@aibrains/pdf-renderer 0.2.0 → 0.4.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 (73) hide show
  1. package/dist/components/KeyValueTable.d.ts +23 -0
  2. package/dist/components/KeyValueTable.d.ts.map +1 -0
  3. package/dist/components/KeyValueTable.js +37 -0
  4. package/dist/components/KeyValueTable.js.map +1 -0
  5. package/dist/components/LineItemTable.d.ts +53 -0
  6. package/dist/components/LineItemTable.d.ts.map +1 -0
  7. package/dist/components/LineItemTable.js +99 -0
  8. package/dist/components/LineItemTable.js.map +1 -0
  9. package/dist/components/SignatureLine.d.ts +24 -0
  10. package/dist/components/SignatureLine.d.ts.map +1 -0
  11. package/dist/components/SignatureLine.js +34 -0
  12. package/dist/components/SignatureLine.js.map +1 -0
  13. package/dist/components/TotalsBlock.d.ts +41 -0
  14. package/dist/components/TotalsBlock.d.ts.map +1 -0
  15. package/dist/components/TotalsBlock.js +59 -0
  16. package/dist/components/TotalsBlock.js.map +1 -0
  17. package/dist/components/index.d.ts +20 -0
  18. package/dist/components/index.d.ts.map +1 -0
  19. package/dist/components/index.js +23 -0
  20. package/dist/components/index.js.map +1 -0
  21. package/dist/core/fonts.d.ts +87 -0
  22. package/dist/core/fonts.d.ts.map +1 -0
  23. package/dist/core/fonts.js +159 -0
  24. package/dist/core/fonts.js.map +1 -0
  25. package/dist/core/index.d.ts +2 -0
  26. package/dist/core/index.d.ts.map +1 -1
  27. package/dist/core/index.js +6 -1
  28. package/dist/core/index.js.map +1 -1
  29. package/dist/descriptors/index.d.ts +14 -0
  30. package/dist/descriptors/index.d.ts.map +1 -0
  31. package/dist/descriptors/index.js +20 -0
  32. package/dist/descriptors/index.js.map +1 -0
  33. package/dist/descriptors/registry.d.ts +52 -0
  34. package/dist/descriptors/registry.d.ts.map +1 -0
  35. package/dist/descriptors/registry.js +85 -0
  36. package/dist/descriptors/registry.js.map +1 -0
  37. package/dist/descriptors/types.d.ts +207 -0
  38. package/dist/descriptors/types.d.ts.map +1 -0
  39. package/dist/descriptors/types.js +15 -0
  40. package/dist/descriptors/types.js.map +1 -0
  41. package/dist/index.d.ts +4 -1
  42. package/dist/index.d.ts.map +1 -1
  43. package/dist/index.js +6 -2
  44. package/dist/index.js.map +1 -1
  45. package/dist/primitives/BrandedFooter.d.ts +18 -0
  46. package/dist/primitives/BrandedFooter.d.ts.map +1 -0
  47. package/dist/primitives/BrandedFooter.js +35 -0
  48. package/dist/primitives/BrandedFooter.js.map +1 -0
  49. package/dist/primitives/BrandedHeader.d.ts +41 -0
  50. package/dist/primitives/BrandedHeader.d.ts.map +1 -0
  51. package/dist/primitives/BrandedHeader.js +52 -0
  52. package/dist/primitives/BrandedHeader.js.map +1 -0
  53. package/dist/primitives/Document.d.ts +21 -0
  54. package/dist/primitives/Document.d.ts.map +1 -0
  55. package/dist/primitives/Document.js +19 -0
  56. package/dist/primitives/Document.js.map +1 -0
  57. package/dist/primitives/Page.d.ts +27 -0
  58. package/dist/primitives/Page.d.ts.map +1 -0
  59. package/dist/primitives/Page.js +32 -0
  60. package/dist/primitives/Page.js.map +1 -0
  61. package/dist/primitives/Watermark.d.ts +25 -0
  62. package/dist/primitives/Watermark.d.ts.map +1 -0
  63. package/dist/primitives/Watermark.js +35 -0
  64. package/dist/primitives/Watermark.js.map +1 -0
  65. package/dist/primitives/index.d.ts +21 -0
  66. package/dist/primitives/index.d.ts.map +1 -0
  67. package/dist/primitives/index.js +24 -0
  68. package/dist/primitives/index.js.map +1 -0
  69. package/fonts/NotoSans-Bold.woff +0 -0
  70. package/fonts/NotoSans-Regular.woff +0 -0
  71. package/fonts/NotoSansDevanagari-Bold.woff +0 -0
  72. package/fonts/NotoSansDevanagari-Regular.woff +0 -0
  73. package/package.json +31 -5
