@jxsuite/studio 5.6.0 → 5.7.0
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/dist/chunks/{2020-zvax9fmb.js → 2020-cs2sb9t1.js} +3 -3
- package/dist/chunks/adapter-y5gdq19c.js +4 -0
- package/dist/chunks/{cf-account-picker-zfycs4k2.js → cf-account-picker-882a7ecm.js} +3 -3
- package/dist/chunks/cf-settings-20dznc3j.js +4 -0
- package/dist/chunks/components-q037dya7.js +4 -0
- package/dist/chunks/content-source-37x3vsap.js +4 -0
- package/dist/chunks/{convert-to-repeater-x19jr6c7.js → convert-to-repeater-grfep2w8.js} +3 -3
- package/dist/chunks/editor-j5sq149q.js +4 -0
- package/dist/chunks/entry-commands-c5h3nqck.js +4 -0
- package/dist/chunks/{extension-sections-y90sa0n4.js → extension-sections-dp8endhx.js} +3 -3
- package/dist/chunks/file-ops-937cvqk6.js +4 -0
- package/dist/chunks/files-tznwe1p1.js +4 -0
- package/dist/chunks/format-host-e2pjvd25.js +4 -0
- package/dist/chunks/fs-events-fv64ak3s.js +4 -0
- package/dist/chunks/git-panel-gb713ttc.js +4 -0
- package/dist/chunks/{grid-view-d9mybhn0.js → grid-view-5amhg604.js} +10 -10
- package/dist/chunks/iframe-host-t819mcg5.js +4 -0
- package/dist/chunks/{index-vnwy9d44.js → index-9ydfe04y.js} +3 -3
- package/dist/chunks/index-m0x5ztax.js +4 -0
- package/dist/chunks/{javascript-f0nrbdjb.js → javascript-d9pqgc2p.js} +2 -2
- package/dist/chunks/{jsonMode-nfa90dtf.js → jsonMode-800yvbem.js} +4 -4
- package/dist/chunks/jx-validate-zc9zp77s.js +4 -0
- package/dist/chunks/layers-4bsr82wz.js +4 -0
- package/dist/chunks/layers-panel-b6shnaax.js +4 -0
- package/dist/chunks/lit-html-cfn61dn7.js +4 -0
- package/dist/chunks/media-picker-ej0kdh1j.js +4 -0
- package/dist/chunks/menu-rtxf9chb.js +4 -0
- package/dist/chunks/{monaco-binding-antn79jf.js → monaco-binding-62dtmgbf.js} +3 -3
- package/dist/chunks/monaco-buffer-nn4dtx27.js +4 -0
- package/dist/chunks/{monaco-setup-k8s40vwg.js → monaco-setup-tj13ndtm.js} +3 -3
- package/dist/chunks/notify-ahs57a2z.js +4 -0
- package/dist/chunks/platform-v9xyfkbx.js +4 -0
- package/dist/chunks/publish-panel-bq36xcmj.js +4 -0
- package/dist/chunks/quick-search-zm00h9dh.js +4 -0
- package/dist/chunks/references-99ws0b0m.js +4 -0
- package/dist/chunks/right-panel-pq2f71q3.js +4 -0
- package/dist/chunks/section-registry-b2yzp9sw.js +4 -0
- package/dist/chunks/{studio-y17505ge.js → studio-01kbbqg3.js} +207 -207
- package/dist/chunks/{studio-gxna6yta.js → studio-01qza1n3.js} +4 -4
- package/dist/chunks/{studio-n2e133d6.js → studio-03wwfvyt.js} +4 -4
- package/dist/chunks/{studio-09n3fyy0.js → studio-0bbxhhce.js} +4 -4
- package/dist/chunks/{studio-dknr8m7b.js → studio-0k9mvpgj.js} +7 -7
- package/dist/chunks/{studio-s85vah66.js → studio-0scebvb9.js} +5 -5
- package/dist/chunks/studio-1a99w39s.js +5 -0
- package/dist/chunks/{studio-eegyf5vg.js → studio-1wvfxkyy.js} +4 -4
- package/dist/chunks/{studio-ft8pfpp0.js → studio-1x8x26k3.js} +4 -4
- package/dist/chunks/{studio-28pz4s1k.js → studio-222rqyyc.js} +4 -4
- package/dist/chunks/{studio-6exg5z4x.js → studio-4xppwncr.js} +3 -3
- package/dist/chunks/{studio-0c3fpdqj.js → studio-54g077x3.js} +5 -5
- package/dist/chunks/{studio-z47mm077.js → studio-56z7evx4.js} +6 -6
- package/dist/chunks/{studio-zkkdbbvd.js → studio-5e9zsamh.js} +6 -6
- package/dist/chunks/{studio-4yztve2t.js → studio-65fhspdd.js} +4 -4
- package/dist/chunks/{studio-b29h7g7s.js → studio-693nhyky.js} +4 -4
- package/dist/chunks/{studio-654fxcr0.js → studio-7pgy3xaf.js} +4 -4
- package/dist/chunks/{studio-k9pwvmz8.js → studio-888knnkc.js} +4 -4
- package/dist/chunks/{studio-b5rxwkj2.js → studio-9mqfamps.js} +4 -4
- package/dist/chunks/{studio-011em5cf.js → studio-a7xqhc3n.js} +4 -4
- package/dist/chunks/{studio-mf41717j.js → studio-aje966s9.js} +4 -4
- package/dist/chunks/studio-aqmph6k4.js +5 -0
- package/dist/chunks/studio-c6w3tq7t.js +5 -0
- package/dist/chunks/{studio-tzs6njnb.js → studio-c6zdm25z.js} +7 -7
- package/dist/chunks/{studio-1pxvgx1t.js → studio-c9d3pxf7.js} +4 -4
- package/dist/chunks/{studio-pvj970st.js → studio-ceb34dxj.js} +4 -4
- package/dist/chunks/studio-cvbkkfqb.js +5 -0
- package/dist/chunks/{studio-sadckcpp.js → studio-cxt150pj.js} +5 -5
- package/dist/chunks/{studio-891t1tv9.js → studio-dkn3x3hz.js} +4 -4
- package/dist/chunks/studio-e6re3rk1.js +5 -0
- package/dist/chunks/{studio-9n2j9nqk.js → studio-edbtvcd1.js} +4 -4
- package/dist/chunks/{studio-wr0pq67n.js → studio-eh0rac07.js} +4 -4
- package/dist/chunks/{studio-mm8x32gg.js → studio-evwgp1ym.js} +4 -4
- package/dist/chunks/{studio-9tkaykt5.js → studio-f195h2hq.js} +4 -4
- package/dist/chunks/{studio-0nm2skex.js → studio-fqq890ap.js} +3 -3
- package/dist/chunks/{studio-02y9cb4h.js → studio-frb0qbf7.js} +5 -5
- package/dist/chunks/{studio-je15p5v8.js → studio-gfn1kpxj.js} +5 -5
- package/dist/chunks/{studio-ymsjnvp9.js → studio-gh97gngt.js} +4 -4
- package/dist/chunks/{studio-zkvyd3ev.js → studio-gp02nqnw.js} +4 -4
- package/dist/chunks/{studio-5fc0728f.js → studio-hjbg8d5y.js} +7 -7
- package/dist/chunks/{studio-dtmdjmqb.js → studio-j6gnhvaa.js} +4 -4
- package/dist/chunks/{studio-d007j0z3.js → studio-mwxgyn9h.js} +6 -6
- package/dist/chunks/{studio-36s6qjgq.js → studio-n78gjfy8.js} +4 -4
- package/dist/chunks/studio-nbxqcgvf.js +5 -0
- package/dist/chunks/{studio-ks0ecgjx.js → studio-nt06yybj.js} +4 -4
- package/dist/chunks/{studio-ebt49j3c.js → studio-p7c1agz0.js} +5 -5
- package/dist/chunks/{studio-y164brht.js → studio-pwqfmt4p.js} +4 -4
- package/dist/chunks/{studio-6zyt56ek.js → studio-r3kaka4d.js} +4 -4
- package/dist/chunks/{studio-tj28pxa1.js → studio-semd1s8s.js} +4 -4
- package/dist/chunks/studio-skzanb0k.js +5 -0
- package/dist/chunks/{studio-z1vdxq0e.js → studio-spf2skgc.js} +4 -4
- package/dist/chunks/{studio-7w04zw8h.js → studio-st75kn99.js} +5 -5
- package/dist/chunks/{studio-dmymvk2j.js → studio-sxc0zvpt.js} +3 -3
- package/dist/chunks/studio-t1eedsyx.js +4 -0
- package/dist/chunks/{studio-153mwkyq.js → studio-tp642n5g.js} +4 -4
- package/dist/chunks/{studio-r7yeeqc4.js → studio-tw7rre6s.js} +4 -4
- package/dist/chunks/{studio-t0v47dpc.js → studio-tzegmy4w.js} +4 -4
- package/dist/chunks/studio-vavmwshr.js +5 -0
- package/dist/chunks/{studio-805fwp9k.js → studio-wma2c6g8.js} +4 -4
- package/dist/chunks/studio-x92tgnee.js +64 -0
- package/dist/chunks/studio-xk0z6msk.js +5 -0
- package/dist/chunks/{studio-njmg0e73.js → studio-xry7tk3z.js} +5 -5
- package/dist/chunks/{studio-sgzss898.js → studio-xta2vxp6.js} +7 -7
- package/dist/chunks/{studio-jsr14n1s.js → studio-xy3tv3az.js} +4 -4
- package/dist/chunks/{studio-6k1eswp9.js → studio-y7jehjrp.js} +4 -4
- package/dist/chunks/{studio-81twpmzj.js → studio-yr04mv2j.js} +4 -4
- package/dist/chunks/{studio-gj4j9e7k.js → studio-zd4kayn2.js} +4 -4
- package/dist/chunks/{studio-w8w9frjy.js → studio-zpnk016a.js} +12 -12
- package/dist/chunks/{tsMode-eq26t9gs.js → tsMode-k9s9fcag.js} +4 -4
- package/dist/chunks/workspace-b69mgm0e.js +4 -0
- package/dist/chunks/{ws-client-3gxqp06s.js → ws-client-0ja08haa.js} +3 -3
- package/dist/manifest.json +62 -62
- package/dist/studio.js +95 -95
- package/package.json +3 -3
- package/src/canvas/stage-scrollbar.ts +7 -7
- package/src/files/file-ops.ts +5 -8
- package/src/panels/jump-bar.ts +132 -158
- package/src/panels/pane-context.ts +8 -8
- package/src/panels/pane-grid.ts +18 -26
- package/src/panels/style-panel.ts +2 -2
- package/src/services/context-manager.ts +41 -70
- package/src/services/document-assistant.ts +12 -3
- package/src/services/harness/chat-reducer.ts +115 -0
- package/src/services/harness/turn-hooks.ts +50 -0
- package/src/services/tool-executor.ts +69 -288
- package/src/services/tool-outcomes.ts +12 -10
- package/src/studio.ts +2 -5
- package/src/surfaces/block-action-bar.json +6 -1
- package/src/surfaces/jump-bar.json +9 -12
- package/src/surfaces/jump-bar.ts +15 -16
- package/src/surfaces/pane-context.json +2 -2
- package/src/surfaces/pane-grid.json +8 -25
- package/src/surfaces/pane-grid.ts +7 -8
- package/src/surfaces/statusbar.json +71 -3
- package/src/surfaces/statusbar.ts +66 -139
- package/src/surfaces/style-panel.json +3 -3
- package/src/surfaces/style-panel.ts +11 -1
- package/dist/chunks/adapter-6zhjbpmd.js +0 -4
- package/dist/chunks/cf-settings-fpa485q3.js +0 -4
- package/dist/chunks/components-b0vh4sq8.js +0 -4
- package/dist/chunks/content-source-z5t0d0h9.js +0 -4
- package/dist/chunks/editor-7e23n4a8.js +0 -4
- package/dist/chunks/entry-commands-5cm6aba2.js +0 -4
- package/dist/chunks/file-ops-hv7gf757.js +0 -4
- package/dist/chunks/files-kb0epdxf.js +0 -4
- package/dist/chunks/format-host-eg1wy2bp.js +0 -4
- package/dist/chunks/fs-events-ky3vxfmh.js +0 -4
- package/dist/chunks/git-panel-yyg3bzp2.js +0 -4
- package/dist/chunks/iframe-host-9wdf0hes.js +0 -4
- package/dist/chunks/index-2tf0m2ne.js +0 -4
- package/dist/chunks/jx-validate-7w11db9v.js +0 -4
- package/dist/chunks/layers-7zasrpse.js +0 -4
- package/dist/chunks/layers-panel-9nzc4fdq.js +0 -4
- package/dist/chunks/lit-html-5qr7nbng.js +0 -4
- package/dist/chunks/media-picker-maevn9d4.js +0 -4
- package/dist/chunks/menu-wq6q0v3y.js +0 -4
- package/dist/chunks/monaco-buffer-9ry2rn5x.js +0 -4
- package/dist/chunks/notify-g91gjd6w.js +0 -4
- package/dist/chunks/platform-jdwjp2vt.js +0 -4
- package/dist/chunks/publish-panel-8yym447p.js +0 -4
- package/dist/chunks/quick-search-9bzm9kh3.js +0 -4
- package/dist/chunks/references-znssfqvq.js +0 -4
- package/dist/chunks/right-panel-czbzktm8.js +0 -4
- package/dist/chunks/section-registry-0rtq73qs.js +0 -4
- package/dist/chunks/studio-0mm38y62.js +0 -5
- package/dist/chunks/studio-27tc8q0h.js +0 -5
- package/dist/chunks/studio-7djymzt2.js +0 -5
- package/dist/chunks/studio-ant1zbp3.js +0 -5
- package/dist/chunks/studio-eb5sty2k.js +0 -5
- package/dist/chunks/studio-frv7vjhw.js +0 -5
- package/dist/chunks/studio-mb8jhtr4.js +0 -64
- package/dist/chunks/studio-nvykrgbj.js +0 -4
- package/dist/chunks/studio-nw4q9sdn.js +0 -5
- package/dist/chunks/studio-p6avneaq.js +0 -5
- package/dist/chunks/studio-vz7b43ng.js +0 -5
- package/dist/chunks/workspace-emt8454d.js +0 -4
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{_t,Lr,qr,Hu}from"./studio-semd1s8s.js";function Rf(){return Lr(_t.cfToken)}function $_(t){qr(_t.cfToken,t||"")}function D_(){return Lr(_t.cfAccountId)}function h$(t){qr(_t.cfAccountId,t||"")}function A_(){Hu([_t.cfToken,_t.cfAccountId])}
|
|
2
|
+
export{Rf,$_,D_,h$,A_};
|
|
3
|
+
|
|
4
|
+
//# debugId=35E77CC9D5BD485E64756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-1a99w39s.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
function v(s,n={}){let t=n.baseMs??1000,o=n.maxMs??30000,i=n.random??Math.random,e=Math.min(o,t*2**Math.max(0,s));return e/2+i()*e/2}function
|
|
2
|
-
export{
|
|
1
|
+
function v(s,n={}){let t=n.baseMs??1000,o=n.maxMs??30000,i=n.random??Math.random,e=Math.min(o,t*2**Math.max(0,s));return e/2+i()*e/2}function zg(s,n={}){let t=n.win??(typeof window>"u"?void 0:window),o=n.doc??(typeof document>"u"?void 0:document),i=0,e=null,r=!1,a=()=>{if(e=null,!r)s()},c=()=>{if(r||e===null)return;clearTimeout(e),i=0,a()},u=(d)=>{if(d.persisted)c()},l=()=>{if(o?.visibilityState==="visible")c()};return t?.addEventListener("online",c),t?.addEventListener("pageshow",u),o?.addEventListener("visibilitychange",l),{dispose(){if(r)return;if(r=!0,e!==null)clearTimeout(e),e=null;t?.removeEventListener("online",c),t?.removeEventListener("pageshow",u),o?.removeEventListener("visibilitychange",l)},opened(){i=0},scheduleRetry(){if(r||e!==null)return;let d=v(i,n);i+=1,e=setTimeout(a,d)},wake:c}}
|
|
2
|
+
export{zg};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
5
|
-
//# sourceMappingURL=studio-
|
|
4
|
+
//# debugId=34607FEE061EF8D964756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-1wvfxkyy.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{p}from"./studio-
|
|
2
|
-
export{
|
|
1
|
+
import{p}from"./studio-y7jehjrp.js";import{me}from"./studio-0bbxhhce.js";var s=null,y=null,h=null,g=!1;function E(n){return h=n,g=!0,s?P():Promise.resolve()}async function P(){if(!g)return;g=!1;try{let{applyProjectSchemas:n}=await (me("tj13ndtm"),import("./monaco-setup-tj13ndtm.js"));n(h)}catch{}}function Ep(){if(s)return Promise.resolve(s);return y??=(async()=>{let[n]=await Promise.all([(me("j5sq149q"),import("./editor-j5sq149q.js")),(me("tj13ndtm"),import("./monaco-setup-tj13ndtm.js"))]);return s=n,await P(),s})(),y}function th(){return s}function Rm(n,t,o){if(!n?.isConnected||t)return!1;return o()}var r=[],l=null;function qt(){if(!l)l=(async()=>{try{r=await p().listFormats?.()??[]}catch{r=[]}return r})();return l}function Md(){l=null,r=[],m=null,a=[],d=null,c=[]}var a=[],m=null;function Pd(){if(!m)m=(async()=>{try{a=await p().listExtensions?.()??[]}catch{a=[]}return a})();return m}function $m(){return a}var c=[],d=null;function F(){if(!d)d=(async()=>{try{c=await p().listExtensionCatalog?.()??[]}catch{c=[]}return c})();return d}function Lv(){return c}async function M(n){let t=null;try{t=await n.fetchProjectSchemas?.()??null}catch{}E(t),await (me("zc9zp77s"),import("./jx-validate-zc9zp77s.js")).then(({applyProjectSchemas:o})=>o(t)).catch(()=>!1)}function Ga(n){M(n),F(),(me("dp8endhx"),import("./extension-sections-dp8endhx.js")).then(({syncExtensionSettingsSections:t})=>t()).catch(()=>{})}function Tp(){return r}function Vs(n,t){let o=n.startsWith(".")?n.toLowerCase():`.${n.toLowerCase()}`;return r.find((e)=>e.extensions.includes(o)&&(!t||e.capabilities[t]))}function wi(n){if(!n)return;return r.find((t)=>t.name===n)}function Lp(n){return Error(`No format class imported for "${n}" — add one to project.json imports `+`(e.g. "Markdown": "@jxsuite/parser/Markdown.class.json") and make sure the project's dependencies are installed`)}function Zt(n){if(!n)return;let t=n.lastIndexOf(".");if(t===-1)return;return Vs(n.slice(t))}function Ka(n){let t=new Set;for(let o of r){if(n&&!o.documentKinds.includes(n))continue;for(let e of o.extensions)t.add(e)}return t.delete(".json"),[...t]}function Dr(){return r.find((n)=>n.capabilities.serialize&&n.documentKinds.includes("content"))}async function k(n){let t=p();if(!t.formatAction)throw Error("Platform does not support format actions");return t.formatAction(n)}async function ck(n,t,o){return await k({action:"parse",format:n,options:o,source:t})}async function Us(n,t,o){return await k({action:"serialize",doc:t,format:n,options:o})}function dk(n,t){let o=n?.studio?.documentMode,e=o?.componentWhen;if(e?.frontmatterKey){let i=t[e.frontmatterKey],u=e.matches?new RegExp(e.matches):/./;if(typeof i==="string"&&u.test(i))return{document:t,frontmatter:{},mode:"component"}}if(o?.default==="component")return{document:t,frontmatter:{},mode:"component"};let f=t.children??[];if(f.length===0)f.push({children:[],tagName:"p"});let S=new Set(["state","imports"]),x={children:f},w={};for(let[i,u]of Object.entries(t)){if(i==="children")continue;if(S.has(i))x[i]=u;else w[i]=u}return{document:x,frontmatter:w,mode:"content"}}
|
|
2
|
+
export{Ep,th,Rm,qt,Md,Pd,$m,Lv,Ga,Tp,Vs,wi,Lp,Zt,Ka,Dr,ck,Us,dk};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
5
|
-
//# sourceMappingURL=studio-
|
|
4
|
+
//# debugId=AFD18F3445E6650C64756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-1x8x26k3.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{p,We}from"./studio-6k1eswp9.js";import{_t,Lr,mL,ev,tv,Ur,bL,ju}from"./studio-tj28pxa1.js";import{S}from"./studio-0nm2skex.js";import{bs,Ct}from"./studio-z1vdxq0e.js";var s=null;async function bc(){if(!We()||typeof p().getAccountStatus!=="function"){s=null;return}try{s=await p().getAccountStatus?.()??null}catch{s=null}}function Ww(){return s}function Vw(){return s!==null&&s.installations.length===0&&Boolean(s.appInstallUrl)}function lT(){if(s===null)return null;let e=s.installations.flatMap((t)=>t.manageUrl?[{account:t.account??`Installation ${t.id}`,url:t.manageUrl}]:[]);if(e.length===0&&!s.appInstallUrl)return null;return{manage:e,...s.appInstallUrl?{installUrl:s.appInstallUrl}:{}}}function cT(){return s?.entries??[]}function H1(){return(s?.notices??[]).filter((e)=>e.display!=="toast")}var j=new Set;function I(){let e=(s?.notices??[]).filter((t)=>t.display==="toast"&&!j.has(t.id));for(let t of e)j.add(t.id);return e}var M="https://jxsuite.com/problems/";function tm(e){if(typeof e!=="string"||!e.startsWith("https://jxsuite.com/problems/"))return null;let t=e.slice(29);return t===""?null:t}function $o(e){if(typeof e==="string")return e.trim()===""?null:e;if(!e||typeof e!=="object")return null;let t=e;for(let o of[t.detail,t.error,t.title])if(typeof o==="string"&&o.trim()!=="")return o;return null}function Ps(e,t){return $o(e)??(t===void 0?"Request failed":`Request failed (${t})`)}var a=(e,t,o,r)=>({status:t,title:o,type:`${M}${e}`,...r===void 0?{}:{extensions:r}}),re={invalidRequest:a("invalid-request",400,"The request was malformed or incomplete"),notFound:a("not-found",404,"The requested resource does not exist"),methodNotAllowed:a("method-not-allowed",405,"That method is not allowed on this route"),conflict:a("conflict",409,"The request conflicts with the current state",["conflicts"]),payloadTooLarge:a("payload-too-large",413,"The request body is too large"),unauthorized:a("unauthorized",401,"Credentials are missing or not accepted"),forbidden:a("forbidden",403,"The request was refused"),needsInstallationAccess:a("needs-installation-access",403,"The GitHub App is not installed for that account",["installUrl"]),pathOutsideProject:a("path-outside-project",403,"The path resolves outside the active project"),actionRequired:a("action-required",403,"An action is required first",["actions","heading","retry"]),noActiveProject:a("no-active-project",409,"No project is active on this backend"),capabilityUnavailable:a("capability-unavailable",501,"This backend does not provide that capability"),upstreamFailure:a("upstream-failure",502,"An upstream service failed",["upstream"]),internalError:a("internal-error",500,"The backend failed to complete the request")};var Uw=".jx-loc-id",n=(e,t,o,r)=>({method:e,path:t,optional:r!==void 0,summary:o,...r===void 0?{}:{degradation:r}}),se={activate:n("POST","/__studio/activate","Bind the backend to a project root"),project:n("GET","/__studio/project","Root project metadata {name, root}"),projectInfo:n("GET","/__studio/project-info","Probe a directory: {isSiteProject, projectConfig?, directories?}"),resolveSite:n("GET","/__studio/resolve-site","Resolve the owning site of a file path {sitePath, projectConfig?, fileRelPath?}"),sites:n("GET","/__studio/sites","Enumerate site projects [{config, path}] (backs listProjects)","The welcome screen's Projects catalogue stays hidden."),findProject:n("GET","/__studio/find-project","Locate a project directory by name outside the root","openProject falls back to config-matching only."),locateDirectory:n("GET","/__studio/locate-directory","Resolve the absolute path of a showDirectoryPicker() folder by the id in its .jx-loc-id","Browse… reports that the folder could not be placed; the Location is typed by hand."),createProject:n("POST","/__studio/create-project","Scaffold a project at a caller-chosen destination → {root, config}"),starters:n("GET","/__studio/starters","Starter templates (StarterInfo[])","The New Project picker offers only blank/templates."),importSite:n("POST","/__studio/import-site","Clone a live website into a project; streams NDJSON progress","The New Project Import tab is unavailable."),files:n("GET","/__studio/files","List a directory (DirEntry[]) in stable path order; an entry may carry an opaque content `version` the backend vouches for; with ?glob=<pattern>, search matching files project-wide"),fileRead:n("GET","/__studio/file","Read a file's text content"),filesRead:n("POST","/__studio/files/read","Read many files' text content {paths} → ReadFilesResult {files: [path, {content} | "+"{error: {status, code?, message}}][], omitted}. At most READ_FILES_MAX_PATHS (200) paths and a backend byte budget per call: the excess is listed in `omitted` (never a 400) and the first path is always answered. Per-path errors: 404 missing/deleted, 415 binary, 413 too large, 502 upstream. Allowed for read-only sessions; keeps fileRead's server-side effects","Adapters fall back to one fileRead per path."),fileWrite:n("PUT","/__studio/file","Write a file's text content"),fileDelete:n("DELETE","/__studio/file","Delete a file"),fileUpload:n("POST","/__studio/file/upload","Upload binary content to a path → UploadResult {path, size?}. `path` is the answer, not an "+"echo: a store that de-duplicates, suffixes, or normalizes names reports what it really wrote"),fileBytes:n("GET","/__studio/file/bytes","A project file's raw bytes, undecoded — the read side of `fileUpload`, for a caller that must "+"not go through UTF-8","Studio can only read a project file as text, so any surface that must decode one stays hidden."),documentRaw:n("GET","/__studio/raw/","A project file as its own bytes, at its own URL — the mount a canvas renders against when "+"the editor origin does not serve the site's URL space. The project-relative path is appended to this prefix","The canvas cannot address project files by URL, so a host whose origin does not serve the site URL space renders no component $refs and no images."),fileRename:n("POST","/__studio/file/rename","Rename/move (+ refactor report). `from`/`to` are server-root-relative; every path in the "+"report is relative to the active project (specs/server.md §4.1)"),references:n("GET","/__studio/references","Where a file or a component tag is used (?path=&tag=, at least one) → ReferencesResult "+"{files, filesReferencing, refsTotal} — the read side of the rename refactor's own walker, "+"cached until the backend's watcher sees the tree move (backs findReferences). `?path=` is server-root-relative and every path in the answer is relative to the active project; a "+"target outside that project is a 400, never a zero-result 200 (specs/server.md §4.1)",'Usage counts are hidden: no "Used on N pages" in the inspector, no Selection: Find Usages, and delete/rename confirmations state no reference count.'),locate:n("POST","/__studio/locate","Find a file by name → {path | null}"),collab:n("GET","/__studio/collab","Realtime co-editing: a WebSocket upgrade speaking the @jxsuite/collab wire envelope (one socket per project, documents multiplexed by path; y-protocols sync + project-level "+"awareness in lib0 binary frames — see @jxsuite/collab/envelope for the frame layout and "+"the docEpoch/doc-reset lifecycle). A plain GET (no Upgrade) answers {collab, protocols, version} as the capability probe, and `protocols` is the subprotocol negotiation: the client offers one of them as Sec-WebSocket-Protocol and the server echoes it, or the "+"client offers none when the server advertises none, because RFC 6455 §4.1 fails a "+"connection whose offer went unechoed.","Realtime co-editing is unavailable; Studio edits solo with file-level saves"),components:n("GET","/__studio/components","Discover components (ComponentMeta[])"),cem:n("GET","/__studio/cem","Custom-elements manifest of an npm dependency","Dependency components lose prop/slot metadata."),formats:n("GET","/__studio/formats","The project's format registry entries plus a sibling `extensions` array — per enabled "+"extension its manifest identity and project-section contributions (ExtensionsInfo[]; backs listFormats and listExtensions).","Only .json documents open (backs listFormats); descriptor-contributed settings sections do not appear."),extensionCatalog:n("GET","/__studio/catalog","Extensions this backend can OFFER (ExtensionCatalogEntry[]) — the shipped first-party "+"catalogue plus any package in the project's own dependencies exporting a jx-extension.json, each marked with whether the host resolves it without a project install and whether the project has it installed. A capability rather than a constant: a Worker ships a fixed set "+"of extension packages (specs/extensions.md §5.5). Backs listExtensionCatalog.","The Extensions section offers no catalogue; adding an extension stays a typed package name."),projectSchemas:n("GET","/__studio/project-schemas","The project's generated entry documents (project.schema.json / document.schema.json), "+"PRE-BUNDLED into self-contained schemas — {project, document} (backs fetchProjectSchemas). "+"Regenerated on demand when missing or older than project.json.","The JSON editor falls back to the bundled core schemas (extension sections get no editor validation/completion)."),format:n("POST","/__studio/format","Dispatch a format capability {format, action: parse|serialize, source?|doc?}","Non-JSON documents cannot be parsed/serialized (backs formatAction)."),pluginSchema:n("GET","/__studio/plugin-schema","Extract a $studio schema from a class source","Plugin property panels fall back to generic JSON editing."),codeFormat:n("POST","/__studio/code/format","Format posted source {code, path?} → {code, errors}","Code editors skip format-on-open/save (codeService returns null)."),codeMinify:n("POST","/__studio/code/minify","Minify posted source {code} → {code}","Compiled-output minification is skipped."),codeLint:n("POST","/__studio/code/lint","Lint posted source {code, path?} → {diagnostics}","Code editors show no lint markers."),buildSite:n("POST","/__studio/build","Build or render the site → {routes, files, errors, mode?, url}","Build Site reports that this target cannot build."),previewSite:n("POST","/__studio/preview","Preview the working tree at a route → {routes, files, errors, mode, url, reused}","Open in Browser falls back to buildSite."),previewOverlay:n("POST","/__studio/preview/overlay","Publish (POST) or retract (DELETE) a document's unsaved bytes → 204","A live preview shows the last saved state instead of the editor's."),packages:n("GET","/__studio/packages","List dependencies (PackageInfo[])"),packagesAdd:n("POST","/__studio/packages/add","Add a dependency"),packagesRemove:n("POST","/__studio/packages/remove","Remove a dependency"),packagesInstall:n("POST","/__studio/packages/install","Run the package manager install","Install/reinstall affordances are hidden; manifest-only edits still work."),packagesNeedsInstall:n("GET","/__studio/packages/needs-install","Whether node_modules is stale","The install-on-open prompt never shows."),packagesVersions:n("GET","/__studio/packages/versions","Newest published version of each dependency (PackageVersionInfo[])","The Latest column stays empty and the update affordances are hidden."),packagesSetVersions:n("POST","/__studio/packages/set-versions","Rewrite dependency ranges and install","Bulk version updates are hidden."),gitStatus:n("GET","/__studio/git/status","Working-tree status (GitStatusResult)"),gitBranches:n("GET","/__studio/git/branches","Branch list (GitBranchesResult)"),gitLog:n("GET","/__studio/git/log","Recent commits (GitLogEntry[])"),gitStage:n("POST","/__studio/git/stage","Stage files"),gitUnstage:n("POST","/__studio/git/unstage","Unstage files"),gitCommit:n("POST","/__studio/git/commit","Commit staged (else all dirty) files"),gitPush:n("POST","/__studio/git/push","Push (cloud: sync check — commits land on push)"),gitPull:n("POST","/__studio/git/pull","Pull/fast-forward; 409 {conflicts} on overlap"),gitFetch:n("POST","/__studio/git/fetch","Refresh remote tracking state"),gitCheckout:n("POST","/__studio/git/checkout","Switch branches"),gitCreateBranch:n("POST","/__studio/git/create-branch","Create a branch"),gitDiff:n("GET","/__studio/git/diff","Unified diff of dirty files (or one path)"),gitShow:n("GET","/__studio/git/show","File content at a ref"),gitDiscard:n("POST","/__studio/git/discard","Discard working changes"),gitInit:n("POST","/__studio/git/init","Initialize a repository"),gitAddRemote:n("POST","/__studio/git/add-remote","Add a remote"),gitClone:n("POST","/__studio/git/clone","Clone a repository","The welcome screen hides Clone Git Repository."),gitPr:n("POST","/__studio/git/pr","Open a pull request → PullRequestInfo","Studio falls back to a direct GitHub API call with the user's token."),dataConnections:n("GET","/__studio/data/connections","Connector connections with configured/missingSecrets/isDefault state, reachable table names, and registry-descriptor provider metadata (DataConnectionsResponse; backs dataConnections)","The connections settings section shows no status, and data-domain actions stay hidden."),dataConnectionTest:n("POST","/__studio/data/connections/test","Probe a connection {connection} → DataConnectionTestResult (backs dataConnectionTest)","The Test Connection action is hidden."),dataPush:n("POST","/__studio/data/push","Additive schema push {connection?, dryRun?} → DataPushResult (plan of DataPushStep[], "+"applied, warnings/errors; backs dataPush)","The Push Schema action is hidden; schemas deploy via `jx db push` instead."),dataRows:n("GET","/__studio/data/rows","Page a table (DataRowsQuery params) → DataRowsResult {rows, total, columns} (backs dataRows)","The data grid is unavailable."),dataInsertRow:n("POST","/__studio/data/rows","Insert a row {table, connection?, values} → {row} (backs dataInsertRow)","The data grid hides its add-row footer."),dataUpdateRow:n("PUT","/__studio/data/rows","Update a row keyed on its primary key {table, connection?, pk, set} → {row} (backs "+"dataUpdateRow)","Data grid cells are read-only."),dataDeleteRow:n("DELETE","/__studio/data/rows","Delete a row (?table=&pk=&connection=) → {ok} (backs dataDeleteRow)","The data grid hides row deletion."),secretsList:n("GET","/__studio/secrets","Configured secret env-var NAMES, never values (SecretsListResponse; backs listSecrets)","Secret fields cannot show set/unset state."),secretsSet:n("PUT","/__studio/secrets","Write/remove secrets in the backend store (.dev.vars locally) {set?, remove?} → names "+"(backs setSecrets)","The secret form control renders disabled; secrets are edited in .dev.vars by hand."),aiChat:n("POST","/__studio/ai/chat","StreamEvent SSE chat proxy {messages, tools, systemPrompt, model}"),aiModels:n("GET","/__studio/ai/models","Model catalogue (AiModelsResponse)"),cfProxy:n("POST","/__studio/cf/proxy","Allowlisted Cloudflare API passthrough {path, method?, body?} (backs cfApi)","The Publish panel explains the git-push publishing path instead.")};var B1=200;var K=new Set(["reload","repeat","none"]);function $u(e){if(!Array.isArray(e))return[];return e.flatMap((t)=>{let o=t;if(!o||typeof o.id!=="string"||!o.id||typeof o.label!=="string"||!o.label)return[];return[{id:o.id,label:o.label,...typeof o.href==="string"&&o.href?{href:o.href}:{},...o.primary===!0?{primary:!0}:{}}]})}function qw(e){return typeof e==="string"&&K.has(e)?e:void 0}function H(e){return e.replaceAll("_","-")}function x(e){if(!e||typeof e!=="object")return{};let{actions:t,code:o,heading:r,installUrl:c,retry:m,type:u}=e,f=qw(m),i=tm(u)??(typeof o==="string"?H(o):null);return{...i===null?{}:{code:i},...typeof c==="string"?{installUrl:c}:{},...t===void 0?{}:{actions:$u(t)},...typeof r==="string"&&r?{heading:r}:{},...f===void 0?{}:{retry:f}}}function dT(e){let t=x(e);return t.code==="needs-installation-access"&&t.installUrl?t.installUrl:null}function uT(e){return x(e).code==="action-required"}function vc(){return Lr(_t.aiOpenAiKey)}function hT(e){Ur(_t.aiOpenAiKey,e||"")}function Eb(){return mL(_t.aiOpenAiKey)}function da(){return Lr(_t.aiBaseUrl)}function Tb(){return Lr(_t.aiModel)}function pT(e){Ur(_t.aiModel,e||"")}function fT(e){bL([[_t.aiOpenAiKey,e.apiKey],[_t.aiBaseUrl,e.baseUrl],[_t.aiModel,e.model]])}function mT(e){return!sp(_t.aiOpenAiKey,e.apiKey,vc())||!sp(_t.aiBaseUrl,e.baseUrl,da())||!sp(_t.aiModel,e.model,Tb())}function sp(e,t,o){return tv(e,t)===tv(e,o)}function gT(){ju([_t.aiOpenAiKey,_t.aiBaseUrl,_t.aiModel])}function Gw(){return{apiKey:vc(),baseUrl:da()}}function N(e){return`${e.apiKey}\x00${e.baseUrl}`}var g=null,R="",A=!1,_=!1,k="",T,v="",E=null,O=null,U=new Set,W=600000,b=0,L=!1;function Tr(){g=null,R="",A=!1,_=!1,k="",T=void 0,v="",E=null,O=null,b=0}var z=new Set([_t.aiOpenAiKey.key,_t.aiBaseUrl.key,_t.cfToken.key,_t.cfAccountId.key]);ev((e)=>{if(e.some((t)=>z.has(t)))Tr()});function z1(e){return g&&R===N(e)?g:null}function B(e){return g?.find((t)=>t.id===e)}function W1(e){return B(e)?.toolSupport}function bT(e){return B(e)?.contextWindow}function Lb(e){if(e)U.add(e);O??=bd({force:!0}).catch(()=>{}).then(()=>{b=Date.now();for(let t of U)t()})}function V(){if(!_||b===0||Date.now()-b<W)return!1;return O=null,b=0,Lb(),!0}function J(){if(typeof window>"u"||L)return;L=!0,window.addEventListener("focus",()=>{V()})}J();function nm(){return Eb()||Kw()}function Kw(){return A}function vT(){return _}function ap(){return T}function yT(){return v}function Jw(){return E}function Y(){return k}function Ba(){return Tb()||Y()||_t.aiModel.default}function X(e,t){let o;try{o=new URL(e,"http://jx.invalid")}catch{return e}return o.pathname=o.pathname.replace(/[^/]*$/,t),/^https?:/i.test(e)?o.href:`${o.pathname}${o.search}`}async function bd(e={}){let t=e.credentials??Gw(),o=N(t);if(g&&R===o&&!e.force)return g;let r=p(),c=await Promise.resolve(r.aiChatUrl()),m=X(c,"models"),u={};if(t.apiKey)u["X-Api-Key"]=t.apiKey;if(t.baseUrl)u["X-Api-Base-URL"]=t.baseUrl;let f=await fetch(m,{headers:u});if(!f.ok)throw Error(`HTTP ${f.status}`);let i=await f.json();return A=i.configured===!0,_=i.managed===!0,k=i.defaultModel??"",T=i.code,v=i.upstreamError!==void 0?i.upstreamMessage??"":"",E=i.code==="action_required"?{actions:$u(i.actions),...typeof i.detail==="string"&&i.detail?{detail:i.detail}:{}}:null,g=(i.models||[]).map((l)=>{let h={id:l.id,name:l.name||l.id};if(typeof l.contextWindow==="number")h.contextWindow=l.contextWindow;if(typeof l.toolSupport==="boolean")h.toolSupport=l.toolSupport;return h}),R=o,g}var w=new Set,C=null;function wT(e){if(w.size===0){C=e;return}for(let t of w)t(e)}function G(e){w.add(e);let t=C;if(C=null,t)e(t);return()=>{w.delete(e)}}function Yw(){return We()&&typeof p().performAction==="function"}function V1(e){let t=e.find((r)=>r.primary)??e[0];if(!t)return null;let o=e.find((r)=>r!==t);return o?{lead:t,other:o}:{lead:t}}var P=null,q=!1;function Zw(e){let t=V1(e.actions);if(!Yw()||!t)return Promise.resolve(!1);return P??=Q(e,t).finally(()=>{P=null}),P}async function lp(e){let t=x(e);if(t.code!=="action-required"||!t.actions?.length)return!1;return Zw({actions:t.actions,detail:e instanceof Error?e.message:void 0,heading:t.heading,retry:t.retry})}async function F(){Tr(),await bc(),U1()}function Q(e,t){let o=e.detail??"This needs one more step first.";return new Promise((r)=>{let c="offer",m=(y)=>{if(c==="done")return;c="done",h.close(),r(y)},u=(y)=>{c="offer",h.update({cancelLabel:"Not now",confirmLabel:t.lead.label,message:y,secondaryLabel:t.other?.label??""})},f=(y)=>{if(c!=="offer")return;c="waiting";let D;try{D=p().performAction(y)}catch(d){u(d instanceof Error?d.message:String(d));return}h.update({cancelLabel:"Cancel",confirmLabel:"Waiting…",message:"Finish in the window that opened. This closes by itself once it is done.",secondaryLabel:""}),D.then(async(d)=>{if(d?.status==="done"){await F(),m(!0);return}if(c!=="waiting"||!d||d.status==="redirect")return;bc(),u(o)},(d)=>{if(c==="waiting")u(d instanceof Error?d.message:String(d))})},{lead:i,other:l}=t,h=bs({cancelLabel:"Not now",confirmLabel:i.label,headline:e.heading??"One more step",layer:Ct("dialog"),message:o,onCancel:()=>{q=!0,m(!1)},onClosed:()=>{m(!1)},onConfirm:()=>{f(i)},region:"account/action",...l?{onSecondary:()=>{f(l)},secondaryLabel:l.label}:{}})})}function Z(e){if(e==="reload")location.reload();else if(e==="repeat")S.info("Done. Run that again now.",{key:"account.action.retry",source:"Account"})}function xT(){return G((e)=>{if(q||P)return;Zw(e).then((t)=>{if(t)Z(e.retry)})})}async function Ib(e){if(!Yw())return!1;let t=p().performAction(e),o;try{o=await t}catch(r){return S.error(r instanceof Error?r.message:String(r),{key:"account.action",source:"Account",tier:"toast"}),!1}if(o?.status==="done")return await F(),!0;if(o?.status!=="redirect")await bc();return!1}function U1(){for(let e of I()){let t={key:`account.notice.${e.id}`,source:"Account"};if(e.level==="warning")S.warn(e.message,t);else S.info(e.message,t)}}
|
|
2
|
-
export{bc,Ww,Vw,
|
|
1
|
+
import{p,We}from"./studio-y7jehjrp.js";import{_t,Lr,aL,Xb,Qb,qr,cL,Hu}from"./studio-semd1s8s.js";import{k}from"./studio-fqq890ap.js";import{bs,Ct}from"./studio-spf2skgc.js";var s=null;async function bc(){if(!We()||typeof p().getAccountStatus!=="function"){s=null;return}try{s=await p().getAccountStatus?.()??null}catch{s=null}}function Ww(){return s}function Vw(){return s!==null&&s.installations.length===0&&Boolean(s.appInstallUrl)}function eT(){if(s===null)return null;let e=s.installations.flatMap((t)=>t.manageUrl?[{account:t.account??`Installation ${t.id}`,url:t.manageUrl}]:[]);if(e.length===0&&!s.appInstallUrl)return null;return{manage:e,...s.appInstallUrl?{installUrl:s.appInstallUrl}:{}}}function tT(){return s?.entries??[]}function F1(){return(s?.notices??[]).filter((e)=>e.display!=="toast")}var j=new Set;function I(){let e=(s?.notices??[]).filter((t)=>t.display==="toast"&&!j.has(t.id));for(let t of e)j.add(t.id);return e}var M="https://jxsuite.com/problems/";function Xf(e){if(typeof e!=="string"||!e.startsWith("https://jxsuite.com/problems/"))return null;let t=e.slice(29);return t===""?null:t}function Ro(e){if(typeof e==="string")return e.trim()===""?null:e;if(!e||typeof e!=="object")return null;let t=e;for(let o of[t.detail,t.error,t.title])if(typeof o==="string"&&o.trim()!=="")return o;return null}function Fs(e,t){return Ro(e)??(t===void 0?"Request failed":`Request failed (${t})`)}var a=(e,t,o,r)=>({status:t,title:o,type:`${M}${e}`,...r===void 0?{}:{extensions:r}}),re={invalidRequest:a("invalid-request",400,"The request was malformed or incomplete"),notFound:a("not-found",404,"The requested resource does not exist"),methodNotAllowed:a("method-not-allowed",405,"That method is not allowed on this route"),conflict:a("conflict",409,"The request conflicts with the current state",["conflicts"]),payloadTooLarge:a("payload-too-large",413,"The request body is too large"),unauthorized:a("unauthorized",401,"Credentials are missing or not accepted"),forbidden:a("forbidden",403,"The request was refused"),needsInstallationAccess:a("needs-installation-access",403,"The GitHub App is not installed for that account",["installUrl"]),pathOutsideProject:a("path-outside-project",403,"The path resolves outside the active project"),actionRequired:a("action-required",403,"An action is required first",["actions","heading","retry"]),noActiveProject:a("no-active-project",409,"No project is active on this backend"),capabilityUnavailable:a("capability-unavailable",501,"This backend does not provide that capability"),upstreamFailure:a("upstream-failure",502,"An upstream service failed",["upstream"]),internalError:a("internal-error",500,"The backend failed to complete the request")};var Uw=".jx-loc-id",n=(e,t,o,r)=>({method:e,path:t,optional:r!==void 0,summary:o,...r===void 0?{}:{degradation:r}}),se={activate:n("POST","/__studio/activate","Bind the backend to a project root"),project:n("GET","/__studio/project","Root project metadata {name, root}"),projectInfo:n("GET","/__studio/project-info","Probe a directory: {isSiteProject, projectConfig?, directories?}"),resolveSite:n("GET","/__studio/resolve-site","Resolve the owning site of a file path {sitePath, projectConfig?, fileRelPath?}"),sites:n("GET","/__studio/sites","Enumerate site projects [{config, path}] (backs listProjects)","The welcome screen's Projects catalogue stays hidden."),findProject:n("GET","/__studio/find-project","Locate a project directory by name outside the root","openProject falls back to config-matching only."),locateDirectory:n("GET","/__studio/locate-directory","Resolve the absolute path of a showDirectoryPicker() folder by the id in its .jx-loc-id","Browse… reports that the folder could not be placed; the Location is typed by hand."),createProject:n("POST","/__studio/create-project","Scaffold a project at a caller-chosen destination → {root, config}"),starters:n("GET","/__studio/starters","Starter templates (StarterInfo[])","The New Project picker offers only blank/templates."),importSite:n("POST","/__studio/import-site","Clone a live website into a project; streams NDJSON progress","The New Project Import tab is unavailable."),files:n("GET","/__studio/files","List a directory (DirEntry[]) in stable path order; an entry may carry an opaque content `version` the backend vouches for; with ?glob=<pattern>, search matching files project-wide"),fileRead:n("GET","/__studio/file","Read a file's text content"),filesRead:n("POST","/__studio/files/read","Read many files' text content {paths} → ReadFilesResult {files: [path, {content} | "+"{error: {status, code?, message}}][], omitted}. At most READ_FILES_MAX_PATHS (200) paths and a backend byte budget per call: the excess is listed in `omitted` (never a 400) and the first path is always answered. Per-path errors: 404 missing/deleted, 415 binary, 413 too large, 502 upstream. Allowed for read-only sessions; keeps fileRead's server-side effects","Adapters fall back to one fileRead per path."),fileWrite:n("PUT","/__studio/file","Write a file's text content"),fileDelete:n("DELETE","/__studio/file","Delete a file"),fileUpload:n("POST","/__studio/file/upload","Upload binary content to a path → UploadResult {path, size?}. `path` is the answer, not an "+"echo: a store that de-duplicates, suffixes, or normalizes names reports what it really wrote"),fileBytes:n("GET","/__studio/file/bytes","A project file's raw bytes, undecoded — the read side of `fileUpload`, for a caller that must "+"not go through UTF-8","Studio can only read a project file as text, so any surface that must decode one stays hidden."),documentRaw:n("GET","/__studio/raw/","A project file as its own bytes, at its own URL — the mount a canvas renders against when "+"the editor origin does not serve the site's URL space. The project-relative path is appended to this prefix","The canvas cannot address project files by URL, so a host whose origin does not serve the site URL space renders no component $refs and no images."),fileRename:n("POST","/__studio/file/rename","Rename/move (+ refactor report). `from`/`to` are server-root-relative; every path in the "+"report is relative to the active project (specs/server.md §4.1)"),references:n("GET","/__studio/references","Where a file or a component tag is used (?path=&tag=, at least one) → ReferencesResult "+"{files, filesReferencing, refsTotal} — the read side of the rename refactor's own walker, "+"cached until the backend's watcher sees the tree move (backs findReferences). `?path=` is server-root-relative and every path in the answer is relative to the active project; a "+"target outside that project is a 400, never a zero-result 200 (specs/server.md §4.1)",'Usage counts are hidden: no "Used on N pages" in the inspector, no Selection: Find Usages, and delete/rename confirmations state no reference count.'),locate:n("POST","/__studio/locate","Find a file by name → {path | null}"),collab:n("GET","/__studio/collab","Realtime co-editing: a WebSocket upgrade speaking the @jxsuite/collab wire envelope (one socket per project, documents multiplexed by path; y-protocols sync + project-level "+"awareness in lib0 binary frames — see @jxsuite/collab/envelope for the frame layout and "+"the docEpoch/doc-reset lifecycle). A plain GET (no Upgrade) answers {collab, protocols, version} as the capability probe, and `protocols` is the subprotocol negotiation: the client offers one of them as Sec-WebSocket-Protocol and the server echoes it, or the "+"client offers none when the server advertises none, because RFC 6455 §4.1 fails a "+"connection whose offer went unechoed.","Realtime co-editing is unavailable; Studio edits solo with file-level saves"),components:n("GET","/__studio/components","Discover components (ComponentMeta[])"),cem:n("GET","/__studio/cem","Custom-elements manifest of an npm dependency","Dependency components lose prop/slot metadata."),formats:n("GET","/__studio/formats","The project's format registry entries plus a sibling `extensions` array — per enabled "+"extension its manifest identity and project-section contributions (ExtensionsInfo[]; backs listFormats and listExtensions).","Only .json documents open (backs listFormats); descriptor-contributed settings sections do not appear."),extensionCatalog:n("GET","/__studio/catalog","Extensions this backend can OFFER (ExtensionCatalogEntry[]) — the shipped first-party "+"catalogue plus any package in the project's own dependencies exporting a jx-extension.json, each marked with whether the host resolves it without a project install and whether the project has it installed. A capability rather than a constant: a Worker ships a fixed set "+"of extension packages (specs/extensions.md §5.5). Backs listExtensionCatalog.","The Extensions section offers no catalogue; adding an extension stays a typed package name."),projectSchemas:n("GET","/__studio/project-schemas","The project's generated entry documents (project.schema.json / document.schema.json), "+"PRE-BUNDLED into self-contained schemas — {project, document} (backs fetchProjectSchemas). "+"Regenerated on demand when missing or older than project.json.","The JSON editor falls back to the bundled core schemas (extension sections get no editor validation/completion)."),format:n("POST","/__studio/format","Dispatch a format capability {format, action: parse|serialize, source?|doc?}","Non-JSON documents cannot be parsed/serialized (backs formatAction)."),pluginSchema:n("GET","/__studio/plugin-schema","Extract a $studio schema from a class source","Plugin property panels fall back to generic JSON editing."),codeFormat:n("POST","/__studio/code/format","Format posted source {code, path?} → {code, errors}","Code editors skip format-on-open/save (codeService returns null)."),codeMinify:n("POST","/__studio/code/minify","Minify posted source {code} → {code}","Compiled-output minification is skipped."),codeLint:n("POST","/__studio/code/lint","Lint posted source {code, path?} → {diagnostics}","Code editors show no lint markers."),buildSite:n("POST","/__studio/build","Build or render the site → {routes, files, errors, mode?, url}","Build Site reports that this target cannot build."),previewSite:n("POST","/__studio/preview","Preview the working tree at a route → {routes, files, errors, mode, url, reused}","Open in Browser falls back to buildSite."),previewOverlay:n("POST","/__studio/preview/overlay","Publish (POST) or retract (DELETE) a document's unsaved bytes → 204","A live preview shows the last saved state instead of the editor's."),packages:n("GET","/__studio/packages","List dependencies (PackageInfo[])"),packagesAdd:n("POST","/__studio/packages/add","Add a dependency"),packagesRemove:n("POST","/__studio/packages/remove","Remove a dependency"),packagesInstall:n("POST","/__studio/packages/install","Run the package manager install","Install/reinstall affordances are hidden; manifest-only edits still work."),packagesNeedsInstall:n("GET","/__studio/packages/needs-install","Whether node_modules is stale","The install-on-open prompt never shows."),packagesVersions:n("GET","/__studio/packages/versions","Newest published version of each dependency (PackageVersionInfo[])","The Latest column stays empty and the update affordances are hidden."),packagesSetVersions:n("POST","/__studio/packages/set-versions","Rewrite dependency ranges and install","Bulk version updates are hidden."),gitStatus:n("GET","/__studio/git/status","Working-tree status (GitStatusResult)"),gitBranches:n("GET","/__studio/git/branches","Branch list (GitBranchesResult)"),gitLog:n("GET","/__studio/git/log","Recent commits (GitLogEntry[])"),gitStage:n("POST","/__studio/git/stage","Stage files"),gitUnstage:n("POST","/__studio/git/unstage","Unstage files"),gitCommit:n("POST","/__studio/git/commit","Commit staged (else all dirty) files"),gitPush:n("POST","/__studio/git/push","Push (cloud: sync check — commits land on push)"),gitPull:n("POST","/__studio/git/pull","Pull/fast-forward; 409 {conflicts} on overlap"),gitFetch:n("POST","/__studio/git/fetch","Refresh remote tracking state"),gitCheckout:n("POST","/__studio/git/checkout","Switch branches"),gitCreateBranch:n("POST","/__studio/git/create-branch","Create a branch"),gitDiff:n("GET","/__studio/git/diff","Unified diff of dirty files (or one path)"),gitShow:n("GET","/__studio/git/show","File content at a ref"),gitDiscard:n("POST","/__studio/git/discard","Discard working changes"),gitInit:n("POST","/__studio/git/init","Initialize a repository"),gitAddRemote:n("POST","/__studio/git/add-remote","Add a remote"),gitClone:n("POST","/__studio/git/clone","Clone a repository","The welcome screen hides Clone Git Repository."),gitPr:n("POST","/__studio/git/pr","Open a pull request → PullRequestInfo","Studio falls back to a direct GitHub API call with the user's token."),dataConnections:n("GET","/__studio/data/connections","Connector connections with configured/missingSecrets/isDefault state, reachable table names, and registry-descriptor provider metadata (DataConnectionsResponse; backs dataConnections)","The connections settings section shows no status, and data-domain actions stay hidden."),dataConnectionTest:n("POST","/__studio/data/connections/test","Probe a connection {connection} → DataConnectionTestResult (backs dataConnectionTest)","The Test Connection action is hidden."),dataPush:n("POST","/__studio/data/push","Additive schema push {connection?, dryRun?} → DataPushResult (plan of DataPushStep[], "+"applied, warnings/errors; backs dataPush)","The Push Schema action is hidden; schemas deploy via `jx db push` instead."),dataRows:n("GET","/__studio/data/rows","Page a table (DataRowsQuery params) → DataRowsResult {rows, total, columns} (backs dataRows)","The data grid is unavailable."),dataInsertRow:n("POST","/__studio/data/rows","Insert a row {table, connection?, values} → {row} (backs dataInsertRow)","The data grid hides its add-row footer."),dataUpdateRow:n("PUT","/__studio/data/rows","Update a row keyed on its primary key {table, connection?, pk, set} → {row} (backs "+"dataUpdateRow)","Data grid cells are read-only."),dataDeleteRow:n("DELETE","/__studio/data/rows","Delete a row (?table=&pk=&connection=) → {ok} (backs dataDeleteRow)","The data grid hides row deletion."),secretsList:n("GET","/__studio/secrets","Configured secret env-var NAMES, never values (SecretsListResponse; backs listSecrets)","Secret fields cannot show set/unset state."),secretsSet:n("PUT","/__studio/secrets","Write/remove secrets in the backend store (.dev.vars locally) {set?, remove?} → names "+"(backs setSecrets)","The secret form control renders disabled; secrets are edited in .dev.vars by hand."),aiChat:n("POST","/__studio/ai/chat","StreamEvent SSE chat proxy {messages, tools, systemPrompt, model}"),aiModels:n("GET","/__studio/ai/models","Model catalogue (AiModelsResponse)"),cfProxy:n("POST","/__studio/cf/proxy","Allowlisted Cloudflare API passthrough {path, method?, body?} (backs cfApi)","The Publish panel explains the git-push publishing path instead.")};var j1=200;var K=new Set(["reload","repeat","none"]);function Du(e){if(!Array.isArray(e))return[];return e.flatMap((t)=>{let o=t;if(!o||typeof o.id!=="string"||!o.id||typeof o.label!=="string"||!o.label)return[];return[{id:o.id,label:o.label,...typeof o.href==="string"&&o.href?{href:o.href}:{},...o.primary===!0?{primary:!0}:{}}]})}function qw(e){return typeof e==="string"&&K.has(e)?e:void 0}function H(e){return e.replaceAll("_","-")}function x(e){if(!e||typeof e!=="object")return{};let{actions:t,code:o,heading:r,installUrl:c,retry:m,type:u}=e,f=qw(m),i=Xf(u)??(typeof o==="string"?H(o):null);return{...i===null?{}:{code:i},...typeof c==="string"?{installUrl:c}:{},...t===void 0?{}:{actions:Du(t)},...typeof r==="string"&&r?{heading:r}:{},...f===void 0?{}:{retry:f}}}function nT(e){let t=x(e);return t.code==="needs-installation-access"&&t.installUrl?t.installUrl:null}function iT(e){return x(e).code==="action-required"}function vc(){return Lr(_t.aiOpenAiKey)}function oT(e){qr(_t.aiOpenAiKey,e||"")}function kb(){return aL(_t.aiOpenAiKey)}function da(){return Lr(_t.aiBaseUrl)}function Sb(){return Lr(_t.aiModel)}function rT(e){qr(_t.aiModel,e||"")}function sT(e){cL([[_t.aiOpenAiKey,e.apiKey],[_t.aiBaseUrl,e.baseUrl],[_t.aiModel,e.model]])}function aT(e){return!sp(_t.aiOpenAiKey,e.apiKey,vc())||!sp(_t.aiBaseUrl,e.baseUrl,da())||!sp(_t.aiModel,e.model,Sb())}function sp(e,t,o){return Qb(e,t)===Qb(e,o)}function lT(){Hu([_t.aiOpenAiKey,_t.aiBaseUrl,_t.aiModel])}function Gw(){return{apiKey:vc(),baseUrl:da()}}function N(e){return`${e.apiKey}\x00${e.baseUrl}`}var g=null,R="",P=!1,_=!1,A="",T,v="",E=null,O=null,U=new Set,W=600000,b=0,L=!1;function Tr(){g=null,R="",P=!1,_=!1,A="",T=void 0,v="",E=null,O=null,b=0}var z=new Set([_t.aiOpenAiKey.key,_t.aiBaseUrl.key,_t.cfToken.key,_t.cfAccountId.key]);Xb((e)=>{if(e.some((t)=>z.has(t)))Tr()});function H1(e){return g&&R===N(e)?g:null}function B(e){return g?.find((t)=>t.id===e)}function B1(e){return B(e)?.toolSupport}function cT(e){return B(e)?.contextWindow}function Eb(e){if(e)U.add(e);O??=bd({force:!0}).catch(()=>{}).then(()=>{b=Date.now();for(let t of U)t()})}function V(){if(!_||b===0||Date.now()-b<W)return!1;return O=null,b=0,Eb(),!0}function J(){if(typeof window>"u"||L)return;L=!0,window.addEventListener("focus",()=>{V()})}J();function Qf(){return kb()||Kw()}function Kw(){return P}function dT(){return _}function ap(){return T}function uT(){return v}function Jw(){return E}function Y(){return A}function Ba(){return Sb()||Y()||_t.aiModel.default}function X(e,t){let o;try{o=new URL(e,"http://jx.invalid")}catch{return e}return o.pathname=o.pathname.replace(/[^/]*$/,t),/^https?:/i.test(e)?o.href:`${o.pathname}${o.search}`}async function bd(e={}){let t=e.credentials??Gw(),o=N(t);if(g&&R===o&&!e.force)return g;let r=p(),c=await Promise.resolve(r.aiChatUrl()),m=X(c,"models"),u={};if(t.apiKey)u["X-Api-Key"]=t.apiKey;if(t.baseUrl)u["X-Api-Base-URL"]=t.baseUrl;let f=await fetch(m,{headers:u});if(!f.ok)throw Error(`HTTP ${f.status}`);let i=await f.json();return P=i.configured===!0,_=i.managed===!0,A=i.defaultModel??"",T=i.code,v=i.upstreamError!==void 0?i.upstreamMessage??"":"",E=i.code==="action_required"?{actions:Du(i.actions),...typeof i.detail==="string"&&i.detail?{detail:i.detail}:{}}:null,g=(i.models||[]).map((l)=>{let h={id:l.id,name:l.name||l.id};if(typeof l.contextWindow==="number")h.contextWindow=l.contextWindow;if(typeof l.toolSupport==="boolean")h.toolSupport=l.toolSupport;return h}),R=o,g}var S=new Set,C=null;function hT(e){if(S.size===0){C=e;return}for(let t of S)t(e)}function G(e){S.add(e);let t=C;if(C=null,t)e(t);return()=>{S.delete(e)}}function Yw(){return We()&&typeof p().performAction==="function"}function z1(e){let t=e.find((r)=>r.primary)??e[0];if(!t)return null;let o=e.find((r)=>r!==t);return o?{lead:t,other:o}:{lead:t}}var w=null,q=!1;function Zw(e){let t=z1(e.actions);if(!Yw()||!t)return Promise.resolve(!1);return w??=Q(e,t).finally(()=>{w=null}),w}async function lp(e){let t=x(e);if(t.code!=="action-required"||!t.actions?.length)return!1;return Zw({actions:t.actions,detail:e instanceof Error?e.message:void 0,heading:t.heading,retry:t.retry})}async function F(){Tr(),await bc(),W1()}function Q(e,t){let o=e.detail??"This needs one more step first.";return new Promise((r)=>{let c="offer",m=(y)=>{if(c==="done")return;c="done",h.close(),r(y)},u=(y)=>{c="offer",h.update({cancelLabel:"Not now",confirmLabel:t.lead.label,message:y,secondaryLabel:t.other?.label??""})},f=(y)=>{if(c!=="offer")return;c="waiting";let D;try{D=p().performAction(y)}catch(d){u(d instanceof Error?d.message:String(d));return}h.update({cancelLabel:"Cancel",confirmLabel:"Waiting…",message:"Finish in the window that opened. This closes by itself once it is done.",secondaryLabel:""}),D.then(async(d)=>{if(d?.status==="done"){await F(),m(!0);return}if(c!=="waiting"||!d||d.status==="redirect")return;bc(),u(o)},(d)=>{if(c==="waiting")u(d instanceof Error?d.message:String(d))})},{lead:i,other:l}=t,h=bs({cancelLabel:"Not now",confirmLabel:i.label,headline:e.heading??"One more step",layer:Ct("dialog"),message:o,onCancel:()=>{q=!0,m(!1)},onClosed:()=>{m(!1)},onConfirm:()=>{f(i)},region:"account/action",...l?{onSecondary:()=>{f(l)},secondaryLabel:l.label}:{}})})}function Z(e){if(e==="reload")location.reload();else if(e==="repeat")k.info("Done. Run that again now.",{key:"account.action.retry",source:"Account"})}function pT(){return G((e)=>{if(q||w)return;Zw(e).then((t)=>{if(t)Z(e.retry)})})}async function Tb(e){if(!Yw())return!1;let t=p().performAction(e),o;try{o=await t}catch(r){return k.error(r instanceof Error?r.message:String(r),{key:"account.action",source:"Account",tier:"toast"}),!1}if(o?.status==="done")return await F(),!0;if(o?.status!=="redirect")await bc();return!1}function W1(){for(let e of I()){let t={key:`account.notice.${e.id}`,source:"Account"};if(e.level==="warning")k.warn(e.message,t);else k.info(e.message,t)}}
|
|
2
|
+
export{bc,Ww,Vw,eT,tT,F1,Xf,Ro,Fs,Uw,j1,Du,qw,nT,iT,vc,oT,kb,da,Sb,rT,sT,aT,sp,lT,Gw,Tr,H1,B1,cT,Eb,Qf,Kw,dT,ap,uT,Jw,Ba,bd,hT,Yw,z1,Zw,lp,pT,Tb,W1};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
5
|
-
//# sourceMappingURL=studio-
|
|
4
|
+
//# debugId=4FD39BF317B161DD64756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-222rqyyc.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Mg,Os,Wy,Ur,Vy,as}from"./studio-c6zdm25z.js";var sS="meta",aS="frontmatter",lS="structure",cS="source",dS=2;function Xc(t){return t.getMap(sS)}function uS(t){return t.getMap(aS)}function _f(t){return t.getMap(lS)}function hS(t){return t.getText(cS)}function f(t){return JSON.parse(JSON.stringify(t))}function h(t){return typeof t==="object"&&t!==null&&!Array.isArray(t)}var y=new Set(["textContent"]),m=new Set(["style","attributes","$props"]);function g(t,e){let n=t.toString();if(n===e)return!1;let r=0,o=Math.min(n.length,e.length);while(r<o&&n[r]===e[r])r+=1;let i=n.length,a=e.length;while(i>r&&a>r&&n[i-1]===e[a-1])i-=1,a-=1;if(i>r)t.delete(r,i-r);if(a>r)t.insert(r,e.slice(r,a));return!0}function l(t){let e=new Ur;for(let[n,r]of Object.entries(t)){if(r===void 0)continue;e.set(n,h(r)?l(r):f(r))}return e}function Y(t,e){for(let n of[...t.keys()])if(!(n in e)||e[n]===void 0)t.delete(n);for(let[n,r]of Object.entries(e)){if(r===void 0)continue;let o=t.get(n);if(h(r))if(o instanceof Ur)Y(o,r);else t.set(n,l(r));else if(!b(o,r))t.set(n,f(r))}}function b(t,e){if(t===e)return!0;if(t instanceof Ur||t instanceof Os||t instanceof as)return!1;return JSON.stringify(t??null)===JSON.stringify(e??null)}function p(t){return typeof t==="string"?new as(t):pS(t)}function Wh(t){let e=new Os;return e.insert(0,t.map((n)=>p(n))),e}function pS(t){if(!h(t))throw TypeError("collab-schema: a document node must be a plain object");let e=new Ur;for(let[n,r]of Object.entries(t)){if(r===void 0)continue;if(n==="children"&&Array.isArray(r))e.set(n,Wh(r));else if(y.has(n)&&typeof r==="string")e.set(n,new as(r));else if(m.has(n)&&h(r))e.set(n,l(r));else e.set(n,f(r))}return e}function Qc(t){if(t instanceof Ur){let e={};for(let[n,r]of t.entries())e[n]=Qc(r);return e}if(t instanceof Os)return t.toArray().map((e)=>Qc(e));if(t instanceof as)return t.toString();return t}function PR(t){return Qc(_f(t))}function By(t,e){let n=_f(t);for(let r of e)if(n instanceof Ur)n=n.get(String(r));else if(n instanceof Os){let o=typeof r==="number"?r:Number(r);if(!Number.isInteger(o)||o<0||o>=n.length)return;n=n.get(o)}else return;return n}function m_(t,e,n){let r=hS(t);if(r.toString()===e)return!1;return t.transact(()=>{g(r,e)},n),!0}function FR(t,e,n={}){let r=Xc(t);if(r.get("structureSeeded")===!0)return!1;return t.transact(()=>{let o=_f(t);for(let[a,s]of Object.entries(e)){if(s===void 0)continue;if(a==="children"&&Array.isArray(s))o.set(a,Wh(s));else o.set(a,f(s))}let i=uS(t);for(let[a,s]of Object.entries(n.frontmatter??{}))if(s!==void 0)i.set(a,f(s));r.set("schemaVersion",dS),r.set("canonical","structure"),r.set("canonicalRev",0),r.set("sourceFormat",n.sourceFormat??null),r.set("structureSeeded",!0)},n.origin),!0}var jR="jx-local",HR="jx-mirror",BR="jx-seed";class ed extends Error{constructor(t){super(`collab-path-unresolved:${t.join("/")}`);this.name="CollabPathError"}}function w(t,e){let n=By(t,e);if(!(n instanceof Ur))throw new ed(e);return n}function d(t,e,n){let r=w(t,e),o=r.get("children");if(o instanceof Os)return o;if(n&&o===void 0){let i=new Os;return r.set("children",i),i}throw new ed([...e,"children"])}function R(t){return JSON.parse(JSON.stringify(t))}function P(t){return typeof t==="object"&&t!==null&&!Array.isArray(t)}function M(t,e,n){let r=t.get(e);if(e==="children"&&Array.isArray(n)){t.set(e,Wh(n));return}if(y.has(e)&&typeof n==="string"){if(r instanceof as)g(r,n);else t.set(e,new as(n));return}if(m.has(e)&&P(n)){if(r instanceof Ur)Y(r,n);else t.set(e,l(n));return}t.set(e,R(n))}function D(t,e){switch(e.op){case"set-key":{let n=w(t,e.path);if(e.value===void 0)n.delete(e.key);else M(n,e.key,e.value);return}case"insert-child":{let n=d(t,e.parentPath,!0);if(e.index<0||e.index>n.length)throw new ed([...e.parentPath,"children",e.index]);n.insert(e.index,[p(e.node)]);return}case"remove-child":{let n=d(t,e.parentPath,!1);if(e.index<0||e.index>=n.length)throw new ed([...e.parentPath,"children",e.index]);n.delete(e.index,1);return}case"set-child":{let n=d(t,e.parentPath,!1);if(e.index<0||e.index>=n.length)throw new ed([...e.parentPath,"children",e.index]);let r=n.get(e.index);if(r instanceof as&&typeof e.node==="string"){g(r,e.node);return}n.delete(e.index,1),n.insert(e.index,[p(e.node)]);return}case"move-child":{let n=d(t,e.fromParentPath,!1),r=d(t,e.toParentPath,!0);if(e.fromIndex<0||e.fromIndex>=n.length)throw new ed([...e.fromParentPath,"children",e.fromIndex]);let o=Qc(n.get(e.fromIndex));if(n.delete(e.fromIndex,1),e.toIndex<0||e.toIndex>r.length)throw new ed([...e.toParentPath,"children",e.toIndex]);r.insert(e.toIndex,[p(o)]);return}default:throw Error(`unknown-doc-op:${e.op}`)}}function zR(t,e,n){t.transact(()=>{for(let r of e)D(t,r)},n)}function C(t){for(let e=0;e<t.length;e++){let n=t[e];if(typeof n!=="string")continue;if(m.has(n))return{key:n,nodePath:t.slice(0,e)};if(y.has(n))return{key:n,nodePath:t.slice(0,e)}}return null}function J(t){return t.every((e)=>typeof e==="string"||typeof e==="number")}function WR(t){if(t.length===0)return[];let e=t.map((o)=>o.path);if(!e.every((o)=>J(o)))return null;for(let o=0;o<e.length;o++)for(let i=0;i<e.length;i++){if(o===i)continue;let a=e[o],s=e[i];if(a.length<=s.length&&a.every((c,u)=>c===s[u]))return null}if(t.filter((o)=>o instanceof Mg).length>1)return null;let r=[];for(let o of t){let i=o.path,a=C(i);if(a){let{doc:s}=o.target;if(!s)return null;let c=By(s,[...a.nodePath,a.key]);if(c===void 0)return null;r.push({key:a.key,op:"set-key",path:a.nodePath,value:Qc(c)});continue}if(o instanceof Vy){let s=i.at(-1);if(i.at(-2)==="children"&&typeof s==="number"){r.push({index:s,node:o.target.toString(),op:"set-child",parentPath:i.slice(0,-2)});continue}return null}if(o instanceof Wy){let s=o.target;for(let[c,u]of o.changes.keys)if(u.action==="delete")r.push({key:c,op:"set-key",path:i});else r.push({key:c,op:"set-key",path:i,value:Qc(s.get(c))})}else if(o instanceof Mg){if(i.at(-1)!=="children")return null;let s=i.slice(0,-1),c=0;for(let u of o.changes.delta)if(u.retain!==void 0)c+=u.retain;else if(u.delete!==void 0)for(let x=0;x<u.delete;x++)r.push({index:c,op:"remove-child",parentPath:s});else if(u.insert!==void 0){let x=Array.isArray(u.insert)?u.insert:[u.insert];for(let O of x)r.push({index:c,node:Qc(O),op:"insert-child",parentPath:s}),c+=1}}else return null}return r}function VR(t,e,n){t.transact(()=>{let r=_f(t),o=e,i=[...r.keys()];for(let s of i)if(!(s in o)||o[s]===void 0)r.delete(s);for(let[s,c]of Object.entries(o)){if(c===void 0)continue;if(s==="children"&&Array.isArray(c))r.set(s,Wh(c));else r.set(s,JSON.parse(JSON.stringify(c)))}let a=Xc(t);a.set("canonicalRev",Number(a.get("canonicalRev")??0)+1)},n)}function g_(t){return Xc(t).get("canonical")==="source"?"source":"structure"}function b_(t){return Number(Xc(t).get("canonicalRev")??0)}function UR(t,e,n){if(g_(t)==="source")return!1;return t.transact(()=>{m_(t,e,n);let r=Xc(t);r.set("canonical","source"),r.set("canonicalRev",b_(t)+1)},n),!0}function qR(t,e){if(g_(t)!=="source")return!1;return t.transact(()=>{let n=Xc(t);n.set("canonical","structure"),n.set("canonicalRev",b_(t)+1)},e),!0}function GR(t,e,n){let r=[];for(let[o,i]of t.getStates()){let a=i;if(o!==n&&a.mode==="source"&&a.focusedPath===e)r.push(o)}return r}function KR(t,e){let n=t.clientID,r=t.getStates().get(n);if(r?.mode!=="source"||r.focusedPath!==e)return!1;let o=n;for(let[i,a]of t.getStates()){let s=a;if(s.mode==="source"&&s.focusedPath===e&&s.canWrite!==!1&&i<o)o=i}return o===n}var v_=["#4f9cf9","#e5484d","#30a46c","#f5a524","#8e4ec6","#00a2c7","#e93d82","#a8845c"];function JR(t){let e=5381;for(let r=0;r<t.length;r++)e=Math.imul(e,33)+(t.codePointAt(r)??0);let n=Math.abs(e)%v_.length;return v_[n]}export{sS,aS,lS,cS,dS,Xc,uS,_f,hS,Wh,pS,Qc,PR,By,m_,FR,jR,HR,BR,ed,zR,WR,VR,g_,b_,UR,qR,GR,KR,v_,JR};
|
|
2
2
|
|
|
3
|
-
//# debugId=
|
|
4
|
-
//# sourceMappingURL=studio-
|
|
3
|
+
//# debugId=15ADD5B2190E687964756E2164756E21
|
|
4
|
+
//# sourceMappingURL=studio-4xppwncr.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{te}from"./studio-ery42sqr.js";import{v,
|
|
1
|
+
import{te}from"./studio-ery42sqr.js";import{v,k}from"./studio-fqq890ap.js";import{un,rn}from"./studio-0k9mvpgj.js";import{rt,zt,T,R,An,Ct}from"./studio-spf2skgc.js";var S={$schema:"https://jxsuite.com/schema/v1",$id:"StudioGithubAuth",$description:"The RFC 8628 device flow's waiting room: the code GitHub minted, the page to type it into, and a Cancel. A `jx-dialog`, so the platform owns modality, Escape, focus restoration and the backdrop — and it is the reason the dialog has no confirm button at all: the answer arrives from GitHub over a poll rather than from anything the reader can press here, so a primary button would be a control with nothing to do. Nothing in this document talks to GitHub: `github/github-auth.ts` keeps the client id, the poll loop, its failure budget and every report the three outcomes raise.",tagName:"jx-dialog",$props:{headline:"Sign in to GitHub",confirmLabel:"",cancelLabel:"Cancel",size:"sm"},attributes:{part:"github-auth"},oncancel:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/cancel"},value:[]}]},onclose:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},style:{$description:"Four `.github-auth-*` rules in `styles/overlays.css` become the parts below, and two things in them do not travel. `.github-auth-dialog`'s `padding: 16px 0` was the card's own body padding drawn by hand, and `jx-dialog` already pads its body; `.github-auth-dialog p { font-size: 13px }` was a body size this surface picked for itself, and what the paragraphs now inherit is the dialog's own `--jx-text-md`. The `8px 0` margins go with them — the column is a flex column with a gap, so a margin between two rows would be a second opinion about the same space. The code keeps its 24px, which is above the token scale on purpose: it is a string the reader has to copy onto another screen, and reading it out loud is the whole job of this dialog.",'& [part="device"]':{display:"flex",flexDirection:"column",alignItems:"center",gap:"var(--jx-space-3)",textAlign:"center"},'& [part="lede"], & [part="waiting"]':{margin:"0"},'& [part="code"]':{$description:"`<code>`, not a styled `<div>`: this is a literal string to be transcribed, and the element that says so is also the one a reader's own stylesheet and a screen reader's character-by-character mode already know about. It is this dialog's message, and the one string in it the reader must carry to another screen, so it opts back in to selection against the root's `user-select: none`. `all` rather than `text`: one click selects the whole code, so a copy never leaves a character behind.",userSelect:"all",fontFamily:"var(--font-mono)",fontSize:"24px",fontWeight:"700",letterSpacing:"2px",padding:"var(--jx-space-3) var(--jx-space-4)",background:"var(--hover-bg)",borderRadius:"var(--radius)"},'& [part="link"]':{$description:"The blue this carried as a `var(--accent, …)` fallback is gone: `--accent` is declared on `:root` in `styles/tokens.css`, so the fallback could only ever have painted when the token was missing — which is a theme fault to fix rather than a colour to hard-code.",color:"var(--accent)",textDecoration:"underline"},'& [part="waiting"]':{color:"var(--fg-dim)",fontStyle:"italic"}},children:[{tagName:"div",attributes:{part:"device"},children:[{tagName:"p",attributes:{part:"lede"},textContent:"Enter this code on GitHub to authorize Jx Studio:"},{tagName:"code",attributes:{part:"code"},textContent:"${state.userCode}"},{tagName:"a",attributes:{part:"link",href:"${state.verificationUri}",target:"_blank",rel:"noreferrer"},textContent:"Open ${state.verificationUri}"},{tagName:"p",attributes:{part:"waiting"},textContent:"Waiting for authorization…"}]}]};T("github-auth",S);function A(e){let t=document.createElement("div");t.style.pointerEvents="auto",t.setAttribute(rt,zt("dialog","github-auth")),e.layer.append(t);let r=!1,u=()=>{if(r)return;r=!0,e.onClosed()},f=v({cancel:()=>{e.onCancel()},closed:u,userCode:e.userCode,verificationUri:e.verificationUri}),s=null,c=R("github-auth",f,t).then(async(o)=>{s=o;let n=o.root;if(r)return o.dispose(),n;if(await An(n),r)return n;return un(n),n});return{close(){let o=s?.root;if(o instanceof HTMLElement)rn(o);s?.dispose(),s=null,t.remove(),u()},host:t,ready:c}}var _="jx_github_token";function p(){return globalThis.__jxPlatform?.githubAuth??null}var g=null,C=!1;function E(e){g=e}function h1(){return g!==null||C||localStorage.getItem("jx_github_token")!==null}function p1(){return p()?"desktop":"browser"}function b(){return g??localStorage.getItem("jx_github_token")}function f1(){g=null,C=!1,localStorage.removeItem("jx_github_token"),p()?.signOut().catch(()=>{})}var H="Ov23liYVlMFpgjOEPXJH",O="github.auth",j="Source Control",N="git.signInToGithub",U=3,M="The request never reached GitHub. GitHub's device-flow endpoints send no CORS headers, so a "+"browser cannot call them directly — the desktop app can. A machine that is offline fails "+"identically, and the browser does not say which happened.";function D(e){k.error("Could not reach GitHub to sign in.",{action:N,detail:`${M}
|
|
2
2
|
|
|
3
|
-
${te(e)}`,key:O,source:j})}function y(e,t){
|
|
4
|
-
export{p1,f1,
|
|
3
|
+
${te(e)}`,key:O,source:j})}function y(e,t){k.warn(e,{action:N,detail:t,key:O,source:j})}async function Y(){let e;try{e=await fetch("https://github.com/login/device/code",{body:JSON.stringify({client_id:H,scope:"repo"}),headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"})}catch(t){return D(t),null}if(!e.ok)return y("GitHub refused to start the sign-in.",`GitHub answered ${e.status}${e.statusText?` ${e.statusText}`:""}.`),null;return await e.json()}async function Cw(){let e=b();if(e)return e;let t=p();if(t)try{let{token:o}=await t.signIn();return E(o),o}catch(o){return y("GitHub sign-in was not completed.",te(o)),null}let r=await Y();if(!r)return null;let{device_code:u,user_code:f,verification_uri:s,interval:c=5}=r;return new Promise((o)=>{let n=!1,a=null,m=0,w=!1,I=(l)=>{if(w)return;if(w=!0,n=!0,a)clearTimeout(a),a=null;o(l)},x=!1,G=()=>{if(x)return;x=!0,L.close()},d=(l)=>{I(l),G()},h=async()=>{if(n)return;try{let i=await(await fetch("https://github.com/login/oauth/access_token",{body:JSON.stringify({client_id:H,device_code:u,grant_type:"urn:ietf:params:oauth:grant-type:device_code"}),headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"})).json();if(m=0,i.access_token){localStorage.setItem(_,i.access_token),d(i.access_token);return}if(i.error==="authorization_pending"){a=setTimeout(h,c*1000);return}if(i.error==="slow_down"){a=setTimeout(h,(c+5)*1000);return}y("GitHub sign-in was not completed.",i.error==="access_denied"?"The authorization was declined on GitHub.":i.error==="expired_token"?"The device code expired before it was entered.":`GitHub answered "${i.error??"an unrecognised response"}".`),d(null)}catch(l){if(m+=1,m>=U){D(l),d(null);return}a=setTimeout(h,c*1000)}},L=A({layer:Ct("dialog"),onCancel:()=>{G()},onClosed:()=>{d(null)},userCode:f,verificationUri:s});a=setTimeout(h,c*1000)})}
|
|
4
|
+
export{h1,p1,f1,Cw};
|
|
5
5
|
|
|
6
|
-
//# debugId=
|
|
7
|
-
//# sourceMappingURL=studio-
|
|
6
|
+
//# debugId=1B7FC845BC721E9264756E2164756E21
|
|
7
|
+
//# sourceMappingURL=studio-54g077x3.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import{v}from"./studio-
|
|
1
|
+
import{v}from"./studio-fqq890ap.js";import{$o,bL,ot,Jo,Se,He,qu,m,No,ci}from"./studio-cvbkkfqb.js";import{p}from"./studio-y7jehjrp.js";import{qt,Zt}from"./studio-1x8x26k3.js";import{T,R,bs,Ct}from"./studio-spf2skgc.js";import{te}from"./studio-ery42sqr.js";import{Ir}from"./studio-888knnkc.js";import{Ps,mc}from"./studio-9mqfamps.js";import{Fw,R1,$1}from"./studio-65fhspdd.js";import{Ld,Gi}from"./studio-c6w3tq7t.js";import{ds,Kf,vb,yb,Iu,Io,Ru}from"./studio-skzanb0k.js";import{D}from"./studio-tp642n5g.js";var I={$schema:"https://jxsuite.com/schema/v1",$id:"StudioGridOpen",$description:"Every grid-able source a project has, grouped by where it comes from: the project's own pages and content collections first, then each connection's tables. It is the ISLAND of a confirm dialog rather than a dialog of its own — `ui/layers.ts`'s dialog owns the headline, the cancel button, modality and focus, and this document is only the list — because a second answer to \"what is a dialog\" is a defect (studio-ui-guidelines.md §12.5). Group headings are why it is not the kit menu: a menu row can carry a divider above it and cannot carry a name for the run it opens.",tagName:"div",attributes:{part:"sources"},style:{display:"flex",flexDirection:"column",gap:"var(--jx-space-3)",minWidth:"280px",fontFamily:"var(--jx-font-sans)",fontSize:"var(--jx-text-md)",color:"var(--fg)",'& [part="group-title"]':{margin:"0",fontSize:"var(--jx-text-xs)",fontWeight:"600",textTransform:"uppercase",letterSpacing:"0.04em",color:"var(--fg-dim)"},'& [part="rows"]':{display:"flex",flexDirection:"column",gap:"1px",marginTop:"var(--jx-space-1)"},'& [part="source"]':{textAlign:"left",background:"none",border:"none",color:"var(--fg)",font:"inherit",padding:"var(--jx-space-2) var(--jx-space-2)",borderRadius:"var(--jx-radius-sm)",cursor:"pointer"},'& [part="source"]:hover':{background:"var(--bg-hover)"},'& [part="source"]:focus-visible':{outline:"var(--jx-focus-ring)",outlineOffset:"-2px"},'& [part="group-empty"]':{margin:"0",padding:"var(--jx-space-2)",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"}},children:[{$prototype:"Array",items:{$ref:"#/state/groups"},key:{$ref:"$map/item/key"},map:{$description:"One origin of grid-able sources. A connection with no tables says why it has none instead of drawing an empty box — an author who has not pushed a schema yet is exactly the reader who needs the sentence.",tagName:"section",attributes:{part:"group","data-group":"${$map.item.key}"},children:[{tagName:"h3",attributes:{part:"group-title"},textContent:"${$map.item.title}"},{tagName:"div",attributes:{part:"rows"},$switch:{$ref:"$map/item/state"},cases:{listed:{tagName:"div",attributes:{part:"rows-list",role:"none"},style:{display:"contents"},children:[{$prototype:"Array",items:{$ref:"$map/item/rows"},key:{$ref:"$map/item/id"},map:{tagName:"button",attributes:{part:"source",type:"button","data-source":"${$map.item.id}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/open"},value:[{$ref:"$map/item/id"}]}]},textContent:"${$map.item.label}"}}]},empty:{tagName:"p",attributes:{part:"group-empty"},textContent:"${$map.item.emptyMessage}"}}}]}}]};T("grid-open",I);function j(e,r,t){let n=v({groups:r,open:t}),o=null,i=!1,s=R("grid-open",n,e).then((l)=>{if(i)return l.dispose(),l.root;return o=l,l.root});return{dispose(){i=!0,o?.dispose(),o=null},ready:s}}function S(){try{return p()}catch{return null}}function Rw(){return typeof S()?.dataRows==="function"}async function E(){let e=S();if(typeof e?.dataConnections!=="function")return null;return e.dataConnections()}async function SE(e){let r=S();if(typeof r?.dataConnectionTest!=="function")return{error:"Connection tests are not supported by this backend",ok:!1};try{return await r.dataConnectionTest(e)}catch(t){return{error:t instanceof Error?t.message:String(t),ok:!1}}}async function _1(e){let r=S();if(typeof r?.dataPush!=="function")return{applied:!1,errors:["Schema push is not supported by this backend"],plan:[]};try{return await r.dataPush(e)}catch(t){return{applied:!1,errors:[t instanceof Error?t.message:String(t)],plan:[]}}}function C(e){let t=S()?.[e];if(t===void 0||t===null)throw Error(`The ${String(e)} surface is not supported by this backend`);return t}function x(e){return C("dataRows")(e)}function M(e){return C("dataInsertRow")(e)}function A(e){return C("dataUpdateRow")(e)}function K(e){return C("dataDeleteRow")(e)}function EE(e,r,t){let n=(s)=>s.replaceAll(/([a-z0-9])([A-Z])/g,"$1_$2").replaceAll(/[^A-Za-z0-9]+/g,"_").replaceAll(/^_+|_+$/g,"").toUpperCase(),i=[r??e,t.replace(/Env$/,"")].map((s)=>n(s)).filter(Boolean).join("_")||"SECRET";return/^\d/.test(i)?`JX_${i}`:i}function W(e){let r=[],t=[],n="",o=!1,i=!1,s=()=>{t.push(n),n="",i=!1},l=()=>{if(s(),t.length===1&&t[0]===""){t=[];return}r.push(t),t=[]};for(let a=0;a<e.length;a++){let c=e[a];if(o){if(c==='"')if(e[a+1]==='"')n+='"',a+=1;else o=!1;else n+=c;continue}if(c==='"'&&!i)o=!0,i=!0;else if(c==='"')n+=c;else if(c===",")s();else if(c===`
|
|
2
2
|
`)l();else if(c==="\r"){if(e[a+1]===`
|
|
3
|
-
`)a+=1;l()}else n+=c,i=!0}if(n!==""||t.length>0)l();return r}function
|
|
3
|
+
`)a+=1;l()}else n+=c,i=!0}if(n!==""||t.length>0)l();return r}function $w(e){let r=(e.match(/\r\n/g)??[]).length,t=(e.match(/(?<!\r)\n/g)??[]).length,n=r>t?`\r
|
|
4
4
|
`:`
|
|
5
5
|
`,o=e.endsWith(`
|
|
6
|
-
`),i=W(e),s=i[0]??[],l=i.slice(1),a=Math.max(s.length,...l.map((c)=>c.length),0);while(s.length<a)s.push("");for(let c of l)while(c.length<a)c.push("");return{eol:n,headers:s,rows:l,trailingNewline:o}}function U(e){if(/[",\n\r]/.test(e))return`"${e.replaceAll('"','""')}"`;return e}function k(e){return[e.headers,...e.rows].map((t)=>t.map((n)=>U(n)).join(",")).join(e.eol)+(e.trailingNewline?e.eol:"")}var Q=["id","sku","slug","Slug"];function q(e){let r=new Set;return e.map((t,n)=>{let o=t.trim()===""?`column${n+1}`:t;if(r.has(o))o=`${o}__${n+1}`;return r.add(o),o})}function J(e,r){for(let t of Q){let n=e.indexOf(t);if(n===-1)continue;let o=r.rows.map((i)=>i[n]??"");if(o.every((i)=>i!=="")&&new Set(o).size===o.length)return t}return null}function O(e,r){let t=Rw(e),n=q(t.headers),o=J(n,t),i=o?n.indexOf(o):-1,s=t.rows.map((d,u)=>i===-1?String(u):d[i]),l=new Map(s.map((d,u)=>[d,u])),a=qu(r,D?.projectConfig),c=a?.schema?.properties??{},y=t.rows.slice(0,50).map((d)=>{let u={};for(let[h,w]of n.entries())u[w]=d[h]??"";return u}),f=new Map(xb(y).map((d)=>[d.field,d])),m=new Map(wb(a?.schema,{idField:o??void 0}).map((d)=>[d.field,d]));return{columns:n.map((d,u)=>{let w=(d in c?m.get(d):void 0)??f.get(d)??{editable:!0,field:d,kind:"string",title:t.headers[u]||d};return{...w,pk:d===o,title:t.headers[u]?.trim()||w.title}}),doc:t,fields:n,keys:s,keyToIndex:l,loadText:e}}function X(e,r){let t={},n=e.doc.rows[r]??[];for(let[o,i]of e.fields.entries()){let s=e.columns[o],l=n[o]??"";t[i]=s.kind==="string"||s.kind==="text"||s.kind==="readonly"?l:Lu(l,s)}return t}function _(e,r){let t=e.doc.rows.map((i)=>[...i]),n=(i)=>e.fields.indexOf(i);for(let i of r.cells){let s=e.keyToIndex.get(i.rowKey),l=n(i.field);if(s===void 0||l===-1)continue;t[s][l]=Ro(i.value)}for(let i of r.inserts){let s=e.fields.map((l)=>Ro(i.cells[l]??null));t.push(s)}let o=r.deletes.map((i)=>e.keyToIndex.get(i.rowKey)).filter((i)=>i!==void 0).toSorted((i,s)=>s-i);for(let i of o)t.splice(i,1);return{...e.doc,rows:t}}function N(e,r){return{cells:e.cells.map((t)=>({field:t.field,rowKey:t.rowKey,...r})),deletes:e.deletes.map((t)=>({rowKey:t.rowKey,...r})),inserts:e.inserts.map((t)=>({error:r.error,ok:r.ok,tempKey:t.tempKey}))}}function $w(e){let r=null,t=(n=!1)=>{if(!n&&r)return r;return r=p().readFile(e).then((o)=>O(o,e)),r};return{backingPaths:()=>new Map([[e,"*"]]),capabilities:{delete:!0,insert:!0,remotePaging:!1,remoteSort:!1},async columns(){return(await t()).columns},async commit(n){let o=await t(),i=p(),s=null;try{s=await i.readFile(e)}catch{s=null}if(s!==o.loadText&&!mc(e))return N(n,{error:"File changed on disk — refresh to reload",ok:!1,stale:!0});let l=_(o,n),a=k(l);return Ms(e),await i.writeFile(e,a),r=Promise.resolve(O(a,e)),N(n,{ok:!0})},id:e,label:e.split("/").pop()??e,async refresh(){await t(!0)},async rows(){let n=await t(),o=n.doc.rows.map((i,s)=>({cells:X(n,s),key:n.keys[s]}));return{rows:o,total:o.length}},async serializeForSource(n){let o=await t();return k(_(o,n))}}}var Z=50;function ee(e){let r=e.toLowerCase();if(/(int|real|floa|doub|num|dec)/.test(r))return"number";if(r.includes("bool"))return"boolean";if(/(timestamp|datetime|date)/.test(r))return"date";return"string"}function re(e){return!e.pk&&e.name!=="created_at"&&e.name!=="updated_at"}function ne(e){if(e===null||e===void 0)return null;if(typeof e==="string"||typeof e==="number"||typeof e==="boolean")return e;return JSON.stringify(e)}function B(e,r){let t=[],n="id",o=new Map,i=(a)=>{if(a.length>0)t=a,n=a.find((c)=>c.pk)?.name??"id"},s=(a)=>({table:r,...e?{connection:e}:{},limit:a?.limit??Z,offset:a?.offset??0,...a?.orderBy?{dir:a.dir??"asc",orderBy:a.orderBy}:{}}),l=(a,c)=>{let y=a[n];if(typeof y==="string"||typeof y==="number")return o.set(String(y),y),String(y);return`row-${c}`};return{capabilities:{delete:!0,insert:!0,remotePaging:!0,remoteSort:!0},async columns(){if(t.length===0){let a=await x(s({limit:1,offset:0}));i(a.columns)}return t.map((a)=>{let c=re(a)?ee(a.type):"readonly";return{editable:c!=="readonly",field:a.name,kind:c,pk:a.pk===!0,title:a.name,widthHint:a.pk?80:void 0}})},async commit(a){let c={cells:[],deletes:[],inserts:[]},y=new Map;for(let f of a.cells){let m=y.get(f.rowKey)??[];m.push({field:f.field,value:f.value}),y.set(f.rowKey,m)}for(let[f,m]of y){let b=o.get(f),d=(u,h)=>{for(let w of m)c.cells.push({error:h,field:w.field,ok:u,rowKey:f})};if(b===void 0){d(!1,"Row has no primary key — refresh the grid");continue}try{let u={};for(let h of m)u[h.field]=h.value;await A({pk:b,set:u,table:r,...e?{connection:e}:{}}),d(!0)}catch(u){d(!1,u instanceof Error?u.message:String(u))}}for(let f of a.inserts)try{let m={};for(let[h,w]of Object.entries(f.cells))if(w!==null)m[h]=w;let{row:b}=await M({table:r,values:m,...e?{connection:e}:{}}),d=b[n],u=typeof d==="string"||typeof d==="number"?String(d):void 0;if(u!==void 0&&(typeof d==="string"||typeof d==="number"))o.set(u,d);c.inserts.push({newKey:u,ok:!0,tempKey:f.tempKey})}catch(m){c.inserts.push({error:m instanceof Error?m.message:String(m),ok:!1,tempKey:f.tempKey})}for(let f of a.deletes){let m=o.get(f.rowKey);if(m===void 0){c.deletes.push({error:"Row has no primary key — refresh the grid",ok:!1,rowKey:f.rowKey});continue}try{await K({pk:m,table:r,...e?{connection:e}:{}}),c.deletes.push({ok:!0,rowKey:f.rowKey})}catch(b){c.deletes.push({error:b instanceof Error?b.message:String(b),ok:!1,rowKey:f.rowKey})}}return c},id:ds({connection:e??"default",kind:"data",table:r}),label:r,async refresh(){t=[],o.clear()},async rows(a){let c=await x(s(a));return i(c.columns),{rows:c.rows.map((f,m)=>{let b=l(f,m),d={};for(let u of t)d[u.name]=ne(f[u.name]);return{cells:d,key:b}}),total:c.total}}}}var mb=[{key:"all",label:"All"},{dir:"pages",key:"pages",label:"Pages"},{dir:"layouts",key:"layouts",label:"Layouts"},{dir:"components",key:"components",label:"Components"},{dir:"content",key:"content",label:"Content"},{dir:"public",key:"media",label:"Media"}],S1=mb.map((e)=>e.key);function Dw(e){return mb.find((r)=>r.key===e)}function k1(e){return Dw(e)?.dir}function oe(e,r){if(r&&Ld.has(r))return"Media";if(e.startsWith("pages"))return"Pages";if(e.startsWith("layouts"))return"Layouts";if(e.startsWith("components"))return"Components";if(e.startsWith("content"))return"Content";if(e.startsWith("public"))return"Media";if(e.startsWith("data"))return"Content";if(e.startsWith("styles"))return"Components";return"Other"}function ie(e){let r=D?.projectConfig?.content??{};for(let[t,n]of Object.entries(r)){if(!n.source)continue;let o=n.source.replace(/^\.\//,"").replace(/\/$/,"");if(e.startsWith(`${o}/`)||e===o)return t.charAt(0).toUpperCase()+t.slice(1)}return null}var se=new Set(["node_modules",".git",".jx","dist","build",".cache"]);async function H(e,r,t,n,o){let i;try{i=await Ir(()=>r.listDirectory(e))}catch(l){n.push({dir:e,error:te(l)});return}let s=[];for(let l of i){if(l.type==="directory"){if(!se.has(l.name))s.push(l.path);continue}let a=Gi(l.name),c=oe(l.path,a);t.push({category:c,ext:a,locale:kL(l.path,o)??void 0,modified:l.modified,name:l.name,path:l.path,size:l.size,type:c==="Content"?ie(l.path)??a??"file":a||"file"})}await Promise.all(s.map((l)=>H(l,r,t,n,o)))}async function Gf(e,r){let t=[],n=[],{i18n:o}=Do(D?.projectConfig??{});return await Promise.all(e.map((i)=>H(i,r,t,n,o))),t.sort((i,s)=>i.path.localeCompare(s.path)),{failures:n,files:t}}function RE(e,r){let t=e,n=Dw(r.category);if(n&&n.key!=="all")t=t.filter((s)=>s.category===n.label);let o=r.query.trim().toLowerCase();if(o)t=t.filter((s)=>s.name.toLowerCase().includes(o)||s.path.toLowerCase().includes(o));let i=r.locale?.trim();if(i)t=t.filter((s)=>s.locale===i);return t}var Kf=["table","cards","media","calendar","board"],Aw={board:"Board",calendar:"Calendar",cards:"Cards",media:"Media",table:"Table"};var $E=new Set(["cards","media"]),ae=/^(\d{4}-\d{2}-\d{2})/;function le(e){let r=ae.exec(e.name);if(r)return r[1];if(e.modified){let t=new Date(e.modified);if(!Number.isNaN(t.getTime()))return t.toISOString().slice(0,10)}return null}function E1(){return Do(D?.projectConfig??{}).i18n?.locales??[]}function DE(e){let r=new Set;for(let t of e)if(t.locale)r.add(t.locale);return E1().filter((t)=>r.has(t))}function AE(e){let r=new Map,t=[];for(let o of e){let i=le(o);if(i===null){t.push(o);continue}let s=r.get(i);if(s)s.push(o);else r.set(i,[o])}return{days:[...r.entries()].map(([o,i])=>({date:o,files:i})).toSorted((o,i)=>i.date.localeCompare(o.date)),undated:t}}function NE(e){let r=new Map;for(let n of e){let o=r.get(n.category);if(o)o.push(n);else r.set(n.category,[n])}let t=mb.map((n)=>n.label);return[...r.entries()].map(([n,o])=>({files:o,group:n})).toSorted((n,o)=>{let i=t.indexOf(n.group),s=t.indexOf(o.group);if(i===s)return n.group.localeCompare(o.group);return(i===-1?t.length:i)-(s===-1?t.length:s)})}var G="The Library lists files; it does not edit them. Rename, duplicate or delete from the file's context menu, or open the file to edit it.";function Nw(){return[{editable:!1,field:"name",kind:"string",pk:!0,title:"Name",widthHint:260},{editable:!1,field:"category",kind:"string",title:"Category",widthHint:120},{editable:!1,field:"locale",kind:"string",title:"Locale",widthHint:90},{editable:!1,field:"type",kind:"string",title:"Type",widthHint:120},{editable:!1,field:"size",kind:"number",title:"Size",widthHint:90},{editable:!1,field:"modified",kind:"date",title:"Modified",widthHint:160},{editable:!1,field:"path",kind:"readonly",title:"Path",widthHint:320}]}function ce(e){return{cells:{category:e.category,locale:e.locale??null,modified:e.modified??null,name:e.name,path:e.path,size:e.size??null,type:e.type},key:e.path}}function L(){return ds({kind:"library"})}function OE(e){let r=null,t=null,n=e??(()=>D?.projectDirs??[]);async function o(){if(r)return r;return t??=Gf(n(),p()).then((i)=>(r=i,t=null,i)),t}return{capabilities:{delete:!1,insert:!1,remotePaging:!1,remoteSort:!1},columns:()=>Promise.resolve(Nw()),commit(i){return Promise.resolve({cells:i.cells.map((s)=>({error:G,field:s.field,ok:!1,rowKey:s.rowKey})),deletes:i.deletes.map((s)=>({error:G,ok:!1,rowKey:s.rowKey})),inserts:i.inserts.map((s)=>({error:G,ok:!1,tempKey:s.tempKey}))})},failures:()=>r?.failures??[],files:()=>r?.files??[],id:L(),label:"Library",async refresh(){r=null,t=null,await o()},async rows(){let i=await o();return{rows:i.files.map((s)=>ce(s)),total:i.files.length}},scanned:()=>r!==null}}var P={children:[],tagName:"div"};async function ME(e,r={}){let t=g.tabs.get(e);if(t)return ci(e,{focus:r.focus!==!1}),t;try{await qt()}catch{}let n=$w(e),o=Oo({capabilities:{modes:["grid","source"]},document:structuredClone(P),documentPath:e,id:e,sourceFormat:Zt(e)?.name??null,...r.paneId!==void 0&&{paneId:r.paneId},...r.preview===!0&&{preview:!0},...r.focus===!1&&{focus:!1}});return Iu(o,n).load(),o}function F(e){let r=Oo({capabilities:{modes:["grid"]},document:structuredClone(P),documentPath:null,id:e.id});return Iu(r,e).load(),r}function z(e){let r=ds({kind:"collection",name:e}),t=g.tabs.get(r);if(t)return ci(r),t;return F($1(e))}function PE(){let e=L(),r=g.tabs.get(e);if(r)return ci(e),r;return Oo({capabilities:{modes:["manage"]},document:structuredClone(P),documentPath:null,id:e})}function T1(){let e=ds({kind:"pages"}),r=g.tabs.get(e);if(r)return ci(e),r;return F(D1())}function Y(e,r){let t=ds({connection:e??"default",kind:"data",table:r}),n=g.tabs.get(t);if(n)return ci(t),n;return F(B(e,r))}function de(e){let r=Yf(e);if(r?.kind==="pages")T1();else if(r?.kind==="collection")z(r.name);else if(r?.kind==="data")Y(r.connection,r.table)}function ue(e,r){return[{emptyMessage:"",key:"project",rows:[{id:ds({kind:"pages"}),label:"Pages"},...e.map(({name:t})=>({id:ds({kind:"collection",name:t}),label:`Collection: ${t}`}))],state:"listed",title:"Project"},...r.map((t)=>({emptyMessage:"No tables — push a schema first.",key:`data:${t.name}`,rows:t.tables.map((n)=>({id:ds({connection:t.name,kind:"data",table:n}),label:n})),state:t.tables.length===0?"empty":"listed",title:`Data · ${t.name}`}))]}async function FE(){let e=Pw(),r=[];if(Iw())r=(await E().catch(()=>null))?.connections??[];let t=null,n=bs({cancelLabel:"Cancel",confirmLabel:"",headline:"Open Grid",island:(o)=>{t=j(o,ue(e,r),(i)=>{n.close(),de(i)})},layer:Ct("dialog"),onCancel:()=>n.close(),onClosed:()=>{t?.dispose(),t=null},onConfirm:()=>{},region:"grid/open"});n.ready}function pe(){return[{args:ke({name:je("The content collection's name, as project.json declares it.")}),category:"Project",id:"collection.editInGrid",level:"project",menus:["context/file","palette"],group:"5_data",requires:"a project that declares content collections",when:(e)=>e.project.open,run:(e,r)=>{let t=ot("collection.editInGrid",r,"name"),n=Pw().map((o)=>o.name);if(!n.includes(t))throw RangeError(`command "collection.editInGrid" argument "name": "${t}" is not a content `+"collection this project declares — it declares: "+`${n.length>0?n.join(", "):"none"}`);z(t)},title:"Edit Collection in Grid"},{args:{additionalProperties:!1,properties:{connection:je('The connection name from project.json. Defaults to "default".'),table:je("The table to open.")},required:["table"],type:"object"},category:"Project",id:"data.openGrid",level:"project",menus:["palette"],group:"5_data",requires:"a platform that serves the data routes",when:(e)=>e.project.open,enablement:(e)=>e.capability.dataRows,run:(e,r)=>{let t=ot("data.openGrid",r,"table");Y(Zo("data.openGrid",r,"connection"),t)},title:"Open Data Grid"}]}function jE(e){e.registerAll(pe())}
|
|
7
|
-
export{
|
|
6
|
+
`),i=W(e),s=i[0]??[],l=i.slice(1),a=Math.max(s.length,...l.map((c)=>c.length),0);while(s.length<a)s.push("");for(let c of l)while(c.length<a)c.push("");return{eol:n,headers:s,rows:l,trailingNewline:o}}function U(e){if(/[",\n\r]/.test(e))return`"${e.replaceAll('"','""')}"`;return e}function k(e){return[e.headers,...e.rows].map((t)=>t.map((n)=>U(n)).join(",")).join(e.eol)+(e.trailingNewline?e.eol:"")}var Q=["id","sku","slug","Slug"];function q(e){let r=new Set;return e.map((t,n)=>{let o=t.trim()===""?`column${n+1}`:t;if(r.has(o))o=`${o}__${n+1}`;return r.add(o),o})}function J(e,r){for(let t of Q){let n=e.indexOf(t);if(n===-1)continue;let o=r.rows.map((i)=>i[n]??"");if(o.every((i)=>i!=="")&&new Set(o).size===o.length)return t}return null}function O(e,r){let t=$w(e),n=q(t.headers),o=J(n,t),i=o?n.indexOf(o):-1,s=t.rows.map((d,u)=>i===-1?String(u):d[i]),l=new Map(s.map((d,u)=>[d,u])),a=qu(r,D?.projectConfig),c=a?.schema?.properties??{},y=t.rows.slice(0,50).map((d)=>{let u={};for(let[h,w]of n.entries())u[w]=d[h]??"";return u}),f=new Map(yb(y).map((d)=>[d.field,d])),g=new Map(vb(a?.schema,{idField:o??void 0}).map((d)=>[d.field,d]));return{columns:n.map((d,u)=>{let w=(d in c?g.get(d):void 0)??f.get(d)??{editable:!0,field:d,kind:"string",title:t.headers[u]||d};return{...w,pk:d===o,title:t.headers[u]?.trim()||w.title}}),doc:t,fields:n,keys:s,keyToIndex:l,loadText:e}}function X(e,r){let t={},n=e.doc.rows[r]??[];for(let[o,i]of e.fields.entries()){let s=e.columns[o],l=n[o]??"";t[i]=s.kind==="string"||s.kind==="text"||s.kind==="readonly"?l:Iu(l,s)}return t}function _(e,r){let t=e.doc.rows.map((i)=>[...i]),n=(i)=>e.fields.indexOf(i);for(let i of r.cells){let s=e.keyToIndex.get(i.rowKey),l=n(i.field);if(s===void 0||l===-1)continue;t[s][l]=Io(i.value)}for(let i of r.inserts){let s=e.fields.map((l)=>Io(i.cells[l]??null));t.push(s)}let o=r.deletes.map((i)=>e.keyToIndex.get(i.rowKey)).filter((i)=>i!==void 0).toSorted((i,s)=>s-i);for(let i of o)t.splice(i,1);return{...e.doc,rows:t}}function N(e,r){return{cells:e.cells.map((t)=>({field:t.field,rowKey:t.rowKey,...r})),deletes:e.deletes.map((t)=>({rowKey:t.rowKey,...r})),inserts:e.inserts.map((t)=>({error:r.error,ok:r.ok,tempKey:t.tempKey}))}}function Dw(e){let r=null,t=(n=!1)=>{if(!n&&r)return r;return r=p().readFile(e).then((o)=>O(o,e)),r};return{backingPaths:()=>new Map([[e,"*"]]),capabilities:{delete:!0,insert:!0,remotePaging:!1,remoteSort:!1},async columns(){return(await t()).columns},async commit(n){let o=await t(),i=p(),s=null;try{s=await i.readFile(e)}catch{s=null}if(s!==o.loadText&&!mc(e))return N(n,{error:"File changed on disk — refresh to reload",ok:!1,stale:!0});let l=_(o,n),a=k(l);return Ps(e),await i.writeFile(e,a),r=Promise.resolve(O(a,e)),N(n,{ok:!0})},id:e,label:e.split("/").pop()??e,async refresh(){await t(!0)},async rows(){let n=await t(),o=n.doc.rows.map((i,s)=>({cells:X(n,s),key:n.keys[s]}));return{rows:o,total:o.length}},async serializeForSource(n){let o=await t();return k(_(o,n))}}}var Z=50;function ee(e){let r=e.toLowerCase();if(/(int|real|floa|doub|num|dec)/.test(r))return"number";if(r.includes("bool"))return"boolean";if(/(timestamp|datetime|date)/.test(r))return"date";return"string"}function re(e){return!e.pk&&e.name!=="created_at"&&e.name!=="updated_at"}function ne(e){if(e===null||e===void 0)return null;if(typeof e==="string"||typeof e==="number"||typeof e==="boolean")return e;return JSON.stringify(e)}function B(e,r){let t=[],n="id",o=new Map,i=(a)=>{if(a.length>0)t=a,n=a.find((c)=>c.pk)?.name??"id"},s=(a)=>({table:r,...e?{connection:e}:{},limit:a?.limit??Z,offset:a?.offset??0,...a?.orderBy?{dir:a.dir??"asc",orderBy:a.orderBy}:{}}),l=(a,c)=>{let y=a[n];if(typeof y==="string"||typeof y==="number")return o.set(String(y),y),String(y);return`row-${c}`};return{capabilities:{delete:!0,insert:!0,remotePaging:!0,remoteSort:!0},async columns(){if(t.length===0){let a=await x(s({limit:1,offset:0}));i(a.columns)}return t.map((a)=>{let c=re(a)?ee(a.type):"readonly";return{editable:c!=="readonly",field:a.name,kind:c,pk:a.pk===!0,title:a.name,widthHint:a.pk?80:void 0}})},async commit(a){let c={cells:[],deletes:[],inserts:[]},y=new Map;for(let f of a.cells){let g=y.get(f.rowKey)??[];g.push({field:f.field,value:f.value}),y.set(f.rowKey,g)}for(let[f,g]of y){let b=o.get(f),d=(u,h)=>{for(let w of g)c.cells.push({error:h,field:w.field,ok:u,rowKey:f})};if(b===void 0){d(!1,"Row has no primary key — refresh the grid");continue}try{let u={};for(let h of g)u[h.field]=h.value;await A({pk:b,set:u,table:r,...e?{connection:e}:{}}),d(!0)}catch(u){d(!1,u instanceof Error?u.message:String(u))}}for(let f of a.inserts)try{let g={};for(let[h,w]of Object.entries(f.cells))if(w!==null)g[h]=w;let{row:b}=await M({table:r,values:g,...e?{connection:e}:{}}),d=b[n],u=typeof d==="string"||typeof d==="number"?String(d):void 0;if(u!==void 0&&(typeof d==="string"||typeof d==="number"))o.set(u,d);c.inserts.push({newKey:u,ok:!0,tempKey:f.tempKey})}catch(g){c.inserts.push({error:g instanceof Error?g.message:String(g),ok:!1,tempKey:f.tempKey})}for(let f of a.deletes){let g=o.get(f.rowKey);if(g===void 0){c.deletes.push({error:"Row has no primary key — refresh the grid",ok:!1,rowKey:f.rowKey});continue}try{await K({pk:g,table:r,...e?{connection:e}:{}}),c.deletes.push({ok:!0,rowKey:f.rowKey})}catch(b){c.deletes.push({error:b instanceof Error?b.message:String(b),ok:!1,rowKey:f.rowKey})}}return c},id:ds({connection:e??"default",kind:"data",table:r}),label:r,async refresh(){t=[],o.clear()},async rows(a){let c=await x(s(a));return i(c.columns),{rows:c.rows.map((f,g)=>{let b=l(f,g),d={};for(let u of t)d[u.name]=ne(f[u.name]);return{cells:d,key:b}}),total:c.total}}}}var pb=[{key:"all",label:"All"},{dir:"pages",key:"pages",label:"Pages"},{dir:"layouts",key:"layouts",label:"Layouts"},{dir:"components",key:"components",label:"Components"},{dir:"content",key:"content",label:"Content"},{dir:"public",key:"media",label:"Media"}],C1=pb.map((e)=>e.key);function Aw(e){return pb.find((r)=>r.key===e)}function k1(e){return Aw(e)?.dir}function oe(e,r){if(r&&Ld.has(r))return"Media";if(e.startsWith("pages"))return"Pages";if(e.startsWith("layouts"))return"Layouts";if(e.startsWith("components"))return"Components";if(e.startsWith("content"))return"Content";if(e.startsWith("public"))return"Media";if(e.startsWith("data"))return"Content";if(e.startsWith("styles"))return"Components";return"Other"}function ie(e){let r=D?.projectConfig?.content??{};for(let[t,n]of Object.entries(r)){if(!n.source)continue;let o=n.source.replace(/^\.\//,"").replace(/\/$/,"");if(e.startsWith(`${o}/`)||e===o)return t.charAt(0).toUpperCase()+t.slice(1)}return null}var se=new Set(["node_modules",".git",".jx","dist","build",".cache"]);async function H(e,r,t,n,o){let i;try{i=await Ir(()=>r.listDirectory(e))}catch(l){n.push({dir:e,error:te(l)});return}let s=[];for(let l of i){if(l.type==="directory"){if(!se.has(l.name))s.push(l.path);continue}let a=Gi(l.name),c=oe(l.path,a);t.push({category:c,ext:a,locale:bL(l.path,o)??void 0,modified:l.modified,name:l.name,path:l.path,size:l.size,type:c==="Content"?ie(l.path)??a??"file":a||"file"})}await Promise.all(s.map((l)=>H(l,r,t,n,o)))}async function Uf(e,r){let t=[],n=[],{i18n:o}=$o(D?.projectConfig??{});return await Promise.all(e.map((i)=>H(i,r,t,n,o))),t.sort((i,s)=>i.path.localeCompare(s.path)),{failures:n,files:t}}function TE(e,r){let t=e,n=Aw(r.category);if(n&&n.key!=="all")t=t.filter((s)=>s.category===n.label);let o=r.query.trim().toLowerCase();if(o)t=t.filter((s)=>s.name.toLowerCase().includes(o)||s.path.toLowerCase().includes(o));let i=r.locale?.trim();if(i)t=t.filter((s)=>s.locale===i);return t}var qf=["table","cards","media","calendar","board"],Nw={board:"Board",calendar:"Calendar",cards:"Cards",media:"Media",table:"Table"};var LE=new Set(["cards","media"]),ae=/^(\d{4}-\d{2}-\d{2})/;function le(e){let r=ae.exec(e.name);if(r)return r[1];if(e.modified){let t=new Date(e.modified);if(!Number.isNaN(t.getTime()))return t.toISOString().slice(0,10)}return null}function S1(){return $o(D?.projectConfig??{}).i18n?.locales??[]}function IE(e){let r=new Set;for(let t of e)if(t.locale)r.add(t.locale);return S1().filter((t)=>r.has(t))}function RE(e){let r=new Map,t=[];for(let o of e){let i=le(o);if(i===null){t.push(o);continue}let s=r.get(i);if(s)s.push(o);else r.set(i,[o])}return{days:[...r.entries()].map(([o,i])=>({date:o,files:i})).toSorted((o,i)=>i.date.localeCompare(o.date)),undated:t}}function $E(e){let r=new Map;for(let n of e){let o=r.get(n.category);if(o)o.push(n);else r.set(n.category,[n])}let t=pb.map((n)=>n.label);return[...r.entries()].map(([n,o])=>({files:o,group:n})).toSorted((n,o)=>{let i=t.indexOf(n.group),s=t.indexOf(o.group);if(i===s)return n.group.localeCompare(o.group);return(i===-1?t.length:i)-(s===-1?t.length:s)})}var G="The Library lists files; it does not edit them. Rename, duplicate or delete from the file's context menu, or open the file to edit it.";function Ow(){return[{editable:!1,field:"name",kind:"string",pk:!0,title:"Name",widthHint:260},{editable:!1,field:"category",kind:"string",title:"Category",widthHint:120},{editable:!1,field:"locale",kind:"string",title:"Locale",widthHint:90},{editable:!1,field:"type",kind:"string",title:"Type",widthHint:120},{editable:!1,field:"size",kind:"number",title:"Size",widthHint:90},{editable:!1,field:"modified",kind:"date",title:"Modified",widthHint:160},{editable:!1,field:"path",kind:"readonly",title:"Path",widthHint:320}]}function ce(e){return{cells:{category:e.category,locale:e.locale??null,modified:e.modified??null,name:e.name,path:e.path,size:e.size??null,type:e.type},key:e.path}}function L(){return ds({kind:"library"})}function DE(e){let r=null,t=null,n=e??(()=>D?.projectDirs??[]);async function o(){if(r)return r;return t??=Uf(n(),p()).then((i)=>(r=i,t=null,i)),t}return{capabilities:{delete:!1,insert:!1,remotePaging:!1,remoteSort:!1},columns:()=>Promise.resolve(Ow()),commit(i){return Promise.resolve({cells:i.cells.map((s)=>({error:G,field:s.field,ok:!1,rowKey:s.rowKey})),deletes:i.deletes.map((s)=>({error:G,ok:!1,rowKey:s.rowKey})),inserts:i.inserts.map((s)=>({error:G,ok:!1,tempKey:s.tempKey}))})},failures:()=>r?.failures??[],files:()=>r?.files??[],id:L(),label:"Library",async refresh(){r=null,t=null,await o()},async rows(){let i=await o();return{rows:i.files.map((s)=>ce(s)),total:i.files.length}},scanned:()=>r!==null}}var P={children:[],tagName:"div"};async function AE(e,r={}){let t=m.tabs.get(e);if(t)return ci(e,{focus:r.focus!==!1}),t;try{await qt()}catch{}let n=Dw(e),o=No({capabilities:{modes:["grid","source"]},document:structuredClone(P),documentPath:e,id:e,sourceFormat:Zt(e)?.name??null,...r.paneId!==void 0&&{paneId:r.paneId},...r.preview===!0&&{preview:!0},...r.focus===!1&&{focus:!1}});return Ru(o,n).load(),o}function F(e){let r=No({capabilities:{modes:["grid"]},document:structuredClone(P),documentPath:null,id:e.id});return Ru(r,e).load(),r}function z(e){let r=ds({kind:"collection",name:e}),t=m.tabs.get(r);if(t)return ci(r),t;return F(R1(e))}function NE(){let e=L(),r=m.tabs.get(e);if(r)return ci(e),r;return No({capabilities:{modes:["manage"]},document:structuredClone(P),documentPath:null,id:e})}function E1(){let e=ds({kind:"pages"}),r=m.tabs.get(e);if(r)return ci(e),r;return F($1())}function Y(e,r){let t=ds({connection:e??"default",kind:"data",table:r}),n=m.tabs.get(t);if(n)return ci(t),n;return F(B(e,r))}function de(e){let r=Kf(e);if(r?.kind==="pages")E1();else if(r?.kind==="collection")z(r.name);else if(r?.kind==="data")Y(r.connection,r.table)}function ue(e,r){return[{emptyMessage:"",key:"project",rows:[{id:ds({kind:"pages"}),label:"Pages"},...e.map(({name:t})=>({id:ds({kind:"collection",name:t}),label:`Collection: ${t}`}))],state:"listed",title:"Project"},...r.map((t)=>({emptyMessage:"No tables — push a schema first.",key:`data:${t.name}`,rows:t.tables.map((n)=>({id:ds({connection:t.name,kind:"data",table:n}),label:n})),state:t.tables.length===0?"empty":"listed",title:`Data · ${t.name}`}))]}async function OE(){let e=Fw(),r=[];if(Rw())r=(await E().catch(()=>null))?.connections??[];let t=null,n=bs({cancelLabel:"Cancel",confirmLabel:"",headline:"Open Grid",island:(o)=>{t=j(o,ue(e,r),(i)=>{n.close(),de(i)})},layer:Ct("dialog"),onCancel:()=>n.close(),onClosed:()=>{t?.dispose(),t=null},onConfirm:()=>{},region:"grid/open"});n.ready}function pe(){return[{args:Se({name:He("The content collection's name, as project.json declares it.")}),category:"Project",id:"collection.editInGrid",level:"project",menus:["context/file","palette"],group:"5_data",requires:"a project that declares content collections",when:(e)=>e.project.open,run:(e,r)=>{let t=ot("collection.editInGrid",r,"name"),n=Fw().map((o)=>o.name);if(!n.includes(t))throw RangeError(`command "collection.editInGrid" argument "name": "${t}" is not a content `+"collection this project declares — it declares: "+`${n.length>0?n.join(", "):"none"}`);z(t)},title:"Edit Collection in Grid"},{args:{additionalProperties:!1,properties:{connection:He('The connection name from project.json. Defaults to "default".'),table:He("The table to open.")},required:["table"],type:"object"},category:"Project",id:"data.openGrid",level:"project",menus:["palette"],group:"5_data",requires:"a platform that serves the data routes",when:(e)=>e.project.open,enablement:(e)=>e.capability.dataRows,run:(e,r)=>{let t=ot("data.openGrid",r,"table");Y(Jo("data.openGrid",r,"connection"),t)},title:"Open Data Grid"}]}function ME(e){e.registerAll(pe())}
|
|
7
|
+
export{Rw,SE,_1,EE,$w,Dw,pb,C1,Aw,k1,Uf,TE,qf,Nw,LE,S1,IE,RE,$E,Ow,DE,AE,NE,E1,OE,ME};
|
|
8
8
|
|
|
9
|
-
//# debugId=
|
|
10
|
-
//# sourceMappingURL=studio-
|
|
9
|
+
//# debugId=5E34916DF590526664756E2164756E21
|
|
10
|
+
//# sourceMappingURL=studio-56z7evx4.js.map
|