react-native-nitro-xlsx 0.1.4 → 0.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (428) hide show
  1. package/NitroXlsx.podspec +27 -27
  2. package/Package.swift +35 -10
  3. package/README.md +220 -58
  4. package/android/CMakeLists.txt +24 -27
  5. package/android/cpp-adapter.cpp +12 -0
  6. package/android/src/main/java/com/margelo/nitro/xlsx/NitroXlsxPackage.kt +9 -0
  7. package/cpp/HybridNitroXlsx.cpp +25 -179
  8. package/cpp/HybridNitroXlsx.hpp +2 -2
  9. package/cpp/HybridXlsxConditionalFormat.cpp +252 -0
  10. package/cpp/HybridXlsxConditionalFormat.hpp +62 -0
  11. package/cpp/HybridXlsxConditionalFormats.cpp +46 -0
  12. package/cpp/HybridXlsxConditionalFormats.hpp +28 -0
  13. package/cpp/HybridXlsxWorkbook.cpp +159 -196
  14. package/cpp/HybridXlsxWorkbook.hpp +7 -2
  15. package/cpp/HybridXlsxWorksheet.cpp +433 -62
  16. package/cpp/HybridXlsxWorksheet.hpp +73 -26
  17. package/cpp/XlsxCacheDir.cpp +76 -0
  18. package/cpp/XlsxCacheDir.hpp +27 -0
  19. package/cpp/XlsxError.hpp +68 -0
  20. package/cpp/XlsxJson.cpp +185 -0
  21. package/cpp/XlsxJson.hpp +36 -0
  22. package/ios/XlsxCacheDir.mm +60 -0
  23. package/nitrogen/generated/android/NitroXlsx+autolinking.cmake +2 -0
  24. package/nitrogen/generated/shared/c++/HybridNitroXlsxSpec.hpp +5 -3
  25. package/nitrogen/generated/shared/c++/HybridXlsxConditionalFormatSpec.cpp +54 -0
  26. package/nitrogen/generated/shared/c++/HybridXlsxConditionalFormatSpec.hpp +95 -0
  27. package/nitrogen/generated/shared/c++/HybridXlsxConditionalFormatsSpec.cpp +24 -0
  28. package/nitrogen/generated/shared/c++/HybridXlsxConditionalFormatsSpec.hpp +68 -0
  29. package/nitrogen/generated/shared/c++/HybridXlsxWorkbookSpec.cpp +3 -0
  30. package/nitrogen/generated/shared/c++/HybridXlsxWorkbookSpec.hpp +6 -1
  31. package/nitrogen/generated/shared/c++/HybridXlsxWorksheetSpec.cpp +47 -19
  32. package/nitrogen/generated/shared/c++/HybridXlsxWorksheetSpec.hpp +52 -20
  33. package/package.json +3 -3
  34. package/scripts/run-cpp-tests.sh +14 -0
  35. package/src/__mocks__/react-native-nitro-modules.ts +1 -0
  36. package/src/__tests__/index.test.ts +76 -7
  37. package/src/index.ts +107 -18
  38. package/src/specs/NitroXlsx.nitro.ts +141 -44
  39. package/thirdparty/OpenXLSX/.clang-format +118 -0
  40. package/thirdparty/OpenXLSX/.clang-tidy +28 -0
  41. package/thirdparty/OpenXLSX/.gitignore +130 -0
  42. package/thirdparty/OpenXLSX/Benchmarks/2024-07-29-benchmarks_before_XMLNode_wrappers +46 -0
  43. package/thirdparty/OpenXLSX/Benchmarks/2024-07-29-benchmarks_with_XMLNode_wrappers_and_namespace_and_stripping +49 -0
  44. package/thirdparty/OpenXLSX/Benchmarks/2024-07-29-benchmarks_with_XMLNode_wrappers_and_namespace_char_support +49 -0
  45. package/thirdparty/OpenXLSX/Benchmarks/2024-07-29-benchmarks_with_XMLNode_wrappers_and_namespace_support +49 -0
  46. package/thirdparty/OpenXLSX/Benchmarks/2024-07-29-benchmarks_with_XMLNode_wrappers_and_namespaced_name_disabled +49 -0
  47. package/thirdparty/OpenXLSX/Benchmarks/2024-08-11-benchmarks_post-XLCellIterator-Rework +46 -0
  48. package/thirdparty/OpenXLSX/Benchmarks/2024-08-14-benchmarks_post-default-row-column-style-support +46 -0
  49. package/thirdparty/OpenXLSX/Benchmarks/2024-09-02-benchmarks +46 -0
  50. package/thirdparty/OpenXLSX/Benchmarks/2024-12-19-benchmarks +46 -0
  51. package/thirdparty/OpenXLSX/Benchmarks/2024-12-30-benchmarks-post-XLSharedStrings-by-ref +46 -0
  52. package/thirdparty/OpenXLSX/Benchmarks/2025-01-09-benchmarks-post-conditionalFormatsAndSheetProtection +46 -0
  53. package/thirdparty/OpenXLSX/Benchmarks/2025-01-10-benchmarks-post-XLCellValue-bugfix +46 -0
  54. package/thirdparty/OpenXLSX/Benchmarks/2025-01-31-benchmarks-post-XLComments-implementation +46 -0
  55. package/thirdparty/OpenXLSX/Benchmarks/2025-02-02-benchmarks-post-XLRowIterator-Rework +46 -0
  56. package/thirdparty/OpenXLSX/Benchmarks/2025-07-20-benchmarks-after-hiding-pugixml-internals +46 -0
  57. package/thirdparty/OpenXLSX/Benchmarks/2025-08-29-benchmarks-after-code-review-with-libzip +46 -0
  58. package/thirdparty/OpenXLSX/Benchmarks/Benchmark.cpp +249 -0
  59. package/thirdparty/OpenXLSX/Benchmarks/CMakeLists.txt +19 -0
  60. package/thirdparty/OpenXLSX/CMakeLists.txt +466 -0
  61. package/thirdparty/OpenXLSX/Documentation/CMakeLists.txt +31 -0
  62. package/thirdparty/OpenXLSX/Documentation/Doxyfile.in +2471 -0
  63. package/thirdparty/OpenXLSX/Documentation/DoxygenLayout.xml +194 -0
  64. package/thirdparty/OpenXLSX/Documentation/customdoxygen.css +1355 -0
  65. package/thirdparty/OpenXLSX/Examples/CMakeLists.txt +103 -0
  66. package/thirdparty/OpenXLSX/Examples/Demo1.cpp +279 -0
  67. package/thirdparty/OpenXLSX/Examples/Demo10.cpp +545 -0
  68. package/thirdparty/OpenXLSX/Examples/Demo1A.cpp +137 -0
  69. package/thirdparty/OpenXLSX/Examples/Demo2.cpp +65 -0
  70. package/thirdparty/OpenXLSX/Examples/Demo3.cpp +89 -0
  71. package/thirdparty/OpenXLSX/Examples/Demo4.cpp +86 -0
  72. package/thirdparty/OpenXLSX/Examples/Demo5.cpp +77 -0
  73. package/thirdparty/OpenXLSX/Examples/Demo6.cpp +103 -0
  74. package/thirdparty/OpenXLSX/Examples/Demo7.cpp +79 -0
  75. package/thirdparty/OpenXLSX/Examples/Demo8.cpp +117 -0
  76. package/thirdparty/OpenXLSX/Examples/Demo9.cpp +363 -0
  77. package/thirdparty/OpenXLSX/Examples/cmake/FindLIBZIP.cmake +61 -0
  78. package/thirdparty/OpenXLSX/Examples/external/CustomZip/CustomZip.hpp +256 -0
  79. package/thirdparty/OpenXLSX/LICENSE.md +29 -0
  80. package/thirdparty/OpenXLSX/Makefile.GNU +530 -0
  81. package/thirdparty/OpenXLSX/Notes/TBDs.txt +16 -0
  82. package/thirdparty/OpenXLSX/Notes/confirmed-TBCs.txt +8 -0
  83. package/thirdparty/OpenXLSX/Notes/styles-missing-support.xml +12 -0
  84. package/thirdparty/OpenXLSX/Notes/todo-list.txt +108 -0
  85. package/thirdparty/OpenXLSX/OpenXLSX/CMakeLists.txt +631 -0
  86. package/thirdparty/OpenXLSX/OpenXLSX/OpenXLSX.hpp +63 -0
  87. package/thirdparty/OpenXLSX/OpenXLSX/OpenXLSXConfig.cmake +11 -0
  88. package/thirdparty/OpenXLSX/OpenXLSX/cmake/bundle_static_library.cmake +198 -0
  89. package/thirdparty/OpenXLSX/OpenXLSX/cmake/patch_pkg_config.cmake +69 -0
  90. package/thirdparty/OpenXLSX/OpenXLSX/headers/IZipArchive.hpp +361 -0
  91. package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX-Exports.hpp +12 -0
  92. package/thirdparty/OpenXLSX/OpenXLSX/headers/XLCell.hpp +367 -0
  93. package/thirdparty/OpenXLSX/OpenXLSX/headers/XLCellIterator.hpp +252 -0
  94. package/thirdparty/OpenXLSX/OpenXLSX/headers/XLCellRange.hpp +223 -0
  95. package/thirdparty/OpenXLSX/OpenXLSX/headers/XLCellReference.hpp +317 -0
  96. package/thirdparty/OpenXLSX/OpenXLSX/headers/XLCellValue.hpp +793 -0
  97. package/thirdparty/OpenXLSX/OpenXLSX/headers/XLColor.hpp +232 -0
  98. package/thirdparty/OpenXLSX/OpenXLSX/headers/XLColumn.hpp +159 -0
  99. package/thirdparty/OpenXLSX/OpenXLSX/headers/XLCommandQuery.hpp +228 -0
  100. package/thirdparty/OpenXLSX/OpenXLSX/headers/XLComments.hpp +270 -0
  101. package/thirdparty/OpenXLSX/OpenXLSX/headers/XLConstants.hpp +18 -0
  102. package/thirdparty/OpenXLSX/OpenXLSX/headers/XLContentTypes.hpp +264 -0
  103. package/thirdparty/OpenXLSX/OpenXLSX/headers/XLDateTime.hpp +175 -0
  104. package/thirdparty/OpenXLSX/OpenXLSX/headers/XLDocument.hpp +505 -0
  105. package/thirdparty/OpenXLSX/OpenXLSX/headers/XLDrawing.hpp +452 -0
  106. package/thirdparty/OpenXLSX/OpenXLSX/headers/XLException.hpp +161 -0
  107. package/thirdparty/OpenXLSX/OpenXLSX/headers/XLFormula.hpp +375 -0
  108. package/thirdparty/OpenXLSX/OpenXLSX/headers/XLIterator.hpp +40 -0
  109. package/thirdparty/OpenXLSX/OpenXLSX/headers/XLMergeCells.hpp +216 -0
  110. package/thirdparty/OpenXLSX/OpenXLSX/headers/XLProperties.hpp +348 -0
  111. package/thirdparty/OpenXLSX/OpenXLSX/headers/XLRelationships.hpp +348 -0
  112. package/thirdparty/OpenXLSX/OpenXLSX/headers/XLRow.hpp +721 -0
  113. package/thirdparty/OpenXLSX/OpenXLSX/headers/XLRowData.hpp +488 -0
  114. package/thirdparty/OpenXLSX/OpenXLSX/headers/XLSharedStrings.hpp +204 -0
  115. package/thirdparty/OpenXLSX/OpenXLSX/headers/XLSheet.hpp +1640 -0
  116. package/thirdparty/OpenXLSX/OpenXLSX/headers/XLStyles.hpp +2390 -0
  117. package/thirdparty/OpenXLSX/OpenXLSX/headers/XLTables.hpp +132 -0
  118. package/thirdparty/OpenXLSX/OpenXLSX/headers/XLWorkbook.hpp +404 -0
  119. package/thirdparty/OpenXLSX/OpenXLSX/headers/XLXmlData.hpp +283 -0
  120. package/thirdparty/OpenXLSX/OpenXLSX/headers/XLXmlFile.hpp +194 -0
  121. package/thirdparty/OpenXLSX/OpenXLSX/headers/XLXmlParser.hpp +282 -0
  122. package/thirdparty/OpenXLSX/OpenXLSX/headers/XLXmlParserForwardDeclarations.hpp +85 -0
  123. package/thirdparty/OpenXLSX/OpenXLSX/headers/XLZipArchive.hpp +232 -0
  124. package/thirdparty/OpenXLSX/OpenXLSX/headers/detail/LibZip.hpp +447 -0
  125. package/thirdparty/OpenXLSX/OpenXLSX/headers/detail/OpenXLSXFileSystemTools.hpp +207 -0
  126. package/thirdparty/OpenXLSX/OpenXLSX/headers/detail/Zippy.hpp +1375 -0
  127. package/thirdparty/OpenXLSX/OpenXLSX/sources/XLCell.cpp +340 -0
  128. package/thirdparty/OpenXLSX/OpenXLSX/sources/XLCellIterator.cpp +427 -0
  129. package/thirdparty/OpenXLSX/OpenXLSX/sources/XLCellRange.cpp +221 -0
  130. package/thirdparty/OpenXLSX/OpenXLSX/sources/XLCellReference.cpp +408 -0
  131. package/thirdparty/OpenXLSX/OpenXLSX/sources/XLCellValue.cpp +519 -0
  132. package/thirdparty/OpenXLSX/OpenXLSX/sources/XLColor.cpp +202 -0
  133. package/thirdparty/OpenXLSX/OpenXLSX/sources/XLColumn.cpp +141 -0
  134. package/thirdparty/OpenXLSX/OpenXLSX/sources/XLComments.cpp +637 -0
  135. package/thirdparty/OpenXLSX/OpenXLSX/sources/XLContentTypes.cpp +329 -0
  136. package/thirdparty/OpenXLSX/OpenXLSX/sources/XLDateTime.cpp +269 -0
  137. package/thirdparty/OpenXLSX/OpenXLSX/sources/XLDocument.cpp +1678 -0
  138. package/thirdparty/OpenXLSX/OpenXLSX/sources/XLDrawing.cpp +784 -0
  139. package/thirdparty/OpenXLSX/OpenXLSX/sources/XLFormula.cpp +201 -0
  140. package/thirdparty/OpenXLSX/OpenXLSX/sources/XLMergeCells.cpp +357 -0
  141. package/thirdparty/OpenXLSX/OpenXLSX/sources/XLProperties.cpp +810 -0
  142. package/thirdparty/OpenXLSX/OpenXLSX/sources/XLRelationships.cpp +529 -0
  143. package/thirdparty/OpenXLSX/OpenXLSX/sources/XLRow.cpp +918 -0
  144. package/thirdparty/OpenXLSX/OpenXLSX/sources/XLRowData.cpp +508 -0
  145. package/thirdparty/OpenXLSX/OpenXLSX/sources/XLSharedStrings.cpp +220 -0
  146. package/thirdparty/OpenXLSX/OpenXLSX/sources/XLSheet.cpp +1970 -0
  147. package/thirdparty/OpenXLSX/OpenXLSX/sources/XLStyles.cpp +3014 -0
  148. package/thirdparty/OpenXLSX/OpenXLSX/sources/XLTables.cpp +125 -0
  149. package/thirdparty/OpenXLSX/OpenXLSX/sources/XLWorkbook.cpp +784 -0
  150. package/thirdparty/OpenXLSX/OpenXLSX/sources/XLXmlData.cpp +247 -0
  151. package/thirdparty/OpenXLSX/OpenXLSX/sources/XLXmlFile.cpp +160 -0
  152. package/thirdparty/OpenXLSX/OpenXLSX/sources/XLXmlParser.cpp +261 -0
  153. package/thirdparty/OpenXLSX/OpenXLSX/sources/XLZipArchive.cpp +266 -0
  154. package/thirdparty/OpenXLSX/OpenXLSX/sources/utilities/XLUtilities.hpp +478 -0
  155. package/thirdparty/OpenXLSX/README.md +1279 -0
  156. package/thirdparty/OpenXLSX/Scripts/cmake-cleanup.sh +102 -0
  157. package/thirdparty/OpenXLSX/Scripts/compile.sh +23 -0
  158. package/thirdparty/OpenXLSX/Scripts/demos-cleanup.sh +25 -0
  159. package/thirdparty/OpenXLSX/Scripts/demos-run-all.sh +60 -0
  160. package/thirdparty/OpenXLSX/Scripts/guarded-xml-format.sh +47 -0
  161. package/thirdparty/OpenXLSX/Scripts/make-gnu.sh +11 -0
  162. package/thirdparty/OpenXLSX/Scripts/uninstall-manifest.sh +48 -0
  163. package/thirdparty/OpenXLSX/Scripts/xml-format-all.sh +19 -0
  164. package/thirdparty/OpenXLSX/Scripts/xml-format.sh +38 -0
  165. package/thirdparty/OpenXLSX/Tests/CMakeLists.txt +37 -0
  166. package/thirdparty/OpenXLSX/Tests/catch/catch.hpp +17799 -0
  167. package/thirdparty/OpenXLSX/Tests/catch/catch_reporter_automake.hpp +68 -0
  168. package/thirdparty/OpenXLSX/Tests/catch/catch_reporter_sonarqube.hpp +182 -0
  169. package/thirdparty/OpenXLSX/Tests/catch/catch_reporter_tap.hpp +278 -0
  170. package/thirdparty/OpenXLSX/Tests/catch/catch_reporter_teamcity.hpp +212 -0
  171. package/thirdparty/OpenXLSX/Tests/main.cpp +55 -0
  172. package/thirdparty/OpenXLSX/Tests/testXLCell.cpp +176 -0
  173. package/thirdparty/OpenXLSX/Tests/testXLCellRange.cpp +180 -0
  174. package/thirdparty/OpenXLSX/Tests/testXLCellReference.cpp +160 -0
  175. package/thirdparty/OpenXLSX/Tests/testXLCellValue.cpp +366 -0
  176. package/thirdparty/OpenXLSX/Tests/testXLCellValueProxy.cpp +255 -0
  177. package/thirdparty/OpenXLSX/Tests/testXLColor.cpp +75 -0
  178. package/thirdparty/OpenXLSX/Tests/testXLDateTime.cpp +229 -0
  179. package/thirdparty/OpenXLSX/Tests/testXLDocument.cpp +197 -0
  180. package/thirdparty/OpenXLSX/Tests/testXLFormula.cpp +131 -0
  181. package/thirdparty/OpenXLSX/Tests/testXLRow.cpp +597 -0
  182. package/thirdparty/OpenXLSX/Tests/testXLSheet.cpp +77 -0
  183. package/thirdparty/OpenXLSX/Tests/ziptest-with-libs.cpp +88 -0
  184. package/thirdparty/OpenXLSX/Tests/ziptest.cpp +735 -0
  185. package/thirdparty/OpenXLSX/cmake/get-git-HEAD-ID.cmake +45 -0
  186. package/thirdparty/OpenXLSX/cmake/libopenxlsxCPackOptions.cmake.in +20 -0
  187. package/thirdparty/OpenXLSX/cmake/manage_dependency.cmake +813 -0
  188. package/thirdparty/OpenXLSX/cmake/recursive_library_type_test.cmake +52 -0
  189. package/thirdparty/OpenXLSX/gnu-make-crutch/OpenXLSX-Exports-shared.hpp +42 -0
  190. package/thirdparty/OpenXLSX/gnu-make-crutch/OpenXLSX-Exports-static.hpp +42 -0
  191. package/thirdparty/OpenXLSX/vcpkg.json +24 -0
  192. package/thirdparty/README.md +42 -0
  193. package/thirdparty/miniz/.clang-format +47 -0
  194. package/thirdparty/miniz/.travis.yml +2 -0
  195. package/thirdparty/miniz/CMakeLists.txt +333 -0
  196. package/thirdparty/miniz/CMakePresets.json +31 -0
  197. package/thirdparty/miniz/ChangeLog.md +272 -0
  198. package/thirdparty/miniz/Config.cmake.in +1 -0
  199. package/thirdparty/miniz/LICENSE +22 -0
  200. package/thirdparty/miniz/amalgamate.sh +57 -0
  201. package/thirdparty/miniz/examples/example1.c +105 -0
  202. package/thirdparty/miniz/examples/example2.c +164 -0
  203. package/thirdparty/miniz/examples/example3.c +269 -0
  204. package/thirdparty/miniz/examples/example4.c +102 -0
  205. package/thirdparty/miniz/examples/example5.c +327 -0
  206. package/thirdparty/miniz/examples/example6.c +189 -0
  207. package/thirdparty/miniz/meson.build +21 -0
  208. package/thirdparty/miniz/miniz.c +646 -0
  209. package/thirdparty/miniz/miniz.h +615 -0
  210. package/thirdparty/miniz/miniz.pc.in +13 -0
  211. package/thirdparty/miniz/miniz_common.h +89 -0
  212. package/thirdparty/miniz/miniz_export.h +20 -0
  213. package/thirdparty/miniz/miniz_tdef.c +1602 -0
  214. package/thirdparty/miniz/miniz_tdef.h +199 -0
  215. package/thirdparty/miniz/miniz_tinfl.c +778 -0
  216. package/thirdparty/miniz/miniz_tinfl.h +150 -0
  217. package/thirdparty/miniz/miniz_zip.c +4895 -0
  218. package/thirdparty/miniz/miniz_zip.h +454 -0
  219. package/thirdparty/miniz/readme.md +46 -0
  220. package/thirdparty/miniz/test.sh +36 -0
  221. package/thirdparty/miniz/tests/add_in_place_fuzzer.c +87 -0
  222. package/thirdparty/miniz/tests/catch_amalgamated.cpp +10795 -0
  223. package/thirdparty/miniz/tests/catch_amalgamated.hpp +13143 -0
  224. package/thirdparty/miniz/tests/checksum_fuzzer.c +26 -0
  225. package/thirdparty/miniz/tests/compress_fuzzer.c +91 -0
  226. package/thirdparty/miniz/tests/flush_fuzzer.c +88 -0
  227. package/thirdparty/miniz/tests/fuzz_main.c +55 -0
  228. package/thirdparty/miniz/tests/large_fuzzer.c +133 -0
  229. package/thirdparty/miniz/tests/main.cpp +185 -0
  230. package/thirdparty/miniz/tests/miniz_tdefl_fuzzer.cc +115 -0
  231. package/thirdparty/miniz/tests/miniz_tester.cpp +1881 -0
  232. package/thirdparty/miniz/tests/miniz_zip_validate_fuzzer.cc +71 -0
  233. package/thirdparty/miniz/tests/miniz_zip_writer_fuzzer.cc +96 -0
  234. package/thirdparty/miniz/tests/ossfuzz.sh +48 -0
  235. package/thirdparty/miniz/tests/small_fuzzer.c +126 -0
  236. package/thirdparty/miniz/tests/timer.cpp +152 -0
  237. package/thirdparty/miniz/tests/timer.h +40 -0
  238. package/thirdparty/miniz/tests/uncompress2_fuzzer.c +21 -0
  239. package/thirdparty/miniz/tests/uncompress_fuzzer.c +30 -0
  240. package/thirdparty/miniz/tests/zip.dict +9 -0
  241. package/thirdparty/miniz/tests/zip_fuzzer.c +63 -0
  242. package/thirdparty/pugixml/.codecov.yml +7 -0
  243. package/thirdparty/pugixml/.gitattributes +1 -0
  244. package/thirdparty/pugixml/CMakeLists.txt +330 -0
  245. package/thirdparty/pugixml/LICENSE.md +24 -0
  246. package/thirdparty/pugixml/Makefile +98 -0
  247. package/thirdparty/pugixml/README.md +81 -0
  248. package/thirdparty/pugixml/SECURITY.md +9 -0
  249. package/thirdparty/pugixml/appveyor.yml +50 -0
  250. package/thirdparty/pugixml/docs/config.adoc +7 -0
  251. package/thirdparty/pugixml/docs/images/dom_tree.png +0 -0
  252. package/thirdparty/pugixml/docs/images/vs2005_link1.png +0 -0
  253. package/thirdparty/pugixml/docs/images/vs2005_link2.png +0 -0
  254. package/thirdparty/pugixml/docs/images/vs2005_pch1.png +0 -0
  255. package/thirdparty/pugixml/docs/images/vs2005_pch2.png +0 -0
  256. package/thirdparty/pugixml/docs/images/vs2005_pch3.png +0 -0
  257. package/thirdparty/pugixml/docs/images/vs2005_pch4.png +0 -0
  258. package/thirdparty/pugixml/docs/images/vs2010_link1.png +0 -0
  259. package/thirdparty/pugixml/docs/images/vs2010_link2.png +0 -0
  260. package/thirdparty/pugixml/docs/manual.adoc +3326 -0
  261. package/thirdparty/pugixml/docs/manual.html +6395 -0
  262. package/thirdparty/pugixml/docs/quickstart.adoc +287 -0
  263. package/thirdparty/pugixml/docs/quickstart.html +1107 -0
  264. package/thirdparty/pugixml/docs/samples/character.xml +8 -0
  265. package/thirdparty/pugixml/docs/samples/custom_memory_management.cpp +27 -0
  266. package/thirdparty/pugixml/docs/samples/include.cpp +64 -0
  267. package/thirdparty/pugixml/docs/samples/load_error_handling.cpp +33 -0
  268. package/thirdparty/pugixml/docs/samples/load_file.cpp +16 -0
  269. package/thirdparty/pugixml/docs/samples/load_memory.cpp +66 -0
  270. package/thirdparty/pugixml/docs/samples/load_options.cpp +30 -0
  271. package/thirdparty/pugixml/docs/samples/load_stream.cpp +97 -0
  272. package/thirdparty/pugixml/docs/samples/modify_add.cpp +29 -0
  273. package/thirdparty/pugixml/docs/samples/modify_base.cpp +43 -0
  274. package/thirdparty/pugixml/docs/samples/modify_remove.cpp +27 -0
  275. package/thirdparty/pugixml/docs/samples/save_custom_writer.cpp +116 -0
  276. package/thirdparty/pugixml/docs/samples/save_declaration.cpp +27 -0
  277. package/thirdparty/pugixml/docs/samples/save_file.cpp +17 -0
  278. package/thirdparty/pugixml/docs/samples/save_options.cpp +48 -0
  279. package/thirdparty/pugixml/docs/samples/save_stream.cpp +18 -0
  280. package/thirdparty/pugixml/docs/samples/save_subtree.cpp +26 -0
  281. package/thirdparty/pugixml/docs/samples/text.cpp +35 -0
  282. package/thirdparty/pugixml/docs/samples/transitions.xml +7 -0
  283. package/thirdparty/pugixml/docs/samples/traverse_base.cpp +51 -0
  284. package/thirdparty/pugixml/docs/samples/traverse_iter.cpp +27 -0
  285. package/thirdparty/pugixml/docs/samples/traverse_predicate.cpp +48 -0
  286. package/thirdparty/pugixml/docs/samples/traverse_rangefor.cpp +32 -0
  287. package/thirdparty/pugixml/docs/samples/traverse_walker.cpp +35 -0
  288. package/thirdparty/pugixml/docs/samples/tree.xml +12 -0
  289. package/thirdparty/pugixml/docs/samples/weekly-shift_jis.xml +78 -0
  290. package/thirdparty/pugixml/docs/samples/weekly-utf-16.xml +0 -0
  291. package/thirdparty/pugixml/docs/samples/weekly-utf-8.xml +78 -0
  292. package/thirdparty/pugixml/docs/samples/xgconsole.xml +12 -0
  293. package/thirdparty/pugixml/docs/samples/xpath_error.cpp +43 -0
  294. package/thirdparty/pugixml/docs/samples/xpath_query.cpp +36 -0
  295. package/thirdparty/pugixml/docs/samples/xpath_select.cpp +28 -0
  296. package/thirdparty/pugixml/docs/samples/xpath_variables.cpp +38 -0
  297. package/thirdparty/pugixml/readme.txt +50 -0
  298. package/thirdparty/pugixml/scripts/archive.py +54 -0
  299. package/thirdparty/pugixml/scripts/cocoapods_push.sh +4 -0
  300. package/thirdparty/pugixml/scripts/natvis/pugixml.natvis +77 -0
  301. package/thirdparty/pugixml/scripts/natvis/pugixml_compact.natvis +506 -0
  302. package/thirdparty/pugixml/scripts/nuget/build/native/pugixml-propertiesui.xml +17 -0
  303. package/thirdparty/pugixml/scripts/nuget/build/native/pugixml.targets +28 -0
  304. package/thirdparty/pugixml/scripts/nuget/pugixml.nuspec +20 -0
  305. package/thirdparty/pugixml/scripts/nuget_build.ps1 +60 -0
  306. package/thirdparty/pugixml/scripts/premake4.lua +92 -0
  307. package/thirdparty/pugixml/scripts/pugixml-config.cmake.in +12 -0
  308. package/thirdparty/pugixml/scripts/pugixml.pc.in +11 -0
  309. package/thirdparty/pugixml/scripts/pugixml.podspec +14 -0
  310. package/thirdparty/pugixml/scripts/pugixml.xcodeproj/project.pbxproj +212 -0
  311. package/thirdparty/pugixml/scripts/pugixml_airplay.mkf +13 -0
  312. package/thirdparty/pugixml/scripts/pugixml_codeblocks.cbp +44 -0
  313. package/thirdparty/pugixml/scripts/pugixml_codelite.project +56 -0
  314. package/thirdparty/pugixml/scripts/pugixml_dll.rc +45 -0
  315. package/thirdparty/pugixml/scripts/pugixml_vs2005.vcproj +343 -0
  316. package/thirdparty/pugixml/scripts/pugixml_vs2005_static.vcproj +343 -0
  317. package/thirdparty/pugixml/scripts/pugixml_vs2008.vcproj +339 -0
  318. package/thirdparty/pugixml/scripts/pugixml_vs2008_static.vcproj +339 -0
  319. package/thirdparty/pugixml/scripts/pugixml_vs2010.vcxproj +191 -0
  320. package/thirdparty/pugixml/scripts/pugixml_vs2010_static.vcxproj +191 -0
  321. package/thirdparty/pugixml/scripts/pugixml_vs2013.vcxproj +199 -0
  322. package/thirdparty/pugixml/scripts/pugixml_vs2013_static.vcxproj +199 -0
  323. package/thirdparty/pugixml/scripts/pugixml_vs2015.vcxproj +172 -0
  324. package/thirdparty/pugixml/scripts/pugixml_vs2015_static.vcxproj +176 -0
  325. package/thirdparty/pugixml/scripts/pugixml_vs2017.vcxproj +172 -0
  326. package/thirdparty/pugixml/scripts/pugixml_vs2017_static.vcxproj +176 -0
  327. package/thirdparty/pugixml/scripts/pugixml_vs2019.vcxproj +176 -0
  328. package/thirdparty/pugixml/scripts/pugixml_vs2019_static.vcxproj +180 -0
  329. package/thirdparty/pugixml/scripts/pugixml_vs2022.vcxproj +176 -0
  330. package/thirdparty/pugixml/scripts/pugixml_vs2022_static.vcxproj +180 -0
  331. package/thirdparty/pugixml/scripts/pugixml_vs2026.vcxproj +176 -0
  332. package/thirdparty/pugixml/scripts/pugixml_vs2026_static.vcxproj +180 -0
  333. package/thirdparty/pugixml/scripts/sbom.cdx.json +47 -0
  334. package/thirdparty/pugixml/src/pugiconfig.hpp +81 -0
  335. package/thirdparty/pugixml/src/pugixml.cpp +13776 -0
  336. package/thirdparty/pugixml/src/pugixml.hpp +1604 -0
  337. package/thirdparty/pugixml/tests/allocator.cpp +175 -0
  338. package/thirdparty/pugixml/tests/allocator.hpp +10 -0
  339. package/thirdparty/pugixml/tests/autotest-appveyor.ps1 +93 -0
  340. package/thirdparty/pugixml/tests/cmake-appveyor.ps1 +57 -0
  341. package/thirdparty/pugixml/tests/data/empty.xml +0 -0
  342. package/thirdparty/pugixml/tests/data/large.xml +1 -0
  343. package/thirdparty/pugixml/tests/data/latintest_latin1.xml +1 -0
  344. package/thirdparty/pugixml/tests/data/latintest_utf8.xml +1 -0
  345. package/thirdparty/pugixml/tests/data/multiline.xml +3 -0
  346. package/thirdparty/pugixml/tests/data/small.xml +1 -0
  347. package/thirdparty/pugixml/tests/data/truncation.xml +19 -0
  348. package/thirdparty/pugixml/tests/data/utftest_utf16_be.xml +0 -0
  349. package/thirdparty/pugixml/tests/data/utftest_utf16_be_bom.xml +0 -0
  350. package/thirdparty/pugixml/tests/data/utftest_utf16_be_clean.xml +0 -0
  351. package/thirdparty/pugixml/tests/data/utftest_utf16_be_nodecl.xml +0 -0
  352. package/thirdparty/pugixml/tests/data/utftest_utf16_le.xml +0 -0
  353. package/thirdparty/pugixml/tests/data/utftest_utf16_le_bom.xml +0 -0
  354. package/thirdparty/pugixml/tests/data/utftest_utf16_le_clean.xml +0 -0
  355. package/thirdparty/pugixml/tests/data/utftest_utf16_le_nodecl.xml +0 -0
  356. package/thirdparty/pugixml/tests/data/utftest_utf32_be.xml +0 -0
  357. package/thirdparty/pugixml/tests/data/utftest_utf32_be_bom.xml +0 -0
  358. package/thirdparty/pugixml/tests/data/utftest_utf32_be_clean.xml +0 -0
  359. package/thirdparty/pugixml/tests/data/utftest_utf32_be_nodecl.xml +0 -0
  360. package/thirdparty/pugixml/tests/data/utftest_utf32_le.xml +0 -0
  361. package/thirdparty/pugixml/tests/data/utftest_utf32_le_bom.xml +0 -0
  362. package/thirdparty/pugixml/tests/data/utftest_utf32_le_clean.xml +0 -0
  363. package/thirdparty/pugixml/tests/data/utftest_utf32_le_nodecl.xml +0 -0
  364. package/thirdparty/pugixml/tests/data/utftest_utf8.xml +87 -0
  365. package/thirdparty/pugixml/tests/data/utftest_utf8_bom.xml +87 -0
  366. package/thirdparty/pugixml/tests/data/utftest_utf8_clean.xml +84 -0
  367. package/thirdparty/pugixml/tests/data/utftest_utf8_nodecl.xml +86 -0
  368. package/thirdparty/pugixml/tests/data//321/202/320/265/321/201/321/202.xml +1 -0
  369. package/thirdparty/pugixml/tests/data_fuzz_parse/basic.xml +1 -0
  370. package/thirdparty/pugixml/tests/data_fuzz_parse/doctype.xml +1 -0
  371. package/thirdparty/pugixml/tests/data_fuzz_parse/refs.xml +1 -0
  372. package/thirdparty/pugixml/tests/data_fuzz_parse/types.xml +1 -0
  373. package/thirdparty/pugixml/tests/data_fuzz_parse/utf16.xml +0 -0
  374. package/thirdparty/pugixml/tests/data_fuzz_parse/utf32.xml +0 -0
  375. package/thirdparty/pugixml/tests/data_fuzz_xpath/basic.xpath +1 -0
  376. package/thirdparty/pugixml/tests/data_fuzz_xpath/functions.xpath +1 -0
  377. package/thirdparty/pugixml/tests/data_fuzz_xpath/math.xpath +1 -0
  378. package/thirdparty/pugixml/tests/data_fuzz_xpath/path.xpath +1 -0
  379. package/thirdparty/pugixml/tests/data_fuzz_xpath/predicate.xpath +1 -0
  380. package/thirdparty/pugixml/tests/fuzz_parse.cpp +14 -0
  381. package/thirdparty/pugixml/tests/fuzz_parse.dict +72 -0
  382. package/thirdparty/pugixml/tests/fuzz_setup.sh +11 -0
  383. package/thirdparty/pugixml/tests/fuzz_xpath.cpp +46 -0
  384. package/thirdparty/pugixml/tests/fuzz_xpath.dict +72 -0
  385. package/thirdparty/pugixml/tests/helpers.hpp +114 -0
  386. package/thirdparty/pugixml/tests/main.cpp +218 -0
  387. package/thirdparty/pugixml/tests/test.cpp +220 -0
  388. package/thirdparty/pugixml/tests/test.hpp +175 -0
  389. package/thirdparty/pugixml/tests/test_compact.cpp +150 -0
  390. package/thirdparty/pugixml/tests/test_deprecated.cpp +25 -0
  391. package/thirdparty/pugixml/tests/test_document.cpp +1910 -0
  392. package/thirdparty/pugixml/tests/test_dom_modify.cpp +2122 -0
  393. package/thirdparty/pugixml/tests/test_dom_text.cpp +601 -0
  394. package/thirdparty/pugixml/tests/test_dom_traverse.cpp +1481 -0
  395. package/thirdparty/pugixml/tests/test_header_guard.cpp +3 -0
  396. package/thirdparty/pugixml/tests/test_header_iosfwd_1.cpp +3 -0
  397. package/thirdparty/pugixml/tests/test_header_iosfwd_2.cpp +3 -0
  398. package/thirdparty/pugixml/tests/test_header_iostream_1.cpp +3 -0
  399. package/thirdparty/pugixml/tests/test_header_iostream_2.cpp +3 -0
  400. package/thirdparty/pugixml/tests/test_header_only_1.cpp +21 -0
  401. package/thirdparty/pugixml/tests/test_header_only_2.cpp +21 -0
  402. package/thirdparty/pugixml/tests/test_header_string_1.cpp +3 -0
  403. package/thirdparty/pugixml/tests/test_header_string_2.cpp +3 -0
  404. package/thirdparty/pugixml/tests/test_header_string_iostream.cpp +5 -0
  405. package/thirdparty/pugixml/tests/test_memory.cpp +303 -0
  406. package/thirdparty/pugixml/tests/test_parse.cpp +1463 -0
  407. package/thirdparty/pugixml/tests/test_parse_doctype.cpp +366 -0
  408. package/thirdparty/pugixml/tests/test_unicode.cpp +152 -0
  409. package/thirdparty/pugixml/tests/test_version.cpp +5 -0
  410. package/thirdparty/pugixml/tests/test_write.cpp +757 -0
  411. package/thirdparty/pugixml/tests/test_xpath.cpp +833 -0
  412. package/thirdparty/pugixml/tests/test_xpath_api.cpp +646 -0
  413. package/thirdparty/pugixml/tests/test_xpath_functions.cpp +844 -0
  414. package/thirdparty/pugixml/tests/test_xpath_operators.cpp +566 -0
  415. package/thirdparty/pugixml/tests/test_xpath_parse.cpp +428 -0
  416. package/thirdparty/pugixml/tests/test_xpath_paths.cpp +787 -0
  417. package/thirdparty/pugixml/tests/test_xpath_paths_abbrev_w3c.cpp +219 -0
  418. package/thirdparty/pugixml/tests/test_xpath_paths_w3c.cpp +312 -0
  419. package/thirdparty/pugixml/tests/test_xpath_variables.cpp +683 -0
  420. package/thirdparty/pugixml/tests/test_xpath_xalan_1.cpp +411 -0
  421. package/thirdparty/pugixml/tests/test_xpath_xalan_2.cpp +417 -0
  422. package/thirdparty/pugixml/tests/test_xpath_xalan_3.cpp +321 -0
  423. package/thirdparty/pugixml/tests/test_xpath_xalan_4.cpp +300 -0
  424. package/thirdparty/pugixml/tests/test_xpath_xalan_5.cpp +295 -0
  425. package/thirdparty/pugixml/tests/writer_string.cpp +79 -0
  426. package/thirdparty/pugixml/tests/writer_string.hpp +27 -0
  427. package/ios/dummy.swift +0 -2
  428. package/scripts/prepare-openxlsx.js +0 -109
