Skip to content
This repository has been archived by the owner on Jun 15, 2022. It is now read-only.

Commit

Permalink
Merge branch 'release/3.10.0'
Browse files Browse the repository at this point in the history
vardan-arm committed Feb 3, 2022

Unverified

This user has not yet uploaded their public signing key.
2 parents ac472c5 + 5b0802b commit 9812616
Showing 37 changed files with 1,002 additions and 169 deletions.
2 changes: 2 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -5,5 +5,7 @@ module.exports = {
plugins: ['@typescript-eslint'],
rules: {
'prettier/prettier': 'warn',
'no-shadow': 'off',
'@typescript-eslint/no-shadow': ['error'],
},
};
11 changes: 11 additions & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -43,4 +43,15 @@
</activity>
</application>

<queries>
<intent>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="http"/>
</intent>
<intent>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="https"/>
</intent>
</queries>

</manifest>
10 changes: 8 additions & 2 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -390,6 +390,8 @@ PODS:
- React-Core
- RNStoreReview (0.1.5):
- React
- RNSVG (12.1.1):
- React
- RNVectorIcons (7.1.0):
- React
- RNZipArchive (6.0.2):
@@ -486,6 +488,7 @@ DEPENDENCIES:
- RNScreens (from `../node_modules/react-native-screens`)
- RNSearchBar (from `../node_modules/react-native-search-bar`)
- RNStoreReview (from `../node_modules/react-native-store-review/ios`)
- RNSVG (from `../node_modules/react-native-svg`)
- RNVectorIcons (from `../node_modules/react-native-vector-icons`)
- RNZipArchive (from `../node_modules/react-native-zip-archive`)
- sn-textview (from `../node_modules/sn-textview`)
@@ -620,6 +623,8 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native-search-bar"
RNStoreReview:
:path: "../node_modules/react-native-store-review/ios"
RNSVG:
:path: "../node_modules/react-native-svg"
RNVectorIcons:
:path: "../node_modules/react-native-vector-icons"
RNZipArchive:
@@ -635,7 +640,7 @@ SPEC CHECKSUMS:
boost: a7c83b31436843459a1961bfd74b96033dc77234
BugsnagReactNative: d6988f685aae2de5ecda1f5ca39f03661759d416
CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
DoubleConversion: 831926d9b8bf8166fd87886c4abab286c2422662
DoubleConversion: cf9b38bf0b2d048436d9a82ad2abe1404f11e7de
FBLazyVector: e5569e42a1c79ca00521846c223173a57aca1fe1
FBReactNativeSpec: fe08c1cd7e2e205718d77ad14b34957cce949b58
Flipper: 30e8eeeed6abdc98edaf32af0cda2f198be4b733
@@ -649,7 +654,7 @@ SPEC CHECKSUMS:
FlipperKit: d8d346844eca5d9120c17d441a2f38596e8ed2b9
fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9
GCDWebServer: 2c156a56c8226e2d5c0c3f208a3621ccffbe3ce4
glog: 5337263514dd6f09803962437687240c5dc39aa4
glog: 73c2498ac6884b13ede40eda8228cb1eee9d9d62
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
OpenSSL-Universal: 1aa4f6a6ee7256b83db99ec1ccdaa80d10f9af9b
RCT-Folly: a21c126816d8025b547704b777a2ba552f3d9fa9
@@ -699,6 +704,7 @@ SPEC CHECKSUMS:
RNScreens: 21b73c94c9117e1110a79ee0ee80c93ccefed8ce
RNSearchBar: 5ed8e13ba8a6c701fbd2afdfe4164493d24b2aee
RNStoreReview: 62d6afd7c37db711a594bbffca6b0ea3a812b7a8
RNSVG: 551acb6562324b1d52a4e0758f7ca0ec234e278f
RNVectorIcons: bc69e6a278b14842063605de32bec61f0b251a59
RNZipArchive: 3dd2de5b7f590d79e83270508b78870bf5a54f36
sn-textview: 0211237b3e0edeeb23aed2a9c47b78af35a81e95
4 changes: 2 additions & 2 deletions ios/StandardNotes.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
@@ -732,7 +732,7 @@
COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "";
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "arm64 ";
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
@@ -798,7 +798,7 @@
COPY_PHASE_STRIP = YES;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "";
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "arm64 ";
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
34 changes: 24 additions & 10 deletions metro.config.js
Original file line number Diff line number Diff line change
@@ -2,15 +2,29 @@
* Metro configuration for React Native
* https://github.com/facebook/react-native
*
* And for svg files usage
* https://stackoverflow.com/a/65231261/2504429
* @format
*/
module.exports = {
transformer: {
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: false,
},
}),
},
};
const {getDefaultConfig} = require('metro-config');

