@jxsuite/studio 8.0.0 → 8.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{2020-5wtzce5g.js → 2020-dg097k3e.js} +3 -3
- package/dist/chunks/adapter-tck81zft.js +4 -0
- package/dist/chunks/{add-new-flow-psym14sn.js → add-new-flow-a1w0bnm6.js} +3 -3
- package/dist/chunks/{cf-account-picker-haqazq5r.js → cf-account-picker-ce3kp3x1.js} +3 -3
- package/dist/chunks/cf-settings-7ye6x7g2.js +4 -0
- package/dist/chunks/color-4gj49xq6.js +4 -0
- package/dist/chunks/{color-area-6rbra5dy.js → color-area-vh9cew51.js} +2 -2
- package/dist/chunks/{color-field-gy56c94g.js → color-field-e78f16bs.js} +3 -3
- package/dist/chunks/{color-slider-sqqdyf6c.js → color-slider-fg4yhvk6.js} +2 -2
- package/dist/chunks/{combobox-72h32ejk.js → combobox-6hs00996.js} +2 -2
- package/dist/chunks/components-qce0v93f.js +4 -0
- package/dist/chunks/content-source-jjx8kgzr.js +4 -0
- package/dist/chunks/{convert-to-repeater-he70fc2b.js → convert-to-repeater-grnmea6c.js} +3 -3
- package/dist/chunks/editor-bkja5dbv.js +4 -0
- package/dist/chunks/entry-commands-1wh0btvg.js +4 -0
- package/dist/chunks/{extension-sections-0egb88dm.js → extension-sections-rp7fkega.js} +3 -3
- package/dist/chunks/file-ops-6pe4z7an.js +4 -0
- package/dist/chunks/files-ybpp3j38.js +4 -0
- package/dist/chunks/format-host-3mtbhxk1.js +4 -0
- package/dist/chunks/fs-events-xfanfxds.js +4 -0
- package/dist/chunks/grid-open-dg5qmnaj.js +4 -0
- package/dist/chunks/{grid-view-qg1b5eqx.js → grid-view-x26rfpz1.js} +16 -15
- package/dist/chunks/{icons-63bjtbs7.js → icons-853n6qt3.js} +2 -2
- package/dist/chunks/{iframe-entry-2zggzajv.js → iframe-entry-02wzcyvy.js} +4 -4
- package/dist/chunks/{iframe-entry-99nr5zfb.js → iframe-entry-42hpmwz5.js} +4 -4
- package/dist/chunks/{iframe-entry-76j8vwwx.js → iframe-entry-b5qgggyp.js} +2 -2
- package/dist/chunks/iframe-host-j2bk2xkc.js +4 -0
- package/dist/chunks/{index-32eqzv1k.js → index-203h71wy.js} +3 -3
- package/dist/chunks/index-fkrm7pdk.js +4 -0
- package/dist/chunks/{javascript-pjp734q4.js → javascript-ww5pv5ae.js} +2 -2
- package/dist/chunks/{jsonMode-njkvsa02.js → jsonMode-vwbdwwq3.js} +6 -6
- package/dist/chunks/jx-validate-w7v32f6a.js +4 -0
- package/dist/chunks/layers-g7j732cm.js +4 -0
- package/dist/chunks/layers-panel-gjrsxcck.js +4 -0
- package/dist/chunks/{listbox-c421cf8c.js → listbox-7gka1h86.js} +2 -2
- package/dist/chunks/lit-html-jdfz9rhc.js +4 -0
- package/dist/chunks/media-library-9j0v4wmk.js +4 -0
- package/dist/chunks/media-picker-cpyyt2m0.js +4 -0
- package/dist/chunks/{menu-bdpzbfvs.js → menu-d2jxpgma.js} +2 -2
- package/dist/chunks/{monaco-binding-vq1hgnn0.js → monaco-binding-63tqze27.js} +3 -3
- package/dist/chunks/monaco-buffer-9wcme176.js +4 -0
- package/dist/chunks/{monaco-setup-xrd2cbkp.js → monaco-setup-zyyynnj8.js} +3 -3
- package/dist/chunks/notify-rahnnnv4.js +4 -0
- package/dist/chunks/platform-b2aqv7v5.js +4 -0
- package/dist/chunks/{popover-b89sfej7.js → popover-9tf4cjrk.js} +2 -2
- package/dist/chunks/publish-panel-4yk2461b.js +4 -0
- package/dist/chunks/{publish-quick-qx2455cj.js → publish-quick-ajzdhhs6.js} +3 -3
- package/dist/chunks/publish-workspace-mxestzcf.js +4 -0
- package/dist/chunks/quick-search-9g6z65b0.js +4 -0
- package/dist/chunks/references-c26enpxs.js +4 -0
- package/dist/chunks/right-panel-9d0e0yg7.js +4 -0
- package/dist/chunks/source-control-xyn3a8ds.js +4 -0
- package/dist/chunks/{split-c9zfdgxf.js → split-m5rwn31z.js} +2 -2
- package/dist/chunks/{studio-x9hsze61.js → studio-02phtmqn.js} +4 -4
- package/dist/chunks/{studio-4hp8pkyt.js → studio-0khd0xdw.js} +4 -4
- package/dist/chunks/studio-1fvzq9vs.js +5 -0
- package/dist/chunks/studio-1gdfsr49.js +12 -0
- package/dist/chunks/{studio-3q40e3rj.js → studio-1meqbxns.js} +4 -4
- package/dist/chunks/{studio-q0tccd43.js → studio-1yhz0s8p.js} +4 -4
- package/dist/chunks/studio-25a5by3h.js +5 -0
- package/dist/chunks/{studio-k3xxbagr.js → studio-2b8443ms.js} +3 -3
- package/dist/chunks/{studio-3qqjeep5.js → studio-2c2mjyzj.js} +5 -5
- package/dist/chunks/studio-2dtc90zs.js +10 -0
- package/dist/chunks/{studio-9tmebf0s.js → studio-332hesdk.js} +4 -4
- package/dist/chunks/{studio-03ct6yfv.js → studio-3pndhat0.js} +8 -8
- package/dist/chunks/{studio-s32578pn.js → studio-3q6n9qvq.js} +4 -4
- package/dist/chunks/studio-4dsdnan2.js +9 -0
- package/dist/chunks/{studio-ed1hp6zf.js → studio-4fjqdzrb.js} +5 -5
- package/dist/chunks/{studio-jcnsdaep.js → studio-533py3yy.js} +4 -4
- package/dist/chunks/studio-5abge3wy.js +5 -0
- package/dist/chunks/{studio-8tr6cfrc.js → studio-6vrxzkba.js} +4 -4
- package/dist/chunks/{studio-jaaz8ce9.js → studio-73wz63nn.js} +4 -4
- package/dist/chunks/{studio-bavb31r0.js → studio-74nzv280.js} +4 -4
- package/dist/chunks/{studio-q7rtx6zq.js → studio-7cg75gtj.js} +7 -7
- package/dist/chunks/studio-89cwmnae.js +5 -0
- package/dist/chunks/studio-8m1t83kn.js +7 -0
- package/dist/chunks/{studio-q0mvbaq6.js → studio-8nyw10dp.js} +4 -4
- package/dist/chunks/{studio-83mk4bgg.js → studio-94ppxeqy.js} +8 -8
- package/dist/chunks/{studio-qmn1xc24.js → studio-957jg8g3.js} +4 -4
- package/dist/chunks/{studio-r5qy30vx.js → studio-9wyqyfqy.js} +4 -4
- package/dist/chunks/studio-a3evp7f6.js +6 -0
- package/dist/chunks/{studio-n0c5h6mf.js → studio-a6x058ew.js} +4 -4
- package/dist/chunks/studio-ana67wax.js +5 -0
- package/dist/chunks/studio-b4xhpcwy.js +4 -0
- package/dist/chunks/studio-bf0rgyf7.js +5 -0
- package/dist/chunks/{studio-x1x167jh.js → studio-bqgs90r8.js} +4 -4
- package/dist/chunks/{studio-qwdqwkj0.js → studio-c4rcaftm.js} +4 -4
- package/dist/chunks/{studio-mn0476ag.js → studio-c5dj3dzk.js} +4 -4
- package/dist/chunks/studio-cgjt1zce.js +5 -0
- package/dist/chunks/{studio-bbe4c90a.js → studio-cpdzrdgp.js} +4 -4
- package/dist/chunks/studio-cq87hree.js +5 -0
- package/dist/chunks/studio-d140sy8e.js +5 -0
- package/dist/chunks/{studio-jsgf2q5k.js → studio-dmn7gpba.js} +5 -5
- package/dist/chunks/studio-e8pzjjhf.js +5 -0
- package/dist/chunks/{studio-dgk4dqtx.js → studio-f8kz3krj.js} +5 -5
- package/dist/chunks/{studio-qgh13jtz.js → studio-fqs1a22a.js} +4 -4
- package/dist/chunks/{studio-syreb644.js → studio-fw3jp9m7.js} +4 -4
- package/dist/chunks/{studio-ed3xx40h.js → studio-g6ysm05p.js} +6 -6
- package/dist/chunks/studio-gmhd0j3f.js +5 -0
- package/dist/chunks/{studio-p4nrkvqr.js → studio-gqpty626.js} +4 -4
- package/dist/chunks/{studio-kt3pjkwd.js → studio-grp684wx.js} +4 -4
- package/dist/chunks/{studio-df0baea9.js → studio-h98520qr.js} +4 -4
- package/dist/chunks/{studio-8m0y2qe7.js → studio-hnx1h1pr.js} +4 -4
- package/dist/chunks/studio-hvxt8z79.js +5 -0
- package/dist/chunks/{studio-43sd2mam.js → studio-hw60n5dh.js} +3 -3
- package/dist/chunks/{studio-wbcjbhy1.js → studio-hxq1ebp0.js} +6 -6
- package/dist/chunks/{studio-wys23mxz.js → studio-j4e627w1.js} +4 -4
- package/dist/chunks/{studio-ccv2svc6.js → studio-j5jqvyn3.js} +4 -4
- package/dist/chunks/{studio-881z1xrx.js → studio-jqrg9xxg.js} +4 -4
- package/dist/chunks/{studio-b7y5mr30.js → studio-kdseew9m.js} +4 -4
- package/dist/chunks/studio-kt2j51sa.js +5 -0
- package/dist/chunks/{studio-d5grtb9e.js → studio-m4w6sygj.js} +9 -9
- package/dist/chunks/{studio-zz9qe3rw.js → studio-mmqr9awv.js} +37 -37
- package/dist/chunks/{studio-5g0rprdt.js → studio-nm9qev4p.js} +5 -5
- package/dist/chunks/{studio-tft6r105.js → studio-nsv7g1qn.js} +4 -4
- package/dist/chunks/{studio-3e54qh39.js → studio-p89w12s2.js} +5 -5
- package/dist/chunks/{studio-y3ahhdpx.js → studio-pbagym4j.js} +4 -4
- package/dist/chunks/{studio-w4rz9hdk.js → studio-pr23qhrw.js} +4 -4
- package/dist/chunks/{studio-6m380wp7.js → studio-r4ya3sb2.js} +4 -4
- package/dist/chunks/studio-rdnezzkd.js +6 -0
- package/dist/chunks/{studio-f14e1zdj.js → studio-rm9m3z60.js} +4 -4
- package/dist/chunks/studio-tpmnbgmt.js +5 -0
- package/dist/chunks/studio-ttxhq5yt.js +5 -0
- package/dist/chunks/{studio-nh6d342n.js → studio-txkx6586.js} +6 -6
- package/dist/chunks/{studio-a2bvaptz.js → studio-v0gsjav0.js} +4 -4
- package/dist/chunks/{studio-fbhxxc5f.js → studio-v2ek69cb.js} +4 -4
- package/dist/chunks/{studio-y0n7yxea.js → studio-wcakp5bt.js} +7 -7
- package/dist/chunks/{studio-k7evxqh4.js → studio-x3ge4rts.js} +4 -4
- package/dist/chunks/{studio-pbxa5fpc.js → studio-xddgbwhe.js} +3 -3
- package/dist/chunks/{studio-c05wdnt3.js → studio-y1x65h5r.js} +4 -4
- package/dist/chunks/{studio-rthyg42z.js → studio-z42kysg7.js} +169 -169
- package/dist/chunks/studio-zf188hnd.js +5 -0
- package/dist/chunks/{studio-tfkznv39.js → studio-zht0x0v3.js} +4 -4
- package/dist/chunks/{studio-svb7yyve.js → studio-zm7dnr9g.js} +4 -4
- package/dist/chunks/{tooltip-yypz28gq.js → tooltip-dj1pvgz7.js} +2 -2
- package/dist/chunks/{tree-9xa4hm7n.js → tree-j0ebwr5s.js} +2 -2
- package/dist/chunks/{tsMode-epyfz1hv.js → tsMode-vra2hh7y.js} +5 -5
- package/dist/chunks/workspace-3nt93k48.js +4 -0
- package/dist/chunks/workspace-home-zbgyqqws.js +4 -0
- package/dist/chunks/{ws-client-bv552sfx.js → ws-client-72x5n99j.js} +3 -3
- package/dist/iframe-entry.js +14 -14
- package/dist/manifest.json +75 -75
- package/dist/studio.js +80 -80
- package/package.json +11 -11
- package/src/browse/component-examples.ts +15 -224
- package/src/browse/library-preview.ts +6 -13
- package/src/browse/preview-root.ts +7 -4
- package/src/canvas/canvas-utils.ts +18 -4
- package/src/canvas/iframe-editable-root.ts +13 -4
- package/src/canvas/iframe-entry.ts +3 -1
- package/src/canvas/iframe-interaction.ts +11 -2
- package/src/canvas/iframe-render.ts +25 -3
- package/src/canvas/preview-placeholder.ts +120 -0
- package/src/editor/shortcuts.ts +3 -0
- package/src/panels/component-preview.ts +5 -0
- package/src/panels/pane-context.ts +43 -18
- package/src/panels/site-model.ts +7 -19
- package/src/panels/site-panel.ts +2 -25
- package/src/panels/stylebook-doc.ts +2 -53
- package/src/services/references.ts +0 -0
- package/src/style/stylebook-specimens.ts +11 -15
- package/src/surfaces/pane-context.json +286 -265
- package/src/surfaces/pane-context.ts +17 -8
- package/src/tabs/tab.ts +5 -6
- package/src/utils/geometry.ts +49 -2
- package/dist/chunks/adapter-5tphg7xe.js +0 -4
- package/dist/chunks/cf-settings-h2wrh6hq.js +0 -4
- package/dist/chunks/color-m7r1vk54.js +0 -4
- package/dist/chunks/components-r22xca09.js +0 -4
- package/dist/chunks/content-source-mmppmcyg.js +0 -4
- package/dist/chunks/editor-ccd9jwsa.js +0 -4
- package/dist/chunks/entry-commands-6qxz9e8p.js +0 -4
- package/dist/chunks/file-ops-qnab36ek.js +0 -4
- package/dist/chunks/files-rcn56qvm.js +0 -4
- package/dist/chunks/format-host-yxz0kjjs.js +0 -4
- package/dist/chunks/fs-events-d1qxq4z4.js +0 -4
- package/dist/chunks/grid-open-4z1g062t.js +0 -4
- package/dist/chunks/iframe-host-ssv7kyj0.js +0 -4
- package/dist/chunks/index-f0jn7nnp.js +0 -4
- package/dist/chunks/jx-validate-ttasrbh7.js +0 -4
- package/dist/chunks/layers-bgyr11tr.js +0 -4
- package/dist/chunks/layers-panel-7ez66zeq.js +0 -4
- package/dist/chunks/lit-html-v9gh687x.js +0 -4
- package/dist/chunks/media-library-sq468wts.js +0 -4
- package/dist/chunks/media-picker-shfe59pt.js +0 -4
- package/dist/chunks/monaco-buffer-3afgwvbp.js +0 -4
- package/dist/chunks/notify-kzrjr3fv.js +0 -4
- package/dist/chunks/platform-7v4rtd7m.js +0 -4
- package/dist/chunks/publish-panel-2z9gw8ee.js +0 -4
- package/dist/chunks/publish-workspace-wrc1dgwx.js +0 -4
- package/dist/chunks/quick-search-n0t0eqxb.js +0 -4
- package/dist/chunks/references-9547rg5s.js +0 -4
- package/dist/chunks/right-panel-wsgnr9pn.js +0 -4
- package/dist/chunks/source-control-kwktr9y6.js +0 -4
- package/dist/chunks/studio-07rcfje3.js +0 -5
- package/dist/chunks/studio-3exxhz5g.js +0 -5
- package/dist/chunks/studio-3qeh9t0h.js +0 -6
- package/dist/chunks/studio-58xg6j2q.js +0 -9
- package/dist/chunks/studio-80jyh1xh.js +0 -4
- package/dist/chunks/studio-8vcvfs7r.js +0 -6
- package/dist/chunks/studio-fyh0jc96.js +0 -5
- package/dist/chunks/studio-gcxk20n7.js +0 -5
- package/dist/chunks/studio-m8g16bgz.js +0 -5
- package/dist/chunks/studio-mx1smyq0.js +0 -5
- package/dist/chunks/studio-pgmvdv7z.js +0 -7
- package/dist/chunks/studio-ph84avkf.js +0 -5
- package/dist/chunks/studio-rj9eamf8.js +0 -5
- package/dist/chunks/studio-rptgsk96.js +0 -5
- package/dist/chunks/studio-s19tp1xr.js +0 -5
- package/dist/chunks/studio-tf9jryb1.js +0 -10
- package/dist/chunks/studio-txf2kysx.js +0 -5
- package/dist/chunks/studio-v8867ddv.js +0 -12
- package/dist/chunks/studio-vxq7fcvv.js +0 -5
- package/dist/chunks/studio-wc649wss.js +0 -5
- package/dist/chunks/studio-z97c48fk.js +0 -5
- package/dist/chunks/studio-zat62m0c.js +0 -5
- package/dist/chunks/studio-zcd2e7yz.js +0 -5
- package/dist/chunks/workspace-dz7nxfhv.js +0 -4
- package/dist/chunks/workspace-home-xsd7hkjw.js +0 -4
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import{p}from"./studio-pr23qhrw.js";import{Kd,m}from"./studio-y1x65h5r.js";import{g}from"./studio-hw60n5dh.js";import{Bt,zi,fn,ul,cr,Oa}from"./studio-tpmnbgmt.js";import{Io}from"./studio-6vrxzkba.js";import{La,zd}from"./studio-9wyqyfqy.js";import{Aw}from"./studio-5abge3wy.js";import{ls,Ew,Tw,ir,Hr}from"./studio-1yhz0s8p.js";import{S}from"./studio-ana67wax.js";import{n,Z,_,rf}from"./studio-kt2j51sa.js";import{le}from"./studio-fqs1a22a.js";var Cs="draft",wp="Marked a draft. Studio filters drafts out of its own lists; the build does not exclude them yet.";function Hl(e){return e?.[Cs]===!0}function M(e){return e?.properties?.[Cs]?.type==="boolean"}function Dc(e,t){return M(e)||Hl(t)}var k=g({includeDrafts:!1});function I(){return k.includeDrafts}function KD(e){k.includeDrafts=e}function T(e,t,r){return r?e:e.filter((o)=>!Hl(t(o)))}function W(e){let t=[],r=[],o="",s=!1,l=!1,u=()=>{r.push(o),o="",l=!1},x=()=>{if(u(),r.length===1&&r[0]===""){r=[];return}t.push(r),r=[]};for(let C=0;C<e.length;C++){let F=e[C];if(s){if(F==='"')if(e[C+1]==='"')o+='"',C+=1;else s=!1;else o+=F;continue}if(F==='"'&&!l)s=!0,l=!0;else if(F==='"')o+=F;else if(F===",")u();else if(F===`
|
|
2
|
+
`)x();else if(F==="\r"){if(e[C+1]===`
|
|
3
|
+
`)C+=1;x()}else o+=F,l=!0}if(o!==""||r.length>0)x();return t}function Ad(e){let t=(e.match(/\r\n/g)??[]).length,r=(e.match(/(?<!\r)\n/g)??[]).length,o=t>r?`\r
|
|
4
|
+
`:`
|
|
5
|
+
`,s=e.endsWith(`
|
|
6
|
+
`),l=W(e),u=l[0]??[],x=l.slice(1),C=Math.max(u.length,...x.map((F)=>F.length),0);while(u.length<C)u.push("");for(let F of x)while(F.length<C)F.push("");return{eol:o,headers:u,rows:x,trailingNewline:s}}function z(e){if(/[",\n\r]/.test(e))return`"${e.replaceAll('"','""')}"`;return e}function AT(e){return[e.headers,...e.rows].map((r)=>r.map((o)=>z(o)).join(",")).join(e.eol)+(e.trailingNewline?e.eol:"")}function q(e,t){let{headers:r,rows:o}=Ad(e),s=[t,"id","sku","slug","Slug"].flatMap((l)=>{let u=l===void 0?-1:r.indexOf(l);return u===-1?[]:[u]});return o.filter((l)=>l.some((u)=>u.trim()!=="")).map((l,u)=>{let x=s.find((C)=>(l[C]??"")!=="");return x===void 0?String(u):l[x]})}function B(e,t){let r;try{r=JSON.parse(e)}catch{return[]}let o=(s,l)=>{let u=_(s)&&!Array.isArray(s)?s.id:void 0;return n(u)||Z(u)?String(u):l};if(!Array.isArray(r))return[o(r,t)];return r.map((s,l)=>o(s,`${t}-${l}`))}function K(e,t,r){let o=e.toLowerCase();if(o.endsWith(".csv"))return q(t,r);if(o.endsWith(".json")){let s=(e.split("/").pop()??e).replace(/\.json$/i,"");return B(t,s)}return[]}var R="__path";function N(){return S?.projectConfig?.content??{}}function fb(e){let t=N()[e];if(!t?.source)return null;let r=t.source.replace(/^\.\//,"").replace(/\/$/,""),o=t.format==="json"?".json":zi(t.format)?.extensions[0]??cr()?.extensions[0]??".json";return{def:t,dir:r,ext:o,name:e}}function mS(){return Object.entries(N()).filter(([,e])=>{let t=e.source?.replace(/^\.\//,"")??"";return t!==""&&!/\.[a-z0-9]+$/i.test(t)}).map(([e,t])=>({dir:t.source.replace(/^\.\//,"").replace(/\/$/,""),name:e}))}async function O(e,t){let r=p(),o=[],s=async(l)=>{let u;try{u=await r.listDirectory(l)}catch{return}for(let x of u)if(x.type==="directory")await s(x.path);else if(t.some((C)=>x.path.endsWith(C)))o.push(x.path)};return await s(e),o.toSorted()}async function gS(e){let t=e.dir.indexOf(Io);if(t===-1)return[e.dir];let r=e.dir.slice(0,t).replace(/\/$/,""),o=e.dir.slice(t+Io.length),s;try{s=await p().listDirectory(r)}catch{return[]}return s.filter((l)=>l.type==="directory").map((l)=>`${l.path}${o}`.replace(/\/$/,"")).filter((l)=>Kd(l)?.name===e.name).toSorted()}async function V(e){let t=await gS(e);return(await Promise.all(t.map((o)=>O(o,[e.ext])))).flat().toSorted()}async function H(e){let t=Aw(e.name);if(t===null)return null;let r;try{r=await p().readFile(t)}catch{return[]}return K(t,r,e.def.idField)}async function mb(e){await Bt().catch(()=>{});let t=fb(e);if(!t)return[];let r=await H(t);if(r!==null)return r;return(await V(t)).map((s)=>{let l=s.split("/").pop()??s;return l.slice(0,l.length-t.ext.length)})}async function Q(e,t,r){let o=Array.from({length:e.length}),s=0,l=Array.from({length:Math.min(t,e.length)},async()=>{while(s<e.length){let u=s;s+=1,o[u]=await r(e[u])}});return await Promise.all(l),o}function j(e){if(e===void 0)return null;if(rf(e))return e;if(Array.isArray(e)&&e.every((t)=>!_(t)))return e.map(String);return JSON.stringify(e)}function A(e){for(let t of m.tabs.values())if(t.documentPath===e)return t;return null}function U(e,t){return e.every((r)=>{let o=r[t];return!n(o)||!o.startsWith("{")&&!o.startsWith("[")})}var L=new WeakSet;async function OT(){let e=[];for(let t of m.tabs.values()){let r=ir(t);if(r&&L.has(r.source))e.push(r.load())}await Promise.all(e)}function J(e){let t=X(e);if(e.drafts)L.add(t);return t}function X(e){let t=new Map,r=null,o=null,s=(d=!1)=>{if(!d&&r)return r;return r=(async()=>{await Bt().catch(()=>{});let h=p(),f=await e.list();t.clear(),o=null;let y=await Q(f,32,async(i)=>{try{let a=await h.readFile(i),c=await Hr(i,a);return{document:c.document,formatName:c.format.name,frontmatter:c.frontmatter,rawText:a}}catch{return null}});for(let[i,a]of f.entries()){let c=y[i];if(c)t.set(a,c)}})(),r},l=()=>{if(o)return o;let d={editable:!1,field:R,insertOnly:!0,kind:"string",pk:!0,required:!0,title:"Path",widthHint:220},h=Ew(e.schema()),f=new Set([R,...h.map((a)=>a.field)]),y=[...t.values()].map((a)=>{let c={};for(let[w,b]of Object.entries(a.frontmatter))if(!f.has(w)&&!w.startsWith("$"))c[w]=j(b);return c}),i=Tw(y);for(let a of i)a.editable=a.kind!=="text"||U(y,a.field);if(e.priorityFields?.length){let a=(c)=>{let w=e.priorityFields.indexOf(c.field);return w===-1?e.priorityFields.length:w};i.sort((c,w)=>a(c)-a(w))}return o=x([d,...h,...i]),o},u=()=>{if(!e.drafts)return!1;let d=e.schema();return Dc(d)||[...t.values()].some((h)=>Dc(d,h.frontmatter))},x=(d)=>{let h=d.findIndex((y)=>y.field===Cs);if(h<1||!u())return d;let f=d.filter((y)=>y.field!==Cs);return[f[0],d[h],...f.slice(1)]},C=(d,h)=>{let f={[R]:d};for(let y of l()){if(y.field===R)continue;f[y.field]=j(h.frontmatter[y.field])}return{cells:f,fingerprint:h.rawText,key:d}},F=async(d,h,f)=>{let y=p(),i={...h.frontmatter};for(let b of f)if(b.value===null)delete i[b.field];else i[b.field]=b.value;let a=h.document,c={...i,...a,children:a.children??[]},w=await Oa(h.formatName,c,{mode:"roundtrip",source:h.rawText});La(d),await y.writeFile(d,w),t.set(d,{...h,frontmatter:i,rawText:w})};return{backingPaths:()=>new Map([...t.keys()].map((d)=>[d,d])),capabilities:{delete:!0,insert:!0,remotePaging:!1,remoteSort:!1},async columns(){return await s(),l()},async commit(d){await s();let h=p(),f={cells:[],deletes:[],inserts:[]},y=new Map;for(let i of d.cells){let a=y.get(i.rowKey)??[];a.push({field:i.field,value:i.value}),y.set(i.rowKey,a)}for(let[i,a]of y){let c=(P,D,v)=>{for(let G of a)f.cells.push({error:D,field:G.field,ok:P,rowKey:i,stale:v})},w=t.get(i);if(!w){c(!1,"Entry no longer loaded — refresh the grid");continue}let b=A(i);if(b?.doc.dirty){c(!1,"Open in a tab with unsaved changes — save or close it first");continue}let E=null;try{E=await h.readFile(i)}catch{E=null}if(E!==w.rawText&&!zd(i)){c(!1,"File changed on disk — refresh to reload",!0);continue}try{if(await F(i,w,a),c(!0),b){let{reloadFileInTab:P}=await (le("ybpp3j38"),import("./files-ybpp3j38.js"));P(i)}}catch(P){c(!1,P instanceof Error?P.message:String(P))}}for(let i of d.inserts){let a=i.cells[R];if(!n(a)||a.trim()===""){f.inserts.push({error:"Path is required",ok:!1,tempKey:i.tempKey});continue}let c=e.resolveInsertPath(a),w=t.has(c);if(!w)try{await h.readFile(c),w=!0}catch{w=!1}if(w){f.inserts.push({error:`${c} already exists`,ok:!1,tempKey:i.tempKey});continue}let b=e.insertFormatName(c);if(!b){f.inserts.push({error:`No format can serialize ${c}`,ok:!1,tempKey:i.tempKey});continue}try{let E={};for(let[v,G]of Object.entries(i.cells))if(v!==R&&G!==null)E[v]=G;let P=await Oa(b,{...E,children:[]},{frontmatter:Object.keys(E).length>0,mode:"roundtrip"});La(c),await h.writeFile(c,P);let D=await Hr(c,P);t.set(c,{document:D.document,formatName:D.format.name,frontmatter:D.frontmatter,rawText:P}),f.inserts.push({newKey:c,ok:!0,tempKey:i.tempKey})}catch(E){f.inserts.push({error:E instanceof Error?E.message:String(E),ok:!1,tempKey:i.tempKey})}}for(let i of d.deletes){if(A(i.rowKey)){f.deletes.push({error:"Open in a tab — close it first",ok:!1,rowKey:i.rowKey});continue}try{La(i.rowKey),await h.deleteFile(i.rowKey),t.delete(i.rowKey),f.deletes.push({ok:!0,rowKey:i.rowKey})}catch(a){f.deletes.push({error:a instanceof Error?a.message:String(a),ok:!1,rowKey:i.rowKey})}}return f},id:e.id,label:e.label,async refresh(){await s(!0)},async rows(){await s();let h=(e.drafts?T([...t.entries()],([,f])=>f.frontmatter,I()):[...t.entries()]).map(([f,y])=>C(f,y));return{rows:h,total:h.length}}}}function MT(e){let t=()=>{let r=fb(e);if(!r)throw Error(`No content collection named "${e}" in project.json`);return r};return J({drafts:!0,id:ls({kind:"collection",name:e}),insertFormatName:(r)=>{let o=t();return(o.def.format?zi(o.def.format)?.name:void 0)??fn(r)?.name??cr()?.name??null},label:e,list:()=>V(t()),resolveInsertPath:(r)=>{let o=t(),s=r.trim().replace(/^\.\//,"").replace(/^\//,"");if(!s.includes("/"))s=`${o.dir}/${s}`;if(!s.endsWith(o.ext))s=`${s}${o.ext}`;return s},schema:()=>t().def.schema})}function PT(){let e=()=>{let t=ul("page").filter((r)=>r!==".json");return t.length>0?t:[".md"]};return J({id:ls({kind:"pages"}),insertFormatName:(t)=>fn(t)?.name??null,label:"Pages",list:()=>O("pages",e()),priorityFields:["title","description"],resolveInsertPath:(t)=>{let r=t.trim().replace(/^\.\//,"").replace(/^\//,"");if(!r.startsWith("pages/"))r=`pages/${r}`;if(!e().some((o)=>r.endsWith(o)))r=`${r}${e()[0]}`;return r},schema:()=>null})}
|
|
7
|
+
export{Ad,AT,Cs,wp,Hl,Dc,KD,fb,mS,gS,mb,OT,MT,PT};
|
|
8
|
+
|
|
9
|
+
//# debugId=9897E0CD8218438964756E2164756E21
|
|
10
|
+
//# sourceMappingURL=studio-2dtc90zs.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{p}from"./studio-
|
|
2
|
-
export{
|
|
1
|
+
import{p}from"./studio-pr23qhrw.js";import{Si}from"./studio-6vrxzkba.js";import{us}from"./studio-hnx1h1pr.js";import{nn}from"./studio-gmhd0j3f.js";import{Vc,uA,Ab}from"./studio-hvxt8z79.js";import{Z}from"./studio-kt2j51sa.js";var u=new Map,h=new Map,d=new Map,g=new Set;function m(e){return nn(e)===".svg"}function c(e){let t=e===null?null:/^\s*(\d+(?:\.\d+)?)\s*(?:px)?\s*$/.exec(e),n=t?Number(t[1]):Number.NaN;return n>0?n:null}function M(e){let t=new DOMParser().parseFromString(e,"image/svg+xml").documentElement;if(t.localName!=="svg")return null;let n=c(t.getAttribute("width")),i=c(t.getAttribute("height")),r=(t.getAttribute("viewBox")??"").trim().split(/[\s,]+/).map(Number),o=r[2]??Number.NaN,l=r[3]??Number.NaN,a=r.length===4&&o>0&&l>0,s=null;if(n!==null&&i!==null)s={height:i,width:n};else if(a&&n!==null)s={height:n*l/o,width:n};else if(a&&i!==null)s={height:i,width:i*o/l};else if(a)s={height:l,width:o};return s&&{height:Math.round(s.height),width:Math.round(s.width)}}async function b(e){g.add(e);try{let t=M(await p().readFile(e));if(t&&t.width>0&&t.height>0)d.set(e,t)}catch{}}function Dd(e){let t=Si(e);return u.has(t)&&(!m(t)||g.has(t))}function f(e,t){let n=uA(e),i=d.get(e);return{bytes:Z(t?.size)?t.size:null,ext:nn(n),height:i?.height??null,kind:Vc({name:n}),modified:t?.modified??null,name:n,path:e,width:i?.width??null}}function Nd(e){return u.get(Si(e))??null}function qD(e){for(let t of e){if(t.type!=="file")continue;let n=Si(t.path);if(!u.has(n))u.set(n,f(n,t))}}async function Uu(e){let t=Si(e),n=u.get(t);if(n&&Dd(t))return n;let i=h.get(t);if(i)return i;let r=(async()=>{if(m(t)&&!g.has(t))await b(t);if(n){let a=d.get(t);return{...n,height:a?.height??null,width:a?.width??null}}let l;try{l=(await us(()=>p().listDirectory(Ab(t)))).find((s)=>Si(s.path)===t)}catch{l=void 0}return f(t,l)})();h.set(t,r);let o=await r;return h.delete(t),u.set(t,o),o}function yp(e,t,n){if(!(t>0&&n>0))return!1;let i=Si(e);if(m(i))return!1;let r=d.get(i);if(r&&r.width===t&&r.height===n)return!1;d.set(i,{height:n,width:t});let o=u.get(i);if(o)u.set(i,{...o,height:n,width:t});return!0}function GD(){u.clear(),d.clear(),g.clear()}function NT(e){if(e<1024)return`${e} B`;if(e<1048576)return`${Math.round(e/1024)} KB`;return`${(e/1048576).toFixed(1)} MB`}function Cw(e){if(!e)return"";let t=[];if(e.width!==null&&e.height!==null)t.push(`${e.width} × ${e.height}`);if(e.bytes!==null)t.push(NT(e.bytes));return t.join(" · ")}
|
|
2
|
+
export{Dd,Nd,qD,Uu,yp,GD,NT,Cw};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
5
|
-
//# sourceMappingURL=studio-
|
|
4
|
+
//# debugId=058F9F991DB85F6F64756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-332hesdk.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{p,_e}from"./studio-
|
|
2
|
-
`),i=
|
|
3
|
-
${r}`;if(!E.has(o)){let s=j,a=Se(e,t).then((l)=>{if(E.get(o)===a)E.delete(o);if(s===j){w.set(e,{entries:l,key:r});for(let c of L)c()}return l});E.set(o,a)}return null}function Fe(e,t,r){let i=w.get(t),o=i?.entries.findIndex((a)=>a.path===e)??-1;if(!i||o===-1)return!1;let s=i.entries.with(o,X(e,t,r));w.set(t,{entries:s,key:i.key});for(let a of L)a();return!0}function fD(e,t){let r=Ul(e);if(e===null||r===null||r===ci)return!1;return Fe(e,r,t)}function kE(){j+=1,w.clear(),E.clear()}function iw(e){return L.add(e),()=>{L.delete(e)}}var Le=/^\d{4}-\d{2}-\d{2}/,y="entry",b=g(new Map);function k(e){let t=b.get(e.id);if(t===void 0)return null;if("key"in t)return t.key;return ir(e)?.state.rows[t.row]?.key??null}function ve(e){return b.has(e.id)}function A(e,t){b.set(e.id,{key:t})}function Ce(e){b.delete(e.id)}function h(e){return ve(e)&&ir(e)!==null}function ee(e){let t=ir(e),r=k(e);if(!t||r===null)return{};let i={};for(let o of t.state.columns){let s=t.buffer.effectiveValue(r,o.field);if(s===null||s==="")continue;if(o.kind==="date"&&n(s)&&!Le.test(s)){i[o.field]=tb(s)||s;continue}i[o.field]=S(s)&&!Array.isArray(s)?s.$ref:s}return i}function Te(e){if(e===void 0||e===null)return null;if(Array.isArray(e))return e.map((t)=>n(t)?t:JSON.stringify(t));if(n(e)||Z(e)||Xe(e))return e;return JSON.stringify(e)}function I(e,t){let r=ir(e),i=k(e);if(!r||i===null)return;let o=new Set(r.state.columns.map((s)=>s.field));r.buffer.group(()=>{for(let[s,a]of Object.entries(t))if(o.has(s))r.buffer.setCell(i,s,Te(a))})}function F(e){let t=ir(e),r=k(e),i=t?.state.rows??[],o=r===null?-1:i.findIndex((s)=>s.key===r);return{index:o,next:o===-1?null:i[o+1]?.key??null,previous:o<=0?null:i[o-1]?.key??null,total:i.length}}async function mD(e,t){let{openFileInTab:r}=await (le("rcn56qvm"),import("./files-rcn56qvm.js"));await r(e);let i=m.tabs.get(e)??null;if(!i||!ir(i))return i;if(!b.has(i.id))i.scope.run(()=>{ta(()=>Ce(i))});if(b.set(i.id,{row:t}),!i.capabilities.modes.includes(y))i.capabilities.modes.unshift(y);return i.session.ui.canvasMode=y,i.session.ui.preview=!1,Bt(i.id),i}function te(e){return e.doc.sourceFormat==null&&e.doc.mode!=="content"}function Fl(e){if(h(e))return ee(e);return te(e)?e.doc.document:e.doc.content.frontmatter}function Re(e,t,r){let i=e.doc.document,o=Object.hasOwn(i,t)?$e(i[t]):void 0,s=r===void 0||r===null||r==="";if(s)delete i[t];else i[t]=r;let a=s?void 0:$e(r);Bi({forward:{key:t,op:"set-key",path:[],value:a},inverse:{key:t,op:"set-key",path:[],value:o}}),e.doc.dirty=!0,tN()}function _(e,t,r){if(h(e))I(e,{[t]:r});else if(te(e))Re(e,t,r);else Kd(e,t,r)}function q_(e,t){if(h(e)){I(e,t);return}Y(e,(r)=>{for(let[i,o]of Object.entries(t))_(r,i,o)})}var re={$schema:"https://jxsuite.com/schema/v1",$id:"StudioEntryEditor",$description:"The Entry editor (site-architecture.md §7.4) — one content entry's fields, in a pane, as a Jx document over the kit. The adapter (`surfaces/entry-editor.ts`) hands in a projection; `content/entry-editor.ts` decides everything in it — which collection the file belongs to, which record its fields live in, which required keys are absent and what a draft flag commits into. The FORM is an island: a schema is `ui/schema-form.ts`'s subject, so this document renders an empty `fields` node and the flow places the element that engine hands back (studio-ui-guidelines.md §9.3, §9.4). That is the whole of the difference between this and the card the lit version drew, and it is why the engine converting in batch 7 is what unblocked this one.",tagName:"div",attributes:{part:"entry","data-jx-region":"${state.region}"},style:{$description:"What `.entry-editor`, `.entry-editor-header`, `.entry-editor-collection`, `.entry-draft-switch`, `.entry-editor-fields`, `.entry-editor-note` and `.entry-editor-empty` said in `styles/overlays.css`, keyed on `part` and re-pointed at the studio token layer. This editor was the only emitter of all seven, so those rules are dead in the stylesheet from here; a central sweep removes them rather than this change, which owns no stylesheet. Every `--spectrum-font-size-*` reference is gone rather than renamed: those names resolve only inside `<sp-theme>`, and a pane editor is mounted outside it, so each would silently have taken its hard-coded fallback.",height:"100%",padding:"var(--jx-space-5)",overflowY:"auto",background:"var(--bg-panel)",'& [part="header"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-4)",marginBottom:"var(--jx-space-5)"},'& [part="name"]':{margin:"0",fontSize:"var(--jx-text-lg)",fontWeight:"600",color:"var(--fg)"},'& [part="collection"]':{padding:"1px var(--jx-space-3)",borderRadius:"var(--radius)",background:"var(--bg)",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"},'& [part="draft"]':{$description:"Pushed to the far end of the header rather than placed there: the heading and the collection chip are both content-width, so `margin-left: auto` is what keeps the switch on the right edge whatever the entry is called.",marginLeft:"auto"},'& [part="fields"]':{$description:"The schema form's host is `display: contents`, so its rows are the flex items of THIS box — which is why the column lives here and not inside the engine.",display:"flex",flexDirection:"column"},'& [part="note"]':{margin:"0 0 var(--jx-space-4)",color:"var(--fg-dim)",fontSize:"var(--jx-text-md)",lineHeight:"1.5"},'& [part="empty"]':{display:"flex",maxWidth:"46ch",flexDirection:"column",alignItems:"flex-start",gap:"var(--jx-space-3)",color:"var(--fg-dim)",fontSize:"var(--jx-text-md)",lineHeight:"1.5"},'& [part="record-nav"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-2)",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"}},children:[{tagName:"div",attributes:{part:"stage-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/stage"},cases:{entry:{tagName:"div",attributes:{part:"body",role:"none"},style:{display:"contents"},children:[{tagName:"div",attributes:{part:"header"},children:[{tagName:"h3",attributes:{part:"name"},textContent:"${state.name}"},{tagName:"span",attributes:{part:"collection"},textContent:"${state.collection}"},{tagName:"div",attributes:{part:"record-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/recordNav"},cases:{shown:{$description:"A record of a file-backed collection (a CSV row): which row of the file this is, the rows either side of it, and the grid that shows them all. A file entry has no neighbours to step to, so it draws none of this.",tagName:"div",attributes:{part:"record-nav",role:"group","aria-label":"Records"},children:[{tagName:"jx-action-button",attributes:{part:"previous"},$props:{size:"sm",quiet:!0,label:"Previous record",hint:"Previous record",disabled:{$ref:"#/state/previousDisabled"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/showPrevious"},value:[]}]},children:[{tagName:"span",textContent:"‹ Previous"}]},{tagName:"span",attributes:{part:"place"},textContent:"${state.place}"},{tagName:"jx-action-button",attributes:{part:"next"},$props:{size:"sm",quiet:!0,label:"Next record",hint:"Next record",disabled:{$ref:"#/state/nextDisabled"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/showNext"},value:[]}]},children:[{tagName:"span",textContent:"Next ›"}]},{tagName:"jx-action-button",attributes:{part:"grid"},$props:{size:"sm",quiet:!0,label:"Edit in grid",hint:"Every record of the file, as a table"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openGrid"},value:[]}]},children:[{tagName:"span",textContent:"Edit in grid"}]}]}}},{tagName:"div",attributes:{part:"draft-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/draftAxis"},cases:{shown:{$description:"No `label`: the slotted word is on screen and carries the name, so an aria-label would be read twice. The tooltip is `hint`, which is what DRAFT_MEANING has always been.",tagName:"jx-switch",attributes:{part:"draft"},$props:{checked:{$ref:"#/state/draft"},hint:"${state.draftHint}",size:"sm"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setDraft"},value:[{$ref:"event#/target/checked"}]}]},children:[{tagName:"span",textContent:"Draft"}]}}}]},{tagName:"div",attributes:{part:"note-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/noteState"},cases:{shown:{tagName:"p",attributes:{part:"note"},textContent:"${state.note}"}}},{$description:"An island: `ui/schema-form.ts` draws this entry's fields into this node, and nothing in this document knows what a schema is.",tagName:"div",attributes:{part:"fields","data-jx-region":"${state.fieldsRegion}"}}]},empty:{$description:"The mode is reachable from the palette and from `__jxAutomation` on any tab, so this state is real: it names the reason and the fix rather than drawing an empty form.",tagName:"div",attributes:{part:"empty"},children:[{tagName:"p",attributes:{part:"empty-line"},textContent:"${state.emptyLine}"},{tagName:"p",attributes:{part:"note"},children:[{tagName:"span",textContent:"A collection is a "},{tagName:"code",textContent:"content"},{tagName:"span",textContent:" entry in "},{tagName:"code",textContent:"project.json"},{tagName:"span",textContent:" whose "},{tagName:"code",textContent:"source"},{tagName:"span",textContent:" directory contains this file and which declares a "},{tagName:"code",textContent:"schema"},{tagName:"span",textContent:"."}]},{tagName:"jx-action-button",attributes:{part:"content-types"},$props:{label:"Content types",size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openContentTypes"},value:[]}]},children:[{tagName:"span",textContent:"Content types…"}]}]}}}]};T("entry-editor",re);function ie(e,t){e.region=t.region,e.fieldsRegion=t.fieldsRegion,e.stage=t.stage,e.name=t.name,e.collection=t.collection,e.draftAxis=t.draftAxis,e.draft=t.draft,e.draftHint=t.draftHint,e.noteState=t.noteState,e.note=t.note,e.emptyLine=t.emptyLine,e.recordNav=t.recordNav,e.place=t.place,e.previousDisabled=t.previousDisabled,e.nextDisabled=t.nextDisabled}function Ne(e){let t=n(e)?void 0:e.attributes?.part;return n(t)?t:""}function oe(e,t,r,i){e.replaceChildren();let o=g({collection:"",draft:!1,draftAxis:"hidden",draftHint:"",emptyLine:"",fieldsRegion:"",name:"",nextDisabled:!0,note:"",noteState:"hidden",openContentTypes:r.openContentTypes,openGrid:r.openGrid,place:"",previousDisabled:!0,recordNav:"hidden",region:"",setDraft:r.setDraft,showNext:r.showNext,showPrevious:r.showPrevious,stage:"empty"});ie(o,t);let s=null,a=!1,l=R("entry-editor",o,e,{onNodeCreated:(c,d,f)=>{if(c instanceof HTMLElement&&Ne(f)==="fields")i.fieldsSlot(c)}}).then((c)=>{let d=c.root;if(a)return c.dispose(),d;return s=c,d});return{attached:()=>{if(a)return!1;let c=s?.root;return c===void 0?!0:c instanceof HTMLElement&&e.contains(c)},dispose(){a=!0,s?.dispose(),s=null},ready:l,update:(c)=>ie(o,c)}}var H=g(new Map);function se(e,t){H.set(e,t)}function gD(e){return e?H.get(e):void 0}function bD(e){H.delete(e)}function M(e){return e.replaceAll("\\","/").replace(/^(?:\.\/)+/,"").replace(/\/+$/,"")}function je(e){if(e.endsWith("/"))return!1;let t=e.slice(e.lastIndexOf("/")+1);return/\.[a-z\d]+$/i.test(t)}function ce(e,t){let r=[];for(let s of e)r.push(M(s));let i=[],o=t?.content??{};for(let s of Object.values(o)){if(!n(s.source)||s.source===""||je(s.source))continue;let a=M(s.source),l=a.indexOf(Io);if(l!==-1)a=M(a.slice(0,l));if(a===""||a===".")continue;if(![...r,...i].some((d)=>a===d||a.startsWith(`${d}/`)))i.push(a)}return i.length===0?e:[...e,...i]}function Pe(e,t){let r=Ul(e);if(r===null)return null;if(r===ci)return t===void 0||Xu(e,t)?r:null;let i=Un(e);if(!i||i.name!==r||!i.def.format||i.ext===null)return r;return e.toLowerCase().endsWith(i.ext.toLowerCase())?r:null}var Oe=new Set(["node_modules",".git",".jx",".cache"]);async function de(e,t,r,i,o,s=!1,a){let l;try{l=await hs(()=>t.listDirectory(e))}catch(d){if(!s)i.push({dir:e,error:Q(d)});return}let c=[];for(let d of l){if(d.type==="directory"){if(!Oe.has(d.name))c.push(d.path);continue}let f=on(d.name);r.push({collection:Pe(d.path,a),ext:f,locale:yx(d.path,o)??void 0,media:Ys.has(f),modified:d.modified,name:d.name,path:d.path,size:d.size,type:f||"file"})}await Promise.all(c.map((d)=>de(d,t,r,i,o,!1,a)))}async function rm(e,t,r=new Set,i){let o=[],s=[],{i18n:a}=Qt(x?.projectConfig??{});return await Promise.all(e.map((l)=>de(l,t,o,s,a,r.has(l),i))),o.sort((l,c)=>l.path.localeCompare(c.path)),{failures:s,files:o}}function EE(e,t){let r=e.filter((s)=>s.collection===t.collection),i=t.query.trim().toLowerCase();if(i)r=r.filter((s)=>s.name.toLowerCase().includes(i)||s.path.toLowerCase().includes(i));let o=t.locale?.trim();if(o)r=r.filter((s)=>s.locale===o);return r}var sm=["table","cards","calendar","board"],ow={board:"Board",calendar:"Calendar",cards:"Cards",table:"Table"};var vD=new Set(["cards"]),ke=/^(\d{4}-\d{2}-\d{2})/;function TE(e){let t=ke.exec(e.name);if(t)return t[1];if(e.modified){let r=vp(new Date(e.modified));if(r)return r}return null}function nb(){return Qt(x?.projectConfig??{}).i18n?.locales??[]}function yD(e){let t=new Set;for(let r of e)if(r.locale)t.add(r.locale);return nb().filter((r)=>t.has(r))}function wD(e,t=TE){let r=new Map,i=[];for(let s of e){let a=t(s);if(a===null){i.push(s);continue}let l=r.get(a);if(l)l.push(s);else r.set(a,[s])}return{days:[...r.entries()].map(([s,a])=>({date:s,files:a})).toSorted((s,a)=>a.date.localeCompare(s.date)),undated:i}}function Ae(e){let t=e.lastIndexOf("/");return t===-1?".":e.slice(0,t)}function xD(e){let t=new Map;for(let r of e){let i=Ae(r.path),o=t.get(i);if(o)o.push(r);else t.set(i,[r])}return[...t.entries()].map(([r,i])=>({files:i,group:r})).toSorted((r,i)=>r.group.localeCompare(i.group))}function Ie(e,t,r,i){let o=pp(e,t),s=o===null?"":t[o]??"",a=Object.values(t).find((l)=>l.trim()!=="");return(s||a||i||`Row ${r+1}`).trim()}function He(e){let{headers:t,rows:r}=Md(e);return r.flatMap((i,o)=>i.some((s)=>s.trim()!=="")?[{fields:Object.fromEntries(t.map((s,a)=>[s,i[a]??""])),row:o}]:[])}function Me(e){let t;try{t=JSON.parse(e)}catch{return null}let r=(i)=>S(i)&&!Array.isArray(i)?Object.fromEntries(Object.entries(i).map(([o,s])=>[o,P(s)])):{};if(!Array.isArray(t))return[{fields:r(t),row:0,single:!0}];return t.map((i,o)=>({fields:r(i),row:o}))}function ue(e,t,r){let i=e.toLowerCase(),o=i.endsWith(".csv")?He(t):i.endsWith(".json")?Me(t):null;if(o===null)return null;let s=(e.split("/").pop()??e).replace(/\.[^.]+$/,"");return o.map(({fields:a,row:l,single:c},d)=>({fields:a,index:d,row:l,title:Ie(r,a,d,c?s:"")}))}function fe(e,t){return`${e}#${t+1}`}var G="The Content workspace lists files; it does not edit them in the list. Rename, duplicate or delete from the file's context menu, or open the file to edit it.";function Ge(e){return`field:${e}`}function _D(e){return e.startsWith("field:")?e.slice(6):null}var Ve=6,me=new Set(["image","markdown","html","richtext"]);function V(e){return Sb($S(e))}function SD(e,t){return Object.entries(e?.properties??{}).filter(([r,i])=>{if(t.has(r)||r===ks)return!1;if(i.type==="object"||n(i.format)&&me.has(i.format))return!1;let o=i.items?.format;return i.type!=="array"||i.items?.type==="string"&&!(n(o)&&me.has(o))}).slice(0,Ve).map(([r,i])=>{let o={name:r,title:V(r)};if(i.type==="array")o.list=!0;if(i.type==="number"||i.type==="integer"||i.format==="date"||i.format==="date-time")o.measure=!0;return o})}function Je(e){let t=[{editable:!1,field:"title",kind:"string",title:"Title",widthHint:240},{editable:!1,field:"url",kind:"string",pk:!0,title:"URL",widthHint:200},{editable:!1,field:"template",kind:"string",title:"Template",widthHint:140}];if(e?.status)t.push({editable:!1,field:"status",kind:"string",title:"Status",widthHint:100});if(e?.locale)t.push({editable:!1,field:"locale",kind:"string",title:"Language",widthHint:110});return t.push({editable:!1,field:"modified",kind:"date",title:"Edited",widthHint:120}),t}function LE(e=ci,t){let r=[...t?.locale?[{editable:!1,field:"locale",kind:"string",title:"Locale",widthHint:90}]:[],{editable:!1,field:"modified",kind:"date",title:"Modified",widthHint:160},{editable:!1,field:"path",kind:"readonly",title:"Path",widthHint:320}];if(e===ci)return Je(t);let i=[{editable:!1,field:"title",kind:"string",title:"Title",widthHint:260}];if(t?.status)i.push({editable:!1,field:"status",kind:"string",title:"Status",widthHint:100});if(t?.date)i.push({editable:!1,field:"date",kind:"date",title:"Date",widthHint:120});for(let o of t?.fields??[])i.push({editable:!1,field:Ge(o.name),kind:"string",title:o.title,widthHint:140});return[...i,...r]}function ze(e){return{cells:{locale:e.locale??null,modified:e.modified??null,status:null,template:null,title:e.name,url:e.collection===ci?_r(e.path).urlPattern:null},key:e.path}}async function Ke(e,t){return(await Promise.all(e.map(async(i)=>{let o=i.collection===null?null:Un(i.path);if(!o?.fileBacked)return[i];let s;try{s=await t(i.path)}catch{return[i]}let a=ue(i.path,s,o.def.schema);if(a===null)return[i];return a.map((l)=>Ye(i,l))}))).flat()}function Ye(e,t){return{...e,name:t.title,path:fe(e.path,t.index),record:{fields:t.fields,row:t.row,source:e.path}}}async function Be(e){let t=p(),r=await Ke(e.files,(i)=>t.readFile(i));return{...e,files:r}}function CD(e){let t=null,r=null,i=null,o=e??(()=>ce(x?.projectDirs??[],x?.projectConfig??null));async function s(){if(t)return t;let a=o(),l=new Set(e?a:x?.projectDirs??[]),c=new Set(a.filter((d)=>!l.has(d)));return r??=Ev().then((d)=>rm(a,p(),c,d)).then(Be).then((d)=>(t=d,i=a.join(`
|
|
4
|
-
`),r=null,d)),r}return{capabilities:{delete:!1,insert:!1,remotePaging:!1,remoteSort:!1},columns:()=>Promise.resolve(
|
|
5
|
-
`)}}var We=[y],
|
|
6
|
-
export{pp,
|
|
1
|
+
import{p,_e}from"./studio-pr23qhrw.js";import{Q}from"./studio-nqxqf8p2.js";import{ge,ea,ne,g}from"./studio-hw60n5dh.js";import{ln,gx,Yl,Hi,Y,Gd,Vn,m,Ht}from"./studio-y1x65h5r.js";import{Sv}from"./studio-tpmnbgmt.js";import{Io}from"./studio-6vrxzkba.js";import{us}from"./studio-hnx1h1pr.js";import{Js,nn,Dp}from"./studio-gmhd0j3f.js";import{or}from"./studio-hvxt8z79.js";import{Ad,Cs,wp,Hl,Dc}from"./studio-2dtc90zs.js";import{ae}from"./studio-7cg75gtj.js";import{wi,T,R}from"./studio-02phtmqn.js";import{wr,Zu,ES,_b,ci,Vl}from"./studio-5abge3wy.js";import{ir,YD}from"./studio-1yhz0s8p.js";import{Fl,gp}from"./studio-bf0rgyf7.js";import{ya,Rc,OD,MD}from"./studio-d140sy8e.js";import{vp}from"./studio-e1g64q43.js";import{S}from"./studio-ana67wax.js";import{$e}from"./studio-gqpty626.js";import{n,Z,Xe,_,v}from"./studio-kt2j51sa.js";import{le}from"./studio-fqs1a22a.js";var he=["title","name","label","heading"];function pp(e,t={}){let r=(i)=>{for(let o of he){let s=i.find((a)=>a.toLowerCase()===o);if(s!==void 0)return s}return null};return r(Object.keys(e?.properties??{}))??r(Object.keys(t).filter((i)=>n(t[i])))}function j(e){if(e instanceof Date)return eb(e);if(n(e))return e;if(Z(e)||Xe(e))return String(e);if(Array.isArray(e))return e.filter((t)=>n(t)||Z(t)).map(String).join(", ");return""}function be(e,t){return Object.fromEntries(Object.keys(e?.properties??{}).filter((r)=>(r in t)).map((r)=>[r,j(t[r])]))}var xe=["date","published","publishedAt","pubDate","publishDate"];function z_(e,t){for(let[r,i]of Object.entries(e?.properties??{}))if(i.format==="date"||i.format==="date-time")return r;return xe.find((r)=>(r in t))??null}function bE(e){let t=e?.properties??{};return z_(e,Object.fromEntries(Object.keys(t).map((r)=>[r,""])))}function eb(e){if(e instanceof Date)return Number.isNaN(e.getTime())?"":e.toISOString().slice(0,10);if(!n(e))return"";let t=/^(\d{4}-\d{2}-\d{2})/.exec(e.trim());if(t)return t[1];let r=new Date(e);if(e.trim()===""||Number.isNaN(r.getTime()))return"";if(!e.includes(":")){let i=String(r.getMonth()+1).padStart(2,"0"),o=String(r.getDate()).padStart(2,"0");return`${r.getFullYear()}-${i}-${o}`}return r.toISOString().slice(0,10)}function P(e){let t=e.split("/").pop()??e,r=t.lastIndexOf(".");return r>0?t.slice(0,r):t}function B(e,t){if(t.startsWith("/"))return`public${t}`;let r=e.includes("/")?e.slice(0,e.lastIndexOf("/")):"",i=[...r===""?[]:r.split("/"),...t.split("/")],o=[];for(let s of i){if(s===""||s===".")continue;if(s==="..")o.pop();else o.push(s)}return o.join("/")}var W=/^[a-z][\d+.a-z-]*:/i;function Ee(e,t){let r=t.trim();if(r==="")return"";return W.test(r)?r:or(B(e,r))}function q(e){if(n(e))return e.split(",")[0]?.trim()??"";if(Array.isArray(e)){let[t]=e;return t===void 0?"":q(t)}if(v(e)){let{src:t}=e;return n(t)?t:""}return""}function U(e){if(e.format==="image")return!0;let t=e.properties?.src;if(e.type==="object"&&t?.type==="string")return!0;return e.type==="array"&&e.items!==void 0&&U(e.items)}function vE(e,t,r){for(let[i,o]of Object.entries(r?.properties??{}))if(U(o)){let s=Ee(e,q(t[i]));if(s!=="")return s}for(let i of Object.values(t)){if(!n(i)||W.test(i))continue;let o=i.lastIndexOf(".");if(o>0&&Dp(i.slice(o)))return or(B(e,i))}return""}function X(e,t,r){let i=ya(t)?.schema??null,o=pp(i,r),s=o===null?void 0:r[o],a=Hl(r),l=z_(i,r);return{date:l===null?"":eb(r[l]),fields:be(i,r),path:e,status:Dc(i,r)?a?"Draft":"Published":"",thumb:vE(e,r,i),title:n(s)&&s.trim()!==""?s:P(e)}}async function we(e){try{let t=await p().readFile(e);if(e.endsWith(".json")){let o=JSON.parse(t);return _(o)&&!Array.isArray(o)?o:{}}let{parseSourceForPath:r}=await (le("6pe4z7an"),import("./file-ops-6pe4z7an.js"));return(await r(e,t)).frontmatter}catch{return{}}}var E=new Map,x=new Map,N=0,F=new Set,K=200;async function Se(e,t){let r=t.slice(0,K),i=await Promise.all(r.map(async(s)=>X(s,e,await we(s)))),o=t.slice(K).map((s)=>({date:"",path:s,status:"",thumb:"",title:P(s)}));return[...i,...o]}function Qy(e,t){let r=t.join(`
|
|
2
|
+
`),i=E.get(e);if(i?.key===r)return i.entries;if(!_e())return t.map((s)=>({date:"",path:s,status:"",thumb:"",title:P(s)}));let o=`${e}
|
|
3
|
+
${r}`;if(!x.has(o)){let s=N,a=Se(e,t).then((l)=>{if(x.get(o)===a)x.delete(o);if(s===N){E.set(e,{entries:l,key:r});for(let c of F)c()}return l});x.set(o,a)}return null}function Fe(e,t,r){let i=E.get(t),o=i?.entries.findIndex((a)=>a.path===e)??-1;if(!i||o===-1)return!1;let s=i.entries.with(o,X(e,t,r));E.set(t,{entries:s,key:i.key});for(let a of F)a();return!0}function cD(e,t){let r=Vl(e);if(e===null||r===null||r===ci)return!1;return Fe(e,r,t)}function yE(){N+=1,E.clear(),x.clear()}function ew(e){return F.add(e),()=>{F.delete(e)}}var Le=/^\d{4}-\d{2}-\d{2}/,y="entry",b=g(new Map);function O(e){let t=b.get(e.id);if(t===void 0)return null;if("key"in t)return t.key;return ir(e)?.state.rows[t.row]?.key??null}function ve(e){return b.has(e.id)}function k(e,t){b.set(e.id,{key:t})}function Ce(e){b.delete(e.id)}function h(e){return ve(e)&&ir(e)!==null}function ee(e){let t=ir(e),r=O(e);if(!t||r===null)return{};let i={};for(let o of t.state.columns){let s=t.buffer.effectiveValue(r,o.field);if(s===null||s==="")continue;if(o.kind==="date"&&n(s)&&!Le.test(s)){i[o.field]=eb(s)||s;continue}i[o.field]=_(s)&&!Array.isArray(s)?s.$ref:s}return i}function Te(e){if(e===void 0||e===null)return null;if(Array.isArray(e))return e.map((t)=>n(t)?t:JSON.stringify(t));if(n(e)||Z(e)||Xe(e))return e;return JSON.stringify(e)}function A(e,t){let r=ir(e),i=O(e);if(!r||i===null)return;let o=new Set(r.state.columns.map((s)=>s.field));r.buffer.group(()=>{for(let[s,a]of Object.entries(t))if(o.has(s))r.buffer.setCell(i,s,Te(a))})}function w(e){let t=ir(e),r=O(e),i=t?.state.rows??[],o=r===null?-1:i.findIndex((s)=>s.key===r);return{index:o,next:o===-1?null:i[o+1]?.key??null,previous:o<=0?null:i[o-1]?.key??null,total:i.length}}async function dD(e,t){let{openFileInTab:r}=await (le("ybpp3j38"),import("./files-ybpp3j38.js"));await r(e);let i=m.tabs.get(e)??null;if(!i||!ir(i))return i;if(!b.has(i.id))i.scope.run(()=>{ea(()=>Ce(i))});if(b.set(i.id,{row:t}),!i.capabilities.modes.includes(y))i.capabilities.modes.unshift(y);return i.session.ui.canvasMode=y,i.session.ui.preview=!1,Ht(i.id),i}function te(e){return e.doc.sourceFormat==null&&e.doc.mode!=="content"}function Pl(e){if(h(e))return ee(e);return te(e)?e.doc.document:e.doc.content.frontmatter}function Re(e,t,r){let i=e.doc.document,o=Object.hasOwn(i,t)?$e(i[t]):void 0,s=r===void 0||r===null||r==="";if(s)delete i[t];else i[t]=r;let a=s?void 0:$e(r);Hi({forward:{key:t,op:"set-key",path:[],value:a},inverse:{key:t,op:"set-key",path:[],value:o}}),e.doc.dirty=!0,YD()}function I(e,t,r){if(h(e))A(e,{[t]:r});else if(te(e))Re(e,t,r);else Gd(e,t,r)}function W_(e,t){if(h(e)){A(e,t);return}Y(e,(r)=>{for(let[i,o]of Object.entries(t))I(r,i,o)})}var re={$schema:"https://jxsuite.com/schema/v1",$id:"StudioEntryEditor",$description:"The Entry editor (site-architecture.md §7.4) — one content entry's fields, in a pane, as a Jx document over the kit. The adapter (`surfaces/entry-editor.ts`) hands in a projection; `content/entry-editor.ts` decides everything in it — which collection the file belongs to, which record its fields live in, which required keys are absent and what a draft flag commits into. The FORM is an island: a schema is `ui/schema-form.ts`'s subject, so this document renders an empty `fields` node and the flow places the element that engine hands back (studio-ui-guidelines.md §9.3, §9.4). That is the whole of the difference between this and the card the lit version drew, and it is why the engine converting in batch 7 is what unblocked this one.",tagName:"div",attributes:{part:"entry","data-jx-region":"${state.region}"},style:{$description:"What `.entry-editor`, `.entry-editor-header`, `.entry-editor-collection`, `.entry-draft-switch`, `.entry-editor-fields`, `.entry-editor-note` and `.entry-editor-empty` said in `styles/overlays.css`, keyed on `part` and re-pointed at the studio token layer. This editor was the only emitter of all seven, so those rules are dead in the stylesheet from here; a central sweep removes them rather than this change, which owns no stylesheet. Every `--spectrum-font-size-*` reference is gone rather than renamed: those names resolve only inside `<sp-theme>`, and a pane editor is mounted outside it, so each would silently have taken its hard-coded fallback.",height:"100%",padding:"var(--jx-space-5)",overflowY:"auto",background:"var(--bg-panel)",'& [part="header"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-4)",marginBottom:"var(--jx-space-5)"},'& [part="name"]':{margin:"0",fontSize:"var(--jx-text-lg)",fontWeight:"600",color:"var(--fg)"},'& [part="collection"]':{padding:"1px var(--jx-space-3)",borderRadius:"var(--radius)",background:"var(--bg)",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"},'& [part="draft"]':{$description:"Pushed to the far end of the header rather than placed there: the heading and the collection chip are both content-width, so `margin-left: auto` is what keeps the switch on the right edge whatever the entry is called.",marginLeft:"auto"},'& [part="fields"]':{$description:"The schema form's host is `display: contents`, so its rows are the flex items of THIS box — which is why the column lives here and not inside the engine.",display:"flex",flexDirection:"column"},'& [part="note"]':{margin:"0 0 var(--jx-space-4)",color:"var(--fg-dim)",fontSize:"var(--jx-text-md)",lineHeight:"1.5"},'& [part="empty"]':{display:"flex",maxWidth:"46ch",flexDirection:"column",alignItems:"flex-start",gap:"var(--jx-space-3)",color:"var(--fg-dim)",fontSize:"var(--jx-text-md)",lineHeight:"1.5"},'& [part="record-nav"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-2)",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"}},children:[{tagName:"div",attributes:{part:"stage-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/stage"},cases:{entry:{tagName:"div",attributes:{part:"body",role:"none"},style:{display:"contents"},children:[{tagName:"div",attributes:{part:"header"},children:[{tagName:"h3",attributes:{part:"name"},textContent:"${state.name}"},{tagName:"span",attributes:{part:"collection"},textContent:"${state.collection}"},{tagName:"div",attributes:{part:"record-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/recordNav"},cases:{shown:{$description:"A record of a file-backed collection (a CSV row): which row of the file this is, the rows either side of it, and the grid that shows them all. A file entry has no neighbours to step to, so it draws none of this.",tagName:"div",attributes:{part:"record-nav",role:"group","aria-label":"Records"},children:[{tagName:"jx-action-button",attributes:{part:"previous"},$props:{size:"sm",quiet:!0,label:"Previous record",hint:"Previous record",disabled:{$ref:"#/state/previousDisabled"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/showPrevious"},value:[]}]},children:[{tagName:"span",textContent:"‹ Previous"}]},{tagName:"span",attributes:{part:"place"},textContent:"${state.place}"},{tagName:"jx-action-button",attributes:{part:"next"},$props:{size:"sm",quiet:!0,label:"Next record",hint:"Next record",disabled:{$ref:"#/state/nextDisabled"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/showNext"},value:[]}]},children:[{tagName:"span",textContent:"Next ›"}]},{tagName:"jx-action-button",attributes:{part:"grid"},$props:{size:"sm",quiet:!0,label:"Edit in grid",hint:"Every record of the file, as a table"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openGrid"},value:[]}]},children:[{tagName:"span",textContent:"Edit in grid"}]}]}}},{tagName:"div",attributes:{part:"draft-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/draftAxis"},cases:{shown:{$description:"No `label`: the slotted word is on screen and carries the name, so an aria-label would be read twice. The tooltip is `hint`, which is what DRAFT_MEANING has always been.",tagName:"jx-switch",attributes:{part:"draft"},$props:{checked:{$ref:"#/state/draft"},hint:"${state.draftHint}",size:"sm"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setDraft"},value:[{$ref:"event#/target/checked"}]}]},children:[{tagName:"span",textContent:"Draft"}]}}}]},{tagName:"div",attributes:{part:"note-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/noteState"},cases:{shown:{tagName:"p",attributes:{part:"note"},textContent:"${state.note}"}}},{$description:"An island: `ui/schema-form.ts` draws this entry's fields into this node, and nothing in this document knows what a schema is.",tagName:"div",attributes:{part:"fields","data-jx-region":"${state.fieldsRegion}"}}]},empty:{$description:"The mode is reachable from the palette and from `__jxAutomation` on any tab, so this state is real: it names the reason and the fix rather than drawing an empty form.",tagName:"div",attributes:{part:"empty"},children:[{tagName:"p",attributes:{part:"empty-line"},textContent:"${state.emptyLine}"},{tagName:"p",attributes:{part:"note"},children:[{tagName:"span",textContent:"A collection is a "},{tagName:"code",textContent:"content"},{tagName:"span",textContent:" entry in "},{tagName:"code",textContent:"project.json"},{tagName:"span",textContent:" whose "},{tagName:"code",textContent:"source"},{tagName:"span",textContent:" directory contains this file and which declares a "},{tagName:"code",textContent:"schema"},{tagName:"span",textContent:"."}]},{tagName:"jx-action-button",attributes:{part:"content-types"},$props:{label:"Content types",size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openContentTypes"},value:[]}]},children:[{tagName:"span",textContent:"Content types…"}]}]}}}]};T("entry-editor",re);function ie(e,t){e.region=t.region,e.fieldsRegion=t.fieldsRegion,e.stage=t.stage,e.name=t.name,e.collection=t.collection,e.draftAxis=t.draftAxis,e.draft=t.draft,e.draftHint=t.draftHint,e.noteState=t.noteState,e.note=t.note,e.emptyLine=t.emptyLine,e.recordNav=t.recordNav,e.place=t.place,e.previousDisabled=t.previousDisabled,e.nextDisabled=t.nextDisabled}function Ne(e){let t=n(e)?void 0:e.attributes?.part;return n(t)?t:""}function oe(e,t,r,i){e.replaceChildren();let o=g({collection:"",draft:!1,draftAxis:"hidden",draftHint:"",emptyLine:"",fieldsRegion:"",name:"",nextDisabled:!0,note:"",noteState:"hidden",openContentTypes:r.openContentTypes,openGrid:r.openGrid,place:"",previousDisabled:!0,recordNav:"hidden",region:"",setDraft:r.setDraft,showNext:r.showNext,showPrevious:r.showPrevious,stage:"empty"});ie(o,t);let s=null,a=!1,l=R("entry-editor",o,e,{onNodeCreated:(c,d,f)=>{if(c instanceof HTMLElement&&Ne(f)==="fields")i.fieldsSlot(c)}}).then((c)=>{let d=c.root;if(a)return c.dispose(),d;return s=c,d});return{attached:()=>{if(a)return!1;let c=s?.root;return c===void 0?!0:c instanceof HTMLElement&&e.contains(c)},dispose(){a=!0,s?.dispose(),s=null},ready:l,update:(c)=>ie(o,c)}}var H=g(new Map);function se(e,t){H.set(e,t)}function uD(e){return e?H.get(e):void 0}function hD(e){H.delete(e)}function M(e){return e.replaceAll("\\","/").replace(/^(?:\.\/)+/,"").replace(/\/+$/,"")}function je(e){if(e.endsWith("/"))return!1;let t=e.slice(e.lastIndexOf("/")+1);return/\.[a-z\d]+$/i.test(t)}function ce(e,t){let r=[];for(let s of e)r.push(M(s));let i=[],o=t?.content??{};for(let s of Object.values(o)){if(!n(s.source)||s.source===""||je(s.source))continue;let a=M(s.source),l=a.indexOf(Io);if(l!==-1)a=M(a.slice(0,l));if(a===""||a===".")continue;if(![...r,...i].some((d)=>a===d||a.startsWith(`${d}/`)))i.push(a)}return i.length===0?e:[...e,...i]}function Pe(e,t){let r=Vl(e);if(r===null)return null;if(r===ci)return t===void 0||Zu(e,t)?r:null;let i=Vn(e);if(!i||i.name!==r||!i.def.format||i.ext===null)return r;return e.toLowerCase().endsWith(i.ext.toLowerCase())?r:null}var Oe=new Set(["node_modules",".git",".jx",".cache"]);async function de(e,t,r,i,o,s=!1,a){let l;try{l=await us(()=>t.listDirectory(e))}catch(d){if(!s)i.push({dir:e,error:Q(d)});return}let c=[];for(let d of l){if(d.type==="directory"){if(!Oe.has(d.name))c.push(d.path);continue}let f=nn(d.name);r.push({collection:Pe(d.path,a),ext:f,locale:gx(d.path,o)??void 0,media:Js.has(f),modified:d.modified,name:d.name,path:d.path,size:d.size,type:f||"file"})}await Promise.all(c.map((d)=>de(d,t,r,i,o,!1,a)))}async function sm(e,t,r=new Set,i){let o=[],s=[],{i18n:a}=ln(S?.projectConfig??{});return await Promise.all(e.map((l)=>de(l,t,o,s,a,r.has(l),i))),o.sort((l,c)=>l.path.localeCompare(c.path)),{failures:s,files:o}}function wE(e,t){let r=e.filter((s)=>s.collection===t.collection),i=t.query.trim().toLowerCase();if(i)r=r.filter((s)=>s.name.toLowerCase().includes(i)||s.path.toLowerCase().includes(i));let o=t.locale?.trim();if(o)r=r.filter((s)=>s.locale===o);return r}var am=["table","cards","calendar","board"],tw={board:"Board",calendar:"Calendar",cards:"Cards",table:"Table"};var pD=new Set(["cards"]),ke=/^(\d{4}-\d{2}-\d{2})/;function xE(e){let t=ke.exec(e.name);if(t)return t[1];if(e.modified){let r=vp(new Date(e.modified));if(r)return r}return null}function tb(){return ln(S?.projectConfig??{}).i18n?.locales??[]}function fD(e){let t=new Set;for(let r of e)if(r.locale)t.add(r.locale);return tb().filter((r)=>t.has(r))}function mD(e,t=xE){let r=new Map,i=[];for(let s of e){let a=t(s);if(a===null){i.push(s);continue}let l=r.get(a);if(l)l.push(s);else r.set(a,[s])}return{days:[...r.entries()].map(([s,a])=>({date:s,files:a})).toSorted((s,a)=>a.date.localeCompare(s.date)),undated:i}}function Ae(e){let t=e.lastIndexOf("/");return t===-1?".":e.slice(0,t)}function gD(e){let t=new Map;for(let r of e){let i=Ae(r.path),o=t.get(i);if(o)o.push(r);else t.set(i,[r])}return[...t.entries()].map(([r,i])=>({files:i,group:r})).toSorted((r,i)=>r.group.localeCompare(i.group))}function Ie(e,t,r,i){let o=pp(e,t),s=o===null?"":t[o]??"",a=Object.values(t).find((l)=>l.trim()!=="");return(s||a||i||`Row ${r+1}`).trim()}function He(e){let{headers:t,rows:r}=Ad(e);return r.flatMap((i,o)=>i.some((s)=>s.trim()!=="")?[{fields:Object.fromEntries(t.map((s,a)=>[s,i[a]??""])),row:o}]:[])}function Me(e){let t;try{t=JSON.parse(e)}catch{return null}let r=(i)=>_(i)&&!Array.isArray(i)?Object.fromEntries(Object.entries(i).map(([o,s])=>[o,j(s)])):{};if(!Array.isArray(t))return[{fields:r(t),row:0,single:!0}];return t.map((i,o)=>({fields:r(i),row:o}))}function ue(e,t,r){let i=e.toLowerCase(),o=i.endsWith(".csv")?He(t):i.endsWith(".json")?Me(t):null;if(o===null)return null;let s=(e.split("/").pop()??e).replace(/\.[^.]+$/,"");return o.map(({fields:a,row:l,single:c},d)=>({fields:a,index:d,row:l,title:Ie(r,a,d,c?s:"")}))}function fe(e,t){return`${e}#${t+1}`}var G="The Content workspace lists files; it does not edit them in the list. Rename, duplicate or delete from the file's context menu, or open the file to edit it.";function Ge(e){return`field:${e}`}function bD(e){return e.startsWith("field:")?e.slice(6):null}var Ve=6,me=new Set(["image","markdown","html","richtext"]);function V(e){return _b(ES(e))}function vD(e,t){return Object.entries(e?.properties??{}).filter(([r,i])=>{if(t.has(r)||r===Cs)return!1;if(i.type==="object"||n(i.format)&&me.has(i.format))return!1;let o=i.items?.format;return i.type!=="array"||i.items?.type==="string"&&!(n(o)&&me.has(o))}).slice(0,Ve).map(([r,i])=>{let o={name:r,title:V(r)};if(i.type==="array")o.list=!0;if(i.type==="number"||i.type==="integer"||i.format==="date"||i.format==="date-time")o.measure=!0;return o})}function Je(e){let t=[{editable:!1,field:"title",kind:"string",title:"Title",widthHint:240},{editable:!1,field:"url",kind:"string",pk:!0,title:"URL",widthHint:200},{editable:!1,field:"template",kind:"string",title:"Template",widthHint:140}];if(e?.status)t.push({editable:!1,field:"status",kind:"string",title:"Status",widthHint:100});if(e?.locale)t.push({editable:!1,field:"locale",kind:"string",title:"Language",widthHint:110});return t.push({editable:!1,field:"modified",kind:"date",title:"Edited",widthHint:120}),t}function _E(e=ci,t){let r=[...t?.locale?[{editable:!1,field:"locale",kind:"string",title:"Locale",widthHint:90}]:[],{editable:!1,field:"modified",kind:"date",title:"Modified",widthHint:160},{editable:!1,field:"path",kind:"readonly",title:"Path",widthHint:320}];if(e===ci)return Je(t);let i=[{editable:!1,field:"title",kind:"string",title:"Title",widthHint:260}];if(t?.status)i.push({editable:!1,field:"status",kind:"string",title:"Status",widthHint:100});if(t?.date)i.push({editable:!1,field:"date",kind:"date",title:"Date",widthHint:120});for(let o of t?.fields??[])i.push({editable:!1,field:Ge(o.name),kind:"string",title:o.title,widthHint:140});return[...i,...r]}function ze(e){return{cells:{locale:e.locale??null,modified:e.modified??null,status:null,template:null,title:e.name,url:e.collection===ci?wr(e.path).urlPattern:null},key:e.path}}async function Ke(e,t){return(await Promise.all(e.map(async(i)=>{let o=i.collection===null?null:Vn(i.path);if(!o?.fileBacked)return[i];let s;try{s=await t(i.path)}catch{return[i]}let a=ue(i.path,s,o.def.schema);if(a===null)return[i];return a.map((l)=>Ye(i,l))}))).flat()}function Ye(e,t){return{...e,name:t.title,path:fe(e.path,t.index),record:{fields:t.fields,row:t.row,source:e.path}}}async function Be(e){let t=p(),r=await Ke(e.files,(i)=>t.readFile(i));return{...e,files:r}}function yD(e){let t=null,r=null,i=null,o=e??(()=>ce(S?.projectDirs??[],S?.projectConfig??null));async function s(){if(t)return t;let a=o(),l=new Set(e?a:S?.projectDirs??[]),c=new Set(a.filter((d)=>!l.has(d)));return r??=Sv().then((d)=>sm(a,p(),c,d)).then(Be).then((d)=>(t=d,i=a.join(`
|
|
4
|
+
`),r=null,d)),r}return{capabilities:{delete:!1,insert:!1,remotePaging:!1,remoteSort:!1},columns:()=>Promise.resolve(_E()),commit(a){return Promise.resolve({cells:a.cells.map((l)=>({error:G,field:l.field,ok:!1,rowKey:l.rowKey})),deletes:a.deletes.map((l)=>({error:G,ok:!1,rowKey:l.rowKey})),inserts:a.inserts.map((l)=>({error:G,ok:!1,tempKey:l.tempKey}))})},failures:()=>t?.failures??[],files:()=>t?.files??[],id:Yl("content"),label:"Content",async refresh(){t=null,r=null,await s()},async rows(){let a=await s();return{rows:a.files.map((l)=>ze(l)),total:a.files.length}},scanned:()=>t!==null,stale:()=>t!==null&&i!==o().join(`
|
|
5
|
+
`)}}var We=[y],C=new Map;function J(e){return C.get(e)??null}function SE(e,t){let r=J(e);return r!==null&&r.tabId===t.id&&r.wrap.isConnected&&r.surface.attached()}function nw(e){let t=C.get(e);if(!t)return;t.scope.stop(),t.surface.dispose(),C.delete(e)}function nb(e,t){Y(e,(r)=>I(r,Cs,t))}function wD(e){let t=L(e),r=Pl(e);if(!t||!Dc(t.schema,r))return null;let i=Hl(r);return{draft:i,text:i?"Draft":"Published",title:i?wp:"Not marked a draft."}}function CE(e){return Object.fromEntries(Object.entries(e?.properties??{}).map(([t,r])=>[t,{label:n(r.title)&&r.title!==""?r.title:V(t)}]))}function kE(e){return{fieldKeyPrefix:`entry:${e.id}`,resolvePointer:(t,r)=>gp(t,{projectConfig:S?.projectConfig??{},scope:r})}}function EE(e,t){return Object.fromEntries(MD(e.schema,t).map((r)=>[r,"Required — this entry does not have one."]))}function L(e){return h(e)?OD(e.documentPath):Rc(e.documentPath)}function TE(e,t,r){let i=pp(t,r),o=e.properties??{},s=i===null?void 0:o[i];if(i===null||s===void 0)return e;return{...e,properties:{[i]:s,...o}}}function qe(e){return`${e.documentPath??"This document"} is not an entry of any content collection, so there is no schema to draw a form from.`}function pe(e,t,r){let i=wi(e,"entry"),o=wi(e,"entry/fields");if(!r)return{collection:"",draft:!1,draftAxis:"hidden",draftHint:wp,emptyLine:qe(t),fieldsRegion:o,name:"",nextDisabled:!0,note:"",noteState:"hidden",place:"",previousDisabled:!0,recordNav:"hidden",region:i,stage:"empty"};let s=Pl(t),a=Hl(s),l=h(t),c=w(t);return{collection:r.name,draft:a,draftAxis:Dc(r.schema,s)?"shown":"hidden",draftHint:wp,emptyLine:"",fieldsRegion:o,name:l?Ue(r,s,c.index):t.documentPath?.split("/").pop()??"Untitled",nextDisabled:c.next===null,note:wp,noteState:a?"shown":"hidden",place:c.index===-1?"":`${c.index+1} of ${c.total}`,previousDisabled:c.previous===null,recordNav:l?"shown":"hidden",region:i,stage:"entry"}}function Ue(e,t,r){let i=pp(e.schema,t),o=i===null?void 0:t[i];if(n(o)&&o.trim()!=="")return o.trim();return r===-1?"Record":`Row ${r+1}`}function xD(e,t){let{paneId:r,wrap:i}=e;if(SE(r,t))return;nw(r);let o=null,s=null,a=()=>{if(o!==null&&J(r)===o)c()},l=(u)=>{if(!s||!u)return;let D=Pl(t),z=Fl(`entry:${r}`,TE(u.schema,u.schema,D),D,{context:kE(t),errors:EE(u,D),onChange:(ye)=>W_(t,ye),rerender:a,ui:CE(u.schema)});if(z.parentNode!==s)s.replaceChildren(z)},c=()=>{let u=L(t);if(!u)s=null;o?.surface.update(pe(r,t,u)),l(u)},d=ge(),f=oe(i,pe(r,t,L(t)),{openContentTypes:()=>{ae()?.run("settings.open",{section:"content"})},openGrid:()=>{let{index:u}=w(t);if(u!==-1&&t.documentPath)se(t.documentPath,u);t.session.ui.canvasMode="grid"},setDraft:(u)=>nb(t,u),showNext:()=>{let{next:u}=w(t);if(u!==null)k(t,u)},showPrevious:()=>{let{previous:u}=w(t);if(u!==null)k(t,u)}},{fieldsSlot:(u)=>{s=u,l(L(t))}});o={paneId:r,scope:d,surface:f,tabId:t.id,wrap:i},C.set(r,o),d.run(()=>{ne(()=>{if(J(r)!==o)return;t.doc.document,t.doc.content.frontmatter,S?.projectConfig?.content,c()})})}async function _D(e){let{openFileInTab:t}=await (le("ybpp3j38"),import("./files-ybpp3j38.js"));await t(e);for(let[r,i]of m.tabs.entries()){if(i.documentPath!==e)continue;for(let o of We)if(!i.capabilities.modes.includes(o))i.capabilities.modes.unshift(o);return i.session.ui.canvasMode=y,i.session.ui.preview=!1,Ht(r),i}return null}
|
|
6
|
+
export{pp,z_,bE,eb,vE,Qy,cD,yE,ew,dD,Pl,W_,uD,hD,sm,wE,am,tw,pD,xE,tb,fD,mD,gD,bD,vD,_E,yD,SE,nw,nb,wD,CE,kE,EE,TE,xD,_D};
|
|
7
7
|
|
|
8
|
-
//# debugId=
|
|
9
|
-
//# sourceMappingURL=studio-
|
|
8
|
+
//# debugId=4A66485A413BA1AD64756E2164756E21
|
|
9
|
+
//# sourceMappingURL=studio-3pndhat0.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{p,_e}from"./studio-
|
|
2
|
-
export{pt,Go,
|
|
1
|
+
import{p,_e}from"./studio-pr23qhrw.js";import{C}from"./studio-hw60n5dh.js";function v(e){return e.trim().replace(/\/+$/,"")}function u(e){return e.trim()}var pt={aiBaseUrl:{default:"",key:"jx.ai.baseUrl",normalize:v,scope:"user"},aiOpenAiKey:{default:"",key:"jx.ai.openaiKey",normalize:u,scope:"user",secret:!0},aiModel:{default:"gpt-4o",key:"jx.ai.model",normalize:u,scope:"user"},keybindings:{default:"",key:"jx.keybindings",normalize:(e)=>e.trim()==="{}"?"":e.trim(),scope:"user"},theme:{default:"",key:"jx-studio-theme",normalize:u,scope:"user"},showIgnoredFiles:{default:"",key:"jx.files.showIgnored",normalize:u,scope:"user"},developerPanels:{default:"",key:"jx.panels.developer",normalize:u,scope:"user"},cfAccountId:{default:"",key:"jx.cf.accountId",normalize:u,scope:"user"},cfToken:{default:"",key:"jx.cf.token",normalize:u,scope:"user",secret:!0}},S=Object.values(pt),f=S.filter((e)=>e.scope==="user"),P=f.map((e)=>e.key);function h(e){let t=e.schedule??queueMicrotask,n=null,i=Promise.resolve(),r=Promise.resolve();function s(){let o=n;if(n=null,!o)return i;return i=i.then(()=>e.send(o)).catch((a)=>{e.onError?.(a,o)}),i}return{enqueue(o){if(n){Object.assign(n,o);return}n={...o},r=new Promise((a)=>{t(()=>{s().then(a)})})},settled(){return r}}}var c=new Map;function m(){return typeof localStorage>"u"?void 0:localStorage}function k(e,t){try{if(t===null)m()?.removeItem(e);else m()?.setItem(e,t)}catch{}}try{for(let e of S){let t=m()?.getItem(e.key);if(t!==null&&t!==void 0)c.set(e.key,t)}}catch{}function Go(e){return c.get(e.key)??""}function EA(e){return(c.get(e.key)??"")!==""}var y=new Set;function Ap(e){return y.add(e),()=>{y.delete(e)}}function l(e){for(let t of y)t(e)}var g=h({onError(e){C("error","Your settings could not be saved.",{detail:e instanceof Error?e.message:String(e),key:"settings-write",source:"Settings"})},async send(e){if(!_e())return;let t=p();if(!t.patchSettings)return;let n={},i=[];for(let[r,s]of Object.entries(e))if(s)n[r]=s;else i.push(r);await t.patchSettings({remove:i,set:n})}});function TA(){return g.settled()}function d(e){let t=[];for(let[n,i]of Object.entries(e)){if((c.get(n)??null)===i)continue;if(i===null)c.delete(n);else c.set(n,i);k(n,i),t.push(n)}return t}function dx(e,t){return e.normalize?e.normalize(t):t}function _r(e,t){let n=dx(e,t),i=d({[e.key]:n});if(i.length>0)g.enqueue({[e.key]:n}),l(i)}function LA(e){let t={};for(let[i,r]of e)t[i.key]=dx(i,r);let n=d(t);if(n.length>0)g.enqueue(t),l(n)}function Op(e){let t={};for(let i of e)t[i.key]=null;let n=d(t);if(n.length>0)g.enqueue(t),l(n)}async function $A(){if(!_e())return;let e=p();if(!e.getSettings)return;let t;try{t=await e.getSettings()}catch{return}let n={},i=!1;for(let s of f){let o=t[s.key];if(o)n[s.key]=o;else if(c.get(s.key))i=!0}let r=d(n);if(r.length>0)l(r);if(i){let s={};for(let o of f){let a=c.get(o.key);if(a&&!t[o.key])s[o.key]=a}g.enqueue(s)}}function x(e){let t={};for(let i of f)t[i.key]=e[i.key]??null;let n=d(t);if(n.length>0)l(n)}function IA(){if(!_e())return;p().subscribeSettings?.(x)}
|
|
2
|
+
export{pt,Go,EA,Ap,TA,dx,_r,LA,Op,$A,IA};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
5
|
-
//# sourceMappingURL=studio-
|
|
4
|
+
//# debugId=0D206F434DC20E5564756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-3q6n9qvq.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{Pp}from"./studio-7cg75gtj.js";import{Om,Px,u}from"./studio-y1x65h5r.js";import{g}from"./studio-hw60n5dh.js";import{eo,xr,Jw,h}from"./studio-m4w6sygj.js";import{Ne}from"./studio-v2ek69cb.js";import{T,R}from"./studio-02phtmqn.js";import{vt,nl,ji,Pc,Tp,zr,$L,AL}from"./studio-5abge3wy.js";import{uS,kT,hS}from"./studio-a3evp7f6.js";import{S,cl}from"./studio-ana67wax.js";import{n,Z,_,Di,nd}from"./studio-kt2j51sa.js";import{le}from"./studio-fqs1a22a.js";var $y="Project Styles",Iu="stylebook",Kf="tokens",Y="source",Hg={elements:Iu,variables:Kf,code:Y},c_=["elements","variables","code"],xR=c_.map((e)=>Hg[e]),d_=[{id:"color",prefix:"--color-",title:"Colors"},{id:"font",prefix:"--font-",title:"Fonts"},{id:"size",prefix:"--size-",title:"Sizes & Spacing"},{id:"other",prefix:"--",title:"Other"}];function u_(e){if(e.startsWith("--color"))return"color";if(e.startsWith("--font"))return"font";if(e.startsWith("--size")||e.startsWith("--spacing")||e.startsWith("--radius"))return"size";return"other"}function K(e){let o=u_(e);if(o==="other")return e;let{prefix:t}=d_.find((r)=>r.id===o);return Px(e,t)}function Q(e){if(!e)return[];let o=[];for(let[t,r]of Object.entries(e)){if(!t.startsWith("--"))continue;if(!n(r)&&!Z(r))continue;o.push({group:u_(t),label:K(t),name:t,value:r})}return o}function h_(e){let o=Q(e);return d_.map((t)=>({group:t,tokens:o.filter((r)=>r.group===t.id)}))}function p_(e){if(!e)return[];let{featureQueries:o,sizeBreakpoints:t}=zr(e),r=[],a=[];for(let{name:l,query:d}of o){let k=Tp(d);if(k)r.push({key:`@${l}`,kind:"scheme",label:k==="dark"?"Dark":"Light",name:l,scheme:k});else a.push({key:`@${l}`,kind:"feature",label:`@${l}`,name:l})}let i=t.map(({name:l})=>({key:`@${l}`,kind:"size",label:`@${l}`,name:l}));return[...r,...i,...a]}function J(e,o){return Di(e,o.key)}function Iy(e,o,t){let r=J(e,o)?.[t];return n(r)||Z(r)?r:void 0}function Rk(e,o,t,r){if(r){nd(e,o.key)[t]=r;return}let a=J(e,o);if(!a)return;if(delete a[t],Object.keys(a).length===0)delete e[o.key]}function _R(e,o,t,r=[]){let a=new Set(r.map((i)=>i.name));return o.filter((i)=>!a.has(i.name)&&Iy(e,i,t)===void 0)}var cp={$sections:[{label:"Headings",elements:[{tag:"h1",text:"Code Is Poetry"},{tag:"h2",text:"Code Is Poetry"},{tag:"h3",text:"Code Is Poetry"},{tag:"h4",text:"Code Is Poetry"},{tag:"h5",text:"Code Is Poetry"},{tag:"h6",text:"Code Is Poetry"}]},{label:"Paragraph",elements:[{tag:"p",text:"In a village of La Mancha, the name of which I have no desire to call to mind, there lived not long since one of those gentlemen that keep a lance in the lance-rack, an old buckler, a lean hack, and a greyhound for coursing."}]},{label:"List",elements:[{tag:"ul",children:[{tag:"li",text:"Alice."},{tag:"li",text:"The White Rabbit."},{tag:"li",text:"The Cheshire Cat."},{tag:"li",text:"The Mad Hatter."},{tag:"li",text:"The Queen of Hearts."}]},{tag:"ol",children:[{tag:"li",text:"First item"},{tag:"li",text:"Second item"},{tag:"li",text:"Third item"}]}]},{label:"Quote",elements:[{tag:"blockquote",children:[{tag:"p",text:"In quoting others, we cite ourselves.",style:"font-size:1.25em;font-style:italic"},{tag:"p",text:"— Julio Cortázar"}]}]},{label:"Code",elements:[{tag:"pre",children:[{tag:"code",text:`// A "block" is the abstract term used
|
|
2
|
+
// to describe units of markup that
|
|
3
|
+
// when composed together, form the
|
|
4
|
+
// content or layout of a page.
|
|
5
|
+
registerBlockType( name, settings );`}]}]},{label:"Inline",elements:[{tag:"a",text:"Visit the documentation",attributes:{href:"#"}},{tag:"strong",text:"Bold text emphasis"},{tag:"em",text:"Italic text emphasis"},{tag:"small",text:"Fine print and legal text"},{tag:"mark",text:"Highlighted text"},{tag:"code",text:"const x = 42;"},{tag:"abbr",text:"HTML",attributes:{title:"HyperText Markup Language"}},{tag:"sub",text:"subscript"},{tag:"sup",text:"superscript"}]},{label:"Form",elements:[{tag:"input",attributes:{type:"text",placeholder:"Enter text…"}},{tag:"button",text:"Click Me"},{tag:"select",children:[{tag:"option",text:"Option 1"},{tag:"option",text:"Option 2"},{tag:"option",text:"Option 3"}]},{tag:"textarea",attributes:{placeholder:"Enter longer text…",rows:"3"}}]},{label:"Table",elements:[{tag:"table",children:[{tag:"thead",children:[{tag:"tr",children:[{tag:"th",text:"Name"},{tag:"th",text:"Role"},{tag:"th",text:"Status"}]}]},{tag:"tbody",children:[{tag:"tr",children:[{tag:"td",text:"Alice"},{tag:"td",text:"Developer"},{tag:"td",text:"Active"}]},{tag:"tr",children:[{tag:"td",text:"Bob"},{tag:"td",text:"Designer"},{tag:"td",text:"Away"}]},{tag:"tr",children:[{tag:"td",text:"Carol"},{tag:"td",text:"Manager"},{tag:"td",text:"Active"}]}]}]}]},{label:"Interactive",elements:[{tag:"details",attributes:{open:""},children:[{tag:"summary",text:"Click to expand details"},{tag:"p",text:"Additional detail content revealed when the disclosure widget is toggled open."}]}]},{label:"Media",elements:[{tag:"img",attributes:{alt:"Placeholder image"},style:"width:100%;max-width:400px;height:200px;background:#e0e0e0;display:block;border-radius:4px"},{tag:"video",attributes:{controls:""},style:"width:100%;max-width:400px;height:200px;background:#e0e0e0;display:block;border-radius:4px"},{tag:"audio",attributes:{controls:""},style:"width:100%"}]}],$variables:{color:{label:"Color",prefix:"--color-",placeholder:"#007acc"},font:{label:"Font",prefix:"--font-",placeholder:"system-ui, sans-serif"},size:{label:"Size",prefix:"--size-",placeholder:"16px"},other:{label:"Other",prefix:"--",placeholder:"value"}}};var D={$schema:"https://jxsuite.com/schema/v1",$id:"StudioStylebookChrome",$description:"The bar across the top of the Project Styles canvas: the filter that narrows the specimen catalogue, and the toggle that reduces it to the elements this file has already styled. Both are shell state rather than document state — the adapter owns which — and the two names come in as values, because the surface is called Project Styles and the canvas view it draws is the wire word `stylebook`; nothing a reader sees here may be spelled from that. **The bar IS the kit's toolbar now.** It used to write `role=\"toolbar\"` and its own `aria-label` on a `<div>`, which is a role with none of the behaviour under it: two controls, two tab stops, and no arrow key between them. `jx-action-group` is not the element for it — that one roves `jx-action-button` and this bar's first control is a `jx-textfield` — so `jx-toolbar` is, and the field keeps its own arrows while its caret still has text to walk (ui.md §5.5).",tagName:"jx-toolbar",attributes:{part:"chrome"},$props:{label:{$ref:"#/state/title"}},style:{$description:'What `.sb-chrome` said in `styles/overlays.css`, plus the six inline declarations the template carried beside it, plus `.tb-toggle` — all three go dead with this conversion, and none of them is shared with another surface. Three repairs on the way. The bar is one element rather than a positioned box wrapping a `role="toolbar"` row that declared the same flex layout again. The flex layout is not declared here EITHER any more: `display: flex`, `align-items: center`, the `--jx-space-2` gap, the sans face and the foreground colour are all `jx-toolbar`\'s own, so what is left below is only what a positioned BAND is. And `.tb-toggle` read `var(--spectrum-font-size-50, 11px)`, which the kit spells `--jx-text-sm` at the same value; the rest of its drawing is a `jx-action-button` reaching in through `part="control"`, because what it has to look like is a small bordered chip and every fill and control height the kit draws would otherwise have to be taken back off.',position:"absolute",top:"0",left:"0",right:"0",zIndex:"15",flexShrink:"0",padding:"var(--jx-space-2) var(--jx-space-3)",background:"var(--bg-panel)",borderBottom:"1px solid var(--border)",'& [part="filter"]':{flex:"1",maxWidth:"200px"},'& [part="customized"] > [part="control"]':{$description:"Bordered, unfilled and dimmed until it is on, which is what says it is a filter rather than an action: the catalogue it narrows is the thing the reader is looking at, so the control has to be quieter than its subject.",padding:"3px var(--jx-space-3)",border:"1px solid var(--border)",borderRadius:"var(--radius)",background:"transparent",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)",":hover":{background:"var(--hover-bg)"}},'& [part="customized"][data-selected] > [part="control"]':{$description:"`data-selected` and not `selected`: the kit reflects the pressed state as a data attribute (`jx-action-button.json`), and the property this document binds never reaches the attribute of the same name.",borderColor:"var(--accent)",background:"var(--accent-15)",color:"var(--accent)"}},children:[{tagName:"jx-textfield",attributes:{part:"filter"},$props:{size:"sm",type:"search",clearable:!0,label:{$ref:"#/state/filterLabel"},placeholder:"Filter…",value:{$ref:"#/state/filter"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setFilter"},value:[{$ref:"event#/target/value"}]}]}},{tagName:"jx-action-button",$description:"`onchange` and not `onclick`: a `toggles` button owns its own pressed state and says so with `change` (`jx-action-button.json`), and an `onclick` written here would replace the element's own click handler on the same property — the toggle would stop flipping and stop announcing `aria-pressed`.",attributes:{part:"customized"},$props:{size:"sm",toggles:!0,selected:{$ref:"#/state/customizedOnly"},label:{$ref:"#/state/customizedLabel"},hint:{$ref:"#/state/customizedHint"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/toggleCustomized"},value:[]}]},children:[{tagName:"span",textContent:"${state.customizedLabel}"}]}]};T("stylebook-chrome",D);function W(e,o){let t=document.createElement("div");t.style.display="contents";let r=g({...e,...o}),a=null,i=!1;function l(){i=!0,R("stylebook-chrome",r,t).then((d)=>{i=!1,a=d})}return l(),{host:t,update(d){if(Object.assign(r,d),i||a!==null&&t.contains(a.root))return;a?.dispose(),a=null,t.textContent="",l()}}}function L(e){return!e.startsWith(":")&&!e.startsWith(".")&&!e.startsWith("&")&&!e.startsWith("[")&&!e.startsWith("@")&&!e.startsWith("--")}function j(e){return _(e)&&!Array.isArray(e)}var A="& .element-card-preview";function Ry(e){let o={},t=(r)=>{let a={};for(let[i,l]of Object.entries(r))if(i!=="@--")a[i]=l;return a};for(let[r,a]of Object.entries(e)){if(!j(a)){o[r]=a;continue}if(r==="@--")continue;if(Pp(r)){o[r]=a;continue}if(r.startsWith("@")){let i={};for(let[l,d]of Object.entries(a))if(j(d)&&L(l))i[`${A} ${l}`]=t(d);else i[l]=d;o[r]=i;continue}if(L(r)){o[`${A} ${r}`]=t(a);continue}o[r]=a}return o}function B(e,o){let t=o.split(" "),r=e;for(let a of t){if(!j(r))return null;r=r[a]}return j(r)?r:null}function Dy(e,o){let t=B(e,o);if(t&&Object.keys(t).length>0)return!0;for(let[r,a]of Object.entries(e)){if(!r.startsWith("@")||!j(a))continue;let i=B(a,o);if(i&&Object.keys(i).length>0)return!0}return!1}function te(e){if(!e)return null;return e.split(" ").pop()??null}function Ny(e,o){let t=te(o),r=[],a=(i,l,d)=>{let k=d?`${d} ${i.tag}`:i.tag;r.push({depth:l,entry:i,path:k,selected:i.tag===t,tag:i.tag});let w=i.children?[...new Map(i.children.map((v)=>[v.tag,v])).values()]:[];for(let v of w)a(v,l+1,k)};for(let i of e)a(i,0,"");return r}function H(e){let o=new Map,t=new Map,r=e.filter.toLowerCase(),a=(s,p,f)=>{let c=s.tag===f?f:`${f} ${s.tag}`;o.set(Pc(p),c);let b=s.children??[];for(let[y,N]of b.entries())a(N,[...p,"children",y],f)},i=(s)=>{let p={...s.attributes};if(s.style)p.style=s.style;let f={tagName:s.tag};if(s.text)f.textContent=s.text;if(Object.keys(p).length>0)f.attributes=p;if(s.children)f.children=s.children.map(i);return f},l=(s,p,f,c,b)=>{o.set(Pc(c),s),o.set(Pc([...c,"children",0]),s);let y=[...c,"children",0,"children",0];if(b)a(b,y,s);else o.set(Pc(y),s);if(!t.has(s))t.set(s,c);return{attributes:{class:"element-card"},children:[{attributes:{class:"element-card-preview"},children:[f],tagName:"div"},{attributes:{class:"element-card-label"},tagName:"div",textContent:p}],tagName:"div"}},d=[],k=(s,p)=>({attributes:{class:"sb-section"},children:[{attributes:{class:"sb-label"},tagName:"div",textContent:s},{attributes:{class:"sb-body"},children:p,tagName:"div"}],tagName:"div"}),w=()=>["children",d.length,"children",1];for(let s of e.meta.$sections){let p=s.elements;if(r)p=p.filter((b)=>b.tag.includes(r)||s.label.toLowerCase().includes(r));if(e.customizedOnly)p=p.filter((b)=>Dy(e.effectiveStyle,b.tag));if(p.length===0)continue;let f=w(),c=p.map((b,y)=>l(b.tag,`<${b.tag}>`,i(b),[...f,"children",y],b));d.push(k(s.label,c))}let v=[];{let s=e.components;if(r)s=s.filter((p)=>p.tagName.toLowerCase().includes(r));if(e.customizedOnly)s=s.filter((p)=>Dy(e.effectiveStyle,p.tagName));if(s.length>0){let p=w(),f=s.map((c,b)=>{let y=[...p,"children",b];if(c.source!=="npm"&&c.path?.endsWith(".json")){v.push({$ref:`/${e.projectRoot?`${e.projectRoot}/`:""}${c.path}`.replace(/^\/+/,"/")});let P=e.specimens?.get(c.tagName);if(P?.kind==="props"){let m={$props:P.props,tagName:c.tagName};return l(c.tagName,`<${c.tagName}>`,m,y,null)}if(P?.kind!=="none"){let m={};for(let E of c.props??[])if(E.default!==void 0&&E.default!=="false"&&E.default!=="''")m[E.name]=String(E.default).replaceAll(/^'|'$/g,"");let O={tagName:c.tagName};if(Object.keys(m).length>0)O.attributes=m;return l(c.tagName,`<${c.tagName}>`,O,y,null)}}let M={attributes:{class:"sb-fallback"},tagName:"div",textContent:`<${c.tagName}>`};return l(c.tagName,`<${c.tagName}>`,M,y,null)});d.push(k("Components",f))}}if(d.length===0)d.push({attributes:{class:"sb-empty"},tagName:"div",textContent:e.customizedOnly?"No customized elements":"No matching elements"});let x={};if(v.length>0)x.$elements=v;if(e.effectiveHead&&e.effectiveHead.length>0)x.$head=e.effectiveHead;return x.$media=e.effectiveMedia,x.attributes={class:"sb-root"},x.children=d,x.style=Ry(e.effectiveStyle),x.tagName="div",{doc:x,pathToTag:o,tagToCardPath:t}}var V=new WeakMap;async function oe(e){let{path:o}=e;if(e.source==="npm"||!o?.endsWith(".json"))return{kind:"bare"};let t=await kT(o);if(!t)return{kind:"bare"};let r=uS(t);if(r.size>0&&await hS(t,o,r))return{kind:"props",props:Object.fromEntries(r)};return await hS(t,o,new Map)?{kind:"bare"}:{kind:"none"}}async function q(e,o=oe){let t=V.get(e);if(!t)t=new Map,V.set(e,t);let r=t,a=await Promise.all(e.map(async(i)=>{let l=i.path??i.tagName,d=r.get(l);if(!d)d=o(i).catch(()=>({kind:"bare"})),r.set(l,d);return[i.tagName,await d]}));return new Map(a)}var F=new WeakMap;function ne(e){let o={customizedHint:"Show only the elements this file has already styled",customizedLabel:"Customized",customizedOnly:h.stylebook.customizedOnly,filter:h.stylebook.filter,filterLabel:`Filter the ${$y} catalogue`,title:$y},t=F.get(e);if(t)return t.update(o),t.host;let r=W(o,{setFilter:(a)=>{h.stylebook.filter=a},toggleCustomized:()=>{h.stylebook.customizedOnly=!h.stylebook.customizedOnly}});return F.set(e,r),r.host}function re(e,o){let t=e.filter((r)=>r.name===(o??"base"));return t.length>0?t:e.slice(0,1)}async function SR(e,o){let t=e.wrap,r=vt(e.paneId),a=h.stylebook.filter.toLowerCase(),{customizedOnly:i}=h.stylebook,l=e.renderGeneration,d=Ne,k=q(d),w=eo(r?.doc.document?.$media),{sizeBreakpoints:v,baseWidth:x}=zr(w),s=v.length>0,p=ne(e);t.style.overflow="hidden";let f=[];if(s){f.push({displayName:ji("--"),name:"base",width:x});for(let m of v)f.push({displayName:ji(m.name),name:m.name,width:m.width})}let c;if(!s){let m=w["--"],O=m?`${ji("--")} (${x}px)`:null;c=[o.canvasPanelEntry(m?"base":null,O,!m,m?x:void 0)]}else c=re(f,nl(e.paneId)).map((m)=>o.canvasPanelEntry(m.name,`${m.displayName} (${m.width}px)`,!1,m.width));if(!await o.drawStage(e,{frame:"boards",framePart:"panzoom",frameVars:"--boards-inset:40px",handles:"hidden",hug:!1,innerPart:"boards",lead:"chrome",panels:c.map((m)=>m.item)},c))return;let y=o.stageHost(e,"chrome-host");if(y&&y.firstChild!==p)y.replaceChildren(p);let N=await k;if(e.renderGeneration!==l)return;let M=H({components:d,specimens:N,customizedOnly:Boolean(i),effectiveHead:Jw(r?.doc.document?.$head),effectiveMedia:w,effectiveStyle:xr(r?.doc.document?.style),filter:a,meta:cp,projectRoot:S?.projectRoot??null}),{panels:P}=e;for(let{panel:m}of c)P.push(m),$L(e.renderGeneration,M,m.canvas,m._width);if(s)o.updateActivePanelHeaders(e);o.applyTransform(e),o.observeCenterUntilStable(e)}function _d(e,o,{panCanvas:t=!1}={}){let r={activeSelector:e,rightTab:"style"};if(o!==void 0)r.activeMedia=o;if(cl(u.value,{selection:[],ui:r}),h.stylebook.selection=e,e&&t)AL(e)}var f_=[{id:"page",strip:"page",title:"Page"},{id:"properties",strip:"element",title:"Content"},{id:"style",strip:"element",title:"Style"},{id:"events",strip:"element",title:"Logic"},{id:"assistant",strip:"assistant",title:"Assistant"}],Dk=[{id:"page",title:"Page"},{id:"element",title:"Element"},{id:"assistant",title:"Assistant"}];function m_(){return{saveDocument:()=>{},undo:()=>{},redo:()=>{},openInBrowser:()=>{},buildSite:()=>{},closeDocument:()=>{},duplicateSelection:()=>{},deleteSelection:()=>{},selectParent:()=>{},toggleDock:()=>{},toggleZen:()=>{},openPalette:()=>{},openProject:()=>{},newWindow:()=>{},panelRoster:[],focusPanel:()=>{},focusInspectorTab:()=>{},cycleRegion:()=>{}}}var C=(e)=>e.document.open,I=(e)=>e.selection.count>0&&e.editor.kind==="canvas",z=(e)=>!e.selection.isRoot&&e.selection.paths.every((o)=>Om(o)),G="an element selected on the canvas that has a sibling position: not the document root, a repeater's template or a switch case",U=(e)=>e.map((o)=>`[${o.join(", ")}]`).join(" and ");function Jf(e){return[{id:"file.save",title:"Save",category:"File",level:"document",icon:"floppy-disk",keybinding:"mod+s",menus:["commandbar/primary","statusbar/document","palette"],group:"1_file",undo:"none",when:C,enablement:(t)=>t.document.dirty,requires:"unsaved changes",run:()=>e.saveDocument()},{id:"document.close",title:"Close Document",category:"Document",level:"document",keybinding:"mod+w",menus:["context/tab","palette"],group:"1_file",when:C,requires:"an open document",run:()=>e.closeDocument()},{id:"view.openInBrowser",title:"Open in Browser",category:"View",level:"document",icon:"arrow-square-out",keybinding:"mod+shift+o",menus:["commandbar/primary","statusbar/document","palette"],group:"2_output",when:(t)=>t.project.isSite,enablement:C,requires:"a page to preview",run:()=>e.openInBrowser()},{id:"project.buildSite",title:"Build Site",category:"Project",level:"project",menus:["commandbar/overflow","palette"],group:"2_output",when:(t)=>t.project.isSite,requires:"a site project",run:()=>e.buildSite()},{id:"edit.undo",title:"Undo",category:"Edit",level:"document",icon:"arrow-u-up-left",keybinding:"mod+z",menus:["commandbar/primary","palette"],group:"1_history",order:1,when:C,enablement:(t)=>t.document.canUndo,requires:"a change to undo",run:()=>e.undo()},{id:"edit.redo",title:"Redo",category:"Edit",level:"document",icon:"arrow-u-up-right",keybinding:["mod+shift+z","mod+y"],menus:["commandbar/primary","palette"],group:"1_history",order:2,when:C,enablement:(t)=>t.document.canRedo,requires:"a change to redo",run:()=>e.redo()},{id:"selection.duplicate",title:"Duplicate",category:"Selection",level:"selection",keyScope:"canvas",keybinding:"mod+d",menus:["blockbar","context/element","context/layer","outline/row","palette"],group:"3_structure",undo:"document",when:I,enablement:z,requires:G,aiTool:{name:"duplicate_node",description:"Duplicate elements in the document, inserting each copy after its original, as one undoable step. The copies become the selection.",report:({after:t})=>{let r=t.selection.paths.length;return`Duplicated ${r} element${r===1?"":"s"}; the ${r===1?"copy is":"copies are"} selected at ${U(t.selection.paths)}.`}},run:()=>e.duplicateSelection()},{id:"selection.repeat",title:"Repeat...",category:"Selection",level:"selection",keyScope:"canvas",menus:["context/element","palette"],group:"3_structure",undo:"document",when:I,enablement:(t)=>z(t)&&!t.selection.isRepeater,requires:"an element with a sibling position that is not already a repeater",run:()=>{(le("grnmea6c"),import("./convert-to-repeater-grnmea6c.js")).then(({convertToRepeater:t})=>t())}},{id:"selection.delete",title:"Delete",category:"Selection",level:"selection",keyScope:"canvas",keybinding:["delete","backspace"],menus:["blockbar","context/element","context/layer","outline/row","palette"],group:"9_danger",destructive:!0,undo:"document",when:I,enablement:z,requires:G,aiTool:{name:"delete_node",description:"Delete elements from the document as one undoable step.",report:({before:t,after:r})=>{let a=t.selection.paths.length;return`Deleted ${a} element${a===1?"":"s"} at ${U(t.selection.paths)} in one undo step; the selection is now ${r.selection.count===0?"empty":"elsewhere"}.`}},run:()=>e.deleteSelection()},{id:"selection.selectParent",title:"Select Parent",category:"Selection",level:"selection",keyScope:"canvas",keybinding:["escape","arrowleft"],menus:["palette"],group:"2_navigate",when:I,requires:"an element selection",run:()=>e.selectParent()},{id:"view.toggleNavigator",title:"Toggle Navigator Dock",category:"View",level:"application",keybinding:"mod+b",menus:["commandbar/overflow","palette"],group:"4_docks",run:()=>e.toggleDock("navigator")},{id:"view.toggleInspector",title:"Toggle Inspector Dock",category:"View",level:"application",keybinding:"mod+alt+b",menus:["commandbar/overflow","palette"],group:"4_docks",run:()=>e.toggleDock("inspector")},{id:"view.zen",title:"Zen Mode",category:"View",level:"application",keybinding:"mod+.",menus:["commandbar/overflow","palette"],group:"4_docks",run:()=>e.toggleZen()},{id:"palette.open",title:"Open Command Center",category:"View",level:"application",keybinding:"mod+k",menus:["palette"],group:"5_palette",run:()=>e.openPalette("picker")},{id:"palette.openFiles",title:"Go to File…",category:"File",level:"application",keybinding:"mod+p",menus:["palette"],group:"5_palette",run:()=>e.openPalette("files")},{id:"palette.openCommands",title:"Run Command…",category:"View",level:"application",keybinding:"mod+shift+p",menus:["palette"],group:"5_palette",run:()=>e.openPalette("commands")},{id:"palette.openNodes",title:"Go to Symbol in Document…",category:"Selection",level:"document",menus:["palette"],group:"5_palette",when:C,requires:"an open document",run:()=>e.openPalette("nodes")},{id:"project.open",title:"Open Project…",category:"Project",level:"project",keybinding:"mod+o",menus:["commandbar/overflow","statusbar/project","palette"],group:"1_file",run:()=>e.openProject()},{id:"view.newWindow",title:"New Window",category:"View",level:"application",keybinding:"mod+shift+n",menus:["commandbar/overflow","palette"],group:"1_file",when:(t)=>t.capability.windowControls,requires:"a host that can hold more than one window",run:()=>e.newWindow()},{id:"project.openRecent",title:"Open Recent…",category:"Project",level:"project",menus:["commandbar/overflow","statusbar/project","palette"],group:"1_file",run:()=>e.openPalette("projects")},...ae(e),...ie(e),{id:"view.cycleRegion",title:"Focus Next Region",category:"View",level:"application",keybinding:"f6",menus:["palette"],group:"4_docks",run:()=>e.cycleRegion(1)},{id:"view.cycleRegionBack",title:"Focus Previous Region",category:"View",level:"application",keybinding:"shift+f6",menus:["palette"],group:"4_docks",run:()=>e.cycleRegion(-1)}]}function ae(e){return e.panelRoster.map((o)=>({id:`panel.focus.${o.id}`,title:`Show ${o.title}`,category:"View",level:"application",menus:["palette"],group:"4_docks",requires:"an open project",when:(t)=>t.project.open&&(o.when?.(t)??!0),run:()=>e.focusPanel(o.id)}))}function ie(e){return f_.map((o,t)=>({id:`inspector.focus.${o.id}`,title:`Show ${o.title}`,category:"View",level:"document",keybinding:`mod+shift+${t+1}`,menus:["palette"],group:"4_docks",requires:"an open document",when:(a)=>a.document.open,run:()=>e.focusInspectorTab(o.id)}))}
|
|
6
|
+
export{$y,Iu,Kf,Hg,c_,xR,d_,u_,h_,p_,Iy,Rk,_R,Ry,Dy,Ny,cp,SR,_d,f_,Dk,m_,Jf};
|
|
7
|
+
|
|
8
|
+
//# debugId=B1C5D7A2A5268C2864756E2164756E21
|
|
9
|
+
//# sourceMappingURL=studio-4dsdnan2.js.map
|