@driveflux/pdf 1.6.67 → 1.6.69

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.
@@ -1,2 +1 @@
1
- export {};
2
- //# sourceMappingURL=types.js.map
1
+ export { };
@@ -1,3 +1,6 @@
1
1
  import type { UserIdentification } from '@driveflux/db';
2
+ import { Text } from '@react-pdf/renderer';
3
+ import React from 'react';
2
4
  export declare const formatIdentification: (identification?: UserIdentification | null) => string;
5
+ export declare const renderMarkdown: (text: string) => (string | React.CElement<React.PropsWithChildren<import("@react-pdf/renderer").TextProps> | import("@react-pdf/renderer").SVGTextProps, Text>)[];
3
6
  //# 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,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAEvD,eAAO,MAAM,oBAAoB,GAChC,iBAAiB,kBAAkB,GAAG,IAAI,WAK1C,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;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAC1C,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,eAAO,MAAM,oBAAoB,GAChC,iBAAiB,kBAAkB,GAAG,IAAI,WAK1C,CAAA;AAED,eAAO,MAAM,cAAc,GAAI,MAAM,MAAM,qJAuC1C,CAAA"}
@@ -1,4 +1,32 @@
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) || '-';
1
+ import { Text } from '@react-pdf/renderer';
2
+ import React from 'react';
3
+ export const formatIdentification = (identification) => {
4
+ return identification?.type === 'id'
5
+ ? `${identification?.number?.slice(0, 6)}-${identification?.number?.slice(6, 8)}-${identification?.number?.slice(8)}`
6
+ : identification?.number || '-';
4
7
  };
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":"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,EAA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C,EAAE,CAAC,CAAC,CAAC,CACjB,CAAA;QACF,CAAC;QAED,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YAClD,OAAO,KAAK,CAAC,aAAa,CACzB,IAAI,EACJ;gBACC,GAAG,EAAE,KAAK;gBACV,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE;aAC7B,EACD,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CACjB,CAAA;QACF,CAAC;QAED,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YAChD,OAAO,KAAK,CAAC,aAAa,CACzB,IAAI,EACJ;gBACC,GAAG,EAAE,KAAK;gBACV,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE;aAC9B,EACD,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CACjB,CAAA;QACF,CAAC;QAED,OAAO,IAAI,CAAA;IACZ,CAAC,CAAC,CAAA;AACH,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@driveflux/pdf",
3
- "version": "1.6.67",
3
+ "version": "1.6.69",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -12,7 +12,7 @@
12
12
  "dist"
13
13
  ],
14
14
  "dependencies": {
15
- "@driveflux/db": "2.2.50",
15
+ "@driveflux/db": "2.2.52",
16
16
  "@driveflux/env": "1.5.0",
17
17
  "@driveflux/format-money": "5.4.1",
18
18
  "@driveflux/time": "4.4.1",