@jxsuite/studio 5.6.0 → 6.0.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-bb2yq946.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-t0q184js.js +4 -0
- package/dist/chunks/{convert-to-repeater-x19jr6c7.js → convert-to-repeater-vqkt7s3s.js} +3 -3
- package/dist/chunks/editor-j5sq149q.js +4 -0
- package/dist/chunks/entry-commands-fxzgcc4k.js +4 -0
- package/dist/chunks/{extension-sections-y90sa0n4.js → extension-sections-8beq9ac3.js} +3 -3
- package/dist/chunks/file-ops-2n77759h.js +4 -0
- package/dist/chunks/files-fjy7zpxt.js +4 -0
- package/dist/chunks/format-host-wj3mf3n8.js +4 -0
- package/dist/chunks/fs-events-7kcgn4e9.js +4 -0
- package/dist/chunks/git-panel-7z2mpt2d.js +4 -0
- package/dist/chunks/{grid-view-d9mybhn0.js → grid-view-ca10def6.js} +10 -10
- package/dist/chunks/iframe-host-a0zjd6xp.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-p677nrh5.js +4 -0
- package/dist/chunks/layers-panel-y4w1dq90.js +4 -0
- package/dist/chunks/lit-html-cfn61dn7.js +4 -0
- package/dist/chunks/media-picker-xg7yjpz9.js +4 -0
- package/dist/chunks/menu-fpekzj6w.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-xtbfgg2r.js +4 -0
- package/dist/chunks/quick-search-d3a6m7j3.js +4 -0
- package/dist/chunks/references-99ws0b0m.js +4 -0
- package/dist/chunks/right-panel-31vbk5xp.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-1a99w39s.js +5 -0
- package/dist/chunks/studio-1q6amtph.js +5 -0
- package/dist/chunks/{studio-eegyf5vg.js → studio-1wvfxkyy.js} +4 -4
- package/dist/chunks/{studio-z47mm077.js → studio-3ck2a5c4.js} +6 -6
- package/dist/chunks/{studio-ymsjnvp9.js → studio-4fde4a0x.js} +4 -4
- package/dist/chunks/{studio-je15p5v8.js → studio-4jj9gme2.js} +5 -5
- package/dist/chunks/{studio-w8w9frjy.js → studio-4m50vh74.js} +12 -12
- package/dist/chunks/{studio-891t1tv9.js → studio-4r0sjtx8.js} +4 -4
- package/dist/chunks/{studio-6exg5z4x.js → studio-4xppwncr.js} +3 -3
- package/dist/chunks/{studio-011em5cf.js → studio-5d7wfmnp.js} +4 -4
- package/dist/chunks/{studio-zkkdbbvd.js → studio-5e9zsamh.js} +6 -6
- package/dist/chunks/{studio-pvj970st.js → studio-5gs9th4b.js} +4 -4
- package/dist/chunks/{studio-dtmdjmqb.js → studio-5vy2wfm5.js} +4 -4
- package/dist/chunks/{studio-654fxcr0.js → studio-7pgy3xaf.js} +4 -4
- package/dist/chunks/{studio-z1vdxq0e.js → studio-7qvs7v0m.js} +4 -4
- package/dist/chunks/studio-84rtc120.js +5 -0
- package/dist/chunks/{studio-ks0ecgjx.js → studio-8xcwewjq.js} +4 -4
- package/dist/chunks/{studio-sadckcpp.js → studio-aekhcdzw.js} +5 -5
- package/dist/chunks/{studio-mf41717j.js → studio-aje966s9.js} +4 -4
- package/dist/chunks/studio-aqmph6k4.js +5 -0
- package/dist/chunks/{studio-28pz4s1k.js → studio-bftp4n4b.js} +4 -4
- package/dist/chunks/{studio-tzs6njnb.js → studio-c6zdm25z.js} +7 -7
- package/dist/chunks/{studio-sgzss898.js → studio-capk0583.js} +7 -7
- package/dist/chunks/{studio-805fwp9k.js → studio-cbr9czkn.js} +4 -4
- package/dist/chunks/{studio-1pxvgx1t.js → studio-chdmwwzw.js} +4 -4
- package/dist/chunks/{studio-dknr8m7b.js → studio-cp1gbff9.js} +7 -7
- package/dist/chunks/{studio-ft8pfpp0.js → studio-cqmtbg2p.js} +4 -4
- package/dist/chunks/studio-e47215hh.js +5 -0
- package/dist/chunks/{studio-9n2j9nqk.js → studio-edbtvcd1.js} +4 -4
- package/dist/chunks/{studio-mm8x32gg.js → studio-evwgp1ym.js} +4 -4
- package/dist/chunks/{studio-02y9cb4h.js → studio-fbx6twps.js} +5 -5
- package/dist/chunks/{studio-0nm2skex.js → studio-fqq890ap.js} +3 -3
- package/dist/chunks/studio-fthwn4kf.js +5 -0
- package/dist/chunks/{studio-s85vah66.js → studio-g8dsj3d2.js} +5 -5
- package/dist/chunks/{studio-0c3fpdqj.js → studio-ge5fqjth.js} +5 -5
- package/dist/chunks/{studio-ebt49j3c.js → studio-gjknvzam.js} +5 -5
- 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-d007j0z3.js → studio-hnvnfbdv.js} +6 -6
- package/dist/chunks/{studio-b5rxwkj2.js → studio-mk00zd5d.js} +4 -4
- package/dist/chunks/{studio-36s6qjgq.js → studio-n78gjfy8.js} +4 -4
- package/dist/chunks/studio-nbxqcgvf.js +5 -0
- package/dist/chunks/{studio-y164brht.js → studio-pwqfmt4p.js} +4 -4
- package/dist/chunks/studio-qa73881a.js +5 -0
- package/dist/chunks/{studio-6zyt56ek.js → studio-r3kaka4d.js} +4 -4
- package/dist/chunks/{studio-njmg0e73.js → studio-rmn2dz59.js} +5 -5
- package/dist/chunks/{studio-wr0pq67n.js → studio-rr4xkv81.js} +4 -4
- package/dist/chunks/{studio-tj28pxa1.js → studio-semd1s8s.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-9tkaykt5.js → studio-tmeq6mjb.js} +4 -4
- package/dist/chunks/{studio-153mwkyq.js → studio-tp642n5g.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-x5g1xk77.js +5 -0
- package/dist/chunks/studio-x92tgnee.js +64 -0
- package/dist/chunks/{studio-4yztve2t.js → studio-xg1942as.js} +4 -4
- package/dist/chunks/{studio-k9pwvmz8.js → studio-xkfs0dp2.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-jsr14n1s.js → studio-zev8ssp1.js} +4 -4
- package/dist/chunks/{studio-r7yeeqc4.js → studio-ztvcxm3w.js} +4 -4
- package/dist/chunks/{tsMode-eq26t9gs.js → tsMode-k9s9fcag.js} +4 -4
- package/dist/chunks/workspace-5vmgsagj.js +4 -0
- package/dist/chunks/{ws-client-3gxqp06s.js → ws-client-0ja08haa.js} +3 -3
- package/dist/iframe-entry.js +3 -3
- package/dist/manifest.json +62 -62
- package/dist/studio.js +95 -95
- package/package.json +12 -12
- 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/src/ui/schema-form.ts +6 -2
- 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-b29h7g7s.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
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{tt,Oi}from"./studio-dmymvk2j.js";import{SI,Wx,hn,sn,Hm,II,ne}from"./studio-dknr8m7b.js";import{ge,Q,v,$c,S,zd}from"./studio-0nm2skex.js";import{te}from"./studio-ery42sqr.js";var rt="data-jx-region",ce=["rail","navigator","inspector","pane","dock.bottom","statusbar","commandbar","overlay"],de=new Set(["dock.bottom"]);function ue(e){let t=e.indexOf("/"),o=t===-1?e:e.slice(0,t),n=t===-1?void 0:e.slice(t+1);if(n===""||o==="")return null;let a=o,i;if(!de.has(o)){let s=o.indexOf(".");if(s!==-1){if(a=o.slice(0,s),i=o.slice(s+1),i==="")return null}}if(!ce.includes(a))return null;return i===void 0?n===void 0?{surface:a}:{part:n,surface:a}:n===void 0?{instance:i,surface:a}:{instance:i,part:n,surface:a}}function fe(e){return ue(e)!==null}function me(e){if(e==="pane")return"pane.primary";return e.startsWith("pane/")?`pane.primary/${e.slice(5)}`:e}function B(e){return e??document}var pe=[{locate:([,e],t)=>{let n=Rp(`inspector/field:${e}`,t)?.querySelector('[part="browse"]');return n?[n]:[]},pattern:/^inspector\/field:(.+)\/browse$/},{locate:([,e],t)=>{let o=Rp("inspector",t);return o?[...o.querySelectorAll(`[data-prop="${CSS.escape(e)}"]`)]:[]},pattern:/^inspector\/field:(.+)$/}];function ve(e,t){let o=me(e);if(!fe(o))return[];let n=[...B(t).querySelectorAll(`[data-jx-region="${CSS.escape(o)}"]`)];if(n.length>0)return n;for(let a of pe){let i=o.match(a.pattern);if(i)return a.locate(i,B(t))}return[]}function Rp(e,t){return ve(e,t).at(-1)??null}var bS={dock:"dock.bottom",inspector:"inspector",navigator:"navigator",pane:"pane.primary",rail:"rail",status:"statusbar"};function xi(e,t){return t?`pane.${e}/${t}`:`pane.${e}`}function bI(e){return xi(e,"tabs")}function vI(e){return`navigator/panel:${e}`}function yI(e){return`inspector/tab:${e}`}var wI="navigator/statements";function xI(e){return`inspector/statements:${e}`}function Lv(e){return`dock.bottom/panel:${e}`}var he={dialog:"dialog",modal:"dialog",popover:"menu",toast:"toasts"};function zt(e,t){let o=he[e];return t?`overlay.${o}:${t}`:`overlay.${o}`}var k=new Map,Y=1;function X(e){let t=Y;return Y+=1,k.set(t,{...e,id:t}),t}function H(e){k.delete(e)}function Z(){return[...k.values()]}function mI(e){let t=e.toLowerCase();return Z().filter((o)=>o.elements.has(t))}function gI(e){return Z().filter((t)=>t.name===e)}var P=null;function gS(e=document){return P??=II({document:e}),P}function ee(){return P??gS()}var L="jx-studio:/surfaces/",w=new Map;function T(e,t){w.set(e,t),Wx(ye(e),t)}function ye(e){return`${L}${e}.json`}function _I(e){return w.get(e)}function be(e){if(!e.startsWith(L)||!e.endsWith(".json"))return;return w.get(e.slice(L.length,-5))}async function R(e,t,o,n={}){let a=w.get(e);if(!a)throw Error(`Studio surface "${e}" is not registered`);if(await ee(),n.region)o.setAttribute(rt,n.region);let i=await SI(a,o,{scope:t,base:L,resolver:be,...n.onNodeCreated?{onNodeCreated:n.onNodeCreated}:{},...n.onNodeMoved?{onNodeMoved:n.onNodeMoved}:{},...n.signal?{signal:n.signal}:{}}),s=(r)=>({dispose:r,elements:i.elements,root:i.root,scope:i.scope});if(n.signal?.aborted)return s(i.dispose);let d=0,l=()=>{i.dispose(),H(d)};return d=X({elements:i.elements,host:o,name:e,remount:async()=>{l(),await R(e,t,o,n)}}),n.signal?.addEventListener("abort",()=>H(d),{once:!0}),s(l)}var oe={$schema:"https://jxsuite.com/schema/v1",$id:"StudioDialog",$description:"Studio's confirm, save-or-discard and prompt dialogs: one jx-dialog whose body is projected from the adapter's scope. `message` is a sentence; `choice` is a `jx-select` over the options; `field` is the prompt's jx-textfield with its refusal. The four answers call the host's functions, and the host decides when the dialog closes.",tagName:"jx-dialog",$props:{headline:{$ref:"#/state/headline"},confirmLabel:{$ref:"#/state/confirmLabel"},secondaryLabel:{$ref:"#/state/secondaryLabel"},cancelLabel:{$ref:"#/state/cancelLabel"},destructive:{$ref:"#/state/destructive"},size:{$ref:"#/state/size"}},attributes:{headline:"${state.headline}","confirm-label":"${state.confirmLabel || null}","secondary-label":"${state.secondaryLabel || null}","cancel-label":"${state.cancelLabel || null}",part:"dialog-host"},onconfirm:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/confirm"},value:[]}]},onsecondary:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/secondary"},value:[]}]},oncancel:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/cancel"},value:[]}]},onclose:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},style:{'& [part="message"]':{$description:"The one part of a dialog that is text rather than interface, so it opts back in to selection. The root sets `user-select: none` and `styles/tokens.json` restates it on every `dialog`, so the headline, the labels and the buttons around this sentence stay unselectable; a message is often the thing a reader copies into a search or a bug report.",margin:"0 0 var(--jx-space-3)",userSelect:"text"},'& [part="message"]:last-child':{margin:"0"},'& [part="island"] > p, & [part="island"] > span, & [part="island"] > strong, & [part="island"] > em, & [part="island"] > code':{$description:"The island's own prose is the message's other form — a body richer than a sentence, written straight into the island from a lit template (studio-ui-guidelines.md §9.4) — so it is selectable for the same reason `[part=\"message\"]` is. The opt-in stops at those children because the island is ALSO the mount point for a whole document: the Open Grid picker and Push Schema's plan put their surfaces here, and `user-select` inherits, so a rule on the island itself would hand selection to every heading, source row and button they draw, which is the interface the policy exists to keep unselectable. A mounted surface roots a `div`; a message writes paragraphs and text-level spans, so the two forms are told apart by the child that arrives.",userSelect:"text"},'& [part="island"]:empty':{display:"none"},'& [part="message-slot"], & [part="choice-slot"], & [part="field-slot"]':{display:"contents"},'& [part="choice-row"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-1)",margin:"0 0 var(--jx-space-3)"},'& [part="choice-label"]':{fontSize:"var(--jx-text-sm)",color:"var(--jx-fg-dim)"},"& jx-textfield":{width:"100%"}},children:[{tagName:"div",attributes:{part:"message-slot",role:"none"},$switch:{$ref:"#/state/hasMessage"},cases:{true:{tagName:"p",attributes:{part:"message"},textContent:"${state.message}"}}},{tagName:"div",attributes:{part:"island"}},{tagName:"div",attributes:{part:"choice-slot",role:"none"},$switch:{$ref:"#/state/hasChoice"},cases:{true:{tagName:"div",attributes:{part:"choice-row"},children:[{tagName:"span",attributes:{part:"choice-label"},textContent:"${state.choiceLabel}"},{tagName:"jx-select",$props:{label:{$ref:"#/state/choiceLabel"},options:{$ref:"#/state/options"},value:{$ref:"#/state/chosen"}},attributes:{part:"choice"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/pick"},value:[{$ref:"event#/target/value"}]}]}}]}}},{tagName:"div",attributes:{part:"field-slot",role:"none"},$switch:{$ref:"#/state/hasField"},cases:{true:{tagName:"jx-textfield",$props:{label:{$ref:"#/state/headline"},value:{$ref:"#/state/value"},placeholder:{$ref:"#/state/placeholder"},invalid:{$ref:"#/state/invalid"},error:{$ref:"#/state/error"},multiline:{$ref:"#/state/multiline"},rows:{$ref:"#/state/rows"},mono:{$ref:"#/state/mono"}},attributes:{part:"field"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/input"},value:[{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"#/state/singleLine"},cases:{true:[{$switch:{$ref:"event#/key"},cases:{Enter:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/confirm"},value:[]}]}}]}}]},$description:"The prompt's one field. `multiline` is what makes it a paste box rather than a line: an import the author copied out of a `_redirects` file is column-aligned, so it also asks for `mono`. A multiline field takes Enter as a newline, which is why the Enter-confirms handler below is guarded on it — a paste box whose second line submits the dialog cannot be typed into."}}}]};T("dialog",oe);function Nn(e){if(e.querySelector('[part="dialog"]'))return Promise.resolve(e);return new Promise((t)=>{e.addEventListener("jx-ready",function o(n){if(n.target!==e&&!e.querySelector('[part="dialog"]'))return;e.removeEventListener("jx-ready",o),t(e)})})}function bs(e){let t=document.createElement("div");t.style.pointerEvents="auto",t.setAttribute(rt,zt("dialog",e.region)),e.layer.append(t);let o=v({cancel:()=>{e.onCancel()},cancelLabel:e.cancelLabel,choiceLabel:e.choice?.label??"",chosen:e.choice?.chosen??"",closed:()=>{e.onClosed()},confirm:()=>{e.onConfirm()},confirmLabel:e.confirmLabel,destructive:e.destructive===!0,error:"",hasChoice:e.choice!==void 0,hasField:e.field!==void 0,mono:e.field?.mono===!0,multiline:e.field?.multiline===!0,rows:e.field?.rows??"3",singleLine:e.field!==void 0&&e.field.multiline!==!0?"true":"false",hasMessage:e.message!==void 0&&e.message!=="",headline:e.headline,input:(r)=>{o.value=r,e.onInput?.(r)},invalid:!1,message:e.message??"",options:e.choice?.options??[],pick:(r)=>{e.onPick?.(r)},placeholder:e.field?.placeholder??"",secondary:()=>{e.onSecondary?.()},secondaryLabel:e.secondaryLabel??"",size:e.size??"sm",value:e.field?.value??""}),n=null,a=!1,i=()=>{},s=new Promise((r)=>{i=r}),l=R("dialog",o,t).then(async(r)=>{let c=r.root;if(a)return r.dispose(),c;if(n=r,await Promise.race([Nn(c),s]),a)return c;if(e.island?.(c.querySelector('[part="island"]')??c),hn(c),e.field){let y=c.querySelector("jx-textfield");if(y)setTimeout(()=>{if(!a)Hm(y,e.field?.select??"all")},0)}return c});return{close(){if(a)return;a=!0,i();let r=n?.root;if(r instanceof HTMLElement)sn(r);n?.dispose(),n=null,t.remove()},host:t,ready:l,update(r){if(r.confirmLabel!==void 0)o.confirmLabel=r.confirmLabel;if(r.cancelLabel!==void 0)o.cancelLabel=r.cancelLabel;if(r.secondaryLabel!==void 0)o.secondaryLabel=r.secondaryLabel;if(r.message!==void 0)o.message=r.message,o.hasMessage=r.message!=="";if(r.value!==void 0)o.value=r.value;if(r.placeholder!==void 0)o.placeholder=r.placeholder;if(r.invalid!==void 0)o.invalid=r.invalid;if(r.error!==void 0)if(r.error!==""&&r.error===o.error){o.error="";let c=r.error;queueMicrotask(()=>{o.error=c})}else o.error=r.error;if(r.options!==void 0)o.options=r.options;if(r.chosen!==void 0)o.chosen=r.chosen}}}var re={$schema:"https://jxsuite.com/schema/v1",$id:"StudioToasts",$description:"The toast stack: a rendering of the notification service's toasts, newest last. Each row is projected by ui/layers.ts with its severity glyph and, where a recovery command exists, that command's title and gate; the two buttons call back into the host, which owns the records and their timers.",tagName:"div",attributes:{part:"stack"},style:{position:"absolute",right:"var(--jx-space-4)",bottom:"36px",display:"flex",flexDirection:"column",gap:"var(--jx-space-3)",alignItems:"flex-end",maxWidth:"min(420px, calc(100vw - 24px))",'& [part="toast"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-3)",pointerEvents:"auto",padding:"var(--jx-space-3)",border:"1px solid var(--jx-border)",borderLeft:"3px solid var(--jx-fg-dim)",borderRadius:"var(--jx-radius-md)",background:"var(--jx-bg-panel)",color:"var(--jx-fg)",fontSize:"var(--jx-text-sm)",lineHeight:"var(--jx-leading-sm)",boxShadow:"var(--jx-shadow-popover)"},'& [part="toast"][data-severity="success"]':{borderLeftColor:"var(--jx-success)"},'& [part="toast"][data-severity="info"]':{borderLeftColor:"var(--jx-accent)"},'& [part="toast"][data-severity="warn"]':{borderLeftColor:"var(--jx-warning)"},'& [part="toast"][data-severity="error"]':{borderLeftColor:"var(--jx-danger)"},'& [part="icon"]':{flex:"none",width:"14px",textAlign:"center",fontWeight:"700"},'& [data-severity="success"] [part="icon"]':{color:"var(--jx-success)"},'& [data-severity="info"] [part="icon"]':{color:"var(--jx-accent)"},'& [data-severity="warn"] [part="icon"]':{color:"var(--jx-warning)"},'& [data-severity="error"] [part="icon"]':{color:"var(--jx-danger)"},'& [part="message"]':{flex:"1",minWidth:"0",overflow:"hidden",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"3"},'& [part="action-slot"]':{display:"contents"},'& [part="action"] > [part="control"]':{color:"var(--jx-accent)"}},children:[{$prototype:"Array",items:{$ref:"#/state/toasts"},key:{$ref:"$map/item/id"},map:{tagName:"div",attributes:{part:"toast","data-severity":"${$map.item.severity}"},children:[{tagName:"span",attributes:{part:"icon","aria-hidden":"true"},textContent:"${$map.item.icon}"},{tagName:"span",attributes:{part:"message"},textContent:"${$map.item.message}"},{tagName:"span",attributes:{part:"action-slot",role:"none"},$switch:{$ref:"$map/item/hasAction"},cases:{true:{tagName:"jx-button",$props:{size:"sm",quiet:!0,disabled:{$ref:"$map/item/actionDisabled"}},attributes:{part:"action",title:"${$map.item.actionTitle}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/runAction"},value:[{$ref:"$map/item/id"}]}]},children:[{tagName:"span",textContent:"${$map.item.actionLabel}"}]}}},{tagName:"jx-action-button",$props:{label:"Dismiss notification",hint:"Dismiss notification",icon:"x",size:"sm"},attributes:{part:"dismiss"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/dismissToast"},value:[{$ref:"$map/item/id"}]}]}}]}}]};function $e(e){return e instanceof RangeError||e instanceof Error&&e.name==="CommandUnavailableError"}function rn(e,t,o,n=t){let a=(s)=>{if(!$e(s))console.error(`${n}: command "${t}" failed`,s);S.error(te(s),{key:`command.run:${t}`,source:n})},i;try{i=e.run(t,o)}catch(s){return a(s),Promise.resolve()}return Promise.resolve(i).catch(a)}function Rc(e,t,o){let n=ne();return n?rn(n,e,t,o):Promise.resolve()}var se,F,q,M;function Ct(e){return(e==="popover"?se:e==="modal"?F:e==="toast"?M:q)||document.body}function vS(){se=document.querySelector("#layer-popover"),F=document.querySelector("#layer-modal"),q=document.querySelector("#layer-dialog"),M=document.querySelector("#layer-toast"),Ce()}var ae="jx-dialog[data-open], dialog[open]";function Mm(){return Boolean(q?.querySelector(ae)||F?.querySelector(ae))}function Qo(e,t,o={}){let{confirmLabel:n="Confirm",cancelLabel:a="Cancel",destructive:i=!1}=o;return new Promise((s)=>{let d=!1,l=(c)=>{if(d)return;d=!0,r.close(),s(c)},r=bs({cancelLabel:a,confirmLabel:n,destructive:i,headline:e,layer:Ct("dialog"),...G(t),onCancel:()=>l(!1),onClosed:()=>l(!1),onConfirm:()=>l(!0)})})}function zx(e,t,o={}){let{saveLabel:n="Save",discardLabel:a="Discard",cancelLabel:i="Cancel"}=o;return new Promise((s)=>{let d=!1,l=(c)=>{if(d)return;d=!0,r.close(),s(c)},r=bs({cancelLabel:i,confirmLabel:n,headline:e,layer:Ct("dialog"),...G(t),onCancel:()=>l("cancel"),onClosed:()=>l("cancel"),onConfirm:()=>l("save"),onSecondary:()=>l("discard"),secondaryLabel:a})})}function G(e){if(typeof e==="string")return{message:e};return{island:(t)=>{Oi(e,t)}}}function On(e,t={}){let{cancelLabel:o="Cancel",choice:n,confirmLabel:a="OK",message:i,mono:s=!1,multiline:d=!1,placeholder:l="",rows:r="3",select:c="all",size:y,validate:J,value:le=""}=t,O=(m)=>J?J(m,b):m.trim()?"":"Enter a value.",p=le,b=n?.initial??"",f="",U=!1,z=()=>typeof l==="function"?l():l,W=()=>n?n.options().map((m)=>({label:m.label,value:m.value})):[];return new Promise((m)=>{let V=!1,N=(u)=>{if(V)return;V=!0,A.close(),m(u)},K=(u)=>{f=u,A.update({error:f,invalid:f!==""})},A=bs({cancelLabel:o,confirmLabel:a,headline:e,layer:Ct("dialog"),...i===void 0?{}:G(i),...n?{choice:{chosen:b,label:n.label,options:W()}}:{},field:{mono:s,multiline:d,placeholder:z(),rows:r,select:c,value:p},...y===void 0?{}:{size:y},onCancel:()=>N(null),onClosed:()=>N(null),onConfirm:()=>{let u=O(p);if(u){K(u);return}N(p.trim())},onInput:(u)=>{U=!0,p=u;let x=O(p);if(x!==f)K(x)},onPick:(u)=>{b=u,n?.onChange?.(u);let x=O(p);f=U||f?x:"",A.update({chosen:b,error:f,invalid:f!=="",options:W(),placeholder:z()})}})})}var C=new Map;function vs(e,t){let o=`${e}:${t}`,n=C.get(o);if(n&&n.parentElement)return n;return n=document.createElement("div"),n.style.pointerEvents="auto",n.setAttribute(rt,zt(e,t)),Ct(e).append(n),C.set(o,n),n}function Pm(e,t){let o=`${e}:${t}`,n=C.get(o);if(n)Oi(tt,n),n.remove(),C.delete(o)}var Re=180,Le={error:"✕",info:"ℹ",success:"✓",warn:"!"},j=null,h=new Map,g=new Set;function Te(){return globalThis.matchMedia?.("(prefers-reduced-motion: reduce)").matches===!0}function we(){try{return new URLSearchParams(globalThis.location?.search??"").get("automation")==="1"}catch{return!1}}function yS(){return[...g].map((e)=>`overlay: toast ${e} settling in`)}function _(e){let t=h.get(e);if(t!==void 0)clearTimeout(t),h.delete(e);g.delete(e),zd(e)}function Ee(e){if(h.has(e.id)||g.has(e.id))return;let t=Te()?0:Re;if(t>0)g.add(e.id),setTimeout(()=>g.delete(e.id),t);let o=e.timeoutMs??0;if(o<=0||we())return;h.set(e.id,setTimeout(()=>_(e.id),o))}T("toasts",re);var I=null,D=null,E=null;function ie(){return I??=v({dismissToast:(e)=>{_(e)},runAction:(e)=>{let t=$c.find((n)=>n.id===e),o=ne();if(!t?.action||!o)return;_(e),rn(o,t.action,t.actionArgs,"Notifications")},toasts:[]}),I}function Me(e){let t=e.action===void 0?null:ne(),o=e.action,n=t&&o!==void 0?t.get(o):void 0,a=n&&o!==void 0&&t.isVisible(o)?n:null,i=a&&o!==void 0?t.disabledReason(o):void 0;return{actionDisabled:i!==void 0,actionLabel:a?.title??"",actionTitle:a===null||a===void 0?"":i===void 0?a.title:`${a.title} — requires ${i}`,hasAction:a!==null&&a!==void 0,icon:Le[e.severity],id:e.id,message:e.message,severity:e.severity}}function Ce(){if(je(),!M)return;j=ge(),j.run(()=>{Q(()=>{$c.length,ne();for(let e of $c)Ee(e);ie().toasts=$c.map((e)=>Me(e))})}),D=R("toasts",ie(),M),D.then((e)=>{E=e})}function je(){j?.stop(),j=null;for(let t of h.values())clearTimeout(t);h.clear(),g.clear();let e=D;if(D=null,E)E.dispose(),E=null;else if(e)e.then((t)=>t.dispose());I=null}
|
|
2
|
-
export{
|
|
1
|
+
import{tt,Ni}from"./studio-sxc0zvpt.js";import{vI,zx,un,rn,Pm,CI,ne}from"./studio-cp1gbff9.js";import{ge,Q,v,$c,k,Wd}from"./studio-fqq890ap.js";import{te}from"./studio-ery42sqr.js";var rt="data-jx-region",ce=["rail","navigator","inspector","pane","dock.bottom","statusbar","commandbar","overlay"],de=new Set(["dock.bottom"]);function ue(e){let t=e.indexOf("/"),o=t===-1?e:e.slice(0,t),n=t===-1?void 0:e.slice(t+1);if(n===""||o==="")return null;let a=o,i;if(!de.has(o)){let s=o.indexOf(".");if(s!==-1){if(a=o.slice(0,s),i=o.slice(s+1),i==="")return null}}if(!ce.includes(a))return null;return i===void 0?n===void 0?{surface:a}:{part:n,surface:a}:n===void 0?{instance:i,surface:a}:{instance:i,part:n,surface:a}}function fe(e){return ue(e)!==null}function me(e){if(e==="pane")return"pane.primary";return e.startsWith("pane/")?`pane.primary/${e.slice(5)}`:e}function B(e){return e??document}var pe=[{locate:([,e],t)=>{let n=Ip(`inspector/field:${e}`,t)?.querySelector('[part="browse"]');return n?[n]:[]},pattern:/^inspector\/field:(.+)\/browse$/},{locate:([,e],t)=>{let o=Ip("inspector",t);return o?[...o.querySelectorAll(`[data-prop="${CSS.escape(e)}"]`)]:[]},pattern:/^inspector\/field:(.+)$/}];function ve(e,t){let o=me(e);if(!fe(o))return[];let n=[...B(t).querySelectorAll(`[data-jx-region="${CSS.escape(o)}"]`)];if(n.length>0)return n;for(let a of pe){let i=o.match(a.pattern);if(i)return a.locate(i,B(t))}return[]}function Ip(e,t){return ve(e,t).at(-1)??null}var fk={dock:"dock.bottom",inspector:"inspector",navigator:"navigator",pane:"pane.primary",rail:"rail",status:"statusbar"};function Zi(e,t){return t?`pane.${e}/${t}`:`pane.${e}`}function uI(e){return Zi(e,"tabs")}function hI(e){return`navigator/panel:${e}`}function pI(e){return`inspector/tab:${e}`}var fI="navigator/statements";function mI(e){return`inspector/statements:${e}`}function Iv(e){return`dock.bottom/panel:${e}`}var he={dialog:"dialog",modal:"dialog",popover:"menu",toast:"toasts"};function zt(e,t){let o=he[e];return t?`overlay.${o}:${t}`:`overlay.${o}`}var A=new Map,Y=1;function X(e){let t=Y;return Y+=1,A.set(t,{...e,id:t}),t}function H(e){A.delete(e)}function Z(){return[...A.values()]}function cI(e){let t=e.toLowerCase();return Z().filter((o)=>o.elements.has(t))}function dI(e){return Z().filter((t)=>t.name===e)}var P=null;function pk(e=document){return P??=CI({document:e}),P}function ee(){return P??pk()}var S="jx-studio:/surfaces/",L=new Map;function T(e,t){L.set(e,t),zx(ye(e),t)}function ye(e){return`${S}${e}.json`}function gI(e){return L.get(e)}function be(e){if(!e.startsWith(S)||!e.endsWith(".json"))return;return L.get(e.slice(S.length,-5))}async function R(e,t,o,n={}){let a=L.get(e);if(!a)throw Error(`Studio surface "${e}" is not registered`);if(await ee(),n.region)o.setAttribute(rt,n.region);let i=await vI(a,o,{scope:t,base:S,resolver:be,...n.onNodeCreated?{onNodeCreated:n.onNodeCreated}:{},...n.onNodeMoved?{onNodeMoved:n.onNodeMoved}:{},...n.signal?{signal:n.signal}:{}}),s=(r)=>({dispose:r,elements:i.elements,root:i.root,scope:i.scope});if(n.signal?.aborted)return s(i.dispose);let d=0,l=()=>{i.dispose(),H(d)};return d=X({elements:i.elements,host:o,name:e,remount:async()=>{l(),await R(e,t,o,n)}}),n.signal?.addEventListener("abort",()=>H(d),{once:!0}),s(l)}var oe={$schema:"https://jxsuite.com/schema/v1",$id:"StudioDialog",$description:"Studio's confirm, save-or-discard and prompt dialogs: one jx-dialog whose body is projected from the adapter's scope. `message` is a sentence; `choice` is a `jx-select` over the options; `field` is the prompt's jx-textfield with its refusal. The four answers call the host's functions, and the host decides when the dialog closes.",tagName:"jx-dialog",$props:{headline:{$ref:"#/state/headline"},confirmLabel:{$ref:"#/state/confirmLabel"},secondaryLabel:{$ref:"#/state/secondaryLabel"},cancelLabel:{$ref:"#/state/cancelLabel"},destructive:{$ref:"#/state/destructive"},size:{$ref:"#/state/size"}},attributes:{headline:"${state.headline}","confirm-label":"${state.confirmLabel || null}","secondary-label":"${state.secondaryLabel || null}","cancel-label":"${state.cancelLabel || null}",part:"dialog-host"},onconfirm:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/confirm"},value:[]}]},onsecondary:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/secondary"},value:[]}]},oncancel:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/cancel"},value:[]}]},onclose:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},style:{'& [part="message"]':{$description:"The one part of a dialog that is text rather than interface, so it opts back in to selection. The root sets `user-select: none` and `styles/tokens.json` restates it on every `dialog`, so the headline, the labels and the buttons around this sentence stay unselectable; a message is often the thing a reader copies into a search or a bug report.",margin:"0 0 var(--jx-space-3)",userSelect:"text"},'& [part="message"]:last-child':{margin:"0"},'& [part="island"] > p, & [part="island"] > span, & [part="island"] > strong, & [part="island"] > em, & [part="island"] > code':{$description:"The island's own prose is the message's other form — a body richer than a sentence, written straight into the island from a lit template (studio-ui-guidelines.md §9.4) — so it is selectable for the same reason `[part=\"message\"]` is. The opt-in stops at those children because the island is ALSO the mount point for a whole document: the Open Grid picker and Push Schema's plan put their surfaces here, and `user-select` inherits, so a rule on the island itself would hand selection to every heading, source row and button they draw, which is the interface the policy exists to keep unselectable. A mounted surface roots a `div`; a message writes paragraphs and text-level spans, so the two forms are told apart by the child that arrives.",userSelect:"text"},'& [part="island"]:empty':{display:"none"},'& [part="message-slot"], & [part="choice-slot"], & [part="field-slot"]':{display:"contents"},'& [part="choice-row"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-1)",margin:"0 0 var(--jx-space-3)"},'& [part="choice-label"]':{fontSize:"var(--jx-text-sm)",color:"var(--jx-fg-dim)"},"& jx-textfield":{width:"100%"}},children:[{tagName:"div",attributes:{part:"message-slot",role:"none"},$switch:{$ref:"#/state/hasMessage"},cases:{true:{tagName:"p",attributes:{part:"message"},textContent:"${state.message}"}}},{tagName:"div",attributes:{part:"island"}},{tagName:"div",attributes:{part:"choice-slot",role:"none"},$switch:{$ref:"#/state/hasChoice"},cases:{true:{tagName:"div",attributes:{part:"choice-row"},children:[{tagName:"span",attributes:{part:"choice-label"},textContent:"${state.choiceLabel}"},{tagName:"jx-select",$props:{label:{$ref:"#/state/choiceLabel"},options:{$ref:"#/state/options"},value:{$ref:"#/state/chosen"}},attributes:{part:"choice"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/pick"},value:[{$ref:"event#/target/value"}]}]}}]}}},{tagName:"div",attributes:{part:"field-slot",role:"none"},$switch:{$ref:"#/state/hasField"},cases:{true:{tagName:"jx-textfield",$props:{label:{$ref:"#/state/headline"},value:{$ref:"#/state/value"},placeholder:{$ref:"#/state/placeholder"},invalid:{$ref:"#/state/invalid"},error:{$ref:"#/state/error"},multiline:{$ref:"#/state/multiline"},rows:{$ref:"#/state/rows"},mono:{$ref:"#/state/mono"}},attributes:{part:"field"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/input"},value:[{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"#/state/singleLine"},cases:{true:[{$switch:{$ref:"event#/key"},cases:{Enter:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/confirm"},value:[]}]}}]}}]},$description:"The prompt's one field. `multiline` is what makes it a paste box rather than a line: an import the author copied out of a `_redirects` file is column-aligned, so it also asks for `mono`. A multiline field takes Enter as a newline, which is why the Enter-confirms handler below is guarded on it — a paste box whose second line submits the dialog cannot be typed into."}}}]};T("dialog",oe);function An(e){if(e.querySelector('[part="dialog"]'))return Promise.resolve(e);return new Promise((t)=>{e.addEventListener("jx-ready",function o(n){if(n.target!==e&&!e.querySelector('[part="dialog"]'))return;e.removeEventListener("jx-ready",o),t(e)})})}function bs(e){let t=document.createElement("div");t.style.pointerEvents="auto",t.setAttribute(rt,zt("dialog",e.region)),e.layer.append(t);let o=v({cancel:()=>{e.onCancel()},cancelLabel:e.cancelLabel,choiceLabel:e.choice?.label??"",chosen:e.choice?.chosen??"",closed:()=>{e.onClosed()},confirm:()=>{e.onConfirm()},confirmLabel:e.confirmLabel,destructive:e.destructive===!0,error:"",hasChoice:e.choice!==void 0,hasField:e.field!==void 0,mono:e.field?.mono===!0,multiline:e.field?.multiline===!0,rows:e.field?.rows??"3",singleLine:e.field!==void 0&&e.field.multiline!==!0?"true":"false",hasMessage:e.message!==void 0&&e.message!=="",headline:e.headline,input:(r)=>{o.value=r,e.onInput?.(r)},invalid:!1,message:e.message??"",options:e.choice?.options??[],pick:(r)=>{e.onPick?.(r)},placeholder:e.field?.placeholder??"",secondary:()=>{e.onSecondary?.()},secondaryLabel:e.secondaryLabel??"",size:e.size??"sm",value:e.field?.value??""}),n=null,a=!1,i=()=>{},s=new Promise((r)=>{i=r}),l=R("dialog",o,t).then(async(r)=>{let c=r.root;if(a)return r.dispose(),c;if(n=r,await Promise.race([An(c),s]),a)return c;if(e.island?.(c.querySelector('[part="island"]')??c),un(c),e.field){let y=c.querySelector("jx-textfield");if(y)setTimeout(()=>{if(!a)Pm(y,e.field?.select??"all")},0)}return c});return{close(){if(a)return;a=!0,i();let r=n?.root;if(r instanceof HTMLElement)rn(r);n?.dispose(),n=null,t.remove()},host:t,ready:l,update(r){if(r.confirmLabel!==void 0)o.confirmLabel=r.confirmLabel;if(r.cancelLabel!==void 0)o.cancelLabel=r.cancelLabel;if(r.secondaryLabel!==void 0)o.secondaryLabel=r.secondaryLabel;if(r.message!==void 0)o.message=r.message,o.hasMessage=r.message!=="";if(r.value!==void 0)o.value=r.value;if(r.placeholder!==void 0)o.placeholder=r.placeholder;if(r.invalid!==void 0)o.invalid=r.invalid;if(r.error!==void 0)if(r.error!==""&&r.error===o.error){o.error="";let c=r.error;queueMicrotask(()=>{o.error=c})}else o.error=r.error;if(r.options!==void 0)o.options=r.options;if(r.chosen!==void 0)o.chosen=r.chosen}}}var re={$schema:"https://jxsuite.com/schema/v1",$id:"StudioToasts",$description:"The toast stack: a rendering of the notification service's toasts, newest last. Each row is projected by ui/layers.ts with its severity glyph and, where a recovery command exists, that command's title and gate; the two buttons call back into the host, which owns the records and their timers.",tagName:"div",attributes:{part:"stack"},style:{position:"absolute",right:"var(--jx-space-4)",bottom:"36px",display:"flex",flexDirection:"column",gap:"var(--jx-space-3)",alignItems:"flex-end",maxWidth:"min(420px, calc(100vw - 24px))",'& [part="toast"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-3)",pointerEvents:"auto",padding:"var(--jx-space-3)",border:"1px solid var(--jx-border)",borderLeft:"3px solid var(--jx-fg-dim)",borderRadius:"var(--jx-radius-md)",background:"var(--jx-bg-panel)",color:"var(--jx-fg)",fontSize:"var(--jx-text-sm)",lineHeight:"var(--jx-leading-sm)",boxShadow:"var(--jx-shadow-popover)"},'& [part="toast"][data-severity="success"]':{borderLeftColor:"var(--jx-success)"},'& [part="toast"][data-severity="info"]':{borderLeftColor:"var(--jx-accent)"},'& [part="toast"][data-severity="warn"]':{borderLeftColor:"var(--jx-warning)"},'& [part="toast"][data-severity="error"]':{borderLeftColor:"var(--jx-danger)"},'& [part="icon"]':{flex:"none",width:"14px",textAlign:"center",fontWeight:"700"},'& [data-severity="success"] [part="icon"]':{color:"var(--jx-success)"},'& [data-severity="info"] [part="icon"]':{color:"var(--jx-accent)"},'& [data-severity="warn"] [part="icon"]':{color:"var(--jx-warning)"},'& [data-severity="error"] [part="icon"]':{color:"var(--jx-danger)"},'& [part="message"]':{flex:"1",minWidth:"0",overflow:"hidden",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"3"},'& [part="action-slot"]':{display:"contents"},'& [part="action"] > [part="control"]':{color:"var(--jx-accent)"}},children:[{$prototype:"Array",items:{$ref:"#/state/toasts"},key:{$ref:"$map/item/id"},map:{tagName:"div",attributes:{part:"toast","data-severity":"${$map.item.severity}"},children:[{tagName:"span",attributes:{part:"icon","aria-hidden":"true"},textContent:"${$map.item.icon}"},{tagName:"span",attributes:{part:"message"},textContent:"${$map.item.message}"},{tagName:"span",attributes:{part:"action-slot",role:"none"},$switch:{$ref:"$map/item/hasAction"},cases:{true:{tagName:"jx-button",$props:{size:"sm",quiet:!0,disabled:{$ref:"$map/item/actionDisabled"}},attributes:{part:"action",title:"${$map.item.actionTitle}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/runAction"},value:[{$ref:"$map/item/id"}]}]},children:[{tagName:"span",textContent:"${$map.item.actionLabel}"}]}}},{tagName:"jx-action-button",$props:{label:"Dismiss notification",hint:"Dismiss notification",icon:"x",size:"sm"},attributes:{part:"dismiss"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/dismissToast"},value:[{$ref:"$map/item/id"}]}]}}]}}]};function $e(e){return e instanceof RangeError||e instanceof Error&&e.name==="CommandUnavailableError"}function on(e,t,o,n=t){let a=(s)=>{if(!$e(s))console.error(`${n}: command "${t}" failed`,s);k.error(te(s),{key:`command.run:${t}`,source:n})},i;try{i=e.run(t,o)}catch(s){return a(s),Promise.resolve()}return Promise.resolve(i).catch(a)}function Rc(e,t,o){let n=ne();return n?on(n,e,t,o):Promise.resolve()}var se,F,q,E;function Ct(e){return(e==="popover"?se:e==="modal"?F:e==="toast"?E:q)||document.body}function mk(){se=document.querySelector("#layer-popover"),F=document.querySelector("#layer-modal"),q=document.querySelector("#layer-dialog"),E=document.querySelector("#layer-toast"),Ce()}var ae="jx-dialog[data-open], dialog[open]";function Am(){return Boolean(q?.querySelector(ae)||F?.querySelector(ae))}function Xo(e,t,o={}){let{confirmLabel:n="Confirm",cancelLabel:a="Cancel",destructive:i=!1}=o;return new Promise((s)=>{let d=!1,l=(c)=>{if(d)return;d=!0,r.close(),s(c)},r=bs({cancelLabel:a,confirmLabel:n,destructive:i,headline:e,layer:Ct("dialog"),...G(t),onCancel:()=>l(!1),onClosed:()=>l(!1),onConfirm:()=>l(!0)})})}function Bx(e,t,o={}){let{saveLabel:n="Save",discardLabel:a="Discard",cancelLabel:i="Cancel"}=o;return new Promise((s)=>{let d=!1,l=(c)=>{if(d)return;d=!0,r.close(),s(c)},r=bs({cancelLabel:i,confirmLabel:n,headline:e,layer:Ct("dialog"),...G(t),onCancel:()=>l("cancel"),onClosed:()=>l("cancel"),onConfirm:()=>l("save"),onSecondary:()=>l("discard"),secondaryLabel:a})})}function G(e){if(typeof e==="string")return{message:e};return{island:(t)=>{Ni(e,t)}}}function Nn(e,t={}){let{cancelLabel:o="Cancel",choice:n,confirmLabel:a="OK",message:i,mono:s=!1,multiline:d=!1,placeholder:l="",rows:r="3",select:c="all",size:y,validate:J,value:le=""}=t,D=(m)=>J?J(m,b):m.trim()?"":"Enter a value.",p=le,b=n?.initial??"",f="",U=!1,z=()=>typeof l==="function"?l():l,W=()=>n?n.options().map((m)=>({label:m.label,value:m.value})):[];return new Promise((m)=>{let V=!1,O=(u)=>{if(V)return;V=!0,N.close(),m(u)},K=(u)=>{f=u,N.update({error:f,invalid:f!==""})},N=bs({cancelLabel:o,confirmLabel:a,headline:e,layer:Ct("dialog"),...i===void 0?{}:G(i),...n?{choice:{chosen:b,label:n.label,options:W()}}:{},field:{mono:s,multiline:d,placeholder:z(),rows:r,select:c,value:p},...y===void 0?{}:{size:y},onCancel:()=>O(null),onClosed:()=>O(null),onConfirm:()=>{let u=D(p);if(u){K(u);return}O(p.trim())},onInput:(u)=>{U=!0,p=u;let x=D(p);if(x!==f)K(x)},onPick:(u)=>{b=u,n?.onChange?.(u);let x=D(p);f=U||f?x:"",N.update({chosen:b,error:f,invalid:f!=="",options:W(),placeholder:z()})}})})}var M=new Map;function vs(e,t){let o=`${e}:${t}`,n=M.get(o);if(n&&n.parentElement)return n;return n=document.createElement("div"),n.style.pointerEvents="auto",n.setAttribute(rt,zt(e,t)),Ct(e).append(n),M.set(o,n),n}function Nm(e,t){let o=`${e}:${t}`,n=M.get(o);if(n)Ni(tt,n),n.remove(),M.delete(o)}var Re=180,Le={error:"✕",info:"ℹ",success:"✓",warn:"!"},C=null,h=new Map,g=new Set;function Te(){return globalThis.matchMedia?.("(prefers-reduced-motion: reduce)").matches===!0}function we(){try{return new URLSearchParams(globalThis.location?.search??"").get("automation")==="1"}catch{return!1}}function gk(){return[...g].map((e)=>`overlay: toast ${e} settling in`)}function _(e){let t=h.get(e);if(t!==void 0)clearTimeout(t),h.delete(e);g.delete(e),Wd(e)}function Ee(e){if(h.has(e.id)||g.has(e.id))return;let t=Te()?0:Re;if(t>0)g.add(e.id),setTimeout(()=>g.delete(e.id),t);let o=e.timeoutMs??0;if(o<=0||we())return;h.set(e.id,setTimeout(()=>_(e.id),o))}T("toasts",re);var I=null,j=null,w=null;function ie(){return I??=v({dismissToast:(e)=>{_(e)},runAction:(e)=>{let t=$c.find((n)=>n.id===e),o=ne();if(!t?.action||!o)return;_(e),on(o,t.action,t.actionArgs,"Notifications")},toasts:[]}),I}function Me(e){let t=e.action===void 0?null:ne(),o=e.action,n=t&&o!==void 0?t.get(o):void 0,a=n&&o!==void 0&&t.isVisible(o)?n:null,i=a&&o!==void 0?t.disabledReason(o):void 0;return{actionDisabled:i!==void 0,actionLabel:a?.title??"",actionTitle:a===null||a===void 0?"":i===void 0?a.title:`${a.title} — requires ${i}`,hasAction:a!==null&&a!==void 0,icon:Le[e.severity],id:e.id,message:e.message,severity:e.severity}}function Ce(){if(je(),!E)return;C=ge(),C.run(()=>{Q(()=>{$c.length,ne();for(let e of $c)Ee(e);ie().toasts=$c.map((e)=>Me(e))})}),j=R("toasts",ie(),E),j.then((e)=>{w=e})}function je(){C?.stop(),C=null;for(let t of h.values())clearTimeout(t);h.clear(),g.clear();let e=j;if(j=null,w)w.dispose(),w=null;else if(e)e.then((t)=>t.dispose());I=null}
|
|
2
|
+
export{cI,dI,pk,rt,Ip,fk,Zi,uI,hI,pI,fI,mI,Iv,zt,T,gI,R,An,bs,on,Rc,Ct,mk,Am,Xo,Bx,Nn,vs,Nm,gk};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
5
|
-
//# sourceMappingURL=studio-
|
|
4
|
+
//# debugId=5235C2EE8A8D6D9864756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-7qvs7v0m.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{qu}from"./studio-x5g1xk77.js";import{gb}from"./studio-xg1942as.js";import{D}from"./studio-tp642n5g.js";function c(){return Object.keys(D?.projectConfig?.content??{})}function Tw(e){let n=gb(e);if(!n)return null;if(/\.[a-z\d]+$/i.test(n.dir))return null;return{def:n.def,dir:n.dir,ext:n.ext,name:n.name,schema:n.def.schema??null}}function cb(){return c().map((e)=>Tw(e)).filter((e)=>e!==null)}function sa(e){let n=qu(e??null,D?.projectConfig);return n?Tw(n.name):null}function u(e){if(e===null||typeof e!=="object")return e;return JSON.parse(JSON.stringify(e))}function l(e){if(typeof e.$ref==="string")return"";switch(e.type){case"boolean":return!1;case"integer":case"number":return 0;case"array":return[];case"object":return y1(e);default:return""}}function y1(e){let n=e?.properties;if(!n)return{};let i=new Set(Array.isArray(e?.required)?e.required:[]),t={};for(let[r,o]of Object.entries(n))if(o.default!==void 0)t[r]=u(o.default);else if(i.has(r))t[r]=l(o);return t}function CE(e,n){return(Array.isArray(e?.required)?e.required:[]).filter((t)=>n[t]===void 0)}
|
|
2
|
+
export{Tw,cb,sa,y1,CE};
|
|
3
|
+
|
|
4
|
+
//# debugId=33EF567F57BD535C64756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-84rtc120.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{_k}from"./studio-cp1gbff9.js";import{T,R,vs,Nm}from"./studio-7qvs7v0m.js";import{v}from"./studio-fqq890ap.js";import{Oe}from"./studio-vavmwshr.js";var w={$schema:"https://jxsuite.com/schema/v1",$id:"StudioMenu",$description:"A Studio menu: one jx-menu whose rows are a projection of command records the adapter hands in as `rows`. Nothing here decides what a row says; a row prints its record's title, chord, disabled reason and destructive flag, a divider falls where the adapter marked a group boundary, and a row with children owns a one-level submenu of the same shape. The chord and the reason are rendered only when present, so a row's text is its title.",tagName:"jx-menu",$props:{label:{$ref:"#/state/label"},x:{$ref:"#/state/x"},y:{$ref:"#/state/y"},floor:{$ref:"#/state/floor"},placement:{$ref:"#/state/placement"}},onselect:{$ref:"#/state/select"},children:[{$prototype:"Array",items:{$ref:"#/state/rows"},key:{$ref:"$map/item/id"},map:{tagName:"div",attributes:{role:"none"},children:[{tagName:"div",attributes:{role:"none"},$switch:{$ref:"$map/item/dividerAbove"},cases:{true:{tagName:"hr"}}},{tagName:"jx-menu-item",$props:{value:{$ref:"$map/item/id"},disabled:{$ref:"$map/item/disabled"},destructive:{$ref:"$map/item/destructive"},requires:{$ref:"$map/item/requires"},checked:{$ref:"$map/item/checked"},haspopup:{$ref:"$map/item/haspopup"}},attributes:{"data-command-id":"${$map.item.id}"},children:[{tagName:"span",textContent:"${$map.item.title}"},{tagName:"span",attributes:{slot:"value"},$switch:{$ref:"$map/item/noChord"},cases:{false:{tagName:"kbd",textContent:"${$map.item.chord}"}}},{tagName:"span",attributes:{slot:"description"},$switch:{$ref:"$map/item/enabled"},cases:{false:{tagName:"span",textContent:"Needs ${$map.item.requires}"}}},{tagName:"span",attributes:{slot:"submenu"},$switch:{$ref:"$map/item/haspopup"},cases:{true:{tagName:"jx-menu",$props:{label:{$ref:"$map/item/submenuLabel"}},children:[{$prototype:"Array",items:{$ref:"$map/item/children"},key:{$ref:"$map/item/id"},map:{tagName:"div",attributes:{role:"none"},children:[{tagName:"div",attributes:{role:"none"},$switch:{$ref:"$map/item/dividerAbove"},cases:{true:{tagName:"hr"}}},{tagName:"jx-menu-item",$props:{value:{$ref:"$map/item/id"},disabled:{$ref:"$map/item/disabled"},destructive:{$ref:"$map/item/destructive"},requires:{$ref:"$map/item/requires"},checked:{$ref:"$map/item/checked"}},attributes:{"data-command-id":"${$map.item.id}"},children:[{tagName:"span",textContent:"${$map.item.title}"},{tagName:"span",attributes:{slot:"value"},$switch:{$ref:"$map/item/noChord"},cases:{false:{tagName:"kbd",textContent:"${$map.item.chord}"}}},{tagName:"span",attributes:{slot:"description"},$switch:{$ref:"$map/item/enabled"},cases:{false:{tagName:"span",textContent:"Needs ${$map.item.requires}"}}}]}]}}]}}}]}]}}]};T("menu",w);var M="block-end span-inline-end";function j(e){if(e.placement!==void 0)return e.placement;return e.opener&&!e.origin&&!e.place&&!e.floor?M:""}function E(e){if(!e)return{x:0,y:0};let n=Oe(e);return{x:Math.round(n.left),y:Math.round(n.bottom)}}function p(e,n=0){let r=n===0?(e.children??[]).map((t)=>p(t,1)):[];return{...e,checked:e.checked??"",children:r,chord:e.chord??"",enabled:!e.disabled,haspopup:r.length>0,noChord:!e.chord,noDivider:!e.dividerAbove,requires:e.requires??"",submenuLabel:e.submenuLabel??e.title}}function N(e,n){for(let r of e){if(r.id===n)return r;let t=r.children.find((d)=>d.id===n);if(t)return t}return}var L={bottom:0,height:0,left:0,right:0,top:0,width:0,x:0,y:0};function Nt(e){let n=vs("popover",e.region),r=new AbortController,t=null,d=null,i=!1,f=()=>{if(i)return;i=!0,r.abort(),d?.(),d=null,Nm("popover",e.region),P(e.opener??null),e.onClosed?.(u)},h=e.place?e.place(L):e.origin??E(e.opener),l=v({floor:e.floor?.()??0,label:e.label,placement:j(e),rows:e.rows.map((o)=>p(o)),select:(o,m)=>{let a=String(m.detail),s=N(l.rows,a);if(!s)return;if(s.run)s.run();else e.run?.(a);u.close()},x:h.x,y:h.y}),b=()=>{if(i||!t||!e.place)return;let o=e.place(Oe(t));l.x=o.x,l.y=o.y},y=(async()=>{let o=await R("menu",l,n,{signal:r.signal});if(r.signal.aborted)return;if({dispose:d}=o,t=o.root,t.addEventListener("toggle",(a)=>{if(a.newState==="closed")f()}),!t.hasAttribute("popover"))await new Promise((a)=>{t.addEventListener("jx-ready",()=>a(),{once:!0})});if(r.signal.aborted)return;let m=e.opener instanceof HTMLElement&&e.opener!==document.body?e.opener:void 0;t.showPopover(m?{source:m}:void 0),b(),requestAnimationFrame(b)})(),u={close:()=>{if(i)return;if(t?.open)t.hidePopover();f()},host:n,ready:y,setRows:(o)=>{if(i)return;let a=document.activeElement?.closest("jx-menu"),s=a&&a!==t?a.parentElement?.closest("jx-menu-item")?.dataset.commandId:void 0;l.rows=o.map((c)=>p(c)),setTimeout(()=>{if(i||!t||t.contains(document.activeElement))return;let c=s?t.querySelector(`jx-menu-item[data-command-id="${s}"]`):null,g=c?.querySelector("jx-menu")??null;if(c&&!(g?.open&&g.querySelector("jx-menu-item")))c.focus();else _k(t)},0)}};return u}function P(e){let n=document.activeElement;if(e?.isConnected&&(!n||n===document.body))e.focus()}
|
|
2
|
+
export{Nt};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
5
|
-
//# sourceMappingURL=studio-
|
|
4
|
+
//# debugId=78207AFC52B59A5764756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-8xcwewjq.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{p}from"./studio-
|
|
1
|
+
import{p}from"./studio-y7jehjrp.js";import{lp}from"./studio-bftp4n4b.js";import{ge,Q,v,Hm}from"./studio-fqq890ap.js";import{ne}from"./studio-cp1gbff9.js";import{T,R}from"./studio-7qvs7v0m.js";import{Bi,y}from"./studio-4m50vh74.js";import{D}from"./studio-tp642n5g.js";function k({slug:e,adapter:t}){let o=new Date().toISOString().slice(0,10);return`${JSON.stringify(t==="cloudflare-workers"?{assets:{binding:"ASSETS",directory:"./dist"},compatibility_date:o,compatibility_flags:["nodejs_compat"],main:"./dist/worker.js",name:e}:{compatibility_date:o,compatibility_flags:["nodejs_compat"],name:e,pages_build_output_dir:"./dist"},null,"\t")}
|
|
2
2
|
`}function m(e,{slug:t,adapter:o}){if(!e)return{content:k({adapter:o,slug:t}),patched:!0};let n;try{n=JSON.parse(e)}catch{return{content:e,patched:!1}}if(n.name=t,o==="cloudflare-workers")delete n.pages_build_output_dir,n.main="./dist/worker.js",n.assets={binding:"ASSETS",directory:"./dist"};else delete n.main,delete n.assets,n.pages_build_output_dir="./dist";return{content:`${JSON.stringify(n,null,"\t")}
|
|
3
|
-
`,patched:!0}}function gd(){try{return typeof p().cfApi==="function"}catch{return!1}}async function l(e,t){let o=p().cfApi;if(!o)throw Error("This platform cannot reach the Cloudflare API");try{return await o(e,t)}catch(n){throw lp(n),n}}async function oT(){return l("/accounts")}async function j(e,t){try{return await l(`/accounts/${e}/pages/projects/${t}`)}catch{return null}}async function C(e){return l(`/accounts/${e.accountId}/pages/projects`,{method:"POST",body:{name:e.projectName,production_branch:e.productionBranch,build_config:{build_command:"bunx jx build",destination_dir:"dist"},source:{type:"github",config:{owner:e.owner,repo_name:e.repo,production_branch:e.productionBranch,deployments_enabled:!0}}}})}async function em(e){let t=await l(`/accounts/${e.accountId}/pages/projects/${e.projectName}/deployments`),[o]=t;if(!o)return null;return{id:o.id,url:o.url,environment:o.environment,stage:o.latest_stage?.name??"unknown",status:o.latest_stage?.status??"unknown",createdOn:o.created_on}}async function j1(e,t){let o={...e.build};if(t===null)delete o.deploy;else o.deploy=t;if(await zi({build:o}),t!==null){let n=p(),i=null;try{i=await n.readFile("wrangler.jsonc")}catch{i=null}let w=o.adapter==="cloudflare-workers"?"cloudflare-workers":"cloudflare-pages",{content:x,patched:S}=m(i,{adapter:w,slug:t.projectName});if(S)await n.writeFile("wrangler.jsonc",x)}}async function rT(e,t){let n=await j(t.accountId,t.projectName)??await C(t),i={provider:"cloudflare-pages",accountId:t.accountId,projectName:t.projectName,...n.subdomain?{productionUrl:`https://${n.subdomain}`}:{}};return await j1(e,i),i}var h={$schema:"https://jxsuite.com/schema/v1",$id:"StudioPanelDeployChecklist",$description:"The deploy checklist, drawn above the Activity feed in the Bottom dock's Activity tab: what is MISSING before this project can ship, as one row with the chain of prerequisites under it. `publish/deploy-checklist.ts` owns the chain — which link is forged, which is merely unasked, and which command forges the next one — and hands this document a row, four steps and at most one action. Nothing here reads source control, the project config or the command registry. It draws in the Activity tab's own vocabulary because a deploy is an ordered list of stages that finish, which is exactly what a row of that feed already is; a fifth visual idiom for it would be a second design of a thing the tab has.",tagName:"div",attributes:{part:"checklist"},style:{$description:"What `.activity-list`, `.activity-row`, `.activity-row--running`, `.activity-row--done`, `.activity-icon`, `.activity-body`, `.activity-head`, `.activity-title`, `.activity-source`, `.activity-status`, `.activity-steps`, `.activity-step`, `.activity-step--done` and `.activity-step-icon` said in `styles/panels.css`, keyed on `part`. This is the LAST reader of those rules — `surfaces/panel-activity.json` carried its own copy when the feed converted, and left the stylesheet standing because this file still drew from it — so the whole `.problem-*, .activity-*` block is dead once this lands. Three token names could not travel: `--spectrum-font-size-50`, `--spectrum-font-size-75` and `--spectrum-corner-radius-75` resolve only inside `<sp-theme>`, and a document mounted into the dock body is outside it, so each would silently have taken its hard-coded px fallback. They are the kit's own scale here. One thing changed meaning on purpose: the step's `data-state` is the checklist's own three-valued state rather than the two CSS classes it used to collapse into, so `unknown` — \"nobody has asked\" — is a state the styling can tell apart from `todo` the day it should.",display:"block",minWidth:"0",fontFamily:"var(--jx-font-sans)",color:"var(--fg)",'& [part="list"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-1)",margin:"0",padding:"0",listStyle:"none"},'& [part="row"]':{$description:"The left border is the state, at 3px, which is the one thing that must be legible without reading the row. Its default is the dim foreground so a state nobody has a colour for still draws a border rather than a gap.",display:"flex",alignItems:"flex-start",gap:"var(--jx-space-2)",padding:"6px var(--jx-space-2)",border:"1px solid var(--border)",borderLeft:"3px solid var(--fg-dim)",borderRadius:"var(--radius)",background:"var(--bg-panel)",color:"var(--fg)",fontSize:"var(--jx-text-md)"},'& [part="row"][data-state="running"]':{borderLeftColor:"var(--accent)"},'& [part="row"][data-state="done"]':{borderLeftColor:"var(--success)"},'& [part="state-icon"]':{$description:'Named `state-icon` rather than `icon`: `jx-button` puts `part="icon"` on the glyph slot of every button it draws, and the action button below is inside this same light-DOM tree — a rule on the bare name would reach into the kit\'s own drawing and a devtools query could not tell the two apart.',flex:"none",width:"14px",textAlign:"center",fontWeight:"700",lineHeight:"1.5"},'& [part="row"][data-state="running"] > [part="state-icon"]':{color:"var(--accent)"},'& [part="row"][data-state="done"] > [part="state-icon"]':{color:"var(--success)"},'& [part="row-body"]':{flex:"1",minWidth:"0",display:"flex",flexDirection:"column",alignItems:"flex-start",gap:"2px"},'& [part="head"]':{display:"flex",alignItems:"baseline",gap:"var(--jx-space-2)",alignSelf:"stretch",minWidth:"0"},'& [part="row-title"]':{fontWeight:"700",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},'& [part="source"]':{$description:"Pushed to the far edge, so the tab reads as a column of who raised what.",flex:"none",marginLeft:"auto",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"},'& [part="summary"]':{color:"var(--fg-dim)",overflowWrap:"anywhere"},'& [part="steps"]':{$description:'The chain, declared up front, so "which link is missing" is answered by looking rather than by reading the summary and remembering what came before it.',display:"flex",flexDirection:"column",gap:"1px",margin:"2px 0 0",padding:"0",listStyle:"none",fontSize:"var(--jx-text-sm)"},'& [part="step"]':{display:"flex",gap:"6px",color:"var(--fg-dim)"},'& [part="step"][data-state="done"] > [part="step-icon"]':{color:"var(--success)"},'& [part="step-icon"]':{flex:"none",width:"10px",textAlign:"center"},'& [part="action"]':{marginTop:"var(--jx-space-1)"}},children:[{tagName:"div",attributes:{part:"body-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasProject"},cases:{true:{tagName:"ul",attributes:{part:"list"},children:[{tagName:"li",attributes:{part:"row","data-state":"${state.rowState}"},children:[{tagName:"span",attributes:{part:"state-icon","aria-hidden":"true"},textContent:"${state.rowIcon}"},{tagName:"div",attributes:{part:"row-body"},children:[{tagName:"div",attributes:{part:"head"},children:[{tagName:"span",attributes:{part:"row-title"},textContent:"Deploy checklist"},{tagName:"span",attributes:{part:"source"},textContent:"Publish"}]},{tagName:"div",attributes:{part:"summary"},textContent:"${state.summary}"},{tagName:"ol",attributes:{part:"steps"},children:[{$prototype:"Array",items:{$ref:"#/state/steps"},key:{$ref:"$map/item/id"},map:{tagName:"li",attributes:{part:"step","data-step":"${$map.item.id}","data-state":"${$map.item.state}"},children:[{tagName:"span",attributes:{part:"step-icon","aria-hidden":"true"},textContent:"${$map.item.icon}"},{tagName:"span",attributes:{part:"step-text"},textContent:"${$map.item.text}"}]}}]},{tagName:"span",attributes:{part:"action-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasAction"},cases:{true:{tagName:"jx-button",$description:"The recovery button wears the command's own title, so it reads as a verb rather than as a decoration, and a refused command is dimmed with the reason it names in its tooltip. A command the registry does not have, or whose `when` is false, draws NOTHING rather than a dead label — a surface may choose whether to show a command, never whether it exists (§13).",$props:{size:"sm",disabled:{$ref:"#/state/actionDisabled"}},attributes:{part:"action",title:"${state.actionTitle}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/runAction"},value:[]}]},children:[{tagName:"span",textContent:"${state.actionLabel}"}]}}}]}]}]}}}]};T("panel-deploy-checklist",h);var d=null,c=null,a=null,r=null;function A(e,t){e.hasProject=t.hasProject,e.rowState=t.rowState,e.rowIcon=t.rowIcon,e.summary=t.summary,e.steps=t.steps,e.hasAction=t.hasAction,e.actionLabel=t.actionLabel,e.actionTitle=t.actionTitle,e.actionDisabled=t.actionDisabled}function N(e){if(d!==e)return!1;return r===null?a!==null:r.root.parentNode===e}function f(e,t){if(N(e))return;u(),d=e;let o=v({actionDisabled:!1,actionLabel:"",actionTitle:"",hasAction:!1,hasProject:!1,rowIcon:"",rowState:"running",runAction:t.runAction,steps:[],summary:""});c=ge(),c.run(()=>{Q(()=>{A(o,t.project())})});let n=R("panel-deploy-checklist",o,e);a=n,n.then((i)=>{if(a===n)r=i;else i.dispose()})}function u(){c?.stop(),c=null;let e=a;if(a=null,r)r.dispose(),r=null;else if(e)e.then((t)=>t.dispose());d=null}function I(){return D?.projectConfig??null}function ca(){return I()?.build?.deploy}var s=Wm({asked:!1,observed:null});function rp(e){s.observed=e,s.asked=!0}function _(){let{status:e}=y.git;if(e===null)return{command:"git.init",detail:"Source control has not reported on this project yet.",id:"repo",label:"Track this project with git",state:"unknown"};return e.isRepo?{command:"git.init",detail:`Tracked${e.branch?` — on branch ${e.branch}`:""}.`,id:"repo",label:"Track this project with git",state:"done"}:{command:"git.init",detail:"A deploy ships what the repository holds, so the repository comes first.",id:"repo",label:"Track this project with git",state:"todo"}}function L(){let{status:e}=y.git;if(e===null||!e.isRepo)return{command:"git.createGithubRepository",detail:"A remote is where the provider builds from.",id:"remote",label:"Push to a remote",state:e===null?"unknown":"todo"};if((e.remotes??[]).length===0)return{command:"git.createGithubRepository",detail:"This repository is local only — nothing outside this machine can build it.",id:"remote",label:"Push to a remote",state:"todo"};return e.ahead>0?{command:"git.push",detail:`${e.ahead} commit(s) are not on ${e.remotes[0]} yet, so a build would ship the older tree.`,id:"remote",label:"Push to a remote",state:"todo"}:{command:"git.push",detail:`Up to date with ${e.remotes[0]}.`,id:"remote",label:"Push to a remote",state:"done"}}function O(){let e=ca();if(e)return{command:"publish.setUp",detail:`Cloudflare Pages project ${e.projectName}.`,id:"provider",label:"Connect a deploy provider",state:"done"};return gd()?{command:"publish.setUp",detail:"Connecting one makes every commit build and publish on its own.",id:"provider",label:"Connect a deploy provider",state:"todo"}:{command:"publish.setUp",detail:"This platform cannot reach the Cloudflare API. Commit and push instead — your host "+"runs bunx jx build and serves dist/.",id:"provider",label:"Connect a deploy provider",state:"unknown"}}function E(){if(!ca())return{command:"publish.deploy",detail:"Nothing has been deployed, because no provider is connected.",id:"deployed",label:"Deploy",state:"todo"};if(!s.asked)return{command:"publish.deploy",detail:"Cloudflare has not been asked yet, so this is not a claim that nothing shipped.",id:"deployed",label:"Deploy",state:"unknown"};if(s.observed===null)return{command:"publish.deploy",detail:"Cloudflare reports no deployments for this project.",id:"deployed",label:"Deploy",state:"todo"};let{observed:e}=s;return e.status==="success"?{command:"publish.deploy",detail:`${e.environment} — ${e.url}`,id:"deployed",label:"Deploy",state:"done"}:{command:"publish.deploy",detail:`Last deployment ${e.stage}: ${e.status}.`,id:"deployed",label:"Deploy",state:"todo"}}function g(){return[_(),L(),O(),E()]}function b(){return g().find((e)=>e.state!=="done")??null}function sT(){if(!D)return null;let e=b();if(e)return{command:e.command,label:e.label,title:e.detail};return{command:"publish.openDashboard",label:"Deployed",title:ca()?.productionUrl??"Everything this project needs to ship is in place."}}var W={done:"✓",todo:"·",unknown:"?"};function V(e){return{icon:W[e.state],id:e.id,state:e.state,text:e.state==="done"?e.label:`${e.label} — ${e.detail}`}}function H(e){let t={actionDisabled:!1,actionLabel:"",actionTitle:"",hasAction:!1};if(!e)return t;let o=ne(),n=o?.get(e.command);if(!o||!n||!o.isVisible(e.command))return t;let i=o.disabledReason(e.command);return{actionDisabled:i!==void 0,actionLabel:n.title,actionTitle:i?`${n.title} — requires ${i}`:n.title,hasAction:!0}}function J(){if(!D)return{actionDisabled:!1,actionLabel:"",actionTitle:"",hasAction:!1,hasProject:!1,rowIcon:"",rowState:"running",steps:[],summary:""};let e=g(),t=e.find((o)=>o.state!=="done")??null;return{...H(t),hasProject:!0,rowIcon:t?"⋯":"✓",rowState:t?"running":"done",steps:e.map((o)=>V(o)),summary:t?t.detail:"Everything this project needs to ship is in place."}}function B(){let e=b();if(!e)return;ne()?.run(e.command)}var F={project:J,runAction:B};function aT(e){let t=e.querySelector("[data-deploy-checklist]");if(!t){u();return}f(t,F)}
|
|
4
|
-
export{gd,
|
|
3
|
+
`,patched:!0}}function gd(){try{return typeof p().cfApi==="function"}catch{return!1}}async function l(e,t){let o=p().cfApi;if(!o)throw Error("This platform cannot reach the Cloudflare API");try{return await o(e,t)}catch(n){throw lp(n),n}}async function YE(){return l("/accounts")}async function j(e,t){try{return await l(`/accounts/${e}/pages/projects/${t}`)}catch{return null}}async function C(e){return l(`/accounts/${e.accountId}/pages/projects`,{method:"POST",body:{name:e.projectName,production_branch:e.productionBranch,build_config:{build_command:"bunx jx build",destination_dir:"dist"},source:{type:"github",config:{owner:e.owner,repo_name:e.repo,production_branch:e.productionBranch,deployments_enabled:!0}}}})}async function Zf(e){let t=await l(`/accounts/${e.accountId}/pages/projects/${e.projectName}/deployments`),[o]=t;if(!o)return null;return{id:o.id,url:o.url,environment:o.environment,stage:o.latest_stage?.name??"unknown",status:o.latest_stage?.status??"unknown",createdOn:o.created_on}}async function P1(e,t){let o={...e.build};if(t===null)delete o.deploy;else o.deploy=t;if(await Bi({build:o}),t!==null){let n=p(),i=null;try{i=await n.readFile("wrangler.jsonc")}catch{i=null}let w=o.adapter==="cloudflare-workers"?"cloudflare-workers":"cloudflare-pages",{content:x,patched:S}=m(i,{adapter:w,slug:t.projectName});if(S)await n.writeFile("wrangler.jsonc",x)}}async function ZE(e,t){let n=await j(t.accountId,t.projectName)??await C(t),i={provider:"cloudflare-pages",accountId:t.accountId,projectName:t.projectName,...n.subdomain?{productionUrl:`https://${n.subdomain}`}:{}};return await P1(e,i),i}var h={$schema:"https://jxsuite.com/schema/v1",$id:"StudioPanelDeployChecklist",$description:"The deploy checklist, drawn above the Activity feed in the Bottom dock's Activity tab: what is MISSING before this project can ship, as one row with the chain of prerequisites under it. `publish/deploy-checklist.ts` owns the chain — which link is forged, which is merely unasked, and which command forges the next one — and hands this document a row, four steps and at most one action. Nothing here reads source control, the project config or the command registry. It draws in the Activity tab's own vocabulary because a deploy is an ordered list of stages that finish, which is exactly what a row of that feed already is; a fifth visual idiom for it would be a second design of a thing the tab has.",tagName:"div",attributes:{part:"checklist"},style:{$description:"What `.activity-list`, `.activity-row`, `.activity-row--running`, `.activity-row--done`, `.activity-icon`, `.activity-body`, `.activity-head`, `.activity-title`, `.activity-source`, `.activity-status`, `.activity-steps`, `.activity-step`, `.activity-step--done` and `.activity-step-icon` said in `styles/panels.css`, keyed on `part`. This is the LAST reader of those rules — `surfaces/panel-activity.json` carried its own copy when the feed converted, and left the stylesheet standing because this file still drew from it — so the whole `.problem-*, .activity-*` block is dead once this lands. Three token names could not travel: `--spectrum-font-size-50`, `--spectrum-font-size-75` and `--spectrum-corner-radius-75` resolve only inside `<sp-theme>`, and a document mounted into the dock body is outside it, so each would silently have taken its hard-coded px fallback. They are the kit's own scale here. One thing changed meaning on purpose: the step's `data-state` is the checklist's own three-valued state rather than the two CSS classes it used to collapse into, so `unknown` — \"nobody has asked\" — is a state the styling can tell apart from `todo` the day it should.",display:"block",minWidth:"0",fontFamily:"var(--jx-font-sans)",color:"var(--fg)",'& [part="list"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-1)",margin:"0",padding:"0",listStyle:"none"},'& [part="row"]':{$description:"The left border is the state, at 3px, which is the one thing that must be legible without reading the row. Its default is the dim foreground so a state nobody has a colour for still draws a border rather than a gap.",display:"flex",alignItems:"flex-start",gap:"var(--jx-space-2)",padding:"6px var(--jx-space-2)",border:"1px solid var(--border)",borderLeft:"3px solid var(--fg-dim)",borderRadius:"var(--radius)",background:"var(--bg-panel)",color:"var(--fg)",fontSize:"var(--jx-text-md)"},'& [part="row"][data-state="running"]':{borderLeftColor:"var(--accent)"},'& [part="row"][data-state="done"]':{borderLeftColor:"var(--success)"},'& [part="state-icon"]':{$description:'Named `state-icon` rather than `icon`: `jx-button` puts `part="icon"` on the glyph slot of every button it draws, and the action button below is inside this same light-DOM tree — a rule on the bare name would reach into the kit\'s own drawing and a devtools query could not tell the two apart.',flex:"none",width:"14px",textAlign:"center",fontWeight:"700",lineHeight:"1.5"},'& [part="row"][data-state="running"] > [part="state-icon"]':{color:"var(--accent)"},'& [part="row"][data-state="done"] > [part="state-icon"]':{color:"var(--success)"},'& [part="row-body"]':{flex:"1",minWidth:"0",display:"flex",flexDirection:"column",alignItems:"flex-start",gap:"2px"},'& [part="head"]':{display:"flex",alignItems:"baseline",gap:"var(--jx-space-2)",alignSelf:"stretch",minWidth:"0"},'& [part="row-title"]':{fontWeight:"700",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},'& [part="source"]':{$description:"Pushed to the far edge, so the tab reads as a column of who raised what.",flex:"none",marginLeft:"auto",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"},'& [part="summary"]':{color:"var(--fg-dim)",overflowWrap:"anywhere"},'& [part="steps"]':{$description:'The chain, declared up front, so "which link is missing" is answered by looking rather than by reading the summary and remembering what came before it.',display:"flex",flexDirection:"column",gap:"1px",margin:"2px 0 0",padding:"0",listStyle:"none",fontSize:"var(--jx-text-sm)"},'& [part="step"]':{display:"flex",gap:"6px",color:"var(--fg-dim)"},'& [part="step"][data-state="done"] > [part="step-icon"]':{color:"var(--success)"},'& [part="step-icon"]':{flex:"none",width:"10px",textAlign:"center"},'& [part="action"]':{marginTop:"var(--jx-space-1)"}},children:[{tagName:"div",attributes:{part:"body-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasProject"},cases:{true:{tagName:"ul",attributes:{part:"list"},children:[{tagName:"li",attributes:{part:"row","data-state":"${state.rowState}"},children:[{tagName:"span",attributes:{part:"state-icon","aria-hidden":"true"},textContent:"${state.rowIcon}"},{tagName:"div",attributes:{part:"row-body"},children:[{tagName:"div",attributes:{part:"head"},children:[{tagName:"span",attributes:{part:"row-title"},textContent:"Deploy checklist"},{tagName:"span",attributes:{part:"source"},textContent:"Publish"}]},{tagName:"div",attributes:{part:"summary"},textContent:"${state.summary}"},{tagName:"ol",attributes:{part:"steps"},children:[{$prototype:"Array",items:{$ref:"#/state/steps"},key:{$ref:"$map/item/id"},map:{tagName:"li",attributes:{part:"step","data-step":"${$map.item.id}","data-state":"${$map.item.state}"},children:[{tagName:"span",attributes:{part:"step-icon","aria-hidden":"true"},textContent:"${$map.item.icon}"},{tagName:"span",attributes:{part:"step-text"},textContent:"${$map.item.text}"}]}}]},{tagName:"span",attributes:{part:"action-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasAction"},cases:{true:{tagName:"jx-button",$description:"The recovery button wears the command's own title, so it reads as a verb rather than as a decoration, and a refused command is dimmed with the reason it names in its tooltip. A command the registry does not have, or whose `when` is false, draws NOTHING rather than a dead label — a surface may choose whether to show a command, never whether it exists (§13).",$props:{size:"sm",disabled:{$ref:"#/state/actionDisabled"}},attributes:{part:"action",title:"${state.actionTitle}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/runAction"},value:[]}]},children:[{tagName:"span",textContent:"${state.actionLabel}"}]}}}]}]}]}}}]};T("panel-deploy-checklist",h);var d=null,c=null,a=null,r=null;function A(e,t){e.hasProject=t.hasProject,e.rowState=t.rowState,e.rowIcon=t.rowIcon,e.summary=t.summary,e.steps=t.steps,e.hasAction=t.hasAction,e.actionLabel=t.actionLabel,e.actionTitle=t.actionTitle,e.actionDisabled=t.actionDisabled}function N(e){if(d!==e)return!1;return r===null?a!==null:r.root.parentNode===e}function f(e,t){if(N(e))return;u(),d=e;let o=v({actionDisabled:!1,actionLabel:"",actionTitle:"",hasAction:!1,hasProject:!1,rowIcon:"",rowState:"running",runAction:t.runAction,steps:[],summary:""});c=ge(),c.run(()=>{Q(()=>{A(o,t.project())})});let n=R("panel-deploy-checklist",o,e);a=n,n.then((i)=>{if(a===n)r=i;else i.dispose()})}function u(){c?.stop(),c=null;let e=a;if(a=null,r)r.dispose(),r=null;else if(e)e.then((t)=>t.dispose());d=null}function I(){return D?.projectConfig??null}function ca(){return I()?.build?.deploy}var s=Hm({asked:!1,observed:null});function rp(e){s.observed=e,s.asked=!0}function _(){let{status:e}=y.git;if(e===null)return{command:"git.init",detail:"Source control has not reported on this project yet.",id:"repo",label:"Track this project with git",state:"unknown"};return e.isRepo?{command:"git.init",detail:`Tracked${e.branch?` — on branch ${e.branch}`:""}.`,id:"repo",label:"Track this project with git",state:"done"}:{command:"git.init",detail:"A deploy ships what the repository holds, so the repository comes first.",id:"repo",label:"Track this project with git",state:"todo"}}function L(){let{status:e}=y.git;if(e===null||!e.isRepo)return{command:"git.createGithubRepository",detail:"A remote is where the provider builds from.",id:"remote",label:"Push to a remote",state:e===null?"unknown":"todo"};if((e.remotes??[]).length===0)return{command:"git.createGithubRepository",detail:"This repository is local only — nothing outside this machine can build it.",id:"remote",label:"Push to a remote",state:"todo"};return e.ahead>0?{command:"git.push",detail:`${e.ahead} commit(s) are not on ${e.remotes[0]} yet, so a build would ship the older tree.`,id:"remote",label:"Push to a remote",state:"todo"}:{command:"git.push",detail:`Up to date with ${e.remotes[0]}.`,id:"remote",label:"Push to a remote",state:"done"}}function O(){let e=ca();if(e)return{command:"publish.setUp",detail:`Cloudflare Pages project ${e.projectName}.`,id:"provider",label:"Connect a deploy provider",state:"done"};return gd()?{command:"publish.setUp",detail:"Connecting one makes every commit build and publish on its own.",id:"provider",label:"Connect a deploy provider",state:"todo"}:{command:"publish.setUp",detail:"This platform cannot reach the Cloudflare API. Commit and push instead — your host "+"runs bunx jx build and serves dist/.",id:"provider",label:"Connect a deploy provider",state:"unknown"}}function E(){if(!ca())return{command:"publish.deploy",detail:"Nothing has been deployed, because no provider is connected.",id:"deployed",label:"Deploy",state:"todo"};if(!s.asked)return{command:"publish.deploy",detail:"Cloudflare has not been asked yet, so this is not a claim that nothing shipped.",id:"deployed",label:"Deploy",state:"unknown"};if(s.observed===null)return{command:"publish.deploy",detail:"Cloudflare reports no deployments for this project.",id:"deployed",label:"Deploy",state:"todo"};let{observed:e}=s;return e.status==="success"?{command:"publish.deploy",detail:`${e.environment} — ${e.url}`,id:"deployed",label:"Deploy",state:"done"}:{command:"publish.deploy",detail:`Last deployment ${e.stage}: ${e.status}.`,id:"deployed",label:"Deploy",state:"todo"}}function g(){return[_(),L(),O(),E()]}function b(){return g().find((e)=>e.state!=="done")??null}function XE(){if(!D)return null;let e=b();if(e)return{command:e.command,label:e.label,title:e.detail};return{command:"publish.openDashboard",label:"Deployed",title:ca()?.productionUrl??"Everything this project needs to ship is in place."}}var W={done:"✓",todo:"·",unknown:"?"};function V(e){return{icon:W[e.state],id:e.id,state:e.state,text:e.state==="done"?e.label:`${e.label} — ${e.detail}`}}function H(e){let t={actionDisabled:!1,actionLabel:"",actionTitle:"",hasAction:!1};if(!e)return t;let o=ne(),n=o?.get(e.command);if(!o||!n||!o.isVisible(e.command))return t;let i=o.disabledReason(e.command);return{actionDisabled:i!==void 0,actionLabel:n.title,actionTitle:i?`${n.title} — requires ${i}`:n.title,hasAction:!0}}function J(){if(!D)return{actionDisabled:!1,actionLabel:"",actionTitle:"",hasAction:!1,hasProject:!1,rowIcon:"",rowState:"running",steps:[],summary:""};let e=g(),t=e.find((o)=>o.state!=="done")??null;return{...H(t),hasProject:!0,rowIcon:t?"⋯":"✓",rowState:t?"running":"done",steps:e.map((o)=>V(o)),summary:t?t.detail:"Everything this project needs to ship is in place."}}function B(){let e=b();if(!e)return;ne()?.run(e.command)}var F={project:J,runAction:B};function QE(e){let t=e.querySelector("[data-deploy-checklist]");if(!t){u();return}f(t,F)}
|
|
4
|
+
export{gd,YE,Zf,P1,ZE,ca,rp,XE,QE};
|
|
5
5
|
|
|
6
|
-
//# debugId=
|
|
7
|
-
//# sourceMappingURL=studio-
|
|
6
|
+
//# debugId=32A006FBA9B78D4764756E2164756E21
|
|
7
|
+
//# sourceMappingURL=studio-aekhcdzw.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
function
|
|
2
|
-
export{
|
|
1
|
+
function Zy(o){if(o===null||typeof o!=="object")return{offer:[],refused:null};let e=o;if(e.collab===!1){let t=typeof e.detail==="string"?e.detail.trim():"";return{offer:[],refused:t||"This server has collaboration disabled."}}let{protocols:r}=e;if(!Array.isArray(r)||r.length===0)return{offer:[],refused:null};if(r.includes("jx.collab.v1"))return{offer:["jx.collab.v1"],refused:null};let n=r.filter((t)=>typeof t==="string").join(", ")||"none";return{offer:[],refused:`This server speaks collab envelope ${n}; this editor speaks jx.collab.v1.`}}
|
|
2
|
+
export{Zy};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
5
|
-
//# sourceMappingURL=studio-
|
|
4
|
+
//# debugId=9E2F4DC69B554C8964756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-aje966s9.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-7qvs7v0m.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-bftp4n4b.js.map
|