1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00

Fix build

This commit is contained in:
Laurent Cozic 2020-02-19 00:09:19 +00:00
parent eeb9999334
commit 2fa8e2ff09
15 changed files with 74 additions and 1232 deletions

View File

@ -53,7 +53,7 @@ ReactNativeClient/lib/joplin-renderer/assets/
# Ignore files generated from TypeScript files
ElectronClient/app/gui/ShareNoteDialog.js
ReactNativeClient/lib/JoplinServerApi.js
ReactNativeClient/QuickActions.js
ReactNativeClient/PluginAssetsLoader.js
ReactNativeClient/lib/joplin-renderer/MdToHtml/rules/mermaid.js
ReactNativeClient/lib/joplin-renderer/MdToHtml/rules/sanitize_html.js
ReactNativeClient/lib/joplin-renderer/MdToHtml/rules/sanitize_html.js
ReactNativeClient/setUpQuickActions.js

2
.gitignore vendored
View File

@ -49,7 +49,7 @@ Tools/commit_hook.txt
# Ignore files generated from TypeScript files
ElectronClient/app/gui/ShareNoteDialog.js
ReactNativeClient/lib/JoplinServerApi.js
ReactNativeClient/QuickActions.js
ReactNativeClient/PluginAssetsLoader.js
ReactNativeClient/lib/joplin-renderer/MdToHtml/rules/mermaid.js
ReactNativeClient/lib/joplin-renderer/MdToHtml/rules/sanitize_html.js
ReactNativeClient/setUpQuickActions.js

View File

