@jxsuite/studio 6.1.2 → 8.0.1
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/README.md +5 -5
- package/dist/chunks/2020-5wtzce5g.js +4 -0
- package/dist/chunks/adapter-5tphg7xe.js +4 -0
- package/dist/chunks/add-new-flow-psym14sn.js +4 -0
- package/dist/chunks/cf-account-picker-haqazq5r.js +4 -0
- package/dist/chunks/cf-settings-h2wrh6hq.js +4 -0
- package/dist/chunks/{color-area-0fj8a4ga.js → color-area-6rbra5dy.js} +2 -2
- package/dist/chunks/{color-field-xch8kx2g.js → color-field-gy56c94g.js} +3 -3
- package/dist/chunks/color-m7r1vk54.js +4 -0
- package/dist/chunks/{color-slider-jxd8v350.js → color-slider-sqqdyf6c.js} +2 -2
- package/dist/chunks/{combobox-p0efwjke.js → combobox-72h32ejk.js} +3 -3
- package/dist/chunks/components-r22xca09.js +4 -0
- package/dist/chunks/content-source-mmppmcyg.js +4 -0
- package/dist/chunks/convert-to-repeater-he70fc2b.js +4 -0
- package/dist/chunks/editor-ccd9jwsa.js +4 -0
- package/dist/chunks/entry-commands-6qxz9e8p.js +4 -0
- package/dist/chunks/extension-sections-0egb88dm.js +4 -0
- package/dist/chunks/file-ops-qnab36ek.js +4 -0
- package/dist/chunks/files-rcn56qvm.js +4 -0
- package/dist/chunks/format-host-yxz0kjjs.js +4 -0
- package/dist/chunks/fs-events-d1qxq4z4.js +4 -0
- package/dist/chunks/grid-open-4z1g062t.js +4 -0
- package/dist/chunks/{grid-view-d2wq9ezg.js → grid-view-qg1b5eqx.js} +25 -25
- package/dist/chunks/{icons-pnfz478q.js → icons-63bjtbs7.js} +2 -2
- package/dist/chunks/{iframe-entry-jdcktez8.js → iframe-entry-2zggzajv.js} +4 -4
- package/dist/chunks/{iframe-entry-zap785cw.js → iframe-entry-76j8vwwx.js} +4 -4
- package/dist/chunks/iframe-entry-99nr5zfb.js +5 -0
- package/dist/chunks/{iframe-entry-x0ygf2yr.js → iframe-entry-pkgmcgp0.js} +4 -4
- package/dist/chunks/iframe-host-ssv7kyj0.js +4 -0
- package/dist/chunks/{index-zpjmzqfk.js → index-32eqzv1k.js} +3 -3
- package/dist/chunks/index-f0jn7nnp.js +4 -0
- package/dist/chunks/{javascript-m54mnwp6.js → javascript-pjp734q4.js} +3 -3
- package/dist/chunks/jsonMode-njkvsa02.js +13 -0
- package/dist/chunks/jx-validate-ttasrbh7.js +4 -0
- package/dist/chunks/layers-bgyr11tr.js +4 -0
- package/dist/chunks/layers-panel-7ez66zeq.js +4 -0
- package/dist/chunks/{listbox-e74qjyq6.js → listbox-c421cf8c.js} +2 -2
- package/dist/chunks/lit-html-v9gh687x.js +4 -0
- package/dist/chunks/media-library-sq468wts.js +4 -0
- package/dist/chunks/media-picker-shfe59pt.js +4 -0
- package/dist/chunks/{menu-n6yzswmy.js → menu-bdpzbfvs.js} +2 -2
- package/dist/chunks/{monaco-binding-7gx83x3r.js → monaco-binding-vq1hgnn0.js} +3 -3
- package/dist/chunks/monaco-buffer-3afgwvbp.js +4 -0
- package/dist/chunks/monaco-setup-xrd2cbkp.js +4 -0
- package/dist/chunks/notify-kzrjr3fv.js +4 -0
- package/dist/chunks/parse-v77xtwv7.js +4 -0
- package/dist/chunks/platform-7v4rtd7m.js +4 -0
- package/dist/chunks/popover-b89sfej7.js +4 -0
- package/dist/chunks/publish-panel-2z9gw8ee.js +4 -0
- package/dist/chunks/publish-quick-qx2455cj.js +4 -0
- package/dist/chunks/publish-workspace-wrc1dgwx.js +4 -0
- package/dist/chunks/quick-search-n0t0eqxb.js +4 -0
- package/dist/chunks/references-9547rg5s.js +4 -0
- package/dist/chunks/right-panel-wsgnr9pn.js +4 -0
- package/dist/chunks/source-control-kwktr9y6.js +4 -0
- package/dist/chunks/{split-n2gfpm5m.js → split-c9zfdgxf.js} +2 -2
- package/dist/chunks/studio-03ct6yfv.js +9 -0
- package/dist/chunks/studio-07rcfje3.js +5 -0
- package/dist/chunks/studio-3e54qh39.js +7 -0
- package/dist/chunks/studio-3exxhz5g.js +5 -0
- package/dist/chunks/studio-3q40e3rj.js +5 -0
- package/dist/chunks/studio-3qeh9t0h.js +6 -0
- package/dist/chunks/studio-3qqjeep5.js +6 -0
- package/dist/chunks/studio-43sd2mam.js +4 -0
- package/dist/chunks/studio-4hp8pkyt.js +5 -0
- package/dist/chunks/studio-58xg6j2q.js +9 -0
- package/dist/chunks/studio-5g0rprdt.js +7 -0
- package/dist/chunks/{studio-2j1cb95x.js → studio-6m380wp7.js} +4 -4
- package/dist/chunks/studio-80jyh1xh.js +4 -0
- package/dist/chunks/studio-83mk4bgg.js +9 -0
- package/dist/chunks/{studio-v0jzqdjm.js → studio-881z1xrx.js} +4 -4
- package/dist/chunks/studio-8m0y2qe7.js +5 -0
- package/dist/chunks/{studio-d81xfh1g.js → studio-8tr6cfrc.js} +4 -4
- package/dist/chunks/studio-8vcvfs7r.js +6 -0
- package/dist/chunks/studio-9tmebf0s.js +5 -0
- package/dist/chunks/studio-a2bvaptz.js +5 -0
- package/dist/chunks/studio-b7y5mr30.js +5 -0
- package/dist/chunks/studio-bavb31r0.js +5 -0
- package/dist/chunks/{studio-dgz8d0c1.js → studio-bbe4c90a.js} +4 -4
- package/dist/chunks/studio-c05wdnt3.js +5 -0
- package/dist/chunks/studio-ccv2svc6.js +5 -0
- package/dist/chunks/studio-d5grtb9e.js +16 -0
- package/dist/chunks/studio-df0baea9.js +5 -0
- package/dist/chunks/studio-dgk4dqtx.js +7 -0
- package/dist/chunks/studio-e1g64q43.js +5 -0
- package/dist/chunks/studio-ed1hp6zf.js +6 -0
- package/dist/chunks/studio-ed3xx40h.js +7 -0
- package/dist/chunks/studio-f14e1zdj.js +5 -0
- package/dist/chunks/studio-fbhxxc5f.js +5 -0
- package/dist/chunks/studio-fyh0jc96.js +5 -0
- package/dist/chunks/studio-gcxk20n7.js +5 -0
- package/dist/chunks/studio-jaaz8ce9.js +5 -0
- package/dist/chunks/{studio-90pq9km1.js → studio-jcnsdaep.js} +4 -4
- package/dist/chunks/studio-jsgf2q5k.js +7 -0
- package/dist/chunks/{studio-0q988f9w.js → studio-k3xxbagr.js} +3 -3
- package/dist/chunks/{studio-5ve6bbep.js → studio-k7evxqh4.js} +4 -4
- package/dist/chunks/studio-kt3pjkwd.js +5 -0
- package/dist/chunks/studio-m8g16bgz.js +5 -0
- package/dist/chunks/studio-mn0476ag.js +5 -0
- package/dist/chunks/studio-mx1smyq0.js +5 -0
- package/dist/chunks/studio-n0c5h6mf.js +5 -0
- package/dist/chunks/{studio-485046te.js → studio-nh6d342n.js} +7 -7
- package/dist/chunks/studio-nqxqf8p2.js +4 -0
- package/dist/chunks/studio-p4nrkvqr.js +5 -0
- package/dist/chunks/{studio-1fxkaaea.js → studio-pbxa5fpc.js} +4 -4
- package/dist/chunks/studio-pgmvdv7z.js +7 -0
- package/dist/chunks/studio-ph84avkf.js +5 -0
- package/dist/chunks/{studio-tq0rtfwj.js → studio-q0mvbaq6.js} +4 -4
- package/dist/chunks/studio-q0tccd43.js +5 -0
- package/dist/chunks/studio-q7rtx6zq.js +14 -0
- package/dist/chunks/{studio-a3g98wjr.js → studio-qgh13jtz.js} +4 -4
- package/dist/chunks/studio-qmn1xc24.js +5 -0
- package/dist/chunks/studio-qwdqwkj0.js +5 -0
- package/dist/chunks/studio-r5qy30vx.js +5 -0
- package/dist/chunks/studio-rj9eamf8.js +5 -0
- package/dist/chunks/studio-rptgsk96.js +5 -0
- package/dist/chunks/studio-rthyg42z.js +928 -0
- package/dist/chunks/studio-s19tp1xr.js +5 -0
- package/dist/chunks/studio-s32578pn.js +5 -0
- package/dist/chunks/studio-svb7yyve.js +5 -0
- package/dist/chunks/studio-syreb644.js +5 -0
- package/dist/chunks/studio-tf9jryb1.js +10 -0
- package/dist/chunks/studio-tfkznv39.js +5 -0
- package/dist/chunks/studio-tft6r105.js +5 -0
- package/dist/chunks/studio-txf2kysx.js +5 -0
- package/dist/chunks/studio-v8867ddv.js +12 -0
- package/dist/chunks/studio-vxq7fcvv.js +5 -0
- package/dist/chunks/studio-w4rz9hdk.js +5 -0
- package/dist/chunks/studio-wbcjbhy1.js +9 -0
- package/dist/chunks/studio-wc649wss.js +5 -0
- package/dist/chunks/studio-wys23mxz.js +5 -0
- package/dist/chunks/studio-x1x167jh.js +5 -0
- package/dist/chunks/studio-x9hsze61.js +5 -0
- package/dist/chunks/studio-y0n7yxea.js +9 -0
- package/dist/chunks/studio-y3ahhdpx.js +5 -0
- package/dist/chunks/studio-z97c48fk.js +5 -0
- package/dist/chunks/studio-zat62m0c.js +5 -0
- package/dist/chunks/studio-zcd2e7yz.js +5 -0
- package/dist/chunks/studio-zz9qe3rw.js +64 -0
- package/dist/chunks/toast-1gv0h53h.js +4 -0
- package/dist/chunks/{toast-host-ke5z4ng7.js → toast-host-1yg5ar8d.js} +3 -3
- package/dist/chunks/{tooltip-5v8ngwj2.js → tooltip-yypz28gq.js} +3 -3
- package/dist/chunks/{tree-mdq3v5cw.js → tree-9xa4hm7n.js} +2 -2
- package/dist/chunks/tsMode-epyfz1hv.js +14 -0
- package/dist/chunks/workspace-dz7nxfhv.js +4 -0
- package/dist/chunks/workspace-home-xsd7hkjw.js +4 -0
- package/dist/chunks/{ws-client-nze0k6mv.js → ws-client-bv552sfx.js} +3 -3
- package/dist/iframe-entry.js +20 -16
- package/dist/manifest.json +77 -63
- package/dist/studio.js +103 -104
- package/dist/workers/ts.worker.js +3 -3
- package/package.json +12 -11
- package/src/browse/component-examples.ts +272 -0
- package/src/browse/library-commands.ts +64 -104
- package/src/browse/library-layouts.ts +263 -49
- package/src/browse/library-model.ts +181 -133
- package/src/browse/library-pane.ts +738 -446
- package/src/browse/library-preview.ts +149 -19
- package/src/browse/library-source.ts +308 -41
- package/src/browse/preview-root.ts +78 -0
- package/src/browse/preview-style.ts +155 -0
- package/src/canvas/asset-refs.ts +16 -1
- package/src/canvas/canvas-live-render.ts +222 -30
- package/src/canvas/canvas-origin.ts +37 -12
- package/src/canvas/canvas-page-context.ts +112 -0
- package/src/canvas/canvas-render.ts +113 -107
- package/src/canvas/canvas-utils.ts +57 -12
- package/src/canvas/iframe-drop.ts +107 -0
- package/src/canvas/iframe-entry.ts +24 -12
- package/src/canvas/iframe-host.ts +134 -62
- package/src/canvas/iframe-keys.ts +11 -0
- package/src/canvas/iframe-patch.ts +8 -7
- package/src/canvas/iframe-protocol.ts +24 -5
- package/src/canvas/iframe-render.ts +48 -1
- package/src/canvas/iframe-subtree.ts +5 -2
- package/src/canvas/npm-modules.ts +22 -0
- package/src/canvas/preview-navigate.ts +16 -0
- package/src/canvas/repeater-sources.ts +200 -0
- package/src/canvas/stage-scrollbar.ts +5 -1
- package/src/canvas/surface-registry.ts +6 -0
- package/src/commands/app-commands.ts +16 -6
- package/src/commands/budget.ts +10 -8
- package/src/commands/context.ts +35 -10
- package/src/commands/defaults.ts +69 -45
- package/src/commands/keymap.ts +9 -0
- package/src/commands/levels.ts +11 -5
- package/src/commands/live-context.ts +2 -0
- package/src/commands/registry.ts +10 -1
- package/src/content/collection-match.ts +6 -5
- package/src/content/collection-pages.ts +412 -0
- package/src/content/content-collections.ts +270 -0
- package/src/content/entry-commands.ts +51 -60
- package/src/content/entry-editor.ts +111 -18
- package/src/content/entry-fields.ts +13 -1
- package/src/content/entry-inspector.ts +225 -0
- package/src/content/entry-model.ts +17 -3
- package/src/content/entry-open.ts +80 -0
- package/src/content/entry-summaries.ts +440 -0
- package/src/content/file-record-ids.ts +80 -0
- package/src/content/file-records.ts +125 -0
- package/src/content/page-summaries.ts +129 -0
- package/src/content/record-entry.ts +201 -0
- package/src/content/writing-banner.ts +177 -0
- package/src/create/add-new-commands.ts +185 -0
- package/src/create/add-new-flow.ts +1116 -0
- package/src/create/add-new.ts +1014 -0
- package/src/create/element-name.ts +121 -0
- package/src/editor/convert-to-component.ts +67 -43
- package/src/editor/file-drop-action.ts +9 -1
- package/src/editor/inline-edit-apply.ts +44 -0
- package/src/editor/inline-edit.ts +10 -0
- package/src/editor/insert-component.ts +91 -0
- package/src/editor/insert-zone-action.ts +13 -4
- package/src/editor/shortcuts.ts +44 -22
- package/src/editor/slash-menu.ts +51 -8
- package/src/files/components.ts +74 -10
- package/src/files/file-ops.ts +15 -5
- package/src/files/files.ts +164 -150
- package/src/files/fs-events.ts +18 -7
- package/src/files/media-meta.ts +95 -1
- package/src/files/media-types.ts +55 -0
- package/src/files/media-upload.ts +209 -52
- package/src/files/new-file-name.ts +156 -0
- package/src/files/serialize-document.ts +13 -3
- package/src/format/format-host.ts +15 -0
- package/src/github/github-auth.ts +2 -2
- package/src/github/github-publish.ts +4 -3
- package/src/grid/grid-controller.ts +5 -1
- package/src/grid/grid-open.ts +0 -27
- package/src/grid/grid-panel.ts +54 -2
- package/src/grid/grid-reveal.ts +34 -0
- package/src/grid/grid-source.ts +3 -25
- package/src/grid/grid-view.ts +31 -6
- package/src/grid/sources/content-source.ts +75 -7
- package/src/grid/tabulator-tables.d.ts +6 -0
- package/src/hosting/document.ts +2 -2
- package/src/i18n/i18n-commands.ts +2 -1
- package/src/media/media-commands.ts +181 -0
- package/src/media/media-library-model.ts +232 -0
- package/src/media/media-library.ts +1283 -0
- package/src/media/media-pane.ts +47 -19
- package/src/packages/pull-package-sync.ts +1 -1
- package/src/panels/activity-panel.ts +21 -5
- package/src/panels/ai-chat/chat-markdown.ts +8 -8
- package/src/panels/block-action-bar.ts +11 -11
- package/src/panels/canvas-dnd-bridge.ts +5 -2
- package/src/panels/chat-panel.ts +6 -6
- package/src/panels/collections-panel.ts +306 -0
- package/src/panels/component-preview.ts +35 -13
- package/src/panels/data-explorer.ts +1 -1
- package/src/panels/data-grid.ts +4 -0
- package/src/panels/dnd.ts +17 -30
- package/src/panels/elements-panel.ts +9 -2
- package/src/panels/empty-state.ts +2 -2
- package/src/panels/formula-workspace.ts +2 -3
- package/src/panels/frontmatter-fields.ts +9 -9
- package/src/panels/git-diff-open.ts +9 -5
- package/src/panels/head-panel.ts +369 -103
- package/src/panels/i18n-panel.ts +11 -10
- package/src/panels/imports-panel.ts +2 -0
- package/src/panels/jump-bar.ts +27 -2
- package/src/panels/layers-panel.ts +36 -30
- package/src/panels/left-panel.ts +22 -8
- package/src/panels/navigator-panels.ts +23 -11
- package/src/panels/pane-context.ts +111 -29
- package/src/panels/pane-grid.ts +6 -6
- package/src/panels/panel-registry.ts +14 -9
- package/src/panels/properties-panel.ts +7 -3
- package/src/panels/right-panel.ts +199 -43
- package/src/panels/seo-modal.ts +41 -108
- package/src/panels/settings-menu.ts +52 -50
- package/src/panels/settings-pane.ts +268 -162
- package/src/panels/signals-panel.ts +3 -4
- package/src/panels/site-model.ts +367 -0
- package/src/panels/site-panel.ts +638 -0
- package/src/panels/style-panel.ts +37 -3
- package/src/panels/stylebook-doc.ts +142 -10
- package/src/panels/stylebook-layers-panel.ts +39 -80
- package/src/panels/stylebook-panel.ts +47 -10
- package/src/panels/styles-panel.ts +327 -0
- package/src/panels/tab-strip.ts +109 -25
- package/src/platform.ts +1 -1
- package/src/platforms/cloud.ts +28 -1
- package/src/platforms/default-platform.ts +4 -4
- package/src/platforms/devserver.ts +51 -25
- package/src/publish/deploy-checklist.ts +12 -7
- package/src/publish/pages-service.ts +38 -14
- package/src/publish/publish-changes.ts +491 -0
- package/src/publish/publish-commands.ts +83 -18
- package/src/publish/publish-ids.ts +49 -0
- package/src/publish/publish-quick.ts +148 -0
- package/src/publish/publish-workspace.ts +926 -0
- package/src/publish/source-control.ts +907 -0
- package/src/services/automation.ts +16 -20
- package/src/services/cf-settings.ts +4 -4
- package/src/services/connection.ts +2 -2
- package/src/services/directory-picker.ts +2 -2
- package/src/services/references.ts +0 -0
- package/src/services/render-critic.ts +21 -2
- package/src/services/settings/definitions.ts +25 -14
- package/src/settings/contributed-section.ts +49 -10
- package/src/settings/css-vars-editor.ts +93 -27
- package/src/settings/developer-panels.ts +43 -0
- package/src/settings/extension-sections.ts +20 -2
- package/src/settings/general-settings.ts +91 -21
- package/src/settings/preferences-dialog.ts +8 -1
- package/src/settings/project-sections.ts +27 -10
- package/src/settings/schema-field-ui.ts +3 -1
- package/src/settings/section-registry.ts +116 -11
- package/src/settings/settings-dialog.ts +192 -0
- package/src/settings/settings-document.ts +182 -162
- package/src/shell.ts +467 -431
- package/src/site-context.ts +64 -10
- package/src/state.ts +28 -9
- package/src/studio.ts +194 -41
- package/src/style/project-styles.ts +34 -0
- package/src/style/stylebook-specimens.ts +89 -0
- package/src/style/stylebook-target.ts +26 -0
- package/src/style/tag-inheritance.ts +105 -0
- package/src/style/variables-focus.ts +61 -0
- package/src/style/variables-view.ts +235 -0
- package/src/surfaces/add-new.json +1482 -0
- package/src/surfaces/add-new.ts +325 -0
- package/src/surfaces/ai-chat.ts +2 -2
- package/src/surfaces/boot-failure.json +4 -3
- package/src/surfaces/bottom-dock.json +1 -1
- package/src/surfaces/canvas-stage.json +30 -19
- package/src/surfaces/canvas-stage.ts +5 -5
- package/src/surfaces/collections-panel.json +615 -0
- package/src/surfaces/collections-panel.ts +168 -0
- package/src/surfaces/commandbar.json +241 -96
- package/src/surfaces/commandbar.ts +134 -99
- package/src/surfaces/empty-state.json +1 -1
- package/src/surfaces/entry-editor.json +136 -0
- package/src/surfaces/entry-editor.ts +21 -0
- package/src/surfaces/entry-inspector.json +371 -0
- package/src/surfaces/entry-inspector.ts +143 -0
- package/src/surfaces/inspector-dock.json +162 -14
- package/src/surfaces/inspector-dock.ts +46 -19
- package/src/surfaces/library-pane.json +670 -437
- package/src/surfaces/library-pane.ts +94 -59
- package/src/surfaces/media-browser.json +62 -6
- package/src/surfaces/media-browser.ts +15 -1
- package/src/surfaces/media-field.json +1 -1
- package/src/surfaces/media-library.json +1586 -0
- package/src/surfaces/media-library.ts +282 -0
- package/src/surfaces/media-pick-dialog.json +71 -0
- package/src/surfaces/media-pick-dialog.ts +132 -0
- package/src/surfaces/menu.ts +18 -0
- package/src/surfaces/pane-context.json +144 -77
- package/src/surfaces/pane-context.ts +24 -0
- package/src/surfaces/panel-deploy-checklist.json +12 -6
- package/src/surfaces/panel-deploy-checklist.ts +3 -1
- package/src/surfaces/panel-page.json +72 -2
- package/src/surfaces/panel-page.ts +38 -7
- package/src/surfaces/panel-signals.json +1 -1
- package/src/surfaces/panel-signals.ts +5 -5
- package/src/surfaces/panel-stylebook-layers.json +71 -204
- package/src/surfaces/panel-stylebook-layers.ts +0 -21
- package/src/surfaces/preferences.json +120 -48
- package/src/surfaces/preferences.ts +8 -0
- package/src/surfaces/publish-quick.json +428 -0
- package/src/surfaces/publish-quick.ts +165 -0
- package/src/surfaces/publish-workspace.json +2892 -0
- package/src/surfaces/publish-workspace.ts +391 -0
- package/src/surfaces/rail.json +1 -159
- package/src/surfaces/rail.ts +18 -75
- package/src/surfaces/schema-form.json +10 -2
- package/src/surfaces/schema-form.ts +2 -0
- package/src/surfaces/seo.json +1 -1
- package/src/surfaces/settings-contributed.json +5 -5
- package/src/surfaces/settings-contributed.ts +18 -2
- package/src/surfaces/settings-css-vars.json +44 -36
- package/src/surfaces/settings-css-vars.ts +77 -4
- package/src/surfaces/settings-deploy.json +2 -15
- package/src/surfaces/settings-deploy.ts +1 -1
- package/src/surfaces/settings-dialog.json +51 -0
- package/src/surfaces/settings-dialog.ts +169 -0
- package/src/surfaces/settings-overview.json +3 -3
- package/src/surfaces/settings-overview.ts +9 -2
- package/src/surfaces/settings-pane.json +269 -46
- package/src/surfaces/settings-pane.ts +85 -24
- package/src/surfaces/shell.json +2 -1
- package/src/surfaces/site-panel.json +1029 -0
- package/src/surfaces/site-panel.ts +233 -0
- package/src/surfaces/slash-menu.json +63 -21
- package/src/surfaces/slash-menu.ts +23 -0
- package/src/surfaces/statusbar.ts +39 -15
- package/src/surfaces/styles-panel.json +735 -0
- package/src/surfaces/styles-panel.ts +195 -0
- package/src/surfaces/styles-variables.json +149 -0
- package/src/surfaces/styles-variables.ts +145 -0
- package/src/surfaces/tab-strip.json +4 -4
- package/src/surfaces/welcome.ts +1 -1
- package/src/surfaces/writing-banner.json +94 -0
- package/src/surfaces/writing-banner.ts +80 -0
- package/src/tabs/bare-repeaters.ts +101 -0
- package/src/tabs/tab.ts +47 -7
- package/src/types.ts +21 -26
- package/src/ui/form-controls.ts +47 -8
- package/src/ui/layers.ts +13 -0
- package/src/ui/media-picker.ts +284 -40
- package/src/ui/regions.ts +7 -6
- package/src/ui/schema-form.ts +259 -27
- package/src/ui/virtual-window.ts +26 -1
- package/src/utils/base64.ts +3 -3
- package/src/utils/edit-display.ts +322 -67
- package/src/utils/local-day.ts +18 -0
- package/src/workspace/pane-derive.ts +4 -4
- package/src/workspace/session.ts +28 -7
- package/src/workspace/tab-workspace.ts +137 -0
- package/src/workspace/workspace-back.ts +189 -0
- package/src/workspace/workspace-home.ts +133 -0
- package/src/workspace/workspace-ids.ts +129 -0
- package/src/workspace/workspace-switch.ts +372 -0
- package/src/workspace/workspace.ts +125 -11
- package/styles/shell-frame.css +30 -7
- package/styles/shell-frame.json +15 -3
- package/dist/chunks/2020-f2gkpy8d.js +0 -4
- package/dist/chunks/adapter-4912g339.js +0 -4
- package/dist/chunks/cf-account-picker-wccaenh6.js +0 -4
- package/dist/chunks/cf-settings-br6105tr.js +0 -4
- package/dist/chunks/color-28ksk2qm.js +0 -4
- package/dist/chunks/components-db68vsn7.js +0 -4
- package/dist/chunks/content-source-1449qesq.js +0 -4
- package/dist/chunks/convert-to-repeater-5h457egj.js +0 -4
- package/dist/chunks/editor-x9jn86a7.js +0 -4
- package/dist/chunks/entry-commands-may24cpt.js +0 -4
- package/dist/chunks/extension-sections-pvr14vxr.js +0 -4
- package/dist/chunks/file-ops-x9v54pcj.js +0 -4
- package/dist/chunks/files-j3knqf0s.js +0 -4
- package/dist/chunks/format-host-tyre2trb.js +0 -4
- package/dist/chunks/fs-events-64ma9htc.js +0 -4
- package/dist/chunks/git-panel-84ps5dex.js +0 -4
- package/dist/chunks/iframe-entry-fvbk89gm.js +0 -5
- package/dist/chunks/iframe-host-ck6vejt5.js +0 -4
- package/dist/chunks/index-b8xw3vy9.js +0 -4
- package/dist/chunks/jsonMode-w15cmrcm.js +0 -13
- package/dist/chunks/jx-validate-at3zn8wa.js +0 -4
- package/dist/chunks/layers-h4xp1pss.js +0 -4
- package/dist/chunks/layers-panel-m5hw1d7g.js +0 -4
- package/dist/chunks/lit-html-8t8t3dnr.js +0 -4
- package/dist/chunks/media-picker-2cweexc5.js +0 -4
- package/dist/chunks/menu-ynw13y0s.js +0 -4
- package/dist/chunks/monaco-buffer-qzxn567r.js +0 -4
- package/dist/chunks/monaco-setup-gxf6656g.js +0 -4
- package/dist/chunks/notify-cj5zbrs2.js +0 -4
- package/dist/chunks/parse-b7ddhr8m.js +0 -4
- package/dist/chunks/platform-3dfws9js.js +0 -4
- package/dist/chunks/popover-jt2gxmzs.js +0 -4
- package/dist/chunks/publish-panel-1gvxbj21.js +0 -4
- package/dist/chunks/quick-search-0dajrwqg.js +0 -4
- package/dist/chunks/references-49qgt404.js +0 -4
- package/dist/chunks/right-panel-jm1bwe53.js +0 -4
- package/dist/chunks/section-registry-6kwc4fky.js +0 -4
- package/dist/chunks/studio-0rt52vpq.js +0 -5
- package/dist/chunks/studio-18vgbhs5.js +0 -5
- package/dist/chunks/studio-24mccdrj.js +0 -5
- package/dist/chunks/studio-2eh507zk.js +0 -9
- package/dist/chunks/studio-2hcbccfv.js +0 -5
- package/dist/chunks/studio-2jbs3rxv.js +0 -5
- package/dist/chunks/studio-4h8k4dw9.js +0 -5
- package/dist/chunks/studio-5f6n18kx.js +0 -5
- package/dist/chunks/studio-5gthpky6.js +0 -5
- package/dist/chunks/studio-6ep3js6b.js +0 -9
- package/dist/chunks/studio-6wkmf3wz.js +0 -9
- package/dist/chunks/studio-841rf3cg.js +0 -5
- package/dist/chunks/studio-8gmwgheg.js +0 -5
- package/dist/chunks/studio-8qm0ep50.js +0 -5
- package/dist/chunks/studio-924p1tm1.js +0 -6
- package/dist/chunks/studio-a3shpz9y.js +0 -5
- package/dist/chunks/studio-amsbaaar.js +0 -6
- package/dist/chunks/studio-at5spjbc.js +0 -7
- package/dist/chunks/studio-b2xv945e.js +0 -5
- package/dist/chunks/studio-bn5nkafw.js +0 -5
- package/dist/chunks/studio-bw6q5xjf.js +0 -9
- package/dist/chunks/studio-c7q0t9x1.js +0 -5
- package/dist/chunks/studio-camnhc96.js +0 -6
- package/dist/chunks/studio-cffqvnzd.js +0 -5
- package/dist/chunks/studio-efvfrsf8.js +0 -5
- package/dist/chunks/studio-er30bpcx.js +0 -5
- package/dist/chunks/studio-ezscgr64.js +0 -5
- package/dist/chunks/studio-ffrrncvz.js +0 -5
- package/dist/chunks/studio-fpphgn8y.js +0 -10
- package/dist/chunks/studio-j1kvhdjk.js +0 -4
- package/dist/chunks/studio-j430n16g.js +0 -7
- package/dist/chunks/studio-jjkg84nj.js +0 -5
- package/dist/chunks/studio-m0q32ars.js +0 -4
- package/dist/chunks/studio-m6bdst11.js +0 -5
- package/dist/chunks/studio-nv2cptd4.js +0 -64
- package/dist/chunks/studio-nwfrc98n.js +0 -5
- package/dist/chunks/studio-p1wgvp7r.js +0 -5
- package/dist/chunks/studio-pag2wncm.js +0 -5
- package/dist/chunks/studio-qvanvzfd.js +0 -5
- package/dist/chunks/studio-qwa64kt7.js +0 -5
- package/dist/chunks/studio-rk1zc4x3.js +0 -928
- package/dist/chunks/studio-se2r3ptc.js +0 -5
- package/dist/chunks/studio-sg2a0dh0.js +0 -5
- package/dist/chunks/studio-tjzjhe68.js +0 -5
- package/dist/chunks/studio-v2w7q8r1.js +0 -7
- package/dist/chunks/studio-v5vjq1h0.js +0 -4
- package/dist/chunks/studio-v8aga3vp.js +0 -14
- package/dist/chunks/studio-vfcdrfmv.js +0 -5
- package/dist/chunks/studio-vmfkgdjf.js +0 -5
- package/dist/chunks/studio-wt1816jj.js +0 -5
- package/dist/chunks/studio-wz73q5kq.js +0 -4
- package/dist/chunks/studio-y04qtxvp.js +0 -7
- package/dist/chunks/studio-y21g8zzg.js +0 -5
- package/dist/chunks/studio-y64hrt8p.js +0 -12
- package/dist/chunks/studio-ynn90f58.js +0 -16
- package/dist/chunks/studio-yxz682sx.js +0 -5
- package/dist/chunks/studio-zp7snvkq.js +0 -5
- package/dist/chunks/studio-zq4z6tm6.js +0 -5
- package/dist/chunks/toast-c9fn075p.js +0 -4
- package/dist/chunks/tsMode-sf49ee9x.js +0 -14
- package/dist/chunks/workspace-jtfahpee.js +0 -4
- package/src/panels/frontmatter-panel.ts +0 -711
- package/src/panels/git-panel.ts +0 -1108
- package/src/surfaces/doc-header.json +0 -776
- package/src/surfaces/doc-header.ts +0 -222
- package/src/surfaces/git-panel.json +0 -1880
- package/src/surfaces/git-panel.ts +0 -264
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{e$,Oe,Rs,qy,Y,ta,Ir,uh,Ql,Ye,hh,Ln,ct,ev,Ti,gi,Ie,Vr,R1,pr,qe,si,b,h,qn,Ko,ef}from"./studio-24mccdrj.js";import{xe,oe,he,E}from"./studio-wz73q5kq.js";import{tt,or,gh,rc}from"./studio-vmfkgdjf.js";import{f,Qe}from"./studio-ffrrncvz.js";import{nu,Li}from"./studio-nwfrc98n.js";import{pv,df,fg,lc,cs,fr,ds,la,Ch,gl,gg,iR,uo,Wi,ru,bg,ae}from"./studio-v8aga3vp.js";import{ut,Vm,Bc}from"./studio-4h8k4dw9.js";import{x1,Gd}from"./studio-jjkg84nj.js";import{Aa,Lo,ia,ra,Is}from"./studio-485046te.js";import{Hi,NL,Ey,OL,Ls,Yl,Ty,AL,x,y1}from"./studio-ynn90f58.js";import{zm,Bp,Um,Kd}from"./studio-qwa64kt7.js";import{Ur,Dt,ai,ao,ul,O,vh,wh,xh,Bi}from"./studio-c7q0t9x1.js";import{ne}from"./studio-y21g8zzg.js";import{Me,uv}from"./studio-m6bdst11.js";import{wv}from"./studio-90pq9km1.js";import{i,ee,te,T,w,He,Ro,Qn,Ze,mf}from"./studio-cffqvnzd.js";var po=128,TC="fullRender",cL="mountCanvas",dL="patchBatch",Tt="prepareRender",Rr={derivedResolves:0,derivedRetargets:0,escalations:0,fullRenders:0,hostRenderPosts:0,lastEscalationReason:"",lastFullRenderMs:0,p95FullRenderMs:0,panelRenders:0,patchedOps:0,renderPreparations:0,skippedFullRenders:0,timings:{}};globalThis.__jxCanvasPerf=Rr;var wt=new Map;function Mt(){try{return typeof localStorage<"u"&&Boolean(localStorage.getItem("jx-canvas-debug"))}catch{return!1}}function Et(){return typeof performance<"u"&&te(performance.now)?performance.now():0}function Nt(e,t){if(Mt())console.debug(`[jx-canvas] ${e}`,t??"")}function my(e){Rr.escalations+=1,Rr.lastEscalationReason=e,Nt("escalation",e)}function fo(e){if(e.length===0)return 0;let t=e.toSorted((o,r)=>o-r),n=Math.min(t.length-1,Math.ceil(t.length*0.95)-1);return t[Math.max(0,n)]??0}function mo(e,t){let n=Number.isFinite(t)&&t>0?t:0,o=wt.get(e);if(!o)o=[],wt.set(e,o);if(o.push(n),o.length>po)o.shift();let r=Rr.timings[e],a={count:(r?.count??0)+1,lastMs:n,maxMs:Math.max(r?.maxMs??0,n),p95Ms:fo(o),totalMs:(r?.totalMs??0)+n};if(Rr.timings[e]=a,e===TC)Rr.lastFullRenderMs=a.lastMs,Rr.p95FullRenderMs=a.p95Ms;Nt(`span:${e}`,`${n.toFixed(2)}ms`)}function Ot(e){let t=Et(),n=Mt(),o=`jx-${e}-start`;if(n)try{performance.mark(o)}catch{}let r=!1;return()=>{if(r)return Rr.timings[e]?.lastMs??0;r=!0;let a=Et()-t;if(n)try{performance.measure(`jx-${e}`,o),performance.clearMarks(o)}catch{}return mo(e,a),a}}function Nx(e,t){let n=Ot(e);try{return t()}finally{n()}}async function Ox(e,t){let n=Ot(e);try{return await t()}finally{n()}}function So(){return or(b.activePaneId)}function pt(e){let t=qn(e),n=t?.derived,o=n?.kind==="lens"?qn(n.sourcePaneId)?.activeTabId:t?.activeTabId;return o?b.tabs.get(o)??null:null}function Co(e){return qn(e)?.derived??null}function Rx(e){if(!e)return[];let t=[];for(let n of b.panes)if(pt(n.id)?.id===e.id)t.push(or(n.id));return t}function q(e){for(let t of gh()){let n=t.panels.find((o)=>o.canvas===e);if(n)return{panel:n,surface:t}}return null}function Rt(e){let t=e.canvas,n=t?q(t):null;return n?pt(n.surface.paneId):null}function ql(e){let t=e?.session.ui,n=t?.canvasMode??"design";return t?.preview&&(n==="edit"||n==="design")?"preview":n}function $r(e){let t=Co(e);if(t?.kind==="lens"){let n=t.mode;return pt(e)?.session.ui?.preview&&(n==="edit"||n==="design")?"preview":n}return ql(pt(e))}function nh(e){let t=Co(e);if(t?.kind==="lens"&&t.preset==="breakpoint")return t.media;return pt(e)?.session.ui.activeMedia??null}function py(e){return rc(e)?.paneId??si}function Om(e){return pt(py(e))}function by(e){return pv(e)!==null}function ih(e){return pv(e)}function ko(e){if(!e)return{baseWidth:320,featureQueries:[],sizeBreakpoints:[]};let t=[],n=[],o=320;for(let[r,a]of Object.entries(e)){if(r==="--"){let c=String(a).match(/^(\d+)\s*px$/);o=c?Number(c[1]):320;continue}let s=a.match(/min-width:\s*([\d.]+)px/),l=a.match(/max-width:\s*([\d.]+)px/);if(s)n.push({name:r,query:a,type:"min",width:Number(s[1])});else if(l)n.push({name:r,query:a,type:"max",width:Number(l[1])});else t.push({name:r,query:a})}return n.sort((r,a)=>r.type==="min"?r.width-a.width:a.width-r.width),{baseWidth:o,featureQueries:t,sizeBreakpoints:n}}function ho(e,t){let n=new Set;for(let o of e)if(o.type==="min"&&t>=o.width)n.add(o.name);else if(o.type==="max"&&t<=o.width)n.add(o.name);return n}function At(e,t){let n=ho(e,t),o=null;for(let r of e){if(!n.has(r.name))continue;let a=Math.abs(r.width-t);if(o===null){o=r;continue}let s=Math.abs(o.width-t);if(a<s||a===s&&r.width<o.width)o=r}return o?.name??null}function mL(e,t,n=8){let o=null;for(let r of t){let a=Math.abs(r-e);if(a>n)continue;if(o===null||a<Math.abs(o-e))o=r}return o??e}var Ax={$id:"elements-meta",title:"HTML Element Metadata",description:"Inline scoping and inline toolbar action metadata for HTML elements.",$convertGroups:{text:["p","h1","h2","h3","h4","h5","h6","blockquote"],container:["div","section","article","aside","main","header","footer","nav","search"],list:["ul","ol"]},$defs:{p:{$convertTo:"text",$convertToWhenEmpty:["text","container"],$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:[{tag:"strong",label:"Bold",command:"bold"},{tag:"em",label:"Italic",command:"italic"},{tag:"u",label:"Underline",command:"underline"},{tag:"del",label:"Strikethrough",command:"strikethrough"},{tag:"sup",label:"Superscript",command:"superscript"},{tag:"sub",label:"Subscript",command:"subscript"},{tag:"code",label:"Code",command:"code"},{tag:"a",label:"Link",command:"link"}]},h1:{$convertTo:"text",$inlineChildren:["em","strong","code","a","span","br","b","i","u","sub","sup"],$inlineActions:[{tag:"strong",label:"Bold",command:"bold"},{tag:"em",label:"Italic",command:"italic"},{tag:"code",label:"Code",command:"code"},{tag:"a",label:"Link",command:"link"}]},h2:{$convertTo:"text",$inlineChildren:["em","strong","code","a","span","br","b","i","u","sub","sup"],$inlineActions:"h1"},h3:{$convertTo:"text",$inlineChildren:["em","strong","code","a","span","br","b","i","u","sub","sup"],$inlineActions:"h1"},h4:{$convertTo:"text",$inlineChildren:["em","strong","code","a","span","br","b","i","u","sub","sup"],$inlineActions:"h1"},h5:{$convertTo:"text",$inlineChildren:["em","strong","code","a","span","br","b","i","u","sub","sup"],$inlineActions:"h1"},h6:{$convertTo:"text",$inlineChildren:["em","strong","code","a","span","br","b","i","u","sub","sup"],$inlineActions:"h1"},li:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},td:{$inlineChildren:["em","strong","del","code","a","span","br","b","i","u","sub","sup","s"],$inlineActions:"p"},th:{$inlineChildren:["em","strong","del","code","a","span","br","b","i","u","sub","sup","s"],$inlineActions:"p"},blockquote:{$convertTo:"text",$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},figcaption:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},caption:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},summary:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},dt:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},dd:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},label:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},a:{$inlineChildren:["em","strong","code","span","br","b","i","u","sub","sup"],$inlineActions:[{tag:"strong",label:"Bold",command:"bold"},{tag:"em",label:"Italic",command:"italic"},{tag:"code",label:"Code",command:"code"}]},span:{$inlineChildren:["em","strong","del","code","a","br","b","i","u","sub","sup","s"],$inlineActions:"p"},div:{$convertTo:"container",$convertToWhenEmpty:["container","text"],$inlineChildren:[]},section:{$convertTo:"container",$inlineChildren:[]},article:{$convertTo:"container",$inlineChildren:[]},nav:{$convertTo:"container",$inlineChildren:[]},main:{$convertTo:"container",$inlineChildren:[]},header:{$convertTo:"container",$inlineChildren:[]},footer:{$convertTo:"container",$inlineChildren:[]},aside:{$convertTo:"container",$inlineChildren:[]},ul:{$convertTo:"list",$inlineChildren:[]},ol:{$convertTo:"list",$inlineChildren:[]},pre:{$inlineChildren:["code"]},table:{$inlineChildren:[]},thead:{$inlineChildren:[]},tbody:{$inlineChildren:[]},tr:{$inlineChildren:[]}}};var Np=Ax.$defs,yo=new Set(["pre"]),Fi=new Set(Object.entries(Np).filter(([e,t])=>!yo.has(e)&&(t.$inlineChildren?.length??0)>0).map(([e])=>e));var It=new Set(["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"]);function _e(e,t){if(!t)return It.has(e);let n=Np[t];if(!n||!n.$inlineChildren)return!1;return n.$inlineChildren.includes(e)}function hL(e){let t=Np[e];if(!t)return null;let n=t.$inlineActions;if(i(n))n=Np[n]?.$inlineActions??void 0;if(!Array.isArray(n))return null;return n}var bo=null;function Px(e,t){if(!T(e))return!1;let n=(Ze(e.tagName)||"div").toLowerCase();if(t){let o=(Ze(t.tagName)||"div").toLowerCase();return _e(n,o)}return It.has(n)}function pL(){return bo!==null}function de(e){return!e||e==="base"?null:e}function gy(e){let t=e.panels;if(t.length===0)return null;if(t.length===1)return t[0];let n=nh(e.paneId);for(let o of t){if(n===null&&o.mediaName==="base")return o;if(o.mediaName===n)return o}return t[0]}function $t(){return gy(So())}function fL(e,t){if(!e)return t;let n=t;for(let o=Dt(n);o;o=Dt(n)){let r=ne(e,n),a=ne(e,o);if(!r||!a)break;let s=(Ze(r.tagName)||"div").toLowerCase(),l=(Ze(a.tagName)||"div").toLowerCase();if(!_e(s,l))break;n=o}return n}var Op=240,gL=8,bL=16,pe=new Map;function je(e){return ko(Hi(e.doc.document.$media))}function Mx(e){let{baseWidth:t,sizeBreakpoints:n}=je(e),o=e.session.ui.activeMedia;return n.find((r)=>r.name===o)?.width??t}function xo(e,t){let n=pe.get(e);if(!n)return null;if(!t||n.tabId!==t.id||n.media!==t.session.ui.activeMedia)return pe.delete(e),null;return n.width}function yL(e,t){let n=t?Mx(t):0;return xo(e.paneId,t)??n}function Fx(e){pe.delete(e)}function vL(e){let{baseWidth:t,sizeBreakpoints:n}=je(e);return[t,...n.map((o)=>o.width)]}function jx(e,t,n){let{sizeBreakpoints:o}=je(t),r=At(o,n);return t.session.ui.activeMedia=r,pe.set(e,{media:r,tabId:t.id,width:n}),r}var Fe={invokerTags:bg,popoverTags:ru};function LC(e,t){if(!e||!t)return null;for(let n=t.length;n>=0;n-=1){let o=t.slice(0,n),r=ne(e,o);if(T(r)&&la(r,Fe))return o}return null}function kt(e,t){let n=e.doc.document;if(!n)return null;if(t){let o=ne(n,t);return T(o)&&la(o,Fe)?t:null}return LC(n,Oe(e.session.selection))}function Ht(){let e=h.value?.doc.document;return e?iR(e,Fe):!1}var Lt=["toggle-popover","show-popover","hide-popover","show-modal","close","request-close"],Ve=new Set(["show-modal","close","request-close"]),We=new Set(["toggle-popover","show-popover","hide-popover"]),Po=["any","closerequest","none"],wo=new Set(Lt),Eo=new Set(Po),To=new Set(["button"]);function J(e){return fr(e)==="dialog"}function Jt(e){return e.startsWith("--")}function Mo(e){let t=[];for(let{node:n}of gl(e)){let o=Ch(n);if(J(n)&&o!==null&&!t.includes(o))t.push(o)}return t}function _t(e){for(let{node:t}of gl(e))if(J(t))return!0;return!1}function No(e){let t=e.oncommand;return t!==void 0&&t!==null}function Oo(e,t){for(let{node:n}of gl(e)){if(n===e)continue;let o=fr(n);if(o==="button"){let r=cs(n,"command"),a=cs(n,"commandfor");if(r!==null&&(r==="close"||r==="request-close")&&(a===null||a===t))return!0}if(o==="form"&&cs(n,"method")?.toLowerCase()==="dialog")return!0}return!1}function iL(e,t){let n=[...gl(e,[],null,t)],o=Mo(e),r=gg(e,t),a=o.length>0||r.length>0,s=new Map,l=new Map;for(let{node:u}of n){let d=Ch(u);if(d!==null&&!s.has(d))s.set(d,u);if(fr(u)==="button"){let p=cs(u,"commandfor"),g=cs(u,"command");if(p!==null){let P=l.get(p)??new Set;P.add(g??""),l.set(p,P)}}}let c=[];for(let{node:u,path:d}of n)if(c.push(...Ao(u,d,s,o,r,a,t)),J(u))c.push(...Io(u,d,l));return c}function Ao(e,t,n,o,r,a,s){let l=[],c=fr(e),u=s?.invokerTags?.has(c)??!1,d=cs(e,"command"),p=cs(e,"commandfor");if(!(d!==null||p!==null||("command"in lc(e))||("commandfor"in lc(e))))return l;let P=ds(e,"the element");if(!To.has(c)&&!u)return l.push({detail:"`command` and `commandfor` are attributes of `HTMLButtonElement` and of no other "+"interface — not even `<input>`, which `popovertarget` does allow. Elsewhere they parse "+`and do nothing. Make it a <button>, or remove both attributes. ${Wi}`,fix:"invoker",message:`<${c||"element"}> carries command/commandfor, which only <button> supports.`,path:t,rule:"invoker-not-button",severity:"error"}),l;if(d!==null&&!wo.has(d)&&!Jt(d))return l.push({detail:`\`command\` is an enumerated attribute taking ${Lt.map((A)=>`\`${A}\``).join(", ")}, or a custom command starting with \`--\`. Anything else is the invalid-value state, and a button in that state does nothing when clicked. ${Wi}`,message:`${P} declares command="${d}", which is not a built-in or --custom command.`,path:t,rule:"command-invalid",severity:"error"}),l;if(p!==null){let A=n.get(p),k=o.includes(p),v=r.includes(p);if(!A&&a){let y=[...o,...r].map((C)=>`"${C}"`).join(", ");return l.push({detail:`No element in this document has the id "${p}". The dialogs and popovers here are: ${y}. A commandfor that names nothing does nothing, silently. ${Wi}`,message:`commandfor="${p}" names nothing in this document.`,path:t,rule:"command-target-missing",severity:"error"}),l}if(d!==null&&A){if(Ve.has(d)&&!J(A))l.push({detail:`\`${d}\` acts on a <dialog>, and "${p}" is ${v?"a popover":`a <${fr(A)||"element"}>`}. The click is ignored. ${v?"Use `toggle-popover`, `show-popover` or `hide-popover` for a popover.":"Point it at a dialog, or make the target one."} ${Wi}`,message:`${P} sends ${d} to "${p}", which is not a dialog.`,path:t,rule:"command-target-mismatch",severity:"error"});else if(We.has(d)&&!la(A,s))l.push({detail:`\`${d}\` acts on a popover, and "${p}" is ${k?"a dialog":`a <${fr(A)||"element"}>`} that declares no \`popover\`. The click is ignored. ${k?"Use `show-modal`, `close` or `request-close` for a dialog.":"Give the target a `popover` attribute, or point the button elsewhere."} ${Wi}`,message:`${P} sends ${d} to "${p}", which is not a popover.`,path:t,rule:"command-target-mismatch",severity:"error"});else if(Jt(d)&&!No(A))l.push({detail:`A custom command is a \`CommandEvent\` dispatched at its target, and "${p}" has no `+"`oncommand` handler to answer it — so the click does nothing. Add one that switches on "+`\`event#/command\`, or use a built-in command. ${Wi}`,message:`${P} sends ${d} to "${p}", which handles no command.`,path:t,rule:"custom-command-unhandled",severity:"warn"})}}return l}function Io(e,t,n){let o=[],r=ds(e,"the dialog"),a=Ch(e),{style:s}=e,l=cs(e,"closedby");if(l!==null&&!Eo.has(l))o.push({detail:`\`closedby\` is an enumerated attribute taking \`any\` (light dismiss and Escape), \`closerequest\` (Escape only, the default for a modal) or \`none\`. Anything else is the invalid-value default, \`auto\`, which is the same as leaving it out. ${Wi}`,message:`${r} declares closedby="${l}", which is not any, closerequest or none.`,path:t,rule:"dialog-closedby-invalid",severity:"error"});if(uo(s,"display")!==null)o.push({detail:`A closed dialog is hidden by the browser's own \`dialog:not([open]) { display: none }\`. That rule is UA-origin, so any author \`display\` beats it, and the dialog is laid out on every page whether or not anyone opened it. \`display\` belongs in the \`&[open]\` rule and nowhere else. ${Wi}`,fix:"display",message:`${r} sets display in its base rule.`,path:t,rule:"dialog-display",severity:"error"});let c=a===null?void 0:n.get(a),u=cs(e,"open")!==null||lc(e).open===!0||e.open===!0;if(a!==null&&!c?.has("show-modal")&&!u)o.push({detail:`No <button> in this document opens it with \`command="show-modal"\`. If it is opened from another file or from a function that calls \`showModal()\`, this is fine; otherwise there is no way for a reader to open it. ${Wi}`,message:`${r} has no invoker in this document.`,path:t,rule:"dialog-no-invoker",severity:"warn"});if(c?.has("show-modal")&&l==="none"&&!Oo(e,a))o.push({detail:`A modal dialog makes everything outside it inert, so the only ways out are the ones it offers: \`closedby="none"\` turns off Escape and light dismiss, and nothing inside it closes it. A reader who opens it cannot leave. Add a <button command="close"> inside, or drop \`closedby="none"\`. ${Wi}`,message:`${r} opens modally, closes on nothing, and has no close button.`,path:t,rule:"modal-without-close",severity:"error"});return o}function $C(e,t){if(!e||!t)return null;for(let n=t.length;n>=0;n-=1){let o=t.slice(0,n),r=ne(e,o);if(T(r)&&J(r))return o}return null}function Hx(e,t){let n=e.doc.document;if(!n)return null;if(t){let o=ne(n,t);return T(o)&&J(o)?t:null}return $C(n,Oe(e.session.selection))}function jt(){let e=h.value?.doc.document;return e?_t(e):!1}var Do=/\[\.\.\.(\w+)\]|\[(\w+)\]/g;function $o(e){return e.split("\\").join("/").replace(/^\.\//,"").replace(/^\//,"").replace(/^pages\//,"")}function qt(e){let t=$o(e),n=t.slice(t.lastIndexOf("/")+1),o=n.lastIndexOf(".");if(o>0)t=t.slice(0,t.length-(n.length-o));if(t.endsWith("/index"))t=t.slice(0,-6)||"/";else if(t==="index")t="/";if(!t.startsWith("/"))t=`/${t}`;let r=[],a=!1,s=!1,l=t.replaceAll(Do,(c,u,d)=>{if(a=!0,u)return s=!0,r.push(u),"*";return r.push(d),`:${d}`});return{isCatchAll:s,isDynamic:a,params:r,urlPattern:l}}function fy(e){if(!e)return"/";return qt(e).urlPattern}function Kl(e){if(!e)return[];return qt(e).params}function oL(e){let t=e.document?.$paths,n=e.frontmatter?.$paths;return t??n??null}var me=new Map;function sL(){me.clear()}function aL(e,t){if(!t)return Promise.resolve({});let n=`${e??""}::${JSON.stringify(t)}`,o=me.get(n);if(!o)o=Ho(t).catch((r)=>(me.delete(n),console.warn("page-params: failed to enumerate $paths values:",r),{})),me.set(n,o);return o}async function Ho(e){if(Array.isArray(e)){let t={};for(let n of e)for(let[o,r]of Object.entries(n))fe(t,o,r);return t}if("contentType"in e&&i(e.contentType)&&e.contentType){let t=e.param??"slug",n=e.field??"id",o=await _o(e.contentType),r={[t]:[]};if(!Array.isArray(o))return r;let a=o;for(let s of a)fe(r,t,n==="id"?s.id:s.data?.[n]??s.id);return r}if("values"in e&&Array.isArray(e.values)){let t=e.param??"value",n={[t]:[]};for(let o of e.values)fe(n,t,o);return n}if("$ref"in e&&i(e.$ref)&&e.$ref){let t=e.param??"id",n=e.field??"id",o=await f().readFile(e.$ref.replace(/^\.\//,"")),r=JSON.parse(o),a={[t]:[]};if(!Array.isArray(r))return a;for(let s of r)fe(a,t,w(s)?s[n]??s.id??s:s);return a}return{}}async function Jo(){let e=await nu();for(let t of e){let n=t.classes?.find((o)=>o.name==="ContentCollection");if(n)return n.path}return"@jxsuite/parser/ContentCollection.class.json"}async function _o(e){let t={$prototype:"ContentCollection",$src:await Jo(),contentType:e},n=f();if(n.resolveClass)return n.resolveClass(t);return fetch("/__jx_resolve__",{body:JSON.stringify(t),headers:{"content-type":"application/json"},method:"POST"}).then((o)=>{if(!o.ok)throw Error(`Class resolution failed: ${o.status}`);return o.json()})}function fe(e,t,n){if(n===null||n===void 0||n==="")return;let o=String(n);e[t]??=[];let r=e[t];if(!r.includes(o))r.push(o)}function Ft(e,t,n){if(Object.keys(t).length===0)return e;let o=zt(e,t);return o.state??={},o.state.$page={params:{...t},title:i(o.title)?o.title:"",url:fy(n)},o}function Vt(e){if(!e)return[];return Object.keys(e).filter((t)=>{let n=e[t];return w(n)&&i(n.$prototype)&&i(n.$src)&&JSON.stringify(n).includes('"#/$params/')})}async function Wt(e,t,n){if(t.length===0)return;let o=f(),{resolveClass:r}=o;if(!r)return;let{state:a}=e;if(!a)return;await Promise.all(t.map(async(s)=>{let l=a[s];if(!w(l))return;let c={...l};if(n)c.$base=n;try{a[s]=await r.call(o,c)}catch(u){console.warn(`page-params: failed to resolve state.${s} for preview:`,u)}}))}function Bt(e,t){let n=jo(e,t);if(n!==null)return n;if(Array.isArray(e))return e.map((o)=>Bt(o,t));return w(e)?zt(e,t):e}function zt(e,t){let n={};for(let[o,r]of Object.entries(e))n[o]=Bt(r,t);return n}function jo(e,t){if(!He(e)||!e.$ref.startsWith("#/$params/"))return null;return t[e.$ref.slice(10)]??null}function W(e){return pt(e.paneId)}function X(e){let t=Co(e.paneId);if(t?.kind==="lens")return t.zoom;return W(e)?.session.ui.zoom??1}function Ap(e=So()){return X(e)}function ge(e,t){let n=Co(e.paneId);if(n?.kind==="lens"){n.zoom=t;return}let o=W(e);if(o)o.session.ui.zoom=t}function qo(e){return Boolean(e.canvas&&e.viewport)}function rh(e,t,n,o=null){let a={_width:o||null,canvas:null,element:null,mediaName:e||"",ready:!1,renderScope:null,scrollContainer:null,viewport:null},s=[];if(o&&!n)s.push(`--panel-viewport-w:${o}px`);if(o)s.push(`--panel-canvas-w:${o}px`);return{item:{fullWidth:n,header:t?"shown":"hidden",key:e??"",label:t??"",mediaAttr:e,widthVars:s.join(";")},panel:a}}function wL(e,t){for(let{item:n,panel:o}of e){let r=(a)=>t.panelNode(n.key,a);o.element=r("panel"),o.viewport=r("panel-viewport"),o.canvas=r("panel-canvas")}}function xL(e,t){let n=e.find((r)=>r.item.key===t);if(!n)return;let o=Rt(n.panel);if(o)o.session.ui.activeMedia=de(n.item.mediaAttr)}function Ue(e){if(!e.panzoomWrap)return;let t=e.wrap.clientWidth,n=e.panzoomWrap.scrollWidth,o=X(e),r=n*o;e.panX=Math.max(16,(t-r)/2),e.panY=0}function yy(e){if(e.centerObserver)e.centerObserver.disconnect(),e.centerObserver=null;if(!e.panzoomWrap)return;e.needsCenter=!0,e.centerObserver=new ResizeObserver(()=>{if(!e.needsCenter){e.centerObserver?.disconnect(),e.centerObserver=null;return}Ue(e),Es(e)}),e.centerObserver.observe(e.panzoomWrap),Ue(e)}function Es(e){if(!e.panzoomWrap)return;let t=X(e);e.panzoomWrap.style.transform=`translate(${e.panX}px, ${e.panY}px) scale(${t})`,Bi("overlays")}var Ge=0.25,Xe=3;function Gt(e){return Math.min(Xe,Math.max(Ge,e))}function Fo(e,t,n){let o=e.wrap.querySelector('[part="edit-canvas"]'),r=e.panels[0]?.canvas;if(!o||!r)return null;let a=e.wrap.querySelector('[part="edit-column"]'),s=a?Me(a).width:0,l=t&&s>0?s/t:1,c=n;if(c===null){let u=Me(o);c=u.top+u.height/2}return{layoutY:Math.max(0,(c-Me(r).top)/l),scroller:o,zoom:l}}function jd(e=So(),t=null){if($r(e.paneId)!=="edit")return;let[n]=e.panels;if(!n||!qo(n))return;let o=n.canvas,r=o.querySelector("iframe"),a=W(e)?.session.ui.editZoom??1,s=Fo(e,n._width??null,t);if(a===1){if(n._width=null,o.style.width="",o.style.transform="",o.style.transformOrigin="",r)r.style.width="100%";n.viewport.style.height=""}else{let l=e.wrap.querySelector('[part="edit-column"]');if(!l)return;let c=Me(l).width;if(c<=0)return;let u=c/a;if(n._width=u,o.style.width=`${u}px`,o.style.transform=`scale(${a})`,o.style.transformOrigin="top left",r)r.style.width=`${u}px`,n.viewport.style.height=`${r.offsetHeight*a}px`}if(s)s.scroller.scrollTop+=s.layoutY*(a-s.zoom);Bi("overlays")}function oh(e,t=So()){let n=W(t);if(!n)return;n.session.ui.editZoom=Gt(e),jd(t)}var Be=new Map,ze=new Map;function _L(e,t=So(),n=null){let o=W(t);if(!o)return;if(o.session.ui.editZoom=Gt(e),ze.set(t.paneId,n),Be.has(t.paneId))return;Be.set(t.paneId,requestAnimationFrame(()=>{Be.delete(t.paneId);let r=ze.get(t.paneId)??null;ze.delete(t.paneId),jd(t,r)}))}function Zt(e,t,n){if(!e.panzoomWrap)return;let o=e.wrap.clientWidth,r=e.wrap.clientHeight,a=24,s=32,l=0,{panels:c}=e;for(let S of c)l+=S._width||800;l+=a*Math.max(0,c.length-1)+s;let u=X(e),g=Me(e.panzoomWrap).height/u+s,P=o/l,A=r/g,k=t==="width"?P:Math.min(P,A),v=Math.min(n,Math.max(F,k));ge(e,v);let y=l*v,C=g*v;e.panX=Math.max(0,(o-y)/2),e.panY=Math.max(0,(r-C)/2),Es(e)}function SL({maxZoom:e=V,surface:t=So()}={}){ve("page",t),Zt(t,"page",e)}var F=0.05,V=5;function Yt(e){return Math.min(V,Math.max(F,e))}var Vo="page",et=["width","page","none"];function Wo(e,t,n){let o=t[n];if(Bo(o))return o;if(ee(o)&&o>=F&&o<=V)return o;throw RangeError(`command "${e}" argument "${n}": expected ${et.map((r)=>`"${r}"`).join(" | ")} or a number in [${F}, ${V}], got ${JSON.stringify(o)}`)}function Bo(e){return i(e)&&et.includes(e)}var Xt=new Map;function Qt(e){let t=W(e);if(!t)return null;let n=Co(e.paneId)?.kind==="lens"?`::${e.paneId}`:"";return`${t.id}::${t.documentPath??""}${n}`}function ve(e,t){let n=Qt(t);if(n)Xt.set(n,e)}function Bx(e=So()){let t=Qt(e);return(t===null?void 0:Xt.get(t))??Vo}function en(e,t=So()){let n=e??Bx(t);if(n==="none"){Es(t);return}if(ee(n)){ge(t,Yt(n)),Es(t);return}Zt(t,n,1)}function RC(e,t=So()){ve(e,t),en(e,t)}function Pp(e,t=So(),n=null){if(!W(t))return;let r=Yt(e),a=r/X(t);if(ve(r,t),t.panzoomWrap&&a!==1){let s=Me(t.panzoomWrap),l=Me(t.wrap),c=n?.clientX??l.left+l.width/2,u=n?.clientY??l.top+l.height/2;t.panX+=(c-s.left)*(1-a),t.panY+=(u-s.top)*(1-a),t.needsCenter=!1}ge(t,r),Es(t)}function Vx(e){if(e.wrap.clientWidth<=0){Es(e);return}en(Bx(e),e)}function CL(e=So()){if(ve(1,e),!e.panzoomWrap)return;ge(e,1),Ue(e),Es(e)}function zo(e,t){let n=Me(tn(e)??e.wrap),o=t.top+t.height/2-n.top;return n.height/2-o}function tn(e){return gy(e)?.scrollContainer??null}function Uo(e,t,n){let o=tn(e);if(!o){Go(e,t);return}let r=o.scrollTop-t;if(n){o.scrollTo({behavior:"smooth",top:r});return}o.scrollTop=r}function vy(e,t=So()){Uo(t,zo(t,e),!1)}function Go(e,t){let n=e.panY,o=n+t,r=performance.now(),a=250,s=(l)=>{let c=Math.min((l-r)/250,1),u=c*(2-c);if(e.panY=n+(o-n)*u,Es(e),c<1)requestAnimationFrame(s)};requestAnimationFrame(s)}var Ke=["edit","design","preview","source","stylebook","grid","git-diff"],ye=new Set(["edit","design"]);function Zo(e){return ye.has(e)}var IC=["edit","design","preview"];function Yo(e){return IC.filter((t)=>e.capabilities.modes.includes(t))}function kL(e){return Yo(e).filter((t)=>t!=="preview")}function DC(e){let t=e.session.ui.canvasMode;return Zo(t)?t:null}function NC(e){return{available:e.capabilities.modes.includes("preview")&&ye.has(e.session.ui.canvasMode),on:e.session.ui.preview===!0}}function OC(e,t,n){if(t==="preview"){if(ye.has(e.session.ui.canvasMode))e.session.ui.preview=!0;return}if(e.session.ui.preview=!1,e.session.ui.canvasMode!==t)n(e,t)}var Kt=new Set(["design","stylebook","git-diff"]),D=(e)=>e.document.open,Ut=["auto","light","dark"];function Xo(e){function t(s){let l=h.value;if(!l)throw RangeError(`command "${s}" needs an open document; no tab is active`);return l}function n(s,l){let{pane:c}=l;if(c===void 0)return t(s);let u=ct(s,l,"pane"),d=pt(u);if(!d)throw RangeError(`command "${s}" argument "pane": "${u}" has no open document`);return d}let o={pane:qe("Which pane to render this way. Defaults to the focused one.")};function r(s){e.renderPane(a(s))}function a(s){let{pane:l}=s;return i(l)?l:b.activePaneId}return[{args:Ie({mode:Vr(Ke,"The canvas mode to switch the active pane to.")}),category:"View",id:"canvas.setMode",level:"document",menus:["palette"],group:"3_canvas",requires:"an open document",when:D,aiTool:{description:"Switch the active document's editor mode. edit and design put its element tree on the canvas, where the document tools work; preview renders it as a visitor sees it; source shows the JSON; stylebook, grid and git-diff open other editors. Use it to return a document to edit or design when the tree tools are refused.",name:"set_canvas_mode",report:({after:s,args:l})=>{let c=gi("canvas.setMode",l,"mode",Ke),u=s.editor.kind==="canvas"?"the document tools address its element tree":"the tree-editing tools are unavailable until it returns to edit or design";return`The active document is in ${c} mode; ${u}.`}},run:(s,l)=>{let c=gi("canvas.setMode",l,"mode",Ke),u=t("canvas.setMode"),{modes:d}=u.capabilities;if(!d.includes(c))throw RangeError(`command "canvas.setMode" argument "mode": "${c}" is not a mode this document `+`supports — it declares: ${d.join(", ")}`);if(c==="preview"){let p=u.session.ui.canvasMode;if(!ye.has(p))throw RangeError(`command "canvas.setMode" argument "mode": "preview" composes with the edit and design base modes; this pane is in "${p}"`);u.session.ui.preview=!0;return}u.session.ui.preview=!1,e.setCanvasMode(u,c)},title:"Set Canvas Mode"},{args:Ie({zoom:R1("Pan-zoom scale, 1 = 100%.",{maximum:V,minimum:F})}),category:"View",id:"canvas.setZoom",level:"document",menus:["palette"],group:"3_canvas",requires:"a document on the pan-zoom surface",when:D,enablement:()=>Kt.has(e.getCanvasMode()),run:(s,l)=>{t("canvas.setZoom"),Pp(ev("canvas.setZoom",l,"zoom",F,V))},title:"Set Zoom"},{args:Ie({fit:{description:'How the document is framed: "width" | "page" | "none", or a numeric pan-zoom scale.',oneOf:[{enum:[...et],type:"string"},{maximum:V,minimum:F,type:"number"}]}}),category:"View",id:"canvas.setFit",level:"document",menus:["palette"],group:"3_canvas",requires:"a document on the pan-zoom surface",when:D,enablement:()=>Kt.has(e.getCanvasMode()),run:(s,l)=>{t("canvas.setFit"),RC(Wo("canvas.setFit",l,"fit"))},title:"Set Fit"},{args:Ie({zoom:R1("Edit-mode content zoom, 1 = 100%.",{maximum:Xe,minimum:Ge})}),category:"View",id:"canvas.setEditZoom",level:"document",menus:["palette"],group:"3_canvas",requires:"a document in edit mode",when:D,enablement:()=>e.getCanvasMode()==="edit",run:(s,l)=>{t("canvas.setEditZoom"),oh(ev("canvas.setEditZoom",l,"zoom",Ge,Xe))},title:"Set Edit Zoom"},{args:{additionalProperties:!1,properties:{...o,width:{description:"How wide the Edit column should render, in CSS pixels, or null to go back to the chosen breakpoint's own width.",type:["number","null"]}},required:["width"],type:"object"},category:"View",id:"canvas.setEditWidth",level:"document",menus:["palette"],group:"3_canvas",requires:"a document in edit mode",when:D,enablement:()=>e.getCanvasMode()==="edit",run:(s,l)=>{let c=n("canvas.setEditWidth",l),{width:u}=l;if(u===null){Fx(a(l)),r(l);return}jx(a(l),c,ev("canvas.setEditWidth",l,"width",Op,1e4)),r(l)},title:"Set Edit Width"},{args:{additionalProperties:!1,properties:{...o,media:{description:"A breakpoint key the document renders under, or null for the base rendering.",type:["string","null"]}},required:["media"],type:"object"},category:"View",id:"canvas.setBreakpoint",level:"document",menus:["palette"],group:"3_canvas",requires:"an open document",when:D,run:(s,l)=>{let c=n("canvas.setBreakpoint",l),{media:u}=l;if(u!==null&&!i(u))throw RangeError('command "canvas.setBreakpoint" argument "media": expected a breakpoint key or null');let d=Object.keys(Hi(c.doc.document.$media));if(u!==null&&!d.includes(u))throw RangeError(`command "canvas.setBreakpoint" argument "media": "${u}" is not a breakpoint this `+`document defines — it defines: ${d.length>0?d.join(", "):"nothing"}`);c.session.ui.activeMedia=u,r(l)},title:"Set Breakpoint"},{args:Ie({...o,scheme:Vr(Ut,"Which color scheme the canvas renders in.")},["scheme"]),category:"View",id:"canvas.setColorScheme",level:"document",menus:["palette"],group:"3_canvas",requires:"an open document",when:D,run:(s,l)=>{let c=n("canvas.setColorScheme",l);c.session.ui.previewColorScheme=gi("canvas.setColorScheme",l,"scheme",Ut),r(l)},title:"Set Color Scheme"},{args:Ie({...o,locale:qe("BCP 47 tag this pane renders as.")},["locale"]),category:"View",id:"i18n.switchLocale",level:"document",menus:["palette"],group:"3_canvas",requires:"an open document in a project that declares more than one locale",when:(s)=>s.document.open&&s.project.isMultilingual,run:(s,l)=>{let c=n("i18n.switchLocale",l),u=ct("i18n.switchLocale",l,"locale"),d=Ls();if(d===null||!d.locales.includes(u))throw RangeError(`command "i18n.switchLocale" argument "locale": "${u}" is not a locale this `+`project declares — it declares: ${d===null?"nothing":d.locales.join(", ")}`);c.session.ui.previewLocale=u,r(l)},title:"Set Rendering Language"},{args:Ie({...o,visible:pr("True to draw the page's layout elements, false to hide them.")},["visible"]),category:"View",id:"canvas.setLayoutVisible",level:"document",menus:["palette"],group:"3_canvas",requires:"an open document",when:D,run:(s,l)=>{let c=n("canvas.setLayoutVisible",l);c.session.ui.showLayout=Ti("canvas.setLayoutVisible",l,"visible"),r(l)},title:"Show Layout Elements"},{args:Ie({...o,open:pr("True to draw the popover open, false to close it."),path:{description:"Document path of the popover. Defaults to the popover the selection is in or at.",items:{type:["string","number"]},type:"array"}},[]),category:"View",enablement:()=>Ht(),group:"3_canvas",id:"canvas.setPopoverOpen",level:"document",menus:["palette"],requires:"a popover in the open document",run:(s,l)=>{let c=n("canvas.setPopoverOpen",l),u=l.path,d=l.open===void 0?!0:Ti("canvas.setPopoverOpen",l,"open");if(!d&&u===void 0){e.setOpenPopover(c,null);return}let p=kt(c,u);if(p===null)throw RangeError('command "canvas.setPopoverOpen" argument "path": names no popover in this document — '+"a popover is an element with a `popover` attribute, and <dialog> is not one");e.setOpenPopover(c,d?p:null)},title:"Show Popover",when:D},{args:Ie({...o,open:pr("True to draw the dialog open, false to close it."),path:{description:"Document path of the dialog. Defaults to the dialog the selection is in or at.",items:{type:["string","number"]},type:"array"}},[]),category:"View",enablement:()=>jt(),group:"3_canvas",id:"canvas.setDialogOpen",level:"document",menus:["palette"],requires:"a dialog in the open document",run:(s,l)=>{let c=n("canvas.setDialogOpen",l),u=l.path,d=l.open===void 0?!0:Ti("canvas.setDialogOpen",l,"open");if(!d&&u===void 0){e.setOpenDialog(c,null);return}let p=Hx(c,u);if(p===null)throw RangeError('command "canvas.setDialogOpen" argument "path": names no dialog in this document — '+"a dialog is a <dialog> element, and a popover is not one");e.setOpenDialog(c,d?p:null)},title:"Show Dialog",when:D},{args:{additionalProperties:!1,properties:{...o,open:{default:!0,description:"True to open the resolving-with popover, false to close it.",type:"boolean"}},required:[],type:"object"},category:"View",id:"canvas.setResolvingOpen",level:"document",menus:["palette"],group:"3_canvas",requires:"an open document",when:D,run:(s,l)=>{n("canvas.setResolvingOpen",l);let{open:c,pane:u}=l;e.setResolvingOpen(i(u)?u:b.activePaneId,c===void 0||Ti("canvas.setResolvingOpen",l,"open"))},title:"Show Resolving Values"},{args:{additionalProperties:!1,properties:{...o,name:qe("The prop's name, as the component's state declares it."),value:{description:"The test value — any JSON. Null clears it and the prop returns to its default.",type:["string","number","boolean","array","object","null"]}},required:["name"],type:"object"},category:"View",id:"canvas.setTestProp",level:"document",menus:["palette"],group:"3_canvas",requires:"an open component document",when:D,run:(s,l)=>{let c=n("canvas.setTestProp",l),u=ct("canvas.setTestProp",l,"name"),d=Object.keys(c.doc.document.state??{});if(!d.includes(u))throw RangeError(`command "canvas.setTestProp" argument "name": "${u}" is not a prop this component `+`declares — it declares: ${d.length>0?d.join(", "):"nothing"}`);let{value:p}=l,g={...c.session.ui.previewProps};if(p===null||p===void 0)delete g[u];else g[u]=p;c.session.ui.previewProps=Object.keys(g).length>0?g:null,r(l)},title:"Set Test Value"},{args:{additionalProperties:!1,properties:{...o,name:qe("The route parameter's name, without brackets."),value:qe("The value to preview the route with. Empty clears it.")},required:["name","value"],type:"object"},category:"View",id:"canvas.setRouteParam",level:"document",menus:["palette"],group:"3_canvas",requires:"an open page with a dynamic route",when:D,run:(s,l)=>{let c=n("canvas.setRouteParam",l),u=ct("canvas.setRouteParam",l,"name"),d=Kl(c.documentPath);if(!d.includes(u))throw RangeError(`command "canvas.setRouteParam" argument "name": "${u}" is not a parameter of this `+`route — it has: ${d.length>0?d.join(", "):"none"}`);c.session.ui.previewParams={...c.session.ui.previewParams,[u]:ct("canvas.setRouteParam",l,"value")},r(l)},title:"Set Route Parameter"}]}function EL(e,t){e.registerAll(Xo(t))}function wy(e=So()){let t=nh(e.paneId),n=e.panels;for(let o of n){let r=o.element?.querySelector('[part="panel-header"]');if(r){let a=t===null&&o.mediaName==="base"||t===o.mediaName;r.toggleAttribute("data-active",a)}}}var nt="jx:canvas";function nn(e){let{target:t,source:n,targetOrigin:o,acceptOrigin:r,token:a}=e,s=new Set,l=(c)=>{if(r!=="*"&&c.origin!==r)return;let u=c.data;if(!T(u)||!(nt in u)||u[nt]!==a)return;let d="payload"in u?u.payload:void 0;for(let p of s)p(d)};return n.addEventListener("message",l),{dispose(){s.clear(),n.removeEventListener("message",l)},onMessage(c){return s.add(c),()=>s.delete(c)},post(c){t.postMessage({[nt]:a,payload:c},o)}}}var Qo=null;function Ix(){return Qo}var er=new Set(["img","video","source","iframe","audio"]),be="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",it="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='32'%20height='32'%3E%3Crect%20width='32'%20height='32'%20fill='%23d0d0d0'/%3E%3C/svg%3E";function rL(e,t){e.addEventListener("error",(n)=>{let{target:o}=n;if(o instanceof HTMLImageElement&&o.getAttribute("src")!==it)o.setAttribute("src",it),o.removeAttribute("srcset"),o.dataset.placeholder=""},{capture:!0,signal:t})}var tr=/(src|poster|image|bg|background|icon|logo|photo|avatar|thumbnail|cover|banner)$/i;function nr(e){return tr.test(e)}var rr=new Set(["p","h1","h2","h3","h4","h5","h6","blockquote","li","dt","dd","th","td","span","strong","em","small","mark","code","abbr","q","sub","sup","time","a","button","label","legend","caption","summary","pre","option"]),ir=new Set(["div","section","article","aside","header","footer","main","nav","figure","figcaption","details","fieldset","form","ul","ol","dl","table"]);function ar(e){if(!e.tagName||e.textContent||e.innerHTML)return null;if(e.$__layout)return null;if(Array.isArray(e.children)&&e.children.length>0)return null;if(rr.has(Ze(e.tagName)))return"empty-text-placeholder";if(ir.has(Ze(e.tagName)))return"empty-container-placeholder";return null}function ot(e){return e.replaceAll(/\$\{([^}]+)\}/g,"❪ $1 ❫")}function sr(e){let t=e.map;return{children:T(t)?[H(t)]:[],className:"repeater-perimeter",tagName:"div"}}function rt(e){return`{${e.startsWith("#/state/")?e.slice(8):e}}`}function H(e){if(Array.isArray(e))return e.map((s)=>H(s));if(!Qn(e))return e;if(e.$prototype==="Array")return sr(e);let t=e,n={},o=!1,r=i(t.tagName)&&er.has(t.tagName);if(r){let{attributes:s,src:l}=t,c=s?.src,u=t.poster,d=s?.poster;if(!(l&&l!==""||c&&c!=="")&&!(u&&u!==""||d&&d!==""))o=!0}for(let[s,l]of Object.entries(t))if(s==="state"||s==="$media"||s==="$elements")n[s]=l;else if(s==="$props"&&vh(l)){let c={};for(let[u,d]of Object.entries(l))if(i(d)&&d.includes("${"))if(nr(u))c[u]=it;else if(u==="href"||u==="action")c[u]="";else c[u]=ot(d);else if(Qn(d)&&d.$ref)c[u]=rt(d.$ref);else c[u]=d;n[s]=c}else if(s==="children")if(Array.isArray(l))n.children=l.map((c)=>H(c));else if(Qn(l)&&l.$prototype==="Array")n.children=[H(l)];else n.children=H(l);else if(s==="cases"&&t.$switch&&vh(l)){let[c]=Object.entries(l);if(c){let[,u]=c;n.children=vh(u)&&!(Qn(u)&&u.$ref)?[H(u)]:[{style:{background:"color-mix(in srgb, var(--danger) 8%, transparent)",border:"1px dashed color-mix(in srgb, var(--danger) 40%, transparent)",borderRadius:"4px",color:"var(--danger)",fontFamily:"'JetBrains Mono', 'SF Mono', 'Fira Code', monospace",fontSize:"11px",fontStyle:"italic",padding:"6px 10px"},tagName:"div",textContent:`[$switch: ${Object.keys(l).join(" | ")}]`}]}}else if(s==="attributes"&&r&&vh(l)){let c={};for(let[u,d]of Object.entries(l))if(u==="src"||u==="poster")if(i(d)&&d!==""&&!d.includes("${"))c[u]=d;else o=!0,c[u]=be;else if(i(d)&&d.includes("${")){let p=u==="href"||u==="action";c[u]=p?"":ot(d)}else if(Qn(d)&&d.$ref)c[u]=rt(d.$ref);else c[u]=d;n.attributes=c}else if(s==="style")if(vh(l)){let c={};for(let[u,d]of Object.entries(l))if(!i(d)||!d.includes("${"))c[u]=d;n.style=c}else n.style=l;else if(i(l)&&l.includes("${"))if((s==="src"||s==="poster")&&r)o=!0,n[s]=be;else{let u=s==="src"||s==="href"||s==="poster"||s==="action";n[s]=u?"":ot(l)}else if(Qn(l)&&l.$ref){let c=rt(l.$ref);if((s==="src"||s==="poster")&&r)o=!0,n[s]=be;else n[s]=c}else if((s==="src"||s==="poster")&&l===""&&r)o=!0,n[s]=be;else n[s]=H(l);let a=ar(n);if(a)n.className=n.className?`${n.className} ${a}`:a;if(o){let s=i(n.className)?n.className:"";if(!s.includes("empty-media-placeholder"))n.className=s?`${s} empty-media-placeholder`:"empty-media-placeholder"}return n}function Dx(e){let t=e?.tagName;return i(t)&&t.includes("-")}function lr(e){return T(e)&&!Array.isArray(e)}function on(e){if(e===void 0)return null;if(lr(e)){if(e.$expression||e.$compute||e.$prototype||e.$handler)return null;return"default"in e||"type"in e?"signal":"literal"}return i(e)&&e.includes("${")?null:"literal"}function lL(e){let t=e?.state??{},n=[];for(let[o,r]of Object.entries(t)){if(mf(o))continue;let a=on(r);if(!a)continue;let s=a==="signal"?r.default:r;n.push({name:o,value:s})}return n}function rn(e,t){let n={...e.state},o=!1;for(let[r,a]of Object.entries(t)){let s=n[r],l=on(s);if(!l)continue;n[r]=l==="signal"?{...s,default:a}:a,o=!0}if(!o)return e;return{...e,state:n}}function an(e,t=[]){if(!T(e))return null;if(Array.isArray(e.children)){let n=e.children.findIndex((o)=>T(o)&&!o.$__layout);if(n!==-1)return{offset:n,prefix:[...t,"children"]};for(let o=0;o<e.children.length;o++){let r=e.children[o];if(T(r)&&r.$__layout){let a=an(r,[...t,"children",o]);if(a)return a}}}return null}function at(e,t,n=[]){if(!T(e))return;if(e.$__layout={file:t,path:n},Array.isArray(e.children))for(let[o,r]of e.children.entries()){if(i(r))continue;at(r,t,[...n,"children",o])}if(Array.isArray(e.$elements)){for(let[o,r]of e.$elements.entries())if(!i(r))at(r,t,[...n,"$elements",o])}}async function sn(e,t,n=null){let o={documentPath:t?.documentPath,mode:t?.doc.mode},r=n??ql(t),a=r==="preview"?structuredClone(he(e)):H(wh(e)),s=!1,l=o.documentPath&&O?.isSiteProject&&(o.documentPath.startsWith("pages/")||o.documentPath.startsWith("./pages/")),c=null,u=0;if(l&&t?.session.ui.showLayout!==!1){let v=Yl(e.$layout);if(v){let y=await Ty(v);if(y){at(y,v.replace(/^\.\//,""));let C=r==="preview"?structuredClone(he(e)):a,S=AL(y,C);a=r==="preview"?S:H(wh(S)),s=!0;let R=an(S);c=R?.prefix??null,u=R?.offset??0}}}let d=Bp(O?.projectRoot),p=o.documentPath?new URL(o.documentPath,d).href:void 0,g=Um(o.documentPath,Kd());if(l&&t){let{previewParams:v}=t.session.ui;if(Object.keys(v).length>0){let y=Vt(e.state??null);a=Ft(a,v,o.documentPath),await Wt(a,y,p)}}if(!l&&t&&Dx(a)){let{previewProps:v}=t.session.ui;if(v&&Object.keys(v).length>0)a=rn(a,v)}let P=new Set;if(r!=="preview")(function v(y,C){if(!T(y))return;if(y.$prototype==="Array"){P.add(C.join("/"));let S=y.map;if(T(S))v(S,[...C,"map"]);return}if(Array.isArray(y.children))for(let[S,R]of y.children.entries()){if(i(R))continue;v(R,[...C,"children",S])}else if(Ro(y.children))v(y.children,[...C,"children"]);if(y.$switch&&y.cases)for(let[S,R]of Object.entries(y.cases))v(R,[...C,"cases",S])})(e,[]);let A=o.documentPath!=null&&(o.documentPath.startsWith("layouts/")||o.documentPath.startsWith("./layouts/")),k=Ey(a.$elements);if((o.mode==="content"||s||A)&&ut.length>0){let v=new Set(k.map((C)=>T(C)?C.$ref:C)),y=(C)=>{let S=new Set;if(!T(C))return S;if(C.tagName)S.add(Ze(C.tagName));if(Array.isArray(C.children)){for(let R of C.children)if(!i(R))for(let co of y(R))S.add(co)}return S};for(let C of y(a)){let S=ut.find((R)=>R.tagName===C);if(S&&S.source!=="npm"&&S.path){let R=Bc(o.documentPath??null,S.path);if(!v.has(R))k.push({$ref:R}),v.add(R)}}}if(k.length>0)a.$elements=k;return a.imports=NL(a.imports),a.$media=Hi(a.$media),a.$head=OL(a.$head),{assets:g,docBase:p,mapperCtx:{arrayPaths:[...P],canvasMode:r,layoutWrapped:s,pageContentOffset:u,pageContentPrefix:c},renderDoc:a,siteStyle:O?.projectConfig?.style??null}}function ki(e){if(e==="--")return"Base";return e.replace(/^--/,"").replaceAll("-"," ").replaceAll(/\b\w/g,(t)=>t.toUpperCase())||e}var ln=new Set(["script","style","link","iframe","object","embed"]);function Fd(e){let t={tagName:e};if(/^h[1-6]$/.test(e))t.textContent="Heading";else if(e==="p")t.textContent="Paragraph text";else if(e==="span"||e==="strong"||e==="em"||e==="small"||e==="mark"||e==="code"||e==="abbr"||e==="q"||e==="sub"||e==="sup"||e==="time")t.textContent="Text";else if(e==="a")t.textContent="Link",t.attributes={href:"#"};else if(e==="button")t.textContent="Button";else if(e==="label")t.textContent="Label";else if(e==="legend")t.textContent="Legend";else if(e==="caption")t.textContent="Caption";else if(e==="summary")t.textContent="Summary";else if(e==="li"||e==="dt"||e==="dd"||e==="th"||e==="td"||e==="option")t.textContent="Item";else if(e==="blockquote")t.textContent="Quote";else if(e==="pre")t.textContent="Preformatted text";else if(e==="input")t.attributes={placeholder:"Enter text...",type:"text"};else if(e==="img")t.attributes={alt:"Image"};else if(e==="iframe")t.attributes={src:""};else if(e==="slot")t.children=[{tagName:"p",textContent:"Slot content"}];else if(e==="select")t.children=[{tagName:"option",textContent:"Option 1"}];else if(e==="ul"||e==="ol")t.children=[{tagName:"li",textContent:"Item"}];else if(e==="dl")t.children=[{tagName:"dt",textContent:"Term"},{tagName:"dd",textContent:"Definition"}];else if(e==="table")t.children=[{children:[{children:[{tagName:"th",textContent:"Header"}],tagName:"tr"}],tagName:"thead"},{children:[{children:[{tagName:"td",textContent:"Cell"}],tagName:"tr"}],tagName:"tbody"}];else if(e==="details")t.children=[{tagName:"summary",textContent:"Summary"},{tagName:"p",textContent:"Detail content"}];return t}function B(e){if(!e)return[];if(Array.isArray(e.children))return e.children;return i(e.textContent)&&e.textContent.length>0?[e.textContent]:[]}function Q(e){let t=0;for(let n of e)t+=i(n)?n.length:Q(B(n));return t}function st(e,t,n){let o=[],r=0;for(let a of e){if(r>=n)break;if(i(a)){let u=r+a.length;if(u>t){let d=a.slice(Math.max(0,t-r),Math.max(0,Math.min(n,u)-r));if(d)o.push(d)}r=u;continue}let s=B(a),l=Q(s),c=r+l;if(l===0){if(r>=t&&r<n)o.push({...a})}else if(c>t){let u=st(s,Math.max(0,t-r),Math.min(n,c)-r);if(u.length>0)o.push(cr(a,u))}r=c}return o}function cr(e,t){let{children:n,textContent:o,...r}=e;if(t.length===0)return{...r,textContent:""};if(t.length===1&&i(t[0]))return{...r,textContent:t[0]};return{...r,children:t}}function cn(e){let t=[];for(let n of e){if(i(n)){if(n.length===0)continue;let o=t.at(-1);if(i(o)){t[t.length-1]=o+n;continue}}t.push(n)}return t}function un(e,t,n,o,r=""){return cn([...st(e,0,t),...r?[r]:[],...st(n,o,Q(n))])}function lt(e){let t=cn(e);if(t.length===0)return{textContent:""};if(t.length===1&&i(t[0]))return{textContent:t[0]};return{children:t}}function ur(e){if(!e)return!0;if(e.textContent!=null&&e.textContent.trim()==="")return!0;let t=e.children;if(!t)return!1;if(t.length===0)return!0;let[n]=t;if(t.length===1&&i(n)&&n.trim()==="")return!0;return t.length===1&&T(n)&&n.tagName==="br"}function dn(e){return{index:ai(e),parentPath:Dt(e)}}function pn(e,t,n,o,r={}){if(!e)return;let a=ne(e.doc.document,t);if(n){if(a&&JSON.stringify(a.children)===JSON.stringify(n))return;Y(e,(s)=>{if(a?.textContent!=null)Ye(s,t,"textContent");Ye(s,t,"children",n)},{coalesceKey:r.coalesceKey??null})}else if(o!=null){if(a&&a.textContent===o&&!a.children)return;Y(e,(s)=>{if(a?.children)Ye(s,t,"children");Ye(s,t,"textContent",o)},{coalesceKey:r.coalesceKey??null})}}function fn(e,t,n,o){if(!e)return!1;let r=ne(e.doc.document,t);if(!r)return!1;if(`${r.$props?.[n]??""}`===o)return!1;return Y(e,(s)=>{hh(s,t,n,o)}),!0}function mn(e,t,n){if(!e)return null;let o=ne(e.doc.document,t),r=ne(e.doc.document,n);if(!o||!r)return null;if(ul(t,n)||ul(n,t))return null;let a=B(r),s=B(o),l=Q(a),c=lt([...a,...s]);return Y(e,(u)=>{if(c.children){if(r.textContent!=null)Ye(u,n,"textContent");Ye(u,n,"children",c.children)}else{if(r.children)Ye(u,n,"children");Ye(u,n,"textContent",c.textContent??"")}if(uh(u,t),hn(u,Dt(t)),ef(e))u.session.selection=[n]}),{offset:l,path:n}}function hn(e,t){let n=t;while(n.length>0){let o=ne(e.doc.document,n),r=o?.children;if(!o||!Array.isArray(r)||r.length>0)return;let a=Dt(n);if(uh(e,n),!a)return;n=a}}function gn(e,t,n,o){let{parentPath:r,index:a}=dn(t),s=[...r,"children",a+1];if(!e)return s;let l={tagName:"p"};if(o.textContent!=null)l.textContent=o.textContent;else if(o.children)l.children=o.children;else l.textContent="";return Y(e,(c)=>{if(n.textContent!=null)Ye(c,t,"children"),Ye(c,t,"textContent",n.textContent);else if(n.children)Ye(c,t,"textContent"),Ye(c,t,"children",n.children);if(Ir(c,r,a+1,l),ef(e))c.session.selection=[s]}),s}function vn(e,t,n,o){if(ur(o)){if(!e)return t;return Y(e,(c)=>{Ye(c,t,"tagName",n.tag),Ye(c,t,"children");let u=Fd(n.tag);if(u.textContent&&u.textContent!=="Paragraph text")Ye(c,t,"textContent",u.textContent);else Ye(c,t,"textContent");if(ef(e))c.session.selection=[t]}),t}let{parentPath:r,index:a}=dn(t),s=[...r,"children",a+1];if(!e)return s;let l=Fd(n.tag);return Y(e,(c)=>{if(o?.children)Ye(c,t,"textContent"),Ye(c,t,"children",o.children);else if(o?.textContent!=null)Ye(c,t,"children"),Ye(c,t,"textContent",o.textContent);if(Ir(c,r,a+1,structuredClone(l)),ef(e))c.session.selection=[s]}),s}function yn(e,t,n,o,r){if(!e)return null;let a=ne(e.doc.document,t.path),s=ne(e.doc.document,n.path);if(!a||!s)return null;if(ul(t.path,n.path)||ul(n.path,t.path))return null;let l=lt(un(B(a),t.offset,B(s),n.offset,r)),c=[...o,n.path].toSorted(dr);return Y(e,(u)=>{if(l.children){if(a.textContent!=null)Ye(u,t.path,"textContent");Ye(u,t.path,"children",l.children)}else{if(a.children)Ye(u,t.path,"children");Ye(u,t.path,"textContent",l.textContent??"")}for(let d of c)if(ne(u.doc.document,d))uh(u,d),hn(u,Dt(d));if(ef(e))u.session.selection=[t.path]}),{offset:t.offset+r.length,path:t.path}}function dr(e,t){let n=Math.min(e.length,t.length);for(let o=0;o<n;o++){let r=e[o],a=t[o];if(r===a)continue;if(ee(r)&&ee(a))return a-r;return String(a).localeCompare(String(r))}return t.length-e.length}function I(e,t=1){return{height:e.height*t,left:e.x*t,top:e.y*t,width:e.width*t}}function uL(e,t,n=1){return{x:(e.x-t.left)/n,y:(e.y-t.top)/n}}function Ce(e,t){if(!t){e.style.display="none";return}e.style.display="block",e.style.left=`${t.left}px`,e.style.top=`${t.top}px`,e.style.width=`${t.width}px`,e.style.height=`${t.height}px`}function bn(e=document){let t=e.createElement("div");t.className="jx-canvas-iframe-overlay",t.style.cssText="position:absolute;inset:0;pointer-events:none;overflow:hidden;z-index:2";let n=e.createElement("div");n.className="overlay-box overlay-selection",n.style.display="none";let o=e.createElement("div");o.className="overlay-label",o.style.display="none",n.append(o);let r=e.createElement("div");r.className="overlay-box overlay-hover",r.style.display="none";let a=e.createElement("div");a.className="canvas-drop-indicator",a.style.display="none";let s=e.createElement("button");s.className="insertion-helper",s.textContent="+",s.style.pointerEvents="auto",s.style.display="none";let l=e.createElement("div");l.className="canvas-replace-target",l.style.display="none";let c=e.createElement("div");c.className="overlay-presence-group";let u=e.createElement("div");return u.className="overlay-coselection-group",t.append(r,n,u,a,l,s,c),{dispose:()=>t.remove(),insertButton:s,root:t,setDropIndicator:(d,p="inside")=>hr(a,d,p),setHover:(d)=>Ce(r,d),setInsertZone:(d,p="center")=>mr(s,d,p),setReplaceTarget:(d)=>Ce(l,d),setSuppressed:(d)=>{t.style.display=d?"none":""},setCoSelection:(d)=>{u.replaceChildren();for(let p of d){let g=e.createElement("div");g.className="overlay-box overlay-selection overlay-coselection",Ce(g,p),u.append(g)}},setPresence:(d)=>{c.replaceChildren();for(let p of d){let g=e.createElement("div");g.className="overlay-box overlay-presence",g.style.cssText=`position:absolute;display:block;pointer-events:none;outline:1.5px solid ${p.color};outline-offset:1px;left:${p.placement.left}px;top:${p.placement.top}px;width:${p.placement.width}px;height:${p.placement.height}px`;let P=e.createElement("div");P.className="overlay-presence-tag",P.textContent=p.label,P.style.cssText=`position:absolute;top:-18px;left:-2px;padding:1px 5px;border-radius:3px;font:10px/1.4 sans-serif;color:#fff;white-space:nowrap;background:${p.color}`,g.append(P),c.append(g)}},setSelection:(d,p=null)=>{if(Ce(n,d),d&&p)o.textContent=p,o.style.display="block";else o.style.display="none"}}}function mr(e,t,n){if(!t){e.style.display="none",e.classList.remove("visible");return}e.dataset.edge=n,e.classList.add("visible"),e.style.display="grid",e.style.left=`${t.left+t.width/2}px`,e.style.top=`${t.top+t.height/2}px`,e.style.translate="-50% -50%"}function hr(e,t,n){if(!t){e.style.display="none";return}if(e.style.display="block",e.style.left=`${t.left}px`,e.style.width=`${t.width}px`,n==="inside"){e.className="canvas-drop-indicator inside",e.style.top=`${t.top}px`,e.style.height=`${t.height}px`;return}e.className="canvas-drop-indicator line",e.style.height="",e.style.top=`${n==="top"?t.top:t.top+t.height}px`}function Gl(e){return JSON.stringify(e)}var L=null;function gr(e){if(L?.isConnected)return L;let t=e.createElement("div");return t.className="jx-drag-ghost",t.style.cssText="position:fixed;left:0;top:0;z-index:9999;pointer-events:none;display:none;padding:2px 8px;border-radius:4px;font-size:12px;line-height:1.4;white-space:nowrap;background:var(--accent,#3b82f6);color:var(--accent-fg,#fff);box-shadow:0 2px 8px rgba(0,0,0,0.25);transform:translate(8px,8px)",e.body.append(t),L=t,t}function AC(e,t,n,o=document){let r=gr(o);r.textContent=e,r.style.left=`${t}px`,r.style.top=`${n}px`,r.style.display="block"}function Wx(e,t){if(!L||L.style.display==="none")return;L.style.left=`${e}px`,L.style.top=`${t}px`}function Hd(){if(L)L.style.display="none"}var xn=function(){if(typeof window>"u")return null;var e=new Image;return e.src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",e}();function Hc(e){var t=e.nativeSetDragImage;if(t&&xn)t(xn,0,0)}function Cn(e,t){if(e==null)return{};var n={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(t.indexOf(o)!==-1)continue;n[o]=e[o]}return n}function Pn(e,t){if(e==null)return{};var n,o,r=Cn(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Pe(e,t){var n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;return n.every(function(r){return Object.is(e[r],t[r])})}function Sn(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Pe,t=null;return function(n){if(t&&e(t.value,n))return t.value;return t={value:n},t.value}}var vr=["block"];function wn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,o)}return n}function En(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?wn(Object(n),!0).forEach(function(o){Aa(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wn(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function yr(e){return{x:(e.right+e.left)/2,y:(e.bottom+e.top)/2}}function dt(e){var{client:t,borderBox:n}=e,o=n.height/4;if(t.y<=n.top+o)return"reorder-above";if(t.y>=n.bottom-o)return"reorder-below";return"make-child"}function br(e){var{element:t,input:n,currentLevel:o,indentPerLevel:r,mode:a}=e,s={x:n.clientX,y:n.clientY},l=t.getBoundingClientRect();if(a==="standard"){var c=dt({borderBox:l,client:s});return{type:c,indentPerLevel:r,currentLevel:o}}var u=yr(l);if(a==="expanded"){var d=dt({borderBox:l,client:s});return{type:d==="reorder-above"?d:"make-child",indentPerLevel:r,currentLevel:o}}var p=r*o;if(s.x<l.left+p){if(s.y<u.y)return{type:"reorder-above",indentPerLevel:r,currentLevel:o};var g=(s.x-l.left)/r,P=Math.max(Math.floor(g),0);return{type:"reparent",desiredLevel:P,indentPerLevel:r,currentLevel:o}}return{type:dt({borderBox:l,client:s}),indentPerLevel:r,currentLevel:o}}function Tn(e,t){if(e.type!==t.type)return!1;if(e.type==="instruction-blocked"&&t.type==="instruction-blocked")return Tn(e.desired,t.desired);return Pe(e,t)}var xr=Sn(Tn);function Cr(e){var{desired:t,block:n}=e;if(n!==null&&n!==void 0&&n.includes(t.type)&&t.type!=="instruction-blocked"){var o={type:"instruction-blocked",desired:t};return o}return t}function xy(e,t){var n=t.block,o=Pn(t,vr),r=br(o),a=Cr({desired:r,block:n}),s=xr(a);return En(En({},e),{},Aa({},Se,s))}function sh(e){var t;return(t=e[Se])!==null&&t!==void 0?t:null}var Se=Symbol("tree-item-instruction");function ft(e){return T(e)&&i(e.$ref)?e.$ref:null}function we(e){if(e.source!=="npm"||!e.package)return null;return e.modulePath?`${e.package}/${e.modulePath}`:e.package}function Pr(e,t){let n=we(e);if(n)return n;return e.path?{$ref:Bc(t,e.path)}:null}function PC(e,t,n){let o=we(t);if(o)return e.some((a)=>i(a)&&(a===o||a===t.package));if(!t.path)return!1;let r=U(Bc(n,t.path));return e.some((a)=>{let s=ft(a);return s!==null&&U(s)===r})}function U(e){return e.replace(/^(?:\.\/)+/,"")}function Am(e,t,n){let o=Pr(t,n);if(!o)return[...e];let a=we(t)&&t.modulePath?e.filter((s)=>s!==t.package):[...e];return PC(a,t,n)?a:[...a,o]}function MC(e,t,n){let o=we(t);if(o)return e.filter((a)=>!(i(a)&&(a===o||a===t.package)));if(!t.path)return[...e];let r=U(Bc(n,t.path));return e.filter((a)=>{let s=ft(a);return s===null||U(s)!==r})}function TL(e,t){return e.filter((n)=>!i(n)||!(n===t||n.startsWith(`${t}/`)))}function LL(e,t){let n=U(t);return e.filter((o)=>{let r=ft(o);return r===null||U(r)!==n})}async function zx(e){df(!0);try{if(e.source==="npm"){if(!customElements.get(e.tagName))return mt(e.tagName)}else{if(e.path&&!e.path.endsWith(".json"))return mt(e.tagName);let n=O?.projectRoot,o=`${location.origin}/${n?`${n}/`:""}${e.path}`;await fg(o)}let t=document.createElement(e.tagName);for(let n of e.props||[])if(n.default!==void 0&&n.default!=="false"&&n.default!=="''"){let o=String(n.default).replaceAll(/^'|'$/g,"");t.setAttribute(n.name,o)}return t}catch(t){return console.warn("Component preview failed:",e.tagName,t),mt(e.tagName)}}function mt(e){let t=document.createElement("div");return t.style.cssText="padding:12px;border:1px dashed var(--border);border-radius:var(--radius);color:var(--fg-dim)",t.textContent=`<${e}>`,t}var Sr='[part="outline"]',ht='[part="row"]',wr='[part="verbs"]',Ee=null;function $L(){if(Ee!==null)cancelAnimationFrame(Ee);for(let e of tt.dndCleanups)e();tt.dndCleanups=[],Ee=requestAnimationFrame(()=>{Ee=null;let e=xh?.querySelector(Sr);if(!e)return;for(let n of e.querySelectorAll("[data-dnd-row]")){let o=n.dataset.value.split("/").map((c)=>/^\d+$/.test(c)?Math.trunc(Number(c)):c),r=Math.trunc(Number(n.dataset.dndDepth))||0,a=Object.hasOwn(n.dataset,"dndVoid"),s=Object.hasOwn(n.dataset,"dndExpanded"),l=Lo(Is({canDrag({element:c,input:u}){if(uv(u.clientX,u.clientY)?.closest(wr))return!1;return!0},element:n,getInitialData(){return{path:o,type:"tree-node"}},onGenerateDragPreview({nativeSetDragImage:c}){Hc({nativeSetDragImage:c})},onDragStart(){if(n.dataset.dragging="",tt.layerDragSourceHeight=n.offsetHeight,s)Er(n,e)},onDrop(){if(delete n.dataset.dragging,s)Bi("leftPanel")}}),ia({element:n,canDrop({source:c}){let u=c.data.path;if(Array.isArray(u)&&ul(u,o))return!1;return!0},getData({input:c,element:u}){return xy({path:o},{block:a?["make-child"]:[],currentLevel:r,element:u,indentPerLevel:16,input:c,mode:s?"expanded":"standard"})},onDragEnter({self:c}){Mn(n,c.data,e)},onDrag({self:c}){Mn(n,c.data,e)},onDrop(){re(e)}}));tt.dndCleanups.push(l)}let t=ra({onDrop({source:n,location:o}){re(e);let[r]=o.current.dropTargets;if(!r)return;let a=sh(r.data);if(!a||a.type==="instruction-blocked")return;let s=n.data,l=r.data.path;if(!Array.isArray(l))return;let c=s.type==="tree-node"&&n.element,u=c&&Object.hasOwn(c.dataset,"dndExpanded");if(Pm(h.value,a,s,l),u){let d=h.value,p=Oe(d?.session.selection);if(p)tt._layersCollapsed||=new Set,tt._layersCollapsed.add(p.join("/"))}},onDropTargetChange({location:n}){let[o]=n.current.dropTargets;if(o&&!sh(o.data))re(e)}});tt.dndCleanups.push(t)})}function RL(){requestAnimationFrame(()=>{let e=xh?.querySelector(".components-section");if(!e)return;for(let t of e.querySelectorAll("[data-component-tag]")){let n=t.dataset.componentTag;if(!n)continue;let o=ut.find((l)=>l.tagName===n);if(!o)continue;let r=t.querySelector(".element-card-preview");if(r&&!r.querySelector(n))zx(o).then((l)=>{r.textContent="",r.append(l)});let a=Vm(o),s=Is({element:t,getInitialData(){return{fragment:structuredClone(a),type:"block"}},onGenerateDragPreview({nativeSetDragImage:l}){Hc({nativeSetDragImage:l})}});tt.dndCleanups.push(s)}})}function IL(){requestAnimationFrame(()=>{let e=xh?.querySelector('[part="content"]');if(!e)return;for(let t of e.querySelectorAll("[data-block-tag]")){let n=t.dataset.blockTag,o=t.querySelector(".element-card-preview");if(o&&!o.firstChild){let s=document.createElement(ln.has(n)?"span":n);s.textContent=n,o.append(s)}let r=Fd(n),a=Is({element:t,getInitialData(){return{fragment:structuredClone(r),type:"block"}},onGenerateDragPreview({nativeSetDragImage:s}){Hc({nativeSetDragImage:s})}});tt.dndCleanups.push(a)}})}function Er(e,t){let n=`${e.dataset.value}/`,o=t.querySelectorAll(ht);for(let r of o)if(r.dataset.value?.startsWith(n))r.style.display="none"}function Mn(e,t,n){let o=sh(t);if(tt._currentDropTargetRow&&tt._currentDropTargetRow!==e)delete tt._currentDropTargetRow.dataset.drop;if(!o||o.type==="instruction-blocked"){re(n);return}if(o.type==="make-child"){re(n),e.dataset.drop="",tt._currentDropTargetRow=e;return}delete e.dataset.drop,tt._currentDropTargetRow=e;let r=[...n.querySelectorAll(ht)],a=r.indexOf(e),s=tt.layerDragSourceHeight;for(let[l,c]of r.entries()){if(c.dataset.dragging!==void 0)continue;if(o.type==="reorder-above")c.style.transform=l>=a?`translateY(${s}px)`:"";else c.style.transform=l>a?`translateY(${s}px)`:""}}function re(e){if(tt._currentDropTargetRow)delete tt._currentDropTargetRow.dataset.drop,tt._currentDropTargetRow=null;let t=e.querySelectorAll(ht);for(let n of t)n.style.transform="",n.style.display=""}function Nn(e,t,n){if(t==="make-child")return{index:Ur(ne(e,n)).length,parent:n};let o=Dt(n),r=ai(n);if(!o||!ee(r))return;if(t==="reorder-above")return{index:r,parent:o};if(t==="reorder-below")return{index:r+1,parent:o};return null}function Pm(e,t,n,o){if(!e)return;if(n.type==="tree-node"){let r=n.path,a=Nn(e.doc.document,t.type,o);if(a)Y(e,(s)=>Ql(s,r,a.parent,a.index))}else if(n.type==="block"){let r=Nn(e.doc.document,t.type,o);if(r===void 0)return;let a=n.fragment;if(r)Y(e,(l)=>Ir(l,r.parent,r.index,structuredClone(a)));let s=a.tagName;if(Ze(s).includes("-")){let l=ut.find((d)=>d.tagName===s),c=e.doc.document.$elements??[],u=l?Am(c,l,e.documentPath??null):c;if(u.length!==c.length)ta(e,(d)=>{d.$elements=u})}}}function On(e){let t={};for(let[n,o]of Object.entries(e?.nesting??{}))if(n!=="_root")t[n]=o?.inline===!0;for(let n of e?.inline??[])t[n]=!1;return t}function _(e){return JSON.parse(JSON.stringify(e))}var $e=new WeakMap,m=new Set,K=0,se=new Map,Vn=-1,Wn=0,Tr=600;function FC(e){return Vn===e&&Date.now()-Wn<=Tr}var Rn=0,Bn=new Set;function Mr(e,t){let n;try{n=new URL(e,t.iframe.src||zm())}catch{return}if(!["http:","https:","mailto:","tel:"].includes(n.protocol))return;let o=n.href,r=Ix();if(r){r(o);return}window.open(o,"_blank","noopener,noreferrer")}function jC(e){Bn.add(e)}function Nr(e){return Bn.delete(e)}var j=new Map,G=new Map,le=new Map,Or=300;function HC(e,t,n,o=Or){let r=null;for(let l of m){if(!l.iframe.isConnected){m.delete(l);continue}if(l.ready&&!l.stylebook&&e!==null&&l.tabId===e){r=l;break}}if(!r)return Promise.resolve(null);Rn+=1;let a=Rn,s=_(t);return r.channel.post({contextPath:n?[...n]:null,exprs:s,gen:r.lastRenderedGen,kind:"evalExpr",reqId:a}),new Promise((l)=>{let c=setTimeout(()=>{j.delete(a),G.delete(a),l(null)},o);G.set(a,r),j.set(a,(u)=>{clearTimeout(c),G.delete(a),l(u)})})}var An=0,Z=new Map,Ar=250;function BC(e,t=Ar){let n=[];for(let o of m){if(!o.iframe.isConnected){m.delete(o);continue}if(o.ready&&!o.stylebook&&e!==null&&o.tabId===e)n.push(o)}if(n.length===0)return Promise.resolve();return new Promise((o)=>{let r=n.length,a=setTimeout(()=>{for(let c of l)Z.delete(c),le.delete(c);o()},t),s=()=>{if(r-=1,r===0)clearTimeout(a),o()},l=[];for(let c of n){An+=1;let u=An;l.push(u),Z.set(u,s),le.set(u,c),c.channel.post({kind:"flushEdits",reqId:u})}})}function Ux(e){return $e.get(e)??null}function Mm(e){for(let t of m){if(!t.iframe.isConnected)continue;let n=Me(t.iframe);if(e.x>=n.left&&e.x<=n.right&&e.y>=n.top&&e.y<=n.bottom)return t}return null}function Fm(e,t,n){K+=1,se.set(K,n);let o=t.type==="tree-node"?{path:[...t.path],type:"tree-node"}:{type:t.type};return e.channel.post({dragSeq:K,gen:e.lastRenderedGen,kind:"dragStart",src:o}),K}function qx(){return K}function al(e){let t=Me(e.iframe),n=e.iframe.clientWidth>0?t.width/e.iframe.clientWidth:1;return{rect:t,scale:n}}function zn(e){if(e.stylebook)return"stylebook";return e.tabId??"unbound"}function VC(){let e=[];for(let t of m){if(!t.iframe.isConnected){m.delete(t);continue}let n=`canvas[${zn(t)}]`;if(!t.ready){e.push(`${n}: frame has not handshaked`);continue}let o=[...t.pendingTabIds.keys()];if(o.length>0)e.push(`${n}: gen ${o.join(", ")} unacked`);if(t.pendingPatches>0)e.push(`${n}: ${t.pendingPatches} unacked patch(es)`);if(t.pendingMeasures.size>0)e.push(`${n}: ${t.pendingMeasures.size} measure(s) in flight`);let{idle:r}=t;if(!r){e.push(`${n}: no quiescence report yet`);continue}if(r.gen!==t.lastRenderedGen)e.push(`${n}: quiescence is for gen ${r.gen}, DOM is gen ${t.lastRenderedGen}`);if(!r.fonts)e.push(`${n}: fonts still loading`);if(r.animations>0)e.push(`${n}: ${r.animations} running animation(s)`);if(r.images>0)e.push(`${n}: ${r.images} pending image retry(ies)`)}if(j.size>0)e.push(`canvas: ${j.size} expression eval(s) in flight`);return e}var Dr=500,kr=2,Hr=40;function Kn(){let e=h.value?.id??null,t=null;for(let n of m){if(!n.iframe.isConnected){m.delete(n);continue}if(!n.ready||n.stylebook)continue;if(n.tabId===e)return n;t??=n}return t}function Un(e,t){let{rect:n,scale:o}=al(e),r=n.left+t.x*o,a=n.top+t.y*o,s=t.width*o,l=t.height*o;return{height:l,left:r,top:a,width:s,x:r+s/2,y:a+l/2}}function ce(e,t){return new Promise((n)=>{e.selReqId+=1;let o=e.selReqId,r=setTimeout(()=>{e.pendingMeasures.delete(o),n(null)},Dr);e.pendingMeasures.set(o,(a)=>{clearTimeout(r);let[s]=a;n(s?Un(e,s.rect):null)}),e.channel.post({kind:"measure",paths:[[...t]],reqId:o})})}function WC(e){let t=Ux(e),n=t?.lastHover;if(!t||!n)return null;return{settle:async()=>(await ce(t,n.path))?.top??null,top:Un(t,n.rect).top}}function zC(e){let t=Kn();return t?ce(t,e):Promise.resolve(null)}function Jr(e){return new Promise((t)=>{let n=Number.NaN,o=0,r=0,a=()=>{let{top:s}=Me(e.iframe);if(o=s===n?o+1:0,n=s,r+=1,o>=kr||r>=Hr){t();return}requestAnimationFrame(a)};requestAnimationFrame(a)})}async function jm(e){let t=Kn();return t?HI(t,e):null}async function HI(e,t){let n=await ce(e,t);if(!n)return null;let o=q(e.canvasEl)?.surface;return vy({height:n.height,top:n.top},o),await Jr(e),ce(e,t)}function tD(e,t){let n=Ux(e);return n?ce(n,t):Promise.resolve(null)}function Lr(e){let t=e.canvasEl.parentElement;if(!t)return;let n=/scale\(([\d.]+)\)/.exec(e.canvasEl.style.transform),o=n?Number(n[1]):1;t.style.height=o===1?"":`${e.iframe.offsetHeight*o}px`}function Gn(e){if(e.preview){e.iframe.style.height="100%",e.iframe.style.minHeight="0px";return}if(e.contentHeight===null)return;e.iframe.style.height=`${e.contentHeight}px`,e.iframe.style.minHeight=e.contentFragment?"0px":"480px",Lr(e)}function xt(e,t){if(e.preview=t,e.overlay.setSuppressed(t),t)e.pendingEnterEdit=null;Gn(e)}function UC(e,t){xt(Pt(e),t)}function Jl(e,t){if(!e.iframe.isConnected)return;e.channel.post(t)}function _y(e){se.delete(e)}function Sy(e){e.overlay.setDropIndicator(null)}var Zn=null;function qC(e){Zn=e}var _r=300,Yn=null;function KC(e){Yn=e}var Ct=null;function GC(e){Ct=e}function jr(e,t,n){if((t?qr(t.tagName):!1)&&t){e.overlay.setDropIndicator(null),e.overlay.setReplaceTarget(I(t.rect));return}e.overlay.setReplaceTarget(null),e.overlay.setDropIndicator(n?I(n.referenceRect):null,n?.edge)}function In(e){e.overlay.setReplaceTarget(null),e.overlay.setDropIndicator(null)}function qr(e){return e==="img"||e==="video"||e==="source"}function Fr(e,t){if(e.dataset.jxGutterDrop==="1")return;e.dataset.jxGutterDrop="1",e.addEventListener("dragover",(n)=>{if(![...n.dataTransfer?.types??[]].includes("Files"))return;if(n.preventDefault(),n.dataTransfer)n.dataTransfer.dropEffect="copy"}),e.addEventListener("drop",(n)=>{let o=n.dataTransfer?.files,r=t();if(!o?.length||!r||r.stylebook)return;n.preventDefault(),Ct?.(M(r),[...o],null,null)})}var Re=null;function JC(e){Re=e}var Ae=null;function YC(e){Ae=e}var Xn=null;function ZC(e){Xn=e}function Dn(e,t){let n=[...t];for(;;){let o=e.get(Gl(n));if(o)return o;if(n.length<2)return null;n=n.slice(0,-2)}}var N=null;function XC(){let e=N;return Boolean(e?.editing&&e.iframe.isConnected)}var De=null;function QC(e){De=e}var bt=null;function e1(e){bt=e}var $n=null,eo=null;function t1(e){eo=e}function n1(e,t){for(let n of m){if(!n.iframe.isConnected){m.delete(n);continue}if(n.ready&&n.tabId===e.id&&!n.preview)n.popoverOpen=t,n.channel.post({kind:"setPopoverOpen",path:t})}}function i1(e,t){for(let n of m){if(!n.iframe.isConnected){m.delete(n);continue}if(n.ready&&n.tabId===e.id&&!n.preview)n.dialogOpen=t,n.channel.post({kind:"setDialogOpen",path:t})}}function Kx(e,t){let n=0;for(let o of m){if(!o.iframe.isConnected){m.delete(o);continue}if(o.ready&&o.tabId===t){let r=q(o.canvasEl)?.surface;if(!r){my("host-stage-unresolved");continue}let a=r.renderGeneration,s=ke?.host===o?ke.paths:void 0;Je(o),o.channel.post(s?{echoPaths:s,forwardOps:e,gen:a,kind:"patch"}:{forwardOps:e,gen:a,kind:"patch"}),o.pendingPatches+=1,n+=1}}return n}var ke=null,Wr=0;function kn(e,t,n){ke={host:e,paths:t};try{n()}finally{ke=null}}var gt=null,vt=null;function Br(e,t,n){return!e&&t===n}function zr(e,t){let n=M(e);if(!n)return;let o=ne(n.doc.document,t);if(!o)return;Kx([{key:"$props",op:"set-key",path:t,value:o.$props}],n.id)}function M(e){return e.tabId?b.tabs.get(e.tabId)??null:null}function r1(e){return M(e)}function Te(e){let t=q(e.canvasEl)?.surface.paneId;if(t)Ko(t)}var Kr=Object.freeze([]);function Gr(){let e=new Map;for(let t of b.panes){let n=t.activeTabId?b.tabs.get(t.activeTabId):null;if(!n)continue;let o=n.session.selection;o.map((r)=>r.join("/")).join("|"),e.set(n.id,o)}return e}function Zr(){if($n)return;let e=xe(!0);e.run(()=>{oe(()=>{let t=Gr();x.stylebook.selection;for(let n of m)Le(n,(n.tabId?t.get(n.tabId):null)??Kr)})}),$n={stop:()=>e.stop()}}function Je(e){if(!e.ready)return;let t=Gd();if(t===e.postedVersions)return;if(e.postedVersions===null&&Object.keys(t).length===0){e.postedVersions=t;return}e.postedVersions=t,e.channel.post({kind:"assetVersions",versions:t})}var Hn=!1,yt=!1;function Yr(){if(Hn)return;Hn=!0,xe(!0).run(()=>{oe(()=>{if(x1.value,yt)return;yt=!0,queueMicrotask(()=>{yt=!1,Xr()})})})}function Xr(){for(let e of m){if(!e.iframe.isConnected){m.delete(e);continue}Je(e)}}var Jn=!1,Ne=null;function Qr(){if(Jn)return;Jn=!0,xe(!0).run(()=>{oe(()=>{for(let t of b.panes){let n=t.activeTabId?b.tabs.get(t.activeTabId):null;if(!n)continue;let{peers:o}=Ln(n);o.map((r)=>JSON.stringify(r.state.structuralSelection??null)).join("|")}if(Ne)clearTimeout(Ne);Ne=setTimeout(()=>{Ne=null;for(let t of m)to(t)},100)})})}function to(e){if(e.stylebook||!e.ready||!e.iframe.isConnected)return;let t=M(e),n=t?Ln(t).peers:[];e.presenceMeta.clear();let o=[];for(let r of n){let{structuralSelection:a}=r.state;if(!a||r.state.focusedPath!==t?.documentPath)continue;for(let s of a){let l=[...s];o.push(l),e.presenceMeta.set(JSON.stringify(l),{color:r.state.user.color,label:r.state.user.name??r.state.user.login})}}if(o.length===0){e.presenceReqId=-1,e.overlay.setPresence([]);return}e.selReqId+=1,e.presenceReqId=e.selReqId,e.channel.post({kind:"measure",paths:o,reqId:e.presenceReqId})}function Le(e,t){if(e.stylebook){ei(e);return}let n=Oe(t);if(e.selectionPath=n,e.selectionPaths=t,!e.iframe.isConnected){m.delete(e);return}if(!n){e.coSelectionKeys.clear(),e.overlay.setSelection(null),e.overlay.setCoSelection([]);return}if(!e.ready)return;let o=Rs(t.slice(0,-1));e.coSelectionKeys=new Set(o.map((r)=>JSON.stringify(r))),e.selReqId+=1,e.channel.post({kind:"measure",paths:[[...n],...o],reqId:e.selReqId})}function ei(e){if(!e.iframe.isConnected){m.delete(e);return}let t=x.stylebook.selection,n=t?e.stylebook?.tagToCardPath.get(t):void 0;if(!t||!n){e.overlay.setSelection(null);return}if(!e.ready)return;e.selReqId+=1,e.channel.post({kind:"measure",paths:[[...n]],reqId:e.selReqId})}function _n(){return wv("../canvas.html")}var ti="about:blank";function no(e){e.channel.dispose();for(let[t,n]of j)if(G.get(t)===e)j.delete(t),G.delete(t),n(null);for(let[t,n]of Z)if(le.get(t)===e)Z.delete(t),le.delete(t),n();for(let[,t]of e.pendingMeasures)t([]);if(e.pendingMeasures.clear(),e.pendingTabIds.clear(),ue(e),N===e)N=null;e.overlay.root.remove(),e.iframe.remove(),$e.delete(e.canvasEl),m.delete(e)}function ni(){if(!Qe())return _n();let e=f();if(e.canvasUrl)return e.canvasUrl;return e.canvasUrlDeferred?ti:_n()}function Hm(e){let t=0;for(let n of new Set(m))if(e.contains(n.canvasEl))no(n),t+=1;return t}function Pt(e){let t=ni(),n=$e.get(e);if(n){if(n.canvasUrl===t)return n;no(n)}let o=location.origin,r=crypto.randomUUID(),a=new URL(t,location.href).origin,s=document.createElement("iframe");s.className="jx-canvas-iframe",s.title="Canvas — live page render",s.style.cssText="width:100%;min-height:480px;height:100%;border:0;display:block;background:#fff";let l=new URL(t,location.href);if(l.searchParams.set("token",r),location.protocol==="http:"||location.protocol==="https:")l.searchParams.set("parentOrigin",o);if(s.src=a===o?`${l.pathname}${l.search}`:l.href,!e.style.position)e.style.position="relative";let c=bn(document);e.replaceChildren(s,c.root),Fr(e,()=>Ux(e));let u=nn({acceptOrigin:a,source:window,target:{postMessage:(p,g)=>s.contentWindow?.postMessage(p,g)},targetOrigin:a,token:r}),d={canvasEl:e,canvasUrl:t,channel:u,contentFragment:!1,contentHeight:null,hiddenPaths:new Set,popoverOpen:null,dialogOpen:null,editing:!1,editingProp:null,iframe:s,insertHideTimer:null,insertHover:!1,coSelectionKeys:new Set,insertZone:null,lastRenderedGen:-1,lastHover:null,lastSelectionRect:null,lastSnapshotSeq:0,overlay:c,panReqId:-1,pending:null,postedVersions:null,idle:null,pendingEnterEdit:null,pendingMeasures:new Map,pendingPatches:0,pendingTabIds:new Map,presenceMeta:new Map,presenceReqId:-1,preview:!1,ready:!1,selectionPath:null,selectionPaths:[],selReqId:0,snapshot:null,stylebook:null,tabId:null};return c.insertButton.addEventListener("click",(p)=>ii(d,p)),c.insertButton.addEventListener("mouseenter",()=>{d.insertHover=!0,ue(d)}),c.insertButton.addEventListener("mouseleave",()=>{d.insertHover=!1,ro(d)}),u.onMessage((p)=>ci(d,p)),$e.set(e,d),m.add(d),Zr(),Qr(),Yr(),d}function oi(e,t){ue(e),e.insertZone=t,e.overlay.setInsertZone(I(t.rect),t.edge)}function oo(e){ue(e),e.insertZone=null,e.insertHover=!1,e.overlay.setInsertZone(null)}function ri(e){let t=e.overlay.insertButton;return e.insertHover||t.matches(":hover")}function ro(e){ue(e),e.insertHideTimer=setTimeout(()=>{if(e.insertHideTimer=null,ri(e))return;oo(e)},_r)}function ue(e){if(e.insertHideTimer!==null)clearTimeout(e.insertHideTimer),e.insertHideTimer=null}function ii(e,t){t.stopPropagation(),t.preventDefault();let n=e.insertZone;if(!n)return;Yn?.(e.overlay.insertButton,n)}var li=new Set(["contextMenu","dragOver","dropResult","editCommit","editCommitProp","editInput","editInsert","editMerge","editRangeReplace","editSplit","editStart","fileDragOver","fileDrop","hit","hover","insertZones","layoutHit","nativeDragEnter"]);function ci(e,t){if(e.preview&&li.has(t.kind))return;switch(t.kind){case"ready":{e.ready=!0;let n=St?.();if(n)e.channel.post({chords:n.chords,kind:"keymap",mac:n.mac});if(e.postedVersions=null,Je(e),e.pending)e.channel.post(e.pending),e.pending=null;Le(e,e.selectionPaths);return}case"paneFocus":{Te(e),bt?.();return}case"popoverTargetClick":{let n=M(e);if(!n||e.preview)return;let o=JSON.stringify(n.session.ui.openPopover)===JSON.stringify(t.targetPath),r=t.action==="show"||t.action==="toggle"&&!o;if(r||o)ae()?.run("canvas.setPopoverOpen",{open:r,path:t.targetPath});return}case"commandTargetClick":{let n=M(e);if(!n||e.preview)return;let o=(a)=>JSON.stringify(a)===JSON.stringify(t.targetPath),r=ne(n.doc.document,t.targetPath);if(!Qn(r))return;if(We.has(t.command)){if(!la(r))return;let a=t.command==="show-popover"||t.command==="toggle-popover"&&!o(n.session.ui.openPopover);if(a||o(n.session.ui.openPopover))ae()?.run("canvas.setPopoverOpen",{open:a,path:t.targetPath})}else if(Ve.has(t.command)){if(!J(r))return;let a=t.command==="show-modal";if(a||o(n.session.ui.openDialog))ae()?.run("canvas.setDialogOpen",{open:a,path:t.targetPath})}return}case"hit":{Te(e),bt?.(),y1(null);let n=null,o=q(e.canvasEl)?.panel;if(o?.mediaName&&!o.mediaName.startsWith("git-diff")){n=de(o.mediaName);let a=M(e);if(a)a.session.ui.activeMedia=n}if(Ae?.dismiss(),e.stylebook){let a=Dn(e.stylebook.pathToTag,t.hit.path);if(Xn?.(a,n),a){let s=I(t.hit.rect);e.overlay.setSelection(s,`<${a}>`),e.lastSelectionRect=s}else e.overlay.setSelection(null);return}e.selectionPath=t.hit.path,e.selectionPaths=[t.hit.path];let r=M(e);if(r)r.session.selection=t.additive?qy(r.session.selection,t.hit.path):[t.hit.path];{let a=I(t.hit.rect);e.overlay.setSelection(a),e.lastSelectionRect=a}return}case"layoutHit":{if(e.stylebook)return;Te(e),Ae?.dismiss(),y1(t.hit),e.selectionPath=null,e.selectionPaths=[];let n=M(e);if(n)n.session.selection=[];let o=I(t.hit.rect);e.overlay.setSelection(o,`LAYOUT · ${t.hit.layoutFile}`),e.lastSelectionRect=o,Bi("rightPanel");return}case"hover":{if(e.stylebook){let n=t.hit?Dn(e.stylebook.pathToTag,t.hit.path):null,o=x.stylebook.selection;if(t.hit&&n&&n!==o)e.overlay.setHover(I(t.hit.rect));else e.overlay.setHover(null);return}e.lastHover=t.hit,fi(e,t.hit);return}case"insertZones":{if(e.stylebook)return;let n=t.zones?.[0]??null;if(n)oi(e,n);else ro(e);return}case"geometry":{let n=e.pendingMeasures.get(t.reqId);if(n){e.pendingMeasures.delete(t.reqId),n(t.hits);return}if(t.reqId===e.presenceReqId){e.presenceReqId=-1;let o=[];for(let r of t.hits){let a=e.presenceMeta.get(JSON.stringify(r.path));if(a)o.push({...a,placement:I(r.rect)})}e.overlay.setPresence(o);return}if(t.reqId===e.panReqId){e.panReqId=-1;let[o]=t.hits;if(o){let{rect:r,scale:a}=al(e);vy({height:o.rect.height*a,top:o.rect.y*a+r.top})}return}if(t.reqId===e.selReqId){let o=JSON.stringify(e.selectionPath),r=[],a=null;if(e.stylebook){let[l]=t.hits;a=l?I(l.rect):null}else for(let l of t.hits){let c=JSON.stringify(l.path);if(c===o)a=I(l.rect);else if(e.coSelectionKeys.has(c))r.push(I(l.rect))}let s=e.stylebook?x.stylebook.selection:null;e.overlay.setSelection(a,s?`<${s}>`:null),e.overlay.setCoSelection(r),e.lastSelectionRect=a,e.hiddenPaths=new Set((t.hidden??[]).map((l)=>JSON.stringify(l)))}return}case"evalResult":{let n=j.get(t.reqId);if(!n)return;j.delete(t.reqId),G.delete(t.reqId),n(t.gen===e.lastRenderedGen?t.results:null);return}case"renderComplete":{if(e.pendingTabIds.has(t.gen))e.tabId=e.pendingTabIds.get(t.gen)??null;for(let n of e.pendingTabIds.keys())if(n<=t.gen)e.pendingTabIds.delete(n);jn(e,t.gen);return}case"patchComplete":{e.pendingPatches=Math.max(0,e.pendingPatches-1),jn(e,t.gen);return}case"idle":{e.idle={animations:t.animations,fonts:t.fonts,gen:t.gen,images:t.images};return}case"renderError":{e.pendingTabIds.delete(t.gen);let n=M(e);if(n)n.session.canvas.refreshing=!1,Bi("leftPanel");E.error("The page could not be rendered.",{detail:t.message,key:`canvas.render:${zn(e)}`,source:"Canvas"});return}case"dataScope":{if(t.gen!==e.lastRenderedGen)return;let n=M(e);if(n)n.session.canvas.scope=t.scope,n.session.canvas.refreshing=!1;Bi("leftPanel");return}case"contentHeight":{e.contentHeight=t.height,e.contentFragment=t.fragment,Gn(e);return}case"dragOver":{if(t.dragSeq!==K)return;if(t.cursor)Vn=t.dragSeq,Wn=Date.now();if(t.gen!==e.lastRenderedGen)return;if(t.preview)e.overlay.setDropIndicator(I(t.preview.referenceRect),t.preview.edge);else e.overlay.setDropIndicator(null);if(t.cursor){let n=al(e);Wx(t.cursor.x*n.scale+n.rect.left,t.cursor.y*n.scale+n.rect.top)}return}case"nativeDragEnter":{if(e.stylebook)return;Zn?.(e);return}case"dragEnd":{e.overlay.setDropIndicator(null),Hd(),se.delete(t.dragSeq);return}case"dropResult":{if(t.dragSeq!==K||t.gen!==e.lastRenderedGen)return;if(t.instruction&&t.targetPath){let n=se.get(t.dragSeq);if(n)Pm(M(e),{type:t.instruction},n,t.targetPath)}se.delete(t.dragSeq),e.overlay.setDropIndicator(null),Hd();return}case"fileDragOver":{if(e.stylebook)return;jr(e,t.hit,t.preview);return}case"fileDragLeave":{In(e);return}case"fileDrop":{if(In(e),e.stylebook)return;Ct?.(M(e),t.files,t.hit,t.preview);return}case"patchError":{e.pendingPatches=Math.max(0,e.pendingPatches-1);let n=q(e.canvasEl)?.surface;if(n)eo?.(n.paneId);return}case"forwardKey":{pi(t.event);return}case"forwardWheel":{di(e,t);return}case"editStart":{if(N&&N!==e)N.editing=!1,N.editingProp=null,N.snapshot=null;if(N=e,t.prop!==void 0&&vt===Gl(t.path))ie(e,t.path,void 0,t.prop);vt=null,Wr+=1,e.editing=!0,e.editingProp=t.prop??null,e.snapshot=null,e.lastSnapshotSeq=0,De?.();return}case"selectionChanged":{if(t.seq<=e.lastSnapshotSeq)return;if(e.lastSnapshotSeq=t.seq,e.snapshot=t,!e.editing)e.editing=!0,N=e;De?.();return}case"flushComplete":{let n=Z.get(t.reqId);if(n)Z.delete(t.reqId),le.delete(t.reqId),n();return}case"editInput":{let n=M(e);if(n)n.doc.dirty=!0;return}case"editCommit":{let n=()=>pn(M(e),t.path,t.children,t.textContent);if(t.inPlace)kn(e,[t.path],n);else n();return}case"editCommitProp":{let n=()=>fn(M(e),t.path,t.prop,t.value);if(t.inPlace){kn(e,[t.path],n),gt=Gl(t.path);return}let o=n();if(Br(o,gt,Gl(t.path)))zr(e,t.path);gt=null,vt=o?Gl(t.path):null;return}case"editMerge":{let n=mn(M(e),t.fromPath,t.intoPath);if(n)ie(e,n.path,n.offset);return}case"editRangeReplace":{let n=yn(M(e),t.from,t.to,t.between,t.text);if(n)ie(e,n.path,n.offset);return}case"editSplit":{ie(e,gn(M(e),t.path,t.before,t.after));return}case"editInsert":{ie(e,vn(M(e),t.path,t.cmd,t.commitData));return}case"slashShow":{let{rect:n,scale:o}=al(e),r=t.rect.x*o+n.left,a=t.rect.y*o+n.top,s={filter:t.filter,onDismiss:()=>e.channel.post({kind:"slashDismissed"}),onSelect:(l)=>e.channel.post({cmd:{...l},kind:"slashSelect"}),rect:{bottom:a+t.rect.height*o,height:t.rect.height*o,left:r,top:a,width:t.rect.width*o}};if(t.showFilter===!0)s.showFilter=!0;Re?.show(s);return}case"slashNav":{Re?.nav(t.key);return}case"slashDismiss":{Re?.dismiss();return}case"previewNavigate":{Mr(t.href,e);return}case"contextMenu":{if(e.stylebook)return;Te(e);let{rect:n,scale:o}=al(e);Ae?.show({clientX:t.x*o+n.left,clientY:t.y*o+n.top,path:t.path?[...t.path]:null});return}case"editEnd":{if(!e.editing)return;if(e.editing=!1,e.editingProp=null,e.snapshot=null,N===e)N=null;De?.();break}default:break}}function jn(e,t){if(e.lastRenderedGen=t,Le(e,e.selectionPaths),to(e),oo(e),e.pendingEnterEdit&&t>=e.pendingEnterEdit.minGen){let{offset:n,path:o,prop:r}=e.pendingEnterEdit;if(e.pendingEnterEdit=null,e.tabId!==null&&e.tabId===Om(e.canvasEl)?.id)ui(e,o,n,r)}}function ie(e,t,n,o){let r={minGen:e.lastRenderedGen,path:[...t]};if(n!==void 0)r.offset=n;if(o!==void 0)r.prop=o;e.pendingEnterEdit=r}function ui(e,t,n,o){let r={kind:"enterEdit",path:[...t]};if(n!==void 0)r.offset=n;if(o!==void 0)r.prop=o;e.channel.post(r)}function di(e,t){let{rect:n,scale:o}=al(e),r=rc(e.canvasEl)?.wrap;if(!r)return;r.dispatchEvent(new WheelEvent("wheel",{bubbles:!0,cancelable:!0,clientX:n.left+t.x*o,clientY:n.top+t.y*o,ctrlKey:t.ctrlKey,deltaX:t.deltaX,deltaY:t.deltaY,metaKey:t.metaKey,shiftKey:t.shiftKey}))}function pi(e){document.dispatchEvent(new KeyboardEvent("keydown",{altKey:e.altKey,bubbles:!0,cancelable:!0,code:e.code,ctrlKey:e.ctrlKey,key:e.key,metaKey:e.metaKey,shiftKey:e.shiftKey}))}function fi(e,t){if(!t||ao(t.path,e.selectionPath)){e.overlay.setHover(null);return}e.overlay.setHover(I(t.rect))}var mi=4,z=new Map;function hi(e){let t=z.get(e);if(t)return z.delete(e),z.set(e,t),t;let n=new Map;z.set(e,n);for(let o of z.keys()){if(z.size<=mi)break;z.delete(o)}return n}function vi(e,t,n,o,r,a=null){let s=hi(e),l=o?.id??null,c=s.get(t);if(c&&c.tabId===n&&c.viewTabId===l&&c.mode===a)return c.payload;let u=Nr(r),d=Ox(Tt,async()=>{Rr.renderPreparations+=1;let p=await sn(t,o,a),g=_(p.renderDoc),P=_(t),A=n?b.tabs.get(n)??null:null,k=Li(A?.doc.sourceFormat)?.studio?.elements,v=k?On(k):void 0,y={assets:p.assets,doc:g,docBase:p.docBase??`${zm()}/`,mapperCtx:p.mapperCtx,mode:p.mapperCtx.canvasMode,shadowDoc:P,siteStyle:p.siteStyle};if(v)y.editableTags=v;if(u)y.allowAutoRequests=!0;return y});return s.set(t,{mode:a,payload:d,tabId:n,viewTabId:l}),d}async function o1(e,t,n,o,r=null,a=Om(n),s=null,l=null){let c=Pt(n);c.pendingTabIds.set(e,r),c.stylebook=null,c.iframe.style.width=o?`${o}px`:"100%";let d={...await vi(e,t,r,a,py(n),s),colorScheme:so(a),gen:e,kind:"render",popoverOpen:a?.session.ui.openPopover??null,dialogOpen:a?.session.ui.openDialog??null};if(l)d.diffMarks=l;c.popoverOpen=d.popoverOpen??null,c.dialogOpen=d.dialogOpen??null,xt(c,d.mode==="preview"),io(c,d)}function io(e,t){if(Rr.hostRenderPosts+=1,e.ready)Je(e),e.channel.post(t);else e.pending=t}function s1(e,t,n,o){let r=Pt(n);r.pendingTabIds.set(e,null),r.stylebook={pathToTag:t.pathToTag,tagToCardPath:t.tagToCardPath},xt(r,!1),r.pendingEnterEdit=null,r.iframe.style.width=o?`${o}px`:"100%";let a=_(t.doc),s=_(t.doc),l={assets:null,colorScheme:so(Om(n)),doc:a,docBase:`${zm()}/`,gen:e,kind:"render",mapperCtx:{arrayPaths:[],canvasMode:"stylebook",layoutWrapped:!1,pageContentOffset:null,pageContentPrefix:null},mode:"stylebook",shadowDoc:s,siteStyle:null};io(r,l)}function so(e){let t=e?.session.ui.previewColorScheme;return t==="light"||t==="dark"?t:null}function a1(e,t){for(let n of m){if(!n.iframe.isConnected){m.delete(n);continue}if(t&&!t.contains(n.iframe))continue;if(n.ready)n.channel.post({kind:"setColorScheme",scheme:e})}}function l1(e,t){let n=e$(e);for(let o of m){if(!o.iframe.isConnected){m.delete(o);continue}if(t&&!t.contains(o.iframe))continue;if(o.ready)o.channel.post({dir:n,kind:"setLocale",locale:e})}}function c1(e,t){let n=_(e),o=0;for(let r of m){if(!r.iframe.isConnected){m.delete(r);continue}if(r.ready)r.channel.post({base:t,doc:n,kind:"redefineElement"}),o+=1}return o}function d1(){let e=O?.projectConfig;if(!e)return;let t=_(e.style??null),n=_(e.$media??{});for(let o of m){if(!o.iframe.isConnected){m.delete(o);continue}if(o.ready&&!o.stylebook)o.channel.post({kind:"siteStyleUpdate",media:n,siteStyle:t})}}function Cy(e){let t=0,n=_(e);for(let o of m){if(!o.iframe.isConnected){m.delete(o);continue}if(o.ready&&o.stylebook)o.channel.post({gen:o.lastRenderedGen,kind:"styleUpdate",style:n}),t+=1,Le(o,o.selectionPaths)}return t}function u1(e){let t=lo();if(!t?.stylebook||!t.ready)return;let n=t.stylebook.tagToCardPath.get(e);if(!n)return;t.selReqId+=1,t.panReqId=t.selReqId,t.channel.post({kind:"measure",paths:[[...n]],reqId:t.selReqId})}function ll(){let e=N;if(!e||!e.iframe.isConnected)return{editing:!1,editingProp:null,snapshot:null};return{editing:e.editing,editingProp:e.editingProp,snapshot:e.snapshot}}var St=null;function h1(e,t){St=e,t?.(()=>Fn()),Fn()}function Fn(){let e=St?.();if(!e)return;for(let t of m){if(!t.iframe.isConnected){m.delete(t);continue}if(t.ready)t.channel.post({chords:e.chords,kind:"keymap",mac:e.mac})}}function Bd(e){let t=N;if(!t||!t.ready)return;t.channel.post({intent:e,kind:"applyFormat"})}function p1(){let e=N;if(!e||!e.ready)return;e.channel.post({kind:"openSlash"})}function ky(){let e=N;if(e?.editing&&e.ready&&e.iframe.isConnected)e.channel.post({kind:"endEdit"})}function lo(){let e=$t();return e?Ux(e.canvas):null}function Gx(){let e=N,t=e??lo();if(!t)return null;let{rect:n,scale:o}=al(t);if(t.lastSelectionRect)return{height:t.lastSelectionRect.height*o,left:t.lastSelectionRect.left*o+n.left,top:t.lastSelectionRect.top*o+n.top,width:t.lastSelectionRect.width*o};let r=t===e?t.snapshot?.rect:null;if(r)return{height:r.height*o,left:r.x*o+n.left,top:r.y*o+n.top,width:r.width*o};return null}
|
|
2
|
-
export{So,pt,Co,Rx,ql,$r,nh,py,Om,iL,Ix,rL,fy,Kl,oL,sL,aL,Dx,lL,TC,cL,dL,Rr,my,Nx,Ox,ki,Fd,uL,Gl,Ax,Np,hL,Px,pL,gy,fL,by,ih,ko,mL,Op,gL,bL,Mx,yL,Fx,vL,jx,LC,$C,Hx,Ap,rh,wL,xL,yy,Es,jd,oh,_L,SL,Bx,RC,Pp,Vx,CL,vy,IC,kL,DC,NC,OC,EL,wy,AC,Wx,Hd,Hc,xy,sh,PC,Am,MC,TL,LL,zx,$L,RL,IL,Pm,FC,jC,HC,BC,Ux,Mm,Fm,qx,al,VC,WC,zC,jm,HI,tD,UC,Jl,_y,Sy,qC,KC,GC,JC,YC,ZC,XC,QC,e1,t1,n1,i1,Kx,r1,Hm,o1,s1,a1,l1,c1,d1,Cy,u1,ll,h1,Bd,p1,ky,Gx};
|
|
3
|
-
|
|
4
|
-
//# debugId=FC13750807F882C764756E2164756E21
|
|
5
|
-
//# sourceMappingURL=studio-se2r3ptc.js.map
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{Xt,Li,rn,Go,sa}from"./studio-nwfrc98n.js";import{xe,oe,v,E}from"./studio-wz73q5kq.js";import{Ei,Y,ec,ct,Ti,gi,Ie,Na,pr,qe,Gp,tc,nv,b,h,bi}from"./studio-24mccdrj.js";import{cc}from"./studio-d81xfh1g.js";import{re}from"./studio-j1kvhdjk.js";import{ae}from"./studio-v8aga3vp.js";import{gx,Gu,Dd,Ju}from"./studio-zq4z6tm6.js";import{sr,I,A}from"./studio-2jbs3rxv.js";import{Ac,Zb,Yu,Cm,ST,sC}from"./studio-2hcbccfv.js";import{io}from"./studio-ynn90f58.js";import{kT}from"./studio-er30bpcx.js";import{sx,zb,Ea,YS,lT}from"./studio-8qm0ep50.js";import{O}from"./studio-c7q0t9x1.js";import{Te}from"./studio-y21g8zzg.js";import{i,w}from"./studio-cffqvnzd.js";import{we}from"./studio-a3g98wjr.js";var ix=["string","number","boolean","array","object","reference"],rx=["","image","date","color"],Ic={format:"",name:"",required:!1,type:"string"};function vm(e){if(e.$ref)return"reference";return e.type||"string"}function Dc(e){if(e.type==="array"&&e.items?.format)return e.items.format;return e.format||""}function Zs(e,r){switch(e){case"number":return{type:"number"};case"boolean":return{type:"boolean"};case"array":return r?{items:{format:r,type:"string"},type:"array"}:{items:{type:"string"},type:"array"};case"object":return{properties:{},required:[],type:"object"};case"reference":return{$ref:"#/content/"};default:return r?{format:r,type:"string"}:{type:"string"}}}var U={$schema:"https://jxsuite.com/schema/v1",$id:"StudioSchemaBuilder",$description:'The `schema-builder` form control (specs/extensions.md §9.1): the visual editor for a JSON Schema object, drawn as one card per property. A descriptor names it with `"ui": { "<prop>": { "control": "schema-builder" } }`, and `ui/schema-form.ts` mounts it into the empty host its own document announces for that field. The adapter (`surfaces/schema-builder.ts`) hands in the fields already classified and every draft the reader is part-way through typing; `ui/form-controls.ts` decides what a field may be renamed to and what reaches the host\'s `onChange`. Nothing here reads a schema: a document that re-derived a field\'s type while drawing would be a second opinion about what one module already owns. **The card is `surfaces/settings-defs.json`\'s, part for part.** Data Shapes edits the project\'s `$defs` and this edits a content type\'s `schema`; they are the same object with the same six controls per row, so the row vocabulary — `card`, `field-row`, `field-label`, `field-name`, `field-type`, `field-format`, `field-required`, `field-delete`, `nested`, `nested-card`, `nested-add-name`/`-type`/`-button`, `ref-target`, `add-form` — is ONE vocabulary, and the row views it is drawn from are that surface\'s own types rather than a second declaration of them. What differs is only what encloses it: Data Shapes carries the two-column chrome that chooses WHICH shape is being edited, and this one is handed the object to edit.',tagName:"div",attributes:{part:"builder"},style:{$description:"What `.schema-builder`, `.schema-field-list`, `.schema-field-card`, `.schema-field-row`, `.schema-field-nested`, `.schema-field-name-input`, `.schema-nested-add`, `.schema-nested-add-name` and `.schema-add-field` said in `styles/overlays.css`, keyed on `part` and re-pointed at the studio token layer — the same translation `surfaces/settings-defs.json` carries, because it is the same card. Two values could not come with them. `.schema-field-card--nested` read `var(--spectrum-gray-300, #444)`, and the caption was an `sp-field-label` at whatever size Spectrum drew it; a document is mounted in the pane rather than inside `<sp-theme>`, so both would have taken their hard-coded fallback every time. The nested card takes the studio layer's `--border`, and the caption says what it is in the type ramp instead.",display:"block",'& [part="fields"]':{display:"flex",flexDirection:"column",gap:"4px",marginBottom:"12px"},'& [part="card"], & [part="nested-card"]':{border:"1px solid var(--border)",borderRadius:"var(--radius)",padding:"6px 10px"},'& [part="field-row"]':{display:"flex",alignItems:"center",gap:"8px"},'& [part="field-label"]':{$description:"The field's name in words: a caption on the row rather than a label for a control, since the raw key beside it is what the reader edits and what carries the accessible name.",flex:"none",minWidth:"84px",fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)",overflowWrap:"anywhere"},'& [part="field-name"]':{flex:"1",maxWidth:"140px"},'& [part="nested"]':{marginLeft:"16px",marginTop:"6px",paddingLeft:"8px",borderLeft:"2px solid var(--border)",display:"flex",flexDirection:"column",gap:"4px"},'& [part="ref-target"]':{display:"flex",marginTop:"6px",maxWidth:"220px"},'& [part="nested-add"]':{display:"flex",alignItems:"center",gap:"6px",padding:"4px 0"},'& [part="nested-add-name"]':{flex:"1",maxWidth:"120px"},'& [part="add-form"]':{display:"flex",alignItems:"center",gap:"8px",padding:"8px 0"}},children:[{tagName:"div",attributes:{part:"fields"},children:[{$prototype:"Array",items:{$ref:"#/state/fields"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"card","data-field":"${$map.item.key}"},children:[{tagName:"div",attributes:{part:"field-row"},children:[{tagName:"span",attributes:{part:"field-label"},textContent:"${$map.item.label}"},{tagName:"jx-textfield",attributes:{part:"field-name"},$props:{label:"Name for ${$map.item.label}",size:"sm",value:{$ref:"$map/item/name"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/renameField"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},{tagName:"jx-select",attributes:{part:"field-type"},$props:{label:"Type for ${$map.item.label}",size:"sm",options:{$ref:"#/state/typeOptions"},value:{$ref:"$map/item/type"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setType"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},{tagName:"div",attributes:{part:"format-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasFormat"},cases:{true:{tagName:"jx-select",attributes:{part:"field-format"},$props:{label:"Format for ${$map.item.label}",size:"sm",options:{$ref:"#/state/formatOptions"},value:{$ref:"$map/item/format"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setFormat"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}}}},{tagName:"jx-switch",$description:"Whether the object requires this field. The word on screen is the name: `Req` is slotted rather than passed as `label`, because the kit's switch wraps its control in the label the slot lands in, and a second name would be announced over the top of it. Which row it belongs to is the tooltip's job instead, which is what `hint` is.",attributes:{part:"field-required"},$props:{hint:"Require ${$map.item.label}",size:"sm",checked:{$ref:"$map/item/required"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setRequired"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/checked"}]}]},children:[{tagName:"span",textContent:"Req"}]},{tagName:"jx-action-button",attributes:{part:"field-delete"},$props:{label:"Delete ${$map.item.label}",hint:"Delete ${$map.item.label}",icon:"trash",quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/removeField"},value:[{$ref:"$map/item/key"}]}]}}]},{tagName:"div",attributes:{part:"extra-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/extra"},cases:{reference:{tagName:"div",attributes:{part:"ref-target"},children:[{tagName:"jx-select",attributes:{part:"ref-target-select"},$props:{label:"Target for ${$map.item.label}",size:"sm",options:{$ref:"#/state/targets"},value:{$ref:"$map/item/refTarget"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setTarget"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}}]},nested:{tagName:"div",attributes:{part:"nested"},children:[{$prototype:"Array",items:{$ref:"$map/item/children"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"nested-card","data-nested":"${$map.item.key}"},children:[{tagName:"div",attributes:{part:"field-row"},children:[{tagName:"jx-textfield",attributes:{part:"field-name"},$props:{label:"Name for ${$map.item.parent}.${$map.item.key}",size:"sm",value:{$ref:"$map/item/name"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/renameNested"},value:[{$ref:"$map/item/parent"},{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},{tagName:"jx-select",attributes:{part:"field-type"},$props:{label:"Type for ${$map.item.parent}.${$map.item.key}",size:"sm",options:{$ref:"#/state/typeOptions"},value:{$ref:"$map/item/type"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setNestedType"},value:[{$ref:"$map/item/parent"},{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},{tagName:"div",attributes:{part:"format-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasFormat"},cases:{true:{tagName:"jx-select",attributes:{part:"field-format"},$props:{label:"Format for ${$map.item.parent}.${$map.item.key}",size:"sm",options:{$ref:"#/state/formatOptions"},value:{$ref:"$map/item/format"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setNestedFormat"},value:[{$ref:"$map/item/parent"},{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}}}},{tagName:"jx-switch",attributes:{part:"field-required"},$props:{hint:"Require ${$map.item.parent}.${$map.item.key}",size:"sm",checked:{$ref:"$map/item/required"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setNestedRequired"},value:[{$ref:"$map/item/parent"},{$ref:"$map/item/key"},{$ref:"event#/target/checked"}]}]},children:[{tagName:"span",textContent:"Req"}]},{tagName:"jx-action-button",attributes:{part:"field-delete"},$props:{label:"Delete ${$map.item.parent}.${$map.item.key}",hint:"Delete ${$map.item.parent}.${$map.item.key}",icon:"trash",quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/removeNested"},value:[{$ref:"$map/item/parent"},{$ref:"$map/item/key"}]}]}}]}]}},{tagName:"div",attributes:{part:"nested-add"},children:[{tagName:"jx-textfield",attributes:{part:"nested-add-name"},$props:{label:"New field in ${$map.item.label}",placeholder:"field name",size:"sm",value:{$ref:"$map/item/draftName"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editDraftName"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{Enter:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/addNested"},value:[{$ref:"$map/item/key"}]}]}}]}},{tagName:"jx-select",attributes:{part:"nested-add-type"},$props:{label:"Type of the new field in ${$map.item.label}",size:"sm",options:{$ref:"#/state/typeOptions"},value:{$ref:"$map/item/draftType"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editDraftType"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},{tagName:"jx-action-button",attributes:{part:"nested-add-button"},$props:{label:"Add a field to ${$map.item.label}",hint:"Add a field to ${$map.item.label}",icon:"plus",quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/addNested"},value:[{$ref:"$map/item/key"}]}]}}]}]}}}]}}]},{tagName:"div",attributes:{part:"add-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/addState"},cases:{closed:{tagName:"jx-action-button",attributes:{part:"add-open"},$props:{label:"Add Field",icon:"plus",quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openAdd"},value:[]}]},children:[{tagName:"span",textContent:"Add Field"}]},open:{tagName:"div",attributes:{part:"add-form"},children:[{tagName:"jx-textfield",attributes:{part:"add-name"},$props:{label:"New field name",placeholder:"Field name",size:"sm",value:{$ref:"#/state/addName"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editAddName"},value:[{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{Enter:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/confirmAdd"},value:[]}],Escape:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/cancelAdd"},value:[]}]}}]}},{tagName:"jx-select",attributes:{part:"add-type"},$props:{label:"Type of the new field",size:"sm",options:{$ref:"#/state/typeOptions"},value:{$ref:"#/state/addType"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editAddType"},value:[{$ref:"event#/target/value"}]}]}},{tagName:"div",attributes:{part:"add-format-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/addHasFormat"},cases:{true:{tagName:"jx-select",attributes:{part:"add-format"},$props:{label:"Format of the new field",size:"sm",options:{$ref:"#/state/formatOptions"},value:{$ref:"#/state/addFormat"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editAddFormat"},value:[{$ref:"event#/target/value"}]}]}}}},{tagName:"jx-switch",attributes:{part:"add-required"},$props:{hint:"Require the new field",size:"sm",checked:{$ref:"#/state/addRequired"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editAddRequired"},value:[{$ref:"event#/target/checked"}]}]},children:[{tagName:"span",textContent:"Required"}]},{tagName:"jx-button",attributes:{part:"add-confirm"},$props:{size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/confirmAdd"},value:[]}]},children:[{tagName:"span",textContent:"Add"}]},{tagName:"jx-button",attributes:{part:"add-cancel"},$props:{size:"sm",quiet:!0},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/cancelAdd"},value:[]}]},children:[{tagName:"span",textContent:"Cancel"}]}]}}}]};I("schema-builder",U);function ge(){return{addFormat:"",addHasFormat:!0,addName:"",addRequired:!1,addState:"closed",addType:"string",fields:[],formatOptions:[],targets:[],typeOptions:[]}}function K(e,r){e.textContent="";let t=v({...ge(),...r}),a=null,n=!0,s=!1,c=()=>A("schema-builder",t,e).then((d)=>{let y=d.root;if(n=!1,s)return d.dispose(),y;return a=d,y}),m=c();return{dispose(){s=!0,a?.dispose(),a=null,e.textContent=""},host:e,ready:m,update(d){if(t.addFormat=d.addFormat,t.addHasFormat=d.addHasFormat,t.addName=d.addName,t.addRequired=d.addRequired,t.addState=d.addState,t.addType=d.addType,t.fields=d.fields,t.formatOptions=d.formatOptions,t.targets=d.targets,t.typeOptions=d.typeOptions,s||n||a!==null&&e.contains(a.root))return;a?.dispose(),a=null,n=!0,e.textContent="",c()}}}var G={$schema:"https://jxsuite.com/schema/v1",$id:"StudioReferenceField",$description:'The `reference` form control — site-architecture.md §6.1\'s `{ "$ref": "#/content/x" }` and site-architecture.md §7.4\'s entry picker. Registered once and dispatched to by `ui/schema-form.ts` for any property whose `$ref` names a collection, so the settings forms, the entry editor and an array-of-objects cell all draw the same control without any of them knowing it exists. `ui/form-controls.ts` decides which of the three states the field is in and what each gesture commits; nothing here reads a schema or lists a directory. The three states are drawn as three different controls on purpose: a picker while the entries are known, a TEXT field while they are not — a failed read leaves the value editable with the reason beside it, because swapping it for an empty dropdown would present "no entries" and "could not find out" as the same screen — and a disabled picker saying so while the read is in flight.',tagName:"div",attributes:{part:"reference",role:"none"},style:{$description:"The five `.reference-*` rules from `styles/inspector.css`, keyed on `part` and re-pointed at the studio token layer. Two values could not come with them. The note read `var(--spectrum-font-size-50, 11px)`, which resolves only inside `<sp-theme>` — this document is mounted in a settings pane, an entry editor or a frontmatter card, all outside that element, so it would silently have taken its hard-coded fallback every time. And `.reference-missing` coloured ONE row of the dropdown red; the kit's select offers a row a face, a swatch and a border style but no tone, so the dangling entry says what it is in words (\"— not found\") and the colour is not replaced by a second channel. The 6px gap comes onto the kit's spacing scale.",display:"flex",flex:"1",minWidth:"0",alignItems:"center",gap:"var(--jx-space-2)",'& [part="picker"], & [part="text"]':{flex:"1",minWidth:"0"},'& [part="note"]':{margin:"0",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)",lineHeight:"1.4"},'& [part="note"][data-tone="danger"]':{$description:"A listing that failed is a FAULT rather than a fact about the project, and the two notes this control draws are otherwise the same sentence in the same place.",color:"var(--danger)"},'& [part="retry"]':{flex:"none"}},children:[{tagName:"div",attributes:{part:"control-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/kind"},cases:{picker:{$description:"The collection's entries. The empty row is `\"\"` rather than a sentinel, because the kit's select treats the empty string as a legal value a reader can arrow to; a dangling reference is kept in the list and marked, since blanking the field would delete the evidence and the value in one repaint. While the read is in flight the same control is disabled and offers one row saying so.",tagName:"jx-select",attributes:{part:"picker"},$props:{size:"sm",label:{$ref:"#/state/label"},options:{$ref:"#/state/options"},value:{$ref:"#/state/value"},disabled:{$ref:"#/state/disabled"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/choose"},value:[{$ref:"event#/target/value"}]}]}},text:{$description:"The id as the string it is: what a reader gets when the choices could not be listed, and when the control was named by a `ui.control` override on a property that references nothing. Refusing to draw anything would lose the value that is already there.",tagName:"jx-textfield",attributes:{part:"text"},$props:{size:"sm",label:{$ref:"#/state/label"},value:{$ref:"#/state/value"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/edit"},value:[{$ref:"event#/target/value"}]}]}}}},{tagName:"div",attributes:{part:"note-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasNote"},cases:{true:{tagName:"p",attributes:{part:"note","data-tone":"${state.noteTone}",role:"status"},textContent:"${state.note}"}}},{tagName:"div",attributes:{part:"retry-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/canRetry"},cases:{true:{$description:"Offered only where there is something to try again — a listing that failed. It used to be offered only where the HOST passed a repaint hook, because a template control cannot draw a second frame of its own and a button that cannot do the thing it is named after is worse than its absence. A mounted control redraws itself, so the condition is now the failure rather than the host.",tagName:"jx-action-button",attributes:{part:"retry"},$props:{size:"sm",quiet:!0,label:"Retry listing entries"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/retry"},value:[]}]},children:[{tagName:"span",textContent:"Retry"}]}}}]};I("reference-field",G);function be(){return{canRetry:!1,disabled:!0,hasNote:!1,kind:"picker",label:"",note:"",noteTone:"dim",options:[],value:""}}function X(e,r){e.textContent="";let t=v({...be(),...r}),a=null,n=!0,s=!1,c=()=>A("reference-field",t,e).then((d)=>{let y=d.root;if(n=!1,s)return d.dispose(),y;return a=d,y}),m=c();return{dispose(){s=!0,a?.dispose(),a=null,e.textContent=""},host:e,ready:m,update(d){if(t.canRetry=d.canRetry,t.disabled=d.disabled,t.hasNote=d.hasNote,t.kind=d.kind,t.label=d.label,t.note=d.note,t.noteTone=d.noteTone,t.options=d.options,t.value=d.value,s||n||a!==null&&e.contains(a.root))return;a?.dispose(),a=null,n=!0,e.textContent="",c()}}}var Q={$schema:"https://jxsuite.com/schema/v1",$id:"StudioSecretField",$description:'The `secret` form control (specs/extensions.md §9.1, §13): one password field whose VALUE goes to the platform\'s secret store and never to project.json. A descriptor names it with `"ui": { "<field>": { "control": "secret" } }`, and `ui/schema-form.ts` mounts it into the empty host its own document announces for that field. **A surface never renders back the secret it describes, and this document is where that is visible rather than remembered**: the only thing bound to the field\'s value is `#/state/shown`, a scope path whose whole purpose is to hold nothing. What the field is worth is said in the placeholder instead — the env NAME the store gave it, which is the only half of a secret a screen may carry. `ui/form-controls.ts` decides everything else: whether the host has a secret store at all, what the placeholder says, what a commit is worth and what the field persists.',tagName:"div",attributes:{part:"secret",role:"none"},style:{$description:"`.secret-field` carried no rule anywhere — it was one of `check-styles.ts`'s ALLOWED_ORPHANS, a class emitted only so a test could find the control — so there is nothing to translate and the wrapper takes no box of its own. The field takes the width of the control host the form drew, which is the flex item; a kit field is inline-flex by default and would otherwise sit at its intrinsic width in a row sized for it.",display:"contents",'& [part="field"]':{width:"100%"}},children:[{$description:"`autocomplete: new-password` because this is a place to PUT a secret rather than to prove one: without it a password manager offers to fill the field with a credential belonging to whatever site the reader last logged in to, and the offer is the manager's own UI drawn over an editor. The value binding is `#/state/shown` and nothing else ever writes to it — see the document description.",tagName:"jx-textfield",attributes:{part:"field"},$props:{type:"password",size:"sm",autocomplete:"new-password",label:{$ref:"#/state/label"},placeholder:{$ref:"#/state/placeholder"},disabled:{$ref:"#/state/disabled"},value:{$ref:"#/state/shown"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/commit"},value:[{$ref:"event#/target/value"}]}],description:"The change bubbles out of the field's own input, so what the reader typed is read off the event rather than off the element — and it is read here, handed to the flow, and never written back onto the scope."}}]};I("secret-field",Q);function ve(){return{disabled:!0,label:"",placeholder:"Not set"}}function Z(e,r){e.textContent="";let t=v({...ve(),...r,shown:""}),a=null,n=!0,s=!1,c=()=>A("secret-field",t,e).then((d)=>{let y=d.root;if(n=!1,s)return d.dispose(),y;return a=d,y}),m=c();return{clear(){t.shown=" ",t.shown=""},dispose(){s=!0,a?.dispose(),a=null,e.textContent=""},host:e,ready:m,update(d){if(t.disabled=d.disabled,t.label=d.label,t.placeholder=d.placeholder,s||n||a!==null&&e.contains(a.root))return;a?.dispose(),a=null,n=!0,e.textContent="",c()}}}var Se=ix.map((e)=>({label:e,value:e})),Fe=rx.map((e)=>({label:e||"(none)",value:e})),ee=[],te=" ";function Ne(e){let r=e.resolvePointer("#/$context/content"),t=w(r)?Object.keys(r):[],a=t.join(" ");if(a!==te)te=a,ee=t.map((n)=>({label:n,value:n}));return ee}function C(e){return e==="string"||e==="array"}function Ee(e){if(!w(e))return{properties:{},required:[],type:"object"};return e}function Ce(e){return JSON.parse(JSON.stringify(e))}function je(e){let r=e;return r.type??="object",r.properties??={},r.required??=[],r}function R(e){return`name:${e}`}function D(e){return`required:${e}`}function M(e,r){return`${e} ${r}`}function q(e,r,t){return e.echo?.id===r?e.echo.value:t}function ke(e,r,t,a,n){let s=M(r,t),c=vm(a);return{format:Dc(a),hasFormat:C(c),key:t,name:q(e,R(s),t),parent:r,required:q(e,D(s),n),type:c}}function Ae(e,r,t,a,n){let s=vm(t),c=s==="object",m=e.drafts.get(r),d=t.required??[];return{children:c?Object.entries(t.properties??{}).map(([y,g])=>ke(e,r,y,g,d.includes(y))):[],draftName:m?.name??"",draftType:m?.type??"string",extra:s==="reference"&&n?"reference":c?"nested":"none",format:Dc(t),hasFormat:C(s),key:r,label:tc(r),name:q(e,R(r),r),refTarget:t.$ref?t.$ref.replace(/^#\/[^/]+\//,""):"",required:q(e,D(r),a),type:s}}function ne(e,r,t){let a={};for(let[n,s]of Object.entries(e))a[n===r?t:n]=s,delete e[n];Object.assign(e,a)}function L(e,r,t){e.required??=[];let a=e.required.indexOf(r);if(t&&a===-1)e.required.push(r);if(!t&&a!==-1)e.required.splice(a,1)}function Re(e,r){let t=r,a=null,n={add:{...Ic},addOpen:!1,drafts:new Map,echo:null},s=()=>a??Ee(t.value),c=()=>{let o=s(),l=o.required??[],p=Ne(t.ctx);return{addFormat:n.add.format,addHasFormat:C(n.add.type),addName:n.add.name,addRequired:n.add.required,addState:n.addOpen?"open":"closed",addType:n.add.type,fields:Object.entries(o.properties??{}).map(([f,u])=>Ae(n,f,u,l.includes(f),p.length>0)),formatOptions:Fe,targets:p,typeOptions:Se}},m=()=>T.update(c()),d=(o,l)=>{n.echo={id:o,value:l},m()},y=()=>{n.echo=null,m()},g=(o)=>{let l=Ce(s()),p=je(l);if(!o(p)){y();return}a=p,n.echo=null,t.onChange(l),m()},x=(o,l)=>o.properties[l],F=(o)=>{let l=n.drafts.get(o);if(!l)l={name:"",type:"string"},n.drafts.set(o,l);return l},T=K(e,{addNested(o){let l=F(o),p=nv(l.name.trim());if(!p)return;g((f)=>{let u=x(f,o);if(!u)return!1;return u.properties??={},u.properties[p]=Zs(l.type||"string"),l.name="",!0})},cancelAdd(){n.addOpen=!1,n.add={...Ic},m()},confirmAdd(){let o=nv(n.add.name.trim());if(!o)return;let{format:l,required:p,type:f}=n.add;n.addOpen=!1,n.add={...Ic},g((u)=>{if(u.properties[o]=Zs(f,l||void 0),p)L(u,o,!0);return!0})},editAddFormat(o){n.add.format=o,m()},editAddName(o){n.add.name=o,m()},editAddRequired(o){n.add.required=o,m()},editAddType(o){n.add.type=o,m()},editDraftName(o,l){F(o).name=l,m()},editDraftType(o,l){F(o).type=l,m()},openAdd(){n.addOpen=!0,n.add={...Ic},m()},removeField(o){g((l)=>{if(!l.properties[o])return!1;return delete l.properties[o],l.required=l.required.filter((p)=>p!==o),!0})},removeNested(o,l){g((p)=>{let f=x(p,o);if(!f?.properties?.[l])return!1;if(delete f.properties[l],f.required)f.required=f.required.filter((u)=>u!==l);return!0})},renameField(o,l){d(R(o),l);let p=nv(l.trim());g((f)=>{if(!f.properties[o]||!p||p===o||f.properties[p])return!1;return ne(f.properties,o,p),f.required=f.required.map((u)=>u===o?p:u),!0})},renameNested(o,l,p){d(R(M(o,l)),p);let f=nv(p.trim());g((u)=>{let S=x(u,o);if(!S?.properties?.[l]||!f||f===l||S.properties[f])return!1;if(ne(S.properties,l,f),S.required)S.required=S.required.map((k)=>k===l?f:k);return!0})},setFormat(o,l){g((p)=>{let f=p.properties[o];if(!f)return!1;return p.properties[o]=Zs(f.type||"string",l||void 0),!0})},setNestedFormat(o,l,p){g((f)=>{let u=x(f,o),S=u?.properties?.[l];if(!u?.properties||!S)return!1;return u.properties[l]=Zs(S.type||"string",p||void 0),!0})},setNestedRequired(o,l,p){d(D(M(o,l)),p),g((f)=>{let u=x(f,o);if(!u)return!1;return L(u,l,p),!0})},setNestedType(o,l,p){g((f)=>{let u=x(f,o),S=u?.properties?.[l];if(!u?.properties||!S)return!1;let k=C(p)?Dc(S):void 0;return u.properties[l]=Zs(p,k||void 0),!0})},setRequired(o,l){d(D(o),l),g((p)=>{if(!p.properties[o])return!1;return L(p,o,l),!0})},setTarget(o,l){g((p)=>{if(!p.properties[o])return!1;return p.properties[o]={$ref:`#/content/${l}`},!0})},setType(o,l){g((p)=>{let f=p.properties[o];if(!f)return!1;let u=C(l)?Dc(f):void 0;return p.properties[o]=Zs(l,u||void 0),!0})}});return m(),{dispose:()=>T.dispose(),update(o){t=o,a=null,n.echo=null,m()}}}var Oe={mount:Re};gx("schema-builder",Oe);function ie(e){return i(e)&&e?e:null}function De(e,r){let t=r,a=()=>{let s=ie(t.value);n.update({disabled:!t.ctx.commitSecret,label:t.key,placeholder:s?`Stored as ${s}`:"Not set"})},n=Z(e,{commit(s){let{commitSecret:c}=t.ctx;if(!c||!s)return;n.clear();let{key:m,onChange:d}=t,y=ie(t.value);Promise.resolve(c(m,s)).then((g)=>{if(i(g)&&g&&g!==y)d(g)})}});return a(),{dispose:()=>n.dispose(),update(s){t=s,a()}}}var He={mount:De};gx("secret",He);var j=new Map,H=new Map,N=new Map;function V(e){if(e===void 0)j.clear(),H.clear(),N.clear();else j.delete(e),H.delete(e),N.delete(e)}function Pe(e){let r=j.get(e);if(r)return r;let t=(we("1449qesq"),import("./content-source-1449qesq.js")).then((a)=>a.listCollectionEntryIds(e));return j.set(e,t),t}function KS(e,r){let t=H.get(e);if(t)return t;let a=Pe(e),n=N.get(e);if(n){if(r)n.add(r);return null}N.set(e,new Set(r?[r]:[]));let s=(c)=>{if(j.get(e)!==a)return;let m=N.get(e);N.delete(e),H.set(e,c);for(let d of m??[])d()};return a.then((c)=>s({ids:c}),(c)=>s({error:re(c)})),null}function Le(e,r){let t=i(e.value)?e.value:"",a={canRetry:!1,disabled:!1,hasNote:!1,label:e.key,note:"",noteTone:"dim",options:[],value:t},n=Gu(e.schema);if(n===null)return{...a,hasNote:!0,kind:"text",note:'No collection referenced — add "$ref": "#/content/<type>" to this field.'};let s=KS(n,r);if(s===null)return{...a,disabled:!0,kind:"picker",options:[{label:"Loading…",value:t}]};if("error"in s)return{...a,canRetry:!0,hasNote:!0,kind:"text",note:`Could not list ${n} entries — ${s.error}`,noteTone:"danger"};let c=t!==""&&!s.ids.includes(t);return{...a,hasNote:s.ids.length===0,kind:"picker",note:s.ids.length===0?`No ${n} entries yet.`:"",options:[{label:"—",value:""},...c?[{label:`${t} — not found`,value:t}]:[],...s.ids.map((m)=>({label:m,value:m}))]}}function Me(e,r){let t=r,a=!1,n=()=>{if(!a)s.update(Le(t,n))},s=X(e,{choose(c){t.onChange(c===""?void 0:c)},edit(c){t.onChange(c.trim()||void 0)},retry(){let c=Gu(t.schema);if(c!==null)V(c);n()}});return n(),{dispose(){a=!0,s.dispose()},update(c){t=c,n()}}}var Ve={mount:Me};gx("reference",Ve);var se={$schema:"https://jxsuite.com/schema/v1",$id:"StudioEntryEditor",$description:"The Entry editor (site-architecture.md §7.4) — one content entry's fields, in a pane, as a Jx document over the kit. The adapter (`surfaces/entry-editor.ts`) hands in a projection; `content/entry-editor.ts` decides everything in it — which collection the file belongs to, which record its fields live in, which required keys are absent and what a draft flag commits into. The FORM is an island: a schema is `ui/schema-form.ts`'s subject, so this document renders an empty `fields` node and the flow places the element that engine hands back (studio-ui-guidelines.md §9.3, §9.4). That is the whole of the difference between this and the card the lit version drew, and it is why the engine converting in batch 7 is what unblocked this one.",tagName:"div",attributes:{part:"entry","data-jx-region":"${state.region}"},style:{$description:"What `.entry-editor`, `.entry-editor-header`, `.entry-editor-collection`, `.entry-draft-switch`, `.entry-editor-fields`, `.entry-editor-note` and `.entry-editor-empty` said in `styles/overlays.css`, keyed on `part` and re-pointed at the studio token layer. This editor was the only emitter of all seven, so those rules are dead in the stylesheet from here; a central sweep removes them rather than this change, which owns no stylesheet. Every `--spectrum-font-size-*` reference is gone rather than renamed: those names resolve only inside `<sp-theme>`, and a pane editor is mounted outside it, so each would silently have taken its hard-coded fallback.",height:"100%",padding:"var(--jx-space-5)",overflowY:"auto",background:"var(--bg-panel)",'& [part="header"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-4)",marginBottom:"var(--jx-space-5)"},'& [part="name"]':{margin:"0",fontSize:"var(--jx-text-lg)",fontWeight:"600",color:"var(--fg)"},'& [part="collection"]':{padding:"1px var(--jx-space-3)",borderRadius:"var(--radius)",background:"var(--bg)",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"},'& [part="draft"]':{$description:"Pushed to the far end of the header rather than placed there: the heading and the collection chip are both content-width, so `margin-left: auto` is what keeps the switch on the right edge whatever the entry is called.",marginLeft:"auto"},'& [part="fields"]':{$description:"The schema form's host is `display: contents`, so its rows are the flex items of THIS box — which is why the column lives here and not inside the engine.",display:"flex",flexDirection:"column"},'& [part="note"]':{margin:"0 0 var(--jx-space-4)",color:"var(--fg-dim)",fontSize:"var(--jx-text-md)",lineHeight:"1.5"},'& [part="empty"]':{display:"flex",maxWidth:"46ch",flexDirection:"column",alignItems:"flex-start",gap:"var(--jx-space-3)",color:"var(--fg-dim)",fontSize:"var(--jx-text-md)",lineHeight:"1.5"}},children:[{tagName:"div",attributes:{part:"stage-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/stage"},cases:{entry:{tagName:"div",attributes:{part:"body",role:"none"},style:{display:"contents"},children:[{tagName:"div",attributes:{part:"header"},children:[{tagName:"h3",attributes:{part:"name"},textContent:"${state.name}"},{tagName:"span",attributes:{part:"collection"},textContent:"${state.collection}"},{tagName:"div",attributes:{part:"draft-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/draftAxis"},cases:{shown:{$description:"No `label`: the slotted word is on screen and carries the name, so an aria-label would be read twice. The tooltip is `hint`, which is what DRAFT_MEANING has always been.",tagName:"jx-switch",attributes:{part:"draft"},$props:{checked:{$ref:"#/state/draft"},hint:"${state.draftHint}",size:"sm"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setDraft"},value:[{$ref:"event#/target/checked"}]}]},children:[{tagName:"span",textContent:"Draft"}]}}}]},{tagName:"div",attributes:{part:"note-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/noteState"},cases:{shown:{tagName:"p",attributes:{part:"note"},textContent:"${state.note}"}}},{$description:"An island: `ui/schema-form.ts` draws this entry's fields into this node, and nothing in this document knows what a schema is.",tagName:"div",attributes:{part:"fields","data-jx-region":"${state.fieldsRegion}"}}]},empty:{$description:"The mode is reachable from the palette and from `__jxAutomation` on any tab, so this state is real: it names the reason and the fix rather than drawing an empty form.",tagName:"div",attributes:{part:"empty"},children:[{tagName:"p",attributes:{part:"empty-line"},textContent:"${state.emptyLine}"},{tagName:"p",attributes:{part:"note"},children:[{tagName:"span",textContent:"A collection is a "},{tagName:"code",textContent:"content"},{tagName:"span",textContent:" entry in "},{tagName:"code",textContent:"project.json"},{tagName:"span",textContent:" whose "},{tagName:"code",textContent:"source"},{tagName:"span",textContent:" directory contains this file and which declares a "},{tagName:"code",textContent:"schema"},{tagName:"span",textContent:"."}]},{tagName:"jx-action-button",attributes:{part:"content-types"},$props:{label:"Content types",size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openContentTypes"},value:[]}]},children:[{tagName:"span",textContent:"Content types…"}]}]}}}]};I("entry-editor",se);function de(e,r){e.region=r.region,e.fieldsRegion=r.fieldsRegion,e.stage=r.stage,e.name=r.name,e.collection=r.collection,e.draftAxis=r.draftAxis,e.draft=r.draft,e.draftHint=r.draftHint,e.noteState=r.noteState,e.note=r.note,e.emptyLine=r.emptyLine}function ze(e){let r=i(e)?void 0:e.attributes?.part;return i(r)?r:""}function le(e,r,t,a){e.replaceChildren();let n=v({collection:"",draft:!1,draftAxis:"hidden",draftHint:"",emptyLine:"",fieldsRegion:"",name:"",note:"",noteState:"hidden",openContentTypes:t.openContentTypes,region:"",setDraft:t.setDraft,stage:"empty"});de(n,r);let s=null,c=!1,m=A("entry-editor",n,e,{onNodeCreated:(d,y,g)=>{if(d instanceof HTMLElement&&ze(g)==="fields")a.fieldsSlot(d)}}).then((d)=>{let y=d.root;if(c)return d.dispose(),y;return s=d,y});return{attached:()=>{if(c)return!1;let d=s?.root;return d===void 0?!0:d instanceof HTMLElement&&e.contains(d)},dispose(){c=!0,s?.dispose(),s=null},ready:m,update:(d)=>de(n,d)}}function ce(e){return e.doc.sourceFormat==null&&e.doc.mode!=="content"}function wm(e){return ce(e)?e.doc.document:e.doc.content.frontmatter}function _e(e,r,t){let a=e.doc.document,n=Object.hasOwn(a,r)?Te(a[r]):void 0,s=t===void 0||t===null||t==="";if(s)delete a[r];else a[r]=t;let c=s?void 0:Te(t);Ei({forward:{key:r,op:"set-key",path:[],value:c},inverse:{key:r,op:"set-key",path:[],value:n}}),e.doc.dirty=!0,kT()}function B(e,r,t){if(ce(e))_e(e,r,t);else ec(e,r,t)}function pe(e,r){Y(e,(t)=>{for(let[a,n]of Object.entries(r))B(t,a,n)})}var fe="entry",Je=[fe],P=new Map;function z(e){return P.get(e)??null}function GS(e,r){let t=z(e);return t!==null&&t.tabId===r.id&&t.wrap.isConnected&&t.surface.attached()}function Wb(e){let r=P.get(e);if(!r)return;r.scope.stop(),r.surface.dispose(),P.delete(e)}function _(e,r){Y(e,(t)=>B(t,Ac,r))}function sT(e){let r=Ea(e.documentPath),t=wm(e);if(!r||!Cm(r.schema,t))return null;let a=Yu(t);return{draft:a,text:a?"Draft":"Published",title:a?Zb:"Not marked a draft."}}function We(e){return{fieldKeyPrefix:`entry:${e.id}`,resolvePointer:(r,t)=>Ju(r,{projectConfig:O?.projectConfig??{},scope:t})}}function Ue(e,r){return Object.fromEntries(lT(e.schema,r).map((t)=>[t,"Required — this entry does not have one."]))}function Ye(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 me(e,r,t){let a=sr(e,"entry"),n=sr(e,"entry/fields");if(!t)return{collection:"",draft:!1,draftAxis:"hidden",draftHint:Zb,emptyLine:Ye(r),fieldsRegion:n,name:"",note:"",noteState:"hidden",region:a,stage:"empty"};let s=wm(r),c=Yu(s);return{collection:t.name,draft:c,draftAxis:Cm(t.schema,s)?"shown":"hidden",draftHint:Zb,emptyLine:"",fieldsRegion:n,name:r.documentPath?.split("/").pop()??"Untitled",note:Zb,noteState:c?"shown":"hidden",region:a,stage:"entry"}}function aT(e,r){let{paneId:t,wrap:a}=e;if(GS(t,r))return;Wb(t);let n=null,s=null,c=()=>{if(n!==null&&z(t)===n)d()},m=(x)=>{if(!s||!x)return;let F=wm(r),T=Dd(`entry:${t}`,x.schema,F,{context:We(r),errors:Ue(x,F),onChange:(o)=>pe(r,o),rerender:c});if(T.parentNode!==s)s.replaceChildren(T)},d=()=>{let x=Ea(r.documentPath);if(!x)s=null;n?.surface.update(me(t,r,x)),m(x)},y=xe(),g=le(a,me(t,r,Ea(r.documentPath)),{openContentTypes:()=>{ae()?.run("settings.open",{section:"content"})},setDraft:(x)=>_(r,x)},{fieldsSlot:(x)=>{s=x,m(Ea(r.documentPath))}});n={paneId:t,scope:y,surface:g,tabId:r.id,wrap:a},P.set(t,n),y.run(()=>{oe(()=>{if(z(t)!==n)return;r.doc.document,r.doc.content.frontmatter,O?.projectConfig?.content,d()})})}async function J(e){let{openFileInTab:r}=await (we("j3knqf0s"),import("./files-j3knqf0s.js"));await r(e);for(let[t,a]of b.tabs.entries()){if(a.documentPath!==e)continue;for(let n of Je)if(!a.capabilities.modes.includes(n))a.capabilities.modes.unshift(n);return a.session.ui.canvasMode=fe,a.session.ui.preview=!1,bi(t),a}return null}function W(){return zb().map((e)=>e.name)}async function Ke(e){let r=YS(e.schema),t=(e.def.format?Li(e.def.format)?.name:void 0)??rn(`untitled${e.ext}`)?.name??Go()?.name;if(e.ext===".json"||t===void 0)return io(r,null);return sa(t,{...r,children:[]},{frontmatter:Object.keys(r).length>0,mode:"roundtrip"})}async function ox(e,r={}){let t=sx(e);if(!t)return E.error(`No content collection named "${e}" to create an entry in.`,{detail:"A collection needs a `content` entry in project.json whose `source` is a directory. A collection whose source names a single file (a CSV catalogue) has rows, not entry files.",source:"Content"}),null;await Xt().catch(()=>{});let a;try{a=await Ke(t)}catch(d){return E.error(`Could not prepare a new ${t.name} entry.`,{detail:re(d),path:t.dir,source:"Content"}),null}let n=r.dir,s=n!==void 0&&Gp(n)?.name===t.name?n:t.dir;if(s.includes(cc))return E.error(`"${t.name}" is a localized collection.`,{detail:`Its entries live in one directory per language (${t.dir}). Open the folder for the language you are writing in and create the entry there.`,path:t.dir,source:"Content"}),null;let{createFileIn:c}=await (we("j3knqf0s"),import("./files-j3knqf0s.js")),m=await c({content:a,dir:s,format:{ext:t.ext,kind:"fixed"},source:"Content",suggestedName:"untitled",title:`New ${t.name} entry`});if(m===null)return null;return V(t.name),await J(m),m}function ue(){let e=h.value;return e&&Ea(e.documentPath)?e:null}function Ge(){return[{args:Ie({collection:Na(W,"The content collection the entry is created in.")}),category:"File",id:"content.newEntry",level:"project",menus:["palette"],group:"1_file",requires:"a project with a directory-backed content collection",when:(e)=>e.project.open,enablement:()=>W().length>0,undo:"project",run:async(e,r)=>{let t=W();await ox(gi("content.newEntry",r,"collection",t))},title:"New Entry"},{args:Ie({path:qe("Project-relative path of the entry file to open.")}),category:"File",id:"content.openEntry",level:"project",menus:["context/file","palette"],group:"1_file",requires:"an open project",when:(e)=>e.project.open,run:async(e,r)=>{await J(ct("content.openEntry",r,"path"))},title:"Open Entry Form"},{args:Ie({draft:pr("True marks the open entry a draft; false marks it published. Written as a `draft` field on the entry.")}),category:"Document",id:"content.setDraft",level:"document",menus:["context/tab","palette"],group:"3_document",requires:"a content entry open",when:(e)=>e.document.open,enablement:()=>ue()!==null,undo:"document",run:(e,r)=>{let t=ue();if(!t)throw Error("content.setDraft: the active document is not a content entry");_(t,Ti("content.setDraft",r,"draft"))},title:"Set Draft"},{args:Ie({include:pr("True lists entries marked `draft: true` alongside the rest.")}),category:"View",id:"content.setIncludeDrafts",level:"project",menus:["palette"],group:"2_view",requires:"an open project",when:(e)=>e.project.open,run:async(e,r)=>{ST(Ti("content.setIncludeDrafts",r,"include")),await sC()},title:"Include Drafts"}]}function JS(e){e.registerAll(Ge())}
|
|
2
|
-
export{ix,rx,Ic,vm,Dc,Zs,KS,wm,GS,Wb,sT,aT,ox,JS};
|
|
3
|
-
|
|
4
|
-
//# debugId=CD299E750C40D5E964756E2164756E21
|
|
5
|
-
//# sourceMappingURL=studio-sg2a0dh0.js.map
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{i,w}from"./studio-cffqvnzd.js";var S=500;class h extends Error{constructor(){super();this.name="MaxOpsExceededError"}}function Ss(e,n){if(e===n)return!0;if(Array.isArray(e)&&Array.isArray(n))return e.length===n.length&&e.every((o,t)=>Ss(o,n[t]));if(w(e)&&w(n)){let o=Object.keys(e),t=Object.keys(n);return o.length===t.length&&o.every((a)=>(a in n)&&Ss(e[a],n[a]))}return!1}function A(e){let n=5381;for(let o=0;o<e.length;o++)n=Math.imul(n,33)+(e.codePointAt(o)??0);return n.toString(36)}function m(e){return i(e)?`s:${e}`:`n:${A(JSON.stringify(e))}`}function g(e){if(i(e))return"s";let{attributes:n,$props:o}=e,t=(w(n)?n.id:void 0)??(w(o)?o.key:void 0)??"";return`w:${String(e.tagName??"")}:${String(t)}`}function y(e,n,o=Number.POSITIVE_INFINITY){let t=e.length,a=n.length;if(t===0||a===0||t*a>o)return[];let l=Array.from({length:t+1},()=>Array.from({length:a+1},()=>0));for(let s=t-1;s>=0;s--)for(let c=a-1;c>=0;c--)l[s][c]=e[s]===n[c]?l[s+1][c+1]+1:Math.max(l[s+1][c],l[s][c+1]);let f=[],r=0,u=0;while(r<t&&u<a)if(e[r]===n[u])f.push([r,u]),r+=1,u+=1;else if(l[r+1][u]>=l[r][u+1])r+=1;else u+=1;return f}function MS(e,n,o={}){let t=o.maxCells??Number.POSITIVE_INFINITY,a=y(e.map((s)=>m(s)),n.map((s)=>m(s)),t),l=[],f=-1,r=-1,u=[];for(let[s,c]of a)u.push([f+1,s,r+1,c]),l.push({aIndex:s,bIndex:c,identical:!0}),f=s,r=c;u.push([f+1,e.length,r+1,n.length]);for(let[s,c,x,I]of u){let J=e.slice(s,c),O=n.slice(x,I);for(let[M,N]of y(J.map((p)=>g(p)),O.map((p)=>g(p)),t))l.push({aIndex:s+M,bIndex:x+N,identical:!1})}return l.toSorted((s,c)=>s.aIndex-c.aIndex)}function d(e,n){if(e.ops.length>=e.maxOps)throw new h;e.ops.push(n)}function b(e,n,o,t){for(let f of new Set([...Object.keys(o),...Object.keys(t)])){if(f==="children")continue;if(!(f in t))d(e,{key:f,op:"set-key",path:n});else if(!Ss(o[f],t[f]))d(e,{key:f,op:"set-key",path:n,value:t[f]})}let a=o.children,l=t.children;if(Array.isArray(a)&&Array.isArray(l))D(e,n,a,l);else if(!Ss(a,l))d(e,{key:"children",op:"set-key",path:n,value:l})}function D(e,n,o,t){let a=MS(o,t),l=new Set(a.map((r)=>r.aIndex)),f=new Map(a.map((r)=>[r.bIndex,r]));for(let r=o.length-1;r>=0;r--)if(!l.has(r))d(e,{index:r,op:"remove-child",parentPath:n});for(let[r,u]of t.entries()){let s=f.get(r);if(!s){d(e,{index:r,node:u,op:"insert-child",parentPath:n});continue}if(s.identical)continue;let c=o[s.aIndex];if(w(c)&&w(u))b(e,[...n,"children",r],c,u);else if(!Ss(c,u))d(e,{index:r,node:u,op:"set-child",parentPath:n})}}function XI(e,n,o={}){let t={maxOps:o.maxOps??S,ops:[]};try{b(t,[],e,n)}catch(a){if(a instanceof h)return null;throw a}return t.ops}
|
|
2
|
-
export{Ss,MS,XI};
|
|
3
|
-
|
|
4
|
-
//# debugId=7749B0E480A3E5C964756E2164756E21
|
|
5
|
-
//# sourceMappingURL=studio-tjzjhe68.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{x}from"./studio-ynn90f58.js";import{Br,Km,h}from"./studio-24mccdrj.js";import{O}from"./studio-c7q0t9x1.js";var Im=["application","project","document","selection"],QT=["global","canvas","caret","grid","code","dock","palette"],eL=["File","Edit","Selection","Insert","View","Document","Project","Source Control","Publish","Assistant","Collaborate","Help"],m=["commandbar/primary","commandbar/overflow","statusbar/project","statusbar/document","statusbar/selection","context/element","context/file","context/layer","context/tab","context/pane","blockbar","blockbar/format","outline/row","settings/menu","palette","never"],u={"commandbar/primary":{admits:["application","document"],note:"document only for Save / Undo / Redo / Open in Browser, by frequency; ≤5 total"},"commandbar/overflow":{admits:["application","project","document"],note:"never selection — the Command Bar is not a selection surface"},"statusbar/project":{admits:["project"],note:"the status bar's left field"},"statusbar/document":{admits:["document"],note:"the status bar's centre field"},"statusbar/selection":{admits:["selection"],note:"the status bar's right field"},"context/element":{admits:["selection"],note:"the canvas element menu acts on a selection"},"context/file":{admits:["project"],note:"a file row addresses the project's file set"},"context/layer":{admits:["selection"],note:"an outline row IS a selection"},"context/tab":{admits:["document"],note:"a tab addresses one document"},"context/pane":{admits:["document"],note:"a pane hosts one document"},blockbar:{admits:["selection"],note:"the floating bar owns selection-scoped verbs"},"blockbar/format":{admits:["selection"],note:"the bar's inline-format cluster — a range inside the selection is still the selection"},"outline/row":{admits:["selection"],note:"row actions act on the row's node"},"settings/menu":{admits:["application","project"],note:"the rail foot's gear menu — the settings family. It is a MENU, not a pinned slot, so it "+"may host two levels for the reason commandbar/overflow does: a menu prints each row's own name, chord and gate, and draws a divider where the level changes. The rail's PINNED groups stay single-level, in PANEL_PLACEMENT_MATRIX"},palette:{admits:["application","project","document","selection"],note:"the level-agnostic surface; it groups rows by level"},never:{admits:["application","project","document","selection"],note:"keyboard- and API-only; no rendered surface to be misplaced in"}},p=["rail/project","rail/document","navigator","inspector","dock.bottom"],f={"rail/project":{admits:["project"],note:"the rail's upper group — Files, Search, Source Control, Problems"},"rail/document":{admits:["document"],note:"the rail's lower group — Outline, Page, Data, Packages"},navigator:{admits:["project","document"],note:"whichever level the hosted panel declares; the panel header prints it"},inspector:{admits:["selection"],note:"the Inspector's tabs are selection surfaces"},"dock.bottom":{admits:["project","document"],note:"the panel header states which"}};function g(e){return e==="bottom"?"dock.bottom":e}function v(e){let t=[g(e.dock)];if(e.rail!==!1)t.push(`rail/${e.level}`);return t}function P(e){return p.some((t)=>t===e)}function r(e){let t=[];if(!s(e.level))return t.push({panelId:e.id,placement:"—",level:String(e.level),message:`declares unknown level "${String(e.level)}" (expected one of: ${Im.join(", ")})`}),t;for(let n of v(e)){if(!P(n)){t.push({panelId:e.id,placement:n,level:e.level,message:`is level "${e.level}" and would render in "${n}", which is not a panel `+"placement — the rail has a group for project and one for document, and nothing else"});continue}let o=f[n];if(!o.admits.includes(e.level))t.push({panelId:e.id,placement:n,level:e.level,message:`is level "${e.level}" but "${n}" admits only ${o.admits.join(", ")} — ${o.note}`})}return t}function b(e){return m.some((t)=>t===e)}function s(e){return Im.some((t)=>t===e)}function tL(e){let t=[];if(!s(e.level))return t.push({commandId:e.id,placement:"—",level:String(e.level),message:`declares unknown level "${String(e.level)}" (expected one of: ${Im.join(", ")})`}),t;for(let n of e.menus??[]){if(!b(n)){t.push({commandId:e.id,placement:String(n),level:e.level,message:`declares unknown placement "${String(n)}"`});continue}let o=u[n];if(!o.admits.includes(e.level))t.push({commandId:e.id,placement:n,level:e.level,message:`is level "${e.level}" but "${n}" admits only ${o.admits.join(", ")} — ${o.note}`})}return t}function Md(){let e=Km();return e.project.open=O!==null,e.project.isMultilingual=(Br(O?.projectConfig??{}).i18n?.locales.length??0)>1,e.git.dirtyCount=x.git.status?.files.length??0,e.document.open=h.value!==null,e}var y=/^[a-z][\w-]*$/,a=new Map;function Xn(e){if(!y.test(e.id))throw Error(`Panel id "${e.id}" is malformed — expected /^[a-z][\\w-]*$/, because the id is also `+`the region "navigator/panel:${e.id}" and the value view.setActivity accepts.`);if(a.has(e.id))throw Error(`Panel "${e.id}" is already registered — a second definition site is the defect this `+"registry exists to prevent.");let t=r({id:e.id,level:e.level,dock:e.dock,rail:e.rail});if(t.length>0){let n=t.map((o)=>` ✗ ${e.id} ${o.message}`).join(`
|
|
2
|
-
`);throw Error(`Panel "${e.id}" violates the level × placement matrix:
|
|
3
|
-
${n}`)}if(e.railLabel!==void 0&&(e.railLabel.trim()===""||!e.title.startsWith(e.railLabel)))throw Error(`Panel "${e.id}" declares railLabel "${e.railLabel}", which is not a leading part of its title "${e.title}": the rail button's accessible name is the title, and the words on screen must be inside it (WCAG 2.5.3, Label in Name).`);a.set(e.id,e)}function th(e){return a.get(e)}function dy(e){let t=[...a.values()];return e?t.filter((n)=>n.dock===e):t}function uy(e,t){return e.when?e.when(t):!0}var c=[{level:"project",label:"Project"},{level:"document",label:"Document"}];function d(){return dy().filter((e)=>e.rail!==!1)}function CC(e){let t=d();return c.flatMap(({level:n,label:o})=>{let l=t.filter((i)=>i.level===n&&uy(i,e));return l.length>0?[{level:n,label:o,panels:l}]:[]})}function nL(){let e=d();return c.flatMap(({level:t})=>e.filter((n)=>n.level===t))}
|
|
4
|
-
export{Im,QT,eL,tL,Md,Xn,th,dy,uy,CC,nL};
|
|
5
|
-
|
|
6
|
-
//# debugId=4DA6016BCBCA4CF064756E2164756E21
|
|
7
|
-
//# sourceMappingURL=studio-v2w7q8r1.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
var e=new Map,r=new Set;function o(){for(let t of r)t()}function rl(){o()}function Ub(t){return r.add(t),()=>{r.delete(t)}}function Cs(t){e.set(t.key,t),o()}function XS(t){if(e.delete(t))o()}function xm(){return[...e.values()].toSorted((t,s)=>t.order-s.order)}function ax(){return xm().map((t)=>t.key)}function lx(t){return e.get(t)}var i=null,n="overview";function qb(){if(i!==null&&e.has(i))return n=i,i=null,n;if(e.has(n))return n;return ax()[0]??n}function Kb(t){if(e.has(t))n=t,i=null;else i=t;o()}export{rl,Ub,Cs,XS,xm,ax,lx,qb,Kb};
|
|
2
|
-
|
|
3
|
-
//# debugId=8841DFFB7C59375664756E2164756E21
|
|
4
|
-
//# sourceMappingURL=studio-v5vjq1h0.js.map
|