@jxsuite/studio 10.4.0 → 10.5.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-7sx2vexa.js +4 -0
- package/dist/chunks/adapter-12dxr3z7.js +4 -0
- package/dist/chunks/{add-new-flow-v0pm96mr.js → add-new-flow-any4pw2q.js} +3 -3
- package/dist/chunks/{cf-account-picker-xb8vvt2h.js → cf-account-picker-ajh60k54.js} +3 -3
- package/dist/chunks/cf-settings-hbj16kh3.js +4 -0
- package/dist/chunks/{color-area-h8dbasp1.js → color-area-gbcftzh3.js} +2 -2
- package/dist/chunks/{color-field-qv5r2b16.js → color-field-85136598.js} +3 -3
- package/dist/chunks/{color-slider-nz2mrzky.js → color-slider-w1s3ndd8.js} +2 -2
- package/dist/chunks/color-thzpppyc.js +4 -0
- package/dist/chunks/{combobox-6hs00996.js → combobox-dk98wc5x.js} +3 -3
- package/dist/chunks/components-a98hzqw9.js +4 -0
- package/dist/chunks/content-source-jq3fjs3w.js +4 -0
- package/dist/chunks/{convert-to-repeater-r8sfxjjm.js → convert-to-repeater-g66r6qp1.js} +3 -3
- package/dist/chunks/editor-rth1rzj8.js +4 -0
- package/dist/chunks/entry-commands-02j0s19w.js +4 -0
- package/dist/chunks/{extension-sections-vjzw46xb.js → extension-sections-rqrs7dr0.js} +3 -3
- package/dist/chunks/file-ops-6a49er4c.js +4 -0
- package/dist/chunks/files-b2p9y0yz.js +4 -0
- package/dist/chunks/format-host-7xe57k1s.js +4 -0
- package/dist/chunks/fs-events-0xsy168g.js +4 -0
- package/dist/chunks/grid-open-h3q4fjy5.js +4 -0
- package/dist/chunks/{grid-view-2f03wcgw.js → grid-view-0v4hjspb.js} +17 -17
- package/dist/chunks/{icons-gb967qc8.js → icons-j9eksgew.js} +2 -2
- package/dist/chunks/{iframe-entry-btck0e9s.js → iframe-entry-4zqtn3ry.js} +4 -4
- package/dist/chunks/{iframe-entry-b5qgggyp.js → iframe-entry-54kwwhmg.js} +4 -4
- package/dist/chunks/{iframe-entry-42hpmwz5.js → iframe-entry-m24fza30.js} +4 -4
- package/dist/chunks/iframe-host-8jcmaktg.js +4 -0
- package/dist/chunks/{image-bake-4afr4y6a.js → image-bake-m8gzaan9.js} +3 -3
- package/dist/chunks/{image-editor-x7t8jbjn.js → image-editor-0afyws7c.js} +3 -3
- package/dist/chunks/{index-yjrfeks8.js → index-2q88g57p.js} +3 -3
- package/dist/chunks/index-7nj2375a.js +4 -0
- package/dist/chunks/{javascript-hy2mws8v.js → javascript-5sxtr1g7.js} +3 -3
- package/dist/chunks/jsonMode-m6sf47hq.js +13 -0
- package/dist/chunks/jx-validate-808zgbgy.js +4 -0
- package/dist/chunks/layers-0ffdtqjn.js +4 -0
- package/dist/chunks/layers-panel-rw62wtvf.js +4 -0
- package/dist/chunks/{listbox-7gka1h86.js → listbox-k5p41049.js} +2 -2
- package/dist/chunks/lit-html-9bz9rcfv.js +4 -0
- package/dist/chunks/media-library-2a5hdbek.js +4 -0
- package/dist/chunks/media-open-069kzhj4.js +4 -0
- package/dist/chunks/media-picker-4p4pd28y.js +4 -0
- package/dist/chunks/menu-26nez152.js +4 -0
- package/dist/chunks/{monaco-binding-a51py33c.js → monaco-binding-1s2b8snq.js} +3 -3
- package/dist/chunks/monaco-buffer-m9fd2dka.js +4 -0
- package/dist/chunks/monaco-setup-e0crh3v6.js +4 -0
- package/dist/chunks/notify-re3js157.js +4 -0
- package/dist/chunks/platform-rywy3tkg.js +4 -0
- package/dist/chunks/popover-fhdnt4be.js +4 -0
- package/dist/chunks/publish-panel-czkpg8m4.js +4 -0
- package/dist/chunks/{publish-quick-4fwngwrw.js → publish-quick-b9wbhqj6.js} +3 -3
- package/dist/chunks/publish-workspace-yy6d23b7.js +4 -0
- package/dist/chunks/quick-search-tp7pjnmv.js +4 -0
- package/dist/chunks/references-wd2yj8s1.js +4 -0
- package/dist/chunks/right-panel-x971k0zc.js +4 -0
- package/dist/chunks/source-control-k4p00hpe.js +4 -0
- package/dist/chunks/{split-m5rwn31z.js → split-qh21j2b0.js} +2 -2
- package/dist/chunks/{studio-v5wktj6f.js → studio-151kgn69.js} +4 -4
- package/dist/chunks/studio-15mfah02.js +10 -0
- package/dist/chunks/studio-1a7zshnv.js +5 -0
- package/dist/chunks/studio-1d8m5s38.js +16 -0
- package/dist/chunks/studio-35pmfjtx.js +5 -0
- package/dist/chunks/{studio-3na1r48j.js → studio-3yr1zdp9.js} +8 -8
- package/dist/chunks/studio-43pynnhz.js +5 -0
- package/dist/chunks/studio-44xqe0b7.js +4 -0
- package/dist/chunks/{studio-hh394phe.js → studio-48yzqzqr.js} +4 -4
- package/dist/chunks/{studio-9gr7xs9r.js → studio-4jy967rj.js} +5 -5
- package/dist/chunks/{studio-4bgvvzhv.js → studio-4ncxzw5m.js} +4 -4
- package/dist/chunks/{studio-pm17wdc4.js → studio-4s5bka8t.js} +4 -4
- package/dist/chunks/{studio-5tet77de.js → studio-4z0cdh16.js} +3 -3
- package/dist/chunks/studio-5rq3e4q5.js +5 -0
- package/dist/chunks/{studio-wmjmsw0p.js → studio-69g6a0jn.js} +4 -4
- package/dist/chunks/studio-6hcfm9q3.js +5 -0
- package/dist/chunks/studio-6mf31e16.js +5 -0
- package/dist/chunks/studio-6sxnqqw8.js +5 -0
- package/dist/chunks/{studio-0939t1q1.js → studio-7qqb7hb8.js} +4 -4
- package/dist/chunks/{studio-bg8pzprg.js → studio-7qr8k0v2.js} +4 -4
- package/dist/chunks/{studio-0x6f3nk9.js → studio-8ncm9zwx.js} +4 -4
- package/dist/chunks/studio-8w5pa88p.js +7 -0
- package/dist/chunks/{studio-3qr08sxq.js → studio-9f5vcb4w.js} +3 -3
- package/dist/chunks/studio-aaw7wxv8.js +5 -0
- package/dist/chunks/studio-afx9brsc.js +5 -0
- package/dist/chunks/studio-ajfq4fmr.js +5 -0
- package/dist/chunks/{studio-evq47j2z.js → studio-ber1dgte.js} +4 -4
- package/dist/chunks/{studio-sce30r7b.js → studio-bk0anq3b.js} +3 -3
- package/dist/chunks/{studio-0gvvqj3h.js → studio-bmwgj8ez.js} +4 -4
- package/dist/chunks/{studio-s24mhq0z.js → studio-bpzwhn88.js} +4 -4
- package/dist/chunks/{studio-g9brbewz.js → studio-c72v1kwc.js} +4 -4
- package/dist/chunks/{studio-tpxcryf2.js → studio-cv6gnjqd.js} +4 -4
- package/dist/chunks/{studio-90zkgne5.js → studio-czpmzs9r.js} +7 -7
- package/dist/chunks/{studio-2pk7kc7z.js → studio-d5f7sskn.js} +4 -4
- package/dist/chunks/studio-dmgh2rrj.js +5 -0
- package/dist/chunks/{studio-nwf0c32p.js → studio-dst8y8vh.js} +4 -4
- package/dist/chunks/studio-ehj3csbm.js +6 -0
- package/dist/chunks/{studio-hfqpfmpk.js → studio-ek4fb4eb.js} +4 -4
- package/dist/chunks/studio-ep1384t9.js +5 -0
- package/dist/chunks/{studio-abh9kfdh.js → studio-eq5vqn1q.js} +4 -4
- package/dist/chunks/studio-erjccagy.js +5 -0
- package/dist/chunks/studio-ex1644g2.js +5 -0
- package/dist/chunks/studio-f3awr5nc.js +12 -0
- package/dist/chunks/studio-f69wcajk.js +9 -0
- package/dist/chunks/{studio-jma2q8r9.js → studio-g65t6svn.js} +4 -4
- package/dist/chunks/{studio-r6mx7vm5.js → studio-gw83z798.js} +5 -5
- package/dist/chunks/{studio-2x972v58.js → studio-hy936516.js} +4 -4
- package/dist/chunks/studio-j3bq30yz.js +5 -0
- package/dist/chunks/studio-j52ks8q7.js +5 -0
- package/dist/chunks/{studio-g0hxtcga.js → studio-jqvke4ac.js} +4 -4
- package/dist/chunks/{studio-bnc50f9h.js → studio-k05g7efh.js} +4 -4
- package/dist/chunks/studio-kefs4sz4.js +5 -0
- package/dist/chunks/{studio-2e4hry72.js → studio-ketrgtph.js} +5 -5
- package/dist/chunks/studio-m3jrjfhy.js +14 -0
- package/dist/chunks/{studio-45mj4jqe.js → studio-m8hesdrw.js} +4 -4
- package/dist/chunks/{studio-k0xzrse2.js → studio-n271vdsg.js} +36 -36
- package/dist/chunks/studio-n4pnf0sw.js +5 -0
- package/dist/chunks/{studio-gnazwtv3.js → studio-ncwx602y.js} +4 -4
- package/dist/chunks/{studio-amaz545p.js → studio-nngc45ct.js} +4 -4
- package/dist/chunks/{studio-eqcddvc2.js → studio-nv5eq0f7.js} +173 -173
- package/dist/chunks/{studio-az3wvyh2.js → studio-nzp0sqjg.js} +4 -4
- package/dist/chunks/{studio-k2evngrj.js → studio-pgze9p34.js} +5 -5
- package/dist/chunks/studio-ph17an19.js +5 -0
- package/dist/chunks/studio-pte5w7rf.js +9 -0
- package/dist/chunks/studio-pv1ts08p.js +6 -0
- package/dist/chunks/studio-q509sqt8.js +5 -0
- package/dist/chunks/{studio-rr00ex23.js → studio-qarg1xf9.js} +6 -6
- package/dist/chunks/studio-r5g7fx7q.js +9 -0
- package/dist/chunks/studio-s49y6m5b.js +5 -0
- package/dist/chunks/studio-s4k1v7dt.js +7 -0
- package/dist/chunks/studio-t46rt6gx.js +5 -0
- package/dist/chunks/{studio-61rg2cz5.js → studio-td3h1644.js} +4 -4
- package/dist/chunks/{studio-v7a7yb5w.js → studio-thgexj3w.js} +7 -7
- package/dist/chunks/{studio-vpevkfxw.js → studio-veh91hjv.js} +4 -4
- package/dist/chunks/studio-vswmz40d.js +6 -0
- package/dist/chunks/{studio-daksw8kh.js → studio-w3aafbpk.js} +4 -4
- package/dist/chunks/studio-w4mfaaam.js +5 -0
- package/dist/chunks/{studio-4zd6an2b.js → studio-wn2cmf9q.js} +4 -4
- package/dist/chunks/studio-x5ffyssw.js +5 -0
- package/dist/chunks/{studio-swedpd82.js → studio-x5py815g.js} +4 -4
- package/dist/chunks/{studio-4fnb5648.js → studio-xh6rf05g.js} +4 -4
- package/dist/chunks/studio-z6s56dzz.js +5 -0
- package/dist/chunks/{studio-nvcn2ykc.js → studio-zav9hgb3.js} +4 -4
- package/dist/chunks/{studio-a88ej93p.js → studio-ze1sm147.js} +6 -6
- package/dist/chunks/{studio-pj216fmn.js → studio-zkkt13qd.js} +4 -4
- package/dist/chunks/studio-zn7ysyzb.js +5 -0
- package/dist/chunks/{studio-xx3r3sb0.js → studio-ztzf8mce.js} +4 -4
- package/dist/chunks/{studio-1410q5dw.js → studio-zzgp5yka.js} +4 -4
- package/dist/chunks/{tooltip-dj1pvgz7.js → tooltip-gtx40bjg.js} +3 -3
- package/dist/chunks/{tree-j0ebwr5s.js → tree-a19s1c05.js} +2 -2
- package/dist/chunks/tsMode-3f116hth.js +14 -0
- package/dist/chunks/workspace-home-61n1jz3q.js +4 -0
- package/dist/chunks/workspace-sheek6zw.js +4 -0
- package/dist/chunks/{ws-client-arz2qsy9.js → ws-client-cb49m87s.js} +3 -3
- package/dist/iframe-entry.js +14 -14
- package/dist/manifest.json +82 -82
- package/dist/studio.js +97 -96
- package/dist/workers/ts.worker.js +3 -3
- package/package.json +11 -11
- package/src/browse/library-layouts.ts +9 -12
- package/src/browse/library-pane.ts +22 -16
- package/src/browse/library-source.ts +3 -4
- package/src/canvas/canvas-live-render.ts +2 -5
- package/src/canvas/canvas-page-context.ts +5 -0
- package/src/content/entry-commands.ts +32 -27
- package/src/content/entry-editor.ts +46 -44
- package/src/content/entry-inspector.ts +15 -12
- package/src/content/entry-model.ts +3 -3
- package/src/content/entry-summaries.ts +5 -5
- package/src/content/hold-state.ts +172 -0
- package/src/content/page-summaries.ts +10 -14
- package/src/editor/inline-edit.ts +6 -1
- package/src/editor/repeater-scope.ts +333 -74
- package/src/grid/sources/content-source.ts +42 -66
- package/src/panels/block-action-bar.ts +3 -4
- package/src/panels/events-panel.ts +6 -2
- package/src/panels/formula-workspace.ts +9 -0
- package/src/panels/properties-panel.ts +127 -35
- package/src/panels/statement-editor.ts +4 -0
- package/src/panels/tab-strip.ts +29 -26
- package/src/services/ai-project-tools.ts +3 -3
- package/src/services/ai-tools.ts +5 -5
- package/src/services/ai-write-report.ts +22 -4
- package/src/services/context-manager.ts +110 -2
- package/src/services/document-assistant.ts +2 -2
- package/src/services/harness/chat-reducer.ts +9 -4
- package/src/services/render-critic.ts +234 -12
- package/src/services/tool-executor.ts +16 -8
- package/src/surfaces/collections-panel.json +1 -1
- package/src/surfaces/collections-panel.ts +1 -1
- package/src/surfaces/entry-editor.json +10 -10
- package/src/surfaces/entry-editor.ts +22 -19
- package/src/surfaces/entry-inspector.json +11 -11
- package/src/surfaces/entry-inspector.ts +17 -10
- package/src/surfaces/tab-strip.json +5 -5
- package/src/surfaces/tab-strip.ts +2 -2
- package/src/types.ts +2 -0
- package/src/ui/expression-editor.ts +10 -5
- package/src/ui/schema-form.ts +18 -1
- package/src/utils/edit-display.ts +27 -1
- package/dist/chunks/2020-906vx2dq.js +0 -4
- package/dist/chunks/adapter-hnvad61x.js +0 -4
- package/dist/chunks/cf-settings-mkbcz4z2.js +0 -4
- package/dist/chunks/color-04361ttk.js +0 -4
- package/dist/chunks/components-w5zqwva1.js +0 -4
- package/dist/chunks/content-source-g38w0d3f.js +0 -4
- package/dist/chunks/editor-wvf5e6j9.js +0 -4
- package/dist/chunks/entry-commands-t13dyw3c.js +0 -4
- package/dist/chunks/file-ops-1sghzgcr.js +0 -4
- package/dist/chunks/files-zrqtgt41.js +0 -4
- package/dist/chunks/format-host-9gy76erh.js +0 -4
- package/dist/chunks/fs-events-45rhg3me.js +0 -4
- package/dist/chunks/grid-open-t4fq6bbm.js +0 -4
- package/dist/chunks/iframe-host-9aq8ze3q.js +0 -4
- package/dist/chunks/index-f9qr7kzh.js +0 -4
- package/dist/chunks/jsonMode-vj30te2h.js +0 -13
- package/dist/chunks/jx-validate-r4ax11e3.js +0 -4
- package/dist/chunks/layers-m49nmwvx.js +0 -4
- package/dist/chunks/layers-panel-zr92pwdp.js +0 -4
- package/dist/chunks/lit-html-k2mb9k0r.js +0 -4
- package/dist/chunks/media-library-j74rt0w4.js +0 -4
- package/dist/chunks/media-open-mypr0k6b.js +0 -4
- package/dist/chunks/media-picker-pemtbsjv.js +0 -4
- package/dist/chunks/menu-d2jxpgma.js +0 -4
- package/dist/chunks/monaco-buffer-pa0g6ax7.js +0 -4
- package/dist/chunks/monaco-setup-0hw9f835.js +0 -4
- package/dist/chunks/notify-bwehrp7q.js +0 -4
- package/dist/chunks/platform-kv0k65cy.js +0 -4
- package/dist/chunks/popover-9tf4cjrk.js +0 -4
- package/dist/chunks/publish-panel-vg1n880b.js +0 -4
- package/dist/chunks/publish-workspace-jv4w2bx2.js +0 -4
- package/dist/chunks/quick-search-nh29rt8a.js +0 -4
- package/dist/chunks/references-vqyr5s9x.js +0 -4
- package/dist/chunks/right-panel-3ws9f2w0.js +0 -4
- package/dist/chunks/source-control-h3hcs5gy.js +0 -4
- package/dist/chunks/studio-0khd8xtx.js +0 -4
- package/dist/chunks/studio-1ctnw3xv.js +0 -5
- package/dist/chunks/studio-1ks5d9y4.js +0 -5
- package/dist/chunks/studio-1y9mab9m.js +0 -5
- package/dist/chunks/studio-2kpxm0eh.js +0 -7
- package/dist/chunks/studio-2zz4qbv9.js +0 -5
- package/dist/chunks/studio-3pz4t5a2.js +0 -5
- package/dist/chunks/studio-4f7thq0p.js +0 -5
- package/dist/chunks/studio-7rrdbvex.js +0 -5
- package/dist/chunks/studio-9dq7rwc7.js +0 -5
- package/dist/chunks/studio-acer0g8w.js +0 -5
- package/dist/chunks/studio-brh8d2pr.js +0 -5
- package/dist/chunks/studio-c2fa783p.js +0 -9
- package/dist/chunks/studio-cfnn70h1.js +0 -5
- package/dist/chunks/studio-cqxj4fcy.js +0 -5
- package/dist/chunks/studio-cw11h078.js +0 -5
- package/dist/chunks/studio-dn56z7sn.js +0 -5
- package/dist/chunks/studio-egnjpyde.js +0 -9
- package/dist/chunks/studio-ejrypvmq.js +0 -5
- package/dist/chunks/studio-frc16j8v.js +0 -10
- package/dist/chunks/studio-j0zf5x2x.js +0 -5
- package/dist/chunks/studio-j5fcp6gj.js +0 -5
- package/dist/chunks/studio-jd1qb1st.js +0 -7
- package/dist/chunks/studio-k1xqrgm5.js +0 -5
- package/dist/chunks/studio-k3we3kqb.js +0 -5
- package/dist/chunks/studio-knsjyx7n.js +0 -5
- package/dist/chunks/studio-mrjtnm62.js +0 -5
- package/dist/chunks/studio-n9qba0gx.js +0 -5
- package/dist/chunks/studio-nzemfbkk.js +0 -14
- package/dist/chunks/studio-pwctzka3.js +0 -16
- package/dist/chunks/studio-q80fg1d6.js +0 -12
- package/dist/chunks/studio-q9hx2qp0.js +0 -5
- package/dist/chunks/studio-qrzmfaf6.js +0 -5
- package/dist/chunks/studio-tmfcn347.js +0 -6
- package/dist/chunks/studio-wqfaqw4m.js +0 -5
- package/dist/chunks/studio-xpx91fby.js +0 -6
- package/dist/chunks/studio-xva3hzkv.js +0 -5
- package/dist/chunks/studio-z3fztxrp.js +0 -9
- package/dist/chunks/studio-z9453ypn.js +0 -6
- package/dist/chunks/tsMode-jg1dtphj.js +0 -14
- package/dist/chunks/workspace-6ztqcrsh.js +0 -4
- package/dist/chunks/workspace-home-rse9h8a0.js +0 -4
- package/src/content/draft-state.ts +0 -108
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{ae}from"./studio-wqfaqw4m.js";import{p}from"./studio-4fnb5648.js";import{cs}from"./studio-xpx91fby.js";import{Jt,Ut}from"./studio-nzemfbkk.js";import{sn,dt}from"./studio-tpxcryf2.js";import{Zl,sA,Hb,RL,aA,Ri,jd}from"./studio-rr00ex23.js";import{hb,AE}from"./studio-k1xqrgm5.js";import{C}from"./studio-4f7thq0p.js";import{Ve,vt,E,R}from"./studio-9dq7rwc7.js";import{g}from"./studio-3qr08sxq.js";import{Q}from"./studio-k3we3kqb.js";import{ce}from"./studio-0939t1q1.js";function Bl(e){let t=e.trim().replaceAll("\\","/").split("/").filter((n)=>n!=="");return t.some((n)=>n==="."||n==="..")?null:t.join("/")}var w={$schema:"https://jxsuite.com/schema/v1",$id:"StudioPublish",$description:"Publish: the one-click Cloudflare Pages flow, as a `jx-dialog` over the kit. Eight bodies, one at a time, because the reader is at exactly one point of a chain — a host that cannot reach Cloudflare at all, a question still in flight, a connection that lapsed, an invitation to connect, a stored token Cloudflare refused, a field to paste a replacement into, the create-and-connect form, and the connected status. `publish/publish-panel.ts` keeps every one of those decisions and the calls that settle them; this document knows only which of the eight it was told to draw. **The token is never painted.** The field below binds no `value` — it is written by the reader and read once, on its way to storage — so a stored secret cannot reach the attribute, the serialised HTML or the accessibility tree, which is `studio.md` §15 rule 1 written as a missing binding rather than as a rule somebody remembers.",tagName:"jx-dialog",$props:{headline:"Publish",confirmLabel:"",cancelLabel:"Close",size:"md"},attributes:{part:"publish"},oncancel:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},onclose:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},style:{$description:"What the five `.publish-*` names carried, keyed on `part`, and most of them do not survive the move. `.publish-modal` and its `.new-project-modal` base were a fixed card, a scroll body, a border, a shadow and a `z-index: 1000` — a modal `<dialog>` is every one of those, and the top layer is what the z-index was climbing towards. `.publish-field` was a label stacked over a control, which is `jx-field`'s whole shape. What is left is the column gap between bodies, the two button rows, the hint and the refusal. Nothing here uses `--spectrum-*`: those custom properties resolve only inside `<sp-theme>`, and a document mounted in a layer host is outside it, so each would silently have taken its hard-coded fallback.",'& [part="body"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-3)"},'& [part="note"], & [part="status-line"], & [part="deployment"]':{margin:"0",lineHeight:"1.5"},'& [part="rows"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-3)"},'& [part="actions"]':{$description:'Wraps rather than overflows (studio-ui-guidelines.md §4.6): two buttons whose labels are whole phrases — "Verify & Connect", "Preferences › Accounts" — are wider than a narrow dialog at the sizes a reader may have set.',display:"flex",flexWrap:"wrap",gap:"var(--jx-space-2)"},'& [part="submit"]':{alignSelf:"flex-start"},'& [part="hint"]':{$description:"Publishing rides every commit, so the connected body's only job is to say what is already happening. Dim, because it is a standing fact rather than something to act on.",margin:"0",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"},'& [part="failure"]':{$description:'`failure` and not `error`: `jx-textfield` and `jx-select` each draw a `[part="error"]` of their own inside this same tree, and the kit is light DOM — a scoped rule on that name would restyle the token field\'s refusal line too.',margin:"0",color:"var(--danger)",lineHeight:"1.5"},'& [part="link"], & [part="install-link"]':{color:"var(--accent)",textDecoration:"underline"},"& code":{fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-sm)"}},children:[{tagName:"div",attributes:{part:"body"},children:[{tagName:"div",attributes:{part:"body-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/body"},cases:{unsupported:{tagName:"p",attributes:{part:"note"},children:["This platform cannot reach the Cloudflare API. Publish by committing and pushing — your host builds ",{tagName:"code",textContent:"bunx jx build"}," and serves ",{tagName:"code",textContent:"dist/"},"."]},loading:{tagName:"p",attributes:{part:"note"},textContent:"Checking Cloudflare connection…"},lapsed:{tagName:"div",attributes:{part:"lapsed",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"note"},textContent:"Your Cloudflare connection has expired, so publishing cannot reach your account. Reconnect to restore it — this site's Pages project and its settings are untouched."},{tagName:"jx-button",$props:{variant:"accent",disabled:{$ref:"#/state/busy"}},attributes:{part:"reconnect"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/connect"},value:[]}]},children:[{tagName:"span",textContent:"${state.connectLabel}"}]}]},hosted:{tagName:"div",attributes:{part:"hosted",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"note"},textContent:"Connect your Cloudflare account to publish this site."},{tagName:"jx-button",$props:{disabled:{$ref:"#/state/busy"}},attributes:{part:"connect"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/connect"},value:[]}]},children:[{tagName:"span",textContent:"Connect Cloudflare"}]}]},stored:{tagName:"div",attributes:{part:"stored",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"note"},textContent:"A Cloudflare API token is stored on this machine, and Cloudflare did not accept it. It may have been revoked, or it may be missing the Account Settings Read and Pages Read/Write permissions."},{tagName:"div",attributes:{part:"actions"},children:[{tagName:"jx-button",$props:{disabled:{$ref:"#/state/busy"}},attributes:{part:"replace"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/replace"},value:[]}]},children:[{tagName:"span",textContent:"Replace token"}]},{tagName:"jx-button",$props:{quiet:!0},attributes:{part:"accounts"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openAccounts"},value:[]}]},children:[{tagName:"span",textContent:"Preferences › Accounts"}]}]}]},token:{tagName:"div",attributes:{part:"token-form",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"note"},textContent:"Paste a Cloudflare API token (permissions: Account Settings Read, Pages Read/Write). It is stored on this machine and only sent to the same-origin proxy — Studio never renders it back."},{tagName:"jx-field",$props:{span:!0,label:"API token"},attributes:{part:"token-row","data-field":"token"},children:[{tagName:"jx-textfield",$description:"No `value` binding, and its absence is the contract: a secret may pass through a field the reader typed it into and may never be painted into one they did not. The draft lives in the adapter's closure until Verify reads it, so nothing here — not the attribute, not the accessibility tree, not a DOM dump — has ever held it.",$props:{type:"password",placeholder:"cf_..."},attributes:{part:"token"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setToken"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"div",attributes:{part:"actions"},children:[{tagName:"jx-button",$props:{variant:"accent",disabled:{$ref:"#/state/busy"}},attributes:{part:"verify"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/verify"},value:[]}]},children:[{tagName:"span",textContent:"Verify & Connect"}]},{tagName:"jx-button",$props:{quiet:!0},attributes:{part:"accounts"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openAccounts"},value:[]}]},children:[{tagName:"span",textContent:"Preferences › Accounts"}]}]}]},form:{tagName:"div",attributes:{part:"connect-form",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"note"},children:["Create a Cloudflare Pages project connected to this repository. Every commit then builds and publishes automatically (",{tagName:"code",textContent:"bunx jx build"},")."]},{tagName:"div",attributes:{part:"rows"},children:[{tagName:"jx-field",$props:{span:!0,label:"Account"},attributes:{part:"row","data-field":"account"},children:[{tagName:"jx-select",$props:{options:{$ref:"#/state/accountOptions"},value:{$ref:"#/state/accountId"}},attributes:{part:"account"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setAccount"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-field",$props:{span:!0,label:"Pages project name"},attributes:{part:"row","data-field":"projectName"},children:[{tagName:"jx-textfield",$props:{value:{$ref:"#/state/projectName"}},attributes:{part:"project-name"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setProjectName"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-field",$props:{span:!0,label:"GitHub owner"},attributes:{part:"row","data-field":"owner"},children:[{tagName:"jx-textfield",$props:{value:{$ref:"#/state/owner"}},attributes:{part:"owner"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setOwner"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-field",$props:{span:!0,label:"GitHub repository"},attributes:{part:"row","data-field":"repo"},children:[{tagName:"jx-textfield",$props:{value:{$ref:"#/state/repo"}},attributes:{part:"repo"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setRepo"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-field",$props:{span:!0,label:"Production branch"},attributes:{part:"row","data-field":"branch"},children:[{tagName:"jx-textfield",$props:{value:{$ref:"#/state/branch"}},attributes:{part:"branch"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setBranch"},value:[{$ref:"event#/target/value"}]}]}}]}]},{tagName:"jx-button",$props:{variant:"accent",disabled:{$ref:"#/state/busy"}},attributes:{part:"submit"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/submit"},value:[]}]},children:[{tagName:"span",textContent:"${state.submitLabel}"}]}]},status:{tagName:"div",attributes:{part:"status",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"status-line"},children:["Connected to Pages project ",{tagName:"strong",attributes:{part:"project-name"},textContent:"${state.deployProject}"},{tagName:"span",attributes:{part:"site-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasProductionUrl"},cases:{true:{tagName:"span",children:[" — ",{tagName:"a",attributes:{part:"link",href:"${state.productionUrl}",target:"_blank",rel:"noreferrer"},textContent:"${state.productionUrl}"}]}}}]},{tagName:"div",attributes:{part:"deployment-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasDeployment"},cases:{true:{tagName:"p",attributes:{part:"deployment"},children:["Latest deployment: ",{tagName:"strong",attributes:{part:"deployment-state"},textContent:"${state.deploymentState}"}," (${state.deploymentEnvironment}) — ",{tagName:"a",attributes:{part:"link",href:"${state.deploymentUrl}",target:"_blank",rel:"noreferrer"},textContent:"preview"}]},false:{tagName:"p",attributes:{part:"deployment"},textContent:"No deployments yet — the first commit after connecting triggers one."}}},{tagName:"p",attributes:{part:"hint"},textContent:"Publishing happens automatically on every commit."},{tagName:"div",attributes:{part:"actions"},children:[{tagName:"jx-button",$props:{disabled:{$ref:"#/state/busy"}},attributes:{part:"refresh"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/refresh"},value:[]}]},children:[{tagName:"span",textContent:"Refresh"}]},{tagName:"jx-button",$props:{variant:"negative",disabled:{$ref:"#/state/busy"}},attributes:{part:"disconnect"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/disconnect"},value:[]}]},children:[{tagName:"span",textContent:"Disconnect"}]}]}]}}},{tagName:"div",attributes:{part:"failure-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasFailure"},cases:{true:{tagName:"p",attributes:{part:"failure"},children:["${state.failure}",{tagName:"span",attributes:{part:"pages-app-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/needsPagesApp"},cases:{true:{tagName:"span",children:[" — if the Cloudflare Pages GitHub App is not installed on the repository, ",{tagName:"a",attributes:{part:"install-link",href:"${state.pagesAppUrl}",target:"_blank",rel:"noreferrer"},textContent:"install it"}," and retry."]}}}]}}}]}]};E("publish",w);var D="https://github.com/apps/cloudflare-pages/installations/new";function I(e){if(!e.supported)return"unsupported";if(e.loading)return"loading";if(e.connected&&e.lapsed)return"lapsed";if(!e.connected){if(e.hosted)return"hosted";return e.tokenStored&&!e.replacing?"stored":"token"}return e.deploy?"status":"form"}function j(e){let{error:t}=e;return{accountId:e.form.accountId,accountOptions:e.accounts,body:I(e),branch:e.form.branch,busy:e.busy,connectLabel:e.busy?"Reconnecting…":"Reconnect Cloudflare",deploymentEnvironment:e.deployment?.environment??"",deploymentState:e.deployment?`${e.deployment.stage}: ${e.deployment.status}`:"",deploymentUrl:e.deployment?.url??"",deployProject:e.deploy?.projectName??"",failure:t,hasDeployment:e.deployment!==null,hasFailure:t!=="",hasProductionUrl:(e.deploy?.productionUrl??"")!=="",needsPagesApp:/github/i.test(t)&&/app|install|source|repo/i.test(t),owner:e.form.owner,pagesAppUrl:D,productionUrl:e.deploy?.productionUrl??"",projectName:e.form.projectName,repo:e.form.repo,submitLabel:e.busy?"Connecting…":"Create & Connect"}}function k(e){let t=document.createElement("div");t.style.pointerEvents="auto",e.layer.append(t);let n="",m=!1,N=()=>{if(m)return;m=!0,e.onClosed()},P=()=>m,d=g({...j(e.view),closed:N,connect:()=>{e.onConnect()},disconnect:()=>{e.onDisconnect()},openAccounts:()=>{e.onOpenAccounts()},refresh:()=>{e.onRefresh()},replace:()=>{n="",e.onReplaceToken()},setAccount:(o)=>{d.accountId=o,e.onField("accountId",o)},setBranch:(o)=>{d.branch=o,e.onField("branch",o)},setOwner:(o)=>{d.owner=o,e.onField("owner",o)},setProjectName:(o)=>{d.projectName=o,e.onField("projectName",o)},setRepo:(o)=>{d.repo=o,e.onField("repo",o)},setToken:(o)=>{n=o},submit:()=>{e.onSubmit()},verify:()=>{let o=n;n="",e.onSaveToken(o)}}),y=null,A=R("publish",d,t).then(async(o)=>{y=o;let u=o.root;if(P())return o.dispose(),u;if(await sn(u),P())return u;return(u.querySelector('dialog[part="dialog"]')??u).setAttribute(Ve,vt("modal","publish")),Jt(u),u});return{close(){let o=y?.root;if(o instanceof HTMLElement)Ut(o);y?.dispose(),y=null,n="",t.remove(),N()},host:t,ready:A,update(o){Object.assign(d,j(o))}}}var f=null,i="loading",h=[],l=null,r="",c=!1,b=!1,a={accountId:"",branch:"main",owner:"",projectName:"",repo:""};function x(){return C?.projectConfig??null}function T(e){return e.toLowerCase().replaceAll(/[^a-z0-9]+/g,"-").replaceAll(/^-+|-+$/g,"").slice(0,58)||"site"}function O(){let e=p().projectRoot,t=/^([\w.-]+)\/([\w.-]+)(?:@.+)?$/.exec(e);return t?{owner:t[1],repo:t[2]}:{owner:"",repo:""}}function H(){let e=/^[\w.-]+\/[\w.-]+@[^:]+:(.+)$/.exec(p().projectRoot)?.[1]??"";return Bl(e)??""}function L(){let e=Ri();return e?{productionUrl:e.productionUrl??"",projectName:e.projectName}:null}function S(){let e=Zl(),t=i==="loading"?null:i;return{accounts:h.map((n)=>({label:n.name,value:n.id})),busy:c,connected:t?.connected===!0,deploy:L(),deployment:l?{environment:l.environment,stage:l.stage,status:l.status,url:l.url}:null,error:r,form:{...a},hosted:e&&Q(p().cfConnect),lapsed:t?.connected===!0&&t.needsReconnect===!0,loading:i==="loading",replacing:b,supported:e,tokenStored:hb()!==""}}function s(){if(f){f.update(S());return}f=k({layer:dt("modal"),onClosed:B,onConnect:()=>{M()},onDisconnect:()=>{z()},onField:(e,t)=>{a={...a,[e]:t}},onOpenAccounts:_,onRefresh:()=>{v()},onReplaceToken:()=>{b=!0,r="",s()},onSaveToken:(e)=>{U(e)},onSubmit:()=>{V()},view:S()})}async function v(){i="loading",s();try{if(i=await p().cfConnection?.()??null,i?.connected&&!i.needsReconnect){h=await sA(),a={...a,accountId:i.accountId??h[0]?.id??""};let e=Ri();if(e)l=await Hb(e),jd(l)}}catch(e){i=null,r=e instanceof Error?e.message:String(e)}s()}async function U(e){let t=e.trim();if(!t){r="Paste a token, or use Preferences › Accounts to forget the stored one.",s();return}AE(t),b=!1,r="",await v()}function _(){ae()?.run("app.preferences",{section:"accounts"})}async function M(){c=!0,r="",s();try{let e=await p().cfConnect?.()??null;if(e?.status==="timeout")r="The Cloudflare window didn't finish. Sign in there, then reconnect — nothing was changed.";else if(e?.status==="connected"&&!e.connection.accountId){let{openCfAccountPicker:t}=await (ce("xb8vvt2h"),import("./cf-account-picker-xb8vvt2h.js"));await t()}}catch(e){r=e instanceof Error?e.message:String(e)}c=!1,cs(),await v()}async function V(){let e=x();if(!e)return;if(!a.projectName||!a.owner||!a.repo||!a.accountId){r="Account, project name, and the GitHub owner/repo are all required.",s();return}c=!0,r="",s();try{let t=H(),n={accountId:a.accountId,owner:a.owner,productionBranch:a.branch||"main",projectName:a.projectName,repo:a.repo};if(t)n.rootDir=t;let m=await aA(e,n);l=await Hb(m).catch(()=>null)}catch(t){r=t instanceof Error?t.message:String(t)}c=!1,s()}async function z(){let e=x();if(!e)return;c=!0,s();try{await RL(e,null),l=null}catch(t){r=t instanceof Error?t.message:String(t)}c=!1,s()}function B(){let e=f;f=null,e?.close()}function NE(e){i={accountId:e.accountId??"demo-account",connected:!0},h=[],l=e.deployment,jd(e.deployment),r="",c=!1,b=!1,s()}function cF(){let e=x(),{owner:t,repo:n}=O();i="loading",h=[],l=null,r="",c=!1,b=!1,a={accountId:"",branch:"main",owner:t,projectName:Ri()?.projectName??T(e?.name??""),repo:n},s(),v()}
|
|
2
|
-
export{
|
|
1
|
+
import{ae}from"./studio-q509sqt8.js";import{p}from"./studio-xh6rf05g.js";import{ds}from"./studio-pv1ts08p.js";import{Jt,Ut}from"./studio-m3jrjfhy.js";import{sn,dt}from"./studio-cv6gnjqd.js";import{Xl,yO,Wb,B$,vO,Ii,jd}from"./studio-qarg1xf9.js";import{mb,UE}from"./studio-35pmfjtx.js";import{x}from"./studio-zn7ysyzb.js";import{ze,yt,E,I}from"./studio-1a7zshnv.js";import{b}from"./studio-9f5vcb4w.js";import{Q}from"./studio-erjccagy.js";import{ce}from"./studio-7qqb7hb8.js";function Wl(e){let t=e.trim().replaceAll("\\","/").split("/").filter((n)=>n!=="");return t.some((n)=>n==="."||n==="..")?null:t.join("/")}var w={$schema:"https://jxsuite.com/schema/v1",$id:"StudioPublish",$description:"Publish: the one-click Cloudflare Pages flow, as a `jx-dialog` over the kit. Eight bodies, one at a time, because the reader is at exactly one point of a chain — a host that cannot reach Cloudflare at all, a question still in flight, a connection that lapsed, an invitation to connect, a stored token Cloudflare refused, a field to paste a replacement into, the create-and-connect form, and the connected status. `publish/publish-panel.ts` keeps every one of those decisions and the calls that settle them; this document knows only which of the eight it was told to draw. **The token is never painted.** The field below binds no `value` — it is written by the reader and read once, on its way to storage — so a stored secret cannot reach the attribute, the serialised HTML or the accessibility tree, which is `studio.md` §15 rule 1 written as a missing binding rather than as a rule somebody remembers.",tagName:"jx-dialog",$props:{headline:"Publish",confirmLabel:"",cancelLabel:"Close",size:"md"},attributes:{part:"publish"},oncancel:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},onclose:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},style:{$description:"What the five `.publish-*` names carried, keyed on `part`, and most of them do not survive the move. `.publish-modal` and its `.new-project-modal` base were a fixed card, a scroll body, a border, a shadow and a `z-index: 1000` — a modal `<dialog>` is every one of those, and the top layer is what the z-index was climbing towards. `.publish-field` was a label stacked over a control, which is `jx-field`'s whole shape. What is left is the column gap between bodies, the two button rows, the hint and the refusal. Nothing here uses `--spectrum-*`: those custom properties resolve only inside `<sp-theme>`, and a document mounted in a layer host is outside it, so each would silently have taken its hard-coded fallback.",'& [part="body"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-3)"},'& [part="note"], & [part="status-line"], & [part="deployment"]':{margin:"0",lineHeight:"1.5"},'& [part="rows"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-3)"},'& [part="actions"]':{$description:'Wraps rather than overflows (studio-ui-guidelines.md §4.6): two buttons whose labels are whole phrases — "Verify & Connect", "Preferences › Accounts" — are wider than a narrow dialog at the sizes a reader may have set.',display:"flex",flexWrap:"wrap",gap:"var(--jx-space-2)"},'& [part="submit"]':{alignSelf:"flex-start"},'& [part="hint"]':{$description:"Publishing rides every commit, so the connected body's only job is to say what is already happening. Dim, because it is a standing fact rather than something to act on.",margin:"0",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"},'& [part="failure"]':{$description:'`failure` and not `error`: `jx-textfield` and `jx-select` each draw a `[part="error"]` of their own inside this same tree, and the kit is light DOM — a scoped rule on that name would restyle the token field\'s refusal line too.',margin:"0",color:"var(--danger)",lineHeight:"1.5"},'& [part="link"], & [part="install-link"]':{color:"var(--accent)",textDecoration:"underline"},"& code":{fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-sm)"}},children:[{tagName:"div",attributes:{part:"body"},children:[{tagName:"div",attributes:{part:"body-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/body"},cases:{unsupported:{tagName:"p",attributes:{part:"note"},children:["This platform cannot reach the Cloudflare API. Publish by committing and pushing — your host builds ",{tagName:"code",textContent:"bunx jx build"}," and serves ",{tagName:"code",textContent:"dist/"},"."]},loading:{tagName:"p",attributes:{part:"note"},textContent:"Checking Cloudflare connection…"},lapsed:{tagName:"div",attributes:{part:"lapsed",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"note"},textContent:"Your Cloudflare connection has expired, so publishing cannot reach your account. Reconnect to restore it — this site's Pages project and its settings are untouched."},{tagName:"jx-button",$props:{variant:"accent",disabled:{$ref:"#/state/busy"}},attributes:{part:"reconnect"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/connect"},value:[]}]},children:[{tagName:"span",textContent:"${state.connectLabel}"}]}]},hosted:{tagName:"div",attributes:{part:"hosted",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"note"},textContent:"Connect your Cloudflare account to publish this site."},{tagName:"jx-button",$props:{disabled:{$ref:"#/state/busy"}},attributes:{part:"connect"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/connect"},value:[]}]},children:[{tagName:"span",textContent:"Connect Cloudflare"}]}]},stored:{tagName:"div",attributes:{part:"stored",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"note"},textContent:"A Cloudflare API token is stored on this machine, and Cloudflare did not accept it. It may have been revoked, or it may be missing the Account Settings Read and Pages Read/Write permissions."},{tagName:"div",attributes:{part:"actions"},children:[{tagName:"jx-button",$props:{disabled:{$ref:"#/state/busy"}},attributes:{part:"replace"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/replace"},value:[]}]},children:[{tagName:"span",textContent:"Replace token"}]},{tagName:"jx-button",$props:{quiet:!0},attributes:{part:"accounts"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openAccounts"},value:[]}]},children:[{tagName:"span",textContent:"Preferences › Accounts"}]}]}]},token:{tagName:"div",attributes:{part:"token-form",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"note"},textContent:"Paste a Cloudflare API token (permissions: Account Settings Read, Pages Read/Write). It is stored on this machine and only sent to the same-origin proxy — Studio never renders it back."},{tagName:"jx-field",$props:{span:!0,label:"API token"},attributes:{part:"token-row","data-field":"token"},children:[{tagName:"jx-textfield",$description:"No `value` binding, and its absence is the contract: a secret may pass through a field the reader typed it into and may never be painted into one they did not. The draft lives in the adapter's closure until Verify reads it, so nothing here — not the attribute, not the accessibility tree, not a DOM dump — has ever held it.",$props:{type:"password",placeholder:"cf_..."},attributes:{part:"token"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setToken"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"div",attributes:{part:"actions"},children:[{tagName:"jx-button",$props:{variant:"accent",disabled:{$ref:"#/state/busy"}},attributes:{part:"verify"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/verify"},value:[]}]},children:[{tagName:"span",textContent:"Verify & Connect"}]},{tagName:"jx-button",$props:{quiet:!0},attributes:{part:"accounts"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openAccounts"},value:[]}]},children:[{tagName:"span",textContent:"Preferences › Accounts"}]}]}]},form:{tagName:"div",attributes:{part:"connect-form",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"note"},children:["Create a Cloudflare Pages project connected to this repository. Every commit then builds and publishes automatically (",{tagName:"code",textContent:"bunx jx build"},")."]},{tagName:"div",attributes:{part:"rows"},children:[{tagName:"jx-field",$props:{span:!0,label:"Account"},attributes:{part:"row","data-field":"account"},children:[{tagName:"jx-select",$props:{options:{$ref:"#/state/accountOptions"},value:{$ref:"#/state/accountId"}},attributes:{part:"account"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setAccount"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-field",$props:{span:!0,label:"Pages project name"},attributes:{part:"row","data-field":"projectName"},children:[{tagName:"jx-textfield",$props:{value:{$ref:"#/state/projectName"}},attributes:{part:"project-name"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setProjectName"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-field",$props:{span:!0,label:"GitHub owner"},attributes:{part:"row","data-field":"owner"},children:[{tagName:"jx-textfield",$props:{value:{$ref:"#/state/owner"}},attributes:{part:"owner"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setOwner"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-field",$props:{span:!0,label:"GitHub repository"},attributes:{part:"row","data-field":"repo"},children:[{tagName:"jx-textfield",$props:{value:{$ref:"#/state/repo"}},attributes:{part:"repo"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setRepo"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-field",$props:{span:!0,label:"Production branch"},attributes:{part:"row","data-field":"branch"},children:[{tagName:"jx-textfield",$props:{value:{$ref:"#/state/branch"}},attributes:{part:"branch"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setBranch"},value:[{$ref:"event#/target/value"}]}]}}]}]},{tagName:"jx-button",$props:{variant:"accent",disabled:{$ref:"#/state/busy"}},attributes:{part:"submit"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/submit"},value:[]}]},children:[{tagName:"span",textContent:"${state.submitLabel}"}]}]},status:{tagName:"div",attributes:{part:"status",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"status-line"},children:["Connected to Pages project ",{tagName:"strong",attributes:{part:"project-name"},textContent:"${state.deployProject}"},{tagName:"span",attributes:{part:"site-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasProductionUrl"},cases:{true:{tagName:"span",children:[" — ",{tagName:"a",attributes:{part:"link",href:"${state.productionUrl}",target:"_blank",rel:"noreferrer"},textContent:"${state.productionUrl}"}]}}}]},{tagName:"div",attributes:{part:"deployment-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasDeployment"},cases:{true:{tagName:"p",attributes:{part:"deployment"},children:["Latest deployment: ",{tagName:"strong",attributes:{part:"deployment-state"},textContent:"${state.deploymentState}"}," (${state.deploymentEnvironment}) — ",{tagName:"a",attributes:{part:"link",href:"${state.deploymentUrl}",target:"_blank",rel:"noreferrer"},textContent:"preview"}]},false:{tagName:"p",attributes:{part:"deployment"},textContent:"No deployments yet — the first commit after connecting triggers one."}}},{tagName:"p",attributes:{part:"hint"},textContent:"Publishing happens automatically on every commit."},{tagName:"div",attributes:{part:"actions"},children:[{tagName:"jx-button",$props:{disabled:{$ref:"#/state/busy"}},attributes:{part:"refresh"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/refresh"},value:[]}]},children:[{tagName:"span",textContent:"Refresh"}]},{tagName:"jx-button",$props:{variant:"negative",disabled:{$ref:"#/state/busy"}},attributes:{part:"disconnect"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/disconnect"},value:[]}]},children:[{tagName:"span",textContent:"Disconnect"}]}]}]}}},{tagName:"div",attributes:{part:"failure-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasFailure"},cases:{true:{tagName:"p",attributes:{part:"failure"},children:["${state.failure}",{tagName:"span",attributes:{part:"pages-app-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/needsPagesApp"},cases:{true:{tagName:"span",children:[" — if the Cloudflare Pages GitHub App is not installed on the repository, ",{tagName:"a",attributes:{part:"install-link",href:"${state.pagesAppUrl}",target:"_blank",rel:"noreferrer"},textContent:"install it"}," and retry."]}}}]}}}]}]};E("publish",w);var D="https://github.com/apps/cloudflare-pages/installations/new";function R(e){if(!e.supported)return"unsupported";if(e.loading)return"loading";if(e.connected&&e.lapsed)return"lapsed";if(!e.connected){if(e.hosted)return"hosted";return e.tokenStored&&!e.replacing?"stored":"token"}return e.deploy?"status":"form"}function j(e){let{error:t}=e;return{accountId:e.form.accountId,accountOptions:e.accounts,body:R(e),branch:e.form.branch,busy:e.busy,connectLabel:e.busy?"Reconnecting…":"Reconnect Cloudflare",deploymentEnvironment:e.deployment?.environment??"",deploymentState:e.deployment?`${e.deployment.stage}: ${e.deployment.status}`:"",deploymentUrl:e.deployment?.url??"",deployProject:e.deploy?.projectName??"",failure:t,hasDeployment:e.deployment!==null,hasFailure:t!=="",hasProductionUrl:(e.deploy?.productionUrl??"")!=="",needsPagesApp:/github/i.test(t)&&/app|install|source|repo/i.test(t),owner:e.form.owner,pagesAppUrl:D,productionUrl:e.deploy?.productionUrl??"",projectName:e.form.projectName,repo:e.form.repo,submitLabel:e.busy?"Connecting…":"Create & Connect"}}function k(e){let t=document.createElement("div");t.style.pointerEvents="auto",e.layer.append(t);let n="",m=!1,P=()=>{if(m)return;m=!0,e.onClosed()},C=()=>m,d=b({...j(e.view),closed:P,connect:()=>{e.onConnect()},disconnect:()=>{e.onDisconnect()},openAccounts:()=>{e.onOpenAccounts()},refresh:()=>{e.onRefresh()},replace:()=>{n="",e.onReplaceToken()},setAccount:(o)=>{d.accountId=o,e.onField("accountId",o)},setBranch:(o)=>{d.branch=o,e.onField("branch",o)},setOwner:(o)=>{d.owner=o,e.onField("owner",o)},setProjectName:(o)=>{d.projectName=o,e.onField("projectName",o)},setRepo:(o)=>{d.repo=o,e.onField("repo",o)},setToken:(o)=>{n=o},submit:()=>{e.onSubmit()},verify:()=>{let o=n;n="",e.onSaveToken(o)}}),y=null,A=I("publish",d,t).then(async(o)=>{y=o;let u=o.root;if(C())return o.dispose(),u;if(await sn(u),C())return u;return(u.querySelector('dialog[part="dialog"]')??u).setAttribute(ze,yt("modal","publish")),Jt(u),u});return{close(){let o=y?.root;if(o instanceof HTMLElement)Ut(o);y?.dispose(),y=null,n="",t.remove(),P()},host:t,ready:A,update(o){Object.assign(d,j(o))}}}var f=null,i="loading",h=[],l=null,r="",c=!1,g=!1,a={accountId:"",branch:"main",owner:"",projectName:"",repo:""};function N(){return x?.projectConfig??null}function T(e){return e.toLowerCase().replaceAll(/[^a-z0-9]+/g,"-").replaceAll(/^-+|-+$/g,"").slice(0,58)||"site"}function O(){let e=p().projectRoot,t=/^([\w.-]+)\/([\w.-]+)(?:@.+)?$/.exec(e);return t?{owner:t[1],repo:t[2]}:{owner:"",repo:""}}function H(){let e=/^[\w.-]+\/[\w.-]+@[^:]+:(.+)$/.exec(p().projectRoot)?.[1]??"";return Wl(e)??""}function L(){let e=Ii();return e?{productionUrl:e.productionUrl??"",projectName:e.projectName}:null}function S(){let e=Xl(),t=i==="loading"?null:i;return{accounts:h.map((n)=>({label:n.name,value:n.id})),busy:c,connected:t?.connected===!0,deploy:L(),deployment:l?{environment:l.environment,stage:l.stage,status:l.status,url:l.url}:null,error:r,form:{...a},hosted:e&&Q(p().cfConnect),lapsed:t?.connected===!0&&t.needsReconnect===!0,loading:i==="loading",replacing:g,supported:e,tokenStored:mb()!==""}}function s(){if(f){f.update(S());return}f=k({layer:dt("modal"),onClosed:B,onConnect:()=>{M()},onDisconnect:()=>{z()},onField:(e,t)=>{a={...a,[e]:t}},onOpenAccounts:_,onRefresh:()=>{v()},onReplaceToken:()=>{g=!0,r="",s()},onSaveToken:(e)=>{U(e)},onSubmit:()=>{V()},view:S()})}async function v(){i="loading",s();try{if(i=await p().cfConnection?.()??null,i?.connected&&!i.needsReconnect){h=await yO(),a={...a,accountId:i.accountId??h[0]?.id??""};let e=Ii();if(e)l=await Wb(e),jd(l)}}catch(e){i=null,r=e instanceof Error?e.message:String(e)}s()}async function U(e){let t=e.trim();if(!t){r="Paste a token, or use Preferences › Accounts to forget the stored one.",s();return}UE(t),g=!1,r="",await v()}function _(){ae()?.run("app.preferences",{section:"accounts"})}async function M(){c=!0,r="",s();try{let e=await p().cfConnect?.()??null;if(e?.status==="timeout")r="The Cloudflare window didn't finish. Sign in there, then reconnect — nothing was changed.";else if(e?.status==="connected"&&!e.connection.accountId){let{openCfAccountPicker:t}=await (ce("ajh60k54"),import("./cf-account-picker-ajh60k54.js"));await t()}}catch(e){r=e instanceof Error?e.message:String(e)}c=!1,ds(),await v()}async function V(){let e=N();if(!e)return;if(!a.projectName||!a.owner||!a.repo||!a.accountId){r="Account, project name, and the GitHub owner/repo are all required.",s();return}c=!0,r="",s();try{let t=H(),n={accountId:a.accountId,owner:a.owner,productionBranch:a.branch||"main",projectName:a.projectName,repo:a.repo};if(t)n.rootDir=t;let m=await vO(e,n);l=await Wb(m).catch(()=>null)}catch(t){r=t instanceof Error?t.message:String(t)}c=!1,s()}async function z(){let e=N();if(!e)return;c=!0,s();try{await B$(e,null),l=null}catch(t){r=t instanceof Error?t.message:String(t)}c=!1,s()}function B(){let e=f;f=null,e?.close()}function zE(e){i={accountId:e.accountId??"demo-account",connected:!0},h=[],l=e.deployment,jd(e.deployment),r="",c=!1,g=!1,s()}function SF(){let e=N(),{owner:t,repo:n}=O();i="loading",h=[],l=null,r="",c=!1,g=!1,a={accountId:"",branch:"main",owner:t,projectName:Ii()?.projectName??T(e?.name??""),repo:n},s(),v()}
|
|
2
|
+
export{Wl,zE,SF};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
5
|
-
//# sourceMappingURL=studio-
|
|
4
|
+
//# debugId=C2B562B4CEC6B45A64756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-ber1dgte.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{b}from"./studio-9f5vcb4w.js";import{J}from"./studio-erjccagy.js";var d={assertive:"jx-live-assertive",polite:"jx-live-polite"};function l(t){if(typeof document>"u")return null;let i=d[t],n=document.querySelector(`#${i}`);if(n)return n;let e=document.createElement("div");return e.id=i,e.setAttribute("aria-live",t),e.setAttribute("role",t==="assertive"?"alert":"status"),e.setAttribute("aria-atomic","true"),e.style.cssText="position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;border:0",document.body.append(e),e}function Eh(t,i="polite"){if(t==="")return;let n=l(i);if(!n)return;n.textContent="",setTimeout(()=>{n.textContent=t},0)}var of=60000,a=null;function ao(){return a??Date.now()}function XP(t){let i=t instanceof Date?t.getTime():J(t)?t:Date.parse(t);if(!Number.isFinite(i))throw TypeError(`clock: cannot pin to ${JSON.stringify(t)}`);return a=i,i}var p={error:"problem",info:"toast",success:"toast",warn:"toast"},m={error:8000,info:4000,success:4000,warn:8000},u=0;function g(){return u+=1,`n${u}`}var iu=b([]),ra=b([]),y=4;function x(t){return t==="problem"?ra:iu}function v(t,i,n,e){let r={at:ao(),id:g(),message:i,severity:t,tier:n};if(e.action!==void 0)r.action=e.action;if(e.actionArgs!==void 0)r.actionArgs=e.actionArgs;if(e.detail!==void 0)r.detail=e.detail;if(e.source!==void 0)r.source=e.source;if(e.path!==void 0)r.path=e.path;if(e.key!==void 0)r.key=e.key;if(n==="toast")r.timeoutMs=e.timeoutMs??m[t];return r}function w(t,i,n={}){let e=n.tier??p[t],r=v(t,i,e,n),s=x(e);if(r.key!==void 0){let c=s.findIndex((f)=>f.key===r.key);if(c!==-1)s.splice(c,1)}if(s.push(r),e==="toast")while(iu.length>y)iu.shift();return Eh(r.source===void 0?r.message:`${r.source}: ${r.message}`,t==="error"?"assertive":"polite"),r}function o(t){return(i,n={})=>w(t,i,n)}w.success=o("success");w.info=o("info");w.warn=o("warn");w.error=o("error");function Th(t){for(let i of[iu,ra]){let n=i.findIndex((e)=>e.id===t);if(n!==-1)return i.splice(n,1),!0}return!1}function xl(t){let i=t?ra.filter((e)=>!t(e)):[],n=ra.length-i.length;return ra.splice(0,ra.length,...i),n}function sf(t){let i=[];for(let n of ra){if(n.source!==t)continue;let e={message:n.message,severity:n.severity};if(n.detail!==void 0)e.detail=n.detail;if(n.path!==void 0)e.path=n.path;if(n.key!==void 0)e.key=n.key;if(n.action!==void 0)e.action=n.action;if(n.actionArgs!==void 0)e.actionArgs=n.actionArgs;i.push(e)}return i}function Ay(t){return t===void 0?ra.length:ra.filter((i)=>i.severity===t).length}export{Eh,of,ao,XP,iu,ra,w,Th,xl,sf,Ay};
|
|
2
2
|
|
|
3
|
-
//# debugId=
|
|
4
|
-
//# sourceMappingURL=studio-
|
|
3
|
+
//# debugId=96DA46F4FDC9128A64756E2164756E21
|
|
4
|
+
//# sourceMappingURL=studio-bk0anq3b.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
function l(n){return n.ownerDocument.defaultView?.getComputedStyle(n).display==="contents"}function Me(n){let o=n.getBoundingClientRect();if(o.width>0||o.height>0||!n.hasChildNodes()||!l(n))return o;let t=null;for(let r of n.childNodes){let e=null;if(r instanceof Element)e=Me(r);else if(r.nodeType===Node.TEXT_NODE){let i=n.ownerDocument.createRange();i.selectNodeContents(r),e=i.getBoundingClientRect()}if(!e||e.width===0&&e.height===0)continue;t=t?{bottom:Math.max(t.bottom,e.bottom),left:Math.min(t.left,e.left),right:Math.max(t.right,e.right),top:Math.min(t.top,e.top)}:{bottom:e.bottom,left:e.left,right:e.right,top:e.top}}return t?new DOMRect(t.left,t.top,t.right-t.left,t.bottom-t.top):o}function
|
|
2
|
-
export{Me,
|
|
1
|
+
function l(n){return n.ownerDocument.defaultView?.getComputedStyle(n).display==="contents"}function Me(n){let o=n.getBoundingClientRect();if(o.width>0||o.height>0||!n.hasChildNodes()||!l(n))return o;let t=null;for(let r of n.childNodes){let e=null;if(r instanceof Element)e=Me(r);else if(r.nodeType===Node.TEXT_NODE){let i=n.ownerDocument.createRange();i.selectNodeContents(r),e=i.getBoundingClientRect()}if(!e||e.width===0&&e.height===0)continue;t=t?{bottom:Math.max(t.bottom,e.bottom),left:Math.min(t.left,e.left),right:Math.max(t.right,e.right),top:Math.min(t.top,e.top)}:{bottom:e.bottom,left:e.left,right:e.right,top:e.top}}return t?new DOMRect(t.left,t.top,t.right-t.left,t.bottom-t.top):o}function v_(n,o,t=document){return t.elementFromPoint(n,o)}
|
|
2
|
+
export{Me,v_};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
5
|
-
//# sourceMappingURL=studio-
|
|
4
|
+
//# debugId=3D6BC8F0C2B45CD464756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-bmwgj8ez.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{us}from"./studio-td3h1644.js";var r="site-",f=new Set(["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),o=[[183,183],[192,214],[216,246],[248,893],[895,8191],[8204,8205],[8255,8256],[8304,8591],[11264,12271],[12289,55295],[63744,64975],[65008,65533],[65536,983039]];function n(e){return`${String.fromCodePoint(92)}u{${e.toString(16)}}`}var a=[String.raw`\-.0-9_a-z`,...o.map(([e,t])=>`${n(e)}-${n(t)}`)].join(""),s=new RegExp(`^[${a}]$`,"u");function Lw(e){if(e==="")return"Enter a tag name.";if(!/^[a-z]/.test(e))return"A tag name starts with a lower-case letter.";for(let t of e.slice(1))if(!s.test(t))return/[A-Z]/.test(t)?"A tag name is lower case.":`“${t}” cannot appear in a tag name.`;if(!e.includes("-"))return"A tag name needs a hyphen, such as my-card.";if(f.has(e))return`<${e}> is reserved by HTML.`;return""}function $b(e){let t=us(e).replaceAll(/-+/g,"-").replaceAll(/^-|-$/g,"");if(t==="")return"";return/^[a-z]/.test(t)&&t.includes("-")?t:`${r}${t}`}
|
|
2
|
+
export{Lw,$b};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
5
|
-
//# sourceMappingURL=studio-
|
|
4
|
+
//# debugId=3A0193554AB411ED64756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-bpzwhn88.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{p,
|
|
2
|
-
export{
|
|
1
|
+
import{p,ve}from"./studio-xh6rf05g.js";import{w}from"./studio-bk0anq3b.js";function v(e){return e.trim().replace(/\/+$/,"")}function k(e){return e.trim().toLowerCase()==="anthropic"?"anthropic":""}function a(e){return e.trim()}var ot={aiBaseUrl:{default:"",key:"jx.ai.baseUrl",normalize:v,scope:"user"},aiOpenAiKey:{default:"",key:"jx.ai.openaiKey",normalize:a,scope:"user",secret:!0},aiProvider:{default:"",key:"jx.ai.provider",normalize:k,scope:"user"},aiModel:{default:"gpt-4o",key:"jx.ai.model",normalize:a,scope:"user"},keybindings:{default:"",key:"jx.keybindings",normalize:(e)=>e.trim()==="{}"?"":e.trim(),scope:"user"},theme:{default:"",key:"jx-studio-theme",normalize:a,scope:"user"},showIgnoredFiles:{default:"",key:"jx.files.showIgnored",normalize:a,scope:"user"},developerPanels:{default:"",key:"jx.panels.developer",normalize:a,scope:"user"},cfAccountId:{default:"",key:"jx.cf.accountId",normalize:a,scope:"user"},cfToken:{default:"",key:"jx.cf.token",normalize:a,scope:"user",secret:!0}},S=Object.values(ot),f=S.filter((e)=>e.scope==="user"),z=f.map((e)=>e.key);function h(e){let t=e.schedule??queueMicrotask,n=null,i=Promise.resolve(),r=Promise.resolve();function s(){let o=n;if(n=null,!o)return i;return i=i.then(()=>e.send(o)).catch((u)=>{e.onError?.(u,o)}),i}return{enqueue(o){if(n){Object.assign(n,o);return}n={...o},r=new Promise((u)=>{t(()=>{s().then(u)})})},settled(){return r}}}var c=new Map;function m(){return typeof localStorage>"u"?void 0:localStorage}function x(e,t){try{if(t===null)m()?.removeItem(e);else m()?.setItem(e,t)}catch{}}try{for(let e of S){let t=m()?.getItem(e.key);if(t!==null&&t!==void 0)c.set(e.key,t)}}catch{}function Er(e){return c.get(e.key)??""}function PA(e){return(c.get(e.key)??"")!==""}var y=new Set;function Bp(e){return y.add(e),()=>{y.delete(e)}}function l(e){for(let t of y)t(e)}var g=h({onError(e){w("error","Your settings could not be saved.",{detail:e instanceof Error?e.message:String(e),key:"settings-write",source:"Settings"})},async send(e){if(!ve())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 MA(){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);x(n,i),t.push(n)}return t}function jx(e,t){return e.normalize?e.normalize(t):t}function _o(e,t){let n=jx(e,t),i=d({[e.key]:n});if(i.length>0)g.enqueue({[e.key]:n}),l(i)}function FA(e){let t={};for(let[i,r]of e)t[i.key]=jx(i,r);let n=d(t);if(n.length>0)g.enqueue(t),l(n)}function Vp(e){let t={};for(let i of e)t[i.key]=null;let n=d(t);if(n.length>0)g.enqueue(t),l(n)}async function jA(){if(!ve())return;let e=p();if(!e.getSettings)return;let t;try{t=await e.getSettings()}catch{return}let n={},i=!1;for(let s of f){let o=t[s.key];if(o)n[s.key]=o;else if(c.get(s.key))i=!0}let r=d(n);if(r.length>0)l(r);if(i){let s={};for(let o of f){let u=c.get(o.key);if(u&&!t[o.key])s[o.key]=u}g.enqueue(s)}}function P(e){let t={};for(let i of f)t[i.key]=e[i.key]??null;let n=d(t);if(n.length>0)l(n)}function HA(){if(!ve())return;p().subscribeSettings?.(P)}
|
|
2
|
+
export{ot,Er,PA,Bp,MA,jx,_o,FA,Vp,jA,HA};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
5
|
-
//# sourceMappingURL=studio-
|
|
4
|
+
//# debugId=113FD24DFD72B33D64756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-c72v1kwc.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{ft,io}from"./studio-5tet77de.js";import{Jt,Ut,Nh}from"./studio-nzemfbkk.js";import{iu,w,$h}from"./studio-sce30r7b.js";import{ae}from"./studio-wqfaqw4m.js";import{X}from"./studio-9c6cbq2c.js";import{Ve,vt,E,R}from"./studio-9dq7rwc7.js";import{me,te,g}from"./studio-3qr08sxq.js";import{n,Q}from"./studio-k3we3kqb.js";var B={$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."}}}]};E("dialog",B);function sn(e){if(e.querySelector('[part="dialog"]'))return Promise.resolve(e);return new Promise((t)=>{e.addEventListener("jx-ready",function o(r){if(r.target!==e&&!e.querySelector('[part="dialog"]'))return;e.removeEventListener("jx-ready",o),t(e)})})}function Zs(e){let t=document.createElement("div");t.style.pointerEvents="auto",t.setAttribute(Ve,vt("dialog",e.region)),e.layer.append(t);let o=g({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:(a)=>{o.value=a,e.onInput?.(a)},invalid:!1,message:e.message??"",options:e.choice?.options??[],pick:(a)=>{e.onPick?.(a)},placeholder:e.field?.placeholder??"",secondary:()=>{e.onSecondary?.()},secondaryLabel:e.secondaryLabel??"",size:e.size??"sm",value:e.field?.value??""}),r=null,i=!1,s=()=>i,l=()=>{},m=new Promise((a)=>{l=a}),p=R("dialog",o,t).then(async(a)=>{let d=a.root;if(s())return a.dispose(),d;if(r=a,await Promise.race([sn(d),m]),s())return d;if(e.island?.(d.querySelector('[part="island"]')??d),Jt(d),e.field){let x=d.querySelector("jx-textfield");if(x)setTimeout(()=>{if(!i)Nh(x,e.field?.select??"all")},0)}return d});return{close(){if(i)return;i=!0,l();let a=r?.root;if(a instanceof HTMLElement)Ut(a);r?.dispose(),r=null,t.remove()},host:t,ready:p,update(a){if(a.confirmLabel!==void 0)o.confirmLabel=a.confirmLabel;if(a.cancelLabel!==void 0)o.cancelLabel=a.cancelLabel;if(a.secondaryLabel!==void 0)o.secondaryLabel=a.secondaryLabel;if(a.message!==void 0)o.message=a.message,o.hasMessage=a.message!=="";if(a.value!==void 0)o.value=a.value;if(a.placeholder!==void 0)o.placeholder=a.placeholder;if(a.invalid!==void 0)o.invalid=a.invalid;if(a.error!==void 0)if(a.error!==""&&a.error===o.error){o.error="";let d=a.error;queueMicrotask(()=>{o.error=d})}else o.error=a.error;if(a.options!==void 0)o.options=a.options;if(a.chosen!==void 0)o.chosen=a.chosen}}}var G={$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 re(e){return e instanceof RangeError||e instanceof Error&&e.name==="CommandUnavailableError"}function Tn(e,t,o,r=t){let i=(l)=>{if(!re(l))console.error(`${r}: command "${t}" failed`,l);w.error(X(l),{key:`command.run:${t}`,source:r})},s;try{s=e.run(t,o)}catch(l){return i(l),Promise.resolve()}return Promise.resolve(s).catch(i)}function nt(e,t,o){let r=ae();return r?Tn(r,e,t,o):Promise.resolve()}var Y=null,_=null,q=null,C=null;function dt(e){return(e==="popover"?Y:e==="modal"?_:e==="toast"?C:q)??document.body}function Z$(){Y=document.querySelector("#layer-popover"),_=document.querySelector("#layer-modal"),q=document.querySelector("#layer-dialog"),C=document.querySelector("#layer-toast"),ue()}var U="jx-dialog[data-open], dialog[open]";function sv(){return Boolean(q?.querySelector(U)||_?.querySelector(U))}function X$(){return document.querySelector(":popover-open")!==null}function qo(e,t,o={}){let{confirmLabel:r="Confirm",cancelLabel:i="Cancel",destructive:s=!1}=o;return new Promise((l)=>{let m=!1,c=(a)=>{if(m)return;m=!0,p.close(),l(a)},p=Zs({cancelLabel:i,confirmLabel:r,destructive:s,headline:e,layer:dt("dialog"),...z(t),onCancel:()=>c(!1),onClosed:()=>c(!1),onConfirm:()=>c(!0)})})}function qC(e,t,o={}){let{saveLabel:r="Save",discardLabel:i="Discard",cancelLabel:s="Cancel"}=o;return new Promise((l)=>{let m=!1,c=(a)=>{if(m)return;m=!0,p.close(),l(a)},p=Zs({cancelLabel:s,confirmLabel:r,headline:e,layer:dt("dialog"),...z(t),onCancel:()=>c("cancel"),onClosed:()=>c("cancel"),onConfirm:()=>c("save"),onSecondary:()=>c("discard"),secondaryLabel:i})})}function z(e){if(n(e))return{message:e};return{island:(t)=>{io(e,t)}}}function Fn(e,t={}){let{cancelLabel:o="Cancel",choice:r,confirmLabel:i="OK",message:s,mono:l=!1,multiline:m=!1,placeholder:c="",rows:p="3",select:a="all",size:d,validate:x,value:Z=""}=t,k=(h)=>x?x(h,S):h.trim()?"":"Enter a value.",v=Z,S=r?.initial??"",f="",F=!1,I=()=>Q(c)?c():c,V=()=>r?r.options().map((h)=>({label:h.label,value:h.value})):[];return new Promise((h)=>{let K=!1,H=(u)=>{if(K)return;K=!0,N.close(),h(u)},W=(u)=>{f=u,N.update({error:f,invalid:f!==""})},L={cancelLabel:o,confirmLabel:i,headline:e,layer:dt("dialog"),onCancel:()=>H(null),onClosed:()=>H(null),onConfirm:()=>{let u=k(v);if(u){W(u);return}H(v.trim())},onInput:(u)=>{F=!0,v=u;let T=k(v);if(T!==f)W(T)},onPick:(u)=>{S=u,r?.onChange?.(u);let T=k(v);f=F||f?T:"",N.update({chosen:S,error:f,invalid:f!=="",options:V(),placeholder:I()})}};if(s!==void 0)Object.assign(L,z(s));if(r)L.choice={chosen:S,label:r.label,options:V()};if(L.field={mono:l,multiline:m,placeholder:I(),rows:p,select:a,value:v},d!==void 0)L.size=d;let N=Zs(L)})}var M=new Map;function Xs(e,t){let o=`${e}:${t}`,r=M.get(o);if(r&&r.parentElement)return r;return r=document.createElement("div"),r.style.pointerEvents="auto",r.setAttribute(Ve,vt(e,t)),dt(e).append(r),M.set(o,r),r}function av(e,t){let o=`${e}:${t}`,r=M.get(o);if(r)io(ft,r),r.remove(),M.delete(o)}var ne=180,ie={error:"✕",info:"ℹ",success:"✓",warn:"!"},P=null,y=new Map,b=new Set;function se(){if(!("matchMedia"in globalThis))return!1;return globalThis.matchMedia("(prefers-reduced-motion: reduce)").matches===!0}function le(){try{return new URLSearchParams(globalThis.location.search).get("automation")==="1"}catch{return!1}}function Q$(){return[...b].map((e)=>`overlay: toast ${e} settling in`)}function O(e){let t=y.get(e);if(t!==void 0)clearTimeout(t),y.delete(e);b.delete(e),$h(e)}function ce(e){if(y.has(e.id)||b.has(e.id))return;let t=se()?0:ne;if(t>0)b.add(e.id),setTimeout(()=>b.delete(e.id),t);let o=e.timeoutMs??0;if(o<=0||le())return;y.set(e.id,setTimeout(()=>O(e.id),o))}E("toasts",G);var A=null,D=null,j=null;function J(){return A??=g({dismissToast:(e)=>{O(e)},runAction:(e)=>{let t=iu.find((r)=>r.id===e),o=ae();if(!t?.action||!o)return;O(e),Tn(o,t.action,t.actionArgs,"Notifications")},toasts:[]}),A}function de(e){let t=e.action===void 0?null:ae(),o=e.action,r=t&&o!==void 0?t.get(o):void 0,i=r&&o!==void 0&&t.isVisible(o)?r:null,s=i&&o!==void 0?t.disabledReason(o):void 0;return{actionDisabled:s!==void 0,actionLabel:i?.title??"",actionTitle:i===null?"":s===void 0?i.title:`${i.title} — requires ${s}`,hasAction:i!==null,icon:ie[e.severity],id:e.id,message:e.message,severity:e.severity}}function ue(){if(fe(),!C)return;P=me(),P.run(()=>{te(()=>{iu.length,ae();for(let e of iu)ce(e);J().toasts=iu.map((e)=>de(e))})}),D=R("toasts",J(),C),D.then((e)=>{j=e})}function fe(){P?.stop(),P=null;for(let t of y.values())clearTimeout(t);y.clear(),b.clear();let e=D;if(D=null,j)j.dispose(),j=null;else if(e)e.then((t)=>t.dispose());A=null}
|
|
2
|
-
export{sn,
|
|
1
|
+
import{ft,ir}from"./studio-4z0cdh16.js";import{Jt,Ut,Ih}from"./studio-m3jrjfhy.js";import{iu,w,Th}from"./studio-bk0anq3b.js";import{ae}from"./studio-q509sqt8.js";import{X}from"./studio-9c6cbq2c.js";import{ze,yt,E,I}from"./studio-1a7zshnv.js";import{me,te,b}from"./studio-9f5vcb4w.js";import{n,Q}from"./studio-erjccagy.js";var B={$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."}}}]};E("dialog",B);function sn(e){if(e.querySelector('[part="dialog"]'))return Promise.resolve(e);return new Promise((t)=>{e.addEventListener("jx-ready",function o(r){if(r.target!==e&&!e.querySelector('[part="dialog"]'))return;e.removeEventListener("jx-ready",o),t(e)})})}function ea(e){let t=document.createElement("div");t.style.pointerEvents="auto",t.setAttribute(ze,yt("dialog",e.region)),e.layer.append(t);let o=b({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:(a)=>{o.value=a,e.onInput?.(a)},invalid:!1,message:e.message??"",options:e.choice?.options??[],pick:(a)=>{e.onPick?.(a)},placeholder:e.field?.placeholder??"",secondary:()=>{e.onSecondary?.()},secondaryLabel:e.secondaryLabel??"",size:e.size??"sm",value:e.field?.value??""}),r=null,i=!1,s=()=>i,l=()=>{},m=new Promise((a)=>{l=a}),p=I("dialog",o,t).then(async(a)=>{let d=a.root;if(s())return a.dispose(),d;if(r=a,await Promise.race([sn(d),m]),s())return d;if(e.island?.(d.querySelector('[part="island"]')??d),Jt(d),e.field){let x=d.querySelector("jx-textfield");if(x)setTimeout(()=>{if(!i)Ih(x,e.field?.select??"all")},0)}return d});return{close(){if(i)return;i=!0,l();let a=r?.root;if(a instanceof HTMLElement)Ut(a);r?.dispose(),r=null,t.remove()},host:t,ready:p,update(a){if(a.confirmLabel!==void 0)o.confirmLabel=a.confirmLabel;if(a.cancelLabel!==void 0)o.cancelLabel=a.cancelLabel;if(a.secondaryLabel!==void 0)o.secondaryLabel=a.secondaryLabel;if(a.message!==void 0)o.message=a.message,o.hasMessage=a.message!=="";if(a.value!==void 0)o.value=a.value;if(a.placeholder!==void 0)o.placeholder=a.placeholder;if(a.invalid!==void 0)o.invalid=a.invalid;if(a.error!==void 0)if(a.error!==""&&a.error===o.error){o.error="";let d=a.error;queueMicrotask(()=>{o.error=d})}else o.error=a.error;if(a.options!==void 0)o.options=a.options;if(a.chosen!==void 0)o.chosen=a.chosen}}}var G={$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 re(e){return e instanceof RangeError||e instanceof Error&&e.name==="CommandUnavailableError"}function Tn(e,t,o,r=t){let i=(l)=>{if(!re(l))console.error(`${r}: command "${t}" failed`,l);w.error(X(l),{key:`command.run:${t}`,source:r})},s;try{s=e.run(t,o)}catch(l){return i(l),Promise.resolve()}return Promise.resolve(s).catch(i)}function nt(e,t,o){let r=ae();return r?Tn(r,e,t,o):Promise.resolve()}var Y=null,A=null,_=null,C=null;function dt(e){return(e==="popover"?Y:e==="modal"?A:e==="toast"?C:_)??document.body}function aR(){Y=document.querySelector("#layer-popover"),A=document.querySelector("#layer-modal"),_=document.querySelector("#layer-dialog"),C=document.querySelector("#layer-toast"),ue()}var U="jx-dialog[data-open], dialog[open]";function uy(){return Boolean(_?.querySelector(U)||A?.querySelector(U))}function lR(){return document.querySelector(":popover-open")!==null}function Kr(e,t,o={}){let{confirmLabel:r="Confirm",cancelLabel:i="Cancel",destructive:s=!1}=o;return new Promise((l)=>{let m=!1,c=(a)=>{if(m)return;m=!0,p.close(),l(a)},p=ea({cancelLabel:i,confirmLabel:r,destructive:s,headline:e,layer:dt("dialog"),...q(t),onCancel:()=>c(!1),onClosed:()=>c(!1),onConfirm:()=>c(!0)})})}function i1(e,t,o={}){let{saveLabel:r="Save",discardLabel:i="Discard",cancelLabel:s="Cancel"}=o;return new Promise((l)=>{let m=!1,c=(a)=>{if(m)return;m=!0,p.close(),l(a)},p=ea({cancelLabel:s,confirmLabel:r,headline:e,layer:dt("dialog"),...q(t),onCancel:()=>c("cancel"),onClosed:()=>c("cancel"),onConfirm:()=>c("save"),onSecondary:()=>c("discard"),secondaryLabel:i})})}function q(e){if(n(e))return{message:e};return{island:(t)=>{ir(e,t)}}}function Fn(e,t={}){let{cancelLabel:o="Cancel",choice:r,confirmLabel:i="OK",message:s,mono:l=!1,multiline:m=!1,placeholder:c="",rows:p="3",select:a="all",size:d,validate:x,value:Z=""}=t,k=(g)=>x?x(g,S):g.trim()?"":"Enter a value.",h=Z,S=r?.initial??"",f="",z=!1,F=()=>Q(c)?c():c,V=()=>r?r.options().map((g)=>({label:g.label,value:g.value})):[];return new Promise((g)=>{let K=!1,H=(u)=>{if(K)return;K=!0,N.close(),g(u)},W=(u)=>{f=u,N.update({error:f,invalid:f!==""})},L={cancelLabel:o,confirmLabel:i,headline:e,layer:dt("dialog"),onCancel:()=>H(null),onClosed:()=>H(null),onConfirm:()=>{let u=k(h);if(u){W(u);return}H(h.trim())},onInput:(u)=>{z=!0,h=u;let T=k(h);if(T!==f)W(T)},onPick:(u)=>{S=u,r?.onChange?.(u);let T=k(h);f=z||f?T:"",N.update({chosen:S,error:f,invalid:f!=="",options:V(),placeholder:F()})}};if(s!==void 0)Object.assign(L,q(s));if(r)L.choice={chosen:S,label:r.label,options:V()};if(L.field={mono:l,multiline:m,placeholder:F(),rows:p,select:a,value:h},d!==void 0)L.size=d;let N=ea(L)})}var M=new Map;function ta(e,t){let o=`${e}:${t}`,r=M.get(o);if(r&&r.parentElement)return r;return r=document.createElement("div"),r.style.pointerEvents="auto",r.setAttribute(ze,yt(e,t)),dt(e).append(r),M.set(o,r),r}function hy(e,t){let o=`${e}:${t}`,r=M.get(o);if(r)ir(ft,r),r.remove(),M.delete(o)}var ne=180,ie={error:"✕",info:"ℹ",success:"✓",warn:"!"},P=null,y=new Map,v=new Set;function se(){if(!("matchMedia"in globalThis))return!1;return globalThis.matchMedia("(prefers-reduced-motion: reduce)").matches===!0}function le(){try{return new URLSearchParams(globalThis.location.search).get("automation")==="1"}catch{return!1}}function cR(){return[...v].map((e)=>`overlay: toast ${e} settling in`)}function O(e){let t=y.get(e);if(t!==void 0)clearTimeout(t),y.delete(e);v.delete(e),Th(e)}function ce(e){if(y.has(e.id)||v.has(e.id))return;let t=se()?0:ne;if(t>0)v.add(e.id),setTimeout(()=>v.delete(e.id),t);let o=e.timeoutMs??0;if(o<=0||le())return;y.set(e.id,setTimeout(()=>O(e.id),o))}E("toasts",G);var R=null,D=null,j=null;function J(){return R??=b({dismissToast:(e)=>{O(e)},runAction:(e)=>{let t=iu.find((r)=>r.id===e),o=ae();if(!t?.action||!o)return;O(e),Tn(o,t.action,t.actionArgs,"Notifications")},toasts:[]}),R}function de(e){let t=e.action===void 0?null:ae(),o=e.action,r=t&&o!==void 0?t.get(o):void 0,i=r&&o!==void 0&&t.isVisible(o)?r:null,s=i&&o!==void 0?t.disabledReason(o):void 0;return{actionDisabled:s!==void 0,actionLabel:i?.title??"",actionTitle:i===null?"":s===void 0?i.title:`${i.title} — requires ${s}`,hasAction:i!==null,icon:ie[e.severity],id:e.id,message:e.message,severity:e.severity}}function ue(){if(fe(),!C)return;P=me(),P.run(()=>{te(()=>{iu.length,ae();for(let e of iu)ce(e);J().toasts=iu.map((e)=>de(e))})}),D=I("toasts",J(),C),D.then((e)=>{j=e})}function fe(){P?.stop(),P=null;for(let t of y.values())clearTimeout(t);y.clear(),v.clear();let e=D;if(D=null,j)j.dispose(),j=null;else if(e)e.then((t)=>t.dispose());R=null}
|
|
2
|
+
export{sn,ea,Tn,nt,dt,aR,uy,lR,Kr,i1,Fn,ta,hy,cR};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
5
|
-
//# sourceMappingURL=studio-
|
|
4
|
+
//# debugId=C802DF943C9EA83264756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-cv6gnjqd.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=
|
|
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 se(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=
|
|
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){
|
|
1
|
+
import{up,pe}from"./studio-7qqb7hb8.js";var ne=pe(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=pe(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=pe(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=up(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;if(typeof Symbol<"u"&&(t=e[Symbol.toPrimitive])!==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 ml(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=up(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){ml(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=up(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=up(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 ie={isActive:!1};function Be(){return!ie.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});ie.isActive=!0;var u={current:i};ae({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(),ae({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(){ie.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(),ae({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 ae(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 ue={canStart:Be,start:wt};var le=new Map;function At(e){var{typeKey:r,mount:t}=e,n=le.get(r);if(n)return n.usageCount++,n;var o={typeKey:r,unmount:t(),usageCount:1};return le.set(r,o),o}function Ve(e){var r=At(e);return function t(){if(r.usageCount--,r.usageCount>0)return;r.unmount(),le.delete(e.typeKey)}}function zo(){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){ml(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 ce(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
|
+
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 se(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=zo(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=ce(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=ce(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=ce(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=se(D),b=se(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 se(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
|
+
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){ml(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;ue.start({event:w,dragType:s,getDropTargetsOver:l.getIsOver,dispatchEvent:a})}function d(){function f(){var w={canStart:ue.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 zo(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:Xs}=de;function Uo(e){if(!1)var r;var t=zo(de.registerUsage(),jt(e),ee(e.element,{attribute:"draggable",value:"true"}));return A(t)}export{ml,zo,Zs,Xs,Uo};
|
|
6
6
|
|
|
7
|
-
//# debugId=
|
|
8
|
-
//# sourceMappingURL=studio-
|
|
7
|
+
//# debugId=9FC41F18ACA25BBA64756E2164756E21
|
|
8
|
+
//# sourceMappingURL=studio-czpmzs9r.js.map
|