@driveflux/pdf 1.0.14 → 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 (100) 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__/subscription.d.ts +1 -1
  4. package/dist/__mocks__/subscription.d.ts.map +1 -1
  5. package/dist/templates/QuotationPdf/CustomerSubscriptionSection.d.ts.map +1 -1
  6. package/dist/templates/QuotationPdf/CustomerSubscriptionSection.js +2 -2
  7. package/dist/templates/QuotationPdf/index.d.ts +1 -1
  8. package/dist/templates/QuotationPdf/index.d.ts.map +1 -1
  9. package/dist/templates/QuotationPdf/utils.d.ts +2 -3
  10. package/dist/templates/QuotationPdf/utils.d.ts.map +1 -1
  11. package/dist/templates/QuotationPdf/utils.js +0 -14
  12. package/dist/templates/SubscriptionAgreement/index.d.ts +1 -1
  13. package/dist/templates/SubscriptionAgreement/index.d.ts.map +1 -1
  14. package/dist/templates/SubscriptionAgreement/translations.d.ts.map +1 -1
  15. package/dist/templates/SubscriptionAgreement/utils.d.ts +1 -1
  16. package/dist/templates/SubscriptionAgreement/utils.d.ts.map +1 -1
  17. package/dist/theme/colors.d.ts.map +1 -1
  18. package/dist/theme/colors.js +36 -36
  19. package/dist/utils.d.ts +2 -8
  20. package/dist/utils.d.ts.map +1 -1
  21. package/dist/utils.js +7 -31
  22. package/package.json +23 -20
  23. package/.eslintrc +0 -3
  24. package/.swcrc +0 -14
  25. package/.turbo/turbo-build.log +0 -6
  26. package/CHANGELOG.md +0 -179
  27. package/dist/cjs/__mocks__/quotation.js +0 -69
  28. package/dist/cjs/__mocks__/subscription.js +0 -1079
  29. package/dist/cjs/components/FluxLogo.js +0 -76
  30. package/dist/cjs/components/StandardPage.js +0 -129
  31. package/dist/cjs/debug.js +0 -234
  32. package/dist/cjs/index.js +0 -20
  33. package/dist/cjs/templates/QuotationPdf/CustomerSubscriptionSection.js +0 -147
  34. package/dist/cjs/templates/QuotationPdf/GFV.js +0 -57
  35. package/dist/cjs/templates/QuotationPdf/Header.js +0 -86
  36. package/dist/cjs/templates/QuotationPdf/Pricing.js +0 -430
  37. package/dist/cjs/templates/QuotationPdf/QuotationPdfPage.js +0 -45
  38. package/dist/cjs/templates/QuotationPdf/SectionBoxNew.js +0 -43
  39. package/dist/cjs/templates/QuotationPdf/TermsSection.js +0 -60
  40. package/dist/cjs/templates/QuotationPdf/index.js +0 -208
  41. package/dist/cjs/templates/QuotationPdf/translations.js +0 -103
  42. package/dist/cjs/templates/QuotationPdf/utils.js +0 -108
  43. package/dist/cjs/templates/SubscriptionAgreement/Confirmation.js +0 -95
  44. package/dist/cjs/templates/SubscriptionAgreement/CoverPage.js +0 -110
  45. package/dist/cjs/templates/SubscriptionAgreement/CoverPageSection.js +0 -35
  46. package/dist/cjs/templates/SubscriptionAgreement/Details.js +0 -161
  47. package/dist/cjs/templates/SubscriptionAgreement/Footer.js +0 -68
  48. package/dist/cjs/templates/SubscriptionAgreement/Header.js +0 -61
  49. package/dist/cjs/templates/SubscriptionAgreement/LabelValue.js +0 -39
  50. package/dist/cjs/templates/SubscriptionAgreement/SubscriptionAgreementPage.js +0 -48
  51. package/dist/cjs/templates/SubscriptionAgreement/TermsOfUse.js +0 -72
  52. package/dist/cjs/templates/SubscriptionAgreement/TermsOfUseSubSection.js +0 -108
  53. package/dist/cjs/templates/SubscriptionAgreement/index.js +0 -276
  54. package/dist/cjs/templates/SubscriptionAgreement/translations.js +0 -666
  55. package/dist/cjs/templates/SubscriptionAgreement/utils.js +0 -14
  56. package/dist/cjs/templates/index.js +0 -19
  57. package/dist/cjs/theme/colors.js +0 -147
  58. package/dist/cjs/theme/index.js +0 -18
  59. package/dist/cjs/types.js +0 -4
  60. package/dist/cjs/utils.js +0 -184
  61. package/dist/cjs/watch.js +0 -20
  62. package/index.cjs +0 -1
  63. package/index.d.ts +0 -1
  64. package/src/__mocks__/quotation.ts +0 -62
  65. package/src/__mocks__/subscription.ts +0 -803
  66. package/src/components/FluxLogo.tsx +0 -52
  67. package/src/components/StandardPage.tsx +0 -32
  68. package/src/debug.ts +0 -45
  69. package/src/index.ts +0 -3
  70. package/src/templates/QuotationPdf/CustomerSubscriptionSection.tsx +0 -68
  71. package/src/templates/QuotationPdf/GFV.tsx +0 -29
  72. package/src/templates/QuotationPdf/Header.tsx +0 -31
  73. package/src/templates/QuotationPdf/Pricing.tsx +0 -214
  74. package/src/templates/QuotationPdf/QuotationPdfPage.tsx +0 -25
  75. package/src/templates/QuotationPdf/SectionBoxNew.tsx +0 -20
  76. package/src/templates/QuotationPdf/TermsSection.tsx +0 -28
  77. package/src/templates/QuotationPdf/index.tsx +0 -46
  78. package/src/templates/QuotationPdf/translations.ts +0 -82
  79. package/src/templates/QuotationPdf/utils.ts +0 -59
  80. package/src/templates/SubscriptionAgreement/Confirmation.tsx +0 -49
  81. package/src/templates/SubscriptionAgreement/CoverPage.tsx +0 -52
  82. package/src/templates/SubscriptionAgreement/CoverPageSection.tsx +0 -25
  83. package/src/templates/SubscriptionAgreement/Details.tsx +0 -127
  84. package/src/templates/SubscriptionAgreement/Footer.tsx +0 -37
  85. package/src/templates/SubscriptionAgreement/Header.tsx +0 -37
  86. package/src/templates/SubscriptionAgreement/LabelValue.tsx +0 -19
  87. package/src/templates/SubscriptionAgreement/SubscriptionAgreementPage.tsx +0 -24
  88. package/src/templates/SubscriptionAgreement/TermsOfUse.tsx +0 -30
  89. package/src/templates/SubscriptionAgreement/TermsOfUseSubSection.tsx +0 -44
  90. package/src/templates/SubscriptionAgreement/index.tsx +0 -66
  91. package/src/templates/SubscriptionAgreement/translations.ts +0 -664
  92. package/src/templates/SubscriptionAgreement/utils.ts +0 -7
  93. package/src/templates/index.ts +0 -2
  94. package/src/theme/colors.ts +0 -180
  95. package/src/theme/index.ts +0 -1
  96. package/src/types.ts +0 -1
  97. package/src/utils.ts +0 -27
  98. package/src/watch.ts +0 -16
  99. package/tsconfig.json +0 -13
  100. 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,SA2DvB,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"}
