@jxsuite/studio 10.1.0 → 10.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{2020-mkb0qa6p.js → 2020-906vx2dq.js} +3 -3
- package/dist/chunks/adapter-hnvad61x.js +4 -0
- package/dist/chunks/add-new-flow-3tkn72ey.js +4 -0
- package/dist/chunks/cf-account-picker-xb8vvt2h.js +4 -0
- package/dist/chunks/cf-settings-mkbcz4z2.js +4 -0
- package/dist/chunks/components-w5zqwva1.js +4 -0
- package/dist/chunks/content-source-1vzxq1ba.js +4 -0
- package/dist/chunks/convert-to-repeater-gwzh9gar.js +4 -0
- package/dist/chunks/editor-wvf5e6j9.js +4 -0
- package/dist/chunks/entry-commands-mx2whrjx.js +4 -0
- package/dist/chunks/extension-sections-338ee35t.js +4 -0
- package/dist/chunks/file-ops-9bxvk59j.js +4 -0
- package/dist/chunks/files-t07yqqej.js +4 -0
- package/dist/chunks/format-host-5ja5gxyk.js +4 -0
- package/dist/chunks/fs-events-3424ezp3.js +4 -0
- package/dist/chunks/grid-open-1mpq9mzb.js +4 -0
- package/dist/chunks/{grid-view-r22jsqht.js → grid-view-w9nfy203.js} +15 -15
- package/dist/chunks/icons-gb967qc8.js +4 -0
- package/dist/chunks/iframe-host-wsg0bn73.js +4 -0
- package/dist/chunks/image-bake-4afr4y6a.js +4 -0
- package/dist/chunks/image-editor-x7t8jbjn.js +4 -0
- package/dist/chunks/index-f9qr7kzh.js +4 -0
- package/dist/chunks/{index-pxwwf00y.js → index-yjrfeks8.js} +3 -3
- package/dist/chunks/{javascript-pzqryby6.js → javascript-hy2mws8v.js} +3 -3
- package/dist/chunks/{jsonMode-tcnyxyap.js → jsonMode-vj30te2h.js} +6 -6
- package/dist/chunks/jx-validate-ttr5ewf0.js +4 -0
- package/dist/chunks/layers-m49nmwvx.js +4 -0
- package/dist/chunks/layers-panel-hvy2e549.js +4 -0
- package/dist/chunks/lit-html-k2mb9k0r.js +4 -0
- package/dist/chunks/media-library-ae67q4at.js +4 -0
- package/dist/chunks/media-open-yp9jm834.js +4 -0
- package/dist/chunks/media-picker-s41ngdfr.js +4 -0
- package/dist/chunks/{monaco-binding-bqpge64f.js → monaco-binding-a51py33c.js} +3 -3
- package/dist/chunks/monaco-buffer-pa0g6ax7.js +4 -0
- package/dist/chunks/{monaco-setup-1mkab762.js → monaco-setup-g9kterhx.js} +3 -3
- package/dist/chunks/notify-bwehrp7q.js +4 -0
- package/dist/chunks/parse-hee7ne9b.js +4 -0
- package/dist/chunks/platform-kv0k65cy.js +4 -0
- package/dist/chunks/publish-panel-gzfxcm0t.js +4 -0
- package/dist/chunks/publish-quick-w3nxd7q4.js +4 -0
- package/dist/chunks/publish-workspace-dppd82tc.js +4 -0
- package/dist/chunks/quick-search-tdxaam55.js +4 -0
- package/dist/chunks/references-vqyr5s9x.js +4 -0
- package/dist/chunks/right-panel-0yrw4cgz.js +4 -0
- package/dist/chunks/source-control-6fk72me2.js +4 -0
- package/dist/chunks/{studio-0g2sm01j.js → studio-0939t1q1.js} +4 -4
- package/dist/chunks/studio-0gvvqj3h.js +5 -0
- package/dist/chunks/studio-0khd8xtx.js +4 -0
- package/dist/chunks/{studio-rf8d6p9f.js → studio-0w3541dg.js} +6 -6
- package/dist/chunks/{studio-9b7177jq.js → studio-0x6f3nk9.js} +4 -4
- package/dist/chunks/studio-1410q5dw.js +5 -0
- package/dist/chunks/{studio-8qejv8yf.js → studio-15hwqgd8.js} +4 -4
- package/dist/chunks/studio-1ks5d9y4.js +5 -0
- package/dist/chunks/{studio-881z1xrx.js → studio-2ggfzrrd.js} +4 -4
- package/dist/chunks/{studio-jw0q5j6k.js → studio-321ym1tt.js} +4 -4
- package/dist/chunks/studio-3c10v2q1.js +5 -0
- package/dist/chunks/{studio-9rcbvksg.js → studio-3na1r48j.js} +8 -8
- package/dist/chunks/{studio-ggm7zf70.js → studio-3q7mhbgx.js} +5 -5
- package/dist/chunks/studio-3qr08sxq.js +4 -0
- package/dist/chunks/studio-3xk9zdgb.js +5 -0
- package/dist/chunks/studio-423tfdte.js +5 -0
- package/dist/chunks/{studio-brdp85q7.js → studio-45mj4jqe.js} +4 -4
- package/dist/chunks/studio-4f7thq0p.js +5 -0
- package/dist/chunks/{studio-w67vfgy5.js → studio-4fnb5648.js} +4 -4
- package/dist/chunks/studio-4zd6an2b.js +5 -0
- package/dist/chunks/studio-53wy9ek3.js +5 -0
- package/dist/chunks/studio-5n193zqd.js +5 -0
- package/dist/chunks/{studio-x2metr13.js → studio-5tet77de.js} +3 -3
- package/dist/chunks/studio-7rrdbvex.js +5 -0
- package/dist/chunks/studio-8kx6m0rg.js +5 -0
- package/dist/chunks/{studio-va0e63sk.js → studio-90zkgne5.js} +7 -7
- package/dist/chunks/studio-9c6cbq2c.js +4 -0
- package/dist/chunks/studio-9dq7rwc7.js +5 -0
- package/dist/chunks/studio-9qx1ywbv.js +9 -0
- package/dist/chunks/studio-a65kbs2e.js +9 -0
- package/dist/chunks/studio-aam8zt8z.js +5 -0
- package/dist/chunks/{studio-8jb31dcf.js → studio-abh9kfdh.js} +4 -4
- package/dist/chunks/studio-b4e0ftkt.js +5 -0
- package/dist/chunks/studio-b68k0z00.js +5 -0
- package/dist/chunks/{studio-dy2xtt7a.js → studio-bct64zmj.js} +4 -4
- package/dist/chunks/studio-bz0b5brj.js +6 -0
- package/dist/chunks/studio-cfnn70h1.js +5 -0
- package/dist/chunks/studio-daksw8kh.js +5 -0
- package/dist/chunks/{studio-mwnmzx7g.js → studio-e7vjyp04.js} +7 -7
- package/dist/chunks/studio-ea6r1zyr.js +5 -0
- package/dist/chunks/studio-egnjpyde.js +9 -0
- package/dist/chunks/studio-ejrypvmq.js +5 -0
- package/dist/chunks/studio-eqcddvc2.js +928 -0
- package/dist/chunks/studio-f8tyeyzt.js +5 -0
- package/dist/chunks/studio-fj6c905s.js +5 -0
- package/dist/chunks/{studio-hsr3k06v.js → studio-fkrr7kgg.js} +5 -5
- package/dist/chunks/studio-fspe7m9t.js +5 -0
- package/dist/chunks/{studio-4zqfw5ha.js → studio-g0hxtcga.js} +4 -4
- package/dist/chunks/studio-g9brbewz.js +5 -0
- package/dist/chunks/studio-ggx3j7nd.js +5 -0
- package/dist/chunks/{studio-jh6t5qz4.js → studio-hfxttkyr.js} +4 -4
- package/dist/chunks/studio-hh394phe.js +5 -0
- package/dist/chunks/{studio-07k0geap.js → studio-j0zf5x2x.js} +4 -4
- package/dist/chunks/studio-jeb7hth3.js +5 -0
- package/dist/chunks/studio-k0xzrse2.js +64 -0
- package/dist/chunks/studio-k1xqrgm5.js +5 -0
- package/dist/chunks/studio-k2evngrj.js +7 -0
- package/dist/chunks/studio-k3we3kqb.js +5 -0
- package/dist/chunks/{studio-nf0pqpbj.js → studio-n9qba0gx.js} +4 -4
- package/dist/chunks/studio-nf8esxxc.js +5 -0
- package/dist/chunks/studio-nn4f9m9c.js +5 -0
- package/dist/chunks/studio-nskxe9q1.js +6 -0
- package/dist/chunks/{studio-4nkm4404.js → studio-nvcn2ykc.js} +4 -4
- package/dist/chunks/studio-nwynxqtb.js +5 -0
- package/dist/chunks/{studio-f2j9et3h.js → studio-nzemfbkk.js} +8 -8
- package/dist/chunks/studio-p2a03pgm.js +5 -0
- package/dist/chunks/{studio-skynbac3.js → studio-pm17wdc4.js} +4 -4
- package/dist/chunks/{studio-9cp96v90.js → studio-q80fg1d6.js} +7 -7
- package/dist/chunks/studio-r050sez0.js +6 -0
- package/dist/chunks/{studio-sd07xva5.js → studio-s7t4vp1d.js} +5 -5
- package/dist/chunks/studio-s9fng7m8.js +7 -0
- package/dist/chunks/studio-sce30r7b.js +4 -0
- package/dist/chunks/{studio-zxm98z2m.js → studio-stahswgb.js} +6 -6
- package/dist/chunks/studio-swedpd82.js +5 -0
- package/dist/chunks/studio-thz5t120.js +5 -0
- package/dist/chunks/studio-tpxcryf2.js +5 -0
- package/dist/chunks/{studio-tpy3rdxn.js → studio-v5wktj6f.js} +4 -4
- package/dist/chunks/{studio-7vb997ff.js → studio-vpevkfxw.js} +4 -4
- package/dist/chunks/studio-waekn290.js +5 -0
- package/dist/chunks/studio-wfct4h6n.js +5 -0
- package/dist/chunks/studio-wgc54sxf.js +5 -0
- package/dist/chunks/studio-wqfaqw4m.js +5 -0
- package/dist/chunks/studio-wse1rs8t.js +7 -0
- package/dist/chunks/studio-x0gsfr1d.js +16 -0
- package/dist/chunks/studio-xpx91fby.js +6 -0
- package/dist/chunks/studio-y1b86ast.js +5 -0
- package/dist/chunks/studio-yrcrncev.js +5 -0
- package/dist/chunks/{studio-zacvfm31.js → studio-yzpskb0j.js} +4 -4
- package/dist/chunks/studio-zfdbmhp3.js +5 -0
- package/dist/chunks/{tsMode-6vwhy6ty.js → tsMode-jg1dtphj.js} +7 -7
- package/dist/chunks/workspace-9btkc8tk.js +4 -0
- package/dist/chunks/workspace-home-qcc4z5ag.js +4 -0
- package/dist/chunks/{ws-client-zcxkfgmf.js → ws-client-arz2qsy9.js} +3 -3
- package/dist/iframe-entry.js +13 -13
- package/dist/manifest.json +83 -77
- package/dist/studio.js +74 -75
- package/package.json +5 -5
- package/src/browse/library-model.ts +56 -23
- package/src/browse/library-pane.ts +44 -29
- package/src/browse/library-preview.ts +6 -2
- package/src/canvas/asset-refs.ts +13 -4
- package/src/canvas/asset-resolve.ts +54 -11
- package/src/canvas/canvas-render.ts +25 -0
- package/src/canvas/iframe-entry.ts +5 -1
- package/src/canvas/iframe-host.ts +16 -6
- package/src/canvas/iframe-protocol.ts +9 -1
- package/src/commands/context.ts +6 -0
- package/src/commands/live-context.ts +5 -2
- package/src/editor/shortcuts.ts +6 -0
- package/src/files/asset-versions.ts +108 -2
- package/src/files/file-ops.ts +11 -1
- package/src/files/files.ts +111 -48
- package/src/files/media-paths.ts +12 -4
- package/src/files/media-upload.ts +195 -21
- package/src/files/new-file-name.ts +39 -1
- package/src/media/image-bake.ts +164 -0
- package/src/media/image-editor.ts +846 -0
- package/src/media/image-format.ts +262 -0
- package/src/media/image-recipe.ts +651 -0
- package/src/media/media-commands.ts +65 -1
- package/src/media/media-library-model.ts +1 -1
- package/src/media/media-library.ts +175 -15
- package/src/media/media-open.ts +156 -3
- package/src/media/media-pane.ts +8 -4
- package/src/panels/data-grid.ts +0 -4
- package/src/panels/pane-context.ts +6 -1
- package/src/panels/settings-menu.ts +3 -3
- package/src/panels/settings-pane.ts +42 -56
- package/src/panels/tab-strip.ts +12 -3
- package/src/services/ai-import-tools.ts +6 -3
- package/src/services/ai-models.ts +65 -11
- package/src/services/ai-settings.ts +45 -5
- package/src/services/document-assistant.ts +5 -2
- package/src/services/settings/definitions.ts +19 -0
- package/src/settings/contributed-section.ts +16 -7
- package/src/settings/css-vars-editor.ts +4 -4
- package/src/settings/general-settings.ts +1 -4
- package/src/settings/preferences-accounts.ts +2 -2
- package/src/settings/preferences-dialog.ts +4 -2
- package/src/settings/project-sections.ts +1 -1
- package/src/settings/section-registry.ts +5 -4
- package/src/settings/settings-document.ts +33 -24
- package/src/settings/settings-workspace.ts +205 -0
- package/src/shell.ts +31 -6
- package/src/studio.ts +13 -2
- package/src/surfaces/ai-credentials-form.json +59 -5
- package/src/surfaces/ai-credentials-form.ts +15 -2
- package/src/surfaces/commandbar.ts +7 -3
- package/src/surfaces/image-editor.json +1390 -0
- package/src/surfaces/image-editor.ts +272 -0
- package/src/surfaces/media-library.json +129 -1
- package/src/surfaces/media-library.ts +17 -2
- package/src/surfaces/settings-contributed.json +4 -4
- package/src/surfaces/settings-contributed.ts +2 -2
- package/src/surfaces/settings-pane.json +262 -180
- package/src/surfaces/settings-pane.ts +63 -14
- package/src/types.ts +2 -1
- package/src/ui/ai-credentials-form.ts +128 -11
- package/src/ui/regions.ts +5 -5
- package/src/workspace/tab-workspace.ts +5 -3
- package/src/workspace/workspace-home.ts +18 -4
- package/src/workspace/workspace-ids.ts +40 -7
- package/src/workspace/workspace-switch.ts +3 -1
- package/src/workspace/workspace.ts +22 -1
- package/dist/chunks/adapter-xcpsmecx.js +0 -4
- package/dist/chunks/add-new-flow-ptmhmzr9.js +0 -4
- package/dist/chunks/cf-account-picker-z1sgwpwd.js +0 -4
- package/dist/chunks/cf-settings-xqvhxxe9.js +0 -4
- package/dist/chunks/components-whsc81a7.js +0 -4
- package/dist/chunks/content-source-jwtxg78w.js +0 -4
- package/dist/chunks/convert-to-repeater-f92ey3kp.js +0 -4
- package/dist/chunks/editor-zdqdpq1x.js +0 -4
- package/dist/chunks/entry-commands-w8p2fbpt.js +0 -4
- package/dist/chunks/extension-sections-y2p1te2r.js +0 -4
- package/dist/chunks/file-ops-13ab4swj.js +0 -4
- package/dist/chunks/files-zbc8p6v1.js +0 -4
- package/dist/chunks/format-host-zjsbktbx.js +0 -4
- package/dist/chunks/fs-events-t6x0hch6.js +0 -4
- package/dist/chunks/grid-open-fyzdwpkh.js +0 -4
- package/dist/chunks/icons-853n6qt3.js +0 -4
- package/dist/chunks/iframe-host-kbyqc7pt.js +0 -4
- package/dist/chunks/index-6nvj89vb.js +0 -4
- package/dist/chunks/jx-validate-5sp8a4rm.js +0 -4
- package/dist/chunks/layers-panel-qrxj9vr2.js +0 -4
- package/dist/chunks/layers-tpzayggx.js +0 -4
- package/dist/chunks/lit-html-x6nrxsx3.js +0 -4
- package/dist/chunks/media-library-ywppnjrz.js +0 -4
- package/dist/chunks/media-picker-etxgc8qq.js +0 -4
- package/dist/chunks/monaco-buffer-qrnqhk0b.js +0 -4
- package/dist/chunks/notify-kcv38wwe.js +0 -4
- package/dist/chunks/parse-df2kkmhc.js +0 -4
- package/dist/chunks/platform-dtsysmyd.js +0 -4
- package/dist/chunks/publish-panel-evb1rcxt.js +0 -4
- package/dist/chunks/publish-quick-m9vkhahq.js +0 -4
- package/dist/chunks/publish-workspace-ktk9h536.js +0 -4
- package/dist/chunks/quick-search-2f47fxcw.js +0 -4
- package/dist/chunks/references-5w6ajjv7.js +0 -4
- package/dist/chunks/right-panel-kz0a6byf.js +0 -4
- package/dist/chunks/source-control-1phx90zk.js +0 -4
- package/dist/chunks/studio-0hr000ba.js +0 -5
- package/dist/chunks/studio-1wyp7dt5.js +0 -5
- package/dist/chunks/studio-20ap8dds.js +0 -5
- package/dist/chunks/studio-291gqh98.js +0 -5
- package/dist/chunks/studio-37twdaf7.js +0 -64
- package/dist/chunks/studio-4smcnv33.js +0 -5
- package/dist/chunks/studio-56egy6vf.js +0 -5
- package/dist/chunks/studio-5dmgmyw4.js +0 -5
- package/dist/chunks/studio-5e7p1vgd.js +0 -5
- package/dist/chunks/studio-5m0w815d.js +0 -5
- package/dist/chunks/studio-695k95bw.js +0 -5
- package/dist/chunks/studio-6vwvshw8.js +0 -6
- package/dist/chunks/studio-732mw0g8.js +0 -5
- package/dist/chunks/studio-76t560kn.js +0 -6
- package/dist/chunks/studio-7823f0g8.js +0 -5
- package/dist/chunks/studio-8486jn4r.js +0 -5
- package/dist/chunks/studio-848rk4p1.js +0 -5
- package/dist/chunks/studio-8x8616xd.js +0 -5
- package/dist/chunks/studio-a3s6frde.js +0 -4
- package/dist/chunks/studio-ahf3cspq.js +0 -4
- package/dist/chunks/studio-bkmv1h3e.js +0 -9
- package/dist/chunks/studio-cgb97rwv.js +0 -5
- package/dist/chunks/studio-ch8gt8vt.js +0 -5
- package/dist/chunks/studio-cqf1k4qk.js +0 -5
- package/dist/chunks/studio-cvz0e00f.js +0 -5
- package/dist/chunks/studio-dbgv4fv9.js +0 -16
- package/dist/chunks/studio-eesyjg7h.js +0 -9
- package/dist/chunks/studio-et6t8g4m.js +0 -4
- package/dist/chunks/studio-fep7hr66.js +0 -7
- package/dist/chunks/studio-fyf7j57j.js +0 -5
- package/dist/chunks/studio-g5prntab.js +0 -5
- package/dist/chunks/studio-ga77mf07.js +0 -5
- package/dist/chunks/studio-h7gy12h2.js +0 -5
- package/dist/chunks/studio-j933k8nr.js +0 -5
- package/dist/chunks/studio-jgbvqcgh.js +0 -5
- package/dist/chunks/studio-k4xc5g6h.js +0 -5
- package/dist/chunks/studio-p0nf2e1f.js +0 -6
- package/dist/chunks/studio-pd9dsqpq.js +0 -5
- package/dist/chunks/studio-pmzg17fj.js +0 -5
- package/dist/chunks/studio-pzfa2vmb.js +0 -5
- package/dist/chunks/studio-qyb5bebs.js +0 -9
- package/dist/chunks/studio-rt498t2v.js +0 -5
- package/dist/chunks/studio-s0fg2wav.js +0 -5
- package/dist/chunks/studio-t3j8htp7.js +0 -7
- package/dist/chunks/studio-thj81e98.js +0 -7
- package/dist/chunks/studio-tyw7tk0x.js +0 -5
- package/dist/chunks/studio-vcz63n42.js +0 -5
- package/dist/chunks/studio-vffwe9k7.js +0 -5
- package/dist/chunks/studio-vjhej0w5.js +0 -928
- package/dist/chunks/studio-vxjap704.js +0 -5
- package/dist/chunks/studio-xebavr9s.js +0 -5
- package/dist/chunks/studio-yg5n49za.js +0 -5
- package/dist/chunks/studio-yhz5b313.js +0 -5
- package/dist/chunks/studio-zsjpsw08.js +0 -5
- package/dist/chunks/workspace-d65bz1qk.js +0 -4
- package/dist/chunks/workspace-home-vbg9b3jh.js +0 -4
- package/src/settings/settings-dialog.ts +0 -192
- package/src/surfaces/settings-dialog.json +0 -51
- package/src/surfaces/settings-dialog.ts +0 -169
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{Wt,ml,gv,an,xn,ea,Gn,Ra,xh,Z,Yd,Qd,fi,m,h,pn,Sr,Qm,i1,oc,eg,tg,td,c1,r0,xI,eu,Ft,kv}from"./studio-yrcrncev.js";import{w,yl}from"./studio-sce30r7b.js";import{nu,ef}from"./studio-swedpd82.js";import{p}from"./studio-4fnb5648.js";import{pO,hl,Sx,u,tv}from"./studio-x0gsfr1d.js";import{ae}from"./studio-wqfaqw4m.js";import{Vu,Gl}from"./studio-yzpskb0j.js";import{Tn,nt,qo,qC}from"./studio-tpxcryf2.js";import{zt}from"./studio-daksw8kh.js";import{Ul,xS,Tb,vN,pT,fT,mT,gT}from"./studio-9qx1ywbv.js";import{oa,At}from"./studio-1ks5d9y4.js";import{Cs,Tp,Jl,jc}from"./studio-e7vjyp04.js";import{al}from"./studio-ggx3j7nd.js";import{bt,Ub,Ql,zc,sh,Ap,bC,ji}from"./studio-53wy9ek3.js";import{pl,Br,Ks,Js,zr}from"./studio-90zkgne5.js";import{Yl,$m,Ip}from"./studio-thz5t120.js";import{ju,GE}from"./studio-hfxttkyr.js";import{_i}from"./studio-wse1rs8t.js";import{rT}from"./studio-423tfdte.js";import{Sa,Fc}from"./studio-wgc54sxf.js";import{Xc}from"./studio-zfdbmhp3.js";import{tf,C,wn,vl}from"./studio-4f7thq0p.js";import{hf,E,R}from"./studio-9dq7rwc7.js";import{Me,h0}from"./studio-0gvvqj3h.js";import{me,te,g}from"./studio-3qr08sxq.js";import{n,Ze,v}from"./studio-k3we3kqb.js";import{ce}from"./studio-0939t1q1.js";var St=new Set(["entry"]);function sb(e){let t=ml(e.id);if(t)return t;let a=e.session.ui.canvasMode;if(a==="git-diff")return"publish";if(a==="media"||a==="image")return"media";if(St.has(a))return"content";let r=Yl(e.id);if(r)return r.kind==="data"?"design":"content";if(e.documentPath===an)return"styles";return Gn(e.documentPath)?"content":"design"}var Tt=new Set(["edit","design","stylebook"]);function fE(e){return e.documentPath!==null&&Yl(e.id)===null&&Tt.has(e.session.ui.canvasMode)}function Nc(e,t=u.workspace){let a=m.tabs.get(e);return a!==void 0&&sb(a)===t}function ne(e,t=u.workspace){return e.tabOrder.filter((a)=>Nc(a,t))}function _D(e){let t=m.mruOrder.find((a)=>Nc(a,e));if(t)return t;for(let a of m.panes){let r=a.tabOrder.find((i)=>Nc(i,e));if(r)return r}return null}function mE(e,t){if(e.activeTabId&&Nc(e.activeTabId,t))return e.activeTabId;return m.mruOrder.find((a)=>e.tabOrder.includes(a)&&Nc(a,t))??e.tabOrder.find((a)=>Nc(a,t))??null}var je={$schema:"https://jxsuite.com/schema/v1",$id:"StudioTabStrip",$description:"One pane's tab strip, as a Jx document over the kit: a real `tablist` of `jx-tab`s, or — for a pane that owns no document — the derivation chip naming what it is a projection of, and in both cases one trailing button. `panels/tab-strip.ts` keeps every decision: which pane a host is drawing, what each tab is called (the shortest unique suffix, and a page's ROUTE), what its tooltip says, whether closing it needs a prompt, what the overflow chevron lists and what the context menu offers. This document owns the markup, the ARIA, the keyboard and the style, and it holds THREE things the old chip drew by hand and the kit now draws: the tab's own selected state (`aria-selected`, not an `.active` class), its close button, and its dirty dot. The three that are Studio's alone go in `jx-tab`'s slots — the drill-in marker in `icon`, the draft pill in `status`, the pin toggle in `actions` (ui.md §5.4) — which is the gap that kept this strip out of the tab pattern until now. **Drag is `@atlaskit/pragmatic-drag-and-drop`, not native HTML5 DnD**: a chip carries no `draggable` attribute and no `ondrag*` handler, because `panels/tab-strip.ts` registers every chip and every strip as a pragmatic source/target through `onNodeCreated` and resolves a completed drag in `panels/tab-drop.ts`. What is left here is three SCOPE comparisons, exactly as `files-panel.json` marks a row under drag: `data-dragging` on the chip being carried, `data-drop` on the chip a drop would land beside, `data-drop-tail` on the strip when the drop is its empty tail.",tagName:"div",attributes:{part:"strip-row","data-focused":"${state.focused ? '' : null}",hidden:"${state.mode === 'empty' ? '' : null}"},onmousedown:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/focusPane"},value:[]}]},style:{$description:"`styles/shell.css`'s `.tab-strip*` rules and `styles/canvas.css`'s pane-state rules, keyed on `part` and carried in. What did NOT come with them is the point: the chip's own hover, its selected underline, its close button and its dirty dot are `jx-tab`'s, and the strip's flex row and hairline are `jx-tabs`'s. What is left here is the pane strip's own shape — the scroll container the chevron exists for, the 11px type of a chrome row, the states the PANE model adds (pinned, preview, dragging, an unfocused pane's dimmed underline), and the three slotted marks.",display:"flex",alignItems:"stretch",minWidth:"0",background:"var(--bg-panel)",borderBottom:"1px solid var(--border)",fontFamily:"var(--jx-font-sans)","&[hidden]":{display:"none"},'& [part="tabs"]':{$description:"`.tab-strip`. The kit's strip draws its own hairline; the ROW draws this one, so the strip's is taken off rather than doubled. The scrollbar is hidden by design — the wheel handler is a mouse affordance and the chevron is the pointer-independent route to the same tabs — so `overflow-x: auto` here is a scrolling box with no visible bar.",flex:"1 1 auto",minWidth:"0",gap:"0",padding:"0 var(--jx-space-2)",border:"0",overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none",fontSize:"var(--jx-text-sm)","&::-webkit-scrollbar":{display:"none"}},'& [part="tabs"][data-drop-tail]::after':{$description:"The strip's own tail target: a drop onto the empty space after the last chip, or onto a pane whose strip carries no chips at all — an empty pane made a target during a drag by `panels/tab-strip.ts`'s `project`. A fixed-width bar rather than a background tint, so it reads the same as a chip's own `data-drop` edge instead of a second visual language for the same gesture.",content:'""',flex:"0 0 2px",alignSelf:"stretch",background:"var(--accent)"},'& [part="tab"]':{$description:"`.tab-strip-tab`. The kit's tab caps itself at 220px and reserves a control's height; a chrome row is tighter than that and its labels are the shortest unique suffix, so both are re-declared. `flex-shrink: 0` is what makes the strip scroll rather than squeeze fifteen documents into one width.",gap:"var(--jx-space-1)",padding:"4px var(--jx-space-2)",minHeight:"0",maxWidth:"none",flexShrink:"0",marginBlockEnd:"0",color:"var(--fg-dim)",cursor:"pointer",":hover":{color:"var(--fg)",background:"var(--hover-bg)"},'&[aria-selected="true"]':{color:"var(--fg)",borderBlockEndColor:"var(--accent)"},"&[data-dragging]":{opacity:"0.4"},"&[data-drop]":{$description:"The chip a drop would land BESIDE. An inset shadow rather than a border, so the indicator draws no layout shift mid-drag — the same reason `files-panel.json`'s row indicators are backgrounds rather than borders.",boxShadow:"inset 2px 0 0 var(--accent)"}},'& [part="tab"] [part="label"]':{maxWidth:"140px"},'& [part="tab"][data-preview] [part="label"]':{fontStyle:"italic"},'&:not([data-focused]) [part="tab"][aria-selected="true"]':{$description:"The unfocused pane's strip still says which of ITS documents is current, in a colour that does not compete with the pane holding the keyboard.",borderBlockEndColor:"var(--border)"},'& [part="tab"] [part="close"]':{$description:"`.tab-strip-close`'s reveal, applied to the kit's own close button: a row of fifteen ✕ glyphs is noise, so the affordance appears on the tab under the pointer and on the current one. The button keeps its own 24px target either way (SC 2.5.8) — this moves no pixel of layout.",opacity:"0"},'& [part="tab"]:hover [part="close"], & [part="tab"][aria-selected="true"] [part="close"]':{opacity:"1"},'& [part="origin"]':{$description:"`.tab-strip-origin` — the drill-in marker, in `jx-tab`'s icon slot. Hidden from assistive technology by the document that writes it: a reader hears where a document was opened from in the tooltip, and an arrow announced beside a file name says nothing.",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)",lineHeight:"1"},'& [part="pill"]':{$description:'`.entry-pill` — the draft pill (site-architecture.md §7.6), in `jx-tab`\'s status slot. It is ON THE CHIP and not only inside the entry editor because the mistake it prevents, publishing something you believed was private, is made while glancing at a row of tabs. "Published" is deliberately as visible as "Draft": a state you can only see one half of is a state you cannot check. The two Spectrum colours it used to name are `--jx-signal` against `--jx-bg`, which flips with the theme where a fixed yellow and a fixed black did not.',padding:"0 5px",borderRadius:"var(--radius)",background:"var(--bg)",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)",lineHeight:"15px",whiteSpace:"nowrap"},'& [part="pill"][data-draft]':{background:"var(--jx-signal)",color:"var(--jx-bg)"},'& [part="pin"]':{$description:"`.tab-strip-pin`, in `jx-tab`'s actions slot, on the current chip and on a pinned one (the rule below). A click on it never also selects the tab, and that is the KIT's doing now rather than a `stopPropagation` this document has to remember: `jx-tab` stops a click inside its actions slot exactly as it stops one on its own close button.",display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",padding:"0",border:"none",background:"none",color:"var(--fg-dim)",font:"inherit",fontSize:"var(--jx-text-md)",lineHeight:"1",borderRadius:"var(--radius)",cursor:"pointer",":hover":{background:"var(--hover-bg)",color:"var(--fg)"},":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"-1px"}},'& [part="tab"]:not([aria-selected="true"]):not([data-pinned]) [part="pin"]':{$description:"An inactive, unpinned chip draws no pin and keeps no box for one. It was `opacity: 0` here and revealed on hover, so the invisible button still took 16px of the chip and every click on it: the centre of a short chip (the Media home's, beside its viewer tab) was the pin, so the click toggled a pin nobody could see and the tab did not activate. A box that takes clicks is a control, and a control is either shown or absent. The current chip shows its pin, a pinned chip shows its mark, and any chip pins from its context menu (`document.togglePinned`).",display:"none"},'& [part="tab"][data-pinned] [part="pin"]':{color:"var(--accent)"},'& [part="derivation"]':{$description:"A LENS pane's strip: one chip naming the projection and the document it projects, where an ordinary pane draws tab chips. It is not a tab and must not look like one — no close ✕ of its own, because a lens owns no document to close. Its vertical box is a tab chip's, `4px` top and bottom plus the 2px underline `[part=\"tab\"]` reserves, so the lens's one-chip row sits on the same baseline grid as the tab row in the pane beside it; `tab-strip.test.ts` compares the two declarations rather than the two boxes, because happy-dom lays nothing out and a 19px strip against a 28px one is the class of defect only a picture catches. Horizontally it is 10px rather than a chip's 8px: this row is one chip wide with nothing to sit beside, and a chip's tighter inset exists so several of them read as a series.",display:"flex",flex:"1 1 auto",alignItems:"baseline",gap:"6px",minWidth:"0",padding:"4px 10px",borderBottom:"2px solid transparent",whiteSpace:"nowrap",overflow:"hidden"},'& [part="preset"]':{color:"var(--fg)",fontSize:"var(--jx-text-md)"},'& [part="subject"]':{color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)",textOverflow:"ellipsis",overflow:"hidden"},'& [part="overflow"]':{$description:"`.tab-strip-overflow`. It sits OUTSIDE the scrolling strip, so it stays reachable at any scroll offset — which is the whole point of it. One button draws both trailing affordances, because they are the same control in the same place: the chevron that lists the tabs currently out of view, and, on a derived pane, the ✕ that is a lens's only exit.",flex:"0 0 auto",display:"flex",alignItems:"center",justifyContent:"center",width:"22px",padding:"0",border:"none",borderLeft:"1px solid var(--border)",background:"none",color:"var(--fg-dim)",font:"inherit",fontSize:"var(--jx-text-lg)",lineHeight:"1",cursor:"pointer",":hover":{background:"var(--hover-bg)",color:"var(--fg)"},":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"-2px"}},'& [part="overflow"][hidden]':{display:"none"}},children:[{$description:"One row draws one pane, and a pane is either a set of open documents or a projection of somebody else's. A third answer — a pane with neither — draws nothing at all, which is the case with no branch here: the row itself is `hidden`.",tagName:"div",attributes:{part:"body"},style:{$description:"The switch container generates no box: the branch inside it IS the row's flex item, so a lens chip and a tab strip sit at the same depth and take the same `flex` the row gives them.",display:"contents"},$switch:{$ref:"#/state/mode"},cases:{tabs:{tagName:"jx-tabs",attributes:{part:"tabs",label:"${state.stripLabel}",selected:"${state.active}","data-drop-tail":"${state.dropTail ? '' : null}"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/activate"},value:[{$ref:"event#/detail"}]}]},onclose:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closeTab"},value:[{$ref:"event#/detail"}]}]},onwheel:{$ref:"#/state/wheel"},children:[{$prototype:"Array",items:{$ref:"#/state/tabs"},key:{$ref:"$map/item/key"},map:{tagName:"jx-tab",attributes:{part:"tab","data-tab":"${$map.item.key}",value:"${$map.item.key}",label:"${$map.item.label}",title:"${$map.item.title}",closable:"",dirty:"${$map.item.dirty ? '' : null}","data-pinned":"${$map.item.pinned ? '' : null}","data-preview":"${$map.item.preview ? '' : null}","data-dragging":"${state.dragKey === $map.item.key ? '' : null}","data-drop":"${state.dropIndex === $map.item.index ? '' : null}"},ondblclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/promote"},value:[{$ref:"$map/item/key"}]}]},onauxclick:{$prototype:"Function",body:[{if:{operator:"===",target:{$ref:"event#/button"},value:1},then:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/closeTab"},value:[{$ref:"$map/item/key"}]}]}]},oncontextmenu:{$prototype:"Function",body:[{preventDefault:!0},{stopPropagation:!0},{operator:"call",target:{$ref:"#/state/context"},value:[{$ref:"$map/item/key"},{$ref:"event#/clientX"},{$ref:"event#/clientY"}]}]},children:[{$description:"The drill-in marker: this document was opened FROM another one. `jx-tab`'s icon slot draws it before the label, which is where it has always been.",tagName:"span",attributes:{slot:"icon",part:"origin","aria-hidden":"true",hidden:"${$map.item.origin ? null : ''}"},textContent:"↳"},{$description:"The draft pill. It is a `<span>` in the status slot rather than a mounted document of its own, which is what kept it a lit fragment inside `content/entry-editor.ts` until the strip converted: a document mounted per chip would be an async mount inside a synchronous rebuild. `entryDraftPill` states the two facts; this draws them.",tagName:"span",attributes:{slot:"status",part:"pill",title:"${$map.item.pillTitle}","data-draft":"${$map.item.draft ? '' : null}",hidden:"${$map.item.pill ? null : ''}"},textContent:"${$map.item.pill}"},{$description:"The pin, in the actions slot. `title` is the whole accessible name (studio-ui-guidelines.md §10): the glyph is hidden, so a matching `aria-label` would announce it twice. `tabindex` follows the tab's own selectedness, exactly as the close button's does — the strip is ONE stop in the tab order, and a control inside every chip that took the platform's default would make fifteen.",tagName:"button",attributes:{slot:"actions",part:"pin",type:"button",title:"${$map.item.pinTitle}",tabindex:"${$map.item.tabindex}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/togglePin"},value:[{$ref:"$map/item/key"}]}]},children:[{tagName:"span",attributes:{part:"pin-glyph","aria-hidden":"true"},textContent:"${$map.item.pinGlyph}"}]}]}}]},derivation:{$description:`THE CHIP FINISHES ITS OWN SENTENCE, and both halves are the flow's: two of the presets are labelled with an unfinished phrase — "Same page at", "Same page in" — because the interesting half is the value, and a chip whose source pane shows nothing says "no document" rather than trailing off.`,tagName:"div",attributes:{part:"derivation",title:"${state.chipTitle}"},children:[{tagName:"span",attributes:{part:"preset"},textContent:"${state.preset}"},{tagName:"span",attributes:{part:"subject"},textContent:"${state.subject}"}]}}},{tagName:"button",attributes:{part:"overflow",type:"button",title:"${state.trailingTitle}",hidden:"${state.trailing ? null : ''}"},onclick:{$prototype:"Function",body:[{stopPropagation:!0},{operator:"call",target:{$ref:"#/state/openTrailing"},value:[{$ref:"event#/currentTarget"}]}]},children:[{tagName:"span",attributes:{part:"overflow-glyph","aria-hidden":"true"},textContent:"${state.trailingGlyph}"}]}]};E("tab-strip",je);function Et(e){let t=n(e)?void 0:e.attributes?.part;return n(t)?t:""}function Pt(e){let t=e?.$map,a=v(t)?t.item:void 0,r=v(a)?a.key:void 0;return n(r)?r:""}function Ce(e,t,a){let r=g({...t,...a,dragKey:"",dropIndex:-1,dropTail:!1});e.replaceChildren();let i=null,o=!1,s=null;return R("tab-strip",r,e,{onNodeCreated:(l,c,d,f)=>{if(o||!(l instanceof HTMLElement))return;let b=Et(d);if(b==="tabs"){s=l,a.stripHost(l);return}if(b==="tab"){let x=Pt(f);if(x)a.chipHost(l,x)}}}).then((l)=>{if(o){l.dispose();return}i=l}),{dispose(){o=!0,i?.dispose(),i=null,s=null,e.replaceChildren()},drag(l){r.dragKey=l.dragKey,r.dropIndex=l.dropIndex,r.dropTail=l.dropTail},strip:()=>s,update(l){r.focused=l.focused,r.stripLabel=l.stripLabel,r.active=l.active,r.tabs=l.tabs,r.preset=l.preset,r.subject=l.subject,r.chipTitle=l.chipTitle,r.trailing=l.trailing,r.trailingTitle=l.trailingTitle,r.trailingGlyph=l.trailingGlyph,r.mode=l.mode}}}function Fe(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),a.push.apply(a,r)}return a}function Ae(e){for(var t=1;t<arguments.length;t++){var a=arguments[t]!=null?arguments[t]:{};t%2?Fe(Object(a),!0).forEach(function(r){pl(e,r,a[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):Fe(Object(a)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(a,r))})}return e}var Nt={top:function e(t,a){return Math.abs(a.y-t.top)},right:function e(t,a){return Math.abs(t.right-a.x)},bottom:function e(t,a){return Math.abs(t.bottom-a.y)},left:function e(t,a){return Math.abs(a.x-t.left)}};function fe(e,t){var a,r,{element:i,input:o,allowedEdges:s}=t,l={x:o.clientX,y:o.clientY},c=i.getBoundingClientRect(),d=s.map(function(b){return{edge:b,value:Nt[b](c,l)}}),f=(a=(r=d.sort(function(b,x){return b.value-x.value})[0])===null||r===void 0?void 0:r.edge)!==null&&a!==void 0?a:null;return Ae(Ae({},e),{},pl({},re,f))}function he(e){var t;return(t=e[re])!==null&&t!==void 0?t:null}var re=Symbol("closestEdge");function Oe(e){var{startIndex:t,closestEdgeOfTarget:a,indexOfTarget:r,axis:i}=e;if(t===-1||r===-1)return t;if(t===r)return t;if(a==null)return r;var o=i==="vertical"&&a==="bottom"||i==="horizontal"&&a==="right",s=t<r;if(s)return o?r:r-1;return o?r+1:r}function Mu(e){return v(e)&&(e.type==="tab"||e.type==="file-tree"&&e.entryType==="file")}function ge(e,t,a){if(pn(t)?.derived)GE(t);if(!kv(e,t,a))return;td(e),Ft(e)}async function Ht(e,t,a){let r=[...m.tabs.values()].find((o)=>o.documentPath===e);if(r){ge(r.id,t,a);return}await _i(e,{focus:!0,paneId:t});let i=[...m.tabs.values()].find((o)=>o.documentPath===e);if(i)ge(i.id,t,a)}function Le(e,t){if(e.tabId===void 0)return e.index;return t==="left"?e.index:e.index+1}async function It(e,t){let a=he(t);if(e.type==="tab"){if(e.paneId===t.paneId){let r=pn(t.paneId);if(!r)return;let i=r.tabOrder.indexOf(e.tabId);if(i===-1)return;let o=t.tabId===void 0?r.tabOrder.length-1:Oe({axis:"horizontal",closestEdgeOfTarget:a,indexOfTarget:t.index,startIndex:i});if(o!==i)xI(e.tabId,o);return}ge(e.tabId,t.paneId,Le(t,a));return}await Ht(e.path,t.paneId,Le(t,a))}async function jt(e,t){if(e.type==="tab"){if(i1(e.tabId))td(e.tabId);return}let a=oc(t.paneId);if(await _i(e.path,{paneId:a.id}),![...m.tabs.values()].some((i)=>i.documentPath===e.path)&&tg(a))eg(a.id)}async function De(e,t){if(!t||!Mu(e.data))return;let a=e.data;if(t.data.type==="tab-slot"){await It(a,t.data);return}if(t.data.type==="pane-edge")await jt(a,t.data)}var we=null,ie=null,z=new Map,_=new Map,T=new Map,A=new Map,M=new Map,J=null,H=null,P=null,U=new Map,oe=new Map,ve=null;function Mt(e){return`pane.${e}/tabs`}function Ct(e){return hf(Mt(e.id))??we}function SD(e){Ot(),we=e,ve=Js({onDragStart({source:t}){if(!Mu(t.data))return;H=t.data.type==="tab"?{kind:"tab",tabId:t.data.tabId}:{kind:"file",path:t.data.path},be(),ye()},onDrag({location:t}){if(!H)return;let[a]=t.current.dropTargets,r=a?.data;P=r?.type==="tab-slot"?{index:r.tabId===void 0?-1:r.index,paneId:r.paneId,tail:r.tabId===void 0}:null,ye()},onDrop({location:t,source:a}){if(!Mu(a.data))return;let[r]=t.current.dropTargets;H=null,P=null,ye(),be(),De(a,r)}}),ie=me(),ie.run(()=>{te(()=>{m.activePaneId;for(let t of m.panes)t.id,t.tabOrder,t.activeTabId;u.workspace;for(let t of m.tabs.values())t.session.ui.canvasMode,t.doc.dirty,al(t),t.documentPath,t.pinned,t.preview,t.session.openedFrom,t.doc.content.frontmatter[Cs];c1(),be()})})}function Ot(){Rt(),Se(),_e(),ie?.stop(),ie=null,ve?.(),ve=null;for(let e of T.keys())$e(e);for(let e of T.values())e.dispose();T.clear(),A.clear(),we=null,H=null,P=null,z.clear(),M.clear(),_.clear()}function $e(e){let t=U.get(e);if(t){for(let a of t.values())a();U.delete(e)}oe.get(e)?.(),oe.delete(e)}function be(){let e=tv(),t=new Map;for(let r of m.panes){let i=Ct(r);if(i&&(!t.has(i)||Qm(r.id)))t.set(i,r)}let a=new Set;for(let[r,i]of t){if(e||i.derived)Lt(i,r);_.set(i.id,r),a.add(i.id)}for(let[r,i]of _){if(a.has(r))continue;if(_.delete(r),z.delete(r),M.delete(r),!t.has(i))$e(i),T.get(i)?.dispose(),T.delete(i),A.delete(i)}}function Lt(e,t){let a=Re(e);A.set(t,{mode:a.mode,paneId:e.id});let r=T.get(t);if(r)r.update(a);else T.set(t,Ce(t,a,Jt(t)));if(Kt(t,a),T.get(t)?.strip()&&e.activeTabId!==z.get(e.id))z.set(e.id,e.activeTabId),le.add(t);Dt(t)}var V=new Map,le=new Set;function Dt(e){if(V.has(e))return;V.set(e,requestAnimationFrame(()=>{V.delete(e);let t=F(e);if(t&&tv())_t(t,e);le.delete(e)}))}function Rt(){for(let e of V.values())cancelAnimationFrame(e);V.clear(),le.clear()}function _t(e,t){let a=T.get(t)?.strip();if(a&&le.has(t))[...a.children].find((r)=>r instanceof HTMLElement&&r.dataset.tab===e.activeTabId)?.scrollIntoView({block:"nearest",inline:"nearest"});Yt(e,t)}function F(e){let t=A.get(e)?.paneId;return m.panes.find((a)=>a.id===t)??null}function Jt(e){return{activate:(t)=>{Ft(t)},chipHost:(t,a)=>{Gt(e,t,a)},closeTab:(t)=>{ab(t)},context:(t,a,r)=>{let i=m.tabs.get(t);if(i)ia(i,a,r)},focusPane:()=>{Sr(F(e)?.id??fi)},openTrailing:(t)=>{Xt(e,t)},promote:(t)=>{td(t)},stripHost:(t)=>{qt(e,t)},togglePin:(t)=>{let a=m.tabs.get(t);if(a)r0(t,!a.pinned)},wheel:(t,a)=>{Zt(a)}}}function Vt(e,t){let a=ae(),r=bt(e.id)??bt(t.sourcePaneId),i=t.kind==="lens"&&t.preset==="breakpoint"?`${ju.breakpoint} ${t.media?ji(t.media):"Base"}`:t.kind==="companion"&&t.preset==="locale"?`${ju.locale} ${t.locale?Wt(t.locale):"—"}`:ju[t.preset],o=r?$d(r):"no document";return{active:"",chipTitle:`${i} · ${r?.documentPath??"no document"}`,focused:Qm(e.id),mode:"derivation",preset:i,stripLabel:se(e),subject:o,tabs:[],trailing:!0,trailingGlyph:"✕",trailingTitle:a?.get("pane.unsplit")?.title??"Close Side Pane"}}function se(e){return e.id===fi?"Open documents":"Open documents in the side pane"}function Ut(e){return{active:"",chipTitle:"",focused:Qm(e.id),mode:"empty",preset:"",stripLabel:se(e),subject:"",tabs:[],trailing:!1,trailingGlyph:"",trailingTitle:""}}function Re(e){let{derived:t}=e,a=ne(e);if(t&&a.length===0)return Vt(e,t);if(a.length===0){if(H)return{active:"",chipTitle:"",focused:Qm(e.id),mode:"tabs",preset:"",stripLabel:se(e),subject:"",tabs:[],trailing:!1,trailingGlyph:"⌄",trailingTitle:"Show hidden tabs"};return z.set(e.id,null),M.set(e.id,!1),Ut(e)}let r=Je(e);return{active:e.activeTabId??"",chipTitle:"",focused:Qm(e.id),mode:"tabs",preset:"",stripLabel:se(e),subject:"",tabs:a.flatMap((i)=>Bt(e,i,e.tabOrder.indexOf(i),r)),trailing:M.get(e.id)===!0,trailingGlyph:"⌄",trailingTitle:"Show hidden tabs"}}function Bt(e,t,a,r){let i=m.tabs.get(t);if(!i)return[];let o=vN(i);return[{dirty:i.doc.dirty||al(i),draft:o?.draft??!1,index:a,key:t,label:r.get(t)??"Untitled",origin:Boolean(i.session.openedFrom),pill:o?.text??"",pillTitle:o?.title??"",pinGlyph:i.pinned?"◉":"◎",pinTitle:i.pinned?"Unpin":"Pin",pinned:i.pinned,preview:i.preview,tabindex:t===e.activeTabId?"0":"-1",title:la(i)}]}function Gt(e,t,a){let r=U.get(e);if(!r)r=new Map,U.set(e,r);r.get(a)?.();let i=Br(zr({element:t,canDrag({input:o}){let s=h0(o.clientX,o.clientY);return!(s instanceof Element&&s.closest('[part="pin"], [part="close"]'))},getInitialData(){return{paneId:F(e)?.id,tabId:a,type:"tab"}}}),Ks({canDrop({source:o}){return Mu(o.data)},element:t,getData({element:o,input:s}){let l=F(e);if(!l)return{type:"tab-slot-refused"};return fe({index:l.tabOrder.indexOf(a),paneId:l.id,tabId:a,type:"tab-slot"},{allowedEdges:["left","right"],element:o,input:s})}}));r.set(a,i)}function qt(e,t){oe.get(e)?.();let a=Ks({canDrop({source:r}){return Mu(r.data)},element:t,getData(){let r=F(e);return r?{index:r.tabOrder.length,paneId:r.id,type:"tab-slot"}:{type:"tab-slot-refused"}}});oe.set(e,a)}function Kt(e,t){if(t.mode!=="tabs"){$e(e);return}let a=new Set(t.tabs.map((i)=>i.key)),r=U.get(e);if(!r)return;for(let[i,o]of r)if(!a.has(i))o(),r.delete(i)}function ye(){let e=H?.kind==="tab"?H.tabId:"";for(let[t,a]of A){let r=T.get(t);if(!r)continue;let i=P!==null&&P.paneId===a.paneId;r.drag({dragKey:e,dropIndex:i&&P?P.index:-1,dropTail:i&&P?P.tail:!1})}}function Yt(e,t){let a=T.get(t),r=a?.strip();if(!a||!r)return;let i=r.scrollWidth>r.clientWidth;if(i!==(M.get(e.id)===!0))M.set(e.id,i),a.update(Re(e))}function Xt(e,t){let a=F(e);if(!a)return;if(A.get(e)?.mode==="derivation"){nt("pane.unsplit",void 0,"Tabs");return}ta(a,Je(a),t)}function Zt(e){if(e.ctrlKey)return;let t=e.currentTarget;if(!(t instanceof HTMLElement)||t.scrollWidth<=t.clientWidth)return;let a=Math.abs(e.deltaX)>Math.abs(e.deltaY)?e.deltaX:e.deltaY;if(!a)return;e.preventDefault(),t.scrollLeft+=a}function Qt(e=m.activePaneId){let t=m.panes.find((d)=>d.id===e),a=_.get(e),r=a?T.get(a)?.strip()??null:null;if(!t||!r)return[];let i=r.scrollLeft,o=i+r.clientWidth,s=[],l=ne(t),c=[...r.querySelectorAll('[part="tab"]')];for(let[d,f]of c.entries()){let b=l[d];if(b&&(f.offsetLeft<i||f.offsetLeft+f.offsetWidth>o))s.push(b)}return s}function Se(){J?.close(),J=null}function ta(e,t,a){Se();let r=Qt(e.id),i=r.length>0?r:ne(e),o=Me(a??document.body);J=zt({label:"Hidden tabs",onClosed:(s)=>{if(J===s)J=null},opener:a,place:(s)=>({x:Math.max(4,o.right-s.width),y:o.bottom}),placement:"block-end span-inline-start",region:"tab-overflow",rows:i.map((s)=>({checked:s===e.activeTabId?"true":"false",destructive:!1,disabled:!1,dividerAbove:!1,id:s,run:()=>{Ft(s)},title:t.get(s)??"Untitled"}))})}var W=null;function _e(){W?.close(),W=null}function aa(e){let t={};if(Fc(e.documentPath))t.draft=!Jl(Ul(e));return t}function na(e){let t=Object.entries(e),a=t.length===1?t[0]?.[1]:void 0;if(!Ze(a))return;return a?"false":"true"}function ra(e){let t=ae();if(!t)return[];let a=aa(e),r=[],i;for(let o of t.forPlacement("context/tab")){let s=o.args;if(!(s?.required??[]).every((x)=>(x in a)))continue;let l={};for(let x of Object.keys(s?.properties??{}))if(x in a)l[x]=a[x];let c=r.length>0&&o.group!==i;({group:i}=o);let d=t.disabledReason(o.id),f=na(l),b={destructive:o.destructive===!0,dividerAbove:c,id:o.id,title:o.title};if(f!==void 0)b.checked=f;r.push(d===void 0?{...b,disabled:!1,run:()=>{Tn(t,o.id,l,"Tabs")}}:{...b,disabled:!0,requires:d})}return r}function ia(e,t,a){_e(),Se(),Ft(e.id);let r=ra(e);if(r.length===0)return;W=zt({label:"Tab actions",onClosed:(i)=>{if(W===i)W=null},origin:{x:t,y:a},region:"tab",rows:r})}function cm(e){let t=e.replace(/^\.\//,"");if(!t.startsWith("pages/"))return null;let r=t.slice(6).replace(/\.[^./]+$/,"").split("/").filter((i)=>i!=="");if(r.at(-1)==="index")r.pop();return`/${r.join("/")}`}function sa(e){let t=e.map((a)=>{let r=a.documentPath;if(!r)return{depth:0,fixed:!0,id:a.id,label:a.fallback,parts:[]};let i=cm(r);if(i!==null)return{depth:0,fixed:!0,id:a.id,label:i,parts:[]};let o=r.split("/").filter((s)=>s!==""&&s!==".");return{depth:1,fixed:!1,id:a.id,label:o.slice(-1).join("/")||r,parts:o}});for(;;){let a=new Map;for(let i of t){let o=a.get(i.label);if(o)o.push(i);else a.set(i.label,[i])}let r=!1;for(let i of a.values()){if(i.length<2)continue;for(let o of i){if(o.fixed||o.depth>=o.parts.length)continue;o.depth+=1,o.label=o.parts.slice(-o.depth).join("/"),r=!0}}if(!r)break}return new Map(t.map((a)=>[a.id,a.label]))}function Je(e){return sa(e.tabOrder.flatMap((t)=>{let a=m.tabs.get(t);return a?[{documentPath:a.documentPath,fallback:$m(a.id)??gv(a.id)??"Untitled",id:t}]:[]}))}function la(e){let t=e.documentPath||$m(e.id)||gv(e.id)||"Untitled",a=e.session.openedFrom,r=a?.documentPath?`${t}
|
|
2
|
+
Opened from ${a.documentPath}`:t;return e.preview?`${r}
|
|
3
|
+
Preview — double-click to keep open`:r}function $d(e){let t=e.documentPath;if(!t)return $m(e.id)??"Untitled";return cm(t)??t.split("/").at(-1)??t}function Ve(e){let t=ef(e),a=al(e);if(!e.doc.dirty&&!t&&!a)return!1;let r=xn(e);if(!r.active)return!0;if(ea(e))return!0;if(t||a)return!0;return r.peers.filter((o)=>o.state.focusedPath===e.documentPath).length===0}function xe(e){if(ea(e))return`You have read access to this session, so "${$d(e)}" has changes that were never published and have nowhere to be saved. Closing discards them.`;if(ef(e))return`"${$d(e)}" has text in its editor that the document could not be given — the `+"source does not parse, or a collaborator holds the source lock. Saving would write the file without it, so it is not offered. Closing discards that text.";return null}async function da(e){let t=xe(e);if(t)return qo("Changes Cannot Be Saved",t,{cancelLabel:"Keep Editing",confirmLabel:"Close Without Saving",destructive:!0});let a=await qC("Unsaved Changes",`"${$d(e)}" has unsaved changes.`,{discardLabel:"Close Without Saving"});if(a==="cancel")return!1;return a==="discard"||await Ip(e)}async function ab(e){let t=m.tabs.get(e);if(!t)return;if(await nu(t),!m.tabs.has(e))return;if(Ve(t)&&!await da(t))return;eu(e)}async function gE(e){let t=[...m.tabs.values()];for(let c of t)await nu(c);let a=[...m.tabs.values()].filter((c)=>Ve(c));if(a.length===0)return!0;let r=a.length===1?`"${$d(a[0])}" has unsaved changes`:`${a.length} documents have unsaved changes`,i=a.filter((c)=>xe(c)!==null),o=a.filter((c)=>xe(c)===null),s=i.length===1?`"${$d(i[0])}"`:`${i.length} of them`;if(o.length===0)return qo("Changes Cannot Be Saved",`${e} closes every open document, and ${r}. ${s} cannot be saved at all, so saving would leave work behind. Closing discards it.`,{cancelLabel:"Keep Editing",confirmLabel:"Close Without Saving",destructive:!0});let l=await qC("Unsaved Changes",i.length===0?`${e} closes every open document, and ${r}.`:`${e} closes every open document, and ${r}. ${s} cannot be saved at `+`all — saving writes the other ${o.length} and discards ${i.length===1?"that one":"those"}.`,{discardLabel:"Close Without Saving",saveLabel:i.length===0?"Save All":`Save ${o.length} of ${a.length}`});if(l==="cancel")return!1;if(l==="discard")return!0;for(let c of o)if(!await Ip(c))return!1;return!0}function We(e,t){if(!n(t)||t.trim()==="")return[...e];return[{attributes:{content:t,name:"description"},tagName:"meta"},...e]}function ze(e,t,a){let r=e.doc.content.frontmatter,i=xh(e.documentPath,t),o=i?.schema,s=o?.properties,l=new Set(o?.required||[]),c=[];if(s){for(let[d,f]of Object.entries(s)){if(a.has(d))continue;c.push({entry:f,field:d,value:r[d]})}for(let[d,f]of Object.entries(r)){if(s[d]||d.startsWith("$")||a.has(d))continue;c.push({entry:{type:Ze(f)?"boolean":"string"},field:d,value:f})}}else for(let[d,f]of Object.entries(r)){if(d.startsWith("$")||a.has(d))continue;c.push({entry:{type:Ze(f)?"boolean":"string"},field:d,value:f})}return{collection:i,fields:c,hasSchema:Boolean(s),requiredFields:l}}function B(e){return n(e)?e:""}function ca(e){return{checked:!1,hasNote:!1,hasThumb:!1,isSet:!1,kind:"text",label:e,note:"",options:[],placeholder:"",thumb:"",value:""}}function Ue(e,t,a,r,i){let o=e.replaceAll(/([A-Z])/g," $1").replace(/^./,(d)=>d.toUpperCase()),s=ca(o+(r.has(e)?" *":""));s.isSet=a!==void 0&&a!==""&&a!==!1;let l=(d)=>String(d)||void 0,c=Vu(t);if(c!==null){let d=B(a),f=rT(c,i.rerender);if(s.kind="select",s.value=d,f===null)return s.options=[{label:"Loading…",value:d}],{parse:l,row:s};if("error"in f)return s.kind="text",s.hasNote=!0,s.note=`Could not list ${c} entries — ${f.error}`,{parse:l,row:s};let b=d!==""&&!f.ids.includes(d);if(s.options=[{label:"—",value:""},...b?[{label:`${d} — not found`,value:d}]:[],...f.ids.map((x)=>({label:x,value:x}))],f.ids.length===0)s.hasNote=!0,s.note=`No ${c} entries yet.`;return{parse:l,row:s}}if(t.type==="boolean")return s.kind="boolean",s.checked=Boolean(a),{parse:(d)=>d===!0?!0:void 0,row:s};if(t.type==="array")return s.value=Array.isArray(a)?a.join(", "):B(a),s.placeholder="comma, separated",{parse:(d)=>{let f=String(d);return f?f.split(",").map((b)=>b.trim()).filter(Boolean):void 0},row:s};if(Array.isArray(t.enum))return s.kind="select",s.value=B(a),s.options=[{label:"—",value:""},...t.enum.map((d)=>({label:d,value:d}))],{parse:l,row:s};if(Ra(t.format)){let d=B(a);return s.kind="media",s.value=d,s.hasThumb=d!==""&&oa.has(At(d)),s.thumb=s.hasThumb?Xc(d):"",{parse:l,row:s}}if(t.type==="number")return s.kind="number",s.value=a===void 0?"":String(a),{parse:(d)=>{let f=String(d).trim(),b=Number(f);return f===""||Number.isNaN(b)?void 0:b},row:s};return s.value=B(a),s.placeholder=t.format==="date"?"YYYY-MM-DD":"",{parse:l,row:s}}var Be="https://fonts.googleapis.com/css2?",Ge=["https://fonts.googleapis.com","https://fonts.gstatic.com"];function ew(e){return e?.tagName==="link"&&e.attributes?.rel==="stylesheet"&&n(e.attributes.href)&&e.attributes.href.startsWith(Be)}function Te(e){return e?.tagName==="link"&&e.attributes?.rel==="preconnect"&&n(e.attributes.href)&&Ge.includes(e.attributes.href)}function vD(e){let t=e.match(/family=([^&:]+)/);if(!t)return"";return decodeURIComponent(t[1].replaceAll("+"," "))}function yD(e){return`${Be}family=${encodeURIComponent(e).replaceAll("%20","+")}&display=swap`}function wD(e){for(let t of Ge)if(!e.some((r)=>r?.tagName==="link"&&r.attributes?.rel==="preconnect"&&r.attributes.href===t)){let r={href:t,rel:"preconnect"};if(t==="https://fonts.gstatic.com")r.crossorigin="";e.push({attributes:r,tagName:"link"})}}function xD(e){if(!e.some((a)=>ew(a)))return e.filter((a)=>!Te(a));return e}var qe={$schema:"https://jxsuite.com/schema/v1",$id:"StudioPanelPage",$description:"The Inspector's Page tab (specs/studio.md §6), the former Navigator Page panel: everything the open document says about itself before anybody reads its body — its frontmatter, the layout it is poured into, its title, description, viewport and icon, its OpenGraph card, and the raw `$head` tags no structured control owns. ONE row vocabulary across the first four sections, told apart by `kind`, because a Title, a Layout picker and a schema-driven frontmatter field differ in what they COMMIT rather than in what they look like — and what they commit is `panels/head-panel.ts`'s decision, reached by the row's `key`. Nothing here knows what a `$head` entry is, which of them are managed, what a content collection is or that a page has a layout: the flow hands over sections whose every field is already a string and this draws them. The Custom Tags section is the one different shape — a read-only list plus the form that adds to it — because those rows are markup a reader is being SHOWN rather than a value they are editing.",tagName:"div",attributes:{part:"page"},style:{$description:"The eleven `.imports-*` and four `.head-*` rules in `styles/panels.css` plus the row vocabulary the panel used to borrow from `styles/inspector.css` (`.style-row`, `.style-row-label`, `.set-dot`) and `styles/overlays.css` (`.media-picker`, `.media-picker-thumb`). The borrowed ones are TRANSCRIBED rather than shared, because a document emits no class, so a class cannot style it, and the lit panels that still draw a `.style-row` go on owning those rules until they convert. Four token repairs travel with them. `--spectrum-font-size-50` resolved only inside `<sp-theme>` and a document is mounted outside it, so every rule that read it would silently have taken its 11px fallback and stopped following the theme; each is `--jx-text-sm` here, and the two bare `10px` literals are `--jx-text-xs`. `.imports-count` read `--text-hint`, a name NO stylesheet in this package defines — an unresolvable custom property makes the whole declaration invalid at computed-value time, so the count has been inheriting its colour rather than taking the one written for it, and it says `--fg-dim`, which is what it was drawing anyway. And `.head-section-body .style-row > sp-textfield` reached INSIDE another component to widen it, which a part cannot do and no longer has to: `[part=\"widget\"]` is the field itself. Two things changed on purpose. THE CLEAR DOT IS A BUTTON — it was a `<span>` with a click handler and no role, so a row's only route to clearing its value could not be reached from the keyboard at all. AND THE ADD FORM IS STATE, not three `ref()` handles read at submit time: a document binding writes only when the scope moves, so the flow states what each field holds and clearing one after a successful add is a real change the runtime carries back.",display:"block",overflowY:"auto",padding:"var(--jx-space-2)",fontFamily:"var(--jx-font-sans)",color:"var(--fg)",'& [part="section"]':{marginBottom:"var(--jx-space-4)"},'& [part="section-header"]':{$description:'The uppercase band every section opens with. It is the only thing that ever styled a section title, which is why `[part="title"]` carries no declaration of its own: the weight, the size, the colour and the letter-spacing are all inherited from here.',display:"flex",alignItems:"center",gap:"6px",padding:"6px 8px 2px",fontSize:"var(--jx-text-sm)",fontWeight:"600",color:"var(--fg-dim)",textTransform:"uppercase",letterSpacing:"0.5px"},'& [part="count"]':{fontWeight:"400",color:"var(--fg-dim)"},'& [part="seo-button"]':{$description:"The door to Search appearance, pushed to the right edge of the band so the section still reads as a heading and the button as its affordance. The band's own uppercasing and tracking stop here: this is a sentence, not a heading.",marginLeft:"auto",textTransform:"none",letterSpacing:"normal"},'& [part="body"]':{padding:"0 var(--jx-space-2)"},'& [part="row"]':{$description:"studio-ui-guidelines.md §4.1's standard form row, stacked: the label sits above a control that takes the whole width. `min-width: 0` is what keeps it honest in a 240px dock (studio-ui-guidelines.md §4.6) — a field refuses to shrink below its own min-content without it.",display:"flex",flexDirection:"column",alignItems:"stretch",gap:"2px",padding:"2px 0",minWidth:"0"},'& [part="row-label"]':{display:"flex",alignItems:"center",gap:"4px",fontSize:"var(--jx-text-xs)",color:"var(--fg-dim)"},'& [part="chip"]':{$description:"studio-ui-guidelines.md §4.2's set dot: a 6px accent dot, drawn only where the value is set on this document, that clears it when pressed. A real `button` — it is pressable, and it is the row's only keyboard route to clearing — stripped of the chrome a button brings so the row still reads as a label with a dot beside it.",width:"6px",height:"6px",padding:"0",border:"none",borderRadius:"50%",background:"var(--accent)",cursor:"pointer",flexShrink:"0"},'& [part="chip"]:hover':{background:"var(--danger)"},'& [part="chip"]:focus-visible':{outline:"var(--jx-focus-ring)",outlineOffset:"2px"},'& [part="row-name"]':{$description:"The visible label, `aria-hidden` in the markup: every control in the row carries the same words as its own accessible name, so a label node in the tree as well would have each field announced twice. That is the trade the kit's naming makes — a control names itself — and it is also why this row needs no minted ids.",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},'& [part="widget"]':{width:"100%",minWidth:"0"},'& [part="readout"]':{$description:"A derived value set as text in the field's place, monospaced because a URL is read character by character.",display:"block",padding:"2px 0",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontFamily:"var(--font-mono, monospace)",fontSize:"var(--jx-text-sm)"},'& [part="row-action"]':{alignSelf:"flex-start"},'& [part="note"]':{$description:"What the row could not find out — the entries of a referenced collection that is empty, or the reason listing it failed. A sentence under the control, in the row's own label size, so it reads as part of the field rather than as an error banner.",margin:"0",fontSize:"var(--jx-text-xs)",color:"var(--fg-dim)"},'& [part="media"]':{display:"flex",alignItems:"center",gap:"4px",minWidth:"0"},'& [part="media"] [part="widget"]':{flex:"1",minWidth:"0"},'& [part="thumb"]':{width:"24px",height:"24px",objectFit:"cover",borderRadius:"var(--radius)",border:"1px solid var(--border)",flexShrink:"0"},'& [part="list"]':{padding:"0 var(--jx-space-2)"},'& [part="tag-row"]':{display:"flex",alignItems:"center",gap:"4px",padding:"3px var(--jx-space-2)",borderRadius:"var(--radius)",fontSize:"var(--jx-text-sm)"},'& [part="tag-row"]:hover':{background:"var(--hover-bg)"},'& [part="tag-name"]':{fontWeight:"500",whiteSpace:"nowrap"},'& [part="tag-value"]':{$description:"What the tag says. It takes the row's slack and ellipses rather than wrapping, because a row is a line and a wrapped value would push the remove button off the one the eye is on. The `title` beside it is what makes the full text readable when it does.",flex:"1",minWidth:"0",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontFamily:"var(--font-mono, monospace)",fontSize:"var(--jx-text-xs)",color:"var(--fg-dim)"},'& [part="empty"]':{$description:"The compact teaching state, drawn here rather than by `panels/empty-state.ts`: that helper is a lit template, and a surface is a document or a lit template and never a mix. It keeps the compact variant's shape — left-aligned, above the add form that IS its action, so it offers no button of its own (empty-state rule 2's stated exception).",margin:"0",padding:"var(--jx-space-3) var(--jx-space-4)",maxWidth:"34ch",lineHeight:"1.5",fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)"},'& [part="add"]':{display:"flex",alignItems:"center",gap:"4px",padding:"var(--jx-space-2)"},'& [part="add"] [part="field"]':{flex:"1",minWidth:"0"},'& [part="tag-picker"]':{minWidth:"70px"}},children:[{$prototype:"Array",items:{$ref:"#/state/sections"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"section","data-section":"${$map.item.key}"},children:[{tagName:"div",attributes:{part:"section-header"},children:[{tagName:"span",attributes:{part:"title"},textContent:"${$map.item.title}"},{tagName:"div",attributes:{part:"seo-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasSeo"},cases:{true:{tagName:"jx-action-button",attributes:{part:"seo-button"},$props:{size:"sm",quiet:!0,label:"Search appearance",hint:"Preview how this page appears in search and when shared"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openSeo"},value:[]}]},children:[{tagName:"span",textContent:"Search appearance…"}]}}}]},{tagName:"div",attributes:{part:"body"},children:[{$prototype:"Array",items:{$ref:"$map/item/rows"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"row","data-prop":"${$map.item.prop}"},children:[{tagName:"div",attributes:{part:"row-label"},children:[{tagName:"div",attributes:{part:"chip-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/isSet"},cases:{true:{tagName:"button",attributes:{part:"chip",type:"button",title:"${$map.item.clearLabel}","aria-label":"${$map.item.clearLabel}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/clear"},value:[{$ref:"$map/item/key"}]}]}}}},{tagName:"span",attributes:{part:"row-name","aria-hidden":"true"},textContent:"${$map.item.label}"}]},{tagName:"div",attributes:{part:"widget-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/kind"},cases:{text:{tagName:"jx-textfield",attributes:{part:"widget"},$props:{size:"sm",label:"${$map.item.label}",placeholder:{$ref:"$map/item/placeholder"},value:{$ref:"$map/item/value"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editText"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/commitText"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},textarea:{tagName:"jx-textfield",attributes:{part:"widget"},$props:{size:"sm",multiline:!0,rows:3,label:"${$map.item.label}",placeholder:{$ref:"$map/item/placeholder"},value:{$ref:"$map/item/value"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editText"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/commitText"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},number:{tagName:"jx-number-field",attributes:{part:"widget"},$props:{size:"sm",label:"${$map.item.label}",value:{$ref:"$map/item/value"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setNumber"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},boolean:{tagName:"jx-checkbox",attributes:{part:"widget"},$props:{size:"sm",label:"${$map.item.label}",checked:{$ref:"$map/item/checked"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setBoolean"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/checked"}]}]}},readout:{$description:"A value the document derives rather than stores, such as a page's URL, which is its file's place under `pages/`. Shown, never edited here: an editable URL would be a rename, and a rename is the file tree's.",tagName:"output",attributes:{part:"readout","aria-label":"${$map.item.label}"},textContent:"${$map.item.value}"},select:{tagName:"jx-select",attributes:{part:"widget"},$props:{size:"sm",label:"${$map.item.label}",options:{$ref:"$map/item/options"},value:{$ref:"$map/item/value"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setChoice"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},media:{tagName:"div",attributes:{part:"media"},children:[{tagName:"div",attributes:{part:"thumb-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasThumb"},cases:{true:{tagName:"img",attributes:{part:"thumb",src:"${$map.item.thumb}",alt:""}}}},{tagName:"jx-textfield",attributes:{part:"widget"},$props:{size:"sm",label:"${$map.item.label}",placeholder:"/image.jpg",value:{$ref:"$map/item/value"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editText"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/commitText"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},{tagName:"jx-action-button",attributes:{part:"upload"},$props:{size:"sm",quiet:!0,icon:"upload-simple",label:"Upload media",hint:"Upload media"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/upload"},value:[{$ref:"$map/item/key"}]}]}},{tagName:"jx-action-button",attributes:{part:"browse"},$props:{size:"sm",quiet:!0,icon:"image",label:"Browse media",hint:"Browse media"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/browse"},value:[{$ref:"$map/item/key"},{$ref:"event#/currentTarget"}]}]}}]}}},{tagName:"div",attributes:{part:"action-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasAction"},cases:{true:{$description:"The row's one door elsewhere, named for what it opens: the Layout row's Edit template opens the layout in Design.",tagName:"jx-button",attributes:{part:"row-action"},$props:{size:"sm",variant:"secondary"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/runRowAction"},value:[{$ref:"$map/item/key"}]}]},children:[{tagName:"span",textContent:"${$map.item.action}"}]}}},{tagName:"div",attributes:{part:"note-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasNote"},cases:{true:{tagName:"p",attributes:{part:"note"},textContent:"${$map.item.note}"}}}]}}]}]}},{tagName:"div",attributes:{part:"section","data-section":"custom"},children:[{tagName:"div",attributes:{part:"section-header"},children:[{tagName:"span",attributes:{part:"title"},textContent:"Custom Tags"},{tagName:"span",attributes:{part:"count"},textContent:"${state.customCount}"}]},{tagName:"div",attributes:{part:"custom-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/customState"},cases:{empty:{tagName:"p",attributes:{part:"empty"},textContent:"Custom tags add your own meta, link and script elements to this page — analytics, verification, a webfont. Add one below."},listed:{tagName:"div",attributes:{part:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/customEntries"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"tag-row","data-tag":"${$map.item.key}"},children:[{tagName:"span",attributes:{part:"tag-name",title:"${$map.item.value}"},textContent:"${$map.item.label}"},{tagName:"span",attributes:{part:"tag-value"},textContent:"${$map.item.value}"},{tagName:"jx-action-button",attributes:{part:"remove"},$props:{icon:"x",size:"sm",quiet:!0,label:"${$map.item.removeLabel}",hint:"Remove"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/removeEntry"},value:[{$ref:"$map/item/key"}]}]}}]}}]}}},{tagName:"div",attributes:{part:"add","data-add":"tag"},children:[{tagName:"jx-select",attributes:{part:"tag-picker","data-field":"tag"},$props:{size:"sm",label:"Tag",options:{$ref:"#/state/tagOptions"},value:{$ref:"#/state/addTag"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editTag"},value:[{$ref:"event#/target/value"}]}]}},{tagName:"jx-textfield",attributes:{part:"field","data-field":"attr"},$props:{size:"sm",label:"Attribute",placeholder:"Attribute (e.g. name)",value:{$ref:"#/state/addAttr"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editAttr"},value:[{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{Enter:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/addEntry"},value:[]}]}}]}},{tagName:"jx-textfield",attributes:{part:"field","data-field":"value"},$props:{size:"sm",label:"Value",placeholder:"Value",value:{$ref:"#/state/addValue"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editValue"},value:[{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{Enter:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/addEntry"},value:[]}]}}]}},{tagName:"jx-action-button",attributes:{part:"add-button","data-add":"tag"},$props:{icon:"plus",size:"sm",quiet:!0,label:"Add tag",hint:"Add tag"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/addEntry"},value:[]}]}}]}]}]};E("panel-page",qe);function Ke(e,t){e.sections=t.sections,e.customCount=t.customCount,e.customState=t.customState,e.customEntries=t.customEntries,e.addTag=t.addTag,e.addAttr=t.addAttr,e.addValue=t.addValue,e.tagOptions=t.tagOptions}function ua(){return{addAttr:"",addTag:"",addValue:"",customCount:"0",customEntries:[],customState:"empty",sections:[],tagOptions:[]}}var G=new WeakMap;function Ye(e,t,a){let r=G.get(e);if(r&&(r.handle===null||r.handle.root.isConnected)){Ke(r.scope,t);return}r?.handle?.dispose(),e.textContent="";let i=g({...ua(),...a});Ke(i,t);let o={handle:null,scope:i};G.set(e,o),R("panel-page",i,e).then((s)=>{if(G.get(e)!==o){s.dispose();return}o.handle=s})}function de(e){let t=G.get(e);if(!t)return;G.delete(e),t.handle?.dispose(),e.textContent=""}var Xe={$schema:"https://jxsuite.com/schema/v1",$id:"StudioEmptyState",$description:"The one empty-state pattern (studio-ui-guidelines.md §11), as the document every region draws it from. Nine surfaces had already copied it into their own JSON — the Source Control panel's (since folded into `publish-workspace.json`), `logic-panel.json`, `panel-outline.json` and the rest each carry a `[part=\"empty\"]` block written from the same rules — because `panels/empty-state.ts` is a lit template a document cannot call. This is the copy those were waiting for: the region that has NO document of its own hands its box to this one instead of rendering the helper, so a shell with three surfaces still lit and eight converted has one empty state rather than two. The copy rules stay where they are stated, in `panels/empty-state.ts`'s header: one sentence saying what the region is FOR, the action that fills it, and one shared verb across equivalent surfaces. Nothing here decides any of them — the adapter is handed a message, an optional second sentence and a list of buttons, and this draws exactly that.",tagName:"div",attributes:{part:"empty","data-compact":"${state.compact ? '' : null}"},style:{$description:"What `.empty-state`, `.empty-state--teach`, `.empty-state-message`, `.empty-state-detail`, `.empty-state-actions`, `.empty-state-action` and the `--compact` pair said across `styles/overlays.css` and `styles/panels.css`, keyed on `part`. Neither stylesheet loses its rules: `ui/expression-editor.ts` still renders the lit helper for its own compact state, so this is a copy until that surface converts. Two values did not travel. `.empty-state`'s `font-size: 13px` was a number nothing else in the shell uses and is the kit's `--jx-text-md`; `.empty-state-detail`'s `var(--spectrum-font-size-50, 11px)` resolves only inside `<sp-theme>`, and a document mounted into a Navigator body or a canvas stage is outside it, so it would silently have taken its hard-coded fallback on every paint — it is `--jx-text-sm`, which is the step it was.",display:"flex",flexDirection:"column",alignItems:"center",gap:"var(--jx-space-3)",padding:"var(--jx-space-6)",textAlign:"center",color:"var(--fg-dim)",fontSize:"var(--jx-text-md)",'& [part="empty-message"]':{margin:"0",maxWidth:"34ch",lineHeight:"1.5"},'& [part="empty-detail"]':{$description:"The second sentence: where the region's content comes from. Dimmer than the first, because the first is the one a reader has to take in.",margin:"0",maxWidth:"34ch",fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)",opacity:"0.8"},'& [part="empty-actions"]':{display:"flex",flexWrap:"wrap",justifyContent:"center",gap:"var(--jx-space-3)"},'& [part="empty-action"]':{flex:"none"},"&[data-compact]":{$description:"An inline section inside an otherwise populated panel — tighter and left-aligned, because it sits directly above its own add form rather than filling a region on its own.",alignItems:"flex-start",gap:"var(--jx-space-2)",padding:"var(--jx-space-3) var(--jx-space-4)",textAlign:"left",fontSize:"var(--jx-text-sm)"},'&[data-compact] [part="empty-actions"]':{justifyContent:"flex-start"}},children:[{tagName:"p",attributes:{part:"empty-message"},textContent:"${state.message}"},{tagName:"div",attributes:{part:"empty-detail-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasDetail"},cases:{true:{tagName:"p",attributes:{part:"empty-detail"},textContent:"${state.detail}"}}},{tagName:"div",attributes:{part:"empty-actions-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasActions"},cases:{true:{tagName:"div",attributes:{part:"empty-actions"},children:[{$prototype:"Array",items:{$ref:"#/state/actions"},key:{$ref:"$map/item/id"},map:{tagName:"jx-button",attributes:{part:"empty-action"},$props:{size:"sm",variant:"secondary",disabled:{$ref:"$map/item/disabled"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/runAction"},value:[{$ref:"$map/item/id"}]}]},children:[{tagName:"span",textContent:"${$map.item.label}"}]}}]}}}]};E("empty-state",Xe);function fa(e){let t=document.createElement("div");t.style.display="contents";let a=[],r=g({...Qe(e),runAction:(s)=>{a[Number(s)]?.()}});a=et(e);let i=null,o=!1;return R("empty-state",r,t).then((s)=>{if(o){s.dispose();return}i=s}),{dispose(){o=!0,i?.dispose(),i=null,t.replaceChildren()},host:t,update(s){a=et(s),Object.assign(r,Qe(s))}}}function Qe(e){let t=e.actions??[];return{actions:t.map((a,r)=>({disabled:Boolean(a.disabled),id:String(r),label:a.label})),compact:Boolean(e.compact),detail:e.detail??"",hasActions:t.length>0,hasDetail:(e.detail??"")!=="",message:e.message}}function et(e){return(e.actions??[]).map((t)=>t.run)}var tt=new WeakMap;function Pu(e,t){let a=tt.get(e);if(a)return a.update(t),a.host;let r=fa(t);return tt.set(e,r),r.host}var at={$schema:"https://jxsuite.com/schema/v1",$id:"StudioEntryInspector",$description:"The Inspector's Entry tab (specs/studio.md §6, §22.5): one collection entry's own settings while it is written on the canvas, the Content-Entry board's sidebar. Its status (draft or published), its fields as the collection's schema types them, the URL its collection page publishes it at, and the file it is stored in. `content/entry-inspector.ts` keeps every decision; the field form is an island it fills, `ui/schema-form.ts`'s, the same form the form-only entry editor draws.",tagName:"div",attributes:{part:"entry","data-jx-region":"${state.region}"},style:{$description:"A column of sections, each a small uppercase heading over its rows, like the Page tab beside it.",display:"flex",flexDirection:"column",gap:"var(--jx-space-4)",padding:"var(--jx-space-3)",fontFamily:"var(--jx-font-sans)",fontSize:"var(--jx-text-md)",color:"var(--fg)",'& [part="section"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-2)"},'& [part="section-title"]':{margin:"0",fontSize:"var(--jx-text-sm)",fontWeight:"700",letterSpacing:"0.06em",textTransform:"uppercase",color:"var(--fg-dim)"},'& [part="head"]':{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:"var(--jx-space-2)"},'& [part="kind"]':{fontWeight:"600"},'& [part="status"]':{fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)"},'& [part="status"][data-draft="true"]':{color:"var(--warning)"},'& [part="note"]':{margin:"0",fontSize:"var(--jx-text-sm)",lineHeight:"1.5",color:"var(--fg-dim)"},'& [part="url"]':{fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-sm)",wordBreak:"break-all"},'& [part="path"]':{fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-sm)",color:"var(--fg)",wordBreak:"break-all"},'& [part="fields-head"]':{display:"flex",alignItems:"center",justifyContent:"space-between"}},children:[{tagName:"section",attributes:{part:"section","aria-labelledby":"entry-inspector-entry"},children:[{tagName:"div",attributes:{part:"head"},children:[{tagName:"h3",attributes:{part:"section-title",id:"entry-inspector-entry"},textContent:"Entry"},{tagName:"span",attributes:{part:"status","data-draft":"${state.draft ? 'true' : 'false'}"},textContent:"${state.status}"}]},{tagName:"span",attributes:{part:"kind"},textContent:"${state.kind}"},{tagName:"div",attributes:{part:"draft-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/draftAxis"},cases:{shown:{$description:"The entry's draft state, the one field every collection with a draft workflow shares (site-architecture.md §7.6). A setter: the switch names the state it reaches.",tagName:"jx-switch",attributes:{part:"draft"},$props:{checked:{$ref:"#/state/draft"},hint:"${state.draftHint}",size:"sm"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setDraft"},value:[{$ref:"event#/target/checked"}]}]},children:[{tagName:"span",textContent:"Draft"}]}}}]},{tagName:"section",attributes:{part:"section","aria-labelledby":"entry-inspector-fields"},children:[{tagName:"div",attributes:{part:"fields-head"},children:[{tagName:"h3",attributes:{part:"section-title",id:"entry-inspector-fields"},textContent:"Fields"},{tagName:"jx-action-button",attributes:{part:"edit-fields"},$props:{size:"sm",quiet:!0,hint:"Edit this collection's fields in Project Settings",haspopup:"dialog"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openFields"},value:[]}]},children:[{tagName:"span",textContent:"Edit"}]}]},{tagName:"div",attributes:{part:"fields-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/fieldsState"},cases:{form:{tagName:"div",attributes:{part:"fields"}},none:{tagName:"p",attributes:{part:"note"},textContent:"This collection declares no fields. Edit adds some in Project Settings."}}}]},{tagName:"section",attributes:{part:"section","aria-labelledby":"entry-inspector-page"},children:[{tagName:"div",attributes:{part:"fields-head"},children:[{tagName:"h3",attributes:{part:"section-title",id:"entry-inspector-page"},textContent:"Page"},{$description:"The door to Search appearance, the same `document.openSeo` the Page tab's button runs: an entry's search title, description and social image are its frontmatter too (studio.md §4.2).",tagName:"jx-action-button",attributes:{part:"seo-button"},$props:{size:"sm",quiet:!0,label:"Search appearance",hint:"Preview how this entry appears in search and when shared",haspopup:"dialog"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openSeo"},value:[]}]},children:[{tagName:"span",textContent:"Search appearance…"}]}]},{tagName:"div",attributes:{part:"url-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/urlState"},cases:{shown:{tagName:"code",attributes:{part:"url"},textContent:"${state.url}"},none:{tagName:"p",attributes:{part:"note"},textContent:"Entries of this collection have no page of their own."},unlisted:{$description:"The collection has a page, but the page lists the ids it publishes (`$paths.values`) and this entry is not one of them: naming a URL the build never writes would be a link to nothing.",tagName:"p",attributes:{part:"note"},textContent:"Not published: this collection's page lists the entries it publishes, and this is not one of them."},loading:{tagName:"p",attributes:{part:"note"},textContent:"Finding the page this entry is published at…"}}},{tagName:"p",attributes:{part:"note"},children:[{tagName:"span",textContent:"Stored as "},{tagName:"code",attributes:{part:"path"},textContent:"${state.path}"},{tagName:"span",textContent:"${state.storage}"}]}]}]};E("entry-inspector",at);function ga(e,t){e.region=t.region,e.kind=t.kind,e.status=t.status,e.draftAxis=t.draftAxis,e.draft=t.draft,e.draftHint=t.draftHint,e.fieldsState=t.fieldsState,e.urlState=t.urlState,e.url=t.url,e.path=t.path,e.storage=t.storage}function ba(e){let t=n(e)?void 0:e.attributes?.part;return n(t)?t:""}function rt(e,t,a,r){e.replaceChildren();let i=g({...t,...a}),o=null,s=!1,l=R("entry-inspector",i,e,{onNodeCreated:(c,d,f)=>{if(!s&&c instanceof HTMLElement&&ba(f)==="fields")r.fieldsSlot(c)}}).then((c)=>{if(s)c.dispose();else o=c;return c});return{attached:()=>{if(s)return!1;let c=o?.root;return c===void 0?!0:e.contains(c)},dispose(){s=!0,o?.dispose(),o=null},ready:l,update:(c)=>ga(i,c)}}var ya="inspector/entry";function ot(e){let t=Gn(e?.documentPath);return t!==null&&!t.fileBacked}function st(e){let t=e.documentPath??"",r=Gn(t)?.name??"",i=Sa(r),o=Ul(e),s=jc(i?.schema,o),l=Jl(o),c=r===""?null:sh(r,zc(t)),d=c?bC(c,t,o):null,f=t.endsWith(".json");return{draft:l,draftAxis:s?"shown":"hidden",draftHint:Tp,fieldsState:i?.schema?"form":"none",kind:Ub(Ql(r)?.item??"entry"),path:t,region:ya,status:s?l?"Draft":"Published":"",storage:f?". Its fields are the file itself.":". Fields are its frontmatter, and the body is its Markdown.",url:d??"",urlState:c===void 0?"loading":d?"shown":c?"unlisted":"none"}}var y=null;function lt(e,t){let a=Sa(Gn(t.documentPath)?.name??"");if(!e.formHost||!a?.schema)return;let r=Ul(t),i=Gl("entry-inspector",gT(a.schema,a.schema,r),r,{context:fT(t),errors:mT(a,r),onChange:(o)=>xS(t,o),rerender:e.redraw,ui:pT(a.schema)});if(i.parentNode!==e.formHost)e.formHost.replaceChildren(i)}function it(e,t){let a=st(t);if(a.fieldsState==="none")e.formHost=null;e.handle.update(a),lt(e,t)}function q(e){if(!y||e!==void 0&&y.host!==e)return;y.unlisten(),y.scope.stop(),y.handle.dispose(),y=null}function dt(e,t){if(y&&y.host===e&&y.tabId===t.id&&y.handle.attached()){it(y,t);return}q();let a=me(),r=()=>{if(y===i)it(i,t)},i={formHost:null,handle:rt(e,st(t),{openFields:()=>{let o=Gn(t.documentPath)?.name;nt("settings.open",o?{entry:o,section:"content"}:{section:"content"},"Entry")},openSeo:()=>{nt("document.openSeo",void 0,"Entry")},setDraft:(o)=>Tb(t,o)},{fieldsSlot:(o)=>{if(y===i)i.formHost=o,lt(i,t)}}),host:e,redraw:r,scope:a,tabId:t.id,unlisten:Ap(r)};y=i,a.run(()=>{te(()=>{t.doc.document,t.doc.content.frontmatter,C?.projectConfig?.content,r()})})}var O=null;async function bE(){try{O=(await p().listDirectory("layouts")).filter((a)=>a.type==="file"&&a.name.endsWith(".json")).map((a)=>({name:a.name.replace(/\.json$/,"").replaceAll(/[-_]+/g," ").replaceAll(/\b\w/g,(r)=>r.toUpperCase()),path:`./layouts/${a.name}`}))}catch{O=[]}return O}async function va(){await bE(),wn("rightPanel","seoModal")}function tw(){O=null,Ma()}function xa(){if(O===null)va();return O}var nw=[{attr:"name",key:"description",label:"Description"},{attr:"name",key:"viewport",label:"Viewport"}],iw=[{attr:"property",key:"og:title",label:"Title"},{attr:"property",key:"og:description",label:"Description",multiline:!0},{attr:"property",key:"og:image",label:"Image",media:!0},{attr:"property",key:"og:type",label:"Type"}],ct=new Set([...nw,...iw].map((e)=>e.key)),pt=new Set(["title"]);function wa(e){return He(e)?new Set([...pt,"description"]):pt}function vE(e){let t=ow(e.$head??[],"name","description");if(t)return String(t.attributes?.content??"");return n(e.description)?e.description:""}function V_(e,t){if(!ow(e.$head??[],"name","description")&&n(e.description)){if(t)e.description=t;else delete e.description;return}rw(e,"name","description",t)}function ow(e,t,a){return e.find((r)=>r?.tagName==="meta"&&r.attributes?.[t]===a)}function yE(e,t){return e.find((a)=>a?.tagName==="link"&&a.attributes?.rel===t)}function $a(e){if(!e?.tagName)return!1;if(e.tagName==="meta"){let t=String(e.attributes?.name??""),a=String(e.attributes?.property??"");return Boolean(t&&ct.has(t))||Boolean(a&&ct.has(a))}if(e.tagName==="link"&&e.attributes?.rel==="icon")return!0;return!1}function rw(e,t,a,r){if(!e.$head)e.$head=[];let i=e.$head.findIndex((o)=>o?.tagName==="meta"&&o.attributes?.[t]===a);if(r){let o={attributes:{[t]:a,content:r},tagName:"meta"};if(i!==-1)e.$head[i]=o;else e.$head.push(o)}else if(i!==-1)e.$head.splice(i,1)}function U_(e,t,a){if(!e.$head)e.$head=[];let r=e.$head.findIndex((i)=>i?.tagName==="link"&&i.attributes?.rel===t);if(a){let i={attributes:{href:a,rel:t},tagName:"link"};if(r!==-1)e.$head[r]=i;else e.$head.push(i)}else if(r!==-1)e.$head.splice(r,1)}function Ta(e){if(!e?.tagName)return"unknown";let t=e.attributes??{};if(t.name)return`<meta name="${String(t.name)}">`;if(t.property)return`<meta property="${String(t.property)}">`;if(t.rel&&t.href)return`<link rel="${String(t.rel)}">`;if(t.src)return`<script src="${String(t.src)}">`;if(t.charset)return`<meta charset="${String(t.charset)}">`;return`<${e.tagName}>`}function ka(e){let t=e?.attributes??{};return String(t.content??t.href??t.src??e?.textContent??"")}var yt="Jx Site",vt={donor:null,source:"none",value:""};function ke(e,t,a){let r=null;for(let i of e)if(i?.tagName==="meta"&&i.attributes?.[t]===a)r=String(i.attributes.content??"");return r}function K(e,t,a){let r=ke(e.page,t,a);if(r!==null)return{donor:null,source:"page",value:r};let i=ke(e.layout,t,a);if(i!==null)return{donor:e.layoutName??"the layout",source:"layout",value:i};let o=ke(e.site,t,a);if(o!==null)return{donor:"Site head",source:"site",value:o};return vt}function Ea(e,t){let a=e.trim();if(a)return{donor:null,source:"page",value:a};let r=t?.trim();if(r)return{donor:"Site name",source:"site",value:r};return{donor:"the build",source:"build",value:yt}}function Pa(e,t){let a=e??"",r=a.split("/").filter((s)=>s!=="");if(!t||e===null)return{crumb:a||"/",host:"",href:null};let i;try{i=new URL(a,t)}catch{return{crumb:a||"/",host:"",href:null}}let{host:o}=i;return{crumb:[o,...r].join(" › "),host:o,href:i.href}}var xt=new Map([["description",160],["og:description",200],["og:title",60],["title",60]]),Na=new Intl.Segmenter("en-US",{granularity:"grapheme"});function wE(e){let t=0;for(let a of Na.segment(e))t+=1;return t}var ut="Search appearance";function CD(e,t){yl((a)=>a.source===ut);for(let a of e.warnings){let r={action:"document.openSeo",key:`seo.${a.id}`,source:ut,tier:"problem"};if(t!==void 0)r.path=t;w.warn(a.message,r)}return e.warnings.length}function lb(e,t){return e.fields.find((a)=>a.key===t)??{...vt,key:t,label:t,limit:xt.get(t)??null}}function Ha(e){return[...e.site,...e.layout,...e.page].some((t)=>t?.tagName==="title")}function Ia(e,t){let a=[],r=(o)=>e.fields.find((s)=>s.key===o);if(r("title")?.source==="build")a.push({field:"title",id:"title-missing",message:`Neither this page nor the project names a title, so the build ships “${yt}”.`});if(r("description")?.value.trim()==="")a.push({field:"description",id:"description-missing",message:"No description reaches this page from the site, its layout or the page itself — a "+"result row shows whatever text the engine picks instead."});if(r("og:title")?.value.trim()==="")a.push({field:"og:title",id:"og-title-missing",message:"No og:title — a shared link carries no headline of its own."});if(r("og:description")?.value.trim()==="")a.push({field:"og:description",id:"og-description-missing",message:"No og:description — a shared link carries no summary of its own."});if(r("og:image")?.value.trim()==="")a.push({field:"og:image",id:"og-image-missing",message:"No og:image — a shared link renders as a text-only card."});for(let o of e.fields){let s=wE(o.value);if(o.limit!==null&&s>o.limit){let l=o.key.endsWith("description")?"summaries":"headlines";a.push({field:o.key,id:`${o.key}-long`,message:`${o.label} is ${s} characters; ${l} are cut near ${o.limit}.`})}}if(e.url.href===null)a.push({field:"url",id:"site-url-missing",message:"Project Settings names no site URL, so the build emits no canonical link and no og:url."});if(Ha(t))a.push({field:"title",id:"head-title-ignored",message:"A <title> element in $head is discarded — the build writes the title from the "+"document's own title property."});return a}function ja(e,t){let a=(s,l,c)=>({...c,key:s,label:l,limit:xt.get(s)??null}),r=[a("title","Title",Ea(t.pageTitle,t.siteName)),a("description","Description",K(e,"name","description")),a("og:title","Social title",K(e,"property","og:title")),a("og:description","Social description",K(e,"property","og:description")),a("og:image","Social image",K(e,"property","og:image")),a("og:type","Social type",K(e,"property","og:type"))],i=Pa(t.route,t.siteUrl),o={fields:r,url:i};return{...o,warnings:Ia(o,e)}}var Pe=null,Ne=[],Y=null;function Ma(){Pe=null,Ne=[],Y=null}async function Ca(e){if(Y===e)return;Y=e;let t=await Sx(e);if(Y!==e)return;Y=null,Pe=e,Ne=t?.$head??[],wn("seoModal")}function wt(e){return e.replace(/^\.\//,"").replace(/^layouts\//,"").replace(/\.json$/,"").replaceAll(/[-_/]+/g," ").replaceAll(/\b\w/g,(t)=>t.toUpperCase())||e}function Fa(e,t){let a=He(e)?hl(t):null;if(a===null)return{entries:[],name:null};let r=wt(a);if(a===Pe)return{entries:Ne,name:r};return Ca(a),{entries:[],name:r}}function xE(e,t){let a=C?.projectConfig,r=Fa(e,t.$layout),i=e?.documentPath,o={pageTitle:n(t.title)?t.title:"",route:i?cm(i):null};if(a?.name!==void 0)o.siteName=a.name;if(a?.url!==void 0)o.siteUrl=a.url;return ja({layout:r.entries,layoutName:r.name,page:We(t.$head??[],t.description),site:a?.$head??[]},o)}function He(e){let t=e?.documentPath;return Boolean(t&&C?.isSiteProject&&(t.startsWith("pages/")||t.startsWith("./pages/")))}function q_(e,t){let a={...e};if(t.title!==void 0)a.title=t.title;if(n(t.description))a.description=t.description;if(n(t.$layout)||t.$layout===!1)a.$layout=t.$layout;if(t.$head!==void 0)a.$head=t.$head;return a}function _E(e,t,a){if(!e)return;let r=e.doc.content.frontmatter,i=q_({},r).$head,o={};if(n(r.title))o.title=r.title;if(n(r.description))o.description=r.description;if(i)o.$head=[...i];if(n(r.$layout)||r.$layout===!1)o.$layout=r.$layout;a(o);let s=o.$head&&o.$head.length>0?o.$head:void 0,l=o.$layout!==r.$layout,c=o.title!==r.title,d=n(r.description)&&o.description!==r.description,f=JSON.stringify(s)!==JSON.stringify(i);if(l||c||d||f)Z(e,(b)=>{if(l)Qd(b,"$layout",n(o.$layout)||o.$layout===!1?o.$layout:void 0);if(c)Qd(b,"title",o.title);if(d)Qd(b,"description",n(o.description)?o.description:void 0);if(f)Qd(b,"$head",s)});t()}var k=null,N=null,ue="meta",Q="",ee="",S=new Map,Ie=new Map;function Aa(e){let t=e?.documentPath?cm(e.documentPath):null;if(t===null)return null;return{...j("__url","url","URL"),kind:"readout",value:t}}var Ee=new Map,D=new Map,Oa=[{label:"meta",value:"meta"},{label:"link",value:"link"},{label:"script",value:"script"}];function j(e,t,a){return{action:"",checked:!1,clearLabel:`Clear ${t}`,hasAction:!1,hasNote:!1,hasThumb:!1,isSet:!1,key:e,kind:"text",label:a,note:"",options:[],placeholder:"",prop:t,thumb:"",value:""}}function $t(e,t){e.hasThumb=t!==""&&oa.has(At(t)),e.thumb=e.hasThumb?Xc(t):""}function La(e,t){let a=n(e.title)?e.title:"";return S.set("title",{images:!1,clear:()=>t((r)=>{delete r.title}),commit:(r)=>t((i)=>{let o=String(r).trim();if(o)i.title=o;else delete i.title})}),{...j("title","title","Title"),clearLabel:"Clear title",isSet:Boolean(a),placeholder:"Page title…",value:a}}function mt(e,t,a){let r=String(ow(t,e.attr,e.key)?.attributes?.content??""),i=`meta:${e.attr}:${e.key}`;S.set(i,{images:e.media===!0,clear:()=>a((s)=>rw(s,e.attr,e.key,"")),commit:(s)=>a((l)=>rw(l,e.attr,e.key,e.media?String(s):String(s).trim()))});let o=j(i,e.key,e.label);if(o.isSet=Boolean(r),o.value=r,e.media)return o.kind="media",$t(o,r),o;return o.kind=e.multiline?"textarea":"text",o.placeholder=e.key==="viewport"?"width=device-width, initial-scale=1":`${e.label}…`,o}function Da(e,t){let a=vE(e),r="meta:name:description";S.set("meta:name:description",{images:!1,clear:()=>t((o)=>V_(o,"")),commit:(o)=>t((s)=>V_(s,String(o).trim()))});let i=j("meta:name:description","description","Description");return i.isSet=Boolean(a),i.value=a,i.kind="text",i.placeholder="Description…",i}function _a(e,t){let a=String(yE(e,"icon")?.attributes?.href??"");S.set("link:icon",{images:!0,clear:()=>t((i)=>U_(i,"icon","")),commit:(i)=>t((o)=>U_(o,"icon",String(i)))});let r=j("link:icon","icon","Icon");return r.isSet=Boolean(a),r.kind="media",r.value=a,$t(r,a),r}function Ja(e,t,a){if(!He(e))return null;let r=xa();if(r===null)return null;let i=t.$layout,o=C?.projectConfig?.defaults?.layout,s=o?wt(o):"";S.set("__layout",{images:!1,clear:()=>a((d)=>{delete d.$layout}),commit:(d)=>{let f=String(d);a((b)=>{if(f==="__default__")delete b.$layout;else if(f==="__none__")b.$layout=!1;else b.$layout=f}),pO()}});let l=j("__layout","layout","Layout");l.kind="select",l.isSet=i!==void 0,l.options=[{label:s?`Default (${s})`:"Default",value:"__default__"},{label:"None",value:"__none__"},...r.map((d)=>({label:d.name,value:d.path}))],l.value=i===!1?"__none__":i||"__default__";let c=hl(i);if(c)l.action="Edit template",l.hasAction=!0,Ie.set("__layout",()=>{(ce("t07yqqej"),import("./files-t07yqqej.js")).then(({openFileInTab:d})=>d(c.replace(/^\.\//,"")))});return{hasSeo:!1,key:"layout",rows:[l],title:"Layout"}}function Va(e){if(!e||e.doc.mode!=="content")return null;let{collection:t,fields:a,hasSchema:r,requiredFields:i}=ze(e,C?.projectConfig,wa(e));if(a.length===0&&!r)return null;return{hasSeo:!1,key:"frontmatter",rows:a.map((s)=>{let l=`fm:${s.field}`,{parse:c,row:d}=Ue(s.field,s.entry,s.value,i,{rerender:L});return S.set(l,{images:d.kind==="media"&&s.entry.format==="image",clear:()=>Z(e,(f)=>Qd(f,s.field)),commit:(f)=>Z(e,(b)=>Qd(b,s.field,c(f)))}),Object.assign(j(l,s.field,d.label),d,{clearLabel:`Clear ${s.field}`})}),title:t?`Frontmatter (${t.name})`:"Frontmatter"}}function Wa(e){Ee.clear();let t=[];for(let a of e){if($a(a)||ew(a)||Te(a))continue;let r=`tag:${t.length}`;Ee.set(r,a);let i=Ta(a);t.push({key:r,label:i,removeLabel:`Remove ${i}`,value:ka(a)})}return t}function za(e){S.clear(),Ie.clear();let t=h.value,a=e.document,r=a.$head??[],i=[],o=Va(t);if(o)i.push(o);let s=Ja(t,a,e.applyMutation);if(s)i.push(s);let l=Aa(t);i.push({hasSeo:!0,key:"page",rows:[La(a,e.applyMutation),...l?[l]:[],...nw.map((d)=>d.key==="description"?Da(a,e.applyMutation):mt(d,r,e.applyMutation)),_a(r,e.applyMutation)],title:"Page"},{hasSeo:!1,key:"opengraph",rows:iw.map((d)=>mt(d,r,e.applyMutation)),title:"OpenGraph"});let c=Wa(r);return{addAttr:Q,addTag:ue,addValue:ee,customCount:String(c.length),customEntries:c,customState:c.length===0?"empty":"listed",sections:i,tagOptions:Oa}}function L(){if(!k||!N)return;Ye(k,za(N),Ga)}function ft(){for(let{timer:e}of D.values())clearTimeout(e);D.clear()}function X(e){let t=D.get(e);if(t)clearTimeout(t.timer),D.delete(e)}function pe(e,t){X(e),S.get(e)?.commit(t)}function Ua(){let e=N,t=Q.trim(),a=ee.trim();if(!e||!t||!a)return;let r=ue||"meta";Q="",ee="",L();let i={attributes:{},tagName:r};if(r==="meta")i.attributes={content:a,name:t};else if(r==="link")i.attributes={href:a,rel:t};else if(r==="script")i.attributes={[t]:a};e.applyMutation((o)=>{if(!o.$head)o.$head=[];o.$head.push(i)}),e.rerender()}function Ba(e){let t=N,a=Ee.get(e);if(!t||!a)return;t.applyMutation((r)=>{if(!r.$head)return;let i=r.$head.indexOf(a);if(i!==-1)r.$head.splice(i,1)}),t.rerender()}var ht=null;function gt(){return ht??=(ce("s41ngdfr"),import("./media-picker-s41ngdfr.js")),ht}var Ga={addEntry:Ua,browse:(e,t)=>{X(e),gt().then((a)=>{if(t instanceof HTMLElement)a.showMediaPickerPopover(t,(r)=>{S.get(e)?.commit(r)},{images:S.get(e)?.images??!0})})},clear:(e)=>{X(e),S.get(e)?.clear()},commitText:(e,t)=>pe(e,t),editAttr:(e)=>{Q=e,L()},editText:(e,t)=>{X(e);let a=()=>{D.delete(e),S.get(e)?.commit(t)};D.set(e,{commit:a,timer:setTimeout(a,tf)})},editTag:(e)=>{ue=e,L()},editValue:(e)=>{ee=e,L()},openSeo:()=>{ae()?.run("document.openSeo")},removeEntry:Ba,runRowAction:(e)=>{Ie.get(e)?.()},setBoolean:(e,t)=>pe(e,t),setChoice:(e,t)=>pe(e,t),setNumber:(e,t)=>pe(e,t),upload:(e)=>{X(e),gt().then((t)=>{t.pickAndUpload((a)=>{S.get(e)?.commit(a)})})}};function qa(e,t){if(e!==k)ue="meta",Q="",ee="",ft();if(t.document!==N?.document)ft();k=e,N=t,L()}function SE(e){if(!e)return"Document";if(e.startsWith("pages/"))return"Page";if(e.startsWith("layouts/"))return"Template";if(e.startsWith("components/"))return"Component";let t=Gn(e);return t&&!t.fileBacked?"Entry":"Document"}var Ka="A component has no page settings: its title, search and social details come from the page that uses it.";function Ya(e){return{actions:[{label:"Edit tag and props",run:()=>{vl(e,{selection:[[]],ui:{rightTab:"properties"}})}}],detail:"Its tag name and the props it takes are set on its root element.",message:Ka}}var kD="Open a page to edit its title, description and social preview.",I=null;function CE(e){if(I&&I!==e){if(q(I),de(I),k===I)k=null,N=null}I=e,sw()}function sw(){let e=I;if(!e)return;let t=h.value;if(!t||ot(t)){if(de(e),k===e)k=null,N=null;if(t)dt(e,t);else q(e);return}if(q(e),SE(t.documentPath)==="Component"){if(de(e),k===e)k=null,N=null;let r=Pu(e,Ya(t));if(e.firstChild!==r||e.childNodes.length!==1)e.replaceChildren(r);return}let a=t.doc.mode==="content";qa(e,{applyMutation:a?(r)=>_E(h.value,sw,r):(r)=>{Yd(h.value,r)},document:a?q_(t.doc.document,t.doc.content.frontmatter):t.doc.document,rerender:sw})}
|
|
4
|
+
export{ew,vD,yD,wD,xD,sb,fE,Nc,_D,mE,Mu,SD,cm,$d,ab,gE,Pu,bE,tw,nw,iw,vE,V_,ow,yE,rw,U_,wE,CD,lb,xE,q_,_E,SE,kD,CE,sw};
|
|
5
|
+
|
|
6
|
+
//# debugId=8E3A3F4E5831B1DE64756E2164756E21
|
|
7
|
+
//# sourceMappingURL=studio-s9fng7m8.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{g}from"./studio-3qr08sxq.js";import{Y}from"./studio-k3we3kqb.js";var d={assertive:"jx-live-assertive",polite:"jx-live-polite"};function l(t){if(typeof document>"u")return null;let i=d[t],n=document.querySelector(`#${i}`);if(n)return n;let e=document.createElement("div");return e.id=i,e.setAttribute("aria-live",t),e.setAttribute("role",t==="assertive"?"alert":"status"),e.setAttribute("aria-atomic","true"),e.style.cssText="position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;border:0",document.body.append(e),e}function Lh(t,i="polite"){if(t==="")return;let n=l(i);if(!n)return;n.textContent="",setTimeout(()=>{n.textContent=t},0)}var rf=60000,a=null;function ar(){return a??Date.now()}function BM(t){let i=t instanceof Date?t.getTime():Y(t)?t:Date.parse(t);if(!Number.isFinite(i))throw TypeError(`clock: cannot pin to ${JSON.stringify(t)}`);return a=i,i}var p={error:"problem",info:"toast",success:"toast",warn:"toast"},m={error:8000,info:4000,success:4000,warn:8000},u=0;function y(){return u+=1,`n${u}`}var iu=g([]),ta=g([]),x=4;function b(t){return t==="problem"?ta:iu}function v(t,i,n,e){let r={at:ar(),id:y(),message:i,severity:t,tier:n};if(e.action!==void 0)r.action=e.action;if(e.actionArgs!==void 0)r.actionArgs=e.actionArgs;if(e.detail!==void 0)r.detail=e.detail;if(e.source!==void 0)r.source=e.source;if(e.path!==void 0)r.path=e.path;if(e.key!==void 0)r.key=e.key;if(n==="toast")r.timeoutMs=e.timeoutMs??m[t];return r}function w(t,i,n={}){let e=n.tier??p[t],r=v(t,i,e,n),s=b(e);if(r.key!==void 0){let c=s.findIndex((f)=>f.key===r.key);if(c!==-1)s.splice(c,1)}if(s.push(r),e==="toast")while(iu.length>x)iu.shift();return Lh(r.source===void 0?r.message:`${r.source}: ${r.message}`,t==="error"?"assertive":"polite"),r}function o(t){return(i,n={})=>w(t,i,n)}w.success=o("success");w.info=o("info");w.warn=o("warn");w.error=o("error");function $h(t){for(let i of[iu,ta]){let n=i.findIndex((e)=>e.id===t);if(n!==-1)return i.splice(n,1),!0}return!1}function yl(t){let i=t?ta.filter((e)=>!t(e)):[],n=ta.length-i.length;return ta.splice(0,ta.length,...i),n}function sf(t){let i=[];for(let n of ta){if(n.source!==t)continue;let e={message:n.message,severity:n.severity};if(n.detail!==void 0)e.detail=n.detail;if(n.path!==void 0)e.path=n.path;if(n.key!==void 0)e.key=n.key;if(n.action!==void 0)e.action=n.action;if(n.actionArgs!==void 0)e.actionArgs=n.actionArgs;i.push(e)}return i}function Iv(t){return t===void 0?ta.length:ta.filter((i)=>i.severity===t).length}export{Lh,rf,ar,BM,iu,ta,w,$h,yl,sf,Iv};
|
|
2
|
+
|
|
3
|
+
//# debugId=DC733AA9F3078EE964756E2164756E21
|
|
4
|
+
//# sourceMappingURL=studio-sce30r7b.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{p}from"./studio-
|
|
2
|
-
`}function f(e,{slug:t,adapter:o}){if(!e)return{content:P({adapter:o,slug:t}),patched:!0};let n=
|
|
3
|
-
`,patched:!0}}function zl(){try{return Q(p().cfApi)}catch{return!1}}async function l(e,t){let o=p().cfApi;if(!o)throw Error("This platform cannot reach the Cloudflare API");try{return await o(e,t)}catch(n){throw Im(n),n}}async function cN(){return l("/accounts")}async function A(e,t){try{return await l(`/accounts/${e}/pages/projects/${t}`)}catch{return null}}async function I(e){let t={build_command:"bunx jx build",destination_dir:"dist"};if(e.rootDir)t.root_dir=e.rootDir;return l(`/accounts/${e.accountId}/pages/projects`,{method:"POST",body:{name:e.projectName,production_branch:e.productionBranch,build_config:t,source:{type:"github",config:{owner:e.owner,repo_name:e.repo,production_branch:e.productionBranch,deployments_enabled:!0}}}})}function _(e){let t={id:e.id,url:e.url,environment:e.environment,stage:e.latest_stage?.name??"unknown",status:e.latest_stage?.status??"unknown",createdOn:e.created_on},o=e.deployment_trigger?.metadata?.branch;if(o)t.branch=o;return t}async function UT(e){return(await l(`/accounts/${e.accountId}/pages/projects/${e.projectName}/deployments`)).map((o)=>_(o))}async function Cb(e){let[t]=await UT(e);return t??null}async function qT(e,t){let o={...e.build};if(t===null)delete o.deploy;else o.deploy=t;if(await no({build:o}),t!==null){let n=p(),i=null;try{i=await n.readFile("wrangler.jsonc")}catch{i=null}let x=o.adapter==="cloudflare-workers"?"cloudflare-workers":"cloudflare-pages",{content:v,patched:D}=f(i,{adapter:x,slug:t.projectName});if(D)await n.writeFile("wrangler.jsonc",v)}}async function dN(e,t){let n=await A(t.accountId,t.projectName)??await I(t),i={provider:"cloudflare-pages",accountId:t.accountId,projectName:t.projectName};if(n.subdomain)i.productionUrl=`https://${n.subdomain}`;return await qT(e,i),i}var h={$schema:"https://jxsuite.com/schema/v1",$id:"StudioPanelDeployChecklist",$description:"The deploy checklist, drawn above the Activity feed in the Bottom dock's Activity tab: what is MISSING before this project can ship, as one row with the chain of prerequisites under it. `publish/deploy-checklist.ts` owns the chain — which link is forged, which is merely unasked, and which command forges the next one — and hands this document a row, four steps and at most one action. Nothing here reads source control, the project config or the command registry. It draws in the Activity tab's own vocabulary because a deploy is an ordered list of stages that finish, which is exactly what a row of that feed already is; a fifth visual idiom for it would be a second design of a thing the tab has.",tagName:"div",attributes:{part:"checklist"},style:{$description:"What `.activity-list`, `.activity-row`, `.activity-row--running`, `.activity-row--done`, `.activity-icon`, `.activity-body`, `.activity-head`, `.activity-title`, `.activity-source`, `.activity-status`, `.activity-steps`, `.activity-step`, `.activity-step--done` and `.activity-step-icon` said in `styles/panels.css`, keyed on `part`. This is the LAST reader of those rules — `surfaces/panel-activity.json` carried its own copy when the feed converted, and left the stylesheet standing because this file still drew from it — so the whole `.problem-*, .activity-*` block is dead once this lands. Three token names could not travel: `--spectrum-font-size-50`, `--spectrum-font-size-75` and `--spectrum-corner-radius-75` resolve only inside `<sp-theme>`, and a document mounted into the dock body is outside it, so each would silently have taken its hard-coded px fallback. They are the kit's own scale here. One thing changed meaning on purpose: the step's `data-state` is the checklist's own three-valued state rather than the two CSS classes it used to collapse into, so `unknown` — \"nobody has asked\" — is a state the styling can tell apart from `todo` the day it should.",display:"block",minWidth:"0",fontFamily:"var(--jx-font-sans)",color:"var(--fg)",'& [part="list"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-1)",margin:"0",padding:"0",listStyle:"none"},'& [part="row"]':{$description:"The left border is the state, at 3px, which is the one thing that must be legible without reading the row. Its default is the dim foreground so a state nobody has a colour for still draws a border rather than a gap.",display:"flex",alignItems:"flex-start",gap:"var(--jx-space-2)",padding:"6px var(--jx-space-2)",border:"1px solid var(--border)",borderLeft:"3px solid var(--fg-dim)",borderRadius:"var(--radius)",background:"var(--bg-panel)",color:"var(--fg)",fontSize:"var(--jx-text-md)"},'& [part="row"][data-state="running"]':{borderLeftColor:"var(--accent)"},'& [part="row"][data-state="done"]':{borderLeftColor:"var(--success)"},'& [part="state-icon"]':{$description:'Named `state-icon` rather than `icon`: `jx-button` puts `part="icon"` on the glyph slot of every button it draws, and the action button below is inside this same light-DOM tree — a rule on the bare name would reach into the kit\'s own drawing and a devtools query could not tell the two apart.',flex:"none",width:"14px",textAlign:"center",fontWeight:"700",lineHeight:"1.5"},'& [part="row"][data-state="running"] > [part="state-icon"]':{color:"var(--accent)"},'& [part="row"][data-state="done"] > [part="state-icon"]':{color:"var(--success)"},'& [part="row-body"]':{flex:"1",minWidth:"0",display:"flex",flexDirection:"column",alignItems:"flex-start",gap:"2px"},'& [part="head"]':{display:"flex",alignItems:"baseline",gap:"var(--jx-space-2)",alignSelf:"stretch",minWidth:"0"},'& [part="row-title"]':{fontWeight:"700",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},'& [part="source"]':{$description:"Pushed to the far edge, so the tab reads as a column of who raised what.",flex:"none",marginLeft:"auto",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"},'& [part="summary"]':{color:"var(--fg-dim)",overflowWrap:"anywhere"},'& [part="steps"]':{$description:'The chain, declared up front, so "which link is missing" is answered by looking rather than by reading the summary and remembering what came before it.',display:"flex",flexDirection:"column",gap:"1px",margin:"2px 0 0",padding:"0",listStyle:"none",fontSize:"var(--jx-text-sm)"},'& [part="step"]':{display:"flex",gap:"6px",color:"var(--fg-dim)"},'& [part="step"][data-state="done"] > [part="step-icon"]':{color:"var(--success)"},'& [part="step-icon"]':{flex:"none","--jx-icon-size":"1em",marginBlockEnd:"-0.15em"},'& [part="action"]':{marginTop:"var(--jx-space-1)"}},children:[{tagName:"div",attributes:{part:"body-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasProject"},cases:{true:{tagName:"ul",attributes:{part:"list"},children:[{tagName:"li",attributes:{part:"row","data-state":"${state.rowState}"},children:[{tagName:"span",attributes:{part:"state-icon","aria-hidden":"true"},textContent:"${state.rowIcon}"},{tagName:"div",attributes:{part:"row-body"},children:[{tagName:"div",attributes:{part:"head"},children:[{tagName:"span",attributes:{part:"row-title"},textContent:"Deploy checklist"},{tagName:"span",attributes:{part:"source"},textContent:"Publish"}]},{tagName:"div",attributes:{part:"summary"},textContent:"${state.summary}"},{tagName:"ol",attributes:{part:"steps"},children:[{$prototype:"Array",items:{$ref:"#/state/steps"},key:{$ref:"$map/item/id"},map:{tagName:"li",attributes:{part:"step","data-step":"${$map.item.id}","data-state":"${$map.item.state}"},children:[{tagName:"jx-icon",attributes:{part:"step-icon"},$props:{name:{$ref:"$map/item/icon"},label:{$ref:"$map/item/iconLabel"}}},{tagName:"span",attributes:{part:"step-text"},textContent:"${$map.item.text}"}]}}]},{tagName:"span",attributes:{part:"action-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasAction"},cases:{true:{tagName:"jx-button",$description:"The recovery button wears the command's own title, so it reads as a verb rather than as a decoration, and a refused command is dimmed with the reason it names in its tooltip. A command the registry does not have, or whose `when` is false, draws NOTHING rather than a dead label — a surface may choose whether to show a command, never whether it exists (§13).",$props:{size:"sm",disabled:{$ref:"#/state/actionDisabled"}},attributes:{part:"action",title:"${state.actionTitle}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/runAction"},value:[]}]},children:[{tagName:"span",textContent:"${state.actionLabel}"}]}}}]}]}]}}}]};T("panel-deploy-checklist",h);var d=null,c=null,s=null,r=null;function O(e,t){e.hasProject=t.hasProject,e.rowState=t.rowState,e.rowIcon=t.rowIcon,e.summary=t.summary,e.steps=t.steps,e.hasAction=t.hasAction,e.actionLabel=t.actionLabel,e.actionTitle=t.actionTitle,e.actionDisabled=t.actionDisabled}function J(e){if(d!==e)return!1;return r===null?s!==null:r.root.parentNode===e}function y(e,t){if(J(e))return;m(),d=e;let o=g({actionDisabled:!1,actionLabel:"",actionTitle:"",hasAction:!1,hasProject:!1,rowIcon:"",rowState:"running",runAction:t.runAction,steps:[],summary:""});c=ge(),c.run(()=>{ne(()=>{O(o,t.project())})});let n=R("panel-deploy-checklist",o,e);s=n,n.then((i)=>{if(s===n)r=i;else i.dispose()})}function m(){c?.stop(),c=null;let e=s;if(s=null,r)r.dispose(),r=null;else if(e)e.then((t)=>t.dispose());d=null}function L(){return S?.projectConfig??null}function Ri(){return L()?.build?.deploy}var a=xv({asked:!1,observed:null});function Ad(e){a.observed=e,a.asked=!0}function GT(){return a.observed}function V(){let{status:e}=u.git;if(e===null)return{command:"git.init",detail:"Source control has not reported on this project yet.",id:"repo",label:"Track this project with git",state:"unknown"};return e.isRepo?{command:"git.init",detail:`Tracked${e.branch?` — on branch ${e.branch}`:""}.`,id:"repo",label:"Track this project with git",state:"done"}:{command:"git.init",detail:"A deploy ships what the repository holds, so the repository comes first.",id:"repo",label:"Track this project with git",state:"todo"}}function W(){let{status:e}=u.git;if(e===null||!e.isRepo)return{command:"git.createGithubRepository",detail:"A remote is where the provider builds from.",id:"remote",label:"Push to a remote",state:e===null?"unknown":"todo"};if((e.remotes??[]).length===0)return{command:"git.createGithubRepository",detail:"This repository is local only — nothing outside this machine can build it.",id:"remote",label:"Push to a remote",state:"todo"};return e.ahead>0?{command:"git.push",detail:`${e.ahead} commit(s) are not on ${e.remotes[0]} yet, so a build would ship the older tree.`,id:"remote",label:"Push to a remote",state:"todo"}:{command:"git.push",detail:`Up to date with ${e.remotes[0]}.`,id:"remote",label:"Push to a remote",state:"done"}}function E(){let e=Ri();if(e)return{command:"publish.setUp",detail:`Cloudflare Pages project ${e.projectName}.`,id:"provider",label:"Connect a deploy provider",state:"done"};return zl()?{command:"publish.setUp",detail:"Connecting one makes every commit build and publish on its own.",id:"provider",label:"Connect a deploy provider",state:"todo"}:{command:"publish.setUp",detail:"This platform cannot reach the Cloudflare API. Commit and push instead — your host "+"runs bunx jx build and serves dist/.",id:"provider",label:"Connect a deploy provider",state:"unknown"}}function B(){if(!Ri())return{command:"publish.deploy",detail:"Nothing has been deployed, because no provider is connected.",id:"deployed",label:"Deploy",state:"todo"};if(!a.asked)return{command:"publish.deploy",detail:"Cloudflare has not been asked yet, so this is not a claim that nothing shipped.",id:"deployed",label:"Deploy",state:"unknown"};if(a.observed===null)return{command:"publish.deploy",detail:"Cloudflare reports no deployments for this project.",id:"deployed",label:"Deploy",state:"todo"};let{observed:e}=a;return e.status==="success"?{command:"publish.deploy",detail:`${e.environment} — ${e.url}`,id:"deployed",label:"Deploy",state:"done"}:{command:"publish.deploy",detail:`Last deployment ${e.stage}: ${e.status}.`,id:"deployed",label:"Deploy",state:"todo"}}function w(){return[V(),W(),E(),B()]}function SS(){return w().find((e)=>e.state!=="done")??null}function uN(){if(!S)return null;let e=SS();if(e)return{command:e.command,label:e.label,title:e.detail};return{command:"publish.openDashboard",label:"Deployed",title:Ri()?.productionUrl??"Everything this project needs to ship is in place."}}var b={done:{icon:"check",label:"Done"},todo:{icon:"warning-circle",label:"To do"},unknown:{icon:"question",label:"Not checked yet"}};function H(e){return{icon:b[e.state].icon,iconLabel:b[e.state].label,id:e.id,state:e.state,text:e.state==="done"?e.label:`${e.label} — ${e.detail}`}}function F(e){let t={actionDisabled:!1,actionLabel:"",actionTitle:"",hasAction:!1};if(!e)return t;let o=ae(),n=o?.get(e.command);if(!o||!n||!o.isVisible(e.command))return t;let i=o.disabledReason(e.command);return{actionDisabled:i!==void 0,actionLabel:n.title,actionTitle:i?`${n.title} — requires ${i}`:n.title,hasAction:!0}}function KT(){if(!S)return{actionDisabled:!1,actionLabel:"",actionTitle:"",hasAction:!1,hasProject:!1,rowIcon:"",rowState:"running",steps:[],summary:""};let e=w(),t=e.find((o)=>o.state!=="done")??null;return{...F(t),hasProject:!0,rowIcon:t?"⋯":"✓",rowState:t?"running":"done",steps:e.map((o)=>H(o)),summary:t?t.detail:"Everything this project needs to ship is in place."}}function z(){let e=SS();if(!e)return;ae()?.run(e.command)}var M={project:KT,runAction:z};function hN(e){let t=e.querySelector("[data-deploy-checklist]");if(!t){m();return}y(t,M)}
|
|
4
|
-
export{
|
|
1
|
+
import{p}from"./studio-4fnb5648.js";import{Am}from"./studio-xpx91fby.js";import{ae}from"./studio-wqfaqw4m.js";import{no,u}from"./studio-x0gsfr1d.js";import{C}from"./studio-4f7thq0p.js";import{E,R}from"./studio-9dq7rwc7.js";import{me,te,g,Wv}from"./studio-3qr08sxq.js";import{Q}from"./studio-k3we3kqb.js";function S(e){return JSON.parse(e)}function j(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function k(e){try{let t=S(e);return j(t)?t:void 0}catch{return}}function P({slug:e,adapter:t}){let o=new Date().toISOString().slice(0,10);return`${JSON.stringify(t==="cloudflare-workers"?{assets:{binding:"ASSETS",directory:"./dist"},compatibility_date:o,compatibility_flags:["nodejs_compat"],main:"./dist/worker.js",name:e}:{compatibility_date:o,compatibility_flags:["nodejs_compat"],name:e,pages_build_output_dir:"./dist"},null,"\t")}
|
|
2
|
+
`}function f(e,{slug:t,adapter:o}){if(!e)return{content:P({adapter:o,slug:t}),patched:!0};let n=k(e);if(n===void 0)return{content:e,patched:!1};if(n.name=t,o==="cloudflare-workers")delete n.pages_build_output_dir,n.main="./dist/worker.js",n.assets={binding:"ASSETS",directory:"./dist"};else delete n.main,delete n.assets,n.pages_build_output_dir="./dist";return{content:`${JSON.stringify(n,null,"\t")}
|
|
3
|
+
`,patched:!0}}function Zl(){try{return Q(p().cfApi)}catch{return!1}}async function l(e,t){let o=p().cfApi;if(!o)throw Error("This platform cannot reach the Cloudflare API");try{return await o(e,t)}catch(n){throw Am(n),n}}async function sA(){return l("/accounts")}async function A(e,t){try{return await l(`/accounts/${e}/pages/projects/${t}`)}catch{return null}}async function I(e){let t={build_command:"bunx jx build",destination_dir:"dist"};if(e.rootDir)t.root_dir=e.rootDir;return l(`/accounts/${e.accountId}/pages/projects`,{method:"POST",body:{name:e.projectName,production_branch:e.productionBranch,build_config:t,source:{type:"github",config:{owner:e.owner,repo_name:e.repo,production_branch:e.productionBranch,deployments_enabled:!0}}}})}function _(e){let t={id:e.id,url:e.url,environment:e.environment,stage:e.latest_stage?.name??"unknown",status:e.latest_stage?.status??"unknown",createdOn:e.created_on},o=e.deployment_trigger?.metadata?.branch;if(o)t.branch=o;return t}async function IL(e){return(await l(`/accounts/${e.accountId}/pages/projects/${e.projectName}/deployments`)).map((o)=>_(o))}async function Hb(e){let[t]=await IL(e);return t??null}async function RL(e,t){let o={...e.build};if(t===null)delete o.deploy;else o.deploy=t;if(await no({build:o}),t!==null){let n=p(),i=null;try{i=await n.readFile("wrangler.jsonc")}catch{i=null}let x=o.adapter==="cloudflare-workers"?"cloudflare-workers":"cloudflare-pages",{content:v,patched:D}=f(i,{adapter:x,slug:t.projectName});if(D)await n.writeFile("wrangler.jsonc",v)}}async function aA(e,t){let n=await A(t.accountId,t.projectName)??await I(t),i={provider:"cloudflare-pages",accountId:t.accountId,projectName:t.projectName};if(n.subdomain)i.productionUrl=`https://${n.subdomain}`;return await RL(e,i),i}var h={$schema:"https://jxsuite.com/schema/v1",$id:"StudioPanelDeployChecklist",$description:"The deploy checklist, drawn above the Activity feed in the Bottom dock's Activity tab: what is MISSING before this project can ship, as one row with the chain of prerequisites under it. `publish/deploy-checklist.ts` owns the chain — which link is forged, which is merely unasked, and which command forges the next one — and hands this document a row, four steps and at most one action. Nothing here reads source control, the project config or the command registry. It draws in the Activity tab's own vocabulary because a deploy is an ordered list of stages that finish, which is exactly what a row of that feed already is; a fifth visual idiom for it would be a second design of a thing the tab has.",tagName:"div",attributes:{part:"checklist"},style:{$description:"What `.activity-list`, `.activity-row`, `.activity-row--running`, `.activity-row--done`, `.activity-icon`, `.activity-body`, `.activity-head`, `.activity-title`, `.activity-source`, `.activity-status`, `.activity-steps`, `.activity-step`, `.activity-step--done` and `.activity-step-icon` said in `styles/panels.css`, keyed on `part`. This is the LAST reader of those rules — `surfaces/panel-activity.json` carried its own copy when the feed converted, and left the stylesheet standing because this file still drew from it — so the whole `.problem-*, .activity-*` block is dead once this lands. Three token names could not travel: `--spectrum-font-size-50`, `--spectrum-font-size-75` and `--spectrum-corner-radius-75` resolve only inside `<sp-theme>`, and a document mounted into the dock body is outside it, so each would silently have taken its hard-coded px fallback. They are the kit's own scale here. One thing changed meaning on purpose: the step's `data-state` is the checklist's own three-valued state rather than the two CSS classes it used to collapse into, so `unknown` — \"nobody has asked\" — is a state the styling can tell apart from `todo` the day it should.",display:"block",minWidth:"0",fontFamily:"var(--jx-font-sans)",color:"var(--fg)",'& [part="list"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-1)",margin:"0",padding:"0",listStyle:"none"},'& [part="row"]':{$description:"The left border is the state, at 3px, which is the one thing that must be legible without reading the row. Its default is the dim foreground so a state nobody has a colour for still draws a border rather than a gap.",display:"flex",alignItems:"flex-start",gap:"var(--jx-space-2)",padding:"6px var(--jx-space-2)",border:"1px solid var(--border)",borderLeft:"3px solid var(--fg-dim)",borderRadius:"var(--radius)",background:"var(--bg-panel)",color:"var(--fg)",fontSize:"var(--jx-text-md)"},'& [part="row"][data-state="running"]':{borderLeftColor:"var(--accent)"},'& [part="row"][data-state="done"]':{borderLeftColor:"var(--success)"},'& [part="state-icon"]':{$description:'Named `state-icon` rather than `icon`: `jx-button` puts `part="icon"` on the glyph slot of every button it draws, and the action button below is inside this same light-DOM tree — a rule on the bare name would reach into the kit\'s own drawing and a devtools query could not tell the two apart.',flex:"none",width:"14px",textAlign:"center",fontWeight:"700",lineHeight:"1.5"},'& [part="row"][data-state="running"] > [part="state-icon"]':{color:"var(--accent)"},'& [part="row"][data-state="done"] > [part="state-icon"]':{color:"var(--success)"},'& [part="row-body"]':{flex:"1",minWidth:"0",display:"flex",flexDirection:"column",alignItems:"flex-start",gap:"2px"},'& [part="head"]':{display:"flex",alignItems:"baseline",gap:"var(--jx-space-2)",alignSelf:"stretch",minWidth:"0"},'& [part="row-title"]':{fontWeight:"700",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},'& [part="source"]':{$description:"Pushed to the far edge, so the tab reads as a column of who raised what.",flex:"none",marginLeft:"auto",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"},'& [part="summary"]':{color:"var(--fg-dim)",overflowWrap:"anywhere"},'& [part="steps"]':{$description:'The chain, declared up front, so "which link is missing" is answered by looking rather than by reading the summary and remembering what came before it.',display:"flex",flexDirection:"column",gap:"1px",margin:"2px 0 0",padding:"0",listStyle:"none",fontSize:"var(--jx-text-sm)"},'& [part="step"]':{display:"flex",gap:"6px",color:"var(--fg-dim)"},'& [part="step"][data-state="done"] > [part="step-icon"]':{color:"var(--success)"},'& [part="step-icon"]':{flex:"none","--jx-icon-size":"1em",marginBlockEnd:"-0.15em"},'& [part="action"]':{marginTop:"var(--jx-space-1)"}},children:[{tagName:"div",attributes:{part:"body-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasProject"},cases:{true:{tagName:"ul",attributes:{part:"list"},children:[{tagName:"li",attributes:{part:"row","data-state":"${state.rowState}"},children:[{tagName:"span",attributes:{part:"state-icon","aria-hidden":"true"},textContent:"${state.rowIcon}"},{tagName:"div",attributes:{part:"row-body"},children:[{tagName:"div",attributes:{part:"head"},children:[{tagName:"span",attributes:{part:"row-title"},textContent:"Deploy checklist"},{tagName:"span",attributes:{part:"source"},textContent:"Publish"}]},{tagName:"div",attributes:{part:"summary"},textContent:"${state.summary}"},{tagName:"ol",attributes:{part:"steps"},children:[{$prototype:"Array",items:{$ref:"#/state/steps"},key:{$ref:"$map/item/id"},map:{tagName:"li",attributes:{part:"step","data-step":"${$map.item.id}","data-state":"${$map.item.state}"},children:[{tagName:"jx-icon",attributes:{part:"step-icon"},$props:{name:{$ref:"$map/item/icon"},label:{$ref:"$map/item/iconLabel"}}},{tagName:"span",attributes:{part:"step-text"},textContent:"${$map.item.text}"}]}}]},{tagName:"span",attributes:{part:"action-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasAction"},cases:{true:{tagName:"jx-button",$description:"The recovery button wears the command's own title, so it reads as a verb rather than as a decoration, and a refused command is dimmed with the reason it names in its tooltip. A command the registry does not have, or whose `when` is false, draws NOTHING rather than a dead label — a surface may choose whether to show a command, never whether it exists (§13).",$props:{size:"sm",disabled:{$ref:"#/state/actionDisabled"}},attributes:{part:"action",title:"${state.actionTitle}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/runAction"},value:[]}]},children:[{tagName:"span",textContent:"${state.actionLabel}"}]}}}]}]}]}}}]};E("panel-deploy-checklist",h);var d=null,c=null,s=null,r=null;function T(e,t){e.hasProject=t.hasProject,e.rowState=t.rowState,e.rowIcon=t.rowIcon,e.summary=t.summary,e.steps=t.steps,e.hasAction=t.hasAction,e.actionLabel=t.actionLabel,e.actionTitle=t.actionTitle,e.actionDisabled=t.actionDisabled}function O(e){if(d!==e)return!1;return r===null?s!==null:r.root.parentNode===e}function y(e,t){if(O(e))return;m(),d=e;let o=g({actionDisabled:!1,actionLabel:"",actionTitle:"",hasAction:!1,hasProject:!1,rowIcon:"",rowState:"running",runAction:t.runAction,steps:[],summary:""});c=me(),c.run(()=>{te(()=>{T(o,t.project())})});let n=R("panel-deploy-checklist",o,e);s=n,n.then((i)=>{if(s===n)r=i;else i.dispose()})}function m(){c?.stop(),c=null;let e=s;if(s=null,r)r.dispose(),r=null;else if(e)e.then((t)=>t.dispose());d=null}function J(){return C?.projectConfig??null}function Ri(){return J()?.build?.deploy}var a=Wv({asked:!1,observed:null});function jd(e){a.observed=e,a.asked=!0}function DL(){return a.observed}function L(){let{status:e}=u.git;if(e===null)return{command:"git.init",detail:"Source control has not reported on this project yet.",id:"repo",label:"Track this project with git",state:"unknown"};return e.isRepo?{command:"git.init",detail:`Tracked${e.branch?` — on branch ${e.branch}`:""}.`,id:"repo",label:"Track this project with git",state:"done"}:{command:"git.init",detail:"A deploy ships what the repository holds, so the repository comes first.",id:"repo",label:"Track this project with git",state:"todo"}}function V(){let{status:e}=u.git;if(e===null||!e.isRepo)return{command:"git.createGithubRepository",detail:"A remote is where the provider builds from.",id:"remote",label:"Push to a remote",state:e===null?"unknown":"todo"};if((e.remotes??[]).length===0)return{command:"git.createGithubRepository",detail:"This repository is local only — nothing outside this machine can build it.",id:"remote",label:"Push to a remote",state:"todo"};return e.ahead>0?{command:"git.push",detail:`${e.ahead} commit(s) are not on ${e.remotes[0]} yet, so a build would ship the older tree.`,id:"remote",label:"Push to a remote",state:"todo"}:{command:"git.push",detail:`Up to date with ${e.remotes[0]}.`,id:"remote",label:"Push to a remote",state:"done"}}function W(){let e=Ri();if(e)return{command:"publish.setUp",detail:`Cloudflare Pages project ${e.projectName}.`,id:"provider",label:"Connect a deploy provider",state:"done"};return Zl()?{command:"publish.setUp",detail:"Connecting one makes every commit build and publish on its own.",id:"provider",label:"Connect a deploy provider",state:"todo"}:{command:"publish.setUp",detail:"This platform cannot reach the Cloudflare API. Commit and push instead — your host "+"runs bunx jx build and serves dist/.",id:"provider",label:"Connect a deploy provider",state:"unknown"}}function B(){if(!Ri())return{command:"publish.deploy",detail:"Nothing has been deployed, because no provider is connected.",id:"deployed",label:"Deploy",state:"todo"};if(!a.asked)return{command:"publish.deploy",detail:"Cloudflare has not been asked yet, so this is not a claim that nothing shipped.",id:"deployed",label:"Deploy",state:"unknown"};if(a.observed===null)return{command:"publish.deploy",detail:"Cloudflare reports no deployments for this project.",id:"deployed",label:"Deploy",state:"todo"};let{observed:e}=a;return e.status==="success"?{command:"publish.deploy",detail:`${e.environment} — ${e.url}`,id:"deployed",label:"Deploy",state:"done"}:{command:"publish.deploy",detail:`Last deployment ${e.stage}: ${e.status}.`,id:"deployed",label:"Deploy",state:"todo"}}function w(){return[L(),V(),W(),B()]}function nC(){return w().find((e)=>e.state!=="done")??null}function lA(){if(!C)return null;let e=nC();if(e)return{command:e.command,label:e.label,title:e.detail};return{command:"publish.openDashboard",label:"Deployed",title:Ri()?.productionUrl??"Everything this project needs to ship is in place."}}var b={done:{icon:"check",label:"Done"},todo:{icon:"warning-circle",label:"To do"},unknown:{icon:"question",label:"Not checked yet"}};function H(e){return{icon:b[e.state].icon,iconLabel:b[e.state].label,id:e.id,state:e.state,text:e.state==="done"?e.label:`${e.label} — ${e.detail}`}}function F(e){let t={actionDisabled:!1,actionLabel:"",actionTitle:"",hasAction:!1};if(!e)return t;let o=ae(),n=o?.get(e.command);if(!o||!n||!o.isVisible(e.command))return t;let i=o.disabledReason(e.command);return{actionDisabled:i!==void 0,actionLabel:n.title,actionTitle:i?`${n.title} — requires ${i}`:n.title,hasAction:!0}}function NL(){if(!C)return{actionDisabled:!1,actionLabel:"",actionTitle:"",hasAction:!1,hasProject:!1,rowIcon:"",rowState:"running",steps:[],summary:""};let e=w(),t=e.find((o)=>o.state!=="done")??null;return{...F(t),hasProject:!0,rowIcon:t?"⋯":"✓",rowState:t?"running":"done",steps:e.map((o)=>H(o)),summary:t?t.detail:"Everything this project needs to ship is in place."}}function z(){let e=nC();if(!e)return;ae()?.run(e.command)}var M={project:NL,runAction:z};function cA(e){let t=e.querySelector("[data-deploy-checklist]");if(!t){m();return}y(t,M)}
|
|
4
|
+
export{Zl,sA,IL,Hb,RL,aA,Ri,jd,DL,nC,lA,NL,cA};
|
|
5
5
|
|
|
6
|
-
//# debugId=
|
|
7
|
-
//# sourceMappingURL=studio-
|
|
6
|
+
//# debugId=AF8336C5EDFC6E0364756E2164756E21
|
|
7
|
+
//# sourceMappingURL=studio-stahswgb.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{w}from"./studio-sce30r7b.js";import{le}from"./studio-3qr08sxq.js";import{Q,_}from"./studio-k3we3kqb.js";var st={functionEditor:null,blockActionBarEl:null,selDragCleanup:null,dndCleanups:[],elementsCollapsed:new Set,elementsFilter:"",_currentDropTargetRow:null,layerDragSourceHeight:0,_completionRegistered:!1,_layersCollapsed:null};var m=0;function DM(){return m+=1,m}var l=new Map;function bo(e){let r=l.get(e);if(!r)r=v(e),l.set(e,r);return r}function v(e){return{centerObserver:null,monacoDiffEditor:null,monacoEditor:null,needsCenter:!0,panX:0,panY:0,panels:[],paneId:e,panzoomWrap:null,stage:null,prevCanvasMode:null,prevStylebookCustomizedOnly:null,prevStylebookFilter:null,renderGeneration:0,sourceCollabCleanup:null,stageScrollbar:null,wrap:null}}function Ch(e){return e.wrap}function Zp(){return[...l.values()]}function nd(e){if(!e)return null;for(let r of l.values())if(Ch(r)?.contains(e))return r;return null}function g(e){for(let r of e.panels)r.renderScope?.stop(),r.renderScope=null;e.panels.length=0,e.prevCanvasMode=null}function NM(e,r){let t=bo(e);return t.wrap=r,g(t),t}function AM(e){if(l.get(e))EI(e);let t=v(e);return l.set(e,t),t}var S=null;function OM(e){S=e}function EI(e){let r=l.get(e);if(!r)return;S?.(r),g(r),y(e)}function y(e){l.delete(e)}var Xp="commit";function b(e){return _(e)&&Q(e.then)}function Ev(e){let r=new Map,t=new Map,o=new Map,a=!1,u=!1,c=!1;function f(n,i){if(!b(i))return i;let s=i.finally(()=>{if(o.get(n)===s)o.delete(n)});return o.set(n,s),s}let d={arm(n,i,s){clearTimeout(r.get(n)),t.set(n,s),r.set(n,setTimeout(()=>{r.delete(n),t.delete(n),f(n,s())},i))},cancel(){for(let n of r.values())clearTimeout(n);r.clear(),t.clear()},flush(n){let i=t.get(n);if(!i)return o.get(n);return clearTimeout(r.get(n)),r.delete(n),t.delete(n),f(n,i())},ahead:()=>a,markAhead(){a=!0},typed:()=>u,markTyped(){a=!0,u=!0},markSettled(){a=!1,u=!1},shared:()=>c,markShared(){c=!0}};return e._writes=d,d}var T={logic:{holds:"The handler you were typing",reached:"written into",source:"Logic"},source:{holds:"The source you were typing",reached:"parsed into",source:"Editor"}};function p(e,r,t){if(e._writes?.typed()!==!0)return!0;let a=e._editingTab??null,u=a?.documentPath??"Untitled",{holds:c,reached:f,source:d}=T[r],n=t?{detail:h(t.error)}:{};if(n.key=`buffer-discarded:${r}:${a?.id??"none"}`,n.source=d,a?.documentPath)n.path=a.documentPath;return w.warn(`${c} was discarded — it was never ${f} "${u}".`,n),!1}function h(e){return e instanceof Error?e.stack??e.message:String(e)}function Tv(e,r){let t=e?._writes;if(!e||!t)return!0;let o;try{o=t.flush(Xp)}catch(a){return t.cancel(),p(e,r,{error:a})}if(t.cancel(),b(o))return o.then(()=>p(e,r,null),(a)=>p(e,r,{error:a})),!0;return p(e,r,null)}function TI(e){e?._writes?.cancel()}function tu(e){return Boolean(e?.getModel())}function Qp(e,r){if(!tu(e)||e.hasTextFocus()||e._writes?.ahead()||e._writes?.shared())return!0;return r!==void 0&&e.getValue()!==r}function C(e){let r=le(e);return[...Zp().map((o)=>o.monacoEditor),st.functionEditor].filter((o)=>o!=null&&o._editingTab!=null&&le(o._editingTab)===r&&tu(o))}async function nu(e){for(let r of C(e)){if(!tu(r))continue;try{await r._writes?.flush(Xp)}catch(t){let o={detail:h(t),key:`buffer-commit:${e.id}`,source:"Editor"};if(e.documentPath)o.path=e.documentPath;w.error(`Could not save the editor's contents into "${e.documentPath??"Untitled"}".`,o)}}}function ef(e){return C(e).some((r)=>r._writes?.typed()===!0)}
|
|
2
|
+
export{st,DM,bo,Ch,Zp,nd,NM,AM,OM,EI,Xp,Ev,Tv,TI,tu,Qp,nu,ef};
|
|
3
|
+
|
|
4
|
+
//# debugId=9B21F4536E53C8D664756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-swedpd82.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{p,ye}from"./studio-4fnb5648.js";import{X}from"./studio-9c6cbq2c.js";import{La,oI}from"./studio-4zd6an2b.js";import{w,yl,sf}from"./studio-sce30r7b.js";import{KO,ea,uI,Ra,Z,Zd,Zm,_r,i0,o0,m,h,Si}from"./studio-yrcrncev.js";import{jt,ou,Wi,lf,fn,lr,AI,Oa,OI}from"./studio-aam8zt8z.js";import{Ud}from"./studio-bct64zmj.js";import{zd}from"./studio-y1b86ast.js";import{ls,al,$L,Xu}from"./studio-ggx3j7nd.js";import{UI,t2,n2,Ah,Bv}from"./studio-nzemfbkk.js";import{qo}from"./studio-tpxcryf2.js";import{ka,DA,a$}from"./studio-53wy9ek3.js";import{Es,Co}from"./studio-x0gsfr1d.js";import{sl}from"./studio-a65kbs2e.js";import{KN}from"./studio-nskxe9q1.js";import{oe}from"./studio-v5wktj6f.js";import{me,ia,te,g,le}from"./studio-3qr08sxq.js";import{n,Y,Ze,_,v}from"./studio-k3we3kqb.js";function ie(e,o=[]){if(e?.tagName==="slot"){let s=e.attributes?.name;o.push(n(s)?s.trim():"")}if(Array.isArray(e?.children))for(let s of e.children)ie(n(s)?void 0:s,o);return o}function VS(e){let o=ie(e),s=o.filter((r)=>r==="").length;if(s>1)return`Component has ${s} unnamed <slot> elements — only one default slot is allowed. Give extra slots a name attribute.`;let l=new Set;for(let r of o){if(r&&l.has(r))return`Duplicate slot name "${r}" — slot names must be unique within a component.`;l.add(r)}return null}var se={invokerTags:Bv,popoverTags:Ah},D="Popover",Se={display:"document.repairPopoverDisplay","open-display":"document.repairPopoverDisplay",invoker:"document.repairPopoverInvoker",mode:"document.repairPopoverMode"};function ae(e,o,s,l){let r=`${o}.${s}.${l.join("/")}`,d=e.get(r)??0;return e.set(r,d+1),d===0?r:`${r}#${d}`}function W(e,o){yl((d)=>d.source===D);let s=new Map,l=t2(e,se);for(let d of l){let c=d.fix===void 0?void 0:Se[d.fix],C={detail:d.detail,key:ae(s,"popover",d.rule,d.path),source:D,tier:"problem"};if(c!==void 0)C.action=c,C.actionArgs={path:d.path};if(o!==void 0)C.path=o;w(d.severity,d.message,C)}let r=DA(e,se);for(let d of r){let c={detail:d.detail,key:ae(s,"dialog",d.rule,d.path),source:D,tier:"problem"};if(o!==void 0)c.path=o;w(d.severity,d.message,c)}return l.length+r.length}function z(e,o){let s=o?.path;if(!Array.isArray(s))throw RangeError(`command "${e}" needs a "path" argument naming the popover`);return s}function J(e){let o=h.value;if(!o)throw RangeError(`command "${e}" needs an open document`);return o}function xe(){return[{category:"Document",group:"2_document",id:"document.checkPopovers",level:"document",menus:["palette"],requires:"an open document",run:()=>{let e=J("document.checkPopovers"),o=W(e.doc.document,e.documentPath??void 0);w.success(o===0?"No popover problems found in this document.":`${o} popover problem(s) filed.`,{key:"popover.run",source:D})},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=sf(D),o=e.length;return{data:e,summary:o===0?"No popover problems found in this document.":`Filed ${o} popover problem${o===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,o)=>{let l=J("document.repairPopoverDisplay"),r=z("document.repairPopoverDisplay",o),d=oe(l.doc.document,r),c=n2(d?.style);if(!c)throw RangeError(`command "${"document.repairPopoverDisplay"}": nothing to move — this popover sets no display`);Z(l,(C)=>{for(let b of c.base)Zm(C,r,b,"");for(let b of c.breakpoints)o0(C,r,[b],"display","");if(c.openDisplay!==null)i0(C,r,":popover-open","display",c.openDisplay)}),w.success("Moved `display` into `:popover-open`.",{key:"popover.repaired.display",source:D})},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,o)=>{let l=J("document.repairPopoverInvoker"),r=z("document.repairPopoverInvoker",o);Z(l,(d)=>{_r(d,r,"popovertarget"),_r(d,r,"popovertargetaction")}),w.success("Removed the attributes, which did nothing on this element.",{key:"popover.repaired.invoker",source:D})},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,o)=>{let l=J("document.repairPopoverMode"),r=z("document.repairPopoverMode",o);Z(l,(d)=>{_r(d,r,"popover",UI)}),w.success(`Set \`popover\` to "${UI}".`,{key:"popover.repaired.mode",source:D})},title:"Set popover to auto",when:(e)=>e.document.open}]}function WN(e){e.registerAll(xe())}function zw(e,o){if(e===o)return!0;if(Array.isArray(e)&&Array.isArray(o))return e.length===o.length&&e.every((s,l)=>s===o[l]);if(_(e)&&_(o)&&!Array.isArray(e)&&!Array.isArray(o))return e.$ref===o.$ref;return!1}var N="grid://",Nb={children:[],tagName:"div"};function ss(e){switch(e.kind){case"pages":return`${N}pages`;case"collection":return`${N}collection/${encodeURIComponent(e.name)}`;default:return`${N}data/${encodeURIComponent(e.connection)}/${encodeURIComponent(e.table)}`}}function Pe(e){return e.startsWith(N)}function Yl(e){if(!Pe(e))return null;let o=e.slice(N.length).split("/");if(o[0]==="pages"&&o.length===1)return{kind:"pages"};if(o[0]==="collection"&&o.length===2&&o[1])return{kind:"collection",name:decodeURIComponent(o[1])};if(o[0]==="data"&&o.length===3&&o[1]&&o[2])return{connection:decodeURIComponent(o[1]),kind:"data",table:decodeURIComponent(o[2])};return null}function $m(e){let o=Yl(e);if(!o)return null;switch(o.kind){case"pages":return"Pages · grid";case"collection":return`${o.name} · grid`;default:return`${o.table} @ ${o.connection} · grid`}}var ce=0;function de(e){let o=e.coalesceMs??800,s=e.now??(()=>Date.now()),r=g({deletes:new Set,errors:new Map,inserts:new Map,pending:new Map,redoStack:[],stale:new Set,undoStack:[]}),d=null,c=(t,i,a)=>{let u=r.errors.get(t);if(u)u.set(i,a);else r.errors.set(t,new Map([[i,a]]))},C=(t,i)=>{let a=r.errors.get(t);if(a?.delete(i),a?.size===0)r.errors.delete(t)},b=(t)=>{if(r.redoStack.length=0,d){d.push(t);return}let i=r.undoStack.at(-1);if(t.kind==="cell"&&i?.kind==="cell"&&i.rowKey===t.rowKey&&i.field===t.field&&t.at-i.at<=o){i.after=t.after,i.at=t.at;return}r.undoStack.push(t)},k=(t,i,a)=>{let u=r.inserts.get(t);if(u){if(a===null)delete u[i];else u[i]=a;return}if(zw(a,e.resolveBaseline(t,i))){let f=r.pending.get(t);if(f?.delete(i),f?.size===0)r.pending.delete(t);return}let y=r.pending.get(t);if(y)y.set(i,{value:a});else r.pending.set(t,new Map([[i,{value:a}]]))},P=(t,i)=>{let a=r.inserts.get(t);if(a)return a[i]??null;let u=r.pending.get(t)?.get(i);return u?u.value:e.resolveBaseline(t,i)},O=(t,i)=>{let a=r.errors.get(t);return a?.get(i)??a?.get("*")??null},M=(t,i)=>{switch(t.kind){case"cell":{k(t.rowKey,t.field,i==="undo"?t.before:t.after);break}case"insert":{if(i==="undo")r.inserts.delete(t.tempKey);else r.inserts.set(t.tempKey,{...t.cells});break}case"drop-insert":{if(i==="undo")r.inserts.set(t.tempKey,{...t.cells});else r.inserts.delete(t.tempKey);break}case"delete":{if(i==="undo")r.deletes.delete(t.rowKey);else r.deletes.add(t.rowKey);break}default:{let a=i==="undo"?t.ops.toReversed():t.ops;for(let u of a)M(u,i);break}}},F=()=>{if(d)throw Error("edit-buffer: groups may not nest");d=[]},x=()=>{let t=d;if(d=null,!t)return;if(t.length===1)r.undoStack.push(t[0]);else if(t.length>1)r.undoStack.push({kind:"group",ops:t})},E=(t)=>{let i=(a)=>{switch(a.kind){case"cell":return t(a.rowKey)?null:a;case"insert":case"drop-insert":return t(a.tempKey)?null:a;case"delete":return t(a.rowKey)?null:a;default:{let u=a.ops.map((y)=>i(y)).filter((y)=>y!==null);return u.length>0?{kind:"group",ops:u}:null}}};r.undoStack=r.undoStack.map(i).filter((a)=>a!==null),r.redoStack=r.redoStack.map(i).filter((a)=>a!==null)};return{applyCommitResult(t){let i=new Set;for(let a of t.cells)if(a.ok){let u=r.pending.get(a.rowKey);if(u?.delete(a.field),u?.size===0)r.pending.delete(a.rowKey);C(a.rowKey,a.field)}else if(c(a.rowKey,a.field,a.error??"Save failed"),a.stale)r.stale.add(a.rowKey);for(let a of t.inserts)if(a.ok)r.inserts.delete(a.tempKey),r.errors.delete(a.tempKey),i.add(a.tempKey);else c(a.tempKey,"*",a.error??"Insert failed");for(let a of t.deletes)if(a.ok)r.deletes.delete(a.rowKey),r.pending.delete(a.rowKey),r.errors.delete(a.rowKey),i.add(a.rowKey);else if(c(a.rowKey,"*",a.error??"Delete failed"),a.stale)r.stale.add(a.rowKey);for(let a of i)r.stale.delete(a);if(i.size>0)E((a)=>i.has(a))},buildBatch(){let t=[];for(let[i,a]of r.pending){if(r.deletes.has(i))continue;for(let[u,y]of a)t.push({baseline:e.resolveBaseline(i,u),field:u,rowKey:i,value:y.value})}return{cells:t,deletes:[...r.deletes].map((i)=>({rowKey:i})),inserts:[...r.inserts].map(([i,a])=>({cells:{...a},tempKey:i}))}},canRedo:()=>r.redoStack.length>0,canUndo:()=>r.undoStack.length>0,cellError:O,cellState(t,i){if(O(t,i)!==null)return"error";if(r.stale.has(t))return"stale";if(r.inserts.has(t)||r.pending.get(t)?.has(i))return"dirty";return"clean"},deleteRow(t){if(r.deletes.has(t))return;let i=r.inserts.get(t);if(i){let a={...i};r.inserts.delete(t),r.errors.delete(t),r.stale.delete(t),b({cells:a,kind:"drop-insert",tempKey:t});return}r.deletes.add(t),b({kind:"delete",rowKey:t})},dirtyCount(){let t=r.inserts.size+r.deletes.size;for(let[i,a]of r.pending)if(!r.deletes.has(i))t+=a.size;return t},discardRow(t){r.pending.delete(t),r.deletes.delete(t),r.inserts.delete(t),r.errors.delete(t),r.stale.delete(t),E((i)=>i===t)},effectiveValue:P,beginGroup:F,endGroup:x,group(t){F();try{t()}finally{x()}},insertRow(t={}){ce+=1;let i=`__new-${ce}`;return r.inserts.set(i,{...t}),b({cells:{...t},kind:"insert",tempKey:i}),i},isDirty:()=>r.pending.size>0||r.inserts.size>0||r.deletes.size>0,isInsertKey:(t)=>r.inserts.has(t),markStale(t){for(let i of t)r.stale.add(i)},redo(){let t=r.redoStack.pop();if(!t)return!1;return M(t,"redo"),r.undoStack.push(t),!0},reset(){r.pending.clear(),r.inserts.clear(),r.deletes.clear(),r.errors.clear(),r.stale.clear(),r.undoStack.length=0,r.redoStack.length=0},rowState(t){if(r.deletes.has(t))return"pending-delete";if(r.inserts.has(t))return"pending-insert";if(r.stale.has(t))return"stale";if(r.pending.has(t)||r.errors.has(t))return"dirty";return"clean"},setCell(t,i,a){let u=P(t,i);if(zw(u,a))return;k(t,i,a),b({after:a,at:s(),before:u,field:i,kind:"cell",rowKey:t})},state:r,undo(){let t=r.undoStack.pop();if(!t)return!1;return M(t,"undo"),r.redoStack.push(t),!0}}}var ue={array:220,boolean:70,date:130,enum:140,image:180,number:110,readonly:200,reference:200,string:180,text:340};function fe(e){return Math.min(340,Math.max(90,Math.round(e*7.5)))}function Ge(e){if(e.$ref)return"reference";if(e.enum!==void 0&&Array.isArray(e.enum))return"enum";let o=e.type==="array"?void 0:e.format;if(Ra(o))return"image";if(o==="date"||o==="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 pe(e){let o=e.replaceAll(/([a-z0-9])([A-Z])/g,"$1 $2").replaceAll(/[_-]+/g," ").trim();return o.charAt(0).toUpperCase()+o.slice(1)}function Ww(e,o={}){let s=Object.entries(e?.properties??{}),l=new Set(e?.required),r=new Set(o.readonlyFields),d=s.map(([c,C])=>{let b=r.has(c)?"readonly":Ge(C),k=Array.isArray(C.enum)?Math.max(...C.enum.map((P)=>String(P).length),4):0;return{editable:b!=="readonly",field:c,kind:b,pk:c===o.idField,required:l.has(c),schema:C,title:pe(c),widthHint:b==="enum"?fe(k+3):ue[b]}});return d.sort((c,C)=>{let b=(P)=>P.pk?0:P.required?1:2,k=b(c)-b(C);return k===0?0:k}),d}function Vw(e,o=50){let s=e.slice(0,o),l=[];for(let r of s)for(let d of Object.keys(r))if(!l.includes(d))l.push(d);return l.map((r)=>{let d=s.flatMap((b)=>{let k=b[r];return k===null||k===void 0||k===""?[]:[k]}),c=Re(d),C=Math.max(...d.map((b)=>Qo(b).length),r.length,4);return{editable:!0,field:r,kind:c,title:pe(r),widthHint:c==="string"||c==="text"?fe(C):ue[c]}})}function Re(e){if(e.length===0)return"string";if(e.some((s)=>Array.isArray(s)))return"array";let o=e.map(String);if(e.every((s)=>Ze(s))||o.every((s)=>/^(true|false)$/i.test(s)))return"boolean";if(e.every((s)=>Y(s))||o.every((s)=>s.trim()!==""&&!Number.isNaN(Number(s.replaceAll(/[$€£¥,\s]/g,"")))))return"number";if(o.every((s)=>/^\d{4}-\d{2}-\d{2}([T ].*)?$/.test(s)))return"date";if(o.some((s)=>s.length>200))return"text";return"string"}function Lp(e,o){if(e===null||e===void 0)return null;switch(o.kind){case"number":{if(Y(e))return Number.isNaN(e)?null:e;let s=String(e).trim().replaceAll(/[$€£¥,\s]/g,"");if(s==="")return null;let l=Number(s);return Number.isNaN(l)?null:l}case"boolean":{if(Ze(e))return e;return String(e).trim().toLowerCase()==="true"}case"array":{if(Array.isArray(e))return e.map(String);let s=String(e).trim();return s===""?[]:s.split(",").map((l)=>l.trim()).filter(Boolean)}case"reference":{if(v(e)&&"$ref"in e){let l=e.$ref;return n(l)&&l!==""?l:null}let s=String(e).trim();return s===""?null:s}default:{let s=String(e);return s===""?null:s}}}function Qo(e){if(e===null||e===void 0)return"";if(Array.isArray(e))return e.join(", ");if(_(e))return e.$ref;return String(e)}var WS="__key",H=new WeakMap;function er(e){return e?H.get(le(e))??null:null}function $p(e,o){let l=g({columns:[],error:null,grouping:null,loading:!1,query:{},rows:[],saving:!1,total:0}),r=new Map,d=(t)=>{r=new Map(t.map((i)=>[i.key,i]))},c=de({resolveBaseline:(t,i)=>r.get(t)?.cells[i]??null}),C=async()=>{let t=await o.rows(l.query);d(t.rows),l.rows=t.rows,l.total=t.total},b=(t)=>{let i=l.columns.filter((y)=>y.required&&y.editable);if(i.length===0)return null;let a=t.cells.filter((y)=>y.value===null&&i.some((f)=>f.field===y.field)).map((y)=>({error:"Required",field:y.field,ok:!1,rowKey:y.rowKey})),u=t.inserts.filter((y)=>i.some((f)=>y.cells[f.field]===null||y.cells[f.field]===void 0)).map((y)=>({error:`Missing required: ${i.filter((G)=>y.cells[G.field]===null||y.cells[G.field]===void 0).map((G)=>G.field).join(", ")}`,ok:!1,tempKey:y.tempKey}));if(a.length===0&&u.length===0)return null;return{cells:a,deletes:[],inserts:u}},k=(t)=>t===null||t===""||Array.isArray(t)&&t.length===0,P=(t,i,a)=>{if(a==="number")return(Y(t)?t:0)-(Y(i)?i:0);if(a==="boolean")return(t===!0?1:0)-(i===!0?1:0);return Qo(t).localeCompare(Qo(i))},O=()=>{let t=l.rows.map((u)=>u.key),{dir:i,orderBy:a}=l.query;if(a&&!o.capabilities.remoteSort){let u=l.columns.find((f)=>f.field===a)?.kind,y=i==="desc"?-1:1;t=t.toSorted((f,G)=>{let R=c.effectiveValue(f,a),U=c.effectiveValue(G,a);if(k(R)!==k(U))return k(R)?1:-1;return y*P(R,U,u)})}return l.grouping?[...M(t).values()].flat():t},M=(t)=>{let i=new Map;for(let a of t){let u=Qo(c.effectiveValue(a,l.grouping)),y=i.get(u);if(y)y.push(a);else i.set(u,[a])}return i},F=null,x=()=>F?.refreshData(),E={addRow(t={}){let i=c.insertRow(t);return x(),i},bindView(t){F=t},buffer:c,deleteRows(t){if(t.length===0)return;c.group(()=>{for(let i of t)c.deleteRow(i)}),x()},discardRow(t){c.discardRow(t),x()},replaceAll(t,i){if(t==="")return 0;let a=l.columns.filter((f)=>f.editable&&(f.kind==="string"||f.kind==="text")),u=[...l.rows.map((f)=>f.key),...c.state.inserts.keys()],y=0;if(c.group(()=>{for(let f of u){if(c.rowState(f)==="pending-delete")continue;for(let G of a){let R=c.effectiveValue(f,G.field);if(n(R)&&R.includes(t))c.setCell(f,G.field,R.replaceAll(t,i)),y+=1}}}),y>0)x();return y},effectiveRows(){let t=(u)=>Array.isArray(u)?[...u]:_(u)?{$ref:u.$ref}:u,i=(u)=>{let y=[[WS,u]];for(let f of l.columns)y.push([f.field,t(c.effectiveValue(u,f.field))]);return Object.fromEntries(y)},a=O().map((u)=>i(u));for(let[u]of c.state.inserts)a.push(i(u));return a},groups(){if(!l.grouping)return[];return[...M(O())].map(([t,i])=>({count:i.length,value:t}))},async load(){l.loading=!0,l.error=null;try{l.columns=await o.columns(),await C()}catch(t){l.error=X(t)}finally{l.loading=!1}x()},async refresh(){if(c.isDirty()){if(!await qo("Refresh Grid",`Discard ${c.dirtyCount()} pending change(s) and reload?`,{confirmLabel:"Discard & Reload",destructive:!0}))return}c.reset(),await o.refresh?.(),await this.load()},async save(){if(l.saving)return;let t=c.buildBatch(),i=t.cells.length+t.inserts.length+t.deletes.length;if(i===0){w.info("No grid changes to save.",{key:"grid.save"});return}let a=b(t);if(a){c.applyCommitResult(a),w.warn("Required cells are empty — fix the marked rows, then save again.",{key:"grid.save",source:"Data",tier:"problem"});return}if(t.deletes.length>0){if(!await qo("Delete Rows",`Save will permanently delete ${t.deletes.length} row(s). Continue?`,{confirmLabel:"Delete & Save",destructive:!0}))return}let y=new Set(t.cells.map((f)=>f.rowKey)).size+t.inserts.length+t.deletes.length>5?sl({title:"Saving grid"}):null;l.saving=!0;try{let f=await o.commit(t),G=(S,j)=>`${S}\x00${j}`,R=new Map(t.cells.map((S)=>[G(S.rowKey,S.field),S]));for(let S of f.cells){let j=R.get(G(S.rowKey,S.field));if(S.ok&&j){let ne=r.get(S.rowKey);if(ne)ne.cells[S.field]=j.value}}if(c.applyCommitResult(f),f.inserts.some((S)=>S.ok)||f.deletes.some((S)=>S.ok))await C();let L=f.cells.filter((S)=>S.ok).length+f.inserts.filter((S)=>S.ok).length+f.deletes.filter((S)=>S.ok).length,ee=i-L,re=f.cells.filter((S)=>S.stale).length+f.deletes.filter((S)=>S.stale).length;if(ee===0)w.success(`Saved ${L} change(s).`,{key:"grid.save"});else w.error(`Saved ${L} · ${ee} failed${re?` (${re} stale)`:""} — kept pending.`,{action:"file.save",key:"grid.save",source:"Data"})}catch(f){w.error("Could not save the grid.",{action:"file.save",detail:X(f),key:"grid.save",source:"Data"})}finally{l.saving=!1,y?.done(),x()}},serializeForSource(){if(!o.serializeForSource)return null;return o.serializeForSource(c.buildBatch())},async setQuery(t){l.query=t,l.loading=!0;try{await C()}catch(i){l.error=X(i)}finally{l.loading=!1}x()},setGrouping(t){l.grouping=t,x()},async setSort(t){let i={...l.query};if(t)i.orderBy=t.field,i.dir=t.dir;else delete i.orderBy,delete i.dir;if(!o.capabilities.remoteSort){l.query=i,x();return}await this.setQuery(i)},source:o,state:l,tab:e};return e.scope.run(()=>{te(()=>{e.doc.dirty=c.isDirty()}),Zd(e,{canRedo:()=>c.canRedo(),canUndo:()=>c.canUndo(),redo:()=>{c.redo(),x()},undo:()=>{c.undo(),x()}});let t=p();if(t.subscribeFileEvents&&o.backingPaths){let i=t.subscribeFileEvents((a)=>{let u=o.backingPaths(),y=new Set;for(let f of a){if(f.isDir)continue;let G=f.path.replaceAll("\\","/"),R=u.get(G);if(R!==void 0&&!Ud(G))y.add(R)}if(y.size===0)return;if(c.isDirty()){let f=y.has("*")?l.rows.map((G)=>G.key):[...y];c.markStale(f),w.warn("Grid rows changed on disk — marked stale; refresh to reload.",{key:"grid.stale",source:"Data"}),x()}else E.refresh()});ia(i)}ia(()=>{Zd(e,null),H.delete(le(e)),o.dispose?.()})}),H.set(le(e),E),E}async function Ju(e){let s=er(e)?.serializeForSource();if(s)return s;await jt();let l=Wi(e.doc.sourceFormat);if(l?.capabilities.serialize){let r=e.doc.content.frontmatter,d=e.doc.document,c={...r,...d,children:d.children??[]};return Oa(l.name,c,{mode:"roundtrip",...e.doc.source!==null&&{source:e.doc.source}})}if(e.doc.mode==="content"){let r=lr();if(r){let d=e.doc.content.frontmatter,c=Object.keys(d).length>0,C={...d,...e.doc.document};return Oa(r.name,C,{frontmatter:c,mode:"roundtrip"})}}return Co(KO(e.doc.document,e.doc.bareRepeaters??null),e.doc.layout??null)}var Ee=200,Te=500,Oe=2097152,A=new Map,V=!1,I=null,T=null,B=null,Q=null;function Me(){let e=[];for(let o of m.tabs.values())if(o.doc.dirty&&o.documentPath)e.push(o);return e}async function ge(){if(!ye())return;let e=p();if(!e.setPreviewOverlay||!e.clearPreviewOverlay)return;let o=new Set;for(let s of Me()){let l=s.documentPath.replace(/^\.\//,""),r;try{r=await Ju(s)}catch{continue}if(r.length>Oe)continue;if(o.add(l),A.get(l)===r)continue;A.set(l,r),await e.setPreviewOverlay(l,r)}for(let s of A.keys())if(!o.has(s))A.delete(s),await e.clearPreviewOverlay(s)}function he(){if(!V)return;let e=Date.now();if(B??=e,T)clearTimeout(T);let o=e-B,s=Math.max(0,Math.min(Ee,Te-o));T=setTimeout(()=>{T=null,B=null,Q=ge().finally(()=>{Q=null})},s)}function VN(){he()}function UN(){if(V)return;V=!0,I=me(),I.run(()=>{te(()=>{for(let e of m.tabs.values())e.doc.dirty,e.doc.document;he()})})}function qN(){if(V=!1,T)clearTimeout(T),T=null;B=null,I?.stop(),I=null,A.clear()}async function US(){if(!V)return;if(T)clearTimeout(T),T=null,B=null;await Q,await ge()}var we=/^[A-Za-z0-9][A-Za-z0-9!#$&^_.+-]{0,126}$/,$e=new Set(["vnd","prs","x"]);function Fe(e){if(!n(e))return null;let[o,...s]=e.split(";"),l=(o??"").indexOf("/");if(l===-1)return null;let r=(o??"").slice(0,l).trim().toLowerCase(),d=(o??"").slice(l+1).trim().toLowerCase();if(!we.test(r)||!we.test(d))return null;let c=d.lastIndexOf("+"),C=c===-1?null:d.slice(c+1),b=c===-1?d:d.slice(0,c);if(C==="")return null;let k=b.indexOf("."),P=k===-1?null:b.slice(0,k),O=P!==null&&$e.has(P)?P:null,M=O===null?b:b.slice(O.length+1);if(M==="")return null;let F={};for(let x of s){let E=x.indexOf("=");if(E===-1)return null;let t=x.slice(0,E).trim().toLowerCase(),i=x.slice(E+1).trim();if(t==="")return null;if(i.startsWith('"')&&i.endsWith('"')&&i.length>=2)i=i.slice(1,-1);F[t]=i}return{parameters:F,subtype:M,suffix:C,tree:O,type:r}}function Uw(e){let o=Fe(e);if(o===null)return null;let s=o.tree===null?"":`${o.tree}.`,l=o.suffix===null?"":`+${o.suffix}`;return`${o.type}/${s}${o.subtype}${l}`}var be="text/markdown; variant=GFM",ve="application/yaml",Tt={".markdown":`${be}; charset=utf-8`,".md":`${be}; charset=utf-8`,".yaml":`${ve}; charset=utf-8`,".yml":`${ve}; charset=utf-8`};async function GN(e,o){let s=await AI(e.name,o);return OI(e,s)}async function Fr(e,o){await jt();let s=fn(e);if(!s||!s.capabilities.parse)throw lf(e);return{...await GN(s,o),format:s}}var KT=async(e,o)=>{if(e.documentPath&&fn(e.documentPath)){let l=await Fr(e.documentPath,o);return e.doc.source=o,{document:l.document,frontmatter:l.frontmatter}}let s=Es(o);return e.doc.layout=s.layout,{document:s.document}};function De(e){return"showOpenFilePicker"in e}function Ne(e){return"showSaveFilePicker"in e}function q(e,o){if(e.documentPath!==null)o.path=e.documentPath;return o}async function vF(){try{await jt();let e=ou(),o=[{accept:{"application/json":[".json"]},description:"Jx Component"},...e.filter((r)=>r.capabilities.parse).map((r)=>({accept:{[Uw(r.mediaType)??"text/plain"]:r.extensions},description:r.name}))],s=[".json",...e.flatMap((r)=>r.extensions)].join(","),l=async(r,d,c=null)=>{let C=c?await KN(r):null,b=fn(r);if(b){let{document:k,frontmatter:P}=await GN(b,d);Si({document:k,documentPath:C,fileHandle:c,frontmatter:P,id:r,source:d,sourceFormat:b.name})}else if(r.endsWith(".json")){let{document:k,layout:P}=Es(d);Si({document:k,documentPath:C,fileHandle:c,id:r,layout:P})}else throw lf(r)};if(De(window)){let[r]=await window.showOpenFilePicker({types:o}),d=await r.getFile();await l(r.name,await d.text(),r)}else{let r=document.createElement("input");r.type="file",r.accept=s,r.addEventListener("change",async()=>{let d=r.files?.[0];if(!d)return;await l(d.name,await d.text())}),r.click()}}catch(e){if(!(e instanceof Error&&e.name==="AbortError"))w.error("Could not open the file.",{detail:X(e),source:"Open File"})}}var Ce=()=>{};function JT(e){Ce=e}function K(e){let o=e.doc.document;Ce(e.documentPath,o,e);let s=n(o.tagName)&&o.tagName.includes("-")?VS(o):null;if(s)w.warn(s,q(e,{key:`slots:${e.documentPath??e.id}`,source:"Components",tier:"problem"}));W(o,e.documentPath??void 0)}function Ae(e){return!zd(e.documentPath??"")}async function Ip(e=h.value){if(!e)return!1;if(await a$(e.id),ea(e))return w.warn(`You have read access to this session — changes to ${e.documentPath??"this document"} stay in your browser and cannot be saved.`,q(e,{action:"file.save",key:`save.readOnly:${e.documentPath??e.id}`,source:"Collaboration"})),!1;if(!Ae(e)){if(ka(e)===ls||al(e))return $L(e);return w.warn(`${e.documentPath??"This file"} is a media file, so there is no document for Save to write.`,q(e,{key:`save.notADocument:${e.documentPath??e.id}`,source:"Save"})),!1}let o=er(e);if(o)return await o.save(),!e.doc.dirty;try{if(await uI(e))return K(e),!0;let s=await Ju(e);if(e.documentPath){if(await p().writeFile(e.documentPath,s),e.doc.dirty=!1,e.doc.sourceFormat!==null)e.doc.source=s;return US(),K(e),!0}if(e.fileHandle&&"createWritable"in e.fileHandle){let l=await e.fileHandle.createWritable();if(await l.write(s),await l.close(),e.doc.dirty=!1,e.doc.sourceFormat!==null)e.doc.source=s;return K(e),!0}w.warn("This document has no save target — use Export.",{key:"save.noTarget"})}catch(s){if(!(s instanceof Error&&s.name==="AbortError"))w.error(`Could not save ${e.documentPath??e.id}.`,q(e,{action:"file.save",detail:X(s),key:`save:${e.documentPath??e.id}`,source:"Save"}))}return!1}function Be(e){return Wi(e.doc.sourceFormat)??(e.doc.mode==="content"?lr():void 0)}async function YT(){let e=h.value;if(!e)return;try{await jt();let o=Be(e),s=await Ju(e),l=o?Uw(o.mediaType)??"text/plain":"application/json",r=o?o.extensions[0]:".json",d=o?o.name:"Jx Component",c=o?`content${r}`:"component.json";if(Ne(window)){let C=e.documentPath?e.documentPath.split("/").pop():c,b=await window.showSaveFilePicker({suggestedName:C,types:[{accept:{[l]:[r]},description:d}]}),k=await b.createWritable();await k.write(s),await k.close(),e.doc.dirty=!1,K(e),w.success(`Exported as ${b.name}.`)}else{let C=new Blob([s],{type:l}),b=URL.createObjectURL(C),k=document.createElement("a");k.href=b,k.download=c,k.click(),URL.revokeObjectURL(b),e.doc.dirty=!1,K(e),w.success(`Downloaded ${c}.`)}}catch(o){if(!(o instanceof Error&&o.name==="AbortError"))w.error("Could not export the document.",{detail:X(o),source:"Export"})}}async function ke(e,o){let s=zd(e)?await Xu(e):await La({path:e});return oI(s,o)??""}async function Ab(e){let o=await ke(e.path,"delete"),s=`Delete ${e.name}? This cannot be undone.`;return Boolean(await qo("Delete File",o===""?s:`${s} ${o}`,{confirmLabel:"Delete",destructive:!0}))}async function Ob(e,o="rename"){let s=await ke(e,o);return s===""?void 0:s}
|
|
2
|
+
export{zw,Nb,ss,Yl,$m,Ww,Vw,Lp,Qo,WS,er,$p,VS,WN,Ju,VN,UN,qN,US,Uw,GN,Fr,KT,vF,JT,Ip,YT,Ab,Ob};
|
|
3
|
+
|
|
4
|
+
//# debugId=14BFBE1DB1928FD864756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-thz5t120.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{ft,io}from"./studio-5tet77de.js";import{Jt,Ut,Nh}from"./studio-nzemfbkk.js";import{iu,w,$h}from"./studio-sce30r7b.js";import{ae}from"./studio-wqfaqw4m.js";import{X}from"./studio-9c6cbq2c.js";import{Ve,vt,E,R}from"./studio-9dq7rwc7.js";import{me,te,g}from"./studio-3qr08sxq.js";import{n,Q}from"./studio-k3we3kqb.js";var B={$schema:"https://jxsuite.com/schema/v1",$id:"StudioDialog",$description:"Studio's confirm, save-or-discard and prompt dialogs: one jx-dialog whose body is projected from the adapter's scope. `message` is a sentence; `choice` is a `jx-select` over the options; `field` is the prompt's jx-textfield with its refusal. The four answers call the host's functions, and the host decides when the dialog closes.",tagName:"jx-dialog",$props:{headline:{$ref:"#/state/headline"},confirmLabel:{$ref:"#/state/confirmLabel"},secondaryLabel:{$ref:"#/state/secondaryLabel"},cancelLabel:{$ref:"#/state/cancelLabel"},destructive:{$ref:"#/state/destructive"},size:{$ref:"#/state/size"}},attributes:{headline:"${state.headline}","confirm-label":"${state.confirmLabel || null}","secondary-label":"${state.secondaryLabel || null}","cancel-label":"${state.cancelLabel || null}",part:"dialog-host"},onconfirm:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/confirm"},value:[]}]},onsecondary:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/secondary"},value:[]}]},oncancel:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/cancel"},value:[]}]},onclose:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},style:{'& [part="message"]':{$description:"The one part of a dialog that is text rather than interface, so it opts back in to selection. The root sets `user-select: none` and `styles/tokens.json` restates it on every `dialog`, so the headline, the labels and the buttons around this sentence stay unselectable; a message is often the thing a reader copies into a search or a bug report.",margin:"0 0 var(--jx-space-3)",userSelect:"text"},'& [part="message"]:last-child':{margin:"0"},'& [part="island"] > p, & [part="island"] > span, & [part="island"] > strong, & [part="island"] > em, & [part="island"] > code':{$description:"The island's own prose is the message's other form — a body richer than a sentence, written straight into the island from a lit template (studio-ui-guidelines.md §9.4) — so it is selectable for the same reason `[part=\"message\"]` is. The opt-in stops at those children because the island is ALSO the mount point for a whole document: the Open Grid picker and Push Schema's plan put their surfaces here, and `user-select` inherits, so a rule on the island itself would hand selection to every heading, source row and button they draw, which is the interface the policy exists to keep unselectable. A mounted surface roots a `div`; a message writes paragraphs and text-level spans, so the two forms are told apart by the child that arrives.",userSelect:"text"},'& [part="island"]:empty':{display:"none"},'& [part="message-slot"], & [part="choice-slot"], & [part="field-slot"]':{display:"contents"},'& [part="choice-row"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-1)",margin:"0 0 var(--jx-space-3)"},'& [part="choice-label"]':{fontSize:"var(--jx-text-sm)",color:"var(--jx-fg-dim)"},"& jx-textfield":{width:"100%"}},children:[{tagName:"div",attributes:{part:"message-slot",role:"none"},$switch:{$ref:"#/state/hasMessage"},cases:{true:{tagName:"p",attributes:{part:"message"},textContent:"${state.message}"}}},{tagName:"div",attributes:{part:"island"}},{tagName:"div",attributes:{part:"choice-slot",role:"none"},$switch:{$ref:"#/state/hasChoice"},cases:{true:{tagName:"div",attributes:{part:"choice-row"},children:[{tagName:"span",attributes:{part:"choice-label"},textContent:"${state.choiceLabel}"},{tagName:"jx-select",$props:{label:{$ref:"#/state/choiceLabel"},options:{$ref:"#/state/options"},value:{$ref:"#/state/chosen"}},attributes:{part:"choice"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/pick"},value:[{$ref:"event#/target/value"}]}]}}]}}},{tagName:"div",attributes:{part:"field-slot",role:"none"},$switch:{$ref:"#/state/hasField"},cases:{true:{tagName:"jx-textfield",$props:{label:{$ref:"#/state/headline"},value:{$ref:"#/state/value"},placeholder:{$ref:"#/state/placeholder"},invalid:{$ref:"#/state/invalid"},error:{$ref:"#/state/error"},multiline:{$ref:"#/state/multiline"},rows:{$ref:"#/state/rows"},mono:{$ref:"#/state/mono"}},attributes:{part:"field"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/input"},value:[{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"#/state/singleLine"},cases:{true:[{$switch:{$ref:"event#/key"},cases:{Enter:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/confirm"},value:[]}]}}]}}]},$description:"The prompt's one field. `multiline` is what makes it a paste box rather than a line: an import the author copied out of a `_redirects` file is column-aligned, so it also asks for `mono`. A multiline field takes Enter as a newline, which is why the Enter-confirms handler below is guarded on it — a paste box whose second line submits the dialog cannot be typed into."}}}]};E("dialog",B);function sn(e){if(e.querySelector('[part="dialog"]'))return Promise.resolve(e);return new Promise((t)=>{e.addEventListener("jx-ready",function o(r){if(r.target!==e&&!e.querySelector('[part="dialog"]'))return;e.removeEventListener("jx-ready",o),t(e)})})}function Zs(e){let t=document.createElement("div");t.style.pointerEvents="auto",t.setAttribute(Ve,vt("dialog",e.region)),e.layer.append(t);let o=g({cancel:()=>{e.onCancel()},cancelLabel:e.cancelLabel,choiceLabel:e.choice?.label??"",chosen:e.choice?.chosen??"",closed:()=>{e.onClosed()},confirm:()=>{e.onConfirm()},confirmLabel:e.confirmLabel,destructive:e.destructive===!0,error:"",hasChoice:e.choice!==void 0,hasField:e.field!==void 0,mono:e.field?.mono===!0,multiline:e.field?.multiline===!0,rows:e.field?.rows??"3",singleLine:e.field!==void 0&&e.field.multiline!==!0?"true":"false",hasMessage:e.message!==void 0&&e.message!=="",headline:e.headline,input:(a)=>{o.value=a,e.onInput?.(a)},invalid:!1,message:e.message??"",options:e.choice?.options??[],pick:(a)=>{e.onPick?.(a)},placeholder:e.field?.placeholder??"",secondary:()=>{e.onSecondary?.()},secondaryLabel:e.secondaryLabel??"",size:e.size??"sm",value:e.field?.value??""}),r=null,i=!1,s=()=>i,l=()=>{},m=new Promise((a)=>{l=a}),p=R("dialog",o,t).then(async(a)=>{let d=a.root;if(s())return a.dispose(),d;if(r=a,await Promise.race([sn(d),m]),s())return d;if(e.island?.(d.querySelector('[part="island"]')??d),Jt(d),e.field){let x=d.querySelector("jx-textfield");if(x)setTimeout(()=>{if(!i)Nh(x,e.field?.select??"all")},0)}return d});return{close(){if(i)return;i=!0,l();let a=r?.root;if(a instanceof HTMLElement)Ut(a);r?.dispose(),r=null,t.remove()},host:t,ready:p,update(a){if(a.confirmLabel!==void 0)o.confirmLabel=a.confirmLabel;if(a.cancelLabel!==void 0)o.cancelLabel=a.cancelLabel;if(a.secondaryLabel!==void 0)o.secondaryLabel=a.secondaryLabel;if(a.message!==void 0)o.message=a.message,o.hasMessage=a.message!=="";if(a.value!==void 0)o.value=a.value;if(a.placeholder!==void 0)o.placeholder=a.placeholder;if(a.invalid!==void 0)o.invalid=a.invalid;if(a.error!==void 0)if(a.error!==""&&a.error===o.error){o.error="";let d=a.error;queueMicrotask(()=>{o.error=d})}else o.error=a.error;if(a.options!==void 0)o.options=a.options;if(a.chosen!==void 0)o.chosen=a.chosen}}}var G={$schema:"https://jxsuite.com/schema/v1",$id:"StudioToasts",$description:"The toast stack: a rendering of the notification service's toasts, newest last. Each row is projected by ui/layers.ts with its severity glyph and, where a recovery command exists, that command's title and gate; the two buttons call back into the host, which owns the records and their timers.",tagName:"div",attributes:{part:"stack"},style:{position:"absolute",right:"var(--jx-space-4)",bottom:"36px",display:"flex",flexDirection:"column",gap:"var(--jx-space-3)",alignItems:"flex-end",maxWidth:"min(420px, calc(100vw - 24px))",'& [part="toast"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-3)",pointerEvents:"auto",padding:"var(--jx-space-3)",border:"1px solid var(--jx-border)",borderLeft:"3px solid var(--jx-fg-dim)",borderRadius:"var(--jx-radius-md)",background:"var(--jx-bg-panel)",color:"var(--jx-fg)",fontSize:"var(--jx-text-sm)",lineHeight:"var(--jx-leading-sm)",boxShadow:"var(--jx-shadow-popover)"},'& [part="toast"][data-severity="success"]':{borderLeftColor:"var(--jx-success)"},'& [part="toast"][data-severity="info"]':{borderLeftColor:"var(--jx-accent)"},'& [part="toast"][data-severity="warn"]':{borderLeftColor:"var(--jx-warning)"},'& [part="toast"][data-severity="error"]':{borderLeftColor:"var(--jx-danger)"},'& [part="icon"]':{flex:"none",width:"14px",textAlign:"center",fontWeight:"700"},'& [data-severity="success"] [part="icon"]':{color:"var(--jx-success)"},'& [data-severity="info"] [part="icon"]':{color:"var(--jx-accent)"},'& [data-severity="warn"] [part="icon"]':{color:"var(--jx-warning)"},'& [data-severity="error"] [part="icon"]':{color:"var(--jx-danger)"},'& [part="message"]':{flex:"1",minWidth:"0",overflow:"hidden",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"3"},'& [part="action-slot"]':{display:"contents"},'& [part="action"] > [part="control"]':{color:"var(--jx-accent)"}},children:[{$prototype:"Array",items:{$ref:"#/state/toasts"},key:{$ref:"$map/item/id"},map:{tagName:"div",attributes:{part:"toast","data-severity":"${$map.item.severity}"},children:[{tagName:"span",attributes:{part:"icon","aria-hidden":"true"},textContent:"${$map.item.icon}"},{tagName:"span",attributes:{part:"message"},textContent:"${$map.item.message}"},{tagName:"span",attributes:{part:"action-slot",role:"none"},$switch:{$ref:"$map/item/hasAction"},cases:{true:{tagName:"jx-button",$props:{size:"sm",quiet:!0,disabled:{$ref:"$map/item/actionDisabled"}},attributes:{part:"action",title:"${$map.item.actionTitle}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/runAction"},value:[{$ref:"$map/item/id"}]}]},children:[{tagName:"span",textContent:"${$map.item.actionLabel}"}]}}},{tagName:"jx-action-button",$props:{label:"Dismiss notification",hint:"Dismiss notification",icon:"x",size:"sm"},attributes:{part:"dismiss"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/dismissToast"},value:[{$ref:"$map/item/id"}]}]}}]}}]};function re(e){return e instanceof RangeError||e instanceof Error&&e.name==="CommandUnavailableError"}function Tn(e,t,o,r=t){let i=(l)=>{if(!re(l))console.error(`${r}: command "${t}" failed`,l);w.error(X(l),{key:`command.run:${t}`,source:r})},s;try{s=e.run(t,o)}catch(l){return i(l),Promise.resolve()}return Promise.resolve(s).catch(i)}function nt(e,t,o){let r=ae();return r?Tn(r,e,t,o):Promise.resolve()}var Y=null,_=null,q=null,C=null;function dt(e){return(e==="popover"?Y:e==="modal"?_:e==="toast"?C:q)??document.body}function Z$(){Y=document.querySelector("#layer-popover"),_=document.querySelector("#layer-modal"),q=document.querySelector("#layer-dialog"),C=document.querySelector("#layer-toast"),ue()}var U="jx-dialog[data-open], dialog[open]";function sv(){return Boolean(q?.querySelector(U)||_?.querySelector(U))}function X$(){return document.querySelector(":popover-open")!==null}function qo(e,t,o={}){let{confirmLabel:r="Confirm",cancelLabel:i="Cancel",destructive:s=!1}=o;return new Promise((l)=>{let m=!1,c=(a)=>{if(m)return;m=!0,p.close(),l(a)},p=Zs({cancelLabel:i,confirmLabel:r,destructive:s,headline:e,layer:dt("dialog"),...z(t),onCancel:()=>c(!1),onClosed:()=>c(!1),onConfirm:()=>c(!0)})})}function qC(e,t,o={}){let{saveLabel:r="Save",discardLabel:i="Discard",cancelLabel:s="Cancel"}=o;return new Promise((l)=>{let m=!1,c=(a)=>{if(m)return;m=!0,p.close(),l(a)},p=Zs({cancelLabel:s,confirmLabel:r,headline:e,layer:dt("dialog"),...z(t),onCancel:()=>c("cancel"),onClosed:()=>c("cancel"),onConfirm:()=>c("save"),onSecondary:()=>c("discard"),secondaryLabel:i})})}function z(e){if(n(e))return{message:e};return{island:(t)=>{io(e,t)}}}function Fn(e,t={}){let{cancelLabel:o="Cancel",choice:r,confirmLabel:i="OK",message:s,mono:l=!1,multiline:m=!1,placeholder:c="",rows:p="3",select:a="all",size:d,validate:x,value:Z=""}=t,k=(h)=>x?x(h,S):h.trim()?"":"Enter a value.",v=Z,S=r?.initial??"",f="",F=!1,I=()=>Q(c)?c():c,V=()=>r?r.options().map((h)=>({label:h.label,value:h.value})):[];return new Promise((h)=>{let K=!1,H=(u)=>{if(K)return;K=!0,N.close(),h(u)},W=(u)=>{f=u,N.update({error:f,invalid:f!==""})},L={cancelLabel:o,confirmLabel:i,headline:e,layer:dt("dialog"),onCancel:()=>H(null),onClosed:()=>H(null),onConfirm:()=>{let u=k(v);if(u){W(u);return}H(v.trim())},onInput:(u)=>{F=!0,v=u;let T=k(v);if(T!==f)W(T)},onPick:(u)=>{S=u,r?.onChange?.(u);let T=k(v);f=F||f?T:"",N.update({chosen:S,error:f,invalid:f!=="",options:V(),placeholder:I()})}};if(s!==void 0)Object.assign(L,z(s));if(r)L.choice={chosen:S,label:r.label,options:V()};if(L.field={mono:l,multiline:m,placeholder:I(),rows:p,select:a,value:v},d!==void 0)L.size=d;let N=Zs(L)})}var M=new Map;function Xs(e,t){let o=`${e}:${t}`,r=M.get(o);if(r&&r.parentElement)return r;return r=document.createElement("div"),r.style.pointerEvents="auto",r.setAttribute(Ve,vt(e,t)),dt(e).append(r),M.set(o,r),r}function av(e,t){let o=`${e}:${t}`,r=M.get(o);if(r)io(ft,r),r.remove(),M.delete(o)}var ne=180,ie={error:"✕",info:"ℹ",success:"✓",warn:"!"},P=null,y=new Map,b=new Set;function se(){if(!("matchMedia"in globalThis))return!1;return globalThis.matchMedia("(prefers-reduced-motion: reduce)").matches===!0}function le(){try{return new URLSearchParams(globalThis.location.search).get("automation")==="1"}catch{return!1}}function Q$(){return[...b].map((e)=>`overlay: toast ${e} settling in`)}function O(e){let t=y.get(e);if(t!==void 0)clearTimeout(t),y.delete(e);b.delete(e),$h(e)}function ce(e){if(y.has(e.id)||b.has(e.id))return;let t=se()?0:ne;if(t>0)b.add(e.id),setTimeout(()=>b.delete(e.id),t);let o=e.timeoutMs??0;if(o<=0||le())return;y.set(e.id,setTimeout(()=>O(e.id),o))}E("toasts",G);var A=null,D=null,j=null;function J(){return A??=g({dismissToast:(e)=>{O(e)},runAction:(e)=>{let t=iu.find((r)=>r.id===e),o=ae();if(!t?.action||!o)return;O(e),Tn(o,t.action,t.actionArgs,"Notifications")},toasts:[]}),A}function de(e){let t=e.action===void 0?null:ae(),o=e.action,r=t&&o!==void 0?t.get(o):void 0,i=r&&o!==void 0&&t.isVisible(o)?r:null,s=i&&o!==void 0?t.disabledReason(o):void 0;return{actionDisabled:s!==void 0,actionLabel:i?.title??"",actionTitle:i===null?"":s===void 0?i.title:`${i.title} — requires ${s}`,hasAction:i!==null,icon:ie[e.severity],id:e.id,message:e.message,severity:e.severity}}function ue(){if(fe(),!C)return;P=me(),P.run(()=>{te(()=>{iu.length,ae();for(let e of iu)ce(e);J().toasts=iu.map((e)=>de(e))})}),D=R("toasts",J(),C),D.then((e)=>{j=e})}function fe(){P?.stop(),P=null;for(let t of y.values())clearTimeout(t);y.clear(),b.clear();let e=D;if(D=null,j)j.dispose(),j=null;else if(e)e.then((t)=>t.dispose());A=null}
|
|
2
|
+
export{sn,Zs,Tn,nt,dt,Z$,sv,X$,qo,qC,Fn,Xs,av,Q$};
|
|
3
|
+
|
|
4
|
+
//# debugId=DB2A0A775E7A8BB064756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-tpxcryf2.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{n,
|
|
2
|
-
export{
|
|
1
|
+
import{n,Y,_}from"./studio-k3we3kqb.js";function y(t){return JSON.parse(JSON.stringify(t))}function Ce(t){return t===void 0||t===null?t:y(t)}function oe(t,e){let r=t;for(let o of e){if(r==null)return;r=r[o]}return r}function Ov(t){if(Array.isArray(t))throw TypeError("Cannot insert into a children array; parentPath must point at a node");if(!t.children)t.children=[];if(!Array.isArray(t.children))throw TypeError("Cannot insert into mapped-array children; edit the map template instead");return t.children}function Mv(t,e){let{op:r}=e;switch(e.op){case"set-key":{let o=oe(t,e.path);if(!o)throw Error(`doc-op-node-not-found:${e.path.join("/")}`);if(e.value===void 0)delete o[e.key];else o[e.key]=Ce(e.value);return}case"insert-child":{l(t,e.parentPath).splice(e.index,0,Ce(e.node));return}case"remove-child":{l(t,e.parentPath).splice(e.index,1);return}case"set-child":{l(t,e.parentPath).splice(e.index,1,Ce(e.node));return}case"move-child":{P(e);let o=l(t,e.fromParentPath),a=l(t,e.toParentPath),[i]=o.splice(e.fromIndex,1);a.splice(e.toIndex,0,i);return}default:break}throw Error(`unknown-doc-op:${r}`)}function l(t,e){let r=oe(t,e);if(r==null)throw TypeError(`doc-op-node-not-found:${e.join("/")}`);return Ov(r)}function h1(t,e,r,o,a){let i=t.length,c=i<e.length&&t.every((s,u)=>s===e[u]),d=e[i+1];if(!c||e[i]!=="children"||!Y(d))return e;if(a?d<r:d<=r)return e;let h=[...e];return h[i+1]=d+o,h}function P(t){let e=[...t.fromParentPath,"children",t.fromIndex],r=t.toParentPath;if(r.length>=e.length&&e.every((o,a)=>o===r[a]))throw Error(`doc-op-move-into-self:${r.join("/")}`)}function df(t,e){return t<0?Math.max(e+t,0):Math.min(t,e)}function p1(t,e){let{op:r}=e;switch(b(e),e.op){case"set-key":{let o=oe(t,e.path);if(o===void 0)throw Error(`doc-op-node-not-found:${e.path.join("/")}`);if(!_(o)||Array.isArray(o))throw TypeError(`doc-op-not-a-node:${e.path.join("/")}`);let a=Ce(o[e.key]);return a===void 0?{key:e.key,op:"set-key",path:e.path}:{key:e.key,op:"set-key",path:e.path,value:a}}case"insert-child":{let{length:o}=f(t,e.parentPath);return{index:df(e.index,o),op:"remove-child",parentPath:e.parentPath}}case"remove-child":{let o=x(t,e.parentPath,e.index);return{index:e.index,node:o,op:"insert-child",parentPath:e.parentPath}}case"set-child":{let o=x(t,e.parentPath,e.index);return{index:e.index,node:o,op:"set-child",parentPath:e.parentPath}}case"move-child":{P(e);let o=J(t,e.fromParentPath);m(o,e.fromParentPath,e.fromIndex);let a=f(t,e.toParentPath),i=df(e.toIndex,a.length-(a===o?1:0));return{fromIndex:i,fromParentPath:h1(e.fromParentPath,e.toParentPath,e.fromIndex,-1,!1),op:"move-child",toIndex:e.fromIndex,toParentPath:h1(e.toParentPath,e.fromParentPath,i,1,!0)}}default:break}throw Error(`unknown-doc-op:${r}`)}function b(t){let e=[];if(t.op==="move-child")e.push([t.fromParentPath,t.fromIndex],[t.toParentPath,t.toIndex]);else if(t.op==="insert-child"||t.op==="remove-child"||t.op==="set-child")e.push([t.parentPath,t.index]);for(let[r,o]of e)if(!Number.isInteger(o))throw TypeError(`doc-op-index:${[...r,"children",String(o)].join("/")}`)}function J(t,e){let r=oe(t,e);return r&&Array.isArray(r.children)?r.children:null}function m(t,e,r){if(!t||r<0||r>=t.length)throw Error(`doc-op-node-not-found:${[...e,"children",r].join("/")}`)}function x(t,e,r){let o=J(t,e);return m(o,e,r),Ce(o[r])}function f(t,e){let r=oe(t,e);if(!_(r)||Array.isArray(r))throw Error(`doc-op-node-not-found:${e.join("/")}`);if(r.children===void 0)return[];if(!Array.isArray(r.children))throw TypeError(`doc-op-mapped-children:${e.join("/")}`);return r.children}function na(t,e){if(t.length>e.length)return!1;return t.every((r,o)=>r===e[o])}function g(t,e){let r=Math.min(t.length,e.length);for(let o=0;o<r;o++){let a=t[o],i=e[o];if(a===i)continue;if(Y(a)&&Y(i))return a-i;return String(a)<String(i)?-1:1}return t.length-e.length}function w(t){let e=[];for(let r of t)if(!t.some((o)=>!v(o,r)&&na(o,r)))e.push([...r]);return e}function v(t,e){return t.length===e.length&&na(t,e)}function uf(t){let e=t?.at(-1);return t&&t.at(-2)==="children"&&Y(e)?{index:e,parentPath:t.slice(0,-2)}:null}function ru(t){return uf(t)!==null}function sg(t){return w(t).filter((e)=>ru(e)).toSorted((e,r)=>g(r,e))}function c0(t){if(Y(t)&&Number.isInteger(t))return t;return n(t)&&/^(?:0|[1-9]\d*)$/.test(t)?Number(t):null}function d0(t,e,r,o){let a=uf(e),i=a&&oe(t,a.parentPath),c=oe(t,r);if(!a||!i||!Array.isArray(i.children)||!c)return null;if(i.children[a.index]===void 0)return null;let d=i===c,h=d&&a.index<o?o-1:o,s=Array.isArray(c.children)?c.children.length:0,u={fromIndex:a.index,fromParentPath:a.parentPath,op:"move-child",toIndex:df(h,s-(d?1:0)),toParentPath:r},p=p1(t,u);return{forward:u,inverse:p}}
|
|
2
|
+
export{Ce,oe,Ov,Mv,h1,df,p1,na,uf,ru,sg,c0,d0};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
5
|
-
//# sourceMappingURL=studio-
|
|
4
|
+
//# debugId=83EBFA104545DF0064756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-v5wktj6f.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var s=new Set(["project.schema.json","document.schema.json"]);function
|
|
2
|
-
export{
|
|
1
|
+
var s=new Set(["project.schema.json","document.schema.json"]);function iR(e){return s.has(e)?`file:///.jx/generated/${e}`:`file:///${e}`}function v2(e,r){return{head:`file:///.jx/diff/${e}/head/${r}`,work:`file:///.jx/diff/${e}/work/${r}`}}function y2(e){switch(e.slice(e.lastIndexOf(".")+1).toLowerCase()){case"cjs":case"js":case"mjs":return"javascript";case"css":return"css";case"htm":case"html":return"html";case"json":return"json";case"md":return"markdown";case"cts":case"mts":case"ts":return"typescript";case"yaml":case"yml":return"yaml";default:return"plaintext"}}
|
|
2
|
+
export{iR,v2,y2};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
5
|
-
//# sourceMappingURL=studio-
|
|
4
|
+
//# debugId=9404E8EB25D80EE864756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-vpevkfxw.js.map
|