@withgraphite/graphite-cli 1.7.13 → 1.7.15
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/.CHANGELOG.md +7 -0
- package/graphite.js +1 -1
- package/package.json +1 -1
- package/build/asset-manifest.json +0 -20
- package/build/favicon.ico +0 -0
- package/build/index.html +0 -1
- package/build/manifest.json +0 -15
- package/build/static/css/603.b5b455ea.chunk.css +0 -2
- package/build/static/css/main.18f97c48.css +0 -2
- package/build/static/js/447.f60d5f2f.chunk.js +0 -2
- package/build/static/js/447.f60d5f2f.chunk.js.LICENSE.txt +0 -33
- package/build/static/js/603.0c99f909.chunk.js +0 -1
- package/build/static/js/main.js +0 -2
- package/build/static/js/main.js.LICENSE.txt +0 -39
- package/build/static/media/codicon.fa2cc0ab9f0bec2b3365.ttf +0 -0
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
object-assign
|
|
3
|
-
(c) Sindre Sorhus
|
|
4
|
-
@license MIT
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* @license
|
|
9
|
-
* Lodash <https://lodash.com/>
|
|
10
|
-
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
11
|
-
* Released under MIT license <https://lodash.com/license>
|
|
12
|
-
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
13
|
-
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* @license React
|
|
18
|
-
* react-is.production.min.js
|
|
19
|
-
*
|
|
20
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
21
|
-
*
|
|
22
|
-
* This source code is licensed under the MIT license found in the
|
|
23
|
-
* LICENSE file in the root directory of this source tree.
|
|
24
|
-
*/
|
|
25
|
-
|
|
26
|
-
/** @license React v16.13.1
|
|
27
|
-
* react-is.production.min.js
|
|
28
|
-
*
|
|
29
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
|
-
*
|
|
31
|
-
* This source code is licensed under the MIT license found in the
|
|
32
|
-
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkGraphiteInteractive=self.webpackChunkGraphiteInteractive||[]).push([[603],{8603:(e,n,o)=>{o.r(n),o.d(n,{ComparisonView:()=>Ne,lineRange:()=>Le});var t=o(579),r=(o(8219),o(7581)),i=o(7873),s=o(7821),l=o.n(s),a=o(4812),c=o(1981),d=o(5626),p=o(5043);function u(e){let{children:n}=e;return(0,t.jsx)("div",{className:"empty-state",children:(0,t.jsx)("div",{children:n})})}var h=o(5213),m=o(4983),f=o(9192),g=o(9235),x=o(7528),v=o(4574),b=(o(1528),o(3026)),y=o(9703),j=o.n(y),S=o(3536);function w(e){return e.map((e=>e.includes(" ")?'"'.concat(e,'"'):e)).join(", ")}function C(e){return"string"==typeof e&&/(inset\s|)([0-9.]+(\w*)\s){1,4}(rgb[a]?\(.*\)|\w+)/.test(e)}function k(e,n){return Array.isArray(e)?e.filter(n):Object.entries(e).reduce(((e,o)=>{let[t,r]=o;if((0,S.isObject)(r)){const o=k(r,n);(0,S.isEmpty)(o)||(e[t]=o)}else n(r)&&(e[t]=r);return e}),{})}function T(e){const{scale:n}=e;return function(e,n){var o={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.indexOf(t)<0&&(o[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(t=Object.getOwnPropertySymbols(e);r<t.length;r++)n.indexOf(t[r])<0&&Object.prototype.propertyIsEnumerable.call(e,t[r])&&(o[t[r]]=e[t[r]])}return o}(e,["scale"])}const{lineHeight:L}=j().typography.normal,O={animation:{easeOutCubic:"cubic-bezier(0.33, 1, 0.68, 1)"},borderWidths:[0,"1px"],breakpoints:["544px","768px","1012px","1280px"],fonts:{normal:w(["-apple-system","BlinkMacSystemFont","Segoe UI","Noto Sans","Helvetica","Arial","sans-serif","Apple Color Emoji","Segoe UI Emoji"]),mono:w(["SFMono-Regular","Consolas","Liberation Mono","Menlo","Courier","monospace"])},fontSizes:["12px","14px","16px","20px","24px","32px","40px","48px"],fontWeights:{light:300,normal:400,semibold:500,bold:600},lineHeights:L,radii:["0","3px","6px","100px"],sizes:{small:"544px",medium:"768px",large:"1012px",xlarge:"1280px"},space:["0","4px","8px","16px","24px","32px","40px","48px","64px","80px","96px","112px","128px"],colorSchemes:Object.entries(j().colors).reduce(((e,n)=>{let[o,t]=n;const{colors:r,shadows:i}=function(e){return{colors:k(e,(e=>function(e){return!(C(e)||!e.startsWith("#")&&!e.startsWith("rgb")&&!e.startsWith("hsl"))}(e))),shadows:k(e,(e=>C(e)))}}(t);return Object.assign(Object.assign({},e),{[o]:{colors:T(r),shadows:T(i)}})}),{})},{Jt:N,Zz:E,qU:M}=b,A=E(b.xe,b.yW,b.Vy),F=M({whiteSpace:{property:"whiteSpace"}}),I=E(b.Il,F);E(b.PQ,b.r7),b.Zp;var R=o(7789),P=o.n(R),B=o(7950);const D="light",H="dark",z=(0,p.createContext)({setColorMode:()=>null,setDayScheme:()=>null,setNightScheme:()=>null}),W=e=>{var n,o,r,i,s,l,a,c,{children:d}=e,u=function(e,n){var o={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.indexOf(t)<0&&(o[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(t=Object.getOwnPropertySymbols(e);r<t.length;r++)n.indexOf(t[r])<0&&Object.prototype.propertyIsEnumerable.call(e,t[r])&&(o[t[r]]=e[t[r]])}return o}(e,["children"]);const{theme:h,colorMode:m,dayScheme:f,nightScheme:g}=_(),x=null!==(o=null!==(n=u.theme)&&void 0!==n?n:h)&&void 0!==o?o:O,{resolvedServerColorMode:b}=(()=>{var e;try{const n=null===(e=document.getElementById("__PRIMER_DATA__"))||void 0===e?void 0:e.textContent;if(n)return JSON.parse(n)}catch(e){}return{}})(),y=(0,p.useRef)(b),[j,S]=(0,p.useState)(null!==(i=null!==(r=u.colorMode)&&void 0!==r?r:m)&&void 0!==i?i:"day"),[w,C]=(0,p.useState)(null!==(l=null!==(s=u.dayScheme)&&void 0!==s?s:f)&&void 0!==l?l:D),[k,T]=(0,p.useState)(null!==(c=null!==(a=u.nightScheme)&&void 0!==a?a:g)&&void 0!==c?c:H),L=function(){const[e,n]=(0,p.useState)(U);return(0,p.useEffect)((()=>{var e;const o=null===(e=null===window||void 0===window?void 0:window.matchMedia)||void 0===e?void 0:e.call(window,"(prefers-color-scheme: dark)");function t(e){const o=e.matches;n(o?"night":"day")}if(o){if(void 0!==o.addEventListener)return o.addEventListener("change",t),function(){o.removeEventListener("change",t)};if(void 0!==o.addListener)return o.addListener(t),function(){o.removeListener(t)}}}),[]),e}(),N=y.current||J(j,L),E=function(e,n,o){switch(e){case"day":case"light":return n;case"dark":case"night":return o}}(N,w,k),{resolvedTheme:M,resolvedColorScheme:A}=(0,p.useMemo)((()=>function(e,n){if(!e.colorSchemes)return{resolvedTheme:e,resolvedColorScheme:void 0};if(!e.colorSchemes[n]){console.error("`".concat(n,"` scheme not defined in `theme.colorSchemes`"));const o=Object.keys(e.colorSchemes)[0];return{resolvedTheme:o?P()(e,e.colorSchemes[o]):e,resolvedColorScheme:o}}return{resolvedTheme:P()(e,e.colorSchemes[n]),resolvedColorScheme:n}}(x,E)),[x,E]),F=(0,p.useMemo)((()=>({theme:M,colorScheme:E,colorMode:j,resolvedColorMode:N,resolvedColorScheme:A,dayScheme:w,nightScheme:k,setColorMode:S,setDayScheme:C,setNightScheme:T})),[j,E,w,k,N,A,M]);return(0,p.useEffect)((function(){const e=J(j,L);y.current&&(y.current!==e&&window.setTimeout((()=>{(0,B.flushSync)((()=>{S(e)})),S(j)})),y.current=null)}),[j,L]),(0,p.useEffect)((()=>{var e,n;S(null!==(n=null!==(e=u.colorMode)&&void 0!==e?e:m)&&void 0!==n?n:"day")}),[u.colorMode,m]),(0,p.useEffect)((()=>{var e,n;C(null!==(n=null!==(e=u.dayScheme)&&void 0!==e?e:f)&&void 0!==n?n:D)}),[u.dayScheme,f]),(0,p.useEffect)((()=>{var e,n;T(null!==(n=null!==(e=u.nightScheme)&&void 0!==e?e:g)&&void 0!==n?n:H)}),[u.nightScheme,g]),(0,t.jsx)(z.Provider,{value:F,children:(0,t.jsxs)(v.NP,{theme:M,children:[d,u.preventSSRMismatch?(0,t.jsx)("script",{type:"application/json",id:"__PRIMER_DATA__",dangerouslySetInnerHTML:{__html:JSON.stringify({resolvedServerColorMode:N})}}):null]})})};function _(){return(0,p.useContext)(z)}function U(){var e,n;return"undefined"!=typeof window&&(null===(n=null===(e=window.matchMedia)||void 0===e?void 0:e.call(window,"(prefers-color-scheme: dark)"))||void 0===n?void 0:n.matches)?"night":"day"}function J(e,n){return"auto"===e?n:e}var V,G;const q=(0,v.DU)(V||(V=(0,x.A)(["\n * { box-sizing: border-box; }\n body { margin: 0; }\n table { border-collapse: collapse; }\n input { color-scheme: ",'; }\n\n [role="button"]:focus:not(:focus-visible):not(.focus-visible),\n [role="tabpanel"][tabindex="0"]:focus:not(:focus-visible):not(.focus-visible),\n button:focus:not(:focus-visible):not(.focus-visible),\n summary:focus:not(:focus-visible):not(.focus-visible),\n a:focus:not(:focus-visible):not(.focus-visible) {\n outline: none;\n box-shadow: none;\n }\n\n [tabindex="0"]:focus:not(:focus-visible):not(.focus-visible),\n details-dialog:focus:not(:focus-visible):not(.focus-visible) {\n outline: none;\n }\n'])),(e=>e.colorScheme)),K=v.Ay.div(G||(G=(0,x.A)(["\n ",";\n ",";\n"])),I,A);function X(e){var{children:n,color:o="fg.default",fontFamily:r="normal",lineHeight:i="default"}=e,s=function(e,n){var o={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.indexOf(t)<0&&(o[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(t=Object.getOwnPropertySymbols(e);r<t.length;r++)n.indexOf(t[r])<0&&Object.prototype.propertyIsEnumerable.call(e,t[r])&&(o[t[r]]=e[t[r]])}return o}(e,["children","color","fontFamily","lineHeight"]);const{colorScheme:l,dayScheme:a,nightScheme:c}=_();return(0,t.jsxs)(K,Object.assign({},s,{color:o,fontFamily:r,lineHeight:i,"data-portal-root":!0,"data-color-mode":(null==l?void 0:l.includes("dark"))?"dark":"light","data-light-theme":a,"data-dark-theme":c,children:[(0,t.jsx)(q,{colorScheme:(null==l?void 0:l.includes("dark"))?"dark":"light"}),n]}))}var Z=o(4767),Q=o(9451),Y=o(336),$=o(205);const ee=e=>(0,$.Ay)(e.sx),ne=v.Ay.div(b.xe,b.yW,b.Il,b.Zp,b.pn,b.Vg,b.Tp,b.PQ,b.G1,b.r7,ee);var oe,te=o(5550);const re=v.Ay.span(oe||(oe=(0,x.A)(["\n ",";\n ",";\n ",";\n"])),I,A,ee);function ie(e){let{ctx:n,path:o,diffType:r,open:i,onChangeOpen:s}=e;const l=void 0===r?"fg.muted":se[r],a=o.split("/");return(0,t.jsxs)(ne,{className:"split-diff-view-file-header",display:"flex",alignItems:"center",bg:"accent.subtle",color:l,paddingX:2,paddingY:1,lineHeight:2,backgroundColor:"canvas.subtle",borderTopRightRadius:2,borderTopLeftRadius:2,borderBottomColor:"border.default",borderBottomStyle:"solid",borderBottomWidth:"1px",children:[s?(0,t.jsx)(ne,{paddingRight:2,onClick:()=>s(!i),sx:{cursor:"pointer"},children:i?(0,t.jsx)(te.Mtm,{size:24}):(0,t.jsx)(te.D3D,{size:24})}):null,void 0!==r&&(0,t.jsx)(m.I,{icon:le[r]}),(0,t.jsx)(re,{fontFamily:"mono",fontSize:12,children:a.reduce(((e,o,r)=>{const i=a.slice(r).join("/"),s=null==n?void 0:n.copy;return(0,t.jsxs)("span",{className:s?"file-header-copyable-path":void 0,children:[e,(0,t.jsxs)("span",{title:s?"Copy ".concat(i):void 0,onClick:s?()=>s(i):void 0,className:"file-header-path-element",children:[o,r<a.length-1?"/":""]})]},r)}),(0,t.jsx)("span",{}))})]})}const se={Modified:"var(--scm-modified-foreground)",Added:"var(--scm-added-foreground)",Removed:"var(--scm-removed-foreground)",Renamed:"var(--scm-modified-foreground)",Copied:"var(--scm-added-foreground)"},le={Modified:"diff-modified",Added:"diff-added",Removed:"diff-removed",Renamed:"diff-renamed",Copied:"diff-renamed"};var ae,ce=o(93);const de={small:"16px",medium:"32px",large:"64px"},pe=(0,v.Ay)((function(e){var{size:n="medium"}=e,o=function(e,n){var o={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.indexOf(t)<0&&(o[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(t=Object.getOwnPropertySymbols(e);r<t.length;r++)n.indexOf(t[r])<0&&Object.prototype.propertyIsEnumerable.call(e,t[r])&&(o[t[r]]=e[t[r]])}return o}(e,["size"]);const r=de[n];return(0,t.jsxs)("svg",Object.assign({height:r,width:r,viewBox:"0 0 16 16",fill:"none"},o,{children:[(0,t.jsx)("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeOpacity:"0.25",strokeWidth:"2",vectorEffect:"non-scaling-stroke"}),(0,t.jsx)("path",{d:"M15 8a7.002 7.002 0 00-7-7",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",vectorEffect:"non-scaling-stroke"})]}))}))(ae||(ae=(0,x.A)(["\n @keyframes rotate-keyframes {\n 100% {\n transform: rotate(360deg);\n }\n }\n\n animation: rotate-keyframes 1s linear infinite;\n\n ","\n"])),ee);function ue(e){let n,o,{beforeLineNumber:r,before:i,afterLineNumber:s,after:l,rowType:a,path:c,openFileToLine:d}=e;switch(a){case"remove":n="patch-remove-line",o=void 0;break;case"modify":n="patch-remove-line",o="patch-add-line";break;case"add":n=void 0,o="patch-add-line";break;case"common":n=void 0,o=void 0;break;case"expanded":n="patch-expanded",o="patch-expanded"}const p="expanded"!==a;return(0,t.jsxs)("tr",{children:[(0,t.jsx)(he,{className:n,content:i,lineNumber:r,path:c,side:"LEFT",canComment:p}),(0,t.jsx)(he,{className:o,content:l,lineNumber:s,path:c,side:"RIGHT",canComment:p,openFileToLine:d})]})}function he(e){let{className:n,content:o,lineNumber:r,path:i,side:s,openFileToLine:l}=e;const a="RIGHT"===s?me:{},c=null!=l&&null!=r,d=(null!=n?" ".concat(n,"-number"):"")+(c?" clickable":"");return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ne,Object.assign({as:"td",className:"lineNumber".concat(d),"data-line-number":r,"data-path":i,"data-side":s,onClick:c?()=>l(r):void 0},a,{children:r})),(0,t.jsx)("td",{className:n,children:o})]})}pe.displayName="Spinner";const me={borderLeftWidth:"1px",borderLeftStyle:"solid",borderLeftColor:"border.default"},fe=(0,p.memo)((function(e){let{ctx:n,path:o,patch:r,preamble:i}=e;var s;const[l,a]=(0,p.useState)(!1),[c,d]=(0,p.useState)((()=>new Set)),u=(0,p.useCallback)((e=>{const n=new Set(c);n.add(e),d(n)}),[c,d]),h=null!==(s=n.translate)&&void 0!==s?s:e=>e,m="/dev/null"===r.newFileName,{hunks:f}=r,g=f.length-1,x=[...null!=i?i:[]];return!m||l?f.forEach(((e,r)=>{if(0===r&&(1!==e.oldStart||1!==e.newStart)){const r="s0";if(c.has(r)){const i={id:n.id,start:1,numLines:e.oldStart-1};x.push((0,t.jsx)(be,{ctx:n,range:i,path:o,beforeLineStart:1,afterLineStart:1,t:h},r))}else{const n=Math.max(e.oldStart,e.newStart)-1;x.push((0,t.jsx)(ve,{numLines:n,onExpand:()=>u(r),t:h},r))}}if(function(e,n,o,r){const{oldStart:i,newStart:s,lines:l}=e,a=function(e){const n=[];let o={common:[],removed:[],added:[]};return e.forEach((e=>{const t=e.charAt(0),r=e.slice(1);" "===t?(function(e){return 0!==e.removed.length||0!==e.added.length}(o)&&(n.push(o),o={common:[],removed:[],added:[]}),o.common.push(r)):"-"===t?o.removed.push(r):"+"===t&&o.added.push(r)})),n.push(o),n}(l);let c=i,d=s;a.forEach((e=>{const{common:i,removed:s,added:l}=e;ge(i,n,"common",c,d,o,r),c+=i.length,d+=i.length;const a=Math.max(s.length,l.length);for(let e=0;e<a;++e){const i=s[e],a=l[e];if(null!=i&&null!=a){const e=xe(i,a),[s,l]=e;o.push((0,t.jsx)(ue,{beforeLineNumber:c,before:s,afterLineNumber:d,after:l,rowType:"modify",path:n,openFileToLine:r},"".concat(c,"/").concat(d))),++c,++d}else null!=i?(o.push((0,t.jsx)(ue,{beforeLineNumber:c,before:i,afterLineNumber:null,after:null,rowType:"remove",path:n,openFileToLine:r},"".concat(c,"/"))),++c):(o.push((0,t.jsx)(ue,{beforeLineNumber:null,before:null,afterLineNumber:d,after:a,rowType:"add",path:n,openFileToLine:r},"/".concat(d))),++d)}}))}(e,o,x,n.openFileToLine),r!==g){const i=f[r+1],s="s".concat(e.oldStart);if(c.has(s)){const r=e.oldStart+e.oldLines,l=i.oldStart-r,a={id:n.id,start:r,numLines:l};x.push((0,t.jsx)(be,{ctx:n,range:a,path:o,beforeLineStart:e.oldStart+e.oldLines,afterLineStart:e.newStart+e.newLines,t:h},s))}else{const n=i.oldStart-e.oldLines-e.oldStart;x.push((0,t.jsx)(ve,{numLines:n,onExpand:()=>u(s),t:h},s))}}})):x.push((0,t.jsx)(ye,{children:(0,t.jsxs)(ne,{display:"inline-block",onClick:()=>a(!0),padding:1,sx:{cursor:"pointer",":hover":{bg:"accent.emphasis",color:"fg.onEmphasis"}},children:[(0,t.jsx)(te.e0J,{size:16}),(0,t.jsx)(re,{paddingX:4,children:"Show deleted file"}),(0,t.jsx)(te.e0J,{size:16})]})},"show-deleted")),(0,t.jsxs)("table",{className:"SplitDiffView-hunk-table",children:[(0,t.jsxs)("colgroup",{children:[(0,t.jsx)("col",{width:50}),(0,t.jsx)("col",{width:"50%"}),(0,t.jsx)("col",{width:50}),(0,t.jsx)("col",{width:"50%"})]}),(0,t.jsx)("tbody",{children:x})]})}));function ge(e,n,o,r,i,s,l){let a=r,c=i;e.forEach((e=>{s.push((0,t.jsx)(ue,{beforeLineNumber:a,before:e,afterLineNumber:c,after:e,rowType:o,path:n,openFileToLine:l},"".concat(a,"/").concat(c))),++a,++c}))}function xe(e,n){if(e.length+n.length>300)return[e,n];const o=(0,ce.JJ)(e,n),r=[],i=[];return o.forEach(((e,n)=>{const{added:o,removed:s,value:l}=e;o?i.push((0,t.jsx)("span",{className:"patch-add-word",children:l},n)):s?r.push((0,t.jsx)("span",{className:"patch-remove-word",children:l},n)):(r.push(l),i.push(l))})),[r,i]}function ve(e){let{numLines:n,onExpand:o}=e;if(0===n)return null;const r=1===n?"Expand 1 line":"Expand ".concat(n," lines");return(0,t.jsx)(ye,{children:(0,t.jsxs)(ne,{display:"inline-block",onClick:o,padding:1,sx:{cursor:"pointer",":hover":{bg:"accent.emphasis",color:"fg.onEmphasis"}},children:[(0,t.jsx)(te.e0J,{size:16}),(0,t.jsx)(re,{paddingX:4,children:r}),(0,t.jsx)(te.e0J,{size:16})]})})}const be=(0,c.PA)((function(e){let{ctx:n,path:o,range:r,beforeLineStart:i,afterLineStart:s}=e;const l=n.atoms.lineRange(r).get();switch(l.state){case"fulfilled":{const e=[];return ge(l.value,o,"expanded",i,s,e,n.openFileToLine),(0,t.jsx)(t.Fragment,{children:e})}case"pending":return(0,t.jsx)(ye,{children:(0,t.jsx)(ne,{padding:1,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",children:(0,t.jsxs)(ne,{display:"flex",alignItems:"center",children:[(0,t.jsx)(pe,{size:"small"}),(0,t.jsx)(re,{marginLeft:2,children:"Loading..."})]})})});case"rejected":return(0,t.jsx)(ye,{children:(0,t.jsx)(ne,{padding:1,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",children:(0,t.jsx)(ne,{display:"flex",alignItems:"center",children:(0,t.jsxs)(re,{children:["Error: ",l.value.message]})})})})}}));function ye(e){let{children:n}=e;return(0,t.jsx)(ne,{as:"tr",bg:"accent.subtle",color:"fg.muted",height:12,children:(0,t.jsx)(ne,{as:"td",colSpan:4,className:"separator",children:n})})}function je(e){let{ctx:n,path:o,patch:r}=e;var s,l,a,c;const d=null!==(l=null!==(s=r.newFileName)&&void 0!==s?s:r.oldFileName)&&void 0!==l?l:"/dev/null",p=fe,u=[];return r.type===i.DiffType.Added&&u.push((0,t.jsx)(Se,{children:"This file was added"},"added")),r.type===i.DiffType.Removed&&u.push((0,t.jsx)(Se,{children:"This file was removed"},"deleted")),r.type===i.DiffType.Renamed&&u.push((0,t.jsxs)(Se,{children:["This file was renamed from ",null!==(a=r.oldFileName)&&void 0!==a?a:""]},"renamed")),r.type===i.DiffType.Copied&&u.push((0,t.jsxs)(Se,{children:["This file was copied from ",null!==(c=r.oldFileName)&&void 0!==c?c:""]},"copied")),(0,t.jsxs)(ne,{className:"split-diff-view",borderWidth:"1px",borderStyle:"solid",borderColor:"border.default",borderRadius:2,children:[(0,t.jsx)(ie,{ctx:n,path:d,diffType:r.type}),(0,t.jsx)(p,{ctx:n,path:o,patch:r,preamble:u})]})}function Se(e){let{children:n}=e;return(0,t.jsx)(ne,{as:"tr",bg:"attention.subtle",color:"fg.muted",height:12,children:(0,t.jsx)(ne,{as:"td",colSpan:4,className:"separator",children:(0,t.jsx)(ne,{padding:1,children:n})})})}const we=(0,p.memo)((0,c.PA)((function(){const{theme:e}=_();return(0,t.jsx)("style",{children:"\n.patch-word-begin {\n border-top-left-radius: .2em;\n border-bottom-left-radius: .2em;\n}\n\n.patch-word-end {\n border-top-right-radius: .2em;\n border-bottom-right-radius: .2em;\n}\n\n.patch-add-line {\n background-color: ".concat(null==e?void 0:e.colors.diffBlob.addition.lineBg,";\n}\n\n.patch-add-line-number {\n color: ").concat(null==e?void 0:e.colors.diffBlob.addition.numText,";\n background-color: ").concat(null==e?void 0:e.colors.diffBlob.addition.numBg,";\n}\n\n.patch-add-word {\n background-color: ").concat(null==e?void 0:e.colors.diffBlob.addition.wordBg,";\n}\n\n.patch-remove-line {\n background-color: ").concat(null==e?void 0:e.colors.diffBlob.deletion.lineBg,";\n}\n\n.patch-remove-line-number {\n color: ").concat(null==e?void 0:e.colors.diffBlob.deletion.numText,";\n background-color: ").concat(null==e?void 0:e.colors.diffBlob.deletion.numBg,";\n}\n\n.patch-remove-word {\n background-color: ").concat(null==e?void 0:e.colors.diffBlob.deletion.wordBg,";\n}\n\n.patch-expanded, .patch-expanded-number {\n background-color: ").concat(null==e?void 0:e.colors.canvas.subtle,";\n}\n\n.patch-expanded-number {\n color: ").concat(null==e?void 0:e.colors.fg.subtle,";\n}\n\n.SplitDiffView-hunk-table td {\n font-family: ").concat(null==e?void 0:e.fonts.mono,"\n}\n\n.lineNumber.clickable {\n cursor: pointer;\n}\n\n.lineNumber.clickable:hover {\n text-decoration: underline;\n}\n/**\n * pl = prettylights theme\n *\n * Mapping from CSS class name to Primer color deduced from a combination of:\n * https://cdn.jsdelivr.net/npm/github-syntax-theme-generator@0.5.0/build/css/github-light.css\n * https://primer.style/react/theme-reference\n *\n * Though it is a bit confusing because github-light.css defines some classes\n * multiple times, such as .pl-s.\n */\n\n.pl-ba {\n color: ").concat(null==e?void 0:e.colors.prettylights.syntax.brackethighlighterAngle,";\n}\n\n.pl-bu {\n color: ").concat(null==e?void 0:e.colors.prettylights.syntax.brackethighlighterUnmatched,";\n}\n\n.pl-c {\n color: ").concat(null==e?void 0:e.colors.prettylights.syntax.comment,";\n}\n\n.pl-c1 {\n color: ").concat(null==e?void 0:e.colors.prettylights.syntax.constant,";\n}\n\n.pl-c2 {\n background-color: ").concat(null==e?void 0:e.colors.prettylights.syntax.carriageReturnBg,";\n color: ").concat(null==e?void 0:e.colors.prettylights.syntax.carriageReturnText,';\n}\n\n.pl-c2::before {\n content: "^M";\n}\n\n.pl-corl {\n color: ').concat(null==e?void 0:e.colors.prettylights.syntax.constantOtherReferenceLink,";\n text-decoration: underline;\n}\n\n.pl-e, .pl-en {\n color: ").concat(null==e?void 0:e.colors.prettylights.syntax.entity,";\n}\n\n.pl-ent {\n color: ").concat(null==e?void 0:e.colors.prettylights.syntax.entityTag,";\n}\n\n.pl-ii {\n background-color: ").concat(null==e?void 0:e.colors.prettylights.syntax.invalidIllegalBg,";\n color: ").concat(null==e?void 0:e.colors.prettylights.syntax.invalidIllegalText,";\n}\n\n.pl-k {\n color: ").concat(null==e?void 0:e.colors.prettylights.syntax.keyword,";\n}\n\n.pl-s, .pl-pds {\n color: ").concat(null==e?void 0:e.colors.prettylights.syntax.string,";\n}\n\n.pl-sg {\n color: ").concat(null==e?void 0:e.colors.prettylights.syntax.sublimelinterGutterMark,";\n}\n\n.pl-smi {\n color: ").concat(null==e?void 0:e.colors.prettylights.syntax.storageModifierImport,";\n}\n\n.pl-sr {\n color: ").concat(null==e?void 0:e.colors.prettylights.syntax.stringRegexp,";\n font-weight: bold;\n}\n\n.pl-v {\n color: ").concat(null==e?void 0:e.colors.prettylights.syntax.variable,";\n}\n")})})));var Ce=o(1891);function ke(e){return(0,i.parsePatch)(e).filter((e=>e.hunks.length>0||null!=e.newFileName||null!=e.oldFileName))}const Te=(0,f.T)({genKey:e=>{switch(e.type){case i.ComparisonType.Range:throw new Error("Version comparison not supported");case i.ComparisonType.Committed:return"Committed ".concat(e.hash);case i.ComparisonType.Commit:throw new Error("Commit comparison not supported");case i.ComparisonType.HeadChanges:return"HEAD";case i.ComparisonType.StackChanges:return"STACK";case i.ComparisonType.UncommittedChanges:return"UNCOMMITTED"}},genValue:e=>(0,g.s)({default:{isLoading:!0,data:null},setter:n=>{n.isLoading&&Q.A.postMessage({type:"requestComparison",comparison:e})},effects:[n=>{let{setSelf:o}=n;const t=Q.A.onMessageOfType("comparison",(n=>{var t,r;e.type===n.comparison.type&&o({isLoading:!1,data:(t=n.data.diff,r=ke,null==t.error?{value:r(t.value)}:t)})}));return()=>t.dispose()}]})}),Le=(0,f.T)({genKey:e=>l()(e),genValue:e=>(0,a.EW)((()=>{Y.jn.get(),Q.A.postMessage(Object.assign({type:"requestComparisonContextLines"},e));const n=new Promise((e=>{const n=Q.A.onMessageOfType("comparisonContextLines",(o=>{e(o.lines),n.dispose()}))}));return(0,d.Sx)(n)}))});function Oe(e){const n=Te(e);return[n.get(),(0,p.useCallback)((()=>{(0,a.h5)((()=>{const e=n.get();n.set(Object.assign(Object.assign({},e),{isLoading:!0}))}))}),[n])]}const Ne=(0,c.PA)((function(e){let{comparison:n}=e;const o=(0,Z.m)(),[r,i]=Oe(n);return(0,p.useEffect)(i,[n,i]),(0,t.jsx)("div",{"data-testid":"comparison-view",className:"comparison-view",children:(0,t.jsxs)(W,{colorMode:"light"===o.colorScheme?"day":"night",children:[(0,t.jsx)(we,{}),(0,t.jsxs)(X,{className:"comparison-view-base-styles",children:[(0,t.jsx)(Me,{comparison:n}),(0,t.jsx)("div",{className:"comparison-view-details",children:null==r.data?(0,t.jsx)(m.I,{icon:"loading"}):null!=r.data.error?(0,t.jsx)(h.P,{error:r.data.error,title:"Unable to load comparison"}):0===r.data.value.length?(0,t.jsx)(u,{children:"No Changes"}):r.data.value.map(((e,o)=>(0,t.jsx)(Ae,{diff:e,comparison:n},o)))})]})]})})})),Ee=[i.ComparisonType.UncommittedChanges,i.ComparisonType.HeadChanges,i.ComparisonType.StackChanges],Me=(0,c.PA)((function(e){let{comparison:n}=e;const[o,s]=Oe(n);return(0,t.jsx)(t.Fragment,{children:(0,t.jsxs)("div",{className:"comparison-view-header",children:[(0,t.jsxs)("span",{className:"comparison-view-header-group",children:[(0,t.jsxs)(r.yT,{"data-testid":"comparison-view-picker",value:n.type,onChange:e=>{const n=Ce.k.get();Ce.k.set(Object.assign(Object.assign({},n),{comparison:{type:e.currentTarget.value}}))},children:[Ee.map((e=>(0,t.jsx)(r.eH,{value:e,children:(0,i.labelForComparison)({type:e})},e))),Ee.includes(n.type)?null:(0,t.jsx)(r.eH,{value:n.type,children:(0,i.labelForComparison)(n)},n.type)]}),(0,t.jsx)(r.Ls,{title:"Reload this comparison. Comparisons do not refresh automatically.",appearance:"secondary",onClick:s,children:(0,t.jsx)(m.I,{icon:"refresh","data-testid":"comparison-refresh-button"})}),o.isLoading?(0,t.jsx)(m.I,{icon:"loading","data-testid":"comparison-loading"}):null]}),(0,t.jsx)(r.Ls,{"data-testid":"close-comparison-view-button",appearance:"icon",onClick:()=>(0,a.h5)((()=>{const e=Ce.k.get();Ce.k.set(Object.assign(Object.assign({},e),{visible:!1}))})),children:(0,t.jsx)(m.I,{icon:"x"})})]})})}));function Ae(e){let{diff:n,comparison:o}=e;var r,i;const s=(0,Z.m)(),l=null!==(i=null!==(r=n.newFileName)&&void 0!==r?r:n.oldFileName)&&void 0!==i?i:"",a={id:{path:l,comparison:o},atoms:{lineRange:Le},copy:s.copyToClipboard,openFileToLine:Fe(o)?e=>s.openFile(l,{line:e}):void 0};return(0,t.jsx)("div",{className:"comparison-view-file",children:(0,t.jsx)(je,{ctx:a,patch:n,path:l})},l)}function Fe(e){switch(e.type){case i.ComparisonType.UncommittedChanges:case i.ComparisonType.HeadChanges:case i.ComparisonType.StackChanges:return!0;case i.ComparisonType.Committed:case i.ComparisonType.Commit:case i.ComparisonType.Range:return!1}}}}]);
|