package/dist/index.js CHANGED
@@ -31,7 +31,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
31
31
  };
32
32
  Object.defineProperty(exports, "__esModule", { value: true });
33
33
  exports.PDF_RENDERER_PACKAGE_VERSION = void 0;
34
- exports.PDF_RENDERER_PACKAGE_VERSION = '0.2.0';
35
- // Re-export the C.0.2 core API surface.
34
+ exports.PDF_RENDERER_PACKAGE_VERSION = '0.4.0';
35
+ // Re-export the C.0.2 core API surface + C.0.3 primitives + components
36
+ // + C.0.4 descriptor registry.
36
37
  __exportStar(require("./core"), exports);
38
+ __exportStar(require("./primitives"), exports);
39
+ __exportStar(require("./components"), exports);
40
+ __exportStar(require("./descriptors"), exports);
37
41
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;;;;;;AAEU,QAAA,4BAA4B,GAAG,OAAO,CAAC;AAEpD,wCAAwC;AACxC,yCAAuB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;;;;;;AAEU,QAAA,4BAA4B,GAAG,OAAO,CAAC;AAEpD,uEAAuE;AACvE,+BAA+B;AAC/B,yCAAuB;AACvB,+CAA6B;AAC7B,+CAA6B;AAC7B,gDAA8B"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * BrandedFooter — fixed-bottom page footer with optional text + page number.
3
+ *
4
+ * Sits on every page via `fixed` (a @react-pdf/renderer flag that pins the
5
+ * element across pagination). Pages without the footer can simply omit it.
6
+ */
7
+ import * as React from 'react';
8
+ import { type Lang } from '../core/i18n';
9
+ export interface BrandedFooterConfig {
10
+ /** Custom footer text (e.g., school slogan, terms reference, etc.) */
11
+ text?: string;
12
+ /** Show "Page X of Y" — defaults to true. */
13
+ showPageNumbers?: boolean;
14
+ /** Language for the page-number label (defaults to 'en'). */
15
+ lang?: Lang;
16
+ }
17
+ export declare const BrandedFooter: React.FC<BrandedFooterConfig>;
18
+ //# sourceMappingURL=BrandedFooter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BrandedFooter.d.ts","sourceRoot":"","sources":["../../src/primitives/BrandedFooter.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAK,KAAK,IAAI,EAAE,MAAM,cAAc,CAAC;AAG5C,MAAM,WAAW,mBAAmB;IAClC,sEAAsE;IACtE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,6CAA6C;IAC7C,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,6DAA6D;IAC7D,IAAI,CAAC,EAAE,IAAI,CAAC;CACb;AAsBD,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAqBvD,CAAC"}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BrandedFooter = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const renderer_1 = require("@react-pdf/renderer");
6
+ const theme_1 = require("../core/theme");
7
+ const i18n_1 = require("../core/i18n");
8
+ const fonts_1 = require("../core/fonts");
9
+ const styles = renderer_1.StyleSheet.create({
10
+ container: {
11
+ position: 'absolute',
12
+ bottom: 8,
13
+ left: 0,
14
+ right: 0,
15
+ flexDirection: 'row',
16
+ justifyContent: 'space-between',
17
+ alignItems: 'center',
18
+ paddingTop: theme_1.DEFAULT_SPACING.xs,
19
+ borderTopWidth: 1,
20
+ borderTopColor: theme_1.DEFAULT_COLORS.border,
21
+ paddingHorizontal: 24,
22
+ },
23
+ text: {
24
+ fontSize: theme_1.DEFAULT_FONT_SIZE.xs,
25
+ color: theme_1.DEFAULT_COLORS.textMuted,
26
+ },
27
+ });
28
+ const BrandedFooter = ({ text, showPageNumbers = true, lang = 'en', }) => {
29
+ // Page-number label uses the localized "Page X of Y" — pick the matching font
30
+ // based on the language (ne → Devanagari, else → Latin).
31
+ const pageNumberFontFamily = lang === 'ne' ? fonts_1.FONT_FAMILY_DEVANAGARI : fonts_1.FONT_FAMILY_LATIN;
32
+ return ((0, jsx_runtime_1.jsxs)(renderer_1.View, { style: styles.container, fixed: true, children: [(0, jsx_runtime_1.jsx)(renderer_1.Text, { style: [styles.text, { fontFamily: (0, fonts_1.pickFontFamily)(text) }], children: text !== null && text !== void 0 ? text : '' }), showPageNumbers && ((0, jsx_runtime_1.jsx)(renderer_1.Text, { style: [styles.text, { fontFamily: pageNumberFontFamily }], render: ({ pageNumber, totalPages }) => (0, i18n_1.t)('common', 'pageOf', lang, { page: pageNumber, total: totalPages }) }))] }));
33
+ };
34
+ exports.BrandedFooter = BrandedFooter;
35
+ //# sourceMappingURL=BrandedFooter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BrandedFooter.js","sourceRoot":"","sources":["../../src/primitives/BrandedFooter.tsx"],"names":[],"mappings":";;;;AAQA,kDAA6D;AAC7D,yCAAmF;AACnF,uCAA4C;AAC5C,yCAA0F;AAW1F,MAAM,MAAM,GAAG,qBAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,QAAQ,EAAE,UAAU;QACpB,MAAM,EAAE,CAAC;QACT,IAAI,EAAE,CAAC;QACP,KAAK,EAAE,CAAC;QACR,aAAa,EAAE,KAAK;QACpB,cAAc,EAAE,eAAe;QAC/B,UAAU,EAAE,QAAQ;QACpB,UAAU,EAAE,uBAAe,CAAC,EAAE;QAC9B,cAAc,EAAE,CAAC;QACjB,cAAc,EAAE,sBAAc,CAAC,MAAM;QACrC,iBAAiB,EAAE,EAAE;KACtB;IACD,IAAI,EAAE;QACJ,QAAQ,EAAE,yBAAiB,CAAC,EAAE;QAC9B,KAAK,EAAE,sBAAc,CAAC,SAAS;KAChC;CACF,CAAC,CAAC;AAEI,MAAM,aAAa,GAAkC,CAAC,EAC3D,IAAI,EACJ,eAAe,GAAG,IAAI,EACtB,IAAI,GAAG,IAAI,GACZ,EAAE,EAAE;IACH,8EAA8E;IAC9E,yDAAyD;IACzD,MAAM,oBAAoB,GAAG,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,8BAAsB,CAAC,CAAC,CAAC,yBAAiB,CAAC;IACxF,OAAO,CACL,wBAAC,eAAI,IAAC,KAAK,EAAE,MAAM,CAAC,SAAS,EAAE,KAAK,mBAClC,uBAAC,eAAI,IAAC,KAAK,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,UAAU,EAAE,IAAA,sBAAc,EAAC,IAAI,CAAC,EAAE,CAAC,YAAG,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,EAAE,GAAQ,EACpF,eAAe,IAAI,CAClB,uBAAC,eAAI,IACH,KAAK,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,UAAU,EAAE,oBAAoB,EAAE,CAAC,EAC1D,MAAM,EAAE,CAAC,EAAE,UAAU,EAAE,UAAU,EAAE,EAAE,EAAE,CACrC,IAAA,QAAC,EAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,GAEtE,CACH,IACI,CACR,CAAC;AACJ,CAAC,CAAC;AArBW,QAAA,aAAa,iBAqBxB"}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * BrandedHeader — page header with logo, school name, and address.
3
+ *
4
+ * Used by Invoice, Receipt, Report Card, Admit Card. Per template config:
5
+ * - `header.showLogo` — toggle the logo (if branding.logoS3Key present)
6
+ * - `header.showSchoolName` — toggle the school name
7
+ * - `header.showSchoolAddress` — toggle the address lines
8
+ * - `header.tagline` — optional tagline below the school name
9
+ *
10
+ * Logo source: callers must pre-resolve the S3 key to a URL or Buffer and
11
+ * pass it as the `logoSrc` prop. The header doesn't fetch anything.
12
+ */
13
+ import * as React from 'react';
14
+ import { type ImageSource } from '../core/fonts';
15
+ export interface BrandedHeaderBranding {
16
+ /**
17
+ * Pre-resolved logo source. Accepts URL string, Buffer, or react-pdf
18
+ * SourceObject literal — see `ImageSource` in `core/fonts.ts`. Pass
19
+ * `undefined` to skip.
20
+ */
21
+ logoSrc?: ImageSource;
22
+ schoolName?: string;
23
+ addressLines?: string[];
24
+ phone?: string;
25
+ email?: string;
26
+ }
27
+ export interface BrandedHeaderConfig {
28
+ showLogo?: boolean;
29
+ showSchoolName?: boolean;
30
+ showSchoolAddress?: boolean;
31
+ showContact?: boolean;
32
+ tagline?: string;
33
+ /** Primary brand color — applied to the school name. Defaults to theme primary. */
34
+ primaryColor?: string;
35
+ }
36
+ export interface BrandedHeaderProps {
37
+ branding: BrandedHeaderBranding;
38
+ config?: BrandedHeaderConfig;
39
+ }
40
+ export declare const BrandedHeader: React.FC<BrandedHeaderProps>;
41
+ //# sourceMappingURL=BrandedHeader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BrandedHeader.d.ts","sourceRoot":"","sources":["../../src/primitives/BrandedHeader.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAkB,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjE,MAAM,WAAW,qBAAqB;IACpC;;;;OAIG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mFAAmF;IACnF,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,qBAAqB,CAAC;IAChC,MAAM,CAAC,EAAE,mBAAmB,CAAC;CAC9B;AAwCD,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA2CtD,CAAC"}
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BrandedHeader = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const renderer_1 = require("@react-pdf/renderer");
6
+ const theme_1 = require("../core/theme");
7
+ const fonts_1 = require("../core/fonts");
8
+ const styles = renderer_1.StyleSheet.create({
9
+ container: {
10
+ flexDirection: 'row',
11
+ justifyContent: 'space-between',
12
+ alignItems: 'flex-start',
13
+ paddingBottom: theme_1.DEFAULT_SPACING.md,
14
+ borderBottomWidth: 1,
15
+ borderBottomColor: theme_1.DEFAULT_COLORS.border,
16
+ marginBottom: theme_1.DEFAULT_SPACING.lg,
17
+ },
18
+ logo: {
19
+ width: 64,
20
+ height: 64,
21
+ objectFit: 'contain',
22
+ },
23
+ textBlock: {
24
+ flexDirection: 'column',
25
+ alignItems: 'flex-end',
26
+ flex: 1,
27
+ },
28
+ schoolName: {
29
+ fontSize: theme_1.DEFAULT_FONT_SIZE.lg,
30
+ fontWeight: 'bold',
31
+ marginBottom: 2,
32
+ },
33
+ tagline: {
34
+ // No italic variant registered in V1 — keep style upright.
35
+ fontSize: theme_1.DEFAULT_FONT_SIZE.xs,
36
+ color: theme_1.DEFAULT_COLORS.textMuted,
37
+ marginBottom: 4,
38
+ },
39
+ address: {
40
+ fontSize: theme_1.DEFAULT_FONT_SIZE.xs,
41
+ color: theme_1.DEFAULT_COLORS.textMuted,
42
+ lineHeight: 1.3,
43
+ },
44
+ });
45
+ const BrandedHeader = ({ branding, config = {}, }) => {
46
+ const { showLogo = true, showSchoolName = true, showSchoolAddress = true, showContact = true, tagline, primaryColor, } = config;
47
+ const hasLogo = showLogo && branding.logoSrc;
48
+ const schoolColor = primaryColor !== null && primaryColor !== void 0 ? primaryColor : theme_1.DEFAULT_COLORS.primary;
49
+ return ((0, jsx_runtime_1.jsxs)(renderer_1.View, { style: styles.container, children: [hasLogo && (0, jsx_runtime_1.jsx)(renderer_1.Image, { style: styles.logo, src: branding.logoSrc }), (0, jsx_runtime_1.jsxs)(renderer_1.View, { style: styles.textBlock, children: [showSchoolName && branding.schoolName && ((0, jsx_runtime_1.jsx)(renderer_1.Text, { style: [styles.schoolName, { color: schoolColor, fontFamily: (0, fonts_1.pickFontFamily)(branding.schoolName) }], children: branding.schoolName })), tagline && ((0, jsx_runtime_1.jsx)(renderer_1.Text, { style: [styles.tagline, { fontFamily: (0, fonts_1.pickFontFamily)(tagline) }], children: tagline })), showSchoolAddress && branding.addressLines && branding.addressLines.length > 0 && ((0, jsx_runtime_1.jsx)(renderer_1.View, { children: branding.addressLines.map((line, idx) => ((0, jsx_runtime_1.jsx)(renderer_1.Text, { style: [styles.address, { fontFamily: (0, fonts_1.pickFontFamily)(line) }], children: line }, idx))) })), showContact && (branding.phone || branding.email) && ((0, jsx_runtime_1.jsx)(renderer_1.Text, { style: styles.address, children: [branding.phone, branding.email].filter(Boolean).join(' · ') }))] })] }));
50
+ };
51
+ exports.BrandedHeader = BrandedHeader;
52
+ //# sourceMappingURL=BrandedHeader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BrandedHeader.js","sourceRoot":"","sources":["../../src/primitives/BrandedHeader.tsx"],"names":[],"mappings":"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"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Document — wraps `@react-pdf/renderer`'s Document and ensures the bundled
3
+ * fonts are registered before the first render.
4
+ *
5
+ * Every consumer document (InvoicePdf, ReceiptPdf, ReportCardPdf, ...) should
6
+ * wrap its `<Page>` children in this Document rather than the raw RPDF one.
7
+ * That makes font registration a render-side invariant rather than a per-caller
8
+ * concern, eliminating an easy gap.
9
+ */
10
+ import * as React from 'react';
11
+ export interface DocumentProps {
12
+ /** Document title surfaced in PDF metadata. */
13
+ title?: string;
14
+ /** Document author surfaced in PDF metadata. */
15
+ author?: string;
16
+ /** Document subject surfaced in PDF metadata. */
17
+ subject?: string;
18
+ children: React.ReactNode;
19
+ }
20
+ export declare const Document: React.FC<DocumentProps>;
21
+ //# sourceMappingURL=Document.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Document.d.ts","sourceRoot":"","sources":["../../src/primitives/Document.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,MAAM,WAAW,aAAa;IAC5B,+CAA+C;IAC/C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gDAAgD;IAChD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iDAAiD;IACjD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAUD,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAY5C,CAAC"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Document = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const renderer_1 = require("@react-pdf/renderer");
6
+ const fonts_1 = require("../core/fonts");
7
+ /**
8
+ * Register fonts on module load (idempotent). Each consumer document still
9
+ * wraps children in `<Document>`, so the registration is also guaranteed by
10
+ * the render path — but pre-registering here means snapshot tests that
11
+ * accidentally render outside `<Document>` still get correct shaping.
12
+ */
13
+ (0, fonts_1.registerFonts)();
14
+ const Document = ({ title, author, subject, children, }) => {
15
+ // RPDF's Document props don't include children in its TS type — pass via prop.
16
+ return ((0, jsx_runtime_1.jsx)(renderer_1.Document, { title: title, author: author, subject: subject, children: children }));
17
+ };
18
+ exports.Document = Document;
19
+ //# sourceMappingURL=Document.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Document.js","sourceRoot":"","sources":["../../src/primitives/Document.tsx"],"names":[],"mappings":";;;;AAWA,kDAA+D;AAC/D,yCAA8C;AAY9C;;;;;GAKG;AACH,IAAA,qBAAa,GAAE,CAAC;AAET,MAAM,QAAQ,GAA4B,CAAC,EAChD,KAAK,EACL,MAAM,EACN,OAAO,EACP,QAAQ,GACT,EAAE,EAAE;IACH,+EAA+E;IAC/E,OAAO,CACL,uBAAC,mBAAY,IAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,YACzD,QAA8B,GAClB,CAChB,CAAC;AACJ,CAAC,CAAC;AAZW,QAAA,QAAQ,YAYnB"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Page — wraps `@react-pdf/renderer`'s Page with EdForge defaults.
3
+ *
4
+ * Margins come from template config (`PdfTemplateConfig.margins`); pageSize
5
+ * from `template.pageSize`. The default values mirror the design doc § 4.2
6
+ * (A4 portrait, 15mm margins on all sides) which suit a printable invoice in
7
+ * Nepal pilot defaults.
8
+ */
9
+ import * as React from 'react';
10
+ export type PageSize = 'A4' | 'A5' | 'LETTER';
11
+ export type Orientation = 'portrait' | 'landscape';
12
+ export interface PageProps {
13
+ /** Defaults to A4. */
14
+ size?: PageSize;
15
+ /** Defaults to portrait. */
16
+ orientation?: Orientation;
17
+ /** Margins in millimetres; defaults to 15mm on all sides. */
18
+ margins?: {
19
+ top: number;
20
+ right: number;
21
+ bottom: number;
22
+ left: number;
23
+ };
24
+ children: React.ReactNode;
25
+ }
26
+ export declare const Page: React.FC<PageProps>;
27
+ //# sourceMappingURL=Page.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Page.d.ts","sourceRoot":"","sources":["../../src/primitives/Page.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,MAAM,MAAM,QAAQ,GAAG,IAAI,GAAG,IAAI,GAAG,QAAQ,CAAC;AAC9C,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,WAAW,CAAC;AAEnD,MAAM,WAAW,SAAS;IACxB,sBAAsB;IACtB,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,4BAA4B;IAC5B,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,6DAA6D;IAC7D,OAAO,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACvE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAgBD,eAAO,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CAuBpC,CAAC"}
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Page = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const renderer_1 = require("@react-pdf/renderer");
6
+ const theme_1 = require("../core/theme");
7
+ const fonts_1 = require("../core/fonts");
8
+ const mm = (value) => `${value}mm`;
9
+ // react-pdf does NOT support CSS-style font-fallback chains. The page default
10
+ // is Latin; Devanagari text runs MUST explicitly set fontFamily to
11
+ // 'Noto Sans Devanagari' (use `pickFontFamily(text)` helper from core/fonts).
12
+ const baseStyles = renderer_1.StyleSheet.create({
13
+ page: {
14
+ fontFamily: fonts_1.FONT_FAMILY_LATIN,
15
+ fontSize: theme_1.DEFAULT_FONT_SIZE.md,
16
+ color: theme_1.DEFAULT_COLORS.text,
17
+ backgroundColor: theme_1.DEFAULT_COLORS.background,
18
+ },
19
+ });
20
+ const Page = ({ size = 'A4', orientation = 'portrait', margins = theme_1.DEFAULT_MARGINS_MM, children, }) => {
21
+ return ((0, jsx_runtime_1.jsx)(renderer_1.Page, { size: size, orientation: orientation, style: [
22
+ baseStyles.page,
23
+ {
24
+ paddingTop: mm(margins.top),
25
+ paddingRight: mm(margins.right),
26
+ paddingBottom: mm(margins.bottom),
27
+ paddingLeft: mm(margins.left),
28
+ },
29
+ ], children: children }));
30
+ };
31
+ exports.Page = Page;
32
+ //# sourceMappingURL=Page.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Page.js","sourceRoot":"","sources":["../../src/primitives/Page.tsx"],"names":[],"mappings":";;;;AAUA,kDAAmE;AACnE,yCAAsF;AACtF,yCAAkD;AAelD,MAAM,EAAE,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,GAAG,KAAK,IAAI,CAAC;AAE3C,8EAA8E;AAC9E,mEAAmE;AACnE,8EAA8E;AAC9E,MAAM,UAAU,GAAG,qBAAU,CAAC,MAAM,CAAC;IACnC,IAAI,EAAE;QACJ,UAAU,EAAE,yBAAiB;QAC7B,QAAQ,EAAE,yBAAiB,CAAC,EAAE;QAC9B,KAAK,EAAE,sBAAc,CAAC,IAAI;QAC1B,eAAe,EAAE,sBAAc,CAAC,UAAU;KAC3C;CACF,CAAC,CAAC;AAEI,MAAM,IAAI,GAAwB,CAAC,EACxC,IAAI,GAAG,IAAI,EACX,WAAW,GAAG,UAAU,EACxB,OAAO,GAAG,0BAAkB,EAC5B,QAAQ,GACT,EAAE,EAAE;IACH,OAAO,CACL,uBAAC,eAAQ,IACP,IAAI,EAAE,IAAI,EACV,WAAW,EAAE,WAAW,EACxB,KAAK,EAAE;YACL,UAAU,CAAC,IAAI;YACf;gBACE,UAAU,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC;gBAC3B,YAAY,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;gBAC/B,aAAa,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC;gBACjC,WAAW,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;aAC9B;SACF,YAEA,QAA8B,GACtB,CACZ,CAAC;AACJ,CAAC,CAAC;AAvBW,QAAA,IAAI,QAuBf"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Watermark — diagonal translucent text overlay.
3
+ *
4
+ * Common cases:
5
+ * - "DRAFT" on a not-yet-issued invoice preview
6
+ * - "PAID" on a settled invoice
7
+ * - "CANCELLED" on a voided invoice or refunded receipt
8
+ *
9
+ * Positioned absolutely, rotated 45deg. Use sparingly — it bleeds through to
10
+ * the body content visually.
11
+ */
12
+ import * as React from 'react';
13
+ export interface WatermarkProps {
14
+ text: string;
15
+ /** 0.0–1.0. Defaults to 0.10 (faint). */
16
+ opacity?: number;
17
+ /** Rotation in degrees. Defaults to -45 (bottom-left to top-right). */
18
+ rotation?: number;
19
+ /** Hex color. Defaults to theme danger. */
20
+ color?: string;
21
+ /** Font size in pt. Defaults to 96. */
22
+ fontSize?: number;
23
+ }
24
+ export declare const Watermark: React.FC<WatermarkProps>;
25
+ //# sourceMappingURL=Watermark.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Watermark.d.ts","sourceRoot":"","sources":["../../src/primitives/Watermark.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,yCAAyC;IACzC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,uEAAuE;IACvE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,2CAA2C;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uCAAuC;IACvC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAiBD,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAyB9C,CAAC"}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Watermark = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const renderer_1 = require("@react-pdf/renderer");
6
+ const theme_1 = require("../core/theme");
7
+ const fonts_1 = require("../core/fonts");
8
+ const styles = renderer_1.StyleSheet.create({
9
+ container: {
10
+ position: 'absolute',
11
+ top: '40%',
12
+ left: 0,
13
+ right: 0,
14
+ alignItems: 'center',
15
+ justifyContent: 'center',
16
+ },
17
+ text: {
18
+ fontWeight: 'bold',
19
+ letterSpacing: 8,
20
+ },
21
+ });
22
+ const Watermark = ({ text, opacity = 0.1, rotation = -45, color = theme_1.DEFAULT_COLORS.danger, fontSize = 96, }) => {
23
+ return ((0, jsx_runtime_1.jsx)(renderer_1.View, { style: styles.container, fixed: true, children: (0, jsx_runtime_1.jsx)(renderer_1.Text, { style: [
24
+ styles.text,
25
+ {
26
+ color,
27
+ opacity,
28
+ fontSize,
29
+ fontFamily: (0, fonts_1.pickFontFamily)(text),
30
+ transform: `rotate(${rotation}deg)`,
31
+ },
32
+ ], children: text }) }));
33
+ };
34
+ exports.Watermark = Watermark;
35
+ //# sourceMappingURL=Watermark.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Watermark.js","sourceRoot":"","sources":["../../src/primitives/Watermark.tsx"],"names":[],"mappings":";;;;AAaA,kDAA6D;AAC7D,yCAA+C;AAC/C,yCAA+C;AAc/C,MAAM,MAAM,GAAG,qBAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,QAAQ,EAAE,UAAU;QACpB,GAAG,EAAE,KAAK;QACV,IAAI,EAAE,CAAC;QACP,KAAK,EAAE,CAAC;QACR,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,QAAQ;KACzB;IACD,IAAI,EAAE;QACJ,UAAU,EAAE,MAAM;QAClB,aAAa,EAAE,CAAC;KACjB;CACF,CAAC,CAAC;AAEI,MAAM,SAAS,GAA6B,CAAC,EAClD,IAAI,EACJ,OAAO,GAAG,GAAG,EACb,QAAQ,GAAG,CAAC,EAAE,EACd,KAAK,GAAG,sBAAc,CAAC,MAAM,EAC7B,QAAQ,GAAG,EAAE,GACd,EAAE,EAAE;IACH,OAAO,CACL,uBAAC,eAAI,IAAC,KAAK,EAAE,MAAM,CAAC,SAAS,EAAE,KAAK,kBAClC,uBAAC,eAAI,IACH,KAAK,EAAE;gBACL,MAAM,CAAC,IAAI;gBACX;oBACE,KAAK;oBACL,OAAO;oBACP,QAAQ;oBACR,UAAU,EAAE,IAAA,sBAAc,EAAC,IAAI,CAAC;oBAChC,SAAS,EAAE,UAAU,QAAQ,MAAM;iBACpC;aACF,YAEA,IAAI,GACA,GACF,CACR,CAAC;AACJ,CAAC,CAAC;AAzBW,QAAA,SAAS,aAyBpB"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Layout primitives — building blocks that compose into document components.
3
+ *
4
+ * Sprint C.0.3:
5
+ * - Document — wraps RPDF Document, auto-registers fonts
6
+ * - Page — wraps RPDF Page with template margins + default font + theme
7
+ * - BrandedHeader — logo + school name + address (driven by branding)
8
+ * - BrandedFooter — footer text + page numbers
9
+ * - Watermark — DRAFT/PAID/CANCELLED diagonal overlay
10
+ */
11
+ export { Document } from './Document';
12
+ export type { DocumentProps } from './Document';
13
+ export { Page } from './Page';
14
+ export type { PageProps, PageSize, Orientation } from './Page';
15
+ export { BrandedHeader } from './BrandedHeader';
16
+ export type { BrandedHeaderProps, BrandedHeaderBranding, BrandedHeaderConfig, } from './BrandedHeader';
17
+ export { BrandedFooter } from './BrandedFooter';
18
+ export type { BrandedFooterConfig } from './BrandedFooter';
19
+ export { Watermark } from './Watermark';
20
+ export type { WatermarkProps } from './Watermark';
21
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/primitives/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,YAAY,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAE/D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EACV,kBAAkB,EAClB,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAE3D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ /**
3
+ * Layout primitives — building blocks that compose into document components.
4
+ *
5
+ * Sprint C.0.3:
6
+ * - Document — wraps RPDF Document, auto-registers fonts
7
+ * - Page — wraps RPDF Page with template margins + default font + theme
8
+ * - BrandedHeader — logo + school name + address (driven by branding)
9
+ * - BrandedFooter — footer text + page numbers
10
+ * - Watermark — DRAFT/PAID/CANCELLED diagonal overlay
11
+ */
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.Watermark = exports.BrandedFooter = exports.BrandedHeader = exports.Page = exports.Document = void 0;
14
+ var Document_1 = require("./Document");
15
+ Object.defineProperty(exports, "Document", { enumerable: true, get: function () { return Document_1.Document; } });
16
+ var Page_1 = require("./Page");
17
+ Object.defineProperty(exports, "Page", { enumerable: true, get: function () { return Page_1.Page; } });
18
+ var BrandedHeader_1 = require("./BrandedHeader");
19
+ Object.defineProperty(exports, "BrandedHeader", { enumerable: true, get: function () { return BrandedHeader_1.BrandedHeader; } });
20
+ var BrandedFooter_1 = require("./BrandedFooter");
21
+ Object.defineProperty(exports, "BrandedFooter", { enumerable: true, get: function () { return BrandedFooter_1.BrandedFooter; } });
22
+ var Watermark_1 = require("./Watermark");
23
+ Object.defineProperty(exports, "Watermark", { enumerable: true, get: function () { return Watermark_1.Watermark; } });
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/primitives/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;AAEH,uCAAsC;AAA7B,oGAAA,QAAQ,OAAA;AAGjB,+BAA8B;AAArB,4FAAA,IAAI,OAAA;AAGb,iDAAgD;AAAvC,8GAAA,aAAa,OAAA;AAOtB,iDAAgD;AAAvC,8GAAA,aAAa,OAAA;AAGtB,yCAAwC;AAA/B,sGAAA,SAAS,OAAA"}
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aibrains/pdf-renderer",
3
- "version": "0.2.0",
3
+ "version": "0.4.0",
4
4
  "description": "EdForge PDF rendering library. JSX-based document templates built on @react-pdf/renderer, with localization (EN + NE), Bikram Sambat date support, and a TemplateDescriptor registry for cross-domain doc types (invoice, receipt, report card, admit card, etc.).",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -14,28 +14,54 @@
