From 5196c1b136a399e51b06a191b6a88491f215155c Mon Sep 17 00:00:00 2001 From: Suhaib Al-Absi Date: Mon, 2 Dec 2024 14:49:23 +0300 Subject: [PATCH] PSPDFKit Update --- .../xcshareddata/swiftpm/Package.resolved | 4 ++-- .../FileDetailsViewController.swift | 20 +++++++++++++++--- Core/project.yml | 2 +- Parent/Parent.xcodeproj/project.pbxproj | 2 +- Student/project-ci.yml | 2 +- Student/project.yml | 2 +- Teacher/Teacher.xcodeproj/project.pbxproj | 2 +- setup | 21 +++++++++++++++++++ 8 files changed, 45 insertions(+), 10 deletions(-) create mode 100755 setup diff --git a/Canvas.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Canvas.xcworkspace/xcshareddata/swiftpm/Package.resolved index fbedf8a891..15d988a790 100644 --- a/Canvas.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Canvas.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -150,8 +150,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/PSPDFKit/PSPDFKit-SP", "state" : { - "revision" : "34567b2d180a86afb3925b1749f25ea9f40af586", - "version" : "13.9.1" + "revision" : "80539b4cf5f06bc987b1ceae49b42959f256896b", + "version" : "14.1.1" } }, { diff --git a/Core/Core/Files/View/FileDetails/FileDetailsViewController.swift b/Core/Core/Files/View/FileDetails/FileDetailsViewController.swift index 9855e57f35..dabf1f9731 100644 --- a/Core/Core/Files/View/FileDetails/FileDetailsViewController.swift +++ b/Core/Core/Files/View/FileDetails/FileDetailsViewController.swift @@ -657,9 +657,7 @@ extension FileDetailsViewController: PDFViewControllerDelegate, FlexibleToolbarC public func flexibleToolbarContainerContentRect(_ container: FlexibleToolbarContainer, for position: FlexibleToolbar.Position) -> CGRect { - let isCompact = container.traitCollection.horizontalSizeClass == .compact - let padding: CGFloat = isCompact ? 10 : 16 - + let padding: CGFloat = container.isHorizontallyCompact ? 10 : 16 let safeInsets = container.safeAreaInsets let contentFrame = contentView.convert(contentView.bounds, to: container) let toolbarRect = CGRect( @@ -672,6 +670,16 @@ extension FileDetailsViewController: PDFViewControllerDelegate, FlexibleToolbarC return toolbarRect } + public func flexibleToolbarContainerWillShow(_ container: FlexibleToolbarContainer) { + guard container.isHorizontallyCompact else { return } + tabBarController?.tabBar.isHidden = true + } + + public func flexibleToolbarContainerWillHide(_ container: FlexibleToolbarContainer) { + guard container.isHorizontallyCompact else { return } + tabBarController?.tabBar.isHidden = false + } + func saveAnnotations() { for child in children { if let pdf = child as? PDFViewController { @@ -750,3 +758,9 @@ extension FileDetailsViewController: PDFViewControllerDelegate, FlexibleToolbarC pdfAnnotationsMutatedMoveToDocsDirectory = true } } + +private extension UIView { + var isHorizontallyCompact: Bool { + traitCollection.horizontalSizeClass == .compact + } +} diff --git a/Core/project.yml b/Core/project.yml index 17ba8e7725..7f92673eab 100644 --- a/Core/project.yml +++ b/Core/project.yml @@ -29,7 +29,7 @@ packages: exactVersion: 3.5.0 PSPDFKit: url: https://github.com/PSPDFKit/PSPDFKit-SP - exactVersion: 13.9.1 + exactVersion: 14.1.1 Swifter: url: https://github.com/httpswift/swifter version: 1.5.0 diff --git a/Parent/Parent.xcodeproj/project.pbxproj b/Parent/Parent.xcodeproj/project.pbxproj index 77a7c9738b..8d610bcbdf 100644 --- a/Parent/Parent.xcodeproj/project.pbxproj +++ b/Parent/Parent.xcodeproj/project.pbxproj @@ -1604,7 +1604,7 @@ repositoryURL = "https://github.com/PSPDFKit/PSPDFKit-SP"; requirement = { kind = exactVersion; - version = 13.9.1; + version = 14.1.1; }; }; /* End XCRemoteSwiftPackageReference section */ diff --git a/Student/project-ci.yml b/Student/project-ci.yml index 42c603ff3b..d3b7f6892a 100644 --- a/Student/project-ci.yml +++ b/Student/project-ci.yml @@ -35,7 +35,7 @@ packages: exactVersion: 9.1.0 PSPDFKit: url: https://github.com/PSPDFKit/PSPDFKit-SP - exactVersion: 13.9.1 + exactVersion: 14.1.1 FirebaseCrashlytics: url: https://github.com/firebase/firebase-ios-sdk.git exactVersion: 10.23.1 diff --git a/Student/project.yml b/Student/project.yml index 21be689691..3403cd7ccc 100644 --- a/Student/project.yml +++ b/Student/project.yml @@ -37,7 +37,7 @@ packages: exactVersion: 9.1.0 PSPDFKit: url: https://github.com/PSPDFKit/PSPDFKit-SP - exactVersion: 13.9.1 + exactVersion: 14.1.1 FirebaseCrashlytics: url: https://github.com/firebase/firebase-ios-sdk.git exactVersion: 10.23.1 diff --git a/Teacher/Teacher.xcodeproj/project.pbxproj b/Teacher/Teacher.xcodeproj/project.pbxproj index 33a5d17452..48b494a5ae 100644 --- a/Teacher/Teacher.xcodeproj/project.pbxproj +++ b/Teacher/Teacher.xcodeproj/project.pbxproj @@ -1779,7 +1779,7 @@ repositoryURL = "https://github.com/PSPDFKit/PSPDFKit-SP"; requirement = { kind = exactVersion; - version = 13.9.1; + version = 14.1.1; }; }; /* End XCRemoteSwiftPackageReference section */ diff --git a/setup b/setup new file mode 100755 index 0000000000..08391cb171 --- /dev/null +++ b/setup @@ -0,0 +1,21 @@ +# +# This file is part of Canvas. +# Copyright (C) 2019-present Instructure, Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +git config commit.template .gitcommit +cd rn/Teacher +yarn build