@useprint/preview 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (228) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +5 -5
  3. package/.next/diagnostics/framework.json +1 -1
  4. package/.next/images-manifest.json +1 -0
  5. package/.next/next-minimal-server.js.nft.json +1 -1
  6. package/.next/next-server.js.nft.json +1 -1
  7. package/.next/prerender-manifest.json +3 -5
  8. package/.next/required-server-files.js +324 -0
  9. package/.next/required-server-files.json +11 -8
  10. package/.next/routes-manifest.json +1 -1
  11. package/.next/server/app/_global-error/page.js +3 -3
  12. package/.next/server/app/_global-error/page.js.nft.json +1 -1
  13. package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  14. package/.next/server/app/_global-error.html +2 -2
  15. package/.next/server/app/_global-error.meta +2 -1
  16. package/.next/server/app/_global-error.rsc +2 -3
  17. package/.next/server/app/_global-error.segments/_full.segment.rsc +2 -3
  18. package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  19. package/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  20. package/.next/server/app/_global-error.segments/_head.segment.rsc +5 -0
  21. package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  22. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -8
  23. package/.next/server/app/_not-found/page.js +2 -2
  24. package/.next/server/app/_not-found/page.js.nft.json +1 -1
  25. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  26. package/.next/server/app/favicon.ico/route.js +1 -1
  27. package/.next/server/app/favicon.ico/route.js.nft.json +1 -1
  28. package/.next/server/app/favicon.ico.body +0 -0
  29. package/.next/server/app/page.js +2 -2
  30. package/.next/server/app/page.js.nft.json +1 -1
  31. package/.next/server/app/page_client-reference-manifest.js +1 -1
  32. package/.next/server/app/preview/[...slug]/page.js +102 -219
  33. package/.next/server/app/preview/[...slug]/page.js.nft.json +1 -1
  34. package/.next/server/app/preview/[...slug]/page_client-reference-manifest.js +1 -1
  35. package/.next/server/chunks/337.js +3 -0
  36. package/.next/server/chunks/377.js +1 -0
  37. package/.next/server/chunks/445.js +22 -0
  38. package/.next/server/chunks/471.js +13 -0
  39. package/.next/server/chunks/820.js +1 -0
  40. package/.next/server/chunks/95.js +4 -4
  41. package/.next/server/chunks/static/media/pdf.worker.min.3327dba1.mjs +8 -0
  42. package/.next/server/middleware-build-manifest.js +1 -1
  43. package/.next/server/next-font-manifest.js +1 -1
  44. package/.next/server/next-font-manifest.json +1 -1
  45. package/.next/server/pages/500.html +2 -2
  46. package/.next/server/server-reference-manifest.js +1 -1
  47. package/.next/server/server-reference-manifest.json +1 -1
  48. package/.next/server/webpack-runtime.js +1 -1
  49. package/.next/static/chunks/134-e1901aa4c8d7c5e4.js +1 -0
  50. package/.next/static/chunks/399-119d2a8d117d3501.js +1 -0
  51. package/.next/static/chunks/4bd1b696-096d35a2bd1da3af.js +1 -0
  52. package/.next/static/chunks/576-c76dd52ea4e7fe70.js +1 -0
  53. package/.next/static/chunks/794-96cfa93198fb4e82.js +2 -0
  54. package/.next/static/chunks/818-09ed5fa3e6aa2cec.js +9 -0
  55. package/.next/static/chunks/aad4249a-49e9609864e9e734.js +2 -0
  56. package/.next/static/chunks/app/layout-7711ba9e6b7bcccc.js +1 -0
  57. package/.next/static/chunks/app/preview/[...slug]/page-2ce7c5eb36e7cd8b.js +1 -0
  58. package/.next/static/chunks/{c828b8b5-6f56633e9da941cb.js → c828b8b5-fe0be434537dde60.js} +2 -2
  59. package/.next/static/chunks/framework-2d4b35820b5e3e1e.js +1 -0
  60. package/.next/static/chunks/main-d2bae8996dc5307c.js +5 -0
  61. package/.next/static/chunks/{webpack-b8e17eaab329ee72.js → webpack-96cba10d3fe872ec.js} +1 -1
  62. package/.next/static/css/30dcbab3549c2dfe.css +4 -0
  63. package/.next/static/media/inter-cyrillic-400-normal.372704ff.woff2 +0 -0
  64. package/.next/static/media/inter-cyrillic-400-normal.a6b6ef6f.woff +0 -0
  65. package/.next/static/media/inter-cyrillic-500-normal.7c15bba8.woff2 +0 -0
  66. package/.next/static/media/inter-cyrillic-500-normal.b9f8c929.woff +0 -0
  67. package/.next/static/media/inter-cyrillic-600-normal.2f42892a.woff2 +0 -0
  68. package/.next/static/media/inter-cyrillic-600-normal.c3987adc.woff +0 -0
  69. package/.next/static/media/inter-cyrillic-700-normal.93eba3c3.woff +0 -0
  70. package/.next/static/media/inter-cyrillic-700-normal.e9e5b2dc.woff2 +0 -0
  71. package/.next/static/media/inter-cyrillic-ext-400-normal.2a31c04b.woff +0 -0
  72. package/.next/static/media/inter-cyrillic-ext-400-normal.f572b170.woff2 +0 -0
  73. package/.next/static/media/inter-cyrillic-ext-500-normal.5a6bb1da.woff +0 -0
  74. package/.next/static/media/inter-cyrillic-ext-500-normal.fe0d9b14.woff2 +0 -0
  75. package/.next/static/media/inter-cyrillic-ext-600-normal.ecbdecad.woff +0 -0
  76. package/.next/static/media/inter-cyrillic-ext-600-normal.f7b3c15b.woff2 +0 -0
  77. package/.next/static/media/inter-cyrillic-ext-700-normal.4b4022a6.woff +0 -0
  78. package/.next/static/media/inter-cyrillic-ext-700-normal.74b516d2.woff2 +0 -0
  79. package/.next/static/media/inter-greek-400-normal.cc58c11b.woff +0 -0
  80. package/.next/static/media/inter-greek-400-normal.d7020e3c.woff2 +0 -0
  81. package/.next/static/media/inter-greek-500-normal.d9a33207.woff +0 -0
  82. package/.next/static/media/inter-greek-500-normal.f41f43db.woff2 +0 -0
  83. package/.next/static/media/inter-greek-600-normal.4ec0c1c1.woff +0 -0
  84. package/.next/static/media/inter-greek-600-normal.cc532937.woff2 +0 -0
  85. package/.next/static/media/inter-greek-700-normal.5ec6c758.woff +0 -0
  86. package/.next/static/media/inter-greek-700-normal.97f0eeeb.woff2 +0 -0
  87. package/.next/static/media/inter-greek-ext-400-normal.4ce1df5d.woff2 +0 -0
  88. package/.next/static/media/inter-greek-ext-400-normal.88ede1ea.woff +0 -0
  89. package/.next/static/media/inter-greek-ext-500-normal.7a4aa726.woff +0 -0
  90. package/.next/static/media/inter-greek-ext-500-normal.cbd51e2d.woff2 +0 -0
  91. package/.next/static/media/inter-greek-ext-600-normal.089a95ee.woff +0 -0
  92. package/.next/static/media/inter-greek-ext-600-normal.1f33d317.woff2 +0 -0
  93. package/.next/static/media/inter-greek-ext-700-normal.31f1075d.woff +0 -0
  94. package/.next/static/media/inter-greek-ext-700-normal.827cd618.woff2 +0 -0
  95. package/.next/static/media/inter-latin-400-normal.2c7a775c.woff +0 -0
  96. package/.next/static/media/inter-latin-400-normal.ef6d3f52.woff2 +0 -0
  97. package/.next/static/media/inter-latin-500-normal.b7b43ace.woff2 +0 -0
  98. package/.next/static/media/inter-latin-500-normal.cb4c8ceb.woff +0 -0
  99. package/.next/static/media/inter-latin-600-normal.8fb1a964.woff2 +0 -0
  100. package/.next/static/media/inter-latin-600-normal.ce0f5f43.woff +0 -0
  101. package/.next/static/media/inter-latin-700-normal.953b7aa5.woff2 +0 -0
  102. package/.next/static/media/inter-latin-700-normal.9c21d4dc.woff +0 -0
  103. package/.next/static/media/inter-latin-ext-400-normal.32a25442.woff2 +0 -0
  104. package/.next/static/media/inter-latin-ext-400-normal.4edcaace.woff +0 -0
  105. package/.next/static/media/inter-latin-ext-500-normal.a19a84a6.woff +0 -0
  106. package/.next/static/media/inter-latin-ext-500-normal.d9b491de.woff2 +0 -0
  107. package/.next/static/media/inter-latin-ext-600-normal.38b075d8.woff2 +0 -0
  108. package/.next/static/media/inter-latin-ext-600-normal.49faa47a.woff +0 -0
  109. package/.next/static/media/inter-latin-ext-700-normal.93534b50.woff +0 -0
  110. package/.next/static/media/inter-latin-ext-700-normal.b63daa1a.woff2 +0 -0
  111. package/.next/static/media/inter-vietnamese-400-normal.a9dd2faf.woff +0 -0
  112. package/.next/static/media/inter-vietnamese-400-normal.de4fc44f.woff2 +0 -0
  113. package/.next/static/media/inter-vietnamese-500-normal.7c0a695f.woff2 +0 -0
  114. package/.next/static/media/inter-vietnamese-500-normal.a3a73b95.woff +0 -0
  115. package/.next/static/media/inter-vietnamese-600-normal.9d518599.woff2 +0 -0
  116. package/.next/static/media/inter-vietnamese-600-normal.c5ce3fcb.woff +0 -0
  117. package/.next/static/media/inter-vietnamese-700-normal.bc68b199.woff +0 -0
  118. package/.next/static/media/inter-vietnamese-700-normal.faf12809.woff2 +0 -0
  119. package/.next/static/media/pdf.worker.min.67f75a11.mjs +8 -0
  120. package/.next/trace +32 -32
  121. package/.next/trace-build +1 -1
  122. package/CHANGELOG.md +9 -0
  123. package/next.config.js +5 -1
  124. package/package.json +2 -3
  125. package/public/apple-touch-icon.png +0 -0
  126. package/public/favicon-96x96.png +0 -0
  127. package/public/favicon.ico +0 -0
  128. package/public/favicon.svg +3 -0
  129. package/public/site.webmanifest +21 -0
  130. package/public/web-app-manifest-192x192.png +0 -0
  131. package/public/web-app-manifest-512x512.png +0 -0
  132. package/readme.md +9 -27
  133. package/scripts/utils/default-seed/contracts/project-proposal.tsx +68 -0
  134. package/scripts/utils/default-seed/finance/payment-summary.tsx +55 -0
  135. package/scripts/utils/default-seed/reports/incident-report.tsx +49 -0
  136. package/scripts/utils/default-seed/updates/release-notes.tsx +58 -0
  137. package/src/actions/generate-pdf-from-html.ts +0 -8
  138. package/src/actions/render-document-by-path.tsx +0 -3
  139. package/src/app/favicon.ico +0 -0
  140. package/src/app/fonts.ts +0 -7
  141. package/src/app/globals.css +9 -0
  142. package/src/app/layout.tsx +13 -8
  143. package/src/app/page.tsx +14 -12
  144. package/src/app/preview/[...slug]/page.tsx +9 -61
  145. package/src/app/preview/[...slug]/preview.tsx +5 -6
  146. package/src/components/logo.tsx +21 -13
  147. package/src/components/pdf-viewer.tsx +61 -20
  148. package/src/components/print.tsx +37 -5
  149. package/src/components/shell.tsx +1 -2
  150. package/src/utils/__snapshots__/get-document-component.spec.ts.snap +25 -181
  151. package/src/utils/canidocument/ast/get-object-variables.ts +1 -1
  152. package/src/utils/canidocument/ast/get-used-style-properties.ts +1 -1
  153. package/src/utils/canidocument/get-compatibility-stats-for-entry.ts +1 -1
  154. package/src/utils/canidocument/tailwind/get-tailwind-config.ts +1 -1
  155. package/src/utils/canidocument/tailwind/get-tailwind-metadata.spec.ts +2 -2
  156. package/src/utils/canidocument/tailwind/get-tailwind-metadata.ts +1 -1
  157. package/src/utils/canidocument/types.ts +12 -0
  158. package/src/utils/contains-document-template.spec.ts +1 -1
  159. package/src/utils/esbuild/renderring-utilities-exporter.ts +248 -0
  160. package/src/utils/get-document-component.spec.ts +6 -4
  161. package/src/utils/get-document-component.ts +61 -10
  162. package/src/utils/get-documents-directory-metadata.spec.ts +18 -55
  163. package/src/utils/iframe-processing.spec.ts +13 -25
  164. package/src/utils/js-document-detection.spec.ts +11 -5
  165. package/src/utils/linting.ts +29 -33
  166. package/src/utils/margin-calculation.spec.ts +5 -5
  167. package/src/utils/testing/js-document-export-default.js +3 -0
  168. package/src/utils/testing/js-document-test.js +3 -0
  169. package/src/utils/testing/mdx-document-test.js +3 -0
  170. package/src/utils/testing/request-response-document.tsx +15 -0
  171. package/.next/server/chunks/134.js +0 -22
  172. package/.next/server/chunks/286.js +0 -27
  173. package/.next/server/chunks/489.js +0 -13
  174. package/.next/server/chunks/731.js +0 -1
  175. package/.next/server/chunks/static/media/pdf.worker.min.3fa7f4f1.mjs +0 -8
  176. package/.next/static/chunks/134-488429db271f07ce.js +0 -1
  177. package/.next/static/chunks/399-38210d4b480adc3a.js +0 -1
  178. package/.next/static/chunks/4bd1b696-f2999b4e17b2fd5f.js +0 -1
  179. package/.next/static/chunks/576-d2a7761fb68a178e.js +0 -1
  180. package/.next/static/chunks/794-de04f3efd45c53dd.js +0 -20
  181. package/.next/static/chunks/818-708fabc8a2438ba2.js +0 -9
  182. package/.next/static/chunks/aad4249a-8397af6f169152d5.js +0 -2
  183. package/.next/static/chunks/app/layout-38d6d79a819ab362.js +0 -1
  184. package/.next/static/chunks/app/preview/[...slug]/page-1097b557142aa22c.js +0 -1
  185. package/.next/static/chunks/framework-9fb1a057e8adf51d.js +0 -1
  186. package/.next/static/chunks/main-66c819c51fec57bf.js +0 -23
  187. package/.next/static/css/2f4a632dc94d1fb7.css +0 -3
  188. package/.next/static/media/19cfc7226ec3afaa-s.woff2 +0 -0
  189. package/.next/static/media/21350d82a1f187e9-s.woff2 +0 -0
  190. package/.next/static/media/8e9860b6e62d6359-s.woff2 +0 -0
  191. package/.next/static/media/ba9851c3c22cd980-s.woff2 +0 -0
  192. package/.next/static/media/c5fe6dc8356a8c31-s.woff2 +0 -0
  193. package/.next/static/media/df0a9ae256c0569c-s.woff2 +0 -0
  194. package/.next/static/media/e4af272ccee01ff0-s.p.woff2 +0 -0
  195. package/.next/static/media/pdf.worker.min.539a26ca.mjs +0 -8
  196. package/.next/types/app/layout.ts +0 -86
  197. package/.next/types/cache-life.d.ts +0 -145
  198. package/scripts/utils/default-seed/auth/account-confirmation.tsx +0 -68
  199. package/scripts/utils/default-seed/auth/forgot-password.tsx +0 -71
  200. package/scripts/utils/default-seed/communications/payment-overdue.tsx +0 -82
  201. package/scripts/utils/default-seed/communications/team-invite.tsx +0 -78
  202. package/scripts/utils/default-seed/communications/webhooks-failed.tsx +0 -89
  203. package/scripts/utils/default-seed/feedback-request.tsx +0 -78
  204. package/scripts/utils/default-seed/marketing/changelog.tsx +0 -98
  205. package/src/actions/document-validation/__snapshots__/check-images.spec.tsx.snap +0 -84
  206. package/src/actions/document-validation/canidocument-data.ts +0 -85993
  207. package/src/actions/document-validation/check-compatibility.ts +0 -333
  208. package/src/actions/document-validation/check-images.spec.tsx +0 -21
  209. package/src/actions/document-validation/check-images.ts +0 -160
  210. package/src/actions/document-validation/check-links.spec.tsx +0 -113
  211. package/src/actions/document-validation/check-links.ts +0 -113
  212. package/src/actions/document-validation/get-code-location-from-ast-element.ts +0 -18
  213. package/src/actions/document-validation/quick-fetch.ts +0 -14
  214. package/src/animated-icons-data/help.json +0 -1082
  215. package/src/animated-icons-data/link.json +0 -1309
  216. package/src/animated-icons-data/mail.json +0 -1320
  217. package/src/components/toolbar/checking-results.tsx +0 -150
  218. package/src/components/toolbar/code-preview-line-link.tsx +0 -39
  219. package/src/components/toolbar/compatibility.tsx +0 -113
  220. package/src/components/toolbar/linter.tsx +0 -278
  221. package/src/components/toolbar/results-table.tsx +0 -0
  222. package/src/components/toolbar/results.tsx +0 -52
  223. package/src/components/toolbar/spam-assassin.tsx +0 -153
  224. package/src/components/toolbar/toolbar-button.tsx +0 -52
  225. package/src/components/toolbar/use-cached-state.ts +0 -33
  226. package/src/components/toolbar.tsx +0 -349
  227. /package/.next/static/{ZCqBZ8ZswPjX7K5Zalrpy → dBOUMD9vJ2VLASRDl2YeR}/_buildManifest.js +0 -0
  228. /package/.next/static/{ZCqBZ8ZswPjX7K5Zalrpy → dBOUMD9vJ2VLASRDl2YeR}/_ssgManifest.js +0 -0
