@driveflux/pdf 1.0.15 → 1.1.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.
Files changed (104) 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 +1 -4
  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 +0 -14
  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/utils.d.ts +1 -1
  20. package/dist/templates/SubscriptionAgreement/utils.d.ts.map +1 -1
  21. package/dist/theme/colors.d.ts.map +1 -1
  22. package/dist/theme/colors.js +36 -36
  23. package/dist/utils.d.ts +2 -8
  24. package/dist/utils.d.ts.map +1 -1
  25. package/dist/utils.js +7 -31
  26. package/package.json +23 -20
  27. package/.eslintrc +0 -3
  28. package/.swcrc +0 -14
  29. package/.turbo/turbo-build.log +0 -6
  30. package/CHANGELOG.md +0 -186
  31. package/dist/cjs/__mocks__/quotation.js +0 -70
  32. package/dist/cjs/__mocks__/subscription.js +0 -1079
  33. package/dist/cjs/components/FluxLogo.js +0 -76
  34. package/dist/cjs/components/StandardPage.js +0 -129
  35. package/dist/cjs/debug.js +0 -234
  36. package/dist/cjs/index.js +0 -20
  37. package/dist/cjs/templates/QuotationPdf/CustomerSubscriptionSection.js +0 -155
  38. package/dist/cjs/templates/QuotationPdf/GFV.js +0 -57
  39. package/dist/cjs/templates/QuotationPdf/Header.js +0 -86
  40. package/dist/cjs/templates/QuotationPdf/Pricing.js +0 -430
  41. package/dist/cjs/templates/QuotationPdf/QuotationPdfPage.js +0 -45
  42. package/dist/cjs/templates/QuotationPdf/SectionBoxNew.js +0 -43
  43. package/dist/cjs/templates/QuotationPdf/TermsSection.js +0 -60
  44. package/dist/cjs/templates/QuotationPdf/index.js +0 -208
  45. package/dist/cjs/templates/QuotationPdf/translations.js +0 -106
  46. package/dist/cjs/templates/QuotationPdf/utils.js +0 -108
  47. package/dist/cjs/templates/SubscriptionAgreement/Confirmation.js +0 -95
  48. package/dist/cjs/templates/SubscriptionAgreement/CoverPage.js +0 -110
  49. package/dist/cjs/templates/SubscriptionAgreement/CoverPageSection.js +0 -35
  50. package/dist/cjs/templates/SubscriptionAgreement/Details.js +0 -161
  51. package/dist/cjs/templates/SubscriptionAgreement/Footer.js +0 -68
  52. package/dist/cjs/templates/SubscriptionAgreement/Header.js +0 -61
  53. package/dist/cjs/templates/SubscriptionAgreement/LabelValue.js +0 -39
  54. package/dist/cjs/templates/SubscriptionAgreement/SubscriptionAgreementPage.js +0 -48
  55. package/dist/cjs/templates/SubscriptionAgreement/TermsOfUse.js +0 -72
  56. package/dist/cjs/templates/SubscriptionAgreement/TermsOfUseSubSection.js +0 -108
  57. package/dist/cjs/templates/SubscriptionAgreement/index.js +0 -276
  58. package/dist/cjs/templates/SubscriptionAgreement/translations.js +0 -666
  59. package/dist/cjs/templates/SubscriptionAgreement/utils.js +0 -14
  60. package/dist/cjs/templates/index.js +0 -19
  61. package/dist/cjs/theme/colors.js +0 -147
  62. package/dist/cjs/theme/index.js +0 -18
  63. package/dist/cjs/types.js +0 -4
  64. package/dist/cjs/utils.js +0 -184
  65. package/dist/cjs/watch.js +0 -20
  66. package/index.cjs +0 -1
  67. package/index.d.ts +0 -1
  68. package/src/__mocks__/quotation.ts +0 -63
  69. package/src/__mocks__/subscription.ts +0 -803
  70. package/src/components/FluxLogo.tsx +0 -52
  71. package/src/components/StandardPage.tsx +0 -32
  72. package/src/debug.ts +0 -45
  73. package/src/index.ts +0 -3
  74. package/src/templates/QuotationPdf/CustomerSubscriptionSection.tsx +0 -73
  75. package/src/templates/QuotationPdf/GFV.tsx +0 -29
  76. package/src/templates/QuotationPdf/Header.tsx +0 -31
  77. package/src/templates/QuotationPdf/Pricing.tsx +0 -214
  78. package/src/templates/QuotationPdf/QuotationPdfPage.tsx +0 -25
  79. package/src/templates/QuotationPdf/SectionBoxNew.tsx +0 -20
  80. package/src/templates/QuotationPdf/TermsSection.tsx +0 -28
  81. package/src/templates/QuotationPdf/index.tsx +0 -46
  82. package/src/templates/QuotationPdf/translations.ts +0 -84
  83. package/src/templates/QuotationPdf/utils.ts +0 -59
  84. package/src/templates/SubscriptionAgreement/Confirmation.tsx +0 -49
  85. package/src/templates/SubscriptionAgreement/CoverPage.tsx +0 -52
  86. package/src/templates/SubscriptionAgreement/CoverPageSection.tsx +0 -25
  87. package/src/templates/SubscriptionAgreement/Details.tsx +0 -127
  88. package/src/templates/SubscriptionAgreement/Footer.tsx +0 -37
  89. package/src/templates/SubscriptionAgreement/Header.tsx +0 -37
  90. package/src/templates/SubscriptionAgreement/LabelValue.tsx +0 -19
  91. package/src/templates/SubscriptionAgreement/SubscriptionAgreementPage.tsx +0 -24
  92. package/src/templates/SubscriptionAgreement/TermsOfUse.tsx +0 -30
  93. package/src/templates/SubscriptionAgreement/TermsOfUseSubSection.tsx +0 -44
  94. package/src/templates/SubscriptionAgreement/index.tsx +0 -66
  95. package/src/templates/SubscriptionAgreement/translations.ts +0 -664
  96. package/src/templates/SubscriptionAgreement/utils.ts +0 -7
  97. package/src/templates/index.ts +0 -2
  98. package/src/theme/colors.ts +0 -180
  99. package/src/theme/index.ts +0 -1
  100. package/src/types.ts +0 -1
  101. package/src/utils.ts +0 -27
  102. package/src/watch.ts +0 -16
  103. package/tsconfig.json +0 -13
  104. package/tsconfig.tsbuildinfo +0 -1
