@ahmedrowaihi/pdf-forge-preview 1.0.0-canary.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (351) hide show
  1. package/.next/BUILD_ID +1 -0
  2. package/.next/app-path-routes-manifest.json +7 -0
  3. package/.next/build/chunks/[root-of-the-server]__12fb5caf._.js +233 -0
  4. package/.next/build/chunks/[root-of-the-server]__12fb5caf._.js.map +8 -0
  5. package/.next/build/chunks/[root-of-the-server]__242deb00._.js +500 -0
  6. package/.next/build/chunks/[root-of-the-server]__242deb00._.js.map +11 -0
  7. package/.next/build/chunks/[turbopack-node]_transforms_postcss_ts_ad9a1eec._.js +13 -0
  8. package/.next/build/chunks/[turbopack-node]_transforms_postcss_ts_ad9a1eec._.js.map +5 -0
  9. package/.next/build/chunks/[turbopack]_runtime.js +795 -0
  10. package/.next/build/chunks/[turbopack]_runtime.js.map +10 -0
  11. package/.next/build/chunks/node_modules__pnpm_806d01c0._.js +6758 -0
  12. package/.next/build/chunks/node_modules__pnpm_806d01c0._.js.map +47 -0
  13. package/.next/build/package.json +1 -0
  14. package/.next/build/postcss.js +6 -0
  15. package/.next/build/postcss.js.map +5 -0
  16. package/.next/build-manifest.json +20 -0
  17. package/.next/diagnostics/build-diagnostics.json +6 -0
  18. package/.next/diagnostics/framework.json +1 -0
  19. package/.next/export-marker.json +6 -0
  20. package/.next/fallback-build-manifest.json +12 -0
  21. package/.next/images-manifest.json +66 -0
  22. package/.next/next-minimal-server.js.nft.json +1 -0
  23. package/.next/next-server.js.nft.json +1 -0
  24. package/.next/package.json +1 -0
  25. package/.next/prerender-manifest.json +65 -0
  26. package/.next/required-server-files.js +163 -0
  27. package/.next/required-server-files.json +163 -0
  28. package/.next/routes-manifest.json +77 -0
  29. package/.next/server/app/_global-error/page/app-paths-manifest.json +3 -0
  30. package/.next/server/app/_global-error/page/build-manifest.json +17 -0
  31. package/.next/server/app/_global-error/page/next-font-manifest.json +6 -0
  32. package/.next/server/app/_global-error/page/react-loadable-manifest.json +1 -0
  33. package/.next/server/app/_global-error/page/server-reference-manifest.json +4 -0
  34. package/.next/server/app/_global-error/page.js +11 -0
  35. package/.next/server/app/_global-error/page.js.map +5 -0
  36. package/.next/server/app/_global-error/page.js.nft.json +1 -0
  37. package/.next/server/app/_global-error/page_client-reference-manifest.js +2 -0
  38. package/.next/server/app/_global-error.html +2 -0
  39. package/.next/server/app/_global-error.meta +15 -0
  40. package/.next/server/app/_global-error.rsc +13 -0
  41. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +5 -0
  42. package/.next/server/app/_global-error.segments/_full.segment.rsc +13 -0
  43. package/.next/server/app/_global-error.segments/_head.segment.rsc +6 -0
  44. package/.next/server/app/_global-error.segments/_index.segment.rsc +4 -0
  45. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -0
  46. package/.next/server/app/_not-found/page/app-paths-manifest.json +3 -0
  47. package/.next/server/app/_not-found/page/build-manifest.json +17 -0
  48. package/.next/server/app/_not-found/page/next-font-manifest.json +16 -0
  49. package/.next/server/app/_not-found/page/react-loadable-manifest.json +1 -0
  50. package/.next/server/app/_not-found/page/server-reference-manifest.json +20 -0
  51. package/.next/server/app/_not-found/page.js +14 -0
  52. package/.next/server/app/_not-found/page.js.map +5 -0
  53. package/.next/server/app/_not-found/page.js.nft.json +1 -0
  54. package/.next/server/app/_not-found/page_client-reference-manifest.js +2 -0
  55. package/.next/server/app/favicon.ico/route/app-paths-manifest.json +3 -0
  56. package/.next/server/app/favicon.ico/route/build-manifest.json +11 -0
  57. package/.next/server/app/favicon.ico/route.js +6 -0
  58. package/.next/server/app/favicon.ico/route.js.map +5 -0
  59. package/.next/server/app/favicon.ico/route.js.nft.json +1 -0
  60. package/.next/server/app/favicon.ico.body +0 -0
  61. package/.next/server/app/favicon.ico.meta +1 -0
  62. package/.next/server/app/page/app-paths-manifest.json +3 -0
  63. package/.next/server/app/page/build-manifest.json +17 -0
  64. package/.next/server/app/page/next-font-manifest.json +16 -0
  65. package/.next/server/app/page/react-loadable-manifest.json +1 -0
  66. package/.next/server/app/page/server-reference-manifest.json +20 -0
  67. package/.next/server/app/page.js +17 -0
  68. package/.next/server/app/page.js.map +5 -0
  69. package/.next/server/app/page.js.nft.json +1 -0
  70. package/.next/server/app/page_client-reference-manifest.js +2 -0
  71. package/.next/server/app/preview/[...slug]/page/app-paths-manifest.json +3 -0
  72. package/.next/server/app/preview/[...slug]/page/build-manifest.json +17 -0
  73. package/.next/server/app/preview/[...slug]/page/next-font-manifest.json +16 -0
  74. package/.next/server/app/preview/[...slug]/page/react-loadable-manifest.json +1 -0
  75. package/.next/server/app/preview/[...slug]/page/server-reference-manifest.json +65 -0
  76. package/.next/server/app/preview/[...slug]/page.js +19 -0
  77. package/.next/server/app/preview/[...slug]/page.js.map +5 -0
  78. package/.next/server/app/preview/[...slug]/page.js.nft.json +1 -0
  79. package/.next/server/app/preview/[...slug]/page_client-reference-manifest.js +2 -0
  80. package/.next/server/app-paths-manifest.json +7 -0
  81. package/.next/server/chunks/730ea_preview-server__next-internal_server_app_favicon_ico_route_actions_a71a8ae7.js +3 -0
  82. package/.next/server/chunks/730ea_preview-server__next-internal_server_app_favicon_ico_route_actions_a71a8ae7.js.map +1 -0
  83. package/.next/server/chunks/[externals]_next_dist_a6d89067._.js +3 -0
  84. package/.next/server/chunks/[externals]_next_dist_a6d89067._.js.map +1 -0
  85. package/.next/server/chunks/[root-of-the-server]__a62cd78d._.js +21 -0
  86. package/.next/server/chunks/[root-of-the-server]__a62cd78d._.js.map +1 -0
  87. package/.next/server/chunks/[turbopack]_runtime.js +795 -0
  88. package/.next/server/chunks/[turbopack]_runtime.js.map +10 -0
  89. package/.next/server/chunks/ssr/730ea_preview-server__next-internal_server_app__global-error_page_actions_986e2de5.js +3 -0
  90. package/.next/server/chunks/ssr/730ea_preview-server__next-internal_server_app__global-error_page_actions_986e2de5.js.map +1 -0
  91. package/.next/server/chunks/ssr/[root-of-the-server]__025eaae9._.js +3 -0
  92. package/.next/server/chunks/ssr/[root-of-the-server]__025eaae9._.js.map +1 -0
  93. package/.next/server/chunks/ssr/[root-of-the-server]__1536282c._.js +4 -0
  94. package/.next/server/chunks/ssr/[root-of-the-server]__1536282c._.js.map +1 -0
  95. package/.next/server/chunks/ssr/[root-of-the-server]__15cf9d36._.js +3 -0
  96. package/.next/server/chunks/ssr/[root-of-the-server]__15cf9d36._.js.map +1 -0
  97. package/.next/server/chunks/ssr/[root-of-the-server]__450f653e._.js +3 -0
  98. package/.next/server/chunks/ssr/[root-of-the-server]__450f653e._.js.map +1 -0
  99. package/.next/server/chunks/ssr/[root-of-the-server]__4874d0d7._.js +3 -0
  100. package/.next/server/chunks/ssr/[root-of-the-server]__4874d0d7._.js.map +1 -0
  101. package/.next/server/chunks/ssr/[root-of-the-server]__49771cdc._.js +3 -0
  102. package/.next/server/chunks/ssr/[root-of-the-server]__49771cdc._.js.map +1 -0
  103. package/.next/server/chunks/ssr/[root-of-the-server]__9ff74047._.js +3 -0
  104. package/.next/server/chunks/ssr/[root-of-the-server]__9ff74047._.js.map +1 -0
  105. package/.next/server/chunks/ssr/[root-of-the-server]__a9be37b1._.js +3 -0
  106. package/.next/server/chunks/ssr/[root-of-the-server]__a9be37b1._.js.map +1 -0
  107. package/.next/server/chunks/ssr/[root-of-the-server]__aeefe74e._.js +3 -0
  108. package/.next/server/chunks/ssr/[root-of-the-server]__aeefe74e._.js.map +1 -0
  109. package/.next/server/chunks/ssr/[root-of-the-server]__b13738d2._.js +3 -0
  110. package/.next/server/chunks/ssr/[root-of-the-server]__b13738d2._.js.map +1 -0
  111. package/.next/server/chunks/ssr/[root-of-the-server]__bb428c83._.js +4 -0
  112. package/.next/server/chunks/ssr/[root-of-the-server]__bb428c83._.js.map +1 -0
  113. package/.next/server/chunks/ssr/[root-of-the-server]__c61333e3._.js +10 -0
  114. package/.next/server/chunks/ssr/[root-of-the-server]__c61333e3._.js.map +1 -0
  115. package/.next/server/chunks/ssr/[root-of-the-server]__cb0c7b1a._.js +4 -0
  116. package/.next/server/chunks/ssr/[root-of-the-server]__cb0c7b1a._.js.map +1 -0
  117. package/.next/server/chunks/ssr/[root-of-the-server]__dafcae4c._.js +3 -0
  118. package/.next/server/chunks/ssr/[root-of-the-server]__dafcae4c._.js.map +1 -0
  119. package/.next/server/chunks/ssr/[root-of-the-server]__e47d0c07._.js +3 -0
  120. package/.next/server/chunks/ssr/[root-of-the-server]__e47d0c07._.js.map +1 -0
  121. package/.next/server/chunks/ssr/[root-of-the-server]__ecac8617._.js +31 -0
  122. package/.next/server/chunks/ssr/[root-of-the-server]__ecac8617._.js.map +1 -0
  123. package/.next/server/chunks/ssr/[root-of-the-server]__fd4bda25._.js +3 -0
  124. package/.next/server/chunks/ssr/[root-of-the-server]__fd4bda25._.js.map +1 -0
  125. package/.next/server/chunks/ssr/[turbopack]_runtime.js +795 -0
  126. package/.next/server/chunks/ssr/[turbopack]_runtime.js.map +10 -0
  127. package/.next/server/chunks/ssr/_19494208._.js +19 -0
  128. package/.next/server/chunks/ssr/_19494208._.js.map +1 -0
  129. package/.next/server/chunks/ssr/_810f54e9._.js +4 -0
  130. package/.next/server/chunks/ssr/_810f54e9._.js.map +1 -0
  131. package/.next/server/chunks/ssr/_aa01e67e._.js +4 -0
  132. package/.next/server/chunks/ssr/_aa01e67e._.js.map +1 -0
  133. package/.next/server/chunks/ssr/_bf10718b._.js +4 -0
  134. package/.next/server/chunks/ssr/_bf10718b._.js.map +1 -0
  135. package/.next/server/chunks/ssr/_c57c12df._.js +4 -0
  136. package/.next/server/chunks/ssr/_c57c12df._.js.map +1 -0
  137. package/.next/server/chunks/ssr/_d9b57cb8._.js +5 -0
  138. package/.next/server/chunks/ssr/_d9b57cb8._.js.map +1 -0
  139. package/.next/server/chunks/ssr/_e2a766a8._.js +3 -0
  140. package/.next/server/chunks/ssr/_e2a766a8._.js.map +1 -0
  141. package/.next/server/chunks/ssr/_e2b86512._.js +8 -0
  142. package/.next/server/chunks/ssr/_e2b86512._.js.map +1 -0
  143. package/.next/server/chunks/ssr/_ee8ea3aa._.js +19 -0
  144. package/.next/server/chunks/ssr/_ee8ea3aa._.js.map +1 -0
  145. package/.next/server/chunks/ssr/e8449_next_dist_5870db32._.js +3 -0
  146. package/.next/server/chunks/ssr/e8449_next_dist_5870db32._.js.map +1 -0
  147. package/.next/server/chunks/ssr/e8449_next_dist_client_components_builtin_forbidden_5542069c.js +3 -0
  148. package/.next/server/chunks/ssr/e8449_next_dist_client_components_builtin_forbidden_5542069c.js.map +1 -0
  149. package/.next/server/chunks/ssr/e8449_next_dist_client_components_builtin_global-error_d0870f3a.js +3 -0
  150. package/.next/server/chunks/ssr/e8449_next_dist_client_components_builtin_global-error_d0870f3a.js.map +1 -0
  151. package/.next/server/chunks/ssr/e8449_next_dist_client_components_builtin_unauthorized_4c01c8d5.js +3 -0
  152. package/.next/server/chunks/ssr/e8449_next_dist_client_components_builtin_unauthorized_4c01c8d5.js.map +1 -0
  153. package/.next/server/chunks/ssr/e8449_next_dist_client_components_d90ace34._.js +3 -0
  154. package/.next/server/chunks/ssr/e8449_next_dist_client_components_d90ace34._.js.map +1 -0
  155. package/.next/server/chunks/ssr/e8449_next_dist_esm_af7aafb8._.js +6 -0
  156. package/.next/server/chunks/ssr/e8449_next_dist_esm_af7aafb8._.js.map +1 -0
  157. package/.next/server/chunks/ssr/e8449_next_dist_esm_build_templates_app-page_f16f0848.js +4 -0
  158. package/.next/server/chunks/ssr/e8449_next_dist_esm_build_templates_app-page_f16f0848.js.map +1 -0
  159. package/.next/server/chunks/ssr/e8449_next_dist_f0d8a2cc._.js +4 -0
  160. package/.next/server/chunks/ssr/e8449_next_dist_f0d8a2cc._.js.map +1 -0
  161. package/.next/server/chunks/ssr/node_modules__pnpm_37510d96._.js +5 -0
  162. package/.next/server/chunks/ssr/node_modules__pnpm_37510d96._.js.map +1 -0
  163. package/.next/server/chunks/ssr/packages_preview-server_src_app_897ecf1c._.js +3 -0
  164. package/.next/server/chunks/ssr/packages_preview-server_src_app_897ecf1c._.js.map +1 -0
  165. package/.next/server/chunks/ssr/packages_preview-server_src_e17a2a9b._.js +3 -0
  166. package/.next/server/chunks/ssr/packages_preview-server_src_e17a2a9b._.js.map +1 -0
  167. package/.next/server/functions-config-manifest.json +4 -0
  168. package/.next/server/interception-route-rewrite-manifest.js +1 -0
  169. package/.next/server/middleware-build-manifest.js +21 -0
  170. package/.next/server/middleware-manifest.json +6 -0
  171. package/.next/server/next-font-manifest.js +1 -0
  172. package/.next/server/next-font-manifest.json +34 -0
  173. package/.next/server/pages/500.html +2 -0
  174. package/.next/server/pages-manifest.json +3 -0
  175. package/.next/server/server-reference-manifest.js +1 -0
  176. package/.next/server/server-reference-manifest.json +80 -0
  177. package/.next/static/cdYIhKFtJ0GB-yJK5ywz_/_buildManifest.js +11 -0
  178. package/.next/static/cdYIhKFtJ0GB-yJK5ywz_/_clientMiddlewareManifest.json +1 -0
  179. package/.next/static/cdYIhKFtJ0GB-yJK5ywz_/_ssgManifest.js +1 -0
  180. package/.next/static/chunks/0464c7ff175ee6ff.js +1 -0
  181. package/.next/static/chunks/10468413db24762a.js +14 -0
  182. package/.next/static/chunks/2de338262e51ef94.js +3 -0
  183. package/.next/static/chunks/37adc260f85da877.js +1 -0
  184. package/.next/static/chunks/521eee9903bc4d1f.js +5 -0
  185. package/.next/static/chunks/6051bd38272cb442.js +14 -0
  186. package/.next/static/chunks/8d433d4b9d701456.js +1 -0
  187. package/.next/static/chunks/92ba72595aad9df6.js +1 -0
  188. package/.next/static/chunks/959ed978a6e89a66.js +1 -0
  189. package/.next/static/chunks/a6dad97d9634a72d.js +1 -0
  190. package/.next/static/chunks/a6dad97d9634a72d.js.map +1 -0
  191. package/.next/static/chunks/a6db6456c5b75734.js +1 -0
  192. package/.next/static/chunks/c3ece0a7e3e07076.js +1 -0
  193. package/.next/static/chunks/d1b29a74f6814a03.css +3 -0
  194. package/.next/static/chunks/f7ec22614fe1c1fe.js +1 -0
  195. package/.next/static/chunks/turbopack-e062a8e6d6034eb0.js +4 -0
  196. package/.next/static/media/1bffadaabf893a1e-s.7cd81963.woff2 +0 -0
  197. package/.next/static/media/2bbe8d2671613f1f-s.76dcb0b2.woff2 +0 -0
  198. package/.next/static/media/2c55a0e60120577a-s.2a48534a.woff2 +0 -0
  199. package/.next/static/media/5476f68d60460930-s.c995e352.woff2 +0 -0
  200. package/.next/static/media/83afe278b6a6bb3c-s.p.3a6ba036.woff2 +0 -0
  201. package/.next/static/media/9c72aa0f40e4eef8-s.18a48cbc.woff2 +0 -0
  202. package/.next/static/media/SFMonoBold-s.p.b90ec775.otf +0 -0
  203. package/.next/static/media/SFMonoHeavy-s.p.545fe93b.otf +0 -0
  204. package/.next/static/media/SFMonoLight-s.p.7c5363a6.otf +0 -0
  205. package/.next/static/media/SFMonoMedium-s.p.a4fc9904.otf +0 -0
  206. package/.next/static/media/SFMonoRegular-s.p.04ea7bf3.otf +0 -0
  207. package/.next/static/media/SFMonoSemibold-s.p.2d2ddb43.otf +0 -0
  208. package/.next/static/media/ad66f9afd8947f86-s.7a40eb73.woff2 +0 -0
  209. package/.next/static/media/favicon.678eb597.ico +0 -0
  210. package/.next/static/media/logo.22a370b0.png +0 -0
  211. package/.next/trace +1 -0
  212. package/.next/trace-build +1 -0
  213. package/.next/turbopack +0 -0
  214. package/.next/types/routes.d.ts +58 -0
  215. package/.next/types/validator.ts +70 -0
  216. package/CHANGELOG.md +12 -0
  217. package/LICENSE.md +8 -0
  218. package/index.mjs +17 -0
  219. package/jsx-runtime/jsx-dev-runtime.js +26 -0
  220. package/module-punycode.d.ts +3 -0
  221. package/next-env.d.ts +6 -0
  222. package/next.config.mjs +15 -0
  223. package/package.json +78 -0
  224. package/postcss.config.js +5 -0
  225. package/readme.md +33 -0
  226. package/scripts/build-preview-server.mts +25 -0
  227. package/scripts/dev.mts +57 -0
  228. package/scripts/seed.mts +36 -0
  229. package/src/actions/export-single-template.ts +74 -0
  230. package/src/actions/get-template-path-from-slug.ts +32 -0
  231. package/src/actions/get-templates-directory-metadata-action.ts +19 -0
  232. package/src/actions/render-template-by-path.tsx +313 -0
  233. package/src/actions/safe-action.ts +15 -0
  234. package/src/animated-icons-data/help.json +1082 -0
  235. package/src/animated-icons-data/link.json +1309 -0
  236. package/src/animated-icons-data/load.json +443 -0
  237. package/src/animated-icons-data/mail.json +1320 -0
  238. package/src/app/env.ts +14 -0
  239. package/src/app/favicon.ico +0 -0
  240. package/src/app/fonts/SFMono/SFMonoBold.otf +0 -0
  241. package/src/app/fonts/SFMono/SFMonoBoldItalic.otf +0 -0
  242. package/src/app/fonts/SFMono/SFMonoHeavy.otf +0 -0
  243. package/src/app/fonts/SFMono/SFMonoHeavyItalic.otf +0 -0
  244. package/src/app/fonts/SFMono/SFMonoLight.otf +0 -0
  245. package/src/app/fonts/SFMono/SFMonoLightItalic.otf +0 -0
  246. package/src/app/fonts/SFMono/SFMonoMedium.otf +0 -0
  247. package/src/app/fonts/SFMono/SFMonoMediumItalic.otf +0 -0
  248. package/src/app/fonts/SFMono/SFMonoRegular.otf +0 -0
  249. package/src/app/fonts/SFMono/SFMonoRegularItalic.otf +0 -0
  250. package/src/app/fonts/SFMono/SFMonoSemibold.otf +0 -0
  251. package/src/app/fonts/SFMono/SFMonoSemiboldItalic.otf +0 -0
  252. package/src/app/fonts.ts +39 -0
  253. package/src/app/globals.css +136 -0
  254. package/src/app/layout.tsx +46 -0
  255. package/src/app/logo.png +0 -0
  256. package/src/app/page.tsx +52 -0
  257. package/src/app/preview/[...slug]/download-button.tsx +138 -0
  258. package/src/app/preview/[...slug]/error-overlay.tsx +58 -0
  259. package/src/app/preview/[...slug]/page.tsx +90 -0
  260. package/src/app/preview/[...slug]/preview.tsx +249 -0
  261. package/src/app/preview/[...slug]/template-frame.tsx +68 -0
  262. package/src/components/button.tsx +101 -0
  263. package/src/components/code-container.tsx +169 -0
  264. package/src/components/code-snippet.tsx +9 -0
  265. package/src/components/code.tsx +185 -0
  266. package/src/components/heading.tsx +113 -0
  267. package/src/components/icons/icon-arrow-down.tsx +16 -0
  268. package/src/components/icons/icon-base.tsx +26 -0
  269. package/src/components/icons/icon-bug.tsx +19 -0
  270. package/src/components/icons/icon-button.tsx +23 -0
  271. package/src/components/icons/icon-check.tsx +19 -0
  272. package/src/components/icons/icon-clipboard.tsx +40 -0
  273. package/src/components/icons/icon-cloud-alert.tsx +18 -0
  274. package/src/components/icons/icon-cloud-check.tsx +17 -0
  275. package/src/components/icons/icon-download.tsx +19 -0
  276. package/src/components/icons/icon-file.tsx +19 -0
  277. package/src/components/icons/icon-folder-open.tsx +19 -0
  278. package/src/components/icons/icon-folder.tsx +18 -0
  279. package/src/components/icons/icon-hide-sidebar.tsx +23 -0
  280. package/src/components/icons/icon-image.tsx +19 -0
  281. package/src/components/icons/icon-info.tsx +18 -0
  282. package/src/components/icons/icon-link.tsx +14 -0
  283. package/src/components/icons/icon-loader.tsx +16 -0
  284. package/src/components/icons/icon-monitor.tsx +19 -0
  285. package/src/components/icons/icon-moon.tsx +16 -0
  286. package/src/components/icons/icon-phone.tsx +26 -0
  287. package/src/components/icons/icon-reload.tsx +18 -0
  288. package/src/components/icons/icon-source.tsx +19 -0
  289. package/src/components/icons/icon-stamp.tsx +14 -0
  290. package/src/components/icons/icon-sun.tsx +74 -0
  291. package/src/components/icons/icon-warning.tsx +31 -0
  292. package/src/components/index.ts +7 -0
  293. package/src/components/logo.tsx +41 -0
  294. package/src/components/resizable-wrapper.tsx +269 -0
  295. package/src/components/shell.tsx +95 -0
  296. package/src/components/sidebar/file-tree-directory-children.tsx +142 -0
  297. package/src/components/sidebar/file-tree-directory.tsx +92 -0
  298. package/src/components/sidebar/file-tree.tsx +31 -0
  299. package/src/components/sidebar/index.ts +1 -0
  300. package/src/components/sidebar/sidebar.tsx +46 -0
  301. package/src/components/text.tsx +99 -0
  302. package/src/components/toolbar/checking-results.tsx +150 -0
  303. package/src/components/toolbar/code-preview-line-link.tsx +39 -0
  304. package/src/components/toolbar/results-table.tsx +0 -0
  305. package/src/components/toolbar/results.tsx +52 -0
  306. package/src/components/toolbar/toolbar-button.tsx +52 -0
  307. package/src/components/toolbar/use-cached-state.ts +36 -0
  308. package/src/components/toolbar.tsx +182 -0
  309. package/src/components/tooltip-content.tsx +31 -0
  310. package/src/components/tooltip.tsx +19 -0
  311. package/src/components/topbar/active-view-toggle-group.tsx +86 -0
  312. package/src/components/topbar/emulated-dark-mode-toggle.tsx +58 -0
  313. package/src/components/topbar/view-size-controls.tsx +173 -0
  314. package/src/components/topbar.tsx +59 -0
  315. package/src/contexts/preview.tsx +91 -0
  316. package/src/contexts/templates.tsx +57 -0
  317. package/src/contexts/toolbar.tsx +22 -0
  318. package/src/hooks/use-clamped-state.ts +24 -0
  319. package/src/hooks/use-fragment-identifier.ts +14 -0
  320. package/src/hooks/use-hot-reload.ts +31 -0
  321. package/src/hooks/use-rendering-metadata.ts +37 -0
  322. package/src/hooks/use-template-rendering-result.ts +58 -0
  323. package/src/utils/cn.ts +6 -0
  324. package/src/utils/constants.ts +8 -0
  325. package/src/utils/contains-template.ts +52 -0
  326. package/src/utils/convert-stack-with-sourcemap.ts +79 -0
  327. package/src/utils/copy-text-to-clipboard.ts +7 -0
  328. package/src/utils/create-jsx-runtime.ts +47 -0
  329. package/src/utils/esbuild/escape-string-for-regex.ts +3 -0
  330. package/src/utils/esbuild/renderring-utilities-exporter.ts +64 -0
  331. package/src/utils/get-line-and-column-from-offset.ts +11 -0
  332. package/src/utils/get-template-component.ts +158 -0
  333. package/src/utils/get-templates-directory-metadata.ts +195 -0
  334. package/src/utils/index.ts +6 -0
  335. package/src/utils/language-map.ts +7 -0
  336. package/src/utils/load-stream.ts +15 -0
  337. package/src/utils/register-spinner-autostopping.ts +28 -0
  338. package/src/utils/result.ts +49 -0
  339. package/src/utils/run-bundled-code.ts +86 -0
  340. package/src/utils/sanitize.ts +6 -0
  341. package/src/utils/sleep.ts +3 -0
  342. package/src/utils/snake-to-camel.ts +5 -0
  343. package/src/utils/static-node-modules-for-vm.ts +93 -0
  344. package/src/utils/style-text.ts +11 -0
  345. package/src/utils/types/as.ts +26 -0
  346. package/src/utils/types/error-object.ts +11 -0
  347. package/src/utils/types/hot-reload-change.ts +13 -0
  348. package/src/utils/types/template.ts +8 -0
  349. package/src/utils/unreachable.ts +8 -0
  350. package/templates/.gitkeep +0 -0
  351. package/tsconfig.json +47 -0
