@jxsuite/studio 6.1.2 → 8.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (522) hide show
  1. package/README.md +5 -5
  2. package/dist/chunks/2020-5wtzce5g.js +4 -0
  3. package/dist/chunks/adapter-5tphg7xe.js +4 -0
  4. package/dist/chunks/add-new-flow-psym14sn.js +4 -0
  5. package/dist/chunks/cf-account-picker-haqazq5r.js +4 -0
  6. package/dist/chunks/cf-settings-h2wrh6hq.js +4 -0
  7. package/dist/chunks/{color-area-0fj8a4ga.js → color-area-6rbra5dy.js} +2 -2
  8. package/dist/chunks/{color-field-xch8kx2g.js → color-field-gy56c94g.js} +3 -3
  9. package/dist/chunks/color-m7r1vk54.js +4 -0
  10. package/dist/chunks/{color-slider-jxd8v350.js → color-slider-sqqdyf6c.js} +2 -2
  11. package/dist/chunks/{combobox-p0efwjke.js → combobox-72h32ejk.js} +3 -3
  12. package/dist/chunks/components-r22xca09.js +4 -0
  13. package/dist/chunks/content-source-mmppmcyg.js +4 -0
  14. package/dist/chunks/convert-to-repeater-he70fc2b.js +4 -0
  15. package/dist/chunks/editor-ccd9jwsa.js +4 -0
  16. package/dist/chunks/entry-commands-6qxz9e8p.js +4 -0
  17. package/dist/chunks/extension-sections-0egb88dm.js +4 -0
  18. package/dist/chunks/file-ops-qnab36ek.js +4 -0
  19. package/dist/chunks/files-rcn56qvm.js +4 -0
  20. package/dist/chunks/format-host-yxz0kjjs.js +4 -0
  21. package/dist/chunks/fs-events-d1qxq4z4.js +4 -0
  22. package/dist/chunks/grid-open-4z1g062t.js +4 -0
  23. package/dist/chunks/{grid-view-d2wq9ezg.js → grid-view-qg1b5eqx.js} +25 -25
  24. package/dist/chunks/{icons-pnfz478q.js → icons-63bjtbs7.js} +2 -2
  25. package/dist/chunks/{iframe-entry-jdcktez8.js → iframe-entry-2zggzajv.js} +4 -4
  26. package/dist/chunks/{iframe-entry-zap785cw.js → iframe-entry-76j8vwwx.js} +4 -4
  27. package/dist/chunks/iframe-entry-99nr5zfb.js +5 -0
  28. package/dist/chunks/{iframe-entry-x0ygf2yr.js → iframe-entry-pkgmcgp0.js} +4 -4
  29. package/dist/chunks/iframe-host-ssv7kyj0.js +4 -0
  30. package/dist/chunks/{index-zpjmzqfk.js → index-32eqzv1k.js} +3 -3
  31. package/dist/chunks/index-f0jn7nnp.js +4 -0
  32. package/dist/chunks/{javascript-m54mnwp6.js → javascript-pjp734q4.js} +3 -3
  33. package/dist/chunks/jsonMode-njkvsa02.js +13 -0
  34. package/dist/chunks/jx-validate-ttasrbh7.js +4 -0
  35. package/dist/chunks/layers-bgyr11tr.js +4 -0
  36. package/dist/chunks/layers-panel-7ez66zeq.js +4 -0
  37. package/dist/chunks/{listbox-e74qjyq6.js → listbox-c421cf8c.js} +2 -2
  38. package/dist/chunks/lit-html-v9gh687x.js +4 -0
  39. package/dist/chunks/media-library-sq468wts.js +4 -0
  40. package/dist/chunks/media-picker-shfe59pt.js +4 -0
  41. package/dist/chunks/{menu-n6yzswmy.js → menu-bdpzbfvs.js} +2 -2
  42. package/dist/chunks/{monaco-binding-7gx83x3r.js → monaco-binding-vq1hgnn0.js} +3 -3
  43. package/dist/chunks/monaco-buffer-3afgwvbp.js +4 -0
  44. package/dist/chunks/monaco-setup-xrd2cbkp.js +4 -0
  45. package/dist/chunks/notify-kzrjr3fv.js +4 -0
  46. package/dist/chunks/parse-v77xtwv7.js +4 -0
  47. package/dist/chunks/platform-7v4rtd7m.js +4 -0
  48. package/dist/chunks/popover-b89sfej7.js +4 -0
  49. package/dist/chunks/publish-panel-2z9gw8ee.js +4 -0
  50. package/dist/chunks/publish-quick-qx2455cj.js +4 -0
  51. package/dist/chunks/publish-workspace-wrc1dgwx.js +4 -0
  52. package/dist/chunks/quick-search-n0t0eqxb.js +4 -0
  53. package/dist/chunks/references-9547rg5s.js +4 -0
  54. package/dist/chunks/right-panel-wsgnr9pn.js +4 -0
  55. package/dist/chunks/source-control-kwktr9y6.js +4 -0
  56. package/dist/chunks/{split-n2gfpm5m.js → split-c9zfdgxf.js} +2 -2
  57. package/dist/chunks/studio-03ct6yfv.js +9 -0
  58. package/dist/chunks/studio-07rcfje3.js +5 -0
  59. package/dist/chunks/studio-3e54qh39.js +7 -0
  60. package/dist/chunks/studio-3exxhz5g.js +5 -0
  61. package/dist/chunks/studio-3q40e3rj.js +5 -0
  62. package/dist/chunks/studio-3qeh9t0h.js +6 -0
  63. package/dist/chunks/studio-3qqjeep5.js +6 -0
  64. package/dist/chunks/studio-43sd2mam.js +4 -0
  65. package/dist/chunks/studio-4hp8pkyt.js +5 -0
  66. package/dist/chunks/studio-58xg6j2q.js +9 -0
  67. package/dist/chunks/studio-5g0rprdt.js +7 -0
  68. package/dist/chunks/{studio-2j1cb95x.js → studio-6m380wp7.js} +4 -4
  69. package/dist/chunks/studio-80jyh1xh.js +4 -0
  70. package/dist/chunks/studio-83mk4bgg.js +9 -0
  71. package/dist/chunks/{studio-v0jzqdjm.js → studio-881z1xrx.js} +4 -4
  72. package/dist/chunks/studio-8m0y2qe7.js +5 -0
  73. package/dist/chunks/{studio-d81xfh1g.js → studio-8tr6cfrc.js} +4 -4
  74. package/dist/chunks/studio-8vcvfs7r.js +6 -0
  75. package/dist/chunks/studio-9tmebf0s.js +5 -0
  76. package/dist/chunks/studio-a2bvaptz.js +5 -0
  77. package/dist/chunks/studio-b7y5mr30.js +5 -0
  78. package/dist/chunks/studio-bavb31r0.js +5 -0
  79. package/dist/chunks/{studio-dgz8d0c1.js → studio-bbe4c90a.js} +4 -4
  80. package/dist/chunks/studio-c05wdnt3.js +5 -0
  81. package/dist/chunks/studio-ccv2svc6.js +5 -0
  82. package/dist/chunks/studio-d5grtb9e.js +16 -0
  83. package/dist/chunks/studio-df0baea9.js +5 -0
  84. package/dist/chunks/studio-dgk4dqtx.js +7 -0
  85. package/dist/chunks/studio-e1g64q43.js +5 -0
  86. package/dist/chunks/studio-ed1hp6zf.js +6 -0
  87. package/dist/chunks/studio-ed3xx40h.js +7 -0
  88. package/dist/chunks/studio-f14e1zdj.js +5 -0
  89. package/dist/chunks/studio-fbhxxc5f.js +5 -0
  90. package/dist/chunks/studio-fyh0jc96.js +5 -0
  91. package/dist/chunks/studio-gcxk20n7.js +5 -0
  92. package/dist/chunks/studio-jaaz8ce9.js +5 -0
  93. package/dist/chunks/{studio-90pq9km1.js → studio-jcnsdaep.js} +4 -4
  94. package/dist/chunks/studio-jsgf2q5k.js +7 -0
  95. package/dist/chunks/{studio-0q988f9w.js → studio-k3xxbagr.js} +3 -3
  96. package/dist/chunks/{studio-5ve6bbep.js → studio-k7evxqh4.js} +4 -4
  97. package/dist/chunks/studio-kt3pjkwd.js +5 -0
  98. package/dist/chunks/studio-m8g16bgz.js +5 -0
  99. package/dist/chunks/studio-mn0476ag.js +5 -0
  100. package/dist/chunks/studio-mx1smyq0.js +5 -0
  101. package/dist/chunks/studio-n0c5h6mf.js +5 -0
  102. package/dist/chunks/{studio-485046te.js → studio-nh6d342n.js} +7 -7
  103. package/dist/chunks/studio-nqxqf8p2.js +4 -0
  104. package/dist/chunks/studio-p4nrkvqr.js +5 -0
  105. package/dist/chunks/{studio-1fxkaaea.js → studio-pbxa5fpc.js} +4 -4
  106. package/dist/chunks/studio-pgmvdv7z.js +7 -0
  107. package/dist/chunks/studio-ph84avkf.js +5 -0
  108. package/dist/chunks/{studio-tq0rtfwj.js → studio-q0mvbaq6.js} +4 -4
  109. package/dist/chunks/studio-q0tccd43.js +5 -0
  110. package/dist/chunks/studio-q7rtx6zq.js +14 -0
  111. package/dist/chunks/{studio-a3g98wjr.js → studio-qgh13jtz.js} +4 -4
  112. package/dist/chunks/studio-qmn1xc24.js +5 -0
  113. package/dist/chunks/studio-qwdqwkj0.js +5 -0
  114. package/dist/chunks/studio-r5qy30vx.js +5 -0
  115. package/dist/chunks/studio-rj9eamf8.js +5 -0
  116. package/dist/chunks/studio-rptgsk96.js +5 -0
  117. package/dist/chunks/studio-rthyg42z.js +928 -0
  118. package/dist/chunks/studio-s19tp1xr.js +5 -0
  119. package/dist/chunks/studio-s32578pn.js +5 -0
  120. package/dist/chunks/studio-svb7yyve.js +5 -0
  121. package/dist/chunks/studio-syreb644.js +5 -0
  122. package/dist/chunks/studio-tf9jryb1.js +10 -0
  123. package/dist/chunks/studio-tfkznv39.js +5 -0
  124. package/dist/chunks/studio-tft6r105.js +5 -0
  125. package/dist/chunks/studio-txf2kysx.js +5 -0
  126. package/dist/chunks/studio-v8867ddv.js +12 -0
  127. package/dist/chunks/studio-vxq7fcvv.js +5 -0
  128. package/dist/chunks/studio-w4rz9hdk.js +5 -0
  129. package/dist/chunks/studio-wbcjbhy1.js +9 -0
  130. package/dist/chunks/studio-wc649wss.js +5 -0
  131. package/dist/chunks/studio-wys23mxz.js +5 -0
  132. package/dist/chunks/studio-x1x167jh.js +5 -0
  133. package/dist/chunks/studio-x9hsze61.js +5 -0
  134. package/dist/chunks/studio-y0n7yxea.js +9 -0
  135. package/dist/chunks/studio-y3ahhdpx.js +5 -0
  136. package/dist/chunks/studio-z97c48fk.js +5 -0
  137. package/dist/chunks/studio-zat62m0c.js +5 -0
  138. package/dist/chunks/studio-zcd2e7yz.js +5 -0
  139. package/dist/chunks/studio-zz9qe3rw.js +64 -0
  140. package/dist/chunks/toast-1gv0h53h.js +4 -0
  141. package/dist/chunks/{toast-host-ke5z4ng7.js → toast-host-1yg5ar8d.js} +3 -3
  142. package/dist/chunks/{tooltip-5v8ngwj2.js → tooltip-yypz28gq.js} +3 -3
  143. package/dist/chunks/{tree-mdq3v5cw.js → tree-9xa4hm7n.js} +2 -2
  144. package/dist/chunks/tsMode-epyfz1hv.js +14 -0
  145. package/dist/chunks/workspace-dz7nxfhv.js +4 -0
  146. package/dist/chunks/workspace-home-xsd7hkjw.js +4 -0
  147. package/dist/chunks/{ws-client-nze0k6mv.js → ws-client-bv552sfx.js} +3 -3
  148. package/dist/iframe-entry.js +20 -16
  149. package/dist/manifest.json +77 -63
  150. package/dist/studio.js +103 -104
  151. package/dist/workers/ts.worker.js +3 -3
  152. package/package.json +12 -11
  153. package/src/browse/component-examples.ts +272 -0
  154. package/src/browse/library-commands.ts +64 -104
  155. package/src/browse/library-layouts.ts +263 -49
  156. package/src/browse/library-model.ts +181 -133
  157. package/src/browse/library-pane.ts +738 -446
  158. package/src/browse/library-preview.ts +149 -19
  159. package/src/browse/library-source.ts +308 -41
  160. package/src/browse/preview-root.ts +78 -0
  161. package/src/browse/preview-style.ts +155 -0
  162. package/src/canvas/asset-refs.ts +16 -1
  163. package/src/canvas/canvas-live-render.ts +222 -30
  164. package/src/canvas/canvas-origin.ts +37 -12
  165. package/src/canvas/canvas-page-context.ts +112 -0
  166. package/src/canvas/canvas-render.ts +113 -107
  167. package/src/canvas/canvas-utils.ts +57 -12
  168. package/src/canvas/iframe-drop.ts +107 -0
  169. package/src/canvas/iframe-entry.ts +24 -12
  170. package/src/canvas/iframe-host.ts +134 -62
  171. package/src/canvas/iframe-keys.ts +11 -0
  172. package/src/canvas/iframe-patch.ts +8 -7
  173. package/src/canvas/iframe-protocol.ts +24 -5
  174. package/src/canvas/iframe-render.ts +48 -1
  175. package/src/canvas/iframe-subtree.ts +5 -2
  176. package/src/canvas/npm-modules.ts +22 -0
  177. package/src/canvas/preview-navigate.ts +16 -0
  178. package/src/canvas/repeater-sources.ts +200 -0
  179. package/src/canvas/stage-scrollbar.ts +5 -1
  180. package/src/canvas/surface-registry.ts +6 -0
  181. package/src/commands/app-commands.ts +16 -6
  182. package/src/commands/budget.ts +10 -8
  183. package/src/commands/context.ts +35 -10
  184. package/src/commands/defaults.ts +69 -45
  185. package/src/commands/keymap.ts +9 -0
  186. package/src/commands/levels.ts +11 -5
  187. package/src/commands/live-context.ts +2 -0
  188. package/src/commands/registry.ts +10 -1
  189. package/src/content/collection-match.ts +6 -5
  190. package/src/content/collection-pages.ts +412 -0
  191. package/src/content/content-collections.ts +270 -0
  192. package/src/content/entry-commands.ts +51 -60
  193. package/src/content/entry-editor.ts +111 -18
  194. package/src/content/entry-fields.ts +13 -1
  195. package/src/content/entry-inspector.ts +225 -0
  196. package/src/content/entry-model.ts +17 -3
  197. package/src/content/entry-open.ts +80 -0
  198. package/src/content/entry-summaries.ts +440 -0
  199. package/src/content/file-record-ids.ts +80 -0
  200. package/src/content/file-records.ts +125 -0
  201. package/src/content/page-summaries.ts +129 -0
  202. package/src/content/record-entry.ts +201 -0
  203. package/src/content/writing-banner.ts +177 -0
  204. package/src/create/add-new-commands.ts +185 -0
  205. package/src/create/add-new-flow.ts +1116 -0
  206. package/src/create/add-new.ts +1014 -0
  207. package/src/create/element-name.ts +121 -0
  208. package/src/editor/convert-to-component.ts +67 -43
  209. package/src/editor/file-drop-action.ts +9 -1
  210. package/src/editor/inline-edit-apply.ts +44 -0
  211. package/src/editor/inline-edit.ts +10 -0
  212. package/src/editor/insert-component.ts +91 -0
  213. package/src/editor/insert-zone-action.ts +13 -4
  214. package/src/editor/shortcuts.ts +44 -22
  215. package/src/editor/slash-menu.ts +51 -8
  216. package/src/files/components.ts +74 -10
  217. package/src/files/file-ops.ts +15 -5
  218. package/src/files/files.ts +164 -150
  219. package/src/files/fs-events.ts +18 -7
  220. package/src/files/media-meta.ts +95 -1
  221. package/src/files/media-types.ts +55 -0
  222. package/src/files/media-upload.ts +209 -52
  223. package/src/files/new-file-name.ts +156 -0
  224. package/src/files/serialize-document.ts +13 -3
  225. package/src/format/format-host.ts +15 -0
  226. package/src/github/github-auth.ts +2 -2
  227. package/src/github/github-publish.ts +4 -3
  228. package/src/grid/grid-controller.ts +5 -1
  229. package/src/grid/grid-open.ts +0 -27
  230. package/src/grid/grid-panel.ts +54 -2
  231. package/src/grid/grid-reveal.ts +34 -0
  232. package/src/grid/grid-source.ts +3 -25
  233. package/src/grid/grid-view.ts +31 -6
  234. package/src/grid/sources/content-source.ts +75 -7
  235. package/src/grid/tabulator-tables.d.ts +6 -0
  236. package/src/hosting/document.ts +2 -2
  237. package/src/i18n/i18n-commands.ts +2 -1
  238. package/src/media/media-commands.ts +181 -0
  239. package/src/media/media-library-model.ts +232 -0
  240. package/src/media/media-library.ts +1283 -0
  241. package/src/media/media-pane.ts +47 -19
  242. package/src/packages/pull-package-sync.ts +1 -1
  243. package/src/panels/activity-panel.ts +21 -5
  244. package/src/panels/ai-chat/chat-markdown.ts +8 -8
  245. package/src/panels/block-action-bar.ts +11 -11
  246. package/src/panels/canvas-dnd-bridge.ts +5 -2
  247. package/src/panels/chat-panel.ts +6 -6
  248. package/src/panels/collections-panel.ts +306 -0
  249. package/src/panels/component-preview.ts +35 -13
  250. package/src/panels/data-explorer.ts +1 -1
  251. package/src/panels/data-grid.ts +4 -0
  252. package/src/panels/dnd.ts +17 -30
  253. package/src/panels/elements-panel.ts +9 -2
  254. package/src/panels/empty-state.ts +2 -2
  255. package/src/panels/formula-workspace.ts +2 -3
  256. package/src/panels/frontmatter-fields.ts +9 -9
  257. package/src/panels/git-diff-open.ts +9 -5
  258. package/src/panels/head-panel.ts +369 -103
  259. package/src/panels/i18n-panel.ts +11 -10
  260. package/src/panels/imports-panel.ts +2 -0
  261. package/src/panels/jump-bar.ts +27 -2
  262. package/src/panels/layers-panel.ts +36 -30
  263. package/src/panels/left-panel.ts +22 -8
  264. package/src/panels/navigator-panels.ts +23 -11
  265. package/src/panels/pane-context.ts +111 -29
  266. package/src/panels/pane-grid.ts +6 -6
  267. package/src/panels/panel-registry.ts +14 -9
  268. package/src/panels/properties-panel.ts +7 -3
  269. package/src/panels/right-panel.ts +199 -43
  270. package/src/panels/seo-modal.ts +41 -108
  271. package/src/panels/settings-menu.ts +52 -50
  272. package/src/panels/settings-pane.ts +268 -162
  273. package/src/panels/signals-panel.ts +3 -4
  274. package/src/panels/site-model.ts +367 -0
  275. package/src/panels/site-panel.ts +638 -0
  276. package/src/panels/style-panel.ts +37 -3
  277. package/src/panels/stylebook-doc.ts +142 -10
  278. package/src/panels/stylebook-layers-panel.ts +39 -80
  279. package/src/panels/stylebook-panel.ts +47 -10
  280. package/src/panels/styles-panel.ts +327 -0
  281. package/src/panels/tab-strip.ts +109 -25
  282. package/src/platform.ts +1 -1
  283. package/src/platforms/cloud.ts +28 -1
  284. package/src/platforms/default-platform.ts +4 -4
  285. package/src/platforms/devserver.ts +51 -25
  286. package/src/publish/deploy-checklist.ts +12 -7
  287. package/src/publish/pages-service.ts +38 -14
  288. package/src/publish/publish-changes.ts +491 -0
  289. package/src/publish/publish-commands.ts +83 -18
  290. package/src/publish/publish-ids.ts +49 -0
  291. package/src/publish/publish-quick.ts +148 -0
  292. package/src/publish/publish-workspace.ts +926 -0
  293. package/src/publish/source-control.ts +907 -0
  294. package/src/services/automation.ts +16 -20
  295. package/src/services/cf-settings.ts +4 -4
  296. package/src/services/connection.ts +2 -2
  297. package/src/services/directory-picker.ts +2 -2
  298. package/src/services/references.ts +0 -0
  299. package/src/services/render-critic.ts +21 -2
  300. package/src/services/settings/definitions.ts +25 -14
  301. package/src/settings/contributed-section.ts +49 -10
  302. package/src/settings/css-vars-editor.ts +93 -27
  303. package/src/settings/developer-panels.ts +43 -0
  304. package/src/settings/extension-sections.ts +20 -2
  305. package/src/settings/general-settings.ts +91 -21
  306. package/src/settings/preferences-dialog.ts +8 -1
  307. package/src/settings/project-sections.ts +27 -10
  308. package/src/settings/schema-field-ui.ts +3 -1
  309. package/src/settings/section-registry.ts +116 -11
  310. package/src/settings/settings-dialog.ts +192 -0
  311. package/src/settings/settings-document.ts +182 -162
  312. package/src/shell.ts +467 -431
  313. package/src/site-context.ts +64 -10
  314. package/src/state.ts +28 -9
  315. package/src/studio.ts +194 -41
  316. package/src/style/project-styles.ts +34 -0
  317. package/src/style/stylebook-specimens.ts +89 -0
  318. package/src/style/stylebook-target.ts +26 -0
  319. package/src/style/tag-inheritance.ts +105 -0
  320. package/src/style/variables-focus.ts +61 -0
  321. package/src/style/variables-view.ts +235 -0
  322. package/src/surfaces/add-new.json +1482 -0
  323. package/src/surfaces/add-new.ts +325 -0
  324. package/src/surfaces/ai-chat.ts +2 -2
  325. package/src/surfaces/boot-failure.json +4 -3
  326. package/src/surfaces/bottom-dock.json +1 -1
  327. package/src/surfaces/canvas-stage.json +30 -19
  328. package/src/surfaces/canvas-stage.ts +5 -5
  329. package/src/surfaces/collections-panel.json +615 -0
  330. package/src/surfaces/collections-panel.ts +168 -0
  331. package/src/surfaces/commandbar.json +241 -96
  332. package/src/surfaces/commandbar.ts +134 -99
  333. package/src/surfaces/empty-state.json +1 -1
  334. package/src/surfaces/entry-editor.json +136 -0
  335. package/src/surfaces/entry-editor.ts +21 -0
  336. package/src/surfaces/entry-inspector.json +371 -0
  337. package/src/surfaces/entry-inspector.ts +143 -0
  338. package/src/surfaces/inspector-dock.json +162 -14
  339. package/src/surfaces/inspector-dock.ts +46 -19
  340. package/src/surfaces/library-pane.json +670 -437
  341. package/src/surfaces/library-pane.ts +94 -59
  342. package/src/surfaces/media-browser.json +62 -6
  343. package/src/surfaces/media-browser.ts +15 -1
  344. package/src/surfaces/media-field.json +1 -1
  345. package/src/surfaces/media-library.json +1586 -0
  346. package/src/surfaces/media-library.ts +282 -0
  347. package/src/surfaces/media-pick-dialog.json +71 -0
  348. package/src/surfaces/media-pick-dialog.ts +132 -0
  349. package/src/surfaces/menu.ts +18 -0
  350. package/src/surfaces/pane-context.json +144 -77
  351. package/src/surfaces/pane-context.ts +24 -0
  352. package/src/surfaces/panel-deploy-checklist.json +12 -6
  353. package/src/surfaces/panel-deploy-checklist.ts +3 -1
  354. package/src/surfaces/panel-page.json +72 -2
  355. package/src/surfaces/panel-page.ts +38 -7
  356. package/src/surfaces/panel-signals.json +1 -1
  357. package/src/surfaces/panel-signals.ts +5 -5
  358. package/src/surfaces/panel-stylebook-layers.json +71 -204
  359. package/src/surfaces/panel-stylebook-layers.ts +0 -21
  360. package/src/surfaces/preferences.json +120 -48
  361. package/src/surfaces/preferences.ts +8 -0
  362. package/src/surfaces/publish-quick.json +428 -0
  363. package/src/surfaces/publish-quick.ts +165 -0
  364. package/src/surfaces/publish-workspace.json +2892 -0
  365. package/src/surfaces/publish-workspace.ts +391 -0
  366. package/src/surfaces/rail.json +1 -159
  367. package/src/surfaces/rail.ts +18 -75
  368. package/src/surfaces/schema-form.json +10 -2
  369. package/src/surfaces/schema-form.ts +2 -0
  370. package/src/surfaces/seo.json +1 -1
  371. package/src/surfaces/settings-contributed.json +5 -5
  372. package/src/surfaces/settings-contributed.ts +18 -2
  373. package/src/surfaces/settings-css-vars.json +44 -36
  374. package/src/surfaces/settings-css-vars.ts +77 -4
  375. package/src/surfaces/settings-deploy.json +2 -15
  376. package/src/surfaces/settings-deploy.ts +1 -1
  377. package/src/surfaces/settings-dialog.json +51 -0
  378. package/src/surfaces/settings-dialog.ts +169 -0
  379. package/src/surfaces/settings-overview.json +3 -3
  380. package/src/surfaces/settings-overview.ts +9 -2
  381. package/src/surfaces/settings-pane.json +269 -46
  382. package/src/surfaces/settings-pane.ts +85 -24
  383. package/src/surfaces/shell.json +2 -1
  384. package/src/surfaces/site-panel.json +1029 -0
  385. package/src/surfaces/site-panel.ts +233 -0
  386. package/src/surfaces/slash-menu.json +63 -21
  387. package/src/surfaces/slash-menu.ts +23 -0
  388. package/src/surfaces/statusbar.ts +39 -15
  389. package/src/surfaces/styles-panel.json +735 -0
  390. package/src/surfaces/styles-panel.ts +195 -0
  391. package/src/surfaces/styles-variables.json +149 -0
  392. package/src/surfaces/styles-variables.ts +145 -0
  393. package/src/surfaces/tab-strip.json +4 -4
  394. package/src/surfaces/welcome.ts +1 -1
  395. package/src/surfaces/writing-banner.json +94 -0
  396. package/src/surfaces/writing-banner.ts +80 -0
  397. package/src/tabs/bare-repeaters.ts +101 -0
  398. package/src/tabs/tab.ts +47 -7
  399. package/src/types.ts +21 -26
  400. package/src/ui/form-controls.ts +47 -8
  401. package/src/ui/layers.ts +13 -0
  402. package/src/ui/media-picker.ts +284 -40
  403. package/src/ui/regions.ts +7 -6
  404. package/src/ui/schema-form.ts +259 -27
  405. package/src/ui/virtual-window.ts +26 -1
  406. package/src/utils/base64.ts +3 -3
  407. package/src/utils/edit-display.ts +322 -67
  408. package/src/utils/local-day.ts +18 -0
  409. package/src/workspace/pane-derive.ts +4 -4
  410. package/src/workspace/session.ts +28 -7
  411. package/src/workspace/tab-workspace.ts +137 -0
  412. package/src/workspace/workspace-back.ts +189 -0
  413. package/src/workspace/workspace-home.ts +133 -0
  414. package/src/workspace/workspace-ids.ts +129 -0
  415. package/src/workspace/workspace-switch.ts +372 -0
  416. package/src/workspace/workspace.ts +125 -11
  417. package/styles/shell-frame.css +30 -7
  418. package/styles/shell-frame.json +15 -3
  419. package/dist/chunks/2020-f2gkpy8d.js +0 -4
  420. package/dist/chunks/adapter-4912g339.js +0 -4
  421. package/dist/chunks/cf-account-picker-wccaenh6.js +0 -4
  422. package/dist/chunks/cf-settings-br6105tr.js +0 -4
  423. package/dist/chunks/color-28ksk2qm.js +0 -4
  424. package/dist/chunks/components-db68vsn7.js +0 -4
  425. package/dist/chunks/content-source-1449qesq.js +0 -4
  426. package/dist/chunks/convert-to-repeater-5h457egj.js +0 -4
  427. package/dist/chunks/editor-x9jn86a7.js +0 -4
  428. package/dist/chunks/entry-commands-may24cpt.js +0 -4
  429. package/dist/chunks/extension-sections-pvr14vxr.js +0 -4
  430. package/dist/chunks/file-ops-x9v54pcj.js +0 -4
  431. package/dist/chunks/files-j3knqf0s.js +0 -4
  432. package/dist/chunks/format-host-tyre2trb.js +0 -4
  433. package/dist/chunks/fs-events-64ma9htc.js +0 -4
  434. package/dist/chunks/git-panel-84ps5dex.js +0 -4
  435. package/dist/chunks/iframe-entry-fvbk89gm.js +0 -5
  436. package/dist/chunks/iframe-host-ck6vejt5.js +0 -4
  437. package/dist/chunks/index-b8xw3vy9.js +0 -4
  438. package/dist/chunks/jsonMode-w15cmrcm.js +0 -13
  439. package/dist/chunks/jx-validate-at3zn8wa.js +0 -4
  440. package/dist/chunks/layers-h4xp1pss.js +0 -4
  441. package/dist/chunks/layers-panel-m5hw1d7g.js +0 -4
  442. package/dist/chunks/lit-html-8t8t3dnr.js +0 -4
  443. package/dist/chunks/media-picker-2cweexc5.js +0 -4
  444. package/dist/chunks/menu-ynw13y0s.js +0 -4
  445. package/dist/chunks/monaco-buffer-qzxn567r.js +0 -4
  446. package/dist/chunks/monaco-setup-gxf6656g.js +0 -4
  447. package/dist/chunks/notify-cj5zbrs2.js +0 -4
  448. package/dist/chunks/parse-b7ddhr8m.js +0 -4
  449. package/dist/chunks/platform-3dfws9js.js +0 -4
  450. package/dist/chunks/popover-jt2gxmzs.js +0 -4
  451. package/dist/chunks/publish-panel-1gvxbj21.js +0 -4
  452. package/dist/chunks/quick-search-0dajrwqg.js +0 -4
  453. package/dist/chunks/references-49qgt404.js +0 -4
  454. package/dist/chunks/right-panel-jm1bwe53.js +0 -4
  455. package/dist/chunks/section-registry-6kwc4fky.js +0 -4
  456. package/dist/chunks/studio-0rt52vpq.js +0 -5
  457. package/dist/chunks/studio-18vgbhs5.js +0 -5
  458. package/dist/chunks/studio-24mccdrj.js +0 -5
  459. package/dist/chunks/studio-2eh507zk.js +0 -9
  460. package/dist/chunks/studio-2hcbccfv.js +0 -5
  461. package/dist/chunks/studio-2jbs3rxv.js +0 -5
  462. package/dist/chunks/studio-4h8k4dw9.js +0 -5
  463. package/dist/chunks/studio-5f6n18kx.js +0 -5
  464. package/dist/chunks/studio-5gthpky6.js +0 -5
  465. package/dist/chunks/studio-6ep3js6b.js +0 -9
  466. package/dist/chunks/studio-6wkmf3wz.js +0 -9
  467. package/dist/chunks/studio-841rf3cg.js +0 -5
  468. package/dist/chunks/studio-8gmwgheg.js +0 -5
  469. package/dist/chunks/studio-8qm0ep50.js +0 -5
  470. package/dist/chunks/studio-924p1tm1.js +0 -6
  471. package/dist/chunks/studio-a3shpz9y.js +0 -5
  472. package/dist/chunks/studio-amsbaaar.js +0 -6
  473. package/dist/chunks/studio-at5spjbc.js +0 -7
  474. package/dist/chunks/studio-b2xv945e.js +0 -5
  475. package/dist/chunks/studio-bn5nkafw.js +0 -5
  476. package/dist/chunks/studio-bw6q5xjf.js +0 -9
  477. package/dist/chunks/studio-c7q0t9x1.js +0 -5
  478. package/dist/chunks/studio-camnhc96.js +0 -6
  479. package/dist/chunks/studio-cffqvnzd.js +0 -5
  480. package/dist/chunks/studio-efvfrsf8.js +0 -5
  481. package/dist/chunks/studio-er30bpcx.js +0 -5
  482. package/dist/chunks/studio-ezscgr64.js +0 -5
  483. package/dist/chunks/studio-ffrrncvz.js +0 -5
  484. package/dist/chunks/studio-fpphgn8y.js +0 -10
  485. package/dist/chunks/studio-j1kvhdjk.js +0 -4
  486. package/dist/chunks/studio-j430n16g.js +0 -7
  487. package/dist/chunks/studio-jjkg84nj.js +0 -5
  488. package/dist/chunks/studio-m0q32ars.js +0 -4
  489. package/dist/chunks/studio-m6bdst11.js +0 -5
  490. package/dist/chunks/studio-nv2cptd4.js +0 -64
  491. package/dist/chunks/studio-nwfrc98n.js +0 -5
  492. package/dist/chunks/studio-p1wgvp7r.js +0 -5
  493. package/dist/chunks/studio-pag2wncm.js +0 -5
  494. package/dist/chunks/studio-qvanvzfd.js +0 -5
  495. package/dist/chunks/studio-qwa64kt7.js +0 -5
  496. package/dist/chunks/studio-rk1zc4x3.js +0 -928
  497. package/dist/chunks/studio-se2r3ptc.js +0 -5
  498. package/dist/chunks/studio-sg2a0dh0.js +0 -5
  499. package/dist/chunks/studio-tjzjhe68.js +0 -5
  500. package/dist/chunks/studio-v2w7q8r1.js +0 -7
  501. package/dist/chunks/studio-v5vjq1h0.js +0 -4
  502. package/dist/chunks/studio-v8aga3vp.js +0 -14
  503. package/dist/chunks/studio-vfcdrfmv.js +0 -5
  504. package/dist/chunks/studio-vmfkgdjf.js +0 -5
  505. package/dist/chunks/studio-wt1816jj.js +0 -5
  506. package/dist/chunks/studio-wz73q5kq.js +0 -4
  507. package/dist/chunks/studio-y04qtxvp.js +0 -7
  508. package/dist/chunks/studio-y21g8zzg.js +0 -5
  509. package/dist/chunks/studio-y64hrt8p.js +0 -12
  510. package/dist/chunks/studio-ynn90f58.js +0 -16
  511. package/dist/chunks/studio-yxz682sx.js +0 -5
  512. package/dist/chunks/studio-zp7snvkq.js +0 -5
  513. package/dist/chunks/studio-zq4z6tm6.js +0 -5
  514. package/dist/chunks/toast-c9fn075p.js +0 -4
  515. package/dist/chunks/tsMode-sf49ee9x.js +0 -14
  516. package/dist/chunks/workspace-jtfahpee.js +0 -4
  517. package/src/panels/frontmatter-panel.ts +0 -711
  518. package/src/panels/git-panel.ts +0 -1108
  519. package/src/surfaces/doc-header.json +0 -776
  520. package/src/surfaces/doc-header.ts +0 -222
  521. package/src/surfaces/git-panel.json +0 -1880
  522. package/src/surfaces/git-panel.ts +0 -264
