@surething/cockpit 1.0.262 → 1.0.263
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/.next-prod/BUILD_ID +1 -1
- package/.next-prod/app-path-routes-manifest.json +3 -3
- package/.next-prod/build-manifest.json +3 -3
- package/.next-prod/cockpit-build.json +2 -2
- package/.next-prod/prerender-manifest.json +3 -3
- package/.next-prod/react-loadable-manifest.json +1 -1
- package/.next-prod/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/_global-error.html +1 -1
- package/.next-prod/server/app/_global-error.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next-prod/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/_not-found.html +2 -2
- package/.next-prod/server/app/_not-found.rsc +3 -3
- package/.next-prod/server/app/_not-found.segments/_full.segment.rsc +3 -3
- package/.next-prod/server/app/_not-found.segments/_index.segment.rsc +3 -3
- package/.next-prod/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next-prod/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next-prod/server/app/m/page.js +1 -1
- package/.next-prod/server/app/m/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/project/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/review/[id]/page.js +1 -1
- package/.next-prod/server/app/review/[id]/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app-paths-manifest.json +3 -3
- package/.next-prod/server/chunks/1564.js +1 -1
- package/.next-prod/server/chunks/5750.js +39 -40
- package/.next-prod/server/chunks/8764.js +2 -2
- package/.next-prod/server/middleware-build-manifest.js +1 -1
- package/.next-prod/server/middleware-react-loadable-manifest.js +1 -1
- package/.next-prod/server/pages/404.html +2 -2
- package/.next-prod/server/pages/500.html +1 -1
- package/.next-prod/server/server-reference-manifest.json +1 -1
- package/.next-prod/static/chunks/1372-c2e2e52980e95aec.js +15 -0
- package/.next-prod/static/chunks/{1959.a8039e13d14ada11.js → 1959.1d5dbd36400b94d2.js} +4 -4
- package/.next-prod/static/chunks/2032-8326efdf5830d58c.js +1 -0
- package/.next-prod/static/chunks/6722-1252a1399ff10e47.js +35 -0
- package/.next-prod/static/chunks/6784-20cc834d161af395.js +381 -0
- package/.next-prod/static/chunks/app/{layout-7b31e254e348e208.js → layout-b11ccf3395201b18.js} +1 -1
- package/.next-prod/static/chunks/app/m/page-d7c162f2db6b377c.js +1 -0
- package/.next-prod/static/chunks/app/{page-cb0d12250512641d.js → page-e03b50ea13cd6198.js} +1 -1
- package/.next-prod/static/chunks/app/project/{page-cb0d12250512641d.js → page-e03b50ea13cd6198.js} +1 -1
- package/.next-prod/static/chunks/app/review/[id]/page-556db82704d074ab.js +1 -0
- package/.next-prod/static/chunks/{webpack-ce60587570394496.js → webpack-e959a5364a05b2ac.js} +1 -1
- package/.next-prod/static/css/237348b31ba05918.css +1 -0
- package/.next-prod/trace +14 -14
- package/.next-prod/trace-build +1 -1
- package/dist/{chunk-LC4LAEWJ.mjs → chunk-FBAFMLUC.mjs} +1 -1
- package/dist/{chunk-AI7T3EXM.mjs → chunk-H6AI4XJC.mjs} +1 -1
- package/dist/{chunk-ZCMAJV2M.mjs → chunk-ZE2JXL6E.mjs} +3 -3
- package/dist/httpApi.mjs +2 -2
- package/dist/scheduledTasks.mjs +2 -2
- package/dist/{server-CQXVJT3F.mjs → server-HRP33LCV.mjs} +2 -2
- package/dist/wsServer.mjs +4 -4
- package/package.json +1 -1
- package/public/html-lib/json-viewer.js +9 -9
- package/public/html-lib/markdown.css +0 -7
- package/public/html-lib/markdown.js +1 -1
- package/public/html-lib/pdf-viewer.css +0 -11
- package/public/html-lib/pdf-viewer.js +1 -1
- package/public/html-lib/theme.css +95 -11
- package/.next-prod/static/chunks/1372-a26fa30d21bd1ecc.js +0 -15
- package/.next-prod/static/chunks/2032-f224a93f7a22bc21.js +0 -1
- package/.next-prod/static/chunks/5400-bf3fe22440a73161.js +0 -36
- package/.next-prod/static/chunks/6784-d51b98432358f755.js +0 -381
- package/.next-prod/static/chunks/app/m/page-7dcf56a65528216f.js +0 -1
- package/.next-prod/static/chunks/app/review/[id]/page-c0136423507b7547.js +0 -1
- package/.next-prod/static/css/38ad6f470b64a40f.css +0 -1
- /package/.next-prod/static/{noNfrQRJFchmZSWx_yn1K → Jy5sAJFfhng774VeXYdQS}/_buildManifest.js +0 -0
- /package/.next-prod/static/{noNfrQRJFchmZSWx_yn1K → Jy5sAJFfhng774VeXYdQS}/_ssgManifest.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2032],{19736:(e,t,r)=>{r.d(t,{ReviewCommentsListModal:()=>c});var n=r(95155),o=r(12115),s=r(79114),a=r(64428),l=r(34075),i=r(69809);function d(e,t,r){let n=(e,r)=>t[e]||r,o=[],s=null!=r?`[${r+1}] `:"",a=e.anchor.selectedText.length>200?e.anchor.selectedText.slice(0,197)+"...":e.anchor.selectedText;for(let t of(o.push(`${s}${i.A.t("review.quoteRef",{text:a})}`),o.push(i.A.t("review.commentAuthor",{author:n(e.authorId,e.author),content:e.content})),e.replies))o.push(i.A.t("review.replyAuthor",{author:n(t.authorId,t.author),content:t.content}));return o.join("\n")}function c({isOpen:e,onClose:t,comments:r,reviewTitle:m,userNameMap:x,onCommentClick:h}){let{t:p}=(0,s.Bd)(),[f,g]=(0,o.useState)(null),[v,b]=(0,o.useState)(!1);if(!e)return null;let w=[...r].sort((e,t)=>e.anchor.startOffset-t.anchor.startOffset),j=(e,t)=>x[e]||t,N=async e=>{g(e.id);try{let t=d(e,x);await navigator.clipboard.writeText(t),(0,l.oR)(p("toast.copiedComment"))}catch{(0,l.oR)(p("toast.copyFailed"),"error")}finally{g(null)}},k=async()=>{if(0!==r.length){b(!0);try{let e=function(e,t,r){if(0===e.length)return"";let n=[...e].sort((e,t)=>e.anchor.startOffset-t.anchor.startOffset),o=[i.A.t("review.reviewSummary",{title:t}),""];return n.forEach((e,t)=>{o.push(d(e,r,t)),o.push("")}),o.push(i.A.t("review.totalNComments",{count:e.length})),o.join("\n").trim()}(r,m,x);await navigator.clipboard.writeText(e),(0,l.oR)(p("toast.copiedAllComments"))}catch{(0,l.oR)(p("toast.copyFailed"),"error")}finally{b(!1)}}},y=e=>{h?.(e),t()},C=w.filter(e=>!e.closed),M=w.filter(e=>e.closed),S=(0,n.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",onClick:t,children:(0,n.jsxs)("div",{className:"w-full max-w-2xl max-h-[80vh] bg-card border border-border rounded-lg shadow-xl flex flex-col overflow-hidden",onClick:e=>e.stopPropagation(),children:[(0,n.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border bg-secondary",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("h2",{className:"text-sm font-semibold text-foreground",children:p("review.allCommentsTitle")}),(0,n.jsxs)("span",{className:"text-xs text-muted-foreground",children:[p("review.commentsCountBrief",{count:r.length}),M.length>0&&` (${p("review.closedCount",{count:M.length})})`]}),r.length>0&&(0,n.jsx)("button",{onClick:k,disabled:v,className:"p-1 rounded hover:bg-accent text-muted-foreground disabled:opacity-50",title:p("review.copyAllComments"),children:v?(0,n.jsx)("span",{className:"inline-block w-4 h-4 border-2 border-current border-t-transparent rounded-full animate-spin"}):(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})})]}),(0,n.jsx)("button",{onClick:t,className:"p-1 rounded hover:bg-accent text-muted-foreground",children:(0,n.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,n.jsx)("div",{className:"flex-1 overflow-y-auto p-3",children:0===r.length?(0,n.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-muted-foreground",children:[(0,n.jsx)("div",{className:"text-2xl mb-2",children:"\uD83D\uDCAC"}),(0,n.jsx)("span",{className:"text-sm",children:p("review.noComments")})]}):(0,n.jsxs)("div",{className:"space-y-2",children:[C.map((e,t)=>(0,n.jsx)(u,{comment:e,index:t,resolveAuthor:j,copyingId:f,onCopy:N,onClick:y},e.id)),M.length>0&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"text-[11px] text-muted-foreground/60 pt-2 pb-1 px-1",children:p("review.closedComments",{count:M.length})}),M.map((e,t)=>(0,n.jsx)(u,{comment:e,index:C.length+t,resolveAuthor:j,copyingId:f,onCopy:N,onClick:y,closed:!0},e.id))]})]})})]})});return(0,n.jsx)(a.ZL,{children:S})}function u({comment:e,index:t,resolveAuthor:r,copyingId:o,onCopy:s,onClick:a,closed:l}){let d=e.anchor.selectedText.length>100?e.anchor.selectedText.slice(0,97)+"...":e.anchor.selectedText;return(0,n.jsxs)("div",{className:`rounded-lg border border-border hover:border-muted-foreground/30 transition-all cursor-pointer group ${l?"opacity-50":""}`,onClick:()=>a(e.id),children:[(0,n.jsx)("div",{className:"px-3 pt-2.5 pb-1",children:(0,n.jsx)("div",{className:"text-xs bg-yellow-500/10 border-l-2 border-yellow-500 px-2 py-1 rounded-r text-muted-foreground truncate",children:d})}),(0,n.jsxs)("div",{className:"px-3 pt-1.5 pb-2 flex items-start gap-2",children:[(0,n.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 mb-0.5",children:[(0,n.jsx)("span",{className:"w-4 h-4 rounded-full bg-brand/20 text-brand flex items-center justify-center text-[9px] font-bold flex-shrink-0",children:r(e.authorId,e.author).charAt(0)}),(0,n.jsx)("span",{className:"text-xs font-medium",children:r(e.authorId,e.author)}),(0,n.jsx)("span",{className:"text-[10px] text-muted-foreground",children:new Date(e.createdAt).toLocaleString("zh-CN",{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"})}),l&&(0,n.jsx)("span",{className:"text-[10px] text-muted-foreground/60",children:i.A.t("review.closedLabel")})]}),(0,n.jsx)("p",{className:"text-sm text-foreground line-clamp-2 pl-6",children:e.content}),e.replies.length>0&&(0,n.jsxs)("div",{className:"pl-6 mt-1 space-y-0.5",children:[e.replies.slice(0,3).map(e=>(0,n.jsxs)("div",{className:"text-xs text-muted-foreground truncate",children:[(0,n.jsx)("span",{className:"font-medium",children:r(e.authorId,e.author)}),": ",e.content]},e.id)),e.replies.length>3&&(0,n.jsx)("div",{className:"text-[10px] text-muted-foreground/60",children:i.A.t("review.moreReplies",{count:e.replies.length-3})})]})]}),(0,n.jsx)("button",{onClick:t=>{t.stopPropagation(),s(e)},disabled:o===e.id,className:"p-1 rounded opacity-0 group-hover:opacity-100 hover:bg-accent text-muted-foreground transition-opacity disabled:opacity-50 flex-shrink-0 mt-0.5",title:i.A.t("review.copyComment"),children:o===e.id?(0,n.jsx)("span",{className:"inline-block w-4 h-4 border-2 border-current border-t-transparent rounded-full animate-spin"}):(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})})]})]})}},82032:(e,t,r)=>{r.d(t,{ReviewDropdown:()=>h});var n=r(95155),o=r(12115),s=r(79114),a=r(2111),l=r(19736),i=r(49433),d=r(86957),c=r(90420);let u="review-last-viewed";function m(){try{return JSON.parse(localStorage.getItem(u)||"{}")}catch{return{}}}function x(e,t){if(!e.lastCommentAt)return!1;let r=t[e.id];return!r||e.lastCommentAt>r}function h({cwd:e}){let{t}=(0,s.Bd)(),[r,p]=(0,o.useState)(!1),[f,g]=(0,o.useState)([]),[v,b]=(0,o.useState)(!1),[w,j]=(0,o.useState)(null),[N,k]=(0,o.useState)({}),[y,C]=(0,o.useState)({open:!1,comments:[],title:"",userNameMap:{}}),M=(0,o.useRef)(null),S=(0,o.useRef)(null),[A,L]=(0,o.useState)(null);(0,o.useEffect)(()=>{queueMicrotask(()=>k(m()))},[]),(0,o.useEffect)(()=>{if(!r)return;let e=e=>{M.current&&!M.current.contains(e.target)&&p(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[r]);let E=(0,o.useCallback)(async()=>{b(!0);let e=await d.t4.runPromiseExit((0,c.Y_)());"Success"===e._tag&&g(e.value.reviews??[]),b(!1)},[]);(0,o.useEffect)(()=>{r&&queueMicrotask(()=>E())},[r,E]);let T=(0,o.useCallback)(e=>{let{data:t}=e;Array.isArray(t)&&t.some(e=>"review"===e.type)&&E()},[E]);(0,a.h)({url:`/ws/watch?cwd=${encodeURIComponent(e||"/")}`,onMessage:T,enabled:!!e}),(0,o.useEffect)(()=>{queueMicrotask(()=>E())},[E]);let $=(0,o.useMemo)(()=>f.filter(e=>e.active),[f]),R=(0,o.useMemo)(()=>$.some(e=>x(e,N)),[$,N]),I=(0,o.useCallback)(e=>{let t;(t=m())[e]=Date.now(),localStorage.setItem(u,JSON.stringify(t)),k(m()),window.open(`${window.location.origin}/review/${e}`,"_blank")},[]),B=(0,o.useCallback)(async(e,t)=>{e.stopPropagation();let[r,n]=await Promise.all([d.t4.runPromiseExit((0,c.JK)(t)),d.t4.runPromiseExit((0,c.BL)())]);if("Success"!==r._tag)return;let o=r.value.review,s={};if("Success"===n._tag)for(let[e,t]of Object.entries(n.value.users))s[e]=t.name;C({open:!0,comments:o.comments||[],title:o.title??"",userNameMap:s})},[]),D=(0,o.useCallback)((e,t)=>{S.current=t,e.dataTransfer.effectAllowed="move";let r=e.currentTarget;requestAnimationFrame(()=>r.classList.add("opacity-30"))},[]),O=(0,o.useCallback)(e=>{S.current=null,L(null),e.currentTarget instanceof HTMLElement&&e.currentTarget.classList.remove("opacity-30")},[]),_=(0,o.useCallback)((e,t)=>{e.preventDefault(),e.dataTransfer.dropEffect="move",S.current&&S.current!==t&&L(t)},[]),z=(0,o.useCallback)((e,t)=>{e.preventDefault(),L(null);let r=S.current;S.current=null,r&&r!==t&&g(e=>{let n=[...e],o=n.findIndex(e=>e.id===r),s=n.findIndex(e=>e.id===t);if(-1===o||-1===s)return e;let[a]=n.splice(o,1);n.splice(s,0,a);let l=n.map(e=>e.id);return d.t4.runFork((0,c.z1)(l).pipe(i.orElse(()=>i.void))),n})},[]);return(0,n.jsxs)("div",{ref:M,className:"relative",children:[(0,n.jsxs)("button",{onClick:()=>p(e=>!e),className:`relative p-2 rounded-lg transition-colors ${r?"text-foreground bg-accent":"text-muted-foreground hover:text-foreground hover:bg-accent"}`,title:t("review.reviewManagement"),children:[(0,n.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"})}),R&&(0,n.jsx)("span",{className:"absolute top-1 right-1 w-2 h-2 bg-red-500 rounded-full"})]}),r&&(0,n.jsxs)("div",{className:"absolute right-0 top-full mt-1 w-64 bg-popover border border-border rounded-lg shadow-xl z-50 overflow-hidden",children:[(0,n.jsxs)("div",{className:"px-3 py-2 border-b border-border flex items-center justify-between",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:t("review.allReviews")}),(0,n.jsx)("span",{className:"text-xs text-muted-foreground/60 ml-1.5",children:$.length})]}),(0,n.jsx)("button",{onClick:E,className:"p-0.5 text-muted-foreground hover:text-foreground rounded transition-colors",title:t("common.refresh"),children:(0,n.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})})]}),(0,n.jsx)("div",{className:"max-h-80 overflow-y-auto",children:v&&0===f.length?(0,n.jsx)("div",{className:"px-3 py-4 text-xs text-muted-foreground/50 text-center",children:t("common.loading")}):0===$.length?(0,n.jsx)("div",{className:"px-3 py-4 text-xs text-muted-foreground/50 text-center",children:t("review.noOpenReviews")}):$.map(e=>{let r,o,s,a,l,i=x(e,N);return(0,n.jsxs)("div",{draggable:!0,onDragStart:t=>D(t,e.id),onDragEnd:O,onDragOver:t=>_(t,e.id),onDrop:t=>z(t,e.id),onMouseEnter:t=>{let r=t.currentTarget.getBoundingClientRect();j({id:e.id,text:e.title,top:r.top+r.height/2,left:r.left})},onMouseLeave:()=>j(t=>t?.id===e.id?null:t),onClick:()=>I(e.id),className:`group px-3 py-2 cursor-pointer border-b transition-colors ${A===e.id?"border-b-brand border-t border-t-transparent":"border-b-border/50"} hover:bg-accent/30`,children:[(0,n.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0",children:[(0,n.jsx)("span",{className:`w-1.5 h-1.5 rounded-full flex-shrink-0 ${i?"bg-red-500":"bg-green-500"}`}),(0,n.jsx)("span",{className:`text-xs truncate flex-1 ${i?"font-medium text-foreground":""}`,children:e.title}),e.commentCount>0&&(0,n.jsx)("button",{onClick:t=>B(t,e.id),className:"flex-shrink-0 p-0.5 rounded text-muted-foreground/0 group-hover:text-muted-foreground/60 hover:!text-brand hover:!bg-brand/10 transition-colors",title:t("review.viewComments"),children:(0,n.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,n.jsx)("path",{d:"M7 8h10M7 12h4m1 8l-4-4H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-3l-4 4z"})})})]}),(0,n.jsxs)("div",{className:"flex items-center gap-2 text-[10px] text-muted-foreground/50 mt-0.5 pl-3",children:[(0,n.jsx)("span",{children:(o=String((r=new Date(e.updatedAt||e.createdAt)).getMonth()+1).padStart(2,"0"),s=String(r.getDate()).padStart(2,"0"),a=String(r.getHours()).padStart(2,"0"),l=String(r.getMinutes()).padStart(2,"0"),`${o}-${s} ${a}:${l}`)}),e.commentCount>0&&(0,n.jsx)("span",{children:t("review.nComments",{count:e.commentCount})})]})]},e.id)})})]}),w&&r&&(0,n.jsx)("div",{className:"fixed z-[60] px-2 py-1 text-xs bg-popover text-popover-foreground border border-border rounded shadow-md whitespace-nowrap pointer-events-none",style:{top:w.top,left:w.left-8,transform:"translate(-100%, -50%)"},children:w.text}),(0,n.jsx)(l.ReviewCommentsListModal,{isOpen:y.open,onClose:()=>C(e=>({...e,open:!1})),comments:y.comments,reviewTitle:y.title,userNameMap:y.userNameMap})]})}}}]);
|