@papyrus-sdk/engine-native 0.2.12-beta.0 → 0.2.15

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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Papyrus Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/dist/index.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { ComponentType, RefAttributes } from 'react';
2
2
  import { ViewProps, View } from 'react-native';
3
3
  import { BaseDocumentEngine } from '@papyrus-sdk/core';
4
- import { PageTheme, DocumentLoadInput, TextItem, TextSelection, OutlineItem, SearchResult, PageDestination, RenderTargetType } from '@papyrus-sdk/types';
4
+ import { RenderTargetType, DocumentLoadInput, TextItem, SearchResult, TextSelection, OutlineItem, PageDestination, PageTheme } from '@papyrus-sdk/types';
5
5
 
6
6
  type PapyrusPageViewProps = ViewProps & {
7
7
  engineId?: string;
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { ComponentType, RefAttributes } from 'react';
2
2
  import { ViewProps, View } from 'react-native';
3
3
  import { BaseDocumentEngine } from '@papyrus-sdk/core';
4
- import { PageTheme, DocumentLoadInput, TextItem, TextSelection, OutlineItem, SearchResult, PageDestination, RenderTargetType } from '@papyrus-sdk/types';
4
+ import { RenderTargetType, DocumentLoadInput, TextItem, SearchResult, TextSelection, OutlineItem, PageDestination, PageTheme } from '@papyrus-sdk/types';
5
5
 
6
6
  type PapyrusPageViewProps = ViewProps & {
7
7
  engineId?: string;
@@ -1,12 +1,12 @@
1
1
  Pod::Spec.new do |s|
2
2
  s.name = 'PapyrusNativeEngine'
3
- s.version = '0.1.1'
3
+ s.version = '0.2.12'
4
4
  s.summary = 'Papyrus Native Engine (PDFKit)'
5
- s.homepage = 'https://example.com/papyrus'
5
+ s.homepage = 'https://solrachix.github.io/Papyrus/'
6
6
  s.license = { :type => 'MIT' }
7
- s.author = { 'Papyrus' => 'dev@papyrus.local' }
7
+ s.author = { 'Papyrus SDK' => 'https://github.com/solrachix/Papyrus' }
8
8
  s.platforms = { :ios => '13.0' }
9
- s.source = { :git => 'https://example.com/papyrus.git', :tag => s.version.to_s }
9
+ s.source = { :git => 'https://github.com/solrachix/Papyrus.git', :tag => s.version.to_s }
10
10
  s.source_files = '**/*.{h,m,mm,swift}'
11
11
  s.requires_arc = true
12
12
  s.swift_version = '5.0'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@papyrus-sdk/engine-native",
3
- "version": "0.2.12-beta.0",
3
+ "version": "0.2.15",
4
4
  "license": "MIT",
5
5
  "keywords": [
6
6
  "papyrus",
@@ -14,19 +14,20 @@
14
14
  ],
15
15
  "main": "dist/index.js",
16
16
  "react-native": "dist/index.js",
17
- "module": "dist/index.js",
17
+ "module": "dist/index.mjs",
18
18
  "types": "dist/index.d.ts",
19
19
  "exports": {
20
20
  ".": {
21
21
  "react-native": "./dist/index.js",
22
22
  "types": "./dist/index.d.ts",
23
- "import": "./dist/index.js",
23
+ "import": "./dist/index.mjs",
24
24
  "require": "./dist/index.js"
25
25
  }
26
26
  },
27
27
  "files": [
28
28
  "dist",
29
- "android/src",
29
+ "android/src/main",
30
+ "!android/src/main/cpp/*_test.cpp",
30
31
  "android/build.gradle",
31
32
  "android/consumer-rules.pro",
32
33
  "ios/*.h",
@@ -45,18 +46,17 @@
45
46
  "bugs": {
46
47
  "url": "https://github.com/solrachix/Papyrus/issues"
47
48
  },
48
- "scripts": {
49
- "build": "tsup index.ts --dts --format cjs,esm --out-dir dist --clean --sourcemap",
50
- "prepublishOnly": "pnpm build"
51
- },
52
49
  "peerDependencies": {
53
- "@papyrus-sdk/core": ">=0.2.15-beta.0",
54
- "@papyrus-sdk/types": ">=0.2.8-beta.0",
50
+ "@papyrus-sdk/core": ">=0.2.18",
51
+ "@papyrus-sdk/types": ">=0.2.11",
55
52
  "react-native": ">=0.81.0"
56
53
  },
57
54
  "devDependencies": {
58
- "@papyrus-sdk/core": "0.2.15-beta.0",
59
- "@papyrus-sdk/types": "0.2.8-beta.0",
55
+ "@papyrus-sdk/core": "0.2.18",
56
+ "@papyrus-sdk/types": "0.2.11",
60
57
  "react-native": "^0.81.0"
58
+ },
59
+ "scripts": {
60
+ "build": "tsup index.ts --dts --format cjs,esm --out-dir dist --clean --sourcemap"
61
61
  }
62
- }
62
+ }
@@ -1,40 +0,0 @@
1
- package com.papyrus.engine;
2
-
3
- import static org.junit.Assert.assertFalse;
4
- import static org.junit.Assert.assertTrue;
5
-
6
- import org.junit.Test;
7
-
8
- public class PapyrusOutlineTest {
9
- @Test
10
- public void computeAvailabilityReturnsTrueWhenLoaderAndProbeSucceed() {
11
- boolean available = PapyrusOutline.computeAvailability(() -> {}, () -> true);
12
-
13
- assertTrue(available);
14
- }
15
-
16
- @Test
17
- public void computeAvailabilityReturnsFalseWhenProbeReturnsFalse() {
18
- boolean available = PapyrusOutline.computeAvailability(() -> {}, () -> false);
19
-
20
- assertFalse(available);
21
- }
22
-
23
- @Test
24
- public void computeAvailabilityReturnsFalseWhenProbeThrows() {
25
- boolean available = PapyrusOutline.computeAvailability(() -> {}, () -> {
26
- throw new UnsatisfiedLinkError("missing probe");
27
- });
28
-
29
- assertFalse(available);
30
- }
31
-
32
- @Test
33
- public void computeAvailabilityReturnsFalseWhenLibraryLoadThrows() {
34
- boolean available = PapyrusOutline.computeAvailability(() -> {
35
- throw new UnsatisfiedLinkError("missing lib");
36
- }, () -> true);
37
-
38
- assertFalse(available);
39
- }
40
- }
@@ -1,30 +0,0 @@
1
- package com.papyrus.engine;
2
-
3
- import static org.junit.Assert.assertArrayEquals;
4
- import static org.junit.Assert.assertTrue;
5
-
6
- import org.junit.Test;
7
-
8
- public class PapyrusPageViewTest {
9
- @Test
10
- public void constrainRenderSizeKeepsSafeSizesUntouched() {
11
- int[] size = PapyrusPageView.constrainRenderSize(1200, 1600);
12
-
13
- assertArrayEquals(new int[] {1200, 1600}, size);
14
- }
15
-
16
- @Test
17
- public void constrainRenderSizeCapsOversizedBitmapsPreservingAspectRatio() {
18
- int[] size = PapyrusPageView.constrainRenderSize(6000, 8000);
19
-
20
- assertTrue(size[0] > 0);
21
- assertTrue(size[1] > 0);
22
- assertTrue(size[0] <= PapyrusPageView.MAX_RENDER_EDGE);
23
- assertTrue(size[1] <= PapyrusPageView.MAX_RENDER_EDGE);
24
- assertTrue(
25
- ((long) size[0] * (long) size[1]) <= PapyrusPageView.MAX_RENDER_PIXELS
26
- );
27
- assertTrue(size[0] < 6000);
28
- assertTrue(size[1] < 8000);
29
- }
30
- }