@ -6952,36 +6952,6 @@
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
"integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
"dev": true
}
}
},
"param-case": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/param-case/-/param-case-2.1.1.tgz",
"integrity": "sha1-35T9jPZTHs915r75oIWPvHK+Ikc=",
"requires": {
"no-case": "^2.2.0"
}
},
"parse-glob": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz",
"integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=",
"dev": true,
"optional": true,
"requires": {
"glob-base": "^0.3.0",
"is-dotfile": "^1.0.0",
"is-extglob": "^1.0.0",
"is-glob": "^2.0.0"
},
"dependencies": {
"is-extglob": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz",
"integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=",
"dev": true,
"optional": true
},
"semver-diff": {
"version": "2.1.0",
@ -7683,8 +7653,7 @@
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz",
"integrity": "sha1-7wiaF40Ug7quTZPrmLT55OEdmQo=",
"dev": true,
"optional": true
"dev": true
},
"repeat-string": {
"version": "1.6.1",

View File

@ -180,8 +180,6 @@ android {
}
dependencies {
implementation project(':react-native-quick-actions')
implementation project(':@react-native-community_slider')
implementation "org.webkit:android-jsc:r241213"
compile project(':react-native-push-notification')
// implementation (project(':react-native-camera')) {

View File

@ -4,9 +4,6 @@ import android.app.Application;
import android.content.Context;
import com.facebook.react.PackageList;
import com.facebook.react.ReactApplication;
import com.reactNativeQuickActions.AppShortcutsPackage;
import com.reactnativecommunity.slider.ReactSliderPackage;
import com.reactnativecommunity.webview.RNCWebViewPackage;
import com.dieam.reactnativepushnotification.ReactNativePushNotificationPackage;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.ReactNativeHost;
@ -19,77 +16,55 @@ import java.util.Arrays;
import java.lang.reflect.InvocationTargetException;
import java.util.List;
import android.database.CursorWindow;
import com.reactNativeQuickActions.AppShortcutsPackage;
public class MainApplication extends Application implements ReactApplication {
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
private final ReactNativeHost mReactNativeHost =
new ReactNativeHost(this) {
@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
@Override
protected List<ReactPackage> getPackages() {
@SuppressWarnings("UnnecessaryLocalVariable")
List<ReactPackage> packages = new PackageList(this).getPackages();
// Packages that cannot be autolinked yet can be added manually here, for example:
// packages.add(new MyReactNativePackage());
return packages;
}
@Override
protected List<ReactPackage> getPackages() {
@SuppressWarnings("UnnecessaryLocalVariable")
List<ReactPackage> packages = new PackageList(this).getPackages();
// Packages that cannot be autolinked yet can be added manually here, for example:
// packages.add(new MyReactNativePackage());
return packages;
}
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new AppShortcutsPackage(),
new ReactSliderPackage(),
new RNCWebViewPackage(),
new ReactNativePushNotificationPackage(),
new ImageResizerPackage(),
new RNFileViewerPackage(),
new RNSecureRandomPackage(),
new ImagePickerPackage(),
new ReactNativeDocumentPicker(),
new RNFetchBlobPackage(),
new RNFSPackage(),
new SQLitePluginPackage(),
new VectorIconsPackage(),
new SharePackage(),
new RNCameraPackage(),
new RNVersionInfoPackage()
);
}
@Override
protected String getJSMainModuleName() {
return "index";
}
};
@Override
protected String getJSMainModuleName() {
return "index";
}
};
@Override
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}
@Override
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}
@Override
public void onCreate() {
super.onCreate();
@Override
public void onCreate() {
super.onCreate();
// To try to fix the error "Row too big to fit into CursorWindow"
// https://github.com/andpor/react-native-sqlite-storage/issues/364#issuecomment-526423153
// https://github.com/laurent22/joplin/issues/1767#issuecomment-515617991
try {
Field field = CursorWindow.class.getDeclaredField("sCursorWindowSize");
// To try to fix the error "Row too big to fit into CursorWindow"
// https://github.com/andpor/react-native-sqlite-storage/issues/364#issuecomment-526423153
// https://github.com/laurent22/joplin/issues/1767#issuecomment-515617991
try {
Field field = CursorWindow.class.getDeclaredField("sCursorWindowSize");
field.setAccessible(true);
field.set(null, 50 * 1024 * 1024); //the 102400 is the new size added
} catch (Exception e) {
e.printStackTrace();
}
} catch (Exception e) {
e.printStackTrace();
}
SoLoader.init(this, /* native exopackage */ false);
initializeFlipper(this); // Remove this line if you don't want Flipper enabled
SoLoader.init(this, /* native exopackage */ false);
initializeFlipper(this); // Remove this line if you don't want Flipper enabled
}
/**
* Loads Flipper in React Native templates.
*

View File

@ -1,22 +1,4 @@
rootProject.name = 'Joplin'
include ':react-native-quick-actions'
project(':react-native-quick-actions').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-quick-actions/android')
include ':@react-native-community_slider'
project(':@react-native-community_slider').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-community/slider/android')
include ':react-native-webview'
project(':react-native-webview').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-webview/android')
include ':react-native-file-viewer'
project(':react-native-file-viewer').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-file-viewer/android')
include ':react-native-securerandom'
project(':react-native-securerandom').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-securerandom/android')
include ':react-native-fs'
project(':react-native-fs').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fs/android')
include ':react-native-image-picker'
project(':react-native-image-picker').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-image-picker/android')
include ':react-native-vector-icons'
project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')
include ':react-native-image-resizer'
project(':react-native-image-resizer').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-image-resizer/android')
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':react-native-fs'
project(':react-native-fs').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fs/android')

File diff suppressed because it is too large Load Diff

View File

@ -17,6 +17,10 @@
@implementation AppDelegate
- (void)application:(UIApplication *)application performActionForShortcutItem:(UIApplicationShortcutItem *)shortcutItem completionHandler:(void (^)(BOOL succeeded)) completionHandler {
[RNQuickActionManager onQuickActionPress:shortcutItem completionHandler:completionHandler];
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
@ -83,8 +87,4 @@ fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler
#endif
}
- (void)application:(UIApplication *)application performActionForShortcutItem:(UIApplicationShortcutItem *)shortcutItem completionHandler:(void (^)(BOOL succeeded)) completionHandler {
[RNQuickActionManager onQuickActionPress:shortcutItem completionHandler:completionHandler];
}
@end

View File

@ -249,6 +249,8 @@ PODS:
- React
- RNFS (2.11.17):
- React
- RNQuickAction (0.3.13):
- React
- RNSecureRandom (1.0.0-rc.0):
- React
- RNVectorIcons (6.6.0):
@ -296,6 +298,7 @@ DEPENDENCIES:
- RNDeviceInfo (from `../node_modules/react-native-device-info`)
- RNFileViewer (from `../node_modules/react-native-file-viewer/ios`)
- RNFS (from `../node_modules/react-native-fs`)
- RNQuickAction (from `../node_modules/react-native-quick-actions`)
- RNSecureRandom (from `../node_modules/react-native-securerandom`)
- RNVectorIcons (from `../node_modules/react-native-vector-icons`)
- Yoga (from `../node_modules/react-native/ReactCommon/yoga`)
@ -379,6 +382,8 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native-file-viewer/ios"
RNFS:
:path: "../node_modules/react-native-fs"
RNQuickAction:
:path: "../node_modules/react-native-quick-actions"
RNSecureRandom:
:path: "../node_modules/react-native-securerandom"
RNVectorIcons:
@ -425,6 +430,7 @@ SPEC CHECKSUMS:
RNDeviceInfo: 6812ed7e578d4344bf4e77102f014b5adf0b5c28
RNFileViewer: 5047ecf40477339723cc08abd55b5ebcefcef4b5
RNFS: 416676c3a9ae404454bade10e3d78147c7c33a40
RNQuickAction: 6d404a869dc872cde841ad3147416a670d13fa93
RNSecureRandom: 1f19ad1492f7ed416b8fc79e92216a1f73f13a4c
RNVectorIcons: 0bb4def82230be1333ddaeee9fcba45f0b288ed4
Yoga: f2a7cd4280bfe2cca5a7aed98ba0eb3d1310f18b

View File

@ -131,8 +131,7 @@ class NoteScreenComponent extends BaseScreenComponent {
if (item.type_ === BaseModel.TYPE_NOTE) {
// Easier to just go back, then go to the note since
// the Note screen doesn't handle reloading a different note.
// Similar to creating a new note via QuickActions.
// the Note screen doesn't handle reloading a different note
this.props.dispatch({
type: 'NAV_BACK',
@ -759,8 +758,8 @@ class NoteScreenComponent extends BaseScreenComponent {
let fieldToFocus = this.state.note.is_todo ? 'title' : 'body';
if (this.state.mode === 'view') fieldToFocus = '';
if (fieldToFocus === 'title') this.refs.titleTextField.focus();
if (fieldToFocus === 'body') this.refs.noteBodyTextField.focus();
if (fieldToFocus === 'title' && this.refs.titleTextField) this.refs.titleTextField.focus();
if (fieldToFocus === 'body' && this.refs.noteBodyTextField) this.refs.noteBodyTextField.focus();
}
async folderPickerOptions_valueChanged(itemValue) {

View File

@ -41,8 +41,10 @@
"markdown-it-sup": "^1.0.0",
"markdown-it-toc-done-right": "^4.1.0",
"md5": "^2.2.1",
"memory-cache": "^0.2.0",
"mermaid": "^8.4.6",
"moment": "^2.24.0",
"node-html-parser": "^1.2.4",
"prop-types": "^15.6.0",
"punycode": "^2.1.1",
"query-string": "4.3.4",
@ -66,7 +68,6 @@
"react-native-popup-menu": "^0.10.0",
"react-native-push-notification": "git+https://github.com/laurent22/react-native-push-notification.git",
"react-native-quick-actions": "^0.3.13",
"react-native-share-extension": "^1.2.1",
"react-native-securerandom": "^1.0.0-rc.0",
"react-native-side-menu": "^1.1.3",
"react-native-sqlite-storage": "^4.1.0",
@ -74,8 +75,6 @@
"react-native-version-info": "^0.5.1",
"react-native-webview": "^5.12.0",
"react-redux": "5.0.7",
"memory-cache": "^0.2.0",
"node-html-parser": "^1.2.4",
"redux": "4.0.0",
"reselect": "^4.0.0",
"rn-fetch-blob": "^0.12.0",

View File

@ -81,8 +81,8 @@ const DecryptionWorker = require('lib/services/DecryptionWorker');
const EncryptionService = require('lib/services/EncryptionService');
const MigrationService = require('lib/services/MigrationService');
import setUpQuickActions from './setUpQuickActions';
import PluginAssetsLoader from './PluginAssetsLoader';
import setUpQuickActions from './QuickActions';
let storeDispatch = function() {};
@ -216,9 +216,9 @@ const appReducer = (state = appDefaultState, action) => {
const currentRoute = state.route;
if (!historyGoingBack && historyCanGoBackTo(currentRoute, action)) {
// If the route *name* is the same (even if the other parameters are different), we
// overwrite the last route in the history with the current one. If the route name
// is different, we push a new history entry.
// If the route *name* is the same (even if the other parameters are different), we
// overwrite the last route in the history with the current one. If the route name
// is different, we push a new history entry.
if (currentRoute.routeName == action.routeName) {
// nothing
} else {

View File

@ -1,5 +1,4 @@
import {DeviceEventEmitter} from 'react-native';
import { DeviceEventEmitter } from 'react-native';
import * as QuickActions from 'react-native-quick-actions';
const { _ } = require('lib/locale.js');
@ -10,8 +9,8 @@ type TData = {
export default (dispatch: Function, folderId: string) => {
const userInfo = { url: '' };
QuickActions.setShortcutItems([
{type: 'New note', title: _('New note'), icon: 'Compose', userInfo},
{type: 'New to-do', title: _('New to-do'), icon: 'Add', userInfo},
{ type: 'New note', title: _('New note'), icon: 'Compose', userInfo },
{ type: 'New to-do', title: _('New to-do'), icon: 'Add', userInfo },
]);
DeviceEventEmitter.addListener('quickActionShortcut', (data: TData) => {
@ -25,7 +24,7 @@ export default (dispatch: Function, folderId: string) => {
// page to that first note you made rather than creating an entirely new
// note. If you navigate around enough (which I think changes the redux
// state sufficiently or something), then it'll work again.
dispatch({type: 'NAV_BACK'});
dispatch({ type: 'NAV_BACK' });
if (data.type === 'New note') {
dispatch({

14
package-lock.json generated
View File

@ -109,12 +109,14 @@
"@types/prop-types": {
"version": "15.7.3",
"resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.3.tgz",
"integrity": "sha512-KfRL3PuHmqQLOG+2tGpRO26Ctg+Cq1E01D2DMriKEATHgWLfeNDmq9e29Q9WIky0dQ3NPkd1mzYH8Lm936Z9qw=="
"integrity": "sha512-KfRL3PuHmqQLOG+2tGpRO26Ctg+Cq1E01D2DMriKEATHgWLfeNDmq9e29Q9WIky0dQ3NPkd1mzYH8Lm936Z9qw==",
"dev": true
},
"@types/react": {
"version": "16.9.16",
"resolved": "https://registry.npmjs.org/@types/react/-/react-16.9.16.tgz",
"integrity": "sha512-dQ3wlehuBbYlfvRXfF5G+5TbZF3xqgkikK7DWAsQXe2KnzV+kjD4W2ea+ThCrKASZn9h98bjjPzoTYzfRqyBkw==",
"dev": true,
"requires": {
"@types/prop-types": "*",
"csstype": "^2.2.0"
@ -130,9 +132,10 @@
}
},
"@types/react-native": {
"version": "0.61.4",
"resolved": "https://registry.npmjs.org/@types/react-native/-/react-native-0.61.4.tgz",
"integrity": "sha512-RWU51dCIEjvgT0QuclgAha/P9fdAvnDzilhatx85LcTKTH2S3PSOUNZlbxwyZLMrqpCek5xsBOjSA5nOIFYq4A==",
"version": "0.61.15",
"resolved": "https://registry.npmjs.org/@types/react-native/-/react-native-0.61.15.tgz",
"integrity": "sha512-+lOUYk3yOfpyMy2HcVbR5bZnbExiVahMr3AqWNPh/01N0quH7nBzlou+/rpbvmDXSGwCh3QjWWfEkLNRfvbiiA==",
"dev": true,
"requires": {
"@types/react": "*"
}
@ -599,7 +602,8 @@
"csstype": {
"version": "2.6.7",
"resolved": "https://registry.npmjs.org/csstype/-/csstype-2.6.7.tgz",
"integrity": "sha512-9Mcn9sFbGBAdmimWb2gLVDtFJzeKtDGIr76TUqmjZrw9LFXBMSU70lcs+C0/7fyCd6iBDqmksUcCOUIkisPHsQ=="
"integrity": "sha512-9Mcn9sFbGBAdmimWb2gLVDtFJzeKtDGIr76TUqmjZrw9LFXBMSU70lcs+C0/7fyCd6iBDqmksUcCOUIkisPHsQ==",
"dev": true
},
"date-fns": {
"version": "1.30.1",

View File

@ -28,6 +28,7 @@
"devDependencies": {
"@types/react": "^16.9.16",
"@types/react-dom": "^16.9.4",
"@types/react-native": "^0.61.15",
"@typescript-eslint/eslint-plugin": "^2.10.0",
"@typescript-eslint/parser": "^2.10.0",
"eslint": "^6.1.0",
@ -35,9 +36,5 @@
"husky": "^3.0.2",
"lint-staged": "^9.2.1",
"typescript": "^3.7.3"
},
"dependencies": {
"@types/react-native": "^0.61.4",
"joplin-renderer": "^1.0.6"
}
}