expo-print 14.0.0 → 14.0.1
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 +4 -0
- package/android/build.gradle +2 -2
- package/build/Print.d.ts +2 -2
- package/build/Print.d.ts.map +1 -1
- package/build/Print.js.map +1 -1
- package/package.json +2 -2
- package/src/Print.ts +2 -1
package/CHANGELOG.md
CHANGED
package/android/build.gradle
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
apply plugin: 'com.android.library'
|
|
2
2
|
|
|
3
3
|
group = 'host.exp.exponent'
|
|
4
|
-
version = '14.0.
|
|
4
|
+
version = '14.0.1'
|
|
5
5
|
|
|
6
6
|
def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
|
|
7
7
|
apply from: expoModulesCorePlugin
|
|
@@ -14,6 +14,6 @@ android {
|
|
|
14
14
|
namespace "expo.modules.print"
|
|
15
15
|
defaultConfig {
|
|
16
16
|
versionCode 27
|
|
17
|
-
versionName "14.0.
|
|
17
|
+
versionName "14.0.1"
|
|
18
18
|
}
|
|
19
19
|
}
|
package/build/Print.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FilePrintOptions, FilePrintResult, OrientationType, PrintOptions, Printer } from './Print.types';
|
|
2
|
-
export { FilePrintOptions, FilePrintResult, OrientationType, PrintOptions, Printer };
|
|
1
|
+
import { FilePrintOptions, FilePrintResult, OrientationType, PageMargins, PrintOptions, Printer } from './Print.types';
|
|
2
|
+
export { FilePrintOptions, FilePrintResult, OrientationType, PageMargins, PrintOptions, Printer };
|
|
3
3
|
/**
|
|
4
4
|
* The orientation of the printed content.
|
|
5
5
|
*/
|
package/build/Print.d.ts.map
CHANGED
|
@@ -1 +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;
|
|
1
|
+
{"version":3,"file":"Print.d.ts","sourceRoot":"","sources":["../src/Print.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,WAAW,EACX,YAAY,EACZ,OAAO,EACR,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,eAAe,EAAE,WAAW,EAAE,YAAY,EAAE,OAAO,EAAE,CAAC;AAIlG;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,eAA2C,CAAC;AAGtE;;;;;;;;;;;;GAYG;AACH,wBAAsB,UAAU,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAuBrE;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.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;
|
|
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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/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 PageMargins,\n PrintOptions,\n Printer,\n} from './Print.types';\n\nexport { FilePrintOptions, FilePrintResult, OrientationType, PageMargins, PrintOptions, Printer };\n\nlet isPrinting = false;\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 *\n * > Note: on iOS, when printing without providing a `PrintOptions.printerUrl` the `Promise` will be\n * > resolved once printing is started in the native print window and rejected if the window is closed without\n * > starting the print. On Android the `Promise` will be resolved immediately after displaying the native print window\n * > and won't be rejected if the window is closed without starting the print.\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 if (isPrinting) {\n throw new Error('Another print request is already in progress');\n }\n\n isPrinting = true;\n try {\n return await ExponentPrint.print(options);\n } finally {\n isPrinting = false;\n }\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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-print",
|
|
3
|
-
"version": "14.0.
|
|
3
|
+
"version": "14.0.1",
|
|
4
4
|
"description": "Provides an API for Android and iOS (AirPrint) printing functionality.",
|
|
5
5
|
"main": "build/Print.js",
|
|
6
6
|
"types": "build/Print.d.ts",
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"expo": "*",
|
|
45
45
|
"react-native": "*"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "5ad642a63afa9190ceb4e57dd52c8bdf71d93dd8"
|
|
48
48
|
}
|
package/src/Print.ts
CHANGED
|
@@ -6,11 +6,12 @@ import {
|
|
|
6
6
|
FilePrintOptions,
|
|
7
7
|
FilePrintResult,
|
|
8
8
|
OrientationType,
|
|
9
|
+
PageMargins,
|
|
9
10
|
PrintOptions,
|
|
10
11
|
Printer,
|
|
11
12
|
} from './Print.types';
|
|
12
13
|
|
|
13
|
-
export { FilePrintOptions, FilePrintResult, OrientationType, PrintOptions, Printer };
|
|
14
|
+
export { FilePrintOptions, FilePrintResult, OrientationType, PageMargins, PrintOptions, Printer };
|
|
14
15
|
|
|
15
16
|
let isPrinting = false;
|
|
16
17
|
// @needsAudit @docsMissing
|