@webority/mobile-ui 0.122.0 → 0.124.0

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 (99) hide show
  1. package/android/src/newarch/java/com/webority/mobileui/pdfrasterizer/PdfRasterizerModule.kt +33 -33
  2. package/dist/canvas-kit/kit.js +3957 -3775
  3. package/dist/canvas-kit/manifest.json +136 -2
  4. package/dist/canvas-kit/release.json +6 -6
  5. package/lib/commonjs/components/AppIcon/catalog/bold/b.g.js +1 -1
  6. package/lib/commonjs/components/AppIcon/catalog/bold/h.g.js +1 -1
  7. package/lib/commonjs/components/AppIcon/catalog/bold/m.g.js +1 -1
  8. package/lib/commonjs/components/AppIcon/catalog/bold/p.g.js +1 -1
  9. package/lib/commonjs/components/AppIcon/catalog/bold/v.g.js +1 -1
  10. package/lib/commonjs/components/AppIcon/catalog/broken/b.g.js +1 -1
  11. package/lib/commonjs/components/AppIcon/catalog/broken/h.g.js +1 -1
  12. package/lib/commonjs/components/AppIcon/catalog/broken/m.g.js +1 -1
  13. package/lib/commonjs/components/AppIcon/catalog/broken/p.g.js +1 -1
  14. package/lib/commonjs/components/AppIcon/catalog/broken/v.g.js +1 -1
  15. package/lib/commonjs/components/AppIcon/catalog/bulk/b.g.js +1 -1
  16. package/lib/commonjs/components/AppIcon/catalog/bulk/h.g.js +1 -1
  17. package/lib/commonjs/components/AppIcon/catalog/bulk/m.g.js +1 -1
  18. package/lib/commonjs/components/AppIcon/catalog/bulk/p.g.js +1 -1
  19. package/lib/commonjs/components/AppIcon/catalog/bulk/v.g.js +1 -1
  20. package/lib/commonjs/components/AppIcon/catalog/linear/b.g.js +1 -1
  21. package/lib/commonjs/components/AppIcon/catalog/linear/h.g.js +1 -1
  22. package/lib/commonjs/components/AppIcon/catalog/linear/m.g.js +1 -1
  23. package/lib/commonjs/components/AppIcon/catalog/linear/p.g.js +1 -1
  24. package/lib/commonjs/components/AppIcon/catalog/linear/v.g.js +1 -1
  25. package/lib/commonjs/components/AppIcon/catalog/outline/b.g.js +1 -1
  26. package/lib/commonjs/components/AppIcon/catalog/outline/h.g.js +1 -1
  27. package/lib/commonjs/components/AppIcon/catalog/outline/m.g.js +1 -1
  28. package/lib/commonjs/components/AppIcon/catalog/outline/p.g.js +1 -1
  29. package/lib/commonjs/components/AppIcon/catalog/outline/v.g.js +1 -1
  30. package/lib/commonjs/components/AppIcon/catalog/twotone/b.g.js +1 -1
  31. package/lib/commonjs/components/AppIcon/catalog/twotone/h.g.js +1 -1
  32. package/lib/commonjs/components/AppIcon/catalog/twotone/m.g.js +1 -1
  33. package/lib/commonjs/components/AppIcon/catalog/twotone/p.g.js +1 -1
  34. package/lib/commonjs/components/AppIcon/catalog/twotone/v.g.js +1 -1
  35. package/lib/commonjs/components/AppIcon/catalog.g.js +1 -1
  36. package/lib/commonjs/components/AppIcon/glyphs.g.js +1 -1
  37. package/lib/commonjs/components/AppIcon/variants.g.js +1 -1
  38. package/lib/commonjs/components/Chip/Chip.js +1 -1
  39. package/lib/commonjs/components/Composer/Composer.js +1 -1
  40. package/lib/commonjs/components/Markdown/Markdown.js +1 -1
  41. package/lib/commonjs/components/SquircleImage/SquircleImage.js +1 -0
  42. package/lib/commonjs/components/SquircleImage/index.js +1 -0
  43. package/lib/commonjs/components/index.js +1 -1
  44. package/lib/module/components/AppIcon/catalog/bold/b.g.js +1 -1
  45. package/lib/module/components/AppIcon/catalog/bold/h.g.js +1 -1
  46. package/lib/module/components/AppIcon/catalog/bold/m.g.js +1 -1
  47. package/lib/module/components/AppIcon/catalog/bold/p.g.js +1 -1
  48. package/lib/module/components/AppIcon/catalog/bold/v.g.js +1 -1
  49. package/lib/module/components/AppIcon/catalog/broken/b.g.js +1 -1
  50. package/lib/module/components/AppIcon/catalog/broken/h.g.js +1 -1
  51. package/lib/module/components/AppIcon/catalog/broken/m.g.js +1 -1
  52. package/lib/module/components/AppIcon/catalog/broken/p.g.js +1 -1
  53. package/lib/module/components/AppIcon/catalog/broken/v.g.js +1 -1
  54. package/lib/module/components/AppIcon/catalog/bulk/b.g.js +1 -1
  55. package/lib/module/components/AppIcon/catalog/bulk/h.g.js +1 -1
  56. package/lib/module/components/AppIcon/catalog/bulk/m.g.js +1 -1
  57. package/lib/module/components/AppIcon/catalog/bulk/p.g.js +1 -1
  58. package/lib/module/components/AppIcon/catalog/bulk/v.g.js +1 -1
  59. package/lib/module/components/AppIcon/catalog/linear/b.g.js +1 -1
  60. package/lib/module/components/AppIcon/catalog/linear/h.g.js +1 -1
  61. package/lib/module/components/AppIcon/catalog/linear/m.g.js +1 -1
  62. package/lib/module/components/AppIcon/catalog/linear/p.g.js +1 -1
  63. package/lib/module/components/AppIcon/catalog/linear/v.g.js +1 -1
  64. package/lib/module/components/AppIcon/catalog/outline/b.g.js +1 -1
  65. package/lib/module/components/AppIcon/catalog/outline/h.g.js +1 -1
  66. package/lib/module/components/AppIcon/catalog/outline/m.g.js +1 -1
  67. package/lib/module/components/AppIcon/catalog/outline/p.g.js +1 -1
  68. package/lib/module/components/AppIcon/catalog/outline/v.g.js +1 -1
  69. package/lib/module/components/AppIcon/catalog/twotone/b.g.js +1 -1
  70. package/lib/module/components/AppIcon/catalog/twotone/h.g.js +1 -1
  71. package/lib/module/components/AppIcon/catalog/twotone/m.g.js +1 -1
  72. package/lib/module/components/AppIcon/catalog/twotone/p.g.js +1 -1
  73. package/lib/module/components/AppIcon/catalog/twotone/v.g.js +1 -1
  74. package/lib/module/components/AppIcon/catalog.g.js +1 -1
  75. package/lib/module/components/AppIcon/glyphs.g.js +1 -1
  76. package/lib/module/components/AppIcon/variants.g.js +1 -1
  77. package/lib/module/components/Chip/Chip.js +1 -1
  78. package/lib/module/components/Composer/Composer.js +1 -1
  79. package/lib/module/components/Markdown/Markdown.js +1 -1
  80. package/lib/module/components/SquircleImage/SquircleImage.js +1 -0
  81. package/lib/module/components/SquircleImage/index.js +1 -0
  82. package/lib/module/components/index.js +1 -1
  83. package/lib/typescript/commonjs/components/AppIcon/catalog.g.d.ts +1 -1
  84. package/lib/typescript/commonjs/components/AppIcon/glyphs.g.d.ts +21 -0
  85. package/lib/typescript/commonjs/components/Chip/Chip.d.ts +2 -0
  86. package/lib/typescript/commonjs/components/Composer/Composer.d.ts +8 -1
  87. package/lib/typescript/commonjs/components/Markdown/Markdown.d.ts +5 -1
  88. package/lib/typescript/commonjs/components/SquircleImage/SquircleImage.d.ts +21 -0
  89. package/lib/typescript/commonjs/components/SquircleImage/index.d.ts +3 -0
  90. package/lib/typescript/commonjs/components/index.d.ts +2 -0
  91. package/lib/typescript/module/components/AppIcon/catalog.g.d.ts +1 -1
  92. package/lib/typescript/module/components/AppIcon/glyphs.g.d.ts +21 -0
  93. package/lib/typescript/module/components/Chip/Chip.d.ts +2 -0
  94. package/lib/typescript/module/components/Composer/Composer.d.ts +8 -1
  95. package/lib/typescript/module/components/Markdown/Markdown.d.ts +5 -1
  96. package/lib/typescript/module/components/SquircleImage/SquircleImage.d.ts +21 -0
  97. package/lib/typescript/module/components/SquircleImage/index.d.ts +3 -0
  98. package/lib/typescript/module/components/index.d.ts +2 -0
  99. package/package.json +7 -7
