@puddle-code/cli 0.3.4 → 0.3.6
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 +4 -13
- package/dist/host-control.mjs +5 -1
- package/dist/index.js +10 -4
- package/dist/public/assets/{App-CwV0Dizo.js → App-Duewv-oi.js} +2 -2
- package/dist/public/assets/{Dashboard-fA7E3Mr1.js → Dashboard-7gBsrB7q.js} +1 -1
- package/dist/public/assets/{EditorTabClose-DNWGZZN8.js → EditorTabClose-BV-zQyHT.js} +1 -1
- package/dist/public/assets/{LazyTerminal-CAvxgexS.js → LazyTerminal-gX1-vBQf.js} +2 -2
- package/dist/public/assets/{ModelRefcount-CJK-g5rf.js → ModelRefcount-BasPzO4R.js} +1 -1
- package/dist/public/assets/{NewProjectDialog-eDAOcbIM.js → NewProjectDialog-CDYUPliQ.js} +1 -1
- package/dist/public/assets/{PaneEditorBody-Cxn0s84L.js → PaneEditorBody-CqLkAxM1.js} +3 -3
- package/dist/public/assets/{PdfViewer-BY5xRKk1.js → PdfViewer-DAAfA9OC.js} +1 -1
- package/dist/public/assets/{SettingsDialog-Sd6i7Plz.js → SettingsDialog-DiwhE5dK.js} +1 -1
- package/dist/public/assets/{Terminal-CqjwbNAI.js → Terminal-DmlEI-h7.js} +3 -3
- package/dist/public/assets/{Workspace-C-M1AjMn.js → Workspace-cfjpv0xU.js} +4 -4
- package/dist/public/assets/{auth-cjbSLnao.js → auth-BxExwqPW.js} +1 -1
- package/dist/public/assets/{buffer-store-BAQjeFXg.js → buffer-store-CYe-IdNO.js} +1 -1
- package/dist/public/assets/{copy-Df7qIcX6.js → copy-CjatFFf8.js} +1 -1
- package/dist/public/assets/{disclosure-C2uTs3Vm.js → disclosure-7lu23NnB.js} +1 -1
- package/dist/public/assets/{dist-Cl5AP2As.js → dist-7fft9rhQ.js} +1 -1
- package/dist/public/assets/{errors-BiS6nBXL.js → errors-DhRwiizF.js} +1 -1
- package/dist/public/assets/{index-CW1P_8TN.js → index-BRywm-gU.js} +3 -3
- package/dist/public/assets/{markdown-mermaid-JPAETK2Y.js → markdown-mermaid-CF9txXiK.js} +1 -1
- package/dist/public/assets/{media-refresh-store-CHnqDJWI.js → media-refresh-store-DLtYZTP9.js} +1 -1
- package/dist/public/assets/{notification-delivery-Lz-hnQG7.js → notification-delivery-CoCRZRSK.js} +1 -1
- package/dist/public/assets/{project-abbrev-Bz8ZEwrb.js → project-abbrev-DX_a_ySv.js} +1 -1
- package/dist/public/assets/{protocol-support-CJIxbQCB.js → protocol-support-gmAQBWF3.js} +1 -1
- package/dist/public/assets/{scroll-restoration-r--43sOx.js → scroll-restoration-hg7BYUz2.js} +1 -1
- package/dist/public/assets/{selection-actions-C2udLSyj.js → selection-actions-BZy4596m.js} +1 -1
- package/dist/public/assets/{switch-DwMO1AUH.js → switch-OD1b2aeq.js} +1 -1
- package/dist/public/assets/{use-ui-state-Crvfdw4F.js → use-ui-state-C2LCTPRw.js} +1 -1
- package/dist/public/assets/{ws-B1kcYo2j.js → ws-oU1ansI7.js} +1 -1
- package/dist/public/index.html +2 -2
- package/dist/pudl.js +6 -2
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{t as n}from"./jsx-runtime-ffCh33zF.js";import{a as r,c as i,d as a,f as o,i as s,l as c,r as ee,s as l}from"./LazyTerminal-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{t as n}from"./jsx-runtime-ffCh33zF.js";import{a as r,c as i,d as a,f as o,i as s,l as c,r as ee,s as l}from"./LazyTerminal-gX1-vBQf.js";import{G as u,K as d,Y as te,c as ne,d as re,it as ie,tt as f,wt as ae}from"./protocol-support-gmAQBWF3.js";import{r as p,u as m}from"./project-abbrev-DX_a_ySv.js";import{t as h}from"./button-Chvl9hcE.js";import{t as g}from"./createLucideIcon-DyMAgLa3.js";import{a as _,i as v,n as y,o as b,r as x,t as S}from"./dialog-Bnex_wlx.js";import{t as oe}from"./use-debounced-value-C86N-mOK.js";var C=g(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),w=e(t(),1),T=n();function E(e){let t=e.trim().replace(/\/+$/,``);return t===``?`/`:t}function D(e){return e.startsWith(`/`)||e.startsWith(`~`)}function O(e){let t=e.replace(/\/+$/,``),n=t.lastIndexOf(`/`);return n<=0?`/`:t.slice(0,n)}function se({dir:e,onNavigate:t,onChoose:n}){let r=f(e.endsWith(`/`)?e:`${e}/`);return(0,T.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,T.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,T.jsxs)(`button`,{type:`button`,onClick:()=>t(O(e)),disabled:e===`/`,title:`Parent directory`,className:`shrink-0 rounded-sm p-1 text-fg-gold transition-colors hover:bg-elevated hover:text-fg disabled:pointer-events-none disabled:opacity-40`,children:[(0,T.jsx)(p,{className:`size-3.5`}),(0,T.jsx)(`span`,{className:`sr-only`,children:`Parent directory`})]}),(0,T.jsx)(`button`,{type:`button`,onClick:()=>n(e),className:`ml-auto shrink-0 text-2xs text-fg-muted transition-colors hover:text-fg`,children:`choose this folder`})]}),(0,T.jsxs)(`div`,{className:`max-h-48 overflow-y-auto`,children:[(r.data?.entries??[]).map(e=>(0,T.jsxs)(`div`,{className:`flex items-center rounded-md transition-colors hover:bg-elevated`,children:[(0,T.jsxs)(`button`,{type:`button`,onClick:()=>t(e.path),className:`flex min-w-0 flex-1 items-center gap-2 px-2 py-1 text-left`,children:[e.is_git?(0,T.jsx)(l,{className:`size-3.5 shrink-0 text-success`}):(0,T.jsx)(C,{className:`size-3.5 shrink-0 text-fg-gold`}),(0,T.jsx)(`span`,{className:`truncate text-xs text-fg`,children:e.name})]}),e.is_git&&(0,T.jsx)(`button`,{type:`button`,onClick:()=>n(e.path),className:`shrink-0 px-2 py-1 text-2xs text-fg-muted transition-colors hover:text-fg`,children:`choose`})]},e.path)),r.data!==void 0&&r.data.entries.length===0&&(0,T.jsx)(`p`,{className:`px-2 py-1 text-xs text-fg-muted`,children:`No subdirectories.`})]})]})}function k({profileId:e,open:t,onOpenChange:n}){let l=ae(),p=te().data?.protocol,g=ne(p),C=re(p),O=d(),k=u(),A=m(),j=ie(),[M,N]=(0,w.useState)(``),[P,F]=(0,w.useState)(``),[I,L]=(0,w.useState)(!1),[R,z]=(0,w.useState)(``),[B,V]=(0,w.useState)(null),[H,U]=(0,w.useState)(!1),[W,G]=(0,w.useState)(null),[K,q]=(0,w.useState)(null),J=j.data?.home,ce=()=>{let e=M.trim(),t=D(e)&&J!==void 0?E(e.replace(/^~(?=\/|$)/,J)):D(e)&&e.startsWith(`/`)?E(e):J??`/`;X(t)},Y=e=>{F(e),H||z(a(e))},X=e=>{q(e),N(e)},le=e=>{N(e),q(null),Y(e.split(`/`).filter(Boolean).pop()??``),L(!0)},Z=f(oe(M,150)),ue=(0,w.useMemo)(()=>{if(!D(M))return(l.data??[]).map(e=>({value:e.path,badge:`registered`,is_git:!0}));let e=new Set((l.data??[]).map(e=>e.path));return(Z.data?.entries??[]).map(t=>({value:t.path,label:t.name,badge:e.has(t.path)?`registered`:t.is_git?`git`:void 0,is_git:t.is_git}))},[M,l.data,Z.data]),Q=async()=>{G(null);try{let t=E(M),r=l.data?.find(e=>e.path===t)?.id??(await O.mutateAsync({path:t,...g?{default_base_branch:``}:{}})).id,i=await k.mutateAsync({profile_id:e,repo_id:r,name:P.trim(),...C?{colour:B}:{},...o(R)?{abbrev:o(R)}:{}});n(!1),A(`/project/${i.id}`)}catch(e){G(e instanceof Error?e.message:String(e))}},$=P.trim()!==``&&D(M.trim());return(0,T.jsx)(S,{open:t,onOpenChange:n,children:(0,T.jsxs)(y,{children:[(0,T.jsxs)(_,{children:[(0,T.jsx)(b,{children:`New project`}),(0,T.jsx)(x,{children:`Point at a git repository on the daemon host — known repositories are reused.`})]}),(0,T.jsxs)(`form`,{className:`flex flex-col gap-3`,onSubmit:e=>{e.preventDefault(),$&&Q()},children:[(0,T.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,T.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,T.jsx)(i,{htmlFor:`repo-path`,children:`Repository path`}),(0,T.jsx)(`button`,{type:`button`,onClick:()=>K===null?ce():q(null),className:`text-2xs text-fg-muted transition-colors hover:text-fg`,children:K===null?`browse…`:`hide browser`})]}),(0,T.jsx)(ee,{id:`repo-path`,placeholder:`~/src/my-repo`,value:M,onValueChange:N,onChoose:e=>{!I&&e.is_git&&Y(e.value.split(`/`).filter(Boolean).pop()??``)},hints:ue}),K!==null&&(0,T.jsx)(se,{dir:K,onNavigate:X,onChoose:le})]}),(0,T.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,T.jsx)(i,{htmlFor:`project-name`,children:`Project name`}),(0,T.jsx)(c,{id:`project-name`,placeholder:`e.g. checkout-rework`,value:P,className:r(B),onChange:e=>{Y(e.target.value),L(!0)}})]}),(0,T.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,T.jsx)(i,{htmlFor:`project-abbrev`,children:`Abbreviation`}),(0,T.jsx)(c,{id:`project-abbrev`,placeholder:P.trim()?a(P):`ABBRV`,maxLength:5,value:R,onChange:e=>{z(o(e.target.value)),U(!0)},className:`w-24 uppercase`}),(0,T.jsxs)(`p`,{className:`text-2xs text-fg-muted`,children:[`Up to `,5,` characters — the project's label on the collapsed sidebar rail.`]})]}),C&&(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,T.jsx)(`span`,{className:`text-xs text-fg-secondary`,children:`Colour`}),(0,T.jsx)(s,{value:B,onChange:V,label:`Project colour`})]}),W&&(0,T.jsx)(`p`,{className:`text-xs text-danger`,children:W}),(0,T.jsxs)(v,{children:[(0,T.jsx)(h,{type:`button`,variant:`ghost`,onClick:()=>n(!1),children:`Cancel`}),(0,T.jsx)(h,{type:`submit`,disabled:!$||O.isPending||k.isPending,children:`Create project`})]})]})]})})}export{k as t};
|