@jxsuite/studio 10.5.0 → 10.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/data/locales/en/elements.json +434 -0
- package/data/webdata.json +116 -139
- package/dist/chunks/{2020-7sx2vexa.js → 2020-rqm7qrje.js} +3 -3
- package/dist/chunks/adapter-cyy8vbcx.js +4 -0
- package/dist/chunks/add-new-flow-8cgtejv2.js +4 -0
- package/dist/chunks/{cf-account-picker-ajh60k54.js → cf-account-picker-v3qd2dhw.js} +3 -3
- package/dist/chunks/cf-settings-1fnw874z.js +4 -0
- package/dist/chunks/{color-area-gbcftzh3.js → color-area-frd9y9q6.js} +2 -2
- package/dist/chunks/{color-field-85136598.js → color-field-rebpbe33.js} +3 -3
- package/dist/chunks/{color-slider-w1s3ndd8.js → color-slider-6bzmk3s7.js} +2 -2
- package/dist/chunks/color-t2bnnj8y.js +4 -0
- package/dist/chunks/{combobox-dk98wc5x.js → combobox-c49x7gf1.js} +2 -2
- package/dist/chunks/components-y8yhdd7d.js +4 -0
- package/dist/chunks/content-source-9e7qvmsf.js +4 -0
- package/dist/chunks/convert-to-repeater-pd2w4z21.js +4 -0
- package/dist/chunks/editor-mb9jzdrw.js +4 -0
- package/dist/chunks/entry-commands-at0wnx3f.js +4 -0
- package/dist/chunks/extension-sections-4z9qq0gh.js +4 -0
- package/dist/chunks/file-ops-dtdvjmza.js +4 -0
- package/dist/chunks/files-8pf70854.js +4 -0
- package/dist/chunks/format-host-fd3m2y2a.js +4 -0
- package/dist/chunks/fs-events-hrk29vcv.js +4 -0
- package/dist/chunks/grid-open-bh74v82z.js +4 -0
- package/dist/chunks/{grid-view-0v4hjspb.js → grid-view-a51mgzmq.js} +10 -10
- package/dist/chunks/{icons-j9eksgew.js → icons-qp8fn1k8.js} +2 -2
- package/dist/chunks/{iframe-entry-4zqtn3ry.js → iframe-entry-mpwe5pwk.js} +4 -4
- package/dist/chunks/{iframe-entry-2x9bn5ng.js → iframe-entry-msd43x9h.js} +4 -4
- package/dist/chunks/iframe-entry-rt8jz5t8.js +5 -0
- package/dist/chunks/{iframe-entry-54kwwhmg.js → iframe-entry-v40cr813.js} +2 -2
- package/dist/chunks/iframe-host-q0s0wwy3.js +4 -0
- package/dist/chunks/{image-bake-m8gzaan9.js → image-bake-q9ajdjsj.js} +3 -3
- package/dist/chunks/{image-editor-0afyws7c.js → image-editor-ke9std9b.js} +2 -2
- package/dist/chunks/index-57ang7ma.js +4 -0
- package/dist/chunks/index-eytr7av4.js +17 -0
- package/dist/chunks/{index-2q88g57p.js → index-x495reff.js} +3 -3
- package/dist/chunks/{javascript-5sxtr1g7.js → javascript-qe34bvaz.js} +3 -3
- package/dist/chunks/{jsonMode-m6sf47hq.js → jsonMode-m8rseh31.js} +8 -8
- package/dist/chunks/jx-validate-bbd1mary.js +4 -0
- package/dist/chunks/layers-panel-wcjtdqsa.js +4 -0
- package/dist/chunks/layers-yscpys6q.js +4 -0
- package/dist/chunks/{listbox-k5p41049.js → listbox-tktzq5xj.js} +2 -2
- package/dist/chunks/lit-html-qm5wbhqz.js +4 -0
- package/dist/chunks/media-library-2hfff88g.js +4 -0
- package/dist/chunks/media-open-4pb05cne.js +4 -0
- package/dist/chunks/media-picker-bzktmmwr.js +4 -0
- package/dist/chunks/{menu-26nez152.js → menu-xc3cbgsd.js} +2 -2
- package/dist/chunks/{monaco-binding-1s2b8snq.js → monaco-binding-7t38arh9.js} +3 -3
- package/dist/chunks/monaco-buffer-3vz94c9f.js +4 -0
- package/dist/chunks/monaco-setup-fstdew02.js +4 -0
- package/dist/chunks/notify-gbdcckrh.js +4 -0
- package/dist/chunks/parse-fpdzgk4c.js +4 -0
- package/dist/chunks/platform-9g72gdqr.js +4 -0
- package/dist/chunks/{popover-fhdnt4be.js → popover-cnmsav6b.js} +2 -2
- package/dist/chunks/publish-panel-91x1cb5d.js +4 -0
- package/dist/chunks/publish-quick-e2dmf7eg.js +4 -0
- package/dist/chunks/publish-workspace-1x8mnzrj.js +4 -0
- package/dist/chunks/quick-search-2m4y6p1x.js +4 -0
- package/dist/chunks/references-yg1g9rwx.js +4 -0
- package/dist/chunks/right-panel-7mfyhzrk.js +4 -0
- package/dist/chunks/source-control-rrc4jgp5.js +4 -0
- package/dist/chunks/{split-qh21j2b0.js → split-d15yencd.js} +2 -2
- package/dist/chunks/{studio-r5g7fx7q.js → studio-0jhhznxy.js} +6 -6
- package/dist/chunks/studio-0nb57pjg.js +7 -0
- package/dist/chunks/{studio-bpzwhn88.js → studio-0wa4wv4s.js} +4 -4
- package/dist/chunks/studio-0z8kp4xk.js +5 -0
- package/dist/chunks/{studio-jqvke4ac.js → studio-18gc5t3v.js} +4 -4
- package/dist/chunks/{studio-xh6rf05g.js → studio-1b79rpcb.js} +4 -4
- package/dist/chunks/studio-211q5j7m.js +4 -0
- package/dist/chunks/studio-213pyfxh.js +16 -0
- package/dist/chunks/studio-2b1smjvp.js +5 -0
- package/dist/chunks/{studio-dst8y8vh.js → studio-2v6tc9jp.js} +4 -4
- package/dist/chunks/studio-30j0wz99.js +5 -0
- package/dist/chunks/studio-3kmqhwtt.js +5 -0
- package/dist/chunks/studio-44drsmhw.js +5 -0
- package/dist/chunks/{studio-d5f7sskn.js → studio-495b6f2r.js} +4 -4
- package/dist/chunks/{studio-g65t6svn.js → studio-4gthb2fd.js} +4 -4
- package/dist/chunks/{studio-bmwgj8ez.js → studio-4xadhxj1.js} +4 -4
- package/dist/chunks/{studio-zav9hgb3.js → studio-52mzbxqm.js} +4 -4
- package/dist/chunks/{studio-thgexj3w.js → studio-56mmnsw8.js} +7 -7
- package/dist/chunks/studio-59hz8f4r.js +5 -0
- package/dist/chunks/{studio-bk0anq3b.js → studio-5k9mfafh.js} +3 -3
- package/dist/chunks/{studio-qarg1xf9.js → studio-5qez462c.js} +5 -5
- package/dist/chunks/studio-6tnpg0vx.js +5 -0
- package/dist/chunks/studio-6w8mt734.js +6 -0
- package/dist/chunks/studio-7hm04x5z.js +5 -0
- package/dist/chunks/studio-8atmfjjm.js +7 -0
- package/dist/chunks/{studio-69g6a0jn.js → studio-8n99z71s.js} +4 -4
- package/dist/chunks/{studio-ep1384t9.js → studio-8vmad6x2.js} +4 -4
- package/dist/chunks/{studio-6sxnqqw8.js → studio-93p5k4r4.js} +4 -4
- package/dist/chunks/{studio-hy936516.js → studio-9gb0m81w.js} +4 -4
- package/dist/chunks/{studio-ek4fb4eb.js → studio-a4ymg4vd.js} +4 -4
- package/dist/chunks/studio-anc8067x.js +5 -0
- package/dist/chunks/{studio-ketrgtph.js → studio-dbdt67kr.js} +5 -5
- package/dist/chunks/studio-dbex091t.js +5 -0
- package/dist/chunks/{studio-nngc45ct.js → studio-dj8ctxey.js} +4 -4
- package/dist/chunks/{studio-pgze9p34.js → studio-ed9bz68j.js} +5 -5
- package/dist/chunks/{studio-4ncxzw5m.js → studio-fe2d1fp5.js} +4 -4
- package/dist/chunks/{studio-m8hesdrw.js → studio-fgp4cyy3.js} +4 -4
- package/dist/chunks/{studio-151kgn69.js → studio-ft706q02.js} +4 -4
- package/dist/chunks/{studio-pv1ts08p.js → studio-g79s1dyg.js} +5 -5
- package/dist/chunks/{studio-zkkt13qd.js → studio-gahswxp4.js} +4 -4
- package/dist/chunks/{studio-x5ffyssw.js → studio-gbqc12bk.js} +4 -4
- package/dist/chunks/{studio-4jy967rj.js → studio-gxphbetb.js} +5 -5
- package/dist/chunks/studio-hdf01j7q.js +7 -0
- package/dist/chunks/studio-hf259xzd.js +48 -0
- package/dist/chunks/studio-jbva4wxw.js +5 -0
- package/dist/chunks/{studio-td3h1644.js → studio-jj9gf1qc.js} +4 -4
- package/dist/chunks/studio-jsjg3mjv.js +5 -0
- package/dist/chunks/studio-jtvb8hd7.js +5 -0
- package/dist/chunks/{studio-c72v1kwc.js → studio-kp4vzrct.js} +4 -4
- package/dist/chunks/{studio-s4k1v7dt.js → studio-kpx02gaa.js} +6 -6
- package/dist/chunks/{studio-3yr1zdp9.js → studio-kv1728ex.js} +8 -8
- package/dist/chunks/studio-m25ry0mf.js +5 -0
- package/dist/chunks/studio-mcbwmkyh.js +5 -0
- package/dist/chunks/studio-meajkr51.js +5 -0
- package/dist/chunks/studio-mkjrjpr2.js +6 -0
- package/dist/chunks/{studio-nv5eq0f7.js → studio-mr084886.js} +181 -181
- package/dist/chunks/{studio-43pynnhz.js → studio-mrb10hv3.js} +4 -4
- package/dist/chunks/{studio-7qqb7hb8.js → studio-nhpg405j.js} +4 -4
- package/dist/chunks/{studio-n271vdsg.js → studio-nsec0hxm.js} +41 -41
- package/dist/chunks/{studio-ztzf8mce.js → studio-nv0mh0p5.js} +4 -4
- package/dist/chunks/studio-pafmb06w.js +5 -0
- package/dist/chunks/{studio-4s5bka8t.js → studio-pgftd79b.js} +4 -4
- package/dist/chunks/{studio-wn2cmf9q.js → studio-pk961xgz.js} +4 -4
- package/dist/chunks/studio-pzbr7g05.js +5 -0
- package/dist/chunks/{studio-15mfah02.js → studio-qcc5hsw2.js} +6 -6
- package/dist/chunks/studio-qfq58c8n.js +5 -0
- package/dist/chunks/{studio-j3bq30yz.js → studio-qvb2jr83.js} +4 -4
- package/dist/chunks/studio-r85zw6ay.js +5 -0
- package/dist/chunks/{studio-f69wcajk.js → studio-s0kwce5w.js} +5 -5
- package/dist/chunks/studio-s6ymkf3q.js +14 -0
- package/dist/chunks/{studio-8ncm9zwx.js → studio-s7p5ccxa.js} +4 -4
- package/dist/chunks/{studio-zzgp5yka.js → studio-s9jjap3x.js} +4 -4
- package/dist/chunks/{studio-ber1dgte.js → studio-t5hde1ws.js} +4 -4
- package/dist/chunks/studio-vj9yv897.js +5 -0
- package/dist/chunks/{studio-ajfq4fmr.js → studio-wmak8xjw.js} +4 -4
- package/dist/chunks/{studio-k05g7efh.js → studio-wqsmvtqj.js} +4 -4
- package/dist/chunks/studio-x3z3rhej.js +5 -0
- package/dist/chunks/{studio-7qr8k0v2.js → studio-xb55kpmy.js} +4 -4
- package/dist/chunks/{studio-f3awr5nc.js → studio-xxtdajmv.js} +7 -7
- package/dist/chunks/{studio-1a7zshnv.js → studio-xxttcym1.js} +4 -4
- package/dist/chunks/{studio-czpmzs9r.js → studio-y2zsnzye.js} +7 -7
- package/dist/chunks/{studio-9f5vcb4w.js → studio-y3tjh2xb.js} +3 -3
- package/dist/chunks/studio-y4f1rdsj.js +5 -0
- package/dist/chunks/studio-ybkd5w8k.js +5 -0
- package/dist/chunks/{studio-cv6gnjqd.js → studio-yetr4gg1.js} +4 -4
- package/dist/chunks/{studio-ehj3csbm.js → studio-z295anhs.js} +5 -5
- package/dist/chunks/{studio-pte5w7rf.js → studio-z89e6wpg.js} +8 -8
- package/dist/chunks/{studio-4z0cdh16.js → studio-zbwr6prc.js} +3 -3
- package/dist/chunks/{studio-w3aafbpk.js → studio-zdbsv5q2.js} +3 -3
- package/dist/chunks/{studio-eq5vqn1q.js → studio-zvthj8hg.js} +4 -4
- package/dist/chunks/toast-2kn2vrn4.js +4 -0
- package/dist/chunks/{toast-host-g3r2s0kn.js → toast-host-3rxeyj3d.js} +3 -3
- package/dist/chunks/{tooltip-gtx40bjg.js → tooltip-ghkxkasp.js} +2 -2
- package/dist/chunks/{tree-a19s1c05.js → tree-vw4nc63s.js} +2 -2
- package/dist/chunks/{tsMode-3f116hth.js → tsMode-7gngmamr.js} +7 -7
- package/dist/chunks/workspace-gv0hxgsm.js +4 -0
- package/dist/chunks/workspace-home-j7e0mjy5.js +4 -0
- package/dist/chunks/{ws-client-cb49m87s.js → ws-client-vs11sxc5.js} +3 -3
- package/dist/iframe-entry.js +14 -14
- package/dist/manifest.json +84 -83
- package/dist/studio.js +80 -80
- package/package.json +12 -12
- package/src/browse/preview-style.ts +2 -1
- package/src/canvas/canvas-render.ts +6 -1
- package/src/canvas/iframe-drop.ts +84 -1
- package/src/canvas/iframe-entry.ts +9 -6
- package/src/canvas/iframe-render.ts +13 -0
- package/src/collab/collab-session.ts +2 -2
- package/src/commands/levels.ts +1 -1
- package/src/create/add-new-flow.ts +2 -1
- package/src/editor/convert-targets.ts +2 -23
- package/src/editor/slash-menu.ts +35 -17
- package/src/files/files.ts +18 -0
- package/src/format/format-choices.ts +5 -5
- package/src/format/format-host.ts +35 -3
- package/src/grid/redirects-grid.ts +4 -4
- package/src/locale/element-names.ts +131 -0
- package/src/panels/dnd.ts +3 -1
- package/src/panels/elements-panel.ts +93 -36
- package/src/panels/imports-panel.ts +3 -2
- package/src/panels/navigator-panels.ts +10 -10
- package/src/panels/panel-registry.ts +3 -3
- package/src/panels/site-panel.ts +2 -1
- package/src/panels/style-panel.ts +2 -1
- package/src/panels/styles-panel.ts +2 -2
- package/src/platforms/cloud.ts +5 -2
- package/src/services/ai-command-tools.ts +2 -1
- package/src/services/ai-project-tools.ts +18 -5
- package/src/services/jxn-language.ts +110 -0
- package/src/services/model-uri.ts +3 -0
- package/src/services/monaco-setup.ts +6 -2
- package/src/settings/contributed-section.ts +2 -1
- package/src/settings/extension-commands.ts +2 -1
- package/src/settings/general-settings.ts +2 -2
- package/src/settings/settings-document.ts +5 -5
- package/src/shell.ts +1 -1
- package/src/studio.ts +28 -11
- package/src/style/variables-view.ts +2 -2
- package/src/surfaces/panel-elements.json +466 -206
- package/src/surfaces/panel-elements.ts +61 -25
- package/src/tabs/project-config.ts +13 -13
- package/src/tabs/tab.ts +7 -2
- package/src/types.ts +11 -2
- package/src/view.ts +9 -2
- package/src/workspace/tab-workspace.ts +2 -2
- package/src/workspace/workspace-back.ts +2 -2
- package/dist/chunks/adapter-12dxr3z7.js +0 -4
- package/dist/chunks/add-new-flow-any4pw2q.js +0 -4
- package/dist/chunks/cf-settings-hbj16kh3.js +0 -4
- package/dist/chunks/color-thzpppyc.js +0 -4
- package/dist/chunks/components-a98hzqw9.js +0 -4
- package/dist/chunks/content-source-jq3fjs3w.js +0 -4
- package/dist/chunks/convert-to-repeater-g66r6qp1.js +0 -4
- package/dist/chunks/editor-rth1rzj8.js +0 -4
- package/dist/chunks/entry-commands-02j0s19w.js +0 -4
- package/dist/chunks/extension-sections-rqrs7dr0.js +0 -4
- package/dist/chunks/file-ops-6a49er4c.js +0 -4
- package/dist/chunks/files-b2p9y0yz.js +0 -4
- package/dist/chunks/format-host-7xe57k1s.js +0 -4
- package/dist/chunks/fs-events-0xsy168g.js +0 -4
- package/dist/chunks/grid-open-h3q4fjy5.js +0 -4
- package/dist/chunks/iframe-entry-m24fza30.js +0 -5
- package/dist/chunks/iframe-host-8jcmaktg.js +0 -4
- package/dist/chunks/index-7nj2375a.js +0 -4
- package/dist/chunks/jx-validate-808zgbgy.js +0 -4
- package/dist/chunks/layers-0ffdtqjn.js +0 -4
- package/dist/chunks/layers-panel-rw62wtvf.js +0 -4
- package/dist/chunks/lit-html-9bz9rcfv.js +0 -4
- package/dist/chunks/media-library-2a5hdbek.js +0 -4
- package/dist/chunks/media-open-069kzhj4.js +0 -4
- package/dist/chunks/media-picker-4p4pd28y.js +0 -4
- package/dist/chunks/monaco-buffer-m9fd2dka.js +0 -4
- package/dist/chunks/monaco-setup-e0crh3v6.js +0 -4
- package/dist/chunks/notify-re3js157.js +0 -4
- package/dist/chunks/parse-hee7ne9b.js +0 -4
- package/dist/chunks/platform-rywy3tkg.js +0 -4
- package/dist/chunks/publish-panel-czkpg8m4.js +0 -4
- package/dist/chunks/publish-quick-b9wbhqj6.js +0 -4
- package/dist/chunks/publish-workspace-yy6d23b7.js +0 -4
- package/dist/chunks/quick-search-tp7pjnmv.js +0 -4
- package/dist/chunks/references-wd2yj8s1.js +0 -4
- package/dist/chunks/right-panel-x971k0zc.js +0 -4
- package/dist/chunks/source-control-k4p00hpe.js +0 -4
- package/dist/chunks/studio-1d8m5s38.js +0 -16
- package/dist/chunks/studio-35pmfjtx.js +0 -5
- package/dist/chunks/studio-44xqe0b7.js +0 -4
- package/dist/chunks/studio-48yzqzqr.js +0 -5
- package/dist/chunks/studio-5rq3e4q5.js +0 -5
- package/dist/chunks/studio-6hcfm9q3.js +0 -5
- package/dist/chunks/studio-6mf31e16.js +0 -5
- package/dist/chunks/studio-8w5pa88p.js +0 -7
- package/dist/chunks/studio-9c6cbq2c.js +0 -4
- package/dist/chunks/studio-aaw7wxv8.js +0 -5
- package/dist/chunks/studio-afx9brsc.js +0 -5
- package/dist/chunks/studio-dmgh2rrj.js +0 -5
- package/dist/chunks/studio-erjccagy.js +0 -5
- package/dist/chunks/studio-ex1644g2.js +0 -5
- package/dist/chunks/studio-gw83z798.js +0 -7
- package/dist/chunks/studio-j52ks8q7.js +0 -5
- package/dist/chunks/studio-kefs4sz4.js +0 -5
- package/dist/chunks/studio-m3jrjfhy.js +0 -14
- package/dist/chunks/studio-n4pnf0sw.js +0 -5
- package/dist/chunks/studio-ncwx602y.js +0 -5
- package/dist/chunks/studio-nzp0sqjg.js +0 -5
- package/dist/chunks/studio-ph17an19.js +0 -5
- package/dist/chunks/studio-q509sqt8.js +0 -5
- package/dist/chunks/studio-s49y6m5b.js +0 -5
- package/dist/chunks/studio-t46rt6gx.js +0 -5
- package/dist/chunks/studio-veh91hjv.js +0 -5
- package/dist/chunks/studio-vswmz40d.js +0 -6
- package/dist/chunks/studio-w4mfaaam.js +0 -5
- package/dist/chunks/studio-x5py815g.js +0 -5
- package/dist/chunks/studio-z6s56dzz.js +0 -5
- package/dist/chunks/studio-ze1sm147.js +0 -7
- package/dist/chunks/studio-zn7ysyzb.js +0 -5
- package/dist/chunks/toast-w11qpkyz.js +0 -4
- package/dist/chunks/workspace-home-61n1jz3q.js +0 -4
- package/dist/chunks/workspace-sheek6zw.js +0 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{De}from"./studio-
|
|
2
|
-
export{
|
|
1
|
+
import{De}from"./studio-mrb10hv3.js";import{bt,La,Jr,zo}from"./studio-m25ry0mf.js";import{Wt,td,ti,qn,Se,fi,Fe,g,Yo,pn,S1,cg,kh,id}from"./studio-ybkd5w8k.js";import{nr,Ls,gl,u}from"./studio-3kmqhwtt.js";import{zt}from"./studio-anc8067x.js";import{re}from"./studio-ft706q02.js";import{te}from"./studio-y3tjh2xb.js";var wS=["code","layout","component","diff","breakpoint","locale"],T={breakpoint:"design",code:"source",component:"design"},x={design:"Design",source:"Code"},k="Could not read this file's comparison against HEAD.";var Bu={breakpoint:"Same page at",code:"Code",component:"Component definition",diff:"Diff vs HEAD",layout:"Layout",locale:"Same page in"};function R(e){let t=pn(e)?.derived;if(!t)return null;let o=bt(t.sourcePaneId);if(!o)return{diffPath:null,kind:t.kind,media:null,mode:null,path:null,probePath:null,reason:"The pane this one follows has no document open.",select:null,status:"unavailable"};if(t.kind==="lens")return w(e,t,o);return S(e,t,o)}function w(e,t,o){let n={diffPath:null,kind:"lens",media:t.media,mode:t.mode,path:null,probePath:null,select:null};if(t.preset==="diff"){let i=o.documentPath;if(!m(i))return{...n,reason:"Nothing to compare — this file matches HEAD.",status:"unavailable"};if(t.diff?.filePath===i&&(t.diffRev===void 0||t.diffRev===u.git.rev))return{...n,reason:"",status:"ready"};if(c.get(e)?.failed&&c.get(e)?.path===i)return{...n,reason:k,status:"unavailable"};return{...n,diffPath:i,reason:"",status:"loading"}}if(t.preset==="code"&&La(o)==="source")return{...n,reason:"The pane this one follows is showing Code — one document has one editor.",status:"unavailable"};if(t.preset==="breakpoint"&&!xS(o).includes(t.media))return{...n,reason:`This document does not declare a "${t.media??"base"}" breakpoint.`,status:"unavailable"};return{...n,reason:"",status:"ready"}}function m(e){return u.git.status?.files.find((t)=>t.path===e&&(t.status==="M"||t.status==="A"||t.status==="U"))??null}function S(e,t,o){let n={diffPath:null,kind:"companion",media:null,mode:null};if(t.preset==="layout"){let a=u.layoutSelection,r=a?.layoutFile??gl(o.doc.document.$layout);return r===null?{...n,path:null,probePath:null,reason:"This page has no layout.",select:null,status:"unavailable"}:{...n,path:r,probePath:null,reason:"",select:a?a.layoutPath:null,status:"ready"}}if(t.preset==="locale"){let a=Ls(),r=o.documentPath===null||t.locale===null?null:td(o.documentPath,t.locale,a);if(r===null)return{...n,path:null,probePath:null,reason:"This document has no path in that locale.",select:null,status:"unavailable"};let l=d.get(e);if(l?.path!==r||l.exists===null)return{...n,path:null,probePath:r,reason:"",select:null,status:"loading"};if(!l.exists)return{...n,path:null,probePath:null,reason:`No ${Wt(t.locale)} copy of this document yet — `+"the Languages panel can create one.",select:null,status:"unavailable"};return{...n,path:r,probePath:null,reason:"",select:null,status:"ready"}}let i=_(o);if(i===null)return t.resolved===null?{...n,path:null,probePath:null,reason:"Select an element inside a component to see its definition.",select:null,status:"unavailable"}:{...n,path:null,probePath:null,reason:"",select:null,status:"ready"};return{...n,path:i,probePath:null,reason:"",select:null,status:"ready"}}function xS(e){let{sizeBreakpoints:t}=zo(nr(e.doc.document.$media));return[null,...t.map((o)=>o.name)]}function _(e){let[t]=e?.session.selection??[];if(!e||!t)return null;let o=e.doc.document,n=[...t];while(n){let i=re(o,n),a=i?De.find((r)=>r.tagName===i.tagName):null;if(a?.path)return a.path;n=zt(n)}return null}function F(e,t){if(t.sourcePaneId===e||!pn(t.sourcePaneId))throw RangeError(`pane "${e}" cannot derive from "${t.sourcePaneId}" — a derivation names `+"another pane that is in the grid");b(e,t)}function b(e,t){let o=pn(e);if(o)c.delete(e),d.delete(e),o.derived=t}function uT(e){b(e,null)}function f(e,t){let o=pn(e),n=o?.derived,i=R(e);if(!o||!n||!i)return;if(Jr.derivedResolves+=1,n.status=i.status,n.reason=i.reason,n.kind==="lens"){let r=pn(n.sourcePaneId);if(o.tabOrder.length>0||o.activeTabId!==null){let l=[...o.tabOrder];for(let s of l)if(cg(s),r)kh(r,s);o.activeTabId=null}if(n.preset==="diff"&&i.status!=="ready")n.diff=null;A(e,i,t);return}if(C(e,i,t),n.resolved!==null&&bt(e)===null)n.resolved=null;if(i.path===null||i.path===n.resolved){v(e,i);return}n.resolved=i.path,Jr.derivedRetargets+=1;let a=t.openFileInPane(e,i.path);if(i.select===null)return;Promise.resolve(a).then(()=>{v(e,i)})}function v(e,t){let o=t.select,n=bt(e);if(!o||!n||t.path!==null&&n.documentPath!==t.path)return;let[i]=n.session.selection;if(i?.length===o.length&&i.every((a,r)=>a===o[r]))return;n.session.selection=[[...o]]}var c=new Map;function A(e,t,o){let n=t.diffPath,i=m(n),{rev:a}=u.git,r=c.get(e);if(n===null||!i||r?.path===n&&r.rev===a)return;c.set(e,{failed:!1,path:n,rev:a}),o.loadDiff(n,i.status).then((l)=>{let s=pn(e)?.derived;if(s?.kind!=="lens"||s.preset!=="diff"||c.get(e)?.path!==n)return;if(l)s.diff=l,s.diffRev=a;else c.set(e,{failed:!0,path:n,rev:a});f(e,o)}).catch((l)=>{console.error("loadDiff error:",l)})}var d=new Map;function C(e,t,o){let n=t.probePath;if(n===null||d.get(e)?.path===n)return;d.set(e,{exists:null,path:n}),o.fileExists(n).then((i)=>{let a=pn(e)?.derived;if(a?.kind!=="companion"||a.preset!=="locale"||d.get(e)?.path!==n)return;d.set(e,{exists:i,path:n}),f(e,o)}).catch((i)=>{console.error("fileExists error:",i)})}var p=new Map;function M(e,t){if(p.has(e))return;p.set(e,requestAnimationFrame(()=>{p.delete(e);try{f(e,t)}catch(o){console.error("applyDerivation error:",o)}}))}function wD(e,t){te(()=>{let o=pn(e),n=o?.derived;if(!n)return;o.activeTabId;let i=bt(n.sourcePaneId);if(n.kind==="lens"&&n.preset==="code")i?.session.ui.canvasMode;if(n.kind==="companion"&&n.preset==="component")i?.session.selection;if(n.kind==="companion"&&n.preset==="layout")u.layoutSelection,i?.doc.document?.$layout;M(e,t)})}function $w(e,t,o,n=null){let i=bt(t);if(!i)return"an open document";let a=T[e];if(a&&!i.capabilities.modes.includes(a))return`a document with a ${x[a]} view — this one declares none`;if(e==="code")return La(i)==="source"?"a source pane that is not already showing Code":null;if(e==="diff")return m(i.documentPath)===null?"a file with changes against HEAD":null;if(e==="breakpoint")return xS(i).includes(o)?null:"a breakpoint this document declares — see Project Settings › Contexts";if(e==="layout")return gl(i.doc.document.$layout)===null?"a page with a layout — this one declares none":null;if(e==="locale"){let r=Ls();if(r===null||r.locales.length<2)return"a project that declares more than one locale — see Project Settings › Locales";if(i.documentPath===null)return"a document that has been saved";return n!==null&&r.locales.includes(n)?null:"a locale this project declares"}return null}function Tb(e){let t=pn(e);return t&&t.activeTabId!==null&&t.derived===null?null:D}var D="an open document in a pane that is not itself derived";function O(e,t,o,n=null){if(e==="locale")return{kind:"companion",locale:n,preset:e,reason:"",resolved:null,sourcePaneId:t,status:"loading"};if(e==="layout"||e==="component")return{kind:"companion",preset:e,reason:"",resolved:null,sourcePaneId:t,status:"loading"};return{diff:null,kind:"lens",media:e==="breakpoint"?o:null,mode:e==="code"?"source":e==="diff"?"git-diff":"design",preset:e,reason:"",sourcePaneId:t,status:"loading",zoom:1}}function P(){return g.panes.find((e)=>hT(e.id)===null)??null}function hT(e){let t=pn(e);return t?.derived?.kind==="companion"&&t.activeTabId?null:y}var y="a derived pane showing a document of its own — Code, Diff and breakpoint views project "+"the document already open beside them";function xD(e){return[{args:Se({locale:Fe('BCP 47 tag for preset "locale". Ignored by every other preset.'),media:Fe('Breakpoint name for preset "breakpoint" — omit or leave empty for the base size. '+"Ignored by every other preset."),preset:fi(wS,"Which projection of this pane's document to show beside it.")},["preset"]),id:"pane.derive",title:"Show Beside This…",category:"View",level:"document",menus:["context/pane"],group:"5_pane",when:(t)=>t.document.open,enablement:()=>Tb(Yo().id)===null,requires:D,undo:"none",run:(t,o)=>{let n=qn("pane.derive",o,"preset",wS),i=ti("pane.derive",o,"media")??null,a=ti("pane.derive",o,"locale")??null,r=Yo(),l=$w(n,r.id,i,a);if(l)throw RangeError(`command "pane.derive" argument "preset": "${n}" requires ${l}`);let s=S1(r.id);F(s.id,O(n,r.id,i,a));let E=[...s.tabOrder];for(let h of E)cg(h),kh(r,h);f(s.id,e)}},{id:"pane.pin",title:"Keep This Document",category:"View",level:"document",menus:["context/pane","palette"],group:"5_pane",enablement:()=>P()!==null,requires:y,undo:"none",run:()=>{let t=P();if(!t?.activeTabId)return;id(t.activeTabId),uT(t.id)}}]}
|
|
2
|
+
export{wS,Bu,xS,uT,wD,$w,Tb,hT,xD};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
5
|
-
//# sourceMappingURL=studio-
|
|
4
|
+
//# debugId=1E35C792562B0B9264756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-gahswxp4.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{jt,Wi,fn,lo,Ma}from"./studio-ex1644g2.js";import{w}from"./studio-bk0anq3b.js";import{jn,Qc,St,Hi,Se,Tr,Fe,Gd,h}from"./studio-s49y6m5b.js";import{Lr}from"./studio-zav9hgb3.js";import{X}from"./studio-9c6cbq2c.js";import{xm}from"./studio-nngc45ct.js";import{us,ly,La}from"./studio-td3h1644.js";import{ks,eO,e$}from"./studio-15mfah02.js";import{Cr}from"./studio-1d8m5s38.js";import{wo,ih}from"./studio-aaw7wxv8.js";import{Lw,$b}from"./studio-bpzwhn88.js";import{Ib}from"./studio-pte5w7rf.js";import{ql}from"./studio-ph17an19.js";import{qs,sl,GT}from"./studio-6mf31e16.js";import{m}from"./studio-erjccagy.js";import{ce}from"./studio-7qqb7hb8.js";var kb=["page","collection","template","component","media","entry"],Tw={collection:{cta:"Create collection",hint:"Posts, products, team… with a page each",icon:"stack",id:"collection",label:"Collection",nameLabel:"Collection name",placeholder:"Recipes"},component:{cta:"Create component",hint:"A reusable block for any page",icon:"cube",id:"component",label:"Component",nameLabel:"Component name",placeholder:"Pricing table"},entry:{cta:"Create entry",hint:"A new item in a collection",icon:"file-text",id:"entry",label:"Entry",nameLabel:"Entry name",placeholder:"My first post"},media:{cta:"Upload",hint:"Images, video, documents",icon:"image",id:"media",label:"Media",nameLabel:"",placeholder:""},page:{cta:"Create page",hint:"A new URL on your site",icon:"file",id:"page",label:"Page",nameLabel:"Page name",placeholder:"Pricing"},template:{cta:"Create template",hint:"Shared frame that pages sit inside",icon:"frame-corners",id:"template",label:"Template",nameLabel:"Template name",placeholder:"Landing"}},Us="blank",jc="article",v0="selection",vm="copy",$w=["title","image","richText","date","tags","number","link"],w0={date:{key:"date",label:"Date",schema:{format:"date",type:"string"}},image:{key:"cover",label:"Image",schema:{format:"image",type:"string"}},link:{key:"link",label:"Link",schema:{format:"uri",type:"string"}},number:{key:"number",label:"Number",schema:{type:"number"}},richText:{key:null,label:"Rich text",schema:null},tags:{key:"tags",label:"Tags",schema:{items:{type:"string"},type:"array"}},title:{key:"title",label:"Title",schema:{type:"string"}}},cT=["title","image","richText"];function p(e,n){return e==="."||e===""?n:`${e}/${n}`}function rl(e){return e.replace(/^\.\//,"")}function x0(e,n){let t=n.defaultLayout;if(e===Us||e==="")return t?!1:void 0;if(t&&rl(t)===rl(e))return;return e}function Hu(e){let n=e.defaultLayout;if(n)return e.layouts.find((r)=>rl(r.ref)===rl(n))?.ref??n;return e.layouts[0]?.ref??Us}function _0(e,n){let t=jn(n??"");if(t!==null){let r=e.layouts.find((o)=>rl(o.ref).replace(/\.json$/i,"").split("/").some((l)=>jn(l)===t));if(r)return r.ref}return Hu(e)}function I(e){return e.trim().replaceAll("\\","/").split("/").map((n)=>us(n)).filter((n)=>n!=="")}function D(e){let n={};for(let r of $w){let o=w0[r];if(e.includes(r)&&o.key!==null&&o.schema!==null)n[o.key]={...o.schema}}let t={properties:n,type:"object"};if(e.includes("title"))t.required=["title"];return t}function mD(e,n){let t=e?.properties??{};return $w.filter((r)=>{let{key:o}=w0[r];return o===null?n:Object.hasOwn(t,o)})}function L(e,n){let t=GT(e.schema);if(n!==void 0&&n!==""&&e.schema?.properties?.title!==void 0)t.title=n;if(e.ext===".json"||e.formatName===null)return{doc:t,format:null};return{doc:{...t,children:[]},format:e.formatName,frontmatter:Object.keys(t).length>0}}function dT(e,n,t,r){let o=[];if(n.includes("title"))o.push({tagName:"h1",textContent:"${state.entry.data.title}"});if(n.includes("image"))o.push({attributes:{alt:n.includes("title")?"${state.entry.data.title}":"",loading:"lazy",src:"${state.entry.data.cover}"},tagName:"img"});if(n.includes("richText")&&r.contentFormat!==null)o.push({children:"${state.entry.$children}",tagName:"div"});let i={};if(t!==void 0)i.$layout=t;return i.$paths={contentType:e,field:"id",param:"slug"},i.title=n.includes("title")?"${state.entry.data.title}":ih(e),i.state={entry:{$prototype:"ContentEntry",$src:"@jxsuite/parser/ContentEntry.class.json",contentType:e,field:"id",id:{$ref:"#/$params/slug"}}},i.tagName="article",i.children=o,i}function wm(e,n){let t=n.i18n??null,r=jn(e);return t!==null&&r!==null&&t.locales.includes(r)?r:null}function Eb(e){return e.dir.includes(Lr)}function _(e,n){return e.localeDirs?.[n]??e.dir.replace(Lr,n.toLowerCase())}function S(e,n,t){let r=t.i18n??null;if(n===null||r===null)return e;return Qc(e,n,{...r,locales:[...r.locales]})??e}function J(e){let n=e.lastIndexOf("/");return n===-1?[".",e]:[e.slice(0,n),e.slice(n+1)]}function W(e,n,t){if(n.startFrom===vm&&n.copyOf!==void 0){let r=t.componentDocs?.get(n.copyOf);if(r){let o=JSON.parse(JSON.stringify(r));return delete o.$id,o.tagName=e,o}}return{children:[],tagName:e}}function H(e,n,t){let r=n.startFrom??Hu(t),o=r===jc&&t.article!==null?t.article:null,i=o?.ext??".json",l=n.url===void 0?[us(e)].filter((u)=>u!==""):I(n.url),a=l.length===0?n.url===void 0?"":"index":l.at(-1),s=["pages",...l.slice(0,-1)].join("/"),c=a===""?"":`${a}${i}`,f=wm(n.locale,t),d=c===""?p(s,c):S(p(s,c),f,t),b=c===""?s:J(d)[0],g=e.trim(),y;if(o)y={doc:{children:[{tagName:"h1",textContent:g}],title:g},format:o.name,frontmatter:!0};else{let u={},C=x0(r===jc?Us:r,t);if(C!==void 0)u.$layout=C;u.title=g,u.tagName="main",u.children=[{tagName:"h1",textContent:g}],y={doc:u,format:null}}let N=c===""?"":wo(d).urlPattern;return{content:y,dir:b,ext:i,extraWrites:[],fileName:c,kind:"page",path:d,route:N,saved:c===""?"":`Saved as ${d} · opens at ${N}`}}function B(e,n,t){let r=us(e),o=n.fields??cT,i=t.i18n??null,l=i!==null&&n.localized!==!1,a=`content/${r}`,s=l?`${a}/${i.defaultLocale.toLowerCase()}`:a,c=t.contentFormat,f=c?.ext??".json",d=ih(r),b=r===""?"":`first-${d.replaceAll(" ","-")}${f}`,g=D(o),y=structuredClone(g),N={format:c?.name??"json",schema:m(y)?y:{},source:l?`./${a}/${Lr}`:`./${a}`},u=L({ext:f,formatName:c?.name??null,schema:g},`First ${d}`),C=[],T,O="";if(n.ownPage!==!1&&r!==""){let j=n.pageTemplate??Hu(t),A=l?[i.defaultLocale,...i.locales.filter((x)=>x!==i.defaultLocale)]:[null],k=[];for(let x of A){let P=S(`pages/${r}/[slug].json`,x,t),R=x===null||j!==Hu(t)?j:_0(t,x);T??=wo(P).urlPattern,C.push({body:{doc:dT(r,o,x0(R,t),t),format:null},path:P}),k.push(P)}O=k.length===1?`, and ${k[0]} at ${T}`:`, and a page in each language (${k.join(", ")})`}let E={config:{entry:N,name:r},content:u,dir:s,ext:f,extraWrites:C,fileName:b,kind:"collection",path:p(s,b),saved:r===""?"":l?`Adds a “${r}” collection to project.json with one folder per language under ${a}/, a first entry in ${s}/${O}.`:`Adds a “${r}” collection to project.json, a ${s}/ folder with a first entry${O}.`};if(T!==void 0)E.route=T;return E}function K(e,n){let t=us(e),r=t===""?"":`${t}.json`,o=p("layouts",r),i={},l=n.startFrom??"";if(l!==""&&l!==Us)i.$layout=l;return i.tagName="div",i.children=[{children:[{tagName:"slot"}],tagName:"main"}],{content:{doc:i,format:null},dir:"layouts",ext:".json",extraWrites:[],fileName:r,kind:"template",path:o,saved:r===""?"":`Saved as ${o} with one slot.`}}function M(e,n,t){let r=$b(e),o=r===""?"":`${r}.json`,i=p("components",o);return{content:{doc:W(r,n,t),format:null},dir:"components",ext:".json",extraWrites:[],fileName:o,kind:"component",path:i,saved:o===""?"":`Saved as ${i} with tag <${r}>.`,tag:r}}function z(e,n,t){let r=t.collections.find((d)=>d.name===n.collection)??null,o=us(e),i=r?.ext??".json",l=wm(n.locale,t),a=r!==null&&Eb(r)&&l===null,s=r===null?"content":Eb(r)&&l!==null?_(r,l):r.dir,c=o===""||r===null||a?"":`${o}${i}`,f=p(s,c);return{content:r?L(r,e.trim()):{doc:{},format:null},dir:s,ext:i,extraWrites:[],fileName:c,kind:"entry",path:f,saved:c===""?"":`Saved as ${f} in ${r.name}.`}}function uT(e,n,t,r){switch(e){case"page":return H(n,t,r);case"collection":return B(n,t,r);case"template":return K(n,t);case"component":return M(n,t,r);case"entry":return z(n,t,r);default:{let o=t.files??0;return{content:{doc:{},format:null},dir:La,ext:"",extraWrites:[],fileName:"",kind:e,path:La,saved:o===0?`Saved under ${La}/. No folder to choose.`:`${o===1?"1 file":`${o} files`} will be saved under ${La}/.`}}}}function U(e,n){let t=e.lastIndexOf("/"),r=t===-1?".":e.slice(0,t),o=n(r);return ly(e.slice(t+1),"",{dir:r,taken:o??new Set})}function F(e){if(e.kind!=="page"||e.fileName==="")return[];let n=e.fileName.slice(0,e.fileName.length-e.ext.length);if(n!=="index")return[{dir:e.dir,stem:n},{dir:p(e.dir,n),stem:"index"}];let t=e.dir.lastIndexOf("/");if(t===-1)return[{dir:e.dir,stem:n}];return[{dir:e.dir,stem:n},{dir:e.dir.slice(0,t),stem:e.dir.slice(t+1)}]}function q(e,n){let t=e.fileName.toLowerCase();for(let{dir:r,stem:o}of F(e)){let i=`${o.toLowerCase()}.`;for(let l of n(r)??[])if(l.startsWith(i)&&!(r===e.dir&&l===t))return p(r,l)}return null}function V(e){return ly(e,"",{choice:{ext:"",kind:"fixed"},dir:".",taken:new Set})}function hT(e,n,t,r,o){if(e.kind==="media")return(t.files??0)===0?"Drop files here, or browse for them.":"";let i=V(n);if(i!=="")return i;switch(e.kind){case"page":{if(t.url!==void 0){if(t.url.replaceAll("\\","/").split("/").includes(".."))return"A URL cannot step outside the site.";if(!t.url.trim().startsWith("/"))return"A URL starts with a slash, such as /pricing."}let a=q(e,o);if(a!==null)return`${a} already opens at ${e.route??"/"}.`;break}case"component":{let a=e.tag??"",s=Lw(a);if(s!=="")return s;if(r.componentTags.includes(a))return`A component named <${a}> already exists.`;if(t.startFrom===v0&&r.hasSelection!==!0)return"Select an element on the canvas to make a component from it.";if(t.startFrom===vm&&(t.copyOf===void 0||r.componentDocs?.get(t.copyOf)===void 0))return"Choose the component to copy.";break}case"collection":{let a=e.config?.name??"";if(r.declaredContent.includes(a))return`A collection named “${a}” already exists.`;if(o("content")?.has(a)===!0)return`content/${a}/ already exists.`;break}case"entry":{let a=r.collections.find((s)=>s.name===t.collection);if(!a)return"Choose the collection this entry belongs to.";if(Eb(a)&&wm(t.locale,r)===null)return`Choose the language this ${ih(a.name)} is written in.`;break}default:break}let l=[...e.kind==="collection"?[]:[e.path],...e.extraWrites.map((a)=>a.path)];for(let a of l){let s=U(a,o);if(s!=="")return s}return""}function pT(e){let n=new Set,t=(r)=>{let o=r.lastIndexOf("/");n.add(o===-1?".":r.slice(0,o))};if(e.kind==="media")return[];if(e.kind==="collection")n.add("content");else if(e.fileName!=="")t(e.path);for(let r of e.extraWrites)t(r.path);for(let{dir:r}of F(e))n.add(r);return[...n]}function gD(e){let n=(r)=>r==="."?0:r.split("/").length,t=new Map;for(let r of e){let o=n(r);t.set(o,[...t.get(o)??[],r])}return[...t.entries()].toSorted(([r],[o])=>r-o).map(([,r])=>r)}function bD(e,n){if(e===".")return!1;let t=e.lastIndexOf("/"),r=n.get(t===-1?".":e.slice(0,t));return r!==void 0&&!r.has(e.slice(t+1).toLowerCase())}function S0(e){if(e.ext===".json")return null;return(e.def.format?Wi(e.def.format)?.name:void 0)??fn(`untitled${e.ext}`)?.name??lo()?.name??null}async function G(e){let n=L({ext:e.ext,formatName:S0(e),schema:e.schema});if(n.format===null)return Cr(n.doc,null);return Ma(n.format,n.doc,{frontmatter:n.frontmatter??!1,mode:"roundtrip"})}async function $F(e,n={}){let t=qs(e);if(!t)return w.error(`No content collection named "${e}" to create an entry in.`,{detail:"A collection needs a `content` entry in project.json whose `source` is a directory. A collection whose source names a single file (a CSV catalogue) has rows, not entry files.",source:"Content"}),null;await jt().catch(()=>{});let r;try{r=await G(t)}catch(s){return w.error(`Could not prepare a new ${t.name} entry.`,{detail:X(s),path:t.dir,source:"Content"}),null}let o=n.dir,i=o!==void 0&&Gd(o)?.name===t.name?o:t.dir;if(i.includes(Lr))return w.error(`"${t.name}" is a localized collection.`,{detail:`Its entries live in one directory per language (${t.dir}). Open the folder for the language you are writing in and create the entry there.`,path:t.dir,source:"Content"}),null;let{createFileIn:l}=await (ce("b2p9y0yz"),import("./files-b2p9y0yz.js")),a=await l({content:r,dir:i,format:{ext:t.ext,kind:"fixed"},source:"Content",suggestedName:"untitled",title:`New ${t.name} entry`});if(a===null)return null;return xm(t.name),await ql(a),a}function v(){let e=h.value;return e&&sl(e.documentPath)?e:null}function Y(){return sl(v()?.documentPath??null)}function Q(){return[{args:Se({path:Fe("Project-relative path of the entry file to open.")}),category:"File",id:"content.openEntry",level:"project",menus:["context/file","palette"],group:"1_file",requires:"an open project",when:(e)=>e.project.open,run:async(e,n)=>{await ql(St("content.openEntry",n,"path"))},title:"Open Entry"},{args:Se({hold:Tr("True holds the open entry back from production; false releases it. Written to the one-field `hold` rule its collection declares.")}),category:"Document",id:"content.setHold",level:"document",menus:["context/tab","palette"],group:"3_document",requires:"a content entry whose collection has a one-field hold rule",when:(e)=>e.document.open,enablement:()=>ks(Y()?.def)!==null,undo:"document",run:(e,n)=>{let t=v();if(!t)throw Error("content.setHold: the active document is not a content entry");Ib(t,Hi("content.setHold",n,"hold"))},title:"Set Hold"},{args:Se({include:Tr("True lists entries a `hold` rule matches alongside the rest.")}),category:"View",id:"content.setIncludeHeld",level:"project",menus:["palette"],group:"2_view",requires:"an open project",when:(e)=>e.project.open,run:async(e,n)=>{eO(Hi("content.setIncludeHeld",n,"include")),await e$()},title:"Include Held Entries"}]}function fT(e){e.registerAll(Q())}
|
|
2
|
-
export{
|
|
1
|
+
import{Z}from"./studio-mkjrjpr2.js";import{jt,zi,fn,co,ja}from"./studio-hf259xzd.js";import{w}from"./studio-5k9mfafh.js";import{jn,td,St,Bi,Se,$r,Fe,Yd,h}from"./studio-ybkd5w8k.js";import{Rr}from"./studio-52mzbxqm.js";import{km}from"./studio-dj8ctxey.js";import{hs,hy,Ia}from"./studio-jj9gf1qc.js";import{Ts,uO,c$}from"./studio-qcc5hsw2.js";import{xo,oh}from"./studio-m25ry0mf.js";import{Ow,Nb}from"./studio-0wa4wv4s.js";import{Ab}from"./studio-z89e6wpg.js";import{Kl}from"./studio-jbva4wxw.js";import{Js,ll,i$}from"./studio-pafmb06w.js";import{vr}from"./studio-213pyfxh.js";import{f}from"./studio-0z8kp4xk.js";import{ce}from"./studio-nhpg405j.js";var Lb=["page","collection","template","component","media","entry"],Nw={collection:{cta:"Create collection",hint:"Posts, products, team… with a page each",icon:"stack",id:"collection",label:"Collection",nameLabel:"Collection name",placeholder:"Recipes"},component:{cta:"Create component",hint:"A reusable block for any page",icon:"cube",id:"component",label:"Component",nameLabel:"Component name",placeholder:"Pricing table"},entry:{cta:"Create entry",hint:"A new item in a collection",icon:"file-text",id:"entry",label:"Entry",nameLabel:"Entry name",placeholder:"My first post"},media:{cta:"Upload",hint:"Images, video, documents",icon:"image",id:"media",label:"Media",nameLabel:"",placeholder:""},page:{cta:"Create page",hint:"A new URL on your site",icon:"file",id:"page",label:"Page",nameLabel:"Page name",placeholder:"Pricing"},template:{cta:"Create template",hint:"Shared frame that pages sit inside",icon:"frame-corners",id:"template",label:"Template",nameLabel:"Template name",placeholder:"Landing"}},qs="blank",Bc="article",TS="selection",Sm="copy",Dw=["title","image","richText","date","tags","number","link"],$S={date:{key:"date",label:"Date",schema:{format:"date",type:"string"}},image:{key:"cover",label:"Image",schema:{format:"image",type:"string"}},link:{key:"link",label:"Link",schema:{format:"uri",type:"string"}},number:{key:"number",label:"Number",schema:{type:"number"}},richText:{key:null,label:"Rich text",schema:null},tags:{key:"tags",label:"Tags",schema:{items:{type:"string"},type:"array"}},title:{key:"title",label:"Title",schema:{type:"string"}}},bT=["title","image","richText"];function p(e,n){return e==="."||e===""?n:`${e}/${n}`}function sl(e){return e.replace(/^\.\//,"")}function LS(e,n){let t=n.defaultLayout;if(e===qs||e==="")return t?!1:void 0;if(t&&sl(t)===sl(e))return;return e}function Vu(e){let n=e.defaultLayout;if(n)return e.layouts.find((r)=>sl(r.ref)===sl(n))?.ref??n;return e.layouts[0]?.ref??qs}function RS(e,n){let t=jn(n??"");if(t!==null){let r=e.layouts.find((o)=>sl(o.ref).replace(/\.json$/i,"").split("/").some((l)=>jn(l)===t));if(r)return r.ref}return Vu(e)}function I(e){return e.trim().replaceAll("\\","/").split("/").map((n)=>hs(n)).filter((n)=>n!=="")}function D(e){let n={};for(let r of Dw){let o=$S[r];if(e.includes(r)&&o.key!==null&&o.schema!==null)n[o.key]={...o.schema}}let t={properties:n,type:"object"};if(e.includes("title"))t.required=["title"];return t}function ED(e,n){let t=e?.properties??{};return Dw.filter((r)=>{let{key:o}=$S[r];return o===null?n:Object.hasOwn(t,o)})}function L(e,n){let t=i$(e.schema);if(n!==void 0&&n!==""&&e.schema?.properties?.title!==void 0)t.title=n;if(e.ext===".json"||e.formatName===null)return{doc:t,format:null};return{doc:{...t,children:[]},format:e.formatName,frontmatter:Object.keys(t).length>0}}function yT(e,n,t,r){let o=[];if(n.includes("title"))o.push({tagName:"h1",textContent:"${state.entry.data.title}"});if(n.includes("image"))o.push({attributes:{alt:n.includes("title")?"${state.entry.data.title}":"",loading:"lazy",src:"${state.entry.data.cover}"},tagName:"img"});if(n.includes("richText")&&r.contentFormat!==null)o.push({children:"${state.entry.$children}",tagName:"div"});let i={};if(t!==void 0)i.$layout=t;return i.$paths={contentType:e,field:"id",param:"slug"},i.title=n.includes("title")?"${state.entry.data.title}":oh(e),i.state={entry:{$prototype:"ContentEntry",$src:"@jxsuite/parser/ContentEntry.class.json",contentType:e,field:"id",id:{$ref:"#/$params/slug"}}},i.tagName="article",i.children=o,i}function Cm(e,n){let t=n.i18n??null,r=jn(e);return t!==null&&r!==null&&t.locales.includes(r)?r:null}function Rb(e){return e.dir.includes(Rr)}function _(e,n){return e.localeDirs?.[n]??e.dir.replace(Rr,n.toLowerCase())}function S(e,n,t){let r=t.i18n??null;if(n===null||r===null)return e;return td(e,n,{...r,locales:[...r.locales]})??e}function J(e){let n=e.lastIndexOf("/");return n===-1?[".",e]:[e.slice(0,n),e.slice(n+1)]}function W(e,n,t){if(n.startFrom===Sm&&n.copyOf!==void 0){let r=t.componentDocs?.get(n.copyOf);if(r){let o=JSON.parse(JSON.stringify(r));return delete o.$id,o.tagName=e,o}}return{children:[],tagName:e}}function H(e,n,t){let r=n.startFrom??Vu(t),o=r===Bc&&t.article!==null?t.article:null,i=o?.ext??".json",l=n.url===void 0?[hs(e)].filter((u)=>u!==""):I(n.url),a=l.length===0?n.url===void 0?"":"index":l.at(-1),s=["pages",...l.slice(0,-1)].join("/"),c=a===""?"":`${a}${i}`,m=Cm(n.locale,t),d=c===""?p(s,c):S(p(s,c),m,t),b=c===""?s:J(d)[0],g=e.trim(),y;if(o)y={doc:{children:[{tagName:"h1",textContent:g}],title:g},format:o.name,frontmatter:!0};else{let u={},C=LS(r===Bc?qs:r,t);if(C!==void 0)u.$layout=C;u.title=g,u.tagName="main",u.children=[{tagName:"h1",textContent:g}],y={doc:u,format:null}}let N=c===""?"":xo(d).urlPattern;return{content:y,dir:b,ext:i,extraWrites:[],fileName:c,kind:"page",path:d,route:N,saved:c===""?"":`Saved as ${d} · opens at ${N}`}}function B(e,n,t){let r=hs(e),o=n.fields??bT,i=t.i18n??null,l=i!==null&&n.localized!==!1,a=`content/${r}`,s=l?`${a}/${i.defaultLocale.toLowerCase()}`:a,c=t.contentFormat,m=c?.ext??".json",d=oh(r),b=r===""?"":`first-${d.replaceAll(" ","-")}${m}`,g=D(o),y=structuredClone(g),N={format:c?.name??"json",schema:f(y)?y:{},source:l?`./${a}/${Rr}`:`./${a}`},u=L({ext:m,formatName:c?.name??null,schema:g},`First ${d}`),C=[],T,O="";if(n.ownPage!==!1&&r!==""){let j=n.pageTemplate??Vu(t),A=l?[i.defaultLocale,...i.locales.filter((x)=>x!==i.defaultLocale)]:[null],k=[];for(let x of A){let P=S(`pages/${r}/[slug].json`,x,t),R=x===null||j!==Vu(t)?j:RS(t,x);T??=xo(P).urlPattern,C.push({body:{doc:yT(r,o,LS(R,t),t),format:null},path:P}),k.push(P)}O=k.length===1?`, and ${k[0]} at ${T}`:`, and a page in each language (${k.join(", ")})`}let E={config:{entry:N,name:r},content:u,dir:s,ext:m,extraWrites:C,fileName:b,kind:"collection",path:p(s,b),saved:r===""?"":l?`Adds a “${r}” collection to project.json with one folder per language under ${a}/, a first entry in ${s}/${O}.`:`Adds a “${r}” collection to project.json, a ${s}/ folder with a first entry${O}.`};if(T!==void 0)E.route=T;return E}function K(e,n){let t=hs(e),r=t===""?"":`${t}.json`,o=p("layouts",r),i={},l=n.startFrom??"";if(l!==""&&l!==qs)i.$layout=l;return i.tagName="div",i.children=[{children:[{tagName:"slot"}],tagName:"main"}],{content:{doc:i,format:null},dir:"layouts",ext:".json",extraWrites:[],fileName:r,kind:"template",path:o,saved:r===""?"":`Saved as ${o} with one slot.`}}function M(e,n,t){let r=Nb(e),o=r===""?"":`${r}.json`,i=p("components",o);return{content:{doc:W(r,n,t),format:null},dir:"components",ext:".json",extraWrites:[],fileName:o,kind:"component",path:i,saved:o===""?"":`Saved as ${i} with tag <${r}>.`,tag:r}}function z(e,n,t){let r=t.collections.find((d)=>d.name===n.collection)??null,o=hs(e),i=r?.ext??".json",l=Cm(n.locale,t),a=r!==null&&Rb(r)&&l===null,s=r===null?"content":Rb(r)&&l!==null?_(r,l):r.dir,c=o===""||r===null||a?"":`${o}${i}`,m=p(s,c);return{content:r?L(r,e.trim()):{doc:{},format:null},dir:s,ext:i,extraWrites:[],fileName:c,kind:"entry",path:m,saved:c===""?"":`Saved as ${m} in ${r.name}.`}}function vT(e,n,t,r){switch(e){case"page":return H(n,t,r);case"collection":return B(n,t,r);case"template":return K(n,t);case"component":return M(n,t,r);case"entry":return z(n,t,r);default:{let o=t.files??0;return{content:{doc:{},format:null},dir:Ia,ext:"",extraWrites:[],fileName:"",kind:e,path:Ia,saved:o===0?`Saved under ${Ia}/. No folder to choose.`:`${o===1?"1 file":`${o} files`} will be saved under ${Ia}/.`}}}}function U(e,n){let t=e.lastIndexOf("/"),r=t===-1?".":e.slice(0,t),o=n(r);return hy(e.slice(t+1),"",{dir:r,taken:o??new Set})}function F(e){if(e.kind!=="page"||e.fileName==="")return[];let n=e.fileName.slice(0,e.fileName.length-e.ext.length);if(n!=="index")return[{dir:e.dir,stem:n},{dir:p(e.dir,n),stem:"index"}];let t=e.dir.lastIndexOf("/");if(t===-1)return[{dir:e.dir,stem:n}];return[{dir:e.dir,stem:n},{dir:e.dir.slice(0,t),stem:e.dir.slice(t+1)}]}function q(e,n){let t=e.fileName.toLowerCase();for(let{dir:r,stem:o}of F(e)){let i=`${o.toLowerCase()}.`;for(let l of n(r)??[])if(l.startsWith(i)&&!(r===e.dir&&l===t))return p(r,l)}return null}function V(e){return hy(e,"",{choice:{ext:"",kind:"fixed"},dir:".",taken:new Set})}function wT(e,n,t,r,o){if(e.kind==="media")return(t.files??0)===0?"Drop files here, or browse for them.":"";let i=V(n);if(i!=="")return i;switch(e.kind){case"page":{if(t.url!==void 0){if(t.url.replaceAll("\\","/").split("/").includes(".."))return"A URL cannot step outside the site.";if(!t.url.trim().startsWith("/"))return"A URL starts with a slash, such as /pricing."}let a=q(e,o);if(a!==null)return`${a} already opens at ${e.route??"/"}.`;break}case"component":{let a=e.tag??"",s=Ow(a);if(s!=="")return s;if(r.componentTags.includes(a))return`A component named <${a}> already exists.`;if(t.startFrom===TS&&r.hasSelection!==!0)return"Select an element on the canvas to make a component from it.";if(t.startFrom===Sm&&(t.copyOf===void 0||r.componentDocs?.get(t.copyOf)===void 0))return"Choose the component to copy.";break}case"collection":{let a=e.config?.name??"";if(r.declaredContent.includes(a))return`A collection named “${a}” already exists.`;if(o("content")?.has(a)===!0)return`content/${a}/ already exists.`;break}case"entry":{let a=r.collections.find((s)=>s.name===t.collection);if(!a)return"Choose the collection this entry belongs to.";if(Rb(a)&&Cm(t.locale,r)===null)return`Choose the language this ${oh(a.name)} is written in.`;break}default:break}let l=[...e.kind==="collection"?[]:[e.path],...e.extraWrites.map((a)=>a.path)];for(let a of l){let s=U(a,o);if(s!=="")return s}return""}function xT(e){let n=new Set,t=(r)=>{let o=r.lastIndexOf("/");n.add(o===-1?".":r.slice(0,o))};if(e.kind==="media")return[];if(e.kind==="collection")n.add("content");else if(e.fileName!=="")t(e.path);for(let r of e.extraWrites)t(r.path);for(let{dir:r}of F(e))n.add(r);return[...n]}function TD(e){let n=(r)=>r==="."?0:r.split("/").length,t=new Map;for(let r of e){let o=n(r);t.set(o,[...t.get(o)??[],r])}return[...t.entries()].toSorted(([r],[o])=>r-o).map(([,r])=>r)}function $D(e,n){if(e===".")return!1;let t=e.lastIndexOf("/"),r=n.get(t===-1?".":e.slice(0,t));return r!==void 0&&!r.has(e.slice(t+1).toLowerCase())}function IS(e){if(e.ext===".json")return null;return(e.def.format?zi(e.def.format)?.name:void 0)??fn(`untitled${e.ext}`)?.name??co()?.name??null}async function G(e){let n=L({ext:e.ext,formatName:IS(e),schema:e.schema});if(n.format===null)return vr(n.doc,null);return ja(n.format,n.doc,{frontmatter:n.frontmatter??!1,mode:"roundtrip"})}async function HF(e,n={}){let t=Js(e);if(!t)return w.error(`No content collection named "${e}" to create an entry in.`,{detail:"A collection needs a `content` entry in project.json whose `source` is a directory. A collection whose source names a single file (a CSV catalogue) has rows, not entry files.",source:"Content"}),null;await jt().catch(()=>{});let r;try{r=await G(t)}catch(s){return w.error(`Could not prepare a new ${t.name} entry.`,{detail:Z(s),path:t.dir,source:"Content"}),null}let o=n.dir,i=o!==void 0&&Yd(o)?.name===t.name?o:t.dir;if(i.includes(Rr))return w.error(`"${t.name}" is a localized collection.`,{detail:`Its entries live in one directory per language (${t.dir}). Open the folder for the language you are writing in and create the entry there.`,path:t.dir,source:"Content"}),null;let{createFileIn:l}=await (ce("8pf70854"),import("./files-8pf70854.js")),a=await l({content:r,dir:i,format:{ext:t.ext,kind:"fixed"},source:"Content",suggestedName:"untitled",title:`New ${t.name} entry`});if(a===null)return null;return km(t.name),await Kl(a),a}function v(){let e=h.value;return e&&ll(e.documentPath)?e:null}function Y(){return ll(v()?.documentPath??null)}function Q(){return[{args:Se({path:Fe("Project-relative path of the entry file to open.")}),category:"File",id:"content.openEntry",level:"project",menus:["context/file","palette"],group:"1_file",requires:"an open project",when:(e)=>e.project.open,run:async(e,n)=>{await Kl(St("content.openEntry",n,"path"))},title:"Open Entry"},{args:Se({hold:$r("True holds the open entry back from production; false releases it. Written to the one-field `hold` rule its collection declares.")}),category:"Document",id:"content.setHold",level:"document",menus:["context/tab","palette"],group:"3_document",requires:"a content entry whose collection has a one-field hold rule",when:(e)=>e.document.open,enablement:()=>Ts(Y()?.def)!==null,undo:"document",run:(e,n)=>{let t=v();if(!t)throw Error("content.setHold: the active document is not a content entry");Ab(t,Bi("content.setHold",n,"hold"))},title:"Set Hold"},{args:Se({include:$r("True lists entries a `hold` rule matches alongside the rest.")}),category:"View",id:"content.setIncludeHeld",level:"project",menus:["palette"],group:"2_view",requires:"an open project",when:(e)=>e.project.open,run:async(e,n)=>{uO(Bi("content.setIncludeHeld",n,"include")),await c$()},title:"Include Held Entries"}]}function _T(e){e.registerAll(Q())}
|
|
2
|
+
export{Lb,Nw,qs,Bc,TS,Sm,Dw,$S,bT,sl,LS,Vu,RS,ED,yT,Cm,Rb,vT,wT,xT,TD,$D,IS,HF,_T};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
5
|
-
//# sourceMappingURL=studio-
|
|
4
|
+
//# debugId=DA4F330E127A874764756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-gbqc12bk.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{p}from"./studio-
|
|
2
|
-
${n.help}`:""),severity:n.severity==="error"?t.MarkerSeverity.Error:t.MarkerSeverity.Warning,source:"oxlint",startColumn:c,startLineNumber:a}]});t.editor.setModelMarkers(s,"oxlint",r)}function
|
|
3
|
-
export{
|
|
1
|
+
import{p}from"./studio-1b79rpcb.js";import{x}from"./studio-anc8067x.js";import{df}from"./studio-hf259xzd.js";import{re}from"./studio-ft706q02.js";import{f,V_}from"./studio-0z8kp4xk.js";async function rx(e,o){return p().codeService(e,o)}async function bO(e){return p().locateFile(e)}var Xu=new Map;async function ox(e,o){let s=e.$prototype?x?.projectConfig?.imports?.[e.$prototype]:null,t=e.$src||s;if(!t||!e.$prototype)return null;let r=`${t}::${e.$prototype}`;if(Xu.has(r))return Xu.get(r);try{let n=p(),i=!s&&o.documentPath?`${location.origin}/${o.documentPath}`:void 0,a=await n.fetchPluginSchema(t,e.$prototype,i);return Xu.set(r,a),a}catch{return Xu.set(r,null),null}}function g$(e,o){let s=e.getModel();if(!s)return;let t=df();if(!t)return;let r=o.flatMap((n)=>{let i=n.labels?.[0];if(!i)return[];let{line:a,column:c,length:u}=i.span;return[{code:n.url?{target:t.Uri.parse(n.url),value:n.code}:n.code,endColumn:c+(u||1),endLineNumber:a,message:n.message+(n.help?`
|
|
2
|
+
${n.help}`:""),severity:n.severity==="error"?t.MarkerSeverity.Error:t.MarkerSeverity.Warning,source:"oxlint",startColumn:c,startLineNumber:a}]});t.editor.setModelMarkers(s,"oxlint",r)}function yO(e,o){let s=(t)=>{if(!f(t))return null;let r=t.parameters;if(!Array.isArray(r)||r.length===0)return null;return V_(r)};if(e.type==="def"){let t=e.defName?s(o?.state?.[e.defName]):null;if(t)return t}else if(e.type==="event"){if(!o||!e.path)return["state","event"];let t=re(o,e.path),r=t&&e.eventKey?s(t[e.eventKey]):null;if(r)return r}return["state","event"]}
|
|
3
|
+
export{rx,bO,Xu,ox,g$,yO};
|
|
4
4
|
|
|
5
|
-
//# debugId=
|
|
6
|
-
//# sourceMappingURL=studio-
|
|
5
|
+
//# debugId=33924B4B6B8FD63D64756E2164756E21
|
|
6
|
+
//# sourceMappingURL=studio-gxphbetb.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{Wt,vl,ky,xn,ra,Jn,Aa,Sh,X,Zd,eu,mi,g,h,pn,ko,sg,_1,lc,ag,lg,id,$1,b_,HR,tu,Ft,Oy}from"./studio-ybkd5w8k.js";import{w,Sl}from"./studio-5k9mfafh.js";import{iu,rf}from"./studio-r85zw6ay.js";import{p}from"./studio-1b79rpcb.js";import{MA,gl,Ax,u,dy}from"./studio-3kmqhwtt.js";import{ae}from"./studio-dbex091t.js";import{qu,Zl}from"./studio-8vmad6x2.js";import{Tn,it,Kr,u1}from"./studio-yetr4gg1.js";import{Vt}from"./studio-zdbsv5q2.js";import{Gl,AS,Ab,HD,IT,NT,DT,OT}from"./studio-z89e6wpg.js";import{la,Ot}from"./studio-6tnpg0vx.js";import{Lp,Om,Ts,dO,Rp}from"./studio-qcc5hsw2.js";import{dl}from"./studio-qvb2jr83.js";import{bt,ey,nc,zc,ah,Mp,OC,Hi}from"./studio-m25ry0mf.js";import{bl,Uo,Xs,Qs,qo}from"./studio-y2zsnzye.js";import{Ql,Pm,Dp}from"./studio-a4ymg4vd.js";import{Bu,uT}from"./studio-gahswxp4.js";import{hi}from"./studio-8atmfjjm.js";import{ST}from"./studio-dj8ctxey.js";import{Js,ll}from"./studio-pafmb06w.js";import{ed}from"./studio-meajkr51.js";import{of,x,wn,_l}from"./studio-anc8067x.js";import{gf,E,I}from"./studio-xxttcym1.js";import{Me,E_}from"./studio-4xadhxj1.js";import{me,te,b}from"./studio-y3tjh2xb.js";import{Ni}from"./studio-213pyfxh.js";import{n,qe,f}from"./studio-0z8kp4xk.js";import{ce}from"./studio-nhpg405j.js";var Ie={$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",Ie);function Tt(e){let t=document.createElement("div");t.style.display="contents";let a=[],r=b({...Ce(e),runAction:(s)=>{a[Number(s)]?.()}});a=Oe(e);let i=null,o=!1;return I("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=Oe(s),Object.assign(r,Ce(s))}}}function Ce(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 Oe(e){return(e.actions??[]).map((t)=>t.run)}var Fe=new WeakMap;function ju(e,t){let a=Fe.get(e);if(a)return a.update(t),a.host;let r=Tt(t);return Fe.set(e,r),r.host}var kt=new Set(["entry"]);function pb(e){let t=vl(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(kt.has(a))return"content";let r=Ql(e.id);if(r)return r.kind==="data"?"design":"content";if(Ni(e.documentPath))return"styles";return Jn(e.documentPath)?"content":"design"}var Et=new Set(["edit","design","stylebook"]);function DE(e){return e.documentPath!==null&&Ql(e.id)===null&&Et.has(e.session.ui.canvasMode)}function Mc(e,t=u.workspace){let a=g.tabs.get(e);return a!==void 0&&pb(a)===t}function ne(e,t=u.workspace){return e.tabOrder.filter((a)=>Mc(a,t))}function VN(e){let t=g.mruOrder.find((a)=>Mc(a,e));if(t)return t;for(let a of g.panes){let r=a.tabOrder.find((i)=>Mc(i,e));if(r)return r}return null}function OE(e,t){if(e.activeTabId&&Mc(e.activeTabId,t))return e.activeTabId;return g.mruOrder.find((a)=>e.tabOrder.includes(a)&&Mc(a,t))??e.tabOrder.find((a)=>Mc(a,t))??null}var Le={$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 hold 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 hold 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-held]':{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 hold 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. `entryHoldPill` states the two facts; this draws them.",tagName:"span",attributes:{slot:"status",part:"pill",title:"${$map.item.pillTitle}","data-held":"${$map.item.held ? '' : 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",Le);function Nt(e){let t=n(e)?void 0:e.attributes?.part;return n(t)?t:""}function Ht(e){let t=e?.$map,a=f(t)?t.item:void 0,r=f(a)?a.key:void 0;return n(r)?r:""}function Ae(e,t,a){let r=b({...t,...a,dragKey:"",dropIndex:-1,dropTail:!1});e.replaceChildren();let i=null,o=!1,s=null;return I("tab-strip",r,e,{onNodeCreated:(l,c,d,m)=>{if(o||!(l instanceof HTMLElement))return;let y=Nt(d);if(y==="tabs"){s=l,a.stripHost(l);return}if(y==="tab"){let S=Ht(m);if(S)a.chipHost(l,S)}}}).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 De(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 Re(e){for(var t=1;t<arguments.length;t++){var a=arguments[t]!=null?arguments[t]:{};t%2?De(Object(a),!0).forEach(function(r){bl(e,r,a[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):De(Object(a)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(a,r))})}return e}var jt={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(y){return{edge:y,value:jt[y](c,l)}}),m=(a=(r=d.sort(function(y,S){return y.value-S.value})[0])===null||r===void 0?void 0:r.edge)!==null&&a!==void 0?a:null;return Re(Re({},e),{},bl({},re,m))}function he(e){var t;return(t=e[re])!==null&&t!==void 0?t:null}var re=Symbol("closestEdge");function _e(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 Fu(e){return f(e)&&(e.type==="tab"||e.type==="file-tree"&&e.entryType==="file")}function ge(e,t,a){if(pn(t)?.derived)uT(t);if(!Oy(e,t,a))return;id(e),Ft(e)}async function It(e,t,a){let r=[...g.tabs.values()].find((o)=>o.documentPath===e);if(r){ge(r.id,t,a);return}await hi(e,{focus:!0,paneId:t});let i=[...g.tabs.values()].find((o)=>o.documentPath===e);if(i)ge(i.id,t,a)}function Je(e,t){if(e.tabId===void 0)return e.index;return t==="left"?e.index:e.index+1}async function Mt(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:_e({axis:"horizontal",closestEdgeOfTarget:a,indexOfTarget:t.index,startIndex:i});if(o!==i)HR(e.tabId,o);return}ge(e.tabId,t.paneId,Je(t,a));return}await It(e.path,t.paneId,Je(t,a))}async function Ct(e,t){if(e.type==="tab"){if(_1(e.tabId))id(e.tabId);return}let a=lc(t.paneId);if(await hi(e.path,{paneId:a.id}),![...g.tabs.values()].some((i)=>i.documentPath===e.path)&&lg(a))ag(a.id)}async function Ve(e,t){if(!t||!Fu(e.data))return;let a=e.data;if(t.data.type==="tab-slot"){await Mt(a,t.data);return}if(t.data.type==="pane-edge")await Ct(a,t.data)}var we=null,ie=null,z=new Map,_=new Map,k=new Map,L=new Map,O=new Map,J=null,j=null,N=null,U=new Map,oe=new Map,ve=null;function Lt(e){return`pane.${e}/tabs`}function At(e){return gf(Lt(e.id))??we}function WN(e){Dt(),we=e,ve=Qs({onDragStart({source:t}){if(!Fu(t.data))return;j=t.data.type==="tab"?{kind:"tab",tabId:t.data.tabId}:{kind:"file",path:t.data.path},be(),ye()},onDrag({location:t}){if(!j)return;let[a]=t.current.dropTargets,r=a?.data;N=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(!Fu(a.data))return;let[r]=t.current.dropTargets;j=null,N=null,ye(),be(),Ve(a,r)}}),ie=me(),ie.run(()=>{te(()=>{g.activePaneId;for(let t of g.panes)t.id,t.tabOrder,t.activeTabId;u.workspace;for(let t of g.tabs.values()){t.session.ui.canvasMode,t.doc.dirty,dl(t),t.documentPath,t.pinned,t.preview,t.session.openedFrom;for(let a of dO(ll(t.documentPath)?.def))t.doc.content.frontmatter[a]}$1(),be()})})}function Dt(){Jt(),Se(),ze(),ie?.stop(),ie=null,ve?.(),ve=null;for(let e of k.keys())$e(e);for(let e of k.values())e.dispose();k.clear(),L.clear(),we=null,j=null,N=null,z.clear(),O.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=dy(),t=new Map;for(let r of g.panes){let i=At(r);if(i&&(!t.has(i)||sg(r.id)))t.set(i,r)}let a=new Set;for(let[r,i]of t){if(e||i.derived)Rt(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),O.delete(r),!t.has(i))$e(i),k.get(i)?.dispose(),k.delete(i),L.delete(i)}}function Rt(e,t){let a=We(e);L.set(t,{mode:a.mode,paneId:e.id});let r=k.get(t);if(r)r.update(a);else k.set(t,Ae(t,a,Ut(t)));if(Xt(t,a),k.get(t)?.strip()&&e.activeTabId!==z.get(e.id))z.set(e.id,e.activeTabId),le.add(t);_t(t)}var V=new Map,le=new Set;function _t(e){if(V.has(e))return;V.set(e,requestAnimationFrame(()=>{V.delete(e);let t=F(e);if(t&&dy())zt(t,e);le.delete(e)}))}function Jt(){for(let e of V.values())cancelAnimationFrame(e);V.clear(),le.clear()}function zt(e,t){let a=k.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"});Zt(e,t)}function F(e){let t=L.get(e)?.paneId;return g.panes.find((a)=>a.id===t)??null}function Ut(e){return{activate:(t)=>{Ft(t)},chipHost:(t,a)=>{Kt(e,t,a)},closeTab:(t)=>{fb(t)},context:(t,a,r)=>{let i=g.tabs.get(t);if(i)sa(i,a,r)},focusPane:()=>{ko(F(e)?.id??mi)},openTrailing:(t)=>{Qt(e,t)},promote:(t)=>{id(t)},stripHost:(t)=>{Yt(e,t)},togglePin:(t)=>{let a=g.tabs.get(t);if(a)b_(t,!a.pinned)},wheel:(t,a)=>{ea(a)}}}function Bt(e,t){let a=ae(),r=bt(e.id)??bt(t.sourcePaneId),i=t.kind==="lens"&&t.preset==="breakpoint"?`${Bu.breakpoint} ${t.media?Hi(t.media):"Base"}`:t.kind==="companion"&&t.preset==="locale"?`${Bu.locale} ${t.locale?Wt(t.locale):"—"}`:Bu[t.preset],o=r?Id(r):"no document";return{active:"",chipTitle:`${i} · ${r?.documentPath??"no document"}`,focused:sg(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===mi?"Open documents":"Open documents in the side pane"}function Gt(e){return{active:"",chipTitle:"",focused:sg(e.id),mode:"empty",preset:"",stripLabel:se(e),subject:"",tabs:[],trailing:!1,trailingGlyph:"",trailingTitle:""}}function We(e){let{derived:t}=e,a=ne(e);if(t&&a.length===0)return Bt(e,t);if(a.length===0){if(j)return{active:"",chipTitle:"",focused:sg(e.id),mode:"tabs",preset:"",stripLabel:se(e),subject:"",tabs:[],trailing:!1,trailingGlyph:"⌄",trailingTitle:"Show hidden tabs"};return z.set(e.id,null),O.set(e.id,!1),Gt(e)}let r=Ue(e);return{active:e.activeTabId??"",chipTitle:"",focused:sg(e.id),mode:"tabs",preset:"",stripLabel:se(e),subject:"",tabs:a.flatMap((i)=>qt(e,i,e.tabOrder.indexOf(i),r)),trailing:O.get(e.id)===!0,trailingGlyph:"⌄",trailingTitle:"Show hidden tabs"}}function qt(e,t,a,r){let i=g.tabs.get(t);if(!i)return[];let o=HD(i);return[{dirty:i.doc.dirty||dl(i),held:o?.held??!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:ca(i)}]}function Kt(e,t,a){let r=U.get(e);if(!r)r=new Map,U.set(e,r);r.get(a)?.();let i=Uo(qo({element:t,canDrag({input:o}){let s=E_(o.clientX,o.clientY);return!(s instanceof Element&&s.closest('[part="pin"], [part="close"]'))},getInitialData(){return{paneId:F(e)?.id,tabId:a,type:"tab"}}}),Xs({canDrop({source:o}){return Fu(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 Yt(e,t){oe.get(e)?.();let a=Xs({canDrop({source:r}){return Fu(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 Xt(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=j?.kind==="tab"?j.tabId:"";for(let[t,a]of L){let r=k.get(t);if(!r)continue;let i=N!==null&&N.paneId===a.paneId;r.drag({dragKey:e,dropIndex:i&&N?N.index:-1,dropTail:i&&N?N.tail:!1})}}function Zt(e,t){let a=k.get(t),r=a?.strip();if(!a||!r)return;let i=r.scrollWidth>r.clientWidth;if(i!==(O.get(e.id)===!0))O.set(e.id,i),a.update(We(e))}function Qt(e,t){let a=F(e);if(!a)return;if(L.get(e)?.mode==="derivation"){it("pane.unsplit",void 0,"Tabs");return}aa(a,Ue(a),t)}function ea(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 ta(e=g.activePaneId){let t=g.panes.find((d)=>d.id===e),a=_.get(e),r=a?k.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,m]of c.entries()){let y=l[d];if(y&&(m.offsetLeft<i||m.offsetLeft+m.offsetWidth>o))s.push(y)}return s}function Se(){J?.close(),J=null}function aa(e,t,a){Se();let r=ta(e.id),i=r.length>0?r:ne(e),o=Me(a??document.body);J=Vt({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 ze(){W?.close(),W=null}function na(e){let t={},a=Ts(ll(e.documentPath)?.def);if(a)t.hold=Gl(e)[a.field]!==!0;return t}function ia(e){let t=Object.entries(e),a=t.length===1?t[0]?.[1]:void 0;if(!qe(a))return;return a?"false":"true"}function oa(e){let t=ae();if(!t)return[];let a=na(e),r=[],i;for(let o of t.forPlacement("context/tab")){let s=o.args;if(!(s?.required??[]).every((S)=>(S in a)))continue;let l={};for(let S of Object.keys(s?.properties??{}))if(S in a)l[S]=a[S];let c=r.length>0&&o.group!==i;({group:i}=o);let d=t.disabledReason(o.id),m=ia(l),y={destructive:o.destructive===!0,dividerAbove:c,id:o.id,title:o.title};if(m!==void 0)y.checked=m;r.push(d===void 0?{...y,disabled:!1,run:()=>{Tn(t,o.id,l,"Tabs")}}:{...y,disabled:!0,requires:d})}return r}function sa(e,t,a){ze(),Se(),Ft(e.id);let r=oa(e);if(r.length===0)return;W=Vt({label:"Tab actions",onClosed:(i)=>{if(W===i)W=null},origin:{x:t,y:a},region:"tab",rows:r})}function fm(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 da(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=fm(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 Ue(e){return da(e.tabOrder.flatMap((t)=>{let a=g.tabs.get(t);return a?[{documentPath:a.documentPath,fallback:Pm(a.id)??ky(a.id)??"Untitled",id:t}]:[]}))}function ca(e){let t=e.documentPath||Pm(e.id)||ky(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 Id(e){let t=e.documentPath;if(!t)return Pm(e.id)??"Untitled";return fm(t)??t.split("/").at(-1)??t}function Be(e){let t=rf(e),a=dl(e);if(!e.doc.dirty&&!t&&!a)return!1;let r=xn(e);if(!r.active)return!0;if(ra(e))return!0;if(t||a)return!0;return r.peers.filter((o)=>o.state.focusedPath===e.documentPath).length===0}function xe(e){if(ra(e))return`You have read access to this session, so "${Id(e)}" has changes that were never published and have nowhere to be saved. Closing discards them.`;if(rf(e))return`"${Id(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 pa(e){let t=xe(e);if(t)return Kr("Changes Cannot Be Saved",t,{cancelLabel:"Keep Editing",confirmLabel:"Close Without Saving",destructive:!0});let a=await u1("Unsaved Changes",`"${Id(e)}" has unsaved changes.`,{discardLabel:"Close Without Saving"});if(a==="cancel")return!1;return a==="discard"||await Dp(e)}async function fb(e){let t=g.tabs.get(e);if(!t)return;if(await iu(t),!g.tabs.has(e))return;if(Be(t)&&!await pa(t))return;tu(e)}async function AE(e){let t=[...g.tabs.values()];for(let c of t)await iu(c);let a=[...g.tabs.values()].filter((c)=>Be(c));if(a.length===0)return!0;let r=a.length===1?`"${Id(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?`"${Id(i[0])}"`:`${i.length} of them`;if(o.length===0)return Kr("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 u1("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 Dp(c))return!1;return!0}function Ge(e,t){if(!n(t)||t.trim()==="")return[...e];return[{attributes:{content:t,name:"description"},tagName:"meta"},...e]}function Ke(e,t,a){let r=e.doc.content.frontmatter,i=Sh(e.documentPath,t),o=i?.schema,s=o?.properties,l=new Set(o?.required||[]),c=[];if(s){for(let[d,m]of Object.entries(s)){if(a.has(d))continue;c.push({entry:m,field:d,value:r[d]})}for(let[d,m]of Object.entries(r)){if(s[d]||d.startsWith("$")||a.has(d))continue;c.push({entry:{type:qe(m)?"boolean":"string"},field:d,value:m})}}else for(let[d,m]of Object.entries(r)){if(d.startsWith("$")||a.has(d))continue;c.push({entry:{type:qe(m)?"boolean":"string"},field:d,value:m})}return{collection:i,fields:c,hasSchema:Boolean(s),requiredFields:l}}function B(e){return n(e)?e:""}function ua(e){return{checked:!1,hasNote:!1,hasThumb:!1,isSet:!1,kind:"text",label:e,note:"",options:[],placeholder:"",thumb:"",value:""}}function Ye(e,t,a,r,i){let o=e.replaceAll(/([A-Z])/g," $1").replace(/^./,(d)=>d.toUpperCase()),s=ua(o+(r.has(e)?" *":""));s.isSet=a!==void 0&&a!==""&&a!==!1;let l=(d)=>String(d)||void 0,c=qu(t);if(c!==null){let d=B(a),m=ST(c,i.rerender);if(s.kind="select",s.value=d,m===null)return s.options=[{label:"Loading…",value:d}],{parse:l,row:s};if("error"in m)return s.kind="text",s.hasNote=!0,s.note=`Could not list ${c} entries — ${m.error}`,{parse:l,row:s};let y=d!==""&&!m.ids.includes(d);if(s.options=[{label:"—",value:""},...y?[{label:`${d} — not found`,value:d}]:[],...m.ids.map((S)=>({label:S,value:S}))],m.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 m=String(d);return m?m.split(",").map((y)=>y.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(Aa(t.format)){let d=B(a);return s.kind="media",s.value=d,s.hasThumb=d!==""&&la.has(Ot(d)),s.thumb=s.hasThumb?ed(d):"",{parse:l,row:s}}if(t.type==="number")return s.kind="number",s.value=a===void 0?"":String(a),{parse:(d)=>{let m=String(d).trim(),y=Number(m);return m===""||Number.isNaN(y)?void 0:y},row:s};return s.value=B(a),s.placeholder=t.format==="date"?"YYYY-MM-DD":"",{parse:l,row:s}}var Xe="https://fonts.googleapis.com/css2?",Ze=["https://fonts.googleapis.com","https://fonts.gstatic.com"];function uw(e){return e?.tagName==="link"&&e.attributes?.rel==="stylesheet"&&n(e.attributes.href)&&e.attributes.href.startsWith(Xe)}function Te(e){return e?.tagName==="link"&&e.attributes?.rel==="preconnect"&&n(e.attributes.href)&&Ze.includes(e.attributes.href)}function FN(e){let t=e.match(/family=([^&:]+)/);if(!t)return"";return decodeURIComponent(t[1].replaceAll("+"," "))}function jN(e){return`${Xe}family=${encodeURIComponent(e).replaceAll("%20","+")}&display=swap`}function HN(e){for(let t of Ze)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 BN(e){if(!e.some((a)=>uw(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 et(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 fa(){return{addAttr:"",addTag:"",addValue:"",customCount:"0",customEntries:[],customState:"empty",sections:[],tagOptions:[]}}var G=new WeakMap;function tt(e,t,a){let r=G.get(e);if(r&&(r.handle===null||r.handle.root.isConnected)){et(r.scope,t);return}r?.handle?.dispose(),e.textContent="";let i=b({...fa(),...a});et(i,t);let o={handle:null,scope:i};G.set(e,o),I("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 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 (a hold rule's label, 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-held="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-held":"${state.held ? 'true' : 'false'}"},textContent:"${state.status}"}]},{tagName:"span",attributes:{part:"kind"},textContent:"${state.kind}"},{tagName:"div",attributes:{part:"hold-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/holdSwitch"},cases:{shown:{$description:"The entry's hold switch, on a collection whose rules offer one: the one field every such collection has in common. The state this shares (site-architecture.md §7.6). A setter: the switch names the state it reaches.",tagName:"jx-switch",attributes:{part:"hold"},$props:{checked:{$ref:"#/state/holdOn"},hint:"${state.holdHint}",size:"sm"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setHold"},value:[{$ref:"event#/target/checked"}]}]},children:[{tagName:"span",textContent:"${state.holdLabel}"}]}}}]},{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.holdSwitch=t.holdSwitch,e.holdOn=t.holdOn,e.holdLabel=t.holdLabel,e.holdHint=t.holdHint,e.held=t.held,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 nt(e,t,a,r){e.replaceChildren();let i=b({...t,...a}),o=null,s=!1,l=I("entry-inspector",i,e,{onNodeCreated:(c,d,m)=>{if(!s&&c instanceof HTMLElement&&ba(m)==="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=Jn(e?.documentPath);return t!==null&&!t.fileBacked}function st(e){let t=e.documentPath??"",r=Jn(t)?.name??"",i=Js(r),o=Gl(e),s=i?.def,l=Lp(s,o),c=Ts(s),d=r===""?null:ah(r,zc(t)),m=d?OC(d,t,o):null,y=t.endsWith(".json");return{fieldsState:i?.schema?"form":"none",held:l!==null,holdHint:Rp(l),holdLabel:c?.label??"",holdOn:c!==null&&o[c.field]===!0,holdSwitch:c?"shown":"hidden",kind:ey(nc(r)?.item??"entry"),path:t,region:ya,status:Om(s,o),storage:y?". Its fields are the file itself.":". Fields are its frontmatter, and the body is its Markdown.",url:m??"",urlState:d===void 0?"loading":m?"shown":d?"unlisted":"none"}}var v=null;function lt(e,t){let a=Js(Jn(t.documentPath)?.name??"");if(!e.formHost||!a?.schema)return;let r=Gl(t),i=Zl("entry-inspector",OT(a.schema,a.schema,r),r,{context:NT(t),errors:DT(a,r),onChange:(o)=>AS(t,o),rerender:e.redraw,ui:IT(a.schema)});if(i.parentNode!==e.formHost)e.formHost.replaceChildren(i)}function rt(e,t){let a=st(t);if(a.fieldsState==="none")e.formHost=null;e.handle.update(a),lt(e,t)}function q(e){if(!v||e!==void 0&&v.host!==e)return;v.unlisten(),v.scope.stop(),v.handle.dispose(),v=null}function dt(e,t){if(v&&v.host===e&&v.tabId===t.id&&v.handle.attached()){rt(v,t);return}q();let a=me(),r=()=>{if(v===i)rt(i,t)},i={formHost:null,handle:nt(e,st(t),{openFields:()=>{let o=Jn(t.documentPath)?.name;it("settings.open",o?{entry:o,section:"content"}:{section:"content"},"Entry")},openSeo:()=>{it("document.openSeo",void 0,"Entry")},setHold:(o)=>Ab(t,o)},{fieldsSlot:(o)=>{if(v===i)i.formHost=o,lt(i,t)}}),host:e,redraw:r,scope:a,tabId:t.id,unlisten:Mp(r)};v=i,a.run(()=>{te(()=>{t.doc.document,t.doc.content.frontmatter,x?.projectConfig?.content,r()})})}var A=null;async function PE(){try{A=(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{A=[]}return A}async function va(){await PE(),wn("rightPanel","seoModal")}function hw(){A=null,Ia()}function xa(){if(A===null)va();return A}var pw=[{attr:"name",key:"description",label:"Description"},{attr:"name",key:"viewport",label:"Viewport"}],fw=[{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([...pw,...fw].map((e)=>e.key)),pt=new Set(["title"]);function wa(e){return He(e)?new Set([...pt,"description"]):pt}function ME(e){let t=mw(e.$head??[],"name","description");if(t)return String(t.attributes?.content??"");return n(e.description)?e.description:""}function rS(e,t){if(!mw(e.$head??[],"name","description")&&n(e.description)){if(t)e.description=t;else delete e.description;return}gw(e,"name","description",t)}function mw(e,t,a){return e.find((r)=>r?.tagName==="meta"&&r.attributes?.[t]===a)}function FE(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 gw(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 oS(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 Sa(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 Ta(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 ka(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 Ea(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]]),Pa=new Intl.Segmenter("en-US",{granularity:"grapheme"});function jE(e){let t=0;for(let a of Pa.segment(e))t+=1;return t}var ut="Search appearance";function zN(e,t){Sl((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 mb(e,t){return e.fields.find((a)=>a.key===t)??{...vt,key:t,label:t,limit:xt.get(t)??null}}function Na(e){return[...e.site,...e.layout,...e.page].some((t)=>t?.tagName==="title")}function Ha(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=jE(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(Na(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",ka(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=Ea(t.route,t.siteUrl),o={fields:r,url:i};return{...o,warnings:Ha(o,e)}}var Pe=null,Ne=[],Y=null;function Ia(){Pe=null,Ne=[],Y=null}async function Ma(e){if(Y===e)return;Y=e;let t=await Ax(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 Ca(e,t){let a=He(e)?gl(t):null;if(a===null)return{entries:[],name:null};let r=wt(a);if(a===Pe)return{entries:Ne,name:r};return Ma(a),{entries:[],name:r}}function HE(e,t){let a=x?.projectConfig,r=Ca(e,t.$layout),i=e?.documentPath,o={pageTitle:n(t.title)?t.title:"",route:i?fm(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:Ge(t.$head??[],t.description),site:a?.$head??[]},o)}function He(e){let t=e?.documentPath;return Boolean(t&&x?.isSiteProject&&(t.startsWith("pages/")||t.startsWith("./pages/")))}function sS(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 BE(e,t,a){if(!e)return;let r=e.doc.content.frontmatter,i=sS({},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,m=JSON.stringify(s)!==JSON.stringify(i);if(l||c||d||m)X(e,(y)=>{if(l)eu(y,"$layout",n(o.$layout)||o.$layout===!1?o.$layout:void 0);if(c)eu(y,"title",o.title);if(d)eu(y,"description",n(o.description)?o.description:void 0);if(m)eu(y,"$head",s)});t()}var P=null,H=null,ue="meta",Q="",ee="",T=new Map,je=new Map;function Oa(e){let t=e?.documentPath?fm(e.documentPath):null;if(t===null)return null;return{...C("__url","url","URL"),kind:"readout",value:t}}var Ee=new Map,R=new Map,Fa=[{label:"meta",value:"meta"},{label:"link",value:"link"},{label:"script",value:"script"}];function C(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!==""&&la.has(Ot(t)),e.thumb=e.hasThumb?ed(t):""}function La(e,t){let a=n(e.title)?e.title:"";return T.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})}),{...C("title","title","Title"),clearLabel:"Clear title",isSet:Boolean(a),placeholder:"Page title…",value:a}}function mt(e,t,a){let r=String(mw(t,e.attr,e.key)?.attributes?.content??""),i=`meta:${e.attr}:${e.key}`;T.set(i,{images:e.media===!0,clear:()=>a((s)=>gw(s,e.attr,e.key,"")),commit:(s)=>a((l)=>gw(l,e.attr,e.key,e.media?String(s):String(s).trim()))});let o=C(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=ME(e),r="meta:name:description";T.set("meta:name:description",{images:!1,clear:()=>t((o)=>rS(o,"")),commit:(o)=>t((s)=>rS(s,String(o).trim()))});let i=C("meta:name:description","description","Description");return i.isSet=Boolean(a),i.value=a,i.kind="text",i.placeholder="Description…",i}function Ra(e,t){let a=String(FE(e,"icon")?.attributes?.href??"");T.set("link:icon",{images:!0,clear:()=>t((i)=>oS(i,"icon","")),commit:(i)=>t((o)=>oS(o,"icon",String(i)))});let r=C("link:icon","icon","Icon");return r.isSet=Boolean(a),r.kind="media",r.value=a,$t(r,a),r}function _a(e,t,a){if(!He(e))return null;let r=xa();if(r===null)return null;let i=t.$layout,o=x?.projectConfig?.defaults?.layout,s=o?wt(o):"";T.set("__layout",{images:!1,clear:()=>a((d)=>{delete d.$layout}),commit:(d)=>{let m=String(d);a((y)=>{if(m==="__default__")delete y.$layout;else if(m==="__none__")y.$layout=!1;else y.$layout=m}),MA()}});let l=C("__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=gl(i);if(c)l.action="Edit template",l.hasAction=!0,je.set("__layout",()=>{(ce("8pf70854"),import("./files-8pf70854.js")).then(({openFileInTab:d})=>d(c.replace(/^\.\//,"")))});return{hasSeo:!1,key:"layout",rows:[l],title:"Layout"}}function Ja(e){if(!e||e.doc.mode!=="content")return null;let{collection:t,fields:a,hasSchema:r,requiredFields:i}=Ke(e,x?.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}=Ye(s.field,s.entry,s.value,i,{rerender:D});return T.set(l,{images:d.kind==="media"&&s.entry.format==="image",clear:()=>X(e,(m)=>eu(m,s.field)),commit:(m)=>X(e,(y)=>eu(y,s.field,c(m)))}),Object.assign(C(l,s.field,d.label),d,{clearLabel:`Clear ${s.field}`})}),title:t?`Frontmatter (${t.name})`:"Frontmatter"}}function Va(e){Ee.clear();let t=[];for(let a of e){if($a(a)||uw(a)||Te(a))continue;let r=`tag:${t.length}`;Ee.set(r,a);let i=Sa(a);t.push({key:r,label:i,removeLabel:`Remove ${i}`,value:Ta(a)})}return t}function Wa(e){T.clear(),je.clear();let t=h.value,a=e.document,r=a.$head??[],i=[],o=Ja(t);if(o)i.push(o);let s=_a(t,a,e.applyMutation);if(s)i.push(s);let l=Oa(t);i.push({hasSeo:!0,key:"page",rows:[La(a,e.applyMutation),...l?[l]:[],...pw.map((d)=>d.key==="description"?Da(a,e.applyMutation):mt(d,r,e.applyMutation)),Ra(r,e.applyMutation)],title:"Page"},{hasSeo:!1,key:"opengraph",rows:fw.map((d)=>mt(d,r,e.applyMutation)),title:"OpenGraph"});let c=Va(r);return{addAttr:Q,addTag:ue,addValue:ee,customCount:String(c.length),customEntries:c,customState:c.length===0?"empty":"listed",sections:i,tagOptions:Fa}}function D(){if(!P||!H)return;tt(P,Wa(H),Ba)}function ft(){for(let{timer:e}of R.values())clearTimeout(e);R.clear()}function Z(e){let t=R.get(e);if(t)clearTimeout(t.timer),R.delete(e)}function pe(e,t){Z(e),T.get(e)?.commit(t)}function za(){let e=H,t=Q.trim(),a=ee.trim();if(!e||!t||!a)return;let r=ue||"meta";Q="",ee="",D();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 Ua(e){let t=H,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("bzktmmwr"),import("./media-picker-bzktmmwr.js")),ht}var Ba={addEntry:za,browse:(e,t)=>{Z(e),gt().then((a)=>{if(t instanceof HTMLElement)a.showMediaPickerPopover(t,(r)=>{T.get(e)?.commit(r)},{images:T.get(e)?.images??!0})})},clear:(e)=>{Z(e),T.get(e)?.clear()},commitText:(e,t)=>pe(e,t),editAttr:(e)=>{Q=e,D()},editText:(e,t)=>{Z(e);let a=()=>{R.delete(e),T.get(e)?.commit(t)};R.set(e,{commit:a,timer:setTimeout(a,of)})},editTag:(e)=>{ue=e,D()},editValue:(e)=>{ee=e,D()},openSeo:()=>{ae()?.run("document.openSeo")},removeEntry:Ua,runRowAction:(e)=>{je.get(e)?.()},setBoolean:(e,t)=>pe(e,t),setChoice:(e,t)=>pe(e,t),setNumber:(e,t)=>pe(e,t),upload:(e)=>{Z(e),gt().then((t)=>{t.pickAndUpload((a)=>{T.get(e)?.commit(a)})})}};function Ga(e,t){if(e!==P)ue="meta",Q="",ee="",ft();if(t.document!==H?.document)ft();P=e,H=t,D()}function VE(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=Jn(e);return t&&!t.fileBacked?"Entry":"Document"}var qa="A component has no page settings: its title, search and social details come from the page that uses it.";function Ka(e){return{actions:[{label:"Edit tag and props",run:()=>{_l(e,{selection:[[]],ui:{rightTab:"properties"}})}}],detail:"Its tag name and the props it takes are set on its root element.",message:qa}}var UN="Open a page to edit its title, description and social preview.",M=null;function WE(e){if(M&&M!==e){if(q(M),de(M),P===M)P=null,H=null}M=e,bw()}function bw(){let e=M;if(!e)return;let t=h.value;if(!t||ot(t)){if(de(e),P===e)P=null,H=null;if(t)dt(e,t);else q(e);return}if(q(e),VE(t.documentPath)==="Component"){if(de(e),P===e)P=null,H=null;let r=ju(e,Ka(t));if(e.firstChild!==r||e.childNodes.length!==1)e.replaceChildren(r);return}let a=t.doc.mode==="content";Ga(e,{applyMutation:a?(r)=>BE(h.value,bw,r):(r)=>{Zd(h.value,r)},document:a?sS(t.doc.document,t.doc.content.frontmatter):t.doc.document,rerender:bw})}
|
|
4
|
+
export{uw,FN,jN,HN,BN,pb,DE,Mc,VN,OE,Fu,WN,fm,Id,fb,AE,ju,PE,hw,pw,fw,ME,rS,mw,FE,gw,oS,jE,zN,mb,HE,sS,BE,VE,UN,WE,bw};
|
|
5
|
+
|
|
6
|
+
//# debugId=64B5BB126F90892F64756E2164756E21
|
|
7
|
+
//# sourceMappingURL=studio-hdf01j7q.js.map
|