@@ -65,14 +65,13 @@ class PdfRasterizerModule(reactContext: ReactApplicationContext) :
65
65
  val handle = UUID.randomUUID().toString()
66
66
  openDocuments[handle] = OpenDocument(renderer, fd)
67
67
 
68
- val page = renderer.openPage(0)
68
+ // PdfRenderer reports page size in points (1/72 in) — return as-is.
69
+ val (pageWidth, pageHeight) = renderer.openPage(0).use { page -> page.width to page.height }
69
70
  val result: WritableMap = Arguments.createMap()
70
71
  result.putString("handle", handle)
71
72
  result.putInt("pageCount", renderer.pageCount)
72
- // PdfRenderer reports page size in points (1/72 in) — return as-is.
73
- result.putDouble("pageWidth", page.width.toDouble())
74
- result.putDouble("pageHeight", page.height.toDouble())
75
- page.close()
73
+ result.putDouble("pageWidth", pageWidth.toDouble())
74
+ result.putDouble("pageHeight", pageHeight.toDouble())
76
75
 
77
76
  promise.resolve(result)
78
77
  } catch (e: SecurityException) {
@@ -107,11 +106,10 @@ class PdfRasterizerModule(reactContext: ReactApplicationContext) :
107
106
  }
108
107
 
109
108
  try {
110
- val page = doc.renderer.openPage(index)
109
+ val (width, height) = doc.renderer.openPage(index).use { page -> page.width to page.height }
111
110
  val result: WritableMap = Arguments.createMap()
112
- result.putDouble("width", page.width.toDouble())
113
- result.putDouble("height", page.height.toDouble())
114
- page.close()
111
+ result.putDouble("width", width.toDouble())
112
+ result.putDouble("height", height.toDouble())
115
113
  promise.resolve(result)
116
114
  } catch (e: Exception) {
117
115
  promise.reject(ERR_INVALID_PDF, "Failed to read page $index: ${e.message}", e)
@@ -150,22 +148,22 @@ class PdfRasterizerModule(reactContext: ReactApplicationContext) :
150
148
  return@synchronized
151
149
  }
