@jxsuite/studio 8.0.1 → 9.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{2020-5wtzce5g.js → 2020-89fz3pfy.js} +3 -3
- package/dist/chunks/adapter-ay13gema.js +4 -0
- package/dist/chunks/add-new-flow-nmkqpjym.js +4 -0
- package/dist/chunks/cf-account-picker-2e06qxey.js +4 -0
- package/dist/chunks/cf-settings-5y04810c.js +4 -0
- package/dist/chunks/color-04361ttk.js +4 -0
- package/dist/chunks/{color-area-6rbra5dy.js → color-area-h8dbasp1.js} +2 -2
- package/dist/chunks/{color-field-gy56c94g.js → color-field-qv5r2b16.js} +3 -3
- package/dist/chunks/{color-slider-sqqdyf6c.js → color-slider-nz2mrzky.js} +2 -2
- package/dist/chunks/{combobox-72h32ejk.js → combobox-6hs00996.js} +2 -2
- package/dist/chunks/components-3vf75n83.js +4 -0
- package/dist/chunks/content-source-4f2raf4a.js +4 -0
- package/dist/chunks/{convert-to-repeater-he70fc2b.js → convert-to-repeater-j9hfcj4f.js} +3 -3
- package/dist/chunks/editor-645krvtz.js +4 -0
- package/dist/chunks/entry-commands-3qmv8wkr.js +4 -0
- package/dist/chunks/{extension-sections-0egb88dm.js → extension-sections-thfke054.js} +3 -3
- package/dist/chunks/file-ops-kkhp9ma7.js +4 -0
- package/dist/chunks/files-yswdhxrf.js +4 -0
- package/dist/chunks/format-host-4g8ex6bz.js +4 -0
- package/dist/chunks/fs-events-z9gpvc6t.js +4 -0
- package/dist/chunks/grid-open-fm4j183c.js +4 -0
- package/dist/chunks/{grid-view-qg1b5eqx.js → grid-view-7d2nx83y.js} +16 -15
- package/dist/chunks/{icons-63bjtbs7.js → icons-853n6qt3.js} +2 -2
- package/dist/chunks/{iframe-entry-pkgmcgp0.js → iframe-entry-2x9bn5ng.js} +4 -4
- package/dist/chunks/{iframe-entry-99nr5zfb.js → iframe-entry-42hpmwz5.js} +4 -4
- package/dist/chunks/{iframe-entry-76j8vwwx.js → iframe-entry-b5qgggyp.js} +2 -2
- package/dist/chunks/{iframe-entry-2zggzajv.js → iframe-entry-btck0e9s.js} +4 -4
- package/dist/chunks/iframe-host-q7fedsmr.js +4 -0
- package/dist/chunks/{index-32eqzv1k.js → index-jxmt7vh8.js} +3 -3
- package/dist/chunks/index-pt4wh98x.js +4 -0
- package/dist/chunks/{javascript-pjp734q4.js → javascript-vmqp56ke.js} +2 -2
- package/dist/chunks/{jsonMode-njkvsa02.js → jsonMode-n3wmpant.js} +5 -5
- package/dist/chunks/jx-validate-19y62knt.js +4 -0
- package/dist/chunks/layers-panel-1qvc83y9.js +4 -0
- package/dist/chunks/layers-qf0bc7ze.js +4 -0
- package/dist/chunks/{listbox-c421cf8c.js → listbox-7gka1h86.js} +2 -2
- package/dist/chunks/lit-html-wyqw04y2.js +4 -0
- package/dist/chunks/media-library-f9d5qcjb.js +4 -0
- package/dist/chunks/media-picker-rsb1fmk2.js +4 -0
- package/dist/chunks/{menu-bdpzbfvs.js → menu-d2jxpgma.js} +2 -2
- package/dist/chunks/{monaco-binding-vq1hgnn0.js → monaco-binding-wfhmz89d.js} +3 -3
- package/dist/chunks/monaco-buffer-ak0raadw.js +4 -0
- package/dist/chunks/{monaco-setup-xrd2cbkp.js → monaco-setup-fty7a8vg.js} +3 -3
- package/dist/chunks/notify-4qj70q0x.js +4 -0
- package/dist/chunks/parse-n8dfxnqf.js +4 -0
- package/dist/chunks/platform-ehg6t9vd.js +4 -0
- package/dist/chunks/{popover-b89sfej7.js → popover-9tf4cjrk.js} +2 -2
- package/dist/chunks/publish-panel-yhmda3cd.js +4 -0
- package/dist/chunks/{publish-quick-qx2455cj.js → publish-quick-12hh8926.js} +3 -3
- package/dist/chunks/publish-workspace-hx8qdv9p.js +4 -0
- package/dist/chunks/quick-search-r955m3q1.js +4 -0
- package/dist/chunks/references-8gxv0x7t.js +4 -0
- package/dist/chunks/right-panel-jarwqjpy.js +4 -0
- package/dist/chunks/source-control-84qt25m9.js +4 -0
- package/dist/chunks/{split-c9zfdgxf.js → split-m5rwn31z.js} +2 -2
- package/dist/chunks/studio-0nefxhar.js +7 -0
- package/dist/chunks/studio-0rg30pvs.js +5 -0
- package/dist/chunks/{studio-s32578pn.js → studio-14hh60j8.js} +4 -4
- package/dist/chunks/studio-1cfyd1ys.js +5 -0
- package/dist/chunks/studio-2bq7hheq.js +5 -0
- package/dist/chunks/{studio-zz9qe3rw.js → studio-32d8wyxq.js} +37 -37
- package/dist/chunks/studio-3hpcawh8.js +4 -0
- package/dist/chunks/{studio-svb7yyve.js → studio-4j35hgsw.js} +4 -4
- package/dist/chunks/{studio-x1x167jh.js → studio-4qg61g9j.js} +4 -4
- package/dist/chunks/studio-4rgem12q.js +5 -0
- package/dist/chunks/studio-6k9djnxw.js +5 -0
- package/dist/chunks/studio-6rbaedw2.js +9 -0
- package/dist/chunks/studio-732mw0g8.js +5 -0
- package/dist/chunks/studio-79r8msnr.js +7 -0
- package/dist/chunks/studio-7q6jdd4h.js +5 -0
- package/dist/chunks/{studio-r5qy30vx.js → studio-8hf8qcm1.js} +4 -4
- package/dist/chunks/{studio-8tr6cfrc.js → studio-8pne0rx4.js} +4 -4
- package/dist/chunks/{studio-y0n7yxea.js → studio-9179bsm7.js} +7 -7
- package/dist/chunks/{studio-pbxa5fpc.js → studio-9ff0vqff.js} +3 -3
- package/dist/chunks/studio-9gzvypw4.js +5 -0
- package/dist/chunks/studio-9ndgd55w.js +5 -0
- package/dist/chunks/studio-9ra9e7m4.js +5 -0
- package/dist/chunks/studio-a6e5fzve.js +5 -0
- package/dist/chunks/studio-a9k86nq6.js +5 -0
- package/dist/chunks/studio-ae7a69jc.js +6 -0
- package/dist/chunks/studio-aghsg0ds.js +7 -0
- package/dist/chunks/{studio-k3xxbagr.js → studio-ajw4k8hp.js} +3 -3
- package/dist/chunks/{studio-qmn1xc24.js → studio-apapy17g.js} +4 -4
- package/dist/chunks/{studio-8m0y2qe7.js → studio-by8x0jvc.js} +4 -4
- package/dist/chunks/{studio-wbcjbhy1.js → studio-c88gq88j.js} +5 -5
- package/dist/chunks/{studio-n0c5h6mf.js → studio-cg54vtet.js} +4 -4
- package/dist/chunks/studio-dvhxxxbd.js +5 -0
- package/dist/chunks/{studio-3q40e3rj.js → studio-e4rq6x0q.js} +4 -4
- package/dist/chunks/{studio-fbhxxc5f.js → studio-ekzbgnjp.js} +4 -4
- package/dist/chunks/studio-fg4fj9ec.js +10 -0
- package/dist/chunks/studio-fj6jzgxw.js +5 -0
- package/dist/chunks/{studio-nh6d342n.js → studio-g45r5vm8.js} +7 -7
- package/dist/chunks/{studio-a2bvaptz.js → studio-gczve8zf.js} +4 -4
- package/dist/chunks/studio-ge08zwpv.js +5 -0
- package/dist/chunks/studio-gk9yk8dj.js +12 -0
- package/dist/chunks/{studio-bbe4c90a.js → studio-gskkgfe3.js} +4 -4
- package/dist/chunks/{studio-83mk4bgg.js → studio-h4jbgne2.js} +8 -8
- package/dist/chunks/{studio-b7y5mr30.js → studio-hcy9zeac.js} +4 -4
- package/dist/chunks/studio-ht81xjkr.js +5 -0
- package/dist/chunks/{studio-jaaz8ce9.js → studio-jr30g4ae.js} +4 -4
- package/dist/chunks/{studio-qgh13jtz.js → studio-k5n4es74.js} +4 -4
- package/dist/chunks/{studio-ccv2svc6.js → studio-k6hbx2fc.js} +4 -4
- package/dist/chunks/{studio-9tmebf0s.js → studio-kqh7fxn6.js} +4 -4
- package/dist/chunks/{studio-q0mvbaq6.js → studio-kyw47pet.js} +4 -4
- package/dist/chunks/studio-mkw17ngg.js +5 -0
- package/dist/chunks/{studio-x9hsze61.js → studio-myb4mf0h.js} +4 -4
- package/dist/chunks/studio-n4qq1n57.js +5 -0
- package/dist/chunks/studio-nfmpmkqb.js +5 -0
- package/dist/chunks/studio-nfwacw31.js +5 -0
- package/dist/chunks/{studio-rthyg42z.js → studio-nm86874b.js} +172 -172
- package/dist/chunks/studio-nqexty8x.js +16 -0
- package/dist/chunks/studio-nr0kcqc6.js +5 -0
- package/dist/chunks/{studio-jsgf2q5k.js → studio-nvfa137z.js} +5 -5
- package/dist/chunks/studio-psh8mwnw.js +4 -0
- package/dist/chunks/studio-qd0cycm4.js +9 -0
- package/dist/chunks/{studio-tfkznv39.js → studio-qevf5z9d.js} +4 -4
- package/dist/chunks/studio-qs5fmhtj.js +14 -0
- package/dist/chunks/studio-ry4789ng.js +7 -0
- package/dist/chunks/studio-s4fq9jht.js +5 -0
- package/dist/chunks/studio-sc35ttdk.js +5 -0
- package/dist/chunks/studio-sm2f0sc6.js +6 -0
- package/dist/chunks/{studio-3qeh9t0h.js → studio-spza69tb.js} +5 -5
- package/dist/chunks/studio-t6dqnnft.js +5 -0
- package/dist/chunks/{studio-43sd2mam.js → studio-tfmhnwyr.js} +3 -3
- package/dist/chunks/studio-tn7v8gey.js +6 -0
- package/dist/chunks/{studio-tft6r105.js → studio-trcfer2b.js} +4 -4
- package/dist/chunks/studio-tyw7tk0x.js +5 -0
- package/dist/chunks/{studio-jcnsdaep.js → studio-tyzgte21.js} +4 -4
- package/dist/chunks/studio-vtey9w98.js +5 -0
- package/dist/chunks/studio-ws2r1d7e.js +5 -0
- package/dist/chunks/studio-x2trkhk5.js +5 -0
- package/dist/chunks/{studio-mn0476ag.js → studio-xzgp0cp7.js} +4 -4
- package/dist/chunks/studio-y47090vq.js +5 -0
- package/dist/chunks/{studio-5g0rprdt.js → studio-yjh9gddd.js} +5 -5
- package/dist/chunks/studio-ywf9y1e2.js +5 -0
- package/dist/chunks/{studio-k7evxqh4.js → studio-z1p91z5a.js} +4 -4
- package/dist/chunks/studio-ztppbam0.js +5 -0
- package/dist/chunks/{toast-host-1yg5ar8d.js → toast-host-g3r2s0kn.js} +2 -2
- package/dist/chunks/toast-w11qpkyz.js +4 -0
- package/dist/chunks/{tooltip-yypz28gq.js → tooltip-dj1pvgz7.js} +2 -2
- package/dist/chunks/{tree-9xa4hm7n.js → tree-j0ebwr5s.js} +2 -2
- package/dist/chunks/{tsMode-epyfz1hv.js → tsMode-byje4a01.js} +5 -5
- package/dist/chunks/workspace-7q4arnt3.js +4 -0
- package/dist/chunks/workspace-home-ge027kr6.js +4 -0
- package/dist/chunks/{ws-client-bv552sfx.js → ws-client-h09h6sqg.js} +3 -3
- package/dist/iframe-entry.js +14 -14
- package/dist/manifest.json +76 -76
- package/dist/studio.js +88 -88
- package/package.json +15 -16
- package/src/browse/component-examples.ts +15 -224
- package/src/browse/library-preview.ts +6 -13
- package/src/browse/preview-root.ts +7 -4
- package/src/canvas/canvas-utils.ts +18 -4
- package/src/canvas/iframe-editable-root.ts +13 -4
- package/src/canvas/iframe-entry.ts +3 -1
- package/src/canvas/iframe-interaction.ts +11 -2
- package/src/canvas/iframe-render.ts +25 -3
- package/src/canvas/preview-placeholder.ts +120 -0
- package/src/collab/collab-session.ts +6 -2
- package/src/commands/context.ts +4 -0
- package/src/commands/defaults.ts +2 -0
- package/src/commands/live-context.ts +2 -0
- package/src/editor/shortcuts.ts +3 -0
- package/src/files/files.ts +6 -3
- package/src/new-project/new-project-modal.ts +1 -4
- package/src/panels/ai-panel.ts +27 -34
- package/src/panels/component-preview.ts +5 -0
- package/src/panels/pane-context.ts +43 -18
- package/src/panels/site-model.ts +7 -19
- package/src/panels/site-panel.ts +2 -25
- package/src/panels/stylebook-doc.ts +2 -53
- package/src/platform.ts +20 -0
- package/src/platforms/devserver.ts +2 -120
- package/src/services/ai-ask.ts +29 -171
- package/src/services/ai-command-tools.ts +40 -50
- package/src/services/ai-import-tools.ts +4 -5
- package/src/services/ai-project-tools.ts +13 -3
- package/src/services/ai-tools.ts +26 -564
- package/src/services/ai-writes.ts +84 -2
- package/src/services/document-assistant.ts +29 -58
- package/src/services/harness/assistant-tools.ts +68 -0
- package/src/services/harness/interaction-store.ts +118 -0
- package/src/services/harness/studio-documents.ts +105 -0
- package/src/services/harness/turn-hooks.ts +1 -6
- package/src/services/project-adoption.ts +8 -16
- package/src/services/references.ts +0 -0
- package/src/services/tool-executor.ts +25 -22
- package/src/state.ts +3 -13
- package/src/style/stylebook-specimens.ts +11 -15
- package/src/surfaces/files-panel.json +12 -0
- package/src/surfaces/files-panel.ts +5 -2
- package/src/surfaces/pane-context.json +286 -265
- package/src/surfaces/pane-context.ts +17 -8
- package/src/surfaces/welcome.ts +4 -1
- package/src/tabs/selection.ts +14 -109
- package/src/tabs/tab.ts +15 -7
- package/src/tabs/transact.ts +316 -124
- package/src/types.ts +13 -8
- package/src/utils/geometry.ts +49 -2
- package/dist/chunks/adapter-5tphg7xe.js +0 -4
- package/dist/chunks/add-new-flow-psym14sn.js +0 -4
- package/dist/chunks/cf-account-picker-haqazq5r.js +0 -4
- package/dist/chunks/cf-settings-h2wrh6hq.js +0 -4
- package/dist/chunks/color-m7r1vk54.js +0 -4
- package/dist/chunks/components-r22xca09.js +0 -4
- package/dist/chunks/content-source-mmppmcyg.js +0 -4
- package/dist/chunks/editor-ccd9jwsa.js +0 -4
- package/dist/chunks/entry-commands-6qxz9e8p.js +0 -4
- package/dist/chunks/file-ops-qnab36ek.js +0 -4
- package/dist/chunks/files-rcn56qvm.js +0 -4
- package/dist/chunks/format-host-yxz0kjjs.js +0 -4
- package/dist/chunks/fs-events-d1qxq4z4.js +0 -4
- package/dist/chunks/grid-open-4z1g062t.js +0 -4
- package/dist/chunks/iframe-host-ssv7kyj0.js +0 -4
- package/dist/chunks/index-f0jn7nnp.js +0 -4
- package/dist/chunks/jx-validate-ttasrbh7.js +0 -4
- package/dist/chunks/layers-bgyr11tr.js +0 -4
- package/dist/chunks/layers-panel-7ez66zeq.js +0 -4
- package/dist/chunks/lit-html-v9gh687x.js +0 -4
- package/dist/chunks/media-library-sq468wts.js +0 -4
- package/dist/chunks/media-picker-shfe59pt.js +0 -4
- package/dist/chunks/monaco-buffer-3afgwvbp.js +0 -4
- package/dist/chunks/notify-kzrjr3fv.js +0 -4
- package/dist/chunks/parse-v77xtwv7.js +0 -4
- package/dist/chunks/platform-7v4rtd7m.js +0 -4
- package/dist/chunks/publish-panel-2z9gw8ee.js +0 -4
- package/dist/chunks/publish-workspace-wrc1dgwx.js +0 -4
- package/dist/chunks/quick-search-n0t0eqxb.js +0 -4
- package/dist/chunks/references-9547rg5s.js +0 -4
- package/dist/chunks/right-panel-wsgnr9pn.js +0 -4
- package/dist/chunks/source-control-kwktr9y6.js +0 -4
- package/dist/chunks/studio-03ct6yfv.js +0 -9
- package/dist/chunks/studio-07rcfje3.js +0 -5
- package/dist/chunks/studio-3e54qh39.js +0 -7
- package/dist/chunks/studio-3exxhz5g.js +0 -5
- package/dist/chunks/studio-3qqjeep5.js +0 -6
- package/dist/chunks/studio-4hp8pkyt.js +0 -5
- package/dist/chunks/studio-58xg6j2q.js +0 -9
- package/dist/chunks/studio-6m380wp7.js +0 -5
- package/dist/chunks/studio-80jyh1xh.js +0 -4
- package/dist/chunks/studio-8vcvfs7r.js +0 -6
- package/dist/chunks/studio-bavb31r0.js +0 -5
- package/dist/chunks/studio-c05wdnt3.js +0 -5
- package/dist/chunks/studio-d5grtb9e.js +0 -16
- package/dist/chunks/studio-df0baea9.js +0 -5
- package/dist/chunks/studio-dgk4dqtx.js +0 -7
- package/dist/chunks/studio-e1g64q43.js +0 -5
- package/dist/chunks/studio-ed1hp6zf.js +0 -6
- package/dist/chunks/studio-ed3xx40h.js +0 -7
- package/dist/chunks/studio-f14e1zdj.js +0 -5
- package/dist/chunks/studio-fyh0jc96.js +0 -5
- package/dist/chunks/studio-gcxk20n7.js +0 -5
- package/dist/chunks/studio-kt3pjkwd.js +0 -5
- package/dist/chunks/studio-m8g16bgz.js +0 -5
- package/dist/chunks/studio-mx1smyq0.js +0 -5
- package/dist/chunks/studio-nqxqf8p2.js +0 -4
- package/dist/chunks/studio-p4nrkvqr.js +0 -5
- package/dist/chunks/studio-pgmvdv7z.js +0 -7
- package/dist/chunks/studio-ph84avkf.js +0 -5
- package/dist/chunks/studio-q0tccd43.js +0 -5
- package/dist/chunks/studio-q7rtx6zq.js +0 -14
- package/dist/chunks/studio-qwdqwkj0.js +0 -5
- package/dist/chunks/studio-rj9eamf8.js +0 -5
- package/dist/chunks/studio-rptgsk96.js +0 -5
- package/dist/chunks/studio-s19tp1xr.js +0 -5
- package/dist/chunks/studio-syreb644.js +0 -5
- package/dist/chunks/studio-tf9jryb1.js +0 -10
- package/dist/chunks/studio-txf2kysx.js +0 -5
- package/dist/chunks/studio-v8867ddv.js +0 -12
- package/dist/chunks/studio-vxq7fcvv.js +0 -5
- package/dist/chunks/studio-w4rz9hdk.js +0 -5
- package/dist/chunks/studio-wc649wss.js +0 -5
- package/dist/chunks/studio-wys23mxz.js +0 -5
- package/dist/chunks/studio-y3ahhdpx.js +0 -5
- package/dist/chunks/studio-z97c48fk.js +0 -5
- package/dist/chunks/studio-zat62m0c.js +0 -5
- package/dist/chunks/studio-zcd2e7yz.js +0 -5
- package/dist/chunks/toast-1gv0h53h.js +0 -4
- package/dist/chunks/workspace-dz7nxfhv.js +0 -4
- package/dist/chunks/workspace-home-xsd7hkjw.js +0 -4
- package/src/services/directory-picker.ts +0 -187
- package/src/services/gated-registry.ts +0 -77
package/src/utils/geometry.ts
CHANGED
|
@@ -9,9 +9,56 @@
|
|
|
9
9
|
* `getBoundingClientRect`/`elementFromPoint`/`elementsFromPoint` calls exist elsewhere in `src`.
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* Whether an element is `display: contents`, so it generates no box of its own (CSS Display §2.5).
|
|
14
|
+
* Component hosts are the common case: the host steps aside and its rendered root does the layout.
|
|
15
|
+
*/
|
|
16
|
+
export function isDisplayContents(el: Element): boolean {
|
|
17
|
+
return el.ownerDocument.defaultView?.getComputedStyle(el).display === "contents";
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Bounding rect of an element, in viewport coordinates.
|
|
22
|
+
*
|
|
23
|
+
* An element with no box (`display: contents`) answers a zero rect at the origin, which is useless
|
|
24
|
+
* for drawing a selection or hover box around it. Its visible extent is what its contents render,
|
|
25
|
+
* so it is measured as the union of its children's rects, each measured by this same rule. A Range
|
|
26
|
+
* over the contents is NOT enough: CSSOM View takes a selected child's own client rects and skips
|
|
27
|
+
* its descendants, so a component whose root is another `display: contents` component (a CTA
|
|
28
|
+
* wrapping a section) measured as only the text runs that happened to sit directly inside it. The
|
|
29
|
+
* style read happens only when the element's own rect is empty, so an ordinary element pays nothing
|
|
30
|
+
* for it.
|
|
31
|
+
*/
|
|
13
32
|
export function rectOf(el: Element): DOMRect {
|
|
14
|
-
|
|
33
|
+
const rect = el.getBoundingClientRect();
|
|
34
|
+
if (rect.width > 0 || rect.height > 0 || !el.hasChildNodes() || !isDisplayContents(el)) {
|
|
35
|
+
return rect;
|
|
36
|
+
}
|
|
37
|
+
let union: { bottom: number; left: number; right: number; top: number } | null = null;
|
|
38
|
+
for (const child of el.childNodes) {
|
|
39
|
+
let r: DOMRect | null = null;
|
|
40
|
+
if (child instanceof Element) {
|
|
41
|
+
r = rectOf(child);
|
|
42
|
+
} else if (child.nodeType === Node.TEXT_NODE) {
|
|
43
|
+
const range = el.ownerDocument.createRange();
|
|
44
|
+
range.selectNodeContents(child);
|
|
45
|
+
r = range.getBoundingClientRect();
|
|
46
|
+
}
|
|
47
|
+
if (!r || (r.width === 0 && r.height === 0)) {
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
union = union
|
|
51
|
+
? {
|
|
52
|
+
bottom: Math.max(union.bottom, r.bottom),
|
|
53
|
+
left: Math.min(union.left, r.left),
|
|
54
|
+
right: Math.max(union.right, r.right),
|
|
55
|
+
top: Math.min(union.top, r.top),
|
|
56
|
+
}
|
|
57
|
+
: { bottom: r.bottom, left: r.left, right: r.right, top: r.top };
|
|
58
|
+
}
|
|
59
|
+
return union
|
|
60
|
+
? new DOMRect(union.left, union.top, union.right - union.left, union.bottom - union.top)
|
|
61
|
+
: rect;
|
|
15
62
|
}
|
|
16
63
|
|
|
17
64
|
/**
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{Q}from"./studio-nqxqf8p2.js";import{p}from"./studio-w4rz9hdk.js";import{g,C}from"./studio-43sd2mam.js";import"./studio-k3xxbagr.js";import{Pt,Nt,uh,ae}from"./studio-q7rtx6zq.js";import"./studio-8tr6cfrc.js";import{qe,ft,T,R,Jt,rt,tt}from"./studio-x9hsze61.js";import{Ot,Aa,ur,Oa}from"./studio-z97c48fk.js";import{Fn,Vt,Qt,Hi}from"./studio-c05wdnt3.js";import"./studio-kt3pjkwd.js";import{yS}from"./studio-tf9jryb1.js";import"./studio-fyh0jc96.js";import"./studio-8m0y2qe7.js";import"./studio-r5qy30vx.js";import"./studio-4hp8pkyt.js";import"./studio-s32578pn.js";import{ko,Kl}from"./studio-d5grtb9e.js";import"./studio-3e54qh39.js";import"./studio-y0n7yxea.js";import"./studio-5g0rprdt.js";import"./studio-ph84avkf.js";import{qc,Sa,Ca}from"./studio-3exxhz5g.js";import{Qu,kb}from"./studio-rj9eamf8.js";import{Ae,Ab}from"./studio-fbhxxc5f.js";import"./studio-nh6d342n.js";import"./studio-q0tccd43.js";import"./studio-syreb644.js";import"./studio-bavb31r0.js";import"./studio-x1x167jh.js";import"./studio-dgk4dqtx.js";import{K_,jE,hw,X_,yi}from"./studio-ed3xx40h.js";import"./studio-pbxa5fpc.js";import"./studio-ccv2svc6.js";import"./studio-07rcfje3.js";import"./studio-k1wvtp03.js";import{om}from"./studio-df0baea9.js";import"./studio-n0c5h6mf.js";import"./studio-03ct6yfv.js";import"./studio-mn0476ag.js";import{rE,qy}from"./studio-jsgf2q5k.js";import{Xg,ew,Bs,Nc,F_,nm,tw,j_,gE,el,H_,Fu,B_,uD,bE,im,Qg,vE,yE,wE,hD,pD,z_}from"./studio-f14e1zdj.js";import{Ug}from"./studio-rptgsk96.js";import{qg,Td,Ld}from"./studio-pgmvdv7z.js";import{Xy,pE}from"./studio-zat62m0c.js";import{Pl}from"./studio-txf2kysx.js";import"./studio-wys23mxz.js";import{YE,gw}from"./studio-mx1smyq0.js";import{ls}from"./studio-tft6r105.js";import"./studio-8vcvfs7r.js";import"./studio-9tmebf0s.js";import"./studio-3qeh9t0h.js";import{x,xn}from"./studio-gcxk20n7.js";import{n,v}from"./studio-vxq7fcvv.js";var z={$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}"}]};T("add-new",z);function D(e){return{...e,blocked:!e.canConfirm,invalid:e.error!=="",named:e.kind!=="media"}}function E(e){let t=document.createElement("div");t.style.pointerEvents="auto",t.setAttribute(qe,ft("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=g({...D(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:(m)=>{d.name=m,a.setName(m)},setLocalized:a.setLocalized,setOwnPage:a.setOwnPage,setUrl:(m)=>{d.url=m,a.setUrl(m)},toggleUrl:a.toggleUrl,togglePreset:a.togglePreset}),f=null,u=()=>{setTimeout(()=>{let m=f?.root;if(r||!(m instanceof HTMLElement))return;let c=m.querySelector('jx-textfield[part="name"]');if(c)uh(c,"all")},0)},b=R("add-new",d,t).then(async(m)=>{f=m;let c=m.root;if(l())return m.dispose(),c;if(await Jt(c),l())return c;if(Pt(c),d.named)u();return c});return{close(){let m=f?.root;if(m instanceof HTMLElement)Nt(m);f?.dispose(),f=null,t.remove(),o()},host:t,ready:b,update(m){Object.assign(d,D(m))}}}var y="Add new";async function W(){return(await rE()).map((t)=>({name:t.name,ref:t.path})).toSorted((t,r)=>t.name.localeCompare(r.name))}function _(){for(let e of K_("page")){if(e.ext===".json")continue;let t=Aa(e.ext,"serialize");if(t)return{ext:e.ext,name:t.name}}return null}function B(){let e=ur(),t=e?.extensions[0];return e&&t?{ext:t,name:e.name}:null}function J(){return Qt(x?.projectConfig??{}).i18n}async function V(e){let t={},{i18n:r}=Qt(x?.projectConfig??{});for(let o of await yS(e)){let l=Fn(Hi(o,r));if(l!==null)t[l]=o}return t}async function L(){await Ot().catch(()=>{});let e=await Promise.all(gw().map(async(t)=>{let r={dir:t.dir,ext:t.ext,formatName:z_(t),name:t.name,schema:t.schema};if(Qg(t))r.localeDirs=await V(t);return r}));return{i18n:J(),article:_(),collections:e,componentTags:Ae.map((t)=>t.tagName),copyableTags:Ae.filter((t)=>I(t)).map((t)=>t.tagName),contentFormat:B(),declaredContent:YE(),defaultLayout:x?.projectConfig?.defaults?.layout??null,hasSelection:Xy()!==null,layouts:await W()}}function I(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 Ae){let{path:r}=t;if(!I(t)||!n(r))continue;try{let o=JSON.parse(await p().readFile(r));if(v(o))e.set(t.tagName,o)}catch{}}return e}function U(e,t){let r=e.trim();if(r===Bs||r==="none"||r==="")return Bs;if(r===Nc)return Nc;let o=el(r);return t.find((a)=>el(a.ref)===o||el(a.ref)===`layouts/${o}`||el(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(im(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)=>el(a.ref));throw RangeError(`command "file.new" argument "template": "${e.template}" names no template — `+`declared: ${[Bs,Nc,...l].join(", ")}`)}if(e.kind==="collection")r.pageTemplate=o===Nc?Bs:o;else if(e.kind==="template")r.startFrom=o===Bs||o===Nc?"":o;else r.startFrom=o}return r}async function X(e){if(e.format===null)return ko(e.doc,null);return Oa(e.format,e.doc,{frontmatter:e.frontmatter??!0,mode:"roundtrip"})}async function F(e,t,r=!1){for(let o of hD(wE(e)))await Promise.all(o.map(async(l)=>{if(!r&&t.has(l))return;t.set(l,pD(l,t)?new Set:await hw(l))}))}function S(e){if(Ug(e),Ld(),e.some((t)=>t.startsWith("pages/")))kb(),qg();jE(e).then((t)=>{if(t)Ld(),xn("leftPanel")})}async function P(e,t,r){let o;try{o=await X(t)}catch(l){throw C.error(`Could not prepare ${e}.`,{detail:Q(l),path:e,source:y}),Error(`could not prepare ${e}`,{cause:l})}if(await X_(e,o,{quiet:r,source:y})===null)throw Error(`could not write ${e}`)}async function Z(e){let t=e.config,r=x?.projectConfig?.content,o=v(r)?{...r}:{};if(o[t.name]=t.entry,!(await Kl({content:o})).ok)return null;let a=["project.json"],d=[];for(let u of[{body:e.content,path:e.path},...e.extraWrites])try{await P(u.path,u.body,!0),a.push(u.path)}catch{d.push(u.path)}if(d.length===0)C.success(`Created the ${t.name} collection`);else C.warn(`Created the ${t.name} collection, but ${d.join(" and ")} could not be written.`,{source:y});S(a),om(t.name),rt("content.showCollection",{collection:t.name},y);let f={kind:"collection",path:`content/${t.name}`,wrote:a};if(e.route!==void 0)f.route=e.route;return f}async function M(e,t,r){if(e.kind==="media"){let l=await Ca(r,{dir:Sa,only:"media"});if(l.length===0)return null;let a=l.map((d)=>d.path);return S(a),rt("media.browse",{select:l[0].path},y),{kind:"media",path:Sa,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===F_){let l=await pE(e.tag);if(l===null)return null;return S([l]),await yi(l),o}try{await P(e.path,e.content,!1)}catch{return null}switch(S([e.path]),e.kind){case"component":{Ab(e.path,e.content.doc),await yi(e.path);break}case"template":{qy(),await yi(e.path);break}case"entry":{if(t.collection!==void 0)om(t.collection);await Pl(e.path);break}default:await yi(e.path)}return o}async function Je(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=vE(t,e.name,o,r),a=new Map;await F(l,a,!0);let d=yE(l,e.name,o,r,(u)=>a.get(u));if(d!=="")throw RangeError(`command "file.new": ${d}`);let f=await M(l,o,[]);if(f===null)throw Error(`file.new could not create ${l.path}; the reason is in Problems.`);return f}async function Ve(e){let t=await L(),r=t.collections.find((u)=>u.name===e);if(!r)return C.error(`"${e}" is not a collection this project declares.`,{source:y}),null;let o=`pages/${ls(e)||e}`,l=`${o}/[slug].json`;if((await hw(o)).has("[slug].json"))return C.error(`${l} already exists.`,{detail:"Open it in Design and point its $paths at this collection, or rename it first.",path:l,source:y}),null;let d=uD(r.schema,r.formatName!==null),f=bE(e,d,H_(Fu(t),t),t);try{await P(l,{doc:f,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===nm&&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 w(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)=>w(o.ref,o.name,t.defaultLayout!==null&&el(o.ref)===el(t.defaultLayout)?"the site's default":"a template",e.pageStart));if(t.article!==null)r.push(w(Nc,"Article","mostly writing",e.pageStart));return r.push(w(Bs,"Blank","no template",e.pageStart)),r}function ee(){let e=Xy();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=ew[e.kind],a=Xg.filter((s)=>s!=="entry"||t.collections.length>0).map((s)=>({checked:s===e.kind?"true":"false",hint:ew[s].hint,icon:ew[s].icon,id:s,label:ew[s].label})),d=r.config?.name??"",f=Qu(d===""?"items":d),u=t.i18n?.locales??[],b=t.collections.find((s)=>s.name===e.collection),m=u.length>0&&(e.kind==="page"||e.kind==="entry"&&b!==void 0&&Qg(b)),c=[...t.layouts.map((s)=>({label:s.name,value:s.ref})),{label:"No template",value:Bs}];return{canConfirm:o===""&&!e.busy,chordNote:te(),collection:e.collection,collectionOptions:t.collections.map((s)=>({label:Td(s.name),value:s.name})),componentChoices:[w("blank","Blank","an empty block",e.componentStart),w(F_,"Current selection",ee(),e.componentStart,t.hasSelection===!0?"":"Select an element on the canvas first."),w(nm,"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===nm,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:f,kind:e.kind,kindHint:l.hint,kindLabel:l.label,kinds:a,locale:e.locale,localeOptions:u.map((s)=>({label:Vt(s),value:s})),localeShown:m,localeSummary:u.join(", "),localizable:u.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:tw.filter((s)=>s!=="richText"||t.contentFormat!==null).map((s)=>{let N=e.fields.includes(s);return{icon:N?"check":"plus",id:s,label:j_[s].label,selected:N}}),route:r.route===void 0||r.route===""?"/":r.route,saved:r.saved,startChoices:q(e,t),templateOptions:c,uploadAccept:qc(),url:e.url,wrapChoices:[...t.layouts.map((s)=>w(s.ref,s.name,"keeps its frame around this one",e.wrap)),w("","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 Ye(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:im(e.locale,o)??o.i18n?.defaultLocale??"",localized:o.i18n!==null&&o.i18n!==void 0,componentStart:"blank",copyOf:"",dropActive:!1,editingUrl:!1,fields:[...gE],files:[],kind:oe(e,o),name:e.name??"",ownPage:!0,pageStart:B_(o,im(e.locale,o)??o.i18n?.defaultLocale??""),pageTemplate:Fu(o),templateChosen:e.template!==void 0,touched:(e.name??"")!=="",url:"",wrap:Fu(o)===Bs?"":Fu(o)};if(e.template!==void 0){let i=U(e.template,o.layouts);if(i!==null)a.pageStart=i,a.pageTemplate=i===Nc?Bs:i,a.wrap=i===Bs||i===Nc?"":i}if(o.contentFormat===null)a.fields=a.fields.filter((i)=>i!=="richText");let d=!1,f=null,u=()=>vE(a.kind,a.name,j(a),o),b=(i)=>yE(i,a.name,j(a),o,(h)=>l.get(h)),m=()=>{let i=u();if(r.handle?.update(O(a,o,i,b(i))),wE(i).some((h)=>!l.has(h)))F(i,l).then(()=>{if(!d){let h=u();r.handle?.update(O(a,o,h,b(h)))}})},c=(i)=>{i(),m()},s=async()=>{if(a.busy)return;a.touched=!0;let i=u();if(await F(i,l,!0),b(i)!==""){m();return}a.busy=!0,m();try{f=await M(i,j(a),a.files)}catch(k){C.error("Could not create it.",{detail:Q(k),source:y}),f=null}if(a.busy=!1,f===null){m();return}r.handle?.close()},N=u(),K=E({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(f)},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===nm&&o.componentDocs===void 0)Y().then((h)=>{if(o.componentDocs=h,a.copyOf==="")a.copyOf=h.keys().next().value??"";if(!d)m()})},pickLocale:(i)=>{c(()=>{if(a.locale=i,!a.templateChosen)a.pageStart=B_(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=u().route??"/";a.editingUrl=!a.editingUrl})},togglePreset:(i)=>{c(()=>{let h=tw.find((k)=>k===i);if(h===void 0)return;a.fields=a.fields.includes(h)?a.fields.filter((k)=>k!==h):[...a.fields,h]})}},layer:tt("dialog"),view:O(a,o,N,b(N))});r.handle=K,m()}export{Ve as addCollectionPage,Je as createDirect,Ye as openAddNew};
|
|
2
|
-
|
|
3
|
-
//# debugId=1A961F8D7C1772D864756E2164756E21
|
|
4
|
-
//# sourceMappingURL=add-new-flow-psym14sn.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{Q}from"./studio-nqxqf8p2.js";import{p,_e}from"./studio-w4rz9hdk.js";import{g}from"./studio-43sd2mam.js";import"./studio-k3xxbagr.js";import{Pt,Nt}from"./studio-q7rtx6zq.js";import"./studio-8tr6cfrc.js";import{qe,ft,T,R,Jt,tt}from"./studio-x9hsze61.js";import"./studio-dgk4dqtx.js";import"./studio-s32578pn.js";import"./studio-zcd2e7yz.js";import"./studio-4hp8pkyt.js";import{am}from"./studio-wc649wss.js";var d={$schema:"https://jxsuite.com/schema/v1",$id:"StudioCfAccountPicker",$description:"The Cloudflare account picker: which of the accounts this grant reaches should publishing and the assistant run against. A `jx-dialog`, so the platform owns modality, Escape, focus restoration and the backdrop — which is what retired the `sp-dialog-wrapper` this surface used to open by hand, along with the focus trap and the `aria-modal` slot `showDialog` wrapped around it. There is no confirming button: each row commits itself, because a picker whose answer is one of N rows has N answers rather than one. The adapter (`surfaces/cf-account-picker.ts`) hands in rows that are already strings and booleans — nothing here knows what `cf_account_required` is, which call refused, or whether the list came back empty because the grant reaches nothing or because Cloudflare could not be reached.",tagName:"jx-dialog",$props:{headline:"Choose a Cloudflare account",confirmLabel:"",cancelLabel:"Cancel",size:"sm"},attributes:{part:"cf-accounts"},oncancel:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},onclose:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},style:{$description:"The picker's own look. Four `.cf-account-picker*` rules in `styles/shell.css` become the parts below and one of them does not come with them: `min-width: 320px` was this surface sizing its own box, and `jx-dialog` is what sizes a dialog now — `sm` is `min(90vw, 24rem)`, which is wider than the 320px it asked for. The row shape came from `.prefs-account`, which the lit template BORROWED from Preferences › Accounts; it is copied here rather than shared, because a class in a stylesheet is a thing two surfaces can drift apart on and `preferences-dialog.ts` still draws its own rows from it. Three token repairs travel with them: `--spectrum-font-size-75` and `--spectrum-font-size-50` resolve only inside `<sp-theme>`, and a document mounted in the dialog layer is outside it, so every one of them would silently have taken its hard-coded fallback.",'& [part="picker"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-4)"},'& [part="intro"], & [part="empty"]':{$description:"The lede and the two absences read as the same secondary line, so they are one rule: the sentence over the list and the sentence drawn instead of it are the same voice.",margin:"0",fontSize:"var(--jx-text-md)",color:"var(--fg-dim)"},'& [part="failure"]':{$description:'A commit the broker refused, said above the list the reader is still looking at. It is not an announcement of the same thing twice: the list survives a refusal, because listing again is not what would fix an account Cloudflare will not accept, so the reason has to sit beside the rows that are still on offer. It is `failure` rather than `error` because every kit field draws a permanent, empty `[part="error"]` of its own, and the kit is light DOM: a rule on that name here would reach any field this dialog ever holds.',margin:"0",fontSize:"var(--jx-text-md)",color:"var(--danger)"},'& [part="fail"]':{$description:"The one state that offers a verb of its own. Retrying is right for a listing that never landed and wrong for a grant that genuinely reaches nothing, so the button lives in this branch rather than under both.",display:"flex",flexDirection:"column",alignItems:"flex-start",gap:"var(--jx-space-3)"},'& [part="list"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-2)"},'& [part="row"]':{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"var(--jx-space-4)",padding:"var(--jx-space-3)",border:"1px solid var(--border)",borderRadius:"var(--radius)"},'& [part="text"]':{$description:"`min-width: 0` lets the column shrink below its content, so the name and id reflow inside the row instead of pushing its own button off the end of it; what lets them reflow is their own `overflow-wrap`. Nothing here ellipsizes. Unlike Preferences › Accounts, the row does not wrap its button onto a line of its own: in an `sm` dialog the arithmetic (a 120px basis, the gap and a 105px button against a 236px row) would wrap every row at rest.",display:"flex",flexDirection:"column",gap:"var(--jx-space-1)",minWidth:"0"},'& [part="name"]':{$description:"`overflow-wrap: anywhere` because Cloudflare names a new account after the email that opened it (`name@example.com's Account`), and an address has no break opportunity in it.",color:"var(--fg)",overflowWrap:"anywhere"},'& [part="detail"]':{$description:"The account id under the name. Two Cloudflare accounts may carry the same name and the id is what is stored, so the row shows both rather than the half a reader would have to guess from. `overflow-wrap: anywhere` because the id is 32 hex digits with no break opportunity: it measured 203px in a 119px column and ran under the row's own button. It reflows rather than ellipsizing, because the id is the half that tells two same-named accounts apart.",fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)",overflowWrap:"anywhere"}},children:[{tagName:"div",attributes:{part:"picker"},children:[{tagName:"p",attributes:{part:"intro"},textContent:"Your Cloudflare login reaches more than one account. Publishing and the assistant both run against the one you pick; you can change it in Preferences › Accounts."},{tagName:"div",attributes:{part:"body-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/listState"},cases:{loading:{tagName:"p",attributes:{part:"empty"},textContent:"Reading your Cloudflare accounts…"},empty:{tagName:"p",attributes:{part:"empty"},textContent:"This Cloudflare login reaches no accounts. Create one at dash.cloudflare.com, then try again."},failed:{tagName:"div",attributes:{part:"fail"},children:[{tagName:"p",attributes:{part:"empty"},textContent:"${state.failureMessage}"},{tagName:"jx-button",attributes:{part:"retry"},$props:{size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/retry"},value:[]}]},children:[{tagName:"span",textContent:"Try again"}]}]},listed:{tagName:"div",attributes:{part:"listed",role:"none"},style:{display:"contents"},children:[{tagName:"div",attributes:{part:"failure-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasFailure"},cases:{true:{tagName:"p",attributes:{part:"failure"},textContent:"${state.failure}"}}},{tagName:"div",attributes:{part:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/rows"},key:{$ref:"$map/item/id"},map:{tagName:"div",attributes:{part:"row","data-account":"${$map.item.id}"},children:[{tagName:"div",attributes:{part:"text"},children:[{tagName:"span",attributes:{part:"name"},textContent:"${$map.item.name}"},{tagName:"span",attributes:{part:"detail"},textContent:"${$map.item.id}"}]},{tagName:"jx-button",attributes:{part:"choose"},$props:{size:"sm",variant:"accent",disabled:{$ref:"$map/item/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/choose"},value:[{$ref:"$map/item/id"}]}]},children:[{tagName:"span",textContent:"${$map.item.label}"}]}]}}]}]}}}]}]};T("cf-account-picker",d);function h(t){let a=t.choosing!=="";return{...t,failureMessage:`Cloudflare could not be reached: ${t.failure}`,hasFailure:t.failure!=="",listState:t.loading?"loading":t.accounts.length>0?"listed":t.failure!==""?"failed":"empty",rows:t.accounts.map((o)=>({busy:a,id:o.id,label:t.choosing===o.id?"Selecting…":"Use this account",name:o.name}))}}function f(t){let a=document.createElement("div");a.style.pointerEvents="auto",a.setAttribute(qe,ft("dialog","cf-accounts")),t.layer.append(a);let o=!1,s=()=>{if(o)return;o=!0,t.onClosed()},u=()=>o,n=g({...h({accounts:[],choosing:"",failure:"",loading:!0}),choose:(e)=>{t.onChoose(e)},closed:s,retry:()=>{t.onRetry()}}),l=null,c=R("cf-account-picker",n,a).then(async(e)=>{l=e;let i=e.root;if(u())return e.dispose(),i;if(await Jt(i),u())return i;return Pt(i),i});return{close(){if(o)return;let e=l?.root;if(e instanceof HTMLElement)Nt(e);l?.dispose(),l=null,a.remove(),s()},host:a,ready:c,update(e){Object.assign(n,h({accounts:e.accounts??n.accounts,choosing:e.choosing??n.choosing,failure:e.failure??n.failure,loading:e.loading??n.loading}))}}}function w(){if(!_e())return!1;let t=p();return Boolean(t.cfAccounts&&t.cfSelectAccount)}function H(){if(!w())return Promise.resolve(null);return new Promise((t)=>{let a=[],o="",s=!1,u=(r)=>{if(s)return;s=!0,c.close(),t(r)};async function n(){c.update({failure:"",loading:!0});let r="";try{a=await p().cfAccounts?.()??[]}catch(e){a=[],r=Q(e)}if(s)return;c.update({accounts:a,failure:r,loading:!1})}async function l(r){let e=a.find((i)=>i.id===r);if(!e||o!=="")return;o=r,c.update({choosing:r,failure:""});try{await p().cfSelectAccount?.({id:e.id,name:e.name})}catch(i){if(o="",!s)c.update({choosing:"",failure:Q(i)});return}am(),u(e)}let c=f({layer:tt("dialog"),onChoose:(r)=>{l(r)},onClosed:()=>{u(null)},onRetry:()=>{n()}});n()})}export{H as openCfAccountPicker};
|
|
2
|
-
|
|
3
|
-
//# debugId=F765F43C81817D7A64756E2164756E21
|
|
4
|
-
//# sourceMappingURL=cf-account-picker-haqazq5r.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{sb,ME,PE,J2,FE}from"./studio-zcd2e7yz.js";import"./studio-s32578pn.js";import"./studio-43sd2mam.js";import"./studio-w4rz9hdk.js";export{FE as clearCfConnection,PE as getCfAccountId,sb as getCfToken,J2 as setCfAccountId,ME as setCfToken};
|
|
2
|
-
|
|
3
|
-
//# debugId=EEC96313E20D039364756E2164756E21
|
|
4
|
-
//# sourceMappingURL=cf-settings-h2wrh6hq.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{o,m,h,K,d,g,T,P,N,B,k,_,V,M,ee}from"./iframe-entry-2zggzajv.js";export{m as ARROW_SIGN,o as clamp,V as contrastRatio,g as formatHex,k as formatOklch,P 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=6FC32DC8F60ED03564756E2164756E21
|
|
4
|
-
//# sourceMappingURL=color-m7r1vk54.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{Ae,Yw,_a,Ab,zc,Wc}from"./studio-fbhxxc5f.js";import"./studio-w4rz9hdk.js";export{Yw as _componentRegistryLoaded,zc as buildComponentInstance,Ae as componentRegistry,Wc as computeRelativePath,_a as loadComponentRegistry,Ab as noteComponentSaved};
|
|
2
|
-
|
|
3
|
-
//# debugId=BBE55E0CBC2EB35864756E2164756E21
|
|
4
|
-
//# sourceMappingURL=components-r22xca09.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{mb,vS,yS,gb,BT,zT,WT}from"./studio-tf9jryb1.js";import"./studio-q0tccd43.js";import"./studio-3qeh9t0h.js";import"./studio-y0n7yxea.js";import"./studio-3e54qh39.js";import"./studio-5g0rprdt.js";import"./studio-rj9eamf8.js";import"./studio-fbhxxc5f.js";import"./studio-d5grtb9e.js";import"./studio-nh6d342n.js";import"./studio-3exxhz5g.js";import"./studio-ph84avkf.js";import"./studio-4hp8pkyt.js";import"./studio-s32578pn.js";import"./studio-x9hsze61.js";import"./studio-k3xxbagr.js";import"./studio-q7rtx6zq.js";import"./studio-r5qy30vx.js";import"./studio-fyh0jc96.js";import"./studio-8m0y2qe7.js";import"./studio-c05wdnt3.js";import"./studio-kt3pjkwd.js";import"./studio-8tr6cfrc.js";import"./studio-43sd2mam.js";import"./studio-nqxqf8p2.js";import"./studio-z97c48fk.js";import"./studio-w4rz9hdk.js";export{vS as collectionDirs,mb as collectionInfo,yS as collectionSourceDirs,zT as createCollectionSource,WT as createPagesSource,gb as listCollectionEntryIds,BT as reloadDraftAwareGrids};
|
|
2
|
-
|
|
3
|
-
//# debugId=8396D19E89C990A864756E2164756E21
|
|
4
|
-
//# sourceMappingURL=content-source-mmppmcyg.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{F2,jf,j2,H2,B2,ip,z2,W2,ba,Y0,_d,V2,Wn,we}from"./studio-rthyg42z.js";export{F2 as CancellationTokenSource,jf as Emitter,j2 as KeyCode,H2 as KeyMod,ba as MarkerSeverity,Y0 as MarkerTag,B2 as Position,ip as Range,z2 as Selection,W2 as SelectionDirection,V2 as Token,_d as Uri,Wn as editor,we as languages};
|
|
2
|
-
|
|
3
|
-
//# debugId=5E5D1E1614C2B51564756E2164756E21
|
|
4
|
-
//# sourceMappingURL=editor-ccd9jwsa.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{z_,K2,xE}from"./studio-f14e1zdj.js";import"./studio-txf2kysx.js";import"./studio-df0baea9.js";import"./studio-03ct6yfv.js";import"./studio-ccv2svc6.js";import"./studio-07rcfje3.js";import"./studio-mx1smyq0.js";import"./studio-pbxa5fpc.js";import"./studio-n0c5h6mf.js";import"./studio-9tmebf0s.js";import"./studio-tf9jryb1.js";import"./studio-q0tccd43.js";import"./studio-3qeh9t0h.js";import"./studio-y0n7yxea.js";import"./studio-3e54qh39.js";import"./studio-5g0rprdt.js";import"./studio-rj9eamf8.js";import"./studio-fbhxxc5f.js";import"./studio-d5grtb9e.js";import"./studio-nh6d342n.js";import"./studio-3exxhz5g.js";import"./studio-ph84avkf.js";import"./studio-4hp8pkyt.js";import"./studio-s32578pn.js";import"./studio-x9hsze61.js";import"./studio-k3xxbagr.js";import"./studio-q7rtx6zq.js";import"./studio-r5qy30vx.js";import"./studio-fyh0jc96.js";import"./studio-8m0y2qe7.js";import"./studio-c05wdnt3.js";import"./studio-kt3pjkwd.js";import"./studio-8tr6cfrc.js";import"./studio-43sd2mam.js";import"./studio-nqxqf8p2.js";import"./studio-z97c48fk.js";import"./studio-w4rz9hdk.js";import"./studio-k1wvtp03.js";export{K2 as createEntry,z_ as entryFormatName,xE as registerContentCommands};
|
|
2
|
-
|
|
3
|
-
//# debugId=4C731D36DA9243A264756E2164756E21
|
|
4
|
-
//# sourceMappingURL=entry-commands-6qxz9e8p.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{oN,or,VT,iP,UT,Sp,qT,vb,yb}from"./studio-q0tccd43.js";import"./studio-3qeh9t0h.js";import"./studio-y0n7yxea.js";import"./studio-3e54qh39.js";import"./studio-5g0rprdt.js";import"./studio-rj9eamf8.js";import"./studio-fbhxxc5f.js";import"./studio-d5grtb9e.js";import"./studio-nh6d342n.js";import"./studio-3exxhz5g.js";import"./studio-ph84avkf.js";import"./studio-4hp8pkyt.js";import"./studio-s32578pn.js";import"./studio-x9hsze61.js";import"./studio-k3xxbagr.js";import"./studio-q7rtx6zq.js";import"./studio-r5qy30vx.js";import"./studio-fyh0jc96.js";import"./studio-8m0y2qe7.js";import"./studio-c05wdnt3.js";import"./studio-kt3pjkwd.js";import"./studio-8tr6cfrc.js";import"./studio-43sd2mam.js";import"./studio-nqxqf8p2.js";import"./studio-z97c48fk.js";import"./studio-w4rz9hdk.js";export{vb as confirmFileDelete,qT as exportFile,iP as openFile,VT as parseCollabSource,oN as parseFormatSource,or as parseSourceForPath,yb as renamePromptMessage,Sp as saveFile,UT as setDocumentSavedListener};
|
|
2
|
-
|
|
3
|
-
//# debugId=EBACF7DF9C64F73264756E2164756E21
|
|
4
|
-
//# sourceMappingURL=file-ops-qnab36ek.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{zs,cm,jE,HE,C2,BE,zE,WE,Z_,k2,cb,VE,E2,T2,UE,PD,L2,$2,hw,X_,FD,qE,I2,yi,Q_,GE,KE,dm,JE,R2,D2}from"./studio-ed3xx40h.js";import"./studio-wys23mxz.js";import"./studio-mx1smyq0.js";import"./studio-bavb31r0.js";import"./studio-pbxa5fpc.js";import"./studio-syreb644.js";import"./studio-dgk4dqtx.js";import"./studio-x1x167jh.js";import"./studio-9tmebf0s.js";import"./studio-tf9jryb1.js";import"./studio-q0tccd43.js";import"./studio-3qeh9t0h.js";import"./studio-y0n7yxea.js";import"./studio-3e54qh39.js";import"./studio-5g0rprdt.js";import"./studio-rj9eamf8.js";import"./studio-fbhxxc5f.js";import"./studio-d5grtb9e.js";import"./studio-nh6d342n.js";import"./studio-3exxhz5g.js";import"./studio-ph84avkf.js";import"./studio-4hp8pkyt.js";import"./studio-s32578pn.js";import"./studio-x9hsze61.js";import"./studio-k3xxbagr.js";import"./studio-q7rtx6zq.js";import"./studio-r5qy30vx.js";import"./studio-fyh0jc96.js";import"./studio-8m0y2qe7.js";import"./studio-c05wdnt3.js";import"./studio-kt3pjkwd.js";import"./studio-8tr6cfrc.js";import"./studio-43sd2mam.js";import"./studio-nqxqf8p2.js";import"./studio-z97c48fk.js";import"./studio-w4rz9hdk.js";export{E2 as FILE_ROW_HEIGHT,UE as canMoveInto,$2 as createFileIn,Z_ as findHomePage,WE as initProjectRepo,T2 as isFileDrag,hw as listTakenNames,zs as loadDirectory,BE as loadProject,cm as loadProjectDirectories,R2 as mountFilesPanel,FD as notifyMoveOutcome,Q_ as openFileInPane,yi as openFileInTab,k2 as openHomePage,cb as openLastSessionOrHome,zE as openProject,qE as parentDirOf,L2 as pickAndUploadTo,jE as refreshProjectDirectoriesFor,JE as registerFilesPanel,GE as reloadCleanTab,dm as reloadFileInTab,KE as reloadTabsIfChanged,VE as setSessionWorkspaceShow,C2 as setShowIgnoredFiles,I2 as settleRename,HE as showIgnoredFiles,D2 as unmountFilesPanel,PD as uploadFilesToDir,X_ as writeNewFile};
|
|
2
|
-
|
|
3
|
-
//# debugId=091B8581988B034464756E2164756E21
|
|
4
|
-
//# sourceMappingURL=files-rcn56qvm.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{Ot,$h,od,kv,Gx,ic,tu,Aa,Wi,nf,cn,hl,Ev,ur,sI,Oa,aI}from"./studio-z97c48fk.js";import"./studio-w4rz9hdk.js";export{ur as defaultContentFormat,hl as documentExtensions,Aa as formatByExtension,Wi as formatByName,cn as formatForPath,sI as formatParse,Oa as formatSerialize,Gx as getExtensionCatalog,kv as getExtensions,tu as getFormats,od as loadExtensions,Ot as loadFormats,nf as noFormatError,ic as refreshExtensionUi,$h as refreshFormats,Ev as routedPageExtensions,aI as splitFormatDocument};
|
|
2
|
-
|
|
3
|
-
//# debugId=087D3EDC646D052464756E2164756E21
|
|
4
|
-
//# sourceMappingURL=format-host-yxz0kjjs.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{$a,Vd,L$}from"./studio-r5qy30vx.js";import"./studio-fyh0jc96.js";import"./studio-8m0y2qe7.js";import"./studio-c05wdnt3.js";import"./studio-kt3pjkwd.js";import"./studio-8tr6cfrc.js";import"./studio-43sd2mam.js";import"./studio-nqxqf8p2.js";import"./studio-z97c48fk.js";import"./studio-w4rz9hdk.js";export{Vd as isRecentLocal,$a as markLocalMutation,L$ as startFsSync};
|
|
2
|
-
|
|
3
|
-
//# debugId=C9F2BDE5983CD3C264756E2164756E21
|
|
4
|
-
//# sourceMappingURL=fs-events-d1qxq4z4.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{tT,VD,oS,nT,iT}from"./studio-bavb31r0.js";import"./studio-tf9jryb1.js";import"./studio-q0tccd43.js";import"./studio-3qeh9t0h.js";import"./studio-y0n7yxea.js";import"./studio-3e54qh39.js";import"./studio-5g0rprdt.js";import"./studio-rj9eamf8.js";import"./studio-fbhxxc5f.js";import"./studio-d5grtb9e.js";import"./studio-nh6d342n.js";import"./studio-3exxhz5g.js";import"./studio-ph84avkf.js";import"./studio-4hp8pkyt.js";import"./studio-s32578pn.js";import"./studio-x9hsze61.js";import"./studio-k3xxbagr.js";import"./studio-q7rtx6zq.js";import"./studio-r5qy30vx.js";import"./studio-fyh0jc96.js";import"./studio-8m0y2qe7.js";import"./studio-c05wdnt3.js";import"./studio-kt3pjkwd.js";import"./studio-8tr6cfrc.js";import"./studio-43sd2mam.js";import"./studio-nqxqf8p2.js";import"./studio-z97c48fk.js";import"./studio-w4rz9hdk.js";export{VD as openCollectionGrid,tT as openCsvGridTab,nT as openGridSourcePicker,oS as openPagesGrid,iT as registerGridCommands};
|
|
2
|
-
|
|
3
|
-
//# debugId=F0A3763A6B3E82A364756E2164756E21
|
|
4
|
-
//# sourceMappingURL=grid-open-4z1g062t.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{pL,fL,mL,gL,KS,Ib,Rb,JS,ql,bL,vL,yL,Db,P2,oP,wL,Bc,qw,Gw,xL,_L,SL,CL,kL,EL,TL,LL,$L,IL,RL,DL,YS,NL,Nb,AL,OL,ML,PL,FL,jL,Kw,HL,Gl,BL,rh,zL,Jw,ZS}from"./studio-rj9eamf8.js";import"./studio-fbhxxc5f.js";import"./studio-d5grtb9e.js";import"./studio-nh6d342n.js";import"./studio-ph84avkf.js";import"./studio-s32578pn.js";import"./studio-q7rtx6zq.js";import"./studio-8m0y2qe7.js";import"./studio-c05wdnt3.js";import"./studio-kt3pjkwd.js";import"./studio-8tr6cfrc.js";import"./studio-43sd2mam.js";import"./studio-nqxqf8p2.js";import"./studio-z97c48fk.js";import"./studio-w4rz9hdk.js";export{wL as adoptCanvasPreviewMode,fL as allowAutoRequestsOnNextRender,Rb as beginDragSession,bL as canvasIdleBlockers,yL as canvasPointAt,Gw as clearDropIndicator,Jw as commitActiveEditSession,JS as currentDragSession,NL as dragHostTab,qw as endDragSession,gL as flushCanvasEdits,ZS as getEditBarAnchorRect,Gl as getEditSnapshot,ql as hostDragGeometry,KS as hostForCanvas,TL as isCaretActive,Ib as liveDragHostAt,oP as measureInCanvas,AL as mountIframeCanvas,OL as mountStylebookCanvas,HL as panToStylebookTag,vL as pointerAnchor,rh as postApplyFormat,ML as postColorSchemeToLiveHosts,DL as postDialogOpen,Bc as postDragMessage,PL as postLocaleToLiveHosts,zL as postOpenSlash,YS as postPatchToHosts,RL as postPopoverOpen,FL as postRedefineElementToLiveHosts,jL as postSiteStyleToLiveHosts,Kw as postStyleUpdateToStylebookHosts,Nb as releaseCanvasHosts,mL as requestCanvasEval,Db as revealCanvasPath,P2 as revealCanvasPathIn,pL as sawIframeDragOver,kL as setCanvasContextMenuHandler,$L as setCanvasPointerDownHandler,CL as setCanvasSlashHandler,SL as setFileDropHandler,IL as setIframePatchEscalation,_L as setInsertZoneClickHandler,BL as setKeymapSource,xL as setNativeDragEnterHandler,EL as setStylebookHitHandler,LL as setToolbarRefresh};
|
|
2
|
-
|
|
3
|
-
//# debugId=9E42D4B45921496164756E2164756E21
|
|
4
|
-
//# sourceMappingURL=iframe-host-ssv7kyj0.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{zI,WI,VI,UI,qI,_u,GI,Dg,KI,Hf,JI,Bf,l2,X0,pk,c2,d2,u2,h2,Su,p2,f2,m2,fk,mk,g2,b2,v2,y2,gk,w2}from"./studio-80jyh1xh.js";import{Sd,Q0,Ng,x2,QI,eR,tR,nR,Ag,yk,wk}from"./studio-83mk4bgg.js";import{Ws,X2}from"./studio-tfkznv39.js";import{$e,oe,vv,yv}from"./studio-p4nrkvqr.js";export{qI as COLLAB_SCHEMA_VERSION,Su as CollabPathError,Ag as EnvelopeError,eR as FRAME_AWARENESS,nR as FRAME_CONTROL,tR as FRAME_DOC_CLOSE,QI as FRAME_DOC_SYNC,WI as FRONTMATTER_KEY,d2 as LOCAL_ORIGIN,zI as META_KEY,u2 as MIRROR_ORIGIN,gk as PRESENCE_PALETTE,h2 as SEED_ORIGIN,UI as SOURCE_KEY,VI as STRUCTURE_KEY,x2 as UndoManager,Sd as YDoc,g2 as acquireSourceCanonical,yv as applyDocOpToDoc,p2 as applyDocOpsToY,fk as canonicalOf,mk as canonicalRevOf,vv as childArray,$e as cloneValue,w2 as colorForKey,Ng as createAbsolutePositionFromRelativePosition,Q0 as createRelativePositionFromTypeIndex,wk as decodeFrame,Ws as deepEqual,X2 as diffDocs,yk as encodeFrame,GI as frontmatterMap,oe as getNodeAtPath,y2 as isSourceReconciler,_u as metaMap,v2 as otherSourceEditors,b2 as releaseSourceCanonical,m2 as replaceYStructure,X0 as resolveYPath,c2 as seedStructure,KI as sourceText,Dg as structureMap,Hf as toYChildren,JI as toYNode,pk as updateSourceText,l2 as yDocToJson,f2 as yEventsToDocOps,Bf as yValueToJson};
|
|
2
|
-
|
|
3
|
-
//# debugId=11BE2D06C371185F64756E2164756E21
|
|
4
|
-
//# sourceMappingURL=index-f0jn7nnp.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{tt,v$,Wb,y$,Ko,gC,xi,Xs,Vb,w$}from"./studio-x9hsze61.js";import"./studio-k3xxbagr.js";import"./studio-q7rtx6zq.js";import"./studio-8tr6cfrc.js";import"./studio-43sd2mam.js";import"./studio-nqxqf8p2.js";export{Vb as clearLayerSlot,Xs as getLayerSlot,v$ as initLayers,Wb as isModalOpen,y$ as isPopoverOpen,tt as layerHost,w$ as overlayIdleBlockers,Ko as showConfirmDialog,xi as showPromptDialog,gC as showSaveDiscardDialog};
|
|
2
|
-
|
|
3
|
-
//# debugId=0276DB44A812559B64756E2164756E21
|
|
4
|
-
//# sourceMappingURL=layers-bgyr11tr.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{S2,Ok}from"./studio-ed1hp6zf.js";import"./studio-58xg6j2q.js";import"./studio-3qqjeep5.js";import"./studio-zat62m0c.js";import"./studio-mn0476ag.js";import"./studio-ccv2svc6.js";import"./studio-07rcfje3.js";import"./studio-wys23mxz.js";import"./studio-pbxa5fpc.js";import"./studio-8vcvfs7r.js";import"./studio-n0c5h6mf.js";import"./studio-9tmebf0s.js";import"./studio-q0tccd43.js";import"./studio-3qeh9t0h.js";import"./studio-y0n7yxea.js";import"./studio-3e54qh39.js";import"./studio-5g0rprdt.js";import"./studio-rj9eamf8.js";import"./studio-fbhxxc5f.js";import"./studio-d5grtb9e.js";import"./studio-nh6d342n.js";import"./studio-3exxhz5g.js";import"./studio-ph84avkf.js";import"./studio-4hp8pkyt.js";import"./studio-s32578pn.js";import"./studio-x9hsze61.js";import"./studio-k3xxbagr.js";import"./studio-q7rtx6zq.js";import"./studio-r5qy30vx.js";import"./studio-fyh0jc96.js";import"./studio-8m0y2qe7.js";import"./studio-c05wdnt3.js";import"./studio-kt3pjkwd.js";import"./studio-8tr6cfrc.js";import"./studio-43sd2mam.js";import"./studio-nqxqf8p2.js";import"./studio-z97c48fk.js";import"./studio-w4rz9hdk.js";import"./studio-k1wvtp03.js";export{Ok as registerLayersPanel,S2 as startLayerTitleEdit};
|
|
2
|
-
|
|
3
|
-
//# debugId=97975D17FE1853C664756E2164756E21
|
|
4
|
-
//# sourceMappingURL=layers-panel-7ez66zeq.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{Q2,ww,N2,hS,xw,LT,$T,A2,eP,tP,pS,nP,IT}from"./studio-qwdqwkj0.js";import"./studio-8vcvfs7r.js";import"./studio-n0c5h6mf.js";import"./studio-x1x167jh.js";import"./studio-9tmebf0s.js";import"./studio-q0tccd43.js";import"./studio-3qeh9t0h.js";import"./studio-y0n7yxea.js";import"./studio-3e54qh39.js";import"./studio-5g0rprdt.js";import"./studio-rj9eamf8.js";import"./studio-fbhxxc5f.js";import"./studio-d5grtb9e.js";import"./studio-nh6d342n.js";import"./studio-3exxhz5g.js";import"./studio-ph84avkf.js";import"./studio-4hp8pkyt.js";import"./studio-s32578pn.js";import"./studio-x9hsze61.js";import"./studio-k3xxbagr.js";import"./studio-q7rtx6zq.js";import"./studio-r5qy30vx.js";import"./studio-fyh0jc96.js";import"./studio-8m0y2qe7.js";import"./studio-c05wdnt3.js";import"./studio-kt3pjkwd.js";import"./studio-8tr6cfrc.js";import"./studio-43sd2mam.js";import"./studio-nqxqf8p2.js";import"./studio-z97c48fk.js";import"./studio-w4rz9hdk.js";export{Q2 as MEDIA_HOME_MODE,A2 as applyMediaBrowse,pS as closeMediaPickDialog,N2 as deleteMediaFile,xw as detachMediaLibrary,$T as focusMediaHome,hS as mediaLibraryMounted,nP as openMediaPickDialog,LT as renderMediaLibrary,tP as requestMediaReplace,eP as requestMediaUpload,IT as resetMediaLibrary,ww as selectedEntry};
|
|
2
|
-
|
|
3
|
-
//# debugId=4BDA9C7EB25EF86164756E2164756E21
|
|
4
|
-
//# sourceMappingURL=media-library-sq468wts.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{DT,NT,Uu,kw,O2,gS,M2,bS,Hl,pm}from"./studio-n0c5h6mf.js";import"./studio-9tmebf0s.js";import"./studio-3exxhz5g.js";import"./studio-ph84avkf.js";import"./studio-x9hsze61.js";import"./studio-k3xxbagr.js";import"./studio-q7rtx6zq.js";import"./studio-fyh0jc96.js";import"./studio-8m0y2qe7.js";import"./studio-c05wdnt3.js";import"./studio-kt3pjkwd.js";import"./studio-8tr6cfrc.js";import"./studio-43sd2mam.js";import"./studio-nqxqf8p2.js";import"./studio-z97c48fk.js";import"./studio-w4rz9hdk.js";export{kw as invalidateMediaCache,DT as isMediaScanPath,Hl as mountMediaPicker,NT as onProjectMediaChange,O2 as openFullMediaPicker,bS as pickAndUpload,Uu as projectMediaFiles,gS as showMediaPickerPopover,pm as unmountMediaPicker,M2 as uploadAndAssign};
|
|
2
|
-
|
|
3
|
-
//# debugId=7B4F1E225769872264756E2164756E21
|
|
4
|
-
//# sourceMappingURL=media-picker-shfe59pt.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{Gp,fv,mv,J$,Xd,Kp,Qd,Jp}from"./studio-kt3pjkwd.js";import"./studio-43sd2mam.js";export{Gp as BUFFER_COMMIT,Xd as bufferIsLive,Kp as bufferMovedOn,fv as bufferWrites,J$ as cancelBufferWrites,mv as commitBufferWrites,Qd as commitTabBuffers,Jp as tabBufferUnsaved};
|
|
2
|
-
|
|
3
|
-
//# debugId=5AC57D3D529AD0BD64756E2164756E21
|
|
4
|
-
//# sourceMappingURL=monaco-buffer-3afgwvbp.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{Ck,q2}from"./studio-6m380wp7.js";import"./studio-zcd2e7yz.js";import"./studio-3e54qh39.js";import"./studio-d5grtb9e.js";import"./studio-4hp8pkyt.js";import"./studio-s32578pn.js";import"./studio-x9hsze61.js";import"./studio-k3xxbagr.js";import"./studio-q7rtx6zq.js";import"./studio-c05wdnt3.js";import"./studio-kt3pjkwd.js";import"./studio-8tr6cfrc.js";import"./studio-43sd2mam.js";import"./studio-nqxqf8p2.js";import"./studio-z97c48fk.js";import"./studio-w4rz9hdk.js";export{q2 as openPublishPanel,Ck as seedPublishConnected};
|
|
2
|
-
|
|
3
|
-
//# debugId=3C12EB4EE230771864756E2164756E21
|
|
4
|
-
//# sourceMappingURL=publish-panel-2z9gw8ee.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{oR,kk,o_,r_,Ek}from"./studio-a2bvaptz.js";import"./studio-y3ahhdpx.js";import"./studio-syreb644.js";import"./studio-dgk4dqtx.js";import"./studio-x1x167jh.js";import"./studio-9tmebf0s.js";import"./studio-y0n7yxea.js";import"./studio-3e54qh39.js";import"./studio-5g0rprdt.js";import"./studio-rj9eamf8.js";import"./studio-fbhxxc5f.js";import"./studio-d5grtb9e.js";import"./studio-nh6d342n.js";import"./studio-3exxhz5g.js";import"./studio-ph84avkf.js";import"./studio-4hp8pkyt.js";import"./studio-s32578pn.js";import"./studio-x9hsze61.js";import"./studio-k3xxbagr.js";import"./studio-q7rtx6zq.js";import"./studio-fyh0jc96.js";import"./studio-8m0y2qe7.js";import"./studio-c05wdnt3.js";import"./studio-kt3pjkwd.js";import"./studio-8tr6cfrc.js";import"./studio-43sd2mam.js";import"./studio-nqxqf8p2.js";import"./studio-z97c48fk.js";import"./studio-w4rz9hdk.js";export{r_ as detachPublishWorkspace,kk as focusPublishHome,o_ as publishWorkspaceMounted,Ek as renderPublishWorkspace,oR as showPublishTab};
|
|
2
|
-
|
|
3
|
-
//# debugId=C72A8347A69D3AD664756E2164756E21
|
|
4
|
-
//# sourceMappingURL=publish-workspace-wrc1dgwx.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{Tk,Fg}from"./studio-k7evxqh4.js";import"./studio-ed3xx40h.js";import"./studio-wys23mxz.js";import"./studio-mx1smyq0.js";import"./studio-bavb31r0.js";import"./studio-pbxa5fpc.js";import"./studio-syreb644.js";import"./studio-dgk4dqtx.js";import"./studio-x1x167jh.js";import"./studio-9tmebf0s.js";import"./studio-tf9jryb1.js";import"./studio-q0tccd43.js";import"./studio-3qeh9t0h.js";import"./studio-y0n7yxea.js";import"./studio-3e54qh39.js";import"./studio-5g0rprdt.js";import"./studio-rj9eamf8.js";import"./studio-fbhxxc5f.js";import"./studio-d5grtb9e.js";import"./studio-nh6d342n.js";import"./studio-3exxhz5g.js";import"./studio-ph84avkf.js";import"./studio-4hp8pkyt.js";import"./studio-s32578pn.js";import"./studio-x9hsze61.js";import"./studio-k3xxbagr.js";import"./studio-q7rtx6zq.js";import"./studio-r5qy30vx.js";import"./studio-fyh0jc96.js";import"./studio-8m0y2qe7.js";import"./studio-c05wdnt3.js";import"./studio-kt3pjkwd.js";import"./studio-8tr6cfrc.js";import"./studio-43sd2mam.js";import"./studio-nqxqf8p2.js";import"./studio-z97c48fk.js";import"./studio-w4rz9hdk.js";export{Tk as initQuickSearch,Fg as openQuickSearch};
|
|
2
|
-
|
|
3
|
-
//# debugId=2E71FDC804D7285564756E2164756E21
|
|
4
|
-
//# sourceMappingURL=quick-search-n0t0eqxb.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{ph,al,ar,$$,Er,Yb,wC,Zb,I$,Xb}from"./studio-fyh0jc96.js";import"./studio-nqxqf8p2.js";import"./studio-w4rz9hdk.js";export{Er as invalidateUsages,ar as loadUsages,Yb as onUsagesInvalidated,al as peekUsages,$$ as retryUsages,wC as splitUsages,Xb as usageFiles,Zb as usageHeadline,I$ as usageWarning,ph as usagesSupported};
|
|
2
|
-
|
|
3
|
-
//# debugId=D389F19C51717FFB64756E2164756E21
|
|
4
|
-
//# sourceMappingURL=references-9547rg5s.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{hR,Lk,G2,$k,jg,Nl,ku}from"./studio-b7y5mr30.js";import"./studio-58xg6j2q.js";import"./studio-3qqjeep5.js";import"./studio-jsgf2q5k.js";import"./studio-mn0476ag.js";import"./studio-df0baea9.js";import"./studio-03ct6yfv.js";import"./studio-07rcfje3.js";import"./studio-ed3xx40h.js";import"./studio-wys23mxz.js";import"./studio-mx1smyq0.js";import"./studio-bavb31r0.js";import"./studio-pbxa5fpc.js";import"./studio-syreb644.js";import"./studio-dgk4dqtx.js";import"./studio-8vcvfs7r.js";import"./studio-n0c5h6mf.js";import"./studio-x1x167jh.js";import"./studio-9tmebf0s.js";import"./studio-tf9jryb1.js";import"./studio-q0tccd43.js";import"./studio-3qeh9t0h.js";import"./studio-y0n7yxea.js";import"./studio-3e54qh39.js";import"./studio-5g0rprdt.js";import"./studio-rj9eamf8.js";import"./studio-fbhxxc5f.js";import"./studio-d5grtb9e.js";import"./studio-nh6d342n.js";import"./studio-3exxhz5g.js";import"./studio-ph84avkf.js";import"./studio-4hp8pkyt.js";import"./studio-s32578pn.js";import"./studio-x9hsze61.js";import"./studio-k3xxbagr.js";import"./studio-q7rtx6zq.js";import"./studio-r5qy30vx.js";import"./studio-fyh0jc96.js";import"./studio-8m0y2qe7.js";import"./studio-c05wdnt3.js";import"./studio-kt3pjkwd.js";import"./studio-8tr6cfrc.js";import"./studio-43sd2mam.js";import"./studio-nqxqf8p2.js";import"./studio-z97c48fk.js";import"./studio-w4rz9hdk.js";import"./studio-k1wvtp03.js";export{Nl as inspectorTab,Lk as mount,jg as render,$k as restingInspectorTab,ku as setInspectorTab,hR as stripOf,G2 as unmount};
|
|
2
|
-
|
|
3
|
-
//# debugId=5862772FBC9DB06E64756E2164756E21
|
|
4
|
-
//# sourceMappingURL=right-panel-wsgnr9pn.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{Vs,rT,aS,lS,hb,xa,sT,aT,lT,cT,dT,uT,hT,pT,fT,mT,gT,bT,vT,yT,cS,wT,xT,yw,_T,ST,pb,CT}from"./studio-syreb644.js";import"./studio-dgk4dqtx.js";import"./studio-x1x167jh.js";import"./studio-9tmebf0s.js";import"./studio-y0n7yxea.js";import"./studio-3e54qh39.js";import"./studio-5g0rprdt.js";import"./studio-rj9eamf8.js";import"./studio-fbhxxc5f.js";import"./studio-d5grtb9e.js";import"./studio-nh6d342n.js";import"./studio-3exxhz5g.js";import"./studio-ph84avkf.js";import"./studio-4hp8pkyt.js";import"./studio-s32578pn.js";import"./studio-x9hsze61.js";import"./studio-k3xxbagr.js";import"./studio-q7rtx6zq.js";import"./studio-fyh0jc96.js";import"./studio-8m0y2qe7.js";import"./studio-c05wdnt3.js";import"./studio-kt3pjkwd.js";import"./studio-8tr6cfrc.js";import"./studio-43sd2mam.js";import"./studio-nqxqf8p2.js";import"./studio-z97c48fk.js";import"./studio-w4rz9hdk.js";export{ST as armGitPoll,cS as changeRow,yT as checkoutBranch,pb as cleanupSourceControl,lS as cloneRepository,xT as commitRow,vT as createBranch,bT as discardFile,aS as fetchGitLog,hT as fetchRemote,wT as groupFilesByComponent,gT as includeNewChanges,_T as lastUpdatedLabel,lT as loadDiffForLens,rT as noteFileSaved,uT as openFileComparison,xa as platformHostsGit,sT as platformOpensPullRequests,hb as platformSupportsClone,pT as pullRemote,Vs as refreshGitStatus,CT as registerSourceControlCommands,yw as relativeDate,dT as runCloneRepository,mT as setAllIncluded,fT as setIncluded,cT as setSourceControlDeps,aT as statusTag};
|
|
2
|
-
|
|
3
|
-
//# debugId=76FBB9F24A7966C964756E2164756E21
|
|
4
|
-
//# sourceMappingURL=source-control-kwktr9y6.js.map
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{p,_e}from"./studio-w4rz9hdk.js";import{Q}from"./studio-nqxqf8p2.js";import{ge,ta,ne,g}from"./studio-43sd2mam.js";import{Qt,yx,Xl,Bi,Y,Kd,Un,m,Bt}from"./studio-c05wdnt3.js";import{Ev}from"./studio-z97c48fk.js";import{Io}from"./studio-8tr6cfrc.js";import{hs}from"./studio-8m0y2qe7.js";import{Ys,on,Dp}from"./studio-ph84avkf.js";import{rr}from"./studio-3exxhz5g.js";import{Md,ks,wp,Bl,Oc}from"./studio-tf9jryb1.js";import{ae}from"./studio-q7rtx6zq.js";import{wi,T,R}from"./studio-x9hsze61.js";import{_r,Xu,$S,Sb,ci,Ul}from"./studio-rj9eamf8.js";import{ir,tN}from"./studio-q0tccd43.js";import{jl,gp}from"./studio-07rcfje3.js";import{wa,Ac,HD,BD}from"./studio-mx1smyq0.js";import{vp}from"./studio-e1g64q43.js";import{x}from"./studio-gcxk20n7.js";import{$e}from"./studio-p4nrkvqr.js";import{n,Z,Xe,S,v}from"./studio-vxq7fcvv.js";import{le}from"./studio-qgh13jtz.js";var he=["title","name","label","heading"];function pp(e,t={}){let r=(i)=>{for(let o of he){let s=i.find((a)=>a.toLowerCase()===o);if(s!==void 0)return s}return null};return r(Object.keys(e?.properties??{}))??r(Object.keys(t).filter((i)=>n(t[i])))}function P(e){if(e instanceof Date)return tb(e);if(n(e))return e;if(Z(e)||Xe(e))return String(e);if(Array.isArray(e))return e.filter((t)=>n(t)||Z(t)).map(String).join(", ");return""}function be(e,t){return Object.fromEntries(Object.keys(e?.properties??{}).filter((r)=>(r in t)).map((r)=>[r,P(t[r])]))}var xe=["date","published","publishedAt","pubDate","publishDate"];function U_(e,t){for(let[r,i]of Object.entries(e?.properties??{}))if(i.format==="date"||i.format==="date-time")return r;return xe.find((r)=>(r in t))??null}function SE(e){let t=e?.properties??{};return U_(e,Object.fromEntries(Object.keys(t).map((r)=>[r,""])))}function tb(e){if(e instanceof Date)return Number.isNaN(e.getTime())?"":e.toISOString().slice(0,10);if(!n(e))return"";let t=/^(\d{4}-\d{2}-\d{2})/.exec(e.trim());if(t)return t[1];let r=new Date(e);if(e.trim()===""||Number.isNaN(r.getTime()))return"";if(!e.includes(":")){let i=String(r.getMonth()+1).padStart(2,"0"),o=String(r.getDate()).padStart(2,"0");return`${r.getFullYear()}-${i}-${o}`}return r.toISOString().slice(0,10)}function O(e){let t=e.split("/").pop()??e,r=t.lastIndexOf(".");return r>0?t.slice(0,r):t}function B(e,t){if(t.startsWith("/"))return`public${t}`;let r=e.includes("/")?e.slice(0,e.lastIndexOf("/")):"",i=[...r===""?[]:r.split("/"),...t.split("/")],o=[];for(let s of i){if(s===""||s===".")continue;if(s==="..")o.pop();else o.push(s)}return o.join("/")}var W=/^[a-z][\d+.a-z-]*:/i;function Ee(e,t){let r=t.trim();if(r==="")return"";return W.test(r)?r:rr(B(e,r))}function q(e){if(n(e))return e.split(",")[0]?.trim()??"";if(Array.isArray(e)){let[t]=e;return t===void 0?"":q(t)}if(v(e)){let{src:t}=e;return n(t)?t:""}return""}function U(e){if(e.format==="image")return!0;let t=e.properties?.src;if(e.type==="object"&&t?.type==="string")return!0;return e.type==="array"&&e.items!==void 0&&U(e.items)}function CE(e,t,r){for(let[i,o]of Object.entries(r?.properties??{}))if(U(o)){let s=Ee(e,q(t[i]));if(s!=="")return s}for(let i of Object.values(t)){if(!n(i)||W.test(i))continue;let o=i.lastIndexOf(".");if(o>0&&Dp(i.slice(o)))return rr(B(e,i))}return""}function X(e,t,r){let i=wa(t)?.schema??null,o=pp(i,r),s=o===null?void 0:r[o],a=Bl(r),l=U_(i,r);return{date:l===null?"":tb(r[l]),fields:be(i,r),path:e,status:Oc(i,r)?a?"Draft":"Published":"",thumb:CE(e,r,i),title:n(s)&&s.trim()!==""?s:O(e)}}async function we(e){try{let t=await p().readFile(e);if(e.endsWith(".json")){let o=JSON.parse(t);return S(o)&&!Array.isArray(o)?o:{}}let{parseSourceForPath:r}=await (le("qnab36ek"),import("./file-ops-qnab36ek.js"));return(await r(e,t)).frontmatter}catch{return{}}}var w=new Map,E=new Map,j=0,L=new Set,K=200;async function Se(e,t){let r=t.slice(0,K),i=await Promise.all(r.map(async(s)=>X(s,e,await we(s)))),o=t.slice(K).map((s)=>({date:"",path:s,status:"",thumb:"",title:O(s)}));return[...i,...o]}function nw(e,t){let r=t.join(`
|
|
2
|
-
`),i=w.get(e);if(i?.key===r)return i.entries;if(!_e())return t.map((s)=>({date:"",path:s,status:"",thumb:"",title:O(s)}));let o=`${e}
|
|
3
|
-
${r}`;if(!E.has(o)){let s=j,a=Se(e,t).then((l)=>{if(E.get(o)===a)E.delete(o);if(s===j){w.set(e,{entries:l,key:r});for(let c of L)c()}return l});E.set(o,a)}return null}function Fe(e,t,r){let i=w.get(t),o=i?.entries.findIndex((a)=>a.path===e)??-1;if(!i||o===-1)return!1;let s=i.entries.with(o,X(e,t,r));w.set(t,{entries:s,key:i.key});for(let a of L)a();return!0}function fD(e,t){let r=Ul(e);if(e===null||r===null||r===ci)return!1;return Fe(e,r,t)}function kE(){j+=1,w.clear(),E.clear()}function iw(e){return L.add(e),()=>{L.delete(e)}}var Le=/^\d{4}-\d{2}-\d{2}/,y="entry",b=g(new Map);function k(e){let t=b.get(e.id);if(t===void 0)return null;if("key"in t)return t.key;return ir(e)?.state.rows[t.row]?.key??null}function ve(e){return b.has(e.id)}function A(e,t){b.set(e.id,{key:t})}function Ce(e){b.delete(e.id)}function h(e){return ve(e)&&ir(e)!==null}function ee(e){let t=ir(e),r=k(e);if(!t||r===null)return{};let i={};for(let o of t.state.columns){let s=t.buffer.effectiveValue(r,o.field);if(s===null||s==="")continue;if(o.kind==="date"&&n(s)&&!Le.test(s)){i[o.field]=tb(s)||s;continue}i[o.field]=S(s)&&!Array.isArray(s)?s.$ref:s}return i}function Te(e){if(e===void 0||e===null)return null;if(Array.isArray(e))return e.map((t)=>n(t)?t:JSON.stringify(t));if(n(e)||Z(e)||Xe(e))return e;return JSON.stringify(e)}function I(e,t){let r=ir(e),i=k(e);if(!r||i===null)return;let o=new Set(r.state.columns.map((s)=>s.field));r.buffer.group(()=>{for(let[s,a]of Object.entries(t))if(o.has(s))r.buffer.setCell(i,s,Te(a))})}function F(e){let t=ir(e),r=k(e),i=t?.state.rows??[],o=r===null?-1:i.findIndex((s)=>s.key===r);return{index:o,next:o===-1?null:i[o+1]?.key??null,previous:o<=0?null:i[o-1]?.key??null,total:i.length}}async function mD(e,t){let{openFileInTab:r}=await (le("rcn56qvm"),import("./files-rcn56qvm.js"));await r(e);let i=m.tabs.get(e)??null;if(!i||!ir(i))return i;if(!b.has(i.id))i.scope.run(()=>{ta(()=>Ce(i))});if(b.set(i.id,{row:t}),!i.capabilities.modes.includes(y))i.capabilities.modes.unshift(y);return i.session.ui.canvasMode=y,i.session.ui.preview=!1,Bt(i.id),i}function te(e){return e.doc.sourceFormat==null&&e.doc.mode!=="content"}function Fl(e){if(h(e))return ee(e);return te(e)?e.doc.document:e.doc.content.frontmatter}function Re(e,t,r){let i=e.doc.document,o=Object.hasOwn(i,t)?$e(i[t]):void 0,s=r===void 0||r===null||r==="";if(s)delete i[t];else i[t]=r;let a=s?void 0:$e(r);Bi({forward:{key:t,op:"set-key",path:[],value:a},inverse:{key:t,op:"set-key",path:[],value:o}}),e.doc.dirty=!0,tN()}function _(e,t,r){if(h(e))I(e,{[t]:r});else if(te(e))Re(e,t,r);else Kd(e,t,r)}function q_(e,t){if(h(e)){I(e,t);return}Y(e,(r)=>{for(let[i,o]of Object.entries(t))_(r,i,o)})}var re={$schema:"https://jxsuite.com/schema/v1",$id:"StudioEntryEditor",$description:"The Entry editor (site-architecture.md §7.4) — one content entry's fields, in a pane, as a Jx document over the kit. The adapter (`surfaces/entry-editor.ts`) hands in a projection; `content/entry-editor.ts` decides everything in it — which collection the file belongs to, which record its fields live in, which required keys are absent and what a draft flag commits into. The FORM is an island: a schema is `ui/schema-form.ts`'s subject, so this document renders an empty `fields` node and the flow places the element that engine hands back (studio-ui-guidelines.md §9.3, §9.4). That is the whole of the difference between this and the card the lit version drew, and it is why the engine converting in batch 7 is what unblocked this one.",tagName:"div",attributes:{part:"entry","data-jx-region":"${state.region}"},style:{$description:"What `.entry-editor`, `.entry-editor-header`, `.entry-editor-collection`, `.entry-draft-switch`, `.entry-editor-fields`, `.entry-editor-note` and `.entry-editor-empty` said in `styles/overlays.css`, keyed on `part` and re-pointed at the studio token layer. This editor was the only emitter of all seven, so those rules are dead in the stylesheet from here; a central sweep removes them rather than this change, which owns no stylesheet. Every `--spectrum-font-size-*` reference is gone rather than renamed: those names resolve only inside `<sp-theme>`, and a pane editor is mounted outside it, so each would silently have taken its hard-coded fallback.",height:"100%",padding:"var(--jx-space-5)",overflowY:"auto",background:"var(--bg-panel)",'& [part="header"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-4)",marginBottom:"var(--jx-space-5)"},'& [part="name"]':{margin:"0",fontSize:"var(--jx-text-lg)",fontWeight:"600",color:"var(--fg)"},'& [part="collection"]':{padding:"1px var(--jx-space-3)",borderRadius:"var(--radius)",background:"var(--bg)",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"},'& [part="draft"]':{$description:"Pushed to the far end of the header rather than placed there: the heading and the collection chip are both content-width, so `margin-left: auto` is what keeps the switch on the right edge whatever the entry is called.",marginLeft:"auto"},'& [part="fields"]':{$description:"The schema form's host is `display: contents`, so its rows are the flex items of THIS box — which is why the column lives here and not inside the engine.",display:"flex",flexDirection:"column"},'& [part="note"]':{margin:"0 0 var(--jx-space-4)",color:"var(--fg-dim)",fontSize:"var(--jx-text-md)",lineHeight:"1.5"},'& [part="empty"]':{display:"flex",maxWidth:"46ch",flexDirection:"column",alignItems:"flex-start",gap:"var(--jx-space-3)",color:"var(--fg-dim)",fontSize:"var(--jx-text-md)",lineHeight:"1.5"},'& [part="record-nav"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-2)",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"}},children:[{tagName:"div",attributes:{part:"stage-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/stage"},cases:{entry:{tagName:"div",attributes:{part:"body",role:"none"},style:{display:"contents"},children:[{tagName:"div",attributes:{part:"header"},children:[{tagName:"h3",attributes:{part:"name"},textContent:"${state.name}"},{tagName:"span",attributes:{part:"collection"},textContent:"${state.collection}"},{tagName:"div",attributes:{part:"record-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/recordNav"},cases:{shown:{$description:"A record of a file-backed collection (a CSV row): which row of the file this is, the rows either side of it, and the grid that shows them all. A file entry has no neighbours to step to, so it draws none of this.",tagName:"div",attributes:{part:"record-nav",role:"group","aria-label":"Records"},children:[{tagName:"jx-action-button",attributes:{part:"previous"},$props:{size:"sm",quiet:!0,label:"Previous record",hint:"Previous record",disabled:{$ref:"#/state/previousDisabled"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/showPrevious"},value:[]}]},children:[{tagName:"span",textContent:"‹ Previous"}]},{tagName:"span",attributes:{part:"place"},textContent:"${state.place}"},{tagName:"jx-action-button",attributes:{part:"next"},$props:{size:"sm",quiet:!0,label:"Next record",hint:"Next record",disabled:{$ref:"#/state/nextDisabled"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/showNext"},value:[]}]},children:[{tagName:"span",textContent:"Next ›"}]},{tagName:"jx-action-button",attributes:{part:"grid"},$props:{size:"sm",quiet:!0,label:"Edit in grid",hint:"Every record of the file, as a table"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openGrid"},value:[]}]},children:[{tagName:"span",textContent:"Edit in grid"}]}]}}},{tagName:"div",attributes:{part:"draft-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/draftAxis"},cases:{shown:{$description:"No `label`: the slotted word is on screen and carries the name, so an aria-label would be read twice. The tooltip is `hint`, which is what DRAFT_MEANING has always been.",tagName:"jx-switch",attributes:{part:"draft"},$props:{checked:{$ref:"#/state/draft"},hint:"${state.draftHint}",size:"sm"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setDraft"},value:[{$ref:"event#/target/checked"}]}]},children:[{tagName:"span",textContent:"Draft"}]}}}]},{tagName:"div",attributes:{part:"note-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/noteState"},cases:{shown:{tagName:"p",attributes:{part:"note"},textContent:"${state.note}"}}},{$description:"An island: `ui/schema-form.ts` draws this entry's fields into this node, and nothing in this document knows what a schema is.",tagName:"div",attributes:{part:"fields","data-jx-region":"${state.fieldsRegion}"}}]},empty:{$description:"The mode is reachable from the palette and from `__jxAutomation` on any tab, so this state is real: it names the reason and the fix rather than drawing an empty form.",tagName:"div",attributes:{part:"empty"},children:[{tagName:"p",attributes:{part:"empty-line"},textContent:"${state.emptyLine}"},{tagName:"p",attributes:{part:"note"},children:[{tagName:"span",textContent:"A collection is a "},{tagName:"code",textContent:"content"},{tagName:"span",textContent:" entry in "},{tagName:"code",textContent:"project.json"},{tagName:"span",textContent:" whose "},{tagName:"code",textContent:"source"},{tagName:"span",textContent:" directory contains this file and which declares a "},{tagName:"code",textContent:"schema"},{tagName:"span",textContent:"."}]},{tagName:"jx-action-button",attributes:{part:"content-types"},$props:{label:"Content types",size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openContentTypes"},value:[]}]},children:[{tagName:"span",textContent:"Content types…"}]}]}}}]};T("entry-editor",re);function ie(e,t){e.region=t.region,e.fieldsRegion=t.fieldsRegion,e.stage=t.stage,e.name=t.name,e.collection=t.collection,e.draftAxis=t.draftAxis,e.draft=t.draft,e.draftHint=t.draftHint,e.noteState=t.noteState,e.note=t.note,e.emptyLine=t.emptyLine,e.recordNav=t.recordNav,e.place=t.place,e.previousDisabled=t.previousDisabled,e.nextDisabled=t.nextDisabled}function Ne(e){let t=n(e)?void 0:e.attributes?.part;return n(t)?t:""}function oe(e,t,r,i){e.replaceChildren();let o=g({collection:"",draft:!1,draftAxis:"hidden",draftHint:"",emptyLine:"",fieldsRegion:"",name:"",nextDisabled:!0,note:"",noteState:"hidden",openContentTypes:r.openContentTypes,openGrid:r.openGrid,place:"",previousDisabled:!0,recordNav:"hidden",region:"",setDraft:r.setDraft,showNext:r.showNext,showPrevious:r.showPrevious,stage:"empty"});ie(o,t);let s=null,a=!1,l=R("entry-editor",o,e,{onNodeCreated:(c,d,f)=>{if(c instanceof HTMLElement&&Ne(f)==="fields")i.fieldsSlot(c)}}).then((c)=>{let d=c.root;if(a)return c.dispose(),d;return s=c,d});return{attached:()=>{if(a)return!1;let c=s?.root;return c===void 0?!0:c instanceof HTMLElement&&e.contains(c)},dispose(){a=!0,s?.dispose(),s=null},ready:l,update:(c)=>ie(o,c)}}var H=g(new Map);function se(e,t){H.set(e,t)}function gD(e){return e?H.get(e):void 0}function bD(e){H.delete(e)}function M(e){return e.replaceAll("\\","/").replace(/^(?:\.\/)+/,"").replace(/\/+$/,"")}function je(e){if(e.endsWith("/"))return!1;let t=e.slice(e.lastIndexOf("/")+1);return/\.[a-z\d]+$/i.test(t)}function ce(e,t){let r=[];for(let s of e)r.push(M(s));let i=[],o=t?.content??{};for(let s of Object.values(o)){if(!n(s.source)||s.source===""||je(s.source))continue;let a=M(s.source),l=a.indexOf(Io);if(l!==-1)a=M(a.slice(0,l));if(a===""||a===".")continue;if(![...r,...i].some((d)=>a===d||a.startsWith(`${d}/`)))i.push(a)}return i.length===0?e:[...e,...i]}function Pe(e,t){let r=Ul(e);if(r===null)return null;if(r===ci)return t===void 0||Xu(e,t)?r:null;let i=Un(e);if(!i||i.name!==r||!i.def.format||i.ext===null)return r;return e.toLowerCase().endsWith(i.ext.toLowerCase())?r:null}var Oe=new Set(["node_modules",".git",".jx",".cache"]);async function de(e,t,r,i,o,s=!1,a){let l;try{l=await hs(()=>t.listDirectory(e))}catch(d){if(!s)i.push({dir:e,error:Q(d)});return}let c=[];for(let d of l){if(d.type==="directory"){if(!Oe.has(d.name))c.push(d.path);continue}let f=on(d.name);r.push({collection:Pe(d.path,a),ext:f,locale:yx(d.path,o)??void 0,media:Ys.has(f),modified:d.modified,name:d.name,path:d.path,size:d.size,type:f||"file"})}await Promise.all(c.map((d)=>de(d,t,r,i,o,!1,a)))}async function rm(e,t,r=new Set,i){let o=[],s=[],{i18n:a}=Qt(x?.projectConfig??{});return await Promise.all(e.map((l)=>de(l,t,o,s,a,r.has(l),i))),o.sort((l,c)=>l.path.localeCompare(c.path)),{failures:s,files:o}}function EE(e,t){let r=e.filter((s)=>s.collection===t.collection),i=t.query.trim().toLowerCase();if(i)r=r.filter((s)=>s.name.toLowerCase().includes(i)||s.path.toLowerCase().includes(i));let o=t.locale?.trim();if(o)r=r.filter((s)=>s.locale===o);return r}var sm=["table","cards","calendar","board"],ow={board:"Board",calendar:"Calendar",cards:"Cards",table:"Table"};var vD=new Set(["cards"]),ke=/^(\d{4}-\d{2}-\d{2})/;function TE(e){let t=ke.exec(e.name);if(t)return t[1];if(e.modified){let r=vp(new Date(e.modified));if(r)return r}return null}function nb(){return Qt(x?.projectConfig??{}).i18n?.locales??[]}function yD(e){let t=new Set;for(let r of e)if(r.locale)t.add(r.locale);return nb().filter((r)=>t.has(r))}function wD(e,t=TE){let r=new Map,i=[];for(let s of e){let a=t(s);if(a===null){i.push(s);continue}let l=r.get(a);if(l)l.push(s);else r.set(a,[s])}return{days:[...r.entries()].map(([s,a])=>({date:s,files:a})).toSorted((s,a)=>a.date.localeCompare(s.date)),undated:i}}function Ae(e){let t=e.lastIndexOf("/");return t===-1?".":e.slice(0,t)}function xD(e){let t=new Map;for(let r of e){let i=Ae(r.path),o=t.get(i);if(o)o.push(r);else t.set(i,[r])}return[...t.entries()].map(([r,i])=>({files:i,group:r})).toSorted((r,i)=>r.group.localeCompare(i.group))}function Ie(e,t,r,i){let o=pp(e,t),s=o===null?"":t[o]??"",a=Object.values(t).find((l)=>l.trim()!=="");return(s||a||i||`Row ${r+1}`).trim()}function He(e){let{headers:t,rows:r}=Md(e);return r.flatMap((i,o)=>i.some((s)=>s.trim()!=="")?[{fields:Object.fromEntries(t.map((s,a)=>[s,i[a]??""])),row:o}]:[])}function Me(e){let t;try{t=JSON.parse(e)}catch{return null}let r=(i)=>S(i)&&!Array.isArray(i)?Object.fromEntries(Object.entries(i).map(([o,s])=>[o,P(s)])):{};if(!Array.isArray(t))return[{fields:r(t),row:0,single:!0}];return t.map((i,o)=>({fields:r(i),row:o}))}function ue(e,t,r){let i=e.toLowerCase(),o=i.endsWith(".csv")?He(t):i.endsWith(".json")?Me(t):null;if(o===null)return null;let s=(e.split("/").pop()??e).replace(/\.[^.]+$/,"");return o.map(({fields:a,row:l,single:c},d)=>({fields:a,index:d,row:l,title:Ie(r,a,d,c?s:"")}))}function fe(e,t){return`${e}#${t+1}`}var G="The Content workspace lists files; it does not edit them in the list. Rename, duplicate or delete from the file's context menu, or open the file to edit it.";function Ge(e){return`field:${e}`}function _D(e){return e.startsWith("field:")?e.slice(6):null}var Ve=6,me=new Set(["image","markdown","html","richtext"]);function V(e){return Sb($S(e))}function SD(e,t){return Object.entries(e?.properties??{}).filter(([r,i])=>{if(t.has(r)||r===ks)return!1;if(i.type==="object"||n(i.format)&&me.has(i.format))return!1;let o=i.items?.format;return i.type!=="array"||i.items?.type==="string"&&!(n(o)&&me.has(o))}).slice(0,Ve).map(([r,i])=>{let o={name:r,title:V(r)};if(i.type==="array")o.list=!0;if(i.type==="number"||i.type==="integer"||i.format==="date"||i.format==="date-time")o.measure=!0;return o})}function Je(e){let t=[{editable:!1,field:"title",kind:"string",title:"Title",widthHint:240},{editable:!1,field:"url",kind:"string",pk:!0,title:"URL",widthHint:200},{editable:!1,field:"template",kind:"string",title:"Template",widthHint:140}];if(e?.status)t.push({editable:!1,field:"status",kind:"string",title:"Status",widthHint:100});if(e?.locale)t.push({editable:!1,field:"locale",kind:"string",title:"Language",widthHint:110});return t.push({editable:!1,field:"modified",kind:"date",title:"Edited",widthHint:120}),t}function LE(e=ci,t){let r=[...t?.locale?[{editable:!1,field:"locale",kind:"string",title:"Locale",widthHint:90}]:[],{editable:!1,field:"modified",kind:"date",title:"Modified",widthHint:160},{editable:!1,field:"path",kind:"readonly",title:"Path",widthHint:320}];if(e===ci)return Je(t);let i=[{editable:!1,field:"title",kind:"string",title:"Title",widthHint:260}];if(t?.status)i.push({editable:!1,field:"status",kind:"string",title:"Status",widthHint:100});if(t?.date)i.push({editable:!1,field:"date",kind:"date",title:"Date",widthHint:120});for(let o of t?.fields??[])i.push({editable:!1,field:Ge(o.name),kind:"string",title:o.title,widthHint:140});return[...i,...r]}function ze(e){return{cells:{locale:e.locale??null,modified:e.modified??null,status:null,template:null,title:e.name,url:e.collection===ci?_r(e.path).urlPattern:null},key:e.path}}async function Ke(e,t){return(await Promise.all(e.map(async(i)=>{let o=i.collection===null?null:Un(i.path);if(!o?.fileBacked)return[i];let s;try{s=await t(i.path)}catch{return[i]}let a=ue(i.path,s,o.def.schema);if(a===null)return[i];return a.map((l)=>Ye(i,l))}))).flat()}function Ye(e,t){return{...e,name:t.title,path:fe(e.path,t.index),record:{fields:t.fields,row:t.row,source:e.path}}}async function Be(e){let t=p(),r=await Ke(e.files,(i)=>t.readFile(i));return{...e,files:r}}function CD(e){let t=null,r=null,i=null,o=e??(()=>ce(x?.projectDirs??[],x?.projectConfig??null));async function s(){if(t)return t;let a=o(),l=new Set(e?a:x?.projectDirs??[]),c=new Set(a.filter((d)=>!l.has(d)));return r??=Ev().then((d)=>rm(a,p(),c,d)).then(Be).then((d)=>(t=d,i=a.join(`
|
|
4
|
-
`),r=null,d)),r}return{capabilities:{delete:!1,insert:!1,remotePaging:!1,remoteSort:!1},columns:()=>Promise.resolve(LE()),commit(a){return Promise.resolve({cells:a.cells.map((l)=>({error:G,field:l.field,ok:!1,rowKey:l.rowKey})),deletes:a.deletes.map((l)=>({error:G,ok:!1,rowKey:l.rowKey})),inserts:a.inserts.map((l)=>({error:G,ok:!1,tempKey:l.tempKey}))})},failures:()=>t?.failures??[],files:()=>t?.files??[],id:Xl("content"),label:"Content",async refresh(){t=null,r=null,await s()},async rows(){let a=await s();return{rows:a.files.map((l)=>ze(l)),total:a.files.length}},scanned:()=>t!==null,stale:()=>t!==null&&i!==o().join(`
|
|
5
|
-
`)}}var We=[y],D=new Map;function J(e){return D.get(e)??null}function $E(e,t){let r=J(e);return r!==null&&r.tabId===t.id&&r.wrap.isConnected&&r.surface.attached()}function rw(e){let t=D.get(e);if(!t)return;t.scope.stop(),t.surface.dispose(),D.delete(e)}function ib(e,t){Y(e,(r)=>_(r,ks,t))}function kD(e){let t=C(e),r=Fl(e);if(!t||!Oc(t.schema,r))return null;let i=Bl(r);return{draft:i,text:i?"Draft":"Published",title:i?wp:"Not marked a draft."}}function IE(e){return Object.fromEntries(Object.entries(e?.properties??{}).map(([t,r])=>[t,{label:n(r.title)&&r.title!==""?r.title:V(t)}]))}function RE(e){return{fieldKeyPrefix:`entry:${e.id}`,resolvePointer:(t,r)=>gp(t,{projectConfig:x?.projectConfig??{},scope:r})}}function DE(e,t){return Object.fromEntries(BD(e.schema,t).map((r)=>[r,"Required — this entry does not have one."]))}function C(e){return h(e)?HD(e.documentPath):Ac(e.documentPath)}function NE(e,t,r){let i=pp(t,r),o=e.properties??{},s=i===null?void 0:o[i];if(i===null||s===void 0)return e;return{...e,properties:{[i]:s,...o}}}function qe(e){return`${e.documentPath??"This document"} is not an entry of any content collection, so there is no schema to draw a form from.`}function pe(e,t,r){let i=wi(e,"entry"),o=wi(e,"entry/fields");if(!r)return{collection:"",draft:!1,draftAxis:"hidden",draftHint:wp,emptyLine:qe(t),fieldsRegion:o,name:"",nextDisabled:!0,note:"",noteState:"hidden",place:"",previousDisabled:!0,recordNav:"hidden",region:i,stage:"empty"};let s=Fl(t),a=Bl(s),l=h(t),c=F(t);return{collection:r.name,draft:a,draftAxis:Oc(r.schema,s)?"shown":"hidden",draftHint:wp,emptyLine:"",fieldsRegion:o,name:l?Ue(r,s,c.index):t.documentPath?.split("/").pop()??"Untitled",nextDisabled:c.next===null,note:wp,noteState:a?"shown":"hidden",place:c.index===-1?"":`${c.index+1} of ${c.total}`,previousDisabled:c.previous===null,recordNav:l?"shown":"hidden",region:i,stage:"entry"}}function Ue(e,t,r){let i=pp(e.schema,t),o=i===null?void 0:t[i];if(n(o)&&o.trim()!=="")return o.trim();return r===-1?"Record":`Row ${r+1}`}function ED(e,t){let{paneId:r,wrap:i}=e;if($E(r,t))return;rw(r);let o=null,s=null,a=()=>{if(o!==null&&J(r)===o)c()},l=(u)=>{if(!s||!u)return;let N=Fl(t),z=jl(`entry:${r}`,NE(u.schema,u.schema,N),N,{context:RE(t),errors:DE(u,N),onChange:(ye)=>q_(t,ye),rerender:a,ui:IE(u.schema)});if(z.parentNode!==s)s.replaceChildren(z)},c=()=>{let u=C(t);if(!u)s=null;o?.surface.update(pe(r,t,u)),l(u)},d=ge(),f=oe(i,pe(r,t,C(t)),{openContentTypes:()=>{ae()?.run("settings.open",{section:"content"})},openGrid:()=>{let{index:u}=F(t);if(u!==-1&&t.documentPath)se(t.documentPath,u);t.session.ui.canvasMode="grid"},setDraft:(u)=>ib(t,u),showNext:()=>{let{next:u}=F(t);if(u!==null)A(t,u)},showPrevious:()=>{let{previous:u}=F(t);if(u!==null)A(t,u)}},{fieldsSlot:(u)=>{s=u,l(C(t))}});o={paneId:r,scope:d,surface:f,tabId:t.id,wrap:i},D.set(r,o),d.run(()=>{ne(()=>{if(J(r)!==o)return;t.doc.document,t.doc.content.frontmatter,x?.projectConfig?.content,c()})})}async function TD(e){let{openFileInTab:t}=await (le("rcn56qvm"),import("./files-rcn56qvm.js"));await t(e);for(let[r,i]of m.tabs.entries()){if(i.documentPath!==e)continue;for(let o of We)if(!i.capabilities.modes.includes(o))i.capabilities.modes.unshift(o);return i.session.ui.canvasMode=y,i.session.ui.preview=!1,Bt(r),i}return null}
|
|
6
|
-
export{pp,U_,SE,tb,CE,nw,fD,kE,iw,mD,Fl,q_,gD,bD,rm,EE,sm,ow,vD,TE,nb,yD,wD,xD,_D,SD,LE,CD,$E,rw,ib,kD,IE,RE,DE,NE,ED,TD};
|
|
7
|
-
|
|
8
|
-
//# debugId=6E7704F8B30EFADF64756E2164756E21
|
|
9
|
-
//# sourceMappingURL=studio-03ct6yfv.js.map
|