diff --git a/ACKNOWLEDGEMENTS.md b/ACKNOWLEDGEMENTS.md
index 349ea845..148fdc3f 100644
--- a/ACKNOWLEDGEMENTS.md
+++ b/ACKNOWLEDGEMENTS.md
@@ -231,6 +231,30 @@ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
+--------------------------------------------------------------------------------
+## Brotli (https://github.com/google/brotli)
+
+Copyright (c) 2009, 2010, 2013-2016 by the Brotli Authors.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+
--------------------------------------------------------------------------------
## Caveat (https://github.com/googlefonts/caveat)
@@ -485,33 +509,6 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
---------------------------------------------------------------------------------
-## cppformat (https://github.com/cppformat/cppformat)
-
-Copyright (c) 2012 - 2015, Victor Zverovich
-
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-1. Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-2. Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
--------------------------------------------------------------------------------
## cxx-prettyprint (https://louisdx.github.io/cxx-prettyprint/)
@@ -539,6 +536,30 @@ FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
+--------------------------------------------------------------------------------
+## DBSCAN (https://github.com/NSHipster/DBSCAN)
+
+Copyright 2020 Read Evaluate Press, LLC
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+the rights to use, copy, modify, merge, publish, distribute, sublicense,
+and/or sell copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
+
+
--------------------------------------------------------------------------------
## diff-match-patch-cpp-stl (https://github.com/leutloff/diff-match-patch-cpp-stl)
@@ -1727,6 +1748,32 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+--------------------------------------------------------------------------------
+## InterposeKit (https://github.com/steipete/InterposeKit)
+
+MIT License
+
+Copyright (c) 2020 Peter Steinberger
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+
--------------------------------------------------------------------------------
Copyright 2006 Google Inc. All Rights Reserved.
Author: agl@imperialviolet.org (Adam Langley)
@@ -2017,30 +2064,33 @@ limitations under the License.
libjpeg-turbo Licenses
======================
-libjpeg-turbo is covered by three compatible BSD-style open source licenses:
+libjpeg-turbo is covered by two compatible BSD-style open source licenses:
- The IJG (Independent JPEG Group) License, which is listed in
[README.ijg](README.ijg)
- This license applies to the libjpeg API library and associated programs
- (any code inherited from libjpeg, and any modifications to that code.)
+ This license applies to the libjpeg API library and associated programs,
+ including any code inherited from libjpeg and any modifications to that
+ code. Note that the libjpeg-turbo SIMD source code bears the
+ [zlib License](https://opensource.org/licenses/Zlib), but in the context of
+ the overall libjpeg API library, the terms of the zlib License are subsumed
+ by the terms of the IJG License.
- The Modified (3-clause) BSD License, which is listed below
- This license covers the TurboJPEG API library and associated programs, as
- well as the build system.
-
-- The [zlib License](https://opensource.org/licenses/Zlib)
-
- This license is a subset of the other two, and it covers the libjpeg-turbo
- SIMD extensions.
+ This license applies to the TurboJPEG API library and associated programs, as
+ well as the build system. Note that the TurboJPEG API library wraps the
+ libjpeg API library, so in the context of the overall TurboJPEG API library,
+ both the terms of the IJG License and the terms of the Modified (3-clause)
+ BSD License apply.
Complying with the libjpeg-turbo Licenses
=========================================
This section provides a roll-up of the libjpeg-turbo licensing terms, to the
-best of our understanding.
+best of our understanding. This is not a license in and of itself. It is
+intended solely for clarification.
1. If you are distributing a modified version of the libjpeg-turbo source,
then:
@@ -2054,7 +2104,7 @@ best of our understanding.
- Clauses 1 and 3 of the zlib License
2. You must add your own copyright notice to the header of each source
- file you modified, so others can tell that you modified that file (if
+ file you modified, so others can tell that you modified that file. (If
there is not an existing copyright header in that file, then you can
simply add a notice stating that you modified the file.)
@@ -2107,7 +2157,7 @@ best of our understanding.
The Modified (3-clause) BSD License
===================================
-Copyright (C)2009-2019 D. R. Commander. All Rights Reserved.
+Copyright (C)2009-2024 D. R. Commander. All Rights Reserved.
Copyright (C)2015 Viktor Szathmáry. All Rights Reserved.
Redistribution and use in source and binary forms, with or without
@@ -2135,8 +2185,8 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
-Why Three Licenses?
-===================
+Why Two Licenses?
+=================
The zlib License could have been used instead of the Modified (3-clause) BSD
License, and since the IJG License effectively subsumes the distribution
@@ -3276,91 +3326,369 @@ copyright to it, placing it in the public domain. The library comes with
absolutely no warranty.
--------------------------------------------------------------------------------
-MIT License
-
-Copyright (c) 2021 The fast_float authors
+LICENSE-Apache2-LLVM
-Permission is hereby granted, free of charge, to any
-person obtaining a copy of this software and associated
-documentation files (the "Software"), to deal in the
-Software without restriction, including without
-limitation the rights to use, copy, modify, merge,
-publish, distribute, sublicense, and/or sell copies of
-the Software, and to permit persons to whom the Software
-is furnished to do so, subject to the following
-conditions:
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
-The above copyright notice and this permission notice
-shall be included in all copies or substantial portions
-of the Software.
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
-ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
-TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
-SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
-IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-DEALINGS IN THE SOFTWARE.
+ 1. Definitions.
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
---------------------------------------------------------------------------------
-## FreeType (www.freetype.org)
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
- The FreeType Project LICENSE
- ----------------------------
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
- 2006-Jan-27
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
- Copyright 1996-2002, 2006 by
- David Turner, Robert Wilhelm, and Werner Lemberg
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
-Introduction
-============
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
- The FreeType Project is distributed in several archive packages;
- some of them may contain, in addition to the FreeType font engine,
- various tools and contributions which rely on, or relate to, the
- FreeType Project.
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
- This license applies to all files found in such packages, and
- which do not fall under their own explicit license. The license
- affects thus the FreeType font engine, the test programs,
- documentation and makefiles, at the very least.
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
- This license was inspired by the BSD, Artistic, and IJG
- (Independent JPEG Group) licenses, which all encourage inclusion
- and use of free software in commercial and freeware products
- alike. As a consequence, its main points are that:
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
- o We don't promise that this software works. However, we will be
- interested in any kind of bug reports. (`as is' distribution)
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
- o You can use this software for whatever you want, in parts or
- full form, without having to pay us. (`royalty-free' usage)
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
- o You may not pretend that you wrote this software. If you use
- it, or only parts of it, in a program, you must acknowledge
- somewhere in your documentation that you have used the
- FreeType code. (`credits')
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
- We specifically permit and encourage the inclusion of this
- software, with or without modifications, in commercial products.
- We disclaim all warranties covering The FreeType Project and
- assume no liability related to The FreeType Project.
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
- Finally, many people asked us for a preferred form for a
- credit/disclaimer to use in compliance with this license. We thus
- encourage you to use the following text:
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
- """
- Portions of this software are copyright � The FreeType
- Project (www.freetype.org). All rights reserved.
- """
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+
+--- LLVM Exceptions to the Apache 2.0 License ----
+
+As an exception, if, as a result of your compiling your source code, portions
+of this Software are embedded into an Object form of such source code, you
+may redistribute such embedded portions in such Object form without complying
+with the conditions of Sections 4(a), 4(b) and 4(d) of the License.
+
+In addition, if you combine or link compiled forms of this Software with
+software that is licensed under the GPLv2 ("Combined Software") and if a
+court of competent jurisdiction determines that the patent provision (Section
+3), the indemnity provision (Section 9) or other Section of the License
+conflicts with the conditions of the GPLv2, you may retroactively and
+prospectively choose to deem waived or otherwise exclude such Section(s) of
+the License, but only in their entirety and only with respect to the Combined
+Software.
+
+LICENSE-Boost
+
+Boost Software License - Version 1.0 - August 17th, 2003
+
+Permission is hereby granted, free of charge, to any person or organization
+obtaining a copy of the software and accompanying documentation covered by
+this license (the "Software") to use, reproduce, display, distribute,
+execute, and transmit the Software, and to prepare derivative works of the
+Software, and to permit third-parties to whom the Software is furnished to
+do so, all subject to the following:
+
+The copyright notices in the Software and this entire statement, including
+the above license grant, this restriction and the following disclaimer,
+must be included in all copies of the Software, in whole or in part, and
+all derivative works of the Software, unless such copies or derivative
+works are solely in the form of machine-executable object code generated by
+a source language processor.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
+SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
+FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
+
+
+subproject/3rdparty/shaded_plots/license.txt (benchmark plot scripts)
+
+Copyright (c) 2018, John A. Onofrey
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution
+* Neither the name of Yale University nor the names of its
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+--------------------------------------------------------------------------------
+MIT License
+
+Copyright (c) 2021 The fast_float authors
+
+Permission is hereby granted, free of charge, to any
+person obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the
+Software without restriction, including without
+limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software
+is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice
+shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
+
+
+--------------------------------------------------------------------------------
+## FreeType (www.freetype.org)
+
+ The FreeType Project LICENSE
+ ----------------------------
+
+ 2006-Jan-27
+
+ Copyright 1996-2002, 2006 by
+ David Turner, Robert Wilhelm, and Werner Lemberg
+
+
+
+Introduction
+============
+
+ The FreeType Project is distributed in several archive packages;
+ some of them may contain, in addition to the FreeType font engine,
+ various tools and contributions which rely on, or relate to, the
+ FreeType Project.
+
+ This license applies to all files found in such packages, and
+ which do not fall under their own explicit license. The license
+ affects thus the FreeType font engine, the test programs,
+ documentation and makefiles, at the very least.
+
+ This license was inspired by the BSD, Artistic, and IJG
+ (Independent JPEG Group) licenses, which all encourage inclusion
+ and use of free software in commercial and freeware products
+ alike. As a consequence, its main points are that:
+
+ o We don't promise that this software works. However, we will be
+ interested in any kind of bug reports. (`as is' distribution)
+
+ o You can use this software for whatever you want, in parts or
+ full form, without having to pay us. (`royalty-free' usage)
+
+ o You may not pretend that you wrote this software. If you use
+ it, or only parts of it, in a program, you must acknowledge
+ somewhere in your documentation that you have used the
+ FreeType code. (`credits')
+
+ We specifically permit and encourage the inclusion of this
+ software, with or without modifications, in commercial products.
+ We disclaim all warranties covering The FreeType Project and
+ assume no liability related to The FreeType Project.
+
+
+ Finally, many people asked us for a preferred form for a
+ credit/disclaimer to use in compliance with this license. We thus
+ encourage you to use the following text:
+
+ """
+ Portions of this software are copyright � The FreeType
+ Project (www.freetype.org). All rights reserved.
+ """
Please replace with the value from the FreeType version you
actually use.
@@ -3881,6 +4209,215 @@ This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/
+--------------------------------------------------------------------------------
+## resumable-assert (https://github.com/google/resumable-assert)
+
+Copyright 2018 Google Inc. All rights reserved.
+
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+
--------------------------------------------------------------------------------
## RxAndroid (https://github.com/ReactiveX/RxAndroid)
@@ -4151,7 +4688,7 @@ Apache License
--------------------------------------------------------------------------------
-sqlite-vec — https://github.com/asg017/sqlite-vec
+## sqlite-vec (https://github.com/asg017/sqlite-vec)
MIT License
@@ -4212,6 +4749,49 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+--------------------------------------------------------------------------------
+## stb_image (https://github.com/nothings/stb)
+
+This software is available under 2 licenses -- choose whichever you prefer.
+------------------------------------------------------------------------------
+ALTERNATIVE A - MIT License
+Copyright (c) 2017 Sean Barrett
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+------------------------------------------------------------------------------
+ALTERNATIVE B - Public Domain (www.unlicense.org)
+This is free and unencumbered software released into the public domain.
+Anyone is free to copy, modify, publish, use, compile, sell, or distribute this
+software, either in source code form or as a compiled binary, for any purpose,
+commercial or non-commercial, and by any means.
+In jurisdictions that recognize copyright laws, the author or authors of this
+software dedicate any and all copyright interest in the software to the public
+domain. We make this dedication for the benefit of the public at large and to
+the detriment of our heirs and successors. We intend this dedication to be an
+overt act of relinquishment in perpetuity of all present and future rights to
+this software under copyright law.
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+------------------------------------------------------------------------------
+
+
--------------------------------------------------------------------------------
## swift-cmark (https://github.com/swiftlang/swift-cmark/)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d697be69..6e72a6ce 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,27 @@
+- Requires React Native 0.87 or later, and says so in `peerDependencies`. Nutrient Android SDK 12 needs Android Gradle Plugin 9.1 or later, which React Native 0.86 and older can't run. React Native 0.87 and later, and Expo SDK 58, already use Android Gradle Plugin 9.2.1 and Gradle 9.4.1. (L#HYB-1092)
+- Updates for Nutrient Android SDK 12.1.0. (L#HYB-1088)
+- Updates for Nutrient iOS SDK 27.2.0, which requires Xcode 27. Apps built with Xcode 27 must use the UIScene life cycle, or they fail to launch on iOS 27; the Catalog's `SceneDelegate.swift` shows how to start React Native from a scene. (L#HYB-1120)
+- Updates the Android build toolchain to `compileSdk` 37.1 and Kotlin 2.4.10, which the Nutrient Android SDK requires. In your app, raise `kotlinVersion` to 2.4.10 and add it to the `kotlin-gradle-plugin` classpath, which the React Native template leaves unversioned, and set `compileSdkMinor 1` in the app module. With an Android Gradle Plugin older than 9.1 or a Kotlin older than 2.4.10, the build now stops with a message naming the versions to raise them to. (L#HYB-1087)
+- Fixes an issue on iOS where `exitCurrentlyActiveMode` left the keyboard, date picker or choice list of a form field open. (L#HYB-1008)
+- Fixes a crash on iOS when annotations selected with `selectAnnotations` included both form fields and other annotations and were then deselected. (L#HYB-1134)
+- Supports React Native's Strict TypeScript API, the default since React Native 0.87, where `NativeModules.Nutrient` and `NativeModules.RNProcessor` are untyped. Type them with the exported classes, for example `const Processor: ProcessorModule = NativeModules.RNProcessor;` after `import type { Processor as ProcessorModule } from '@nutrient-sdk/react-native';`. Also fixes two type errors the strict API reported in `PDFDocument`. (L#HYB-1092)
+- Updates the Android integration to the coroutine APIs of the Nutrient Android SDK, which no longer uses RxJava. It needs Nutrient Android SDK 12.1.0 or later. (L#HYB-1114)
+- Fixes promises on Android that never settled, or waited out a timeout, once the `NutrientView` they act on was closed. `enterAnnotationCreationMode`, `exitCurrentlyActiveMode` and `enterContentEditingMode` now reject, `selectAnnotations` and `clearSelectedAnnotations` reject at once rather than after 5 seconds, the viewport conversions resolve `null`, and `dismissSignaturePad` resolves `false`. `save`, `applyInstantJSON`, `importXFDF`, `getFormElements` and `updateFormFieldValue` now reject with "Document is nil" for a document that's gone. (L#HYB-1114)
+- Removes the global RxJava error handler the Android integration installed, which replaced any error handler your app set with `RxJavaPlugins.setErrorHandler`. (L#HYB-1115)
+- Fixes an issue on Android where NotificationCenter events such as `annotationsChanged` and `documentPageChanged` were sent again for every earlier event after a `NutrientView` switched documents. (L#HYB-1114)
+- Updates the Expo config plugin to set the Android toolchain this release needs, so `npx expo prebuild` apps build without editing the generated `android` project. It raises `android.kotlinVersion` to 2.4.10 when the app sets an older one or none, and makes the app module compile against android-37.1 when it is on API 37 or older. Without them, an Expo SDK 58 app failed at the module's Kotlin check or in `:app:checkReleaseAarMetadata`. If the app also sets `kotlinVersion` with `expo-build-properties`, list `@nutrient-sdk/react-native` before it in `plugins`. (L#HYB-1132)
+- Moves the Android integration off the View toolbar classes that Nutrient Android removed in favour of the Compose toolbars. Annotation toolbar grouping, position, supported positions and the stylus button now go through the toolbar coordinator, custom main-toolbar items through a toolbar items provider, and `hideDefaultToolbar` and the navigation button through the main toolbar. No JavaScript API changes. (L#HYB-1088)
+- Removes the Android `androidCustomColorPickerEnabled` annotation configuration option's effect: Nutrient Android unified its two annotation-inspector colour pickers into one, so there is no longer a second picker to switch to. The option is still accepted and ignored. (L#HYB-1088)
+- Deprecates `customColorPickerEnabled` in the annotation presets. It now has no effect on either platform: Nutrient Android SDK 12 has a single colour picker, and iOS never read the option. Remove it from your presets; it is still accepted, so existing configurations keep loading. Also deprecates `costomColorPickerEnabled`, a misspelling in the ink preset type, and adds the correctly spelled `customColorPickerEnabled` there. (L#HYB-1089)
+- Removes the Android `androidUseTextSelectionToolbar` configuration option's effect: Nutrient Android removed the docked text selection toolbar it switched to, so text selection always uses the popup toolbar. The option is still accepted and ignored. (L#HYB-1088)
+- Fixes a crash on iOS with React Native 0.88 in debug builds, where every `NutrientView` and `NutrientInstantView` failed an assertion that component views set up their default props. (L#HYB-1092)
+- Supports apps on Android Gradle Plugin 9 with its built-in Kotlin enabled. The Android module no longer applies the `kotlin-android` plugin there, and compiles its New Architecture Kotlin sources, which AGP 9 otherwise left out so that every `NutrientView` failed with "Can't find ViewManager". The Catalog now uses React Native 0.88.0, Android Gradle Plugin 9.2.1 and Gradle 9.4.1. (L#HYB-1092)
+- Ships R8 keep rules with the Android module for the turbo modules and Fabric view managers it creates by reflection, and the class names the Nutrient Android SDK uses to detect React Native. Release builds no longer depend on the Android SDK's own rules keeping everything under `com.pspdfkit` and `io.nutrient`. (L#AND-2184)
+- Logs a warning on iOS when `aiAssistantConfiguration` is missing `serverURL`, `jwt` or `sessionID`, or has a `serverURL` that isn't a valid URL. With Nutrient iOS SDK 27, AI Assistant then uses the on-device language model instead of a server. (L#HYB-1121)
+- Fixes an issue on Android where `selectAnnotations` ignored `showContextualMenu`, so the annotation contextual menu was not shown after a programmatic selection. (L#HYB-1118)
+- Updates the Catalog example to the UIScene life cycle, which apps built with Xcode 27 need to launch on iOS 27. (L#HYB-1119)
+- Fixes an issue where `PDFDocument.updateAnnotations` resolved `true` without updating anything when the annotations passed had no `uuid` or `name`. It now rejects with `No annotations found to update`. (L#HYB-1080)
+
## 4.5.1 — 31 Aug 2026
- Adds `pdfToScreenScale` and `pageSize` to the `documentViewportChanged` payload and `getViewportState`, for converting a PDF point to screen coordinates in JavaScript. (J#HYB-1032)
diff --git a/README.md b/README.md
index dd2b5775..e5f3dbb4 100644
--- a/README.md
+++ b/README.md
@@ -37,6 +37,7 @@ Nutrient.setLicenseKey('YOUR_REACT_NATIVE_LICENSE_KEY_GOES_HERE');
### Requirements
- A [development environment](https://reactnative.dev/docs/environment-setup) for running React Native projects using the React Native CLI. If you’re using Expo, [check out our blog post](https://www.nutrient.io/blog/how-to-use-pspdfkit-for-react-native-with-expo/) on the topic.
+- React Native 0.87 or later (Expo SDK 58 or later)
#### iOS
@@ -48,6 +49,10 @@ Nutrient.setLicenseKey('YOUR_REACT_NATIVE_LICENSE_KEY_GOES_HERE');
- The [latest stable version of Android Studio](https://developer.android.com/studio)
- The [Android NDK](https://developer.android.com/studio/projects/install-ndk)
- An [Android Virtual Device](https://developer.android.com/studio/run/managing-avds.html) or a hardware device
+- Android Gradle Plugin 9.1 or later and Kotlin 2.4.10 or later. React Native 0.87 and later already use Android Gradle Plugin 9.2.1 and Gradle 9.4.1.
+- `compileSdk` 37 with `compileSdkMinor` 1 (the `android-37.1` platform), and `minSdk` 24
+
+> If your app minifies release builds, avoid Android Gradle Plugin 9.3.0–9.3.3 and 9.4.0–9.4.1. Their R8 removes a null check in `react-native-screens` ([b/558217403](https://issuetracker.google.com/issues/558217403)), so the app crashes at launch. Stay on 9.2.1, or pin R8 9.4.29 or later.
### Installation
@@ -55,7 +60,7 @@ To install the Nutrient React Native SDK, run `yarn add @nutrient-sdk/react-nati
### Expo config plugin (Android)
-When using Expo prebuild/dev client, add the package as a plugin so Android `AppTheme` is switched to a MaterialComponents-compatible theme:
+When using Expo prebuild/dev client, add the package as a plugin so Android `AppTheme` is switched to a MaterialComponents-compatible theme, and the generated Android project uses Kotlin 2.4.10 or later and compiles against android-37.1 or later:
```js
// app.config.js
@@ -86,6 +91,8 @@ export default {
};
```
+If you also set `android.kotlinVersion` with `expo-build-properties`, list `@nutrient-sdk/react-native` before it in `plugins`, or set 2.4.10 or later there. Otherwise the version from `expo-build-properties` replaces the one this plugin sets.
+
After updating app config, run `npx expo prebuild -p android` (or rebuild with EAS).
### Getting Started
@@ -141,26 +148,39 @@ See our [Getting Started on React Native guide](https://www.nutrient.io/getting-
> If you previously added `https://my.nutrient.io/maven/` for the Nutrient SDK, you can remove it. Keep it only if you also use an add-on that isn't on Maven Central yet, such as OCR (`io.nutrient:nutrient-ocr`).
-1. Open the app’s build.gradle file:
+1. Raise Kotlin in your project's `android/build.gradle`. Nutrient's Kotlin metadata is built with Kotlin 2.4. The React Native template leaves the Kotlin Gradle plugin unversioned, so it has to be given the version as well:
+
+ ```diff
+ buildscript {
+ ext {
+ - kotlinVersion = "2.2.0"
+ + kotlinVersion = "2.4.10"
+ }
+ dependencies {
+ classpath("com.android.tools.build:gradle")
+ classpath("com.facebook.react:react-native-gradle-plugin")
+ - classpath("org.jetbrains.kotlin:kotlin-gradle-plugin")
+ + classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
+ }
+ }
+ ```
+
+ Keep the Android Gradle Plugin 9.2.1 and Gradle 9.4.1 that React Native 0.87 and later come with.
+
+1. Open the app’s build.gradle file and set the compile SDK's minor version:
```diff
...
android {
- - compileSdkVersion rootProject.ext.compileSdkVersion
- + compileSdkVersion 36
- ...
- defaultConfig {
- applicationId "com.nutrientdemo"
- - minSdkVersion rootProject.ext.minSdkVersion
- + minSdkVersion 24
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- }
- }
+ compileSdk rootProject.ext.compileSdkVersion
+ + // Nutrient's AAR metadata requires the android-37.1 platform, so the minor version
+ + // has to be set as well.
+ + compileSdkMinor 1
...
```
+ > `compileSdkVersion` in your project's `ext` block is 37 in React Native 0.87 and later. If you lowered it, set `compileSdk 37` in the app module.
+
1. Open your project’s Podfile:
```bash
@@ -236,9 +256,10 @@ See our [Getting Started on React Native guide](https://www.nutrient.io/getting-
import React, { Component } from 'react';
import { Platform } from 'react-native';
import NutrientView from '@nutrient-sdk/react-native';
+ import type { Nutrient as NutrientModule } from '@nutrient-sdk/react-native';
import { NativeModules } from 'react-native';
- const Nutrient = NativeModules.Nutrient;
+ const Nutrient: NutrientModule = NativeModules.Nutrient;
Nutrient.setLicenseKey(null);
const DOCUMENT =
diff --git a/__mocks__/react-native.js b/__mocks__/react-native.js
index bc1d2e32..3035fed3 100644
--- a/__mocks__/react-native.js
+++ b/__mocks__/react-native.js
@@ -13,6 +13,7 @@ module.exports = {
PDFDocumentManager: {
getPageCount: jest.fn().mockResolvedValue(10),
getDocumentId: jest.fn().mockResolvedValue('doc-id'),
+ updateAnnotations: jest.fn().mockResolvedValue(true),
},
PSPDFKitViewManager: {},
Nutrient: {
diff --git a/__tests__/pdfdocument.test.ts b/__tests__/pdfdocument.test.ts
index da3fcedf..639f4c79 100644
--- a/__tests__/pdfdocument.test.ts
+++ b/__tests__/pdfdocument.test.ts
@@ -292,6 +292,38 @@ describe('PDFDocument JS helpers', () => {
});
});
});
-});
+ describe('updateAnnotations', () => {
+ const nativeUpdate = NativeModules.PDFDocumentManager.updateAnnotations as jest.Mock;
+
+ test.each([
+ ['a nested array', [[{ uuid: 'a', name: 'b', type: 'pspdfkit/ink' }]]],
+ ['elements without a uuid or name', [{ foo: 'bar' }]],
+ ])('rejects without calling native when given %s', async (_label, annotations) => {
+ const doc = new PDFDocument(1234);
+ await expect(doc.updateAnnotations(annotations)).rejects.toMatchObject({
+ code: 'updateAnnotations',
+ message: 'No annotations found to update',
+ });
+ expect(nativeUpdate).not.toHaveBeenCalled();
+ });
+
+ test('rejects instead of throwing when an element is null', async () => {
+ const doc = new PDFDocument(1234);
+ await expect(doc.updateAnnotations([null])).rejects.toThrow(TypeError);
+ expect(nativeUpdate).not.toHaveBeenCalled();
+ });
+
+ test('resolves without calling native when given an empty array', async () => {
+ const doc = new PDFDocument(1234);
+ await expect(doc.updateAnnotations([])).resolves.toBe(true);
+ expect(nativeUpdate).not.toHaveBeenCalled();
+ });
+ test('forwards annotations that carry an identifier to native', async () => {
+ const doc = new PDFDocument(1234);
+ await expect(doc.updateAnnotations([{ uuid: 'a', name: 'b' }, { foo: 'bar' }])).resolves.toBe(true);
+ expect(nativeUpdate).toHaveBeenCalledWith(expect.anything(), [{ uuid: 'a', name: 'b' }]);
+ });
+ });
+});
diff --git a/__tests__/plugin.test.ts b/__tests__/plugin.test.ts
new file mode 100644
index 00000000..fb73e159
--- /dev/null
+++ b/__tests__/plugin.test.ts
@@ -0,0 +1,341 @@
+// Mods run on prebuild, not when a plugin registers them, and the mod registered last runs first,
+// the way Expo chains them.
+jest.mock(
+ 'expo/config-plugins',
+ () => {
+ const withMod =
+ (key: string) => (config: any, action: (config: any) => any) => {
+ const next = config.mods[key];
+ return {
+ ...config,
+ mods: {
+ ...config.mods,
+ [key]: (modResults: any) =>
+ next(action({ ...config, modResults }).modResults),
+ },
+ };
+ };
+ return {
+ createRunOncePlugin: (plugin: any) => plugin,
+ withAndroidStyles: withMod('styles'),
+ withAppBuildGradle: withMod('appBuildGradle'),
+ withGradleProperties: withMod('gradleProperties'),
+ };
+ },
+ { virtual: true },
+);
+
+import * as fs from 'fs';
+import * as path from 'path';
+
+const { withGradleProperties } = require('expo/config-plugins');
+const withNutrientAndroidToolchain = require('../plugin/withNutrientAndroidToolchain');
+const {
+ raiseKotlinVersion,
+ addCompileSdkMinor,
+ MIN_KOTLIN_VERSION,
+ COMPILE_SDK,
+ COMPILE_SDK_MINOR,
+} = withNutrientAndroidToolchain;
+const withNutrient = require('../plugin');
+
+const EXPO_APP_BUILD_GRADLE = `android {
+ buildToolsVersion rootProject.ext.buildToolsVersion
+ compileSdk rootProject.ext.compileSdkVersion
+
+ namespace 'com.example'
+}
+`;
+
+const COMPILE_SDK_MINOR_BLOCK = [
+ ' compileSdk rootProject.ext.compileSdkVersion',
+ ' // @generated begin nutrient-compile-sdk - expo prebuild (DO NOT MODIFY)',
+ " if (rootProject.ext.compileSdkVersion.toString().tokenize('.')[0].toInteger() <= 37) {",
+ ' compileSdk 37',
+ ' compileSdkMinor 1',
+ ' }',
+ ' // @generated end nutrient-compile-sdk',
+].join('\n');
+
+// The block an older package version would have added.
+const OLDER_COMPILE_SDK_MINOR_BLOCK = COMPILE_SDK_MINOR_BLOCK.replace(
+ 'compileSdkMinor 1',
+ 'compileSdkMinor 0',
+);
+
+function kotlinProperty(value: string) {
+ return { type: 'property', key: 'android.kotlinVersion', value };
+}
+
+const identity = (modResults: any) => modResults;
+
+function expoConfig() {
+ return {
+ name: 'app',
+ mods: {
+ gradleProperties: identity,
+ appBuildGradle: identity,
+ styles: identity,
+ },
+ };
+}
+
+// Runs the registered mods against the files a new Expo app starts with.
+function prebuild(
+ config: any,
+ appBuildGradle = { language: 'groovy', contents: EXPO_APP_BUILD_GRADLE },
+) {
+ return {
+ gradleProperties: config.mods.gradleProperties([
+ { type: 'property', key: 'newArchEnabled', value: 'true' },
+ ]),
+ appBuildGradle: config.mods.appBuildGradle(appBuildGradle),
+ styles: config.mods.styles({
+ resources: {
+ style: [{ $: { name: 'AppTheme', parent: 'Theme.AppCompat' } }],
+ },
+ }),
+ };
+}
+
+// Sets `android.kotlinVersion` the way `expo-build-properties` does.
+function withKotlinVersion(config: any, version: string) {
+ return withGradleProperties(config, (config: any) => {
+ config.modResults = config.modResults
+ .filter((item: any) => item.key !== 'android.kotlinVersion')
+ .concat(kotlinProperty(version));
+ return config;
+ });
+}
+
+describe('Expo plugin Android toolchain', () => {
+ let warn: jest.SpyInstance;
+
+ beforeEach(() => {
+ warn = jest.spyOn(console, 'warn').mockImplementation(() => {});
+ });
+
+ afterEach(() => {
+ warn.mockRestore();
+ });
+
+ describe('android.kotlinVersion', () => {
+ test('is added when the app does not set it, with a warning', () => {
+ expect(raiseKotlinVersion([])).toEqual([kotlinProperty('2.4.10')]);
+ expect(warn).toHaveBeenCalledTimes(1);
+ expect(warn.mock.calls[0][0]).toContain('to 2.4.10 (was not set)');
+ });
+
+ test.each(['2.2.10', '2.4.0', '1.9.24', '2.4.0-RC2'])(
+ 'raises %s to 2.4.10, with a warning',
+ version => {
+ expect(raiseKotlinVersion([kotlinProperty(version)])).toEqual([
+ kotlinProperty('2.4.10'),
+ ]);
+ expect(warn).toHaveBeenCalledTimes(1);
+ expect(warn.mock.calls[0][0]).toContain(`to 2.4.10 (was ${version})`);
+ },
+ );
+
+ test.each(['2.4.10', '2.4.20', '2.5.0', '3.0.0-RC'])(
+ 'keeps %s',
+ version => {
+ expect(raiseKotlinVersion([kotlinProperty(version)])).toEqual([
+ kotlinProperty(version),
+ ]);
+ expect(warn).not.toHaveBeenCalled();
+ },
+ );
+
+ test('ignores comments that mention the key', () => {
+ const comment = { type: 'comment', value: 'android.kotlinVersion=1.9.0' };
+ expect(raiseKotlinVersion([comment])).toEqual([
+ comment,
+ kotlinProperty('2.4.10'),
+ ]);
+ });
+ });
+
+ describe('compileSdkMinor', () => {
+ test('raises the app to android-37.1 after the compileSdk line', () => {
+ expect(addCompileSdkMinor(EXPO_APP_BUILD_GRADLE)).toContain(
+ COMPILE_SDK_MINOR_BLOCK,
+ );
+ });
+
+ test('matches the older compileSdkVersion spelling', () => {
+ const contents = EXPO_APP_BUILD_GRADLE.replace(
+ 'compileSdk ',
+ 'compileSdkVersion ',
+ );
+ expect(addCompileSdkMinor(contents)).toContain(
+ ' compileSdkMinor 1',
+ );
+ });
+
+ test('keeps CRLF line endings in a CRLF build.gradle', () => {
+ const contents = EXPO_APP_BUILD_GRADLE.replace(/\n/g, '\r\n');
+ const result = addCompileSdkMinor(contents);
+ expect(result).toBe(
+ addCompileSdkMinor(EXPO_APP_BUILD_GRADLE).replace(/\n/g, '\r\n'),
+ );
+ expect(addCompileSdkMinor(result)).toBe(result);
+ expect(warn).not.toHaveBeenCalled();
+ });
+
+ test('changes no other line in a build.gradle with mixed line endings', () => {
+ const contents = EXPO_APP_BUILD_GRADLE.replace(
+ 'compileSdk rootProject.ext.compileSdkVersion\n',
+ 'compileSdk rootProject.ext.compileSdkVersion\r\n',
+ );
+ const result = addCompileSdkMinor(contents);
+ expect(result).toBe(
+ contents.replace(
+ ' compileSdk rootProject.ext.compileSdkVersion',
+ COMPILE_SDK_MINOR_BLOCK.replace(/\n/g, '\r\n'),
+ ),
+ );
+ expect(addCompileSdkMinor(result)).toBe(result);
+ });
+
+ test('is not added twice across repeated prebuilds', () => {
+ const once = addCompileSdkMinor(EXPO_APP_BUILD_GRADLE);
+ expect(addCompileSdkMinor(once)).toBe(once);
+ });
+
+ test('replaces the block an older package version added', () => {
+ const contents = addCompileSdkMinor(EXPO_APP_BUILD_GRADLE).replace(
+ COMPILE_SDK_MINOR_BLOCK,
+ OLDER_COMPILE_SDK_MINOR_BLOCK,
+ );
+ expect(contents).toContain('compileSdkMinor 0');
+ expect(addCompileSdkMinor(contents)).toBe(
+ addCompileSdkMinor(EXPO_APP_BUILD_GRADLE),
+ );
+ });
+
+ test.each([
+ ['compileSdk 38\n compileSdkMinor 0'],
+ ['compileSdk 37\n compileSdkMinor 1'],
+ ['compileSdk 37\n compileSdkMinor 2'],
+ ['compileSdk rootProject.ext.compileSdkVersion\n compileSdkMinor 1'],
+ ])(
+ 'keeps what the app sets when it is android-37.1 or later: %j',
+ lines => {
+ const contents = EXPO_APP_BUILD_GRADLE.replace(
+ 'compileSdk rootProject.ext.compileSdkVersion',
+ lines,
+ );
+ expect(addCompileSdkMinor(contents)).toBe(contents);
+ expect(warn).not.toHaveBeenCalled();
+ },
+ );
+
+ test.each([
+ ['compileSdk 37\n compileSdkMinor 0'],
+ ['compileSdk 36\n compileSdkMinor 1'],
+ ['compileSdk rootProject.ext.compileSdkVersion\n compileSdkMinor 0'],
+ ])(
+ 'warns when the app sets a version older than android-37.1: %j',
+ lines => {
+ const contents = EXPO_APP_BUILD_GRADLE.replace(
+ 'compileSdk rootProject.ext.compileSdkVersion',
+ lines,
+ );
+ expect(addCompileSdkMinor(contents)).toBe(contents);
+ expect(warn).toHaveBeenCalledTimes(1);
+ expect(warn.mock.calls[0][0]).toContain('older than android-37.1');
+ },
+ );
+
+ test('leaves a hard-coded compileSdk unchanged and warns', () => {
+ const contents = 'android {\n compileSdk 36\n}\n';
+ expect(addCompileSdkMinor(contents)).toBe(contents);
+ expect(warn).toHaveBeenCalledTimes(1);
+ });
+
+ test('removes its own block when the compileSdk line is no longer found', () => {
+ const contents = addCompileSdkMinor(EXPO_APP_BUILD_GRADLE).replace(
+ 'compileSdk rootProject.ext.compileSdkVersion',
+ 'compileSdk 36',
+ );
+ expect(addCompileSdkMinor(contents)).toBe(
+ EXPO_APP_BUILD_GRADLE.replace(
+ 'compileSdk rootProject.ext.compileSdkVersion',
+ 'compileSdk 36',
+ ),
+ );
+ expect(warn).toHaveBeenCalledTimes(1);
+ });
+ });
+
+ describe('android/build.gradle', () => {
+ const moduleBuildGradle = fs.readFileSync(
+ path.join(__dirname, '..', 'android', 'build.gradle'),
+ 'utf8',
+ );
+
+ test('refuses the Kotlin versions the plugin raises', () => {
+ const floor = moduleBuildGradle.match(
+ /nutrientVersionAtLeast\(appKotlinVersion, \[(\d+), (\d+), (\d+)\]\)/,
+ );
+ expect(floor?.slice(1).join('.')).toBe(MIN_KOTLIN_VERSION);
+ });
+
+ test('compiles against the platform the plugin raises the app to', () => {
+ expect(moduleBuildGradle.match(/^ *compileSdk (\d+)$/m)?.[1]).toBe(
+ String(COMPILE_SDK),
+ );
+ expect(moduleBuildGradle.match(/^ *compileSdkMinor (\d+)$/m)?.[1]).toBe(
+ String(COMPILE_SDK_MINOR),
+ );
+ });
+ });
+
+ describe('config plugin', () => {
+ test('updates gradle.properties and the app build.gradle', () => {
+ const files = prebuild(withNutrientAndroidToolchain(expoConfig()));
+ expect(files.gradleProperties).toContainEqual(kotlinProperty('2.4.10'));
+ expect(files.appBuildGradle.contents).toContain(COMPILE_SDK_MINOR_BLOCK);
+ });
+
+ test('leaves a Kotlin script build.gradle.kts unchanged and warns', () => {
+ const appBuildGradle = {
+ language: 'kt',
+ contents: 'android {\n compileSdk = 37\n}\n',
+ };
+ const files = prebuild(
+ withNutrientAndroidToolchain(expoConfig()),
+ appBuildGradle,
+ );
+ expect(files.appBuildGradle).toEqual(appBuildGradle);
+ expect(files.gradleProperties).toContainEqual(kotlinProperty('2.4.10'));
+ expect(warn.mock.calls.map(call => call[0])).toContainEqual(
+ expect.stringContaining('is not Groovy'),
+ );
+ });
+
+ test('is applied by the package plugin together with the theme', () => {
+ const files = prebuild(withNutrient(expoConfig()));
+ expect(files.styles.resources.style[0].$.parent).toBe(
+ '@style/NutrientRN.AppTheme',
+ );
+ expect(files.gradleProperties).toContainEqual(kotlinProperty('2.4.10'));
+ expect(files.appBuildGradle.contents).toContain(COMPILE_SDK_MINOR_BLOCK);
+ });
+
+ test('raises an older Kotlin version from a plugin listed after it', () => {
+ const config = withKotlinVersion(withNutrient(expoConfig()), '2.2.10');
+ expect(prebuild(config).gradleProperties).toContainEqual(
+ kotlinProperty('2.4.10'),
+ );
+ });
+
+ test('is overwritten by an older Kotlin version from a plugin listed before it', () => {
+ const config = withNutrient(withKotlinVersion(expoConfig(), '2.2.10'));
+ expect(prebuild(config).gradleProperties).toContainEqual(
+ kotlinProperty('2.2.10'),
+ );
+ });
+ });
+});
diff --git a/android/build.gradle b/android/build.gradle
index b0d8ed25..774dd405 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -15,24 +15,32 @@
* Contains gradle configuration constants
*/
ext {
- NUTRIENT_VERSION = '11.6.4'
+ // Pinned to the released Nutrient Android SDK. Override with `nutrient.version` (and, for a
+ // build that is not on Maven Central, `nutrient.mavenUrl`) in the app's `local.properties`
+ // to build against a nightly, a SNAPSHOT or a locally staged `-dev` build.
+ def nutrientLocalProperties = new Properties()
+ def nutrientLocalPropertiesFile = rootProject.file('local.properties')
+ if (nutrientLocalPropertiesFile.exists()) {
+ nutrientLocalPropertiesFile.withReader('UTF-8') { nutrientLocalProperties.load(it) }
+ }
+ NUTRIENT_VERSION = nutrientLocalProperties.getProperty('nutrient.version') ?: '12.1.0'
+ NUTRIENT_MAVEN_URL = nutrientLocalProperties.getProperty('nutrient.mavenUrl')
+}
+
+if (NUTRIENT_MAVEN_URL != null) {
+ rootProject.allprojects {
+ repositories {
+ maven { url NUTRIENT_MAVEN_URL }
+ }
+ }
}
buildscript {
+ // Nutrient's metadata is compiled with Kotlin 2.4, so an integrator's Kotlin version has to
+ // be at least that. Anything older fails to read the SDK's .kotlin_module files.
ext.kotlin_version = rootProject.ext.has('kotlinVersion') ? rootProject.ext.kotlinVersion :
rootProject.ext.has('kotlin_version') ? rootProject.ext.kotlin_version :
- '1.9.24'
-
- ext.getComposeVersion = { kotlin_version ->
- switch (kotlin_version) {
- case ~/2\..*/:
- // For Kotlin 2.x+, compose compiler is handled by the plugin
- return null
- case '1.9.25': return '1.5.15'
- case '1.9.24': return '1.5.14'
- default: return '1.5.14'
- }
- }
+ '2.4.10'
repositories {
mavenCentral()
@@ -43,20 +51,44 @@ buildscript {
}
dependencies {
- classpath("com.android.tools.build:gradle:8.5.0")
+ // Only used when this module is built on its own: inside an app, the app's Android Gradle
+ // Plugin applies. 9.2.1 is what React Native 0.87 and later come with.
+ classpath("com.android.tools.build:gradle:9.2.1")
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
- // Add Compose compiler plugin for Kotlin 2.0+
- if (kotlin_version.startsWith('2')) {
- classpath "org.jetbrains.kotlin:compose-compiler-gradle-plugin:$kotlin_version"
- }
+ classpath "org.jetbrains.kotlin:compose-compiler-gradle-plugin:$kotlin_version"
}
}
+def nutrientVersionAtLeast = { String version, List minimum ->
+ def parts = version.tokenize('.-').take(3).collect { it.isInteger() ? it.toInteger() : 0 }
+ while (parts.size() < 3) parts << 0
+ for (int i = 0; i < 3; i++) {
+ if (parts[i] != minimum[i]) return parts[i] > minimum[i]
+ }
+ return true
+}
+def appAgpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION
+
apply plugin: 'com.android.library'
-apply plugin: 'kotlin-android'
-// Add Compose compiler plugin for Kotlin 2.0+
-if (kotlin_version.startsWith('2')) {
- apply plugin: 'org.jetbrains.kotlin.plugin.compose'
+// AGP 9 compiles Kotlin itself and refuses the kotlin-android plugin, unless the app opts out with
+// `android.builtInKotlin=false` (as the React Native 0.87+ templates do).
+if (!nutrientVersionAtLeast(appAgpVersion, [9, 0, 0]) || project.findProperty('android.builtInKotlin')?.toString() == 'false') {
+ apply plugin: 'kotlin-android'
+}
+apply plugin: 'org.jetbrains.kotlin.plugin.compose'
+
+// The app's own Android Gradle Plugin and Kotlin are the ones in use, not the versions above. With
+// anything older than Nutrient needs, the build fails in checkAarMetadata (Nutrient Android 12's
+// Compose dependencies need AGP 9.1) or on Kotlin metadata, so say what to upgrade here. React
+// Native 0.86 and older can't run AGP 9, because their Gradle plugin uses AGP 8-only APIs.
+def appKotlinVersion = org.jetbrains.kotlin.gradle.plugin.KotlinPluginWrapperKt.getKotlinPluginVersion(project)
+if (!nutrientVersionAtLeast(appAgpVersion, [9, 1, 0]) || !nutrientVersionAtLeast(appKotlinVersion, [2, 4, 10])) {
+ throw new GradleException(
+ "@nutrient-sdk/react-native needs React Native 0.87 or later, Android Gradle Plugin 9.1 or later " +
+ "and Kotlin 2.4.10 or later, " +
+ "but this build uses Android Gradle Plugin $appAgpVersion and Kotlin $appKotlinVersion. " +
+ "Raise them in your app's Gradle files; the @nutrient-sdk/react-native changelog lists every " +
+ "toolchain version this release needs.")
}
def isNewArchitectureEnabled() {
@@ -71,15 +103,19 @@ if (isNewArchitectureEnabled()) {
apply plugin: "com.facebook.react"
}
android {
- compileSdkVersion 34
+ compileSdk 37
+ // API 37 ships as minor platform releases; Nutrient's AAR metadata requires android-37.1,
+ // so both the major and the minor version have to be set or the build fails in
+ // checkDebugAarMetadata before any source is compiled.
+ compileSdkMinor 1
namespace "com.pspdfkit.react"
defaultConfig {
minSdkVersion 24
- targetSdkVersion 34
versionCode 1
versionName "1.0"
+ consumerProguardFiles "consumer-rules.pro"
}
sourceSets {
@@ -88,6 +124,9 @@ android {
// Conditionally include newarch sources only when New Architecture is enabled
if (isNewArchitectureEnabled()) {
java.srcDirs += ["src/newarch/java"]
+ // AGP 9's built-in Kotlin only takes the .java files from java.srcDirs, so without
+ // this the Fabric view managers and events would silently be left out.
+ kotlin.srcDirs += ["src/newarch/java"]
}
}
}
@@ -97,7 +136,7 @@ android {
targetCompatibility JavaVersion.VERSION_17
}
- lintOptions {
+ lint {
abortOnError false
}
@@ -105,18 +144,12 @@ android {
buildConfig true
compose true
}
+}
- composeOptions {
- def composeVersion = getComposeVersion(kotlin_version)
- if (composeVersion != null) {
- kotlinCompilerExtensionVersion composeVersion
- }
- // When using Kotlin 2.0+, the kotlinCompilerExtensionVersion is handled by the plugin
- }
-
- kotlin {
- jvmToolchain(17)
- }
+// Top level, not inside `android { }`: under AGP 9 the Kotlin toolchain is configured on the
+// Kotlin extension. Nesting it only ever worked because Groovy resolved it against the project.
+kotlin {
+ jvmToolchain(17)
}
// IMPORTANT: Do not force Compose runtime versions here.
@@ -142,7 +175,6 @@ dependencies {
implementation "androidx.recyclerview:recyclerview:1.4.0"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3"
- implementation "org.jetbrains.kotlinx:kotlinx-coroutines-rx3:1.7.3"
// Let Nutrient manage Compose versions.
diff --git a/android/consumer-rules.pro b/android/consumer-rules.pro
new file mode 100644
index 00000000..6d5f6186
--- /dev/null
+++ b/android/consumer-rules.pro
@@ -0,0 +1,15 @@
+# Keep rules applied to apps that use this module when they build with R8. Keep only what is reached
+# by name rather than by a normal Java/Kotlin reference. React Native's own rules already keep every
+# NativeModule (including turbo modules and view managers) and @ReactMethod/@ReactProp members.
+
+# PSPDFKitPackage creates these with Class.forName, reading NAME and calling their constructors, so
+# the old architecture can run without the new-architecture classes on the classpath.
+-keep class io.nutrient.react.turbo.NutrientTurboModule { public static final java.lang.String NAME; (...); }
+-keep class io.nutrient.react.turbo.NutrientViewTurboModule { public static final java.lang.String NAME; (...); }
+-keep class io.nutrient.react.turbo.NutrientInstantViewTurboModule { public static final java.lang.String NAME; (...); }
+-keep class io.nutrient.react.fabric.ReactPdfViewManagerFabric { (); }
+-keep class io.nutrient.react.fabric.ReactInstantPdfViewManagerFabric { (); }
+
+# The Nutrient Android SDK detects React Native with Class.forName on these names (HybridLicenseHelper).
+-keepnames class com.pspdfkit.react.PSPDFKitPackage
+-keepnames class com.pspdfkit.react.PSPDFKitModule
diff --git a/android/src/main/java/com/pspdfkit/react/AnnotationConfigurationAdaptor.kt b/android/src/main/java/com/pspdfkit/react/AnnotationConfigurationAdaptor.kt
index 982be344..e1da3c05 100644
--- a/android/src/main/java/com/pspdfkit/react/AnnotationConfigurationAdaptor.kt
+++ b/android/src/main/java/com/pspdfkit/react/AnnotationConfigurationAdaptor.kt
@@ -51,6 +51,12 @@ const val MAX_ALPHA = "maximumAlpha"
const val MIN_ALPHA = "minimumAlpha"
const val MAX_THICKNESS = "maximumThickness"
const val MIN_THICKNESS = "minimumThickness"
+/**
+ * Accepted and ignored, so existing configurations keep loading. Nutrient Android unified the two
+ * annotation-inspector color pickers into a single Compose picker and removed
+ * `setCustomColorPickerEnabled`, so there is no second picker to switch to. The JavaScript option is
+ * deprecated (https://linear.app/nutrient/issue/HYB-1089).
+ */
const val CUSTOM_COLOR_PICKER_ENABLED = "customColorPickerEnabled"
const val Z_INDEX_EDITING_ENABLED = "zIndexEditingEnabled"
const val AGGREGATION_STRATEGY = "aggregationStrategy"
@@ -357,9 +363,7 @@ class AnnotationConfigurationAdaptor {
MIN_ALPHA -> builder.setMinAlpha(configuration.getDouble(key).toFloat())
MAX_THICKNESS -> builder.setMaxThickness(configuration.getDouble(key).toFloat())
MIN_THICKNESS -> builder.setMinThickness(configuration.getDouble(key).toFloat())
- CUSTOM_COLOR_PICKER_ENABLED -> builder.setCustomColorPickerEnabled(
- configuration.getBoolean(key)
- )
+ CUSTOM_COLOR_PICKER_ENABLED -> {}
PREVIEW_ENABLED -> builder.setPreviewEnabled(configuration.getBoolean(key))
Z_INDEX_EDITING_ENABLED -> builder.setZIndexEditingEnabled(
@@ -411,9 +415,7 @@ class AnnotationConfigurationAdaptor {
MIN_ALPHA -> builder.setMinAlpha(configuration.getDouble(key).toFloat())
MAX_THICKNESS -> builder.setMaxThickness(configuration.getDouble(key).toFloat())
MIN_THICKNESS -> builder.setMinThickness(configuration.getDouble(key).toFloat())
- CUSTOM_COLOR_PICKER_ENABLED -> builder.setCustomColorPickerEnabled(
- configuration.getBoolean(key)
- )
+ CUSTOM_COLOR_PICKER_ENABLED -> {}
PREVIEW_ENABLED -> builder.setPreviewEnabled(configuration.getBoolean(key))
Z_INDEX_EDITING_ENABLED -> builder.setZIndexEditingEnabled(
@@ -481,9 +483,7 @@ class AnnotationConfigurationAdaptor {
MIN_ALPHA -> builder.setMinAlpha(configuration.getDouble(key).toFloat())
MAX_THICKNESS -> builder.setMaxThickness(configuration.getDouble(key).toFloat())
MIN_THICKNESS -> builder.setMinThickness(configuration.getDouble(key).toFloat())
- CUSTOM_COLOR_PICKER_ENABLED -> builder.setCustomColorPickerEnabled(
- configuration.getBoolean(key)
- )
+ CUSTOM_COLOR_PICKER_ENABLED -> {}
PREVIEW_ENABLED -> builder.setPreviewEnabled(configuration.getBoolean(key))
Z_INDEX_EDITING_ENABLED -> builder.setZIndexEditingEnabled(
@@ -572,11 +572,7 @@ class AnnotationConfigurationAdaptor {
MIN_ALPHA -> builder.setMinAlpha(configuration.getDouble(key).toFloat())
MAX_THICKNESS -> builder.setMaxThickness(configuration.getDouble(key).toFloat())
MIN_THICKNESS -> builder.setMinThickness(configuration.getDouble(key).toFloat())
- CUSTOM_COLOR_PICKER_ENABLED -> builder.setCustomColorPickerEnabled(
- configuration.getBoolean(
- key
- )
- )
+ CUSTOM_COLOR_PICKER_ENABLED -> {}
Z_INDEX_EDITING_ENABLED -> builder.setZIndexEditingEnabled(
configuration.getBoolean(
@@ -633,11 +629,7 @@ class AnnotationConfigurationAdaptor {
MAX_ALPHA -> builder.setMaxAlpha(configuration.getDouble(key).toFloat())
MIN_ALPHA -> builder.setMinAlpha(configuration.getDouble(key).toFloat())
- CUSTOM_COLOR_PICKER_ENABLED -> builder.setCustomColorPickerEnabled(
- configuration.getBoolean(
- key
- )
- )
+ CUSTOM_COLOR_PICKER_ENABLED -> {}
Z_INDEX_EDITING_ENABLED -> builder.setZIndexEditingEnabled(
configuration.getBoolean(
@@ -843,11 +835,7 @@ class AnnotationConfigurationAdaptor {
)
}
- CUSTOM_COLOR_PICKER_ENABLED -> builder.setCustomColorPickerEnabled(
- configuration.getBoolean(
- key
- )
- )
+ CUSTOM_COLOR_PICKER_ENABLED -> {}
PREVIEW_ENABLED -> builder.setPreviewEnabled(configuration.getBoolean(key))
Z_INDEX_EDITING_ENABLED -> builder.setZIndexEditingEnabled(
@@ -892,11 +880,7 @@ class AnnotationConfigurationAdaptor {
builder.setAvailableColors(extractColors(colors.toArrayList().map { it as String }))
}
- CUSTOM_COLOR_PICKER_ENABLED -> builder.setCustomColorPickerEnabled(
- configuration.getBoolean(
- key
- )
- )
+ CUSTOM_COLOR_PICKER_ENABLED -> {}
DEFAULT_ICON_NAME -> configuration.getString(
key
@@ -955,11 +939,7 @@ class AnnotationConfigurationAdaptor {
builder.setAvailableFillColors(extractColors(fillColors.toArrayList().map { it as String }))
}
- CUSTOM_COLOR_PICKER_ENABLED -> builder.setCustomColorPickerEnabled(
- configuration.getBoolean(
- key
- )
- )
+ CUSTOM_COLOR_PICKER_ENABLED -> {}
DEFAULT_THICKNESS -> builder.setDefaultThickness(
configuration.getDouble(key).toFloat()
@@ -1054,11 +1034,7 @@ class AnnotationConfigurationAdaptor {
builder.setAvailableColors(extractColors(colors.toArrayList().map { it as String }))
}
- CUSTOM_COLOR_PICKER_ENABLED -> builder.setCustomColorPickerEnabled(
- configuration.getBoolean(
- key
- )
- )
+ CUSTOM_COLOR_PICKER_ENABLED -> {}
DEFAULT_TEXT_SIZE -> builder.setDefaultTextSize(
configuration.getDouble(key).toFloat()
@@ -1151,11 +1127,7 @@ class AnnotationConfigurationAdaptor {
MIN_ALPHA -> builder.setMinAlpha(configuration.getDouble(key).toFloat())
MAX_THICKNESS -> builder.setMaxThickness(configuration.getDouble(key).toFloat())
MIN_THICKNESS -> builder.setMinThickness(configuration.getDouble(key).toFloat())
- CUSTOM_COLOR_PICKER_ENABLED -> builder.setCustomColorPickerEnabled(
- configuration.getBoolean(
- key
- )
- )
+ CUSTOM_COLOR_PICKER_ENABLED -> {}
PREVIEW_ENABLED -> builder.setPreviewEnabled(configuration.getBoolean(key))
Z_INDEX_EDITING_ENABLED -> builder.setZIndexEditingEnabled(
diff --git a/android/src/main/java/com/pspdfkit/react/ConfigurationAdapter.java b/android/src/main/java/com/pspdfkit/react/ConfigurationAdapter.java
index 47cd8ccc..bb40b277 100644
--- a/android/src/main/java/com/pspdfkit/react/ConfigurationAdapter.java
+++ b/android/src/main/java/com/pspdfkit/react/ConfigurationAdapter.java
@@ -168,18 +168,13 @@ public ConfigurationAdapter(@NonNull final Context context, ReadableMap configur
// Match the default PdfView configuration: disable immersive mode. Text selection uses the
// SDK popup toolbar by default; React Native customizes it via OnPreparePopupToolbarListener
// (see NutrientTextSelectionPopupMenuBridge). The legacy key androidUseTextSelectionToolbar
- // is still honored for apps that explicitly force the contextual TextSelectionToolbar.
+ // is ignored: Nutrient Android removed the docked TextSelectionToolbar it switched to.
this.configuration
.contentEditingEnabled(false)
.immersiveModeEnabled(false);
if (hasConfiguration) {
String key;
- key = getKeyOrNull(configuration, "androidUseTextSelectionToolbar");
- if (key != null && configuration.getBoolean(key)) {
- this.configuration.textSelectionPopupToolbarEnabled(false);
- }
-
key = getKeyOrNull(configuration, PAGE_SCROLL_DIRECTION);
if (key != null) {
configurePageScrollDirection(configuration.getString(key));
diff --git a/android/src/main/java/com/pspdfkit/react/PDFDocumentModule.kt b/android/src/main/java/com/pspdfkit/react/PDFDocumentModule.kt
index 3c2194a1..a543953a 100644
--- a/android/src/main/java/com/pspdfkit/react/PDFDocumentModule.kt
+++ b/android/src/main/java/com/pspdfkit/react/PDFDocumentModule.kt
@@ -29,7 +29,6 @@ import com.pspdfkit.forms.SignatureFormElement
import com.pspdfkit.forms.TextFormElement
import com.pspdfkit.forms.SignatureFormConfiguration
import com.pspdfkit.forms.TextFormConfiguration
-import com.pspdfkit.internal.jni.NativeFormFlags
import android.graphics.RectF
import com.pspdfkit.react.helper.AnnotationUtils
import com.pspdfkit.react.helper.BookmarkUtils
@@ -37,15 +36,15 @@ import com.pspdfkit.react.helper.ConversionHelpers.getAnnotationTypes
import com.pspdfkit.react.helper.DocumentJsonDataProvider
import com.pspdfkit.react.helper.FormUtils
import com.pspdfkit.react.helper.JsonUtilities
-import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
-import io.reactivex.rxjava3.schedulers.Schedulers
import org.json.JSONObject
import java.io.ByteArrayOutputStream
import java.util.EnumSet
+import java.util.WeakHashMap
import androidx.core.graphics.toColorInt
import java.lang.ref.WeakReference
import com.pspdfkit.views.PdfView
import com.pspdfkit.ui.PdfFragment
+import com.pspdfkit.ui.annotations.OnAnnotationSelectedListener
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.SupervisorJob
@@ -75,6 +74,8 @@ class PDFDocumentModule(reactContext: ReactApplicationContext) : ReactContextBas
private val documents = ConcurrentHashMap()
private val documentConfigurations = ConcurrentHashMap>()
+ // Main thread only, at most one deferred popup toolbar request per fragment.
+ private val pendingPopupToolbarListeners = WeakHashMap()
override fun getName(): String {
return NAME
@@ -108,13 +109,7 @@ class PDFDocumentModule(reactContext: ReactApplicationContext) : ReactContextBas
val docData = this@PDFDocumentModule.getDocument(reference)
val pdfView = docData?.pdfViewRef?.get()
if (pdfView != null) {
- pdfView.getPdfFragment()
- .take(1)
- .observeOn(AndroidSchedulers.mainThread())
- .subscribe(
- { pdfFragment -> pdfFragment.notifyAnnotationHasChanged(foundAnnotation!!) },
- { /* Ignore errors if fragment is not available */ }
- )
+ pdfView.withPdfFragment { pdfFragment -> pdfFragment.notifyAnnotationHasChanged(foundAnnotation!!) }
}
}
promise.resolve(foundAnnotation != null)
@@ -283,6 +278,7 @@ class PDFDocumentModule(reactContext: ReactApplicationContext) : ReactContextBas
promise.resolve(true)
return
}
+ promise.reject("save error", "Document is nil")
} catch (e: Throwable) {
promise.reject("save error", e)
}
@@ -489,7 +485,7 @@ class PDFDocumentModule(reactContext: ReactApplicationContext) : ReactContextBas
promise.reject(RuntimeException(e))
}
}
- }
+ } ?: promise.reject("applyInstantJSON error", "Document is nil")
} catch (e: Throwable) {
promise.reject("applyInstantJSON error", e)
}
@@ -504,31 +500,27 @@ class PDFDocumentModule(reactContext: ReactApplicationContext) : ReactContextBas
}
val document = it
- XfdfFormatter.parseXfdfAsync(document, ContentResolverDataProvider((Uri.parse(importPath))))
- .subscribeOn(Schedulers.io())
- .observeOn(AndroidSchedulers.mainThread())
- .subscribe(
- { annotations ->
- scope.launch {
- try {
- withContext(Dispatchers.Default) {
- for (annotation in annotations) {
- document.annotationProvider.addAnnotationToPage(annotation)
- }
- }
- val result = JSONObject()
- result.put("success", true)
- val jsonMap = JsonUtilities.jsonObjectToMap(result)
- val nativeMap = Arguments.makeNativeMap(jsonMap)
- promise.resolve(nativeMap)
- } catch (e: Throwable) {
- promise.reject("importXFDF error", e)
- }
+ scope.launch {
+ try {
+ // XfdfFormatter runs on the calling thread.
+ val annotations = withContext(Dispatchers.IO) {
+ XfdfFormatter.parseXfdfAsync(document, ContentResolverDataProvider((Uri.parse(importPath))))
+ }
+ withContext(Dispatchers.Default) {
+ for (annotation in annotations) {
+ document.annotationProvider.addAnnotationToPage(annotation)
}
- }, { e ->
- promise.reject("importXFDF error", e)
- })
- }
+ }
+ val result = JSONObject()
+ result.put("success", true)
+ val jsonMap = JsonUtilities.jsonObjectToMap(result)
+ val nativeMap = Arguments.makeNativeMap(jsonMap)
+ promise.resolve(nativeMap)
+ } catch (e: Throwable) {
+ promise.reject("importXFDF error", e)
+ }
+ }
+ } ?: promise.reject("importXFDF error", "Document is nil")
} catch (e: Throwable) {
promise.reject("importXFDF error", e)
}
@@ -556,30 +548,21 @@ class PDFDocumentModule(reactContext: ReactApplicationContext) : ReactContextBas
}
var allFormFields: List = emptyList()
if (Nutrient.getLicenseFeatures().contains(LicenseFeature.FORMS)) {
- allFormFields = document.formProvider.formFields
+ allFormFields = document.formProvider.getFormFields()
}
- XfdfFormatter.writeXfdfAsync(document, allAnnotations, allFormFields, outputStream)
- .subscribeOn(Schedulers.io())
- .observeOn(AndroidSchedulers.mainThread())
- .subscribe(
- {
- try {
- outputStream.close()
- } catch (_: Exception) { /* ignore */ }
- val result = JSONObject()
- result.put("success", true)
- result.put("filePath", filePath)
- val jsonMap = JsonUtilities.jsonObjectToMap(result)
- val nativeMap = Arguments.makeNativeMap(jsonMap)
- promise.resolve(nativeMap)
- },
- { e ->
- try {
- outputStream.close()
- } catch (_: Exception) { /* ignore */ }
- promise.reject("exportXFDF error", e)
- }
- )
+ // XfdfFormatter runs on the calling thread.
+ withContext(Dispatchers.IO) {
+ XfdfFormatter.writeXfdfAsync(document, allAnnotations, allFormFields, outputStream)
+ }
+ try {
+ outputStream.close()
+ } catch (_: Exception) { /* ignore */ }
+ val result = JSONObject()
+ result.put("success", true)
+ result.put("filePath", filePath)
+ val jsonMap = JsonUtilities.jsonObjectToMap(result)
+ val nativeMap = Arguments.makeNativeMap(jsonMap)
+ promise.resolve(nativeMap)
} catch (e: Throwable) {
try {
outputStream.close()
@@ -590,38 +573,54 @@ class PDFDocumentModule(reactContext: ReactApplicationContext) : ReactContextBas
}
@ReactMethod fun getFormElements(reference: Int, promise: Promise) {
- try {
- this.getDocument(reference)?.document?.let {
-
- val formElements = it.formProvider.formElements
- val formElementsJSON = ArrayList