@driveflux/pdf 1.6.69 → 1.7.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.
- package/dist/__mocks__/subscription.d.ts +0 -2
- package/dist/__mocks__/subscription.d.ts.map +1 -1
- package/dist/__mocks__/subscription.js +23 -33
- package/dist/__mocks__/subscription.js.map +1 -1
- package/dist/components/StandardPage.d.ts.map +1 -1
- package/dist/components/StandardPage.js +99 -20
- package/dist/components/StandardPage.js.map +1 -1
- package/dist/debug.js +18 -34
- package/dist/debug.js.map +1 -1
- package/dist/templates/QuotationPdf/Pricing.d.ts.map +1 -1
- package/dist/templates/QuotationPdf/Pricing.js +9 -5
- package/dist/templates/QuotationPdf/Pricing.js.map +1 -1
- package/dist/templates/QuotationPdf/index.js +9 -17
- package/dist/templates/QuotationPdf/translations.d.ts.map +1 -1
- package/dist/templates/QuotationPdf/translations.js +4 -0
- package/dist/templates/QuotationPdf/translations.js.map +1 -1
- package/dist/templates/SubscriptionAgreement/Confirmation.d.ts +0 -2
- package/dist/templates/SubscriptionAgreement/Confirmation.d.ts.map +1 -1
- package/dist/templates/SubscriptionAgreement/Confirmation.js +5 -5
- package/dist/templates/SubscriptionAgreement/Confirmation.js.map +1 -1
- package/dist/templates/SubscriptionAgreement/CoverPage.d.ts +1 -3
- package/dist/templates/SubscriptionAgreement/CoverPage.d.ts.map +1 -1
- package/dist/templates/SubscriptionAgreement/CoverPage.js +8 -24
- package/dist/templates/SubscriptionAgreement/CoverPage.js.map +1 -1
- package/dist/templates/SubscriptionAgreement/Details.d.ts.map +1 -1
- package/dist/templates/SubscriptionAgreement/Details.js +5 -73
- package/dist/templates/SubscriptionAgreement/Details.js.map +1 -1
- package/dist/templates/SubscriptionAgreement/TermsOfUse.d.ts +2 -2
- package/dist/templates/SubscriptionAgreement/TermsOfUse.d.ts.map +1 -1
- package/dist/templates/SubscriptionAgreement/TermsOfUse.js +53 -11
- package/dist/templates/SubscriptionAgreement/TermsOfUse.js.map +1 -1
- package/dist/templates/SubscriptionAgreement/TermsOfUseSubSection.d.ts.map +1 -1
- package/dist/templates/SubscriptionAgreement/TermsOfUseSubSection.js +97 -12
- package/dist/templates/SubscriptionAgreement/TermsOfUseSubSection.js.map +1 -1
- package/dist/templates/SubscriptionAgreement/index.d.ts +1 -5
- package/dist/templates/SubscriptionAgreement/index.d.ts.map +1 -1
- package/dist/templates/SubscriptionAgreement/index.js +16 -29
- package/dist/templates/SubscriptionAgreement/index.js.map +1 -1
- package/dist/templates/SubscriptionAgreement/translations.d.ts +0 -6
- package/dist/templates/SubscriptionAgreement/translations.d.ts.map +1 -1
- package/dist/templates/SubscriptionAgreement/translations.js +1 -7
- package/dist/templates/SubscriptionAgreement/translations.js.map +1 -1
- package/dist/templates/SubscriptionAgreement/types.d.ts +1 -2
- package/dist/templates/SubscriptionAgreement/types.d.ts.map +1 -1
- package/dist/templates/SubscriptionAgreement/utils.d.ts +0 -3
- package/dist/templates/SubscriptionAgreement/utils.d.ts.map +1 -1
- package/dist/templates/SubscriptionAgreement/utils.js +3 -31
- package/dist/templates/SubscriptionAgreement/utils.js.map +1 -1
- package/dist/utils.js +8 -15
- package/package.json +19 -19
- package/dist/__mocks__/tou.d.ts +0 -10
- package/dist/__mocks__/tou.d.ts.map +0 -1
- package/dist/__mocks__/tou.js +0 -23
- package/dist/__mocks__/tou.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
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;
|
|
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,GAChC,iBAAiB,kBAAkB,GAAG,IAAI,WAK1C,CAAA"}
|
|
@@ -1,32 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
return identification?.type === 'id'
|
|
5
|
-
? `${identification?.number?.slice(0, 6)}-${identification?.number?.slice(6, 8)}-${identification?.number?.slice(8)}`
|
|
6
|
-
: identification?.number || '-';
|
|
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) || '-';
|
|
7
4
|
};
|
|
8
|
-
export const renderMarkdown = (text) => {
|
|
9
|
-
const parts = text.split(/(\*\*\*.*?\*\*\*|\*\*.*?\*\*|\*.*?\*)/g);
|
|
10
|
-
return parts.map((part, index) => {
|
|
11
|
-
if (part.startsWith('***') && part.endsWith('***')) {
|
|
12
|
-
return React.createElement(Text, {
|
|
13
|
-
key: index,
|
|
14
|
-
style: { fontWeight: 'bold', fontStyle: 'italic' },
|
|
15
|
-
}, part.slice(3, -3));
|
|
16
|
-
}
|
|
17
|
-
if (part.startsWith('**') && part.endsWith('**')) {
|
|
18
|
-
return React.createElement(Text, {
|
|
19
|
-
key: index,
|
|
20
|
-
style: { fontWeight: 'bold' },
|
|
21
|
-
}, part.slice(2, -2));
|
|
22
|
-
}
|
|
23
|
-
if (part.startsWith('*') && part.endsWith('*')) {
|
|
24
|
-
return React.createElement(Text, {
|
|
25
|
-
key: index,
|
|
26
|
-
style: { fontStyle: 'italic' },
|
|
27
|
-
}, part.slice(1, -1));
|
|
28
|
-
}
|
|
29
|
-
return part;
|
|
30
|
-
});
|
|
31
|
-
};
|
|
32
|
-
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/templates/SubscriptionAgreement/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/templates/SubscriptionAgreement/utils.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,oBAAoB,GAAG,CACnC,cAA0C,EACzC,EAAE;IACH,OAAO,cAAc,EAAE,IAAI,KAAK,IAAI;QACnC,CAAC,CAAC,GAAG,cAAc,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,cAAc,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,cAAc,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE;QACrH,CAAC,CAAC,cAAc,EAAE,MAAM,IAAI,GAAG,CAAA;AACjC,CAAC,CAAA"}
|
package/dist/utils.js
CHANGED
|
@@ -28,7 +28,7 @@ function _async_to_generator(fn) {
|
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
30
|
function _ts_generator(thisArg, body) {
|
|
31
|
-
var f, y, t,
|
|
31
|
+
var f, y, t, _ = {
|
|
32
32
|
label: 0,
|
|
33
33
|
sent: function() {
|
|
34
34
|
if (t[0] & 1) throw t[1];
|
|
@@ -36,12 +36,8 @@ function _ts_generator(thisArg, body) {
|
|
|
36
36
|
},
|
|
37
37
|
trys: [],
|
|
38
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() {
|
|
39
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
40
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
45
41
|
return this;
|
|
46
42
|
}), g;
|
|
47
43
|
function verb(n) {
|
|
@@ -54,7 +50,7 @@ function _ts_generator(thisArg, body) {
|
|
|
54
50
|
}
|
|
55
51
|
function step(op) {
|
|
56
52
|
if (f) throw new TypeError("Generator is already executing.");
|
|
57
|
-
while(_)try {
|
|
53
|
+
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
58
54
|
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
55
|
if (y = 0, t) op = [
|
|
60
56
|
op[0] & 2,
|
|
@@ -128,8 +124,8 @@ import ReactPDF from '@react-pdf/renderer';
|
|
|
128
124
|
* @param document React PDF Document element
|
|
129
125
|
* @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
126
|
* @returns PDF Buffer
|
|
131
|
-
*/ export var toPdf =
|
|
132
|
-
|
|
127
|
+
*/ export var toPdf = function(document, fileName) {
|
|
128
|
+
return _async_to_generator(function() {
|
|
133
129
|
var stream;
|
|
134
130
|
return _ts_generator(this, function(_state) {
|
|
135
131
|
switch(_state.label){
|
|
@@ -167,8 +163,5 @@ import ReactPDF from '@react-pdf/renderer';
|
|
|
167
163
|
];
|
|
168
164
|
}
|
|
169
165
|
});
|
|
170
|
-
});
|
|
171
|
-
|
|
172
|
-
return _ref.apply(this, arguments);
|
|
173
|
-
};
|
|
174
|
-
}();
|
|
166
|
+
})();
|
|
167
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@driveflux/pdf",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -12,29 +12,29 @@
|
|
|
12
12
|
"dist"
|
|
13
13
|
],
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@driveflux/db": "2.
|
|
16
|
-
"@driveflux/env": "1.
|
|
17
|
-
"@driveflux/format-money": "5.
|
|
18
|
-
"@driveflux/time": "4.
|
|
19
|
-
"@react-pdf/renderer": "^4.
|
|
20
|
-
"date-fns": "^
|
|
21
|
-
"nodemon": "^3.1.
|
|
22
|
-
"react": "
|
|
15
|
+
"@driveflux/db": "2.3.0",
|
|
16
|
+
"@driveflux/env": "1.6.0",
|
|
17
|
+
"@driveflux/format-money": "5.5.0",
|
|
18
|
+
"@driveflux/time": "4.5.0",
|
|
19
|
+
"@react-pdf/renderer": "^4.3.0",
|
|
20
|
+
"date-fns": "^4.1.0",
|
|
21
|
+
"nodemon": "^3.1.10",
|
|
22
|
+
"react": "19.1.0"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@babel/preset-env": "^7.
|
|
26
|
-
"@driveflux/fab": "2.
|
|
27
|
-
"@driveflux/tsconfig": "1.
|
|
28
|
-
"@swc/cli": "0.
|
|
29
|
-
"@swc/core": "1.
|
|
30
|
-
"@types/node": "^22.
|
|
31
|
-
"@types/react": "^
|
|
25
|
+
"@babel/preset-env": "^7.27.2",
|
|
26
|
+
"@driveflux/fab": "2.5.0",
|
|
27
|
+
"@driveflux/tsconfig": "1.4.0",
|
|
28
|
+
"@swc/cli": "0.7.5",
|
|
29
|
+
"@swc/core": "1.11.24",
|
|
30
|
+
"@types/node": "^22.15.16",
|
|
31
|
+
"@types/react": "^19.1.3",
|
|
32
32
|
"del-cli": "^6.0.0",
|
|
33
|
-
"react": "
|
|
34
|
-
"typescript": "^5.
|
|
33
|
+
"react": "19.1.0",
|
|
34
|
+
"typescript": "^5.8.3"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
|
-
"react": "
|
|
37
|
+
"react": "19.1.0"
|
|
38
38
|
},
|
|
39
39
|
"scripts": {
|
|
40
40
|
"build": "fab",
|
package/dist/__mocks__/tou.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tou.d.ts","sourceRoot":"","sources":["../../src/__mocks__/tou.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc;;;;;;;;CAuB1B,CAAA"}
|
package/dist/__mocks__/tou.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export const mockTermsOfUse = {
|
|
2
|
-
items: [
|
|
3
|
-
{
|
|
4
|
-
content: 'Terms of Use',
|
|
5
|
-
items: [
|
|
6
|
-
{
|
|
7
|
-
content: 'These Terms of ***Use*** are NOT no yes defined and govern the relationship, rules and regulations of the interactions by FLUX and its Members.',
|
|
8
|
-
items: [],
|
|
9
|
-
},
|
|
10
|
-
],
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
content: 'Introduction',
|
|
14
|
-
items: [
|
|
15
|
-
{
|
|
16
|
-
content: 'FLUX is an online business functioning as a technology provider that facilitates vehicle subscriptions.',
|
|
17
|
-
items: [],
|
|
18
|
-
},
|
|
19
|
-
],
|
|
20
|
-
},
|
|
21
|
-
],
|
|
22
|
-
};
|
|
23
|
-
//# sourceMappingURL=tou.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tou.js","sourceRoot":"","sources":["../../src/__mocks__/tou.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,cAAc,GAAG;IAC7B,KAAK,EAAE;QACN;YACC,OAAO,EAAE,cAAc;YACvB,KAAK,EAAE;gBACN;oBACC,OAAO,EACN,iJAAiJ;oBAClJ,KAAK,EAAE,EAAE;iBACT;aACD;SACD;QACD;YACC,OAAO,EAAE,cAAc;YACvB,KAAK,EAAE;gBACN;oBACC,OAAO,EACN,yGAAyG;oBAC1G,KAAK,EAAE,EAAE;iBACT;aACD;SACD;KACD;CACD,CAAA"}
|