@paperclipai/ui 2026.831.0 → 2026.831.1
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/assets/{CompanyExport-BkapGNc4.js → CompanyExport-Z_xz3qVA.js} +1 -1
- package/dist/assets/{dist-BT_-J9vH.js → dist-4YXWoKXj.js} +1 -1
- package/dist/assets/{dist-De1dLVWv.js → dist-B17jbIHX.js} +1 -1
- package/dist/assets/{dist-COkHxnM-.js → dist-BB2MrBPx.js} +1 -1
- package/dist/assets/{dist-BY8Ovukd.js → dist-BN3fNijI.js} +1 -1
- package/dist/assets/{dist-BIB8B5Yt.js → dist-BqvKUIYe.js} +1 -1
- package/dist/assets/{dist-ClHUjRaR.js → dist-C9mVZxup.js} +1 -1
- package/dist/assets/{dist-ypw5cJye.js → dist-CD2uEzoc.js} +1 -1
- package/dist/assets/{dist-aV8W0Cid.js → dist-CWdUvdQ_.js} +1 -1
- package/dist/assets/{dist-jE0s8Epb.js → dist-CezW8FxG.js} +1 -1
- package/dist/assets/{dist-yqWtMRTU.js → dist-CsmobXqG.js} +1 -1
- package/dist/assets/{dist-BFE4nrdb.js → dist-D3TaYMsE.js} +1 -1
- package/dist/assets/{dist-DfhA_362.js → dist-DB0TB3dq.js} +1 -1
- package/dist/assets/{dist-u9Xf4fZO.js → dist-DG5hSs6D.js} +1 -1
- package/dist/assets/{dist-v4lY6ztx.js → dist-DIY0IJrU.js} +1 -1
- package/dist/assets/{dist-D36tWFvq.js → dist-DIx3g1eJ.js} +1 -1
- package/dist/assets/{dist-d3LFhBWV.js → dist-DR2qMARL.js} +1 -1
- package/dist/assets/{dist-Bj22b5x0.js → dist-Dhyv0aAR.js} +1 -1
- package/dist/assets/{dist-CIaSSm62.js → dist-DnuNJVHx.js} +1 -1
- package/dist/assets/{dist-D8x7mYVS.js → dist-FVd0fwMU.js} +1 -1
- package/dist/assets/{dist-DammdbHg.js → dist-Sdv93IsT.js} +1 -1
- package/dist/assets/{dist-ephSgHpc.js → dist-h_v0c4US.js} +1 -1
- package/dist/assets/{dist-C8A1Q1Q2.js → dist-t8zfJs5a.js} +1 -1
- package/dist/assets/{dist-R-JSNxQc.js → dist-tokM-YcO.js} +1 -1
- package/dist/assets/{index-DXc1QDcn.js → index-BHbrFFmp.js} +100 -100
- package/dist/index.html +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{o as be}from"./rolldown-runtime-CPfWejcf.js";import{$n as Be,Di as ee,Dr as ze,Ki as De,Mi as ue,Mn as se,Ni as Z,et as _e,ir as Ue,lr as We,lt as qe,ma as Ke,pt as B,rr as G}from"./mention-chips-CbXq5njg.js";import{_t as pe,a as Ye,bt as Ze,c as fe,ct as Ge,d as Xe,dt as He,f as Ve,ft as Je,gt as Qe,h as he,ht as et,i as tt,l as st,lt as nt,m as rt,mt as X,n as ot,o as at,p as z,pt as it,r as ct,s as lt,t as we,u as dt,ut,vt as pt,yt as ft}from"./index-
|
|
1
|
+
import{o as be}from"./rolldown-runtime-CPfWejcf.js";import{$n as Be,Di as ee,Dr as ze,Ki as De,Mi as ue,Mn as se,Ni as Z,et as _e,ir as Ue,lr as We,lt as qe,ma as Ke,pt as B,rr as G}from"./mention-chips-CbXq5njg.js";import{_t as pe,a as Ye,bt as Ze,c as fe,ct as Ge,d as Xe,dt as He,f as Ve,ft as Je,gt as Qe,h as he,ht as et,i as tt,l as st,lt as nt,m as rt,mt as X,n as ot,o as at,p as z,pt as it,r as ct,s as lt,t as we,u as dt,ut,vt as pt,yt as ft}from"./index-BHbrFFmp.js";var h=be(Ke(),1),ht=["agents","projects","skills","routines","tasks","attachments"],mt={agents:"Agents",projects:"Projects",skills:"Skills",routines:"Routines",tasks:"Tasks",attachments:"Attachments"};function gt(){return{agents:!0,projects:!0,skills:!0,routines:!0,tasks:!0,attachments:!0}}function je(e){return e.tasks||e.routines}function ye(e){const o=new Set;for(const a of e){if(!a.recurring)continue;const n=a.path.trim();if(!n)continue;o.add(n);const r=n.lastIndexOf("/");r>=0&&o.add(`${n.slice(0,r+1)}`)}return o}function xt(e,o){for(const a of o)if(e===a||e.startsWith(a))return!0;return!1}function bt(e){const o=new Set,a=new Set;for(const n of e)for(const r of n.attachments??[]){const c=r.sha256.trim().toLowerCase();c&&(n.recurring?o:a).add(c)}return{recurring:o,oneOff:a}}var wt=new Set(["agents","projects","skills","routines","tasks"]);function jt(e){const o=new Map;for(const a of e){const n=a.sha256.trim().toLowerCase();if(!n)continue;const r=o.get(n)??new Set,c=a.ownedBy&&a.ownedBy.length>0?a.ownedBy:["always"];for(const u of c)r.add(u);o.set(n,r)}return o}function yt(e,o){for(const a of e)if(!wt.has(a)||o[a])return!0;return!1}function ve(e,o){return e.startsWith("agents/")?"agents":e.startsWith("projects/")?"projects":e.startsWith("skills/")?"skills":e.startsWith("tasks/")?xt(e,o)?"routines":"tasks":e.startsWith("blobs/")?"attachments":null}function vt(e,o){const a=ye(o),n={agents:0,projects:0,skills:0,routines:0,tasks:0,attachments:0};for(const r of e){const c=ve(r,a);c&&(n[c]+=1)}return n}function kt(e){const{filePaths:o,issues:a,categories:n}=e,r=ye(a),c=bt(a),u=jt(e.embeddedAssets??[]),p=n.attachments&&je(n),m=new Set;for(const l of o){const x=ve(l,r);if(x===null){m.add(l);continue}if(x==="attachments"){const i=l.slice(6).trim().toLowerCase(),g=u.get(i);if(g&&yt(g,n)){m.add(l);continue}if(!p)continue;const w=c.recurring.has(i),j=c.oneOff.has(i);!w&&!j?g||m.add(l):(j&&n.tasks||w&&n.routines)&&m.add(l);continue}n[x]&&m.add(l)}return m}function ke(e,o){if(!o.has(e))return o.add(e),e;let a=2;for(;;){const n=`${e}-${a}`;if(!o.has(n))return o.add(n),n;a+=1}}function St(e){const o=new Set,a=new Map,n=[...e].sort((r,c)=>r.name.localeCompare(c.name));for(const r of n){const c=ze(r.name)??"agent";a.set(r.id,ke(c,o))}return a}function Ct(e){const o=new Set,a=new Map,n=[...e].sort((r,c)=>r.name.localeCompare(c.name));for(const r of n){const c=We(r.name,r.name);a.set(r.id,ke(c,o))}return a}function Et(e){const o=St(e.agents),a=Ct(e.projects),n={agents:e.orderedAgents.map(r=>o.get(r.id)).filter(r=>!!r),projects:e.orderedProjects.map(r=>a.get(r.id)).filter(r=>!!r)};return n.agents.length>0||n.projects.length>0?n:void 0}var t=be(De(),1);function Se(e){const o=new Set,a=new Set,n=new Set;for(const r of e){const c=r.match(/^agents\/([^/]+)\//);c&&o.add(c[1]);const u=r.match(/^projects\/([^/]+)\//);u&&a.add(u[1]);const p=r.match(/^tasks\/([^/]+)\//);p&&n.add(p[1])}return{agents:o,projects:a,tasks:n,routines:new Set(n)}}function Nt(e,o){const a=Se(o),n=e.split(`
|
|
2
2
|
`),r=[],c=new Set(["agents","projects","tasks","routines"]),u=new Set(["agents","projects"]);let p=null,m=null,l=!0,x=null,i=null,g=[],w=null,j=[];function R(){i!==null&&g.length>0&&(j.push(i),j.push(...g)),i=null,g=[]}function E(){R(),w!==null&&j.length>0&&(r.push(w),r.push(...j)),w=null,j=[]}for(const b of n){const _=b.match(/^([a-zA-Z_][\w-]*):\s*(.*)$/);if(_&&!b.startsWith(" ")){E(),m=null,l=!0;const C=_[0].split(":")[0];if(c.has(C)){p=C,w=b;continue}else if(C==="sidebar"){p=C,x=null,w=b;continue}else{p=null,r.push(b);continue}}if(p==="sidebar"){const C=b.match(/^ ([\w-]+):\s*$/);if(C&&!b.startsWith(" ")){R();const N=C[1];x=N&&u.has(N)?N:null,i=x?b:null;continue}const T=b.match(/^ - ["']?([^"'\n]+)["']?\s*$/);if(T&&x){const N=T[1],U=a[x];N&&U.has(N)&&g.push(b);continue}if(x){g.push(b);continue}}if(p&&c.has(p)){const C=b.match(/^ ([\w][\w-]*):\s*(.*)$/);if(C&&!b.startsWith(" ")){const T=C[1];m=T,l=a[p].has(T),l&&j.push(b);continue}if(m!==null){l&&j.push(b);continue}j.push(b);continue}r.push(b)}E();let S=r.join(`
|
|
3
3
|
`);const D=S.match(/^\s{2}logoPath:\s*["']?([^"'\n]+)["']?\s*$/m);return D&&!o.has(D[1])&&(S=S.replace(/^\s{2}logoPath:\s*["']?([^"'\n]+)["']?\s*\n?/m,"")),S}function Ce(e,o){if(!o)return e;const a=o.toLowerCase();return e.map(n=>{if(n.kind==="file")return n.name.toLowerCase().includes(a)||n.path.toLowerCase().includes(a)?n:null;const r=Ce(n.children,o);return r.length>0?{...n,children:r}:null}).filter(n=>n!==null)}function At(e,o){const a=new Set,n=o.toLowerCase();function r(c,u){if(c.kind==="file"){if(c.name.toLowerCase().includes(n)||c.path.toLowerCase().includes(n))for(const p of u)a.add(p)}else for(const p of c.children)r(p,[...u,c.path])}for(const c of e)r(c,[]);return a}var me=10;function Pt(e,o,a,n){let r=0,c=0;return{nodes:e.map(u=>{if(u.kind==="dir"&&u.name==="tasks"){r=u.children.length;const p=[],m=[],l=a.toLowerCase();for(const g of u.children){const w=st([g],"file"),j=n!==null&&w.has(n),R=a&&(g.name.toLowerCase().includes(l)||g.path.toLowerCase().includes(l)||[...w].some(E=>E.toLowerCase().includes(l)));j||R?p.push(g):m.push(g)}const x=Math.max(0,o-p.length),i=[...p,...m.slice(0,x)];return c=i.length,{...u,children:i}}return u}),totalTaskChildren:r,visibleTaskChildren:c}}function Ee(e,o,a){const n={};for(const r of Object.keys(e))o.has(r)&&(n[r]=a[r]??e[r]);return n}function Rt(e,o,a){const n=Ee(e.files,o,a),r=tt(n,e.rootPath),c=new ArrayBuffer(r.byteLength);new Uint8Array(c).set(r);const u=new Blob([c],{type:"application/zip"}),p=URL.createObjectURL(u),m=document.createElement("a");m.href=p,m.download=`${e.rootPath}.zip`,document.body.appendChild(m),m.click(),m.remove(),window.setTimeout(()=>URL.revokeObjectURL(p),1e3)}function Tt({data:e,onSkillClick:o}){return(0,t.jsx)("div",{className:"rounded-md border border-border bg-accent/20 px-4 py-3 mb-4",children:(0,t.jsx)("dl",{className:"grid grid-cols-(--gtc-5) gap-x-4 gap-y-1.5 text-sm",children:Object.entries(e).map(([a,n])=>(0,t.jsxs)("div",{className:"contents",children:[(0,t.jsx)("dt",{className:"text-muted-foreground whitespace-nowrap py-0.5",children:at[a]??a}),(0,t.jsx)("dd",{className:"py-0.5",children:Array.isArray(n)?(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:n.map(r=>(0,t.jsx)("button",{type:"button",className:se("inline-flex items-center rounded-md border border-border bg-background px-2 py-0.5 text-xs",a==="skills"&&o&&"cursor-pointer hover:bg-accent/50 hover:border-foreground/30 transition-colors"),onClick:()=>a==="skills"&&o?.(r),children:r},r))}):(0,t.jsx)("span",{children:n})})]},a))})})}var Mt={ceo:"CEO",cto:"CTO",cmo:"CMO",cfo:"CFO",coo:"COO",vp:"VP",manager:"Manager",engineer:"Engineer",agent:"Agent"};function Lt(e,o,a,n){const r=Se(o),c=e.agents.filter(i=>r.agents.has(i.slug)),u=e.projects.filter(i=>r.projects.has(i.slug)),p=e.issues.filter(i=>r.tasks.has(i.slug)),m=e.skills.filter(i=>[...o].some(g=>g.startsWith(`skills/${i.key}/`)||g.startsWith("skills/")&&g.includes(`/${i.slug}/`))),l=[];l.push(`# ${a}`),l.push(""),n&&(l.push(`> ${n}`),l.push("")),c.length>0&&(l.push(""),l.push("")),l.push("## What's Inside"),l.push(""),l.push("This is an [Agent Company](https://paperclip.ing) package."),l.push("");const x=[];if(c.length>0&&x.push(["Agents",c.length]),u.length>0&&x.push(["Projects",u.length]),m.length>0&&x.push(["Skills",m.length]),p.length>0&&x.push(["Tasks",p.length]),x.length>0){l.push("| Content | Count |"),l.push("|---------|-------|");for(const[i,g]of x)l.push(`| ${i} | ${g} |`);l.push("")}if(c.length>0){l.push("### Agents"),l.push(""),l.push("| Agent | Role | Reports To |"),l.push("|-------|------|------------|");for(const i of c){const g=Mt[i.role]??i.role,w=i.reportsToSlug??"—";l.push(`| ${i.name} | ${g} | ${w} |`)}l.push("")}if(u.length>0){l.push("### Projects"),l.push("");for(const i of u){const g=i.description?` — ${i.description}`:"";l.push(`- **${i.name}**${g}`)}l.push("")}return l.push("## Getting Started"),l.push(""),l.push("```bash"),l.push("npx paperclipai company import this-github-url-or-folder"),l.push("```"),l.push(""),l.push("See [Paperclip](https://paperclip.ing) for more information."),l.push(""),l.push("---"),l.push(`Exported from [Paperclip](https://paperclip.ing) on ${new Date().toISOString().split("T")[0]}`),l.push(""),l.join(`
|
|
4
4
|
`)}function Ot(e){const{src:o,selectedFile:a,allFiles:n,orgChartPreviewUrl:r}=e;if(/^(?:https?:|data:)/i.test(o))return null;if(o.replace(/^\.\//,"")==="images/org-chart.png"&&r)return r;const c=(a.includes("/")?a.slice(0,a.lastIndexOf("/")+1):"")+o,u=n[c]??n[o];return u?we(c in n?c:o,u):null}function Ft({selectedFile:e,content:o,allFiles:a,orgChartPreviewUrl:n,onSkillClick:r}){if(!e||o===null)return(0,t.jsx)(z,{icon:B,message:"Select a file to preview its contents."});const c=ot(o),u=e.endsWith(".md")&&c!==null,p=u&&c?Xe(c):null,m=ct(e,o)?we(e,o):null,l=u?x=>Ot({src:x,selectedFile:e,allFiles:a,orgChartPreviewUrl:n}):void 0;return(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("div",{className:"border-b border-border px-5 py-3",children:(0,t.jsx)("div",{className:"truncate font-mono text-sm",children:e})}),(0,t.jsx)("div",{className:"min-h-(--sz-560px) px-5 py-5",children:p?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(Tt,{data:p.data,onSkillClick:r}),p.body.trim()&&(0,t.jsx)(he,{resolveImageSrc:l,softBreaks:!1,linkIssueReferences:!1,children:p.body})]}):u?(0,t.jsx)(he,{resolveImageSrc:l,softBreaks:!1,linkIssueReferences:!1,children:c??""}):m?(0,t.jsx)("div",{className:"flex min-h-(--sz-520px) items-center justify-center rounded-lg border border-border bg-accent/10 p-6",children:(0,t.jsx)("img",{src:m,alt:e,className:"max-h-(--sz-480px) max-w-full object-contain"})}):c!==null?(0,t.jsx)("pre",{className:"overflow-x-auto whitespace-pre-wrap break-words border-0 bg-transparent p-0 font-mono text-sm text-foreground",children:(0,t.jsx)("code",{children:c})}):(0,t.jsx)("div",{className:"rounded-lg border border-border bg-accent/10 px-4 py-3 text-sm text-muted-foreground",children:"Binary asset preview is not available for this file type."})})]})}function ge(e){const o="/company/export/files/",a=Qe(e),n=a.indexOf(o);return n===-1?null:decodeURIComponent(a.slice(n+22))||null}function xe(e){const o=e.split("/").slice(0,-1),a=[];let n="";for(const r of o)n=n?`${n}/${r}`:r,a.push(n);return a}function It(e){return(e instanceof DOMException||e instanceof Error)&&e.name==="AbortError"}function te(e){return e instanceof Error?e.message:"Failed to load export data."}function Dt(){const{selectedCompanyId:e,selectedCompany:o}=Be(),{setBreadcrumbs:a}=Ge(),{pushToast:n}=it(),r=et(),c=Ze(),u=(0,h.useRef)(ge(c.pathname)),{data:p}=Z({queryKey:G.auth.session,queryFn:()=>Ue.getSession()}),{data:m=[]}=Z({queryKey:G.agents.list(e),queryFn:()=>Je.list(e),enabled:!!e}),{data:l=[]}=Z({queryKey:G.projects.list(e),queryFn:()=>ut.list(e),enabled:!!e}),{data:x}=Z({queryKey:G.companies.exportFidelity(e),queryFn:()=>ee.exportFidelity(e),enabled:!!e}),[i,g]=(0,h.useState)(null),[w,j]=(0,h.useState)(null),[R,E]=(0,h.useState)(new Set),[S,D]=(0,h.useState)(()=>({...gt(),tasks:!1,routines:!1,attachments:!1})),[b,_]=(0,h.useState)(""),[C,T]=(0,h.useState)(me),[N,U]=(0,h.useState)(!1),W=(0,h.useRef)(null),F=(0,h.useRef)(null),L=(0,h.useRef)(0),ne=(0,h.useRef)(null),re=p?.user?.id??p?.session?.userId??null,H=(0,h.useMemo)(()=>m.filter(s=>s.status!=="terminated"),[m]),V=(0,h.useMemo)(()=>l,[l]),{orderedAgents:oe}=He({agents:H,companyId:e,userId:re}),{orderedProjects:ae}=nt({projects:V,companyId:e,userId:re}),ie=(0,h.useMemo)(()=>Et({agents:H,orderedAgents:oe,projects:V,orderedProjects:ae}),[oe,ae,H,V]),J=S.tasks||S.routines,Q=(0,h.useCallback)((s,d=!1)=>{j(s),s?r(`/company/export/files/${encodeURI(s)}`,{replace:d}):r("/company/export",{replace:d})},[r]);(0,h.useEffect)(()=>{if(!i)return;const s=ge(c.pathname);s&&s in i.files&&s!==w?(j(s),E(d=>{const f=new Set(d);for(const y of xe(s))f.add(y);return f})):!s&&w&&j(null)},[c.pathname,i]),(0,h.useEffect)(()=>{a([{label:o?.name??"Organization",href:"/dashboard"},{label:"Settings",href:"/company/settings"},{label:"Export"}])},[o?.name,a]);const A=ue({mutationFn:({includeIssues:s,includeSkills:d,signal:f})=>ee.exportPreview(e,{include:{company:!0,agents:!0,projects:!0,issues:s,skills:d},sidebarOrder:ie},{signal:f}),onSuccess:(s,d)=>{if(d.requestId!==L.current)return;g(s);const f=fe(s.files),y=new Set;for(const v of f)v.kind==="dir"&&v.name!=="tasks"&&y.add(v.path);const k=u.current;if(k&&k in s.files){j(k);const v=xe(k);E(new Set([...y,...v]))}else{const v="README.md"in s.files?"README.md":Object.keys(s.files)[0];v&&Q(v,!0),E(y)}},onError:(s,d)=>{d.requestId!==L.current||It(s)||n({tone:"error",title:"Export failed",body:te(s)})}});function O(){if(!e)return;F.current?.abort();const s=new AbortController,d=L.current+1;L.current=d,F.current=s,U(!1),A.mutate({includeIssues:J,includeSkills:S.skills,requestId:d,signal:s.signal})}const q=ue({mutationFn:()=>ee.exportBundle(e,{include:{company:!0,agents:!0,projects:!0,issues:J,skills:S.skills},selectedFiles:Array.from(P).sort(),sidebarOrder:ie}),onSuccess:s=>{const d=new Set(Object.keys(s.files));Rt(s,d,s.files),n({tone:"success",title:"Export downloaded",body:`${d.size} file${d.size===1?"":"s"} exported as ${s.rootPath}.zip`})},onError:s=>{n({tone:"error",title:"Export failed",body:s instanceof Error?s.message:"Failed to build export package."})}});(0,h.useEffect)(()=>{e&&(ne.current!==e&&(ne.current=e,g(null),j(null)),O())},[e,J,S.skills]),(0,h.useEffect)(()=>()=>{L.current+=1,F.current?.abort()},[]);const M=(0,h.useMemo)(()=>i?fe(i.files):[],[i]),P=(0,h.useMemo)(()=>i?kt({filePaths:Object.keys(i.files),issues:i.manifest.issues,categories:S,embeddedAssets:i.manifest.embeddedAssets??[]}):new Set,[i,S]),Ne=(0,h.useMemo)(()=>i?vt(Object.keys(i.files),i.manifest.issues):null,[i]),{displayTree:Ae,totalTaskChildren:ce,visibleTaskChildren:le}=(0,h.useMemo)(()=>{let s=M;b&&(s=Ce(s,b));const d=Pt(s,C,b,w);return{displayTree:d.nodes,totalTaskChildren:d.totalTaskChildren,visibleTaskChildren:d.visibleTaskChildren}},[M,b,C,w]),Pe=(0,h.useMemo)(()=>{const s={};function d(f){if(f.kind==="file"){const k=P.has(f.path);return k||(s[f.path]="muted"),k}let y=!1;for(const k of f.children)d(k)&&(y=!0);return y||(s[f.path]="muted"),y}for(const f of M)d(f);return s},[M,P]),K=(0,h.useMemo)(()=>{if(!i)return{};const s={...i.files},d=i.paperclipExtensionPath;if(d&&typeof i.files[d]=="string"&&(s[d]=Nt(i.files[d],P)),typeof i.files["README.md"]=="string"){const f=i.manifest.company?.name??o?.name??"Company",y=i.manifest.company?.description??null;s["README.md"]=Lt(i.manifest,P,f,y)}return s},[i,P,o?.name]),Re=(0,h.useMemo)(()=>i?Ye(Ee(i.files,P,K),i.rootPath):0,[i,P,K]),de=(0,h.useMemo)(()=>dt(M),[M]),I=P.size,$=(0,h.useMemo)(()=>i?i.warnings.filter(s=>!/terminated agent/i.test(s)):[],[i]);function Te(s){E(d=>{const f=new Set(d);return f.has(s)?f.delete(s):f.add(s),f})}function Me(s){D(d=>({...d,[s]:!d[s]}))}function Le(s){const d=b.length>0,f=s.length>0;if(f&&!d&&(W.current=new Set(R)),_(s),f){const y=At(M,s);E(k=>{const v=new Set(k);for(const Y of y)v.add(Y);return v})}else d&&W.current&&(E(W.current),W.current=null)}function Oe(s){if(!i)return;const d=i.manifest.skills.find(f=>f.key===s||f.slug===s)?.path??`skills/${s}/SKILL.md`;d in i.files&&(Q(d),E(f=>{const y=new Set(f);y.add("skills");const k=d.split("/").slice(0,-1);let v="";for(const Y of k)v=v?`${v}/${Y}`:Y,y.add(v);return y}))}function Fe(){!i||P.size===0||q.isPending||q.mutate()}function Ie(){L.current+=1,F.current?.abort(),F.current=null,A.reset(),U(!0)}if(!e)return(0,t.jsx)(z,{icon:B,message:"Select an organization to export."});if(A.isPending&&!i)return(0,t.jsx)(Ve,{variant:"detail"});if(N&&!i)return(0,t.jsx)(z,{icon:B,title:"Export preview cancelled",message:"The preview request was cancelled. Your export settings are unchanged.",action:"Retry preview",onAction:O,hideActionIcon:!0});if(A.isError&&!i)return(0,t.jsx)(z,{icon:B,title:"Export preview failed",message:te(A.error),description:"Retry the preview. You do not need to reload this page.",action:"Retry preview",onAction:O,hideActionIcon:!0});if(!i)return(0,t.jsx)(z,{icon:B,title:"Export preview unavailable",message:"No export preview is loaded.",action:"Load preview",onAction:O,hideActionIcon:!0});const $e=w?K[w]??null:null;return(0,t.jsxs)("div",{className:"max-w-6xl",children:[(0,t.jsx)("div",{className:"sticky top-0 z-10 border-b border-border bg-background px-5 py-3",children:(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-4 text-sm",children:[(0,t.jsxs)("span",{className:"font-medium",children:[o?.name??"Organization"," export"]}),(0,t.jsxs)("span",{className:"text-muted-foreground",children:["Exporting ",I.toLocaleString()," of ",de.toLocaleString()," file",de===1?"":"s",I>0&&` (~${rt(Re)})`]}),$.length>0&&(0,t.jsxs)("span",{className:"text-amber-500",children:[$.length," warning",$.length===1?"":"s"]})]}),(0,t.jsxs)(X,{size:"sm",onClick:Fe,disabled:I===0||q.isPending||A.isPending||A.isError||N,children:[(0,t.jsx)(ft,{className:"mr-1.5 h-3.5 w-3.5"}),q.isPending?"Building export...":`Export ${I.toLocaleString()} file${I===1?"":"s"}`]})]})}),$.length>0&&(0,t.jsx)("div",{className:"mx-5 mt-3 rounded-md border border-amber-500/30 bg-amber-500/5 px-4 py-3",children:$.map(s=>(0,t.jsx)("div",{className:"text-xs text-amber-500",children:s},s))}),x&&x.warnings.length>0&&(0,t.jsxs)("div",{className:"mx-5 mt-3 rounded-md border border-amber-500/30 bg-amber-500/5 px-4 py-3",children:[(0,t.jsx)("h3",{className:"mb-1.5 text-xs font-medium",children:"Not included in this export"}),x.warnings.map(s=>(0,t.jsx)("div",{className:se("text-xs",s.severity==="blocker"?"font-medium text-destructive":"text-amber-500"),children:s.message},s.code))]}),(0,t.jsxs)("div",{className:"grid gap-4 xl:h-(--sz-calc-30) xl:grid-cols-(--gtc-25) xl:gap-0",children:[(0,t.jsxs)("aside",{className:"flex max-h-(--sz-24rem) flex-col overflow-hidden border-b border-border xl:max-h-none xl:border-b-0 xl:border-r",children:[(0,t.jsx)("div",{className:"border-b border-border px-4 py-3 shrink-0",children:(0,t.jsx)("h2",{className:"text-base font-semibold",children:"Package files"})}),(0,t.jsxs)("div",{className:"border-b border-border px-4 py-3 shrink-0",children:[(0,t.jsx)("h3",{className:"mb-2 text-xs font-medium text-muted-foreground",children:"What to include"}),(0,t.jsx)("div",{className:"grid grid-cols-2 gap-x-4 gap-y-1.5",role:"group","aria-label":"What to include",children:ht.map(s=>{const d=s==="attachments"&&!je(S),f=S[s]&&!d,y=Ne?.[s]??0,k=i.manifest.includes.issues||s!=="tasks"&&s!=="routines"&&s!=="attachments";return(0,t.jsxs)("label",{className:se("flex items-center gap-2 text-sm",d?"cursor-not-allowed opacity-50":"cursor-pointer"),title:d?"Attachments travel with tasks and routines; re-enable one of them to include attachments.":void 0,children:[(0,t.jsx)("input",{type:"checkbox",checked:f,disabled:d,onChange:()=>Me(s),className:"accent-foreground","data-export-category":s}),(0,t.jsx)("span",{className:"min-w-0 truncate",children:mt[s]}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:k?y.toLocaleString():"—"})]},s)})}),(0,t.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:"Task and routine history is opt-in because it can be large."})]}),(0,t.jsx)("div",{className:"border-b border-border px-3 py-2 shrink-0",children:(0,t.jsxs)("div",{className:"flex items-center gap-2 rounded-md border border-border px-2 py-1",children:[(0,t.jsx)(qe,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),(0,t.jsx)("input",{type:"text",value:b,onChange:s=>Le(s.target.value),placeholder:"Search files...",className:"w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground","data-page-search-target":"true"})]})}),(0,t.jsxs)("div",{className:"flex-1 overflow-y-auto",children:[(0,t.jsx)(lt,{nodes:Ae,selectedFile:w,expandedDirs:R,onToggleDir:Te,onSelectFile:Q,fileTones:Pe,showCheckboxes:!1,wrapLabels:!1}),ce>le&&!b&&(0,t.jsx)("div",{className:"px-4 py-2",children:(0,t.jsxs)("button",{type:"button",onClick:()=>T(s=>s+me),className:"w-full rounded-md border border-border px-3 py-1.5 text-xs text-muted-foreground hover:bg-accent/30 hover:text-foreground transition-colors",children:["Show more tasks (",le," of ",ce,")"]})})]})]}),(0,t.jsxs)("div",{className:"relative min-w-0 overflow-y-auto xl:pl-6",children:[(0,t.jsx)(Ft,{selectedFile:w,content:$e,allFiles:K,orgChartPreviewUrl:`/api/companies/${encodeURIComponent(e)}/org.svg`,onSkillClick:Oe}),A.isPending?(0,t.jsx)("div",{className:"absolute inset-0 z-10 flex min-h-(--sz-520px) items-center justify-center bg-background/90 px-6 text-center",role:"status","aria-live":"polite","aria-busy":"true","data-export-preview-state":"loading",children:(0,t.jsxs)("div",{className:"flex max-w-md flex-col items-center gap-3",children:[(0,t.jsx)(pt,{className:"h-6 w-6 animate-spin text-muted-foreground"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:"Updating export preview…"}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:"Large task histories can take a minute. You can untick Tasks or cancel this update."})]}),(0,t.jsxs)(X,{type:"button",variant:"outline",size:"sm",onClick:Ie,children:[(0,t.jsx)(_e,{}),"Cancel update"]})]})}):N?(0,t.jsx)("div",{className:"absolute inset-0 z-10 flex min-h-(--sz-520px) items-center justify-center bg-background/90 px-6 text-center","data-export-preview-state":"cancelled",children:(0,t.jsxs)("div",{className:"flex max-w-md flex-col items-center gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:"Preview update cancelled"}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:"The previous preview remains available. Retry when you are ready."})]}),(0,t.jsxs)(X,{type:"button",variant:"outline",size:"sm",onClick:O,children:[(0,t.jsx)(pe,{}),"Retry preview"]})]})}):A.isError?(0,t.jsx)("div",{className:"absolute inset-0 z-10 flex min-h-(--sz-520px) items-center justify-center bg-background/90 px-6 text-center",role:"alert","data-export-preview-state":"error",children:(0,t.jsxs)("div",{className:"flex max-w-md flex-col items-center gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium text-destructive",children:"Export preview failed"}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:te(A.error)})]}),(0,t.jsxs)(X,{type:"button",variant:"outline",size:"sm",onClick:O,children:[(0,t.jsx)(pe,{}),"Retry preview"]})]})}):null]})]})]})}export{Dt as CompanyExport};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as O}from"./dist-
|
|
1
|
+
import{r as O}from"./dist-D3TaYMsE.js";import{D as r,E as a,F as b,I as e,g as s,k as t,w as P,y as S}from"./index-BHbrFFmp.js";var n={__proto__:null,anyref:34,dataref:34,eqref:34,externref:34,i31ref:34,funcref:34,i8:34,i16:34,i32:34,i64:34,f32:34,f64:34},Q=O.deserialize({version:14,states:"!^Q]QPOOOqQPO'#CbOOQO'#Cd'#CdOOQO'#Cl'#ClOOQO'#Ch'#ChQ]QPOOOOQO,58|,58|OxQPO,58|OOQO-E6f-E6fOOQO1G.h1G.h",stateData:"!P~O_OSPOSQOS~OTPOVROXROYROZROaQO~OSUO~P]OSXO~P]O",goto:"xaPPPPPPbPbPPPhPPPrXROPTVQTOQVPTWTVXSOPTV",nodeNames:"⚠ LineComment BlockComment Module ) ( App Identifier Type Keyword Number String",maxTerm:17,nodeProps:[["isolate",-3,1,2,11,""],["openedBy",4,"("],["closedBy",5,")"],["group",-6,6,7,8,9,10,11,"Expression"]],skippedNodes:[0,1,2],repeatNodeCount:1,tokenData:"0o~R^XY}YZ}]^}pq}rs!Stu#pxy'Uyz(e{|(j}!O(j!Q!R(s!R![*p!]!^.^#T#o.{~!SO_~~!VVOr!Srs!ls#O!S#O#P!q#P;'S!S;'S;=`#j<%lO!S~!qOZ~~!tRO;'S!S;'S;=`!};=`O!S~#QWOr!Srs!ls#O!S#O#P!q#P;'S!S;'S;=`#j;=`<%l!S<%lO!S~#mP;=`<%l!S~#siqr%bst%btu%buv%bvw%bwx%bz{%b{|%b}!O%b!O!P%b!P!Q%b!Q![%b![!]%b!^!_%b!_!`%b!`!a%b!a!b%b!b!c%b!c!}%b#Q#R%b#R#S%b#S#T%b#T#o%b#p#q%b#r#s%b~%giV~qr%bst%btu%buv%bvw%bwx%bz{%b{|%b}!O%b!O!P%b!P!Q%b!Q![%b![!]%b!^!_%b!_!`%b!`!a%b!a!b%b!b!c%b!c!}%b#Q#R%b#R#S%b#S#T%b#T#o%b#p#q%b#r#s%b~'ZPT~!]!^'^~'aTO!]'^!]!^'p!^;'S'^;'S;=`(_<%lO'^~'sVOy'^yz(Yz!]'^!]!^'p!^;'S'^;'S;=`(_<%lO'^~(_OQ~~(bP;=`<%l'^~(jOS~~(mQ!Q!R(s!R![*p~(xUY~!O!P)[!Q![*p!g!h){#R#S+U#X#Y){#l#m+[~)aRY~!Q![)j!g!h){#X#Y){~)oSY~!Q![)j!g!h){#R#S*j#X#Y){~*OR{|*X}!O*X!Q![*_~*[P!Q![*_~*dQY~!Q![*_#R#S*X~*mP!Q![)j~*uTY~!O!P)[!Q![*p!g!h){#R#S+U#X#Y){~+XP!Q![*p~+_R!Q![+h!c!i+h#T#Z+h~+mVY~!O!P,S!Q![+h!c!i+h!r!s-P#R#S+[#T#Z+h#d#e-P~,XTY~!Q![,h!c!i,h!r!s-P#T#Z,h#d#e-P~,mUY~!Q![,h!c!i,h!r!s-P#R#S.Q#T#Z,h#d#e-P~-ST{|-c}!O-c!Q![-o!c!i-o#T#Z-o~-fR!Q![-o!c!i-o#T#Z-o~-tSY~!Q![-o!c!i-o#R#S-c#T#Z-o~.TR!Q![,h!c!i,h#T#Z,h~.aP!]!^.d~.iSP~OY.dZ;'S.d;'S;=`.u<%lO.d~.xP;=`<%l.d~/QiX~qr.{st.{tu.{uv.{vw.{wx.{z{.{{|.{}!O.{!O!P.{!P!Q.{!Q![.{![!].{!^!_.{!_!`.{!`!a.{!a!b.{!b!c.{!c!}.{#Q#R.{#R#S.{#S#T.{#T#o.{#p#q.{#r#s.{",tokenizers:[0],topRules:{Module:[0,3]},specialized:[{term:9,get:o=>n[o]||-1}],tokenPrec:0}),i=s.define({name:"wast",parser:Q.configure({props:[t.add({App:P({closing:")",align:!1})}),r.add({App:a,BlockComment(o){return{from:o.from+2,to:o.to-2}}}),b({Keyword:e.keyword,Type:e.typeName,Number:e.number,String:e.string,Identifier:e.variableName,LineComment:e.lineComment,BlockComment:e.blockComment,"( )":e.paren})]}),languageData:{commentTokens:{line:";;",block:{open:"(;",close:";)"}},closeBrackets:{brackets:["(",'"']}}});function l(){return new S(i)}export{l as wast};
|