package/NitroXlsx.podspec CHANGED
@@ -13,26 +13,33 @@ Pod::Spec.new do |s|
13
13
  s.platforms = { :ios => "15.1" }
14
14
  s.source = { :git => "https://github.com/zydbkqf/react-native-nitro-xlsx.git", :tag => "#{s.version}" }
15
15
 
16
+ # OpenXLSX, pugixml and miniz are vendored under thirdparty/ and shipped
17
+ # with the package, so no network access is needed during pod install.
16
18
  s.exclude_files = [
17
19
  "cpp/tests/**/*",
18
- "OpenXLSX/ThirdParty/miniz/tests/**/*",
19
- "OpenXLSX/ThirdParty/miniz/examples/**/*",
20
+ "thirdparty/miniz/tests/**/*",
21
+ "thirdparty/miniz/examples/**/*",
22
+ "thirdparty/pugixml/tests/**/*",
23
+ "thirdparty/OpenXLSX/Tests/**/*",
24
+ "thirdparty/OpenXLSX/Examples/**/*",
25
+ "thirdparty/OpenXLSX/Benchmarks/**/*",
20
26
  ]
21
27
 
22
28
  s.source_files = [
23
29
  "cpp/**/*.{h,hpp,cpp}",
24
- "OpenXLSX/OpenXLSX/**/*.hpp",
25
- "OpenXLSX/OpenXLSX/**/*.cpp",
26
- "OpenXLSX/ThirdParty/pugixml/src/**/*.hpp",
27
- "OpenXLSX/ThirdParty/pugixml/src/**/*.cpp",
28
- "OpenXLSX/OpenXLSX/headers/detail/Zippy.hpp",
29
- "OpenXLSX/ThirdParty/miniz/**/*.h",
30
- "OpenXLSX/ThirdParty/miniz/**/*.c",
30
+ "ios/**/*.{h,hpp,mm}",
31
+ "thirdparty/OpenXLSX/OpenXLSX/**/*.hpp",
32
+ "thirdparty/OpenXLSX/OpenXLSX/**/*.cpp",
33
+ "thirdparty/pugixml/src/**/*.hpp",
34
+ "thirdparty/pugixml/src/**/*.cpp",
35
+ "thirdparty/OpenXLSX/OpenXLSX/headers/detail/Zippy.hpp",
36
+ "thirdparty/miniz/**/*.h",
37
+ "thirdparty/miniz/**/*.c",
31
38
  ]
