@jxsuite/studio 5.5.0 → 5.6.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/LICENSE +1 -1
- package/dist/chunks/{2020-g8mwpbkq.js → 2020-zvax9fmb.js} +3 -3
- package/dist/chunks/adapter-6zhjbpmd.js +4 -0
- package/dist/chunks/cf-account-picker-zfycs4k2.js +4 -0
- package/dist/chunks/cf-settings-fpa485q3.js +4 -0
- package/dist/chunks/components-b0vh4sq8.js +4 -0
- package/dist/chunks/content-source-z5t0d0h9.js +4 -0
- package/dist/chunks/convert-to-repeater-x19jr6c7.js +4 -0
- package/dist/chunks/editor-7e23n4a8.js +4 -0
- package/dist/chunks/entry-commands-5cm6aba2.js +4 -0
- package/dist/chunks/extension-sections-y90sa0n4.js +4 -0
- package/dist/chunks/file-ops-hv7gf757.js +4 -0
- package/dist/chunks/files-kb0epdxf.js +4 -0
- package/dist/chunks/format-host-eg1wy2bp.js +4 -0
- package/dist/chunks/fs-events-ky3vxfmh.js +4 -0
- package/dist/chunks/git-panel-yyg3bzp2.js +4 -0
- package/dist/chunks/grid-view-5mqv1cbd.css +1 -0
- package/dist/chunks/grid-view-d9mybhn0.js +51 -0
- package/dist/chunks/iframe-host-9wdf0hes.js +4 -0
- package/dist/chunks/index-2tf0m2ne.js +4 -0
- package/dist/chunks/{index-arg188jq.js → index-vnwy9d44.js} +3 -3
- package/dist/chunks/{javascript-zcdmye2k.js → javascript-f0nrbdjb.js} +2 -2
- package/dist/chunks/{jsonMode-6x5e1nbf.js → jsonMode-nfa90dtf.js} +5 -5
- package/dist/chunks/jx-validate-7w11db9v.js +4 -0
- package/dist/chunks/layers-7zasrpse.js +4 -0
- package/dist/chunks/layers-panel-9nzc4fdq.js +4 -0
- package/dist/chunks/lit-html-5qr7nbng.js +4 -0
- package/dist/chunks/media-picker-maevn9d4.js +4 -0
- package/dist/chunks/menu-wq6q0v3y.js +4 -0
- package/dist/chunks/{monaco-binding-4az2kh5p.js → monaco-binding-antn79jf.js} +3 -3
- package/dist/chunks/monaco-buffer-9ry2rn5x.js +4 -0
- package/dist/chunks/{monaco-setup-d7mwkcx3.js → monaco-setup-k8s40vwg.js} +3 -3
- package/dist/chunks/notify-g91gjd6w.js +4 -0
- package/dist/chunks/platform-jdwjp2vt.js +4 -0
- package/dist/chunks/publish-panel-8yym447p.js +4 -0
- package/dist/chunks/quick-search-9bzm9kh3.js +4 -0
- package/dist/chunks/references-znssfqvq.js +4 -0
- package/dist/chunks/right-panel-czbzktm8.js +4 -0
- package/dist/chunks/section-registry-0rtq73qs.js +4 -0
- package/dist/chunks/studio-011em5cf.js +5 -0
- package/dist/chunks/studio-02y9cb4h.js +6 -0
- package/dist/chunks/{studio-7gqyhjns.js → studio-09n3fyy0.js} +4 -4
- package/dist/chunks/{studio-xcng8nx7.js → studio-0c3fpdqj.js} +5 -5
- package/dist/chunks/studio-0mm38y62.js +5 -0
- package/dist/chunks/studio-0nm2skex.js +4 -0
- package/dist/chunks/{studio-73czgk6a.js → studio-153mwkyq.js} +4 -4
- package/dist/chunks/{studio-f8jyp45j.js → studio-1pxvgx1t.js} +4 -4
- package/dist/chunks/studio-27tc8q0h.js +5 -0
- package/dist/chunks/studio-28pz4s1k.js +5 -0
- package/dist/chunks/{studio-x5esgzct.js → studio-36s6qjgq.js} +4 -4
- package/dist/chunks/studio-4yztve2t.js +5 -0
- package/dist/chunks/{studio-x9sagq2d.js → studio-5fc0728f.js} +7 -7
- package/dist/chunks/{studio-7jazdy6y.js → studio-654fxcr0.js} +4 -4
- package/dist/chunks/studio-6exg5z4x.js +4 -0
- package/dist/chunks/studio-6k1eswp9.js +5 -0
- package/dist/chunks/{studio-5wfrgee9.js → studio-6zyt56ek.js} +4 -4
- package/dist/chunks/studio-7djymzt2.js +5 -0
- package/dist/chunks/{studio-b4epb26c.js → studio-7w04zw8h.js} +7 -7
- package/dist/chunks/studio-805fwp9k.js +5 -0
- package/dist/chunks/{studio-k1eaqyzm.js → studio-81twpmzj.js} +4 -4
- package/dist/chunks/studio-891t1tv9.js +5 -0
- package/dist/chunks/{studio-5n1km79v.js → studio-9n2j9nqk.js} +4 -4
- package/dist/chunks/{studio-he2fhrgp.js → studio-9tkaykt5.js} +4 -4
- package/dist/chunks/studio-ant1zbp3.js +5 -0
- package/dist/chunks/studio-b29h7g7s.js +5 -0
- package/dist/chunks/studio-b5rxwkj2.js +5 -0
- package/dist/chunks/studio-d007j0z3.js +7 -0
- package/dist/chunks/studio-dknr8m7b.js +14 -0
- package/dist/chunks/{studio-eq27rrr0.js → studio-dmymvk2j.js} +3 -3
- package/dist/chunks/studio-dtmdjmqb.js +5 -0
- package/dist/chunks/studio-eb5sty2k.js +5 -0
- package/dist/chunks/{studio-hc9q4j24.js → studio-ebt49j3c.js} +5 -5
- package/dist/chunks/studio-eegyf5vg.js +5 -0
- package/dist/chunks/studio-frv7vjhw.js +5 -0
- package/dist/chunks/studio-ft8pfpp0.js +5 -0
- package/dist/chunks/{studio-mhhc9btt.js → studio-gj4j9e7k.js} +4 -4
- package/dist/chunks/{studio-hf4qdjc8.js → studio-gxna6yta.js} +4 -4
- package/dist/chunks/studio-je15p5v8.js +6 -0
- package/dist/chunks/{studio-21enxdr8.js → studio-jsr14n1s.js} +4 -4
- package/dist/chunks/studio-k9pwvmz8.js +5 -0
- package/dist/chunks/{studio-p1eggxcf.js → studio-ks0ecgjx.js} +3 -3
- package/dist/chunks/studio-mb8jhtr4.js +64 -0
- package/dist/chunks/studio-mf41717j.js +5 -0
- package/dist/chunks/{studio-625ezz59.js → studio-mm8x32gg.js} +4 -4
- package/dist/chunks/{studio-pkkw32j0.js → studio-n2e133d6.js} +4 -4
- package/dist/chunks/{studio-c4pnt1c6.js → studio-njmg0e73.js} +5 -5
- package/dist/chunks/studio-nvykrgbj.js +4 -0
- package/dist/chunks/studio-nw4q9sdn.js +5 -0
- package/dist/chunks/studio-p6avneaq.js +5 -0
- package/dist/chunks/studio-pvj970st.js +5 -0
- package/dist/chunks/studio-r7yeeqc4.js +5 -0
- package/dist/chunks/studio-s85vah66.js +6 -0
- package/dist/chunks/studio-sadckcpp.js +7 -0
- package/dist/chunks/studio-sgzss898.js +9 -0
- package/dist/chunks/{studio-7by9a93k.js → studio-t0v47dpc.js} +4 -4
- package/dist/chunks/{studio-jnb285we.js → studio-tj28pxa1.js} +4 -4
- package/dist/chunks/{studio-6j2jn55a.js → studio-tzs6njnb.js} +8 -8
- package/dist/chunks/studio-vz7b43ng.js +5 -0
- package/dist/chunks/studio-w8w9frjy.js +16 -0
- package/dist/chunks/{studio-xc8ebsts.js → studio-wr0pq67n.js} +4 -4
- package/dist/chunks/{studio-8r4y2x0z.js → studio-y164brht.js} +4 -4
- package/dist/chunks/studio-y17505ge.js +928 -0
- package/dist/chunks/studio-ymsjnvp9.js +5 -0
- package/dist/chunks/studio-z1vdxq0e.js +5 -0
- package/dist/chunks/studio-z47mm077.js +10 -0
- package/dist/chunks/studio-zkkdbbvd.js +9 -0
- package/dist/chunks/{studio-awqghqxv.js → studio-zkvyd3ev.js} +4 -4
- package/dist/chunks/{tsMode-rtwt7w1a.js → tsMode-eq26t9gs.js} +5 -5
- package/dist/chunks/workspace-emt8454d.js +4 -0
- package/dist/chunks/ws-client-3gxqp06s.js +4 -0
- package/dist/iframe-entry.js +14 -14
- package/dist/manifest.json +62 -59
- package/dist/studio.css +1 -1
- package/dist/studio.js +115 -117
- package/package.json +5 -5
- package/src/account/action-flow.ts +294 -0
- package/src/account/action-required.ts +68 -0
- package/src/account-status.ts +29 -1
- package/src/browse/library-model.ts +3 -1
- package/src/browse/library-preview.ts +6 -2
- package/src/canvas/asset-refs.ts +3 -1
- package/src/canvas/asset-resolve.ts +79 -1
- package/src/canvas/iframe-entry.ts +38 -1
- package/src/canvas/iframe-host.ts +85 -0
- package/src/canvas/iframe-protocol.ts +13 -0
- package/src/files/asset-versions.ts +294 -0
- package/src/files/files.ts +61 -9
- package/src/files/fs-events.ts +279 -28
- package/src/files/media-meta.ts +2 -1
- package/src/files/media-paths.ts +5 -2
- package/src/files/media-upload.ts +5 -1
- package/src/new-project/add-repo-modal.ts +12 -1
- package/src/new-project/new-project-modal.ts +12 -1
- package/src/panels/git-panel.ts +25 -2
- package/src/platform-errors.ts +61 -1
- package/src/platforms/cloud.ts +389 -50
- package/src/platforms/devserver.ts +17 -1
- package/src/publish/pages-service.ts +17 -7
- package/src/services/ai-models.ts +30 -6
- package/src/services/ai-system-prompt.ts +81 -51
- package/src/settings/preferences-accounts.ts +42 -3
- package/src/settings/preferences-dialog.ts +8 -1
- package/src/studio.ts +18 -1
- package/src/surfaces/dialog.ts +5 -0
- package/src/surfaces/welcome.json +86 -1
- package/src/surfaces/welcome.ts +61 -2
- package/src/types.ts +84 -2
- package/src/ui/ai-managed-connect.ts +41 -4
- package/src/ui/media-picker.ts +2 -1
- package/dist/chunks/adapter-bsbs78x9.js +0 -4
- package/dist/chunks/cf-account-picker-gnm7xeqb.js +0 -4
- package/dist/chunks/cf-settings-9y6jyscp.js +0 -4
- package/dist/chunks/components-s51h3b7c.js +0 -4
- package/dist/chunks/content-source-ty3be0qg.js +0 -4
- package/dist/chunks/convert-to-repeater-c3e7q61z.js +0 -4
- package/dist/chunks/editor-t002b41m.js +0 -4
- package/dist/chunks/entry-commands-sb72e9gy.js +0 -4
- package/dist/chunks/extension-sections-ktn2ntnj.js +0 -4
- package/dist/chunks/file-ops-78zeytkm.js +0 -4
- package/dist/chunks/files-gatzrz8v.js +0 -4
- package/dist/chunks/format-host-r59b1651.js +0 -4
- package/dist/chunks/fs-events-f8h91ndt.js +0 -4
- package/dist/chunks/git-panel-y12zf7nj.js +0 -4
- package/dist/chunks/grid-view-rfd8b2pg.js +0 -51
- package/dist/chunks/grid-view-tafenfm2.css +0 -1
- package/dist/chunks/iframe-host-vsrsj20g.js +0 -4
- package/dist/chunks/index-5aghyrfh.js +0 -4
- package/dist/chunks/jx-validate-653krkrf.js +0 -4
- package/dist/chunks/layers-32p8gtae.js +0 -4
- package/dist/chunks/layers-panel-rs58m105.js +0 -4
- package/dist/chunks/lit-html-54bmkwz3.js +0 -4
- package/dist/chunks/media-picker-5bb04wct.js +0 -4
- package/dist/chunks/menu-cbha7w2e.js +0 -4
- package/dist/chunks/monaco-buffer-9vbbyfr1.js +0 -4
- package/dist/chunks/notify-dc1nz5ar.js +0 -4
- package/dist/chunks/platform-2m49s1zf.js +0 -4
- package/dist/chunks/publish-panel-nx3ycmma.js +0 -4
- package/dist/chunks/quick-search-yzrzh9x3.js +0 -4
- package/dist/chunks/references-vx7mbj9f.js +0 -4
- package/dist/chunks/right-panel-7jzpbxja.js +0 -4
- package/dist/chunks/section-registry-gjryse41.js +0 -4
- package/dist/chunks/studio-3znfhcxg.js +0 -5
- package/dist/chunks/studio-58qam27v.js +0 -4
- package/dist/chunks/studio-6j59fwaw.js +0 -5
- package/dist/chunks/studio-7z69g1gx.js +0 -5
- package/dist/chunks/studio-93j3v6zx.js +0 -5
- package/dist/chunks/studio-9gf6v8zy.js +0 -5
- package/dist/chunks/studio-9rhmettf.js +0 -4
- package/dist/chunks/studio-ac5aq677.js +0 -10
- package/dist/chunks/studio-as65vbns.js +0 -5
- package/dist/chunks/studio-bkv0sga4.js +0 -6
- package/dist/chunks/studio-bttmqef4.js +0 -5
- package/dist/chunks/studio-c3y9d41k.js +0 -5
- package/dist/chunks/studio-ccegp7gz.js +0 -9
- package/dist/chunks/studio-chxabn98.js +0 -6
- package/dist/chunks/studio-cktcdsxz.js +0 -16
- package/dist/chunks/studio-cnspfke5.js +0 -5
- package/dist/chunks/studio-de3p1ktm.js +0 -5
- package/dist/chunks/studio-fsbcn530.js +0 -928
- package/dist/chunks/studio-gftga7a3.js +0 -64
- package/dist/chunks/studio-hf1rpcq0.js +0 -4
- package/dist/chunks/studio-hz02hq70.js +0 -5
- package/dist/chunks/studio-jsv3s3s1.js +0 -5
- package/dist/chunks/studio-ks7cksh0.js +0 -5
- package/dist/chunks/studio-nptx0dbs.js +0 -5
- package/dist/chunks/studio-pg0z7k98.js +0 -5
- package/dist/chunks/studio-pve0b2f2.js +0 -5
- package/dist/chunks/studio-q7zmjv3b.js +0 -6
- package/dist/chunks/studio-rpmvw7kj.js +0 -5
- package/dist/chunks/studio-rwhss52s.js +0 -5
- package/dist/chunks/studio-sbg3g3h0.js +0 -5
- package/dist/chunks/studio-sq1bn60g.js +0 -14
- package/dist/chunks/studio-vwz7rma2.js +0 -5
- package/dist/chunks/studio-wa55e8gf.js +0 -5
- package/dist/chunks/studio-x0mzdha2.js +0 -5
- package/dist/chunks/studio-xrgpakvc.js +0 -9
- package/dist/chunks/studio-xt3djk1w.js +0 -7
- package/dist/chunks/studio-yh3nggx1.js +0 -7
- package/dist/chunks/studio-zmecp6hq.js +0 -5
- package/dist/chunks/workspace-g6dvaete.js +0 -4
- package/dist/chunks/ws-client-shf41j5p.js +0 -4
|
@@ -2,7 +2,7 @@ var C=globalThis,O=(t)=>t,b=C.trustedTypes,j=b?b.createPolicy("lit-html",{create
|
|
|
2
2
|
\f\r](?:([^\\s"'>=/]+)([
|
|
3
3
|
\f\r]*=[
|
|
4
4
|
\f\r]*(?:[^
|
|
5
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),R=/'/g,V=/"/g,z=/^(?:script|style|textarea|title)$/i,E=(t)=>(e,...s)=>({_$litType$:t,strings:e,values:s}),
|
|
5
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),R=/'/g,V=/"/g,z=/^(?:script|style|textarea|title)$/i,E=(t)=>(e,...s)=>({_$litType$:t,strings:e,values:s}),br=E(1),J=E(2),K=E(3),Bl=Symbol.for("lit-noChange"),tt=Symbol.for("lit-nothing"),W=new WeakMap,u=g.createTreeWalker(g,129);function Z(t,e){if(!w(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return j!==void 0?j.createHTML(e):e}var k=(t,e)=>{let s=t.length-1,i=[],n,l=e===2?"<svg>":e===3?"<math>":"",r=y;for(let o=0;o<s;o++){let a=t[o],T,h,A=-1,_=0;for(;_<a.length&&(r.lastIndex=_,h=r.exec(a),h!==null);)_=r.lastIndex,r===y?h[1]==="!--"?r=D:h[1]!==void 0?r=L:h[2]!==void 0?(z.test(h[2])&&(n=RegExp("</"+h[2],"g")),r=p):h[3]!==void 0&&(r=p):r===p?h[0]===">"?(r=n??y,A=-1):h[1]===void 0?A=-2:(A=r.lastIndex-h[2].length,T=h[1],r=h[3]===void 0?p:h[3]==='"'?V:R):r===V||r===R?r=p:r===D||r===L?r=y:(r=p,n=void 0);let d=r===p&&t[o+1].startsWith("/>")?" ":"";l+=r===y?a+q:A>=0?(i.push(T),a.slice(0,A)+"$lit$"+a.slice(A)+c+d):a+c+(A===-2?o:d)}return[Z(t,l+(t[s]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]};class N{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let n=0,l=0,r=t.length-1,o=this.parts,[a,T]=k(t,e);if(this.el=N.createElement(a,s),u.currentNode=this.el.content,e===2||e===3){let h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(i=u.nextNode())!==null&&o.length<r;){if(i.nodeType===1){if(i.hasAttributes())for(let h of i.getAttributeNames())if(h.endsWith("$lit$")){let A=T[l++],_=i.getAttribute(h).split(c),d=/([.?@])?(.*)/.exec(A);o.push({type:1,index:n,name:d[2],strings:_,ctor:d[1]==="."?I:d[1]==="?"?S:d[1]==="@"?P:v}),i.removeAttribute(h)}else h.startsWith(c)&&(o.push({type:6,index:n}),i.removeAttribute(h));if(z.test(i.tagName)){let h=i.textContent.split(c),A=h.length-1;if(A>0){i.textContent=b?b.emptyScript:"";for(let _=0;_<A;_++)i.append(h[_],x()),u.nextNode(),o.push({type:2,index:++n});i.append(h[A],x())}}}else if(i.nodeType===8)if(i.data===M)o.push({type:2,index:n});else{let h=-1;for(;(h=i.data.indexOf(c,h+1))!==-1;)o.push({type:7,index:n}),h+=c.length-1}n++}}static createElement(t,e){let s=g.createElement("template");return s.innerHTML=t,s}}function f(t,e,s=t,i){if(e===Bl)return e;let n=i!==void 0?s._$Co?.[i]:s._$Cl,l=H(e)?void 0:e._$litDirective$;return n?.constructor!==l&&(n?._$AO?.(!1),l===void 0?n=void 0:(n=new l(t),n._$AT(t,s,i)),i!==void 0?(s._$Co??=[])[i]=n:s._$Cl=n),n!==void 0&&(e=f(t,n._$AS(t,e.values),n,i)),e}class B{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:e},parts:s}=this._$AD,i=(t?.creationScope??g).importNode(e,!0);u.currentNode=i;let n=u.nextNode(),l=0,r=0,o=s[0];for(;o!==void 0;){if(l===o.index){let a;o.type===2?a=new m(n,n.nextSibling,this,t):o.type===1?a=new o.ctor(n,o.name,o.strings,this,t):o.type===6&&(a=new U(n,this,t)),this._$AV.push(a),o=s[++r]}l!==o?.index&&(n=u.nextNode(),l++)}return u.currentNode=g,i}p(t){let e=0;for(let s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class m{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,s,i){this.type=2,this._$AH=tt,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=f(this,t,e),H(t)?t===tt||t==null||t===""?(this._$AH!==tt&&this._$AR(),this._$AH=tt):t!==this._$AH&&t!==Bl&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):F(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==tt&&H(this._$AH)?this._$AA.nextSibling.data=t:this.T(g.createTextNode(t)),this._$AH=t}$(t){let{values:e,_$litType$:s}=t,i=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=N.createElement(Z(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===i)this._$AH.p(e);else{let n=new B(i,this),l=n.u(this.options);n.p(e),this.T(l),this._$AH=n}}_$AC(t){let e=W.get(t.strings);return e===void 0&&W.set(t.strings,e=new N(t)),e}k(t){w(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,s,i=0;for(let n of t)i===e.length?e.push(s=new m(this.O(x()),this.O(x()),this,this.options)):s=e[i],s._$AI(n),i++;i<e.length&&(this._$AR(s&&s._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){let s=O(t).nextSibling;O(t).remove(),t=s}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}}class v{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,i,n){this.type=1,this._$AH=tt,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=n,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=tt}_$AI(t,e=this,s,i){let n=this.strings,l=!1;if(n===void 0)t=f(this,t,e,0),l=!H(t)||t!==this._$AH&&t!==Bl,l&&(this._$AH=t);else{let r=t,o,a;for(t=n[0],o=0;o<n.length-1;o++)a=f(this,r[s+o],e,o),a===Bl&&(a=this._$AH[o]),l||=!H(a)||a!==this._$AH[o],a===tt?t=tt:t!==tt&&(t+=(a??"")+n[o+1]),this._$AH[o]=a}l&&!i&&this.j(t)}j(t){t===tt?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class I extends v{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===tt?void 0:t}}class S extends v{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==tt)}}class P extends v{constructor(t,e,s,i,n){super(t,e,s,i,n),this.type=5}_$AI(t,e=this){if((t=f(this,t,e,0)??tt)===Bl)return;let s=this._$AH,i=t===tt&&s!==tt||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,n=t!==tt&&(s===tt||i);i&&this.element.removeEventListener(this.name,this,s),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class U{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){f(this,t)}}var wS={M:"$lit$",P:c,A:M,C:1,L:k,R:B,D:F,V:f,I:m,H:v,N:S,U:P,B:I,F:U},G=C.litHtmlPolyfillSupport;G?.(N,m),(C.litHtmlVersions??=[]).push("3.3.3");var Oi=(t,e,s)=>{let i=s?.renderBefore??e,n=i._$litPart$;if(n===void 0){let l=s?.renderBefore??null;i._$litPart$=n=new m(e.insertBefore(x(),l),l,void 0,s??{})}return n._$AI(t),n};export{br,Bl,tt,wS,Oi};
|
|
6
6
|
|
|
7
|
-
//# debugId=
|
|
8
|
-
//# sourceMappingURL=studio-
|
|
7
|
+
//# debugId=027A536B42EF692F64756E2164756E21
|
|
8
|
+
//# sourceMappingURL=studio-dmymvk2j.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{tt}from"./studio-dmymvk2j.js";import{te}from"./studio-ery42sqr.js";import{mS,p,We}from"./studio-6k1eswp9.js";import{Zt}from"./studio-ft8pfpp0.js";import{ge,Q,v,Zi,S}from"./studio-0nm2skex.js";import{on,ZC,g,u,Oo,ci}from"./studio-27tc8q0h.js";import{Gi,mm,up,Id,Hu}from"./studio-ant1zbp3.js";import{hn,sn}from"./studio-dknr8m7b.js";import{y}from"./studio-w8w9frjy.js";import{rt,xi,zt,T,R,Nn,Ct,Qo,On,yS}from"./studio-z1vdxq0e.js";import{Gn}from"./studio-njmg0e73.js";import{_w}from"./studio-0c3fpdqj.js";import{aa,eT,la,nT,kb,iT}from"./studio-sgzss898.js";import{cC,dC,um}from"./studio-pvj970st.js";import{yE}from"./studio-7djymzt2.js";import{lb,xE,cb,g1}from"./studio-0mm38y62.js";import{dI,D,pI,Po}from"./studio-153mwkyq.js";import{He}from"./studio-nw4q9sdn.js";import{me}from"./studio-09n3fyy0.js";var Y={$schema:"https://jxsuite.com/schema/v1",$id:"StudioMediaPane",$description:"The Media viewer: a pane that SHOWS a file the studio has no document model for — an image at its own size, a video or audio player, an embedded PDF, a font set in a pangram, or an honest line about a format nothing here can draw. The adapter hands in one projection: which of the six stages to draw, the URL that loads it, the file's name and facts, the reference a document would write for it, and the documents that already do. Nothing here decides anything; a control asks the host to copy, to open a path, or to record the pixel size the browser just learned.",tagName:"div",attributes:{part:"viewer","data-jx-region":"${state.region}"},style:{$description:"What `.media-viewer`, `.media-stage`, `.media-image`, `.media-video`, `.media-embed`, `.media-audio`, `.media-specimen`, `.media-specimen-line`, `.media-unviewable`, `.media-note`, `.media-details`, `.media-name`, `.media-facts`, `.media-ref`, `.media-ref-value`, `.media-usage`, `.media-usage-title`, `.media-usage-headline`, `.media-usage-list`, `.media-usage-link` and `.media-usage-count` said in `styles/overlays.css`, keyed on `part` and re-pointed at the studio token layer. All twenty-two were this surface's alone, so the stylesheet block goes with the conversion rather than being copied. Eight `var(--spectrum-font-size-…)` names could not come with the declarations: every one of them resolves only inside `<sp-theme>`, and this document is mounted in a pane stage that is outside it, so each would silently have taken its hex fallback — they are the kit's `--jx-text-xs`, `--jx-text-sm`, `--jx-text-md` and `--jx-text-lg` instead.",height:"100%",display:"flex",gap:"var(--jx-space-5)",padding:"var(--jx-space-5)",overflowY:"auto",background:"var(--bg-panel)",fontFamily:"var(--jx-font-sans)",color:"var(--fg)",'& [part="asset-slot"], & [part="usage-slot"], & [part="list-slot"]':{$description:"A `$switch` renders its own container, and none of these three is a box: each stands exactly where its case does, so the case's own rule is the only one that lays anything out.",display:"contents"},'& [part="stage"]':{$description:"The asset takes the room and the details column keeps a fixed width, so the file is the thing being looked at and the facts about it are beside it rather than on top of it.",flex:"1",minWidth:"0",display:"flex",alignItems:"flex-start",justifyContent:"center"},'& [part="image"]':{$description:"Never larger than its own pixels: an upscaled thumbnail is a lie about the asset, and judging whether an imported image is big enough is the whole reason somebody opens this.",maxWidth:"100%",height:"auto",border:"1px solid var(--border)",borderRadius:"var(--radius)",background:"var(--bg-input)"},'& [part="video"], & [part="embed"]':{width:"100%",maxHeight:"70vh",border:"1px solid var(--border)",borderRadius:"var(--radius)",background:"var(--bg-input)"},'& [part="audio"]':{width:"100%"},'& [part="specimen"]':{$description:"A font is shown by being USED. The face itself arrives as a `@font-face` the adapter writes, under a family name generated from the path so two specimens open side by side cannot claim the same one; the element carries only that NAME, as a custom property, and the fallback stack that catches a face the browser refuses stays here where it is a rule rather than data.",width:"100%",padding:"var(--jx-space-5)",border:"1px solid var(--border)",borderRadius:"var(--radius)",background:"var(--bg-input)",color:"var(--fg)",fontFamily:"var(--jx-specimen-family, system-ui), system-ui, sans-serif"},'& [part="specimen-line"]':{margin:"0 0 var(--jx-space-4)",lineHeight:"1.3",overflowWrap:"anywhere"},'& [part="specimen-line"][data-size="48"]':{fontSize:"48px"},'& [part="specimen-line"][data-size="32"]':{fontSize:"32px"},'& [part="specimen-line"][data-size="24"]':{fontSize:"24px"},'& [part="specimen-line"][data-size="18"]':{fontSize:"18px"},'& [part="specimen-line"][data-size="14"]':{fontSize:"var(--jx-text-lg)"},'& [part="unviewable"]':{$description:"Not a failure state. A file the browser cannot render is a zip, or a format this build has never heard of, so the box says what the file IS and that the project still builds with it in.",padding:"var(--jx-space-6)",border:"1px dashed var(--border)",borderRadius:"var(--radius)",color:"var(--fg-dim)",textAlign:"center"},'& [part="note"]':{fontSize:"var(--jx-text-md)",color:"var(--fg-dim)"},'& [part="details"]':{flex:"0 0 260px",display:"flex",flexDirection:"column",gap:"var(--jx-space-4)"},'& [part="title"]':{margin:"0",fontSize:"var(--jx-text-lg)",color:"var(--fg)",overflowWrap:"anywhere"},'& [part="facts"]':{$description:'Kind, pixel size, bytes and modified date, joined by the adapter. Each is omitted rather than zeroed when it is not known: a real file can almost be `0 × 0` or `0 B`, so neither may double as "we did not find out".',margin:"0",fontSize:"var(--jx-text-md)",color:"var(--fg-dim)"},'& [part="ref"]':{$description:"The reference a document writes for this file — `/hero.jpg` for `public/hero.jpg`, which shares not one segment with it. Getting this wrong is the commonest way an image goes missing from a page, which is why it is on screen next to a button that copies it.",display:"flex",alignItems:"center",gap:"6px"},'& [part="ref-value"]':{flex:"1",minWidth:"0",fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-sm)",background:"var(--bg-input)",border:"1px solid var(--border)",borderRadius:"var(--radius)",padding:"3px 6px",overflowWrap:"anywhere"},'& [part="usage"]':{display:"flex",flexDirection:"column"},'& [part="group-title"]':{margin:"0 0 var(--jx-space-2)",fontSize:"var(--jx-text-md)",fontWeight:"500",color:"var(--fg-dim)"},'& [part="message"]':{margin:"0",fontSize:"var(--jx-text-md)",color:"var(--fg-dim)"},'& [part="list"]':{listStyle:"none",margin:"var(--jx-space-3) 0 0",padding:"0",display:"flex",flexDirection:"column",gap:"var(--jx-space-1)"},'& [part="row"]':{display:"flex",alignItems:"baseline",gap:"6px",fontSize:"var(--jx-text-md)"},'& [part="file-path"]':{$description:'The path is a control, not a label: it opens the document that references this file. A plain button rather than a `jx-button`, for the reason the Problems rows give — what it has to look like is a line of text, and every fill, border and control height the kit draws would have to be taken back off again. Named `file-path` and not `path` because `jx-icon` puts `part="path"` on the `<path>` of every glyph it draws, so `[part="path"]` would select this button and any SVG path beside it.',flex:"1",minWidth:"0",margin:"0",padding:"0",background:"none",border:"none",borderRadius:"var(--jx-radius-xs)",textAlign:"left",color:"var(--accent)",cursor:"pointer",font:"inherit",overflowWrap:"anywhere",":hover":{textDecoration:"underline"},":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"2px"}},'& [part="count"]':{flex:"0 0 auto",fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-xs)",color:"var(--fg-dim)"}},children:[{tagName:"div",attributes:{part:"stage"},children:[{tagName:"div",attributes:{part:"asset-slot",role:"none"},$switch:{$ref:"#/state/kind"},cases:{image:{tagName:"img",attributes:{part:"image",src:"${state.src}",alt:""},onload:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/imageLoaded"},value:[{$ref:"event#/target/naturalWidth"},{$ref:"event#/target/naturalHeight"}]}],description:"The only honest source of pixel dimensions in a browser is an image that has loaded, and this viewer is showing one at full size anyway. The host decides whether the numbers are new; a repeat load of the same picture must not repaint the pane."}},video:{tagName:"video",attributes:{part:"video",src:"${state.src}",controls:!0}},audio:{tagName:"audio",attributes:{part:"audio",src:"${state.src}",controls:!0}},embed:{tagName:"embed",attributes:{part:"embed",src:"${state.src}",type:"application/pdf",title:"${state.name}"}},font:{tagName:"div",attributes:{part:"specimen",style:"${state.specimenFamily}"},children:[{tagName:"style",textContent:"${state.fontFace}"},{tagName:"p",attributes:{part:"specimen-line","data-size":"48"},textContent:"${state.specimen}"},{tagName:"p",attributes:{part:"specimen-line","data-size":"32"},textContent:"${state.specimen}"},{tagName:"p",attributes:{part:"specimen-line","data-size":"24"},textContent:"${state.specimen}"},{tagName:"p",attributes:{part:"specimen-line","data-size":"18"},textContent:"${state.specimen}"},{tagName:"p",attributes:{part:"specimen-line","data-size":"14"},textContent:"${state.specimen}"}]},unviewable:{tagName:"div",attributes:{part:"unviewable"},children:[{tagName:"p",children:[{tagName:"span",textContent:"Jx has no viewer for "},{tagName:"code",textContent:"${state.extLabel}"},{tagName:"span",textContent:"."}]},{tagName:"p",attributes:{part:"note"},textContent:"The file is in the project and builds normally."}]}}}]},{tagName:"div",attributes:{part:"details"},children:[{tagName:"h3",attributes:{part:"title"},textContent:"${state.name}"},{tagName:"p",attributes:{part:"facts"},textContent:"${state.facts}"},{tagName:"div",attributes:{part:"ref"},children:[{tagName:"code",attributes:{part:"ref-value"},textContent:"${state.ref}"},{tagName:"jx-action-button",$props:{size:"sm",quiet:!0,hint:"Copy the reference"},attributes:{part:"copy"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/copyRef"}}]},children:[{tagName:"span",textContent:"Copy"}]}]},{tagName:"div",attributes:{part:"usage-slot",role:"none"},$switch:{$ref:"#/state/usageState"},cases:{shown:{tagName:"div",attributes:{part:"usage"},children:[{tagName:"h4",attributes:{part:"group-title"},textContent:"Used by"},{tagName:"p",attributes:{part:"message"},textContent:"${state.usageHeadline}"},{tagName:"div",attributes:{part:"list-slot",role:"none"},$switch:{$ref:"#/state/hasUsageFiles"},cases:{true:{tagName:"ul",attributes:{part:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/usageFiles"},key:{$ref:"$map/item/path"},map:{tagName:"li",attributes:{part:"row","data-usage":"${$map.item.path}"},children:[{tagName:"button",attributes:{part:"file-path",type:"button"},textContent:"${$map.item.path}",onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openDocument"},value:[{$ref:"$map/item/path"}]}]}},{tagName:"span",attributes:{part:"count"},textContent:"${$map.item.count}"}]}}]}}}]}}}]}]};T("media-pane",Y);function et(t,e){t.region=e.region,t.name=e.name,t.kind=e.kind,t.src=e.src,t.facts=e.facts,t.ref=e.ref,t.specimen=e.specimen,t.specimenFamily=e.specimenFamily,t.fontFace=e.fontFace,t.extLabel=e.extLabel,t.usageState=e.usageState,t.usageHeadline=e.usageHeadline,t.usageFiles=e.usageFiles,t.hasUsageFiles=e.usageFiles.length>0}function at(t,e,a){t.replaceChildren();let r=v({copyRef:a.copyRef,extLabel:"",facts:"",fontFace:"",hasUsageFiles:!1,imageLoaded:a.imageLoaded,kind:"unviewable",name:"",openDocument:a.openDocument,ref:"",region:"",specimen:"",specimenFamily:"",src:"",usageFiles:[],usageHeadline:"",usageState:"hidden"});et(r,e);let i=null,o=!1,n=R("media-pane",r,t).then((s)=>{if(o)return s.dispose(),s.root;return i=s,s.root});return{attached:()=>{if(o)return!1;let s=i?.root;return s===void 0?!0:s instanceof HTMLElement&&t.contains(s)},dispose(){o=!0,i?.dispose(),i=null},ready:n,update:(s)=>et(r,s)}}var z="media",Ht=new Set([".woff",".woff2",".ttf",".otf"]),Ot="The quick brown fox jumps over the lazy dog",A=new Map;function H(t){return A.get(t)??null}function a1(t,e){let a=H(t);return a!==null&&a.tabId===e.id&&a.wrap.isConnected&&a.surface.attached()}function ab(t){let e=A.get(t);if(!e)return;e.scope.stop(),e.surface.dispose(),A.delete(t)}function Vt(t){let e=Gi(t);if(Ht.has(e))return"font";let a=up({name:t});if(a==="image"||a==="video"||a==="audio")return a;return e===".pdf"?"embed":"unviewable"}function _t(t,e){let a=[up({name:t})];if(e?.width!=null&&e.height!=null)a.push(`${e.width} × ${e.height}`);if(e?.bytes!=null)a.push(g1(e.bytes));if(e?.modified)a.push(`modified ${e.modified.slice(0,10)}`);return a.join(" · ")}function Jt(t){return`jx-specimen-${t.replaceAll(/[^a-zA-Z0-9]/g,"-")}`}function Wt(t){let e=iT(t);if(e===null)return{usageFiles:[],usageHeadline:"",usageState:"hidden"};return{usageFiles:(t?.status==="ready"?t.result.files:[]).map((r)=>({count:String(r.count),path:r.path})),usageHeadline:e,usageState:"shown"}}async function Bt(t){let{openFileInTab:e}=await (me("kb0epdxf"),import("./files-kb0epdxf.js"));await e(t)}function gE(t,e){let{paneId:a,wrap:r}=t;if(a1(a,e))return;ab(a);let i=e.documentPath??"",o=Jt(i),n=Hu(i),s=Id(i),l=Gi(i),c=Vt(i),m=null,h=()=>{if(m!==null&&H(a)===m)f()},x=()=>{let j=lb(i),d=nT(i);if(j===null)xE(i).then(h);if(d===null||d.status==="pending")kb(i).then(h);return{extLabel:l||"this file",facts:_t(i,j),fontFace:c==="font"?`@font-face { font-family: "${o}"; src: url("${n}"); }`:"",kind:c,name:i.split("/").pop()??"",ref:s,region:xi(a,"media"),specimen:Ot,specimenFamily:`--jx-specimen-family: "${o}"`,src:n,...Wt(d)}},f=()=>{m?.surface.update(x())},k=ge(),N=at(r,x(),{copyRef:()=>{navigator.clipboard?.writeText(s)},imageLoaded:(j,d)=>{if(cb(i,j,d))h()},openDocument:(j)=>{Bt(j)}});m={paneId:a,scope:k,surface:N,tabId:e.id,wrap:r},A.set(a,m),k.run(()=>{Q(()=>{if(H(a)!==m)return;e.documentPath,f()})})}var qt={children:[],tagName:"div"};function yw(t){return mm(t)}function Kt(t){return Gi(t)===".svg"?[z,"source"]:[z]}function bE(t,e={}){let a=g.tabs.get(t);if(a)return ci(t,{focus:e.focus!==!1}),a;return Oo({capabilities:{modes:Kt(t)},document:structuredClone(qt),documentPath:t,id:t,sourceFormat:null,...e.paneId!==void 0&&{paneId:e.paneId},...e.preview===!0&&{preview:!0},...e.focus===!1&&{focus:!1}})}var Xt={children:[],tagName:"div"},Yt=new Set(["bunfig.json","jsconfig.json","package-lock.json","package.json","tsconfig.json","wrangler.json"]);function zf(t){let e=t.slice(t.lastIndexOf("/")+1);if(Yt.has(e)||e.endsWith(".schema.json"))return!1;return t.endsWith(".json")||Boolean(Zt(t))}function it(t,e){if(t.startsWith("../")||t.includes("/../"))return`"${t}" is outside this project, so its comparison belongs to the project that owns it.`;if(e==="R")return"A renamed file's comparison needs both paths, and Studio does not model the old name yet.";if(yw(t))return`"${t}" is an image or media file, and a comparison of one is not text.`;return null}function Qt(){return["git-diff"]}function ee(t){let e=g.tabs.get(t);if(e)return ci(t),e;return Oo({capabilities:{modes:Qt()},document:structuredClone(Xt),documentPath:t,id:t,sourceFormat:null})}async function ot(t){if(!zf(t))return ee(t);let e=await (me("kb0epdxf"),import("./files-kb0epdxf.js"));return await e.openFileInTab(t,{})??[...g.tabs.values()].find((r)=>r.documentPath===t)??null}var nt={$schema:"https://jxsuite.com/schema/v1",$id:"StudioGithubPublish",$description:"Create GitHub Repository: the three things the flow needs before it calls the API — the repository's name, an optional description, and whether it is private. A `jx-dialog`, so the platform owns modality, Escape, focus restoration and the backdrop, and the kit draws both answer buttons. Nothing here reaches GitHub: `github/github-publish.ts` keeps the token, the request and the activity, and this document only collects.",tagName:"jx-dialog",$props:{headline:"Create GitHub Repository",confirmLabel:"Create Repository",cancelLabel:"Cancel",size:"sm"},attributes:{part:"github-publish"},onconfirm:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/confirm"},value:[]}]},oncancel:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/cancel"},value:[]}]},onclose:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},style:{$description:'What is NOT here is most of the conversion. `.github-publish-dialog` was a flex column with an 8px gap and `8px 0` of padding: the gap is the one thing it said that nothing else draws, and `jx-dialog`\'s own body already pads the content, so only the gap survives. `.github-publish-dialog sp-textfield { width: 100% }` had nothing to transcribe either — a `jx-field` row is a grid whose control cell stretches, so the field fills the row without being told to. The three `sp-field-label`s are gone with them, because `jx-field` draws the label AND names the control from it; the third of them carried no `for` at all, so "Visibility" was text beside a switch rather than a name for it.','& [part="rows"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-3)"}},children:[{tagName:"div",attributes:{part:"rows"},children:[{tagName:"jx-field",$props:{span:!0,label:"Repository name"},attributes:{part:"row","data-field":"name"},children:[{tagName:"jx-textfield",$props:{placeholder:"my-project",value:{$ref:"#/state/name"}},attributes:{part:"field"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setName"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-field",$props:{span:!0,label:"Description (optional)"},attributes:{part:"row","data-field":"description"},children:[{tagName:"jx-textfield",$props:{placeholder:"A brief description",value:{$ref:"#/state/description"}},attributes:{part:"field"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setDescription"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-field",$props:{span:!0,label:"Visibility"},attributes:{part:"row","data-field":"visibility"},children:[{tagName:"div",$description:'The row opens with a plain `div`, and that is the whole reason it exists: `jx-field` names the first thing slotted into it that observes `labelledby`, so a switch slotted straight in would be announced "Visibility" over the top of the words printed beside it. A `div` observes no naming, so the switch keeps the name its own label gives it.',attributes:{part:"visibility-row"},children:[{tagName:"jx-switch",attributes:{part:"toggle"},$props:{checked:{$ref:"#/state/isPrivate"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setPrivate"},value:[{$ref:"event#/target/checked"}]}]},children:[{tagName:"span",textContent:"Private repository"}]}]}]}]}]};T("github-publish",nt);function st(t){let e=document.createElement("div");e.style.pointerEvents="auto",e.setAttribute(rt,zt("dialog","github-publish")),t.layer.append(e);let a=!1,r=()=>{if(a)return;a=!0,t.onClosed()},i=v({cancel:()=>{t.onCancel()},closed:r,confirm:()=>{t.onConfirm({description:i.description,isPrivate:i.isPrivate,name:i.name})},description:"",isPrivate:!0,name:t.name,setDescription:(l)=>{i.description=l},setName:(l)=>{i.name=l},setPrivate:(l)=>{i.isPrivate=l}}),o=null,n=R("github-publish",i,e).then(async(l)=>{o=l;let c=l.root;if(a)return l.dispose(),c;if(await Nn(c),a)return c;return hn(c),c});return{close(){if(a)return;let l=o?.root;if(l instanceof HTMLElement)sn(l);o?.dispose(),o=null,e.remove(),r()},host:e,ready:n}}var M=["Create the repository","Add the remote","Push"];function re(t){return new Promise((e)=>{let a=!1,r=(o)=>{if(a)return;a=!0,e(o)},i=st({layer:Ct("dialog"),name:t,onCancel:()=>{i.close()},onClosed:()=>{r(null)},onConfirm:(o)=>{r({...o,name:o.name||t}),i.close()}})})}async function O({projectName:t}){let e=await _w();if(!e)return!1;let a=await re(t);if(!a)return!1;let r=aa({source:"Source Control",status:`Creating ${a.name}…`,steps:[...M],title:"Create GitHub repository"});r.step(M[0]);let i=await fetch("https://api.github.com/user/repos",{body:JSON.stringify({auto_init:!1,description:a.description,name:a.name,private:a.isPrivate}),headers:{Accept:"application/vnd.github+json",Authorization:`Bearer ${e}`,"Content-Type":"application/json"},method:"POST"}).catch((l)=>(r.log(te(l)),null));if(!i)return r.fail("Could not reach GitHub to create the repository.",{action:"git.createGithubRepository"}),!1;if(!i.ok){let l=await i.json();return r.log(l.errors?.[0]?.message||l.message||`GitHub answered ${i.status}.`),r.fail("Could not create the GitHub repository.",{action:"git.createGithubRepository"}),!1}let o=await i.json();r.log(`Created ${o.html_url}`);let n=p();r.step(M[1]);try{await n.gitAddRemote("origin",o.clone_url)}catch(l){return r.log(te(l)),r.fail("The repository was created, but the remote could not be added.",{action:"panel.focus.git"}),!1}r.step(M[2]);try{await n.gitPush({setUpstream:!0})}catch(l){return r.log(te(l)),r.fail("The repository was created, but the push failed.",{action:"git.push"}),!1}let{refreshGitStatus:s}=await (me("yyg3bzp2"),import("./git-panel-yyg3bzp2.js"));return await s(),r.done(o.html_url),S.success(`Repository created: ${o.html_url}`,{key:"github.repo"}),!0}var P=[];function ie(){return We()&&typeof p().listProjects==="function"}async function bw(){if(!ie()){P=[];return}try{P=await p().listProjects?.()??[]}catch{P=[]}}function fE(){return P}function lt(t){P=t}var ct=2,oe=1e4;class pt extends Error{blockedBy;constructor(t,e){super(t.length===0?`Studio did not report ${ct} consecutive quiet frames within ${e}ms`:`Studio was not idle after ${e}ms — blocked by ${t.join("; ")}`);this.name="NotIdleError",this.blockedBy=t}}function dt(){return[{blockers:()=>{let t=pI();return t>0?[`render: ${t} renderer(s) mid-paint`]:[]},name:"render"},{blockers:cC,name:"canvas"},{blockers:()=>{let t=mS();if(t.length===0)return[];return[`platform: ${t.length} in-flight (${[...new Set(t)].join(", ")})`]},name:"platform"},{blockers:yS,name:"overlay"},{blockers:eT,name:"activity"},{blockers:yE,name:"grid"}]}function ne(t=dt()){let e=[];for(let a of t)e.push(...a.blockers());return e}function ut(t={}){let{frames:e=ct,now:a=()=>Date.now(),raf:r=(n)=>{requestAnimationFrame(()=>n())},sources:i=dt(),timeoutMs:o=oe}=t;return new Promise((n,s)=>{let l=a()+o,c=0,m=!1,h=[],x=()=>{if(m)return;let f=ne(i);if(f.length>0)h=f,c=0;else if(c+=1,c>=e){m=!0,n();return}if(a()>=l){m=!0,s(new pt(f.length>0?f:h,o));return}r(x)};r(x)})}var mt=/\.toggle[A-Z]/;function se(t){return t.replace(/\.toggle([A-Z])/,(e,a)=>`.set${a}`)}function ht(t){return!mt.test(t.id)}var le={"file.contextMenu":{disposition:"refused",note:"opening a menu to press an item names a control; the ITEM is the command"},"layers.contextMenu":{disposition:"refused",note:"matched RENDERED TEXT, which R1 of scripts/screenshots/README.md forbids; a row is addressed by its data-jx-path"},"media.browse":{disposition:"command",note:"media.browse, site-architecture.md §9.4"},"project.showWelcome":{disposition:"refused",note:"cold start is a startup profile (?profile=fresh), not an action"},"settings.setSection":{disposition:"refused",note:`mirrored the section registry's LABELS; say settings.open { section: "cssVars" }`},"view.setStatus":{disposition:"refused",note:"the status bar is not staged — if a capture needs a calm shell, the app must BE calm"}},ce={openSettings:'a user opens Settings — run("settings.open")',select:'a user selects a node — run("selection.set", { path })',setActivity:'a user picks a Navigator panel — run("navigator.showPanel", { panel })',setRightTab:'a user picks an Inspector tab — run("inspector.setTab", { tab })',setStatus:"the status bar reports what the app just did; staging it is the one lie the Remote Rule (studio.md §13.5) names outright",setZoom:'a user zooms — run("canvas.setZoom", { zoom })'};function V(t,e){let a=t[e];if(a===void 0)return[];if(!Array.isArray(a))throw TypeError(`seed argument "${e}" must be an array`);return a}function pe(t,e){let a=t[e];if(a===null||typeof a!=="object")throw TypeError(`seed argument "${e}" must be an object`);return a}function de(t,e){let a=t[e];if(a===void 0)return;if(typeof a!=="string")throw TypeError(`seed argument "${e}" must be a string`);return a}function ue(t){return[{boundary:"the assistant's model stream",id:"seed.assistant",run:(e)=>{t.seedAssistantMessages(V(e,"messages"))}},{boundary:"the collaboration websocket (awareness + sync)",id:"seed.collab",run:(e)=>{let a=u.value;if(!a)return;let r=on(a);r.status="synced",r.active=!0;let i=[];for(let o of V(e,"peers")){let n={...o.state};n.focusedPath??=a.documentPath,i.push({...o,state:n})}r.peers=i,Po()}},{boundary:"the Cloudflare Pages API",id:"seed.publish",run:(e)=>{let a=de(e,"accountId");t.seedPublishConnected({deployment:pe(e,"deployment"),...a?{accountId:a}:{}})}},{boundary:"the platform's git routes (`gitStatus` / `gitBranches` / `gitLog`)",id:"seed.git",run:(e)=>{y.git.status=e.status??null,y.git.branches=e.branches??null,y.git.logEntries=e.log??null,y.git.loading=!1,y.git.error=null,Po()}},{boundary:"the platform's recent-projects store (desktop IPC / cloud API)",id:"seed.projectList",run:(e)=>{lt(V(e,"projects")),Po()}}]}class _ extends Error{id;constructor(t,e){super(`automation refuses "${t}" — ${e}`);this.name="AutomationRefusedError",this.id=t}}function he(t){let e=[];for(let a of t.visible()){if(!ht(a))continue;let r=t.disabledReason(a.id),i={enabled:r===void 0,id:a.id,title:a.title};if(a.args)i.args=a.args;if(r!==void 0)i.requires=r;e.push(i)}return e}function fe(t,e,a){if(a.has(t))return`"${t}" is a seed, not a command — call seed("${t}", …)`;let r=le[t];if(r?.disposition==="refused")return`"${t}" is refused by spec §13.5: ${r.note}`;if(r)return`"${t}" has no command record yet (${r.note}) — __jxAutomation.run projects the registry and nothing else`;let i=e.list().filter((o)=>ht(o)).map((o)=>o.id);return`unknown command "${t}" — the registry declares ${i.length} scriptable id(s)`}function be(t){let e=new Map(ue(t).map((r)=>[r.id,r])),a=new Set(e.keys());return{probe:{commands:()=>he(t.registry),idle:(r={})=>ut(r),pointAt:(r)=>dC(r.path),revealPath:(r)=>um(r),seeds:()=>[...e.values()].map((r)=>({boundary:r.boundary,id:r.id})),state:()=>t.registry.context()},async run(r,i={}){if(mt.test(r))throw new _(r,`it names a delta against state the caller cannot observe; call "${se(r)}"`);let{registry:o}=t;if(!o.get(r))throw Error(fe(r,o,a));await o.run(r,i)},async seed(r,i={}){let o=r.startsWith("seed.")?r.slice(5):r,n=ce[o];if(n)throw new _(r,`a seed stands in for a remote, never for a user: ${n}`);let s=e.get(r.startsWith("seed.")?r:`seed.${r}`);if(!s)throw Error(`unknown seed "${r}" — declared seeds are ${[...e.keys()].join(", ")}`);await s.run(i)}}}function rb(t){return new URLSearchParams(t).get("automation")==="1"}function mE(t){if(!rb(location.search))return!1;return globalThis.__jxAutomation=be(t),!0}var gt={$schema:"https://jxsuite.com/schema/v1",$id:"StudioJxsuiteUpdate",$description:"The on-open offer to bring a project's `@jxsuite/*` dependencies up to their newest published versions: one sentence, and the packages that would move. A `jx-dialog`, so the platform owns modality, Escape, focus restoration and the backdrop, and the kit draws both answers. Nothing here asks the registry or writes a manifest: `packages/jxsuite-update.ts` keeps the lookup, the dismissal key and the install, and this document only says what is on offer.",tagName:"jx-dialog",$props:{headline:"Update @jxsuite packages?",confirmLabel:"Update",cancelLabel:"Not now",size:"sm"},attributes:{part:"jxsuite-update"},onconfirm:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/confirm"},value:[]}]},oncancel:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/cancel"},value:[]}]},onclose:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},style:{$description:'The old body was a lit template with no stylesheet at all, which is why the conversion is mostly a deletion. Two `<br />`s stood in for a paragraph break, and one `<span style="white-space: pre-line">` held every package as a single `\\n`-joined string — a list spelled as whitespace. Neither is addressable and neither announces as what it is, so a screen reader read one run-on line and a test could only match a substring of it. It is a `<ul>` of keyed rows now: the list says how many packages there are, and each row is `[data-package]`. The one token repair travels with it — that span asked for `--spectrum-font-size-75`, which resolves only inside `<sp-theme>`, and a document mounted in the dialog layer is outside it, so the size silently fell back to the hard-coded `12px` written beside it.','& [part="offer"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-3)"},'& [part="lede"]':{margin:"0"},'& [part="list"]':{$description:"Capped and scrolling, because the count is the registry's rather than this dialog's: a project that has not been opened in a year can have every `@jxsuite/*` package behind at once, and a dialog that grows past the viewport puts its own Update button off screen.",listStyle:"none",margin:"0",padding:"0",display:"flex",flexDirection:"column",gap:"var(--jx-space-1)",maxHeight:"240px",overflowY:"auto"},'& [part="package"]':{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:"var(--jx-space-3)",fontSize:"var(--jx-text-sm)"},'& [part="package-name"]':{color:"var(--fg)"},'& [part="package-move"]':{$description:"Tabular figures, so a column of versions does not jitter between rows of different widths.",color:"var(--fg-dim)",fontVariantNumeric:"tabular-nums",whiteSpace:"nowrap"}},children:[{tagName:"div",attributes:{part:"offer"},children:[{tagName:"p",attributes:{part:"lede"},textContent:"Newer versions of these packages have been published. Update the project to them?"},{tagName:"ul",attributes:{part:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/packages"},key:{$ref:"$map/item/name"},map:{tagName:"li",attributes:{part:"package","data-package":"${$map.item.name}"},children:[{tagName:"span",attributes:{part:"package-name"},textContent:"${$map.item.name}"},{tagName:"span",attributes:{part:"package-move"},textContent:"${$map.item.current} → ${$map.item.target}"}]}}]}]}]};T("jxsuite-update",gt);function ft(t){let e=document.createElement("div");e.style.pointerEvents="auto",e.setAttribute(rt,zt("dialog","jxsuite-update")),t.layer.append(e);let a=!1,r=()=>{if(a)return;a=!0,t.onClosed()},i=v({cancel:()=>{t.onCancel()},closed:r,confirm:()=>{t.onConfirm()},packages:t.packages}),o=null,n=R("jxsuite-update",i,e).then(async(s)=>{o=s;let l=s.root;if(a)return s.dispose(),l;if(await Nn(l),a)return l;return hn(l),l});return{close(){let s=o?.root;if(s instanceof HTMLElement)sn(s);o?.dispose(),o=null,e.remove(),r()},host:e,ready:n}}function sb(t){return t.replace(/^[\^~>=<v\s]+/,"").trim().split(/\s+/)[0]??""}function bt(t){if(t.includes(":"))return!1;return/^\d+\.\d+/.test(sb(t))}function yt(t){let e=sb(t).split(/[-+]/)[0]??"",[a=0,r=0,i=0]=e.split(".").map((o)=>Math.trunc(Number(o))||0);return[a,r,i]}function we(t,e){let a=yt(t),r=yt(e);for(let i=0;i<3;i++){let o=a[i]??0,n=r[i]??0;if(o!==n)return o<n?-1:1}return 0}function vw(t,e){if(!bt(t)||!bt(e))return!1;return we(e,t)>0}var ve="@jxsuite/";async function J(){let t=p();if(!t.packageVersions)return[];let e;try{e=await t.packageVersions()}catch{return[]}let a=[];for(let r of e)if(r.name.startsWith(ve)&&vw(r.current,r.latest))a.push({current:r.current,dev:Boolean(r.dev),latest:r.latest,name:r.name});return a}function wt(t,e){let a=e.map((r)=>`${r.name}@${r.latest}`).toSorted().join(",");return`jx:jxsuite-update-dismissed:${t}:${a}`}function xe(t,e){try{return localStorage.getItem(wt(t,e))==="1"}catch{return!1}}function $e(t,e){try{localStorage.setItem(wt(t,e),"1")}catch{}}async function W(t){let e=p();if(!e.setPackageVersions||t.length===0)return;let a=la({status:"Updating @jxsuite packages…",title:"Updating dependencies"});try{let r=await e.setPackageVersions(t.map((i)=>({dev:i.dev,name:i.name,version:`^${i.latest}`})));if(r.ok)a.done(),S.success(`Updated ${t.length} @jxsuite package(s) to their latest versions.`);else a.fail(r.log??"Update failed")}catch(r){a.fail(r instanceof Error?r.message:String(r))}}function Se(t){return new Promise((e)=>{let a=!1,r=(s)=>{if(a)return;a=!0,e(s)},i=!1,o=()=>{if(i)return;i=!0,n.close()},n=ft({layer:Ct("dialog"),onCancel:()=>{o()},onClosed:()=>{r(!1),o()},onConfirm:()=>{r(!0),o()},packages:t.map((s)=>({current:s.current,name:s.name,target:`^${s.latest}`}))})})}async function tp(t){if(rb(location.search))return;if(!p().setPackageVersions)return;let a=await J();if(a.length===0||xe(t,a))return;if(!await Se(a)){$e(t,a);return}await W(a)}var G=["package.json","bun.lock","bun.lockb"],ke=new Set(["??","U"]),je=25,Pe="@jxsuite/";function F(t){return typeof t==="object"&&t!==null&&!Array.isArray(t)}function E(t){if(Array.isArray(t))return t.map((e)=>E(e));if(F(t)){let e={};for(let a of Object.keys(t).toSorted())e[a]=E(t[a]);return e}return t}function vt(t){let e={...t};for(let a of["dependencies","devDependencies"]){let r=e[a];if(!F(r))continue;let i={...r};for(let o of Object.keys(i))if(o.startsWith(Pe))i[o]="*";e[a]=i}return e}function Ce(t,e){if(t===null||e===null)return!1;let a,r;try{a=JSON.parse(t),r=JSON.parse(e)}catch{return!1}if(!F(a)||!F(r))return!1;return JSON.stringify(E(vt(a)))===JSON.stringify(E(vt(r)))}async function L(t,e){try{return await p().gitShow({path:t,ref:e})}catch{return null}}async function $t(t){try{return await p().readFile(t)}catch{return null}}async function St(t){let e=[],a=[],r=!0;for(let i of G){let o=t.files.filter((l)=>l.path===i);if(o.length===0)continue;let n=await L(i,"@{u}");if(o.every((l)=>ke.has(l.status))){if(n!==null)a.push(i);continue}let s=await L(i,"HEAD");if(n===null||n===s)continue;if(e.push(i),i==="package.json")r&&=Ce(s,await $t(i))}return{automated:r,discard:e,removeUntracked:a}}function kt(t){return t.discard.length===0&&t.removeUntracked.length===0}async function Ne(t){let e=[...new Set(t.files.filter((a)=>!G.includes(a.path)).map((a)=>a.path))];if(e.length>je)return!0;for(let a of e){let r=await L(a,"@{u}");if(r!==null&&r!==await L(a,"HEAD"))return!0}return!1}async function Ae(t){let e=p();if(t.discard.length>0)await e.gitUnstage(t.discard),await e.gitDiscard(t.discard);for(let a of t.removeUntracked)await e.deleteFile(a)}async function B(){let t=p(),e=[];try{e=await J()}catch{e=[]}if(e.length>0&&t.setPackageVersions){await W(e);return}if(!t.installDependencies)return;let a=la({status:"Running bun install…",title:"Syncing dependencies"});try{let r=await t.installDependencies();if(r.ok)a.done();else a.fail(r.log??"bun install failed")}catch(r){a.fail(te(r))}}async function jt(t){let e=p();try{await Ae(t)}catch(a){throw Error(`Could not reset local package files: ${te(a)}`,{cause:a})}try{await e.gitPull()}catch(a){throw await B(),a}S.warn("Local package updates were superseded by pulled changes.",{source:"Source Control"}),await B()}async function Re(t){let e=p(),a;try{a=await e.gitStatus()}catch{throw t}if(!(a.behind>0))throw t;let r=await St(a);if(kt(r)||await Ne(a))throw t;if(!r.automated){if(!await Qo("Discard local package changes?","package.json / bun.lock have local edits that conflict with incoming changes. Discard them, pull, and re-sync packages?",{confirmLabel:"Discard and pull",destructive:!0}))throw t}await jt(r)}async function xt(){let t;try{let e=await p().listDirectory("");t=new Set(e.filter((a)=>a.type==="file").map((a)=>a.name))}catch{t=new Set(G)}return Promise.all(G.map((e)=>t.has(e)?$t(e):Promise.resolve(null)))}async function q(){let t=p(),e=await xt(),a=null;try{await t.gitFetch(),a=await t.gitStatus()}catch{a=null}if(a&&a.behind>0){let i=await St(a);if(!kt(i)&&i.automated){await jt(i);return}}try{await t.gitPull()}catch(i){await Re(i);return}let r=await xt();if(e.some((i,o)=>i!==r[o]))await B()}async function np(){let t=p(),e;try{e=await t.gitStatus()}catch{return}if(!e?.isRepo||(e.remotes?.length??0)===0)return;S.info("Syncing project…",{key:"project.sync",source:"Source Control"});try{await q()}catch(a){S.warn("The project could not be synced with its remote.",{detail:te(a),key:"project.sync",source:"Source Control",tier:"problem"})}}var Pt={$schema:"https://jxsuite.com/schema/v1",$id:"StudioPanelGit",$description:"The Navigator's Source Control panel: what git says about this project, and every verb that answers. It has four moods and the adapter names which one — no project, a first read still in flight, a project git is not tracking yet, and a repository — so nothing here asks whether `status` is null or what `isRepo` means. Under the fourth mood it draws the sync bar (with or without a remote), the branch row, the two sub-tabs, and then either the commit form over the changed files or the log. `panels/git-panel.ts` keeps every decision: what a comparison is, which files group under which component, what a status letter reads aloud, what a commit does before it runs, and which of the four verbs a row's buttons are. Rows arrive as strings and booleans, keyed by path.",tagName:"div",attributes:{part:"git-panel"},style:{$description:"The sixty-odd `.git-*` rules in `styles/overlays.css`, keyed on `part` and carried here. Four token repairs travel with them, all of the shape `surfaces/panel-imports.json` describes: `--spectrum-font-size-75` and `--spectrum-font-size-50` resolved only inside `<sp-theme>` and a document is mounted outside it, so every rule that read one would silently have taken its px fallback — they are `--jx-text-md` (12px) and `--jx-text-sm` (11px) here, at the same values, and the bare `10px` literals are `--jx-text-xs`. The one deliberate move is the two headline values, the sync label and the branch name: they were 13px, which is not a step on the scale, and they take `--jx-text-lg` (14px). Three rules are DELETED rather than moved, because the kit already draws them: the sub-tab strip's own fill, hover and selected underline are `jx-tabs`/`jx-tab`, the branch picker's box is `jx-select`, and `.git-split-btn`'s hand-built dropdown is the kit menu (see `openCommitMenu`). And one is repaired: a row's action buttons were `opacity: 0` until the ROW was hovered, so tabbing to Stage moved the keyboard onto an invisible control — the reveal is `:focus-within` as well as `:hover`.",display:"flex",flexDirection:"column",height:"100%",fontFamily:"var(--jx-font-sans)",fontSize:"var(--jx-text-md)",color:"var(--fg)",'& [part="empty"]':{$description:"Drawn here rather than borrowed from `panels/empty-state.ts`, which is a lit template a document cannot call. What is kept is the pattern's rules (studio-ui-guidelines.md §11): one sentence saying what the region is for, then the action that fills it.",display:"flex",flex:"1",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"var(--jx-space-3)",padding:"var(--jx-space-5)",textAlign:"center",color:"var(--fg-dim)"},'& [part="empty-message"]':{margin:"0",maxWidth:"34ch",lineHeight:"1.5"},'& [part="empty-actions"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-2)"},'& [part="sync-bar"]':{$description:'A wrapping row (studio-ui-guidelines.md §4.6), and it has exactly two items: `sync-head` (Refresh and the status, which never split) and what answers the status (the Fetch/Pull/Push group, or Create GitHub repository with no remote). It was a single line whose only shrinkable item was the status text, so a narrow Navigator never moved a button: it broke "3 behind / Last updated 09:04 AM" into a column one word wide (25px at the 160px floor) and painted "(no" under Create GitHub repository at the default 240px. Now the second item drops to a line of its own when the two no longer fit, and where that happens is decided by the status text\'s own width (a count, a locale\'s clock), never by a breakpoint. The row gap is the smaller step so a wrapped bar reads as one block.',display:"flex",flexWrap:"wrap",alignItems:"center",gap:"var(--jx-space-3) var(--jx-space-4)",padding:"var(--jx-space-4)",borderBottom:"1px solid var(--border)"},'& [part="sync-bar"][data-remote="none"], & [part="sync-bar"][data-remote="none"] > [part="sync-head"]':{$description:"The no-remote bar keeps its tighter 8px between Refresh and the sentence, and on both axes: the head carries that gap now that Refresh and the text sit in it rather than in the bar.",gap:"var(--jx-space-3)"},'& [part="sync-head"]':{$description:"Refresh and the status, as one item of the bar, so wrapping never leaves the icon alone on a line above its text. `flex: 1 1 auto` makes its basis the status text's own width, which is the wrap threshold; with `min-width: 0` it can then shrink below that when it is alone on a line, and the status wraps as a sentence rather than word by word.",display:"flex",flex:"1 1 auto",alignItems:"center",gap:"var(--jx-space-4)",minWidth:"0"},'& [part="sync-text"]':{$description:"`1 1 auto` rather than `1`: the head's basis decides whether the verbs fit beside it, and it should be the status text's own width. An auto basis says that directly; the `0%` basis of `flex: 1` only reaches the same answer through how an engine treats a percentage while it measures.",display:"flex",flex:"1 1 auto",flexDirection:"column",gap:"1px",minWidth:"0"},'& [part="sync-label"]':{fontSize:"var(--jx-text-lg)",fontWeight:"600",color:"var(--fg)"},'& [part="sync-time"]':{fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)"},'& [part="sync-actions"]':{$description:"The verbs never shrink: they are what moves. `margin-left: auto` keeps them at the inline end whether they share the status's line or sit on one of their own.",display:"flex",flex:"none",marginLeft:"auto"},'& [part="branch-row"]':{$description:'A wrapping row (studio-ui-guidelines.md §4.6) of two items, `branch-head` and the picker. It was a single line with the picker capped at 40% of it, so a long branch name was cut twice ("chor…" beside "cho…") and a narrow Navigator word-stacked "Active / branch". Now the picker drops below the name when the two no longer fit, at a width the name decides.',display:"flex",flexWrap:"wrap",alignItems:"center",gap:"var(--jx-space-3) var(--jx-space-4)",padding:"10px var(--jx-space-4)",borderBottom:"1px solid var(--border)"},'& [part="branch-head"]':{$description:"The branch icon and the name, as one item so the icon is never alone on a line. The 999:1 grow ratio against the picker gives nearly all spare room to the name while the two share a line, so the picker stays the width of the branch it shows; once the picker wraps, it is alone and takes the whole line. A third item in this row needs its own flex decision.",display:"flex",flex:"999 1 auto",alignItems:"center",gap:"var(--jx-space-4)",minWidth:"0"},'& [part="branch-icon"]':{$description:"The hand-drawn 18px branch SVG this panel carried is the kit's `git-branch` glyph — the same key `PanelRecord.icon` already names for this panel's rail button, so the two drawings cannot drift.",flex:"none","--jx-icon-size":"18px",color:"var(--fg-dim)"},'& [part="branch-text"]':{display:"flex",flex:"1 1 auto",flexDirection:"column",gap:"1px",minWidth:"0"},'& [part="branch-label"]':{fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)"},'& [part="branch-name"]':{overflow:"hidden",fontSize:"var(--jx-text-lg)",fontWeight:"600",color:"var(--fg)",textOverflow:"ellipsis",whiteSpace:"nowrap"},'& [part="branch-picker"]':{$description:"Sized by the branch it shows while it shares the name's line, and the full width of the row once it wraps below it, which is where a long branch name finally reads whole. `min-width: 0` is the kit's own default, restated because studio-ui-guidelines.md §4.6 asks it of every flex child: when even a line of its own is narrower than the name, the picker shrinks and the kit's preview ellipsizes.",flex:"1 1 auto",minWidth:"0"},'& [part="tab"]':{$description:`The sub-tabs may shrink below their labels. A flex item's automatic minimum is its content, and a tab's label is nowrap, so "Local Changes (3)" and "History" held 179px against the 159px the Navigator has at its 160px floor and scrolled the whole panel sideways; the kit's label ellipsis could never engage. \`inspector-dock.json\` makes the same call for its tabs. It is a surface decision and not a kit default because the document tab strip deliberately scrolls instead.`,minWidth:"0"},'& [part="create-repository"] > [part="control"], & [part="init"] > [part="control"], & [part="clone"] > [part="control"], & [part="commit-button"] > [part="control"]':{$description:`The panel's labelled buttons wrap their words at the Navigator's floor instead of overflowing it. The kit's control is nowrap, which is right for a toolbar and made each label a floor of its own: "Create GitHub repository" held 165px in a 135px sync bar, "Clone Git Repository" and "Initialize Repository" held 141px and 135px in the empty state's 127px, and "Commit and sync" beside its menu had about a pixel to spare in the commit form's 135px. Nothing changes where the label fits, because a nowrap label and a wrapping one have the same max-content width. This reaches into the kit's \`control\` part as \`commandbar.json\` does for its primary button.`,whiteSpace:"normal"},'& [part="commit"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-3)",padding:"var(--jx-space-4)",borderBottom:"1px solid var(--border)"},'& [part="commit-label"]':{fontWeight:"500",color:"var(--fg-dim)"},'& [part="commit-actions"]':{display:"flex",gap:"var(--jx-space-2)"},'& [part="commit-button"]':{flex:"1"},'& [part="section"]':{borderBottom:"1px solid var(--border)"},'& [part="section-header"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-3)",padding:"var(--jx-space-3) var(--jx-space-4) 6px",fontWeight:"700",color:"var(--fg)"},'& [part="count"]':{$description:"The pill beside a section title. `margin-inline-end: auto` is what pushes the section's own button to the right edge — it was a second rule (`.git-section-header .git-count`) over the same element, and there is only one place a count is drawn.",display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:"18px",height:"18px",marginInlineEnd:"auto",padding:"0 5px",borderRadius:"9px",background:"var(--accent-15)",color:"var(--accent)",fontSize:"var(--jx-text-xs)",fontWeight:"600"},'& [part="group"]':{marginBottom:"var(--jx-space-1)"},'& [part="group-header"]':{display:"flex",alignItems:"center",gap:"6px",padding:"var(--jx-space-2) var(--jx-space-3)"},'& [part="group-name"]':{fontWeight:"500",color:"var(--fg)"},'& [part="file-row"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-2)",padding:"var(--jx-space-1) var(--jx-space-3) var(--jx-space-1) var(--jx-space-5)"},'& [part="file-row"]:hover':{background:"var(--hover-bg)"},'& [part="file-open"]':{$description:"A REAL button, because it does something. It was a bare span with a cursor and a `title`: not focusable, no role, and Enter did nothing — so the panel's primary verb was mouse-only. A `<button>` needs no role, no tabindex and no key handler of its own, which is three lines of the old row that simply go.",display:"flex",flex:"1",alignItems:"baseline",gap:"6px",minWidth:"0",margin:"0",padding:"0",overflow:"hidden",border:"none",borderRadius:"var(--radius)",background:"none",color:"inherit",font:"inherit",textAlign:"left",cursor:"pointer",":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"-2px"}},'& [part="file-name"]':{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},'& [part="file-dir"]':{overflow:"hidden",color:"var(--fg-dim)",fontSize:"var(--jx-text-xs)",textOverflow:"ellipsis",whiteSpace:"nowrap"},'& [part="file-actions"]':{$description:"Revealed on `:focus-within` as well as on the row's hover. Opacity alone hid a control the keyboard could still reach: tabbing through a changed file landed on an invisible Stage button.",display:"flex",flex:"none",opacity:"0"},'& [part="file-row"]:hover [part="file-actions"], & [part="file-actions"]:focus-within':{opacity:"1"},'& [part="badge"]':{$description:"One letter and a colour, which is why every row's open button carries the status in words as well.",flex:"none",width:"16px",color:"var(--signal)",fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-xs)",fontWeight:"700",textAlign:"center"},'& [part="badge"][data-status="A"], & [part="badge"][data-status="U"]':{color:"var(--success)"},'& [part="badge"][data-status="D"]':{color:"var(--danger)"},'& [part="badge"][data-status="R"], & [part="badge"][data-status="C"]':{color:"var(--tag)"},'& [part="history"]':{flex:"1",overflowY:"auto",padding:"var(--jx-space-2) 0"},'& [part="history-list"]':{margin:"0",padding:"0",listStyle:"none"},'& [part="history-entry"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-1)",padding:"6px var(--jx-space-4)",borderBottom:"1px solid var(--border)"},'& [part="history-entry"]:hover':{background:"var(--hover-bg)"},'& [part="history-hash"]':{color:"var(--accent)",fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-xs)"},'& [part="history-message"]':{color:"var(--fg)"},'& [part="history-meta"]':{color:"var(--fg-dim)",fontSize:"var(--jx-text-xs)"},'& [part="status"]':{margin:"0",padding:"var(--jx-space-3)",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)",textAlign:"center"},'& [part="failure"]':{$description:"The panel's own refusal banner. It is `failure` rather than `error` because the branch picker and the commit field each draw a permanent, empty `[part=\"error\"]` of their own inside this same light-DOM tree: under that name this padding, rule and wash drew a 16×13 box over both fields' top-left corners that took the click, and dressed either field's real refusal sentence as a banner.",margin:"0",padding:"6px var(--jx-space-3)",borderBottom:"1px solid var(--border)",background:"color-mix(in srgb, var(--danger) 8%, transparent)",color:"var(--danger)",fontSize:"var(--jx-text-sm)"},"@(forced-colors: active)":{'& [part="failure"]':{$description:"The wash behind the banner collapses into the page when every author colour is replaced, so the border is what is left to mark it.",border:"1px solid CanvasText",color:"CanvasText"}}},children:[{tagName:"div",attributes:{part:"view-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/view"},cases:{"no-project":{tagName:"div",attributes:{part:"empty","data-view":"no-project"},children:[{tagName:"p",attributes:{part:"empty-message"},textContent:"Source control keeps every version of a project, so any change can be undone. Open a project to see its history."},{tagName:"div",attributes:{part:"clone-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/canClone"},cases:{true:{tagName:"div",attributes:{part:"empty-actions"},children:[{tagName:"jx-button",attributes:{part:"clone","data-action":"clone"},$props:{size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/clone"},value:[]}]},children:[{tagName:"jx-icon",$props:{name:"download-simple"}},{tagName:"span",textContent:"Clone Git Repository"}]}]}}}]},loading:{tagName:"p",attributes:{part:"status","data-view":"loading"},textContent:"Loading…"},"no-repo":{tagName:"div",attributes:{part:"empty","data-view":"no-repo"},children:[{tagName:"p",attributes:{part:"empty-message"},textContent:"This project is not tracked by git yet. Start tracking it to keep a history of every change and to publish it anywhere."},{tagName:"div",attributes:{part:"empty-actions"},children:[{tagName:"jx-button",attributes:{part:"init","data-action":"init"},$props:{size:"sm",variant:"accent",disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/initRepository"},value:[]}]},children:[{tagName:"jx-icon",$props:{name:"plus"}},{tagName:"span",textContent:"Initialize Repository"}]},{tagName:"jx-button",attributes:{part:"create-repository","data-action":"create-repository"},$props:{size:"sm",disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/createRepository"},value:[]}]},children:[{tagName:"jx-icon",$props:{name:"share-network"}},{tagName:"span",textContent:"Create GitHub repository"}]}]}]},repo:{tagName:"div",attributes:{part:"repo",role:"none"},style:{display:"contents"},children:[{tagName:"div",attributes:{part:"remote-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/remoteState"},cases:{remote:{tagName:"div",attributes:{part:"sync-bar","data-remote":"yes"},children:[{tagName:"div",attributes:{part:"sync-head"},children:[{tagName:"jx-action-button",attributes:{part:"refresh","data-action":"refresh"},$props:{icon:"arrows-clockwise",size:"sm",quiet:!0,label:"Refresh",hint:"Refresh",disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/refresh"},value:[]}]}},{tagName:"div",attributes:{part:"sync-text"},children:[{tagName:"span",attributes:{part:"sync-label"},textContent:"${state.syncLabel}"},{tagName:"span",attributes:{part:"updated-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasLastUpdated"},cases:{true:{tagName:"span",attributes:{part:"sync-time"},textContent:"${state.lastUpdated}"}}}]}]},{$description:"Three quiet tools, so NOT compact. A compact group draws every member's frame and fill whatever its quiet says, so the `quiet: true` each verb below writes would have been silently framed into a segmented control; Spectrum's group here was quiet and never compact, which is what compact=false and the 2px gap between the verbs restore.",tagName:"jx-action-group",attributes:{part:"sync-actions"},$props:{label:"Remote actions",compact:!1},children:[{tagName:"jx-action-button",attributes:{part:"fetch","data-action":"fetch"},$props:{icon:"download-simple",size:"sm",quiet:!0,label:"Fetch",hint:"Fetch",disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/fetch"},value:[]}]}},{tagName:"jx-action-button",attributes:{part:"pull","data-action":"pull"},$props:{icon:"arrow-down",size:"sm",quiet:!0,label:{$ref:"#/state/pullLabel"},hint:{$ref:"#/state/pullLabel"},disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/pull"},value:[]}]}},{tagName:"jx-action-button",attributes:{part:"push","data-action":"push"},$props:{icon:"arrow-up",size:"sm",quiet:!0,label:{$ref:"#/state/pushLabel"},hint:{$ref:"#/state/pushLabel"},disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/push"},value:[]}]}}]}]},local:{tagName:"div",attributes:{part:"sync-bar","data-remote":"none"},children:[{tagName:"div",attributes:{part:"sync-head"},children:[{tagName:"jx-action-button",attributes:{part:"refresh","data-action":"refresh"},$props:{icon:"arrows-clockwise",size:"sm",quiet:!0,label:"Refresh",hint:"Refresh",disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/refresh"},value:[]}]}},{tagName:"div",attributes:{part:"sync-text"},children:[{tagName:"span",attributes:{part:"sync-label"},textContent:"Local only (no remote)"}]}]},{tagName:"jx-button",attributes:{part:"create-repository","data-action":"create-repository"},$props:{size:"sm",disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/createRepository"},value:[]}]},children:[{tagName:"jx-icon",$props:{name:"share-network"}},{tagName:"span",textContent:"Create GitHub repository"}]}]}}},{tagName:"div",attributes:{part:"branch-row"},children:[{tagName:"div",attributes:{part:"branch-head"},children:[{tagName:"jx-icon",attributes:{part:"branch-icon"},$props:{name:"git-branch"}},{tagName:"div",attributes:{part:"branch-text"},children:[{tagName:"span",attributes:{part:"branch-label"},textContent:"Active branch"},{tagName:"span",attributes:{part:"branch-name"},textContent:"${state.branchName}"}]}]},{tagName:"jx-select",attributes:{part:"branch-picker"},$props:{label:"Switch branch",size:"sm",options:{$ref:"#/state/branchOptions"},value:{$ref:"#/state/branchValue"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/chooseBranch"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-tabs",attributes:{part:"tabs",selected:"${state.subTab}"},$props:{label:"Source control views"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/selectTab"},value:[{$ref:"event#/detail"}]}]},children:[{tagName:"jx-tab",attributes:{part:"tab","data-tab":"changes",value:"changes",label:"${state.changesLabel}",panel:"git-panel-body"}},{tagName:"jx-tab",attributes:{part:"tab","data-tab":"history",value:"history",label:"History",panel:"git-panel-body"}}]},{tagName:"div",attributes:{part:"body",id:"git-panel-body",role:"tabpanel","data-tab":"${state.subTab}"},style:{display:"contents"},$switch:{$ref:"#/state/subTab"},cases:{changes:{tagName:"div",attributes:{part:"changes",role:"none"},style:{display:"contents"},children:[{tagName:"div",attributes:{part:"commit","data-jx-region":"navigator/panel:git/commit"},children:[{tagName:"span",attributes:{part:"commit-label",id:"git-commit-label"},textContent:"Please write a commit message"},{tagName:"jx-textfield",attributes:{part:"commit-input","data-field":"commit-message"},$props:{labelledby:"git-commit-label",multiline:!0,size:"sm",placeholder:"Describe your changes",value:{$ref:"#/state/commitMessage"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editMessage"},value:[{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{Enter:[{if:{operator:"||",target:{$ref:"event#/ctrlKey"},value:{$ref:"event#/metaKey"}},then:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/commit"},value:[]}]}]}}]}},{tagName:"div",attributes:{part:"commit-actions"},children:[{tagName:"jx-button",attributes:{part:"commit-button","data-action":"commit-and-sync"},$props:{size:"sm",variant:"accent",disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/commitAndSync"},value:[]}]},children:[{tagName:"span",textContent:"Commit and sync"}]},{tagName:"jx-action-button",attributes:{part:"commit-menu","data-action":"commit-menu"},$props:{icon:"caret-down",size:"sm",label:"More commit options",hint:"More commit options",haspopup:"menu"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openCommitMenu"},value:[{$ref:"event#/currentTarget"}]}]}}]}]},{tagName:"div",attributes:{part:"staged-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasStaged"},cases:{true:{tagName:"section",attributes:{part:"section","data-section":"staged","aria-label":"Staged Changes"},children:[{tagName:"div",attributes:{part:"section-header"},children:[{tagName:"span",attributes:{part:"section-title"},textContent:"Staged Changes"},{tagName:"span",attributes:{part:"count"},textContent:"${state.stagedCount}"},{tagName:"jx-action-button",attributes:{part:"unstage-all","data-action":"unstage-all"},$props:{icon:"minus",size:"sm",quiet:!0,label:"Unstage all",hint:"Unstage all"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/unstageAll"},value:[]}]}}]},{$prototype:"Array",items:{$ref:"#/state/stagedFiles"},key:{$ref:"$map/item/key"},map:{$description:"One changed file. Every row opens the file it names — renderability decides which VIEW opens, not whether the row responds — and carries the two or three verbs its staged state allows. `$map/item` inside a nested map is the FILE, which is why the row hands its own path back to every action rather than an index.",tagName:"div",attributes:{part:"file-row","data-path":"${$map.item.path}","data-status":"${$map.item.status}"},children:[{tagName:"button",attributes:{part:"file-open",type:"button","aria-label":"${$map.item.label}",title:"Open this file's comparison"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openFile"},value:[{$ref:"$map/item/path"}]}]},children:[{tagName:"span",attributes:{part:"file-name"},textContent:"${$map.item.name}"},{tagName:"span",attributes:{part:"dir-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasDir"},cases:{true:{tagName:"span",attributes:{part:"file-dir"},textContent:"${$map.item.dir}"}}}]},{tagName:"span",attributes:{part:"file-actions"},$switch:{$ref:"$map/item/staged"},cases:{true:{tagName:"jx-action-button",attributes:{part:"unstage","data-action":"unstage"},$props:{icon:"minus",size:"sm",quiet:!0,label:"Unstage ${$map.item.path}",hint:"Unstage"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/unstage"},value:[{$ref:"$map/item/path"}]}]}},false:{tagName:"span",attributes:{part:"unstaged-actions",role:"none"},style:{display:"contents"},children:[{tagName:"jx-action-button",attributes:{part:"discard","data-action":"discard"},$props:{icon:"arrow-u-up-left",size:"sm",quiet:!0,label:"Discard changes to ${$map.item.path}",hint:"Discard changes",disabled:{$ref:"$map/item/cannotDiscard"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/discard"},value:[{$ref:"$map/item/path"}]}]}},{tagName:"jx-action-button",attributes:{part:"stage","data-action":"stage"},$props:{icon:"plus",size:"sm",quiet:!0,label:"Stage ${$map.item.path}",hint:"Stage"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/stage"},value:[{$ref:"$map/item/path"}]}]}}]}}},{tagName:"span",attributes:{part:"badge","data-status":"${$map.item.status}"},textContent:"${$map.item.status}"}]}}]}}},{tagName:"section",attributes:{part:"section","data-section":"changed","aria-label":"Changed Components"},children:[{tagName:"div",attributes:{part:"section-header"},children:[{tagName:"span",attributes:{part:"section-title"},textContent:"Changed Components"},{tagName:"span",attributes:{part:"count"},textContent:"${state.changedCount}"},{tagName:"span",attributes:{part:"stage-all-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasUnstaged"},cases:{true:{tagName:"jx-action-button",attributes:{part:"stage-all","data-action":"stage-all"},$props:{icon:"plus",size:"sm",quiet:!0,label:"Stage all",hint:"Stage all"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/stageAll"},value:[]}]}}}}]},{tagName:"div",attributes:{part:"groups-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/filesState"},cases:{listed:{tagName:"div",attributes:{part:"groups"},children:[{$prototype:"Array",items:{$ref:"#/state/groups"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"group","data-group":"${$map.item.key}"},children:[{tagName:"div",attributes:{part:"group-header"},children:[{tagName:"span",attributes:{part:"group-name"},textContent:"${$map.item.name}"}]},{$prototype:"Array",items:{$ref:"$map/item/files"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"file-row","data-path":"${$map.item.path}","data-status":"${$map.item.status}"},children:[{tagName:"button",attributes:{part:"file-open",type:"button","aria-label":"${$map.item.label}",title:"Open this file's comparison"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openFile"},value:[{$ref:"$map/item/path"}]}]},children:[{tagName:"span",attributes:{part:"file-name"},textContent:"${$map.item.name}"},{tagName:"span",attributes:{part:"dir-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasDir"},cases:{true:{tagName:"span",attributes:{part:"file-dir"},textContent:"${$map.item.dir}"}}}]},{tagName:"span",attributes:{part:"file-actions"},$switch:{$ref:"$map/item/staged"},cases:{true:{tagName:"jx-action-button",attributes:{part:"unstage","data-action":"unstage"},$props:{icon:"minus",size:"sm",quiet:!0,label:"Unstage ${$map.item.path}",hint:"Unstage"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/unstage"},value:[{$ref:"$map/item/path"}]}]}},false:{tagName:"span",attributes:{part:"unstaged-actions",role:"none"},style:{display:"contents"},children:[{tagName:"jx-action-button",attributes:{part:"discard","data-action":"discard"},$props:{icon:"arrow-u-up-left",size:"sm",quiet:!0,label:"Discard changes to ${$map.item.path}",hint:"Discard changes",disabled:{$ref:"$map/item/cannotDiscard"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/discard"},value:[{$ref:"$map/item/path"}]}]}},{tagName:"jx-action-button",attributes:{part:"stage","data-action":"stage"},$props:{icon:"plus",size:"sm",quiet:!0,label:"Stage ${$map.item.path}",hint:"Stage"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/stage"},value:[{$ref:"$map/item/path"}]}]}}]}}},{tagName:"span",attributes:{part:"badge","data-status":"${$map.item.status}"},textContent:"${$map.item.status}"}]}}]}}]},empty:{tagName:"p",attributes:{part:"empty-message","data-empty":"changes"},textContent:"Nothing to commit. Files you edit and save show up here."}}}]}]},history:{tagName:"div",attributes:{part:"history"},children:[{tagName:"div",attributes:{part:"history-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/historyState"},cases:{listed:{tagName:"ul",attributes:{part:"history-list"},children:[{$prototype:"Array",items:{$ref:"#/state/commits"},key:{$ref:"$map/item/key"},map:{tagName:"li",attributes:{part:"history-entry","data-hash":"${$map.item.hash}"},children:[{tagName:"span",attributes:{part:"history-hash"},textContent:"${$map.item.hash}"},{tagName:"span",attributes:{part:"history-message"},textContent:"${$map.item.message}"},{tagName:"span",attributes:{part:"history-meta"},textContent:"${$map.item.meta}"}]}}]},empty:{tagName:"p",attributes:{part:"empty-message","data-empty":"history"},textContent:"No commits yet. Each commit you make is a version you can come back to."}}}]}}},{tagName:"div",attributes:{part:"busy-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/busy"},cases:{true:{tagName:"p",attributes:{part:"status","data-status":"busy"},textContent:"Loading…"}}},{tagName:"div",attributes:{part:"failure-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasError"},cases:{true:{tagName:"p",attributes:{part:"failure",role:"alert"},textContent:"${state.error}"}}}]}}}]};T("git-panel",Pt);function Nt(t,e){t.view=e.view,t.canClone=e.canClone,t.busy=e.busy,t.hasError=e.hasError,t.error=e.error,t.remoteState=e.remoteState,t.syncLabel=e.syncLabel,t.lastUpdated=e.lastUpdated,t.hasLastUpdated=e.hasLastUpdated,t.pullLabel=e.pullLabel,t.pushLabel=e.pushLabel,t.branchName=e.branchName,t.branchValue=e.branchValue,t.branchOptions=e.branchOptions,t.subTab=e.subTab,t.changesLabel=e.changesLabel,t.commitMessage=e.commitMessage,t.hasStaged=e.hasStaged,t.stagedCount=e.stagedCount,t.stagedFiles=e.stagedFiles,t.changedCount=e.changedCount,t.hasUnstaged=e.hasUnstaged,t.filesState=e.filesState,t.groups=e.groups,t.historyState=e.historyState,t.commits=e.commits}function Me(){return{branchName:"",branchOptions:[],branchValue:"",busy:!1,canClone:!1,changedCount:"0",changesLabel:"Local Changes",commitMessage:"",commits:[],error:"",filesState:"empty",groups:[],hasError:!1,hasLastUpdated:!1,hasStaged:!1,hasUnstaged:!1,historyState:"empty",lastUpdated:"",pullLabel:"Pull",pushLabel:"Push",remoteState:"local",stagedCount:"0",stagedFiles:[],subTab:"changes",syncLabel:"",view:"loading"}}function At(t,e,a){let r=v({...Me(),...a});Nt(r,e);let i=null,o=!1;return R("git-panel",r,t).then((n)=>{if(o){n.dispose();return}i=n}),{connected:()=>!o&&(i===null||i.root.parentNode===t),dispose(){o=!0,i?.dispose(),i=null},update:(n)=>{Nt(r,n)}}}async function dc(){if(!D)return;let t=p(),{git:e}=y;e.loading=!0,e.error=null;try{let[a,r]=await Promise.allSettled([t.gitStatus(),t.gitBranches()]);if(a.status==="fulfilled")e.status=a.value;if(r.status==="fulfilled")e.branches=r.value;let i=a.status==="rejected"?a.reason:r.status==="rejected"&&a.value?.isRepo?r.reason:null;if(i)e.error=te(i);e.lastUpdated=Zi(),e.rev+=1,await Ge()}catch(a){e.error=te(a)}finally{e.loading=!1}}async function Ge(){let t=y.git.diffState;if(!t)return;let e=y.git.status?.files.find((a)=>a.path===t.filePath);if(!e||!Tt(e.status)){y.git.diffState=null;return}try{y.git.diffState=await I(t.filePath,e.status)}catch{}}async function l1(t){y.git.rev+=1;let e=y.git.diffState;if(!t||e?.filePath!==t)return;try{y.git.diffState=await I(t,e.fileStatus)}catch{}}async function ww(t){let e=p();if(!e.gitClone){S.warn("Cloning is not supported on this platform.",{source:"Source Control"});return}let a=await On("Clone Git Repository",{confirmLabel:"Clone",message:"Repository URL",placeholder:"https://github.com/user/repo.git",validate:(r)=>r.trim()?"":"Enter a repository URL."});if(!a)return;try{S.info("Cloning repository…",{key:"git.clone",source:"Source Control"});let r=await e.gitClone(a);if(r?.root)S.success("Clone complete.",{key:"git.clone"}),await t.openRecentProject(r.root)}catch(r){S.error("Could not clone the repository.",{detail:te(r),key:"git.clone",source:"Source Control"})}}function xw(){return We()&&Boolean(p().gitClone)}var Fe={A:"added",D:"deleted",M:"modified",R:"renamed",U:"untracked"},De=new Set(["M","A","U","D"]);function Tt(t){return De.has(t)}async function I(t,e){let a=p(),r=e!=="A"&&e!=="U",i=e!=="D",[o,n]=await Promise.all([r?a.gitShow({path:t,ref:"HEAD"}):Promise.resolve(""),i?a.readFile(t):Promise.resolve("")]);return{currentContent:n,filePath:t,fileStatus:e,originalContent:o}}async function c1(t,e){try{return await I(t,e)}catch(a){return console.warn("loadDiffForLens:",te(a)),null}}async function Mt(){try{S.info("Initializing repository…",{key:"git.init"}),await p().gitInit(),S.success("Repository initialized.",{key:"git.init"})}catch(t){S.error("Could not initialize the repository.",{action:"git.init",detail:te(t),key:"git.init",source:"Source Control"});return}await dc()}async function Ee(){await b("gitPush")}async function Le(){if(await _w())S.success("Signed in to GitHub.",{key:"github.auth"})}async function b(t,e){let a=p();y.git.loading=!0,y.git.error=null;try{return await a[t](e),await dc(),!0}catch(r){return y.git.error=te(r),y.git.loading=!1,!1}}function Gt(t){if(!y.git.commitMessage)y.git.commitMessage=t}async function Ue(){y.git.loading=!0,y.git.error=null;try{await q(),await dc()}catch(t){y.git.error=te(t),y.git.loading=!1}}var C=null;async function Ie(){let t=p();try{y.git.logEntries=await t.gitLog(30)}catch(e){y.git.error=te(e)}}var U={},K=null;function Ft(t){let e=t.path.split("/"),a=e.pop()??t.path,r=e.join("/");return{cannotDiscard:t.status==="U",dir:r,hasDir:r!=="",key:t.path,label:`${t.path}, ${Fe[t.status]??"changed"}`,name:a,path:t.path,staged:Boolean(t.staged),status:t.status}}function ze(t){let e=new Map;for(let a of t){let r=a.path.split("/"),i;if(a.path.endsWith(".json")||a.path.endsWith(".class.json")||Zt(a.path))i=r.length>1?`/${r.at(-2)}`:`/${r[0]}`;else i="Other";if(!e.has(i))e.set(i,[]);e.get(i).push(a)}return[...e.entries()].map(([a,r])=>({files:r.map((i)=>Ft(i)),key:a,name:a}))}function Oe(t){return{hash:t.hash.slice(0,7),key:t.hash,message:t.message,meta:`${t.author} · ${ta(t.date)}`}}function Ve(t){return t?`Last updated ${new Date(t).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}`:""}function Dt(){if(!D)return"no-project";let{error:t,loading:e,status:a}=y.git;if(!a&&!e&&!t)return"loading";return a&&!a.isRepo?"no-repo":"repo"}function X(){let{branches:t,commitMessage:e,error:a,lastUpdated:r,loading:i,logEntries:o,status:n,subTab:s}=y.git,l=n?.files??[],c=l.filter((d)=>d.staged),m=l.filter((d)=>!d.staged),h=[...c,...m],x=!n?.ahead&&!n?.behind,f=n?.ahead?`${n.ahead} ahead`:"",k=n?.behind?`${n.behind} behind`:"",N=o??[];return{branchName:(t?.current??n?.branch??"")||"—",branchOptions:[...(t?.branches??[]).map((d)=>({label:d,value:d})),{label:"+ New branch…",value:Z}],branchValue:K??t?.current??"",busy:Boolean(i),canClone:xw(),changedCount:String(h.length),changesLabel:h.length>0?`Local Changes (${h.length})`:"Local Changes",commitMessage:e,commits:N.map((d)=>Oe(d)),error:a??"",filesState:h.length>0?"listed":"empty",groups:ze(h),hasError:Boolean(a),hasLastUpdated:Boolean(r),hasStaged:c.length>0,hasUnstaged:m.length>0,historyState:N.length>0?"listed":"empty",lastUpdated:Ve(r),pullLabel:k?`Pull (${k})`:"Pull",pushLabel:f?`Push (${f})`:"Push",remoteState:(n?.remotes?.length??0)>0?"remote":"local",stagedCount:String(c.length),stagedFiles:c.map((d)=>Ft(d)),subTab:s,syncLabel:x?"Up to date":`${f}${f&&k?", ":""}${k}`,view:Dt()}}var Z="__new__";function Et(t){return y.git.status?.files.find((e)=>e.path===t)}async function Lt(){let t=y.git.commitMessage.trim();if(!t)return;if(y.git.commitMessage="",await ZC(),!await b("gitCommit",t))Gt(t)}async function _e(){let t=y.git.commitMessage.trim();if(!t)return;y.git.commitMessage="",y.git.loading=!0,y.git.error=null,await ZC();let e=p(),a=!1;try{await e.gitCommit(t),a=!0,await e.gitPush(),await dc()}catch(r){if(y.git.error=te(r),y.git.loading=!1,!a)Gt(t)}}async function Je(t){let{branches:e,status:a}=y.git;if(t===Z){K=Z,Rt();let r=await On("New Branch",{confirmLabel:"Create",message:`Branching from ${e?.current||a?.branch||"the current branch"}.`,placeholder:"feature/my-change",validate:(i)=>i.trim()?"":"Enter a branch name."});if(K=null,Rt(),r)await b("gitCreateBranch",r);return}if(t!==e?.current)await b("gitCheckout",t)}async function Be(t){let e=Et(t);if(!e)return;let a=Tt(e.status)?it(e.path,e.status):`"${e.path}" has no change this view can open.`;if(a){y.git.error=a;return}try{y.git.loading=!0;let r=await I(e.path,e.status);y.git.diffState=r;let i=await ot(e.path);if(U.setGitDiffState?.(r),i)U.setCanvasMode?.(i,"git-diff")}catch(r){y.git.error=`Failed to load diff: ${te(r)}`}finally{y.git.loading=!1}}async function qe(t){if(Et(t)?.status==="U")return;if(!await Qo("Discard Changes",`Discard changes to ${t}?`,{confirmLabel:"Discard",destructive:!0}))return;await b("gitDiscard",[t])}function Ke(t){(me("wq6q0v3y"),import("./menu-wq6q0v3y.js")).then(({openMenu:e})=>{e({label:"Commit options",opener:t,place:(a)=>{let r=He(t);return{x:Math.max(4,r.right-a.width),y:r.bottom+4}},region:"git-commit",rows:[{destructive:!1,disabled:!1,dividerAbove:!1,id:"git.commitWithoutSync",run:()=>{Lt()},title:"Commit (don't sync)"}]})})}function Xe(t){if(y.git.subTab=t,t==="history"&&!y.git.logEntries)Ie()}var Ze={chooseBranch:(t)=>{Je(t)},clone:()=>{U.cloneRepository?.()},commit:()=>{Lt()},commitAndSync:()=>{_e()},createRepository:()=>{O({projectName:D?.name||"my-project"})},discard:(t)=>{qe(t)},editMessage:(t)=>{y.git.commitMessage=t},fetch:()=>{b("gitFetch")},initRepository:()=>{Mt()},openCommitMenu:Ke,openFile:(t)=>{Be(t)},pull:()=>{Ue()},push:()=>{b("gitPush")},refresh:()=>{dc()},selectTab:Xe,stage:(t)=>{b("gitStage",[t])},stageAll:()=>{let t=(y.git.status?.files??[]).filter((e)=>!e.staged).map((e)=>e.path);b("gitStage",t)},unstage:(t)=>{b("gitUnstage",[t])},unstageAll:()=>{let t=(y.git.status?.files??[]).filter((e)=>e.staged).map((e)=>e.path);b("gitUnstage",t)}},w=null;function Ut(){if(!w)return;w.scope.stop(),w.handle.dispose(),w=null}function Rt(){w?.handle.update(X())}function Ye(){if(C)return;C=setInterval(()=>{if(y.leftTab==="git"&&!y.git.loading)dc()},dI)}function Qe(t,e){U=e;let a=t.querySelector(".panel-content")??t;if(We()&&Dt()==="loading")dc();if(w&&(w.host!==a||!w.handle.connected()))Ut();if(w)return;let r=At(a,X(),Ze),i=ge();i.run(()=>{Q(()=>{let o=X();if(o.view==="repo")Ye();r.update(o)})}),w={handle:r,host:a,scope:i}}function d1(t){return tt}function ta(t){let e=new Date(t),a=Zi()-e.getTime(),r=Math.floor(a/60000);if(r<1)return"just now";if(r<60)return`${r}m ago`;let i=Math.floor(r/60);if(i<24)return`${i}h ago`;let o=Math.floor(i/24);if(o<30)return`${o}d ago`;return e.toLocaleDateString()}function ea(){return[{category:"Source Control",id:"git.init",level:"project",menus:["commandbar/overflow","palette"],group:"7_scm",requires:"an open project that git is not already tracking",when:(t)=>t.project.open,enablement:(t)=>!t.project.isRepo,run:async()=>{await Mt()},title:"Initialize Repository"},{category:"Source Control",id:"git.createGithubRepository",level:"project",menus:["commandbar/overflow","palette"],group:"7_scm",requires:"a project tracked by git",when:(t)=>t.project.open,enablement:(t)=>t.project.isRepo,run:async()=>{await O({projectName:D?.name||"my-project"})},title:"Create GitHub Repository"},{category:"Source Control",id:"git.push",level:"project",menus:["commandbar/overflow","palette"],group:"7_scm",requires:"a project tracked by git",when:(t)=>t.project.open,enablement:(t)=>t.project.isRepo,run:async()=>{await Ee()},title:"Push"},{category:"Source Control",id:"git.signInToGithub",level:"application",menus:["palette"],group:"7_scm",run:async()=>{await Le()},title:"Sign In to GitHub"}]}function u1(t){t.registerAll(ea())}function Wf(){if(C)clearInterval(C),C=null;Ut()}function h1(){Gn({id:"git",title:"Source Control",railLabel:"Source",level:"project",dock:"navigator",icon:"git-branch",badge:(t)=>t.git.dirtyCount||null,render:()=>tt,afterRender:(t,e)=>{Qe(e,t.deps)}})}
|
|
2
|
+
export{bw,fE,rb,mE,sb,vw,tp,np,a1,ab,gE,yw,bE,zf,dc,l1,ww,xw,c1,d1,u1,Wf,h1};
|
|
3
|
+
|
|
4
|
+
//# debugId=6B474683BE46953D64756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-dtmdjmqb.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{p,We}from"./studio-6k1eswp9.js";import{te}from"./studio-ery42sqr.js";import{Fs,K1}from"./studio-81twpmzj.js";import{ge,Xa,Q,v,re,Zi,Jr,S,tl,lh,Fp}from"./studio-0nm2skex.js";import{Wu,Te,q,_m,Sc,Yo,gv,bv,on,ma,km,YC,An,g,u}from"./studio-27tc8q0h.js";import{qt,wi,Ip,Zt,$r,hS,Us,pS}from"./studio-ft8pfpp0.js";import{mm}from"./studio-ant1zbp3.js";import{TS,TI,LI,Fd,zm,ne}from"./studio-dknr8m7b.js";import{xi,T,R,rn,Qo}from"./studio-z1vdxq0e.js";import{$t}from"./studio-ks0ecgjx.js";import{hs,pr,y}from"./studio-w8w9frjy.js";import{sT}from"./studio-sadckcpp.js";import{mc}from"./studio-b5rxwkj2.js";import{la,kb}from"./studio-sgzss898.js";import{st,Go,ET,aC}from"./studio-pvj970st.js";import{_b}from"./studio-36s6qjgq.js";import{K,so,Xo,Mo,D,Hx}from"./studio-153mwkyq.js";import{Ve}from"./studio-p6avneaq.js";var xe={$schema:"https://jxsuite.com/schema/v1",$id:"StudioJumpBar",$description:"The jump bar: one pane's address, outermost step first, every step a command the adapter has already resolved against the registry. A step is a button when its command can run and a readout when it cannot — an address with a hole in it is a lie about containment, so a step never disappears. A step with more than one place to go carries the chevron that opens its siblings; one alternative is not a choice and draws no control. Nothing here decides what the bar says, which step is where you are, or what a chevron opens.",tagName:"nav",attributes:{part:"bar","aria-label":"Location","data-jx-region":"${state.region}",hidden:"${state.empty ? '' : null}"},style:{$description:"The `.jump-bar` rules the bar used to take from `styles/shell.css`, brought here and re-valued onto the kit's own layer. It scrolls rather than wraps — a deep selection must not push the stage down by a second line — and the overflow is taken at the START, because the leaf is the part being read. The height is the one number this file shares with its adapter: the stage's `--jump-bar-h` offset must be the box this rule draws.",display:"flex",alignItems:"center",gap:"1px",height:"24px",padding:"0 var(--jx-space-3)",minWidth:"0",overflowX:"auto",scrollbarWidth:"none",whiteSpace:"nowrap",boxSizing:"border-box",fontFamily:"var(--jx-font-sans)",fontSize:"var(--jx-text-xs)",color:"var(--jx-fg-dim)",background:"var(--jx-bg-panel)",borderBottom:"1px solid var(--jx-border)","&[hidden]":{display:"none"},"&::-webkit-scrollbar":{display:"none"},'& [part="step"]':{display:"flex",alignItems:"center",flexShrink:"0"},'& [part="separator"]':{flexShrink:"0",padding:"0 1px",color:"var(--jx-fg-dim)",opacity:"0.6"},'& [part="crumb"]':{maxWidth:"28ch",overflow:"hidden",margin:"0",padding:"0 var(--jx-space-2)",border:"none",borderRadius:"var(--jx-radius-xs)",background:"transparent",color:"inherit",font:"inherit",lineHeight:"1",whiteSpace:"nowrap",textOverflow:"ellipsis"},'& button[part="crumb"]':{cursor:"pointer",":hover:not(:disabled)":{color:"var(--jx-fg)",background:"var(--jx-hover-bg)"},":disabled":{cursor:"default",opacity:"0.6"},":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"-2px"}},'& [part="crumb"][aria-current]':{$description:"Where you ARE is stated by weight, not by taking the control away: the leaf still selects, which is how a stray click in the canvas is undone without leaving the bar.",color:"var(--jx-fg)"},'& span[part="crumb"]':{$description:"A step with no runnable command is a readout, not a dead button. No hover, no pointer, no promise.",cursor:"default"},'& [part="alternatives"]':{padding:"0 1px",border:"none",borderRadius:"var(--jx-radius-xs)",background:"transparent",color:"inherit",font:"inherit",lineHeight:"1",cursor:"pointer",":hover":{color:"var(--jx-fg)",background:"var(--jx-hover-bg)"},":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"-2px"}}},children:[{$prototype:"Array",items:{$ref:"#/state/segments"},key:{$ref:"$map/item/key"},map:{tagName:"span",attributes:{part:"step","data-jump-kind":"${$map.item.kind}"},children:[{tagName:"span",attributes:{part:"separator-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/leading"},cases:{false:{tagName:"span",attributes:{part:"separator","aria-hidden":"true"},textContent:"›"}}},{tagName:"span",attributes:{part:"crumb-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/control"},cases:{button:{tagName:"button",attributes:{part:"crumb",type:"button",title:"${$map.item.title}","aria-current":"${$map.item.current ? 'true' : null}",disabled:{$ref:"$map/item/disabled"}},textContent:"${$map.item.label}",onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/run"},value:[{$ref:"$map/item/key"}]}]}},readout:{tagName:"span",attributes:{part:"crumb",title:"${$map.item.title}","aria-current":"${$map.item.current ? 'true' : null}"},textContent:"${$map.item.label}"}}},{tagName:"span",attributes:{part:"alternatives-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasChoices"},cases:{true:{tagName:"button",attributes:{part:"alternatives",type:"button","aria-haspopup":"menu","aria-label":"${$map.item.altsLabel}",title:"${$map.item.altsLabel}"},textContent:"⌄",onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/choose"},value:[{$ref:"$map/item/key"},{$ref:"event#/currentTarget"}]}]}}}}]}}]};T("jump-bar",xe);function Se(e,t,r){let n=v({...r,empty:!0,region:t,segments:[]});e.replaceChildren();let l=null,i=!1;return R("jump-bar",n,e).then((d)=>{if(i){d.dispose();return}l=d}),{dispose(){i=!0,l?.dispose(),l=null,e.replaceChildren()},update(d){n.segments=[...d],n.empty=d.length===0}}}var ke={$schema:"https://jxsuite.com/schema/v1",$id:"StudioPaneGrid",$description:"The pane grid (studio.md §18.1): one cell per pane, with a splitter before every cell but the first. Every box here is EMPTY by design — the FIVE inside a cell are hosts other modules fill (`panels/tab-strip.ts` the strip, `panels/jump-bar.ts` the jump bar, `panels/pane-context.ts` the chrome layer, `canvas/canvas-render.ts` the stage, `panels/pane-grid.ts` itself the right-edge drop zone), and the stage is an ISLAND in the studio-ui-guidelines.md §9.4 sense: the canvas host mounts a cross-origin `<iframe>` into it, so nothing this document draws may ever go inside it. What the document owns is the STRUCTURE and the STYLE — the cell's own two-row grid, the three row-2 children that share its lower cell, and the splitter — which is `styles/shell.css`'s `.pane*` block and `styles/canvas.css`'s `.pane-stage` rule, carried here and keyed on `part`. Two things are load-bearing and easy to undo. (1) **A row that moves reloads an iframe**, so the keyed `$map` is not an optimisation: `workspace.panes[0]` is always the primary and `MAX_PANES` is 2, the key is the pane id, and the runtime's forward-cursor pass therefore never moves a kept row — gaining or losing the side pane leaves the primary's node, and the frame inside it, untouched. (2) **The splitter must sit BETWEEN two cells and inside neither**, so each row is a `display: contents` wrapper holding its own leading splitter and its cell: the wrapper generates no box, so the splitter and the two cells are the grid items of `#pane-grid` in DOM order, and a pointer landing on the splitter is in no cell at all. Every selector below is a `>` chain from the root, because a pane's stage hosts other surface documents and a bare `[part=\"row\"]` descendant rule would reach into them.",tagName:"div",attributes:{part:"grid",role:"none"},style:{$description:"The pane's own layout, and the splitter's. The tracks of `#pane-grid` ITSELF are not here and must not be: the track count depends on `workspace.panes.length` and the split on `shell.paneSplit`, which is written on every `pointermove` of a drag — `panels/pane-grid.ts` writes them as one inline `grid-template-columns` on the host, so a drag moves a track edge and never a node. The splitter's own paint is not here either: `jx-split` owns the hairline, the cursors and the drag state it mirrors as `data-dragging`, so this block says only where the element is placed.",display:"contents",'& > [part="row"]':{$description:"One pane's row: its leading splitter and its cell, generating no box of their own so both are grid items of `#pane-grid`.",display:"contents"},'& > [part="row"] > [part="splitter-slot"]':{display:"contents"},'& > [part="row"] > [part="splitter-slot"] > jx-split':{$description:"WHERE the splitter sits, and nothing about what it looks like: the hairline, the two cursors, the hover and drag colours and the focus ring are `jx-split`'s own, and the `.dragging` class this block used to name is gone with the module that wrote it — the element mirrors its own gesture as `data-dragging` and paints itself. BOTH grid axes are `auto`: a definite row position — the `2 / 4` a column handle inherits on the APP grid, or the `1 / -1` this rule used to carry — moves the item into an earlier step of CSS Grid's auto-placement, so the splitter claimed column 1 and the two cells flowed around it into the 5px track and the second half. DOM order was already right; the placement algorithm was not reading it. `width: auto` with `justify-self: stretch` is what hands the thickness back to the TRACK `panels/pane-grid.ts` writes, so the element's own 5px default cannot disagree with the column it is placed in.",gridRow:"auto",gridColumn:"auto",justifySelf:"stretch",margin:"0",width:"auto",zIndex:"10"},'& > [part="row"] > [part="pane"]':{$description:'ONE PANE, and one COLUMN, declared. Four children name `grid-row: 2` in order to share the lower cell, and auto-placement answers that by inventing an implicit column each: the jump bar, the chrome layer, the stage and the drop zone lined up side by side, the stage taking a third of the pane and pinning the document to the right edge. `grid-template-columns` is what makes "share the cell" mean it, and every row-2 child restates `grid-column: 1` so a future fifth one cannot re-open the same hole. No unit test can see this — happy-dom does no layout, so every rect is zero — which is why the screenshot lane is what caught it.',display:"grid",gridTemplateColumns:"minmax(0, 1fr)",gridTemplateRows:"auto minmax(0, 1fr)",minWidth:"0",minHeight:"0"},'& > [part="row"] > [part="pane"] > [part="strip"]':{gridRow:"1",gridColumn:"1",minHeight:"0",minWidth:"0"},'& > [part="row"] > [part="pane"] > [part="strip"]:empty':{$description:"A pane with nothing to say costs no band. The strip host is empty until `panels/tab-strip.ts` mounts a document into it, and empty again the moment it disposes.",display:"none"},'& > [part="row"] > [part="pane"] > [part="jump"]':{$description:"The jump bar. Like the chrome layer below it this shares the pane's lower cell rather than owning a row, so the two bars stack OVER the stage instead of pushing it down. `align-self: start` is what keeps it the height of its own content instead of the height of the cell, so the bar never covers the stage it sits above.",gridRow:"2",gridColumn:"1",alignSelf:"start",position:"relative",zIndex:"3",minWidth:"0",maxWidth:"100%"},'& > [part="row"] > [part="pane"] > [part="chrome"]':{$description:'The pane context bar and the floating zoom pod. The layer itself is inert and only its children take the pointer; `surfaces/pane-context.json` owns what they look like. Offset by `--jump-bar-h` for the same reason the stage is: the jump bar is stacked over this same cell, and one projection per bar is what keeps "no tab open" costing no dead band.',gridRow:"2",gridColumn:"1",marginTop:"var(--jump-bar-h, 0px)",position:"relative",zIndex:"2",minWidth:"0",display:"flex",flexDirection:"column",justifyContent:"space-between",pointerEvents:"none"},'& > [part="row"] > [part="pane"] > [part="chrome"] > *':{pointerEvents:"auto"},'& > [part="row"] > [part="pane"] > [part="pane-stage"]':{$description:"The stage: the pane's own axis (`styles/canvas.css`) over its placement in the cell (`styles/shell.css`). Offset by the SUM of the two bars stacked over this cell — `--jump-bar-h` (written by `panels/jump-bar.ts`) and `--pane-context-h` (by `panels/pane-context.ts`), both onto the CELL, which is why this reads them by cascade — so neither ever covers the document, and by zero when no tab is open, so the welcome screen does not sit under a band nothing explains. Two variables rather than one total: each bar owns its own answer, and a bar that renders nothing writes 0 without knowing the other exists.",gridRow:"2",gridColumn:"1",marginTop:"calc(var(--jump-bar-h, 0px) + var(--pane-context-h, 0px))",position:"relative",overflow:"auto",background:"var(--bg-panel)",minWidth:"0",display:"flex",gap:"var(--jx-space-6)",alignItems:"flex-start"},'& > [part="row"] > [part="pane"] > [part="drop-zone"]':{$description:"The right-edge target that creates a second pane (§18.1). Sits ABOVE the stage (`z-index: 4` against the stage's own stacking, jump's 3, chrome's 2) so a drag reaches it before it reaches the cross-origin iframe underneath, which would otherwise swallow every drag event with no affordance to say so. `pointer-events: none` when unarmed — a mouse doing anything other than dragging a tab or a file must pass straight through to the stage — and `auto` only while `data-armed` is set, which `panels/pane-grid.ts`'s own arming monitor writes for the DURATION of a drag it recognises, never for a click.",gridRow:"2",gridColumn:"1",position:"relative",zIndex:"4",minWidth:"0",pointerEvents:"none"},'& > [part="row"] > [part="pane"] > [part="drop-zone"][data-armed]':{pointerEvents:"auto"},'& > [part="row"] > [part="pane"] > [part="drop-zone"][data-over]::after':{$description:"The right BAND, not the whole cell: the zone only ever ACCEPTS a drop in that band (`panels/pane-grid.ts`'s `edgeData`), so lighting the whole cell would promise a drop this element refuses everywhere else in it.",content:'""',position:"absolute",insetBlock:"0",insetInlineEnd:"0",insetInlineStart:"50%",background:"color-mix(in srgb, var(--accent) 14%, transparent)",borderInlineStart:"2px solid var(--accent)"}},children:[{$description:"Keyed on the PANE ID, and that is the whole of §18.1 rule 1's structural half: the key is what makes the runtime MOVE a kept row rather than rebuild it, and re-parenting is not a move for an `<iframe>` — it reloads, dropping its `iframe-channel` connection, its shadow document and every `ready` panel with it. A row renders complete (its cell, its five hosts and its splitter) inside the row's own effect scope before it is inserted, so there is no frame in which a cell exists with no stage inside it.",$prototype:"Array",items:{$ref:"#/state/rows"},key:{$ref:"$map/item/id"},map:{tagName:"div",attributes:{part:"row",role:"none"},children:[{$description:"Present on every cell but the first. It is a child of the ROW rather than of either cell, so a splitter drag never reaches the cell's pane-focus listener — and it is created and destroyed with the second pane, so nothing re-inserts it while a pointer capture is live.",tagName:"div",attributes:{part:"splitter-slot",role:"none"},$switch:{$ref:"$map/item/split"},cases:{shown:{$description:'`jx-split` (ui.md §5.5), which is where `role="separator"`, the tab stop, `aria-valuenow` and the whole keyboard now live. This document used to write the role on a bare div and hand the div to `ui/panel-resize.ts`, which made the pane split the one dock-sized thing in Studio a reader could not move without a mouse — an SC 2.1.1 failure with a drag handle drawn on it, and an SC 2.5.7 one besides. Every prop below is a CONSTANT except `value`: `min` and `max` are the shell\'s own supported range, and `gap` is the pixel floor the element converts against the track it measures itself, which is why nothing here has to be recomputed when the window resizes. `collapse` is the even split rather than the floor, because both sides of this splitter are real panes: the first Enter or double click is the 50/50 reset this gesture has always been, and the second one is the return trip it never had.',tagName:"jx-split",attributes:{part:"splitter"},$props:{label:"Pane split",value:{$ref:"#/state/paneSplit"},min:{$ref:"#/state/splitMin"},max:{$ref:"#/state/splitMax"},gap:{$ref:"#/state/splitGap"},collapse:{$ref:"#/state/splitDefault"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/move"},value:[{$ref:"event#/target/value"}]}]},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/settle"},value:[]}]}}}},{$description:'One pane\'s cell. `pane.<id>` goes on the STAGE and `pane.<id>/tabs` on the strip, never on this element: nine shots crop `pane.primary` meaning "the canvas", and moving the id up one level would silently widen all nine to include the strip and the two bars, which no gate can tell from an intended crop.',tagName:"div",attributes:{part:"pane","data-pane-id":"${$map.item.id}"},children:[{tagName:"div",attributes:{part:"strip","data-jx-region":"${$map.item.stripRegion}"}},{$description:"The jump bar and the context bar are HANDED this box rather than resolving a region into it. They cannot resolve one the way the strip does: nothing inside the strip re-stamps `pane.<id>/tabs`, while both bars stamp `pane.<id>/jump` and `pane.<id>/context` on markup they render INSIDE these two divs — so a region on the wrapper as well would put the same id on two nested elements, and `resolveRegion` takes the LAST match. Sixty shots crop `pane.primary/context`; a second, larger element carrying it is a silently widened crop.",tagName:"div",attributes:{part:"jump"}},{tagName:"div",attributes:{part:"chrome"}},{$description:"Drawn EMPTY and left empty. `canvas/canvas-render.ts` is this element's render root and `canvas/iframe-host.ts` mounts the artboards' iframes into it; a node cannot have two owners of its child list.",tagName:"div",attributes:{part:"pane-stage","data-jx-region":"${$map.item.region}"}},{$description:"The right-edge drop target (§18.1). No `data-jx-region`: `pane.<id>` uniqueness names the stage, and a second element answering to it would be a silently widened crop the moment a shot cropped this pane.",tagName:"div",attributes:{part:"drop-zone",role:"none","data-armed":"${state.armed ? '' : null}","data-over":"${state.edgePane === $map.item.id ? '' : null}"}}]}]}}]};T("pane-grid",ke);var Ye="pane",Qe="pane-stage",Zf=`[part="${Ye}"]`,zE=`[part="${Qe}"]`,Xe=new Map([["pane","pane"],["strip","strip"],["jump","jump"],["chrome","chrome"],["pane-stage","stage"],["drop-zone","dropZone"]]);function Ze(e){let t=typeof e==="string"?void 0:e.attributes?.part;return typeof t==="string"?t:""}function et(e){let t=e?.$map?.item;return typeof t?.id==="string"?t.id:""}function WE(e,t,r,n){e.replaceChildren();let l=v({armed:!1,edgePane:"",move:n.move,paneSplit:r.value,rows:t,settle:n.settle,splitDefault:r.collapse,splitGap:r.gap,splitMax:r.max,splitMin:r.min}),i=null,d=!1,h=R("pane-grid",l,e,{onNodeCreated:(c,w,x,E)=>{let G=Xe.get(Ze(x));if(G)n.cellPart(et(E),G,c)}}).then((c)=>{if(d){c.dispose();return}i=c});return{dispose(){d=!0,i?.dispose(),i=null,e.replaceChildren()},drag(c){l.armed=c.armed,l.edgePane=c.edgePane},ready:h,update(c,w){l.rows=c,l.paneSplit=w}}}var tt="--jump-bar-h",rt=24;function le(e){if(!e)return"Untitled";let t=D?.projectRoot;return t&&e.startsWith(`${t}/`)?e.slice(t.length+1):e}function nt(e,t){let r=[];for(let n=0;n<t.length;){let l=t[n],i=l==="map"?1:2,d=t.slice(0,n+i),h=K(e,d),c=h?.tag,w=h?.$prototype==="Array"?"Repeater":Ve(h?.tagName)||(typeof c==="string"?c:"")||(l==="cases"?String(t[n+1]):`[${t[n+1]}]`);r.push({label:w,path:d}),n+=i}return r}function ot(e,t,r){let n=t[r];if(!n)return[];let l=r===0?[]:t[r-1].path,i=K(e,l),d=n.path.at(-2),h=n.path;if(d==="cases"){let w=i?.cases;if(!w||typeof w!=="object")return[];return Object.keys(w).map((x)=>{let E=[...l,"cases",x];return $e(e,E,x,h)})}if(d!=="children")return[];let c=[];for(let[w,x]of so(i).entries()){if(typeof x==="string")continue;let E=[...l,"children",w];c.push($e(e,E,Mo(x),h))}return c}function $e(e,t,r,n){let l=K(e,t),i=l?Mo(l):r,d={args:{path:t},command:"selection.set",label:i};return Xo(t,n)?{...d,current:!0}:d}function it(e,t=null){if(!e)return[];let r=[],n=D;if(n)r.push({choices:[],command:"project.openRecent",kind:"project",label:n.name,title:n.projectRoot});r.push({choices:[],command:t?"pane.pin":"palette.openFiles",kind:"file",label:le(e.documentPath),title:e.documentPath??"Not saved to disk yet"});let l=e.session.ui.editingFunction,i=e.session.ui.editingFormula;if(l)return r.push(Pe("ƒ",l)),r;if(i)return r.push(Pe("fx",i)),r;let d=Te(e.session.selection);if(d&&d.length>0){let h=nt(e.doc.document,d);for(let[c,w]of h.entries()){let x=K(e.doc.document,w.path);r.push({args:{path:w.path},choices:ot(e.doc.document,h,c),command:"selection.set",kind:"node",label:c===h.length-1&&x?Mo(x):w.label,title:w.path.join(" / ")})}}return r}function Pe(e,t){return{choices:[],command:null,kind:"editor",label:`${e} ${t.defName??t.eventKey??"editor"}`}}function at(e){let t=e.args?.path;return e.kind==="node"&&Array.isArray(t)?`node:${t.join("/")}`:e.kind}function lt(e,t){return t!==null&&Boolean(e?.get(t))&&e.isVisible(t)}function dt(e,t,r){let n=e.get(r),l=e.disabledReason(r),i=e.keymap.formatBinding(r),d=l?`${n.title} — requires ${l}`:i?`${n.title} (${i})`:n.title;return t.title?`${t.title} · ${d}`:d}function ct(e,t,r,n){let l=t.command,i=lt(e,l);return{altsLabel:`Siblings of ${t.label}`,control:i?"button":"readout",current:n,disabled:i&&e.disabledReason(l)!==void 0,hasChoices:e!==null&&t.choices.length>1,key:at(t),kind:t.kind,label:t.label,leading:r,title:i?dt(e,t,l):t.title??t.label}}var F=new Map,H=null,N=null;function de(){let e=N;N=null,e?.close()}function ut(e,t){let r=ne();if(!r)return;de();let n=e.choices.map((i,d)=>({checked:i.current===!0?"true":"false",destructive:!1,disabled:!1,dividerAbove:!1,id:String(d),run:()=>{rn(r,i.command,i.args,"Jump Bar")},title:i.label}));N=$t({label:`Go to a sibling of ${e.label}`,onClosed:(i)=>{if(N===i)N=null},opener:t,region:"jump-bar",rows:n})}function U(e,t){(t?.closest(Zf)??document.documentElement).style.setProperty(tt,`${e}px`)}function pt(e){let t=it(st(e),Go(e)),r=ne();return{segments:t,steps:t.map((n,l)=>ct(r,n,l===0,l===t.length-1))}}function Ce(e){if(F.size===0)return;de();for(let[t,r]of F){if(e!==void 0&&t!==e)continue;let{segments:n,steps:l}=pt(t);r.segments=new Map(l.map((i,d)=>[i.key,n[d]])),r.surface.update(l),U(l.length===0?0:rt,r.host)}}function Hw(e,t){let r=F.get(e);if(r?.host===t)return;if(r)r.surface.dispose(),U(0,r.host),F.delete(e);if(!t)return;let n={host:t,segments:new Map,surface:Se(t,xi(e,"jump"),{choose:(l,i)=>{let d=F.get(e)?.segments.get(l);if(d)ut(d,i)},run:(l)=>{let i=F.get(e)?.segments.get(l),d=ne();if(i?.command&&d)rn(d,i.command,i.args,"Jump Bar")}})};F.set(e,n),Ce(e)}function VE(e){mt(),Hw(An,e),H=ge(),H.run(()=>{Q(()=>{ne(),D?.name;for(let t of g.panes){let r=st(t.id);if(!r)continue;r.doc.document,r.documentPath,r.session.selection.map((n)=>n.join("/")).join("|"),r.session.ui.editingFormula,r.session.ui.editingFunction}Ce()})})}function mt(){de(),H?.stop(),H=null;for(let e of F.values())e.surface.dispose(),U(0,e.host);F.clear(),U(0)}var ce=60000,ue=60*ce,W=24*ue;function pe(e,t=Zi()){let r=Math.max(0,t-e);if(r<ce)return"just now";if(r<ue)return`${Math.floor(r/ce)}m ago`;if(r<W)return`${Math.floor(r/ue)}h ago`;if(r<2*W)return"yesterday";if(r<7*W)return`${Math.floor(r/W)}d ago`;return new Date(e).toLocaleDateString()}function ft(e){let t=e.messageCount;return{key:e.id,meta:`${pe(e.updatedAt)} · ${t} ${t===1?"message":"messages"}`,title:e.title}}function UE(e){return e.map((t)=>ft(t))}var Re={$schema:"https://jxsuite.com/schema/v1",$id:"StudioStatusbar",$description:"The status bar: ambient state in the shell's level order, PROJECT then DOCUMENT then SELECTION. The adapter hands in `fields`, each with its region and its items; an item with a command is a button that runs it through `run`, and an item without one is a readout. Nothing here decides what the bar says.",tagName:"div",attributes:{part:"bar"},style:{display:"flex",alignItems:"stretch",flex:"1",minWidth:"0",'& > [part="field"]':{display:"flex",alignItems:"center",gap:"2px",minWidth:"0",padding:"0 var(--jx-space-3)"},'& > [part="field"]:last-child':{overflow:"hidden"},'& > [part="field"] + [part="field"]':{borderLeft:"1px solid var(--jx-border)"},'& [part="item"], & [part="state"]':{maxWidth:"32ch",overflow:"hidden",margin:"0",padding:"0 var(--jx-space-2)",border:"none",borderRadius:"var(--jx-radius-xs)",background:"transparent",color:"inherit",font:"inherit",lineHeight:"1",whiteSpace:"nowrap",textOverflow:"ellipsis"},'& [part="item"]':{cursor:"pointer",":hover:not(:disabled)":{color:"var(--jx-fg)",background:"var(--jx-hover-bg)"},":disabled":{cursor:"default",opacity:"0.6"},":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"-2px"}},'& [part="state"]':{cursor:"default"}},children:[{$prototype:"Array",items:{$ref:"#/state/fields"},key:{$ref:"$map/item/id"},map:{tagName:"div",attributes:{part:"field","data-jx-region":"${$map.item.region}"},children:[{$prototype:"Array",items:{$ref:"$map/item/items"},key:{$ref:"$map/item/key"},map:{tagName:"span",attributes:{part:"slot"},style:{display:"contents"},$switch:{$ref:"$map/item/kind"},cases:{button:{tagName:"button",attributes:{part:"item",type:"button",title:"${$map.item.title}",disabled:{$ref:"$map/item/disabled"}},textContent:"${$map.item.label}",onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/run"},value:[{$ref:"$map/item/key"}]}]}},state:{tagName:"span",attributes:{part:"state",title:"${$map.item.title}"},textContent:"${$map.item.label}"}}}}]}}]};T("statusbar",Re);var Z=null,Ee=new Map;function je(e){if(e)Ee.set(e,Zi())}function gt(e,t,r){if(r.command===null)return{args:void 0,command:null,disabled:!1,key:`${t}:${r.label}`,kind:"state",label:r.label,title:r.title??r.label};let n=r.command;if(!e?.get(n)||!e.isVisible(n))return null;let l=e.get(n),i=e.disabledReason(n),d=e.keymap.formatBinding(n),h=i?`${l.title} — requires ${i}`:d?`${l.title} (${d})`:l.title;return{args:r.args,command:n,disabled:i!==void 0,key:`${t}:${n}`,kind:"button",label:r.label,title:r.title?`${r.title} · ${h}`:h}}function ee(e,t,r){let n=`statusbar/${t}`,l=r.map((i)=>i===null?null:gt(e,n,i)).filter((i)=>i!==null);if(l.length===0)return null;return{id:t,items:l,region:n}}function yt(e,t){return`${e>0?` ↑${e}`:""}${t>0?` ↓${t}`:""}`}function bt(e){let t=D,{status:r}=y.git,n=Fp(),l=sT(),i=u.value?on(u.value).peers.length:0;return ee(e,"project",[t?{command:"project.openRecent",label:t.name}:{command:"project.open",label:"No project"},r?.isRepo===!0&&r.branch?{command:"panel.focus.git",label:`⑂ ${r.branch}${yt(r.ahead,r.behind)}`,title:`${r.files.length} changed file(s)`}:null,l?{command:l.command,label:l.label,title:l.title}:null,n>0?{args:{tab:"problems"},command:"view.setBottomTab",label:`⚠ ${n}`,title:`${n} problem(s)`}:null,i>0?{command:"collab.showStatus",label:`${i} peer${i===1?"":"s"}`,title:`${i} peer${i===1?"":"s"} in this document`}:null])}function wt(e,t){if(e==="none")return"";if(e!=="canvas")return Wu[e];return t.charAt(0).toUpperCase()+t.slice(1)}function vt(e,t,r){if(t)return{command:null,label:"Read-only",title:"A collaborator owns this session's file"};if(e)return{command:"file.save",label:"Unsaved changes"};return r===void 0?{command:null,label:"Saved"}:{command:null,label:`Saved ${pe(r)}`}}function xt(e){let t=u.value;if(!t)return null;let r=e?.context()??null,n=r?wt(r.editor.kind,r.canvas.view):"",l=on(t),i=t.documentPath===null?void 0:Ee.get(t.documentPath);return ee(e,"document",[{command:"palette.openFiles",label:le(t.documentPath),title:t.documentPath??"Not saved to disk yet"},n?{command:null,label:n,title:"The pane's view — change it on the pane context bar"}:null,vt(t.doc.dirty,l.readOnly,i)])}function St(e){let t=u.value?.session.selection??[];if(t.length>0)return t.length>1?ee(e,"selection",[{command:null,label:`${t.length} selected`,title:`${t.length} elements are selected; the jump bar names the primary`}]):null;return y.stylebook.selection?ee(e,"selection",[{command:null,label:y.stylebook.selection.replaceAll(" "," › "),title:"The style rule being edited"}]):null}function kt(){let e=ne();return[bt(e),xt(e),St(e)].filter((t)=>t!==null)}var Y=null,J=null,X=null;function Ge(){return Y??=v({fields:[],run:(e)=>{let t=Y?.fields.flatMap((n)=>n.items).find((n)=>n.key===e),r=ne();if(t?.command&&r)rn(r,t.command,t.args,"Status Bar")}}),Y}function Pt(){if(J||!Hx)return;J=R("statusbar",Ge(),Hx),J.then((e)=>{X=e})}function A1(){Ge().fields=kt(),Pt()}function qE(){Ct(),Z=ge(),Z.run(()=>{Q(()=>{ne(),y.stylebook.selection,y.git.status,Jr.length;let e=u.value;if(e)e.doc.document,e.doc.dirty,e.doc.mode,e.documentPath,e.session.selection.map((t)=>t.join("/")).join("|"),e.session.ui.canvasMode,e.session.ui.preview,on(e).peers.length,on(e).readOnly;A1()})})}function Ct(){Z?.stop(),Z=null;let e=J;if(J=null,X)X.dispose(),X=null;else if(e)e.then((t)=>t.dispose());Y=null}var Me={invokerTags:zm,popoverTags:Fd},B="Popover",Rt={display:"document.repairPopoverDisplay","open-display":"document.repairPopoverDisplay",invoker:"document.repairPopoverInvoker",mode:"document.repairPopoverMode"};function Ae(e,t,r,n){let l=`${t}.${r}.${n.join("/")}`,i=e.get(l)??0;return e.set(l,i+1),i===0?l:`${l}#${i}`}function fe(e,t){tl((i)=>i.source===B);let r=new Map,n=TI(e,Me);for(let i of n){let d=i.fix===void 0?void 0:Rt[i.fix];S(i.severity,i.message,{detail:i.detail,key:Ae(r,"popover",i.rule,i.path),source:B,tier:"problem",...d===void 0?{}:{action:d,actionArgs:{path:i.path}},...t===void 0?{}:{path:t}})}let l=ET(e,Me);for(let i of l)S(i.severity,i.message,{detail:i.detail,key:Ae(r,"dialog",i.rule,i.path),source:B,tier:"problem",...t===void 0?{}:{path:t}});return n.length+l.length}function me(e,t){let r=t?.path;if(!Array.isArray(r))throw RangeError(`command "${e}" needs a "path" argument naming the popover`);return r}function oe(e){let t=u.value;if(!t)throw RangeError(`command "${e}" needs an open document`);return t}function Et(){return[{category:"Document",group:"2_document",id:"document.checkPopovers",level:"document",menus:["palette"],requires:"an open document",run:()=>{let e=oe("document.checkPopovers"),t=fe(e.doc.document,e.documentPath??void 0);S.success(t===0?"No popover problems found in this document.":`${t} popover problem(s) filed.`,{key:"popover.run",source:B})},title:"Check Popovers",when:(e)=>e.document.open,aiTool:{description:"Check the open document for popover defects an author can fix — a base-rule `display` "+"that defeats the browser's own hiding of a closed popover, `popovertarget` on an "+"element that cannot invoke, a target naming no popover, a cut exit animation — and "+"file each as a Problem. The findings come back as data.",name:"check_popovers",report:()=>{let e=lh(B),t=e.length;return{data:e,summary:t===0?"No popover problems found in this document.":`Filed ${t} popover problem${t===1?"":"s"} in Problems.`}}}},{args:{additionalProperties:!1,properties:{path:{items:{type:["string","number"]},type:"array"}},required:["path"],type:"object"},category:"Document",group:"2_document",id:"document.repairPopoverDisplay",level:"document",menus:[],requires:"a popover whose base rule sets display",run:(e,t)=>{let n=oe("document.repairPopoverDisplay"),l=me("document.repairPopoverDisplay",t),i=K(n.doc.document,l),d=LI(i?.style);if(!d)throw RangeError(`command "${"document.repairPopoverDisplay"}": nothing to move — this popover sets no display`);q(n,(h)=>{for(let c of d.base)Sc(h,l,c,"");for(let c of d.breakpoints)bv(h,l,[c],"display","");if(d.openDisplay!==null)gv(h,l,":popover-open","display",d.openDisplay)}),S.success("Moved `display` into `:popover-open`.",{key:"popover.repaired.display",source:B})},title:"Move display into :popover-open",when:(e)=>e.document.open},{args:{additionalProperties:!1,properties:{path:{items:{type:["string","number"]},type:"array"}},required:["path"],type:"object"},category:"Document",group:"2_document",id:"document.repairPopoverInvoker",level:"document",menus:[],requires:"an element carrying popovertarget that cannot invoke",run:(e,t)=>{let n=oe("document.repairPopoverInvoker"),l=me("document.repairPopoverInvoker",t);q(n,(i)=>{Yo(i,l,"popovertarget"),Yo(i,l,"popovertargetaction")}),S.success("Removed the attributes, which did nothing on this element.",{key:"popover.repaired.invoker",source:B})},title:"Remove the inert popover attributes",when:(e)=>e.document.open},{args:{additionalProperties:!1,properties:{path:{items:{type:["string","number"]},type:"array"}},required:["path"],type:"object"},category:"Document",group:"2_document",id:"document.repairPopoverMode",level:"document",menus:[],requires:"a popover whose mode is not one of the three keywords",run:(e,t)=>{let n=oe("document.repairPopoverMode"),l=me("document.repairPopoverMode",t);q(n,(i)=>{Yo(i,l,"popover",TS)}),S.success(`Set \`popover\` to "${TS}".`,{key:"popover.repaired.mode",source:B})},title:"Set popover to auto",when:(e)=>e.document.open}]}function GE(e){e.registerAll(Et())}function yb(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every((r,n)=>r===t[n]);if(e!==null&&t!==null&&typeof e==="object"&&typeof t==="object"&&!Array.isArray(e)&&!Array.isArray(t))return e.$ref===t.$ref;return!1}var O="grid://";function ds(e){switch(e.kind){case"pages":return`${O}pages`;case"library":return`${O}library`;case"collection":return`${O}collection/${encodeURIComponent(e.name)}`;default:return`${O}data/${encodeURIComponent(e.connection)}/${encodeURIComponent(e.table)}`}}function jt(e){return e.startsWith(O)}function Yf(e){if(!jt(e))return null;let t=e.slice(O.length).split("/");if(t[0]==="pages"&&t.length===1)return{kind:"pages"};if(t[0]==="library"&&t.length===1)return{kind:"library"};if(t[0]==="collection"&&t.length===2&&t[1])return{kind:"collection",name:decodeURIComponent(t[1])};if(t[0]==="data"&&t.length===3&&t[1]&&t[2])return{connection:decodeURIComponent(t[1]),kind:"data",table:decodeURIComponent(t[2])};return null}function Fw(e){let t=Yf(e);if(!t)return null;switch(t.kind){case"pages":return"Pages · grid";case"library":return"Library";case"collection":return`${t.name} · grid`;default:return`${t.table} @ ${t.connection} · grid`}}var De=0;function Fe(e){let t=e.coalesceMs??800,r=e.now??(()=>Date.now()),n=v({deletes:new Set,errors:new Map,inserts:new Map,pending:new Map,redoStack:[],stale:new Set,undoStack:[]}),l=null,i=(o,a,s)=>{let m=n.errors.get(o);if(m)m.set(a,s);else n.errors.set(o,new Map([[a,s]]))},d=(o,a)=>{let s=n.errors.get(o);if(s?.delete(a),s?.size===0)n.errors.delete(o)},h=(o)=>{if(n.redoStack.length=0,l){l.push(o);return}let a=n.undoStack.at(-1);if(o.kind==="cell"&&a?.kind==="cell"&&a.rowKey===o.rowKey&&a.field===o.field&&o.at-a.at<=t){a.after=o.after,a.at=o.at;return}n.undoStack.push(o)},c=(o,a,s)=>{let m=n.inserts.get(o);if(m){if(s===null)delete m[a];else m[a]=s;return}if(yb(s,e.resolveBaseline(o,a))){let f=n.pending.get(o);if(f?.delete(a),f?.size===0)n.pending.delete(o);return}let b=n.pending.get(o);if(b)b.set(a,{value:s});else n.pending.set(o,new Map([[a,{value:s}]]))},w=(o,a)=>{let s=n.inserts.get(o);if(s)return s[a]??null;let m=n.pending.get(o)?.get(a);return m?m.value:e.resolveBaseline(o,a)},x=(o,a)=>{let s=n.errors.get(o);return s?.get(a)??s?.get("*")??null},E=(o,a)=>{switch(o.kind){case"cell":{c(o.rowKey,o.field,a==="undo"?o.before:o.after);break}case"insert":{if(a==="undo")n.inserts.delete(o.tempKey);else n.inserts.set(o.tempKey,{...o.cells});break}case"drop-insert":{if(a==="undo")n.inserts.set(o.tempKey,{...o.cells});else n.inserts.delete(o.tempKey);break}case"delete":{if(a==="undo")n.deletes.delete(o.rowKey);else n.deletes.add(o.rowKey);break}default:{let s=a==="undo"?o.ops.toReversed():o.ops;for(let m of s)E(m,a);break}}},G=()=>{if(l)throw Error("edit-buffer: groups may not nest");l=[]},P=()=>{let o=l;if(l=null,!o)return;if(o.length===1)n.undoStack.push(o[0]);else if(o.length>1)n.undoStack.push({kind:"group",ops:o})},M=(o)=>{let a=(s)=>{switch(s.kind){case"cell":return o(s.rowKey)?null:s;case"insert":case"drop-insert":return o(s.tempKey)?null:s;case"delete":return o(s.rowKey)?null:s;default:{let m=s.ops.map((b)=>a(b)).filter((b)=>b!==null);return m.length>0?{kind:"group",ops:m}:null}}};n.undoStack=n.undoStack.map(a).filter((s)=>s!==null),n.redoStack=n.redoStack.map(a).filter((s)=>s!==null)};return{applyCommitResult(o){let a=new Set;for(let s of o.cells)if(s.ok){let m=n.pending.get(s.rowKey);if(m?.delete(s.field),m?.size===0)n.pending.delete(s.rowKey);d(s.rowKey,s.field)}else if(i(s.rowKey,s.field,s.error??"Save failed"),s.stale)n.stale.add(s.rowKey);for(let s of o.inserts)if(s.ok)n.inserts.delete(s.tempKey),n.errors.delete(s.tempKey),a.add(s.tempKey);else i(s.tempKey,"*",s.error??"Insert failed");for(let s of o.deletes)if(s.ok)n.deletes.delete(s.rowKey),n.pending.delete(s.rowKey),n.errors.delete(s.rowKey),a.add(s.rowKey);else if(i(s.rowKey,"*",s.error??"Delete failed"),s.stale)n.stale.add(s.rowKey);for(let s of a)n.stale.delete(s);if(a.size>0)M((s)=>a.has(s))},buildBatch(){let o=[];for(let[a,s]of n.pending){if(n.deletes.has(a))continue;for(let[m,b]of s)o.push({baseline:e.resolveBaseline(a,m),field:m,rowKey:a,value:b.value})}return{cells:o,deletes:[...n.deletes].map((a)=>({rowKey:a})),inserts:[...n.inserts].map(([a,s])=>({cells:{...s},tempKey:a}))}},canRedo:()=>n.redoStack.length>0,canUndo:()=>n.undoStack.length>0,cellError:x,cellState(o,a){if(x(o,a)!==null)return"error";if(n.stale.has(o))return"stale";if(n.inserts.has(o)||n.pending.get(o)?.has(a))return"dirty";return"clean"},deleteRow(o){if(n.deletes.has(o))return;let a=n.inserts.get(o);if(a){let s={...a};n.inserts.delete(o),n.errors.delete(o),n.stale.delete(o),h({cells:s,kind:"drop-insert",tempKey:o});return}n.deletes.add(o),h({kind:"delete",rowKey:o})},dirtyCount(){let o=n.inserts.size+n.deletes.size;for(let[a,s]of n.pending)if(!n.deletes.has(a))o+=s.size;return o},discardRow(o){n.pending.delete(o),n.deletes.delete(o),n.inserts.delete(o),n.errors.delete(o),n.stale.delete(o),M((a)=>a===o)},effectiveValue:w,beginGroup:G,endGroup:P,group(o){G();try{o()}finally{P()}},insertRow(o={}){De+=1;let a=`__new-${De}`;return n.inserts.set(a,{...o}),h({cells:{...o},kind:"insert",tempKey:a}),a},isDirty:()=>n.pending.size>0||n.inserts.size>0||n.deletes.size>0,isInsertKey:(o)=>n.inserts.has(o),markStale(o){for(let a of o)n.stale.add(a)},redo(){let o=n.redoStack.pop();if(!o)return!1;return E(o,"redo"),n.undoStack.push(o),!0},reset(){n.pending.clear(),n.inserts.clear(),n.deletes.clear(),n.errors.clear(),n.stale.clear(),n.undoStack.length=0,n.redoStack.length=0},rowState(o){if(n.deletes.has(o))return"pending-delete";if(n.inserts.has(o))return"pending-insert";if(n.stale.has(o))return"stale";if(n.pending.has(o)||n.errors.has(o))return"dirty";return"clean"},setCell(o,a,s){let m=w(o,a);if(yb(m,s))return;c(o,a,s),h({after:s,at:r(),before:m,field:a,kind:"cell",rowKey:o})},state:n,undo(){let o=n.undoStack.pop();if(!o)return!1;return E(o,"undo"),n.redoStack.push(o),!0}}}var Be={array:220,boolean:70,date:130,enum:140,image:180,number:110,readonly:200,reference:200,string:180,text:340};function Oe(e){return Math.min(340,Math.max(90,Math.round(e*7.5)))}function Gt(e){if(e.$ref)return"reference";if(e.enum!==void 0&&Array.isArray(e.enum))return"enum";let t=e.type==="array"?void 0:e.format;if(ma(t))return"image";if(t==="date"||t==="date-time")return"date";switch(e.type){case"number":case"integer":return"number";case"boolean":return"boolean";case"array":return"array";case"object":return"readonly";default:return(e.maxLength??0)>200||e.format==="markdown"?"text":"string"}}function Ne(e){let t=e.replaceAll(/([a-z0-9])([A-Z])/g,"$1 $2").replaceAll(/[_-]+/g," ").trim();return t.charAt(0).toUpperCase()+t.slice(1)}function wb(e,t={}){let r=Object.entries(e?.properties??{}),n=new Set(e?.required),l=new Set(t.readonlyFields),i=r.map(([d,h])=>{let c=l.has(d)?"readonly":Gt(h),w=Array.isArray(h.enum)?Math.max(...h.enum.map((x)=>String(x).length),4):0;return{editable:c!=="readonly",field:d,kind:c,pk:d===t.idField,required:n.has(d),schema:h,title:Ne(d),widthHint:c==="enum"?Oe(w+3):Be[c]}});return i.sort((d,h)=>{let c=(x)=>x.pk?0:x.required?1:2,w=c(d)-c(h);return w===0?0:w}),i}function xb(e,t=50){let r=e.slice(0,t),n=[];for(let l of r)for(let i of Object.keys(l))if(!n.includes(i))n.push(i);return n.map((l)=>{let i=r.map((c)=>c[l]).filter((c)=>c!==null&&c!==void 0&&c!==""),d=Tt(i),h=Math.max(...i.map((c)=>Ro(c).length),l.length,4);return{editable:!0,field:l,kind:d,title:Ne(l),widthHint:d==="string"||d==="text"?Oe(h):Be[d]}})}function Tt(e){if(e.length===0)return"string";if(e.some((r)=>Array.isArray(r)))return"array";let t=e.map(String);if(e.every((r)=>typeof r==="boolean")||t.every((r)=>/^(true|false)$/i.test(r)))return"boolean";if(e.every((r)=>typeof r==="number")||t.every((r)=>r.trim()!==""&&!Number.isNaN(Number(r.replaceAll(/[$€£¥,\s]/g,"")))))return"number";if(t.every((r)=>/^\d{4}-\d{2}-\d{2}([T ].*)?$/.test(r)))return"date";if(t.some((r)=>r.length>200))return"text";return"string"}function Lu(e,t){if(e===null||e===void 0)return null;switch(t.kind){case"number":{if(typeof e==="number")return Number.isNaN(e)?null:e;let r=String(e).trim().replaceAll(/[$€£¥,\s]/g,"");if(r==="")return null;let n=Number(r);return Number.isNaN(n)?null:n}case"boolean":{if(typeof e==="boolean")return e;return String(e).trim().toLowerCase()==="true"}case"array":{if(Array.isArray(e))return e.map(String);let r=String(e).trim();return r===""?[]:r.split(",").map((n)=>n.trim()).filter(Boolean)}case"reference":{if(typeof e==="object"&&e!==null&&"$ref"in e){let n=e.$ref;return typeof n==="string"&&n!==""?n:null}let r=String(e).trim();return r===""?null:r}default:{let r=String(e);return r===""?null:r}}}function Ro(e){if(e===null||e===void 0)return"";if(Array.isArray(e))return e.join(", ");if(typeof e==="object")return e.$ref;return String(e)}var jw="__key",he=new WeakMap;function Ha(e){return e?he.get(re(e))??null:null}function Iu(e,t){let r=v({columns:[],error:null,grouping:null,loading:!1,query:{},rows:[],saving:!1,total:0}),n=new Map,l=(o)=>{n=new Map(o.map((a)=>[a.key,a]))},i=Fe({resolveBaseline:(o,a)=>n.get(o)?.cells[a]??null}),d=async()=>{let o=await t.rows(r.query);r.rows=o.rows,r.total=o.total,l(o.rows)},h=(o)=>{let a=r.columns.filter((b)=>b.required&&b.editable);if(a.length===0)return null;let s=o.cells.filter((b)=>b.value===null&&a.some((f)=>f.field===b.field)).map((b)=>({error:"Required",field:b.field,ok:!1,rowKey:b.rowKey})),m=o.inserts.filter((b)=>a.some((f)=>b.cells[f.field]===null||b.cells[f.field]===void 0)).map((b)=>({error:`Missing required: ${a.filter((C)=>b.cells[C.field]===null||b.cells[C.field]===void 0).map((C)=>C.field).join(", ")}`,ok:!1,tempKey:b.tempKey}));if(s.length===0&&m.length===0)return null;return{cells:s,deletes:[],inserts:m}},c=(o)=>o===null||o===""||Array.isArray(o)&&o.length===0,w=(o,a,s)=>{if(s==="number")return(typeof o==="number"?o:0)-(typeof a==="number"?a:0);if(s==="boolean")return(o===!0?1:0)-(a===!0?1:0);return Ro(o).localeCompare(Ro(a))},x=()=>{let o=r.rows.map((m)=>m.key),{dir:a,orderBy:s}=r.query;if(s&&!t.capabilities.remoteSort){let m=r.columns.find((f)=>f.field===s)?.kind,b=a==="desc"?-1:1;o=o.toSorted((f,C)=>{let j=i.effectiveValue(f,s),ae=i.effectiveValue(C,s);if(c(j)!==c(ae))return c(j)?1:-1;return b*w(j,ae,m)})}return r.grouping?[...E(o).values()].flat():o},E=(o)=>{let a=new Map;for(let s of o){let m=Ro(i.effectiveValue(s,r.grouping)),b=a.get(m);if(b)b.push(s);else a.set(m,[s])}return a},G=null,P=()=>G?.refreshData(),M={addRow(o={}){let a=i.insertRow(o);return P(),a},bindView(o){G=o},buffer:i,deleteRows(o){if(o.length===0)return;i.group(()=>{for(let a of o)i.deleteRow(a)}),P()},discardRow(o){i.discardRow(o),P()},replaceAll(o,a){if(o==="")return 0;let s=r.columns.filter((f)=>f.editable&&(f.kind==="string"||f.kind==="text")),m=[...r.rows.map((f)=>f.key),...i.state.inserts.keys()],b=0;if(i.group(()=>{for(let f of m){if(i.rowState(f)==="pending-delete")continue;for(let C of s){let j=i.effectiveValue(f,C.field);if(typeof j==="string"&&j.includes(o))i.setCell(f,C.field,j.replaceAll(o,a)),b+=1}}}),b>0)P();return b},effectiveRows(){let o=(m)=>Array.isArray(m)?[...m]:m!==null&&typeof m==="object"?{$ref:m.$ref}:m,a=(m)=>{let b={[jw]:m};for(let f of r.columns)b[f.field]=o(i.effectiveValue(m,f.field));return b},s=x().map((m)=>a(m));for(let[m]of i.state.inserts)s.push(a(m));return s},groups(){if(!r.grouping)return[];return[...E(x())].map(([o,a])=>({count:a.length,value:o}))},async load(){r.loading=!0,r.error=null;try{r.columns=await t.columns(),await d()}catch(o){r.error=te(o)}finally{r.loading=!1}P()},async refresh(){if(i.isDirty()){if(!await Qo("Refresh Grid",`Discard ${i.dirtyCount()} pending change(s) and reload?`,{confirmLabel:"Discard & Reload",destructive:!0}))return}i.reset(),await t.refresh?.(),await this.load()},async save(){if(r.saving)return;let o=i.buildBatch(),a=o.cells.length+o.inserts.length+o.deletes.length;if(a===0){S.info("No grid changes to save.",{key:"grid.save"});return}let s=h(o);if(s){i.applyCommitResult(s),S.warn("Required cells are empty — fix the marked rows, then save again.",{key:"grid.save",source:"Data",tier:"problem"});return}if(o.deletes.length>0){if(!await Qo("Delete Rows",`Save will permanently delete ${o.deletes.length} row(s). Continue?`,{confirmLabel:"Delete & Save",destructive:!0}))return}let b=new Set(o.cells.map((f)=>f.rowKey)).size+o.inserts.length+o.deletes.length>5?la({title:"Saving grid"}):null;r.saving=!0;try{let f=await t.commit(o),C=(k,z)=>`${k}\x00${z}`,j=new Map(o.cells.map((k)=>[C(k.rowKey,k.field),k]));for(let k of f.cells){let z=j.get(C(k.rowKey,k.field));if(k.ok&&z){let ve=n.get(k.rowKey);if(ve)ve.cells[k.field]=z.value}}if(i.applyCommitResult(f),f.inserts.some((k)=>k.ok)||f.deletes.some((k)=>k.ok))await d();let se=f.cells.filter((k)=>k.ok).length+f.inserts.filter((k)=>k.ok).length+f.deletes.filter((k)=>k.ok).length,be=a-se,we=f.cells.filter((k)=>k.stale).length+f.deletes.filter((k)=>k.stale).length;if(be===0)S.success(`Saved ${se} change(s).`,{key:"grid.save"});else S.error(`Saved ${se} · ${be} failed${we?` (${we} stale)`:""} — kept pending.`,{action:"file.save",key:"grid.save",source:"Data"})}catch(f){S.error("Could not save the grid.",{action:"file.save",detail:te(f),key:"grid.save",source:"Data"})}finally{r.saving=!1,b?.done(),P()}},serializeForSource(){if(!t.serializeForSource)return null;return t.serializeForSource(i.buildBatch())},async setQuery(o){r.query=o,r.loading=!0;try{await d()}catch(a){r.error=te(a)}finally{r.loading=!1}P()},setGrouping(o){r.grouping=o,P()},async setSort(o){let a={...r.query};if(o)a.orderBy=o.field,a.dir=o.dir;else delete a.orderBy,delete a.dir;if(!t.capabilities.remoteSort){r.query=a,P();return}await this.setQuery(a)},source:t,state:r,tab:e};return e.scope.run(()=>{Q(()=>{e.doc.dirty=i.isDirty()}),_m(e,{canRedo:()=>i.canRedo(),canUndo:()=>i.canUndo(),redo:()=>{i.redo(),P()},undo:()=>{i.undo(),P()}});let o=p();if(o.subscribeFileEvents&&t.backingPaths){let a=o.subscribeFileEvents((s)=>{let m=t.backingPaths(),b=new Set;for(let f of s){if(f.isDir)continue;let C=f.path.replaceAll("\\","/"),j=m.get(C);if(j!==void 0&&!mc(C))b.add(j)}if(b.size===0)return;if(i.isDirty()){let f=b.has("*")?r.rows.map((C)=>C.key):[...b];i.markStale(f),S.warn("Grid rows changed on disk — marked stale; refresh to reload.",{key:"grid.stale",source:"Data"}),P()}else M.refresh()});Xa(a)}Xa(()=>{_m(e,null),he.delete(re(e)),t.dispose?.()})}),he.set(re(e),M),M}async function md(e){let r=Ha(e)?.serializeForSource();if(r)return r;await qt();let n=wi(e.doc.sourceFormat);if(n?.capabilities.serialize){let l=e.doc.content?.frontmatter||{},i=e.doc.document,d={...l,...i,children:i.children??[]};return Us(n.name,d,{mode:"roundtrip"})}if(e.doc.mode==="content"){let l=$r();if(l){let i=e.doc.content?.frontmatter??{},d=Object.keys(i).length>0,h={...i,...e.doc.document};return Us(l.name,h,{frontmatter:d,mode:"roundtrip"})}}return pr(e.doc.document,e.doc.layout??null)}var Mt=200,At=500,Dt=2097152,_=new Map,V=!1,ie=null,A=null,L=null,ye=null;function Ft(){let e=[];for(let t of g.tabs.values())if(t.doc.dirty&&t.documentPath)e.push(t);return e}async function Je(){if(!We())return;let e=p();if(!e.setPreviewOverlay||!e.clearPreviewOverlay)return;let t=new Set;for(let r of Ft()){let n=r.documentPath.replace(/^\.\//,""),l;try{l=await md(r)}catch{continue}if(l.length>Dt)continue;if(t.add(n),_.get(n)===l)continue;_.set(n,l),await e.setPreviewOverlay(n,l)}for(let r of _.keys())if(!t.has(r))_.delete(r),await e.clearPreviewOverlay(r)}function Ke(){if(!V)return;let e=Date.now();if(L??=e,A)clearTimeout(A);let t=e-L,r=Math.max(0,Math.min(Mt,At-t));A=setTimeout(()=>{A=null,L=null,ye=Je().finally(()=>{ye=null})},r)}function KE(){Ke()}function JE(){if(V)return;V=!0,ie=ge(),ie.run(()=>{Q(()=>{for(let e of g.tabs.values())e.doc.dirty,e.doc.document;Ke()})})}function YE(){if(V=!1,A)clearTimeout(A),A=null;L=null,ie?.stop(),ie=null,_.clear()}async function Bw(){if(!V)return;if(A)clearTimeout(A),A=null,L=null;await ye,await Je()}var _e=/^[A-Za-z0-9][A-Za-z0-9!#$&^_.+-]{0,126}$/,Bt=new Set(["vnd","prs","x"]);function Ot(e){if(typeof e!=="string")return null;let[t,...r]=e.split(";"),n=(t??"").indexOf("/");if(n===-1)return null;let l=(t??"").slice(0,n).trim().toLowerCase(),i=(t??"").slice(n+1).trim().toLowerCase();if(!_e.test(l)||!_e.test(i))return null;let d=i.lastIndexOf("+"),h=d===-1?null:i.slice(d+1),c=d===-1?i:i.slice(0,d);if(h==="")return null;let w=c.indexOf("."),x=w===-1?null:c.slice(0,w),E=x!==null&&Bt.has(x)?x:null,G=E===null?c:c.slice(E.length+1);if(G==="")return null;let P={};for(let M of r){let o=M.indexOf("=");if(o===-1)return null;let a=M.slice(0,o).trim().toLowerCase(),s=M.slice(o+1).trim();if(a==="")return null;if(s.startsWith('"')&&s.endsWith('"')&&s.length>=2)s=s.slice(1,-1);P[a]=s}return{parameters:P,subtype:G,suffix:h,tree:E,type:l}}function zw(e){let t=Ot(e);if(t===null)return null;let r=t.tree===null?"":`${t.tree}.`,n=t.suffix===null?"":`+${t.suffix}`;return`${t.type}/${r}${t.subtype}${n}`}var Le="text/markdown; variant=GFM",Ie="application/yaml",bn={".markdown":`${Le}; charset=utf-8`,".md":`${Le}; charset=utf-8`,".yaml":`${Ie}; charset=utf-8`,".yml":`${Ie}; charset=utf-8`};async function Nt(e,t){let r=await hS(e.name,t);return pS(e,r)}async function Er(e,t){await qt();let r=Zt(e);if(!r||!r.capabilities.parse)throw Ip(e);return{...await Nt(r,t),format:r}}var N1=async(e,t)=>{if(e.documentPath&&Zt(e.documentPath)){let n=await Er(e.documentPath,t);return{document:n.document,frontmatter:n.frontmatter}}let r=hs(t);return e.doc.layout=r.layout,{document:r.document}};var ze=()=>{};function O1(e){ze=e}function I(e){je(e.documentPath);let t=e.doc.document;ze(e.documentPath,t);let r=typeof t.tagName==="string"&&t.tagName.includes("-")?_b(t):null;if(r)S.warn(r,{key:`slots:${e.documentPath??e.id}`,...e.documentPath===null?{}:{path:e.documentPath},source:"Components",tier:"problem"});fe(t,e.documentPath??void 0)}function Jt(e){return!mm(e.documentPath??"")}async function op(e=u.value){if(!e)return!1;if(await aC(e.id),km(e))return S.warn(`You have read access to this session — changes to ${e.documentPath??"this document"} stay in your browser and cannot be saved.`,{action:"file.save",key:`save.readOnly:${e.documentPath??e.id}`,...e.documentPath===null?{}:{path:e.documentPath},source:"Collaboration"}),!1;if(!Jt(e))return S.warn(`${e.documentPath??"This file"} is a media file, so there is no document for Save to write.`,{key:`save.notADocument:${e.documentPath??e.id}`,...e.documentPath===null?{}:{path:e.documentPath},source:"Save"}),!1;let t=Ha(e);if(t)return await t.save(),!e.doc.dirty;try{if(await YC(e))return I(e),!0;let r=await md(e);if(e.documentPath)return await p().writeFile(e.documentPath,r),e.doc.dirty=!1,Bw(),I(e),!0;if(e.fileHandle&&"createWritable"in e.fileHandle){let n=await e.fileHandle.createWritable();return await n.write(r),await n.close(),e.doc.dirty=!1,I(e),!0}S.warn("This document has no save target — use Export.",{key:"save.noTarget"})}catch(r){if(!(r instanceof Error&&r.name==="AbortError"))S.error(`Could not save ${e.documentPath??e.id}.`,{action:"file.save",detail:te(r),key:`save:${e.documentPath??e.id}`,...e.documentPath===null?{}:{path:e.documentPath},source:"Save"})}return!1}function Kt(e){return wi(e.doc.sourceFormat)??(e.doc.mode==="content"?$r():void 0)}async function M1(){let e=u.value;if(!e)return;try{await qt();let t=Kt(e),r=await md(e),n=t?zw(t.mediaType)??"text/plain":"application/json",l=t?t.extensions[0]:".json",i=t?t.name:"Jx Component",d=t?`content${l}`:"component.json";if("showSaveFilePicker"in window){let h=e.documentPath?e.documentPath.split("/").pop():d,c=await window.showSaveFilePicker({suggestedName:h,types:[{accept:{[n]:[l]},description:i}]}),w=await c.createWritable();await w.write(r),await w.close(),e.doc.dirty=!1,I(e),S.success(`Exported as ${c.name}.`)}else{let h=new Blob([r],{type:n}),c=URL.createObjectURL(h),w=document.createElement("a");w.href=c,w.download=d,w.click(),URL.revokeObjectURL(c),e.doc.dirty=!1,I(e),S.success(`Downloaded ${d}.`)}}catch(t){if(!(t instanceof Error&&t.name==="AbortError"))S.error("Could not export the document.",{detail:te(t),source:"Export"})}}async function He(e,t){let r=mm(e)?await kb(e):await Fs({path:e});return K1(r,t)??""}async function Xf(e){let t=await He(e.path,"delete"),r=`Delete ${e.name}? This cannot be undone.`;return Boolean(await Qo("Delete File",t===""?r:`${r} ${t}`,{confirmLabel:"Delete",destructive:!0}))}async function Qf(e,t="rename"){let r=await He(e,t);return r===""?void 0:r}
|
|
2
|
+
export{yb,ds,Yf,Fw,wb,xb,Lu,Ro,jw,Ha,Iu,Zf,zE,WE,Hw,VE,UE,A1,qE,GE,md,KE,JE,YE,Bw,zw,Er,N1,O1,op,M1,Xf,Qf};
|
|
3
|
+
|
|
4
|
+
//# debugId=BCC22A9ED494514964756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-eb5sty2k.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Rv}from"./studio-dknr8m7b.js";import{v}from"./studio-0nm2skex.js";import{Nl,Cv,u}from"./studio-27tc8q0h.js";import{Ai,Ko,y}from"./studio-w8w9frjy.js";import{at}from"./studio-y164brht.js";import{st,bi,Il,Nu,hr,EC,$C}from"./studio-pvj970st.js";import{D,Lc}from"./studio-153mwkyq.js";import{T,R}from"./studio-z1vdxq0e.js";import{me}from"./studio-09n3fyy0.js";var Kg={$sections:[{label:"Headings",elements:[{tag:"h1",text:"Code Is Poetry"},{tag:"h2",text:"Code Is Poetry"},{tag:"h3",text:"Code Is Poetry"},{tag:"h4",text:"Code Is Poetry"},{tag:"h5",text:"Code Is Poetry"},{tag:"h6",text:"Code Is Poetry"}]},{label:"Paragraph",elements:[{tag:"p",text:"In a village of La Mancha, the name of which I have no desire to call to mind, there lived not long since one of those gentlemen that keep a lance in the lance-rack, an old buckler, a lean hack, and a greyhound for coursing."}]},{label:"List",elements:[{tag:"ul",children:[{tag:"li",text:"Alice."},{tag:"li",text:"The White Rabbit."},{tag:"li",text:"The Cheshire Cat."},{tag:"li",text:"The Mad Hatter."},{tag:"li",text:"The Queen of Hearts."}]},{tag:"ol",children:[{tag:"li",text:"First item"},{tag:"li",text:"Second item"},{tag:"li",text:"Third item"}]}]},{label:"Quote",elements:[{tag:"blockquote",children:[{tag:"p",text:"In quoting others, we cite ourselves.",style:"font-size:1.25em;font-style:italic"},{tag:"p",text:"— Julio Cortázar"}]}]},{label:"Code",elements:[{tag:"pre",children:[{tag:"code",text:`// A "block" is the abstract term used
|
|
2
2
|
// to describe units of markup that
|
|
3
3
|
// when composed together, form the
|
|
4
4
|
// content or layout of a page.
|
|
5
|
-
registerBlockType( name, settings );`}]}]},{label:"Inline",elements:[{tag:"a",text:"Visit the documentation",attributes:{href:"#"}},{tag:"strong",text:"Bold text emphasis"},{tag:"em",text:"Italic text emphasis"},{tag:"small",text:"Fine print and legal text"},{tag:"mark",text:"Highlighted text"},{tag:"code",text:"const x = 42;"},{tag:"abbr",text:"HTML",attributes:{title:"HyperText Markup Language"}},{tag:"sub",text:"subscript"},{tag:"sup",text:"superscript"}]},{label:"Form",elements:[{tag:"input",attributes:{type:"text",placeholder:"Enter text…"}},{tag:"button",text:"Click Me"},{tag:"select",children:[{tag:"option",text:"Option 1"},{tag:"option",text:"Option 2"},{tag:"option",text:"Option 3"}]},{tag:"textarea",attributes:{placeholder:"Enter longer text…",rows:"3"}}]},{label:"Table",elements:[{tag:"table",children:[{tag:"thead",children:[{tag:"tr",children:[{tag:"th",text:"Name"},{tag:"th",text:"Role"},{tag:"th",text:"Status"}]}]},{tag:"tbody",children:[{tag:"tr",children:[{tag:"td",text:"Alice"},{tag:"td",text:"Developer"},{tag:"td",text:"Active"}]},{tag:"tr",children:[{tag:"td",text:"Bob"},{tag:"td",text:"Designer"},{tag:"td",text:"Away"}]},{tag:"tr",children:[{tag:"td",text:"Carol"},{tag:"td",text:"Manager"},{tag:"td",text:"Active"}]}]}]}]},{label:"Interactive",elements:[{tag:"details",attributes:{open:""},children:[{tag:"summary",text:"Click to expand details"},{tag:"p",text:"Additional detail content revealed when the disclosure widget is toggled open."}]}]},{label:"Media",elements:[{tag:"img",attributes:{alt:"Placeholder image"},style:"width:100%;max-width:400px;height:200px;background:#e0e0e0;display:block;border-radius:4px"},{tag:"video",attributes:{controls:""},style:"width:100%;max-width:400px;height:200px;background:#e0e0e0;display:block;border-radius:4px"},{tag:"audio",attributes:{controls:""},style:"width:100%"}]}],$variables:{color:{label:"Color",prefix:"--color-",placeholder:"#007acc"},font:{label:"Font",prefix:"--font-",placeholder:"system-ui, sans-serif"},size:{label:"Size",prefix:"--size-",placeholder:"16px"},other:{label:"Other",prefix:"--",placeholder:"value"}}};var O={$schema:"https://jxsuite.com/schema/v1",$id:"StudioStylebookChrome",$description:"The bar across the top of the Project Styles canvas: the filter that narrows the specimen catalogue, and the toggle that reduces it to the elements this file has already styled. Both are shell state rather than document state — the adapter owns which — and the two names come in as values, because the surface is called Project Styles and the canvas view it draws is the wire word `stylebook`; nothing a reader sees here may be spelled from that. **The bar IS the kit's toolbar now.** It used to write `role=\"toolbar\"` and its own `aria-label` on a `<div>`, which is a role with none of the behaviour under it: two controls, two tab stops, and no arrow key between them. `jx-action-group` is not the element for it — that one roves `jx-action-button` and this bar's first control is a `jx-textfield` — so `jx-toolbar` is, and the field keeps its own arrows while its caret still has text to walk (ui.md §5.5).",tagName:"jx-toolbar",attributes:{part:"chrome"},$props:{label:{$ref:"#/state/title"}},style:{$description:'What `.sb-chrome` said in `styles/overlays.css`, plus the six inline declarations the template carried beside it, plus `.tb-toggle` — all three go dead with this conversion, and none of them is shared with another surface. Three repairs on the way. The bar is one element rather than a positioned box wrapping a `role="toolbar"` row that declared the same flex layout again. The flex layout is not declared here EITHER any more: `display: flex`, `align-items: center`, the `--jx-space-2` gap, the sans face and the foreground colour are all `jx-toolbar`\'s own, so what is left below is only what a positioned BAND is. And `.tb-toggle` read `var(--spectrum-font-size-50, 11px)`, which the kit spells `--jx-text-sm` at the same value; the rest of its drawing is a `jx-action-button` reaching in through `part="control"`, because what it has to look like is a small bordered chip and every fill and control height the kit draws would otherwise have to be taken back off.',position:"absolute",top:"0",left:"0",right:"0",zIndex:"15",flexShrink:"0",padding:"var(--jx-space-2) var(--jx-space-3)",background:"var(--bg-panel)",borderBottom:"1px solid var(--border)",'& [part="filter"]':{flex:"1",maxWidth:"200px"},'& [part="customized"] > [part="control"]':{$description:"Bordered, unfilled and dimmed until it is on, which is what says it is a filter rather than an action: the catalogue it narrows is the thing the reader is looking at, so the control has to be quieter than its subject.",padding:"3px var(--jx-space-3)",border:"1px solid var(--border)",borderRadius:"var(--radius)",background:"transparent",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)",":hover":{background:"var(--hover-bg)"}},'& [part="customized"][data-selected] > [part="control"]':{$description:"`data-selected` and not `selected`: the kit reflects the pressed state as a data attribute (`jx-action-button.json`), and the property this document binds never reaches the attribute of the same name.",borderColor:"var(--accent)",background:"var(--accent-15)",color:"var(--accent)"}},children:[{tagName:"jx-textfield",attributes:{part:"filter"},$props:{size:"sm",type:"search",clearable:!0,label:{$ref:"#/state/filterLabel"},placeholder:"Filter…",value:{$ref:"#/state/filter"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setFilter"},value:[{$ref:"event#/target/value"}]}]}},{tagName:"jx-action-button",$description:"`onchange` and not `onclick`: a `toggles` button owns its own pressed state and says so with `change` (`jx-action-button.json`), and an `onclick` written here would replace the element's own click handler on the same property — the toggle would stop flipping and stop announcing `aria-pressed`.",attributes:{part:"customized"},$props:{size:"sm",toggles:!0,selected:{$ref:"#/state/customizedOnly"},label:{$ref:"#/state/customizedLabel"},hint:{$ref:"#/state/customizedHint"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/toggleCustomized"},value:[]}]},children:[{tagName:"span",textContent:"${state.customizedLabel}"}]}]};T("stylebook-chrome",O);function z(e,o){let t=document.createElement("div");t.style.display="contents";let n=v({...e,...o}),r=null,s=!1;function i(){s=!0,R("stylebook-chrome",n,t).then((d)=>{s=!1,r=d})}return i(),{host:t,update(d){if(Object.assign(n,d),s||r!==null&&t.contains(r.root))return;r?.dispose(),r=null,t.textContent="",i()}}}function E(e){return!e.startsWith(":")&&!e.startsWith(".")&&!e.startsWith("&")&&!e.startsWith("[")&&!e.startsWith("@")&&!e.startsWith("--")}function w(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}var M="& .element-card-preview";function Mg(e){let o=e,t={},n=(r)=>{let s={};for(let[i,d]of Object.entries(r))if(i!=="@--")s[i]=d;return s};for(let[r,s]of Object.entries(o)){if(!w(s)){t[r]=s;continue}if(r==="@--")continue;if(bv(r)){t[r]=s;continue}if(r.startsWith("@")){let i={};for(let[d,g]of Object.entries(s))if(w(g)&&E(d))i[`${M} ${d}`]=n(g);else i[d]=g;t[r]=i;continue}if(E(r)){t[`${M} ${r}`]=n(s);continue}t[r]=s}return t}function I(e,o){let t=o.split(" "),n=e;for(let r of t){if(!w(n))return null;n=n[r]}return w(n)?n:null}function J(e,o){let t=e,n=I(t,o);if(n&&Object.keys(n).length>0)return!0;for(let[r,s]of Object.entries(t)){if(!r.startsWith("@")||!w(s))continue;let i=I(s,o);if(i&&Object.keys(i).length>0)return!0}return!1}function _(e){let o=new Map,t=new Map,n=e.filter.toLowerCase(),r=(a,c,h)=>{let p=a.tag===h?h:`${h} ${a.tag}`;o.set(Sl(c),p);let m=a.children??[];for(let[l,C]of m.entries())r(C,[...c,"children",l],h)},s=(a)=>{let c={...a.attributes};if(a.style)c.style=a.style;return{tagName:a.tag,...a.text?{textContent:a.text}:{},...Object.keys(c).length>0?{attributes:c}:{},...a.children?{children:a.children.map(s)}:{}}},i=(a,c,h,p,m)=>{o.set(Sl(p),a),o.set(Sl([...p,"children",0]),a);let l=[...p,"children",0,"children",0];if(m)r(m,l,a);else o.set(Sl(l),a);if(!t.has(a))t.set(a,p);return{attributes:{class:"element-card"},children:[{attributes:{class:"element-card-preview"},children:[h],tagName:"div"},{attributes:{class:"element-card-label"},tagName:"div",textContent:c}],tagName:"div"}},d=[],g=(a,c)=>({attributes:{class:"sb-section"},children:[{attributes:{class:"sb-label"},tagName:"div",textContent:a},{attributes:{class:"sb-body"},children:c,tagName:"div"}],tagName:"div"}),f=()=>["children",d.length,"children",1];for(let a of e.meta.$sections){let c=a.elements;if(n)c=c.filter((m)=>m.tag.includes(n)||a.label.toLowerCase().includes(n));if(e.customizedOnly)c=c.filter((m)=>J(e.effectiveStyle,m.tag));if(c.length===0)continue;let h=f(),p=c.map((m,l)=>i(m.tag,`<${m.tag}>`,s(m),[...h,"children",l],m));d.push(g(a.label,p))}let b=[];{let a=e.components;if(n)a=a.filter((c)=>c.tagName.toLowerCase().includes(n));if(e.customizedOnly)a=a.filter((c)=>J(e.effectiveStyle,c.tagName));if(a.length>0){let c=f(),h=a.map((p,m)=>{let l=[...c,"children",m];if(p.source!=="npm"&&p.path?.endsWith(".json")){b.push({$ref:`/${e.projectRoot?`${e.projectRoot}/`:""}${p.path}`.replace(/^\/+/,"/")});let j={};for(let k of p.props??[])if(k.default!==void 0&&k.default!=="false"&&k.default!=="''")j[k.name]=String(k.default).replaceAll(/^'|'$/g,"");let q={tagName:p.tagName,...Object.keys(j).length>0?{attributes:j}:{}};return i(p.tagName,`<${p.tagName}>`,q,l,null)}let V={attributes:{class:"sb-fallback"},tagName:"div",textContent:`<${p.tagName}>`};return i(p.tagName,`<${p.tagName}>`,V,l,null)});d.push(g("Components",h))}}if(d.length===0)d.push({attributes:{class:"sb-empty"},tagName:"div",textContent:e.customizedOnly?"No customized elements":"No matching elements"});return{doc:{...b.length>0?{$elements:b}:{},$media:e.effectiveMedia,attributes:{class:"sb-root"},children:d,style:Mg(e.effectiveStyle),tagName:"div"},pathToTag:o,tagToCardPath:t}}var Pg="Project Styles",Ek="stylebook",By=[{id:"color",prefix:"--color-",title:"Colors"},{id:"font",prefix:"--font-",title:"Fonts"},{id:"size",prefix:"--size-",title:"Sizes & Spacing"},{id:"other",prefix:"--",title:"Other"}];function L(e){if(e.startsWith("--color"))return"color";if(e.startsWith("--font"))return"font";if(e.startsWith("--size")||e.startsWith("--spacing")||e.startsWith("--radius"))return"size";return"other"}function C_(e){let o=L(e);if(o==="other")return e;let{prefix:t}=By.find((n)=>n.id===o);return dv(e,t)}function U(e){if(!e)return[];let o=[];for(let[t,n]of Object.entries(e)){if(!t.startsWith("--"))continue;if(typeof n!=="string"&&typeof n!=="number")continue;o.push({group:L(t),label:C_(t),name:t,value:n})}return o}function Tk(e){let o=U(e);return By.map((t)=>({group:t,tokens:o.filter((n)=>n.group===t.id)}))}function Lk(e){if(!e)return[];let{featureQueries:o,sizeBreakpoints:t}=ur(e),n=[],r=[];for(let{name:i,query:d}of o){let g=Lu(d);if(g)n.push({key:`@${i}`,kind:"scheme",label:g==="dark"?"Dark":"Light",name:i,scheme:g});else r.push({key:`@${i}`,kind:"feature",label:`@${i}`,name:i})}let s=t.map(({name:i})=>({key:`@${i}`,kind:"size",label:`@${i}`,name:i}));return[...n,...s,...r]}function A(e,o){let t=e[o.key];return t&&typeof t==="object"?t:void 0}function Fg(e,o,t){let n=A(e,o)?.[t];return typeof n==="string"||typeof n==="number"?n:void 0}function S_(e,o,t,n){if(n){let s=e[o.key]??={};s[t]=n;return}let r=A(e,o);if(!r)return;if(delete r[t],Object.keys(r).length===0)delete e[o.key]}function Ik(e,o,t,n=[]){let r=new Set(n.map((s)=>s.name));return o.filter((s)=>!r.has(s.name)&&Fg(e,s,t)===void 0)}var W=new WeakMap;function K(e){let o={customizedHint:"Show only the elements this file has already styled",customizedLabel:"Customized",customizedOnly:y.stylebook.customizedOnly,filter:y.stylebook.filter,filterLabel:`Filter the ${Pg} catalogue`,title:Pg},t=W.get(e);if(t)return t.update(o),t.host;let n=z(o,{setFilter:(r)=>{y.stylebook.filter=r},toggleCustomized:()=>{y.stylebook.customizedOnly=!y.stylebook.customizedOnly}});return W.set(e,n),n.host}async function Rk(e,o){let t=e.wrap,n=st(e.paneId),r=y.stylebook.filter.toLowerCase(),{customizedOnly:s}=y.stylebook,i=Di(n?.doc.document?.$media),{sizeBreakpoints:d,baseWidth:g}=ur(i),f=d.length>0,b=K(e);t.style.overflow="hidden";let S=[];if(f){S.push({displayName:gi("--"),name:"base",width:g});for(let l of d)S.push({displayName:gi(l.name),name:l.name,width:l.width})}let a;if(!f){let l=i&&i["--"],C=l?`${gi("--")} (${g}px)`:null;a=[o.canvasPanelEntry(l?"base":null,C,!l,l?g:void 0)]}else a=S.map((l)=>o.canvasPanelEntry(l.name,`${l.displayName} (${l.width}px)`,!1,l.width));if(!await o.drawStage(e,{frame:"boards",framePart:"panzoom",frameVars:"--boards-inset:40px",handles:"hidden",hug:!1,innerPart:"boards",lead:"chrome",panels:a.map((l)=>l.item)},a))return;let h=o.stageHost(e,"chrome-host");if(h&&h.firstChild!==b)h.replaceChildren(b);let p=_({components:at,customizedOnly:Boolean(s),effectiveMedia:i??{},effectiveStyle:Go(n?.doc.document?.style),filter:r,meta:jg,projectRoot:D?.projectRoot??null}),{panels:m}=e;for(let{panel:l}of a)m.push(l),tC(e.renderGeneration,p,l.canvas,l._width);if(f)o.updateActivePanelHeaders(e);o.applyTransform(e),o.observeCenterUntilStable(e)}function fu(e,o,{panCanvas:t=!1}={}){if(y.stylebook.selection=e,Cc(u.value,{selection:[[]],ui:{activeSelector:e,rightTab:"style",...o!==void 0?{activeMedia:o}:{}}}),e&&t)sC(e)}var Q=8,zy=[{id:"properties",title:"Content"},{id:"style",title:"Style"},{id:"events",title:"Logic"},{id:"assistant",title:"Assistant"}];function Wy(){return{saveDocument:()=>{},undo:()=>{},redo:()=>{},openInBrowser:()=>{},buildSite:()=>{},closeDocument:()=>{},duplicateSelection:()=>{},deleteSelection:()=>{},selectParent:()=>{},toggleDock:()=>{},toggleZen:()=>{},openPalette:()=>{},openProject:()=>{},newWindow:()=>{},panelRoster:[],focusPanel:()=>{},focusInspectorTab:()=>{},cycleRegion:()=>{}}}var x=(e)=>e.document.open,P=(e)=>e.selection.count>0&&e.editor.kind==="canvas",N=(e)=>!e.selection.isRoot&&e.selection.paths.every((o)=>Il(o)),B="an element selected on the canvas that has a sibling position: not the document root, a repeater's template or a switch case",H=(e)=>e.map((o)=>`[${o.join(", ")}]`).join(" and ");function Vh(e){return[{id:"file.save",title:"Save",category:"File",level:"document",icon:"floppy-disk",keybinding:"mod+s",menus:["commandbar/primary","statusbar/document","palette"],group:"1_file",undo:"none",when:x,requires:"an open document",run:()=>e.saveDocument()},{id:"document.close",title:"Close Document",category:"Document",level:"document",keybinding:"mod+w",menus:["context/tab","palette"],group:"1_file",when:x,requires:"an open document",run:()=>e.closeDocument()},{id:"view.openInBrowser",title:"Open in Browser",category:"View",level:"document",icon:"arrow-square-out",keybinding:"mod+shift+o",menus:["commandbar/primary","statusbar/document","palette"],group:"2_output",when:(t)=>t.project.isSite,enablement:x,requires:"a page to preview",run:()=>e.openInBrowser()},{id:"project.buildSite",title:"Build Site",category:"Project",level:"project",menus:["commandbar/overflow","palette"],group:"2_output",when:(t)=>t.project.isSite,requires:"a site project",run:()=>e.buildSite()},{id:"edit.undo",title:"Undo",category:"Edit",level:"document",icon:"arrow-u-up-left",keybinding:"mod+z",menus:["commandbar/primary","palette"],group:"1_history",when:x,enablement:(t)=>t.document.canUndo,requires:"a change to undo",run:()=>e.undo()},{id:"edit.redo",title:"Redo",category:"Edit",level:"document",icon:"arrow-u-up-right",keybinding:["mod+shift+z","mod+y"],menus:["commandbar/primary","palette"],group:"1_history",when:x,enablement:(t)=>t.document.canRedo,requires:"a change to redo",run:()=>e.redo()},{id:"selection.duplicate",title:"Duplicate",category:"Selection",level:"selection",keyScope:"canvas",keybinding:"mod+d",menus:["blockbar","context/element","context/layer","outline/row","palette"],group:"3_structure",undo:"document",when:P,enablement:N,requires:B,aiTool:{name:"duplicate_node",description:"Duplicate elements in the document, inserting each copy after its original, as one undoable step. The copies become the selection.",report:({after:t})=>{let n=t.selection.paths.length;return`Duplicated ${n} element${n===1?"":"s"}; the ${n===1?"copy is":"copies are"} selected at ${H(t.selection.paths)}.`}},run:()=>e.duplicateSelection()},{id:"selection.repeat",title:"Repeat...",category:"Selection",level:"selection",keyScope:"canvas",menus:["context/element","palette"],group:"3_structure",undo:"document",when:P,enablement:(t)=>N(t)&&!t.selection.isRepeater,requires:"an element with a sibling position that is not already a repeater",run:()=>{(me("c3e7q61z"),import("./convert-to-repeater-c3e7q61z.js")).then(({convertToRepeater:t})=>t())}},{id:"selection.delete",title:"Delete",category:"Selection",level:"selection",keyScope:"canvas",keybinding:["delete","backspace"],menus:["blockbar","context/element","context/layer","outline/row","palette"],group:"9_danger",destructive:!0,undo:"document",when:P,enablement:N,requires:B,aiTool:{name:"delete_node",description:"Delete elements from the document as one undoable step.",report:({before:t,after:n})=>{let r=t.selection.paths.length;return`Deleted ${r} element${r===1?"":"s"} at ${H(t.selection.paths)} in one undo step; the selection is now ${n.selection.count===0?"empty":"elsewhere"}.`}},run:()=>e.deleteSelection()},{id:"selection.selectParent",title:"Select Parent",category:"Selection",level:"selection",keyScope:"canvas",keybinding:["escape","arrowleft"],menus:["palette"],group:"2_navigate",when:P,requires:"an element selection",run:()=>e.selectParent()},{id:"view.toggleNavigator",title:"Toggle Navigator Dock",category:"View",level:"application",keybinding:"mod+b",menus:["commandbar/overflow","palette"],group:"4_docks",run:()=>e.toggleDock("navigator")},{id:"view.toggleInspector",title:"Toggle Inspector Dock",category:"View",level:"application",keybinding:"mod+alt+b",menus:["commandbar/overflow","palette"],group:"4_docks",run:()=>e.toggleDock("inspector")},{id:"view.zen",title:"Zen Mode",category:"View",level:"application",keybinding:"mod+.",menus:["commandbar/overflow","palette"],group:"4_docks",run:()=>e.toggleZen()},{id:"palette.open",title:"Open Command Center",category:"View",level:"application",keybinding:"mod+k",menus:["palette"],group:"5_palette",run:()=>e.openPalette("picker")},{id:"palette.openFiles",title:"Go to File…",category:"File",level:"application",keybinding:"mod+p",menus:["palette"],group:"5_palette",run:()=>e.openPalette("files")},{id:"palette.openCommands",title:"Run Command…",category:"View",level:"application",keybinding:"mod+shift+p",menus:["palette"],group:"5_palette",run:()=>e.openPalette("commands")},{id:"palette.openNodes",title:"Go to Symbol in Document…",category:"Selection",level:"document",menus:["palette"],group:"5_palette",when:x,requires:"an open document",run:()=>e.openPalette("nodes")},{id:"project.open",title:"Open Project…",category:"Project",level:"project",keybinding:"mod+o",menus:["commandbar/overflow","statusbar/project","palette"],group:"1_file",run:()=>e.openProject()},{id:"view.newWindow",title:"New Window",category:"View",level:"application",keybinding:"mod+shift+n",menus:["commandbar/overflow","palette"],group:"1_file",when:(t)=>t.capability.windowControls,requires:"a host that can hold more than one window",run:()=>e.newWindow()},{id:"project.openRecent",title:"Open Recent…",category:"Project",level:"project",menus:["commandbar/overflow","statusbar/project","palette"],group:"1_file",run:()=>e.openPalette("projects")},...Z(e),...Y(e),{id:"view.cycleRegion",title:"Focus Next Region",category:"View",level:"application",keybinding:"f6",menus:["palette"],group:"4_docks",run:()=>e.cycleRegion(1)},{id:"view.cycleRegionBack",title:"Focus Previous Region",category:"View",level:"application",keybinding:"shift+f6",menus:["palette"],group:"4_docks",run:()=>e.cycleRegion(-1)}]}function Z(e){let o=0;return e.panelRoster.map((t)=>{let n={id:`panel.focus.${t.id}`,title:`Show ${t.title}`,category:"View",level:"application",menus:["palette"],group:"4_docks",requires:"an open project",when:(r)=>r.project.open&&(t.when?.(r)??!0),run:()=>e.focusPanel(t.id)};if(t.rail!==!1&&o<Q)o+=1,n.keybinding=`mod+${o}`;return n})}function Y(e){return zy.map((o,t)=>({id:`inspector.focus.${o.id}`,title:`Show ${o.title}`,category:"View",level:"document",keybinding:`mod+shift+${t+1}`,menus:["palette"],group:"4_docks",requires:"an open document",when:(r)=>r.document.open,run:()=>e.focusInspectorTab(o.id)}))}
|
|
6
|
-
export{
|
|
5
|
+
registerBlockType( name, settings );`}]}]},{label:"Inline",elements:[{tag:"a",text:"Visit the documentation",attributes:{href:"#"}},{tag:"strong",text:"Bold text emphasis"},{tag:"em",text:"Italic text emphasis"},{tag:"small",text:"Fine print and legal text"},{tag:"mark",text:"Highlighted text"},{tag:"code",text:"const x = 42;"},{tag:"abbr",text:"HTML",attributes:{title:"HyperText Markup Language"}},{tag:"sub",text:"subscript"},{tag:"sup",text:"superscript"}]},{label:"Form",elements:[{tag:"input",attributes:{type:"text",placeholder:"Enter text…"}},{tag:"button",text:"Click Me"},{tag:"select",children:[{tag:"option",text:"Option 1"},{tag:"option",text:"Option 2"},{tag:"option",text:"Option 3"}]},{tag:"textarea",attributes:{placeholder:"Enter longer text…",rows:"3"}}]},{label:"Table",elements:[{tag:"table",children:[{tag:"thead",children:[{tag:"tr",children:[{tag:"th",text:"Name"},{tag:"th",text:"Role"},{tag:"th",text:"Status"}]}]},{tag:"tbody",children:[{tag:"tr",children:[{tag:"td",text:"Alice"},{tag:"td",text:"Developer"},{tag:"td",text:"Active"}]},{tag:"tr",children:[{tag:"td",text:"Bob"},{tag:"td",text:"Designer"},{tag:"td",text:"Away"}]},{tag:"tr",children:[{tag:"td",text:"Carol"},{tag:"td",text:"Manager"},{tag:"td",text:"Active"}]}]}]}]},{label:"Interactive",elements:[{tag:"details",attributes:{open:""},children:[{tag:"summary",text:"Click to expand details"},{tag:"p",text:"Additional detail content revealed when the disclosure widget is toggled open."}]}]},{label:"Media",elements:[{tag:"img",attributes:{alt:"Placeholder image"},style:"width:100%;max-width:400px;height:200px;background:#e0e0e0;display:block;border-radius:4px"},{tag:"video",attributes:{controls:""},style:"width:100%;max-width:400px;height:200px;background:#e0e0e0;display:block;border-radius:4px"},{tag:"audio",attributes:{controls:""},style:"width:100%"}]}],$variables:{color:{label:"Color",prefix:"--color-",placeholder:"#007acc"},font:{label:"Font",prefix:"--font-",placeholder:"system-ui, sans-serif"},size:{label:"Size",prefix:"--size-",placeholder:"16px"},other:{label:"Other",prefix:"--",placeholder:"value"}}};var O={$schema:"https://jxsuite.com/schema/v1",$id:"StudioStylebookChrome",$description:"The bar across the top of the Project Styles canvas: the filter that narrows the specimen catalogue, and the toggle that reduces it to the elements this file has already styled. Both are shell state rather than document state — the adapter owns which — and the two names come in as values, because the surface is called Project Styles and the canvas view it draws is the wire word `stylebook`; nothing a reader sees here may be spelled from that. **The bar IS the kit's toolbar now.** It used to write `role=\"toolbar\"` and its own `aria-label` on a `<div>`, which is a role with none of the behaviour under it: two controls, two tab stops, and no arrow key between them. `jx-action-group` is not the element for it — that one roves `jx-action-button` and this bar's first control is a `jx-textfield` — so `jx-toolbar` is, and the field keeps its own arrows while its caret still has text to walk (ui.md §5.5).",tagName:"jx-toolbar",attributes:{part:"chrome"},$props:{label:{$ref:"#/state/title"}},style:{$description:'What `.sb-chrome` said in `styles/overlays.css`, plus the six inline declarations the template carried beside it, plus `.tb-toggle` — all three go dead with this conversion, and none of them is shared with another surface. Three repairs on the way. The bar is one element rather than a positioned box wrapping a `role="toolbar"` row that declared the same flex layout again. The flex layout is not declared here EITHER any more: `display: flex`, `align-items: center`, the `--jx-space-2` gap, the sans face and the foreground colour are all `jx-toolbar`\'s own, so what is left below is only what a positioned BAND is. And `.tb-toggle` read `var(--spectrum-font-size-50, 11px)`, which the kit spells `--jx-text-sm` at the same value; the rest of its drawing is a `jx-action-button` reaching in through `part="control"`, because what it has to look like is a small bordered chip and every fill and control height the kit draws would otherwise have to be taken back off.',position:"absolute",top:"0",left:"0",right:"0",zIndex:"15",flexShrink:"0",padding:"var(--jx-space-2) var(--jx-space-3)",background:"var(--bg-panel)",borderBottom:"1px solid var(--border)",'& [part="filter"]':{flex:"1",maxWidth:"200px"},'& [part="customized"] > [part="control"]':{$description:"Bordered, unfilled and dimmed until it is on, which is what says it is a filter rather than an action: the catalogue it narrows is the thing the reader is looking at, so the control has to be quieter than its subject.",padding:"3px var(--jx-space-3)",border:"1px solid var(--border)",borderRadius:"var(--radius)",background:"transparent",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)",":hover":{background:"var(--hover-bg)"}},'& [part="customized"][data-selected] > [part="control"]':{$description:"`data-selected` and not `selected`: the kit reflects the pressed state as a data attribute (`jx-action-button.json`), and the property this document binds never reaches the attribute of the same name.",borderColor:"var(--accent)",background:"var(--accent-15)",color:"var(--accent)"}},children:[{tagName:"jx-textfield",attributes:{part:"filter"},$props:{size:"sm",type:"search",clearable:!0,label:{$ref:"#/state/filterLabel"},placeholder:"Filter…",value:{$ref:"#/state/filter"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setFilter"},value:[{$ref:"event#/target/value"}]}]}},{tagName:"jx-action-button",$description:"`onchange` and not `onclick`: a `toggles` button owns its own pressed state and says so with `change` (`jx-action-button.json`), and an `onclick` written here would replace the element's own click handler on the same property — the toggle would stop flipping and stop announcing `aria-pressed`.",attributes:{part:"customized"},$props:{size:"sm",toggles:!0,selected:{$ref:"#/state/customizedOnly"},label:{$ref:"#/state/customizedLabel"},hint:{$ref:"#/state/customizedHint"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/toggleCustomized"},value:[]}]},children:[{tagName:"span",textContent:"${state.customizedLabel}"}]}]};T("stylebook-chrome",O);function z(e,o){let t=document.createElement("div");t.style.display="contents";let n=v({...e,...o}),r=null,s=!1;function i(){s=!0,R("stylebook-chrome",n,t).then((d)=>{s=!1,r=d})}return i(),{host:t,update(d){if(Object.assign(n,d),s||r!==null&&t.contains(r.root))return;r?.dispose(),r=null,t.textContent="",i()}}}function E(e){return!e.startsWith(":")&&!e.startsWith(".")&&!e.startsWith("&")&&!e.startsWith("[")&&!e.startsWith("@")&&!e.startsWith("--")}function w(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}var M="& .element-card-preview";function Ug(e){let o=e,t={},n=(r)=>{let s={};for(let[i,d]of Object.entries(r))if(i!=="@--")s[i]=d;return s};for(let[r,s]of Object.entries(o)){if(!w(s)){t[r]=s;continue}if(r==="@--")continue;if(Rv(r)){t[r]=s;continue}if(r.startsWith("@")){let i={};for(let[d,g]of Object.entries(s))if(w(g)&&E(d))i[`${M} ${d}`]=n(g);else i[d]=g;t[r]=i;continue}if(E(r)){t[`${M} ${r}`]=n(s);continue}t[r]=s}return t}function I(e,o){let t=o.split(" "),n=e;for(let r of t){if(!w(n))return null;n=n[r]}return w(n)?n:null}function J(e,o){let t=e,n=I(t,o);if(n&&Object.keys(n).length>0)return!0;for(let[r,s]of Object.entries(t)){if(!r.startsWith("@")||!w(s))continue;let i=I(s,o);if(i&&Object.keys(i).length>0)return!0}return!1}function _(e){let o=new Map,t=new Map,n=e.filter.toLowerCase(),r=(a,c,h)=>{let p=a.tag===h?h:`${h} ${a.tag}`;o.set(Il(c),p);let m=a.children??[];for(let[l,C]of m.entries())r(C,[...c,"children",l],h)},s=(a)=>{let c={...a.attributes};if(a.style)c.style=a.style;return{tagName:a.tag,...a.text?{textContent:a.text}:{},...Object.keys(c).length>0?{attributes:c}:{},...a.children?{children:a.children.map(s)}:{}}},i=(a,c,h,p,m)=>{o.set(Il(p),a),o.set(Il([...p,"children",0]),a);let l=[...p,"children",0,"children",0];if(m)r(m,l,a);else o.set(Il(l),a);if(!t.has(a))t.set(a,p);return{attributes:{class:"element-card"},children:[{attributes:{class:"element-card-preview"},children:[h],tagName:"div"},{attributes:{class:"element-card-label"},tagName:"div",textContent:c}],tagName:"div"}},d=[],g=(a,c)=>({attributes:{class:"sb-section"},children:[{attributes:{class:"sb-label"},tagName:"div",textContent:a},{attributes:{class:"sb-body"},children:c,tagName:"div"}],tagName:"div"}),f=()=>["children",d.length,"children",1];for(let a of e.meta.$sections){let c=a.elements;if(n)c=c.filter((m)=>m.tag.includes(n)||a.label.toLowerCase().includes(n));if(e.customizedOnly)c=c.filter((m)=>J(e.effectiveStyle,m.tag));if(c.length===0)continue;let h=f(),p=c.map((m,l)=>i(m.tag,`<${m.tag}>`,s(m),[...h,"children",l],m));d.push(g(a.label,p))}let b=[];{let a=e.components;if(n)a=a.filter((c)=>c.tagName.toLowerCase().includes(n));if(e.customizedOnly)a=a.filter((c)=>J(e.effectiveStyle,c.tagName));if(a.length>0){let c=f(),h=a.map((p,m)=>{let l=[...c,"children",m];if(p.source!=="npm"&&p.path?.endsWith(".json")){b.push({$ref:`/${e.projectRoot?`${e.projectRoot}/`:""}${p.path}`.replace(/^\/+/,"/")});let j={};for(let k of p.props??[])if(k.default!==void 0&&k.default!=="false"&&k.default!=="''")j[k.name]=String(k.default).replaceAll(/^'|'$/g,"");let q={tagName:p.tagName,...Object.keys(j).length>0?{attributes:j}:{}};return i(p.tagName,`<${p.tagName}>`,q,l,null)}let V={attributes:{class:"sb-fallback"},tagName:"div",textContent:`<${p.tagName}>`};return i(p.tagName,`<${p.tagName}>`,V,l,null)});d.push(g("Components",h))}}if(d.length===0)d.push({attributes:{class:"sb-empty"},tagName:"div",textContent:e.customizedOnly?"No customized elements":"No matching elements"});return{doc:{...b.length>0?{$elements:b}:{},$media:e.effectiveMedia,attributes:{class:"sb-root"},children:d,style:Ug(e.effectiveStyle),tagName:"div"},pathToTag:o,tagToCardPath:t}}var qg="Project Styles",qk="stylebook",Xy=[{id:"color",prefix:"--color-",title:"Colors"},{id:"font",prefix:"--font-",title:"Fonts"},{id:"size",prefix:"--size-",title:"Sizes & Spacing"},{id:"other",prefix:"--",title:"Other"}];function L(e){if(e.startsWith("--color"))return"color";if(e.startsWith("--font"))return"font";if(e.startsWith("--size")||e.startsWith("--spacing")||e.startsWith("--radius"))return"size";return"other"}function H_(e){let o=L(e);if(o==="other")return e;let{prefix:t}=Xy.find((n)=>n.id===o);return Cv(e,t)}function U(e){if(!e)return[];let o=[];for(let[t,n]of Object.entries(e)){if(!t.startsWith("--"))continue;if(typeof n!=="string"&&typeof n!=="number")continue;o.push({group:L(t),label:H_(t),name:t,value:n})}return o}function Gk(e){let o=U(e);return Xy.map((t)=>({group:t,tokens:o.filter((n)=>n.group===t.id)}))}function Kk(e){if(!e)return[];let{featureQueries:o,sizeBreakpoints:t}=hr(e),n=[],r=[];for(let{name:i,query:d}of o){let g=Nu(d);if(g)n.push({key:`@${i}`,kind:"scheme",label:g==="dark"?"Dark":"Light",name:i,scheme:g});else r.push({key:`@${i}`,kind:"feature",label:`@${i}`,name:i})}let s=t.map(({name:i})=>({key:`@${i}`,kind:"size",label:`@${i}`,name:i}));return[...n,...s,...r]}function A(e,o){let t=e[o.key];return t&&typeof t==="object"?t:void 0}function Gg(e,o,t){let n=A(e,o)?.[t];return typeof n==="string"||typeof n==="number"?n:void 0}function B_(e,o,t,n){if(n){let s=e[o.key]??={};s[t]=n;return}let r=A(e,o);if(!r)return;if(delete r[t],Object.keys(r).length===0)delete e[o.key]}function Jk(e,o,t,n=[]){let r=new Set(n.map((s)=>s.name));return o.filter((s)=>!r.has(s.name)&&Gg(e,s,t)===void 0)}var W=new WeakMap;function K(e){let o={customizedHint:"Show only the elements this file has already styled",customizedLabel:"Customized",customizedOnly:y.stylebook.customizedOnly,filter:y.stylebook.filter,filterLabel:`Filter the ${qg} catalogue`,title:qg},t=W.get(e);if(t)return t.update(o),t.host;let n=z(o,{setFilter:(r)=>{y.stylebook.filter=r},toggleCustomized:()=>{y.stylebook.customizedOnly=!y.stylebook.customizedOnly}});return W.set(e,n),n.host}async function Yk(e,o){let t=e.wrap,n=st(e.paneId),r=y.stylebook.filter.toLowerCase(),{customizedOnly:s}=y.stylebook,i=Ai(n?.doc.document?.$media),{sizeBreakpoints:d,baseWidth:g}=hr(i),f=d.length>0,b=K(e);t.style.overflow="hidden";let S=[];if(f){S.push({displayName:bi("--"),name:"base",width:g});for(let l of d)S.push({displayName:bi(l.name),name:l.name,width:l.width})}let a;if(!f){let l=i&&i["--"],C=l?`${bi("--")} (${g}px)`:null;a=[o.canvasPanelEntry(l?"base":null,C,!l,l?g:void 0)]}else a=S.map((l)=>o.canvasPanelEntry(l.name,`${l.displayName} (${l.width}px)`,!1,l.width));if(!await o.drawStage(e,{frame:"boards",framePart:"panzoom",frameVars:"--boards-inset:40px",handles:"hidden",hug:!1,innerPart:"boards",lead:"chrome",panels:a.map((l)=>l.item)},a))return;let h=o.stageHost(e,"chrome-host");if(h&&h.firstChild!==b)h.replaceChildren(b);let p=_({components:at,customizedOnly:Boolean(s),effectiveMedia:i??{},effectiveStyle:Ko(n?.doc.document?.style),filter:r,meta:Kg,projectRoot:D?.projectRoot??null}),{panels:m}=e;for(let{panel:l}of a)m.push(l),EC(e.renderGeneration,p,l.canvas,l._width);if(f)o.updateActivePanelHeaders(e);o.applyTransform(e),o.observeCenterUntilStable(e)}function yu(e,o,{panCanvas:t=!1}={}){if(y.stylebook.selection=e,Lc(u.value,{selection:[[]],ui:{activeSelector:e,rightTab:"style",...o!==void 0?{activeMedia:o}:{}}}),e&&t)$C(e)}var Q=8,Qy=[{id:"properties",title:"Content"},{id:"style",title:"Style"},{id:"events",title:"Logic"},{id:"assistant",title:"Assistant"}];function ew(){return{saveDocument:()=>{},undo:()=>{},redo:()=>{},openInBrowser:()=>{},buildSite:()=>{},closeDocument:()=>{},duplicateSelection:()=>{},deleteSelection:()=>{},selectParent:()=>{},toggleDock:()=>{},toggleZen:()=>{},openPalette:()=>{},openProject:()=>{},newWindow:()=>{},panelRoster:[],focusPanel:()=>{},focusInspectorTab:()=>{},cycleRegion:()=>{}}}var x=(e)=>e.document.open,P=(e)=>e.selection.count>0&&e.editor.kind==="canvas",N=(e)=>!e.selection.isRoot&&e.selection.paths.every((o)=>Nl(o)),B="an element selected on the canvas that has a sibling position: not the document root, a repeater's template or a switch case",H=(e)=>e.map((o)=>`[${o.join(", ")}]`).join(" and ");function Jh(e){return[{id:"file.save",title:"Save",category:"File",level:"document",icon:"floppy-disk",keybinding:"mod+s",menus:["commandbar/primary","statusbar/document","palette"],group:"1_file",undo:"none",when:x,requires:"an open document",run:()=>e.saveDocument()},{id:"document.close",title:"Close Document",category:"Document",level:"document",keybinding:"mod+w",menus:["context/tab","palette"],group:"1_file",when:x,requires:"an open document",run:()=>e.closeDocument()},{id:"view.openInBrowser",title:"Open in Browser",category:"View",level:"document",icon:"arrow-square-out",keybinding:"mod+shift+o",menus:["commandbar/primary","statusbar/document","palette"],group:"2_output",when:(t)=>t.project.isSite,enablement:x,requires:"a page to preview",run:()=>e.openInBrowser()},{id:"project.buildSite",title:"Build Site",category:"Project",level:"project",menus:["commandbar/overflow","palette"],group:"2_output",when:(t)=>t.project.isSite,requires:"a site project",run:()=>e.buildSite()},{id:"edit.undo",title:"Undo",category:"Edit",level:"document",icon:"arrow-u-up-left",keybinding:"mod+z",menus:["commandbar/primary","palette"],group:"1_history",when:x,enablement:(t)=>t.document.canUndo,requires:"a change to undo",run:()=>e.undo()},{id:"edit.redo",title:"Redo",category:"Edit",level:"document",icon:"arrow-u-up-right",keybinding:["mod+shift+z","mod+y"],menus:["commandbar/primary","palette"],group:"1_history",when:x,enablement:(t)=>t.document.canRedo,requires:"a change to redo",run:()=>e.redo()},{id:"selection.duplicate",title:"Duplicate",category:"Selection",level:"selection",keyScope:"canvas",keybinding:"mod+d",menus:["blockbar","context/element","context/layer","outline/row","palette"],group:"3_structure",undo:"document",when:P,enablement:N,requires:B,aiTool:{name:"duplicate_node",description:"Duplicate elements in the document, inserting each copy after its original, as one undoable step. The copies become the selection.",report:({after:t})=>{let n=t.selection.paths.length;return`Duplicated ${n} element${n===1?"":"s"}; the ${n===1?"copy is":"copies are"} selected at ${H(t.selection.paths)}.`}},run:()=>e.duplicateSelection()},{id:"selection.repeat",title:"Repeat...",category:"Selection",level:"selection",keyScope:"canvas",menus:["context/element","palette"],group:"3_structure",undo:"document",when:P,enablement:(t)=>N(t)&&!t.selection.isRepeater,requires:"an element with a sibling position that is not already a repeater",run:()=>{(me("x19jr6c7"),import("./convert-to-repeater-x19jr6c7.js")).then(({convertToRepeater:t})=>t())}},{id:"selection.delete",title:"Delete",category:"Selection",level:"selection",keyScope:"canvas",keybinding:["delete","backspace"],menus:["blockbar","context/element","context/layer","outline/row","palette"],group:"9_danger",destructive:!0,undo:"document",when:P,enablement:N,requires:B,aiTool:{name:"delete_node",description:"Delete elements from the document as one undoable step.",report:({before:t,after:n})=>{let r=t.selection.paths.length;return`Deleted ${r} element${r===1?"":"s"} at ${H(t.selection.paths)} in one undo step; the selection is now ${n.selection.count===0?"empty":"elsewhere"}.`}},run:()=>e.deleteSelection()},{id:"selection.selectParent",title:"Select Parent",category:"Selection",level:"selection",keyScope:"canvas",keybinding:["escape","arrowleft"],menus:["palette"],group:"2_navigate",when:P,requires:"an element selection",run:()=>e.selectParent()},{id:"view.toggleNavigator",title:"Toggle Navigator Dock",category:"View",level:"application",keybinding:"mod+b",menus:["commandbar/overflow","palette"],group:"4_docks",run:()=>e.toggleDock("navigator")},{id:"view.toggleInspector",title:"Toggle Inspector Dock",category:"View",level:"application",keybinding:"mod+alt+b",menus:["commandbar/overflow","palette"],group:"4_docks",run:()=>e.toggleDock("inspector")},{id:"view.zen",title:"Zen Mode",category:"View",level:"application",keybinding:"mod+.",menus:["commandbar/overflow","palette"],group:"4_docks",run:()=>e.toggleZen()},{id:"palette.open",title:"Open Command Center",category:"View",level:"application",keybinding:"mod+k",menus:["palette"],group:"5_palette",run:()=>e.openPalette("picker")},{id:"palette.openFiles",title:"Go to File…",category:"File",level:"application",keybinding:"mod+p",menus:["palette"],group:"5_palette",run:()=>e.openPalette("files")},{id:"palette.openCommands",title:"Run Command…",category:"View",level:"application",keybinding:"mod+shift+p",menus:["palette"],group:"5_palette",run:()=>e.openPalette("commands")},{id:"palette.openNodes",title:"Go to Symbol in Document…",category:"Selection",level:"document",menus:["palette"],group:"5_palette",when:x,requires:"an open document",run:()=>e.openPalette("nodes")},{id:"project.open",title:"Open Project…",category:"Project",level:"project",keybinding:"mod+o",menus:["commandbar/overflow","statusbar/project","palette"],group:"1_file",run:()=>e.openProject()},{id:"view.newWindow",title:"New Window",category:"View",level:"application",keybinding:"mod+shift+n",menus:["commandbar/overflow","palette"],group:"1_file",when:(t)=>t.capability.windowControls,requires:"a host that can hold more than one window",run:()=>e.newWindow()},{id:"project.openRecent",title:"Open Recent…",category:"Project",level:"project",menus:["commandbar/overflow","statusbar/project","palette"],group:"1_file",run:()=>e.openPalette("projects")},...Z(e),...Y(e),{id:"view.cycleRegion",title:"Focus Next Region",category:"View",level:"application",keybinding:"f6",menus:["palette"],group:"4_docks",run:()=>e.cycleRegion(1)},{id:"view.cycleRegionBack",title:"Focus Previous Region",category:"View",level:"application",keybinding:"shift+f6",menus:["palette"],group:"4_docks",run:()=>e.cycleRegion(-1)}]}function Z(e){let o=0;return e.panelRoster.map((t)=>{let n={id:`panel.focus.${t.id}`,title:`Show ${t.title}`,category:"View",level:"application",menus:["palette"],group:"4_docks",requires:"an open project",when:(r)=>r.project.open&&(t.when?.(r)??!0),run:()=>e.focusPanel(t.id)};if(t.rail!==!1&&o<Q)o+=1,n.keybinding=`mod+${o}`;return n})}function Y(e){return Qy.map((o,t)=>({id:`inspector.focus.${o.id}`,title:`Show ${o.title}`,category:"View",level:"document",keybinding:`mod+shift+${t+1}`,menus:["palette"],group:"4_docks",requires:"an open document",when:(r)=>r.document.open,run:()=>e.focusInspectorTab(o.id)}))}
|
|
6
|
+
export{Ug,qg,qk,Xy,H_,Gk,Kk,Gg,B_,Jk,Kg,Yk,yu,Qy,ew,Jh};
|
|
7
7
|
|
|
8
|
-
//# debugId=
|
|
9
|
-
//# sourceMappingURL=studio-
|
|
8
|
+
//# debugId=396B05510E8DB6FB64756E2164756E21
|
|
9
|
+
//# sourceMappingURL=studio-ebt49j3c.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
function v(s,n={}){let t=n.baseMs??1000,o=n.maxMs??30000,i=n.random??Math.random,e=Math.min(o,t*2**Math.max(0,s));return e/2+i()*e/2}function Vg(s,n={}){let t=n.win??(typeof window>"u"?void 0:window),o=n.doc??(typeof document>"u"?void 0:document),i=0,e=null,r=!1,a=()=>{if(e=null,!r)s()},c=()=>{if(r||e===null)return;clearTimeout(e),i=0,a()},u=(d)=>{if(d.persisted)c()},l=()=>{if(o?.visibilityState==="visible")c()};return t?.addEventListener("online",c),t?.addEventListener("pageshow",u),o?.addEventListener("visibilitychange",l),{dispose(){if(r)return;if(r=!0,e!==null)clearTimeout(e),e=null;t?.removeEventListener("online",c),t?.removeEventListener("pageshow",u),o?.removeEventListener("visibilitychange",l)},opened(){i=0},scheduleRetry(){if(r||e!==null)return;let d=v(i,n);i+=1,e=setTimeout(a,d)},wake:c}}
|
|
2
|
+
export{Vg};
|
|
3
|
+
|
|
4
|
+
//# debugId=5E346150D9E5AB3564756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-eegyf5vg.js.map
|