expo-print 11.0.4 → 11.2.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.
- package/CHANGELOG.md +11 -7
- package/README.md +3 -3
- package/android/build.gradle +41 -24
- package/build/ExponentPrint.d.ts +1 -0
- package/build/ExponentPrint.d.ts.map +1 -0
- package/build/ExponentPrint.web.d.ts +1 -0
- package/build/ExponentPrint.web.d.ts.map +1 -0
- package/build/Print.d.ts +3 -1
- package/build/Print.d.ts.map +1 -0
- package/build/Print.js +2 -1
- package/build/Print.js.map +1 -1
- package/build/Print.types.d.ts +20 -9
- package/build/Print.types.d.ts.map +1 -0
- package/build/Print.types.js.map +1 -1
- package/ios/EXPrint.xcframework/ios-arm64/EXPrint.framework/EXPrint +0 -0
- package/ios/EXPrint.xcframework/ios-arm64/EXPrint.framework/Info.plist +0 -0
- package/ios/EXPrint.xcframework/ios-arm64_x86_64-simulator/EXPrint.framework/EXPrint +0 -0
- package/ios/EXPrint.xcframework/ios-arm64_x86_64-simulator/EXPrint.framework/Info.plist +0 -0
- package/package.json +7 -6
- package/src/Print.ts +2 -1
- package/src/Print.types.ts +19 -9
package/CHANGELOG.md
CHANGED
|
@@ -10,19 +10,23 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
-
## 11.0
|
|
13
|
+
## 11.2.0 — 2022-04-18
|
|
14
14
|
|
|
15
|
-
###
|
|
15
|
+
### ⚠️ Notices
|
|
16
16
|
|
|
17
|
-
-
|
|
17
|
+
- On Android bump `compileSdkVersion` to `31`, `targetSdkVersion` to `31` and `Java` version to `11`. ([#16941](https://github.com/expo/expo/pull/16941) by [@bbarthec](https://github.com/bbarthec))
|
|
18
18
|
|
|
19
|
-
## 11.
|
|
19
|
+
## 11.1.1 - 2022-02-01
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
### 🐛 Bug fixes
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
- Fix `Plugin with id 'maven' not found` build error from Android Gradle 7. ([#16080](https://github.com/expo/expo/pull/16080) by [@kudo](https://github.com/kudo))
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
## 11.1.0 — 2021-12-03
|
|
26
|
+
|
|
27
|
+
### 🐛 Bug fixes
|
|
28
|
+
|
|
29
|
+
- Fix page-breaks and margins not supported on iOS ([#14383](https://github.com/expo/expo/pull/14802) by [@cruzach](https://github.com/IjzerenHein))
|
|
26
30
|
|
|
27
31
|
## 11.0.1 — 2021-10-01
|
|
28
32
|
|
package/README.md
CHANGED
|
@@ -4,12 +4,12 @@ Provides an API for iOS (AirPrint) and Android printing functionality.
|
|
|
4
4
|
|
|
5
5
|
# API documentation
|
|
6
6
|
|
|
7
|
-
- [Documentation for the
|
|
8
|
-
- [Documentation for the latest stable release](https://docs.expo.
|
|
7
|
+
- [Documentation for the main branch](https://github.com/expo/expo/blob/main/docs/pages/versions/unversioned/sdk/print.md)
|
|
8
|
+
- [Documentation for the latest stable release](https://docs.expo.dev/versions/latest/sdk/print/)
|
|
9
9
|
|
|
10
10
|
# Installation in managed Expo projects
|
|
11
11
|
|
|
12
|
-
For
|
|
12
|
+
For [managed](https://docs.expo.dev/versions/latest/introduction/managed-vs-bare/) Expo projects, please follow the installation instructions in the [API documentation for the latest stable release](https://docs.expo.dev/versions/latest/sdk/print/).
|
|
13
13
|
|
|
14
14
|
# Installation in bare React Native projects
|
|
15
15
|
|
package/android/build.gradle
CHANGED
|
@@ -1,63 +1,80 @@
|
|
|
1
1
|
apply plugin: 'com.android.library'
|
|
2
2
|
apply plugin: 'kotlin-android'
|
|
3
|
-
apply plugin: 'maven'
|
|
3
|
+
apply plugin: 'maven-publish'
|
|
4
4
|
|
|
5
5
|
group = 'host.exp.exponent'
|
|
6
|
-
version = '11.0
|
|
6
|
+
version = '11.2.0'
|
|
7
7
|
|
|
8
8
|
buildscript {
|
|
9
|
+
def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
|
|
10
|
+
if (expoModulesCorePlugin.exists()) {
|
|
11
|
+
apply from: expoModulesCorePlugin
|
|
12
|
+
applyKotlinExpoModulesCorePlugin()
|
|
13
|
+
}
|
|
14
|
+
|
|
9
15
|
// Simple helper that allows the root project to override versions declared by this library.
|
|
10
16
|
ext.safeExtGet = { prop, fallback ->
|
|
11
17
|
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
|
|
12
18
|
}
|
|
13
19
|
|
|
20
|
+
// Ensures backward compatibility
|
|
21
|
+
ext.getKotlinVersion = {
|
|
22
|
+
if (ext.has("kotlinVersion")) {
|
|
23
|
+
ext.kotlinVersion()
|
|
24
|
+
} else {
|
|
25
|
+
ext.safeExtGet("kotlinVersion", "1.6.10")
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
14
29
|
repositories {
|
|
15
30
|
mavenCentral()
|
|
16
31
|
}
|
|
17
32
|
|
|
18
33
|
dependencies {
|
|
19
|
-
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${
|
|
34
|
+
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${getKotlinVersion()}")
|
|
20
35
|
}
|
|
21
36
|
}
|
|
22
37
|
|
|
23
|
-
// Upload android library to maven with javadoc and android sources
|
|
24
|
-
configurations {
|
|
25
|
-
deployerJars
|
|
26
|
-
}
|
|
27
|
-
|
|
28
38
|
// Creating sources with comments
|
|
29
39
|
task androidSourcesJar(type: Jar) {
|
|
30
40
|
classifier = 'sources'
|
|
31
41
|
from android.sourceSets.main.java.srcDirs
|
|
32
42
|
}
|
|
33
43
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
+
afterEvaluate {
|
|
45
|
+
publishing {
|
|
46
|
+
publications {
|
|
47
|
+
release(MavenPublication) {
|
|
48
|
+
from components.release
|
|
49
|
+
// Add additional sourcesJar to artifacts
|
|
50
|
+
artifact(androidSourcesJar)
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
repositories {
|
|
54
|
+
maven {
|
|
55
|
+
url = mavenLocal().url
|
|
56
|
+
}
|
|
44
57
|
}
|
|
45
58
|
}
|
|
46
59
|
}
|
|
47
60
|
|
|
48
61
|
android {
|
|
49
|
-
compileSdkVersion safeExtGet("compileSdkVersion",
|
|
62
|
+
compileSdkVersion safeExtGet("compileSdkVersion", 31)
|
|
50
63
|
|
|
51
64
|
compileOptions {
|
|
52
|
-
sourceCompatibility JavaVersion.
|
|
53
|
-
targetCompatibility JavaVersion.
|
|
65
|
+
sourceCompatibility JavaVersion.VERSION_11
|
|
66
|
+
targetCompatibility JavaVersion.VERSION_11
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
kotlinOptions {
|
|
70
|
+
jvmTarget = JavaVersion.VERSION_11.majorVersion
|
|
54
71
|
}
|
|
55
72
|
|
|
56
73
|
defaultConfig {
|
|
57
74
|
minSdkVersion safeExtGet("minSdkVersion", 21)
|
|
58
|
-
targetSdkVersion safeExtGet("targetSdkVersion",
|
|
75
|
+
targetSdkVersion safeExtGet("targetSdkVersion", 31)
|
|
59
76
|
versionCode 27
|
|
60
|
-
versionName "11.0
|
|
77
|
+
versionName "11.2.0"
|
|
61
78
|
}
|
|
62
79
|
lintOptions {
|
|
63
80
|
abortOnError false
|
|
@@ -67,5 +84,5 @@ android {
|
|
|
67
84
|
dependencies {
|
|
68
85
|
implementation project(':expo-modules-core')
|
|
69
86
|
|
|
70
|
-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${
|
|
87
|
+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${getKotlinVersion()}"
|
|
71
88
|
}
|
package/build/ExponentPrint.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExponentPrint.d.ts","sourceRoot":"","sources":["../src/ExponentPrint.ts"],"names":[],"mappings":";AACA,wBAAgD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExponentPrint.web.d.ts","sourceRoot":"","sources":["../src/ExponentPrint.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;;;;aAY/B,QAAQ,IAAI,CAAC;wBAGF,QAAQ,IAAI,CAAC;;AAbzC,wBAgBE"}
|
package/build/Print.d.ts
CHANGED
|
@@ -14,8 +14,9 @@ export declare const Orientation: OrientationType;
|
|
|
14
14
|
*/
|
|
15
15
|
export declare function printAsync(options: PrintOptions): Promise<void>;
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
17
|
+
* Chooses a printer that can be later used in `printAsync`
|
|
18
18
|
* @return A promise which fulfils with an object containing `name` and `url` of the selected printer.
|
|
19
|
+
* @platform ios
|
|
19
20
|
*/
|
|
20
21
|
export declare function selectPrinterAsync(): Promise<Printer>;
|
|
21
22
|
/**
|
|
@@ -24,3 +25,4 @@ export declare function selectPrinterAsync(): Promise<Printer>;
|
|
|
24
25
|
* @param options A map of print options.
|
|
25
26
|
*/
|
|
26
27
|
export declare function printToFileAsync(options?: FilePrintOptions): Promise<FilePrintResult>;
|
|
28
|
+
//# sourceMappingURL=Print.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Print.d.ts","sourceRoot":"","sources":["../src/Print.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,YAAY,EACZ,OAAO,EACR,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,eAAe,EAAE,YAAY,EAAE,OAAO,EAAE,CAAC;AAGrF;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,eAA2C,CAAC;AAGtE;;;;;;;GAOG;AACH,wBAAsB,UAAU,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAcrE;AAGD;;;;GAIG;AACH,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,OAAO,CAAC,CAM3D;AAGD;;;;GAIG;AACH,wBAAsB,gBAAgB,CAAC,OAAO,GAAE,gBAAqB,GAAG,OAAO,CAAC,eAAe,CAAC,CAE/F"}
|
package/build/Print.js
CHANGED
|
@@ -32,8 +32,9 @@ export async function printAsync(options) {
|
|
|
32
32
|
}
|
|
33
33
|
// @needsAudit
|
|
34
34
|
/**
|
|
35
|
-
*
|
|
35
|
+
* Chooses a printer that can be later used in `printAsync`
|
|
36
36
|
* @return A promise which fulfils with an object containing `name` and `url` of the selected printer.
|
|
37
|
+
* @platform ios
|
|
37
38
|
*/
|
|
38
39
|
export async function selectPrinterAsync() {
|
|
39
40
|
if (ExponentPrint.selectPrinter) {
|
package/build/Print.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Print.js","sourceRoot":"","sources":["../src/Print.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAW5C,2BAA2B;AAC3B;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAoB,aAAa,CAAC,WAAW,CAAC;AAEtE,cAAc;AACd;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,OAAqB;IACpD,IAAI,QAAQ,CAAC,EAAE,KAAK,KAAK,EAAE;QACzB,OAAO,MAAM,aAAa,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;KAC3C;IACD,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,IAAI,QAAQ,CAAC,EAAE,KAAK,KAAK,IAAI,CAAC,OAAO,CAAC,kBAAkB,EAAE;QACzF,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAC;KACjE;IACD,IAAI,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,IAAI,EAAE;QAC/B,MAAM,IAAI,KAAK,CAAC,sEAAsE,CAAC,CAAC;KACzF;IACD,IAAI,OAAO,CAAC,kBAAkB,KAAK,SAAS,EAAE;QAC5C,OAAO,CAAC,IAAI,CAAC,8EAA8E,CAAC,CAAC;KAC9F;IACD,OAAO,MAAM,aAAa,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;AAC5C,CAAC;AAED,cAAc;AACd
|
|
1
|
+
{"version":3,"file":"Print.js","sourceRoot":"","sources":["../src/Print.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAW5C,2BAA2B;AAC3B;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAoB,aAAa,CAAC,WAAW,CAAC;AAEtE,cAAc;AACd;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,OAAqB;IACpD,IAAI,QAAQ,CAAC,EAAE,KAAK,KAAK,EAAE;QACzB,OAAO,MAAM,aAAa,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;KAC3C;IACD,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,IAAI,QAAQ,CAAC,EAAE,KAAK,KAAK,IAAI,CAAC,OAAO,CAAC,kBAAkB,EAAE;QACzF,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAC;KACjE;IACD,IAAI,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,IAAI,EAAE;QAC/B,MAAM,IAAI,KAAK,CAAC,sEAAsE,CAAC,CAAC;KACzF;IACD,IAAI,OAAO,CAAC,kBAAkB,KAAK,SAAS,EAAE;QAC5C,OAAO,CAAC,IAAI,CAAC,8EAA8E,CAAC,CAAC;KAC9F;IACD,OAAO,MAAM,aAAa,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;AAC5C,CAAC;AAED,cAAc;AACd;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB;IACtC,IAAI,aAAa,CAAC,aAAa,EAAE;QAC/B,OAAO,MAAM,aAAa,CAAC,aAAa,EAAE,CAAC;KAC5C;IAED,MAAM,IAAI,mBAAmB,CAAC,OAAO,EAAE,oBAAoB,CAAC,CAAC;AAC/D,CAAC;AAED,cAAc;AACd;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,UAA4B,EAAE;IACnE,OAAO,MAAM,aAAa,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;AACvD,CAAC","sourcesContent":["import { UnavailabilityError } from 'expo-modules-core';\nimport { Platform } from 'react-native';\n\nimport ExponentPrint from './ExponentPrint';\nimport {\n FilePrintOptions,\n FilePrintResult,\n OrientationType,\n PrintOptions,\n Printer,\n} from './Print.types';\n\nexport { FilePrintOptions, FilePrintResult, OrientationType, PrintOptions, Printer };\n\n// @needsAudit @docsMissing\n/**\n * The orientation of the printed content.\n */\nexport const Orientation: OrientationType = ExponentPrint.Orientation;\n\n// @needsAudit\n/**\n * Prints a document or HTML, on web this prints the HTML from the page.\n * > Note: On iOS, printing from HTML source doesn't support local asset URLs (due to `WKWebView`\n * > limitations). As a workaround you can use inlined base64-encoded strings.\n * > See [this comment](https://github.com/expo/expo/issues/7940#issuecomment-657111033) for more details.\n * @param options A map defining what should be printed.\n * @return Resolves to an empty `Promise` if printing started.\n */\nexport async function printAsync(options: PrintOptions): Promise<void> {\n if (Platform.OS === 'web') {\n return await ExponentPrint.print(options);\n }\n if (!options.uri && !options.html && Platform.OS === 'ios' && !options.markupFormatterIOS) {\n throw new Error('Must provide either `html` or `uri` to print');\n }\n if (options.uri && options.html) {\n throw new Error('Must provide exactly one of `html` and `uri` but both were specified');\n }\n if (options.markupFormatterIOS !== undefined) {\n console.warn('The markupFormatterIOS option is deprecated. Use useMarkupFormatter instead.');\n }\n return await ExponentPrint.print(options);\n}\n\n// @needsAudit\n/**\n * Chooses a printer that can be later used in `printAsync`\n * @return A promise which fulfils with an object containing `name` and `url` of the selected printer.\n * @platform ios\n */\nexport async function selectPrinterAsync(): Promise<Printer> {\n if (ExponentPrint.selectPrinter) {\n return await ExponentPrint.selectPrinter();\n }\n\n throw new UnavailabilityError('Print', 'selectPrinterAsync');\n}\n\n// @needsAudit\n/**\n * Prints HTML to PDF file and saves it to [app's cache directory](./filesystem/#filesystemcachedirectory).\n * On Web this method opens the print dialog.\n * @param options A map of print options.\n */\nexport async function printToFileAsync(options: FilePrintOptions = {}): Promise<FilePrintResult> {\n return await ExponentPrint.printToFileAsync(options);\n}\n"]}
|
package/build/Print.types.d.ts
CHANGED
|
@@ -2,11 +2,14 @@ export declare type PrintOptions = {
|
|
|
2
2
|
/**
|
|
3
3
|
* URI of a PDF file to print. Remote, local (ex. selected via `DocumentPicker`) or base64 data URI
|
|
4
4
|
* starting with `data:application/pdf;base64,`. This only supports PDF, not other types of
|
|
5
|
-
* document (e.g. images).
|
|
5
|
+
* document (e.g. images).
|
|
6
|
+
* @platform ios
|
|
6
7
|
*/
|
|
7
8
|
uri?: string;
|
|
8
9
|
/**
|
|
9
|
-
* HTML string to print.
|
|
10
|
+
* HTML string to print.
|
|
11
|
+
* @platform android
|
|
12
|
+
* @platform ios
|
|
10
13
|
*/
|
|
11
14
|
html?: string;
|
|
12
15
|
/**
|
|
@@ -20,27 +23,32 @@ export declare type PrintOptions = {
|
|
|
20
23
|
*/
|
|
21
24
|
height?: number;
|
|
22
25
|
/**
|
|
23
|
-
* URL of the printer to use. Returned from `selectPrinterAsync`.
|
|
26
|
+
* URL of the printer to use. Returned from `selectPrinterAsync`.
|
|
27
|
+
* @platform ios
|
|
24
28
|
*/
|
|
25
29
|
printerUrl?: string;
|
|
26
30
|
/**
|
|
27
|
-
*
|
|
31
|
+
* Alternative to default option that uses [UIMarkupTextPrintFormatter](https://developer.apple.com/documentation/uikit/uimarkuptextprintformatter)
|
|
28
32
|
* instead of WebView, but it doesn't display images.
|
|
33
|
+
* @platform ios
|
|
29
34
|
*/
|
|
30
35
|
useMarkupFormatter?: boolean;
|
|
31
36
|
/**
|
|
32
37
|
* @deprecated
|
|
33
|
-
*
|
|
38
|
+
* This argument is deprecated, use `useMarkupFormatter` instead.
|
|
34
39
|
* Might be removed in the future releases.
|
|
40
|
+
* @platform ios
|
|
35
41
|
*/
|
|
36
42
|
markupFormatterIOS?: string;
|
|
37
43
|
/**
|
|
38
|
-
*
|
|
44
|
+
* The orientation of the printed content, `Print.Orientation.portrait`
|
|
39
45
|
* or `Print.Orientation.landscape`.
|
|
46
|
+
* @platform ios
|
|
40
47
|
*/
|
|
41
48
|
orientation?: OrientationType['portrait'] | OrientationType['landscape'];
|
|
42
49
|
/**
|
|
43
|
-
*
|
|
50
|
+
* Page margins for the printed document.
|
|
51
|
+
* @platform ios
|
|
44
52
|
*/
|
|
45
53
|
margins?: PageMargins;
|
|
46
54
|
};
|
|
@@ -73,8 +81,9 @@ export declare type FilePrintOptions = {
|
|
|
73
81
|
*/
|
|
74
82
|
html?: string;
|
|
75
83
|
/**
|
|
76
|
-
*
|
|
84
|
+
* Alternative to default option that uses [UIMarkupTextPrintFormatter](https://developer.apple.com/documentation/uikit/uimarkuptextprintformatter)
|
|
77
85
|
* instead of WebView, but it doesn't display images.
|
|
86
|
+
* @platform ios
|
|
78
87
|
*/
|
|
79
88
|
useMarkupFormatter?: boolean;
|
|
80
89
|
/**
|
|
@@ -88,7 +97,8 @@ export declare type FilePrintOptions = {
|
|
|
88
97
|
*/
|
|
89
98
|
height?: number;
|
|
90
99
|
/**
|
|
91
|
-
*
|
|
100
|
+
* Page margins for the printed document.
|
|
101
|
+
* @platform ios
|
|
92
102
|
*/
|
|
93
103
|
margins?: PageMargins;
|
|
94
104
|
/**
|
|
@@ -111,3 +121,4 @@ export declare type FilePrintResult = {
|
|
|
111
121
|
*/
|
|
112
122
|
base64?: string;
|
|
113
123
|
};
|
|
124
|
+
//# sourceMappingURL=Print.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Print.types.d.ts","sourceRoot":"","sources":["../src/Print.types.ts"],"names":[],"mappings":"AACA,oBAAY,YAAY,GAAG;IACzB;;;;;OAKG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;;;;OAKG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;;OAIG;IACH,WAAW,CAAC,EAAE,eAAe,CAAC,UAAU,CAAC,GAAG,eAAe,CAAC,WAAW,CAAC,CAAC;IACzE;;;OAGG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;CACvB,CAAC;AAGF,oBAAY,OAAO,GAAG;IACpB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAGF;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAGD,oBAAY,WAAW,GAAG;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAGF,oBAAY,gBAAgB,GAAG;IAC7B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAGF,oBAAY,eAAe,GAAG;IAC5B;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC"}
|
package/build/Print.types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Print.types.js","sourceRoot":"","sources":["../src/Print.types.ts"],"names":[],"mappings":"","sourcesContent":["// @needsAudit\nexport type PrintOptions = {\n /**\n * URI of a PDF file to print. Remote, local (ex. selected via `DocumentPicker`) or base64 data URI\n * starting with `data:application/pdf;base64,`. This only supports PDF, not other types of\n * document (e.g. images)
|
|
1
|
+
{"version":3,"file":"Print.types.js","sourceRoot":"","sources":["../src/Print.types.ts"],"names":[],"mappings":"","sourcesContent":["// @needsAudit\nexport type PrintOptions = {\n /**\n * URI of a PDF file to print. Remote, local (ex. selected via `DocumentPicker`) or base64 data URI\n * starting with `data:application/pdf;base64,`. This only supports PDF, not other types of\n * document (e.g. images).\n * @platform ios\n */\n uri?: string;\n /**\n * HTML string to print.\n * @platform android\n * @platform ios\n */\n html?: string;\n /**\n * Width of the single page in pixels. Defaults to `612` which is a width of US Letter paper\n * format with 72 PPI. **Available only with `html` option.**\n */\n width?: number;\n /**\n * Height of the single page in pixels. Defaults to `792` which is a height of US Letter paper\n * format with 72 PPI. **Available only with `html` option.**\n */\n height?: number;\n /**\n * URL of the printer to use. Returned from `selectPrinterAsync`.\n * @platform ios\n */\n printerUrl?: string;\n /**\n * Alternative to default option that uses [UIMarkupTextPrintFormatter](https://developer.apple.com/documentation/uikit/uimarkuptextprintformatter)\n * instead of WebView, but it doesn't display images.\n * @platform ios\n */\n useMarkupFormatter?: boolean;\n /**\n * @deprecated\n * This argument is deprecated, use `useMarkupFormatter` instead.\n * Might be removed in the future releases.\n * @platform ios\n */\n markupFormatterIOS?: string;\n /**\n * The orientation of the printed content, `Print.Orientation.portrait`\n * or `Print.Orientation.landscape`.\n * @platform ios\n */\n orientation?: OrientationType['portrait'] | OrientationType['landscape'];\n /**\n * Page margins for the printed document.\n * @platform ios\n */\n margins?: PageMargins;\n};\n\n// @needsAudit\nexport type Printer = {\n /**\n * Name of the printer.\n */\n name: string;\n /**\n * URL of the printer.\n */\n url: string;\n};\n\n// @needsAudit\n/**\n * The possible values of orientation for the printed content.\n */\nexport interface OrientationType {\n portrait: string;\n landscape: string;\n}\n\n// @needsAudit\nexport type PageMargins = {\n top: number;\n right: number;\n bottom: number;\n left: number;\n};\n\n// @docsMissing\nexport type FilePrintOptions = {\n /**\n * HTML string to print into PDF file.\n */\n html?: string;\n /**\n * Alternative to default option that uses [UIMarkupTextPrintFormatter](https://developer.apple.com/documentation/uikit/uimarkuptextprintformatter)\n * instead of WebView, but it doesn't display images.\n * @platform ios\n */\n useMarkupFormatter?: boolean;\n /**\n * Width of the single page in pixels. Defaults to `612` which is a width of US Letter paper\n * format with 72 PPI.\n */\n width?: number;\n /**\n * Height of the single page in pixels. Defaults to `792` which is a height of US Letter paper\n * format with 72 PPI.\n */\n height?: number;\n /**\n * Page margins for the printed document.\n * @platform ios\n */\n margins?: PageMargins;\n /**\n * Whether to include base64 encoded string of the file in the returned object.\n */\n base64?: boolean;\n};\n\n// @needsAudit\nexport type FilePrintResult = {\n /**\n * A URI to the printed PDF file.\n */\n uri: string;\n /**\n * Number of pages that were needed to render given content.\n */\n numberOfPages: number;\n /**\n * Base64 encoded string containing the data of the PDF file. **Available only if `base64`\n * option is truthy**. It doesn't include data URI prefix `data:application/pdf;base64,`.\n */\n base64?: string;\n};\n"]}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-print",
|
|
3
|
-
"version": "11.0
|
|
3
|
+
"version": "11.2.0",
|
|
4
4
|
"description": "Provides an API for iOS (AirPrint) and Android printing functionality.",
|
|
5
5
|
"main": "build/Print.js",
|
|
6
6
|
"types": "build/Print.d.ts",
|
|
@@ -31,13 +31,14 @@
|
|
|
31
31
|
"license": "MIT",
|
|
32
32
|
"homepage": "https://docs.expo.dev/versions/latest/sdk/print/",
|
|
33
33
|
"jest": {
|
|
34
|
-
"preset": "expo-module-scripts
|
|
35
|
-
},
|
|
36
|
-
"dependencies": {
|
|
37
|
-
"expo-modules-core": "~0.4.7"
|
|
34
|
+
"preset": "expo-module-scripts"
|
|
38
35
|
},
|
|
36
|
+
"dependencies": {},
|
|
39
37
|
"devDependencies": {
|
|
40
38
|
"expo-module-scripts": "^2.0.0"
|
|
41
39
|
},
|
|
42
|
-
"
|
|
40
|
+
"peerDependencies": {
|
|
41
|
+
"expo": "*"
|
|
42
|
+
},
|
|
43
|
+
"gitHead": "22dce752354bb429c84851bc4389abe47a766b1f"
|
|
43
44
|
}
|
package/src/Print.ts
CHANGED
|
@@ -45,8 +45,9 @@ export async function printAsync(options: PrintOptions): Promise<void> {
|
|
|
45
45
|
|
|
46
46
|
// @needsAudit
|
|
47
47
|
/**
|
|
48
|
-
*
|
|
48
|
+
* Chooses a printer that can be later used in `printAsync`
|
|
49
49
|
* @return A promise which fulfils with an object containing `name` and `url` of the selected printer.
|
|
50
|
+
* @platform ios
|
|
50
51
|
*/
|
|
51
52
|
export async function selectPrinterAsync(): Promise<Printer> {
|
|
52
53
|
if (ExponentPrint.selectPrinter) {
|
package/src/Print.types.ts
CHANGED
|
@@ -3,11 +3,14 @@ export type PrintOptions = {
|
|
|
3
3
|
/**
|
|
4
4
|
* URI of a PDF file to print. Remote, local (ex. selected via `DocumentPicker`) or base64 data URI
|
|
5
5
|
* starting with `data:application/pdf;base64,`. This only supports PDF, not other types of
|
|
6
|
-
* document (e.g. images).
|
|
6
|
+
* document (e.g. images).
|
|
7
|
+
* @platform ios
|
|
7
8
|
*/
|
|
8
9
|
uri?: string;
|
|
9
10
|
/**
|
|
10
|
-
* HTML string to print.
|
|
11
|
+
* HTML string to print.
|
|
12
|
+
* @platform android
|
|
13
|
+
* @platform ios
|
|
11
14
|
*/
|
|
12
15
|
html?: string;
|
|
13
16
|
/**
|
|
@@ -21,27 +24,32 @@ export type PrintOptions = {
|
|
|
21
24
|
*/
|
|
22
25
|
height?: number;
|
|
23
26
|
/**
|
|
24
|
-
* URL of the printer to use. Returned from `selectPrinterAsync`.
|
|
27
|
+
* URL of the printer to use. Returned from `selectPrinterAsync`.
|
|
28
|
+
* @platform ios
|
|
25
29
|
*/
|
|
26
30
|
printerUrl?: string;
|
|
27
31
|
/**
|
|
28
|
-
*
|
|
32
|
+
* Alternative to default option that uses [UIMarkupTextPrintFormatter](https://developer.apple.com/documentation/uikit/uimarkuptextprintformatter)
|
|
29
33
|
* instead of WebView, but it doesn't display images.
|
|
34
|
+
* @platform ios
|
|
30
35
|
*/
|
|
31
36
|
useMarkupFormatter?: boolean;
|
|
32
37
|
/**
|
|
33
38
|
* @deprecated
|
|
34
|
-
*
|
|
39
|
+
* This argument is deprecated, use `useMarkupFormatter` instead.
|
|
35
40
|
* Might be removed in the future releases.
|
|
41
|
+
* @platform ios
|
|
36
42
|
*/
|
|
37
43
|
markupFormatterIOS?: string;
|
|
38
44
|
/**
|
|
39
|
-
*
|
|
45
|
+
* The orientation of the printed content, `Print.Orientation.portrait`
|
|
40
46
|
* or `Print.Orientation.landscape`.
|
|
47
|
+
* @platform ios
|
|
41
48
|
*/
|
|
42
49
|
orientation?: OrientationType['portrait'] | OrientationType['landscape'];
|
|
43
50
|
/**
|
|
44
|
-
*
|
|
51
|
+
* Page margins for the printed document.
|
|
52
|
+
* @platform ios
|
|
45
53
|
*/
|
|
46
54
|
margins?: PageMargins;
|
|
47
55
|
};
|
|
@@ -82,8 +90,9 @@ export type FilePrintOptions = {
|
|
|
82
90
|
*/
|
|
83
91
|
html?: string;
|
|
84
92
|
/**
|
|
85
|
-
*
|
|
93
|
+
* Alternative to default option that uses [UIMarkupTextPrintFormatter](https://developer.apple.com/documentation/uikit/uimarkuptextprintformatter)
|
|
86
94
|
* instead of WebView, but it doesn't display images.
|
|
95
|
+
* @platform ios
|
|
87
96
|
*/
|
|
88
97
|
useMarkupFormatter?: boolean;
|
|
89
98
|
/**
|
|
@@ -97,7 +106,8 @@ export type FilePrintOptions = {
|
|
|
97
106
|
*/
|
|
98
107
|
height?: number;
|
|
99
108
|
/**
|
|
100
|
-
*
|
|
109
|
+
* Page margins for the printed document.
|
|
110
|
+
* @platform ios
|
|
101
111
|
*/
|
|
102
112
|
margins?: PageMargins;
|
|
103
113
|
/**
|