@jxsuite/studio 5.6.0 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{2020-zvax9fmb.js → 2020-cs2sb9t1.js} +3 -3
- package/dist/chunks/adapter-y5gdq19c.js +4 -0
- package/dist/chunks/{cf-account-picker-zfycs4k2.js → cf-account-picker-bb2yq946.js} +3 -3
- package/dist/chunks/cf-settings-20dznc3j.js +4 -0
- package/dist/chunks/components-q037dya7.js +4 -0
- package/dist/chunks/content-source-t0q184js.js +4 -0
- package/dist/chunks/{convert-to-repeater-x19jr6c7.js → convert-to-repeater-vqkt7s3s.js} +3 -3
- package/dist/chunks/editor-j5sq149q.js +4 -0
- package/dist/chunks/entry-commands-fxzgcc4k.js +4 -0
- package/dist/chunks/{extension-sections-y90sa0n4.js → extension-sections-8beq9ac3.js} +3 -3
- package/dist/chunks/file-ops-2n77759h.js +4 -0
- package/dist/chunks/files-fjy7zpxt.js +4 -0
- package/dist/chunks/format-host-wj3mf3n8.js +4 -0
- package/dist/chunks/fs-events-7kcgn4e9.js +4 -0
- package/dist/chunks/git-panel-7z2mpt2d.js +4 -0
- package/dist/chunks/{grid-view-d9mybhn0.js → grid-view-ca10def6.js} +10 -10
- package/dist/chunks/iframe-host-a0zjd6xp.js +4 -0
- package/dist/chunks/{index-vnwy9d44.js → index-9ydfe04y.js} +3 -3
- package/dist/chunks/index-m0x5ztax.js +4 -0
- package/dist/chunks/{javascript-f0nrbdjb.js → javascript-d9pqgc2p.js} +2 -2
- package/dist/chunks/{jsonMode-nfa90dtf.js → jsonMode-800yvbem.js} +4 -4
- package/dist/chunks/jx-validate-zc9zp77s.js +4 -0
- package/dist/chunks/layers-p677nrh5.js +4 -0
- package/dist/chunks/layers-panel-y4w1dq90.js +4 -0
- package/dist/chunks/lit-html-cfn61dn7.js +4 -0
- package/dist/chunks/media-picker-xg7yjpz9.js +4 -0
- package/dist/chunks/menu-fpekzj6w.js +4 -0
- package/dist/chunks/{monaco-binding-antn79jf.js → monaco-binding-62dtmgbf.js} +3 -3
- package/dist/chunks/monaco-buffer-nn4dtx27.js +4 -0
- package/dist/chunks/{monaco-setup-k8s40vwg.js → monaco-setup-tj13ndtm.js} +3 -3
- package/dist/chunks/notify-ahs57a2z.js +4 -0
- package/dist/chunks/platform-v9xyfkbx.js +4 -0
- package/dist/chunks/publish-panel-xtbfgg2r.js +4 -0
- package/dist/chunks/quick-search-d3a6m7j3.js +4 -0
- package/dist/chunks/references-99ws0b0m.js +4 -0
- package/dist/chunks/right-panel-31vbk5xp.js +4 -0
- package/dist/chunks/section-registry-b2yzp9sw.js +4 -0
- package/dist/chunks/{studio-y17505ge.js → studio-01kbbqg3.js} +207 -207
- package/dist/chunks/{studio-gxna6yta.js → studio-01qza1n3.js} +4 -4
- package/dist/chunks/{studio-n2e133d6.js → studio-03wwfvyt.js} +4 -4
- package/dist/chunks/{studio-09n3fyy0.js → studio-0bbxhhce.js} +4 -4
- package/dist/chunks/studio-1a99w39s.js +5 -0
- package/dist/chunks/studio-1q6amtph.js +5 -0
- package/dist/chunks/{studio-eegyf5vg.js → studio-1wvfxkyy.js} +4 -4
- package/dist/chunks/{studio-z47mm077.js → studio-3ck2a5c4.js} +6 -6
- package/dist/chunks/{studio-ymsjnvp9.js → studio-4fde4a0x.js} +4 -4
- package/dist/chunks/{studio-je15p5v8.js → studio-4jj9gme2.js} +5 -5
- package/dist/chunks/{studio-w8w9frjy.js → studio-4m50vh74.js} +12 -12
- package/dist/chunks/{studio-891t1tv9.js → studio-4r0sjtx8.js} +4 -4
- package/dist/chunks/{studio-6exg5z4x.js → studio-4xppwncr.js} +3 -3
- package/dist/chunks/{studio-011em5cf.js → studio-5d7wfmnp.js} +4 -4
- package/dist/chunks/{studio-zkkdbbvd.js → studio-5e9zsamh.js} +6 -6
- package/dist/chunks/{studio-pvj970st.js → studio-5gs9th4b.js} +4 -4
- package/dist/chunks/{studio-dtmdjmqb.js → studio-5vy2wfm5.js} +4 -4
- package/dist/chunks/{studio-654fxcr0.js → studio-7pgy3xaf.js} +4 -4
- package/dist/chunks/{studio-z1vdxq0e.js → studio-7qvs7v0m.js} +4 -4
- package/dist/chunks/studio-84rtc120.js +5 -0
- package/dist/chunks/{studio-ks0ecgjx.js → studio-8xcwewjq.js} +4 -4
- package/dist/chunks/{studio-sadckcpp.js → studio-aekhcdzw.js} +5 -5
- package/dist/chunks/{studio-mf41717j.js → studio-aje966s9.js} +4 -4
- package/dist/chunks/studio-aqmph6k4.js +5 -0
- package/dist/chunks/{studio-28pz4s1k.js → studio-bftp4n4b.js} +4 -4
- package/dist/chunks/{studio-tzs6njnb.js → studio-c6zdm25z.js} +7 -7
- package/dist/chunks/{studio-sgzss898.js → studio-capk0583.js} +7 -7
- package/dist/chunks/{studio-805fwp9k.js → studio-cbr9czkn.js} +4 -4
- package/dist/chunks/{studio-1pxvgx1t.js → studio-chdmwwzw.js} +4 -4
- package/dist/chunks/{studio-dknr8m7b.js → studio-cp1gbff9.js} +7 -7
- package/dist/chunks/{studio-ft8pfpp0.js → studio-cqmtbg2p.js} +4 -4
- package/dist/chunks/studio-e47215hh.js +5 -0
- package/dist/chunks/{studio-9n2j9nqk.js → studio-edbtvcd1.js} +4 -4
- package/dist/chunks/{studio-mm8x32gg.js → studio-evwgp1ym.js} +4 -4
- package/dist/chunks/{studio-02y9cb4h.js → studio-fbx6twps.js} +5 -5
- package/dist/chunks/{studio-0nm2skex.js → studio-fqq890ap.js} +3 -3
- package/dist/chunks/studio-fthwn4kf.js +5 -0
- package/dist/chunks/{studio-s85vah66.js → studio-g8dsj3d2.js} +5 -5
- package/dist/chunks/{studio-0c3fpdqj.js → studio-ge5fqjth.js} +5 -5
- package/dist/chunks/{studio-ebt49j3c.js → studio-gjknvzam.js} +5 -5
- package/dist/chunks/{studio-zkvyd3ev.js → studio-gp02nqnw.js} +4 -4
- package/dist/chunks/{studio-5fc0728f.js → studio-hjbg8d5y.js} +7 -7
- package/dist/chunks/{studio-d007j0z3.js → studio-hnvnfbdv.js} +6 -6
- package/dist/chunks/{studio-b5rxwkj2.js → studio-mk00zd5d.js} +4 -4
- package/dist/chunks/{studio-36s6qjgq.js → studio-n78gjfy8.js} +4 -4
- package/dist/chunks/studio-nbxqcgvf.js +5 -0
- package/dist/chunks/{studio-y164brht.js → studio-pwqfmt4p.js} +4 -4
- package/dist/chunks/studio-qa73881a.js +5 -0
- package/dist/chunks/{studio-6zyt56ek.js → studio-r3kaka4d.js} +4 -4
- package/dist/chunks/{studio-njmg0e73.js → studio-rmn2dz59.js} +5 -5
- package/dist/chunks/{studio-wr0pq67n.js → studio-rr4xkv81.js} +4 -4
- package/dist/chunks/{studio-tj28pxa1.js → studio-semd1s8s.js} +4 -4
- package/dist/chunks/{studio-7w04zw8h.js → studio-st75kn99.js} +5 -5
- package/dist/chunks/{studio-dmymvk2j.js → studio-sxc0zvpt.js} +3 -3
- package/dist/chunks/studio-t1eedsyx.js +4 -0
- package/dist/chunks/{studio-9tkaykt5.js → studio-tmeq6mjb.js} +4 -4
- package/dist/chunks/{studio-153mwkyq.js → studio-tp642n5g.js} +4 -4
- package/dist/chunks/{studio-t0v47dpc.js → studio-tzegmy4w.js} +4 -4
- package/dist/chunks/studio-vavmwshr.js +5 -0
- package/dist/chunks/studio-x5g1xk77.js +5 -0
- package/dist/chunks/studio-x92tgnee.js +64 -0
- package/dist/chunks/{studio-4yztve2t.js → studio-xg1942as.js} +4 -4
- package/dist/chunks/{studio-k9pwvmz8.js → studio-xkfs0dp2.js} +4 -4
- package/dist/chunks/{studio-6k1eswp9.js → studio-y7jehjrp.js} +4 -4
- package/dist/chunks/{studio-81twpmzj.js → studio-yr04mv2j.js} +4 -4
- package/dist/chunks/{studio-gj4j9e7k.js → studio-zd4kayn2.js} +4 -4
- package/dist/chunks/{studio-jsr14n1s.js → studio-zev8ssp1.js} +4 -4
- package/dist/chunks/{studio-r7yeeqc4.js → studio-ztvcxm3w.js} +4 -4
- package/dist/chunks/{tsMode-eq26t9gs.js → tsMode-k9s9fcag.js} +4 -4
- package/dist/chunks/workspace-5vmgsagj.js +4 -0
- package/dist/chunks/{ws-client-3gxqp06s.js → ws-client-0ja08haa.js} +3 -3
- package/dist/iframe-entry.js +3 -3
- package/dist/manifest.json +62 -62
- package/dist/studio.js +95 -95
- package/package.json +12 -12
- package/src/canvas/stage-scrollbar.ts +7 -7
- package/src/files/file-ops.ts +5 -8
- package/src/panels/jump-bar.ts +132 -158
- package/src/panels/pane-context.ts +8 -8
- package/src/panels/pane-grid.ts +18 -26
- package/src/panels/style-panel.ts +2 -2
- package/src/services/context-manager.ts +41 -70
- package/src/services/document-assistant.ts +12 -3
- package/src/services/harness/chat-reducer.ts +115 -0
- package/src/services/harness/turn-hooks.ts +50 -0
- package/src/services/tool-executor.ts +69 -288
- package/src/services/tool-outcomes.ts +12 -10
- package/src/studio.ts +2 -5
- package/src/surfaces/block-action-bar.json +6 -1
- package/src/surfaces/jump-bar.json +9 -12
- package/src/surfaces/jump-bar.ts +15 -16
- package/src/surfaces/pane-context.json +2 -2
- package/src/surfaces/pane-grid.json +8 -25
- package/src/surfaces/pane-grid.ts +7 -8
- package/src/surfaces/statusbar.json +71 -3
- package/src/surfaces/statusbar.ts +66 -139
- package/src/surfaces/style-panel.json +3 -3
- package/src/surfaces/style-panel.ts +11 -1
- package/src/ui/schema-form.ts +6 -2
- package/dist/chunks/adapter-6zhjbpmd.js +0 -4
- package/dist/chunks/cf-settings-fpa485q3.js +0 -4
- package/dist/chunks/components-b0vh4sq8.js +0 -4
- package/dist/chunks/content-source-z5t0d0h9.js +0 -4
- package/dist/chunks/editor-7e23n4a8.js +0 -4
- package/dist/chunks/entry-commands-5cm6aba2.js +0 -4
- package/dist/chunks/file-ops-hv7gf757.js +0 -4
- package/dist/chunks/files-kb0epdxf.js +0 -4
- package/dist/chunks/format-host-eg1wy2bp.js +0 -4
- package/dist/chunks/fs-events-ky3vxfmh.js +0 -4
- package/dist/chunks/git-panel-yyg3bzp2.js +0 -4
- package/dist/chunks/iframe-host-9wdf0hes.js +0 -4
- package/dist/chunks/index-2tf0m2ne.js +0 -4
- package/dist/chunks/jx-validate-7w11db9v.js +0 -4
- package/dist/chunks/layers-7zasrpse.js +0 -4
- package/dist/chunks/layers-panel-9nzc4fdq.js +0 -4
- package/dist/chunks/lit-html-5qr7nbng.js +0 -4
- package/dist/chunks/media-picker-maevn9d4.js +0 -4
- package/dist/chunks/menu-wq6q0v3y.js +0 -4
- package/dist/chunks/monaco-buffer-9ry2rn5x.js +0 -4
- package/dist/chunks/notify-g91gjd6w.js +0 -4
- package/dist/chunks/platform-jdwjp2vt.js +0 -4
- package/dist/chunks/publish-panel-8yym447p.js +0 -4
- package/dist/chunks/quick-search-9bzm9kh3.js +0 -4
- package/dist/chunks/references-znssfqvq.js +0 -4
- package/dist/chunks/right-panel-czbzktm8.js +0 -4
- package/dist/chunks/section-registry-0rtq73qs.js +0 -4
- package/dist/chunks/studio-0mm38y62.js +0 -5
- package/dist/chunks/studio-27tc8q0h.js +0 -5
- package/dist/chunks/studio-7djymzt2.js +0 -5
- package/dist/chunks/studio-ant1zbp3.js +0 -5
- package/dist/chunks/studio-b29h7g7s.js +0 -5
- package/dist/chunks/studio-eb5sty2k.js +0 -5
- package/dist/chunks/studio-frv7vjhw.js +0 -5
- package/dist/chunks/studio-mb8jhtr4.js +0 -64
- package/dist/chunks/studio-nvykrgbj.js +0 -4
- package/dist/chunks/studio-nw4q9sdn.js +0 -5
- package/dist/chunks/studio-p6avneaq.js +0 -5
- package/dist/chunks/studio-vz7b43ng.js +0 -5
- package/dist/chunks/workspace-emt8454d.js +0 -4
|
@@ -1,5 +1,5 @@
|
|
|
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{
|
|
1
|
+
import{p}from"./studio-y7jehjrp.js";import{qt,Vs,Ka}from"./studio-cqmtbg2p.js";import{ne}from"./studio-cp1gbff9.js";import{T,R,on,Rc,vs}from"./studio-7qvs7v0m.js";import{v}from"./studio-fqq890ap.js";import{u}from"./studio-x5g1xk77.js";import{Xg,lE,Ff,Lo}from"./studio-hnvnfbdv.js";import{Nd,Zo,D}from"./studio-tp642n5g.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 P_(e){z=e??null}function $f(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 lE(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=Xg().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=Nd(t.doc.document).map((r)=>({kind:"node",path:r.path,name:r.nodeType==="text"?String(r.node).slice(0,60):Zo(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(),on(n,e.id,t,"Palette")}function M(e){switch(e.kind){case"project":{y(),z?.openRecentProject(e.root);return}case"file":{y(),Ff({name:e.name,path:e.path,root:J()??""}),Lo(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{P_,$f};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
5
|
-
//# sourceMappingURL=studio-
|
|
4
|
+
//# debugId=8C60334715637D6264756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-rr4xkv81.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{p,We}from"./studio-
|
|
2
|
-
export{_t,Lr,
|
|
1
|
+
import{p,We}from"./studio-y7jehjrp.js";import{k}from"./studio-fqq890ap.js";function h(e){return e.trim().replace(/\/+$/,"")}function u(e){return e.trim()}var _t={aiBaseUrl:{default:"",key:"jx.ai.baseUrl",normalize:h,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"},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(_t),l=S.filter((e)=>e.scope==="user"),P=l.map((e)=>e.key);function y(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 v(e,t){try{if(t===null)globalThis.localStorage?.removeItem(e);else globalThis.localStorage?.setItem(e,t)}catch{}}try{for(let e of S){let t=globalThis.localStorage?.getItem(e.key);if(t!==null&&t!==void 0)c.set(e.key,t)}}catch{}function Lr(e){return c.get(e.key)??""}function aL(e){return(c.get(e.key)??"")!==""}var m=new Set;function Xb(e){return m.add(e),()=>{m.delete(e)}}function f(e){for(let t of m)t(e)}var g=y({onError(e){k("error","Your settings could not be saved.",{detail:e instanceof Error?e.message:String(e),key:"settings-write",source:"Settings"})},async send(e){if(!We())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 lL(){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);v(n,i),t.push(n)}return t}function Qb(e,t){return e.normalize?e.normalize(t):t}function qr(e,t){let n=Qb(e,t),i=d({[e.key]:n});if(i.length>0)g.enqueue({[e.key]:n}),f(i)}function cL(e){let t={};for(let[i,r]of e)t[i.key]=Qb(i,r);let n=d(t);if(n.length>0)g.enqueue(t),f(n)}function Hu(e){let t={};for(let i of e)t[i.key]=null;let n=d(t);if(n.length>0)g.enqueue(t),f(n)}async function dL(){if(!We())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 l){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)f(r);if(i){let s={};for(let o of l){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 l)t[i.key]=e[i.key]??null;let n=d(t);if(n.length>0)f(n)}function uL(){if(!We())return;p().subscribeSettings?.(x)}
|
|
2
|
+
export{_t,Lr,aL,Xb,lL,Qb,qr,cL,Hu,dL,uL};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
5
|
-
//# sourceMappingURL=studio-
|
|
4
|
+
//# debugId=B77F0A03C3A129AC64756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-semd1s8s.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{
|
|
2
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function B(e,r){return me(e)||ge(e,r)||X(e,r)||ye()}var ot=
|
|
3
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function J(e){return He(e)||Ce(e)||X(e)||Me()}var Xe=
|
|
1
|
+
import{bu,ae}from"./studio-0bbxhhce.js";var ne=ae(function(be){Object.defineProperty(be,"__esModule",{value:!0});be.bind=void 0;function at(e,r){var{type:t,listener:n,options:o}=r;return e.addEventListener(t,n,o),function i(){e.removeEventListener(t,n,o)}}be.bind=at});var Te=ae(function(k){var N=k&&k.__assign||function(){return N=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++){r=arguments[t];for(var o in r)if(Object.prototype.hasOwnProperty.call(r,o))e[o]=r[o]}return e},N.apply(this,arguments)};Object.defineProperty(k,"__esModule",{value:!0});k.bindAll=void 0;var it=ne();function xe(e){if(typeof e>"u")return;if(typeof e==="boolean")return{capture:e};return e}function ut(e,r){if(r==null)return e;var t=N(N({},e),{options:N(N({},xe(r)),xe(e.options))});return t}function lt(e,r,t){var n=r.map(function(o){var i=ut(o,t);return(0,it.bind)(e,i)});return function o(){n.forEach(function(i){return i()})}}k.bindAll=lt});var R=ae(function(V){Object.defineProperty(V,"__esModule",{value:!0});V.bindAll=V.bind=void 0;var ct=ne();Object.defineProperty(V,"bind",{enumerable:!0,get:function(){return ct.bind}});var st=Te();Object.defineProperty(V,"bindAll",{enumerable:!0,get:function(){return st.bindAll}})});function me(e){if(Array.isArray(e))return e}function ge(e,r){var t=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var n,o,i,u,l=[],a=!0,c=!1;try{if(i=(t=t.call(e)).next,r===0){if(Object(t)!==t)return;a=!1}else for(;!(a=(n=i.call(t)).done)&&(l.push(n.value),l.length!==r);a=!0);}catch(d){c=!0,o=d}finally{try{if(!a&&t.return!=null&&(u=t.return(),Object(u)!==u))return}finally{if(c)throw o}}return l}}function L(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}function X(e,r){if(e){if(typeof e=="string")return L(e,r);var t={}.toString.call(e).slice(8,-1);return t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set"?Array.from(e):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?L(e,r):void 0}}function ye(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function B(e,r){return me(e)||ge(e,r)||X(e,r)||ye()}var ot=bu(R());var q="data-pdnd-honey-pot";function z(e){return e instanceof Element&&e.hasAttribute(q)}function G(e){var r=document.elementsFromPoint(e.x,e.y),t=B(r,2),n=t[0],o=t[1];if(!n)return null;if(z(n))return o!==null&&o!==void 0?o:null;return n}function H(e){return H=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},H(e)}function we(e,r){if(H(e)!="object"||!e)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var n=t.call(e,r||"default");if(H(n)!="object")return n;throw TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function De(e){var r=we(e,"string");return H(r)=="symbol"?r:r+""}function ga(e,r,t){return(r=De(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}var Y=bu(R());var Ae=2147483647;var Oe={inset:"unset",border:"none",padding:0,margin:0,overflow:"visible",color:"inherit",background:"transparent",width:"auto",height:"auto"};function A(e){var r=null;return function t(){if(!r){for(var n=arguments.length,o=Array(n),i=0;i<n;i++)o[i]=arguments[i];var u=e.apply(this,o);r={result:u}}return r.result}}var Z=A(function e(){return typeof HTMLElement<"u"&&typeof HTMLElement.prototype.showPopover==="function"});function Ee(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),t.push.apply(t,n)}return t}function Se(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?Ee(Object(t),!0).forEach(function(n){ga(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ee(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var U=2,Pe=U/2;function ft(e){return{x:Math.floor(e.x),y:Math.floor(e.y)}}function dt(e){return{x:e.x-Pe,y:e.y-Pe}}function vt(e){return{x:Math.max(e.x,0),y:Math.max(e.y,0)}}function mt(e){return{x:Math.min(e.x,window.innerWidth-U),y:Math.min(e.y,window.innerHeight-U)}}function je(e){var r=e.client,t=mt(vt(dt(ft(r))));return DOMRect.fromRect({x:t.x,y:t.y,width:U,height:U})}function Ie(e){var r=e.clientRect;return{left:"".concat(r.left,"px"),top:"".concat(r.top,"px"),width:"".concat(r.width,"px"),height:"".concat(r.height,"px")}}function gt(e){var{client:r,clientRect:t}=e;return r.x>=t.x&&r.x<=t.x+t.width&&r.y>=t.y&&r.y<=t.y+t.height}function yt(e){var r=e.initial,t=document.createElement("div");if(t.setAttribute(q,"true"),Z())t.setAttribute("popover","manual");var n=je({client:r});if(Object.assign(t.style,Se(Se({position:"fixed"},Z()?Oe:{zIndex:Ae}),{},{backgroundColor:"transparent",padding:0,margin:0,boxSizing:"border-box",pointerEvents:"auto"},Ie({clientRect:n}))),document.body.appendChild(t),Z())t.showPopover();var o=Y.bind(window,{type:"pointermove",listener:function i(u){var l={x:u.clientX,y:u.clientY};n=je({client:l}),Object.assign(t.style,Ie({clientRect:n}))},options:{capture:!0}});return function i(u){var l=u.current;if(o(),gt({client:l,clientRect:n})){t.remove();return}function a(){c(),t.remove()}var c=Y.bindAll(window,[{type:"pointerdown",listener:a},{type:"pointermove",listener:a},{type:"focusin",listener:a},{type:"focusout",listener:a},{type:"dragstart",listener:a},{type:"dragenter",listener:a},{type:"dragover",listener:a}],{capture:!0})}}function Fe(){var e=null;function r(){return e=null,Y.bind(window,{type:"pointermove",listener:function n(o){e={x:o.clientX,y:o.clientY}},options:{capture:!0}})}function t(){var n=null;return function o(i){var{eventName:u,payload:l}=i;if(u==="onDragStart"){var a=l.location.initial.input,c=e!==null&&e!==void 0?e:{x:a.clientX,y:a.clientY};n=yt({initial:c})}if(u==="onDrop"){var d,f=l.location.current.input;(d=n)===null||d===void 0||d({current:{x:f.clientX,y:f.clientY}}),n=null,e=null}}}return{bindEvents:r,getOnPostDispatch:t}}function He(e){if(Array.isArray(e))return L(e)}function Ce(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Me(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
3
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function J(e){return He(e)||Ce(e)||X(e)||Me()}var Xe=bu(R());var Ne=A(function e(){return navigator.userAgent.includes("Firefox")});var W=A(function e(){var r=navigator,t=r.userAgent;return t.includes("AppleWebKit")&&!t.includes("Chrome")});function bt(e){return"nodeName"in e}function ke(e){return bt(e)&&e.ownerDocument!==document}var We=bu(R());var Q={isLeavingWindow:Symbol("leaving"),isEnteringWindow:Symbol("entering")};(function e(){if(typeof window>"u")return;if(!W())return;function r(){return{enterCount:0,isOverWindow:!1}}var t=r();function n(){t=r()}We.bindAll(window,[{type:"dragstart",listener:function o(){t.enterCount=0,t.isOverWindow=!0}},{type:"drop",listener:n},{type:"dragend",listener:n},{type:"dragenter",listener:function o(i){if(!t.isOverWindow&&t.enterCount===0)i[Q.isEnteringWindow]=!0;t.isOverWindow=!0,t.enterCount++}},{type:"dragleave",listener:function o(i){if(t.enterCount--,t.isOverWindow&&t.enterCount===0)i[Q.isLeavingWindow]=!0,t.isOverWindow=!1}}],{capture:!0})})();function Ke(e){var r=e.dragLeave;if(!W())return!1;return r.hasOwnProperty(Q.isLeavingWindow)}function Le(e){var r=e.dragLeave,{type:t,relatedTarget:n}=r;if(t!=="dragleave")return!1;if(W())return Ke({dragLeave:r});if(n==null)return!0;if(Ne())return ke(n);return n instanceof HTMLIFrameElement}function Re(e){var r=e.onDragEnd;return[{type:"pointermove",listener:function(){var t=0;return function n(){if(t<20){t++;return}r()}}()},{type:"pointerdown",listener:r}]}function C(e){return{altKey:e.altKey,button:e.button,buttons:e.buttons,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey,clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY}}var ht=function e(r){var t=[],n=null,o=function i(){for(var u=arguments.length,l=Array(u),a=0;a<u;a++)l[a]=arguments[a];if(t=l,n)return;n=requestAnimationFrame(function(){n=null,r.apply(void 0,t)})};return o.cancel=function(){if(!n)return;cancelAnimationFrame(n),n=null},o},Ue=ht;var oe=Ue(function(e){return e()}),_=function(){var e=null;function r(n){var o=requestAnimationFrame(function(){e=null,n()});e={frameId:o,fn:n}}function t(){if(e)cancelAnimationFrame(e.frameId),e.fn(),e=null}return{schedule:r,flush:t}}();function Ye(e){var{source:r,initial:t,dispatchEvent:n}=e,o={dropTargets:[]};function i(l){n(l),o={dropTargets:l.payload.location.current.dropTargets}}var u={start:function l(a){var c=a.nativeSetDragImage,d={current:t,previous:o,initial:t};i({eventName:"onGenerateDragPreview",payload:{source:r,location:d,nativeSetDragImage:c}}),_.schedule(function(){i({eventName:"onDragStart",payload:{source:r,location:d}})})},dragUpdate:function l(a){var c=a.current;_.flush(),oe.cancel(),i({eventName:"onDropTargetChange",payload:{source:r,location:{initial:t,previous:o,current:c}}})},drag:function l(a){var c=a.current;oe(function(){_.flush();var d={initial:t,previous:o,current:c};i({eventName:"onDrag",payload:{source:r,location:d}})})},drop:function l(a){var{current:c,updatedSourcePayload:d}=a;_.flush(),oe.cancel(),i({eventName:"onDrop",payload:{source:d!==null&&d!==void 0?d:r,location:{current:c,previous:o,initial:t}}})}};return u}var ue={isActive:!1};function Be(){return!ue.isActive}function xt(e){if(e.dataTransfer)return e.dataTransfer.setDragImage.bind(e.dataTransfer);return null}function Tt(e){var{current:r,next:t}=e;if(r.length!==t.length)return!0;for(var n=0;n<r.length;n++)if(r[n].element!==t[n].element)return!0;return!1}function wt(e){var{event:r,dragType:t,getDropTargetsOver:n,dispatchEvent:o}=e;if(!Be())return;var i=Dt({event:r,dragType:t,getDropTargetsOver:n});ue.isActive=!0;var u={current:i};ie({event:r,current:i.dropTargets});var l=Ye({source:t.payload,dispatchEvent:o,initial:i});function a(s){var p=Tt({current:u.current.dropTargets,next:s.dropTargets});if(u.current=s,p)l.dragUpdate({current:u.current})}function c(s){var p=C(s),m=z(s.target)?G({x:p.clientX,y:p.clientY}):s.target,g=n({target:m,input:p,source:t.payload,current:u.current.dropTargets});if(g.length)s.preventDefault(),ie({event:s,current:g});a({dropTargets:g,input:p})}function d(){if(u.current.dropTargets.length)a({dropTargets:[],input:u.current.input});l.drop({current:u.current,updatedSourcePayload:null}),f()}function f(){ue.isActive=!1,w()}var w=Xe.bindAll(window,[{type:"dragover",listener:function s(p){c(p),l.drag({current:u.current})}},{type:"dragenter",listener:c},{type:"dragleave",listener:function s(p){if(!Le({dragLeave:p}))return;if(a({input:u.current.input,dropTargets:[]}),t.startedFrom==="external")d()}},{type:"drop",listener:function s(p){if(u.current={dropTargets:u.current.dropTargets,input:C(p)},!u.current.dropTargets.length){d();return}p.preventDefault(),ie({event:p,current:u.current.dropTargets}),l.drop({current:u.current,updatedSourcePayload:t.type==="external"?t.getDropPayload(p):null}),f()}},{type:"dragend",listener:function s(p){u.current={dropTargets:u.current.dropTargets,input:C(p)},d()}}].concat(J(Re({onDragEnd:d}))),{capture:!0});l.start({nativeSetDragImage:xt(r)})}function ie(e){var r,{event:t,current:n}=e,o=(r=n[0])===null||r===void 0?void 0:r.dropEffect;if(o!=null&&t.dataTransfer)t.dataTransfer.dropEffect=o}function Dt(e){var{event:r,dragType:t,getDropTargetsOver:n}=e,o=C(r);if(t.startedFrom==="external")return{input:o,dropTargets:[]};var i=n({input:o,source:t.payload,target:r.target,current:[]});return{input:o,dropTargets:i}}var le={canStart:Be,start:wt};var ce=new Map;function At(e){var{typeKey:r,mount:t}=e,n=ce.get(r);if(n)return n.usageCount++,n;var o={typeKey:r,unmount:t(),usageCount:1};return ce.set(r,o),o}function Ve(e){var r=At(e);return function t(){if(r.usageCount--,r.usageCount>0)return;r.unmount(),ce.delete(e.typeKey)}}function gr(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];return function n(){r.forEach(function(o){return o()})}}function ee(e,r){var{attribute:t,value:n}=r;return e.setAttribute(t,n),function(){return e.removeAttribute(t)}}function qe(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),t.push.apply(t,n)}return t}function F(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?qe(Object(t),!0).forEach(function(n){ga(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):qe(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function se(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=Ot(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,o=function a(){};return{s:o,n:function a(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function a(c){throw c},f:o}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
4
4
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,u=!0,l=!1;return{s:function a(){t=t.call(e)},n:function a(){var c=t.next();return u=c.done,c},e:function a(c){l=!0,i=c},f:function a(){try{u||t.return==null||t.return()}finally{if(l)throw i}}}}function Ot(e,r){if(e){if(typeof e=="string")return ze(e,r);var t={}.toString.call(e).slice(8,-1);return t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set"?Array.from(e):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?ze(e,r):void 0}}function ze(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}function pe(e){return e.slice(0).reverse()}function Ge(e){var{typeKey:r,defaultDropEffect:t}=e,n=new WeakMap,o="data-drop-target-for-".concat(r),i="[".concat(o,"]");function u(s){return n.set(s.element,s),function(){return n.delete(s.element)}}function l(s){if(!1)var p;var m=gr(ee(s.element,{attribute:o,value:"true"}),u(s));return A(m)}function a(s){var p,m,g,D,{source:y,target:h,input:b,result:T}=s,v=T===void 0?[]:T;if(h==null)return v;if(!(h instanceof Element)){if(h instanceof Node)return a({source:y,target:h.parentElement,input:b,result:v});return v}var P=h.closest(i);if(P==null)return v;var x=n.get(P);if(x==null)return v;var E={input:b,source:y,element:x.element};if(x.canDrop&&!x.canDrop(E))return a({source:y,target:x.element.parentElement,input:b,result:v});var S=(p=(m=x.getData)===null||m===void 0?void 0:m.call(x,E))!==null&&p!==void 0?p:{},j=(g=(D=x.getDropEffect)===null||D===void 0?void 0:D.call(x,E))!==null&&g!==void 0?g:t,O={data:S,element:x.element,dropEffect:j,isActiveDueToStickiness:!1};return a({source:y,target:x.element.parentElement,input:b,result:[].concat(J(v),[O])})}function c(s){var{eventName:p,payload:m}=s,g=se(m.location.current.dropTargets),D;try{for(g.s();!(D=g.n()).done;){var y,h=D.value,b=n.get(h.element),T=F(F({},m),{},{self:h});b===null||b===void 0||(y=b[p])===null||y===void 0||y.call(b,T)}}catch(v){g.e(v)}finally{g.f()}}var d={onGenerateDragPreview:c,onDrag:c,onDragStart:c,onDrop:c,onDropTargetChange:function s(p){var m=p.payload,g=new Set(m.location.current.dropTargets.map(function(K){return K.element})),D=new Set,y=se(m.location.previous.dropTargets),h;try{for(y.s();!(h=y.n()).done;){var b,T=h.value;D.add(T.element);var v=n.get(T.element),P=g.has(T.element),x=F(F({},m),{},{self:T});if(v===null||v===void 0||(b=v.onDropTargetChange)===null||b===void 0||b.call(v,x),!P){var E;v===null||v===void 0||(E=v.onDragLeave)===null||E===void 0||E.call(v,x)}}}catch(K){y.e(K)}finally{y.f()}var S=se(m.location.current.dropTargets),j;try{for(S.s();!(j=S.n()).done;){var O,M,re=j.value;if(D.has(re.element))continue;var ve=F(F({},m),{},{self:re}),I=n.get(re.element);I===null||I===void 0||(O=I.onDropTargetChange)===null||O===void 0||O.call(I,ve),I===null||I===void 0||(M=I.onDragEnter)===null||M===void 0||M.call(I,ve)}}catch(K){S.e(K)}finally{S.f()}}};function f(s){d[s.eventName](s)}function w(s){var{source:p,target:m,input:g,current:D}=s,y=a({source:p,target:m,input:g});if(y.length>=D.length)return y;var h=pe(D),b=pe(y),T=[];for(var v=0;v<h.length;v++){var P,x=h[v],E=b[v];if(E!=null){T.push(E);continue}var S=T[v-1],j=h[v-1];if((S===null||S===void 0?void 0:S.element)!==(j===null||j===void 0?void 0:j.element))break;var O=n.get(x.element);if(!O)break;var M={input:g,source:p,element:O.element};if(O.canDrop&&!O.canDrop(M))break;if(!((P=O.getIsSticky)!==null&&P!==void 0&&P.call(O,M)))break;T.push(F(F({},x),{},{isActiveDueToStickiness:!0}))}return pe(T)}return{dropTargetForConsumers:l,getIsOver:w,dispatchEvent:f}}function Et(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=St(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,o=function a(){};return{s:o,n:function a(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function a(c){throw c},f:o}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
5
5
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,u=!0,l=!1;return{s:function a(){t=t.call(e)},n:function a(){var c=t.next();return u=c.done,c},e:function a(c){l=!0,i=c},f:function a(){try{u||t.return==null||t.return()}finally{if(l)throw i}}}}function St(e,r){if(e){if(typeof e=="string")return Ze(e,r);var t={}.toString.call(e).slice(8,-1);return t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set"?Array.from(e):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Ze(e,r):void 0}}function Ze(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}function $e(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),t.push.apply(t,n)}return t}function Pt(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?$e(Object(t),!0).forEach(function(n){ga(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):$e(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function Je(){var e=new Set,r=null;function t(i){if(!r)return;if(!i.canMonitor||i.canMonitor(r.canMonitorArgs))r.active.add(i)}function n(i){var u=Pt({},i);e.add(u),t(u);function l(){if(e.delete(u),r)r.active.delete(u)}return A(l)}function o(i){var{eventName:u,payload:l}=i;if(u==="onGenerateDragPreview"){r={canMonitorArgs:{initial:l.location.initial,source:l.source},active:new Set};var a=Et(e),c;try{for(a.s();!(c=a.n()).done;){var d=c.value;t(d)}}catch(g){a.e(g)}finally{a.f()}}if(!r)return;var f=Array.from(r.active);for(var w=0,s=f;w<s.length;w++){var p=s[w];if(r.active.has(p)){var m;(m=p[u])===null||m===void 0||m.call(p,l)}}if(u==="onDrop")r.active.clear(),r=null}return{dispatchEvent:o,monitorForConsumers:n}}function Qe(e){var{typeKey:r,mount:t,dispatchEventToSource:n,onPostDispatch:o,defaultDropEffect:i}=e,u=Je(),l=Ge({typeKey:r,defaultDropEffect:i});function a(f){n===null||n===void 0||n(f),l.dispatchEvent(f),u.dispatchEvent(f),o===null||o===void 0||o(f)}function c(f){var{event:w,dragType:s}=f;le.start({event:w,dragType:s,getDropTargetsOver:l.getIsOver,dispatchEvent:a})}function d(){function f(){var w={canStart:le.canStart,start:c};return t(w)}return Ve({typeKey:r,mount:f})}return{registerUsage:d,dropTarget:l.dropTargetForConsumers,monitor:u.monitorForConsumers}}var _e=A(function e(){return navigator.userAgent.toLocaleLowerCase().includes("android")}),et="pdnd:android-fallback";var fe="text/plain";var tt="text/uri-list";var rt="application/vnd.pdnd";var te=new WeakMap;function jt(e){return te.set(e.element,e),function r(){te.delete(e.element)}}var nt=Fe(),de=Qe({typeKey:"element",defaultDropEffect:"move",mount:function e(r){return gr(nt.bindEvents(),ot.bind(document,{type:"dragstart",listener:function t(n){var o,i,u,l,a,c;if(!r.canStart(n))return;if(n.defaultPrevented)return;if(!n.dataTransfer)return;var d=n.target;if(!(d instanceof HTMLElement))return;var f=te.get(d);if(!f)return;var w=C(n),s={element:f.element,dragHandle:(o=f.dragHandle)!==null&&o!==void 0?o:null,input:w};if(f.canDrag&&!f.canDrag(s)){n.preventDefault();return}if(f.dragHandle){var p=G({x:w.clientX,y:w.clientY});if(!f.dragHandle.contains(p)){n.preventDefault();return}}var m=(i=(u=f.getInitialDataForExternal)===null||u===void 0?void 0:u.call(f,s))!==null&&i!==void 0?i:null;if(m)for(var g=0,D=Object.entries(m);g<D.length;g++){var y=B(D[g],2),h=y[0],b=y[1];n.dataTransfer.setData(h,b!==null&&b!==void 0?b:"")}if(_e()&&!n.dataTransfer.types.includes(fe)&&!n.dataTransfer.types.includes(tt))n.dataTransfer.setData(fe,et);n.dataTransfer.setData(rt,"");var T={element:f.element,dragHandle:(l=f.dragHandle)!==null&&l!==void 0?l:null,data:(a=(c=f.getInitialData)===null||c===void 0?void 0:c.call(f,s))!==null&&a!==void 0?a:{}},v={type:"element",payload:T,startedFrom:"internal"};r.start({event:n,dragType:v})}}))},dispatchEventToSource:function e(r){var t,n,{eventName:o,payload:i}=r;(t=te.get(i.source.element))===null||t===void 0||(n=t[o])===null||n===void 0||n.call(t,i)},onPostDispatch:nt.getOnPostDispatch()}),{dropTarget:zs,monitor:Ws}=de;function gs(e){if(!1)var r;var t=gr(de.registerUsage(),jt(e),ee(e.element,{attribute:"draggable",value:"true"}));return A(t)}export{ga,gr,zs,Ws,gs};
|
|
6
6
|
|
|
7
|
-
//# debugId=
|
|
8
|
-
//# sourceMappingURL=studio-
|
|
7
|
+
//# debugId=5C8A290D1659961464756E2164756E21
|
|
8
|
+
//# sourceMappingURL=studio-st75kn99.js.map
|
|
@@ -2,7 +2,7 @@ var C=globalThis,O=(t)=>t,b=C.trustedTypes,j=b?b.createPolicy("lit-html",{create
|
|
|
2
2
|
\f\r](?:([^\\s"'>=/]+)([
|
|
3
3
|
\f\r]*=[
|
|
4
4
|
\f\r]*(?:[^
|
|
5
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),R=/'/g,V=/"/g,z=/^(?:script|style|textarea|title)$/i,E=(t)=>(e,...s)=>({_$litType$:t,strings:e,values:s}),br=E(1),J=E(2),K=E(3),Bl=Symbol.for("lit-noChange"),tt=Symbol.for("lit-nothing"),W=new WeakMap,u=g.createTreeWalker(g,129);function Z(t,e){if(!w(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return j!==void 0?j.createHTML(e):e}var k=(t,e)=>{let s=t.length-1,i=[],n,l=e===2?"<svg>":e===3?"<math>":"",r=y;for(let o=0;o<s;o++){let a=t[o],T,h,A=-1,_=0;for(;_<a.length&&(r.lastIndex=_,h=r.exec(a),h!==null);)_=r.lastIndex,r===y?h[1]==="!--"?r=D:h[1]!==void 0?r=L:h[2]!==void 0?(z.test(h[2])&&(n=RegExp("</"+h[2],"g")),r=p):h[3]!==void 0&&(r=p):r===p?h[0]===">"?(r=n??y,A=-1):h[1]===void 0?A=-2:(A=r.lastIndex-h[2].length,T=h[1],r=h[3]===void 0?p:h[3]==='"'?V:R):r===V||r===R?r=p:r===D||r===L?r=y:(r=p,n=void 0);let d=r===p&&t[o+1].startsWith("/>")?" ":"";l+=r===y?a+q:A>=0?(i.push(T),a.slice(0,A)+"$lit$"+a.slice(A)+c+d):a+c+(A===-2?o:d)}return[Z(t,l+(t[s]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]};class N{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let n=0,l=0,r=t.length-1,o=this.parts,[a,T]=k(t,e);if(this.el=N.createElement(a,s),u.currentNode=this.el.content,e===2||e===3){let h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(i=u.nextNode())!==null&&o.length<r;){if(i.nodeType===1){if(i.hasAttributes())for(let h of i.getAttributeNames())if(h.endsWith("$lit$")){let A=T[l++],_=i.getAttribute(h).split(c),d=/([.?@])?(.*)/.exec(A);o.push({type:1,index:n,name:d[2],strings:_,ctor:d[1]==="."?I:d[1]==="?"?S:d[1]==="@"?P:v}),i.removeAttribute(h)}else h.startsWith(c)&&(o.push({type:6,index:n}),i.removeAttribute(h));if(z.test(i.tagName)){let h=i.textContent.split(c),A=h.length-1;if(A>0){i.textContent=b?b.emptyScript:"";for(let _=0;_<A;_++)i.append(h[_],x()),u.nextNode(),o.push({type:2,index:++n});i.append(h[A],x())}}}else if(i.nodeType===8)if(i.data===M)o.push({type:2,index:n});else{let h=-1;for(;(h=i.data.indexOf(c,h+1))!==-1;)o.push({type:7,index:n}),h+=c.length-1}n++}}static createElement(t,e){let s=g.createElement("template");return s.innerHTML=t,s}}function f(t,e,s=t,i){if(e===Bl)return e;let n=i!==void 0?s._$Co?.[i]:s._$Cl,l=H(e)?void 0:e._$litDirective$;return n?.constructor!==l&&(n?._$AO?.(!1),l===void 0?n=void 0:(n=new l(t),n._$AT(t,s,i)),i!==void 0?(s._$Co??=[])[i]=n:s._$Cl=n),n!==void 0&&(e=f(t,n._$AS(t,e.values),n,i)),e}class B{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:e},parts:s}=this._$AD,i=(t?.creationScope??g).importNode(e,!0);u.currentNode=i;let n=u.nextNode(),l=0,r=0,o=s[0];for(;o!==void 0;){if(l===o.index){let a;o.type===2?a=new m(n,n.nextSibling,this,t):o.type===1?a=new o.ctor(n,o.name,o.strings,this,t):o.type===6&&(a=new U(n,this,t)),this._$AV.push(a),o=s[++r]}l!==o?.index&&(n=u.nextNode(),l++)}return u.currentNode=g,i}p(t){let e=0;for(let s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class m{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,s,i){this.type=2,this._$AH=tt,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=f(this,t,e),H(t)?t===tt||t==null||t===""?(this._$AH!==tt&&this._$AR(),this._$AH=tt):t!==this._$AH&&t!==Bl&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):F(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==tt&&H(this._$AH)?this._$AA.nextSibling.data=t:this.T(g.createTextNode(t)),this._$AH=t}$(t){let{values:e,_$litType$:s}=t,i=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=N.createElement(Z(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===i)this._$AH.p(e);else{let n=new B(i,this),l=n.u(this.options);n.p(e),this.T(l),this._$AH=n}}_$AC(t){let e=W.get(t.strings);return e===void 0&&W.set(t.strings,e=new N(t)),e}k(t){w(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,s,i=0;for(let n of t)i===e.length?e.push(s=new m(this.O(x()),this.O(x()),this,this.options)):s=e[i],s._$AI(n),i++;i<e.length&&(this._$AR(s&&s._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){let s=O(t).nextSibling;O(t).remove(),t=s}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}}class v{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,i,n){this.type=1,this._$AH=tt,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=n,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=tt}_$AI(t,e=this,s,i){let n=this.strings,l=!1;if(n===void 0)t=f(this,t,e,0),l=!H(t)||t!==this._$AH&&t!==Bl,l&&(this._$AH=t);else{let r=t,o,a;for(t=n[0],o=0;o<n.length-1;o++)a=f(this,r[s+o],e,o),a===Bl&&(a=this._$AH[o]),l||=!H(a)||a!==this._$AH[o],a===tt?t=tt:t!==tt&&(t+=(a??"")+n[o+1]),this._$AH[o]=a}l&&!i&&this.j(t)}j(t){t===tt?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class I extends v{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===tt?void 0:t}}class S extends v{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==tt)}}class P extends v{constructor(t,e,s,i,n){super(t,e,s,i,n),this.type=5}_$AI(t,e=this){if((t=f(this,t,e,0)??tt)===Bl)return;let s=this._$AH,i=t===tt&&s!==tt||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,n=t!==tt&&(s===tt||i);i&&this.element.removeEventListener(this.name,this,s),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class U{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){f(this,t)}}var
|
|
5
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),R=/'/g,V=/"/g,z=/^(?:script|style|textarea|title)$/i,E=(t)=>(e,...s)=>({_$litType$:t,strings:e,values:s}),br=E(1),J=E(2),K=E(3),Bl=Symbol.for("lit-noChange"),tt=Symbol.for("lit-nothing"),W=new WeakMap,u=g.createTreeWalker(g,129);function Z(t,e){if(!w(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return j!==void 0?j.createHTML(e):e}var k=(t,e)=>{let s=t.length-1,i=[],n,l=e===2?"<svg>":e===3?"<math>":"",r=y;for(let o=0;o<s;o++){let a=t[o],T,h,A=-1,_=0;for(;_<a.length&&(r.lastIndex=_,h=r.exec(a),h!==null);)_=r.lastIndex,r===y?h[1]==="!--"?r=D:h[1]!==void 0?r=L:h[2]!==void 0?(z.test(h[2])&&(n=RegExp("</"+h[2],"g")),r=p):h[3]!==void 0&&(r=p):r===p?h[0]===">"?(r=n??y,A=-1):h[1]===void 0?A=-2:(A=r.lastIndex-h[2].length,T=h[1],r=h[3]===void 0?p:h[3]==='"'?V:R):r===V||r===R?r=p:r===D||r===L?r=y:(r=p,n=void 0);let d=r===p&&t[o+1].startsWith("/>")?" ":"";l+=r===y?a+q:A>=0?(i.push(T),a.slice(0,A)+"$lit$"+a.slice(A)+c+d):a+c+(A===-2?o:d)}return[Z(t,l+(t[s]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]};class N{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let n=0,l=0,r=t.length-1,o=this.parts,[a,T]=k(t,e);if(this.el=N.createElement(a,s),u.currentNode=this.el.content,e===2||e===3){let h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(i=u.nextNode())!==null&&o.length<r;){if(i.nodeType===1){if(i.hasAttributes())for(let h of i.getAttributeNames())if(h.endsWith("$lit$")){let A=T[l++],_=i.getAttribute(h).split(c),d=/([.?@])?(.*)/.exec(A);o.push({type:1,index:n,name:d[2],strings:_,ctor:d[1]==="."?I:d[1]==="?"?S:d[1]==="@"?P:v}),i.removeAttribute(h)}else h.startsWith(c)&&(o.push({type:6,index:n}),i.removeAttribute(h));if(z.test(i.tagName)){let h=i.textContent.split(c),A=h.length-1;if(A>0){i.textContent=b?b.emptyScript:"";for(let _=0;_<A;_++)i.append(h[_],x()),u.nextNode(),o.push({type:2,index:++n});i.append(h[A],x())}}}else if(i.nodeType===8)if(i.data===M)o.push({type:2,index:n});else{let h=-1;for(;(h=i.data.indexOf(c,h+1))!==-1;)o.push({type:7,index:n}),h+=c.length-1}n++}}static createElement(t,e){let s=g.createElement("template");return s.innerHTML=t,s}}function f(t,e,s=t,i){if(e===Bl)return e;let n=i!==void 0?s._$Co?.[i]:s._$Cl,l=H(e)?void 0:e._$litDirective$;return n?.constructor!==l&&(n?._$AO?.(!1),l===void 0?n=void 0:(n=new l(t),n._$AT(t,s,i)),i!==void 0?(s._$Co??=[])[i]=n:s._$Cl=n),n!==void 0&&(e=f(t,n._$AS(t,e.values),n,i)),e}class B{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:e},parts:s}=this._$AD,i=(t?.creationScope??g).importNode(e,!0);u.currentNode=i;let n=u.nextNode(),l=0,r=0,o=s[0];for(;o!==void 0;){if(l===o.index){let a;o.type===2?a=new m(n,n.nextSibling,this,t):o.type===1?a=new o.ctor(n,o.name,o.strings,this,t):o.type===6&&(a=new U(n,this,t)),this._$AV.push(a),o=s[++r]}l!==o?.index&&(n=u.nextNode(),l++)}return u.currentNode=g,i}p(t){let e=0;for(let s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class m{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,s,i){this.type=2,this._$AH=tt,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=f(this,t,e),H(t)?t===tt||t==null||t===""?(this._$AH!==tt&&this._$AR(),this._$AH=tt):t!==this._$AH&&t!==Bl&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):F(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==tt&&H(this._$AH)?this._$AA.nextSibling.data=t:this.T(g.createTextNode(t)),this._$AH=t}$(t){let{values:e,_$litType$:s}=t,i=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=N.createElement(Z(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===i)this._$AH.p(e);else{let n=new B(i,this),l=n.u(this.options);n.p(e),this.T(l),this._$AH=n}}_$AC(t){let e=W.get(t.strings);return e===void 0&&W.set(t.strings,e=new N(t)),e}k(t){w(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,s,i=0;for(let n of t)i===e.length?e.push(s=new m(this.O(x()),this.O(x()),this,this.options)):s=e[i],s._$AI(n),i++;i<e.length&&(this._$AR(s&&s._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){let s=O(t).nextSibling;O(t).remove(),t=s}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}}class v{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,i,n){this.type=1,this._$AH=tt,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=n,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=tt}_$AI(t,e=this,s,i){let n=this.strings,l=!1;if(n===void 0)t=f(this,t,e,0),l=!H(t)||t!==this._$AH&&t!==Bl,l&&(this._$AH=t);else{let r=t,o,a;for(t=n[0],o=0;o<n.length-1;o++)a=f(this,r[s+o],e,o),a===Bl&&(a=this._$AH[o]),l||=!H(a)||a!==this._$AH[o],a===tt?t=tt:t!==tt&&(t+=(a??"")+n[o+1]),this._$AH[o]=a}l&&!i&&this.j(t)}j(t){t===tt?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class I extends v{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===tt?void 0:t}}class S extends v{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==tt)}}class P extends v{constructor(t,e,s,i,n){super(t,e,s,i,n),this.type=5}_$AI(t,e=this){if((t=f(this,t,e,0)??tt)===Bl)return;let s=this._$AH,i=t===tt&&s!==tt||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,n=t!==tt&&(s===tt||i);i&&this.element.removeEventListener(this.name,this,s),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class U{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){f(this,t)}}var bk={M:"$lit$",P:c,A:M,C:1,L:k,R:B,D:F,V:f,I:m,H:v,N:S,U:P,B:I,F:U},G=C.litHtmlPolyfillSupport;G?.(N,m),(C.litHtmlVersions??=[]).push("3.3.3");var Ni=(t,e,s)=>{let i=s?.renderBefore??e,n=i._$litPart$;if(n===void 0){let l=s?.renderBefore??null;i._$litPart$=n=new m(e.insertBefore(x(),l),l,void 0,s??{})}return n._$AI(t),n};export{br,Bl,tt,bk,Ni};
|
|
6
6
|
|
|
7
|
-
//# debugId=
|
|
8
|
-
//# sourceMappingURL=studio-
|
|
7
|
+
//# debugId=732581C40428621064756E2164756E21
|
|
8
|
+
//# sourceMappingURL=studio-sxc0zvpt.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
var e=new Map,r=new Set;function o(){for(let t of r)t()}function ja(){o()}function db(t){return r.add(t),()=>{r.delete(t)}}function cs(t){e.set(t.key,t),o()}function x1(t){if(e.delete(t))o()}function Vf(){return[...e.values()].toSorted((t,s)=>t.order-s.order)}function Lw(){return Vf().map((t)=>t.key)}function Iw(t){return e.get(t)}var i=null,n="overview";function ub(){if(i!==null&&e.has(i))return n=i,i=null,n;if(e.has(n))return n;return Lw()[0]??n}function hb(t){if(e.has(t))n=t,i=null;else i=t;o()}export{ja,db,cs,x1,Vf,Lw,Iw,ub,hb};
|
|
2
|
+
|
|
3
|
+
//# debugId=2A602E1D78BE302464756E2164756E21
|
|
4
|
+
//# sourceMappingURL=studio-t1eedsyx.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{te}from"./studio-ery42sqr.js";import{p}from"./studio-6k1eswp9.js";import{v,S}from"./studio-0nm2skex.js";import{fd,Eu}from"./studio-jsr14n1s.js";import{xi,T,R}from"./studio-z1vdxq0e.js";import{dd}from"./studio-gxna6yta.js";import{IE}from"./studio-z47mm077.js";import{Ab}from"./studio-pvj970st.js";import{Sd}from"./studio-w8w9frjy.js";import{D}from"./studio-153mwkyq.js";var N={$schema:"https://jxsuite.com/schema/v1",$id:"StudioSettingsContributed",$description:'The generic settings section behind `$studio.settings` (specs/extensions.md §9.1), as a Jx document over the kit. One document serves both layouts an extension may declare: "form" is a single schema form over the whole section value, "map" is master-detail — the entry keys on the left, the selected entry\'s form on the right. The adapter (`surfaces/settings-contributed.ts`) hands in the title, the layout, the entry rows already marked as selected, and whatever the reader is part-way through typing; `settings/contributed-section.ts` decides what an entry may be named, what reaches `project.json`, and what the validator said about it. The schema form itself is an ISLAND: this document renders `form-host` and nothing inside it, because a form built from a JSON Schema is `ui/schema-form.ts`\'s surface rather than this one\'s — the section places the element that surface hands back. The actions row is the second island: `panels/data-grid.ts` contributes it, and that one is still lit over Spectrum.',tagName:"section",attributes:{part:"contributed"},style:{$description:"What `.settings-section-title`, `.settings-two-col`, `.settings-list-panel`, `.settings-editor-panel`, `.settings-editor-header`, `.settings-empty-state` and `.settings-inline-form` said in `styles/overlays.css`, keyed on `part` and re-pointed at the studio token layer. This section was the LAST emitter of every one of them except `.settings-empty-state`, which `panels/settings-pane.ts` still writes when a project closes with the editor open — so those rules are dead in the stylesheet from here, and a central sweep removes them rather than this change, which owns no stylesheet. Two values could not come across. `.settings-editor-header h3` read `var(--spectrum-font-size-100, 14px)`, and a document is mounted in the pane rather than inside `<sp-theme>`, so it would have taken its hard-coded fallback every time; the entry name is a kit textfield now and carries the kit's own type ramp. And `.entry-name-input`, `.settings-form-panel`, `.settings-section` and `.contributed-section` had no rule anywhere at all — they were four entries on `check-styles.ts`'s orphan ledger, which is the ledger's point.",display:"block",'& [part="title"]':{margin:"0 0 16px",fontSize:"16px",fontWeight:"600",color:"var(--fg)"},'& [part="actions"]':{$description:"The host-contributed actions row — Test Connection, Push Schema, Open Data Grid on the data sections. `.data-section-actions` never had a rule anywhere, so the row was whatever the buttons stacked up to; it is a row with a gap under it now.",display:"flex",alignItems:"center",flexWrap:"wrap",gap:"8px",marginBottom:"12px"},'& [part="columns"]':{$description:"The 1px gap over the border colour is the divider between the two columns: two panels on `--bg-panel` with `--border` showing through the gap, so nothing draws a rule of its own.",display:"flex",height:"100%",gap:"1px",background:"var(--border)"},'& [part="list"]':{display:"flex",flexDirection:"column",gap:"4px",padding:"12px",width:"200px",minWidth:"200px",background:"var(--bg-panel)",overflowY:"auto"},'& [part="entry"], & [part="new-open"]':{width:"100%"},'& [part="entry"] > [part="control"], & [part="new-open"] > [part="control"]':{$description:"`.settings-list-panel sp-action-button` said `width: 100%; justify-content: flex-start`, and both halves belong to the button the row is made of rather than to the row: a kit action button centres its glyph and its label, which reads as a list of centred names.",width:"100%",justifyContent:"flex-start"},'& [part="new-form"]':{display:"flex",alignItems:"center",gap:"6px"},'& [part="new-field"]':{flex:"1",minWidth:"0"},'& [part="empty"]':{flex:"1",display:"flex",alignItems:"center",justifyContent:"center",background:"var(--bg-panel)",color:"var(--fg-dim)",fontSize:"13px"},'& [part="editor"]':{$description:"`min-width: 0` is the one line `.settings-editor-panel` did not have and needed: a flex child's floor is its content, and the schema form inside this one is a whole form rather than the short cards Data Shapes puts here — so a long pointer or a wide row pushed the column past the right edge of the pane instead of scrolling inside it.",flex:"1",padding:"16px",background:"var(--bg-panel)",overflowY:"auto",minWidth:"0"},'& [part="editor-header"]':{display:"flex",alignItems:"center",gap:"12px",marginBottom:"16px"},'& [part="entry-name"]':{flex:"1",minWidth:"0",maxWidth:"220px"}},children:[{tagName:"h3",attributes:{part:"title"},textContent:"${state.title}"},{tagName:"div",attributes:{part:"actions-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/actionsState"},cases:{slot:{$description:"An island: the host renders its own actions into this node and the document renders nothing inside it.",tagName:"div",attributes:{part:"actions"}}}},{tagName:"div",attributes:{part:"body-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/layout"},cases:{form:{$description:"An island: `ui/schema-form.ts` draws the whole section value into this node.",tagName:"div",attributes:{part:"form-host"}},map:{tagName:"div",attributes:{part:"columns"},children:[{tagName:"div",attributes:{part:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/entries"},key:{$ref:"$map/item/key"},map:{tagName:"jx-action-button",attributes:{part:"entry","data-entry":"${$map.item.key}","data-jx-region":"${$map.item.region}"},$props:{label:"${$map.item.key}",selected:{$ref:"$map/item/selected"},quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/select"},value:[{$ref:"$map/item/key"}]}]},children:[{tagName:"span",textContent:"${$map.item.key}"}]}},{tagName:"div",attributes:{part:"new-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/newState"},cases:{closed:{tagName:"jx-action-button",attributes:{part:"new-open"},$props:{label:"New Entry",icon:"plus",quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openNew"},value:[]}]},children:[{tagName:"span",textContent:"New Entry"}]},open:{tagName:"div",attributes:{part:"new-form"},children:[{tagName:"jx-textfield",attributes:{part:"new-field"},$props:{label:"New entry name",placeholder:"entry-name",size:"sm",value:{$ref:"#/state/newName"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editNew"},value:[{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{Enter:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/createNew"},value:[]}],Escape:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/cancelNew"},value:[]}]}}]}},{tagName:"jx-button",attributes:{part:"new-create"},$props:{size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/createNew"},value:[]}]},children:[{tagName:"span",textContent:"Create"}]}]}}}]},{tagName:"div",attributes:{part:"editor-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/editorState"},cases:{empty:{tagName:"div",attributes:{part:"empty"},textContent:"Select or create an entry"},editing:{tagName:"div",attributes:{part:"editor","data-jx-region":"${state.editorRegion}"},children:[{tagName:"div",attributes:{part:"editor-header"},children:[{tagName:"jx-textfield",attributes:{part:"entry-name"},$props:{label:"Entry name",size:"sm",value:{$ref:"#/state/entryName"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/renameEntry"},value:[{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{Enter:[{operator:"call",target:{$ref:"#/state/renameEntry"},value:[{$ref:"event#/target/value"}]}],Escape:[{operator:"call",target:{$ref:"#/state/cancelRename"},value:[{$ref:"event#/target/value"}]}]}}]}},{tagName:"jx-action-button",attributes:{part:"delete-entry"},$props:{label:"Delete entry",hint:"Delete entry",icon:"trash",quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/removeEntry"},value:[]}]}}]},{$description:"An island: `ui/schema-form.ts` draws the selected entry into this node.",tagName:"div",attributes:{part:"form-host"}}]}}}]}}}]};T("settings-contributed",N);function V(){return{actionsState:"none",editorRegion:"",editorState:"empty",entries:[],entryName:"",layout:"form",newName:"",newState:"closed",title:""}}function W(e){let o=e?.attributes?.part;return typeof o==="string"?o:""}function j(e,i,o){e.textContent="";let n=v({...V(),...i}),t=null,r=!1,a=R("settings-contributed",n,e,{onNodeCreated:(s,l,d)=>{if(!(s instanceof HTMLElement))return;let c=W(d);if(c==="form-host")o.formSlot(s);else if(c==="actions")o.actionsSlot(s)}}).then((s)=>{if(r)return s.dispose(),s.root;return t=s,s.root});return{attached:()=>{if(r)return!1;let s=t?.root;return s===void 0?!0:s instanceof HTMLElement&&e.contains(s)},dispose(){r=!0,t?.dispose(),t=null},host:e,ready:a,update(s){n.actionsState=s.actionsState,n.editorRegion=s.editorRegion,n.editorState=s.editorState,n.entries=s.entries,n.entryName=s.entryName,n.layout=s.layout,n.newName=s.newName,n.newState=s.newState,n.title=s.title}}}var f=new Map,b=new Set,w=new Map;function TE(e,i){let o=D?.projectConfig?.[e],n=o&&typeof o==="object"&&!Array.isArray(o)?o:{};if(!Object.hasOwn(n,i))return Object.keys(n);return f.set(e,i),null}var x=new Map;function I(e,i){let o={},n=[];for(let t of i){let r=t.indexOf(": "),a=r===-1?"":t.slice(0,r),s=r===-1?t:t.slice(r+2);if(a===e){n.push(s);continue}if(!a.startsWith(`${e}/`))continue;let[l]=a.slice(e.length+1).split("/");if(l&&o[l]===void 0)o[l]=s}return{fields:o,section:n}}async function k(e,i){let o=D.projectConfig;if(!(await Sd()).ok)return;let t=[];try{t=await dd(o)}catch(r){S.warn(`Could not validate project.json — ${te(r)}`,{key:"settings:validator",path:"project.json",source:"Settings",tier:"problem"});return}x.set(e,I(e,t).fields),i()}function E(e,i){for(let[o,n]of Object.entries(i))if(n===void 0)delete e[o];else e[o]=n}function H(e){return e.toLowerCase().replaceAll(/\s+/g,"-").replaceAll(/[^a-z0-9-]/g,"")}function J(e,i){if(!e)return{};let o=(n)=>{if(typeof n==="string")return n.replaceAll("${key}",i);if(Array.isArray(n))return n.map((t)=>o(t));if(n&&typeof n==="object"){let t={};for(let[r,a]of Object.entries(n))t[r]=o(a);return t}return n};return o(e)}function M(e,i,o=null){let n=p();return{fieldKeyPrefix:`$settings.${e}`,resolvePointer:(t,r)=>Eu(t,{projectConfig:D?.projectConfig??{},...r!==void 0&&{scope:r},...i.formats!==void 0&&{formats:i.formats}}),...typeof n.setSecrets==="function"?{commitSecret:async(t,r)=>{let a=IE(e,o,t);return await n.setSecrets({set:{[a]:r}}),a}}:{}}}function h(e){let i=D?.projectConfig;if(!i)return null;let o=i[e];if(o&&typeof o==="object"&&!Array.isArray(o))return o;let n={};return i[e]=n,n}var A=new WeakMap;function m(e){x1(e.container,e.contribution,e.opts)}function O(e,i){e.echo=i,m(e)}function K(e){let{container:i,contribution:o,opts:n}=e,t=o.key,r=o.title??t,a=n.actions?"slot":"none",s=Ab(i),l=xi(s,"editor");if((o.settings.layout??"form")!=="map")return{actionsState:a,editorRegion:l,editorState:"empty",entries:[],entryName:"",layout:"form",newName:"",newState:"closed",title:r};let d=h(t)??{},c=f.get(t)??null,g=c===null?void 0:d[c],y=c!==null&&g!==void 0&&g!==null&&typeof g==="object";return{actionsState:a,editorRegion:l,editorState:y?"editing":"empty",entries:Object.keys(d).map((u)=>({key:u,region:xi(s,`entry:${u}`),selected:u===c})),entryName:e.echo??(y?c:""),layout:"map",newName:w.get(t)??"",newState:b.has(t)?"open":"closed",title:r}}function L(e){let i=e.formHost;if(!i)return;let{contribution:o,opts:n}=e,t=o.key,r=o.settings.entry?.ui,a=()=>m(e),s=(u)=>{if(u.parentNode!==i)i.replaceChildren(u)};if((o.settings.layout??"form")!=="map"){let u=`/${t}`;s(fd(`section:${t}`,o.entrySchema,h(t)??{},{context:M(t,n,null),errors:x.get(u)??{},onChange:(P)=>{let C=h(t);if(!C)return;E(C,P),a(),k(u,a)},rerender:a,...r!==void 0&&{ui:r}}));return}let l=h(t)??{},d=f.get(t)??null,c=d===null?void 0:l[d];if(d===null||!c||typeof c!=="object"){i.replaceChildren();return}let g=c,y=`/${t}/${d}`;s(fd(`section:${t}:${d}`,o.entrySchema,g,{context:M(t,n,d),errors:x.get(y)??{},onChange:(u)=>{E(g,u),a(),k(y,a)},rerender:a,...r!==void 0&&{ui:r}}))}function F(e){let i=e.actionsHost,{actions:o}=e.opts;if(!i)return;if(!o){i.replaceChildren();return}let n=e.contribution.key,t=(e.contribution.settings.layout??"form")==="map"?f.get(n)??null:null;o(i,{rerender:()=>m(e),sectionKey:n,selected:t})}function q(e){let i=(t)=>{e.echo=null,m(e),k(t,()=>m(e))},o=()=>{e.echo=null,m(e)},n=()=>e.contribution.key;return{cancelNew(){b.delete(n()),w.delete(n()),m(e)},cancelRename(t){O(e,t),o()},createNew(){let t=n(),r=H(w.get(t)??""),a=h(t);if(!r||!a||a[r])return;a[r]=J(e.contribution.settings.entry?.newEntry,r),f.set(t,r),b.delete(t),w.delete(t),i(`/${t}`)},editNew(t){w.set(n(),t),m(e)},openNew(){b.add(n()),m(e)},removeEntry(){let t=n(),r=f.get(t)??null,a=h(t);if(!r||!a?.[r])return;delete a[r],f.set(t,null),i(`/${t}`)},renameEntry(t){O(e,t);let r=n(),a=f.get(r)??null,s=h(r),l=H(t.trim());if(!a||!s||!l||l===a||s[l]){o();return}let d={};for(let[c,g]of Object.entries(s))d[c===a?l:c]=g,delete s[c];Object.assign(s,d),f.set(r,l),i(`/${r}`)},select(t){f.set(n(),t),e.echo=null,m(e)}}}function x1(e,i,o={}){let n=A.get(e);if(n)n.contribution=i,n.opts=o;if(!n?.handle.attached()){n?.handle.dispose();let t={actionsHost:null,container:e,contribution:i,echo:null,formHost:null,handle:void 0,opts:o};A.set(e,t),t.handle=j(e,q(t),{actionsSlot:(r)=>{t.actionsHost=r,F(t)},formSlot:(r)=>{t.formHost=r,L(t)}}),n=t}n.handle.update(K(n)),F(n),L(n)}
|
|
2
|
-
export{
|
|
1
|
+
import{te}from"./studio-ery42sqr.js";import{p}from"./studio-y7jehjrp.js";import{v,k}from"./studio-fqq890ap.js";import{fd,Tu}from"./studio-zev8ssp1.js";import{Zi,T,R}from"./studio-7qvs7v0m.js";import{dd}from"./studio-01qza1n3.js";import{EE}from"./studio-3ck2a5c4.js";import{$b}from"./studio-5gs9th4b.js";import{kd}from"./studio-4m50vh74.js";import{D}from"./studio-tp642n5g.js";var N={$schema:"https://jxsuite.com/schema/v1",$id:"StudioSettingsContributed",$description:'The generic settings section behind `$studio.settings` (specs/extensions.md §9.1), as a Jx document over the kit. One document serves both layouts an extension may declare: "form" is a single schema form over the whole section value, "map" is master-detail — the entry keys on the left, the selected entry\'s form on the right. The adapter (`surfaces/settings-contributed.ts`) hands in the title, the layout, the entry rows already marked as selected, and whatever the reader is part-way through typing; `settings/contributed-section.ts` decides what an entry may be named, what reaches `project.json`, and what the validator said about it. The schema form itself is an ISLAND: this document renders `form-host` and nothing inside it, because a form built from a JSON Schema is `ui/schema-form.ts`\'s surface rather than this one\'s — the section places the element that surface hands back. The actions row is the second island: `panels/data-grid.ts` contributes it, and that one is still lit over Spectrum.',tagName:"section",attributes:{part:"contributed"},style:{$description:"What `.settings-section-title`, `.settings-two-col`, `.settings-list-panel`, `.settings-editor-panel`, `.settings-editor-header`, `.settings-empty-state` and `.settings-inline-form` said in `styles/overlays.css`, keyed on `part` and re-pointed at the studio token layer. This section was the LAST emitter of every one of them except `.settings-empty-state`, which `panels/settings-pane.ts` still writes when a project closes with the editor open — so those rules are dead in the stylesheet from here, and a central sweep removes them rather than this change, which owns no stylesheet. Two values could not come across. `.settings-editor-header h3` read `var(--spectrum-font-size-100, 14px)`, and a document is mounted in the pane rather than inside `<sp-theme>`, so it would have taken its hard-coded fallback every time; the entry name is a kit textfield now and carries the kit's own type ramp. And `.entry-name-input`, `.settings-form-panel`, `.settings-section` and `.contributed-section` had no rule anywhere at all — they were four entries on `check-styles.ts`'s orphan ledger, which is the ledger's point.",display:"block",'& [part="title"]':{margin:"0 0 16px",fontSize:"16px",fontWeight:"600",color:"var(--fg)"},'& [part="actions"]':{$description:"The host-contributed actions row — Test Connection, Push Schema, Open Data Grid on the data sections. `.data-section-actions` never had a rule anywhere, so the row was whatever the buttons stacked up to; it is a row with a gap under it now.",display:"flex",alignItems:"center",flexWrap:"wrap",gap:"8px",marginBottom:"12px"},'& [part="columns"]':{$description:"The 1px gap over the border colour is the divider between the two columns: two panels on `--bg-panel` with `--border` showing through the gap, so nothing draws a rule of its own.",display:"flex",height:"100%",gap:"1px",background:"var(--border)"},'& [part="list"]':{display:"flex",flexDirection:"column",gap:"4px",padding:"12px",width:"200px",minWidth:"200px",background:"var(--bg-panel)",overflowY:"auto"},'& [part="entry"], & [part="new-open"]':{width:"100%"},'& [part="entry"] > [part="control"], & [part="new-open"] > [part="control"]':{$description:"`.settings-list-panel sp-action-button` said `width: 100%; justify-content: flex-start`, and both halves belong to the button the row is made of rather than to the row: a kit action button centres its glyph and its label, which reads as a list of centred names.",width:"100%",justifyContent:"flex-start"},'& [part="new-form"]':{display:"flex",alignItems:"center",gap:"6px"},'& [part="new-field"]':{flex:"1",minWidth:"0"},'& [part="empty"]':{flex:"1",display:"flex",alignItems:"center",justifyContent:"center",background:"var(--bg-panel)",color:"var(--fg-dim)",fontSize:"13px"},'& [part="editor"]':{$description:"`min-width: 0` is the one line `.settings-editor-panel` did not have and needed: a flex child's floor is its content, and the schema form inside this one is a whole form rather than the short cards Data Shapes puts here — so a long pointer or a wide row pushed the column past the right edge of the pane instead of scrolling inside it.",flex:"1",padding:"16px",background:"var(--bg-panel)",overflowY:"auto",minWidth:"0"},'& [part="editor-header"]':{display:"flex",alignItems:"center",gap:"12px",marginBottom:"16px"},'& [part="entry-name"]':{flex:"1",minWidth:"0",maxWidth:"220px"}},children:[{tagName:"h3",attributes:{part:"title"},textContent:"${state.title}"},{tagName:"div",attributes:{part:"actions-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/actionsState"},cases:{slot:{$description:"An island: the host renders its own actions into this node and the document renders nothing inside it.",tagName:"div",attributes:{part:"actions"}}}},{tagName:"div",attributes:{part:"body-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/layout"},cases:{form:{$description:"An island: `ui/schema-form.ts` draws the whole section value into this node.",tagName:"div",attributes:{part:"form-host"}},map:{tagName:"div",attributes:{part:"columns"},children:[{tagName:"div",attributes:{part:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/entries"},key:{$ref:"$map/item/key"},map:{tagName:"jx-action-button",attributes:{part:"entry","data-entry":"${$map.item.key}","data-jx-region":"${$map.item.region}"},$props:{label:"${$map.item.key}",selected:{$ref:"$map/item/selected"},quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/select"},value:[{$ref:"$map/item/key"}]}]},children:[{tagName:"span",textContent:"${$map.item.key}"}]}},{tagName:"div",attributes:{part:"new-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/newState"},cases:{closed:{tagName:"jx-action-button",attributes:{part:"new-open"},$props:{label:"New Entry",icon:"plus",quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openNew"},value:[]}]},children:[{tagName:"span",textContent:"New Entry"}]},open:{tagName:"div",attributes:{part:"new-form"},children:[{tagName:"jx-textfield",attributes:{part:"new-field"},$props:{label:"New entry name",placeholder:"entry-name",size:"sm",value:{$ref:"#/state/newName"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editNew"},value:[{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{Enter:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/createNew"},value:[]}],Escape:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/cancelNew"},value:[]}]}}]}},{tagName:"jx-button",attributes:{part:"new-create"},$props:{size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/createNew"},value:[]}]},children:[{tagName:"span",textContent:"Create"}]}]}}}]},{tagName:"div",attributes:{part:"editor-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/editorState"},cases:{empty:{tagName:"div",attributes:{part:"empty"},textContent:"Select or create an entry"},editing:{tagName:"div",attributes:{part:"editor","data-jx-region":"${state.editorRegion}"},children:[{tagName:"div",attributes:{part:"editor-header"},children:[{tagName:"jx-textfield",attributes:{part:"entry-name"},$props:{label:"Entry name",size:"sm",value:{$ref:"#/state/entryName"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/renameEntry"},value:[{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{Enter:[{operator:"call",target:{$ref:"#/state/renameEntry"},value:[{$ref:"event#/target/value"}]}],Escape:[{operator:"call",target:{$ref:"#/state/cancelRename"},value:[{$ref:"event#/target/value"}]}]}}]}},{tagName:"jx-action-button",attributes:{part:"delete-entry"},$props:{label:"Delete entry",hint:"Delete entry",icon:"trash",quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/removeEntry"},value:[]}]}}]},{$description:"An island: `ui/schema-form.ts` draws the selected entry into this node.",tagName:"div",attributes:{part:"form-host"}}]}}}]}}}]};T("settings-contributed",N);function V(){return{actionsState:"none",editorRegion:"",editorState:"empty",entries:[],entryName:"",layout:"form",newName:"",newState:"closed",title:""}}function W(e){let o=e?.attributes?.part;return typeof o==="string"?o:""}function j(e,i,o){e.textContent="";let n=v({...V(),...i}),t=null,r=!1,a=R("settings-contributed",n,e,{onNodeCreated:(s,l,d)=>{if(!(s instanceof HTMLElement))return;let c=W(d);if(c==="form-host")o.formSlot(s);else if(c==="actions")o.actionsSlot(s)}}).then((s)=>{if(r)return s.dispose(),s.root;return t=s,s.root});return{attached:()=>{if(r)return!1;let s=t?.root;return s===void 0?!0:s instanceof HTMLElement&&e.contains(s)},dispose(){r=!0,t?.dispose(),t=null},host:e,ready:a,update(s){n.actionsState=s.actionsState,n.editorRegion=s.editorRegion,n.editorState=s.editorState,n.entries=s.entries,n.entryName=s.entryName,n.layout=s.layout,n.newName=s.newName,n.newState=s.newState,n.title=s.title}}}var f=new Map,b=new Set,w=new Map;function kE(e,i){let o=D?.projectConfig?.[e],n=o&&typeof o==="object"&&!Array.isArray(o)?o:{};if(!Object.hasOwn(n,i))return Object.keys(n);return f.set(e,i),null}var x=new Map;function I(e,i){let o={},n=[];for(let t of i){let r=t.indexOf(": "),a=r===-1?"":t.slice(0,r),s=r===-1?t:t.slice(r+2);if(a===e){n.push(s);continue}if(!a.startsWith(`${e}/`))continue;let[l]=a.slice(e.length+1).split("/");if(l&&o[l]===void 0)o[l]=s}return{fields:o,section:n}}async function S(e,i){let o=D.projectConfig;if(!(await kd()).ok)return;let t=[];try{t=await dd(o)}catch(r){k.warn(`Could not validate project.json — ${te(r)}`,{key:"settings:validator",path:"project.json",source:"Settings",tier:"problem"});return}x.set(e,I(e,t).fields),i()}function E(e,i){for(let[o,n]of Object.entries(i))if(n===void 0)delete e[o];else e[o]=n}function H(e){return e.toLowerCase().replaceAll(/\s+/g,"-").replaceAll(/[^a-z0-9-]/g,"")}function J(e,i){if(!e)return{};let o=(n)=>{if(typeof n==="string")return n.replaceAll("${key}",i);if(Array.isArray(n))return n.map((t)=>o(t));if(n&&typeof n==="object"){let t={};for(let[r,a]of Object.entries(n))t[r]=o(a);return t}return n};return o(e)}function M(e,i,o=null){let n=p();return{fieldKeyPrefix:`$settings.${e}`,resolvePointer:(t,r)=>Tu(t,{projectConfig:D?.projectConfig??{},...r!==void 0&&{scope:r},...i.formats!==void 0&&{formats:i.formats}}),...typeof n.setSecrets==="function"?{commitSecret:async(t,r)=>{let a=EE(e,o,t);return await n.setSecrets({set:{[a]:r}}),a}}:{}}}function h(e){let i=D?.projectConfig;if(!i)return null;let o=i[e];if(o&&typeof o==="object"&&!Array.isArray(o))return o;let n={};return i[e]=n,n}var A=new WeakMap;function m(e){w1(e.container,e.contribution,e.opts)}function O(e,i){e.echo=i,m(e)}function K(e){let{container:i,contribution:o,opts:n}=e,t=o.key,r=o.title??t,a=n.actions?"slot":"none",s=$b(i),l=Zi(s,"editor");if((o.settings.layout??"form")!=="map")return{actionsState:a,editorRegion:l,editorState:"empty",entries:[],entryName:"",layout:"form",newName:"",newState:"closed",title:r};let d=h(t)??{},c=f.get(t)??null,g=c===null?void 0:d[c],y=c!==null&&g!==void 0&&g!==null&&typeof g==="object";return{actionsState:a,editorRegion:l,editorState:y?"editing":"empty",entries:Object.keys(d).map((u)=>({key:u,region:Zi(s,`entry:${u}`),selected:u===c})),entryName:e.echo??(y?c:""),layout:"map",newName:w.get(t)??"",newState:b.has(t)?"open":"closed",title:r}}function L(e){let i=e.formHost;if(!i)return;let{contribution:o,opts:n}=e,t=o.key,r=o.settings.entry?.ui,a=()=>m(e),s=(u)=>{if(u.parentNode!==i)i.replaceChildren(u)};if((o.settings.layout??"form")!=="map"){let u=`/${t}`;s(fd(`section:${t}`,o.entrySchema,h(t)??{},{context:M(t,n,null),errors:x.get(u)??{},onChange:(P)=>{let C=h(t);if(!C)return;E(C,P),a(),S(u,a)},rerender:a,...r!==void 0&&{ui:r}}));return}let l=h(t)??{},d=f.get(t)??null,c=d===null?void 0:l[d];if(d===null||!c||typeof c!=="object"){i.replaceChildren();return}let g=c,y=`/${t}/${d}`;s(fd(`section:${t}:${d}`,o.entrySchema,g,{context:M(t,n,d),errors:x.get(y)??{},onChange:(u)=>{E(g,u),a(),S(y,a)},rerender:a,...r!==void 0&&{ui:r}}))}function F(e){let i=e.actionsHost,{actions:o}=e.opts;if(!i)return;if(!o){i.replaceChildren();return}let n=e.contribution.key,t=(e.contribution.settings.layout??"form")==="map"?f.get(n)??null:null;o(i,{rerender:()=>m(e),sectionKey:n,selected:t})}function q(e){let i=(t)=>{e.echo=null,m(e),S(t,()=>m(e))},o=()=>{e.echo=null,m(e)},n=()=>e.contribution.key;return{cancelNew(){b.delete(n()),w.delete(n()),m(e)},cancelRename(t){O(e,t),o()},createNew(){let t=n(),r=H(w.get(t)??""),a=h(t);if(!r||!a||a[r])return;a[r]=J(e.contribution.settings.entry?.newEntry,r),f.set(t,r),b.delete(t),w.delete(t),i(`/${t}`)},editNew(t){w.set(n(),t),m(e)},openNew(){b.add(n()),m(e)},removeEntry(){let t=n(),r=f.get(t)??null,a=h(t);if(!r||!a?.[r])return;delete a[r],f.set(t,null),i(`/${t}`)},renameEntry(t){O(e,t);let r=n(),a=f.get(r)??null,s=h(r),l=H(t.trim());if(!a||!s||!l||l===a||s[l]){o();return}let d={};for(let[c,g]of Object.entries(s))d[c===a?l:c]=g,delete s[c];Object.assign(s,d),f.set(r,l),i(`/${r}`)},select(t){f.set(n(),t),e.echo=null,m(e)}}}function w1(e,i,o={}){let n=A.get(e);if(n)n.contribution=i,n.opts=o;if(!n?.handle.attached()){n?.handle.dispose();let t={actionsHost:null,container:e,contribution:i,echo:null,formHost:null,handle:void 0,opts:o};A.set(e,t),t.handle=j(e,q(t),{actionsSlot:(r)=>{t.actionsHost=r,F(t)},formSlot:(r)=>{t.formHost=r,L(t)}}),n=t}n.handle.update(K(n)),F(n),L(n)}
|
|
2
|
+
export{kE,w1};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
5
|
-
//# sourceMappingURL=studio-
|
|
4
|
+
//# debugId=4A09A7801D85A2D264756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-tmeq6mjb.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{Ot,rh,
|
|
2
|
-
export{
|
|
1
|
+
import{Ot,rh,qe}from"./studio-nbxqcgvf.js";var Tm=400;var Tc=350,oI=30000;function K(e,t){let n=e;for(let r of t){if(n==null)return;n=n[r]}return n}function _o(e){return Array.isArray(e?.children)?e.children:[]}function Lm(e){if(!e||typeof e!=="object")return e;if(Array.isArray(e)){for(let r of e)Lm(r);return e}let t=e,{children:n}=t;if(n&&typeof n==="object"&&!Array.isArray(n)&&n.$prototype==="Array")t.children=[n];if(Array.isArray(t.children))for(let r of t.children)Lm(r);if(t.$prototype==="Array"&&t.map&&typeof t.map==="object")Lm(t.map);if(t.cases&&typeof t.cases==="object")for(let r of Object.values(t.cases))Lm(r);return e}function ht(e){return e.length>=2?e.slice(0,-2):null}function _n(e){return e.at(-1)}function ok(e){return e.join("/")}function Yo(e,t){if(e===t)return!0;if(!e||!t||e.length!==t.length)return!1;return e.every((n,r)=>n===t[r])}function qa(e,t){if(e.length>t.length)return!1;return e.every((n,r)=>n===t[r])}function Nd(e,t=[],n=0){let r=[];return l(e,t,n,r,!1),r}function l(e,t,n,r,o){if(typeof e==="string"||typeof e==="number"||typeof e==="boolean"){if(!o)r.push({depth:n,node:e,nodeType:"text",path:t});return}if(e.$prototype==="Array"){if(!o)r.push({depth:n,node:e,nodeType:"map",path:t});let s=e.map;if(s&&typeof s==="object")l(s,[...t,"map"],n+1,r,!1);return}if(!o)r.push({depth:n,node:e,nodeType:"element",path:t});if(e.$props&&qe(e.tagName).includes("-")&&!Array.isArray(e.children))return;let{children:i}=e;if(Array.isArray(i))for(let s=0;s<i.length;s++){let a=[...t,"children",s];l(i[s],a,n+1,r,!1)}else if(i&&typeof i==="object"&&i.$prototype==="Array")l(i,[...t,"children"],n+1,r,!1);if(e.$switch&&e.cases&&typeof e.cases==="object")for(let[s,a]of Object.entries(e.cases)){let c=[...t,"cases",s];if(a&&typeof a==="object"&&a.$ref)r.push({depth:n+1,node:a,nodeType:"case-ref",path:c});else if(a&&typeof a==="object")r.push({depth:n+1,node:a,nodeType:"case",path:c}),l(a,c,n+2,r,!0)}}function Zo(e){if(!e)return"?";if(e.$prototype==="Array"){let{items:r}=e;return`Repeater → ${(Ot(r)?r.$ref:void 0)||"items"}`}if(e.$title)return e.$title;if(e.$id)return e.$id;if(e.tagName==="slot"){let r=e.attributes?.name;return typeof r==="string"&&r.trim()?`slot: ${r.trim()}`:"slot"}let t=qe(e.tagName)||"div",n=e.$switch?" ⇆":"";if(typeof e.textContent==="string"&&e.textContent.length>0)return`${t} — ${e.textContent.slice(0,24)}${n}`;return t+n}var D=null;function Hl(e){D=e}function vt(){return D}function Xu(e){if(!e||typeof e!=="object")return e;if(Array.isArray(e))return e.map((n)=>Xu(n));let t={};for(let[n,r]of Object.entries(e)){if(n.startsWith("on")&&rh(r))continue;if(n==="children")t.children=Array.isArray(r)?r.map((o)=>Xu(o)):Xu(r);else if(n==="cases"&&typeof r==="object"){let o={};for(let[i,s]of Object.entries(r))o[i]=Xu(s);t.cases=o}else if(n==="state"&&typeof r==="object"&&r!==null){let o={};for(let[i,s]of Object.entries(r)){if(s&&typeof s==="object"&&s.timing==="server")continue;o[i]=s}t.state=o}else if(n==="style"||n==="attributes"||n==="$media")t[n]=r;else t[n]=r}return t}var jx=null,Qu=null,rk=null,sk=null,Ev=null;function rI(){jx=document.querySelector("#activity-bar"),Qu=document.querySelector("#left-panel"),rk=document.querySelector("#right-panel"),sk=document.querySelector("#toolbar"),Ev=document.querySelector("#statusbar")}var Sp=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),ak=[":hover",":focus",":active",":focus-within",":focus-visible",":disabled",":first-child",":last-child","::before","::after","::placeholder"];function Hx(e){return e.startsWith(":")||e.startsWith(".")||e.startsWith("&")||e.startsWith("[")}var u=new Map;function Tv(e,t,n){let r=t??Tm;return(...o)=>{clearTimeout(u.get(e)),u.set(e,setTimeout(()=>{u.delete(e),n(...o)},r))}}function sI(e){clearTimeout(u.get(e)),u.delete(e)}var p=new Map,f=0;function aI(){return f}function d(e,t){f+=1;let n=()=>{f-=1},r=null;try{let o=t();if(typeof o?.then==="function")r=o}catch(o){console.error(`Renderer "${e}" failed:`,o)}if(!r){n();return}r.then(n,(o)=>{console.error(`Renderer "${e}" failed:`,o),n()})}function eh(e,t){p.set(e,t)}function Oo(){for(let[e,t]of p.entries())d(e,t)}function Ai(...e){for(let t of e){let n=p.get(t);if(!n)continue;d(t,n)}}function Lc(e,t){if(e){if(t.selection!==void 0)e.session.selection=t.selection;if(t.hover!==void 0)e.session.hover=t.hover;if(t.clipboard!==void 0)e.session.clipboard=t.clipboard;if(t.ui)for(let[n,r]of Object.entries(t.ui))e.session.ui[n]=r;if(t.canvas)for(let[n,r]of Object.entries(t.canvas))e.session.canvas[n]=r}}function Gr(e,t,n){if(e)e.session.ui[t]=n}function lI(e,t){if(e)for(let[n,r]of Object.entries(t))e.session.canvas[n]=r}
|
|
2
|
+
export{Tm,Tc,oI,K,_o,Lm,ht,_n,ok,Yo,qa,Nd,Zo,D,Hl,vt,Xu,jx,Qu,rk,sk,Ev,rI,Sp,ak,Hx,Tv,sI,aI,eh,Oo,Ai,Lc,Gr,lI};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
5
|
-
//# sourceMappingURL=studio-
|
|
4
|
+
//# debugId=4157AE0D27B8DA8364756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-tp642n5g.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
class f extends Error{name="MaxOpsExceededError"}function d(n){return typeof n==="object"&&n!==null&&!Array.isArray(n)}function ls(n,e){if(n===e)return!0;if(Array.isArray(n)&&Array.isArray(e))return n.length===e.length&&n.every((t,r)=>ls(t,e[r]));if(d(n)&&d(e)){let t=Object.keys(n),r=Object.keys(e);return t.length===r.length&&t.every((i)=>(i in e)&&ls(n[i],e[i]))}return!1}function A(n){let e=5381;for(let t=0;t<n.length;t++)e=Math.imul(e,33)+(n.codePointAt(t)??0);return e.toString(36)}function m(n){return typeof n==="string"?`s:${n}`:`n:${A(JSON.stringify(n))}`}function x(n){if(typeof n==="string")return"s";let e=n,{attributes:t,$props:r}=e,i=(d(t)?t.id:void 0)??(d(r)?r.key:void 0)??"";return`w:${String(e.tagName??"")}:${String(i)}`}function y(n,e,t=Number.POSITIVE_INFINITY){let r=n.length,i=e.length;if(r===0||i===0||r*i>t)return[];let c=Array.from({length:r+1},()=>Array.from({length:i+1},()=>0));for(let s=r-1;s>=0;s--)for(let l=i-1;l>=0;l--)c[s][l]=n[s]===e[l]?c[s+1][l+1]+1:Math.max(c[s+1][l],c[s][l+1]);let o=[],a=0,u=0;while(a<r&&u<i)if(n[a]===e[u])o.push([a,u]),a+=1,u+=1;else if(c[a+1][u]>=c[a][u+1])a+=1;else u+=1;return o}function
|
|
2
|
-
export{ls,
|
|
1
|
+
class f extends Error{name="MaxOpsExceededError"}function d(n){return typeof n==="object"&&n!==null&&!Array.isArray(n)}function ls(n,e){if(n===e)return!0;if(Array.isArray(n)&&Array.isArray(e))return n.length===e.length&&n.every((t,r)=>ls(t,e[r]));if(d(n)&&d(e)){let t=Object.keys(n),r=Object.keys(e);return t.length===r.length&&t.every((i)=>(i in e)&&ls(n[i],e[i]))}return!1}function A(n){let e=5381;for(let t=0;t<n.length;t++)e=Math.imul(e,33)+(n.codePointAt(t)??0);return e.toString(36)}function m(n){return typeof n==="string"?`s:${n}`:`n:${A(JSON.stringify(n))}`}function x(n){if(typeof n==="string")return"s";let e=n,{attributes:t,$props:r}=e,i=(d(t)?t.id:void 0)??(d(r)?r.key:void 0)??"";return`w:${String(e.tagName??"")}:${String(i)}`}function y(n,e,t=Number.POSITIVE_INFINITY){let r=n.length,i=e.length;if(r===0||i===0||r*i>t)return[];let c=Array.from({length:r+1},()=>Array.from({length:i+1},()=>0));for(let s=r-1;s>=0;s--)for(let l=i-1;l>=0;l--)c[s][l]=n[s]===e[l]?c[s+1][l+1]+1:Math.max(c[s+1][l],c[s][l+1]);let o=[],a=0,u=0;while(a<r&&u<i)if(n[a]===e[u])o.push([a,u]),a+=1,u+=1;else if(c[a+1][u]>=c[a][u+1])a+=1;else u+=1;return o}function r1(n,e,t={}){let r=t.maxCells??Number.POSITIVE_INFINITY,i=y(n.map((s)=>m(s)),e.map((s)=>m(s)),r),c=[],o=-1,a=-1,u=[];for(let[s,l]of i)u.push([o+1,s,a+1,l]),c.push({aIndex:s,bIndex:l,identical:!0}),o=s,a=l;u.push([o+1,n.length,a+1,e.length]);for(let[s,l,p,k]of u){let w=n.slice(s,l),O=e.slice(p,k);for(let[b,I]of y(w.map((h)=>x(h)),O.map((h)=>x(h)),r))c.push({aIndex:s+b,bIndex:p+I,identical:!1})}return c.toSorted((s,l)=>s.aIndex-l.aIndex)}class g{ops=[];maxOps;constructor(n){this.maxOps=n}result(){return this.ops}push(n){if(this.ops.length>=this.maxOps)throw new f;this.ops.push(n)}diffNode(n,e,t){for(let c of new Set([...Object.keys(e),...Object.keys(t)])){if(c==="children")continue;if(!(c in t))this.push({key:c,op:"set-key",path:n});else if(!ls(e[c],t[c]))this.push({key:c,op:"set-key",path:n,value:t[c]})}let r=e.children,i=t.children;if(Array.isArray(r)&&Array.isArray(i))this.diffChildren(n,r,i);else if(!ls(r,i))this.push({key:"children",op:"set-key",path:n,value:i})}diffChildren(n,e,t){let r=r1(e,t),i=new Set(r.map((o)=>o.aIndex)),c=new Map(r.map((o)=>[o.bIndex,o]));for(let o=e.length-1;o>=0;o--)if(!i.has(o))this.push({index:o,op:"remove-child",parentPath:n});for(let o=0;o<t.length;o++){let a=c.get(o);if(!a){this.push({index:o,node:t[o],op:"insert-child",parentPath:n});continue}if(a.identical)continue;let u=e[a.aIndex],s=t[o];if(d(u)&&d(s))this.diffNode([...n,"children",o],u,s);else if(!ls(u,s))this.push({index:o,node:s,op:"set-child",parentPath:n})}}}function f$(n,e,t={}){let r=new g(t.maxOps??500);try{r.diffNode([],n,e)}catch(i){if(i instanceof f)return null;throw i}return r.result()}
|
|
2
|
+
export{ls,r1,f$};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
5
|
-
//# sourceMappingURL=studio-
|
|
4
|
+
//# debugId=D8287AACA826507164756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-tzegmy4w.js.map
|