@jxsuite/studio 9.0.0 → 10.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (178) hide show
  1. package/dist/chunks/{2020-89fz3pfy.js → 2020-j56903f1.js} +3 -3
  2. package/dist/chunks/adapter-wc5zvg9a.js +4 -0
  3. package/dist/chunks/{add-new-flow-nmkqpjym.js → add-new-flow-snx1s4b0.js} +3 -3
  4. package/dist/chunks/{cf-account-picker-2e06qxey.js → cf-account-picker-xyqw0jex.js} +3 -3
  5. package/dist/chunks/cf-settings-hp1pjm0n.js +4 -0
  6. package/dist/chunks/components-nkwphrx3.js +4 -0
  7. package/dist/chunks/content-source-6a253wmk.js +4 -0
  8. package/dist/chunks/{convert-to-repeater-j9hfcj4f.js → convert-to-repeater-fhdwyg14.js} +3 -3
  9. package/dist/chunks/editor-wqrc68ca.js +4 -0
  10. package/dist/chunks/entry-commands-nef0wrmp.js +4 -0
  11. package/dist/chunks/{extension-sections-thfke054.js → extension-sections-8ez2rrk8.js} +2 -2
  12. package/dist/chunks/file-ops-y3w71k1n.js +4 -0
  13. package/dist/chunks/files-de90apn9.js +4 -0
  14. package/dist/chunks/format-host-zfjz4rzm.js +4 -0
  15. package/dist/chunks/fs-events-77c0mr0x.js +4 -0
  16. package/dist/chunks/grid-open-4n4fjfpf.js +4 -0
  17. package/dist/chunks/{grid-view-7d2nx83y.js → grid-view-ka55z38f.js} +4 -4
  18. package/dist/chunks/iframe-host-na2mywz4.js +4 -0
  19. package/dist/chunks/index-ewmgdb7c.js +4 -0
  20. package/dist/chunks/{index-jxmt7vh8.js → index-qb98xhse.js} +3 -3
  21. package/dist/chunks/{javascript-vmqp56ke.js → javascript-ces13wny.js} +2 -2
  22. package/dist/chunks/{jsonMode-n3wmpant.js → jsonMode-6md16d4v.js} +2 -2
  23. package/dist/chunks/jx-validate-b309c020.js +4 -0
  24. package/dist/chunks/layers-8rn8y6qv.js +4 -0
  25. package/dist/chunks/layers-panel-eyah7h9z.js +4 -0
  26. package/dist/chunks/media-library-gs3np47y.js +4 -0
  27. package/dist/chunks/media-picker-tt7dk4tb.js +4 -0
  28. package/dist/chunks/{monaco-binding-wfhmz89d.js → monaco-binding-p8j80s4w.js} +3 -3
  29. package/dist/chunks/monaco-buffer-wsf6cmnq.js +4 -0
  30. package/dist/chunks/{monaco-setup-fty7a8vg.js → monaco-setup-wasktzfg.js} +2 -2
  31. package/dist/chunks/notify-qwst108r.js +4 -0
  32. package/dist/chunks/platform-c16mqvmp.js +4 -0
  33. package/dist/chunks/publish-panel-d34bhvwj.js +4 -0
  34. package/dist/chunks/{publish-quick-12hh8926.js → publish-quick-vr695j26.js} +3 -3
  35. package/dist/chunks/publish-workspace-2yr60mt4.js +4 -0
  36. package/dist/chunks/quick-search-e6xsdv0d.js +4 -0
  37. package/dist/chunks/references-gsj6trdv.js +4 -0
  38. package/dist/chunks/right-panel-33jv1knc.js +4 -0
  39. package/dist/chunks/source-control-bj9bejjv.js +4 -0
  40. package/dist/chunks/{studio-9ndgd55w.js → studio-03mqh8ax.js} +4 -4
  41. package/dist/chunks/{studio-apapy17g.js → studio-06j4en5h.js} +2 -2
  42. package/dist/chunks/{studio-aghsg0ds.js → studio-0ydxv2mr.js} +6 -6
  43. package/dist/chunks/{studio-ekzbgnjp.js → studio-1e8dw2w2.js} +4 -4
  44. package/dist/chunks/{studio-0nefxhar.js → studio-2hsqbq7b.js} +5 -5
  45. package/dist/chunks/{studio-sm2f0sc6.js → studio-2j86y34y.js} +5 -5
  46. package/dist/chunks/{studio-1cfyd1ys.js → studio-2ks6ka4g.js} +3 -3
  47. package/dist/chunks/{studio-vtey9w98.js → studio-34jrz12k.js} +4 -4
  48. package/dist/chunks/{studio-e4rq6x0q.js → studio-35vrtpdq.js} +4 -4
  49. package/dist/chunks/{studio-a9k86nq6.js → studio-38g0jdz7.js} +4 -4
  50. package/dist/chunks/{studio-9gzvypw4.js → studio-396srjbk.js} +4 -4
  51. package/dist/chunks/{studio-4j35hgsw.js → studio-3c8pp7pb.js} +4 -4
  52. package/dist/chunks/{studio-z1p91z5a.js → studio-3v5cagy9.js} +4 -4
  53. package/dist/chunks/{studio-a6e5fzve.js → studio-3w35qvay.js} +4 -4
  54. package/dist/chunks/{studio-ry4789ng.js → studio-3zge48z4.js} +6 -6
  55. package/dist/chunks/{studio-9ra9e7m4.js → studio-45gyxpcq.js} +4 -4
  56. package/dist/chunks/{studio-tfmhnwyr.js → studio-4kzbrr5t.js} +3 -3
  57. package/dist/chunks/{studio-tyzgte21.js → studio-5tzgq6fx.js} +4 -4
  58. package/dist/chunks/{studio-nqexty8x.js → studio-5wzdy1jc.js} +6 -6
  59. package/dist/chunks/{studio-14hh60j8.js → studio-771k2n12.js} +4 -4
  60. package/dist/chunks/{studio-nm86874b.js → studio-7dzyz9n8.js} +98 -98
  61. package/dist/chunks/{studio-k5n4es74.js → studio-7xag4na8.js} +4 -4
  62. package/dist/chunks/studio-88bmt9rh.js +5 -0
  63. package/dist/chunks/{studio-kyw47pet.js → studio-9b7177jq.js} +4 -4
  64. package/dist/chunks/{studio-yjh9gddd.js → studio-9cxmp61c.js} +5 -5
  65. package/dist/chunks/{studio-qd0cycm4.js → studio-9dz76yqc.js} +5 -5
  66. package/dist/chunks/{studio-cg54vtet.js → studio-agyvzfm4.js} +4 -4
  67. package/dist/chunks/{studio-x2trkhk5.js → studio-c1pxszat.js} +4 -4
  68. package/dist/chunks/{studio-qs5fmhtj.js → studio-cpkamjdn.js} +7 -7
  69. package/dist/chunks/{studio-n4qq1n57.js → studio-d038kqbs.js} +4 -4
  70. package/dist/chunks/{studio-fj6jzgxw.js → studio-d83m0wyq.js} +4 -4
  71. package/dist/chunks/studio-dbxv7w4s.js +5 -0
  72. package/dist/chunks/{studio-7q6jdd4h.js → studio-de1s2x9v.js} +4 -4
  73. package/dist/chunks/{studio-h4jbgne2.js → studio-dx73md4n.js} +6 -6
  74. package/dist/chunks/{studio-nfwacw31.js → studio-ekgtrndg.js} +4 -4
  75. package/dist/chunks/{studio-79r8msnr.js → studio-epenqmvk.js} +3 -3
  76. package/dist/chunks/{studio-sc35ttdk.js → studio-et2q4s8n.js} +4 -4
  77. package/dist/chunks/{studio-g45r5vm8.js → studio-ewarnzm4.js} +2 -2
  78. package/dist/chunks/{studio-nfmpmkqb.js → studio-fy7jzj9j.js} +4 -4
  79. package/dist/chunks/{studio-kqh7fxn6.js → studio-gr36vnte.js} +4 -4
  80. package/dist/chunks/{studio-spza69tb.js → studio-gwrhcrss.js} +5 -5
  81. package/dist/chunks/{studio-8hf8qcm1.js → studio-h310mbqm.js} +4 -4
  82. package/dist/chunks/{studio-qevf5z9d.js → studio-h5tpz5ke.js} +4 -4
  83. package/dist/chunks/studio-h7weqf2q.js +5 -0
  84. package/dist/chunks/{studio-gk9yk8dj.js → studio-hcsba201.js} +6 -6
  85. package/dist/chunks/{studio-ws2r1d7e.js → studio-hwejq03c.js} +4 -4
  86. package/dist/chunks/{studio-9179bsm7.js → studio-hy4ye0dx.js} +6 -6
  87. package/dist/chunks/{studio-myb4mf0h.js → studio-jttyqrmh.js} +4 -4
  88. package/dist/chunks/{studio-k6hbx2fc.js → studio-jw0q5j6k.js} +4 -4
  89. package/dist/chunks/{studio-s4fq9jht.js → studio-k3a8rp3d.js} +4 -4
  90. package/dist/chunks/{studio-by8x0jvc.js → studio-k3bcy02e.js} +4 -4
  91. package/dist/chunks/{studio-3hpcawh8.js → studio-m48v13s3.js} +3 -3
  92. package/dist/chunks/{studio-4qg61g9j.js → studio-ndskgqef.js} +4 -4
  93. package/dist/chunks/studio-p1n2xjda.js +5 -0
  94. package/dist/chunks/{studio-ae7a69jc.js → studio-pgm83a2f.js} +5 -5
  95. package/dist/chunks/{studio-0rg30pvs.js → studio-pqqq6v85.js} +4 -4
  96. package/dist/chunks/{studio-gskkgfe3.js → studio-r17asgs0.js} +4 -4
  97. package/dist/chunks/{studio-8pne0rx4.js → studio-ry81j4q1.js} +4 -4
  98. package/dist/chunks/{studio-mkw17ngg.js → studio-rzg8hnkf.js} +4 -4
  99. package/dist/chunks/{studio-trcfer2b.js → studio-s0fg2wav.js} +4 -4
  100. package/dist/chunks/{studio-gczve8zf.js → studio-tj2s0tks.js} +3 -3
  101. package/dist/chunks/{studio-tn7v8gey.js → studio-v9ywz2se.js} +5 -5
  102. package/dist/chunks/{studio-nvfa137z.js → studio-vswcpzk7.js} +5 -5
  103. package/dist/chunks/{studio-ztppbam0.js → studio-vzgmyt0v.js} +4 -4
  104. package/dist/chunks/{studio-fg4fj9ec.js → studio-wxdcd42g.js} +5 -5
  105. package/dist/chunks/{studio-xzgp0cp7.js → studio-wxhy1yh7.js} +4 -4
  106. package/dist/chunks/{studio-4rgem12q.js → studio-x08a3m0a.js} +4 -4
  107. package/dist/chunks/{studio-t6dqnnft.js → studio-x3mjr5cc.js} +4 -4
  108. package/dist/chunks/{studio-9ff0vqff.js → studio-x97ay0v4.js} +4 -4
  109. package/dist/chunks/{studio-32d8wyxq.js → studio-xdpz9rpe.js} +29 -29
  110. package/dist/chunks/{studio-6k9djnxw.js → studio-xh683qzy.js} +4 -4
  111. package/dist/chunks/{studio-c88gq88j.js → studio-xkxetm65.js} +5 -5
  112. package/dist/chunks/{studio-jr30g4ae.js → studio-y26hx9re.js} +4 -4
  113. package/dist/chunks/{studio-hcy9zeac.js → studio-yg3djpnm.js} +4 -4
  114. package/dist/chunks/studio-yx8hzqja.js +5 -0
  115. package/dist/chunks/{studio-ht81xjkr.js → studio-zg16eeq1.js} +4 -4
  116. package/dist/chunks/{studio-6rbaedw2.js → studio-zgx7svjd.js} +6 -6
  117. package/dist/chunks/{studio-ywf9y1e2.js → studio-zkq3r91p.js} +4 -4
  118. package/dist/chunks/{tsMode-byje4a01.js → tsMode-h6tkz0ea.js} +2 -2
  119. package/dist/chunks/workspace-home-zkkrxq3r.js +4 -0
  120. package/dist/chunks/workspace-tdqqjqaa.js +4 -0
  121. package/dist/chunks/{ws-client-h09h6sqg.js → ws-client-e951my95.js} +3 -3
  122. package/dist/iframe-entry.js +8 -8
  123. package/dist/manifest.json +72 -72
  124. package/dist/studio.js +64 -65
  125. package/package.json +11 -11
  126. package/src/canvas/iframe-editable-root.ts +32 -2
  127. package/src/format/format-host.ts +1 -1
  128. package/src/github/github-auth-status.ts +2 -2
  129. package/src/media/media-library.ts +73 -3
  130. package/src/packages/ensure-deps.ts +5 -5
  131. package/src/packages/pull-package-sync.ts +4 -4
  132. package/src/panels/activity-panel.ts +1 -1
  133. package/src/platforms/cloud.ts +48 -34
  134. package/src/settings/extension-commands.ts +1 -1
  135. package/src/settings/extension-rows.ts +1 -6
  136. package/src/settings/extensions-section.ts +3 -6
  137. package/src/surfaces/block-action-bar.json +1 -3
  138. package/src/surfaces/media-library.json +35 -0
  139. package/src/surfaces/media-library.ts +2 -0
  140. package/src/surfaces/menu.ts +62 -1
  141. package/src/surfaces/settings-packages.ts +1 -1
  142. package/src/types.ts +10 -8
  143. package/src/ui/layers.ts +1 -1
  144. package/src/ui/progress-modal.ts +3 -3
  145. package/dist/chunks/adapter-ay13gema.js +0 -4
  146. package/dist/chunks/cf-settings-5y04810c.js +0 -4
  147. package/dist/chunks/components-3vf75n83.js +0 -4
  148. package/dist/chunks/content-source-4f2raf4a.js +0 -4
  149. package/dist/chunks/editor-645krvtz.js +0 -4
  150. package/dist/chunks/entry-commands-3qmv8wkr.js +0 -4
  151. package/dist/chunks/file-ops-kkhp9ma7.js +0 -4
  152. package/dist/chunks/files-yswdhxrf.js +0 -4
  153. package/dist/chunks/format-host-4g8ex6bz.js +0 -4
  154. package/dist/chunks/fs-events-z9gpvc6t.js +0 -4
  155. package/dist/chunks/grid-open-fm4j183c.js +0 -4
  156. package/dist/chunks/iframe-host-q7fedsmr.js +0 -4
  157. package/dist/chunks/index-pt4wh98x.js +0 -4
  158. package/dist/chunks/jx-validate-19y62knt.js +0 -4
  159. package/dist/chunks/layers-panel-1qvc83y9.js +0 -4
  160. package/dist/chunks/layers-qf0bc7ze.js +0 -4
  161. package/dist/chunks/media-library-f9d5qcjb.js +0 -4
  162. package/dist/chunks/media-picker-rsb1fmk2.js +0 -4
  163. package/dist/chunks/monaco-buffer-ak0raadw.js +0 -4
  164. package/dist/chunks/notify-4qj70q0x.js +0 -4
  165. package/dist/chunks/platform-ehg6t9vd.js +0 -4
  166. package/dist/chunks/publish-panel-yhmda3cd.js +0 -4
  167. package/dist/chunks/publish-workspace-hx8qdv9p.js +0 -4
  168. package/dist/chunks/quick-search-r955m3q1.js +0 -4
  169. package/dist/chunks/references-8gxv0x7t.js +0 -4
  170. package/dist/chunks/right-panel-jarwqjpy.js +0 -4
  171. package/dist/chunks/source-control-84qt25m9.js +0 -4
  172. package/dist/chunks/studio-2bq7hheq.js +0 -5
  173. package/dist/chunks/studio-dvhxxxbd.js +0 -5
  174. package/dist/chunks/studio-ge08zwpv.js +0 -5
  175. package/dist/chunks/studio-nr0kcqc6.js +0 -5
  176. package/dist/chunks/studio-y47090vq.js +0 -5
  177. package/dist/chunks/workspace-7q4arnt3.js +0 -4
  178. package/dist/chunks/workspace-home-ge027kr6.js +0 -4