32
39
 
33
40
  s.private_header_files = [
34
- "OpenXLSX/**/*.hpp",
35
- "OpenXLSX/**/*.h",
41
+ "thirdparty/OpenXLSX/**/*.hpp",
42
+ "thirdparty/OpenXLSX/**/*.h",
36
43
  ]
37
44
 
38
45
  s.dependency "React"
@@ -44,29 +51,22 @@ Pod::Spec.new do |s|
44
51
  "SWIFT_INSTALL_OBJC_HEADER" => "NO",
45
52
  "OTHER_CFLAGS" => "$(inherited) -fmodules",
46
53
  "OTHER_CPLUSPLUSFLAGS" => "$(inherited) -fmodules",
47
- "HEADER_SEARCH_PATHS" => "$(inherited) ${PODS_TARGET_SRCROOT}/OpenXLSX ${PODS_TARGET_SRCROOT}/OpenXLSX/OpenXLSX ${PODS_TARGET_SRCROOT}/OpenXLSX/OpenXLSX/headers ${PODS_TARGET_SRCROOT}/OpenXLSX/ThirdParty/pugixml/src ${PODS_TARGET_SRCROOT}/OpenXLSX/ThirdParty/miniz",
54
+ "HEADER_SEARCH_PATHS" => "$(inherited) ${PODS_TARGET_SRCROOT}/thirdparty/OpenXLSX ${PODS_TARGET_SRCROOT}/thirdparty/OpenXLSX/OpenXLSX ${PODS_TARGET_SRCROOT}/thirdparty/OpenXLSX/OpenXLSX/headers ${PODS_TARGET_SRCROOT}/thirdparty/pugixml/src ${PODS_TARGET_SRCROOT}/thirdparty/miniz",
48
55
  }
