@ingit/cli-darwin-x64 0.2.3 → 0.3.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/client/assets/SettingsDialog-Clv5zIpo.js +7 -0
- package/client/assets/index-BKOFpCtL.js +679 -0
- package/client/index.html +1 -1
- package/ingit +0 -0
- package/libziggit.dylib +0 -0
- package/package.json +1 -1
- package/client/assets/SettingsDialog-CwkyBvJR.js +0 -7
- package/client/assets/index-Bofblqs1.js +0 -615
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{S as e,_ as t,a as n,b as r,c as i,d as a,f as o,g as s,h as c,i as l,l as u,m as d,n as f,o as p,p as m,r as h,s as g,t as _,u as v,v as y,x as b,y as x}from"./index-BKOFpCtL.js";var S=e(r(),1),C=b(),w={width:`100%`,border:`1px solid #45475a`,borderRadius:6,background:`#11111b`,color:`#cdd6f4`,fontFamily:`inherit`,fontSize:12,outline:`none`},T={height:30,padding:`0 11px`,border:`1px solid #45475a`,borderRadius:6,background:`#181825`,color:`#bac2de`,fontFamily:`inherit`,fontSize:11,fontWeight:700,cursor:`pointer`},E={...T,border:`1px solid #6d9658`,background:`#8dcf78`,color:`#0b1020`,fontWeight:800},D=`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
2
|
+
<path d="m12 3 2.5 5.5L20 11l-5.5 2.5L12 19l-2.5-5.5L4 11l5.5-2.5L12 3Z" />
|
|
3
|
+
</svg>`;function O(e){let t=new Set(e.map(e=>e.id)),n=typeof crypto<`u`&&`randomUUID`in crypto?crypto.randomUUID():`${Date.now()}-${Math.random().toString(36).slice(2)}`,r=`custom-${n}`,i=2;for(;t.has(r);)r=`custom-${n}-${i}`,i+=1;return r}function k(e){let t=new Set(e.map(e=>e.id)),n=typeof crypto<`u`&&`randomUUID`in crypto?crypto.randomUUID():`${Date.now()}-${Math.random().toString(36).slice(2)}`,r=`custom-${n}`,i=2;for(;t.has(r);)r=`custom-${n}-${i}`,i+=1;return r}function A({icon:e,customSvg:t,size:n=18,muted:r=!1}){let i=n+10;return(0,C.jsxs)(`svg`,{"aria-hidden":`true`,width:i,height:i,viewBox:`-12 -12 24 24`,style:{display:`block`,flex:`0 0 auto`},children:[(0,C.jsx)(`circle`,{r:`10`,fill:`#11111b`,stroke:r?`#45475a`:`#89b4fa`,strokeWidth:`1.5`}),(0,C.jsx)(u,{icon:e,customSvg:t,color:r?`#6c7086`:`#89b4fa`,size:n})]})}function j(e){return e.map(e=>({...e,label:e.label.trim(),types:e.types.map(e=>e.trim()).filter(Boolean),patterns:e.patterns.map(e=>e.trim()).filter(Boolean),...e.customSvg===void 0?{}:{customSvg:e.customSvg.trim()}}))}function M(e){for(let t of e){if(!t.label.trim())return{id:t.id,message:`Every rule needs a name.`};if(t.enabled&&t.types.length===0&&t.patterns.length===0)return{id:t.id,message:`“${t.label}” needs at least one commit type or message pattern.`};for(let e of t.patterns){let n=o(e);if(n)return{id:t.id,message:`Invalid pattern in “${t.label}”: ${n}`}}if(t.customSvg!==void 0){let e=y(t.customSvg);if(e)return{id:t.id,message:`Invalid custom SVG in “${t.label}”: ${e}`}}}return null}function N(e){let t=e.trim(),n=t.split(/\s+/).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(String.raw`\s+`);return`${/^\w/.test(t)?String.raw`\b`:``}${n}${/\w$/.test(t)?String.raw`\b`:``}`}function P({rule:e,index:t,count:n,onChange:r,onMove:a,onDuplicate:s,onDelete:c}){let[l,u]=(0,S.useState)(e.types.join(`, `)),[d,f]=(0,S.useState)(e.patterns.join(`
|
|
4
|
+
`)),[p,m]=(0,S.useState)(e.customSvg??``),[h,g]=(0,S.useState)(``),_=e.customSvg===void 0?null:y(p),v=d.split(`
|
|
5
|
+
`).map(e=>e.trim()).filter(Boolean).map(e=>({pattern:e,error:o(e)})).filter(e=>e.error!==null),b=()=>{if(!h.trim())return;let t=N(h),n=[...e.patterns,t];f(n.join(`
|
|
6
|
+
`)),g(``),r({patterns:n})};return(0,C.jsxs)(`div`,{style:{display:`flex`,minHeight:0,height:`100%`,flexDirection:`column`},children:[(0,C.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,padding:`14px 16px`,borderBottom:`1px solid #313244`},children:[(0,C.jsx)(A,{icon:e.icon,customSvg:e.customSvg,size:17,muted:!e.enabled}),(0,C.jsxs)(`div`,{style:{minWidth:0,flex:1},children:[(0,C.jsx)(`div`,{style:{color:`#cdd6f4`,fontSize:14,fontWeight:750,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:e.label||`Untitled rule`}),(0,C.jsxs)(`div`,{style:{marginTop:2,color:`#6c7086`,fontSize:10},children:[`Rule `,t+1,` of `,n,` · evaluated top to bottom`]})]}),(0,C.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:6,color:e.enabled?`#a6e3a1`:`#7f849c`,fontSize:11,cursor:`pointer`},children:[(0,C.jsx)(`input`,{type:`checkbox`,checked:e.enabled,onChange:e=>r({enabled:e.target.checked}),style:{accentColor:`#a6e3a1`}}),`Enabled`]})]}),(0,C.jsxs)(`div`,{style:{flex:1,minHeight:0,overflowY:`auto`,padding:16},children:[(0,C.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`minmax(0, 1fr) minmax(0, 1fr)`,gap:14},children:[(0,C.jsxs)(`label`,{style:{display:`flex`,flexDirection:`column`,gap:6,color:`#bac2de`,fontSize:11,fontWeight:700},children:[`Rule name`,(0,C.jsx)(`input`,{value:e.label,maxLength:100,onChange:e=>r({label:e.target.value}),style:{...w,height:34,padding:`0 9px`}})]}),(0,C.jsxs)(`label`,{style:{display:`flex`,flexDirection:`column`,gap:6,color:`#bac2de`,fontSize:11,fontWeight:700},children:[`Conventional Commit types`,(0,C.jsx)(`input`,{value:l,onChange:e=>{let t=e.target.value;u(t),r({types:t.split(`,`).map(e=>e.trim()).filter(Boolean)})},placeholder:`feat, feature`,spellCheck:!1,style:{...w,height:34,padding:`0 9px`,fontFamily:`ui-monospace, SFMono-Regular, monospace`}})]})]}),(0,C.jsxs)(`div`,{style:{marginTop:16},children:[(0,C.jsx)(`div`,{style:{marginBottom:7,color:`#bac2de`,fontSize:11,fontWeight:700},children:`Icon`}),(0,C.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fill, minmax(38px, 1fr))`,gap:5},children:i.map(t=>{let n=e.customSvg===void 0&&e.icon===t;return(0,C.jsx)(`button`,{type:`button`,title:t,"aria-label":`Use ${t} icon`,"aria-pressed":n,onClick:()=>r({icon:t,customSvg:void 0}),style:{height:38,display:`grid`,placeItems:`center`,padding:0,border:`1px solid ${n?`#89b4fa`:`#313244`}`,borderRadius:6,background:n?`#89b4fa18`:`#181825`,cursor:`pointer`},children:(0,C.jsx)(A,{icon:t,size:14,muted:!n})},t)})}),(0,C.jsxs)(`button`,{type:`button`,"aria-pressed":e.customSvg!==void 0,onClick:()=>{let e=p||D;m(e),r({customSvg:e})},style:{width:`100%`,height:38,marginTop:6,display:`flex`,alignItems:`center`,justifyContent:`center`,gap:7,border:`1px solid ${e.customSvg===void 0?`#313244`:`#89b4fa`}`,borderRadius:6,background:e.customSvg===void 0?`#181825`:`#89b4fa18`,color:e.customSvg===void 0?`#9399b2`:`#89b4fa`,fontFamily:`inherit`,fontSize:11,fontWeight:700,cursor:`pointer`},children:[(0,C.jsx)(A,{icon:e.icon,customSvg:e.customSvg??D,size:13,muted:e.customSvg===void 0}),`Custom SVG`]}),e.customSvg!==void 0&&(0,C.jsxs)(`label`,{style:{display:`flex`,flexDirection:`column`,gap:6,marginTop:9,color:`#bac2de`,fontSize:11,fontWeight:700},children:[`Raw SVG`,(0,C.jsx)(`textarea`,{value:p,onChange:e=>{let t=e.target.value;m(t),r({customSvg:t})},rows:5,placeholder:`<svg viewBox="0 0 24 24">…</svg>`,spellCheck:!1,style:{...w,minHeight:112,resize:`vertical`,padding:`8px 9px`,lineHeight:1.45,fontFamily:`ui-monospace, SFMono-Regular, monospace`,borderColor:_?`#f38ba888`:`#45475a`}}),(0,C.jsx)(`span`,{style:{color:_?`#f38ba8`:`#6c7086`,fontSize:10,fontWeight:500,lineHeight:1.4},children:_??`Scripts, events, external references, and unsupported elements are blocked. Paint inherits the branch color.`})]})]}),(0,C.jsxs)(`div`,{style:{marginTop:16},children:[(0,C.jsx)(`div`,{style:{marginBottom:6,color:`#bac2de`,fontSize:11,fontWeight:700},children:`Quick-add a keyword or phrase`}),(0,C.jsxs)(`div`,{style:{display:`flex`,gap:7},children:[(0,C.jsx)(`input`,{value:h,onChange:e=>g(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),b())},placeholder:`e.g. upgrade dependency`,style:{...w,height:32,flex:1,padding:`0 9px`}}),(0,C.jsx)(`button`,{type:`button`,onClick:b,disabled:!h.trim(),style:{...T,height:32,opacity:h.trim()?1:.45},children:`Add keyword`})]})]}),(0,C.jsxs)(`label`,{style:{display:`flex`,flexDirection:`column`,gap:6,marginTop:13,color:`#bac2de`,fontSize:11,fontWeight:700},children:[`Message patterns `,(0,C.jsx)(`span`,{style:{color:`#6c7086`,fontWeight:500},children:`(advanced)`}),(0,C.jsx)(`textarea`,{value:d,onChange:e=>{let t=e.target.value;f(t),r({patterns:t.split(`
|
|
7
|
+
`).map(e=>e.trim()).filter(Boolean)})},rows:5,placeholder:String.raw`\bkeyword\b`,spellCheck:!1,style:{...w,minHeight:108,resize:`vertical`,padding:`8px 9px`,lineHeight:1.5,fontFamily:`ui-monospace, SFMono-Regular, monospace`}})]}),(0,C.jsx)(`div`,{style:{marginTop:6,color:`#6c7086`,fontSize:10,lineHeight:1.45},children:`One case-insensitive regular expression per line. The keyword helper adds safe word boundaries automatically. Conventional Commit types are matched before message patterns.`}),v.map(({pattern:e,error:t})=>(0,C.jsxs)(`div`,{style:{marginTop:6,color:`#f38ba8`,fontSize:10},children:[(0,C.jsx)(`code`,{children:e}),`: `,t]},`${e}:${t}`))]}),(0,C.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6,padding:`10px 16px`,borderTop:`1px solid #313244`,background:`#181825`},children:[(0,C.jsx)(`button`,{type:`button`,onClick:()=>a(-1),disabled:t===0,title:`Move rule up`,style:{...T,opacity:t===0?.4:1},children:`↑ Up`}),(0,C.jsx)(`button`,{type:`button`,onClick:()=>a(1),disabled:t===n-1,title:`Move rule down`,style:{...T,opacity:t===n-1?.4:1},children:`↓ Down`}),(0,C.jsx)(`button`,{type:`button`,onClick:s,style:T,children:`Duplicate`}),(0,C.jsx)(`button`,{type:`button`,onClick:c,style:{...T,marginLeft:`auto`,borderColor:`#f38ba866`,color:`#f38ba8`},children:`Delete`})]})]})}function F({onClose:e,onDirtyChange:n}){let r=t(),[i,o]=(0,S.useState)(()=>a(r)),[l,u]=(0,S.useState)(()=>r[0]?.id??null),[f,p]=(0,S.useState)(`feat: add commit icon settings`),[h,g]=(0,S.useState)(null),_=i.findIndex(e=>e.id===l),y=_>=0?i[_]??null:null,b=(0,S.useMemo)(()=>m(f,i),[f,i]),x=i.filter(e=>e.enabled).length,D=(0,S.useMemo)(()=>s(j(i))!==s(r),[r,i]);(0,S.useEffect)(()=>(n(D),()=>n(!1)),[D,n]);let k=e=>{l&&(g(null),o(t=>t.map(t=>t.id===l?{...t,...e}:t)))},N=()=>{let e={id:O(i),icon:`feature`,label:`New rule`,enabled:!0,types:[],patterns:[String.raw`\bkeyword\b`]};o(t=>[...t,e]),u(e.id),g(null)},F=e=>{if(_<0)return;let t=_+e;t<0||t>=i.length||(o(e=>{let n=[...e],[r]=n.splice(_,1);return r&&n.splice(t,0,r),n}),g(null))},I=()=>{if(!y)return;let e={...y,id:O(i),label:`${y.label} copy`,types:[...y.types],patterns:[...y.patterns]};o(t=>{let n=[...t];return n.splice(_+1,0,e),n}),u(e.id),g(null)},L=()=>{if(_<0)return;let e=i.filter((e,t)=>t!==_);o(e),u(e[Math.min(_,e.length-1)]?.id??null),g(null)},R=()=>{let e=a(v);o(e),u(e[0]?.id??null),g(null)},z=()=>{let t=j(i),n=M(t);if(n){u(n.id),g(n.message);return}if(!(s(t)===s(v)?d():c(t))){g(`Could not save commit icon settings to local storage.`);return}e()};return(0,C.jsxs)(`div`,{style:{display:`flex`,minWidth:0,minHeight:0,height:`100%`,flexDirection:`column`},children:[(0,C.jsxs)(`div`,{style:{padding:`15px 18px 13px`,borderBottom:`1px solid #313244`},children:[(0,C.jsx)(`h2`,{style:{margin:0,color:`#f5e0dc`,fontSize:16},children:`Commit icons`}),(0,C.jsx)(`p`,{style:{margin:`5px 0 0`,color:`#7f849c`,fontSize:11,lineHeight:1.45},children:`Choose how commit messages map to graph-node icons. Rule order matters; the first enabled match wins.`})]}),(0,C.jsxs)(`div`,{style:{padding:`10px 14px`,display:`flex`,alignItems:`center`,gap:9,borderBottom:`1px solid #313244`,background:`#181825`},children:[(0,C.jsx)(`span`,{style:{color:`#7f849c`,fontSize:10,fontWeight:700,textTransform:`uppercase`,letterSpacing:`0.06em`},children:`Test`}),(0,C.jsx)(`input`,{value:f,onChange:e=>p(e.target.value),"aria-label":`Test commit message`,placeholder:`Enter a commit message…`,style:{...w,minWidth:120,height:32,flex:1,padding:`0 9px`}}),(0,C.jsx)(`div`,{style:{width:145,display:`flex`,alignItems:`center`,gap:7,color:b?`#cdd6f4`:`#6c7086`,fontSize:11},children:b?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(A,{icon:b.icon,customSvg:b.customSvg,size:14}),(0,C.jsx)(`span`,{style:{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:b.label})]}):`No matching icon`})]}),(0,C.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`250px minmax(0, 1fr)`,flex:1,minHeight:0},children:[(0,C.jsxs)(`div`,{style:{display:`flex`,minHeight:0,flexDirection:`column`,borderRight:`1px solid #313244`,background:`#181825`},children:[(0,C.jsxs)(`div`,{style:{height:42,padding:`0 10px 0 12px`,display:`flex`,alignItems:`center`,color:`#7f849c`,fontSize:10},children:[x,` enabled · `,i.length,` total`,(0,C.jsx)(`button`,{type:`button`,onClick:N,style:{...T,height:26,marginLeft:`auto`,padding:`0 8px`},children:`+ Add`})]}),(0,C.jsxs)(`div`,{style:{flex:1,minHeight:0,overflowY:`auto`,padding:`0 6px 8px`},children:[i.map((e,t)=>{let n=e.id===l;return(0,C.jsxs)(`button`,{type:`button`,onClick:()=>u(e.id),style:{width:`100%`,display:`flex`,alignItems:`center`,gap:8,minHeight:42,padding:`5px 8px`,border:`1px solid ${n?`#89b4fa55`:`transparent`}`,borderRadius:6,background:n?`#89b4fa16`:`transparent`,color:e.enabled?`#cdd6f4`:`#6c7086`,fontFamily:`inherit`,textAlign:`left`,cursor:`pointer`,opacity:e.enabled?1:.68},children:[(0,C.jsx)(`span`,{style:{width:18,flexShrink:0,color:`#585b70`,fontSize:9,textAlign:`right`},children:t+1}),(0,C.jsx)(A,{icon:e.icon,customSvg:e.customSvg,size:13,muted:!e.enabled}),(0,C.jsxs)(`span`,{style:{minWidth:0,flex:1},children:[(0,C.jsx)(`span`,{style:{display:`block`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,fontSize:11,fontWeight:650},children:e.label||`Untitled rule`}),(0,C.jsx)(`span`,{style:{display:`block`,marginTop:2,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,color:`#6c7086`,fontSize:9},children:e.types.length>0?e.types.join(`, `):`${e.patterns.length} pattern${e.patterns.length===1?``:`s`}`})]})]},e.id)}),i.length===0&&(0,C.jsx)(`div`,{style:{padding:`26px 14px`,color:`#6c7086`,fontSize:11,lineHeight:1.5,textAlign:`center`},children:`No rules. Add one, or restore the defaults.`})]})]}),(0,C.jsx)(`div`,{style:{minWidth:0,minHeight:0},children:y?(0,C.jsx)(P,{rule:y,index:_,count:i.length,onChange:k,onMove:F,onDuplicate:I,onDelete:L},y.id):(0,C.jsx)(`div`,{style:{height:`100%`,display:`grid`,placeItems:`center`,color:`#6c7086`,fontSize:12},children:`Select or add a rule to edit it.`})})]}),(0,C.jsxs)(`div`,{style:{minHeight:52,padding:`10px 14px`,display:`flex`,alignItems:`center`,gap:8,borderTop:`1px solid #313244`,background:`#11111b`},children:[(0,C.jsx)(`button`,{type:`button`,onClick:R,style:T,children:`Restore defaults`}),(0,C.jsx)(`span`,{style:{color:h?`#f38ba8`:`#585b70`,fontSize:10,marginLeft:4},children:h??`Custom settings are stored in this browser.`}),(0,C.jsx)(`button`,{type:`button`,onClick:e,style:{...T,marginLeft:`auto`},children:`Cancel`}),(0,C.jsx)(`button`,{type:`button`,onClick:z,style:E,children:`Save settings`})]})]})}function I(e){return e.map(e=>({...e,fileName:e.fileName.trim(),command:e.command.trim()}))}function L(e){let t=new Set;for(let n of e){let e=n.fileName.trim(),r=n.command.trim();if(!e)return`Every resolver needs a file name.`;if(e===`.`||e===`..`||e.includes(`/`)||e.includes(`\\`))return`“${e}” must be a file name, not a path.`;if(t.has(e))return`“${e}” has more than one resolver.`;if(!r)return`“${e}” needs a command.`;if(!g(r))return`The command for “${e}” is empty or contains an unterminated quote.`;t.add(e)}return null}function R({onClose:e,onDirtyChange:t}){let r=p(),[i,a]=(0,S.useState)(()=>f(r)),[o,s]=(0,S.useState)(null),c=(0,S.useMemo)(()=>n(I(i))!==n(r),[r,i]);(0,S.useEffect)(()=>(t(c),()=>t(!1)),[c,t]);let u=(e,t)=>{s(null),a(n=>n.map(n=>n.id===e?{...n,...t}:n))},d=()=>{let e={id:k(i),fileName:``,command:``};a(t=>[...t,e]),s(null)},m=()=>{a(f(_)),s(null)},g=()=>{let t=I(i),r=L(t);if(r){s(r);return}if(!(n(t)===n(_)?h():l(t))){s(`Could not save conflict resolver settings to local storage.`);return}e()};return(0,C.jsxs)(`div`,{style:{display:`flex`,minWidth:0,minHeight:0,height:`100%`,flexDirection:`column`},children:[(0,C.jsxs)(`div`,{style:{padding:`15px 18px 13px`,borderBottom:`1px solid #313244`},children:[(0,C.jsx)(`h2`,{style:{margin:0,color:`#f5e0dc`,fontSize:16},children:`Lockfile conflict resolvers`}),(0,C.jsx)(`p`,{style:{margin:`5px 0 0`,color:`#7f849c`,fontSize:11,lineHeight:1.45},children:`Show “run install & resolve” for conflicted files with an exact matching name. The command runs from that file's directory.`})]}),(0,C.jsxs)(`div`,{style:{padding:`10px 14px`,display:`flex`,alignItems:`center`,gap:10,borderBottom:`1px solid #313244`,background:`#181825`},children:[(0,C.jsx)(`span`,{style:{color:`#7f849c`,fontSize:10},children:`Commands launch directly with your user permissions. Quotes are supported; no shell is added implicitly.`}),(0,C.jsx)(`button`,{type:`button`,onClick:d,style:{...T,height:28,marginLeft:`auto`,flexShrink:0},children:`+ Add resolver`})]}),(0,C.jsxs)(`div`,{style:{flex:1,minHeight:0,overflowY:`auto`,padding:14},children:[(0,C.jsxs)(`div`,{"aria-hidden":`true`,style:{display:`grid`,gridTemplateColumns:`minmax(170px, 0.7fr) minmax(280px, 1.3fr) 32px`,gap:8,padding:`0 8px 7px`,color:`#6c7086`,fontSize:9,fontWeight:800,letterSpacing:`0.08em`,textTransform:`uppercase`},children:[(0,C.jsx)(`span`,{children:`File name`}),(0,C.jsx)(`span`,{children:`Command`}),(0,C.jsx)(`span`,{})]}),(0,C.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:6},children:[i.map((e,t)=>(0,C.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`minmax(170px, 0.7fr) minmax(280px, 1.3fr) 32px`,alignItems:`center`,gap:8,padding:8,border:`1px solid #313244`,borderRadius:7,background:`#181825`},children:[(0,C.jsx)(`input`,{value:e.fileName,"aria-label":`Resolver ${t+1} file name`,placeholder:`example.lock`,spellCheck:!1,onChange:t=>u(e.id,{fileName:t.target.value}),style:{...w,height:32,padding:`0 9px`,fontFamily:`ui-monospace, SFMono-Regular, monospace`}}),(0,C.jsx)(`input`,{value:e.command,"aria-label":`Resolver ${t+1} command`,placeholder:`package-manager install`,spellCheck:!1,onChange:t=>u(e.id,{command:t.target.value}),style:{...w,height:32,padding:`0 9px`,fontFamily:`ui-monospace, SFMono-Regular, monospace`}}),(0,C.jsx)(`button`,{type:`button`,"aria-label":`Delete resolver for ${e.fileName||`row ${t+1}`}`,title:`Delete resolver`,onClick:()=>{a(t=>t.filter(t=>t.id!==e.id)),s(null)},style:{width:30,height:30,padding:0,border:`1px solid transparent`,borderRadius:6,background:`transparent`,color:`#f38ba8`,fontSize:15,cursor:`pointer`},children:`×`})]},e.id)),i.length===0&&(0,C.jsx)(`div`,{style:{padding:36,border:`1px dashed #313244`,borderRadius:7,color:`#6c7086`,fontSize:11,textAlign:`center`},children:`No resolvers configured. Conflicted files will use the normal “Mark resolved” action.`})]})]}),(0,C.jsxs)(`div`,{style:{minHeight:52,padding:`10px 14px`,display:`flex`,alignItems:`center`,gap:8,borderTop:`1px solid #313244`,background:`#11111b`},children:[(0,C.jsx)(`button`,{type:`button`,onClick:m,style:T,children:`Restore defaults`}),(0,C.jsx)(`span`,{style:{color:o?`#f38ba8`:`#585b70`,fontSize:10,marginLeft:4},children:o??`${i.length} resolver${i.length===1?``:`s`} · stored in this browser`}),(0,C.jsx)(`button`,{type:`button`,onClick:e,style:{...T,marginLeft:`auto`},children:`Cancel`}),(0,C.jsx)(`button`,{type:`button`,onClick:g,style:E,children:`Save settings`})]})]})}function z({onClose:e}){let t=x(e=>e.showGutterColors),n=x(e=>e.setShowGutterColors);return(0,C.jsxs)(`div`,{style:{display:`flex`,minWidth:0,minHeight:0,height:`100%`,flexDirection:`column`},children:[(0,C.jsxs)(`div`,{style:{padding:`15px 18px 13px`,borderBottom:`1px solid #313244`},children:[(0,C.jsx)(`h2`,{style:{margin:0,color:`#f5e0dc`,fontSize:16},children:`Graph appearance`}),(0,C.jsx)(`p`,{style:{margin:`5px 0 0`,color:`#7f849c`,fontSize:11,lineHeight:1.45},children:`Control visual aids used across repository graphs.`})]}),(0,C.jsx)(`div`,{style:{flex:1,padding:18},children:(0,C.jsxs)(`label`,{title:`Give each graph gutter a distinct background color`,style:{display:`flex`,alignItems:`flex-start`,gap:10,maxWidth:560,padding:14,border:`1px solid ${t?`#89b4fa55`:`#313244`}`,borderRadius:7,background:t?`#89b4fa10`:`#181825`,color:`#cdd6f4`,cursor:`pointer`},children:[(0,C.jsx)(`input`,{type:`checkbox`,checked:t,onChange:e=>n(e.target.checked),style:{margin:`2px 0 0`,accentColor:`#89b4fa`,cursor:`pointer`}}),(0,C.jsxs)(`span`,{children:[(0,C.jsx)(`span`,{style:{display:`block`,fontSize:12,fontWeight:750},children:`Color-code gutters`}),(0,C.jsx)(`span`,{style:{display:`block`,marginTop:4,color:`#7f849c`,fontSize:10,lineHeight:1.45},children:`Tint each branch lane with its stable branch color to make parallel histories easier to follow.`})]})]})}),(0,C.jsxs)(`div`,{style:{minHeight:52,padding:`10px 14px`,display:`flex`,alignItems:`center`,borderTop:`1px solid #313244`,background:`#11111b`},children:[(0,C.jsx)(`span`,{style:{color:`#585b70`,fontSize:10},children:`Appearance settings are saved automatically.`}),(0,C.jsx)(`button`,{type:`button`,onClick:e,style:{...E,marginLeft:`auto`},children:`Done`})]})]})}function B(e){return{width:`100%`,padding:`8px 9px`,border:`1px solid ${e?`#89b4fa44`:`transparent`}`,borderRadius:6,background:e?`#89b4fa16`:`transparent`,color:e?`#89b4fa`:`#a6adc8`,fontFamily:`inherit`,fontSize:11,fontWeight:700,textAlign:`left`,cursor:`pointer`}}function V({open:e,onClose:t}){let n=(0,S.useRef)(null),r=(0,S.useRef)(null),[i,a]=(0,S.useState)(`appearance`),[o,s]=(0,S.useState)(!1),[c,l]=(0,S.useState)(!1),u=()=>{(o||c)&&!window.confirm(`Discard unsaved settings changes?`)||t()};return(0,S.useEffect)(()=>{let t=n.current;t&&(e?(t.open||t.showModal(),requestAnimationFrame(()=>r.current?.focus())):t.open&&t.close())},[e]),(0,C.jsxs)(`dialog`,{ref:n,className:`ingit-settings-dialog`,"aria-labelledby":`settings-dialog-title`,onCancel:e=>{e.preventDefault(),u()},onClose:u,onClick:e=>{e.target===e.currentTarget&&u()},style:{position:`fixed`,inset:0,width:`min(980px, calc(100vw - 32px))`,height:`min(720px, calc(100vh - 32px))`,margin:`auto`,padding:0,overflow:`hidden`,border:`1px solid #45475a`,borderRadius:9,background:`#1e1e2e`,color:`#cdd6f4`,boxShadow:`0 24px 80px rgba(0,0,0,0.65)`,fontFamily:`system-ui, -apple-system, sans-serif`},children:[(0,C.jsx)(`style`,{children:`.ingit-settings-dialog::backdrop { background: rgba(10, 10, 18, 0.72); backdrop-filter: blur(2px); }`}),(0,C.jsxs)(`div`,{onClick:e=>e.stopPropagation(),style:{display:`grid`,gridTemplateColumns:`170px minmax(0, 1fr)`,height:`100%`},children:[(0,C.jsxs)(`aside`,{style:{display:`flex`,flexDirection:`column`,background:`#181825`,borderRight:`1px solid #313244`},children:[(0,C.jsxs)(`div`,{style:{height:58,padding:`0 14px`,display:`flex`,alignItems:`center`,borderBottom:`1px solid #313244`},children:[(0,C.jsx)(`h1`,{id:`settings-dialog-title`,style:{margin:0,color:`#f5e0dc`,fontSize:16},children:`Settings`}),(0,C.jsx)(`button`,{ref:r,type:`button`,onClick:u,"aria-label":`Close settings`,title:`Close settings`,style:{marginLeft:`auto`,padding:3,border:`none`,background:`transparent`,color:`#7f849c`,fontSize:15,cursor:`pointer`},children:`✕`})]}),(0,C.jsxs)(`div`,{style:{padding:`12px 8px`},children:[(0,C.jsx)(`div`,{style:{padding:`0 8px 6px`,color:`#585b70`,fontSize:9,fontWeight:800,letterSpacing:`0.1em`,textTransform:`uppercase`},children:`Graph`}),(0,C.jsx)(`button`,{type:`button`,onClick:()=>a(`appearance`),"aria-current":i===`appearance`?`page`:void 0,style:B(i===`appearance`),children:`Appearance`}),(0,C.jsxs)(`button`,{type:`button`,onClick:()=>a(`commit-icons`),"aria-current":i===`commit-icons`?`page`:void 0,style:{...B(i===`commit-icons`),marginTop:3},children:[`Commit icons`,o?` •`:``]}),(0,C.jsx)(`div`,{style:{padding:`14px 8px 6px`,color:`#585b70`,fontSize:9,fontWeight:800,letterSpacing:`0.1em`,textTransform:`uppercase`},children:`Working tree`}),(0,C.jsxs)(`button`,{type:`button`,onClick:()=>a(`conflict-resolvers`),"aria-current":i===`conflict-resolvers`?`page`:void 0,style:B(i===`conflict-resolvers`),children:[`Lockfile resolvers`,c?` •`:``]})]}),(0,C.jsx)(`div`,{style:{marginTop:`auto`,padding:12,borderTop:`1px solid #313244`,color:`#45475a`,fontSize:9,lineHeight:1.45},children:`Settings apply across repositories on this device.`})]}),(0,C.jsx)(`main`,{style:{minWidth:0,minHeight:0},children:e&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`div`,{style:{display:i===`appearance`?`block`:`none`,height:`100%`},children:(0,C.jsx)(z,{onClose:u})}),(0,C.jsx)(`div`,{style:{display:i===`commit-icons`?`block`:`none`,height:`100%`},children:(0,C.jsx)(F,{onClose:t,onDirtyChange:s})}),(0,C.jsx)(`div`,{style:{display:i===`conflict-resolvers`?`block`:`none`,height:`100%`},children:(0,C.jsx)(R,{onClose:t,onDirtyChange:l})})]})})]})]})}export{V as SettingsDialog};
|