@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,276 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "generateSubscriptionAgreementPdf", {
6
- enumerable: true,
7
- get: function() {
8
- return generateSubscriptionAgreementPdf;
9
- }
10
- });
11
- var _jsxruntime = require("react/jsx-runtime");
12
- var _renderer = require("@react-pdf/renderer");
13
- var _react = require("react");
14
- var _utils = require("../../utils.js");
15
- var _Confirmation = /*#__PURE__*/ _interop_require_default(require("./Confirmation.js"));
16
- var _CoverPage = /*#__PURE__*/ _interop_require_default(require("./CoverPage.js"));
17
- var _Details = /*#__PURE__*/ _interop_require_default(require("./Details.js"));
18
- var _SubscriptionAgreementPage = /*#__PURE__*/ _interop_require_default(require("./SubscriptionAgreementPage.js"));
19
- var _TermsOfUse = /*#__PURE__*/ _interop_require_default(require("./TermsOfUse.js"));
20
- var _translations = require("./translations.js");
21
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
22
- try {
23
- var info = gen[key](arg);
24
- var value = info.value;
25
- } catch (error) {
26
- reject(error);
27
- return;
28
- }
29
- if (info.done) {
30
- resolve(value);
31
- } else {
32
- Promise.resolve(value).then(_next, _throw);
33
- }
34
- }
35
- function _async_to_generator(fn) {
36
- return function() {
37
- var self = this, args = arguments;
38
- return new Promise(function(resolve, reject) {
39
- var gen = fn.apply(self, args);
40
- function _next(value) {
41
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
42
- }
43
- function _throw(err) {
44
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
45
- }
46
- _next(undefined);
47
- });
48
- };
49
- }
50
- function _define_property(obj, key, value) {
51
- if (key in obj) {
52
- Object.defineProperty(obj, key, {
53
- value: value,
54
- enumerable: true,
55
- configurable: true,
56
- writable: true
57
- });
58
- } else {
59
- obj[key] = value;
60
- }
61
- return obj;
62
- }
63
- function _interop_require_default(obj) {
64
- return obj && obj.__esModule ? obj : {
65
- default: obj
66
- };
67
- }
68
- function _object_spread(target) {
69
- for(var i = 1; i < arguments.length; i++){
70
- var source = arguments[i] != null ? arguments[i] : {};
71
- var ownKeys = Object.keys(source);
72
- if (typeof Object.getOwnPropertySymbols === "function") {
73
- ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
74
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
75
- }));
76
- }
77
- ownKeys.forEach(function(key) {
78
- _define_property(target, key, source[key]);
79
- });
80
- }
81
- return target;
82
- }
83
- function ownKeys(object, enumerableOnly) {
84
- var keys = Object.keys(object);
85
- if (Object.getOwnPropertySymbols) {
86
- var symbols = Object.getOwnPropertySymbols(object);
87
- if (enumerableOnly) {
88
- symbols = symbols.filter(function(sym) {
89
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
90
- });
91
- }
92
- keys.push.apply(keys, symbols);
93
- }
94
- return keys;
95
- }
96
- function _object_spread_props(target, source) {
97
- source = source != null ? source : {};
98
- if (Object.getOwnPropertyDescriptors) {
99
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
100
- } else {
101
- ownKeys(Object(source)).forEach(function(key) {
102
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
103
- });
104
- }
105
- return target;
106
- }
107
- function _ts_generator(thisArg, body) {
108
- var f, y, t, g, _ = {
109
- label: 0,
110
- sent: function() {
111
- if (t[0] & 1) throw t[1];
112
- return t[1];
113
- },
114
- trys: [],
115
- ops: []
116
- };
117
- return g = {
118
- next: verb(0),
119
- "throw": verb(1),
120
- "return": verb(2)
121
- }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
122
- return this;
123
- }), g;
124
- function verb(n) {
125
- return function(v) {
126
- return step([
127
- n,
128
- v
129
- ]);
130
- };
131
- }
132
- function step(op) {
133
- if (f) throw new TypeError("Generator is already executing.");
134
- while(_)try {
135
- 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;
136
- if (y = 0, t) op = [
137
- op[0] & 2,
138
- t.value
139
- ];
140
- switch(op[0]){
141
- case 0:
142
- case 1:
143
- t = op;
144
- break;
145
- case 4:
146
- _.label++;
147
- return {
148
- value: op[1],
149
- done: false
150
- };
151
- case 5:
152
- _.label++;
153
- y = op[1];
154
- op = [
155
- 0
156
- ];
157
- continue;
158
- case 7:
159
- op = _.ops.pop();
160
- _.trys.pop();
161
- continue;
162
- default:
163
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
164
- _ = 0;
165
- continue;
166
- }
167
- if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
168
- _.label = op[1];
169
- break;
170
- }
171
- if (op[0] === 6 && _.label < t[1]) {
172
- _.label = t[1];
173
- t = op;
174
- break;
175
- }
176
- if (t && _.label < t[2]) {
177
- _.label = t[2];
178
- _.ops.push(op);
179
- break;
180
- }
181
- if (t[2]) _.ops.pop();
182
- _.trys.pop();
183
- continue;
184
- }
185
- op = body.call(thisArg, _);
186
- } catch (e) {
187
- op = [
188
- 6,
189
- e
190
- ];
191
- y = 0;
192
- } finally{
193
- f = t = 0;
194
- }
195
- if (op[0] & 5) throw op[1];
196
- return {
197
- value: op[0] ? op[1] : void 0,
198
- done: true
199
- };
200
- }
201
- }
202
- var generateSubscriptionAgreementPdf = function() {
203
- var _ref = _async_to_generator(function(param, fileName) {
204
- var _param_locale, locale, subscription;
205
- return _ts_generator(this, function(_state) {
206
- switch(_state.label){
207
- case 0:
208
- _param_locale = param.locale, locale = _param_locale === void 0 ? 'en' : _param_locale, subscription = param.subscription;
209
- if (!subscription.signature) {
210
- throw new Error('Signature not found');
211
- }
212
- return [
213
- 4,
214
- (0, _utils.toPdf)(/*#__PURE__*/ (0, _jsxruntime.jsx)(SubscriptionAgreement, {
215
- locale: locale,
216
- signature: subscription.signature,
217
- subscription: subscription
218
- }), fileName)
219
- ];
220
- case 1:
221
- return [
222
- 2,
223
- _state.sent()
224
- ];
225
- }
226
- });
227
- });
228
- return function generateSubscriptionAgreementPdf(_, fileName) {
229
- return _ref.apply(this, arguments);
230
- };
231
- }();
232
- var SubscriptionAgreement = function(param) {
233
- var _param_locale = param.locale, locale = _param_locale === void 0 ? 'en' : _param_locale, signature = param.signature, subscription = param.subscription;
234
- if (!signature.signedAt) {
235
- throw new Error("Missing 'signature.signedAt'");
236
- }
237
- var pageProps = (0, _react.useMemo)(function() {
238
- return {
239
- t: (0, _translations.useTranslations)(locale),
240
- userId: subscription.userId,
241
- subscriptionId: subscription.id
242
- };
243
- }, []);
244
- var t = pageProps.t;
245
- return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_renderer.Document, {
246
- title: t.title,
247
- language: locale,
248
- children: [
249
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_SubscriptionAgreementPage.default, _object_spread_props(_object_spread({}, pageProps), {
250
- children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_CoverPage.default, {
251
- tTitle: t.title,
252
- tCover: t.cover,
253
- signedAt: signature.signedAt,
254
- user: subscription.user
255
- })
256
- })),
257
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_SubscriptionAgreementPage.default, _object_spread_props(_object_spread({}, pageProps), {
258
- children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_TermsOfUse.default, {
259
- t: t.termsOfUse
260
- })
261
- })),
262
- /*#__PURE__*/ (0, _jsxruntime.jsxs)(_SubscriptionAgreementPage.default, _object_spread_props(_object_spread({}, pageProps), {
263
- children: [
264
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_Details.default, {
265
- tDetails: t.details,
266
- subscription: subscription
267
- }),
268
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_Confirmation.default, {
269
- tConfirmation: t.confirmation,
270
- subscription: subscription
271
- })
272
- ]
273
- }))
274
- ]
275
- });
276
- };