@cenk1cenk2/md-printer 3.2.23 → 3.3.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 (46) hide show
  1. package/README.md +33 -1
  2. package/dist/_virtual/{_@oxc-project_runtime@0.156.0 → _@oxc-project_runtime@0.157.0}/helpers/esm/decorate.mjs +1 -1
  3. package/dist/_virtual/{_@oxc-project_runtime@0.156.0 → _@oxc-project_runtime@0.157.0}/helpers/esm/decorateMetadata.mjs +1 -1
  4. package/dist/_virtual/{_@oxc-project_runtime@0.156.0 → _@oxc-project_runtime@0.157.0}/helpers/esm/decorateParam.mjs +1 -1
  5. package/dist/commands/index.mjs +1 -1
  6. package/dist/constants/attachment.constants.mjs +7 -0
  7. package/dist/constants/index.mjs +3 -2
  8. package/dist/constants/template.constants.mjs +3 -2
  9. package/dist/interfaces/attachment.interface.mjs +1 -0
  10. package/dist/modules/md-printer/md-printer.handler.mjs +3 -3
  11. package/dist/modules/md-printer/md-printer.module.mjs +1 -1
  12. package/dist/services/i18n.service.mjs +3 -3
  13. package/dist/services/index.mjs +2 -1
  14. package/dist/services/markdown.service.mjs +1 -1
  15. package/dist/services/pdf/pdf.service.mjs +124 -0
  16. package/dist/services/printer.module.mjs +3 -1
  17. package/dist/services/printer.service.mjs +33 -6
  18. package/dist/services/renderer/browser.service.mjs +3 -3
  19. package/dist/services/renderer/renderer.service.mjs +3 -3
  20. package/dist/services/session/preview.service.mjs +2 -2
  21. package/dist/services/session/session.service.mjs +2 -2
  22. package/dist/services/signature/adapters/a-trust.adapter.mjs +2 -2
  23. package/dist/services/signature/signature.service.mjs +2 -2
  24. package/dist/services/template/assets.mjs +1 -1
  25. package/dist/services/template/render.entry.ts +1 -1
  26. package/dist/services/template/template.service.mjs +20 -5
  27. package/oclif.manifest.json +1 -1
  28. package/package.json +14 -24
  29. package/templates/default/Template.svelte +0 -83
  30. package/templates/default/settings.json +0 -7
  31. package/templates/invoice/Template.svelte +0 -247
  32. package/templates/invoice/components/Client.svelte +0 -42
  33. package/templates/invoice/components/Company.svelte +0 -41
  34. package/templates/invoice/components/Items.svelte +0 -66
  35. package/templates/invoice/components/Notes.svelte +0 -21
  36. package/templates/invoice/components/Payment.svelte +0 -25
  37. package/templates/invoice/components/Signature.svelte +0 -34
  38. package/templates/invoice/components/Totals.svelte +0 -47
  39. package/templates/invoice/i18n/de.yaml +0 -30
  40. package/templates/invoice/i18n/en.yaml +0 -30
  41. package/templates/invoice/round.js +0 -2
  42. package/templates/invoice/settings.json +0 -11
  43. package/templates/kilic.dev/Template.svelte +0 -102
  44. package/templates/kilic.dev/settings.json +0 -7
  45. package/templates/mail/Template.svelte +0 -166
  46. package/templates/mail/settings.json +0 -7
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@cenk1cenk2/md-printer",
3
- "version": "3.2.23",
3
+ "version": "3.3.0",
4
4
  "description": "Render markdown or yaml through Svelte templates into PDF or HTML with Puppeteer.",
5
5
  "type": "module",
6
6
  "repository": {
7
7
  "type": "git",
8
- "url": "https://gitlab.kilic.dev/utils/md-printer.git"
8
+ "url": "https://gitlab.kilic.dev/utils/md-printer.git",
9
+ "directory": "packages/md-printer"
9
10
  },
10
11
  "author": "Cenk Kilic",
11
12
  "license": "MIT",
@@ -18,8 +19,7 @@
18
19
  "files": [
19
20
  "/bin",
20
21
  "/dist",
21
- "/oclif.manifest.json",
22
- "templates/"
22
+ "/oclif.manifest.json"
23
23
  ],
