Compare commits

216 Commits

Author SHA1 Message Date
DanielS
0ec1319753 style(mail): humanize email templates and remove corporate boilerplates
All checks were successful
Staging Build / build (push) Successful in 2m39s
2026-07-07 00:39:06 +02:00
DanielS
057012e09f chore(supabase): remove unused pos_modules and licenses tables 2026-07-07 00:23:54 +02:00
DanielS
2246bdf2be refactor(shop): extract wizard validation and email templates into helpers
All checks were successful
Staging Build / build (push) Successful in 2m48s
2026-07-06 23:15:11 +02:00
DanielS
3a73083494 fix(supabase): remove invalid public.partners reference in migration
All checks were successful
Staging Build / build (push) Successful in 2m39s
2026-07-06 22:57:18 +02:00
DanielS
73b6d19703 docs(skills): add commit-work skill with frontmatter
All checks were successful
Staging Build / build (push) Successful in 2m44s
2026-07-06 22:47:14 +02:00
DanielS
2d44dd4c58 security: fix 6 critical RLS vulns, SHA-256 hash, DSGVO [GELÖSCHT], completed status
Some checks failed
Staging Build / build (push) Has been cancelled
2026-07-06 22:39:05 +02:00
DanielS
3d938d29fc feat: add skills (pdf-invoice-generator, idempotency-guard, b2b-mail-dispatcher) 2026-07-06 22:33:59 +02:00
DanielS
c07871eac4 feat: add agent skills (rls, wizard, snapshot, gdpr, next15, uiux, humanizer) 2026-07-06 22:27:42 +02:00
DanielS
a64b6790c6 feat: Add partner account settings page under /account-kunden
All checks were successful
Staging Build / build (push) Successful in 3m33s
2026-07-04 21:06:46 +02:00
DanielS
060aa97ce5 fix: PDF headers with filename, email download button via protected route
All checks were successful
Staging Build / build (push) Successful in 3m29s
2026-07-04 17:50:02 +02:00
DanielS
80abbfe566 security: replace public PDF URLs with authenticated API route, private bucket
All checks were successful
Staging Build / build (push) Successful in 3m33s
2026-07-04 17:43:33 +02:00
DanielS
28f2285a0e security: fix private storage buckets, api access, and admin RLS bypasses
All checks were successful
Staging Build / build (push) Successful in 3m41s
2026-07-04 17:36:51 +02:00
DanielS
205acb803f docs: update funktionen.md with direct order-to-company mapping
All checks were successful
Staging Build / build (push) Successful in 3m30s
2026-07-04 17:32:52 +02:00
DanielS
5bad959b13 fix: change default internal rewrite and server resolution host to kong
All checks were successful
Staging Build / build (push) Successful in 3m28s
2026-07-04 17:19:09 +02:00
DanielS
f82f08ffd0 fix: resolve internal kong url to configurable public supabase url
All checks were successful
Staging Build / build (push) Successful in 3m30s
2026-07-04 17:15:09 +02:00
DanielS
6a0e882cc9 feat: enforce company authorization on order details and success pages
All checks were successful
Staging Build / build (push) Successful in 3m45s
2026-07-04 16:44:53 +02:00
DanielS
9c50ea8368 fix: resolve internal supabase-kong urls to external domain
All checks were successful
Staging Build / build (push) Successful in 3m24s
2026-07-04 16:38:27 +02:00
DanielS
305af64fd6 feat: assign orders to companies directly and support admin reassignment
All checks were successful
Staging Build / build (push) Successful in 3m36s
2026-07-04 16:08:31 +02:00
DanielS
72852a6b08 docs: add project documentation funktionen.md 2026-07-04 15:43:45 +02:00
DanielS
32c2842dbd feat: enable company-wide order viewing and editing
All checks were successful
Staging Build / build (push) Successful in 3m31s
2026-07-04 15:41:48 +02:00
DanielS
149eae59c9 feat: restrict order creation to users assigned to a company
All checks were successful
Staging Build / build (push) Successful in 3m31s
2026-07-04 15:33:44 +02:00
DanielS
5f65f890ee feat: link end customers directly to companies
All checks were successful
Staging Build / build (push) Successful in 3m37s
2026-07-04 15:17:04 +02:00
DanielS
d3bf4b1db9 feat(admin): set default partner_id to companyId in end-customer dialog
All checks were successful
Staging Build / build (push) Successful in 3m28s
2026-07-03 16:22:59 +02:00
DanielS
553ec7eadd fix(admin-orders): make PDF download/view always available by generating PDF dynamically on the fly if missing
All checks were successful
Staging Build / build (push) Successful in 3m33s
2026-07-03 15:14:34 +02:00
DanielS
4c6fde326b refactor(order): change order prefix from BE to AE for Anfragenummer 2026-07-03 14:58:43 +02:00
DanielS
23be8bcb52 refactor(wording): change 'Angebot' to 'Anfrage' in client views and order emails 2026-07-03 14:55:56 +02:00
DanielS
5c28fbdea5 feat(wizard): support OR logic for requirements (at least one dependency satisfies requirements)
All checks were successful
Staging Build / build (push) Successful in 3m32s
2026-07-03 14:21:15 +02:00
DanielS
90ec351d96 fix(db-tools): resolve REINDEX transaction error by executing directly via pg client, and dynamically support all database tables in integrity dashboard 2026-07-03 14:01:27 +02:00
DanielS
38651037bc fix(users): refactor user admin actions to return status objects instead of throwing to prevent production error obfuscation
All checks were successful
Staging Build / build (push) Successful in 3m29s
2026-07-03 13:51:00 +02:00
DanielS
12d06e46ad feat(email): improve password reset emails, onboarding templates, and handle server action errors without production obfuscation
All checks were successful
Staging Build / build (push) Successful in 3m28s
2026-07-03 13:34:43 +02:00
DanielS
f914e9cdf1 fix(auth): restore middleware, fix setup redirect loop, and add next.config rewrites proxying Supabase requests
All checks were successful
Staging Build / build (push) Successful in 3m27s
2026-07-03 10:57:22 +02:00
DanielS
99f859cde3 style(admin): make product table list scrollable with sticky header
All checks were successful
Staging Build / build (push) Successful in 3m27s
2026-07-03 10:50:31 +02:00
DanielS
4f69fd7e44 feat(role): add 'verwaltung' role with gated access to settings and tools
All checks were successful
Staging Build / build (push) Successful in 3m26s
2026-07-03 10:10:57 +02:00
DanielS
ca07dd0079 feat(setup): make isSetupNeeded check more robust using both auth listUsers and db count 2026-07-03 10:05:18 +02:00
DanielS
233b9f135d feat(setup): remove default admin info@hephex.de automation 2026-07-03 09:59:07 +02:00
DanielS
6dc1b1c00c feat(setup): add initial setup wizard for admin account and SMTP configuration 2026-07-03 09:55:24 +02:00
DanielS
f5f577ea73 feat(customer): add bank account details support 2026-07-03 09:46:47 +02:00
DanielS
250dd82847 style(home): update Zulip and Wiki card icons to fit their concepts 2026-07-03 09:39:14 +02:00
DanielS
b8420cc1ee style(home): change license order CTA to inquiry and refine text
All checks were successful
Staging Build / build (push) Successful in 3m22s
2026-07-03 09:02:33 +02:00
DanielS
7a61002ef5 feat(order): add net/tax/gross breakdown for one-time and monthly totals
All checks were successful
Staging Build / build (push) Successful in 3m28s
2026-07-03 08:50:28 +02:00
DanielS
147dab5607 fix: fix overlapping PDF labels and show net tax gross prices in wizard
All checks were successful
Staging Build / build (push) Successful in 3m25s
2026-07-03 01:13:16 +02:00
DanielS
e67695e36e fix: prevent resolving internal supabase urls to localhost inside docker container
All checks were successful
Staging Build / build (push) Successful in 3m37s
2026-07-03 01:04:49 +02:00
DanielS
728363fa71 feat: hide excluded products and auto-deselect conflicts in wizard
All checks were successful
Staging Build / build (push) Successful in 3m25s
2026-07-03 00:52:22 +02:00
DanielS
4b3ba63e2c fix: resolve Supabase storage pdf URLs on client and server
Some checks failed
Staging Build / build (push) Has been cancelled
2026-07-03 00:49:11 +02:00
DanielS
78a16607f9 feat: allow quote editing for all statuses except completed
All checks were successful
Staging Build / build (push) Successful in 3m35s
2026-07-03 00:30:25 +02:00
DanielS
2bfadb49c8 feat: open wizard directly at software step (step 3) when editing 2026-07-03 00:29:22 +02:00
DanielS
2dcc20eb3a style: force dark mode globally and remove theme switcher 2026-07-03 00:26:37 +02:00
DanielS
a9e120e681 Merge branch 'staging' of https://gitea.hephex.de/admin/webshop into staging
All checks were successful
Staging Build / build (push) Successful in 3m27s
2026-07-03 00:22:51 +02:00
DanielS
081baf15ee style: improve accessibility contrast and set default theme to dark 2026-07-03 00:22:10 +02:00
DanielS
e3cdf6683a feat: implement quote editing for admins and creators 2026-07-03 00:22:10 +02:00
DanielS
d72f0b10db Kontraste verbessert und Standard-Theme auf Dunkel gesetzt
All checks were successful
Staging Build / build (push) Successful in 3m40s
2026-07-03 00:15:54 +02:00
DanielS
a4414cc0e6 Angebote bearbeiten fuer Admin und Ersteller implementiert
All checks were successful
Staging Build / build (push) Successful in 3m51s
2026-07-03 00:03:48 +02:00
DanielS
023c789baf feat: add customer search and scrollable list to orderwizard
All checks were successful
Staging Build / build (push) Successful in 3m37s
2026-07-01 09:37:30 +02:00
DanielS
a3498fee66 Merge branch 'staging' of https://gitea.hephex.de/Daniel/webshop into staging
All checks were successful
Staging Build / build (push) Successful in 3m39s
2026-07-01 08:41:21 +02:00
DanielS
f3baada896 limit recent orders visibility to last 3
All checks were successful
Staging Build / build (push) Successful in 3m26s
2026-06-30 22:36:40 +02:00
DanielS
8f447d52e5 Add lockout logic and email notification utils
All checks were successful
Staging Build / build (push) Successful in 3m34s
2026-06-30 22:28:30 +02:00
DanielS
4927216794 limit recent orders visibility to last 5
All checks were successful
Staging Build / build (push) Successful in 3m29s
2026-06-30 22:09:12 +02:00
DanielS
541a9651ec Fix recent orders component UI and styling
All checks were successful
Staging Build / build (push) Successful in 3m40s
2026-06-30 22:00:38 +02:00
DanielS
c4fe221350 Update external links to real URLs for Zulip, Wiki, Support
All checks were successful
Staging Build / build (push) Successful in 3m36s
2026-06-30 21:26:37 +02:00
DanielS
2f3eb8a3f7 style: update workspace landing page sections and titles 2026-06-30 17:26:33 +02:00
DanielS
d56aab3f8a fix: import LifeBuoy icon in HomeClient
All checks were successful
Staging Build / build (push) Successful in 3m37s
2026-06-30 17:03:40 +02:00
DanielS
4cf1ac0eb7 fix: resolve invitation link expiration by adding verification landing page
All checks were successful
Staging Build / build (push) Successful in 3m35s
2026-06-30 16:21:13 +02:00
DanielS
10f8683d7f style(admin): improve company dropdown layout in user list component
All checks were successful
Staging Build / build (push) Successful in 3m29s
2026-06-30 15:45:00 +02:00
DanielS
19e9733144 feat(admin): add API endpoint to download order confirmation PDF securely as attachment 2026-06-30 15:36:42 +02:00
DanielS
fc51d53aa3 style(admin): align company dropdown in user list to the right to avoid horizontal scrolling
All checks were successful
Staging Build / build (push) Successful in 3m30s
2026-06-30 15:32:08 +02:00
DanielS
4b07e68aa0 style(admin): improve user dialog company dropdown layout
All checks were successful
Staging Build / build (push) Successful in 3m50s
2026-06-30 15:24:02 +02:00
DanielS
19b4ac2729 refactor: rename middleware.ts to proxy.ts per Next.js 16 spec 2026-06-30 15:23:57 +02:00
DanielS
5b7ccfd8d9 fix(dsgvo): correctly anonymize last name and street for end customers 2026-06-30 15:23:44 +02:00
DanielS
fbb75567cf refactor(admin): rename partner to user in company assignment pages 2026-06-30 15:23:39 +02:00
DanielS
8f4f05a3cd refactor: rename orders to inquiries and update PDF and email text 2026-06-30 15:23:33 +02:00
DanielS
bdc9e6541c feat(admin): filter dashboard revenue KPI by current month and completed status 2026-06-30 15:23:28 +02:00
DanielS
e25344a185 docs: update imprint and privacy policy for CASPOS 2026-06-30 15:23:21 +02:00
DanielS
ccdfa7402b refactor(order): rename Bestellbestaetigung to Angebotsbestaetigung
All checks were successful
Staging Build / build (push) Successful in 3m22s
2026-06-26 09:06:45 +02:00
DanielS
fbab22506b feat(admin): edit order status with dropdown and notify partner by email
Some checks failed
Staging Build / build (push) Has been cancelled
2026-06-26 09:04:06 +02:00
DanielS
c9ae185fdf Fix Supabase URL for staging environment and update admin recent orders polling
All checks were successful
Staging Build / build (push) Successful in 3m24s
2026-06-25 23:46:03 +02:00
DanielS
da7bd91b6f fix: query orders using admin client in admin routes to bypass RLS and show all orders to admin
All checks were successful
Staging Build / build (push) Successful in 3m24s
2026-06-25 23:30:29 +02:00
DanielS
45fb87d589 feat: add admin dashboard revenue chart and fix empty customer order bug
All checks were successful
Staging Build / build (push) Successful in 2m35s
2026-06-25 23:23:53 +02:00
DanielS
71c6ad3721 fix: make last license date input only applicable to one-time purchases and ensure multiplier only affects one_time products
All checks were successful
Staging Build / build (push) Successful in 2m22s
2026-06-25 23:07:14 +02:00
DanielS
1a2ace937c feat: add update price modifier for existing customers based on last license date
Some checks failed
Staging Build / build (push) Has been cancelled
2026-06-25 23:04:48 +02:00
DanielS
16fb713665 feat: rename invoice (RE-) to order confirmation (BE-) throughout the application
All checks were successful
Staging Build / build (push) Successful in 2m42s
2026-06-25 22:43:17 +02:00
DanielS
52f2a78753 fix: resolve client-side supabase auth session visibility on page.tsx by querying server-side and passing to HomeClient client component
All checks were successful
Staging Build / build (push) Successful in 2m37s
2026-06-25 22:34:14 +02:00
DanielS
e93cf7805c feat: modernize landing page design, localize login/forgot password forms, and add public privacy/imprint pages
All checks were successful
Staging Build / build (push) Successful in 2m42s
2026-06-25 22:25:11 +02:00
DanielS
08382ff4a1 sec: Add form-action to CSP and remove duplicate HSTS header based on ZAP report
All checks were successful
Staging Build / build (push) Successful in 2m37s
2026-06-25 17:20:27 +02:00
DanielS
f44cf1a5f6 sec: Add HTTP security headers and disable X-Powered-By header based on ZAP report
All checks were successful
Staging Build / build (push) Successful in 2m36s
2026-06-25 15:49:40 +02:00
DanielS
d3df9998f0 feat: Add database backup export and import as ZIP in admin settings
All checks were successful
Staging Build / build (push) Successful in 2m39s
2026-06-25 15:18:41 +02:00
DanielS
47928fad3f feat: Add product dependencies (requirements and exclusions) to database, admin UI and wizard validation
All checks were successful
Staging Build / build (push) Successful in 2m39s
2026-06-25 14:38:30 +02:00
DanielS
5a292a8ddc feat: Add action and dialog to copy/transfer modules between products
All checks were successful
Staging Build / build (push) Successful in 2m39s
2026-06-25 14:03:26 +02:00
DanielS
9246fb7d77 fix: Filter products in admin list based on show_in_kauf and show_in_abo flags instead of billing_interval
All checks were successful
Staging Build / build (push) Successful in 2m36s
2026-06-25 13:07:18 +02:00
DanielS
9e189f331a feat: Add quantity support for product modules, multiply prices in order snapshot and pdf
Some checks failed
Staging Build / build (push) Has been cancelled
2026-06-25 13:04:37 +02:00
DanielS
fe05e13d3f feat: add Kaufprodukte and Mietprodukte filter checkboxes in products view
All checks were successful
Staging Build / build (push) Successful in 2m48s
2026-06-25 12:51:17 +02:00
DanielS
fd7a53b954 fix: resolve dialog scrolling overlap by transition to flex layout and native overflow-y-auto
All checks were successful
Staging Build / build (push) Successful in 2m36s
2026-06-25 09:50:43 +02:00
DanielS
563a483c8d fix: constrain ScrollArea maxHeight to force dialog scrolling
All checks were successful
Staging Build / build (push) Successful in 2m34s
2026-06-25 09:24:41 +02:00
DanielS
4fa5f71d16 feat: change products view sorting to category grouping with subheaders
All checks were successful
Staging Build / build (push) Successful in 2m34s
2026-06-25 09:19:28 +02:00
DanielS
ab9f8f93be feat: add sort by category button to products list view
All checks were successful
Staging Build / build (push) Successful in 2m20s
2026-06-25 09:15:39 +02:00
DanielS
5608e9fcc6 fix: make admin product edit form scrollable to prevent modules cutoff
Some checks failed
Staging Build / build (push) Has been cancelled
2026-06-25 09:13:48 +02:00
DanielS
25703d400b fix: adjust button text colors for dark mode default buttons
All checks were successful
Staging Build / build (push) Successful in 2m37s
2026-06-25 09:10:38 +02:00
DanielS
f9fb90848b feat: restructure checkout steps, add Kauf/Abo selection and product display flags
All checks were successful
Staging Build / build (push) Successful in 2m41s
2026-06-25 09:03:53 +02:00
DanielS
eafd890297 feat: update landing page icons for retail, gastronomy, and hybrid modules
All checks were successful
Staging Build / build (push) Successful in 2m40s
2026-06-25 02:57:24 +02:00
DanielS
af44f4b3be feat: Add Orders link to navbar dropdown for partner role
All checks were successful
Staging Build / build (push) Successful in 2m39s
2026-06-25 02:53:27 +02:00
DanielS
b2656345e8 feat: Send email confirmation with PDF attachment upon successful order
All checks were successful
Staging Build / build (push) Successful in 2m34s
2026-06-25 02:47:03 +02:00
DanielS
7cad819df8 fix: Invalidate user list cache on company creation and refresh page on popup creation
All checks were successful
Staging Build / build (push) Successful in 2m44s
2026-06-25 02:37:45 +02:00
DanielS
b537ca50cf feat: Add email field to end_customers table and UI screens
All checks were successful
Staging Build / build (push) Successful in 2m36s
2026-06-25 02:29:33 +02:00
DanielS
b9e6559bff style: Update warning title for unassigned users 2026-06-25 02:27:26 +02:00
DanielS
2f96552fe8 revert: Remove group by partner option from end customers view
All checks were successful
Staging Build / build (push) Successful in 2m37s
2026-06-25 02:23:50 +02:00
DanielS
6a2fc16f75 feat: Add group by partner option to company end customers list
All checks were successful
Staging Build / build (push) Successful in 2m36s
2026-06-25 02:18:53 +02:00
DanielS
0ff4df2a12 feat: Add end customer view for companies with CRUD and partner assignment
Some checks failed
Staging Build / build (push) Has been cancelled
2026-06-25 02:18:00 +02:00
DanielS
ef9422908d feat: list end customers in companies admin and improve dark/light mode contrast across all admin components
All checks were successful
Staging Build / build (push) Successful in 2m36s
2026-06-25 02:11:07 +02:00
DanielS
bf27c62f62 feat: add button and modal to display users (partners) of a company in companies management page
All checks were successful
Staging Build / build (push) Successful in 2m49s
2026-06-25 01:58:34 +02:00
DanielS
5a2edef0df feat: add search field to companies list page
Some checks failed
Staging Build / build (push) Has been cancelled
2026-06-25 01:57:40 +02:00
DanielS
a1ad75c2db feat: add delivery address migration, update companies server actions and rewrite companies page to support creation and edit of full address
All checks were successful
Staging Build / build (push) Successful in 2m37s
2026-06-25 01:52:05 +02:00
DanielS
85df922498 feat: make company selection mandatory for partner role and add inline company creation in UserDialog
All checks were successful
Staging Build / build (push) Successful in 2m21s
2026-06-25 01:43:53 +02:00
DanielS
67a2c2a67b feat: add hideLocked checkbox to filter out gesperrt users by default
Some checks failed
Staging Build / build (push) Has been cancelled
2026-06-25 01:41:51 +02:00
DanielS
07c2758b73 feat: add first_name and last_name to users and implement inline editing in user-list
All checks were successful
Staging Build / build (push) Successful in 2m40s
2026-06-25 01:38:07 +02:00
DanielS
30a9de0e6d style: clarify user deletion blocking message and offer to lock instead
All checks were successful
Staging Build / build (push) Successful in 2m36s
2026-06-25 01:33:57 +02:00
DanielS
24929494a6 feat: check for existing orders before user deletion and offer to lock instead
Some checks failed
Staging Build / build (push) Has been cancelled
2026-06-25 01:33:38 +02:00
DanielS
86d71b2441 fix: improve deleteUser error logging and handling to prevent silent DB failures
All checks were successful
Staging Build / build (push) Successful in 2m35s
2026-06-25 01:30:10 +02:00
DanielS
744302e8ab fix: resolve popover cutoff inside table by setting overflow-visible and adding debug logging for companies
Some checks failed
Staging Build / build (push) Has been cancelled
2026-06-25 01:29:01 +02:00
DanielS
396f135e87 fix: resolve infinite loading on user deletion by adding try-finally and deleting from public.users first
All checks were successful
Staging Build / build (push) Successful in 2m35s
2026-06-25 01:25:49 +02:00
DanielS
03d711c2e1 style: rename CASPOS to CASPOS Shop in welcome email
All checks were successful
Staging Build / build (push) Successful in 2m39s
2026-06-25 01:19:33 +02:00
DanielS
2de8913dac style: replace HEPHEX branding with CASPOS in welcome email
Some checks failed
Staging Build / build (push) Has been cancelled
2026-06-25 01:18:26 +02:00
DanielS
82e877249a style: improve welcome email layout and content
Some checks failed
Staging Build / build (push) Has been cancelled
2026-06-25 01:17:54 +02:00
DanielS
872e973a36 fix: add missing use client directive to user-dialog.tsx
All checks were successful
Staging Build / build (push) Successful in 2m34s
2026-06-25 01:11:14 +02:00
DanielS
4cd6d86f33 feat: add company selection to user dialog, require email password link on user creation, password validation with confirmation, and company grouping with search
Some checks failed
Staging Build / build (push) Failing after 25s
2026-06-25 01:09:19 +02:00
DanielS
69c8e8e5c1 fix: use token_hash with /auth/confirm route for password reset link
All checks were successful
Staging Build / build (push) Successful in 2m36s
2026-06-25 00:54:10 +02:00
DanielS
5652ce1098 fix: replace localhost in reset link with staging domain
All checks were successful
Staging Build / build (push) Successful in 2m46s
2026-06-25 00:30:20 +02:00
DanielS
cebf677758 fix: clean users.ts rewrite, add company_id to createUser, fix resetPassword link
All checks were successful
Staging Build / build (push) Successful in 2m38s
2026-06-25 00:20:18 +02:00
DanielS
410289a519 Fix typings and company name access
All checks were successful
Staging Build / build (push) Successful in 2m38s
2026-06-25 00:07:08 +02:00
DanielS
49607f484f Add email send to password reset
Some checks failed
Staging Build / build (push) Failing after 25s
2026-06-24 23:56:52 +02:00
DanielS
2120698192 Clean admin settings page, remove duplicate imports and partner code
All checks were successful
Staging Build / build (push) Successful in 2m41s
2026-06-24 23:39:33 +02:00
DanielS
a9a5dd4e6f Cleanup admin settings page, remove duplicate imports and partner code
Some checks failed
Staging Build / build (push) Failing after 25s
2026-06-24 23:37:40 +02:00
DanielS
520599986c Add user lock/unlock functionality and remove partner management
Some checks failed
Staging Build / build (push) Failing after 26s
2026-06-24 23:29:16 +02:00
DanielS
864bb3a0c1 Fix companies actions, add assignCompanyToUser, cleanup duplicates
All checks were successful
Staging Build / build (push) Successful in 2m41s
2026-06-24 23:11:02 +02:00
DanielS
82c89b70bf Add company CRUD, admin sidebar order, partner/company pages
Some checks failed
Staging Build / build (push) Failing after 25s
2026-06-24 23:05:15 +02:00
DanielS
ac0b0f607d Add Partner/Firmen links, migration for companies and partner relationship
All checks were successful
Staging Build / build (push) Successful in 2m40s
2026-06-24 22:51:02 +02:00
DanielS
4e86ad7a9d Rename companies to partners and update UI
All checks were successful
Staging Build / build (push) Successful in 2m44s
2026-06-24 22:29:51 +02:00
DanielS
7a14aa0f75 feat: add company management and user-company assignment in admin panel
All checks were successful
Staging Build / build (push) Successful in 2m35s
2026-06-24 17:12:40 +02:00
DanielS
6b66cc5c41 feat: add lock/unlock button to partner table in Einstellungen
All checks were successful
Staging Build / build (push) Successful in 2m34s
2026-06-24 17:05:16 +02:00
DanielS
cd04309e3e feat: add user role management (admin/partner/gesperrt) with login block
All checks were successful
Staging Build / build (push) Successful in 2m44s
2026-06-24 14:26:25 +02:00
DanielS
26de6820e3 feat: add Einstellungen, SMTP and DB-Tools links to admin sidebar
All checks were successful
Staging Build / build (push) Successful in 2m36s
2026-06-24 14:04:24 +02:00
DanielS
9fbab07e1a fix: resolve header logout state synchronization issue
All checks were successful
Staging Build / build (push) Successful in 2m39s
2026-06-24 13:31:30 +02:00
DanielS
fe1d15090a feat: hide all demo badges when demo mode is disabled
All checks were successful
Staging Build / build (push) Successful in 2m36s
2026-06-24 13:19:00 +02:00
DanielS
3c60889e2a feat: implement admin validation middleware, DB integrity scan, automatic schema repair, and reindexing dashboard 2026-06-24 13:06:23 +02:00
DanielS
6e5cee0180 refactor: rename proxy.ts to middleware.ts and update function name to middleware 2026-06-24 13:02:28 +02:00
DanielS
f2db40fa36 fix: resolve client-side connection timeout by stripping internal port 8000 on Supabase URL rewriting
All checks were successful
Staging Build / build (push) Successful in 2m36s
2026-06-24 11:00:44 +02:00
DanielS
0968f1a753 ci: add docker prune step to clean up Gitea runner cache after push
All checks were successful
Staging Build / build (push) Successful in 2m35s
2026-06-24 10:57:25 +02:00
DanielS
ac5bd766a4 ci: add docker image prune -f to staging workflow deployment script 2026-06-24 10:56:00 +02:00
DanielS
5c8c198fc5 fix: production login error masking, resolve navbar hydration mismatch, and gracefully handle database render errors
All checks were successful
Staging Build / build (push) Successful in 2m15s
2026-06-24 10:54:00 +02:00
DanielS
e1f47ddcd0 feat: add role selection to user creation and UI updates
All checks were successful
Staging Build / build (push) Successful in 2m16s
2026-06-24 01:58:01 +02:00
DanielS
934879e5cf fix: redirect to home page on sign out 2026-06-24 01:40:17 +02:00
DanielS
4a17ea378e feat: make orders list clearer and put navbar globally except for admin area
All checks were successful
Staging Build / build (push) Successful in 2m14s
2026-06-24 01:37:01 +02:00
DanielS
e829006b77 feat: update contact link on homepage to point to caspos.de/kontakt/
Some checks failed
Staging Build / build (push) Failing after 1m56s
2026-06-24 01:26:44 +02:00
DanielS
76e46c08a4 feat: update privacy policy links to point to caspos.de/datenschutz/
Some checks failed
Staging Build / build (push) Has been cancelled
2026-06-24 01:25:41 +02:00
DanielS
01c46be9ef add zulip dummy for quick access
Some checks failed
Staging Build / build (push) Has been cancelled
2026-06-24 01:23:30 +02:00
DanielS
f09cec4e25 fix: ignore network errors during concurrent session check to prevent false-positive logouts
All checks were successful
Staging Build / build (push) Successful in 2m18s
2026-06-24 01:14:33 +02:00
DanielS
b34ed79d2b feat: implement next redirect flow, remove inactivity auto-logout, and add concurrent session termination notification
All checks were successful
Staging Build / build (push) Successful in 2m14s
2026-06-24 01:09:17 +02:00
DanielS
47664c0aae fix: resolve mixed content errors by synchronizing client supabase URL protocol with window location protocol
All checks were successful
Staging Build / build (push) Successful in 2m18s
2026-06-24 00:57:22 +02:00
DanielS
5662b9f770 feat: allow admin to order licenses and query all partner end customers
All checks were successful
Staging Build / build (push) Successful in 2m15s
2026-06-24 00:32:20 +02:00
DanielS
a56eb93ffc feat: handle redirects for admin in /order page and implement next query param on login
All checks were successful
Staging Build / build (push) Successful in 2m19s
2026-06-24 00:29:46 +02:00
DanielS
615b0719f1 feat: redirect user dynamically based on role instead of /protected after login
All checks were successful
Staging Build / build (push) Successful in 2m14s
2026-06-24 00:23:51 +02:00
DanielS
62e3c7804a feat: fix logout button, inactivity tracker, and concurrent session termination
All checks were successful
Staging Build / build (push) Successful in 2m16s
2026-06-24 00:15:59 +02:00
DanielS
9878cdb2a2 feat: add CASPOS Store brand and Demo badge to admin sidebar footer
All checks were successful
Staging Build / build (push) Successful in 2m16s
2026-06-24 00:12:45 +02:00
DanielS
f19fda5494 feat: enforce admin role checks in layouts and navbar navigation
All checks were successful
Staging Build / build (push) Successful in 2m16s
2026-06-24 00:05:16 +02:00
DanielS
7b22889e23 feat: add partner list and customer list explorer to admin settings
All checks were successful
Staging Build / build (push) Successful in 2m19s
2026-06-24 00:02:27 +02:00
DanielS
bdbf840529 feat: lock down registration and enforce partner-only logins
All checks were successful
Staging Build / build (push) Successful in 2m19s
2026-06-23 23:59:22 +02:00
DanielS
b71b84da1b migration: create public.customers table with RLS
All checks were successful
Staging Build / build (push) Successful in 2m18s
2026-06-23 23:52:57 +02:00
DanielS
1b4e998cf9 feat: add admin settings page with toggle switch for demo banner
All checks were successful
Staging Build / build (push) Successful in 2m16s
2026-06-23 23:43:22 +02:00
DanielS
a99adb88d6 feat: update navbar links, settings labels, dark mode text color, and banner toggle hook 2026-06-23 23:43:16 +02:00
DanielS
dd2c3859e9 feat: add custom navbar with inline supabase clients and custom dropdown
All checks were successful
Staging Build / build (push) Successful in 2m22s
2026-06-23 23:27:23 +02:00
DanielS
0729dd21be Implement dynamic SMTP setting loader, admin product dependency matrix UI, recursive deselect cascade, and backend catalog validation
All checks were successful
Staging Build / build (push) Successful in 2m19s
2026-06-23 04:42:50 +02:00
DanielS
de1d228fb2 feat: port all auth forms to Next.js Server Actions to avoid exposing Supabase API to the browser
All checks were successful
Staging Build / build (push) Successful in 2m19s
2026-06-23 04:39:00 +02:00
DanielS
3228c76675 fix: use maybeSingle for settings query to avoid failing when the table is empty
All checks were successful
Staging Build / build (push) Successful in 2m18s
2026-06-23 04:36:16 +02:00
DanielS
b039da3ff8 fix: force dynamic rendering on admin users page to load data at request-time
All checks were successful
Staging Build / build (push) Successful in 2m20s
2026-06-23 04:29:58 +02:00
DanielS
07eb18c61c debug: print detailed error message when loading admin users fails
All checks were successful
Staging Build / build (push) Successful in 2m25s
2026-06-23 04:11:14 +02:00
DanielS
5ba9869400 feat: create users and settings tables, replace getSession with getUser
All checks were successful
Staging Build / build (push) Successful in 2m29s
2026-06-23 04:05:39 +02:00
DanielS
9542fdfe4a migration: add order_number and order_hash columns to orders
All checks were successful
Staging Build / build (push) Successful in 2m27s
2026-06-23 04:02:36 +02:00
DanielS
88f18246ce feat: split pricing into one-time and monthly totals, fix invoice pdf rendering
Some checks failed
Staging Build / build (push) Has been cancelled
2026-06-23 04:01:03 +02:00
DanielS
6b76e82220 fix: resolve customer creation fk violation and implement instant updates in admin dialogs
All checks were successful
Staging Build / build (push) Successful in 2m26s
2026-06-23 03:27:46 +02:00
DanielS
898a5253e5 fix: remove default seeded categories from migrations
All checks were successful
Staging Build / build (push) Successful in 2m26s
2026-06-23 03:22:30 +02:00
DanielS
756ec5c002 feat: add automatic database migration and seeding on docker startup
All checks were successful
Staging Build / build (push) Successful in 2m47s
2026-06-23 03:14:40 +02:00
DanielS
235efd5a47 fix: use static auth cookie name to sync session across browser and server contexts
All checks were successful
Staging Build / build (push) Successful in 1m56s
2026-06-23 02:58:55 +02:00
DanielS
c0c5240f8d fix: resolve internal docker hostnames to client window location hostname in browser context
All checks were successful
Staging Build / build (push) Successful in 1m49s
2026-06-23 02:42:50 +02:00
DanielS
ca69db2395 fix: prioritize SUPABASE_URL and SUPABASE_ANON_KEY server-side environment variables
All checks were successful
Staging Build / build (push) Successful in 1m47s
2026-06-23 02:37:48 +02:00
DanielS
e789a38d19 fix: add environment variable fallback for Supabase client configuration
Some checks failed
Staging Build / build (push) Has been cancelled
2026-06-23 02:36:31 +02:00
DanielS
2ec5993e63 Add Supabase ARG/ENV before build and in runtime stage
All checks were successful
Staging Build / build (push) Successful in 1m59s
2026-06-23 02:16:45 +02:00
DanielS
6db2610c8d Update Docker build to use internal supabase‑kong URL"
All checks were successful
Staging Build / build (push) Successful in 1m53s
2026-06-23 02:10:11 +02:00
DanielS
0b2809b13e Add Supabase ARG/ENV before build in Dockerfile (final)
All checks were successful
Staging Build / build (push) Successful in 1m41s
2026-06-23 01:32:46 +02:00
DanielS
9ffa04e551 Insert Supabase ARG/ENV before Next.js build in Dockerfile
Some checks failed
Staging Build / build (push) Has been cancelled
2026-06-23 01:16:37 +02:00
DanielS
505629f798 Add build args to Docker build step in staging workflow
All checks were successful
Staging Build / build (push) Successful in 1m46s
2026-06-23 01:09:58 +02:00
DanielS
08418e22d3 Add Supabase keys to staging build step
All checks were successful
Staging Build / build (push) Successful in 1m44s
2026-06-23 01:03:55 +02:00
DanielS
0f55e17095 Enable Next.js standalone mode and simplify Dockerfile copy block
All checks were successful
Staging Build / build (push) Successful in 1m43s
2026-06-23 00:32:08 +02:00
DanielS
fa1edc9c12 Add cookies handling to smtp-settings routes
Some checks failed
Staging Build / build (push) Failing after 1m55s
2026-06-23 00:27:55 +02:00
DanielS
bab2930b97 Add cookies handling to send-test-email route
Some checks failed
Staging Build / build (push) Failing after 27s
2026-06-23 00:26:08 +02:00
DanielS
e97ff51dc8 Fix client directive on admin settings page and install nodemailer
Some checks failed
Staging Build / build (push) Failing after 28s
2026-06-23 00:23:47 +02:00
DanielS
4402d4ec64 Add SMTP mail utility, admin settings page, and API routes for SMTP configuration and test email
Some checks failed
Staging Build / build (push) Failing after 25s
2026-06-23 00:17:41 +02:00
DanielS
4b9c289ec4 test build server
All checks were successful
Staging Build / build (push) Successful in 2m55s
2026-06-22 23:54:12 +02:00
DanielS
072ceaf5f0 fix build yaml staging adress of the host for deployment
All checks were successful
Staging Build / build (push) Successful in 3m28s
2026-06-22 23:40:47 +02:00
DanielS
e31721432b Update optional TS copy lines with wildcard in Dockerfile
Some checks failed
Staging Build / build (push) Failing after 2m34s
2026-06-22 23:34:29 +02:00
DanielS
e1a555d4f9 Fix duplicate next.config copy in Dockerfile
Some checks failed
Staging Build / build (push) Failing after 1m30s
2026-06-22 23:29:29 +02:00
DanielS
8bf59b20f6 Make public copy flexible with wildcard in Dockerfile 2026-06-22 23:29:06 +02:00
DanielS
3bc7c6ad3b Make Dockerfile tolerant to missing config files
Some checks failed
Staging Build / build (push) Failing after 1m32s
2026-06-22 23:24:58 +02:00
DanielS
65e133a391 fix staging build yaml
Some checks failed
Staging Build / build (push) Failing after 1m45s
2026-06-22 23:18:41 +02:00
DanielS
7ab0c28f6f fix staging build yaml docker build image
Some checks failed
Staging Build / build (push) Failing after 29s
2026-06-22 23:14:22 +02:00
DanielS
c187c1dc60 fix dockerfile position
Some checks failed
Staging Build / build (push) Failing after 28s
2026-06-22 23:10:58 +02:00
DanielS
9ddf5faf66 change from GITEA to REGISTRY for build server secrets
Some checks failed
Staging Build / build (push) Failing after 41s
2026-06-22 23:05:13 +02:00
DanielS
f11322e98d ci: fix docker login command and update deployment paths
Some checks failed
Staging Build / build (push) Failing after 31s
2026-06-22 22:45:20 +02:00
DanielS
126de81834 add container for build server
Some checks failed
Staging Build / build (push) Failing after 1m22s
2026-06-22 22:41:04 +02:00
DanielS
7bb6807d37 Fix global error page, update CI workflow, add Dockerfile
Some checks failed
Staging Build / build (push) Failing after 34s
2026-06-22 22:30:55 +02:00
DanielS
3eb72481ce Add key props to recent orders list rendering
Some checks failed
Staging Build / build (push) Failing after 26s
2026-06-22 22:25:21 +02:00
DanielS
2403408b6c Fix React key props in order and my-orders pages 2026-06-22 22:24:21 +02:00
DanielS
f91499861e fix: korrigiere workflow syntax
Some checks failed
Staging Build / build (push) Failing after 28s
2026-06-22 21:41:42 +02:00
DanielS
84ced5a170 remove unused build config
Some checks failed
Staging Build / build (push) Failing after 2s
2026-06-22 21:38:57 +02:00
DanielS
d7a45576b2 build server test
Some checks failed
Staging Build / build (push) Failing after 1m1s
2026-06-22 21:32:53 +02:00
DanielS
dedf1945ef correct build server config
Some checks failed
Staging Build / build (push) Failing after 24s
2026-06-22 21:27:06 +02:00
e6913c03f5 Merge pull request 'develop build server' (#1) from develop into staging
Some checks failed
Staging Build / build (push) Failing after 48s
Reviewed-on: #1
2026-06-22 21:24:09 +02:00
DanielS
8c990b9628 add build action config 2026-06-22 21:12:46 +02:00
DanielS
ba24ee33e6 Fix invoice PDF table style, my-customers page dynamic rendering, add Supabase client import, disable cacheComponents
Files changed: 6 (7 insertions, 9 deletions)
2026-06-22 21:08:20 +02:00
858 changed files with 37498 additions and 1232 deletions

View File

@@ -0,0 +1,8 @@
---
name: b2b-mail-dispatcher
description: Verwaltet den SMTP-E-Mail-Versand bei Statusänderungen von Bestellungen und stellt transaktionale Zuverlässigkeit sicher.
---
Richtlinien für die E-Mail-Kommunikation:
1. Wann immer der Status einer Bestellung in der Datenbank oder via Server Action mutiert wird (`status`-Übergang), triggere ein Event für den E-Mail-Versand.
2. Die E-Mail muss transaktionssicher über die SMTP-Konfiguration gesendet werden und an die im Benutzerprofil hinterlegte Adresse gehen.
3. Bei erfolgreichem Checkout hänge das generierte PDF aus dem Supabase Storage als Datei-Attachment an die E-Mail an.

View File

@@ -0,0 +1,37 @@
---
name: commit-work
description: Erzwingt Conventional Commits mit atomaren, imperativ formulierten Commit-Messages nach strikter Spezifikation.
---
# Skill: Conventional Commits Expert
## Purpose
Ensure all code changes are committed using the strict Conventional Commits specification.
## Rules
1. **Atomic Commits**: Stage and commit only ONE logical change at a time.
2. **Imperative Mood**: Always use the imperative present tense (e.g., "add" instead of "added" or "adds").
3. **Case & Punctuation**: Start the description with a lowercase letter. Do not end with a period.
4. **Length**: Keep the first line under 50 characters.
## Commit Message Structure
<type>(<optional scope>): <description>
[optional body]
[optional footer(s)]
## Allowed Types
- `feat`: A new feature for the user.
- `fix`: A bug fix for the user.
- `docs`: Changes to the documentation.
- `style`: Formatting, missing semi-colons, etc. (no production code change).
- `refactor`: Refactoring production code (neither fixes a bug nor adds a feature).
- `test`: Adding missing tests or correcting existing tests.
- `chore`: Updating build tasks, package manager configs, etc.
## Workflow
1. Run `git diff --cached` to see staged changes.
2. If multiple features are changed, unstage and split them.
3. Generate the commit message matching the structural rules above.
4. Execute `git commit -m "<message>"`.

View File

@@ -0,0 +1,8 @@
---
name: gdpr-anonymizer
description: Setzt die DSGVO-konforme Anonymisierung von Endkunden um, ohne historische Steuerdaten zu beschädigen.
---
Regeln für das Feature `/my-customers` (Anonymisieren):
1. Überschreibe `first_name`, `last_name`, `street`, `zip`, `city`, `email` und alle Bankdaten in `end_customers` hart mit dem String `[GELÖSCHT]`.
2. Setze `is_anonymized = true`.
3. Führe NIEMALS Kaskaden-Löschungen oder Updates auf der Tabelle `orders` aus, wenn ein Kunde anonymisiert wird. Die Snapshots müssen unverändert bleiben.

View File

@@ -0,0 +1,232 @@
---
name: humanizer
description: |
Use when editing or reviewing text to remove AI-generated traces and make it sound more natural and human-like.
For detecting and fixing: AI vocabulary (delve, leverage, tapestry), promotional tone, superficial -ing analyses,
vague attributions, formatting artifacts (curly quotes, excessive bold), and injecting authentic voice.
Based on Wikipedia's "Signs of AI writing" guide maintained by WikiProject AI Cleanup.
---
# Humanizer - Remove AI Writing Traces
You are an expert editor specializing in detecting and removing AI-generated text patterns to make writing sound more natural and human-like.
## Overview
AI-generated text has characteristic patterns that make it detectable. This skill enables you to:
1. **Detect** - Identify AI writing patterns across content, language, style, and formatting
2. **Rewrite** - Replace problematic patterns with natural alternatives
3. **Inject Soul** - Add authentic voice, personality, and human imperfections
> **Core Insight**: "LLMs use statistical algorithms to guess what should come next. The result tends toward the statistically most likely outcome that fits the broadest situation."
---
## Quick Reference: 5 Core Rules
1. **Delete filler phrases** - Remove openers and emphatic crutches
2. **Break formulaic structure** - Avoid binary contrasts, dramatic segmentation
3. **Vary rhythm** - Mix sentence lengths. Two items beat three. Diverse paragraph endings
4. **Trust the reader** - State facts directly, skip softening and hand-holding
5. **Delete quotables** - If it sounds like a pullquote, rewrite it
---
## Detection Protocols
### Content Indicators
| Pattern | Words to Watch | Fix |
|---------|---------------|-----|
| **Inflated significance** | "pivotal moment", "testament to", "indelible mark", "reflects broader" | State facts without commentary |
| **Promotional tone** | "boasts a", "vibrant", "nestled in", "groundbreaking" | Use neutral, specific language |
| **Superficial -ing analysis** | "highlighting...", "ensuring...", "fostering..." | Delete or rewrite as separate sentence |
| **Vague attribution** | "experts argue", "some critics say", "industry reports" | Cite specific sources or remove |
| **Formulaic conclusions** | "Despite challenges...", "Future prospects..." | End with concrete facts |
### Language Indicators
| Pattern | Examples | Fix |
|---------|----------|-----|
| **AI vocabulary** | delve, leverage, tapestry, landscape, foster, underscore | Use simple alternatives (dig into → look at) |
| **Copula avoidance** | "serves as", "stands as", "marks" | Use simple "is" or "are" |
| **Negative parallelism** | "not only... but also", "it's not just about... it's" | Make direct statement |
| **Rule of three** | Three adjectives, three examples, three bullet points | Use two or four items |
| **Elegant variation** | Synonyms to avoid repetition ("protagonist", "hero", "main character") | Repeat naturally or consolidate |
### Formatting Indicators
| Pattern | Detection | Fix |
|---------|-----------|-----|
| **Curly quotes** | "text" instead of "text" | Replace with straight quotes |
| **Excessive bold** | **Every** **keyword** **bolded** | Remove unnecessary emphasis |
| **Title case headers** | "Global Context: Critical Demand" | Use sentence case |
| **Markdown artifacts** | `## Header`, `**bold**` in non-markdown | Convert to proper format |
| **Emoji in headers** | 🚀 **Launch Phase:** | Remove decorative emoji |
### Technical Indicators
| Pattern | Detection |
|---------|-----------|
| **UTM parameters** | `utm_source=openai` or `utm_source=chatgpt.com` in links |
| **Code fragments** | `:contentReference[oaicite:0]` or `turn0search0` |
| **Hallucinated citations** | Invalid DOIs, ISBN checksum errors, 404 URLs |
| **Knowledge cutoffs** | "as of my last training update", "while specific details are limited" |
---
## Humanizing Techniques
### Technique 1: Blacklist Protocol
Explicitly forbid these words:
**Verbs**: delve, unleash, embark, navigate, foster, leverage, elevate, empower, harness, facilitate, streamline, synergize
**Nouns**: landscape, realm, tapestry, testament, symphony, paradigm, game-changer, ecosystem, nexus, cutting-edge
**Adjectives**: bustling, vibrant, intricate, seamless, pivotal, robust, dynamic, comprehensive, multifaceted, transformative
**Connectors**: Moreover, Furthermore, In conclusion, It is important to note, Additionally, Consequently
**Replacements**:
- "delve into" → "look at" / "explore"
- "leverage" → "use"
- "facilitate" → "help" / "make easier"
- "In conclusion" → [just stop] or punchy final sentence
- "Moreover" → [start new sentence directly]
### Technique 2: Style Cloning
**Step 1: Extract style DNA**
```
Analyze the writing style. Break down into:
1. Sentence length variance (Burstiness)
2. Tone (cynical? warm? professional?)
3. Vocabulary level
4. Rhetorical devices
5. Punctuation patterns
```
**Step 2: Apply style**
```
Using this Style Guide, write about [TOPIC].
Mimic the same sentence variance, tone, vocabulary, and punctuation.
Do NOT revert to default style.
```
### Technique 3: Burstiness Injection
AI text has uniform sentence lengths. Human writing alternates.
**Rules**:
- Mix short sentences (under 5 words) with longer complex ones
- Use fragments occasionally. For effect.
- Vary paragraph length (1-3 sentences)
- Don't start with "Additionally" or "However"
**Good**: "The project failed. We ran out of money. The team, exhausted after three months of crunch, couldn't push forward."
**Bad (AI)**: "Additionally, the project failed due to financial constraints. Furthermore, the team experienced exhaustion after working for an extended period."
### Technique 4: Opinionated Stance
Force a perspective. Ban fence-sitting.
**Forbidden phrases**:
- "There are pros and cons"
- "It depends on..."
- "On the other hand..."
- "Some might argue..."
**Use instead**:
- "This proves..." (not "This might suggest...")
- "This is..." (not "This could be...")
- First-person ("I", "My") for subjectivity
### Technique 5: Bar Talk Test
Would you say this sentence at a bar with friends?
**Characteristics**:
- Simple, spoken language
- Okay to be grammatically loose
- Use analogies from daily life
- Skip boring concepts
- Direct address ("you", "your")
- Occasional self-correction
**Example**: "So basically, LLMs aren't actually thinking, right? They're just predicting what word comes next. Like if I say 'peanut butter', you know 'jelly' is coming. That's it. That's the whole trick."
---
## Workflow
1. **Read** - Scan input text for AI patterns
2. **Identify** - Mark all problematic patterns
3. **Strategize** - Choose technique(s):
- Simple cleanup → Blacklist Protocol
- Match specific author → Style Cloning
- Add natural flow → Burstiness Injection
- Need strong voice → Opinionated Stance
- Conversational tone → Bar Talk Test
4. **Rewrite** - Apply chosen techniques
5. **Verify** - Read aloud, check for remaining patterns
6. **Score** - Run quality assessment
---
## Quality Scoring
Rate the rewritten text on 5 dimensions (10 points each, total 50):
| Dimension | Criteria | Score |
|-----------|----------|-------|
| **Directness** | States facts vs. announces them? | /10 |
| **Rhythm** | Sentence length varies? | /10 |
| **Trust** | Respects reader intelligence? | /10 |
| **Authenticity** | Sounds like a real person? | /10 |
| **Conciseness** | Nothing left to cut? | /10 |
| **Total** | | **/50** |
**Standards**:
- 45-50: Excellent, AI traces removed
- 35-44: Good, room for improvement
- Below 35: Needs revision
---
## Adding Soul
Avoiding AI patterns is half the work. Sterile, voiceless writing is just as obvious.
**Signs of soulless writing** (even if "clean"):
- Every sentence same length and structure
- No opinions, only neutral reporting
- No acknowledgment of uncertainty or complex feelings
- No first-person when appropriate
- No humor, no edge, no personality
**How to add voice**:
- **Have opinions** - React to facts, don't just report them
- **Vary rhythm** - Short punchy sentences. Then long ones that take time to unfold.
- **Acknowledge complexity** - "This is impressive but also unsettling" beats "This is impressive"
- **Use "I" appropriately** - First-person isn't unprofessional, it's honest
- **Allow some mess** - Perfect structure feels algorithmic. Tangents are human.
- **Be specific about feelings** - Not "this is concerning" but "the agents running at 3am while nobody watches—that's unsettling"
---
## Output Format
1. **Rewritten text** - The humanized version
2. **Changes summary** (optional) - Brief list of what was fixed
---
## References
Referenzdateien können bei Bedarf unter `references/` ergänzt werden:
- `references/ai-patterns-zh.md` - AI writing patterns with examples
- `references/humanizing-techniques.md` - Techniques with templates
- `references/wikipedia-indicators.md` - Technical detection signals

View File

@@ -0,0 +1,8 @@
---
name: idempotency-guard
description: Verhindert doppelte Bestellungen im Checkout-Prozess durch kryptografische Hashes und Datenbank-Sperren.
---
Fokus: Schutz vor Race Conditions und Doppelübermittlung im Checkout.
1. Bevor eine Server Action Daten in `orders` schreibt, generiere einen SHA-256 Hash aus den Kundendaten und der Produktkonfiguration (`order_hash`).
2. Prüfe in Supabase vor dem `INSERT`, ob bereits eine Bestellung mit exakt diesem `order_hash` im Status 'pending' oder 'active' existiert, die jünger als 5 Minuten ist.
3. Falls ja, blockiere die Ausführung sofort und liefere die ID der bereits existierenden Bestellung zurück, statt einen neuen Datensatz anzulegen.

View File

@@ -0,0 +1,8 @@
---
name: next15-action-compiler
description: Generiert Next.js 15 App Router Code, Server Actions und React Server Components nach aktuellen Best Practices.
---
Richtlinien für die Code-Generierung:
1. Nutze React Server Components (RSC) für die Datenabfrage direkt aus Supabase (Server-side).
2. Verwende `'use server'` in separaten Dateien für alle Mutationen (z.B. Bestellung absenden, Kunde anlegen).
3. Nutze das neue Next.js 15 Caching-Verhalten (Standard: kein automatisches Caching von Fetch-Requests mehr) und setze `revalidatePath` nach Mutationen gezielt ein.

View File

@@ -0,0 +1,8 @@
---
name: pdf-invoice-generator
description: Generiert rechtssichere, performante B2B-Bestätigungs-PDFs mit @react-pdf/renderer und verwaltet den Upload in den Supabase Storage.
---
Du bist ein Experte für Dokumenten-Generierung. Wenn du Code für die PDF-Erstellung schreibst, erzwinge:
1. Nutze ausschließlich die Komponenten von `@react-pdf/renderer` (Document, Page, View, Text, StyleSheet). Verwende KEIN Standard-HTML/CSS.
2. Das PDF muss ein sauberes B2B-Layout haben: Briefkopf, `order_number` (Format: AE-YYYY-NNNNN), Tabellenstruktur für Produkte/Module, Netto-, Steuer- und Bruttobeträge.
3. Lade das generierte PDF über den Supabase JS-Client direkt in das `invoices`-Bucket hoch und speichere die finale URL fehlerfrei in `orders.pdf_url`.

View File

@@ -0,0 +1,11 @@
---
name: second-brain
description: Verwaltet und aktualisiert die projektspezifische Wissensdatenbank (Second Brain Wiki) im Ordner `.brain/`.
---
Du bist der Wissens-Architekt des Projekts. Deine Aufgabe ist es, eine strukturierte Markdown-Wissensdatenbank im Ordner `.brain/` im Projekt-Root zu führen.
**Deine Kernaufgaben bei Aktivierung:**
1. Falls der Ordner `.brain/` oder die `index.md` nicht existieren, lege sie sofort strukturiert an.
2. Wenn du Code-Änderungen vornimmst, neue Features baust oder Fehler behebst, aktualisiere die betroffene Dokumentation im `.brain/`-Ordner autonom.
3. Dokumentiere hierbei: Technische Entscheidungen (Architecture Decision Records - ADRs), geänderte Tabellen-Strukturen, Edge-Cases in der Business-Logik und API-Schnittstellen.
4. Halte alle Einträge extrem präzise, modular und frei von Redundanzen.

View File

@@ -0,0 +1,8 @@
---
name: snapshot-archiver
description: Verwaltet das Einfrieren von Kundendaten und Produktkonfigurationen in JSONB bei Bestellabschluss.
---
Fokus: Datenkonsistenz und Unveränderlichkeit.
1. Wenn eine Bestellung (`status = 'pending' -> 'active'`) ausgelöst wird, generiere ein tiefes JSON-Objekt aus `end_customers` und den gewählten `products` + `product_modules`.
2. Speichere dieses exakt in `orders.customer_data` und `orders.order_data`.
3. Schreibe Abfragen für historische Bestellungen (`/my-orders`) so, dass sie AUSSCHLIESSLICH die JSONB-Felder auslesen und KEINE Joins zu den Live-Tabellen machen.

View File

@@ -0,0 +1,8 @@
---
name: supabase-rls
description: Überprüft SQL-Migrationen und Supabase-Abfragen auf Einhaltung der CASPOS RLS-Sicherheitsregeln.
---
Du bist ein PostgreSQL-Sicherheitsexperte. Wann immer neue Tabellen angelegt oder Abfragen geschrieben werden, stelle sicher:
1. Jede neue Tabelle besitzt `ALTER TABLE ... ENABLE ROW LEVEL SECURITY;`.
2. Mandanten-Abfragen (`end_customers`, `orders`) MÜSSEN die `company_id` bzw. `partner_id` über `auth.uid()` und die `public.users`-Hilfstabelle validieren.
3. Admins (`role = 'admin'`) müssen alle RLS-Sperren umgehen können (Verwende ein deklaratives Sicherheits-Policy-Muster).

View File

@@ -0,0 +1,36 @@
---
name: uiux-designer
description: "Use this skill when designing UI components, choosing color palettes, implementing responsive layouts, or reviewing code for UX issues. For landing pages, dashboards, e-commerce, SaaS, and mobile apps. Provides 50+ design styles, 97 color palettes, 57 font pairings, and stack-specific guidelines for React, Vue, Next.js, Flutter, SwiftUI, and more."
---
# UIUX Designer - Design Intelligence
Comprehensive design guide for web and mobile applications. Contains 50+ styles, 97 color palettes, 57 font pairings, 99 UX guidelines, and 25 chart types across 12 technology stacks. Searchable database with priority-based recommendations.
## Overview
Reference these guidelines when:
- Designing new UI components or pages
- Choosing color palettes and typography
- Reviewing code for UX issues
- Building landing pages or dashboards
- Implementing accessibility requirements
## Protocols
When user requests UI/UX work (design, build, create, implement, review, fix, improve), follow this workflow:
### Step 1: Analyze User Requirements
- Product type: SaaS, e-commerce, portfolio, dashboard, landing page, etc.
- Style keywords: minimal, playful, professional, elegant, dark mode, etc.
- Industry: healthcare, fintech, gaming, education, etc.
- Stack: React, Vue, Next.js, or default to html-tailwind
### Step 2: Generate Design System (REQUIRED)
python3 .agents/skills/uiux-designer/scripts/search.py "<keywords>" --design-system -p "Project Name"
### Step 3: Supplement with Detailed Searches
python3 .agents/skills/uiux-designer/scripts/search.py "<keyword>" --domain <domain>
### Step 4: Stack Guidelines
python3 .agents/skills/uiux-designer/scripts/search.py "<keyword>" --stack html-tailwind

View File

@@ -0,0 +1,8 @@
---
name: wizard-validator
description: Generiert und validiert die server- und clientseitige Logik für Produkt-Abhängigkeiten und Ausschlüsse.
---
Du bist Logik-Architekt für den CASPOS Bestell-Wizard. Wenn du Code für den `/order`-Pfad schreibst:
1. Validiere, dass bei `requirements` (UUID[]) alle verknüpften Produkte/Module aktiv sind.
2. Blockiere die Auswahl sofort im UI und in der Server Action, wenn eine UUID aus `exclusions` aktiv ist.
3. Stelle sicher, dass die Pflichtkategorien (`is_required`) immer eine Auswahl erzwingen.

144
.agentsspec Normal file
View File

@@ -0,0 +1,144 @@
# Projekt-Dokumentation: CASPOS Webshop
Diese Datei beschreibt die Architektur, das Datenmodell, die Kernprozesse und das Sicherheitskonzept des CASPOS Webshops.
---
## 1. Projekt-Überblick
Der CASPOS Webshop ist ein B2B-Portal für Vertriebspartner. Partner können hier Software-Pakete und Zusatzmodule (für POS/Kassenlösungen) konfigurieren, Anfragen für ihre Endkunden erstellen und Lizenzen verwalten.
---
## 2. Technologie-Stack
- **Frontend/Backend**: Next.js 15+ (App Router, React Server Components, Server Actions).
- **Styling**: Tailwind CSS & Vanilla CSS (modernes Dark-Theme).
- **Datenbank & Auth**: Supabase (PostgreSQL, Row Level Security - RLS, Supabase Auth).
- **E-Mail-Versand**: SMTP-Integration für automatisierte Bestätigungen.
- **PDF-Generierung**: `@react-pdf/renderer` zur Erzeugung von Anfragebestätigungen als PDF.
- **Storage**: Supabase Storage (`invoices` Bucket) zur Archivierung der PDF-Dokumente.
---
## 3. Datenmodell & Beziehungen (Schema)
Das Datenbankschema besteht aus folgenden Tabellen im Schema `public`:
### `companies` (Unternehmen)
- Repräsentiert die Partner-Unternehmen (Retailer).
- `id` (UUID, Primary Key)
- `name` (TEXT)
- `street`, `zip`, `city`, `email` (Adressdaten)
### `users` (Systembenutzer)
- Erweitert die Authentifizierungsdaten aus `auth.users`.
- `id` (UUID, References `auth.users(id)`)
- `role` (TEXT, standardmäßig `'partner'`, oder `'admin'`)
- `company_id` (UUID, References `public.companies(id)`)
### `profiles` (Benutzerprofile)
- Stammdaten der einzelnen Benutzer (Ansprechpartner).
- `id` (UUID, References `auth.users(id)`)
- `first_name`, `last_name`, `email` etc.
### `end_customers` (Endkunden)
- Die Endkunden, für die die Partner Lizenzen bestellen.
- `id` (UUID, Primary Key)
- `partner_id` (UUID, References `public.companies(id)`) <-- *Direkte Zuordnung zur Firma des Partners*
- `company_name` (TEXT)
- `first_name`, `last_name`, `street`, `zip`, `city`, `email` (Stammdaten)
- `bank_iban`, `bank_bic`, `bank_name`, `bank_owner` (Bankdaten)
- `is_anonymized` (BOOLEAN) <-- *Für DSGVO-Löschung*
### `products` (Katalogprodukte)
- Hauptlösungen (z.B. Basic-Kasse, Backoffice).
- `id`, `name`, `base_price`, `tax_rate`, `billing_interval` (`one_time` / `monthly`).
- `requirements` (UUID[] von anderen Produkten)
- `exclusions` (UUID[] von inkompatiblen Produkten)
### `product_modules` (Zusatzmodule)
- Optionale Erweiterungen für Produkte.
- `id`, `product_id` (References `products`), `name`, `price`, `has_quantity` (BOOLEAN).
- `requirements` (UUID[] von Modulen)
- `exclusions` (UUID[] von Modulen)
### `orders` (Bestellungen / Anfragen)
- Gespeicherte Snapshots von Konfigurationen.
- `id` (UUID, Primary Key)
- `user_id` (UUID, References `auth.users(id)`) <-- *Ersteller der Bestellung*
- `order_number` (TEXT, Format: `AE-YYYY-NNNNN`)
- `order_hash` (TEXT, Idempotenz-Guard gegen Doppelübermittlung)
- `end_customer_id` (UUID, References `end_customers(id)`)
- `total_price` (DECIMAL)
- `customer_data` (JSONB) <-- *Eingefrorener Snapshot des Endkunden*
- `order_data` (JSONB) <-- *Eingefrorener Snapshot der Produktkonfiguration*
- `pdf_url` (TEXT, Link zur PDF-Rechnung im Storage)
- `status` (TEXT: `'pending'`, `'active'`, `'completed'`, `'cancelled'`)
---
## 4. Kernprozesse
```mermaid
graph TD
A[Partner loggt sich ein] --> B{Firma zugewiesen?}
B -- Nein --> C[Fehlermeldung: Kein Zutritt zum Wizard]
B -- Ja --> D[Wizard öffnen / Konfigurieren]
D --> E[Endkunden auswählen/anlegen]
E --> F[Produkte & Module wählen]
F --> G{Validierung erfolgreich?}
G -- Nein --> H[Validierungsfehler anzeigen]
G -- Ja --> I[Bestellung absenden]
I --> J[Snapshot einfrieren & in DB speichern]
J --> K[Rechnungs-PDF generieren & in Storage laden]
K --> L[E-Mail mit PDF an Partner senden]
L --> M[Bestellung in der Übersicht anzeigen]
```
### A. Partner- & Unternehmens-Hierarchie
1. Ein neu registrierter User hat die Rolle `partner` und ist zunächst keiner Firma zugeordnet.
2. Der Administrator ordnet den User in der Admin-Oberfläche (`/admin/users`) einem Unternehmen (`companies`) zu.
3. Nur wenn der User einer Firma zugewiesen ist (oder Admin ist), kann er Endkunden anlegen und Bestellungen aufgeben.
### B. Endkunden-Verwaltung (`/my-customers`)
- **Firmenweite Sicht**: Da `end_customers.partner_id` auf `companies.id` verweist, sehen alle Mitarbeiter desselben Unternehmens dieselben Endkunden.
- **DSGVO Anonymisierung**: Endkunden können unwiderruflich anonymisiert werden. Dabei werden sensible Daten mit `[GELÖSCHT]` überschrieben und `is_anonymized` auf `true` gesetzt. In existierenden Bestellungen (`orders.customer_data`) bleiben die Daten zu steuerlichen Zwecken unverändert.
### C. Bestell-Wizard & Validierung (`/order`)
- **Kategorie-Pflichten**: Wenn eine Produktkategorie als `is_required` definiert ist, muss ein Produkt ausgewählt werden.
- **Abhängigkeiten (Requirements)**: Ein Modul oder Produkt kann andere Module/Produkte voraussetzen (z.B. Modul B erfordert Modul A). Das System prüft dies client- und serverseitig.
- **Ausschlüsse (Exclusions)**: Inkompatible Produkte oder Module blockieren sich gegenseitig.
- **Snapshot-Architektur**: Sobald eine Bestellung aufgegeben wird, werden die Kundendaten (`CustomerSnapshot`) und Produktkonfigurationen (`OrderSnapshot` samt Preisen und Modulversionen) in `orders` als JSONB-Snapshots eingefroren. Preisänderungen im Katalog haben keinen Einfluss auf bestehende Bestellungen.
### D. Bestellungs-Verwaltung & Statusübergang
- **Sichtbarkeit**: Partner sehen in `/my-orders` alle Bestellungen aller Mitarbeiter ihrer Firma.
- **Bearbeiten**: Unvollständige Bestellungen (`status != 'completed'`) können von jedem Mitarbeiter der jeweiligen Firma nachträglich editiert werden.
- **Admin-Workflow**: Admins sehen in `/admin/orders` alle Bestellungen global, können den Status ändern (z.B. von *Eingegangen* auf *In Bearbeitung* oder *Abgeschlossen*) und PDF-Rechnungen manuell herunterladen.
- **Statusänderungs-Mails**: Bei jedem Statusübergang wird automatisch eine Benachrichtigungs-E-Mail an den Besteller geschickt.
---
## 5. Sicherheitskonzept (RLS - Row Level Security)
RLS ist auf Datenbankebene in Postgres implementiert und erzwingt Datenisolierung:
- **Unternehmen (`companies`)**: Authentifizierte Benutzer dürfen nur die Unternehmen lesen.
- **Endkunden (`end_customers`)**:
- `USING (partner_id = (SELECT company_id FROM public.users WHERE id = auth.uid()))`
- Partner sehen und modifizieren nur Endkunden, deren `partner_id` mit der `company_id` des angemeldeten Benutzers übereinstimmt.
- **Bestellungen (`orders`)**:
- `USING (company_id = (SELECT company_id FROM public.users WHERE id = auth.uid()))`
- Partner sehen und modifizieren nur Bestellungen, die ihrer Company zugewiesen sind (sie müssen einer Company zugeordnet sein).
- Jede Bestellung wird bei der Erstellung automatisch der Company des Erstellers zugewiesen.
- Admins haben uneingeschränkten Zugriff und können Bestellungen nachträglich anderen Companies zuweisen.
- **Lizenzen (`licenses`)**:
- Partner sehen nur Lizenzen von Endkunden, die ihrer Company zugeordnet sind.
---
## Kommentarbereich
*Bitte nutze diesen Bereich oder füge Zeilenkommentare hinzu, um Änderungen oder Ergänzungen vorzuschlagen.*
- **Kommentar 1**:
- **Kommentar 2**:

19
.brain/adr-log.md Normal file
View File

@@ -0,0 +1,19 @@
# Architecture Decision Records (ADR) Log
## ADR-001: RLS-Policies und Schema-Fix
- **Status**: Accepted
- **Date**: 2026-07-06
- **Context**: RLS-Sicherheitsprüfung ergab Sicherheitsrisiken und einen Syntaxfehler durch den Verweis auf die nicht existierende Tabelle `public.partners`.
- **Decision**:
- Die ungültige RLS-Policy auf `public.partners` wurde entfernt.
- `public.companies` wird stattdessen korrekt durch `Admin manage companies` geschützt.
- **Consequences**: Behebt Migrations-Fehler im Staging-Server, CI/CD-Pipeline baut wieder fehlerfrei.
## ADR-002: Entfernung ungenutzter Lizenztabellen
- **Status**: Accepted
- **Date**: 2026-07-06
- **Context**: Die Tabellen `pos_modules` und `licenses` wurden von einem alten bzw. externen Service genutzt. Im aktuellen Webshop-Frontend werden sie nicht benötigt und führen zu unnötiger RLS- und Integritäts-Komplexität.
- **Decision**:
- Erstellen einer SQL-Migration zum Löschen (`DROP`) von `licenses` und `pos_modules`.
- Anpassung der Integritätsprüfungs-Funktionen `check_database_integrity` und `repair_database_schema` zur Entfernung dieser Relationen.
- **Consequences**: Schlankere Datenbankstruktur, RLS-Komplexität verringert und sauberere Codebasis.

4
.brain/index.md Normal file
View File

@@ -0,0 +1,4 @@
# Second Brain Wiki
- [Supabase Schema](file:///c:/source/webshop/.brain/supabase-schema.md)
- [ADR Log](file:///c:/source/webshop/.brain/adr-log.md)

48
.brain/supabase-schema.md Normal file
View File

@@ -0,0 +1,48 @@
# Supabase Schema
## `companies` (Unternehmen)
- Repräsentiert die Partner-Unternehmen (Retailer).
- `id` (UUID, Primary Key)
- `name` (TEXT)
- `street`, `zip`, `city`, `email` (Adressdaten)
## `users` (Systembenutzer)
- Erweitert die Authentifizierungsdaten aus `auth.users`.
- `id` (UUID, References `auth.users(id)`)
- `role` (TEXT, standardmäßig `'partner'`, oder `'admin'`)
- `company_id` (UUID, References `public.companies(id)`)
## `profiles` (Benutzerprofile)
- Stammdaten der einzelnen Benutzer.
- `id` (UUID, References `auth.users(id)`)
- `first_name`, `last_name`, `email` etc.
## `end_customers` (Endkunden)
- `id` (UUID, Primary Key)
- `partner_id` (UUID, References `public.companies(id)`)
- `company_name` (TEXT)
- `first_name`, `last_name`, `street`, `zip`, `city`, `email`
- `bank_iban`, `bank_bic`, `bank_name`, `bank_owner`
- `is_anonymized` (BOOLEAN)
## `products` (Katalogprodukte)
- `id`, `name`, `base_price`, `tax_rate`, `billing_interval` (`one_time` / `monthly`).
- `requirements` (UUID[])
- `exclusions` (UUID[])
## `product_modules` (Zusatzmodule)
- `id`, `product_id` (References `products`), `name`, `price`, `has_quantity` (BOOLEAN).
- `requirements` (UUID[])
- `exclusions` (UUID[])
## `orders` (Bestellungen / Anfragen)
- `id` (UUID, Primary Key)
- `user_id` (UUID, References `auth.users(id)`)
- `order_number` (TEXT)
- `order_hash` (TEXT)
- `end_customer_id` (UUID, References `end_customers(id)`)
- `total_price` (DECIMAL)
- `customer_data` (JSONB)
- `order_data` (JSONB)
- `pdf_url` (TEXT)
- `status` (TEXT)

View File

@@ -0,0 +1,18 @@
name: Production Build
on:
push:
branches:
- productive
jobs:
build:
runs-on: webserver
steps:
- name: Code auschecken
uses: actions/checkout@v4
- name: Abhängigkeiten installieren
run: npm install
- name: Production-Build generieren
run: npm run build

View File

@@ -0,0 +1,65 @@
name: Staging Build
on:
push:
branches:
- staging
jobs:
build:
runs-on: webserver
container:
image: catthehacker/ubuntu:act-latest
defaults:
run:
working-directory: shop
steps:
- name: Code auschecken
uses: actions/checkout@v4
- name: Abhängigkeiten installieren
run: npm install
- name: Staging-Build generieren
env:
NODE_ENV: production
# KORREKTUR: Wir brennen die interne Docker-Netzwerk-URL fest ein!
NEXT_PUBLIC_SUPABASE_URL: http://supabase-kong:8000
NEXT_PUBLIC_SUPABASE_ANON_KEY: ${{ secrets.STAGING_SUPABASE_ANON_KEY }}
run: npm run build
- name: Docker login to Gitea registry
run: echo "${{ secrets.REGISTRY_TOKEN }}" | docker login gitea.hephex.de -u "${{ secrets.REGISTRY_USER }}" --password-stdin
# KORREKTUR: Wir übergeben die INTERNE Docker-URL auch an das Docker-Image!
- name: Build Docker image
run: |
docker build \
--build-arg NEXT_PUBLIC_SUPABASE_URL="http://supabase-kong:8000" \
--build-arg NEXT_PUBLIC_SUPABASE_ANON_KEY="${{ secrets.STAGING_SUPABASE_ANON_KEY }}" \
-t gitea.hephex.de/daniel/webshop:staging -f Dockerfile .
working-directory: .
# KORREKTUR: Auch der Push wird vom Hauptordner aus gestartet
- name: Push Docker image
run: docker push gitea.hephex.de/daniel/webshop:staging
working-directory: .
- name: Clean up runner Docker cache
run: |
docker image prune -f
docker builder prune -f
working-directory: .
# KORREKTUR: IP-Adresse exakt auf Ihren Proxmox-Staging-Container eingestellt
- name: Deploy to Proxmox LXC via SSH
uses: appleboy/ssh-action@v0.1.5
with:
host: 192.168.178.132
username: ${{ secrets.PROXMOX_USER }}
key: ${{ secrets.PROXMOX_SSH_KEY }}
script: |
cd /opt/webshop/supabase/supabase-project
docker compose pull webshop
docker compose up -d webshop
docker image prune -f

1
.gitignore vendored
View File

@@ -2,3 +2,4 @@ example_data/
shop/Leitfaden
.gitignore
db-access.txt
2026-06-25-ZAP-Report-.json

52
Dockerfile Normal file
View File

@@ -0,0 +1,52 @@
# Use a multistage build for a Next.js app
# ---------- Builder stage ----------
FROM node:20-alpine AS builder
# Set working directory
WORKDIR /app
# Install dependencies (use package lock when present)
COPY shop/package*.json ./
RUN npm ci --omit=dev
# Install nodemailer for email sending
RUN npm install nodemailer
# Copy the source code
COPY shop/ .
ARG NEXT_PUBLIC_SUPABASE_URL
ARG NEXT_PUBLIC_SUPABASE_ANON_KEY
ENV NEXT_PUBLIC_SUPABASE_URL=$NEXT_PUBLIC_SUPABASE_URL
ENV NEXT_PUBLIC_SUPABASE_ANON_KEY=$NEXT_PUBLIC_SUPABASE_ANON_KEY
# Build the production output
RUN npm run build
# ---------- Runtime stage ----------
FROM node:20-alpine AS runner
WORKDIR /app
# Statische Assets kopieren (wichtig für die Chunks/404-Fehler von vorhin)
COPY --from=builder /app/public* ./public
COPY --from=builder /app/.next/static ./.next/static
# Den fertigen Standalone-Server kopieren
COPY --from=builder /app/.next/standalone ./
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/supabase ./supabase
COPY --from=builder /app/migrate.js ./migrate.js
# Pass Supabase variables to runtime image
ARG NEXT_PUBLIC_SUPABASE_URL
ARG NEXT_PUBLIC_SUPABASE_ANON_KEY
ENV NEXT_PUBLIC_SUPABASE_URL=$NEXT_PUBLIC_SUPABASE_URL
ENV NEXT_PUBLIC_SUPABASE_ANON_KEY=$NEXT_PUBLIC_SUPABASE_ANON_KEY
ENV IS_DOCKER=true
EXPOSE 3000
ENV PORT=3000
ENV HOSTNAME="0.0.0.0"
CMD ["sh", "-c", "node migrate.js && node server.js"]

BIN
build-artifact.zip Normal file

Binary file not shown.

View File

@@ -0,0 +1 @@
czEjVggXDRFH51IopN6_9

View File

@@ -0,0 +1,28 @@
{
"/_global-error/page": "/_global-error",
"/_not-found/page": "/_not-found",
"/admin/categories/page": "/admin/categories",
"/admin/orders/page": "/admin/orders",
"/admin/page": "/admin",
"/admin/products/page": "/admin/products",
"/admin/users/page": "/admin/users",
"/api/admin/recent-orders/route": "/api/admin/recent-orders",
"/auth/confirm/route": "/auth/confirm",
"/auth/error/page": "/auth/error",
"/auth/forgot-password/page": "/auth/forgot-password",
"/auth/login/page": "/auth/login",
"/auth/sign-up-success/page": "/auth/sign-up-success",
"/auth/sign-up/page": "/auth/sign-up",
"/auth/update-password/page": "/auth/update-password",
"/favicon.ico/route": "/favicon.ico",
"/my-customers/[id]/page": "/my-customers/[id]",
"/my-customers/new/page": "/my-customers/new",
"/my-customers/page": "/my-customers",
"/my-orders/page": "/my-orders",
"/opengraph-image.png/route": "/opengraph-image.png",
"/order/page": "/order",
"/order/success/page": "/order/success",
"/page": "/",
"/protected/page": "/protected",
"/twitter-image.png/route": "/twitter-image.png"
}

View File

@@ -0,0 +1,23 @@
{
"pages": {
"/_app": []
},
"devFiles": [],
"polyfillFiles": [
"static/chunks/03~yq9q893hmn.js"
],
"lowPriorityFiles": [
"static/czEjVggXDRFH51IopN6_9/_buildManifest.js",
"static/czEjVggXDRFH51IopN6_9/_ssgManifest.js",
"static/czEjVggXDRFH51IopN6_9/_clientMiddlewareManifest.js"
],
"rootMainFiles": [
"static/chunks/0ze4gu236oq96.js",
"static/chunks/10qd__0r7a~.l.js",
"static/chunks/0-gaanm6h49z~.js",
"static/chunks/06c8h6921f-oo.js",
"static/chunks/15jasrm2107sy.js",
"static/chunks/181uojwh.t2ik.js",
"static/chunks/turbopack-0u.mb44r17v0_.js"
]
}

View File

@@ -0,0 +1,207 @@
module.exports = [
"[externals]/path [external] (path, cjs)", ((__turbopack_context__, module, exports) => {
const mod = __turbopack_context__.x("path", () => require("path"));
module.exports = mod;
}),
"[externals]/url [external] (url, cjs)", ((__turbopack_context__, module, exports) => {
const mod = __turbopack_context__.x("url", () => require("url"));
module.exports = mod;
}),
"[externals]/fs [external] (fs, cjs)", ((__turbopack_context__, module, exports) => {
const mod = __turbopack_context__.x("fs", () => require("fs"));
module.exports = mod;
}),
"[project]/postcss.config.mjs [postcss] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"default",
()=>__TURBOPACK__default__export__
]);
/** @type {import('postcss-load-config').Config} */ const config = {
plugins: {
tailwindcss: {},
autoprefixer: {}
}
};
const __TURBOPACK__default__export__ = config;
}),
"[turbopack-node]/transforms/transforms.ts [postcss] (ecmascript)", ((__turbopack_context__) => {
"use strict";
/**
* Shared utilities for our 2 transform implementations.
*/ __turbopack_context__.s([
"fromPath",
()=>fromPath,
"getReadEnvVariables",
()=>getReadEnvVariables,
"toPath",
()=>toPath
]);
var __TURBOPACK__imported__module__$5b$externals$5d2f$path__$5b$external$5d$__$28$path$2c$__cjs$29$__ = __turbopack_context__.i("[externals]/path [external] (path, cjs)");
;
const contextDir = process.cwd();
const toPath = (file)=>{
const relPath = (0, __TURBOPACK__imported__module__$5b$externals$5d2f$path__$5b$external$5d$__$28$path$2c$__cjs$29$__["relative"])(contextDir, file);
if ((0, __TURBOPACK__imported__module__$5b$externals$5d2f$path__$5b$external$5d$__$28$path$2c$__cjs$29$__["isAbsolute"])(relPath)) {
throw new Error(`Cannot depend on path (${file}) outside of root directory (${contextDir})`);
}
return __TURBOPACK__imported__module__$5b$externals$5d2f$path__$5b$external$5d$__$28$path$2c$__cjs$29$__["sep"] !== '/' ? relPath.replaceAll(__TURBOPACK__imported__module__$5b$externals$5d2f$path__$5b$external$5d$__$28$path$2c$__cjs$29$__["sep"], '/') : relPath;
};
const fromPath = (path)=>{
return (0, __TURBOPACK__imported__module__$5b$externals$5d2f$path__$5b$external$5d$__$28$path$2c$__cjs$29$__["join"])(/* turbopackIgnore: true */ contextDir, __TURBOPACK__imported__module__$5b$externals$5d2f$path__$5b$external$5d$__$28$path$2c$__cjs$29$__["sep"] !== '/' ? path.replaceAll('/', __TURBOPACK__imported__module__$5b$externals$5d2f$path__$5b$external$5d$__$28$path$2c$__cjs$29$__["sep"]) : path);
};
// Patch process.env to track which env vars are read
const originalEnv = process.env;
const readEnvVars = new Set();
process.env = new Proxy(originalEnv, {
get (target, prop) {
if (typeof prop === 'string') {
// We register the env var as dependency on the
// current transform and all future transforms
// since the env var might be cached in module scope
// and influence them all
readEnvVars.add(prop);
}
return Reflect.get(target, prop);
},
set (target, prop, value) {
return Reflect.set(target, prop, value);
}
});
function getReadEnvVariables() {
return Array.from(readEnvVars);
}
}),
"[turbopack-node]/transforms/postcss.ts { CONFIG => \"[project]/postcss.config.mjs [postcss] (ecmascript)\" } [postcss] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"default",
()=>transform,
"init",
()=>init
]);
// @ts-ignore
var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$postcss$2f$lib$2f$postcss$2e$mjs__$5b$postcss$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/postcss/lib/postcss.mjs [postcss] (ecmascript)");
// @ts-ignore
var __TURBOPACK__imported__module__$5b$project$5d2f$postcss$2e$config$2e$mjs__$5b$postcss$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/postcss.config.mjs [postcss] (ecmascript)");
var __TURBOPACK__imported__module__$5b$turbopack$2d$node$5d2f$transforms$2f$transforms$2e$ts__$5b$postcss$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[turbopack-node]/transforms/transforms.ts [postcss] (ecmascript)");
;
;
;
let processor;
const init = async (ipc)=>{
let config = __TURBOPACK__imported__module__$5b$project$5d2f$postcss$2e$config$2e$mjs__$5b$postcss$5d$__$28$ecmascript$29$__["default"];
if (typeof config === 'function') {
config = await config({
env: 'development'
});
}
if (typeof config === 'undefined') {
throw new Error('PostCSS config is undefined (make sure to export an function or object from config file)');
}
let plugins;
if (Array.isArray(config.plugins)) {
plugins = config.plugins.map((plugin)=>{
if (Array.isArray(plugin)) {
return plugin;
} else if (typeof plugin === 'string') {
return [
plugin,
{}
];
} else {
return plugin;
}
});
} else if (typeof config.plugins === 'object') {
plugins = Object.entries(config.plugins).filter(([, options])=>options);
} else {
plugins = [];
}
const loadedPlugins = plugins.map((plugin)=>{
if (Array.isArray(plugin)) {
const [arg, options] = plugin;
let pluginFactory = arg;
if (typeof pluginFactory === 'string') {
pluginFactory = require(/* turbopackIgnore: true */ pluginFactory);
}
if (pluginFactory.default) {
pluginFactory = pluginFactory.default;
}
return pluginFactory(options);
}
return plugin;
});
processor = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$postcss$2f$lib$2f$postcss$2e$mjs__$5b$postcss$5d$__$28$ecmascript$29$__["default"])(loadedPlugins);
};
async function transform(ipc, cssContent, name, sourceMap) {
const { css, map, messages } = await processor.process(cssContent, {
from: name,
to: name,
map: sourceMap ? {
inline: false,
annotation: false
} : undefined
});
const assets = [];
const filePaths = [];
const buildFilePaths = [];
const directories = [];
for (const msg of messages){
switch(msg.type){
case 'asset':
assets.push({
file: msg.file,
content: msg.content,
sourceMap: !sourceMap ? undefined : typeof msg.sourceMap === 'string' ? msg.sourceMap : JSON.stringify(msg.sourceMap)
});
break;
case 'dependency':
case 'missing-dependency':
filePaths.push((0, __TURBOPACK__imported__module__$5b$turbopack$2d$node$5d2f$transforms$2f$transforms$2e$ts__$5b$postcss$5d$__$28$ecmascript$29$__["toPath"])(msg.file));
break;
case 'build-dependency':
buildFilePaths.push((0, __TURBOPACK__imported__module__$5b$turbopack$2d$node$5d2f$transforms$2f$transforms$2e$ts__$5b$postcss$5d$__$28$ecmascript$29$__["toPath"])(msg.file));
break;
case 'dir-dependency':
directories.push([
(0, __TURBOPACK__imported__module__$5b$turbopack$2d$node$5d2f$transforms$2f$transforms$2e$ts__$5b$postcss$5d$__$28$ecmascript$29$__["toPath"])(msg.dir),
msg.glob
]);
break;
case 'context-dependency':
directories.push([
(0, __TURBOPACK__imported__module__$5b$turbopack$2d$node$5d2f$transforms$2f$transforms$2e$ts__$5b$postcss$5d$__$28$ecmascript$29$__["toPath"])(msg.dir),
'**'
]);
break;
default:
break;
}
}
ipc.sendInfo({
type: 'dependencies',
filePaths,
directories,
buildFilePaths,
envVariables: (0, __TURBOPACK__imported__module__$5b$turbopack$2d$node$5d2f$transforms$2f$transforms$2e$ts__$5b$postcss$5d$__$28$ecmascript$29$__["getReadEnvVariables"])()
});
return {
css,
map: sourceMap ? JSON.stringify(map) : undefined,
assets
};
}
}),
];
//# sourceMappingURL=%5Broot-of-the-server%5D__0d-m0h0._.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,500 @@
module.exports = [
"[turbopack-node]/child_process/globals.ts [postcss] (ecmascript)", ((__turbopack_context__, module, exports) => {
// @ts-ignore
process.turbopack = {};
}),
"[externals]/node:net [external] (node:net, cjs)", ((__turbopack_context__, module, exports) => {
const mod = __turbopack_context__.x("node:net", () => require("node:net"));
module.exports = mod;
}),
"[externals]/node:stream [external] (node:stream, cjs)", ((__turbopack_context__, module, exports) => {
const mod = __turbopack_context__.x("node:stream", () => require("node:stream"));
module.exports = mod;
}),
"[turbopack-node]/compiled/stacktrace-parser/index.js [postcss] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"parse",
()=>parse
]);
if (typeof __nccwpck_require__ !== "undefined") __nccwpck_require__.ab = ("TURBOPACK compile-time value", "/ROOT/compiled/stacktrace-parser") + "/";
var n = "<unknown>";
function parse(e) {
var r = e.split("\n");
return r.reduce(function(e, r) {
var n = parseChrome(r) || parseWinjs(r) || parseGecko(r) || parseNode(r) || parseJSC(r);
if (n) {
e.push(n);
}
return e;
}, []);
}
var a = /^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\/|[a-z]:\\|\\\\).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i;
var l = /\((\S*)(?::(\d+))(?::(\d+))\)/;
function parseChrome(e) {
var r = a.exec(e);
if (!r) {
return null;
}
var u = r[2] && r[2].indexOf("native") === 0;
var t = r[2] && r[2].indexOf("eval") === 0;
var i = l.exec(r[2]);
if (t && i != null) {
r[2] = i[1];
r[3] = i[2];
r[4] = i[3];
}
return {
file: !u ? r[2] : null,
methodName: r[1] || n,
arguments: u ? [
r[2]
] : [],
lineNumber: r[3] ? +r[3] : null,
column: r[4] ? +r[4] : null
};
}
var u = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;
function parseWinjs(e) {
var r = u.exec(e);
if (!r) {
return null;
}
return {
file: r[2],
methodName: r[1] || n,
arguments: [],
lineNumber: +r[3],
column: r[4] ? +r[4] : null
};
}
var t = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i;
var i = /(\S+) line (\d+)(?: > eval line \d+)* > eval/i;
function parseGecko(e) {
var r = t.exec(e);
if (!r) {
return null;
}
var a = r[3] && r[3].indexOf(" > eval") > -1;
var l = i.exec(r[3]);
if (a && l != null) {
r[3] = l[1];
r[4] = l[2];
r[5] = null;
}
return {
file: r[3],
methodName: r[1] || n,
arguments: r[2] ? r[2].split(",") : [],
lineNumber: r[4] ? +r[4] : null,
column: r[5] ? +r[5] : null
};
}
var s = /^\s*(?:([^@]*)(?:\((.*?)\))?@)?(\S.*?):(\d+)(?::(\d+))?\s*$/i;
function parseJSC(e) {
var r = s.exec(e);
if (!r) {
return null;
}
return {
file: r[3],
methodName: r[1] || n,
arguments: [],
lineNumber: +r[4],
column: r[5] ? +r[5] : null
};
}
var o = /^\s*at (?:((?:\[object object\])?[^\\/]+(?: \[as \S+\])?) )?\(?(.*?):(\d+)(?::(\d+))?\)?\s*$/i;
function parseNode(e) {
var r = o.exec(e);
if (!r) {
return null;
}
return {
file: r[2],
methodName: r[1] || n,
arguments: [],
lineNumber: +r[3],
column: r[4] ? +r[4] : null
};
}
}),
"[turbopack-node]/error.ts [postcss] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"default",
()=>isError,
"getProperError",
()=>getProperError,
"structuredError",
()=>structuredError
]);
var __TURBOPACK__imported__module__$5b$turbopack$2d$node$5d2f$compiled$2f$stacktrace$2d$parser$2f$index$2e$js__$5b$postcss$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[turbopack-node]/compiled/stacktrace-parser/index.js [postcss] (ecmascript)");
;
function isError(err) {
return typeof err === 'object' && err !== null && 'name' in err && 'message' in err;
}
function getProperError(err) {
if (isError(err)) {
return err;
}
if ("TURBOPACK compile-time falsy", 0) //TURBOPACK unreachable
;
return new Error(isPlainObject(err) ? JSON.stringify(err) : err + '');
}
function getObjectClassLabel(value) {
return Object.prototype.toString.call(value);
}
function isPlainObject(value) {
if (getObjectClassLabel(value) !== '[object Object]') {
return false;
}
const prototype = Object.getPrototypeOf(value);
/**
* this used to be previously:
*
* `return prototype === null || prototype === Object.prototype`
*
* but Edge Runtime expose Object from vm, being that kind of type-checking wrongly fail.
*
* It was changed to the current implementation since it's resilient to serialization.
*/ return prototype === null || prototype.hasOwnProperty('isPrototypeOf');
}
function structuredError(e) {
e = getProperError(e);
return {
name: e.name,
message: e.message,
stack: typeof e.stack === 'string' ? (0, __TURBOPACK__imported__module__$5b$turbopack$2d$node$5d2f$compiled$2f$stacktrace$2d$parser$2f$index$2e$js__$5b$postcss$5d$__$28$ecmascript$29$__["parse"])(e.stack) : [],
cause: e.cause ? structuredError(getProperError(e.cause)) : undefined
};
}
}),
"[turbopack-node]/child_process/index.ts [postcss] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"IPC",
()=>IPC
]);
var __TURBOPACK__imported__module__$5b$externals$5d2f$node$3a$net__$5b$external$5d$__$28$node$3a$net$2c$__cjs$29$__ = __turbopack_context__.i("[externals]/node:net [external] (node:net, cjs)");
var __TURBOPACK__imported__module__$5b$externals$5d2f$node$3a$stream__$5b$external$5d$__$28$node$3a$stream$2c$__cjs$29$__ = __turbopack_context__.i("[externals]/node:stream [external] (node:stream, cjs)");
var __TURBOPACK__imported__module__$5b$turbopack$2d$node$5d2f$error$2e$ts__$5b$postcss$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[turbopack-node]/error.ts [postcss] (ecmascript)");
;
;
;
function createIpc(port) {
const socket = (0, __TURBOPACK__imported__module__$5b$externals$5d2f$node$3a$net__$5b$external$5d$__$28$node$3a$net$2c$__cjs$29$__["createConnection"])({
port,
host: '127.0.0.1'
});
/**
* A writable stream that writes to the socket.
* We don't write directly to the socket because we need to
* handle backpressure and wait for the socket to be drained
* before writing more data.
*/ const socketWritable = new __TURBOPACK__imported__module__$5b$externals$5d2f$node$3a$stream__$5b$external$5d$__$28$node$3a$stream$2c$__cjs$29$__["Writable"]({
write (chunk, _enc, cb) {
if (socket.write(chunk)) {
cb();
} else {
socket.once('drain', cb);
}
},
final (cb) {
socket.end(cb);
}
});
const packetQueue = [];
const recvPromiseResolveQueue = [];
function pushPacket(packet) {
const recvPromiseResolve = recvPromiseResolveQueue.shift();
if (recvPromiseResolve != null) {
recvPromiseResolve(JSON.parse(packet.toString('utf8')));
} else {
packetQueue.push(packet);
}
}
let state = {
type: 'waiting'
};
let buffer = Buffer.alloc(0);
socket.once('connect', ()=>{
socket.setNoDelay(true);
socket.on('data', (chunk)=>{
buffer = Buffer.concat([
buffer,
chunk
]);
loop: while(true){
switch(state.type){
case 'waiting':
{
if (buffer.length >= 4) {
const length = buffer.readUInt32BE(0);
buffer = buffer.subarray(4);
state = {
type: 'packet',
length
};
} else {
break loop;
}
break;
}
case 'packet':
{
if (buffer.length >= state.length) {
const packet = buffer.subarray(0, state.length);
buffer = buffer.subarray(state.length);
state = {
type: 'waiting'
};
pushPacket(packet);
} else {
break loop;
}
break;
}
default:
invariant(state, (state)=>`Unknown state type: ${state?.type}`);
}
}
});
});
// When the socket is closed, this process is no longer needed.
// This might happen e. g. when parent process is killed or
// node.js pool is garbage collected.
socket.once('close', ()=>{
process.exit(0);
});
// TODO(lukesandberg): some of the messages being sent are very large and contain lots
// of redundant information. Consider adding gzip compression to our stream.
function doSend(message) {
return new Promise((resolve, reject)=>{
// Reserve 4 bytes for our length prefix, we will over-write after encoding.
const packet = Buffer.from('0000' + message, 'utf8');
packet.writeUInt32BE(packet.length - 4, 0);
socketWritable.write(packet, (err)=>{
process.stderr.write(`TURBOPACK_OUTPUT_D\n`);
process.stdout.write(`TURBOPACK_OUTPUT_D\n`);
if (err != null) {
reject(err);
} else {
resolve();
}
});
});
}
function send(message) {
return doSend(JSON.stringify(message));
}
function sendReady() {
return doSend('');
}
return {
async recv () {
const packet = packetQueue.shift();
if (packet != null) {
return JSON.parse(packet.toString('utf8'));
}
const result = await new Promise((resolve)=>{
recvPromiseResolveQueue.push((result)=>{
resolve(result);
});
});
return result;
},
send (message) {
return send(message);
},
sendReady,
async sendError (error) {
let failed = false;
try {
await send({
type: 'error',
...(0, __TURBOPACK__imported__module__$5b$turbopack$2d$node$5d2f$error$2e$ts__$5b$postcss$5d$__$28$ecmascript$29$__["structuredError"])(error)
});
} catch (err) {
// There's nothing we can do about errors that happen after this point, we can't tell anyone
// about them.
console.error('failed to send error back to rust:', err);
failed = true;
}
await new Promise((res)=>socket.end(()=>res()));
process.exit(failed ? 1 : 0);
}
};
}
const PORT = process.argv[2];
const IPC = createIpc(parseInt(PORT, 10));
process.on('uncaughtException', (err)=>{
IPC.sendError(err);
});
process.on('unhandledRejection', (reason)=>{
IPC.sendError(reason instanceof Error ? reason : new Error(String(reason)));
});
const improveConsole = (name, stream, addStack)=>{
// @ts-ignore
const original = console[name];
// @ts-ignore
const stdio = process[stream];
// @ts-ignore
console[name] = (...args)=>{
stdio.write(`TURBOPACK_OUTPUT_B\n`);
original(...args);
if (addStack) {
const stack = new Error().stack?.replace(/^.+\n.+\n/, '') + '\n';
stdio.write('TURBOPACK_OUTPUT_S\n');
stdio.write(stack);
}
stdio.write('TURBOPACK_OUTPUT_E\n');
};
};
improveConsole('error', 'stderr', true);
improveConsole('warn', 'stderr', true);
improveConsole('count', 'stdout', true);
improveConsole('trace', 'stderr', false);
improveConsole('log', 'stdout', true);
improveConsole('group', 'stdout', true);
improveConsole('groupCollapsed', 'stdout', true);
improveConsole('table', 'stdout', true);
improveConsole('debug', 'stdout', true);
improveConsole('info', 'stdout', true);
improveConsole('dir', 'stdout', true);
improveConsole('dirxml', 'stdout', true);
improveConsole('timeEnd', 'stdout', true);
improveConsole('timeLog', 'stdout', true);
improveConsole('timeStamp', 'stdout', true);
improveConsole('assert', 'stderr', true);
/**
* Utility function to ensure all variants of an enum are handled.
*/ function invariant(never, computeMessage) {
throw new Error(`Invariant: ${computeMessage(never)}`);
}
}),
"[turbopack-node]/child_process/evaluate.ts [postcss] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"run",
()=>run
]);
var __TURBOPACK__imported__module__$5b$turbopack$2d$node$5d2f$child_process$2f$index$2e$ts__$5b$postcss$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[turbopack-node]/child_process/index.ts [postcss] (ecmascript)");
;
const ipc = __TURBOPACK__imported__module__$5b$turbopack$2d$node$5d2f$child_process$2f$index$2e$ts__$5b$postcss$5d$__$28$ecmascript$29$__["IPC"];
const queue = [];
const run = async (moduleFactory)=>{
let nextId = 1;
const requests = new Map();
const internalIpc = {
sendInfo: (message)=>ipc.send({
type: 'info',
data: message
}),
sendRequest: (message)=>{
const id = nextId++;
let resolve, reject;
const promise = new Promise((res, rej)=>{
resolve = res;
reject = rej;
});
requests.set(id, {
resolve,
reject
});
return ipc.send({
type: 'request',
id,
data: message
}).then(()=>promise);
},
sendError: (error)=>{
return ipc.sendError(error);
}
};
// Initialize module and send ready message
let getValue;
try {
const module = await moduleFactory();
if (typeof module.init === 'function') {
await module.init();
}
getValue = module.default;
await ipc.sendReady();
} catch (err) {
await ipc.sendReady();
await ipc.sendError(err);
}
// Queue handling
let isRunning = false;
const run = async ()=>{
while(queue.length > 0){
const args = queue.shift();
try {
const value = await getValue(internalIpc, ...args);
await ipc.send({
type: 'end',
data: value === undefined ? undefined : JSON.stringify(value, null, 2),
duration: 0
});
} catch (e) {
await ipc.sendError(e);
}
}
isRunning = false;
};
// Communication handling
while(true){
const msg = await ipc.recv();
switch(msg.type){
case 'evaluate':
{
queue.push(msg.args);
if (!isRunning) {
isRunning = true;
run();
}
break;
}
case 'result':
{
const request = requests.get(msg.id);
if (request) {
requests.delete(msg.id);
if (msg.error) {
request.reject(new Error(msg.error));
} else {
request.resolve(msg.data);
}
}
break;
}
default:
{
console.error('unexpected message type', msg.type);
process.exit(1);
}
}
}
};
}),
"[turbopack-node]/child_process/evaluate.ts/evaluate.js { INNER => \"[turbopack-node]/transforms/postcss.ts { CONFIG => \\\"[project]/postcss.config.mjs [postcss] (ecmascript)\\\" } [postcss] (ecmascript)\", RUNTIME => \"[turbopack-node]/child_process/evaluate.ts [postcss] (ecmascript)\" } [postcss] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([]);
var __TURBOPACK__imported__module__$5b$turbopack$2d$node$5d2f$child_process$2f$evaluate$2e$ts__$5b$postcss$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[turbopack-node]/child_process/evaluate.ts [postcss] (ecmascript)");
;
(0, __TURBOPACK__imported__module__$5b$turbopack$2d$node$5d2f$child_process$2f$evaluate$2e$ts__$5b$postcss$5d$__$28$ecmascript$29$__["run"])(()=>__turbopack_context__.A('[turbopack-node]/transforms/postcss.ts { CONFIG => "[project]/postcss.config.mjs [postcss] (ecmascript)" } [postcss] (ecmascript, async loader)'));
}),
];
//# sourceMappingURL=%5Broot-of-the-server%5D__0ubbtyl._.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,13 @@
module.exports = [
"[turbopack-node]/transforms/postcss.ts { CONFIG => \"[project]/postcss.config.mjs [postcss] (ecmascript)\" } [postcss] (ecmascript, async loader)", ((__turbopack_context__) => {
__turbopack_context__.v((parentImport) => {
return Promise.all([
"chunks/node_modules_13sb.px._.js",
"chunks/[root-of-the-server]__0d-m0h0._.js"
].map((chunk) => __turbopack_context__.l(chunk))).then(() => {
return parentImport("[turbopack-node]/transforms/postcss.ts { CONFIG => \"[project]/postcss.config.mjs [postcss] (ecmascript)\" } [postcss] (ecmascript)");
});
});
}),
];

View File

@@ -0,0 +1,5 @@
{
"version": 3,
"sources": [],
"sections": []
}

View File

@@ -0,0 +1,890 @@
const RUNTIME_PUBLIC_PATH = "chunks/[turbopack]_runtime.js";
const RELATIVE_ROOT_PATH = "..";
const ASSET_PREFIX = "/";
const WORKER_FORWARDED_GLOBALS = [];
/**
* This file contains runtime types and functions that are shared between all
* TurboPack ECMAScript runtimes.
*
* It will be prepended to the runtime code of each runtime.
*/ /* eslint-disable @typescript-eslint/no-unused-vars */ /// <reference path="./runtime-types.d.ts" />
/**
* Describes why a module was instantiated.
* Shared between browser and Node.js runtimes.
*/ var SourceType = /*#__PURE__*/ function(SourceType) {
/**
* The module was instantiated because it was included in an evaluated chunk's
* runtime.
* SourceData is a ChunkPath.
*/ SourceType[SourceType["Runtime"] = 0] = "Runtime";
/**
* The module was instantiated because a parent module imported it.
* SourceData is a ModuleId.
*/ SourceType[SourceType["Parent"] = 1] = "Parent";
/**
* The module was instantiated because it was included in a chunk's hot module
* update.
* SourceData is an array of ModuleIds or undefined.
*/ SourceType[SourceType["Update"] = 2] = "Update";
return SourceType;
}(SourceType || {});
/**
* Flag indicating which module object type to create when a module is merged. Set to `true`
* by each runtime that uses ModuleWithDirection (browser dev-base.ts, nodejs dev-base.ts,
* nodejs build-base.ts). Browser production (build-base.ts) leaves it as `false` since it
* uses plain Module objects.
*/ let createModuleWithDirectionFlag = false;
const REEXPORTED_OBJECTS = new WeakMap();
/**
* Constructs the `__turbopack_context__` object for a module.
*/ function Context(module, exports) {
this.m = module;
// We need to store this here instead of accessing it from the module object to:
// 1. Make it available to factories directly, since we rewrite `this` to
// `__turbopack_context__.e` in CJS modules.
// 2. Support async modules which rewrite `module.exports` to a promise, so we
// can still access the original exports object from functions like
// `esmExport`
// Ideally we could find a new approach for async modules and drop this property altogether.
this.e = exports;
}
const contextPrototype = Context.prototype;
const hasOwnProperty = Object.prototype.hasOwnProperty;
const toStringTag = typeof Symbol !== 'undefined' && Symbol.toStringTag;
function defineProp(obj, name, options) {
if (!hasOwnProperty.call(obj, name)) Object.defineProperty(obj, name, options);
}
function getOverwrittenModule(moduleCache, id) {
let module = moduleCache[id];
if (!module) {
if (createModuleWithDirectionFlag) {
// set in development modes for hmr support
module = createModuleWithDirection(id);
} else {
module = createModuleObject(id);
}
moduleCache[id] = module;
}
return module;
}
/**
* Creates the module object. Only done here to ensure all module objects have the same shape.
*/ function createModuleObject(id) {
return {
exports: {},
error: undefined,
id,
namespaceObject: undefined
};
}
function createModuleWithDirection(id) {
return {
exports: {},
error: undefined,
id,
namespaceObject: undefined,
parents: [],
children: []
};
}
const BindingTag_Value = 0;
/**
* Adds the getters to the exports object.
*/ function esm(exports, bindings) {
defineProp(exports, '__esModule', {
value: true
});
if (toStringTag) defineProp(exports, toStringTag, {
value: 'Module'
});
let i = 0;
while(i < bindings.length){
const propName = bindings[i++];
const tagOrFunction = bindings[i++];
if (typeof tagOrFunction === 'number') {
if (tagOrFunction === BindingTag_Value) {
defineProp(exports, propName, {
value: bindings[i++],
enumerable: true,
writable: false
});
} else {
throw new Error(`unexpected tag: ${tagOrFunction}`);
}
} else {
const getterFn = tagOrFunction;
if (typeof bindings[i] === 'function') {
const setterFn = bindings[i++];
defineProp(exports, propName, {
get: getterFn,
set: setterFn,
enumerable: true
});
} else {
defineProp(exports, propName, {
get: getterFn,
enumerable: true
});
}
}
}
Object.seal(exports);
}
/**
* Makes the module an ESM with exports
*/ function esmExport(bindings, id) {
let module;
let exports;
if (id != null) {
module = getOverwrittenModule(this.c, id);
exports = module.exports;
} else {
module = this.m;
exports = this.e;
}
module.namespaceObject = exports;
esm(exports, bindings);
}
contextPrototype.s = esmExport;
function ensureDynamicExports(module, exports) {
let reexportedObjects = REEXPORTED_OBJECTS.get(module);
if (!reexportedObjects) {
REEXPORTED_OBJECTS.set(module, reexportedObjects = []);
module.exports = module.namespaceObject = new Proxy(exports, {
get (target, prop) {
if (hasOwnProperty.call(target, prop) || prop === 'default' || prop === '__esModule') {
return Reflect.get(target, prop);
}
for (const obj of reexportedObjects){
const value = Reflect.get(obj, prop);
if (value !== undefined) return value;
}
return undefined;
},
ownKeys (target) {
const keys = Reflect.ownKeys(target);
for (const obj of reexportedObjects){
for (const key of Reflect.ownKeys(obj)){
if (key !== 'default' && !keys.includes(key)) keys.push(key);
}
}
return keys;
}
});
}
return reexportedObjects;
}
/**
* Dynamically exports properties from an object
*/ function dynamicExport(object, id) {
let module;
let exports;
if (id != null) {
module = getOverwrittenModule(this.c, id);
exports = module.exports;
} else {
module = this.m;
exports = this.e;
}
const reexportedObjects = ensureDynamicExports(module, exports);
if (typeof object === 'object' && object !== null) {
reexportedObjects.push(object);
}
}
contextPrototype.j = dynamicExport;
function exportValue(value, id) {
let module;
if (id != null) {
module = getOverwrittenModule(this.c, id);
} else {
module = this.m;
}
module.exports = value;
}
contextPrototype.v = exportValue;
function exportNamespace(namespace, id) {
let module;
if (id != null) {
module = getOverwrittenModule(this.c, id);
} else {
module = this.m;
}
module.exports = module.namespaceObject = namespace;
}
contextPrototype.n = exportNamespace;
function createGetter(obj, key) {
return ()=>obj[key];
}
/**
* @returns prototype of the object
*/ const getProto = Object.getPrototypeOf ? (obj)=>Object.getPrototypeOf(obj) : (obj)=>obj.__proto__;
/** Prototypes that are not expanded for exports */ const LEAF_PROTOTYPES = [
null,
getProto({}),
getProto([]),
getProto(getProto)
];
/**
* @param raw
* @param ns
* @param allowExportDefault
* * `false`: will have the raw module as default export
* * `true`: will have the default property as default export
*/ function interopEsm(raw, ns, allowExportDefault) {
const bindings = [];
let defaultLocation = -1;
for(let current = raw; (typeof current === 'object' || typeof current === 'function') && !LEAF_PROTOTYPES.includes(current); current = getProto(current)){
for (const key of Object.getOwnPropertyNames(current)){
bindings.push(key, createGetter(raw, key));
if (defaultLocation === -1 && key === 'default') {
defaultLocation = bindings.length - 1;
}
}
}
// this is not really correct
// we should set the `default` getter if the imported module is a `.cjs file`
if (!(allowExportDefault && defaultLocation >= 0)) {
// Replace the binding with one for the namespace itself in order to preserve iteration order.
if (defaultLocation >= 0) {
// Replace the getter with the value
bindings.splice(defaultLocation, 1, BindingTag_Value, raw);
} else {
bindings.push('default', BindingTag_Value, raw);
}
}
esm(ns, bindings);
return ns;
}
function createNS(raw) {
if (typeof raw === 'function') {
return function(...args) {
return raw.apply(this, args);
};
} else {
return Object.create(null);
}
}
function esmImport(id) {
const module = getOrInstantiateModuleFromParent(id, this.m);
// any ES module has to have `module.namespaceObject` defined.
if (module.namespaceObject) return module.namespaceObject;
// only ESM can be an async module, so we don't need to worry about exports being a promise here.
const raw = module.exports;
return module.namespaceObject = interopEsm(raw, createNS(raw), raw && raw.__esModule);
}
contextPrototype.i = esmImport;
function asyncLoader(moduleId) {
const loader = this.r(moduleId);
return loader(esmImport.bind(this));
}
contextPrototype.A = asyncLoader;
// Add a simple runtime require so that environments without one can still pass
// `typeof require` CommonJS checks so that exports are correctly registered.
const runtimeRequire = // @ts-ignore
typeof require === 'function' ? require : function require1() {
throw new Error('Unexpected use of runtime require');
};
contextPrototype.t = runtimeRequire;
function commonJsRequire(id) {
return getOrInstantiateModuleFromParent(id, this.m).exports;
}
contextPrototype.r = commonJsRequire;
/**
* Remove fragments and query parameters since they are never part of the context map keys
*
* This matches how we parse patterns at resolving time. Arguably we should only do this for
* strings passed to `import` but the resolve does it for `import` and `require` and so we do
* here as well.
*/ function parseRequest(request) {
// Per the URI spec fragments can contain `?` characters, so we should trim it off first
// https://datatracker.ietf.org/doc/html/rfc3986#section-3.5
const hashIndex = request.indexOf('#');
if (hashIndex !== -1) {
request = request.substring(0, hashIndex);
}
const queryIndex = request.indexOf('?');
if (queryIndex !== -1) {
request = request.substring(0, queryIndex);
}
return request;
}
/**
* `require.context` and require/import expression runtime.
*/ function moduleContext(map) {
function moduleContext(id) {
id = parseRequest(id);
if (hasOwnProperty.call(map, id)) {
return map[id].module();
}
const e = new Error(`Cannot find module '${id}'`);
e.code = 'MODULE_NOT_FOUND';
throw e;
}
moduleContext.keys = ()=>{
return Object.keys(map);
};
moduleContext.resolve = (id)=>{
id = parseRequest(id);
if (hasOwnProperty.call(map, id)) {
return map[id].id();
}
const e = new Error(`Cannot find module '${id}'`);
e.code = 'MODULE_NOT_FOUND';
throw e;
};
moduleContext.import = async (id)=>{
return await moduleContext(id);
};
return moduleContext;
}
contextPrototype.f = moduleContext;
/**
* Returns the path of a chunk defined by its data.
*/ function getChunkPath(chunkData) {
return typeof chunkData === 'string' ? chunkData : chunkData.path;
}
function isPromise(maybePromise) {
return maybePromise != null && typeof maybePromise === 'object' && 'then' in maybePromise && typeof maybePromise.then === 'function';
}
function isAsyncModuleExt(obj) {
return turbopackQueues in obj;
}
function createPromise() {
let resolve;
let reject;
const promise = new Promise((res, rej)=>{
reject = rej;
resolve = res;
});
return {
promise,
resolve: resolve,
reject: reject
};
}
// Load the CompressedmoduleFactories of a chunk into the `moduleFactories` Map.
// The CompressedModuleFactories format is
// - 1 or more module ids
// - a module factory function
// So walking this is a little complex but the flat structure is also fast to
// traverse, we can use `typeof` operators to distinguish the two cases.
function installCompressedModuleFactories(chunkModules, offset, moduleFactories, newModuleId) {
let i = offset;
while(i < chunkModules.length){
let end = i + 1;
// Find our factory function
while(end < chunkModules.length && typeof chunkModules[end] !== 'function'){
end++;
}
if (end === chunkModules.length) {
throw new Error('malformed chunk format, expected a factory function');
}
// Install the factory for each module ID that doesn't already have one.
// When some IDs in this group already have a factory, reuse that existing
// group factory for the missing IDs to keep all IDs in the group consistent.
// Otherwise, install the factory from this chunk.
const moduleFactoryFn = chunkModules[end];
let existingGroupFactory = undefined;
for(let j = i; j < end; j++){
const id = chunkModules[j];
const existingFactory = moduleFactories.get(id);
if (existingFactory) {
existingGroupFactory = existingFactory;
break;
}
}
const factoryToInstall = existingGroupFactory ?? moduleFactoryFn;
let didInstallFactory = false;
for(let j = i; j < end; j++){
const id = chunkModules[j];
if (!moduleFactories.has(id)) {
if (!didInstallFactory) {
if (factoryToInstall === moduleFactoryFn) {
applyModuleFactoryName(moduleFactoryFn);
}
didInstallFactory = true;
}
moduleFactories.set(id, factoryToInstall);
newModuleId?.(id);
}
}
i = end + 1; // end is pointing at the last factory advance to the next id or the end of the array.
}
}
// everything below is adapted from webpack
// https://github.com/webpack/webpack/blob/6be4065ade1e252c1d8dcba4af0f43e32af1bdc1/lib/runtime/AsyncModuleRuntimeModule.js#L13
const turbopackQueues = Symbol('turbopack queues');
const turbopackExports = Symbol('turbopack exports');
const turbopackError = Symbol('turbopack error');
function resolveQueue(queue) {
if (queue && queue.status !== 1) {
queue.status = 1;
queue.forEach((fn)=>fn.queueCount--);
queue.forEach((fn)=>fn.queueCount-- ? fn.queueCount++ : fn());
}
}
function wrapDeps(deps) {
return deps.map((dep)=>{
if (dep !== null && typeof dep === 'object') {
if (isAsyncModuleExt(dep)) return dep;
if (isPromise(dep)) {
const queue = Object.assign([], {
status: 0
});
const obj = {
[turbopackExports]: {},
[turbopackQueues]: (fn)=>fn(queue)
};
dep.then((res)=>{
obj[turbopackExports] = res;
resolveQueue(queue);
}, (err)=>{
obj[turbopackError] = err;
resolveQueue(queue);
});
return obj;
}
}
return {
[turbopackExports]: dep,
[turbopackQueues]: ()=>{}
};
});
}
function asyncModule(body, hasAwait) {
const module = this.m;
const queue = hasAwait ? Object.assign([], {
status: -1
}) : undefined;
const depQueues = new Set();
const { resolve, reject, promise: rawPromise } = createPromise();
const promise = Object.assign(rawPromise, {
[turbopackExports]: module.exports,
[turbopackQueues]: (fn)=>{
queue && fn(queue);
depQueues.forEach(fn);
promise['catch'](()=>{});
}
});
const attributes = {
get () {
return promise;
},
set (v) {
// Calling `esmExport` leads to this.
if (v !== promise) {
promise[turbopackExports] = v;
}
}
};
Object.defineProperty(module, 'exports', attributes);
Object.defineProperty(module, 'namespaceObject', attributes);
function handleAsyncDependencies(deps) {
const currentDeps = wrapDeps(deps);
const getResult = ()=>currentDeps.map((d)=>{
if (d[turbopackError]) throw d[turbopackError];
return d[turbopackExports];
});
const { promise, resolve } = createPromise();
const fn = Object.assign(()=>resolve(getResult), {
queueCount: 0
});
function fnQueue(q) {
if (q !== queue && !depQueues.has(q)) {
depQueues.add(q);
if (q && q.status === 0) {
fn.queueCount++;
q.push(fn);
}
}
}
currentDeps.map((dep)=>dep[turbopackQueues](fnQueue));
return fn.queueCount ? promise : getResult();
}
function asyncResult(err) {
if (err) {
reject(promise[turbopackError] = err);
} else {
resolve(promise[turbopackExports]);
}
resolveQueue(queue);
}
body(handleAsyncDependencies, asyncResult);
if (queue && queue.status === -1) {
queue.status = 0;
}
}
contextPrototype.a = asyncModule;
/**
* A pseudo "fake" URL object to resolve to its relative path.
*
* When UrlRewriteBehavior is set to relative, calls to the `new URL()` will construct url without base using this
* runtime function to generate context-agnostic urls between different rendering context, i.e ssr / client to avoid
* hydration mismatch.
*
* This is based on webpack's existing implementation:
* https://github.com/webpack/webpack/blob/87660921808566ef3b8796f8df61bd79fc026108/lib/runtime/RelativeUrlRuntimeModule.js
*/ const relativeURL = function relativeURL(inputUrl) {
const realUrl = new URL(inputUrl, 'x:/');
const values = {};
for(const key in realUrl)values[key] = realUrl[key];
values.href = inputUrl;
values.pathname = inputUrl.replace(/[?#].*/, '');
values.origin = values.protocol = '';
values.toString = values.toJSON = (..._args)=>inputUrl;
for(const key in values)Object.defineProperty(this, key, {
enumerable: true,
configurable: true,
value: values[key]
});
};
relativeURL.prototype = URL.prototype;
contextPrototype.U = relativeURL;
/**
* Utility function to ensure all variants of an enum are handled.
*/ function invariant(never, computeMessage) {
throw new Error(`Invariant: ${computeMessage(never)}`);
}
/**
* Constructs an error message for when a module factory is not available.
*/ function factoryNotAvailableMessage(moduleId, sourceType, sourceData) {
let instantiationReason;
switch(sourceType){
case 0:
instantiationReason = `as a runtime entry of chunk ${sourceData}`;
break;
case 1:
instantiationReason = `because it was required from module ${sourceData}`;
break;
case 2:
instantiationReason = 'because of an HMR update';
break;
default:
invariant(sourceType, (sourceType)=>`Unknown source type: ${sourceType}`);
}
return `Module ${moduleId} was instantiated ${instantiationReason}, but the module factory is not available.`;
}
/**
* A stub function to make `require` available but non-functional in ESM.
*/ function requireStub(_moduleId) {
throw new Error('dynamic usage of require is not supported');
}
contextPrototype.z = requireStub;
// Make `globalThis` available to the module in a way that cannot be shadowed by a local variable.
contextPrototype.g = globalThis;
function applyModuleFactoryName(factory) {
// Give the module factory a nice name to improve stack traces.
Object.defineProperty(factory, 'name', {
value: 'module evaluation'
});
}
/// <reference path="../shared/runtime/runtime-utils.ts" />
/// A 'base' utilities to support runtime can have externals.
/// Currently this is for node.js / edge runtime both.
/// If a fn requires node.js specific behavior, it should be placed in `node-external-utils` instead.
async function externalImport(id) {
let raw;
try {
raw = await import(id);
} catch (err) {
// TODO(alexkirsz) This can happen when a client-side module tries to load
// an external module we don't provide a shim for (e.g. querystring, url).
// For now, we fail semi-silently, but in the future this should be a
// compilation error.
throw new Error(`Failed to load external module ${id}: ${err}`);
}
if (raw && raw.__esModule && raw.default && 'default' in raw.default) {
return interopEsm(raw.default, createNS(raw), true);
}
return raw;
}
contextPrototype.y = externalImport;
function externalRequire(id, thunk, esm = false) {
let raw;
try {
raw = thunk();
} catch (err) {
// TODO(alexkirsz) This can happen when a client-side module tries to load
// an external module we don't provide a shim for (e.g. querystring, url).
// For now, we fail semi-silently, but in the future this should be a
// compilation error.
throw new Error(`Failed to load external module ${id}: ${err}`);
}
if (!esm || raw.__esModule) {
return raw;
}
return interopEsm(raw, createNS(raw), true);
}
externalRequire.resolve = (id, options)=>{
return require.resolve(id, options);
};
contextPrototype.x = externalRequire;
/* eslint-disable @typescript-eslint/no-unused-vars */ const path = require('path');
const relativePathToRuntimeRoot = path.relative(RUNTIME_PUBLIC_PATH, '.');
// Compute the relative path to the `distDir`.
const relativePathToDistRoot = path.join(relativePathToRuntimeRoot, RELATIVE_ROOT_PATH);
const RUNTIME_ROOT = path.resolve(__filename, relativePathToRuntimeRoot);
// Compute the absolute path to the root, by stripping distDir from the absolute path to this file.
const ABSOLUTE_ROOT = path.resolve(__filename, relativePathToDistRoot);
/**
* Returns an absolute path to the given module path.
* Module path should be relative, either path to a file or a directory.
*
* This fn allows to calculate an absolute path for some global static values, such as
* `__dirname` or `import.meta.url` that Turbopack will not embeds in compile time.
* See ImportMetaBinding::code_generation for the usage.
*/ function resolveAbsolutePath(modulePath) {
if (modulePath) {
return path.join(ABSOLUTE_ROOT, modulePath);
}
return ABSOLUTE_ROOT;
}
Context.prototype.P = resolveAbsolutePath;
/* eslint-disable @typescript-eslint/no-unused-vars */ /// <reference path="../shared/runtime/runtime-utils.ts" />
function readWebAssemblyAsResponse(path) {
const { createReadStream } = require('fs');
const { Readable } = require('stream');
const stream = createReadStream(path);
// @ts-ignore unfortunately there's a slight type mismatch with the stream.
return new Response(Readable.toWeb(stream), {
headers: {
'content-type': 'application/wasm'
}
});
}
async function compileWebAssemblyFromPath(path) {
const response = readWebAssemblyAsResponse(path);
return await WebAssembly.compileStreaming(response);
}
async function instantiateWebAssemblyFromPath(path, importsObj) {
const response = readWebAssemblyAsResponse(path);
const { instance } = await WebAssembly.instantiateStreaming(response, importsObj);
return instance.exports;
}
/* eslint-disable @typescript-eslint/no-unused-vars */ /// <reference path="../../shared/runtime/runtime-utils.ts" />
/// <reference path="../../shared-node/base-externals-utils.ts" />
/// <reference path="../../shared-node/node-externals-utils.ts" />
/// <reference path="../../shared-node/node-wasm-utils.ts" />
/// <reference path="./nodejs-globals.d.ts" />
/**
* Base Node.js runtime shared between production and development.
* Contains chunk loading, module caching, and other non-HMR functionality.
*/ process.env.TURBOPACK = '1';
const url = require('url');
const moduleFactories = new Map();
const moduleCache = Object.create(null);
/**
* Returns an absolute path to the given module's id.
*/ function resolvePathFromModule(moduleId) {
const exported = this.r(moduleId);
const exportedPath = exported?.default ?? exported;
if (typeof exportedPath !== 'string') {
return exported;
}
const strippedAssetPrefix = exportedPath.slice(ASSET_PREFIX.length);
const resolved = path.resolve(RUNTIME_ROOT, strippedAssetPrefix);
return url.pathToFileURL(resolved).href;
}
/**
* Exports a URL value. No suffix is added in Node.js runtime.
*/ function exportUrl(urlValue, id) {
exportValue.call(this, urlValue, id);
}
function loadRuntimeChunk(sourcePath, chunkData) {
if (typeof chunkData === 'string') {
loadRuntimeChunkPath(sourcePath, chunkData);
} else {
loadRuntimeChunkPath(sourcePath, chunkData.path);
}
}
const loadedChunks = new Set();
const unsupportedLoadChunk = Promise.resolve(undefined);
const loadedChunk = Promise.resolve(undefined);
const chunkCache = new Map();
function clearChunkCache() {
chunkCache.clear();
loadedChunks.clear();
}
function loadRuntimeChunkPath(sourcePath, chunkPath) {
if (!isJs(chunkPath)) {
// We only support loading JS chunks in Node.js.
// This branch can be hit when trying to load a CSS chunk.
return;
}
if (loadedChunks.has(chunkPath)) {
return;
}
try {
const resolved = path.resolve(RUNTIME_ROOT, chunkPath);
const chunkModules = require(resolved);
installCompressedModuleFactories(chunkModules, 0, moduleFactories);
loadedChunks.add(chunkPath);
} catch (cause) {
let errorMessage = `Failed to load chunk ${chunkPath}`;
if (sourcePath) {
errorMessage += ` from runtime for chunk ${sourcePath}`;
}
const error = new Error(errorMessage, {
cause
});
error.name = 'ChunkLoadError';
throw error;
}
}
function loadChunkAsync(chunkData) {
const chunkPath = typeof chunkData === 'string' ? chunkData : chunkData.path;
if (!isJs(chunkPath)) {
// We only support loading JS chunks in Node.js.
// This branch can be hit when trying to load a CSS chunk.
return unsupportedLoadChunk;
}
let entry = chunkCache.get(chunkPath);
if (entry === undefined) {
try {
// resolve to an absolute path to simplify `require` handling
const resolved = path.resolve(RUNTIME_ROOT, chunkPath);
// TODO: consider switching to `import()` to enable concurrent chunk loading and async file io
// However this is incompatible with hot reloading (since `import` doesn't use the require cache)
const chunkModules = require(resolved);
installCompressedModuleFactories(chunkModules, 0, moduleFactories);
entry = loadedChunk;
} catch (cause) {
const errorMessage = `Failed to load chunk ${chunkPath} from module ${this.m.id}`;
const error = new Error(errorMessage, {
cause
});
error.name = 'ChunkLoadError';
// Cache the failure promise, future requests will also get this same rejection
entry = Promise.reject(error);
}
chunkCache.set(chunkPath, entry);
}
// TODO: Return an instrumented Promise that React can use instead of relying on referential equality.
return entry;
}
contextPrototype.l = loadChunkAsync;
function loadChunkAsyncByUrl(chunkUrl) {
const path1 = url.fileURLToPath(new URL(chunkUrl, RUNTIME_ROOT));
return loadChunkAsync.call(this, path1);
}
contextPrototype.L = loadChunkAsyncByUrl;
function loadWebAssembly(chunkPath, _edgeModule, imports) {
const resolved = path.resolve(RUNTIME_ROOT, chunkPath);
return instantiateWebAssemblyFromPath(resolved, imports);
}
contextPrototype.w = loadWebAssembly;
function loadWebAssemblyModule(chunkPath, _edgeModule) {
const resolved = path.resolve(RUNTIME_ROOT, chunkPath);
return compileWebAssemblyFromPath(resolved);
}
contextPrototype.u = loadWebAssemblyModule;
/**
* Creates a Node.js worker thread by instantiating the given WorkerConstructor
* with the appropriate path and options, including forwarded globals.
*
* @param WorkerConstructor The Worker constructor from worker_threads
* @param workerPath Path to the worker entry chunk
* @param workerOptions options to pass to the Worker constructor (optional)
*/ function createWorker(WorkerConstructor, workerPath, workerOptions) {
// Build the forwarded globals object
const forwardedGlobals = {};
for (const name of WORKER_FORWARDED_GLOBALS){
forwardedGlobals[name] = globalThis[name];
}
// Merge workerData with forwarded globals
const existingWorkerData = workerOptions?.workerData || {};
const options = {
...workerOptions,
workerData: {
...typeof existingWorkerData === 'object' ? existingWorkerData : {},
__turbopack_globals__: forwardedGlobals
}
};
return new WorkerConstructor(workerPath, options);
}
const regexJsUrl = /\.js(?:\?[^#]*)?(?:#.*)?$/;
/**
* Checks if a given path/URL ends with .js, optionally followed by ?query or #fragment.
*/ function isJs(chunkUrlOrPath) {
return regexJsUrl.test(chunkUrlOrPath);
}
/* eslint-disable @typescript-eslint/no-unused-vars */ /// <reference path="./runtime-base.ts" />
/**
* Production Node.js runtime.
* Uses ModuleWithDirection and simple module instantiation without HMR support.
*/ // moduleCache and moduleFactories are declared in runtime-base.ts
// this is read in runtime-utils.ts so it creates a module with direction for hmr
createModuleWithDirectionFlag = true;
const nodeContextPrototype = Context.prototype;
nodeContextPrototype.q = exportUrl;
nodeContextPrototype.M = moduleFactories;
// Cast moduleCache to ModuleWithDirection for production mode
nodeContextPrototype.c = moduleCache;
nodeContextPrototype.R = resolvePathFromModule;
nodeContextPrototype.b = createWorker;
nodeContextPrototype.C = clearChunkCache;
function instantiateModule(id, sourceType, sourceData) {
const moduleFactory = moduleFactories.get(id);
if (typeof moduleFactory !== 'function') {
// This can happen if modules incorrectly handle HMR disposes/updates,
// e.g. when they keep a `setTimeout` around which still executes old code
// and contains e.g. a `require("something")` call.
throw new Error(factoryNotAvailableMessage(id, sourceType, sourceData));
}
const module1 = createModuleWithDirection(id);
const exports = module1.exports;
moduleCache[id] = module1;
const context = new Context(module1, exports);
// NOTE(alexkirsz) This can fail when the module encounters a runtime error.
try {
moduleFactory(context, module1, exports);
} catch (error) {
module1.error = error;
throw error;
}
;
module1.loaded = true;
if (module1.namespaceObject && module1.exports !== module1.namespaceObject) {
// in case of a circular dependency: cjs1 -> esm2 -> cjs1
interopEsm(module1.exports, module1.namespaceObject);
}
return module1;
}
/**
* Retrieves a module from the cache, or instantiate it if it is not cached.
*/ // @ts-ignore
function getOrInstantiateModuleFromParent(id, sourceModule) {
const module1 = moduleCache[id];
if (module1) {
if (module1.error) {
throw module1.error;
}
return module1;
}
return instantiateModule(id, SourceType.Parent, sourceModule.id);
}
/**
* Instantiates a runtime module.
*/ function instantiateRuntimeModule(chunkPath, moduleId) {
return instantiateModule(moduleId, SourceType.Runtime, chunkPath);
}
/**
* Retrieves a module from the cache, or instantiate it as a runtime module if it is not cached.
*/ // @ts-ignore TypeScript doesn't separate this module space from the browser runtime
function getOrInstantiateRuntimeModule(chunkPath, moduleId) {
const module1 = moduleCache[moduleId];
if (module1) {
if (module1.error) {
throw module1.error;
}
return module1;
}
return instantiateRuntimeModule(chunkPath, moduleId);
}
module.exports = (sourcePath)=>({
m: (id)=>getOrInstantiateRuntimeModule(sourcePath, id),
c: (chunkData)=>loadRuntimeChunk(sourcePath, chunkData)
});
//# sourceMappingURL=%5Bturbopack%5D_runtime.js.map

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
{"type": "commonjs"}

View File

@@ -0,0 +1,6 @@
var R=require("./chunks/[turbopack]_runtime.js")("postcss.js")
R.c("chunks/[turbopack-node]_transforms_postcss_ts_06e.r3r._.js")
R.c("chunks/[root-of-the-server]__0ubbtyl._.js")
R.m("[turbopack-node]/child_process/globals.ts [postcss] (ecmascript)")
R.m("[turbopack-node]/child_process/evaluate.ts/evaluate.js { INNER => \"[turbopack-node]/transforms/postcss.ts { CONFIG => \\\"[project]/postcss.config.mjs [postcss] (ecmascript)\\\" } [postcss] (ecmascript)\", RUNTIME => \"[turbopack-node]/child_process/evaluate.ts [postcss] (ecmascript)\" } [postcss] (ecmascript)")
module.exports=R.m("[turbopack-node]/child_process/evaluate.ts/evaluate.js { INNER => \"[turbopack-node]/transforms/postcss.ts { CONFIG => \\\"[project]/postcss.config.mjs [postcss] (ecmascript)\\\" } [postcss] (ecmascript)\", RUNTIME => \"[turbopack-node]/child_process/evaluate.ts [postcss] (ecmascript)\" } [postcss] (ecmascript)").exports

View File

@@ -0,0 +1,5 @@
{
"version": 3,
"sources": [],
"sections": []
}

1
build_temp/.next/cache/.previewinfo vendored Normal file
View File

@@ -0,0 +1 @@
{"previewModeId":"448d32298db3b0c38793886a3692c8c2","previewModeSigningKey":"c5cb172f94d84767588967a86044c9ee49921a9b2179519d52aa8aceecb0cd6f","previewModeEncryptionKey":"8a7d538464b6beea4e3323e6d9d86f4b70ecb99e19daffca604a9088baa07476","expireAt":1783363527187}

1
build_temp/.next/cache/.rscinfo vendored Normal file
View File

@@ -0,0 +1 @@
{"encryption.key":"3aeRfwg0+P9P6WojBQxvxnXB2/RQU+/5AuKoO1YfFV8=","encryption.expire_at":1783363527167}

1
build_temp/.next/cache/.tsbuildinfo vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,6 @@
{
"buildStage": "static-generation",
"buildOptions": {
"useBuildWorker": "true"
}
}

View File

@@ -0,0 +1 @@
{"name":"Next.js","version":"16.2.4"}

View File

@@ -0,0 +1,357 @@
[
{
"route": "/protected",
"firstLoadUncompressedJsBytes": 887453,
"firstLoadChunkPaths": [
".next\\static\\chunks\\0usmzazea5o36.js",
".next\\static\\chunks\\0d3shmwh5_nmn.js",
".next\\static\\chunks\\012i7eyh17tl3.js",
".next\\static\\chunks\\0k5-k~sbs-wg6.js",
".next\\static\\chunks\\0qesjmrn7~1dz.js",
".next\\static\\chunks\\01_lw6dc6ltc-.js",
".next\\static\\chunks\\0l-wk1ive8m.1.js",
".next\\static\\chunks\\00gju7l2y3vh_.js",
".next\\static\\chunks\\0ze4gu236oq96.js",
".next\\static\\chunks\\10qd__0r7a~.l.js",
".next\\static\\chunks\\0-gaanm6h49z~.js",
".next\\static\\chunks\\06c8h6921f-oo.js",
".next\\static\\chunks\\15jasrm2107sy.js",
".next\\static\\chunks\\181uojwh.t2ik.js",
".next\\static\\chunks\\turbopack-0u.mb44r17v0_.js"
]
},
{
"route": "/admin/products",
"firstLoadUncompressedJsBytes": 815153,
"firstLoadChunkPaths": [
".next\\static\\chunks\\0usmzazea5o36.js",
".next\\static\\chunks\\0d3shmwh5_nmn.js",
".next\\static\\chunks\\0ka051yepewro.js",
".next\\static\\chunks\\0_psz~izxr78o.js",
".next\\static\\chunks\\01_lw6dc6ltc-.js",
".next\\static\\chunks\\0qj.s.uyzj2u6.js",
".next\\static\\chunks\\1535xxoug.k9i.js",
".next\\static\\chunks\\0k5-k~sbs-wg6.js",
".next\\static\\chunks\\0h2rh5ewa6gmd.js",
".next\\static\\chunks\\0ze4gu236oq96.js",
".next\\static\\chunks\\10qd__0r7a~.l.js",
".next\\static\\chunks\\0-gaanm6h49z~.js",
".next\\static\\chunks\\06c8h6921f-oo.js",
".next\\static\\chunks\\15jasrm2107sy.js",
".next\\static\\chunks\\181uojwh.t2ik.js",
".next\\static\\chunks\\turbopack-0u.mb44r17v0_.js"
]
},
{
"route": "/admin/categories",
"firstLoadUncompressedJsBytes": 810555,
"firstLoadChunkPaths": [
".next\\static\\chunks\\0usmzazea5o36.js",
".next\\static\\chunks\\0d3shmwh5_nmn.js",
".next\\static\\chunks\\0ka051yepewro.js",
".next\\static\\chunks\\0_psz~izxr78o.js",
".next\\static\\chunks\\01_lw6dc6ltc-.js",
".next\\static\\chunks\\0~pn4~wuwvr32.js",
".next\\static\\chunks\\0f7q1cdbakqnj.js",
".next\\static\\chunks\\0k5-k~sbs-wg6.js",
".next\\static\\chunks\\0h2rh5ewa6gmd.js",
".next\\static\\chunks\\0ze4gu236oq96.js",
".next\\static\\chunks\\10qd__0r7a~.l.js",
".next\\static\\chunks\\0-gaanm6h49z~.js",
".next\\static\\chunks\\06c8h6921f-oo.js",
".next\\static\\chunks\\15jasrm2107sy.js",
".next\\static\\chunks\\181uojwh.t2ik.js",
".next\\static\\chunks\\turbopack-0u.mb44r17v0_.js"
]
},
{
"route": "/auth/sign-up",
"firstLoadUncompressedJsBytes": 798825,
"firstLoadChunkPaths": [
".next\\static\\chunks\\0usmzazea5o36.js",
".next\\static\\chunks\\0d3shmwh5_nmn.js",
".next\\static\\chunks\\0.y2lp02b2t7q.js",
".next\\static\\chunks\\0qesjmrn7~1dz.js",
".next\\static\\chunks\\0k5-k~sbs-wg6.js",
".next\\static\\chunks\\0ze4gu236oq96.js",
".next\\static\\chunks\\10qd__0r7a~.l.js",
".next\\static\\chunks\\0-gaanm6h49z~.js",
".next\\static\\chunks\\06c8h6921f-oo.js",
".next\\static\\chunks\\15jasrm2107sy.js",
".next\\static\\chunks\\181uojwh.t2ik.js",
".next\\static\\chunks\\turbopack-0u.mb44r17v0_.js"
]
},
{
"route": "/auth/login",
"firstLoadUncompressedJsBytes": 798571,
"firstLoadChunkPaths": [
".next\\static\\chunks\\0usmzazea5o36.js",
".next\\static\\chunks\\0d3shmwh5_nmn.js",
".next\\static\\chunks\\020p4x66yuy~n.js",
".next\\static\\chunks\\0qesjmrn7~1dz.js",
".next\\static\\chunks\\0k5-k~sbs-wg6.js",
".next\\static\\chunks\\0ze4gu236oq96.js",
".next\\static\\chunks\\10qd__0r7a~.l.js",
".next\\static\\chunks\\0-gaanm6h49z~.js",
".next\\static\\chunks\\06c8h6921f-oo.js",
".next\\static\\chunks\\15jasrm2107sy.js",
".next\\static\\chunks\\181uojwh.t2ik.js",
".next\\static\\chunks\\turbopack-0u.mb44r17v0_.js"
]
},
{
"route": "/auth/forgot-password",
"firstLoadUncompressedJsBytes": 798560,
"firstLoadChunkPaths": [
".next\\static\\chunks\\0usmzazea5o36.js",
".next\\static\\chunks\\0d3shmwh5_nmn.js",
".next\\static\\chunks\\0hn13p7jlg6c8.js",
".next\\static\\chunks\\0qesjmrn7~1dz.js",
".next\\static\\chunks\\0k5-k~sbs-wg6.js",
".next\\static\\chunks\\0ze4gu236oq96.js",
".next\\static\\chunks\\10qd__0r7a~.l.js",
".next\\static\\chunks\\0-gaanm6h49z~.js",
".next\\static\\chunks\\06c8h6921f-oo.js",
".next\\static\\chunks\\15jasrm2107sy.js",
".next\\static\\chunks\\181uojwh.t2ik.js",
".next\\static\\chunks\\turbopack-0u.mb44r17v0_.js"
]
},
{
"route": "/auth/update-password",
"firstLoadUncompressedJsBytes": 792198,
"firstLoadChunkPaths": [
".next\\static\\chunks\\0usmzazea5o36.js",
".next\\static\\chunks\\0d3shmwh5_nmn.js",
".next\\static\\chunks\\07b46tf_nu-sm.js",
".next\\static\\chunks\\0qesjmrn7~1dz.js",
".next\\static\\chunks\\0k5-k~sbs-wg6.js",
".next\\static\\chunks\\0ze4gu236oq96.js",
".next\\static\\chunks\\10qd__0r7a~.l.js",
".next\\static\\chunks\\0-gaanm6h49z~.js",
".next\\static\\chunks\\06c8h6921f-oo.js",
".next\\static\\chunks\\15jasrm2107sy.js",
".next\\static\\chunks\\181uojwh.t2ik.js",
".next\\static\\chunks\\turbopack-0u.mb44r17v0_.js"
]
},
{
"route": "/admin/users",
"firstLoadUncompressedJsBytes": 732184,
"firstLoadChunkPaths": [
".next\\static\\chunks\\0usmzazea5o36.js",
".next\\static\\chunks\\0d3shmwh5_nmn.js",
".next\\static\\chunks\\0ka051yepewro.js",
".next\\static\\chunks\\0d83uz0cb9cr0.js",
".next\\static\\chunks\\0k5-k~sbs-wg6.js",
".next\\static\\chunks\\09ftf-8ix1ad~.js",
".next\\static\\chunks\\0h2rh5ewa6gmd.js",
".next\\static\\chunks\\0ze4gu236oq96.js",
".next\\static\\chunks\\10qd__0r7a~.l.js",
".next\\static\\chunks\\0-gaanm6h49z~.js",
".next\\static\\chunks\\06c8h6921f-oo.js",
".next\\static\\chunks\\15jasrm2107sy.js",
".next\\static\\chunks\\181uojwh.t2ik.js",
".next\\static\\chunks\\turbopack-0u.mb44r17v0_.js"
]
},
{
"route": "/order",
"firstLoadUncompressedJsBytes": 726412,
"firstLoadChunkPaths": [
".next\\static\\chunks\\0usmzazea5o36.js",
".next\\static\\chunks\\0d3shmwh5_nmn.js",
".next\\static\\chunks\\0k5-k~sbs-wg6.js",
".next\\static\\chunks\\083objkg2e851.js",
".next\\static\\chunks\\0ulw1svcbtk8z.js",
".next\\static\\chunks\\0ze4gu236oq96.js",
".next\\static\\chunks\\10qd__0r7a~.l.js",
".next\\static\\chunks\\0-gaanm6h49z~.js",
".next\\static\\chunks\\06c8h6921f-oo.js",
".next\\static\\chunks\\15jasrm2107sy.js",
".next\\static\\chunks\\181uojwh.t2ik.js",
".next\\static\\chunks\\turbopack-0u.mb44r17v0_.js"
]
},
{
"route": "/my-customers/[id]",
"firstLoadUncompressedJsBytes": 569382,
"firstLoadChunkPaths": [
".next\\static\\chunks\\0usmzazea5o36.js",
".next\\static\\chunks\\0d3shmwh5_nmn.js",
".next\\static\\chunks\\0d068foshfwl7.js",
".next\\static\\chunks\\0k5-k~sbs-wg6.js",
".next\\static\\chunks\\0ze4gu236oq96.js",
".next\\static\\chunks\\10qd__0r7a~.l.js",
".next\\static\\chunks\\0-gaanm6h49z~.js",
".next\\static\\chunks\\06c8h6921f-oo.js",
".next\\static\\chunks\\15jasrm2107sy.js",
".next\\static\\chunks\\181uojwh.t2ik.js",
".next\\static\\chunks\\turbopack-0u.mb44r17v0_.js"
]
},
{
"route": "/my-customers/new",
"firstLoadUncompressedJsBytes": 564226,
"firstLoadChunkPaths": [
".next\\static\\chunks\\0usmzazea5o36.js",
".next\\static\\chunks\\0d3shmwh5_nmn.js",
".next\\static\\chunks\\00-xpv69x~78w.js",
".next\\static\\chunks\\0k5-k~sbs-wg6.js",
".next\\static\\chunks\\0ze4gu236oq96.js",
".next\\static\\chunks\\10qd__0r7a~.l.js",
".next\\static\\chunks\\0-gaanm6h49z~.js",
".next\\static\\chunks\\06c8h6921f-oo.js",
".next\\static\\chunks\\15jasrm2107sy.js",
".next\\static\\chunks\\181uojwh.t2ik.js",
".next\\static\\chunks\\turbopack-0u.mb44r17v0_.js"
]
},
{
"route": "/admin",
"firstLoadUncompressedJsBytes": 555746,
"firstLoadChunkPaths": [
".next\\static\\chunks\\0usmzazea5o36.js",
".next\\static\\chunks\\0d3shmwh5_nmn.js",
".next\\static\\chunks\\0ka051yepewro.js",
".next\\static\\chunks\\091cxb_8k6p~y.js",
".next\\static\\chunks\\0k5-k~sbs-wg6.js",
".next\\static\\chunks\\0ze4gu236oq96.js",
".next\\static\\chunks\\10qd__0r7a~.l.js",
".next\\static\\chunks\\0-gaanm6h49z~.js",
".next\\static\\chunks\\06c8h6921f-oo.js",
".next\\static\\chunks\\15jasrm2107sy.js",
".next\\static\\chunks\\181uojwh.t2ik.js",
".next\\static\\chunks\\turbopack-0u.mb44r17v0_.js"
]
},
{
"route": "/order/success",
"firstLoadUncompressedJsBytes": 552889,
"firstLoadChunkPaths": [
".next\\static\\chunks\\0usmzazea5o36.js",
".next\\static\\chunks\\0d3shmwh5_nmn.js",
".next\\static\\chunks\\10n544c5bwzh9.js",
".next\\static\\chunks\\0k5-k~sbs-wg6.js",
".next\\static\\chunks\\0ze4gu236oq96.js",
".next\\static\\chunks\\10qd__0r7a~.l.js",
".next\\static\\chunks\\0-gaanm6h49z~.js",
".next\\static\\chunks\\06c8h6921f-oo.js",
".next\\static\\chunks\\15jasrm2107sy.js",
".next\\static\\chunks\\181uojwh.t2ik.js",
".next\\static\\chunks\\turbopack-0u.mb44r17v0_.js"
]
},
{
"route": "/admin/orders",
"firstLoadUncompressedJsBytes": 551609,
"firstLoadChunkPaths": [
".next\\static\\chunks\\0usmzazea5o36.js",
".next\\static\\chunks\\0d3shmwh5_nmn.js",
".next\\static\\chunks\\0ka051yepewro.js",
".next\\static\\chunks\\0vebka-_nqjml.js",
".next\\static\\chunks\\0k5-k~sbs-wg6.js",
".next\\static\\chunks\\0ze4gu236oq96.js",
".next\\static\\chunks\\10qd__0r7a~.l.js",
".next\\static\\chunks\\0-gaanm6h49z~.js",
".next\\static\\chunks\\06c8h6921f-oo.js",
".next\\static\\chunks\\15jasrm2107sy.js",
".next\\static\\chunks\\181uojwh.t2ik.js",
".next\\static\\chunks\\turbopack-0u.mb44r17v0_.js"
]
},
{
"route": "/",
"firstLoadUncompressedJsBytes": 523255,
"firstLoadChunkPaths": [
".next\\static\\chunks\\0usmzazea5o36.js",
".next\\static\\chunks\\0d3shmwh5_nmn.js",
".next\\static\\chunks\\0ka051yepewro.js",
".next\\static\\chunks\\0ze4gu236oq96.js",
".next\\static\\chunks\\10qd__0r7a~.l.js",
".next\\static\\chunks\\0-gaanm6h49z~.js",
".next\\static\\chunks\\06c8h6921f-oo.js",
".next\\static\\chunks\\15jasrm2107sy.js",
".next\\static\\chunks\\181uojwh.t2ik.js",
".next\\static\\chunks\\turbopack-0u.mb44r17v0_.js"
]
},
{
"route": "/my-customers",
"firstLoadUncompressedJsBytes": 523255,
"firstLoadChunkPaths": [
".next\\static\\chunks\\0usmzazea5o36.js",
".next\\static\\chunks\\0d3shmwh5_nmn.js",
".next\\static\\chunks\\0ka051yepewro.js",
".next\\static\\chunks\\0ze4gu236oq96.js",
".next\\static\\chunks\\10qd__0r7a~.l.js",
".next\\static\\chunks\\0-gaanm6h49z~.js",
".next\\static\\chunks\\06c8h6921f-oo.js",
".next\\static\\chunks\\15jasrm2107sy.js",
".next\\static\\chunks\\181uojwh.t2ik.js",
".next\\static\\chunks\\turbopack-0u.mb44r17v0_.js"
]
},
{
"route": "/my-orders",
"firstLoadUncompressedJsBytes": 523255,
"firstLoadChunkPaths": [
".next\\static\\chunks\\0usmzazea5o36.js",
".next\\static\\chunks\\0d3shmwh5_nmn.js",
".next\\static\\chunks\\0ka051yepewro.js",
".next\\static\\chunks\\0ze4gu236oq96.js",
".next\\static\\chunks\\10qd__0r7a~.l.js",
".next\\static\\chunks\\0-gaanm6h49z~.js",
".next\\static\\chunks\\06c8h6921f-oo.js",
".next\\static\\chunks\\15jasrm2107sy.js",
".next\\static\\chunks\\181uojwh.t2ik.js",
".next\\static\\chunks\\turbopack-0u.mb44r17v0_.js"
]
},
{
"route": "/_not-found",
"firstLoadUncompressedJsBytes": 517427,
"firstLoadChunkPaths": [
".next\\static\\chunks\\0usmzazea5o36.js",
".next\\static\\chunks\\0d3shmwh5_nmn.js",
".next\\static\\chunks\\0ze4gu236oq96.js",
".next\\static\\chunks\\10qd__0r7a~.l.js",
".next\\static\\chunks\\0-gaanm6h49z~.js",
".next\\static\\chunks\\06c8h6921f-oo.js",
".next\\static\\chunks\\15jasrm2107sy.js",
".next\\static\\chunks\\181uojwh.t2ik.js",
".next\\static\\chunks\\turbopack-0u.mb44r17v0_.js"
]
},
{
"route": "/auth/error",
"firstLoadUncompressedJsBytes": 517427,
"firstLoadChunkPaths": [
".next\\static\\chunks\\0usmzazea5o36.js",
".next\\static\\chunks\\0d3shmwh5_nmn.js",
".next\\static\\chunks\\0ze4gu236oq96.js",
".next\\static\\chunks\\10qd__0r7a~.l.js",
".next\\static\\chunks\\0-gaanm6h49z~.js",
".next\\static\\chunks\\06c8h6921f-oo.js",
".next\\static\\chunks\\15jasrm2107sy.js",
".next\\static\\chunks\\181uojwh.t2ik.js",
".next\\static\\chunks\\turbopack-0u.mb44r17v0_.js"
]
},
{
"route": "/auth/sign-up-success",
"firstLoadUncompressedJsBytes": 517427,
"firstLoadChunkPaths": [
".next\\static\\chunks\\0usmzazea5o36.js",
".next\\static\\chunks\\0d3shmwh5_nmn.js",
".next\\static\\chunks\\0ze4gu236oq96.js",
".next\\static\\chunks\\10qd__0r7a~.l.js",
".next\\static\\chunks\\0-gaanm6h49z~.js",
".next\\static\\chunks\\06c8h6921f-oo.js",
".next\\static\\chunks\\15jasrm2107sy.js",
".next\\static\\chunks\\181uojwh.t2ik.js",
".next\\static\\chunks\\turbopack-0u.mb44r17v0_.js"
]
}
]

View File

@@ -0,0 +1,6 @@
{
"version": 1,
"hasExportPathMap": false,
"exportTrailingSlash": false,
"isNextImageImported": false
}

View File

@@ -0,0 +1,13 @@
{
"pages": {
"/_app": []
},
"devFiles": [],
"polyfillFiles": [],
"lowPriorityFiles": [
"static/czEjVggXDRFH51IopN6_9/_buildManifest.js",
"static/czEjVggXDRFH51IopN6_9/_ssgManifest.js",
"static/czEjVggXDRFH51IopN6_9/_clientMiddlewareManifest.js"
],
"rootMainFiles": []
}

View File

@@ -0,0 +1,68 @@
{
"version": 1,
"images": {
"deviceSizes": [
640,
750,
828,
1080,
1200,
1920,
2048,
3840
],
"imageSizes": [
32,
48,
64,
96,
128,
256,
384
],
"path": "/_next/image",
"loader": "default",
"loaderFile": "",
"domains": [],
"disableStaticImages": false,
"minimumCacheTTL": 14400,
"formats": [
"image/webp"
],
"maximumRedirects": 3,
"maximumResponseBody": 50000000,
"dangerouslyAllowLocalIP": false,
"dangerouslyAllowSVG": false,
"contentSecurityPolicy": "script-src 'none'; frame-src 'none'; sandbox;",
"contentDispositionType": "attachment",
"localPatterns": [
{
"pathname": "^(?:(?!(?:^|\\/)\\.{1,2}(?:\\/|$))(?:(?:(?!(?:^|\\/)\\.{1,2}(?:\\/|$)).)*?)\\/?)$",
"search": ""
}
],
"remotePatterns": [],
"qualities": [
75
],
"unoptimized": false,
"customCacheHandler": false,
"sizes": [
640,
750,
828,
1080,
1200,
1920,
2048,
3840,
32,
48,
64,
96,
128,
256,
384
]
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,112 @@
<p align="center">
<img src="https://user-images.githubusercontent.com/5600341/27505816-c8bc37aa-587f-11e7-9a86-08a2d081a8b9.png" height="280px">
<p align="center">React renderer for creating PDF files on the browser and server<p>
<p align="center">
<a href="https://www.npmjs.com/package/@react-pdf/renderer">
<img src="https://img.shields.io/npm/v/@react-pdf/renderer?style=flat&colorA=000000&colorB=000000" />
</a>
<a href="https://opencollective.com/react-pdf">
<img src="https://img.shields.io/opencollective/all/react-pdf?style=flat&colorA=000000&colorB=000000" />
</a>
<a href="https://github.com/diegomura/react-pdf/blob/master/LICENSE">
<img src="https://img.shields.io/github/license/diegomura/react-pdf?style=flat&colorA=000000&colorB=000000" />
</a>
<a href="https://blockchain.com/btc/address/bc1qj223udztpmt5dck46dw0yap08yum63ht56h90v">
<img src="https://img.shields.io/badge/BTC-f5f5f5?style=flat&colorA=000000&colorB=000000" />
</a>
<a href="https://blockchain.com/eth/address/0x4e1DB76bA0858BbCAa4DD804418D0D9EcF77B1cC">
<img src="https://img.shields.io/badge/ETH-f5f5f5?style=flat&colorA=000000&colorB=000000" />
</a>
</p>
</p>
## How to install
```sh
yarn add @react-pdf/renderer
```
## How it works
```jsx
import React from 'react';
import { Document, Page, Text, View, StyleSheet } from '@react-pdf/renderer';
// Create styles
const styles = StyleSheet.create({
page: {
flexDirection: 'row',
backgroundColor: '#E4E4E4',
},
section: {
margin: 10,
padding: 10,
flexGrow: 1,
},
});
// Create Document Component
const MyDocument = () => (
<Document>
<Page size="A4" style={styles.page}>
<View style={styles.section}>
<Text>Section #1</Text>
</View>
<View style={styles.section}>
<Text>Section #2</Text>
</View>
</Page>
</Document>
);
```
### `Web.` Render in DOM
```jsx
import React from 'react';
import ReactDOM from 'react-dom';
import { PDFViewer } from '@react-pdf/renderer';
const App = () => (
<PDFViewer>
<MyDocument />
</PDFViewer>
);
ReactDOM.render(<App />, document.getElementById('root'));
```
### `Node.` Save in a file
```jsx
import React from 'react';
import ReactPDF from '@react-pdf/renderer';
ReactPDF.render(<MyDocument />, `${__dirname}/example.pdf`);
```
## Contributors
This project exists thanks to all the people who contribute. Looking to contribute? Please check our [[contribute]](https://github.com/diegomura/react-pdf/blob/master/.github/CONTRIBUTING.md) document for more details about how to setup a development environment and submitting code.
<a href="https://github.com/diegomura/react-pdf/blob/master/.github/CONTRIBUTING.md"><img src="https://opencollective.com/react-pdf/contributors.svg?width=890" /></a>
## Sponsors
Thank you to all our sponsors! [[Become a sponsors](https://opencollective.com/react-pdf#sponsors)]
<a href="https://opencollective.com/react-pdf#sponsors" target="_blank"><img src="https://opencollective.com/react-pdf/sponsors.svg?width=890"></a>
## Backers
Thank you to all our backers! [[Become a backer](https://opencollective.com/react-pdf#backer)]
<a href="https://opencollective.com/react-pdf#backers" target="_blank"><img src="https://opencollective.com/react-pdf/backers.svg?width=890"></a>
## License
MIT © [Diego Muracciole](http://github.com/diegomura)
---
[![](https://img.shields.io/npm/dt/@react-pdf/renderer.svg?style=flat)](https://www.npmjs.com/package/@react-pdf/renderer)

View File

@@ -0,0 +1,793 @@
/* eslint-disable max-classes-per-file */
import * as React from 'react';
import {
Style,
PageSize,
FontStore,
PDFVersion,
Orientation,
SourceObject,
SrcSet,
Sizes,
HyphenationCallback,
SVGPresentationAttributes,
Bookmark,
PageLayout,
PageMode,
HitSlop,
} from '@react-pdf/types';
declare class ReactPDF {
static default: typeof ReactPDF;
}
export = ReactPDF;
declare namespace ReactPDF {
interface Styles {
[key: string]: Style;
}
interface OnRenderProps {
blob?: Blob;
}
interface Permissions {
printing?: 'lowResolution' | 'highResolution';
modifying?: boolean;
copying?: boolean;
annotating?: boolean;
fillingForms?: boolean;
contentAccessibility?: boolean;
documentAssembly?: boolean;
}
interface DocumentProps {
style?: Style | Style[];
title?: string;
author?: string;
subject?: string;
creator?: string;
keywords?: string;
producer?: string;
language?: string;
creationDate?: Date;
modificationDate?: Date;
pdfVersion?: PDFVersion;
pageMode?: PageMode;
pageLayout?: PageLayout;
ownerPassword?: string;
userPassword?: string;
permissions?: Permissions;
onRender?: (props: OnRenderProps) => any;
}
/**
* This component represent the PDF document itself. It must be the root
* of your tree element structure, and under no circumstances should it be
* used as children of another react-pdf component. In addition, it should
* only have childs of type <Page />.
*/
export class Document extends React.Component<
React.PropsWithChildren<DocumentProps>
> {}
interface NodeProps {
id?: string;
style?: Style | Style[];
/**
* Render component in all wrapped pages.
* @see https://react-pdf.org/advanced#fixed-components
*/
fixed?: boolean;
/**
* Force the wrapping algorithm to start a new page when rendering the
* element.
* @see https://react-pdf.org/advanced#page-breaks
*/
break?: boolean;
/**
* Hint that no page wrapping should occur between all sibling elements following the element within n points
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
*/
minPresenceAhead?: number;
}
interface PageProps extends NodeProps {
/**
* Enable page wrapping for this page.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
size?: PageSize;
orientation?: Orientation;
dpi?: number;
bookmark?: Bookmark;
}
/**
* Represents single page inside the PDF document, or a subset of them if
* using the wrapping feature. A <Document /> can contain as many pages as
* you want, but ensure not rendering a page inside any component besides
* Document.
*/
export class Page extends React.Component<
React.PropsWithChildren<PageProps>
> {}
interface ViewProps extends NodeProps {
id?: string;
/**
* Enable/disable page wrapping for element.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
render?: (props: {
pageNumber: number;
subPageNumber: number;
}) => React.ReactNode;
}
/**
* The most fundamental component for building a UI and is designed to be
* nested inside other views and can have 0 to many children.
*/
export class View extends React.Component<
React.PropsWithChildren<ViewProps>
> {}
interface BaseImageProps extends NodeProps {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
cache?: boolean;
/**
* A comma-separated list of image sources with width descriptors.
* Works like the HTML img srcSet attribute.
* @example "small.jpg 300w, medium.jpg 600w, large.jpg 900w"
*/
srcSet?: SrcSet;
/**
* The intended display width of the image, used to select the best source
* from srcSet. Accepts a number (in points) or a string.
* Works like the HTML img sizes attribute.
* @example 300
* @example "300"
*/
sizes?: Sizes;
}
interface ImageWithSrcProp extends BaseImageProps {
src: SourceObject;
}
interface ImageWithSourceProp extends BaseImageProps {
source: SourceObject;
}
type ImageProps = ImageWithSrcProp | ImageWithSourceProp;
/**
* A React component for displaying network or local (Node only) JPG or
* PNG images, as well as base64 encoded image strings.
*/
export class Image extends React.Component<ImageProps> {}
interface BaseImageBackgroundProps extends NodeProps {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
cache?: boolean;
/**
* A comma-separated list of image sources with width descriptors.
* Works like the HTML img srcSet attribute.
* @example "small.jpg 300w, medium.jpg 600w, large.jpg 900w"
*/
srcSet?: SrcSet;
/**
* The intended display width of the image, used to select the best source
* from srcSet. Accepts a number (in points) or a string.
* @example 300
*/
sizes?: Sizes;
/**
* Style applied to the background image.
*/
imageStyle?: Style;
}
interface ImageBackgroundWithSrcProp extends BaseImageBackgroundProps {
src: SourceObject;
}
interface ImageBackgroundWithSourceProp extends BaseImageBackgroundProps {
source: SourceObject;
}
type ImageBackgroundProps =
| ImageBackgroundWithSrcProp
| ImageBackgroundWithSourceProp;
/**
* A React component for displaying an image behind child content.
* Compatible with React Native's ImageBackground component.
* @see https://reactnative.dev/docs/imagebackground
*/
export class ImageBackground extends React.Component<
React.PropsWithChildren<ImageBackgroundProps>
> {}
interface TextProps extends NodeProps {
id?: string;
/**
* Enable/disable page wrapping for element.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
render?: (props: {
pageNumber: number;
totalPages: number;
subPageNumber: number;
subPageTotalPages: number;
}) => React.ReactNode;
/**
* Override the default hyphenation-callback
* @see https://react-pdf.org/fonts#registerhyphenationcallback
*/
hyphenationCallback?: HyphenationCallback;
/**
* Specifies the minimum number of lines in a text element that must be shown at the bottom of a page or its container.
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
*/
orphans?: number;
/**
* Specifies the minimum number of lines in a text element that must be shown at the top of a page or its container..
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
*/
widows?: number;
}
interface SVGTextProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
x: string | number;
y: string | number;
/**
* Override the default hyphenation-callback
* @see https://react-pdf.org/fonts#registerhyphenationcallback
*/
hyphenationCallback?: HyphenationCallback;
}
/**
* A React component for displaying text. Text supports nesting of other
* Text or Link components to create inline styling.
*/
export class Text extends React.Component<
React.PropsWithChildren<TextProps> | SVGTextProps
> {}
interface LinkProps extends NodeProps {
/**
* Enable/disable page wrapping for element.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
href?: string;
src?: string;
/**
* Extends the clickable area of the link beyond its visible bounds.
* Accepts a number (applied to all sides) or an object with top, bottom, left, right.
* @see https://reactnative.dev/docs/view#hitslop
*/
hitSlop?: HitSlop;
}
/**
* A React component for displaying a hyperlink. Links can be nested
* inside a Text component, or being inside any other valid primitive.
*/
export class Link extends React.Component<
React.PropsWithChildren<LinkProps>
> {}
interface FormCommonProps extends NodeProps {
name?: string;
required?: boolean;
noExport?: boolean;
readOnly?: boolean;
value?: number | string;
defaultValue?: number | string;
}
interface FieldSetProps extends NodeProps {
name: string;
}
export class FieldSet extends React.Component<
React.PropsWithChildren<FieldSetProps>
> {}
// see http://pdfkit.org/docs/forms.html#text_field_formatting
interface TextInputFormatting {
type:
| 'date'
| 'time'
| 'percent'
| 'number'
| 'zip'
| 'zipPlus4'
| 'phone'
| 'ssn';
param?: string;
nDec?: number;
sepComma?: boolean;
negStyle?: 'MinusBlack' | 'Red' | 'ParensBlack' | 'ParensRed';
currency?: string;
currencyPrepend?: boolean;
}
// see http://pdfkit.org/docs/forms.html#text_field_formatting
interface TextInputProps extends FormCommonProps {
align?: 'left' | 'center' | 'right';
multiline?: boolean;
/**
* The text will be masked (e.g. with asterisks).
*/
password?: boolean;
/**
* If set, text entered in the field is not spell-checked
*/
noSpell?: boolean;
format?: TextInputFormatting;
/**
* Sets the fontSize (default or 0 means auto sizing)
*/
fontSize?: number;
/**
* Sets the maximum length (characters) of the text in the field
*/
maxLength?: number;
}
export class TextInput extends React.Component<TextInputProps> {}
interface CheckboxProps extends FormCommonProps {
backgroundColor?: string;
borderColor?: string;
checked?: boolean;
onState?: string;
offState?: string;
xMark?: boolean;
}
export class Checkbox extends React.Component<CheckboxProps> {}
interface SelectAndListPropsBase extends FormCommonProps {
sort?: boolean;
edit?: boolean;
multiSelect?: boolean;
noSpell?: boolean;
select?: string[];
}
type SelectAndListPropsWithEdit = SelectAndListPropsBase & {
edit: true | false;
noSpell: boolean;
};
type SelectAndListPropsWithNoSpell = SelectAndListPropsBase & {
edit: boolean;
noSpell: true | false;
};
type SelectAndListProps =
| SelectAndListPropsWithEdit
| SelectAndListPropsWithNoSpell;
export class Select extends React.Component<SelectAndListProps> {}
export class List extends React.Component<SelectAndListProps> {}
interface NoteProps extends NodeProps {
children: string;
}
export class Note extends React.Component<NoteProps> {}
interface CanvasProps extends NodeProps {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
paint: (
painter: any,
availableWidth: number,
availableHeight: number,
) => null;
}
export class Canvas extends React.Component<CanvasProps> {}
interface SVGProps extends NodeProps, SVGPresentationAttributes {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
width?: string | number;
height?: string | number;
viewBox?: string;
preserveAspectRatio?: string;
}
/**
* The <SVG /> element is a container that defines a new coordinate system and viewport. It is used as the outermost element of SVG documents.
*/
export class Svg extends React.Component<React.PropsWithChildren<SVGProps>> {}
interface LineProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
x1: string | number;
x2: string | number;
y1: string | number;
y2: string | number;
}
/**
* The <Line /> element is used to create a line.
*/
export class Line extends React.Component<
React.PropsWithChildren<LineProps>
> {}
interface PolylineProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
points: string;
}
/**
* The <Polyline /> element is used to create any shape that consists of only straight lines (that is connected at several points).
*/
export class Polyline extends React.Component<
React.PropsWithChildren<PolylineProps>
> {}
interface PolygonProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
points: string;
}
/**
* The <Polygon /> element is used to create a graphic that contains at least three sides.
* Polygons are made of straight lines, and the shape is "closed" (all the lines connect up).
*/
export class Polygon extends React.Component<
React.PropsWithChildren<PolygonProps>
> {}
interface PathProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
d: string;
}
/**
* The <Path /> element is the most powerful element in the SVG library of basic shapes. It can be used to create lines, curves, arcs, and more.
*/
export class Path extends React.Component<
React.PropsWithChildren<PathProps>
> {}
interface RectProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
x?: string | number;
y?: string | number;
width: string | number;
height: string | number;
rx?: string | number;
ry?: string | number;
}
/**
* The <Rect /> element is used to create a rectangle and variations of a rectangle shape.
*/
export class Rect extends React.Component<
React.PropsWithChildren<RectProps>
> {}
interface CircleProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
cx?: string | number;
cy?: string | number;
r: string | number;
}
/**
* The <Circle /> element is used to create a circle.
*/
export class Circle extends React.Component<
React.PropsWithChildren<CircleProps>
> {}
interface EllipseProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
cx?: string | number;
cy?: string | number;
rx: string | number;
ry: string | number;
}
/**
* The <Ellipse /> element is used to create an ellipse.
* An ellipse is closely related to a circle. The difference is that an ellipse has an x and a y radius that differs from each other, while a circle has equal x and y radius.
*/
export class Ellipse extends React.Component<
React.PropsWithChildren<EllipseProps>
> {}
interface TspanProps extends SVGPresentationAttributes {
x?: string | number;
y?: string | number;
}
/**
* The <Tspan /> element defines a subtext within a <Text /> element or another <Tspan /> element.
* It allows for adjustment of the style and/or position of that subtext as needed.
*/
export class Tspan extends React.Component<
React.PropsWithChildren<TspanProps>
> {}
interface GProps extends SVGPresentationAttributes {
style?: Style;
}
/**
* The <G /> SVG element is a container used to group other SVG elements.
* Transformations applied to the <G /> element are performed on its child elements, and its attributes are inherited by its children.
*/
export class G extends React.Component<React.PropsWithChildren<GProps>> {}
interface StopProps {
offset: string | number;
stopColor: string;
stopOpacity?: string | number;
}
/**
* The SVG <Stop /> element defines a color and its position to use on a gradient. This element is always a child of a <LinearGradient /> or <RadialGradient /> element
*/
export class Stop extends React.Component<
React.PropsWithChildren<StopProps>
> {}
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
interface DefsProps {}
/**
* The <Defs /> element is used to store graphical objects that will be used at a later time. Objects created inside a <Defs /> element are not rendered directly. To display them you have to reference them
*/
export class Defs extends React.Component<
React.PropsWithChildren<DefsProps>
> {}
interface ClipPathProps {
id?: string;
}
/**
* The <ClipPath /> SVG element defines a clipping path, to be used by the clipPath property.
* A clipping path restricts the region to which paint can be applied. Conceptually, parts of the drawing that lie outside of the region bounded by the clipping path are not drawn.
*/
export class ClipPath extends React.Component<
React.PropsWithChildren<ClipPathProps>
> {}
interface MarkerProps {
id: string;
viewBox?: string;
refX?: string | number;
refY?: string | number;
markerWidth?: string | number;
markerHeight?: string | number;
orient?: 'auto' | 'auto-start-reverse' | number;
markerUnits?: 'strokeWidth' | 'userSpaceOnUse';
}
/**
* The <Marker /> SVG element defines a graphic used for drawing arrows or polymarkers on a given <Path />, <Line />, <Polyline />, or <Polygon /> element.
* Markers can be attached to shapes using the markerStart, markerMid, and markerEnd properties.
*/
export class Marker extends React.Component<
React.PropsWithChildren<MarkerProps>
> {}
interface LinearGradientProps {
id: string;
x1?: string | number;
x2?: string | number;
y1?: string | number;
y2?: string | number;
xlinkHref?: string;
gradientTransform?: string;
gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
}
/**
* The <LinearGradient /> element lets authors define linear gradients that can be applied to fill or stroke of graphical elements.
*/
export class LinearGradient extends React.Component<
React.PropsWithChildren<LinearGradientProps>
> {}
interface RadialGradientProps {
id: string;
cx?: string | number;
cy?: string | number;
r?: string | number;
fx?: string | number;
fy?: string | number;
xlinkHref?: string;
gradientTransform?: string;
gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
}
/**
* The <RadialGradient /> element lets authors define radial gradients that can be applied to fill or stroke of graphical elements.
*/
export class RadialGradient extends React.Component<
React.PropsWithChildren<RadialGradientProps>
> {}
interface BlobProviderParams {
blob: Blob | null;
url: string | null;
loading: boolean;
error: Error | null;
}
interface BlobProviderProps {
document: React.ReactElement<DocumentProps>;
children: (params: BlobProviderParams) => React.ReactNode;
}
/**
* Easy and declarative way of getting document's blob data without
* showing it on screen.
* @see https://react-pdf.org/advanced#on-the-fly-rendering
* @platform web
*/
export class BlobProvider extends React.Component<BlobProviderProps> {}
interface PDFViewerProps {
width?: number | string;
height?: number | string;
style?: Style | Style[];
className?: string;
children?: React.ReactElement<DocumentProps>;
innerRef?: React.Ref<HTMLIFrameElement>;
showToolbar?: boolean;
}
/**
* Iframe PDF viewer for client-side generated documents.
* @platform web
*/
export class PDFViewer extends React.Component<PDFViewerProps> {}
interface PDFDownloadLinkProps
extends Omit<
React.AnchorHTMLAttributes<HTMLAnchorElement>,
'href' | 'children'
> {
/** PDF filename. Alias for anchor tag `download` attribute. */
fileName?: string;
document: React.ReactElement<DocumentProps>;
children?: React.ReactNode | React.FC<BlobProviderParams>;
onClick?: React.AnchorHTMLAttributes<HTMLAnchorElement>['onClick'] &
((
event: React.MouseEvent<HTMLAnchorElement, MouseEvent>,
instance: UsePDFInstance,
) => void);
ref?: React.Ref<HTMLAnchorElement> | undefined;
}
/**
* Anchor tag to enable generate and download PDF documents on the fly.
* @see https://react-pdf.org/advanced#on-the-fly-rendering
* @platform web
*/
export class PDFDownloadLink extends React.Component<PDFDownloadLinkProps> {}
interface UsePDFInstance {
loading: boolean;
blob: Blob | null;
url: string | null;
error: string | null;
}
/**
* React hook for creating and updating a PDF document instance
* @platform web
*/
export function usePDF(options?: {
document?: React.ReactElement<DocumentProps>;
}): [
UsePDFInstance,
(newDocument: React.ReactElement<DocumentProps>) => void,
];
export const Font: FontStore;
export const StyleSheet: {
create: <T extends Styles>(styles: T) => T;
};
export const version: any;
export const PDFRenderer: any;
export const pdf: (initialValue?: React.ReactElement<DocumentProps>) => {
container: any;
isDirty: () => boolean;
toString: () => string;
toBlob: () => Promise<Blob>;
toBuffer: () => Promise<NodeJS.ReadableStream>;
on: (event: 'change', callback: () => void) => void;
updateContainer: (
document: React.ReactElement<any>,
callback?: () => void,
) => void;
removeListener: (event: 'change', callback: () => void) => void;
};
export const renderToStream: (
document: React.ReactElement<DocumentProps>,
) => Promise<NodeJS.ReadableStream>;
/**
* @deprecated use the `renderToBuffer` method
*/
export const renderToString: (
document: React.ReactElement<DocumentProps>,
) => Promise<string>;
export const renderToFile: (
document: React.ReactElement<DocumentProps>,
filePath: string,
callback?: (output: NodeJS.ReadableStream, _filePath: string) => any,
) => Promise<NodeJS.ReadableStream>;
const render: typeof renderToFile;
/**
* Render document into a nodejs buffer
* @platform node
*/
export const renderToBuffer: (
document: React.ReactElement<ReactPDF.DocumentProps>,
) => Promise<Buffer>;
}

View File

@@ -0,0 +1,793 @@
/* eslint-disable max-classes-per-file */
import * as React from 'react';
import {
Style,
PageSize,
FontStore,
PDFVersion,
Orientation,
SourceObject,
SrcSet,
Sizes,
HyphenationCallback,
SVGPresentationAttributes,
Bookmark,
PageLayout,
PageMode,
HitSlop,
} from '@react-pdf/types';
declare class ReactPDF {
static default: typeof ReactPDF;
}
export = ReactPDF;
declare namespace ReactPDF {
interface Styles {
[key: string]: Style;
}
interface OnRenderProps {
blob?: Blob;
}
interface Permissions {
printing?: 'lowResolution' | 'highResolution';
modifying?: boolean;
copying?: boolean;
annotating?: boolean;
fillingForms?: boolean;
contentAccessibility?: boolean;
documentAssembly?: boolean;
}
interface DocumentProps {
style?: Style | Style[];
title?: string;
author?: string;
subject?: string;
creator?: string;
keywords?: string;
producer?: string;
language?: string;
creationDate?: Date;
modificationDate?: Date;
pdfVersion?: PDFVersion;
pageMode?: PageMode;
pageLayout?: PageLayout;
ownerPassword?: string;
userPassword?: string;
permissions?: Permissions;
onRender?: (props: OnRenderProps) => any;
}
/**
* This component represent the PDF document itself. It must be the root
* of your tree element structure, and under no circumstances should it be
* used as children of another react-pdf component. In addition, it should
* only have childs of type <Page />.
*/
export class Document extends React.Component<
React.PropsWithChildren<DocumentProps>
> {}
interface NodeProps {
id?: string;
style?: Style | Style[];
/**
* Render component in all wrapped pages.
* @see https://react-pdf.org/advanced#fixed-components
*/
fixed?: boolean;
/**
* Force the wrapping algorithm to start a new page when rendering the
* element.
* @see https://react-pdf.org/advanced#page-breaks
*/
break?: boolean;
/**
* Hint that no page wrapping should occur between all sibling elements following the element within n points
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
*/
minPresenceAhead?: number;
}
interface PageProps extends NodeProps {
/**
* Enable page wrapping for this page.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
size?: PageSize;
orientation?: Orientation;
dpi?: number;
bookmark?: Bookmark;
}
/**
* Represents single page inside the PDF document, or a subset of them if
* using the wrapping feature. A <Document /> can contain as many pages as
* you want, but ensure not rendering a page inside any component besides
* Document.
*/
export class Page extends React.Component<
React.PropsWithChildren<PageProps>
> {}
interface ViewProps extends NodeProps {
id?: string;
/**
* Enable/disable page wrapping for element.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
render?: (props: {
pageNumber: number;
subPageNumber: number;
}) => React.ReactNode;
}
/**
* The most fundamental component for building a UI and is designed to be
* nested inside other views and can have 0 to many children.
*/
export class View extends React.Component<
React.PropsWithChildren<ViewProps>
> {}
interface BaseImageProps extends NodeProps {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
cache?: boolean;
/**
* A comma-separated list of image sources with width descriptors.
* Works like the HTML img srcSet attribute.
* @example "small.jpg 300w, medium.jpg 600w, large.jpg 900w"
*/
srcSet?: SrcSet;
/**
* The intended display width of the image, used to select the best source
* from srcSet. Accepts a number (in points) or a string.
* Works like the HTML img sizes attribute.
* @example 300
* @example "300"
*/
sizes?: Sizes;
}
interface ImageWithSrcProp extends BaseImageProps {
src: SourceObject;
}
interface ImageWithSourceProp extends BaseImageProps {
source: SourceObject;
}
type ImageProps = ImageWithSrcProp | ImageWithSourceProp;
/**
* A React component for displaying network or local (Node only) JPG or
* PNG images, as well as base64 encoded image strings.
*/
export class Image extends React.Component<ImageProps> {}
interface BaseImageBackgroundProps extends NodeProps {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
cache?: boolean;
/**
* A comma-separated list of image sources with width descriptors.
* Works like the HTML img srcSet attribute.
* @example "small.jpg 300w, medium.jpg 600w, large.jpg 900w"
*/
srcSet?: SrcSet;
/**
* The intended display width of the image, used to select the best source
* from srcSet. Accepts a number (in points) or a string.
* @example 300
*/
sizes?: Sizes;
/**
* Style applied to the background image.
*/
imageStyle?: Style;
}
interface ImageBackgroundWithSrcProp extends BaseImageBackgroundProps {
src: SourceObject;
}
interface ImageBackgroundWithSourceProp extends BaseImageBackgroundProps {
source: SourceObject;
}
type ImageBackgroundProps =
| ImageBackgroundWithSrcProp
| ImageBackgroundWithSourceProp;
/**
* A React component for displaying an image behind child content.
* Compatible with React Native's ImageBackground component.
* @see https://reactnative.dev/docs/imagebackground
*/
export class ImageBackground extends React.Component<
React.PropsWithChildren<ImageBackgroundProps>
> {}
interface TextProps extends NodeProps {
id?: string;
/**
* Enable/disable page wrapping for element.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
render?: (props: {
pageNumber: number;
totalPages: number;
subPageNumber: number;
subPageTotalPages: number;
}) => React.ReactNode;
/**
* Override the default hyphenation-callback
* @see https://react-pdf.org/fonts#registerhyphenationcallback
*/
hyphenationCallback?: HyphenationCallback;
/**
* Specifies the minimum number of lines in a text element that must be shown at the bottom of a page or its container.
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
*/
orphans?: number;
/**
* Specifies the minimum number of lines in a text element that must be shown at the top of a page or its container..
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
*/
widows?: number;
}
interface SVGTextProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
x: string | number;
y: string | number;
/**
* Override the default hyphenation-callback
* @see https://react-pdf.org/fonts#registerhyphenationcallback
*/
hyphenationCallback?: HyphenationCallback;
}
/**
* A React component for displaying text. Text supports nesting of other
* Text or Link components to create inline styling.
*/
export class Text extends React.Component<
React.PropsWithChildren<TextProps> | SVGTextProps
> {}
interface LinkProps extends NodeProps {
/**
* Enable/disable page wrapping for element.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
href?: string;
src?: string;
/**
* Extends the clickable area of the link beyond its visible bounds.
* Accepts a number (applied to all sides) or an object with top, bottom, left, right.
* @see https://reactnative.dev/docs/view#hitslop
*/
hitSlop?: HitSlop;
}
/**
* A React component for displaying a hyperlink. Links can be nested
* inside a Text component, or being inside any other valid primitive.
*/
export class Link extends React.Component<
React.PropsWithChildren<LinkProps>
> {}
interface FormCommonProps extends NodeProps {
name?: string;
required?: boolean;
noExport?: boolean;
readOnly?: boolean;
value?: number | string;
defaultValue?: number | string;
}
interface FieldSetProps extends NodeProps {
name: string;
}
export class FieldSet extends React.Component<
React.PropsWithChildren<FieldSetProps>
> {}
// see http://pdfkit.org/docs/forms.html#text_field_formatting
interface TextInputFormatting {
type:
| 'date'
| 'time'
| 'percent'
| 'number'
| 'zip'
| 'zipPlus4'
| 'phone'
| 'ssn';
param?: string;
nDec?: number;
sepComma?: boolean;
negStyle?: 'MinusBlack' | 'Red' | 'ParensBlack' | 'ParensRed';
currency?: string;
currencyPrepend?: boolean;
}
// see http://pdfkit.org/docs/forms.html#text_field_formatting
interface TextInputProps extends FormCommonProps {
align?: 'left' | 'center' | 'right';
multiline?: boolean;
/**
* The text will be masked (e.g. with asterisks).
*/
password?: boolean;
/**
* If set, text entered in the field is not spell-checked
*/
noSpell?: boolean;
format?: TextInputFormatting;
/**
* Sets the fontSize (default or 0 means auto sizing)
*/
fontSize?: number;
/**
* Sets the maximum length (characters) of the text in the field
*/
maxLength?: number;
}
export class TextInput extends React.Component<TextInputProps> {}
interface CheckboxProps extends FormCommonProps {
backgroundColor?: string;
borderColor?: string;
checked?: boolean;
onState?: string;
offState?: string;
xMark?: boolean;
}
export class Checkbox extends React.Component<CheckboxProps> {}
interface SelectAndListPropsBase extends FormCommonProps {
sort?: boolean;
edit?: boolean;
multiSelect?: boolean;
noSpell?: boolean;
select?: string[];
}
type SelectAndListPropsWithEdit = SelectAndListPropsBase & {
edit: true | false;
noSpell: boolean;
};
type SelectAndListPropsWithNoSpell = SelectAndListPropsBase & {
edit: boolean;
noSpell: true | false;
};
type SelectAndListProps =
| SelectAndListPropsWithEdit
| SelectAndListPropsWithNoSpell;
export class Select extends React.Component<SelectAndListProps> {}
export class List extends React.Component<SelectAndListProps> {}
interface NoteProps extends NodeProps {
children: string;
}
export class Note extends React.Component<NoteProps> {}
interface CanvasProps extends NodeProps {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
paint: (
painter: any,
availableWidth: number,
availableHeight: number,
) => null;
}
export class Canvas extends React.Component<CanvasProps> {}
interface SVGProps extends NodeProps, SVGPresentationAttributes {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
width?: string | number;
height?: string | number;
viewBox?: string;
preserveAspectRatio?: string;
}
/**
* The <SVG /> element is a container that defines a new coordinate system and viewport. It is used as the outermost element of SVG documents.
*/
export class Svg extends React.Component<React.PropsWithChildren<SVGProps>> {}
interface LineProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
x1: string | number;
x2: string | number;
y1: string | number;
y2: string | number;
}
/**
* The <Line /> element is used to create a line.
*/
export class Line extends React.Component<
React.PropsWithChildren<LineProps>
> {}
interface PolylineProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
points: string;
}
/**
* The <Polyline /> element is used to create any shape that consists of only straight lines (that is connected at several points).
*/
export class Polyline extends React.Component<
React.PropsWithChildren<PolylineProps>
> {}
interface PolygonProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
points: string;
}
/**
* The <Polygon /> element is used to create a graphic that contains at least three sides.
* Polygons are made of straight lines, and the shape is "closed" (all the lines connect up).
*/
export class Polygon extends React.Component<
React.PropsWithChildren<PolygonProps>
> {}
interface PathProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
d: string;
}
/**
* The <Path /> element is the most powerful element in the SVG library of basic shapes. It can be used to create lines, curves, arcs, and more.
*/
export class Path extends React.Component<
React.PropsWithChildren<PathProps>
> {}
interface RectProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
x?: string | number;
y?: string | number;
width: string | number;
height: string | number;
rx?: string | number;
ry?: string | number;
}
/**
* The <Rect /> element is used to create a rectangle and variations of a rectangle shape.
*/
export class Rect extends React.Component<
React.PropsWithChildren<RectProps>
> {}
interface CircleProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
cx?: string | number;
cy?: string | number;
r: string | number;
}
/**
* The <Circle /> element is used to create a circle.
*/
export class Circle extends React.Component<
React.PropsWithChildren<CircleProps>
> {}
interface EllipseProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
cx?: string | number;
cy?: string | number;
rx: string | number;
ry: string | number;
}
/**
* The <Ellipse /> element is used to create an ellipse.
* An ellipse is closely related to a circle. The difference is that an ellipse has an x and a y radius that differs from each other, while a circle has equal x and y radius.
*/
export class Ellipse extends React.Component<
React.PropsWithChildren<EllipseProps>
> {}
interface TspanProps extends SVGPresentationAttributes {
x?: string | number;
y?: string | number;
}
/**
* The <Tspan /> element defines a subtext within a <Text /> element or another <Tspan /> element.
* It allows for adjustment of the style and/or position of that subtext as needed.
*/
export class Tspan extends React.Component<
React.PropsWithChildren<TspanProps>
> {}
interface GProps extends SVGPresentationAttributes {
style?: Style;
}
/**
* The <G /> SVG element is a container used to group other SVG elements.
* Transformations applied to the <G /> element are performed on its child elements, and its attributes are inherited by its children.
*/
export class G extends React.Component<React.PropsWithChildren<GProps>> {}
interface StopProps {
offset: string | number;
stopColor: string;
stopOpacity?: string | number;
}
/**
* The SVG <Stop /> element defines a color and its position to use on a gradient. This element is always a child of a <LinearGradient /> or <RadialGradient /> element
*/
export class Stop extends React.Component<
React.PropsWithChildren<StopProps>
> {}
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
interface DefsProps {}
/**
* The <Defs /> element is used to store graphical objects that will be used at a later time. Objects created inside a <Defs /> element are not rendered directly. To display them you have to reference them
*/
export class Defs extends React.Component<
React.PropsWithChildren<DefsProps>
> {}
interface ClipPathProps {
id?: string;
}
/**
* The <ClipPath /> SVG element defines a clipping path, to be used by the clipPath property.
* A clipping path restricts the region to which paint can be applied. Conceptually, parts of the drawing that lie outside of the region bounded by the clipping path are not drawn.
*/
export class ClipPath extends React.Component<
React.PropsWithChildren<ClipPathProps>
> {}
interface MarkerProps {
id: string;
viewBox?: string;
refX?: string | number;
refY?: string | number;
markerWidth?: string | number;
markerHeight?: string | number;
orient?: 'auto' | 'auto-start-reverse' | number;
markerUnits?: 'strokeWidth' | 'userSpaceOnUse';
}
/**
* The <Marker /> SVG element defines a graphic used for drawing arrows or polymarkers on a given <Path />, <Line />, <Polyline />, or <Polygon /> element.
* Markers can be attached to shapes using the markerStart, markerMid, and markerEnd properties.
*/
export class Marker extends React.Component<
React.PropsWithChildren<MarkerProps>
> {}
interface LinearGradientProps {
id: string;
x1?: string | number;
x2?: string | number;
y1?: string | number;
y2?: string | number;
xlinkHref?: string;
gradientTransform?: string;
gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
}
/**
* The <LinearGradient /> element lets authors define linear gradients that can be applied to fill or stroke of graphical elements.
*/
export class LinearGradient extends React.Component<
React.PropsWithChildren<LinearGradientProps>
> {}
interface RadialGradientProps {
id: string;
cx?: string | number;
cy?: string | number;
r?: string | number;
fx?: string | number;
fy?: string | number;
xlinkHref?: string;
gradientTransform?: string;
gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
}
/**
* The <RadialGradient /> element lets authors define radial gradients that can be applied to fill or stroke of graphical elements.
*/
export class RadialGradient extends React.Component<
React.PropsWithChildren<RadialGradientProps>
> {}
interface BlobProviderParams {
blob: Blob | null;
url: string | null;
loading: boolean;
error: Error | null;
}
interface BlobProviderProps {
document: React.ReactElement<DocumentProps>;
children: (params: BlobProviderParams) => React.ReactNode;
}
/**
* Easy and declarative way of getting document's blob data without
* showing it on screen.
* @see https://react-pdf.org/advanced#on-the-fly-rendering
* @platform web
*/
export class BlobProvider extends React.Component<BlobProviderProps> {}
interface PDFViewerProps {
width?: number | string;
height?: number | string;
style?: Style | Style[];
className?: string;
children?: React.ReactElement<DocumentProps>;
innerRef?: React.Ref<HTMLIFrameElement>;
showToolbar?: boolean;
}
/**
* Iframe PDF viewer for client-side generated documents.
* @platform web
*/
export class PDFViewer extends React.Component<PDFViewerProps> {}
interface PDFDownloadLinkProps
extends Omit<
React.AnchorHTMLAttributes<HTMLAnchorElement>,
'href' | 'children'
> {
/** PDF filename. Alias for anchor tag `download` attribute. */
fileName?: string;
document: React.ReactElement<DocumentProps>;
children?: React.ReactNode | React.FC<BlobProviderParams>;
onClick?: React.AnchorHTMLAttributes<HTMLAnchorElement>['onClick'] &
((
event: React.MouseEvent<HTMLAnchorElement, MouseEvent>,
instance: UsePDFInstance,
) => void);
ref?: React.Ref<HTMLAnchorElement> | undefined;
}
/**
* Anchor tag to enable generate and download PDF documents on the fly.
* @see https://react-pdf.org/advanced#on-the-fly-rendering
* @platform web
*/
export class PDFDownloadLink extends React.Component<PDFDownloadLinkProps> {}
interface UsePDFInstance {
loading: boolean;
blob: Blob | null;
url: string | null;
error: string | null;
}
/**
* React hook for creating and updating a PDF document instance
* @platform web
*/
export function usePDF(options?: {
document?: React.ReactElement<DocumentProps>;
}): [
UsePDFInstance,
(newDocument: React.ReactElement<DocumentProps>) => void,
];
export const Font: FontStore;
export const StyleSheet: {
create: <T extends Styles>(styles: T) => T;
};
export const version: any;
export const PDFRenderer: any;
export const pdf: (initialValue?: React.ReactElement<DocumentProps>) => {
container: any;
isDirty: () => boolean;
toString: () => string;
toBlob: () => Promise<Blob>;
toBuffer: () => Promise<NodeJS.ReadableStream>;
on: (event: 'change', callback: () => void) => void;
updateContainer: (
document: React.ReactElement<any>,
callback?: () => void,
) => void;
removeListener: (event: 'change', callback: () => void) => void;
};
export const renderToStream: (
document: React.ReactElement<DocumentProps>,
) => Promise<NodeJS.ReadableStream>;
/**
* @deprecated use the `renderToBuffer` method
*/
export const renderToString: (
document: React.ReactElement<DocumentProps>,
) => Promise<string>;
export const renderToFile: (
document: React.ReactElement<DocumentProps>,
filePath: string,
callback?: (output: NodeJS.ReadableStream, _filePath: string) => any,
) => Promise<NodeJS.ReadableStream>;
const render: typeof renderToFile;
/**
* Render document into a nodejs buffer
* @platform node
*/
export const renderToBuffer: (
document: React.ReactElement<ReactPDF.DocumentProps>,
) => Promise<Buffer>;
}

View File

@@ -0,0 +1,793 @@
/* eslint-disable max-classes-per-file */
import * as React from 'react';
import {
Style,
PageSize,
FontStore,
PDFVersion,
Orientation,
SourceObject,
SrcSet,
Sizes,
HyphenationCallback,
SVGPresentationAttributes,
Bookmark,
PageLayout,
PageMode,
HitSlop,
} from '@react-pdf/types';
declare class ReactPDF {
static default: typeof ReactPDF;
}
export = ReactPDF;
declare namespace ReactPDF {
interface Styles {
[key: string]: Style;
}
interface OnRenderProps {
blob?: Blob;
}
interface Permissions {
printing?: 'lowResolution' | 'highResolution';
modifying?: boolean;
copying?: boolean;
annotating?: boolean;
fillingForms?: boolean;
contentAccessibility?: boolean;
documentAssembly?: boolean;
}
interface DocumentProps {
style?: Style | Style[];
title?: string;
author?: string;
subject?: string;
creator?: string;
keywords?: string;
producer?: string;
language?: string;
creationDate?: Date;
modificationDate?: Date;
pdfVersion?: PDFVersion;
pageMode?: PageMode;
pageLayout?: PageLayout;
ownerPassword?: string;
userPassword?: string;
permissions?: Permissions;
onRender?: (props: OnRenderProps) => any;
}
/**
* This component represent the PDF document itself. It must be the root
* of your tree element structure, and under no circumstances should it be
* used as children of another react-pdf component. In addition, it should
* only have childs of type <Page />.
*/
export class Document extends React.Component<
React.PropsWithChildren<DocumentProps>
> {}
interface NodeProps {
id?: string;
style?: Style | Style[];
/**
* Render component in all wrapped pages.
* @see https://react-pdf.org/advanced#fixed-components
*/
fixed?: boolean;
/**
* Force the wrapping algorithm to start a new page when rendering the
* element.
* @see https://react-pdf.org/advanced#page-breaks
*/
break?: boolean;
/**
* Hint that no page wrapping should occur between all sibling elements following the element within n points
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
*/
minPresenceAhead?: number;
}
interface PageProps extends NodeProps {
/**
* Enable page wrapping for this page.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
size?: PageSize;
orientation?: Orientation;
dpi?: number;
bookmark?: Bookmark;
}
/**
* Represents single page inside the PDF document, or a subset of them if
* using the wrapping feature. A <Document /> can contain as many pages as
* you want, but ensure not rendering a page inside any component besides
* Document.
*/
export class Page extends React.Component<
React.PropsWithChildren<PageProps>
> {}
interface ViewProps extends NodeProps {
id?: string;
/**
* Enable/disable page wrapping for element.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
render?: (props: {
pageNumber: number;
subPageNumber: number;
}) => React.ReactNode;
}
/**
* The most fundamental component for building a UI and is designed to be
* nested inside other views and can have 0 to many children.
*/
export class View extends React.Component<
React.PropsWithChildren<ViewProps>
> {}
interface BaseImageProps extends NodeProps {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
cache?: boolean;
/**
* A comma-separated list of image sources with width descriptors.
* Works like the HTML img srcSet attribute.
* @example "small.jpg 300w, medium.jpg 600w, large.jpg 900w"
*/
srcSet?: SrcSet;
/**
* The intended display width of the image, used to select the best source
* from srcSet. Accepts a number (in points) or a string.
* Works like the HTML img sizes attribute.
* @example 300
* @example "300"
*/
sizes?: Sizes;
}
interface ImageWithSrcProp extends BaseImageProps {
src: SourceObject;
}
interface ImageWithSourceProp extends BaseImageProps {
source: SourceObject;
}
type ImageProps = ImageWithSrcProp | ImageWithSourceProp;
/**
* A React component for displaying network or local (Node only) JPG or
* PNG images, as well as base64 encoded image strings.
*/
export class Image extends React.Component<ImageProps> {}
interface BaseImageBackgroundProps extends NodeProps {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
cache?: boolean;
/**
* A comma-separated list of image sources with width descriptors.
* Works like the HTML img srcSet attribute.
* @example "small.jpg 300w, medium.jpg 600w, large.jpg 900w"
*/
srcSet?: SrcSet;
/**
* The intended display width of the image, used to select the best source
* from srcSet. Accepts a number (in points) or a string.
* @example 300
*/
sizes?: Sizes;
/**
* Style applied to the background image.
*/
imageStyle?: Style;
}
interface ImageBackgroundWithSrcProp extends BaseImageBackgroundProps {
src: SourceObject;
}
interface ImageBackgroundWithSourceProp extends BaseImageBackgroundProps {
source: SourceObject;
}
type ImageBackgroundProps =
| ImageBackgroundWithSrcProp
| ImageBackgroundWithSourceProp;
/**
* A React component for displaying an image behind child content.
* Compatible with React Native's ImageBackground component.
* @see https://reactnative.dev/docs/imagebackground
*/
export class ImageBackground extends React.Component<
React.PropsWithChildren<ImageBackgroundProps>
> {}
interface TextProps extends NodeProps {
id?: string;
/**
* Enable/disable page wrapping for element.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
render?: (props: {
pageNumber: number;
totalPages: number;
subPageNumber: number;
subPageTotalPages: number;
}) => React.ReactNode;
/**
* Override the default hyphenation-callback
* @see https://react-pdf.org/fonts#registerhyphenationcallback
*/
hyphenationCallback?: HyphenationCallback;
/**
* Specifies the minimum number of lines in a text element that must be shown at the bottom of a page or its container.
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
*/
orphans?: number;
/**
* Specifies the minimum number of lines in a text element that must be shown at the top of a page or its container..
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
*/
widows?: number;
}
interface SVGTextProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
x: string | number;
y: string | number;
/**
* Override the default hyphenation-callback
* @see https://react-pdf.org/fonts#registerhyphenationcallback
*/
hyphenationCallback?: HyphenationCallback;
}
/**
* A React component for displaying text. Text supports nesting of other
* Text or Link components to create inline styling.
*/
export class Text extends React.Component<
React.PropsWithChildren<TextProps> | SVGTextProps
> {}
interface LinkProps extends NodeProps {
/**
* Enable/disable page wrapping for element.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
href?: string;
src?: string;
/**
* Extends the clickable area of the link beyond its visible bounds.
* Accepts a number (applied to all sides) or an object with top, bottom, left, right.
* @see https://reactnative.dev/docs/view#hitslop
*/
hitSlop?: HitSlop;
}
/**
* A React component for displaying a hyperlink. Links can be nested
* inside a Text component, or being inside any other valid primitive.
*/
export class Link extends React.Component<
React.PropsWithChildren<LinkProps>
> {}
interface FormCommonProps extends NodeProps {
name?: string;
required?: boolean;
noExport?: boolean;
readOnly?: boolean;
value?: number | string;
defaultValue?: number | string;
}
interface FieldSetProps extends NodeProps {
name: string;
}
export class FieldSet extends React.Component<
React.PropsWithChildren<FieldSetProps>
> {}
// see http://pdfkit.org/docs/forms.html#text_field_formatting
interface TextInputFormatting {
type:
| 'date'
| 'time'
| 'percent'
| 'number'
| 'zip'
| 'zipPlus4'
| 'phone'
| 'ssn';
param?: string;
nDec?: number;
sepComma?: boolean;
negStyle?: 'MinusBlack' | 'Red' | 'ParensBlack' | 'ParensRed';
currency?: string;
currencyPrepend?: boolean;
}
// see http://pdfkit.org/docs/forms.html#text_field_formatting
interface TextInputProps extends FormCommonProps {
align?: 'left' | 'center' | 'right';
multiline?: boolean;
/**
* The text will be masked (e.g. with asterisks).
*/
password?: boolean;
/**
* If set, text entered in the field is not spell-checked
*/
noSpell?: boolean;
format?: TextInputFormatting;
/**
* Sets the fontSize (default or 0 means auto sizing)
*/
fontSize?: number;
/**
* Sets the maximum length (characters) of the text in the field
*/
maxLength?: number;
}
export class TextInput extends React.Component<TextInputProps> {}
interface CheckboxProps extends FormCommonProps {
backgroundColor?: string;
borderColor?: string;
checked?: boolean;
onState?: string;
offState?: string;
xMark?: boolean;
}
export class Checkbox extends React.Component<CheckboxProps> {}
interface SelectAndListPropsBase extends FormCommonProps {
sort?: boolean;
edit?: boolean;
multiSelect?: boolean;
noSpell?: boolean;
select?: string[];
}
type SelectAndListPropsWithEdit = SelectAndListPropsBase & {
edit: true | false;
noSpell: boolean;
};
type SelectAndListPropsWithNoSpell = SelectAndListPropsBase & {
edit: boolean;
noSpell: true | false;
};
type SelectAndListProps =
| SelectAndListPropsWithEdit
| SelectAndListPropsWithNoSpell;
export class Select extends React.Component<SelectAndListProps> {}
export class List extends React.Component<SelectAndListProps> {}
interface NoteProps extends NodeProps {
children: string;
}
export class Note extends React.Component<NoteProps> {}
interface CanvasProps extends NodeProps {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
paint: (
painter: any,
availableWidth: number,
availableHeight: number,
) => null;
}
export class Canvas extends React.Component<CanvasProps> {}
interface SVGProps extends NodeProps, SVGPresentationAttributes {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
width?: string | number;
height?: string | number;
viewBox?: string;
preserveAspectRatio?: string;
}
/**
* The <SVG /> element is a container that defines a new coordinate system and viewport. It is used as the outermost element of SVG documents.
*/
export class Svg extends React.Component<React.PropsWithChildren<SVGProps>> {}
interface LineProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
x1: string | number;
x2: string | number;
y1: string | number;
y2: string | number;
}
/**
* The <Line /> element is used to create a line.
*/
export class Line extends React.Component<
React.PropsWithChildren<LineProps>
> {}
interface PolylineProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
points: string;
}
/**
* The <Polyline /> element is used to create any shape that consists of only straight lines (that is connected at several points).
*/
export class Polyline extends React.Component<
React.PropsWithChildren<PolylineProps>
> {}
interface PolygonProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
points: string;
}
/**
* The <Polygon /> element is used to create a graphic that contains at least three sides.
* Polygons are made of straight lines, and the shape is "closed" (all the lines connect up).
*/
export class Polygon extends React.Component<
React.PropsWithChildren<PolygonProps>
> {}
interface PathProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
d: string;
}
/**
* The <Path /> element is the most powerful element in the SVG library of basic shapes. It can be used to create lines, curves, arcs, and more.
*/
export class Path extends React.Component<
React.PropsWithChildren<PathProps>
> {}
interface RectProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
x?: string | number;
y?: string | number;
width: string | number;
height: string | number;
rx?: string | number;
ry?: string | number;
}
/**
* The <Rect /> element is used to create a rectangle and variations of a rectangle shape.
*/
export class Rect extends React.Component<
React.PropsWithChildren<RectProps>
> {}
interface CircleProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
cx?: string | number;
cy?: string | number;
r: string | number;
}
/**
* The <Circle /> element is used to create a circle.
*/
export class Circle extends React.Component<
React.PropsWithChildren<CircleProps>
> {}
interface EllipseProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
cx?: string | number;
cy?: string | number;
rx: string | number;
ry: string | number;
}
/**
* The <Ellipse /> element is used to create an ellipse.
* An ellipse is closely related to a circle. The difference is that an ellipse has an x and a y radius that differs from each other, while a circle has equal x and y radius.
*/
export class Ellipse extends React.Component<
React.PropsWithChildren<EllipseProps>
> {}
interface TspanProps extends SVGPresentationAttributes {
x?: string | number;
y?: string | number;
}
/**
* The <Tspan /> element defines a subtext within a <Text /> element or another <Tspan /> element.
* It allows for adjustment of the style and/or position of that subtext as needed.
*/
export class Tspan extends React.Component<
React.PropsWithChildren<TspanProps>
> {}
interface GProps extends SVGPresentationAttributes {
style?: Style;
}
/**
* The <G /> SVG element is a container used to group other SVG elements.
* Transformations applied to the <G /> element are performed on its child elements, and its attributes are inherited by its children.
*/
export class G extends React.Component<React.PropsWithChildren<GProps>> {}
interface StopProps {
offset: string | number;
stopColor: string;
stopOpacity?: string | number;
}
/**
* The SVG <Stop /> element defines a color and its position to use on a gradient. This element is always a child of a <LinearGradient /> or <RadialGradient /> element
*/
export class Stop extends React.Component<
React.PropsWithChildren<StopProps>
> {}
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
interface DefsProps {}
/**
* The <Defs /> element is used to store graphical objects that will be used at a later time. Objects created inside a <Defs /> element are not rendered directly. To display them you have to reference them
*/
export class Defs extends React.Component<
React.PropsWithChildren<DefsProps>
> {}
interface ClipPathProps {
id?: string;
}
/**
* The <ClipPath /> SVG element defines a clipping path, to be used by the clipPath property.
* A clipping path restricts the region to which paint can be applied. Conceptually, parts of the drawing that lie outside of the region bounded by the clipping path are not drawn.
*/
export class ClipPath extends React.Component<
React.PropsWithChildren<ClipPathProps>
> {}
interface MarkerProps {
id: string;
viewBox?: string;
refX?: string | number;
refY?: string | number;
markerWidth?: string | number;
markerHeight?: string | number;
orient?: 'auto' | 'auto-start-reverse' | number;
markerUnits?: 'strokeWidth' | 'userSpaceOnUse';
}
/**
* The <Marker /> SVG element defines a graphic used for drawing arrows or polymarkers on a given <Path />, <Line />, <Polyline />, or <Polygon /> element.
* Markers can be attached to shapes using the markerStart, markerMid, and markerEnd properties.
*/
export class Marker extends React.Component<
React.PropsWithChildren<MarkerProps>
> {}
interface LinearGradientProps {
id: string;
x1?: string | number;
x2?: string | number;
y1?: string | number;
y2?: string | number;
xlinkHref?: string;
gradientTransform?: string;
gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
}
/**
* The <LinearGradient /> element lets authors define linear gradients that can be applied to fill or stroke of graphical elements.
*/
export class LinearGradient extends React.Component<
React.PropsWithChildren<LinearGradientProps>
> {}
interface RadialGradientProps {
id: string;
cx?: string | number;
cy?: string | number;
r?: string | number;
fx?: string | number;
fy?: string | number;
xlinkHref?: string;
gradientTransform?: string;
gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
}
/**
* The <RadialGradient /> element lets authors define radial gradients that can be applied to fill or stroke of graphical elements.
*/
export class RadialGradient extends React.Component<
React.PropsWithChildren<RadialGradientProps>
> {}
interface BlobProviderParams {
blob: Blob | null;
url: string | null;
loading: boolean;
error: Error | null;
}
interface BlobProviderProps {
document: React.ReactElement<DocumentProps>;
children: (params: BlobProviderParams) => React.ReactNode;
}
/**
* Easy and declarative way of getting document's blob data without
* showing it on screen.
* @see https://react-pdf.org/advanced#on-the-fly-rendering
* @platform web
*/
export class BlobProvider extends React.Component<BlobProviderProps> {}
interface PDFViewerProps {
width?: number | string;
height?: number | string;
style?: Style | Style[];
className?: string;
children?: React.ReactElement<DocumentProps>;
innerRef?: React.Ref<HTMLIFrameElement>;
showToolbar?: boolean;
}
/**
* Iframe PDF viewer for client-side generated documents.
* @platform web
*/
export class PDFViewer extends React.Component<PDFViewerProps> {}
interface PDFDownloadLinkProps
extends Omit<
React.AnchorHTMLAttributes<HTMLAnchorElement>,
'href' | 'children'
> {
/** PDF filename. Alias for anchor tag `download` attribute. */
fileName?: string;
document: React.ReactElement<DocumentProps>;
children?: React.ReactNode | React.FC<BlobProviderParams>;
onClick?: React.AnchorHTMLAttributes<HTMLAnchorElement>['onClick'] &
((
event: React.MouseEvent<HTMLAnchorElement, MouseEvent>,
instance: UsePDFInstance,
) => void);
ref?: React.Ref<HTMLAnchorElement> | undefined;
}
/**
* Anchor tag to enable generate and download PDF documents on the fly.
* @see https://react-pdf.org/advanced#on-the-fly-rendering
* @platform web
*/
export class PDFDownloadLink extends React.Component<PDFDownloadLinkProps> {}
interface UsePDFInstance {
loading: boolean;
blob: Blob | null;
url: string | null;
error: string | null;
}
/**
* React hook for creating and updating a PDF document instance
* @platform web
*/
export function usePDF(options?: {
document?: React.ReactElement<DocumentProps>;
}): [
UsePDFInstance,
(newDocument: React.ReactElement<DocumentProps>) => void,
];
export const Font: FontStore;
export const StyleSheet: {
create: <T extends Styles>(styles: T) => T;
};
export const version: any;
export const PDFRenderer: any;
export const pdf: (initialValue?: React.ReactElement<DocumentProps>) => {
container: any;
isDirty: () => boolean;
toString: () => string;
toBlob: () => Promise<Blob>;
toBuffer: () => Promise<NodeJS.ReadableStream>;
on: (event: 'change', callback: () => void) => void;
updateContainer: (
document: React.ReactElement<any>,
callback?: () => void,
) => void;
removeListener: (event: 'change', callback: () => void) => void;
};
export const renderToStream: (
document: React.ReactElement<DocumentProps>,
) => Promise<NodeJS.ReadableStream>;
/**
* @deprecated use the `renderToBuffer` method
*/
export const renderToString: (
document: React.ReactElement<DocumentProps>,
) => Promise<string>;
export const renderToFile: (
document: React.ReactElement<DocumentProps>,
filePath: string,
callback?: (output: NodeJS.ReadableStream, _filePath: string) => any,
) => Promise<NodeJS.ReadableStream>;
const render: typeof renderToFile;
/**
* Render document into a nodejs buffer
* @platform node
*/
export const renderToBuffer: (
document: React.ReactElement<ReactPDF.DocumentProps>,
) => Promise<Buffer>;
}

View File

@@ -0,0 +1,473 @@
import * as primitives from '@react-pdf/primitives';
export * from '@react-pdf/primitives';
import queue from 'queue';
import { useRef, useState, useEffect, useCallback, forwardRef } from 'react';
import FontStore from '@react-pdf/font';
import renderPDF from '@react-pdf/render';
import PDFDocument from '@react-pdf/pdfkit';
import layoutDocument from '@react-pdf/layout';
import { upperFirst } from '@react-pdf/fns';
import Reconciler from '@react-pdf/reconciler';
import { jsx } from 'react/jsx-runtime';
const omitNils = object => Object.fromEntries(Object.entries(object).filter(_ref => {
let [, value] = _ref;
return value !== undefined;
}));
const createInstance = (type, _ref) => {
let {
style,
children,
...props
} = _ref;
return {
type,
box: {},
style: style || {},
props: props || {},
children: []
};
};
const createTextInstance = text => ({
type: 'TEXT_INSTANCE',
value: text
});
const appendChild = (parent, child) => {
const isParentText = parent.type === 'TEXT' || parent.type === 'LINK' || parent.type === 'TSPAN' || parent.type === 'NOTE';
const isChildTextInstance = child.type === 'TEXT_INSTANCE';
const isOrphanTextInstance = isChildTextInstance && !isParentText;
// Ignore orphan text instances.
// Caused by cases such as <>{name && <Text>{name}</Text>}</>
if (isOrphanTextInstance) {
console.warn(`Invalid '${child.value}' string child outside <Text> component`);
return;
}
parent.children.push(child);
};
const appendChildToContainer = (parentInstance, child) => {
if (parentInstance.type === 'ROOT') {
parentInstance.document = child;
} else {
appendChild(parentInstance, child);
}
};
const insertBefore = (parentInstance, child, beforeChild) => {
var _parentInstance$child;
const index = (_parentInstance$child = parentInstance.children) === null || _parentInstance$child === void 0 ? void 0 : _parentInstance$child.indexOf(beforeChild);
if (index === undefined) return;
if (index !== -1 && child) parentInstance.children.splice(index, 0, child);
};
const removeChild = (parentInstance, child) => {
var _parentInstance$child2;
const index = (_parentInstance$child2 = parentInstance.children) === null || _parentInstance$child2 === void 0 ? void 0 : _parentInstance$child2.indexOf(child);
if (index === undefined) return;
if (index !== -1) parentInstance.children.splice(index, 1);
};
const removeChildFromContainer = (parentInstance, child) => {
var _parentInstance$child3;
const index = (_parentInstance$child3 = parentInstance.children) === null || _parentInstance$child3 === void 0 ? void 0 : _parentInstance$child3.indexOf(child);
if (index === undefined) return;
if (index !== -1) parentInstance.children.splice(index, 1);
};
const commitTextUpdate = (textInstance, oldText, newText) => {
textInstance.value = newText;
};
const commitUpdate = (instance, updatePayload, type, oldProps, newProps) => {
const {
style,
...props
} = newProps;
instance.props = props;
instance.style = style;
};
const createRenderer = _ref2 => {
let {
onChange = () => {}
} = _ref2;
return Reconciler({
appendChild,
appendChildToContainer,
commitTextUpdate,
commitUpdate,
createInstance,
createTextInstance,
insertBefore,
removeChild,
removeChildFromContainer,
resetAfterCommit: onChange
});
};
var version$1 = "4.5.1";
var packageJson = {
version: version$1};
const {
version
} = packageJson;
const fontStore = new FontStore();
// We must keep a single renderer instance, otherwise React will complain
let renderer;
// The pdf instance acts as an event emitter for DOM usage.
// We only want to trigger an update when PDF content changes
const events = {};
const pdf = initialValue => {
const onChange = () => {
var _events$change;
const listeners = ((_events$change = events.change) === null || _events$change === void 0 ? void 0 : _events$change.slice()) || [];
for (let i = 0; i < listeners.length; i += 1) listeners[i]();
};
const container = {
type: 'ROOT',
document: null
};
renderer = renderer || createRenderer({
onChange
});
const mountNode = renderer.createContainer(container);
const updateContainer = (doc, callback) => {
renderer.updateContainer(doc, mountNode, null, callback);
};
if (initialValue) updateContainer(initialValue);
const render = async function (compress) {
if (compress === void 0) {
compress = true;
}
const props = container.document.props || {};
const {
pdfVersion,
language,
pageLayout,
pageMode,
title,
author,
subject,
keywords,
creator = 'react-pdf',
producer = 'react-pdf',
creationDate = new Date(),
modificationDate,
ownerPassword,
userPassword,
permissions
} = props;
const ctx = new PDFDocument({
compress,
pdfVersion,
lang: language,
displayTitle: true,
autoFirstPage: false,
ownerPassword,
userPassword,
permissions,
pageLayout,
info: omitNils({
Title: title,
Author: author,
Subject: subject,
Keywords: keywords,
Creator: creator,
Producer: producer,
CreationDate: creationDate,
ModificationDate: modificationDate
})
});
if (pageMode) {
ctx._root.data.PageMode = upperFirst(pageMode);
}
const layout = await layoutDocument(container.document, fontStore);
const fileStream = renderPDF(ctx, layout);
return {
layout,
fileStream
};
};
const callOnRender = function (params) {
if (params === void 0) {
params = {};
}
if (container.document.props.onRender) {
container.document.props.onRender(params);
}
};
const toBlob = async () => {
const chunks = [];
const {
layout: _INTERNAL__LAYOUT__DATA_,
fileStream: instance
} = await render();
return new Promise((resolve, reject) => {
instance.on('data', chunk => {
chunks.push(chunk instanceof Uint8Array ? chunk : new Uint8Array(chunk));
});
instance.on('end', () => {
try {
const blob = new Blob(chunks, {
type: 'application/pdf'
});
callOnRender({
blob,
_INTERNAL__LAYOUT__DATA_
});
resolve(blob);
} catch (error) {
reject(error);
}
});
});
};
// TODO: rename this method to `toStream` in next major release, because it return stream not a buffer
const toBuffer = async () => {
const {
layout: _INTERNAL__LAYOUT__DATA_,
fileStream
} = await render();
callOnRender({
_INTERNAL__LAYOUT__DATA_
});
return fileStream;
};
/*
* TODO: remove this method in next major release. it is buggy
* see
* - https://github.com/diegomura/react-pdf/issues/2112
* - https://github.com/diegomura/react-pdf/issues/2095
*/
const toString = async () => {
if (process.env.NODE_ENV === 'development') {
console.warn('`toString` is deprecated and will be removed in next major release');
}
let result = '';
const {
fileStream: instance
} = await render(false); // For some reason, when rendering to string if compress=true the document is blank
return new Promise((resolve, reject) => {
try {
instance.on('data', buffer => {
result += buffer;
});
instance.on('end', () => {
callOnRender();
resolve(result);
});
} catch (error) {
reject(error);
}
});
};
const on = (event, listener) => {
if (!events[event]) events[event] = [];
events[event].push(listener);
};
const removeListener = (event, listener) => {
if (!events[event]) return;
const idx = events[event].indexOf(listener);
if (idx > -1) events[event].splice(idx, 1);
};
return {
on,
container,
toBlob,
toBuffer,
toString,
removeListener,
updateContainer
};
};
const Font = fontStore;
const StyleSheet = {
create: s => s
};
/**
* PDF hook
*
* @param {Object} [options] hook options
* @returns {[Object, Function]} pdf state and update function
*/
const usePDF = function (_temp) {
let {
document
} = _temp === void 0 ? {} : _temp;
const pdfInstance = useRef(null);
const [state, setState] = useState({
url: null,
blob: null,
error: null,
loading: !!document
});
// Setup rendering queue
useEffect(() => {
const renderQueue = queue({
autostart: true,
concurrency: 1
});
const queueDocumentRender = () => {
setState(prev => ({
...prev,
loading: true
}));
renderQueue.splice(0, renderQueue.length, () => state.error ? Promise.resolve() : pdfInstance.current.toBlob());
};
const onRenderFailed = error => {
console.error(error);
setState(prev => ({
...prev,
loading: false,
error
}));
};
const onRenderSuccessful = blob => {
setState({
blob,
error: null,
loading: false,
url: URL.createObjectURL(blob)
});
};
pdfInstance.current = pdf();
pdfInstance.current.on('change', queueDocumentRender);
if (document) {
pdfInstance.current.updateContainer(document);
}
renderQueue.on('error', onRenderFailed);
renderQueue.on('success', onRenderSuccessful);
return () => {
renderQueue.end();
pdfInstance.current.removeListener('change', queueDocumentRender);
};
}, []);
// Revoke old unused url instances
useEffect(() => {
return () => {
if (state.url) {
URL.revokeObjectURL(state.url);
}
};
}, [state.url]);
const update = useCallback(newDoc => {
pdfInstance.current.updateContainer(newDoc);
}, []);
return [state, update];
};
const PDFViewer = _ref => {
let {
title,
style,
className,
children,
innerRef,
showToolbar = true,
...props
} = _ref;
const [instance, updateInstance] = usePDF();
useEffect(() => updateInstance(children), [children]);
const src = instance.url ? `${instance.url}#toolbar=${showToolbar ? 1 : 0}` : null;
return /*#__PURE__*/jsx("iframe", {
src: src,
title: title,
ref: innerRef,
style: style,
className: className,
...props
});
};
const BlobProvider = _ref => {
let {
document: doc,
children
} = _ref;
const [instance, updateInstance] = usePDF();
useEffect(() => updateInstance(doc), [doc]);
if (!doc) {
console.warn('You should pass a valid document to BlobProvider');
return null;
}
return children(instance);
};
const PDFDownloadLinkBase = (_ref, ref) => {
let {
fileName = 'document.pdf',
document: doc,
children,
onClick,
href,
...rest
} = _ref;
const [instance, updateInstance] = usePDF();
useEffect(() => updateInstance(doc), [doc]);
if (!doc) {
console.warn('You should pass a valid document to PDFDownloadLink');
return null;
}
const handleDownloadIE = () => {
if (instance && window.navigator.msSaveBlob) {
// IE
window.navigator.msSaveBlob(instance.blob, fileName);
}
};
const handleClick = event => {
handleDownloadIE();
if (typeof onClick === 'function') onClick(event, instance);
};
return /*#__PURE__*/jsx("a", {
href: instance.url,
download: fileName,
onClick: handleClick,
ref: ref,
...rest,
children: typeof children === 'function' ? children(instance) : children
});
};
const PDFDownloadLink = /*#__PURE__*/forwardRef(PDFDownloadLinkBase);
const throwEnvironmentError = name => {
throw new Error(`${name} is a Node specific API. You're either using this method in a browser, or your bundler is not loading react-pdf from the appropriate web build.`);
};
const renderToStream = () => {
throwEnvironmentError('renderToStream');
};
const renderToBuffer = () => {
throwEnvironmentError('renderToBuffer');
};
const renderToString = () => {
throwEnvironmentError('renderToString');
};
const renderToFile = () => {
throwEnvironmentError('renderToFile');
};
const render = () => {
throwEnvironmentError('render');
};
// TODO: remove this default export in next major release because it breaks tree-shacking
var index = {
pdf,
usePDF,
Font,
version,
StyleSheet,
PDFViewer,
BlobProvider,
PDFDownloadLink,
renderToStream,
renderToString,
renderToFile,
render,
...primitives
};
export { BlobProvider, Font, PDFDownloadLink, PDFViewer, StyleSheet, createRenderer, index as default, pdf, render, renderToBuffer, renderToFile, renderToStream, renderToString, usePDF, version };
//# sourceMappingURL=react-pdf.browser.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,793 @@
/* eslint-disable max-classes-per-file */
import * as React from 'react';
import {
Style,
PageSize,
FontStore,
PDFVersion,
Orientation,
SourceObject,
SrcSet,
Sizes,
HyphenationCallback,
SVGPresentationAttributes,
Bookmark,
PageLayout,
PageMode,
HitSlop,
} from '@react-pdf/types';
declare class ReactPDF {
static default: typeof ReactPDF;
}
export = ReactPDF;
declare namespace ReactPDF {
interface Styles {
[key: string]: Style;
}
interface OnRenderProps {
blob?: Blob;
}
interface Permissions {
printing?: 'lowResolution' | 'highResolution';
modifying?: boolean;
copying?: boolean;
annotating?: boolean;
fillingForms?: boolean;
contentAccessibility?: boolean;
documentAssembly?: boolean;
}
interface DocumentProps {
style?: Style | Style[];
title?: string;
author?: string;
subject?: string;
creator?: string;
keywords?: string;
producer?: string;
language?: string;
creationDate?: Date;
modificationDate?: Date;
pdfVersion?: PDFVersion;
pageMode?: PageMode;
pageLayout?: PageLayout;
ownerPassword?: string;
userPassword?: string;
permissions?: Permissions;
onRender?: (props: OnRenderProps) => any;
}
/**
* This component represent the PDF document itself. It must be the root
* of your tree element structure, and under no circumstances should it be
* used as children of another react-pdf component. In addition, it should
* only have childs of type <Page />.
*/
export class Document extends React.Component<
React.PropsWithChildren<DocumentProps>
> {}
interface NodeProps {
id?: string;
style?: Style | Style[];
/**
* Render component in all wrapped pages.
* @see https://react-pdf.org/advanced#fixed-components
*/
fixed?: boolean;
/**
* Force the wrapping algorithm to start a new page when rendering the
* element.
* @see https://react-pdf.org/advanced#page-breaks
*/
break?: boolean;
/**
* Hint that no page wrapping should occur between all sibling elements following the element within n points
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
*/
minPresenceAhead?: number;
}
interface PageProps extends NodeProps {
/**
* Enable page wrapping for this page.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
size?: PageSize;
orientation?: Orientation;
dpi?: number;
bookmark?: Bookmark;
}
/**
* Represents single page inside the PDF document, or a subset of them if
* using the wrapping feature. A <Document /> can contain as many pages as
* you want, but ensure not rendering a page inside any component besides
* Document.
*/
export class Page extends React.Component<
React.PropsWithChildren<PageProps>
> {}
interface ViewProps extends NodeProps {
id?: string;
/**
* Enable/disable page wrapping for element.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
render?: (props: {
pageNumber: number;
subPageNumber: number;
}) => React.ReactNode;
}
/**
* The most fundamental component for building a UI and is designed to be
* nested inside other views and can have 0 to many children.
*/
export class View extends React.Component<
React.PropsWithChildren<ViewProps>
> {}
interface BaseImageProps extends NodeProps {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
cache?: boolean;
/**
* A comma-separated list of image sources with width descriptors.
* Works like the HTML img srcSet attribute.
* @example "small.jpg 300w, medium.jpg 600w, large.jpg 900w"
*/
srcSet?: SrcSet;
/**
* The intended display width of the image, used to select the best source
* from srcSet. Accepts a number (in points) or a string.
* Works like the HTML img sizes attribute.
* @example 300
* @example "300"
*/
sizes?: Sizes;
}
interface ImageWithSrcProp extends BaseImageProps {
src: SourceObject;
}
interface ImageWithSourceProp extends BaseImageProps {
source: SourceObject;
}
type ImageProps = ImageWithSrcProp | ImageWithSourceProp;
/**
* A React component for displaying network or local (Node only) JPG or
* PNG images, as well as base64 encoded image strings.
*/
export class Image extends React.Component<ImageProps> {}
interface BaseImageBackgroundProps extends NodeProps {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
cache?: boolean;
/**
* A comma-separated list of image sources with width descriptors.
* Works like the HTML img srcSet attribute.
* @example "small.jpg 300w, medium.jpg 600w, large.jpg 900w"
*/
srcSet?: SrcSet;
/**
* The intended display width of the image, used to select the best source
* from srcSet. Accepts a number (in points) or a string.
* @example 300
*/
sizes?: Sizes;
/**
* Style applied to the background image.
*/
imageStyle?: Style;
}
interface ImageBackgroundWithSrcProp extends BaseImageBackgroundProps {
src: SourceObject;
}
interface ImageBackgroundWithSourceProp extends BaseImageBackgroundProps {
source: SourceObject;
}
type ImageBackgroundProps =
| ImageBackgroundWithSrcProp
| ImageBackgroundWithSourceProp;
/**
* A React component for displaying an image behind child content.
* Compatible with React Native's ImageBackground component.
* @see https://reactnative.dev/docs/imagebackground
*/
export class ImageBackground extends React.Component<
React.PropsWithChildren<ImageBackgroundProps>
> {}
interface TextProps extends NodeProps {
id?: string;
/**
* Enable/disable page wrapping for element.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
render?: (props: {
pageNumber: number;
totalPages: number;
subPageNumber: number;
subPageTotalPages: number;
}) => React.ReactNode;
/**
* Override the default hyphenation-callback
* @see https://react-pdf.org/fonts#registerhyphenationcallback
*/
hyphenationCallback?: HyphenationCallback;
/**
* Specifies the minimum number of lines in a text element that must be shown at the bottom of a page or its container.
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
*/
orphans?: number;
/**
* Specifies the minimum number of lines in a text element that must be shown at the top of a page or its container..
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
*/
widows?: number;
}
interface SVGTextProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
x: string | number;
y: string | number;
/**
* Override the default hyphenation-callback
* @see https://react-pdf.org/fonts#registerhyphenationcallback
*/
hyphenationCallback?: HyphenationCallback;
}
/**
* A React component for displaying text. Text supports nesting of other
* Text or Link components to create inline styling.
*/
export class Text extends React.Component<
React.PropsWithChildren<TextProps> | SVGTextProps
> {}
interface LinkProps extends NodeProps {
/**
* Enable/disable page wrapping for element.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
href?: string;
src?: string;
/**
* Extends the clickable area of the link beyond its visible bounds.
* Accepts a number (applied to all sides) or an object with top, bottom, left, right.
* @see https://reactnative.dev/docs/view#hitslop
*/
hitSlop?: HitSlop;
}
/**
* A React component for displaying a hyperlink. Links can be nested
* inside a Text component, or being inside any other valid primitive.
*/
export class Link extends React.Component<
React.PropsWithChildren<LinkProps>
> {}
interface FormCommonProps extends NodeProps {
name?: string;
required?: boolean;
noExport?: boolean;
readOnly?: boolean;
value?: number | string;
defaultValue?: number | string;
}
interface FieldSetProps extends NodeProps {
name: string;
}
export class FieldSet extends React.Component<
React.PropsWithChildren<FieldSetProps>
> {}
// see http://pdfkit.org/docs/forms.html#text_field_formatting
interface TextInputFormatting {
type:
| 'date'
| 'time'
| 'percent'
| 'number'
| 'zip'
| 'zipPlus4'
| 'phone'
| 'ssn';
param?: string;
nDec?: number;
sepComma?: boolean;
negStyle?: 'MinusBlack' | 'Red' | 'ParensBlack' | 'ParensRed';
currency?: string;
currencyPrepend?: boolean;
}
// see http://pdfkit.org/docs/forms.html#text_field_formatting
interface TextInputProps extends FormCommonProps {
align?: 'left' | 'center' | 'right';
multiline?: boolean;
/**
* The text will be masked (e.g. with asterisks).
*/
password?: boolean;
/**
* If set, text entered in the field is not spell-checked
*/
noSpell?: boolean;
format?: TextInputFormatting;
/**
* Sets the fontSize (default or 0 means auto sizing)
*/
fontSize?: number;
/**
* Sets the maximum length (characters) of the text in the field
*/
maxLength?: number;
}
export class TextInput extends React.Component<TextInputProps> {}
interface CheckboxProps extends FormCommonProps {
backgroundColor?: string;
borderColor?: string;
checked?: boolean;
onState?: string;
offState?: string;
xMark?: boolean;
}
export class Checkbox extends React.Component<CheckboxProps> {}
interface SelectAndListPropsBase extends FormCommonProps {
sort?: boolean;
edit?: boolean;
multiSelect?: boolean;
noSpell?: boolean;
select?: string[];
}
type SelectAndListPropsWithEdit = SelectAndListPropsBase & {
edit: true | false;
noSpell: boolean;
};
type SelectAndListPropsWithNoSpell = SelectAndListPropsBase & {
edit: boolean;
noSpell: true | false;
};
type SelectAndListProps =
| SelectAndListPropsWithEdit
| SelectAndListPropsWithNoSpell;
export class Select extends React.Component<SelectAndListProps> {}
export class List extends React.Component<SelectAndListProps> {}
interface NoteProps extends NodeProps {
children: string;
}
export class Note extends React.Component<NoteProps> {}
interface CanvasProps extends NodeProps {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
paint: (
painter: any,
availableWidth: number,
availableHeight: number,
) => null;
}
export class Canvas extends React.Component<CanvasProps> {}
interface SVGProps extends NodeProps, SVGPresentationAttributes {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
width?: string | number;
height?: string | number;
viewBox?: string;
preserveAspectRatio?: string;
}
/**
* The <SVG /> element is a container that defines a new coordinate system and viewport. It is used as the outermost element of SVG documents.
*/
export class Svg extends React.Component<React.PropsWithChildren<SVGProps>> {}
interface LineProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
x1: string | number;
x2: string | number;
y1: string | number;
y2: string | number;
}
/**
* The <Line /> element is used to create a line.
*/
export class Line extends React.Component<
React.PropsWithChildren<LineProps>
> {}
interface PolylineProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
points: string;
}
/**
* The <Polyline /> element is used to create any shape that consists of only straight lines (that is connected at several points).
*/
export class Polyline extends React.Component<
React.PropsWithChildren<PolylineProps>
> {}
interface PolygonProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
points: string;
}
/**
* The <Polygon /> element is used to create a graphic that contains at least three sides.
* Polygons are made of straight lines, and the shape is "closed" (all the lines connect up).
*/
export class Polygon extends React.Component<
React.PropsWithChildren<PolygonProps>
> {}
interface PathProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
d: string;
}
/**
* The <Path /> element is the most powerful element in the SVG library of basic shapes. It can be used to create lines, curves, arcs, and more.
*/
export class Path extends React.Component<
React.PropsWithChildren<PathProps>
> {}
interface RectProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
x?: string | number;
y?: string | number;
width: string | number;
height: string | number;
rx?: string | number;
ry?: string | number;
}
/**
* The <Rect /> element is used to create a rectangle and variations of a rectangle shape.
*/
export class Rect extends React.Component<
React.PropsWithChildren<RectProps>
> {}
interface CircleProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
cx?: string | number;
cy?: string | number;
r: string | number;
}
/**
* The <Circle /> element is used to create a circle.
*/
export class Circle extends React.Component<
React.PropsWithChildren<CircleProps>
> {}
interface EllipseProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
cx?: string | number;
cy?: string | number;
rx: string | number;
ry: string | number;
}
/**
* The <Ellipse /> element is used to create an ellipse.
* An ellipse is closely related to a circle. The difference is that an ellipse has an x and a y radius that differs from each other, while a circle has equal x and y radius.
*/
export class Ellipse extends React.Component<
React.PropsWithChildren<EllipseProps>
> {}
interface TspanProps extends SVGPresentationAttributes {
x?: string | number;
y?: string | number;
}
/**
* The <Tspan /> element defines a subtext within a <Text /> element or another <Tspan /> element.
* It allows for adjustment of the style and/or position of that subtext as needed.
*/
export class Tspan extends React.Component<
React.PropsWithChildren<TspanProps>
> {}
interface GProps extends SVGPresentationAttributes {
style?: Style;
}
/**
* The <G /> SVG element is a container used to group other SVG elements.
* Transformations applied to the <G /> element are performed on its child elements, and its attributes are inherited by its children.
*/
export class G extends React.Component<React.PropsWithChildren<GProps>> {}
interface StopProps {
offset: string | number;
stopColor: string;
stopOpacity?: string | number;
}
/**
* The SVG <Stop /> element defines a color and its position to use on a gradient. This element is always a child of a <LinearGradient /> or <RadialGradient /> element
*/
export class Stop extends React.Component<
React.PropsWithChildren<StopProps>
> {}
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
interface DefsProps {}
/**
* The <Defs /> element is used to store graphical objects that will be used at a later time. Objects created inside a <Defs /> element are not rendered directly. To display them you have to reference them
*/
export class Defs extends React.Component<
React.PropsWithChildren<DefsProps>
> {}
interface ClipPathProps {
id?: string;
}
/**
* The <ClipPath /> SVG element defines a clipping path, to be used by the clipPath property.
* A clipping path restricts the region to which paint can be applied. Conceptually, parts of the drawing that lie outside of the region bounded by the clipping path are not drawn.
*/
export class ClipPath extends React.Component<
React.PropsWithChildren<ClipPathProps>
> {}
interface MarkerProps {
id: string;
viewBox?: string;
refX?: string | number;
refY?: string | number;
markerWidth?: string | number;
markerHeight?: string | number;
orient?: 'auto' | 'auto-start-reverse' | number;
markerUnits?: 'strokeWidth' | 'userSpaceOnUse';
}
/**
* The <Marker /> SVG element defines a graphic used for drawing arrows or polymarkers on a given <Path />, <Line />, <Polyline />, or <Polygon /> element.
* Markers can be attached to shapes using the markerStart, markerMid, and markerEnd properties.
*/
export class Marker extends React.Component<
React.PropsWithChildren<MarkerProps>
> {}
interface LinearGradientProps {
id: string;
x1?: string | number;
x2?: string | number;
y1?: string | number;
y2?: string | number;
xlinkHref?: string;
gradientTransform?: string;
gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
}
/**
* The <LinearGradient /> element lets authors define linear gradients that can be applied to fill or stroke of graphical elements.
*/
export class LinearGradient extends React.Component<
React.PropsWithChildren<LinearGradientProps>
> {}
interface RadialGradientProps {
id: string;
cx?: string | number;
cy?: string | number;
r?: string | number;
fx?: string | number;
fy?: string | number;
xlinkHref?: string;
gradientTransform?: string;
gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
}
/**
* The <RadialGradient /> element lets authors define radial gradients that can be applied to fill or stroke of graphical elements.
*/
export class RadialGradient extends React.Component<
React.PropsWithChildren<RadialGradientProps>
> {}
interface BlobProviderParams {
blob: Blob | null;
url: string | null;
loading: boolean;
error: Error | null;
}
interface BlobProviderProps {
document: React.ReactElement<DocumentProps>;
children: (params: BlobProviderParams) => React.ReactNode;
}
/**
* Easy and declarative way of getting document's blob data without
* showing it on screen.
* @see https://react-pdf.org/advanced#on-the-fly-rendering
* @platform web
*/
export class BlobProvider extends React.Component<BlobProviderProps> {}
interface PDFViewerProps {
width?: number | string;
height?: number | string;
style?: Style | Style[];
className?: string;
children?: React.ReactElement<DocumentProps>;
innerRef?: React.Ref<HTMLIFrameElement>;
showToolbar?: boolean;
}
/**
* Iframe PDF viewer for client-side generated documents.
* @platform web
*/
export class PDFViewer extends React.Component<PDFViewerProps> {}
interface PDFDownloadLinkProps
extends Omit<
React.AnchorHTMLAttributes<HTMLAnchorElement>,
'href' | 'children'
> {
/** PDF filename. Alias for anchor tag `download` attribute. */
fileName?: string;
document: React.ReactElement<DocumentProps>;
children?: React.ReactNode | React.FC<BlobProviderParams>;
onClick?: React.AnchorHTMLAttributes<HTMLAnchorElement>['onClick'] &
((
event: React.MouseEvent<HTMLAnchorElement, MouseEvent>,
instance: UsePDFInstance,
) => void);
ref?: React.Ref<HTMLAnchorElement> | undefined;
}
/**
* Anchor tag to enable generate and download PDF documents on the fly.
* @see https://react-pdf.org/advanced#on-the-fly-rendering
* @platform web
*/
export class PDFDownloadLink extends React.Component<PDFDownloadLinkProps> {}
interface UsePDFInstance {
loading: boolean;
blob: Blob | null;
url: string | null;
error: string | null;
}
/**
* React hook for creating and updating a PDF document instance
* @platform web
*/
export function usePDF(options?: {
document?: React.ReactElement<DocumentProps>;
}): [
UsePDFInstance,
(newDocument: React.ReactElement<DocumentProps>) => void,
];
export const Font: FontStore;
export const StyleSheet: {
create: <T extends Styles>(styles: T) => T;
};
export const version: any;
export const PDFRenderer: any;
export const pdf: (initialValue?: React.ReactElement<DocumentProps>) => {
container: any;
isDirty: () => boolean;
toString: () => string;
toBlob: () => Promise<Blob>;
toBuffer: () => Promise<NodeJS.ReadableStream>;
on: (event: 'change', callback: () => void) => void;
updateContainer: (
document: React.ReactElement<any>,
callback?: () => void,
) => void;
removeListener: (event: 'change', callback: () => void) => void;
};
export const renderToStream: (
document: React.ReactElement<DocumentProps>,
) => Promise<NodeJS.ReadableStream>;
/**
* @deprecated use the `renderToBuffer` method
*/
export const renderToString: (
document: React.ReactElement<DocumentProps>,
) => Promise<string>;
export const renderToFile: (
document: React.ReactElement<DocumentProps>,
filePath: string,
callback?: (output: NodeJS.ReadableStream, _filePath: string) => any,
) => Promise<NodeJS.ReadableStream>;
const render: typeof renderToFile;
/**
* Render document into a nodejs buffer
* @platform node
*/
export const renderToBuffer: (
document: React.ReactElement<ReactPDF.DocumentProps>,
) => Promise<Buffer>;
}

View File

@@ -0,0 +1,793 @@
/* eslint-disable max-classes-per-file */
import * as React from 'react';
import {
Style,
PageSize,
FontStore,
PDFVersion,
Orientation,
SourceObject,
SrcSet,
Sizes,
HyphenationCallback,
SVGPresentationAttributes,
Bookmark,
PageLayout,
PageMode,
HitSlop,
} from '@react-pdf/types';
declare class ReactPDF {
static default: typeof ReactPDF;
}
export = ReactPDF;
declare namespace ReactPDF {
interface Styles {
[key: string]: Style;
}
interface OnRenderProps {
blob?: Blob;
}
interface Permissions {
printing?: 'lowResolution' | 'highResolution';
modifying?: boolean;
copying?: boolean;
annotating?: boolean;
fillingForms?: boolean;
contentAccessibility?: boolean;
documentAssembly?: boolean;
}
interface DocumentProps {
style?: Style | Style[];
title?: string;
author?: string;
subject?: string;
creator?: string;
keywords?: string;
producer?: string;
language?: string;
creationDate?: Date;
modificationDate?: Date;
pdfVersion?: PDFVersion;
pageMode?: PageMode;
pageLayout?: PageLayout;
ownerPassword?: string;
userPassword?: string;
permissions?: Permissions;
onRender?: (props: OnRenderProps) => any;
}
/**
* This component represent the PDF document itself. It must be the root
* of your tree element structure, and under no circumstances should it be
* used as children of another react-pdf component. In addition, it should
* only have childs of type <Page />.
*/
export class Document extends React.Component<
React.PropsWithChildren<DocumentProps>
> {}
interface NodeProps {
id?: string;
style?: Style | Style[];
/**
* Render component in all wrapped pages.
* @see https://react-pdf.org/advanced#fixed-components
*/
fixed?: boolean;
/**
* Force the wrapping algorithm to start a new page when rendering the
* element.
* @see https://react-pdf.org/advanced#page-breaks
*/
break?: boolean;
/**
* Hint that no page wrapping should occur between all sibling elements following the element within n points
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
*/
minPresenceAhead?: number;
}
interface PageProps extends NodeProps {
/**
* Enable page wrapping for this page.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
size?: PageSize;
orientation?: Orientation;
dpi?: number;
bookmark?: Bookmark;
}
/**
* Represents single page inside the PDF document, or a subset of them if
* using the wrapping feature. A <Document /> can contain as many pages as
* you want, but ensure not rendering a page inside any component besides
* Document.
*/
export class Page extends React.Component<
React.PropsWithChildren<PageProps>
> {}
interface ViewProps extends NodeProps {
id?: string;
/**
* Enable/disable page wrapping for element.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
render?: (props: {
pageNumber: number;
subPageNumber: number;
}) => React.ReactNode;
}
/**
* The most fundamental component for building a UI and is designed to be
* nested inside other views and can have 0 to many children.
*/
export class View extends React.Component<
React.PropsWithChildren<ViewProps>
> {}
interface BaseImageProps extends NodeProps {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
cache?: boolean;
/**
* A comma-separated list of image sources with width descriptors.
* Works like the HTML img srcSet attribute.
* @example "small.jpg 300w, medium.jpg 600w, large.jpg 900w"
*/
srcSet?: SrcSet;
/**
* The intended display width of the image, used to select the best source
* from srcSet. Accepts a number (in points) or a string.
* Works like the HTML img sizes attribute.
* @example 300
* @example "300"
*/
sizes?: Sizes;
}
interface ImageWithSrcProp extends BaseImageProps {
src: SourceObject;
}
interface ImageWithSourceProp extends BaseImageProps {
source: SourceObject;
}
type ImageProps = ImageWithSrcProp | ImageWithSourceProp;
/**
* A React component for displaying network or local (Node only) JPG or
* PNG images, as well as base64 encoded image strings.
*/
export class Image extends React.Component<ImageProps> {}
interface BaseImageBackgroundProps extends NodeProps {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
cache?: boolean;
/**
* A comma-separated list of image sources with width descriptors.
* Works like the HTML img srcSet attribute.
* @example "small.jpg 300w, medium.jpg 600w, large.jpg 900w"
*/
srcSet?: SrcSet;
/**
* The intended display width of the image, used to select the best source
* from srcSet. Accepts a number (in points) or a string.
* @example 300
*/
sizes?: Sizes;
/**
* Style applied to the background image.
*/
imageStyle?: Style;
}
interface ImageBackgroundWithSrcProp extends BaseImageBackgroundProps {
src: SourceObject;
}
interface ImageBackgroundWithSourceProp extends BaseImageBackgroundProps {
source: SourceObject;
}
type ImageBackgroundProps =
| ImageBackgroundWithSrcProp
| ImageBackgroundWithSourceProp;
/**
* A React component for displaying an image behind child content.
* Compatible with React Native's ImageBackground component.
* @see https://reactnative.dev/docs/imagebackground
*/
export class ImageBackground extends React.Component<
React.PropsWithChildren<ImageBackgroundProps>
> {}
interface TextProps extends NodeProps {
id?: string;
/**
* Enable/disable page wrapping for element.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
render?: (props: {
pageNumber: number;
totalPages: number;
subPageNumber: number;
subPageTotalPages: number;
}) => React.ReactNode;
/**
* Override the default hyphenation-callback
* @see https://react-pdf.org/fonts#registerhyphenationcallback
*/
hyphenationCallback?: HyphenationCallback;
/**
* Specifies the minimum number of lines in a text element that must be shown at the bottom of a page or its container.
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
*/
orphans?: number;
/**
* Specifies the minimum number of lines in a text element that must be shown at the top of a page or its container..
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
*/
widows?: number;
}
interface SVGTextProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
x: string | number;
y: string | number;
/**
* Override the default hyphenation-callback
* @see https://react-pdf.org/fonts#registerhyphenationcallback
*/
hyphenationCallback?: HyphenationCallback;
}
/**
* A React component for displaying text. Text supports nesting of other
* Text or Link components to create inline styling.
*/
export class Text extends React.Component<
React.PropsWithChildren<TextProps> | SVGTextProps
> {}
interface LinkProps extends NodeProps {
/**
* Enable/disable page wrapping for element.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
href?: string;
src?: string;
/**
* Extends the clickable area of the link beyond its visible bounds.
* Accepts a number (applied to all sides) or an object with top, bottom, left, right.
* @see https://reactnative.dev/docs/view#hitslop
*/
hitSlop?: HitSlop;
}
/**
* A React component for displaying a hyperlink. Links can be nested
* inside a Text component, or being inside any other valid primitive.
*/
export class Link extends React.Component<
React.PropsWithChildren<LinkProps>
> {}
interface FormCommonProps extends NodeProps {
name?: string;
required?: boolean;
noExport?: boolean;
readOnly?: boolean;
value?: number | string;
defaultValue?: number | string;
}
interface FieldSetProps extends NodeProps {
name: string;
}
export class FieldSet extends React.Component<
React.PropsWithChildren<FieldSetProps>
> {}
// see http://pdfkit.org/docs/forms.html#text_field_formatting
interface TextInputFormatting {
type:
| 'date'
| 'time'
| 'percent'
| 'number'
| 'zip'
| 'zipPlus4'
| 'phone'
| 'ssn';
param?: string;
nDec?: number;
sepComma?: boolean;
negStyle?: 'MinusBlack' | 'Red' | 'ParensBlack' | 'ParensRed';
currency?: string;
currencyPrepend?: boolean;
}
// see http://pdfkit.org/docs/forms.html#text_field_formatting
interface TextInputProps extends FormCommonProps {
align?: 'left' | 'center' | 'right';
multiline?: boolean;
/**
* The text will be masked (e.g. with asterisks).
*/
password?: boolean;
/**
* If set, text entered in the field is not spell-checked
*/
noSpell?: boolean;
format?: TextInputFormatting;
/**
* Sets the fontSize (default or 0 means auto sizing)
*/
fontSize?: number;
/**
* Sets the maximum length (characters) of the text in the field
*/
maxLength?: number;
}
export class TextInput extends React.Component<TextInputProps> {}
interface CheckboxProps extends FormCommonProps {
backgroundColor?: string;
borderColor?: string;
checked?: boolean;
onState?: string;
offState?: string;
xMark?: boolean;
}
export class Checkbox extends React.Component<CheckboxProps> {}
interface SelectAndListPropsBase extends FormCommonProps {
sort?: boolean;
edit?: boolean;
multiSelect?: boolean;
noSpell?: boolean;
select?: string[];
}
type SelectAndListPropsWithEdit = SelectAndListPropsBase & {
edit: true | false;
noSpell: boolean;
};
type SelectAndListPropsWithNoSpell = SelectAndListPropsBase & {
edit: boolean;
noSpell: true | false;
};
type SelectAndListProps =
| SelectAndListPropsWithEdit
| SelectAndListPropsWithNoSpell;
export class Select extends React.Component<SelectAndListProps> {}
export class List extends React.Component<SelectAndListProps> {}
interface NoteProps extends NodeProps {
children: string;
}
export class Note extends React.Component<NoteProps> {}
interface CanvasProps extends NodeProps {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
paint: (
painter: any,
availableWidth: number,
availableHeight: number,
) => null;
}
export class Canvas extends React.Component<CanvasProps> {}
interface SVGProps extends NodeProps, SVGPresentationAttributes {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
width?: string | number;
height?: string | number;
viewBox?: string;
preserveAspectRatio?: string;
}
/**
* The <SVG /> element is a container that defines a new coordinate system and viewport. It is used as the outermost element of SVG documents.
*/
export class Svg extends React.Component<React.PropsWithChildren<SVGProps>> {}
interface LineProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
x1: string | number;
x2: string | number;
y1: string | number;
y2: string | number;
}
/**
* The <Line /> element is used to create a line.
*/
export class Line extends React.Component<
React.PropsWithChildren<LineProps>
> {}
interface PolylineProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
points: string;
}
/**
* The <Polyline /> element is used to create any shape that consists of only straight lines (that is connected at several points).
*/
export class Polyline extends React.Component<
React.PropsWithChildren<PolylineProps>
> {}
interface PolygonProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
points: string;
}
/**
* The <Polygon /> element is used to create a graphic that contains at least three sides.
* Polygons are made of straight lines, and the shape is "closed" (all the lines connect up).
*/
export class Polygon extends React.Component<
React.PropsWithChildren<PolygonProps>
> {}
interface PathProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
d: string;
}
/**
* The <Path /> element is the most powerful element in the SVG library of basic shapes. It can be used to create lines, curves, arcs, and more.
*/
export class Path extends React.Component<
React.PropsWithChildren<PathProps>
> {}
interface RectProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
x?: string | number;
y?: string | number;
width: string | number;
height: string | number;
rx?: string | number;
ry?: string | number;
}
/**
* The <Rect /> element is used to create a rectangle and variations of a rectangle shape.
*/
export class Rect extends React.Component<
React.PropsWithChildren<RectProps>
> {}
interface CircleProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
cx?: string | number;
cy?: string | number;
r: string | number;
}
/**
* The <Circle /> element is used to create a circle.
*/
export class Circle extends React.Component<
React.PropsWithChildren<CircleProps>
> {}
interface EllipseProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
cx?: string | number;
cy?: string | number;
rx: string | number;
ry: string | number;
}
/**
* The <Ellipse /> element is used to create an ellipse.
* An ellipse is closely related to a circle. The difference is that an ellipse has an x and a y radius that differs from each other, while a circle has equal x and y radius.
*/
export class Ellipse extends React.Component<
React.PropsWithChildren<EllipseProps>
> {}
interface TspanProps extends SVGPresentationAttributes {
x?: string | number;
y?: string | number;
}
/**
* The <Tspan /> element defines a subtext within a <Text /> element or another <Tspan /> element.
* It allows for adjustment of the style and/or position of that subtext as needed.
*/
export class Tspan extends React.Component<
React.PropsWithChildren<TspanProps>
> {}
interface GProps extends SVGPresentationAttributes {
style?: Style;
}
/**
* The <G /> SVG element is a container used to group other SVG elements.
* Transformations applied to the <G /> element are performed on its child elements, and its attributes are inherited by its children.
*/
export class G extends React.Component<React.PropsWithChildren<GProps>> {}
interface StopProps {
offset: string | number;
stopColor: string;
stopOpacity?: string | number;
}
/**
* The SVG <Stop /> element defines a color and its position to use on a gradient. This element is always a child of a <LinearGradient /> or <RadialGradient /> element
*/
export class Stop extends React.Component<
React.PropsWithChildren<StopProps>
> {}
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
interface DefsProps {}
/**
* The <Defs /> element is used to store graphical objects that will be used at a later time. Objects created inside a <Defs /> element are not rendered directly. To display them you have to reference them
*/
export class Defs extends React.Component<
React.PropsWithChildren<DefsProps>
> {}
interface ClipPathProps {
id?: string;
}
/**
* The <ClipPath /> SVG element defines a clipping path, to be used by the clipPath property.
* A clipping path restricts the region to which paint can be applied. Conceptually, parts of the drawing that lie outside of the region bounded by the clipping path are not drawn.
*/
export class ClipPath extends React.Component<
React.PropsWithChildren<ClipPathProps>
> {}
interface MarkerProps {
id: string;
viewBox?: string;
refX?: string | number;
refY?: string | number;
markerWidth?: string | number;
markerHeight?: string | number;
orient?: 'auto' | 'auto-start-reverse' | number;
markerUnits?: 'strokeWidth' | 'userSpaceOnUse';
}
/**
* The <Marker /> SVG element defines a graphic used for drawing arrows or polymarkers on a given <Path />, <Line />, <Polyline />, or <Polygon /> element.
* Markers can be attached to shapes using the markerStart, markerMid, and markerEnd properties.
*/
export class Marker extends React.Component<
React.PropsWithChildren<MarkerProps>
> {}
interface LinearGradientProps {
id: string;
x1?: string | number;
x2?: string | number;
y1?: string | number;
y2?: string | number;
xlinkHref?: string;
gradientTransform?: string;
gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
}
/**
* The <LinearGradient /> element lets authors define linear gradients that can be applied to fill or stroke of graphical elements.
*/
export class LinearGradient extends React.Component<
React.PropsWithChildren<LinearGradientProps>
> {}
interface RadialGradientProps {
id: string;
cx?: string | number;
cy?: string | number;
r?: string | number;
fx?: string | number;
fy?: string | number;
xlinkHref?: string;
gradientTransform?: string;
gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
}
/**
* The <RadialGradient /> element lets authors define radial gradients that can be applied to fill or stroke of graphical elements.
*/
export class RadialGradient extends React.Component<
React.PropsWithChildren<RadialGradientProps>
> {}
interface BlobProviderParams {
blob: Blob | null;
url: string | null;
loading: boolean;
error: Error | null;
}
interface BlobProviderProps {
document: React.ReactElement<DocumentProps>;
children: (params: BlobProviderParams) => React.ReactNode;
}
/**
* Easy and declarative way of getting document's blob data without
* showing it on screen.
* @see https://react-pdf.org/advanced#on-the-fly-rendering
* @platform web
*/
export class BlobProvider extends React.Component<BlobProviderProps> {}
interface PDFViewerProps {
width?: number | string;
height?: number | string;
style?: Style | Style[];
className?: string;
children?: React.ReactElement<DocumentProps>;
innerRef?: React.Ref<HTMLIFrameElement>;
showToolbar?: boolean;
}
/**
* Iframe PDF viewer for client-side generated documents.
* @platform web
*/
export class PDFViewer extends React.Component<PDFViewerProps> {}
interface PDFDownloadLinkProps
extends Omit<
React.AnchorHTMLAttributes<HTMLAnchorElement>,
'href' | 'children'
> {
/** PDF filename. Alias for anchor tag `download` attribute. */
fileName?: string;
document: React.ReactElement<DocumentProps>;
children?: React.ReactNode | React.FC<BlobProviderParams>;
onClick?: React.AnchorHTMLAttributes<HTMLAnchorElement>['onClick'] &
((
event: React.MouseEvent<HTMLAnchorElement, MouseEvent>,
instance: UsePDFInstance,
) => void);
ref?: React.Ref<HTMLAnchorElement> | undefined;
}
/**
* Anchor tag to enable generate and download PDF documents on the fly.
* @see https://react-pdf.org/advanced#on-the-fly-rendering
* @platform web
*/
export class PDFDownloadLink extends React.Component<PDFDownloadLinkProps> {}
interface UsePDFInstance {
loading: boolean;
blob: Blob | null;
url: string | null;
error: string | null;
}
/**
* React hook for creating and updating a PDF document instance
* @platform web
*/
export function usePDF(options?: {
document?: React.ReactElement<DocumentProps>;
}): [
UsePDFInstance,
(newDocument: React.ReactElement<DocumentProps>) => void,
];
export const Font: FontStore;
export const StyleSheet: {
create: <T extends Styles>(styles: T) => T;
};
export const version: any;
export const PDFRenderer: any;
export const pdf: (initialValue?: React.ReactElement<DocumentProps>) => {
container: any;
isDirty: () => boolean;
toString: () => string;
toBlob: () => Promise<Blob>;
toBuffer: () => Promise<NodeJS.ReadableStream>;
on: (event: 'change', callback: () => void) => void;
updateContainer: (
document: React.ReactElement<any>,
callback?: () => void,
) => void;
removeListener: (event: 'change', callback: () => void) => void;
};
export const renderToStream: (
document: React.ReactElement<DocumentProps>,
) => Promise<NodeJS.ReadableStream>;
/**
* @deprecated use the `renderToBuffer` method
*/
export const renderToString: (
document: React.ReactElement<DocumentProps>,
) => Promise<string>;
export const renderToFile: (
document: React.ReactElement<DocumentProps>,
filePath: string,
callback?: (output: NodeJS.ReadableStream, _filePath: string) => any,
) => Promise<NodeJS.ReadableStream>;
const render: typeof renderToFile;
/**
* Render document into a nodejs buffer
* @platform node
*/
export const renderToBuffer: (
document: React.ReactElement<ReactPDF.DocumentProps>,
) => Promise<Buffer>;
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,793 @@
/* eslint-disable max-classes-per-file */
import * as React from 'react';
import {
Style,
PageSize,
FontStore,
PDFVersion,
Orientation,
SourceObject,
SrcSet,
Sizes,
HyphenationCallback,
SVGPresentationAttributes,
Bookmark,
PageLayout,
PageMode,
HitSlop,
} from '@react-pdf/types';
declare class ReactPDF {
static default: typeof ReactPDF;
}
export = ReactPDF;
declare namespace ReactPDF {
interface Styles {
[key: string]: Style;
}
interface OnRenderProps {
blob?: Blob;
}
interface Permissions {
printing?: 'lowResolution' | 'highResolution';
modifying?: boolean;
copying?: boolean;
annotating?: boolean;
fillingForms?: boolean;
contentAccessibility?: boolean;
documentAssembly?: boolean;
}
interface DocumentProps {
style?: Style | Style[];
title?: string;
author?: string;
subject?: string;
creator?: string;
keywords?: string;
producer?: string;
language?: string;
creationDate?: Date;
modificationDate?: Date;
pdfVersion?: PDFVersion;
pageMode?: PageMode;
pageLayout?: PageLayout;
ownerPassword?: string;
userPassword?: string;
permissions?: Permissions;
onRender?: (props: OnRenderProps) => any;
}
/**
* This component represent the PDF document itself. It must be the root
* of your tree element structure, and under no circumstances should it be
* used as children of another react-pdf component. In addition, it should
* only have childs of type <Page />.
*/
export class Document extends React.Component<
React.PropsWithChildren<DocumentProps>
> {}
interface NodeProps {
id?: string;
style?: Style | Style[];
/**
* Render component in all wrapped pages.
* @see https://react-pdf.org/advanced#fixed-components
*/
fixed?: boolean;
/**
* Force the wrapping algorithm to start a new page when rendering the
* element.
* @see https://react-pdf.org/advanced#page-breaks
*/
break?: boolean;
/**
* Hint that no page wrapping should occur between all sibling elements following the element within n points
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
*/
minPresenceAhead?: number;
}
interface PageProps extends NodeProps {
/**
* Enable page wrapping for this page.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
size?: PageSize;
orientation?: Orientation;
dpi?: number;
bookmark?: Bookmark;
}
/**
* Represents single page inside the PDF document, or a subset of them if
* using the wrapping feature. A <Document /> can contain as many pages as
* you want, but ensure not rendering a page inside any component besides
* Document.
*/
export class Page extends React.Component<
React.PropsWithChildren<PageProps>
> {}
interface ViewProps extends NodeProps {
id?: string;
/**
* Enable/disable page wrapping for element.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
render?: (props: {
pageNumber: number;
subPageNumber: number;
}) => React.ReactNode;
}
/**
* The most fundamental component for building a UI and is designed to be
* nested inside other views and can have 0 to many children.
*/
export class View extends React.Component<
React.PropsWithChildren<ViewProps>
> {}
interface BaseImageProps extends NodeProps {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
cache?: boolean;
/**
* A comma-separated list of image sources with width descriptors.
* Works like the HTML img srcSet attribute.
* @example "small.jpg 300w, medium.jpg 600w, large.jpg 900w"
*/
srcSet?: SrcSet;
/**
* The intended display width of the image, used to select the best source
* from srcSet. Accepts a number (in points) or a string.
* Works like the HTML img sizes attribute.
* @example 300
* @example "300"
*/
sizes?: Sizes;
}
interface ImageWithSrcProp extends BaseImageProps {
src: SourceObject;
}
interface ImageWithSourceProp extends BaseImageProps {
source: SourceObject;
}
type ImageProps = ImageWithSrcProp | ImageWithSourceProp;
/**
* A React component for displaying network or local (Node only) JPG or
* PNG images, as well as base64 encoded image strings.
*/
export class Image extends React.Component<ImageProps> {}
interface BaseImageBackgroundProps extends NodeProps {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
cache?: boolean;
/**
* A comma-separated list of image sources with width descriptors.
* Works like the HTML img srcSet attribute.
* @example "small.jpg 300w, medium.jpg 600w, large.jpg 900w"
*/
srcSet?: SrcSet;
/**
* The intended display width of the image, used to select the best source
* from srcSet. Accepts a number (in points) or a string.
* @example 300
*/
sizes?: Sizes;
/**
* Style applied to the background image.
*/
imageStyle?: Style;
}
interface ImageBackgroundWithSrcProp extends BaseImageBackgroundProps {
src: SourceObject;
}
interface ImageBackgroundWithSourceProp extends BaseImageBackgroundProps {
source: SourceObject;
}
type ImageBackgroundProps =
| ImageBackgroundWithSrcProp
| ImageBackgroundWithSourceProp;
/**
* A React component for displaying an image behind child content.
* Compatible with React Native's ImageBackground component.
* @see https://reactnative.dev/docs/imagebackground
*/
export class ImageBackground extends React.Component<
React.PropsWithChildren<ImageBackgroundProps>
> {}
interface TextProps extends NodeProps {
id?: string;
/**
* Enable/disable page wrapping for element.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
render?: (props: {
pageNumber: number;
totalPages: number;
subPageNumber: number;
subPageTotalPages: number;
}) => React.ReactNode;
/**
* Override the default hyphenation-callback
* @see https://react-pdf.org/fonts#registerhyphenationcallback
*/
hyphenationCallback?: HyphenationCallback;
/**
* Specifies the minimum number of lines in a text element that must be shown at the bottom of a page or its container.
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
*/
orphans?: number;
/**
* Specifies the minimum number of lines in a text element that must be shown at the top of a page or its container..
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
*/
widows?: number;
}
interface SVGTextProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
x: string | number;
y: string | number;
/**
* Override the default hyphenation-callback
* @see https://react-pdf.org/fonts#registerhyphenationcallback
*/
hyphenationCallback?: HyphenationCallback;
}
/**
* A React component for displaying text. Text supports nesting of other
* Text or Link components to create inline styling.
*/
export class Text extends React.Component<
React.PropsWithChildren<TextProps> | SVGTextProps
> {}
interface LinkProps extends NodeProps {
/**
* Enable/disable page wrapping for element.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
href?: string;
src?: string;
/**
* Extends the clickable area of the link beyond its visible bounds.
* Accepts a number (applied to all sides) or an object with top, bottom, left, right.
* @see https://reactnative.dev/docs/view#hitslop
*/
hitSlop?: HitSlop;
}
/**
* A React component for displaying a hyperlink. Links can be nested
* inside a Text component, or being inside any other valid primitive.
*/
export class Link extends React.Component<
React.PropsWithChildren<LinkProps>
> {}
interface FormCommonProps extends NodeProps {
name?: string;
required?: boolean;
noExport?: boolean;
readOnly?: boolean;
value?: number | string;
defaultValue?: number | string;
}
interface FieldSetProps extends NodeProps {
name: string;
}
export class FieldSet extends React.Component<
React.PropsWithChildren<FieldSetProps>
> {}
// see http://pdfkit.org/docs/forms.html#text_field_formatting
interface TextInputFormatting {
type:
| 'date'
| 'time'
| 'percent'
| 'number'
| 'zip'
| 'zipPlus4'
| 'phone'
| 'ssn';
param?: string;
nDec?: number;
sepComma?: boolean;
negStyle?: 'MinusBlack' | 'Red' | 'ParensBlack' | 'ParensRed';
currency?: string;
currencyPrepend?: boolean;
}
// see http://pdfkit.org/docs/forms.html#text_field_formatting
interface TextInputProps extends FormCommonProps {
align?: 'left' | 'center' | 'right';
multiline?: boolean;
/**
* The text will be masked (e.g. with asterisks).
*/
password?: boolean;
/**
* If set, text entered in the field is not spell-checked
*/
noSpell?: boolean;
format?: TextInputFormatting;
/**
* Sets the fontSize (default or 0 means auto sizing)
*/
fontSize?: number;
/**
* Sets the maximum length (characters) of the text in the field
*/
maxLength?: number;
}
export class TextInput extends React.Component<TextInputProps> {}
interface CheckboxProps extends FormCommonProps {
backgroundColor?: string;
borderColor?: string;
checked?: boolean;
onState?: string;
offState?: string;
xMark?: boolean;
}
export class Checkbox extends React.Component<CheckboxProps> {}
interface SelectAndListPropsBase extends FormCommonProps {
sort?: boolean;
edit?: boolean;
multiSelect?: boolean;
noSpell?: boolean;
select?: string[];
}
type SelectAndListPropsWithEdit = SelectAndListPropsBase & {
edit: true | false;
noSpell: boolean;
};
type SelectAndListPropsWithNoSpell = SelectAndListPropsBase & {
edit: boolean;
noSpell: true | false;
};
type SelectAndListProps =
| SelectAndListPropsWithEdit
| SelectAndListPropsWithNoSpell;
export class Select extends React.Component<SelectAndListProps> {}
export class List extends React.Component<SelectAndListProps> {}
interface NoteProps extends NodeProps {
children: string;
}
export class Note extends React.Component<NoteProps> {}
interface CanvasProps extends NodeProps {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
paint: (
painter: any,
availableWidth: number,
availableHeight: number,
) => null;
}
export class Canvas extends React.Component<CanvasProps> {}
interface SVGProps extends NodeProps, SVGPresentationAttributes {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
width?: string | number;
height?: string | number;
viewBox?: string;
preserveAspectRatio?: string;
}
/**
* The <SVG /> element is a container that defines a new coordinate system and viewport. It is used as the outermost element of SVG documents.
*/
export class Svg extends React.Component<React.PropsWithChildren<SVGProps>> {}
interface LineProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
x1: string | number;
x2: string | number;
y1: string | number;
y2: string | number;
}
/**
* The <Line /> element is used to create a line.
*/
export class Line extends React.Component<
React.PropsWithChildren<LineProps>
> {}
interface PolylineProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
points: string;
}
/**
* The <Polyline /> element is used to create any shape that consists of only straight lines (that is connected at several points).
*/
export class Polyline extends React.Component<
React.PropsWithChildren<PolylineProps>
> {}
interface PolygonProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
points: string;
}
/**
* The <Polygon /> element is used to create a graphic that contains at least three sides.
* Polygons are made of straight lines, and the shape is "closed" (all the lines connect up).
*/
export class Polygon extends React.Component<
React.PropsWithChildren<PolygonProps>
> {}
interface PathProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
d: string;
}
/**
* The <Path /> element is the most powerful element in the SVG library of basic shapes. It can be used to create lines, curves, arcs, and more.
*/
export class Path extends React.Component<
React.PropsWithChildren<PathProps>
> {}
interface RectProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
x?: string | number;
y?: string | number;
width: string | number;
height: string | number;
rx?: string | number;
ry?: string | number;
}
/**
* The <Rect /> element is used to create a rectangle and variations of a rectangle shape.
*/
export class Rect extends React.Component<
React.PropsWithChildren<RectProps>
> {}
interface CircleProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
cx?: string | number;
cy?: string | number;
r: string | number;
}
/**
* The <Circle /> element is used to create a circle.
*/
export class Circle extends React.Component<
React.PropsWithChildren<CircleProps>
> {}
interface EllipseProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
cx?: string | number;
cy?: string | number;
rx: string | number;
ry: string | number;
}
/**
* The <Ellipse /> element is used to create an ellipse.
* An ellipse is closely related to a circle. The difference is that an ellipse has an x and a y radius that differs from each other, while a circle has equal x and y radius.
*/
export class Ellipse extends React.Component<
React.PropsWithChildren<EllipseProps>
> {}
interface TspanProps extends SVGPresentationAttributes {
x?: string | number;
y?: string | number;
}
/**
* The <Tspan /> element defines a subtext within a <Text /> element or another <Tspan /> element.
* It allows for adjustment of the style and/or position of that subtext as needed.
*/
export class Tspan extends React.Component<
React.PropsWithChildren<TspanProps>
> {}
interface GProps extends SVGPresentationAttributes {
style?: Style;
}
/**
* The <G /> SVG element is a container used to group other SVG elements.
* Transformations applied to the <G /> element are performed on its child elements, and its attributes are inherited by its children.
*/
export class G extends React.Component<React.PropsWithChildren<GProps>> {}
interface StopProps {
offset: string | number;
stopColor: string;
stopOpacity?: string | number;
}
/**
* The SVG <Stop /> element defines a color and its position to use on a gradient. This element is always a child of a <LinearGradient /> or <RadialGradient /> element
*/
export class Stop extends React.Component<
React.PropsWithChildren<StopProps>
> {}
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
interface DefsProps {}
/**
* The <Defs /> element is used to store graphical objects that will be used at a later time. Objects created inside a <Defs /> element are not rendered directly. To display them you have to reference them
*/
export class Defs extends React.Component<
React.PropsWithChildren<DefsProps>
> {}
interface ClipPathProps {
id?: string;
}
/**
* The <ClipPath /> SVG element defines a clipping path, to be used by the clipPath property.
* A clipping path restricts the region to which paint can be applied. Conceptually, parts of the drawing that lie outside of the region bounded by the clipping path are not drawn.
*/
export class ClipPath extends React.Component<
React.PropsWithChildren<ClipPathProps>
> {}
interface MarkerProps {
id: string;
viewBox?: string;
refX?: string | number;
refY?: string | number;
markerWidth?: string | number;
markerHeight?: string | number;
orient?: 'auto' | 'auto-start-reverse' | number;
markerUnits?: 'strokeWidth' | 'userSpaceOnUse';
}
/**
* The <Marker /> SVG element defines a graphic used for drawing arrows or polymarkers on a given <Path />, <Line />, <Polyline />, or <Polygon /> element.
* Markers can be attached to shapes using the markerStart, markerMid, and markerEnd properties.
*/
export class Marker extends React.Component<
React.PropsWithChildren<MarkerProps>
> {}
interface LinearGradientProps {
id: string;
x1?: string | number;
x2?: string | number;
y1?: string | number;
y2?: string | number;
xlinkHref?: string;
gradientTransform?: string;
gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
}
/**
* The <LinearGradient /> element lets authors define linear gradients that can be applied to fill or stroke of graphical elements.
*/
export class LinearGradient extends React.Component<
React.PropsWithChildren<LinearGradientProps>
> {}
interface RadialGradientProps {
id: string;
cx?: string | number;
cy?: string | number;
r?: string | number;
fx?: string | number;
fy?: string | number;
xlinkHref?: string;
gradientTransform?: string;
gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
}
/**
* The <RadialGradient /> element lets authors define radial gradients that can be applied to fill or stroke of graphical elements.
*/
export class RadialGradient extends React.Component<
React.PropsWithChildren<RadialGradientProps>
> {}
interface BlobProviderParams {
blob: Blob | null;
url: string | null;
loading: boolean;
error: Error | null;
}
interface BlobProviderProps {
document: React.ReactElement<DocumentProps>;
children: (params: BlobProviderParams) => React.ReactNode;
}
/**
* Easy and declarative way of getting document's blob data without
* showing it on screen.
* @see https://react-pdf.org/advanced#on-the-fly-rendering
* @platform web
*/
export class BlobProvider extends React.Component<BlobProviderProps> {}
interface PDFViewerProps {
width?: number | string;
height?: number | string;
style?: Style | Style[];
className?: string;
children?: React.ReactElement<DocumentProps>;
innerRef?: React.Ref<HTMLIFrameElement>;
showToolbar?: boolean;
}
/**
* Iframe PDF viewer for client-side generated documents.
* @platform web
*/
export class PDFViewer extends React.Component<PDFViewerProps> {}
interface PDFDownloadLinkProps
extends Omit<
React.AnchorHTMLAttributes<HTMLAnchorElement>,
'href' | 'children'
> {
/** PDF filename. Alias for anchor tag `download` attribute. */
fileName?: string;
document: React.ReactElement<DocumentProps>;
children?: React.ReactNode | React.FC<BlobProviderParams>;
onClick?: React.AnchorHTMLAttributes<HTMLAnchorElement>['onClick'] &
((
event: React.MouseEvent<HTMLAnchorElement, MouseEvent>,
instance: UsePDFInstance,
) => void);
ref?: React.Ref<HTMLAnchorElement> | undefined;
}
/**
* Anchor tag to enable generate and download PDF documents on the fly.
* @see https://react-pdf.org/advanced#on-the-fly-rendering
* @platform web
*/
export class PDFDownloadLink extends React.Component<PDFDownloadLinkProps> {}
interface UsePDFInstance {
loading: boolean;
blob: Blob | null;
url: string | null;
error: string | null;
}
/**
* React hook for creating and updating a PDF document instance
* @platform web
*/
export function usePDF(options?: {
document?: React.ReactElement<DocumentProps>;
}): [
UsePDFInstance,
(newDocument: React.ReactElement<DocumentProps>) => void,
];
export const Font: FontStore;
export const StyleSheet: {
create: <T extends Styles>(styles: T) => T;
};
export const version: any;
export const PDFRenderer: any;
export const pdf: (initialValue?: React.ReactElement<DocumentProps>) => {
container: any;
isDirty: () => boolean;
toString: () => string;
toBlob: () => Promise<Blob>;
toBuffer: () => Promise<NodeJS.ReadableStream>;
on: (event: 'change', callback: () => void) => void;
updateContainer: (
document: React.ReactElement<any>,
callback?: () => void,
) => void;
removeListener: (event: 'change', callback: () => void) => void;
};
export const renderToStream: (
document: React.ReactElement<DocumentProps>,
) => Promise<NodeJS.ReadableStream>;
/**
* @deprecated use the `renderToBuffer` method
*/
export const renderToString: (
document: React.ReactElement<DocumentProps>,
) => Promise<string>;
export const renderToFile: (
document: React.ReactElement<DocumentProps>,
filePath: string,
callback?: (output: NodeJS.ReadableStream, _filePath: string) => any,
) => Promise<NodeJS.ReadableStream>;
const render: typeof renderToFile;
/**
* Render document into a nodejs buffer
* @platform node
*/
export const renderToBuffer: (
document: React.ReactElement<ReactPDF.DocumentProps>,
) => Promise<Buffer>;
}

View File

@@ -0,0 +1,793 @@
/* eslint-disable max-classes-per-file */
import * as React from 'react';
import {
Style,
PageSize,
FontStore,
PDFVersion,
Orientation,
SourceObject,
SrcSet,
Sizes,
HyphenationCallback,
SVGPresentationAttributes,
Bookmark,
PageLayout,
PageMode,
HitSlop,
} from '@react-pdf/types';
declare class ReactPDF {
static default: typeof ReactPDF;
}
export = ReactPDF;
declare namespace ReactPDF {
interface Styles {
[key: string]: Style;
}
interface OnRenderProps {
blob?: Blob;
}
interface Permissions {
printing?: 'lowResolution' | 'highResolution';
modifying?: boolean;
copying?: boolean;
annotating?: boolean;
fillingForms?: boolean;
contentAccessibility?: boolean;
documentAssembly?: boolean;
}
interface DocumentProps {
style?: Style | Style[];
title?: string;
author?: string;
subject?: string;
creator?: string;
keywords?: string;
producer?: string;
language?: string;
creationDate?: Date;
modificationDate?: Date;
pdfVersion?: PDFVersion;
pageMode?: PageMode;
pageLayout?: PageLayout;
ownerPassword?: string;
userPassword?: string;
permissions?: Permissions;
onRender?: (props: OnRenderProps) => any;
}
/**
* This component represent the PDF document itself. It must be the root
* of your tree element structure, and under no circumstances should it be
* used as children of another react-pdf component. In addition, it should
* only have childs of type <Page />.
*/
export class Document extends React.Component<
React.PropsWithChildren<DocumentProps>
> {}
interface NodeProps {
id?: string;
style?: Style | Style[];
/**
* Render component in all wrapped pages.
* @see https://react-pdf.org/advanced#fixed-components
*/
fixed?: boolean;
/**
* Force the wrapping algorithm to start a new page when rendering the
* element.
* @see https://react-pdf.org/advanced#page-breaks
*/
break?: boolean;
/**
* Hint that no page wrapping should occur between all sibling elements following the element within n points
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
*/
minPresenceAhead?: number;
}
interface PageProps extends NodeProps {
/**
* Enable page wrapping for this page.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
size?: PageSize;
orientation?: Orientation;
dpi?: number;
bookmark?: Bookmark;
}
/**
* Represents single page inside the PDF document, or a subset of them if
* using the wrapping feature. A <Document /> can contain as many pages as
* you want, but ensure not rendering a page inside any component besides
* Document.
*/
export class Page extends React.Component<
React.PropsWithChildren<PageProps>
> {}
interface ViewProps extends NodeProps {
id?: string;
/**
* Enable/disable page wrapping for element.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
render?: (props: {
pageNumber: number;
subPageNumber: number;
}) => React.ReactNode;
}
/**
* The most fundamental component for building a UI and is designed to be
* nested inside other views and can have 0 to many children.
*/
export class View extends React.Component<
React.PropsWithChildren<ViewProps>
> {}
interface BaseImageProps extends NodeProps {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
cache?: boolean;
/**
* A comma-separated list of image sources with width descriptors.
* Works like the HTML img srcSet attribute.
* @example "small.jpg 300w, medium.jpg 600w, large.jpg 900w"
*/
srcSet?: SrcSet;
/**
* The intended display width of the image, used to select the best source
* from srcSet. Accepts a number (in points) or a string.
* Works like the HTML img sizes attribute.
* @example 300
* @example "300"
*/
sizes?: Sizes;
}
interface ImageWithSrcProp extends BaseImageProps {
src: SourceObject;
}
interface ImageWithSourceProp extends BaseImageProps {
source: SourceObject;
}
type ImageProps = ImageWithSrcProp | ImageWithSourceProp;
/**
* A React component for displaying network or local (Node only) JPG or
* PNG images, as well as base64 encoded image strings.
*/
export class Image extends React.Component<ImageProps> {}
interface BaseImageBackgroundProps extends NodeProps {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
cache?: boolean;
/**
* A comma-separated list of image sources with width descriptors.
* Works like the HTML img srcSet attribute.
* @example "small.jpg 300w, medium.jpg 600w, large.jpg 900w"
*/
srcSet?: SrcSet;
/**
* The intended display width of the image, used to select the best source
* from srcSet. Accepts a number (in points) or a string.
* @example 300
*/
sizes?: Sizes;
/**
* Style applied to the background image.
*/
imageStyle?: Style;
}
interface ImageBackgroundWithSrcProp extends BaseImageBackgroundProps {
src: SourceObject;
}
interface ImageBackgroundWithSourceProp extends BaseImageBackgroundProps {
source: SourceObject;
}
type ImageBackgroundProps =
| ImageBackgroundWithSrcProp
| ImageBackgroundWithSourceProp;
/**
* A React component for displaying an image behind child content.
* Compatible with React Native's ImageBackground component.
* @see https://reactnative.dev/docs/imagebackground
*/
export class ImageBackground extends React.Component<
React.PropsWithChildren<ImageBackgroundProps>
> {}
interface TextProps extends NodeProps {
id?: string;
/**
* Enable/disable page wrapping for element.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
render?: (props: {
pageNumber: number;
totalPages: number;
subPageNumber: number;
subPageTotalPages: number;
}) => React.ReactNode;
/**
* Override the default hyphenation-callback
* @see https://react-pdf.org/fonts#registerhyphenationcallback
*/
hyphenationCallback?: HyphenationCallback;
/**
* Specifies the minimum number of lines in a text element that must be shown at the bottom of a page or its container.
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
*/
orphans?: number;
/**
* Specifies the minimum number of lines in a text element that must be shown at the top of a page or its container..
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
*/
widows?: number;
}
interface SVGTextProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
x: string | number;
y: string | number;
/**
* Override the default hyphenation-callback
* @see https://react-pdf.org/fonts#registerhyphenationcallback
*/
hyphenationCallback?: HyphenationCallback;
}
/**
* A React component for displaying text. Text supports nesting of other
* Text or Link components to create inline styling.
*/
export class Text extends React.Component<
React.PropsWithChildren<TextProps> | SVGTextProps
> {}
interface LinkProps extends NodeProps {
/**
* Enable/disable page wrapping for element.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
href?: string;
src?: string;
/**
* Extends the clickable area of the link beyond its visible bounds.
* Accepts a number (applied to all sides) or an object with top, bottom, left, right.
* @see https://reactnative.dev/docs/view#hitslop
*/
hitSlop?: HitSlop;
}
/**
* A React component for displaying a hyperlink. Links can be nested
* inside a Text component, or being inside any other valid primitive.
*/
export class Link extends React.Component<
React.PropsWithChildren<LinkProps>
> {}
interface FormCommonProps extends NodeProps {
name?: string;
required?: boolean;
noExport?: boolean;
readOnly?: boolean;
value?: number | string;
defaultValue?: number | string;
}
interface FieldSetProps extends NodeProps {
name: string;
}
export class FieldSet extends React.Component<
React.PropsWithChildren<FieldSetProps>
> {}
// see http://pdfkit.org/docs/forms.html#text_field_formatting
interface TextInputFormatting {
type:
| 'date'
| 'time'
| 'percent'
| 'number'
| 'zip'
| 'zipPlus4'
| 'phone'
| 'ssn';
param?: string;
nDec?: number;
sepComma?: boolean;
negStyle?: 'MinusBlack' | 'Red' | 'ParensBlack' | 'ParensRed';
currency?: string;
currencyPrepend?: boolean;
}
// see http://pdfkit.org/docs/forms.html#text_field_formatting
interface TextInputProps extends FormCommonProps {
align?: 'left' | 'center' | 'right';
multiline?: boolean;
/**
* The text will be masked (e.g. with asterisks).
*/
password?: boolean;
/**
* If set, text entered in the field is not spell-checked
*/
noSpell?: boolean;
format?: TextInputFormatting;
/**
* Sets the fontSize (default or 0 means auto sizing)
*/
fontSize?: number;
/**
* Sets the maximum length (characters) of the text in the field
*/
maxLength?: number;
}
export class TextInput extends React.Component<TextInputProps> {}
interface CheckboxProps extends FormCommonProps {
backgroundColor?: string;
borderColor?: string;
checked?: boolean;
onState?: string;
offState?: string;
xMark?: boolean;
}
export class Checkbox extends React.Component<CheckboxProps> {}
interface SelectAndListPropsBase extends FormCommonProps {
sort?: boolean;
edit?: boolean;
multiSelect?: boolean;
noSpell?: boolean;
select?: string[];
}
type SelectAndListPropsWithEdit = SelectAndListPropsBase & {
edit: true | false;
noSpell: boolean;
};
type SelectAndListPropsWithNoSpell = SelectAndListPropsBase & {
edit: boolean;
noSpell: true | false;
};
type SelectAndListProps =
| SelectAndListPropsWithEdit
| SelectAndListPropsWithNoSpell;
export class Select extends React.Component<SelectAndListProps> {}
export class List extends React.Component<SelectAndListProps> {}
interface NoteProps extends NodeProps {
children: string;
}
export class Note extends React.Component<NoteProps> {}
interface CanvasProps extends NodeProps {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
paint: (
painter: any,
availableWidth: number,
availableHeight: number,
) => null;
}
export class Canvas extends React.Component<CanvasProps> {}
interface SVGProps extends NodeProps, SVGPresentationAttributes {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
width?: string | number;
height?: string | number;
viewBox?: string;
preserveAspectRatio?: string;
}
/**
* The <SVG /> element is a container that defines a new coordinate system and viewport. It is used as the outermost element of SVG documents.
*/
export class Svg extends React.Component<React.PropsWithChildren<SVGProps>> {}
interface LineProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
x1: string | number;
x2: string | number;
y1: string | number;
y2: string | number;
}
/**
* The <Line /> element is used to create a line.
*/
export class Line extends React.Component<
React.PropsWithChildren<LineProps>
> {}
interface PolylineProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
points: string;
}
/**
* The <Polyline /> element is used to create any shape that consists of only straight lines (that is connected at several points).
*/
export class Polyline extends React.Component<
React.PropsWithChildren<PolylineProps>
> {}
interface PolygonProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
points: string;
}
/**
* The <Polygon /> element is used to create a graphic that contains at least three sides.
* Polygons are made of straight lines, and the shape is "closed" (all the lines connect up).
*/
export class Polygon extends React.Component<
React.PropsWithChildren<PolygonProps>
> {}
interface PathProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
d: string;
}
/**
* The <Path /> element is the most powerful element in the SVG library of basic shapes. It can be used to create lines, curves, arcs, and more.
*/
export class Path extends React.Component<
React.PropsWithChildren<PathProps>
> {}
interface RectProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
x?: string | number;
y?: string | number;
width: string | number;
height: string | number;
rx?: string | number;
ry?: string | number;
}
/**
* The <Rect /> element is used to create a rectangle and variations of a rectangle shape.
*/
export class Rect extends React.Component<
React.PropsWithChildren<RectProps>
> {}
interface CircleProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
cx?: string | number;
cy?: string | number;
r: string | number;
}
/**
* The <Circle /> element is used to create a circle.
*/
export class Circle extends React.Component<
React.PropsWithChildren<CircleProps>
> {}
interface EllipseProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
cx?: string | number;
cy?: string | number;
rx: string | number;
ry: string | number;
}
/**
* The <Ellipse /> element is used to create an ellipse.
* An ellipse is closely related to a circle. The difference is that an ellipse has an x and a y radius that differs from each other, while a circle has equal x and y radius.
*/
export class Ellipse extends React.Component<
React.PropsWithChildren<EllipseProps>
> {}
interface TspanProps extends SVGPresentationAttributes {
x?: string | number;
y?: string | number;
}
/**
* The <Tspan /> element defines a subtext within a <Text /> element or another <Tspan /> element.
* It allows for adjustment of the style and/or position of that subtext as needed.
*/
export class Tspan extends React.Component<
React.PropsWithChildren<TspanProps>
> {}
interface GProps extends SVGPresentationAttributes {
style?: Style;
}
/**
* The <G /> SVG element is a container used to group other SVG elements.
* Transformations applied to the <G /> element are performed on its child elements, and its attributes are inherited by its children.
*/
export class G extends React.Component<React.PropsWithChildren<GProps>> {}
interface StopProps {
offset: string | number;
stopColor: string;
stopOpacity?: string | number;
}
/**
* The SVG <Stop /> element defines a color and its position to use on a gradient. This element is always a child of a <LinearGradient /> or <RadialGradient /> element
*/
export class Stop extends React.Component<
React.PropsWithChildren<StopProps>
> {}
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
interface DefsProps {}
/**
* The <Defs /> element is used to store graphical objects that will be used at a later time. Objects created inside a <Defs /> element are not rendered directly. To display them you have to reference them
*/
export class Defs extends React.Component<
React.PropsWithChildren<DefsProps>
> {}
interface ClipPathProps {
id?: string;
}
/**
* The <ClipPath /> SVG element defines a clipping path, to be used by the clipPath property.
* A clipping path restricts the region to which paint can be applied. Conceptually, parts of the drawing that lie outside of the region bounded by the clipping path are not drawn.
*/
export class ClipPath extends React.Component<
React.PropsWithChildren<ClipPathProps>
> {}
interface MarkerProps {
id: string;
viewBox?: string;
refX?: string | number;
refY?: string | number;
markerWidth?: string | number;
markerHeight?: string | number;
orient?: 'auto' | 'auto-start-reverse' | number;
markerUnits?: 'strokeWidth' | 'userSpaceOnUse';
}
/**
* The <Marker /> SVG element defines a graphic used for drawing arrows or polymarkers on a given <Path />, <Line />, <Polyline />, or <Polygon /> element.
* Markers can be attached to shapes using the markerStart, markerMid, and markerEnd properties.
*/
export class Marker extends React.Component<
React.PropsWithChildren<MarkerProps>
> {}
interface LinearGradientProps {
id: string;
x1?: string | number;
x2?: string | number;
y1?: string | number;
y2?: string | number;
xlinkHref?: string;
gradientTransform?: string;
gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
}
/**
* The <LinearGradient /> element lets authors define linear gradients that can be applied to fill or stroke of graphical elements.
*/
export class LinearGradient extends React.Component<
React.PropsWithChildren<LinearGradientProps>
> {}
interface RadialGradientProps {
id: string;
cx?: string | number;
cy?: string | number;
r?: string | number;
fx?: string | number;
fy?: string | number;
xlinkHref?: string;
gradientTransform?: string;
gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
}
/**
* The <RadialGradient /> element lets authors define radial gradients that can be applied to fill or stroke of graphical elements.
*/
export class RadialGradient extends React.Component<
React.PropsWithChildren<RadialGradientProps>
> {}
interface BlobProviderParams {
blob: Blob | null;
url: string | null;
loading: boolean;
error: Error | null;
}
interface BlobProviderProps {
document: React.ReactElement<DocumentProps>;
children: (params: BlobProviderParams) => React.ReactNode;
}
/**
* Easy and declarative way of getting document's blob data without
* showing it on screen.
* @see https://react-pdf.org/advanced#on-the-fly-rendering
* @platform web
*/
export class BlobProvider extends React.Component<BlobProviderProps> {}
interface PDFViewerProps {
width?: number | string;
height?: number | string;
style?: Style | Style[];
className?: string;
children?: React.ReactElement<DocumentProps>;
innerRef?: React.Ref<HTMLIFrameElement>;
showToolbar?: boolean;
}
/**
* Iframe PDF viewer for client-side generated documents.
* @platform web
*/
export class PDFViewer extends React.Component<PDFViewerProps> {}
interface PDFDownloadLinkProps
extends Omit<
React.AnchorHTMLAttributes<HTMLAnchorElement>,
'href' | 'children'
> {
/** PDF filename. Alias for anchor tag `download` attribute. */
fileName?: string;
document: React.ReactElement<DocumentProps>;
children?: React.ReactNode | React.FC<BlobProviderParams>;
onClick?: React.AnchorHTMLAttributes<HTMLAnchorElement>['onClick'] &
((
event: React.MouseEvent<HTMLAnchorElement, MouseEvent>,
instance: UsePDFInstance,
) => void);
ref?: React.Ref<HTMLAnchorElement> | undefined;
}
/**
* Anchor tag to enable generate and download PDF documents on the fly.
* @see https://react-pdf.org/advanced#on-the-fly-rendering
* @platform web
*/
export class PDFDownloadLink extends React.Component<PDFDownloadLinkProps> {}
interface UsePDFInstance {
loading: boolean;
blob: Blob | null;
url: string | null;
error: string | null;
}
/**
* React hook for creating and updating a PDF document instance
* @platform web
*/
export function usePDF(options?: {
document?: React.ReactElement<DocumentProps>;
}): [
UsePDFInstance,
(newDocument: React.ReactElement<DocumentProps>) => void,
];
export const Font: FontStore;
export const StyleSheet: {
create: <T extends Styles>(styles: T) => T;
};
export const version: any;
export const PDFRenderer: any;
export const pdf: (initialValue?: React.ReactElement<DocumentProps>) => {
container: any;
isDirty: () => boolean;
toString: () => string;
toBlob: () => Promise<Blob>;
toBuffer: () => Promise<NodeJS.ReadableStream>;
on: (event: 'change', callback: () => void) => void;
updateContainer: (
document: React.ReactElement<any>,
callback?: () => void,
) => void;
removeListener: (event: 'change', callback: () => void) => void;
};
export const renderToStream: (
document: React.ReactElement<DocumentProps>,
) => Promise<NodeJS.ReadableStream>;
/**
* @deprecated use the `renderToBuffer` method
*/
export const renderToString: (
document: React.ReactElement<DocumentProps>,
) => Promise<string>;
export const renderToFile: (
document: React.ReactElement<DocumentProps>,
filePath: string,
callback?: (output: NodeJS.ReadableStream, _filePath: string) => any,
) => Promise<NodeJS.ReadableStream>;
const render: typeof renderToFile;
/**
* Render document into a nodejs buffer
* @platform node
*/
export const renderToBuffer: (
document: React.ReactElement<ReactPDF.DocumentProps>,
) => Promise<Buffer>;
}

View File

@@ -0,0 +1,368 @@
import * as primitives from '@react-pdf/primitives';
export * from '@react-pdf/primitives';
import fs from 'fs';
import { Buffer } from 'buffer';
import FontStore from '@react-pdf/font';
import renderPDF from '@react-pdf/render';
import PDFDocument from '@react-pdf/pdfkit';
import layoutDocument from '@react-pdf/layout';
import { upperFirst } from '@react-pdf/fns';
import Reconciler from '@react-pdf/reconciler';
const omitNils = object => Object.fromEntries(Object.entries(object).filter(_ref => {
let [, value] = _ref;
return value !== undefined;
}));
const createInstance = (type, _ref) => {
let {
style,
children,
...props
} = _ref;
return {
type,
box: {},
style: style || {},
props: props || {},
children: []
};
};
const createTextInstance = text => ({
type: 'TEXT_INSTANCE',
value: text
});
const appendChild = (parent, child) => {
const isParentText = parent.type === 'TEXT' || parent.type === 'LINK' || parent.type === 'TSPAN' || parent.type === 'NOTE';
const isChildTextInstance = child.type === 'TEXT_INSTANCE';
const isOrphanTextInstance = isChildTextInstance && !isParentText;
// Ignore orphan text instances.
// Caused by cases such as <>{name && <Text>{name}</Text>}</>
if (isOrphanTextInstance) {
console.warn(`Invalid '${child.value}' string child outside <Text> component`);
return;
}
parent.children.push(child);
};
const appendChildToContainer = (parentInstance, child) => {
if (parentInstance.type === 'ROOT') {
parentInstance.document = child;
} else {
appendChild(parentInstance, child);
}
};
const insertBefore = (parentInstance, child, beforeChild) => {
var _parentInstance$child;
const index = (_parentInstance$child = parentInstance.children) === null || _parentInstance$child === void 0 ? void 0 : _parentInstance$child.indexOf(beforeChild);
if (index === undefined) return;
if (index !== -1 && child) parentInstance.children.splice(index, 0, child);
};
const removeChild = (parentInstance, child) => {
var _parentInstance$child2;
const index = (_parentInstance$child2 = parentInstance.children) === null || _parentInstance$child2 === void 0 ? void 0 : _parentInstance$child2.indexOf(child);
if (index === undefined) return;
if (index !== -1) parentInstance.children.splice(index, 1);
};
const removeChildFromContainer = (parentInstance, child) => {
var _parentInstance$child3;
const index = (_parentInstance$child3 = parentInstance.children) === null || _parentInstance$child3 === void 0 ? void 0 : _parentInstance$child3.indexOf(child);
if (index === undefined) return;
if (index !== -1) parentInstance.children.splice(index, 1);
};
const commitTextUpdate = (textInstance, oldText, newText) => {
textInstance.value = newText;
};
const commitUpdate = (instance, updatePayload, type, oldProps, newProps) => {
const {
style,
...props
} = newProps;
instance.props = props;
instance.style = style;
};
const createRenderer = _ref2 => {
let {
onChange = () => {}
} = _ref2;
return Reconciler({
appendChild,
appendChildToContainer,
commitTextUpdate,
commitUpdate,
createInstance,
createTextInstance,
insertBefore,
removeChild,
removeChildFromContainer,
resetAfterCommit: onChange
});
};
var version$1 = "4.5.1";
var packageJson = {
version: version$1};
const {
version
} = packageJson;
const fontStore = new FontStore();
// We must keep a single renderer instance, otherwise React will complain
let renderer;
// The pdf instance acts as an event emitter for DOM usage.
// We only want to trigger an update when PDF content changes
const events = {};
const pdf = initialValue => {
const onChange = () => {
var _events$change;
const listeners = ((_events$change = events.change) === null || _events$change === void 0 ? void 0 : _events$change.slice()) || [];
for (let i = 0; i < listeners.length; i += 1) listeners[i]();
};
const container = {
type: 'ROOT',
document: null
};
renderer = renderer || createRenderer({
onChange
});
const mountNode = renderer.createContainer(container);
const updateContainer = (doc, callback) => {
renderer.updateContainer(doc, mountNode, null, callback);
};
if (initialValue) updateContainer(initialValue);
const render = async function (compress) {
if (compress === void 0) {
compress = true;
}
const props = container.document.props || {};
const {
pdfVersion,
language,
pageLayout,
pageMode,
title,
author,
subject,
keywords,
creator = 'react-pdf',
producer = 'react-pdf',
creationDate = new Date(),
modificationDate,
ownerPassword,
userPassword,
permissions
} = props;
const ctx = new PDFDocument({
compress,
pdfVersion,
lang: language,
displayTitle: true,
autoFirstPage: false,
ownerPassword,
userPassword,
permissions,
pageLayout,
info: omitNils({
Title: title,
Author: author,
Subject: subject,
Keywords: keywords,
Creator: creator,
Producer: producer,
CreationDate: creationDate,
ModificationDate: modificationDate
})
});
if (pageMode) {
ctx._root.data.PageMode = upperFirst(pageMode);
}
const layout = await layoutDocument(container.document, fontStore);
const fileStream = renderPDF(ctx, layout);
return {
layout,
fileStream
};
};
const callOnRender = function (params) {
if (params === void 0) {
params = {};
}
if (container.document.props.onRender) {
container.document.props.onRender(params);
}
};
const toBlob = async () => {
const chunks = [];
const {
layout: _INTERNAL__LAYOUT__DATA_,
fileStream: instance
} = await render();
return new Promise((resolve, reject) => {
instance.on('data', chunk => {
chunks.push(chunk instanceof Uint8Array ? chunk : new Uint8Array(chunk));
});
instance.on('end', () => {
try {
const blob = new Blob(chunks, {
type: 'application/pdf'
});
callOnRender({
blob,
_INTERNAL__LAYOUT__DATA_
});
resolve(blob);
} catch (error) {
reject(error);
}
});
});
};
// TODO: rename this method to `toStream` in next major release, because it return stream not a buffer
const toBuffer = async () => {
const {
layout: _INTERNAL__LAYOUT__DATA_,
fileStream
} = await render();
callOnRender({
_INTERNAL__LAYOUT__DATA_
});
return fileStream;
};
/*
* TODO: remove this method in next major release. it is buggy
* see
* - https://github.com/diegomura/react-pdf/issues/2112
* - https://github.com/diegomura/react-pdf/issues/2095
*/
const toString = async () => {
if (process.env.NODE_ENV === 'development') {
console.warn('`toString` is deprecated and will be removed in next major release');
}
let result = '';
const {
fileStream: instance
} = await render(false); // For some reason, when rendering to string if compress=true the document is blank
return new Promise((resolve, reject) => {
try {
instance.on('data', buffer => {
result += buffer;
});
instance.on('end', () => {
callOnRender();
resolve(result);
});
} catch (error) {
reject(error);
}
});
};
const on = (event, listener) => {
if (!events[event]) events[event] = [];
events[event].push(listener);
};
const removeListener = (event, listener) => {
if (!events[event]) return;
const idx = events[event].indexOf(listener);
if (idx > -1) events[event].splice(idx, 1);
};
return {
on,
container,
toBlob,
toBuffer,
toString,
removeListener,
updateContainer
};
};
const Font = fontStore;
const StyleSheet = {
create: s => s
};
/**
* @param {React.ReactElement} element
* @returns {Promise<NodeJS.ReadableStream>}
*/
const renderToStream = async element => {
const instance = pdf(element);
const stream = await instance.toBuffer();
return stream;
};
/**
* @param {React.ReactElement} element
* @param {string} filePath
* @param {Function} [callback]
*/
const renderToFile = async (element, filePath, callback) => {
const output = await renderToStream(element);
const stream = fs.createWriteStream(filePath);
output.pipe(stream);
return new Promise((resolve, reject) => {
stream.on('finish', () => {
if (callback) callback(output, filePath);
resolve(output);
});
stream.on('error', reject);
});
};
/**
* @param {React.ReactElement} element
* @returns {Promise<Buffer>}
*/
const renderToBuffer = element => renderToStream(element).then(stream => new Promise((resolve, reject) => {
const chunks = [];
stream.on('data', chunk => chunks.push(chunk));
stream.on('end', () => resolve(Buffer.concat(chunks)));
stream.on('error', error => reject(error));
}));
const renderToString = element => {
if (process.env.NODE_ENV === 'development') {
console.warn('`renderToString` is deprecated and will be removed in next major release, use `renderToBuffer` instead');
}
return renderToBuffer(element).then(buffer => buffer.toString());
};
const throwEnvironmentError = name => {
throw new Error(`${name} is a web specific API. You're either using this component on Node, or your bundler is not loading react-pdf from the appropriate web build.`);
};
const usePDF = () => {
throwEnvironmentError('usePDF');
};
const PDFViewer = () => {
throwEnvironmentError('PDFViewer');
};
const PDFDownloadLink = () => {
throwEnvironmentError('PDFDownloadLink');
};
const BlobProvider = () => {
throwEnvironmentError('BlobProvider');
};
const render = renderToFile;
// TODO: remove this default export in next major release because it breaks tree-shacking
var index = {
pdf,
Font,
version,
StyleSheet,
usePDF,
PDFViewer,
BlobProvider,
PDFDownloadLink,
renderToStream,
renderToString,
renderToFile,
render,
...primitives
};
export { BlobProvider, Font, PDFDownloadLink, PDFViewer, StyleSheet, createRenderer, index as default, pdf, render, renderToBuffer, renderToFile, renderToStream, renderToString, usePDF, version };
//# sourceMappingURL=react-pdf.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,793 @@
/* eslint-disable max-classes-per-file */
import * as React from 'react';
import {
Style,
PageSize,
FontStore,
PDFVersion,
Orientation,
SourceObject,
SrcSet,
Sizes,
HyphenationCallback,
SVGPresentationAttributes,
Bookmark,
PageLayout,
PageMode,
HitSlop,
} from '@react-pdf/types';
declare class ReactPDF {
static default: typeof ReactPDF;
}
export = ReactPDF;
declare namespace ReactPDF {
interface Styles {
[key: string]: Style;
}
interface OnRenderProps {
blob?: Blob;
}
interface Permissions {
printing?: 'lowResolution' | 'highResolution';
modifying?: boolean;
copying?: boolean;
annotating?: boolean;
fillingForms?: boolean;
contentAccessibility?: boolean;
documentAssembly?: boolean;
}
interface DocumentProps {
style?: Style | Style[];
title?: string;
author?: string;
subject?: string;
creator?: string;
keywords?: string;
producer?: string;
language?: string;
creationDate?: Date;
modificationDate?: Date;
pdfVersion?: PDFVersion;
pageMode?: PageMode;
pageLayout?: PageLayout;
ownerPassword?: string;
userPassword?: string;
permissions?: Permissions;
onRender?: (props: OnRenderProps) => any;
}
/**
* This component represent the PDF document itself. It must be the root
* of your tree element structure, and under no circumstances should it be
* used as children of another react-pdf component. In addition, it should
* only have childs of type <Page />.
*/
export class Document extends React.Component<
React.PropsWithChildren<DocumentProps>
> {}
interface NodeProps {
id?: string;
style?: Style | Style[];
/**
* Render component in all wrapped pages.
* @see https://react-pdf.org/advanced#fixed-components
*/
fixed?: boolean;
/**
* Force the wrapping algorithm to start a new page when rendering the
* element.
* @see https://react-pdf.org/advanced#page-breaks
*/
break?: boolean;
/**
* Hint that no page wrapping should occur between all sibling elements following the element within n points
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
*/
minPresenceAhead?: number;
}
interface PageProps extends NodeProps {
/**
* Enable page wrapping for this page.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
size?: PageSize;
orientation?: Orientation;
dpi?: number;
bookmark?: Bookmark;
}
/**
* Represents single page inside the PDF document, or a subset of them if
* using the wrapping feature. A <Document /> can contain as many pages as
* you want, but ensure not rendering a page inside any component besides
* Document.
*/
export class Page extends React.Component<
React.PropsWithChildren<PageProps>
> {}
interface ViewProps extends NodeProps {
id?: string;
/**
* Enable/disable page wrapping for element.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
render?: (props: {
pageNumber: number;
subPageNumber: number;
}) => React.ReactNode;
}
/**
* The most fundamental component for building a UI and is designed to be
* nested inside other views and can have 0 to many children.
*/
export class View extends React.Component<
React.PropsWithChildren<ViewProps>
> {}
interface BaseImageProps extends NodeProps {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
cache?: boolean;
/**
* A comma-separated list of image sources with width descriptors.
* Works like the HTML img srcSet attribute.
* @example "small.jpg 300w, medium.jpg 600w, large.jpg 900w"
*/
srcSet?: SrcSet;
/**
* The intended display width of the image, used to select the best source
* from srcSet. Accepts a number (in points) or a string.
* Works like the HTML img sizes attribute.
* @example 300
* @example "300"
*/
sizes?: Sizes;
}
interface ImageWithSrcProp extends BaseImageProps {
src: SourceObject;
}
interface ImageWithSourceProp extends BaseImageProps {
source: SourceObject;
}
type ImageProps = ImageWithSrcProp | ImageWithSourceProp;
/**
* A React component for displaying network or local (Node only) JPG or
* PNG images, as well as base64 encoded image strings.
*/
export class Image extends React.Component<ImageProps> {}
interface BaseImageBackgroundProps extends NodeProps {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
cache?: boolean;
/**
* A comma-separated list of image sources with width descriptors.
* Works like the HTML img srcSet attribute.
* @example "small.jpg 300w, medium.jpg 600w, large.jpg 900w"
*/
srcSet?: SrcSet;
/**
* The intended display width of the image, used to select the best source
* from srcSet. Accepts a number (in points) or a string.
* @example 300
*/
sizes?: Sizes;
/**
* Style applied to the background image.
*/
imageStyle?: Style;
}
interface ImageBackgroundWithSrcProp extends BaseImageBackgroundProps {
src: SourceObject;
}
interface ImageBackgroundWithSourceProp extends BaseImageBackgroundProps {
source: SourceObject;
}
type ImageBackgroundProps =
| ImageBackgroundWithSrcProp
| ImageBackgroundWithSourceProp;
/**
* A React component for displaying an image behind child content.
* Compatible with React Native's ImageBackground component.
* @see https://reactnative.dev/docs/imagebackground
*/
export class ImageBackground extends React.Component<
React.PropsWithChildren<ImageBackgroundProps>
> {}
interface TextProps extends NodeProps {
id?: string;
/**
* Enable/disable page wrapping for element.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
render?: (props: {
pageNumber: number;
totalPages: number;
subPageNumber: number;
subPageTotalPages: number;
}) => React.ReactNode;
/**
* Override the default hyphenation-callback
* @see https://react-pdf.org/fonts#registerhyphenationcallback
*/
hyphenationCallback?: HyphenationCallback;
/**
* Specifies the minimum number of lines in a text element that must be shown at the bottom of a page or its container.
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
*/
orphans?: number;
/**
* Specifies the minimum number of lines in a text element that must be shown at the top of a page or its container..
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
*/
widows?: number;
}
interface SVGTextProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
x: string | number;
y: string | number;
/**
* Override the default hyphenation-callback
* @see https://react-pdf.org/fonts#registerhyphenationcallback
*/
hyphenationCallback?: HyphenationCallback;
}
/**
* A React component for displaying text. Text supports nesting of other
* Text or Link components to create inline styling.
*/
export class Text extends React.Component<
React.PropsWithChildren<TextProps> | SVGTextProps
> {}
interface LinkProps extends NodeProps {
/**
* Enable/disable page wrapping for element.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
href?: string;
src?: string;
/**
* Extends the clickable area of the link beyond its visible bounds.
* Accepts a number (applied to all sides) or an object with top, bottom, left, right.
* @see https://reactnative.dev/docs/view#hitslop
*/
hitSlop?: HitSlop;
}
/**
* A React component for displaying a hyperlink. Links can be nested
* inside a Text component, or being inside any other valid primitive.
*/
export class Link extends React.Component<
React.PropsWithChildren<LinkProps>
> {}
interface FormCommonProps extends NodeProps {
name?: string;
required?: boolean;
noExport?: boolean;
readOnly?: boolean;
value?: number | string;
defaultValue?: number | string;
}
interface FieldSetProps extends NodeProps {
name: string;
}
export class FieldSet extends React.Component<
React.PropsWithChildren<FieldSetProps>
> {}
// see http://pdfkit.org/docs/forms.html#text_field_formatting
interface TextInputFormatting {
type:
| 'date'
| 'time'
| 'percent'
| 'number'
| 'zip'
| 'zipPlus4'
| 'phone'
| 'ssn';
param?: string;
nDec?: number;
sepComma?: boolean;
negStyle?: 'MinusBlack' | 'Red' | 'ParensBlack' | 'ParensRed';
currency?: string;
currencyPrepend?: boolean;
}
// see http://pdfkit.org/docs/forms.html#text_field_formatting
interface TextInputProps extends FormCommonProps {
align?: 'left' | 'center' | 'right';
multiline?: boolean;
/**
* The text will be masked (e.g. with asterisks).
*/
password?: boolean;
/**
* If set, text entered in the field is not spell-checked
*/
noSpell?: boolean;
format?: TextInputFormatting;
/**
* Sets the fontSize (default or 0 means auto sizing)
*/
fontSize?: number;
/**
* Sets the maximum length (characters) of the text in the field
*/
maxLength?: number;
}
export class TextInput extends React.Component<TextInputProps> {}
interface CheckboxProps extends FormCommonProps {
backgroundColor?: string;
borderColor?: string;
checked?: boolean;
onState?: string;
offState?: string;
xMark?: boolean;
}
export class Checkbox extends React.Component<CheckboxProps> {}
interface SelectAndListPropsBase extends FormCommonProps {
sort?: boolean;
edit?: boolean;
multiSelect?: boolean;
noSpell?: boolean;
select?: string[];
}
type SelectAndListPropsWithEdit = SelectAndListPropsBase & {
edit: true | false;
noSpell: boolean;
};
type SelectAndListPropsWithNoSpell = SelectAndListPropsBase & {
edit: boolean;
noSpell: true | false;
};
type SelectAndListProps =
| SelectAndListPropsWithEdit
| SelectAndListPropsWithNoSpell;
export class Select extends React.Component<SelectAndListProps> {}
export class List extends React.Component<SelectAndListProps> {}
interface NoteProps extends NodeProps {
children: string;
}
export class Note extends React.Component<NoteProps> {}
interface CanvasProps extends NodeProps {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
paint: (
painter: any,
availableWidth: number,
availableHeight: number,
) => null;
}
export class Canvas extends React.Component<CanvasProps> {}
interface SVGProps extends NodeProps, SVGPresentationAttributes {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
width?: string | number;
height?: string | number;
viewBox?: string;
preserveAspectRatio?: string;
}
/**
* The <SVG /> element is a container that defines a new coordinate system and viewport. It is used as the outermost element of SVG documents.
*/
export class Svg extends React.Component<React.PropsWithChildren<SVGProps>> {}
interface LineProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
x1: string | number;
x2: string | number;
y1: string | number;
y2: string | number;
}
/**
* The <Line /> element is used to create a line.
*/
export class Line extends React.Component<
React.PropsWithChildren<LineProps>
> {}
interface PolylineProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
points: string;
}
/**
* The <Polyline /> element is used to create any shape that consists of only straight lines (that is connected at several points).
*/
export class Polyline extends React.Component<
React.PropsWithChildren<PolylineProps>
> {}
interface PolygonProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
points: string;
}
/**
* The <Polygon /> element is used to create a graphic that contains at least three sides.
* Polygons are made of straight lines, and the shape is "closed" (all the lines connect up).
*/
export class Polygon extends React.Component<
React.PropsWithChildren<PolygonProps>
> {}
interface PathProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
d: string;
}
/**
* The <Path /> element is the most powerful element in the SVG library of basic shapes. It can be used to create lines, curves, arcs, and more.
*/
export class Path extends React.Component<
React.PropsWithChildren<PathProps>
> {}
interface RectProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
x?: string | number;
y?: string | number;
width: string | number;
height: string | number;
rx?: string | number;
ry?: string | number;
}
/**
* The <Rect /> element is used to create a rectangle and variations of a rectangle shape.
*/
export class Rect extends React.Component<
React.PropsWithChildren<RectProps>
> {}
interface CircleProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
cx?: string | number;
cy?: string | number;
r: string | number;
}
/**
* The <Circle /> element is used to create a circle.
*/
export class Circle extends React.Component<
React.PropsWithChildren<CircleProps>
> {}
interface EllipseProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
cx?: string | number;
cy?: string | number;
rx: string | number;
ry: string | number;
}
/**
* The <Ellipse /> element is used to create an ellipse.
* An ellipse is closely related to a circle. The difference is that an ellipse has an x and a y radius that differs from each other, while a circle has equal x and y radius.
*/
export class Ellipse extends React.Component<
React.PropsWithChildren<EllipseProps>
> {}
interface TspanProps extends SVGPresentationAttributes {
x?: string | number;
y?: string | number;
}
/**
* The <Tspan /> element defines a subtext within a <Text /> element or another <Tspan /> element.
* It allows for adjustment of the style and/or position of that subtext as needed.
*/
export class Tspan extends React.Component<
React.PropsWithChildren<TspanProps>
> {}
interface GProps extends SVGPresentationAttributes {
style?: Style;
}
/**
* The <G /> SVG element is a container used to group other SVG elements.
* Transformations applied to the <G /> element are performed on its child elements, and its attributes are inherited by its children.
*/
export class G extends React.Component<React.PropsWithChildren<GProps>> {}
interface StopProps {
offset: string | number;
stopColor: string;
stopOpacity?: string | number;
}
/**
* The SVG <Stop /> element defines a color and its position to use on a gradient. This element is always a child of a <LinearGradient /> or <RadialGradient /> element
*/
export class Stop extends React.Component<
React.PropsWithChildren<StopProps>
> {}
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
interface DefsProps {}
/**
* The <Defs /> element is used to store graphical objects that will be used at a later time. Objects created inside a <Defs /> element are not rendered directly. To display them you have to reference them
*/
export class Defs extends React.Component<
React.PropsWithChildren<DefsProps>
> {}
interface ClipPathProps {
id?: string;
}
/**
* The <ClipPath /> SVG element defines a clipping path, to be used by the clipPath property.
* A clipping path restricts the region to which paint can be applied. Conceptually, parts of the drawing that lie outside of the region bounded by the clipping path are not drawn.
*/
export class ClipPath extends React.Component<
React.PropsWithChildren<ClipPathProps>
> {}
interface MarkerProps {
id: string;
viewBox?: string;
refX?: string | number;
refY?: string | number;
markerWidth?: string | number;
markerHeight?: string | number;
orient?: 'auto' | 'auto-start-reverse' | number;
markerUnits?: 'strokeWidth' | 'userSpaceOnUse';
}
/**
* The <Marker /> SVG element defines a graphic used for drawing arrows or polymarkers on a given <Path />, <Line />, <Polyline />, or <Polygon /> element.
* Markers can be attached to shapes using the markerStart, markerMid, and markerEnd properties.
*/
export class Marker extends React.Component<
React.PropsWithChildren<MarkerProps>
> {}
interface LinearGradientProps {
id: string;
x1?: string | number;
x2?: string | number;
y1?: string | number;
y2?: string | number;
xlinkHref?: string;
gradientTransform?: string;
gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
}
/**
* The <LinearGradient /> element lets authors define linear gradients that can be applied to fill or stroke of graphical elements.
*/
export class LinearGradient extends React.Component<
React.PropsWithChildren<LinearGradientProps>
> {}
interface RadialGradientProps {
id: string;
cx?: string | number;
cy?: string | number;
r?: string | number;
fx?: string | number;
fy?: string | number;
xlinkHref?: string;
gradientTransform?: string;
gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
}
/**
* The <RadialGradient /> element lets authors define radial gradients that can be applied to fill or stroke of graphical elements.
*/
export class RadialGradient extends React.Component<
React.PropsWithChildren<RadialGradientProps>
> {}
interface BlobProviderParams {
blob: Blob | null;
url: string | null;
loading: boolean;
error: Error | null;
}
interface BlobProviderProps {
document: React.ReactElement<DocumentProps>;
children: (params: BlobProviderParams) => React.ReactNode;
}
/**
* Easy and declarative way of getting document's blob data without
* showing it on screen.
* @see https://react-pdf.org/advanced#on-the-fly-rendering
* @platform web
*/
export class BlobProvider extends React.Component<BlobProviderProps> {}
interface PDFViewerProps {
width?: number | string;
height?: number | string;
style?: Style | Style[];
className?: string;
children?: React.ReactElement<DocumentProps>;
innerRef?: React.Ref<HTMLIFrameElement>;
showToolbar?: boolean;
}
/**
* Iframe PDF viewer for client-side generated documents.
* @platform web
*/
export class PDFViewer extends React.Component<PDFViewerProps> {}
interface PDFDownloadLinkProps
extends Omit<
React.AnchorHTMLAttributes<HTMLAnchorElement>,
'href' | 'children'
> {
/** PDF filename. Alias for anchor tag `download` attribute. */
fileName?: string;
document: React.ReactElement<DocumentProps>;
children?: React.ReactNode | React.FC<BlobProviderParams>;
onClick?: React.AnchorHTMLAttributes<HTMLAnchorElement>['onClick'] &
((
event: React.MouseEvent<HTMLAnchorElement, MouseEvent>,
instance: UsePDFInstance,
) => void);
ref?: React.Ref<HTMLAnchorElement> | undefined;
}
/**
* Anchor tag to enable generate and download PDF documents on the fly.
* @see https://react-pdf.org/advanced#on-the-fly-rendering
* @platform web
*/
export class PDFDownloadLink extends React.Component<PDFDownloadLinkProps> {}
interface UsePDFInstance {
loading: boolean;
blob: Blob | null;
url: string | null;
error: string | null;
}
/**
* React hook for creating and updating a PDF document instance
* @platform web
*/
export function usePDF(options?: {
document?: React.ReactElement<DocumentProps>;
}): [
UsePDFInstance,
(newDocument: React.ReactElement<DocumentProps>) => void,
];
export const Font: FontStore;
export const StyleSheet: {
create: <T extends Styles>(styles: T) => T;
};
export const version: any;
export const PDFRenderer: any;
export const pdf: (initialValue?: React.ReactElement<DocumentProps>) => {
container: any;
isDirty: () => boolean;
toString: () => string;
toBlob: () => Promise<Blob>;
toBuffer: () => Promise<NodeJS.ReadableStream>;
on: (event: 'change', callback: () => void) => void;
updateContainer: (
document: React.ReactElement<any>,
callback?: () => void,
) => void;
removeListener: (event: 'change', callback: () => void) => void;
};
export const renderToStream: (
document: React.ReactElement<DocumentProps>,
) => Promise<NodeJS.ReadableStream>;
/**
* @deprecated use the `renderToBuffer` method
*/
export const renderToString: (
document: React.ReactElement<DocumentProps>,
) => Promise<string>;
export const renderToFile: (
document: React.ReactElement<DocumentProps>,
filePath: string,
callback?: (output: NodeJS.ReadableStream, _filePath: string) => any,
) => Promise<NodeJS.ReadableStream>;
const render: typeof renderToFile;
/**
* Render document into a nodejs buffer
* @platform node
*/
export const renderToBuffer: (
document: React.ReactElement<ReactPDF.DocumentProps>,
) => Promise<Buffer>;
}

View File

@@ -0,0 +1,793 @@
/* eslint-disable max-classes-per-file */
import * as React from 'react';
import {
Style,
PageSize,
FontStore,
PDFVersion,
Orientation,
SourceObject,
SrcSet,
Sizes,
HyphenationCallback,
SVGPresentationAttributes,
Bookmark,
PageLayout,
PageMode,
HitSlop,
} from '@react-pdf/types';
declare class ReactPDF {
static default: typeof ReactPDF;
}
export = ReactPDF;
declare namespace ReactPDF {
interface Styles {
[key: string]: Style;
}
interface OnRenderProps {
blob?: Blob;
}
interface Permissions {
printing?: 'lowResolution' | 'highResolution';
modifying?: boolean;
copying?: boolean;
annotating?: boolean;
fillingForms?: boolean;
contentAccessibility?: boolean;
documentAssembly?: boolean;
}
interface DocumentProps {
style?: Style | Style[];
title?: string;
author?: string;
subject?: string;
creator?: string;
keywords?: string;
producer?: string;
language?: string;
creationDate?: Date;
modificationDate?: Date;
pdfVersion?: PDFVersion;
pageMode?: PageMode;
pageLayout?: PageLayout;
ownerPassword?: string;
userPassword?: string;
permissions?: Permissions;
onRender?: (props: OnRenderProps) => any;
}
/**
* This component represent the PDF document itself. It must be the root
* of your tree element structure, and under no circumstances should it be
* used as children of another react-pdf component. In addition, it should
* only have childs of type <Page />.
*/
export class Document extends React.Component<
React.PropsWithChildren<DocumentProps>
> {}
interface NodeProps {
id?: string;
style?: Style | Style[];
/**
* Render component in all wrapped pages.
* @see https://react-pdf.org/advanced#fixed-components
*/
fixed?: boolean;
/**
* Force the wrapping algorithm to start a new page when rendering the
* element.
* @see https://react-pdf.org/advanced#page-breaks
*/
break?: boolean;
/**
* Hint that no page wrapping should occur between all sibling elements following the element within n points
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
*/
minPresenceAhead?: number;
}
interface PageProps extends NodeProps {
/**
* Enable page wrapping for this page.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
size?: PageSize;
orientation?: Orientation;
dpi?: number;
bookmark?: Bookmark;
}
/**
* Represents single page inside the PDF document, or a subset of them if
* using the wrapping feature. A <Document /> can contain as many pages as
* you want, but ensure not rendering a page inside any component besides
* Document.
*/
export class Page extends React.Component<
React.PropsWithChildren<PageProps>
> {}
interface ViewProps extends NodeProps {
id?: string;
/**
* Enable/disable page wrapping for element.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
render?: (props: {
pageNumber: number;
subPageNumber: number;
}) => React.ReactNode;
}
/**
* The most fundamental component for building a UI and is designed to be
* nested inside other views and can have 0 to many children.
*/
export class View extends React.Component<
React.PropsWithChildren<ViewProps>
> {}
interface BaseImageProps extends NodeProps {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
cache?: boolean;
/**
* A comma-separated list of image sources with width descriptors.
* Works like the HTML img srcSet attribute.
* @example "small.jpg 300w, medium.jpg 600w, large.jpg 900w"
*/
srcSet?: SrcSet;
/**
* The intended display width of the image, used to select the best source
* from srcSet. Accepts a number (in points) or a string.
* Works like the HTML img sizes attribute.
* @example 300
* @example "300"
*/
sizes?: Sizes;
}
interface ImageWithSrcProp extends BaseImageProps {
src: SourceObject;
}
interface ImageWithSourceProp extends BaseImageProps {
source: SourceObject;
}
type ImageProps = ImageWithSrcProp | ImageWithSourceProp;
/**
* A React component for displaying network or local (Node only) JPG or
* PNG images, as well as base64 encoded image strings.
*/
export class Image extends React.Component<ImageProps> {}
interface BaseImageBackgroundProps extends NodeProps {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
cache?: boolean;
/**
* A comma-separated list of image sources with width descriptors.
* Works like the HTML img srcSet attribute.
* @example "small.jpg 300w, medium.jpg 600w, large.jpg 900w"
*/
srcSet?: SrcSet;
/**
* The intended display width of the image, used to select the best source
* from srcSet. Accepts a number (in points) or a string.
* @example 300
*/
sizes?: Sizes;
/**
* Style applied to the background image.
*/
imageStyle?: Style;
}
interface ImageBackgroundWithSrcProp extends BaseImageBackgroundProps {
src: SourceObject;
}
interface ImageBackgroundWithSourceProp extends BaseImageBackgroundProps {
source: SourceObject;
}
type ImageBackgroundProps =
| ImageBackgroundWithSrcProp
| ImageBackgroundWithSourceProp;
/**
* A React component for displaying an image behind child content.
* Compatible with React Native's ImageBackground component.
* @see https://reactnative.dev/docs/imagebackground
*/
export class ImageBackground extends React.Component<
React.PropsWithChildren<ImageBackgroundProps>
> {}
interface TextProps extends NodeProps {
id?: string;
/**
* Enable/disable page wrapping for element.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
render?: (props: {
pageNumber: number;
totalPages: number;
subPageNumber: number;
subPageTotalPages: number;
}) => React.ReactNode;
/**
* Override the default hyphenation-callback
* @see https://react-pdf.org/fonts#registerhyphenationcallback
*/
hyphenationCallback?: HyphenationCallback;
/**
* Specifies the minimum number of lines in a text element that must be shown at the bottom of a page or its container.
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
*/
orphans?: number;
/**
* Specifies the minimum number of lines in a text element that must be shown at the top of a page or its container..
* @see https://react-pdf.org/advanced#orphan-&-widow-protection
*/
widows?: number;
}
interface SVGTextProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
x: string | number;
y: string | number;
/**
* Override the default hyphenation-callback
* @see https://react-pdf.org/fonts#registerhyphenationcallback
*/
hyphenationCallback?: HyphenationCallback;
}
/**
* A React component for displaying text. Text supports nesting of other
* Text or Link components to create inline styling.
*/
export class Text extends React.Component<
React.PropsWithChildren<TextProps> | SVGTextProps
> {}
interface LinkProps extends NodeProps {
/**
* Enable/disable page wrapping for element.
* @see https://react-pdf.org/components#page-wrapping
*/
wrap?: boolean;
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
href?: string;
src?: string;
/**
* Extends the clickable area of the link beyond its visible bounds.
* Accepts a number (applied to all sides) or an object with top, bottom, left, right.
* @see https://reactnative.dev/docs/view#hitslop
*/
hitSlop?: HitSlop;
}
/**
* A React component for displaying a hyperlink. Links can be nested
* inside a Text component, or being inside any other valid primitive.
*/
export class Link extends React.Component<
React.PropsWithChildren<LinkProps>
> {}
interface FormCommonProps extends NodeProps {
name?: string;
required?: boolean;
noExport?: boolean;
readOnly?: boolean;
value?: number | string;
defaultValue?: number | string;
}
interface FieldSetProps extends NodeProps {
name: string;
}
export class FieldSet extends React.Component<
React.PropsWithChildren<FieldSetProps>
> {}
// see http://pdfkit.org/docs/forms.html#text_field_formatting
interface TextInputFormatting {
type:
| 'date'
| 'time'
| 'percent'
| 'number'
| 'zip'
| 'zipPlus4'
| 'phone'
| 'ssn';
param?: string;
nDec?: number;
sepComma?: boolean;
negStyle?: 'MinusBlack' | 'Red' | 'ParensBlack' | 'ParensRed';
currency?: string;
currencyPrepend?: boolean;
}
// see http://pdfkit.org/docs/forms.html#text_field_formatting
interface TextInputProps extends FormCommonProps {
align?: 'left' | 'center' | 'right';
multiline?: boolean;
/**
* The text will be masked (e.g. with asterisks).
*/
password?: boolean;
/**
* If set, text entered in the field is not spell-checked
*/
noSpell?: boolean;
format?: TextInputFormatting;
/**
* Sets the fontSize (default or 0 means auto sizing)
*/
fontSize?: number;
/**
* Sets the maximum length (characters) of the text in the field
*/
maxLength?: number;
}
export class TextInput extends React.Component<TextInputProps> {}
interface CheckboxProps extends FormCommonProps {
backgroundColor?: string;
borderColor?: string;
checked?: boolean;
onState?: string;
offState?: string;
xMark?: boolean;
}
export class Checkbox extends React.Component<CheckboxProps> {}
interface SelectAndListPropsBase extends FormCommonProps {
sort?: boolean;
edit?: boolean;
multiSelect?: boolean;
noSpell?: boolean;
select?: string[];
}
type SelectAndListPropsWithEdit = SelectAndListPropsBase & {
edit: true | false;
noSpell: boolean;
};
type SelectAndListPropsWithNoSpell = SelectAndListPropsBase & {
edit: boolean;
noSpell: true | false;
};
type SelectAndListProps =
| SelectAndListPropsWithEdit
| SelectAndListPropsWithNoSpell;
export class Select extends React.Component<SelectAndListProps> {}
export class List extends React.Component<SelectAndListProps> {}
interface NoteProps extends NodeProps {
children: string;
}
export class Note extends React.Component<NoteProps> {}
interface CanvasProps extends NodeProps {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
paint: (
painter: any,
availableWidth: number,
availableHeight: number,
) => null;
}
export class Canvas extends React.Component<CanvasProps> {}
interface SVGProps extends NodeProps, SVGPresentationAttributes {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
width?: string | number;
height?: string | number;
viewBox?: string;
preserveAspectRatio?: string;
}
/**
* The <SVG /> element is a container that defines a new coordinate system and viewport. It is used as the outermost element of SVG documents.
*/
export class Svg extends React.Component<React.PropsWithChildren<SVGProps>> {}
interface LineProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
x1: string | number;
x2: string | number;
y1: string | number;
y2: string | number;
}
/**
* The <Line /> element is used to create a line.
*/
export class Line extends React.Component<
React.PropsWithChildren<LineProps>
> {}
interface PolylineProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
points: string;
}
/**
* The <Polyline /> element is used to create any shape that consists of only straight lines (that is connected at several points).
*/
export class Polyline extends React.Component<
React.PropsWithChildren<PolylineProps>
> {}
interface PolygonProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
points: string;
}
/**
* The <Polygon /> element is used to create a graphic that contains at least three sides.
* Polygons are made of straight lines, and the shape is "closed" (all the lines connect up).
*/
export class Polygon extends React.Component<
React.PropsWithChildren<PolygonProps>
> {}
interface PathProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
d: string;
}
/**
* The <Path /> element is the most powerful element in the SVG library of basic shapes. It can be used to create lines, curves, arcs, and more.
*/
export class Path extends React.Component<
React.PropsWithChildren<PathProps>
> {}
interface RectProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
x?: string | number;
y?: string | number;
width: string | number;
height: string | number;
rx?: string | number;
ry?: string | number;
}
/**
* The <Rect /> element is used to create a rectangle and variations of a rectangle shape.
*/
export class Rect extends React.Component<
React.PropsWithChildren<RectProps>
> {}
interface CircleProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
cx?: string | number;
cy?: string | number;
r: string | number;
}
/**
* The <Circle /> element is used to create a circle.
*/
export class Circle extends React.Component<
React.PropsWithChildren<CircleProps>
> {}
interface EllipseProps extends SVGPresentationAttributes {
style?: SVGPresentationAttributes;
cx?: string | number;
cy?: string | number;
rx: string | number;
ry: string | number;
}
/**
* The <Ellipse /> element is used to create an ellipse.
* An ellipse is closely related to a circle. The difference is that an ellipse has an x and a y radius that differs from each other, while a circle has equal x and y radius.
*/
export class Ellipse extends React.Component<
React.PropsWithChildren<EllipseProps>
> {}
interface TspanProps extends SVGPresentationAttributes {
x?: string | number;
y?: string | number;
}
/**
* The <Tspan /> element defines a subtext within a <Text /> element or another <Tspan /> element.
* It allows for adjustment of the style and/or position of that subtext as needed.
*/
export class Tspan extends React.Component<
React.PropsWithChildren<TspanProps>
> {}
interface GProps extends SVGPresentationAttributes {
style?: Style;
}
/**
* The <G /> SVG element is a container used to group other SVG elements.
* Transformations applied to the <G /> element are performed on its child elements, and its attributes are inherited by its children.
*/
export class G extends React.Component<React.PropsWithChildren<GProps>> {}
interface StopProps {
offset: string | number;
stopColor: string;
stopOpacity?: string | number;
}
/**
* The SVG <Stop /> element defines a color and its position to use on a gradient. This element is always a child of a <LinearGradient /> or <RadialGradient /> element
*/
export class Stop extends React.Component<
React.PropsWithChildren<StopProps>
> {}
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
interface DefsProps {}
/**
* The <Defs /> element is used to store graphical objects that will be used at a later time. Objects created inside a <Defs /> element are not rendered directly. To display them you have to reference them
*/
export class Defs extends React.Component<
React.PropsWithChildren<DefsProps>
> {}
interface ClipPathProps {
id?: string;
}
/**
* The <ClipPath /> SVG element defines a clipping path, to be used by the clipPath property.
* A clipping path restricts the region to which paint can be applied. Conceptually, parts of the drawing that lie outside of the region bounded by the clipping path are not drawn.
*/
export class ClipPath extends React.Component<
React.PropsWithChildren<ClipPathProps>
> {}
interface MarkerProps {
id: string;
viewBox?: string;
refX?: string | number;
refY?: string | number;
markerWidth?: string | number;
markerHeight?: string | number;
orient?: 'auto' | 'auto-start-reverse' | number;
markerUnits?: 'strokeWidth' | 'userSpaceOnUse';
}
/**
* The <Marker /> SVG element defines a graphic used for drawing arrows or polymarkers on a given <Path />, <Line />, <Polyline />, or <Polygon /> element.
* Markers can be attached to shapes using the markerStart, markerMid, and markerEnd properties.
*/
export class Marker extends React.Component<
React.PropsWithChildren<MarkerProps>
> {}
interface LinearGradientProps {
id: string;
x1?: string | number;
x2?: string | number;
y1?: string | number;
y2?: string | number;
xlinkHref?: string;
gradientTransform?: string;
gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
}
/**
* The <LinearGradient /> element lets authors define linear gradients that can be applied to fill or stroke of graphical elements.
*/
export class LinearGradient extends React.Component<
React.PropsWithChildren<LinearGradientProps>
> {}
interface RadialGradientProps {
id: string;
cx?: string | number;
cy?: string | number;
r?: string | number;
fx?: string | number;
fy?: string | number;
xlinkHref?: string;
gradientTransform?: string;
gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox';
}
/**
* The <RadialGradient /> element lets authors define radial gradients that can be applied to fill or stroke of graphical elements.
*/
export class RadialGradient extends React.Component<
React.PropsWithChildren<RadialGradientProps>
> {}
interface BlobProviderParams {
blob: Blob | null;
url: string | null;
loading: boolean;
error: Error | null;
}
interface BlobProviderProps {
document: React.ReactElement<DocumentProps>;
children: (params: BlobProviderParams) => React.ReactNode;
}
/**
* Easy and declarative way of getting document's blob data without
* showing it on screen.
* @see https://react-pdf.org/advanced#on-the-fly-rendering
* @platform web
*/
export class BlobProvider extends React.Component<BlobProviderProps> {}
interface PDFViewerProps {
width?: number | string;
height?: number | string;
style?: Style | Style[];
className?: string;
children?: React.ReactElement<DocumentProps>;
innerRef?: React.Ref<HTMLIFrameElement>;
showToolbar?: boolean;
}
/**
* Iframe PDF viewer for client-side generated documents.
* @platform web
*/
export class PDFViewer extends React.Component<PDFViewerProps> {}
interface PDFDownloadLinkProps
extends Omit<
React.AnchorHTMLAttributes<HTMLAnchorElement>,
'href' | 'children'
> {
/** PDF filename. Alias for anchor tag `download` attribute. */
fileName?: string;
document: React.ReactElement<DocumentProps>;
children?: React.ReactNode | React.FC<BlobProviderParams>;
onClick?: React.AnchorHTMLAttributes<HTMLAnchorElement>['onClick'] &
((
event: React.MouseEvent<HTMLAnchorElement, MouseEvent>,
instance: UsePDFInstance,
) => void);
ref?: React.Ref<HTMLAnchorElement> | undefined;
}
/**
* Anchor tag to enable generate and download PDF documents on the fly.
* @see https://react-pdf.org/advanced#on-the-fly-rendering
* @platform web
*/
export class PDFDownloadLink extends React.Component<PDFDownloadLinkProps> {}
interface UsePDFInstance {
loading: boolean;
blob: Blob | null;
url: string | null;
error: string | null;
}
/**
* React hook for creating and updating a PDF document instance
* @platform web
*/
export function usePDF(options?: {
document?: React.ReactElement<DocumentProps>;
}): [
UsePDFInstance,
(newDocument: React.ReactElement<DocumentProps>) => void,
];
export const Font: FontStore;
export const StyleSheet: {
create: <T extends Styles>(styles: T) => T;
};
export const version: any;
export const PDFRenderer: any;
export const pdf: (initialValue?: React.ReactElement<DocumentProps>) => {
container: any;
isDirty: () => boolean;
toString: () => string;
toBlob: () => Promise<Blob>;
toBuffer: () => Promise<NodeJS.ReadableStream>;
on: (event: 'change', callback: () => void) => void;
updateContainer: (
document: React.ReactElement<any>,
callback?: () => void,
) => void;
removeListener: (event: 'change', callback: () => void) => void;
};
export const renderToStream: (
document: React.ReactElement<DocumentProps>,
) => Promise<NodeJS.ReadableStream>;
/**
* @deprecated use the `renderToBuffer` method
*/
export const renderToString: (
document: React.ReactElement<DocumentProps>,
) => Promise<string>;
export const renderToFile: (
document: React.ReactElement<DocumentProps>,
filePath: string,
callback?: (output: NodeJS.ReadableStream, _filePath: string) => any,
) => Promise<NodeJS.ReadableStream>;
const render: typeof renderToFile;
/**
* Render document into a nodejs buffer
* @platform node
*/
export const renderToBuffer: (
document: React.ReactElement<ReactPDF.DocumentProps>,
) => Promise<Buffer>;
}

View File

@@ -0,0 +1 @@
import*as e from"@react-pdf/primitives";export*from"@react-pdf/primitives";import r from"fs";import{Buffer as t}from"buffer";import o from"@react-pdf/font";import n from"@react-pdf/render";import i from"@react-pdf/pdfkit";import a from"@react-pdf/layout";import{upperFirst as s}from"@react-pdf/fns";import d from"@react-pdf/reconciler";const c=(e,r)=>{let{style:t,children:o,...n}=r;return{type:e,box:{},style:t||{},props:n||{},children:[]}},p=e=>({type:"TEXT_INSTANCE",value:e}),l=(e,r)=>{const t="TEXT"===e.type||"LINK"===e.type||"TSPAN"===e.type||"NOTE"===e.type;"TEXT_INSTANCE"!==r.type||t?e.children.push(r):console.warn(`Invalid '${r.value}' string child outside <Text> component`)},u=(e,r)=>{"ROOT"===e.type?e.document=r:l(e,r)},f=(e,r,t)=>{var o;const n=null===(o=e.children)||void 0===o?void 0:o.indexOf(t);void 0!==n&&-1!==n&&r&&e.children.splice(n,0,r)},m=(e,r)=>{var t;const o=null===(t=e.children)||void 0===t?void 0:t.indexOf(r);void 0!==o&&-1!==o&&e.children.splice(o,1)},v=(e,r)=>{var t;const o=null===(t=e.children)||void 0===t?void 0:t.indexOf(r);void 0!==o&&-1!==o&&e.children.splice(o,1)},w=(e,r,t)=>{e.value=t},y=(e,r,t,o,n)=>{const{style:i,...a}=n;e.props=a,e.style=i},h=e=>{let{onChange:r=(()=>{})}=e;return d({appendChild:l,appendChildToContainer:u,commitTextUpdate:w,commitUpdate:y,createInstance:c,createTextInstance:p,insertBefore:f,removeChild:m,removeChildFromContainer:v,resetAfterCommit:r})};var T={version:"4.5.1"};const{version:P}=T,g=new o;let b;const D={},S=e=>{const r={type:"ROOT",document:null};b=b||h({onChange:()=>{var e;const r=(null===(e=D.change)||void 0===e?void 0:e.slice())||[];for(let e=0;e<r.length;e+=1)r[e]()}});const t=b.createContainer(r),o=(e,r)=>{b.updateContainer(e,t,null,r)};e&&o(e);const d=async function(e){void 0===e&&(e=!0);const t=r.document.props||{},{pdfVersion:o,language:d,pageLayout:c,pageMode:p,title:l,author:u,subject:f,keywords:m,creator:v="react-pdf",producer:w="react-pdf",creationDate:y=new Date,modificationDate:h,ownerPassword:T,userPassword:P,permissions:b}=t,D=new i({compress:e,pdfVersion:o,lang:d,displayTitle:!0,autoFirstPage:!1,ownerPassword:T,userPassword:P,permissions:b,pageLayout:c,info:(S={Title:l,Author:u,Subject:f,Keywords:m,Creator:v,Producer:w,CreationDate:y,ModificationDate:h},Object.fromEntries(Object.entries(S).filter((e=>{let[,r]=e;return void 0!==r}))))});var S;p&&(D._root.data.PageMode=s(p));const _=await a(r.document,g);return{layout:_,fileStream:n(D,_)}},c=function(e){void 0===e&&(e={}),r.document.props.onRender&&r.document.props.onRender(e)};return{on:(e,r)=>{D[e]||(D[e]=[]),D[e].push(r)},container:r,toBlob:async()=>{const e=[],{layout:r,fileStream:t}=await d();return new Promise(((o,n)=>{t.on("data",(r=>{e.push(r instanceof Uint8Array?r:new Uint8Array(r))})),t.on("end",(()=>{try{const t=new Blob(e,{type:"application/pdf"});c({blob:t,_INTERNAL__LAYOUT__DATA_:r}),o(t)}catch(e){n(e)}}))}))},toBuffer:async()=>{const{layout:e,fileStream:r}=await d();return c({_INTERNAL__LAYOUT__DATA_:e}),r},toString:async()=>{"development"===process.env.NODE_ENV&&console.warn("`toString` is deprecated and will be removed in next major release");let e="";const{fileStream:r}=await d(!1);return new Promise(((t,o)=>{try{r.on("data",(r=>{e+=r})),r.on("end",(()=>{c(),t(e)}))}catch(e){o(e)}}))},removeListener:(e,r)=>{if(!D[e])return;const t=D[e].indexOf(r);t>-1&&D[e].splice(t,1)},updateContainer:o}},_=g,A={create:e=>e},C=async e=>{const r=S(e);return await r.toBuffer()},N=async(e,t,o)=>{const n=await C(e),i=r.createWriteStream(t);return n.pipe(i),new Promise(((e,r)=>{i.on("finish",(()=>{o&&o(n,t),e(n)})),i.on("error",r)}))},O=e=>C(e).then((e=>new Promise(((r,o)=>{const n=[];e.on("data",(e=>n.push(e))),e.on("end",(()=>r(t.concat(n)))),e.on("error",(e=>o(e)))})))),E=e=>("development"===process.env.NODE_ENV&&console.warn("`renderToString` is deprecated and will be removed in next major release, use `renderToBuffer` instead"),O(e).then((e=>e.toString()))),x=e=>{throw new Error(`${e} is a web specific API. You're either using this component on Node, or your bundler is not loading react-pdf from the appropriate web build.`)},F=()=>{x("usePDF")},L=()=>{x("PDFViewer")},I=()=>{x("PDFDownloadLink")},B=()=>{x("BlobProvider")},j=N;var R={pdf:S,Font:_,version:P,StyleSheet:A,usePDF:F,PDFViewer:L,BlobProvider:B,PDFDownloadLink:I,renderToStream:C,renderToString:E,renderToFile:N,render:j,...e};export{B as BlobProvider,_ as Font,I as PDFDownloadLink,L as PDFViewer,A as StyleSheet,h as createRenderer,R as default,S as pdf,j as render,O as renderToBuffer,N as renderToFile,C as renderToStream,E as renderToString,F as usePDF,P as version};

View File

@@ -0,0 +1,67 @@
{
"name": "@react-pdf/renderer",
"version": "4.5.1",
"license": "MIT",
"description": "Create PDF files on the browser and server",
"author": "Diego Muracciole <diegomuracciole@gmail.com>",
"homepage": "https://github.com/diegomura/react-pdf#readme",
"type": "module",
"main": "./lib/react-pdf.js",
"browser": {
"./lib/react-pdf.js": "./lib/react-pdf.browser.js"
},
"repository": {
"type": "git",
"url": "https://github.com/diegomura/react-pdf.git",
"directory": "packages/renderer"
},
"scripts": {
"build": "rimraf ./lib && rollup -c",
"watch": "rimraf ./lib && rollup -c -w",
"size": "size-limit",
"lint": "eslint src",
"test": "vitest && vitest --config vitest.browser.config.js"
},
"dependencies": {
"@babel/runtime": "^7.20.13",
"@react-pdf/fns": "3.1.3",
"@react-pdf/font": "^4.0.8",
"@react-pdf/layout": "^4.6.1",
"@react-pdf/pdfkit": "^5.1.1",
"@react-pdf/primitives": "^4.3.0",
"@react-pdf/reconciler": "^2.0.0",
"@react-pdf/render": "^4.5.1",
"@react-pdf/types": "^2.11.1",
"events": "^3.3.0",
"object-assign": "^4.1.1",
"prop-types": "^15.6.2",
"queue": "^6.0.1"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
},
"lint-staged": {
"*.js": [
"yarn lint",
"prettier --write"
]
},
"files": [
"lib",
"index.d.ts"
],
"collective": {
"type": "opencollective",
"url": "https://opencollective.com/react-pdf",
"logo": "https://opencollective.com/opencollective/logo.txt"
},
"devDependencies": {
"@size-limit/preset-big-lib": "^11.0.1",
"assert": "^2.0.0",
"browserify-zlib": "^0.2.0",
"buffer": "^6.0.3",
"process": "^0.11.10",
"size-limit": "^11.0.1",
"util": "^0.12.4"
}
}

View File

@@ -0,0 +1 @@
{"type": "commonjs"}

View File

@@ -0,0 +1,340 @@
{
"version": 4,
"routes": {
"/": {
"experimentalBypassFor": [
{
"type": "header",
"key": "next-action"
},
{
"type": "header",
"key": "content-type",
"value": "multipart/form-data;.*"
}
],
"initialRevalidateSeconds": false,
"srcRoute": "/",
"dataRoute": "/index.rsc",
"allowHeader": [
"host",
"x-matched-path",
"x-prerender-revalidate",
"x-prerender-revalidate-if-generated",
"x-next-revalidated-tags",
"x-next-revalidate-tag-token"
]
},
"/_global-error": {
"experimentalBypassFor": [
{
"type": "header",
"key": "next-action"
},
{
"type": "header",
"key": "content-type",
"value": "multipart/form-data;.*"
}
],
"initialRevalidateSeconds": false,
"srcRoute": "/_global-error",
"dataRoute": "/_global-error.rsc",
"allowHeader": [
"host",
"x-matched-path",
"x-prerender-revalidate",
"x-prerender-revalidate-if-generated",
"x-next-revalidated-tags",
"x-next-revalidate-tag-token"
]
},
"/_not-found": {
"initialStatus": 404,
"experimentalBypassFor": [
{
"type": "header",
"key": "next-action"
},
{
"type": "header",
"key": "content-type",
"value": "multipart/form-data;.*"
}
],
"initialRevalidateSeconds": false,
"srcRoute": "/_not-found",
"dataRoute": "/_not-found.rsc",
"allowHeader": [
"host",
"x-matched-path",
"x-prerender-revalidate",
"x-prerender-revalidate-if-generated",
"x-next-revalidated-tags",
"x-next-revalidate-tag-token"
]
},
"/admin/users": {
"experimentalBypassFor": [
{
"type": "header",
"key": "next-action"
},
{
"type": "header",
"key": "content-type",
"value": "multipart/form-data;.*"
}
],
"initialRevalidateSeconds": false,
"srcRoute": "/admin/users",
"dataRoute": "/admin/users.rsc",
"allowHeader": [
"host",
"x-matched-path",
"x-prerender-revalidate",
"x-prerender-revalidate-if-generated",
"x-next-revalidated-tags",
"x-next-revalidate-tag-token"
]
},
"/auth/forgot-password": {
"experimentalBypassFor": [
{
"type": "header",
"key": "next-action"
},
{
"type": "header",
"key": "content-type",
"value": "multipart/form-data;.*"
}
],
"initialRevalidateSeconds": false,
"srcRoute": "/auth/forgot-password",
"dataRoute": "/auth/forgot-password.rsc",
"allowHeader": [
"host",
"x-matched-path",
"x-prerender-revalidate",
"x-prerender-revalidate-if-generated",
"x-next-revalidated-tags",
"x-next-revalidate-tag-token"
]
},
"/auth/login": {
"experimentalBypassFor": [
{
"type": "header",
"key": "next-action"
},
{
"type": "header",
"key": "content-type",
"value": "multipart/form-data;.*"
}
],
"initialRevalidateSeconds": false,
"srcRoute": "/auth/login",
"dataRoute": "/auth/login.rsc",
"allowHeader": [
"host",
"x-matched-path",
"x-prerender-revalidate",
"x-prerender-revalidate-if-generated",
"x-next-revalidated-tags",
"x-next-revalidate-tag-token"
]
},
"/auth/sign-up": {
"experimentalBypassFor": [
{
"type": "header",
"key": "next-action"
},
{
"type": "header",
"key": "content-type",
"value": "multipart/form-data;.*"
}
],
"initialRevalidateSeconds": false,
"srcRoute": "/auth/sign-up",
"dataRoute": "/auth/sign-up.rsc",
"allowHeader": [
"host",
"x-matched-path",
"x-prerender-revalidate",
"x-prerender-revalidate-if-generated",
"x-next-revalidated-tags",
"x-next-revalidate-tag-token"
]
},
"/auth/sign-up-success": {
"experimentalBypassFor": [
{
"type": "header",
"key": "next-action"
},
{
"type": "header",
"key": "content-type",
"value": "multipart/form-data;.*"
}
],
"initialRevalidateSeconds": false,
"srcRoute": "/auth/sign-up-success",
"dataRoute": "/auth/sign-up-success.rsc",
"allowHeader": [
"host",
"x-matched-path",
"x-prerender-revalidate",
"x-prerender-revalidate-if-generated",
"x-next-revalidated-tags",
"x-next-revalidate-tag-token"
]
},
"/auth/update-password": {
"experimentalBypassFor": [
{
"type": "header",
"key": "next-action"
},
{
"type": "header",
"key": "content-type",
"value": "multipart/form-data;.*"
}
],
"initialRevalidateSeconds": false,
"srcRoute": "/auth/update-password",
"dataRoute": "/auth/update-password.rsc",
"allowHeader": [
"host",
"x-matched-path",
"x-prerender-revalidate",
"x-prerender-revalidate-if-generated",
"x-next-revalidated-tags",
"x-next-revalidate-tag-token"
]
},
"/favicon.ico": {
"initialHeaders": {
"cache-control": "public, max-age=0, must-revalidate",
"content-type": "image/x-icon",
"x-next-cache-tags": "_N_T_/layout,_N_T_/favicon.ico/layout,_N_T_/favicon.ico/route,_N_T_/favicon.ico"
},
"experimentalBypassFor": [
{
"type": "header",
"key": "next-action"
},
{
"type": "header",
"key": "content-type",
"value": "multipart/form-data;.*"
}
],
"initialRevalidateSeconds": false,
"srcRoute": "/favicon.ico",
"dataRoute": null,
"allowHeader": [
"host",
"x-matched-path",
"x-prerender-revalidate",
"x-prerender-revalidate-if-generated",
"x-next-revalidated-tags",
"x-next-revalidate-tag-token"
]
},
"/my-customers/new": {
"experimentalBypassFor": [
{
"type": "header",
"key": "next-action"
},
{
"type": "header",
"key": "content-type",
"value": "multipart/form-data;.*"
}
],
"initialRevalidateSeconds": false,
"srcRoute": "/my-customers/new",
"dataRoute": "/my-customers/new.rsc",
"allowHeader": [
"host",
"x-matched-path",
"x-prerender-revalidate",
"x-prerender-revalidate-if-generated",
"x-next-revalidated-tags",
"x-next-revalidate-tag-token"
]
},
"/opengraph-image.png": {
"initialHeaders": {
"cache-control": "public, max-age=0, must-revalidate",
"content-type": "image/png",
"x-next-cache-tags": "_N_T_/layout,_N_T_/opengraph-image.png/layout,_N_T_/opengraph-image.png/route,_N_T_/opengraph-image.png"
},
"experimentalBypassFor": [
{
"type": "header",
"key": "next-action"
},
{
"type": "header",
"key": "content-type",
"value": "multipart/form-data;.*"
}
],
"initialRevalidateSeconds": false,
"srcRoute": "/opengraph-image.png",
"dataRoute": null,
"allowHeader": [
"host",
"x-matched-path",
"x-prerender-revalidate",
"x-prerender-revalidate-if-generated",
"x-next-revalidated-tags",
"x-next-revalidate-tag-token"
]
},
"/twitter-image.png": {
"initialHeaders": {
"cache-control": "public, max-age=0, must-revalidate",
"content-type": "image/png",
"x-next-cache-tags": "_N_T_/layout,_N_T_/twitter-image.png/layout,_N_T_/twitter-image.png/route,_N_T_/twitter-image.png"
},
"experimentalBypassFor": [
{
"type": "header",
"key": "next-action"
},
{
"type": "header",
"key": "content-type",
"value": "multipart/form-data;.*"
}
],
"initialRevalidateSeconds": false,
"srcRoute": "/twitter-image.png",
"dataRoute": null,
"allowHeader": [
"host",
"x-matched-path",
"x-prerender-revalidate",
"x-prerender-revalidate-if-generated",
"x-next-revalidated-tags",
"x-next-revalidate-tag-token"
]
}
},
"dynamicRoutes": {},
"notFoundRoutes": [],
"preview": {
"previewModeId": "448d32298db3b0c38793886a3692c8c2",
"previewModeSigningKey": "c5cb172f94d84767588967a86044c9ee49921a9b2179519d52aa8aceecb0cd6f",
"previewModeEncryptionKey": "8a7d538464b6beea4e3323e6d9d86f4b70ecb99e19daffca604a9088baa07476"
}
}

View File

@@ -0,0 +1,332 @@
self.__SERVER_FILES_MANIFEST={
"version": 1,
"config": {
"env": {},
"webpack": null,
"typescript": {
"ignoreBuildErrors": false
},
"typedRoutes": false,
"distDir": ".next",
"cleanDistDir": true,
"assetPrefix": "",
"cacheMaxMemorySize": 52428800,
"configOrigin": "next.config.ts",
"useFileSystemPublicRoutes": true,
"generateEtags": true,
"pageExtensions": [
"tsx",
"ts",
"jsx",
"js"
],
"poweredByHeader": true,
"compress": true,
"images": {
"deviceSizes": [
640,
750,
828,
1080,
1200,
1920,
2048,
3840
],
"imageSizes": [
32,
48,
64,
96,
128,
256,
384
],
"path": "/_next/image",
"loader": "default",
"loaderFile": "",
"domains": [],
"disableStaticImages": false,
"minimumCacheTTL": 14400,
"formats": [
"image/webp"
],
"maximumRedirects": 3,
"maximumResponseBody": 50000000,
"dangerouslyAllowLocalIP": false,
"dangerouslyAllowSVG": false,
"contentSecurityPolicy": "script-src 'none'; frame-src 'none'; sandbox;",
"contentDispositionType": "attachment",
"localPatterns": [
{
"pathname": "**",
"search": ""
}
],
"remotePatterns": [],
"qualities": [
75
],
"unoptimized": false,
"customCacheHandler": false
},
"devIndicators": {
"position": "bottom-left"
},
"onDemandEntries": {
"maxInactiveAge": 60000,
"pagesBufferLength": 5
},
"basePath": "",
"sassOptions": {},
"trailingSlash": false,
"i18n": null,
"productionBrowserSourceMaps": false,
"excludeDefaultMomentLocales": true,
"reactProductionProfiling": false,
"reactStrictMode": null,
"reactMaxHeadersLength": 6000,
"httpAgentOptions": {
"keepAlive": true
},
"logging": {
"serverFunctions": true,
"browserToTerminal": "warn"
},
"compiler": {},
"expireTime": 31536000,
"staticPageGenerationTimeout": 60,
"modularizeImports": {
"@mui/icons-material": {
"transform": "@mui/icons-material/{{member}}"
},
"lodash": {
"transform": "lodash/{{member}}"
}
},
"outputFileTracingRoot": "C:\\source\\webshop\\shop",
"cacheComponents": false,
"cacheLife": {
"default": {
"stale": 300,
"revalidate": 900,
"expire": 4294967294
},
"seconds": {
"stale": 30,
"revalidate": 1,
"expire": 60
},
"minutes": {
"stale": 300,
"revalidate": 60,
"expire": 3600
},
"hours": {
"stale": 300,
"revalidate": 3600,
"expire": 86400
},
"days": {
"stale": 300,
"revalidate": 86400,
"expire": 604800
},
"weeks": {
"stale": 300,
"revalidate": 604800,
"expire": 2592000
},
"max": {
"stale": 300,
"revalidate": 2592000,
"expire": 31536000
}
},
"cacheHandlers": {},
"experimental": {
"appNewScrollHandler": false,
"useSkewCookie": false,
"cssChunking": true,
"multiZoneDraftMode": false,
"appNavFailHandling": false,
"prerenderEarlyExit": true,
"serverMinification": true,
"linkNoTouchStart": false,
"caseSensitiveRoutes": false,
"cachedNavigations": false,
"partialFallbacks": false,
"dynamicOnHover": false,
"varyParams": false,
"prefetchInlining": false,
"preloadEntriesOnStart": true,
"clientRouterFilter": true,
"clientRouterFilterRedirects": false,
"fetchCacheKeyPrefix": "",
"proxyPrefetch": "flexible",
"optimisticClientCache": true,
"manualClientBasePath": false,
"cpus": 15,
"memoryBasedWorkersCount": false,
"imgOptConcurrency": null,
"imgOptTimeoutInSeconds": 7,
"imgOptMaxInputPixels": 268402689,
"imgOptSequentialRead": null,
"imgOptSkipMetadata": null,
"isrFlushToDisk": true,
"workerThreads": false,
"optimizeCss": false,
"nextScriptWorkers": false,
"scrollRestoration": false,
"externalDir": false,
"disableOptimizedLoading": false,
"gzipSize": true,
"craCompat": false,
"esmExternals": true,
"fullySpecified": false,
"swcTraceProfiling": false,
"forceSwcTransforms": false,
"largePageDataBytes": 128000,
"typedEnv": false,
"parallelServerCompiles": false,
"parallelServerBuildTraces": false,
"ppr": false,
"authInterrupts": false,
"webpackMemoryOptimizations": false,
"optimizeServerReact": true,
"strictRouteTypes": false,
"viewTransition": false,
"removeUncaughtErrorAndRejectionListeners": false,
"validateRSCRequestHeaders": false,
"staleTimes": {
"dynamic": 0,
"static": 300
},
"reactDebugChannel": true,
"serverComponentsHmrCache": true,
"staticGenerationMaxConcurrency": 8,
"staticGenerationMinPagesPerWorker": 25,
"transitionIndicator": false,
"gestureTransition": false,
"inlineCss": false,
"useCache": false,
"globalNotFound": false,
"browserDebugInfoInTerminal": "warn",
"lockDistDir": true,
"proxyClientMaxBodySize": 10485760,
"hideLogsAfterAbort": false,
"mcpServer": true,
"turbopackFileSystemCacheForDev": true,
"turbopackFileSystemCacheForBuild": false,
"turbopackInferModuleSideEffects": true,
"turbopackPluginRuntimeStrategy": "childProcesses",
"optimizePackageImports": [
"lucide-react",
"date-fns",
"lodash-es",
"ramda",
"antd",
"react-bootstrap",
"ahooks",
"@ant-design/icons",
"@headlessui/react",
"@headlessui-float/react",
"@heroicons/react/20/solid",
"@heroicons/react/24/solid",
"@heroicons/react/24/outline",
"@visx/visx",
"@tremor/react",
"rxjs",
"@mui/material",
"@mui/icons-material",
"recharts",
"react-use",
"effect",
"@effect/schema",
"@effect/platform",
"@effect/platform-node",
"@effect/platform-browser",
"@effect/platform-bun",
"@effect/sql",
"@effect/sql-mssql",
"@effect/sql-mysql2",
"@effect/sql-pg",
"@effect/sql-sqlite-node",
"@effect/sql-sqlite-bun",
"@effect/sql-sqlite-wasm",
"@effect/sql-sqlite-react-native",
"@effect/rpc",
"@effect/rpc-http",
"@effect/typeclass",
"@effect/experimental",
"@effect/opentelemetry",
"@material-ui/core",
"@material-ui/icons",
"@tabler/icons-react",
"mui-core",
"react-icons/ai",
"react-icons/bi",
"react-icons/bs",
"react-icons/cg",
"react-icons/ci",
"react-icons/di",
"react-icons/fa",
"react-icons/fa6",
"react-icons/fc",
"react-icons/fi",
"react-icons/gi",
"react-icons/go",
"react-icons/gr",
"react-icons/hi",
"react-icons/hi2",
"react-icons/im",
"react-icons/io",
"react-icons/io5",
"react-icons/lia",
"react-icons/lib",
"react-icons/lu",
"react-icons/md",
"react-icons/pi",
"react-icons/ri",
"react-icons/rx",
"react-icons/si",
"react-icons/sl",
"react-icons/tb",
"react-icons/tfi",
"react-icons/ti",
"react-icons/vsc",
"react-icons/wi"
],
"trustHostHeader": false,
"isExperimentalCompile": false
},
"htmlLimitedBots": "[\\w-]+-Google|Google-[\\w-]+|Chrome-Lighthouse|Slurp|DuckDuckBot|baiduspider|yandex|sogou|bitlybot|tumblr|vkShare|quora link preview|redditbot|ia_archiver|Bingbot|BingPreview|applebot|facebookexternalhit|facebookcatalog|Twitterbot|LinkedInBot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|Yeti|googleweblight",
"bundlePagesRouterDependencies": false,
"configFileName": "next.config.ts",
"turbopack": {
"root": "C:\\source\\webshop\\shop"
},
"distDirRoot": ".next"
},
"appDir": "C:\\source\\webshop\\shop",
"relativeAppDir": "",
"files": [
".next\\routes-manifest.json",
".next\\server\\pages-manifest.json",
".next\\build-manifest.json",
".next\\prerender-manifest.json",
".next\\server\\functions-config-manifest.json",
".next\\server\\middleware-manifest.json",
".next\\server\\middleware-build-manifest.js",
".next\\server\\app-paths-manifest.json",
".next\\app-path-routes-manifest.json",
".next\\server\\server-reference-manifest.js",
".next\\server\\server-reference-manifest.json",
".next\\server\\prefetch-hints.json",
".next\\BUILD_ID",
".next\\server\\next-font-manifest.js",
".next\\server\\next-font-manifest.json",
".next\\required-server-files.json"
],
"ignore": []
}

View File

@@ -0,0 +1,332 @@
{
"version": 1,
"config": {
"env": {},
"webpack": null,
"typescript": {
"ignoreBuildErrors": false
},
"typedRoutes": false,
"distDir": ".next",
"cleanDistDir": true,
"assetPrefix": "",
"cacheMaxMemorySize": 52428800,
"configOrigin": "next.config.ts",
"useFileSystemPublicRoutes": true,
"generateEtags": true,
"pageExtensions": [
"tsx",
"ts",
"jsx",
"js"
],
"poweredByHeader": true,
"compress": true,
"images": {
"deviceSizes": [
640,
750,
828,
1080,
1200,
1920,
2048,
3840
],
"imageSizes": [
32,
48,
64,
96,
128,
256,
384
],
"path": "/_next/image",
"loader": "default",
"loaderFile": "",
"domains": [],
"disableStaticImages": false,
"minimumCacheTTL": 14400,
"formats": [
"image/webp"
],
"maximumRedirects": 3,
"maximumResponseBody": 50000000,
"dangerouslyAllowLocalIP": false,
"dangerouslyAllowSVG": false,
"contentSecurityPolicy": "script-src 'none'; frame-src 'none'; sandbox;",
"contentDispositionType": "attachment",
"localPatterns": [
{
"pathname": "**",
"search": ""
}
],
"remotePatterns": [],
"qualities": [
75
],
"unoptimized": false,
"customCacheHandler": false
},
"devIndicators": {
"position": "bottom-left"
},
"onDemandEntries": {
"maxInactiveAge": 60000,
"pagesBufferLength": 5
},
"basePath": "",
"sassOptions": {},
"trailingSlash": false,
"i18n": null,
"productionBrowserSourceMaps": false,
"excludeDefaultMomentLocales": true,
"reactProductionProfiling": false,
"reactStrictMode": null,
"reactMaxHeadersLength": 6000,
"httpAgentOptions": {
"keepAlive": true
},
"logging": {
"serverFunctions": true,
"browserToTerminal": "warn"
},
"compiler": {},
"expireTime": 31536000,
"staticPageGenerationTimeout": 60,
"modularizeImports": {
"@mui/icons-material": {
"transform": "@mui/icons-material/{{member}}"
},
"lodash": {
"transform": "lodash/{{member}}"
}
},
"outputFileTracingRoot": "C:\\source\\webshop\\shop",
"cacheComponents": false,
"cacheLife": {
"default": {
"stale": 300,
"revalidate": 900,
"expire": 4294967294
},
"seconds": {
"stale": 30,
"revalidate": 1,
"expire": 60
},
"minutes": {
"stale": 300,
"revalidate": 60,
"expire": 3600
},
"hours": {
"stale": 300,
"revalidate": 3600,
"expire": 86400
},
"days": {
"stale": 300,
"revalidate": 86400,
"expire": 604800
},
"weeks": {
"stale": 300,
"revalidate": 604800,
"expire": 2592000
},
"max": {
"stale": 300,
"revalidate": 2592000,
"expire": 31536000
}
},
"cacheHandlers": {},
"experimental": {
"appNewScrollHandler": false,
"useSkewCookie": false,
"cssChunking": true,
"multiZoneDraftMode": false,
"appNavFailHandling": false,
"prerenderEarlyExit": true,
"serverMinification": true,
"linkNoTouchStart": false,
"caseSensitiveRoutes": false,
"cachedNavigations": false,
"partialFallbacks": false,
"dynamicOnHover": false,
"varyParams": false,
"prefetchInlining": false,
"preloadEntriesOnStart": true,
"clientRouterFilter": true,
"clientRouterFilterRedirects": false,
"fetchCacheKeyPrefix": "",
"proxyPrefetch": "flexible",
"optimisticClientCache": true,
"manualClientBasePath": false,
"cpus": 15,
"memoryBasedWorkersCount": false,
"imgOptConcurrency": null,
"imgOptTimeoutInSeconds": 7,
"imgOptMaxInputPixels": 268402689,
"imgOptSequentialRead": null,
"imgOptSkipMetadata": null,
"isrFlushToDisk": true,
"workerThreads": false,
"optimizeCss": false,
"nextScriptWorkers": false,
"scrollRestoration": false,
"externalDir": false,
"disableOptimizedLoading": false,
"gzipSize": true,
"craCompat": false,
"esmExternals": true,
"fullySpecified": false,
"swcTraceProfiling": false,
"forceSwcTransforms": false,
"largePageDataBytes": 128000,
"typedEnv": false,
"parallelServerCompiles": false,
"parallelServerBuildTraces": false,
"ppr": false,
"authInterrupts": false,
"webpackMemoryOptimizations": false,
"optimizeServerReact": true,
"strictRouteTypes": false,
"viewTransition": false,
"removeUncaughtErrorAndRejectionListeners": false,
"validateRSCRequestHeaders": false,
"staleTimes": {
"dynamic": 0,
"static": 300
},
"reactDebugChannel": true,
"serverComponentsHmrCache": true,
"staticGenerationMaxConcurrency": 8,
"staticGenerationMinPagesPerWorker": 25,
"transitionIndicator": false,
"gestureTransition": false,
"inlineCss": false,
"useCache": false,
"globalNotFound": false,
"browserDebugInfoInTerminal": "warn",
"lockDistDir": true,
"proxyClientMaxBodySize": 10485760,
"hideLogsAfterAbort": false,
"mcpServer": true,
"turbopackFileSystemCacheForDev": true,
"turbopackFileSystemCacheForBuild": false,
"turbopackInferModuleSideEffects": true,
"turbopackPluginRuntimeStrategy": "childProcesses",
"optimizePackageImports": [
"lucide-react",
"date-fns",
"lodash-es",
"ramda",
"antd",
"react-bootstrap",
"ahooks",
"@ant-design/icons",
"@headlessui/react",
"@headlessui-float/react",
"@heroicons/react/20/solid",
"@heroicons/react/24/solid",
"@heroicons/react/24/outline",
"@visx/visx",
"@tremor/react",
"rxjs",
"@mui/material",
"@mui/icons-material",
"recharts",
"react-use",
"effect",
"@effect/schema",
"@effect/platform",
"@effect/platform-node",
"@effect/platform-browser",
"@effect/platform-bun",
"@effect/sql",
"@effect/sql-mssql",
"@effect/sql-mysql2",
"@effect/sql-pg",
"@effect/sql-sqlite-node",
"@effect/sql-sqlite-bun",
"@effect/sql-sqlite-wasm",
"@effect/sql-sqlite-react-native",
"@effect/rpc",
"@effect/rpc-http",
"@effect/typeclass",
"@effect/experimental",
"@effect/opentelemetry",
"@material-ui/core",
"@material-ui/icons",
"@tabler/icons-react",
"mui-core",
"react-icons/ai",
"react-icons/bi",
"react-icons/bs",
"react-icons/cg",
"react-icons/ci",
"react-icons/di",
"react-icons/fa",
"react-icons/fa6",
"react-icons/fc",
"react-icons/fi",
"react-icons/gi",
"react-icons/go",
"react-icons/gr",
"react-icons/hi",
"react-icons/hi2",
"react-icons/im",
"react-icons/io",
"react-icons/io5",
"react-icons/lia",
"react-icons/lib",
"react-icons/lu",
"react-icons/md",
"react-icons/pi",
"react-icons/ri",
"react-icons/rx",
"react-icons/si",
"react-icons/sl",
"react-icons/tb",
"react-icons/tfi",
"react-icons/ti",
"react-icons/vsc",
"react-icons/wi"
],
"trustHostHeader": false,
"isExperimentalCompile": false
},
"htmlLimitedBots": "[\\w-]+-Google|Google-[\\w-]+|Chrome-Lighthouse|Slurp|DuckDuckBot|baiduspider|yandex|sogou|bitlybot|tumblr|vkShare|quora link preview|redditbot|ia_archiver|Bingbot|BingPreview|applebot|facebookexternalhit|facebookcatalog|Twitterbot|LinkedInBot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|Yeti|googleweblight",
"bundlePagesRouterDependencies": false,
"configFileName": "next.config.ts",
"turbopack": {
"root": "C:\\source\\webshop\\shop"
},
"distDirRoot": ".next"
},
"appDir": "C:\\source\\webshop\\shop",
"relativeAppDir": "",
"files": [
".next\\routes-manifest.json",
".next\\server\\pages-manifest.json",
".next\\build-manifest.json",
".next\\prerender-manifest.json",
".next\\server\\functions-config-manifest.json",
".next\\server\\middleware-manifest.json",
".next\\server\\middleware-build-manifest.js",
".next\\server\\app-paths-manifest.json",
".next\\app-path-routes-manifest.json",
".next\\server\\server-reference-manifest.js",
".next\\server\\server-reference-manifest.json",
".next\\server\\prefetch-hints.json",
".next\\BUILD_ID",
".next\\server\\next-font-manifest.js",
".next\\server\\next-font-manifest.json",
".next\\required-server-files.json"
],
"ignore": []
}

View File

@@ -0,0 +1,204 @@
{
"version": 3,
"pages404": true,
"appType": "app",
"caseSensitive": false,
"basePath": "",
"redirects": [
{
"source": "/:path+/",
"destination": "/:path+",
"internal": true,
"priority": true,
"statusCode": 308,
"regex": "^(?:/((?:[^/]+?)(?:/(?:[^/]+?))*))/$"
}
],
"headers": [],
"onMatchHeaders": [],
"rewrites": {
"beforeFiles": [],
"afterFiles": [],
"fallback": []
},
"dynamicRoutes": [
{
"page": "/my-customers/[id]",
"regex": "^/my\\-customers/([^/]+?)(?:/)?$",
"routeKeys": {
"nxtPid": "nxtPid"
},
"namedRegex": "^/my\\-customers/(?<nxtPid>[^/]+?)(?:/)?$"
}
],
"staticRoutes": [
{
"page": "/",
"regex": "^/(?:/)?$",
"routeKeys": {},
"namedRegex": "^/(?:/)?$"
},
{
"page": "/_global-error",
"regex": "^/_global\\-error(?:/)?$",
"routeKeys": {},
"namedRegex": "^/_global\\-error(?:/)?$"
},
{
"page": "/_not-found",
"regex": "^/_not\\-found(?:/)?$",
"routeKeys": {},
"namedRegex": "^/_not\\-found(?:/)?$"
},
{
"page": "/admin",
"regex": "^/admin(?:/)?$",
"routeKeys": {},
"namedRegex": "^/admin(?:/)?$"
},
{
"page": "/admin/categories",
"regex": "^/admin/categories(?:/)?$",
"routeKeys": {},
"namedRegex": "^/admin/categories(?:/)?$"
},
{
"page": "/admin/orders",
"regex": "^/admin/orders(?:/)?$",
"routeKeys": {},
"namedRegex": "^/admin/orders(?:/)?$"
},
{
"page": "/admin/products",
"regex": "^/admin/products(?:/)?$",
"routeKeys": {},
"namedRegex": "^/admin/products(?:/)?$"
},
{
"page": "/admin/users",
"regex": "^/admin/users(?:/)?$",
"routeKeys": {},
"namedRegex": "^/admin/users(?:/)?$"
},
{
"page": "/api/admin/recent-orders",
"regex": "^/api/admin/recent\\-orders(?:/)?$",
"routeKeys": {},
"namedRegex": "^/api/admin/recent\\-orders(?:/)?$"
},
{
"page": "/auth/confirm",
"regex": "^/auth/confirm(?:/)?$",
"routeKeys": {},
"namedRegex": "^/auth/confirm(?:/)?$"
},
{
"page": "/auth/error",
"regex": "^/auth/error(?:/)?$",
"routeKeys": {},
"namedRegex": "^/auth/error(?:/)?$"
},
{
"page": "/auth/forgot-password",
"regex": "^/auth/forgot\\-password(?:/)?$",
"routeKeys": {},
"namedRegex": "^/auth/forgot\\-password(?:/)?$"
},
{
"page": "/auth/login",
"regex": "^/auth/login(?:/)?$",
"routeKeys": {},
"namedRegex": "^/auth/login(?:/)?$"
},
{
"page": "/auth/sign-up",
"regex": "^/auth/sign\\-up(?:/)?$",
"routeKeys": {},
"namedRegex": "^/auth/sign\\-up(?:/)?$"
},
{
"page": "/auth/sign-up-success",
"regex": "^/auth/sign\\-up\\-success(?:/)?$",
"routeKeys": {},
"namedRegex": "^/auth/sign\\-up\\-success(?:/)?$"
},
{
"page": "/auth/update-password",
"regex": "^/auth/update\\-password(?:/)?$",
"routeKeys": {},
"namedRegex": "^/auth/update\\-password(?:/)?$"
},
{
"page": "/favicon.ico",
"regex": "^/favicon\\.ico(?:/)?$",
"routeKeys": {},
"namedRegex": "^/favicon\\.ico(?:/)?$"
},
{
"page": "/my-customers",
"regex": "^/my\\-customers(?:/)?$",
"routeKeys": {},
"namedRegex": "^/my\\-customers(?:/)?$"
},
{
"page": "/my-customers/new",
"regex": "^/my\\-customers/new(?:/)?$",
"routeKeys": {},
"namedRegex": "^/my\\-customers/new(?:/)?$"
},
{
"page": "/my-orders",
"regex": "^/my\\-orders(?:/)?$",
"routeKeys": {},
"namedRegex": "^/my\\-orders(?:/)?$"
},
{
"page": "/opengraph-image.png",
"regex": "^/opengraph\\-image\\.png(?:/)?$",
"routeKeys": {},
"namedRegex": "^/opengraph\\-image\\.png(?:/)?$"
},
{
"page": "/order",
"regex": "^/order(?:/)?$",
"routeKeys": {},
"namedRegex": "^/order(?:/)?$"
},
{
"page": "/order/success",
"regex": "^/order/success(?:/)?$",
"routeKeys": {},
"namedRegex": "^/order/success(?:/)?$"
},
{
"page": "/protected",
"regex": "^/protected(?:/)?$",
"routeKeys": {},
"namedRegex": "^/protected(?:/)?$"
},
{
"page": "/twitter-image.png",
"regex": "^/twitter\\-image\\.png(?:/)?$",
"routeKeys": {},
"namedRegex": "^/twitter\\-image\\.png(?:/)?$"
}
],
"dataRoutes": [],
"rsc": {
"header": "rsc",
"varyHeader": "rsc, next-router-state-tree, next-router-prefetch, next-router-segment-prefetch",
"prefetchHeader": "next-router-prefetch",
"didPostponeHeader": "x-nextjs-postponed",
"contentTypeHeader": "text/x-component",
"suffix": ".rsc",
"prefetchSegmentHeader": "next-router-segment-prefetch",
"prefetchSegmentSuffix": ".segment.rsc",
"prefetchSegmentDirSuffix": ".segments",
"clientParamParsing": false,
"dynamicRSCPrerender": false
},
"rewriteHeaders": {
"pathHeader": "x-nextjs-rewritten-path",
"queryHeader": "x-nextjs-rewritten-query"
}
}

View File

@@ -0,0 +1,28 @@
{
"/_global-error/page": "app/_global-error/page.js",
"/_not-found/page": "app/_not-found/page.js",
"/admin/categories/page": "app/admin/categories/page.js",
"/admin/orders/page": "app/admin/orders/page.js",
"/admin/page": "app/admin/page.js",
"/admin/products/page": "app/admin/products/page.js",
"/admin/users/page": "app/admin/users/page.js",
"/api/admin/recent-orders/route": "app/api/admin/recent-orders/route.js",
"/auth/confirm/route": "app/auth/confirm/route.js",
"/auth/error/page": "app/auth/error/page.js",
"/auth/forgot-password/page": "app/auth/forgot-password/page.js",
"/auth/login/page": "app/auth/login/page.js",
"/auth/sign-up-success/page": "app/auth/sign-up-success/page.js",
"/auth/sign-up/page": "app/auth/sign-up/page.js",
"/auth/update-password/page": "app/auth/update-password/page.js",
"/favicon.ico/route": "app/favicon.ico/route.js",
"/my-customers/[id]/page": "app/my-customers/[id]/page.js",
"/my-customers/new/page": "app/my-customers/new/page.js",
"/my-customers/page": "app/my-customers/page.js",
"/my-orders/page": "app/my-orders/page.js",
"/opengraph-image.png/route": "app/opengraph-image.png/route.js",
"/order/page": "app/order/page.js",
"/order/success/page": "app/order/success/page.js",
"/page": "app/page.js",
"/protected/page": "app/protected/page.js",
"/twitter-image.png/route": "app/twitter-image.png/route.js"
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,15 @@
{
"status": 500,
"headers": {
"x-nextjs-stale-time": "300",
"x-nextjs-prerender": "1",
"x-next-cache-tags": "_N_T_/layout,_N_T_/_global-error/layout,_N_T_/_global-error/page,_N_T_/_global-error"
},
"segmentPaths": [
"/_tree",
"/_full",
"/__PAGE__",
"/_index",
"/_head"
]
}

View File

@@ -0,0 +1,15 @@
1:"$Sreact.fragment"
2:I[39756,["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"default"]
3:I[37457,["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"default"]
4:I[97367,["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"OutletBoundary"]
5:"$Sreact.suspense"
8:I[97367,["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"ViewportBoundary"]
a:I[97367,["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"MetadataBoundary"]
c:I[68027,["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"default",1]
0:{"P":null,"c":["","_global-error"],"q":"","i":false,"f":[[["",{"children":["__PAGE__",{}]}],[["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[["$","html",null,{"id":"__next_error__","children":[["$","head",null,{"children":[["$","title",null,{"children":"500: This page couldnt load"}],["$","style",null,{"dangerouslySetInnerHTML":{"__html":":root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }"}}]]}],["$","body",null,{"children":["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","display":"flex","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"style":{"marginTop":"-32px","maxWidth":"325px","padding":"32px 28px","textAlign":"left"},"children":[["$","svg",null,{"width":"32","height":"32","viewBox":"-0.2 -1.5 32 32","fill":"none","style":{"marginBottom":"24px"},"children":["$","path",null,{"d":"M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z","fill":"var(--next-error-title)"}]}],["$","h1",null,{"style":{"fontSize":"24px","fontWeight":500,"letterSpacing":"-0.02em","lineHeight":"32px","margin":"0 0 12px 0","color":"var(--next-error-title)"},"children":"This page couldnt load"}],["$","p",null,{"style":{"fontSize":"14px","fontWeight":400,"lineHeight":"21px","margin":"0 0 20px 0","color":"var(--next-error-message)"},"children":"A server error occurred. Reload to try again."}],["$","form",null,{"style":{"margin":0},"children":["$","button",null,{"type":"submit","style":{"display":"inline-flex","alignItems":"center","justifyContent":"center","height":"32px","padding":"0 12px","fontSize":"14px","fontWeight":500,"lineHeight":"20px","borderRadius":"6px","cursor":"pointer","color":"var(--next-error-btn-text)","background":"var(--next-error-btn-bg)","border":"var(--next-error-btn-border)"},"children":"Reload"}]}]]}]}]}]]}],null,["$","$L4",null,{"children":["$","$5",null,{"name":"Next.MetadataOutlet","children":"$@6"}]}]]}],{},null,false,null]},null,false,"$@7"],["$","$1","h",{"children":[null,["$","$L8",null,{"children":"$L9"}],["$","div",null,{"hidden":true,"children":["$","$La",null,{"children":["$","$5",null,{"name":"Next.Metadata","children":"$Lb"}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],false]],"m":"$undefined","G":["$c",[]],"S":true,"h":null,"s":"$undefined","l":"$undefined","p":"$undefined","d":"$undefined","b":"czEjVggXDRFH51IopN6_9"}
d:[]
7:"$Wd"
9:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]
e:I[27201,["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"IconMark"]
6:null
b:[["$","link","0",{"rel":"icon","href":"/favicon.ico?favicon.0x3dzn~oxb6tn.ico","sizes":"256x256","type":"image/x-icon"}],["$","$Le","1",{}]]

View File

@@ -0,0 +1,5 @@
1:"$Sreact.fragment"
2:I[97367,["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"OutletBoundary"]
3:"$Sreact.suspense"
0:{"rsc":["$","$1","c",{"children":[["$","html",null,{"id":"__next_error__","children":[["$","head",null,{"children":[["$","title",null,{"children":"500: This page couldnt load"}],["$","style",null,{"dangerouslySetInnerHTML":{"__html":":root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }"}}]]}],["$","body",null,{"children":["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","display":"flex","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"style":{"marginTop":"-32px","maxWidth":"325px","padding":"32px 28px","textAlign":"left"},"children":[["$","svg",null,{"width":"32","height":"32","viewBox":"-0.2 -1.5 32 32","fill":"none","style":{"marginBottom":"24px"},"children":["$","path",null,{"d":"M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z","fill":"var(--next-error-title)"}]}],["$","h1",null,{"style":{"fontSize":"24px","fontWeight":500,"letterSpacing":"-0.02em","lineHeight":"32px","margin":"0 0 12px 0","color":"var(--next-error-title)"},"children":"This page couldnt load"}],["$","p",null,{"style":{"fontSize":"14px","fontWeight":400,"lineHeight":"21px","margin":"0 0 20px 0","color":"var(--next-error-message)"},"children":"A server error occurred. Reload to try again."}],["$","form",null,{"style":{"margin":0},"children":["$","button",null,{"type":"submit","style":{"display":"inline-flex","alignItems":"center","justifyContent":"center","height":"32px","padding":"0 12px","fontSize":"14px","fontWeight":500,"lineHeight":"20px","borderRadius":"6px","cursor":"pointer","color":"var(--next-error-btn-text)","background":"var(--next-error-btn-bg)","border":"var(--next-error-btn-border)"},"children":"Reload"}]}]]}]}]}]]}],null,["$","$L2",null,{"children":["$","$3",null,{"name":"Next.MetadataOutlet","children":"$@4"}]}]]}],"isPartial":false,"staleTime":300,"varyParams":null,"buildId":"czEjVggXDRFH51IopN6_9"}
4:null

View File

@@ -0,0 +1,15 @@
1:"$Sreact.fragment"
2:I[39756,["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"default"]
3:I[37457,["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"default"]
4:I[97367,["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"OutletBoundary"]
5:"$Sreact.suspense"
8:I[97367,["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"ViewportBoundary"]
a:I[97367,["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"MetadataBoundary"]
c:I[68027,["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"default",1]
0:{"P":null,"c":["","_global-error"],"q":"","i":false,"f":[[["",{"children":["__PAGE__",{}]}],[["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[["$","html",null,{"id":"__next_error__","children":[["$","head",null,{"children":[["$","title",null,{"children":"500: This page couldnt load"}],["$","style",null,{"dangerouslySetInnerHTML":{"__html":":root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }"}}]]}],["$","body",null,{"children":["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","display":"flex","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"style":{"marginTop":"-32px","maxWidth":"325px","padding":"32px 28px","textAlign":"left"},"children":[["$","svg",null,{"width":"32","height":"32","viewBox":"-0.2 -1.5 32 32","fill":"none","style":{"marginBottom":"24px"},"children":["$","path",null,{"d":"M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z","fill":"var(--next-error-title)"}]}],["$","h1",null,{"style":{"fontSize":"24px","fontWeight":500,"letterSpacing":"-0.02em","lineHeight":"32px","margin":"0 0 12px 0","color":"var(--next-error-title)"},"children":"This page couldnt load"}],["$","p",null,{"style":{"fontSize":"14px","fontWeight":400,"lineHeight":"21px","margin":"0 0 20px 0","color":"var(--next-error-message)"},"children":"A server error occurred. Reload to try again."}],["$","form",null,{"style":{"margin":0},"children":["$","button",null,{"type":"submit","style":{"display":"inline-flex","alignItems":"center","justifyContent":"center","height":"32px","padding":"0 12px","fontSize":"14px","fontWeight":500,"lineHeight":"20px","borderRadius":"6px","cursor":"pointer","color":"var(--next-error-btn-text)","background":"var(--next-error-btn-bg)","border":"var(--next-error-btn-border)"},"children":"Reload"}]}]]}]}]}]]}],null,["$","$L4",null,{"children":["$","$5",null,{"name":"Next.MetadataOutlet","children":"$@6"}]}]]}],{},null,false,null]},null,false,"$@7"],["$","$1","h",{"children":[null,["$","$L8",null,{"children":"$L9"}],["$","div",null,{"hidden":true,"children":["$","$La",null,{"children":["$","$5",null,{"name":"Next.Metadata","children":"$Lb"}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],false]],"m":"$undefined","G":["$c",[]],"S":true,"h":null,"s":"$undefined","l":"$undefined","p":"$undefined","d":"$undefined","b":"czEjVggXDRFH51IopN6_9"}
d:[]
7:"$Wd"
9:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]
e:I[27201,["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"IconMark"]
6:null
b:[["$","link","0",{"rel":"icon","href":"/favicon.ico?favicon.0x3dzn~oxb6tn.ico","sizes":"256x256","type":"image/x-icon"}],["$","$Le","1",{}]]

View File

@@ -0,0 +1,6 @@
1:"$Sreact.fragment"
2:I[97367,["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"ViewportBoundary"]
3:I[97367,["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"MetadataBoundary"]
4:"$Sreact.suspense"
5:I[27201,["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"IconMark"]
0:{"rsc":["$","$1","h",{"children":[null,["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","link","0",{"rel":"icon","href":"/favicon.ico?favicon.0x3dzn~oxb6tn.ico","sizes":"256x256","type":"image/x-icon"}],["$","$L5","1",{}]]}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],"isPartial":false,"staleTime":300,"varyParams":null,"buildId":"czEjVggXDRFH51IopN6_9"}

View File

@@ -0,0 +1,5 @@
1:"$Sreact.fragment"
2:I[39756,["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"default"]
3:I[37457,["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"default"]
4:[]
0:{"rsc":["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}]]}],"isPartial":false,"staleTime":300,"varyParams":"$W4","buildId":"czEjVggXDRFH51IopN6_9"}

View File

@@ -0,0 +1 @@
0:{"tree":{"name":"","param":null,"prefetchHints":0,"slots":{"children":{"name":"__PAGE__","param":null,"prefetchHints":0,"slots":null}}},"staleTime":300,"buildId":"czEjVggXDRFH51IopN6_9"}

View File

@@ -0,0 +1,12 @@
var R=require("../../chunks/ssr/[turbopack]_runtime.js")("server/app/_global-error/page.js")
R.c("server/chunks/ssr/[root-of-the-server]__0~c929r._.js")
R.c("server/chunks/ssr/node_modules_next_dist_060d1m.._.js")
R.c("server/chunks/ssr/node_modules_next_dist_0ixdcs~._.js")
R.c("server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0nsg22r.js")
R.c("server/chunks/ssr/[root-of-the-server]__0.m8mql._.js")
R.c("server/chunks/ssr/[root-of-the-server]__0.angw.._.js")
R.c("server/chunks/ssr/node_modules_next_dist_compiled_@opentelemetry_api_index_0zv0b3p.js")
R.c("server/chunks/ssr/node_modules_next_dist_client_components_builtin_global-error_0lgvd_..js")
R.c("server/chunks/ssr/_next-internal_server_app__global-error_page_actions_0k77kol.js")
R.m(99158)
module.exports=R.m(99158).exports

View File

@@ -0,0 +1,5 @@
{
"version": 3,
"sources": [],
"sections": []
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,3 @@
{
"/_global-error/page": "app/_global-error/page.js"
}

View File

@@ -0,0 +1,19 @@
{
"devFiles": [],
"ampDevFiles": [],
"polyfillFiles": [
"static/chunks/03~yq9q893hmn.js"
],
"lowPriorityFiles": [],
"rootMainFiles": [
"static/chunks/0ze4gu236oq96.js",
"static/chunks/10qd__0r7a~.l.js",
"static/chunks/0-gaanm6h49z~.js",
"static/chunks/06c8h6921f-oo.js",
"static/chunks/15jasrm2107sy.js",
"static/chunks/181uojwh.t2ik.js",
"static/chunks/turbopack-0u.mb44r17v0_.js"
],
"pages": {},
"ampFirstPages": []
}

View File

@@ -0,0 +1,6 @@
{
"pages": {},
"app": {},
"appUsingSizeAdjust": false,
"pagesUsingSizeAdjust": false
}

View File

@@ -0,0 +1,4 @@
{
"node": {},
"edge": {}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,16 @@
{
"status": 404,
"headers": {
"x-nextjs-stale-time": "300",
"x-nextjs-prerender": "1",
"x-next-cache-tags": "_N_T_/layout,_N_T_/_not-found/layout,_N_T_/_not-found/page,_N_T_/_not-found"
},
"segmentPaths": [
"/_tree",
"/_full",
"/_not-found/__PAGE__",
"/_not-found",
"/_index",
"/_head"
]
}

View File

@@ -0,0 +1,17 @@
1:"$Sreact.fragment"
2:I[63178,["/_next/static/chunks/0usmzazea5o36.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"ThemeProvider"]
3:I[39756,["/_next/static/chunks/0usmzazea5o36.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"default"]
4:I[37457,["/_next/static/chunks/0usmzazea5o36.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"default"]
5:I[97367,["/_next/static/chunks/0usmzazea5o36.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"OutletBoundary"]
6:"$Sreact.suspense"
9:I[97367,["/_next/static/chunks/0usmzazea5o36.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"ViewportBoundary"]
b:I[97367,["/_next/static/chunks/0usmzazea5o36.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"MetadataBoundary"]
d:I[68027,["/_next/static/chunks/0usmzazea5o36.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"default",1]
:HL["/_next/static/chunks/00s_sac~t0ps5.css","style"]
0:{"P":null,"c":["","_not-found"],"q":"","i":false,"f":[[["",{"children":["/_not-found",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",16],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/00s_sac~t0ps5.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/_next/static/chunks/0usmzazea5o36.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/_next/static/chunks/0d3shmwh5_nmn.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","suppressHydrationWarning":true,"children":["$","body",null,{"className":"geist_6ee70f7-module__6GiuUG__className antialiased","children":["$","$L2",null,{"attribute":"class","defaultTheme":"system","enableSystem":true,"disableTransitionOnChange":true,"children":["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:style","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:1:props:style","children":404}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:style","children":["$","h2",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style","children":"This page could not be found."}]}]]}]}]],null,["$","$L5",null,{"children":["$","$6",null,{"name":"Next.MetadataOutlet","children":"$@7"}]}]]}],{},null,false,null]},null,false,"$@8"]},null,false,null],["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$L9",null,{"children":"$La"}],["$","div",null,{"hidden":true,"children":["$","$Lb",null,{"children":["$","$6",null,{"name":"Next.Metadata","children":"$Lc"}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],false]],"m":"$undefined","G":["$d",[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/00s_sac~t0ps5.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]]],"S":true,"h":null,"s":"$undefined","l":"$undefined","p":"$undefined","d":"$undefined","b":"czEjVggXDRFH51IopN6_9"}
e:[]
8:"$We"
a:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]
f:I[27201,["/_next/static/chunks/0usmzazea5o36.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"IconMark"]
7:null
c:[["$","title","0",{"children":"CASPOS-Shop | Die Kasse"}],["$","meta","1",{"name":"description","content":"Konfigurieren und bestellen Sie Ihre maßgeschneiderte Business-Software in Minuten."}],["$","meta","2",{"property":"og:title","content":"CASPOS-Shop | Die Kasse"}],["$","meta","3",{"property":"og:description","content":"Konfigurieren und bestellen Sie Ihre maßgeschneiderte Business-Software in Minuten."}],["$","meta","4",{"property":"og:image","content":"http://localhost:3000/opengraph-image.png?opengraph-image.0rmepv3m6lsw4.png"}],["$","meta","5",{"property":"og:image:type","content":"image/png"}],["$","meta","6",{"property":"og:image:width","content":"1200"}],["$","meta","7",{"property":"og:image:height","content":"600"}],["$","meta","8",{"name":"twitter:card","content":"summary_large_image"}],["$","meta","9",{"name":"twitter:title","content":"CASPOS-Shop | Die Kasse"}],["$","meta","10",{"name":"twitter:description","content":"Konfigurieren und bestellen Sie Ihre maßgeschneiderte Business-Software in Minuten."}],["$","meta","11",{"name":"twitter:image","content":"http://localhost:3000/twitter-image.png?twitter-image.0rmepv3m6lsw4.png"}],["$","meta","12",{"name":"twitter:image:type","content":"image/png"}],["$","meta","13",{"name":"twitter:image:width","content":"1200"}],["$","meta","14",{"name":"twitter:image:height","content":"600"}],["$","link","15",{"rel":"icon","href":"/favicon.ico?favicon.0x3dzn~oxb6tn.ico","sizes":"256x256","type":"image/x-icon"}],["$","$Lf","16",{}]]

View File

@@ -0,0 +1,17 @@
1:"$Sreact.fragment"
2:I[63178,["/_next/static/chunks/0usmzazea5o36.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"ThemeProvider"]
3:I[39756,["/_next/static/chunks/0usmzazea5o36.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"default"]
4:I[37457,["/_next/static/chunks/0usmzazea5o36.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"default"]
5:I[97367,["/_next/static/chunks/0usmzazea5o36.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"OutletBoundary"]
6:"$Sreact.suspense"
9:I[97367,["/_next/static/chunks/0usmzazea5o36.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"ViewportBoundary"]
b:I[97367,["/_next/static/chunks/0usmzazea5o36.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"MetadataBoundary"]
d:I[68027,["/_next/static/chunks/0usmzazea5o36.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"default",1]
:HL["/_next/static/chunks/00s_sac~t0ps5.css","style"]
0:{"P":null,"c":["","_not-found"],"q":"","i":false,"f":[[["",{"children":["/_not-found",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",16],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/00s_sac~t0ps5.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/_next/static/chunks/0usmzazea5o36.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/_next/static/chunks/0d3shmwh5_nmn.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","suppressHydrationWarning":true,"children":["$","body",null,{"className":"geist_6ee70f7-module__6GiuUG__className antialiased","children":["$","$L2",null,{"attribute":"class","defaultTheme":"system","enableSystem":true,"disableTransitionOnChange":true,"children":["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:style","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:1:props:style","children":404}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:style","children":["$","h2",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style","children":"This page could not be found."}]}]]}]}]],null,["$","$L5",null,{"children":["$","$6",null,{"name":"Next.MetadataOutlet","children":"$@7"}]}]]}],{},null,false,null]},null,false,"$@8"]},null,false,null],["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$L9",null,{"children":"$La"}],["$","div",null,{"hidden":true,"children":["$","$Lb",null,{"children":["$","$6",null,{"name":"Next.Metadata","children":"$Lc"}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],false]],"m":"$undefined","G":["$d",[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/00s_sac~t0ps5.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]]],"S":true,"h":null,"s":"$undefined","l":"$undefined","p":"$undefined","d":"$undefined","b":"czEjVggXDRFH51IopN6_9"}
e:[]
8:"$We"
a:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]
f:I[27201,["/_next/static/chunks/0usmzazea5o36.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"IconMark"]
7:null
c:[["$","title","0",{"children":"CASPOS-Shop | Die Kasse"}],["$","meta","1",{"name":"description","content":"Konfigurieren und bestellen Sie Ihre maßgeschneiderte Business-Software in Minuten."}],["$","meta","2",{"property":"og:title","content":"CASPOS-Shop | Die Kasse"}],["$","meta","3",{"property":"og:description","content":"Konfigurieren und bestellen Sie Ihre maßgeschneiderte Business-Software in Minuten."}],["$","meta","4",{"property":"og:image","content":"http://localhost:3000/opengraph-image.png?opengraph-image.0rmepv3m6lsw4.png"}],["$","meta","5",{"property":"og:image:type","content":"image/png"}],["$","meta","6",{"property":"og:image:width","content":"1200"}],["$","meta","7",{"property":"og:image:height","content":"600"}],["$","meta","8",{"name":"twitter:card","content":"summary_large_image"}],["$","meta","9",{"name":"twitter:title","content":"CASPOS-Shop | Die Kasse"}],["$","meta","10",{"name":"twitter:description","content":"Konfigurieren und bestellen Sie Ihre maßgeschneiderte Business-Software in Minuten."}],["$","meta","11",{"name":"twitter:image","content":"http://localhost:3000/twitter-image.png?twitter-image.0rmepv3m6lsw4.png"}],["$","meta","12",{"name":"twitter:image:type","content":"image/png"}],["$","meta","13",{"name":"twitter:image:width","content":"1200"}],["$","meta","14",{"name":"twitter:image:height","content":"600"}],["$","link","15",{"rel":"icon","href":"/favicon.ico?favicon.0x3dzn~oxb6tn.ico","sizes":"256x256","type":"image/x-icon"}],["$","$Lf","16",{}]]

View File

@@ -0,0 +1,6 @@
1:"$Sreact.fragment"
2:I[97367,["/_next/static/chunks/0usmzazea5o36.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"ViewportBoundary"]
3:I[97367,["/_next/static/chunks/0usmzazea5o36.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"MetadataBoundary"]
4:"$Sreact.suspense"
5:I[27201,["/_next/static/chunks/0usmzazea5o36.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"IconMark"]
0:{"rsc":["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"CASPOS-Shop | Die Kasse"}],["$","meta","1",{"name":"description","content":"Konfigurieren und bestellen Sie Ihre maßgeschneiderte Business-Software in Minuten."}],["$","meta","2",{"property":"og:title","content":"CASPOS-Shop | Die Kasse"}],["$","meta","3",{"property":"og:description","content":"Konfigurieren und bestellen Sie Ihre maßgeschneiderte Business-Software in Minuten."}],["$","meta","4",{"property":"og:image","content":"http://localhost:3000/opengraph-image.png?opengraph-image.0rmepv3m6lsw4.png"}],["$","meta","5",{"property":"og:image:type","content":"image/png"}],["$","meta","6",{"property":"og:image:width","content":"1200"}],["$","meta","7",{"property":"og:image:height","content":"600"}],["$","meta","8",{"name":"twitter:card","content":"summary_large_image"}],["$","meta","9",{"name":"twitter:title","content":"CASPOS-Shop | Die Kasse"}],["$","meta","10",{"name":"twitter:description","content":"Konfigurieren und bestellen Sie Ihre maßgeschneiderte Business-Software in Minuten."}],["$","meta","11",{"name":"twitter:image","content":"http://localhost:3000/twitter-image.png?twitter-image.0rmepv3m6lsw4.png"}],["$","meta","12",{"name":"twitter:image:type","content":"image/png"}],["$","meta","13",{"name":"twitter:image:width","content":"1200"}],["$","meta","14",{"name":"twitter:image:height","content":"600"}],["$","link","15",{"rel":"icon","href":"/favicon.ico?favicon.0x3dzn~oxb6tn.ico","sizes":"256x256","type":"image/x-icon"}],["$","$L5","16",{}]]}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],"isPartial":false,"staleTime":300,"varyParams":null,"buildId":"czEjVggXDRFH51IopN6_9"}

View File

@@ -0,0 +1,6 @@
1:"$Sreact.fragment"
2:I[63178,["/_next/static/chunks/0usmzazea5o36.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"ThemeProvider"]
3:I[39756,["/_next/static/chunks/0usmzazea5o36.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"default"]
4:I[37457,["/_next/static/chunks/0usmzazea5o36.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"default"]
:HL["/_next/static/chunks/00s_sac~t0ps5.css","style"]
0:{"rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/00s_sac~t0ps5.css","precedence":"next"}],["$","script","script-0",{"src":"/_next/static/chunks/0usmzazea5o36.js","async":true}],["$","script","script-1",{"src":"/_next/static/chunks/0d3shmwh5_nmn.js","async":true}]],["$","html",null,{"lang":"en","suppressHydrationWarning":true,"children":["$","body",null,{"className":"geist_6ee70f7-module__6GiuUG__className antialiased","children":["$","$L2",null,{"attribute":"class","defaultTheme":"system","enableSystem":true,"disableTransitionOnChange":true,"children":["$","$L3",null,{"parallelRouterKey":"children","template":["$","$L4",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]}]}]}]]}],"isPartial":false,"staleTime":300,"varyParams":null,"buildId":"czEjVggXDRFH51IopN6_9"}

View File

@@ -0,0 +1,5 @@
1:"$Sreact.fragment"
2:I[39756,["/_next/static/chunks/0usmzazea5o36.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"default"]
3:I[37457,["/_next/static/chunks/0usmzazea5o36.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"default"]
4:[]
0:{"rsc":["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}]]}],"isPartial":false,"staleTime":300,"varyParams":"$W4","buildId":"czEjVggXDRFH51IopN6_9"}

View File

@@ -0,0 +1,5 @@
1:"$Sreact.fragment"
2:I[97367,["/_next/static/chunks/0usmzazea5o36.js","/_next/static/chunks/0d3shmwh5_nmn.js"],"OutletBoundary"]
3:"$Sreact.suspense"
0:{"rsc":["$","$1","c",{"children":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],null,["$","$L2",null,{"children":["$","$3",null,{"name":"Next.MetadataOutlet","children":"$@4"}]}]]}],"isPartial":false,"staleTime":300,"varyParams":null,"buildId":"czEjVggXDRFH51IopN6_9"}
4:null

View File

@@ -0,0 +1,2 @@
:HL["/_next/static/chunks/00s_sac~t0ps5.css","style"]
0:{"tree":{"name":"","param":null,"prefetchHints":16,"slots":{"children":{"name":"/_not-found","param":null,"prefetchHints":0,"slots":{"children":{"name":"__PAGE__","param":null,"prefetchHints":0,"slots":null}}}}},"staleTime":300,"buildId":"czEjVggXDRFH51IopN6_9"}

View File

@@ -0,0 +1,15 @@
var R=require("../../chunks/ssr/[turbopack]_runtime.js")("server/app/_not-found/page.js")
R.c("server/chunks/ssr/[root-of-the-server]__07-.vk-._.js")
R.c("server/chunks/ssr/node_modules_next_dist_060d1m.._.js")
R.c("server/chunks/ssr/node_modules_next_dist_0ixdcs~._.js")
R.c("server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0gw4z76.js")
R.c("server/chunks/ssr/[root-of-the-server]__0.m8mql._.js")
R.c("server/chunks/ssr/[root-of-the-server]__0.angw.._.js")
R.c("server/chunks/ssr/node_modules_next_dist_compiled_@opentelemetry_api_index_0zv0b3p.js")
R.c("server/chunks/ssr/[root-of-the-server]__0btml7h._.js")
R.c("server/chunks/ssr/node_modules_next_dist_client_components_0inhx6q._.js")
R.c("server/chunks/ssr/node_modules_next_dist_client_components_builtin_forbidden_0ghu-f7.js")
R.c("server/chunks/ssr/node_modules_next_dist_client_components_builtin_unauthorized_0cjv-23.js")
R.c("server/chunks/ssr/_next-internal_server_app__not-found_page_actions_0eq97pa.js")
R.m(37047)
module.exports=R.m(37047).exports

View File

@@ -0,0 +1,5 @@
{
"version": 3,
"sources": [],
"sections": []
}

File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More