@@ -1,5 +1,5 @@
1
- import{Ot,Nt,ae}from"./studio-qs5fmhtj.js";import{p}from"./studio-9ndgd55w.js";import{ds}from"./studio-y47090vq.js";import{g}from"./studio-tfmhnwyr.js";import{Ue,ft,T,R,Jt,tt}from"./studio-myb4mf0h.js";import{zl,lN,Sb,qT,cN,Ri,Nd}from"./studio-0nefxhar.js";import{cb,DE}from"./studio-nr0kcqc6.js";import{S}from"./studio-9ra9e7m4.js";import{Q}from"./studio-ywf9y1e2.js";import{le}from"./studio-k5n4es74.js";function Rl(e){let t=e.trim().replaceAll("\\","/").split("/").filter((n)=>n!=="");return t.some((n)=>n==="."||n==="..")?null:t.join("/")}var C={$schema:"https://jxsuite.com/schema/v1",$id:"StudioPublish",$description:"Publish: the one-click Cloudflare Pages flow, as a `jx-dialog` over the kit. Eight bodies, one at a time, because the reader is at exactly one point of a chain — a host that cannot reach Cloudflare at all, a question still in flight, a connection that lapsed, an invitation to connect, a stored token Cloudflare refused, a field to paste a replacement into, the create-and-connect form, and the connected status. `publish/publish-panel.ts` keeps every one of those decisions and the calls that settle them; this document knows only which of the eight it was told to draw. **The token is never painted.** The field below binds no `value` — it is written by the reader and read once, on its way to storage — so a stored secret cannot reach the attribute, the serialised HTML or the accessibility tree, which is `studio.md` §15 rule 1 written as a missing binding rather than as a rule somebody remembers.",tagName:"jx-dialog",$props:{headline:"Publish",confirmLabel:"",cancelLabel:"Close",size:"md"},attributes:{part:"publish"},oncancel:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},onclose:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},style:{$description:"What the five `.publish-*` names carried, keyed on `part`, and most of them do not survive the move. `.publish-modal` and its `.new-project-modal` base were a fixed card, a scroll body, a border, a shadow and a `z-index: 1000` — a modal `<dialog>` is every one of those, and the top layer is what the z-index was climbing towards. `.publish-field` was a label stacked over a control, which is `jx-field`'s whole shape. What is left is the column gap between bodies, the two button rows, the hint and the refusal. Nothing here uses `--spectrum-*`: those custom properties resolve only inside `<sp-theme>`, and a document mounted in a layer host is outside it, so each would silently have taken its hard-coded fallback.",'& [part="body"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-3)"},'& [part="note"], & [part="status-line"], & [part="deployment"]':{margin:"0",lineHeight:"1.5"},'& [part="rows"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-3)"},'& [part="actions"]':{$description:'Wraps rather than overflows (studio-ui-guidelines.md §4.6): two buttons whose labels are whole phrases — "Verify & Connect", "Preferences › Accounts" — are wider than a narrow dialog at the sizes a reader may have set.',display:"flex",flexWrap:"wrap",gap:"var(--jx-space-2)"},'& [part="submit"]':{alignSelf:"flex-start"},'& [part="hint"]':{$description:"Publishing rides every commit, so the connected body's only job is to say what is already happening. Dim, because it is a standing fact rather than something to act on.",margin:"0",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"},'& [part="failure"]':{$description:'`failure` and not `error`: `jx-textfield` and `jx-select` each draw a `[part="error"]` of their own inside this same tree, and the kit is light DOM — a scoped rule on that name would restyle the token field\'s refusal line too.',margin:"0",color:"var(--danger)",lineHeight:"1.5"},'& [part="link"], & [part="install-link"]':{color:"var(--accent)",textDecoration:"underline"},"& code":{fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-sm)"}},children:[{tagName:"div",attributes:{part:"body"},children:[{tagName:"div",attributes:{part:"body-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/body"},cases:{unsupported:{tagName:"p",attributes:{part:"note"},children:["This platform cannot reach the Cloudflare API. Publish by committing and pushing — your host builds ",{tagName:"code",textContent:"bunx jx build"}," and serves ",{tagName:"code",textContent:"dist/"},"."]},loading:{tagName:"p",attributes:{part:"note"},textContent:"Checking Cloudflare connection…"},lapsed:{tagName:"div",attributes:{part:"lapsed",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"note"},textContent:"Your Cloudflare connection has expired, so publishing cannot reach your account. Reconnect to restore it — this site's Pages project and its settings are untouched."},{tagName:"jx-button",$props:{variant:"accent",disabled:{$ref:"#/state/busy"}},attributes:{part:"reconnect"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/connect"},value:[]}]},children:[{tagName:"span",textContent:"${state.connectLabel}"}]}]},hosted:{tagName:"div",attributes:{part:"hosted",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"note"},textContent:"Connect your Cloudflare account to publish this site."},{tagName:"jx-button",$props:{disabled:{$ref:"#/state/busy"}},attributes:{part:"connect"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/connect"},value:[]}]},children:[{tagName:"span",textContent:"Connect Cloudflare"}]}]},stored:{tagName:"div",attributes:{part:"stored",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"note"},textContent:"A Cloudflare API token is stored on this machine, and Cloudflare did not accept it. It may have been revoked, or it may be missing the Account Settings Read and Pages Read/Write permissions."},{tagName:"div",attributes:{part:"actions"},children:[{tagName:"jx-button",$props:{disabled:{$ref:"#/state/busy"}},attributes:{part:"replace"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/replace"},value:[]}]},children:[{tagName:"span",textContent:"Replace token"}]},{tagName:"jx-button",$props:{quiet:!0},attributes:{part:"accounts"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openAccounts"},value:[]}]},children:[{tagName:"span",textContent:"Preferences › Accounts"}]}]}]},token:{tagName:"div",attributes:{part:"token-form",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"note"},textContent:"Paste a Cloudflare API token (permissions: Account Settings Read, Pages Read/Write). It is stored on this machine and only sent to the same-origin proxy — Studio never renders it back."},{tagName:"jx-field",$props:{span:!0,label:"API token"},attributes:{part:"token-row","data-field":"token"},children:[{tagName:"jx-textfield",$description:"No `value` binding, and its absence is the contract: a secret may pass through a field the reader typed it into and may never be painted into one they did not. The draft lives in the adapter's closure until Verify reads it, so nothing here — not the attribute, not the accessibility tree, not a DOM dump — has ever held it.",$props:{type:"password",placeholder:"cf_..."},attributes:{part:"token"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setToken"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"div",attributes:{part:"actions"},children:[{tagName:"jx-button",$props:{variant:"accent",disabled:{$ref:"#/state/busy"}},attributes:{part:"verify"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/verify"},value:[]}]},children:[{tagName:"span",textContent:"Verify & Connect"}]},{tagName:"jx-button",$props:{quiet:!0},attributes:{part:"accounts"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openAccounts"},value:[]}]},children:[{tagName:"span",textContent:"Preferences › Accounts"}]}]}]},form:{tagName:"div",attributes:{part:"connect-form",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"note"},children:["Create a Cloudflare Pages project connected to this repository. Every commit then builds and publishes automatically (",{tagName:"code",textContent:"bunx jx build"},")."]},{tagName:"div",attributes:{part:"rows"},children:[{tagName:"jx-field",$props:{span:!0,label:"Account"},attributes:{part:"row","data-field":"account"},children:[{tagName:"jx-select",$props:{options:{$ref:"#/state/accountOptions"},value:{$ref:"#/state/accountId"}},attributes:{part:"account"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setAccount"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-field",$props:{span:!0,label:"Pages project name"},attributes:{part:"row","data-field":"projectName"},children:[{tagName:"jx-textfield",$props:{value:{$ref:"#/state/projectName"}},attributes:{part:"project-name"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setProjectName"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-field",$props:{span:!0,label:"GitHub owner"},attributes:{part:"row","data-field":"owner"},children:[{tagName:"jx-textfield",$props:{value:{$ref:"#/state/owner"}},attributes:{part:"owner"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setOwner"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-field",$props:{span:!0,label:"GitHub repository"},attributes:{part:"row","data-field":"repo"},children:[{tagName:"jx-textfield",$props:{value:{$ref:"#/state/repo"}},attributes:{part:"repo"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setRepo"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-field",$props:{span:!0,label:"Production branch"},attributes:{part:"row","data-field":"branch"},children:[{tagName:"jx-textfield",$props:{value:{$ref:"#/state/branch"}},attributes:{part:"branch"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setBranch"},value:[{$ref:"event#/target/value"}]}]}}]}]},{tagName:"jx-button",$props:{variant:"accent",disabled:{$ref:"#/state/busy"}},attributes:{part:"submit"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/submit"},value:[]}]},children:[{tagName:"span",textContent:"${state.submitLabel}"}]}]},status:{tagName:"div",attributes:{part:"status",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"status-line"},children:["Connected to Pages project ",{tagName:"strong",attributes:{part:"project-name"},textContent:"${state.deployProject}"},{tagName:"span",attributes:{part:"site-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasProductionUrl"},cases:{true:{tagName:"span",children:[" — ",{tagName:"a",attributes:{part:"link",href:"${state.productionUrl}",target:"_blank",rel:"noreferrer"},textContent:"${state.productionUrl}"}]}}}]},{tagName:"div",attributes:{part:"deployment-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasDeployment"},cases:{true:{tagName:"p",attributes:{part:"deployment"},children:["Latest deployment: ",{tagName:"strong",attributes:{part:"deployment-state"},textContent:"${state.deploymentState}"}," (${state.deploymentEnvironment}) — ",{tagName:"a",attributes:{part:"link",href:"${state.deploymentUrl}",target:"_blank",rel:"noreferrer"},textContent:"preview"}]},false:{tagName:"p",attributes:{part:"deployment"},textContent:"No deployments yet — the first commit after connecting triggers one."}}},{tagName:"p",attributes:{part:"hint"},textContent:"Publishing happens automatically on every commit."},{tagName:"div",attributes:{part:"actions"},children:[{tagName:"jx-button",$props:{disabled:{$ref:"#/state/busy"}},attributes:{part:"refresh"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/refresh"},value:[]}]},children:[{tagName:"span",textContent:"Refresh"}]},{tagName:"jx-button",$props:{variant:"negative",disabled:{$ref:"#/state/busy"}},attributes:{part:"disconnect"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/disconnect"},value:[]}]},children:[{tagName:"span",textContent:"Disconnect"}]}]}]}}},{tagName:"div",attributes:{part:"failure-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasFailure"},cases:{true:{tagName:"p",attributes:{part:"failure"},children:["${state.failure}",{tagName:"span",attributes:{part:"pages-app-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/needsPagesApp"},cases:{true:{tagName:"span",children:[" — if the Cloudflare Pages GitHub App is not installed on the repository, ",{tagName:"a",attributes:{part:"install-link",href:"${state.pagesAppUrl}",target:"_blank",rel:"noreferrer"},textContent:"install it"}," and retry."]}}}]}}}]}]};T("publish",C);var D="https://github.com/apps/cloudflare-pages/installations/new";function I(e){if(!e.supported)return"unsupported";if(e.loading)return"loading";if(e.connected&&e.lapsed)return"lapsed";if(!e.connected){if(e.hosted)return"hosted";return e.tokenStored&&!e.replacing?"stored":"token"}return e.deploy?"status":"form"}function w(e){let{error:t}=e;return{accountId:e.form.accountId,accountOptions:e.accounts,body:I(e),branch:e.form.branch,busy:e.busy,connectLabel:e.busy?"Reconnecting…":"Reconnect Cloudflare",deploymentEnvironment:e.deployment?.environment??"",deploymentState:e.deployment?`${e.deployment.stage}: ${e.deployment.status}`:"",deploymentUrl:e.deployment?.url??"",deployProject:e.deploy?.projectName??"",failure:t,hasDeployment:e.deployment!==null,hasFailure:t!=="",hasProductionUrl:(e.deploy?.productionUrl??"")!=="",needsPagesApp:/github/i.test(t)&&/app|install|source|repo/i.test(t),owner:e.form.owner,pagesAppUrl:D,productionUrl:e.deploy?.productionUrl??"",projectName:e.form.projectName,repo:e.form.repo,submitLabel:e.busy?"Connecting…":"Create & Connect"}}function j(e){let t=document.createElement("div");t.style.pointerEvents="auto",e.layer.append(t);let n="",m=!1,N=()=>{if(m)return;m=!0,e.onClosed()},P=()=>m,d=g({...w(e.view),closed:N,connect:()=>{e.onConnect()},disconnect:()=>{e.onDisconnect()},openAccounts:()=>{e.onOpenAccounts()},refresh:()=>{e.onRefresh()},replace:()=>{n="",e.onReplaceToken()},setAccount:(o)=>{d.accountId=o,e.onField("accountId",o)},setBranch:(o)=>{d.branch=o,e.onField("branch",o)},setOwner:(o)=>{d.owner=o,e.onField("owner",o)},setProjectName:(o)=>{d.projectName=o,e.onField("projectName",o)},setRepo:(o)=>{d.repo=o,e.onField("repo",o)},setToken:(o)=>{n=o},submit:()=>{e.onSubmit()},verify:()=>{let o=n;n="",e.onSaveToken(o)}}),y=null,A=R("publish",d,t).then(async(o)=>{y=o;let u=o.root;if(P())return o.dispose(),u;if(await Jt(u),P())return u;return(u.querySelector('dialog[part="dialog"]')??u).setAttribute(Ue,ft("modal","publish")),Ot(u),u});return{close(){let o=y?.root;if(o instanceof HTMLElement)Nt(o);y?.dispose(),y=null,n="",t.remove(),N()},host:t,ready:A,update(o){Object.assign(d,w(o))}}}var f=null,i="loading",h=[],l=null,r="",c=!1,b=!1,a={accountId:"",branch:"main",owner:"",projectName:"",repo:""};function x(){return S?.projectConfig??null}function O(e){return e.toLowerCase().replaceAll(/[^a-z0-9]+/g,"-").replaceAll(/^-+|-+$/g,"").slice(0,58)||"site"}function H(){let e=p().projectRoot,t=/^([\w.-]+)\/([\w.-]+)(?:@.+)?$/.exec(e);return t?{owner:t[1],repo:t[2]}:{owner:"",repo:""}}function L(){let e=/^[\w.-]+\/[\w.-]+@[^:]+:(.+)$/.exec(p().projectRoot)?.[1]??"";return Rl(e)??""}function U(){let e=Ri();return e?{productionUrl:e.productionUrl??"",projectName:e.projectName}:null}function k(){let e=zl(),t=i==="loading"?null:i;return{accounts:h.map((n)=>({label:n.name,value:n.id})),busy:c,connected:t?.connected===!0,deploy:U(),deployment:l?{environment:l.environment,stage:l.stage,status:l.status,url:l.url}:null,error:r,form:{...a},hosted:e&&Q(p().cfConnect),lapsed:t?.connected===!0&&t.needsReconnect===!0,loading:i==="loading",replacing:b,supported:e,tokenStored:cb()!==""}}function s(){if(f){f.update(k());return}f=j({layer:tt("modal"),onClosed:B,onConnect:()=>{M()},onDisconnect:()=>{z()},onField:(e,t)=>{a={...a,[e]:t}},onOpenAccounts:_,onRefresh:()=>{v()},onReplaceToken:()=>{b=!0,r="",s()},onSaveToken:(e)=>{E(e)},onSubmit:()=>{V()},view:k()})}async function v(){i="loading",s();try{if(i=await p().cfConnection?.()??null,i?.connected&&!i.needsReconnect){h=await lN(),a={...a,accountId:i.accountId??h[0]?.id??""};let e=Ri();if(e)l=await Sb(e),Nd(l)}}catch(e){i=null,r=e instanceof Error?e.message:String(e)}s()}async function E(e){let t=e.trim();if(!t){r="Paste a token, or use Preferences › Accounts to forget the stored one.",s();return}DE(t),b=!1,r="",await v()}function _(){ae()?.run("app.preferences",{section:"accounts"})}async function M(){c=!0,r="",s();try{let e=await p().cfConnect?.()??null;if(e?.status==="timeout")r="The Cloudflare window didn't finish. Sign in there, then reconnect — nothing was changed.";else if(e?.status==="connected"&&!e.connection.accountId){let{openCfAccountPicker:t}=await (le("2e06qxey"),import("./cf-account-picker-2e06qxey.js"));await t()}}catch(e){r=e instanceof Error?e.message:String(e)}c=!1,ds(),await v()}async function V(){let e=x();if(!e)return;if(!a.projectName||!a.owner||!a.repo||!a.accountId){r="Account, project name, and the GitHub owner/repo are all required.",s();return}c=!0,r="",s();try{let t=L(),n={accountId:a.accountId,owner:a.owner,productionBranch:a.branch||"main",projectName:a.projectName,repo:a.repo};if(t)n.rootDir=t;let m=await cN(e,n);l=await Sb(m).catch(()=>null)}catch(t){r=t instanceof Error?t.message:String(t)}c=!1,s()}async function z(){let e=x();if(!e)return;c=!0,s();try{await qT(e,null),l=null}catch(t){r=t instanceof Error?t.message:String(t)}c=!1,s()}function B(){let e=f;f=null,e?.close()}function wk(e){i={accountId:e.accountId??"demo-account",connected:!0},h=[],l=e.deployment,Nd(e.deployment),r="",c=!1,b=!1,s()}function K2(){let e=x(),{owner:t,repo:n}=H();i="loading",h=[],l=null,r="",c=!1,b=!1,a={accountId:"",branch:"main",owner:t,projectName:Ri()?.projectName??O(e?.name??""),repo:n},s(),v()}
2
- export{Rl,wk,K2};
1
+ import{Ot,Nt,ae}from"./studio-cpkamjdn.js";import{p}from"./studio-03mqh8ax.js";import{ds}from"./studio-h7weqf2q.js";import{g}from"./studio-4kzbrr5t.js";import{Ue,ft,T,R,Yt,tt}from"./studio-jttyqrmh.js";import{zl,cN,Cb,qT,dN,Ri,Nd}from"./studio-2hsqbq7b.js";import{db,DE}from"./studio-yx8hzqja.js";import{S}from"./studio-45gyxpcq.js";import{Q}from"./studio-zkq3r91p.js";import{le}from"./studio-7xag4na8.js";function Rl(e){let t=e.trim().replaceAll("\\","/").split("/").filter((n)=>n!=="");return t.some((n)=>n==="."||n==="..")?null:t.join("/")}var C={$schema:"https://jxsuite.com/schema/v1",$id:"StudioPublish",$description:"Publish: the one-click Cloudflare Pages flow, as a `jx-dialog` over the kit. Eight bodies, one at a time, because the reader is at exactly one point of a chain — a host that cannot reach Cloudflare at all, a question still in flight, a connection that lapsed, an invitation to connect, a stored token Cloudflare refused, a field to paste a replacement into, the create-and-connect form, and the connected status. `publish/publish-panel.ts` keeps every one of those decisions and the calls that settle them; this document knows only which of the eight it was told to draw. **The token is never painted.** The field below binds no `value` — it is written by the reader and read once, on its way to storage — so a stored secret cannot reach the attribute, the serialised HTML or the accessibility tree, which is `studio.md` §15 rule 1 written as a missing binding rather than as a rule somebody remembers.",tagName:"jx-dialog",$props:{headline:"Publish",confirmLabel:"",cancelLabel:"Close",size:"md"},attributes:{part:"publish"},oncancel:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},onclose:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},style:{$description:"What the five `.publish-*` names carried, keyed on `part`, and most of them do not survive the move. `.publish-modal` and its `.new-project-modal` base were a fixed card, a scroll body, a border, a shadow and a `z-index: 1000` — a modal `<dialog>` is every one of those, and the top layer is what the z-index was climbing towards. `.publish-field` was a label stacked over a control, which is `jx-field`'s whole shape. What is left is the column gap between bodies, the two button rows, the hint and the refusal. Nothing here uses `--spectrum-*`: those custom properties resolve only inside `<sp-theme>`, and a document mounted in a layer host is outside it, so each would silently have taken its hard-coded fallback.",'& [part="body"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-3)"},'& [part="note"], & [part="status-line"], & [part="deployment"]':{margin:"0",lineHeight:"1.5"},'& [part="rows"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-3)"},'& [part="actions"]':{$description:'Wraps rather than overflows (studio-ui-guidelines.md §4.6): two buttons whose labels are whole phrases — "Verify & Connect", "Preferences › Accounts" — are wider than a narrow dialog at the sizes a reader may have set.',display:"flex",flexWrap:"wrap",gap:"var(--jx-space-2)"},'& [part="submit"]':{alignSelf:"flex-start"},'& [part="hint"]':{$description:"Publishing rides every commit, so the connected body's only job is to say what is already happening. Dim, because it is a standing fact rather than something to act on.",margin:"0",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"},'& [part="failure"]':{$description:'`failure` and not `error`: `jx-textfield` and `jx-select` each draw a `[part="error"]` of their own inside this same tree, and the kit is light DOM — a scoped rule on that name would restyle the token field\'s refusal line too.',margin:"0",color:"var(--danger)",lineHeight:"1.5"},'& [part="link"], & [part="install-link"]':{color:"var(--accent)",textDecoration:"underline"},"& code":{fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-sm)"}},children:[{tagName:"div",attributes:{part:"body"},children:[{tagName:"div",attributes:{part:"body-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/body"},cases:{unsupported:{tagName:"p",attributes:{part:"note"},children:["This platform cannot reach the Cloudflare API. Publish by committing and pushing — your host builds ",{tagName:"code",textContent:"bunx jx build"}," and serves ",{tagName:"code",textContent:"dist/"},"."]},loading:{tagName:"p",attributes:{part:"note"},textContent:"Checking Cloudflare connection…"},lapsed:{tagName:"div",attributes:{part:"lapsed",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"note"},textContent:"Your Cloudflare connection has expired, so publishing cannot reach your account. Reconnect to restore it — this site's Pages project and its settings are untouched."},{tagName:"jx-button",$props:{variant:"accent",disabled:{$ref:"#/state/busy"}},attributes:{part:"reconnect"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/connect"},value:[]}]},children:[{tagName:"span",textContent:"${state.connectLabel}"}]}]},hosted:{tagName:"div",attributes:{part:"hosted",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"note"},textContent:"Connect your Cloudflare account to publish this site."},{tagName:"jx-button",$props:{disabled:{$ref:"#/state/busy"}},attributes:{part:"connect"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/connect"},value:[]}]},children:[{tagName:"span",textContent:"Connect Cloudflare"}]}]},stored:{tagName:"div",attributes:{part:"stored",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"note"},textContent:"A Cloudflare API token is stored on this machine, and Cloudflare did not accept it. It may have been revoked, or it may be missing the Account Settings Read and Pages Read/Write permissions."},{tagName:"div",attributes:{part:"actions"},children:[{tagName:"jx-button",$props:{disabled:{$ref:"#/state/busy"}},attributes:{part:"replace"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/replace"},value:[]}]},children:[{tagName:"span",textContent:"Replace token"}]},{tagName:"jx-button",$props:{quiet:!0},attributes:{part:"accounts"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openAccounts"},value:[]}]},children:[{tagName:"span",textContent:"Preferences › Accounts"}]}]}]},token:{tagName:"div",attributes:{part:"token-form",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"note"},textContent:"Paste a Cloudflare API token (permissions: Account Settings Read, Pages Read/Write). It is stored on this machine and only sent to the same-origin proxy — Studio never renders it back."},{tagName:"jx-field",$props:{span:!0,label:"API token"},attributes:{part:"token-row","data-field":"token"},children:[{tagName:"jx-textfield",$description:"No `value` binding, and its absence is the contract: a secret may pass through a field the reader typed it into and may never be painted into one they did not. The draft lives in the adapter's closure until Verify reads it, so nothing here — not the attribute, not the accessibility tree, not a DOM dump — has ever held it.",$props:{type:"password",placeholder:"cf_..."},attributes:{part:"token"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setToken"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"div",attributes:{part:"actions"},children:[{tagName:"jx-button",$props:{variant:"accent",disabled:{$ref:"#/state/busy"}},attributes:{part:"verify"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/verify"},value:[]}]},children:[{tagName:"span",textContent:"Verify & Connect"}]},{tagName:"jx-button",$props:{quiet:!0},attributes:{part:"accounts"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openAccounts"},value:[]}]},children:[{tagName:"span",textContent:"Preferences › Accounts"}]}]}]},form:{tagName:"div",attributes:{part:"connect-form",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"note"},children:["Create a Cloudflare Pages project connected to this repository. Every commit then builds and publishes automatically (",{tagName:"code",textContent:"bunx jx build"},")."]},{tagName:"div",attributes:{part:"rows"},children:[{tagName:"jx-field",$props:{span:!0,label:"Account"},attributes:{part:"row","data-field":"account"},children:[{tagName:"jx-select",$props:{options:{$ref:"#/state/accountOptions"},value:{$ref:"#/state/accountId"}},attributes:{part:"account"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setAccount"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-field",$props:{span:!0,label:"Pages project name"},attributes:{part:"row","data-field":"projectName"},children:[{tagName:"jx-textfield",$props:{value:{$ref:"#/state/projectName"}},attributes:{part:"project-name"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setProjectName"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-field",$props:{span:!0,label:"GitHub owner"},attributes:{part:"row","data-field":"owner"},children:[{tagName:"jx-textfield",$props:{value:{$ref:"#/state/owner"}},attributes:{part:"owner"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setOwner"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-field",$props:{span:!0,label:"GitHub repository"},attributes:{part:"row","data-field":"repo"},children:[{tagName:"jx-textfield",$props:{value:{$ref:"#/state/repo"}},attributes:{part:"repo"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setRepo"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-field",$props:{span:!0,label:"Production branch"},attributes:{part:"row","data-field":"branch"},children:[{tagName:"jx-textfield",$props:{value:{$ref:"#/state/branch"}},attributes:{part:"branch"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setBranch"},value:[{$ref:"event#/target/value"}]}]}}]}]},{tagName:"jx-button",$props:{variant:"accent",disabled:{$ref:"#/state/busy"}},attributes:{part:"submit"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/submit"},value:[]}]},children:[{tagName:"span",textContent:"${state.submitLabel}"}]}]},status:{tagName:"div",attributes:{part:"status",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"status-line"},children:["Connected to Pages project ",{tagName:"strong",attributes:{part:"project-name"},textContent:"${state.deployProject}"},{tagName:"span",attributes:{part:"site-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasProductionUrl"},cases:{true:{tagName:"span",children:[" — ",{tagName:"a",attributes:{part:"link",href:"${state.productionUrl}",target:"_blank",rel:"noreferrer"},textContent:"${state.productionUrl}"}]}}}]},{tagName:"div",attributes:{part:"deployment-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasDeployment"},cases:{true:{tagName:"p",attributes:{part:"deployment"},children:["Latest deployment: ",{tagName:"strong",attributes:{part:"deployment-state"},textContent:"${state.deploymentState}"}," (${state.deploymentEnvironment}) — ",{tagName:"a",attributes:{part:"link",href:"${state.deploymentUrl}",target:"_blank",rel:"noreferrer"},textContent:"preview"}]},false:{tagName:"p",attributes:{part:"deployment"},textContent:"No deployments yet — the first commit after connecting triggers one."}}},{tagName:"p",attributes:{part:"hint"},textContent:"Publishing happens automatically on every commit."},{tagName:"div",attributes:{part:"actions"},children:[{tagName:"jx-button",$props:{disabled:{$ref:"#/state/busy"}},attributes:{part:"refresh"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/refresh"},value:[]}]},children:[{tagName:"span",textContent:"Refresh"}]},{tagName:"jx-button",$props:{variant:"negative",disabled:{$ref:"#/state/busy"}},attributes:{part:"disconnect"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/disconnect"},value:[]}]},children:[{tagName:"span",textContent:"Disconnect"}]}]}]}}},{tagName:"div",attributes:{part:"failure-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasFailure"},cases:{true:{tagName:"p",attributes:{part:"failure"},children:["${state.failure}",{tagName:"span",attributes:{part:"pages-app-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/needsPagesApp"},cases:{true:{tagName:"span",children:[" — if the Cloudflare Pages GitHub App is not installed on the repository, ",{tagName:"a",attributes:{part:"install-link",href:"${state.pagesAppUrl}",target:"_blank",rel:"noreferrer"},textContent:"install it"}," and retry."]}}}]}}}]}]};T("publish",C);var D="https://github.com/apps/cloudflare-pages/installations/new";function I(e){if(!e.supported)return"unsupported";if(e.loading)return"loading";if(e.connected&&e.lapsed)return"lapsed";if(!e.connected){if(e.hosted)return"hosted";return e.tokenStored&&!e.replacing?"stored":"token"}return e.deploy?"status":"form"}function w(e){let{error:t}=e;return{accountId:e.form.accountId,accountOptions:e.accounts,body:I(e),branch:e.form.branch,busy:e.busy,connectLabel:e.busy?"Reconnecting…":"Reconnect Cloudflare",deploymentEnvironment:e.deployment?.environment??"",deploymentState:e.deployment?`${e.deployment.stage}: ${e.deployment.status}`:"",deploymentUrl:e.deployment?.url??"",deployProject:e.deploy?.projectName??"",failure:t,hasDeployment:e.deployment!==null,hasFailure:t!=="",hasProductionUrl:(e.deploy?.productionUrl??"")!=="",needsPagesApp:/github/i.test(t)&&/app|install|source|repo/i.test(t),owner:e.form.owner,pagesAppUrl:D,productionUrl:e.deploy?.productionUrl??"",projectName:e.form.projectName,repo:e.form.repo,submitLabel:e.busy?"Connecting…":"Create & Connect"}}function j(e){let t=document.createElement("div");t.style.pointerEvents="auto",e.layer.append(t);let n="",m=!1,N=()=>{if(m)return;m=!0,e.onClosed()},P=()=>m,d=g({...w(e.view),closed:N,connect:()=>{e.onConnect()},disconnect:()=>{e.onDisconnect()},openAccounts:()=>{e.onOpenAccounts()},refresh:()=>{e.onRefresh()},replace:()=>{n="",e.onReplaceToken()},setAccount:(o)=>{d.accountId=o,e.onField("accountId",o)},setBranch:(o)=>{d.branch=o,e.onField("branch",o)},setOwner:(o)=>{d.owner=o,e.onField("owner",o)},setProjectName:(o)=>{d.projectName=o,e.onField("projectName",o)},setRepo:(o)=>{d.repo=o,e.onField("repo",o)},setToken:(o)=>{n=o},submit:()=>{e.onSubmit()},verify:()=>{let o=n;n="",e.onSaveToken(o)}}),y=null,A=R("publish",d,t).then(async(o)=>{y=o;let u=o.root;if(P())return o.dispose(),u;if(await Yt(u),P())return u;return(u.querySelector('dialog[part="dialog"]')??u).setAttribute(Ue,ft("modal","publish")),Ot(u),u});return{close(){let o=y?.root;if(o instanceof HTMLElement)Nt(o);y?.dispose(),y=null,n="",t.remove(),N()},host:t,ready:A,update(o){Object.assign(d,w(o))}}}var f=null,i="loading",h=[],l=null,r="",c=!1,b=!1,a={accountId:"",branch:"main",owner:"",projectName:"",repo:""};function x(){return S?.projectConfig??null}function O(e){return e.toLowerCase().replaceAll(/[^a-z0-9]+/g,"-").replaceAll(/^-+|-+$/g,"").slice(0,58)||"site"}function H(){let e=p().projectRoot,t=/^([\w.-]+)\/([\w.-]+)(?:@.+)?$/.exec(e);return t?{owner:t[1],repo:t[2]}:{owner:"",repo:""}}function L(){let e=/^[\w.-]+\/[\w.-]+@[^:]+:(.+)$/.exec(p().projectRoot)?.[1]??"";return Rl(e)??""}function U(){let e=Ri();return e?{productionUrl:e.productionUrl??"",projectName:e.projectName}:null}function k(){let e=zl(),t=i==="loading"?null:i;return{accounts:h.map((n)=>({label:n.name,value:n.id})),busy:c,connected:t?.connected===!0,deploy:U(),deployment:l?{environment:l.environment,stage:l.stage,status:l.status,url:l.url}:null,error:r,form:{...a},hosted:e&&Q(p().cfConnect),lapsed:t?.connected===!0&&t.needsReconnect===!0,loading:i==="loading",replacing:b,supported:e,tokenStored:db()!==""}}function s(){if(f){f.update(k());return}f=j({layer:tt("modal"),onClosed:B,onConnect:()=>{M()},onDisconnect:()=>{z()},onField:(e,t)=>{a={...a,[e]:t}},onOpenAccounts:_,onRefresh:()=>{v()},onReplaceToken:()=>{b=!0,r="",s()},onSaveToken:(e)=>{E(e)},onSubmit:()=>{V()},view:k()})}async function v(){i="loading",s();try{if(i=await p().cfConnection?.()??null,i?.connected&&!i.needsReconnect){h=await cN(),a={...a,accountId:i.accountId??h[0]?.id??""};let e=Ri();if(e)l=await Cb(e),Nd(l)}}catch(e){i=null,r=e instanceof Error?e.message:String(e)}s()}async function E(e){let t=e.trim();if(!t){r="Paste a token, or use Preferences › Accounts to forget the stored one.",s();return}DE(t),b=!1,r="",await v()}function _(){ae()?.run("app.preferences",{section:"accounts"})}async function M(){c=!0,r="",s();try{let e=await p().cfConnect?.()??null;if(e?.status==="timeout")r="The Cloudflare window didn't finish. Sign in there, then reconnect — nothing was changed.";else if(e?.status==="connected"&&!e.connection.accountId){let{openCfAccountPicker:t}=await (le("xyqw0jex"),import("./cf-account-picker-xyqw0jex.js"));await t()}}catch(e){r=e instanceof Error?e.message:String(e)}c=!1,ds(),await v()}async function V(){let e=x();if(!e)return;if(!a.projectName||!a.owner||!a.repo||!a.accountId){r="Account, project name, and the GitHub owner/repo are all required.",s();return}c=!0,r="",s();try{let t=L(),n={accountId:a.accountId,owner:a.owner,productionBranch:a.branch||"main",projectName:a.projectName,repo:a.repo};if(t)n.rootDir=t;let m=await dN(e,n);l=await Cb(m).catch(()=>null)}catch(t){r=t instanceof Error?t.message:String(t)}c=!1,s()}async function z(){let e=x();if(!e)return;c=!0,s();try{await qT(e,null),l=null}catch(t){r=t instanceof Error?t.message:String(t)}c=!1,s()}function B(){let e=f;f=null,e?.close()}function wk(e){i={accountId:e.accountId??"demo-account",connected:!0},h=[],l=e.deployment,Nd(e.deployment),r="",c=!1,b=!1,s()}function J2(){let e=x(),{owner:t,repo:n}=H();i="loading",h=[],l=null,r="",c=!1,b=!1,a={accountId:"",branch:"main",owner:t,projectName:Ri()?.projectName??O(e?.name??""),repo:n},s(),v()}
2
+ export{Rl,wk,J2};
3
3
 
4
- //# debugId=9F3334C857B4DE0E64756E2164756E21
5
- //# sourceMappingURL=studio-6k9djnxw.js.map
4
+ //# debugId=FA8C8E910C3A29B364756E2164756E21
5
+ //# sourceMappingURL=studio-xh683qzy.js.map