Skip to content

Commit

Permalink
Release 2.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
PSPDFKit committed Apr 3, 2023
1 parent c476007 commit a4d8c3a
Show file tree
Hide file tree
Showing 58 changed files with 2,059 additions and 1,759 deletions.
18 changes: 15 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
module.exports = {
root: true,
extends: '@react-native-community',
extends: [
'eslint:recommended',
'plugin:react/recommended',
'@react-native-community',
],
plugins: ['simple-import-sort'],
parserOptions: {
ecmaVersion: 12,
parser: '@babel/eslint-parser',
requireConfigFile: false,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
rules: {
'react/no-string-refs': 'off',
'no-alert': 'off',
'react/no-string-refs': 0,
'no-alert': 0,
'simple-import-sort/imports': 2,
},
};
1 change: 0 additions & 1 deletion .tool-versions

This file was deleted.

13 changes: 11 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
## Newest Release

### 2.5.1 - 03 Apr 2023
- Updated NativeCatalog configuration and replaced deprecated AppDelegate.m
- Bumps PSPDFKit for Android version to 8.6.0

## Previous Releases

### 2.5.0 - 23 Mar 2023
- Added magic ink tool for Android annotation toolbar configuration. (#39174)
- Upgrades React Native dependencies and project configuration to 0.71.2
- Adds Instant JSON for React Native
- Updates for PSPDFKit for Android 8.5.1
- Updates for PSPDFKit for iOS 12.1.3
- PSPDFKit now requires React Native 0.71.0 or later.

### 2.4.2 - 01 Feb 2023
- Fixes bug issue for deleting multiple annotations (#38518)
- Bump PSPDFKit for Android version to 8.5.0
- Bump PSPDFKit for iOS version to 12.0.3
- Bump minimum SDK version compileSdkVersion to API 33

## Previous Releases

### 2.4.1 - 22 Nov 2022
- Updates for PSPDFKit 12.0.1 for iOS.
- Fixes Catalog example toolbar menu items not rendering. (#37368)
Expand Down
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* Contains gradle configuration constants
*/
ext {
PSPDFKIT_VERSION = 'SNAPSHOT'
PSPDFKIT_VERSION = '8.6.0'
}

buildscript {
Expand All @@ -38,7 +38,7 @@ apply plugin: 'com.android.library'

android {
compileSdkVersion 33
buildToolsVersion "30.0.2"
buildToolsVersion "30.0.3"

defaultConfig {
minSdkVersion 21
Expand Down
3 changes: 3 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
};
18 changes: 8 additions & 10 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ class PSPDFKitView extends React.Component {
}
: null;
return (
// eslint-disable-next-line react/jsx-no-undef
<RCTPSPDFKitView
ref="pdfView"
fragmentTag="PSPDFKitView.FragmentTag"
Expand Down Expand Up @@ -267,7 +266,7 @@ class PSPDFKitView extends React.Component {
}
};

removeAnnotations = function(annotations) {
removeAnnotations = function (annotations) {
if (Platform.OS === 'android') {
let requestId = this._nextRequestId++;
let requestMap = this._requestMap;
Expand All @@ -277,20 +276,20 @@ class PSPDFKitView extends React.Component {
});

UIManager.dispatchViewManagerCommand(
findNodeHandle(this.refs.pdfView),
this._getViewManagerConfig('RCTPSPDFKitView').Commands.removeAnnotations,
[requestId, annotations],
findNodeHandle(this.refs.pdfView),
this._getViewManagerConfig('RCTPSPDFKitView').Commands
.removeAnnotations,
[requestId, annotations],
);

return promise;
} else if (Platform.OS === 'ios') {
return NativeModules.PSPDFKitViewManager.removeAnnotations(
annotations,
findNodeHandle(this.refs.pdfView),
annotations,
findNodeHandle(this.refs.pdfView),
);
}
}

};

/**
* Gets all unsaved changes to annotations.
Expand Down Expand Up @@ -756,7 +755,6 @@ PSPDFKitView.propTypes = {
};

if (Platform.OS === 'ios' || Platform.OS === 'android') {
// eslint-disable-next-line no-unused-vars
var RCTPSPDFKitView = requireNativeComponent(
'RCTPSPDFKitView',
PSPDFKitView,
Expand Down
42 changes: 22 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-pspdfkit",
"version": "2.4.2",
"version": "2.5.1",
"description": "React Native PDF Library by PSPDFKit",
"keywords": [
"react native",
Expand All @@ -22,33 +22,35 @@
"lint": "eslint --ext .js,.jsx,.ts,.tsx ./*.js"
},
"peerDependencies": {
"prop-types": "^15.8.1",
"react": "18.2.0",
"react-native": "^0.71.1",
"cacheable-request": "^10.2.7",
"decode-uri-component": "^0.2.1",
"http-cache-semantics": "^4.1.1",
"ua-parser-js": "^1.0.33",
"json5": "^2.2.2",
"minimatch": "^3.0.5",
"decode-uri-component": "^0.2.1"
"prop-types": "^15.8.1",
"react": "18.2.0",
"react-native": "^0.71.1",
"ua-parser-js": "^1.0.33"
},
"devDependencies": {
"@babel/core": "^7.19.6",
"@babel/runtime": "^7.19.4",
"@react-native-community/eslint-config": "^3.1.0",
"babel-jest": "^29.2.2",
"eslint": "^8.26.0",
"jest": "^29.2.2",
"metro-react-native-babel-preset": "^0.73.2",
"react-native-codegen": "^0.70.6",
"prettier": "^2.7.1",
"eslint-plugin-ft-flow":"^2.0.1",
"@tsconfig/react-native": "^2.0.2",
"@types/jest": "^29.2.1",
"@types/react": "^18.0.24",
"@babel/core": "^7.21.4",
"@babel/eslint-parser": "^7.21.3",
"@babel/runtime": "^7.21.0",
"@react-native-community/eslint-config": "^3.2.0",
"@tsconfig/react-native": "^2.0.3",
"@types/jest": "^29.5.0",
"@types/react": "^18.0.33",
"@types/react-test-renderer": "^18.0.0",
"babel-jest": "^29.5.0",
"eslint": "^8.37.0",
"eslint-plugin-ft-flow": "^2.0.3",
"eslint-plugin-simple-import-sort": "^10.0.0",
"jest": "^29.5.0",
"metro-react-native-babel-preset": "^0.76.1",
"prettier": "^2.8.7",
"react-native-codegen": "^0.71.5",
"react-test-renderer": "18.2.0",
"typescript": "4.8.4"
"typescript": "5.0.3"
},
"jest": {
"preset": "react-native",
Expand Down
26 changes: 13 additions & 13 deletions samples/Catalog/Catalog.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,27 @@
//

// Imports
import React, { Component } from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
import React, { Component } from 'react';

import { PSPDFKitViewComponent } from './examples/PSPDFKitViewComponent';
import { OpenImageDocument } from './examples/OpenImageDocument';
import { SaveAs } from './examples/SaveAs';
import { ManualSave } from './examples/ManualSave';
import { EventListeners } from './examples/EventListeners';
import { StateChange } from './examples/StateChange';
import { AnnotationProcessing } from './examples/AnnotationProcessing';
import { ProgrammaticAnnotations } from './examples/ProgrammaticAnnotations';
import { ProgrammaticFormFilling } from './examples/ProgrammaticFormFilling';
import { SplitPDF } from './examples/SplitPDF';
import { ToolbarCustomization } from './examples/ToolbarCustomization';
import { HiddenToolbar } from './examples/HiddenToolbar';
import { CustomFontPicker } from './examples/CustomFontPicker';
import { EventListeners } from './examples/EventListeners';
import { GeneratePDF } from './examples/GeneratePDF';
import HomeScreen from './examples/HomeScreen';
import GeneratePDFMenu from './examples/GeneratePDFMenu';
import { HiddenToolbar } from './examples/HiddenToolbar';
import HomeScreen from './examples/HomeScreen';
import InstantSynchronization from './examples/InstantSynchronization';
import { ManualSave } from './examples/ManualSave';
import { OpenImageDocument } from './examples/OpenImageDocument';
import { ProgrammaticAnnotations } from './examples/ProgrammaticAnnotations';
import { ProgrammaticFormFilling } from './examples/ProgrammaticFormFilling';
import { PSPDFKitViewComponent } from './examples/PSPDFKitViewComponent';
import { SaveAs } from './examples/SaveAs';
import { SplitPDF } from './examples/SplitPDF';
import { StateChange } from './examples/StateChange';
import { ToolbarCustomization } from './examples/ToolbarCustomization';
import { PSPDFKit } from './helpers/PSPDFKit';

// By default, this example doesn't set a license key, but instead runs in trial mode (which is the default, and which requires no
Expand Down
7 changes: 4 additions & 3 deletions samples/Catalog/ExamplesNavigationMenu.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { NativeModules, Platform } from 'react-native';
import { extractFromAssetsIfMissing } from './helpers/FileSystemHelpers';

import {
exampleDocumentName,
exampleDocumentPath,
tiffImagePath,
exampleImagePath,
tiffImagePath,
} from './configuration/Constants';
import { PSPDFKit } from './helpers/PSPDFKit';
import exampleDocumentConfiguration, {
tiffImageConfiguration,
} from './helpers/ExampleDocumentConfiguration';
Expand All @@ -16,7 +15,9 @@ import {
fileExists,
getOutputPath,
} from './helpers/FileHelper';
import { extractFromAssetsIfMissing } from './helpers/FileSystemHelpers';
import { getMainBundlePath } from './helpers/ImageHelper';
import { PSPDFKit } from './helpers/PSPDFKit';

const { RNProcessor: Processor } = NativeModules;

Expand Down
25 changes: 13 additions & 12 deletions samples/Catalog/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.pspdfkit.rn">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.INTERNET" />

<application
android:name=".MainApplication"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:allowBackup="false"
android:theme="@style/AppTheme">
android:name=".MainApplication"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:allowBackup="false"
android:theme="@style/AppTheme"
>
<activity
android:name=".MainActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
android:launchMode="singleTask"
android:windowSoftInputMode="adjustResize"
android:exported="true">
android:name=".MainActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
android:launchMode="singleTask"
android:windowSoftInputMode="adjustResize"
android:exported="true"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
Expand Down
5 changes: 4 additions & 1 deletion samples/Catalog/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ buildscript {

// We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.
ndkVersion = "23.1.7779620"
kotlin_version = '1.8.0'
kotlin_version = '1.8.10'
}
repositories {
google()
Expand All @@ -30,6 +30,9 @@ buildscript {

allprojects {
repositories {
google()
mavenLocal()
mavenCentral()
maven {
url 'https://customers.pspdfkit.com/maven/'
}
Expand Down
2 changes: 1 addition & 1 deletion samples/Catalog/configuration/Constants.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Document names
import fileSystem from 'react-native-fs';
import { Platform } from 'react-native';
import fileSystem from 'react-native-fs';

const tiffImageName = 'PSPDFKit_Image_Example.tiff';
const formDocumentName = 'Form_example.pdf';
Expand Down
9 changes: 5 additions & 4 deletions samples/Catalog/examples/AnnotationProcessing.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import { BaseExampleAutoHidingHeaderComponent } from '../helpers/BaseExampleAutoHidingHeaderComponent';
import React from 'react';
import { Button, processColor, View } from 'react-native';
import fileSystem from 'react-native-fs';
import PSPDFKitView from 'react-native-pspdfkit';

import {
pspdfkitColor,
writableDocumentPath,
} from '../configuration/Constants';
import fileSystem from 'react-native-fs';
import { PSPDFKit } from '../helpers/PSPDFKit';
import React from 'react';
import { BaseExampleAutoHidingHeaderComponent } from '../helpers/BaseExampleAutoHidingHeaderComponent';
import { hideToolbar } from '../helpers/NavigationHelper';
import { PSPDFKit } from '../helpers/PSPDFKit';

export class AnnotationProcessing extends BaseExampleAutoHidingHeaderComponent {
pdfRef = null;
Expand Down
5 changes: 3 additions & 2 deletions samples/Catalog/examples/CustomFontPicker.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { BaseExampleAutoHidingHeaderComponent } from '../helpers/BaseExampleAutoHidingHeaderComponent';
import React from 'react';
import { processColor, View } from 'react-native';
import PSPDFKitView from 'react-native-pspdfkit';

import { exampleDocumentPath, pspdfkitColor } from '../configuration/Constants';
import React from 'react';
import { BaseExampleAutoHidingHeaderComponent } from '../helpers/BaseExampleAutoHidingHeaderComponent';
import { hideToolbar } from '../helpers/NavigationHelper';

export class CustomFontPicker extends BaseExampleAutoHidingHeaderComponent {
Expand Down
5 changes: 3 additions & 2 deletions samples/Catalog/examples/EventListeners.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { BaseExampleAutoHidingHeaderComponent } from '../helpers/BaseExampleAutoHidingHeaderComponent';
import React from 'react';
import { processColor, View } from 'react-native';
import PSPDFKitView from 'react-native-pspdfkit';

import { exampleDocumentPath, pspdfkitColor } from '../configuration/Constants';
import React from 'react';
import { BaseExampleAutoHidingHeaderComponent } from '../helpers/BaseExampleAutoHidingHeaderComponent';
import { hideToolbar } from '../helpers/NavigationHelper';

export class EventListeners extends BaseExampleAutoHidingHeaderComponent {
Expand Down
3 changes: 2 additions & 1 deletion samples/Catalog/examples/GeneratePDF.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import React from 'react';
import { BaseExampleAutoHidingHeaderComponent } from '../helpers/BaseExampleAutoHidingHeaderComponent';
import { processColor, View } from 'react-native';
import PSPDFKitView from 'react-native-pspdfkit';

import { pspdfkitColor } from '../configuration/Constants';
import { BaseExampleAutoHidingHeaderComponent } from '../helpers/BaseExampleAutoHidingHeaderComponent';

export class GeneratePDF extends BaseExampleAutoHidingHeaderComponent {
pdfRef = null;
Expand Down
3 changes: 2 additions & 1 deletion samples/Catalog/examples/GeneratePDFMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ import {
TouchableHighlight,
View,
} from 'react-native';

import { pspdfkitColor } from '../configuration/Constants';

const PSPDFKit = NativeModules.PSPDFKit;
import styles from '../styles/styles';
import { generatePDFMenu } from '../ExamplesNavigationMenu';
import styles from '../styles/styles';

class GeneratePDFMenu extends Component {
render() {
Expand Down
1 change: 1 addition & 0 deletions samples/Catalog/examples/HiddenToolbar.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { Component } from 'react';
import { Button, processColor, View } from 'react-native';
import PSPDFKitView from 'react-native-pspdfkit';

import { exampleDocumentPath, pspdfkitColor } from '../configuration/Constants';

export class HiddenToolbar extends Component {
Expand Down
Loading

0 comments on commit a4d8c3a

Please sign in to comment.