24
24
  "oclif": {
25
25
  "bin": "md-printer",
@@ -49,11 +49,15 @@
49
49
  "cenk1cenk2"
50
50
  ],
51
51
  "dependencies": {
52
+ "@cenk1cenk2/md-printer-template-cv": "1.0.0",
53
+ "@cenk1cenk2/md-printer-template-default": "1.0.0",
54
+ "@cenk1cenk2/md-printer-template-invoice": "1.0.0",
55
+ "@cenk1cenk2/md-printer-template-kilic.dev": "1.0.0",
56
+ "@cenk1cenk2/md-printer-template-mail": "1.0.0",
52
57
  "@cenk1cenk2/oclif-common": "^8.0.2",
53
- "@fontsource/montserrat": "^5.3.0",
54
58
  "@listr2/manager": "^4.3.3",
55
59
  "@nestjs/common": "^12.3.2",
56
- "@oclif/core": "^5.1.10",
60
+ "@oclif/core": "^5.1.11",
57
61
  "@oclif/plugin-help": "^7.0.6",
58
62
  "@signpdf/placeholder-plain": "^4.0.0",
59
63
  "@signpdf/utils": "^4.0.0",
@@ -65,16 +69,16 @@
65
69
  "chokidar": "^6.0.0",
66
70
  "enhanced-resolve": "^5.26.0",
67
71
  "entities": "^9.0.0",
68
- "es-toolkit": "^1.53.0",
69
- "github-markdown-css": "^5.9.0",
72
+ "es-toolkit": "^1.53.1",
70
73
  "hast-util-from-html": "^2.0.3",
71
74
  "hast-util-to-html": "^9.0.6",
72
75
  "highlight.js": "^11.12.0",
73
- "i18next": "^26.5.11",
76
+ "i18next": "^26.7.1",
74
77
  "lightningcss": "^1.33.0",
75
78
  "listr2": "^11.4.0",
76
79
  "lowlight": "^3.3.0",
77
80
  "mime": "^4.1.2",
81
+ "mupdf": "^1.28.1",
78
82
  "perfect-debounce": "^2.1.0",
79
83
  "pkijs": "^4.0.1",
80
84
  "property-information": "^7.2.0",
@@ -105,22 +109,15 @@
105
109
  "zod": "^4.6.7"
106
110
  },
107
111
  "devDependencies": {
108
- "@cenk1cenk2/cz-cc": "^3.0.12",
109
- "@cenk1cenk2/eslint-config": "^3.4.5",
110
112
  "@tsconfig/node24": "^24.0.5",
111
113
  "@types/hast": "^3.0.5",
112
114
  "@types/mdast": "^4.0.4",
113
- "@types/node": "^26.6.5",
115
+ "@types/node": "^26.6.6",
114
116
  "@types/serve-static": "^2.2.0",
115
117
  "@types/which": "^3.0.4",
116
118
  "@types/write-file-atomic": "^4.0.3",
117
- "eslint": "^10.13.0",
118
- "eslint-plugin-svelte": "^3.23.1",
119
119
  "execa": "^10.2.1",
120
120
  "oclif": "^6.0.15",
121
- "prettier": "^3.9.10",
122
- "prettier-plugin-svelte": "^4.1.1",
123
- "svelte-eslint-parser": "^1.10.0",
124
121
  "ts-node": "^10.9.2",
125
122
  "tsconfig-paths": "^4.2.0",
126
123
  "tsdown": "^0.23.4",
@@ -128,11 +125,6 @@
128
125
  "vite": "^8.3.5",
129
126
  "vitest": "^5.0.5"
130
127
  },
131
- "config": {
132
- "commitizen": {
133
- "path": "./node_modules/@cenk1cenk2/cz-cc"
134
- }
135
- },
136
128
  "bugs": {
137
129
  "url": "https://gitlab.kilic.dev/utils/md-printer/-/issues"
138
130
  },
@@ -142,8 +134,6 @@
142
134
  "start": "./bin/run.js",
143
135
  "build": "tsdown",
144
136
  "dev:start": "tsdown --watch src/",
145
- "format": "prettier --write src/ --log-level warn && eslint --fix",
146
- "lint": "eslint",
147
137
  "manifest": "oclif manifest",
