@driveflux/pdf 1.2.28 → 1.3.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.
@@ -1 +1 @@
1
- {"version":3,"file":"subscription.d.ts","sourceRoot":"","sources":["../../src/__mocks__/subscription.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAA;AAE5D,eAAO,MAAM,YAAY,EAAE,wBAw0B1B,CAAA"}
1
+ {"version":3,"file":"subscription.d.ts","sourceRoot":"","sources":["../../src/__mocks__/subscription.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAA;AAE5D,eAAO,MAAM,YAAY,EAAE,wBA+zB1B,CAAA"}
@@ -65,7 +65,6 @@ export var subscription = {
65
65
  ipAddress: null
66
66
  },
67
67
  id: 'S5Y9TWWSK',
68
- // subscriptionTag: 'new',
69
68
  object: 'subscription',
70
69
  version: 3,
71
70
  started: true,
@@ -184,12 +183,6 @@ export var subscription = {
184
183
  groups: [
185
184
  'member'
186
185
  ],
187
- maritalStatus: null,
188
- emergencyContactName: null,
189
- emergencyPhoneNumber: null,
190
- jobTitle: null,
191
- industry: null,
192
- estimatedSalary: 10000.2,
193
186
  permissions: [
194
187
  {
195
188
  action: 'read',
@@ -536,7 +529,6 @@ export var subscription = {
536
529
  activeSubscriptionId: 'S5Y9TWWSK',
537
530
  createdAt: new Date('2024-04-01T08:15:04.448Z'),
538
531
  updatedAt: new Date('2024-05-21T07:17:58.621Z'),
539
- listedAt: new Date('2024-06-21T07:17:58.621Z'),
540
532
  metadata: {},
541
533
  addresses: {
542
534
  return: {
@@ -1078,6 +1070,5 @@ export var subscription = {
1078
1070
  metadata: {},
1079
1071
  expiryNoticeSent: false,
1080
1072
  phases: []
1081
- },
1082
- subscriptionTag: 'new'
1073
+ }
1083
1074
  };
package/dist/debug.js CHANGED
@@ -127,7 +127,7 @@ import { quotation } from './__mocks__/quotation.js';
127
127
  import { subscription } from './__mocks__/subscription.js';
128
128
  import { generateSubscriptionAgreementPdf } from './templates/SubscriptionAgreement/index.js';
129
129
  import { generateQuotationPdf } from './templates/index.js';
130
- var debugSubscriptionAgreement = /*#__PURE__*/ function() {
130
+ var debugSubscriptionAgreement = function() {
131
131
  var _ref = _async_to_generator(function() {
132
132
  return _ts_generator(this, function(_state) {
133
133
  switch(_state.label){
@@ -156,7 +156,7 @@ var debugSubscriptionAgreement = /*#__PURE__*/ function() {
156
156
  return _ref.apply(this, arguments);
157
157
  };
158
158
  }();
159
- var debugQuotation = /*#__PURE__*/ function() {
159
+ var debugQuotation = function() {
160
160
  var _ref = _async_to_generator(function() {
161
161
  return _ts_generator(this, function(_state) {
162
162
  switch(_state.label){
@@ -190,7 +190,7 @@ var debugCases = [
190
190
  debugSubscriptionAgreement(),
191
191
  debugQuotation()
192
192
  ];
193
- var debug = /*#__PURE__*/ function() {
193
+ var debug = function() {
194
194
  var _ref = _async_to_generator(function() {
195
195
  var results;
196
196
  return _ts_generator(this, function(_state) {
@@ -1 +1 @@
1
- {"version":3,"file":"Pricing.d.ts","sourceRoot":"","sources":["../../../src/templates/QuotationPdf/Pricing.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAG9C,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAG/B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAEhE,KAAK,KAAK,GAAG;IACZ,SAAS,EAAE,SAAS,CAAA;IACpB,CAAC,CAAC,EAAE,uBAAuB,CAAC,SAAS,CAAC,CAAA;CACtC,CAAA;AAED,QAAA,MAAM,OAAO,EAAE,EAAE,CAAC,KAAK,CAyVtB,CAAA;AAED,eAAe,OAAO,CAAA"}
1
+ {"version":3,"file":"Pricing.d.ts","sourceRoot":"","sources":["../../../src/templates/QuotationPdf/Pricing.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAG9C,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAG/B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAEhE,KAAK,KAAK,GAAG;IACZ,SAAS,EAAE,SAAS,CAAA;IACpB,CAAC,CAAC,EAAE,uBAAuB,CAAC,SAAS,CAAC,CAAA;CACtC,CAAA;AAED,QAAA,MAAM,OAAO,EAAE,EAAE,CAAC,KAAK,CA2WtB,CAAA;AAED,eAAe,OAAO,CAAA"}
@@ -104,12 +104,44 @@ var Pricing = function(param) {
104
104
  ]
105
105
  }, fee.key);
106
106
  }),
107
- quotation.fees.extraCharges.length > 0 && quotation.fees.extraCharges.filter(function(charge) {
108
- return charge.amount > 0;
109
- }).filter(function(charge) {
110
- return charge.type === 'upfront';
111
- }).map(function(charge, i) {
112
- return /*#__PURE__*/ _jsxs(View, {
107
+ quotation.fees.extraCharges.length > 0 && /*#__PURE__*/ _jsx(_Fragment, {
108
+ children: quotation.fees.extraCharges.filter(function(charge) {
109
+ return charge.amount > 0;
110
+ }).filter(function(charge) {
111
+ return charge.type === 'upfront';
112
+ }).map(function(charge, i) {
113
+ return /*#__PURE__*/ _jsxs(View, {
114
+ style: {
115
+ justifyContent: 'space-between',
116
+ flexDirection: 'row',
117
+ rowGap: 8
118
+ },
119
+ children: [
120
+ /*#__PURE__*/ _jsxs(Text, {
121
+ style: {
122
+ paddingRight: 4,
123
+ letterSpacing: 1,
124
+ color: colors.primary3
125
+ },
126
+ children: [
127
+ t === null || t === void 0 ? void 0 : t.fees.extraCharge,
128
+ " - ",
129
+ charge.description
130
+ ]
131
+ }),
132
+ /*#__PURE__*/ _jsx(Text, {
133
+ style: {
134
+ color: colors.primary3,
135
+ letterSpacing: 1
136
+ },
137
+ children: charge.amount.toFixed(2)
138
+ })
139
+ ]
140
+ }, i);
141
+ })
142
+ }),
143
+ quotation.fees.couponCode !== null && quotation.fees.couponType === 'upfront' && /*#__PURE__*/ _jsx(_Fragment, {
144
+ children: /*#__PURE__*/ _jsxs(View, {
113
145
  style: {
114
146
  justifyContent: 'space-between',
115
147
  flexDirection: 'row',
@@ -123,48 +155,20 @@ var Pricing = function(param) {
123
155
  color: colors.primary3
124
156
  },
125
157
  children: [
126
- t === null || t === void 0 ? void 0 : t.fees.extraCharge,
158
+ t === null || t === void 0 ? void 0 : t.fees.promo,
127
159
  " - ",
128
- charge.description
160
+ quotation.fees.couponCode
129
161
  ]
130
162
  }),
131
163
  /*#__PURE__*/ _jsx(Text, {
132
164
  style: {
133
- color: colors.primary3,
165
+ color: colors.accent4,
134
166
  letterSpacing: 1
135
167
  },
136
- children: charge.amount.toFixed(2)
168
+ children: (_quotation_fees_discountAmount = quotation.fees.discountAmount) === null || _quotation_fees_discountAmount === void 0 ? void 0 : _quotation_fees_discountAmount.toFixed(2)
137
169
  })
138
170
  ]
139
- }, i);
140
- }),
141
- quotation.fees.couponCode !== null && quotation.fees.couponType === 'upfront' && /*#__PURE__*/ _jsxs(View, {
142
- style: {
143
- justifyContent: 'space-between',
144
- flexDirection: 'row',
145
- rowGap: 8
146
- },
147
- children: [
148
- /*#__PURE__*/ _jsxs(Text, {
149
- style: {
150
- paddingRight: 4,
151
- letterSpacing: 1,
152
- color: colors.primary3
153
- },
154
- children: [
155
- t === null || t === void 0 ? void 0 : t.fees.promo,
156
- " - ",
157
- quotation.fees.couponCode
158
- ]
159
- }),
160
- /*#__PURE__*/ _jsx(Text, {
161
- style: {
162
- color: colors.accent4,
163
- letterSpacing: 1
164
- },
165
- children: (_quotation_fees_discountAmount = quotation.fees.discountAmount) === null || _quotation_fees_discountAmount === void 0 ? void 0 : _quotation_fees_discountAmount.toFixed(2)
166
- })
167
- ]
171
+ })
168
172
  }),
169
173
  /*#__PURE__*/ _jsxs(View, {
170
174
  style: {
@@ -231,10 +235,42 @@ var Pricing = function(param) {
231
235
  ]
232
236
  }, fee.key);
233
237
  }),
234
- quotation.fees.extraCharges.length > 0 && quotation.fees.extraCharges.filter(function(charge) {
235
- return charge.type === 'monthly';
236
- }).map(function(charge, i) {
237
- return /*#__PURE__*/ _jsxs(View, {
238
+ quotation.fees.extraCharges.length > 0 && /*#__PURE__*/ _jsx(_Fragment, {
239
+ children: quotation.fees.extraCharges.filter(function(charge) {
240
+ return charge.type === 'monthly';
241
+ }).map(function(charge, i) {
242
+ return /*#__PURE__*/ _jsxs(View, {
243
+ style: {
244
+ justifyContent: 'space-between',
245
+ flexDirection: 'row',
246
+ rowGap: 8
247
+ },
248
+ children: [
249
+ /*#__PURE__*/ _jsxs(Text, {
250
+ style: {
251
+ paddingRight: 4,
252
+ letterSpacing: 1,
253
+ color: colors.primary3
254
+ },
255
+ children: [
256
+ t === null || t === void 0 ? void 0 : t.fees.extraCharge,
257
+ " - ",
258
+ charge.description
259
+ ]
260
+ }),
261
+ /*#__PURE__*/ _jsx(Text, {
262
+ style: {
263
+ color: colors.primary3,
264
+ letterSpacing: 1
265
+ },
266
+ children: charge.amount.toFixed(2)
267
+ })
268
+ ]
269
+ }, i);
270
+ })
271
+ }),
272
+ quotation.fees.couponCode !== null && quotation.fees.couponType === 'monthly' && /*#__PURE__*/ _jsx(_Fragment, {
273
+ children: /*#__PURE__*/ _jsxs(View, {
238
274
  style: {
239
275
  justifyContent: 'space-between',
240
276
  flexDirection: 'row',
@@ -248,48 +284,20 @@ var Pricing = function(param) {
248
284
  color: colors.primary3
249
285
  },
250
286
  children: [
251
- t === null || t === void 0 ? void 0 : t.fees.extraCharge,
287
+ t === null || t === void 0 ? void 0 : t.fees.promo,
252
288
  " - ",
253
- charge.description
289
+ quotation.fees.couponCode
254
290
  ]
255
291
  }),
256
292
  /*#__PURE__*/ _jsx(Text, {
257
293
  style: {
258
- color: colors.primary3,
294
+ color: colors.accent4,
259
295
  letterSpacing: 1
260
296
  },
261
- children: charge.amount.toFixed(2)
297
+ children: (_quotation_fees_discountAmount1 = quotation.fees.discountAmount) === null || _quotation_fees_discountAmount1 === void 0 ? void 0 : _quotation_fees_discountAmount1.toFixed(2)
262
298
  })
263
299
  ]
264
- }, i);
265
- }),
266
- quotation.fees.couponCode !== null && quotation.fees.couponType === 'monthly' && /*#__PURE__*/ _jsxs(View, {
267
- style: {
268
- justifyContent: 'space-between',
269
- flexDirection: 'row',
270
- rowGap: 8
271
- },
272
- children: [
273
- /*#__PURE__*/ _jsxs(Text, {
274
- style: {
275
- paddingRight: 4,
276
- letterSpacing: 1,
277
- color: colors.primary3
278
- },
279
- children: [
280
- t === null || t === void 0 ? void 0 : t.fees.promo,
281
- " - ",
282
- quotation.fees.couponCode
283
- ]
284
- }),
285
- /*#__PURE__*/ _jsx(Text, {
286
- style: {
287
- color: colors.accent4,
288
- letterSpacing: 1
289
- },
290
- children: (_quotation_fees_discountAmount1 = quotation.fees.discountAmount) === null || _quotation_fees_discountAmount1 === void 0 ? void 0 : _quotation_fees_discountAmount1.toFixed(2)
291
- })
292
- ]
300
+ })
293
301
  }),
294
302
  /*#__PURE__*/ _jsxs(View, {
295
303
  style: {
@@ -317,104 +325,106 @@ var Pricing = function(param) {
317
325
  })
318
326
  ]
319
327
  }),
320
- bottomContent: /*#__PURE__*/ _jsxs(View, {
321
- style: {
322
- rowGap: 16
323
- },
324
- children: [
325
- /*#__PURE__*/ _jsx(Text, {
326
- style: {
327
- textTransform: 'uppercase',
328
- fontSize: 12,
329
- fontWeight: 'bold',
330
- letterSpacing: 1
331
- },
332
- children: t === null || t === void 0 ? void 0 : t.fees.dueToday.title
333
- }),
334
- /*#__PURE__*/ _jsx(Text, {
335
- style: {
336
- color: colors.primary3,
337
- letterSpacing: 1
338
- },
339
- children: t === null || t === void 0 ? void 0 : t.fees.dueToday.description
340
- }),
341
- /*#__PURE__*/ _jsxs(View, {
342
- style: {
343
- justifyContent: 'space-between',
344
- flexDirection: 'row'
345
- },
346
- children: [
347
- /*#__PURE__*/ _jsxs(Text, {
348
- style: {
349
- letterSpacing: 1,
350
- color: colors.primary3
351
- },
352
- children: [
353
- ' ',
354
- t === null || t === void 0 ? void 0 : t.fees.dueToday.subTotal
355
- ]
356
- }),
357
- /*#__PURE__*/ _jsx(Text, {
358
- style: {
359
- letterSpacing: 1,
360
- color: colors.primary3
361
- },
362
- children: quotation.fees.amountBeforeTax.toFixed(2)
363
- })
364
- ]
365
- }),
366
- /*#__PURE__*/ _jsxs(View, {
367
- style: {
368
- justifyContent: 'space-between',
369
- flexDirection: 'row'
370
- },
371
- children: [
372
- /*#__PURE__*/ _jsxs(Text, {
373
- style: {
374
- letterSpacing: 1,
375
- color: colors.primary3
376
- },
377
- children: [
378
- ' ',
379
- t === null || t === void 0 ? void 0 : t.fees.dueToday.serviceFee
380
- ]
381
- }),
382
- /*#__PURE__*/ _jsx(Text, {
383
- style: {
384
- letterSpacing: 1,
385
- color: colors.primary3
386
- },
387
- children: quotation.fees.taxAmount.toFixed(2)
388
- })
389
- ]
390
- }),
391
- /*#__PURE__*/ _jsxs(View, {
392
- style: {
393
- backgroundColor: colors.primary1,
394
- borderTop: "1px solid ".concat(colors.primary1),
395
- justifyContent: 'space-between',
396
- flexDirection: 'row',
397
- padding: 4
398
- },
399
- children: [
400
- /*#__PURE__*/ _jsx(Text, {
401
- style: {
402
- letterSpacing: 1,
403
- paddingRight: 4,
404
- fontWeight: 'bold'
405
- },
406
- children: t === null || t === void 0 ? void 0 : t.fees.dueToday.grandTotal
407
- }),
408
- /*#__PURE__*/ _jsx(Text, {
409
- style: {
410
- letterSpacing: 1,
411
- fontWeight: 'bold'
412
- },
413
- children: formatMoney(quotation.fees.amountAfterTax)
414
- })
415
- ]
416
- })
417
- ]
328
+ bottomContent: /*#__PURE__*/ _jsx(_Fragment, {
329
+ children: /*#__PURE__*/ _jsxs(View, {
330
+ style: {
331
+ rowGap: 16
332
+ },
333
+ children: [
334
+ /*#__PURE__*/ _jsx(Text, {
335
+ style: {
336
+ textTransform: 'uppercase',
337
+ fontSize: 12,
338
+ fontWeight: 'bold',
339
+ letterSpacing: 1
340
+ },
341
+ children: t === null || t === void 0 ? void 0 : t.fees.dueToday.title
342
+ }),
343
+ /*#__PURE__*/ _jsx(Text, {
344
+ style: {
345
+ color: colors.primary3,
346
+ letterSpacing: 1
347
+ },
348
+ children: t === null || t === void 0 ? void 0 : t.fees.dueToday.description
349
+ }),
350
+ /*#__PURE__*/ _jsxs(View, {
351
+ style: {
352
+ justifyContent: 'space-between',
353
+ flexDirection: 'row'
354
+ },
355
+ children: [
356
+ /*#__PURE__*/ _jsxs(Text, {
357
+ style: {
358
+ letterSpacing: 1,
359
+ color: colors.primary3
360
+ },
361
+ children: [
362
+ ' ',
363
+ t === null || t === void 0 ? void 0 : t.fees.dueToday.subTotal
364
+ ]
365
+ }),
366
+ /*#__PURE__*/ _jsx(Text, {
367
+ style: {
368
+ letterSpacing: 1,
369
+ color: colors.primary3
370
+ },
371
+ children: quotation.fees.amountBeforeTax.toFixed(2)
372
+ })
373
+ ]
374
+ }),
375
+ /*#__PURE__*/ _jsxs(View, {
376
+ style: {
377
+ justifyContent: 'space-between',
378
+ flexDirection: 'row'
379
+ },
380
+ children: [
381
+ /*#__PURE__*/ _jsxs(Text, {
382
+ style: {
383
+ letterSpacing: 1,
384
+ color: colors.primary3
385
+ },
386
+ children: [
387
+ ' ',
388
+ t === null || t === void 0 ? void 0 : t.fees.dueToday.serviceFee
389
+ ]
390
+ }),
391
+ /*#__PURE__*/ _jsx(Text, {
392
+ style: {
393
+ letterSpacing: 1,
394
+ color: colors.primary3
395
+ },
396
+ children: quotation.fees.taxAmount.toFixed(2)
397
+ })
398
+ ]
399
+ }),
400
+ /*#__PURE__*/ _jsxs(View, {
401
+ style: {
402
+ backgroundColor: colors.primary1,
403
+ borderTop: "1px solid ".concat(colors.primary1),
404
+ justifyContent: 'space-between',
405
+ flexDirection: 'row',
406
+ padding: 4
407
+ },
408
+ children: [
409
+ /*#__PURE__*/ _jsx(Text, {
410
+ style: {
411
+ letterSpacing: 1,
412
+ paddingRight: 4,
413
+ fontWeight: 'bold'
414
+ },
415
+ children: t === null || t === void 0 ? void 0 : t.fees.dueToday.grandTotal
416
+ }),
417
+ /*#__PURE__*/ _jsx(Text, {
418
+ style: {
419
+ letterSpacing: 1,
420
+ fontWeight: 'bold'
421
+ },
422
+ children: formatMoney(quotation.fees.amountAfterTax)
423
+ })
424
+ ]
425
+ })
426
+ ]
427
+ })
418
428
  })
419
429
  })
420
430
  });
@@ -132,7 +132,7 @@ import Pricing from './Pricing.js';
132
132
  import QuotationPdfPage from './QuotationPdfPage.js';
133
133
  import TermsSection from './TermsSection.js';
134
134
  import { useTranslations } from './translations.js';
135
- export var generateQuotationPdf = /*#__PURE__*/ function() {
135
+ export var generateQuotationPdf = function() {
136
136
  var _ref = _async_to_generator(function(param, fileName) {
137
137
  var _param_locale, locale, quotation;
138
138
  return _ts_generator(this, function(_state) {
@@ -184,7 +184,7 @@ import Details from './Details.js';
184
184
  import SubscriptionAgreementPage from './SubscriptionAgreementPage.js';
185
185
  import TermsOfUse from './TermsOfUse.js';
186
186
  import { useTranslations } from './translations.js';
187
- export var generateSubscriptionAgreementPdf = /*#__PURE__*/ function() {
187
+ export var generateSubscriptionAgreementPdf = function() {
188
188
  var _ref = _async_to_generator(function(param, fileName) {
189
189
  var _param_locale, locale, subscription;
190
190
  return _ts_generator(this, function(_state) {
package/dist/utils.js CHANGED
@@ -128,7 +128,7 @@ import ReactPDF from '@react-pdf/renderer';
128
128
  * @param document React PDF Document element
129
129
  * @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
130
130
  * @returns PDF Buffer
131
- */ export var toPdf = /*#__PURE__*/ function() {
131
+ */ export var toPdf = function() {
132
132
  var _ref = _async_to_generator(function(document, fileName) {
133
133
  var stream;
134
134
  return _ts_generator(this, function(_state) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@driveflux/pdf",
3
- "version": "1.2.28",
3
+ "version": "1.3.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -12,26 +12,26 @@
12
12
  "dist"
13
13
  ],
14
14
  "dependencies": {
15
- "@driveflux/db": "1.6.6",
16
- "@driveflux/env": "1.2.2",
17
- "@driveflux/format-money": "5.2.1",
18
- "@driveflux/time": "4.2.1",
15
+ "@driveflux/db": "1.7.0",
16
+ "@driveflux/env": "1.3.0",
17
+ "@driveflux/format-money": "5.3.0",
18
+ "@driveflux/time": "4.3.0",
19
19
  "@react-pdf/renderer": "^3.4.4",
20
20
  "date-fns": "^3.6.0",
21
- "nodemon": "^3.1.6",
21
+ "nodemon": "^3.1.4",
22
22
  "react": "^18.3.1"
23
23
  },
24
24
  "devDependencies": {
25
- "@babel/preset-env": "^7.25.4",
26
- "@driveflux/fab": "2.2.1",
27
- "@driveflux/tsconfig": "1.2.1",
28
- "@swc/cli": "0.4.1-nightly.20240914",
29
- "@swc/core": "1.7.26",
30
- "@types/node": "^22.5.5",
31
- "@types/react": "^18.3.8",
25
+ "@babel/preset-env": "^7.24.8",
26
+ "@driveflux/fab": "2.3.0",
27
+ "@driveflux/tsconfig": "1.3.0",
28
+ "@swc/cli": "^0.4.0",
29
+ "@swc/core": "1.7.2",
30
+ "@types/node": "^20.14.12",
31
+ "@types/react": "^18.3.3",
32
32
  "del-cli": "^5.1.0",
33
33
  "react": "^18.3.1",
34
- "typescript": "^5.6.2"
34
+ "typescript": "^5.5.4"
35
35
  },
36
36
  "peerDependencies": {
37
37
  "react": "^18.3.1"