Skip to content

Commit 1f70698

Browse files
dependabot[bot]Rad Azzouzradazzouzsteviki
authored
Bump glob-parent from 5.1.0 to 5.1.2 in /samples/NativeCatalog (#404)
* Bump glob-parent from 5.1.0 to 5.1.2 in /samples/NativeCatalog Bumps [glob-parent](https://github.com/gulpjs/glob-parent) from 5.1.0 to 5.1.2. - [Release notes](https://github.com/gulpjs/glob-parent/releases) - [Changelog](https://github.com/gulpjs/glob-parent/blob/main/CHANGELOG.md) - [Commits](gulpjs/glob-parent@v5.1.0...v5.1.2) --- updated-dependencies: - dependency-name: glob-parent dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]> * Update the Manual Signing example on iOS to use the new Electronic Signatures API. * Bump version number to 1.31.1 * Apply suggestions from code review Co-authored-by: Stefan Kieleithner <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Rad Azzouz <[email protected]> Co-authored-by: Rad Azzouz <[email protected]> Co-authored-by: Stefan Kieleithner <[email protected]>
1 parent ae764b3 commit 1f70698

File tree

7 files changed

+26
-19
lines changed

7 files changed

+26
-19
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-pspdfkit",
3-
"version": "1.31.0",
3+
"version": "1.31.1",
44
"description": "A React Native module for the PSPDFKit library.",
55
"keywords": [
66
"react native",

samples/Catalog/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Catalog",
3-
"version": "1.31.0",
3+
"version": "1.31.1",
44
"private": true,
55
"scripts": {
66
"start": "react-native start",

samples/Catalog/yarn.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5420,7 +5420,7 @@ react-native-permissions@^1.1.1:
54205420
integrity sha512-t0Ujm177bagjUOSzhpmkSz+LqFW04HnY9TeZFavDCmV521fQvFz82aD+POXqWsAdsJVOK3umJYBNNqCjC3g0hQ==
54215421

54225422
"react-native-pspdfkit@file:../..":
5423-
version "1.31.0"
5423+
version "1.31.1"
54245424

54255425
react-native-qrcode-scanner@^1.2.1:
54265426
version "1.2.1"

samples/NativeCatalog/ios/NativeCatalog/Examples/CustomPdfView.m

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#import <React/RCTUtils.h>
1212
#import "NativeCatalog-Swift.h"
1313

14-
@interface CustomPdfView()<PSPDFSignatureViewControllerDelegate>
14+
@interface CustomPdfView()<PSPDFSignatureCreationViewControllerDelegate>
1515
@property (nonatomic, nullable) UIViewController *topController;
1616
@end
1717

@@ -85,19 +85,26 @@ - (UIViewController *)pspdf_parentViewController {
8585
}
8686

8787
- (BOOL)startSigning {
88-
// Programmatically show the signature view controller
89-
PSPDFSignatureViewController *signatureController = [[PSPDFSignatureViewController alloc] init];
90-
signatureController.naturalDrawingEnabled = YES;
91-
signatureController.delegate = self;
92-
PSPDFNavigationController *signatureContainer = [[PSPDFNavigationController alloc] initWithRootViewController:signatureController];
93-
[_pdfController presentViewController:signatureContainer animated:YES completion:NULL];
88+
// Programmatically show the signature creation view controller
89+
if (@available(iOS 13.0, *)) {
90+
PSPDFSignatureCreationViewController *signatureController = [[PSPDFSignatureCreationViewController alloc] init];
91+
signatureController.configuration = [PSPDFSignatureCreationConfiguration configurationWithBuilder:^(PSPDFSignatureCreationConfigurationBuilder * _Nonnull builder) {
92+
builder.availableModes = @[@(PSPDFSignatureCreationModeDraw)];
93+
}];
94+
signatureController.delegate = self;
95+
[_pdfController presentViewController:signatureController animated:YES completion:NULL];
96+
} else {
97+
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"This example is not available on iOS 12" message:@"This example requires iOS 13 and later." preferredStyle:UIAlertControllerStyleAlert];
98+
[alert addAction:[UIAlertAction actionWithTitle:@"Dismiss" style:UIAlertActionStyleDefault handler:NULL]];
99+
[_pdfController presentViewController:alert animated:YES completion:NULL];
100+
}
94101

95102
return YES;
96103
}
97104

98105
#pragma mark - PSPDFSignatureViewControllerDelegate
99106

100-
- (void)signatureViewControllerDidFinish:(PSPDFSignatureViewController *)signatureController withSigner:(nullable PSPDFSigner *)signer shouldSaveSignature:(BOOL)shouldSaveSignature {
107+
- (void)signatureCreationViewControllerDidFinish:(PSPDFSignatureCreationViewController * _Nonnull)signatureController API_AVAILABLE(ios(13.0)){
101108
[signatureController dismissViewControllerAnimated:YES completion:^{
102109
NSURL *samplesURL = [NSBundle.mainBundle.resourceURL URLByAppendingPathComponent:@"PDFs"];
103110
NSURL *p12URL = [samplesURL URLByAppendingPathComponent:@"JohnAppleseed.p12"];
@@ -143,7 +150,7 @@ - (void)signatureViewControllerDidFinish:(PSPDFSignatureViewController *)signatu
143150
// Set the bounding box to fit in the signature form element.
144151
annotation.boundingBox = CGRectMake(signatureFormElement.boundingBox.origin.x + 70, signatureFormElement.boundingBox.origin.y - 25, 50, 50);
145152
annotation.color = signatureController.drawView.strokeColor;
146-
annotation.naturalDrawingEnabled = signatureController.naturalDrawingEnabled;
153+
annotation.naturalDrawingEnabled = signatureController.drawView.naturalDrawingEnabled;
147154
annotation.pageIndex = 0;
148155

149156
// Add the ink annotation.
@@ -163,7 +170,7 @@ - (void)signatureViewControllerDidFinish:(PSPDFSignatureViewController *)signatu
163170
}];
164171
}
165172

166-
- (void)signatureViewControllerDidCancel:(PSPDFSignatureViewController *)signatureController {
173+
- (void)signatureCreationViewControllerDidCancel:(PSPDFSignatureCreationViewController * _Nonnull)signatureController API_AVAILABLE(ios(13.0)){
167174
[signatureController dismissViewControllerAnimated:YES completion:NULL];
168175
}
169176

samples/NativeCatalog/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "NativeCatalog",
3-
"version": "1.31.0",
3+
"version": "1.31.1",
44
"private": true,
55
"scripts": {
66
"android": "react-native run-android",

samples/NativeCatalog/yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3020,9 +3020,9 @@ getpass@^0.1.1:
30203020
assert-plus "^1.0.0"
30213021

30223022
glob-parent@^5.0.0:
3023-
version "5.1.0"
3024-
resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.0.tgz#5f4c1d1e748d30cd73ad2944b3577a81b081e8c2"
3025-
integrity sha512-qjtRgnIVmOfnKUE3NJAQEdk+lKrxfw8t5ke7SXtfMTHcjsBfOfWXCQfdb30zfDoZQ2IRSIiidmjtbHZPZ++Ihw==
3023+
version "5.1.2"
3024+
resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4"
3025+
integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==
30263026
dependencies:
30273027
is-glob "^4.0.1"
30283028

@@ -5511,7 +5511,7 @@ react-native-gesture-handler@^1.3.0:
55115511
prop-types "^15.7.2"
55125512

55135513
"react-native-pspdfkit@file:../..":
5514-
version "1.31.0"
5514+
version "1.31.1"
55155515

55165516
react-native-safe-area-view@^0.14.1:
55175517
version "0.14.8"

0 commit comments

Comments
 (0)