@driveflux/pdf 4.0.77 → 4.0.79
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/components/FluxLogo.js +3 -62
- package/dist/components/StandardPage.js +10 -108
- package/dist/index.js +1 -0
- package/dist/templates/QuotationPdf/CustomerSubscriptionSection.js +27 -145
- package/dist/templates/QuotationPdf/GFV.js +12 -49
- package/dist/templates/QuotationPdf/Header.js +5 -63
- package/dist/templates/QuotationPdf/Pricing.js +191 -573
- package/dist/templates/QuotationPdf/QuotationPdfPage.js +3 -23
- package/dist/templates/QuotationPdf/SectionBoxNew.js +4 -34
- package/dist/templates/QuotationPdf/TermsSection.js +5 -42
- package/dist/templates/QuotationPdf/VehiclePhotos.js +24 -54
- package/dist/templates/QuotationPdf/index.js +10 -197
- package/dist/templates/QuotationPdf/translations.js +22 -34
- package/dist/templates/QuotationPdf/utils.js +49 -92
- package/dist/templates/SubscriptionAgreement/Confirmation.js +10 -65
- package/dist/templates/SubscriptionAgreement/CoverPage.js +10 -93
- package/dist/templates/SubscriptionAgreement/CoverPageSection.js +5 -16
- package/dist/templates/SubscriptionAgreement/Details.js +59 -139
- package/dist/templates/SubscriptionAgreement/Footer.js +6 -48
- package/dist/templates/SubscriptionAgreement/Header.js +5 -35
- package/dist/templates/SubscriptionAgreement/LabelValue.js +3 -25
- package/dist/templates/SubscriptionAgreement/SubscriptionAgreementPage.js +3 -26
- package/dist/templates/SubscriptionAgreement/TermsOfUse.js +8 -94
- package/dist/templates/SubscriptionAgreement/TermsOfUseSubSection.js +11 -97
- package/dist/templates/SubscriptionAgreement/index.js +15 -253
- package/dist/templates/SubscriptionAgreement/translations.js +194 -195
- package/dist/templates/SubscriptionAgreement/types.js +2 -1
- package/dist/templates/SubscriptionAgreement/utils.js +11 -16
- package/dist/templates/index.js +1 -0
- package/dist/theme/colors.js +63 -44
- package/dist/theme/index.js +1 -0
- package/dist/types.js +2 -1
- package/dist/utils.js +16 -167
- package/dist/watch.js +4 -3
- package/package.json +10 -10
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {};
|
|
2
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -1,37 +1,32 @@
|
|
|
1
1
|
import { Text } from '@react-pdf/renderer';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
export const formatIdentification = (identification) => {
|
|
4
|
+
return identification?.type === 'id'
|
|
5
|
+
? `${identification?.number?.slice(0, 6)}-${identification?.number?.slice(6, 8)}-${identification?.number?.slice(8)}`
|
|
6
|
+
: identification?.number || '-';
|
|
6
7
|
};
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
return parts.map(
|
|
8
|
+
export const renderMarkdown = (text) => {
|
|
9
|
+
const parts = text.split(/(\*\*\*.*?\*\*\*|\*\*.*?\*\*|\*.*?\*)/g);
|
|
10
|
+
return parts.map((part, index) => {
|
|
10
11
|
if (part.startsWith('***') && part.endsWith('***')) {
|
|
11
12
|
return React.createElement(Text, {
|
|
12
13
|
key: index,
|
|
13
|
-
style: {
|
|
14
|
-
fontWeight: 'bold',
|
|
15
|
-
fontStyle: 'italic'
|
|
16
|
-
}
|
|
14
|
+
style: { fontWeight: 'bold', fontStyle: 'italic' },
|
|
17
15
|
}, part.slice(3, -3));
|
|
18
16
|
}
|
|
19
17
|
if (part.startsWith('**') && part.endsWith('**')) {
|
|
20
18
|
return React.createElement(Text, {
|
|
21
19
|
key: index,
|
|
22
|
-
style: {
|
|
23
|
-
fontWeight: 'bold'
|
|
24
|
-
}
|
|
20
|
+
style: { fontWeight: 'bold' },
|
|
25
21
|
}, part.slice(2, -2));
|
|
26
22
|
}
|
|
27
23
|
if (part.startsWith('*') && part.endsWith('*')) {
|
|
28
24
|
return React.createElement(Text, {
|
|
29
25
|
key: index,
|
|
30
|
-
style: {
|
|
31
|
-
fontStyle: 'italic'
|
|
32
|
-
}
|
|
26
|
+
style: { fontStyle: 'italic' },
|
|
33
27
|
}, part.slice(1, -1));
|
|
34
28
|
}
|
|
35
29
|
return part;
|
|
36
30
|
});
|
|
37
31
|
};
|
|
32
|
+
//# sourceMappingURL=utils.js.map
|
package/dist/templates/index.js
CHANGED
package/dist/theme/colors.js
CHANGED
|
@@ -1,61 +1,79 @@
|
|
|
1
1
|
// TODO sync this with the one in dump
|
|
2
2
|
// remove dump file version
|
|
3
3
|
// update all instances using colors
|
|
4
|
-
export
|
|
4
|
+
export const colors = {
|
|
5
5
|
/**
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
* #EFEFF0 Light Gray
|
|
7
|
+
*/
|
|
8
|
+
primary1: '#EFEFF0',
|
|
8
9
|
/**
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
* #CACACA Gray
|
|
11
|
+
*/
|
|
12
|
+
primary2: '#CACACA',
|
|
11
13
|
/**
|
|
12
|
-
|
|
13
|
-
|
|
14
|
+
* #585858 Dark Gray
|
|
15
|
+
*/
|
|
16
|
+
primary3: '#585858',
|
|
14
17
|
/**
|
|
15
|
-
|
|
16
|
-
|
|
18
|
+
* #191919 Soft Black
|
|
19
|
+
*/
|
|
20
|
+
primary4: '#191919',
|
|
17
21
|
/**
|
|
18
|
-
|
|
19
|
-
|
|
22
|
+
* #E55867 Red
|
|
23
|
+
*/
|
|
24
|
+
accent4: '#E55867',
|
|
20
25
|
/**
|
|
21
|
-
|
|
22
|
-
|
|
26
|
+
* #ADE0EE Light Blue
|
|
27
|
+
*/
|
|
28
|
+
links2: '#ADE0EE',
|
|
23
29
|
/**
|
|
24
|
-
|
|
25
|
-
|
|
30
|
+
* #50C8E8 Blue
|
|
31
|
+
*/
|
|
32
|
+
links: '#50C8E8',
|
|
26
33
|
/**
|
|
27
|
-
|
|
28
|
-
|
|
34
|
+
* #E24657 Red
|
|
35
|
+
*/
|
|
36
|
+
alert4: '#E24657',
|
|
29
37
|
/**
|
|
30
|
-
|
|
31
|
-
|
|
38
|
+
* #E24657 Red
|
|
39
|
+
*/
|
|
40
|
+
danger: '#E24657',
|
|
32
41
|
/**
|
|
33
|
-
|
|
34
|
-
|
|
42
|
+
* #F4B25C Yellow
|
|
43
|
+
*/
|
|
44
|
+
warning4: '#F4B25C',
|
|
35
45
|
/**
|
|
36
|
-
|
|
37
|
-
|
|
46
|
+
* #4FD9C2 Green
|
|
47
|
+
*/
|
|
48
|
+
success4: '#4FD9C2',
|
|
38
49
|
/**
|
|
39
|
-
|
|
40
|
-
|
|
50
|
+
* #4FD9C2 Green
|
|
51
|
+
*/
|
|
52
|
+
green: '#4FD9C2',
|
|
41
53
|
/**
|
|
42
|
-
|
|
43
|
-
|
|
54
|
+
* #3BD5BC Green
|
|
55
|
+
*/
|
|
56
|
+
// green: '#3BD5BC',
|
|
44
57
|
/**
|
|
45
|
-
|
|
46
|
-
|
|
58
|
+
* #000000 Black
|
|
59
|
+
*/
|
|
60
|
+
black: '#000000',
|
|
47
61
|
/**
|
|
48
|
-
|
|
49
|
-
|
|
62
|
+
* #ffffff White
|
|
63
|
+
*/
|
|
64
|
+
white: '#ffffff',
|
|
50
65
|
/**
|
|
51
|
-
|
|
52
|
-
|
|
66
|
+
* #E6E6E6 Light Gray
|
|
67
|
+
*/
|
|
68
|
+
whiteHover: '#E6E6E6',
|
|
53
69
|
/**
|
|
54
|
-
|
|
55
|
-
|
|
70
|
+
* #F4F4F4 Light Gray
|
|
71
|
+
*/
|
|
72
|
+
placeholder: '#F4F4F4',
|
|
56
73
|
/**
|
|
57
|
-
|
|
58
|
-
|
|
74
|
+
* #F9F7D7 Light Yellow
|
|
75
|
+
*/
|
|
76
|
+
highlight: '#F9F7D7',
|
|
59
77
|
primary: {
|
|
60
78
|
25: '#fafafa',
|
|
61
79
|
50: '#d6f5f0',
|
|
@@ -67,7 +85,7 @@ export var colors = {
|
|
|
67
85
|
600: '#000000',
|
|
68
86
|
700: '#000000',
|
|
69
87
|
800: '#000000',
|
|
70
|
-
900: '#000000'
|
|
88
|
+
900: '#000000',
|
|
71
89
|
},
|
|
72
90
|
// TODO add 25
|
|
73
91
|
success: {
|
|
@@ -80,7 +98,7 @@ export var colors = {
|
|
|
80
98
|
600: '#2EA692',
|
|
81
99
|
700: '#00825c',
|
|
82
100
|
800: '#00724d',
|
|
83
|
-
900: '#005530'
|
|
101
|
+
900: '#005530',
|
|
84
102
|
},
|
|
85
103
|
// TODO add 25
|
|
86
104
|
accent: {
|
|
@@ -93,7 +111,7 @@ export var colors = {
|
|
|
93
111
|
600: '#d8253f',
|
|
94
112
|
700: '#c61a38',
|
|
95
113
|
800: '#b91231',
|
|
96
|
-
900: '#aa0026'
|
|
114
|
+
900: '#aa0026',
|
|
97
115
|
},
|
|
98
116
|
// TODO add 25
|
|
99
117
|
warning: {
|
|
@@ -106,7 +124,7 @@ export var colors = {
|
|
|
106
124
|
600: '#BF7F2C',
|
|
107
125
|
700: '#F4B25C',
|
|
108
126
|
800: '#F4B25C',
|
|
109
|
-
900: '#F4B25C'
|
|
127
|
+
900: '#F4B25C',
|
|
110
128
|
},
|
|
111
129
|
info: {
|
|
112
130
|
25: '#50C8E81A',
|
|
@@ -119,7 +137,7 @@ export var colors = {
|
|
|
119
137
|
600: '#3EA5C0',
|
|
120
138
|
700: '#50C8E8',
|
|
121
139
|
800: '#50C8E8',
|
|
122
|
-
900: '#50C8E8'
|
|
140
|
+
900: '#50C8E8',
|
|
123
141
|
},
|
|
124
142
|
// TODO add 25
|
|
125
143
|
alert: {
|
|
@@ -132,6 +150,7 @@ export var colors = {
|
|
|
132
150
|
600: '#E24657',
|
|
133
151
|
700: '#E24657',
|
|
134
152
|
800: '#E24657',
|
|
135
|
-
900: '#E24657'
|
|
136
|
-
}
|
|
153
|
+
900: '#E24657',
|
|
154
|
+
},
|
|
137
155
|
};
|
|
156
|
+
//# sourceMappingURL=colors.js.map
|
package/dist/theme/index.js
CHANGED
package/dist/types.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {};
|
|
2
|
+
//# sourceMappingURL=types.js.map
|
package/dist/utils.js
CHANGED
|
@@ -1,175 +1,24 @@
|
|
|
1
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
2
|
-
try {
|
|
3
|
-
var info = gen[key](arg);
|
|
4
|
-
var value = info.value;
|
|
5
|
-
} catch (error) {
|
|
6
|
-
reject(error);
|
|
7
|
-
return;
|
|
8
|
-
}
|
|
9
|
-
if (info.done) {
|
|
10
|
-
resolve(value);
|
|
11
|
-
} else {
|
|
12
|
-
Promise.resolve(value).then(_next, _throw);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
function _async_to_generator(fn) {
|
|
16
|
-
return function() {
|
|
17
|
-
var self = this, args = arguments;
|
|
18
|
-
return new Promise(function(resolve, reject) {
|
|
19
|
-
var gen = fn.apply(self, args);
|
|
20
|
-
function _next(value) {
|
|
21
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
22
|
-
}
|
|
23
|
-
function _throw(err) {
|
|
24
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
25
|
-
}
|
|
26
|
-
_next(undefined);
|
|
27
|
-
});
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
function _ts_generator(thisArg, body) {
|
|
31
|
-
var f, y, t, _ = {
|
|
32
|
-
label: 0,
|
|
33
|
-
sent: function() {
|
|
34
|
-
if (t[0] & 1) throw t[1];
|
|
35
|
-
return t[1];
|
|
36
|
-
},
|
|
37
|
-
trys: [],
|
|
38
|
-
ops: []
|
|
39
|
-
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
|
|
40
|
-
return d(g, "next", {
|
|
41
|
-
value: verb(0)
|
|
42
|
-
}), d(g, "throw", {
|
|
43
|
-
value: verb(1)
|
|
44
|
-
}), d(g, "return", {
|
|
45
|
-
value: verb(2)
|
|
46
|
-
}), typeof Symbol === "function" && d(g, Symbol.iterator, {
|
|
47
|
-
value: function() {
|
|
48
|
-
return this;
|
|
49
|
-
}
|
|
50
|
-
}), g;
|
|
51
|
-
function verb(n) {
|
|
52
|
-
return function(v) {
|
|
53
|
-
return step([
|
|
54
|
-
n,
|
|
55
|
-
v
|
|
56
|
-
]);
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
function step(op) {
|
|
60
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
61
|
-
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
62
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
63
|
-
if (y = 0, t) op = [
|
|
64
|
-
op[0] & 2,
|
|
65
|
-
t.value
|
|
66
|
-
];
|
|
67
|
-
switch(op[0]){
|
|
68
|
-
case 0:
|
|
69
|
-
case 1:
|
|
70
|
-
t = op;
|
|
71
|
-
break;
|
|
72
|
-
case 4:
|
|
73
|
-
_.label++;
|
|
74
|
-
return {
|
|
75
|
-
value: op[1],
|
|
76
|
-
done: false
|
|
77
|
-
};
|
|
78
|
-
case 5:
|
|
79
|
-
_.label++;
|
|
80
|
-
y = op[1];
|
|
81
|
-
op = [
|
|
82
|
-
0
|
|
83
|
-
];
|
|
84
|
-
continue;
|
|
85
|
-
case 7:
|
|
86
|
-
op = _.ops.pop();
|
|
87
|
-
_.trys.pop();
|
|
88
|
-
continue;
|
|
89
|
-
default:
|
|
90
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
91
|
-
_ = 0;
|
|
92
|
-
continue;
|
|
93
|
-
}
|
|
94
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
95
|
-
_.label = op[1];
|
|
96
|
-
break;
|
|
97
|
-
}
|
|
98
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
99
|
-
_.label = t[1];
|
|
100
|
-
t = op;
|
|
101
|
-
break;
|
|
102
|
-
}
|
|
103
|
-
if (t && _.label < t[2]) {
|
|
104
|
-
_.label = t[2];
|
|
105
|
-
_.ops.push(op);
|
|
106
|
-
break;
|
|
107
|
-
}
|
|
108
|
-
if (t[2]) _.ops.pop();
|
|
109
|
-
_.trys.pop();
|
|
110
|
-
continue;
|
|
111
|
-
}
|
|
112
|
-
op = body.call(thisArg, _);
|
|
113
|
-
} catch (e) {
|
|
114
|
-
op = [
|
|
115
|
-
6,
|
|
116
|
-
e
|
|
117
|
-
];
|
|
118
|
-
y = 0;
|
|
119
|
-
} finally{
|
|
120
|
-
f = t = 0;
|
|
121
|
-
}
|
|
122
|
-
if (op[0] & 5) throw op[1];
|
|
123
|
-
return {
|
|
124
|
-
value: op[0] ? op[1] : void 0,
|
|
125
|
-
done: true
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
1
|
import ReactPDF from '@react-pdf/renderer';
|
|
130
2
|
/**
|
|
131
3
|
*
|
|
132
4
|
* @param document React PDF Document element
|
|
133
5
|
* @param fileName DO NOT USE THIS IN NEXT.JS APP, as Vercel does not allow us to amend files. This will generate a PDF file in the given fileName
|
|
134
6
|
* @returns PDF Buffer
|
|
135
|
-
*/
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
];
|
|
149
|
-
case 1:
|
|
150
|
-
_state.sent();
|
|
151
|
-
_state.label = 2;
|
|
152
|
-
case 2:
|
|
153
|
-
return [
|
|
154
|
-
4,
|
|
155
|
-
ReactPDF.renderToStream(document)
|
|
156
|
-
];
|
|
157
|
-
case 3:
|
|
158
|
-
stream = _state.sent();
|
|
159
|
-
return [
|
|
160
|
-
2,
|
|
161
|
-
new Promise(function(resolve, reject) {
|
|
162
|
-
var buffers = [];
|
|
163
|
-
stream.on('data', function(data) {
|
|
164
|
-
buffers.push(data);
|
|
165
|
-
});
|
|
166
|
-
stream.on('end', function() {
|
|
167
|
-
resolve(Buffer.concat(buffers));
|
|
168
|
-
});
|
|
169
|
-
stream.on('error', reject);
|
|
170
|
-
})
|
|
171
|
-
];
|
|
172
|
-
}
|
|
7
|
+
*/
|
|
8
|
+
export const toPdf = async (document, fileName) => {
|
|
9
|
+
if (fileName) {
|
|
10
|
+
await ReactPDF.renderToFile(document, fileName);
|
|
11
|
+
}
|
|
12
|
+
const stream = await ReactPDF.renderToStream(document);
|
|
13
|
+
return new Promise((resolve, reject) => {
|
|
14
|
+
const buffers = [];
|
|
15
|
+
stream.on('data', (data) => {
|
|
16
|
+
buffers.push(data);
|
|
17
|
+
});
|
|
18
|
+
stream.on('end', () => {
|
|
19
|
+
resolve(Buffer.concat(buffers));
|
|
173
20
|
});
|
|
174
|
-
|
|
21
|
+
stream.on('error', reject);
|
|
22
|
+
});
|
|
175
23
|
};
|
|
24
|
+
//# sourceMappingURL=utils.js.map
|
package/dist/watch.js
CHANGED
|
@@ -2,10 +2,11 @@ import { execSync } from 'node:child_process';
|
|
|
2
2
|
import fs from 'node:fs';
|
|
3
3
|
fs.watch('src', {
|
|
4
4
|
persistent: true,
|
|
5
|
-
recursive: true
|
|
6
|
-
},
|
|
5
|
+
recursive: true,
|
|
6
|
+
}, () => {
|
|
7
7
|
console.log('Reloading...');
|
|
8
8
|
execSync('pnpm debug', {
|
|
9
|
-
stdio: 'inherit'
|
|
9
|
+
stdio: 'inherit',
|
|
10
10
|
});
|
|
11
11
|
});
|
|
12
|
+
//# sourceMappingURL=watch.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@driveflux/pdf",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.79",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -12,23 +12,23 @@
|
|
|
12
12
|
"dist"
|
|
13
13
|
],
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@driveflux/db": "4.1.
|
|
16
|
-
"@driveflux/env": "3.0.
|
|
17
|
-
"@driveflux/format-money": "7.0.
|
|
18
|
-
"@driveflux/time": "6.0.
|
|
15
|
+
"@driveflux/db": "4.1.20",
|
|
16
|
+
"@driveflux/env": "3.0.2",
|
|
17
|
+
"@driveflux/format-money": "7.0.2",
|
|
18
|
+
"@driveflux/time": "6.0.4",
|
|
19
19
|
"@react-pdf/renderer": "^4.5.1",
|
|
20
|
-
"date-fns": "^4.1
|
|
20
|
+
"date-fns": "^4.2.1",
|
|
21
21
|
"nodemon": "^3.1.14",
|
|
22
22
|
"react": "19.2.6"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@babel/preset-env": "^7.29.5",
|
|
26
|
-
"@driveflux/fab": "4.0.
|
|
27
|
-
"@driveflux/tsconfig": "3.0.
|
|
26
|
+
"@driveflux/fab": "4.0.2",
|
|
27
|
+
"@driveflux/tsconfig": "3.0.2",
|
|
28
28
|
"@swc/cli": "^0.8.1",
|
|
29
29
|
"@swc/core": "^1.15.33",
|
|
30
|
-
"@types/node": "^25.
|
|
31
|
-
"@types/react": "19.2.
|
|
30
|
+
"@types/node": "^25.9.1",
|
|
31
|
+
"@types/react": "19.2.15",
|
|
32
32
|
"del-cli": "^7.0.0",
|
|
33
33
|
"react": "19.2.6",
|
|
34
34
|
"typescript": "^6.0.3"
|