@jxsuite/studio 5.5.0 → 5.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/dist/chunks/{2020-g8mwpbkq.js → 2020-cs2sb9t1.js} +3 -3
- package/dist/chunks/adapter-y5gdq19c.js +4 -0
- package/dist/chunks/cf-account-picker-882a7ecm.js +4 -0
- package/dist/chunks/cf-settings-20dznc3j.js +4 -0
- package/dist/chunks/components-q037dya7.js +4 -0
- package/dist/chunks/content-source-37x3vsap.js +4 -0
- package/dist/chunks/convert-to-repeater-grfep2w8.js +4 -0
- package/dist/chunks/editor-j5sq149q.js +4 -0
- package/dist/chunks/entry-commands-c5h3nqck.js +4 -0
- package/dist/chunks/extension-sections-dp8endhx.js +4 -0
- package/dist/chunks/file-ops-937cvqk6.js +4 -0
- package/dist/chunks/files-tznwe1p1.js +4 -0
- package/dist/chunks/format-host-e2pjvd25.js +4 -0
- package/dist/chunks/fs-events-fv64ak3s.js +4 -0
- package/dist/chunks/git-panel-gb713ttc.js +4 -0
- package/dist/chunks/grid-view-5amhg604.js +51 -0
- package/dist/chunks/grid-view-5mqv1cbd.css +1 -0
- package/dist/chunks/iframe-host-t819mcg5.js +4 -0
- package/dist/chunks/{index-arg188jq.js → index-9ydfe04y.js} +3 -3
- package/dist/chunks/index-m0x5ztax.js +4 -0
- package/dist/chunks/{javascript-zcdmye2k.js → javascript-d9pqgc2p.js} +2 -2
- package/dist/chunks/{jsonMode-6x5e1nbf.js → jsonMode-800yvbem.js} +5 -5
- package/dist/chunks/jx-validate-zc9zp77s.js +4 -0
- package/dist/chunks/layers-4bsr82wz.js +4 -0
- package/dist/chunks/layers-panel-b6shnaax.js +4 -0
- package/dist/chunks/lit-html-cfn61dn7.js +4 -0
- package/dist/chunks/media-picker-ej0kdh1j.js +4 -0
- package/dist/chunks/menu-rtxf9chb.js +4 -0
- package/dist/chunks/{monaco-binding-4az2kh5p.js → monaco-binding-62dtmgbf.js} +3 -3
- package/dist/chunks/monaco-buffer-nn4dtx27.js +4 -0
- package/dist/chunks/{monaco-setup-d7mwkcx3.js → monaco-setup-tj13ndtm.js} +3 -3
- package/dist/chunks/notify-ahs57a2z.js +4 -0
- package/dist/chunks/platform-v9xyfkbx.js +4 -0
- package/dist/chunks/publish-panel-bq36xcmj.js +4 -0
- package/dist/chunks/quick-search-zm00h9dh.js +4 -0
- package/dist/chunks/references-99ws0b0m.js +4 -0
- package/dist/chunks/right-panel-pq2f71q3.js +4 -0
- package/dist/chunks/section-registry-b2yzp9sw.js +4 -0
- package/dist/chunks/studio-01kbbqg3.js +928 -0
- package/dist/chunks/{studio-hf4qdjc8.js → studio-01qza1n3.js} +4 -4
- package/dist/chunks/{studio-pkkw32j0.js → studio-03wwfvyt.js} +4 -4
- package/dist/chunks/{studio-7gqyhjns.js → studio-0bbxhhce.js} +4 -4
- package/dist/chunks/studio-0k9mvpgj.js +14 -0
- package/dist/chunks/studio-0scebvb9.js +6 -0
- package/dist/chunks/studio-1a99w39s.js +5 -0
- package/dist/chunks/studio-1wvfxkyy.js +5 -0
- package/dist/chunks/studio-1x8x26k3.js +5 -0
- package/dist/chunks/studio-222rqyyc.js +5 -0
- package/dist/chunks/studio-4xppwncr.js +4 -0
- package/dist/chunks/{studio-xcng8nx7.js → studio-54g077x3.js} +5 -5
- package/dist/chunks/studio-56z7evx4.js +10 -0
- package/dist/chunks/studio-5e9zsamh.js +9 -0
- package/dist/chunks/studio-65fhspdd.js +5 -0
- package/dist/chunks/studio-693nhyky.js +5 -0
- package/dist/chunks/{studio-7jazdy6y.js → studio-7pgy3xaf.js} +4 -4
- package/dist/chunks/studio-888knnkc.js +5 -0
- package/dist/chunks/studio-9mqfamps.js +5 -0
- package/dist/chunks/studio-a7xqhc3n.js +5 -0
- package/dist/chunks/studio-aje966s9.js +5 -0
- package/dist/chunks/studio-aqmph6k4.js +5 -0
- package/dist/chunks/studio-c6w3tq7t.js +5 -0
- package/dist/chunks/{studio-6j2jn55a.js → studio-c6zdm25z.js} +8 -8
- package/dist/chunks/{studio-f8jyp45j.js → studio-c9d3pxf7.js} +4 -4
- package/dist/chunks/studio-ceb34dxj.js +5 -0
- package/dist/chunks/studio-cvbkkfqb.js +5 -0
- package/dist/chunks/studio-cxt150pj.js +7 -0
- package/dist/chunks/studio-dkn3x3hz.js +5 -0
- package/dist/chunks/studio-e6re3rk1.js +5 -0
- package/dist/chunks/{studio-5n1km79v.js → studio-edbtvcd1.js} +4 -4
- package/dist/chunks/{studio-xc8ebsts.js → studio-eh0rac07.js} +4 -4
- package/dist/chunks/{studio-625ezz59.js → studio-evwgp1ym.js} +4 -4
- package/dist/chunks/{studio-he2fhrgp.js → studio-f195h2hq.js} +4 -4
- package/dist/chunks/studio-fqq890ap.js +4 -0
- package/dist/chunks/studio-frb0qbf7.js +6 -0
- package/dist/chunks/studio-gfn1kpxj.js +6 -0
- package/dist/chunks/studio-gh97gngt.js +5 -0
- package/dist/chunks/{studio-awqghqxv.js → studio-gp02nqnw.js} +4 -4
- package/dist/chunks/{studio-x9sagq2d.js → studio-hjbg8d5y.js} +7 -7
- package/dist/chunks/studio-j6gnhvaa.js +5 -0
- package/dist/chunks/studio-mwxgyn9h.js +7 -0
- package/dist/chunks/{studio-x5esgzct.js → studio-n78gjfy8.js} +4 -4
- package/dist/chunks/studio-nbxqcgvf.js +5 -0
- package/dist/chunks/{studio-p1eggxcf.js → studio-nt06yybj.js} +4 -4
- package/dist/chunks/{studio-hc9q4j24.js → studio-p7c1agz0.js} +5 -5
- package/dist/chunks/{studio-8r4y2x0z.js → studio-pwqfmt4p.js} +4 -4
- package/dist/chunks/{studio-5wfrgee9.js → studio-r3kaka4d.js} +4 -4
- package/dist/chunks/studio-semd1s8s.js +5 -0
- package/dist/chunks/studio-skzanb0k.js +5 -0
- package/dist/chunks/studio-spf2skgc.js +5 -0
- package/dist/chunks/{studio-b4epb26c.js → studio-st75kn99.js} +7 -7
- package/dist/chunks/{studio-eq27rrr0.js → studio-sxc0zvpt.js} +3 -3
- package/dist/chunks/studio-t1eedsyx.js +4 -0
- package/dist/chunks/{studio-73czgk6a.js → studio-tp642n5g.js} +4 -4
- package/dist/chunks/studio-tw7rre6s.js +5 -0
- package/dist/chunks/{studio-7by9a93k.js → studio-tzegmy4w.js} +4 -4
- package/dist/chunks/studio-vavmwshr.js +5 -0
- package/dist/chunks/studio-wma2c6g8.js +5 -0
- package/dist/chunks/studio-x92tgnee.js +64 -0
- package/dist/chunks/studio-xk0z6msk.js +5 -0
- package/dist/chunks/{studio-c4pnt1c6.js → studio-xry7tk3z.js} +5 -5
- package/dist/chunks/studio-xta2vxp6.js +9 -0
- package/dist/chunks/{studio-21enxdr8.js → studio-xy3tv3az.js} +4 -4
- package/dist/chunks/studio-y7jehjrp.js +5 -0
- package/dist/chunks/{studio-k1eaqyzm.js → studio-yr04mv2j.js} +4 -4
- package/dist/chunks/{studio-mhhc9btt.js → studio-zd4kayn2.js} +4 -4
- package/dist/chunks/studio-zpnk016a.js +16 -0
- package/dist/chunks/{tsMode-rtwt7w1a.js → tsMode-k9s9fcag.js} +5 -5
- package/dist/chunks/workspace-b69mgm0e.js +4 -0
- package/dist/chunks/ws-client-0ja08haa.js +4 -0
- package/dist/iframe-entry.js +14 -14
- package/dist/manifest.json +62 -59
- package/dist/studio.css +1 -1
- package/dist/studio.js +121 -123
- package/package.json +5 -5
- package/src/account/action-flow.ts +294 -0
- package/src/account/action-required.ts +68 -0
- package/src/account-status.ts +29 -1
- package/src/browse/library-model.ts +3 -1
- package/src/browse/library-preview.ts +6 -2
- package/src/canvas/asset-refs.ts +3 -1
- package/src/canvas/asset-resolve.ts +79 -1
- package/src/canvas/iframe-entry.ts +38 -1
- package/src/canvas/iframe-host.ts +85 -0
- package/src/canvas/iframe-protocol.ts +13 -0
- package/src/canvas/stage-scrollbar.ts +7 -7
- package/src/files/asset-versions.ts +294 -0
- package/src/files/file-ops.ts +5 -8
- package/src/files/files.ts +61 -9
- package/src/files/fs-events.ts +279 -28
- package/src/files/media-meta.ts +2 -1
- package/src/files/media-paths.ts +5 -2
- package/src/files/media-upload.ts +5 -1
- package/src/new-project/add-repo-modal.ts +12 -1
- package/src/new-project/new-project-modal.ts +12 -1
- package/src/panels/git-panel.ts +25 -2
- package/src/panels/jump-bar.ts +132 -158
- package/src/panels/pane-context.ts +8 -8
- package/src/panels/pane-grid.ts +18 -26
- package/src/panels/style-panel.ts +2 -2
- package/src/platform-errors.ts +61 -1
- package/src/platforms/cloud.ts +389 -50
- package/src/platforms/devserver.ts +17 -1
- package/src/publish/pages-service.ts +17 -7
- package/src/services/ai-models.ts +30 -6
- package/src/services/ai-system-prompt.ts +81 -51
- package/src/services/context-manager.ts +41 -70
- package/src/services/document-assistant.ts +12 -3
- package/src/services/harness/chat-reducer.ts +115 -0
- package/src/services/harness/turn-hooks.ts +50 -0
- package/src/services/tool-executor.ts +69 -288
- package/src/services/tool-outcomes.ts +12 -10
- package/src/settings/preferences-accounts.ts +42 -3
- package/src/settings/preferences-dialog.ts +8 -1
- package/src/studio.ts +20 -6
- package/src/surfaces/block-action-bar.json +6 -1
- package/src/surfaces/dialog.ts +5 -0
- package/src/surfaces/jump-bar.json +9 -12
- package/src/surfaces/jump-bar.ts +15 -16
- package/src/surfaces/pane-context.json +2 -2
- package/src/surfaces/pane-grid.json +8 -25
- package/src/surfaces/pane-grid.ts +7 -8
- package/src/surfaces/statusbar.json +71 -3
- package/src/surfaces/statusbar.ts +66 -139
- package/src/surfaces/style-panel.json +3 -3
- package/src/surfaces/style-panel.ts +11 -1
- package/src/surfaces/welcome.json +86 -1
- package/src/surfaces/welcome.ts +61 -2
- package/src/types.ts +84 -2
- package/src/ui/ai-managed-connect.ts +41 -4
- package/src/ui/media-picker.ts +2 -1
- package/dist/chunks/adapter-bsbs78x9.js +0 -4
- package/dist/chunks/cf-account-picker-gnm7xeqb.js +0 -4
- package/dist/chunks/cf-settings-9y6jyscp.js +0 -4
- package/dist/chunks/components-s51h3b7c.js +0 -4
- package/dist/chunks/content-source-ty3be0qg.js +0 -4
- package/dist/chunks/convert-to-repeater-c3e7q61z.js +0 -4
- package/dist/chunks/editor-t002b41m.js +0 -4
- package/dist/chunks/entry-commands-sb72e9gy.js +0 -4
- package/dist/chunks/extension-sections-ktn2ntnj.js +0 -4
- package/dist/chunks/file-ops-78zeytkm.js +0 -4
- package/dist/chunks/files-gatzrz8v.js +0 -4
- package/dist/chunks/format-host-r59b1651.js +0 -4
- package/dist/chunks/fs-events-f8h91ndt.js +0 -4
- package/dist/chunks/git-panel-y12zf7nj.js +0 -4
- package/dist/chunks/grid-view-rfd8b2pg.js +0 -51
- package/dist/chunks/grid-view-tafenfm2.css +0 -1
- package/dist/chunks/iframe-host-vsrsj20g.js +0 -4
- package/dist/chunks/index-5aghyrfh.js +0 -4
- package/dist/chunks/jx-validate-653krkrf.js +0 -4
- package/dist/chunks/layers-32p8gtae.js +0 -4
- package/dist/chunks/layers-panel-rs58m105.js +0 -4
- package/dist/chunks/lit-html-54bmkwz3.js +0 -4
- package/dist/chunks/media-picker-5bb04wct.js +0 -4
- package/dist/chunks/menu-cbha7w2e.js +0 -4
- package/dist/chunks/monaco-buffer-9vbbyfr1.js +0 -4
- package/dist/chunks/notify-dc1nz5ar.js +0 -4
- package/dist/chunks/platform-2m49s1zf.js +0 -4
- package/dist/chunks/publish-panel-nx3ycmma.js +0 -4
- package/dist/chunks/quick-search-yzrzh9x3.js +0 -4
- package/dist/chunks/references-vx7mbj9f.js +0 -4
- package/dist/chunks/right-panel-7jzpbxja.js +0 -4
- package/dist/chunks/section-registry-gjryse41.js +0 -4
- package/dist/chunks/studio-3znfhcxg.js +0 -5
- package/dist/chunks/studio-58qam27v.js +0 -4
- package/dist/chunks/studio-6j59fwaw.js +0 -5
- package/dist/chunks/studio-7z69g1gx.js +0 -5
- package/dist/chunks/studio-93j3v6zx.js +0 -5
- package/dist/chunks/studio-9gf6v8zy.js +0 -5
- package/dist/chunks/studio-9rhmettf.js +0 -4
- package/dist/chunks/studio-ac5aq677.js +0 -10
- package/dist/chunks/studio-as65vbns.js +0 -5
- package/dist/chunks/studio-bkv0sga4.js +0 -6
- package/dist/chunks/studio-bttmqef4.js +0 -5
- package/dist/chunks/studio-c3y9d41k.js +0 -5
- package/dist/chunks/studio-ccegp7gz.js +0 -9
- package/dist/chunks/studio-chxabn98.js +0 -6
- package/dist/chunks/studio-cktcdsxz.js +0 -16
- package/dist/chunks/studio-cnspfke5.js +0 -5
- package/dist/chunks/studio-de3p1ktm.js +0 -5
- package/dist/chunks/studio-fsbcn530.js +0 -928
- package/dist/chunks/studio-gftga7a3.js +0 -64
- package/dist/chunks/studio-hf1rpcq0.js +0 -4
- package/dist/chunks/studio-hz02hq70.js +0 -5
- package/dist/chunks/studio-jnb285we.js +0 -5
- package/dist/chunks/studio-jsv3s3s1.js +0 -5
- package/dist/chunks/studio-ks7cksh0.js +0 -5
- package/dist/chunks/studio-nptx0dbs.js +0 -5
- package/dist/chunks/studio-pg0z7k98.js +0 -5
- package/dist/chunks/studio-pve0b2f2.js +0 -5
- package/dist/chunks/studio-q7zmjv3b.js +0 -6
- package/dist/chunks/studio-rpmvw7kj.js +0 -5
- package/dist/chunks/studio-rwhss52s.js +0 -5
- package/dist/chunks/studio-sbg3g3h0.js +0 -5
- package/dist/chunks/studio-sq1bn60g.js +0 -14
- package/dist/chunks/studio-vwz7rma2.js +0 -5
- package/dist/chunks/studio-wa55e8gf.js +0 -5
- package/dist/chunks/studio-x0mzdha2.js +0 -5
- package/dist/chunks/studio-xrgpakvc.js +0 -9
- package/dist/chunks/studio-xt3djk1w.js +0 -7
- package/dist/chunks/studio-yh3nggx1.js +0 -7
- package/dist/chunks/studio-zmecp6hq.js +0 -5
- package/dist/chunks/workspace-g6dvaete.js +0 -4
- package/dist/chunks/ws-client-shf41j5p.js +0 -4
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{ge,Q,v}from"./studio-fqq890ap.js";import{Le,mp,q,Ue,kc,PL,gv,FL,bv,jL,Bs,zL,WL,VL,ot,_v,Nx,Ad,xm,Cv,u}from"./studio-cvbkkfqb.js";import{Gs,ne}from"./studio-0k9mvpgj.js";import{Sl,Of,_u,rw,Yh,sw,eE,Zh,Mf,El,Cu,Yg,ad,aw,lw,cw,V_,Xh,U_,Pa,Zg,q_,dw,J_}from"./studio-0scebvb9.js";import{pI,mI,T,R,Nn}from"./studio-spf2skgc.js";import{yo,Mw,ud,T1,hc,ku,Su,hd,pd,pc}from"./studio-xy3tv3az.js";import{bi,Ou,hr,ax}from"./studio-ceb34dxj.js";import{Nt}from"./studio-nt06yybj.js";import{Di,qo,qb,yx,y}from"./studio-zpnk016a.js";import{yc,js,nm}from"./studio-yr04mv2j.js";import{wu,ew}from"./studio-p7c1agz0.js";import{K,Zo,rk,ak,Hx,Tv,sI,Ai,Gr}from"./studio-tp642n5g.js";import{Ae}from"./studio-evwgp1ym.js";import{nt,Ot,Za,ba,va,Op,qe}from"./studio-nbxqcgvf.js";var Pe={$schema:"https://jxsuite.com/schema/v1",$id:"StudioLogicPanel",$description:"The Inspector's **Logic** tab — everything about how the selected element BEHAVES, as a Jx document over the kit. The Inspector is split by task rather than by data type (§6): wiring a `$switch`, wiring a repeater to a collection and wiring a click handler are one job, and they were three, split across two tabs because a `$switch` is stored as a property and a click handler as a property-shaped function. So there are four sections here — Repeating list, Condition, Events, and a custom element's outward contract (Observed Attributes · CSS Properties · CSS Parts) — and each of them is a projection. The adapter (`panels/events-panel.ts`) keeps every decision: what the selection is, which rungs a position permits, what a handler currently holds, which elements of a multi-selection disagree about a key, and what a commit writes. Nothing here reads the document, asks the schema a question or knows what a Value Source is. Two islands, both through `onNodeCreated` (studio-ui-guidelines.md §9.4): `[part=\"control-host\"]` receives the expression editor, which is a lit surface of its own, and `[part=\"statements-host\"]` receives the `statements` surface, which is a mounted document of its own. Every bindable row carries `data-prop`, which is what `inspector/field:<prop>` addresses.",tagName:"div",attributes:{part:"logic"},style:{$description:"The tab's own layout, and nothing else. `.style-sidebar` and `.style-section-body` are NOT transcribed: the first was a scroll container the dock already provides, and the second existed to put padding inside a Spectrum accordion item, which `jx-accordion-item` does itself. What is left is the two vocabularies this tab has that no other surface does — a declared event, and an event binding — plus the one empty state a document cannot borrow from `panels/empty-state.ts`.",display:"block",minWidth:"0",fontFamily:"var(--jx-font-sans)",fontSize:"var(--jx-text-md)",color:"var(--fg)",'& [part="empty"]':{$description:"The one empty-state pattern (studio-ui-guidelines.md §11.2), drawn here because a document cannot render a lit helper. It is a copy rather than a move — every panel still lit renders through that helper — and it goes when the last of them converts.",display:"flex",flexDirection:"column",alignItems:"center",gap:"var(--jx-space-3)",padding:"var(--jx-space-6)",textAlign:"center",fontSize:"var(--jx-text-md)",color:"var(--fg-dim)"},'& [part="empty-message"]':{margin:"0",maxWidth:"34ch",lineHeight:"1.5"},'& [part="section-body"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-2)",minWidth:"0"},'& [part="field"]':{minWidth:"0"},'& [part="field"] > [part="label"]:empty':{$description:"A row whose control names itself — an expression editor draws its own Operator / Target / Value rows — has no second label to draw. `jx-field` takes the empty label out of the accessible name by leaving it empty; this takes it out of the layout.",display:"none"},'& [part="value"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-2)",minWidth:"0"},'& [part="widget"]':{flex:"1 1 auto",minWidth:"0"},'& [part="control-host"]':{display:"block",minWidth:"0"},'& [part="subhead"]':{margin:"var(--jx-space-2) 0 0",fontSize:"var(--jx-text-sm)",fontWeight:"600",color:"var(--fg-dim)"},'& [part="case"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-2)",minWidth:"0"},'& [part="case-name"]':{flex:"1 1 auto",minWidth:"0"},'& [part="declared"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-1)",minWidth:"0"},'& [part="declared-row"]':{display:"flex",alignItems:"baseline",gap:"var(--jx-space-2)",minWidth:"0",fontSize:"var(--jx-text-sm)"},'& [part="event-code"]':{fontFamily:"var(--font-mono, monospace)",color:"var(--accent)"},'& [part="declared-from"]':{color:"var(--fg-dim)"},'& [part="event-type"]':{marginInlineStart:"auto",color:"var(--fg-dim)",fontFamily:"var(--font-mono, monospace)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},'& [part="binding"]':{$description:"One `on*` key and whatever produces it. A box, for the reason a statement card is one: a handler CONTAINS a body, and the border is what says where one binding stops and the next begins.",boxSizing:"border-box",display:"flex",flexDirection:"column",gap:"var(--jx-space-2)",minWidth:"0",padding:"var(--jx-space-2)",border:"1px solid var(--jx-border)",borderRadius:"var(--jx-radius-sm)"},'& [part="binding-head"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-2)",minWidth:"0"},'& [part="event-name"]':{flex:"1 1 auto",minWidth:"0"},'& [part="binding-body"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-2)",minWidth:"0"},'& [part="body-toggle"]':{display:"flex",justifyContent:"flex-end",minWidth:"0"},'& [part="body-row"]':{display:"flex",alignItems:"flex-start",gap:"var(--jx-space-2)",minWidth:"0"},'& [part="body-field"], & [part="expression-host"], & [part="statements-host"]':{flex:"1 1 auto",minWidth:"0"},'& [part="kv"]':{display:"flex",alignItems:"baseline",gap:"var(--jx-space-2)",minWidth:"0",fontSize:"var(--jx-text-sm)"},'& [part="kv-name"]':{fontFamily:"var(--font-mono, monospace)",color:"var(--fg)"},'& [part="kv-detail"], & [part="kv-value"], & [part="kv-tags"]':{color:"var(--fg-dim)"},'& [part="kv-value"]':{marginInlineStart:"auto",fontFamily:"var(--font-mono, monospace)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},'& [part="empty-actions"]':{display:"flex",flexWrap:"wrap",justifyContent:"center",gap:"var(--jx-space-2)"}},children:[{tagName:"div",attributes:{part:"body-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/state"},cases:{empty:{tagName:"div",attributes:{part:"empty"},children:[{tagName:"p",attributes:{part:"empty-message"},textContent:"${state.emptyMessage}"},{tagName:"div",attributes:{part:"empty-actions-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasEmptyActions"},cases:{true:{tagName:"div",attributes:{part:"empty-actions"},children:[{$prototype:"Array",items:{$ref:"#/state/emptyActions"},key:{$ref:"$map/item/id"},map:{tagName:"jx-button",attributes:{part:"empty-action"},$props:{size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/runEmptyAction"},value:[{$ref:"$map/item/id"}]}]},children:[{tagName:"span",textContent:"${$map.item.label}"}]}}]}}}]},ready:{tagName:"jx-accordion",attributes:{part:"sections"},$props:{multiple:!0},children:[{$description:'Repeating list. Filter and Sort are always drawn: they used to hide behind `+ Add filter`, which seeded `{ $ref: "#/state/" }` — a binding to the empty pointer, which is not a signal — so the row opened already bound to nothing and the only way to type a literal was to cycle the mode ring twice (§6.6). A repeater has exactly three inputs, and an empty row states that better than a button does.',tagName:"div",attributes:{part:"repeater-slot",role:"none",hidden:"${state.hasRepeater ? null : ''}"},style:{display:"contents"},$switch:{$ref:"#/state/hasRepeater"},cases:{true:{tagName:"jx-accordion-item",attributes:{"data-section":"repeater"},$props:{label:"Repeating list",open:{$ref:"#/state/repeaterOpen"}},ontoggle:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setSection"},value:["repeater",{$ref:"event#/detail"}]}]},children:[{tagName:"div",attributes:{part:"section-body"},children:[{$prototype:"Array",items:{$ref:"#/state/repeaterFields"},key:{$ref:"$map/item/key"},map:{$description:"A bindable value as a first-class field row. Every position it serves is a single-line expression — a collection, a filter, a sort key, a `$switch` — so it draws one widget rather than dispatching over a widget type: the textarea and checkbox arms the lit version carried had no caller in either tab. The set dot clears the position outright and is disabled where the position is mandatory; the source chip opens the rung picker rather than cycling, so any rung the position permits is one action away (§6.6).",tagName:"jx-field",attributes:{part:"field","data-prop":"${$map.item.prop}"},$props:{label:{$ref:"$map/item/label"},span:!0},children:[{tagName:"div",attributes:{part:"value"},children:[{tagName:"jx-action-button",attributes:{part:"source","data-source":"${$map.item.source}"},$props:{size:"sm",quiet:!0,haspopup:"menu",label:"${$map.item.sourceHint}",disabled:{$ref:"$map/item/sourceLocked"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/pickSource"},value:[{$ref:"$map/item/key"},{$ref:"event#/currentTarget"}]}]},children:[{tagName:"span",textContent:"${$map.item.sourceLabel}"}]},{tagName:"div",attributes:{part:"widget",role:"none"},$switch:{$ref:"$map/item/kind"},cases:{control:{tagName:"div",attributes:{part:"control-host","data-field":"${$map.item.key}"}},text:{tagName:"jx-textfield",attributes:{part:"text"},$props:{size:"sm",label:{$ref:"$map/item/label"},value:{$ref:"$map/item/value"},placeholder:{$ref:"$map/item/placeholder"},mono:{$ref:"$map/item/mono"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setField"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},select:{tagName:"jx-select",attributes:{part:"select"},$props:{size:"sm",label:{$ref:"$map/item/label"},value:{$ref:"$map/item/value"},options:{$ref:"$map/item/options"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setField"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}}}},{tagName:"jx-action-button",attributes:{part:"set"},$props:{size:"sm",quiet:!0,label:"${$map.item.clearTitle}",disabled:{$ref:"$map/item/clearLocked"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/clearField"},value:[{$ref:"$map/item/key"}]}]},children:[{tagName:"jx-dot",attributes:{part:"dot","data-state":"${$map.item.dotState}"},$props:{tone:{$ref:"$map/item/tone"}}}]}]}]}},{tagName:"div",attributes:{part:"template-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasTemplate"},cases:{true:{tagName:"jx-action-button",attributes:{part:"edit-template"},$props:{size:"sm",label:"Edit template"},onclick:{$ref:"#/state/editTemplate"},children:[{tagName:"span",textContent:"Edit template →"}]}}}]}]}}},{$description:"Condition. A `$switch` discriminant is a `$ref` and nothing else, so From data… is its only rung — de-escalating it would delete the key and demote the node — and the adapter says so by locking the row's source chip rather than by this document knowing what a `SwitchDef` is.",tagName:"div",attributes:{part:"condition-slot",role:"none",hidden:"${state.hasCondition ? null : ''}"},style:{display:"contents"},$switch:{$ref:"#/state/hasCondition"},cases:{true:{tagName:"jx-accordion-item",attributes:{"data-section":"condition"},$props:{label:"Condition",open:{$ref:"#/state/conditionOpen"}},ontoggle:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setSection"},value:["condition",{$ref:"event#/detail"}]}]},children:[{tagName:"div",attributes:{part:"section-body"},children:[{$prototype:"Array",items:{$ref:"#/state/conditionFields"},key:{$ref:"$map/item/key"},map:{$description:"A bindable value as a first-class field row. Every position it serves is a single-line expression — a collection, a filter, a sort key, a `$switch` — so it draws one widget rather than dispatching over a widget type: the textarea and checkbox arms the lit version carried had no caller in either tab. The set dot clears the position outright and is disabled where the position is mandatory; the source chip opens the rung picker rather than cycling, so any rung the position permits is one action away (§6.6).",tagName:"jx-field",attributes:{part:"field","data-prop":"${$map.item.prop}"},$props:{label:{$ref:"$map/item/label"},span:!0},children:[{tagName:"div",attributes:{part:"value"},children:[{tagName:"jx-action-button",attributes:{part:"source","data-source":"${$map.item.source}"},$props:{size:"sm",quiet:!0,haspopup:"menu",label:"${$map.item.sourceHint}",disabled:{$ref:"$map/item/sourceLocked"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/pickSource"},value:[{$ref:"$map/item/key"},{$ref:"event#/currentTarget"}]}]},children:[{tagName:"span",textContent:"${$map.item.sourceLabel}"}]},{tagName:"div",attributes:{part:"widget",role:"none"},$switch:{$ref:"$map/item/kind"},cases:{control:{tagName:"div",attributes:{part:"control-host","data-field":"${$map.item.key}"}},text:{tagName:"jx-textfield",attributes:{part:"text"},$props:{size:"sm",label:{$ref:"$map/item/label"},value:{$ref:"$map/item/value"},placeholder:{$ref:"$map/item/placeholder"},mono:{$ref:"$map/item/mono"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setField"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},select:{tagName:"jx-select",attributes:{part:"select"},$props:{size:"sm",label:{$ref:"$map/item/label"},value:{$ref:"$map/item/value"},options:{$ref:"$map/item/options"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setField"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}}}},{tagName:"jx-action-button",attributes:{part:"set"},$props:{size:"sm",quiet:!0,label:"${$map.item.clearTitle}",disabled:{$ref:"$map/item/clearLocked"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/clearField"},value:[{$ref:"$map/item/key"}]}]},children:[{tagName:"jx-dot",attributes:{part:"dot","data-state":"${$map.item.dotState}"},$props:{tone:{$ref:"$map/item/tone"}}}]}]}]}},{tagName:"p",attributes:{part:"subhead"},textContent:"Cases"},{$prototype:"Array",items:{$ref:"#/state/cases"},key:{$ref:"$map/item/key"},map:{tagName:"jx-field",attributes:{part:"field","data-prop":"${$map.item.prop}"},$props:{label:"Case",span:!0},children:[{tagName:"div",attributes:{part:"case"},children:[{tagName:"jx-textfield",attributes:{part:"case-name"},$props:{size:"sm",label:"Case value",value:{$ref:"$map/item/name"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/renameCase"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},{tagName:"jx-action-button",attributes:{part:"case-open"},$props:{size:"sm",quiet:!0,icon:"arrow-right",label:"${$map.item.openTitle}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openCase"},value:[{$ref:"$map/item/key"}]}]}},{tagName:"jx-action-button",attributes:{part:"case-remove"},$props:{size:"sm",quiet:!0,icon:"trash",label:"${$map.item.removeTitle}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/removeCase"},value:[{$ref:"$map/item/key"}]}]}}]}]}},{tagName:"jx-action-button",attributes:{part:"add-case"},$props:{size:"sm",quiet:!0,icon:"plus",label:"Add case"},onclick:{$ref:"#/state/addCase"},children:[{tagName:"span",textContent:"Add case"}]}]}]}}},{$description:"Events. A repeater is not an element — it has no `on*` position to bind, and offering Add Event on one writes a handler onto a node the renderer never mounts — so the adapter withholds the whole section rather than this document asking what a repeater is.",tagName:"div",attributes:{part:"events-slot",role:"none",hidden:"${state.hasEvents ? null : ''}"},style:{display:"contents"},$switch:{$ref:"#/state/hasEvents"},cases:{true:{tagName:"jx-accordion-item",attributes:{"data-section":"events"},$props:{label:"Events",open:{$ref:"#/state/eventsOpen"}},ontoggle:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setSection"},value:["events",{$ref:"event#/detail"}]}]},children:[{tagName:"div",attributes:{part:"section-body"},children:[{tagName:"div",attributes:{part:"declared-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasDeclared"},cases:{true:{tagName:"div",attributes:{part:"declared"},children:[{tagName:"p",attributes:{part:"subhead"},textContent:"Declared Events"},{$prototype:"Array",items:{$ref:"#/state/declared"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"declared-row",title:"${$map.item.title}"},children:[{tagName:"code",attributes:{part:"event-code"},textContent:"${$map.item.name}"},{tagName:"span",attributes:{part:"declared-from"},textContent:"${$map.item.source}"},{tagName:"span",attributes:{part:"event-type",hidden:"${$map.item.type ? null : ''}"},textContent:"${$map.item.type}"}]}},{tagName:"jx-divider"}]}}},{tagName:"div",attributes:{part:"bindings-head-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasBindings"},cases:{true:{tagName:"p",attributes:{part:"subhead"},textContent:"Event Bindings"}}},{$prototype:"Array",items:{$ref:"#/state/bindings"},key:{$ref:"$map/item/key"},map:{$description:"One `on*` key. The Mixed contract (§6.7) splits in two and this row shows both halves: which events exist, how each is produced, and its removal are properties of the BATCH — binding one handler to six buttons is a single decision, so those three controls write to every selected element in one transaction — while what a handler CONTAINS is the PRIMARY's, because six elements do not share one body and broadcasting a keystroke into six of them would destroy five. The dot says `mixed` when the selected elements disagree; the body below it stays the primary's.",tagName:"div",attributes:{part:"binding","data-event":"${$map.item.key}"},children:[{tagName:"div",attributes:{part:"binding-head"},children:[{$description:"The event NAME, and it is free-form rather than a list of ten. The menu offers what this element already binds plus the ten worth suggesting, and its last row asks for any other name through the one prompt dialog Studio has — so `ondragover`, `onpointerdown` and every custom event a component emits are bindable, which is exactly what §6.1 asks for and what the closed picker refused.",tagName:"jx-action-button",attributes:{part:"event-name"},$props:{size:"sm",haspopup:"menu",label:"${$map.item.nameTitle}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/pickEventName"},value:[{$ref:"$map/item/key"},{$ref:"event#/currentTarget"}]}]},children:[{tagName:"span",textContent:"${$map.item.name}"}]},{$description:'The same ladder every other bindable position in Studio offers, in the same four words. It used to read Inline code / Expression / Existing function — a fourth private dialect for the one ladder §6.6 collapses, so a user who learned "Formula" on a property row met "Expression" here and had no reason to think they were the same thing.',tagName:"jx-action-button",attributes:{part:"event-source","data-source":"${$map.item.source}"},$props:{size:"sm",quiet:!0,haspopup:"menu",label:"${$map.item.sourceHint}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/pickHandler"},value:[{$ref:"$map/item/key"},{$ref:"event#/currentTarget"}]}]},children:[{tagName:"span",textContent:"${$map.item.sourceLabel}"}]},{tagName:"jx-action-button",attributes:{part:"event-clear"},$props:{size:"sm",quiet:!0,icon:"trash",label:"${$map.item.clearTitle}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/clearEvent"},value:[{$ref:"$map/item/key"}]}]},children:[{tagName:"jx-dot",attributes:{part:"dot","data-state":"${$map.item.dotState}"},$props:{tone:{$ref:"$map/item/tone"}}}]}]},{tagName:"div",attributes:{part:"binding-body"},children:[{$description:"Statements or Code, for an inline function only. A structured body is a `JxStatement[]` and a code body is a string, so the toggle is a change of REPRESENTATION rather than of view — which is why it is drawn beside the body it rewrites rather than in the source ladder above it.",tagName:"div",attributes:{part:"toggle-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/showToggle"},cases:{true:{tagName:"div",attributes:{part:"body-toggle"},children:[{tagName:"jx-action-group",$props:{compact:!0,selects:"single",label:"Handler body"},children:[{tagName:"jx-action-button",attributes:{part:"body-statements"},$props:{size:"sm",label:"Statements",checked:{$ref:"$map/item/statementsChecked"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setBodyMode"},value:[{$ref:"$map/item/key"},"statements"]}]},children:[{tagName:"span",textContent:"Statements"}]},{tagName:"jx-action-button",attributes:{part:"body-code"},$props:{size:"sm",label:"Code",checked:{$ref:"$map/item/codeChecked"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setBodyMode"},value:[{$ref:"$map/item/key"},"code"]}]},children:[{tagName:"span",textContent:"Code"}]}]}]}}},{tagName:"div",attributes:{part:"body-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/body"},cases:{statements:{$description:"An island: `surfaces/statements.ts` mounts its own document in here, named by the handler it edits (`inspector/statements:<key>`), because a node with two structured handlers stamped one id on two elements and `resolveRegion` took the second.",tagName:"div",attributes:{part:"statements-host","data-event":"${$map.item.key}"}},code:{tagName:"div",attributes:{part:"body-row"},children:[{tagName:"jx-textfield",attributes:{part:"body-field"},$props:{size:"sm",multiline:!0,grows:!0,mono:!0,label:"Handler body",placeholder:"// handler body",value:{$ref:"$map/item/code"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setCode"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},{tagName:"jx-action-button",attributes:{part:"open-editor"},$props:{size:"sm",quiet:!0,icon:"code",label:"${$map.item.openTitle}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openEditor"},value:[{$ref:"$map/item/key"}]}]}}]},expression:{tagName:"div",attributes:{part:"body-row"},children:[{tagName:"div",attributes:{part:"expression-host","data-event":"${$map.item.key}"}},{tagName:"jx-action-button",attributes:{part:"open-editor"},$props:{size:"sm",quiet:!0,icon:"align-bottom",label:"${$map.item.openTitle}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openEditor"},value:[{$ref:"$map/item/key"}]}]}}]},ref:{tagName:"jx-select",attributes:{part:"event-handler"},$props:{size:"sm",label:"Handler",value:{$ref:"$map/item/refValue"},options:{$ref:"$map/item/refOptions"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setHandlerRef"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}}}}]}]}},{tagName:"jx-action-button",attributes:{part:"add-event"},$props:{size:"sm",quiet:!0,icon:"plus",label:"Add Event"},onclick:{$ref:"#/state/addEvent"},children:[{tagName:"span",textContent:"Add Event"}]}]}]}}},{$description:"The custom element's outward contract: what a page may set from markup, what it may override, and what it may reach into. Three read-only lists — this is a report, not a form — drawn only on a component's root.",tagName:"div",attributes:{part:"observed-slot",role:"none",hidden:"${state.hasObserved ? null : ''}"},style:{display:"contents"},$switch:{$ref:"#/state/hasObserved"},cases:{true:{tagName:"jx-accordion-item",attributes:{"data-section":"observed"},$props:{label:"Observed Attributes",open:{$ref:"#/state/observedOpen"}},ontoggle:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setSection"},value:["observed",{$ref:"event#/detail"}]}]},children:[{tagName:"div",attributes:{part:"section-body"},children:[{tagName:"div",attributes:{part:"observed-empty-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/observedEmpty"},cases:{true:{tagName:"div",attributes:{part:"empty"},children:[{tagName:"p",attributes:{part:"empty-message"},textContent:'Attributes let a page set this component from markup. Name an "attribute" on a data entry to expose it here.'}]}}},{$prototype:"Array",items:{$ref:"#/state/observed"},key:{$ref:"$map/item/key"},map:{$description:"A read-only name and what it maps to. The Content tab had three near-identical hand-written flex rows for these; they are one shape now, and this is it.",tagName:"div",attributes:{part:"kv","data-prop":"${$map.item.prop}"},children:[{tagName:"span",attributes:{part:"kv-name"},textContent:"${$map.item.name}"},{tagName:"span",attributes:{part:"kv-detail",hidden:"${$map.item.detail ? null : ''}"},textContent:"${$map.item.detail}"},{tagName:"span",attributes:{part:"kv-tags",hidden:"${$map.item.tags ? null : ''}"},textContent:"${$map.item.tags}"},{tagName:"span",attributes:{part:"kv-value",hidden:"${$map.item.value ? null : ''}"},textContent:"${$map.item.value}"}]}}]}]}}},{tagName:"div",attributes:{part:"cssprops-slot",role:"none",hidden:"${state.hasCssProps ? null : ''}"},style:{display:"contents"},$switch:{$ref:"#/state/hasCssProps"},cases:{true:{tagName:"jx-accordion-item",attributes:{"data-section":"cssprops"},$props:{label:"CSS Properties",open:{$ref:"#/state/cssPropsOpen"}},ontoggle:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setSection"},value:["cssprops",{$ref:"event#/detail"}]}]},children:[{tagName:"div",attributes:{part:"section-body"},children:[{$prototype:"Array",items:{$ref:"#/state/cssProps"},key:{$ref:"$map/item/key"},map:{$description:"A read-only name and what it maps to. The Content tab had three near-identical hand-written flex rows for these; they are one shape now, and this is it.",tagName:"div",attributes:{part:"kv","data-prop":"${$map.item.prop}"},children:[{tagName:"span",attributes:{part:"kv-name"},textContent:"${$map.item.name}"},{tagName:"span",attributes:{part:"kv-detail",hidden:"${$map.item.detail ? null : ''}"},textContent:"${$map.item.detail}"},{tagName:"span",attributes:{part:"kv-tags",hidden:"${$map.item.tags ? null : ''}"},textContent:"${$map.item.tags}"},{tagName:"span",attributes:{part:"kv-value",hidden:"${$map.item.value ? null : ''}"},textContent:"${$map.item.value}"}]}}]}]}}},{tagName:"div",attributes:{part:"cssparts-slot",role:"none",hidden:"${state.hasCssParts ? null : ''}"},style:{display:"contents"},$switch:{$ref:"#/state/hasCssParts"},cases:{true:{tagName:"jx-accordion-item",attributes:{"data-section":"cssparts"},$props:{label:"CSS Parts",open:{$ref:"#/state/cssPartsOpen"}},ontoggle:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setSection"},value:["cssparts",{$ref:"event#/detail"}]}]},children:[{tagName:"div",attributes:{part:"section-body"},children:[{$prototype:"Array",items:{$ref:"#/state/cssParts"},key:{$ref:"$map/item/key"},map:{$description:"A read-only name and what it maps to. The Content tab had three near-identical hand-written flex rows for these; they are one shape now, and this is it.",tagName:"div",attributes:{part:"kv","data-prop":"${$map.item.prop}"},children:[{tagName:"span",attributes:{part:"kv-name"},textContent:"${$map.item.name}"},{tagName:"span",attributes:{part:"kv-detail",hidden:"${$map.item.detail ? null : ''}"},textContent:"${$map.item.detail}"},{tagName:"span",attributes:{part:"kv-tags",hidden:"${$map.item.tags ? null : ''}"},textContent:"${$map.item.tags}"},{tagName:"span",attributes:{part:"kv-value",hidden:"${$map.item.value ? null : ''}"},textContent:"${$map.item.value}"}]}}]}]}}}]}}}]};T("logic-panel",Pe);function ue(){return{bindings:[],cases:[],conditionFields:[],conditionOpen:!0,cssParts:[],cssPartsOpen:!1,cssProps:[],cssPropsOpen:!1,declared:[],emptyActions:[],emptyMessage:"",eventsOpen:!0,hasBindings:!1,hasCondition:!1,hasCssParts:!1,hasCssProps:!1,hasDeclared:!1,hasEmptyActions:!1,hasEvents:!1,hasObserved:!1,hasRepeater:!1,hasTemplate:!1,observed:[],observedEmpty:!1,observedOpen:!1,repeaterFields:[],repeaterOpen:!0,state:"empty"}}function Ie(e,t){for(let[n,o]of Object.entries(t))e[n]=o}function Dt(e){let t=typeof e==="string"?void 0:e.attributes?.part;return typeof t==="string"?t:""}function Ht(e){let t=e?.$map?.item,n=t!==null&&typeof t==="object"?t.key:"";return typeof n==="string"?n:""}function Fe(e,t,n,o){let r=v({...ue(),...n});Ie(r,t);let a=null,i=!1;return e.replaceChildren(),R("logic-panel",r,e,{onNodeCreated:(s,l,d,x)=>{if(!(s instanceof HTMLElement))return;let g=Dt(d);if(g!=="control-host"&&g!=="expression-host"&&g!=="statements-host")return;let c=Ht(x);if(g==="control-host")o.controlSlot(c,s);else if(g==="expression-host")o.expressionSlot(c,s);else o.statementsSlot(c,s)}}).then((s)=>{if(i){s.dispose();return}a=s}),{connected:()=>{let s=a?.root;return s instanceof HTMLElement?s.isConnected:!i},dispose(){i=!0,a?.dispose(),a=null},update(s){Ie(r,s)}}}var Ve=["onclick","oninput","onchange","onsubmit","onkeydown","onkeyup","onfocus","onblur","onmouseenter","onmouseleave"],De=/^on[a-z][\da-z-]*$/i,He=T1("eventHandler");function Bt(e,t){if(e==="function")return{$prototype:"Function",body:"",parameters:[]};if(e==="expression")return{$expression:{operator:"=",target:null}};let[n]=t;return n?{$ref:`#/state/${n[0]}`}:{$ref:""}}function Be(e,t,n){q(u.value,(o)=>{for(let r of e)Ue(o,r,t,n)})}function Jt(e,t,n){if(t.length<2)return 0;let o=t.map((r)=>{let a=K(e,r);return a?Op(a,n)??null:null});return mp(o).mixed?t.length:0}var S={bindings:new Map,cases:new Set,fields:new Map,functionDefs:[],selection:null,targets:[]};function he(e,t){return t.some((n)=>n!==e)}function Je(e,t){let n=yo[e];return he(e,t)?`Value source: ${n} — click to change`:`Value source: ${n} (no other source available here)`}function Wt(e){return[...e.stateDefs.map((t)=>({label:t,value:`#/state/${t}`})),...e.extraSignals??[]]}function zt(e,t,n){let o=n.value!==void 0&&n.value!=="",r=n.mode==="literal"||n.mode==="function";return{clearLocked:!n.onClear,clearTitle:n.onClear?`Clear ${n.label}`:`${n.label} cannot be cleared`,dotState:o?"set":"unset",key:e,kind:n.mode==="expression"?"control":n.mode==="ref"?"select":"text",label:n.label,mono:n.mode==="template",options:n.mode==="ref"?Wt(n):[],placeholder:n.mode==="template"?"${state.…}":"",prop:t,source:n.mode,sourceHint:Je(n.mode,n.offered),sourceLabel:yo[n.mode],sourceLocked:!he(n.mode,n.offered),tone:"",value:r?String(n.value??""):n.mode==="ref"?Ot(n.value)?n.value.$ref:"":String(n.value??"")}}function me(e,t,n,o){let r=hc(o.caps),a=hd(t,o.value),i={...o,mode:a,offered:r};if(a==="expression"){let s=o.value?.$expression;i.paint=(l)=>Sl(l,s,(d)=>o.onChange({$expression:d}),{allowEventRef:!1,stateDefs:[...o.stateDefs],stateEntries:null})}return e.set(t,i),zt(t,n,i)}function We(){let e=new Map,t=new Map,n=new Set,o=ue(),r=u.value,a=Le(r?.session.selection),i=r?.doc.document,s=(b,k=[])=>(S={bindings:t,cases:n,fields:e,functionDefs:[],selection:null,targets:[]},o.emptyActions=k,o.emptyMessage=b,o.hasEmptyActions=k.length>0,o);if(!r||!i)return s("Open a page to inspect and wire what you click.",[{id:"open-page",label:"Open a page…"}]);if(!a)return s(Zh("wire it up"));let l=K(i,a);if(!l)return s(Mf());o.state="ready";let d=i.state||{},x=Object.entries(d).filter(([,b])=>b?.$prototype==="Function"||b?.$handler),g=r.session.selection.length>0?r.session.selection:[a];S={bindings:t,cases:n,fields:e,functionDefs:x,selection:a,targets:g};let c=l.$prototype==="Array",p=Boolean(l.$switch),w=a.length===0,f=dw({document:i,mode:r.doc.mode,selection:r.session.selection,ui:r.session.ui}),j=Xh(i),N=a.join("/"),L=(b)=>{let k=Ot(b)?b.$ref:null;if(!k)return;return U_(d[k.startsWith("#/state/")?k.slice(8):k])||void 0};if(c){o.hasRepeater=!0,o.repeaterOpen=Pa("__repeater",!0);let b=(m)=>(h)=>q(u.value,(A)=>Ue(A,a,m,h||void 0)),k=(m,h)=>me(e,`prop|${N}|${m}`,m,{caps:m==="filter"?"repeaterFilter":"repeaterSort",extraSignals:null,label:h,literalDefault:L(l[m]),onChange:b(m),onClear:()=>q(u.value,(A)=>Ue(A,a,m)),stateDefs:j,value:l[m]});o.repeaterFields=[me(e,`prop|${N}|items`,"items",{caps:"repeaterItems",extraSignals:null,label:"Items",literalDefault:L(l.items),onChange:(m)=>q(u.value,(h)=>Ue(h,a,"items",m)),stateDefs:j,value:l.items}),k("filter","Filter"),k("sort","Sort")],o.hasTemplate=Boolean(l.map)}if(p)o.hasCondition=!0,o.conditionOpen=Pa("__condition",!0),o.conditionFields=[me(e,`prop|${N}|$switch`,"$switch",{caps:"switchDiscriminant",extraSignals:V_(a),label:"Expression",literalDefault:L(l.$switch),onChange:(b)=>q(u.value,(k)=>Ue(k,a,"$switch",b)),stateDefs:j,value:l.$switch})],o.cases=Object.keys(l.cases||{}).map((b)=>(n.add(b),{key:b,name:b,openTitle:`Edit case "${b}"`,prop:`case:${b}`,removeTitle:`Remove case "${b}"`}));if(!c){if(o.hasEvents=!0,o.eventsOpen=Pa("__events",!0),f){let k=[];for(let[m,h]of Object.entries(d))if(Za(h)&&Array.isArray(h.emits))for(let[A,E]of h.emits.entries())k.push({key:`${m}:${E.name||A}`,name:E.name||"(unnamed)",source:`← ${m}`,title:E.description||"",type:nt(E.type)&&typeof E.type.text==="string"?E.type.text:""});o.declared=k,o.hasDeclared=k.length>0}let b=Object.keys(l).filter((k)=>k.startsWith("on")).map((k)=>[k,Op(l,k)]).filter((k)=>k[1]!==void 0);o.bindings=b.map(([k,m])=>_t(t,k,m,d)),o.hasBindings=b.length>0}if(f&&w){let b=Object.entries(d).filter(([,h])=>h.attribute);o.hasObserved=!0,o.observedOpen=Pa("__observed",!1),o.observedEmpty=b.length===0,o.observed=b.map(([h,A])=>{let E=A;return{detail:`→ ${h}`,key:h,name:String(E.attribute),prop:`attribute:${h}`,tags:E.reflects?"reflects":"",value:E.type?String(E.type):""}});let k=Object.entries(l.style||{}).filter(([h])=>h.startsWith("--"));o.hasCssProps=k.length>0,o.cssPropsOpen=Pa("__cssprops",!1),o.cssProps=k.map(([h,A])=>({detail:"",key:h,name:h,prop:`cssprop:${h}`,tags:"",value:String(A)}));let m=J_(i);o.hasCssParts=m.length>0,o.cssPartsOpen=Pa("__cssparts",!1),o.cssParts=m.map((h)=>({detail:`<${h.tag}>`,key:`${h.tag}:${h.name}`,name:h.name,prop:`csspart:${h.name}`,tags:"",value:""}))}return o}function _t(e,t,n,o){let{functionDefs:r,selection:a,targets:i}=S,s=u.value,l=Za(n)?n:null,d=ba(n)?n.$expression:null,x=ud(n),g=Boolean(l&&Array.isArray(l.body)),c=l?g?"statements":"code":d?"expression":"ref",p=Jt(s.doc.document,i,t)>0,w={body:c,fn:l,key:t,mode:x,value:n};if(l&&g&&a)w.mountStatements=(f)=>cw(f,l.body,(j)=>q(u.value,(N)=>Ue(N,a,t,{...l,body:j})),{allowEventRef:!0,emits:l.emits??[],region:mI(t),stateDefs:Object.keys(o),stateEntries:o});if(d&&a){let f=Of(s,`event:${JSON.stringify(a)}:${t}`,d,a,()=>Ai("rightPanel")),j=(L)=>q(u.value,(b)=>Ue(b,a,t,{$expression:L})),N=(L,b)=>q(u.value,(k)=>Bs(k,L,b));w.paint=(L)=>Sl(L,d,j,{allowEventRef:!0,onInsertDef:N,preview:f,stateDefs:Object.keys(o),stateEntries:o})}return e.set(t,w),{body:c,clearTitle:p?`${i.length} selected elements bind ${t} differently — clearing removes it from all of them`:`Clear ${t}`,code:l&&!g&&typeof l.body==="string"?l.body:"",codeChecked:c==="code"?"true":"false",dotState:p?"mixed":"set",key:t,name:t,nameTitle:`Event: ${t} — click to change`,openTitle:c==="expression"?"Open in formula workspace":"Open in editor",refOptions:[{label:"— none —",value:""},...r.map(([f])=>({label:f,value:`#/state/${f}`}))],refValue:Ot(n)?n.$ref:"",showToggle:Boolean(l),source:x,sourceHint:Je(x,He),sourceLabel:yo[x],statementsChecked:c==="statements"?"true":"false",tone:p?"warning":""}}var H=null,W=null,Y=new Map,X=new Map,Z=new Map,Ut={condition:"__condition",cssparts:"__cssparts",cssprops:"__cssprops",events:"__events",observed:"__observed",repeater:"__repeater"};function $e(e){if(W?.stop(),W=null,H?.dispose(),H=null,Y.clear(),X.clear(),Z.clear(),!e)return;H=Fe(e,We(),{addCase:()=>{let{selection:t}=S;if(t)q(u.value,(n)=>zL(n,t,`case${S.cases.size+1}`))},addEvent:en,clearEvent:(t)=>Be(S.targets,t),clearField:(t)=>S.fields.get(t)?.onClear?.(),editTemplate:()=>{let{selection:t}=S;if(t&&u.value)u.value.session.selection=[[...t,"map"]]},openCase:(t)=>{let{selection:n}=S;if(n&&u.value)u.value.session.selection=[[...n,"cases",t]]},openEditor:(t)=>{let{selection:n}=S,o=S.bindings.get(t);if(n&&o)_u({editing:{eventKey:t,path:n,type:"event"},surface:o.body==="expression"?"formula":"function"})},pickEventName:Qt,pickHandler:Xt,pickSource:Yt,runEmptyAction:(t)=>{if(t==="open-page")El().run()},removeCase:(t)=>{let{selection:n}=S;if(n)q(u.value,(o)=>WL(o,n,t))},renameCase:(t,n)=>{let{selection:o}=S;if(o&&n&&n!==t)q(u.value,(r)=>VL(r,o,t,n))},setBodyMode:Zt,setCode:(t,n)=>{let{selection:o}=S,r=S.bindings.get(t);if(o&&r?.fn)q(u.value,(a)=>Ue(a,o,t,{$prototype:"Function",body:n,parameters:r.fn?.parameters||[]}))},setField:(t,n)=>{let o=S.fields.get(t);if(!o)return;if(o.mode==="ref"){o.onChange(n?{$ref:n}:void 0);return}o.onChange(n)},setHandlerRef:(t,n)=>{let{selection:o}=S;if(!o)return;q(u.value,(r)=>Ue(r,o,t,n?{$ref:n}:void 0))},setSection:(t,n)=>{let o=Ut[t];if(o)Zg(o,n)}},{controlSlot:(t,n)=>{Y.set(t,n),S.fields.get(t)?.paint?.(n)},expressionSlot:(t,n)=>{X.set(t,n),S.bindings.get(t)?.paint?.(n)},statementsSlot:(t,n)=>{Z.set(t,n),S.bindings.get(t)?.mountStatements?.(n)}}),Kt()}var fe=!1;function qt(){if(fe||!H)return;fe=!0,queueMicrotask(()=>{if(fe=!1,!H)return;H.update(We()),queueMicrotask(Gt)})}function Gt(){for(let[e,t]of Y){let n=S.fields.get(e);if(!n||!t.isConnected){Y.delete(e);continue}n.paint?.(t)}for(let[e,t]of X){let n=S.bindings.get(e);if(!n||!t.isConnected){X.delete(e);continue}n.paint?.(t)}for(let[e,t]of Z){let n=S.bindings.get(e);if(!n||!t.isConnected){Z.delete(e);continue}n.mountStatements?.(t)}}function Kt(){W?.stop(),W=ge(),W.run(()=>{Q(()=>{let e=u.value;if(e)e.doc.document,e.doc.mode,e.session.selection.map((t)=>t.join("/")).join("|"),e.session.ui.inspectorSections;qt()})})}function Yt(e,t){let n=S.fields.get(e);if(!n||!he(n.mode,n.offered))return;Nt({label:"Value source",opener:t,region:"value-source",rows:n.offered.map((o)=>({checked:o===n.mode?"true":"false",destructive:!1,disabled:!1,dividerAbove:!1,id:o,title:yo[o]})),run:(o)=>{let r=o;if(r===n.mode)return;if(n.mode==="ref"&&n.literalDefault!==void 0&&!Su(e,"literal"))ku(e,"literal",n.literalDefault);n.onChange(pc(e,n.mode,r,Ae(n.value),pd(r,{extraSignals:n.extraSignals,literalDefault:n.literalDefault,stateDefs:n.stateDefs})))}})}function Xt(e,t){let n=S.bindings.get(e);if(!n)return;Nt({label:"Value source",opener:t,region:"value-source",rows:He.map((o)=>({checked:o===n.mode?"true":"false",destructive:!1,disabled:!1,dividerAbove:!1,id:o,title:yo[o]})),run:(o)=>{let r=o;if(r===n.mode)return;let a=Bt(r,S.functionDefs);Be(S.targets,e,pc(`event|${S.selection?.join("/")??""}|${e}`,n.mode,r,n.value,a)??a)}})}function Qt(e,t){let n=[...S.bindings.keys()],o=[...new Set([...n,...Ve])];Nt({label:"Event name",opener:t,region:"event-name",rows:[...o.map((r)=>({checked:r===e?"true":"false",destructive:!1,disabled:!1,dividerAbove:!1,id:r,title:r})),{destructive:!1,disabled:!1,dividerAbove:!0,id:"__custom__",run:()=>{Nn("Event name",{message:"Any DOM or custom event this element emits — onpointerdown, ondragover.",placeholder:"onpointerdown",validate:(r)=>De.test(r.trim())?"":"An event key starts with “on” and continues in letters, digits or hyphens.",value:e}).then((r)=>{if(r)Oe(e,r.trim())})},title:"Other name…"}],run:(r)=>Oe(e,r)})}function Oe(e,t){if(!t||t===e||!De.test(t))return;q(u.value,(n)=>{for(let o of S.targets){let r=Op(K(n.doc.document,o),e);if(r===void 0)continue;Ue(n,o,e),Ue(n,o,t,r)}})}function Zt(e,t){let{selection:n}=S,r=S.bindings.get(e)?.fn;if(!n||!r)return;let a=Array.isArray(r.body);if(t==="statements"===a)return;q(u.value,(i)=>Ue(i,n,e,{...r,body:t==="statements"?[]:""}))}function en(){let{functionDefs:e,selection:t}=S,n=u.value;if(!t||!n)return;let o=K(n.doc.document,t),r="onclick";for(let a of Ve)if(!o?.[a]){r=a;break}q(u.value,(a)=>Ue(a,t,r,e.length>0?{$ref:`#/state/${e[0][0]}`}:{$prototype:"Function",body:"",parameters:[]}))}var tn=new Set(["input","select","textarea"]);function nn(e){let t=qe(e.tagName).toLowerCase(),n=[];if(Gs(e))n.push(":popover-open","::backdrop",":popover-open::backdrop");if(t==="dialog")n.push("[open]",":modal","::backdrop");if(t==="details")n.push("[open]");if(tn.has(t))n.push(":checked",":invalid",":required",":user-invalid");if(t==="a")n.push(":visited",":target");return n}function ze(e){if(!e||typeof e!=="object")return[...ak];return[...new Set([...ak,...nn(e)])]}function _e(e,t,n,o=null){if(n===null||t.length===0)return{};let r={},a=(i,s)=>{for(let[l,d]of Object.entries(i))if(typeof d!=="object")r[l]={donor:s,value:d??""}};if(o){a(e[o]||{},null);for(let i of t){if(i===n)break;a((e[`@${i}`]||{})[o]||{},i)}return r}a(e,null);for(let i of t){if(i===n)break;a(e[`@${i}`]||{},i)}return r}var Ge={$schema:"https://jxsuite.com/schema/v1",$id:"StudioTargetLine",$description:"The Style tab's edit target, as one sentence (§6.2): element · breakpoint · scheme variant · selector, then the chip that states how wide the blast radius is. Every word of the sentence is a control, because a sentence you cannot act on is a caption and the panel already had one of those. The breakpoint and scheme segments ROUTE to where those axes are defined rather than offering a third list to pick from — the Style tab owns the selector axis and nothing else — so the selector is the one segment with a menu, and that menu is the kit's. The project-scope warning band is not decoration: entering Stylebook converts every edit from `this element` to `every element of this tag`, and the band states that before the first keystroke.",tagName:"div",attributes:{part:"target"},style:{$description:"The `.target-line` / `.tl-*` rules the line used to take from `styles/inspector.css`, brought here and re-valued onto the kit's own layer. Every segment is a button with the chrome taken off: the row must read as a sentence, not as a toolbar, which is exactly what the three widgets it replaced failed to do.",display:"block",fontSize:"var(--jx-text-xs)",'& [part="line"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-2)",padding:"5px var(--jx-space-3)",borderBottom:"1px solid var(--jx-border)",lineHeight:"1.4"},'& [part="glyph"]':{flexShrink:"0",color:"var(--jx-accent)"},'& [part="segments"]':{display:"flex",flexWrap:"wrap",alignItems:"center",gap:"1px",minWidth:"0",flex:"1"},'& [part="separator"]':{color:"var(--jx-fg-dim)",opacity:"0.6"},'& [part="segment"]':{padding:"1px 3px",border:"none",borderRadius:"var(--jx-radius-sm)",background:"none",color:"var(--jx-fg)",font:"inherit",fontFamily:"var(--jx-font-mono)"},'& button[part="segment"]':{cursor:"pointer",":hover":{background:"var(--jx-hover-bg)",color:"var(--jx-accent)"},":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"-1px"}},'& [data-seg="element"]':{color:"var(--jx-tag)"},'& [data-seg="media"], & [data-seg="scheme"]':{color:"var(--jx-fg-dim)"},'& [data-seg="selector"]':{color:"var(--jx-signal)"},'& [part="scope"]':{$description:"Element scope is ambient and reads as ambient; the two tag-wide scopes are the ones a reader has to notice BEFORE typing, so they carry weight.",flexShrink:"0",padding:"1px var(--jx-space-3)",border:"1px solid var(--jx-border)",borderRadius:"999px",color:"var(--jx-fg-dim)",whiteSpace:"nowrap"},'& [part="scope"][data-scope="document"]':{borderColor:"var(--jx-accent-50)",color:"var(--jx-accent)"},'& [part="scope"][data-scope="project"]':{borderColor:"var(--jx-warning)",color:"var(--jx-warning)"},'& [part="warning"]':{padding:"var(--jx-space-3)",borderBottom:"1px solid var(--jx-border)",borderLeft:"2px solid var(--jx-warning)",background:"var(--jx-bg-panel)"},'& [part="warning-text"]':{margin:"0",color:"var(--jx-warning)"},'& [part="warning-action"]':{marginTop:"var(--jx-space-2)",padding:"0",border:"none",background:"none",color:"var(--jx-accent)",font:"inherit",cursor:"pointer",textDecoration:"underline",":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"1px"}},'& [part="affected"]':{margin:"var(--jx-space-2) 0 0",padding:"0",maxHeight:"140px",overflowY:"auto",listStyle:"none"},'& [part="affected-row"]':{display:"flex",justifyContent:"space-between",gap:"var(--jx-space-4)",padding:"1px 0",color:"var(--jx-fg-dim)"},'& [part="affected-path"]':{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontFamily:"var(--jx-font-mono)"},'& [part="affected-count"]':{flexShrink:"0",fontFamily:"var(--jx-font-mono)"},'& [part="affected-empty"]':{margin:"var(--jx-space-2) 0 0",color:"var(--jx-fg-dim)"}},children:[{tagName:"div",attributes:{part:"line","data-jx-region":"${state.region}"},children:[{tagName:"span",attributes:{part:"glyph","aria-hidden":"true"},textContent:"⌖"},{tagName:"div",attributes:{part:"segments"},children:[{$prototype:"Array",items:{$ref:"#/state/segments"},key:{$ref:"$map/item/key"},map:{tagName:"span",attributes:{part:"segment-slot",role:"none"},style:{display:"contents"},children:[{tagName:"span",attributes:{part:"separator-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/leading"},cases:{false:{tagName:"span",attributes:{part:"separator","aria-hidden":"true"},textContent:"·"}}},{tagName:"span",attributes:{part:"control-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/control"},cases:{button:{tagName:"button",attributes:{part:"segment",type:"button","data-seg":"${$map.item.key}",title:"${$map.item.title}"},textContent:"${$map.item.label}",onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/activate"},value:[{$ref:"$map/item/key"}]}]}},readout:{tagName:"span",attributes:{part:"segment","data-seg":"${$map.item.key}",title:"${$map.item.title}"},textContent:"${$map.item.label}"}}}]}},{tagName:"span",attributes:{part:"separator","aria-hidden":"true"},textContent:"·"},{tagName:"button",attributes:{part:"segment",type:"button","data-seg":"selector","aria-haspopup":"menu",title:"The state or nested rule these edits land in — click to choose another"},textContent:"${state.selectorLabel} ⌄",onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openSelector"},value:[]}]}}]},{tagName:"span",attributes:{part:"scope","data-scope":"${state.scopeKind}",title:"${state.scopeTitle}"},textContent:"${state.scopeLabel}"}]},{tagName:"div",attributes:{part:"warning-slot",role:"none"},$switch:{$ref:"#/state/warn"},cases:{true:{tagName:"div",attributes:{part:"warning",role:"status"},children:[{tagName:"p",attributes:{part:"warning-text"},textContent:"${state.warningText}"},{tagName:"span",attributes:{part:"warning-action-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasToggle"},cases:{true:{tagName:"button",attributes:{part:"warning-action",type:"button","aria-expanded":"${state.showAffected ? 'true' : 'false'}"},textContent:"${state.toggleLabel}",onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/toggleAffected"},value:[]}]}}}},{tagName:"div",attributes:{part:"affected-slot",role:"none"},$switch:{$ref:"#/state/affectedState"},cases:{list:{tagName:"ul",attributes:{part:"affected"},children:[{$prototype:"Array",items:{$ref:"#/state/affectedFiles"},key:{$ref:"$map/item/path"},map:{tagName:"li",attributes:{part:"affected-row"},children:[{tagName:"span",attributes:{part:"affected-path"},textContent:"${$map.item.path}"},{tagName:"span",attributes:{part:"affected-count"},textContent:"${$map.item.count}"}]}}]},empty:{tagName:"p",attributes:{part:"affected-empty"},textContent:"No file list — the project could not be searched."}}}]}}}]};T("target-line",Ge);var rn="inspector/target",an="style-selector",be="base rule",Ke=null,te=null,ye=null,Ye=null,z=null;function ee(){let e=z;z=null,e?.close()}function Xe(){return Ke??=v({activate:(e)=>{te?.segments.find((t)=>t.key===e)?.onActivate?.()},affectedFiles:[],affectedState:"hidden",hasToggle:!1,openSelector:()=>{ve()},region:rn,scopeKind:"element",scopeLabel:"",scopeTitle:"",segments:[],selectorLabel:be,showAffected:!1,toggleAffected:()=>{te?.scope.onToggleAffected?.()},toggleLabel:"Show affected",warn:!1,warningText:""}),Ke}function Qe(e){let t=e instanceof HTMLElement?e:null;if(t===ye)return;ee();let n=Ye;if(ye=t,Ye=t?R("target-line",Xe(),t):null,n)n.then((o)=>{o.dispose()})}function Ze(e){te=e;let t=Xe(),n=[...e.scope.affectedFiles??[]],o=e.scope.showAffected===!0;t.segments=e.segments.map((r,a)=>({control:r.onActivate?"button":"readout",key:r.key,label:r.label,leading:a===0,title:r.title})),t.selectorLabel=e.selector.value??be,t.scopeKind=e.scope.kind,t.scopeLabel=e.scope.label,t.scopeTitle=e.scope.kind==="element"?"These edits apply to the selected element only":`These edits apply to ${e.scope.label}`,t.warn=e.scope.kind==="project",t.warningText=`Every edit here restyles ${e.scope.label} — ${e.scope.affected??"unknown"}.`,t.hasToggle=Boolean(e.scope.onToggleAffected),t.toggleLabel=o?"Hide affected":"Show affected",t.showAffected=o,t.affectedFiles=n,t.affectedState=o?n.length>0?"list":"empty":"hidden"}var sn="__base__",ln="__add_custom__";function ve(){let e=ye?.querySelector('[data-seg="selector"]')??null;if(!e?.isConnected)throw RangeError(`command "style.openSelectorMenu" needs the Inspector's Style tab rendered; its selector menu is not in the document`);let t=te?.selector;if(!t)return;ee();let n=(r)=>{ee(),t.onSelect(r)},o=[{destructive:!1,disabled:!1,dividerAbove:!1,id:sn,run:()=>{n(null)},title:be},...t.options.map((r,a)=>({checked:t.declared.has(r)?"true":"false",destructive:!1,disabled:!1,dividerAbove:a===0,id:r,run:()=>{n(r)},title:r})),{destructive:!1,disabled:!1,dividerAbove:!0,id:ln,run:()=>{ee(),t.onAddCustom()},title:"+ Add custom…"}];z=Nt({label:"Edit target",onClosed:(r)=>{if(z===r)z=null},opener:e,region:an,rows:o})}var P={$schema:"../../packages/schema/schema.json",$id:"css-meta",title:"CSS Property Metadata",description:"Section assignment, order, and input inference metadata for the style sidebar.",$sections:[{key:"layout",label:"Layout"},{key:"size",label:"Size",$layout:"grid"},{key:"spacing",label:"Spacing"},{key:"positioning",label:"Positioning"},{key:"typography",label:"Typography"},{key:"background",label:"Background"},{key:"border",label:"Border"},{key:"effects",label:"Effects"},{key:"other",label:"Other"}],$defs:{display:{$section:"layout",$order:10,type:"string",$input:"button-group",$buttonValues:["flex","grid","block","inline","none"],$icons:{flex:"columns",grid:"grid-four",block:"rectangle",inline:"text-t",none:"eye-slash"},enum:["block","inline","inline-block","flex","inline-flex","grid","inline-grid","contents","none","flow-root","table","list-item"]},height:{$section:"size",$order:10,type:"string",$units:["px","rem","em","%","vh","svh","dvh"],$keywords:["auto","min-content","max-content","fit-content"]},width:{$section:"size",$order:11,type:"string",$units:["px","rem","em","%","vw","svw"],$keywords:["auto","min-content","max-content","fit-content"]},minHeight:{$section:"size",$order:20,type:"string",$units:["px","rem","em","%","vh"],$keywords:["auto","min-content","max-content","fit-content"]},minWidth:{$section:"size",$order:21,type:"string",$units:["px","rem","em","%","vw"],$keywords:["auto","min-content","max-content","fit-content"]},maxHeight:{$section:"size",$order:30,type:"string",$units:["px","rem","em","%","vh"],$keywords:["none","min-content","max-content","fit-content"]},maxWidth:{$section:"size",$order:31,type:"string",$units:["px","rem","em","%","vw"],$keywords:["none","min-content","max-content","fit-content"]},aspectRatio:{$section:"size",$order:40,type:"string",examples:["auto","1/1","4/3","16/9","2/1"]},objectFit:{$section:"size",$order:41,type:"string",enum:["fill","contain","cover","none","scale-down"]},overflow:{$section:"size",$order:50,$span:2,type:"string",enum:["visible","hidden","scroll","auto","clip"]},overflowX:{$section:"size",$order:51,type:"string",enum:["visible","hidden","scroll","auto","clip"]},overflowY:{$section:"size",$order:52,type:"string",enum:["visible","hidden","scroll","auto","clip"]},boxSizing:{$section:"size",$order:60,$span:2,type:"string",enum:["content-box","border-box"]},flexDirection:{$section:"layout",$order:70,type:"string",$input:"button-group",$icons:{row:"arrow-right","row-reverse":"arrow-left",column:"arrow-down","column-reverse":"arrow-up"},enum:["row","row-reverse","column","column-reverse"],$show:[{prop:"display",values:["flex","inline-flex"]}]},flexWrap:{$section:"layout",$order:71,type:"string",$input:"button-group",$buttonValues:["nowrap","wrap"],$icons:{wrap:"arrow-u-down-left"},enum:["nowrap","wrap","wrap-reverse"],$show:[{prop:"display",values:["flex","inline-flex"]}]},justifyContent:{$section:"layout",$order:72,type:"string",$input:"button-group",$buttonValues:["flex-start","flex-end","center","space-between","space-around","space-evenly"],$icons:{"flex-start":"align-left","flex-end":"align-right",center:"align-center-horizontal","space-between":"arrows-out-line-horizontal","space-around":"arrows-in-line-horizontal","space-evenly":"arrows-horizontal"},enum:["flex-start","flex-end","center","space-between","space-around","space-evenly","start","end","normal"],$show:[{prop:"display",values:["flex","inline-flex","grid","inline-grid"]}]},alignItems:{$section:"layout",$order:73,type:"string",$input:"button-group",$buttonValues:["stretch","flex-start","flex-end","center","baseline"],$icons:{stretch:"arrows-out-line-vertical","flex-start":"align-top","flex-end":"align-bottom",center:"align-center-vertical",baseline:"text-a-underline"},enum:["stretch","flex-start","flex-end","center","baseline","start","end","normal"],$show:[{prop:"display",values:["flex","inline-flex","grid","inline-grid"]}]},alignContent:{$section:"layout",$order:74,type:"string",$input:"button-group",$buttonValues:["normal","flex-start","flex-end","center","space-between","stretch"],$icons:{"flex-start":"align-top","flex-end":"align-bottom",center:"align-center-vertical","space-between":"arrows-vertical",stretch:"arrows-out-line-vertical"},enum:["normal","flex-start","flex-end","center","space-between","space-around","stretch","start","end"],$show:[{prop:"display",values:["flex","inline-flex","grid","inline-grid"]}]},gap:{$section:"layout",$order:75,type:"string",$units:["px","rem","em","%"],$show:[{prop:"display",values:["flex","inline-flex","grid","inline-grid"]}]},rowGap:{$section:"layout",$order:76,type:"string",$units:["px","rem","em","%"],$show:[{prop:"display",values:["flex","inline-flex","grid","inline-grid"]}]},columnGap:{$section:"layout",$order:77,type:"string",$units:["px","rem","em","%"],$show:[{prop:"display",values:["flex","inline-flex","grid","inline-grid"]}]},flexGrow:{$section:"layout",$order:80,type:"string",$units:[],$show:[{prop:"display",values:["flex","inline-flex"]}]},flexShrink:{$section:"layout",$order:81,type:"string",$units:[],$show:[{prop:"display",values:["flex","inline-flex"]}]},flexBasis:{$section:"layout",$order:82,type:"string",$units:["px","rem","em","%"],$keywords:["auto","content"],$show:[{prop:"display",values:["flex","inline-flex"]}]},alignSelf:{$section:"layout",$order:83,type:"string",$input:"button-group",$buttonValues:["auto","flex-start","flex-end","center","baseline","stretch"],$icons:{stretch:"arrows-out-line-vertical","flex-start":"align-top","flex-end":"align-bottom",center:"align-center-vertical",baseline:"text-a-underline"},enum:["auto","flex-start","flex-end","center","baseline","stretch","start","end"],$show:[{prop:"display",values:["flex","inline-flex","grid","inline-grid"]}]},order:{$section:"layout",$order:84,type:"string",$units:[],$show:[{prop:"display",values:["flex","inline-flex","grid","inline-grid"]}]},gridTemplateColumns:{$section:"layout",$order:70,type:"string",examples:["repeat(2,1fr)","repeat(3,1fr)","repeat(4,1fr)","1fr 1fr","auto 1fr","auto"],$show:[{prop:"display",values:["grid","inline-grid"]}]},gridTemplateRows:{$section:"layout",$order:71,type:"string",examples:["repeat(2,1fr)","repeat(3,1fr)","auto 1fr","1fr 1fr"],$show:[{prop:"display",values:["grid","inline-grid"]}]},gridTemplateAreas:{$section:"layout",$order:72,type:"string",$show:[{prop:"display",values:["grid","inline-grid"]}]},justifyItems:{$section:"layout",$order:76,type:"string",enum:["start","end","center","stretch","normal"],$show:[{prop:"display",values:["grid","inline-grid"]}]},gridColumn:{$section:"layout",$order:80,type:"string",$show:[{prop:"display",values:["grid","inline-grid"]}]},gridRow:{$section:"layout",$order:81,type:"string",$show:[{prop:"display",values:["grid","inline-grid"]}]},justifySelf:{$section:"layout",$order:82,type:"string",enum:["auto","start","end","center","stretch","normal"],$show:[{prop:"display",values:["grid","inline-grid"]}]},padding:{$section:"spacing",$order:10,type:"string",$shorthand:!0},paddingTop:{$section:"spacing",$order:11,type:"string",$units:["px","rem","em","%"],$shorthand:"padding"},paddingRight:{$section:"spacing",$order:12,type:"string",$units:["px","rem","em","%"],$shorthand:"padding"},paddingBottom:{$section:"spacing",$order:13,type:"string",$units:["px","rem","em","%"],$shorthand:"padding"},paddingLeft:{$section:"spacing",$order:14,type:"string",$units:["px","rem","em","%"],$shorthand:"padding"},margin:{$section:"spacing",$order:20,type:"string",$shorthand:!0},marginTop:{$section:"spacing",$order:21,type:"string",$units:["px","rem","em","%"],$keywords:["auto"],$shorthand:"margin"},marginRight:{$section:"spacing",$order:22,type:"string",$units:["px","rem","em","%"],$keywords:["auto"],$shorthand:"margin"},marginBottom:{$section:"spacing",$order:23,type:"string",$units:["px","rem","em","%"],$keywords:["auto"],$shorthand:"margin"},marginLeft:{$section:"spacing",$order:24,type:"string",$units:["px","rem","em","%"],$keywords:["auto"],$shorthand:"margin"},position:{$section:"positioning",$order:10,type:"string",enum:["static","relative","absolute","fixed","sticky"]},top:{$section:"positioning",$order:20,type:"string",$units:["px","rem","em","%","vw","vh"],$keywords:["auto"],$show:[{prop:"position",values:["relative","absolute","fixed","sticky"]}]},right:{$section:"positioning",$order:21,type:"string",$units:["px","rem","em","%","vw","vh"],$keywords:["auto"],$show:[{prop:"position",values:["relative","absolute","fixed","sticky"]}]},bottom:{$section:"positioning",$order:22,type:"string",$units:["px","rem","em","%","vw","vh"],$keywords:["auto"],$show:[{prop:"position",values:["relative","absolute","fixed","sticky"]}]},left:{$section:"positioning",$order:23,type:"string",$units:["px","rem","em","%","vw","vh"],$keywords:["auto"],$show:[{prop:"position",values:["relative","absolute","fixed","sticky"]}]},zIndex:{$section:"positioning",$order:30,type:"string",$units:[],$keywords:["auto"],$show:[{prop:"position",values:["relative","absolute","fixed","sticky"]}]},float:{$section:"positioning",$order:40,type:"string",enum:["none","left","right","inline-start","inline-end"]},clear:{$section:"positioning",$order:41,type:"string",enum:["none","left","right","both","inline-start","inline-end"]},fontFamily:{$section:"typography",$order:10,type:"string",presets:[{title:"System UI",value:"system-ui, sans-serif"},{title:"Transitional",value:"Charter, 'Bitstream Charter', 'Sitka Text', Cambria, serif"},{title:"Old Style",value:"'Iowan Old Style', 'Palatino Linotype', 'URW Palladio L', P052, serif"},{title:"Humanist",value:"Seravek, 'Gill Sans Nova', Ubuntu, Calibri, 'DejaVu Sans', source-sans-pro, sans-serif"},{title:"Geometric Humanist",value:"Avenir, Montserrat, Corbel, 'URW Gothic', source-sans-pro, sans-serif"},{title:"Classical Humanist",value:"Optima, Candara, 'Noto Sans', source-sans-pro, sans-serif"},{title:"Neo-Grotesque",value:"Inter, Roboto, 'Helvetica Neue', 'Arial Nova', 'Nimbus Sans', Arial, sans-serif"},{title:"Monospace Slab Serif",value:"'Nimbus Mono PS', 'Courier New', monospace"},{title:"Monospace Code",value:"ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, 'DejaVu Sans Mono', monospace"},{title:"Industrial",value:"Bahnschrift, 'DIN Alternate', 'Franklin Gothic Medium', 'Nimbus Sans Narrow', sans-serif-condensed, sans-serif"},{title:"Rounded Sans",value:"ui-rounded, 'Hiragino Maru Gothic ProN', Quicksand, Comfortaa, Manjari, 'Arial Rounded MT', 'Arial Rounded MT Bold', Calibri, source-sans-pro, sans-serif"},{title:"Slab Serif",value:"Rockwell, 'Rockwell Nova', 'Roboto Slab', 'DejaVu Serif', 'Sitka Small', serif"},{title:"Antique",value:"Superclarendon, 'Bookman Old Style', 'URW Bookman', 'URW Bookman L', 'Georgia Pro', Georgia, serif"},{title:"Didone",value:"Didot, 'Bodoni MT', 'Noto Serif Display', 'URW Palladio L', P052, Sylfaen, serif"},{title:"Handwritten",value:"'Segoe Print', 'Bradley Hand', Chilanka, TSCu_Comic, casual, cursive"}]},fontSize:{$section:"typography",$order:20,type:"string",$units:["px","rem","em","%"],$keywords:["small","medium","large","x-large","xx-large","smaller","larger"]},fontWeight:{$section:"typography",$order:21,type:"string",examples:["100","200","300","400","500","600","700","800","900","normal","bold","lighter","bolder"]},fontStyle:{$section:"typography",$order:22,type:"string",enum:["normal","italic","oblique"]},fontVariant:{$section:"typography",$order:23,type:"string",enum:["normal","small-caps"]},lineHeight:{$section:"typography",$order:30,type:"string",$units:["px","rem","em","%"],$keywords:["normal"]},letterSpacing:{$section:"typography",$order:31,type:"string",$units:["px","rem","em"],$keywords:["normal"]},wordSpacing:{$section:"typography",$order:32,type:"string",$units:["px","rem","em"],$keywords:["normal"]},color:{$section:"typography",$order:40,type:"string",format:"color"},textAlign:{$section:"typography",$order:50,type:"string",$input:"button-group",$buttonValues:["left","center","right","justify"],$icons:{left:"text-align-left",center:"text-align-center",right:"text-align-right",justify:"text-align-justify"},enum:["left","right","center","justify","start","end"]},textTransform:{$section:"typography",$order:51,type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{$section:"typography",$order:52,type:"string",examples:["none","underline","overline","line-through","underline wavy"]},textOverflow:{$section:"typography",$order:53,type:"string",enum:["clip","ellipsis"],$show:[{prop:"overflow",values:["hidden","clip","auto","scroll"]}]},whiteSpace:{$section:"typography",$order:54,type:"string",enum:["normal","nowrap","pre","pre-wrap","pre-line","break-spaces"]},wordBreak:{$section:"typography",$order:55,type:"string",enum:["normal","break-all","keep-all","break-word"]},verticalAlign:{$section:"typography",$order:56,type:"string",examples:["baseline","top","middle","bottom","text-top","text-bottom","sub","super"]},textShadow:{$section:"typography",$order:60,type:"string"},listStyleType:{$section:"typography",$order:70,type:"string",enum:["none","disc","decimal","circle","square","lower-alpha","upper-alpha","lower-roman","upper-roman"]},backgroundColor:{$section:"background",$order:10,type:"string",format:"color"},backgroundImage:{$section:"background",$order:20,type:"string",examples:["none","linear-gradient(to bottom, #fff, #000)","radial-gradient(circle, #fff, #000)"]},backgroundSize:{$section:"background",$order:21,type:"string",examples:["auto","cover","contain","100% 100%"]},backgroundPosition:{$section:"background",$order:22,type:"string",examples:["center","top","bottom","left","right","center center","top left","bottom right"]},backgroundRepeat:{$section:"background",$order:23,type:"string",enum:["repeat","no-repeat","repeat-x","repeat-y","space","round"]},backgroundAttachment:{$section:"background",$order:24,type:"string",enum:["scroll","fixed","local"]},backgroundClip:{$section:"background",$order:25,type:"string",enum:["border-box","padding-box","content-box","text"]},backgroundOrigin:{$section:"background",$order:26,type:"string",enum:["border-box","padding-box","content-box"]},opacity:{$section:"background",$order:40,type:"number",minimum:0,maximum:1},border:{$section:"border",$order:10,type:"string",$shorthand:!0,$shorthandType:"border-side",$longhands:["borderWidth","borderStyle","borderColor"]},borderWidth:{$section:"border",$order:11,type:"string",$shorthand:!0},borderStyle:{$section:"border",$order:12,type:"string",enum:["none","solid","dashed","dotted","double","groove","ridge","inset","outset","hidden"]},borderColor:{$section:"border",$order:13,type:"string",format:"color"},borderTop:{$section:"border",$order:13.1,type:"string",$shorthand:!0,$shorthandType:"border-side",$longhands:["borderTopWidth","borderTopStyle","borderTopColor"]},borderRight:{$section:"border",$order:13.2,type:"string",$shorthand:!0,$shorthandType:"border-side",$longhands:["borderRightWidth","borderRightStyle","borderRightColor"]},borderBottom:{$section:"border",$order:13.3,type:"string",$shorthand:!0,$shorthandType:"border-side",$longhands:["borderBottomWidth","borderBottomStyle","borderBottomColor"]},borderLeft:{$section:"border",$order:13.4,type:"string",$shorthand:!0,$shorthandType:"border-side",$longhands:["borderLeftWidth","borderLeftStyle","borderLeftColor"]},borderBlockStart:{$section:"border",$order:13.5,type:"string",$shorthand:!0,$shorthandType:"border-side",$longhands:["borderBlockStartWidth","borderBlockStartStyle","borderBlockStartColor"]},borderBlockEnd:{$section:"border",$order:13.6,type:"string",$shorthand:!0,$shorthandType:"border-side",$longhands:["borderBlockEndWidth","borderBlockEndStyle","borderBlockEndColor"]},borderInlineStart:{$section:"border",$order:13.7,type:"string",$shorthand:!0,$shorthandType:"border-side",$longhands:["borderInlineStartWidth","borderInlineStartStyle","borderInlineStartColor"]},borderInlineEnd:{$section:"border",$order:13.8,type:"string",$shorthand:!0,$shorthandType:"border-side",$longhands:["borderInlineEndWidth","borderInlineEndStyle","borderInlineEndColor"]},borderTopWidth:{$section:"border",$order:14,type:"string",$units:["px","rem","em"],$shorthand:"borderWidth"},borderTopStyle:{$section:"border",$order:15,$shorthand:"borderTop",type:"string",enum:["none","solid","dashed","dotted","double","groove","ridge","inset","outset","hidden"]},borderTopColor:{$section:"border",$order:16,$shorthand:"borderTop",type:"string",format:"color"},borderRightWidth:{$section:"border",$order:17,type:"string",$units:["px","rem","em"],$shorthand:"borderWidth"},borderRightStyle:{$section:"border",$order:18,$shorthand:"borderRight",type:"string",enum:["none","solid","dashed","dotted","double","groove","ridge","inset","outset","hidden"]},borderRightColor:{$section:"border",$order:19,$shorthand:"borderRight",type:"string",format:"color"},borderBottomWidth:{$section:"border",$order:20,type:"string",$units:["px","rem","em"],$shorthand:"borderWidth"},borderBottomStyle:{$section:"border",$order:21,$shorthand:"borderBottom",type:"string",enum:["none","solid","dashed","dotted","double","groove","ridge","inset","outset","hidden"]},borderBottomColor:{$section:"border",$order:22,$shorthand:"borderBottom",type:"string",format:"color"},borderLeftWidth:{$section:"border",$order:23,type:"string",$units:["px","rem","em"],$shorthand:"borderWidth"},borderLeftStyle:{$section:"border",$order:24,$shorthand:"borderLeft",type:"string",enum:["none","solid","dashed","dotted","double","groove","ridge","inset","outset","hidden"]},borderLeftColor:{$section:"border",$order:25,$shorthand:"borderLeft",type:"string",format:"color"},borderRadius:{$section:"border",$order:30,type:"string",$shorthand:!0},borderTopLeftRadius:{$section:"border",$order:31,type:"string",$units:["px","rem","em","%"],$shorthand:"borderRadius"},borderTopRightRadius:{$section:"border",$order:32,type:"string",$units:["px","rem","em","%"],$shorthand:"borderRadius"},borderBottomRightRadius:{$section:"border",$order:33,type:"string",$units:["px","rem","em","%"],$shorthand:"borderRadius"},borderBottomLeftRadius:{$section:"border",$order:34,type:"string",$units:["px","rem","em","%"],$shorthand:"borderRadius"},outline:{$section:"border",$order:40,type:"string"},outlineOffset:{$section:"border",$order:41,type:"string",$units:["px","rem","em"]},borderBlockStartWidth:{$section:"border",$order:50,type:"string",$units:["px","rem","em"],$shorthand:"borderBlockStart"},borderBlockStartStyle:{$section:"border",$order:51,type:"string",enum:["none","solid","dashed","dotted","double","groove","ridge","inset","outset","hidden"],$shorthand:"borderBlockStart"},borderBlockStartColor:{$section:"border",$order:52,type:"string",format:"color",$shorthand:"borderBlockStart"},borderBlockEndWidth:{$section:"border",$order:53,type:"string",$units:["px","rem","em"],$shorthand:"borderBlockEnd"},borderBlockEndStyle:{$section:"border",$order:54,type:"string",enum:["none","solid","dashed","dotted","double","groove","ridge","inset","outset","hidden"],$shorthand:"borderBlockEnd"},borderBlockEndColor:{$section:"border",$order:55,type:"string",format:"color",$shorthand:"borderBlockEnd"},borderInlineStartWidth:{$section:"border",$order:56,type:"string",$units:["px","rem","em"],$shorthand:"borderInlineStart"},borderInlineStartStyle:{$section:"border",$order:57,type:"string",enum:["none","solid","dashed","dotted","double","groove","ridge","inset","outset","hidden"],$shorthand:"borderInlineStart"},borderInlineStartColor:{$section:"border",$order:58,type:"string",format:"color",$shorthand:"borderInlineStart"},borderInlineEndWidth:{$section:"border",$order:59,type:"string",$units:["px","rem","em"],$shorthand:"borderInlineEnd"},borderInlineEndStyle:{$section:"border",$order:60,type:"string",enum:["none","solid","dashed","dotted","double","groove","ridge","inset","outset","hidden"],$shorthand:"borderInlineEnd"},borderInlineEndColor:{$section:"border",$order:61,type:"string",format:"color",$shorthand:"borderInlineEnd"},boxShadow:{$section:"effects",$order:10,type:"string",examples:["none","0 1px 3px rgba(0,0,0,0.12)","0 4px 6px rgba(0,0,0,0.1)","inset 0 1px 2px rgba(0,0,0,0.1)"]},filter:{$section:"effects",$order:20,type:"string",examples:["none","blur(4px)","brightness(1.2)","contrast(0.8)","grayscale(100%)","saturate(1.5)"]},backdropFilter:{$section:"effects",$order:21,type:"string",examples:["none","blur(4px)","brightness(1.2)","contrast(0.8)","grayscale(100%)","saturate(1.5)"]},transform:{$section:"effects",$order:30,type:"string",examples:["none","translateX(0)","translateY(0)","rotate(0deg)","scale(1)","skewX(0deg)"]},transformOrigin:{$section:"effects",$order:31,type:"string",examples:["center","top","bottom","left","right","top left","top right","bottom left","bottom right","center center"]},transition:{$section:"effects",$order:40,type:"string",examples:["none","all 0.2s ease","opacity 0.2s ease","transform 0.2s ease","background-color 0.2s ease"]},animationName:{$section:"effects",$order:41,type:"string"},animationDuration:{$section:"effects",$order:42,type:"string",$units:["s","ms"],$show:[{prop:"animationName",values:[]}]},animationTimingFunction:{$section:"effects",$order:43,type:"string",enum:["ease","linear","ease-in","ease-out","ease-in-out","step-start","step-end"],$show:[{prop:"animationName",values:[]}]},animationFillMode:{$section:"effects",$order:44,type:"string",enum:["none","forwards","backwards","both"],$show:[{prop:"animationName",values:[]}]},animationIterationCount:{$section:"effects",$order:45,type:"string",examples:["1","2","3","infinite"],$show:[{prop:"animationName",values:[]}]},cursor:{$section:"effects",$order:50,type:"string",enum:["auto","default","pointer","text","move","not-allowed","grab","grabbing","crosshair","help","wait","zoom-in","zoom-out","none"]},pointerEvents:{$section:"effects",$order:51,type:"string",enum:["auto","none"]},userSelect:{$section:"effects",$order:52,type:"string",enum:["auto","none","text","all","contain"]},visibility:{$section:"effects",$order:53,type:"string",enum:["visible","hidden","collapse"]},resize:{$section:"effects",$order:54,type:"string",enum:["none","both","horizontal","vertical"]},appearance:{$section:"effects",$order:55,type:"string",enum:["auto","none"]}}};var et=new Map;function BS(e){et=new Map(e.cssProps)}function xe(){return et}function cn(e,t){let n=t[e.prop]??"";if(e.values.length===0)return n!==""&&n!=="initial";return e.values.includes(n)}function tt(e,t){return(e.$show??[]).every((n)=>cn(n,t))}function rt(e,t){let n=e.style||{},o={...t};for(let r of Object.keys(n)){if(typeof n[r]==="object")continue;let i=P.$defs[r]?.$section??"other";if(o[i]===void 0)o[i]=!0}return o}function B(e){let t=P.$defs[e];if(t?.$longhands)return t.$longhands.map((o)=>({entry:P.$defs[o]||{$order:0},name:o})).toSorted((o,r)=>o.entry.$order-r.entry.$order);let n=[];for(let[o,r]of Object.entries(P.$defs))if(r.$shorthand===e)n.push({entry:r,name:o});return n.sort((o,r)=>o.entry.$order-r.entry.$order),n}function at(e,t){if(!e)return Array.from({length:t},()=>"");let n=e.trim().split(/\s+/);if(t!==4||n.length===0)return Array.from({length:t},()=>"");if(n.length===1)return[n[0],n[0],n[0],n[0]];if(n.length===2)return[n[0],n[1],n[0],n[1]];if(n.length===3)return[n[0],n[1],n[2],n[1]];return[n[0],n[1],n[2],n[3]]}function it(e){let[t,n,o,r]=e;if(t===n&&n===o&&o===r)return t;if(t===o&&n===r)return`${t} ${n}`;if(n===r)return`${t} ${n} ${o}`;return`${t} ${n} ${o} ${r}`}var pn=new Set(["none","solid","dashed","dotted","double","groove","ridge","inset","outset","hidden"]);function st(e){if(!e)return["","",""];let t=[],n="",o=0;for(let s of e.trim()){if(s==="(")o+=1;if(s===")")o-=1;if(s===" "&&o===0){if(n)t.push(n);n=""}else n+=s}if(n)t.push(n);let r="",a="",i="";for(let s of t)if(!a&&pn.has(s))a=s;else if(!r&&/^[\d.]/.test(s))r=s;else i=i?`${i} ${s}`:s;return[r,a,i]}function lt(e){return e.filter((t)=>t&&t.trim()).join(" ")}function dt(){let e=qo(u.value?.doc.document?.style),t=[];for(let[n,o]of Object.entries(e))if(n.startsWith("--font")&&(typeof o==="string"||typeof o==="number"))t.push({name:n,value:String(o)});return t}var ct={fontStyle:"slant",fontVariant:"variant",fontWeight:"weight",textDecoration:"decoration",textTransform:"transform"};var oe=/^(-?[\d.]+)(px|rem|em|%|vw|vh|svw|svh|dvh|ms|s|fr|ch|ex|deg)?$/;var pt={$schema:"https://jxsuite.com/schema/v1",$id:"StudioStylePanel",$description:"The Inspector's Style tab: the Target Line's host, one filter, then the CSS property accordion — every row saying where its value came from (§6.7), every section heading tallying what is set inside it. Nothing here knows what CSS is. `panels/style-panel.ts` resolves the compound coordinate (selection, breakpoint, scheme layer, nested selector), reads css-meta, decides which of seven controls a property gets, works out its provenance and what a commit writes; this document draws the answer and decides nothing. That split is what lets the tab stop going through `panels/panel-scheduler.ts`: the focus guard existed because a lit repaint of the whole panel could take the field a reader was typing into, and a document is one runtime effect per bound property with an equal write skipped.",tagName:"div",attributes:{part:"panel"},style:{$description:"What `.style-sidebar`, `.style-filter-bar`, `.style-row`, `.style-row-label`, `.style-row--child`, `.style-row--warning`, `.style-shorthand-header`, `.style-section-body--grid`, `.kv-row`, `.kv-key`, `.kv-val`, `.input-group`, `.style-input-number-unit`, `.button-group-combo`, `.provenance-chip*`, `.set-dot` and `.provenance-dots` said across `styles/inspector.css` and `styles/overlays.css`, keyed on `part` and re-pointed at the kit's token layer. The rules those parts replace are DEAD in the stylesheets now rather than shared: `ui/field-row.ts` drew the same row for the Signals panel and the expression editor, and it is gone with them, so `.style-row*`, `.provenance-chip*` and `.set-dot` no longer have an emitter. Every `--spectrum-*` reference is gone rather than renamed — those names resolve only inside `<sp-theme>`, and this document is mounted in the Inspector's tab body, outside it, so each would silently have taken its hard-coded px fallback. The one deliberate change is the provenance chip: it is a `button` wherever it acts, drawn at the same 6px, because a 6px circle that clears a property was reachable by mouse alone.",display:"flex",flexDirection:"column",minHeight:"0",fontFamily:"var(--jx-font-sans)",color:"var(--jx-fg)",'& [part="empty"]':{$description:"The one empty-state pattern (`panels/empty-state.ts`), drawn here because a document cannot render a lit helper. Its rules are what is kept (studio-ui-guidelines.md §11): one sentence saying what the region is FOR, then the action that fills it.",display:"flex",flexDirection:"column",alignItems:"center",gap:"var(--jx-space-3)",padding:"var(--jx-space-6)",textAlign:"center",fontSize:"var(--jx-text-md)",color:"var(--jx-fg-dim)"},'& [part="empty-message"]':{margin:"0",maxWidth:"34ch",lineHeight:"1.5"},'& [part="filter"]':{padding:"var(--jx-space-2) var(--jx-space-3)",borderBottom:"1px solid var(--jx-border)"},'& [part="rows"]':{display:"flex",flexDirection:"column",minWidth:"0"},'& [part="rows"][data-layout="grid"]':{$description:"The Size section only. Two equal columns that may both shrink to nothing, so a long value scrolls inside its own control instead of pushing the pane wider.",display:"grid",gridTemplateColumns:"minmax(0, 1fr) minmax(0, 1fr)",gap:"var(--jx-space-2) var(--jx-space-3)"},'& [part="rows"] > [part="row"]':{$description:'Scoped to the panel\'s OWN rows rather than to every `part="row"` beneath it, and that is load-bearing now that a colour row draws a `jx-color-field`. The kit is light DOM and one cascade, so `[part="row"]` as a bare descendant also matches the field\'s internal row — and at equal specificity with the kit\'s own `& > [part="row"]` the winner is whichever sheet was interned later, which is not a thing a stylesheet may depend on. The same reasoning moved `[part="chip"]` under `[part="chip-slot"]`, where `background: none` would otherwise have erased a swatch\'s colour, and `[part="control"]` under its row, where `> *` would have stretched a swatch\'s chip.',display:"flex",flexDirection:"column",alignItems:"stretch",gap:"2px",padding:"2px 0",minWidth:"0"},'& [part="rows"] > [part="row"][data-span="2"]':{gridColumn:"1 / -1"},'& [part="rows"] > [part="row"][data-child="true"]':{paddingLeft:"var(--jx-space-5)"},'& [part="row-label"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-2)",fontSize:"var(--jx-text-xs)",color:"var(--jx-fg-dim)"},'& [part="rows"] > [part="row"][data-warning="true"] > [part="row-label"]':{color:"var(--jx-warning)","::before":{content:'"⚠ "'}},'& [part="label"]':{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},'& [part="rows"] > [part="row"] > [part="control"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-1)",minWidth:"0"},'& [part="rows"] > [part="row"] > [part="control"] > *':{flex:"1",minWidth:"0"},'& [part="color"]':{display:"flex",minWidth:"0"},'& [part="color"] > [part="color-field"]':{flex:"1",minWidth:"0"},'& [part="color-field"] > [part="row"]':{$description:"The field is `inline-flex` around a row sized to its own contents, which is right where it stands in a sentence and wrong where it IS the width of a dock. Two declarations, not a restatement of the kit's layout: the field still lays itself out.",flex:"1",minWidth:"0"},'& [part="color-field"] [part="text"]':{flex:"1",inlineSize:"auto",minInlineSize:"0"},'& [part="chip-slot"] > [part="chip"]':{$description:"One vocabulary, five states (§6.7). `default` draws nothing at all — absence IS the ghost — which is why there is no rule for it: the document never makes the node. `set` is the 6px accent disc `.set-dot` has always been; the two that carry information wear their donor's name in a bordered pill, and `mixed` is neutral on purpose because it says nothing about WHERE a value came from, only that the selection disagrees.",display:"inline-flex",alignItems:"center",flexShrink:"0",margin:"0",padding:"0",border:"none",background:"none",color:"inherit",font:"inherit",fontSize:"var(--jx-text-xs)"},'& [part="chip-slot"] > button[part="chip"]':{cursor:"pointer",":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"1px"}},'& [part="chip-slot"] > [part="chip"][data-state="set"]':{width:"6px",height:"6px",borderRadius:"50%",background:"var(--jx-accent)"},'& [part="chip-slot"] > button[part="chip"][data-state="set"]:hover':{background:"var(--jx-danger)"},'& [part="chip-slot"] > [part="chip"][data-state="inherited"], & [part="chip-slot"] > [part="chip"][data-state="bound"], & [part="chip-slot"] > [part="chip"][data-state="mixed"]':{maxWidth:"16ch",overflow:"hidden",padding:"0 var(--jx-space-2)",border:"1px solid currentcolor",borderRadius:"var(--jx-radius-sm)",lineHeight:"14px",whiteSpace:"nowrap",textOverflow:"ellipsis"},'& [part="chip-slot"] > [part="chip"][data-state="inherited"]':{color:"var(--jx-warning)"},'& [part="chip-slot"] > [part="chip"][data-state="bound"]':{color:"var(--jx-handler)"},'& [part="chip-slot"] > [part="chip"][data-state="mixed"]':{color:"var(--jx-fg-muted)"},'& [part="dots"]':{display:"inline-flex",alignItems:"center",gap:"3px"},'& [part="dot"]':{$description:"A collapsed heading has room for a tally, not for three labelled chips, so the two states that normally carry text collapse to coloured discs beside the accent one. That tally is what retired the tab's Active filter toggle: the toggle existed only because a closed section could not say whether anything inside it was set.",display:"inline-block",flex:"none",width:"7px",height:"7px",margin:"0",padding:"0",border:"none",borderRadius:"50%",background:"var(--jx-fg-muted)"},'& button[part="dot"]':{cursor:"pointer",":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"1px"}},'& [part="dot"][data-state="set"]':{background:"var(--jx-accent)"},'& button[part="dot"][data-state="set"]:hover':{background:"var(--jx-danger)"},'& [part="dot"][data-state="inherited"]':{background:"var(--jx-warning)"},'& [part="dot"][data-state="bound"]':{background:"var(--jx-handler)"},'& [part="source"]':{$description:"The Value Source chip (§6.6): quiet while the value is a literal, accent-tinted the moment it is produced from something else. A CSS declaration has exactly two rungs — `JxStyle` admits no `$ref` — so the picker it opens is two rows, and that is derived from the schema rather than written here.",flex:"none",color:"var(--jx-fg-dim)"},'& [part="source"][data-source="template"]':{color:"var(--jx-accent)"},'& [part="group"]':{$description:"The composite the kit draws as two elements on purpose: a field the reader may type anything into, beside a button that opens the kit MENU. It is the unit row, and it is not a combobox, because its list runs a VERB rather than committing a value — a unit re-attaches to the number the field holds (ui.md §5.5, jx-dimension-field). The keyword rows and the font row, whose list IS the value, are `jx-combobox` (the `keywords` case).",display:"flex",flex:"1",alignItems:"stretch",gap:"0",minWidth:"0"},'& [part="group"] > jx-textfield':{flex:"1 1 auto",minWidth:"0"},'& [part="group-open"]':{flex:"0 0 auto",marginInlineStart:"calc(-1 * 1px)"},'& [part="buttons"]':{display:"flex",flex:"1",alignItems:"stretch",minWidth:"0"},'& [part="buttons"] jx-action-group':{minWidth:"0"},'& [part="shorthand"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-1)",minWidth:"0"},'& [part="shorthand"] > jx-textfield':{flex:"1",minWidth:"0"},'& [part="kv"]':{display:"flex",gap:"var(--jx-space-1)",marginBottom:"3px",minWidth:"0"},'& [part="kv-key"]':{width:"90px",flexShrink:"0"},'& [part="kv-value"]':{flex:"1",minWidth:"0"},'& [part="nested"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-1)",padding:"2px 0",minWidth:"0"},'& [part="nested-open"]':{flex:"1",overflow:"hidden",padding:"var(--jx-space-2) var(--jx-space-3)",border:"none",borderRadius:"var(--jx-radius-sm)",background:"var(--jx-bg-panel)",color:"var(--jx-fg)",font:"inherit",fontSize:"var(--jx-text-sm)",fontFamily:"var(--jx-font-mono)",textAlign:"left",textOverflow:"ellipsis",whiteSpace:"nowrap",cursor:"pointer",":hover":{background:"var(--jx-hover-bg)",color:"var(--jx-accent)"},":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"-1px"}},'& [part="nested-add"]':{width:"100%",padding:"var(--jx-space-2) var(--jx-space-3)",border:"1px dashed var(--jx-border-strong)",borderRadius:"var(--jx-radius-sm)",background:"none",color:"var(--jx-fg-dim)",font:"inherit",fontSize:"var(--jx-text-sm)",cursor:"pointer",":hover":{color:"var(--jx-accent)",borderColor:"var(--jx-accent-50)"},":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"1px"}}},children:[{tagName:"div",attributes:{part:"view-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/view"},cases:{empty:{tagName:"div",attributes:{part:"empty"},children:[{tagName:"p",attributes:{part:"empty-message"},textContent:"${state.emptyMessage}"},{tagName:"span",attributes:{part:"empty-action-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasEmptyAction"},cases:{true:{tagName:"jx-button",attributes:{part:"empty-action"},$props:{size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/runEmptyAction"},value:[]}]},children:[{tagName:"span",textContent:"${state.emptyActionLabel}"}]}}}]},editor:{tagName:"div",attributes:{part:"editor",role:"none"},style:{display:"contents"},children:[{$description:"The Target Line's own host. It is EMPTY on purpose and stays empty: `surfaces/target-line.ts` mounts a second document into it, announced through `onNodeCreated` rather than found by selector (studio-ui-guidelines.md §9.4), so the line survives every repaint of the tab around it.",tagName:"div",attributes:{part:"target-host"}},{tagName:"div",attributes:{part:"filter"},children:[{tagName:"jx-textfield",attributes:{part:"filter-input"},$props:{size:"sm",type:"search",clearable:!0,label:"Filter properties",placeholder:"Filter properties…",value:{$ref:"#/state/filter"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setFilter"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-accordion",attributes:{part:"sections"},$props:{multiple:!0},children:[{$prototype:"Array",items:{$ref:"#/state/sections"},key:{$ref:"$map/item/key"},map:{tagName:"jx-accordion-item",attributes:{part:"section","data-section":"${$map.item.key}"},$props:{label:{$ref:"$map/item/label"},open:{$ref:"$map/item/open"}},ontoggle:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/toggleSection"},value:[{$ref:"$map/item/key"},{$ref:"event#/detail"}]}]},children:[{$description:"The inert half of the tally goes in the heading slot and the one control in the actions slot, which is the element's own division: a click on the actions row cancels the summary's toggle, and a click on an inert mark slotted there would cancel it for nothing.",tagName:"span",attributes:{part:"dots",slot:"heading",hidden:"${$map.item.hasMarks ? null : ''}",title:"${$map.item.tally}","aria-label":"${$map.item.tally}"},children:[{$prototype:"Array",items:{$ref:"$map/item/marks"},key:{$ref:"$map/item/state"},map:{tagName:"span",attributes:{part:"dot","data-state":"${$map.item.state}"}}}]},{tagName:"span",attributes:{part:"actions-slot",slot:"actions",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/canClear"},cases:{true:{tagName:"button",attributes:{part:"dot",type:"button","data-state":"set","data-clear":"${$map.item.key}",title:"${$map.item.clearTitle}","aria-label":"${$map.item.clearTitle}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/clearSection"},value:[{$ref:"$map/item/key"}]}]}}}},{tagName:"div",attributes:{part:"rows","data-layout":"${$map.item.layout}"},children:[{$prototype:"Array",items:{$ref:"$map/item/rows"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"row","data-prop":"${$map.item.prop}","data-kind":"${$map.item.kind}","data-child":"${$map.item.child ? 'true' : null}","data-warning":"${$map.item.warning ? 'true' : null}","data-span":"${$map.item.span ? '2' : null}"},children:[{tagName:"div",attributes:{part:"row-label",hidden:"${$map.item.hasLabel ? null : ''}"},children:[{tagName:"span",attributes:{part:"chip-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/chip"},cases:{button:{tagName:"button",attributes:{part:"chip",type:"button","data-state":"${$map.item.chipState}",title:"${$map.item.chipTitle}","aria-label":"${$map.item.chipTitle}"},textContent:"${$map.item.chipText}",onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/chipClick"},value:[{$ref:"$map/item/key"}]}]}},text:{tagName:"span",attributes:{part:"chip","data-state":"${$map.item.chipState}",title:"${$map.item.chipTitle}"},textContent:"${$map.item.chipText}"}}},{tagName:"span",attributes:{part:"label",title:"${$map.item.prop}"},textContent:"${$map.item.label}"},{tagName:"span",attributes:{part:"source-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasSource"},cases:{true:{tagName:"jx-action-button",attributes:{part:"source","data-source":"${$map.item.sourceState}"},$props:{size:"sm",quiet:!0,haspopup:"menu",label:{$ref:"$map/item/sourceHint"},hint:{$ref:"$map/item/sourceHint"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/pickSource"},value:[{$ref:"$map/item/key"},{$ref:"event#/currentTarget"}]}]},children:[{tagName:"span",textContent:"${$map.item.sourceLabel}"}]}}}]},{tagName:"div",attributes:{part:"control",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/widget"},cases:{text:{tagName:"jx-textfield",attributes:{part:"text"},$props:{size:"sm",label:{$ref:"$map/item/label"},value:{$ref:"$map/item/value"},placeholder:{$ref:"$map/item/placeholder"},mono:{$ref:"$map/item/mono"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editText"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/commitText"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},number:{tagName:"jx-number-field",attributes:{part:"number"},$props:{size:"sm",label:{$ref:"$map/item/label"},value:{$ref:"$map/item/value"},placeholder:{$ref:"$map/item/placeholder"},min:{$ref:"$map/item/min"},max:{$ref:"$map/item/max"},step:{$ref:"$map/item/step"},stepper:!1},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/commitText"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},keywords:{$description:"A keyword row, and the font row: one `jx-combobox` with `allows-custom-value` over the values worth offering (ui.md §5.3). The field IS the value and the rows under it are suggestions, which is the whole of what an enum means on a style property — `text-transform: full-width` is a value whether or not the catalogue lists it, so the list never refuses. A typography row's options carry the kit's drawing channels, so `700` is set in 700 and `Italic` leans, each in the element's own face; the font row's carry `face`, so every font is its own specimen, which is what a menu row could never be (ui.md §5.1: a picker you choose by LOOKING is not a menu). Both handlers read the ELEMENT's value, because a pick announces from the element while typing lets the control's own event bubble, and `currentTarget` is the one node both name. What a font pick WRITES is the adapter's, not the row's: the field holds a token's name, and the commit points the property at it, minting the token first when the name is a preset's.",tagName:"jx-combobox",attributes:{part:"text"},$props:{size:"sm",label:{$ref:"$map/item/label"},value:{$ref:"$map/item/value"},placeholder:{$ref:"$map/item/placeholder"},allowsCustomValue:!0,options:{$ref:"$map/item/options"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editText"},value:[{$ref:"$map/item/key"},{$ref:"event#/currentTarget/value"}]}]},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/commitText"},value:[{$ref:"$map/item/key"},{$ref:"event#/currentTarget/value"}]}]}},group:{$description:"The dual-mode control: a number beside its unit. Type what you mean, or take a unit from the list — and the list is the kit MENU rather than a second popup of this document's own (studio-ui-guidelines.md §12.5), because every row of it is a verb: a unit re-attaches to the number the field holds. A keyword row, whose list commits a value, is the `keywords` case instead — and so is the font row now, because a font is chosen by looking and a menu row cannot draw itself in its own face.",tagName:"div",attributes:{part:"group"},children:[{tagName:"jx-textfield",attributes:{part:"text"},$props:{size:"sm",label:{$ref:"$map/item/label"},value:{$ref:"$map/item/value"},placeholder:{$ref:"$map/item/placeholder"},mono:{$ref:"$map/item/mono"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editText"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/commitText"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},{tagName:"span",attributes:{part:"group-open-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasChoices"},cases:{true:{tagName:"jx-action-button",attributes:{part:"group-open"},$props:{size:"sm",haspopup:"menu",label:{$ref:"$map/item/choicesHint"},hint:{$ref:"$map/item/choicesHint"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/pickChoice"},value:[{$ref:"$map/item/key"},{$ref:"event#/currentTarget"}]}]},children:[{tagName:"span",textContent:"${$map.item.choicesLabel}"}]}}}]},buttons:{tagName:"div",attributes:{part:"buttons"},children:[{tagName:"jx-action-group",$props:{selects:"single",compact:!0,label:{$ref:"$map/item/label"}},children:[{$prototype:"Array",items:{$ref:"$map/item/buttons"},key:{$ref:"$map/item/value"},map:{tagName:"jx-action-button",attributes:{part:"button","data-value":"${$map.item.value}"},$props:{size:"sm",icon:{$ref:"$map/item/icon"},label:{$ref:"$map/item/title"},hint:{$ref:"$map/item/title"},checked:{$ref:"$map/item/checked"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/pressButton"},value:[{$ref:"$map/item/row"},{$ref:"$map/item/value"}]}]},children:[{$description:"The abbreviation, for a value with no glyph, and HIDDEN rather than empty on a button that has one. The kit's `[part=\"label\"]` is `display: contents`, so an empty span is still a flex item in the control, and the control's 4px gap sits between the glyph and nothing: every icon button in the tab drew 26px wide with its glyph pushed 2px off centre, instead of 22px and centred. Hidden, it takes no box, and the button's name and tooltip are the value either way.",tagName:"span",attributes:{hidden:"${$map.item.text ? null : ''}"},textContent:"${$map.item.text}"}]}}]},{tagName:"span",attributes:{part:"overflow-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasChoices"},cases:{true:{tagName:"jx-action-button",attributes:{part:"group-open"},$props:{size:"sm",icon:"dots-three",haspopup:"menu",selected:{$ref:"$map/item/overflowSelected"},label:{$ref:"$map/item/choicesHint"},hint:{$ref:"$map/item/choicesHint"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/pickChoice"},value:[{$ref:"$map/item/key"},{$ref:"event#/currentTarget"}]}]}}}}]},color:{$description:"The colour row, and the whole of it: `ui.md` §5.6 landed, so the swatch, the value, the saturation square, the hue track and the project's own palette are ONE element rather than an announced `[part=\"control-host\"]` a lit island filled. The listener is on the WRAPPER and not on the field, and that is the field's own contract rather than a preference. `jx-color-field` stops its five inner controls' native events at its root and re-says the platform's two names FROM the host, so an ancestor hears exactly one `input` and one `change` per gesture with `e.target` being the field — while a listener on the field itself hears BOTH, including the raw `change` of a text box holding a half-typed word the field has just refused. Bound there, `not a colour` would have been committed as a colour.",tagName:"div",attributes:{part:"color",role:"none"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editText"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/commitText"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]},children:[{tagName:"jx-color-field",attributes:{part:"color-field"},$props:{size:"sm",label:{$ref:"$map/item/label"},value:{$ref:"$map/item/value"},resolved:{$ref:"$map/item/resolved"},alpha:!0},children:[{tagName:"span",attributes:{part:"palette-slot",slot:"tokens",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasTokens"},cases:{true:{$description:"The palette's `change` is caught HERE, on the group, because it never gets out: the field routes it as its `palette` channel, stops it, and then declines it — a swatch that stands for `var(--color-accent)` is not a string the field can parse as a colour, which is exactly why the reference survives the click. A row that let the field answer instead would have committed the literal behind the token and quietly opted one declaration out of the palette for ever.",tagName:"jx-swatch-group",attributes:{part:"palette"},$props:{label:"Colour tokens",value:{$ref:"$map/item/value"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/commitText"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]},children:[{$prototype:"Array",items:{$ref:"$map/item/tokens"},key:{$ref:"$map/item/value"},map:{tagName:"jx-swatch",attributes:{part:"token","data-token":"${$map.item.value}"},$props:{size:"sm",color:{$ref:"$map/item/color"},value:{$ref:"$map/item/value"},label:{$ref:"$map/item/label"}}}}]}}}]}]},shorthand:{tagName:"div",attributes:{part:"shorthand"},children:[{tagName:"jx-textfield",attributes:{part:"text"},$props:{size:"sm",label:{$ref:"$map/item/label"},value:{$ref:"$map/item/value"},placeholder:{$ref:"$map/item/placeholder"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editText"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/commitText"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},{tagName:"jx-action-button",attributes:{part:"expand"},$props:{size:"sm",quiet:!0,icon:{$ref:"$map/item/expandIcon"},expanded:{$ref:"$map/item/expanded"},label:{$ref:"$map/item/expandLabel"},hint:{$ref:"$map/item/expandLabel"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/toggleShorthand"},value:[{$ref:"$map/item/key"}]}]}}]},kv:{tagName:"div",attributes:{part:"kv"},children:[{tagName:"jx-textfield",attributes:{part:"kv-key"},$props:{size:"sm",mono:!0,label:"Property name",value:{$ref:"$map/item/name"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/renameCustom"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},{tagName:"jx-textfield",attributes:{part:"kv-value"},$props:{size:"sm",label:"Value",value:{$ref:"$map/item/value"},placeholder:{$ref:"$map/item/placeholder"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editText"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},{tagName:"jx-action-button",attributes:{part:"kv-remove"},$props:{size:"sm",quiet:!0,icon:"x",label:{$ref:"$map/item/removeLabel"},hint:{$ref:"$map/item/removeLabel"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/chipClick"},value:[{$ref:"$map/item/key"}]}]}}]},kvadd:{tagName:"jx-textfield",attributes:{part:"kv-add"},$props:{size:"sm",mono:!0,label:"Add a CSS property",placeholder:"Property name…"},onkeydown:{$prototype:"Function",body:[{if:{operator:"===",target:{$ref:"event#/key"},value:"Enter"},then:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/addCustom"},value:[{$ref:"$map/item/key"},{$ref:"event#/target"}]}]}]}},nested:{tagName:"div",attributes:{part:"nested"},children:[{tagName:"button",attributes:{part:"nested-open",type:"button",title:"${$map.item.openTitle}"},textContent:"${$map.item.name}",onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openNested"},value:[{$ref:"$map/item/key"}]}]}},{tagName:"jx-action-button",attributes:{part:"nested-remove"},$props:{size:"sm",quiet:!0,icon:"trash",label:{$ref:"$map/item/removeLabel"},hint:{$ref:"$map/item/removeLabel"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/chipClick"},value:[{$ref:"$map/item/key"}]}]}}]},nestedadd:{tagName:"button",attributes:{part:"nested-add",type:"button"},textContent:"+ Add",onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/addNested"},value:[]}]}}}}]}}]}]}}]}]}}}]};T("style-panel",pt);function mn(e){let t=typeof e==="string"?void 0:e.attributes?.part;return typeof t==="string"?t:""}function ut(e,t){e.view=t.view,e.emptyMessage=t.emptyMessage,e.hasEmptyAction=t.hasEmptyAction,e.emptyActionLabel=t.emptyActionLabel,e.filter=t.filter,e.sections=t.sections}function mt(e,t,n,o){let r=v({...n,emptyActionLabel:"",emptyMessage:"",filter:"",hasEmptyAction:!1,sections:[],view:"empty"});ut(r,t),e.replaceChildren();let a=null,i=!1;return R("style-panel",r,e,{onNodeCreated:(s,l,d)=>{if(s instanceof HTMLElement&&mn(d)==="target-host")o.target(s)}}).then((s)=>{if(i){s.dispose();return}a=s}),{connected:()=>!i&&(a===null?e.childNodes.length===0:a.root.parentNode===e),dispose(){i=!0,o.target(null),a?.dispose(),a=null},update:(s)=>ut(r,s)}}var gn={state:"default"};function Se(e){return/^[a-z]/.test(e)}function fn(e,t){let n=e;for(let o of t.split(" "))if(n=va(n,o),!n)return{};return n}function ie(e,t,n){let o=n?va(e,`@${n}`)??{}:e;if(t)return Se(t)?fn(o,t):va(o,t)??{};let r={};for(let[a,i]of Object.entries(o))if(typeof i!=="object")r[a]=i;return r}function xt(e,t,n){if(t&&Se(t)){let o=t.split(" ");return n?(r,a,i)=>jL(r,e,n,o,a,i):(r,a,i)=>bv(r,e,o,a,i)}if(t)return n?(o,r,a)=>FL(o,e,n,t,r,a):(o,r,a)=>gv(o,e,t,r,a);return n?(o,r,a)=>PL(o,e,n,r,a):(o,r,a)=>kc(o,e,r,a)}function hn(e,t,n,o){let r=new Set;if(t.length<2)return r;let a=t.map((s)=>{let l=K(e.doc.document,s);return ie(l?.style??{},n,o)}),i=new Set;for(let s of a)for(let l of Object.keys(s))i.add(l);for(let s of i)if(mp(a.map((l)=>l[s]??null)).mixed)r.add(s);return r}var _=v({showAffected:!1,usageRevision:0});function O(e,t){ne()?.run(e,t)}function $n(e){return e&&Se(e)?e.split(" ")[0]??null:null}function yn(e){return/(?:^|\/)project\.json$/.test(e)}function bn(e,t){let n=e.documentPath??"",o=yn(n);if(!t)return o?gt("every page in this project",null):{kind:"element",label:"this element"};let r=o||/^\.?\/?layouts\//.test(n),a=`all <${t}> in this ${r?"project":"document"}`;return r?gt(a,t):{kind:"document",label:a}}function gt(e,t){if(t===null)return{affected:"how many pages that is, is unknown",kind:"project",label:e};let n={tagName:t};_.usageRevision;let o=yc(n);if(o===null)js(n).then(()=>{if(yc(n)!==null)_.usageRevision+=1});return{kind:"project",label:e,affected:vn(o),affectedFiles:o?.status==="ready"?nm(o.result):[],showAffected:_.showAffected,onToggleAffected:()=>{_.showAffected=!_.showAffected}}}function vn(e){if(e===null||e.status==="pending")return"counting the elements it affects…";if(e.status!=="ready")return"how many elements that is, is unknown";let{files:t,refsTotal:n}=e.result;if(n===0)return"no element in the project uses it yet";return`${n} element${n===1?"":"s"} in ${t.length} file${t.length===1?"":"s"}`}function xn(e,t,n,o){let r=[{key:"element",label:e,title:"What these edits are pointed at — click to find it in the Outline",onActivate:()=>O("view.setActivity",{tab:"layers"})},{key:"media",label:n&&t?`@${bi(t)}`:"Base",title:"The breakpoint these edits land in. Choose it on the pane's Context control; click to manage breakpoints.",onActivate:()=>O("settings.open",{section:"contexts"})}];if(o)r.push({key:"scheme",label:`${bi(o)} variant`,title:"Edits land in this colour-scheme variant. Set the pane's Context control back to Auto to edit base styles; click to manage schemes.",onActivate:()=>O("settings.open",{section:"contexts"})});return r}function wn(e){if(typeof e!=="string")return null;return/\$\{\s*(?:state\.)?([A-Za-z_$][\w$]*)/.exec(e)?.[1]??null}function kn(e){return typeof e==="string"&&e.includes("${")}function se(e,t){if(t.mixed?.props.has(e))return{state:"mixed",donor:String(t.mixed.count),onClick:()=>t.clear(e)};let n=t.active[e];if(n!==void 0&&t.own[e]===void 0)return{state:"inherited",donor:"site tokens",title:`Inherited from the project's site tokens — ${e} is not set on this document`};if(n!==void 0){if(kn(n)){let r=wn(n);return{state:"bound",...r?{donor:r}:{},...r&&t.signals.includes(r)?{onClick:()=>{O("view.setActivity",{tab:"data"}),O("data.expandRow",{name:r})}}:{}}}return{state:"set",onClick:()=>t.clear(e)}}let o=t.inherited[e];if(o)return{state:"inherited",donor:o.donor,...o.jump?{onClick:o.jump}:{}};return{state:"default"}}function wt(e,t,n){let o=[e,...B(e).map((a)=>a.name)],{mixed:r}=t;if(r&&o.some((a)=>r.props.has(a)))return{state:"mixed",donor:String(r.count),...n?{onClick:n}:{}};for(let a of o){let i=se(a,t);if(i.state==="default")continue;return i.state==="set"&&n?{...i,onClick:n}:i}return gn}function Sn(e,t,n,o,r){let{mixed:a}=o;if(a&&(a.props.has(e)||n&&a.props.has(t)))return{state:"mixed",donor:String(a.count),onClick:r};let i=se(e,o);if(i.state==="set"||i.state==="default"&&n)return{state:"set",onClick:r};return i}function Cn(e,t){return e.map(({prop:n,entry:o})=>Ad(o)==="shorthand"?wt(n,t).state:se(n,t).state)}var F=new Map,Ce=new Map,Te=null,ke=new Map;function I(e){return F.get(e)}function Tn(e){return/^-?\d*\.?\d*$/.test(e)}function jn(e,t,n){let o=e.$buttonValues||e.enum||[],r=e.$icons||{},{$buttonValues:a,enum:i}=e,s=a&&i&&i.length>a.length?i.filter((d)=>!a.includes(d)):[];return{buttons:o.map((d)=>{let x=r[d]??"";return{icon:x,row:t,checked:d===n?"true":"false",text:x===""?d:"",title:d,value:d}}),extra:s}}function kt(e){return e.includes("-")?_v(e):e.replace(/^./,(t)=>t.toUpperCase())}function En(e,t){return e.map((n)=>({checked:n===t,label:kt(n),value:n}))}function Ln(e,t,n){let o=ct[t];return e.map((r)=>{let a={label:kt(r),value:r};if(o)a[o]=r,a.face=n;return a})}function An(e){let t=e.activeStyle.fontFamily??e.inheritedStyle.fontFamily;if(typeof t!=="string"&&typeof t!=="number")return"";let n=ad(qo(e.tab.doc.document?.style),t);return n===void 0?"":String(n)}function St(e){return Array.isArray(e.presets)?e.presets:[]}function Rn(e){let t=dt(),n=qo(u.value?.doc.document?.style),o=t.map((r)=>({description:r.name,face:String(ad(n,r.value)??r.value),label:Cv(r.name,"--font-"),value:r.name}));for(let r of St(e)){let a=xm(r.title,"--font-");if(!t.some((i)=>i.name===a))o.push({face:r.value,label:r.title,value:a})}return o}function ft(e,t,n,o){let r=t.trim();if(!r.startsWith("--")){o(t);return}if(n&&qo(u.value?.doc.document?.style)[r]===void 0){let a=St(e).find((i)=>xm(i.title,"--font-")===r);if(a)q(u.value,(i)=>kc(i,[],r,a.value))}o(Yg(r))}function J(e,t,n){return{buttons:[],child:!1,chip:"none",chipState:"default",chipText:"",chipTitle:"",choicesHint:"",choicesLabel:"",expandIcon:"caret-right",expandLabel:"",expanded:!1,hasChoices:!1,hasLabel:!1,hasSource:!1,hasTokens:!1,key:e,kind:n,label:"",max:"",min:"",mono:!1,name:"",openTitle:"",options:[],overflowSelected:!1,placeholder:"",prop:t,removeLabel:"",resolved:"",sourceHint:"",sourceLabel:"",sourceState:"literal",span:!1,step:"",tokens:[],value:"",warning:!1,widget:"text"}}function Ct(e,t,n){if(n.state==="default"){e.chip="none";return}if(e.chipState=n.state,e.chipText=rw(n),e.chipTitle=Yh(e.prop,n),n.onClick)e.chip="button",t.chip=n.onClick;else e.chip="text"}function Mn(){return hc("styleProperty").filter((e)=>e!=="ref")}function Tt(e,t,n,o,r){let a=`${e.coord}|${n}${r.child?"|child":""}`,i=J(a,n,"field"),s={},l=Ad(t),d=xe().get(n)??"",x=r.placeholder||d,g=(c)=>r.onCommit(c===""?void 0:c);if(i.label=Nx(t,n),i.hasLabel=!0,i.child=r.child===!0,i.warning=r.warning===!0,i.span=r.span===!0,i.value=o,i.placeholder=x,Ct(i,s,r.provenance),!r.child){let c=Mn(),p=`${e.coord}|${n}`,w=hd(p,o===""?void 0:o);if(i.hasSource=!0,i.sourceState=w,i.sourceLabel=yo[w],i.sourceHint=`Value source: ${yo[w]} — click to change`,s.source={caps:c,fieldKey:p,mode:w,onChange:(f)=>r.onCommit(f===void 0||f===""?void 0:String(f)),stateDefs:e.templateSignals,value:o===""?void 0:o},w==="template")return i.widget="text",i.mono=!0,i.placeholder="${state.…}",s.commit=(f)=>r.onCommit(f===""?void 0:f),{actions:s,row:i}}switch(l){case"color":{i.widget="color",i.tokens=aw(),i.hasTokens=i.tokens.length>0,i.resolved=lw(o),s.edit=g,s.commit=g,s.debounceId=`color:${a}`;break}case"button-group":{let{buttons:c,extra:p}=jn(t,a,o);i.widget="buttons",i.buttons=c,i.hasChoices=p.length>0,i.overflowSelected=p.includes(o),i.choicesLabel="",i.choicesHint=`More ${i.label.toLowerCase()} values`,s.choices=En(p,o),s.choose=g;break}case"number-unit":{let c=t.$units??[],p=t.$keywords??[],w=oe.exec(o),f=!w&&o!==""&&p.includes(o),j=f?c[0]??"":w?.[2]??c[0]??"";i.widget="group",i.value=Pn(o,w,f),i.placeholder=In(x),i.hasChoices=c.length>0||p.length>0,i.choicesLabel=j||c[0]||"",i.choicesHint=`Unit for ${i.label.toLowerCase()}`,s.choices=[...c.map((N)=>({checked:N===j,label:N,value:N})),...p.map((N,L)=>({checked:N===o,label:N,value:N,...L===0&&c.length>0?{divider:!0}:{}}))],s.choose=(N)=>{if(p.includes(N)){r.onCommit(N);return}let L=oe.exec(o)?.[1];if(L)r.onCommit(L+N)};{let N=(L)=>{let b=L.trim();if(b===""){r.onCommit("");return}r.onCommit(Tn(b)&&c.length>0?b+j:b)};s.edit=N,s.commit=N,s.debounceId=`nui:${a}`}break}case"number":{i.widget="number",i.min=t.minimum===void 0?"":String(t.minimum),i.max=t.maximum===void 0?"":String(t.maximum),i.step=typeof t.maximum==="number"&&t.maximum<=1?"0.1":"",s.commit=g;break}case"select":case"combobox":{let c=Array.isArray(t.enum)?t.enum:Array.isArray(t.examples)?t.examples:[];if(i.widget="keywords",n==="fontFamily")i.value=Cu(o)??o,i.options=Rn(t),s.edit=(p)=>ft(t,p,!1,g),s.commit=(p)=>ft(t,p,!0,g);else i.options=Ln(c,n,An(e)),s.edit=g,s.commit=g;s.debounceId=`kw:${a}`;break}default:{i.widget="text",s.edit=g,s.commit=g,s.debounceId=`text:${a}`;break}}return{actions:s,row:i}}function Pn(e,t,n){if(n)return e;if(t)return t[1]??"";if(e==="")return"";let o=Number.parseFloat(e);return Number.isNaN(o)?e:String(o)}function In(e){return oe.exec(e)?.[1]??e??"0"}function Fn(e,t,n){let o=B(n),r=e.activeStyle,a=r[n],i=o.some((m)=>r[m.name]!==void 0),s=e.tab.session.ui.styleShorthands[n]??i,l=a!==void 0||i,d=e.inheritedStyle,x=(m)=>q(u.value,(h)=>{for(let A of o)e.mutate(h,A.name);e.mutate(h,n,m)}),g=()=>q(u.value,(m)=>{e.mutate(m,n);for(let h of o)e.mutate(m,h.name)}),c=`${e.coord}|${n}`,p=J(c,n,"shorthand"),w={};p.widget="shorthand",p.hasLabel=!0,p.label=Nx(t,n),p.value=typeof a==="string"?a:"",p.placeholder=On(a,o,r,d,n),p.expanded=s,p.expandIcon=s?"caret-down":"caret-right",p.expandLabel=`${s?"Collapse":"Expand"} ${p.label.toLowerCase()}`,Ct(p,w,wt(n,e.provCtx,l?g:void 0)),w.edit=(m)=>x(m||void 0),w.commit=(m)=>x(m||void 0),w.debounceId=`short:${c}`,w.toggle=()=>{let m=u.value;if(m)m.session.ui.styleShorthands={...m.session.ui.styleShorthands,[n]:!s}};let f=[{actions:w,row:p}];if(!s)return f;let j=t.$shorthandType==="border-side",N=typeof a==="string"&&a?j?st(a):at(a,o.length):null,L=j?lt:it,b=j?"":"0",k=(m,h)=>x(L(o.map((A,E)=>E===m?h:r[A.name]??(N?N[E]:b))));for(let[m,{name:h,entry:A}]of o.entries()){let E=r[h]??(N?N[m]:""),G=E!==void 0&&E!=="";f.push(Tt(e,A,h,String(E??""),{child:!0,onCommit:(V)=>k(m,V||b),placeholder:!E&&d[h]!==void 0?String(d[h]):"",provenance:Sn(h,n,G,e.provCtx,()=>k(m,b))}))}return f}function On(e,t,n,o,r){if(e)return"";if(t.some((a)=>n[a.name]!==void 0))return t.map((a)=>n[a.name]||"0").join(" ");if(o[r]!==void 0)return String(o[r]);if(t.some((a)=>o[a.name]!==void 0))return t.map((a)=>o[a.name]||"0").join(" ");return""}function re(e,t){return{emptyActionLabel:t?El().label:"",emptyMessage:e,filter:"",hasEmptyAction:t,sections:[],view:"empty"}}function ht(e){F=new Map;let t=u.value;if(!t)return re("Open a page to style what you click.",!0);if(e()==="stylebook"&&y.stylebook.selection){let r=t.doc.document;if(!r)return re("Open a page to style what you click.",!0);return $t(t,r,{effectiveStyle:qo(r.style),stylebookSelector:y.stylebook.selection})}let n=Le(t.session.selection);if(!n)return re(Zh("style it"),!1);let o=K(t.doc.document,n);if(!o)return re(Mf(),!1);return $t(t,o,{})}function $t(e,t,n){let{effectiveStyle:o,stylebookSelector:r=null}=n,a=Le(e.session.selection),i=t.style||{},s=o??i,l=Object.entries(e.doc.document.state||{}).filter(([,C])=>!C?.$handler&&C?.$prototype!=="Function").map(([C])=>C),{sizeBreakpoints:d}=hr(Di(e.doc.document.$media)),x=d.map((C)=>C.name),g=e.session.ui.activeMedia||null,{activeSelector:c}=e.session.ui,p=e.session.ui.previewColorScheme,w=g===null&&(p==="light"||p==="dark")?Object.entries(Di(e.doc.document.$media)??{}).find(([,C])=>Ou(String(C))===p)?.[0]??null:null,f=g&&x.length>0?g:w,j=f?s[`@${f}`]||{}:s,N=new Set(Object.keys(j).filter((C)=>Hx(C))),L=[...new Set([...ze(t),...N,...c?[c]:[]])],b=$n(r),k=b??(typeof t.tagName==="string"?t.tagName:"element");Ze({segments:xn(k,g,x.length>0,w),selector:{value:c,options:L,declared:N,onSelect:(C)=>{let M=u.value;if(!M)return;if(M.session.ui.activeSelector=C,C?.startsWith(":popover-open"))O("canvas.setPopoverOpen",{open:!0});if((C?.startsWith("[open]")||C?.startsWith(":modal"))&&ax(M)!==null)O("canvas.setDialogOpen",{open:!0})},onAddCustom:()=>{Nn("Add Selector",{confirmLabel:"Use",message:"A state or nested rule to edit under this element.",placeholder:":hover, .child, &.active, [attr]",validate:(C)=>Hx(C.trim())?"":'A selector must start with ":", ".", "&" or "[".'}).then((C)=>{if(C&&u.value)u.value.session.ui.activeSelector=C.trim()})}},scope:bn(e,b)});let m=ie(s,c,f),h=s===i?m:ie(i,c,f),A=e.session.selection.length>0?e.session.selection:[a],E=(C,M,D)=>{for(let Ft of A)xt(Ft,c,f)(C,M,D)},G=(C,M)=>q(u.value,(D)=>E(D,C,M)),V={};if(w){let C=c?va(s,c)??{}:s;for(let[M,D]of Object.entries(C))if(typeof D!=="object")V[M]={value:D??"",donor:"Base",jump:()=>Gr(u.value,"previewColorScheme","auto")}}else for(let[C,M]of Object.entries(_e(s,x,g,c)))V[C]={value:M.value,donor:M.donor===null?"Base":bi(M.donor),jump:()=>Gr(u.value,"activeMedia",M.donor)};let Ee={};for(let[C,M]of Object.entries(V))Ee[C]=M.value;let Re=hn(e,A,c,f),Mt={own:h,active:m,inherited:V,signals:l,clear:(C)=>G(C),...Re.size>0?{mixed:{count:A.length,props:Re}}:{}},Me=rt({style:m},e.session.ui.styleSections);if(JSON.stringify(Me)!==JSON.stringify(e.session.ui.styleSections))e.session.ui.styleSections=Me;let Pt=(e.session.ui.styleFilter||"").toLowerCase(),pe={activeSelector:c,activeStyle:m,commit:G,coord:`style|${a.join("/")}|${f??""}|${c??""}`,editMedia:f,filter:Pt,inheritedStyle:Ee,mutate:E,provCtx:Mt,tab:e,targets:A,templateSignals:l},It=[...Vn(pe),...Hn(pe),...Bn(pe)];return{emptyActionLabel:"",emptyMessage:"",filter:e.session.ui.styleFilter||"",hasEmptyAction:!1,sections:It,view:"editor"}}function yt(e){return F.set(e.row.key,e.actions),e.row}function Vn(e){let{activeStyle:t,tab:n}=e,o=e.filter.length>0,r={};for(let i of P.$sections)r[i.key]=[];for(let[i,s]of Object.entries(P.$defs)){if(typeof s.$shorthand==="string")continue;r[s.$section||"other"].push({entry:s,prop:i})}for(let i of P.$sections)r[i.key].sort((s,l)=>s.entry.$order-l.entry.$order);let a=[];for(let i of P.$sections){if(i.key==="other")continue;let s=r[i.key],l=s.filter(({prop:p,entry:w})=>{if(t[p]!==void 0)return!0;return Ad(w)==="shorthand"&&B(p).some((f)=>t[f.name]!==void 0)}),d=()=>{q(u.value,(p)=>{for(let{prop:w,entry:f}of l){if(t[w]!==void 0)e.mutate(p,w);if(Ad(f)==="shorthand")for(let j of B(w))e.mutate(p,j.name)}})},x=sw(Cn(s,e.provCtx)),g=o?!0:n.session.ui.styleSections[i.key]??!1,c=Ne(i.key,i.label,g,x,{canClear:l.length>0,clearTitle:`Clear all ${i.label.toLowerCase()} properties`,layout:i.$layout==="grid"?"grid":"",onClear:d});if(g)c.rows=Dn(e,s,i.$layout==="grid");if(o&&c.rows.length===0)continue;a.push(c)}return a}function Dn(e,t,n){let{activeStyle:o}=e,r=[];for(let{prop:a,entry:i}of t){let s=o[a],l=s!==void 0,d=tt(i,o),x=Ad(i);if(!l&&!d)continue;if(e.filter){let p=Nx(i,a).toLowerCase();if(!a.includes(e.filter)&&!p.includes(e.filter))continue}if(x==="shorthand"){let p=B(a);if(!(l||p.some((f)=>o[f.name]!==void 0))&&!d)continue;for(let f of Fn(e,i,a))r.push(yt(f));continue}let g=e.inheritedStyle[a],c=Tt(e,i,a,s??"",{onCommit:(p)=>e.commit(a,p||void 0),placeholder:!l&&g!==void 0?String(g):"",provenance:se(a,e.provCtx),span:n&&i.$span===2,warning:l&&!d});r.push(yt(c))}return r}function Ne(e,t,n,o,r){let a=[];if(o.inherited>0)a.push({state:"inherited"});if(o.bound>0)a.push({state:"bound"});if(o.mixed>0)a.push({state:"mixed"});let i=o.set>0&&r.canClear;if(i)Ce.set(e,r.onClear);return{canClear:i,clearTitle:r.clearTitle,hasMarks:a.length>0,key:e,label:t,layout:r.layout,marks:a,open:n,rows:[],tally:eE(o)}}function Hn(e){let t=[];for(let[i,s]of Object.entries(e.activeStyle))if(s!==null&&typeof s==="object"&&!Array.isArray(s)&&!i.startsWith("@"))t.push(i);if(t.length===0)return[];let n=e.tab.session.ui.styleSections.nested??!0,o=Ne("nested","Relative Styling",n,sw([]),{canClear:!1,clearTitle:"",layout:"",onClear:()=>{}});if(!n)return[o];for(let i of t){let s=`${e.coord}|nested|${i}`,l=J(s,i,"nested");l.widget="nested",l.name=i,l.openTitle=`Edit ${i} under this rule`,l.removeLabel=`Remove ${i}`,F.set(s,{chip:()=>e.commit(i),open:()=>{let d=e.activeSelector?`${e.activeSelector} ${i}`:i;wu(d,void 0,{panCanvas:!0})}}),o.rows.push(l)}let r=`${e.coord}|nested|+add`,a=J(r,"+add","nested-add");return a.widget="nestedadd",F.set(r,{}),o.rows.push(a),Te=()=>{Nn("Add Nested Selector",{confirmLabel:"Add",message:"Enter a selector to nest under the current rule.",placeholder:"th, :hover, .active",validate:(i)=>i.trim()?"":"Enter a selector."}).then((i)=>{if(i)e.commit(i,{})})},[o]}function Bn(e){let t=[];for(let l of Object.keys(e.activeStyle))if(!P.$defs[l]){let d=e.activeStyle[l];if(d!==null&&typeof d==="object")continue;t.push(l)}let n=e.tab.session.ui.styleSections.other??t.length>0,o=Ne("other","Custom",n,sw([]),{canClear:!1,clearTitle:"",layout:"",onClear:()=>{}});if(!n)return[o];let r=xe(),a=(l,d)=>{let x=K(l.doc.document,d);return ie(x?.style??{},e.activeSelector,e.editMedia)};for(let l of t){let d=`${e.coord}|custom|${l}`,x=J(d,l,"custom");x.widget="kv",x.name=l,x.value=String(e.activeStyle[l]),x.placeholder=r.get(l)??"",x.removeLabel=`Remove ${l}`,F.set(d,{chip:()=>e.commit(l),debounceId:`custom:${d}`,edit:(g)=>e.commit(l,g),rename:(g)=>{let c=g.trim();if(!c||c===l)return;q(u.value,(p)=>{for(let w of e.targets){let f=a(p,w)[l];if(f===void 0)continue;let j=xt(w,e.activeSelector,e.editMedia);j(p,l),j(p,c,String(f))}})}}),o.rows.push(x)}let i=`${e.coord}|custom|+add`,s=J(i,"+add","custom-add");return s.widget="kvadd",F.set(i,{add:(l)=>{let d=l.trim();if(!d)return!1;return e.commit(d,r.get(d)||""),!0}}),o.rows.push(s),[o]}var Jn="style-value",U=null;function jt(){let e=U;U=null,e?.close()}function bt(e,t,n,o){let r=e instanceof HTMLElement?e:null;if(jt(),!r||n.length===0)return;U=Nt({label:t,onClosed:(a)=>{if(U===a)U=null},opener:r,region:Jn,rows:n.map((a)=>({...a.checked===void 0?{}:{checked:a.checked?"true":"false"},destructive:!1,disabled:!1,dividerAbove:a.divider===!0,id:a.value,title:a.label})),run:(a)=>o(a)})}var Wn={addCustom:(e,t)=>{let n=I(e)?.add;if(!n||!(t instanceof HTMLInputElement))return;if(n(t.value))t.value=""},addNested:()=>Te?.(),chipClick:(e)=>I(e)?.chip?.(),clearSection:(e)=>Ce.get(e)?.(),commitText:(e,t)=>{let n=I(e);if(!n)return;if(n.debounceId)sI(n.debounceId);n.commit?.(t)},editText:(e,t)=>{let n=I(e);if(!n?.edit)return;if(n.debounceId){Tv(n.debounceId,400,n.edit)(t);return}n.edit(t)},openNested:(e)=>I(e)?.open?.(),pickChoice:(e,t)=>{let n=I(e);if(!n?.choose||!n.choices)return;let{choose:o}=n;bt(t,"Values",n.choices,(r)=>o(r))},pickSource:(e,t)=>{let n=I(e)?.source;if(!n)return;bt(t,"Value source",n.caps.map((o)=>({checked:o===n.mode,label:`${yo[o]} — ${Mw[o]}`,value:o})),(o)=>{let r=o;if(r===n.mode)return;n.onChange(pc(n.fieldKey,n.mode,r,Ae(n.value),pd(r,{stateDefs:n.stateDefs})))})},pressButton:(e,t)=>{I(e)?.choose?.(t===zn(e)?"":t)},renameCustom:(e,t)=>I(e)?.rename?.(t),runEmptyAction:()=>El().run(),setFilter:(e)=>{let t=u.value;if(t)t.session.ui.styleFilter=e},toggleSection:(e,t)=>{let n=u.value;if(!n)return;n.session.ui.styleSections={...n.session.ui.styleSections,[e]:t}},toggleShorthand:(e)=>I(e)?.toggle?.()};function zn(e){return ke.get(e)??""}var ae=null,Et=()=>"edit",we=Et;function vt(e){ke=new Map;for(let t of e.sections)for(let n of t.rows)if(n.widget==="buttons")ke.set(n.key,n.buttons.find((o)=>o.checked==="true")?.value??"")}function je(e,t){if(jt(),ae?.scope.stop(),ae?.handle.dispose(),ae=null,F=new Map,Ce=new Map,Te=null,!e)return;we=t?.getCanvasMode??Et;let n=ht(we);vt(n);let o=mt(e,n,Wn,{target:(a)=>Qe(a??void 0)}),r=ge();r.run(()=>{Q(()=>{let a=ht(we);vt(a),o.update(a)})}),ae={handle:o,host:e,scope:r}}function _n(){let e=(t)=>t.document.open&&t.selection.count>0;return[{category:"View",id:"style.openSelectorMenu",level:"selection",menus:["palette"],group:"8_style",requires:"the Style tab showing a selected element",when:e,run:()=>ve(),title:"Open Selector Menu"},{args:{additionalProperties:!1,properties:{selector:Un()},required:["selector"],type:"object"},category:"View",id:"style.setSelector",level:"selection",menus:["palette"],group:"8_style",requires:"an element selection",when:e,run:(t,n)=>{let{selector:o}=n;if(o===null){let i=u.value;if(i)i.session.ui.activeSelector=null;return}let r=ot("style.setSelector",n,"selector");if(!Hx(r))throw RangeError(`command "style.setSelector" argument "selector": "${r}" is not a nested `+'selector — it must start with ":", ".", "&" or "["');let a=u.value;if(!a)throw RangeError('command "style.setSelector" needs an open document');a.session.ui.activeSelector=r},title:"Set Style Selector"}]}function Un(){return{description:'A nested selector such as ":hover", ".child" or "[open]". null edits the base context.',oneOf:[{type:"string"},{type:"null"}]}}function zS(e){e.registerAll(_n())}var Lt={$schema:"https://jxsuite.com/schema/v1",$id:"StudioInspectorDock",$description:"The Inspector dock's own chrome, as a Jx document over the kit: a header naming what the dock is pointed at, a real `tablist` of four tabs, and four `tabpanel`s. It draws no tab BODY — all four are mounted documents of their own (`surfaces/properties-panel.json`, `surfaces/style-panel.json`, `surfaces/logic-panel.json`, and the assistant's) — so each panel carries one empty `[part=\"panel-body\"]` island the adapter announces through `onNodeCreated` (studio-ui-guidelines.md §9.4). The four panels are keyed on the tab id and the id list never changes, so a body host is created ONCE and lives as long as the dock: that is what the old module's hand-built permanent containers were for, and it is now a property of a keyed `$map` rather than a rule someone has to keep. `panels/right-panel.ts` keeps every decision — which tab is selected, per document or detached; what the target's name is; and which of the four seams a host is handed to.",tagName:"div",attributes:{part:"inspector-dock"},style:{$description:"`styles/inspector.css`'s dock rules, carried in. Three of them were `#right-panel > .panel-*` — a direct-child selector that only held while this module rendered flat into the shell cell — and they are `[part]` rules on the document's own children now, which is the same statement without depending on how deep the dock is mounted. The header's typography is `panels.css`'s `.panel-header*`, at the same values: `--spectrum-font-size-50` resolved only inside `<sp-theme>` and a document mounts outside it, so it is `--jx-text-sm` (11px) here.",display:"flex",flexDirection:"column",height:"100%",minHeight:"0",fontFamily:"var(--jx-font-sans)",color:"var(--fg)",'& [part="header"]':{display:"flex",flex:"0 0 auto",alignItems:"baseline",gap:"var(--jx-space-2)",padding:"6px var(--jx-space-3)",borderBottom:"1px solid var(--border)"},'& [part="header-title"]':{fontSize:"var(--jx-text-sm)",fontWeight:"700",letterSpacing:"0.06em",textTransform:"uppercase",color:"var(--fg)"},'& [part="header-target"]':{overflow:"hidden",fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)",textOverflow:"ellipsis",whiteSpace:"nowrap","::before":{$description:"The separator between the tab's name and its target, drawn rather than written into the string — `panels/right-panel.ts` states what the dock is pointed at and nothing about punctuation.",content:'"·"',marginRight:"var(--jx-space-2)"}},'& [part="tabs"]':{$description:"Four words in a 280px dock, allowed to compress rather than to become anonymous — which is why the tabs are not icons (§6). The kit tab's own 220px cap would let one tab push the last off the strip, so each takes an equal quarter.",flex:"0 0 auto",gap:"0",fontSize:"var(--jx-text-sm)"},'& [part="tab"]':{flex:"1 1 0",justifyContent:"center",minWidth:"0",maxWidth:"none",padding:"var(--jx-space-1) var(--jx-space-2)"},'& [part="panel"]':{$description:"`#right-panel > .panel-body { flex: 1; min-height: 0; overflow-y: auto }`. The kit's tab panel pads itself for a dialog; a dock's tab is the whole column and each body pads its own content.",flex:"1",minHeight:"0",padding:"0",overflowY:"auto"},'& [part="panel"][data-tab="assistant"]':{$description:"The chat owns its own scrolling, so its panel is a nested flex column that does not scroll.",display:"flex",flexDirection:"column",overflow:"hidden"},'& [part="panel"][hidden]':{display:"none"},'& [part="panel-body"]':{display:"flex",flex:"1",flexDirection:"column",minHeight:"0"}},children:[{tagName:"header",attributes:{part:"header"},children:[{tagName:"span",attributes:{part:"header-title"},textContent:"${state.title}"},{tagName:"span",attributes:{part:"header-target"},textContent:"${state.target}"}]},{tagName:"jx-tabs",attributes:{part:"tabs",selected:"${state.tab}"},$props:{label:"Inspector"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/selectTab"},value:[{$ref:"event#/detail"}]}]},children:[{$prototype:"Array",items:{$ref:"#/state/tabs"},key:{$ref:"$map/item/key"},map:{tagName:"jx-tab",attributes:{part:"tab",id:"${$map.item.tabId}","data-tab":"${$map.item.key}",value:"${$map.item.key}",label:"${$map.item.title}",panel:"${$map.item.panelId}"}}}]},{$prototype:"Array",items:{$ref:"#/state/tabs"},key:{$ref:"$map/item/key"},map:{tagName:"jx-tab-panel",attributes:{part:"panel",id:"${$map.item.panelId}","data-tab":"${$map.item.key}"},$props:{active:{$ref:"$map/item/active"},labelledby:{$ref:"$map/item/tabId"}},children:[{$description:"The island. Every one of the four tabs is a mounted document of its own, so this stays EMPTY for the life of the dock — `panels/right-panel.ts` is handed it through `onNodeCreated` and passes it to that tab's binder exactly once. It is a slotted child rather than the panel element itself because `jx-tab-panel` distributes its own slot, and a second owner of that child list would fight it.",tagName:"div",attributes:{part:"panel-body","data-jx-region":"${$map.item.region}"}}]}}]};T("inspector-dock",Lt);function Gn(e,t){e.title=t.title,e.target=t.target,e.tab=t.tab,e.tabs=t.tabs}function Kn(e){let t=typeof e==="string"?void 0:e.attributes?.part;return typeof t==="string"?t:""}function Yn(e){let n=e?.$map?.item;return n!==null&&typeof n==="object"?n:null}function At(e,t,n,o){let r=v({...t,selectTab:n.selectTab});e.textContent="",delete e._$litPart$;let a=null,i=!1;return R("inspector-dock",r,e,{onNodeCreated:(s,l,d,x)=>{if(!(s instanceof HTMLElement)||Kn(d)!=="panel-body")return;let g=Yn(x)?.key;if(typeof g==="string"&&g!=="")o.onBody(g,s)}}).then((s)=>{if(i){s.dispose();return}a=s}),{dispose(){i=!0,a?.dispose(),a=null},update:(s)=>{Gn(r,s)}}}var le=null,de=null,ce=v({tab:qb});function Xn(e,t,n){try{Qn(e,t,n)}catch(o){console.error(`right-panel: the ${t} tab could not take its body:`,o)}}function Qn(e,t,n){switch(t){case"assistant":{e.mountAssistant(n);break}case"events":{$e(n);break}case"properties":{q_(n,{navigateToComponent:e.navigateToComponent});break}case"style":{je(n,{getCanvasMode:e.getCanvasMode});break}default:break}}function Zn(e){return ew.map((t)=>({active:t.id===e,key:t.id,panelId:`inspector-panel-${t.id}`,region:pI(t.id),tabId:`inspector-tab-${t.id}`,title:t.title}))}function F_(e){de=At(rk,Rt(),{selectTab:(t)=>eo(t)},{onBody:(t,n)=>Xn(e,t,n)}),le=ge(),le.run(()=>{Q(()=>{let t=u.value;if(y.layoutSelection,t)t.doc.document,t.session.selection.map((n)=>n.join("/")).join("|"),t.session.ui.rightTab;ce.tab,Df()})})}function p$(){le?.stop(),le=null,de?.dispose(),de=null,$e(null),q_(null),je(null),ce.tab=qb}function Rt(){let e=sd();return{tab:e,tabs:Zn(e),target:to(),title:ew.find((t)=>t.id===e)?.title??e}}function Df(){de?.update(Rt())}function sd(){let e=u.value;if(!e)return ce.tab;let t=e.session.ui.rightTab;return yx(t)?t:qb}function Af(e){let t=u.value;if(t)t.session.ui.rightTab=e;else ce.tab=e;Df()}function eo(e){if(e!==""&&e!==sd()&&yx(e))Af(e)}function to(){let e=u.value;if(!e)return"no document";let t=y.layoutSelection;if(t)return`<${t.tagName||"element"}> in ${t.layoutFile||"the layout"}`;let n=e.session.selection,o=Le(n);if(o)return n.length>1?`${n.length} elements`:Zo(K(e.doc.document,o));let r=e.documentPath;return r?r.split("/").at(-1)??"document":"document"}
|
|
2
|
+
export{BS,zS,F_,p$,Df,sd,Af};
|
|
3
|
+
|
|
4
|
+
//# debugId=2532EB0C9C583D2164756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-tw7rre6s.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
class f extends Error{name="MaxOpsExceededError"}function d(n){return typeof n==="object"&&n!==null&&!Array.isArray(n)}function
|
|
2
|
-
export{
|
|
1
|
+
class f extends Error{name="MaxOpsExceededError"}function d(n){return typeof n==="object"&&n!==null&&!Array.isArray(n)}function ls(n,e){if(n===e)return!0;if(Array.isArray(n)&&Array.isArray(e))return n.length===e.length&&n.every((t,r)=>ls(t,e[r]));if(d(n)&&d(e)){let t=Object.keys(n),r=Object.keys(e);return t.length===r.length&&t.every((i)=>(i in e)&&ls(n[i],e[i]))}return!1}function A(n){let e=5381;for(let t=0;t<n.length;t++)e=Math.imul(e,33)+(n.codePointAt(t)??0);return e.toString(36)}function m(n){return typeof n==="string"?`s:${n}`:`n:${A(JSON.stringify(n))}`}function x(n){if(typeof n==="string")return"s";let e=n,{attributes:t,$props:r}=e,i=(d(t)?t.id:void 0)??(d(r)?r.key:void 0)??"";return`w:${String(e.tagName??"")}:${String(i)}`}function y(n,e,t=Number.POSITIVE_INFINITY){let r=n.length,i=e.length;if(r===0||i===0||r*i>t)return[];let c=Array.from({length:r+1},()=>Array.from({length:i+1},()=>0));for(let s=r-1;s>=0;s--)for(let l=i-1;l>=0;l--)c[s][l]=n[s]===e[l]?c[s+1][l+1]+1:Math.max(c[s+1][l],c[s][l+1]);let o=[],a=0,u=0;while(a<r&&u<i)if(n[a]===e[u])o.push([a,u]),a+=1,u+=1;else if(c[a+1][u]>=c[a][u+1])a+=1;else u+=1;return o}function r1(n,e,t={}){let r=t.maxCells??Number.POSITIVE_INFINITY,i=y(n.map((s)=>m(s)),e.map((s)=>m(s)),r),c=[],o=-1,a=-1,u=[];for(let[s,l]of i)u.push([o+1,s,a+1,l]),c.push({aIndex:s,bIndex:l,identical:!0}),o=s,a=l;u.push([o+1,n.length,a+1,e.length]);for(let[s,l,p,k]of u){let w=n.slice(s,l),O=e.slice(p,k);for(let[b,I]of y(w.map((h)=>x(h)),O.map((h)=>x(h)),r))c.push({aIndex:s+b,bIndex:p+I,identical:!1})}return c.toSorted((s,l)=>s.aIndex-l.aIndex)}class g{ops=[];maxOps;constructor(n){this.maxOps=n}result(){return this.ops}push(n){if(this.ops.length>=this.maxOps)throw new f;this.ops.push(n)}diffNode(n,e,t){for(let c of new Set([...Object.keys(e),...Object.keys(t)])){if(c==="children")continue;if(!(c in t))this.push({key:c,op:"set-key",path:n});else if(!ls(e[c],t[c]))this.push({key:c,op:"set-key",path:n,value:t[c]})}let r=e.children,i=t.children;if(Array.isArray(r)&&Array.isArray(i))this.diffChildren(n,r,i);else if(!ls(r,i))this.push({key:"children",op:"set-key",path:n,value:i})}diffChildren(n,e,t){let r=r1(e,t),i=new Set(r.map((o)=>o.aIndex)),c=new Map(r.map((o)=>[o.bIndex,o]));for(let o=e.length-1;o>=0;o--)if(!i.has(o))this.push({index:o,op:"remove-child",parentPath:n});for(let o=0;o<t.length;o++){let a=c.get(o);if(!a){this.push({index:o,node:t[o],op:"insert-child",parentPath:n});continue}if(a.identical)continue;let u=e[a.aIndex],s=t[o];if(d(u)&&d(s))this.diffNode([...n,"children",o],u,s);else if(!ls(u,s))this.push({index:o,node:s,op:"set-child",parentPath:n})}}}function f$(n,e,t={}){let r=new g(t.maxOps??500);try{r.diffNode([],n,e)}catch(i){if(i instanceof f)return null;throw i}return r.result()}
|
|
2
|
+
export{ls,r1,f$};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
5
|
-
//# sourceMappingURL=studio-
|
|
4
|
+
//# debugId=D8287AACA826507164756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-tzegmy4w.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{qt,wi,Zt,Dr,Us}from"./studio-1x8x26k3.js";import{ge,Q,v,k}from"./studio-fqq890ap.js";import{vi,q,Ol,ot,yi,li,Se,fa,oo,He,Dx,bp,Ml,xv,m,u,ci}from"./studio-cvbkkfqb.js";import{te}from"./studio-ery42sqr.js";import{ne}from"./studio-0k9mvpgj.js";import{Pw,Eu,fd,Tu}from"./studio-xy3tv3az.js";import{Zi,T,R}from"./studio-spf2skgc.js";import{fc,mb,Lu,Gf,FE,I1}from"./studio-65fhspdd.js";import{pr}from"./studio-zpnk016a.js";import{HE}from"./studio-skzanb0k.js";import{Tw,cb,sa,y1,CE}from"./studio-e6re3rk1.js";import{D}from"./studio-tp642n5g.js";import{Ae}from"./studio-evwgp1ym.js";import{me}from"./studio-0bbxhhce.js";var kw=["string","number","boolean","array","object","reference"],Sw=["","image","date","color"];function zf(e){if(e.$ref)return"reference";return e.type||"string"}function uc(e){if(e.type==="array"&&e.items?.format)return e.items.format;return e.format||""}function Ms(e,r){switch(e){case"number":return{type:"number"};case"boolean":return{type:"boolean"};case"array":return r?{items:{format:r,type:"string"},type:"array"}:{items:{type:"string"},type:"array"};case"object":return{properties:{},required:[],type:"object"};case"reference":return{$ref:"#/content/"};default:return r?{format:r,type:"string"}:{type:"string"}}}var U={$schema:"https://jxsuite.com/schema/v1",$id:"StudioSchemaBuilder",$description:'The `schema-builder` form control (specs/extensions.md §9.1): the visual editor for a JSON Schema object, drawn as one card per property. A descriptor names it with `"ui": { "<prop>": { "control": "schema-builder" } }`, and `ui/schema-form.ts` mounts it into the empty host its own document announces for that field. The adapter (`surfaces/schema-builder.ts`) hands in the fields already classified and every draft the reader is part-way through typing; `ui/form-controls.ts` decides what a field may be renamed to and what reaches the host\'s `onChange`. Nothing here reads a schema: a document that re-derived a field\'s type while drawing would be a second opinion about what one module already owns. **The card is `surfaces/settings-defs.json`\'s, part for part.** Data Shapes edits the project\'s `$defs` and this edits a content type\'s `schema`; they are the same object with the same six controls per row, so the row vocabulary — `card`, `field-row`, `field-label`, `field-name`, `field-type`, `field-format`, `field-required`, `field-delete`, `nested`, `nested-card`, `nested-add-name`/`-type`/`-button`, `ref-target`, `add-form` — is ONE vocabulary, and the row views it is drawn from are that surface\'s own types rather than a second declaration of them. What differs is only what encloses it: Data Shapes carries the two-column chrome that chooses WHICH shape is being edited, and this one is handed the object to edit.',tagName:"div",attributes:{part:"builder"},style:{$description:"What `.schema-builder`, `.schema-field-list`, `.schema-field-card`, `.schema-field-row`, `.schema-field-nested`, `.schema-field-name-input`, `.schema-nested-add`, `.schema-nested-add-name` and `.schema-add-field` said in `styles/overlays.css`, keyed on `part` and re-pointed at the studio token layer — the same translation `surfaces/settings-defs.json` carries, because it is the same card. Two values could not come with them. `.schema-field-card--nested` read `var(--spectrum-gray-300, #444)`, and the caption was an `sp-field-label` at whatever size Spectrum drew it; a document is mounted in the pane rather than inside `<sp-theme>`, so both would have taken their hard-coded fallback every time. The nested card takes the studio layer's `--border`, and the caption says what it is in the type ramp instead.",display:"block",'& [part="fields"]':{display:"flex",flexDirection:"column",gap:"4px",marginBottom:"12px"},'& [part="card"], & [part="nested-card"]':{border:"1px solid var(--border)",borderRadius:"var(--radius)",padding:"6px 10px"},'& [part="field-row"]':{display:"flex",alignItems:"center",gap:"8px"},'& [part="field-label"]':{$description:"The field's name in words: a caption on the row rather than a label for a control, since the raw key beside it is what the reader edits and what carries the accessible name.",flex:"none",minWidth:"84px",fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)",overflowWrap:"anywhere"},'& [part="field-name"]':{flex:"1",maxWidth:"140px"},'& [part="nested"]':{marginLeft:"16px",marginTop:"6px",paddingLeft:"8px",borderLeft:"2px solid var(--border)",display:"flex",flexDirection:"column",gap:"4px"},'& [part="ref-target"]':{display:"flex",marginTop:"6px",maxWidth:"220px"},'& [part="nested-add"]':{display:"flex",alignItems:"center",gap:"6px",padding:"4px 0"},'& [part="nested-add-name"]':{flex:"1",maxWidth:"120px"},'& [part="add-form"]':{display:"flex",alignItems:"center",gap:"8px",padding:"8px 0"}},children:[{tagName:"div",attributes:{part:"fields"},children:[{$prototype:"Array",items:{$ref:"#/state/fields"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"card","data-field":"${$map.item.key}"},children:[{tagName:"div",attributes:{part:"field-row"},children:[{tagName:"span",attributes:{part:"field-label"},textContent:"${$map.item.label}"},{tagName:"jx-textfield",attributes:{part:"field-name"},$props:{label:"Name for ${$map.item.label}",size:"sm",value:{$ref:"$map/item/name"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/renameField"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},{tagName:"jx-select",attributes:{part:"field-type"},$props:{label:"Type for ${$map.item.label}",size:"sm",options:{$ref:"#/state/typeOptions"},value:{$ref:"$map/item/type"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setType"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},{tagName:"div",attributes:{part:"format-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasFormat"},cases:{true:{tagName:"jx-select",attributes:{part:"field-format"},$props:{label:"Format for ${$map.item.label}",size:"sm",options:{$ref:"#/state/formatOptions"},value:{$ref:"$map/item/format"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setFormat"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}}}},{tagName:"jx-switch",$description:"Whether the object requires this field. The word on screen is the name: `Req` is slotted rather than passed as `label`, because the kit's switch wraps its control in the label the slot lands in, and a second name would be announced over the top of it. Which row it belongs to is the tooltip's job instead, which is what `hint` is.",attributes:{part:"field-required"},$props:{hint:"Require ${$map.item.label}",size:"sm",checked:{$ref:"$map/item/required"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setRequired"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/checked"}]}]},children:[{tagName:"span",textContent:"Req"}]},{tagName:"jx-action-button",attributes:{part:"field-delete"},$props:{label:"Delete ${$map.item.label}",hint:"Delete ${$map.item.label}",icon:"trash",quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/removeField"},value:[{$ref:"$map/item/key"}]}]}}]},{tagName:"div",attributes:{part:"extra-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/extra"},cases:{reference:{tagName:"div",attributes:{part:"ref-target"},children:[{tagName:"jx-select",attributes:{part:"ref-target-select"},$props:{label:"Target for ${$map.item.label}",size:"sm",options:{$ref:"#/state/targets"},value:{$ref:"$map/item/refTarget"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setTarget"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}}]},nested:{tagName:"div",attributes:{part:"nested"},children:[{$prototype:"Array",items:{$ref:"$map/item/children"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"nested-card","data-nested":"${$map.item.key}"},children:[{tagName:"div",attributes:{part:"field-row"},children:[{tagName:"jx-textfield",attributes:{part:"field-name"},$props:{label:"Name for ${$map.item.parent}.${$map.item.key}",size:"sm",value:{$ref:"$map/item/name"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/renameNested"},value:[{$ref:"$map/item/parent"},{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},{tagName:"jx-select",attributes:{part:"field-type"},$props:{label:"Type for ${$map.item.parent}.${$map.item.key}",size:"sm",options:{$ref:"#/state/typeOptions"},value:{$ref:"$map/item/type"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setNestedType"},value:[{$ref:"$map/item/parent"},{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},{tagName:"div",attributes:{part:"format-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasFormat"},cases:{true:{tagName:"jx-select",attributes:{part:"field-format"},$props:{label:"Format for ${$map.item.parent}.${$map.item.key}",size:"sm",options:{$ref:"#/state/formatOptions"},value:{$ref:"$map/item/format"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setNestedFormat"},value:[{$ref:"$map/item/parent"},{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}}}},{tagName:"jx-switch",attributes:{part:"field-required"},$props:{hint:"Require ${$map.item.parent}.${$map.item.key}",size:"sm",checked:{$ref:"$map/item/required"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setNestedRequired"},value:[{$ref:"$map/item/parent"},{$ref:"$map/item/key"},{$ref:"event#/target/checked"}]}]},children:[{tagName:"span",textContent:"Req"}]},{tagName:"jx-action-button",attributes:{part:"field-delete"},$props:{label:"Delete ${$map.item.parent}.${$map.item.key}",hint:"Delete ${$map.item.parent}.${$map.item.key}",icon:"trash",quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/removeNested"},value:[{$ref:"$map/item/parent"},{$ref:"$map/item/key"}]}]}}]}]}},{tagName:"div",attributes:{part:"nested-add"},children:[{tagName:"jx-textfield",attributes:{part:"nested-add-name"},$props:{label:"New field in ${$map.item.label}",placeholder:"field name",size:"sm",value:{$ref:"$map/item/draftName"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editDraftName"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{Enter:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/addNested"},value:[{$ref:"$map/item/key"}]}]}}]}},{tagName:"jx-select",attributes:{part:"nested-add-type"},$props:{label:"Type of the new field in ${$map.item.label}",size:"sm",options:{$ref:"#/state/typeOptions"},value:{$ref:"$map/item/draftType"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editDraftType"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},{tagName:"jx-action-button",attributes:{part:"nested-add-button"},$props:{label:"Add a field to ${$map.item.label}",hint:"Add a field to ${$map.item.label}",icon:"plus",quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/addNested"},value:[{$ref:"$map/item/key"}]}]}}]}]}}}]}}]},{tagName:"div",attributes:{part:"add-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/addState"},cases:{closed:{tagName:"jx-action-button",attributes:{part:"add-open"},$props:{label:"Add Field",icon:"plus",quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openAdd"},value:[]}]},children:[{tagName:"span",textContent:"Add Field"}]},open:{tagName:"div",attributes:{part:"add-form"},children:[{tagName:"jx-textfield",attributes:{part:"add-name"},$props:{label:"New field name",placeholder:"Field name",size:"sm",value:{$ref:"#/state/addName"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editAddName"},value:[{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{Enter:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/confirmAdd"},value:[]}],Escape:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/cancelAdd"},value:[]}]}}]}},{tagName:"jx-select",attributes:{part:"add-type"},$props:{label:"Type of the new field",size:"sm",options:{$ref:"#/state/typeOptions"},value:{$ref:"#/state/addType"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editAddType"},value:[{$ref:"event#/target/value"}]}]}},{tagName:"div",attributes:{part:"add-format-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/addHasFormat"},cases:{true:{tagName:"jx-select",attributes:{part:"add-format"},$props:{label:"Format of the new field",size:"sm",options:{$ref:"#/state/formatOptions"},value:{$ref:"#/state/addFormat"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editAddFormat"},value:[{$ref:"event#/target/value"}]}]}}}},{tagName:"jx-switch",attributes:{part:"add-required"},$props:{hint:"Require the new field",size:"sm",checked:{$ref:"#/state/addRequired"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editAddRequired"},value:[{$ref:"event#/target/checked"}]}]},children:[{tagName:"span",textContent:"Required"}]},{tagName:"jx-button",attributes:{part:"add-confirm"},$props:{size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/confirmAdd"},value:[]}]},children:[{tagName:"span",textContent:"Add"}]},{tagName:"jx-button",attributes:{part:"add-cancel"},$props:{size:"sm",quiet:!0},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/cancelAdd"},value:[]}]},children:[{tagName:"span",textContent:"Cancel"}]}]}}}]};T("schema-builder",U);function be(){return{addFormat:"",addHasFormat:!0,addName:"",addRequired:!1,addState:"closed",addType:"string",fields:[],formatOptions:[],targets:[],typeOptions:[]}}function Y(e,r){e.textContent="";let t=v({...be(),...r}),a=null,n=!0,s=!1,l=()=>R("schema-builder",t,e).then((o)=>{if(n=!1,s)return o.dispose(),o.root;return a=o,o.root}),p=l();return{dispose(){s=!0,a?.dispose(),a=null,e.textContent=""},host:e,ready:p,update(o){if(t.addFormat=o.addFormat,t.addHasFormat=o.addHasFormat,t.addName=o.addName,t.addRequired=o.addRequired,t.addState=o.addState,t.addType=o.addType,t.fields=o.fields,t.formatOptions=o.formatOptions,t.targets=o.targets,t.typeOptions=o.typeOptions,s||n||a!==null&&e.contains(a.root))return;a?.dispose(),a=null,n=!0,e.textContent="",l()}}}var G={$schema:"https://jxsuite.com/schema/v1",$id:"StudioReferenceField",$description:'The `reference` form control — site-architecture.md §6.1\'s `{ "$ref": "#/content/x" }` and site-architecture.md §7.4\'s entry picker. Registered once and dispatched to by `ui/schema-form.ts` for any property whose `$ref` names a collection, so the settings forms, the entry editor and an array-of-objects cell all draw the same control without any of them knowing it exists. `ui/form-controls.ts` decides which of the three states the field is in and what each gesture commits; nothing here reads a schema or lists a directory. The three states are drawn as three different controls on purpose: a picker while the entries are known, a TEXT field while they are not — a failed read leaves the value editable with the reason beside it, because swapping it for an empty dropdown would present "no entries" and "could not find out" as the same screen — and a disabled picker saying so while the read is in flight.',tagName:"div",attributes:{part:"reference",role:"none"},style:{$description:"The five `.reference-*` rules from `styles/inspector.css`, keyed on `part` and re-pointed at the studio token layer. Two values could not come with them. The note read `var(--spectrum-font-size-50, 11px)`, which resolves only inside `<sp-theme>` — this document is mounted in a settings pane, an entry editor or a frontmatter card, all outside that element, so it would silently have taken its hard-coded fallback every time. And `.reference-missing` coloured ONE row of the dropdown red; the kit's select offers a row a face, a swatch and a border style but no tone, so the dangling entry says what it is in words (\"— not found\") and the colour is not replaced by a second channel. The 6px gap comes onto the kit's spacing scale.",display:"flex",flex:"1",minWidth:"0",alignItems:"center",gap:"var(--jx-space-2)",'& [part="picker"], & [part="text"]':{flex:"1",minWidth:"0"},'& [part="note"]':{margin:"0",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)",lineHeight:"1.4"},'& [part="note"][data-tone="danger"]':{$description:"A listing that failed is a FAULT rather than a fact about the project, and the two notes this control draws are otherwise the same sentence in the same place.",color:"var(--danger)"},'& [part="retry"]':{flex:"none"}},children:[{tagName:"div",attributes:{part:"control-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/kind"},cases:{picker:{$description:"The collection's entries. The empty row is `\"\"` rather than a sentinel, because the kit's select treats the empty string as a legal value a reader can arrow to; a dangling reference is kept in the list and marked, since blanking the field would delete the evidence and the value in one repaint. While the read is in flight the same control is disabled and offers one row saying so.",tagName:"jx-select",attributes:{part:"picker"},$props:{size:"sm",label:{$ref:"#/state/label"},options:{$ref:"#/state/options"},value:{$ref:"#/state/value"},disabled:{$ref:"#/state/disabled"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/choose"},value:[{$ref:"event#/target/value"}]}]}},text:{$description:"The id as the string it is: what a reader gets when the choices could not be listed, and when the control was named by a `ui.control` override on a property that references nothing. Refusing to draw anything would lose the value that is already there.",tagName:"jx-textfield",attributes:{part:"text"},$props:{size:"sm",label:{$ref:"#/state/label"},value:{$ref:"#/state/value"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/edit"},value:[{$ref:"event#/target/value"}]}]}}}},{tagName:"div",attributes:{part:"note-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasNote"},cases:{true:{tagName:"p",attributes:{part:"note","data-tone":"${state.noteTone}",role:"status"},textContent:"${state.note}"}}},{tagName:"div",attributes:{part:"retry-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/canRetry"},cases:{true:{$description:"Offered only where there is something to try again — a listing that failed. It used to be offered only where the HOST passed a repaint hook, because a template control cannot draw a second frame of its own and a button that cannot do the thing it is named after is worse than its absence. A mounted control redraws itself, so the condition is now the failure rather than the host.",tagName:"jx-action-button",attributes:{part:"retry"},$props:{size:"sm",quiet:!0,label:"Retry listing entries"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/retry"},value:[]}]},children:[{tagName:"span",textContent:"Retry"}]}}}]};T("reference-field",G);function ve(){return{canRetry:!1,disabled:!0,hasNote:!1,kind:"picker",label:"",note:"",noteTone:"dim",options:[],value:""}}function K(e,r){e.textContent="";let t=v({...ve(),...r}),a=null,n=!0,s=!1,l=()=>R("reference-field",t,e).then((o)=>{if(n=!1,s)return o.dispose(),o.root;return a=o,o.root}),p=l();return{dispose(){s=!0,a?.dispose(),a=null,e.textContent=""},host:e,ready:p,update(o){if(t.canRetry=o.canRetry,t.disabled=o.disabled,t.hasNote=o.hasNote,t.kind=o.kind,t.label=o.label,t.note=o.note,t.noteTone=o.noteTone,t.options=o.options,t.value=o.value,s||n||a!==null&&e.contains(a.root))return;a?.dispose(),a=null,n=!0,e.textContent="",l()}}}var X={$schema:"https://jxsuite.com/schema/v1",$id:"StudioSecretField",$description:'The `secret` form control (specs/extensions.md §9.1, §13): one password field whose VALUE goes to the platform\'s secret store and never to project.json. A descriptor names it with `"ui": { "<field>": { "control": "secret" } }`, and `ui/schema-form.ts` mounts it into the empty host its own document announces for that field. **A surface never renders back the secret it describes, and this document is where that is visible rather than remembered**: the only thing bound to the field\'s value is `#/state/shown`, a scope path whose whole purpose is to hold nothing. What the field is worth is said in the placeholder instead — the env NAME the store gave it, which is the only half of a secret a screen may carry. `ui/form-controls.ts` decides everything else: whether the host has a secret store at all, what the placeholder says, what a commit is worth and what the field persists.',tagName:"div",attributes:{part:"secret",role:"none"},style:{$description:"`.secret-field` carried no rule anywhere — it was one of `check-styles.ts`'s ALLOWED_ORPHANS, a class emitted only so a test could find the control — so there is nothing to translate and the wrapper takes no box of its own. The field takes the width of the control host the form drew, which is the flex item; a kit field is inline-flex by default and would otherwise sit at its intrinsic width in a row sized for it.",display:"contents",'& [part="field"]':{width:"100%"}},children:[{$description:"`autocomplete: new-password` because this is a place to PUT a secret rather than to prove one: without it a password manager offers to fill the field with a credential belonging to whatever site the reader last logged in to, and the offer is the manager's own UI drawn over an editor. The value binding is `#/state/shown` and nothing else ever writes to it — see the document description.",tagName:"jx-textfield",attributes:{part:"field"},$props:{type:"password",size:"sm",autocomplete:"new-password",label:{$ref:"#/state/label"},placeholder:{$ref:"#/state/placeholder"},disabled:{$ref:"#/state/disabled"},value:{$ref:"#/state/shown"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/commit"},value:[{$ref:"event#/target/value"}]}],description:"The change bubbles out of the field's own input, so what the reader typed is read off the event rather than off the element — and it is read here, handed to the flow, and never written back onto the scope."}}]};T("secret-field",X);function xe(){return{disabled:!0,label:"",placeholder:"Not set"}}function Z(e,r){e.textContent="";let t=v({...xe(),...r,shown:""}),a=null,n=!0,s=!1,l=()=>R("secret-field",t,e).then((o)=>{if(n=!1,s)return o.dispose(),o.root;return a=o,o.root}),p=l();return{clear(){t.shown=" ",t.shown=""},dispose(){s=!0,a?.dispose(),a=null,e.textContent=""},host:e,ready:p,update(o){if(t.disabled=o.disabled,t.label=o.label,t.placeholder=o.placeholder,s||n||a!==null&&e.contains(a.root))return;a?.dispose(),a=null,n=!0,e.textContent="",l()}}}var Fe=kw.map((e)=>({label:e,value:e})),Ne=Sw.map((e)=>({label:e||"(none)",value:e})),j={format:"",name:"",required:!1,type:"string"},ee=[],re=" ";function Te(e){let r=e.resolvePointer("#/$context/content"),t=r&&typeof r==="object"&&!Array.isArray(r)?Object.keys(r):[],a=t.join(" ");if(a!==re)re=a,ee=t.map((n)=>({label:n,value:n}));return ee}function N(e){return e==="string"||e==="array"}function ie(e){return e&&typeof e==="object"&&!Array.isArray(e)?e:{properties:{},required:[],type:"object"}}function Ee(e){let r=JSON.parse(JSON.stringify(ie(e)));return r.type??="object",r.properties??={},r.required??=[],r}function A(e){return`name:${e}`}function H(e){return`required:${e}`}function V(e,r){return`${e} ${r}`}function O(e,r,t){return e.echo?.id===r?e.echo.value:t}function ke(e,r,t,a,n){let s=V(r,t),l=zf(a);return{format:uc(a),hasFormat:N(l),key:t,name:O(e,A(s),t),parent:r,required:O(e,H(s),n),type:l}}function Ce(e,r,t,a,n){let s=zf(t),l=s==="object",p=e.drafts.get(r),o=t.required??[];return{children:l?Object.entries(t.properties??{}).map(([w,g])=>ke(e,r,w,g,o.includes(w))):[],draftName:p?.name??"",draftType:p?.type??"string",extra:s==="reference"&&n?"reference":l?"nested":"none",format:uc(t),hasFormat:N(s),key:r,label:Ml(r),name:O(e,A(r),r),refTarget:t.$ref?t.$ref.replace(/^#\/[^/]+\//,""):"",required:O(e,H(r),a),type:s}}function ae(e,r,t){let a={};for(let[n,s]of Object.entries(e))a[n===r?t:n]=s,delete e[n];Object.assign(e,a)}function M(e,r,t){e.required??=[];let a=e.required.indexOf(r);if(t&&a===-1)e.required.push(r);if(!t&&a!==-1)e.required.splice(a,1)}function Re(e,r){let t=r,a=null,n={add:{...j},addOpen:!1,drafts:new Map,echo:null},s=()=>a??ie(t.value),l=()=>{let i=s(),d=i.required??[],c=Te(t.ctx);return{addFormat:n.add.format,addHasFormat:N(n.add.type),addName:n.add.name,addRequired:n.add.required,addState:n.addOpen?"open":"closed",addType:n.add.type,fields:Object.entries(i.properties??{}).map(([f,h])=>Ce(n,f,h,d.includes(f),c.length>0)),formatOptions:Ne,targets:c,typeOptions:Fe}},p=()=>F.update(l()),o=(i,d)=>{n.echo={id:i,value:d},p()},w=()=>{n.echo=null,p()},g=(i)=>{let d=Ee(s());if(!i(d)){w();return}a=d,n.echo=null,t.onChange(d),p()},y=(i,d)=>i.properties[d],x=(i)=>{let d=n.drafts.get(i);if(!d)d={name:"",type:"string"},n.drafts.set(i,d);return d},F=Y(e,{addNested(i){let d=x(i),c=xv(d.name.trim());if(!c)return;g((f)=>{let h=y(f,i);if(!h)return!1;return h.properties??={},h.properties[c]=Ms(d.type||"string"),d.name="",!0})},cancelAdd(){n.addOpen=!1,n.add={...j},p()},confirmAdd(){let i=xv(n.add.name.trim());if(!i)return;let{format:d,required:c,type:f}=n.add;n.addOpen=!1,n.add={...j},g((h)=>{if(h.properties[i]=Ms(f,d||void 0),c)M(h,i,!0);return!0})},editAddFormat(i){n.add.format=i,p()},editAddName(i){n.add.name=i,p()},editAddRequired(i){n.add.required=i,p()},editAddType(i){n.add.type=i,p()},editDraftName(i,d){x(i).name=d,p()},editDraftType(i,d){x(i).type=d,p()},openAdd(){n.addOpen=!0,n.add={...j},p()},removeField(i){g((d)=>{if(!d.properties[i])return!1;return delete d.properties[i],d.required=d.required.filter((c)=>c!==i),!0})},removeNested(i,d){g((c)=>{let f=y(c,i);if(!f?.properties?.[d])return!1;if(delete f.properties[d],f.required)f.required=f.required.filter((h)=>h!==d);return!0})},renameField(i,d){o(A(i),d);let c=xv(d.trim());g((f)=>{if(!f.properties[i]||!c||c===i||f.properties[c])return!1;return ae(f.properties,i,c),f.required=f.required.map((h)=>h===i?c:h),!0})},renameNested(i,d,c){o(A(V(i,d)),c);let f=xv(c.trim());g((h)=>{let b=y(h,i);if(!b?.properties?.[d]||!f||f===d||b.properties[f])return!1;if(ae(b.properties,d,f),b.required)b.required=b.required.map((C)=>C===d?f:C);return!0})},setFormat(i,d){g((c)=>{let f=c.properties[i];if(!f)return!1;return c.properties[i]=Ms(f.type||"string",d||void 0),!0})},setNestedFormat(i,d,c){g((f)=>{let h=y(f,i),b=h?.properties?.[d];if(!h?.properties||!b)return!1;return h.properties[d]=Ms(b.type||"string",c||void 0),!0})},setNestedRequired(i,d,c){o(H(V(i,d)),c),g((f)=>{let h=y(f,i);if(!h)return!1;return M(h,d,c),!0})},setNestedType(i,d,c){g((f)=>{let h=y(f,i),b=h?.properties?.[d];if(!h?.properties||!b)return!1;let C=N(c)?uc(b):void 0;return h.properties[d]=Ms(c,C||void 0),!0})},setRequired(i,d){o(H(i),d),g((c)=>{if(!c.properties[i])return!1;return M(c,i,d),!0})},setTarget(i,d){g((c)=>{if(!c.properties[i])return!1;return c.properties[i]={$ref:`#/content/${d}`},!0})},setType(i,d){g((c)=>{let f=c.properties[i];if(!f)return!1;let h=N(d)?uc(f):void 0;return c.properties[i]=Ms(d,h||void 0),!0})}});return p(),{dispose:()=>F.dispose(),update(i){t=i,a=null,n.echo=null,p()}}}var je={mount:Re};Pw("schema-builder",je);function oe(e){return typeof e==="string"&&e?e:null}function De(e,r){let t=r,a=()=>{let s=oe(t.value);n.update({disabled:!t.ctx.commitSecret,label:t.key,placeholder:s?`Stored as ${s}`:"Not set"})},n=Z(e,{commit(s){let{commitSecret:l}=t.ctx;if(!l||!s)return;n.clear();let{key:p,onChange:o}=t,w=oe(t.value);Promise.resolve(l(p,s)).then((g)=>{if(typeof g==="string"&&g&&g!==w)o(g)})}});return a(),{dispose:()=>n.dispose(),update(s){t=s,a()}}}var qe={mount:De};Pw("secret",qe);var E=new Map,P=new Map,S=new Map;function B(e){if(e===void 0)E.clear(),P.clear(),S.clear();else E.delete(e),P.delete(e),S.delete(e)}function Oe(e){let r=E.get(e);if(r)return r;let t=(me("37x3vsap"),import("./content-source-37x3vsap.js")).then((a)=>a.listCollectionEntryIds(e));return E.set(e,t),t}function g1(e,r){let t=P.get(e);if(t)return t;let a=Oe(e),n=S.get(e);if(n){if(r)n.add(r);return null}S.set(e,new Set(r?[r]:[]));let s=(l)=>{if(E.get(e)!==a)return;let p=S.get(e);S.delete(e),P.set(e,l);for(let o of p??[])o()};return a.then((l)=>s({ids:l}),(l)=>s({error:te(l)})),null}function Pe(e,r){let t=typeof e.value==="string"?e.value:"",a={canRetry:!1,disabled:!1,hasNote:!1,label:e.key,note:"",noteTone:"dim",options:[],value:t},n=Eu(e.schema);if(n===null)return{...a,hasNote:!0,kind:"text",note:'No collection referenced — add "$ref": "#/content/<type>" to this field.'};let s=g1(n,r);if(s===null)return{...a,disabled:!0,kind:"picker",options:[{label:"Loading…",value:t}]};if("error"in s)return{...a,canRetry:!0,hasNote:!0,kind:"text",note:`Could not list ${n} entries — ${s.error}`,noteTone:"danger"};let l=t!==""&&!s.ids.includes(t);return{...a,hasNote:s.ids.length===0,kind:"picker",note:s.ids.length===0?`No ${n} entries yet.`:"",options:[{label:"—",value:""},...l?[{label:`${t} — not found`,value:t}]:[],...s.ids.map((p)=>({label:p,value:p}))]}}function Le(e,r){let t=r,a=!1,n=()=>{if(!a)s.update(Pe(t,n))},s=K(e,{choose(l){t.onChange(l===""?void 0:l)},edit(l){t.onChange(l.trim()||void 0)},retry(){let l=Eu(t.schema);if(l!==null)B(l);n()}});return n(),{dispose(){a=!0,s.dispose()},update(l){t=l,n()}}}var Me={mount:Le};Pw("reference",Me);var se={$schema:"https://jxsuite.com/schema/v1",$id:"StudioEntryEditor",$description:"The Entry editor (site-architecture.md §7.4) — one content entry's fields, in a pane, as a Jx document over the kit. The adapter (`surfaces/entry-editor.ts`) hands in a projection; `content/entry-editor.ts` decides everything in it — which collection the file belongs to, which record its fields live in, which required keys are absent and what a draft flag commits into. The FORM is an island: a schema is `ui/schema-form.ts`'s subject, so this document renders an empty `fields` node and the flow places the element that engine hands back (studio-ui-guidelines.md §9.3, §9.4). That is the whole of the difference between this and the card the lit version drew, and it is why the engine converting in batch 7 is what unblocked this one.",tagName:"div",attributes:{part:"entry","data-jx-region":"${state.region}"},style:{$description:"What `.entry-editor`, `.entry-editor-header`, `.entry-editor-collection`, `.entry-draft-switch`, `.entry-editor-fields`, `.entry-editor-note` and `.entry-editor-empty` said in `styles/overlays.css`, keyed on `part` and re-pointed at the studio token layer. This editor was the only emitter of all seven, so those rules are dead in the stylesheet from here; a central sweep removes them rather than this change, which owns no stylesheet. Every `--spectrum-font-size-*` reference is gone rather than renamed: those names resolve only inside `<sp-theme>`, and a pane editor is mounted outside it, so each would silently have taken its hard-coded fallback.",height:"100%",padding:"var(--jx-space-5)",overflowY:"auto",background:"var(--bg-panel)",'& [part="header"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-4)",marginBottom:"var(--jx-space-5)"},'& [part="name"]':{margin:"0",fontSize:"var(--jx-text-lg)",fontWeight:"600",color:"var(--fg)"},'& [part="collection"]':{padding:"1px var(--jx-space-3)",borderRadius:"var(--radius)",background:"var(--bg)",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"},'& [part="draft"]':{$description:"Pushed to the far end of the header rather than placed there: the heading and the collection chip are both content-width, so `margin-left: auto` is what keeps the switch on the right edge whatever the entry is called.",marginLeft:"auto"},'& [part="fields"]':{$description:"The schema form's host is `display: contents`, so its rows are the flex items of THIS box — which is why the column lives here and not inside the engine.",display:"flex",flexDirection:"column"},'& [part="note"]':{margin:"0 0 var(--jx-space-4)",color:"var(--fg-dim)",fontSize:"var(--jx-text-md)",lineHeight:"1.5"},'& [part="empty"]':{display:"flex",maxWidth:"46ch",flexDirection:"column",alignItems:"flex-start",gap:"var(--jx-space-3)",color:"var(--fg-dim)",fontSize:"var(--jx-text-md)",lineHeight:"1.5"}},children:[{tagName:"div",attributes:{part:"stage-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/stage"},cases:{entry:{tagName:"div",attributes:{part:"body",role:"none"},style:{display:"contents"},children:[{tagName:"div",attributes:{part:"header"},children:[{tagName:"h3",attributes:{part:"name"},textContent:"${state.name}"},{tagName:"span",attributes:{part:"collection"},textContent:"${state.collection}"},{tagName:"div",attributes:{part:"draft-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/draftAxis"},cases:{shown:{$description:"No `label`: the slotted word is on screen and carries the name, so an aria-label would be read twice. The tooltip is `hint`, which is what DRAFT_MEANING has always been.",tagName:"jx-switch",attributes:{part:"draft"},$props:{checked:{$ref:"#/state/draft"},hint:"${state.draftHint}",size:"sm"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setDraft"},value:[{$ref:"event#/target/checked"}]}]},children:[{tagName:"span",textContent:"Draft"}]}}}]},{tagName:"div",attributes:{part:"note-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/noteState"},cases:{shown:{tagName:"p",attributes:{part:"note"},textContent:"${state.note}"}}},{$description:"An island: `ui/schema-form.ts` draws this entry's fields into this node, and nothing in this document knows what a schema is.",tagName:"div",attributes:{part:"fields","data-jx-region":"${state.fieldsRegion}"}}]},empty:{$description:"The mode is reachable from the palette and from `__jxAutomation` on any tab, so this state is real: it names the reason and the fix rather than drawing an empty form.",tagName:"div",attributes:{part:"empty"},children:[{tagName:"p",attributes:{part:"empty-line"},textContent:"${state.emptyLine}"},{tagName:"p",attributes:{part:"note"},children:[{tagName:"span",textContent:"A collection is a "},{tagName:"code",textContent:"content"},{tagName:"span",textContent:" entry in "},{tagName:"code",textContent:"project.json"},{tagName:"span",textContent:" whose "},{tagName:"code",textContent:"source"},{tagName:"span",textContent:" directory contains this file and which declares a "},{tagName:"code",textContent:"schema"},{tagName:"span",textContent:"."}]},{tagName:"jx-action-button",attributes:{part:"content-types"},$props:{label:"Content types",size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openContentTypes"},value:[]}]},children:[{tagName:"span",textContent:"Content types…"}]}]}}}]};T("entry-editor",se);function de(e,r){e.region=r.region,e.fieldsRegion=r.fieldsRegion,e.stage=r.stage,e.name=r.name,e.collection=r.collection,e.draftAxis=r.draftAxis,e.draft=r.draft,e.draftHint=r.draftHint,e.noteState=r.noteState,e.note=r.note,e.emptyLine=r.emptyLine}function Be(e){let t=e?.attributes?.part;return typeof t==="string"?t:""}function le(e,r,t,a){e.replaceChildren();let n=v({collection:"",draft:!1,draftAxis:"hidden",draftHint:"",emptyLine:"",fieldsRegion:"",name:"",note:"",noteState:"hidden",openContentTypes:t.openContentTypes,region:"",setDraft:t.setDraft,stage:"empty"});de(n,r);let s=null,l=!1,p=R("entry-editor",n,e,{onNodeCreated:(o,w,g)=>{if(o instanceof HTMLElement&&Be(g)==="fields")a.fieldsSlot(o)}}).then((o)=>{if(l)return o.dispose(),o.root;return s=o,o.root});return{attached:()=>{if(l)return!1;let o=s?.root;return o===void 0?!0:o instanceof HTMLElement&&e.contains(o)},dispose(){l=!0,s?.dispose(),s=null},ready:p,update:(o)=>de(n,o)}}function ce(e){return e.doc.sourceFormat==null&&e.doc.mode!=="content"}function Wf(e){return ce(e)?e.doc.document:e.doc.content?.frontmatter??{}}function ze(e,r,t){let a=e.doc.document,n=Object.hasOwn(a,r)?Ae(a[r]):void 0,s=t===void 0||t===null||t==="";if(s)delete a[r];else a[r]=t;let l=s?void 0:Ae(t);vi({forward:{key:r,op:"set-key",path:[],value:l},inverse:{key:r,op:"set-key",path:[],value:n}}),e.doc.dirty=!0,HE()}function z(e,r,t){if(ce(e))ze(e,r,t);else Ol(e,r,t)}function pe(e,r){q(e,(t)=>{for(let[a,n]of Object.entries(r))z(t,a,n)})}var fe="entry",Ie=[fe],L=new Map;function I(e){return L.get(e)??null}function b1(e,r){let t=I(e);return t!==null&&t.tabId===r.id&&t.wrap.isConnected&&t.surface.attached()}function lb(e){let r=L.get(e);if(!r)return;r.scope.stop(),r.surface.dispose(),L.delete(e)}function _(e,r){q(e,(t)=>z(t,fc,r))}function xE(e){let r=sa(e.documentPath),t=Wf(e);if(!r||!Gf(r.schema,t))return null;let a=Lu(t);return{draft:a,text:a?"Draft":"Published",title:a?mb:"Not marked a draft."}}function _e(e){return{fieldKeyPrefix:`entry:${e.id}`,resolvePointer:(r,t)=>Tu(r,{projectConfig:D?.projectConfig??{},scope:t})}}function We(e,r){let t={};for(let a of CE(e.schema,r))t[a]="Required — this entry does not have one.";return t}function Je(e){return`${e.documentPath??"This document"} is not an entry of any content collection, so there is no schema to draw a form from.`}function ue(e,r,t){let a=Zi(e,"entry"),n=Zi(e,"entry/fields");if(!t)return{collection:"",draft:!1,draftAxis:"hidden",draftHint:mb,emptyLine:Je(r),fieldsRegion:n,name:"",note:"",noteState:"hidden",region:a,stage:"empty"};let s=Wf(r),l=Lu(s);return{collection:t.name,draft:l,draftAxis:Gf(t.schema,s)?"shown":"hidden",draftHint:mb,emptyLine:"",fieldsRegion:n,name:r.documentPath?.split("/").pop()??"Untitled",note:mb,noteState:l?"shown":"hidden",region:a,stage:"entry"}}function _E(e,r){let{paneId:t,wrap:a}=e;if(b1(t,r))return;lb(t);let n=null,s=null,l=()=>{if(n!==null&&I(t)===n)o()},p=(y)=>{if(!s||!y)return;let x=Wf(r),F=fd(`entry:${t}`,y.schema,x,{context:_e(r),errors:We(y,x),onChange:(i)=>pe(r,i),rerender:l});if(F.parentNode!==s)s.replaceChildren(F)},o=()=>{let y=sa(r.documentPath);if(!y)s=null;n?.surface.update(ue(t,r,y)),p(y)},w=ge(),g=le(a,ue(t,r,sa(r.documentPath)),{openContentTypes:()=>{ne()?.run("settings.open",{section:"content"})},setDraft:(y)=>_(r,y)},{fieldsSlot:(y)=>{s=y,p(sa(r.documentPath))}});n={paneId:t,scope:w,surface:g,tabId:r.id,wrap:a},L.set(t,n),w.run(()=>{Q(()=>{if(I(t)!==n)return;r.doc.document,r.doc.content?.frontmatter,D?.projectConfig?.content,o()})})}async function W(e){let{openFileInTab:r}=await (me("tznwe1p1"),import("./files-tznwe1p1.js"));await r(e);for(let[t,a]of m.tabs.entries()){if(a.documentPath!==e)continue;for(let n of Ie)if(!a.capabilities.modes.includes(n))a.capabilities.modes.unshift(n);return a.session.ui.canvasMode=fe,a.session.ui.preview=!1,ci(t),a}return null}function J(){return cb().map((e)=>e.name)}async function Ue(e){let r=y1(e.schema),t=(e.def.format?wi(e.def.format)?.name:void 0)??Zt(`untitled${e.ext}`)?.name??Dr()?.name;if(e.ext===".json"||t===void 0)return pr(r,null);return Us(t,{...r,children:[]},{frontmatter:Object.keys(r).length>0,mode:"roundtrip"})}async function Ew(e,r={}){let t=Tw(e);if(!t)return k.error(`No content collection named "${e}" to create an entry in.`,{detail:"A collection needs a `content` entry in project.json whose `source` is a directory. A collection whose source names a single file (a CSV catalogue) has rows, not entry files.",source:"Content"}),null;await qt().catch(()=>{});let a;try{a=await Ue(t)}catch(o){return k.error(`Could not prepare a new ${t.name} entry.`,{detail:te(o),path:t.dir,source:"Content"}),null}let n=r.dir,s=n!==void 0&&bp(n)?.name===t.name?n:t.dir;if(s.includes(Dx))return k.error(`"${t.name}" is a localized collection.`,{detail:`Its entries live in one directory per language (${t.dir}). Open the folder for the language you are writing in and create the entry there.`,path:t.dir,source:"Content"}),null;let{createFileIn:l}=await (me("tznwe1p1"),import("./files-tznwe1p1.js")),p=await l({content:a,dir:s,format:{ext:t.ext,kind:"fixed"},source:"Content",suggestedName:"untitled",title:`New ${t.name} entry`});if(p===null)return null;return B(t.name),await W(p),p}function he(){let e=u.value;return e&&sa(e.documentPath)?e:null}function Ye(){return[{args:Se({collection:fa(J,"The content collection the entry is created in.")}),category:"File",id:"content.newEntry",level:"project",menus:["palette"],group:"1_file",requires:"a project with a directory-backed content collection",when:(e)=>e.project.open,enablement:()=>J().length>0,undo:"project",run:async(e,r)=>{let t=J();await Ew(li("content.newEntry",r,"collection",t))},title:"New Entry"},{args:Se({path:He("Project-relative path of the entry file to open.")}),category:"File",id:"content.openEntry",level:"project",menus:["context/file","palette"],group:"1_file",requires:"an open project",when:(e)=>e.project.open,run:async(e,r)=>{await W(ot("content.openEntry",r,"path"))},title:"Open Entry Form"},{args:Se({draft:oo("True marks the open entry a draft; false marks it published. Written as a `draft` field on the entry.")}),category:"Document",id:"content.setDraft",level:"document",menus:["context/tab","palette"],group:"3_document",requires:"a content entry open",when:(e)=>e.document.open,enablement:()=>he()!==null,undo:"document",run:(e,r)=>{let t=he();if(!t)throw Error("content.setDraft: the active document is not a content entry");_(t,yi("content.setDraft",r,"draft"))},title:"Set Draft"},{args:Se({include:oo("True lists entries marked `draft: true` alongside the rest.")}),category:"View",id:"content.setIncludeDrafts",level:"project",menus:["palette"],group:"2_view",requires:"an open project",when:(e)=>e.project.open,run:async(e,r)=>{FE(yi("content.setIncludeDrafts",r,"include")),await I1()},title:"Include Drafts"}]}function v1(e){e.registerAll(Ye())}
|
|
2
|
+
export{kw,Sw,zf,uc,Ms,g1,Wf,b1,lb,xE,_E,Ew,v1};
|
|
3
|
+
|
|
4
|
+
//# debugId=78AC37E2BAC6191964756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-wma2c6g8.js.map
|