@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,3 @@
1
+ import { UserIdentification } from '@driveflux/db';
2
+ export declare const formatIdentification: (identification?: UserIdentification | null) => string;
3
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,4 @@
1
+ export var formatIdentification = function(identification) {
2
+ var _identification_number, _identification_number1, _identification_number2;
3
+ return (identification === null || identification === void 0 ? void 0 : identification.type) === 'id' ? "".concat(identification === null || identification === void 0 ? void 0 : (_identification_number = identification.number) === null || _identification_number === void 0 ? void 0 : _identification_number.slice(0, 6), "-").concat(identification === null || identification === void 0 ? void 0 : (_identification_number1 = identification.number) === null || _identification_number1 === void 0 ? void 0 : _identification_number1.slice(6, 8), "-").concat(identification === null || identification === void 0 ? void 0 : (_identification_number2 = identification.number) === null || _identification_number2 === void 0 ? void 0 : _identification_number2.slice(8)) : (identification === null || identification === void 0 ? void 0 : identification.number) || '-';
4
+ };
@@ -0,0 +1,2 @@
1
+ export * from './SubscriptionAgreement/index.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/templates/index.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAA"}
@@ -0,0 +1 @@
1
+ export * from './SubscriptionAgreement/index.js';
@@ -0,0 +1,148 @@
1
+ export declare const colors: {
2
+ /**
3
+ * #EFEFF0 Light Gray
4
+ */
5
+ primary1: string;
6
+ /**
7
+ * #CACACA Gray
8
+ */
9
+ primary2: string;
10
+ /**
11
+ * #585858 Dark Gray
12
+ */
13
+ primary3: string;
14
+ /**
15
+ * #191919 Soft Black
16
+ */
17
+ primary4: string;
18
+ /**
19
+ * #E55867 Red
20
+ */
21
+ accent4: string;
22
+ /**
23
+ * #ADE0EE Light Blue
24
+ */
25
+ links2: string;
26
+ /**
27
+ * #50C8E8 Blue
28
+ */
29
+ links: string;
30
+ /**
31
+ * #E24657 Red
32
+ */
33
+ alert4: string;
34
+ /**
35
+ * #E24657 Red
36
+ */
37
+ danger: string;
38
+ /**
39
+ * #F4B25C Yellow
40
+ */
41
+ warning4: string;
42
+ /**
43
+ * #4FD9C2 Green
44
+ */
45
+ success4: string;
46
+ /**
47
+ * #4FD9C2 Green
48
+ */
49
+ green: string;
50
+ /**
51
+ * #3BD5BC Green
52
+ */
53
+ /**
54
+ * #000000 Black
55
+ */
56
+ black: string;
57
+ /**
58
+ * #ffffff White
59
+ */
60
+ white: string;
61
+ /**
62
+ * #E6E6E6 Light Gray
63
+ */
64
+ whiteHover: string;
65
+ /**
66
+ * #F4F4F4 Light Gray
67
+ */
68
+ placeholder: string;
69
+ /**
70
+ * #F9F7D7 Light Yellow
71
+ */
72
+ highlight: string;
73
+ primary: {
74
+ 25: string;
75
+ 50: string;
76
+ 100: string;
77
+ 200: string;
78
+ 300: string;
79
+ 400: string;
80
+ 500: string;
81
+ 600: string;
82
+ 700: string;
83
+ 800: string;
84
+ 900: string;
85
+ };
86
+ success: {
87
+ 50: string;
88
+ 100: string;
89
+ 200: string;
90
+ 300: string;
91
+ 400: string;
92
+ 500: string;
93
+ 600: string;
94
+ 700: string;
95
+ 800: string;
96
+ 900: string;
97
+ };
98
+ accent: {
99
+ 50: string;
100
+ 100: string;
101
+ 200: string;
102
+ 300: string;
103
+ 400: string;
104
+ 500: string;
105
+ 600: string;
106
+ 700: string;
107
+ 800: string;
108
+ 900: string;
109
+ };
110
+ warning: {
111
+ 50: string;
112
+ 100: string;
113
+ 200: string;
114
+ 300: string;
115
+ 400: string;
116
+ 500: string;
117
+ 600: string;
118
+ 700: string;
119
+ 800: string;
120
+ 900: string;
121
+ };
122
+ info: {
123
+ 25: string;
124
+ 50: string;
125
+ 100: string;
126
+ 200: string;
127
+ 300: string;
128
+ 400: string;
129
+ 500: string;
130
+ 600: string;
131
+ 700: string;
132
+ 800: string;
133
+ 900: string;
134
+ };
135
+ alert: {
136
+ 50: string;
137
+ 100: string;
138
+ 200: string;
139
+ 300: string;
140
+ 400: string;
141
+ 500: string;
142
+ 600: string;
143
+ 700: string;
144
+ 800: string;
145
+ 900: string;
146
+ };
147
+ };
148
+ //# sourceMappingURL=colors.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,137 @@
1
+ // TODO sync this with the one in dump
2
+ // remove dump file version
3
+ // update all instances using colors
4
+ export var colors = {
5
+ /**
6
+ * #EFEFF0 Light Gray
7
+ */ primary1: '#EFEFF0',
8
+ /**
9
+ * #CACACA Gray
10
+ */ primary2: '#CACACA',
11
+ /**
12
+ * #585858 Dark Gray
13
+ */ primary3: '#585858',
14
+ /**
15
+ * #191919 Soft Black
16
+ */ primary4: '#191919',
17
+ /**
18
+ * #E55867 Red
19
+ */ accent4: '#E55867',
20
+ /**
21
+ * #ADE0EE Light Blue
22
+ */ links2: '#ADE0EE',
23
+ /**
24
+ * #50C8E8 Blue
25
+ */ links: '#50C8E8',
26
+ /**
27
+ * #E24657 Red
28
+ */ alert4: '#E24657',
29
+ /**
30
+ * #E24657 Red
31
+ */ danger: '#E24657',
32
+ /**
33
+ * #F4B25C Yellow
34
+ */ warning4: '#F4B25C',
35
+ /**
36
+ * #4FD9C2 Green
37
+ */ success4: '#4FD9C2',
38
+ /**
39
+ * #4FD9C2 Green
40
+ */ green: '#4FD9C2',
41
+ /**
42
+ * #3BD5BC Green
43
+ */ // green: '#3BD5BC',
44
+ /**
45
+ * #000000 Black
46
+ */ black: '#000000',
47
+ /**
48
+ * #ffffff White
49
+ */ white: '#ffffff',
50
+ /**
51
+ * #E6E6E6 Light Gray
52
+ */ whiteHover: '#E6E6E6',
53
+ /**
54
+ * #F4F4F4 Light Gray
55
+ */ placeholder: '#F4F4F4',
56
+ /**
57
+ * #F9F7D7 Light Yellow
58
+ */ highlight: '#F9F7D7',
59
+ primary: {
60
+ 25: '#fafafa',
61
+ 50: '#d6f5f0',
62
+ 100: '#98e6d6',
63
+ 200: '#191919',
64
+ 300: '#191919',
65
+ 400: '#3bd5bb',
66
+ 500: '#000000',
67
+ 600: '#000000',
68
+ 700: '#000000',
69
+ 800: '#000000',
70
+ 900: '#000000'
71
+ },
72
+ // TODO add 25
73
+ success: {
74
+ 50: '#d8f7f2',
75
+ 100: '#98e6d6',
76
+ 200: '#3bd5bc',
77
+ 300: '#4FD9C2',
78
+ 400: '#3bd5bb',
79
+ 500: '#3bd5bb',
80
+ 600: '#2EA692',
81
+ 700: '#00825c',
82
+ 800: '#00724d',
83
+ 900: '#005530'
84
+ },
85
+ // TODO add 25
86
+ accent: {
87
+ 50: '#fceaee',
88
+ 100: '#f8cad3',
89
+ 200: '#E55867',
90
+ 300: '#E55867',
91
+ 400: '#E24657',
92
+ 500: '#E24657',
93
+ 600: '#d8253f',
94
+ 700: '#c61a38',
95
+ 800: '#b91231',
96
+ 900: '#aa0026'
97
+ },
98
+ // TODO add 25
99
+ warning: {
100
+ 50: '#FDF0DE',
101
+ 100: '#F4B25C',
102
+ 200: '#F4B25C',
103
+ 300: '#F4B25C',
104
+ 400: '#F4B25C',
105
+ 500: '#F4B25C',
106
+ 600: '#BF7F2C',
107
+ 700: '#F4B25C',
108
+ 800: '#F4B25C',
109
+ 900: '#F4B25C'
110
+ },
111
+ info: {
112
+ 25: '#50C8E81A',
113
+ 50: '#CDF1FA',
114
+ 100: '#50C8E8',
115
+ 200: '#50C8E8',
116
+ 300: '#50C8E8',
117
+ 400: '#50C8E8',
118
+ 500: '#50C8E8',
119
+ 600: '#3EA5C0',
120
+ 700: '#50C8E8',
121
+ 800: '#50C8E8',
122
+ 900: '#50C8E8'
123
+ },
124
+ // TODO add 25
125
+ alert: {
126
+ 50: '#E24657',
127
+ 100: '#E24657',
128
+ 200: '#E24657',
129
+ 300: '#E24657',
130
+ 400: '#E24657',
131
+ 500: '#E24657',
132
+ 600: '#E24657',
133
+ 700: '#E24657',
134
+ 800: '#E24657',
135
+ 900: '#E24657'
136
+ }
137
+ };
@@ -0,0 +1,2 @@
1
+ export * from './colors.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA"}
@@ -0,0 +1 @@
1
+ export * from './colors.js';
@@ -0,0 +1,2 @@
1
+ export type PdfTemplatesSupportedLocales = 'en';
2
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,4BAA4B,GAAG,IAAI,CAAA"}
package/dist/types.js ADDED
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,4 @@
1
+ import type { DocumentProps } from '@react-pdf/renderer';
2
+ import { ReactElement } from 'react';
3
+ export declare const toPdf: (document: ReactElement<DocumentProps>, fileName: string) => Promise<void>;
4
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +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,eAAO,MAAM,KAAK,aAAoB,aAAa,aAAa,CAAC,YAAY,MAAM,kBAKlF,CAAA"}
package/dist/utils.js ADDED
@@ -0,0 +1,150 @@
1
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
2
+ try {
3
+ var info = gen[key](arg);
4
+ var value = info.value;
5
+ } catch (error) {
6
+ reject(error);
7
+ return;
8
+ }
9
+ if (info.done) {
10
+ resolve(value);
11
+ } else {
12
+ Promise.resolve(value).then(_next, _throw);
13
+ }
14
+ }
15
+ function _async_to_generator(fn) {
16
+ return function() {
17
+ var self = this, args = arguments;
18
+ return new Promise(function(resolve, reject) {
19
+ var gen = fn.apply(self, args);
20
+ function _next(value) {
21
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
22
+ }
23
+ function _throw(err) {
24
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
25
+ }
26
+ _next(undefined);
27
+ });
28
+ };
29
+ }
30
+ function _ts_generator(thisArg, body) {
31
+ var f, y, t, g, _ = {
32
+ label: 0,
33
+ sent: function() {
34
+ if (t[0] & 1) throw t[1];
35
+ return t[1];
36
+ },
37
+ trys: [],
38
+ ops: []
39
+ };
40
+ return g = {
41
+ next: verb(0),
42
+ "throw": verb(1),
43
+ "return": verb(2)
44
+ }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
45
+ return this;
46
+ }), g;
47
+ function verb(n) {
48
+ return function(v) {
49
+ return step([
50
+ n,
51
+ v
52
+ ]);
53
+ };
54
+ }
55
+ function step(op) {
56
+ if (f) throw new TypeError("Generator is already executing.");
57
+ while(_)try {
58
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
59
+ if (y = 0, t) op = [
60
+ op[0] & 2,
61
+ t.value
62
+ ];
63
+ switch(op[0]){
64
+ case 0:
65
+ case 1:
66
+ t = op;
67
+ break;
68
+ case 4:
69
+ _.label++;
70
+ return {
71
+ value: op[1],
72
+ done: false
73
+ };
74
+ case 5:
75
+ _.label++;
76
+ y = op[1];
77
+ op = [
78
+ 0
79
+ ];
80
+ continue;
81
+ case 7:
82
+ op = _.ops.pop();
83
+ _.trys.pop();
84
+ continue;
85
+ default:
86
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
87
+ _ = 0;
88
+ continue;
89
+ }
90
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
91
+ _.label = op[1];
92
+ break;
93
+ }
94
+ if (op[0] === 6 && _.label < t[1]) {
95
+ _.label = t[1];
96
+ t = op;
97
+ break;
98
+ }
99
+ if (t && _.label < t[2]) {
100
+ _.label = t[2];
101
+ _.ops.push(op);
102
+ break;
103
+ }
104
+ if (t[2]) _.ops.pop();
105
+ _.trys.pop();
106
+ continue;
107
+ }
108
+ op = body.call(thisArg, _);
109
+ } catch (e) {
110
+ op = [
111
+ 6,
112
+ e
113
+ ];
114
+ y = 0;
115
+ } finally{
116
+ f = t = 0;
117
+ }
118
+ if (op[0] & 5) throw op[1];
119
+ return {
120
+ value: op[0] ? op[1] : void 0,
121
+ done: true
122
+ };
123
+ }
124
+ }
125
+ import ReactPDF from '@react-pdf/renderer';
126
+ export var toPdf = function() {
127
+ var _ref = _async_to_generator(function(document, fileName) {
128
+ var pdfStream;
129
+ return _ts_generator(this, function(_state) {
130
+ switch(_state.label){
131
+ case 0:
132
+ return [
133
+ 4,
134
+ ReactPDF.renderToFile(document, fileName)
135
+ ];
136
+ case 1:
137
+ pdfStream = _state.sent();
138
+ pdfStream.on('end', function() {
139
+ console.log("Generated PDF to ".concat(fileName));
140
+ });
141
+ return [
142
+ 2
143
+ ];
144
+ }
145
+ });
146
+ });
147
+ return function toPdf(document, fileName) {
148
+ return _ref.apply(this, arguments);
149
+ };
150
+ }();
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=watch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"watch.d.ts","sourceRoot":"","sources":["../src/watch.ts"],"names":[],"mappings":""}
package/dist/watch.js ADDED
@@ -0,0 +1,11 @@
1
+ import { execSync } from 'child_process';
2
+ import fs from 'node:fs';
3
+ fs.watch('src', {
4
+ persistent: true,
5
+ recursive: true
6
+ }, function() {
7
+ console.log('Reloading...');
8
+ execSync('pnpm debug', {
9
+ stdio: 'inherit'
10
+ });
11
+ });
package/index.cjs ADDED
@@ -0,0 +1 @@
1
+ module.exports = require('./dist/cjs/index.js')
package/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './dist/index'
package/package.json ADDED
@@ -0,0 +1,43 @@
1
+ {
2
+ "name": "@driveflux/pdf",
3
+ "version": "1.0.1",
4
+ "type": "module",
5
+ "main": "./dist/cjs/index.js",
6
+ "module": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "import": "./dist/index.js",
11
+ "require": "./dist/cjs/index.js",
12
+ "types": "./dist/index.d.ts"
13
+ }
14
+ },
15
+ "dependencies": {
16
+ "@driveflux/db": "1.0.36",
17
+ "@driveflux/env": "1.0.6",
18
+ "@driveflux/time": "4.0.5",
19
+ "@react-pdf/renderer": "^3.4.4",
20
+ "nodemon": "^3.1.0",
21
+ "react": "18.3.1"
22
+ },
23
+ "devDependencies": {
24
+ "@babel/preset-env": "^7.24.5",
25
+ "@driveflux/eslint-config": "1.0.5",
26
+ "@driveflux/fab": "1.0.6",
27
+ "@driveflux/tsconfig": "1.0.2",
28
+ "@swc/cli": "^0.3.12",
29
+ "@swc/core": "1.4.17",
30
+ "@types/node": "^20.12.8",
31
+ "del-cli": "^5.1.0",
32
+ "eslint": "9.1.1",
33
+ "typescript": "^5.4.5"
34
+ },
35
+ "scripts": {
36
+ "build": "fab",
37
+ "debug": "pnpm build && node dist/debug.js",
38
+ "dev": "pnpm debug && node dist/watch.js",
39
+ "clean": "fab clean",
40
+ "types": "tsc --noEmit",
41
+ "lint": "eslint \"src/**/*.ts\""
42
+ }
43
+ }