@@ -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,CAmD1C,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
  ]
@@ -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"}
@@ -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
5
  export declare const getMileagePackageTranslation: (mileagePackage?: MileagePackage) => "Lite" | "Standard" | "Plus" | "Unlimited" | "Unknown Mileage Package";
6
- export declare const getFullMileagePackageTranslation: (plan?: MileagePackage | null) => "Unlimited" | "Unknown Mileage Package" | "Lite - 1,250KM" | "Standard - 2,000KM" | "Plus - 2,750KM";
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.14",
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.8",
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/abood/WebstormProjects/flux/shared/pdf
3
- > fab
4
-
5
- Successfully compiled: 35 files with swc (249.96ms)
6
- Successfully compiled: 35 files with swc (243.82ms)
package/CHANGELOG.md DELETED
@@ -1,179 +0,0 @@
1
- # @driveflux/frontend-pdf
2
-
3
- ## 1.0.14
4
-
5
- ### Patch Changes
6
-
7
- - Updated dependencies
8
- - @driveflux/db@1.2.8
9
-
10
- ## 1.0.13
11
-
12
- ### Patch Changes
13
-
14
- - @driveflux/db@1.2.7
15
-
16
- ## 1.0.12
17
-
18
- ### Patch Changes
19
-
20
- - Updated dependencies
21
- - @driveflux/db@1.2.6
22
-
23
- ## 1.0.11
24
-
25
- ### Patch Changes
26
-
27
- - Versions and dependencies fixes
28
- - Updated dependencies
29
- - @driveflux/format-money@5.0.10
30
- - @driveflux/time@4.0.9
31
- - @driveflux/env@1.0.10
32
- - @driveflux/db@1.2.5
33
-
34
- ## 1.0.10
35
-
36
- ### Patch Changes
37
-
38
- - Minor adjustments for deps
39
- - Upgraded packages
40
- - Updated dependencies
41
- - Updated dependencies
42
- - @driveflux/format-money@5.0.9
43
- - @driveflux/time@4.0.8
44
- - @driveflux/env@1.0.9
45
- - @driveflux/db@1.2.4
46
-
47
- ## 1.0.9
48
-
49
- ### Patch Changes
50
-
51
- - Updated dependencies
52
- - @driveflux/db@1.2.3
53
-
54
- ## 1.0.8
55
-
56
- ### Patch Changes
57
-
58
- - Minor updates on build
59
- - Updated dependencies
60
- - @driveflux/time@4.0.7
61
- - @driveflux/env@1.0.8
62
- - @driveflux/db@1.2.2
63
-
64
- ## 1.0.7
65
-
66
- ### Patch Changes
67
-
68
- - Upgraded all packages
69
- - Updated dependencies
70
- - @driveflux/time@4.0.6
71
- - @driveflux/env@1.0.7
72
- - @driveflux/db@1.2.1
73
- - Add mileage value in Quotation PDF
74
-
75
- ## 1.0.6
76
-
77
- ### Patch Changes
78
-
79
- - Updated dependencies
80
- - @driveflux/db@1.2.0
81
-
82
- ## 1.0.5
83
-
84
- ### Patch Changes
85
-
86
- - Updated dependencies
87
- - @driveflux/db@1.1.0
88
-
89
- ## 1.0.4
90
-
91
- ### Patch Changes
92
-
93
- - Updates
94
- - Updated dependencies
95
- - @driveflux/db@1.0.39
96
-
97
- ## 1.0.3
98
-
99
- ### Patch Changes
100
-
101
- - Updates
102
- - Updated dependencies
103
- - @driveflux/db@1.0.38
104
-
105
- ## 1.0.2
106
-
107
- ### Patch Changes
108
-
109
- - Updates
110
- - Updated dependencies
111
- - @driveflux/db@1.0.37
112
-
113
- ## 1.0.1
114
-
115
- ### Patch Changes
116
-
117
- - General updates
118
- - Updated dependencies
119
- - @driveflux/db@1.0.36
120
-
121
- ## 1.0.5
122
-
123
- ### Patch Changes
124
-
125
- - Upgraded packages again
126
-
127
- ## 1.0.4
128
-
129
- ### Patch Changes
130
-
131
- - Upgraded packages
132
-
133
- ## 1.0.3
134
-
135
- ### Patch Changes
136
-
137
- - Reverted SWC core version
138
-
139
- ## 1.0.2
140
-
141
- ### Patch Changes
142
-
143
- - Updated dependencies
144
-
145
- ## 1.0.1
146
-
147
- ### Patch Changes
148
-
149
- - Bump versions
150
-
151
- ## 1.0.0
152
-
153
- ### Major Changes
154
-
155
- - 4.5 pre-release
156
-
157
- ### Patch Changes
158
-
159
- - verion bump + minor improvements
160
- - Bump all versions
161
- - Version bump
162
-
163
- ## 1.0.0-next.2
164
-
165
- ### Patch Changes
166
-
167
- - Version bump
168
-
169
- ## 1.0.0-next.1
170
-
171
- ### Patch Changes
172
-
173
- - verion bump + minor improvements
174
-
175
- ## 1.0.0-next.0
176
-
177
- ### Major Changes
178
-
179
- - 4.5 pre-release
@@ -1,69 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "quotation", {
6
- enumerable: true,
7
- get: function() {
8
- return quotation;
9
- }
10
- });
11
- var quotation = {
12
- id: 'QUO_XZJLVSM8',
13
- vehicleId: 'VBEXLQR',
14
- plan: 'plan36',
15
- mileagePackage: 'lite',
16
- cycleFluxCoefficient: 'flux25',
17
- customerName: 'Bubu Ahmad',
18
- vehicleName: 'Volkswagen Polo 1.6 Sedan 2011',
19
- createdById: 'U2R88JRVL',
20
- createdAt: new Date('2024-05-27T02:26:36.070Z'),
21
- updatedAt: new Date('2024-05-27T02:26:36.070Z'),
22
- metadata: {},
23
- customer: {
24
- type: 'user',
25
- name: 'Bubu Ahmad',
26
- email: 'bubu@gmail.com',
27
- address: {
28
- street1: '15-2 Jalan Solaris',
29
- city: 'Kuala Lumpur',
30
- state: 'Johor',
31
- postalCode: '12323',
32
- country: 'MY'
33
- }
34
- },
35
- fees: {
36
- subscriptionFee: 800,
37
- reservationFee: 0,
38
- startFee: 498,
39
- deposit: 1600,
40
- depositMonths: 2,
41
- extraCharges: [
42
- {
43
- type: 'upfront',
44
- description: 'Spare Tyre',
45
- amount: 2500.2
46
- },
47
- {
48
- type: 'upfront',
49
- description: 'Spare Tyre No 2',
50
- amount: 3000.2
51
- },
52
- {
53
- type: 'monthly',
54
- description: 'Commitment ',
55
- amount: 2
56
- }
57
- ],
58
- amountBeforeTax: 8400.4,
59
- taxAmount: 672.03,
60
- amountAfterTax: 9072.43,
61
- gfv: 0,
62
- cycle: null,
63
- couponCode: null,
64
- discountAmount: null,
65
- appliedDiscountId: null,
66
- couponType: ''
67
- },
68
- quotationPdf: null
69
- };