@repdf/preview 0.0.21 → 0.0.22

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 (35) hide show
  1. package/dist/index.js +67 -30
  2. package/dist/preview/.next/BUILD_ID +1 -1
  3. package/dist/preview/.next/build-manifest.json +4 -4
  4. package/dist/preview/.next/cache/.tsbuildinfo +1 -1
  5. package/dist/preview/.next/cache/webpack/client-production/0.pack +0 -0
  6. package/dist/preview/.next/cache/webpack/client-production/index.pack +0 -0
  7. package/dist/preview/.next/cache/webpack/edge-server-production/index.pack +0 -0
  8. package/dist/preview/.next/cache/webpack/server-production/0.pack +0 -0
  9. package/dist/preview/.next/cache/webpack/server-production/index.pack +0 -0
  10. package/dist/preview/.next/next-minimal-server.js.nft.json +1 -1
  11. package/dist/preview/.next/next-server.js.nft.json +1 -1
  12. package/dist/preview/.next/prerender-manifest.json +1 -1
  13. package/dist/preview/.next/routes-manifest.json +1 -1
  14. package/dist/preview/.next/server/middleware-build-manifest.js +1 -1
  15. package/dist/preview/.next/server/pages/_app.js +1 -1
  16. package/dist/preview/.next/server/pages/_app.js.nft.json +1 -1
  17. package/dist/preview/.next/server/pages/_error.js +1 -1
  18. package/dist/preview/.next/server/pages/_error.js.nft.json +1 -1
  19. package/dist/preview/.next/server/pages/api/component.js +1 -1
  20. package/dist/preview/.next/server/pages/api/component.js.nft.json +1 -1
  21. package/dist/preview/.next/server/pages/api/pdf.js.nft.json +1 -1
  22. package/dist/preview/.next/server/pages/api/trpc/[trpc].js.nft.json +1 -1
  23. package/dist/preview/.next/server/pages/en/404.html +1 -1
  24. package/dist/preview/.next/server/pages/en/500.html +1 -1
  25. package/dist/preview/.next/server/pages/index.js +1 -1
  26. package/dist/preview/.next/server/pages/index.js.nft.json +1 -1
  27. package/dist/preview/.next/server/pages/preview/[...relTemplatePath].js +1 -1
  28. package/dist/preview/.next/server/pages/preview/[...relTemplatePath].js.nft.json +1 -1
  29. package/dist/preview/.next/server/pages-manifest.json +1 -1
  30. package/dist/preview/.next/static/{fz9ql8-57k-jJMz9gYIxr → 10iFYJXApnVsAj_q-bgIS}/_buildManifest.js +1 -1
  31. package/dist/preview/.next/static/chunks/pages/{_app-2de82f9e83b4c360.js → _app-0f9241fc03d167e5.js} +3 -3
  32. package/dist/preview/.next/static/chunks/pages/preview/{[...relTemplatePath]-21a4afde50569413.js → [...relTemplatePath]-54953a42a234e88f.js} +1 -1
  33. package/dist/preview/.next/trace +14 -14
  34. package/package.json +5 -5
  35. /package/dist/preview/.next/static/{fz9ql8-57k-jJMz9gYIxr → 10iFYJXApnVsAj_q-bgIS}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[254],{3440:function(e,r,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/preview/[...relTemplatePath]",function(){return t(8713)}])},8713:function(e,r,t){"use strict";t.r(r),t.d(r,{__N_SSP:function(){return v},default:function(){return w}});var n=t(1549),l=t(7829),i=t(1578),s=t.n(i),a=t(433),o=t(4194),c=t(5562);function p(e){let{children:r}=e,{data:t,isLoading:l}=c.h.core.templateCheck.useQuery({relTemplatePath:"test.txt"});return(0,n.jsx)(n.Fragment,{children:r})}var u=t(7406);function d(e){let{relTemplatePath:r}=e,{data:t,isLoading:l}=c.h.core.fileContents.useQuery({relTemplatePath:r});return l?(0,n.jsx)("div",{children:"Loading..."}):t?(0,n.jsx)("div",{children:(0,n.jsx)(u.y$,{theme:u.np.shadesOfPurple,code:t,language:"tsx",children:e=>{let{className:r,style:t,tokens:l,getLineProps:i,getTokenProps:s}=e;return(0,n.jsx)("pre",{style:{...t,fontSize:"0.8rem",wordWrap:"break-word",whiteSpace:"pre-wrap",overflowWrap:"break-word",maxWidth:"100%"},children:l.map((e,r)=>(0,n.jsxs)("div",{...i({line:e}),style:{display:"flex"},children:[(0,n.jsx)("span",{style:{minWidth:"2em",userSelect:"none",opacity:.5},children:r+1}),(0,n.jsx)("span",{style:{flex:1,overflow:"hidden"},children:e.map((e,r)=>(0,n.jsx)("span",{...s({token:e}),style:{...s({token:e}).style,wordBreak:"break-all",whiteSpace:"pre-wrap"}},r))})]},r))})}})}):(0,n.jsx)("div",{children:"Error"})}function h(e){let{relTemplatePath:r,previewPropGroup:t}=e,{data:l}=c.h.core.generic.useQuery(void 0,{staleTime:1/0,initialData:new Date().toISOString()}),[i,s]=(0,o.useState)(!0),[a,p]=(0,o.useState)("/api/component?relativeTemplatePath=".concat(r,"&previewPropGroup=").concat(null!=t?t:""));return(0,o.useEffect)(()=>{l&&(s(!0),p("/api/component?relativeTemplatePath=".concat(r,"&refresh=").concat(l,"&previewPropGroup=").concat(null!=t?t:"")))},[l,r,t]),(0,n.jsxs)("div",{className:"relative h-full w-full",children:[i&&(0,n.jsx)("div",{className:"absolute inset-0 flex h-full w-full items-center justify-center bg-gray-100 bg-opacity-50",children:(0,n.jsx)("p",{children:"Rendering Component..."})}),a&&(0,n.jsx)("iframe",{src:a,className:"h-full w-full border-none",onLoad:()=>s(!1)})]})}function x(e){let{relTemplatePath:r}=e,{data:t,isLoading:l}=c.h.core.renderedHtml.useQuery({relTemplatePath:r});return l?(0,n.jsx)("div",{children:"Loading..."}):t?(0,n.jsx)("div",{children:(0,n.jsx)(u.y$,{theme:u.np.shadesOfPurple,code:t,language:"tsx",children:e=>{let{className:r,style:t,tokens:l,getLineProps:i,getTokenProps:s}=e;return(0,n.jsx)("pre",{style:{...t,fontSize:"0.8rem",wordWrap:"break-word",whiteSpace:"pre-wrap",overflowWrap:"break-word"},children:l.map((e,r)=>(0,n.jsxs)("div",{...i({line:e}),style:{display:"flex"},children:[(0,n.jsx)("span",{style:{minWidth:"2em",userSelect:"none",opacity:.5},children:r+1}),(0,n.jsx)("span",{children:e.map((e,r)=>(0,n.jsx)("span",{...s({token:e})},r))})]},r))})}})}):(0,n.jsx)("div",{children:"Error"})}function m(e){let{relTemplatePath:r,previewPropGroup:t}=e,{data:l}=c.h.core.generic.useQuery(void 0,{staleTime:1/0,initialData:new Date().toISOString()}),[i,s]=(0,o.useState)(!0),[a,p]=(0,o.useState)("/api/pdf?relativeTemplatePath=".concat(r,"&previewPropGroup=").concat(t));return(0,o.useEffect)(()=>{l&&(s(!0),p("/api/pdf?relativeTemplatePath=".concat(r,"&refresh=").concat(l,"&previewPropGroup=").concat(t)))},[l,r,t]),(0,n.jsxs)("div",{className:"relative h-full w-full",children:[i&&(0,n.jsx)("div",{className:"absolute inset-0 flex h-full w-full items-center justify-center bg-gray-100 bg-opacity-50",children:(0,n.jsx)("p",{children:"Rendering PDF..."})}),(0,n.jsx)("iframe",{src:a,width:"100%",height:"100%",title:"PDF Preview",onLoad:()=>s(!1)},l)]})}function f(e){let{relTemplatePath:r}=e,t=(0,a.useRouter)(),{data:l}=c.h.core.templateDetails.useQuery({relTemplatePath:r}),i=t.query.previewPropGroup?parseInt(t.query.previewPropGroup,10):void 0;return l&&0!==l.previewPropChoices.length?(0,n.jsx)(n.Fragment,{children:(0,n.jsx)("select",{className:"rounded-md border border-gray-300 p-2",onChange:e=>{let r=parseInt(e.target.value);t.push({query:{...t.query,previewPropGroup:r}})},value:i,children:l.previewPropChoices.map((e,r)=>(0,n.jsxs)("option",{value:r,children:["Prop Group ",r+1]},r))})}):null}var v=!0;function w(e){let{templateName:r,relTemplatePath:t}=e,i=(0,a.useRouter)(),c=i.query.view,u=e=>{i.push({query:{...i.query,view:e}})};return(0,o.useEffect)(()=>{c||i.push({query:{...i.query,view:"component"}})},[c]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(s(),{children:(0,n.jsx)("title",{children:"Preview PDF - rePDF"})}),(0,n.jsxs)("div",{className:"flex h-screen flex-col",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between bg-gray-200 p-4",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{children:r}),(0,n.jsx)("p",{className:"text-sm text-gray-500",children:r!==t?t:"​"})]}),(0,n.jsx)("div",{children:(0,n.jsx)(f,{relTemplatePath:t})}),(0,n.jsx)("div",{children:(0,n.jsxs)("ul",{className:"flex",children:[(0,n.jsx)("li",{className:(0,l.Z)("rounded-l bg-gray-300 p-2 text-sm hover:bg-gray-400 hover:text-white cursor-pointer","code"===c&&"bg-gray-400 text-white"),onClick:()=>u("code"),children:"Code"}),(0,n.jsx)("li",{className:(0,l.Z)(" bg-gray-300 p-2 text-sm hover:bg-gray-400 hover:text-white cursor-pointer","component"===c&&"bg-gray-400 text-white"),onClick:()=>u("component"),children:"Component"}),(0,n.jsx)("li",{className:(0,l.Z)(" bg-gray-300 p-2 text-sm hover:bg-gray-400 hover:text-white cursor-pointer","pdf"===c&&"bg-gray-400 text-white"),onClick:()=>u("pdf"),children:"PDF"}),(0,n.jsx)("li",{className:(0,l.Z)("rounded-r bg-gray-300 p-2 text-sm hover:bg-gray-400 hover:text-white cursor-pointer","html"===c&&"bg-gray-400 text-white"),onClick:()=>u("html"),children:"HTML"})]})})]}),(0,n.jsx)("div",{className:"flex-grow",children:(0,n.jsxs)(p,{children:["code"===c&&(0,n.jsx)(d,{relTemplatePath:t}),(null===c||"component"===c)&&(0,n.jsx)(h,{relTemplatePath:t,previewPropGroup:i.query.previewPropGroup}),"html"===c&&(0,n.jsx)(x,{relTemplatePath:t}),"pdf"===c&&(0,n.jsx)(m,{relTemplatePath:t,previewPropGroup:i.query.previewPropGroup})]})})]})]})}},433:function(e,r,t){e.exports=t(7835)}},function(e){e.O(0,[138,888,774,179],function(){return e(e.s=3440)}),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[254],{3440:function(e,r,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/preview/[...relTemplatePath]",function(){return t(8713)}])},8713:function(e,r,t){"use strict";t.r(r),t.d(r,{__N_SSP:function(){return v},default:function(){return w}});var n=t(1549),l=t(7829),i=t(1578),s=t.n(i),a=t(433),o=t(4194),c=t(5562);function p(e){let{children:r}=e,{data:t,isLoading:l}=c.h.core.templateCheck.useQuery({relTemplatePath:"test.txt"});return(0,n.jsx)(n.Fragment,{children:r})}var u=t(7406);function d(e){let{relTemplatePath:r}=e,{data:t,isLoading:l}=c.h.core.fileContents.useQuery({relTemplatePath:r});return l?(0,n.jsx)("div",{children:"Loading..."}):t?(0,n.jsx)("div",{children:(0,n.jsx)(u.y$,{theme:u.np.shadesOfPurple,code:t,language:"tsx",children:e=>{let{className:r,style:t,tokens:l,getLineProps:i,getTokenProps:s}=e;return(0,n.jsx)("pre",{style:{...t,fontSize:"0.8rem",wordWrap:"break-word",whiteSpace:"pre-wrap",overflowWrap:"break-word",maxWidth:"100%"},children:l.map((e,r)=>(0,n.jsxs)("div",{...i({line:e}),style:{display:"flex"},children:[(0,n.jsx)("span",{style:{minWidth:"2em",userSelect:"none",opacity:.5},children:r+1}),(0,n.jsx)("span",{style:{flex:1,overflow:"hidden"},children:e.map((e,r)=>(0,n.jsx)("span",{...s({token:e}),style:{...s({token:e}).style,wordBreak:"break-all",whiteSpace:"pre-wrap"}},r))})]},r))})}})}):(0,n.jsx)("div",{children:"Error"})}function h(e){let{relTemplatePath:r,previewPropGroup:t}=e,{data:l}=c.h.core.generic.useQuery(void 0,{staleTime:1/0,initialData:new Date().toISOString()}),[i,s]=(0,o.useState)(!0),[a,p]=(0,o.useState)("/api/component?relativeTemplatePath=".concat(r,"&previewPropGroup=").concat(null!=t?t:""));return(0,o.useEffect)(()=>{l&&(s(!0),p("/api/component?relativeTemplatePath=".concat(r,"&refresh=").concat(l,"&previewPropGroup=").concat(null!=t?t:"")))},[l,r,t]),(0,n.jsxs)("div",{className:"relative h-full w-full",children:[i&&(0,n.jsx)("div",{className:"absolute inset-0 flex h-full w-full items-center justify-center bg-gray-100 bg-opacity-50",children:(0,n.jsx)("p",{children:"Rendering Component..."})}),a&&(0,n.jsx)("iframe",{src:a,className:"h-full w-full border-none",onLoad:()=>s(!1)})]})}function x(e){let{relTemplatePath:r}=e,{data:t,isLoading:l}=c.h.core.renderedHtml.useQuery({relTemplatePath:r});return l?(0,n.jsx)("div",{children:"Loading..."}):t?(0,n.jsx)("div",{children:(0,n.jsx)(u.y$,{theme:u.np.shadesOfPurple,code:t,language:"tsx",children:e=>{let{className:r,style:t,tokens:l,getLineProps:i,getTokenProps:s}=e;return(0,n.jsx)("pre",{style:{...t,fontSize:"0.8rem",wordWrap:"break-word",whiteSpace:"pre-wrap",overflowWrap:"break-word"},children:l.map((e,r)=>(0,n.jsxs)("div",{...i({line:e}),style:{display:"flex"},children:[(0,n.jsx)("span",{style:{minWidth:"2em",userSelect:"none",opacity:.5},children:r+1}),(0,n.jsx)("span",{children:e.map((e,r)=>(0,n.jsx)("span",{...s({token:e})},r))})]},r))})}})}):(0,n.jsx)("div",{children:"Error"})}function m(e){let{relTemplatePath:r,previewPropGroup:t}=e,{data:l}=c.h.core.generic.useQuery(void 0,{staleTime:1/0,initialData:new Date().toISOString()}),[i,s]=(0,o.useState)(!0),[a,p]=(0,o.useState)("/api/pdf?relativeTemplatePath=".concat(r,"&previewPropGroup=").concat(null!=t?t:""));return(0,o.useEffect)(()=>{l&&(s(!0),p("/api/pdf?relativeTemplatePath=".concat(r,"&refresh=").concat(l,"&previewPropGroup=").concat(null!=t?t:"")))},[l,r,t]),(0,n.jsxs)("div",{className:"relative h-full w-full",children:[i&&(0,n.jsx)("div",{className:"absolute inset-0 flex h-full w-full items-center justify-center bg-gray-100 bg-opacity-50",children:(0,n.jsx)("p",{children:"Rendering PDF..."})}),(0,n.jsx)("iframe",{src:a,width:"100%",height:"100%",title:"PDF Preview",onLoad:()=>s(!1)},l)]})}function f(e){let{relTemplatePath:r}=e,t=(0,a.useRouter)(),{data:l}=c.h.core.templateDetails.useQuery({relTemplatePath:r}),i=t.query.previewPropGroup?parseInt(t.query.previewPropGroup,10):void 0;return l&&0!==l.previewPropChoices.length?(0,n.jsx)(n.Fragment,{children:(0,n.jsx)("select",{className:"rounded-md border border-gray-300 p-2",onChange:e=>{let r=parseInt(e.target.value);t.push({query:{...t.query,previewPropGroup:r}})},value:i,children:l.previewPropChoices.map((e,r)=>(0,n.jsxs)("option",{value:r,children:["Prop Group ",r+1]},r))})}):null}var v=!0;function w(e){let{templateName:r,relTemplatePath:t}=e,i=(0,a.useRouter)(),c=i.query.view,u=e=>{i.push({query:{...i.query,view:e}})};return(0,o.useEffect)(()=>{c||i.push({query:{...i.query,view:"component"}})},[c]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(s(),{children:(0,n.jsx)("title",{children:"Preview PDF - rePDF"})}),(0,n.jsxs)("div",{className:"flex h-screen flex-col",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between bg-gray-200 p-4",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{children:r}),(0,n.jsx)("p",{className:"text-sm text-gray-500",children:r!==t?t:"​"})]}),(0,n.jsx)("div",{children:(0,n.jsx)(f,{relTemplatePath:t})}),(0,n.jsx)("div",{children:(0,n.jsxs)("ul",{className:"flex",children:[(0,n.jsx)("li",{className:(0,l.Z)("rounded-l bg-gray-300 p-2 text-sm hover:bg-gray-400 hover:text-white cursor-pointer","code"===c&&"bg-gray-400 text-white"),onClick:()=>u("code"),children:"Code"}),(0,n.jsx)("li",{className:(0,l.Z)(" bg-gray-300 p-2 text-sm hover:bg-gray-400 hover:text-white cursor-pointer","component"===c&&"bg-gray-400 text-white"),onClick:()=>u("component"),children:"Component"}),(0,n.jsx)("li",{className:(0,l.Z)(" bg-gray-300 p-2 text-sm hover:bg-gray-400 hover:text-white cursor-pointer","pdf"===c&&"bg-gray-400 text-white"),onClick:()=>u("pdf"),children:"PDF"}),(0,n.jsx)("li",{className:(0,l.Z)("rounded-r bg-gray-300 p-2 text-sm hover:bg-gray-400 hover:text-white cursor-pointer","html"===c&&"bg-gray-400 text-white"),onClick:()=>u("html"),children:"HTML"})]})})]}),(0,n.jsx)("div",{className:"flex-grow",children:(0,n.jsxs)(p,{children:["code"===c&&(0,n.jsx)(d,{relTemplatePath:t}),(null===c||"component"===c)&&(0,n.jsx)(h,{relTemplatePath:t,previewPropGroup:i.query.previewPropGroup}),"html"===c&&(0,n.jsx)(x,{relTemplatePath:t}),"pdf"===c&&(0,n.jsx)(m,{relTemplatePath:t,previewPropGroup:i.query.previewPropGroup})]})})]})]})}},433:function(e,r,t){e.exports=t(7835)}},function(e){e.O(0,[138,888,774,179],function(){return e(e.s=3440)}),_N_E=e.O()}]);