@@ -1,3 +1,3 @@
1
- import { Quotation } from '@driveflux/db';
1
+ import type { Quotation } from '@driveflux/db';
2
2
  export declare const quotation: Quotation;
3
3
  //# sourceMappingURL=quotation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"quotation.d.ts","sourceRoot":"","sources":["../../src/__mocks__/quotation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAEzC,eAAO,MAAM,SAAS,EAAE,SA4DvB,CAAA"}
1
+ {"version":3,"file":"quotation.d.ts","sourceRoot":"","sources":["../../src/__mocks__/quotation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE9C,eAAO,MAAM,SAAS,EAAE,SA2DvB,CAAA"}
@@ -53,8 +53,7 @@ export var quotation = {
53
53
  couponCode: null,
54
54
  discountAmount: null,
55
55
  appliedDiscountId: null,
56
- couponType: '',
57
- excessMileageFee: 3.8
56
+ couponType: ''
58
57
  },
59
58
  quotationPdf: null
60
59
  };
@@ -1,3 +1,3 @@
1
- import { SubscriptionForAgreement } from '../templates';
1
+ import type { SubscriptionForAgreement } from '../templates';
2
2
  export declare const subscription: SubscriptionForAgreement;
3
3
  //# sourceMappingURL=subscription.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"subscription.d.ts","sourceRoot":"","sources":["../../src/__mocks__/subscription.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAA;AAEvD,eAAO,MAAM,YAAY,EAAE,wBAgyB1B,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,wBA0zB1B,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"CustomerSubscriptionSection.d.ts","sourceRoot":"","sources":["../../../src/templates/QuotationPdf/CustomerSubscriptionSection.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAGzC,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAG1B,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAG3D,KAAK,KAAK,GAAG;IACX,SAAS,EAAE,SAAS,CAAA;IACpB,CAAC,EAAE,uBAAuB,CAAA;CAC3B,CAAA;AAED,QAAA,MAAM,2BAA2B,EAAE,EAAE,CAAC,KAAK,CAwD1C,CAAA;AAED,eAAe,2BAA2B,CAAA"}
