@snagset/server 0.1.35 → 0.1.36
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.
- package/dist/app.js +5 -0
- package/dist/app.js.map +1 -1
- package/dist/routes/account.js +2 -1
- package/dist/routes/account.js.map +1 -1
- package/dist/routes/assignees.js +10 -0
- package/dist/routes/assignees.js.map +1 -1
- package/dist/routes/commentEdit.js +15 -3
- package/dist/routes/commentEdit.js.map +1 -1
- package/dist/routes/comments.js +6 -0
- package/dist/routes/comments.js.map +1 -1
- package/dist/routes/instance.js +8 -1
- package/dist/routes/instance.js.map +1 -1
- package/dist/routes/integrations.js +19 -12
- package/dist/routes/integrations.js.map +1 -1
- package/dist/routes/invites.js +36 -20
- package/dist/routes/invites.js.map +1 -1
- package/dist/routes/mcpTokens.js +17 -11
- package/dist/routes/mcpTokens.js.map +1 -1
- package/dist/routes/members.js +9 -7
- package/dist/routes/members.js.map +1 -1
- package/dist/routes/owner.js.map +1 -1
- package/dist/routes/reviewLinks.js +13 -0
- package/dist/routes/reviewLinks.js.map +1 -1
- package/dist/routes/rounds.js +7 -3
- package/dist/routes/rounds.js.map +1 -1
- package/dist/routes/sessions.js +7 -4
- package/dist/routes/sessions.js.map +1 -1
- package/dist/routes/sites.js +22 -13
- package/dist/routes/sites.js.map +1 -1
- package/dist/routes/threads.js +43 -10
- package/dist/routes/threads.js.map +1 -1
- package/dist/studioReviewers.js +3 -1
- package/dist/studioReviewers.js.map +1 -1
- package/dist/vendor/types/roles.js +65 -0
- package/package.json +1 -1
- package/static/dashboard/assets/CompositeItem-CJog0hVD.js +1 -0
- package/static/dashboard/assets/{ConfirmDialog-s6KLZt6w.js → ConfirmDialog-D2seMnrm.js} +1 -1
- package/static/dashboard/assets/{CopyButton-Cqz1MLVB.js → CopyButton-Bc4lyikk.js} +1 -1
- package/static/dashboard/assets/{FieldItemContext-4dJ9QpEG.js → FieldItemContext-CzXi3fsx.js} +1 -1
- package/static/dashboard/assets/{InstallTag-B4frNgVO.js → InstallTag-SMFR2B0h.js} +1 -1
- package/static/dashboard/assets/McpTokens-BXqxvFAS.js +1 -0
- package/static/dashboard/assets/{SaveState-DfBHRtEq.js → SaveState-Cmf4iv03.js} +1 -1
- package/static/dashboard/assets/_app-DwywpWfz.js +56 -0
- package/static/dashboard/assets/{_app-5y2NMiTw.js → _app-bdnugJ8u.js} +1 -1
- package/static/dashboard/assets/activity-qDQs5Zz8.js +1 -0
- package/static/dashboard/assets/{arrow-left-iXAzDNV6.js → arrow-left-CDK8KGdH.js} +1 -1
- package/static/dashboard/assets/{avatar-DkFTIwsR.js → avatar-BIbCnV-M.js} +1 -1
- package/static/dashboard/assets/badge-BD0L3Rdr.js +1 -0
- package/static/dashboard/assets/{card-C4v3pSqd.js → card-CCRzd-vJ.js} +1 -1
- package/static/dashboard/assets/{check-BKP4SJjJ.js → check-CvTMcsU6.js} +1 -1
- package/static/dashboard/assets/{chevron-right-BVbfidnK.js → chevron-right-NPSJD-jD.js} +1 -1
- package/static/dashboard/assets/{copy-nRZWPHR1.js → copy-CwAe5Q6l.js} +1 -1
- package/static/dashboard/assets/{dialog-lgIL_ZCX.js → dialog-CvU77XfW.js} +2 -2
- package/static/dashboard/assets/{dropdown-menu-DyLLQk8L.js → dropdown-menu-VHkK2Dt7.js} +1 -1
- package/static/dashboard/assets/{image-off-B6flKQEZ.js → image-off-wPLko91u.js} +1 -1
- package/static/dashboard/assets/index-B1JGVSdd.js +169 -0
- package/static/dashboard/assets/index-CpG77B7f.css +1 -0
- package/static/dashboard/assets/invite-DWNnOuAZ.js +1 -0
- package/static/dashboard/assets/{label-CL3Ivlhy.js → label-C6rZlF0y.js} +1 -1
- package/static/dashboard/assets/labels-DhKmOzOU.js +1 -0
- package/static/dashboard/assets/{layout-grid-B-9bb2Av.js → layout-grid-CPYmheoR.js} +1 -1
- package/static/dashboard/assets/parts-sBoh2K5o.js +6 -0
- package/static/dashboard/assets/{plus-BOeukd4A.js → plus-B7K-9XU0.js} +1 -1
- package/static/dashboard/assets/s._site-DKfVuunu.js +1 -0
- package/static/dashboard/assets/s._site.comments-DqDBqjhy.js +54 -0
- package/static/dashboard/assets/s._site.reviewers-yBn4jjwr.js +1 -0
- package/static/dashboard/assets/s._site.settings-CsiWJZ8D.js +1 -0
- package/static/dashboard/assets/{setup-DjA-0YhC.js → setup-DrjzRZp8.js} +1 -1
- package/static/dashboard/assets/{sign-in-vMnULz18.js → sign-in-BsM2n_hk.js} +1 -1
- package/static/dashboard/assets/sign-up-BXcvVUC-.js +1 -0
- package/static/dashboard/assets/sites-DRTZAXN_.js +1 -0
- package/static/dashboard/assets/studio-CEwWJLvF.js +1 -0
- package/static/dashboard/assets/{studio-CBGrW0G1.js → studio-DdM6OVdO.js} +1 -1
- package/static/dashboard/assets/studio.index-BOXLD6ah.js +1 -0
- package/static/dashboard/assets/studio.integrations-B7XK6X3K.js +1 -0
- package/static/dashboard/assets/studio.members-DSJEjb1M.js +6 -0
- package/static/dashboard/assets/{sun-ygOg7Lon.js → sun-DojiLt7X.js} +1 -1
- package/static/dashboard/assets/{switch-CYLwE1-9.js → switch-SJYZN0-3.js} +1 -1
- package/static/dashboard/assets/{table-BgojscGP.js → table-BDQkr8bT.js} +1 -1
- package/static/dashboard/assets/{useAriaLabelledBy-Ce10PDSC.js → useAriaLabelledBy-BDqDB_Wq.js} +1 -1
- package/static/dashboard/assets/{useBaseQuery-BI_bJwNl.js → useBaseQuery-DXKWEN1Y.js} +1 -1
- package/static/dashboard/assets/useQuery-BCK_zdLj.js +1 -0
- package/static/dashboard/assets/useRender-hAtJO9As.js +1 -0
- package/static/dashboard/assets/{useValueChanged-Dh5Yg1r8.js → useValueChanged-B9j_H2Sq.js} +1 -1
- package/static/dashboard/assets/{users-BXCV1C3P.js → users-jrxD0Qlm.js} +1 -1
- package/static/dashboard/assets/{welcome-C9fdUqeW.js → welcome-BGT16RMO.js} +3 -3
- package/static/dashboard/assets/{widget-signin-DiXxk1Ln.js → widget-signin-A_kxUEvx.js} +1 -1
- package/static/dashboard/assets/you-CdfLrYaC.js +1 -0
- package/static/dashboard/assets/{zod-khKoKeAB.js → zod-C7-R6TNW.js} +1 -1
- package/static/dashboard/index.html +2 -2
- package/static/widget/build.json +2 -2
- package/static/widget/snag.js +1 -1
- package/static/widget/snag.runtime.js +1 -1
- package/static/dashboard/assets/CompositeItem-DpSaUtYZ.js +0 -1
- package/static/dashboard/assets/_app-CnifsCfr.js +0 -56
- package/static/dashboard/assets/activity-DX3WrmQt.js +0 -1
- package/static/dashboard/assets/badge-CrUHZwEL.js +0 -1
- package/static/dashboard/assets/index-D6Jv0m8R.css +0 -1
- package/static/dashboard/assets/index-DMCyFEmS.js +0 -169
- package/static/dashboard/assets/invite-CrR7zqFd.js +0 -1
- package/static/dashboard/assets/labels--UUyt9uB.js +0 -1
- package/static/dashboard/assets/me-6-FBHysO.js +0 -1
- package/static/dashboard/assets/parts-b71WkkoI.js +0 -1
- package/static/dashboard/assets/s._site-MtCDp62_.js +0 -1
- package/static/dashboard/assets/s._site.comments-vNVUqPN4.js +0 -54
- package/static/dashboard/assets/s._site.reviewers-BMYyb10D.js +0 -1
- package/static/dashboard/assets/s._site.settings-BaBm7RJi.js +0 -1
- package/static/dashboard/assets/sign-up-K_HV-_C8.js +0 -1
- package/static/dashboard/assets/sites-Dw-qQxr1.js +0 -1
- package/static/dashboard/assets/studio-DcijgVQL.js +0 -1
- package/static/dashboard/assets/studio.index-D-9QUrvv.js +0 -1
- package/static/dashboard/assets/studio.integrations-Djhl8gKq.js +0 -1
- package/static/dashboard/assets/studio.members-DaS0HWwE.js +0 -6
- package/static/dashboard/assets/useQuery-Cl9FITTP.js +0 -1
- package/static/dashboard/assets/useRender-Ck8DP-Z3.js +0 -1
- package/static/dashboard/assets/you-CZGeTvq7.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{J as x,p as h,r as g,s as f,y as j,A as N,C as w,j as e,G as b,B as y,H as S,I as r}from"./index-B1JGVSdd.js";import{u as v,a as A}from"./zod-C7-R6TNW.js";import{L as i,I as o}from"./label-C6rZlF0y.js";const C=S({email:r().trim().email("An email address"),password:r().min(12,"At least 12 characters"),orgName:r().trim().max(120).optional()});function E(){const{claim:d}=x.useSearch(),c=h(),[l,n]=g.useState(""),{register:a,handleSubmit:p,formState:s}=v({resolver:A(C)}),u=p(async t=>{n("");try{await f.setup({token:d??"",orgName:t.orgName||"My studio",projectName:"",email:t.email,password:t.password,address:location.origin}),j("in"),N.clear(),c({to:"/welcome",replace:!0})}catch(m){n(m instanceof w?m.message:"Something went wrong. Try again.")}});return e.jsx(b,{width:400,children:e.jsxs("form",{onSubmit:u,className:"flex flex-col gap-4",noValidate:!0,children:[e.jsxs("div",{children:[e.jsx("h1",{className:"m-0 text-[22px] font-semibold tracking-tight",children:"Set up Snagset"}),e.jsx("p",{className:"m-0 mt-1.5 text-muted-foreground",children:"This instance has not been claimed yet. The account you make here is the only one, until you add another."})]}),l&&e.jsx("p",{role:"alert",className:"m-0 rounded-md border border-destructive/40 bg-warn-soft px-3 py-2 text-[13px] text-destructive",children:l}),e.jsxs("fieldset",{disabled:s.isSubmitting,className:"m-0 flex min-w-0 flex-col gap-4 border-0 p-0",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(i,{htmlFor:"email",children:"Your email"}),e.jsx(o,{id:"email",type:"email",autoComplete:"username","aria-invalid":!!s.errors.email,...a("email")}),s.errors.email&&e.jsx("p",{className:"m-0 text-[12px] text-destructive",children:s.errors.email.message})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(i,{htmlFor:"password",children:"Password"}),e.jsx(o,{id:"password",type:"password",autoComplete:"new-password","aria-invalid":!!s.errors.password,...a("password")}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"At least 12 characters. There is no reset email on a fresh install — keep it."})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs(i,{htmlFor:"orgName",children:["Studio name ",e.jsx("span",{className:"font-normal text-muted-foreground",children:"optional"})]}),e.jsx(o,{id:"orgName",placeholder:"My studio",...a("orgName")})]}),e.jsx(y,{type:"submit",size:"lg",loading:s.isSubmitting,children:s.isSubmitting?"Setting up…":"Create my account"})]})]})})}export{E as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{K as w,p as y,r as l,z as d,s as N,y as S,C,j as e,G as k,B as E,h as F,L as I,H as L,I as m}from"./index-B1JGVSdd.js";import{u as c}from"./useQuery-BCK_zdLj.js";import{u as R,a as z}from"./zod-C7-R6TNW.js";import{L as u,I as p}from"./label-C6rZlF0y.js";import{C as A}from"./chevron-right-NPSJD-jD.js";import"./useBaseQuery-DXKWEN1Y.js";const B=L({email:m().trim().min(1,"Your email"),password:m().min(1,"Your password")});function Q(){const{redirect:x}=w.useSearch(),r=y(),[a,o]=l.useState(""),[s,h]=l.useState(!1),{register:i,handleSubmit:f,formState:t}=R({resolver:z(B)});c({...d.claimed(),enabled:!0}).data===!1&&r({to:"/setup",replace:!0});const g=c(d.setupState()),j=f(async({email:b,password:v})=>{o("");try{await N.login(b,v),S("in"),r({to:x??"/sites",replace:!0})}catch(n){o(n instanceof C?n.message:"Could not reach the server.")}});return e.jsx(k,{children:e.jsxs("form",{onSubmit:j,className:"flex flex-col gap-4",noValidate:!0,children:[e.jsxs("div",{children:[e.jsx("h1",{className:"m-0 text-[22px] font-semibold tracking-tight",children:"Sign in"}),e.jsx("p",{className:"m-0 mt-1.5 text-muted-foreground",children:"The studio side. Reviewers don't sign in — they open a link."})]}),a&&e.jsx("p",{role:"alert",className:"m-0 rounded-md border border-destructive/40 bg-warn-soft px-3 py-2 text-[13px] text-destructive",children:a}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(u,{htmlFor:"email",children:"Email"}),e.jsx(p,{id:"email",type:"email",autoComplete:"username","aria-invalid":!!t.errors.email,...i("email")})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(u,{htmlFor:"password",children:"Password"}),e.jsx(p,{id:"password",type:"password",autoComplete:"current-password","aria-invalid":!!t.errors.password,...i("password")})]}),e.jsx(E,{type:"submit",size:"lg",loading:t.isSubmitting,children:t.isSubmitting?"Signing in…":"Sign in"}),e.jsxs("button",{type:"button",className:"flex items-center gap-2 rounded-md border border-border px-3 py-2 text-left text-[13px] text-ink-soft","aria-expanded":s,onClick:()=>h(!s),children:[e.jsx(A,{className:F("size-3.5 text-muted-foreground transition-transform",s&&"rotate-90")}),"Forgot your password?"]}),g.data?.signup&&e.jsxs("p",{className:"m-0 text-center text-[13px] text-muted-foreground",children:["New here?"," ",e.jsx(I,{to:"/sign-up",className:"text-foreground underline underline-offset-4",children:"Create a studio"})]}),s&&e.jsxs("div",{className:"flex flex-col gap-2 text-[12.5px] leading-relaxed text-muted-foreground",children:[e.jsx("p",{className:"m-0",children:"There's no reset email — a fresh install has no mail set up, and whoever has a shell on the server already holds more authority than a reset link would grant. From that machine:"}),e.jsx("pre",{className:"m-0 overflow-x-auto rounded-md border border-border bg-card px-3 py-2 font-mono text-[12px] text-foreground",children:e.jsx("code",{children:`printf '%s' "$NEW" | snagset passwd you@example.com`})}),e.jsx("p",{className:"m-0",children:"Every existing session for that account is signed out when it runs."})]})]})})}export{Q as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p,r as u,s as h,y as g,A as f,C as j,j as e,G as N,B as w,L as y,H as v,I as t}from"./index-B1JGVSdd.js";import{u as b,a as S}from"./zod-C7-R6TNW.js";import{L as i,I as o}from"./label-C6rZlF0y.js";const A=v({email:t().trim().email("An email address"),password:t().min(12,"At least 12 characters"),name:t().trim().max(120).optional(),orgName:t().trim().max(120).optional()});function k(){const d=p(),[n,l]=u.useState(""),{register:r,handleSubmit:c,formState:a}=b({resolver:S(A)}),x=c(async s=>{l("");try{await h.register({email:s.email,password:s.password,...s.name?{name:s.name}:{},orgName:s.orgName||"My studio"}),g("in"),f.clear(),d({to:"/welcome",replace:!0})}catch(m){l(m instanceof j?m.message:"Something went wrong. Try again.")}});return e.jsx(N,{width:400,children:e.jsxs("form",{onSubmit:x,className:"flex flex-col gap-4",noValidate:!0,children:[e.jsxs("div",{children:[e.jsx("h1",{className:"m-0 text-[22px] font-semibold tracking-tight",children:"Create a studio"}),e.jsx("p",{className:"m-0 mt-1.5 text-muted-foreground",children:"Your account, and the studio your sites live in. Reviewers never sign up — they open a link."})]}),n&&e.jsx("p",{role:"alert",className:"m-0 rounded-md border border-destructive/40 bg-warn-soft px-3 py-2 text-[13px] text-destructive",children:n}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(i,{htmlFor:"email",children:"Your email"}),e.jsx(o,{id:"email",type:"email",autoComplete:"username","aria-invalid":!!a.errors.email,...r("email")}),a.errors.email&&e.jsx("p",{className:"m-0 text-[12px] text-destructive",children:a.errors.email.message})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(i,{htmlFor:"password",children:"Password"}),e.jsx(o,{id:"password",type:"password",autoComplete:"new-password","aria-invalid":!!a.errors.password,...r("password")}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"At least 12 characters. A short phrase of real words is fine."})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs(i,{htmlFor:"name",children:["Your name ",e.jsx("span",{className:"font-normal text-muted-foreground",children:"optional"})]}),e.jsx(o,{id:"name",autoComplete:"name",...r("name")})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs(i,{htmlFor:"orgName",children:["Studio name ",e.jsx("span",{className:"font-normal text-muted-foreground",children:"optional"})]}),e.jsx(o,{id:"orgName",placeholder:"My studio",...r("orgName")})]}),e.jsx(w,{type:"submit",size:"lg",loading:a.isSubmitting,children:a.isSubmitting?"Creating…":"Create my studio"}),e.jsxs("p",{className:"m-0 text-center text-[13px] text-muted-foreground",children:["Already have an account?"," ",e.jsx(y,{to:"/sign-in",className:"text-foreground underline underline-offset-4",children:"Sign in"})]})]})})}export{k as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{q as v,Y as N,r as u,j as e,B as c,L as w,p as y,d as A,s as S,C as $,H as k,I as h}from"./index-B1JGVSdd.js";import{u as C,a as _}from"./zod-C7-R6TNW.js";import{C as E}from"./card-CCRzd-vJ.js";import{E as D,G as I,I as L,H as P,J as F,K as z}from"./dialog-CvU77XfW.js";import{L as g,I as j}from"./label-C6rZlF0y.js";import{P as H,E as q}from"./parts-sBoh2K5o.js";import{u as K,b as T}from"./labels-DhKmOzOU.js";import{P as f}from"./plus-B7K-9XU0.js";import{L as B}from"./layout-grid-CPYmheoR.js";import{I as G}from"./image-off-wPLko91u.js";import"./useBaseQuery-DXKWEN1Y.js";function te(){const t=K(),a=v(t.user.role,"settings"),{add:o}=N.useSearch(),[m,r]=u.useState(!!o&&a);u.useEffect(()=>{o&&a&&r(!0)},[o,a]);const n=t.projects.reduce((s,x)=>s+x.unresolved,0),i=t.limits.projects.limit,d=i!==null&&t.projects.length>=i;return e.jsxs("div",{className:"p-7",children:[e.jsx(H,{title:"Sites",sub:t.projects.length?`${t.projects.length}${i!==null?` of ${i}`:""} site${t.projects.length===1&&i===null?"":"s"} · ${n} open`:i!==null?`0 of ${i} sites`:void 0,actions:a?e.jsxs(c,{onClick:()=>r(!0),disabled:d,title:d?`This studio's plan allows ${i} sites.`:void 0,children:[e.jsx(f,{}),"Add a site"]}):void 0}),t.projects.length===0?e.jsx(E,{className:"max-w-[1100px]",children:e.jsx(q,{icon:e.jsx(B,{className:"size-5"}),title:"No sites yet",action:a?e.jsxs(c,{onClick:()=>r(!0),children:[e.jsx(f,{}),"Add a site"]}):void 0,children:a?"A site is one client website. Add it, paste the tag, and comments start arriving here.":"A site is one client website. An owner or an admin adds it, and its comments appear here."})}):e.jsx("div",{className:"grid max-w-[1100px] grid-cols-1 gap-5 md:grid-cols-2 xl:grid-cols-3",children:t.projects.map(s=>e.jsxs(w,{to:"/s/$site/comments",params:{site:s.uid},className:"block overflow-hidden rounded-lg border border-border bg-card text-foreground transition-shadow hover:shadow-[0_1px_2px_rgb(24_23_22/.06),0_8px_24px_rgb(24_23_22/.08)]",children:[e.jsx("div",{className:"flex h-[150px] items-center justify-center border-b border-border bg-background",children:s.previewUrl?e.jsx("img",{src:s.previewUrl,alt:"",className:"size-full object-cover object-top"}):e.jsxs("div",{className:"flex flex-col items-center gap-1 text-[12px] text-muted-foreground",children:[e.jsx("span",{className:"flex size-8 items-center justify-center rounded-md bg-muted",children:e.jsx(G,{className:"size-4"})}),"No screenshot yet"]})}),e.jsxs("div",{className:"px-3.5 pb-3.5 pt-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-[14px] font-semibold",children:[e.jsx("span",{className:"truncate",children:s.name}),s.status==="paused"&&e.jsx("span",{className:"rounded-sm bg-muted px-1.5 py-px text-[10.5px] font-medium uppercase tracking-wide text-muted-foreground",children:"Paused"})]}),s.domain&&e.jsx("div",{className:"mt-0.5 truncate font-mono text-[12px] text-muted-foreground",children:s.domain}),e.jsx("div",{className:"mt-2 text-[12.5px] text-ink-soft",children:s.threads===0?"Nothing filed yet":`${s.unresolved} open of ${s.threads}${s.lastActivityAt?` · ${T(s.lastActivityAt)}`:""}`})]})]},s.uid))}),e.jsx(R,{open:m,onOpenChange:r})]})}const Q=k({name:h().trim().min(1,"A name"),domain:h().trim().min(1,"Its domain")});function R({open:t,onOpenChange:a}){const o=y(),m=A(),[r,n]=u.useState(""),{register:i,handleSubmit:d,formState:s,reset:x}=C({resolver:_(Q)}),b=d(async p=>{n("");try{const l=await S.createProject(p.name,"",p.domain);await m.invalidateQueries({queryKey:["me"]}),x(),a(!1),o({to:"/s/$site/comments",params:{site:l.uid}})}catch(l){n(l instanceof $?l.message:"Could not add the site.")}});return e.jsx(D,{open:t,onOpenChange:a,children:e.jsx(I,{children:e.jsxs("form",{onSubmit:b,className:"flex flex-col gap-4",noValidate:!0,children:[e.jsxs(L,{children:[e.jsx(P,{children:"Add a site"}),e.jsx(F,{children:"One client website. The tag it needs is shown right after."})]}),r&&e.jsx("p",{role:"alert",className:"m-0 rounded-md border border-destructive/40 bg-warn-soft px-3 py-2 text-[13px] text-destructive",children:r}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(g,{htmlFor:"site-name",children:"Name"}),e.jsx(j,{id:"site-name",placeholder:"Kilnwork","aria-invalid":!!s.errors.name,...i("name")})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(g,{htmlFor:"site-domain",children:"Domain"}),e.jsx(j,{id:"site-domain",placeholder:"kilnwork.studio","aria-invalid":!!s.errors.domain,...i("domain")}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"Every subdomain, scheme and port of it may run the widget — staging, previews, and localhost while you build. Exact addresses elsewhere can be added in Settings."})]}),e.jsxs(z,{children:[e.jsx(c,{type:"button",variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(c,{type:"submit",loading:s.isSubmitting,children:s.isSubmitting?"Adding…":"Add site"})]})]})})})}export{te as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as t,O as o}from"./index-B1JGVSdd.js";const n=()=>t.jsx(o,{});export{n as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{d as o,z as s,_ as u,s as i,$ as y,Z as c}from"./index-B1JGVSdd.js";function Q(){const e=o(),t=s.me().queryKey;return u({mutationFn:a=>i.renameOrg(a),onMutate:async a=>{await e.cancelQueries({queryKey:t});const r=e.getQueryData(t);return r&&e.setQueryData(t,{...r,org:{...r.org,name:a}}),{was:r}},onError:(a,r,n)=>{n?.was&&e.setQueryData(t,n.was),y.error(c(a))},onSettled:()=>e.invalidateQueries({queryKey:t})})}function q(){const e=o(),t=s.me().queryKey;return u({mutationFn:a=>i.renameMe(a),onMutate:async a=>{await e.cancelQueries({queryKey:t});const r=e.getQueryData(t);return r&&e.setQueryData(t,{...r,user:{...r.user,name:a}}),{was:r}},onError:(a,r,n)=>{n?.was&&e.setQueryData(t,n.was),y.error(c(a))},onSettled:()=>{e.invalidateQueries({queryKey:t}),e.invalidateQueries({queryKey:s.members().queryKey})}})}function f(){return u({mutationFn:e=>i.changePassword(e.current,e.next)})}function l(){const e=o();return u({mutationFn:t=>i.createInvite(t),onSuccess:()=>void e.invalidateQueries({queryKey:s.invites().queryKey})})}function w(){const e=o(),t=s.invites().queryKey;return u({mutationFn:a=>i.revokeInvite(a),onMutate:async a=>{await e.cancelQueries({queryKey:t});const r=e.getQueryData(t);return r&&e.setQueryData(t,{...r,data:r.data.filter(n=>n.id!==a)}),{was:r}},onError:(a,r,n)=>{n?.was&&e.setQueryData(t,n.was),y.error(c(a))},onSettled:()=>e.invalidateQueries({queryKey:t})})}function v(){return u({mutationFn:e=>i.sendInvite(e.id,e.token)})}function K(){const e=o(),t=s.members().queryKey;return u({mutationFn:a=>i.setMemberRole(a.email,a.role),onMutate:async({email:a,role:r})=>{await e.cancelQueries({queryKey:t});const n=e.getQueryData(t);return n&&e.setQueryData(t,{data:n.data.map(m=>m.email===a?{...m,role:r}:m)}),{was:n}},onSuccess:(a,{email:r})=>{e.setQueryData(t,a),a.data.find(n=>n.email===r)?.you&&e.invalidateQueries({queryKey:s.me().queryKey})},onError:(a,r,n)=>{n?.was&&e.setQueryData(t,n.was),y.error(c(a))}})}function D(){const e=o(),t=s.members().queryKey;return u({mutationFn:a=>i.removeMember(a),onMutate:async a=>{await e.cancelQueries({queryKey:t});const r=e.getQueryData(t);return r&&e.setQueryData(t,{data:r.data.filter(n=>n.email!==a)}),{was:r}},onSuccess:a=>e.setQueryData(t,a),onError:(a,r,n)=>{n?.was&&e.setQueryData(t,n.was),y.error(c(a))}})}export{f as a,Q as b,K as c,D as d,w as e,l as f,v as g,q as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as B,r as h,_ as v,s as y,$ as b,Z as C,j as e,B as g,z as S,C as K,q as M,S as G}from"./index-B1JGVSdd.js";import{u as w}from"./useQuery-BCK_zdLj.js";import{L as A,I as k}from"./label-C6rZlF0y.js";import{E as T,G as I,I as U,H as z,J as L,K as _}from"./dialog-CvU77XfW.js";import{C as O}from"./ConfirmDialog-D2seMnrm.js";import{a as D,A as q,P as H}from"./parts-sBoh2K5o.js";import{u as F,b as E}from"./labels-DhKmOzOU.js";import{S as Q}from"./SaveState-Cmf4iv03.js";import{b as V}from"./studio-DdM6OVdO.js";import{c as W}from"./update-duXzIzFS.js";import"./useBaseQuery-DXKWEN1Y.js";import"./card-CCRzd-vJ.js";function J({owner:n}){const s=w(S.instance()),i=B(),t=()=>i.invalidateQueries({queryKey:S.instance().queryKey}),[c,l]=h.useState(!1),[p,x]=h.useState(!1),[d,u]=h.useState(null),a=v({mutationFn:y.disconnectStorage,onSuccess:()=>void t(),onError:j=>b.error(C(j))}),r=v({mutationFn:y.disconnectMail,onSuccess:()=>void t(),onError:j=>b.error(C(j))}),f=v({mutationFn:y.testMail,onSuccess:j=>b.success(`Sent to ${j.to}`),onError:j=>b.error(C(j))}),N=F(),m=s.data?.storage,o=s.data?.mail;return e.jsxs(e.Fragment,{children:[e.jsxs(D,{title:"Storage",description:"The bucket screenshots and files go to. Without one the widget runs in annotation mode.",children:[!s.data&&e.jsx("p",{className:"m-0 text-[13px] text-muted-foreground",children:s.isError?"Could not read it.":"Reading…"}),m&&e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(P,{tone:m.connected?"ok":m.unreadable?"bad":"off",text:m.connected?`Connected · ${m.bucket} at ${(m.endpoint??"").replace(/^https?:\/\//,"")}${m.connectedAt?` · since ${E(m.connectedAt)}`:""}`:m.unreadable?"A bucket is stored but its keys will not decrypt — the secret key changed. Connect it again.":"Not connected — annotation mode. Comments and anchors work; screenshots are not offered."}),N.limits.storage.limit!==null&&e.jsxs("p",{className:"m-0 text-[12px] text-muted-foreground",children:[$(N.limits.storage.used)," of ",$(N.limits.storage.limit)," used across the studio's sites."]}),m.source==="env"?e.jsx(R,{what:"SNAGSET_STORAGE_S3_*"}):n?e.jsxs("div",{className:"flex gap-2",children:[e.jsx(g,{variant:"outline",size:"sm",onClick:()=>l(!0),children:m.connected||m.unreadable?"Replace…":"Connect a bucket…"}),(m.connected||m.unreadable)&&e.jsx(g,{variant:"ghost",size:"sm",onClick:()=>u("storage"),children:"Disconnect"})]}):null]})]}),e.jsx(D,{title:"Mail",description:"How notifications go out. Without a transport they are off, and the instance says so.",children:o&&e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(P,{tone:o.configured?"ok":o.unreadable?"bad":"off",text:o.configured?`${o.scheme==="resend"?"Resend":`SMTP · ${o.host??""}`} · from ${o.from}${o.updatedAt?` · since ${E(o.updatedAt)}`:""}`:o.unreadable?"A transport is stored but its secret will not decrypt — the secret key changed. Connect it again.":"No transport — notifications are off."}),o.source==="env"?e.jsx(R,{what:"SNAGSET_MAIL_URL"}):n?e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(g,{variant:"outline",size:"sm",onClick:()=>x(!0),children:o.configured||o.unreadable?"Replace…":"Connect a transport…"}),o.configured&&e.jsx(g,{variant:"outline",size:"sm",loading:f.isPending,onClick:()=>f.mutate(),children:f.isPending?"Sending…":"Send a test email"}),(o.configured||o.unreadable)&&e.jsx(g,{variant:"ghost",size:"sm",onClick:()=>u("mail"),children:"Disconnect"})]}):(o.configured&&n===!1,null)]})}),e.jsx(Z,{open:c,onOpenChange:l,onDone:()=>void t()}),e.jsx(X,{open:p,onOpenChange:x,onDone:()=>void t()}),e.jsx(O,{open:d!==null,onOpenChange:j=>!j&&u(null),title:d==="storage"?"Disconnect the bucket?":"Disconnect the mail transport?",description:d==="storage"?"Screenshots stop being offered. Nothing in the bucket is deleted, and reconnecting the same bucket brings the pictures back.":"Notifications stop going out until a transport is connected again.",confirmLabel:"Disconnect",busy:a.isPending||r.isPending,onConfirm:async()=>{d==="storage"?await a.mutateAsync():await r.mutateAsync(),u(null)}})]})}function P({tone:n,text:s}){return e.jsxs("p",{className:"m-0 flex items-center gap-2 text-[13px]",children:[e.jsx("span",{className:`size-2 shrink-0 rounded-full ${n==="ok"?"bg-ok":n==="bad"?"bg-destructive":"bg-line-strong"}`,"aria-hidden":"true"}),e.jsx("span",{children:s})]})}function R({what:n}){return e.jsxs("p",{className:"m-0 text-[12px] text-muted-foreground",children:["Set by the environment (",e.jsx("code",{className:"font-mono",children:n}),"). Change it there; the dashboard shows it and does not offer to edit it."]})}function Z({open:n,onOpenChange:s,onDone:i}){const[t,c]=h.useState({endpoint:"",bucket:"",region:"",accessKeyId:"",secretAccessKey:"",publicBaseUrl:""}),[l,p]=h.useState(""),x=v({mutationFn:y.connectStorage}),d=r=>f=>c({...t,[r]:f.target.value}),u=async r=>{r.preventDefault(),p("");try{await x.mutateAsync({endpoint:t.endpoint.trim(),bucket:t.bucket.trim(),accessKeyId:t.accessKeyId.trim(),secretAccessKey:t.secretAccessKey,...t.region.trim()?{region:t.region.trim()}:{},...t.publicBaseUrl.trim()?{publicBaseUrl:t.publicBaseUrl.trim()}:{}}),c({endpoint:"",bucket:"",region:"",accessKeyId:"",secretAccessKey:"",publicBaseUrl:""}),s(!1),i(),b.success("Bucket connected — screenshots are on")}catch(f){p(f instanceof K?f.message:"Could not reach the server.")}},a=(r,f,N,m="text",o)=>e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(A,{htmlFor:`st-${r}`,children:f}),e.jsx(k,{id:`st-${r}`,type:m,placeholder:N,value:t[r],onChange:d(r),autoComplete:"off"}),o&&e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:o})]});return e.jsx(T,{open:n,onOpenChange:s,children:e.jsx(I,{children:e.jsxs("form",{onSubmit:r=>void u(r),className:"flex flex-col gap-4",noValidate:!0,children:[e.jsxs(U,{children:[e.jsx(z,{children:"Connect a bucket"}),e.jsx(L,{children:"Any S3-compatible bucket. It is probed — write, read, delete — before anything is saved, and the keys are stored encrypted with this instance's secret key."})]}),l&&e.jsx("p",{role:"alert",className:"m-0 rounded-md border border-destructive/40 bg-warn-soft px-3 py-2 text-[13px] text-destructive",children:l}),a("endpoint","Endpoint","https://ams3.digitaloceanspaces.com"),a("bucket","Bucket","snagset"),a("region","Region","auto","text","Leave empty for providers that do not use one."),a("accessKeyId","Access key ID",""),a("secretAccessKey","Secret access key","","password"),a("publicBaseUrl","Public base URL","","text","Optional — only if the bucket is served from a CDN address."),e.jsxs(_,{children:[e.jsx(g,{type:"button",variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(g,{type:"submit",loading:x.isPending,children:x.isPending?"Probing…":"Connect"})]})]})})})}function X({open:n,onOpenChange:s,onDone:i}){const[t,c]=h.useState(""),[l,p]=h.useState(""),[x,d]=h.useState(""),u=v({mutationFn:y.connectMail}),a=async r=>{r.preventDefault(),d("");try{await u.mutateAsync({url:t.trim(),from:l.trim()}),c(""),p(""),s(!1),i(),b.success("Transport connected — send a test email to be sure")}catch(f){d(f instanceof K?f.message:"Could not reach the server.")}};return e.jsx(T,{open:n,onOpenChange:s,children:e.jsx(I,{children:e.jsxs("form",{onSubmit:r=>void a(r),className:"flex flex-col gap-4",noValidate:!0,children:[e.jsxs(U,{children:[e.jsx(z,{children:"Connect a mail transport"}),e.jsx(L,{children:"Resend is the easy one — the provider owns SPF and DKIM. SMTP works with any provider. The URL is stored encrypted with this instance's secret key."})]}),x&&e.jsx("p",{role:"alert",className:"m-0 rounded-md border border-destructive/40 bg-warn-soft px-3 py-2 text-[13px] text-destructive",children:x}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(A,{htmlFor:"mail-url",children:"Transport"}),e.jsx(k,{id:"mail-url",type:"password",placeholder:"resend://re_… or smtp://user:pass@host:587",value:t,onChange:r=>c(r.target.value),autoComplete:"off"})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(A,{htmlFor:"mail-from",children:"From"}),e.jsx(k,{id:"mail-from",placeholder:"Snagset <review@kilnwork.studio>",value:l,onChange:r=>p(r.target.value)}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"The address every notification is sent from. Resend needs a verified domain for it."})]}),e.jsxs(_,{children:[e.jsx(g,{type:"button",variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(g,{type:"submit",loading:u.isPending,disabled:!t.trim()||!l.trim(),children:u.isPending?"Saving…":"Connect"})]})]})})})}function $(n){const s=["B","KB","MB","GB","TB"];let i=n,t=0;for(;i>=1024&&t<s.length-1;)i/=1024,t+=1;return`${t===0?i:i.toFixed(i>=10?0:1)} ${s[t]}`}function Y(){const n=F(),s=w(S.meta()),i=w(S.members()),t=V(),c=M(n.user.role,"studio"),[l,p]=h.useState(n.org.name),[x,d]=h.useState(null);h.useEffect(()=>p(n.org.name),[n.org.name]);const u=c&&l.trim().length>0&&l.trim()!==n.org.name;return e.jsxs("div",{className:"flex flex-col gap-10 p-7",children:[e.jsx(H,{title:"General",sub:n.org.name,actions:e.jsx(Q,{saving:t.isPending,savedAt:x})}),e.jsx(D,{title:"Studio",description:"The name at the top of every screen.",children:e.jsxs("form",{className:"flex flex-col gap-1.5",onSubmit:a=>{a.preventDefault(),u&&t.mutate(l.trim(),{onSuccess:()=>d(Date.now())})},children:[e.jsx(A,{htmlFor:"studio-name",children:"Name"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(k,{id:"studio-name",value:l,readOnly:!c,onChange:a=>p(a.target.value)}),u&&e.jsx(g,{type:"submit",variant:"outline",children:"Save"})]}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:c?"Shown at the top of the sidebar, above every site.":"Only an owner can change it."})]})}),e.jsx(D,{title:"This instance",description:"What is running, and where.",children:e.jsxs("dl",{className:"m-0 grid grid-cols-[130px_1fr] gap-x-3 gap-y-1.5 text-[13px]",children:[e.jsx("dt",{className:"text-muted-foreground",children:"Version"}),e.jsxs("dd",{className:"m-0",children:[s.data?.version??"—"," ",e.jsx(ee,{version:s.data?.version??""})]}),e.jsx("dt",{className:"text-muted-foreground",children:"Address"}),e.jsx("dd",{className:"m-0",children:e.jsx(te,{owner:c})}),s.data?.commit&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{className:"text-muted-foreground",children:"Commit"}),e.jsxs("dd",{className:"m-0 font-mono text-[12px] text-ink-soft",children:[s.data.commit.slice(0,12),s.data.modified?" · modified":""]})]}),e.jsx("dt",{className:"text-muted-foreground",children:"Sites · members"}),e.jsxs("dd",{className:"m-0",children:[n.projects.length," · ",i.data?.data.length??"—"]})]})}),e.jsx(J,{owner:c})]})}function ee({version:n}){const[s,i]=h.useState({s:"idle"});return s.s==="idle"?e.jsxs(e.Fragment,{children:["·"," ",e.jsx("button",{type:"button",className:"text-brand hover:underline",onClick:()=>{i({s:"checking"}),W(n).then(t=>i({s:"done",r:t})).catch(()=>i({s:"failed"}))},children:"Check for updates"})," ",e.jsx("span",{className:"text-[12px] text-muted-foreground",children:"— from your browser, never from the server"})]}):s.s==="checking"?e.jsxs("span",{className:"inline-flex items-center gap-1 text-muted-foreground",children:["· ",e.jsx(G,{className:"size-3"})," checking…"]}):s.s==="failed"?e.jsx("span",{className:"text-muted-foreground",children:"· could not reach npm"}):e.jsx("span",{className:"text-muted-foreground",children:s.r?.newer?`· ${s.r.latest} is out`:"· up to date"})}function te({owner:n}){const s=B(),i=w(S.instance()),[t,c]=h.useState(null),[l,p]=h.useState(""),x=v({mutationFn:a=>y.setAddress(a),onSuccess:a=>{s.setQueryData(S.instance().queryKey,a),c(null),p(""),b.success("Address saved — every new link is built from it")},onError:a=>p(C(a))}),d=i.data?.address;if(!d)return e.jsx("span",{className:"font-mono text-[12px] text-ink-soft",children:location.origin});const u=d.source==="env";return t===null||!n||u?e.jsxs("span",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"font-mono text-[12px] text-ink-soft",children:d.url}),e.jsx("span",{className:"text-[12px] text-muted-foreground",children:u?"· set by the environment (SNAGSET_BASE_URL)":d.source==="stored"?"· set at claim; every link is built from it":"· this machine's default"}),n&&!u&&e.jsx(g,{variant:"ghost",size:"sm",onClick:()=>c(d.url),children:"Change…"})]}):e.jsxs("form",{className:"flex flex-col gap-1.5",onSubmit:a=>{a.preventDefault(),x.mutate(t.trim())},children:[e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(k,{"aria-label":"Address",value:t,onChange:a=>c(a.target.value),className:"h-8 max-w-[360px] font-mono text-[12px]",autoFocus:!0}),e.jsx(g,{type:"submit",size:"sm",loading:x.isPending,disabled:!t.trim(),children:x.isPending?"Saving…":"Save"}),e.jsx(g,{type:"button",variant:"ghost",size:"sm",onClick:()=>c(null),children:"Cancel"})]}),l&&e.jsx("span",{className:"text-[12px] text-destructive",children:l}),e.jsx("span",{className:"text-[12px] text-muted-foreground",children:"https:// unless it is this machine; the origin only. Review links, issues and emails are built from it."})]})}const he=()=>M(F().user.role,"settings")?e.jsx(Y,{}):e.jsx(q,{title:"General"});export{he as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{q as U,j as e,L as ee,d as te,r as a,_ as F,$ as I,Z as M,s as T,a0 as D,W as se,B as y,C as K,z as ne}from"./index-B1JGVSdd.js";import{u as B}from"./useQuery-BCK_zdLj.js";import{B as _}from"./badge-BD0L3Rdr.js";import{E,G as O,I as W,H as R,J,K as H}from"./dialog-CvU77XfW.js";import{L as C,I as A}from"./label-C6rZlF0y.js";import{C as oe}from"./ConfirmDialog-D2seMnrm.js";import{A as ae,P as re,a as ie}from"./parts-sBoh2K5o.js";import{u as q,b as ce}from"./labels-DhKmOzOU.js";import{C as z}from"./CopyButton-Bc4lyikk.js";import{M as le}from"./McpTokens-BXqxvFAS.js";import"./useBaseQuery-DXKWEN1Y.js";import"./useRender-hAtJO9As.js";import"./card-CCRzd-vJ.js";import"./check-CvTMcsU6.js";import"./copy-CwAe5Q6l.js";import"./switch-SJYZN0-3.js";import"./useAriaLabelledBy-BDqDB_Wq.js";import"./useValueChanged-B9j_H2Sq.js";const de={ok:{label:"Healthy",tone:"ok"},needs_reauth:{label:"Needs a new token",tone:"bad"},error:{label:"Failing",tone:"bad"}};function he(){const o=q(),i=U(o.user.role,"settings"),x=U(o.user.role,"studio"),f=B(ne.integrations()),S=te(),w=()=>S.invalidateQueries({queryKey:["integrations"]}),[l,u]=a.useState(null),[r,g]=a.useState(null),[j,m]=a.useState(null),b=F({mutationFn:t=>T.regenerateGitHubWebhook(t),onSuccess:({webhook:t},s)=>m({site:s,provider:"github",hook:t,fresh:!1}),onError:t=>I.error(M(t))}),N=F({mutationFn:({uid:t,provider:s})=>T.testTracker(t,s).then(c=>({...c,provider:s})),onSuccess:t=>{I[t.ok?"success":"error"](t.ok?`${D[t.provider]} can see ${t.target}`:t.detail??`${D[t.provider]} refused the token`),w()},onError:t=>I.error(M(t))}),k=F({mutationFn:({uid:t,provider:s})=>T.disconnectTracker(t,s),onSuccess:()=>{g(null),w()},onError:t=>I.error(M(t))}),v=f.data?.data??[],h=t=>v.filter(s=>s.provider===t),d=t=>o.projects.filter(s=>!h(t).some(c=>c.site===s.uid));return e.jsxs("div",{className:"flex flex-col gap-10 p-7",children:[e.jsx(re,{title:"Integrations",sub:"Mirrors converge on the comment's status here; Slack only announces"}),["github","linear","jira","slack"].map(t=>{const s=h(t),c=d(t);return e.jsxs(ie,{title:D[t],description:t==="github"?"A comment becomes an issue in the site's repository, with the brief as its body; resolving it here closes the issue there, and closing it there resolves it here. A fine-grained token per site — no OAuth app to register.":t==="linear"?"A comment becomes an issue in the site's team, with the brief as its body; our status moves it between the team's workflow states by type, and a webhook from Linear moves it back. A personal API key per site — no OAuth app to register.":t==="jira"?"A comment becomes an issue in the site's Jira project, with the brief as its description; our status moves it through the workflow by status category, and a webhook from Jira moves it back. An API token with the account's email — what Atlassian gives a self-hoster.":"One message per comment in a channel, edited in place as the status moves — never a second message, never a reply. A bot token from an app you create in a click from our manifest; Slack sends nothing back.",children:[f.isPending&&e.jsx(se,{rows:2}),f.isSuccess&&s.length===0&&e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(_,{variant:"outline",children:"Not connected"}),e.jsx("span",{className:"text-[13px] text-muted-foreground",children:t==="github"?"No site is connected to a repository yet.":t==="linear"?"No site is connected to a team yet.":t==="jira"?"No site is connected to a project yet.":"No site is connected to a channel yet."})]}),s.length>0&&e.jsx("ul",{className:"m-0 flex list-none flex-col gap-2 p-0",children:s.map(n=>{const P=de[n.health]??{label:n.health,tone:"warn"};return e.jsxs("li",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 rounded-md border border-border px-3 py-2.5 text-[13px]",children:[e.jsx("span",{className:"font-medium",children:n.siteName??n.site}),e.jsx("span",{className:"text-muted-foreground",children:"→"}),e.jsx("code",{className:"font-mono text-[12.5px]",children:n.provider==="github"?`${n.owner}/${n.repo}`:n.provider==="linear"?`${n.teamKey} · ${n.teamName}`:n.provider==="jira"?`${n.projectKey} · ${n.projectName}`:`#${n.channelName} · ${n.teamName}`}),e.jsx(_,{variant:"outline",className:P.tone==="ok"?"border-ok text-ok":P.tone==="bad"?"border-destructive text-destructive":"",children:P.label}),e.jsxs("span",{className:"text-[12px] text-muted-foreground",children:[n.provider==="slack"?n.createOn==="thread.created"?"A message for every new comment":"Messages when you ask, from the brief":n.createOn==="thread.created"?"An issue for every new comment":"Issues when you ask, from the brief",n.provider==="github"&&n.labels.length?` · labels ${n.labels.join(", ")}`:"",n.provider!=="github"&&n.provider!=="slack"&&!n.hasWebhookSecret?` · no webhook secret yet, so ${D[n.provider]} cannot move comments here`:""," · ",ce(n.updatedAt)]}),n.lastError&&e.jsx("span",{className:"basis-full text-[12px] text-destructive",children:n.lastError}),i&&e.jsxs("span",{className:"ml-auto flex gap-1",children:[n.provider==="github"?e.jsx(y,{variant:"ghost",size:"sm",loading:b.isPending,onClick:()=>b.mutate(n.site),children:"Webhook…"}):n.provider==="slack"?null:e.jsx(y,{variant:"ghost",size:"sm",onClick:()=>m({site:n.site,provider:n.provider,hook:{url:`${location.origin}/api/v1/integrations/${n.provider}/inbound`},fresh:!1}),children:"Webhook…"}),e.jsx(y,{variant:"ghost",size:"sm",loading:N.isPending,onClick:()=>N.mutate({uid:n.site,provider:n.provider}),children:"Test"}),e.jsx(y,{variant:"ghost",size:"sm",onClick:()=>g(n),children:"Disconnect"})]})]},`${n.provider}:${n.site}`)})}),i&&c.length>0&&e.jsx("div",{children:e.jsx(y,{variant:"outline",size:"sm",onClick:()=>u(t),children:"Connect a site…"})})]},t)}),e.jsx(le,{owner:i,instanceOwner:x,sites:o.projects}),e.jsx(me,{open:l==="github",onOpenChange:t=>!t&&u(null),sites:d("github"),onDone:(t,s)=>{w(),s&&m({site:t,provider:"github",hook:s,fresh:!0})}}),e.jsx(pe,{open:l==="linear",onOpenChange:t=>!t&&u(null),sites:d("linear"),onDone:(t,s)=>{w(),m({site:t,provider:"linear",hook:s,fresh:!0})}}),e.jsx(xe,{open:l==="jira",onOpenChange:t=>!t&&u(null),sites:d("jira"),onDone:(t,s)=>{w(),m({site:t,provider:"jira",hook:s,fresh:!0})}}),e.jsx(fe,{open:l==="slack",onOpenChange:t=>!t&&u(null),sites:d("slack"),onDone:()=>void w()}),e.jsx(ue,{state:j,onClose:()=>m(null),siteName:t=>v.find(s=>s.site===t)?.siteName??"the site"}),e.jsx(oe,{open:r!==null,onOpenChange:t=>!t&&g(null),title:`Disconnect ${r?.siteName??"this site"} from ${r?D[r.provider]:"the tracker"}?`,description:r?.provider==="slack"?e.jsx(e.Fragment,{children:"Messages already posted stay in the channel; no new ones are posted and they stop being updated. The token is forgotten."}):e.jsx(e.Fragment,{children:"Issues already made keep their links; no new ones are made and status stops mirroring. The token is forgotten."}),confirmLabel:"Disconnect",busy:k.isPending,onConfirm:async()=>{r&&await k.mutateAsync({uid:r.site,provider:r.provider})}})]})}function me({open:o,onOpenChange:i,sites:x,onDone:f}){const[S,w]=a.useState(""),[l,u]=a.useState(""),[r,g]=a.useState(""),[j,m]=a.useState(""),[b,N]=a.useState(!1),[k,v]=a.useState(""),h=F({mutationFn:s=>T.connectTracker(s,"github",{repository:l.trim(),token:r.trim(),labels:j,createOn:b?"thread.created":"manual"})}),d=S||x[0]?.uid||"",t=async s=>{s.preventDefault(),v("");try{const c=await h.mutateAsync(d);u(""),g(""),m(""),N(!1),i(!1),f(d,c.webhook&&"secret"in c.webhook?c.webhook:void 0),I.success("GitHub connected")}catch(c){v(c instanceof K?c.message:"Could not reach the server.")}};return e.jsx(E,{open:o,onOpenChange:i,children:e.jsx(O,{children:e.jsxs("form",{onSubmit:s=>void t(s),className:"flex flex-col gap-4",noValidate:!0,children:[e.jsxs(W,{children:[e.jsx(R,{children:"Connect a site to GitHub"}),e.jsxs(J,{children:["A fine-grained personal access token with ",e.jsx("b",{children:"Issues: read and write"})," on that one repository. It is checked against the repository before it is saved, and stored encrypted with this instance's secret key."]})]}),k&&e.jsx("p",{role:"alert",className:"m-0 rounded-md border border-destructive/40 bg-warn-soft px-3 py-2 text-[13px] text-destructive",children:k}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(C,{htmlFor:"gh-site",children:"Site"}),e.jsx("select",{id:"gh-site",value:d,onChange:s=>w(s.target.value),className:"h-8 rounded-md border border-input bg-background px-2.5 text-[13px]",children:x.map(s=>e.jsx("option",{value:s.uid,children:s.name},s.uid))})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(C,{htmlFor:"gh-repo",children:"Repository"}),e.jsx(A,{id:"gh-repo",placeholder:"kilnwork/site",value:l,onChange:s=>u(s.target.value),autoComplete:"off"})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(C,{htmlFor:"gh-token",children:"Token"}),e.jsx(A,{id:"gh-token",type:"password",placeholder:"github_pat_…",value:r,onChange:s=>g(s.target.value),autoComplete:"off"})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(C,{htmlFor:"gh-labels",children:"Labels"}),e.jsx(A,{id:"gh-labels",placeholder:"review, bug",value:j,onChange:s=>m(s.target.value)}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"Applied to every issue this makes. Optional."})]}),e.jsxs("label",{className:"flex cursor-pointer items-start gap-2.5 text-[13px]",children:[e.jsx("input",{type:"checkbox",className:"mt-0.5",checked:b,onChange:s=>N(s.target.checked)}),e.jsxs("span",{children:[e.jsx("span",{className:"block font-medium",children:"An issue for every new comment"}),e.jsx("span",{className:"block text-[12px] text-muted-foreground",children:'Off by default: a reviewer walking a site leaves twenty comments and half are "never mind". Make issues from the brief when you mean it.'})]})]}),e.jsxs(H,{children:[e.jsx(y,{type:"button",variant:"outline",onClick:()=>i(!1),children:"Cancel"}),e.jsx(y,{type:"submit",loading:h.isPending,disabled:!l.trim()||!r.trim()||!d,children:h.isPending?"Checking…":"Connect"})]})]})})})}function ue({state:o,onClose:i,siteName:x}){const f=o&&"secret"in o.hook?o.hook.secret:null;return e.jsx(E,{open:o!==null,onOpenChange:S=>!S&&i(),children:e.jsxs(O,{children:[e.jsxs(W,{children:[e.jsx(R,{children:o?.fresh?"Connected — now the webhook":"Webhook for "+(o?x(o.site):"")}),e.jsx(J,{children:o?.provider==="linear"?"Issues moved in Linear move the comment here. In Linear › Settings › API › Webhooks, create one for the team with this URL and Issue events; then paste its signing secret when connecting or replacing the connection.":o?.provider==="jira"?"Issues moved in Jira move the comment here. In Jira › Settings › System › Webhooks, create one with this URL, the events Issue updated and Issue deleted, and a secret; then paste the same secret when connecting or replacing the connection.":`Issues closed or reopened on GitHub move the comment here. Add a webhook to the repository — Settings › Webhooks › Add webhook — with these values. The secret is shown this once${o?.fresh?"":", and the previous one has stopped working"}.`})]}),o&&e.jsxs("dl",{className:"m-0 grid grid-cols-[110px_1fr] gap-x-3 gap-y-2 text-[13px]",children:[e.jsx("dt",{className:"text-muted-foreground",children:"Payload URL"}),e.jsxs("dd",{className:"m-0 flex items-center gap-2",children:[e.jsx("code",{className:"min-w-0 flex-1 truncate rounded-md bg-muted px-2 py-1 font-mono text-[12px]",children:o.hook.url}),e.jsx(z,{text:o.hook.url,label:"Copy the payload URL"})]}),e.jsx("dt",{className:"text-muted-foreground",children:"Content type"}),e.jsx("dd",{className:"m-0",children:e.jsx("code",{className:"font-mono text-[12px]",children:"application/json"})}),f&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{className:"text-muted-foreground",children:"Secret"}),e.jsxs("dd",{className:"m-0 flex items-center gap-2",children:[e.jsx("code",{className:"min-w-0 flex-1 truncate rounded-md bg-muted px-2 py-1 font-mono text-[12px]","data-testid":"webhook-secret",children:f}),e.jsx(z,{text:f,label:"Copy the secret"})]})]}),e.jsx("dt",{className:"text-muted-foreground",children:"Events"}),e.jsx("dd",{className:"m-0",children:o.provider==="linear"?"Issues":o.provider==="jira"?"Issue: updated, deleted":"Let me select individual events → Issues"})]}),e.jsx(H,{children:e.jsx(y,{type:"button",onClick:i,children:"Done"})})]})})}function pe({open:o,onOpenChange:i,sites:x,onDone:f}){const[S,w]=a.useState(""),[l,u]=a.useState(""),[r,g]=a.useState(""),[j,m]=a.useState(""),[b,N]=a.useState(!1),[k,v]=a.useState(""),h=F({mutationFn:s=>T.connectTracker(s,"linear",{team:l.trim(),apiKey:r.trim(),...j.trim()?{webhookSecret:j.trim()}:{},createOn:b?"thread.created":"manual"})}),d=S||x[0]?.uid||"",t=async s=>{s.preventDefault(),v("");try{const c=await h.mutateAsync(d);u(""),g(""),m(""),N(!1),i(!1),f(d,c.webhook??{url:`${location.origin}/api/v1/integrations/linear/inbound`}),I.success("Linear connected")}catch(c){v(c instanceof K?c.message:"Could not reach the server.")}};return e.jsx(E,{open:o,onOpenChange:i,children:e.jsx(O,{children:e.jsxs("form",{onSubmit:s=>void t(s),className:"flex flex-col gap-4",noValidate:!0,children:[e.jsxs(W,{children:[e.jsx(R,{children:"Connect a site to Linear"}),e.jsx(J,{children:"A personal API key from Linear › Settings › API, belonging to a member of the team. It is checked against the team before it is saved, and stored encrypted with this instance's secret key."})]}),k&&e.jsx("p",{role:"alert",className:"m-0 rounded-md border border-destructive/40 bg-warn-soft px-3 py-2 text-[13px] text-destructive",children:k}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(C,{htmlFor:"ln-site",children:"Site"}),e.jsx("select",{id:"ln-site",value:d,onChange:s=>w(s.target.value),className:"h-8 rounded-md border border-input bg-background px-2.5 text-[13px]",children:x.map(s=>e.jsx("option",{value:s.uid,children:s.name},s.uid))})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(C,{htmlFor:"ln-team",children:"Team key"}),e.jsx(A,{id:"ln-team",placeholder:"ENG",value:l,onChange:s=>u(s.target.value),autoComplete:"off"}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"The prefix of the team's issues, like the ENG in ENG-123."})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(C,{htmlFor:"ln-key",children:"API key"}),e.jsx(A,{id:"ln-key",type:"password",placeholder:"lin_api_…",value:r,onChange:s=>g(s.target.value),autoComplete:"off"})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(C,{htmlFor:"ln-secret",children:"Webhook signing secret"}),e.jsx(A,{id:"ln-secret",type:"password",placeholder:"from Linear's webhook, optional",value:j,onChange:s=>m(s.target.value),autoComplete:"off"}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"Lets Linear move comments here when issues move there. The URL to give Linear is shown after connecting."})]}),e.jsxs("label",{className:"flex cursor-pointer items-start gap-2.5 text-[13px]",children:[e.jsx("input",{type:"checkbox",className:"mt-0.5",checked:b,onChange:s=>N(s.target.checked)}),e.jsxs("span",{children:[e.jsx("span",{className:"block font-medium",children:"An issue for every new comment"}),e.jsx("span",{className:"block text-[12px] text-muted-foreground",children:"Off by default. Make issues from the brief when you mean it."})]})]}),e.jsxs(H,{children:[e.jsx(y,{type:"button",variant:"outline",onClick:()=>i(!1),children:"Cancel"}),e.jsx(y,{type:"submit",loading:h.isPending,disabled:!l.trim()||!r.trim()||!d,children:h.isPending?"Checking…":"Connect"})]})]})})})}function xe({open:o,onOpenChange:i,sites:x,onDone:f}){const[S,w]=a.useState(""),[l,u]=a.useState(""),[r,g]=a.useState(""),[j,m]=a.useState(""),[b,N]=a.useState(""),[k,v]=a.useState(""),[h,d]=a.useState(!1),[t,s]=a.useState(""),c=F({mutationFn:p=>T.connectTracker(p,"jira",{siteUrl:l.trim(),project:r.trim(),email:j.trim(),apiToken:b.trim(),...k.trim()?{webhookSecret:k.trim()}:{},createOn:h?"thread.created":"manual"})}),n=S||x[0]?.uid||"",P=async p=>{p.preventDefault(),s("");try{const L=await c.mutateAsync(n);g(""),N(""),v(""),d(!1),i(!1),f(n,L.webhook??{url:`${location.origin}/api/v1/integrations/jira/inbound`}),I.success("Jira connected")}catch(L){s(L instanceof K?L.message:"Could not reach the server.")}},$=(p,L,V,Q,Y,Z="text",G)=>e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(C,{htmlFor:`jr-${p}`,children:L}),e.jsx(A,{id:`jr-${p}`,type:Z,placeholder:Y,value:V,onChange:X=>Q(X.target.value),autoComplete:"off"}),G&&e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:G})]});return e.jsx(E,{open:o,onOpenChange:i,children:e.jsx(O,{children:e.jsxs("form",{onSubmit:p=>void P(p),className:"flex flex-col gap-4",noValidate:!0,children:[e.jsxs(W,{children:[e.jsx(R,{children:"Connect a site to Jira"}),e.jsx(J,{children:"An API token from id.atlassian.com › Security, with the email of the account it belongs to. It is checked against the project before it is saved, and stored encrypted with this instance's secret key."})]}),t&&e.jsx("p",{role:"alert",className:"m-0 rounded-md border border-destructive/40 bg-warn-soft px-3 py-2 text-[13px] text-destructive",children:t}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(C,{htmlFor:"jr-site",children:"Site"}),e.jsx("select",{id:"jr-site",value:n,onChange:p=>w(p.target.value),className:"h-8 rounded-md border border-input bg-background px-2.5 text-[13px]",children:x.map(p=>e.jsx("option",{value:p.uid,children:p.name},p.uid))})]}),$("url","Jira site",l,u,"https://kilnwork.atlassian.net"),$("project","Project key",r,g,"KAN","text","The prefix of the project's issues, like the KAN in KAN-12."),$("email","Account email",j,m,"you@kilnwork.studio","email"),$("token","API token",b,N,"","password"),$("secret","Webhook secret",k,v,"the secret you typed into Jira's webhook, optional","password","Lets Jira move comments here when issues move there. The URL to give Jira is shown after connecting."),e.jsxs("label",{className:"flex cursor-pointer items-start gap-2.5 text-[13px]",children:[e.jsx("input",{type:"checkbox",className:"mt-0.5",checked:h,onChange:p=>d(p.target.checked)}),e.jsxs("span",{children:[e.jsx("span",{className:"block font-medium",children:"An issue for every new comment"}),e.jsx("span",{className:"block text-[12px] text-muted-foreground",children:"Off by default. Make issues from the brief when you mean it."})]})]}),e.jsxs(H,{children:[e.jsx(y,{type:"button",variant:"outline",onClick:()=>i(!1),children:"Cancel"}),e.jsx(y,{type:"submit",loading:c.isPending,disabled:!l.trim()||!r.trim()||!j.trim()||!b.trim()||!n,children:c.isPending?"Checking…":"Connect"})]})]})})})}function fe({open:o,onOpenChange:i,sites:x,onDone:f}){const[S,w]=a.useState(""),[l,u]=a.useState(""),[r,g]=a.useState(""),[j,m]=a.useState(!0),[b,N]=a.useState(""),k=B({queryKey:["integrations","slack","manifest"],queryFn:()=>T.slackManifest(),enabled:o,staleTime:1/0}),v=F({mutationFn:t=>T.connectTracker(t,"slack",{channel:l.trim(),token:r.trim(),createOn:j?"thread.created":"manual"})}),h=S||x[0]?.uid||"",d=async t=>{t.preventDefault(),N("");try{await v.mutateAsync(h),u(""),g(""),m(!0),i(!1),f(h),I.success("Slack connected")}catch(s){N(s instanceof K?s.message:"Could not reach the server.")}};return e.jsx(E,{open:o,onOpenChange:i,children:e.jsx(O,{children:e.jsxs("form",{onSubmit:t=>void d(t),className:"flex flex-col gap-4",noValidate:!0,children:[e.jsxs(W,{children:[e.jsx(R,{children:"Connect a site to Slack"}),e.jsx(J,{children:"Create the app in your workspace from our manifest — one click, the scopes are filled in — install it, and paste its Bot User OAuth Token. The token is checked against the channel before it is saved, and stored encrypted with this instance's secret key."})]}),b&&e.jsx("p",{role:"alert",className:"m-0 rounded-md border border-destructive/40 bg-warn-soft px-3 py-2 text-[13px] text-destructive",children:b}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(C,{htmlFor:"sl-site",children:"Site"}),e.jsx("select",{id:"sl-site",value:h,onChange:t=>w(t.target.value),className:"h-8 rounded-md border border-input bg-background px-2.5 text-[13px]",children:x.map(t=>e.jsx("option",{value:t.uid,children:t.name},t.uid))})]}),e.jsxs("div",{className:"flex items-center gap-3 rounded-md border border-border px-3 py-2 text-[13px]",children:[e.jsxs("span",{className:"flex-1",children:[e.jsx("span",{className:"block font-medium",children:"1. Create the app"}),e.jsx("span",{className:"block text-[12px] text-muted-foreground",children:"Opens api.slack.com with the manifest pasted; then Install to Workspace."})]}),e.jsx(y,{type:"button",variant:"outline",size:"sm",disabled:!k.data,render:e.jsx("a",{href:k.data?.url??"#",target:"_blank",rel:"noreferrer"}),children:"Create app…"})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(C,{htmlFor:"sl-token",children:"2. Bot User OAuth Token"}),e.jsx(A,{id:"sl-token",type:"password",placeholder:"xoxb-…",value:r,onChange:t=>g(t.target.value),autoComplete:"off"}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"On the app's OAuth & Permissions page after installing."})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(C,{htmlFor:"sl-channel",children:"3. Channel"}),e.jsx(A,{id:"sl-channel",placeholder:"#reviews",value:l,onChange:t=>u(t.target.value),autoComplete:"off"}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"A public channel by name; a private one needs the app invited first, then its name works too."})]}),e.jsxs("label",{className:"flex cursor-pointer items-start gap-2.5 text-[13px]",children:[e.jsx("input",{type:"checkbox",className:"mt-0.5",checked:j,onChange:t=>m(t.target.checked)}),e.jsxs("span",{children:[e.jsx("span",{className:"block font-medium",children:"A message for every new comment"}),e.jsx("span",{className:"block text-[12px] text-muted-foreground",children:"On by default: a channel is where people are told. Turn it off to post from the brief when you mean it."})]})]}),e.jsxs(H,{children:[e.jsx(y,{type:"button",variant:"outline",onClick:()=>i(!1),children:"Cancel"}),e.jsx(y,{type:"submit",loading:v.isPending,disabled:!l.trim()||!r.trim()||!h,children:v.isPending?"Checking…":"Connect"})]})]})})})}const Ee=()=>U(q().user.role,"settings")?e.jsx(he,{}):e.jsx(ae,{title:"Integrations",children:e.jsxs("p",{className:"m-0",children:["Connecting a site to GitHub, Linear, Jira or Slack is done by an owner or an admin. Your own agent tokens are on"," ",e.jsx(ee,{to:"/you",className:"text-brand hover:underline",children:"You"}),"."]})});export{Ee as component};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{c as Q,j as e,h as U,q as L,a2 as W,r as j,B as h,a3 as v,a4 as M,Z as k,D as X,H as Z,a5 as ee,a6 as se,a7 as te,I as ie,z as C}from"./index-B1JGVSdd.js";import{u as S}from"./useQuery-BCK_zdLj.js";import{u as ae,a as ne}from"./zod-C7-R6TNW.js";import{A as le,a as re}from"./avatar-BIbCnV-M.js";import{B as oe}from"./badge-BD0L3Rdr.js";import{C as B}from"./card-CCRzd-vJ.js";import{X as de,E as me,G as ce,I as R,H as A,J as I,K as D}from"./dialog-CvU77XfW.js";import{L as E,I as xe}from"./label-C6rZlF0y.js";import{T as P,a as T,b as f,c,d as $,e as x}from"./table-BDQkr8bT.js";import{C as he}from"./ConfirmDialog-D2seMnrm.js";import{C as ue}from"./CopyButton-Bc4lyikk.js";import{A as pe,P as je,b as fe}from"./parts-sBoh2K5o.js";import{u as O,a as ge}from"./labels-DhKmOzOU.js";import{c as ve,d as be,e as ye,f as Ne,g as we}from"./studio-DdM6OVdO.js";import{P as ke}from"./plus-B7K-9XU0.js";import"./useBaseQuery-DXKWEN1Y.js";import"./useRender-hAtJO9As.js";import"./check-CvTMcsU6.js";import"./copy-CwAe5Q6l.js";/**
|
|
2
|
+
* @license lucide-react v1.39.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 Ce=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],Se=Q("mail",Ce);function z({className:s,...n}){return e.jsx("select",{className:U("h-8 rounded-md border border-input bg-card px-2.5 text-[13.5px] text-foreground outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:opacity-50",s),...n})}function Re(){const s=O(),n=L(s.user.role,"people"),l=W(s.user.role),m=S(C.members()),t=S(C.invites()),[d,r]=j.useState(!1),o=s.limits.members.limit,i=o!==null&&s.limits.members.used>=o;return e.jsxs("div",{className:"p-7",children:[e.jsx(je,{title:"Members",sub:`${n?"Only owners change roles or remove people.":"Admins invite members. Ask an owner to change a role or remove someone."}${o!==null?` ${s.limits.members.used} of ${o} members.`:""}`,actions:l.length?e.jsxs(h,{onClick:()=>r(!0),disabled:i,title:i?`This studio's plan allows ${o} members.`:void 0,children:[e.jsx(ke,{}),"Invite"]}):void 0}),e.jsx(B,{className:"max-w-[1040px] overflow-hidden py-0",children:e.jsxs(P,{children:[e.jsx(T,{children:e.jsxs(f,{children:[e.jsx(c,{children:"Name"}),e.jsx(c,{children:"Email"}),e.jsx(c,{children:"Role"}),n&&e.jsx(c,{className:"w-0"})]})}),e.jsx($,{children:(m.data?.data??[]).map(u=>e.jsx(De,{m:u,owner:n},u.email))})]})}),e.jsx(Ae,{}),(t.data?.data.length??0)>0&&e.jsx(Ie,{invites:t.data.data,roles:l}),e.jsxs("p",{className:"m-0 mt-3 max-w-[1040px] text-[12.5px] text-muted-foreground",children:["People join through an invite link and choose their own password. A forgotten one is reset on the server with ",e.jsx("code",{className:"font-mono text-[12px]",children:"snagset passwd"}),"."]}),l.length>0&&e.jsx(Le,{open:d,onOpenChange:r,mail:t.data?.mail??!1,roles:l})]})}const _=s=>new Date(s).toLocaleDateString(void 0,{day:"numeric",month:"short"}),b={owner:"Owner",admin:"Admin",member:"Member"};function Ae(){return e.jsx("dl",{className:"m-0 mt-3 grid max-w-[1040px] grid-cols-[70px_1fr] gap-x-3 gap-y-1 text-[12.5px]","aria-label":"Roles",children:v.map(s=>e.jsxs("div",{className:"contents",children:[e.jsx("dt",{className:"font-medium",children:b[s]}),e.jsx("dd",{className:"m-0 text-muted-foreground",children:M[s]})]},s))})}function Ie({invites:s,roles:n}){const l=ye(),m=n.length>0;return e.jsxs("section",{className:"mt-6 max-w-[1040px]","aria-labelledby":"pending-invites",children:[e.jsx("div",{id:"pending-invites",className:"mb-2",children:e.jsx(fe,{children:"Pending invites"})}),e.jsx(B,{className:"overflow-hidden py-0",children:e.jsxs(P,{children:[e.jsx(T,{children:e.jsxs(f,{children:[e.jsx(c,{children:"For"}),e.jsx(c,{children:"Role"}),e.jsx(c,{children:"Invited by"}),e.jsx(c,{children:"Expires"}),m&&e.jsx(c,{className:"w-0"})]})}),e.jsx($,{children:s.map(t=>e.jsxs(f,{children:[e.jsx(x,{className:t.email?"":"text-muted-foreground",children:t.email??"Anyone with the link"}),e.jsx(x,{className:"capitalize",children:t.role}),e.jsx(x,{className:"text-muted-foreground",children:t.createdBy?t.createdBy.name||t.createdBy.email:"—"}),e.jsx(x,{className:"text-muted-foreground",children:_(t.expiresAt)}),m&&e.jsx(x,{className:"text-right",children:n.includes(t.role)&&e.jsx(h,{variant:"ghost",size:"sm","aria-label":`Revoke the invite for ${t.email??"anyone with the link"}`,disabled:l.isPending&&l.variables===t.id,onClick:()=>l.mutate(t.id),children:"Revoke"})})]},t.id))})]})})]})}function De({m:s,owner:n}){const l=ve(),m=be(),[t,d]=j.useState(!1);return e.jsxs(f,{children:[e.jsx(x,{children:e.jsxs("span",{className:"flex items-center gap-2.5",children:[e.jsx(le,{className:"size-6",children:e.jsx(re,{className:"bg-brand-soft text-[10px] font-semibold text-brand",children:ge(s.name,s.email)})}),e.jsx("span",{className:"font-medium",children:s.name||s.email}),s.you&&e.jsx(oe,{variant:"outline",className:"text-[11px]",children:"you"})]})}),e.jsx(x,{className:"text-muted-foreground",children:s.email}),e.jsx(x,{children:n?e.jsx(z,{"aria-label":`Role for ${s.email}`,value:s.role,onChange:r=>l.mutate({email:s.email,role:r.target.value}),children:v.map(r=>e.jsx("option",{value:r,children:b[r]},r))}):e.jsx("span",{className:"capitalize",children:s.role})}),n&&e.jsxs(x,{className:"text-right",children:[!s.you&&e.jsx(h,{variant:"ghost",size:"icon-sm","aria-label":`Remove ${s.email}`,onClick:()=>d(!0),children:e.jsx(de,{})}),e.jsx(he,{open:t,onOpenChange:d,title:`Remove ${s.name||s.email}?`,description:"Every session of theirs ends now. Nothing they wrote is destroyed.",confirmLabel:"Remove",busy:m.isPending,onConfirm:()=>{d(!1),m.mutate(s.email)}})]})]})}const Ee=Z({email:se([te(""),ie().trim().email("An email address, or leave it empty")]),role:ee(v)});function Le({open:s,onOpenChange:n,mail:l,roles:m}){const t=Ne(),d=we(),[r,o]=j.useState(""),[i,u]=j.useState(null),[y,N]=j.useState(null),{register:w,handleSubmit:F,formState:p,reset:H,watch:q}=ae({resolver:ne(Ee),defaultValues:{role:"member",email:""}}),G=q("role"),g=a=>{n(a),a||(u(null),N(null),o(""),d.reset(),H())},V=F(async a=>{o("");try{u(await t.mutateAsync({role:a.role,...a.email?{email:a.email}:{}}))}catch(K){o(k(K))}}),Y=async()=>{if(i){o("");try{N((await d.mutateAsync({id:i.invite.id,token:i.token})).to)}catch(a){o(k(a))}}},J=(i?.mail??l)&&!!i?.invite.email;return e.jsx(me,{open:s,onOpenChange:g,children:e.jsx(ce,{children:i?e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs(R,{children:[e.jsx(A,{children:"Invite link"}),e.jsxs(I,{children:[i.invite.email?`${i.invite.email} can`:"Anyone with this link can"," join as ",X(i.invite.role)," ","until ",_(i.invite.expiresAt),". It works once, and this is the only time it is shown."]})]}),r&&e.jsx("p",{role:"alert",className:"m-0 rounded-md border border-destructive/40 bg-warn-soft px-3 py-2 text-[13px] text-destructive",children:r}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"min-w-0 flex-1 truncate rounded-md bg-muted px-2 py-1.5 font-mono text-[12px]","data-testid":"invite-url",children:i.url}),e.jsx(ue,{text:i.url,label:"Copy link",withText:!0})]}),J&&(y?e.jsxs("p",{role:"status",className:"m-0 text-[13px] text-muted-foreground",children:["Sent to ",y,"."]}):e.jsxs(h,{type:"button",variant:"outline",className:"self-start",loading:d.isPending,onClick:()=>void Y(),children:[e.jsx(Se,{}),d.isPending?"Sending…":`Send by email to ${i.invite.email}`]})),e.jsx(D,{children:e.jsx(h,{type:"button",onClick:()=>g(!1),children:"Done"})})]}):e.jsxs("form",{onSubmit:V,className:"flex flex-col gap-4",noValidate:!0,children:[e.jsxs(R,{children:[e.jsx(A,{children:"Invite someone"}),e.jsx(I,{children:"You get a link to send them. Whoever opens it chooses their own name and password, and is signed in. It works once and lasts seven days."})]}),r&&e.jsx("p",{role:"alert",className:"m-0 rounded-md border border-destructive/40 bg-warn-soft px-3 py-2 text-[13px] text-destructive",children:r}),e.jsxs("fieldset",{disabled:p.isSubmitting,className:"m-0 flex min-w-0 flex-col gap-4 border-0 p-0",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(E,{htmlFor:"invite-role",children:"Role"}),e.jsx(z,{id:"invite-role",className:"w-full",...w("role"),children:["member","admin","owner"].filter(a=>m.includes(a)).map(a=>e.jsx("option",{value:a,children:b[a]},a))}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground","data-testid":"invite-role-summary",children:M[G]??""})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs(E,{htmlFor:"invite-email",children:["Email ",e.jsx("span",{className:"font-normal text-muted-foreground",children:"optional"})]}),e.jsx(xe,{id:"invite-email",type:"email",autoComplete:"off","aria-invalid":!!p.errors.email,...w("email")}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:p.errors.email?.message??(l?"Given, only that address can use the link, and you can mail it to them.":"Given, only that address can use the link.")})]}),e.jsxs(D,{children:[e.jsx(h,{type:"button",variant:"outline",onClick:()=>g(!1),children:"Cancel"}),e.jsx(h,{type:"submit",loading:p.isSubmitting,children:p.isSubmitting?"Creating…":"Create invite"})]})]})]})})})}const Xe=()=>L(O().user.role,"settings")?e.jsx(Re,{}):e.jsx(pe,{title:"Members"});export{Xe as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,
|
|
1
|
+
import{r as i,i as ae,ab as re,e as se,a9 as ie,E as ne,k as M,j as f,ac as oe,h as de}from"./index-B1JGVSdd.js";import{f as ce,e as le,h as ue,j as fe,u as pe,A as he,k as be,l as ge,c as me,n as ve}from"./label-C6rZlF0y.js";import{L as ke,M as xe}from"./dialog-CvU77XfW.js";import{u as we}from"./useAriaLabelledBy-BDqDB_Wq.js";import{u as ye}from"./useValueChanged-B9j_H2Sq.js";const j=i.createContext(void 0);function Ce(){const r=i.useContext(j);if(r===void 0)throw new Error(ae(63));return r}const D={...ce,checked(r){return r?{"data-checked":""}:{"data-unchecked":""}}},Re=i.forwardRef(function(s,o){const{checked:k,className:F,defaultChecked:x,"aria-labelledby":m,form:p,id:L,inputRef:T,name:w,nativeButton:h=!1,onCheckedChange:V,readOnly:d=!1,required:b=!1,disabled:N=!1,render:ze,uncheckedValue:y,value:C,style:Ee,...A}=s,{clearErrors:H}=le(),{state:R,setTouched:q,setDirty:O,validityData:W,setFilled:v,setFocused:P,validationMode:J,disabled:U,name:Y,validation:c}=ue(),{labelId:_}=fe(),t=U||N,l=Y??w,n=i.useRef(null),G=re(n,T,c.inputRef),g=i.useRef(null),z=pe(),E=he({id:L,implicit:!1,controlRef:g}),B=h?void 0:E,[a,K]=be({controlled:k,default:!!x,name:"Switch",state:"checked"});ge(g,z,a,void 0,!t,w),se(()=>{n.current&&v(n.current.checked)},[v]),ye(a,()=>{H(l),O(a!==W.initialValue),v(a),c.change(a)});const{getButtonProps:Q,buttonRef:X}=ie({disabled:t,native:h}),Z=we(m,_,n,!h,B),$={id:h?E:z,role:"switch","aria-checked":a,"aria-readonly":d||void 0,"aria-required":b||void 0,"aria-labelledby":Z,onFocus(){t||P(!0)},onBlur(){const e=n.current;!e||t||(q(!0),P(!1),J==="onBlur"&&c.commit(e.checked))},onClick(e){if(d||t)return;e.preventDefault();const u=n.current;u&&oe(u,e)}},ee={...c.getValidationProps(t),checked:a,disabled:t,form:p,id:B,name:l,required:b,style:l?ke:xe,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:G,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(d){e.preventDefault();return}const u=e.currentTarget.checked,S=me(ve,e.nativeEvent);V?.(u,S),!S.isCanceled&&K(u)},onClick(e){e.stopPropagation()},onFocus(){g.current?.focus()},...C!==void 0?{value:C}:ne},I=i.useMemo(()=>({...R,checked:a,disabled:t,readOnly:d,required:b}),[R,a,t,d,b]),te=M("span",s,{state:I,ref:[o,g,X],props:[$,A,Q,e=>c.getValidationProps(t,e)],stateAttributesMapping:D});return f.jsxs(j.Provider,{value:I,children:[te,!a&&l&&y!==void 0&&f.jsx("input",{type:"hidden",form:p,name:l,value:y,disabled:t}),f.jsx("input",{...ee,suppressHydrationWarning:!0})]})}),Pe=i.forwardRef(function(s,o){const{render:k,className:F,style:x,...m}=s,p=Ce();return M("span",s,{state:p,ref:o,stateAttributesMapping:D,props:m})});function De({className:r,size:s="default",...o}){return f.jsx(Re,{"data-slot":"switch","data-size":s,className:de("peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent transition-all outline-none group-has-[:focus-visible]/field-label:border-transparent group-has-[:focus-visible]/field-label:ring-0 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 data-disabled:cursor-not-allowed data-disabled:opacity-50",r),...o,children:f.jsx(Pe,{"data-slot":"switch-thumb",className:"pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] dark:data-checked:bg-primary-foreground group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 dark:data-unchecked:bg-foreground"})})}export{De as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t,
|
|
1
|
+
import{j as t,h as l}from"./index-B1JGVSdd.js";function o({className:a,...e}){return t.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:t.jsx("table",{"data-slot":"table",className:l("w-full caption-bottom text-sm",a),...e})})}function r({className:a,...e}){return t.jsx("thead",{"data-slot":"table-header",className:l("[&_tr]:border-b",a),...e})}function d({className:a,...e}){return t.jsx("tbody",{"data-slot":"table-body",className:l("[&_tr:last-child]:border-0",a),...e})}function n({className:a,...e}){return t.jsx("tr",{"data-slot":"table-row",className:l("border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted",a),...e})}function b({className:a,...e}){return t.jsx("th",{"data-slot":"table-head",className:l("h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0",a),...e})}function c({className:a,...e}){return t.jsx("td",{"data-slot":"table-cell",className:l("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0",a),...e})}export{o as T,r as a,n as b,b as c,d,c as e};
|
package/static/dashboard/assets/{useAriaLabelledBy-Ce10PDSC.js → useAriaLabelledBy-BDqDB_Wq.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as u,
|
|
1
|
+
import{r as u,e as l}from"./index-B1JGVSdd.js";import{u as c}from"./label-C6rZlF0y.js";function y(e,n,t,r=!0,i){const[a,d]=u.useState(),f=c(i?`${i}-label`:void 0),o=e??n??a;return l(()=>{const s=e||n||!r?void 0:L(t.current,f);a!==s&&d(s)}),o}function L(e,n){const t=b(e);if(t)return!t.id&&n&&(t.id=n),t.id||void 0}function b(e){if(!e)return;const n=e.parentElement;if(n&&n.tagName==="LABEL")return n;const t=e.id;if(t){const i=e.nextElementSibling;if(i&&i.htmlFor===t)return i}const r=e.labels;return r&&r[0]}export{y as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{b2 as N,b3 as h,b4 as O,b5 as U,b6 as k,b7 as B,b8 as A,b9 as y,ba as H,bb as V,bc as M,bd as x,r as p,be as F,d as W}from"./index-B1JGVSdd.js";var st=class extends N{#e;#t=void 0;#f=void 0;#s=void 0;#n;#c;#i;#p;#u;#l;#a;#o;#r;#d=new Set;constructor(t,e){super(),this.options=e,this.#e=t,this.#i=null,this.bindMethods(),this.setOptions(e)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Q(this.#t,this.options)?this.#h():this.updateResult(),this.#S())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return E(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return E(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#m(),this.#g(),this.#t.removeObserver(this)}setOptions(t){const e=this.options,s=this.#t;if(this.options=this.#e.defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof h(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#O(),this.#t.setOptions(this.options),e._defaulted&&!O(this.options,e)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const i=this.hasListeners();i&&P(this.#t,s,this.options,e)&&this.#h(),this.updateResult(),i&&(this.#t!==s||h(this.options.enabled,this.#t)!==h(e.enabled,this.#t)||h(this.options.staleTime,this.#t)!==h(e.staleTime,this.#t))&&this.#R();const r=this.#v();i&&(this.#t!==s||h(this.options.enabled,this.#t)!==h(e.enabled,this.#t)||r!==this.#r)&&this.#y(r)}getOptimisticResult(t){const e=this.#e.getQueryCache().build(this.#e,t),s=this.createResult(e,t);return O(this.getCurrentResult(),s)||(this.#s=s,this.#c=this.options,this.#n=this.#t.state),s}getCurrentResult(){return this.#s}trackResult(t,e){return new Proxy(t,{get:(s,i)=>(this.trackProp(i),e?.(i),Reflect.get(s,i))})}trackProp(t){this.#d.add(t)}getCurrentQuery(){return this.#t}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=this.#e.defaultQueryOptions(t),s=this.#e.getQueryCache().build(this.#e,e);let i=()=>{},r;const c=new Promise(a=>{r=a,i=this.#e.getQueryCache().subscribe(u=>{u.type==="updated"&&u.query.queryHash===s.queryHash&&s.state.data!==void 0&&(i(),a(this.createResult(s,e)))})});return Promise.race([s.fetch().then(()=>{const a=this.createResult(s,e);return r?.(a),a}).finally(()=>{i()}),c])}fetch(t){return this.#h({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#s))}#h(t){this.#O();let e=this.#t.fetch(this.options,t);return t?.throwOnError||(e=e.catch(U)),e}#b(t){return!k()&&h(this.options.enabled,this.#t)!==!1&&B(t)}#R(){this.#m();const t=h(this.options.staleTime,this.#t);if(this.#s.isStale||!this.#b(t))return;const e=A(this.#s.dataUpdatedAt,t)+1;this.#a=y.setTimeout(()=>{this.#s.isStale||this.updateResult()},e)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#y(t){this.#g(),this.#r=t,!(this.#r===0||!this.#b(this.#r))&&(this.#o=y.setInterval(()=>{(this.options.refetchIntervalInBackground||H.isFocused())&&this.#h()},this.#r))}#S(){this.#R(),this.#y(this.#v())}#m(){this.#a!==void 0&&(y.clearTimeout(this.#a),this.#a=void 0)}#g(){this.#o!==void 0&&(y.clearInterval(this.#o),this.#o=void 0)}createResult(t,e){const s=this.#t,i=this.options,r=this.#s,c=this.#n,a=this.#c,u=t!==s?t.state:this.#f,{state:l}=t;let n={...l},d=!1,o;if(e._optimisticResults){const f=this.hasListeners(),D=!f&&Q(t,e),L=f&&P(t,s,e,i);(D||L)&&(n={...n,...V(l.data,t.options)}),e._optimisticResults==="isRestoring"&&(n.fetchStatus="idle")}let{error:R,errorUpdatedAt:v,status:b}=n;o=n.data;let I=!1;if(e.placeholderData!==void 0&&o===void 0&&b==="pending"){let f;r?.isPlaceholderData&&e.placeholderData===a?.placeholderData?(f=r.data,I=!0):f=typeof e.placeholderData=="function"?e.placeholderData(this.#l?.state.data,this.#l):e.placeholderData,f!==void 0&&(b="success",o=M(r?.data,f,e),d=!0)}if(e.select&&o!==void 0&&!I)if(r&&o===c?.data&&e.select===this.#p)o=this.#u;else try{this.#p=e.select,o=e.select(o),o=M(r?.data,o,e),this.#u=o,this.#i=null}catch(f){this.#i=f}else o===void 0&&(this.#i=null);this.#i&&(R=this.#i,o=this.#u,v=Date.now(),b="error",d=!1);const S=n.fetchStatus==="fetching",m=b==="pending",g=b==="error",T=m&&S,w=o!==void 0;return{status:b,fetchStatus:n.fetchStatus,isPending:m,isSuccess:b==="success",isError:g,isInitialLoading:T,isLoading:T,data:o,dataUpdatedAt:n.dataUpdatedAt,error:R,errorUpdatedAt:v,failureCount:n.fetchFailureCount,failureReason:n.fetchFailureReason,errorUpdateCount:n.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:n.dataUpdateCount>u.dataUpdateCount||n.errorUpdateCount>u.errorUpdateCount,isFetching:S,isRefetching:S&&!m,isLoadingError:g&&!w,isPaused:n.fetchStatus==="paused",isPlaceholderData:d,isRefetchError:g&&w,isStale:C(t,e),refetch:this.refetch,isEnabled:h(e.enabled,t)!==!1}}updateResult(){const t=this.#s,e=this.createResult(this.#t,this.options);if(this.#n=this.#t.state,this.#c=this.options,this.#n.data!==void 0&&(this.#l=this.#t),O(e,t))return;this.#s=e;const i=(()=>{if(!t)return!0;const{notifyOnChangeProps:r}=this.options,c=typeof r=="function"?r():r;if(c==="all"||!c&&!this.#d.size)return!0;const a=new Set(c??this.#d);return this.options.throwOnError&&a.add("error"),Object.keys(this.#s).some(u=>{const l=u;return this.#s[l]!==t[l]&&a.has(l)})})();x.batch(()=>{i&&this.listeners.forEach(r=>{r(this.#s)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}#O(){const t=this.#e.getQueryCache().build(this.#e,this.options);if(t===this.#t)return;const e=this.#t;this.#t=t,this.#f=t.state,this.hasListeners()&&(e?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#S()}};function j(t,e){return h(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&h(e.retryOnMount,t)===!1)}function Q(t,e){return j(t,e)||t.state.data!==void 0&&E(t,e,e.refetchOnMount)}function E(t,e,s){if(h(e.enabled,t)!==!1&&h(e.staleTime,t)!=="static"){const i=typeof s=="function"?s(t):s;return i==="always"||i!==!1&&C(t,e)}return!1}function P(t,e,s,i){return(t!==e||h(i.enabled,t)===!1)&&(!s.suspense||t.state.status!=="error")&&C(t,s)}function C(t,e){return h(e.enabled,t)!==!1&&t.isStaleByTime(h(e.staleTime,t))}const _=p.createContext(!1),z=()=>p.useContext(_);_.Provider;function K(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}const G=p.createContext(K()),J=()=>p.useContext(G),X=(t,e,s)=>{const i=s?.state.error&&typeof t.throwOnError=="function"?F(t.throwOnError,[s.state.error,s]):t.throwOnError;(t.suspense||i)&&(e.isReset()||(t.retryOnMount=!1))},Y=t=>{p.useEffect(()=>{t.clearReset()},[t])},Z=({result:t,errorResetBoundary:e,throwOnError:s,query:i,suspense:r})=>t.isError&&!e.isReset()&&!t.isFetching&&i&&(r&&t.data===void 0||F(s,[t.error,i])),it=(t,e)=>e.state.data===void 0,$=t=>{if(t.suspense){const s=r=>r==="static"?r:Math.max(r??1e3,1e3),i=t.staleTime;t.staleTime=typeof i=="function"?(...r)=>s(i(...r)):s(i),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},q=(t,e)=>t?.suspense&&e.isPending,tt=(t,e,s)=>e.fetchOptimistic(t).catch(()=>{s.clearReset()});function rt(t,e,s){const i=z(),r=J(),c=W(),a=c.defaultQueryOptions(t),u=c.getQueryCache().get(a.queryHash),l=t.subscribed!==!1;a._optimisticResults=i?"isRestoring":l?"optimistic":void 0,$(a),X(a,r,u),Y(r);const[n]=p.useState(()=>new e(c,a)),d=n.getOptimisticResult(a),o=!i&&l;if(p.useSyncExternalStore(p.useCallback(R=>{const v=o?n.subscribe(x.batchCalls(R)):U;return n.updateResult(),v},[n,o]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),p.useEffect(()=>{n.setOptions(a)},[a,n]),q(a,d))throw tt(a,n,r);if(Z({result:d,errorResetBoundary:r,throwOnError:a.throwOnError,query:u,suspense:a.suspense}))throw d.error;return a.notifyOnChangeProps?d:n.trackResult(d)}export{st as Q,it as d,rt as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as r,Q as u}from"./useBaseQuery-DXKWEN1Y.js";function a(e,s){return r(e,u)}export{a as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{k as n}from"./index-B1JGVSdd.js";function u(e){return n(e.defaultTagName??"div",e,e)}export{u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s,
|
|
1
|
+
import{r as s,f as c,e as n}from"./index-B1JGVSdd.js";function u(e,r){const t=s.useRef(e),a=c(r);n(()=>{t.current!==e&&a(t.current),t.current=e},[e,a])}export{u};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{c as
|
|
1
|
+
import{c as A,N as E,p as F,d as B,r as l,j as e,G as L,h as k,B as n,s as w,z as x,C as S}from"./index-B1JGVSdd.js";import{C as f}from"./card-CCRzd-vJ.js";import{L as C,I as q}from"./label-C6rZlF0y.js";import{I as P}from"./InstallTag-SMFR2B0h.js";import{C as R}from"./check-CvTMcsU6.js";import{A as z}from"./arrow-left-CDK8KGdH.js";import"./copy-CwAe5Q6l.js";/**
|
|
2
2
|
* @license lucide-react v1.39.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const T=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],j=
|
|
6
|
+
*/const T=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],j=A("arrow-right",T);/**
|
|
7
7
|
* @license lucide-react v1.39.0 - ISC
|
|
8
8
|
*
|
|
9
9
|
* This source code is licensed under the ISC license.
|
|
10
10
|
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const _=[["path",{d:"M5.8 11.3 2 22l10.7-3.79",key:"gwxi1d"}],["path",{d:"M4 3h.01",key:"1vcuye"}],["path",{d:"M22 8h.01",key:"1mrtc2"}],["path",{d:"M15 2h.01",key:"1cjtqr"}],["path",{d:"M22 20h.01",key:"1mrys2"}],["path",{d:"m22 2-2.24.75a2.9 2.9 0 0 0-1.96 3.12c.1.86-.57 1.63-1.45 1.63h-.38c-.86 0-1.6.6-1.76 1.44L14 10",key:"hbicv8"}],["path",{d:"m22 13-.82-.33c-.86-.34-1.82.2-1.98 1.11c-.11.7-.72 1.22-1.43 1.22H17",key:"1i94pl"}],["path",{d:"m11 2 .33.82c.34.86-.2 1.82-1.11 1.98C9.52 4.9 9 5.52 9 6.23V7",key:"1cofks"}],["path",{d:"M11 13c1.93 1.93 2.83 4.17 2 5-.83.83-3.07-.07-5-2-1.93-1.93-2.83-4.17-2-5 .83-.83 3.07.07 5 2Z",key:"4kbmks"}]],G=
|
|
11
|
+
*/const _=[["path",{d:"M5.8 11.3 2 22l10.7-3.79",key:"gwxi1d"}],["path",{d:"M4 3h.01",key:"1vcuye"}],["path",{d:"M22 8h.01",key:"1mrtc2"}],["path",{d:"M15 2h.01",key:"1cjtqr"}],["path",{d:"M22 20h.01",key:"1mrys2"}],["path",{d:"m22 2-2.24.75a2.9 2.9 0 0 0-1.96 3.12c.1.86-.57 1.63-1.45 1.63h-.38c-.86 0-1.6.6-1.76 1.44L14 10",key:"hbicv8"}],["path",{d:"m22 13-.82-.33c-.86-.34-1.82.2-1.98 1.11c-.11.7-.72 1.22-1.43 1.22H17",key:"1i94pl"}],["path",{d:"m11 2 .33.82c.34.86-.2 1.82-1.11 1.98C9.52 4.9 9 5.52 9 6.23V7",key:"1cofks"}],["path",{d:"M11 13c1.93 1.93 2.83 4.17 2 5-.83.83-3.07-.07-5-2-1.93-1.93-2.83-4.17-2-5 .83-.83 3.07.07 5 2Z",key:"4kbmks"}]],G=A("party-popper",_),I=["Site","Address","Install"];function J(){const{me:D,site:r}=E.useRouteContext(),b=F(),o=B(),[a,c]=l.useState(0),[d,K]=l.useState(r.name==="First project"?"":r.name),[h,M]=l.useState(""),[i,u]=l.useState(!1),[m,y]=l.useState(!1),[v,p]=l.useState(""),Q=async()=>{u(!0),y(!0),p("");try{await w.deleteSite(r.uid),o.removeQueries({queryKey:["origins",r.uid]}),await o.invalidateQueries({queryKey:x.me().queryKey}),await o.fetchQuery(x.me()),b({to:"/sites",replace:!0})}catch(t){p(t instanceof S?t.message:"Something went wrong. Try again."),u(!1),y(!1)}},N=async(t,s)=>{u(!0),p("");try{await w.editSite(r.uid,t),t.domain&&o.setQueryData(x.origins(r.uid).queryKey,{domain:t.domain,origins:[]}),await o.invalidateQueries({queryKey:x.me().queryKey}),await o.fetchQuery(x.me()),s()}catch(g){p(g instanceof S?g.message:"Could not reach the server.")}finally{u(!1)}};return e.jsx("div",{className:"relative min-h-dvh bg-background",children:e.jsxs(L,{width:600,children:[e.jsxs("div",{className:"absolute right-6 top-5 text-[12.5px] text-muted-foreground",children:["Signed in as ",D.user.email]}),a<3&&e.jsx("ol",{className:"m-0 mb-6 flex list-none items-center gap-3.5 p-0","aria-label":"Steps",children:I.map((t,s)=>e.jsxs("li",{className:"flex items-center gap-2.5 text-[13.5px] font-medium",children:[e.jsx("span",{className:k("flex size-7 items-center justify-center rounded-full border-[1.5px] text-[12.5px]",s<a&&"border-brand bg-brand text-brand-foreground",s===a&&"border-brand text-brand ring-[3px] ring-brand-soft",s>a&&"border-line-strong text-muted-foreground"),"aria-current":s===a?"step":void 0,children:s<a?e.jsx(R,{className:"size-3.5"}):s+1}),e.jsx("span",{className:s===a?"text-foreground":"text-muted-foreground",children:t}),s<I.length-1&&e.jsx("span",{className:k("h-px w-[90px]",s<a?"bg-brand":"bg-border")})]},t))}),v&&e.jsx("p",{role:"alert",className:"m-0 mb-4 rounded-md border border-destructive/40 bg-warn-soft px-3 py-2 text-[13px] text-destructive",children:v}),a===0&&e.jsx(f,{className:"gap-4 p-7",children:e.jsxs("form",{className:"flex flex-col gap-4",onSubmit:t=>{t.preventDefault(),!(!d.trim()||i)&&N({name:d.trim()},()=>c(1))},children:[e.jsxs("div",{children:[e.jsx("h1",{className:"m-0 text-[21px] font-semibold leading-tight tracking-tight",children:"What is the site called?"}),e.jsx("p",{className:"m-0 mt-2 text-muted-foreground",children:"One client website. You can add more from Sites later."})]}),e.jsxs("fieldset",{disabled:i,className:"m-0 flex min-w-0 flex-col gap-4 border-0 p-0",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(C,{htmlFor:"first-name",children:"Name"}),e.jsx(q,{id:"first-name",placeholder:"Kilnwork",value:d,onChange:t=>K(t.target.value),autoFocus:!0})]}),e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx(n,{type:"button",variant:"ghost",loading:m,disabled:i&&!m,onClick:()=>void Q(),children:"Skip for now"}),e.jsxs(n,{type:"submit",loading:i&&!m,disabled:!d.trim()||m,children:[i&&!m?"Saving…":"Continue",e.jsx(j,{})]})]})]}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"No site yet? Skip, and add one from Sites when it is ready."})]})}),a===1&&e.jsx(f,{className:"gap-4 p-7",children:e.jsxs("form",{className:"flex flex-col gap-4",onSubmit:t=>{t.preventDefault(),!(!h.trim()||i)&&N({domain:h.trim()},()=>c(2))},children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"m-0 text-[21px] font-semibold leading-tight tracking-tight",children:["Where does ",d||r.name," live?"]}),e.jsx("p",{className:"m-0 mt-2 text-muted-foreground",children:"Its domain. Every subdomain, scheme and port of it may run the widget — staging, previews, and localhost while you build. Exact addresses elsewhere can be added in the site's settings."})]}),e.jsxs("fieldset",{disabled:i,className:"m-0 flex min-w-0 flex-col gap-4 border-0 p-0",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(C,{htmlFor:"first-domain",children:"Domain"}),e.jsx(q,{id:"first-domain",placeholder:"kilnwork.studio",value:h,onChange:t=>M(t.target.value),autoFocus:!0})]}),e.jsxs("div",{className:"flex items-center",children:[e.jsxs(n,{type:"button",variant:"ghost",onClick:()=>c(0),children:[e.jsx(z,{}),"Back"]}),e.jsx("div",{className:"flex-1"}),e.jsxs(n,{type:"submit",loading:i,disabled:!h.trim(),children:[i?"Saving…":"Continue",e.jsx(j,{})]})]})]})]})}),a===2&&e.jsxs(f,{className:"gap-4 p-7",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"m-0 text-[21px] font-semibold leading-tight tracking-tight",children:"Install the widget"}),e.jsxs("p",{className:"m-0 mt-2 text-muted-foreground",children:["Paste this before ",e.jsx("code",{className:"font-mono",children:"</body>"})," on every page you want reviewed, and deploy."]})]}),e.jsx(P,{uid:r.uid}),e.jsxs("div",{className:"flex items-center",children:[e.jsxs(n,{type:"button",variant:"ghost",onClick:()=>c(1),children:[e.jsx(z,{}),"Back"]}),e.jsx("div",{className:"flex-1"}),e.jsxs(n,{type:"button",onClick:()=>c(3),children:["Done",e.jsx(j,{})]})]})]}),a===3&&e.jsxs(f,{className:"items-center gap-4 p-8 text-center",children:[e.jsx("span",{className:"flex size-11 items-center justify-center rounded-[10px] bg-brand-soft text-brand",children:e.jsx(G,{className:"size-5"})}),e.jsxs("h1",{className:"m-0 text-[21px] font-semibold leading-tight tracking-tight",children:[d||r.name," is set up"]}),e.jsx("p",{className:"m-0 text-muted-foreground",children:"Three things left, in this order."}),e.jsx("ol",{className:"m-0 flex w-full list-none flex-col gap-2 p-0 text-left",children:[["Deploy the site with the tag on every page","Comments start arriving here the moment a page loads it."],["Add a reviewer and send them their link","Your client gets their own link; you can revoke it without touching the site."],["Start the first round","A round is one pass of feedback. Starting the next one closes the last."]].map(([t,s],g)=>e.jsxs("li",{className:"flex gap-3 rounded-md border border-border px-3 py-2.5",children:[e.jsx("span",{className:"flex size-5 shrink-0 items-center justify-center rounded-full border border-line-strong text-[11px] text-muted-foreground",children:g+1}),e.jsxs("span",{children:[e.jsx("span",{className:"block text-[13px] font-medium",children:t}),e.jsx("span",{className:"block text-[12px] text-muted-foreground",children:s})]})]},t))}),e.jsxs(n,{size:"lg",className:"mt-2 w-full",onClick:()=>void b({to:"/s/$site/comments",params:{site:r.uid},replace:!0}),children:["Go to Comments",e.jsx(j,{})]})]})]})})}export{J as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{P as h,r as x,j as e,B as a,G as N,s as y,Q as b}from"./index-B1JGVSdd.js";const S=`${b}session`;function E(){const{project:o,origin:t,env:g}=h.useSearch(),{me:n}=h.useRouteContext(),[l,d]=x.useState(""),[f,u]=x.useState(!1),i=n.projects.find(s=>s.uid===o),m=typeof window<"u"?window.opener:null,r=()=>window.close();if(!o||!t||!m)return e.jsx(c,{title:"Nothing to sign in to",children:e.jsxs("p",{className:"m-0 text-muted-foreground",children:["This window is opened by the comment box on a site you are reviewing. Open it from there — choose"," ",e.jsx("em",{children:"Studio member? Sign in"})," — and it will ask you here."]})});if(!i)return e.jsxs(c,{title:"Not one of this studio's sites",children:[e.jsxs("p",{className:"m-0 text-muted-foreground",children:["You are signed in to ",n.org.name,", and that site is not one of its sites. If it belongs to another studio you are in, switch to it in the dashboard and try again."]}),e.jsx(a,{variant:"outline",onClick:r,children:"Close"})]});const p=async()=>{d(""),u(!0);try{const s=await y.memberSession(i.uid,t,g);if(s.origin!==t)throw new Error("The address changed while signing in. Try again from the site.");const{origin:j,...w}=s;m.postMessage({type:S,session:w},j),r()}catch(s){d(s instanceof Error?s.message:"Could not reach the server."),u(!1)}};return e.jsxs(c,{title:`Sign in to ${i.name}`,children:[e.jsxs("p",{className:"m-0 text-muted-foreground",children:["Comment on ",e.jsx("span",{className:"font-medium text-foreground",children:t})," as"," ",e.jsx("span",{className:"font-medium text-foreground",children:n.user.name||n.user.email}),", from ",n.org.name,". Your comments there and your replies here will be one author."]}),l&&e.jsx("p",{role:"alert",className:"m-0 rounded-md border border-destructive/40 bg-warn-soft px-3 py-2 text-[13px] text-destructive",children:l}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(a,{size:"lg",className:"flex-1",loading:f,onClick:()=>void p(),children:"Continue"}),e.jsx(a,{size:"lg",variant:"outline",onClick:r,children:"Cancel"})]})]})}function c({title:o,children:t}){return e.jsx(N,{children:e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("h1",{className:"m-0 text-[22px] font-semibold tracking-tight",children:o}),t]})})}export{E as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r,w as b,j as e,h as y,x as N,B as j,q as f,Z as S}from"./index-B1JGVSdd.js";import{L as c,I as d}from"./label-C6rZlF0y.js";import{P as C,a as h}from"./parts-sBoh2K5o.js";import{S as P}from"./SaveState-Cmf4iv03.js";import{M as A}from"./McpTokens-BXqxvFAS.js";import{u as k}from"./labels-DhKmOzOU.js";import{u as M,a as F}from"./studio-DdM6OVdO.js";import{M as E,S as T,a as D}from"./sun-DojiLt7X.js";import"./card-CCRzd-vJ.js";import"./useQuery-BCK_zdLj.js";import"./useBaseQuery-DXKWEN1Y.js";import"./badge-BD0L3Rdr.js";import"./useRender-hAtJO9As.js";import"./dialog-CvU77XfW.js";import"./switch-SJYZN0-3.js";import"./useAriaLabelledBy-BDqDB_Wq.js";import"./useValueChanged-B9j_H2Sq.js";import"./ConfirmDialog-D2seMnrm.js";import"./CopyButton-Bc4lyikk.js";import"./check-CvTMcsU6.js";import"./copy-CwAe5Q6l.js";function z({items:t}){const[a,n]=r.useState(b);return e.jsx("div",{className:"flex gap-2",role:"radiogroup","aria-label":"Theme",children:t.map(s=>e.jsxs("button",{type:"button",role:"radio","aria-checked":a===s.value,onClick:()=>{N(s.value),n(s.value)},className:y("inline-flex h-7 items-center gap-1.5 rounded-md border border-border bg-card px-2.5 text-[12.5px] font-medium text-ink-soft",a===s.value&&"border-line-strong bg-muted text-foreground"),children:[s.icon,s.label]},s.value))})}function ae(){const t=k(),a=M(),[n,s]=r.useState(t.user.name),[u,i]=r.useState(null);r.useEffect(()=>s(t.user.name),[t.user.name]);const m=n.trim()!==t.user.name;return e.jsxs("div",{className:"flex flex-col gap-10 p-7",children:[e.jsx(C,{title:"You",sub:"Your own account on this studio",actions:e.jsx(P,{saving:a.isPending,savedAt:u})}),e.jsxs(h,{title:"Profile",description:"How you appear on replies and in the members list.",children:[e.jsxs("form",{className:"flex flex-col gap-1.5",onSubmit:l=>{l.preventDefault(),m&&a.mutate(n.trim(),{onSuccess:()=>i(Date.now())})},children:[e.jsx(c,{htmlFor:"your-name",children:"Name"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(d,{id:"your-name",value:n,onChange:l=>s(l.target.value)}),m&&e.jsx(j,{type:"submit",variant:"outline",children:"Save"})]})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(c,{htmlFor:"your-email",children:"Email"}),e.jsx(d,{id:"your-email",value:t.user.email,readOnly:!0,className:"bg-muted text-ink-soft"}),e.jsxs("p",{className:"m-0 text-[12px] text-muted-foreground",children:["How you sign in, and how the server finds you. An owner changes it with"," ",e.jsx("code",{className:"font-mono",children:"snagset passwd"}),"."]})]})]}),e.jsx(h,{title:"Password",description:"Changing it keeps this session and ends every other one.",children:e.jsx(H,{})}),!f(t.user.role,"settings")&&f(t.user.role,"review")&&e.jsx(A,{owner:!0,mine:!0,instanceOwner:!1,sites:t.projects}),e.jsx(h,{title:"Appearance",description:"Also in your menu at the bottom of the sidebar.",children:e.jsx(z,{items:[{value:"system",label:"System",icon:e.jsx(E,{className:"size-3.5"})},{value:"light",label:"Light",icon:e.jsx(T,{className:"size-3.5"})},{value:"dark",label:"Dark",icon:e.jsx(D,{className:"size-3.5"})}]})})]})}function H(){const t=F(),[a,n]=r.useState(""),[s,u]=r.useState(""),[i,m]=r.useState(""),[l,g]=r.useState(""),[w,p]=r.useState(!1),x=a.length>0&&s.length>=12&&s===i;return e.jsxs("form",{className:"flex flex-col gap-4",onSubmit:async o=>{if(o.preventDefault(),!(!x||t.isPending)){g("");try{await t.mutateAsync({current:a,next:s}),n(""),u(""),m(""),p(!0)}catch(v){g(S(v))}}},children:[l&&e.jsx("p",{role:"alert",className:"m-0 rounded-md border border-destructive/40 bg-warn-soft px-3 py-2 text-[13px] text-destructive",children:l}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(c,{htmlFor:"pw-current",children:"Current password"}),e.jsx(d,{id:"pw-current",type:"password",autoComplete:"current-password",value:a,onChange:o=>{n(o.target.value),p(!1)}})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(c,{htmlFor:"pw-next",children:"New password"}),e.jsx(d,{id:"pw-next",type:"password",autoComplete:"new-password",value:s,onChange:o=>{u(o.target.value),p(!1)}}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"At least 12 characters. No composition rules — length is what matters."})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(c,{htmlFor:"pw-again",children:"Confirm new password"}),e.jsx(d,{id:"pw-again",type:"password",autoComplete:"new-password",value:i,onChange:o=>{m(o.target.value),p(!1)}}),i.length>0&&s!==i&&e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"Those do not match yet."})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(j,{type:"submit",loading:t.isPending,disabled:!x,children:t.isPending?"Changing…":w&&!x?"Changed":"Change password"})})]})}export{ae as component};
|