@jxsuite/studio 10.5.0 → 10.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/data/locales/en/elements.json +434 -0
- package/data/webdata.json +116 -139
- package/dist/chunks/{2020-7sx2vexa.js → 2020-rqm7qrje.js} +3 -3
- package/dist/chunks/adapter-cyy8vbcx.js +4 -0
- package/dist/chunks/add-new-flow-8cgtejv2.js +4 -0
- package/dist/chunks/{cf-account-picker-ajh60k54.js → cf-account-picker-v3qd2dhw.js} +3 -3
- package/dist/chunks/cf-settings-1fnw874z.js +4 -0
- package/dist/chunks/{color-area-gbcftzh3.js → color-area-frd9y9q6.js} +2 -2
- package/dist/chunks/{color-field-85136598.js → color-field-rebpbe33.js} +3 -3
- package/dist/chunks/{color-slider-w1s3ndd8.js → color-slider-6bzmk3s7.js} +2 -2
- package/dist/chunks/color-t2bnnj8y.js +4 -0
- package/dist/chunks/{combobox-dk98wc5x.js → combobox-c49x7gf1.js} +2 -2
- package/dist/chunks/components-y8yhdd7d.js +4 -0
- package/dist/chunks/content-source-9e7qvmsf.js +4 -0
- package/dist/chunks/convert-to-repeater-pd2w4z21.js +4 -0
- package/dist/chunks/editor-mb9jzdrw.js +4 -0
- package/dist/chunks/entry-commands-at0wnx3f.js +4 -0
- package/dist/chunks/extension-sections-4z9qq0gh.js +4 -0
- package/dist/chunks/file-ops-dtdvjmza.js +4 -0
- package/dist/chunks/files-8pf70854.js +4 -0
- package/dist/chunks/format-host-fd3m2y2a.js +4 -0
- package/dist/chunks/fs-events-hrk29vcv.js +4 -0
- package/dist/chunks/grid-open-bh74v82z.js +4 -0
- package/dist/chunks/{grid-view-0v4hjspb.js → grid-view-a51mgzmq.js} +10 -10
- package/dist/chunks/{icons-j9eksgew.js → icons-qp8fn1k8.js} +2 -2
- package/dist/chunks/{iframe-entry-4zqtn3ry.js → iframe-entry-mpwe5pwk.js} +4 -4
- package/dist/chunks/{iframe-entry-2x9bn5ng.js → iframe-entry-msd43x9h.js} +4 -4
- package/dist/chunks/iframe-entry-rt8jz5t8.js +5 -0
- package/dist/chunks/{iframe-entry-54kwwhmg.js → iframe-entry-v40cr813.js} +2 -2
- package/dist/chunks/iframe-host-q0s0wwy3.js +4 -0
- package/dist/chunks/{image-bake-m8gzaan9.js → image-bake-q9ajdjsj.js} +3 -3
- package/dist/chunks/{image-editor-0afyws7c.js → image-editor-ke9std9b.js} +2 -2
- package/dist/chunks/index-57ang7ma.js +4 -0
- package/dist/chunks/index-eytr7av4.js +17 -0
- package/dist/chunks/{index-2q88g57p.js → index-x495reff.js} +3 -3
- package/dist/chunks/{javascript-5sxtr1g7.js → javascript-qe34bvaz.js} +3 -3
- package/dist/chunks/{jsonMode-m6sf47hq.js → jsonMode-m8rseh31.js} +8 -8
- package/dist/chunks/jx-validate-bbd1mary.js +4 -0
- package/dist/chunks/layers-panel-wcjtdqsa.js +4 -0
- package/dist/chunks/layers-yscpys6q.js +4 -0
- package/dist/chunks/{listbox-k5p41049.js → listbox-tktzq5xj.js} +2 -2
- package/dist/chunks/lit-html-qm5wbhqz.js +4 -0
- package/dist/chunks/media-library-2hfff88g.js +4 -0
- package/dist/chunks/media-open-4pb05cne.js +4 -0
- package/dist/chunks/media-picker-bzktmmwr.js +4 -0
- package/dist/chunks/{menu-26nez152.js → menu-xc3cbgsd.js} +2 -2
- package/dist/chunks/{monaco-binding-1s2b8snq.js → monaco-binding-7t38arh9.js} +3 -3
- package/dist/chunks/monaco-buffer-3vz94c9f.js +4 -0
- package/dist/chunks/monaco-setup-fstdew02.js +4 -0
- package/dist/chunks/notify-gbdcckrh.js +4 -0
- package/dist/chunks/parse-fpdzgk4c.js +4 -0
- package/dist/chunks/platform-9g72gdqr.js +4 -0
- package/dist/chunks/{popover-fhdnt4be.js → popover-cnmsav6b.js} +2 -2
- package/dist/chunks/publish-panel-91x1cb5d.js +4 -0
- package/dist/chunks/publish-quick-e2dmf7eg.js +4 -0
- package/dist/chunks/publish-workspace-1x8mnzrj.js +4 -0
- package/dist/chunks/quick-search-2m4y6p1x.js +4 -0
- package/dist/chunks/references-yg1g9rwx.js +4 -0
- package/dist/chunks/right-panel-7mfyhzrk.js +4 -0
- package/dist/chunks/source-control-rrc4jgp5.js +4 -0
- package/dist/chunks/{split-qh21j2b0.js → split-d15yencd.js} +2 -2
- package/dist/chunks/{studio-r5g7fx7q.js → studio-0jhhznxy.js} +6 -6
- package/dist/chunks/studio-0nb57pjg.js +7 -0
- package/dist/chunks/{studio-bpzwhn88.js → studio-0wa4wv4s.js} +4 -4
- package/dist/chunks/studio-0z8kp4xk.js +5 -0
- package/dist/chunks/{studio-jqvke4ac.js → studio-18gc5t3v.js} +4 -4
- package/dist/chunks/{studio-xh6rf05g.js → studio-1b79rpcb.js} +4 -4
- package/dist/chunks/studio-211q5j7m.js +4 -0
- package/dist/chunks/studio-213pyfxh.js +16 -0
- package/dist/chunks/studio-2b1smjvp.js +5 -0
- package/dist/chunks/{studio-dst8y8vh.js → studio-2v6tc9jp.js} +4 -4
- package/dist/chunks/studio-30j0wz99.js +5 -0
- package/dist/chunks/studio-3kmqhwtt.js +5 -0
- package/dist/chunks/studio-44drsmhw.js +5 -0
- package/dist/chunks/{studio-d5f7sskn.js → studio-495b6f2r.js} +4 -4
- package/dist/chunks/{studio-g65t6svn.js → studio-4gthb2fd.js} +4 -4
- package/dist/chunks/{studio-bmwgj8ez.js → studio-4xadhxj1.js} +4 -4
- package/dist/chunks/{studio-zav9hgb3.js → studio-52mzbxqm.js} +4 -4
- package/dist/chunks/{studio-thgexj3w.js → studio-56mmnsw8.js} +7 -7
- package/dist/chunks/studio-59hz8f4r.js +5 -0
- package/dist/chunks/{studio-bk0anq3b.js → studio-5k9mfafh.js} +3 -3
- package/dist/chunks/{studio-qarg1xf9.js → studio-5qez462c.js} +5 -5
- package/dist/chunks/studio-6tnpg0vx.js +5 -0
- package/dist/chunks/studio-6w8mt734.js +6 -0
- package/dist/chunks/studio-7hm04x5z.js +5 -0
- package/dist/chunks/studio-8atmfjjm.js +7 -0
- package/dist/chunks/{studio-69g6a0jn.js → studio-8n99z71s.js} +4 -4
- package/dist/chunks/{studio-ep1384t9.js → studio-8vmad6x2.js} +4 -4
- package/dist/chunks/{studio-6sxnqqw8.js → studio-93p5k4r4.js} +4 -4
- package/dist/chunks/{studio-hy936516.js → studio-9gb0m81w.js} +4 -4
- package/dist/chunks/{studio-ek4fb4eb.js → studio-a4ymg4vd.js} +4 -4
- package/dist/chunks/studio-anc8067x.js +5 -0
- package/dist/chunks/{studio-ketrgtph.js → studio-dbdt67kr.js} +5 -5
- package/dist/chunks/studio-dbex091t.js +5 -0
- package/dist/chunks/{studio-nngc45ct.js → studio-dj8ctxey.js} +4 -4
- package/dist/chunks/{studio-pgze9p34.js → studio-ed9bz68j.js} +5 -5
- package/dist/chunks/{studio-4ncxzw5m.js → studio-fe2d1fp5.js} +4 -4
- package/dist/chunks/{studio-m8hesdrw.js → studio-fgp4cyy3.js} +4 -4
- package/dist/chunks/{studio-151kgn69.js → studio-ft706q02.js} +4 -4
- package/dist/chunks/{studio-pv1ts08p.js → studio-g79s1dyg.js} +5 -5
- package/dist/chunks/{studio-zkkt13qd.js → studio-gahswxp4.js} +4 -4
- package/dist/chunks/{studio-x5ffyssw.js → studio-gbqc12bk.js} +4 -4
- package/dist/chunks/{studio-4jy967rj.js → studio-gxphbetb.js} +5 -5
- package/dist/chunks/studio-hdf01j7q.js +7 -0
- package/dist/chunks/studio-hf259xzd.js +48 -0
- package/dist/chunks/studio-jbva4wxw.js +5 -0
- package/dist/chunks/{studio-td3h1644.js → studio-jj9gf1qc.js} +4 -4
- package/dist/chunks/studio-jsjg3mjv.js +5 -0
- package/dist/chunks/studio-jtvb8hd7.js +5 -0
- package/dist/chunks/{studio-c72v1kwc.js → studio-kp4vzrct.js} +4 -4
- package/dist/chunks/{studio-s4k1v7dt.js → studio-kpx02gaa.js} +6 -6
- package/dist/chunks/{studio-3yr1zdp9.js → studio-kv1728ex.js} +8 -8
- package/dist/chunks/studio-m25ry0mf.js +5 -0
- package/dist/chunks/studio-mcbwmkyh.js +5 -0
- package/dist/chunks/studio-meajkr51.js +5 -0
- package/dist/chunks/studio-mkjrjpr2.js +6 -0
- package/dist/chunks/{studio-nv5eq0f7.js → studio-mr084886.js} +181 -181
- package/dist/chunks/{studio-43pynnhz.js → studio-mrb10hv3.js} +4 -4
- package/dist/chunks/{studio-7qqb7hb8.js → studio-nhpg405j.js} +4 -4
- package/dist/chunks/{studio-n271vdsg.js → studio-nsec0hxm.js} +41 -41
- package/dist/chunks/{studio-ztzf8mce.js → studio-nv0mh0p5.js} +4 -4
- package/dist/chunks/studio-pafmb06w.js +5 -0
- package/dist/chunks/{studio-4s5bka8t.js → studio-pgftd79b.js} +4 -4
- package/dist/chunks/{studio-wn2cmf9q.js → studio-pk961xgz.js} +4 -4
- package/dist/chunks/studio-pzbr7g05.js +5 -0
- package/dist/chunks/{studio-15mfah02.js → studio-qcc5hsw2.js} +6 -6
- package/dist/chunks/studio-qfq58c8n.js +5 -0
- package/dist/chunks/{studio-j3bq30yz.js → studio-qvb2jr83.js} +4 -4
- package/dist/chunks/studio-r85zw6ay.js +5 -0
- package/dist/chunks/{studio-f69wcajk.js → studio-s0kwce5w.js} +5 -5
- package/dist/chunks/studio-s6ymkf3q.js +14 -0
- package/dist/chunks/{studio-8ncm9zwx.js → studio-s7p5ccxa.js} +4 -4
- package/dist/chunks/{studio-zzgp5yka.js → studio-s9jjap3x.js} +4 -4
- package/dist/chunks/{studio-ber1dgte.js → studio-t5hde1ws.js} +4 -4
- package/dist/chunks/studio-vj9yv897.js +5 -0
- package/dist/chunks/{studio-ajfq4fmr.js → studio-wmak8xjw.js} +4 -4
- package/dist/chunks/{studio-k05g7efh.js → studio-wqsmvtqj.js} +4 -4
- package/dist/chunks/studio-x3z3rhej.js +5 -0
- package/dist/chunks/{studio-7qr8k0v2.js → studio-xb55kpmy.js} +4 -4
- package/dist/chunks/{studio-f3awr5nc.js → studio-xxtdajmv.js} +7 -7
- package/dist/chunks/{studio-1a7zshnv.js → studio-xxttcym1.js} +4 -4
- package/dist/chunks/{studio-czpmzs9r.js → studio-y2zsnzye.js} +7 -7
- package/dist/chunks/{studio-9f5vcb4w.js → studio-y3tjh2xb.js} +3 -3
- package/dist/chunks/studio-y4f1rdsj.js +5 -0
- package/dist/chunks/studio-ybkd5w8k.js +5 -0
- package/dist/chunks/{studio-cv6gnjqd.js → studio-yetr4gg1.js} +4 -4
- package/dist/chunks/{studio-ehj3csbm.js → studio-z295anhs.js} +5 -5
- package/dist/chunks/{studio-pte5w7rf.js → studio-z89e6wpg.js} +8 -8
- package/dist/chunks/{studio-4z0cdh16.js → studio-zbwr6prc.js} +3 -3
- package/dist/chunks/{studio-w3aafbpk.js → studio-zdbsv5q2.js} +3 -3
- package/dist/chunks/{studio-eq5vqn1q.js → studio-zvthj8hg.js} +4 -4
- package/dist/chunks/toast-2kn2vrn4.js +4 -0
- package/dist/chunks/{toast-host-g3r2s0kn.js → toast-host-3rxeyj3d.js} +3 -3
- package/dist/chunks/{tooltip-gtx40bjg.js → tooltip-ghkxkasp.js} +2 -2
- package/dist/chunks/{tree-a19s1c05.js → tree-vw4nc63s.js} +2 -2
- package/dist/chunks/{tsMode-3f116hth.js → tsMode-7gngmamr.js} +7 -7
- package/dist/chunks/workspace-gv0hxgsm.js +4 -0
- package/dist/chunks/workspace-home-j7e0mjy5.js +4 -0
- package/dist/chunks/{ws-client-cb49m87s.js → ws-client-vs11sxc5.js} +3 -3
- package/dist/iframe-entry.js +14 -14
- package/dist/manifest.json +84 -83
- package/dist/studio.js +80 -80
- package/package.json +12 -12
- package/src/browse/preview-style.ts +2 -1
- package/src/canvas/canvas-render.ts +6 -1
- package/src/canvas/iframe-drop.ts +84 -1
- package/src/canvas/iframe-entry.ts +9 -6
- package/src/canvas/iframe-render.ts +13 -0
- package/src/collab/collab-session.ts +2 -2
- package/src/commands/levels.ts +1 -1
- package/src/create/add-new-flow.ts +2 -1
- package/src/editor/convert-targets.ts +2 -23
- package/src/editor/slash-menu.ts +35 -17
- package/src/files/files.ts +18 -0
- package/src/format/format-choices.ts +5 -5
- package/src/format/format-host.ts +35 -3
- package/src/grid/redirects-grid.ts +4 -4
- package/src/locale/element-names.ts +131 -0
- package/src/panels/dnd.ts +3 -1
- package/src/panels/elements-panel.ts +93 -36
- package/src/panels/imports-panel.ts +3 -2
- package/src/panels/navigator-panels.ts +10 -10
- package/src/panels/panel-registry.ts +3 -3
- package/src/panels/site-panel.ts +2 -1
- package/src/panels/style-panel.ts +2 -1
- package/src/panels/styles-panel.ts +2 -2
- package/src/platforms/cloud.ts +5 -2
- package/src/services/ai-command-tools.ts +2 -1
- package/src/services/ai-project-tools.ts +18 -5
- package/src/services/jxn-language.ts +110 -0
- package/src/services/model-uri.ts +3 -0
- package/src/services/monaco-setup.ts +6 -2
- package/src/settings/contributed-section.ts +2 -1
- package/src/settings/extension-commands.ts +2 -1
- package/src/settings/general-settings.ts +2 -2
- package/src/settings/settings-document.ts +5 -5
- package/src/shell.ts +1 -1
- package/src/studio.ts +28 -11
- package/src/style/variables-view.ts +2 -2
- package/src/surfaces/panel-elements.json +466 -206
- package/src/surfaces/panel-elements.ts +61 -25
- package/src/tabs/project-config.ts +13 -13
- package/src/tabs/tab.ts +7 -2
- package/src/types.ts +11 -2
- package/src/view.ts +9 -2
- package/src/workspace/tab-workspace.ts +2 -2
- package/src/workspace/workspace-back.ts +2 -2
- package/dist/chunks/adapter-12dxr3z7.js +0 -4
- package/dist/chunks/add-new-flow-any4pw2q.js +0 -4
- package/dist/chunks/cf-settings-hbj16kh3.js +0 -4
- package/dist/chunks/color-thzpppyc.js +0 -4
- package/dist/chunks/components-a98hzqw9.js +0 -4
- package/dist/chunks/content-source-jq3fjs3w.js +0 -4
- package/dist/chunks/convert-to-repeater-g66r6qp1.js +0 -4
- package/dist/chunks/editor-rth1rzj8.js +0 -4
- package/dist/chunks/entry-commands-02j0s19w.js +0 -4
- package/dist/chunks/extension-sections-rqrs7dr0.js +0 -4
- package/dist/chunks/file-ops-6a49er4c.js +0 -4
- package/dist/chunks/files-b2p9y0yz.js +0 -4
- package/dist/chunks/format-host-7xe57k1s.js +0 -4
- package/dist/chunks/fs-events-0xsy168g.js +0 -4
- package/dist/chunks/grid-open-h3q4fjy5.js +0 -4
- package/dist/chunks/iframe-entry-m24fza30.js +0 -5
- package/dist/chunks/iframe-host-8jcmaktg.js +0 -4
- package/dist/chunks/index-7nj2375a.js +0 -4
- package/dist/chunks/jx-validate-808zgbgy.js +0 -4
- package/dist/chunks/layers-0ffdtqjn.js +0 -4
- package/dist/chunks/layers-panel-rw62wtvf.js +0 -4
- package/dist/chunks/lit-html-9bz9rcfv.js +0 -4
- package/dist/chunks/media-library-2a5hdbek.js +0 -4
- package/dist/chunks/media-open-069kzhj4.js +0 -4
- package/dist/chunks/media-picker-4p4pd28y.js +0 -4
- package/dist/chunks/monaco-buffer-m9fd2dka.js +0 -4
- package/dist/chunks/monaco-setup-e0crh3v6.js +0 -4
- package/dist/chunks/notify-re3js157.js +0 -4
- package/dist/chunks/parse-hee7ne9b.js +0 -4
- package/dist/chunks/platform-rywy3tkg.js +0 -4
- package/dist/chunks/publish-panel-czkpg8m4.js +0 -4
- package/dist/chunks/publish-quick-b9wbhqj6.js +0 -4
- package/dist/chunks/publish-workspace-yy6d23b7.js +0 -4
- package/dist/chunks/quick-search-tp7pjnmv.js +0 -4
- package/dist/chunks/references-wd2yj8s1.js +0 -4
- package/dist/chunks/right-panel-x971k0zc.js +0 -4
- package/dist/chunks/source-control-k4p00hpe.js +0 -4
- package/dist/chunks/studio-1d8m5s38.js +0 -16
- package/dist/chunks/studio-35pmfjtx.js +0 -5
- package/dist/chunks/studio-44xqe0b7.js +0 -4
- package/dist/chunks/studio-48yzqzqr.js +0 -5
- package/dist/chunks/studio-5rq3e4q5.js +0 -5
- package/dist/chunks/studio-6hcfm9q3.js +0 -5
- package/dist/chunks/studio-6mf31e16.js +0 -5
- package/dist/chunks/studio-8w5pa88p.js +0 -7
- package/dist/chunks/studio-9c6cbq2c.js +0 -4
- package/dist/chunks/studio-aaw7wxv8.js +0 -5
- package/dist/chunks/studio-afx9brsc.js +0 -5
- package/dist/chunks/studio-dmgh2rrj.js +0 -5
- package/dist/chunks/studio-erjccagy.js +0 -5
- package/dist/chunks/studio-ex1644g2.js +0 -5
- package/dist/chunks/studio-gw83z798.js +0 -7
- package/dist/chunks/studio-j52ks8q7.js +0 -5
- package/dist/chunks/studio-kefs4sz4.js +0 -5
- package/dist/chunks/studio-m3jrjfhy.js +0 -14
- package/dist/chunks/studio-n4pnf0sw.js +0 -5
- package/dist/chunks/studio-ncwx602y.js +0 -5
- package/dist/chunks/studio-nzp0sqjg.js +0 -5
- package/dist/chunks/studio-ph17an19.js +0 -5
- package/dist/chunks/studio-q509sqt8.js +0 -5
- package/dist/chunks/studio-s49y6m5b.js +0 -5
- package/dist/chunks/studio-t46rt6gx.js +0 -5
- package/dist/chunks/studio-veh91hjv.js +0 -5
- package/dist/chunks/studio-vswmz40d.js +0 -6
- package/dist/chunks/studio-w4mfaaam.js +0 -5
- package/dist/chunks/studio-x5py815g.js +0 -5
- package/dist/chunks/studio-z6s56dzz.js +0 -5
- package/dist/chunks/studio-ze1sm147.js +0 -7
- package/dist/chunks/studio-zn7ysyzb.js +0 -5
- package/dist/chunks/toast-w11qpkyz.js +0 -4
- package/dist/chunks/workspace-home-61n1jz3q.js +0 -4
- package/dist/chunks/workspace-sheek6zw.js +0 -4
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* The Insert surface: the Navigator's element palette, as a Jx document over the kit.
|
|
4
4
|
*
|
|
5
|
-
* This is the adapter. `panels/elements-panel.ts` keeps the panel — what the palette contains,
|
|
6
|
-
* which npm components the open document has enabled, what the filter
|
|
7
|
-
* inserts where — and hands this module a projection with no decisions
|
|
8
|
-
*
|
|
9
|
-
* one of three empty states
|
|
5
|
+
* This is the adapter. `panels/elements-panel.ts` keeps the panel — what the palette contains, what
|
|
6
|
+
* each element is called, which npm components the open document has enabled, what the filter
|
|
7
|
+
* matches, and what a click inserts where — and hands this module a projection with no decisions
|
|
8
|
+
* left in it: the tab that is showing, a section per category that already knows whether it is
|
|
9
|
+
* open, a named card per thing that can be inserted, and the one of three empty states each tab is
|
|
10
|
+
* in.
|
|
10
11
|
*
|
|
11
12
|
* The flattening is here rather than in the document for the reason `surfaces/settings-overview.ts`
|
|
12
13
|
* gives: `$switch` over a value is the only conditional a document has, and "is there anything to
|
|
@@ -36,13 +37,18 @@ import type { SurfaceHandle } from "../ui/surface";
|
|
|
36
37
|
|
|
37
38
|
registerSurface("panel-elements", elementsDoc);
|
|
38
39
|
|
|
39
|
-
/** One insertable HTML element: the tag is its identity
|
|
40
|
+
/** One insertable HTML element: the tag is its identity and what a click inserts. */
|
|
40
41
|
export interface ElementCardView {
|
|
41
42
|
tag: string;
|
|
43
|
+
/** What the card is captioned, in the reader's language. */
|
|
44
|
+
name: string;
|
|
45
|
+
/** What the element is for, in one line: the card's tooltip. */
|
|
46
|
+
description: string;
|
|
42
47
|
}
|
|
43
48
|
|
|
44
|
-
/** One category of the palette
|
|
49
|
+
/** One category of the palette: an accordion section, keyed by a stable id, labelled by name. */
|
|
45
50
|
export interface ElementCategoryView {
|
|
51
|
+
key: string;
|
|
46
52
|
name: string;
|
|
47
53
|
open: boolean;
|
|
48
54
|
elements: ElementCardView[];
|
|
@@ -54,32 +60,44 @@ export interface ComponentCardView {
|
|
|
54
60
|
title: string;
|
|
55
61
|
}
|
|
56
62
|
|
|
63
|
+
/** The palette's two tabs (§5.3). */
|
|
64
|
+
export type InsertTab = "elements" | "components";
|
|
65
|
+
|
|
57
66
|
/**
|
|
58
|
-
* Which body
|
|
67
|
+
* Which body a tab is showing under the filter.
|
|
59
68
|
*
|
|
60
|
-
* `"filtered"` and `"empty"` are different answers rather than one with a flag: a
|
|
61
|
-
* matches offers to clear the filter, and a
|
|
62
|
-
*
|
|
69
|
+
* `"filtered"` and `"empty"` are different answers rather than one with a flag: a tab nothing
|
|
70
|
+
* matches offers to clear the filter, and a tab with nothing in it teaches what it is for, because
|
|
71
|
+
* there is no filter to clear.
|
|
63
72
|
*/
|
|
64
73
|
export type ElementsEmptyState = "none" | "filtered" | "empty";
|
|
65
74
|
|
|
66
75
|
/** What the panel says the surface should be showing right now. */
|
|
67
76
|
export interface ElementsValues {
|
|
77
|
+
/** The tab that is showing. */
|
|
78
|
+
tab: InsertTab;
|
|
68
79
|
/** What the filter field holds — the reader's own text, never a normalised form of it. */
|
|
69
80
|
filter: string;
|
|
81
|
+
/** The filter's accessible name and placeholder, which says what it narrows. */
|
|
82
|
+
filterLabel: string;
|
|
70
83
|
categories: ElementCategoryView[];
|
|
71
84
|
components: ComponentCardView[];
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
85
|
+
elementsEmpty: ElementsEmptyState;
|
|
86
|
+
componentsEmpty: ElementsEmptyState;
|
|
87
|
+
/**
|
|
88
|
+
* The other tab's offer when the filter empties this one but not that one ("Show 2 matching
|
|
89
|
+
* components"), or `""`.
|
|
90
|
+
*/
|
|
91
|
+
otherMatches: string;
|
|
75
92
|
}
|
|
76
93
|
|
|
77
94
|
/** What a control can ask the panel to do. Every one of them is a decision the panel owns. */
|
|
78
95
|
export interface ElementsActions {
|
|
96
|
+
selectTab: (tab: string) => void;
|
|
97
|
+
showOtherTab: () => void;
|
|
79
98
|
setFilter: (value: string) => void;
|
|
80
99
|
clearFilter: () => void;
|
|
81
|
-
setSectionOpen: (
|
|
82
|
-
setComponentsOpen: (open: boolean) => void;
|
|
100
|
+
setSectionOpen: (key: string, open: boolean) => void;
|
|
83
101
|
insertElement: (tag: string) => void;
|
|
84
102
|
insertComponent: (tagName: string) => void;
|
|
85
103
|
}
|
|
@@ -101,17 +119,29 @@ export interface ElementsSurfaceHandle {
|
|
|
101
119
|
dispose: () => void;
|
|
102
120
|
}
|
|
103
121
|
|
|
104
|
-
/**
|
|
105
|
-
|
|
122
|
+
/**
|
|
123
|
+
* The scope the document reads: {@link ElementsValues}, the flags a `$switch` and a tab panel's
|
|
124
|
+
* `active` need as their own values, and the actions its controls call.
|
|
125
|
+
*/
|
|
126
|
+
interface ElementsScope extends ElementsValues, ElementsActions {
|
|
127
|
+
elementsShowing: boolean;
|
|
128
|
+
componentsShowing: boolean;
|
|
129
|
+
hasOtherMatches: boolean;
|
|
130
|
+
}
|
|
106
131
|
|
|
107
132
|
/** Write a projection into the scope. */
|
|
108
133
|
function project(scope: ElementsScope, values: ElementsValues): void {
|
|
134
|
+
scope.tab = values.tab;
|
|
135
|
+
scope.elementsShowing = values.tab === "elements";
|
|
136
|
+
scope.componentsShowing = values.tab === "components";
|
|
109
137
|
scope.filter = values.filter;
|
|
138
|
+
scope.filterLabel = values.filterLabel;
|
|
110
139
|
scope.categories = values.categories;
|
|
111
140
|
scope.components = values.components;
|
|
112
|
-
scope.
|
|
113
|
-
scope.
|
|
114
|
-
scope.
|
|
141
|
+
scope.elementsEmpty = values.elementsEmpty;
|
|
142
|
+
scope.componentsEmpty = values.componentsEmpty;
|
|
143
|
+
scope.otherMatches = values.otherMatches;
|
|
144
|
+
scope.hasOtherMatches = values.otherMatches !== "";
|
|
115
145
|
}
|
|
116
146
|
|
|
117
147
|
/**
|
|
@@ -131,15 +161,21 @@ export function mountElementsSurface(
|
|
|
131
161
|
categories: [],
|
|
132
162
|
clearFilter: actions.clearFilter,
|
|
133
163
|
components: [],
|
|
134
|
-
|
|
135
|
-
|
|
164
|
+
componentsEmpty: "none",
|
|
165
|
+
componentsShowing: false,
|
|
166
|
+
elementsEmpty: "none",
|
|
167
|
+
elementsShowing: true,
|
|
136
168
|
filter: "",
|
|
137
|
-
|
|
169
|
+
filterLabel: "",
|
|
170
|
+
hasOtherMatches: false,
|
|
138
171
|
insertComponent: actions.insertComponent,
|
|
139
172
|
insertElement: actions.insertElement,
|
|
140
|
-
|
|
173
|
+
otherMatches: "",
|
|
174
|
+
selectTab: actions.selectTab,
|
|
141
175
|
setFilter: actions.setFilter,
|
|
142
176
|
setSectionOpen: actions.setSectionOpen,
|
|
177
|
+
showOtherTab: actions.showOtherTab,
|
|
178
|
+
tab: "elements",
|
|
143
179
|
});
|
|
144
180
|
project(scope, values);
|
|
145
181
|
|
|
@@ -65,7 +65,7 @@ import { getPlatform } from "../platform";
|
|
|
65
65
|
import { notify } from "../services/notify";
|
|
66
66
|
import { projectState, requireProjectState, setProjectState } from "../state";
|
|
67
67
|
import { setWorkspaceProject, workspace } from "../workspace/workspace";
|
|
68
|
-
import {
|
|
68
|
+
import { projectConfigPath, createTab, disposeTab } from "./tab";
|
|
69
69
|
import { transactDoc } from "./transact";
|
|
70
70
|
import { deriveJsonLayout, parseJsonDocument, serializeJson } from "@jxsuite/schema/json-layout";
|
|
71
71
|
import type { JsonLayout } from "@jxsuite/schema/json-layout";
|
|
@@ -73,7 +73,7 @@ import type { JsonLayout } from "@jxsuite/schema/json-layout";
|
|
|
73
73
|
import type { Tab } from "./tab";
|
|
74
74
|
import type { JxMutableNode, ProjectConfig } from "@jxsuite/schema/types";
|
|
75
75
|
|
|
76
|
-
export {
|
|
76
|
+
export { isProjectConfigPath, projectConfigPath } from "./tab";
|
|
77
77
|
|
|
78
78
|
/**
|
|
79
79
|
* The project configuration, as a file.
|
|
@@ -146,7 +146,7 @@ let _seeding: Promise<void> | null = null;
|
|
|
146
146
|
* structure in Studio uses (`collab-session.ts`'s `rawTab` for the same reason).
|
|
147
147
|
*/
|
|
148
148
|
function openConfigTab(): Tab | null {
|
|
149
|
-
const tab = workspace.tabs.get(
|
|
149
|
+
const tab = workspace.tabs.get(projectConfigPath());
|
|
150
150
|
return tab ? toRaw(tab) : null;
|
|
151
151
|
}
|
|
152
152
|
|
|
@@ -166,7 +166,7 @@ function unbind(): void {
|
|
|
166
166
|
function seedCommitted(): Promise<void> {
|
|
167
167
|
_seeding ??= (async () => {
|
|
168
168
|
try {
|
|
169
|
-
const text = await getPlatform().readFile(
|
|
169
|
+
const text = await getPlatform().readFile(projectConfigPath());
|
|
170
170
|
const { document, layout } = parseJsonDocument(text);
|
|
171
171
|
_layout = layout;
|
|
172
172
|
// {@link serializeProjectConfig}'s serialisation, over the file's parse rather than a config.
|
|
@@ -332,8 +332,8 @@ export function projectConfigDocument(): Tab {
|
|
|
332
332
|
}
|
|
333
333
|
_detached = createTab({
|
|
334
334
|
document: state.projectConfig ?? {},
|
|
335
|
-
documentPath:
|
|
336
|
-
id:
|
|
335
|
+
documentPath: projectConfigPath(),
|
|
336
|
+
id: projectConfigPath(),
|
|
337
337
|
});
|
|
338
338
|
return bind(_detached);
|
|
339
339
|
}
|
|
@@ -409,11 +409,11 @@ export async function commitProjectConfig(
|
|
|
409
409
|
never seen. Applying either one discards the other, so neither is applied: §16 files the
|
|
410
410
|
write that cannot be applied, which is the one outcome silence is not allowed to be.
|
|
411
411
|
`ai-project-tools.ts`'s `write_file` refuses a dirty tab on exactly these grounds. */
|
|
412
|
-
const error = new Error(`${
|
|
412
|
+
const error = new Error(`${projectConfigPath()} has unsaved changes in its editor tab`);
|
|
413
413
|
notify.error(
|
|
414
|
-
`Could not save ${
|
|
414
|
+
`Could not save ${projectConfigPath()} — the file is open with unsaved changes. Save or ` +
|
|
415
415
|
`revert that tab, then make the settings change again.`,
|
|
416
|
-
{ key: `save:${
|
|
416
|
+
{ key: `save:${projectConfigPath()}`, path: projectConfigPath(), source: "Settings" },
|
|
417
417
|
);
|
|
418
418
|
return { error, ok: false };
|
|
419
419
|
}
|
|
@@ -447,11 +447,11 @@ export async function commitProjectConfig(
|
|
|
447
447
|
const config = configOf(tab.doc.document);
|
|
448
448
|
const output = serializeProjectConfig(config);
|
|
449
449
|
try {
|
|
450
|
-
await getPlatform().writeFile(
|
|
450
|
+
await getPlatform().writeFile(projectConfigPath(), output);
|
|
451
451
|
} catch (error) {
|
|
452
|
-
notify.error(`Could not save ${
|
|
453
|
-
key: `save:${
|
|
454
|
-
path:
|
|
452
|
+
notify.error(`Could not save ${projectConfigPath()} — ${errorMessage(error)}`, {
|
|
453
|
+
key: `save:${projectConfigPath()}`,
|
|
454
|
+
path: projectConfigPath(),
|
|
455
455
|
source: "Settings",
|
|
456
456
|
});
|
|
457
457
|
return { error, ok: false };
|
package/src/tabs/tab.ts
CHANGED
|
@@ -11,6 +11,7 @@ import type { EditorKind } from "../commands/context";
|
|
|
11
11
|
import type { JsonObject, JxMutableNode } from "@jxsuite/schema/types";
|
|
12
12
|
import type { JxDocOp, JxFmOp } from "./patch-ops";
|
|
13
13
|
import type { JsonLayout } from "@jxsuite/schema/json-layout";
|
|
14
|
+
import { PROJECT_FILE_NAME, isProjectConfigPath } from "@jxsuite/schema/project-file";
|
|
14
15
|
|
|
15
16
|
/**
|
|
16
17
|
* The project's configuration file, project-relative.
|
|
@@ -20,7 +21,11 @@ import type { JsonLayout } from "@jxsuite/schema/json-layout";
|
|
|
20
21
|
* Variables and Code views; editor kind `config`), and `tabs/project-config.ts` binds the tab at
|
|
21
22
|
* this path as the configuration document.
|
|
22
23
|
*/
|
|
23
|
-
export
|
|
24
|
+
export function projectConfigPath(): string {
|
|
25
|
+
return PROJECT_FILE_NAME;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export { isProjectConfigPath } from "@jxsuite/schema/project-file";
|
|
24
29
|
|
|
25
30
|
export interface TabUi {
|
|
26
31
|
/** The Inspector leaf showing (`shell.ts`'s `INSPECTOR_TAB_IDS`); Page on a fresh tab (§6). */
|
|
@@ -448,7 +453,7 @@ export function createTab({
|
|
|
448
453
|
* @returns {string[]}
|
|
449
454
|
*/
|
|
450
455
|
function inferModes(documentPath: string | null | undefined, sourceFormat: string | null) {
|
|
451
|
-
if (documentPath
|
|
456
|
+
if (isProjectConfigPath(documentPath)) {
|
|
452
457
|
/* Elements, Variables and Code: the Styles workspace's three views. Spelled here rather than
|
|
453
458
|
imported from `style/project-styles` (`STYLES_TAB_MODES`), whose imports reach `store`,
|
|
454
459
|
which imports this module; `tests/project-config.test.ts` holds the two lists equal. */
|
package/src/types.ts
CHANGED
|
@@ -717,7 +717,7 @@ export interface StudioPlatform {
|
|
|
717
717
|
* announcing the intent — "opened in a new window" is a lie when the project was already open
|
|
718
718
|
* somewhere and that window merely came to the front.
|
|
719
719
|
*/
|
|
720
|
-
openProjectInNewWindow?: (root: string) => Promise<{ focused: boolean }>;
|
|
720
|
+
openProjectInNewWindow?: (root: string) => Promise<{ declined?: true; focused: boolean }>;
|
|
721
721
|
/**
|
|
722
722
|
* Pick a project WITHOUT binding this window to it — the answer to "which project", separated
|
|
723
723
|
* from the act of opening it here. Backs the New Window branch of Open Project: `openProject()`
|
|
@@ -733,7 +733,16 @@ export interface StudioPlatform {
|
|
|
733
733
|
* Point THIS window's backend at a project and return its config. If the project is already open
|
|
734
734
|
* in another window, that window is focused and `deduped` is true (no project is loaded here).
|
|
735
735
|
*/
|
|
736
|
-
setWindowProject?: (
|
|
736
|
+
setWindowProject?: (
|
|
737
|
+
root: string,
|
|
738
|
+
) => Promise<{ declined?: true; deduped: boolean; config: ProjectConfig | null }>;
|
|
739
|
+
/**
|
|
740
|
+
* Be told when the operating system asks this window to show a document, by its project-relative
|
|
741
|
+
* path. Includes anything asked before this was called, so a window that was opened for a
|
|
742
|
+
* document shows it once it has booted. Returns the unsubscribe. A platform with no operating
|
|
743
|
+
* system to hand it files omits it.
|
|
744
|
+
*/
|
|
745
|
+
subscribeOpenDocument?: (handler: (path: string) => void) => () => void;
|
|
737
746
|
/** The project root this window's backend is currently bound to. */
|
|
738
747
|
getProjectRoot?: () => Promise<{ root: string | null }>;
|
|
739
748
|
// ─── Recent projects (backend-persisted; undefined on dev-server) ───────────
|
package/src/view.ts
CHANGED
|
@@ -97,7 +97,13 @@ interface ViewState {
|
|
|
97
97
|
blockActionBarEl: HTMLElement | null;
|
|
98
98
|
selDragCleanup: (() => void) | null;
|
|
99
99
|
dndCleanups: (() => void)[];
|
|
100
|
-
|
|
100
|
+
/** The Insert palette's tab (§5.3). */
|
|
101
|
+
insertTab: "elements" | "components";
|
|
102
|
+
/**
|
|
103
|
+
* The Insert palette's sections the reader has opened or closed, by category key. A key not here
|
|
104
|
+
* takes its default: open, except the categories that start closed.
|
|
105
|
+
*/
|
|
106
|
+
elementsOpen: Map<string, boolean>;
|
|
101
107
|
elementsFilter: string;
|
|
102
108
|
_currentDropTargetRow: HTMLElement | null;
|
|
103
109
|
layerDragSourceHeight: number;
|
|
@@ -119,7 +125,8 @@ export const view: ViewState = {
|
|
|
119
125
|
dndCleanups: [],
|
|
120
126
|
|
|
121
127
|
// Left panel / elements UI
|
|
122
|
-
|
|
128
|
+
insertTab: "elements",
|
|
129
|
+
elementsOpen: new Map(),
|
|
123
130
|
elementsFilter: "",
|
|
124
131
|
|
|
125
132
|
// Drag interaction
|
|
@@ -29,7 +29,7 @@ import { workspace } from "./workspace";
|
|
|
29
29
|
import { homeWorkspaceOfTabId } from "./workspace-ids";
|
|
30
30
|
import { parseGridTabId } from "../grid/grid-source";
|
|
31
31
|
import { collectionForFile } from "../content/collection-match";
|
|
32
|
-
import {
|
|
32
|
+
import { isProjectConfigPath } from "../tabs/tab";
|
|
33
33
|
import type { Pane } from "./workspace";
|
|
34
34
|
import type { WorkspaceId } from "./workspace-ids";
|
|
35
35
|
import type { Tab } from "../tabs/tab";
|
|
@@ -59,7 +59,7 @@ export function workspaceOfTab(tab: Tab): WorkspaceId {
|
|
|
59
59
|
// A data-table grid is the Data panel's, which is Design's; every other grid is content.
|
|
60
60
|
return grid.kind === "data" ? "design" : "content";
|
|
61
61
|
}
|
|
62
|
-
if (tab.documentPath
|
|
62
|
+
if (isProjectConfigPath(tab.documentPath)) {
|
|
63
63
|
return "styles";
|
|
64
64
|
}
|
|
65
65
|
/* A file-backed collection's file too: its grid is where its records are written, and the
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
24
|
import { shell, workspaceDrawsTabStrip } from "../shell";
|
|
25
|
-
import {
|
|
25
|
+
import { isProjectConfigPath } from "../tabs/tab";
|
|
26
26
|
import { tabOfPane } from "../canvas/canvas-surface";
|
|
27
27
|
import { workspace } from "./workspace";
|
|
28
28
|
import { workspaceOfTab } from "./tab-workspace";
|
|
@@ -72,7 +72,7 @@ export function backTargetOf(
|
|
|
72
72
|
return null;
|
|
73
73
|
}
|
|
74
74
|
if (id === "styles") {
|
|
75
|
-
if (tab.documentPath
|
|
75
|
+
if (!isProjectConfigPath(tab.documentPath) || tab.session.ui.canvasMode !== SOURCE_MODE) {
|
|
76
76
|
return null;
|
|
77
77
|
}
|
|
78
78
|
const mode = shell.stylebook.view;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{X}from"./studio-9c6cbq2c.js";import{p}from"./studio-xh6rf05g.js";import{w}from"./studio-bk0anq3b.js";import"./studio-4z0cdh16.js";import{Jt,Ut,Ih}from"./studio-m3jrjfhy.js";import"./studio-zav9hgb3.js";import{sn,nt,dt}from"./studio-cv6gnjqd.js";import{ae}from"./studio-q509sqt8.js";import{jt,Pa,lo,Ma}from"./studio-ex1644g2.js";import{jn,Wt,ln,gr}from"./studio-s49y6m5b.js";import"./studio-x5py815g.js";import{J0}from"./studio-15mfah02.js";import"./studio-wn2cmf9q.js";import"./studio-48yzqzqr.js";import"./studio-k05g7efh.js";import"./studio-pv1ts08p.js";import"./studio-c72v1kwc.js";import{Cr,rc}from"./studio-1d8m5s38.js";import"./studio-qarg1xf9.js";import"./studio-thgexj3w.js";import"./studio-gw83z798.js";import"./studio-z6s56dzz.js";import{us,Jc,La,Qs}from"./studio-td3h1644.js";import"./studio-zzgp5yka.js";import"./studio-j3bq30yz.js";import{ih,Xb}from"./studio-aaw7wxv8.js";import{De,oy}from"./studio-43pynnhz.js";import"./studio-czpmzs9r.js";import"./studio-ek4fb4eb.js";import"./studio-ajfq4fmr.js";import"./studio-6sxnqqw8.js";import"./studio-g65t6svn.js";import"./studio-pgze9p34.js";import{A0,MT,Bw,j0,_i}from"./studio-ze1sm147.js";import"./studio-w3aafbpk.js";import"./studio-bpzwhn88.js";import"./studio-ep1384t9.js";import"./studio-k1wvtp03.js";import{xm}from"./studio-nngc45ct.js";import"./studio-4ncxzw5m.js";import"./studio-pte5w7rf.js";import"./studio-zkkt13qd.js";import{$E,aw}from"./studio-8w5pa88p.js";import{kb,Tw,Us,jc,v0,vm,$w,w0,cT,rl,x0,Hu,_0,mD,dT,wm,Eb,uT,hT,pT,gD,bD,S0}from"./studio-x5ffyssw.js";import{lb}from"./studio-nzp0sqjg.js";import{hb,Rd,Id}from"./studio-s4k1v7dt.js";import{pw,PE}from"./studio-5rq3e4q5.js";import"./studio-vswmz40d.js";import{ql}from"./studio-ph17an19.js";import{KT,Kw}from"./studio-6mf31e16.js";import"./studio-4jy967rj.js";import"./studio-w4mfaaam.js";import{x,wn}from"./studio-zn7ysyzb.js";import{ze,yt,E,I}from"./studio-1a7zshnv.js";import{b}from"./studio-9f5vcb4w.js";import{n,m}from"./studio-erjccagy.js";var R={$schema:"https://jxsuite.com/schema/v1",$id:"StudioAddNew",$description:"Add new: the one dialog that creates a page, a collection, a template, a component, a collection entry or an upload (`specs/studio.md` §9.1.1). One `jx-dialog`, so the platform owns modality, Escape, the backdrop and focus restoration. The kinds run down the left as a radiogroup and the chosen kind's name and options fill the right; the line above the buttons is the derived result, the same `deriveCreation` the write performs, so what it says is what is written. Nothing here composes a path, judges a name or knows a format: `create/add-new-flow.ts` keeps every decision and hands this document rows that are already strings, flags that are already booleans and a refusal that is already a sentence.",tagName:"jx-dialog",$props:{headline:"Add new",confirmLabel:{$ref:"#/state/cta"},confirmDisabled:{$ref:"#/state/blocked"},cancelLabel:"Cancel",size:"lg"},attributes:{part:"add-new","data-kind":"${state.kind}"},onconfirm:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/confirm"},value:[]}]},oncancel:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},onclose:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},ondragover:{$prototype:"Function",body:[{preventDefault:!0}]},ondrop:{$prototype:"Function",body:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/drop"},value:[{$ref:"event#/dataTransfer/files"}]}]},style:{$description:"The board's two columns in the kit's scale. The kinds take a fixed gutter so the right side does not move under the reader as they switch kinds, and the options column scrolls on its own so a long template list never pushes the result line and the buttons off the dialog. No part here is named `field`, `label`, `body`, `error`, `text` or `actions`: the kit is light DOM, and `jx-textfield`, `jx-select` and `jx-dialog` each draw internal nodes under those names inside this same tree.",'& [part="sheet"]':{display:"flex",gap:"var(--jx-space-5)",minHeight:"360px"},'& [part="kinds-column"]':{flex:"0 0 208px",display:"flex",flexDirection:"column",gap:"var(--jx-space-3)",borderRight:"1px solid var(--border)",paddingRight:"var(--jx-space-3)"},'& [part="kinds"]':{display:"flex",flexDirection:"column",alignItems:"stretch",gap:"var(--jx-space-1)"},'& [part="kind"]':{display:"block"},'& [part="kind"] > [part="control"]':{$description:"A kind is a row with its own two lines, so the button's box stretches across the gutter and starts its content at the left edge rather than centring an icon.",width:"100%",height:"auto",justifyContent:"flex-start",alignItems:"flex-start",textAlign:"start",padding:"var(--jx-space-2) var(--jx-space-3)",gap:"var(--jx-space-3)"},'& [part="kind-text"]':{display:"flex",flexDirection:"column",gap:"2px"},'& [part="kind-name"]':{fontSize:"var(--jx-text-md)",color:"var(--fg)"},'& [part="kind-hint"], & [part="choice-note"]':{fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)",whiteSpace:"normal"},'& [part="chord-note"], & [part="note"], & [part="kind-intro"], & [part="drop-summary"]':{margin:"0",fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)"},'& [part="chord-note"]':{marginTop:"auto"},'& [part="detail"]':{flex:"1",minWidth:"0",display:"flex",flexDirection:"column",gap:"var(--jx-space-4)",maxHeight:"60vh",overflowY:"auto"},'& [part="options"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-3)"},'& [part="name-slot"], & [part="options-slot"], & [part="url-slot"], & [part="own-page-slot"], & [part="copy-slot"], & [part="locale-slot"], & [part="localized-slot"]':{$description:"Branch hosts are structure rather than layout: `display: contents` puts what they carry straight into the column, so one gap rule spaces every row whether it is drawn or not.",display:"contents"},'& [part="group-label"]':{margin:"0",fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)"},'& [part="url-row"], & [part="pattern-row"]':{display:"flex",flexWrap:"wrap",alignItems:"center",gap:"var(--jx-space-2)"},'& [part="url-label"]':{fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)"},'& [part="route"], & [part="pattern"]':{fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-sm)",color:"var(--fg)"},'& [part="start-row"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-2)"},'& [part="start-from"], & [part="wrap-in"], & [part="component-start"]':{display:"flex",flexWrap:"wrap",gap:"var(--jx-space-2)"},'& [part="choice-card"] > [part="control"]':{$description:"A choice is a card with a name and a note, as the board draws it: its own two lines inside one radio, so the reader hears one name and sees both.",minWidth:"132px",height:"auto",flexDirection:"column",alignItems:"flex-start",textAlign:"start",padding:"var(--jx-space-2) var(--jx-space-3)",gap:"2px"},'& [part="choice-name"]':{display:"block",fontSize:"var(--jx-text-md)",color:"var(--fg)"},'& [part="choice-note"]':{display:"block"},'& [part="presets"]':{display:"flex",flexWrap:"wrap",gap:"var(--jx-space-2)"},'& [part="drop"]':{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"var(--jx-space-2)",minHeight:"200px",padding:"var(--jx-space-5)",border:"1px dashed var(--border)",borderRadius:"var(--radius)",textAlign:"center"},'& [part="drop"][data-drop="true"]':{borderColor:"var(--accent)",background:"var(--accent-10)"},'& [part="drop-title"]':{margin:"0",fontSize:"var(--jx-text-md)",color:"var(--fg)"},'& [part="browse"]':{display:"inline-flex",alignItems:"center",gap:"var(--jx-space-2)",padding:"var(--jx-space-1) var(--jx-space-3)",border:"1px solid var(--border)",borderRadius:"var(--radius)",color:"var(--fg)",cursor:"pointer"},'& [part="browse"]:focus-within':{outline:"var(--jx-focus-ring)",outlineOffset:"2px"},'& [part="browse-input"]':{$description:"Visually hidden, never `display: none`: the input is the control, and a hidden-from-layout one cannot take focus from the keyboard. The label around it is what is drawn and what is clicked.",position:"absolute",width:"1px",height:"1px",opacity:"0",overflow:"hidden"},'& [part="saved"]':{margin:"0",paddingTop:"var(--jx-space-3)",borderTop:"1px solid var(--border)",fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)",overflowWrap:"anywhere"}},children:[{tagName:"div",attributes:{part:"sheet"},children:[{tagName:"div",attributes:{part:"kinds-column"},children:[{tagName:"jx-action-group",attributes:{part:"kinds"},$props:{selects:"single",label:"What to create",orientation:"vertical",compact:!1},children:[{$prototype:"Array",items:{$ref:"#/state/kinds"},key:{$ref:"$map/item/id"},map:{tagName:"jx-action-button",attributes:{part:"kind","data-kind":"${$map.item.id}"},$props:{label:{$ref:"$map/item/label"},icon:{$ref:"$map/item/icon"},checked:{$ref:"$map/item/checked"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/pickKind"},value:[{$ref:"$map/item/id"}]}]},children:[{tagName:"span",attributes:{part:"kind-text"},children:[{tagName:"span",attributes:{part:"kind-name"},textContent:"${$map.item.label}"},{tagName:"span",attributes:{part:"kind-hint"},textContent:"${$map.item.hint}"}]}]}}]},{tagName:"p",attributes:{part:"chord-note"},textContent:"${state.chordNote}"}]},{tagName:"section",attributes:{part:"detail","aria-label":"${state.kindLabel}"},children:[{tagName:"p",attributes:{part:"kind-intro"},textContent:"${state.kindHint}"},{tagName:"div",attributes:{part:"name-slot",role:"none"},$switch:{$ref:"#/state/named"},cases:{true:{tagName:"jx-field",attributes:{part:"name-row"},$props:{span:!0,label:{$ref:"#/state/nameLabel"},invalid:{$ref:"#/state/invalid"}},children:[{tagName:"jx-textfield",attributes:{part:"name"},$props:{value:{$ref:"#/state/name"},placeholder:{$ref:"#/state/placeholder"},invalid:{$ref:"#/state/invalid"},error:{$ref:"#/state/error"},required:!0,autocomplete:"off"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setName"},value:[{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{Enter:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/confirm"},value:[]}]}}]}}]}}},{tagName:"div",attributes:{part:"options-slot",role:"none"},$switch:{$ref:"#/state/kind"},cases:{page:{tagName:"div",attributes:{part:"options",role:"none"},children:[{tagName:"div",attributes:{part:"locale-slot",role:"none"},$switch:{$ref:"#/state/localeShown"},cases:{true:{tagName:"jx-field",attributes:{part:"locale-row"},$props:{span:!0,label:"Language"},children:[{tagName:"jx-select",attributes:{part:"locale"},$props:{size:"sm",label:"Language",options:{$ref:"#/state/localeOptions"},value:{$ref:"#/state/locale"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/pickLocale"},value:[{$ref:"event#/target/value"}]}]}}]}}},{tagName:"div",attributes:{part:"url-row"},children:[{tagName:"span",attributes:{part:"url-label"},textContent:"URL"},{tagName:"code",attributes:{part:"route"},textContent:"${state.route}"},{tagName:"jx-action-button",attributes:{part:"edit-url"},$props:{label:"Edit URL",toggles:!0,selected:{$ref:"#/state/editingUrl"},size:"sm"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/toggleUrl"},value:[]}]},children:[{tagName:"span",textContent:"Edit"}]}]},{tagName:"div",attributes:{part:"url-slot",role:"none"},$switch:{$ref:"#/state/editingUrl"},cases:{true:{tagName:"jx-field",attributes:{part:"url-row-field"},$props:{span:!0,label:"URL"},children:[{tagName:"jx-textfield",attributes:{part:"url"},$props:{size:"sm",mono:!0,value:{$ref:"#/state/url"},placeholder:"/pricing"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setUrl"},value:[{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{Enter:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/confirm"},value:[]}]}}]}}]}}},{tagName:"div",attributes:{part:"start-row"},children:[{tagName:"p",attributes:{part:"group-label"},textContent:"Start from"},{tagName:"jx-action-group",attributes:{part:"start-from"},$props:{selects:"single",label:"Start from",compact:!1},children:[{$prototype:"Array",items:{$ref:"#/state/startChoices"},key:{$ref:"$map/item/value"},map:{tagName:"jx-action-button",attributes:{part:"choice-card","data-value":"${$map.item.value}"},$props:{label:{$ref:"$map/item/label"},checked:{$ref:"$map/item/checked"},disabled:{$ref:"$map/item/disabled"},hint:{$ref:"$map/item/reason"},quiet:!1},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/pickStart"},value:[{$ref:"$map/item/value"}]}]},children:[{tagName:"span",attributes:{part:"choice-name"},textContent:"${$map.item.label}"},{tagName:"span",attributes:{part:"choice-note"},textContent:"${$map.item.note}"}]}}]}]}]},collection:{tagName:"div",attributes:{part:"options",role:"none"},children:[{tagName:"p",attributes:{part:"group-label"},textContent:"Each ${state.itemNoun} has"},{tagName:"jx-action-group",attributes:{part:"presets"},$props:{selects:"multiple",label:"Fields",compact:!1},children:[{$prototype:"Array",items:{$ref:"#/state/presets"},key:{$ref:"$map/item/id"},map:{tagName:"jx-action-button",attributes:{part:"preset","data-preset":"${$map.item.id}"},$props:{label:{$ref:"$map/item/label"},toggles:!0,selected:{$ref:"$map/item/selected"},quiet:!1,size:"sm",icon:{$ref:"$map/item/icon"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/togglePreset"},value:[{$ref:"$map/item/id"}]}]},children:[{tagName:"span",textContent:"${$map.item.label}"}]}}]},{tagName:"p",attributes:{part:"note"},textContent:"You can add or change fields later."},{tagName:"div",attributes:{part:"localized-slot",role:"none"},$switch:{$ref:"#/state/localizable"},cases:{true:{tagName:"jx-checkbox",attributes:{part:"localized"},$props:{checked:{$ref:"#/state/localized"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setLocalized"},value:[{$ref:"event#/target/checked"}]}]},children:[{tagName:"span",textContent:"One folder per language (${state.localeSummary})"}]}}},{tagName:"jx-checkbox",attributes:{part:"own-page"},$props:{checked:{$ref:"#/state/ownPage"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setOwnPage"},value:[{$ref:"event#/target/checked"}]}]},children:[{tagName:"span",textContent:"Give each ${state.itemNoun} its own page"}]},{tagName:"div",attributes:{part:"own-page-slot",role:"none"},$switch:{$ref:"#/state/ownPage"},cases:{true:{tagName:"div",attributes:{part:"pattern-row"},children:[{tagName:"span",attributes:{part:"url-label"},textContent:"at"},{tagName:"code",attributes:{part:"pattern"},textContent:"${state.pattern}"},{tagName:"span",attributes:{part:"url-label"},textContent:"using"},{tagName:"jx-select",attributes:{part:"page-template"},$props:{size:"sm",label:"Template for each page",options:{$ref:"#/state/templateOptions"},value:{$ref:"#/state/pageTemplate"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/pickPageTemplate"},value:[{$ref:"event#/target/value"}]}]}}]}}}]},template:{tagName:"div",attributes:{part:"options",role:"none"},children:[{tagName:"p",attributes:{part:"group-label"},textContent:"Wrap it in"},{tagName:"jx-action-group",attributes:{part:"wrap-in"},$props:{selects:"single",label:"Wrap it in",compact:!1},children:[{$prototype:"Array",items:{$ref:"#/state/wrapChoices"},key:{$ref:"$map/item/value"},map:{tagName:"jx-action-button",attributes:{part:"choice-card","data-value":"${$map.item.value}"},$props:{label:{$ref:"$map/item/label"},checked:{$ref:"$map/item/checked"},disabled:{$ref:"$map/item/disabled"},hint:{$ref:"$map/item/reason"},quiet:!1},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/pickWrap"},value:[{$ref:"$map/item/value"}]}]},children:[{tagName:"span",attributes:{part:"choice-name"},textContent:"${$map.item.label}"},{tagName:"span",attributes:{part:"choice-note"},textContent:"${$map.item.note}"}]}}]},{tagName:"p",attributes:{part:"note"},textContent:"Pages placed in this template fill its Content area. You can add more named areas later."}]},component:{tagName:"div",attributes:{part:"options",role:"none"},children:[{tagName:"p",attributes:{part:"group-label"},textContent:"Start from"},{tagName:"jx-action-group",attributes:{part:"component-start"},$props:{selects:"single",label:"Start from",compact:!1},children:[{$prototype:"Array",items:{$ref:"#/state/componentChoices"},key:{$ref:"$map/item/value"},map:{tagName:"jx-action-button",attributes:{part:"choice-card","data-value":"${$map.item.value}"},$props:{label:{$ref:"$map/item/label"},checked:{$ref:"$map/item/checked"},disabled:{$ref:"$map/item/disabled"},hint:{$ref:"$map/item/reason"},quiet:!1},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/pickComponentStart"},value:[{$ref:"$map/item/value"}]}]},children:[{tagName:"span",attributes:{part:"choice-name"},textContent:"${$map.item.label}"},{tagName:"span",attributes:{part:"choice-note"},textContent:"${$map.item.note}"}]}}]},{tagName:"div",attributes:{part:"copy-slot",role:"none"},$switch:{$ref:"#/state/copying"},cases:{true:{tagName:"jx-field",attributes:{part:"copy-row"},$props:{span:!0,label:"Copy of"},children:[{tagName:"jx-select",attributes:{part:"copy-of"},$props:{size:"sm",label:"Component to copy",options:{$ref:"#/state/copyOptions"},value:{$ref:"#/state/copyOf"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/pickCopy"},value:[{$ref:"event#/target/value"}]}]}}]}}},{tagName:"p",attributes:{part:"note"},textContent:"It appears under Components in the Site panel, ready to drag onto any page."}]},entry:{tagName:"div",attributes:{part:"options",role:"none"},children:[{tagName:"jx-field",attributes:{part:"collection-row"},$props:{span:!0,label:"Collection"},children:[{tagName:"jx-select",attributes:{part:"collection"},$props:{size:"sm",label:"Collection",options:{$ref:"#/state/collectionOptions"},value:{$ref:"#/state/collection"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/pickCollection"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"div",attributes:{part:"locale-slot",role:"none"},$switch:{$ref:"#/state/localeShown"},cases:{true:{tagName:"jx-field",attributes:{part:"locale-row"},$props:{span:!0,label:"Language"},children:[{tagName:"jx-select",attributes:{part:"locale"},$props:{size:"sm",label:"Language",options:{$ref:"#/state/localeOptions"},value:{$ref:"#/state/locale"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/pickLocale"},value:[{$ref:"event#/target/value"}]}]}}]}}}]},media:{tagName:"div",attributes:{part:"drop","data-drop":"${state.dropActive}"},ondragover:{$prototype:"Function",body:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/dragOver"},value:[]}]},ondragleave:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/dragOut"},value:[]}]},children:[{tagName:"jx-icon",attributes:{part:"drop-glyph"},$props:{name:"upload-simple"}},{tagName:"p",attributes:{part:"drop-title"},textContent:"Drop images, video or documents"},{tagName:"label",attributes:{part:"browse"},children:[{tagName:"input",attributes:{part:"browse-input",type:"file",multiple:!0,accept:"${state.uploadAccept}"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/choose"},value:[{$ref:"event#/target"}]}]}},{tagName:"span",textContent:"Browse files"}]},{tagName:"p",attributes:{part:"drop-summary"},textContent:"${state.fileSummary}"}]}}}]}]},{tagName:"p",attributes:{part:"saved","aria-live":"polite"},textContent:"${state.saved}"}]};E("add-new",R);function T(e){return{...e,blocked:!e.canConfirm,invalid:e.error!=="",named:e.kind!=="media"}}function z(e){let t=document.createElement("div");t.style.pointerEvents="auto",t.setAttribute(ze,yt("dialog","add-new")),e.layer.append(t);let r=!1,o=()=>{if(r)return;r=!0,e.actions.closed()},l=()=>r,{actions:a}=e,d=b({...T(e.view),choose:a.choose,closed:o,confirm:a.confirm,dragOut:a.dragOut,dragOver:a.dragOver,drop:a.drop,pickCollection:a.pickCollection,pickComponentStart:a.pickComponentStart,pickCopy:a.pickCopy,pickKind:a.pickKind,pickLocale:a.pickLocale,pickPageTemplate:a.pickPageTemplate,pickStart:a.pickStart,pickWrap:a.pickWrap,setName:(u)=>{d.name=u,a.setName(u)},setLocalized:a.setLocalized,setOwnPage:a.setOwnPage,setUrl:(u)=>{d.url=u,a.setUrl(u)},toggleUrl:a.toggleUrl,togglePreset:a.togglePreset}),g=null,f=()=>{setTimeout(()=>{let u=g?.root;if(r||!(u instanceof HTMLElement))return;let c=u.querySelector('jx-textfield[part="name"]');if(c)Ih(c,"all")},0)},v=I("add-new",d,t).then(async(u)=>{g=u;let c=u.root;if(l())return u.dispose(),c;if(await sn(c),l())return c;if(Jt(c),d.named)f();return c});return{close(){let u=g?.root;if(u instanceof HTMLElement)Ut(u);g?.dispose(),g=null,t.remove(),o()},host:t,ready:v,update(u){Object.assign(d,T(u))}}}var N="Add new";async function W(){return(await $E()).map((t)=>({name:t.name,ref:t.path})).toSorted((t,r)=>t.name.localeCompare(r.name))}function _(){for(let e of A0("page")){if(e.ext===".json")continue;let t=Pa(e.ext,"serialize");if(t)return{ext:e.ext,name:t.name}}return null}function B(){let e=lo(),t=e?.extensions[0];return e&&t?{ext:t,name:e.name}:null}function J(){return ln(x?.projectConfig??{}).i18n}async function V(e){let t={},{i18n:r}=ln(x?.projectConfig??{});for(let o of await J0(e)){let l=jn(gr(o,r));if(l!==null)t[l]=o}return t}async function L(){await jt().catch(()=>{});let e=await Promise.all(Kw().map(async(t)=>{let r={dir:t.dir,ext:t.ext,formatName:S0(t),name:t.name,schema:t.schema};if(Eb(t))r.localeDirs=await V(t);return r}));return{i18n:J(),article:_(),collections:e,componentTags:De.map((t)=>t.tagName),copyableTags:De.filter((t)=>D(t)).map((t)=>t.tagName),contentFormat:B(),declaredContent:KT(),defaultLayout:x?.projectConfig?.defaults?.layout??null,hasSelection:pw()!==null,layouts:await W()}}function D(e){let{path:t}=e;return n(t)&&e.source!=="npm"&&t.endsWith(".json")}async function Y(){let e=new Map;for(let t of De){let{path:r}=t;if(!D(t)||!n(r))continue;try{let o=JSON.parse(await p().readFile(r));if(m(o))e.set(t.tagName,o)}catch{}}return e}function U(e,t){let r=e.trim();if(r===Us||r==="none"||r==="")return Us;if(r===jc)return jc;let o=rl(r);return t.find((a)=>rl(a.ref)===o||rl(a.ref)===`layouts/${o}`||rl(a.ref)===`layouts/${o}.json`||a.name.toLowerCase()===r.toLowerCase())?.ref??null}function G(e,t){let r={};if(e.collection!==void 0)r.collection=e.collection;if(e.locale!==void 0){if(wm(e.locale,t)===null){let o=t.i18n?.locales??[];throw RangeError(`command "file.new" argument "locale": "${e.locale}" is not a language this `+`project declares — declared: ${o.length===0?"none":o.join(", ")}`)}r.locale=e.locale}if(e.template!==void 0){let o=U(e.template,t.layouts);if(o===null){let l=t.layouts.map((a)=>rl(a.ref));throw RangeError(`command "file.new" argument "template": "${e.template}" names no template — `+`declared: ${[Us,jc,...l].join(", ")}`)}if(e.kind==="collection")r.pageTemplate=o===jc?Us:o;else if(e.kind==="template")r.startFrom=o===Us||o===jc?"":o;else r.startFrom=o}return r}async function Q(e){if(e.format===null)return Cr(e.doc,null);return Ma(e.format,e.doc,{frontmatter:e.frontmatter??!0,mode:"roundtrip"})}async function F(e,t,r=!1){for(let o of gD(pT(e)))await Promise.all(o.map(async(l)=>{if(!r&&t.has(l))return;t.set(l,bD(l,t)?new Set:await Bw(l))}))}function S(e){if(lb(e),Id(),e.some((t)=>t.startsWith("pages/")))Xb(),hb();MT(e).then((t)=>{if(t)Id(),wn("leftPanel")})}async function P(e,t,r){let o;try{o=await Q(t)}catch(l){throw w.error(`Could not prepare ${e}.`,{detail:X(l),path:e,source:N}),Error(`could not prepare ${e}`,{cause:l})}if(await j0(e,o,{quiet:r,source:N})===null)throw Error(`could not write ${e}`)}async function Z(e){let t=e.config,r=x?.projectConfig?.content,o=m(r)?{...r}:{};if(o[t.name]=t.entry,!(await rc({content:o})).ok)return null;let a=["project.json"],d=[];for(let f of[{body:e.content,path:e.path},...e.extraWrites])try{await P(f.path,f.body,!0),a.push(f.path)}catch{d.push(f.path)}if(d.length===0)w.success(`Created the ${t.name} collection`);else w.warn(`Created the ${t.name} collection, but ${d.join(" and ")} could not be written.`,{source:N});S(a),xm(t.name),nt("content.showCollection",{collection:t.name},N);let g={kind:"collection",path:`content/${t.name}`,wrote:a};if(e.route!==void 0)g.route=e.route;return g}async function M(e,t,r){if(e.kind==="media"){let l=await Qs(r,{dir:La,only:"media"});if(l.length===0)return null;let a=l.map((d)=>d.path);return S(a),nt("media.browse",{select:l[0].path},N),{kind:"media",path:La,wrote:a}}if(e.kind==="collection")return Z(e);let o={kind:e.kind,path:e.path,wrote:[e.path]};if(e.route!==void 0)o.route=e.route;if(e.tag!==void 0)o.tag=e.tag;if(e.kind==="component"&&t.startFrom===v0){let l=await PE(e.tag);if(l===null)return null;return S([l]),await _i(l),o}try{await P(e.path,e.content,!1)}catch{return null}switch(S([e.path]),e.kind){case"component":{oy(e.path,e.content.doc),await _i(e.path);break}case"template":{aw(),await _i(e.path);break}case"entry":{if(t.collection!==void 0)xm(t.collection);await ql(e.path);break}default:await _i(e.path)}return o}async function Ve(e){let t=e.kind??"page";if(t==="media")throw RangeError('command "file.new": Media is uploaded, not named; run file.new { kind: "media" } with no name to open the upload drop zone.');let r=await L(),o=G({...e,kind:t},r);if(t==="entry"&&o.collection===void 0&&r.collections.length===1)o.collection=r.collections[0].name;let l=uT(t,e.name,o,r),a=new Map;await F(l,a,!0);let d=hT(l,e.name,o,r,(f)=>a.get(f));if(d!=="")throw RangeError(`command "file.new": ${d}`);let g=await M(l,o,[]);if(g===null)throw Error(`file.new could not create ${l.path}; the reason is in Problems.`);return g}async function Ye(e){let t=await L(),r=t.collections.find((f)=>f.name===e);if(!r)return w.error(`"${e}" is not a collection this project declares.`,{source:N}),null;let o=`pages/${us(e)||e}`,l=`${o}/[slug].json`;if((await Bw(o)).has("[slug].json"))return w.error(`${l} already exists.`,{detail:"Open it in Design and point its $paths at this collection, or rename it first.",path:l,source:N}),null;let d=mD(r.schema,r.formatName!==null),g=dT(e,d,x0(Hu(t),t),t);try{await P(l,{doc:g,format:null},!1)}catch{return null}return S([l]),l}function j(e){switch(e.kind){case"page":{let t={startFrom:e.pageStart};if(e.editingUrl)t.url=e.url;if(e.locale!=="")t.locale=e.locale;return t}case"template":return{startFrom:e.wrap};case"component":{let t={startFrom:e.componentStart};if(e.componentStart===vm&&e.copyOf!=="")t.copyOf=e.copyOf;return t}case"collection":return{fields:e.fields,localized:e.localized,ownPage:e.ownPage,pageTemplate:e.pageTemplate};case"entry":{let t={};if(e.collection!=="")t.collection=e.collection;if(e.locale!=="")t.locale=e.locale;return t}default:return{files:e.files.length}}}function y(e,t,r,o,l=""){return{checked:e===o?"true":"false",disabled:l!=="",label:t,note:r,reason:l,value:e}}function q(e,t){let r=t.layouts.map((o)=>y(o.ref,o.name,t.defaultLayout!==null&&rl(o.ref)===rl(t.defaultLayout)?"the site's default":"a template",e.pageStart));if(t.article!==null)r.push(y(jc,"Article","mostly writing",e.pageStart));return r.push(y(Us,"Blank","no template",e.pageStart)),r}function ee(){let e=pw();if(!e)return"nothing selected";let r=1+(Array.isArray(e.node.children)?e.node.children.length:0);return r===1?"1 element":`${r} elements`}function te(){let e=ae()?.keymap,t=e?.bindingsFor("file.new")??[];if(!e||t.length===0)return"";let[r,...o]=t.map((l)=>e.format(l));return o.length===0?`${r} opens this anywhere.`:`${r} opens this in the desktop app, ${o.join(" or ")} anywhere.`}function O(e,t,r,o){let l=Tw[e.kind],a=kb.filter((s)=>s!=="entry"||t.collections.length>0).map((s)=>({checked:s===e.kind?"true":"false",hint:Tw[s].hint,icon:Tw[s].icon,id:s,label:Tw[s].label})),d=r.config?.name??"",g=ih(d===""?"items":d),f=t.i18n?.locales??[],v=t.collections.find((s)=>s.name===e.collection),u=f.length>0&&(e.kind==="page"||e.kind==="entry"&&v!==void 0&&Eb(v)),c=[...t.layouts.map((s)=>({label:s.name,value:s.ref})),{label:"No template",value:Us}];return{canConfirm:o===""&&!e.busy,chordNote:te(),collection:e.collection,collectionOptions:t.collections.map((s)=>({label:Rd(s.name),value:s.name})),componentChoices:[y("blank","Blank","an empty block",e.componentStart),y(v0,"Current selection",ee(),e.componentStart,t.hasSelection===!0?"":"Select an element on the canvas first."),y(vm,"Copy of…","an existing one",e.componentStart,(t.copyableTags??[]).length>0?"":"This project has no components of its own to copy yet.")],copyOf:e.copyOf,copyOptions:[...t.componentDocs?.keys()??[]].map((s)=>({label:`<${s}>`,value:s})),copying:e.componentStart===vm,cta:l.cta,dropActive:e.dropActive?"true":"false",editingUrl:e.editingUrl,error:e.touched||e.kind==="media"?e.kind==="media"?"":o:"",fileSummary:e.files.length===0?"":e.files.map((s)=>s.name).join(", "),itemNoun:g,kind:e.kind,kindHint:l.hint,kindLabel:l.label,kinds:a,locale:e.locale,localeOptions:f.map((s)=>({label:Wt(s),value:s})),localeShown:u,localeSummary:f.join(", "),localizable:f.length>0,localized:e.localized,name:e.name,nameLabel:l.nameLabel,ownPage:e.ownPage,pageTemplate:e.pageTemplate,pattern:r.route??`/${d===""?"items":d}/:slug`,placeholder:l.placeholder,presets:$w.filter((s)=>s!=="richText"||t.contentFormat!==null).map((s)=>{let k=e.fields.includes(s);return{icon:k?"check":"plus",id:s,label:w0[s].label,selected:k}}),route:r.route===void 0||r.route===""?"/":r.route,saved:r.saved,startChoices:q(e,t),templateOptions:c,uploadAccept:Jc(),url:e.url,wrapChoices:[...t.layouts.map((s)=>y(s.ref,s.name,"keeps its frame around this one",e.wrap)),y("","Nothing","a fresh frame",e.wrap)]}}function oe(e,t){let r=e.kind??"page";return r==="entry"&&t.collections.length===0?"page":r}var A=null;function Ge(e={}){if(A)return A.done;let t,r=new Promise((l)=>{t=l}),o={done:r,handle:null};return A=o,ne(e,t,o),r}async function ne(e,t,r){let o=await L(),l=new Map,a={busy:!1,collection:e.collection??o.collections[0]?.name??"",locale:wm(e.locale,o)??o.i18n?.defaultLocale??"",localized:o.i18n!==null&&o.i18n!==void 0,componentStart:"blank",copyOf:"",dropActive:!1,editingUrl:!1,fields:[...cT],files:[],kind:oe(e,o),name:e.name??"",ownPage:!0,pageStart:_0(o,wm(e.locale,o)??o.i18n?.defaultLocale??""),pageTemplate:Hu(o),templateChosen:e.template!==void 0,touched:(e.name??"")!=="",url:"",wrap:Hu(o)===Us?"":Hu(o)};if(e.template!==void 0){let i=U(e.template,o.layouts);if(i!==null)a.pageStart=i,a.pageTemplate=i===jc?Us:i,a.wrap=i===Us||i===jc?"":i}if(o.contentFormat===null)a.fields=a.fields.filter((i)=>i!=="richText");let d=!1,g=null,f=()=>uT(a.kind,a.name,j(a),o),v=(i)=>hT(i,a.name,j(a),o,(h)=>l.get(h)),u=()=>{let i=f();if(r.handle?.update(O(a,o,i,v(i))),pT(i).some((h)=>!l.has(h)))F(i,l).then(()=>{if(!d){let h=f();r.handle?.update(O(a,o,h,v(h)))}})},c=(i)=>{i(),u()},s=async()=>{if(a.busy)return;a.touched=!0;let i=f();if(await F(i,l,!0),v(i)!==""){u();return}a.busy=!0,u();try{g=await M(i,j(a),a.files)}catch(C){w.error("Could not create it.",{detail:X(C),source:N}),g=null}if(a.busy=!1,g===null){u();return}r.handle?.close()},k=f(),K=z({actions:{choose:(i)=>{let h=[...i.files??[]];i.value="",c(()=>{a.files=[...a.files,...h]})},closed:()=>{if(d)return;d=!0,A=null,r.handle?.close(),t(g)},confirm:()=>{s()},dragOut:()=>{c(()=>{a.dropActive=!1})},dragOver:()=>{if(!a.dropActive)c(()=>{a.dropActive=!0})},drop:(i)=>{c(()=>{a.dropActive=!1;let h=i?[...i]:[];if(h.length>0)a.kind="media";a.files=[...a.files,...h]})},pickCollection:(i)=>{c(()=>{a.collection=i})},pickComponentStart:(i)=>{if(c(()=>{a.componentStart=i}),i===vm&&o.componentDocs===void 0)Y().then((h)=>{if(o.componentDocs=h,a.copyOf==="")a.copyOf=h.keys().next().value??"";if(!d)u()})},pickLocale:(i)=>{c(()=>{if(a.locale=i,!a.templateChosen)a.pageStart=_0(o,i)})},setLocalized:(i)=>{c(()=>{a.localized=i})},pickCopy:(i)=>{c(()=>{a.copyOf=i})},pickKind:(i)=>{c(()=>{a.kind=i})},pickPageTemplate:(i)=>{c(()=>{a.pageTemplate=i})},pickStart:(i)=>{c(()=>{a.pageStart=i,a.templateChosen=!0})},pickWrap:(i)=>{c(()=>{a.wrap=i})},setName:(i)=>{c(()=>{a.name=i,a.touched=!0})},setOwnPage:(i)=>{c(()=>{a.ownPage=i})},setUrl:(i)=>{c(()=>{a.url=i,a.touched=!0})},toggleUrl:()=>{c(()=>{if(!a.editingUrl)a.url=f().route??"/";a.editingUrl=!a.editingUrl})},togglePreset:(i)=>{c(()=>{let h=$w.find((C)=>C===i);if(h===void 0)return;a.fields=a.fields.includes(h)?a.fields.filter((C)=>C!==h):[...a.fields,h]})}},layer:dt("dialog"),view:O(a,o,k,v(k))});r.handle=K,u()}export{Ye as addCollectionPage,Ve as createDirect,Ge as openAddNew};
|
|
2
|
-
|
|
3
|
-
//# debugId=7A4DC1D50488C86264756E2164756E21
|
|
4
|
-
//# sourceMappingURL=add-new-flow-any4pw2q.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{mb,UE,qE,CF,KE}from"./studio-35pmfjtx.js";import"./studio-c72v1kwc.js";import"./studio-bk0anq3b.js";import"./studio-xh6rf05g.js";export{KE as clearCfConnection,qE as getCfAccountId,mb as getCfToken,CF as setCfAccountId,UE as setCfToken};
|
|
2
|
-
|
|
3
|
-
//# debugId=7C1FE07216597E8564756E2164756E21
|
|
4
|
-
//# sourceMappingURL=cf-settings-hbj16kh3.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{o,m,h,K,d,g,T,H,N,B,k,_,V,M,ee}from"./iframe-entry-4zqtn3ry.js";export{m as ARROW_SIGN,o as clamp,V as contrastRatio,g as formatHex,k as formatOklch,H as hsvToRgb,ee as inkOn,B as oklchToSrgb,d as parseColor,K as parseHex,M as preferredInk,_ as relativeLuminance,T as rgbToHsv,h as snapToStep,N as srgbToOklch};
|
|
2
|
-
|
|
3
|
-
//# debugId=AFE4FDC47CD9BD8C64756E2164756E21
|
|
4
|
-
//# sourceMappingURL=color-thzpppyc.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{De,Tx,$a,oy,Uc,qc}from"./studio-43pynnhz.js";import"./studio-xh6rf05g.js";export{Tx as _componentRegistryLoaded,Uc as buildComponentInstance,De as componentRegistry,qc as computeRelativePath,$a as loadComponentRegistry,oy as noteComponentSaved};
|
|
2
|
-
|
|
3
|
-
//# debugId=C417BA65AED9A02964756E2164756E21
|
|
4
|
-
//# sourceMappingURL=components-a98hzqw9.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{Im,G0,J0,Ab,e$,t$,n$}from"./studio-15mfah02.js";import"./studio-ek4fb4eb.js";import"./studio-4jy967rj.js";import"./studio-thgexj3w.js";import"./studio-j3bq30yz.js";import"./studio-qarg1xf9.js";import"./studio-pv1ts08p.js";import"./studio-gw83z798.js";import"./studio-aaw7wxv8.js";import"./studio-43pynnhz.js";import"./studio-1d8m5s38.js";import"./studio-c72v1kwc.js";import"./studio-czpmzs9r.js";import"./studio-td3h1644.js";import"./studio-cv6gnjqd.js";import"./studio-4z0cdh16.js";import"./studio-k05g7efh.js";import"./studio-wn2cmf9q.js";import"./studio-w4mfaaam.js";import"./studio-q509sqt8.js";import"./studio-48yzqzqr.js";import"./studio-s49y6m5b.js";import"./studio-x5py815g.js";import"./studio-9c6cbq2c.js";import"./studio-bk0anq3b.js";import"./studio-ex1644g2.js";import"./studio-xh6rf05g.js";import"./studio-1a7zshnv.js";import"./studio-m3jrjfhy.js";import"./studio-zav9hgb3.js";import"./studio-zzgp5yka.js";import"./studio-z6s56dzz.js";export{G0 as collectionDirs,Im as collectionInfo,J0 as collectionSourceDirs,t$ as createCollectionSource,n$ as createPagesSource,Ab as listCollectionEntryIds,e$ as reloadHoldAwareGrids};
|
|
2
|
-
|
|
3
|
-
//# debugId=C13DF5E5592B1F8164756E2164756E21
|
|
4
|
-
//# sourceMappingURL=content-source-jq3fjs3w.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{Pe,Z,h}from"./studio-s49y6m5b.js";import"./studio-bk0anq3b.js";import"./studio-x5py815g.js";import"./studio-xh6rf05g.js";import"./studio-ex1644g2.js";import"./studio-zav9hgb3.js";import"./studio-4z0cdh16.js";import{Jt,Ut,Ih}from"./studio-m3jrjfhy.js";import{sn,dt}from"./studio-cv6gnjqd.js";import"./studio-q509sqt8.js";import"./studio-9c6cbq2c.js";import{Ul}from"./studio-ehj3csbm.js";import"./studio-ep1384t9.js";import"./studio-k1wvtp03.js";import"./studio-gw83z798.js";import"./studio-c72v1kwc.js";import"./studio-1d8m5s38.js";import"./studio-43pynnhz.js";import"./studio-48yzqzqr.js";import"./studio-z6s56dzz.js";import"./studio-aaw7wxv8.js";import"./studio-czpmzs9r.js";import"./studio-zkkt13qd.js";import"./studio-w3aafbpk.js";import"./studio-4ncxzw5m.js";import"./studio-wn2cmf9q.js";import"./studio-k05g7efh.js";import"./studio-td3h1644.js";import{ex}from"./studio-4jy967rj.js";import"./studio-w4mfaaam.js";import{oo,zt,Vi}from"./studio-zn7ysyzb.js";import{re}from"./studio-151kgn69.js";import{ze,yt,E,I}from"./studio-1a7zshnv.js";import{b}from"./studio-9f5vcb4w.js";import{m,Qy}from"./studio-erjccagy.js";var v={$schema:"https://jxsuite.com/schema/v1",$id:"StudioConvertRepeater",$description:'Repeat…: the dialog that turns the selected element into an `$prototype: "Array"` template. One `jx-dialog`, so the platform owns modality, Escape, the backdrop and focus restoration — which is what retired the `sp-dialog-wrapper` this surface used to open through its bare `open` attribute, and the hand-rolled `requestAnimationFrame` focus move that had to follow it. Three questions in one form: which state definition holds the items, and optionally which function filters and which sorts. The name field appears only when the answer to the first is "Create new…", because a definition that already exists needs no name. Nothing here knows what makes a definition an array — `editor/convert-to-repeater.ts` asks the plugin schemas, keeps the refusals and writes the repeater — and it hands over rows that are already strings.',tagName:"jx-dialog",$props:{headline:"Repeat…",confirmLabel:"Create Repeater",cancelLabel:"Cancel",size:"sm"},attributes:{part:"convert-repeater"},onconfirm:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/confirm"},value:[]}]},oncancel:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},onclose:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},style:{$description:"There is no stylesheet to transcribe: the lit version carried one inline `display:flex;flex-direction:column;gap:12px` on a wrapper div and nothing else, because `sp-field-label` and `sp-dialog-wrapper` drew the rest. Both of those are gone — the label is `jx-field`'s, which actually NAMES the control it wraps rather than sitting beside it, and the box is the dialog's — so the whole of this block is the one gap that separated the rows, said in the kit's scale instead of in the twelve pixels somebody typed.",'& [part="form"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-4)"},'& [part="new-slot"], & [part="functions-slot"], & [part="functions"]':{$description:"A branch host and the pair inside it are structure rather than layout: `display: contents` puts the rows they carry straight into the form's own column, so one gap rule spaces every row whether it is drawn or not.",display:"contents"}},children:[{tagName:"div",attributes:{part:"form"},children:[{tagName:"jx-field",attributes:{part:"source-row"},$props:{span:!0,label:"Items source"},children:[{tagName:"jx-select",attributes:{part:"source"},$props:{size:"sm",options:{$ref:"#/state/sourceOptions"},value:{$ref:"#/state/source"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/pickSource"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"div",attributes:{part:"new-slot",role:"none"},$switch:{$ref:"#/state/creating"},cases:{true:{tagName:"jx-field",attributes:{part:"new-row"},$props:{span:!0,label:"New definition name",invalid:{$ref:"#/state/invalid"}},children:[{tagName:"jx-textfield",attributes:{part:"new-name"},$props:{size:"sm",placeholder:"myItems",value:{$ref:"#/state/newName"},invalid:{$ref:"#/state/invalid"},error:{$ref:"#/state/error"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setName"},value:[{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{Enter:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/confirm"},value:[]}]}}]}}]}}},{tagName:"div",attributes:{part:"functions-slot",role:"none"},$switch:{$ref:"#/state/hasFunctions"},cases:{true:{tagName:"div",attributes:{part:"functions",role:"none"},children:[{tagName:"jx-field",attributes:{part:"filter-row"},$props:{span:!0,label:"Filter (optional)"},children:[{tagName:"jx-select",attributes:{part:"filter"},$props:{size:"sm",options:{$ref:"#/state/functionOptions"},value:{$ref:"#/state/filter"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/pickFilter"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-field",attributes:{part:"sort-row"},$props:{span:!0,label:"Sort (optional)"},children:[{tagName:"jx-select",attributes:{part:"sort"},$props:{size:"sm",options:{$ref:"#/state/functionOptions"},value:{$ref:"#/state/sort"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/pickSort"},value:[{$ref:"event#/target/value"}]}]}}]}]}}}]}]};E("convert-repeater",v);var f="__new__";function g(r){return{...r,creating:r.source===f,functionOptions:[{label:"None",value:""},...r.functions.map((o)=>({label:o,value:o}))],hasFunctions:r.functions.length>0,invalid:r.error!=="",sourceOptions:[...r.sources.map((o)=>({label:o,value:o})),{label:"Create new…",value:f}]}}function y(r){let o=document.createElement("div");o.style.pointerEvents="auto",o.setAttribute(ze,yt("dialog","convert-repeater")),r.layer.append(o);let l=!1,i=()=>{if(l)return;l=!0,r.onClosed()},e=()=>l,s=b({...g(r.view),closed:i,confirm:()=>{r.onConfirm()},pickFilter:(t)=>{s.filter=t,r.onPickFilter(t)},pickSort:(t)=>{s.sort=t,r.onPickSort(t)},pickSource:(t)=>{s.source=t,r.onPickSource(t)},setName:(t)=>{s.newName=t,r.onName(t)}}),c=null,p=()=>{setTimeout(()=>{let t=c?.root;if(l||!(t instanceof HTMLElement))return;let a=t.querySelector('jx-textfield[part="new-name"]');if(a)Ih(a,"all")},0)},u=I("convert-repeater",s,o).then(async(t)=>{c=t;let a=t.root;if(e())return t.dispose(),a;if(await sn(a),e())return a;if(Jt(a),s.creating)p();return a});return{close(){let t=c?.root;if(t instanceof HTMLElement)Ut(t);c?.dispose(),c=null,o.remove(),i()},host:o,ready:u,update(t){let a=g(t),n=a.creating&&!s.creating,d=a.error!==""&&a.error===s.error;if(Object.assign(s,d?{...a,error:""}:a),d){let w=a.error;queueMicrotask(()=>{s.error=w})}if(n)p()}}}var R=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/;async function B(){let r=h.value,o=Pe(r?.session.selection);if(!r||!o||o.length<2)return;if(!re(r.doc.document,o))return;let i=r.doc.document.state||{},e=await S(i);if(!e)return;Z(r,(s)=>{let c=s.doc.document;if(e.newDef){if(!c.state)c.state={};c.state[e.newDef.name]={default:[],type:"array"}}let p=zt(o);if(!p)return;let u=Vi(o),t=re(c,p);if(!t?.children)return;let a=oo(t)[u],n={$prototype:"Array",items:e.items,map:a};if(e.filter)n.filter=e.filter;if(e.sort)n.sort=e.sort;t.children[u]=n})}async function C(r){let o=Object.entries(r).filter(([,i])=>m(i)&&(i.type==="array"||Array.isArray(i.default)||i.$prototype==="Array")).map(([i])=>i),l=h.value?.documentPath;for(let[i,e]of Object.entries(r)){if(!Qy(e)||!e.$prototype||e.$prototype==="Array")continue;if(o.includes(i))continue;if((await ex({...e.$src!=null&&{$src:e.$src},$prototype:e.$prototype},{...l!=null&&{documentPath:l}}))?.returns?.type==="array")o.push(i)}return o}async function S(r){let o=await C(r),l=Object.entries(r).filter(([,i])=>Ul(i)==="function").map(([i])=>i);return new Promise((i)=>{let e={error:"",filter:"",functions:l,newName:"",sort:"",source:o[0]??f,sources:o},s=!1,c=(n)=>{if(s)return;s=!0,a.close(),i(n)},p=(n)=>{e.error=n,a.update(e)},u=()=>({...e.filter&&{filter:{$ref:`#/state/${e.filter}`}},...e.sort&&{sort:{$ref:`#/state/${e.sort}`}}}),t=()=>{if(e.source!==f){c({items:{$ref:`#/state/${e.source}`},...u()});return}let n=e.newName.trim();if(!n){p("Enter a name for the new state definition.");return}if(r[n]){p(`"${n}" already exists.`);return}if(!R.test(n)){p("Invalid identifier name.");return}c({items:{$ref:`#/state/${n}`},...u(),newDef:{name:n}})},a=y({layer:dt("dialog"),onClosed:()=>c(null),onConfirm:t,onName:(n)=>{e.newName=n,e.error="",a.update(e)},onPickFilter:(n)=>{e.filter=n,a.update(e)},onPickSort:(n)=>{e.sort=n,a.update(e)},onPickSource:(n)=>{e.source=n,e.error="",a.update(e)},view:e})})}export{B as convertToRepeater};
|
|
2
|
-
|
|
3
|
-
//# debugId=03379010EF51A97A64756E2164756E21
|
|
4
|
-
//# sourceMappingURL=convert-to-repeater-g66r6qp1.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{fF,nm,mF,gF,bF,dp,yF,vF,Sa,IS,Ed,wF,Un,xe}from"./studio-nv5eq0f7.js";export{fF as CancellationTokenSource,nm as Emitter,mF as KeyCode,gF as KeyMod,Sa as MarkerSeverity,IS as MarkerTag,bF as Position,dp as Range,yF as Selection,vF as SelectionDirection,wF as Token,Ed as Uri,Un as editor,xe as languages};
|
|
2
|
-
|
|
3
|
-
//# debugId=72FE229AA5269CB864756E2164756E21
|
|
4
|
-
//# sourceMappingURL=editor-rth1rzj8.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{S0,$F,fT}from"./studio-x5ffyssw.js";import"./studio-nngc45ct.js";import"./studio-bpzwhn88.js";import"./studio-ph17an19.js";import"./studio-pte5w7rf.js";import"./studio-ep1384t9.js";import"./studio-4ncxzw5m.js";import"./studio-6mf31e16.js";import"./studio-w3aafbpk.js";import"./studio-15mfah02.js";import"./studio-ek4fb4eb.js";import"./studio-4jy967rj.js";import"./studio-thgexj3w.js";import"./studio-j3bq30yz.js";import"./studio-qarg1xf9.js";import"./studio-pv1ts08p.js";import"./studio-gw83z798.js";import"./studio-aaw7wxv8.js";import"./studio-43pynnhz.js";import"./studio-1d8m5s38.js";import"./studio-c72v1kwc.js";import"./studio-czpmzs9r.js";import"./studio-td3h1644.js";import"./studio-cv6gnjqd.js";import"./studio-4z0cdh16.js";import"./studio-k05g7efh.js";import"./studio-wn2cmf9q.js";import"./studio-w4mfaaam.js";import"./studio-q509sqt8.js";import"./studio-48yzqzqr.js";import"./studio-s49y6m5b.js";import"./studio-x5py815g.js";import"./studio-9c6cbq2c.js";import"./studio-bk0anq3b.js";import"./studio-ex1644g2.js";import"./studio-xh6rf05g.js";import"./studio-1a7zshnv.js";import"./studio-m3jrjfhy.js";import"./studio-zav9hgb3.js";import"./studio-zzgp5yka.js";import"./studio-z6s56dzz.js";import"./studio-k1wvtp03.js";export{$F as createEntry,S0 as entryFormatName,fT as registerContentCommands};
|
|
2
|
-
|
|
3
|
-
//# debugId=5FBA100FBA137AB564756E2164756E21
|
|
4
|
-
//# sourceMappingURL=entry-commands-02j0s19w.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import"./studio-xh6rf05g.js";import{jt,rd,ru}from"./studio-ex1644g2.js";import"./studio-9c6cbq2c.js";import"./studio-bk0anq3b.js";import"./studio-s49y6m5b.js";import"./studio-x5py815g.js";import"./studio-zav9hgb3.js";import"./studio-m3jrjfhy.js";import"./studio-ep1384t9.js";import"./studio-4z0cdh16.js";import{ea,dt}from"./studio-cv6gnjqd.js";import"./studio-q509sqt8.js";import"./studio-w3aafbpk.js";import"./studio-k1wvtp03.js";import"./studio-kefs4sz4.js";import{DD,OD,Gl,AD}from"./studio-dst8y8vh.js";import"./studio-c72v1kwc.js";import"./studio-1d8m5s38.js";import{TT}from"./studio-ncwx602y.js";import{z0,YD,JT,ZT}from"./studio-6sxnqqw8.js";import"./studio-wn2cmf9q.js";import"./studio-48yzqzqr.js";import"./studio-k05g7efh.js";import"./studio-pv1ts08p.js";import"./studio-qarg1xf9.js";import"./studio-thgexj3w.js";import"./studio-gw83z798.js";import"./studio-15mfah02.js";import"./studio-z6s56dzz.js";import"./studio-td3h1644.js";import"./studio-zzgp5yka.js";import"./studio-j3bq30yz.js";import"./studio-aaw7wxv8.js";import"./studio-43pynnhz.js";import"./studio-czpmzs9r.js";import"./studio-ek4fb4eb.js";import"./studio-4jy967rj.js";import"./studio-w4mfaaam.js";import{E,I}from"./studio-1a7zshnv.js";import{b}from"./studio-9f5vcb4w.js";import{n,S}from"./studio-erjccagy.js";var g={$schema:"https://jxsuite.com/schema/v1",$id:"StudioDataActions",$description:"The actions row a data-domain settings section grows: test a connection, push the schema, open the rows as a grid. It is an ISLAND inside `surfaces/settings-contributed.json` — the generic contributed-section renderer stays extension-agnostic and draws an empty host, and `panels/data-grid.ts` mounts this into it — which is the seam that lets the data surface contribute verbs without the settings machinery learning what a connection is.",tagName:"div",attributes:{part:"data-actions"},style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:"var(--jx-space-2)",fontFamily:"var(--jx-font-sans)",fontSize:"var(--jx-text-md)",'& [part="result"]':{fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)"},'& [part="result"][data-ok="false"]':{color:"var(--danger)"},'& [part="result"][data-ok="true"]':{color:"var(--success, var(--accent))"}},children:[{tagName:"span",attributes:{part:"test-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/testState"},cases:{shown:{tagName:"jx-button",attributes:{part:"test"},$props:{variant:"secondary",size:"sm",disabled:{$ref:"#/state/testDisabled"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/test"},value:[]}]},children:[{tagName:"span",textContent:"${state.testLabel}"}]}}},{tagName:"jx-button",attributes:{part:"push"},$props:{variant:"secondary",size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/push"},value:[]}]},children:[{tagName:"span",textContent:"Push Schema"}]},{tagName:"jx-button",attributes:{part:"grid"},$props:{variant:"secondary",size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openGrid"},value:[]}]},children:[{tagName:"span",textContent:"Open Data Grid"}]},{tagName:"span",attributes:{part:"result-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/resultState"},cases:{shown:{$description:"The last test's verdict, and a live region because it arrives after the press that asked for it.",tagName:"span",attributes:{part:"result",role:"status","data-ok":"${state.resultOk}",title:"${state.resultTitle}"},textContent:"${state.resultText}"}}}]};E("data-actions",g);function h(t,e){t.testState=e.testState,t.testLabel=e.testLabel,t.testDisabled=e.testDisabled,t.resultState=e.resultState,t.resultOk=e.resultOk,t.resultText=e.resultText,t.resultTitle=e.resultTitle}function y(t,e,o){let a=b({openGrid:o.openGrid,push:o.push,resultOk:"false",resultState:"hidden",resultText:"",resultTitle:"",test:o.test,testDisabled:!1,testLabel:"Test Connection",testState:"hidden"});h(a,e);let s=null,l=!1,r=I("data-actions",a,t).then((i)=>{let d=i.root;if(l)return i.dispose(),d;return s=i,d});return{dispose(){l=!0,s?.dispose(),s=null},ready:r,update:(i)=>h(a,i)}}var x={$schema:"https://jxsuite.com/schema/v1",$id:"StudioPushPlan",$description:"What pushing the schema would do, or what it did. The dry run is the whole point of the surface: a push rewrites a live database's shape, so the plan is read before the apply, and the confirm dialog around this document is the one that gates it. The ISLAND of `ui/layers.ts`'s confirm dialog rather than a dialog of its own (studio-ui-guidelines.md §12.5).",tagName:"div",attributes:{part:"plan"},style:{display:"flex",flexDirection:"column",gap:"var(--jx-space-2)",minWidth:"0",fontFamily:"var(--jx-font-sans)",fontSize:"var(--jx-text-md)",color:"var(--fg)",'& [part="steps"]':{margin:"0",padding:"0",listStyle:"none",display:"flex",flexDirection:"column",gap:"2px",maxHeight:"40vh",overflowY:"auto"},'& [part="step"]':{fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-sm)",padding:"2px var(--jx-space-2)",borderLeft:"2px solid var(--border)"},'& [part="step"][data-kind="drop"]':{borderLeftColor:"var(--danger)"},'& [part="step"][data-kind="create"]':{borderLeftColor:"var(--success, var(--accent))"},'& [part="warning"]':{margin:"0",fontSize:"var(--jx-text-sm)",color:"var(--warning, var(--fg-dim))"},'& [part="failure"]':{$description:'`failure` rather than `error`: every kit field draws a permanent, empty `[part="error"]` of its own, and the kit is light DOM, so a rule on that name here would reach any field the plan ever holds.',margin:"0",fontSize:"var(--jx-text-sm)",color:"var(--danger)"}},children:[{tagName:"ul",attributes:{part:"steps"},children:[{$prototype:"Array",items:{$ref:"#/state/steps"},key:{$ref:"$map/item/key"},map:{tagName:"li",attributes:{part:"step","data-kind":"${$map.item.kind}"},textContent:"${$map.item.summary}"}}]},{$prototype:"Array",items:{$ref:"#/state/warnings"},key:{$ref:"$map/item/key"},map:{tagName:"p",attributes:{part:"warning"},textContent:"${$map.item.text}"}},{$prototype:"Array",items:{$ref:"#/state/errors"},key:{$ref:"$map/item/key"},map:{tagName:"p",attributes:{part:"failure",role:"alert"},textContent:"${$map.item.text}"}}]};E("push-plan",x);function v(t,e){let o=b({errors:e.errors,steps:e.steps,warnings:e.warnings}),a=null,s=!1,l=I("push-plan",o,t).then((r)=>{if(s)r.dispose();else a=r;return r.root});return{dispose(){s=!0,a?.dispose(),a=null},ready:l,update(r){o.steps=r.steps,o.warnings=r.warnings,o.errors=r.errors}}}var u=null;function P(){let t=u;u=null,t?.plan?.dispose(),t?.handle.close()}function D(t,e){return t.map((o,a)=>({key:`${e}:${a}`,text:o}))}function A(t){let e=t.phase==="done"?t.result:t.dryRun;return{errors:D(e?.errors??[],"error"),steps:(e?.plan??[]).map((o,a)=>({key:`${o.kind}:${a}`,kind:o.kind,summary:o.summary})),warnings:D(e?.warnings??[],"warning")}}function L(t){if(t.phase==="loading")return"Compiling plan…";if(t.phase==="applying")return"Applying…";if(t.phase==="done")return t.result?.applied?"Schema applied.":"Push failed.";let e=t.dryRun?.plan.length??0,o=t.dryRun?.errors?.length??0;return e===0&&o===0?"Nothing to push — the schema is up to date.":""}function f(){let t=u;if(!t)return;let e=t.phase==="confirm"&&(t.dryRun?.plan.length??0)>0;t.handle.update({cancelLabel:t.phase==="done"?"Close":"Cancel",confirmLabel:e?"Apply":"",message:L(t)}),t.plan?.update(A(t))}async function H(t,e){if(u)return;let o={connection:t,dryRun:null,onDone:e,phase:"loading",plan:null,result:null},a=ea({cancelLabel:"Cancel",confirmLabel:"",headline:t?`Push Schema — ${t}`:"Push Schema",island:(i)=>{o.plan=v(i,A(o))},layer:dt("dialog"),message:"Compiling plan…",onCancel:P,onClosed:()=>{if(u===o)P()},onConfirm:()=>{N()},region:"data/push"}),s=Object.assign(o,{handle:a});u=s;let l={dryRun:!0};if(t!==void 0)l.connection=t;let r=await JT(l);if(u!==s)return;s.dryRun=r,s.phase="confirm",f()}async function N(){let t=u;if(!t)return;t.phase="applying",f();let e=await JT(t.connection===void 0?{}:{connection:t.connection});if(u!==t)return;t.result=e,t.phase="done",f(),t.onDone()}var c={pushing:!1,testResult:null,testing:null},w=new Map;function k(t,e){let{testResult:o}=c;return{resultOk:o?.ok?"true":"false",resultState:o?"shown":"hidden",resultText:o?`${o.connection}: ${o.ok?"connected":o.error??"failed"}`:"",resultTitle:o?.error??"",testDisabled:!e||c.testing!==null,testLabel:c.testing?"Testing…":"Test Connection",testState:t==="connections"?"shown":"hidden"}}function C(t){if(t!=="connections"&&t!=="data"||!z0())return null;return(e,o)=>O(e,t,o)}async function j(t,e){c.testing=t,c.testResult=null,e();let o=await YD(t);c.testing=null,c.testResult={...o,connection:t},e()}function O(t,e,o){let{rerender:a,selected:s}=o,l=w.get(t);if(l){l.update(k(e,s));return}let r=()=>e==="connections"?o.selected??void 0:void 0;w.set(t,y(t,k(e,s),{openGrid:()=>{ZT()},push:()=>{H(r(),a)},test:()=>{let i=o.selected;if(i)j(i,a)}}))}var V=100;function G(t){let e=t.studio?.settings;if(!e)return null;let{key:o}=t.project,a=e.layout??"form",s=t.entrySchema??{},l=a==="map"?S(s.additionalProperties)?s.additionalProperties:{}:s,r=e.label??t.project.title??o,i={};if(e.entry!==void 0)i.entry=e.entry;if(e.layout!==void 0)i.layout=e.layout;return{contribution:{entrySchema:l,key:o,settings:i,title:r},group:OD(e.group)?e.group:DD,icon:e.icon,intro:n(e.intro)?e.intro:void 0,key:o,label:r,order:e.order??V}}var m=new Set,p=null;function ut(){return p??Promise.resolve()}function ct(){return p??=M().finally(()=>{p=null}),p}async function M(){let[t]=await Promise.all([rd(),jt()]),e=new Set;for(let o of t)for(let a of o.contributions){let s=G(a);if(!s)continue;let{contribution:l}=s;Gl({group:s.group,icon:s.icon,intro:s.intro,key:s.key,label:s.label,order:s.order,render:(r)=>{let i=C(s.key),d={formats:ru()};if(i!==null)d.actions=i;TT(r,l,d)}}),e.add(s.key)}for(let o of m)if(!e.has(o))AD(o);m.clear();for(let o of e)m.add(o)}export{ut as extensionSectionsReady,ct as syncExtensionSettingsSections};
|
|
2
|
-
|
|
3
|
-
//# debugId=76A4B2AC5B323D9864756E2164756E21
|
|
4
|
-
//# sourceMappingURL=extension-sections-rqrs7dr0.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{oO,Bo,r$,NF,o$,Rp,s$,Mb,Fb}from"./studio-ek4fb4eb.js";import"./studio-4jy967rj.js";import"./studio-thgexj3w.js";import"./studio-j3bq30yz.js";import"./studio-qarg1xf9.js";import"./studio-pv1ts08p.js";import"./studio-gw83z798.js";import"./studio-aaw7wxv8.js";import"./studio-43pynnhz.js";import"./studio-1d8m5s38.js";import"./studio-c72v1kwc.js";import"./studio-czpmzs9r.js";import"./studio-td3h1644.js";import"./studio-cv6gnjqd.js";import"./studio-4z0cdh16.js";import"./studio-k05g7efh.js";import"./studio-wn2cmf9q.js";import"./studio-w4mfaaam.js";import"./studio-q509sqt8.js";import"./studio-48yzqzqr.js";import"./studio-s49y6m5b.js";import"./studio-x5py815g.js";import"./studio-9c6cbq2c.js";import"./studio-bk0anq3b.js";import"./studio-ex1644g2.js";import"./studio-xh6rf05g.js";import"./studio-1a7zshnv.js";import"./studio-m3jrjfhy.js";import"./studio-zav9hgb3.js";import"./studio-zzgp5yka.js";import"./studio-z6s56dzz.js";export{Mb as confirmFileDelete,s$ as exportFile,NF as openFile,r$ as parseCollabSource,oO as parseFormatSource,Bo as parseSourceForPath,Fb as renamePromptMessage,Rp as saveFile,o$ as setDocumentSavedListener};
|
|
2
|
-
|
|
3
|
-
//# debugId=D55F66123F13FED564756E2164756E21
|
|
4
|
-
//# sourceMappingURL=file-ops-6a49er4c.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{ol,Tm,MT,FT,rF,jT,HT,BT,F0,oF,Ob,VT,sF,aF,WT,qD,lF,cF,Bw,j0,H0,Vw,$m,dF,Ww,B0,_i,V0,zT,UT,Lm,qT,uF,hF}from"./studio-ze1sm147.js";import"./studio-6mf31e16.js";import"./studio-6sxnqqw8.js";import"./studio-w3aafbpk.js";import"./studio-15mfah02.js";import"./studio-ek4fb4eb.js";import"./studio-4jy967rj.js";import"./studio-ajfq4fmr.js";import"./studio-pgze9p34.js";import"./studio-g65t6svn.js";import"./studio-thgexj3w.js";import"./studio-j3bq30yz.js";import"./studio-qarg1xf9.js";import"./studio-pv1ts08p.js";import"./studio-gw83z798.js";import"./studio-aaw7wxv8.js";import"./studio-43pynnhz.js";import"./studio-1d8m5s38.js";import"./studio-c72v1kwc.js";import"./studio-czpmzs9r.js";import"./studio-td3h1644.js";import"./studio-cv6gnjqd.js";import"./studio-4z0cdh16.js";import"./studio-k05g7efh.js";import"./studio-wn2cmf9q.js";import"./studio-w4mfaaam.js";import"./studio-q509sqt8.js";import"./studio-48yzqzqr.js";import"./studio-s49y6m5b.js";import"./studio-x5py815g.js";import"./studio-9c6cbq2c.js";import"./studio-bk0anq3b.js";import"./studio-ex1644g2.js";import"./studio-xh6rf05g.js";import"./studio-1a7zshnv.js";import"./studio-m3jrjfhy.js";import"./studio-zav9hgb3.js";import"./studio-zzgp5yka.js";import"./studio-z6s56dzz.js";export{sF as FILE_ROW_HEIGHT,WT as canMoveInto,Ww as commitRename,cF as createFileIn,F0 as findHomePage,BT as initProjectRepo,aF as isFileDrag,B0 as listRenameSiblings,Bw as listTakenNames,ol as loadDirectory,jT as loadProject,Tm as loadProjectDirectories,uF as mountFilesPanel,Vw as notifyMoveOutcome,V0 as openFileInPane,_i as openFileInTab,oF as openHomePage,Ob as openLastSessionOrHome,HT as openProject,$m as parentDirOf,lF as pickAndUploadTo,MT as refreshProjectDirectoriesFor,qT as registerFilesPanel,zT as reloadCleanTab,Lm as reloadFileInTab,UT as reloadTabsIfChanged,H0 as renameStatus,VT as setSessionWorkspaceShow,rF as setShowIgnoredFiles,dF as settleRename,FT as showIgnoredFiles,hF as unmountFilesPanel,qD as uploadFilesToDir,j0 as writeNewFile};
|
|
2
|
-
|
|
3
|
-
//# debugId=826CA1FE99715B7A64756E2164756E21
|
|
4
|
-
//# sourceMappingURL=files-b2p9y0yz.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{jt,$h,rd,My,m_,lc,ru,Pa,Wi,lf,fn,_l,Fy,lo,zR,Ma,UR}from"./studio-ex1644g2.js";import"./studio-xh6rf05g.js";export{lo as defaultContentFormat,_l as documentExtensions,Pa as formatByExtension,Wi as formatByName,fn as formatForPath,zR as formatParse,Ma as formatSerialize,m_ as getExtensionCatalog,My as getExtensions,ru as getFormats,rd as loadExtensions,jt as loadFormats,lf as noFormatError,lc as refreshExtensionUi,$h as refreshFormats,Fy as routedPageExtensions,UR as splitFormatDocument};
|
|
2
|
-
|
|
3
|
-
//# debugId=1CA3932FD3D4147764756E2164756E21
|
|
4
|
-
//# sourceMappingURL=format-host-7xe57k1s.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{Ls,Ud,uR}from"./studio-k05g7efh.js";import"./studio-wn2cmf9q.js";import"./studio-48yzqzqr.js";import"./studio-s49y6m5b.js";import"./studio-x5py815g.js";import"./studio-9c6cbq2c.js";import"./studio-bk0anq3b.js";import"./studio-ex1644g2.js";import"./studio-xh6rf05g.js";import"./studio-zav9hgb3.js";export{Ud as isRecentLocal,Ls as markLocalMutation,uR as startFsSync};
|
|
2
|
-
|
|
3
|
-
//# debugId=5471B9292666633E64756E2164756E21
|
|
4
|
-
//# sourceMappingURL=fs-events-0xsy168g.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{YT,XD,q0,ZT,XT}from"./studio-6sxnqqw8.js";import"./studio-15mfah02.js";import"./studio-ek4fb4eb.js";import"./studio-4jy967rj.js";import"./studio-thgexj3w.js";import"./studio-j3bq30yz.js";import"./studio-qarg1xf9.js";import"./studio-pv1ts08p.js";import"./studio-gw83z798.js";import"./studio-aaw7wxv8.js";import"./studio-43pynnhz.js";import"./studio-1d8m5s38.js";import"./studio-c72v1kwc.js";import"./studio-czpmzs9r.js";import"./studio-td3h1644.js";import"./studio-cv6gnjqd.js";import"./studio-4z0cdh16.js";import"./studio-k05g7efh.js";import"./studio-wn2cmf9q.js";import"./studio-w4mfaaam.js";import"./studio-q509sqt8.js";import"./studio-48yzqzqr.js";import"./studio-s49y6m5b.js";import"./studio-x5py815g.js";import"./studio-9c6cbq2c.js";import"./studio-bk0anq3b.js";import"./studio-ex1644g2.js";import"./studio-xh6rf05g.js";import"./studio-1a7zshnv.js";import"./studio-m3jrjfhy.js";import"./studio-zav9hgb3.js";import"./studio-zzgp5yka.js";import"./studio-z6s56dzz.js";export{XD as openCollectionGrid,YT as openCsvGridTab,ZT as openGridSourcePicker,q0 as openPagesGrid,XT as registerGridCommands};
|
|
2
|
-
|
|
3
|
-
//# debugId=0203F11C8203D15464756E2164756E21
|
|
4
|
-
//# sourceMappingURL=grid-open-h3q4fjy5.js.map
|