@@ -0,0 +1,4 @@
1
+ import{Z}from"./studio-vxq7fcvv.js";function q(e){let t=Object.create(null);for(let n of e.split(","))t[n]=1;return(n)=>(n in t)}var F=Object.assign;var Ke=Object.prototype.hasOwnProperty,j=(e,t)=>Ke.call(e,t),A=Array.isArray,k=(e)=>me(e)==="[object Map]";var de=(e)=>typeof e==="function",ze=(e)=>typeof e==="string",O=(e)=>typeof e==="symbol",R=(e)=>e!==null&&typeof e==="object";var We=Object.prototype.toString,me=(e)=>We.call(e),_e=(e)=>me(e).slice(8,-1);var H=(e)=>ze(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e;var U=(e)=>{let t=Object.create(null);return(n)=>t[n]||(t[n]=e(n))},Ge=/-\w/g,_t=U((e)=>e.replace(Ge,(t)=>t.slice(1).toUpperCase())),$e=/\B([A-Z])/g,yt=U((e)=>e.replace($e,"-$1").toLowerCase()),ye=U((e)=>e.charAt(0).toUpperCase()+e.slice(1)),vt=U((e)=>e?`on${ye(e)}`:""),E=(e,t)=>!Object.is(e,t);var Ye="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly";var Et=q(Ye+",async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");var d;class Se{constructor(e=!1){if(this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!e&&d)if(d.active)this.parent=d,this.index=(d.scopes||(d.scopes=[])).push(this)-1;else this._active=!1,this._warnOnRun=!1}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes){let n=this.scopes.slice();for(e=0,t=n.length;e<t;e++)n[e].pause()}for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active){if(this._isPaused){this._isPaused=!1;let e,t;if(this.scopes){let r=this.scopes.slice();for(e=0,t=r.length;e<t;e++)r[e].resume()}let n=this.effects.slice();for(e=0,t=n.length;e<t;e++)n[e].resume()}}}run(e){if(this._active){let t=d;try{return d=this,e()}finally{d=t}}}on(){if(++this._on===1)this.prevScope=d,d=this}off(){if(this._on>0&&--this._on===0){if(d===this)d=this.prevScope;else{let e=d;while(e){if(e.prevScope===this){e.prevScope=this.prevScope;break}e=e.prevScope}}this.prevScope=void 0}}stop(e){if(this._active){this._active=!1;let t,n;for(t=0,n=this.effects.length;t<n;t++)this.effects[t].stop();this.effects.length=0;for(t=0,n=this.cleanups.length;t<n;t++)this.cleanups[t]();if(this.cleanups.length=0,this.scopes){let r=this.scopes.slice();for(t=0,n=r.length;t<n;t++)r[t].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){let r=this.parent.scopes.pop();if(r&&r!==this)this.parent.scopes[this.index]=r,r.index=this.index}this.parent=void 0}}}function ge(e){return new Se(e)}function ta(e,t=!1){if(d)d.cleanups.push(e)}var f;var X=new WeakSet;class W{constructor(e){if(this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,d)if(d.active)d.effects.push(this);else this.flags&=-2}pause(){this.flags|=64}resume(){if(this.flags&64){if(this.flags&=-65,X.has(this))X.delete(this),this.trigger()}}notify(){if(this.flags&2&&!(this.flags&32))return;if(!(this.flags&8))Te(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,ve(this),Ne(this);let e=f,t=_;f=this,_=!0;try{return this.fn()}finally{xe(this),f=e,_=t,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)ae(e);this.deps=this.depsTail=void 0,ve(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){if(this.flags&64)X.add(this);else if(this.scheduler)this.scheduler();else this.runIfDirty()}runIfDirty(){if(ee(this))this.run()}get dirty(){return ee(this)}}var we=0,M,L;function Te(e,t=!1){if(e.flags|=8,t){e.next=L,L=e;return}e.next=M,M=e}function se(){we++}function oe(){if(--we>0)return;if(L){let t=L;L=void 0;while(t){let n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;while(M){let t=M;M=void 0;while(t){let n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(r){if(!e)e=r}t=n}}if(e)throw e}function Ne(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function xe(e){let t,n=e.depsTail,r=n;while(r){let i=r.prevDep;if(r.version===-1){if(r===n)n=i;ae(r),Be(r)}else t=r;r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=i}e.deps=t,e.depsTail=n}function ee(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Ae(t.dep.computed)||t.dep.version!==t.version))return!0;if(e._dirty)return!0;return!1}function Ae(e){if(e.flags&4&&!(e.flags&16))return;if(e.flags&=-17,e.globalVersion===P)return;if(e.globalVersion=P,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!ee(e)))return;e.flags|=2;let t=e.dep,n=f,r=_;f=e,_=!0;try{Ne(e);let i=e.fn(e._value);if(t.version===0||E(i,e._value))e.flags|=128,e._value=i,t.version++}catch(i){throw t.version++,i}finally{f=n,_=r,xe(e),e.flags&=-3}}function ae(e,t=!1){let{dep:n,prevSub:r,nextSub:i}=e;if(r)r.nextSub=i,e.prevSub=void 0;if(i)i.prevSub=r,e.nextSub=void 0;if(n.subs===e){if(n.subs=r,!r&&n.computed){n.computed.flags&=-5;for(let s=n.computed.deps;s;s=s.nextDep)ae(s,!0)}}if(!t&&!--n.sc&&n.map)n.map.delete(n.key)}function Be(e){let{prevDep:t,nextDep:n}=e;if(t)t.nextDep=n,e.prevDep=void 0;if(n)n.prevDep=t,e.nextDep=void 0}function ne(e,t){if(e.effect instanceof W)e=e.effect.fn;let n=new W(e);if(t)F(n,t);try{n.run()}catch(i){throw n.stop(),i}let r=n.run.bind(n);return r.effect=n,r}var _=!0,Oe=[];function Jr(){Oe.push(_),_=!1}function Yr(){let e=Oe.pop();_=e===void 0?!0:e}function WC(e,t=!1){if(f instanceof W)f.cleanup=e}function ve(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let n=f;f=void 0;try{t()}finally{f=n}}}var P=0;class Re{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Y{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!f||!_||f===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==f){if(t=this.activeLink=new Re(f,this),!f.deps)f.deps=f.depsTail=t;else t.prevDep=f.depsTail,f.depsTail.nextDep=t,f.depsTail=t;De(t)}else if(t.version===-1){if(t.version=this.version,t.nextDep){let n=t.nextDep;if(n.prevDep=t.prevDep,t.prevDep)t.prevDep.nextDep=n;if(t.prevDep=f.depsTail,t.nextDep=void 0,f.depsTail.nextDep=t,f.depsTail=t,f.deps===t)f.deps=n}}return t}trigger(e){this.version++,P++,this.notify(e)}notify(e){se();try{for(let t=this.subs;t;t=t.prevSub)if(t.sub.notify())t.sub.dep.notify()}finally{oe()}}}function De(e){if(e.dep.sc++,e.sub.flags&4){let t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let r=t.deps;r;r=r.nextDep)De(r)}let n=e.dep.subs;if(n!==e){if(e.prevSub=n,n)n.nextSub=e}e.dep.subs=e}}var te=new WeakMap,N=Symbol(""),ie=Symbol(""),V=Symbol("");function h(e,t,n){if(_&&f){let r=te.get(e);if(!r)te.set(e,r=new Map);let i=r.get(n);if(!i)r.set(n,i=new Y),i.map=r,i.key=n;i.track()}}function w(e,t,n,r,i,s){let o=te.get(e);if(!o){P++;return}let a=(c)=>{if(c)c.trigger()};if(se(),t==="clear")o.forEach(a);else{let c=A(e),l=c&&H(n);if(c&&n==="length"){let u=Number(r);o.forEach((p,m)=>{if(m==="length"||m===V||!O(m)&&m>=u)a(p)})}else{if(n!==void 0||o.has(void 0))a(o.get(n));if(l)a(o.get(V));switch(t){case"add":if(!c){if(a(o.get(N)),k(e))a(o.get(ie))}else if(l)a(o.get("length"));break;case"delete":if(!c){if(a(o.get(N)),k(e))a(o.get(ie))}break;case"set":if(k(e))a(o.get(N));break}}}oe()}function D(e){let t=he(e);if(t===e)return t;if(h(t,"iterate",V),T(e))return t;if(!S(e))return t.map(v);return _v(e)?t.map((n)=>x(v(n))):t.map(x)}function ce(e){return h(e=he(e),"iterate",V),e}function y(e,t){if(S(e))return _v(e)?x(v(t)):x(t);return v(t)}var qe={__proto__:null,[Symbol.iterator](){return J(this,Symbol.iterator,(e)=>y(this,e))},concat(...e){return D(this).concat(...e.map((t)=>A(t)?D(t):t))},entries(){return J(this,"entries",(e)=>(e[1]=y(this,e[1]),e))},every(e,t){return b(this,"every",e,t,void 0,arguments)},filter(e,t){return b(this,"filter",e,t,(n)=>n.map((r)=>y(this,r)),arguments)},find(e,t){return b(this,"find",e,t,(n)=>y(this,n),arguments)},findIndex(e,t){return b(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return b(this,"findLast",e,t,(n)=>y(this,n),arguments)},findLastIndex(e,t){return b(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return b(this,"forEach",e,t,void 0,arguments)},includes(...e){return Q(this,"includes",e)},indexOf(...e){return Q(this,"indexOf",e)},join(e){return D(this).join(e)},lastIndexOf(...e){return Q(this,"lastIndexOf",e)},map(e,t){return b(this,"map",e,t,void 0,arguments)},pop(){return I(this,"pop")},push(...e){return I(this,"push",e)},reduce(e,...t){return be(this,"reduce",e,t)},reduceRight(e,...t){return be(this,"reduceRight",e,t)},shift(){return I(this,"shift")},some(e,t){return b(this,"some",e,t,void 0,arguments)},splice(...e){return I(this,"splice",e)},toReversed(){return D(this).toReversed()},toSorted(e){return D(this).toSorted(e)},toSpliced(...e){return D(this).toSpliced(...e)},unshift(...e){return I(this,"unshift",e)},values(){return J(this,"values",(e)=>y(this,e))}};function J(e,t,n){let r=ce(e),i=r[t],s=i.call(r);if(r!==e&&!T(e)){if(s[Symbol.toStringTag]==="Array Iterator"){let o=Object.create(Object.getPrototypeOf(s));if(o.next=()=>Ee(s.next(),n),i!==ke[t])Object.defineProperties(o,{return:{get(){let a=s.return;return typeof a==="function"?a.bind(s):a}},throw:{get(){let a=s.throw;return typeof a==="function"?a.bind(s):a}}});return o}s._next=s.next,s.next=()=>Ee(s._next(),n)}return s}function Ee(e,t){if(!e.done)e.value=t(e.value);return e}var ke=Array.prototype;function b(e,t,n,r,i,s){let o=ce(e),a=o!==e&&!T(e),c=o[t];if(c!==ke[t]){let p=c.apply(e,s);return a?v(p):p}let l=n;if(o!==e){if(a)l=function(p,m){return n.call(this,y(e,p),m,e)};else if(n.length>2)l=function(p,m){return n.call(this,p,m,e)}}let u=c.call(o,l,r);return a&&i?i(u):u}function be(e,t,n,r){let i=ce(e),s=i!==e&&!T(e),o=n,a=!1;if(i!==e){if(s)a=r.length===0,o=function(l,u,p){if(a)a=!1,l=y(e,l);return n.call(this,l,y(e,u),p,e)};else if(n.length>3)o=function(l,u,p){return n.call(this,l,u,p,e)}}let c=i[t](o,...r);return a?y(e,c):c}function Q(e,t,n){let r=he(e);h(r,"iterate",V);let i=r[t](...n);if((i===-1||i===!1)&&ct(n[0]))return n[0]=he(n[0]),r[t](...n);return i}function I(e,t,n=[]){Jr(),se();let r=he(e)[t].apply(e,n);return oe(),Yr(),r}var Xe=q("__proto__,__v_isRef,__isVue"),Ce=new Set(Object.getOwnPropertyNames(Symbol).filter((e)=>e!=="arguments"&&e!=="caller").map((e)=>Symbol[e]).filter(O));function Je(e){if(!O(e))e=String(e);let t=he(this);return h(t,"has",e),t.hasOwnProperty(e)}class le{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if(t==="__v_skip")return e.__v_skip;let r=this._isReadonly,i=this._isShallow;if(t==="__v_isReactive")return!r;else if(t==="__v_isReadonly")return r;else if(t==="__v_isShallow")return i;else if(t==="__v_raw"){if(n===(r?i?ot:Pe:i?Le:Me).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n))return e;return}let s=A(e);if(!r){let a;if(s&&(a=qe[t]))return a;if(t==="hasOwnProperty")return Je}let o=Reflect.get(e,t,kh(e)?e:n);if(O(t)?Ce.has(t):Xe(t))return o;if(!r)h(e,"get",t);if(i)return o;if(kh(o)){let a=s&&H(t)?o:o.value;return r&&R(a)?G(a):a}if(R(o))return r?G(o):g(o);return o}}class fe extends le{constructor(e=!1){super(!1,e)}set(e,t,n,r){let i=e[t],s=A(e)&&H(t);if(!this._isShallow){let c=S(i);if(!T(n)&&!S(n))i=he(i),n=he(n);if(!s&&kh(i)&&!kh(n))if(c)return!0;else return i.value=n,!0}let o=s?Number(t)<e.length:j(e,t),a=Reflect.set(e,t,n,kh(e)?e:r);if(e===he(r)&&a){if(!o)w(e,"add",t,n);else if(E(n,i))w(e,"set",t,n,i)}return a}deleteProperty(e,t){let n=j(e,t),r=e[t],i=Reflect.deleteProperty(e,t);if(i&&n)w(e,"delete",t,void 0,r);return i}has(e,t){let n=Reflect.has(e,t);if(!O(t)||!Ce.has(t))h(e,"has",t);return n}ownKeys(e){return h(e,"iterate",A(e)?"length":N),Reflect.ownKeys(e)}}class Ie extends le{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}}var Ze=new fe,Qe=new Ie,et=new fe(!0);var re=(e)=>e,K=(e)=>Reflect.getPrototypeOf(e);function tt(e,t,n){return function(...r){let i=this.__v_raw,s=he(i),o=k(s),a=e==="entries"||e===Symbol.iterator&&o,c=e==="keys"&&o,l=i[e](...r),u=n?re:t?x:v;return!t&&h(s,"iterate",c?ie:N),F(Object.create(l),{next(){let{value:p,done:m}=l.next();return m?{value:p,done:m}:{value:a?[u(p[0]),u(p[1])]:u(p),done:m}}})}}function z(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function nt(e,t){let n={get(i){let s=this.__v_raw,o=he(s),a=he(i);if(!e){if(E(i,a))h(o,"get",i);h(o,"get",a)}let{has:c}=K(o),l=t?re:e?x:v;if(c.call(o,i))return l(s.get(i));else if(c.call(o,a))return l(s.get(a));else if(s!==o)s.get(i)},get size(){let i=this.__v_raw;return!e&&h(he(i),"iterate",N),i.size},has(i){let s=this.__v_raw,o=he(s),a=he(i);if(!e){if(E(i,a))h(o,"has",i);h(o,"has",a)}return i===a?s.has(i):s.has(i)||s.has(a)},forEach(i,s){let o=this,a=o.__v_raw,c=he(a),l=t?re:e?x:v;return!e&&h(c,"iterate",N),a.forEach((u,p)=>i.call(s,l(u),l(p),o))}};return F(n,e?{add:z("add"),set:z("set"),delete:z("delete"),clear:z("clear")}:{add(i){let s=he(this),o=K(s),a=he(i),c=!t&&!T(i)&&!S(i)?a:i;if(!(o.has.call(s,c)||E(i,c)&&o.has.call(s,i)||E(a,c)&&o.has.call(s,a)))s.add(c),w(s,"add",c,c);return this},set(i,s){if(!t&&!T(s)&&!S(s))s=he(s);let o=he(this),{has:a,get:c}=K(o),l=a.call(o,i);if(!l)i=he(i),l=a.call(o,i);let u=c.call(o,i);if(o.set(i,s),!l)w(o,"add",i,s);else if(E(s,u))w(o,"set",i,s,u);return this},delete(i){let s=he(this),{has:o,get:a}=K(s),c=o.call(s,i);if(!c)i=he(i),c=o.call(s,i);let l=a?a.call(s,i):void 0,u=s.delete(i);if(c)w(s,"delete",i,void 0,l);return u},clear(){let i=he(this),s=i.size!==0,o=void 0,a=i.clear();if(s)w(i,"clear",void 0,void 0,void 0);return a}}),["keys","values","entries",Symbol.iterator].forEach((i)=>{n[i]=tt(i,e,t)}),n}function ue(e,t){let n=nt(e,t);return(r,i,s)=>{if(i==="__v_isReactive")return!e;else if(i==="__v_isReadonly")return e;else if(i==="__v_isShallow")return t;else if(i==="__v_raw")return r;return Reflect.get(j(n,i)&&i in r?n:r,i,s)}}var it={get:ue(!1,!1)},rt={get:ue(!1,!0)},st={get:ue(!0,!1)};var Me=new WeakMap,Le=new WeakMap,Pe=new WeakMap,ot=new WeakMap;function at(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function g(e){if(S(e))return e;return pe(e,!1,Ze,it,Me)}function xv(e){return pe(e,!1,et,rt,Le)}function G(e){return pe(e,!0,Qe,st,Pe)}function pe(e,t,n,r,i){if(!R(e))return e;if(e.__v_raw&&!(t&&e.__v_isReactive))return e;if(e.__v_skip||!Object.isExtensible(e))return e;let s=i.get(e);if(s)return s;let o=at(_e(e));if(o===0)return e;let a=new Proxy(e,o===2?r:n);return i.set(e,a),a}function _v(e){if(S(e))return _v(e.__v_raw);return!!(e&&e.__v_isReactive)}function S(e){return!!(e&&e.__v_isReadonly)}function T(e){return!!(e&&e.__v_isShallow)}function ct(e){return e?!!e.__v_raw:!1}function he(e){let t=e&&e.__v_raw;return t?he(t):e}var v=(e)=>R(e)?g(e):e,x=(e)=>R(e)?G(e):e;function kh(e){return e?e.__v_isRef===!0:!1}function Eh(e){return Ve(e,!1)}function Na(e){return Ve(e,!0)}function Ve(e,t){if(kh(e))return e;return new Fe(e,t)}class Fe{constructor(e,t){this.dep=new Y,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:he(e),this._value=t?e:v(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){let t=this._rawValue,n=this.__v_isShallow||T(e)||S(e);if(e=n?e:he(e),E(e,t))this._rawValue=e,this._value=n?e:v(e),this.dep.trigger()}}class je{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new Y(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=P-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&f!==this)return Te(this,!0),!0}get value(){let e=this.dep.track();if(Ae(this),e)e.version=this.dep.version;return this._value}set value(e){if(this.setter)this.setter(e)}}function Th(e,t,n=!1){let r,i;if(de(e))r=e;else r=e.get,i=e.set;return new je(r,i,n)}var lt={assertive:"jx-live-assertive",polite:"jx-live-polite"};function ft(e){if(typeof document>"u")return null;let t=lt[e],n=document.querySelector(`#${t}`);if(n)return n;let r=document.createElement("div");return r.id=t,r.setAttribute("aria-live",e),r.setAttribute("role",e==="assertive"?"alert":"status"),r.setAttribute("aria-atomic","true"),r.style.cssText="position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;border:0",document.body.append(r),r}function qx(e,t="polite"){if(e==="")return;let n=ft(t);if(!n)return;n.textContent="",setTimeout(()=>{n.textContent=e},0)}var Qp=60000,He=null;function dr(){return He??Date.now()}function tM(e){let t=e instanceof Date?e.getTime():Z(e)?e:Date.parse(e);if(!Number.isFinite(t))throw TypeError(`clock: cannot pin to ${JSON.stringify(e)}`);return He=t,t}var ut={error:"problem",info:"toast",success:"toast",warn:"toast"},pt={error:8000,info:4000,success:4000,warn:8000},Ue=0;function dt(){return Ue+=1,`n${Ue}`}var eu=g([]),na=g([]),ht=4;function gt(e){return e==="problem"?na:eu}function mt(e,t,n,r){let i={at:dr(),id:dt(),message:t,severity:e,tier:n};if(r.action!==void 0)i.action=r.action;if(r.actionArgs!==void 0)i.actionArgs=r.actionArgs;if(r.detail!==void 0)i.detail=r.detail;if(r.source!==void 0)i.source=r.source;if(r.path!==void 0)i.path=r.path;if(r.key!==void 0)i.key=r.key;if(n==="toast")i.timeoutMs=r.timeoutMs??pt[e];return i}function C(e,t,n={}){let r=n.tier??ut[e],i=mt(e,t,r,n),s=gt(r);if(i.key!==void 0){let o=s.findIndex((a)=>a.key===i.key);if(o!==-1)s.splice(o,1)}if(s.push(i),r==="toast")while(eu.length>ht)eu.shift();return qx(i.source===void 0?i.message:`${i.source}: ${i.message}`,e==="error"?"assertive":"polite"),i}function B(e){return(t,n={})=>C(e,t,n)}C.success=B("success");C.info=B("info");C.warn=B("warn");C.error=B("error");function Lh(e){for(let t of[eu,na]){let n=t.findIndex((r)=>r.id===e);if(n!==-1)return t.splice(n,1),!0}return!1}function ul(e){let t=e?na.filter((r)=>!e(r)):[],n=na.length-t.length;return na.splice(0,na.length,...t),n}function ef(e){let t=[];for(let n of na){if(n.source!==e)continue;let r={message:n.message,severity:n.severity};if(n.detail!==void 0)r.detail=n.detail;if(n.path!==void 0)r.path=n.path;if(n.key!==void 0)r.key=n.key;if(n.action!==void 0)r.action=n.action;if(n.actionArgs!==void 0)r.actionArgs=n.actionArgs;t.push(r)}return t}function Sv(e){return e===void 0?na.length:na.filter((t)=>t.severity===e).length}export{ge,ta,ne,Jr,Yr,WC,g,xv,_v,he,kh,Eh,Na,Th,qx,Qp,dr,tM,eu,na,C,Lh,ul,ef,Sv};
2
+
3
+ //# debugId=5D546D094A64B68464756E2164756E21
4
+ //# sourceMappingURL=studio-43sd2mam.js.map
@@ -0,0 +1,5 @@
1
+ import{p,_e}from"./studio-w4rz9hdk.js";import{pt,Go,RA,Ap,px,Cr,NA,Op}from"./studio-s32578pn.js";import{C}from"./studio-43sd2mam.js";import{Zs,tt}from"./studio-x9hsze61.js";import{n,Z,Xe,te,v}from"./studio-vxq7fcvv.js";var l=null;async function Bd(){if(!_e()||!te(p().getAccountStatus)){l=null;return}try{l=await p().getAccountStatus?.()??null}catch{l=null}}function lC(){return l}function cC(){return l!==null&&l.installations.length===0&&Boolean(l.appInstallUrl)}function bA(){if(l===null)return null;let e=l.installations.flatMap((r)=>r.manageUrl?[{account:r.account??`Installation ${r.id}`,url:r.manageUrl}]:[]);if(e.length===0&&!l.appInstallUrl)return null;let t={manage:e};if(l.appInstallUrl)t.installUrl=l.appInstallUrl;return t}function vA(){return l?.entries??[]}function a$(){return(l?.notices??[]).filter((e)=>e.display!=="toast")}var L=new Set;function N(){let e=(l?.notices??[]).filter((t)=>t.display==="toast"&&!L.has(t.id));for(let t of e)L.add(t.id);return e}var G="https://jxsuite.com/problems/";function k(e){return typeof e==="string"}function X(e){return typeof e==="object"&&e!==null}function Bb(e){if(!k(e)||!e.startsWith("https://jxsuite.com/problems/"))return null;let t=e.slice(29);return t===""?null:t}function sr(e){if(k(e))return e.trim()===""?null:e;if(!X(e))return null;for(let t of[e.detail,e.error,e.title])if(k(t)&&t.trim()!=="")return t;return null}function ka(e,t){return sr(e)??(t===void 0?"Request failed":`Request failed (${t})`)}var d=(e,t,r,i)=>{let s={status:t,title:r,type:`${G}${e}`};if(i!==void 0)s.extensions=i;return s},me={invalidRequest:d("invalid-request",400,"The request was malformed or incomplete"),notFound:d("not-found",404,"The requested resource does not exist"),methodNotAllowed:d("method-not-allowed",405,"That method is not allowed on this route"),conflict:d("conflict",409,"The request conflicts with the current state",["conflicts"]),payloadTooLarge:d("payload-too-large",413,"The request body is too large"),unauthorized:d("unauthorized",401,"Credentials are missing or not accepted"),forbidden:d("forbidden",403,"The request was refused"),needsInstallationAccess:d("needs-installation-access",403,"The GitHub App is not installed for that account",["installUrl"]),pathOutsideProject:d("path-outside-project",403,"The path resolves outside the active project"),actionRequired:d("action-required",403,"An action is required first",["actions","heading","retry"]),noActiveProject:d("no-active-project",409,"No project is active on this backend"),capabilityUnavailable:d("capability-unavailable",501,"This backend does not provide that capability"),upstreamFailure:d("upstream-failure",502,"An upstream service failed",["upstream"]),internalError:d("internal-error",500,"The backend failed to complete the request")};var dC=".jx-loc-id",o=(e,t,r,i)=>{let s={method:e,path:t,optional:i!==void 0,summary:r};if(i!==void 0)s.degradation=i;return s},he={activate:o("POST","/__studio/activate","Bind the backend to a project root"),project:o("GET","/__studio/project","Root project metadata {name, root}"),projectInfo:o("GET","/__studio/project-info","Probe a directory: {isSiteProject, projectConfig?, directories?}"),resolveSite:o("GET","/__studio/resolve-site","Resolve the owning site of a file path {sitePath, projectConfig?, fileRelPath?}"),sites:o("GET","/__studio/sites","Enumerate site projects [{config, path}] (backs listProjects)","The welcome screen's Projects catalogue stays hidden."),findProject:o("GET","/__studio/find-project","Locate a project directory by name outside the root","openProject falls back to config-matching only."),locateDirectory:o("GET","/__studio/locate-directory","Resolve the absolute path of a showDirectoryPicker() folder by the id in its .jx-loc-id","Browse… reports that the folder could not be placed; the Location is typed by hand."),createProject:o("POST","/__studio/create-project","Scaffold a project at a caller-chosen destination → {root, config}"),starters:o("GET","/__studio/starters","Starter templates (StarterInfo[])","The New Project picker offers only blank/templates."),importSite:o("POST","/__studio/import-site","Clone a live website into a project; streams NDJSON progress","The New Project Import tab is unavailable."),files:o("GET","/__studio/files","List a directory (DirEntry[]) in stable path order; an entry may carry an opaque content `version` the backend vouches for; with ?glob=<pattern>, search matching files project-wide"),fileRead:o("GET","/__studio/file","Read a file's text content"),filesRead:o("POST","/__studio/files/read","Read many files' text content {paths} → ReadFilesResult {files: [path, {content} | "+"{error: {status, code?, message}}][], omitted}. At most READ_FILES_MAX_PATHS (200) paths and a backend byte budget per call: the excess is listed in `omitted` (never a 400) and the first path is always answered. Per-path errors: 404 missing/deleted, 415 binary, 413 too large, 502 upstream. Allowed for read-only sessions; keeps fileRead's server-side effects","Adapters fall back to one fileRead per path."),fileWrite:o("PUT","/__studio/file","Write a file's text content"),fileDelete:o("DELETE","/__studio/file","Delete a file"),fileUpload:o("POST","/__studio/file/upload","Upload binary content to a path → UploadResult {path, size?}. `path` is the answer, not an "+"echo: a store that de-duplicates, suffixes, or normalizes names reports what it really wrote"),fileBytes:o("GET","/__studio/file/bytes","A project file's raw bytes, undecoded — the read side of `fileUpload`, for a caller that must "+"not go through UTF-8","Studio can only read a project file as text, so any surface that must decode one stays hidden."),documentRaw:o("GET","/__studio/raw/","A project file as its own bytes, at its own URL — the mount a canvas renders against when "+"the editor origin does not serve the site's URL space. The project-relative path is appended to this prefix","The canvas cannot address project files by URL, so a host whose origin does not serve the site URL space renders no component $refs and no images."),fileRename:o("POST","/__studio/file/rename","Rename/move (+ refactor report). `from`/`to` are server-root-relative; every path in the "+"report is relative to the active project (specs/server.md §4.1)"),references:o("GET","/__studio/references","Where a file or a component tag is used (?path=&tag=, at least one) → ReferencesResult "+"{files, filesReferencing, refsTotal} — the read side of the rename refactor's own walker, "+"cached until the backend's watcher sees the tree move (backs findReferences). `?path=` is server-root-relative and every path in the answer is relative to the active project; a "+"target outside that project is a 400, never a zero-result 200 (specs/server.md §4.1)",'Usage counts are hidden: no "Used on N pages" in the inspector, no Selection: Find Usages, and delete/rename confirmations state no reference count.'),locate:o("POST","/__studio/locate","Find a file by name → {path | null}"),collab:o("GET","/__studio/collab","Realtime co-editing: a WebSocket upgrade speaking the @jxsuite/collab wire envelope (one socket per project, documents multiplexed by path; y-protocols sync + project-level "+"awareness in lib0 binary frames — see @jxsuite/collab/envelope for the frame layout and "+"the docEpoch/doc-reset lifecycle). A plain GET (no Upgrade) answers {collab, protocols, version} as the capability probe, and `protocols` is the subprotocol negotiation: the client offers one of them as Sec-WebSocket-Protocol and the server echoes it, or the "+"client offers none when the server advertises none, because RFC 6455 §4.1 fails a "+"connection whose offer went unechoed.","Realtime co-editing is unavailable; Studio edits solo with file-level saves"),components:o("GET","/__studio/components","Discover components (ComponentMeta[])"),cem:o("GET","/__studio/cem","Custom-elements manifest of an npm dependency","Dependency components lose prop/slot metadata."),formats:o("GET","/__studio/formats","The project's format registry entries plus a sibling `extensions` array — per enabled "+"extension its manifest identity and project-section contributions (ExtensionsInfo[]; backs listFormats and listExtensions).","Only .json documents open (backs listFormats); descriptor-contributed settings sections do not appear."),extensionCatalog:o("GET","/__studio/catalog","Extensions this backend can OFFER (ExtensionCatalogEntry[]) — the shipped first-party "+"catalogue plus any package in the project's own dependencies exporting a jx-extension.json, each marked with whether the host resolves it without a project install and whether the project has it installed. A capability rather than a constant: a Worker ships a fixed set "+"of extension packages (specs/extensions.md §5.5). Backs listExtensionCatalog.","The Extensions section offers no catalogue; adding an extension stays a typed package name."),projectSchemas:o("GET","/__studio/project-schemas","The project's generated entry documents (project.schema.json / document.schema.json), "+"PRE-BUNDLED into self-contained schemas — {project, document} (backs fetchProjectSchemas). "+"Regenerated on demand when missing or older than project.json.","The JSON editor falls back to the bundled core schemas (extension sections get no editor validation/completion)."),format:o("POST","/__studio/format","Dispatch a format capability {format, action: parse|serialize, source?|doc?}","Non-JSON documents cannot be parsed/serialized (backs formatAction)."),pluginSchema:o("GET","/__studio/plugin-schema","Extract a $studio schema from a class source","Plugin property panels fall back to generic JSON editing."),codeFormat:o("POST","/__studio/code/format","Format posted source {code, path?} → {code, errors}","Code editors skip format-on-open/save (codeService returns null)."),codeMinify:o("POST","/__studio/code/minify","Minify posted source {code} → {code}","Compiled-output minification is skipped."),codeLint:o("POST","/__studio/code/lint","Lint posted source {code, path?} → {diagnostics}","Code editors show no lint markers."),buildSite:o("POST","/__studio/build","Build or render the site → {routes, files, errors, mode?, url}","Build Site reports that this target cannot build."),previewSite:o("POST","/__studio/preview","Preview the working tree at a route → {routes, files, errors, mode, url, reused}","Open in Browser falls back to buildSite."),previewOverlay:o("POST","/__studio/preview/overlay","Publish (POST) or retract (DELETE) a document's unsaved bytes → 204","A live preview shows the last saved state instead of the editor's."),packages:o("GET","/__studio/packages","List dependencies (PackageInfo[])"),packagesAdd:o("POST","/__studio/packages/add","Add a dependency"),packagesRemove:o("POST","/__studio/packages/remove","Remove a dependency"),packagesInstall:o("POST","/__studio/packages/install","Run the package manager install","Install/reinstall affordances are hidden; manifest-only edits still work."),packagesNeedsInstall:o("GET","/__studio/packages/needs-install","Whether node_modules is stale","The install-on-open prompt never shows."),packagesVersions:o("GET","/__studio/packages/versions","Newest published version of each dependency (PackageVersionInfo[])","The Latest column stays empty and the update affordances are hidden."),packagesSetVersions:o("POST","/__studio/packages/set-versions","Rewrite dependency ranges and install","Bulk version updates are hidden."),gitStatus:o("GET","/__studio/git/status","Working-tree status (GitStatusResult)"),gitBranches:o("GET","/__studio/git/branches","Branch list (GitBranchesResult)"),gitLog:o("GET","/__studio/git/log","Recent commits (GitLogEntry[])"),gitStage:o("POST","/__studio/git/stage","Stage files"),gitUnstage:o("POST","/__studio/git/unstage","Unstage files"),gitCommit:o("POST","/__studio/git/commit","Commit staged (else all dirty) files"),gitPush:o("POST","/__studio/git/push","Push (cloud: sync check — commits land on push)"),gitPull:o("POST","/__studio/git/pull","Pull/fast-forward; 409 {conflicts} on overlap"),gitFetch:o("POST","/__studio/git/fetch","Refresh remote tracking state"),gitCheckout:o("POST","/__studio/git/checkout","Switch branches"),gitCreateBranch:o("POST","/__studio/git/create-branch","Create a branch"),gitDiff:o("GET","/__studio/git/diff","Unified diff of dirty files (or one path)"),gitShow:o("GET","/__studio/git/show","File content at a ref"),gitDiscard:o("POST","/__studio/git/discard","Discard working changes"),gitInit:o("POST","/__studio/git/init","Initialize a repository"),gitAddRemote:o("POST","/__studio/git/add-remote","Add a remote"),gitClone:o("POST","/__studio/git/clone","Clone a repository","The welcome screen hides Clone Git Repository."),gitPr:o("POST","/__studio/git/pr","Open a pull request → PullRequestInfo","Studio falls back to a direct GitHub API call with the user's token."),dataConnections:o("GET","/__studio/data/connections","Connector connections with configured/missingSecrets/isDefault state, reachable table names, and registry-descriptor provider metadata (DataConnectionsResponse; backs dataConnections)","The connections settings section shows no status, and data-domain actions stay hidden."),dataConnectionTest:o("POST","/__studio/data/connections/test","Probe a connection {connection} → DataConnectionTestResult (backs dataConnectionTest)","The Test Connection action is hidden."),dataPush:o("POST","/__studio/data/push","Additive schema push {connection?, dryRun?} → DataPushResult (plan of DataPushStep[], "+"applied, warnings/errors; backs dataPush)","The Push Schema action is hidden; schemas deploy via `jx db push` instead."),dataRows:o("GET","/__studio/data/rows","Page a table (DataRowsQuery params) → DataRowsResult {rows, total, columns} (backs dataRows)","The data grid is unavailable."),dataInsertRow:o("POST","/__studio/data/rows","Insert a row {table, connection?, values} → {row} (backs dataInsertRow)","The data grid hides its add-row footer."),dataUpdateRow:o("PUT","/__studio/data/rows","Update a row keyed on its primary key {table, connection?, pk, set} → {row} (backs "+"dataUpdateRow)","Data grid cells are read-only."),dataDeleteRow:o("DELETE","/__studio/data/rows","Delete a row (?table=&pk=&connection=) → {ok} (backs dataDeleteRow)","The data grid hides row deletion."),secretsList:o("GET","/__studio/secrets","Configured secret env-var NAMES, never values (SecretsListResponse; backs listSecrets)","Secret fields cannot show set/unset state."),secretsSet:o("PUT","/__studio/secrets","Write/remove secrets in the backend store (.dev.vars locally) {set?, remove?} → names "+"(backs setSecrets)","The secret form control renders disabled; secrets are edited in .dev.vars by hand."),aiChat:o("POST","/__studio/ai/chat","StreamEvent SSE chat proxy {messages, tools, systemPrompt, model}"),aiModels:o("GET","/__studio/ai/models","Model catalogue (AiModelsResponse)"),cfProxy:o("POST","/__studio/cf/proxy","Allowlisted Cloudflare API passthrough {path, method?, body?} (backs cfApi)","The Publish panel explains the git-push publishing path instead.")};var l$=200,c$=100,d$=12;var Y=new Set(["reload","repeat","none"]);function Np(e){if(!Array.isArray(e))return[];return e.flatMap((r)=>{if(!v(r))return[];let{href:i,id:s,label:f,primary:m}=r;if(!n(s)||!s||!n(f)||!f)return[];let c={id:s,label:f};if(n(i)&&i)c.href=i;if(m===!0)c.primary=!0;return[c]})}function F(e){return n(e)&&Y.has(e)}function u$(e){return F(e)?e:void 0}function Q(e){return e.replaceAll("_","-")}function _(e){if(!v(e))return{};let{actions:t,code:r,heading:i,installUrl:s,retry:f,type:m}=e,c={},a=Bb(m)??(n(r)?Q(r):null);if(a!==null)c.code=a;if(n(s))c.installUrl=s;if(t!==void 0)c.actions=Np(t);if(n(i)&&i)c.heading=i;if(F(f))c.retry=f;return c}function yA(e){let t=_(e);return t.code==="needs-installation-access"&&t.installUrl?t.installUrl:null}function wA(e){return _(e).code==="action-required"}function zd(){return Go(pt.aiOpenAiKey)}function xA(e){Cr(pt.aiOpenAiKey,e||"")}function cx(){return RA(pt.aiOpenAiKey)}function sl(){return Go(pt.aiBaseUrl)}function dx(){return Go(pt.aiModel)}function _A(e){Cr(pt.aiModel,e||"")}function SA(e){NA([[pt.aiOpenAiKey,e.apiKey],[pt.aiBaseUrl,e.baseUrl],[pt.aiModel,e.model]])}function CA(e){return!Cm(pt.aiOpenAiKey,e.apiKey,zd())||!Cm(pt.aiBaseUrl,e.baseUrl,sl())||!Cm(pt.aiModel,e.model,dx())}function Cm(e,t,r){return px(e,t)===px(e,r)}function kA(){Op([pt.aiOpenAiKey,pt.aiBaseUrl,pt.aiModel])}function uC(){return{apiKey:zd(),baseUrl:sl()}}function V(e){return`${e.apiKey}\x00${e.baseUrl}`}var g=null,P="",j=!1,A=!1,D="",I,M="",R=null,U=null,q=new Set,ee=600000,S=0,J=!1;function us(){g=null,P="",j=!1,A=!1,D="",I=void 0,M="",R=null,U=null,S=0}var oe=new Set([pt.aiOpenAiKey.key,pt.aiBaseUrl.key,pt.cfToken.key,pt.cfAccountId.key]);Ap((e)=>{if(e.some((t)=>oe.has(t)))us()});function h$(e){return g&&P===V(e)?g:null}function K(e){return g?.find((t)=>t.id===e)}function p$(e){return K(e)?.toolSupport}function EA(e){return K(e)?.contextWindow}function ux(e){if(e)q.add(e);U??=lh({force:!0}).catch(()=>{}).then(()=>{S=Date.now();for(let t of q)t()})}function ne(){if(!A||S===0||Date.now()-S<ee)return!1;return U=null,S=0,ux(),!0}function re(){if(typeof window>"u"||J)return;J=!0,window.addEventListener("focus",()=>{ne()})}re();function zb(){return cx()||hC()}function hC(){return j}function TA(){return A}function km(){return I}function LA(){return M}function pC(){return R}function ie(){return D}function Yl(){return dx()||ie()||pt.aiModel.default}function se(e,t){let r;try{r=new URL(e,"http://jx.invalid")}catch{return e}return r.pathname=r.pathname.replace(/[^/]*$/,t),/^https?:/i.test(e)?r.href:`${r.pathname}${r.search}`}async function lh(e={}){let t=e.credentials??uC(),r=V(t);if(g&&P===r&&!e.force)return g;let i=p(),s=await Promise.resolve(i.aiChatUrl()),f=se(s,"models"),m={};if(t.apiKey)m["X-Api-Key"]=t.apiKey;if(t.baseUrl)m["X-Api-Base-URL"]=t.baseUrl;let c=await fetch(f,{headers:m});if(!c.ok)throw Error(`HTTP ${c.status}`);let a=await c.json();if(j=a.configured===!0,A=a.managed===!0,D=a.defaultModel??"",I=a.code,M=a.upstreamError!==void 0?a.upstreamMessage??"":"",R=null,a.code==="action_required"){let u={actions:Np(a.actions)};if(n(a.detail)&&a.detail)u.detail=a.detail;R=u}return g=(a.models||[]).map((u)=>{let h={id:u.id,name:u.name||u.id};if(Z(u.contextWindow))h.contextWindow=u.contextWindow;if(Xe(u.toolSupport))h.toolSupport=u.toolSupport;return h}),P=r,g}var T=new Set,B=null;function $A(e){if(T.size===0){B=e;return}for(let t of T)t(e)}function H(e){T.add(e);let t=B;if(B=null,t)e(t);return()=>{T.delete(e)}}function fC(){return _e()&&te(p().performAction)}function f$(e){let t=e.find((i)=>i.primary)??e[0];if(!t)return null;let r=e.find((i)=>i!==t);return r?{lead:t,other:r}:{lead:t}}var w=null,W=!1;function mC(e){let t=f$(e.actions);if(!fC()||!t)return Promise.resolve(!1);return w??=ae(e,t).finally(()=>{w=null}),w}async function Em(e){let t=_(e);if(t.code!=="action-required"||!t.actions?.length)return!1;return mC({actions:t.actions,detail:e instanceof Error?e.message:void 0,heading:t.heading,retry:t.retry})}async function z(){us(),await Bd(),m$()}function ae(e,t){let r=e.detail??"This needs one more step first.";return new Promise((i)=>{let s="offer",f=(y)=>{if(s==="done")return;s="done",E.close(),i(y)},m=(y)=>{s="offer",E.update({cancelLabel:"Not now",confirmLabel:t.lead.label,message:y,secondaryLabel:t.other?.label??""})},c=async(y)=>{let b;try{b=await y}catch(x){if(s==="waiting")m(x instanceof Error?x.message:String(x));return}if(b?.status==="done"){await z(),f(!0);return}if(s!=="waiting"||!b||b.status==="redirect")return;Bd(),m(r)},a=(y)=>{if(s!=="offer")return;s="waiting";let b;try{b=p().performAction(y)}catch(x){m(x instanceof Error?x.message:String(x));return}E.update({cancelLabel:"Cancel",confirmLabel:"Waiting…",message:"Finish in the window that opened. This closes by itself once it is done.",secondaryLabel:""}),c(b)},{lead:u,other:h}=t,O={cancelLabel:"Not now",confirmLabel:u.label,headline:e.heading??"One more step",layer:tt("dialog"),message:r,onCancel:()=>{W=!0,f(!1)},onClosed:()=>{f(!1)},onConfirm:()=>{a(u)},region:"account/action"};if(h)O.onSecondary=()=>{a(h)},O.secondaryLabel=h.label;let E=Zs(O)})}function ce(e){if(e==="reload")location.reload();else if(e==="repeat")C.info("Done. Run that again now.",{key:"account.action.retry",source:"Account"})}function IA(){return H((e)=>{if(W||w)return;mC(e).then((t)=>{if(t)ce(e.retry)})})}async function hx(e){if(!fC())return!1;let t=p().performAction(e),r;try{r=await t}catch(i){return C.error(i instanceof Error?i.message:String(i),{key:"account.action",source:"Account",tier:"toast"}),!1}if(r?.status==="done")return await z(),!0;if(r?.status!=="redirect")await Bd();return!1}function m$(){for(let e of N()){let t={key:`account.notice.${e.id}`,source:"Account"};if(e.level==="warning")C.warn(e.message,t);else C.info(e.message,t)}}
2
+ export{Bd,lC,cC,bA,vA,a$,Bb,sr,ka,dC,l$,c$,d$,Np,u$,yA,wA,zd,xA,cx,sl,dx,_A,SA,CA,Cm,kA,uC,us,h$,p$,EA,ux,zb,hC,TA,km,LA,pC,Yl,lh,$A,fC,f$,mC,Em,IA,hx,m$};
3
+
4
+ //# debugId=D99709F683E98F4E64756E2164756E21
5
+ //# sourceMappingURL=studio-4hp8pkyt.js.map
@@ -0,0 +1,9 @@
1
+ import{Pp}from"./studio-q7rtx6zq.js";import{Mm,Hx,u}from"./studio-c05wdnt3.js";import{g}from"./studio-43sd2mam.js";import{to,Sr,Xw,h}from"./studio-d5grtb9e.js";import{Ae}from"./studio-fbhxxc5f.js";import{T,R}from"./studio-x9hsze61.js";import{vt,nl,Di,Hc,Tp,Wr,Lb,OL,HL}from"./studio-rj9eamf8.js";import{fS,mS,RT,Sw}from"./studio-8vcvfs7r.js";import{x,dl}from"./studio-gcxk20n7.js";import{n,Z,S,Ie,Ni,rd}from"./studio-vxq7fcvv.js";import{le}from"./studio-qgh13jtz.js";var Dy="Project Styles",Ru="stylebook",Gf="tokens",K="source",Bg={elements:Ru,variables:Gf,code:K},h_=["elements","variables","code"],ER=h_.map((e)=>Bg[e]),p_=[{id:"color",prefix:"--color-",title:"Colors"},{id:"font",prefix:"--font-",title:"Fonts"},{id:"size",prefix:"--size-",title:"Sizes & Spacing"},{id:"other",prefix:"--",title:"Other"}];function f_(e){if(e.startsWith("--color"))return"color";if(e.startsWith("--font"))return"font";if(e.startsWith("--size")||e.startsWith("--spacing")||e.startsWith("--radius"))return"size";return"other"}function Q(e){let o=f_(e);if(o==="other")return e;let{prefix:t}=p_.find((r)=>r.id===o);return Hx(e,t)}function X(e){if(!e)return[];let o=[];for(let[t,r]of Object.entries(e)){if(!t.startsWith("--"))continue;if(!n(r)&&!Z(r))continue;o.push({group:f_(t),label:Q(t),name:t,value:r})}return o}function m_(e){let o=X(e);return p_.map((t)=>({group:t,tokens:o.filter((r)=>r.group===t.id)}))}function g_(e){if(!e)return[];let{featureQueries:o,sizeBreakpoints:t}=Wr(e),r=[],a=[];for(let{name:s,query:c}of o){let y=Tp(c);if(y)r.push({key:`@${s}`,kind:"scheme",label:y==="dark"?"Dark":"Light",name:s,scheme:y});else a.push({key:`@${s}`,kind:"feature",label:`@${s}`,name:s})}let i=t.map(({name:s})=>({key:`@${s}`,kind:"size",label:`@${s}`,name:s}));return[...r,...i,...a]}function _(e,o){return Ni(e,o.key)}function Ny(e,o,t){let r=_(e,o)?.[t];return n(r)||Z(r)?r:void 0}function Pk(e,o,t,r){if(r){rd(e,o.key)[t]=r;return}let a=_(e,o);if(!a)return;if(delete a[t],Object.keys(a).length===0)delete e[o.key]}function TR(e,o,t,r=[]){let a=new Set(r.map((i)=>i.name));return o.filter((i)=>!a.has(i.name)&&Ny(e,i,t)===void 0)}var cp={$sections:[{label:"Headings",elements:[{tag:"h1",text:"Code Is Poetry"},{tag:"h2",text:"Code Is Poetry"},{tag:"h3",text:"Code Is Poetry"},{tag:"h4",text:"Code Is Poetry"},{tag:"h5",text:"Code Is Poetry"},{tag:"h6",text:"Code Is Poetry"}]},{label:"Paragraph",elements:[{tag:"p",text:"In a village of La Mancha, the name of which I have no desire to call to mind, there lived not long since one of those gentlemen that keep a lance in the lance-rack, an old buckler, a lean hack, and a greyhound for coursing."}]},{label:"List",elements:[{tag:"ul",children:[{tag:"li",text:"Alice."},{tag:"li",text:"The White Rabbit."},{tag:"li",text:"The Cheshire Cat."},{tag:"li",text:"The Mad Hatter."},{tag:"li",text:"The Queen of Hearts."}]},{tag:"ol",children:[{tag:"li",text:"First item"},{tag:"li",text:"Second item"},{tag:"li",text:"Third item"}]}]},{label:"Quote",elements:[{tag:"blockquote",children:[{tag:"p",text:"In quoting others, we cite ourselves.",style:"font-size:1.25em;font-style:italic"},{tag:"p",text:"— Julio Cortázar"}]}]},{label:"Code",elements:[{tag:"pre",children:[{tag:"code",text:`// A "block" is the abstract term used
2
+ // to describe units of markup that
3
+ // when composed together, form the
4
+ // content or layout of a page.
5
+ registerBlockType( name, settings );`}]}]},{label:"Inline",elements:[{tag:"a",text:"Visit the documentation",attributes:{href:"#"}},{tag:"strong",text:"Bold text emphasis"},{tag:"em",text:"Italic text emphasis"},{tag:"small",text:"Fine print and legal text"},{tag:"mark",text:"Highlighted text"},{tag:"code",text:"const x = 42;"},{tag:"abbr",text:"HTML",attributes:{title:"HyperText Markup Language"}},{tag:"sub",text:"subscript"},{tag:"sup",text:"superscript"}]},{label:"Form",elements:[{tag:"input",attributes:{type:"text",placeholder:"Enter text…"}},{tag:"button",text:"Click Me"},{tag:"select",children:[{tag:"option",text:"Option 1"},{tag:"option",text:"Option 2"},{tag:"option",text:"Option 3"}]},{tag:"textarea",attributes:{placeholder:"Enter longer text…",rows:"3"}}]},{label:"Table",elements:[{tag:"table",children:[{tag:"thead",children:[{tag:"tr",children:[{tag:"th",text:"Name"},{tag:"th",text:"Role"},{tag:"th",text:"Status"}]}]},{tag:"tbody",children:[{tag:"tr",children:[{tag:"td",text:"Alice"},{tag:"td",text:"Developer"},{tag:"td",text:"Active"}]},{tag:"tr",children:[{tag:"td",text:"Bob"},{tag:"td",text:"Designer"},{tag:"td",text:"Away"}]},{tag:"tr",children:[{tag:"td",text:"Carol"},{tag:"td",text:"Manager"},{tag:"td",text:"Active"}]}]}]}]},{label:"Interactive",elements:[{tag:"details",attributes:{open:""},children:[{tag:"summary",text:"Click to expand details"},{tag:"p",text:"Additional detail content revealed when the disclosure widget is toggled open."}]}]},{label:"Media",elements:[{tag:"img",attributes:{alt:"Placeholder image"},style:"width:100%;max-width:400px;height:200px;background:#e0e0e0;display:block;border-radius:4px"},{tag:"video",attributes:{controls:""},style:"width:100%;max-width:400px;height:200px;background:#e0e0e0;display:block;border-radius:4px"},{tag:"audio",attributes:{controls:""},style:"width:100%"}]}],$variables:{color:{label:"Color",prefix:"--color-",placeholder:"#007acc"},font:{label:"Font",prefix:"--font-",placeholder:"system-ui, sans-serif"},size:{label:"Size",prefix:"--size-",placeholder:"16px"},other:{label:"Other",prefix:"--",placeholder:"value"}}};var A={$schema:"https://jxsuite.com/schema/v1",$id:"StudioStylebookChrome",$description:"The bar across the top of the Project Styles canvas: the filter that narrows the specimen catalogue, and the toggle that reduces it to the elements this file has already styled. Both are shell state rather than document state — the adapter owns which — and the two names come in as values, because the surface is called Project Styles and the canvas view it draws is the wire word `stylebook`; nothing a reader sees here may be spelled from that. **The bar IS the kit's toolbar now.** It used to write `role=\"toolbar\"` and its own `aria-label` on a `<div>`, which is a role with none of the behaviour under it: two controls, two tab stops, and no arrow key between them. `jx-action-group` is not the element for it — that one roves `jx-action-button` and this bar's first control is a `jx-textfield` — so `jx-toolbar` is, and the field keeps its own arrows while its caret still has text to walk (ui.md §5.5).",tagName:"jx-toolbar",attributes:{part:"chrome"},$props:{label:{$ref:"#/state/title"}},style:{$description:'What `.sb-chrome` said in `styles/overlays.css`, plus the six inline declarations the template carried beside it, plus `.tb-toggle` — all three go dead with this conversion, and none of them is shared with another surface. Three repairs on the way. The bar is one element rather than a positioned box wrapping a `role="toolbar"` row that declared the same flex layout again. The flex layout is not declared here EITHER any more: `display: flex`, `align-items: center`, the `--jx-space-2` gap, the sans face and the foreground colour are all `jx-toolbar`\'s own, so what is left below is only what a positioned BAND is. And `.tb-toggle` read `var(--spectrum-font-size-50, 11px)`, which the kit spells `--jx-text-sm` at the same value; the rest of its drawing is a `jx-action-button` reaching in through `part="control"`, because what it has to look like is a small bordered chip and every fill and control height the kit draws would otherwise have to be taken back off.',position:"absolute",top:"0",left:"0",right:"0",zIndex:"15",flexShrink:"0",padding:"var(--jx-space-2) var(--jx-space-3)",background:"var(--bg-panel)",borderBottom:"1px solid var(--border)",'& [part="filter"]':{flex:"1",maxWidth:"200px"},'& [part="customized"] > [part="control"]':{$description:"Bordered, unfilled and dimmed until it is on, which is what says it is a filter rather than an action: the catalogue it narrows is the thing the reader is looking at, so the control has to be quieter than its subject.",padding:"3px var(--jx-space-3)",border:"1px solid var(--border)",borderRadius:"var(--radius)",background:"transparent",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)",":hover":{background:"var(--hover-bg)"}},'& [part="customized"][data-selected] > [part="control"]':{$description:"`data-selected` and not `selected`: the kit reflects the pressed state as a data attribute (`jx-action-button.json`), and the property this document binds never reaches the attribute of the same name.",borderColor:"var(--accent)",background:"var(--accent-15)",color:"var(--accent)"}},children:[{tagName:"jx-textfield",attributes:{part:"filter"},$props:{size:"sm",type:"search",clearable:!0,label:{$ref:"#/state/filterLabel"},placeholder:"Filter…",value:{$ref:"#/state/filter"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setFilter"},value:[{$ref:"event#/target/value"}]}]}},{tagName:"jx-action-button",$description:"`onchange` and not `onclick`: a `toggles` button owns its own pressed state and says so with `change` (`jx-action-button.json`), and an `onclick` written here would replace the element's own click handler on the same property — the toggle would stop flipping and stop announcing `aria-pressed`.",attributes:{part:"customized"},$props:{size:"sm",toggles:!0,selected:{$ref:"#/state/customizedOnly"},label:{$ref:"#/state/customizedLabel"},hint:{$ref:"#/state/customizedHint"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/toggleCustomized"},value:[]}]},children:[{tagName:"span",textContent:"${state.customizedLabel}"}]}]};T("stylebook-chrome",A);function W(e,o){let t=document.createElement("div");t.style.display="contents";let r=g({...e,...o}),a=null,i=!1;function s(){i=!0,R("stylebook-chrome",r,t).then((c)=>{i=!1,a=c})}return s(),{host:t,update(c){if(Object.assign(r,c),i||a!==null&&t.contains(a.root))return;a?.dispose(),a=null,t.textContent="",s()}}}function L(e){return!e.startsWith(":")&&!e.startsWith(".")&&!e.startsWith("&")&&!e.startsWith("[")&&!e.startsWith("@")&&!e.startsWith("--")}function O(e){return S(e)&&!Array.isArray(e)}var B="& .element-card-preview";function Ay(e){let o={},t=(r)=>{let a={};for(let[i,s]of Object.entries(r))if(i!=="@--")a[i]=s;return a};for(let[r,a]of Object.entries(e)){if(!O(a)){o[r]=a;continue}if(r==="@--")continue;if(Pp(r)){o[r]=a;continue}if(r.startsWith("@")){let i={};for(let[s,c]of Object.entries(a))if(O(c)&&L(s))i[`${B} ${s}`]=t(c);else i[s]=c;o[r]=i;continue}if(L(r)){o[`${B} ${r}`]=t(a);continue}o[r]=a}return o}function H(e,o){let t=o.split(" "),r=e;for(let a of t){if(!O(r))return null;r=r[a]}return O(r)?r:null}function Oy(e,o){let t=H(e,o);if(t&&Object.keys(t).length>0)return!0;for(let[r,a]of Object.entries(e)){if(!r.startsWith("@")||!O(a))continue;let i=H(a,o);if(i&&Object.keys(i).length>0)return!0}return!1}function oe(e){if(!e)return null;return e.split(" ").pop()??null}function My(e,o){let t=oe(o),r=[],a=(i,s,c)=>{let y=c?`${c} ${i.tag}`:i.tag;r.push({depth:s,entry:i,path:y,selected:i.tag===t,tag:i.tag});let C=i.children?[...new Map(i.children.map((w)=>[w.tag,w])).values()]:[];for(let w of C)a(w,s+1,y)};for(let i of e)a(i,0,"");return r}function ne(e,o,t){let[r]=Array.isArray(e.children)?e.children:[];if(!S(r)||Array.isArray(r)||!Ie(r.items))return null;let{$ref:a}=r.items,i=a.startsWith("#/state/")?a.slice(8):"",s=e.state?.[i];if(!Array.isArray(s))return null;t[o]=s;for(let[y,C]of Object.entries(e.state??{}))if(y!==i&&!(y in t))t[y]=C;return{children:[{...r,items:{$ref:`#/state/${o}`}}],tagName:"div"}}function V(e){let o=new Map,t=new Map,r=e.filter.toLowerCase(),a=(l,d,f)=>{let p=l.tag===f?f:`${f} ${l.tag}`;o.set(Hc(d),p);let b=l.children??[];for(let[v,I]of b.entries())a(I,[...d,"children",v],f)},i=(l)=>{let d={...l.attributes};if(l.style)d.style=l.style;let f={tagName:l.tag};if(l.text)f.textContent=l.text;if(Object.keys(d).length>0)f.attributes=d;if(l.children)f.children=l.children.map(i);return f},s=(l,d,f,p,b)=>{o.set(Hc(p),l),o.set(Hc([...p,"children",0]),l);let v=[...p,"children",0,"children",0];if(b)a(b,v,l);else o.set(Hc(v),l);if(!t.has(l))t.set(l,p);return{attributes:{class:"element-card"},children:[{attributes:{class:"element-card-preview"},children:[f],tagName:"div"},{attributes:{class:"element-card-label"},tagName:"div",textContent:d}],tagName:"div"}},c=[],y=(l,d)=>({attributes:{class:"sb-section"},children:[{attributes:{class:"sb-label"},tagName:"div",textContent:l},{attributes:{class:"sb-body"},children:d,tagName:"div"}],tagName:"div"}),C=()=>["children",c.length,"children",1];for(let l of e.meta.$sections){let d=l.elements;if(r)d=d.filter((b)=>b.tag.includes(r)||l.label.toLowerCase().includes(r));if(e.customizedOnly)d=d.filter((b)=>Oy(e.effectiveStyle,b.tag));if(d.length===0)continue;let f=C(),p=d.map((b,v)=>s(b.tag,`<${b.tag}>`,i(b),[...f,"children",v],b));c.push(y(l.label,p))}let w=[],E={};{let l=e.components;if(r)l=l.filter((d)=>d.tagName.toLowerCase().includes(r));if(e.customizedOnly)l=l.filter((d)=>Oy(e.effectiveStyle,d.tagName));if(l.length>0){let d=C(),f=l.map((p,b)=>{let v=[...d,"children",b];if(p.source!=="npm"&&p.path?.endsWith(".json")){w.push({$ref:`/${e.projectRoot?`${e.projectRoot}/`:""}${p.path}`.replace(/^\/+/,"/")});let m=e.specimens?.get(p.tagName);if(m?.kind==="props"){let P={$props:m.props,tagName:p.tagName};return s(p.tagName,`<${p.tagName}>`,P,v,null)}if(m?.kind==="row"){let P=ne(m.sample.doc,`stylebookRow${b}`,E);if(P)return s(p.tagName,`<${p.tagName}>`,P,v,null)}if(m?.kind!=="none"){let P={};for(let N of p.props??[])if(N.default!==void 0&&N.default!=="false"&&N.default!=="''")P[N.name]=String(N.default).replaceAll(/^'|'$/g,"");let D={tagName:p.tagName};if(Object.keys(P).length>0)D.attributes=P;return s(p.tagName,`<${p.tagName}>`,D,v,null)}}let M={attributes:{class:"sb-fallback"},tagName:"div",textContent:`<${p.tagName}>`};return s(p.tagName,`<${p.tagName}>`,M,v,null)});c.push(y("Components",f))}}if(c.length===0)c.push({attributes:{class:"sb-empty"},tagName:"div",textContent:e.customizedOnly?"No customized elements":"No matching elements"});let k={};if(w.length>0)k.$elements=w;if(e.effectiveHead&&e.effectiveHead.length>0)k.$head=e.effectiveHead;if(k.$media=e.effectiveMedia,Object.keys(E).length>0)k.state=E;return k.attributes={class:"sb-root"},k.children=c,k.style=Ay(e.effectiveStyle),k.tagName="div",{doc:k,pathToTag:o,tagToCardPath:t}}var q=new WeakMap;async function re(e){let{path:o}=e;if(e.source==="npm"||!o?.endsWith(".json"))return{kind:"bare"};let t=await RT(o);if(!t)return{kind:"bare"};let r=await fS(t,o);if(r.size>0&&await Sw(t,o,r))return{kind:"props",props:Object.fromEntries(r)};let a=await mS(t,o);if(a&&await Lb(e))return{kind:"row",sample:a};return await Sw(t,o,new Map)?{kind:"bare"}:{kind:"none"}}async function F(e,o=re){let t=q.get(e);if(!t)t=new Map,q.set(e,t);let r=t,a=await Promise.all(e.map(async(i)=>{let s=i.path??i.tagName,c=r.get(s);if(!c)c=o(i).catch(()=>({kind:"bare"})),r.set(s,c);return[i.tagName,await c]}));return new Map(a)}var G=new WeakMap;function ae(e){let o={customizedHint:"Show only the elements this file has already styled",customizedLabel:"Customized",customizedOnly:h.stylebook.customizedOnly,filter:h.stylebook.filter,filterLabel:`Filter the ${Dy} catalogue`,title:Dy},t=G.get(e);if(t)return t.update(o),t.host;let r=W(o,{setFilter:(a)=>{h.stylebook.filter=a},toggleCustomized:()=>{h.stylebook.customizedOnly=!h.stylebook.customizedOnly}});return G.set(e,r),r.host}function ie(e,o){let t=e.filter((r)=>r.name===(o??"base"));return t.length>0?t:e.slice(0,1)}async function LR(e,o){let t=e.wrap,r=vt(e.paneId),a=h.stylebook.filter.toLowerCase(),{customizedOnly:i}=h.stylebook,s=e.renderGeneration,c=Ae,y=F(c),C=to(r?.doc.document?.$media),{sizeBreakpoints:w,baseWidth:E}=Wr(C),k=w.length>0,l=ae(e);t.style.overflow="hidden";let d=[];if(k){d.push({displayName:Di("--"),name:"base",width:E});for(let m of w)d.push({displayName:Di(m.name),name:m.name,width:m.width})}let f;if(!k){let m=C["--"],P=m?`${Di("--")} (${E}px)`:null;f=[o.canvasPanelEntry(m?"base":null,P,!m,m?E:void 0)]}else f=ie(d,nl(e.paneId)).map((m)=>o.canvasPanelEntry(m.name,`${m.displayName} (${m.width}px)`,!1,m.width));if(!await o.drawStage(e,{frame:"boards",framePart:"panzoom",frameVars:"--boards-inset:40px",handles:"hidden",hug:!1,innerPart:"boards",lead:"chrome",panels:f.map((m)=>m.item)},f))return;let b=o.stageHost(e,"chrome-host");if(b&&b.firstChild!==l)b.replaceChildren(l);let v=await y;if(e.renderGeneration!==s)return;let I=V({components:c,specimens:v,customizedOnly:Boolean(i),effectiveHead:Xw(r?.doc.document?.$head),effectiveMedia:C,effectiveStyle:Sr(r?.doc.document?.style),filter:a,meta:cp,projectRoot:x?.projectRoot??null}),{panels:M}=e;for(let{panel:m}of f)M.push(m),OL(e.renderGeneration,I,m.canvas,m._width);if(k)o.updateActivePanelHeaders(e);o.applyTransform(e),o.observeCenterUntilStable(e)}function Cd(e,o,{panCanvas:t=!1}={}){let r={activeSelector:e,rightTab:"style"};if(o!==void 0)r.activeMedia=o;if(dl(u.value,{selection:[],ui:r}),h.stylebook.selection=e,e&&t)HL(e)}var b_=[{id:"page",strip:"page",title:"Page"},{id:"properties",strip:"element",title:"Content"},{id:"style",strip:"element",title:"Style"},{id:"events",strip:"element",title:"Logic"},{id:"assistant",strip:"assistant",title:"Assistant"}],Fk=[{id:"page",title:"Page"},{id:"element",title:"Element"},{id:"assistant",title:"Assistant"}];function v_(){return{saveDocument:()=>{},undo:()=>{},redo:()=>{},openInBrowser:()=>{},buildSite:()=>{},closeDocument:()=>{},duplicateSelection:()=>{},deleteSelection:()=>{},selectParent:()=>{},toggleDock:()=>{},toggleZen:()=>{},openPalette:()=>{},openProject:()=>{},newWindow:()=>{},panelRoster:[],focusPanel:()=>{},focusInspectorTab:()=>{},cycleRegion:()=>{}}}var j=(e)=>e.document.open,J=(e)=>e.selection.count>0&&e.editor.kind==="canvas",z=(e)=>!e.selection.isRoot&&e.selection.paths.every((o)=>Mm(o)),U="an element selected on the canvas that has a sibling position: not the document root, a repeater's template or a switch case",Y=(e)=>e.map((o)=>`[${o.join(", ")}]`).join(" and ");function Kf(e){return[{id:"file.save",title:"Save",category:"File",level:"document",icon:"floppy-disk",keybinding:"mod+s",menus:["commandbar/primary","statusbar/document","palette"],group:"1_file",undo:"none",when:j,enablement:(t)=>t.document.dirty,requires:"unsaved changes",run:()=>e.saveDocument()},{id:"document.close",title:"Close Document",category:"Document",level:"document",keybinding:"mod+w",menus:["context/tab","palette"],group:"1_file",when:j,requires:"an open document",run:()=>e.closeDocument()},{id:"view.openInBrowser",title:"Open in Browser",category:"View",level:"document",icon:"arrow-square-out",keybinding:"mod+shift+o",menus:["commandbar/primary","statusbar/document","palette"],group:"2_output",when:(t)=>t.project.isSite,enablement:j,requires:"a page to preview",run:()=>e.openInBrowser()},{id:"project.buildSite",title:"Build Site",category:"Project",level:"project",menus:["commandbar/overflow","palette"],group:"2_output",when:(t)=>t.project.isSite,requires:"a site project",run:()=>e.buildSite()},{id:"edit.undo",title:"Undo",category:"Edit",level:"document",icon:"arrow-u-up-left",keybinding:"mod+z",menus:["commandbar/primary","palette"],group:"1_history",order:1,when:j,enablement:(t)=>t.document.canUndo,requires:"a change to undo",run:()=>e.undo()},{id:"edit.redo",title:"Redo",category:"Edit",level:"document",icon:"arrow-u-up-right",keybinding:["mod+shift+z","mod+y"],menus:["commandbar/primary","palette"],group:"1_history",order:2,when:j,enablement:(t)=>t.document.canRedo,requires:"a change to redo",run:()=>e.redo()},{id:"selection.duplicate",title:"Duplicate",category:"Selection",level:"selection",keyScope:"canvas",keybinding:"mod+d",menus:["blockbar","context/element","context/layer","outline/row","palette"],group:"3_structure",undo:"document",when:J,enablement:z,requires:U,aiTool:{name:"duplicate_node",description:"Duplicate elements in the document, inserting each copy after its original, as one undoable step. The copies become the selection.",report:({after:t})=>{let r=t.selection.paths.length;return`Duplicated ${r} element${r===1?"":"s"}; the ${r===1?"copy is":"copies are"} selected at ${Y(t.selection.paths)}.`}},run:()=>e.duplicateSelection()},{id:"selection.repeat",title:"Repeat...",category:"Selection",level:"selection",keyScope:"canvas",menus:["context/element","palette"],group:"3_structure",undo:"document",when:J,enablement:(t)=>z(t)&&!t.selection.isRepeater,requires:"an element with a sibling position that is not already a repeater",run:()=>{(le("he70fc2b"),import("./convert-to-repeater-he70fc2b.js")).then(({convertToRepeater:t})=>t())}},{id:"selection.delete",title:"Delete",category:"Selection",level:"selection",keyScope:"canvas",keybinding:["delete","backspace"],menus:["blockbar","context/element","context/layer","outline/row","palette"],group:"9_danger",destructive:!0,undo:"document",when:J,enablement:z,requires:U,aiTool:{name:"delete_node",description:"Delete elements from the document as one undoable step.",report:({before:t,after:r})=>{let a=t.selection.paths.length;return`Deleted ${a} element${a===1?"":"s"} at ${Y(t.selection.paths)} in one undo step; the selection is now ${r.selection.count===0?"empty":"elsewhere"}.`}},run:()=>e.deleteSelection()},{id:"selection.selectParent",title:"Select Parent",category:"Selection",level:"selection",keyScope:"canvas",keybinding:["escape","arrowleft"],menus:["palette"],group:"2_navigate",when:J,requires:"an element selection",run:()=>e.selectParent()},{id:"view.toggleNavigator",title:"Toggle Navigator Dock",category:"View",level:"application",keybinding:"mod+b",menus:["commandbar/overflow","palette"],group:"4_docks",run:()=>e.toggleDock("navigator")},{id:"view.toggleInspector",title:"Toggle Inspector Dock",category:"View",level:"application",keybinding:"mod+alt+b",menus:["commandbar/overflow","palette"],group:"4_docks",run:()=>e.toggleDock("inspector")},{id:"view.zen",title:"Zen Mode",category:"View",level:"application",keybinding:"mod+.",menus:["commandbar/overflow","palette"],group:"4_docks",run:()=>e.toggleZen()},{id:"palette.open",title:"Open Command Center",category:"View",level:"application",keybinding:"mod+k",menus:["palette"],group:"5_palette",run:()=>e.openPalette("picker")},{id:"palette.openFiles",title:"Go to File…",category:"File",level:"application",keybinding:"mod+p",menus:["palette"],group:"5_palette",run:()=>e.openPalette("files")},{id:"palette.openCommands",title:"Run Command…",category:"View",level:"application",keybinding:"mod+shift+p",menus:["palette"],group:"5_palette",run:()=>e.openPalette("commands")},{id:"palette.openNodes",title:"Go to Symbol in Document…",category:"Selection",level:"document",menus:["palette"],group:"5_palette",when:j,requires:"an open document",run:()=>e.openPalette("nodes")},{id:"project.open",title:"Open Project…",category:"Project",level:"project",keybinding:"mod+o",menus:["commandbar/overflow","statusbar/project","palette"],group:"1_file",run:()=>e.openProject()},{id:"view.newWindow",title:"New Window",category:"View",level:"application",keybinding:"mod+shift+n",menus:["commandbar/overflow","palette"],group:"1_file",when:(t)=>t.capability.windowControls,requires:"a host that can hold more than one window",run:()=>e.newWindow()},{id:"project.openRecent",title:"Open Recent…",category:"Project",level:"project",menus:["commandbar/overflow","statusbar/project","palette"],group:"1_file",run:()=>e.openPalette("projects")},...se(e),...ce(e),{id:"view.cycleRegion",title:"Focus Next Region",category:"View",level:"application",keybinding:"f6",menus:["palette"],group:"4_docks",run:()=>e.cycleRegion(1)},{id:"view.cycleRegionBack",title:"Focus Previous Region",category:"View",level:"application",keybinding:"shift+f6",menus:["palette"],group:"4_docks",run:()=>e.cycleRegion(-1)}]}function se(e){return e.panelRoster.map((o)=>({id:`panel.focus.${o.id}`,title:`Show ${o.title}`,category:"View",level:"application",menus:["palette"],group:"4_docks",requires:"an open project",when:(t)=>t.project.open&&(o.when?.(t)??!0),run:()=>e.focusPanel(o.id)}))}function ce(e){return b_.map((o,t)=>({id:`inspector.focus.${o.id}`,title:`Show ${o.title}`,category:"View",level:"document",keybinding:`mod+shift+${t+1}`,menus:["palette"],group:"4_docks",requires:"an open document",when:(a)=>a.document.open,run:()=>e.focusInspectorTab(o.id)}))}
6
+ export{Dy,Ru,Gf,Bg,h_,ER,p_,f_,m_,g_,Ny,Pk,TR,Ay,Oy,My,cp,LR,Cd,b_,Fk,v_,Kf};
7
+
8
+ //# debugId=96E67B117E07535A64756E2164756E21
9
+ //# sourceMappingURL=studio-58xg6j2q.js.map
@@ -0,0 +1,7 @@
1
+ import{pt,Go,Ap,Cr}from"./studio-s32578pn.js";import{g}from"./studio-43sd2mam.js";import{h}from"./studio-d5grtb9e.js";import{Qt,ov,u}from"./studio-c05wdnt3.js";import{x}from"./studio-gcxk20n7.js";var xb=["application","project","document","selection"],fN=["global","canvas","caret","grid","code","dock","palette"],mN=["File","Edit","Selection","Insert","View","Document","Project","Source Control","Publish","Assistant","Collaborate","Help"],v=["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"],P={"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"}},b=["rail/project","rail/document","navigator","inspector","dock.bottom"],y={"rail/project":{admits:["project"],note:"the rail's upper group — Site, and Files with the developer panels on"},"rail/document":{admits:["document"],note:"the rail's lower group — Outline, Data, and Packages with the developer panels on"},navigator:{admits:["project","document"],note:"whichever level the hosted panel declares; the panel header prints it"},inspector:{admits:["document","selection"],note:"Page is the open document's tab, Element the selection's (§6)"},"dock.bottom":{admits:["project","document"],note:"the panel header states which"}};function w(e){return e==="bottom"?"dock.bottom":e}function E(e){let t=[w(e.dock)];if(e.rail!==!1)t.push(`rail/${e.level}`);return t}function C(e){return b.some((t)=>t===e)}function c(e){let t=[];if(!d(e.level))return t.push({panelId:e.id,placement:"—",level:String(e.level),message:`declares unknown level "${String(e.level)}" (expected one of: ${xb.join(", ")})`}),t;for(let n of E(e)){if(!C(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=y[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 S(e){return v.some((t)=>t===e)}function d(e){return xb.some((t)=>t===e)}function gN(e){let t=[];if(!d(e.level))return t.push({commandId:e.id,placement:"—",level:String(e.level),message:`declares unknown level "${String(e.level)}" (expected one of: ${xb.join(", ")})`}),t;for(let n of e.menus??[]){if(!S(n)){t.push({commandId:e.id,placement:String(n),level:e.level,message:`declares unknown placement "${String(n)}"`});continue}let o=P[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}var l="true",i=g({on:Go(pt.developerPanels)===l});Ap((e)=>{if(e.includes(pt.developerPanels.key))i.on=Go(pt.developerPanels)===l});function CS(){return i.on}function bN(e){i.on=e,Cr(pt.developerPanels,e?l:"")}function Yu(){let e=ov();return e.project.open=x!==null,e.project.isMultilingual=(Qt(x?.projectConfig??{}).i18n?.locales.length??0)>1,e.git.dirtyCount=h.git.status?.files.length??0,e.workspace.id=h.workspace,e.document.open=u.value!==null,e}var L=/^[a-z][\w-]*$/,a=new Map;function Zn(e){if(!L.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=c({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 Cp(e){return a.get(e)}function Mw(e){let t=[...a.values()];return e?t.filter((n)=>n.dock===e):t}function Pw(e,t){return e.when?e.when(t):!0}var m=[{level:"project",label:"Project"},{level:"document",label:"Document"}];function p(){return Mw().filter((e)=>e.rail!==!1)}function QT(e){let t=CS(),n=p().filter((o)=>o.rail!=="developer"||t);return m.flatMap(({level:o,label:f})=>{let r=n.filter((s)=>s.level===o&&Pw(s,e));return r.length>0?[{level:o,label:f,panels:r}]:[]})}function vN(){let e=p();return m.flatMap(({level:t})=>e.filter((n)=>n.level===t))}
4
+ export{xb,fN,mN,gN,CS,bN,Yu,Zn,Cp,Mw,Pw,QT,vN};
5
+
6
+ //# debugId=99CE6A3EFEFBA45E64756E2164756E21
7
+ //# sourceMappingURL=studio-5g0rprdt.js.map
@@ -1,5 +1,5 @@
1
- import{yn,hn,ae}from"./studio-v8aga3vp.js";import{f}from"./studio-ffrrncvz.js";import{Wo}from"./studio-p1wgvp7r.js";import{v}from"./studio-wz73q5kq.js";import{dt,Gt,I,A,jn,Lt}from"./studio-2jbs3rxv.js";import{Ad,AT,Lm,fC,PT,$a,$p}from"./studio-at5spjbc.js";import{sm,uS}from"./studio-ezscgr64.js";import{O}from"./studio-c7q0t9x1.js";import{te}from"./studio-cffqvnzd.js";import{we}from"./studio-a3g98wjr.js";function tl(e){let t=e.trim().replaceAll("\\","/").split("/").filter((n)=>n!=="");return t.some((n)=>n==="."||n==="..")?null:t.join("/")}var C={$schema:"https://jxsuite.com/schema/v1",$id:"StudioPublish",$description:"Publish: the one-click Cloudflare Pages flow, as a `jx-dialog` over the kit. Eight bodies, one at a time, because the reader is at exactly one point of a chain — a host that cannot reach Cloudflare at all, a question still in flight, a connection that lapsed, an invitation to connect, a stored token Cloudflare refused, a field to paste a replacement into, the create-and-connect form, and the connected status. `publish/publish-panel.ts` keeps every one of those decisions and the calls that settle them; this document knows only which of the eight it was told to draw. **The token is never painted.** The field below binds no `value` — it is written by the reader and read once, on its way to storage — so a stored secret cannot reach the attribute, the serialised HTML or the accessibility tree, which is `studio.md` §15 rule 1 written as a missing binding rather than as a rule somebody remembers.",tagName:"jx-dialog",$props:{headline:"Publish",confirmLabel:"",cancelLabel:"Close",size:"md"},attributes:{part:"publish"},oncancel:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},onclose:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},style:{$description:"What the five `.publish-*` names carried, keyed on `part`, and most of them do not survive the move. `.publish-modal` and its `.new-project-modal` base were a fixed card, a scroll body, a border, a shadow and a `z-index: 1000` — a modal `<dialog>` is every one of those, and the top layer is what the z-index was climbing towards. `.publish-field` was a label stacked over a control, which is `jx-field`'s whole shape. What is left is the column gap between bodies, the two button rows, the hint and the refusal. Nothing here uses `--spectrum-*`: those custom properties resolve only inside `<sp-theme>`, and a document mounted in a layer host is outside it, so each would silently have taken its hard-coded fallback.",'& [part="body"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-3)"},'& [part="note"], & [part="status-line"], & [part="deployment"]':{margin:"0",lineHeight:"1.5"},'& [part="rows"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-3)"},'& [part="actions"]':{$description:'Wraps rather than overflows (studio-ui-guidelines.md §4.6): two buttons whose labels are whole phrases — "Verify & Connect", "Preferences › Accounts" — are wider than a narrow dialog at the sizes a reader may have set.',display:"flex",flexWrap:"wrap",gap:"var(--jx-space-2)"},'& [part="submit"]':{alignSelf:"flex-start"},'& [part="hint"]':{$description:"Publishing rides every commit, so the connected body's only job is to say what is already happening. Dim, because it is a standing fact rather than something to act on.",margin:"0",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"},'& [part="failure"]':{$description:'`failure` and not `error`: `jx-textfield` and `jx-select` each draw a `[part="error"]` of their own inside this same tree, and the kit is light DOM — a scoped rule on that name would restyle the token field\'s refusal line too.',margin:"0",color:"var(--danger)",lineHeight:"1.5"},'& [part="link"], & [part="install-link"]':{color:"var(--accent)",textDecoration:"underline"},"& code":{fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-sm)"}},children:[{tagName:"div",attributes:{part:"body"},children:[{tagName:"div",attributes:{part:"body-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/body"},cases:{unsupported:{tagName:"p",attributes:{part:"note"},children:["This platform cannot reach the Cloudflare API. Publish by committing and pushing — your host builds ",{tagName:"code",textContent:"bunx jx build"}," and serves ",{tagName:"code",textContent:"dist/"},"."]},loading:{tagName:"p",attributes:{part:"note"},textContent:"Checking Cloudflare connection…"},lapsed:{tagName:"div",attributes:{part:"lapsed",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"note"},textContent:"Your Cloudflare connection has expired, so publishing cannot reach your account. Reconnect to restore it — this site's Pages project and its settings are untouched."},{tagName:"jx-button",$props:{variant:"accent",disabled:{$ref:"#/state/busy"}},attributes:{part:"reconnect"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/connect"},value:[]}]},children:[{tagName:"span",textContent:"${state.connectLabel}"}]}]},hosted:{tagName:"div",attributes:{part:"hosted",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"note"},textContent:"Connect your Cloudflare account to publish this site."},{tagName:"jx-button",$props:{disabled:{$ref:"#/state/busy"}},attributes:{part:"connect"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/connect"},value:[]}]},children:[{tagName:"span",textContent:"Connect Cloudflare"}]}]},stored:{tagName:"div",attributes:{part:"stored",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"note"},textContent:"A Cloudflare API token is stored on this machine, and Cloudflare did not accept it. It may have been revoked, or it may be missing the Account Settings Read and Pages Read/Write permissions."},{tagName:"div",attributes:{part:"actions"},children:[{tagName:"jx-button",$props:{disabled:{$ref:"#/state/busy"}},attributes:{part:"replace"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/replace"},value:[]}]},children:[{tagName:"span",textContent:"Replace token"}]},{tagName:"jx-button",$props:{quiet:!0},attributes:{part:"accounts"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openAccounts"},value:[]}]},children:[{tagName:"span",textContent:"Preferences › Accounts"}]}]}]},token:{tagName:"div",attributes:{part:"token-form",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"note"},textContent:"Paste a Cloudflare API token (permissions: Account Settings Read, Pages Read/Write). It is stored on this machine and only sent to the same-origin proxy — Studio never renders it back."},{tagName:"jx-field",$props:{span:!0,label:"API token"},attributes:{part:"token-row","data-field":"token"},children:[{tagName:"jx-textfield",$description:"No `value` binding, and its absence is the contract: a secret may pass through a field the reader typed it into and may never be painted into one they did not. The draft lives in the adapter's closure until Verify reads it, so nothing here — not the attribute, not the accessibility tree, not a DOM dump — has ever held it.",$props:{type:"password",placeholder:"cf_..."},attributes:{part:"token"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setToken"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"div",attributes:{part:"actions"},children:[{tagName:"jx-button",$props:{variant:"accent",disabled:{$ref:"#/state/busy"}},attributes:{part:"verify"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/verify"},value:[]}]},children:[{tagName:"span",textContent:"Verify & Connect"}]},{tagName:"jx-button",$props:{quiet:!0},attributes:{part:"accounts"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openAccounts"},value:[]}]},children:[{tagName:"span",textContent:"Preferences › Accounts"}]}]}]},form:{tagName:"div",attributes:{part:"connect-form",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"note"},children:["Create a Cloudflare Pages project connected to this repository. Every commit then builds and publishes automatically (",{tagName:"code",textContent:"bunx jx build"},")."]},{tagName:"div",attributes:{part:"rows"},children:[{tagName:"jx-field",$props:{span:!0,label:"Account"},attributes:{part:"row","data-field":"account"},children:[{tagName:"jx-select",$props:{options:{$ref:"#/state/accountOptions"},value:{$ref:"#/state/accountId"}},attributes:{part:"account"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setAccount"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-field",$props:{span:!0,label:"Pages project name"},attributes:{part:"row","data-field":"projectName"},children:[{tagName:"jx-textfield",$props:{value:{$ref:"#/state/projectName"}},attributes:{part:"project-name"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setProjectName"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-field",$props:{span:!0,label:"GitHub owner"},attributes:{part:"row","data-field":"owner"},children:[{tagName:"jx-textfield",$props:{value:{$ref:"#/state/owner"}},attributes:{part:"owner"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setOwner"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-field",$props:{span:!0,label:"GitHub repository"},attributes:{part:"row","data-field":"repo"},children:[{tagName:"jx-textfield",$props:{value:{$ref:"#/state/repo"}},attributes:{part:"repo"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setRepo"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-field",$props:{span:!0,label:"Production branch"},attributes:{part:"row","data-field":"branch"},children:[{tagName:"jx-textfield",$props:{value:{$ref:"#/state/branch"}},attributes:{part:"branch"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setBranch"},value:[{$ref:"event#/target/value"}]}]}}]}]},{tagName:"jx-button",$props:{variant:"accent",disabled:{$ref:"#/state/busy"}},attributes:{part:"submit"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/submit"},value:[]}]},children:[{tagName:"span",textContent:"${state.submitLabel}"}]}]},status:{tagName:"div",attributes:{part:"status",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"status-line"},children:["Connected to Pages project ",{tagName:"strong",attributes:{part:"project-name"},textContent:"${state.deployProject}"},{tagName:"span",attributes:{part:"site-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasProductionUrl"},cases:{true:{tagName:"span",children:[" — ",{tagName:"a",attributes:{part:"link",href:"${state.productionUrl}",target:"_blank",rel:"noreferrer"},textContent:"${state.productionUrl}"}]}}}]},{tagName:"div",attributes:{part:"deployment-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasDeployment"},cases:{true:{tagName:"p",attributes:{part:"deployment"},children:["Latest deployment: ",{tagName:"strong",attributes:{part:"deployment-state"},textContent:"${state.deploymentState}"}," (${state.deploymentEnvironment}) — ",{tagName:"a",attributes:{part:"link",href:"${state.deploymentUrl}",target:"_blank",rel:"noreferrer"},textContent:"preview"}]},false:{tagName:"p",attributes:{part:"deployment"},textContent:"No deployments yet — the first commit after connecting triggers one."}}},{tagName:"p",attributes:{part:"hint"},textContent:"Publishing happens automatically on every commit."},{tagName:"div",attributes:{part:"actions"},children:[{tagName:"jx-button",$props:{disabled:{$ref:"#/state/busy"}},attributes:{part:"refresh"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/refresh"},value:[]}]},children:[{tagName:"span",textContent:"Refresh"}]},{tagName:"jx-button",$props:{variant:"negative",disabled:{$ref:"#/state/busy"}},attributes:{part:"disconnect"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/disconnect"},value:[]}]},children:[{tagName:"span",textContent:"Disconnect"}]}]}]}}},{tagName:"div",attributes:{part:"failure-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasFailure"},cases:{true:{tagName:"p",attributes:{part:"failure"},children:["${state.failure}",{tagName:"span",attributes:{part:"pages-app-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/needsPagesApp"},cases:{true:{tagName:"span",children:[" — if the Cloudflare Pages GitHub App is not installed on the repository, ",{tagName:"a",attributes:{part:"install-link",href:"${state.pagesAppUrl}",target:"_blank",rel:"noreferrer"},textContent:"install it"}," and retry."]}}}]}}}]}]};I("publish",C);var D="https://github.com/apps/cloudflare-pages/installations/new";function R(e){if(!e.supported)return"unsupported";if(e.loading)return"loading";if(e.connected&&e.lapsed)return"lapsed";if(!e.connected){if(e.hosted)return"hosted";return e.tokenStored&&!e.replacing?"stored":"token"}return e.deploy?"status":"form"}function w(e){let{error:t}=e;return{accountId:e.form.accountId,accountOptions:e.accounts,body:R(e),branch:e.form.branch,busy:e.busy,connectLabel:e.busy?"Reconnecting…":"Reconnect Cloudflare",deploymentEnvironment:e.deployment?.environment??"",deploymentState:e.deployment?`${e.deployment.stage}: ${e.deployment.status}`:"",deploymentUrl:e.deployment?.url??"",deployProject:e.deploy?.projectName??"",failure:t,hasDeployment:e.deployment!==null,hasFailure:t!=="",hasProductionUrl:(e.deploy?.productionUrl??"")!=="",needsPagesApp:/github/i.test(t)&&/app|install|source|repo/i.test(t),owner:e.form.owner,pagesAppUrl:D,productionUrl:e.deploy?.productionUrl??"",projectName:e.form.projectName,repo:e.form.repo,submitLabel:e.busy?"Connecting…":"Create & Connect"}}function j(e){let t=document.createElement("div");t.style.pointerEvents="auto",e.layer.append(t);let n="",u=!1,N=()=>{if(u)return;u=!0,e.onClosed()},P=()=>u,p=v({...w(e.view),closed:N,connect:()=>{e.onConnect()},disconnect:()=>{e.onDisconnect()},openAccounts:()=>{e.onOpenAccounts()},refresh:()=>{e.onRefresh()},replace:()=>{n="",e.onReplaceToken()},setAccount:(o)=>{p.accountId=o,e.onField("accountId",o)},setBranch:(o)=>{p.branch=o,e.onField("branch",o)},setOwner:(o)=>{p.owner=o,e.onField("owner",o)},setProjectName:(o)=>{p.projectName=o,e.onField("projectName",o)},setRepo:(o)=>{p.repo=o,e.onField("repo",o)},setToken:(o)=>{n=o},submit:()=>{e.onSubmit()},verify:()=>{let o=n;n="",e.onSaveToken(o)}}),b=null,S=A("publish",p,t).then(async(o)=>{b=o;let d=o.root;if(P())return o.dispose(),d;if(await jn(d),P())return d;return(d.querySelector('dialog[part="dialog"]')??d).setAttribute(dt,Gt("modal","publish")),yn(d),d});return{close(){let o=b?.root;if(o instanceof HTMLElement)hn(o);b?.dispose(),b=null,n="",t.remove(),N()},host:t,ready:S,update(o){Object.assign(p,w(o))}}}var m=null,i="loading",h=[],l=null,r="",c=!1,g=!1,a={accountId:"",branch:"main",owner:"",projectName:"",repo:""};function x(){return O?.projectConfig??null}function T(e){return e.toLowerCase().replaceAll(/[^a-z0-9]+/g,"-").replaceAll(/^-+|-+$/g,"").slice(0,58)||"site"}function H(){let e=f().projectRoot,t=/^([\w.-]+)\/([\w.-]+)(?:@.+)?$/.exec(e);return t?{owner:t[1],repo:t[2]}:{owner:"",repo:""}}function L(){let e=/^[\w.-]+\/[\w.-]+@[^:]+:(.+)$/.exec(f().projectRoot)?.[1]??"";return tl(e)??""}function U(){let e=$a();return e?{productionUrl:e.productionUrl??"",projectName:e.projectName}:null}function k(){let e=Ad(),t=i==="loading"?null:i;return{accounts:h.map((n)=>({label:n.name,value:n.id})),busy:c,connected:t?.connected===!0,deploy:U(),deployment:l?{environment:l.environment,stage:l.stage,status:l.status,url:l.url}:null,error:r,form:{...a},hosted:e&&te(f().cfConnect),lapsed:t?.connected===!0&&t.needsReconnect===!0,loading:i==="loading",replacing:g,supported:e,tokenStored:sm()!==""}}function s(){if(m){m.update(k());return}m=j({layer:Lt("modal"),onClosed:B,onConnect:()=>{M()},onDisconnect:()=>{z()},onField:(e,t)=>{a={...a,[e]:t}},onOpenAccounts:_,onRefresh:()=>{y()},onReplaceToken:()=>{g=!0,r="",s()},onSaveToken:(e)=>{E(e)},onSubmit:()=>{V()},view:k()})}async function y(){i="loading",s();try{if(i=await f().cfConnection?.()??null,i?.connected&&!i.needsReconnect){h=await AT(),a={...a,accountId:i.accountId??h[0]?.id??""};let e=$a();if(e)l=await Lm(e),$p(l)}}catch(e){i=null,r=e instanceof Error?e.message:String(e)}s()}async function E(e){let t=e.trim();if(!t){r="Paste a token, or use Preferences › Accounts to forget the stored one.",s();return}uS(t),g=!1,r="",await y()}function _(){ae()?.run("app.preferences",{section:"accounts"})}async function M(){c=!0,r="",s();try{let e=await f().cfConnect?.()??null;if(e?.status==="timeout")r="The Cloudflare window didn't finish. Sign in there, then reconnect — nothing was changed.";else if(e?.status==="connected"&&!e.connection.accountId){let{openCfAccountPicker:t}=await (we("wccaenh6"),import("./cf-account-picker-wccaenh6.js"));await t()}}catch(e){r=e instanceof Error?e.message:String(e)}c=!1,Wo(),await y()}async function V(){let e=x();if(!e)return;if(!a.projectName||!a.owner||!a.repo||!a.accountId){r="Account, project name, and the GitHub owner/repo are all required.",s();return}c=!0,r="",s();try{let t=L(),n={accountId:a.accountId,owner:a.owner,productionBranch:a.branch||"main",projectName:a.projectName,repo:a.repo};if(t)n.rootDir=t;let u=await PT(e,n);l=await Lm(u).catch(()=>null)}catch(t){r=t instanceof Error?t.message:String(t)}c=!1,s()}async function z(){let e=x();if(!e)return;c=!0,s();try{await fC(e,null),l=null}catch(t){r=t instanceof Error?t.message:String(t)}c=!1,s()}function B(){let e=m;m=null,e?.close()}function nS(e){i={accountId:e.accountId??"demo-account",connected:!0},h=[],l=e.deployment,$p(e.deployment),r="",c=!1,g=!1,s()}function JI(){let e=x(),{owner:t,repo:n}=H();i="loading",h=[],l=null,r="",c=!1,g=!1,a={accountId:"",branch:"main",owner:t,projectName:$a()?.projectName??T(e?.name??""),repo:n},s(),y()}
2
- export{tl,nS,JI};
1
+ import{Pt,Nt,ae}from"./studio-q7rtx6zq.js";import{p}from"./studio-w4rz9hdk.js";import{us}from"./studio-4hp8pkyt.js";import{g}from"./studio-43sd2mam.js";import{qe,ft,T,R,Jt,tt}from"./studio-x9hsze61.js";import{Wl,dN,wb,YT,uN,Ri,Pd}from"./studio-3e54qh39.js";import{sb,ME}from"./studio-zcd2e7yz.js";import{x}from"./studio-gcxk20n7.js";import{te}from"./studio-vxq7fcvv.js";import{le}from"./studio-qgh13jtz.js";function Dl(e){let t=e.trim().replaceAll("\\","/").split("/").filter((n)=>n!=="");return t.some((n)=>n==="."||n==="..")?null:t.join("/")}var w={$schema:"https://jxsuite.com/schema/v1",$id:"StudioPublish",$description:"Publish: the one-click Cloudflare Pages flow, as a `jx-dialog` over the kit. Eight bodies, one at a time, because the reader is at exactly one point of a chain — a host that cannot reach Cloudflare at all, a question still in flight, a connection that lapsed, an invitation to connect, a stored token Cloudflare refused, a field to paste a replacement into, the create-and-connect form, and the connected status. `publish/publish-panel.ts` keeps every one of those decisions and the calls that settle them; this document knows only which of the eight it was told to draw. **The token is never painted.** The field below binds no `value` — it is written by the reader and read once, on its way to storage — so a stored secret cannot reach the attribute, the serialised HTML or the accessibility tree, which is `studio.md` §15 rule 1 written as a missing binding rather than as a rule somebody remembers.",tagName:"jx-dialog",$props:{headline:"Publish",confirmLabel:"",cancelLabel:"Close",size:"md"},attributes:{part:"publish"},oncancel:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},onclose:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},style:{$description:"What the five `.publish-*` names carried, keyed on `part`, and most of them do not survive the move. `.publish-modal` and its `.new-project-modal` base were a fixed card, a scroll body, a border, a shadow and a `z-index: 1000` — a modal `<dialog>` is every one of those, and the top layer is what the z-index was climbing towards. `.publish-field` was a label stacked over a control, which is `jx-field`'s whole shape. What is left is the column gap between bodies, the two button rows, the hint and the refusal. Nothing here uses `--spectrum-*`: those custom properties resolve only inside `<sp-theme>`, and a document mounted in a layer host is outside it, so each would silently have taken its hard-coded fallback.",'& [part="body"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-3)"},'& [part="note"], & [part="status-line"], & [part="deployment"]':{margin:"0",lineHeight:"1.5"},'& [part="rows"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-3)"},'& [part="actions"]':{$description:'Wraps rather than overflows (studio-ui-guidelines.md §4.6): two buttons whose labels are whole phrases — "Verify & Connect", "Preferences › Accounts" — are wider than a narrow dialog at the sizes a reader may have set.',display:"flex",flexWrap:"wrap",gap:"var(--jx-space-2)"},'& [part="submit"]':{alignSelf:"flex-start"},'& [part="hint"]':{$description:"Publishing rides every commit, so the connected body's only job is to say what is already happening. Dim, because it is a standing fact rather than something to act on.",margin:"0",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"},'& [part="failure"]':{$description:'`failure` and not `error`: `jx-textfield` and `jx-select` each draw a `[part="error"]` of their own inside this same tree, and the kit is light DOM — a scoped rule on that name would restyle the token field\'s refusal line too.',margin:"0",color:"var(--danger)",lineHeight:"1.5"},'& [part="link"], & [part="install-link"]':{color:"var(--accent)",textDecoration:"underline"},"& code":{fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-sm)"}},children:[{tagName:"div",attributes:{part:"body"},children:[{tagName:"div",attributes:{part:"body-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/body"},cases:{unsupported:{tagName:"p",attributes:{part:"note"},children:["This platform cannot reach the Cloudflare API. Publish by committing and pushing — your host builds ",{tagName:"code",textContent:"bunx jx build"}," and serves ",{tagName:"code",textContent:"dist/"},"."]},loading:{tagName:"p",attributes:{part:"note"},textContent:"Checking Cloudflare connection…"},lapsed:{tagName:"div",attributes:{part:"lapsed",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"note"},textContent:"Your Cloudflare connection has expired, so publishing cannot reach your account. Reconnect to restore it — this site's Pages project and its settings are untouched."},{tagName:"jx-button",$props:{variant:"accent",disabled:{$ref:"#/state/busy"}},attributes:{part:"reconnect"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/connect"},value:[]}]},children:[{tagName:"span",textContent:"${state.connectLabel}"}]}]},hosted:{tagName:"div",attributes:{part:"hosted",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"note"},textContent:"Connect your Cloudflare account to publish this site."},{tagName:"jx-button",$props:{disabled:{$ref:"#/state/busy"}},attributes:{part:"connect"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/connect"},value:[]}]},children:[{tagName:"span",textContent:"Connect Cloudflare"}]}]},stored:{tagName:"div",attributes:{part:"stored",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"note"},textContent:"A Cloudflare API token is stored on this machine, and Cloudflare did not accept it. It may have been revoked, or it may be missing the Account Settings Read and Pages Read/Write permissions."},{tagName:"div",attributes:{part:"actions"},children:[{tagName:"jx-button",$props:{disabled:{$ref:"#/state/busy"}},attributes:{part:"replace"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/replace"},value:[]}]},children:[{tagName:"span",textContent:"Replace token"}]},{tagName:"jx-button",$props:{quiet:!0},attributes:{part:"accounts"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openAccounts"},value:[]}]},children:[{tagName:"span",textContent:"Preferences › Accounts"}]}]}]},token:{tagName:"div",attributes:{part:"token-form",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"note"},textContent:"Paste a Cloudflare API token (permissions: Account Settings Read, Pages Read/Write). It is stored on this machine and only sent to the same-origin proxy — Studio never renders it back."},{tagName:"jx-field",$props:{span:!0,label:"API token"},attributes:{part:"token-row","data-field":"token"},children:[{tagName:"jx-textfield",$description:"No `value` binding, and its absence is the contract: a secret may pass through a field the reader typed it into and may never be painted into one they did not. The draft lives in the adapter's closure until Verify reads it, so nothing here — not the attribute, not the accessibility tree, not a DOM dump — has ever held it.",$props:{type:"password",placeholder:"cf_..."},attributes:{part:"token"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setToken"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"div",attributes:{part:"actions"},children:[{tagName:"jx-button",$props:{variant:"accent",disabled:{$ref:"#/state/busy"}},attributes:{part:"verify"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/verify"},value:[]}]},children:[{tagName:"span",textContent:"Verify & Connect"}]},{tagName:"jx-button",$props:{quiet:!0},attributes:{part:"accounts"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openAccounts"},value:[]}]},children:[{tagName:"span",textContent:"Preferences › Accounts"}]}]}]},form:{tagName:"div",attributes:{part:"connect-form",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"note"},children:["Create a Cloudflare Pages project connected to this repository. Every commit then builds and publishes automatically (",{tagName:"code",textContent:"bunx jx build"},")."]},{tagName:"div",attributes:{part:"rows"},children:[{tagName:"jx-field",$props:{span:!0,label:"Account"},attributes:{part:"row","data-field":"account"},children:[{tagName:"jx-select",$props:{options:{$ref:"#/state/accountOptions"},value:{$ref:"#/state/accountId"}},attributes:{part:"account"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setAccount"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-field",$props:{span:!0,label:"Pages project name"},attributes:{part:"row","data-field":"projectName"},children:[{tagName:"jx-textfield",$props:{value:{$ref:"#/state/projectName"}},attributes:{part:"project-name"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setProjectName"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-field",$props:{span:!0,label:"GitHub owner"},attributes:{part:"row","data-field":"owner"},children:[{tagName:"jx-textfield",$props:{value:{$ref:"#/state/owner"}},attributes:{part:"owner"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setOwner"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-field",$props:{span:!0,label:"GitHub repository"},attributes:{part:"row","data-field":"repo"},children:[{tagName:"jx-textfield",$props:{value:{$ref:"#/state/repo"}},attributes:{part:"repo"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setRepo"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-field",$props:{span:!0,label:"Production branch"},attributes:{part:"row","data-field":"branch"},children:[{tagName:"jx-textfield",$props:{value:{$ref:"#/state/branch"}},attributes:{part:"branch"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setBranch"},value:[{$ref:"event#/target/value"}]}]}}]}]},{tagName:"jx-button",$props:{variant:"accent",disabled:{$ref:"#/state/busy"}},attributes:{part:"submit"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/submit"},value:[]}]},children:[{tagName:"span",textContent:"${state.submitLabel}"}]}]},status:{tagName:"div",attributes:{part:"status",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"status-line"},children:["Connected to Pages project ",{tagName:"strong",attributes:{part:"project-name"},textContent:"${state.deployProject}"},{tagName:"span",attributes:{part:"site-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasProductionUrl"},cases:{true:{tagName:"span",children:[" — ",{tagName:"a",attributes:{part:"link",href:"${state.productionUrl}",target:"_blank",rel:"noreferrer"},textContent:"${state.productionUrl}"}]}}}]},{tagName:"div",attributes:{part:"deployment-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasDeployment"},cases:{true:{tagName:"p",attributes:{part:"deployment"},children:["Latest deployment: ",{tagName:"strong",attributes:{part:"deployment-state"},textContent:"${state.deploymentState}"}," (${state.deploymentEnvironment}) — ",{tagName:"a",attributes:{part:"link",href:"${state.deploymentUrl}",target:"_blank",rel:"noreferrer"},textContent:"preview"}]},false:{tagName:"p",attributes:{part:"deployment"},textContent:"No deployments yet — the first commit after connecting triggers one."}}},{tagName:"p",attributes:{part:"hint"},textContent:"Publishing happens automatically on every commit."},{tagName:"div",attributes:{part:"actions"},children:[{tagName:"jx-button",$props:{disabled:{$ref:"#/state/busy"}},attributes:{part:"refresh"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/refresh"},value:[]}]},children:[{tagName:"span",textContent:"Refresh"}]},{tagName:"jx-button",$props:{variant:"negative",disabled:{$ref:"#/state/busy"}},attributes:{part:"disconnect"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/disconnect"},value:[]}]},children:[{tagName:"span",textContent:"Disconnect"}]}]}]}}},{tagName:"div",attributes:{part:"failure-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasFailure"},cases:{true:{tagName:"p",attributes:{part:"failure"},children:["${state.failure}",{tagName:"span",attributes:{part:"pages-app-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/needsPagesApp"},cases:{true:{tagName:"span",children:[" — if the Cloudflare Pages GitHub App is not installed on the repository, ",{tagName:"a",attributes:{part:"install-link",href:"${state.pagesAppUrl}",target:"_blank",rel:"noreferrer"},textContent:"install it"}," and retry."]}}}]}}}]}]};T("publish",w);var D="https://github.com/apps/cloudflare-pages/installations/new";function I(e){if(!e.supported)return"unsupported";if(e.loading)return"loading";if(e.connected&&e.lapsed)return"lapsed";if(!e.connected){if(e.hosted)return"hosted";return e.tokenStored&&!e.replacing?"stored":"token"}return e.deploy?"status":"form"}function j(e){let{error:t}=e;return{accountId:e.form.accountId,accountOptions:e.accounts,body:I(e),branch:e.form.branch,busy:e.busy,connectLabel:e.busy?"Reconnecting…":"Reconnect Cloudflare",deploymentEnvironment:e.deployment?.environment??"",deploymentState:e.deployment?`${e.deployment.stage}: ${e.deployment.status}`:"",deploymentUrl:e.deployment?.url??"",deployProject:e.deploy?.projectName??"",failure:t,hasDeployment:e.deployment!==null,hasFailure:t!=="",hasProductionUrl:(e.deploy?.productionUrl??"")!=="",needsPagesApp:/github/i.test(t)&&/app|install|source|repo/i.test(t),owner:e.form.owner,pagesAppUrl:D,productionUrl:e.deploy?.productionUrl??"",projectName:e.form.projectName,repo:e.form.repo,submitLabel:e.busy?"Connecting…":"Create & Connect"}}function k(e){let t=document.createElement("div");t.style.pointerEvents="auto",e.layer.append(t);let n="",m=!1,P=()=>{if(m)return;m=!0,e.onClosed()},C=()=>m,d=g({...j(e.view),closed:P,connect:()=>{e.onConnect()},disconnect:()=>{e.onDisconnect()},openAccounts:()=>{e.onOpenAccounts()},refresh:()=>{e.onRefresh()},replace:()=>{n="",e.onReplaceToken()},setAccount:(o)=>{d.accountId=o,e.onField("accountId",o)},setBranch:(o)=>{d.branch=o,e.onField("branch",o)},setOwner:(o)=>{d.owner=o,e.onField("owner",o)},setProjectName:(o)=>{d.projectName=o,e.onField("projectName",o)},setRepo:(o)=>{d.repo=o,e.onField("repo",o)},setToken:(o)=>{n=o},submit:()=>{e.onSubmit()},verify:()=>{let o=n;n="",e.onSaveToken(o)}}),y=null,A=R("publish",d,t).then(async(o)=>{y=o;let u=o.root;if(C())return o.dispose(),u;if(await Jt(u),C())return u;return(u.querySelector('dialog[part="dialog"]')??u).setAttribute(qe,ft("modal","publish")),Pt(u),u});return{close(){let o=y?.root;if(o instanceof HTMLElement)Nt(o);y?.dispose(),y=null,n="",t.remove(),P()},host:t,ready:A,update(o){Object.assign(d,j(o))}}}var f=null,i="loading",h=[],l=null,r="",c=!1,b=!1,a={accountId:"",branch:"main",owner:"",projectName:"",repo:""};function N(){return x?.projectConfig??null}function O(e){return e.toLowerCase().replaceAll(/[^a-z0-9]+/g,"-").replaceAll(/^-+|-+$/g,"").slice(0,58)||"site"}function H(){let e=p().projectRoot,t=/^([\w.-]+)\/([\w.-]+)(?:@.+)?$/.exec(e);return t?{owner:t[1],repo:t[2]}:{owner:"",repo:""}}function L(){let e=/^[\w.-]+\/[\w.-]+@[^:]+:(.+)$/.exec(p().projectRoot)?.[1]??"";return Dl(e)??""}function U(){let e=Ri();return e?{productionUrl:e.productionUrl??"",projectName:e.projectName}:null}function S(){let e=Wl(),t=i==="loading"?null:i;return{accounts:h.map((n)=>({label:n.name,value:n.id})),busy:c,connected:t?.connected===!0,deploy:U(),deployment:l?{environment:l.environment,stage:l.stage,status:l.status,url:l.url}:null,error:r,form:{...a},hosted:e&&te(p().cfConnect),lapsed:t?.connected===!0&&t.needsReconnect===!0,loading:i==="loading",replacing:b,supported:e,tokenStored:sb()!==""}}function s(){if(f){f.update(S());return}f=k({layer:tt("modal"),onClosed:B,onConnect:()=>{M()},onDisconnect:()=>{z()},onField:(e,t)=>{a={...a,[e]:t}},onOpenAccounts:_,onRefresh:()=>{v()},onReplaceToken:()=>{b=!0,r="",s()},onSaveToken:(e)=>{E(e)},onSubmit:()=>{V()},view:S()})}async function v(){i="loading",s();try{if(i=await p().cfConnection?.()??null,i?.connected&&!i.needsReconnect){h=await dN(),a={...a,accountId:i.accountId??h[0]?.id??""};let e=Ri();if(e)l=await wb(e),Pd(l)}}catch(e){i=null,r=e instanceof Error?e.message:String(e)}s()}async function E(e){let t=e.trim();if(!t){r="Paste a token, or use Preferences › Accounts to forget the stored one.",s();return}ME(t),b=!1,r="",await v()}function _(){ae()?.run("app.preferences",{section:"accounts"})}async function M(){c=!0,r="",s();try{let e=await p().cfConnect?.()??null;if(e?.status==="timeout")r="The Cloudflare window didn't finish. Sign in there, then reconnect — nothing was changed.";else if(e?.status==="connected"&&!e.connection.accountId){let{openCfAccountPicker:t}=await (le("haqazq5r"),import("./cf-account-picker-haqazq5r.js"));await t()}}catch(e){r=e instanceof Error?e.message:String(e)}c=!1,us(),await v()}async function V(){let e=N();if(!e)return;if(!a.projectName||!a.owner||!a.repo||!a.accountId){r="Account, project name, and the GitHub owner/repo are all required.",s();return}c=!0,r="",s();try{let t=L(),n={accountId:a.accountId,owner:a.owner,productionBranch:a.branch||"main",projectName:a.projectName,repo:a.repo};if(t)n.rootDir=t;let m=await uN(e,n);l=await wb(m).catch(()=>null)}catch(t){r=t instanceof Error?t.message:String(t)}c=!1,s()}async function z(){let e=N();if(!e)return;c=!0,s();try{await YT(e,null),l=null}catch(t){r=t instanceof Error?t.message:String(t)}c=!1,s()}function B(){let e=f;f=null,e?.close()}function Ck(e){i={accountId:e.accountId??"demo-account",connected:!0},h=[],l=e.deployment,Pd(e.deployment),r="",c=!1,b=!1,s()}function q2(){let e=N(),{owner:t,repo:n}=H();i="loading",h=[],l=null,r="",c=!1,b=!1,a={accountId:"",branch:"main",owner:t,projectName:Ri()?.projectName??O(e?.name??""),repo:n},s(),v()}
2
+ export{Dl,Ck,q2};
3
3
 
4
- //# debugId=1C679819F42A75C964756E2164756E21
5
- //# sourceMappingURL=studio-2j1cb95x.js.map
4
+ //# debugId=7F93180A599560B064756E2164756E21
5
+ //# sourceMappingURL=studio-6m380wp7.js.map
@@ -0,0 +1,4 @@
1
+ import{Sy,va,e_,ss,t_,as}from"./studio-83mk4bgg.js";import{$e}from"./studio-p4nrkvqr.js";import{n,Z,v}from"./studio-vxq7fcvv.js";var zI="meta",WI="frontmatter",VI="structure",UI="source",qI=2;function m(e){return v(e)}function _u(e){return e.getMap(zI)}function GI(e){return e.getMap(WI)}function Dg(e){return e.getMap(VI)}function KI(e){return e.getText(UI)}var Y=new Set(["textContent"]),h=new Set(["style","attributes","$props"]);function y(e,t){let o=e.toString();if(o===t)return!1;let r=0,s=Math.min(o.length,t.length);while(r<s&&o[r]===t[r])r+=1;let a=o.length,i=t.length;while(a>r&&i>r&&o[a-1]===t[i-1])a-=1,i-=1;if(a>r)e.delete(r,a-r);if(i>r)e.insert(r,t.slice(r,i));return!0}function f(e){let t=new ss;for(let[o,r]of Object.entries(e)){if(r===void 0)continue;t.set(o,m(r)?f(r):$e(r))}return t}function g(e,t){for(let o of[...e.keys()])if(!(o in t)||t[o]===void 0)e.delete(o);for(let[o,r]of Object.entries(t)){if(r===void 0)continue;let s=e.get(o);if(m(r))if(s instanceof ss)g(s,r);else e.set(o,f(r));else if(!b(s,r))e.set(o,$e(r))}}function b(e,t){if(e===t)return!0;if(e instanceof ss||e instanceof va||e instanceof as)return!1;return JSON.stringify(e??null)===JSON.stringify(t??null)}function d(e){return n(e)?new as(e):JI(e)}function Hf(e){let t=new va;return t.insert(0,e.map((o)=>d(o))),t}function JI(e){if(!m(e))throw TypeError("collab-schema: a document node must be a plain object");let t=new ss;for(let[o,r]of Object.entries(e)){if(r===void 0)continue;if(o==="children"&&Array.isArray(r))t.set(o,Hf(r));else if(Y.has(o)&&n(r))t.set(o,new as(r));else if(h.has(o)&&m(r))t.set(o,f(r));else t.set(o,$e(r))}return t}function S(e){return Object.fromEntries(Array.from(e.entries(),([t,o])=>[t,Bf(o)]))}function E(e){if(n(e))return e;return e instanceof as?e.toString():S(e)}function Bf(e){if(e instanceof ss)return S(e);if(e instanceof va)return e.toArray().map((t)=>Bf(t));if(e instanceof as)return e.toString();return e}function l2(e){return S(Dg(e))}function X0(e,t){let o=Dg(e);for(let r of t)if(o instanceof ss)o=o.get(String(r));else if(o instanceof va){let s=Number(r);if(!Number.isInteger(s)||s<0||s>=o.length)return;o=o.get(s)}else return;return o}function pk(e,t,o){let r=KI(e);if(r.toString()===t)return!1;return e.transact(()=>{y(r,t)},o),!0}function c2(e,t,o={}){let r=_u(e);if(r.get("structureSeeded")===!0)return!1;return e.transact(()=>{let s=Dg(e);for(let[i,c]of Object.entries(t)){if(c===void 0)continue;if(i==="children"&&Array.isArray(c))s.set(i,Hf(c));else s.set(i,$e(c))}let a=GI(e);for(let[i,c]of Object.entries(o.frontmatter??{}))if(c!==void 0)a.set(i,$e(c));r.set("schemaVersion",qI),r.set("canonical","structure"),r.set("canonicalRev",0),r.set("sourceFormat",o.sourceFormat??null),r.set("structureSeeded",!0)},o.origin),!0}var d2="jx-local",u2="jx-mirror",h2="jx-seed";class Su extends Error{constructor(e){super(`collab-path-unresolved:${e.join("/")}`);this.name="CollabPathError"}}function O(e,t){let o=X0(e,t);if(!(o instanceof ss))throw new Su(t);return o}function p(e,t,o){let r=O(e,t),s=r.get("children");if(s instanceof va)return s;if(o&&s===void 0){let a=new va;return r.set("children",a),a}throw new Su([...t,"children"])}function J(e,t,o){let r=e.get(t);if(t==="children"&&Array.isArray(o)){e.set(t,Hf(o));return}if(Y.has(t)&&n(o)){if(r instanceof as)y(r,o);else e.set(t,new as(o));return}if(h.has(t)&&v(o)){if(r instanceof ss)g(r,o);else e.set(t,f(o));return}e.set(t,$e(o))}function V(e,t){let{op:o}=t;switch(t.op){case"set-key":{let r=O(e,t.path);if(t.value===void 0)r.delete(t.key);else J(r,t.key,t.value);return}case"insert-child":{let r=p(e,t.parentPath,!0);if(t.index<0||t.index>r.length)throw new Su([...t.parentPath,"children",t.index]);r.insert(t.index,[d(t.node)]);return}case"remove-child":{let r=p(e,t.parentPath,!1);if(t.index<0||t.index>=r.length)throw new Su([...t.parentPath,"children",t.index]);r.delete(t.index,1);return}case"set-child":{let r=p(e,t.parentPath,!1);if(t.index<0||t.index>=r.length)throw new Su([...t.parentPath,"children",t.index]);let s=r.get(t.index);if(s instanceof as&&n(t.node)){y(s,t.node);return}r.delete(t.index,1),r.insert(t.index,[d(t.node)]);return}case"move-child":{let r=p(e,t.fromParentPath,!1),s=p(e,t.toParentPath,!0);if(t.fromIndex<0||t.fromIndex>=r.length)throw new Su([...t.fromParentPath,"children",t.fromIndex]);let a=Bf(r.get(t.fromIndex));if(r.delete(t.fromIndex,1),t.toIndex<0||t.toIndex>s.length)throw new Su([...t.toParentPath,"children",t.toIndex]);s.insert(t.toIndex,[d(a)]);return}default:throw Error(`unknown-doc-op:${o}`)}}function p2(e,t,o){e.transact(()=>{for(let r of t)V(e,r)},o)}function w(e){for(let t=0;t<e.length;t++){let o=e[t];if(!n(o))continue;if(h.has(o))return{key:o,nodePath:e.slice(0,t)};if(Y.has(o))return{key:o,nodePath:e.slice(0,t)}}return null}function P(e){return e instanceof as||e instanceof ss||n(e)}function C(e){return e.every((t)=>n(t)||Z(t))}function f2(e){if(e.length===0)return[];let t=e.map((s)=>s.path);if(!t.every((s)=>C(s)))return null;for(let s=0;s<t.length;s++)for(let a=0;a<t.length;a++){if(s===a)continue;let i=t[s],c=t[a];if(i.length<=c.length&&i.every((u,l)=>u===c[l]))return null}if(e.filter((s)=>s instanceof Sy).length>1)return null;let r=[];for(let s of e){let{path:a}=s,i=w(a);if(i){let{doc:c}=s.target;if(!c)return null;let u=X0(c,[...i.nodePath,i.key]);if(u===void 0)return null;r.push({key:i.key,op:"set-key",path:i.nodePath,value:Bf(u)});continue}if(s instanceof t_){let c=a.at(-1);if(a.at(-2)==="children"&&Z(c)){r.push({index:c,node:s.target.toString(),op:"set-child",parentPath:a.slice(0,-2)});continue}return null}if(s instanceof e_){let c=s.target;for(let[u,l]of s.changes.keys)if(l.action==="delete")r.push({key:u,op:"set-key",path:a});else r.push({key:u,op:"set-key",path:a,value:Bf(c.get(u))})}else if(s instanceof Sy){if(a.at(-1)!=="children")return null;let c=a.slice(0,-1),u=0;for(let l of s.changes.delta)if(l.retain!==void 0)u+=l.retain;else if(l.delete!==void 0)for(let x=0;x<l.delete;x++)r.push({index:u,op:"remove-child",parentPath:c});else if(l.insert!==void 0){let x=Array.isArray(l.insert)?l.insert:[l.insert];for(let D of x){if(!P(D))return null;r.push({index:u,node:E(D),op:"insert-child",parentPath:c}),u+=1}}}else return null}return r}function m2(e,t,o){e.transact(()=>{let r=Dg(e),s=[...r.keys()];for(let i of s)if(!(i in t)||t[i]===void 0)r.delete(i);for(let[i,c]of Object.entries(t)){if(c===void 0)continue;if(i==="children"&&Array.isArray(c))r.set(i,Hf(c));else r.set(i,$e(c))}let a=_u(e);a.set("canonicalRev",Number(a.get("canonicalRev")??0)+1)},o)}function fk(e){return _u(e).get("canonical")==="source"?"source":"structure"}function mk(e){return Number(_u(e).get("canonicalRev")??0)}function g2(e,t,o){if(fk(e)==="source")return!1;return e.transact(()=>{pk(e,t,o);let r=_u(e);r.set("canonical","source"),r.set("canonicalRev",mk(e)+1)},o),!0}function b2(e,t){if(fk(e)!=="source")return!1;return e.transact(()=>{let o=_u(e);o.set("canonical","structure"),o.set("canonicalRev",mk(e)+1)},t),!0}function v2(e,t,o){let r=[];for(let[s,a]of e.getStates()){let i=a;if(s!==o&&i.mode==="source"&&i.focusedPath===t)r.push(s)}return r}function y2(e,t){let o=e.clientID,r=e.getStates().get(o);if(r?.mode!=="source"||r.focusedPath!==t)return!1;let s=o;for(let[a,i]of e.getStates()){let c=i;if(c.mode==="source"&&c.focusedPath===t&&c.canWrite!==!1&&a<s)s=a}return s===o}var gk=["#4f9cf9","#e5484d","#30a46c","#f5a524","#8e4ec6","#00a2c7","#e93d82","#a8845c"];function w2(e){let t=5381;for(let r=0;r<e.length;r++)t=Math.imul(t,33)+(e.codePointAt(r)??0);let o=Math.abs(t)%gk.length;return gk[o]}export{zI,WI,VI,UI,qI,_u,GI,Dg,KI,Hf,JI,Bf,l2,X0,pk,c2,d2,u2,h2,Su,p2,f2,m2,fk,mk,g2,b2,v2,y2,gk,w2};
2
+
3
+ //# debugId=927469AD1BAD395664756E2164756E21
4
+ //# sourceMappingURL=studio-80jyh1xh.js.map