@driveflux/pdf 1.0.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 (130) hide show
  1. package/.eslintrc +3 -0
  2. package/.swcrc +14 -0
  3. package/.turbo/turbo-build.log +6 -0
  4. package/CHANGELOG.md +69 -0
  5. package/dist/__mocks__/subscription.d.ts +3 -0
  6. package/dist/__mocks__/subscription.d.ts.map +1 -0
  7. package/dist/__mocks__/subscription.js +1069 -0
  8. package/dist/cjs/__mocks__/subscription.js +1079 -0
  9. package/dist/cjs/components/FluxLogo.js +76 -0
  10. package/dist/cjs/components/StandardPage.js +129 -0
  11. package/dist/cjs/debug.js +202 -0
  12. package/dist/cjs/index.js +20 -0
  13. package/dist/cjs/package.json +3 -0
  14. package/dist/cjs/templates/SubscriptionAgreement/Confirmation.js +95 -0
  15. package/dist/cjs/templates/SubscriptionAgreement/CoverPage.js +110 -0
  16. package/dist/cjs/templates/SubscriptionAgreement/CoverPageSection.js +35 -0
  17. package/dist/cjs/templates/SubscriptionAgreement/Details.js +161 -0
  18. package/dist/cjs/templates/SubscriptionAgreement/Footer.js +68 -0
  19. package/dist/cjs/templates/SubscriptionAgreement/Header.js +61 -0
  20. package/dist/cjs/templates/SubscriptionAgreement/LabelValue.js +39 -0
  21. package/dist/cjs/templates/SubscriptionAgreement/SubscriptionAgreementPage.js +48 -0
  22. package/dist/cjs/templates/SubscriptionAgreement/TermsOfUse.js +72 -0
  23. package/dist/cjs/templates/SubscriptionAgreement/TermsOfUseSubSection.js +108 -0
  24. package/dist/cjs/templates/SubscriptionAgreement/index.js +276 -0
  25. package/dist/cjs/templates/SubscriptionAgreement/translations.js +666 -0
  26. package/dist/cjs/templates/SubscriptionAgreement/utils.js +14 -0
  27. package/dist/cjs/templates/index.js +18 -0
  28. package/dist/cjs/theme/colors.js +147 -0
  29. package/dist/cjs/theme/index.js +18 -0
  30. package/dist/cjs/types.js +4 -0
  31. package/dist/cjs/utils.js +165 -0
  32. package/dist/cjs/watch.js +20 -0
  33. package/dist/components/FluxLogo.d.ts +3 -0
  34. package/dist/components/FluxLogo.d.ts.map +1 -0
  35. package/dist/components/FluxLogo.js +66 -0
  36. package/dist/components/StandardPage.d.ts +6 -0
  37. package/dist/components/StandardPage.d.ts.map +1 -0
  38. package/dist/components/StandardPage.js +114 -0
  39. package/dist/debug.d.ts +2 -0
  40. package/dist/debug.d.ts.map +1 -0
  41. package/dist/debug.js +198 -0
  42. package/dist/index.d.ts +4 -0
  43. package/dist/index.d.ts.map +1 -0
  44. package/dist/index.js +3 -0
  45. package/dist/templates/SubscriptionAgreement/Confirmation.d.ts +10 -0
  46. package/dist/templates/SubscriptionAgreement/Confirmation.d.ts.map +1 -0
  47. package/dist/templates/SubscriptionAgreement/Confirmation.js +80 -0
  48. package/dist/templates/SubscriptionAgreement/CoverPage.d.ts +12 -0
  49. package/dist/templates/SubscriptionAgreement/CoverPage.d.ts.map +1 -0
  50. package/dist/templates/SubscriptionAgreement/CoverPage.js +95 -0
  51. package/dist/templates/SubscriptionAgreement/CoverPageSection.d.ts +7 -0
  52. package/dist/templates/SubscriptionAgreement/CoverPageSection.d.ts.map +1 -0
  53. package/dist/templates/SubscriptionAgreement/CoverPageSection.js +25 -0
  54. package/dist/templates/SubscriptionAgreement/Details.d.ts +10 -0
  55. package/dist/templates/SubscriptionAgreement/Details.d.ts.map +1 -0
  56. package/dist/templates/SubscriptionAgreement/Details.js +146 -0
  57. package/dist/templates/SubscriptionAgreement/Footer.d.ts +10 -0
  58. package/dist/templates/SubscriptionAgreement/Footer.d.ts.map +1 -0
  59. package/dist/templates/SubscriptionAgreement/Footer.js +58 -0
  60. package/dist/templates/SubscriptionAgreement/Header.d.ts +10 -0
  61. package/dist/templates/SubscriptionAgreement/Header.d.ts.map +1 -0
  62. package/dist/templates/SubscriptionAgreement/Header.js +46 -0
  63. package/dist/templates/SubscriptionAgreement/LabelValue.d.ts +8 -0
  64. package/dist/templates/SubscriptionAgreement/LabelValue.d.ts.map +1 -0
  65. package/dist/templates/SubscriptionAgreement/LabelValue.js +29 -0
  66. package/dist/templates/SubscriptionAgreement/SubscriptionAgreementPage.d.ts +10 -0
  67. package/dist/templates/SubscriptionAgreement/SubscriptionAgreementPage.d.ts.map +1 -0
  68. package/dist/templates/SubscriptionAgreement/SubscriptionAgreementPage.js +33 -0
  69. package/dist/templates/SubscriptionAgreement/TermsOfUse.d.ts +8 -0
  70. package/dist/templates/SubscriptionAgreement/TermsOfUse.d.ts.map +1 -0
  71. package/dist/templates/SubscriptionAgreement/TermsOfUse.js +57 -0
  72. package/dist/templates/SubscriptionAgreement/TermsOfUseSubSection.d.ts +12 -0
  73. package/dist/templates/SubscriptionAgreement/TermsOfUseSubSection.d.ts.map +1 -0
  74. package/dist/templates/SubscriptionAgreement/TermsOfUseSubSection.js +98 -0
  75. package/dist/templates/SubscriptionAgreement/index.d.ts +14 -0
  76. package/dist/templates/SubscriptionAgreement/index.d.ts.map +1 -0
  77. package/dist/templates/SubscriptionAgreement/index.js +261 -0
  78. package/dist/templates/SubscriptionAgreement/translations.d.ts +72 -0
  79. package/dist/templates/SubscriptionAgreement/translations.d.ts.map +1 -0
  80. package/dist/templates/SubscriptionAgreement/translations.js +656 -0
  81. package/dist/templates/SubscriptionAgreement/utils.d.ts +3 -0
  82. package/dist/templates/SubscriptionAgreement/utils.d.ts.map +1 -0
  83. package/dist/templates/SubscriptionAgreement/utils.js +4 -0
  84. package/dist/templates/index.d.ts +2 -0
  85. package/dist/templates/index.d.ts.map +1 -0
  86. package/dist/templates/index.js +1 -0
  87. package/dist/theme/colors.d.ts +148 -0
  88. package/dist/theme/colors.d.ts.map +1 -0
  89. package/dist/theme/colors.js +137 -0
  90. package/dist/theme/index.d.ts +2 -0
  91. package/dist/theme/index.d.ts.map +1 -0
  92. package/dist/theme/index.js +1 -0
  93. package/dist/types.d.ts +2 -0
  94. package/dist/types.d.ts.map +1 -0
  95. package/dist/types.js +1 -0
  96. package/dist/utils.d.ts +4 -0
  97. package/dist/utils.d.ts.map +1 -0
  98. package/dist/utils.js +150 -0
  99. package/dist/watch.d.ts +2 -0
  100. package/dist/watch.d.ts.map +1 -0
  101. package/dist/watch.js +11 -0
  102. package/index.cjs +1 -0
  103. package/index.d.ts +1 -0
  104. package/package.json +43 -0
  105. package/src/__mocks__/subscription.ts +803 -0
  106. package/src/components/FluxLogo.tsx +52 -0
  107. package/src/components/StandardPage.tsx +32 -0
  108. package/src/debug.ts +36 -0
  109. package/src/index.ts +3 -0
  110. package/src/templates/SubscriptionAgreement/Confirmation.tsx +49 -0
  111. package/src/templates/SubscriptionAgreement/CoverPage.tsx +52 -0
  112. package/src/templates/SubscriptionAgreement/CoverPageSection.tsx +25 -0
  113. package/src/templates/SubscriptionAgreement/Details.tsx +127 -0
  114. package/src/templates/SubscriptionAgreement/Footer.tsx +37 -0
  115. package/src/templates/SubscriptionAgreement/Header.tsx +37 -0
  116. package/src/templates/SubscriptionAgreement/LabelValue.tsx +19 -0
  117. package/src/templates/SubscriptionAgreement/SubscriptionAgreementPage.tsx +24 -0
  118. package/src/templates/SubscriptionAgreement/TermsOfUse.tsx +30 -0
  119. package/src/templates/SubscriptionAgreement/TermsOfUseSubSection.tsx +44 -0
  120. package/src/templates/SubscriptionAgreement/index.tsx +66 -0
  121. package/src/templates/SubscriptionAgreement/translations.ts +664 -0
  122. package/src/templates/SubscriptionAgreement/utils.ts +7 -0
  123. package/src/templates/index.ts +1 -0
  124. package/src/theme/colors.ts +180 -0
  125. package/src/theme/index.ts +1 -0
  126. package/src/types.ts +1 -0
  127. package/src/utils.ts +10 -0
  128. package/src/watch.ts +16 -0
  129. package/tsconfig.json +13 -0
  130. package/tsconfig.tsbuildinfo +1 -0