module.exports = (async () => {
const {
resolver: {sourceExts, assetExts},
} = await getDefaultConfig();
return {
transformer: {
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: false,
},
}),
babelTransformerPath: require.resolve('react-native-svg-transformer')
},
resolver: {
assetExts: assetExts.filter(ext => ext !== "svg"),
sourceExts: [...sourceExts, "svg"]
},
};
})();
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@
"@react-navigation/native": "^5.9.3",
"@react-navigation/stack": "^5.14.3",
"@standardnotes/sncrypto-common": "1.5.2",
"@standardnotes/snjs": "2.34.0",
"@standardnotes/snjs": "2.45.0",
"js-base64": "^3.5.2",
"moment": "^2.29.1",
"react": "17.0.2",
@@ -48,9 +48,11 @@
"react-native-screens": "3.4.0",
"react-native-search-bar": "standardnotes/react-native-search-bar#7d2139d",
"react-native-search-box": "standardnotes/react-native-search-box#c0de5bab18cb418fef75ef2c2cd921304142e492",
"react-native-sodium": "standardnotes/react-native-sodium#40e51a922e0c20c07ebf4d064b81994b4f3abcff",
"react-native-sodium": "https://github.com/standardnotes/react-native-sodium#40e51a922e0c20c07ebf4d064b81994b4f3abcff",
"react-native-static-server": "standardnotes/react-native-static-server#d0c4cb0feae233634ef26fc33118f258192c7b7d",
"react-native-store-review": "^0.1.5",
"react-native-svg": "^12.1.1",
"react-native-svg-transformer": "^1.0.0",
"react-native-tab-view": "^2.15.2",
"react-native-url-polyfill": "^1.3.0",
"react-native-vector-icons": "^7.1.0",
24 changes: 15 additions & 9 deletions src/AppStack.tsx
Original file line number Diff line number Diff line change
@@ -52,13 +52,13 @@ type AppStackNavigatorParamList = {

export type AppStackNavigationProp<
T extends keyof AppStackNavigatorParamList
> = {
navigation: CompositeNavigationProp<
ModalStackNavigationProp<'AppStack'>['navigation'],
StackNavigationProp<AppStackNavigatorParamList, T>
>;
route: RouteProp<AppStackNavigatorParamList, T>;
};
> = {
navigation: CompositeNavigationProp<
ModalStackNavigationProp<'AppStack'>['navigation'],
StackNavigationProp<AppStackNavigatorParamList, T>
>;
route: RouteProp<AppStackNavigatorParamList, T>;
};

const AppStack = createStackNavigator<AppStackNavigatorParamList>();

@@ -201,10 +201,16 @@ export const AppStackComponent = (
const screenStatus = isInTabletMode
? composeStatus || notesStatus
: notesStatus;

const title = route.params?.title ?? (children || '');
const subtitle = [screenStatus?.status, route.params?.subTitle]
.filter(x => !!x)
.join(' • ');

return (
<HeaderTitleView
title={route.params?.title ?? (children || '')}
subtitle={screenStatus?.status}
title={title}
subtitle={subtitle}
subtitleColor={screenStatus?.color}
/>
);
8 changes: 8 additions & 0 deletions src/components/Icon.styled.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { StyleSheet } from 'react-native';

export const iconStyles = StyleSheet.create({
icon: {
width: 14,
height: 14,
},
});
71 changes: 71 additions & 0 deletions src/components/SnIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import { iconStyles } from '@Components/Icon.styled';
import { IconType } from '@standardnotes/snjs';
import React, { useContext } from 'react';
import { ThemeContext } from 'styled-components';
import ArchiveIcon from '../style/Images/ic-archive.svg';
import AuthenticatorIcon from '../style/Images/ic-authenticator.svg';
import CodeIcon from '../style/Images/ic-code.svg';
import MarkdownIcon from '../style/Images/ic-markdown.svg';
import PencilOffIcon from '../style/Images/ic-pencil-off.svg';
import PinFilledIcon from '../style/Images/ic-pin-filled.svg';
import SpreadsheetsIcon from '../style/Images/ic-spreadsheets.svg';
import TasksIcon from '../style/Images/ic-tasks.svg';
import PlainTextIcon from '../style/Images/ic-text-paragraph.svg';
import RichTextIcon from '../style/Images/ic-text-rich.svg';
import TrashFilledIcon from '../style/Images/ic-trash-filled.svg';

const ICONS = {
'pencil-off': PencilOffIcon,
'plain-text': PlainTextIcon,
'rich-text': RichTextIcon,
code: CodeIcon,
markdown: MarkdownIcon,
spreadsheets: SpreadsheetsIcon,
tasks: TasksIcon,
authenticator: AuthenticatorIcon,
'trash-filled': TrashFilledIcon,
'pin-filled': PinFilledIcon,
archive: ArchiveIcon,
};

export type TEditorIcon = Extract<
IconType,
| 'pencil-off'
| 'plain-text'
| 'rich-text'
| 'code'
| 'markdown'
| 'spreadsheets'
| 'tasks'
| 'authenticator'
| 'trash-filled'
| 'pin-filled'
| 'archive'
>;

type Props = {
type: TEditorIcon;
fill?: string;
styles?: Record<string, unknown>;
};

export const SnIcon = ({ type, fill, styles = {} }: Props) => {
const theme = useContext(ThemeContext);
const fillColor = fill || theme.stylekitPalSky;

const IconComponent = ICONS[type];

if (!IconComponent) {
return null;
}

return (
<IconComponent
fill={fillColor}
style={{
...iconStyles.icon,
...styles,
}}
/>
);
};
4 changes: 4 additions & 0 deletions src/lib/application.ts
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@ import {
ChallengeValidation,
DeinitSource,
Environment,
IconsController,
NoteGroupController,
platformFromString,
SNApplication,
@@ -40,6 +41,7 @@ const IsDev = VersionInfo.bundleIdentifier?.includes('dev');
export class MobileApplication extends SNApplication {
private MobileServices!: MobileServices;
public editorGroup: NoteGroupController;
public iconsController: IconsController;
private startedDeinit: boolean = false;
public Uuid: string; // UI remounts when Uuid changes
static previouslyLaunched: boolean = false;
@@ -69,6 +71,7 @@ export class MobileApplication extends SNApplication {
);
this.Uuid = Math.random().toString();
this.editorGroup = new NoteGroupController(this);
this.iconsController = new IconsController();
this.mobileComponentManager.initialize(this.protocolService);
}

@@ -100,6 +103,7 @@ export class MobileApplication extends SNApplication {
}
this.MobileServices = {} as MobileServices;
this.editorGroup.deinit();
this.iconsController.deinit();
super.deinit(source);
}

1 change: 1 addition & 0 deletions src/lib/preferences_manager.ts
Original file line number Diff line number Diff line change
@@ -15,6 +15,7 @@ export enum PrefKey {
LastExportDate = 'lastExportDate',
DoNotShowAgainUnsupportedEditors = 'doNotShowAgainUnsupportedEditors',
SelectedTagUuid = 'selectedTagUuid',
NotesHideEditorIcon = 'hideEditorIcon',
}

type Preferences = Record<PrefKey, any>;
35 changes: 30 additions & 5 deletions src/screens/Notes/NoteCell.styled.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
import { hexToRGBA } from '@Style/utils';
import { StyleSheet } from 'react-native';
import styled, { css } from 'styled-components/native';

export const TouchableContainer = styled.TouchableWithoutFeedback``;
export const Container = styled.View<{ selected: boolean; padding: number }>`
padding: ${props => props.padding}px;
padding-right: ${props => props.padding * 2}px;
export const Container = styled.View<{ selected: boolean; distance: number }>`
display: flex;
flex-direction: row;
align-items: flex-start;
justify-content: space-between;
padding: ${props => props.distance}px 0 0 ${props => props.distance}px;
background-color: ${({ theme, selected }) =>
selected ? theme.stylekitInfoColor : theme.stylekitBackgroundColor};
`;
export const NoteDataContainer = styled.View<{ distance: number }>`
border-bottom-color: ${({ theme }) =>
hexToRGBA(theme.stylekitBorderColor, 0.75)};
border-bottom-width: 1px;
background-color: ${({ theme, selected }) =>
selected ? theme.stylekitInfoColor : theme.stylekitBackgroundColor};
padding-bottom: ${props => props.distance}px;
flex-grow: 1;
flex-shrink: 1;
padding-right: ${props => props.distance}px;
`;
export const DeletedText = styled.Text`
color: ${({ theme }) => theme.stylekitInfoColor};
@@ -28,6 +38,8 @@ export const TitleText = styled.Text<{ selected: boolean }>`
font-size: 16px;
color: ${({ theme, selected }) =>
selected ? theme.stylekitInfoContrastColor : theme.stylekitForegroundColor};
flex-grow: 1;
flex-shrink: 1;
`;
export const TagsContainter = styled.View`
flex: 1;
@@ -49,3 +61,16 @@ export const DetailsText = styled(TagText)<{ first: boolean }>`
margin-top: 5px;
`}
`;
export const NoteTitleContainer = styled.View`
display: flex;
flex-direction: row;
justify-content: space-between;
`;
export const styles = StyleSheet.create({
editorIcon: {
marginTop: 2,
marginRight: 10,
width: 16,
height: 16,
},
});
Loading

0 comments on commit 9812616

Please sign in to comment.