offsite 0.0.90 → 0.0.91
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/apps/client/dist/assets/diff-panel-CeJqpNi8.js +260 -0
- package/apps/client/dist/assets/index-jGMjVlGq.js +72 -0
- package/apps/client/dist/assets/panel-close-button-Bf-0TdmN.js +1 -0
- package/apps/client/dist/index.html +2 -2
- package/apps/client/dist/sw.js +1 -1
- package/package.json +1 -1
- package/apps/client/dist/assets/diff-panel-CttCts3n.js +0 -260
- package/apps/client/dist/assets/dist-D99rUXSZ.js +0 -1
- package/apps/client/dist/assets/index-Cb96Ipx_.js +0 -72
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{a as t,o as n,r,t as i}from"./panel-close-button-Bf-0TdmN.js";import{n as a,r as o,t as s}from"./TextWrapIcon-BRhMbXe9.js";import{t as c}from"./ChevronsDownUpIcon-BNVFd2te.js";import{a as l,t as u}from"./button-CWFREsRn.js";import{An as d,Ft as f,G as p,Gn as m,N as h,P as g,W as _,Wn as v,at as y,cn as b,gt as x,ot as S,zt as C}from"./dist-Jliw2AH0.js";import{c as w,l as T,r as E}from"./utils-U6QfaJBO.js";import{F as D,M as O,in as k,j as A,m as j}from"./XIcon-CDJz0EhT.js";function M(e,t){let n=0;for(let r=0;r<e.length;r++)n+=t(e[r],r);return n}var N=[[`path`,{d:`M18.2505 10.5H19.6403C21.4918 10.5 22.0421 10.7655 21.9975 12.0838C21.9237 14.2674 20.939 16.8047 17 17.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M5.94627 20.6145C2.57185 18.02 2.07468 14.3401 2.00143 10.5001C1.96979 8.8413 2.45126 8.5 4.65919 8.5H15.3408C17.5487 8.5 18.0302 8.8413 17.9986 10.5001C17.9253 14.3401 17.4281 18.02 14.0537 20.6145C13.0934 21.3528 12.2831 21.5 10.9194 21.5H9.08064C7.71686 21.5 6.90658 21.3528 5.94627 20.6145Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M11.3089 2.5C10.7622 2.83861 10.0012 4 10.0012 5.5M7.53971 4C7.53971 4 7 4.5 7 5.5M14.0012 4C13.7279 4.1693 13.5 5 13.5 5.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}]],P=[[`path`,{d:`M3.89124 3.89124C5.28249 2.5 7.52166 2.5 12 2.5C16.4783 2.5 18.7175 2.5 20.1088 3.89124C21.5 5.28249 21.5 7.52166 21.5 12C21.5 16.4783 21.5 18.7175 20.1088 20.1088C18.7175 21.5 16.4783 21.5 12 21.5C7.52166 21.5 5.28249 21.5 3.89124 20.1088C2.5 18.7175 2.5 16.4783 2.5 12C2.5 7.52166 2.5 5.28249 3.89124 3.89124Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M12 2.5V21.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`1`}]],F=[[`path`,{d:`M2.49219 15.5H21.4922`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M2.49219 8.5H21.4922`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M2.49219 12C2.49219 7.52166 2.49219 5.28249 3.88343 3.89124C5.27467 2.5 7.51384 2.5 11.9922 2.5C16.4705 2.5 18.7097 2.5 20.1009 3.89124C21.4922 5.28249 21.4922 7.52166 21.4922 12C21.4922 16.4783 21.4922 18.7175 20.1009 20.1088C18.7097 21.5 16.4705 21.5 11.9922 21.5C7.51384 21.5 5.27467 21.5 3.88343 20.1088C2.49219 18.7175 2.49219 16.4783 2.49219 12Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`2`}]],I=e(T(),1);function L(e){let t=(0,I.useRef)(e);return(0,I.useInsertionEffect)(()=>void(t.current=e)),(0,I.useCallback)((...e)=>t.current(...e),[])}var R=w(),z=(0,I.createContext)(void 0);function B(){return(0,I.useContext)(z)}var V={position:`absolute`,top:0,bottom:0,textAlign:`center`,whiteSpace:`normal`,touchAction:`none`},H={display:`contents`};function U(){return null}function W({fileDiff:e,actions:t,renderCustomHeader:n,renderHeaderPrefix:r,renderHeaderFilenameSuffix:i,renderHeaderMetadata:a,renderAnnotation:o,renderGutterUtility:s,renderMergeConflictUtility:c,lineAnnotations:l,getHoveredLine:u,getInstance:f,getAnnotationSlotName:p=C}){let m=n?.(e),h=r?.(e),g=i?.(e),_=a?.(e);return(0,R.jsxs)(R.Fragment,{children:[m==null?(0,R.jsxs)(R.Fragment,{children:[h!=null&&(0,R.jsx)(`div`,{slot:`header-prefix`,children:h}),g!=null&&(0,R.jsx)(`div`,{slot:`header-filename-suffix`,children:g}),_!=null&&(0,R.jsx)(`div`,{slot:`header-metadata`,children:_})]}):(0,R.jsx)(`div`,{slot:d,children:m}),o!=null&&l?.map((t,n)=>(0,R.jsx)(`div`,{slot:p(t),children:o(t,e)},n)),t!=null&&c!=null&&f!=null&&t.map(t=>{if(t==null)return;let n=G(t,e);return(0,R.jsx)(`div`,{slot:n,style:H,children:c(t,f)},n)}),s!=null&&(0,R.jsx)(`div`,{slot:`gutter-utility-slot`,style:V,children:s(u)})]})}function G(e,t){let n=h(e,t);return n==null?void 0:g({hunkIndex:n.hunkIndex,lineIndex:n.lineIndex,conflictIndex:e.conflictIndex})}var K=(0,I.createContext)(void 0);function q(e,t){return typeof window>`u`&&t!=null?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`template`,{shadowrootmode:`open`,dangerouslySetInnerHTML:{__html:t}}),e]}):(0,R.jsx)(R.Fragment,{children:e})}var J=(0,I.createContext)(void 0);function Y(){return(0,I.useContext)(J)}function ee(){let[e]=(0,I.useState)(()=>{let e=0,t;return{getSnapshot:()=>e,subscribe(e){return t=e,()=>{t=void 0}},forceUpdate(){e++,t?.()}}});return(0,I.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot),e.forceUpdate}function te(e,t){"use no memo";return e.current?.__getNextRenderData(t)}var ne=typeof window>`u`?I.useEffect:I.useLayoutEffect;function re({fileDiff:e,oldFile:t,newFile:n,options:r,editorOptions:i,editStateKey:a,lineAnnotations:o,selectedLines:s,prerenderedHTML:c,metrics:l,hasGutterRenderUtility:u,hasCustomHeader:d,disableWorkerPool:f,edit:h,onEditChange:g,onEditComplete:v}){let y=Y(),x=s!==void 0,S=(0,I.useContext)(K),w=B(),[T,E]=(0,I.useState)(),D=L(e=>g?.(e)),O=g==null?void 0:D,k=(0,I.useRef)(null),A=L(r=>{let i=v?.(r)??`reject`;return i===`accept`&&(k.current={fileDiff:{installed:r.fileDiff,stale:r.originalFileDiff},filePair:e==null?{fileDiff:r.fileDiff,installed:{oldFile:r.oldFile,newFile:r.newFile},stale:{oldFile:t??null,newFile:n??null}}:null,annotations:{installed:r.lineAnnotations,stale:r.originalLineAnnotations}}),i}),j=v==null?void 0:A,M=ie({acceptedCache:k,fileDiff:e,newFile:n,oldFile:t,parseDiffOptions:r?.parseDiffOptions}),N=(0,I.useRef)(null),P=ee(),F=te(N,ae(k,M,o))??{fileDiff:M,lineAnnotations:o??m},R=(0,I.useRef)(null),z=(0,I.useRef)(null),V=L(()=>{if(w==null)throw Error(`FileDiff: EditContext is not attached`);return w(`file-diff`,i??{},a)}),H=L(e=>{if(e!=null){if(N.current!=null)throw Error(`useFileDiffInstance: An instance should not already exist when a node is created`);y==null?N.current=new p(Q({controlledSelection:x,hasCustomHeader:d,hasGutterRenderUtility:u,onEditChange:O,onEditComplete:j,options:r}),f?void 0:S,P):N.current=new _(Q({controlledSelection:x,hasCustomHeader:d,hasGutterRenderUtility:u,onEditChange:O,onEditComplete:j,options:r}),y,l,f?void 0:S,P),N.current.hydrate({fileDiff:M,fileContainer:e,lineAnnotations:o,prerenderedHTML:c})}else{if(N.current==null)throw Error(`useFileDiffInstance: A FileDiff instance should exist when unmounting`);z.current=null,N.current.cleanUp(),N.current=null,R.current=null}});ne(()=>{let{current:e}=N;if(e==null)return;let t=Q({controlledSelection:x,hasCustomHeader:d,hasGutterRenderUtility:u,onEditChange:O,onEditComplete:j,options:r}),n=!b(e.options,t);if(e.setOptions(t),!h&&(z.current=null,R.current!=null)){let{current:e}=R;R.current=null,e()}let i=oe(M,o,k);if(e.render({forceRender:n,fileDiff:i.fileDiff,lineAnnotations:i.lineAnnotations}),s!==void 0&&e.setSelectedLines(s),!h||R.current!=null)return;if(w==null)throw Error(`FileDiff: EditContext is not attached`);let a=()=>{N.current===e&&R.current==null&&e.__canAttachEditor()&&(R.current=se(e,V),P())};if(e.__canAttachEditor()){z.current=null,a();return}let c=e.__prepareForEditing();if(c==null){z.current=null;return}if(z.current?.promise===c)return;let l={promise:c};z.current=l,c.then(()=>{z.current===l&&(a(),z.current=null)}).catch(e=>{z.current===l&&(z.current=null,E(e))})});let U=(0,I.useCallback)(()=>N.current?.getHoveredLine(),[]),W=(0,I.useCallback)(e=>N.current?.getAnnotationSlotName(e)??C(e),[]);if(T!=null)throw T;return{...F,ref:H,getHoveredLine:U,getAnnotationSlotName:W}}function ie({acceptedCache:e,fileDiff:t,newFile:n,oldFile:r,parseDiffOptions:i}){return(0,I.useMemo)(()=>{if(t!=null)return t;let{current:a}=e,o=a?.filePair;if(a!=null&&o!=null){if(X(r,n,o.stale)||X(r,n,o.installed))return o.fileDiff;a.filePair=null}return y(r??null,n??null,i)},[e,t,r,n,i])}function X(e,t,n){return f(e??void 0,n.oldFile??void 0)&&f(t??void 0,n.newFile??void 0)}function ae(e,t,n){"use no memo";return Z(t,n,e.current)}function Z(e,t,n){return{fileDiff:n?.fileDiff!=null&&x(e,n.fileDiff.stale)?n.fileDiff.installed:e,lineAnnotations:n?.annotations!=null&&t===n.annotations.stale?n.annotations.installed:t}}function oe(e,t,n){let{current:r}=n,i=Z(e,t,r);return r==null||(r.fileDiff!=null&&!x(e,r.fileDiff.stale)&&(r.fileDiff=null),t!==r.annotations?.stale&&(r.annotations=null),r.fileDiff==null&&r.annotations==null&&r.filePair==null&&(n.current=null)),i}function Q({options:e,controlledSelection:t,hasCustomHeader:n,hasGutterRenderUtility:r,onEditChange:i,onEditComplete:a}){return{...e,controlledSelection:t,renderCustomHeader:n?U:e?.renderCustomHeader,renderGutterUtility:r?U:e?.renderGutterUtility,onEditChange:i,onEditComplete:a}}function se(e,t){let n=t();try{return n.edit(e)}catch(e){throw n.cleanUp(),e}}function ce({fileDiff:e,options:t,editorOptions:n,editStateKey:r,metrics:i,lineAnnotations:a,selectedLines:o,className:s,style:c,prerenderedHTML:l,renderAnnotation:u,renderCustomHeader:d,renderHeaderPrefix:f,renderHeaderFilenameSuffix:p,renderHeaderMetadata:m,renderGutterUtility:h,disableWorkerPool:g=!1,edit:_=!1,onEditChange:y,onEditComplete:b}){let{ref:x,getHoveredLine:S,getAnnotationSlotName:C,fileDiff:w,lineAnnotations:T}=re({fileDiff:e,options:t,editorOptions:n,editStateKey:r,metrics:i,lineAnnotations:a,selectedLines:o,prerenderedHTML:l,hasGutterRenderUtility:h!=null,hasCustomHeader:d!=null,disableWorkerPool:g,edit:_,onEditChange:y,onEditComplete:b}),E=W({fileDiff:w,renderCustomHeader:d,renderHeaderPrefix:f,renderHeaderFilenameSuffix:p,renderHeaderMetadata:m,renderAnnotation:u,renderGutterUtility:h,lineAnnotations:T,getHoveredLine:S,getAnnotationSlotName:C});return(0,R.jsx)(v,{ref:x,className:s,style:c,children:q(E,l)})}var le=3e3,ue=`text-foreground hover:bg-accent aria-pressed:bg-accent inline-flex h-7 min-w-7 cursor-pointer items-center justify-center rounded-lg px-1.5 [&_svg]:opacity-80`,$=`text-muted-foreground hover:text-foreground aria-pressed:bg-background aria-pressed:text-foreground dark:aria-pressed:bg-input/72 inline-flex h-6 cursor-pointer items-center justify-center rounded-md px-2.5 aria-pressed:shadow-xs`;function de(e){let[d,f]=(0,I.useState)(null),[p,m]=(0,I.useState)(null),[h,g]=(0,I.useState)(0),_=(0,I.useRef)({patch:null,count:0}),v=O(e=>e.prefs.diff),y=D(),[b,x]=r(`diffFlipped`,[]);function C(e){A({...j().prefs,diff:{...v,...e}})}(0,I.useEffect)(()=>{let t=!0,n=!1;async function r(){if(!n){n=!0;try{let n=await k(e.machine,`git.diff`,{projectId:e.projectId});if(!t||(m(null),n===_.current.patch))return;_.current={patch:n,count:_.current.count+1},f(n.trim()===``?[]:S(n,`${e.projectId}:${_.current.count}`).flatMap(e=>e.files))}catch(e){t&&m(E(e))}finally{n=!1}}}function i(){document.hidden||r()}r();let a=window.setInterval(i,le);return window.addEventListener(`focus`,i),()=>{t=!1,window.clearInterval(a),window.removeEventListener(`focus`,i)}},[e.machine,e.projectId,e.running,h]);let w=d??[],T=M(w,e=>M(e.hunks,e=>e.additionLines)),L=M(w,e=>M(e.hunks,e=>e.deletionLines));return(0,R.jsxs)(`div`,{className:`bg-background flex h-full min-h-0 min-w-0 flex-col`,children:[(0,R.jsxs)(`div`,{className:`border-border/60 bg-background flex h-(--workspace-topbar-height) shrink-0 items-center justify-between gap-2 border-b pr-3 pl-3`,children:[(0,R.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[(0,R.jsx)(i,{mobile:e.mobile,onClick:e.onClose}),(0,R.jsx)(`span`,{className:`text-foreground min-w-0 truncate text-xs font-medium`,children:`Uncommitted changes`})]}),(0,R.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[w.length>0&&(0,R.jsxs)(`span`,{className:`text-2xs mr-1 inline-flex items-center gap-1 font-mono tabular-nums`,children:[(0,R.jsxs)(`span`,{className:`text-diff-addition`,children:[`+`,T]}),(0,R.jsxs)(`span`,{className:`text-diff-deletion`,children:[`-`,L]})]}),(0,R.jsx)(u,{size:`icon-sm`,variant:`ghost`,title:`Refresh diff`,"aria-label":`Refresh diff`,onClick:()=>g(h+1),children:(0,R.jsx)(l,{icon:a,className:`size-4`})}),w.length>0&&(0,R.jsx)(u,{size:`icon-sm`,variant:`ghost`,title:v.collapsed?`Expand all files`:`Collapse all files`,onClick:()=>{x([]),C({collapsed:!v.collapsed})},children:(0,R.jsx)(l,{icon:v.collapsed?t:c,className:`size-4`})}),(0,R.jsxs)(`div`,{className:`bg-input/40 flex shrink-0 items-center rounded-lg p-0.5`,children:[(0,R.jsx)(`button`,{className:$,"aria-pressed":!v.split,"aria-label":`Stacked diff view`,onClick:()=>C({split:!1}),children:(0,R.jsx)(l,{icon:F,className:`size-3.5`})}),(0,R.jsx)(`button`,{className:$,"aria-pressed":v.split,"aria-label":`Split diff view`,onClick:()=>C({split:!0}),children:(0,R.jsx)(l,{icon:P,className:`size-3.5`})})]}),(0,R.jsx)(`button`,{className:ue,"aria-pressed":v.wrap,title:v.wrap?`Disable line wrapping`:`Enable line wrapping`,onClick:()=>C({wrap:!v.wrap}),children:(0,R.jsx)(l,{icon:s,className:`size-3.5`})})]})]}),(0,R.jsxs)(`div`,{className:`diff-render-surface min-h-0 flex-1 overflow-y-auto [--code-background:var(--background)]`,children:[p!==null&&(0,R.jsx)(`p`,{className:`text-muted-foreground p-4 text-center text-xs`,children:p}),p===null&&d===null&&(0,R.jsx)(`p`,{className:`text-muted-foreground p-4 text-center text-xs`,children:`Loading…`}),p===null&&d?.length===0&&(0,R.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-3 p-6 text-center`,children:[(0,R.jsx)(l,{icon:N,className:`text-muted-foreground/40 size-8`}),(0,R.jsxs)(`div`,{className:`grid gap-1`,children:[(0,R.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`No uncommitted changes`}),(0,R.jsx)(`p`,{className:`text-muted-foreground/50 text-xs italic`,children:`If it works, don’t touch it.`})]})]}),p===null&&w.map(e=>{let t=v.collapsed!==b.includes(e.name);function r(){x(b.includes(e.name)?b.filter(t=>t!==e.name):[...b,e.name])}return(0,R.jsx)(`div`,{onClick:e=>{e.nativeEvent.composedPath().some(e=>e instanceof Element&&e.hasAttribute(`data-title`))&&r()},children:(0,R.jsx)(ce,{fileDiff:e,options:{theme:y,themeType:`dark`,unsafeCSS:`:host,
|
|
2
|
+
[data-diffs-header],
|
|
3
|
+
[data-diff],
|
|
4
|
+
[data-file],
|
|
5
|
+
[data-error-wrapper],
|
|
6
|
+
[data-virtualizer-buffer] {
|
|
7
|
+
--diffs-header-font-family: var(--font-sans) !important;
|
|
8
|
+
--diffs-font-family: var(--font-mono) !important;
|
|
9
|
+
--diffs-bg: var(--code-background) !important;
|
|
10
|
+
--diffs-light-bg: var(--code-background) !important;
|
|
11
|
+
--diffs-dark-bg: var(--code-background) !important;
|
|
12
|
+
--diffs-token-light-bg: transparent;
|
|
13
|
+
--diffs-token-dark-bg: transparent;
|
|
14
|
+
|
|
15
|
+
--diffs-bg-context-override: color-mix(
|
|
16
|
+
in srgb,
|
|
17
|
+
var(--code-background) 97%,
|
|
18
|
+
var(--code-foreground)
|
|
19
|
+
);
|
|
20
|
+
--diffs-bg-hover-override: color-mix(
|
|
21
|
+
in srgb,
|
|
22
|
+
var(--code-background) 94%,
|
|
23
|
+
var(--code-foreground)
|
|
24
|
+
);
|
|
25
|
+
--diffs-bg-separator-override: color-mix(
|
|
26
|
+
in srgb,
|
|
27
|
+
var(--code-background) 95%,
|
|
28
|
+
var(--code-foreground)
|
|
29
|
+
);
|
|
30
|
+
--diffs-bg-buffer-override: color-mix(
|
|
31
|
+
in srgb,
|
|
32
|
+
var(--code-background) 90%,
|
|
33
|
+
var(--code-foreground)
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
--diffs-bg-context-gutter-override: var(--code-background);
|
|
37
|
+
--diffs-addition-color-override: var(--diff-addition);
|
|
38
|
+
--diffs-deletion-color-override: var(--diff-deletion);
|
|
39
|
+
--diffs-bg-addition-hover-override: color-mix(
|
|
40
|
+
in srgb,
|
|
41
|
+
var(--code-background) 85%,
|
|
42
|
+
var(--diff-addition)
|
|
43
|
+
);
|
|
44
|
+
--diffs-bg-addition-emphasis-override: color-mix(
|
|
45
|
+
in srgb,
|
|
46
|
+
var(--code-background) 65%,
|
|
47
|
+
var(--diff-addition)
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
--diffs-bg-deletion-hover-override: color-mix(
|
|
51
|
+
in srgb,
|
|
52
|
+
var(--code-background) 85%,
|
|
53
|
+
var(--diff-deletion)
|
|
54
|
+
);
|
|
55
|
+
--diffs-bg-deletion-emphasis-override: color-mix(
|
|
56
|
+
in srgb,
|
|
57
|
+
var(--code-background) 65%,
|
|
58
|
+
var(--diff-deletion)
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
background-color: var(--diffs-bg) !important;
|
|
62
|
+
color: var(--code-foreground) !important;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
:is(
|
|
66
|
+
[data-line],
|
|
67
|
+
[data-line-annotation],
|
|
68
|
+
[data-merge-conflict],
|
|
69
|
+
[data-merge-conflict-actions],
|
|
70
|
+
[data-no-newline]
|
|
71
|
+
)[data-selected-line] {
|
|
72
|
+
--diffs-line-bg: light-dark(
|
|
73
|
+
color-mix(
|
|
74
|
+
in lab,
|
|
75
|
+
var(--code-background) 88%,
|
|
76
|
+
color-mix(in srgb, var(--code-background) 50%, var(--diffs-modified-base))
|
|
77
|
+
),
|
|
78
|
+
color-mix(
|
|
79
|
+
in lab,
|
|
80
|
+
var(--code-background) 80%,
|
|
81
|
+
color-mix(in srgb, var(--code-background) 70%, var(--diffs-modified-base))
|
|
82
|
+
)
|
|
83
|
+
) !important;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
:is([data-gutter-buffer], [data-column-number])[data-selected-line] {
|
|
87
|
+
--diffs-line-bg: light-dark(
|
|
88
|
+
color-mix(
|
|
89
|
+
in lab,
|
|
90
|
+
var(--code-background) 91%,
|
|
91
|
+
color-mix(in srgb, var(--code-background) 35%, var(--diffs-modified-base))
|
|
92
|
+
),
|
|
93
|
+
color-mix(
|
|
94
|
+
in lab,
|
|
95
|
+
var(--code-background) 85%,
|
|
96
|
+
color-mix(in srgb, var(--code-background) 60%, var(--diffs-modified-base))
|
|
97
|
+
)
|
|
98
|
+
) !important;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
[data-indicators='bars']
|
|
102
|
+
:is(
|
|
103
|
+
[data-column-number],
|
|
104
|
+
[data-gutter-buffer='annotation']
|
|
105
|
+
)[data-selected-line] {
|
|
106
|
+
position: relative;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
[data-indicators='bars']
|
|
110
|
+
:is(
|
|
111
|
+
[data-column-number],
|
|
112
|
+
[data-gutter-buffer='annotation']
|
|
113
|
+
)[data-selected-line]::before {
|
|
114
|
+
position: absolute !important;
|
|
115
|
+
inset-block: 0 !important;
|
|
116
|
+
inset-inline-start: 0 !important;
|
|
117
|
+
display: block !important;
|
|
118
|
+
width: 4px !important;
|
|
119
|
+
min-width: 4px !important;
|
|
120
|
+
max-width: 4px !important;
|
|
121
|
+
height: auto !important;
|
|
122
|
+
padding: 0 !important;
|
|
123
|
+
content: '' !important;
|
|
124
|
+
background-color: var(--diffs-modified-base) !important;
|
|
125
|
+
background-image: none !important;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
[data-file-info] {
|
|
129
|
+
background-color: var(--code-background) !important;
|
|
130
|
+
border-block-color: transparent !important;
|
|
131
|
+
color: var(--code-foreground) !important;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
[data-diffs-header] {
|
|
135
|
+
position: sticky !important;
|
|
136
|
+
top: 0;
|
|
137
|
+
z-index: 4;
|
|
138
|
+
background-color: var(--code-background) !important;
|
|
139
|
+
border-bottom-color: transparent !important;
|
|
140
|
+
align-items: center !important;
|
|
141
|
+
font-family: var(--font-sans) !important;
|
|
142
|
+
font-size: 12px !important;
|
|
143
|
+
line-height: 1 !important;
|
|
144
|
+
min-height: 32px !important;
|
|
145
|
+
padding-block: 6px !important;
|
|
146
|
+
padding-inline: 8px 12px !important;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
[data-diffs-header]:hover {
|
|
150
|
+
background-color: var(--code-background) !important;
|
|
151
|
+
box-shadow: inset 3px 0
|
|
152
|
+
color-mix(in srgb, var(--code-foreground) 24%, transparent);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
:is([data-separator='line-info'], [data-separator='line-info-basic']) {
|
|
156
|
+
height: 24px !important;
|
|
157
|
+
margin-block: 0 !important;
|
|
158
|
+
--diffs-bg-separator: color-mix(
|
|
159
|
+
in srgb,
|
|
160
|
+
var(--code-background) 97%,
|
|
161
|
+
var(--code-foreground)
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
:is([data-separator='line-info'], [data-separator='line-info-basic'])
|
|
166
|
+
[data-separator-content] {
|
|
167
|
+
color: color-mix(
|
|
168
|
+
in srgb,
|
|
169
|
+
var(--code-foreground) 50%,
|
|
170
|
+
var(--code-background)
|
|
171
|
+
) !important;
|
|
172
|
+
font-family: var(--font-sans) !important;
|
|
173
|
+
font-size: 11px !important;
|
|
174
|
+
text-decoration: none !important;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
:is([data-separator='line-info'], [data-separator='line-info-basic'])
|
|
178
|
+
[data-expand-button] {
|
|
179
|
+
color: color-mix(
|
|
180
|
+
in srgb,
|
|
181
|
+
var(--code-foreground) 50%,
|
|
182
|
+
var(--code-background)
|
|
183
|
+
) !important;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
:is(
|
|
187
|
+
[data-separator='line-info'],
|
|
188
|
+
[data-separator='line-info-basic']
|
|
189
|
+
)[data-expand-index]
|
|
190
|
+
:is([data-separator-content], [data-expand-button]):hover {
|
|
191
|
+
color: var(--code-foreground) !important;
|
|
192
|
+
background-color: color-mix(
|
|
193
|
+
in srgb,
|
|
194
|
+
var(--code-background) 92%,
|
|
195
|
+
var(--code-foreground)
|
|
196
|
+
) !important;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
[data-diffs-header] [data-header-content] {
|
|
200
|
+
align-items: center !important;
|
|
201
|
+
line-height: 1 !important;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
[data-diffs-header] :is([data-title], [data-prev-name]) {
|
|
205
|
+
line-height: 16px !important;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
[data-diffs-header] [data-metadata] {
|
|
209
|
+
align-items: center !important;
|
|
210
|
+
line-height: 1 !important;
|
|
211
|
+
font-variant-numeric: tabular-nums;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
[data-diffs-header] [data-additions-count],
|
|
215
|
+
[data-diffs-header] [data-deletions-count] {
|
|
216
|
+
font-family: var(--font-mono) !important;
|
|
217
|
+
font-size: 11px !important;
|
|
218
|
+
font-variant-numeric: tabular-nums;
|
|
219
|
+
line-height: 1 !important;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
[data-diffs-header] [data-change-icon],
|
|
223
|
+
[data-diffs-header] [data-rename-icon] {
|
|
224
|
+
display: block;
|
|
225
|
+
flex-shrink: 0;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
[data-title] {
|
|
229
|
+
cursor: pointer;
|
|
230
|
+
transition: color 120ms ease;
|
|
231
|
+
font-family: var(--font-sans) !important;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
[data-title]:hover {
|
|
235
|
+
color: color-mix(
|
|
236
|
+
in srgb,
|
|
237
|
+
var(--code-foreground) 84%,
|
|
238
|
+
var(--primary)
|
|
239
|
+
) !important;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
[data-diff],
|
|
243
|
+
[data-file] {
|
|
244
|
+
transition: opacity 200ms ease-out;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
@starting-style {
|
|
248
|
+
[data-diff],
|
|
249
|
+
[data-file] {
|
|
250
|
+
opacity: 0;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
@media (prefers-reduced-motion: reduce) {
|
|
255
|
+
[data-diff],
|
|
256
|
+
[data-file] {
|
|
257
|
+
transition: none;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
`,collapsed:t,lineDiffType:`word-alt`,overflow:v.wrap?`wrap`:`scroll`,diffStyle:v.split?`split`:`unified`},renderHeaderPrefix:()=>(0,R.jsx)(`button`,{className:`text-muted-foreground hover:text-foreground flex size-5 cursor-pointer items-center justify-center`,"aria-label":t?`Expand file`:`Collapse file`,onClick:r,children:(0,R.jsx)(l,{icon:t?o:n,className:`size-3.5`})})})},e.name)})]})]})}export{de as DiffPanel};
|