@driveflux/pdf 4.0.76 → 4.0.78

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.
Files changed (36) hide show
  1. package/dist/components/FluxLogo.js +3 -62
  2. package/dist/components/StandardPage.js +10 -99
  3. package/dist/index.js +1 -0
  4. package/dist/templates/QuotationPdf/CustomerSubscriptionSection.js +27 -145
  5. package/dist/templates/QuotationPdf/GFV.js +12 -49
  6. package/dist/templates/QuotationPdf/Header.js +5 -63
  7. package/dist/templates/QuotationPdf/Pricing.js +191 -573
  8. package/dist/templates/QuotationPdf/Pricing.js.map +1 -1
  9. package/dist/templates/QuotationPdf/QuotationPdfPage.js +3 -23
  10. package/dist/templates/QuotationPdf/SectionBoxNew.js +4 -34
  11. package/dist/templates/QuotationPdf/TermsSection.js +5 -42
  12. package/dist/templates/QuotationPdf/VehiclePhotos.js +24 -54
  13. package/dist/templates/QuotationPdf/index.js +10 -189
  14. package/dist/templates/QuotationPdf/translations.js +22 -34
  15. package/dist/templates/QuotationPdf/utils.js +49 -83
  16. package/dist/templates/SubscriptionAgreement/Confirmation.js +10 -65
  17. package/dist/templates/SubscriptionAgreement/CoverPage.js +10 -93
  18. package/dist/templates/SubscriptionAgreement/CoverPageSection.js +5 -16
  19. package/dist/templates/SubscriptionAgreement/Details.js +59 -139
  20. package/dist/templates/SubscriptionAgreement/Footer.js +6 -48
  21. package/dist/templates/SubscriptionAgreement/Header.js +5 -35
  22. package/dist/templates/SubscriptionAgreement/LabelValue.js +3 -25
  23. package/dist/templates/SubscriptionAgreement/SubscriptionAgreementPage.js +3 -26
  24. package/dist/templates/SubscriptionAgreement/TermsOfUse.js +8 -94
  25. package/dist/templates/SubscriptionAgreement/TermsOfUseSubSection.js +11 -97
  26. package/dist/templates/SubscriptionAgreement/index.js +15 -245
  27. package/dist/templates/SubscriptionAgreement/translations.js +194 -195
  28. package/dist/templates/SubscriptionAgreement/types.js +2 -1
  29. package/dist/templates/SubscriptionAgreement/utils.js +11 -16
  30. package/dist/templates/index.js +1 -0
  31. package/dist/theme/colors.js +63 -44
  32. package/dist/theme/index.js +1 -0
  33. package/dist/types.js +2 -1
  34. package/dist/utils.js +16 -159
  35. package/dist/watch.js +4 -3
  36. package/package.json +18 -18