1
+ {"version":3,"file":"CustomerSubscriptionSection.d.ts","sourceRoot":"","sources":["../../../src/templates/QuotationPdf/CustomerSubscriptionSection.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAGzC,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAG1B,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAG3D,KAAK,KAAK,GAAG;IACX,SAAS,EAAE,SAAS,CAAA;IACpB,CAAC,EAAE,uBAAuB,CAAA;CAC3B,CAAA;AAED,QAAA,MAAM,2BAA2B,EAAE,EAAE,CAAC,KAAK,CAgD1C,CAAA;AAED,eAAe,2BAA2B,CAAA"}
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
2
2
  import { Text, View } from '@react-pdf/renderer';
3
3
  import { colors } from '../../theme/colors.js';
4
4
  import SectionBoxNew from './SectionBoxNew.js';
5
- import { formatAddress, getFullMileagePackageTranslation, getSimplifiedPlanTranslation } from './utils.js';
5
+ import { formatAddress, getMileagePackageTranslation, getSimplifiedPlanTranslation } from './utils.js';
6
6
  var CustomerSubscriptionSection = function(param) {
7
7
  var quotation = param.quotation, t = param.t;
8
8
  var displayContent = function(label, value) {
@@ -80,7 +80,7 @@ var CustomerSubscriptionSection = function(param) {
80
80
  },
81
81
  children: [
82
82
  displayContent(t.subscription.plan, getSimplifiedPlanTranslation(quotation.plan)),
83
- displayContent(t.subscription.mileagePackage, getFullMileagePackageTranslation(quotation.mileagePackage))
83
+ displayContent(t.subscription.mileagePackage, getMileagePackageTranslation(quotation.mileagePackage))
84
84
  ]
85
85
  })
86
86
  ]
@@ -121,14 +121,6 @@ var CustomerSubscriptionSection = function(param) {
121
121
  })
122
122
  ]
123
123
  }, i);
124
- }),
125
- quotation.mileagePackage !== 'unlimited' && /*#__PURE__*/ _jsx(Text, {
126
- style: {
127
- fontSize: '9px',
128
- color: colors.primary3,
129
- letterSpacing: 1
130
- },
131
- children: t.subIncludes.excessMileage(quotation.fees.excessMileageFee || 0)
132
124
  })
133
125
  ]
134
126
  })
@@ -4,6 +4,6 @@ type Options = {
4
4
  locale?: PdfTemplatesSupportedLocales;
5
5
  quotation: Quotation;
6
6
  };
7
- export declare const generateQuotationPdf: ({ locale, quotation }: Options, fileName?: string) => Promise<Buffer>;
7
+ export declare const generateQuotationPdf: ({ locale, quotation }: Options, fileName: string) => Promise<void>;
8
8
  export {};
9
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/QuotationPdf/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAGzC,OAAO,EAAE,4BAA4B,EAAE,MAAM,gBAAgB,CAAA;AAc7D,KAAK,OAAO,GAAG;IACb,MAAM,CAAC,EAAE,4BAA4B,CAAA;IACrC,SAAS,EAAE,SAAS,CAAA;CACrB,CAAA;AAED,eAAO,MAAM,oBAAoB,0BAAwC,OAAO,aAAa,MAAM,oBAElG,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/QuotationPdf/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAGzC,OAAO,EAAE,4BAA4B,EAAE,MAAM,gBAAgB,CAAA;AAc7D,KAAK,OAAO,GAAG;IACb,MAAM,CAAC,EAAE,4BAA4B,CAAA;IACrC,SAAS,EAAE,SAAS,CAAA;CACrB,CAAA;AAED,eAAO,MAAM,oBAAoB,0BAAwC,OAAO,YAAY,MAAM,kBAEjG,CAAA"}
@@ -16,7 +16,6 @@ declare const enTranslation: {
16
16
  subIncludes: {
17
17
  title: string;
18
18
  content: string[];
19
- excessMileage: (excessMileage: number) => string;
20
19
  };
21
20
  pricing: {
22
21
  title: string;
@@ -1 +1 @@
1
- {"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/templates/QuotationPdf/translations.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;uCA6BgB,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6CxC,CAAA;AAED,MAAM,MAAM,uBAAuB,GAAG,OAAO,aAAa,CAAA;AAE1D,eAAO,MAAM,eAAe,WAAY,IAAI,KAAG,uBAK9C,CAAA"}
1
+ {"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/templates/QuotationPdf/translations.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwElB,CAAA;AAED,MAAM,MAAM,uBAAuB,GAAG,OAAO,aAAa,CAAA;AAE1D,eAAO,MAAM,eAAe,WAAY,IAAI,KAAG,uBAK9C,CAAA"}
@@ -26,10 +26,7 @@ var enTranslation = {
26
26
  "Theft recovery services",
27
27
  "Independently rated vehicle inspection",
28
28
  "Option to purchase the vehicle at the end of the subscription"
29
- ],
30
- excessMileage: function(excessMileage) {
31
- return "*If usage exceeds chosen mileage package, excess mileage fees for this vehicle is RM".concat(excessMileage, " per KM.");
32
- }
29
+ ]
33
30
  },
