@driveflux/pdf 1.0.15 → 1.1.1

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 (106) hide show
  1. package/dist/__mocks__/quotation.d.ts +1 -1
  2. package/dist/__mocks__/quotation.d.ts.map +1 -1
  3. package/dist/__mocks__/quotation.js +1 -2
  4. package/dist/__mocks__/subscription.d.ts +1 -1
  5. package/dist/__mocks__/subscription.d.ts.map +1 -1
  6. package/dist/templates/QuotationPdf/CustomerSubscriptionSection.d.ts.map +1 -1
  7. package/dist/templates/QuotationPdf/CustomerSubscriptionSection.js +2 -10
  8. package/dist/templates/QuotationPdf/index.d.ts +1 -1
  9. package/dist/templates/QuotationPdf/index.d.ts.map +1 -1
  10. package/dist/templates/QuotationPdf/translations.d.ts +0 -1
  11. package/dist/templates/QuotationPdf/translations.d.ts.map +1 -1
  12. package/dist/templates/QuotationPdf/translations.js +44 -47
  13. package/dist/templates/QuotationPdf/utils.d.ts +3 -4
  14. package/dist/templates/QuotationPdf/utils.d.ts.map +1 -1
  15. package/dist/templates/QuotationPdf/utils.js +12 -26
  16. package/dist/templates/SubscriptionAgreement/index.d.ts +1 -1
  17. package/dist/templates/SubscriptionAgreement/index.d.ts.map +1 -1
  18. package/dist/templates/SubscriptionAgreement/translations.d.ts.map +1 -1
  19. package/dist/templates/SubscriptionAgreement/translations.js +269 -269
  20. package/dist/templates/SubscriptionAgreement/utils.d.ts +1 -1
  21. package/dist/templates/SubscriptionAgreement/utils.d.ts.map +1 -1
  22. package/dist/theme/colors.d.ts.map +1 -1
  23. package/dist/theme/colors.js +36 -36
  24. package/dist/utils.d.ts +2 -8
  25. package/dist/utils.d.ts.map +1 -1
  26. package/dist/utils.js +7 -31
  27. package/dist/watch.js +1 -1
  28. package/package.json +23 -20
  29. package/.eslintrc +0 -3
  30. package/.swcrc +0 -14
  31. package/.turbo/turbo-build.log +0 -6
  32. package/CHANGELOG.md +0 -186
  33. package/dist/cjs/__mocks__/quotation.js +0 -70
  34. package/dist/cjs/__mocks__/subscription.js +0 -1079
  35. package/dist/cjs/components/FluxLogo.js +0 -76
  36. package/dist/cjs/components/StandardPage.js +0 -129
  37. package/dist/cjs/debug.js +0 -234
  38. package/dist/cjs/index.js +0 -20
  39. package/dist/cjs/templates/QuotationPdf/CustomerSubscriptionSection.js +0 -155
  40. package/dist/cjs/templates/QuotationPdf/GFV.js +0 -57
  41. package/dist/cjs/templates/QuotationPdf/Header.js +0 -86
  42. package/dist/cjs/templates/QuotationPdf/Pricing.js +0 -430
  43. package/dist/cjs/templates/QuotationPdf/QuotationPdfPage.js +0 -45
  44. package/dist/cjs/templates/QuotationPdf/SectionBoxNew.js +0 -43
  45. package/dist/cjs/templates/QuotationPdf/TermsSection.js +0 -60
  46. package/dist/cjs/templates/QuotationPdf/index.js +0 -208
  47. package/dist/cjs/templates/QuotationPdf/translations.js +0 -106
  48. package/dist/cjs/templates/QuotationPdf/utils.js +0 -108
  49. package/dist/cjs/templates/SubscriptionAgreement/Confirmation.js +0 -95
  50. package/dist/cjs/templates/SubscriptionAgreement/CoverPage.js +0 -110
  51. package/dist/cjs/templates/SubscriptionAgreement/CoverPageSection.js +0 -35
  52. package/dist/cjs/templates/SubscriptionAgreement/Details.js +0 -161
  53. package/dist/cjs/templates/SubscriptionAgreement/Footer.js +0 -68
  54. package/dist/cjs/templates/SubscriptionAgreement/Header.js +0 -61
  55. package/dist/cjs/templates/SubscriptionAgreement/LabelValue.js +0 -39
  56. package/dist/cjs/templates/SubscriptionAgreement/SubscriptionAgreementPage.js +0 -48
  57. package/dist/cjs/templates/SubscriptionAgreement/TermsOfUse.js +0 -72
  58. package/dist/cjs/templates/SubscriptionAgreement/TermsOfUseSubSection.js +0 -108
  59. package/dist/cjs/templates/SubscriptionAgreement/index.js +0 -276
  60. package/dist/cjs/templates/SubscriptionAgreement/translations.js +0 -666
  61. package/dist/cjs/templates/SubscriptionAgreement/utils.js +0 -14
  62. package/dist/cjs/templates/index.js +0 -19
  63. package/dist/cjs/theme/colors.js +0 -147
  64. package/dist/cjs/theme/index.js +0 -18
  65. package/dist/cjs/types.js +0 -4
  66. package/dist/cjs/utils.js +0 -184
  67. package/dist/cjs/watch.js +0 -20
  68. package/index.cjs +0 -1
  69. package/index.d.ts +0 -1
  70. package/src/__mocks__/quotation.ts +0 -63
  71. package/src/__mocks__/subscription.ts +0 -803
  72. package/src/components/FluxLogo.tsx +0 -52
  73. package/src/components/StandardPage.tsx +0 -32
  74. package/src/debug.ts +0 -45
  75. package/src/index.ts +0 -3
  76. package/src/templates/QuotationPdf/CustomerSubscriptionSection.tsx +0 -73
  77. package/src/templates/QuotationPdf/GFV.tsx +0 -29
  78. package/src/templates/QuotationPdf/Header.tsx +0 -31
  79. package/src/templates/QuotationPdf/Pricing.tsx +0 -214
  80. package/src/templates/QuotationPdf/QuotationPdfPage.tsx +0 -25
  81. package/src/templates/QuotationPdf/SectionBoxNew.tsx +0 -20
  82. package/src/templates/QuotationPdf/TermsSection.tsx +0 -28
  83. package/src/templates/QuotationPdf/index.tsx +0 -46
  84. package/src/templates/QuotationPdf/translations.ts +0 -84
  85. package/src/templates/QuotationPdf/utils.ts +0 -59
  86. package/src/templates/SubscriptionAgreement/Confirmation.tsx +0 -49
  87. package/src/templates/SubscriptionAgreement/CoverPage.tsx +0 -52
  88. package/src/templates/SubscriptionAgreement/CoverPageSection.tsx +0 -25
  89. package/src/templates/SubscriptionAgreement/Details.tsx +0 -127
  90. package/src/templates/SubscriptionAgreement/Footer.tsx +0 -37
  91. package/src/templates/SubscriptionAgreement/Header.tsx +0 -37
  92. package/src/templates/SubscriptionAgreement/LabelValue.tsx +0 -19
  93. package/src/templates/SubscriptionAgreement/SubscriptionAgreementPage.tsx +0 -24
  94. package/src/templates/SubscriptionAgreement/TermsOfUse.tsx +0 -30
  95. package/src/templates/SubscriptionAgreement/TermsOfUseSubSection.tsx +0 -44
  96. package/src/templates/SubscriptionAgreement/index.tsx +0 -66
  97. package/src/templates/SubscriptionAgreement/translations.ts +0 -664
  98. package/src/templates/SubscriptionAgreement/utils.ts +0 -7
  99. package/src/templates/index.ts +0 -2
  100. package/src/theme/colors.ts +0 -180
  101. package/src/theme/index.ts +0 -1
  102. package/src/types.ts +0 -1
  103. package/src/utils.ts +0 -27
  104. package/src/watch.ts +0 -16
  105. package/tsconfig.json +0 -13
  106. package/tsconfig.tsbuildinfo +0 -1
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "formatIdentification", {
6
- enumerable: true,
7
- get: function() {
8
- return formatIdentification;
9
- }
10
- });
11
- var formatIdentification = function(identification) {
12
- var _identification_number, _identification_number1, _identification_number2;
13
- 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) || '-';
14
- };
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- _export_star(require("./QuotationPdf/index.js"), exports);
6
- _export_star(require("./SubscriptionAgreement/index.js"), exports);
7
- function _export_star(from, to) {
8
- Object.keys(from).forEach(function(k) {
9
- if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
10
- Object.defineProperty(to, k, {
11
- enumerable: true,
12
- get: function() {
13
- return from[k];
14
- }
15
- });
16
- }
17
- });
18
- return from;
19
- }
@@ -1,147 +0,0 @@
1
- // TODO sync this with the one in dump
2
- // remove dump file version
3
- // update all instances using colors
4
- "use strict";
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- Object.defineProperty(exports, "colors", {
9
- enumerable: true,
10
- get: function() {
11
- return colors;
12
- }
13
- });
14
- var colors = {
15
- /**
16
- * #EFEFF0 Light Gray
17
- */ primary1: '#EFEFF0',
18
- /**
19
- * #CACACA Gray
20
- */ primary2: '#CACACA',
21
- /**
22
- * #585858 Dark Gray
23
- */ primary3: '#585858',
24
- /**
25
- * #191919 Soft Black
26
- */ primary4: '#191919',
27
- /**
28
- * #E55867 Red
29
- */ accent4: '#E55867',
30
- /**
31
- * #ADE0EE Light Blue
32
- */ links2: '#ADE0EE',
33
- /**
34
- * #50C8E8 Blue
35
- */ links: '#50C8E8',
36
- /**
37
- * #E24657 Red
38
- */ alert4: '#E24657',
39
- /**
40
- * #E24657 Red
41
- */ danger: '#E24657',
42
- /**
43
- * #F4B25C Yellow
44
- */ warning4: '#F4B25C',
45
- /**
46
- * #4FD9C2 Green
47
- */ success4: '#4FD9C2',
48
- /**
49
- * #4FD9C2 Green
50
- */ green: '#4FD9C2',
51
- /**
52
- * #3BD5BC Green
53
- */ // green: '#3BD5BC',
54
- /**
55
- * #000000 Black
56
- */ black: '#000000',
57
- /**
58
- * #ffffff White
59
- */ white: '#ffffff',
60
- /**
61
- * #E6E6E6 Light Gray
62
- */ whiteHover: '#E6E6E6',
63
- /**
64
- * #F4F4F4 Light Gray
65
- */ placeholder: '#F4F4F4',
66
- /**
67
- * #F9F7D7 Light Yellow
68
- */ highlight: '#F9F7D7',
69
- primary: {
70
- 25: '#fafafa',
71
- 50: '#d6f5f0',
72
- 100: '#98e6d6',
73
- 200: '#191919',
74
- 300: '#191919',
75
- 400: '#3bd5bb',
76
- 500: '#000000',
77
- 600: '#000000',
78
- 700: '#000000',
79
- 800: '#000000',
80
- 900: '#000000'
81
- },
82
- // TODO add 25
83
- success: {
84
- 50: '#d8f7f2',
85
- 100: '#98e6d6',
86
- 200: '#3bd5bc',
87
- 300: '#4FD9C2',
88
- 400: '#3bd5bb',
89
- 500: '#3bd5bb',
90
- 600: '#2EA692',
91
- 700: '#00825c',
92
- 800: '#00724d',
93
- 900: '#005530'
94
- },
95
- // TODO add 25
96
- accent: {
97
- 50: '#fceaee',
98
- 100: '#f8cad3',
99
- 200: '#E55867',
100
- 300: '#E55867',
101
- 400: '#E24657',
102
- 500: '#E24657',
103
- 600: '#d8253f',
104
- 700: '#c61a38',
105
- 800: '#b91231',
106
- 900: '#aa0026'
107
- },
108
- // TODO add 25
109
- warning: {
110
- 50: '#FDF0DE',
111
- 100: '#F4B25C',
112
- 200: '#F4B25C',
113
- 300: '#F4B25C',
114
- 400: '#F4B25C',
115
- 500: '#F4B25C',
116
- 600: '#BF7F2C',
117
- 700: '#F4B25C',
118
- 800: '#F4B25C',
119
- 900: '#F4B25C'
120
- },
121
- info: {
122
- 25: '#50C8E81A',
123
- 50: '#CDF1FA',
124
- 100: '#50C8E8',
125
- 200: '#50C8E8',
126
- 300: '#50C8E8',
127
- 400: '#50C8E8',
128
- 500: '#50C8E8',
129
- 600: '#3EA5C0',
130
- 700: '#50C8E8',
131
- 800: '#50C8E8',
132
- 900: '#50C8E8'
133
- },
134
- // TODO add 25
135
- alert: {
136
- 50: '#E24657',
137
- 100: '#E24657',
138
- 200: '#E24657',
139
- 300: '#E24657',
140
- 400: '#E24657',
141
- 500: '#E24657',
142
- 600: '#E24657',
143
- 700: '#E24657',
144
- 800: '#E24657',
145
- 900: '#E24657'
146
- }
147
- };
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- _export_star(require("./colors.js"), exports);
6
- function _export_star(from, to) {
7
- Object.keys(from).forEach(function(k) {
8
- if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
9
- Object.defineProperty(to, k, {
10
- enumerable: true,
11
- get: function() {
12
- return from[k];
13
- }
14
- });
15
- }
16
- });
17
- return from;
18
- }
package/dist/cjs/types.js DELETED
@@ -1,4 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
package/dist/cjs/utils.js DELETED
@@ -1,184 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "toPdf", {
6
- enumerable: true,
7
- get: function() {
8
- return toPdf;
9
- }
10
- });
11
- var _renderer = /*#__PURE__*/ _interop_require_default(require("@react-pdf/renderer"));
12
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
13
- try {
14
- var info = gen[key](arg);
15
- var value = info.value;
16
- } catch (error) {
17
- reject(error);
18
- return;
19
- }
20
- if (info.done) {
21
- resolve(value);
22
- } else {
23
- Promise.resolve(value).then(_next, _throw);
24
- }
25
- }
26
- function _async_to_generator(fn) {
27
- return function() {
28
- var self = this, args = arguments;
29
- return new Promise(function(resolve, reject) {
30
- var gen = fn.apply(self, args);
31
- function _next(value) {
32
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
33
- }
34
- function _throw(err) {
35
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
36
- }
37
- _next(undefined);
38
- });
39
- };
40
- }
41
- function _interop_require_default(obj) {
42
- return obj && obj.__esModule ? obj : {
43
- default: obj
44
- };
45
- }
46
- function _ts_generator(thisArg, body) {
47
- var f, y, t, g, _ = {
48
- label: 0,
49
- sent: function() {
50
- if (t[0] & 1) throw t[1];
51
- return t[1];
52
- },
53
- trys: [],
54
- ops: []
55
- };
56
- return g = {
57
- next: verb(0),
58
- "throw": verb(1),
59
- "return": verb(2)
60
- }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
61
- return this;
62
- }), g;
63
- function verb(n) {
64
- return function(v) {
65
- return step([
66
- n,
67
- v
68
- ]);
69
- };
70
- }
71
- function step(op) {
72
- if (f) throw new TypeError("Generator is already executing.");
73
- while(_)try {
74
- 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;
75
- if (y = 0, t) op = [
76
- op[0] & 2,
77
- t.value
78
- ];
79
- switch(op[0]){
80
- case 0:
81
- case 1:
82
- t = op;
83
- break;
84
- case 4:
85
- _.label++;
86
- return {
87
- value: op[1],
88
- done: false
89
- };
90
- case 5:
91
- _.label++;
92
- y = op[1];
93
- op = [
94
- 0
95
- ];
96
- continue;
97
- case 7:
98
- op = _.ops.pop();
99
- _.trys.pop();
100
- continue;
101
- default:
102
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
103
- _ = 0;
104
- continue;
105
- }
106
- if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
107
- _.label = op[1];
108
- break;
109
- }
110
- if (op[0] === 6 && _.label < t[1]) {
111
- _.label = t[1];
112
- t = op;
113
- break;
114
- }
115
- if (t && _.label < t[2]) {
116
- _.label = t[2];
117
- _.ops.push(op);
118
- break;
119
- }
120
- if (t[2]) _.ops.pop();
121
- _.trys.pop();
122
- continue;
123
- }
124
- op = body.call(thisArg, _);
125
- } catch (e) {
126
- op = [
127
- 6,
128
- e
129
- ];
130
- y = 0;
131
- } finally{
132
- f = t = 0;
133
- }
134
- if (op[0] & 5) throw op[1];
135
- return {
136
- value: op[0] ? op[1] : void 0,
137
- done: true
138
- };
139
- }
140
- }
141
- var toPdf = function() {
142
- var _ref = _async_to_generator(function(document, fileName) {
143
- var stream;
144
- return _ts_generator(this, function(_state) {
145
- switch(_state.label){
146
- case 0:
147
- if (!!!fileName) return [
148
- 3,
149
- 2
150
- ];
151
- return [
152
- 4,
153
- _renderer.default.renderToFile(document, fileName)
154
- ];
155
- case 1:
156
- _state.sent();
157
- _state.label = 2;
158
- case 2:
159
- return [
160
- 4,
161
- _renderer.default.renderToStream(document)
162
- ];
163
- case 3:
164
- stream = _state.sent();
165
- return [
166
- 2,
167
- new Promise(function(resolve, reject) {
168
- var buffers = [];
169
- stream.on('data', function(data) {
170
- buffers.push(data);
171
- });
172
- stream.on('end', function() {
173
- resolve(Buffer.concat(buffers));
174
- });
175
- stream.on('error', reject);
176
- })
177
- ];
178
- }
179
- });
180
- });
181
- return function toPdf(document, fileName) {
182
- return _ref.apply(this, arguments);
183
- };
184
- }();
package/dist/cjs/watch.js DELETED
@@ -1,20 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- var _child_process = require("child_process");
6
- var _nodefs = /*#__PURE__*/ _interop_require_default(require("node:fs"));
7
- function _interop_require_default(obj) {
8
- return obj && obj.__esModule ? obj : {
9
- default: obj
10
- };
11
- }
12
- _nodefs.default.watch('src', {
13
- persistent: true,
14
- recursive: true
15
- }, function() {
16
- console.log('Reloading...');
17
- (0, _child_process.execSync)('pnpm debug', {
18
- stdio: 'inherit'
19
- });
20
- });
package/index.cjs DELETED
@@ -1 +0,0 @@
1
- module.exports = require('./dist/cjs/index.js')
package/index.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from './dist/index'
@@ -1,63 +0,0 @@
1
- import { Quotation } from '@driveflux/db'
2
-
3
- export const quotation: Quotation = {
4
- id: 'QUO_XZJLVSM8',
5
- vehicleId: 'VBEXLQR',
6
- plan: 'plan36',
7
- mileagePackage: 'lite',
8
- cycleFluxCoefficient: 'flux25',
9
- customerName: 'Bubu Ahmad',
10
- vehicleName: 'Volkswagen Polo 1.6 Sedan 2011',
11
- createdById: 'U2R88JRVL',
12
-
13
- createdAt: new Date('2024-05-27T02:26:36.070Z'),
14
- updatedAt: new Date('2024-05-27T02:26:36.070Z'),
15
- metadata: {},
16
- customer: {
17
- type: 'user',
18
- name: 'Bubu Ahmad',
19
- email: 'bubu@gmail.com',
20
- address: {
21
- street1: '15-2 Jalan Solaris',
22
- city: 'Kuala Lumpur',
23
- state: 'Johor',
24
- postalCode: '12323',
25
- country: 'MY'
26
- }
27
- },
28
- fees: {
29
- subscriptionFee: 800,
30
- reservationFee: 0,
31
- startFee: 498,
32
- deposit: 1600,
33
- depositMonths: 2,
34
- extraCharges: [
35
- {
36
- type: 'upfront',
37
- description: 'Spare Tyre',
38
- amount: 2500.2
39
- },
40
- {
41
- type: 'upfront',
42
- description: 'Spare Tyre No 2',
43
- amount: 3000.2
44
- },
45
- {
46
- type: 'monthly',
47
- description: 'Commitment ',
48
- amount: 2
49
- }
50
- ],
51
- amountBeforeTax: 8400.4,
52
- taxAmount: 672.03,
53
- amountAfterTax: 9072.43,
54
- gfv: 0,
55
- cycle: null,
56
- couponCode: null,
57
- discountAmount: null,
58
- appliedDiscountId: null,
59
- couponType: '',
60
- excessMileageFee: 3.8
61
- },
62
- quotationPdf: null
63
- }