@jxsuite/studio 5.7.0 → 6.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{2020-cs2sb9t1.js → 2020-nkxms0ay.js} +3 -3
- package/dist/chunks/adapter-m948ab5f.js +4 -0
- package/dist/chunks/{cf-account-picker-882a7ecm.js → cf-account-picker-n8hr38v7.js} +3 -3
- package/dist/chunks/cf-settings-356xdtne.js +4 -0
- package/dist/chunks/components-yk3t844e.js +4 -0
- package/dist/chunks/content-source-bawmyc09.js +4 -0
- package/dist/chunks/{convert-to-repeater-grfep2w8.js → convert-to-repeater-7wns8kf1.js} +3 -3
- package/dist/chunks/editor-6sc8nacq.js +4 -0
- package/dist/chunks/entry-commands-8ay9fh81.js +4 -0
- package/dist/chunks/{extension-sections-dp8endhx.js → extension-sections-na7rj3nr.js} +3 -3
- package/dist/chunks/file-ops-gye0qw56.js +4 -0
- package/dist/chunks/files-dmc2xvcq.js +4 -0
- package/dist/chunks/format-host-t76b53f8.js +4 -0
- package/dist/chunks/fs-events-cg4tpz06.js +4 -0
- package/dist/chunks/git-panel-yef7bshy.js +4 -0
- package/dist/chunks/{grid-view-5amhg604.js → grid-view-7tt4bxw1.js} +6 -6
- package/dist/chunks/iframe-host-tmz30gfp.js +4 -0
- package/dist/chunks/{index-9ydfe04y.js → index-gybvv7a6.js} +3 -3
- package/dist/chunks/index-nag78a9h.js +4 -0
- package/dist/chunks/{javascript-d9pqgc2p.js → javascript-rnvdp3k4.js} +2 -2
- package/dist/chunks/{jsonMode-800yvbem.js → jsonMode-zhwsprqk.js} +5 -5
- package/dist/chunks/jx-validate-3gbp5nkn.js +4 -0
- package/dist/chunks/layers-fvz99859.js +4 -0
- package/dist/chunks/layers-panel-gchmbf9p.js +4 -0
- package/dist/chunks/lit-html-9agdspkt.js +4 -0
- package/dist/chunks/media-picker-rhjvyy00.js +4 -0
- package/dist/chunks/menu-2e4y9j7b.js +4 -0
- package/dist/chunks/{monaco-binding-62dtmgbf.js → monaco-binding-2jnhjjvr.js} +3 -3
- package/dist/chunks/monaco-buffer-rp21359g.js +4 -0
- package/dist/chunks/{monaco-setup-tj13ndtm.js → monaco-setup-vhh7gayr.js} +3 -3
- package/dist/chunks/notify-h3www560.js +4 -0
- package/dist/chunks/platform-hz34wcd7.js +4 -0
- package/dist/chunks/publish-panel-exsmjzyj.js +4 -0
- package/dist/chunks/quick-search-pgaqeh0m.js +4 -0
- package/dist/chunks/references-2cgdxnb8.js +4 -0
- package/dist/chunks/right-panel-jf856w5w.js +4 -0
- package/dist/chunks/section-registry-jnf8r5gy.js +4 -0
- package/dist/chunks/studio-0f55h9ye.js +5 -0
- package/dist/chunks/{studio-hjbg8d5y.js → studio-0sqdhnew.js} +7 -7
- package/dist/chunks/{studio-1wvfxkyy.js → studio-0x3jyb8r.js} +4 -4
- package/dist/chunks/{studio-yr04mv2j.js → studio-19x1c75w.js} +4 -4
- package/dist/chunks/{studio-evwgp1ym.js → studio-2sqcndak.js} +4 -4
- package/dist/chunks/{studio-cvbkkfqb.js → studio-3aey7dd3.js} +4 -4
- package/dist/chunks/{studio-888knnkc.js → studio-3bpdkq2s.js} +4 -4
- package/dist/chunks/{studio-ceb34dxj.js → studio-47y6fbpf.js} +4 -4
- package/dist/chunks/{studio-c6w3tq7t.js → studio-4m3826v2.js} +4 -4
- package/dist/chunks/studio-4nx2dj1g.js +4 -0
- package/dist/chunks/{studio-p7c1agz0.js → studio-4xv5s47r.js} +5 -5
- package/dist/chunks/{studio-sxc0zvpt.js → studio-5g0ag7c0.js} +3 -3
- package/dist/chunks/{studio-semd1s8s.js → studio-5g4t8v6w.js} +4 -4
- package/dist/chunks/studio-5py436sf.js +5 -0
- package/dist/chunks/{studio-aje966s9.js → studio-77kt594t.js} +4 -4
- package/dist/chunks/{studio-56z7evx4.js → studio-8f87n763.js} +6 -6
- package/dist/chunks/studio-8mb00b84.js +5 -0
- package/dist/chunks/studio-8p51gq2h.js +6 -0
- package/dist/chunks/studio-954ds834.js +5 -0
- package/dist/chunks/{studio-xta2vxp6.js → studio-9ft45c83.js} +6 -6
- package/dist/chunks/studio-a2138x5k.js +7 -0
- package/dist/chunks/studio-a9yzstqj.js +5 -0
- package/dist/chunks/{studio-gp02nqnw.js → studio-acdksxx6.js} +4 -4
- package/dist/chunks/{studio-edbtvcd1.js → studio-anyrgzvb.js} +4 -4
- package/dist/chunks/{studio-dkn3x3hz.js → studio-ar8jcf2y.js} +4 -4
- package/dist/chunks/{studio-xry7tk3z.js → studio-bmn4mn9j.js} +5 -5
- package/dist/chunks/{studio-03wwfvyt.js → studio-cpxkgjrj.js} +4 -4
- package/dist/chunks/{studio-spf2skgc.js → studio-e7xxa0sj.js} +4 -4
- package/dist/chunks/{studio-01qza1n3.js → studio-ecaz25vk.js} +4 -4
- package/dist/chunks/{studio-5e9zsamh.js → studio-fzdywr6p.js} +6 -6
- package/dist/chunks/{studio-65fhspdd.js → studio-g5fmf0c1.js} +4 -4
- package/dist/chunks/studio-g7nse7zb.js +5 -0
- package/dist/chunks/studio-geq1ea6k.js +14 -0
- package/dist/chunks/{studio-n78gjfy8.js → studio-ghkb32r8.js} +4 -4
- package/dist/chunks/{studio-222rqyyc.js → studio-ghrhy2y7.js} +4 -4
- package/dist/chunks/{studio-a7xqhc3n.js → studio-grawhey1.js} +4 -4
- package/dist/chunks/{studio-eh0rac07.js → studio-h0xgswew.js} +4 -4
- package/dist/chunks/{studio-wma2c6g8.js → studio-h9c4p2tx.js} +4 -4
- package/dist/chunks/studio-jyzj5cxs.js +5 -0
- package/dist/chunks/{studio-x92tgnee.js → studio-mgx8yhnz.js} +31 -31
- package/dist/chunks/{studio-0scebvb9.js → studio-mpb04y1d.js} +5 -5
- package/dist/chunks/{studio-xy3tv3az.js → studio-n17mty64.js} +4 -4
- package/dist/chunks/{studio-gfn1kpxj.js → studio-nwh2eqsk.js} +5 -5
- package/dist/chunks/{studio-nt06yybj.js → studio-pxg4ap1e.js} +3 -3
- package/dist/chunks/{studio-zpnk016a.js → studio-q1h883bt.js} +5 -5
- package/dist/chunks/{studio-c6zdm25z.js → studio-q4tv82h7.js} +6 -6
- package/dist/chunks/{studio-st75kn99.js → studio-qbj760tx.js} +5 -5
- package/dist/chunks/{studio-y7jehjrp.js → studio-qpqa7vk3.js} +4 -4
- package/dist/chunks/{studio-j6gnhvaa.js → studio-qqz8e5gk.js} +4 -4
- package/dist/chunks/{studio-skzanb0k.js → studio-qvasen3f.js} +4 -4
- package/dist/chunks/studio-rggdb3hm.js +5 -0
- package/dist/chunks/{studio-4xppwncr.js → studio-sghy936h.js} +3 -3
- package/dist/chunks/{studio-9mqfamps.js → studio-skprc6ef.js} +4 -4
- package/dist/chunks/{studio-1x8x26k3.js → studio-tt2nactf.js} +4 -4
- package/dist/chunks/{studio-54g077x3.js → studio-txjjzrsm.js} +5 -5
- package/dist/chunks/{studio-f195h2hq.js → studio-tyasmc39.js} +4 -4
- package/dist/chunks/{studio-0bbxhhce.js → studio-v2bvmbjj.js} +4 -4
- package/dist/chunks/{studio-pwqfmt4p.js → studio-vk9ezads.js} +4 -4
- package/dist/chunks/{studio-fqq890ap.js → studio-vzacdfsc.js} +3 -3
- package/dist/chunks/{studio-zd4kayn2.js → studio-w4c0xmrw.js} +4 -4
- package/dist/chunks/{studio-tw7rre6s.js → studio-wfjqhhbk.js} +4 -4
- package/dist/chunks/{studio-tp642n5g.js → studio-wgh5kxpj.js} +4 -4
- package/dist/chunks/studio-xasj0796.js +5 -0
- package/dist/chunks/{studio-tzegmy4w.js → studio-y78s8r2n.js} +4 -4
- package/dist/chunks/{studio-7pgy3xaf.js → studio-z8w183sh.js} +4 -4
- package/dist/chunks/{studio-01kbbqg3.js → studio-zscd9ty4.js} +124 -124
- package/dist/chunks/{studio-mwxgyn9h.js → studio-zxp13sss.js} +6 -6
- package/dist/chunks/{studio-r3kaka4d.js → studio-zygnmm01.js} +4 -4
- package/dist/chunks/{tsMode-k9s9fcag.js → tsMode-gr0m4dzr.js} +5 -5
- package/dist/chunks/workspace-m15qtcqp.js +4 -0
- package/dist/chunks/{ws-client-0ja08haa.js → ws-client-nf61frr1.js} +3 -3
- package/dist/iframe-entry.js +3 -3
- package/dist/manifest.json +62 -62
- package/dist/studio.js +83 -83
- package/package.json +11 -11
- package/src/new-project/add-repo-modal.ts +459 -59
- package/src/platforms/cloud.ts +95 -18
- package/src/publish/pages-service.ts +7 -0
- package/src/publish/publish-panel.ts +16 -2
- package/src/surfaces/add-repo.json +721 -224
- package/src/surfaces/add-repo.ts +196 -31
- package/src/types.ts +42 -3
- package/src/ui/schema-form.ts +6 -2
- package/src/utils/project-dir.ts +24 -0
- package/dist/chunks/adapter-y5gdq19c.js +0 -4
- package/dist/chunks/cf-settings-20dznc3j.js +0 -4
- package/dist/chunks/components-q037dya7.js +0 -4
- package/dist/chunks/content-source-37x3vsap.js +0 -4
- package/dist/chunks/editor-j5sq149q.js +0 -4
- package/dist/chunks/entry-commands-c5h3nqck.js +0 -4
- package/dist/chunks/file-ops-937cvqk6.js +0 -4
- package/dist/chunks/files-tznwe1p1.js +0 -4
- package/dist/chunks/format-host-e2pjvd25.js +0 -4
- package/dist/chunks/fs-events-fv64ak3s.js +0 -4
- package/dist/chunks/git-panel-gb713ttc.js +0 -4
- package/dist/chunks/iframe-host-t819mcg5.js +0 -4
- package/dist/chunks/index-m0x5ztax.js +0 -4
- package/dist/chunks/jx-validate-zc9zp77s.js +0 -4
- package/dist/chunks/layers-4bsr82wz.js +0 -4
- package/dist/chunks/layers-panel-b6shnaax.js +0 -4
- package/dist/chunks/lit-html-cfn61dn7.js +0 -4
- package/dist/chunks/media-picker-ej0kdh1j.js +0 -4
- package/dist/chunks/menu-rtxf9chb.js +0 -4
- package/dist/chunks/monaco-buffer-nn4dtx27.js +0 -4
- package/dist/chunks/notify-ahs57a2z.js +0 -4
- package/dist/chunks/platform-v9xyfkbx.js +0 -4
- package/dist/chunks/publish-panel-bq36xcmj.js +0 -4
- package/dist/chunks/quick-search-zm00h9dh.js +0 -4
- package/dist/chunks/references-99ws0b0m.js +0 -4
- package/dist/chunks/right-panel-pq2f71q3.js +0 -4
- package/dist/chunks/section-registry-b2yzp9sw.js +0 -4
- package/dist/chunks/studio-0k9mvpgj.js +0 -14
- package/dist/chunks/studio-1a99w39s.js +0 -5
- package/dist/chunks/studio-693nhyky.js +0 -5
- package/dist/chunks/studio-aqmph6k4.js +0 -5
- package/dist/chunks/studio-c9d3pxf7.js +0 -5
- package/dist/chunks/studio-cxt150pj.js +0 -7
- package/dist/chunks/studio-e6re3rk1.js +0 -5
- package/dist/chunks/studio-frb0qbf7.js +0 -6
- package/dist/chunks/studio-gh97gngt.js +0 -5
- package/dist/chunks/studio-nbxqcgvf.js +0 -5
- package/dist/chunks/studio-t1eedsyx.js +0 -4
- package/dist/chunks/studio-vavmwshr.js +0 -5
- package/dist/chunks/studio-xk0z6msk.js +0 -5
- package/dist/chunks/workspace-b69mgm0e.js +0 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{tt,Ni}from"./studio-sxc0zvpt.js";import{vI,zx,un,rn,Pm,CI,ne}from"./studio-0k9mvpgj.js";import{ge,Q,v,$c,k,Wd}from"./studio-fqq890ap.js";import{te}from"./studio-ery42sqr.js";var rt="data-jx-region",ce=["rail","navigator","inspector","pane","dock.bottom","statusbar","commandbar","overlay"],de=new Set(["dock.bottom"]);function ue(e){let t=e.indexOf("/"),o=t===-1?e:e.slice(0,t),n=t===-1?void 0:e.slice(t+1);if(n===""||o==="")return null;let a=o,i;if(!de.has(o)){let s=o.indexOf(".");if(s!==-1){if(a=o.slice(0,s),i=o.slice(s+1),i==="")return null}}if(!ce.includes(a))return null;return i===void 0?n===void 0?{surface:a}:{part:n,surface:a}:n===void 0?{instance:i,surface:a}:{instance:i,part:n,surface:a}}function fe(e){return ue(e)!==null}function me(e){if(e==="pane")return"pane.primary";return e.startsWith("pane/")?`pane.primary/${e.slice(5)}`:e}function B(e){return e??document}var pe=[{locate:([,e],t)=>{let n=Ip(`inspector/field:${e}`,t)?.querySelector('[part="browse"]');return n?[n]:[]},pattern:/^inspector\/field:(.+)\/browse$/},{locate:([,e],t)=>{let o=Ip("inspector",t);return o?[...o.querySelectorAll(`[data-prop="${CSS.escape(e)}"]`)]:[]},pattern:/^inspector\/field:(.+)$/}];function ve(e,t){let o=me(e);if(!fe(o))return[];let n=[...B(t).querySelectorAll(`[data-jx-region="${CSS.escape(o)}"]`)];if(n.length>0)return n;for(let a of pe){let i=o.match(a.pattern);if(i)return a.locate(i,B(t))}return[]}function Ip(e,t){return ve(e,t).at(-1)??null}var fk={dock:"dock.bottom",inspector:"inspector",navigator:"navigator",pane:"pane.primary",rail:"rail",status:"statusbar"};function Zi(e,t){return t?`pane.${e}/${t}`:`pane.${e}`}function uI(e){return Zi(e,"tabs")}function hI(e){return`navigator/panel:${e}`}function pI(e){return`inspector/tab:${e}`}var fI="navigator/statements";function mI(e){return`inspector/statements:${e}`}function Iv(e){return`dock.bottom/panel:${e}`}var he={dialog:"dialog",modal:"dialog",popover:"menu",toast:"toasts"};function zt(e,t){let o=he[e];return t?`overlay.${o}:${t}`:`overlay.${o}`}var A=new Map,Y=1;function X(e){let t=Y;return Y+=1,A.set(t,{...e,id:t}),t}function H(e){A.delete(e)}function Z(){return[...A.values()]}function cI(e){let t=e.toLowerCase();return Z().filter((o)=>o.elements.has(t))}function dI(e){return Z().filter((t)=>t.name===e)}var P=null;function pk(e=document){return P??=CI({document:e}),P}function ee(){return P??pk()}var S="jx-studio:/surfaces/",L=new Map;function T(e,t){L.set(e,t),zx(ye(e),t)}function ye(e){return`${S}${e}.json`}function gI(e){return L.get(e)}function be(e){if(!e.startsWith(S)||!e.endsWith(".json"))return;return L.get(e.slice(S.length,-5))}async function R(e,t,o,n={}){let a=L.get(e);if(!a)throw Error(`Studio surface "${e}" is not registered`);if(await ee(),n.region)o.setAttribute(rt,n.region);let i=await vI(a,o,{scope:t,base:S,resolver:be,...n.onNodeCreated?{onNodeCreated:n.onNodeCreated}:{},...n.onNodeMoved?{onNodeMoved:n.onNodeMoved}:{},...n.signal?{signal:n.signal}:{}}),s=(r)=>({dispose:r,elements:i.elements,root:i.root,scope:i.scope});if(n.signal?.aborted)return s(i.dispose);let d=0,l=()=>{i.dispose(),H(d)};return d=X({elements:i.elements,host:o,name:e,remount:async()=>{l(),await R(e,t,o,n)}}),n.signal?.addEventListener("abort",()=>H(d),{once:!0}),s(l)}var oe={$schema:"https://jxsuite.com/schema/v1",$id:"StudioDialog",$description:"Studio's confirm, save-or-discard and prompt dialogs: one jx-dialog whose body is projected from the adapter's scope. `message` is a sentence; `choice` is a `jx-select` over the options; `field` is the prompt's jx-textfield with its refusal. The four answers call the host's functions, and the host decides when the dialog closes.",tagName:"jx-dialog",$props:{headline:{$ref:"#/state/headline"},confirmLabel:{$ref:"#/state/confirmLabel"},secondaryLabel:{$ref:"#/state/secondaryLabel"},cancelLabel:{$ref:"#/state/cancelLabel"},destructive:{$ref:"#/state/destructive"},size:{$ref:"#/state/size"}},attributes:{headline:"${state.headline}","confirm-label":"${state.confirmLabel || null}","secondary-label":"${state.secondaryLabel || null}","cancel-label":"${state.cancelLabel || null}",part:"dialog-host"},onconfirm:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/confirm"},value:[]}]},onsecondary:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/secondary"},value:[]}]},oncancel:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/cancel"},value:[]}]},onclose:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},style:{'& [part="message"]':{$description:"The one part of a dialog that is text rather than interface, so it opts back in to selection. The root sets `user-select: none` and `styles/tokens.json` restates it on every `dialog`, so the headline, the labels and the buttons around this sentence stay unselectable; a message is often the thing a reader copies into a search or a bug report.",margin:"0 0 var(--jx-space-3)",userSelect:"text"},'& [part="message"]:last-child':{margin:"0"},'& [part="island"] > p, & [part="island"] > span, & [part="island"] > strong, & [part="island"] > em, & [part="island"] > code':{$description:"The island's own prose is the message's other form — a body richer than a sentence, written straight into the island from a lit template (studio-ui-guidelines.md §9.4) — so it is selectable for the same reason `[part=\"message\"]` is. The opt-in stops at those children because the island is ALSO the mount point for a whole document: the Open Grid picker and Push Schema's plan put their surfaces here, and `user-select` inherits, so a rule on the island itself would hand selection to every heading, source row and button they draw, which is the interface the policy exists to keep unselectable. A mounted surface roots a `div`; a message writes paragraphs and text-level spans, so the two forms are told apart by the child that arrives.",userSelect:"text"},'& [part="island"]:empty':{display:"none"},'& [part="message-slot"], & [part="choice-slot"], & [part="field-slot"]':{display:"contents"},'& [part="choice-row"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-1)",margin:"0 0 var(--jx-space-3)"},'& [part="choice-label"]':{fontSize:"var(--jx-text-sm)",color:"var(--jx-fg-dim)"},"& jx-textfield":{width:"100%"}},children:[{tagName:"div",attributes:{part:"message-slot",role:"none"},$switch:{$ref:"#/state/hasMessage"},cases:{true:{tagName:"p",attributes:{part:"message"},textContent:"${state.message}"}}},{tagName:"div",attributes:{part:"island"}},{tagName:"div",attributes:{part:"choice-slot",role:"none"},$switch:{$ref:"#/state/hasChoice"},cases:{true:{tagName:"div",attributes:{part:"choice-row"},children:[{tagName:"span",attributes:{part:"choice-label"},textContent:"${state.choiceLabel}"},{tagName:"jx-select",$props:{label:{$ref:"#/state/choiceLabel"},options:{$ref:"#/state/options"},value:{$ref:"#/state/chosen"}},attributes:{part:"choice"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/pick"},value:[{$ref:"event#/target/value"}]}]}}]}}},{tagName:"div",attributes:{part:"field-slot",role:"none"},$switch:{$ref:"#/state/hasField"},cases:{true:{tagName:"jx-textfield",$props:{label:{$ref:"#/state/headline"},value:{$ref:"#/state/value"},placeholder:{$ref:"#/state/placeholder"},invalid:{$ref:"#/state/invalid"},error:{$ref:"#/state/error"},multiline:{$ref:"#/state/multiline"},rows:{$ref:"#/state/rows"},mono:{$ref:"#/state/mono"}},attributes:{part:"field"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/input"},value:[{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"#/state/singleLine"},cases:{true:[{$switch:{$ref:"event#/key"},cases:{Enter:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/confirm"},value:[]}]}}]}}]},$description:"The prompt's one field. `multiline` is what makes it a paste box rather than a line: an import the author copied out of a `_redirects` file is column-aligned, so it also asks for `mono`. A multiline field takes Enter as a newline, which is why the Enter-confirms handler below is guarded on it — a paste box whose second line submits the dialog cannot be typed into."}}}]};T("dialog",oe);function An(e){if(e.querySelector('[part="dialog"]'))return Promise.resolve(e);return new Promise((t)=>{e.addEventListener("jx-ready",function o(n){if(n.target!==e&&!e.querySelector('[part="dialog"]'))return;e.removeEventListener("jx-ready",o),t(e)})})}function bs(e){let t=document.createElement("div");t.style.pointerEvents="auto",t.setAttribute(rt,zt("dialog",e.region)),e.layer.append(t);let o=v({cancel:()=>{e.onCancel()},cancelLabel:e.cancelLabel,choiceLabel:e.choice?.label??"",chosen:e.choice?.chosen??"",closed:()=>{e.onClosed()},confirm:()=>{e.onConfirm()},confirmLabel:e.confirmLabel,destructive:e.destructive===!0,error:"",hasChoice:e.choice!==void 0,hasField:e.field!==void 0,mono:e.field?.mono===!0,multiline:e.field?.multiline===!0,rows:e.field?.rows??"3",singleLine:e.field!==void 0&&e.field.multiline!==!0?"true":"false",hasMessage:e.message!==void 0&&e.message!=="",headline:e.headline,input:(r)=>{o.value=r,e.onInput?.(r)},invalid:!1,message:e.message??"",options:e.choice?.options??[],pick:(r)=>{e.onPick?.(r)},placeholder:e.field?.placeholder??"",secondary:()=>{e.onSecondary?.()},secondaryLabel:e.secondaryLabel??"",size:e.size??"sm",value:e.field?.value??""}),n=null,a=!1,i=()=>{},s=new Promise((r)=>{i=r}),l=R("dialog",o,t).then(async(r)=>{let c=r.root;if(a)return r.dispose(),c;if(n=r,await Promise.race([An(c),s]),a)return c;if(e.island?.(c.querySelector('[part="island"]')??c),un(c),e.field){let y=c.querySelector("jx-textfield");if(y)setTimeout(()=>{if(!a)Pm(y,e.field?.select??"all")},0)}return c});return{close(){if(a)return;a=!0,i();let r=n?.root;if(r instanceof HTMLElement)rn(r);n?.dispose(),n=null,t.remove()},host:t,ready:l,update(r){if(r.confirmLabel!==void 0)o.confirmLabel=r.confirmLabel;if(r.cancelLabel!==void 0)o.cancelLabel=r.cancelLabel;if(r.secondaryLabel!==void 0)o.secondaryLabel=r.secondaryLabel;if(r.message!==void 0)o.message=r.message,o.hasMessage=r.message!=="";if(r.value!==void 0)o.value=r.value;if(r.placeholder!==void 0)o.placeholder=r.placeholder;if(r.invalid!==void 0)o.invalid=r.invalid;if(r.error!==void 0)if(r.error!==""&&r.error===o.error){o.error="";let c=r.error;queueMicrotask(()=>{o.error=c})}else o.error=r.error;if(r.options!==void 0)o.options=r.options;if(r.chosen!==void 0)o.chosen=r.chosen}}}var re={$schema:"https://jxsuite.com/schema/v1",$id:"StudioToasts",$description:"The toast stack: a rendering of the notification service's toasts, newest last. Each row is projected by ui/layers.ts with its severity glyph and, where a recovery command exists, that command's title and gate; the two buttons call back into the host, which owns the records and their timers.",tagName:"div",attributes:{part:"stack"},style:{position:"absolute",right:"var(--jx-space-4)",bottom:"36px",display:"flex",flexDirection:"column",gap:"var(--jx-space-3)",alignItems:"flex-end",maxWidth:"min(420px, calc(100vw - 24px))",'& [part="toast"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-3)",pointerEvents:"auto",padding:"var(--jx-space-3)",border:"1px solid var(--jx-border)",borderLeft:"3px solid var(--jx-fg-dim)",borderRadius:"var(--jx-radius-md)",background:"var(--jx-bg-panel)",color:"var(--jx-fg)",fontSize:"var(--jx-text-sm)",lineHeight:"var(--jx-leading-sm)",boxShadow:"var(--jx-shadow-popover)"},'& [part="toast"][data-severity="success"]':{borderLeftColor:"var(--jx-success)"},'& [part="toast"][data-severity="info"]':{borderLeftColor:"var(--jx-accent)"},'& [part="toast"][data-severity="warn"]':{borderLeftColor:"var(--jx-warning)"},'& [part="toast"][data-severity="error"]':{borderLeftColor:"var(--jx-danger)"},'& [part="icon"]':{flex:"none",width:"14px",textAlign:"center",fontWeight:"700"},'& [data-severity="success"] [part="icon"]':{color:"var(--jx-success)"},'& [data-severity="info"] [part="icon"]':{color:"var(--jx-accent)"},'& [data-severity="warn"] [part="icon"]':{color:"var(--jx-warning)"},'& [data-severity="error"] [part="icon"]':{color:"var(--jx-danger)"},'& [part="message"]':{flex:"1",minWidth:"0",overflow:"hidden",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"3"},'& [part="action-slot"]':{display:"contents"},'& [part="action"] > [part="control"]':{color:"var(--jx-accent)"}},children:[{$prototype:"Array",items:{$ref:"#/state/toasts"},key:{$ref:"$map/item/id"},map:{tagName:"div",attributes:{part:"toast","data-severity":"${$map.item.severity}"},children:[{tagName:"span",attributes:{part:"icon","aria-hidden":"true"},textContent:"${$map.item.icon}"},{tagName:"span",attributes:{part:"message"},textContent:"${$map.item.message}"},{tagName:"span",attributes:{part:"action-slot",role:"none"},$switch:{$ref:"$map/item/hasAction"},cases:{true:{tagName:"jx-button",$props:{size:"sm",quiet:!0,disabled:{$ref:"$map/item/actionDisabled"}},attributes:{part:"action",title:"${$map.item.actionTitle}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/runAction"},value:[{$ref:"$map/item/id"}]}]},children:[{tagName:"span",textContent:"${$map.item.actionLabel}"}]}}},{tagName:"jx-action-button",$props:{label:"Dismiss notification",hint:"Dismiss notification",icon:"x",size:"sm"},attributes:{part:"dismiss"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/dismissToast"},value:[{$ref:"$map/item/id"}]}]}}]}}]};function $e(e){return e instanceof RangeError||e instanceof Error&&e.name==="CommandUnavailableError"}function on(e,t,o,n=t){let a=(s)=>{if(!$e(s))console.error(`${n}: command "${t}" failed`,s);k.error(te(s),{key:`command.run:${t}`,source:n})},i;try{i=e.run(t,o)}catch(s){return a(s),Promise.resolve()}return Promise.resolve(i).catch(a)}function Rc(e,t,o){let n=ne();return n?on(n,e,t,o):Promise.resolve()}var se,F,q,E;function Ct(e){return(e==="popover"?se:e==="modal"?F:e==="toast"?E:q)||document.body}function mk(){se=document.querySelector("#layer-popover"),F=document.querySelector("#layer-modal"),q=document.querySelector("#layer-dialog"),E=document.querySelector("#layer-toast"),Ce()}var ae="jx-dialog[data-open], dialog[open]";function Am(){return Boolean(q?.querySelector(ae)||F?.querySelector(ae))}function Xo(e,t,o={}){let{confirmLabel:n="Confirm",cancelLabel:a="Cancel",destructive:i=!1}=o;return new Promise((s)=>{let d=!1,l=(c)=>{if(d)return;d=!0,r.close(),s(c)},r=bs({cancelLabel:a,confirmLabel:n,destructive:i,headline:e,layer:Ct("dialog"),...G(t),onCancel:()=>l(!1),onClosed:()=>l(!1),onConfirm:()=>l(!0)})})}function Bx(e,t,o={}){let{saveLabel:n="Save",discardLabel:a="Discard",cancelLabel:i="Cancel"}=o;return new Promise((s)=>{let d=!1,l=(c)=>{if(d)return;d=!0,r.close(),s(c)},r=bs({cancelLabel:i,confirmLabel:n,headline:e,layer:Ct("dialog"),...G(t),onCancel:()=>l("cancel"),onClosed:()=>l("cancel"),onConfirm:()=>l("save"),onSecondary:()=>l("discard"),secondaryLabel:a})})}function G(e){if(typeof e==="string")return{message:e};return{island:(t)=>{Ni(e,t)}}}function Nn(e,t={}){let{cancelLabel:o="Cancel",choice:n,confirmLabel:a="OK",message:i,mono:s=!1,multiline:d=!1,placeholder:l="",rows:r="3",select:c="all",size:y,validate:J,value:le=""}=t,D=(m)=>J?J(m,b):m.trim()?"":"Enter a value.",p=le,b=n?.initial??"",f="",U=!1,z=()=>typeof l==="function"?l():l,W=()=>n?n.options().map((m)=>({label:m.label,value:m.value})):[];return new Promise((m)=>{let V=!1,O=(u)=>{if(V)return;V=!0,N.close(),m(u)},K=(u)=>{f=u,N.update({error:f,invalid:f!==""})},N=bs({cancelLabel:o,confirmLabel:a,headline:e,layer:Ct("dialog"),...i===void 0?{}:G(i),...n?{choice:{chosen:b,label:n.label,options:W()}}:{},field:{mono:s,multiline:d,placeholder:z(),rows:r,select:c,value:p},...y===void 0?{}:{size:y},onCancel:()=>O(null),onClosed:()=>O(null),onConfirm:()=>{let u=D(p);if(u){K(u);return}O(p.trim())},onInput:(u)=>{U=!0,p=u;let x=D(p);if(x!==f)K(x)},onPick:(u)=>{b=u,n?.onChange?.(u);let x=D(p);f=U||f?x:"",N.update({chosen:b,error:f,invalid:f!=="",options:W(),placeholder:z()})}})})}var M=new Map;function vs(e,t){let o=`${e}:${t}`,n=M.get(o);if(n&&n.parentElement)return n;return n=document.createElement("div"),n.style.pointerEvents="auto",n.setAttribute(rt,zt(e,t)),Ct(e).append(n),M.set(o,n),n}function Nm(e,t){let o=`${e}:${t}`,n=M.get(o);if(n)Ni(tt,n),n.remove(),M.delete(o)}var Re=180,Le={error:"✕",info:"ℹ",success:"✓",warn:"!"},C=null,h=new Map,g=new Set;function Te(){return globalThis.matchMedia?.("(prefers-reduced-motion: reduce)").matches===!0}function we(){try{return new URLSearchParams(globalThis.location?.search??"").get("automation")==="1"}catch{return!1}}function gk(){return[...g].map((e)=>`overlay: toast ${e} settling in`)}function _(e){let t=h.get(e);if(t!==void 0)clearTimeout(t),h.delete(e);g.delete(e),Wd(e)}function Ee(e){if(h.has(e.id)||g.has(e.id))return;let t=Te()?0:Re;if(t>0)g.add(e.id),setTimeout(()=>g.delete(e.id),t);let o=e.timeoutMs??0;if(o<=0||we())return;h.set(e.id,setTimeout(()=>_(e.id),o))}T("toasts",re);var I=null,j=null,w=null;function ie(){return I??=v({dismissToast:(e)=>{_(e)},runAction:(e)=>{let t=$c.find((n)=>n.id===e),o=ne();if(!t?.action||!o)return;_(e),on(o,t.action,t.actionArgs,"Notifications")},toasts:[]}),I}function Me(e){let t=e.action===void 0?null:ne(),o=e.action,n=t&&o!==void 0?t.get(o):void 0,a=n&&o!==void 0&&t.isVisible(o)?n:null,i=a&&o!==void 0?t.disabledReason(o):void 0;return{actionDisabled:i!==void 0,actionLabel:a?.title??"",actionTitle:a===null||a===void 0?"":i===void 0?a.title:`${a.title} — requires ${i}`,hasAction:a!==null&&a!==void 0,icon:Le[e.severity],id:e.id,message:e.message,severity:e.severity}}function Ce(){if(je(),!E)return;C=ge(),C.run(()=>{Q(()=>{$c.length,ne();for(let e of $c)Ee(e);ie().toasts=$c.map((e)=>Me(e))})}),j=R("toasts",ie(),E),j.then((e)=>{w=e})}function je(){C?.stop(),C=null;for(let t of h.values())clearTimeout(t);h.clear(),g.clear();let e=j;if(j=null,w)w.dispose(),w=null;else if(e)e.then((t)=>t.dispose());I=null}
|
|
2
|
-
export{
|
|
1
|
+
import{tt,Ni}from"./studio-5g0ag7c0.js";import{wI,Wx,un,rn,Fm,SI,ne}from"./studio-geq1ea6k.js";import{ge,Q,v,Dc,k,Vd}from"./studio-vzacdfsc.js";import{te}from"./studio-ery42sqr.js";var rt="data-jx-region",ce=["rail","navigator","inspector","pane","dock.bottom","statusbar","commandbar","overlay"],de=new Set(["dock.bottom"]);function ue(e){let t=e.indexOf("/"),o=t===-1?e:e.slice(0,t),n=t===-1?void 0:e.slice(t+1);if(n===""||o==="")return null;let a=o,i;if(!de.has(o)){let s=o.indexOf(".");if(s!==-1){if(a=o.slice(0,s),i=o.slice(s+1),i==="")return null}}if(!ce.includes(a))return null;return i===void 0?n===void 0?{surface:a}:{part:n,surface:a}:n===void 0?{instance:i,surface:a}:{instance:i,part:n,surface:a}}function fe(e){return ue(e)!==null}function me(e){if(e==="pane")return"pane.primary";return e.startsWith("pane/")?`pane.primary/${e.slice(5)}`:e}function B(e){return e??document}var pe=[{locate:([,e],t)=>{let n=Rp(`inspector/field:${e}`,t)?.querySelector('[part="browse"]');return n?[n]:[]},pattern:/^inspector\/field:(.+)\/browse$/},{locate:([,e],t)=>{let o=Rp("inspector",t);return o?[...o.querySelectorAll(`[data-prop="${CSS.escape(e)}"]`)]:[]},pattern:/^inspector\/field:(.+)$/}];function ve(e,t){let o=me(e);if(!fe(o))return[];let n=[...B(t).querySelectorAll(`[data-jx-region="${CSS.escape(o)}"]`)];if(n.length>0)return n;for(let a of pe){let i=o.match(a.pattern);if(i)return a.locate(i,B(t))}return[]}function Rp(e,t){return ve(e,t).at(-1)??null}var gk={dock:"dock.bottom",inspector:"inspector",navigator:"navigator",pane:"pane.primary",rail:"rail",status:"statusbar"};function Zi(e,t){return t?`pane.${e}/${t}`:`pane.${e}`}function pI(e){return Zi(e,"tabs")}function fI(e){return`navigator/panel:${e}`}function mI(e){return`inspector/tab:${e}`}var gI="navigator/statements";function bI(e){return`inspector/statements:${e}`}function Rv(e){return`dock.bottom/panel:${e}`}var he={dialog:"dialog",modal:"dialog",popover:"menu",toast:"toasts"};function zt(e,t){let o=he[e];return t?`overlay.${o}:${t}`:`overlay.${o}`}var A=new Map,Y=1;function X(e){let t=Y;return Y+=1,A.set(t,{...e,id:t}),t}function H(e){A.delete(e)}function Z(){return[...A.values()]}function uI(e){let t=e.toLowerCase();return Z().filter((o)=>o.elements.has(t))}function hI(e){return Z().filter((t)=>t.name===e)}var P=null;function mk(e=document){return P??=SI({document:e}),P}function ee(){return P??mk()}var S="jx-studio:/surfaces/",L=new Map;function T(e,t){L.set(e,t),Wx(ye(e),t)}function ye(e){return`${S}${e}.json`}function vI(e){return L.get(e)}function be(e){if(!e.startsWith(S)||!e.endsWith(".json"))return;return L.get(e.slice(S.length,-5))}async function R(e,t,o,n={}){let a=L.get(e);if(!a)throw Error(`Studio surface "${e}" is not registered`);if(await ee(),n.region)o.setAttribute(rt,n.region);let i=await wI(a,o,{scope:t,base:S,resolver:be,...n.onNodeCreated?{onNodeCreated:n.onNodeCreated}:{},...n.onNodeMoved?{onNodeMoved:n.onNodeMoved}:{},...n.signal?{signal:n.signal}:{}}),s=(r)=>({dispose:r,elements:i.elements,root:i.root,scope:i.scope});if(n.signal?.aborted)return s(i.dispose);let d=0,l=()=>{i.dispose(),H(d)};return d=X({elements:i.elements,host:o,name:e,remount:async()=>{l(),await R(e,t,o,n)}}),n.signal?.addEventListener("abort",()=>H(d),{once:!0}),s(l)}var oe={$schema:"https://jxsuite.com/schema/v1",$id:"StudioDialog",$description:"Studio's confirm, save-or-discard and prompt dialogs: one jx-dialog whose body is projected from the adapter's scope. `message` is a sentence; `choice` is a `jx-select` over the options; `field` is the prompt's jx-textfield with its refusal. The four answers call the host's functions, and the host decides when the dialog closes.",tagName:"jx-dialog",$props:{headline:{$ref:"#/state/headline"},confirmLabel:{$ref:"#/state/confirmLabel"},secondaryLabel:{$ref:"#/state/secondaryLabel"},cancelLabel:{$ref:"#/state/cancelLabel"},destructive:{$ref:"#/state/destructive"},size:{$ref:"#/state/size"}},attributes:{headline:"${state.headline}","confirm-label":"${state.confirmLabel || null}","secondary-label":"${state.secondaryLabel || null}","cancel-label":"${state.cancelLabel || null}",part:"dialog-host"},onconfirm:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/confirm"},value:[]}]},onsecondary:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/secondary"},value:[]}]},oncancel:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/cancel"},value:[]}]},onclose:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},style:{'& [part="message"]':{$description:"The one part of a dialog that is text rather than interface, so it opts back in to selection. The root sets `user-select: none` and `styles/tokens.json` restates it on every `dialog`, so the headline, the labels and the buttons around this sentence stay unselectable; a message is often the thing a reader copies into a search or a bug report.",margin:"0 0 var(--jx-space-3)",userSelect:"text"},'& [part="message"]:last-child':{margin:"0"},'& [part="island"] > p, & [part="island"] > span, & [part="island"] > strong, & [part="island"] > em, & [part="island"] > code':{$description:"The island's own prose is the message's other form — a body richer than a sentence, written straight into the island from a lit template (studio-ui-guidelines.md §9.4) — so it is selectable for the same reason `[part=\"message\"]` is. The opt-in stops at those children because the island is ALSO the mount point for a whole document: the Open Grid picker and Push Schema's plan put their surfaces here, and `user-select` inherits, so a rule on the island itself would hand selection to every heading, source row and button they draw, which is the interface the policy exists to keep unselectable. A mounted surface roots a `div`; a message writes paragraphs and text-level spans, so the two forms are told apart by the child that arrives.",userSelect:"text"},'& [part="island"]:empty':{display:"none"},'& [part="message-slot"], & [part="choice-slot"], & [part="field-slot"]':{display:"contents"},'& [part="choice-row"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-1)",margin:"0 0 var(--jx-space-3)"},'& [part="choice-label"]':{fontSize:"var(--jx-text-sm)",color:"var(--jx-fg-dim)"},"& jx-textfield":{width:"100%"}},children:[{tagName:"div",attributes:{part:"message-slot",role:"none"},$switch:{$ref:"#/state/hasMessage"},cases:{true:{tagName:"p",attributes:{part:"message"},textContent:"${state.message}"}}},{tagName:"div",attributes:{part:"island"}},{tagName:"div",attributes:{part:"choice-slot",role:"none"},$switch:{$ref:"#/state/hasChoice"},cases:{true:{tagName:"div",attributes:{part:"choice-row"},children:[{tagName:"span",attributes:{part:"choice-label"},textContent:"${state.choiceLabel}"},{tagName:"jx-select",$props:{label:{$ref:"#/state/choiceLabel"},options:{$ref:"#/state/options"},value:{$ref:"#/state/chosen"}},attributes:{part:"choice"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/pick"},value:[{$ref:"event#/target/value"}]}]}}]}}},{tagName:"div",attributes:{part:"field-slot",role:"none"},$switch:{$ref:"#/state/hasField"},cases:{true:{tagName:"jx-textfield",$props:{label:{$ref:"#/state/headline"},value:{$ref:"#/state/value"},placeholder:{$ref:"#/state/placeholder"},invalid:{$ref:"#/state/invalid"},error:{$ref:"#/state/error"},multiline:{$ref:"#/state/multiline"},rows:{$ref:"#/state/rows"},mono:{$ref:"#/state/mono"}},attributes:{part:"field"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/input"},value:[{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"#/state/singleLine"},cases:{true:[{$switch:{$ref:"event#/key"},cases:{Enter:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/confirm"},value:[]}]}}]}}]},$description:"The prompt's one field. `multiline` is what makes it a paste box rather than a line: an import the author copied out of a `_redirects` file is column-aligned, so it also asks for `mono`. A multiline field takes Enter as a newline, which is why the Enter-confirms handler below is guarded on it — a paste box whose second line submits the dialog cannot be typed into."}}}]};T("dialog",oe);function An(e){if(e.querySelector('[part="dialog"]'))return Promise.resolve(e);return new Promise((t)=>{e.addEventListener("jx-ready",function o(n){if(n.target!==e&&!e.querySelector('[part="dialog"]'))return;e.removeEventListener("jx-ready",o),t(e)})})}function bs(e){let t=document.createElement("div");t.style.pointerEvents="auto",t.setAttribute(rt,zt("dialog",e.region)),e.layer.append(t);let o=v({cancel:()=>{e.onCancel()},cancelLabel:e.cancelLabel,choiceLabel:e.choice?.label??"",chosen:e.choice?.chosen??"",closed:()=>{e.onClosed()},confirm:()=>{e.onConfirm()},confirmLabel:e.confirmLabel,destructive:e.destructive===!0,error:"",hasChoice:e.choice!==void 0,hasField:e.field!==void 0,mono:e.field?.mono===!0,multiline:e.field?.multiline===!0,rows:e.field?.rows??"3",singleLine:e.field!==void 0&&e.field.multiline!==!0?"true":"false",hasMessage:e.message!==void 0&&e.message!=="",headline:e.headline,input:(r)=>{o.value=r,e.onInput?.(r)},invalid:!1,message:e.message??"",options:e.choice?.options??[],pick:(r)=>{e.onPick?.(r)},placeholder:e.field?.placeholder??"",secondary:()=>{e.onSecondary?.()},secondaryLabel:e.secondaryLabel??"",size:e.size??"sm",value:e.field?.value??""}),n=null,a=!1,i=()=>{},s=new Promise((r)=>{i=r}),l=R("dialog",o,t).then(async(r)=>{let c=r.root;if(a)return r.dispose(),c;if(n=r,await Promise.race([An(c),s]),a)return c;if(e.island?.(c.querySelector('[part="island"]')??c),un(c),e.field){let y=c.querySelector("jx-textfield");if(y)setTimeout(()=>{if(!a)Fm(y,e.field?.select??"all")},0)}return c});return{close(){if(a)return;a=!0,i();let r=n?.root;if(r instanceof HTMLElement)rn(r);n?.dispose(),n=null,t.remove()},host:t,ready:l,update(r){if(r.confirmLabel!==void 0)o.confirmLabel=r.confirmLabel;if(r.cancelLabel!==void 0)o.cancelLabel=r.cancelLabel;if(r.secondaryLabel!==void 0)o.secondaryLabel=r.secondaryLabel;if(r.message!==void 0)o.message=r.message,o.hasMessage=r.message!=="";if(r.value!==void 0)o.value=r.value;if(r.placeholder!==void 0)o.placeholder=r.placeholder;if(r.invalid!==void 0)o.invalid=r.invalid;if(r.error!==void 0)if(r.error!==""&&r.error===o.error){o.error="";let c=r.error;queueMicrotask(()=>{o.error=c})}else o.error=r.error;if(r.options!==void 0)o.options=r.options;if(r.chosen!==void 0)o.chosen=r.chosen}}}var re={$schema:"https://jxsuite.com/schema/v1",$id:"StudioToasts",$description:"The toast stack: a rendering of the notification service's toasts, newest last. Each row is projected by ui/layers.ts with its severity glyph and, where a recovery command exists, that command's title and gate; the two buttons call back into the host, which owns the records and their timers.",tagName:"div",attributes:{part:"stack"},style:{position:"absolute",right:"var(--jx-space-4)",bottom:"36px",display:"flex",flexDirection:"column",gap:"var(--jx-space-3)",alignItems:"flex-end",maxWidth:"min(420px, calc(100vw - 24px))",'& [part="toast"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-3)",pointerEvents:"auto",padding:"var(--jx-space-3)",border:"1px solid var(--jx-border)",borderLeft:"3px solid var(--jx-fg-dim)",borderRadius:"var(--jx-radius-md)",background:"var(--jx-bg-panel)",color:"var(--jx-fg)",fontSize:"var(--jx-text-sm)",lineHeight:"var(--jx-leading-sm)",boxShadow:"var(--jx-shadow-popover)"},'& [part="toast"][data-severity="success"]':{borderLeftColor:"var(--jx-success)"},'& [part="toast"][data-severity="info"]':{borderLeftColor:"var(--jx-accent)"},'& [part="toast"][data-severity="warn"]':{borderLeftColor:"var(--jx-warning)"},'& [part="toast"][data-severity="error"]':{borderLeftColor:"var(--jx-danger)"},'& [part="icon"]':{flex:"none",width:"14px",textAlign:"center",fontWeight:"700"},'& [data-severity="success"] [part="icon"]':{color:"var(--jx-success)"},'& [data-severity="info"] [part="icon"]':{color:"var(--jx-accent)"},'& [data-severity="warn"] [part="icon"]':{color:"var(--jx-warning)"},'& [data-severity="error"] [part="icon"]':{color:"var(--jx-danger)"},'& [part="message"]':{flex:"1",minWidth:"0",overflow:"hidden",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"3"},'& [part="action-slot"]':{display:"contents"},'& [part="action"] > [part="control"]':{color:"var(--jx-accent)"}},children:[{$prototype:"Array",items:{$ref:"#/state/toasts"},key:{$ref:"$map/item/id"},map:{tagName:"div",attributes:{part:"toast","data-severity":"${$map.item.severity}"},children:[{tagName:"span",attributes:{part:"icon","aria-hidden":"true"},textContent:"${$map.item.icon}"},{tagName:"span",attributes:{part:"message"},textContent:"${$map.item.message}"},{tagName:"span",attributes:{part:"action-slot",role:"none"},$switch:{$ref:"$map/item/hasAction"},cases:{true:{tagName:"jx-button",$props:{size:"sm",quiet:!0,disabled:{$ref:"$map/item/actionDisabled"}},attributes:{part:"action",title:"${$map.item.actionTitle}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/runAction"},value:[{$ref:"$map/item/id"}]}]},children:[{tagName:"span",textContent:"${$map.item.actionLabel}"}]}}},{tagName:"jx-action-button",$props:{label:"Dismiss notification",hint:"Dismiss notification",icon:"x",size:"sm"},attributes:{part:"dismiss"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/dismissToast"},value:[{$ref:"$map/item/id"}]}]}}]}}]};function $e(e){return e instanceof RangeError||e instanceof Error&&e.name==="CommandUnavailableError"}function on(e,t,o,n=t){let a=(s)=>{if(!$e(s))console.error(`${n}: command "${t}" failed`,s);k.error(te(s),{key:`command.run:${t}`,source:n})},i;try{i=e.run(t,o)}catch(s){return a(s),Promise.resolve()}return Promise.resolve(i).catch(a)}function $c(e,t,o){let n=ne();return n?on(n,e,t,o):Promise.resolve()}var se,F,q,E;function Ct(e){return(e==="popover"?se:e==="modal"?F:e==="toast"?E:q)||document.body}function bk(){se=document.querySelector("#layer-popover"),F=document.querySelector("#layer-modal"),q=document.querySelector("#layer-dialog"),E=document.querySelector("#layer-toast"),Ce()}var ae="jx-dialog[data-open], dialog[open]";function Nm(){return Boolean(q?.querySelector(ae)||F?.querySelector(ae))}function Xo(e,t,o={}){let{confirmLabel:n="Confirm",cancelLabel:a="Cancel",destructive:i=!1}=o;return new Promise((s)=>{let d=!1,l=(c)=>{if(d)return;d=!0,r.close(),s(c)},r=bs({cancelLabel:a,confirmLabel:n,destructive:i,headline:e,layer:Ct("dialog"),...G(t),onCancel:()=>l(!1),onClosed:()=>l(!1),onConfirm:()=>l(!0)})})}function zx(e,t,o={}){let{saveLabel:n="Save",discardLabel:a="Discard",cancelLabel:i="Cancel"}=o;return new Promise((s)=>{let d=!1,l=(c)=>{if(d)return;d=!0,r.close(),s(c)},r=bs({cancelLabel:i,confirmLabel:n,headline:e,layer:Ct("dialog"),...G(t),onCancel:()=>l("cancel"),onClosed:()=>l("cancel"),onConfirm:()=>l("save"),onSecondary:()=>l("discard"),secondaryLabel:a})})}function G(e){if(typeof e==="string")return{message:e};return{island:(t)=>{Ni(e,t)}}}function Nn(e,t={}){let{cancelLabel:o="Cancel",choice:n,confirmLabel:a="OK",message:i,mono:s=!1,multiline:d=!1,placeholder:l="",rows:r="3",select:c="all",size:y,validate:J,value:le=""}=t,D=(m)=>J?J(m,b):m.trim()?"":"Enter a value.",p=le,b=n?.initial??"",f="",U=!1,z=()=>typeof l==="function"?l():l,W=()=>n?n.options().map((m)=>({label:m.label,value:m.value})):[];return new Promise((m)=>{let V=!1,O=(u)=>{if(V)return;V=!0,N.close(),m(u)},K=(u)=>{f=u,N.update({error:f,invalid:f!==""})},N=bs({cancelLabel:o,confirmLabel:a,headline:e,layer:Ct("dialog"),...i===void 0?{}:G(i),...n?{choice:{chosen:b,label:n.label,options:W()}}:{},field:{mono:s,multiline:d,placeholder:z(),rows:r,select:c,value:p},...y===void 0?{}:{size:y},onCancel:()=>O(null),onClosed:()=>O(null),onConfirm:()=>{let u=D(p);if(u){K(u);return}O(p.trim())},onInput:(u)=>{U=!0,p=u;let x=D(p);if(x!==f)K(x)},onPick:(u)=>{b=u,n?.onChange?.(u);let x=D(p);f=U||f?x:"",N.update({chosen:b,error:f,invalid:f!=="",options:W(),placeholder:z()})}})})}var M=new Map;function vs(e,t){let o=`${e}:${t}`,n=M.get(o);if(n&&n.parentElement)return n;return n=document.createElement("div"),n.style.pointerEvents="auto",n.setAttribute(rt,zt(e,t)),Ct(e).append(n),M.set(o,n),n}function Om(e,t){let o=`${e}:${t}`,n=M.get(o);if(n)Ni(tt,n),n.remove(),M.delete(o)}var Re=180,Le={error:"✕",info:"ℹ",success:"✓",warn:"!"},C=null,h=new Map,g=new Set;function Te(){return globalThis.matchMedia?.("(prefers-reduced-motion: reduce)").matches===!0}function we(){try{return new URLSearchParams(globalThis.location?.search??"").get("automation")==="1"}catch{return!1}}function vk(){return[...g].map((e)=>`overlay: toast ${e} settling in`)}function _(e){let t=h.get(e);if(t!==void 0)clearTimeout(t),h.delete(e);g.delete(e),Vd(e)}function Ee(e){if(h.has(e.id)||g.has(e.id))return;let t=Te()?0:Re;if(t>0)g.add(e.id),setTimeout(()=>g.delete(e.id),t);let o=e.timeoutMs??0;if(o<=0||we())return;h.set(e.id,setTimeout(()=>_(e.id),o))}T("toasts",re);var I=null,j=null,w=null;function ie(){return I??=v({dismissToast:(e)=>{_(e)},runAction:(e)=>{let t=Dc.find((n)=>n.id===e),o=ne();if(!t?.action||!o)return;_(e),on(o,t.action,t.actionArgs,"Notifications")},toasts:[]}),I}function Me(e){let t=e.action===void 0?null:ne(),o=e.action,n=t&&o!==void 0?t.get(o):void 0,a=n&&o!==void 0&&t.isVisible(o)?n:null,i=a&&o!==void 0?t.disabledReason(o):void 0;return{actionDisabled:i!==void 0,actionLabel:a?.title??"",actionTitle:a===null||a===void 0?"":i===void 0?a.title:`${a.title} — requires ${i}`,hasAction:a!==null&&a!==void 0,icon:Le[e.severity],id:e.id,message:e.message,severity:e.severity}}function Ce(){if(je(),!E)return;C=ge(),C.run(()=>{Q(()=>{Dc.length,ne();for(let e of Dc)Ee(e);ie().toasts=Dc.map((e)=>Me(e))})}),j=R("toasts",ie(),E),j.then((e)=>{w=e})}function je(){C?.stop(),C=null;for(let t of h.values())clearTimeout(t);h.clear(),g.clear();let e=j;if(j=null,w)w.dispose(),w=null;else if(e)e.then((t)=>t.dispose());I=null}
|
|
2
|
+
export{uI,hI,mk,rt,Rp,gk,Zi,pI,fI,mI,gI,bI,Rv,zt,T,vI,R,An,bs,on,$c,Ct,bk,Nm,Xo,zx,Nn,vs,Om,vk};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
5
|
-
//# sourceMappingURL=studio-
|
|
4
|
+
//# debugId=50D5EE6CBEB4C8D464756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-e7xxa0sj.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{Bv,zv}from"./studio-cpxkgjrj.js";import{vu,me}from"./studio-v2bvmbjj.js";var r={document:Bv,project:zv},a={...r},c={document:null,project:null},u=!1;function i(n){return c[n]??=(async()=>{try{let{default:t}=await (me("nkxms0ay"),import("./2020-nkxms0ay.js").then((m)=>vu(m.default,1))),{default:e}=await (me("gybvv7a6"),import("./index-gybvv7a6.js").then((m)=>vu(m.default,1))),o=new t({allErrors:!0,strict:!1,allowUnionTypes:!0});return e(o),o.compile(a[n])}catch(t){if(!u)u=!0,console.error(`[jx] ${n} schema validation is unavailable — the AI assistant's schema gate is a `+"no-op for this session:",t);return null}})(),c[n]}function l(n){return typeof n==="object"&&n!==null&&!Array.isArray(n)&&Object.keys(n).length>0?n:void 0}function b$(n){let t=l(n?.document)??r.document,e=l(n?.project)??r.project,o=t!==r.document||e!==r.project;if(t===a.document&&e===a.project)return o;return a.document=t,a.project=e,c.document=null,c.project=null,o}var m=["unevaluatedProperty","additionalProperty","missingProperty"];function s(n){return(n.errors||[]).map((t)=>{let e=m.find((d)=>typeof t.params?.[d]==="string"),o=e?` (${String(t.params?.[e])})`:"";return`${t.instancePath||"(root)"}: ${t.message}${o}`})}async function op(n){let t=await i("document");if(!t||t(n))return[];return s(t)}async function v$(n){let t=await i("document");if(!t)return null;return t(n)?[]:s(t)}async function ud(n){let t=await i("project");if(!t||t(n))return[];return s(t)}
|
|
2
|
+
export{b$,op,v$,ud};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
5
|
-
//# sourceMappingURL=studio-
|
|
4
|
+
//# debugId=8F98FF90BD71CC4264756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-ecaz25vk.js.map
|