34
31
  pricing: {
35
32
  title: "Pricing",
@@ -1,7 +1,6 @@
1
- import { MileagePackage, PlanType } from '@driveflux/db';
2
- import { Address } from '@driveflux/db/types';
1
+ import type { MileagePackage, PlanType } from '@driveflux/db';
2
+ import type { Address } from '@driveflux/db/types';
3
3
  export declare const formatAddress: (originalAddress: Address) => string;
4
4
  export declare const getSimplifiedPlanTranslation: (plan: PlanType) => "60 Months" | "36 Months" | "24 Months" | "12 Months" | "Monthly" | "Weekly" | "Unknown Plan";
5
- export declare const getMileagePackageTranslation: (mileagePackage?: MileagePackage) => "Unlimited" | "Unknown Mileage Package" | "Lite" | "Standard" | "Plus";
6
- export declare const getFullMileagePackageTranslation: (plan?: MileagePackage | null) => "Lite - 1,250KM" | "Standard - 2,000KM" | "Plus - 2,750KM" | "Unlimited" | "Unknown Mileage Package";
5
+ export declare const getMileagePackageTranslation: (mileagePackage?: MileagePackage) => "Lite" | "Standard" | "Plus" | "Unlimited" | "Unknown Mileage Package";
7
6
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/templates/QuotationPdf/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAE7C,eAAO,MAAM,aAAa,oBAAqB,OAAO,WAMrD,CAAA;AAED,eAAO,MAAM,4BAA4B,SAAU,QAAQ,kGAiB1D,CAAA;AAED,eAAO,MAAM,4BAA4B,oBAAqB,cAAc,2EAa3E,CAAA;AAED,eAAO,MAAM,gCAAgC,UAAW,cAAc,GAAG,IAAI,yGAa5E,CAAA"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/templates/QuotationPdf/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAC7D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAElD,eAAO,MAAM,aAAa,oBAAqB,OAAO,WAMrD,CAAA;AAED,eAAO,MAAM,4BAA4B,SAAU,QAAQ,kGAiB1D,CAAA;AAED,eAAO,MAAM,4BAA4B,oBACvB,cAAc,2EAc/B,CAAA"}
@@ -68,17 +68,3 @@ export var getMileagePackageTranslation = function(mileagePackage) {
68
68
  return "Unknown Mileage Package";
69
69
  }
70
70
  };
71
- export var getFullMileagePackageTranslation = function(plan) {
72
- switch(plan){
73
- case 'lite':
74
- return "Lite - 1,250KM";
75
- case 'standard':
76
- return "Standard - 2,000KM";
77
- case 'plus':
78
- return "Plus - 2,750KM";
79
- case 'unlimited':
80
- return "Unlimited";
81
- default:
82
- return "Unknown Mileage Package";
83
- }
84
- };
@@ -9,6 +9,6 @@ type Options = {
9
9
  locale?: PdfTemplatesSupportedLocales;
10
10
  subscription: SubscriptionForAgreement;
11
11
  };
12
- export declare const generateSubscriptionAgreementPdf: ({ locale, subscription }: Options, fileName?: string) => Promise<Buffer>;
12
+ export declare const generateSubscriptionAgreementPdf: ({ locale, subscription }: Options, fileName: string) => Promise<void>;
13
13
  export {};
