1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-11-19 20:31:46 +02:00

Merge branch 'release-3.1' into dev

This commit is contained in:
Laurent Cozic 2024-11-09 13:41:37 +00:00
commit 551bcc68cf
14 changed files with 81 additions and 41 deletions

View File

@ -23,6 +23,7 @@ import Resource from '@joplin/lib/models/Resource';
import { NoteEntity, ResourceEntity } from '@joplin/lib/services/database/types';
import Dialog from '../gui/Dialog';
import AsyncActionQueue from '@joplin/lib/AsyncActionQueue';
import { htmlentities } from '@joplin/utils/html';
const logger = Logger.create('GotoAnything');
@ -555,7 +556,7 @@ class DialogComponent extends React.PureComponent<Props, State> {
};
const titleHtml = item.fragments
? `<span style="font-weight: bold; color: ${theme.color};">${item.title}</span>`
? `<span style="font-weight: bold; color: ${theme.color};">${htmlentities(item.title)}</span>`
: wrapKeywordMatches(item.title);
const fragmentsHtml = !item.fragments ? null : wrapKeywordMatches(item.fragments);

View File

@ -79,7 +79,7 @@ android {
applicationId "net.cozic.joplin"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 2097755
versionCode 2097756
versionName "3.2.0"
ndk {
abiFilters "armeabi-v7a", "x86", "arm64-v8a", "x86_64"

View File

@ -3,7 +3,7 @@ import { useState, useCallback, useMemo } from 'react';
import { FAB, Portal } from 'react-native-paper';
import { _ } from '@joplin/lib/locale';
import { Dispatch } from 'redux';
import { Platform, useWindowDimensions, View } from 'react-native';
import { Platform, View, ViewStyle } from 'react-native';
import shim from '@joplin/lib/shim';
import AccessibleWebMenu from '../accessibility/AccessibleModalMenu';
const Icon = require('react-native-vector-icons/Ionicons').default;
@ -71,10 +71,22 @@ const FloatingActionButton = (props: ActionButtonProps) => {
// is disabled.
//
// See https://github.com/callstack/react-native-paper/issues/4064
const windowSize = useWindowDimensions();
// May be possible to remove if https://github.com/callstack/react-native-paper/pull/4514
// is merged.
const adjustMargins = !open && shim.mobilePlatform() === 'android';
const marginTop = adjustMargins ? Math.max(0, windowSize.height - 140) : undefined;
const marginStart = adjustMargins ? Math.max(0, windowSize.width - 200) : undefined;
const marginStyles = useMemo((): ViewStyle => {
if (!adjustMargins) {
return {};
}
// Internally, React Native Paper uses absolute positioning to make its
// (usually invisible) view fill the screen. Setting top and left to
// undefined causes the view to take up only part of the screen.
return {
top: undefined,
left: undefined,
};
}, [adjustMargins]);
const label = props.mainButton?.label ?? _('Add new');
@ -92,7 +104,7 @@ const FloatingActionButton = (props: ActionButtonProps) => {
const menuContent = <FAB.Group
open={open}
accessibilityLabel={label}
style={{ marginStart, marginTop }}
style={marginStyles}
icon={ open ? openIcon : closedIcon }
fabStyle={{
backgroundColor: props.mainButton?.color ?? 'rgba(231,76,60,1)',

View File

@ -245,14 +245,14 @@ class NoteScreenComponent extends BaseScreenComponent<Props, State> implements B
}
if (this.state.fromShare) {
// effectively the same as NAV_BACK but NAV_BACK causes undesired behaviour in this case:
// Note: In the past, NAV_BACK caused undesired behaviour in this case:
// - share to Joplin from some other app
// - open Joplin and open any note
// - go back -- with NAV_BACK this causes the app to exit rather than just showing notes
// This no longer seems to happen, but this case should be checked when adjusting navigation
// history behavior.
this.props.dispatch({
type: 'NAV_GO',
routeName: 'Notes',
folderId: this.state.note.parent_id,
type: 'NAV_BACK',
});
ShareExtension.close();

View File

@ -551,7 +551,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Joplin/Joplin.entitlements;
CURRENT_PROJECT_VERSION = 127;
CURRENT_PROJECT_VERSION = 128;
DEVELOPMENT_TEAM = A9BXAFS6CT;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Joplin/Info.plist;
@ -583,7 +583,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Joplin/Joplin.entitlements;
CURRENT_PROJECT_VERSION = 127;
CURRENT_PROJECT_VERSION = 128;
DEVELOPMENT_TEAM = A9BXAFS6CT;
INFOPLIST_FILE = Joplin/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.4;
@ -774,7 +774,7 @@
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_ENTITLEMENTS = ShareExtension/ShareExtension.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 127;
CURRENT_PROJECT_VERSION = 128;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = A9BXAFS6CT;
GCC_C_LANGUAGE_STANDARD = gnu11;
@ -813,7 +813,7 @@
CODE_SIGN_ENTITLEMENTS = ShareExtension/ShareExtension.entitlements;
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 127;
CURRENT_PROJECT_VERSION = 128;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = A9BXAFS6CT;
GCC_C_LANGUAGE_STANDARD = gnu11;

View File

@ -109,6 +109,7 @@
"babel-loader": "9.1.3",
"babel-plugin-module-resolver": "4.1.0",
"babel-plugin-react-native-web": "0.19.12",
"fast-deep-equal": "3.1.3",
"fs-extra": "11.2.0",
"gulp": "4.0.2",
"jest": "29.7.0",

View File

@ -35,6 +35,7 @@ const DropdownAlert = require('react-native-dropdownalert').default;
const AlarmServiceDriver = require('./services/AlarmServiceDriver').default;
const SafeAreaView = require('./components/SafeAreaView');
const { connect, Provider } = require('react-redux');
import fastDeepEqual = require('fast-deep-equal');
import { Provider as PaperProvider, MD3DarkTheme, MD3LightTheme } from 'react-native-paper';
import BackButtonService from './services/BackButtonService';
import NavService from '@joplin/lib/services/NavService';
@ -88,6 +89,8 @@ import JoplinCloudLoginScreen from './components/screens/JoplinCloudLoginScreen'
import SyncTargetNone from '@joplin/lib/SyncTargetNone';
SyncTargetRegistry.addClass(SyncTargetNone);
SyncTargetRegistry.addClass(SyncTargetOneDrive);
SyncTargetRegistry.addClass(SyncTargetNextcloud);
@ -301,7 +304,18 @@ const appReducer = (state = appDefaultState, action: any) => {
const currentRoute = state.route;
if (!historyGoingBack && historyCanGoBackTo(currentRoute)) {
navHistory.push(currentRoute);
const previousRoute = navHistory.length && navHistory[navHistory.length - 1];
const isDifferentRoute = !previousRoute || !fastDeepEqual(navHistory[navHistory.length - 1], currentRoute);
// Avoid multiple consecutive duplicate screens in the navigation history -- these can make
// pressing "back" seem to have no effect.
if (isDifferentRoute) {
navHistory.push(currentRoute);
}
}
if (action.clearHistory) {
navHistory.splice(0, navHistory.length);
}
newState = { ...state };

View File

@ -3,6 +3,7 @@ import shim from '@joplin/lib/shim';
import Note from '@joplin/lib/models/Note';
import checkPermissions from './checkPermissions.js';
import NavService from '@joplin/lib/services/NavService';
const { ToastAndroid } = require('react-native');
const { PermissionsAndroid } = require('react-native');
const { Platform } = require('react-native');
@ -27,27 +28,21 @@ export default async (sharedData: SharedData, folderId: string, dispatch: Functi
}
}
const newNote = await Note.save({
parent_id: folderId,
}, { provisional: true });
// This is a bit hacky, but the surest way to go to
// the needed note. We go back one screen in case there's
// already a note open - if we don't do this, the dispatch
// below will do nothing (because routeName wouldn't change)
// Then we wait a bit for the state to be set correctly, and
// finally we go to the new note.
dispatch({ type: 'NAV_BACK' });
await NavService.go('Notes', { folderId, clearHistory: true });
dispatch({ type: 'SIDE_MENU_CLOSE' });
const newNote = await Note.save({
parent_id: folderId,
}, { provisional: true });
shim.setTimeout(() => {
dispatch({
type: 'NAV_GO',
routeName: 'Note',
noteId: newNote.id,
sharedData: sharedData,
});
shim.setTimeout(async () => {
await NavService.go('Note', { noteId: newNote.id, sharedData });
ShareExtension.close();
}, 5);

View File

@ -37,9 +37,7 @@ const configFromSettings = (settings: EditorSettings) => {
htmlTagLanguage: html({ matchClosingTags: false, autoCloseTags: false }),
}),
}),
markdownLanguage.data.of({
closeBrackets: openingBrackets,
}),
markdownLanguage.data.of({ closeBrackets: { brackets: openingBrackets } }),
];
} else if (language === EditorLanguageType.Html) {
return html({ autoCloseTags: settings.autocompleteMarkup });

View File

@ -387,7 +387,7 @@ describe('models/Note', () => {
expect(conflictedNote.conflict_original_id).toBe(origNote.id);
expect(conflictedNote.parent_id).toBe(folder.id);
expect(conflictedNote.is_shared).toBeUndefined();
expect(conflictedNote.share_id).toBeUndefined();
expect(conflictedNote.share_id).toBe('');
});
it('should copy conflicted note to target folder and cancel conflict', (async () => {

View File

@ -830,9 +830,15 @@ export default class Note extends BaseItem {
});
if (dispatchUpdateAction) {
// The UI requires share_id -- if a new note, it will always be the empty string in the database
// until processed by the share service. At present, loading savedNote from the database in this case
// breaks tests.
if (!('share_id' in savedNote) && isNew) {
savedNote.share_id = '';
}
// Ensures that any note added to the state has all the required
// properties for the UI to work.
if (!('deleted_time' in savedNote)) {
if (!('deleted_time' in savedNote) || !('share_id' in savedNote)) {
const fields = removeElement(unique(this.previewFields().concat(Object.keys(savedNote))), 'type_');
savedNote = await this.load(savedNote.id, {
fields,

View File

@ -1,5 +1,11 @@
# Joplin Android Changelog
## [android-v3.1.8](https://github.com/laurent22/joplin/releases/tag/android-v3.1.8) (Pre-release) - 2024-11-09T13:02:33Z
- Fixed: Fix error on creating new notes if the user is a share recipient (#11326) (#11325 by [@personalizedrefrigerator](https://github.com/personalizedrefrigerator))
- Fixed: Fix new note button is pushed off-screen on certain Android devices (#11323) (#11276 by [@personalizedrefrigerator](https://github.com/personalizedrefrigerator))
- Fixed: Fix sharing to Joplin causes back navigation to get stuck (#11355) (#11324 by [@personalizedrefrigerator](https://github.com/personalizedrefrigerator))
## [android-v3.1.7](https://github.com/laurent22/joplin/releases/tag/android-v3.1.7) (Pre-release) - 2024-11-04T20:27:52Z
- Fixed: Fix search result note hidden after powering on device (#11297) (#11197 by [@personalizedrefrigerator](https://github.com/personalizedrefrigerator))

View File

@ -1,5 +1,11 @@
# Joplin iOS Changelog
## [ios-v13.1.7](https://github.com/laurent22/joplin/releases/tag/ios-v13.1.7) - 2024-11-09T13:05:12Z
- Fixed: Fix error on creating new notes if the user is a share recipient (#11326) (#11325 by [@personalizedrefrigerator](https://github.com/personalizedrefrigerator))
- Fixed: Fix new note button is pushed off-screen on certain Android devices (#11323) (#11276 by [@personalizedrefrigerator](https://github.com/personalizedrefrigerator))
- Fixed: Fix search result note hidden after powering on device (#11297) (#11197 by [@personalizedrefrigerator](https://github.com/personalizedrefrigerator))
## [ios-v13.1.6](https://github.com/laurent22/joplin/releases/tag/ios-v13.1.6) - 2024-10-17T22:16:20Z
- Improved: Added feature flag to disable sync lock support (#10925) (#10407)

View File

@ -8307,6 +8307,7 @@ __metadata:
events: 3.3.0
expo: 51.0.26
expo-camera: 15.0.16
fast-deep-equal: 3.1.3
fs-extra: 11.2.0
gulp: 4.0.2
jest: 29.7.0
@ -42980,6 +42981,13 @@ __metadata:
languageName: node
linkType: hard
"source-map-js@npm:^1.0.1, source-map-js@npm:^1.2.1":
version: 1.2.1
resolution: "source-map-js@npm:1.2.1"
checksum: 4eb0cd997cdf228bc253bcaff9340afeb706176e64868ecd20efbe6efea931465f43955612346d6b7318789e5265bdc419bc7669c1cebe3db0eb255f57efa76b
languageName: node
linkType: hard
"source-map-js@npm:^1.2.0":
version: 1.2.0
resolution: "source-map-js@npm:1.2.0"
@ -42987,13 +42995,6 @@ __metadata:
languageName: node
linkType: hard
"source-map-js@npm:^1.2.1":
version: 1.2.1
resolution: "source-map-js@npm:1.2.1"
checksum: 4eb0cd997cdf228bc253bcaff9340afeb706176e64868ecd20efbe6efea931465f43955612346d6b7318789e5265bdc419bc7669c1cebe3db0eb255f57efa76b
languageName: node
linkType: hard
"source-map-loader@npm:5.0.0":
version: 5.0.0
resolution: "source-map-loader@npm:5.0.0"