@jxsuite/studio 5.5.0 → 5.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/dist/chunks/{2020-g8mwpbkq.js → 2020-zvax9fmb.js} +3 -3
- package/dist/chunks/adapter-6zhjbpmd.js +4 -0
- package/dist/chunks/cf-account-picker-zfycs4k2.js +4 -0
- package/dist/chunks/cf-settings-fpa485q3.js +4 -0
- package/dist/chunks/components-b0vh4sq8.js +4 -0
- package/dist/chunks/content-source-z5t0d0h9.js +4 -0
- package/dist/chunks/convert-to-repeater-x19jr6c7.js +4 -0
- package/dist/chunks/editor-7e23n4a8.js +4 -0
- package/dist/chunks/entry-commands-5cm6aba2.js +4 -0
- package/dist/chunks/extension-sections-y90sa0n4.js +4 -0
- package/dist/chunks/file-ops-hv7gf757.js +4 -0
- package/dist/chunks/files-kb0epdxf.js +4 -0
- package/dist/chunks/format-host-eg1wy2bp.js +4 -0
- package/dist/chunks/fs-events-ky3vxfmh.js +4 -0
- package/dist/chunks/git-panel-yyg3bzp2.js +4 -0
- package/dist/chunks/grid-view-5mqv1cbd.css +1 -0
- package/dist/chunks/grid-view-d9mybhn0.js +51 -0
- package/dist/chunks/iframe-host-9wdf0hes.js +4 -0
- package/dist/chunks/index-2tf0m2ne.js +4 -0
- package/dist/chunks/{index-arg188jq.js → index-vnwy9d44.js} +3 -3
- package/dist/chunks/{javascript-zcdmye2k.js → javascript-f0nrbdjb.js} +2 -2
- package/dist/chunks/{jsonMode-6x5e1nbf.js → jsonMode-nfa90dtf.js} +5 -5
- package/dist/chunks/jx-validate-7w11db9v.js +4 -0
- package/dist/chunks/layers-7zasrpse.js +4 -0
- package/dist/chunks/layers-panel-9nzc4fdq.js +4 -0
- package/dist/chunks/lit-html-5qr7nbng.js +4 -0
- package/dist/chunks/media-picker-maevn9d4.js +4 -0
- package/dist/chunks/menu-wq6q0v3y.js +4 -0
- package/dist/chunks/{monaco-binding-4az2kh5p.js → monaco-binding-antn79jf.js} +3 -3
- package/dist/chunks/monaco-buffer-9ry2rn5x.js +4 -0
- package/dist/chunks/{monaco-setup-d7mwkcx3.js → monaco-setup-k8s40vwg.js} +3 -3
- package/dist/chunks/notify-g91gjd6w.js +4 -0
- package/dist/chunks/platform-jdwjp2vt.js +4 -0
- package/dist/chunks/publish-panel-8yym447p.js +4 -0
- package/dist/chunks/quick-search-9bzm9kh3.js +4 -0
- package/dist/chunks/references-znssfqvq.js +4 -0
- package/dist/chunks/right-panel-czbzktm8.js +4 -0
- package/dist/chunks/section-registry-0rtq73qs.js +4 -0
- package/dist/chunks/studio-011em5cf.js +5 -0
- package/dist/chunks/studio-02y9cb4h.js +6 -0
- package/dist/chunks/{studio-7gqyhjns.js → studio-09n3fyy0.js} +4 -4
- package/dist/chunks/{studio-xcng8nx7.js → studio-0c3fpdqj.js} +5 -5
- package/dist/chunks/studio-0mm38y62.js +5 -0
- package/dist/chunks/studio-0nm2skex.js +4 -0
- package/dist/chunks/{studio-73czgk6a.js → studio-153mwkyq.js} +4 -4
- package/dist/chunks/{studio-f8jyp45j.js → studio-1pxvgx1t.js} +4 -4
- package/dist/chunks/studio-27tc8q0h.js +5 -0
- package/dist/chunks/studio-28pz4s1k.js +5 -0
- package/dist/chunks/{studio-x5esgzct.js → studio-36s6qjgq.js} +4 -4
- package/dist/chunks/studio-4yztve2t.js +5 -0
- package/dist/chunks/{studio-x9sagq2d.js → studio-5fc0728f.js} +7 -7
- package/dist/chunks/{studio-7jazdy6y.js → studio-654fxcr0.js} +4 -4
- package/dist/chunks/studio-6exg5z4x.js +4 -0
- package/dist/chunks/studio-6k1eswp9.js +5 -0
- package/dist/chunks/{studio-5wfrgee9.js → studio-6zyt56ek.js} +4 -4
- package/dist/chunks/studio-7djymzt2.js +5 -0
- package/dist/chunks/{studio-b4epb26c.js → studio-7w04zw8h.js} +7 -7
- package/dist/chunks/studio-805fwp9k.js +5 -0
- package/dist/chunks/{studio-k1eaqyzm.js → studio-81twpmzj.js} +4 -4
- package/dist/chunks/studio-891t1tv9.js +5 -0
- package/dist/chunks/{studio-5n1km79v.js → studio-9n2j9nqk.js} +4 -4
- package/dist/chunks/{studio-he2fhrgp.js → studio-9tkaykt5.js} +4 -4
- package/dist/chunks/studio-ant1zbp3.js +5 -0
- package/dist/chunks/studio-b29h7g7s.js +5 -0
- package/dist/chunks/studio-b5rxwkj2.js +5 -0
- package/dist/chunks/studio-d007j0z3.js +7 -0
- package/dist/chunks/studio-dknr8m7b.js +14 -0
- package/dist/chunks/{studio-eq27rrr0.js → studio-dmymvk2j.js} +3 -3
- package/dist/chunks/studio-dtmdjmqb.js +5 -0
- package/dist/chunks/studio-eb5sty2k.js +5 -0
- package/dist/chunks/{studio-hc9q4j24.js → studio-ebt49j3c.js} +5 -5
- package/dist/chunks/studio-eegyf5vg.js +5 -0
- package/dist/chunks/studio-frv7vjhw.js +5 -0
- package/dist/chunks/studio-ft8pfpp0.js +5 -0
- package/dist/chunks/{studio-mhhc9btt.js → studio-gj4j9e7k.js} +4 -4
- package/dist/chunks/{studio-hf4qdjc8.js → studio-gxna6yta.js} +4 -4
- package/dist/chunks/studio-je15p5v8.js +6 -0
- package/dist/chunks/{studio-21enxdr8.js → studio-jsr14n1s.js} +4 -4
- package/dist/chunks/studio-k9pwvmz8.js +5 -0
- package/dist/chunks/{studio-p1eggxcf.js → studio-ks0ecgjx.js} +3 -3
- package/dist/chunks/studio-mb8jhtr4.js +64 -0
- package/dist/chunks/studio-mf41717j.js +5 -0
- package/dist/chunks/{studio-625ezz59.js → studio-mm8x32gg.js} +4 -4
- package/dist/chunks/{studio-pkkw32j0.js → studio-n2e133d6.js} +4 -4
- package/dist/chunks/{studio-c4pnt1c6.js → studio-njmg0e73.js} +5 -5
- package/dist/chunks/studio-nvykrgbj.js +4 -0
- package/dist/chunks/studio-nw4q9sdn.js +5 -0
- package/dist/chunks/studio-p6avneaq.js +5 -0
- package/dist/chunks/studio-pvj970st.js +5 -0
- package/dist/chunks/studio-r7yeeqc4.js +5 -0
- package/dist/chunks/studio-s85vah66.js +6 -0
- package/dist/chunks/studio-sadckcpp.js +7 -0
- package/dist/chunks/studio-sgzss898.js +9 -0
- package/dist/chunks/{studio-7by9a93k.js → studio-t0v47dpc.js} +4 -4
- package/dist/chunks/{studio-jnb285we.js → studio-tj28pxa1.js} +4 -4
- package/dist/chunks/{studio-6j2jn55a.js → studio-tzs6njnb.js} +8 -8
- package/dist/chunks/studio-vz7b43ng.js +5 -0
- package/dist/chunks/studio-w8w9frjy.js +16 -0
- package/dist/chunks/{studio-xc8ebsts.js → studio-wr0pq67n.js} +4 -4
- package/dist/chunks/{studio-8r4y2x0z.js → studio-y164brht.js} +4 -4
- package/dist/chunks/studio-y17505ge.js +928 -0
- package/dist/chunks/studio-ymsjnvp9.js +5 -0
- package/dist/chunks/studio-z1vdxq0e.js +5 -0
- package/dist/chunks/studio-z47mm077.js +10 -0
- package/dist/chunks/studio-zkkdbbvd.js +9 -0
- package/dist/chunks/{studio-awqghqxv.js → studio-zkvyd3ev.js} +4 -4
- package/dist/chunks/{tsMode-rtwt7w1a.js → tsMode-eq26t9gs.js} +5 -5
- package/dist/chunks/workspace-emt8454d.js +4 -0
- package/dist/chunks/ws-client-3gxqp06s.js +4 -0
- package/dist/iframe-entry.js +14 -14
- package/dist/manifest.json +62 -59
- package/dist/studio.css +1 -1
- package/dist/studio.js +115 -117
- package/package.json +5 -5
- package/src/account/action-flow.ts +294 -0
- package/src/account/action-required.ts +68 -0
- package/src/account-status.ts +29 -1
- package/src/browse/library-model.ts +3 -1
- package/src/browse/library-preview.ts +6 -2
- package/src/canvas/asset-refs.ts +3 -1
- package/src/canvas/asset-resolve.ts +79 -1
- package/src/canvas/iframe-entry.ts +38 -1
- package/src/canvas/iframe-host.ts +85 -0
- package/src/canvas/iframe-protocol.ts +13 -0
- package/src/files/asset-versions.ts +294 -0
- package/src/files/files.ts +61 -9
- package/src/files/fs-events.ts +279 -28
- package/src/files/media-meta.ts +2 -1
- package/src/files/media-paths.ts +5 -2
- package/src/files/media-upload.ts +5 -1
- package/src/new-project/add-repo-modal.ts +12 -1
- package/src/new-project/new-project-modal.ts +12 -1
- package/src/panels/git-panel.ts +25 -2
- package/src/platform-errors.ts +61 -1
- package/src/platforms/cloud.ts +389 -50
- package/src/platforms/devserver.ts +17 -1
- package/src/publish/pages-service.ts +17 -7
- package/src/services/ai-models.ts +30 -6
- package/src/services/ai-system-prompt.ts +81 -51
- package/src/settings/preferences-accounts.ts +42 -3
- package/src/settings/preferences-dialog.ts +8 -1
- package/src/studio.ts +18 -1
- package/src/surfaces/dialog.ts +5 -0
- package/src/surfaces/welcome.json +86 -1
- package/src/surfaces/welcome.ts +61 -2
- package/src/types.ts +84 -2
- package/src/ui/ai-managed-connect.ts +41 -4
- package/src/ui/media-picker.ts +2 -1
- package/dist/chunks/adapter-bsbs78x9.js +0 -4
- package/dist/chunks/cf-account-picker-gnm7xeqb.js +0 -4
- package/dist/chunks/cf-settings-9y6jyscp.js +0 -4
- package/dist/chunks/components-s51h3b7c.js +0 -4
- package/dist/chunks/content-source-ty3be0qg.js +0 -4
- package/dist/chunks/convert-to-repeater-c3e7q61z.js +0 -4
- package/dist/chunks/editor-t002b41m.js +0 -4
- package/dist/chunks/entry-commands-sb72e9gy.js +0 -4
- package/dist/chunks/extension-sections-ktn2ntnj.js +0 -4
- package/dist/chunks/file-ops-78zeytkm.js +0 -4
- package/dist/chunks/files-gatzrz8v.js +0 -4
- package/dist/chunks/format-host-r59b1651.js +0 -4
- package/dist/chunks/fs-events-f8h91ndt.js +0 -4
- package/dist/chunks/git-panel-y12zf7nj.js +0 -4
- package/dist/chunks/grid-view-rfd8b2pg.js +0 -51
- package/dist/chunks/grid-view-tafenfm2.css +0 -1
- package/dist/chunks/iframe-host-vsrsj20g.js +0 -4
- package/dist/chunks/index-5aghyrfh.js +0 -4
- package/dist/chunks/jx-validate-653krkrf.js +0 -4
- package/dist/chunks/layers-32p8gtae.js +0 -4
- package/dist/chunks/layers-panel-rs58m105.js +0 -4
- package/dist/chunks/lit-html-54bmkwz3.js +0 -4
- package/dist/chunks/media-picker-5bb04wct.js +0 -4
- package/dist/chunks/menu-cbha7w2e.js +0 -4
- package/dist/chunks/monaco-buffer-9vbbyfr1.js +0 -4
- package/dist/chunks/notify-dc1nz5ar.js +0 -4
- package/dist/chunks/platform-2m49s1zf.js +0 -4
- package/dist/chunks/publish-panel-nx3ycmma.js +0 -4
- package/dist/chunks/quick-search-yzrzh9x3.js +0 -4
- package/dist/chunks/references-vx7mbj9f.js +0 -4
- package/dist/chunks/right-panel-7jzpbxja.js +0 -4
- package/dist/chunks/section-registry-gjryse41.js +0 -4
- package/dist/chunks/studio-3znfhcxg.js +0 -5
- package/dist/chunks/studio-58qam27v.js +0 -4
- package/dist/chunks/studio-6j59fwaw.js +0 -5
- package/dist/chunks/studio-7z69g1gx.js +0 -5
- package/dist/chunks/studio-93j3v6zx.js +0 -5
- package/dist/chunks/studio-9gf6v8zy.js +0 -5
- package/dist/chunks/studio-9rhmettf.js +0 -4
- package/dist/chunks/studio-ac5aq677.js +0 -10
- package/dist/chunks/studio-as65vbns.js +0 -5
- package/dist/chunks/studio-bkv0sga4.js +0 -6
- package/dist/chunks/studio-bttmqef4.js +0 -5
- package/dist/chunks/studio-c3y9d41k.js +0 -5
- package/dist/chunks/studio-ccegp7gz.js +0 -9
- package/dist/chunks/studio-chxabn98.js +0 -6
- package/dist/chunks/studio-cktcdsxz.js +0 -16
- package/dist/chunks/studio-cnspfke5.js +0 -5
- package/dist/chunks/studio-de3p1ktm.js +0 -5
- package/dist/chunks/studio-fsbcn530.js +0 -928
- package/dist/chunks/studio-gftga7a3.js +0 -64
- package/dist/chunks/studio-hf1rpcq0.js +0 -4
- package/dist/chunks/studio-hz02hq70.js +0 -5
- package/dist/chunks/studio-jsv3s3s1.js +0 -5
- package/dist/chunks/studio-ks7cksh0.js +0 -5
- package/dist/chunks/studio-nptx0dbs.js +0 -5
- package/dist/chunks/studio-pg0z7k98.js +0 -5
- package/dist/chunks/studio-pve0b2f2.js +0 -5
- package/dist/chunks/studio-q7zmjv3b.js +0 -6
- package/dist/chunks/studio-rpmvw7kj.js +0 -5
- package/dist/chunks/studio-rwhss52s.js +0 -5
- package/dist/chunks/studio-sbg3g3h0.js +0 -5
- package/dist/chunks/studio-sq1bn60g.js +0 -14
- package/dist/chunks/studio-vwz7rma2.js +0 -5
- package/dist/chunks/studio-wa55e8gf.js +0 -5
- package/dist/chunks/studio-x0mzdha2.js +0 -5
- package/dist/chunks/studio-xrgpakvc.js +0 -9
- package/dist/chunks/studio-xt3djk1w.js +0 -7
- package/dist/chunks/studio-yh3nggx1.js +0 -7
- package/dist/chunks/studio-zmecp6hq.js +0 -5
- package/dist/chunks/workspace-g6dvaete.js +0 -4
- package/dist/chunks/ws-client-shf41j5p.js +0 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{f}from"./studio-jsv3s3s1.js";import{qt,js,Wa}from"./studio-de3p1ktm.js";import{ne}from"./studio-sq1bn60g.js";import{T,R,rn,kc,ps}from"./studio-zmecp6hq.js";import{v}from"./studio-9rhmettf.js";import{u}from"./studio-ks7cksh0.js";import{Ug,Uk,Df,Io}from"./studio-xt3djk1w.js";import{Ed,Oo,D}from"./studio-73czgk6a.js";var N={$schema:"https://jxsuite.com/schema/v1",$id:"StudioPalette",$description:'The command palette: a `role="combobox"` field over the kit\'s `jx-listbox`, whose rows are `jx-option`s the host projects. `rows` is the ranked set for the current mode and query; `activeId` is the highlight, and it is ONE string — the id the field points `aria-activedescendant` at and the id the listbox is handed as `active`, so a key moves the caret without the rows reconciling and no row re-decides its own flag. The FIELD is not a `jx-combobox`: this one carries a mode chip inside its box, its Enter runs a command rather than committing a value, and its panel is a centred scrim rather than a popover under a control. Every gesture calls back into panels/quick-search.ts, which owns the modes, the ranking, the recents and what a row does.',tagName:"div",attributes:{part:"palette"},style:{display:"contents",'& [part="overlay"]':{position:"fixed",inset:"0",zIndex:"1000",display:"flex",justifyContent:"center",paddingTop:"60px",background:"rgba(0, 0, 0, 0.4)"},'& [part="overlay"][hidden]':{display:"none"},'& [part="panel"]':{width:"560px",maxWidth:"calc(100vw - 32px)",maxHeight:"420px",display:"flex",flexDirection:"column",alignSelf:"flex-start",background:"var(--jx-bg-overlay)",border:"1px solid var(--jx-border)",borderRadius:"var(--jx-radius-md)",boxShadow:"var(--jx-shadow-dialog)",color:"var(--jx-fg)",fontFamily:"var(--jx-font-sans)",overflow:"hidden"},'& [part="input-row"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-3)",paddingLeft:"var(--jx-space-4)",background:"var(--jx-bg-input)",borderBottom:"1px solid var(--jx-border)"},'& [part="chip-slot"], & [part="empty-slot"], & [part="section-slot"], & [part="trailing-slot"]':{display:"contents"},'& [part="chip"]':{display:"inline-flex",alignItems:"center",gap:"var(--jx-space-1)",flexShrink:"0",padding:"2px var(--jx-space-1) 2px var(--jx-space-3)",borderRadius:"var(--jx-radius-sm)",background:"var(--jx-accent-solid)",color:"var(--jx-accent-fg)",fontSize:"var(--jx-text-sm)"},'& [part="chip-remove"] > [part="control"]':{color:"inherit",opacity:"0.8",":hover":{opacity:"1",background:"transparent"}},'& [part="input"]':{flex:"1",minWidth:"0",padding:"var(--jx-space-4) var(--jx-space-5) var(--jx-space-4) var(--jx-space-1)",font:"inherit",fontSize:"var(--jx-text-lg)",border:"none",outline:"none",background:"none",color:"var(--jx-fg)","::placeholder":{color:"var(--jx-fg-muted)"},":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"-2px"}},'& [part="results"]':{$description:"The list is the kit's: a `jx-listbox` of `jx-option`, so the highlight is ONE id — `active`, the same string the field points `aria-activedescendant` at — and the listbox's sidecar is the single writer of every row's `selected`. What this surface still decides is density. The kit's row pads itself by `--jx-space-3`; the other half of the 16px optical margin the panel has always had sits here, on the list, so the heading, the rows and the empty sentence line up on one edge instead of each naming it.",flex:"1",paddingInline:"var(--jx-space-3)"},'& [part="option"] [part="label"]':{fontWeight:"500"},'& [part="option"] [part="description"]':{$description:"A `jx-select` row's note is a category at the END of the row, so the kit pushes it there with an auto margin. A palette row's note is a CONTINUATION of its name — the file's directory, the command's category — and the far edge belongs to the chord, which is how this surface teaches the keyboard it replaced. So the auto margin moves to the end slot.",marginInlineStart:"0"},'& [part="option"] [part="end"]':{marginInlineStart:"auto"},'& [part="option"][aria-disabled="true"]':{$description:"An unavailable command is greyed with its `requires` sentence as the subtitle, and that sentence is the reason the row is on screen at all. The kit fades the whole row to 0.45, which would take a muted grey below any readable contrast — so the row keeps its ink and only the name and the glyph dim.",opacity:"1"},'& [part="option"][aria-disabled="true"] [part="label"], & [part="option"][aria-disabled="true"] [part="icon"]':{opacity:"0.45"},'& [part="chord"]':{flexShrink:"0",fontFamily:"inherit",fontSize:"var(--jx-text-xs)",color:"var(--jx-fg-muted)",border:"1px solid var(--jx-border)",borderRadius:"var(--jx-radius-sm)",padding:"0 5px"},'& [part="option"][aria-selected="true"] [part="chord"]':{color:"inherit",borderColor:"currentColor"},'& [part="badge"]':{fontSize:"var(--jx-text-xs)",padding:"1px var(--jx-space-2)",borderRadius:"var(--jx-radius-sm)",background:"var(--jx-border)",color:"var(--jx-fg-dim)"},'& [part="hint"]':{padding:"var(--jx-space-2) var(--jx-space-5)",borderTop:"1px solid var(--jx-border)",color:"var(--jx-fg-muted)",fontSize:"var(--jx-text-xs)"},'& [part="hint"] kbd':{fontFamily:"inherit",color:"var(--jx-fg-dim)"}},children:[{tagName:"div",attributes:{part:"overlay",hidden:"${state.open ? null : ''}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/close"},value:[]}]},children:[{tagName:"div",attributes:{part:"panel"},onclick:{$prototype:"Function",body:[{stopPropagation:!0}]},children:[{tagName:"div",attributes:{part:"input-row"},children:[{tagName:"span",attributes:{part:"chip-slot",role:"none"},$switch:{$ref:"#/state/hasChip"},cases:{true:{tagName:"span",attributes:{part:"chip"},children:[{tagName:"span",attributes:{part:"chip-label"},textContent:"${state.chipLabel}"},{tagName:"jx-action-button",$props:{label:"Clear mode",hint:"Clear mode (Backspace)",icon:"x",size:"sm"},attributes:{part:"chip-remove"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/clearMode"},value:[]}]}}]}}},{tagName:"input",attributes:{part:"input",type:"text",role:"combobox","aria-controls":"quick-search-listbox","aria-expanded":"${state.expanded ? 'true' : 'false'}","aria-activedescendant":"${state.activeId || null}","aria-autocomplete":"list","aria-label":"${state.placeholder}",placeholder:"${state.placeholder}"},value:{$ref:"#/state/query"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/input"},value:[{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{ArrowDown:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/move"},value:[1]}],ArrowUp:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/move"},value:[-1]}],Enter:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/activate"},value:[]}],Escape:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/close"},value:[]}],Backspace:[{$switch:{$ref:"#/state/canClearMode"},cases:{true:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/clearMode"},value:[]}]}}]}}]}}]},{tagName:"jx-listbox",attributes:{part:"results",id:"quick-search-listbox"},$props:{label:"Results",active:"${state.activeId}"},onselect:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/activateRow"},value:[{$ref:"event#/detail"}]}],description:"One handler for every row, because a row's `select` bubbles. The detail is the row's `value`, which is the index it occupies in `rows` — the same number a hover names, and the number the id is built from."},children:[{tagName:"div",attributes:{part:"empty-slot",role:"none"},$switch:{$ref:"#/state/isEmpty"},cases:{true:{tagName:"div",attributes:{part:"empty"},textContent:"${state.emptyHint}"}}},{tagName:"div",attributes:{part:"section-slot",role:"none"},$switch:{$ref:"#/state/showSection"},cases:{true:{tagName:"div",attributes:{part:"group-heading"},textContent:"${state.sectionLabel}"}}},{$prototype:"Array",items:{$ref:"#/state/rows"},key:{$ref:"$map/item/key"},map:{tagName:"jx-option",attributes:{part:"option",id:"quick-search-option-${$map.index}","data-kind":"${$map.item.kind}"},$props:{value:"${$map.index}",label:{$ref:"$map/item/name"},description:{$ref:"$map/item/detail"},disabled:{$ref:"$map/item/disabled"}},onmouseenter:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/hover"},value:[{$ref:"$map/index"}]}]},children:[{tagName:"jx-icon",attributes:{slot:"icon"},$props:{name:{$ref:"$map/item/icon"}}},{tagName:"span",attributes:{slot:"end",part:"trailing-slot"},$switch:{$ref:"$map/item/trailing"},cases:{chord:{tagName:"kbd",attributes:{part:"chord"},textContent:"${$map.item.chord}"},recent:{tagName:"span",attributes:{part:"badge"},textContent:"recent"}}}]}}]},{tagName:"div",attributes:{part:"hint"},children:[{tagName:"kbd",textContent:"↑↓"}," move · ",{tagName:"kbd",textContent:"↵"}," run · ",{tagName:"kbd",textContent:"?"}," modes · ",{tagName:"kbd",textContent:">"}," commands · ",{tagName:"kbd",textContent:"@"}," elements"]}]}]}]};var P=[{mode:"files",prefix:"",chip:"Files",placeholder:"Go to a file…",description:"Open a file by any part of its path — pgblog finds pages/blog/index.md."},{mode:"commands",prefix:">",chip:"Commands",placeholder:"Run a command…",description:"Run anything Studio can do, with its keyboard shortcut printed beside it."},{mode:"nodes",prefix:"@",chip:"Symbols",placeholder:"Go to an element in this document…",description:"Select an element in the open document by its Outline name."},{mode:"projects",prefix:"",chip:"Recent Projects",placeholder:"Open a recent project…",description:"Reopen a project you have had open before."},{mode:"picker",prefix:"?",chip:"Modes",placeholder:"Type ? for modes, > for commands, @ for elements…",description:"List these modes."}],X=new Map(P.map((e)=>[e.mode,e])),E=P.filter((e)=>e.prefix!=="");function F(e){return X.get(e)??P[0]}function O(e,t,n){let r=E.find((i)=>t.startsWith(i.prefix));if(r)return O(r.mode,t.slice(1),n);let a=e;if(a==="picker"&&t.trim()!=="")a="files";if(a==="files"&&!n)a="projects";return{mode:a,query:t}}var Y=new Set(["/","-","_","."," "]);function V(e,t){if(t==="")return 0;let n=e.toLowerCase(),r=t.toLowerCase(),a=n.lastIndexOf("/")+1,i=0,o=0,x=-2;for(let G of r){let p=n.indexOf(G,o);if(p===-1)return null;if(p===x+1)i+=8;if(p===0||Y.has(n[p-1]??""))i+=6;if(p>=a)i+=4;x=p,o=p+1}return i-x*0.01-n.length*0.001}function k(e,t,n){let r=[];for(let[a,i]of e.entries()){let o=V(n(i),t);if(o!==null)r.push({index:a,item:i,score:o})}return r.toSorted((a,i)=>i.score-a.score||a.index-i.index).map((a)=>a.item)}function q(e){let t=e.args,n=t?.properties;if(!t||!n)return{kind:"none"};let r=Object.keys(n);if(r.length!==1)return{kind:"unsupported"};let a=r[0],i=n[a];if(i.enum)return{kind:"choice",name:a,choices:i.enum.map((o)=>({label:String(o),value:o}))};if(i.type==="boolean")return{kind:"choice",name:a,choices:[{label:"on",value:!0},{label:"off",value:!1}]};return{kind:"unsupported"}}function S(e){return`quick-search-option-${e}`}var _="jx-studio-recent-commands",Z=6;function L(){try{let e=JSON.parse(localStorage.getItem(_)||"[]");return Array.isArray(e)?e.filter((t)=>typeof t==="string"):[]}catch{return[]}}function ee(e){let t=[e,...L().filter((n)=>n!==e)].slice(0,Z);try{localStorage.setItem(_,JSON.stringify(t))}catch{}}var z=null,h=!1,g="picker",d="",c=0,b=null,w=!1,s=null;function H(){return ps("popover","quick-search")}function x_(e){z=e??null}function kf(e="files"){h=!0,g=e,d="",c=0,s=null,b=null,l(),ve(),C()}function y(){h=!1,s=null,l()}function J(){return D?D.projectRoot??null:null}function B(){return D!=null}function Q(){return O(g,d,B())}function W(e){let t=e.split("/");return t.pop(),t.length>0?t.join("/"):""}function te(e){if(e.startsWith("/home/"))return`~/${e.split("/").slice(3).join("/")}`;return e}async function C(){if(!h||b!==null||w||!B())return;w=!0,l();try{await qt(),b=(await f().searchFiles("",Wa())).map((t)=>({kind:"file",path:t.path,name:t.name??t.path.split("/").pop()??"",detail:W(t.path),recent:!1}))}catch{b=[]}w=!1,l()}function oe(e){if(e.trim()==="")return Uk(J()??void 0).map((t)=>({kind:"file",path:t.path,name:t.name,detail:W(t.path),recent:!0}));return k(b??[],e.trim(),(t)=>t.path)}function re(e){let t=Ug().map((n)=>({kind:"project",root:n.root,name:n.name,detail:te(n.root)}));return k(t,e.trim(),(n)=>`${n.name}/${n.root}`)}function ae(e,t){let n=L(),r=[];for(let o of e.visible()){if(q(o).kind==="unsupported")continue;if(!(o.menus??["palette"]).includes("palette"))continue;r.push({kind:"command",id:o.id,name:`${o.category}: ${o.title}`,detail:e.disabledReason(o.id)??"",chord:e.keymap.formatBinding(o.id)??"",enabled:e.isEnabled(o.id),recent:n.includes(o.id)})}let a=k(r,t.trim(),(o)=>o.name);if(t.trim()!=="")return a;let i=n.map((o)=>a.find((x)=>x.id===o)).filter((o)=>o!==void 0);return[...i,...a.filter((o)=>!i.includes(o))]}function ie(e){let t=u.value;if(!t)return[];let n=Ed(t.doc.document).map((r)=>({kind:"node",path:r.path,name:r.nodeType==="text"?String(r.node).slice(0,60):Oo(r.node),detail:r.nodeType}));return k(n,e.trim(),(r)=>r.name)}function se(){return P.filter((e)=>e.mode!=="picker").map((e)=>({kind:"mode",mode:e.mode,name:e.chip,detail:e.description,chord:e.prefix}))}function ce(e){let t=s,n=t.choices.map((r)=>({kind:"arg",commandId:t.command.id,argName:t.name,value:r.value,name:r.label,detail:`${t.command.title} → ${t.name}`}));return k(n,e.trim(),(r)=>r.name)}function de(){let{mode:e,query:t}=Q();if(s)return{rows:ce(t),showingRecent:!1};switch(e){case"commands":{let n=ne();return{rows:n?ae(n,t):[],showingRecent:t.trim()===""}}case"nodes":return{rows:ie(t),showingRecent:!1};case"projects":return{rows:re(t),showingRecent:t.trim()===""};case"picker":return{rows:se(),showingRecent:!1};default:return{rows:oe(t),showingRecent:t.trim()===""}}}function le(e){let t=E.find((n)=>e.startsWith(n.prefix));if(t)g=t.mode,d=e.slice(1);else d=e;if(c=0,e!==d)j().query=e;l(),C()}function pe(){g="picker",s=null,c=0,l()}function me(e){g=e,d="",c=0,l(),C()}function U(e,t){let n=ne();if(!n)return;ee(e.id),y(),rn(n,e.id,t,"Palette")}function M(e){switch(e.kind){case"project":{y(),z?.openRecentProject(e.root);return}case"file":{y(),Df({name:e.name,path:e.path,root:J()??""}),Io(e.path);return}case"mode":{me(e.mode);return}case"node":{y(),kc("selection.set",{path:e.path},"Palette");return}case"arg":{U(s.command,{[e.argName]:e.value});return}default:ue(e)}}function ue(e){let t=ne(),n=t?.get(e.id);if(!t||!n||!e.enabled)return;let r=q(n);if(r.kind==="choice"){s={choices:r.choices,command:n,name:r.name},d="",c=0,l();return}U(n)}function he(e){let t=e.split(".").pop()?.toLowerCase();if(t==="json")return"file-code";if(t&&js(t))return"file-text";return"file"}function fe(e){switch(e.kind){case"project":return"folder-open";case"file":return he(e.name);case"command":return"play";case"node":return"stack";default:return"caret-right"}}function ge(e,t){if((e.kind==="command"||e.kind==="mode")&&e.chord)return"chord";if(e.kind==="command"&&e.recent)return"recent";return t?"recent":"none"}function xe(e){switch(e.kind){case"project":return`project:${e.root}`;case"file":return`file:${e.path}`;case"command":return`command:${e.id}`;case"node":return`node:${e.path.join("/")}`;case"mode":return`mode:${e.mode}`;default:return`arg:${e.value}`}}function be(e,t){if(w)return"Reading the project's files…";if(t.trim()!=="")return"No results";switch(e){case"projects":return"No recent projects — open one to get started";case"nodes":return"Open a document to jump to its elements";case"commands":return"Type to find any command in Studio";default:return F(e).placeholder}}T("palette",N);var I=null,A=null,m=[];function j(){return I??=v({activate:()=>{let e=m[c];if(e)M(e)},activateRow:(e)=>{let t=m[Number(e)];if(t)M(t)},activeId:"",canClearMode:!1,chipLabel:"",clearMode:pe,close:y,emptyHint:"",expanded:!1,hasChip:!1,hover:(e)=>{c=e,j().activeId=S(e)},input:le,isEmpty:!0,move:(e)=>{if(m.length===0)return;c=Math.max(0,Math.min(c+e,m.length-1)),j().activeId=S(c)},open:!1,placeholder:"",query:"",rows:[],sectionLabel:"",showSection:!1}),I}function ve(){setTimeout(()=>{if(h)H().querySelector('[part="input"]')?.focus()},0)}function l(){let e=j();if(!A)A=R("palette",e,H());if(e.open=h,!h){m=[];return}let{mode:t,query:n}=Q(),{rows:r,showingRecent:a}=de(),i=F(t);m=r,e.placeholder=s?`Choose a ${s.name}…`:i.placeholder,e.hasChip=s!==null||t!=="picker",e.chipLabel=s?s.command.title:i.chip,e.query=d,e.canClearMode=d===""&&(s!==null||g!=="picker"),e.rows=r.map((o)=>({chord:(o.kind==="command"||o.kind==="mode")&&o.chord?o.chord:"",detail:o.detail,disabled:o.kind==="command"&&!o.enabled,icon:fe(o),key:xe(o),kind:o.kind,name:o.name,trailing:ge(o,a)})),e.expanded=r.length>0,e.activeId=r.length>0?S(c):"",e.isEmpty=r.length===0,e.emptyHint=be(t,n),e.showSection=a&&r.length>0,e.sectionLabel=s?`${s.command.title} — ${s.name}`:t==="projects"?"Recent projects":t==="commands"?"Recently used":"Recently opened"}
|
|
2
|
-
export{
|
|
1
|
+
import{p}from"./studio-6k1eswp9.js";import{qt,Vs,Ka}from"./studio-ft8pfpp0.js";import{ne}from"./studio-dknr8m7b.js";import{T,R,rn,Rc,vs}from"./studio-z1vdxq0e.js";import{v}from"./studio-0nm2skex.js";import{u}from"./studio-27tc8q0h.js";import{eb,uE,Hf,Io}from"./studio-d007j0z3.js";import{Ad,Mo,D}from"./studio-153mwkyq.js";var N={$schema:"https://jxsuite.com/schema/v1",$id:"StudioPalette",$description:'The command palette: a `role="combobox"` field over the kit\'s `jx-listbox`, whose rows are `jx-option`s the host projects. `rows` is the ranked set for the current mode and query; `activeId` is the highlight, and it is ONE string — the id the field points `aria-activedescendant` at and the id the listbox is handed as `active`, so a key moves the caret without the rows reconciling and no row re-decides its own flag. The FIELD is not a `jx-combobox`: this one carries a mode chip inside its box, its Enter runs a command rather than committing a value, and its panel is a centred scrim rather than a popover under a control. Every gesture calls back into panels/quick-search.ts, which owns the modes, the ranking, the recents and what a row does.',tagName:"div",attributes:{part:"palette"},style:{display:"contents",'& [part="overlay"]':{position:"fixed",inset:"0",zIndex:"1000",display:"flex",justifyContent:"center",paddingTop:"60px",background:"rgba(0, 0, 0, 0.4)"},'& [part="overlay"][hidden]':{display:"none"},'& [part="panel"]':{width:"560px",maxWidth:"calc(100vw - 32px)",maxHeight:"420px",display:"flex",flexDirection:"column",alignSelf:"flex-start",background:"var(--jx-bg-overlay)",border:"1px solid var(--jx-border)",borderRadius:"var(--jx-radius-md)",boxShadow:"var(--jx-shadow-dialog)",color:"var(--jx-fg)",fontFamily:"var(--jx-font-sans)",overflow:"hidden"},'& [part="input-row"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-3)",paddingLeft:"var(--jx-space-4)",background:"var(--jx-bg-input)",borderBottom:"1px solid var(--jx-border)"},'& [part="chip-slot"], & [part="empty-slot"], & [part="section-slot"], & [part="trailing-slot"]':{display:"contents"},'& [part="chip"]':{display:"inline-flex",alignItems:"center",gap:"var(--jx-space-1)",flexShrink:"0",padding:"2px var(--jx-space-1) 2px var(--jx-space-3)",borderRadius:"var(--jx-radius-sm)",background:"var(--jx-accent-solid)",color:"var(--jx-accent-fg)",fontSize:"var(--jx-text-sm)"},'& [part="chip-remove"] > [part="control"]':{color:"inherit",opacity:"0.8",":hover":{opacity:"1",background:"transparent"}},'& [part="input"]':{flex:"1",minWidth:"0",padding:"var(--jx-space-4) var(--jx-space-5) var(--jx-space-4) var(--jx-space-1)",font:"inherit",fontSize:"var(--jx-text-lg)",border:"none",outline:"none",background:"none",color:"var(--jx-fg)","::placeholder":{color:"var(--jx-fg-muted)"},":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"-2px"}},'& [part="results"]':{$description:"The list is the kit's: a `jx-listbox` of `jx-option`, so the highlight is ONE id — `active`, the same string the field points `aria-activedescendant` at — and the listbox's sidecar is the single writer of every row's `selected`. What this surface still decides is density. The kit's row pads itself by `--jx-space-3`; the other half of the 16px optical margin the panel has always had sits here, on the list, so the heading, the rows and the empty sentence line up on one edge instead of each naming it.",flex:"1",paddingInline:"var(--jx-space-3)"},'& [part="option"] [part="label"]':{fontWeight:"500"},'& [part="option"] [part="description"]':{$description:"A `jx-select` row's note is a category at the END of the row, so the kit pushes it there with an auto margin. A palette row's note is a CONTINUATION of its name — the file's directory, the command's category — and the far edge belongs to the chord, which is how this surface teaches the keyboard it replaced. So the auto margin moves to the end slot.",marginInlineStart:"0"},'& [part="option"] [part="end"]':{marginInlineStart:"auto"},'& [part="option"][aria-disabled="true"]':{$description:"An unavailable command is greyed with its `requires` sentence as the subtitle, and that sentence is the reason the row is on screen at all. The kit fades the whole row to 0.45, which would take a muted grey below any readable contrast — so the row keeps its ink and only the name and the glyph dim.",opacity:"1"},'& [part="option"][aria-disabled="true"] [part="label"], & [part="option"][aria-disabled="true"] [part="icon"]':{opacity:"0.45"},'& [part="chord"]':{flexShrink:"0",fontFamily:"inherit",fontSize:"var(--jx-text-xs)",color:"var(--jx-fg-muted)",border:"1px solid var(--jx-border)",borderRadius:"var(--jx-radius-sm)",padding:"0 5px"},'& [part="option"][aria-selected="true"] [part="chord"]':{color:"inherit",borderColor:"currentColor"},'& [part="badge"]':{fontSize:"var(--jx-text-xs)",padding:"1px var(--jx-space-2)",borderRadius:"var(--jx-radius-sm)",background:"var(--jx-border)",color:"var(--jx-fg-dim)"},'& [part="hint"]':{padding:"var(--jx-space-2) var(--jx-space-5)",borderTop:"1px solid var(--jx-border)",color:"var(--jx-fg-muted)",fontSize:"var(--jx-text-xs)"},'& [part="hint"] kbd':{fontFamily:"inherit",color:"var(--jx-fg-dim)"}},children:[{tagName:"div",attributes:{part:"overlay",hidden:"${state.open ? null : ''}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/close"},value:[]}]},children:[{tagName:"div",attributes:{part:"panel"},onclick:{$prototype:"Function",body:[{stopPropagation:!0}]},children:[{tagName:"div",attributes:{part:"input-row"},children:[{tagName:"span",attributes:{part:"chip-slot",role:"none"},$switch:{$ref:"#/state/hasChip"},cases:{true:{tagName:"span",attributes:{part:"chip"},children:[{tagName:"span",attributes:{part:"chip-label"},textContent:"${state.chipLabel}"},{tagName:"jx-action-button",$props:{label:"Clear mode",hint:"Clear mode (Backspace)",icon:"x",size:"sm"},attributes:{part:"chip-remove"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/clearMode"},value:[]}]}}]}}},{tagName:"input",attributes:{part:"input",type:"text",role:"combobox","aria-controls":"quick-search-listbox","aria-expanded":"${state.expanded ? 'true' : 'false'}","aria-activedescendant":"${state.activeId || null}","aria-autocomplete":"list","aria-label":"${state.placeholder}",placeholder:"${state.placeholder}"},value:{$ref:"#/state/query"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/input"},value:[{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{ArrowDown:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/move"},value:[1]}],ArrowUp:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/move"},value:[-1]}],Enter:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/activate"},value:[]}],Escape:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/close"},value:[]}],Backspace:[{$switch:{$ref:"#/state/canClearMode"},cases:{true:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/clearMode"},value:[]}]}}]}}]}}]},{tagName:"jx-listbox",attributes:{part:"results",id:"quick-search-listbox"},$props:{label:"Results",active:"${state.activeId}"},onselect:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/activateRow"},value:[{$ref:"event#/detail"}]}],description:"One handler for every row, because a row's `select` bubbles. The detail is the row's `value`, which is the index it occupies in `rows` — the same number a hover names, and the number the id is built from."},children:[{tagName:"div",attributes:{part:"empty-slot",role:"none"},$switch:{$ref:"#/state/isEmpty"},cases:{true:{tagName:"div",attributes:{part:"empty"},textContent:"${state.emptyHint}"}}},{tagName:"div",attributes:{part:"section-slot",role:"none"},$switch:{$ref:"#/state/showSection"},cases:{true:{tagName:"div",attributes:{part:"group-heading"},textContent:"${state.sectionLabel}"}}},{$prototype:"Array",items:{$ref:"#/state/rows"},key:{$ref:"$map/item/key"},map:{tagName:"jx-option",attributes:{part:"option",id:"quick-search-option-${$map.index}","data-kind":"${$map.item.kind}"},$props:{value:"${$map.index}",label:{$ref:"$map/item/name"},description:{$ref:"$map/item/detail"},disabled:{$ref:"$map/item/disabled"}},onmouseenter:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/hover"},value:[{$ref:"$map/index"}]}]},children:[{tagName:"jx-icon",attributes:{slot:"icon"},$props:{name:{$ref:"$map/item/icon"}}},{tagName:"span",attributes:{slot:"end",part:"trailing-slot"},$switch:{$ref:"$map/item/trailing"},cases:{chord:{tagName:"kbd",attributes:{part:"chord"},textContent:"${$map.item.chord}"},recent:{tagName:"span",attributes:{part:"badge"},textContent:"recent"}}}]}}]},{tagName:"div",attributes:{part:"hint"},children:[{tagName:"kbd",textContent:"↑↓"}," move · ",{tagName:"kbd",textContent:"↵"}," run · ",{tagName:"kbd",textContent:"?"}," modes · ",{tagName:"kbd",textContent:">"}," commands · ",{tagName:"kbd",textContent:"@"}," elements"]}]}]}]};var P=[{mode:"files",prefix:"",chip:"Files",placeholder:"Go to a file…",description:"Open a file by any part of its path — pgblog finds pages/blog/index.md."},{mode:"commands",prefix:">",chip:"Commands",placeholder:"Run a command…",description:"Run anything Studio can do, with its keyboard shortcut printed beside it."},{mode:"nodes",prefix:"@",chip:"Symbols",placeholder:"Go to an element in this document…",description:"Select an element in the open document by its Outline name."},{mode:"projects",prefix:"",chip:"Recent Projects",placeholder:"Open a recent project…",description:"Reopen a project you have had open before."},{mode:"picker",prefix:"?",chip:"Modes",placeholder:"Type ? for modes, > for commands, @ for elements…",description:"List these modes."}],X=new Map(P.map((e)=>[e.mode,e])),E=P.filter((e)=>e.prefix!=="");function F(e){return X.get(e)??P[0]}function O(e,t,n){let r=E.find((i)=>t.startsWith(i.prefix));if(r)return O(r.mode,t.slice(1),n);let a=e;if(a==="picker"&&t.trim()!=="")a="files";if(a==="files"&&!n)a="projects";return{mode:a,query:t}}var Y=new Set(["/","-","_","."," "]);function V(e,t){if(t==="")return 0;let n=e.toLowerCase(),r=t.toLowerCase(),a=n.lastIndexOf("/")+1,i=0,o=0,x=-2;for(let G of r){let m=n.indexOf(G,o);if(m===-1)return null;if(m===x+1)i+=8;if(m===0||Y.has(n[m-1]??""))i+=6;if(m>=a)i+=4;x=m,o=m+1}return i-x*0.01-n.length*0.001}function k(e,t,n){let r=[];for(let[a,i]of e.entries()){let o=V(n(i),t);if(o!==null)r.push({index:a,item:i,score:o})}return r.toSorted((a,i)=>i.score-a.score||a.index-i.index).map((a)=>a.item)}function q(e){let t=e.args,n=t?.properties;if(!t||!n)return{kind:"none"};let r=Object.keys(n);if(r.length!==1)return{kind:"unsupported"};let a=r[0],i=n[a];if(i.enum)return{kind:"choice",name:a,choices:i.enum.map((o)=>({label:String(o),value:o}))};if(i.type==="boolean")return{kind:"choice",name:a,choices:[{label:"on",value:!0},{label:"off",value:!1}]};return{kind:"unsupported"}}function S(e){return`quick-search-option-${e}`}var _="jx-studio-recent-commands",Z=6;function L(){try{let e=JSON.parse(localStorage.getItem(_)||"[]");return Array.isArray(e)?e.filter((t)=>typeof t==="string"):[]}catch{return[]}}function ee(e){let t=[e,...L().filter((n)=>n!==e)].slice(0,Z);try{localStorage.setItem(_,JSON.stringify(t))}catch{}}var z=null,f=!1,g="picker",d="",c=0,b=null,w=!1,s=null;function H(){return vs("popover","quick-search")}function F_(e){z=e??null}function Af(e="files"){f=!0,g=e,d="",c=0,s=null,b=null,l(),ve(),C()}function y(){f=!1,s=null,l()}function J(){return D?D.projectRoot??null:null}function B(){return D!=null}function Q(){return O(g,d,B())}function W(e){let t=e.split("/");return t.pop(),t.length>0?t.join("/"):""}function te(e){if(e.startsWith("/home/"))return`~/${e.split("/").slice(3).join("/")}`;return e}async function C(){if(!f||b!==null||w||!B())return;w=!0,l();try{await qt(),b=(await p().searchFiles("",Ka())).map((t)=>({kind:"file",path:t.path,name:t.name??t.path.split("/").pop()??"",detail:W(t.path),recent:!1}))}catch{b=[]}w=!1,l()}function oe(e){if(e.trim()==="")return uE(J()??void 0).map((t)=>({kind:"file",path:t.path,name:t.name,detail:W(t.path),recent:!0}));return k(b??[],e.trim(),(t)=>t.path)}function re(e){let t=eb().map((n)=>({kind:"project",root:n.root,name:n.name,detail:te(n.root)}));return k(t,e.trim(),(n)=>`${n.name}/${n.root}`)}function ae(e,t){let n=L(),r=[];for(let o of e.visible()){if(q(o).kind==="unsupported")continue;if(!(o.menus??["palette"]).includes("palette"))continue;r.push({kind:"command",id:o.id,name:`${o.category}: ${o.title}`,detail:e.disabledReason(o.id)??"",chord:e.keymap.formatBinding(o.id)??"",enabled:e.isEnabled(o.id),recent:n.includes(o.id)})}let a=k(r,t.trim(),(o)=>o.name);if(t.trim()!=="")return a;let i=n.map((o)=>a.find((x)=>x.id===o)).filter((o)=>o!==void 0);return[...i,...a.filter((o)=>!i.includes(o))]}function ie(e){let t=u.value;if(!t)return[];let n=Ad(t.doc.document).map((r)=>({kind:"node",path:r.path,name:r.nodeType==="text"?String(r.node).slice(0,60):Mo(r.node),detail:r.nodeType}));return k(n,e.trim(),(r)=>r.name)}function se(){return P.filter((e)=>e.mode!=="picker").map((e)=>({kind:"mode",mode:e.mode,name:e.chip,detail:e.description,chord:e.prefix}))}function ce(e){let t=s,n=t.choices.map((r)=>({kind:"arg",commandId:t.command.id,argName:t.name,value:r.value,name:r.label,detail:`${t.command.title} → ${t.name}`}));return k(n,e.trim(),(r)=>r.name)}function de(){let{mode:e,query:t}=Q();if(s)return{rows:ce(t),showingRecent:!1};switch(e){case"commands":{let n=ne();return{rows:n?ae(n,t):[],showingRecent:t.trim()===""}}case"nodes":return{rows:ie(t),showingRecent:!1};case"projects":return{rows:re(t),showingRecent:t.trim()===""};case"picker":return{rows:se(),showingRecent:!1};default:return{rows:oe(t),showingRecent:t.trim()===""}}}function le(e){let t=E.find((n)=>e.startsWith(n.prefix));if(t)g=t.mode,d=e.slice(1);else d=e;if(c=0,e!==d)j().query=e;l(),C()}function pe(){g="picker",s=null,c=0,l()}function me(e){g=e,d="",c=0,l(),C()}function U(e,t){let n=ne();if(!n)return;ee(e.id),y(),rn(n,e.id,t,"Palette")}function M(e){switch(e.kind){case"project":{y(),z?.openRecentProject(e.root);return}case"file":{y(),Hf({name:e.name,path:e.path,root:J()??""}),Io(e.path);return}case"mode":{me(e.mode);return}case"node":{y(),Rc("selection.set",{path:e.path},"Palette");return}case"arg":{U(s.command,{[e.argName]:e.value});return}default:ue(e)}}function ue(e){let t=ne(),n=t?.get(e.id);if(!t||!n||!e.enabled)return;let r=q(n);if(r.kind==="choice"){s={choices:r.choices,command:n,name:r.name},d="",c=0,l();return}U(n)}function he(e){let t=e.split(".").pop()?.toLowerCase();if(t==="json")return"file-code";if(t&&Vs(t))return"file-text";return"file"}function fe(e){switch(e.kind){case"project":return"folder-open";case"file":return he(e.name);case"command":return"play";case"node":return"stack";default:return"caret-right"}}function ge(e,t){if((e.kind==="command"||e.kind==="mode")&&e.chord)return"chord";if(e.kind==="command"&&e.recent)return"recent";return t?"recent":"none"}function xe(e){switch(e.kind){case"project":return`project:${e.root}`;case"file":return`file:${e.path}`;case"command":return`command:${e.id}`;case"node":return`node:${e.path.join("/")}`;case"mode":return`mode:${e.mode}`;default:return`arg:${e.value}`}}function be(e,t){if(w)return"Reading the project's files…";if(t.trim()!=="")return"No results";switch(e){case"projects":return"No recent projects — open one to get started";case"nodes":return"Open a document to jump to its elements";case"commands":return"Type to find any command in Studio";default:return F(e).placeholder}}T("palette",N);var I=null,A=null,h=[];function j(){return I??=v({activate:()=>{let e=h[c];if(e)M(e)},activateRow:(e)=>{let t=h[Number(e)];if(t)M(t)},activeId:"",canClearMode:!1,chipLabel:"",clearMode:pe,close:y,emptyHint:"",expanded:!1,hasChip:!1,hover:(e)=>{c=e,j().activeId=S(e)},input:le,isEmpty:!0,move:(e)=>{if(h.length===0)return;c=Math.max(0,Math.min(c+e,h.length-1)),j().activeId=S(c)},open:!1,placeholder:"",query:"",rows:[],sectionLabel:"",showSection:!1}),I}function ve(){setTimeout(()=>{if(f)H().querySelector('[part="input"]')?.focus()},0)}function l(){let e=j();if(!A)A=R("palette",e,H());if(e.open=f,!f){h=[];return}let{mode:t,query:n}=Q(),{rows:r,showingRecent:a}=de(),i=F(t);h=r,e.placeholder=s?`Choose a ${s.name}…`:i.placeholder,e.hasChip=s!==null||t!=="picker",e.chipLabel=s?s.command.title:i.chip,e.query=d,e.canClearMode=d===""&&(s!==null||g!=="picker"),e.rows=r.map((o)=>({chord:(o.kind==="command"||o.kind==="mode")&&o.chord?o.chord:"",detail:o.detail,disabled:o.kind==="command"&&!o.enabled,icon:fe(o),key:xe(o),kind:o.kind,name:o.name,trailing:ge(o,a)})),e.expanded=r.length>0,e.activeId=r.length>0?S(c):"",e.isEmpty=r.length===0,e.emptyHint=be(t,n),e.showSection=a&&r.length>0,e.sectionLabel=s?`${s.command.title} — ${s.name}`:t==="projects"?"Recent projects":t==="commands"?"Recently used":"Recently opened"}
|
|
2
|
+
export{F_,Af};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
5
|
-
//# sourceMappingURL=studio-
|
|
4
|
+
//# debugId=57AB6F89548296F564756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-wr0pq67n.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{p}from"./studio-6k1eswp9.js";import{D}from"./studio-153mwkyq.js";function u(n,r=[]){if(!n||typeof n!=="object"||Array.isArray(n))return r;let t=n;if(t.tagName==="slot"){let o=t.attributes?.name,l=typeof o==="string"?o.trim():"",{children:a}=t;r.push({name:l,...Array.isArray(a)&&a.length>0?{fallback:a}:{}})}if(Array.isArray(t.children))for(let e of t.children)u(e,r);return r}function m(n){if(n==null)return!1;if(typeof n!=="object")return!0;let r=n;return!r.$prototype&&!r.$handler&&!r.$compute}function Cx(n,r){if(!n||typeof n!=="object"||Array.isArray(n))return null;let t=n,{tagName:e}=t;if(typeof e!=="string"||!e.includes("-"))return null;let o=u(t),l=t.state??{};return{$id:typeof t.$id==="string"&&t.$id?t.$id:null,hasElements:Array.isArray(t.$elements)&&t.$elements.length>0,path:r,props:Object.entries(l).filter(([,a])=>m(a)).map(([a,s])=>{if(typeof s!=="object"||s===null)return{default:s,name:a,type:typeof s};let i=s;return{default:i.default,format:i.format,name:a,type:i.type}}),...o.length>0?{slots:o}:{},tagName:e}}var at=[],c=!1;async function Dl(){try{at=await p().discoverComponents(D?.projectRoot||void 0),c=!0}catch{c=!0}}function FC(n,r){if(!n)return!1;let t=at.findIndex((l)=>l.path===n),e=Cx(r,n);if(!e){if(t===-1)return!1;return at.splice(t,1),!0}let o=e;if(t===-1)at.push(o);else at[t]=o;return!0}function fm(n){let r=Object.fromEntries((n.props??[]).map((e)=>[e.name,e.default!==void 0?e.default:""])),t=[];for(let e of n.slots??[])for(let o of structuredClone(e.fallback??[]))if(!e.name)t.push(o);else if(typeof o==="object"&&o!==null&&typeof o.tagName==="string")o.attributes={slot:e.name,...o.attributes},t.push(o);else t.push({attributes:{slot:e.name},children:[o],tagName:"span"});return{$props:r,tagName:n.tagName,...t.length>0?{children:t}:{}}}function xc(n,r){if(!n)return`./${r}`;let t=n.replaceAll("\\","/"),e=r.replaceAll("\\","/"),l=(t.includes("/")?t.slice(0,t.lastIndexOf("/")):"").split("/").filter(Boolean),a=e.split("/").filter(Boolean),s=0;while(s<l.length&&s<a.length&&l[s]===a[s])s+=1;let i=l.length-s,f=a.slice(s);return(i>0?"../".repeat(i):"./")+f.join("/")}
|
|
2
|
+
export{Cx,at,Dl,FC,fm,xc};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
5
|
-
//# sourceMappingURL=studio-
|
|
4
|
+
//# debugId=9A6E9E7959EF41DF64756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-y164brht.js.map
|