49
56
 
50
57
  s.user_target_xcconfig = {
51
58
  "OTHER_CFLAGS" => "$(inherited) -fmodules",
52
59
  "OTHER_CPLUSPLUSFLAGS" => "$(inherited) -fmodules",
53
- "HEADER_SEARCH_PATHS" => "$(inherited) ${PODS_TARGET_SRCROOT}/OpenXLSX ${PODS_TARGET_SRCROOT}/OpenXLSX/OpenXLSX ${PODS_TARGET_SRCROOT}/OpenXLSX/OpenXLSX/headers ${PODS_TARGET_SRCROOT}/OpenXLSX/ThirdParty/pugixml/src ${PODS_TARGET_SRCROOT}/OpenXLSX/ThirdParty/miniz",
60
+ "HEADER_SEARCH_PATHS" => "$(inherited) ${PODS_TARGET_SRCROOT}/thirdparty/OpenXLSX ${PODS_TARGET_SRCROOT}/thirdparty/OpenXLSX/OpenXLSX ${PODS_TARGET_SRCROOT}/thirdparty/OpenXLSX/OpenXLSX/headers ${PODS_TARGET_SRCROOT}/thirdparty/pugixml/src ${PODS_TARGET_SRCROOT}/thirdparty/miniz",
54
61
  }
