create-fullstack-scaffold 0.4.3 → 0.4.5

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 (147) hide show
  1. package/dist/cli/index.js +5 -0
  2. package/dist/cli/index.js.map +1 -1
  3. package/package.json +1 -1
  4. package/template/dist/cli/index.js +237 -94
  5. package/template/dist/cli/index.js.map +1 -1
  6. package/template/dist/client/admin.html +15 -10
  7. package/template/dist/client/assets/App-BpFUIC-5.js +114 -0
  8. package/template/dist/client/assets/{CartPage-DESSHkaG.js → CartPage-DgDZP-R5.js} +2 -2
  9. package/template/dist/client/assets/{CategoriesPage-DqLZ_Mom.js → CategoriesPage-fuYNiSmE.js} +2 -2
  10. package/template/dist/client/assets/ContentDetailPage-BvvFU1Mr.js +1 -0
  11. package/template/dist/client/assets/ContentListPage-ShPxo6WG.js +1 -0
  12. package/template/dist/client/assets/DashboardPage-C1rZzZo4.js +11 -0
  13. package/template/dist/client/assets/{DeveloperDashboardPage-Cum7zFwO.js → DeveloperDashboardPage-_WtmbVoA.js} +2 -2
  14. package/template/dist/client/assets/{EmptyState-BK7ttK8D.js → EmptyState-DEyOQjbY.js} +1 -1
  15. package/template/dist/client/assets/LoadingSpinner-BcHjaM1m.js +6 -0
  16. package/template/dist/client/assets/LoginPage-CjeQqDdO.js +1 -0
  17. package/template/dist/client/assets/LogoutOutlined-ColFAHdd.js +1 -0
  18. package/template/dist/client/assets/NotificationPage-DRkEv02s.js +1 -0
  19. package/template/dist/client/assets/OrdersPage-7I3vPWLP.js +11 -0
  20. package/template/dist/client/assets/{PluginDetailPage-Br24YS4P.js → PluginDetailPage-CWyxdVCg.js} +3 -13
  21. package/template/dist/client/assets/PluginsPage-DRgWLeJT.js +6 -0
  22. package/template/dist/client/assets/ProfilePage-2FFkaii8.js +16 -0
  23. package/template/dist/client/assets/PublishPage-DW7yvROx.js +1 -0
  24. package/template/dist/client/assets/{RegisterPage-rPFG4Sry.js → RegisterPage-Dvaf9b0e.js} +2 -2
  25. package/template/dist/client/assets/SaveOutlined-CLQ2tsSY.js +2 -0
  26. package/template/dist/client/assets/{SearchPage-DQl1U5Uy.js → SearchPage-DvnEyswS.js} +2 -2
  27. package/template/dist/client/assets/{SettingsPage-DaYE80wj.js → SettingsPage-IrU-L9Zr.js} +2 -2
  28. package/template/dist/client/assets/{StatusBadge-BJ3W2Zc7.js → StatusBadge-CG7wVqpu.js} +1 -1
  29. package/template/dist/client/assets/{TodoPage-zC5wWNBa.js → TodoPage-B7D-bl65.js} +3 -3
  30. package/template/dist/client/assets/TopicsPage-CYCNr-mn.js +6 -0
  31. package/template/dist/client/assets/{WebSocketPage-B4NLdz1w.js → WebSocketPage-CGEg6QJE.js} +2 -2
  32. package/template/dist/client/assets/{activity-B94BUAsD.js → activity-CgTz9Mrd.js} +1 -1
  33. package/template/dist/client/assets/admin-D2iHWNOg.js +1 -0
  34. package/template/dist/client/assets/api-request-DIJocPxr.js +356 -0
  35. package/template/dist/client/assets/{arrow-left-H5JH0iU1.js → arrow-left-DtLQ3tTk.js} +1 -1
  36. package/template/dist/client/assets/{chevron-down-DwRh_wjD.js → chevron-down-CpIAV_yr.js} +1 -1
  37. package/template/dist/client/assets/{chevron-right-CpIWaqAL.js → chevron-right-CnU7oPQs.js} +1 -1
  38. package/template/dist/client/assets/{circle-check-big-CSElLscG.js → circle-check-big-CrZdwS75.js} +1 -1
  39. package/template/dist/client/assets/{circle-x-CYxr4RAw.js → circle-x-CvN9r3fW.js} +1 -1
  40. package/template/dist/client/assets/{clock-BseUJ7ex.js → clock-CTeSZBiH.js} +1 -1
  41. package/template/dist/client/assets/{download-BsGC_Xhq.js → download-OSVfVuNV.js} +1 -1
  42. package/template/dist/client/assets/{external-link-UTDzdjq8.js → external-link-fBsuHMby.js} +1 -1
  43. package/template/dist/client/assets/{eye-nR10ui7i.js → eye-CwlZZEsj.js} +1 -1
  44. package/template/dist/client/assets/index-09IqiOaE.css +1 -0
  45. package/template/dist/client/assets/index-B3CRby6r.js +51 -0
  46. package/template/dist/client/assets/index-CC_zy73y.js +17 -0
  47. package/template/dist/client/assets/main-Cn4IDo2I.js +92 -0
  48. package/template/dist/client/assets/merchant-DDDN9bMu.js +40 -0
  49. package/template/dist/client/assets/{message-square-CwWGL-Bh.js → message-square-BRaZfgbJ.js} +1 -1
  50. package/template/dist/client/assets/pluginStore-DDsWJPe6.js +1 -0
  51. package/template/dist/client/assets/{plus-pZld_nUL.js → plus-DDZfPiDJ.js} +1 -1
  52. package/template/dist/client/assets/sse-client-DGQ072hl.js +64 -0
  53. package/template/dist/client/assets/star-C7tO6w4H.js +11 -0
  54. package/template/dist/client/assets/{tag-DsiUPF90.js → tag-DBfpQDuJ.js} +1 -1
  55. package/template/dist/client/assets/tenant-CizbLaLJ.js +1 -0
  56. package/template/dist/client/assets/{trash-2-DRblNbnA.js → trash-2-BP7fkd5b.js} +1 -1
  57. package/template/dist/client/assets/{triangle-alert-D1CLh-Vd.js → triangle-alert-CrOQEdJ2.js} +1 -1
  58. package/template/dist/client/assets/{wifi-BwXjnCqI.js → wifi-CwYSE0J4.js} +1 -1
  59. package/template/dist/client/assets/{x-BH2rJdFq.js → x-t615pnNR.js} +1 -1
  60. package/template/dist/client/content/index.html +5 -4
  61. package/template/dist/client/index.html +4 -3
  62. package/template/dist/client/merchant.html +18 -0
  63. package/template/dist/client/notifications/index.html +6 -5
  64. package/template/dist/client/tenant.html +18 -0
  65. package/template/dist/client/todos/index.html +6 -5
  66. package/template/dist/client/websocket/index.html +6 -5
  67. package/template/dist/cloudflare/chunk-HX7DVRDX.js +1 -0
  68. package/template/dist/cloudflare/{chunk-QBHAPWIA.js → chunk-IXJL2LE4.js} +1 -1
  69. package/template/dist/cloudflare/chunk-Q34AN3RF.js +14 -0
  70. package/template/dist/cloudflare/{chunk-BHPTQ4K2.js → chunk-ZAMVL4EG.js} +2 -2
  71. package/template/dist/cloudflare/cloudflare.js +35 -29
  72. package/template/dist/cloudflare/db-4AQOSFAX.js +1 -0
  73. package/template/dist/cloudflare/{migrator-2ZYYKNI5.js → migrator-TEPBVUFO.js} +1 -1
  74. package/template/dist/cloudflare/permission-service-impl-RE7NPW3Q.js +1 -0
  75. package/template/dist/cloudflare/schema-DVEMT3X2.js +1 -0
  76. package/template/dist/cloudflare/test-setup-Z2RYE5B4.js +265 -0
  77. package/template/dist/server/chunk-27SIJSPF.js +1 -0
  78. package/template/dist/server/chunk-37QNGBQU.js +1 -0
  79. package/template/dist/server/chunk-FIY4CGJJ.js +1 -0
  80. package/template/dist/server/chunk-HZUDBIT4.js +1 -0
  81. package/template/dist/server/chunk-I6OBDFDU.js +1 -0
  82. package/template/dist/server/chunk-JHNYLNG7.js +1 -0
  83. package/template/dist/server/chunk-MDOVVKKD.js +1 -0
  84. package/template/dist/server/chunk-NSOCT7E5.js +1 -0
  85. package/template/dist/server/chunk-OU5IGVVO.js +1 -0
  86. package/template/dist/server/chunk-OYCBNRMK.js +1 -0
  87. package/template/dist/server/chunk-P2RJNNGD.js +1 -0
  88. package/template/dist/server/chunk-UMAQLNPE.js +1 -0
  89. package/template/dist/server/chunk-XZZTSRSN.js +1 -0
  90. package/template/dist/server/content-service-5QVHDR5X.js +1 -0
  91. package/template/dist/server/db-FLI5L5DD.js +1 -0
  92. package/template/dist/server/dispute-service-E2FCYUEM.js +1 -0
  93. package/template/dist/server/init-72JXJV3I.js +46 -0
  94. package/template/dist/server/init-FWYXSKPX.js +46 -0
  95. package/template/dist/server/node.js +34 -28
  96. package/template/dist/server/order-service-TKGG5S5K.js +1 -0
  97. package/template/dist/server/permission-service-impl-M3AKEYNY.js +1 -0
  98. package/template/dist/server/schema-V4UG7HMU.js +1 -0
  99. package/template/dist/server/tenant-service-JG6UUWXQ.js +1 -0
  100. package/template/dist/server/tenant-service-XJWZSEDX.js +1 -0
  101. package/template/dist/{cloudflare/test-setup-NMZJZLRV.js → server/test-setup-VFOPBGYM.js} +83 -2
  102. package/template/dist/server/ticket-service-3RSW7V2Z.js +1 -0
  103. package/template/dist/server/todo-service-S6BGIO7D.js +1 -0
  104. package/template/src/merchant/pages/DisputesPage.tsx +11 -11
  105. package/template/src/merchant/pages/OrdersPage.tsx +4 -3
  106. package/template/src/merchant/pages/ProductsPage.tsx +2 -2
  107. package/template/src/merchant/stores/merchantStore.ts +11 -6
  108. package/template/src/server/db/init.ts +5 -642
  109. package/template/src/server/module-plugin/services/plugin-seed-service.ts +623 -0
  110. package/template/src/server/module-tenant/routes/tenant-routes.ts +2 -2
  111. package/template/src/server/module-tenant/services/tenant-service.ts +63 -17
  112. package/template/src/shared/modules/merchant/index.ts +9 -0
  113. package/template/src/shared/modules/merchant/schemas.ts +37 -0
  114. package/template/src/shared/modules/tenant/index.ts +2 -0
  115. package/template/src/shared/schemas/index.ts +27 -0
  116. package/template/src/tenant/layouts/Header.tsx +1 -1
  117. package/template/src/tenant/layouts/Sidebar.tsx +1 -1
  118. package/template/src/tenant/pages/SettingsPage.tsx +4 -8
  119. package/template/src/tenant/stores/tenantStore.ts +41 -302
  120. package/template/tsconfig.json +1 -0
  121. package/template/tsup.config.ts +11 -3
  122. package/template/dist/client/assets/ContentDetailPage-DdltMANL.js +0 -1
  123. package/template/dist/client/assets/ContentListPage-B63sUB6N.js +0 -1
  124. package/template/dist/client/assets/DashboardPage-tUMilc7Z.js +0 -11
  125. package/template/dist/client/assets/LoadingSpinner-DVYOLSRM.js +0 -6
  126. package/template/dist/client/assets/LoginPage-g9mSLIMC.js +0 -6
  127. package/template/dist/client/assets/NotificationPage-COTzp-HD.js +0 -1
  128. package/template/dist/client/assets/OrdersPage-BsPh4oEI.js +0 -11
  129. package/template/dist/client/assets/PluginsPage-BNtAe_yo.js +0 -6
  130. package/template/dist/client/assets/ProfilePage-dL_iSuZN.js +0 -16
  131. package/template/dist/client/assets/PublishPage-D96FnbLA.js +0 -1
  132. package/template/dist/client/assets/TopicsPage-DyLjZa4D.js +0 -6
  133. package/template/dist/client/assets/admin-Bh1vfz_L.js +0 -486
  134. package/template/dist/client/assets/index-1bA-ixFv.js +0 -114
  135. package/template/dist/client/assets/index-CWh3vXC_.css +0 -1
  136. package/template/dist/client/assets/main-DHnArIp_.js +0 -82
  137. package/template/dist/client/assets/pluginStore-XQfsm3iR.js +0 -1
  138. package/template/dist/client/content/content-1/index.html +0 -18
  139. package/template/dist/client/content/content-13/index.html +0 -18
  140. package/template/dist/client/content/content-14/index.html +0 -18
  141. package/template/dist/client/content/content-15/index.html +0 -18
  142. package/template/dist/client/content/content-19/index.html +0 -18
  143. package/template/dist/client/content/content-2/index.html +0 -18
  144. package/template/dist/client/content/content-20/index.html +0 -18
  145. package/template/dist/cloudflare/chunk-YY6FRMAQ.js +0 -14
  146. package/template/dist/cloudflare/db-7J42RQ3T.js +0 -1
  147. package/template/dist/cloudflare/permission-service-impl-TGXVSSSA.js +0 -1