152
150
 
153
- val page = doc.renderer.openPage(index)
154
- val longSide = maxOf(page.width, page.height) * scale
155
- val fit = if (longSide > MAX_RENDER_DIMENSION_PX) MAX_RENDER_DIMENSION_PX / longSide else 1.0
156
- val targetWidth = positiveDimension((page.width * scale * fit).roundToInt())
157
- val targetHeight = positiveDimension((page.height * scale * fit).roundToInt())
158
-
159
- val bitmap = Bitmap.createBitmap(targetWidth, targetHeight, Bitmap.Config.ARGB_8888)
160
- // Fill white first — PDF transparency renders as black on some devices otherwise.
161
- bitmap.eraseColor(Color.WHITE)
162
- page.render(bitmap, null, null, PdfRenderer.Page.RENDER_MODE_FOR_DISPLAY)
163
- page.close()
164
-
165
- FileOutputStream(outputFile).use { out ->
166
- bitmap.compress(Bitmap.CompressFormat.PNG, 100, out)
151
+ doc.renderer.openPage(index).use { page ->
152
+ val longSide = maxOf(page.width, page.height) * scale
153
+ val fit = if (longSide > MAX_RENDER_DIMENSION_PX) MAX_RENDER_DIMENSION_PX / longSide else 1.0
154
+ val targetWidth = positiveDimension((page.width * scale * fit).roundToInt())
155
+ val targetHeight = positiveDimension((page.height * scale * fit).roundToInt())
156
+
157
+ val bitmap = Bitmap.createBitmap(targetWidth, targetHeight, Bitmap.Config.ARGB_8888)
158
+ // Fill white first — PDF transparency renders as black on some devices otherwise.
159
+ bitmap.eraseColor(Color.WHITE)
160
+ page.render(bitmap, null, null, PdfRenderer.Page.RENDER_MODE_FOR_DISPLAY)
161
+
162
+ FileOutputStream(outputFile).use { out ->
163
+ bitmap.compress(Bitmap.CompressFormat.PNG, 100, out)
164
+ }
165
+ bitmap.recycle()
167
166
  }
168
- bitmap.recycle()
169
167
 
170
168
  promise.resolve("file://${outputFile.absolutePath}")
171
169
  } catch (e: Exception) {
@@ -179,15 +177,17 @@ class PdfRasterizerModule(reactContext: ReactApplicationContext) :
179
177
  executor.execute {
180
178
  val doc = openDocuments.remove(handle)
181
179
  if (doc != null) {
182
- try {
183
- doc.renderer.close()
184
- } catch (_: Exception) {
185
- // Best-effort.
186
- }
187
- try {
188
- doc.fd.close()
189
- } catch (_: Exception) {
190
- // Best-effort.
180
+ synchronized(doc.renderer) {
181
+ try {
182
+ doc.renderer.close()
183
+ } catch (_: Exception) {
184
+ // Best-effort.
185
+ }
186
+ try {
187
+ doc.fd.close()
188
+ } catch (_: Exception) {
189
+ // Best-effort.
190
+ }
191
191
  }
192
192
  }
193
193