55
62
 
56
- # Prepare OpenXLSX and its dependencies (pugixml, miniz) via a Node script
57
- # so the same logic can be reused from both CocoaPods and Android CMake.
58
- s.prepare_command = "node #{__dir__}/scripts/prepare-openxlsx.js"
59
-
60
- # Swift Package Manager declaration for React Native 0.87+.
61
- # This exposes NitroXlsx as a local Swift package; the heavy lifting for
62
- # OpenXLSX is still done by the prepare command above.
63
- if ENV['NITRO_XLSX_USE_SPM'] == '1' && defined?(SPM) && SPM.respond_to?(:dependency)
64
- SPM.dependency(s,
65
- url: File.join(__dir__, "."),
66
- requirement: { kind: 'upToNextMajorVersion', minimumVersion: s.version.to_s },
67
- products: ['NitroXlsx']
68
- )
69
- end
63
+ # Swift Package Manager note: this podspec intentionally declares nothing for
64
+ # SPM. React Native 0.88+ drives SwiftPM from `package.json` (`swiftpmConfig`)
65
+ # and `npx react-native spm`, and the manifest lives in Package.swift. That
66
+ # manifest is still a placeholder (it only compiles ios/XlsxCacheDir.mm) and
67
+ # CocoaPods remains the build path for this library until the C++ targets,
68
+ # the vendored thirdparty/ tree and the NitroModules dependency are wired
69
+ # into it.
70
70
 
71
71
  load 'nitrogen/generated/ios/NitroXlsx+autolinking.rb'
72
72
  add_nitrogen_files(s)
package/Package.swift CHANGED
@@ -1,19 +1,39 @@
1
1
  // swift-tools-version: 5.9
2
2
  import PackageDescription
3
3
 
4
- // NOTE: This Package.swift is a Swift Package Manager manifest stub for
5
- // React Native 0.87+ compatibility. The library is still primarily built
6
- // through CocoaPods (NitroXlsx.podspec), where OpenXLSX, pugixml and miniz
7
- // are cloned and compiled from source by scripts/prepare-openxlsx.js.
4
+ // NOTE: This manifest is a placeholder for the Swift Package Manager migration,
5
+ // not the build path used today. CocoaPods (NitroXlsx.podspec) still compiles
6
+ // the library, including the vendored OpenXLSX / pugixml / miniz tree under
7
+ // thirdparty/.
8
8
  //
9
- // The local package reference below lets RN 0.87's spm_dependency helper
10
- // register NitroXlsx in the Pods project when SwiftPM mode is enabled.
11
- // Full SPM-based compilation of the C++ sources is not yet supported.
9
+ // It is kept so that (a) the package is syntactically valid and `swift package
10
+ // describe` / `swift build` work, and (b) the eventual migration has a starting
11
+ // point. Today the target only compiles ios/XlsxCacheDir.mm — it exposes
12
+ // getCacheDir / setCacheDir but not the Nitro module itself.
13
+ //
14
+ // Migration target (React Native 0.88+ / nitro-modules 1.x): the package becomes
15
+ // one library product whose targets cover `cpp/`, `ios/XlsxCacheDir.mm` and the
16
+ // thirdparty/ sources, depending on `.product(name: "NitroModules",
17
+ // package: "NitroModules")`, with `swiftpmConfig` in package.json driving
18
+ // autolinking via `npx react-native spm`. The unrelated NITRO_XLSX_USE_SPM env
19
+ // switch that used to live in the podspec has been removed — it was never an
20
+ // upstream concept.
21
+ //
22
+ // Target settings worth knowing:
23
+ // - This is a C-family target, so SwiftPM insists on a public headers
24
+ // directory and defaults it to `include/`, which does not exist here.
25
+ // `publicHeadersPath: "."` points the generated umbrella header at the
26
+ // (header-less) source dir instead of failing to resolve the manifest.
27
+ // - cxxLanguageStandard must match the podspec's CLANG_CXX_LANGUAGE_STANDARD
28
+ // (c++20); SwiftPM defaults to gnu++14 and warns on the nested namespace
29
+ // definitions used by the sources.
12
30
 