14
14
  "types": "./dist/core/index.d.ts",
15
15
  "require": "./dist/core/index.js",
16
16
  "default": "./dist/core/index.js"
17
+ },
18
+ "./primitives": {
19
+ "types": "./dist/primitives/index.d.ts",
20
+ "require": "./dist/primitives/index.js",
21
+ "default": "./dist/primitives/index.js"
22
+ },
23
+ "./components": {
24
+ "types": "./dist/components/index.d.ts",
25
+ "require": "./dist/components/index.js",
26
+ "default": "./dist/components/index.js"
27
+ },
28
+ "./descriptors": {
29
+ "types": "./dist/descriptors/index.d.ts",
30
+ "require": "./dist/descriptors/index.js",
31
+ "default": "./dist/descriptors/index.js"
17
32
  }
18
33
  },
19
34
  "files": [
20
35
  "dist",
36
+ "fonts",
21
37
  "README.md"
22
38
  ],
23
39
  "scripts": {
24
- "build": "tsc",
40
+ "build": "tsc && node scripts/copy-fonts.js",
25
41
  "watch": "tsc --watch",
26
- "clean": "rimraf dist",
42
+ "clean": "rimraf dist fonts",
27
43
  "typecheck": "tsc --noEmit",
28
44
  "test": "jest --config jest.config.cjs",
29
- "prepare": "tsc",
45
+ "prepare": "tsc && node scripts/copy-fonts.js",
30
46
  "prepublishOnly": "npm run clean && npm run build"
31
47
  },
32
48
  "dependencies": {
33
- "@aibrains/shared-types": "^0.60.0"
49
+ "@aibrains/shared-types": "^0.60.0",
50
+ "@react-pdf/renderer": "^3.4.5"
51
+ },
52
+ "peerDependencies": {
53
+ "react": ">=18.0.0 <20.0.0"
34
54
  },
35
55
  "devDependencies": {
56
+ "@fontsource/noto-sans": "^5.2.10",
57
+ "@fontsource/noto-sans-devanagari": "^5.2.8",
36
58
  "@types/jest": "^29.5.0",
37
59
  "@types/node": "^20.0.0",
60
+ "@types/react": "^18.3.29",
61
+ "@types/react-test-renderer": "^18.3.1",
38
62
  "jest": "^29.7.0",
63
+ "react": "^18.3.1",
64
+ "react-test-renderer": "^18.3.1",
39
65
  "rimraf": "^5.0.5",
40
66
  "ts-jest": "^29.1.0",
41
67
  "typescript": "^5.0.0"