14
14
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/SubscriptionAgreement/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAoB,YAAY,EAAE,oBAAoB,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAGnG,OAAO,EAAE,4BAA4B,EAAE,MAAM,gBAAgB,CAAA;AAS7D,MAAM,MAAM,wBAAwB,GAAG,YAAY,GAAG;IACpD,IAAI,EAAE,IAAI,CAAA;IACV,OAAO,EAAE,OAAO,CAAA;IAChB,QAAQ,CAAC,EAAE,oBAAoB,GAAG,IAAI,CAAA;CACvC,CAAA;AAED,KAAK,OAAO,GAAG;IACb,MAAM,CAAC,EAAE,4BAA4B,CAAA;IACrC,YAAY,EAAE,wBAAwB,CAAA;CACvC,CAAA;AACD,eAAO,MAAM,gCAAgC,6BAA2C,OAAO,aAAa,MAAM,oBAQjH,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/SubscriptionAgreement/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAoB,YAAY,EAAE,oBAAoB,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAGnG,OAAO,EAAE,4BAA4B,EAAE,MAAM,gBAAgB,CAAA;AAS7D,MAAM,MAAM,wBAAwB,GAAG,YAAY,GAAG;IACpD,IAAI,EAAE,IAAI,CAAA;IACV,OAAO,EAAE,OAAO,CAAA;IAChB,QAAQ,CAAC,EAAE,oBAAoB,GAAG,IAAI,CAAA;CACvC,CAAA;AAED,KAAK,OAAO,GAAG;IACb,MAAM,CAAC,EAAE,4BAA4B,CAAA;IACrC,YAAY,EAAE,wBAAwB,CAAA;CACvC,CAAA;AACD,eAAO,MAAM,gCAAgC,6BAA2C,OAAO,YAAY,MAAM,kBAQhH,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/templates/SubscriptionAgreement/translations.ts"],"names":[],"mappings":"AACA,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kCAwoBW,QAAQ,GAAG,UAAU;;;;;CAMlD,CAAA;AACD,MAAM,MAAM,gCAAgC,GAAG,OAAO,aAAa,CAAA;AAEnE,eAAO,MAAM,eAAe,WAAY,IAAI,KAAG,gCAK9C,CAAA"}
1
+ {"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/templates/SubscriptionAgreement/translations.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kCAyoBS,QAAQ,GAAG,UAAU;;;;;CAMhD,CAAA;AACD,MAAM,MAAM,gCAAgC,GAAG,OAAO,aAAa,CAAA;AAEnE,eAAO,MAAM,eAAe,WACnB,IAAI,KACV,gCAKF,CAAA"}
@@ -1,3 +1,3 @@
1
- import { UserIdentification } from '@driveflux/db';
1
+ import type { UserIdentification } from '@driveflux/db';
2
2
  export declare const formatIdentification: (identification?: UserIdentification | null) => string;
3
3
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/templates/SubscriptionAgreement/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAElD,eAAO,MAAM,oBAAoB,oBAAqB,kBAAkB,GAAG,IAAI,WAI9E,CAAA"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/templates/SubscriptionAgreement/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAEvD,eAAO,MAAM,oBAAoB,oBACf,kBAAkB,GAAG,IAAI,WAK1C,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../src/theme/colors.ts"],"names":[],"mappings":"AAIE,eAAO,MAAM,MAAM;IACjB;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsFJ,CAAA"}
1
+ {"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../src/theme/colors.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,MAAM;IAClB;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsFH,CAAA"}
@@ -3,59 +3,59 @@
3
3
  // update all instances using colors