13
31
  let package = Package(
14
32
  name: "NitroXlsx",
15
33
  platforms: [
16
- .iOS(.v15)
34
+ // Matches NitroXlsx.podspec (`:ios => "15.1"`). SwiftPM's .v15 only
35
+ // expresses 15.0, so the explicit version string is used instead.
36
+ .iOS("15.1")
17
37
  ],
18
38
  products: [
19
39
  .library(
@@ -25,7 +45,12 @@ let package = Package(
25
45
  .target(
26
46
  name: "NitroXlsx",
27
47
  path: "ios",
28
- sources: ["dummy.swift"]
48
+ sources: ["XlsxCacheDir.mm"],
49
+ publicHeadersPath: ".",
50
+ cxxSettings: [
51
+ .headerSearchPath("../cpp")
52
+ ]
29
53
  )
30
- ]
54
+ ],
55
+ cxxLanguageStandard: .cxx20
31
56
  )
package/README.md CHANGED
@@ -6,12 +6,19 @@ A React Native module for reading and writing Excel XLSX files using [OpenXLSX](
6
6
 
7
7
  - 📊 Full Excel XLSX file creation support
8
8
  - 📖 Read existing XLSX files (from file path or buffer)
9
- - 📝 Formula support (with default values)
10
- - 📅 Date/DateTime support
11
- - 🖼️ Image insertion (from file path or buffer)
12
- - 🎨 Rich formatting (fonts, colors, borders, alignment)
13
- - 📄 Page setup (margins, orientation, headers/footers)
14
- - 🔒 Sheet protection
9
+ - 📝 Formula support (with default values) & array formulas
10
+ - 📅 Date / DateTime support
11
+ - 🔗 Hyperlinks (URLs)
12
+ - 🔄 JSON import / export (`fromJSON` / `toJSON`)
13
+ - 🎨 Rich formatting (fonts, colors, borders, alignment, number formats)
14
+ - 🔒 Sheet protection (password, objects/scenarios, fine-grained allow/deny)
15
+ - 📋 Cell comments (get / set / delete, multi-author)
16
+ - 🔤 Conditional formatting rules
17
+ - 🗂️ Sheet management (delete / rename / clone)
18
+ - ➕ Row/column delete, merge / unmerge
19
+ - 🧩 Hidden rows/columns
20
+ - 🔍 Read cells (value, type, format, formula) + findCell
21
+ - ⚠️ Structured native error codes mapped to JS
15
22
  - 📦 Export as ArrayBuffer - no file system required!
16
23
 
17
24
  ## Installation
@@ -22,7 +29,7 @@ npm install react-native-nitro-xlsx
22
29
  yarn add react-native-nitro-xlsx
23
30
  ```
24
31
 
25
- > **Note**: Native dependencies (OpenXlsx) are downloaded from GitHub during the first build. Please make sure you have a stable network connection.
32
+ > **Note**: Native dependencies (OpenXLSX, pugixml and miniz) are vendored under `thirdparty/` and shipped with the package. The first build compiles them from source; no network access is required.
26
33
 
27
34
  ### iOS
28
35
 
@@ -126,41 +133,59 @@ const fontSize = format.getFontSize();
126
133
 
127
134
  ### Working with JSON
128
135
 
129
- #### Export to JSON (`toJSON`)
136
+ Per-sheet conversion lives on `XlsxWorksheet`. Workbook-level conversion uses a
137
+ `Record` keyed by worksheet name.
130
138
 
131
- Convert worksheet data to a JSON array. By default, the first row is used as object keys.
139
+ #### Export a worksheet (`sheet.toJSON`)
132
140
 
133
- ```typescript
134
- import { NitroXlsx, toJSON } from 'react-native-nitro-xlsx';
141
+ Convert one worksheet's data to an array of records. By default, the first row is used as object keys.
135
142
 
136
- const workbook = NitroXlsx.openWorkbook('/path/to/data.xlsx');
143
+ ```typescript
144
+ const sheet = workbook.getWorksheetByName('Data');
137
145
 
138
146
  // Use the first row as keys (default)
139
- const data = toJSON(workbook);
147
+ const rows = sheet.toJSON();
140
148
  // Result: [{ "Name": "Alice", "Age": 30 }, { "Name": "Bob", "Age": 25 }]
141
149
 
142
150
  // Provide custom keys
143
- const data = toJSON(workbook, ['firstName', 'yearsOld']);
144
- // Result: [{ "firstName": "Alice", "yearsOld": 30 }, { "firstName": "Bob", "yearsOld": 25 }]
151
+ const rows2 = sheet.toJSON(['firstName', 'yearsOld']);
152
+ // Result: [{ "firstName": "Alice", "yearsOld": 30 }, ...]
145
153
  ```
146
154
 
147
- #### Import from JSON (`fromJSON`)
155
+ #### Import into a worksheet (`sheet.fromJSON`)
148
156
 
149
- Create a workbook from a JSON array. The first object's keys become the header row.
157
+ Write an array of records into an existing worksheet. The first record's keys become the header row.
150
158
 
151
159
  ```typescript
152
- import { NitroXlsx } from 'react-native-nitro-xlsx';
153
-
154
- const data = [
160
+ const sheet = workbook.addWorksheet('Data');
161
+ sheet.fromJSON([
155
162
  { Name: 'Alice', Age: 30, Active: true },
156
163
  { Name: 'Bob', Age: 25, Active: false },
157
- ];
164
+ ]);
165
+ // Row 1 (header): Active | Age | Name (keys are sorted alphabetically)
166
+ // Row 2: true | 30 | Alice
167
+ // Row 3: false | 25 | Bob
168
+ ```
169
+
170
+ #### Export all sheets (`workbook.toJSON`)
171
+
172
+ Returns a `Record` keyed by worksheet name.
173
+
174
+ ```typescript
175
+ const all = workbook.toJSON();
176
+ // Result: { "Data": [{ Name: 'Alice', ... }], "Summary": [{ ... }] }
177
+ ```
158
178
 
159
- const workbook = NitroXlsx.fromJSON(data);
160
- // The workbook now has a worksheet with:
161
- // Row 1 (header): Name | Age | Active
162
- // Row 2: Alice | 30 | true
163
- // Row 3: Bob | 25 | false
179
+ #### Create a workbook from multiple sheets (`NitroXlsx.fromJSON`)
180
+
181
+ Each key becomes a worksheet.
182
+
183
+ ```typescript
184
+ const workbook = NitroXlsx.fromJSON({
185
+ Data: [{ Name: 'Alice', Age: 30 }],
186
+ Summary: [{ Total: 1 }],
187
+ });
188
+ // Creates worksheets "Data" and "Summary"
164
189
 
165
190
  const buffer = await workbook.getBuffer();
166
191
  ```
@@ -169,10 +194,10 @@ const buffer = await workbook.getBuffer();
169
194
 
170
195
  ### NitroXlsx
171
196
 
172
- - `createWorkbook(tempDir?: string): XlsxWorkbook` - Create a new workbook. On Android, pass the app's cache directory (e.g., `RNFS.CachesDirectoryPath`) to avoid sandbox write permission issues.
197
+ - `createWorkbook(): XlsxWorkbook` - Create a new workbook. The native side supplies the platform cache directory automatically (`Context.getCacheDir()` on Android, `NSCachesDirectory` on iOS).
173
198
  - `openWorkbook(path: string): XlsxWorkbook` - Open workbook from file path
174
199
  - `openWorkbookFromBuffer(buffer: ArrayBuffer): XlsxWorkbook` - Open workbook from buffer
175
- - `fromJSON(data: Array<Record<string, string | number>>): XlsxWorkbook` - Create a workbook from a JSON array (static method)
200
+ - `fromJSON(data: Record<string, Array<Record<string, string | number | boolean | null>>>): XlsxWorkbook` - Create a workbook with one worksheet per key (native `AnyMap`s, no JSON round-trip)
176
201
 
177
202
  ### XlsxWorkbook
178
203
 
@@ -181,9 +206,12 @@ const buffer = await workbook.getBuffer();
181
206
  - `getWorksheetByName(name: string): XlsxWorksheet` - Get worksheet by name
182
207
  - `getOrAddWorksheet(name: string): XlsxWorksheet` - Get or add worksheet
183
208
  - `getWorksheetCount(): number` - Get number of worksheets
209
+ - `deleteSheet(name: string): void` - Delete a worksheet by name
210
+ - `updateSheetName(oldName: string, newName: string): void` - Rename a worksheet and rewrite formula references to it
211
+ - `clone(existingName: string, newName: string): XlsxWorksheet` - Copy a worksheet
184
212
  - `addCellFormat(): XlsxCellFormat` - Add a new cell format
185
213
  - `getBuffer(): Promise<ArrayBuffer>` - Generate and return the XLSX file as a buffer
186
- - `toJSON(keys?: string[]): Array<Record<string, string | number>>` - Convert worksheet data to a JSON array
214
+ - `toJSON(): Record<string, Array<Record<string, string | number | boolean | null>>>` - Export every worksheet as a `Record` keyed by sheet name
187
215
 
188
216
  ### XlsxWorksheet
189
217
 
@@ -209,7 +237,7 @@ const buffer = await workbook.getBuffer();
209
237
  #### Date/URL
210
238
  | Method | Description |
211
239
  |--------|-------------|
212
- | `writeDatetime(row, col, datetime, format?)` | Write a datetime (Excel serial date number) |
240
+ | `writeDatetime(row, col, datetime, format?)` | Write a datetime (1900-based Excel serial date number; see Cell Types) |
213
241
  | `writeURL(row, col, url, format?)` | Write a hyperlink |
214
242
 
215
243
  #### Column/Row
@@ -217,6 +245,8 @@ const buffer = await workbook.getBuffer();
217
245
  |--------|-------------|
218
246
  | `setColumn(firstCol, lastCol, width, format?)` | Set column properties |
219
247
  | `setRow(row, height, format?)` | Set row properties |
248
+ | `deleteRow(row)` | Delete a row (returns `true` if a row entry existed and was removed) |
249
+ | `deleteColumn(col)` | Delete a column and shift remaining columns left (returns `true` on success) |
220
250
  | `setColumnHidden(firstCol, lastCol, hidden)` | Hide/show columns |
221
251
  | `setRowHidden(row, hidden)` | Hide/show row |
222
252
 
@@ -225,38 +255,75 @@ const buffer = await workbook.getBuffer();
225
255
  |--------|-------------|
226
256
  | `mergeRange(firstRow, firstCol, lastRow, lastCol, value, format?)` | Merge cells with string value |
227
257
  | `mergeRangeNum(firstRow, firstCol, lastRow, lastCol, value, format?)` | Merge cells with number value |
258
+ | `unmergeCells(firstRow, firstCol, lastRow, lastCol)` | Unmerge a previously merged range |
228
259
 
229
- #### Image
260
+ #### Comments
230
261
  | Method | Description |
231
262
  |--------|-------------|
232
- | `insertImage(row, col, path, xOffset?, yOffset?, xScale?, yScale?)` | Insert image from file |
233
- | `insertImageBuffer(row, col, buffer, extension, xOffset?, yOffset?, xScale?, yScale?)` | Insert image from buffer |
263
+ | `setComment(row, col, text, authorId?)` | Set a cell comment (creates the comments part on first use) |
264
+ | `getComment(row, col)` | Get comment text (empty string if none) |
265
+ | `hasComment(row, col)` | Whether the cell has a comment |
266
+ | `deleteComment(row, col)` | Delete a cell comment (returns `true` if one existed) |
267
+ | `getCommentCount()` | Number of comments on this sheet |
268
+ | `addCommentAuthor(author)` | Register an author, returns its `authorId` |
269
+ | `getCommentAuthor(authorId)` | Get author name by id |
234
270
 
235
271
  #### View
272
+
236
273
  | Method | Description |
237
274
  |--------|-------------|
238
- | `freezePanes(row, col)` | Freeze panes |
239
- | `splitPanes(row, col)` | Split panes |
240
- | `setTabColor(color)` | Set tab color |
241
275
  | `hide()` | Hide worksheet |
242
276
  | `activate()` | Activate worksheet |
243
- | `setFirstSheet()` | Set as first sheet |
244
- | `protect(password?)` | Protect worksheet |
245
277
 
246
- #### Page Setup
278
+ #### Sheet Protection
247
279
  | Method | Description |
248
280
  |--------|-------------|
249
- | `setPortrait()` | Set portrait orientation |
250
- | `setLandscape()` | Set landscape orientation |
251
- | `setPaper(paperType)` | Set paper size |
252
- | `setHeader(header)` | Set header |
253
- | `setFooter(footer)` | Set footer |
254
- | `setPrintArea(firstRow, firstCol, lastRow, lastCol)` | Set print area |
255
- | `fitToPages(width, height)` | Fit to pages |
256
- | `setZoom(scale)` | Set zoom level |
257
- | `setGridlines(option)` | Set gridlines |
258
- | `centerHorizontally()` | Center horizontally |
259
- | `centerVertically()` | Center vertically |
281
+ | `protect(password?)` | Convenience: set optional password and enable sheet protection |
282
+ | `protectSheet(set?)` | Enable/disable sheet protection (`set` defaults to `true`) |
283
+ | `protectObjects(set?)` | Protect drawing objects |
284
+ | `protectScenarios(set?)` | Protect scenarios |
285
+ | `setPassword(password)` | Set password (hashed by Excel algorithm) |
286
+ | `setPasswordHash(hash)` | Set a pre-computed 4-digit hex password hash |
287
+ | `clearPassword()` | Remove the password attribute |
288
+ | `clearSheetProtection()` | Remove `<sheetProtection>` entirely |
289
+
290
+ Fine-grained permissions (only meaningful while `protectSheet` is on).
291
+ `allow*(set?)` defaults to `true`; `deny*()` is shorthand for `allow*(false)`.
292
+
293
+ | Allow | Deny | Effect when allowed |
294
+ |-------|------|---------------------|
295
+ | `allowInsertColumns(set?)` | `denyInsertColumns()` | User may insert columns |
296
+ | `allowInsertRows(set?)` | `denyInsertRows()` | User may insert rows |
297
+ | `allowDeleteColumns(set?)` | `denyDeleteColumns()` | User may delete columns |
298
+ | `allowDeleteRows(set?)` | `denyDeleteRows()` | User may delete rows |
299
+ | `allowSelectLockedCells(set?)` | `denySelectLockedCells()` | User may select locked cells |
300
+ | `allowSelectUnlockedCells(set?)` | `denySelectUnlockedCells()` | User may select unlocked cells |
301
+
302
+ Protection state getters:
303
+
304
+ | Method | Returns |
305
+ |--------|---------|
306
+ | `sheetProtected()` / `objectsProtected()` / `scenariosProtected()` | Whether the corresponding protection is on |
307
+ | `insertColumnsAllowed()` / `insertRowsAllowed()` | Whether insert is allowed despite protection |
308
+ | `deleteColumnsAllowed()` / `deleteRowsAllowed()` | Whether delete is allowed despite protection |
309
+ | `selectLockedCellsAllowed()` / `selectUnlockedCellsAllowed()` | Whether select is allowed despite protection |
310
+ | `passwordIsSet()` | Whether a password hash is present |
311
+ | `passwordHash()` | The stored password hash (empty if none) |
312
+ | `sheetProtectionSummary()` | Human-readable summary of the protection settings |
313
+
314
+ Example:
315
+
316
+ ```typescript
317
+ const sheet = workbook.addWorksheet('Locked');
318
+ sheet.writeString(1, 1, 'Protected');
319
+ sheet.setPassword('s3cret');
320
+ sheet.protectSheet();
321
+ sheet.allowDeleteRows(); // users may still delete rows
322
+ sheet.denySelectLockedCells(); // users cannot select locked cells
323
+ console.log(sheet.sheetProtected()); // true
324
+ console.log(sheet.deleteRowsAllowed()); // true
325
+ console.log(sheet.selectLockedCellsAllowed()); // false
326
+ ```
260
327
 
261
328
  #### Read Methods
262
329
  | Method | Description |
@@ -266,11 +333,62 @@ const buffer = await workbook.getBuffer();
266
333
  | `getCellRawValue(row, col)` | Get raw cell value |
267
334
  | `getCellType(row, col)` | Get cell type |
268
335
  | `getCellFormat(row, col)` | Get cell format |
336
+ | `hasFormula(row, col)` | Whether the cell contains a formula |
337
+ | `formula(row, col)` | Get the cell's formula string (empty if none) |
338
+ | `findCell(row, col)` | Whether a cell exists at these coordinates (does **not** create it) |
269
339
  | `getRowCount()` | Get total row count |
270
340
  | `getColumnCount()` | Get total column count |
271
341
  | `getLastRow()` | Get last row index |
272
342
  | `getLastColumn()` | Get last column index |
273
343
  | `getName()` | Get worksheet name |
344
+ | `toJSON(keys?)` | Export this worksheet as an array of records (`keys` defaults to first-row headers) |
345
+ | `fromJSON(data)` | Write an array of records into this worksheet (first row = header) |
346
+
347
+ #### Conditional Formatting
348
+ | Method | Description |
349
+ |--------|-------------|
350
+ | `getConditionalFormats()` | Get the worksheet's `XlsxConditionalFormats` collection |
351
+
352
+ ##### XlsxConditionalFormats
353
+ | Method | Description |
354
+ |--------|-------------|
355
+ | `getCount()` | Number of `<conditionalFormatting>` entries |
356
+ | `create(sqref)` | Create a new entry for a range (e.g. `"A1:A10"`), returns `XlsxConditionalFormat` |
357
+ | `getByIndex(index)` | Get an entry by index |
358
+ | `summary()` | Debug summary string |
359
+
360
+ ##### XlsxConditionalFormat
361
+ | Method | Description |
362
+ |--------|-------------|
363
+ | `getSqref()` / `setSqref(sqref)` | The range these rules apply to |
364
+ | `getRuleCount()` / `createRule()` | Manage `cfRule` entries (`createRule` returns the new index) |
365
+ | `getRuleType(index)` / `setRuleType(index, type)` | Rule type — use `CfType` constants |
366
+ | `getRuleDxfId(index)` / `setRuleDxfId(index, dxfId)` | Differential format id |
367
+ | `getRuleFormula(index, formulaIndex)` / `setRuleFormula(index, formulaIndex, formula)` | Rule formula (`formulaIndex` must be `0`; OpenXLSX supports one formula per rule) |
368
+ | `getRuleOperator(index)` / `setRuleOperator(index, op)` | Comparison operator — use `CfOperator` |
369
+ | `getRuleText(index)` / `setRuleText(index, text)` | Text for text-based rules |
370
+ | `getRulePriority(index)` / `setRulePriority(index, priority)` | Rule priority (1-based) |
371
+ | `getRuleStopIfTrue(index)` / `setRuleStopIfTrue(index, stop)` | Stop evaluating further rules |
372
+ | `getRuleTimePeriod(index)` / `setRuleTimePeriod(index, period)` | Time period — use `CfTimePeriod` |
373
+ | `getRuleRank(index)` / `setRuleRank(index, rank)` | Top/bottom N |
374
+ | `getRuleStdDev(index)` / `setRuleStdDev(index, stdDev)` | Standard deviations for aboveAverage |
375
+ | `getRuleAboveAverage` / `setRuleAboveAverage` | aboveAverage flag |
376
+ | `getRulePercent` / `setRulePercent` | percent flag |
377
+ | `getRuleBottom` / `setRuleBottom` | bottom flag |
378
+ | `getRuleEqualAverage` / `setRuleEqualAverage` | equalAverage flag |
379
+ | `summary()` | Debug summary string |
380
+
381
+ Example:
382
+
383
+ ```typescript
384
+ const cf = sheet.getConditionalFormats().create('B2:B100');
385
+ const ruleIndex = cf.createRule();
386
+ cf.setRuleType(ruleIndex, CfType.CELL_IS);
387
+ cf.setRuleOperator(ruleIndex, CfOperator.GREATER_THAN);
388
+ cf.setRuleFormula(ruleIndex, 0, '100');
389
+ cf.setRuleDxfId(ruleIndex, 0);
390
+ cf.setRulePriority(ruleIndex, 1);
391
+ ```
274
392
 
275
393
  ### XlsxCellFormat
276
394
 
@@ -320,9 +438,14 @@ When reading cells, the following types are returned:
320
438
 
321
439
  - `empty` - Empty cell
322
440
  - `string` - Text string
323
- - `number` - Numeric value
441
+ - `number` - Numeric value. Dates are stored as **Excel serial numbers in the 1900 date system** (days since `1900-01-01`, where `1900-01-01` = `1`, including the spurious `1900-02-29`), and are read back as `number`:
442
+ ```ts
443
+ // Excel serial (1900-based) → JS Date
444
+ const date = new Date(Math.round((serial - 25569) * 86400000));
445
+ // JS Date → Excel serial (1900-based)
446
+ const serial = date.getTime() / 86400000 + 25569;
447
+ ```
324
448
  - `boolean` - Boolean value
325
- - `date` - Date/time value
326
449
  - `error` - Error value
327
450
  - `formula` - Formula
328
451
  - `blank` - Blank cell
@@ -341,7 +464,43 @@ The library exports several useful constants:
341
464
  - `Gridlines` - Gridline options
342
465
  - `Colors` - Common RGB colors
343
466
  - `NumFormat` - Built-in number format indices
344
- - `ImagePosition` - Image positioning options
467
+ - `CfType` - Conditional formatting rule types
468
+ - `CfOperator` - Conditional formatting comparison operators
469
+ - `CfTimePeriod` - Conditional formatting time periods
470
+ - `XlsxErrorCode` - Native error codes
471
+
472
+ ## Error Handling
473
+
474
+ Native failures are thrown as JS `Error`s whose message is `methodName: CODE: detail`.
475
+ Convert them to a structured `XlsxError` with `XlsxError.from`:
476
+
477
+ ```typescript
478
+ import { NitroXlsx, XlsxError, XlsxErrorCode } from 'react-native-nitro-xlsx';
479
+
480
+ try {
481
+ workbook.deleteSheet('Missing');
482
+ } catch (e) {
483
+ const err = XlsxError.from(e);
484
+ if (err.code === XlsxErrorCode.SHEET_NOT_FOUND) {
485
+ // handle missing sheet
486
+ }
487
+ }
488
+ ```
489
+
490
+ Error codes:
491
+
492
+ | Code | Meaning |
493
+ |------|---------|
494
+ | `INVALID_ARGUMENT` | Bad row/col/name or other input |
495
+ | `SHEET_NOT_FOUND` | Worksheet does not exist |
496
+ | `SHEET_EXISTS` | Worksheet name already taken |
497
+ | `INDEX_OUT_OF_RANGE` | Row/col/index out of range |
498
+ | `CELL_NOT_FOUND` | Referenced cell does not exist |
499
+ | `WORKBOOK_CLOSED` | Workbook already finalized via `getBuffer()` |
500
+ | `IO_ERROR` | File open/save failure |
501
+ | `UNSUPPORTED` | Operation not supported by the underlying engine |
502
+ | `XLSX_ERROR` | Generic OpenXLSX failure |
503
+ | `INTERNAL_ERROR` | Unexpected native error |
345
504
 
346
505
  ## Development
347
506
 
@@ -373,17 +532,20 @@ This library is based on OpenXLSX and inherits the following limitations:
373
532
 
374
533
  The following Excel features are not supported and will be ignored when reading or writing files:
375
534
 
376
- - 🖼️ **Images**: Reading and writing images is not supported. Existing images in XLSX files will be ignored.
377
535
  - 📊 **Charts**: Charts, graphs, and sparklines are not supported.
378
- - ✏️ **Drawings/Shape**: Shapes, lines, arrows, and other drawing objects are not supported.
536
+ - 🖼️ **Drawings/Images/Shapes**: Images, shapes, lines, arrows and other drawing objects fall under OpenXLSX's drawing support, which is not implemented. Existing images in XLSX files are silently ignored.
379
537
  - 🔍 **Pivot Tables**: Pivot tables and pivot charts are not supported.
380
538
  - 💻 **VBA/Macros**: VBA macros, forms, and ActiveX controls are not supported.
381
- - 📋 **Comments**: Cell comments and notes are not supported.
382
539
  - 📌 **Hyperlinks**: Only basic URL hyperlinks are supported.
383
- - 🔄 **Conditional Formatting**: Conditional formatting rules are not supported.
384
540
  - 📑 **Data Validation**: Data validation rules are not supported.
385
541
 
386
542
  ### Notes
387
543
 
388
544
  - When reading XLSX files that contain unsupported features, the library will still read the cell data and formatting, but unsupported elements will be silently ignored.
389
- - When writing XLSX files, unsupported features cannot be added and will be omitted from the output.
545
+ - When writing XLSX files, unsupported features cannot be added and will be omitted from the output.
546
+ - `deleteColumn` shifts cell values and formats left; formula references are not rewritten (same limitation as OpenXLSX's `deleteRow`).
547
+ - Conditional formatting supports one formula per `cfRule` (OpenXLSX limitation). `colorScale` / `dataBar` / `iconSet` are not supported.
548
+ - `deleteRule` on `XlsxConditionalFormat` always returns `false` (OpenXLSX does not support removing a `cfRule`).
549
+ - Conditional formatting rule `type` / `operator` / `timePeriod` are direct numeric mappings of OpenXLSX enums; passing an out-of-range value results in undefined behavior. Use the exported `CfType` / `CfOperator` / `CfTimePeriod` constants.
550
+ - `setComment` automatically registers an author so the generated `comments.xml` always has a valid `authorId` (verified to open cleanly in Excel/WPS).
551
+ - `getComment` returns an empty string for a cell without a comment (it does not throw). Use `hasComment` first if you need to distinguish.
@@ -4,33 +4,26 @@ project("NitroXlsx")
4
4
  set(CMAKE_CXX_STANDARD 20)
5
5
  set(CMAKE_CXX_STANDARD_REQUIRED ON)
6
6
 
7
- set(OPENXLSX_DIR ${CMAKE_SOURCE_DIR}/../OpenXLSX)
8
-
9
- # Prepare OpenXLSX and its dependencies (pugixml, miniz) using the same
10
- # Node script that CocoaPods' prepare_command runs on iOS.
11
- find_program(NODE_EXECUTABLE node REQUIRED)
12
- execute_process(
13
- COMMAND ${NODE_EXECUTABLE} ${CMAKE_SOURCE_DIR}/../scripts/prepare-openxlsx.js
14
- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/..
15
- RESULT_VARIABLE PREPARE_RESULT
16
- )
17
- if(NOT PREPARE_RESULT EQUAL 0)
18
- message(FATAL_ERROR
19
- "Failed to prepare OpenXLSX dependencies.\n"
20
- "Please ensure Node.js is installed and run:\n"
21
- " node scripts/prepare-openxlsx.js"
22
- )
23
- endif()
24
-
25
- # Verify OpenXLSX is available
26
- if(NOT EXISTS ${OPENXLSX_DIR}/CMakeLists.txt)
27
- message(FATAL_ERROR
28
- "OpenXLSX not found at ${OPENXLSX_DIR}.\n"
29
- "Please manually clone OpenXLSX:\n"
30
- " cd ${CMAKE_SOURCE_DIR}/.. && git clone --depth 1 --branch v0.5.1 https://github.com/troldal/OpenXLSX.git OpenXLSX\n"
31
- "Then clean CMake cache and rebuild."
32
- )
33
- endif()
7
+ set(THIRDPARTY_DIR ${CMAKE_SOURCE_DIR}/../thirdparty)
8
+ set(OPENXLSX_DIR ${THIRDPARTY_DIR}/OpenXLSX)
9
+
10
+ # OpenXLSX, pugixml and miniz are vendored under thirdparty/ so the build
11
+ # never clones anything from GitHub.
12
+ foreach(required_dir OpenXLSX pugixml miniz)
13
+ if(NOT EXISTS ${THIRDPARTY_DIR}/${required_dir})
14
+ message(FATAL_ERROR
15
+ "Vendored dependency '${required_dir}' is missing at ${THIRDPARTY_DIR}/${required_dir}.\n"
16
+ "The thirdparty/ tree is part of the package - reinstall react-native-nitro-xlsx."
17
+ )
18
+ endif()
19
+ endforeach()
20
+
21
+ # Point OpenXLSX's FetchContent lookups at the vendored copies, so
22
+ # manage_dependency() populates them from disk instead of cloning GitHub.
23
+ set(FORCE_FETCH_ALL ON CACHE BOOL "" FORCE)
24
+ set(FETCHCONTENT_SOURCE_DIR_PUGIXML_FETCH ${THIRDPARTY_DIR}/pugixml CACHE PATH "" FORCE)
25
+ set(FETCHCONTENT_SOURCE_DIR_MINIZ_FETCH ${THIRDPARTY_DIR}/miniz CACHE PATH "" FORCE)
26
+ set(FETCHCONTENT_UPDATES_DISCONNECTED ON CACHE BOOL "" FORCE)
34
27
 
35
28
  set(OPENXLSX_BUILD_SAMPLES OFF CACHE BOOL "" FORCE)
36
29
  set(OPENXLSX_BUILD_TESTS OFF CACHE BOOL "" FORCE)
@@ -47,6 +40,10 @@ add_library(
47
40
  ../cpp/HybridXlsxWorkbook.cpp
48
41
  ../cpp/HybridXlsxWorksheet.cpp
49
42
  ../cpp/HybridXlsxCellFormat.cpp
43
+ ../cpp/HybridXlsxConditionalFormat.cpp
44
+ ../cpp/HybridXlsxConditionalFormats.cpp
45
+ ../cpp/XlsxJson.cpp
46
+ ../cpp/XlsxCacheDir.cpp
50
47
  cpp-adapter.cpp
51
48
  )
52
49
 
@@ -1,9 +1,21 @@
1
1
  #include <jni.h>
2
2
  #include <fbjni/fbjni.h>
3
3
  #include "NitroXlsxOnLoad.hpp"
4
+ #include "XlsxCacheDir.hpp"
4
5
 
5
6
  JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void*) {
6
7
  return facebook::jni::initialize(vm, []() {
7
8
  margelo::nitro::xlsx::registerAllNatives();
8
9
  });
9
10
  }
11
+
12
+ // Called from NitroXlsxPackage with Context.getCacheDir().absolutePath
13
+ extern "C" JNIEXPORT void JNICALL
14
+ Java_com_margelo_nitro_xlsx_NitroXlsxPackage_nativeSetCacheDir(JNIEnv* env, jclass, jstring dir) {
15
+ if (dir == nullptr) return;
16
+ const char* chars = env->GetStringUTFChars(dir, nullptr);
17
+ if (chars != nullptr) {
18
+ margelo::nitro::xlsx::setCacheDir(std::string(chars));
19
+ env->ReleaseStringUTFChars(dir, chars);
20
+ }
21
+ }