@@ -0,0 +1,58 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Text, View } from '@react-pdf/renderer';
3
+ import { colors } from '../../theme/colors.js';
4
+ var Footer = function(param) {
5
+ var tComputerGenerated = param.tComputerGenerated, tPage = param.tPage, tOf = param.tOf;
6
+ return /*#__PURE__*/ _jsxs(View, {
7
+ fixed: true,
8
+ style: {
9
+ justifyContent: 'space-between',
10
+ flexDirection: 'row',
11
+ paddingTop: 16,
12
+ marginTop: 16,
13
+ borderTop: "1px solid ".concat(colors.links),
14
+ color: colors.primary2,
15
+ fontSize: 8
16
+ },
17
+ children: [
18
+ /*#__PURE__*/ _jsx(Text, {
19
+ children: tComputerGenerated
20
+ }),
21
+ /*#__PURE__*/ _jsxs(View, {
22
+ style: {
23
+ flexDirection: 'row',
24
+ columnGap: 4
25
+ },
26
+ children: [
27
+ /*#__PURE__*/ _jsx(Text, {
28
+ children: tPage
29
+ }),
30
+ /*#__PURE__*/ _jsx(Text, {
31
+ style: {
32
+ fontWeight: 'bold',
33
+ color: colors.black
34
+ },
35
+ render: function(param) {
36
+ var pageNumber = param.pageNumber;
37
+ return "".concat(pageNumber);
38
+ }
39
+ }),
40
+ /*#__PURE__*/ _jsx(Text, {
41
+ children: tOf
42
+ }),
43
+ /*#__PURE__*/ _jsx(Text, {
44
+ style: {
45
+ fontWeight: 'bold',
46
+ color: colors.black
47
+ },
48
+ render: function(param) {
49
+ var totalPages = param.totalPages;
50
+ return "".concat(totalPages);
51
+ }
52
+ })
53
+ ]
54
+ })
55
+ ]
56
+ });
57
+ };
58
+ export default Footer;
@@ -0,0 +1,10 @@
1
+ import { FC } from 'react';
2
+ import { SubscriptionAgreementTranslation } from './translations.js';
3
+ type Props = {
4
+ tTitle: SubscriptionAgreementTranslation['title'];
5
+ userId: string;
6
+ subscriptionId: string;
7
+ };
8
+ declare const Header: FC<Props>;
9
+ export default Header;
10
+ //# sourceMappingURL=Header.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../../src/templates/SubscriptionAgreement/Header.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAG1B,OAAO,EAAE,gCAAgC,EAAE,MAAM,mBAAmB,CAAA;AAEpE,KAAK,KAAK,GAAG;IACX,MAAM,EAAE,gCAAgC,CAAC,OAAO,CAAC,CAAA;IACjD,MAAM,EAAE,MAAM,CAAA;IACd,cAAc,EAAE,MAAM,CAAA;CACvB,CAAA;AAED,QAAA,MAAM,MAAM,EAAE,EAAE,CAAC,KAAK,CAsBrB,CAAA;AAED,eAAe,MAAM,CAAA"}
@@ -0,0 +1,46 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Link, Text, View } from '@react-pdf/renderer';
3
+ import FluxLogo from '../../components/FluxLogo.js';
4
+ import { colors } from '../../theme/colors.js';
5
+ var Header = function(param) {
6
+ var tTitle = param.tTitle, userId = param.userId, subscriptionId = param.subscriptionId;
7
+ return /*#__PURE__*/ _jsxs(View, {
8
+ fixed: true,
9
+ style: {
10
+ flexDirection: 'row',
11
+ justifyContent: 'space-between',
12
+ alignItems: 'center',
13
+ paddingBottom: 40,
14
+ // to not get pushed by the content
15
+ minHeight: 69
16
+ },
17
+ children: [
18
+ /*#__PURE__*/ _jsx(Link, {
19
+ src: "https://driveflux.com",
20
+ children: /*#__PURE__*/ _jsx(FluxLogo, {})
21
+ }),
22
+ /*#__PURE__*/ _jsxs(View, {
23
+ style: {
24
+ rowGap: 4,
25
+ fontSize: 8,
26
+ alignItems: 'flex-end'
27
+ },
28
+ children: [
29
+ /*#__PURE__*/ _jsx(Text, {
30
+ style: {
31
+ fontWeight: 'bold'
32
+ },
33
+ children: tTitle
34
+ }),
35
+ /*#__PURE__*/ _jsx(Text, {
36
+ style: {
37
+ color: colors.primary2
38
+ },
39
+ children: "FLUX-".concat(userId, "-").concat(subscriptionId)
40
+ })
41
+ ]
42
+ })
43
+ ]
44
+ });
45
+ };
46
+ export default Header;
@@ -0,0 +1,8 @@
1
+ import { FC } from 'react';
2
+ type Props = {
3
+ label: string;
4
+ value?: string | number | boolean | null;
5
+ };
6
+ declare const LabelValue: FC<Props>;
7
+ export default LabelValue;
8
+ //# sourceMappingURL=LabelValue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LabelValue.d.ts","sourceRoot":"","sources":["../../../src/templates/SubscriptionAgreement/LabelValue.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAE1B,KAAK,KAAK,GAAG;IACX,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAA;CACzC,CAAA;AAED,QAAA,MAAM,UAAU,EAAE,EAAE,CAAC,KAAK,CAQzB,CAAA;AAED,eAAe,UAAU,CAAA"}
@@ -0,0 +1,29 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Text, View } from '@react-pdf/renderer';
3
+ var LabelValue = function(param) {
4
+ var label = param.label, value = param.value;
5
+ return /*#__PURE__*/ _jsxs(View, {
6
+ style: {
7
+ flexDirection: 'row'
8
+ },
9
+ children: [
10
+ /*#__PURE__*/ _jsx(Text, {
11
+ style: {
12
+ minWidth: 120,
13
+ textTransform: 'capitalize'
14
+ },
15
+ children: label
16
+ }),
17
+ /*#__PURE__*/ _jsx(Text, {
18
+ children: ":"
19
+ }),
20
+ /*#__PURE__*/ _jsx(Text, {
21
+ style: {
22
+ paddingLeft: 16
23
+ },
24
+ children: "".concat(value) || '-'
25
+ })
26
+ ]
27
+ });
28
+ };
29
+ export default LabelValue;
@@ -0,0 +1,10 @@
1
+ import { FC, PropsWithChildren } from 'react';
2
+ import { SubscriptionAgreementTranslation } from './translations.js';
3
+ type Props = {
4
+ t: SubscriptionAgreementTranslation;
5
+ userId: string;
6
+ subscriptionId: string;
7
+ };
8
+ declare const SubscriptionAgreementPage: FC<PropsWithChildren<Props>>;
9
+ export default SubscriptionAgreementPage;
10
+ //# sourceMappingURL=SubscriptionAgreementPage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SubscriptionAgreementPage.d.ts","sourceRoot":"","sources":["../../../src/templates/SubscriptionAgreement/SubscriptionAgreementPage.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAI7C,OAAO,EAAE,gCAAgC,EAAE,MAAM,mBAAmB,CAAA;AAEpE,KAAK,KAAK,GAAG;IACX,CAAC,EAAE,gCAAgC,CAAA;IACnC,MAAM,EAAE,MAAM,CAAA;IACd,cAAc,EAAE,MAAM,CAAA;CACvB,CAAA;AAED,QAAA,MAAM,yBAAyB,EAAE,EAAE,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAQ3D,CAAA;AAED,eAAe,yBAAyB,CAAA"}
@@ -0,0 +1,33 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { View } from '@react-pdf/renderer';
3
+ import StandardPage from '../../components/StandardPage.js';
4
+ import Footer from './Footer.js';
5
+ import Header from './Header.js';
6
+ var SubscriptionAgreementPage = function(param) {
7
+ var t = param.t, userId = param.userId, subscriptionId = param.subscriptionId, children = param.children;
8
+ return /*#__PURE__*/ _jsxs(StandardPage, {
9
+ style: {
10
+ padding: 40,
11
+ fontSize: 10
12
+ },
13
+ children: [
14
+ /*#__PURE__*/ _jsx(Header, {
15
+ tTitle: t.title,
16
+ userId: userId,
17
+ subscriptionId: subscriptionId
18
+ }),
19
+ /*#__PURE__*/ _jsx(View, {
20
+ style: {
21
+ flex: 1
22
+ },
23
+ children: children
24
+ }),
25
+ /*#__PURE__*/ _jsx(Footer, {
26
+ tComputerGenerated: t.computerGenerated,
27
+ tPage: t.page,
28
+ tOf: t.of
29
+ })
30
+ ]
31
+ });
32
+ };
33
+ export default SubscriptionAgreementPage;
@@ -0,0 +1,8 @@
1
+ import { FC } from 'react';
2
+ import { SubscriptionAgreementTranslation } from './translations.js';
3
+ type Props = {
4
+ t: SubscriptionAgreementTranslation['termsOfUse'];
5
+ };
6
+ declare const TermsOfUse: FC<Props>;
7
+ export default TermsOfUse;
8
+ //# sourceMappingURL=TermsOfUse.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TermsOfUse.d.ts","sourceRoot":"","sources":["../../../src/templates/SubscriptionAgreement/TermsOfUse.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAE1B,OAAO,EAAE,gCAAgC,EAAE,MAAM,mBAAmB,CAAA;AAEpE,KAAK,KAAK,GAAG;IACX,CAAC,EAAE,gCAAgC,CAAC,YAAY,CAAC,CAAA;CAClD,CAAA;AAED,QAAA,MAAM,UAAU,EAAE,EAAE,CAAC,KAAK,CAkBzB,CAAA;AAED,eAAe,UAAU,CAAA"}
@@ -0,0 +1,57 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Text, View } from '@react-pdf/renderer';
3
+ import TermsOfUseSubSection from './TermsOfUseSubSection.js';
4
+ var TermsOfUse = function(param) {
5
+ var t = param.t;
6
+ return /*#__PURE__*/ _jsxs(View, {
7
+ style: {
8
+ rowGap: 16
9
+ },
10
+ children: [
11
+ /*#__PURE__*/ _jsx(Text, {
12
+ style: {
13
+ fontWeight: 'bold',
14
+ textTransform: 'uppercase'
15
+ },
16
+ children: t.title
17
+ }),
18
+ /*#__PURE__*/ _jsx(View, {
19
+ style: {
20
+ rowGap: 16,
21
+ lineHeight: 1.4
22
+ },
23
+ children: t.content.map(function(section, i) {
24
+ return /*#__PURE__*/ _jsxs(View, {
25
+ style: {
26
+ rowGap: 16
27
+ },
28
+ children: [
29
+ /*#__PURE__*/ _jsx(Text, {
30
+ style: {
31
+ fontWeight: 'bold'
32
+ },
33
+ children: "".concat(i + 1, " ").concat(section.title)
34
+ }),
35
+ /*#__PURE__*/ _jsx(View, {
36
+ style: {
37
+ rowGap: 16,
38
+ paddingLeft: 16
39
+ },
40
+ children: section.subSections.map(function(subSection, j) {
41
+ return /*#__PURE__*/ _jsx(TermsOfUseSubSection, {
42
+ indices: [
43
+ i + 1,
44
+ j + 1
45
+ ],
46
+ subSection: subSection
47
+ }, "".concat(i + 1, ".").concat(j));
48
+ })
49
+ })
50
+ ]
51
+ }, section.title);
52
+ })
53
+ })
54
+ ]
55
+ });
56
+ };
57
+ export default TermsOfUse;
@@ -0,0 +1,12 @@
1
+ import type { FC } from 'react';
2
+ type TermsOfUseSubSectionType = string | {
3
+ paragraph: string;
4
+ subSections: TermsOfUseSubSectionType[];
5
+ };
6
+ type Props = {
7
+ indices: number[];
8
+ subSection: TermsOfUseSubSectionType;
9
+ };
10
+ declare const TermsOfUseSubSection: FC<Props>;
11
+ export default TermsOfUseSubSection;
12
+ //# sourceMappingURL=TermsOfUseSubSection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TermsOfUseSubSection.d.ts","sourceRoot":"","sources":["../../../src/templates/SubscriptionAgreement/TermsOfUseSubSection.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAG/B,KAAK,wBAAwB,GACzB,MAAM,GACN;IACE,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,wBAAwB,EAAE,CAAA;CACxC,CAAA;AAEL,KAAK,KAAK,GAAG;IACX,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,UAAU,EAAE,wBAAwB,CAAA;CACrC,CAAA;AAED,QAAA,MAAM,oBAAoB,EAAE,EAAE,CAAC,KAAK,CAyBnC,CAAA;AAED,eAAe,oBAAoB,CAAA"}
@@ -0,0 +1,98 @@
1
+ function _array_like_to_array(arr, len) {
2
+ if (len == null || len > arr.length) len = arr.length;
3
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
4
+ return arr2;
5
+ }
6
+ function _array_without_holes(arr) {
7
+ if (Array.isArray(arr)) return _array_like_to_array(arr);
8
+ }
9
+ function _iterable_to_array(iter) {
10
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
11
+ }
12
+ function _non_iterable_spread() {
13
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
14
+ }
15
+ function _to_consumable_array(arr) {
16
+ return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
17
+ }
18
+ function _unsupported_iterable_to_array(o, minLen) {
19
+ if (!o) return;
20
+ if (typeof o === "string") return _array_like_to_array(o, minLen);
21
+ var n = Object.prototype.toString.call(o).slice(8, -1);
22
+ if (n === "Object" && o.constructor) n = o.constructor.name;
23
+ if (n === "Map" || n === "Set") return Array.from(n);
24
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
25
+ }
26
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
27
+ import { Text, View } from '@react-pdf/renderer';
28
+ import { useMemo } from 'react';
29
+ var TermsOfUseSubSection = function(param) {
30
+ var indices = param.indices, subSection = param.subSection;
31
+ var _useMemo = useMemo(function() {
32
+ return {
33
+ indicesString: indices.reduce(function(prev, curr, i) {
34
+ return "".concat(prev).concat(curr).concat(i === indices.length - 1 ? '' : '.');
35
+ }, ''),
36
+ paddingLeft: Math.max(indices.length - 2, 0) * 16
37
+ };
38
+ }, []), indicesString = _useMemo.indicesString, paddingLeft = _useMemo.paddingLeft;
39
+ return typeof subSection === 'string' ? /*#__PURE__*/ _jsxs(View, {
40
+ style: {
41
+ flexDirection: 'row',
42
+ paddingLeft: paddingLeft,
43
+ columnGap: 16
44
+ },
45
+ children: [
46
+ /*#__PURE__*/ _jsx(Text, {
47
+ style: {
48
+ fontWeight: 'bold'
49
+ },
50
+ children: indicesString
51
+ }),
52
+ /*#__PURE__*/ _jsx(Text, {
53
+ style: {
54
+ textAlign: 'justify',
55
+ flex: 1
56
+ },
57
+ children: subSection
58
+ })
59
+ ]
60
+ }, indicesString) : 'subSections' in subSection ? /*#__PURE__*/ _jsxs(View, {
61
+ style: {
62
+ gap: 16
63
+ },
64
+ children: [
65
+ /*#__PURE__*/ _jsxs(View, {
66
+ style: {
67
+ flexDirection: 'row',
68
+ paddingLeft: paddingLeft,
69
+ columnGap: 16
70
+ },
71
+ children: [
72
+ /*#__PURE__*/ _jsx(Text, {
73
+ style: {
74
+ fontWeight: 'bold'
75
+ },
76
+ children: indicesString
77
+ }),
78
+ /*#__PURE__*/ _jsx(Text, {
79
+ style: {
80
+ textAlign: 'justify',
81
+ flex: 1
82
+ },
83
+ children: subSection.paragraph
84
+ })
85
+ ]
86
+ }, indicesString),
87
+ subSection.subSections.map(function(subSection, i) {
88
+ return /*#__PURE__*/ _jsx(TermsOfUseSubSection, {
89
+ indices: _to_consumable_array(indices).concat([
90
+ i + 1
91
+ ]),
92
+ subSection: subSection
93
+ }, "".concat(indices, ".").concat(i));
94
+ })
95
+ ]
96
+ }, indicesString) : null;
97
+ };
98
+ export default TermsOfUseSubSection;
@@ -0,0 +1,14 @@
1
+ import { Subscription, SubscriptionSchedule, User, Vehicle } from '@driveflux/db';
2
+ import { PdfTemplatesSupportedLocales } from '../../types.js';
3
+ export type SubscriptionForAgreement = Subscription & {
4
+ user: User;
5
+ vehicle: Vehicle;
6
+ schedule?: SubscriptionSchedule | null;
7
+ };
8
+ type Options = {
9
+ locale?: PdfTemplatesSupportedLocales;
10
+ subscription: SubscriptionForAgreement;
11
+ };
12
+ export declare const generateSubscriptionAgreementPdf: ({ locale, subscription }: Options, fileName: string) => Promise<void>;
13
+ export {};
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +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,YAAY,MAAM,kBAQhH,CAAA"}