polotno-node 2.1.0 → 2.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/README.md +76 -7
- package/dist/{client.7c21efff.js → client.3517c032.js} +54 -46
- package/dist/client.html +1 -1
- package/instance.js +16 -1
- package/package.json +6 -6
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.3517c032.js"></script> </body></html>
|
package/instance.js
CHANGED
|
@@ -7,11 +7,16 @@ module.exports.createPage = async (browser, url) => {
|
|
|
7
7
|
await page.setUserAgent('Chrome Headless');
|
|
8
8
|
|
|
9
9
|
page.on('console', (msg) => {
|
|
10
|
-
msg.args().forEach((message) => {
|
|
10
|
+
msg.args().forEach(async (message) => {
|
|
11
11
|
// skip style information
|
|
12
12
|
if (message.toString().indexOf('margin') >= 0) {
|
|
13
13
|
return;
|
|
14
14
|
}
|
|
15
|
+
// const val = await arg.jsonValue();
|
|
16
|
+
// const { type, subtype, description } = arg._remoteObject;
|
|
17
|
+
// console.log(
|
|
18
|
+
// `type: ${type}, subtype: ${subtype}, description:\n ${description}`
|
|
19
|
+
// );
|
|
15
20
|
const text = message
|
|
16
21
|
.toString()
|
|
17
22
|
.replace('JSHandle:', '')
|
|
@@ -19,6 +24,9 @@ module.exports.createPage = async (browser, url) => {
|
|
|
19
24
|
console.log(text);
|
|
20
25
|
});
|
|
21
26
|
});
|
|
27
|
+
page.on('pageerror', (msg) => {
|
|
28
|
+
console.error(msg);
|
|
29
|
+
});
|
|
22
30
|
await page.goto(url);
|
|
23
31
|
return page;
|
|
24
32
|
};
|
|
@@ -89,6 +97,13 @@ module.exports.createInstance = async ({
|
|
|
89
97
|
}
|
|
90
98
|
}, args[1].assetLoadTimeout);
|
|
91
99
|
}
|
|
100
|
+
if (args[1]?.htmlTextRenderEnabled) {
|
|
101
|
+
await page.evaluate(() => {
|
|
102
|
+
if (window.config && window.config.unstable_useHtmlTextRender) {
|
|
103
|
+
window.config.unstable_useHtmlTextRender(true);
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
}
|
|
92
107
|
await page.evaluate(() => {
|
|
93
108
|
if (window.config?.onLoadError) {
|
|
94
109
|
window.config.onLoadError((error) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "polotno-node",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "Polotno workflow from NodeJS",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"README.md"
|
|
16
16
|
],
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"ava": "^5.3.
|
|
18
|
+
"ava": "^5.3.1",
|
|
19
19
|
"axios": "^1.4.0",
|
|
20
20
|
"canvas": "^2.11.2",
|
|
21
21
|
"fluent-ffmpeg": "^2.1.2",
|
|
@@ -23,16 +23,16 @@
|
|
|
23
23
|
"parcel-bundler": "^1.12.4",
|
|
24
24
|
"pixelmatch": "^5.3.0",
|
|
25
25
|
"pngjs": "^7.0.0",
|
|
26
|
-
"polotno": "^1.9.
|
|
26
|
+
"polotno": "^1.9.8",
|
|
27
27
|
"react": "^18.2.0",
|
|
28
28
|
"react-dom": "^18.2.0"
|
|
29
29
|
},
|
|
30
30
|
"author": "Anton Lavrenov",
|
|
31
31
|
"license": "MIT",
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@sparticuz/chromium": "
|
|
34
|
-
"puppeteer": "^20.
|
|
35
|
-
"puppeteer-core": "^20.
|
|
33
|
+
"@sparticuz/chromium": "114.0.0",
|
|
34
|
+
"puppeteer": "^20.7.2",
|
|
35
|
+
"puppeteer-core": "^20.7.2"
|
|
36
36
|
},
|
|
37
37
|
"bugs": {
|
|
38
38
|
"url": "https://github.com/polotno-project/polotno-node/issues"
|