4
4
  export var colors = {
5
5
  /**
6
- * #EFEFF0 Light Gray
7
- */ primary1: '#EFEFF0',
6
+ * #EFEFF0 Light Gray
7
+ */ primary1: '#EFEFF0',
8
8
  /**
9
- * #CACACA Gray
10
- */ primary2: '#CACACA',
9
+ * #CACACA Gray
10
+ */ primary2: '#CACACA',
11
11
  /**
12
- * #585858 Dark Gray
13
- */ primary3: '#585858',
12
+ * #585858 Dark Gray
13
+ */ primary3: '#585858',
14
14
  /**
15
- * #191919 Soft Black
16
- */ primary4: '#191919',
15
+ * #191919 Soft Black
16
+ */ primary4: '#191919',
17
17
  /**
18
- * #E55867 Red
19
- */ accent4: '#E55867',
18
+ * #E55867 Red
19
+ */ accent4: '#E55867',
20
20
  /**
21
- * #ADE0EE Light Blue
22
- */ links2: '#ADE0EE',
21
+ * #ADE0EE Light Blue
22
+ */ links2: '#ADE0EE',
23
23
  /**
24
- * #50C8E8 Blue
25
- */ links: '#50C8E8',
24
+ * #50C8E8 Blue
25
+ */ links: '#50C8E8',
26
26
  /**
27
- * #E24657 Red
28
- */ alert4: '#E24657',
27
+ * #E24657 Red
28
+ */ alert4: '#E24657',
29
29
  /**
30
- * #E24657 Red
31
- */ danger: '#E24657',
30
+ * #E24657 Red
31
+ */ danger: '#E24657',
32
32
  /**
33
- * #F4B25C Yellow
34
- */ warning4: '#F4B25C',
33
+ * #F4B25C Yellow
34
+ */ warning4: '#F4B25C',
35
35
  /**
36
- * #4FD9C2 Green
37
- */ success4: '#4FD9C2',
36
+ * #4FD9C2 Green
37
+ */ success4: '#4FD9C2',
38
38
  /**
39
- * #4FD9C2 Green
40
- */ green: '#4FD9C2',
39
+ * #4FD9C2 Green
40
+ */ green: '#4FD9C2',
41
41
  /**
42
- * #3BD5BC Green
43
- */ // green: '#3BD5BC',
42
+ * #3BD5BC Green
43
+ */ // green: '#3BD5BC',
44
44
  /**
45
- * #000000 Black
46
- */ black: '#000000',
45
+ * #000000 Black
46
+ */ black: '#000000',
47
47
  /**
48
- * #ffffff White
49
- */ white: '#ffffff',
48
+ * #ffffff White
49
+ */ white: '#ffffff',
50
50
  /**
51
- * #E6E6E6 Light Gray
52
- */ whiteHover: '#E6E6E6',
51
+ * #E6E6E6 Light Gray
52
+ */ whiteHover: '#E6E6E6',
53
53
  /**
54
- * #F4F4F4 Light Gray
55
- */ placeholder: '#F4F4F4',
54
+ * #F4F4F4 Light Gray
55
+ */ placeholder: '#F4F4F4',
56
56
  /**
57
- * #F9F7D7 Light Yellow
58
- */ highlight: '#F9F7D7',
57
+ * #F9F7D7 Light Yellow
58
+ */ highlight: '#F9F7D7',
59
59
  primary: {
60
60
  25: '#fafafa',
61
61
  50: '#d6f5f0',
package/dist/utils.d.ts CHANGED
@@ -1,10 +1,4 @@
1
1
  import type { DocumentProps } from '@react-pdf/renderer';
2
- import { ReactElement } from 'react';
3
- /**
4
- *
5
- * @param document React PDF Document element
6
- * @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
7
- * @returns PDF Buffer
8
- */
9
- export declare const toPdf: (document: ReactElement<DocumentProps>, fileName?: string) => Promise<Buffer>;
2
+ import type { ReactElement } from 'react';
3
+ export declare const toPdf: (document: ReactElement<DocumentProps>, fileName: string) => Promise<void>;
10
4
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAExD,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AAEpC;;;;;GAKG;AACH,eAAO,MAAM,KAAK,aAAoB,YAAY,CAAC,aAAa,CAAC,aAAa,MAAM,KAAG,OAAO,CAAC,MAAM,CAgBpG,CAAA"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAExD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AAEzC,eAAO,MAAM,KAAK,aACP,YAAY,CAAC,aAAa,CAAC,YAC3B,MAAM,kBAMhB,CAAA"}
package/dist/utils.js CHANGED
@@ -123,47 +123,23 @@ function _ts_generator(thisArg, body) {
123
123
  }
124
124
  }
125
125
  import ReactPDF from '@react-pdf/renderer';