@@ -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 var formatIdentification = function(identification) {
4
- var _identification_number, _identification_number1, _identification_number2;
5
- return (identification === null || identification === void 0 ? void 0 : identification.type) === 'id' ? "".concat(identification === null || identification === void 0 ? void 0 : (_identification_number = identification.number) === null || _identification_number === void 0 ? void 0 : _identification_number.slice(0, 6), "-").concat(identification === null || identification === void 0 ? void 0 : (_identification_number1 = identification.number) === null || _identification_number1 === void 0 ? void 0 : _identification_number1.slice(6, 8), "-").concat(identification === null || identification === void 0 ? void 0 : (_identification_number2 = identification.number) === null || _identification_number2 === void 0 ? void 0 : _identification_number2.slice(8)) : (identification === null || identification === void 0 ? void 0 : identification.number) || '-';
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 var renderMarkdown = function(text) {
8
- var parts = text.split(/(\*\*\*.*?\*\*\*|\*\*.*?\*\*|\*.*?\*)/g);
9
- return parts.map(function(part, index) {
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
@@ -1,2 +1,3 @@
1
1
  export * from './QuotationPdf/index.js';
2
2
  export * from './SubscriptionAgreement/index.js';
3
+ //# sourceMappingURL=index.js.map
@@ -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 var colors = {
4
+ export const colors = {
5
5
  /**
6
- * #EFEFF0 Light Gray
7
- */ primary1: '#EFEFF0',
6
+ * #EFEFF0 Light Gray
7
+ */
8
+ primary1: '#EFEFF0',
8
9
  /**
9
- * #CACACA Gray
10
- */ primary2: '#CACACA',
10
+ * #CACACA Gray
11
+ */
12
+ primary2: '#CACACA',
11
13
  /**
12
- * #585858 Dark Gray
13
- */ primary3: '#585858',
14
+ * #585858 Dark Gray
15
+ */
16
+ primary3: '#585858',
14
17
  /**
15
- * #191919 Soft Black
16
- */ primary4: '#191919',
18
+ * #191919 Soft Black
19
+ */
20
+ primary4: '#191919',
17
21
  /**
18
- * #E55867 Red
19
- */ accent4: '#E55867',
22
+ * #E55867 Red
23
+ */
24
+ accent4: '#E55867',
20
25
  /**
21
- * #ADE0EE Light Blue
22
- */ links2: '#ADE0EE',
26
+ * #ADE0EE Light Blue
27
+ */
28
+ links2: '#ADE0EE',
23
29
  /**
24
- * #50C8E8 Blue
25
- */ links: '#50C8E8',
30
+ * #50C8E8 Blue
31
+ */
32
+ links: '#50C8E8',
26
33
  /**
27
- * #E24657 Red
28
- */ alert4: '#E24657',
34
+ * #E24657 Red
35
+ */
36
+ alert4: '#E24657',
29
37
  /**
30
- * #E24657 Red
31
- */ danger: '#E24657',
38
+ * #E24657 Red
39
+ */
40
+ danger: '#E24657',
32
41
  /**
33
- * #F4B25C Yellow
34
- */ warning4: '#F4B25C',
42
+ * #F4B25C Yellow
43
+ */
44
+ warning4: '#F4B25C',
35
45
  /**
36
- * #4FD9C2 Green
37
- */ success4: '#4FD9C2',
46
+ * #4FD9C2 Green
47
+ */
48
+ success4: '#4FD9C2',
38
49
  /**
39
- * #4FD9C2 Green
40
- */ green: '#4FD9C2',
50
+ * #4FD9C2 Green
51
+ */
52
+ green: '#4FD9C2',
41
53
  /**
42
- * #3BD5BC Green
43
- */ // green: '#3BD5BC',
54
+ * #3BD5BC Green
55
+ */
56
+ // green: '#3BD5BC',
44
57
  /**
45
- * #000000 Black
46
- */ black: '#000000',
58
+ * #000000 Black
59
+ */
60
+ black: '#000000',
47
61
  /**
48
- * #ffffff White
49
- */ white: '#ffffff',
62
+ * #ffffff White
63
+ */
64
+ white: '#ffffff',
50
65
  /**
51
- * #E6E6E6 Light Gray
52
- */ whiteHover: '#E6E6E6',
66
+ * #E6E6E6 Light Gray
67
+ */
68
+ whiteHover: '#E6E6E6',
53
69
  /**
54
- * #F4F4F4 Light Gray
55
- */ placeholder: '#F4F4F4',
70
+ * #F4F4F4 Light Gray
71
+ */
72
+ placeholder: '#F4F4F4',
56
73
  /**
57
- * #F9F7D7 Light Yellow
58
- */ highlight: '#F9F7D7',
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
@@ -1 +1,2 @@
1
1
  export * from './colors.js';
2
+ //# sourceMappingURL=index.js.map
package/dist/types.js CHANGED
@@ -1 +1,2 @@
1
- export { };
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
package/dist/utils.js CHANGED
@@ -1,167 +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);
40
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
41
- return this;
42
- }), g;
43
- function verb(n) {
44
- return function(v) {
45
- return step([
46
- n,
47
- v
48
- ]);
49
- };
50
- }
51
- function step(op) {
52
- if (f) throw new TypeError("Generator is already executing.");
53
- while(g && (g = 0, op[0] && (_ = 0)), _)try {
54
- 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;
55
- if (y = 0, t) op = [
56
- op[0] & 2,
57
- t.value
58
- ];
59
- switch(op[0]){
60
- case 0:
61
- case 1:
62
- t = op;
63
- break;
64
- case 4:
65
- _.label++;
66
- return {
67
- value: op[1],
68
- done: false
69
- };
70
- case 5:
71
- _.label++;
72
- y = op[1];
73
- op = [
74
- 0
75
- ];
76
- continue;
77
- case 7:
78
- op = _.ops.pop();
79
- _.trys.pop();
80
- continue;
81
- default:
82
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
83
- _ = 0;
84
- continue;
85
- }
86
- if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
87
- _.label = op[1];
88
- break;
89
- }
90
- if (op[0] === 6 && _.label < t[1]) {
91
- _.label = t[1];
92
- t = op;
93
- break;
94
- }
95
- if (t && _.label < t[2]) {
96
- _.label = t[2];
97
- _.ops.push(op);
98
- break;
99
- }
100
- if (t[2]) _.ops.pop();
101
- _.trys.pop();
102
- continue;
103
- }
104
- op = body.call(thisArg, _);
105
- } catch (e) {
106
- op = [
107
- 6,
108
- e
109
- ];
110
- y = 0;
111
- } finally{
112
- f = t = 0;
113
- }
114
- if (op[0] & 5) throw op[1];
115
- return {
116
- value: op[0] ? op[1] : void 0,
117
- done: true
118
- };
119
- }
120
- }
121
1
  import ReactPDF from '@react-pdf/renderer';