148
138
  "typecheck": "tsc --noEmit",
149
139
  "test": "vitest run"
@@ -1,83 +0,0 @@
1
- <script>
2
- import { Markdown, Page } from '@cenk1cenk2/md-printer/components'
3
-
4
- let { data } = $props()
5
- </script>
6
-
7
- <svelte:head>
8
- {#if data.documentTitle}
9
- <title>{data.documentTitle}</title>
10
- {/if}
11
- </svelte:head>
12
-
13
- <Page>
14
- <Markdown />
15
- </Page>
16
-
17
- <style lang="postcss">
18
- @import 'github-markdown-css/github-markdown-light.css';
19
- @import '@fontsource/montserrat/latin-400.css';
20
- @import '@fontsource/montserrat/latin-ext-400.css';
21
- @import '@fontsource/montserrat/latin-700.css';
22
- @import '@fontsource/montserrat/latin-ext-700.css';
23
- @import '@fontsource/montserrat/latin-800.css';
24
- @import '@fontsource/montserrat/latin-ext-800.css';
25
-
26
- .markdown-body {
27
- font-size: 11px;
28
- font-family: 'Montserrat', sans-serif;
29
- }
30
-
31
- .markdown-body h1,
32
- .markdown-body h2 {
33
- font-weight: 800;
34
- }
35
-
36
- .markdown-body h3,
37
- .markdown-body h4,
38
- .markdown-body h5,
39
- .markdown-body h6,
40
- .markdown-body strong,
41
- .markdown-body b {
42
- font-weight: 700;
43
- }
44
-
45
- .markdown-body pre > code {
46
- white-space: pre-wrap;
47
- padding: 0;
48
- margin: 0;
49
- }
50
-
51
- .markdown-body .document-title-header {
52
- height: 500px;
53
- margin: auto auto;
54
- padding-top: 50%;
55
- break-after: page;
56
- border-bottom: 0;
57
- font-size: 2.5em;
58
- }
59
-
60
- .markdown-body pre {
61
- padding: 12px 8px;
62
- }
63
-
64
- .markdown-body output pre {
65
- margin-top: -36px;
66
- border-top-left-radius: 0;
67
- border-top-right-radius: 0;
68
- border-top: 2px solid #d1d9e0;
69
- }
70
-
71
- .markdown-body output::before {
72
- padding: 4px 16px;
73
- position: relative;
74
- top: -24px;
75
- border-top-left-radius: 4px;
76
- border-top-right-radius: 4px;
77
- border-top: 2px solid #d1d9e0;
78
- color: #59636e;
79
- background-color: #f6f8fa;
80
- content: '> output';
81
- font-size: 0.85em;
82
- }
83
- </style>
@@ -1,7 +0,0 @@
1
- {
2
- "pdfOptions": {
3
- "format": "A4",
4
- "margin": "18mm 12mm",
5
- "printBackground": true
6
- }
7
- }
@@ -1,247 +0,0 @@
1
- <script>
2
- import Client from './components/Client.svelte'
3
- import Company from './components/Company.svelte'
4
- import Items from './components/Items.svelte'
5
- import Notes from './components/Notes.svelte'
6
- import Payment from './components/Payment.svelte'
7
- import Signature from './components/Signature.svelte'
8
- import Totals from './components/Totals.svelte'
9
- import { Page, PageNumber, TotalPages, Title } from '@cenk1cenk2/md-printer/components'
10
-
11
- let { data, content, t, signature } = $props()
12
-
13
- const { company = {}, client = {}, payment = {}, currency = '', date, id } = $derived(data)
14
-
15
- const rows = $derived.by(() =>
16
- (data.items ?? []).map((item) => {
17
- const subtotal = item.quantity * item.price
18
- const tax = (subtotal * item.tax) / 100
19
-
20
- return {
21
- item,
22
- subtotal,
23
- tax,
24
- total: subtotal + tax
25
- }
26
- })
27
- )
28
- const calculatedSubtotal = $derived(rows.reduce((sum, row) => sum + row.subtotal, 0))
29
- const calculatedTax = $derived(rows.reduce((sum, row) => sum + row.tax, 0))
30
- const calculatedTotal = $derived(calculatedSubtotal + calculatedTax)
31
-
32
- const title = $derived(
33
- `${date} - Invoice from ${company.name}${company.tax_number ? ` (${company.tax_number})` : ''} to ${client.name}${client.tax_number ? ` (${client.tax_number})` : ''} - #${id}`
34
- )
35
- </script>
36
-
37
- <svelte:head>
38
- <title>{title}</title>
39
- </svelte:head>
40
-
41
- <Page>
42
- {#snippet footer()}
43
- <div style="margin: 0 auto; text-align: center; font-size: 8px; color: #38404b; width: 100%; padding-top: 8px; margin-bottom: -8px;">
44
- <Title />
45
- -
46
- <b> <PageNumber />/<TotalPages /> </b>
47
- </div>
48
- {/snippet}
49
-
50
- <div class="max-w-full leading-tight prose grid">
51
- <section id="header" class="relative grid grid-cols-12">
52
- <Company {company} {t} />
53
- </section>
54
- <section id="client" class="grid grid-cols-12">
55
- <Client {client} {date} {id} {t} />
56
- </section>
57
- <section id="items" class="grid grid-cols-12">
58
- <Items {rows} {currency} {t} />
59
- </section>
60
- <section id="payment" class="grid grid-cols-12">
61
- <Payment {payment} {t} />
62
- <div class="col-span-1"></div>
63
- <Totals subtotal={calculatedSubtotal} tax={calculatedTax} total={calculatedTotal} {currency} {t} />
64
- </section>
65
- <section id="footer" class="grid grid-cols-12">
66
- <Notes {content} {t} />
67
- <div class="col-span-1"></div>
68
- <Signature {signature} {t} />
69
- </section>
70
- </div>
71
- </Page>
72
-
73
- <style lang="postcss">
74
- @import '@fontsource/montserrat/latin-400.css';
75
- @import '@fontsource/montserrat/latin-ext-400.css';
76
- @import '@fontsource/montserrat/latin-500.css';
77
- @import '@fontsource/montserrat/latin-ext-500.css';
78
- @import '@fontsource/montserrat/latin-700.css';
79
- @import '@fontsource/montserrat/latin-ext-700.css';
80
- @import '@fontsource/montserrat/latin-800.css';
81
- @import '@fontsource/montserrat/latin-ext-800.css';
82
- @import '@fontsource/montserrat/latin-900.css';
83
- @import '@fontsource/montserrat/latin-ext-900.css';
84
-
85
- @import 'tailwindcss';
86
- @plugin '@tailwindcss/typography';
87
-
88
- @theme {
89
- --font-sans: 'Montserrat';
90
- --font-serif: 'Montserrat';
91
- --font-weight-semibold: 700;
92
- --font-weight-bold: 800;
93
- --font-weight-extrabold: 900;
94
- --color-primary-500: #cd0043;
95
- --color-gray-50: oklch(98.5% 0.002 247.839);
96
- --color-gray-100: #abb2bf;
97
- --color-gray-200: #979eab;
98
- --color-gray-300: #7c8a9d;
99
- --color-gray-400: #5c6370;
100
- --color-gray-500: #4b5263;
101
- --color-gray-600: #2c333d;
102
- --color-gray-700: #22282f;
103
- --color-gray-800: #1e2127;
104
- --color-gray-900: #17191e;
105
- --color-gray-950: oklch(13% 0.028 261.692);
106
- }
107
-
108
- *,
109
- ::after,
110
- ::before,
111
- ::backdrop,
112
- ::file-selector-button {
113
- border-color: var(--color-gray-200, currentcolor);
114
- }
115
-
116
- body {
117
- font-family: var(--font-sans);
118
- }
119
-
120
- address {
121
- @apply text-sm;
122
- white-space: pre-line;
123
- }
124
-
125
- /* Typography styles converted from config */
126
- .prose a {
127
- text-decoration: none;
128
- }
129
-
130
- .prose h1 {
131
- font-weight: 800;
132
- padding-top: 0.1875rem;
133
- /* 0.75 * 0.25rem */
134
- padding-bottom: 0.1875rem;
135
- margin-bottom: 0;
136
- margin-top: 0;
137
- border-width: 0;
138
- }
139
-
140
- .prose h2 {
141
- font-weight: 800;
142
- padding-top: 0.125rem;
143
- /* 0.5 * 0.25rem */
144
- padding-bottom: 0.125rem;
145
- margin-bottom: 0;
146
- margin-top: 0;
147
- border-width: 0;
148
- }
149
-
150
- .prose h3 {
151
- font-weight: 700;
152
- padding-top: 0.0625rem;
153
- /* 0.25 * 0.25rem */
154
- padding-bottom: 0.0625rem;
155
- margin-bottom: 0;
156
- margin-top: 0;
157
- border-width: 0;
158
- }
159
-
160
- p {
161
- margin: 0.1em 0em;
162
- }
163
-
164
- .prose blockquote {
165
- font-weight: 400;
166
- color: var(--color-gray-600);
167
- font-style: normal;
168
- quotes: '\201C' '\201D' '\2018' '\2019';
169
- }
170
-
171
- .prose blockquote p:first-of-type::before {
172
- content: '';
173
- }
174
-
175
- .prose blockquote p:last-of-type::after {
176
- content: '';
177
- }
178
-
179
- .prose ul > li {
180
- padding-left: 1em;
181
- text-align: left;
182
- }
183
-
184
- .prose ol > li {
185
- padding-left: 1em;
186
- text-align: left;
187
- }
188
-
189
- .prose ol > li::before {
190
- top: calc(0.875em - 0.1em);
191
- }
192
-
193
- .prose ul > li::before {
194
- top: calc(0.875em - 0.1em);
195
- }
196
-
197
- html {
198
- font-size: 12px;
199
- }
200
-
201
- .page-break {
202
- page-break-after: always;
203
- }
204
-
205
- .text-vertical {
206
- text-orientation: upright;
207
- writing-mode: vertical-lr;
208
- display: flex;
209
- flex-direction: column;
210
- justify-content: center;
211
- @apply p-4;
212
- }
213
-
214
- /* md-to-pdf ships github-markdown-css, which sets `table { display: block }` for horizontal
215
- * scrolling. That collapses rows into an anonymous max-content box, so column widths are ignored. */
216
- table {
217
- display: table;
218
- width: 100%;
219
- }
220
-
221
- table th {
222
- @apply bg-gray-700 text-white;
223
- }
224
-
225
- table tr {
226
- border-top: 0;
227
- break-inside: avoid;
228
- }
229
-
230
- /* zebra rows only pay off over many rows, so striping is opt-in; the short key/value
231
- * tables use hairline row dividers instead and stay quieter beside the items table.
232
- * The reset is needed because md-to-pdf's markdown.css stripes every table itself. */
233
- table tr:nth-child(even) {
234
- background-color: transparent;
235
- }
236
-
237
- table.striped tr:nth-child(even) {
238
- @apply bg-gray-50;
239
- }
240
-
241
- table th,
242
- table td,
243
- table tr {
244
- border: 0;
245
- padding: 0.5em 0.5em;
246
- }
247
- </style>
@@ -1,42 +0,0 @@
1
- <!--
2
- @component
3
- Recipient details and the date/id table of the invoice.
4
- -->
5
- <script>
6
- /**
7
- * @type {{
8
- * client: { name?: string, tax_number?: string, address?: string },
9
- * date: string,
10
- * id: string | number,
11
- * t: (key: string) => string
12
- * }}
13
- */
14
- let { client, date, id, t } = $props()
15
- </script>
16
-
17
- <div class="col-span-1 flex flex-col justify-center text-lg font-extrabold text-gray-100">
18
- <p class="text-vertical">{t('sections.to')}</p>
19
- </div>
20
- <div class="col-span-5 flex flex-col justify-start p-4">
21
- <h2>{client.name}</h2>
22
- {#if client.tax_number}
23
- <h3>{client.tax_number}</h3>
24
- {/if}
25
- <address>{(client.address ?? '').trim()}</address>
26
- </div>
27
- <div class="col-span-6 flex items-center justify-center text-xs py-4 pl-4 pr-16">
28
- <div class="w-full overflow-hidden rounded-xl border-y-2 shadow-md shadow-gray-300 border-gray-900!">
29
- <table class="w-full table-auto my-0!">
30
- <tbody>
31
- <tr>
32
- <td class="w-[30%] text-left align-middle text-sm font-bold">{t('fields.date')}</td>
33
- <td class="w-[70%] text-right align-middle text-sm font-semibold whitespace-nowrap">{date}</td>
34
- </tr>
35
- <tr>
36
- <td class="w-[30%] text-left align-middle text-sm font-bold border-t! border-t-gray-100/30!">{t('fields.id')}</td>
37
- <td class="w-[70%] text-right align-middle text-sm font-semibold whitespace-nowrap border-t! border-t-gray-100/30!">{id}</td>
38
- </tr>
39
- </tbody>
40
- </table>
41
- </div>
42
- </div>
@@ -1,41 +0,0 @@
1
- <!--
2
- @component
3
- Logo, sender details and invoice title cells of the invoice header.
4
- -->
5
- <script>
6
- /**
7
- * @type {{
8
- * company: { name?: string, tax_number?: string, address?: string, phone?: string, email?: string, website?: string },
9
- * t: (key: string) => string
10
- * }}
11
- */
12
- let { company, t } = $props()
13
- </script>
14
-
15
- <img
16
- src="https://main.s3.kilic.dev/html/icon.png"
17
- alt="logo"
18
- class="absolute h-40 top-1/2 left-1/2 -translate-x-1/2 -translate-y-[62%] drop-shadow-lg drop-shadow-gray-900 z-10"
19
- />
20
- <div class="col-span-1 flex flex-col justify-center text-lg font-extrabold text-gray-100">
21
- <p class="text-vertical">{t('sections.from')}</p>
22
- </div>
23
- <div class="col-start-2 col-span-5 flex flex-col justify-start p-4 pt-10 mr-12">
24
- <h1>{company.name}</h1>
25
- <h3>{company.tax_number}</h3>
26
- <address>{(company.address ?? '').trim()}</address>
27
- <div class="flex flex-col text-sm">
28
- {#if company.phone}
29
- <a href="tel:{company.phone}">{company.phone}</a>
30
- {/if}
31
- {#if company.email}
32
- <a href="mailto:{company.email}">{company.email}</a>
33
- {/if}
34
- {#if company.website}
35
- <a href={company.website}>{company.website}</a>
36
- {/if}
37
- </div>
38
- </div>
39
- <div class="col-span-6 bg-gray-900 rounded-bl-4xl flex flex-col justify-center text-center">
40
- <p class="p-4 font-bold text-white text-6xl">{t('invoice')}</p>
41
- </div>
@@ -1,66 +0,0 @@
1
- <!--
2
- @component
3
- Table of invoice line items with their subtotal, tax and total.
4
- -->
5
- <script>
6
- import { round } from '../round.js'
7
-
8
- /**
9
- * @type {{
10
- * rows: { item: { description?: string, quantity: number, unit?: string, price: number, tax: number }, subtotal: number, tax: number, total: number }[],
11
- * currency: string,
12
- * t: (key: string) => string
13
- * }}
14
- */
15
- let { rows, currency, t } = $props()
16
- </script>
17
-
18
- <div class="col-span-12 px-16 py-4">
19
- <div class="overflow-hidden rounded-xl border-y-2 shadow-md shadow-gray-300 border-gray-900!">
20
- <table class="striped w-full table-auto my-0!">
21
- <thead class="border-b-1 border-b-gray-900! border-x-2 border-x-gray-900!">
22
- <tr>
23
- <th scope="col" class="w-md text-center">
24
- {t('table.description')}
25
- </th>
26
- <th scope="col" class="w-[10%] text-center">
27
- {t('table.quantity')}
28
- </th>
29
- <th scope="col" class="w-[10%] text-center">
30
- {t('table.price')}
31
- </th>
32
- <th scope="col" class="w-[10%] text-center">
33
- {t('table.subtotal')}
34
- </th>
35
- <th scope="col" class="w-[10%] text-center">
36
- {t('table.tax')}
37
- </th>
38
- <th scope="col" class="w-[14%] font-semibold text-center">
39
- {t('table.total')}
40
- </th>
41
- </tr>
42
- </thead>
43
- <tbody>
44
- {#each rows as row, index (index)}
45
- <tr>
46
- <td class="text-left align-middle">{row.item.description}</td>
47
- <td class="text-center align-middle">{row.item.quantity} {row.item.unit}</td>
48
- <td class="text-center align-middle">{row.item.price}{currency}</td>
49
- <td class="text-center align-middle">{round(row.subtotal)}{currency}</td>
50
- <td class="text-center align-middle">
51
- {#if row.tax > 0}
52
- <div class="flex flex-row items-center">
53
- <span class="w-8 shrink-0 mr-1 py-px rounded-full text-center text-[0.50rem] font-semibold bg-gray-700 text-white">{row.item.tax}%</span>
54
- <span>{round(row.tax)}{currency}</span>
55
- </div>
56
- {:else}
57
- <span class="font-semibold">—</span>
58
- {/if}
59
- </td>
60
- <td class="font-semibold text-right align-middle">{round(row.total)}{currency}</td>
61
- </tr>
62
- {/each}
63
- </tbody>
64
- </table>
65
- </div>
66
- </div>
@@ -1,21 +0,0 @@
1
- <!--
2
- @component
3
- Rendered markdown body of the document as the invoice notes.
4
- -->
5
- <script>
6
- /**
7
- * @type {{
8
- * content: string,
9
- * t: (key: string) => string
10
- * }}
11
- */
12
- let { content, t } = $props()
13
- </script>
14
-
15
- <div class="col-span-1 flex flex-col justify-center text-lg font-extrabold text-gray-100">
16
- <p class="text-vertical">{t('sections.notes')}</p>
17
- </div>
18
- <div class="col-span-5 flex flex-col p-4 text-sm leading-tight prose">
19
- <!-- eslint-disable-next-line svelte/no-at-html-tags -- markdown input is trusted, same as the document itself -->
20
- {@html content}<br />
21
- </div>
@@ -1,25 +0,0 @@
1
- <!--
2
- @component
3
- Bank details of the payee, shown beside the totals.
4
- -->
5
- <script>
6
- /**
7
- * @type {{
8
- * payment: { bank?: string, address?: string, bic?: string, routing?: string, name?: string, iban?: string },
9
- * t: (key: string) => string
10
- * }}
11
- */
12
- let { payment, t } = $props()
13
- </script>
14
-
15
- <div class="col-span-1 flex flex-col justify-center text-lg font-extrabold text-gray-100 bg-gray-900">
16
- <p class="text-vertical">{t('sections.payment')}</p>
17
- </div>
18
- <div class="col-span-5 flex flex-col p-4 ml-[-1px] pl-5 justify-center bg-gray-700 rounded-r-4xl text-white">
19
- <span>{payment.bank}</span>
20
- <address>{(payment.address ?? '').trim()}</address>
21
- <span>{payment.bic}</span>
22
- <span>{payment.routing}</span>
23
- <span class="mt-4 font-semibold">{payment.name}</span>
24
- <span class="font-semibold">{payment.iban}</span>
25
- </div>
@@ -1,34 +0,0 @@
1
- <!--
2
- @component
3
- Signature block of the invoice: the digital signature when signing is enabled, an empty box otherwise.
4
- -->
5
- <script>
6
- import { SignatureBlock } from '@cenk1cenk2/md-printer/components'
7
-
8
- /**
9
- * @type {{
10
- * signature?: { date: string, name?: string, issuer?: string, serial?: string },
11
- * t: (key: string) => string
12
- * }}
13
- */
14
- let { signature, t } = $props()
15
- </script>
16
-
17
- {#if signature}
18
- <div class="col-span-5 flex flex-col justify-center m-8 mr-16">
19
- <SignatureBlock
20
- {signature}
21
- labels={{
22
- title: t('signed.title'),
23
- by: t('signed.by'),
24
- date: t('signed.date'),
25
- issuer: t('signed.issuer'),
26
- verify: t('signed.verify')
27
- }}
28
- />
29
- </div>
30
- {:else}
31
- <div class="col-span-5 flex flex-col justify-end text-center m-8 mr-16 p-4 pb-0 border-2 border-gray-50! rounded-xl text-xs text-gray-100 h-36">
32
- <p>{t('signature')}</p>
33
- </div>
34
- {/if}