@azuro-org/images-generator 1.3.3 → 1.3.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/index.es.js +3 -3
- package/dist/templates/trendle-trading/images/crash.png +0 -0
- package/dist/templates/trendle-trading/images/drake.png +0 -0
- package/dist/templates/trendle-trading/images/elon.png +0 -0
- package/dist/templates/trendle-trading/images/lewis.png +0 -0
- package/dist/templates/trendle-trading/images/mark.png +0 -0
- package/dist/templates/trendle-trading/images/obama.png +0 -0
- package/dist/templates/trendle-trading/images/sydney.png +0 -0
- package/dist/templates/trendle-trading/images/tramp.png +0 -0
- package/dist/templates/trendle-trading/index.html +1 -1
- package/dist/templates/trendle-trading/index.js +3 -5
- package/lib/index.js +3 -3
- package/lib/templates/trendle-trading/images/crash.png +0 -0
- package/lib/templates/trendle-trading/images/drake.png +0 -0
- package/lib/templates/trendle-trading/images/elon.png +0 -0
- package/lib/templates/trendle-trading/images/lewis.png +0 -0
- package/lib/templates/trendle-trading/images/mark.png +0 -0
- package/lib/templates/trendle-trading/images/obama.png +0 -0
- package/lib/templates/trendle-trading/images/sydney.png +0 -0
- package/lib/templates/trendle-trading/images/tramp.png +0 -0
- package/lib/templates/trendle-trading/index.html +1 -1
- package/lib/templates/trendle-trading/index.js +3 -5
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -65,6 +65,7 @@ function __generator(thisArg, body) {
|
|
|
65
65
|
devtools: false,
|
|
66
66
|
args: [
|
|
67
67
|
'--no-sandbox',
|
|
68
|
+
'--disable-setuid-sandbox',
|
|
68
69
|
'--disable-gpu',
|
|
69
70
|
'--disable-accelerated-video-decode',
|
|
70
71
|
// '--allow-file-access-from-files',
|
|
@@ -79,6 +80,7 @@ function __generator(thisArg, body) {
|
|
|
79
80
|
return [4 /*yield*/, browser.newPage()];
|
|
80
81
|
case 3:
|
|
81
82
|
page = _d.sent();
|
|
83
|
+
page.setDefaultNavigationTimeout(0);
|
|
82
84
|
return [4 /*yield*/, page.setViewport({
|
|
83
85
|
width: width,
|
|
84
86
|
height: height,
|
|
@@ -86,9 +88,7 @@ function __generator(thisArg, body) {
|
|
|
86
88
|
})];
|
|
87
89
|
case 4:
|
|
88
90
|
_d.sent();
|
|
89
|
-
return [4 /*yield*/, page.
|
|
90
|
-
waitUntil: 'networkidle0',
|
|
91
|
-
})];
|
|
91
|
+
return [4 /*yield*/, page.setContent(html, { waitUntil: 'domcontentloaded' })];
|
|
92
92
|
case 5:
|
|
93
93
|
_d.sent();
|
|
94
94
|
return [4 /*yield*/, page.$('body')
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import {_ as __awaiter,a as __generator,g as getFile,b as getBase64Image,d as downloadImage}from'../../index-82868da9.js';import path from'path';import'fs';import'util';import'stream';import'http';import'https';import'url';import'crypto';import'assert';import'tty';import'zlib';import'events';var cardTypes = {
|
|
2
2
|
'profit': {
|
|
3
3
|
rightImg: 'images/profit.png',
|
|
4
|
-
arrow: 'images/arrow-up.png',
|
|
5
4
|
bgColor: '#72FF4B',
|
|
6
5
|
},
|
|
7
6
|
'loss': {
|
|
8
7
|
rightImg: 'images/loss.png',
|
|
9
|
-
arrow: 'images/arrow-down.png',
|
|
10
8
|
bgColor: '#FF604B',
|
|
11
9
|
}
|
|
12
10
|
};
|
|
@@ -15,20 +13,20 @@ var template = {
|
|
|
15
13
|
height: 445,
|
|
16
14
|
type: 'jpeg',
|
|
17
15
|
html: function (props) { return __awaiter(void 0, void 0, void 0, function () {
|
|
18
|
-
var type, trend, pnl, position, referralUrl, isProfit, _a, rightImg,
|
|
16
|
+
var type, trend, pnl, position, referralUrl, isProfit, _a, rightImg, bgColor, leverage, isLong, html, logo, bgImage, rightImage, personImage, arrowImage, trendImage, positionInfo;
|
|
19
17
|
return __generator(this, function (_b) {
|
|
20
18
|
switch (_b.label) {
|
|
21
19
|
case 0:
|
|
22
20
|
type = props.type, trend = props.trend, pnl = props.pnl, position = props.position, referralUrl = props.referralUrl;
|
|
23
21
|
isProfit = pnl > 0;
|
|
24
|
-
_a = isProfit ? cardTypes.profit : cardTypes.loss, rightImg = _a.rightImg,
|
|
22
|
+
_a = isProfit ? cardTypes.profit : cardTypes.loss, rightImg = _a.rightImg, bgColor = _a.bgColor;
|
|
25
23
|
leverage = position.leverage, isLong = position.isLong;
|
|
26
24
|
html = getFile(path.join(__dirname, 'index.html'));
|
|
27
25
|
logo = getBase64Image(path.resolve(__dirname, 'images/logo.png'));
|
|
28
26
|
bgImage = getBase64Image(path.resolve(__dirname, 'images/bg.png'));
|
|
29
27
|
rightImage = getBase64Image(path.resolve(__dirname, rightImg));
|
|
30
28
|
personImage = getBase64Image(path.resolve(__dirname, "images/".concat(type, ".png")));
|
|
31
|
-
arrowImage = getBase64Image(path.resolve(__dirname, arrow));
|
|
29
|
+
arrowImage = getBase64Image(path.resolve(__dirname, isLong ? 'images/arrow-up.png' : 'images/arrow-down.png'));
|
|
32
30
|
return [4 /*yield*/, downloadImage(trend.image)];
|
|
33
31
|
case 1:
|
|
34
32
|
trendImage = _b.sent();
|
package/lib/index.js
CHANGED
|
@@ -65,6 +65,7 @@ function __generator(thisArg, body) {
|
|
|
65
65
|
devtools: false,
|
|
66
66
|
args: [
|
|
67
67
|
'--no-sandbox',
|
|
68
|
+
'--disable-setuid-sandbox',
|
|
68
69
|
'--disable-gpu',
|
|
69
70
|
'--disable-accelerated-video-decode',
|
|
70
71
|
// '--allow-file-access-from-files',
|
|
@@ -79,6 +80,7 @@ function __generator(thisArg, body) {
|
|
|
79
80
|
return [4 /*yield*/, browser.newPage()];
|
|
80
81
|
case 3:
|
|
81
82
|
page = _d.sent();
|
|
83
|
+
page.setDefaultNavigationTimeout(0);
|
|
82
84
|
return [4 /*yield*/, page.setViewport({
|
|
83
85
|
width: width,
|
|
84
86
|
height: height,
|
|
@@ -86,9 +88,7 @@ function __generator(thisArg, body) {
|
|
|
86
88
|
})];
|
|
87
89
|
case 4:
|
|
88
90
|
_d.sent();
|
|
89
|
-
return [4 /*yield*/, page.
|
|
90
|
-
waitUntil: 'networkidle0',
|
|
91
|
-
})];
|
|
91
|
+
return [4 /*yield*/, page.setContent(html, { waitUntil: 'domcontentloaded' })];
|
|
92
92
|
case 5:
|
|
93
93
|
_d.sent();
|
|
94
94
|
return [4 /*yield*/, page.$('body')
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
'use strict';var index=require('../../index-de0b52f4.js'),path=require('path');require('fs'),require('util'),require('stream'),require('http'),require('https'),require('url'),require('crypto'),require('assert'),require('tty'),require('zlib'),require('events');function _interopDefaultLegacy(e){return e&&typeof e==='object'&&'default'in e?e:{'default':e}}var path__default=/*#__PURE__*/_interopDefaultLegacy(path);var cardTypes = {
|
|
2
2
|
'profit': {
|
|
3
3
|
rightImg: 'images/profit.png',
|
|
4
|
-
arrow: 'images/arrow-up.png',
|
|
5
4
|
bgColor: '#72FF4B',
|
|
6
5
|
},
|
|
7
6
|
'loss': {
|
|
8
7
|
rightImg: 'images/loss.png',
|
|
9
|
-
arrow: 'images/arrow-down.png',
|
|
10
8
|
bgColor: '#FF604B',
|
|
11
9
|
}
|
|
12
10
|
};
|
|
@@ -15,20 +13,20 @@ var template = {
|
|
|
15
13
|
height: 445,
|
|
16
14
|
type: 'jpeg',
|
|
17
15
|
html: function (props) { return index._(void 0, void 0, void 0, function () {
|
|
18
|
-
var type, trend, pnl, position, referralUrl, isProfit, _a, rightImg,
|
|
16
|
+
var type, trend, pnl, position, referralUrl, isProfit, _a, rightImg, bgColor, leverage, isLong, html, logo, bgImage, rightImage, personImage, arrowImage, trendImage, positionInfo;
|
|
19
17
|
return index.a(this, function (_b) {
|
|
20
18
|
switch (_b.label) {
|
|
21
19
|
case 0:
|
|
22
20
|
type = props.type, trend = props.trend, pnl = props.pnl, position = props.position, referralUrl = props.referralUrl;
|
|
23
21
|
isProfit = pnl > 0;
|
|
24
|
-
_a = isProfit ? cardTypes.profit : cardTypes.loss, rightImg = _a.rightImg,
|
|
22
|
+
_a = isProfit ? cardTypes.profit : cardTypes.loss, rightImg = _a.rightImg, bgColor = _a.bgColor;
|
|
25
23
|
leverage = position.leverage, isLong = position.isLong;
|
|
26
24
|
html = index.g(path__default["default"].join(__dirname, 'index.html'));
|
|
27
25
|
logo = index.b(path__default["default"].resolve(__dirname, 'images/logo.png'));
|
|
28
26
|
bgImage = index.b(path__default["default"].resolve(__dirname, 'images/bg.png'));
|
|
29
27
|
rightImage = index.b(path__default["default"].resolve(__dirname, rightImg));
|
|
30
28
|
personImage = index.b(path__default["default"].resolve(__dirname, "images/".concat(type, ".png")));
|
|
31
|
-
arrowImage = index.b(path__default["default"].resolve(__dirname, arrow));
|
|
29
|
+
arrowImage = index.b(path__default["default"].resolve(__dirname, isLong ? 'images/arrow-up.png' : 'images/arrow-down.png'));
|
|
32
30
|
return [4 /*yield*/, index.d(trend.image)];
|
|
33
31
|
case 1:
|
|
34
32
|
trendImage = _b.sent();
|