126
- /**
127
- *
128
- * @param document React PDF Document element
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
- * @returns PDF Buffer
131
- */ export var toPdf = function() {
126
+ export var toPdf = function() {
132
127
  var _ref = _async_to_generator(function(document, fileName) {
133
- var stream;
128
+ var pdfStream;
134
129
  return _ts_generator(this, function(_state) {
135
130
  switch(_state.label){
136
131
  case 0:
137
- if (!!!fileName) return [
138
- 3,
139
- 2
140
- ];
141
132
  return [
142
133
  4,
143
134
  ReactPDF.renderToFile(document, fileName)
144
135
  ];
145
136
  case 1:
146
- _state.sent();
147
- _state.label = 2;
148
- case 2:
149
- return [
150
- 4,
151
- ReactPDF.renderToStream(document)
152
- ];
153
- case 3:
154
- stream = _state.sent();
137
+ pdfStream = _state.sent();
138
+ pdfStream.on('end', function() {
139
+ console.log("Generated PDF to ".concat(fileName));
140
+ });
155
141
  return [
156
- 2,
157
- new Promise(function(resolve, reject) {
158
- var buffers = [];
159
- stream.on('data', function(data) {
160
- buffers.push(data);
161
- });
162
- stream.on('end', function() {
163
- resolve(Buffer.concat(buffers));
164
- });
165
- stream.on('error', reject);
166
- })
142
+ 2
167
143
  ];
168
144
  }
169
145
  });
package/package.json CHANGED
@@ -1,23 +1,20 @@
1
1
  {
2
2
  "name": "@driveflux/pdf",
3
- "version": "1.0.15",
3
+ "version": "1.1.0",
4
4
  "type": "module",
5
- "main": "./dist/cjs/index.js",
6
- "module": "./dist/index.js",
7
- "types": "./dist/index.d.ts",
8
5
  "exports": {
9
6
  ".": {
10
7
  "import": "./dist/index.js",
11
- "require": "./dist/cjs/index.js",
12
8
  "types": "./dist/index.d.ts"
13
9
  }
14
10
  },
15
11
  "dependencies": {
16
- "@driveflux/db": "1.2.9",
17
- "@driveflux/env": "1.0.10",
18
- "@driveflux/time": "4.0.9",
19
- "@driveflux/format-money": "5.0.10",
12
+ "@driveflux/db": "1.3.0",
13
+ "@driveflux/env": "1.1.0",
14
+ "@driveflux/format-money": "5.1.0",
15
+ "@driveflux/time": "4.1.0",
20
16
  "@react-pdf/renderer": "^3.4.4",
17
+ "date-fns": "^3.6.0",
21
18
  "nodemon": "^3.1.4",
22
19
  "react": "^18.3.1"
23
20
  },
@@ -26,24 +23,30 @@
26
23
  },
27
24
  "devDependencies": {
28
25
  "@babel/preset-env": "^7.24.7",
29
- "@driveflux/eslint-config": "1.0.9",
30
- "@driveflux/fab": "1.0.10",
31
- "@driveflux/tsconfig": "1.0.2",
32
- "@swc/cli": "^0.3.14",
33
- "@swc/core": "1.6.5",
34
- "@types/node": "^20.14.8",
35
- "react": "^18.3.1",
26
+ "@driveflux/fab": "2.1.0",
27
+ "@driveflux/tsconfig": "1.1.0",
28
+ "@swc/cli": "^0.4.0",
29
+ "@swc/core": "1.6.13",
30
+ "@types/node": "^20.14.10",
36
31
  "@types/react": "^18.3.3",
37
32
  "del-cli": "^5.1.0",
38
- "eslint": "9.5.0",
39
- "typescript": "^5.5.2"
33
+ "react": "^18.3.1",
34
+ "typescript": "^5.5.3"
40
35
  },
36
+ "files": [
37
+ "dist"
38
+ ],
41
39
  "scripts": {
42
40
  "build": "fab",
43
41
  "debug": "pnpm build && node dist/debug.js",
44
42
  "dev": "pnpm debug && node dist/watch.js",
45
43
  "clean": "fab clean",
46
- "types": "tsc --noEmit",
47
- "lint": "eslint \"src/**/*.ts\""
44
+ "build:js": "fab -t esm",
45
+ "build:types": "fab -t types",
46
+ "type-check": "tsc --noEmit",
47
+ "check": "biome check --write ./src",
48
+ "lint:errors": "pnpm lint --diagnostic-level error",
49
+ "format": "biome format --write ./src",
50
+ "lint": "biome lint --write --unsafe ./src"
48
51
  }
49
52
  }
package/.eslintrc DELETED
@@ -1,3 +0,0 @@
1
- {
2
- "extends": ["@driveflux/eslint-config/next.esm.js"]
3
- }
package/.swcrc DELETED
@@ -1,14 +0,0 @@
1
- {
2
- "jsc": {
3
- "parser": {
4
- "syntax": "typescript",
5
- "decorators": true,
6
- "tsx": true
7
- },
8
- "transform": {
9
- "react": {
10
- "runtime": "automatic"
11
- }
12
- }
13
- }
14
- }
@@ -1,6 +0,0 @@
1
-
2
- > @driveflux/pdf@1.0.14 build /Users/flux/Projects/flux-develop/shared/pdf
3
- > fab
4
-
5
- Successfully compiled: 35 files with swc (302.65ms)
6
- Successfully compiled: 35 files with swc (306.11ms)
package/CHANGELOG.md DELETED
@@ -1,186 +0,0 @@
1
- # @driveflux/frontend-pdf
2
-
3
- ## 1.0.15
4
-
5
- ### Patch Changes
6
-
7
- - Updated dependencies
8
- - @driveflux/db@1.2.9
9
-
10
- ## 1.0.14
11
-
12
- ### Patch Changes
13
-
14
- - Updated dependencies
15
- - @driveflux/db@1.2.8
16
-
17
- ## 1.0.13
18
-
19
- ### Patch Changes
20
-
21
- - @driveflux/db@1.2.7
22
-
23
- ## 1.0.12
24
-
25
- ### Patch Changes
26
-
27
- - Updated dependencies
28
- - @driveflux/db@1.2.6
29
-
30
- ## 1.0.11
31
-
32
- ### Patch Changes
33
-
34
- - Versions and dependencies fixes
35
- - Updated dependencies
36
- - @driveflux/format-money@5.0.10
37
- - @driveflux/time@4.0.9
38
- - @driveflux/env@1.0.10
39
- - @driveflux/db@1.2.5
40
-
41
- ## 1.0.10
42
-
43
- ### Patch Changes
44
-
45
- - Minor adjustments for deps
46
- - Upgraded packages
47
- - Updated dependencies
48
- - Updated dependencies
49
- - @driveflux/format-money@5.0.9
50
- - @driveflux/time@4.0.8
51
- - @driveflux/env@1.0.9
52
- - @driveflux/db@1.2.4
53
-
54
- ## 1.0.9
55
-
56
- ### Patch Changes
57
-
58
- - Updated dependencies
59
- - @driveflux/db@1.2.3
60
-
61
- ## 1.0.8
62
-
63
- ### Patch Changes
64
-
65
- - Minor updates on build
66
- - Updated dependencies
67
- - @driveflux/time@4.0.7
68
- - @driveflux/env@1.0.8
69
- - @driveflux/db@1.2.2
70
-
71
- ## 1.0.7
72
-
73
- ### Patch Changes
74
-
75
- - Upgraded all packages
76
- - Updated dependencies
77
- - @driveflux/time@4.0.6
78
- - @driveflux/env@1.0.7
79
- - @driveflux/db@1.2.1
80
- - Add mileage value in Quotation PDF
81
-
82
- ## 1.0.6
83
-
84
- ### Patch Changes
85
-
86
- - Updated dependencies
87
- - @driveflux/db@1.2.0
88
-
89
- ## 1.0.5
90
-
91
- ### Patch Changes
92
-
93
- - Updated dependencies
94
- - @driveflux/db@1.1.0
95
-
96
- ## 1.0.4
97
-
98
- ### Patch Changes
99
-
100
- - Updates
101
- - Updated dependencies
102
- - @driveflux/db@1.0.39
103
-
104
- ## 1.0.3
105
-
106
- ### Patch Changes
107
-
108
- - Updates
109
- - Updated dependencies
110
- - @driveflux/db@1.0.38
111
-
112
- ## 1.0.2
113
-
114
- ### Patch Changes
115
-
116
- - Updates
117
- - Updated dependencies
118
- - @driveflux/db@1.0.37
119
-
120
- ## 1.0.1
121
-
122
- ### Patch Changes
123
-
124
- - General updates
125
- - Updated dependencies
126
- - @driveflux/db@1.0.36
127
-
128
- ## 1.0.5
129
-
130
- ### Patch Changes
131
-
132
- - Upgraded packages again
133
-
134
- ## 1.0.4
135
-
136
- ### Patch Changes
137
-
138
- - Upgraded packages
139
-
140
- ## 1.0.3
141
-
142
- ### Patch Changes
143
-
144
- - Reverted SWC core version
145
-
146
- ## 1.0.2
147
-
148
- ### Patch Changes
149
-
150
- - Updated dependencies
151
-
152
- ## 1.0.1
153
-
154
- ### Patch Changes
155
-
156
- - Bump versions
157
-
158
- ## 1.0.0
159
-
160
- ### Major Changes
161
-
162
- - 4.5 pre-release
163
-
164
- ### Patch Changes
165
-
166
- - verion bump + minor improvements
167
- - Bump all versions
168
- - Version bump
169
-
170
- ## 1.0.0-next.2
171
-
172
- ### Patch Changes
173
-
174
- - Version bump
175
-
176
- ## 1.0.0-next.1
177
-
178
- ### Patch Changes
179
-
180
- - verion bump + minor improvements
181
-
182
- ## 1.0.0-next.0
183
-
184
- ### Major Changes
185
-
186
- - 4.5 pre-release