@@ -1,86 +0,0 @@
1
- // File: /home/runner/work/useprint/useprint/packages/preview-server/src/app/layout.tsx
2
- import * as entry from '../../../src/app/layout.js'
3
- import type { ResolvingMetadata, ResolvingViewport } from 'next/dist/lib/metadata/types/metadata-interface.js'
4
-
5
- import type { PrefetchForTypeCheckInternal } from 'next/dist/build/segment-config/app/app-segment-config.js'
6
-
7
- type TEntry = typeof import('../../../src/app/layout.js')
8
-
9
- type SegmentParams<T extends Object = any> = T extends Record<string, any>
10
- ? { [K in keyof T]: T[K] extends string ? string | string[] | undefined : never }
11
- : T
12
-
13
- // Check that the entry is a valid entry
14
- checkFields<Diff<{
15
- default: Function
16
- config?: {}
17
- generateStaticParams?: Function
18
- unstable_prefetch?: PrefetchForTypeCheckInternal
19
- revalidate?: RevalidateRange<TEntry> | false
20
- dynamic?: 'auto' | 'force-dynamic' | 'error' | 'force-static'
21
- dynamicParams?: boolean
22
- fetchCache?: 'auto' | 'force-no-store' | 'only-no-store' | 'default-no-store' | 'default-cache' | 'only-cache' | 'force-cache'
23
- preferredRegion?: 'auto' | 'global' | 'home' | string | string[]
24
- runtime?: 'nodejs' | 'experimental-edge' | 'edge'
25
- maxDuration?: number
26
-
27
- metadata?: any
28
- generateMetadata?: Function
29
- viewport?: any
30
- generateViewport?: Function
31
-
32
- }, TEntry, ''>>()
33
-
34
-
35
- // Check the prop type of the entry function
36
- checkFields<Diff<LayoutProps, FirstArg<TEntry['default']>, 'default'>>()
37
-
38
- // Check the arguments and return type of the generateMetadata function
39
- if ('generateMetadata' in entry) {
40
- checkFields<Diff<LayoutProps, FirstArg<MaybeField<TEntry, 'generateMetadata'>>, 'generateMetadata'>>()
41
- checkFields<Diff<ResolvingMetadata, SecondArg<MaybeField<TEntry, 'generateMetadata'>>, 'generateMetadata'>>()
42
- }
43
-
44
- // Check the arguments and return type of the generateViewport function
45
- if ('generateViewport' in entry) {
46
- checkFields<Diff<LayoutProps, FirstArg<MaybeField<TEntry, 'generateViewport'>>, 'generateViewport'>>()
47
- checkFields<Diff<ResolvingViewport, SecondArg<MaybeField<TEntry, 'generateViewport'>>, 'generateViewport'>>()
48
- }
49
-
50
- // Check the arguments and return type of the generateStaticParams function
51
- if ('generateStaticParams' in entry) {
52
- checkFields<Diff<{ params: SegmentParams }, FirstArg<MaybeField<TEntry, 'generateStaticParams'>>, 'generateStaticParams'>>()
53
- checkFields<Diff<{ __tag__: 'generateStaticParams', __return_type__: any[] | Promise<any[]> }, { __tag__: 'generateStaticParams', __return_type__: ReturnType<MaybeField<TEntry, 'generateStaticParams'>> }>>()
54
- }
55
-
56
- export interface PageProps {
57
- params?: Promise<SegmentParams>
58
- searchParams?: Promise<any>
59
- }
60
- export interface LayoutProps {
61
- children?: React.ReactNode
62
-
63
- params?: Promise<SegmentParams>
64
- }
65
-
66
- // =============
67
- // Utility types
68
- type RevalidateRange<T> = T extends { revalidate: any } ? NonNegative<T['revalidate']> : never
69
-
70
- // If T is unknown or any, it will be an empty {} type. Otherwise, it will be the same as Omit<T, keyof Base>.
71
- type OmitWithTag<T, K extends keyof any, _M> = Omit<T, K>
72
- type Diff<Base, T extends Base, Message extends string = ''> = 0 extends (1 & T) ? {} : OmitWithTag<T, keyof Base, Message>
73
-
74
- type FirstArg<T extends Function> = T extends (...args: [infer T, any]) => any ? unknown extends T ? any : T : never
75
- type SecondArg<T extends Function> = T extends (...args: [any, infer T]) => any ? unknown extends T ? any : T : never
76
- type MaybeField<T, K extends string> = T extends { [k in K]: infer G } ? G extends Function ? G : never : never
77
-
78
-
79
-
80
- function checkFields<_ extends { [k in keyof any]: never }>() {}
81
-
82
- // https://github.com/sindresorhus/type-fest
83
- type Numeric = number | bigint
84
- type Zero = 0 | 0n
85
- type Negative<T extends Numeric> = T extends Zero ? never : `${T}` extends `-${string}` ? T : never
86
- type NonNegative<T extends Numeric> = T extends Zero ? T : Negative<T> extends never ? T : '__invalid_negative_number__'
@@ -1,145 +0,0 @@
1
- // Type definitions for Next.js cacheLife configs
2
-
3
- declare module 'next/cache' {
4
- export { unstable_cache } from 'next/dist/server/web/spec-extension/unstable-cache'
5
- export {
6
- updateTag,
7
- revalidateTag,
8
- revalidatePath,
9
- refresh,
10
- } from 'next/dist/server/web/spec-extension/revalidate'
11
- export { unstable_noStore } from 'next/dist/server/web/spec-extension/unstable-no-store'
12
-
13
-
14
- /**
15
- * Cache this `"use cache"` for a timespan defined by the `"default"` profile.
16
- * ```
17
- * stale: 300 seconds (5 minutes)
18
- * revalidate: 900 seconds (15 minutes)
19
- * expire: never
20
- * ```
21
- *
22
- * This cache may be stale on clients for 5 minutes before checking with the server.
23
- * If the server receives a new request after 15 minutes, start revalidating new values in the background.
24
- * It lives for the maximum age of the server cache. If this entry has no traffic for a while, it may serve an old value the next request.
25
- */
26
- export function cacheLife(profile: "default"): void
27
-
28
- /**
29
- * Cache this `"use cache"` for a timespan defined by the `"seconds"` profile.
30
- * ```
31
- * stale: 30 seconds
32
- * revalidate: 1 seconds
33
- * expire: 60 seconds (1 minute)
34
- * ```
35
- *
36
- * This cache may be stale on clients for 30 seconds before checking with the server.
37
- * If the server receives a new request after 1 seconds, start revalidating new values in the background.
38
- * If this entry has no traffic for 1 minute it will expire. The next request will recompute it.
39
- */
40
- export function cacheLife(profile: "seconds"): void
41
-
42
- /**
43
- * Cache this `"use cache"` for a timespan defined by the `"minutes"` profile.
44
- * ```
45
- * stale: 300 seconds (5 minutes)
46
- * revalidate: 60 seconds (1 minute)
47
- * expire: 3600 seconds (1 hour)
48
- * ```
49
- *
50
- * This cache may be stale on clients for 5 minutes before checking with the server.
51
- * If the server receives a new request after 1 minute, start revalidating new values in the background.
52
- * If this entry has no traffic for 1 hour it will expire. The next request will recompute it.
53
- */
54
- export function cacheLife(profile: "minutes"): void
55
-
56
- /**
57
- * Cache this `"use cache"` for a timespan defined by the `"hours"` profile.
58
- * ```
59
- * stale: 300 seconds (5 minutes)
60
- * revalidate: 3600 seconds (1 hour)
61
- * expire: 86400 seconds (1 day)
62
- * ```
63
- *
64
- * This cache may be stale on clients for 5 minutes before checking with the server.
65
- * If the server receives a new request after 1 hour, start revalidating new values in the background.
66
- * If this entry has no traffic for 1 day it will expire. The next request will recompute it.
67
- */
68
- export function cacheLife(profile: "hours"): void
69
-
70
- /**
71
- * Cache this `"use cache"` for a timespan defined by the `"days"` profile.
72
- * ```
73
- * stale: 300 seconds (5 minutes)
74
- * revalidate: 86400 seconds (1 day)
75
- * expire: 604800 seconds (1 week)
76
- * ```
77
- *
78
- * This cache may be stale on clients for 5 minutes before checking with the server.
79
- * If the server receives a new request after 1 day, start revalidating new values in the background.
80
- * If this entry has no traffic for 1 week it will expire. The next request will recompute it.
81
- */
82
- export function cacheLife(profile: "days"): void
83
-
84
- /**
85
- * Cache this `"use cache"` for a timespan defined by the `"weeks"` profile.
86
- * ```
87
- * stale: 300 seconds (5 minutes)
88
- * revalidate: 604800 seconds (1 week)
89
- * expire: 2592000 seconds (30 days)
90
- * ```
91
- *
92
- * This cache may be stale on clients for 5 minutes before checking with the server.
93
- * If the server receives a new request after 1 week, start revalidating new values in the background.
94
- * If this entry has no traffic for 30 days it will expire. The next request will recompute it.
95
- */
96
- export function cacheLife(profile: "weeks"): void
97
-
98
- /**
99
- * Cache this `"use cache"` for a timespan defined by the `"max"` profile.
100
- * ```
101
- * stale: 300 seconds (5 minutes)
102
- * revalidate: 2592000 seconds (30 days)
103
- * expire: 31536000 seconds (365 days)
104
- * ```
105
- *
106
- * This cache may be stale on clients for 5 minutes before checking with the server.
107
- * If the server receives a new request after 30 days, start revalidating new values in the background.
108
- * If this entry has no traffic for 365 days it will expire. The next request will recompute it.
109
- */
110
- export function cacheLife(profile: "max"): void
111
-
112
- /**
113
- * Cache this `"use cache"` using a custom timespan.
114
- * ```
115
- * stale: ... // seconds
116
- * revalidate: ... // seconds
117
- * expire: ... // seconds
118
- * ```
119
- *
120
- * This is similar to Cache-Control: max-age=`stale`,s-max-age=`revalidate`,stale-while-revalidate=`expire-revalidate`
121
- *
122
- * If a value is left out, the lowest of other cacheLife() calls or the default, is used instead.
123
- */
124
- export function cacheLife(profile: {
125
- /**
126
- * This cache may be stale on clients for ... seconds before checking with the server.
127
- */
128
- stale?: number,
129
- /**
130
- * If the server receives a new request after ... seconds, start revalidating new values in the background.
131
- */
132
- revalidate?: number,
133
- /**
134
- * If this entry has no traffic for ... seconds it will expire. The next request will recompute it.
135
- */
136
- expire?: number
137
- }): void
138
-
139
-
140
- import { cacheTag } from 'next/dist/server/use-cache/cache-tag'
141
- export { cacheTag }
142
-
143
- export const unstable_cacheTag: typeof cacheTag
144
- export const unstable_cacheLife: typeof cacheLife
145
- }
@@ -1,68 +0,0 @@
1
- import {
2
- Body,
3
- Button,
4
- Column,
5
- Container,
6
- Head,
7
- Heading,
8
- Hr,
9
- Html,
10
- Preview,
11
- Row,
12
- Tailwind,
13
- Text,
14
- } from '@useprint/components';
15
-
16
- interface AccountConfirmationProps {
17
- confirmLink: string;
18
- expiryTime: string;
19
- }
20
-
21
- export default function AccountConfirmation({
22
- confirmLink,
23
- expiryTime,
24
- }: AccountConfirmationProps) {
25
- return (
26
- <Html>
27
- <Head />
28
- <Tailwind>
29
- <Body className="bg-black text-white">
30
- <Preview>Confirm your UsePrint account</Preview>
31
- <Container className="mx-auto">
32
- <Heading className="font-bold text-center my-[48px] text-[32px]">
33
- Welcome to UsePrint!
34
- </Heading>
35
- <Text>
36
- Thank you for signing up! To complete your registration and start
37
- using UsePrint, please confirm your document address.
38
- </Text>
39
- <Text className="mb-6">
40
- Click the button below to verify your document. This link will expire
41
- in {expiryTime}.
42
- </Text>
43
- <Row className="w-full">
44
- <Column className="w-full">
45
- <Button
46
- href={confirmLink}
47
- className="bg-cyan-300 text-[20px] font-bold text-[#404040] w-full text-center border border-solid border-cyan-900 py-[8px] rounded-[8px]"
48
- >
49
- Confirm Document
50
- </Button>
51
- </Column>
52
- </Row>
53
- <Text className="mt-6">- UsePrint team</Text>
54
- <Hr style={{ borderTopColor: '#404040' }} />
55
- <Text className="text-[#606060] font-bold">
56
- UsePrint, 999 React St, Document City, EC 12345
57
- </Text>
58
- </Container>
59
- </Body>
60
- </Tailwind>
61
- </Html>
62
- );
63
- }
64
-
65
- AccountConfirmation.PreviewProps = {
66
- confirmLink: 'https://useprint.dev/confirm/123',
67
- expiryTime: '24 hours',
68
- } satisfies AccountConfirmationProps;
@@ -1,71 +0,0 @@
1
- import {
2
- Body,
3
- Button,
4
- Column,
5
- Container,
6
- Head,
7
- Heading,
8
- Hr,
9
- Html,
10
- Preview,
11
- Row,
12
- Tailwind,
13
- Text,
14
- } from '@useprint/components';
15
-
16
- interface ForgotPasswordProps {
17
- resetLink: string;
18
- expiryTime: string;
19
- }
20
-
21
- export default function ForgotPassword({
22
- resetLink,
23
- expiryTime,
24
- }: ForgotPasswordProps) {
25
- return (
26
- <Html>
27
- <Head />
28
- <Tailwind>
29
- <Body className="bg-black text-white">
30
- <Preview>Reset your UsePrint password</Preview>
31
- <Container className="mx-auto">
32
- <Heading className="font-bold text-center my-[48px] text-[32px]">
33
- Reset Your Password
34
- </Heading>
35
- <Text>
36
- We received a request to reset your password for your UsePrint
37
- account.
38
- </Text>
39
- <Text>
40
- Click the button below to create a new password. This link will
41
- expire in {expiryTime}.
42
- </Text>
43
- <Text className="mb-6">
44
- If you didn't request this, you can safely ignore this document.
45
- </Text>
46
- <Row className="w-full">
47
- <Column className="w-full">
48
- <Button
49
- href={resetLink}
50
- className="bg-cyan-300 text-[20px] font-bold text-[#404040] w-full text-center border border-solid border-cyan-900 py-[8px] rounded-[8px]"
51
- >
52
- Reset Password
53
- </Button>
54
- </Column>
55
- </Row>
56
- <Text className="mt-6">- UsePrint team</Text>
57
- <Hr style={{ borderTopColor: '#404040' }} />
58
- <Text className="text-[#606060] font-bold">
59
- UsePrint, 999 React St, Document City, EC 12345
60
- </Text>
61
- </Container>
62
- </Body>
63
- </Tailwind>
64
- </Html>
65
- );
66
- }
67
-
68
- ForgotPassword.PreviewProps = {
69
- resetLink: 'https://useprint.dev/reset-password/123',
70
- expiryTime: '1 hour',
71
- } satisfies ForgotPasswordProps;
@@ -1,82 +0,0 @@
1
- import {
2
- Body,
3
- Button,
4
- Column,
5
- Container,
6
- Head,
7
- Heading,
8
- Hr,
9
- Html,
10
- Preview,
11
- Row,
12
- Tailwind,
13
- Text,
14
- } from '@useprint/components';
15
-
16
- interface PaymentOverdueProps {
17
- customerName: string;
18
- amount: string;
19
- dueDate: string;
20
- invoiceLink: string;
21
- }
22
-
23
- export default function PaymentOverdue({
24
- customerName,
25
- amount,
26
- dueDate,
27
- invoiceLink,
28
- }: PaymentOverdueProps) {
29
- return (
30
- <Html>
31
- <Head />
32
- <Tailwind>
33
- <Body className="bg-black text-white">
34
- <Preview>Payment of {amount} is overdue - Action required</Preview>
35
- <Container className="mx-auto">
36
- <Heading className="font-bold text-center my-[48px] text-[32px]">
37
- Payment Overdue
38
- </Heading>
39
- <Text>Dear {customerName},</Text>
40
- <Text>
41
- We noticed that your payment of {amount} was due on {dueDate} and
42
- has not been received yet.
43
- </Text>
44
- <Text>
45
- To avoid any service interruption, please process your payment as
46
- soon as possible.
47
- </Text>
48
- <Text className="mb-6">
49
- You can view and pay your invoice by clicking the button below:
50
- </Text>
51
- <Row className="w-full">
52
- <Column className="w-full">
53
- <Button
54
- href={invoiceLink}
55
- className="bg-cyan-300 text-[20px] font-bold text-[#404040] w-full text-center border border-solid border-cyan-900 py-[8px] rounded-[8px]"
56
- >
57
- Pay Now
58
- </Button>
59
- </Column>
60
- </Row>
61
- <Text className="mt-6">
62
- If you have already made this payment, please disregard this
63
- message.
64
- </Text>
65
- <Text className="mt-6">- UsePrint team</Text>
66
- <Hr style={{ borderTopColor: '#404040' }} />
67
- <Text className="text-[#606060] font-bold">
68
- UsePrint, 999 React St, Document City, EC 12345
69
- </Text>
70
- </Container>
71
- </Body>
72
- </Tailwind>
73
- </Html>
74
- );
75
- }
76
-
77
- PaymentOverdue.PreviewProps = {
78
- customerName: 'Jane Smith',
79
- amount: '$99.00',
80
- dueDate: 'June 1st, 2024',
81
- invoiceLink: 'https://useprint.dev/invoice/123',
82
- } satisfies PaymentOverdueProps;
@@ -1,78 +0,0 @@
1
- import {
2
- Body,
3
- Button,
4
- Column,
5
- Container,
6
- Head,
7
- Heading,
8
- Hr,
9
- Html,
10
- Preview,
11
- Row,
12
- Tailwind,
13
- Text,
14
- } from '@useprint/components';
15
-
16
- interface TeamInviteProps {
17
- inviterName: string;
18
- teamName: string;
19
- inviteLink: string;
20
- role: string;
21
- }
22
-
23
- export default function TeamInvite({
24
- inviterName,
25
- teamName,
26
- inviteLink,
27
- role,
28
- }: TeamInviteProps) {
29
- return (
30
- <Html>
31
- <Head />
32
- <Tailwind>
33
- <Body className="bg-black text-white">
34
- <Preview>
35
- {inviterName} has invited you to join {teamName} on UsePrint
36
- </Preview>
37
- <Container className="mx-auto">
38
- <Heading className="font-bold text-center my-[48px] text-[32px]">
39
- You've been invited!
40
- </Heading>
41
- <Text>
42
- {inviterName} has invited you to join {teamName} as a {role}.
43
- </Text>
44
- <Text>
45
- UsePrint helps teams collaborate on document templates and manage
46
- their document campaigns effectively.
47
- </Text>
48
- <Text className="mb-6">
49
- Click the button below to accept the invitation and get started:
50
- </Text>
51
- <Row className="w-full">
52
- <Column className="w-full">
53
- <Button
54
- href={inviteLink}
55
- className="bg-cyan-300 text-[20px] font-bold text-[#404040] w-full text-center border border-solid border-cyan-900 py-[8px] rounded-[8px]"
56
- >
57
- Accept Invitation
58
- </Button>
59
- </Column>
60
- </Row>
61
- <Text className="mt-6">- UsePrint team</Text>
62
- <Hr style={{ borderTopColor: '#404040' }} />
63
- <Text className="text-[#606060] font-bold">
64
- UsePrint, 999 React St, Document City, EC 12345
65
- </Text>
66
- </Container>
67
- </Body>
68
- </Tailwind>
69
- </Html>
70
- );
71
- }
72
-
73
- TeamInvite.PreviewProps = {
74
- inviterName: 'John Doe',
75
- teamName: 'Marketing Team',
76
- inviteLink: 'https://useprint.dev/join/team/123',
77
- role: 'Editor',
78
- } satisfies TeamInviteProps;
@@ -1,89 +0,0 @@
1
- import {
2
- Body,
3
- CodeBlock,
4
- Container,
5
- Head,
6
- Heading,
7
- Hr,
8
- Html,
9
- Preview,
10
- Tailwind,
11
- Text,
12
- vesper,
13
- } from '@useprint/components';
14
-
15
- interface WebhooksFailedProps {
16
- date: string;
17
- error: {
18
- error: string;
19
- timestamp: string;
20
- webhookId: string;
21
- details: {
22
- reason: string;
23
- retryCount: number;
24
- lastAttempt: string;
25
- };
26
- };
27
- }
28
-
29
- export default function WebhooksFailed({ date, error }: WebhooksFailedProps) {
30
- return (
31
- <Html>
32
- <Head />
33
- <Tailwind>
34
- <Body className="bg-black text-white">
35
- <Preview>Some webhooks failed to deliver at {date}</Preview>
36
- <Container className="mx-auto">
37
- <Heading className="font-bold text-center text-[32px]">
38
- Failed webhook attempt
39
- </Heading>
40
- <Text>
41
- We encountered an issue with some of our webhooks. Please check
42
- the logs for more details. Here is the data for the error:
43
- </Text>
44
- <CodeBlock
45
- code={JSON.stringify(error, null, 2)}
46
- language="json"
47
- theme={vesper}
48
- style={{
49
- padding: '16px',
50
- borderRadius: '8px',
51
- }}
52
- lineNumbers
53
- />
54
- <Text className="mb-6">
55
- If you have any questions or need assistance, please reach out to
56
- us at{' '}
57
- <a
58
- href="mailto:support@useprint.dev"
59
- className="text-cyan-300 underline"
60
- >
61
- support@useprint.dev
62
- </a>
63
- .
64
- </Text>
65
- <Text className="mt-6">- UsePrint team</Text>
66
- <Hr style={{ borderTopColor: '#404040' }} />
67
- <Text className="text-[#606060] font-bold">
68
- UsePrint, 999 React St, Document City, EC 12345
69
- </Text>
70
- </Container>
71
- </Body>
72
- </Tailwind>
73
- </Html>
74
- );
75
- }
76
-
77
- WebhooksFailed.PreviewProps = {
78
- date: 'June 4th, 202',
79
- error: {
80
- error: 'Webhook delivery failed',
81
- timestamp: '2023-10-01T12:00:00Z',
82
- webhookId: 'wh_1234567890',
83
- details: {
84
- reason: 'Network error',
85
- retryCount: 3,
86
- lastAttempt: '2023-10-01T12:05:00Z',
87
- },
88
- },
89
- } satisfies WebhooksFailedProps;