polotno-node 2.0.3 → 2.0.5
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/dist/client.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<html><head><title>Canvas editor</title><style>body{padding:0;margin:0}</style><meta name="viewport" content="width=device-width, initial-scale=1"></head><body class="bp3-dark"> <div id="root"></div> <script src="client.
|
|
1
|
+
<html><head><title>Canvas editor</title><style>body{padding:0;margin:0}</style><meta name="viewport" content="width=device-width, initial-scale=1"></head><body class="bp3-dark"> <div id="root"></div> <script src="client.b8d33380.js"></script> </body></html>
|
package/instance.js
CHANGED
|
@@ -19,7 +19,6 @@ module.exports.createPage = async (browser, url) => {
|
|
|
19
19
|
});
|
|
20
20
|
|
|
21
21
|
await page.goto(url);
|
|
22
|
-
|
|
23
22
|
return page;
|
|
24
23
|
};
|
|
25
24
|
|
|
@@ -84,12 +83,12 @@ module.exports.createInstance = async ({
|
|
|
84
83
|
try {
|
|
85
84
|
const result = await page.evaluate(func, ...args);
|
|
86
85
|
if (useParallelPages) {
|
|
87
|
-
page.close();
|
|
86
|
+
await page.close();
|
|
88
87
|
}
|
|
89
88
|
return result;
|
|
90
89
|
} catch (e) {
|
|
91
90
|
if (useParallelPages) {
|
|
92
|
-
page.close();
|
|
91
|
+
await page.close();
|
|
93
92
|
}
|
|
94
93
|
throw e;
|
|
95
94
|
}
|
|
@@ -144,7 +143,9 @@ module.exports.createInstance = async ({
|
|
|
144
143
|
};
|
|
145
144
|
|
|
146
145
|
return {
|
|
147
|
-
close: async () =>
|
|
146
|
+
close: async () => {
|
|
147
|
+
await browser.close();
|
|
148
|
+
},
|
|
148
149
|
firstPage,
|
|
149
150
|
browser,
|
|
150
151
|
run,
|
|
@@ -153,5 +154,6 @@ module.exports.createInstance = async ({
|
|
|
153
154
|
jsonToPDFDataURL,
|
|
154
155
|
jsonToPDFBase64,
|
|
155
156
|
jsonToBlob,
|
|
157
|
+
createPage: async () => await module.exports.createPage(browser, visitPage),
|
|
156
158
|
};
|
|
157
159
|
};
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "polotno-node",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.5",
|
|
4
4
|
"description": "Polotno workflow from NodeJS",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
8
|
-
"build": "rm -rf ./dist && parcel build ./client.html --public-url ./ && rm ./dist/*js.map
|
|
8
|
+
"build": "rm -rf ./dist && parcel build ./client.html --public-url ./ && rm ./dist/*js.map",
|
|
9
|
+
"dev": "parcel ./client.html"
|
|
9
10
|
},
|
|
10
11
|
"files": [
|
|
11
12
|
"dist",
|
|
@@ -15,15 +16,19 @@
|
|
|
15
16
|
],
|
|
16
17
|
"devDependencies": {
|
|
17
18
|
"parcel-bundler": "^1.12.4",
|
|
18
|
-
"polotno": "^1.
|
|
19
|
+
"polotno": "^1.8.3",
|
|
19
20
|
"react": "^18.2.0",
|
|
20
21
|
"react-dom": "^18.2.0"
|
|
21
22
|
},
|
|
22
23
|
"author": "Anton Lavrenov",
|
|
23
24
|
"license": "MIT",
|
|
24
25
|
"dependencies": {
|
|
26
|
+
"axios": "^1.3.4",
|
|
27
|
+
"canvas": "^2.11.0",
|
|
25
28
|
"chrome-aws-lambda": "^10.1.0",
|
|
26
|
-
"
|
|
29
|
+
"fluent-ffmpeg": "^2.1.2",
|
|
30
|
+
"gifencoder": "^2.0.1",
|
|
31
|
+
"puppeteer": "^19.7.5"
|
|
27
32
|
},
|
|
28
33
|
"bugs": {
|
|
29
34
|
"url": "https://github.com/polotno-project/polotno-node/issues"
|