122
2
  /**
123
3
  *
124
4
  * @param document React PDF Document element
125
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
126
6
  * @returns PDF Buffer
127
- */ export var toPdf = function(document, fileName) {
128
- return _async_to_generator(function() {
129
- var stream;
130
- return _ts_generator(this, function(_state) {
131
- switch(_state.label){
132
- case 0:
133
- if (!fileName) return [
134
- 3,
135
- 2
136
- ];
137
- return [
138
- 4,
139
- ReactPDF.renderToFile(document, fileName)
140
- ];
141
- case 1:
142
- _state.sent();
143
- _state.label = 2;
144
- case 2:
145
- return [
146
- 4,
147
- ReactPDF.renderToStream(document)
148
- ];
149
- case 3:
150
- stream = _state.sent();
151
- return [
152
- 2,
153
- new Promise(function(resolve, reject) {
154
- var buffers = [];
155
- stream.on('data', function(data) {
156
- buffers.push(data);
157
- });
158
- stream.on('end', function() {
159
- resolve(Buffer.concat(buffers));
160
- });
161
- stream.on('error', reject);
162
- })
163
- ];
164
- }
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));
165
20
  });
166
- })();
21
+ stream.on('error', reject);
22
+ });
167
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
- }, function() {
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.76",
3
+ "version": "4.0.78",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -12,29 +12,29 @@
12
12
  "dist"
13
13
  ],
14
14
  "dependencies": {
15
- "@driveflux/db": "4.1.19",
16
- "@driveflux/env": "3.0.0",
17
- "@driveflux/format-money": "7.0.0",
18
- "@driveflux/time": "6.0.2",
19
- "@react-pdf/renderer": "^4.3.1",
15
+ "@driveflux/db": "4.1.20",
16
+ "@driveflux/env": "3.0.1",
17
+ "@driveflux/format-money": "7.0.1",
18
+ "@driveflux/time": "6.0.3",
19
+ "@react-pdf/renderer": "^4.5.1",
20
20
  "date-fns": "^4.1.0",
21
- "nodemon": "^3.1.10",
22
- "react": "19.2.1"
21
+ "nodemon": "^3.1.14",
22
+ "react": "19.2.6"
23
23
  },
24
24
  "devDependencies": {
25
- "@babel/preset-env": "^7.28.3",
26
- "@driveflux/fab": "4.0.0",
27
- "@driveflux/tsconfig": "3.0.0",
28
- "@swc/cli": "^0.7.8",
29
- "@swc/core": "^1.13.5",
30
- "@types/node": "^24.9.1",
31
- "@types/react": "19.2.2",
25
+ "@babel/preset-env": "^7.29.5",
26
+ "@driveflux/fab": "4.0.1",
27
+ "@driveflux/tsconfig": "3.0.1",
28
+ "@swc/cli": "^0.8.1",
29
+ "@swc/core": "^1.15.33",
30
+ "@types/node": "^25.7.0",
31
+ "@types/react": "19.2.14",
32
32
  "del-cli": "^7.0.0",
33
- "react": "19.2.1",
34
- "typescript": "^5.9.3"
33
+ "react": "19.2.6",
34
+ "typescript": "^6.0.3"
35
35
  },
36
36
  "peerDependencies": {
37
- "react": "19.2.1"
37
+ "react": "19.2.6"
38
38
  },
39
39
  "scripts": {
40
40
  "build": "fab",