@@ -1 +0,0 @@
1
- import{n as S,r as l,j as e}from"./index-1bA-ixFv.js";import{H as U,R as D}from"./main-DHnArIp_.js";import{u as n}from"./pluginStore-XQfsm3iR.js";import{L as R}from"./LoadingSpinner-DVYOLSRM.js";import{P as b}from"./plus-pZld_nUL.js";import{X as f,U as L}from"./x-BH2rJdFq.js";const q=()=>{const d=n(t=>t.loading),c=n(t=>t.error),v=n(t=>t.createPlugin),y=n(t=>t.clearError),j=S(),[a,r]=l.useState({name:"",slug:"",description:"",repositoryUrl:void 0,homepageUrl:void 0,npmPackage:void 0,license:void 0,tags:[],commands:[]}),[o,m]=l.useState(""),[i,x]=l.useState(""),[g,u]=l.useState(""),p=()=>{o.trim()&&!(a.tags||[]).includes(o.trim())&&(r(t=>({...t,tags:[...t.tags||[],o.trim()]})),m(""))},N=t=>{r(s=>({...s,tags:(s.tags||[]).filter(h=>h!==t)}))},w=()=>{i.trim()&&(r(t=>({...t,commands:[...t.commands||[],{name:i.trim(),description:g.trim()||void 0}]})),x(""),u(""))},k=t=>{r(s=>({...s,commands:(s.commands||[]).filter((h,C)=>C!==t)}))},P=async t=>{t.preventDefault(),y();const s=await v(a);s&&j(`/plugins/${s}`)};return e.jsxs("div",{className:"min-h-screen","data-testid":"publish-page",children:[e.jsxs(U,{children:[e.jsx("title",{children:"Publish Plugin - Plugin Marketplace"}),e.jsx("meta",{name:"description",content:"Publish a new plugin to the marketplace"})]}),e.jsx("div",{className:"bg-gradient-to-br from-slate-900 via-purple-900 to-slate-900 pt-12 pb-20 px-6",children:e.jsxs("div",{className:"max-w-2xl mx-auto",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx("div",{className:"p-2.5 bg-gradient-to-br from-violet-500 to-fuchsia-500 rounded-xl shadow-lg shadow-violet-500/25",children:e.jsx(D,{className:"w-6 h-6 text-white"})}),e.jsx("h1",{className:"text-3xl font-bold text-white tracking-tight",children:"Publish Plugin"})]}),e.jsx("p",{className:"text-purple-200/70 text-lg",children:"Share your creation with the community"})]})}),e.jsxs("div",{className:"max-w-2xl mx-auto px-6 -mt-8 pb-16",children:[c&&e.jsx("div",{className:"mb-6 p-4 bg-red-500/10 border border-red-500/20 text-red-600 rounded-2xl",children:c}),e.jsxs("form",{onSubmit:P,className:"space-y-5",children:[e.jsxs("div",{className:"bg-white rounded-2xl shadow-xl shadow-black/5 border border-gray-100 p-7 space-y-5",children:[e.jsxs("h2",{className:"text-lg font-semibold text-gray-900 flex items-center gap-2",children:[e.jsx("div",{className:"w-1.5 h-6 bg-gradient-to-b from-violet-500 to-fuchsia-500 rounded-full"}),"Basic Information"]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-semibold text-gray-700 mb-1.5",children:["Plugin Name ",e.jsx("span",{className:"text-red-400",children:"*"})]}),e.jsx("input",{type:"text",value:a.name,onChange:t=>r(s=>({...s,name:t.target.value})),placeholder:"My Awesome Plugin",required:!0,className:"w-full px-4 py-3 bg-gray-50 border border-gray-200 rounded-xl focus:ring-2 focus:ring-violet-500 focus:border-transparent outline-none text-sm transition-all"})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-semibold text-gray-700 mb-1.5",children:["Slug ",e.jsx("span",{className:"text-red-400",children:"*"})]}),e.jsx("input",{type:"text",value:a.slug,onChange:t=>r(s=>({...s,slug:t.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"-")})),placeholder:"my-awesome-plugin",required:!0,pattern:"^[a-z0-9-]+$",className:"w-full px-4 py-3 bg-gray-50 border border-gray-200 rounded-xl focus:ring-2 focus:ring-violet-500 focus:border-transparent outline-none text-sm font-mono transition-all"}),e.jsx("p",{className:"text-xs text-gray-400 mt-1.5",children:"Lowercase letters, numbers, and hyphens only"})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-semibold text-gray-700 mb-1.5",children:["Description ",e.jsx("span",{className:"text-red-400",children:"*"})]}),e.jsx("textarea",{value:a.description,onChange:t=>r(s=>({...s,description:t.target.value})),placeholder:"Describe what your plugin does...",required:!0,rows:4,className:"w-full px-4 py-3 bg-gray-50 border border-gray-200 rounded-xl focus:ring-2 focus:ring-violet-500 focus:border-transparent outline-none text-sm resize-none transition-all"})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-semibold text-gray-700 mb-1.5",children:"Repository URL"}),e.jsx("input",{type:"url",value:a.repositoryUrl||"",onChange:t=>r(s=>({...s,repositoryUrl:t.target.value||void 0})),placeholder:"https://github.com/...",className:"w-full px-4 py-3 bg-gray-50 border border-gray-200 rounded-xl focus:ring-2 focus:ring-violet-500 focus:border-transparent outline-none text-sm transition-all"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-semibold text-gray-700 mb-1.5",children:"Homepage URL"}),e.jsx("input",{type:"url",value:a.homepageUrl||"",onChange:t=>r(s=>({...s,homepageUrl:t.target.value||void 0})),placeholder:"https://...",className:"w-full px-4 py-3 bg-gray-50 border border-gray-200 rounded-xl focus:ring-2 focus:ring-violet-500 focus:border-transparent outline-none text-sm transition-all"})]})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-semibold text-gray-700 mb-1.5",children:"NPM Package"}),e.jsx("input",{type:"text",value:a.npmPackage||"",onChange:t=>r(s=>({...s,npmPackage:t.target.value||void 0})),placeholder:"@scope/package-name",className:"w-full px-4 py-3 bg-gray-50 border border-gray-200 rounded-xl focus:ring-2 focus:ring-violet-500 focus:border-transparent outline-none text-sm transition-all"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-semibold text-gray-700 mb-1.5",children:"License"}),e.jsx("input",{type:"text",value:a.license||"",onChange:t=>r(s=>({...s,license:t.target.value||void 0})),placeholder:"MIT",className:"w-full px-4 py-3 bg-gray-50 border border-gray-200 rounded-xl focus:ring-2 focus:ring-violet-500 focus:border-transparent outline-none text-sm transition-all"})]})]})]}),e.jsxs("div",{className:"bg-white rounded-2xl shadow-xl shadow-black/5 border border-gray-100 p-7 space-y-4",children:[e.jsxs("h2",{className:"text-lg font-semibold text-gray-900 flex items-center gap-2",children:[e.jsx("div",{className:"w-1.5 h-6 bg-gradient-to-b from-violet-500 to-fuchsia-500 rounded-full"}),"Tags"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"text",value:o,onChange:t=>m(t.target.value),onKeyDown:t=>t.key==="Enter"&&(t.preventDefault(),p()),placeholder:"Add a tag...",className:"flex-1 px-4 py-2.5 bg-gray-50 border border-gray-200 rounded-xl focus:ring-2 focus:ring-violet-500 focus:border-transparent outline-none text-sm transition-all"}),e.jsx("button",{type:"button",onClick:p,className:"p-2.5 bg-gradient-to-r from-violet-500 to-fuchsia-500 text-white rounded-xl hover:from-violet-400 hover:to-fuchsia-400 transition-all shadow-sm",children:e.jsx(b,{className:"w-5 h-5"})})]}),a.tags&&a.tags.length>0&&e.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:a.tags.map(t=>e.jsxs("span",{className:"inline-flex items-center gap-1.5 px-3 py-1.5 bg-gradient-to-r from-violet-50 to-fuchsia-50 text-violet-700 rounded-lg text-sm font-medium",children:[t,e.jsx("button",{type:"button",onClick:()=>N(t),className:"hover:text-red-500 transition-colors",children:e.jsx(f,{className:"w-3.5 h-3.5"})})]},t))})]}),e.jsxs("div",{className:"bg-white rounded-2xl shadow-xl shadow-black/5 border border-gray-100 p-7 space-y-4",children:[e.jsxs("h2",{className:"text-lg font-semibold text-gray-900 flex items-center gap-2",children:[e.jsx("div",{className:"w-1.5 h-6 bg-gradient-to-b from-violet-500 to-fuchsia-500 rounded-full"}),"Commands"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"text",value:i,onChange:t=>x(t.target.value),placeholder:"Command name",className:"flex-1 px-4 py-2.5 bg-gray-50 border border-gray-200 rounded-xl focus:ring-2 focus:ring-violet-500 focus:border-transparent outline-none text-sm transition-all"}),e.jsx("input",{type:"text",value:g,onChange:t=>u(t.target.value),placeholder:"Description (optional)",className:"flex-1 px-4 py-2.5 bg-gray-50 border border-gray-200 rounded-xl focus:ring-2 focus:ring-violet-500 focus:border-transparent outline-none text-sm transition-all"}),e.jsx("button",{type:"button",onClick:w,className:"p-2.5 bg-gradient-to-r from-violet-500 to-fuchsia-500 text-white rounded-xl hover:from-violet-400 hover:to-fuchsia-400 transition-all shadow-sm",children:e.jsx(b,{className:"w-5 h-5"})})]}),a.commands&&a.commands.length>0&&e.jsx("div",{className:"space-y-2",children:a.commands.map((t,s)=>e.jsxs("div",{className:"flex items-center gap-3 p-3 bg-gray-50 rounded-xl border border-gray-100",children:[e.jsx("code",{className:"text-sm font-mono text-violet-600 font-semibold bg-violet-50 px-2 py-0.5 rounded",children:t.name}),t.description&&e.jsx("span",{className:"text-sm text-gray-500",children:t.description}),e.jsx("button",{type:"button",onClick:()=>k(s),className:"ml-auto p-1 text-gray-400 hover:text-red-500 transition-colors",children:e.jsx(f,{className:"w-4 h-4"})})]},s))})]}),e.jsxs("button",{type:"submit",disabled:d||!a.name||!a.slug||!a.description,className:"w-full py-4 bg-gradient-to-r from-violet-500 to-fuchsia-500 text-white rounded-2xl hover:from-violet-400 hover:to-fuchsia-400 disabled:from-gray-300 disabled:to-gray-300 disabled:cursor-not-allowed transition-all font-semibold text-base flex items-center justify-center gap-2 shadow-lg shadow-violet-500/20",children:[d?e.jsx(R,{size:"sm",color:"text-white"}):e.jsx(L,{className:"w-5 h-5"}),"Publish Plugin"]})]})]})]})};export{q as PublishPage};
@@ -1,6 +0,0 @@
1
- import{c as j,r as a,j as e,N as v}from"./index-1bA-ixFv.js";import{H as w,c as y,b as d}from"./main-DHnArIp_.js";import{L as N}from"./LoadingSpinner-DVYOLSRM.js";import{P as b}from"./plus-pZld_nUL.js";import{M as x}from"./message-square-CwWGL-Bh.js";import{C}from"./chevron-down-DwRh_wjD.js";import{E as S}from"./eye-nR10ui7i.js";/**
2
- * @license lucide-react v0.576.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const L=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],k=j("chevron-up",L),E=[{value:"all",label:"All"},{value:"hot",label:"Hot"},{value:"unanswered",label:"Unanswered"},{value:"solved",label:"Solved"}],P=()=>{const[l,m]=a.useState(""),[r,h]=a.useState("all"),[n,p]=a.useState([]),[u,g]=a.useState(!0);a.useEffect(()=>{async function s(){try{const c=await(await(r==="hot"?d.api.topics.popular:d.api.topics).$get()).json();c.success&&p(c.data.topics)}finally{g(!1)}}s()},[r]);const i=a.useMemo(()=>{if(!l.trim())return n;const s=l.toLowerCase();return n.filter(t=>t.title.toLowerCase().includes(s)||t.excerpt.toLowerCase().includes(s)||t.tags.some(o=>o.label.toLowerCase().includes(s)))},[l,n]),f=s=>s>0?"text-emerald-600":s<0?"text-red-500":"text-gray-400";return e.jsxs("div",{className:"min-h-screen bg-white","data-testid":"topics-page",children:[e.jsxs(w,{children:[e.jsx("title",{children:"Community Forum"}),e.jsx("meta",{name:"description",content:"Browse and discuss community topics"})]}),e.jsx("div",{className:"bg-gradient-to-b from-emerald-50 to-white pt-12 pb-10 px-4 sm:px-6",children:e.jsx("div",{className:"max-w-4xl mx-auto",children:e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-bold text-gray-900 tracking-tight",children:"Community Forum"}),e.jsx("p",{className:"mt-1 text-gray-500",children:"Ask questions, share knowledge, connect with others"})]}),e.jsxs("button",{className:"inline-flex items-center gap-2 px-5 py-2.5 bg-emerald-500 hover:bg-emerald-600 text-white font-medium rounded-xl shadow-sm shadow-emerald-500/25 transition-colors self-start sm:self-auto",children:[e.jsx(b,{className:"w-4 h-4"}),"Ask Question"]})]})})}),e.jsxs("div",{className:"max-w-4xl mx-auto px-4 sm:px-6 -mt-4 pb-16",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 mb-6",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(y,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),e.jsx("input",{type:"text",value:l,onChange:s=>m(s.target.value),placeholder:"Search topics...",className:"w-full pl-10 pr-4 py-2.5 bg-white border border-gray-200 rounded-xl focus:ring-2 focus:ring-emerald-500 focus:border-transparent outline-none transition-shadow text-sm"})]}),e.jsx("div",{className:"flex gap-2 flex-wrap",children:E.map(s=>e.jsx("button",{onClick:()=>h(s.value),className:`px-4 py-2 rounded-xl text-sm font-medium transition-colors ${r===s.value?"bg-emerald-500 text-white shadow-sm shadow-emerald-500/25":"bg-gray-100 text-gray-600 hover:bg-gray-200"}`,children:s.label},s.value))})]}),u?e.jsx("div",{className:"flex items-center justify-center py-20","data-testid":"topics-loading",children:e.jsx(N,{size:"lg"})}):i.length===0?e.jsxs("div",{className:"text-center py-20",children:[e.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 bg-gray-100 rounded-full mb-4",children:e.jsx(x,{className:"w-7 h-7 text-gray-400"})}),e.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-1",children:"No topics found"}),e.jsx("p",{className:"text-gray-500 text-sm",children:"Try adjusting your search or filter"})]}):e.jsx("div",{className:"space-y-3",children:i.map(s=>e.jsxs(v,{to:`/topics/${s.id}`,className:"flex gap-4 p-4 bg-white rounded-2xl border border-gray-100 hover:border-emerald-200 hover:shadow-md hover:shadow-emerald-500/5 transition-all group",children:[e.jsxs("div",{className:"flex flex-col items-center gap-0.5 pt-0.5 min-w-[48px]",children:[e.jsx(k,{className:"w-4 h-4 text-gray-400 hover:text-emerald-500 cursor-pointer"}),e.jsx("span",{className:`text-sm font-bold ${f(s.votes)}`,children:s.votes}),e.jsx(C,{className:"w-4 h-4 text-gray-400 hover:text-red-400 cursor-pointer"})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h3",{className:"font-semibold text-gray-900 group-hover:underline decoration-emerald-400 underline-offset-2 leading-snug",children:s.title}),e.jsx("p",{className:"mt-1 text-sm text-gray-500 line-clamp-2 leading-relaxed",children:s.excerpt}),e.jsxs("div",{className:"mt-2.5 flex flex-wrap items-center gap-2",children:[s.tags.map(t=>e.jsx("span",{className:`px-2.5 py-0.5 rounded-lg text-xs font-medium ${t.color}`,children:t.label},t.label)),e.jsx("span",{className:"text-xs text-gray-400 mx-1",children:"·"}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("div",{className:"w-5 h-5 rounded-full bg-emerald-100 text-emerald-700 text-[10px] font-bold flex items-center justify-center",children:s.author.initials}),e.jsx("span",{className:"text-xs text-gray-600",children:s.author.name}),e.jsx("span",{className:"text-xs text-gray-400",children:s.createdAt})]})]})]}),e.jsxs("div",{className:"hidden sm:flex flex-col items-end justify-center gap-1 text-xs text-gray-400 min-w-[80px]",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(x,{className:"w-3.5 h-3.5"}),e.jsx("span",{children:s.replyCount})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(S,{className:"w-3.5 h-3.5"}),e.jsx("span",{children:s.viewCount})]})]})]},s.id))})]})]})};export{P as TopicsPage};