@@ -0,0 +1,4 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,{otherChunks:["static/chunks/8d433d4b9d701456.js","static/chunks/0464c7ff175ee6ff.js","static/chunks/521eee9903bc4d1f.js","static/chunks/f7ec22614fe1c1fe.js"],runtimeModuleIds:[45832]}]),(()=>{let e;if(!Array.isArray(globalThis.TURBOPACK))return;let t="/_next/",r=(self.TURBOPACK_CHUNK_SUFFIX??document?.currentScript?.getAttribute?.("src")?.replace(/^(.*(?=\?)|^.*$)/,""))||"",n=new WeakMap;function o(e,t){this.m=e,this.e=t}let i=o.prototype,l=Object.prototype.hasOwnProperty,s="undefined"!=typeof Symbol&&Symbol.toStringTag;function u(e,t,r){l.call(e,t)||Object.defineProperty(e,t,r)}function c(e,t){let r=e[t];return r||(r=a(t),e[t]=r),r}function a(e){return{exports:{},error:void 0,id:e,namespaceObject:void 0}}function f(e,t){u(e,"__esModule",{value:!0}),s&&u(e,s,{value:"Module"});let r=0;for(;r<t.length;){let n=t[r++],o=t[r++];if("number"==typeof o)if(0===o)u(e,n,{value:t[r++],enumerable:!0,writable:!1});else throw Error(`unexpected tag: ${o}`);else"function"==typeof t[r]?u(e,n,{get:o,set:t[r++],enumerable:!0}):u(e,n,{get:o,enumerable:!0})}Object.seal(e)}i.s=function(e,t){let r,n;null!=t?n=(r=c(this.c,t)).exports:(r=this.m,n=this.e),r.namespaceObject=n,f(n,e)},i.j=function(e,t){var r,o;let i,s,u;null!=t?s=(i=c(this.c,t)).exports:(i=this.m,s=this.e);let a=(r=i,o=s,(u=n.get(r))||(n.set(r,u=[]),r.exports=r.namespaceObject=new Proxy(o,{get(e,t){if(l.call(e,t)||"default"===t||"__esModule"===t)return Reflect.get(e,t);for(let e of u){let r=Reflect.get(e,t);if(void 0!==r)return r}},ownKeys(e){let t=Reflect.ownKeys(e);for(let e of u)for(let r of Reflect.ownKeys(e))"default"===r||t.includes(r)||t.push(r);return t}})),u);"object"==typeof e&&null!==e&&a.push(e)},i.v=function(e,t){(null!=t?c(this.c,t):this.m).exports=e},i.n=function(e,t){let r;(r=null!=t?c(this.c,t):this.m).exports=r.namespaceObject=e};let p=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,h=[null,p({}),p([]),p(p)];function d(e,t,r){let n=[],o=-1;for(let t=e;("object"==typeof t||"function"==typeof t)&&!h.includes(t);t=p(t))for(let r of Object.getOwnPropertyNames(t))n.push(r,function(e,t){return()=>e[t]}(e,r)),-1===o&&"default"===r&&(o=n.length-1);return r&&o>=0||(o>=0?n.splice(o,1,0,e):n.push("default",0,e)),f(t,n),t}function m(e){let t=B(e,this.m);if(t.namespaceObject)return t.namespaceObject;let r=t.exports;return t.namespaceObject=d(r,"function"==typeof r?function(...e){return r.apply(this,e)}:Object.create(null),r&&r.__esModule)}function b(e){let t=e.indexOf("#");-1!==t&&(e=e.substring(0,t));let r=e.indexOf("?");return -1!==r&&(e=e.substring(0,r)),e}function y(){let e,t;return{promise:new Promise((r,n)=>{t=n,e=r}),resolve:e,reject:t}}i.i=m,i.A=function(e){return this.r(e)(m.bind(this))},i.t="function"==typeof require?require:function(){throw Error("Unexpected use of runtime require")},i.r=function(e){return B(e,this.m).exports},i.f=function(e){function t(t){if(t=b(t),l.call(e,t))return e[t].module();let r=Error(`Cannot find module '${t}'`);throw r.code="MODULE_NOT_FOUND",r}return t.keys=()=>Object.keys(e),t.resolve=t=>{if(t=b(t),l.call(e,t))return e[t].id();let r=Error(`Cannot find module '${t}'`);throw r.code="MODULE_NOT_FOUND",r},t.import=async e=>await t(e),t};let O=Symbol("turbopack queues"),g=Symbol("turbopack exports"),w=Symbol("turbopack error");function C(e){e&&1!==e.status&&(e.status=1,e.forEach(e=>e.queueCount--),e.forEach(e=>e.queueCount--?e.queueCount++:e()))}i.a=function(e,t){let r=this.m,n=t?Object.assign([],{status:-1}):void 0,o=new Set,{resolve:i,reject:l,promise:s}=y(),u=Object.assign(s,{[g]:r.exports,[O]:e=>{n&&e(n),o.forEach(e),u.catch(()=>{})}}),c={get:()=>u,set(e){e!==u&&(u[g]=e)}};Object.defineProperty(r,"exports",c),Object.defineProperty(r,"namespaceObject",c),e(function(e){let t=e.map(e=>{if(null!==e&&"object"==typeof e){if(O in e)return e;if(null!=e&&"object"==typeof e&&"then"in e&&"function"==typeof e.then){let t=Object.assign([],{status:0}),r={[g]:{},[O]:e=>e(t)};return e.then(e=>{r[g]=e,C(t)},e=>{r[w]=e,C(t)}),r}}return{[g]:e,[O]:()=>{}}}),r=()=>t.map(e=>{if(e[w])throw e[w];return e[g]}),{promise:i,resolve:l}=y(),s=Object.assign(()=>l(r),{queueCount:0});function u(e){e!==n&&!o.has(e)&&(o.add(e),e&&0===e.status&&(s.queueCount++,e.push(s)))}return t.map(e=>e[O](u)),s.queueCount?i:r()},function(e){e?l(u[w]=e):i(u[g]),C(n)}),n&&-1===n.status&&(n.status=0)};let U=function(e){let t=new URL(e,"x:/"),r={};for(let e in t)r[e]=t[e];for(let t in r.href=e,r.pathname=e.replace(/[?#].*/,""),r.origin=r.protocol="",r.toString=r.toJSON=(...t)=>e,r)Object.defineProperty(this,t,{enumerable:!0,configurable:!0,value:r[t]})};function R(e,t){throw Error(`Invariant: ${t(e)}`)}U.prototype=URL.prototype,i.U=U,i.z=function(e){throw Error("dynamic usage of require is not supported")},i.g=globalThis;let j=o.prototype;var k,_=((k=_||{})[k.Runtime=0]="Runtime",k[k.Parent=1]="Parent",k[k.Update=2]="Update",k);let v=new Map;i.M=v;let $=new Map,P=new Map;async function S(e,t,r){let n;if("string"==typeof r)return E(e,t,K(r));let o=r.included||[],i=o.map(e=>!!v.has(e)||$.get(e));if(i.length>0&&i.every(e=>e))return void await Promise.all(i);let l=r.moduleChunks||[],s=l.map(e=>P.get(e)).filter(e=>e);if(s.length>0){if(s.length===l.length)return void await Promise.all(s);let r=new Set;for(let e of l)P.has(e)||r.add(e);for(let n of r){let r=E(e,t,K(n));P.set(n,r),s.push(r)}n=Promise.all(s)}else{for(let o of(n=E(e,t,K(r.path)),l))P.has(o)||P.set(o,n)}for(let e of o)$.has(e)||$.set(e,n);await n}j.l=function(e){return S(1,this.m.id,e)};let T=Promise.resolve(void 0),A=new WeakMap;function E(t,r,n){let o=e.loadChunkCached(t,n),i=A.get(o);if(void 0===i){let e=A.set.bind(A,o,T);i=o.then(e).catch(e=>{let o;switch(t){case 0:o=`as a runtime dependency of chunk ${r}`;break;case 1:o=`from module ${r}`;break;case 2:o="from an HMR update";break;default:R(t,e=>`Unknown source type: ${e}`)}let i=Error(`Failed to load chunk ${n} ${o}${e?`: ${e}`:""}`,e?{cause:e}:void 0);throw i.name="ChunkLoadError",i}),A.set(o,i)}return i}function K(e){return`${t}${e.split("/").map(e=>encodeURIComponent(e)).join("/")}${r}`}j.L=function(e){return E(1,this.m.id,e)},j.R=function(e){let t=this.r(e);return t?.default??t},j.P=function(e){return`/ROOT/${e??""}`},j.b=function(e){let t=new Blob([`self.TURBOPACK_WORKER_LOCATION = ${JSON.stringify(location.origin)};
2
+ self.TURBOPACK_CHUNK_SUFFIX = ${JSON.stringify(r)};
3
+ self.TURBOPACK_NEXT_CHUNK_URLS = ${JSON.stringify(e.reverse().map(K),null,2)};
4
+ importScripts(...self.TURBOPACK_NEXT_CHUNK_URLS.map(c => self.TURBOPACK_WORKER_LOCATION + c).reverse());`],{type:"text/javascript"});return URL.createObjectURL(t)};let x=/\.js(?:\?[^#]*)?(?:#.*)?$/,N=/\.css(?:\?[^#]*)?(?:#.*)?$/;function M(e){return N.test(e)}i.w=function(t,r,n){return e.loadWebAssembly(1,this.m.id,t,r,n)},i.u=function(t,r){return e.loadWebAssemblyModule(1,this.m.id,t,r)};let L={};i.c=L;let B=(e,t)=>{let r=L[e];if(r){if(r.error)throw r.error;return r}return q(e,_.Parent,t.id)};function q(e,t,r){let n=v.get(e);if("function"!=typeof n)throw Error(function(e,t,r){let n;switch(t){case 0:n=`as a runtime entry of chunk ${r}`;break;case 1:n=`because it was required from module ${r}`;break;case 2:n="because of an HMR update";break;default:R(t,e=>`Unknown source type: ${e}`)}return`Module ${e} was instantiated ${n}, but the module factory is not available.`}(e,t,r));let i=a(e),l=i.exports;L[e]=i;let s=new o(i,l);try{n(s,i,l)}catch(e){throw i.error=e,e}return i.namespaceObject&&i.exports!==i.namespaceObject&&d(i.exports,i.namespaceObject),i}function I(r){let n,o=function(e){if("string"==typeof e)return e;let r=decodeURIComponent(("undefined"!=typeof TURBOPACK_NEXT_CHUNK_URLS?TURBOPACK_NEXT_CHUNK_URLS.pop():e.getAttribute("src")).replace(/[?#].*$/,""));return r.startsWith(t)?r.slice(t.length):r}(r[0]);return 2===r.length?n=r[1]:(n=void 0,!function(e,t,r,n){let o=1;for(;o<e.length;){let t=e[o],n=o+1;for(;n<e.length&&"function"!=typeof e[n];)n++;if(n===e.length)throw Error("malformed chunk format, expected a factory function");if(!r.has(t)){let i=e[n];for(Object.defineProperty(i,"name",{value:"module evaluation"});o<n;o++)t=e[o],r.set(t,i)}o=n+1}}(r,0,v)),e.registerChunk(o,n)}let W=new Map;function H(e){let t=W.get(e);if(!t){let r,n;t={resolved:!1,loadingStarted:!1,promise:new Promise((e,t)=>{r=e,n=t}),resolve:()=>{t.resolved=!0,r()},reject:n},W.set(e,t)}return t}e={async registerChunk(e,t){if(H(K(e)).resolve(),null!=t){for(let e of t.otherChunks)H(K("string"==typeof e?e:e.path));if(await Promise.all(t.otherChunks.map(t=>S(0,e,t))),t.runtimeModuleIds.length>0)for(let r of t.runtimeModuleIds)!function(e,t){let r=L[t];if(r){if(r.error)throw r.error;return}q(t,_.Runtime,e)}(e,r)}},loadChunkCached:(e,t)=>(function(e,t){let r=H(t);if(r.loadingStarted)return r.promise;if(e===_.Runtime)return r.loadingStarted=!0,M(t)&&r.resolve(),r.promise;if("function"==typeof importScripts)if(M(t));else if(x.test(t))self.TURBOPACK_NEXT_CHUNK_URLS.push(t),importScripts(TURBOPACK_WORKER_LOCATION+t);else throw Error(`can't infer type of chunk from URL ${t} in worker`);else{let e=decodeURI(t);if(M(t))if(document.querySelectorAll(`link[rel=stylesheet][href="${t}"],link[rel=stylesheet][href^="${t}?"],link[rel=stylesheet][href="${e}"],link[rel=stylesheet][href^="${e}?"]`).length>0)r.resolve();else{let e=document.createElement("link");e.rel="stylesheet",e.href=t,e.onerror=()=>{r.reject()},e.onload=()=>{r.resolve()},document.head.appendChild(e)}else if(x.test(t)){let n=document.querySelectorAll(`script[src="${t}"],script[src^="${t}?"],script[src="${e}"],script[src^="${e}?"]`);if(n.length>0)for(let e of Array.from(n))e.addEventListener("error",()=>{r.reject()});else{let e=document.createElement("script");e.src=t,e.onerror=()=>{r.reject()},document.head.appendChild(e)}}else throw Error(`can't infer type of chunk from URL ${t}`)}return r.loadingStarted=!0,r.promise})(e,t),async loadWebAssembly(e,t,r,n,o){let i=fetch(K(r)),{instance:l}=await WebAssembly.instantiateStreaming(i,o);return l.exports},async loadWebAssemblyModule(e,t,r,n){let o=fetch(K(r));return await WebAssembly.compileStreaming(o)}};let F=globalThis.TURBOPACK;globalThis.TURBOPACK={push:I},F.forEach(I)})();
package/.next/trace ADDED
@@ -0,0 +1 @@
1
+ [{"name":"generate-buildid","duration":203,"timestamp":77725620,"id":4,"parentId":1,"tags":{},"startTime":1766836137836,"traceId":"c8e16ec65addc78b"},{"name":"load-custom-routes","duration":345,"timestamp":77725928,"id":5,"parentId":1,"tags":{},"startTime":1766836137837,"traceId":"c8e16ec65addc78b"},{"name":"create-dist-dir","duration":677,"timestamp":77726298,"id":6,"parentId":1,"tags":{},"startTime":1766836137837,"traceId":"c8e16ec65addc78b"},{"name":"clean","duration":222,"timestamp":77727570,"id":7,"parentId":1,"tags":{},"startTime":1766836137838,"traceId":"c8e16ec65addc78b"},{"name":"create-pages-mapping","duration":194,"timestamp":77807338,"id":8,"parentId":1,"tags":{},"startTime":1766836137918,"traceId":"c8e16ec65addc78b"},{"name":"collect-app-files","duration":2316,"timestamp":77807564,"id":9,"parentId":1,"tags":{},"startTime":1766836137918,"traceId":"c8e16ec65addc78b"},{"name":"create-app-mapping","duration":2604,"timestamp":77809903,"id":10,"parentId":1,"tags":{},"startTime":1766836137921,"traceId":"c8e16ec65addc78b"},{"name":"create-app-layouts","duration":125,"timestamp":77812534,"id":11,"parentId":1,"tags":{},"startTime":1766836137923,"traceId":"c8e16ec65addc78b"},{"name":"collect-default-files","duration":508,"timestamp":77814288,"id":13,"parentId":1,"tags":{},"startTime":1766836137925,"traceId":"c8e16ec65addc78b"},{"name":"generate-route-types","duration":11172,"timestamp":77813809,"id":12,"parentId":1,"tags":{},"startTime":1766836137925,"traceId":"c8e16ec65addc78b"},{"name":"public-dir-conflict-check","duration":89,"timestamp":77824999,"id":14,"parentId":1,"tags":{},"startTime":1766836137936,"traceId":"c8e16ec65addc78b"},{"name":"generate-routes-manifest","duration":1916,"timestamp":77825147,"id":15,"parentId":1,"tags":{},"startTime":1766836137936,"traceId":"c8e16ec65addc78b"},{"name":"run-turbopack","duration":6481512,"timestamp":77830127,"id":17,"parentId":1,"tags":{},"startTime":1766836137941,"traceId":"c8e16ec65addc78b"},{"name":"run-typescript","duration":4232265,"timestamp":84326790,"id":19,"parentId":1,"tags":{},"startTime":1766836144438,"traceId":"c8e16ec65addc78b"},{"name":"generate-required-server-files","duration":1974,"timestamp":88559645,"id":21,"parentId":1,"tags":{},"startTime":1766836148671,"traceId":"c8e16ec65addc78b"},{"name":"check-static-error-page","duration":2417,"timestamp":88613520,"id":23,"parentId":22,"tags":{},"startTime":1766836148724,"traceId":"c8e16ec65addc78b"},{"name":"is-page-static","duration":248225,"timestamp":88619489,"id":30,"parentId":25,"tags":{},"startTime":1766836148730,"traceId":"c8e16ec65addc78b"},{"name":"check-page","duration":252286,"timestamp":88615536,"id":25,"parentId":22,"tags":{"page":"/_global-error"},"startTime":1766836148726,"traceId":"c8e16ec65addc78b"},{"name":"is-page-static","duration":308292,"timestamp":88619199,"id":29,"parentId":24,"tags":{},"startTime":1766836148730,"traceId":"c8e16ec65addc78b"},{"name":"check-page","duration":313025,"timestamp":88614519,"id":24,"parentId":22,"tags":{"page":"/_not-found"},"startTime":1766836148725,"traceId":"c8e16ec65addc78b"},{"name":"is-page-static","duration":329330,"timestamp":88619594,"id":31,"parentId":26,"tags":{},"startTime":1766836148730,"traceId":"c8e16ec65addc78b"},{"name":"check-page","duration":333264,"timestamp":88615721,"id":26,"parentId":22,"tags":{"page":"/favicon.ico"},"startTime":1766836148727,"traceId":"c8e16ec65addc78b"},{"name":"is-page-static","duration":332295,"timestamp":88626497,"id":32,"parentId":27,"tags":{},"startTime":1766836148737,"traceId":"c8e16ec65addc78b"},{"name":"check-page","duration":343037,"timestamp":88615798,"id":27,"parentId":22,"tags":{"page":"/"},"startTime":1766836148727,"traceId":"c8e16ec65addc78b"},{"name":"is-page-static","duration":376604,"timestamp":88626850,"id":33,"parentId":28,"tags":{},"startTime":1766836148738,"traceId":"c8e16ec65addc78b"},{"name":"check-page","duration":387641,"timestamp":88615865,"id":28,"parentId":22,"tags":{"page":"/preview/[...slug]"},"startTime":1766836148727,"traceId":"c8e16ec65addc78b"},{"name":"static-check","duration":390745,"timestamp":88612781,"id":22,"parentId":1,"tags":{},"startTime":1766836148724,"traceId":"c8e16ec65addc78b"},{"name":"write-routes-manifest","duration":280,"timestamp":89004138,"id":35,"parentId":1,"tags":{},"startTime":1766836149115,"traceId":"c8e16ec65addc78b"},{"name":"load-dotenv","duration":49,"timestamp":89012190,"id":38,"parentId":37,"tags":{},"startTime":1766836149123,"traceId":"c8e16ec65addc78b"},{"name":"run-export-path-map","duration":287,"timestamp":89014138,"id":39,"parentId":37,"tags":{},"startTime":1766836149125,"traceId":"c8e16ec65addc78b"},{"name":"next-export","duration":96369,"timestamp":89011302,"id":37,"parentId":1,"tags":{},"startTime":1766836149122,"traceId":"c8e16ec65addc78b"},{"name":"move-exported-app-global-error-","duration":463,"timestamp":89108776,"id":40,"parentId":36,"tags":{},"startTime":1766836149220,"traceId":"c8e16ec65addc78b"},{"name":"static-generation","duration":103260,"timestamp":89007305,"id":36,"parentId":1,"tags":{},"startTime":1766836149118,"traceId":"c8e16ec65addc78b"},{"name":"write-routes-manifest","duration":255,"timestamp":89110704,"id":41,"parentId":1,"tags":{},"startTime":1766836149222,"traceId":"c8e16ec65addc78b"},{"name":"print-tree-view","duration":2137,"timestamp":89115274,"id":42,"parentId":1,"tags":{},"startTime":1766836149226,"traceId":"c8e16ec65addc78b"},{"name":"telemetry-flush","duration":86092,"timestamp":89117421,"id":43,"parentId":1,"tags":{},"startTime":1766836149228,"traceId":"c8e16ec65addc78b"},{"name":"next-build","duration":11500391,"timestamp":77703143,"id":1,"tags":{"buildMode":"default","version":"16.1.1","bundler":"turbopack","has-custom-webpack-config":"false","use-build-worker":"true"},"startTime":1766836137814,"traceId":"c8e16ec65addc78b"}]
@@ -0,0 +1 @@
1
+ [{"name":"run-turbopack","duration":6481512,"timestamp":77830127,"id":17,"parentId":1,"tags":{},"startTime":1766836137941,"traceId":"c8e16ec65addc78b"},{"name":"run-typescript","duration":4232265,"timestamp":84326790,"id":19,"parentId":1,"tags":{},"startTime":1766836144438,"traceId":"c8e16ec65addc78b"},{"name":"static-check","duration":390745,"timestamp":88612781,"id":22,"parentId":1,"tags":{},"startTime":1766836148724,"traceId":"c8e16ec65addc78b"},{"name":"static-generation","duration":103260,"timestamp":89007305,"id":36,"parentId":1,"tags":{},"startTime":1766836149118,"traceId":"c8e16ec65addc78b"},{"name":"telemetry-flush","duration":86092,"timestamp":89117421,"id":43,"parentId":1,"tags":{},"startTime":1766836149228,"traceId":"c8e16ec65addc78b"},{"name":"next-build","duration":11500391,"timestamp":77703143,"id":1,"tags":{"buildMode":"default","version":"16.1.1","bundler":"turbopack","has-custom-webpack-config":"false","use-build-worker":"true"},"startTime":1766836137814,"traceId":"c8e16ec65addc78b"}]
File without changes
@@ -0,0 +1,58 @@
1
+ // This file is generated automatically by Next.js
2
+ // Do not edit this file manually
3
+
4
+ type AppRoutes = "/" | "/preview/[...slug]"
5
+ type PageRoutes = never
6
+ type LayoutRoutes = "/"
7
+ type RedirectRoutes = never
8
+ type RewriteRoutes = never
9
+ type Routes = AppRoutes | PageRoutes | LayoutRoutes | RedirectRoutes | RewriteRoutes
10
+
11
+
12
+ interface ParamMap {
13
+ "/": {}
14
+ "/preview/[...slug]": { "slug": string[]; }
15
+ }
16
+
17
+
18
+ export type ParamsOf<Route extends Routes> = ParamMap[Route]
19
+
20
+ interface LayoutSlotMap {
21
+ "/": never
22
+ }
23
+
24
+
25
+ export type { AppRoutes, PageRoutes, LayoutRoutes, RedirectRoutes, RewriteRoutes, ParamMap }
26
+
27
+ declare global {
28
+ /**
29
+ * Props for Next.js App Router page components
30
+ * @example
31
+ * ```tsx
32
+ * export default function Page(props: PageProps<'/blog/[slug]'>) {
33
+ * const { slug } = await props.params
34
+ * return <div>Blog post: {slug}</div>
35
+ * }
36
+ * ```
37
+ */
38
+ interface PageProps<AppRoute extends AppRoutes> {
39
+ params: Promise<ParamMap[AppRoute]>
40
+ searchParams: Promise<Record<string, string | string[] | undefined>>
41
+ }
42
+
43
+ /**
44
+ * Props for Next.js App Router layout components
45
+ * @example
46
+ * ```tsx
47
+ * export default function Layout(props: LayoutProps<'/dashboard'>) {
48
+ * return <div>{props.children}</div>
49
+ * }
50
+ * ```
51
+ */
52
+ type LayoutProps<LayoutRoute extends LayoutRoutes> = {
53
+ params: Promise<ParamMap[LayoutRoute]>
54
+ children: React.ReactNode
55
+ } & {
56
+ [K in LayoutSlotMap[LayoutRoute]]: React.ReactNode
57
+ }
58
+ }
@@ -0,0 +1,70 @@
1
+ // This file is generated automatically by Next.js
2
+ // Do not edit this file manually
3
+ // This file validates that all pages and layouts export the correct types
4
+
5
+ import type { AppRoutes, LayoutRoutes, ParamMap } from "./routes.js"
6
+ import type { ResolvingMetadata, ResolvingViewport } from "next/types.js"
7
+
8
+ type AppPageConfig<Route extends AppRoutes = AppRoutes> = {
9
+ default: React.ComponentType<{ params: Promise<ParamMap[Route]> } & any> | ((props: { params: Promise<ParamMap[Route]> } & any) => React.ReactNode | Promise<React.ReactNode> | never | void | Promise<void>)
10
+ generateStaticParams?: (props: { params: ParamMap[Route] }) => Promise<any[]> | any[]
11
+ generateMetadata?: (
12
+ props: { params: Promise<ParamMap[Route]> } & any,
13
+ parent: ResolvingMetadata
14
+ ) => Promise<any> | any
15
+ generateViewport?: (
16
+ props: { params: Promise<ParamMap[Route]> } & any,
17
+ parent: ResolvingViewport
18
+ ) => Promise<any> | any
19
+ metadata?: any
20
+ viewport?: any
21
+ }
22
+
23
+ type LayoutConfig<Route extends LayoutRoutes = LayoutRoutes> = {
24
+ default: React.ComponentType<LayoutProps<Route>> | ((props: LayoutProps<Route>) => React.ReactNode | Promise<React.ReactNode> | never | void | Promise<void>)
25
+ generateStaticParams?: (props: { params: ParamMap[Route] }) => Promise<any[]> | any[]
26
+ generateMetadata?: (
27
+ props: { params: Promise<ParamMap[Route]> } & any,
28
+ parent: ResolvingMetadata
29
+ ) => Promise<any> | any
30
+ generateViewport?: (
31
+ props: { params: Promise<ParamMap[Route]> } & any,
32
+ parent: ResolvingViewport
33
+ ) => Promise<any> | any
34
+ metadata?: any
35
+ viewport?: any
36
+ }
37
+
38
+
39
+ // Validate ../../src/app/page.tsx
40
+ {
41
+ type __IsExpected<Specific extends AppPageConfig<"/">> = Specific
42
+ const handler = {} as typeof import("../../src/app/page.js")
43
+ type __Check = __IsExpected<typeof handler>
44
+ // @ts-ignore
45
+ type __Unused = __Check
46
+ }
47
+
48
+ // Validate ../../src/app/preview/[...slug]/page.tsx
49
+ {
50
+ type __IsExpected<Specific extends AppPageConfig<"/preview/[...slug]">> = Specific
51
+ const handler = {} as typeof import("../../src/app/preview/[...slug]/page.js")
52
+ type __Check = __IsExpected<typeof handler>
53
+ // @ts-ignore
54
+ type __Unused = __Check
55
+ }
56
+
57
+
58
+
59
+
60
+
61
+
62
+
63
+ // Validate ../../src/app/layout.tsx
64
+ {
65
+ type __IsExpected<Specific extends LayoutConfig<"/">> = Specific
66
+ const handler = {} as typeof import("../../src/app/layout.js")
67
+ type __Check = __IsExpected<typeof handler>
68
+ // @ts-ignore
69
+ type __Unused = __Check
70
+ }
package/CHANGELOG.md ADDED
@@ -0,0 +1,12 @@
1
+ # @ahmedrowaihi/pdf-forge-preview
2
+
3
+ ## 1.0.0-canary.0
4
+
5
+ ### Major Changes
6
+
7
+ - 5900266: first push
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [5900266]
12
+ - @ahmedrowaihi/pdf-forge-printer@1.0.0-canary.0
package/LICENSE.md ADDED
@@ -0,0 +1,8 @@
1
+ Copyright 2024 Plus Five Five, Inc
2
+ Copyright 2025 ahmedrowaihi (fork modifications)
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
5
+
6
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
7
+
8
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/index.mjs ADDED
@@ -0,0 +1,17 @@
1
+ /**
2
+ * this file is required so that import.meta.resolve and require.resolve can properly can find the module for this package
3
+ */
4
+ import fs from 'node:fs/promises';
5
+ import path from 'node:path';
6
+ import url from 'node:url';
7
+
8
+ const filename = url.fileURLToPath(import.meta.url);
9
+ const dirname = path.dirname(filename);
10
+ const packageJson = JSON.parse(
11
+ await fs.readFile(path.join(dirname, 'package.json'), 'utf-8'),
12
+ );
13
+
14
+ /**
15
+ * @type {string}
16
+ */
17
+ export const version = packageJson.version;
@@ -0,0 +1,26 @@
1
+ /**
2
+ * This hack is necessary because React forces the use of the non-dev JSX runtime
3
+ * when NODE_ENV is set to 'production', which would break the data-source references
4
+ * we need for stack traces in the preview server.
5
+ */
6
+ import ReactJSXDevRuntime from 'react/jsx-dev-runtime';
7
+
8
+ export function jsxDEV(type, props, key, isStaticChildren, source, self) {
9
+ const newProps = { ...props };
10
+
11
+ if (source && shouldIncludeSourceReference) {
12
+ newProps['data-source-file'] = source.fileName;
13
+ newProps['data-source-line'] = source.lineNumber;
14
+ }
15
+
16
+ return ReactJSXDevRuntime.jsxDEV(
17
+ type,
18
+ newProps,
19
+ key,
20
+ isStaticChildren,
21
+ source,
22
+ self,
23
+ );
24
+ }
25
+
26
+ export const Fragment = ReactJSXDevRuntime.Fragment;
@@ -0,0 +1,3 @@
1
+ declare module 'module-punycode' {
2
+ export * from 'node:punycode';
3
+ }
package/next-env.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ /// <reference types="next" />
2
+ /// <reference types="next/image-types/global" />
3
+ import "./.next/types/routes.d.ts";
4
+
5
+ // NOTE: This file should not be edited
6
+ // see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @type {import('next').NextConfig}
3
+ */
4
+ const nextConfig = {
5
+ serverExternalPackages: ['esbuild'],
6
+ // Noticed an issue with typescript transpilation when going from Next 14.1.1 to 14.1.2
7
+ // and I narrowed that down into this PR https://github.com/vercel/next.js/pull/62005
8
+ //
9
+ // What is probably happening is that it's noticing the files for the app are somewhere inside of a `node_modules` and automatically opt-outs of SWC's transpilation.
10
+ //
11
+ // TODO: Open an issue on Nextjs about this.
12
+ transpilePackages: ['@ahmedrowaihi'],
13
+ };
14
+
15
+ export default nextConfig;
package/package.json ADDED
@@ -0,0 +1,78 @@
1
+ {
2
+ "name": "@ahmedrowaihi/pdf-forge-preview",
3
+ "version": "1.0.0-canary.0",
4
+ "description": "A live preview of your PDF templates right in your browser.",
5
+ "main": "./index.mjs",
6
+ "dependencies": {
7
+ "next": "^16",
8
+ "@ahmedrowaihi/pdf-forge-printer": "1.0.0-canary.0"
9
+ },
10
+ "devDependencies": {
11
+ "@babel/core": "7.26.10",
12
+ "@babel/parser": "7.27.0",
13
+ "@babel/traverse": "7.27.0",
14
+ "@lottiefiles/dotlottie-react": "0.13.3",
15
+ "@radix-ui/colors": "3.0.0",
16
+ "@radix-ui/react-collapsible": "1.1.12",
17
+ "@radix-ui/react-dropdown-menu": "2.1.16",
18
+ "@radix-ui/react-popover": "1.1.15",
19
+ "@radix-ui/react-slot": "1.2.3",
20
+ "@radix-ui/react-tabs": "1.1.13",
21
+ "@radix-ui/react-toggle": "1.1.10",
22
+ "@radix-ui/react-toggle-group": "1.1.11",
23
+ "@radix-ui/react-tooltip": "1.2.8",
24
+ "lucide-react": "^0.562.0",
25
+ "@types/babel__core": "7.20.5",
26
+ "@types/babel__traverse": "7.20.7",
27
+ "@types/css-tree": "2.3.10",
28
+ "@types/fs-extra": "11.0.1",
29
+ "@types/mime-types": "2.1.4",
30
+ "@types/node": "22.14.1",
31
+ "@types/normalize-path": "3.0.2",
32
+ "@types/react": "^19",
33
+ "@types/react-dom": "^19",
34
+ "@types/webpack": "5.28.5",
35
+ "clsx": "2.1.1",
36
+ "colorjs.io": "0.5.2",
37
+ "esbuild": "0.25.10",
38
+ "framer-motion": "12.23.22",
39
+ "log-symbols": "4.1.0",
40
+ "module-punycode": "npm:punycode@2.3.1",
41
+ "next-safe-action": "8.0.11",
42
+ "ora": "5.4.1",
43
+ "@tailwindcss/postcss": "4.1.17",
44
+ "postcss": "8.5.6",
45
+ "prism-react-renderer": "2.4.1",
46
+ "react": "^19",
47
+ "react-dom": "^19",
48
+ "sharp": "0.34.4",
49
+ "socket.io-client": "4.8.1",
50
+ "sonner": "2.0.3",
51
+ "source-map-js": "1.2.1",
52
+ "stacktrace-parser": "0.1.11",
53
+ "tailwind-merge": "3.2.0",
54
+ "tailwindcss": "4.1.17",
55
+ "typescript": "5.8.3",
56
+ "use-debounce": "10.0.4",
57
+ "zod": "4.1.12",
58
+ "@ahmedrowaihi/pdf-forge-components": "1.0.0-canary.0",
59
+ "@ahmedrowaihi/pdf-forge-core": "1.0.0-canary.0"
60
+ },
61
+ "license": "MIT",
62
+ "repository": {
63
+ "type": "git",
64
+ "url": "https://github.com/ahmedrowaihi/react-pdf-forge.git",
65
+ "directory": "packages/preview-server"
66
+ },
67
+ "publishConfig": {
68
+ "access": "public"
69
+ },
70
+ "scripts": {
71
+ "build": "tsx ./scripts/build-preview-server.mts",
72
+ "clean": "rm -rf dist",
73
+ "dev": "tsx ./scripts/dev.mts",
74
+ "dev:seed": "tsx ./scripts/seed.mts",
75
+ "test": "vitest run",
76
+ "test:watch": "vitest"
77
+ }
78
+ }
@@ -0,0 +1,5 @@
1
+ module.exports = {
2
+ plugins: {
3
+ '@tailwindcss/postcss': {},
4
+ },
5
+ };
package/readme.md ADDED
@@ -0,0 +1,33 @@
1
+ <div align="center"><strong>@ahmedrowaihi/pdf-forge-preview</strong></div>
2
+ <div align="center">A live preview of your PDF templates right in your browser.</div>
3
+ <br />
4
+ <div align="center">
5
+ <a href="https://react-pdf-forge.com">Website</a>
6
+ <span> · </span>
7
+ <a href="https://github.com/ahmedrowaihi/react-pdf-forge">GitHub</a>
8
+
9
+ </div>
10
+
11
+ This package is used to store the preview server, it is also published and versioned so that it can be installed when the [CLI](../pdf-forge-cli) is being used.
12
+
13
+ ## Development workflow
14
+
15
+ ### 1. Seed PDF templates
16
+
17
+ ```sh
18
+ pnpm dev:seed
19
+ ```
20
+
21
+ This generates a boilerplate templates directory for you to work with. These files can also be modified as you see fit since they are not included in git.
22
+
23
+ ### 2. Run development server
24
+
25
+ ```sh
26
+ pnpm dev
27
+ ```
28
+
29
+ This is somewhat equivalent to `next dev` and does not support hot reloading for PDF templates like the CLI does. It lets you work on the UI for the preview server mainly.
30
+
31
+ ### 3. Open in your browser
32
+
33
+ Go to http://localhost:3000
@@ -0,0 +1,25 @@
1
+ import { spawn } from 'node:child_process';
2
+ import fs from 'node:fs';
3
+ import path from 'node:path';
4
+
5
+ const nextBuildProcess = spawn('pnpm next build', {
6
+ detached: true,
7
+ shell: true,
8
+ stdio: 'inherit',
9
+ cwd: path.resolve(import.meta.dirname, '../'),
10
+ });
11
+
12
+ process.on('SIGINT', () => {
13
+ nextBuildProcess.kill('SIGINT');
14
+ });
15
+
16
+ nextBuildProcess.on('exit', (code) => {
17
+ if (code !== 0) {
18
+ console.error(`next build failed with exit code ${code}`);
19
+ process.exit(code);
20
+ }
21
+
22
+ fs.rmSync(path.resolve(import.meta.dirname, '../.next/cache'), {
23
+ recursive: true,
24
+ });
25
+ });
@@ -0,0 +1,57 @@
1
+ import child_process from 'node:child_process';
2
+ import { promises as fs } from 'node:fs';
3
+ import os from 'node:os';
4
+ import path from 'node:path';
5
+ import url from 'node:url';
6
+ import logSymbols from 'log-symbols';
7
+
8
+ console.info(
9
+ ' ',
10
+ logSymbols.warning,
11
+ 'This is only running the development server for the UI, this does not run the CLI part of the preview server.',
12
+ os.EOL,
13
+ );
14
+
15
+ const filename = url.fileURLToPath(import.meta.url);
16
+ const dirname = path.dirname(filename);
17
+
18
+ const previewServerRoot = path.resolve(dirname, '..');
19
+ const templatesDirectoryPath = path.join(previewServerRoot, 'templates');
20
+
21
+ const envPath = path.join(previewServerRoot, '.env.local');
22
+
23
+ await fs.writeFile(
24
+ envPath,
25
+ `TEMPLATES_DIR_RELATIVE_PATH=./templates
26
+ TEMPLATES_DIR_ABSOLUTE_PATH=${templatesDirectoryPath}
27
+ USER_PROJECT_LOCATION=${previewServerRoot}
28
+ PREVIEW_SERVER_LOCATION=${previewServerRoot}
29
+ NEXT_PUBLIC_IS_PREVIEW_DEVELOPMENT=true`,
30
+ 'utf8',
31
+ );
32
+
33
+ const webServerProcess = child_process.spawn('pnpm next dev', {
34
+ cwd: previewServerRoot,
35
+ shell: true,
36
+ stdio: 'inherit',
37
+ });
38
+
39
+ webServerProcess.on('exit', () => {
40
+ void fs.rm(envPath);
41
+ });
42
+
43
+ process.on('SIGINT', () => {
44
+ webServerProcess.kill('SIGINT');
45
+ });
46
+ process.on('SIGUSR1', () => {
47
+ webServerProcess.kill('SIGUSR1');
48
+ });
49
+ process.on('SIGUSR2', () => {
50
+ webServerProcess.kill('SIGUSR2');
51
+ });
52
+ process.on('uncaughtExceptionMonitor', () => {
53
+ webServerProcess.kill();
54
+ });
55
+ process.on('exit', () => {
56
+ webServerProcess.kill();
57
+ });
@@ -0,0 +1,36 @@
1
+ import { existsSync, promises as fs } from 'node:fs';
2
+ import path from 'node:path';
3
+ import url from 'node:url';
4
+
5
+ const filename = url.fileURLToPath(import.meta.url);
6
+ const dirname = path.dirname(filename);
7
+
8
+ const previewServerRoot = path.resolve(dirname, '..');
9
+ const templatesDirectoryPath = path.join(previewServerRoot, 'templates');
10
+
11
+ const seedPath = path.join(dirname, './utils/default-seed/');
12
+
13
+ if (existsSync(templatesDirectoryPath)) {
14
+ console.info(
15
+ 'Deleting all files inside the templates directory (except for .gitkeep)',
16
+ );
17
+ const files = await fs.readdir(templatesDirectoryPath);
18
+ for (const file of files) {
19
+ if (file === '.gitkeep') {
20
+ continue;
21
+ }
22
+ await fs.rm(file, { recursive: true, force: true });
23
+ }
24
+ }
25
+
26
+ // Templates seed templates will be created later
27
+ if (existsSync(seedPath)) {
28
+ console.info('Copying over the default seed to the templates directory');
29
+ await fs.cp(seedPath, templatesDirectoryPath, {
30
+ recursive: true,
31
+ });
32
+ } else {
33
+ console.info(
34
+ 'No seed templates found. Templates seed templates will be created later.',
35
+ );
36
+ }
@@ -0,0 +1,74 @@
1
+ 'use server';
2
+
3
+ import { PlaywrightPdfService } from '@ahmedrowaihi/pdf-forge-printer';
4
+ import { z } from 'zod';
5
+ import { baseActionClient } from './safe-action';
6
+
7
+ const pdfService = new PlaywrightPdfService();
8
+
9
+ /**
10
+ * Export a single template as a PDF or HTML file.
11
+ * Uses Playwright directly for PDF/screenshot generation.
12
+ */
13
+ export const exportSingleTemplate = baseActionClient
14
+ .metadata({
15
+ actionName: 'exportSingleTemplate',
16
+ })
17
+ .inputSchema(
18
+ z.object({
19
+ name: z.string(),
20
+ html: z.string(),
21
+ format: z.enum(['html', 'pdf', 'screenshot']).default('html'),
22
+ darkMode: z.boolean().optional(),
23
+ }),
24
+ )
25
+ .action(async ({ parsedInput }) => {
26
+ if (parsedInput.format === 'html') {
27
+ // Return HTML content for client-side download
28
+ return Promise.resolve({
29
+ name: parsedInput.name,
30
+ html: parsedInput.html,
31
+ format: 'html' as const,
32
+ status: 'succeeded' as const,
33
+ });
34
+ }
35
+
36
+ // Use Playwright service directly for PDF or screenshot generation
37
+ try {
38
+ let buffer: Uint8Array;
39
+ let mimeType: string;
40
+
41
+ if (parsedInput.format === 'pdf') {
42
+ buffer = await pdfService.render({
43
+ html: parsedInput.html,
44
+ outputType: 'pdf',
45
+ darkMode: parsedInput.darkMode,
46
+ });
47
+ mimeType = 'application/pdf';
48
+ } else {
49
+ // screenshot
50
+ buffer = await pdfService.render({
51
+ html: parsedInput.html,
52
+ outputType: 'screenshot',
53
+ darkMode: parsedInput.darkMode,
54
+ });
55
+ mimeType = 'image/png';
56
+ }
57
+
58
+ // Convert Uint8Array to base64 for transmission
59
+ const base64 = Buffer.from(buffer).toString('base64');
60
+
61
+ return {
62
+ name: parsedInput.name,
63
+ data: base64,
64
+ format: parsedInput.format,
65
+ mimeType,
66
+ status: 'succeeded' as const,
67
+ };
68
+ } catch (error) {
69
+ console.error('PDF generation error:', error);
70
+ throw new Error(
71
+ `Failed to generate ${parsedInput.format}. ${error instanceof Error ? error.message : 'Unknown error'}`,
72
+ );
73
+ }
74
+ });