@jxsuite/studio 2.0.0 → 2.1.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 (419) hide show
  1. package/canvas.html +21 -0
  2. package/dist/chunks/Overlay.dev-qfjzkms8.js +23 -0
  3. package/dist/chunks/{Overlay.dev-cszx7yn5.js.map → Overlay.dev-qfjzkms8.js.map} +1 -1
  4. package/dist/chunks/{adapter-z8fkmbmv.js → adapter-qfnesn5v.js} +2 -2
  5. package/dist/chunks/{cf-settings-mmyv436d.js → cf-settings-73sh5z4p.js} +3 -3
  6. package/dist/chunks/{components-0hzentwq.js → components-2bpqp4mq.js} +5 -7
  7. package/dist/chunks/{components-0hzentwq.js.map → components-2bpqp4mq.js.map} +1 -1
  8. package/dist/chunks/content-source-34gnkbnn.js +38 -0
  9. package/dist/chunks/content-source-34gnkbnn.js.map +9 -0
  10. package/dist/chunks/convert-to-repeater-t8kxre5s.js +258 -0
  11. package/dist/chunks/convert-to-repeater-t8kxre5s.js.map +10 -0
  12. package/dist/chunks/extension-sections-6mqydz35.js +301 -0
  13. package/dist/chunks/extension-sections-6mqydz35.js.map +11 -0
  14. package/dist/chunks/files-8kn321h1.js +70 -0
  15. package/dist/chunks/files-8kn321h1.js.map +9 -0
  16. package/dist/chunks/{format-host-2c188n41.js → format-host-mkwsmt8d.js} +3 -3
  17. package/dist/chunks/git-panel-tjbr191d.js +51 -0
  18. package/dist/chunks/git-panel-tjbr191d.js.map +9 -0
  19. package/dist/chunks/{index-baeg2x3y.js → index-7pxchcce.js} +4 -3
  20. package/dist/chunks/{index-baeg2x3y.js.map → index-7pxchcce.js.map} +3 -3
  21. package/dist/chunks/{jx-validate-qx8degj7.js → jx-validate-v6qgknrs.js} +3 -3
  22. package/dist/chunks/layers-panel-87pb25km.js +58 -0
  23. package/dist/chunks/layers-panel-87pb25km.js.map +9 -0
  24. package/dist/chunks/{monaco-setup-zjdp9zdw.js → monaco-setup-e0yh25j4.js} +4 -75
  25. package/dist/chunks/{monaco-setup-zjdp9zdw.js.map → monaco-setup-e0yh25j4.js.map} +3 -4
  26. package/dist/chunks/publish-panel-m0fcgdrt.js +21 -0
  27. package/dist/chunks/publish-panel-m0fcgdrt.js.map +9 -0
  28. package/dist/chunks/quick-search-rhs6cbsb.js +53 -0
  29. package/dist/chunks/quick-search-rhs6cbsb.js.map +9 -0
  30. package/dist/chunks/right-panel-zpdxd98t.js +37 -0
  31. package/dist/chunks/right-panel-zpdxd98t.js.map +9 -0
  32. package/dist/chunks/section-registry-zmckaxf4.js +30 -0
  33. package/dist/chunks/section-registry-zmckaxf4.js.map +9 -0
  34. package/dist/chunks/sp-overlay.dev-9ran0sfq.js +18 -0
  35. package/dist/chunks/sp-overlay.dev-9ran0sfq.js.map +9 -0
  36. package/dist/chunks/sp-popover.dev-rebmdncr.js +9 -0
  37. package/dist/chunks/sp-popover.dev-rebmdncr.js.map +9 -0
  38. package/dist/chunks/sp-progress-circle.dev-5vkppfkt.js +15 -0
  39. package/dist/chunks/sp-progress-circle.dev-5vkppfkt.js.map +9 -0
  40. package/dist/chunks/sp-tooltip.dev-ykqrg8h5.js +15 -0
  41. package/dist/chunks/sp-tooltip.dev-ykqrg8h5.js.map +9 -0
  42. package/dist/chunks/{sp-tray.dev-pb2fsd65.js → sp-tray.dev-ey59vfh7.js} +10 -8
  43. package/dist/chunks/{sp-tray.dev-pb2fsd65.js.map → sp-tray.dev-ey59vfh7.js.map} +2 -2
  44. package/dist/chunks/{studio-9qr6fq7p.js → studio-0rqqhrdy.js} +10 -378
  45. package/dist/chunks/{studio-9qr6fq7p.js.map → studio-0rqqhrdy.js.map} +4 -14
  46. package/dist/chunks/{studio-5x6tqqec.js → studio-2sj1jj3v.js} +10 -8
  47. package/dist/chunks/{studio-5x6tqqec.js.map → studio-2sj1jj3v.js.map} +2 -2
  48. package/dist/chunks/{studio-h3fw0wn8.js → studio-3fk1ac9z.js} +6 -4
  49. package/dist/chunks/{studio-h3fw0wn8.js.map → studio-3fk1ac9z.js.map} +2 -2
  50. package/dist/chunks/studio-41exgzhq.js +6690 -0
  51. package/dist/chunks/studio-41exgzhq.js.map +38 -0
  52. package/dist/chunks/{studio-7v2bpweq.js → studio-4mqb9a0j.js} +6 -4
  53. package/dist/chunks/{studio-7v2bpweq.js.map → studio-4mqb9a0j.js.map} +2 -2
  54. package/dist/chunks/studio-50k77cca.js +1787 -0
  55. package/dist/chunks/studio-50k77cca.js.map +18 -0
  56. package/dist/chunks/{studio-56v3zwk6.js → studio-6a0h7sne.js} +10 -8
  57. package/dist/chunks/{studio-56v3zwk6.js.map → studio-6a0h7sne.js.map} +2 -2
  58. package/dist/chunks/studio-6f0am8f2.js +53 -0
  59. package/dist/chunks/studio-6f0am8f2.js.map +10 -0
  60. package/dist/chunks/studio-6nmjc5qk.js +7002 -0
  61. package/dist/chunks/studio-6nmjc5qk.js.map +32 -0
  62. package/dist/chunks/studio-7afd21nw.js +67 -0
  63. package/dist/chunks/studio-7afd21nw.js.map +10 -0
  64. package/dist/chunks/{studio-xze4zrs1.js → studio-7bmdvzne.js} +2 -2
  65. package/dist/chunks/studio-7bmdvzne.js.map +10 -0
  66. package/dist/chunks/studio-8jpzqk5s.js +128 -0
  67. package/dist/chunks/studio-8jpzqk5s.js.map +10 -0
  68. package/dist/chunks/studio-94m77tgk.js +1482 -0
  69. package/dist/chunks/studio-94m77tgk.js.map +13 -0
  70. package/dist/chunks/studio-9je6w5sq.js +1000 -0
  71. package/dist/chunks/studio-9je6w5sq.js.map +16 -0
  72. package/dist/chunks/{studio-w7c6kvk7.js → studio-a7pzveq1.js} +2 -2
  73. package/dist/chunks/{studio-97qcgvdn.js → studio-adn0z1k3.js} +14 -8
  74. package/dist/chunks/{studio-97qcgvdn.js.map → studio-adn0z1k3.js.map} +3 -3
  75. package/dist/chunks/{studio-kr88ryr7.js → studio-bsxxx3x2.js} +17 -15
  76. package/dist/chunks/{studio-kr88ryr7.js.map → studio-bsxxx3x2.js.map} +7 -6
  77. package/dist/chunks/studio-bw5dz6km.js +608 -0
  78. package/dist/chunks/studio-bw5dz6km.js.map +21 -0
  79. package/dist/chunks/studio-c6s5getc.js +4232 -0
  80. package/dist/chunks/studio-c6s5getc.js.map +39 -0
  81. package/dist/chunks/studio-cjm7fdjf.js +451 -0
  82. package/dist/chunks/studio-cjm7fdjf.js.map +14 -0
  83. package/dist/chunks/{studio-cx91mnh8.js → studio-ckwz4d3x.js} +53 -53
  84. package/dist/chunks/{studio-cx91mnh8.js.map → studio-ckwz4d3x.js.map} +5 -5
  85. package/dist/chunks/studio-dg7zyt5x.js +28 -0
  86. package/dist/chunks/studio-dg7zyt5x.js.map +10 -0
  87. package/dist/chunks/studio-dzcyvvvz.js +166 -0
  88. package/dist/chunks/studio-dzcyvvvz.js.map +10 -0
  89. package/dist/chunks/{studio-7kqe41sa.js → studio-evkr5d3b.js} +15 -7
  90. package/dist/chunks/{studio-7kqe41sa.js.map → studio-evkr5d3b.js.map} +5 -4
  91. package/dist/chunks/studio-f12h6177.js +411 -0
  92. package/dist/chunks/studio-f12h6177.js.map +13 -0
  93. package/dist/chunks/studio-hbp1s8m9.js +1817 -0
  94. package/dist/chunks/studio-hbp1s8m9.js.map +14 -0
  95. package/dist/chunks/studio-k2sxjph5.js +15295 -0
  96. package/dist/chunks/studio-k2sxjph5.js.map +235 -0
  97. package/dist/chunks/studio-myje51t3.js +385 -0
  98. package/dist/chunks/studio-myje51t3.js.map +12 -0
  99. package/dist/chunks/studio-na6rwzhw.js +353 -0
  100. package/dist/chunks/studio-na6rwzhw.js.map +11 -0
  101. package/dist/chunks/{studio-4k0m4fmp.js → studio-p471gg5n.js} +126 -3
  102. package/dist/chunks/studio-p471gg5n.js.map +14 -0
  103. package/dist/chunks/{studio-9bjwf0d4.js → studio-rgwcpast.js} +5 -46
  104. package/dist/chunks/{studio-9bjwf0d4.js.map → studio-rgwcpast.js.map} +4 -5
  105. package/dist/chunks/{studio-hhj92gcr.js → studio-s519zc99.js} +3 -3
  106. package/dist/chunks/studio-sas7mt3k.js +75 -0
  107. package/dist/chunks/studio-sas7mt3k.js.map +10 -0
  108. package/dist/chunks/studio-t5wqwzdh.js +74 -0
  109. package/dist/chunks/studio-t5wqwzdh.js.map +10 -0
  110. package/dist/chunks/{studio-9qpspwfn.js → studio-temv5bw4.js} +5 -5
  111. package/dist/chunks/{studio-9qpspwfn.js.map → studio-temv5bw4.js.map} +1 -1
  112. package/dist/chunks/{studio-qkvt37c0.js → studio-tr20m8g8.js} +669 -18
  113. package/dist/chunks/studio-tr20m8g8.js.map +9 -0
  114. package/dist/chunks/{studio-ygzav7z5.js → studio-v96qfnww.js} +5514 -4291
  115. package/dist/chunks/studio-v96qfnww.js.map +54 -0
  116. package/dist/chunks/studio-vcetc91k.js +659 -0
  117. package/dist/chunks/studio-vcetc91k.js.map +10 -0
  118. package/dist/chunks/{studio-n9zmpxjg.js → studio-vmymjefp.js} +2972 -4937
  119. package/dist/chunks/studio-vmymjefp.js.map +98 -0
  120. package/dist/chunks/{studio-bghqfmea.js → studio-wwseqyw0.js} +2 -2
  121. package/dist/chunks/studio-x9hmy5kr.js +390 -0
  122. package/dist/chunks/studio-x9hmy5kr.js.map +10 -0
  123. package/dist/chunks/studio-xa0ce0n7.js +335 -0
  124. package/dist/chunks/studio-xa0ce0n7.js.map +10 -0
  125. package/dist/chunks/studio-xm3dbxvn.js +378 -0
  126. package/dist/chunks/studio-xm3dbxvn.js.map +19 -0
  127. package/dist/chunks/{studio-nqw433kv.js → studio-xmvbhg31.js} +2 -2
  128. package/dist/chunks/studio-zv37yrfa.js +1054 -0
  129. package/dist/chunks/studio-zv37yrfa.js.map +13 -0
  130. package/dist/chunks/{ws-client-q7hkz3j9.js → ws-client-654ts66j.js} +6 -4
  131. package/dist/chunks/ws-client-654ts66j.js.map +11 -0
  132. package/dist/iframe-entry.js +668 -230
  133. package/dist/studio.js +23711 -35185
  134. package/index.html +35 -4685
  135. package/package.json +17 -15
  136. package/src/about/about-modal.ts +42 -11
  137. package/src/browse/library-commands.ts +240 -0
  138. package/src/browse/library-layouts.ts +369 -0
  139. package/src/browse/library-model.ts +396 -0
  140. package/src/browse/library-pane.ts +1049 -0
  141. package/src/browse/library-preview.ts +252 -0
  142. package/src/browse/library-source.ts +150 -0
  143. package/src/canvas/canvas-helpers.ts +33 -9
  144. package/src/canvas/canvas-live-render.ts +45 -29
  145. package/src/canvas/canvas-patcher.ts +151 -31
  146. package/src/canvas/canvas-perf.ts +46 -7
  147. package/src/canvas/canvas-render.ts +1092 -220
  148. package/src/canvas/canvas-surface.ts +240 -0
  149. package/src/canvas/canvas-utils.ts +1166 -124
  150. package/src/canvas/iframe-drop.ts +2 -1
  151. package/src/canvas/iframe-entry.ts +241 -4
  152. package/src/canvas/iframe-host.ts +1226 -143
  153. package/src/canvas/iframe-inline-edit.ts +31 -0
  154. package/src/canvas/iframe-interaction.ts +76 -16
  155. package/src/canvas/iframe-keys.ts +107 -45
  156. package/src/canvas/iframe-overlay.ts +38 -1
  157. package/src/canvas/iframe-protocol.ts +137 -2
  158. package/src/canvas/iframe-render.ts +70 -2
  159. package/src/canvas/iframe-slash.ts +6 -0
  160. package/src/canvas/path-mapping.ts +56 -6
  161. package/src/canvas/surface-registry.ts +292 -0
  162. package/src/collab/collab-commands.ts +244 -0
  163. package/src/collab/collab-session.ts +198 -32
  164. package/src/collab/collab-state.ts +28 -2
  165. package/src/collab/presence-chips.ts +100 -9
  166. package/src/commands/active-registry.ts +42 -0
  167. package/src/commands/app-commands.ts +176 -0
  168. package/src/commands/budget.ts +158 -0
  169. package/src/commands/command-args.ts +253 -0
  170. package/src/commands/context.ts +387 -0
  171. package/src/commands/defaults.ts +580 -0
  172. package/src/commands/keymap.ts +571 -0
  173. package/src/commands/levels.ts +345 -0
  174. package/src/commands/live-context.ts +193 -0
  175. package/src/commands/reference.ts +227 -0
  176. package/src/commands/registry.ts +293 -0
  177. package/src/component-props.ts +3 -2
  178. package/src/content/draft-state.ts +106 -0
  179. package/src/content/entry-commands.ts +282 -0
  180. package/src/content/entry-editor.ts +327 -0
  181. package/src/content/entry-fields.ts +116 -0
  182. package/src/content/entry-model.ts +175 -0
  183. package/src/editor/canvas-context-menu.ts +17 -11
  184. package/src/editor/canvas-slash-bridge.ts +11 -4
  185. package/src/editor/context-menu.ts +804 -204
  186. package/src/editor/convert-to-component.ts +31 -10
  187. package/src/editor/convert-to-repeater.ts +3 -2
  188. package/src/editor/inline-edit-apply.ts +5 -5
  189. package/src/editor/inline-edit.ts +86 -50
  190. package/src/editor/insert-zone-action.ts +1 -1
  191. package/src/editor/shortcuts.ts +1043 -329
  192. package/src/editor/slash-menu.ts +1 -0
  193. package/src/files/elements.ts +166 -0
  194. package/src/files/file-ops.ts +178 -31
  195. package/src/files/files.ts +898 -268
  196. package/src/files/fs-events.ts +21 -0
  197. package/src/files/media-meta.ts +203 -0
  198. package/src/files/media-paths.ts +141 -0
  199. package/src/files/media-upload.ts +7 -3
  200. package/src/files/media-usage.ts +189 -0
  201. package/src/github/github-auth.ts +235 -33
  202. package/src/github/github-publish.ts +80 -21
  203. package/src/grid/grid-controller.ts +152 -12
  204. package/src/grid/grid-layout.ts +225 -20
  205. package/src/grid/grid-open.ts +120 -0
  206. package/src/grid/grid-panel.ts +554 -39
  207. package/src/grid/grid-source.ts +27 -1
  208. package/src/grid/redirects-grid.ts +599 -0
  209. package/src/grid/redirects.ts +398 -0
  210. package/src/grid/sources/content-source.ts +108 -2
  211. package/src/i18n/i18n-commands.ts +322 -0
  212. package/src/new-project/add-repo-modal.ts +8 -10
  213. package/src/new-project/import-tab.ts +34 -9
  214. package/src/new-project/location-fields.ts +9 -1
  215. package/src/new-project/new-project-modal.ts +270 -262
  216. package/src/packages/jxsuite-update.ts +97 -48
  217. package/src/packages/pull-package-sync.ts +18 -9
  218. package/src/page-params.ts +2 -1
  219. package/src/panels/activity-bar.ts +152 -91
  220. package/src/panels/activity-panel.ts +481 -0
  221. package/src/panels/ai-chat/chat-markdown.ts +8 -3
  222. package/src/panels/ai-chat/chat-view.ts +245 -18
  223. package/src/panels/ai-chat/composer.ts +31 -5
  224. package/src/panels/ai-chat/sessions-view.ts +17 -10
  225. package/src/panels/ai-panel.ts +279 -120
  226. package/src/panels/block-action-bar.ts +1115 -224
  227. package/src/panels/bottom-dock.ts +337 -0
  228. package/src/panels/canvas-dnd-bridge.ts +37 -8
  229. package/src/panels/chat-panel.ts +29 -12
  230. package/src/panels/data-explorer.ts +254 -112
  231. package/src/panels/data-grid.ts +10 -4
  232. package/src/panels/dnd.ts +28 -51
  233. package/src/panels/editors.ts +434 -107
  234. package/src/panels/elements-panel.ts +66 -2
  235. package/src/panels/empty-state.ts +112 -0
  236. package/src/panels/events-panel.ts +596 -82
  237. package/src/panels/formula-workspace.ts +408 -218
  238. package/src/panels/frontmatter-fields.ts +51 -10
  239. package/src/panels/frontmatter-panel.ts +357 -79
  240. package/src/panels/git-panel.ts +375 -164
  241. package/src/panels/head-panel.ts +791 -85
  242. package/src/panels/i18n-panel.ts +592 -0
  243. package/src/panels/imports-panel.ts +95 -85
  244. package/src/panels/jump-bar.ts +584 -0
  245. package/src/panels/layers-panel.ts +1106 -328
  246. package/src/panels/left-panel.ts +109 -204
  247. package/src/panels/navigator-panels.ts +131 -0
  248. package/src/panels/overlays.ts +7 -2
  249. package/src/panels/pane-context.ts +1477 -0
  250. package/src/panels/pane-grid.ts +406 -0
  251. package/src/panels/panel-registry.ts +340 -0
  252. package/src/panels/panel-scheduler.ts +75 -0
  253. package/src/panels/problems-panel.ts +234 -0
  254. package/src/panels/properties-panel.ts +946 -1139
  255. package/src/panels/provenance.ts +258 -0
  256. package/src/panels/quick-search.ts +791 -122
  257. package/src/panels/right-panel.ts +228 -102
  258. package/src/panels/seo-modal.ts +395 -0
  259. package/src/panels/settings-pane.ts +203 -0
  260. package/src/panels/signals-panel.ts +354 -137
  261. package/src/panels/statement-editor.ts +41 -25
  262. package/src/panels/statusbar.ts +342 -106
  263. package/src/panels/style-panel.ts +974 -463
  264. package/src/panels/style-utils.ts +3 -3
  265. package/src/panels/stylebook-doc.ts +4 -2
  266. package/src/panels/stylebook-layers-panel.ts +3 -2
  267. package/src/panels/stylebook-panel.ts +51 -26
  268. package/src/panels/tab-strip.ts +1058 -78
  269. package/src/panels/target-line.ts +274 -0
  270. package/src/panels/toolbar.ts +631 -484
  271. package/src/panels/welcome-screen.ts +301 -198
  272. package/src/platform-errors.ts +26 -3
  273. package/src/platform.ts +96 -2
  274. package/src/platforms/cloud.ts +71 -8
  275. package/src/platforms/devserver.ts +92 -29
  276. package/src/publish/deploy-checklist.ts +383 -0
  277. package/src/publish/pages-service.ts +10 -1
  278. package/src/publish/publish-commands.ts +218 -0
  279. package/src/publish/publish-panel.ts +110 -16
  280. package/src/recent-projects.ts +3 -2
  281. package/src/services/a11y-report.ts +505 -0
  282. package/src/services/ai-models.ts +75 -2
  283. package/src/services/ai-project-tools.ts +29 -10
  284. package/src/services/ai-system-prompt.ts +53 -14
  285. package/src/services/ai-tools.ts +39 -3
  286. package/src/services/ai-writes.ts +154 -0
  287. package/src/services/announce.ts +97 -0
  288. package/src/services/automation.ts +424 -175
  289. package/src/services/cem-export.ts +9 -4
  290. package/src/services/clock.ts +61 -0
  291. package/src/services/document-assistant.ts +36 -8
  292. package/src/services/idle.ts +179 -0
  293. package/src/services/import-client.ts +26 -0
  294. package/src/services/monaco-buffer.ts +627 -0
  295. package/src/services/monaco-lazy.ts +36 -0
  296. package/src/services/notify.ts +271 -0
  297. package/src/services/profile.ts +155 -0
  298. package/src/services/references.ts +0 -0
  299. package/src/services/token-lint.ts +3 -2
  300. package/src/services/tool-executor.ts +53 -7
  301. package/src/services/trusted-types.ts +123 -0
  302. package/src/settings/contexts-section.ts +427 -0
  303. package/src/settings/contributed-section.ts +149 -11
  304. package/src/settings/css-vars-editor.ts +306 -349
  305. package/src/settings/defs-editor.ts +93 -34
  306. package/src/settings/dependencies-editor.ts +7 -7
  307. package/src/settings/extension-sections.ts +37 -5
  308. package/src/settings/general-settings.ts +204 -121
  309. package/src/settings/locales-section.ts +347 -0
  310. package/src/settings/preferences-accounts.ts +140 -0
  311. package/src/settings/preferences-dialog.ts +620 -0
  312. package/src/settings/preferences-keymap.ts +270 -0
  313. package/src/settings/project-sections.ts +260 -0
  314. package/src/settings/section-registry.ts +169 -0
  315. package/src/settings/settings-document.ts +385 -0
  316. package/src/shell.ts +1549 -0
  317. package/src/site-context.ts +45 -20
  318. package/src/state.ts +14 -275
  319. package/src/store.ts +88 -43
  320. package/src/studio.ts +790 -346
  321. package/src/style/live-preview.ts +36 -0
  322. package/src/style/project-styles.ts +349 -0
  323. package/src/style/token-ref.ts +123 -0
  324. package/src/tabs/patch-ops.ts +16 -4
  325. package/src/tabs/project-config.ts +416 -0
  326. package/src/tabs/selection.ts +323 -0
  327. package/src/tabs/tab.ts +182 -47
  328. package/src/tabs/transact.ts +209 -28
  329. package/src/types.ts +68 -13
  330. package/src/ui/ai-credentials-form.ts +39 -35
  331. package/src/ui/ai-managed-connect.ts +113 -0
  332. package/src/ui/dynamic-slot.ts +224 -81
  333. package/src/ui/expression-editor.ts +71 -63
  334. package/src/ui/field-input.ts +4 -6
  335. package/src/ui/field-row.ts +215 -38
  336. package/src/ui/form-controls.ts +194 -7
  337. package/src/ui/layers.ts +492 -69
  338. package/src/ui/media-picker.ts +115 -25
  339. package/src/ui/panel-resize.ts +109 -91
  340. package/src/ui/progress-modal.ts +131 -50
  341. package/src/ui/regions.ts +462 -0
  342. package/src/ui/schema-form.ts +229 -45
  343. package/src/ui/spectrum.ts +24 -8
  344. package/src/ui/timing.ts +49 -0
  345. package/src/ui/value-selector.ts +20 -0
  346. package/src/ui/value-source.ts +348 -0
  347. package/src/ui/virtual-window.ts +400 -0
  348. package/src/utils/edit-display.ts +3 -2
  349. package/src/utils/inherited-style.ts +67 -37
  350. package/src/view.ts +64 -78
  351. package/src/workspace/pane-derive.ts +1258 -0
  352. package/src/workspace/session.ts +317 -0
  353. package/src/workspace/workspace.ts +1345 -23
  354. package/styles/canvas.css +653 -0
  355. package/styles/forced-colors.css +106 -0
  356. package/styles/inspector.css +1454 -0
  357. package/styles/overlays.css +2704 -0
  358. package/styles/panels.css +1701 -0
  359. package/styles/shell.css +1423 -0
  360. package/styles/tokens.css +151 -0
  361. package/dist/chunks/Overlay.dev-cszx7yn5.js +0 -22
  362. package/dist/chunks/extension-sections-qct0gt8f.js +0 -531
  363. package/dist/chunks/extension-sections-qct0gt8f.js.map +0 -12
  364. package/dist/chunks/files-02zn5y24.js +0 -50
  365. package/dist/chunks/files-02zn5y24.js.map +0 -9
  366. package/dist/chunks/git-panel-mbb0y0hz.js +0 -28
  367. package/dist/chunks/git-panel-mbb0y0hz.js.map +0 -9
  368. package/dist/chunks/layers-panel-9qekmqk1.js +0 -26
  369. package/dist/chunks/layers-panel-9qekmqk1.js.map +0 -9
  370. package/dist/chunks/settings-modal-gj0hrah4.js +0 -29
  371. package/dist/chunks/settings-modal-gj0hrah4.js.map +0 -9
  372. package/dist/chunks/sp-overlay.dev-earn5as8.js +0 -17
  373. package/dist/chunks/sp-overlay.dev-earn5as8.js.map +0 -9
  374. package/dist/chunks/sp-popover.dev-frxtfejn.js +0 -8
  375. package/dist/chunks/sp-popover.dev-frxtfejn.js.map +0 -9
  376. package/dist/chunks/sp-progress-circle.dev-7tvw34h8.js +0 -14
  377. package/dist/chunks/sp-progress-circle.dev-7tvw34h8.js.map +0 -9
  378. package/dist/chunks/sp-tooltip.dev-a9fywesm.js +0 -21
  379. package/dist/chunks/sp-tooltip.dev-a9fywesm.js.map +0 -10
  380. package/dist/chunks/studio-4k0m4fmp.js.map +0 -13
  381. package/dist/chunks/studio-568nx4t5.js +0 -469
  382. package/dist/chunks/studio-568nx4t5.js.map +0 -14
  383. package/dist/chunks/studio-9smfzqhc.js +0 -19
  384. package/dist/chunks/studio-9smfzqhc.js.map +0 -10
  385. package/dist/chunks/studio-asvf0j9e.js +0 -429
  386. package/dist/chunks/studio-asvf0j9e.js.map +0 -13
  387. package/dist/chunks/studio-d77qm3pk.js +0 -3427
  388. package/dist/chunks/studio-d77qm3pk.js.map +0 -26
  389. package/dist/chunks/studio-j6gqyjf4.js +0 -1854
  390. package/dist/chunks/studio-j6gqyjf4.js.map +0 -18
  391. package/dist/chunks/studio-n9zmpxjg.js.map +0 -115
  392. package/dist/chunks/studio-qkvt37c0.js.map +0 -9
  393. package/dist/chunks/studio-rq0vxb19.js +0 -3744
  394. package/dist/chunks/studio-rq0vxb19.js.map +0 -22
  395. package/dist/chunks/studio-wd6ewdvd.js +0 -853
  396. package/dist/chunks/studio-wd6ewdvd.js.map +0 -12
  397. package/dist/chunks/studio-xq0t7n5t.js +0 -140
  398. package/dist/chunks/studio-xq0t7n5t.js.map +0 -10
  399. package/dist/chunks/studio-xze4zrs1.js.map +0 -10
  400. package/dist/chunks/studio-ygzav7z5.js.map +0 -46
  401. package/dist/chunks/studio-zmy7241e.js +0 -399
  402. package/dist/chunks/studio-zmy7241e.js.map +0 -12
  403. package/dist/chunks/ws-client-q7hkz3j9.js.map +0 -11
  404. package/src/browse/browse-modal.ts +0 -69
  405. package/src/browse/browse.ts +0 -904
  406. package/src/canvas/canvas-diff.ts +0 -216
  407. package/src/canvas/nested-site-style.ts +0 -58
  408. package/src/new-project/design-fields.ts +0 -264
  409. package/src/new-project/templates.ts +0 -61
  410. package/src/panels/tab-bar.ts +0 -548
  411. package/src/settings/settings-modal.ts +0 -203
  412. /package/dist/chunks/{adapter-z8fkmbmv.js.map → adapter-qfnesn5v.js.map} +0 -0
  413. /package/dist/chunks/{cf-settings-mmyv436d.js.map → cf-settings-73sh5z4p.js.map} +0 -0
  414. /package/dist/chunks/{format-host-2c188n41.js.map → format-host-mkwsmt8d.js.map} +0 -0
  415. /package/dist/chunks/{jx-validate-qx8degj7.js.map → jx-validate-v6qgknrs.js.map} +0 -0
  416. /package/dist/chunks/{studio-w7c6kvk7.js.map → studio-a7pzveq1.js.map} +0 -0
  417. /package/dist/chunks/{studio-hhj92gcr.js.map → studio-s519zc99.js.map} +0 -0
  418. /package/dist/chunks/{studio-bghqfmea.js.map → studio-wwseqyw0.js.map} +0 -0
  419. /package/dist/chunks/{studio-nqw433kv.js.map → studio-xmvbhg31.js.map} +0 -0
@@ -1,16 +1,28 @@
1
1
  /// <reference lib="dom" />
2
2
  /**
3
- * Welcome screen — shown when no project is loaded and no document tabs are open. Mimics VS Code's
4
- * welcome tab with start actions and recent projects.
3
+ * Start pane — the pane-grid surface shown when no project is loaded and no document tabs are open.
4
+ *
5
+ * Three regions, in the order a first run needs them: **Start** (the ways to get a project in front
6
+ * of you), **Recent** (projects you have opened, identified by name + the folder that tells two
7
+ * same-named projects apart + when you last opened them), and **Projects** (the catalogue a cloud
8
+ * platform enumerates). A repository-access prompt sits above them when the account has no GitHub
9
+ * App installation yet, because nothing else on the pane can succeed until it does.
10
+ *
11
+ * Recents never render a raw absolute path: `recentLocations()` gives every row the shortest
12
+ * trailing path that distinguishes it from the other rows sharing its name.
13
+ *
14
+ * @docs studio/interface/welcome-screen
5
15
  */
6
16
 
7
17
  import { html, render as litRender, nothing } from "lit-html";
8
18
  import { getAccountStatus, needsAppInstall } from "../account-status";
9
19
  import { platformSupportsAddRepo } from "../new-project/add-repo-modal";
10
20
  import { getProjectList } from "../project-list";
21
+ import { now } from "../services/clock";
11
22
  import { clearRecentProjects, getRecentProjects, removeRecentProject } from "../recent-projects";
12
23
  import { renderOnly } from "../store";
13
24
  import { platformSupportsClone } from "./git-panel";
25
+ import type { TemplateResult } from "lit-html";
14
26
 
15
27
  interface WelcomeCtx {
16
28
  openProject: () => void;
@@ -27,217 +39,308 @@ export function initWelcome(ctx: WelcomeCtx) {
27
39
  _ctx = ctx;
28
40
  }
29
41
 
42
+ // ─── Location labels ──────────────────────────────────────────────────────────
43
+
44
+ /** Home-relative form of an absolute path (`/home/you/x` → `~/x`); other paths are unchanged. */
45
+ export function shortenPath(path: string): string {
46
+ const match = /^\/(?:home|Users)\/[^/]+(?=\/|$)/.exec(path);
47
+ return match ? `~${path.slice(match[0].length)}` : path;
48
+ }
49
+
50
+ /** The ancestor segments of a root, home-shortened — everything above the project folder itself. */
51
+ function ancestorSegments(root: string): string[] {
52
+ const segments = shortenPath(root).split("/").filter(Boolean);
53
+ return segments.slice(0, -1);
54
+ }
55
+
56
+ /**
57
+ * The last `depth` ancestor folders of a root, as a path. Truncated labels lead with `…/`; a
58
+ * complete absolute one keeps its leading `/`, so the string always says how much it is showing.
59
+ */
60
+ function ancestorLabel(root: string, depth: number): string {
61
+ const segments = ancestorSegments(root);
62
+ if (segments.length === 0) {
63
+ return shortenPath(root);
64
+ }
65
+ const tail = segments.slice(Math.max(0, segments.length - depth));
66
+ if (tail.length < segments.length) {
67
+ return `…/${tail.join("/")}`;
68
+ }
69
+ return tail[0] === "~" || !root.startsWith("/") ? tail.join("/") : `/${tail.join("/")}`;
70
+ }
71
+
72
+ /**
73
+ * The location line for each entry: the shortest trailing path that tells apart the entries sharing
74
+ * a display name. One folder deep is enough for almost every list; same-named projects under the
75
+ * same parent fall back to their whole home-shortened root, which is unique because roots are.
76
+ *
77
+ * @param entries Projects to label, in any order.
78
+ * @returns Root → location label, one entry per distinct root.
79
+ */
80
+ export function recentLocations(
81
+ entries: readonly { name: string; root: string }[],
82
+ ): Map<string, string> {
83
+ const groups = new Map<string, { name: string; root: string }[]>();
84
+ for (const entry of entries) {
85
+ const group = groups.get(entry.name);
86
+ if (group) {
87
+ group.push(entry);
88
+ } else {
89
+ groups.set(entry.name, [entry]);
90
+ }
91
+ }
92
+
93
+ const labels = new Map<string, string>();
94
+ for (const group of groups.values()) {
95
+ const maxDepth = Math.max(...group.map((e) => ancestorSegments(e.root).length), 1);
96
+ let chosen = group.map((e) => ancestorLabel(e.root, maxDepth));
97
+ for (let depth = 1; depth <= maxDepth; depth++) {
98
+ const candidate = group.map((e) => ancestorLabel(e.root, depth));
99
+ if (new Set(candidate).size === group.length) {
100
+ chosen = candidate;
101
+ break;
102
+ }
103
+ }
104
+ if (new Set(chosen).size !== group.length) {
105
+ chosen = group.map((e) => shortenPath(e.root));
106
+ }
107
+ for (const [index, entry] of group.entries()) {
108
+ labels.set(entry.root, chosen[index]!);
109
+ }
110
+ }
111
+ return labels;
112
+ }
113
+
114
+ const MINUTE = 60_000;
115
+ const HOUR = 60 * MINUTE;
116
+ const DAY = 24 * HOUR;
117
+
118
+ /**
119
+ * "When you last opened it", in the coarse units a project list is read in. Deliberately vague past
120
+ * a week — the exact timestamp is in the row's tooltip.
121
+ *
122
+ * @param timestamp Epoch milliseconds.
123
+ * @param at Epoch milliseconds to measure against. Defaults to the {@link now} seam, so a pinned
124
+ * clock makes "last opened" answer the same on every read.
125
+ */
126
+ export function lastOpenedLabel(timestamp: number, at: number = now()): string {
127
+ const elapsed = Math.max(0, at - timestamp);
128
+ if (elapsed < MINUTE) {
129
+ return "just now";
130
+ }
131
+ if (elapsed < HOUR) {
132
+ const minutes = Math.floor(elapsed / MINUTE);
133
+ return `${minutes} minute${minutes === 1 ? "" : "s"} ago`;
134
+ }
135
+ if (elapsed < DAY) {
136
+ const hours = Math.floor(elapsed / HOUR);
137
+ return `${hours} hour${hours === 1 ? "" : "s"} ago`;
138
+ }
139
+ const days = Math.floor(elapsed / DAY);
140
+ if (days === 1) {
141
+ return "yesterday";
142
+ }
143
+ if (days < 30) {
144
+ return `${days} days ago`;
145
+ }
146
+ const months = Math.floor(days / 30);
147
+ return months < 12 ? `${months} month${months === 1 ? "" : "s"} ago` : "over a year ago";
148
+ }
149
+
150
+ // ─── Templates ────────────────────────────────────────────────────────────────
151
+
152
+ /** One Start-list command: a labelled, icon-led action button. */
153
+ function startActionTpl(label: string, icon: TemplateResult, run: () => void): TemplateResult {
154
+ return html`
155
+ <sp-action-button class="welcome-action" quiet size="m" @click=${run}>
156
+ ${icon} ${label}
157
+ </sp-action-button>
158
+ `;
159
+ }
160
+
161
+ function startSectionTpl(ctx: WelcomeCtx): TemplateResult {
162
+ return html`
163
+ <section class="welcome-section">
164
+ <h2 class="welcome-section-title">Start</h2>
165
+ <div class="welcome-actions">
166
+ ${
167
+ // One entry, not two: the starter gallery IS the first step of New Project now, so the
168
+ // Separate "Start from an Example…" button it used to hide behind is gone.
169
+ startActionTpl("New Project…", html`<sp-icon-add slot="icon"></sp-icon-add>`, () =>
170
+ ctx.openNewProject(),
171
+ )
172
+ }
173
+ ${startActionTpl(
174
+ "Open Project…",
175
+ html`<sp-icon-folder-open slot="icon"></sp-icon-folder-open>`,
176
+ () => ctx.openProject(),
177
+ )}
178
+ ${
179
+ platformSupportsClone()
180
+ ? startActionTpl(
181
+ "Clone Git Repository…",
182
+ html`<sp-icon-download slot="icon"></sp-icon-download>`,
183
+ () => ctx.cloneRepository(),
184
+ )
185
+ : nothing
186
+ }
187
+ ${
188
+ platformSupportsAddRepo()
189
+ ? startActionTpl(
190
+ "Add Existing Repository…",
191
+ html`<sp-icon-box slot="icon"></sp-icon-box>`,
192
+ () => ctx.addExistingRepo(),
193
+ )
194
+ : nothing
195
+ }
196
+ </div>
197
+ </section>
198
+ `;
199
+ }
200
+
201
+ /**
202
+ * The GitHub-App install prompt. Gated on `needsAppInstall()`: the account is connected, reports
203
+ * zero installations, and told us where to fix that — the recovery path for the structured
204
+ * needs-installation 403 that `platform-errors.ts` decodes.
205
+ */
206
+ function appInstallTpl(): TemplateResult {
207
+ return html`
208
+ <section class="welcome-section">
209
+ <h2 class="welcome-section-title">Repository access</h2>
210
+ <div class="welcome-actions">
211
+ <sp-action-button
212
+ class="welcome-action"
213
+ quiet
214
+ size="m"
215
+ href=${getAccountStatus()?.appInstallUrl ?? "#"}
216
+ target="_blank"
217
+ rel="noreferrer"
218
+ >
219
+ <sp-icon-link slot="icon"></sp-icon-link>
220
+ Install the Jx Suite GitHub App
221
+ </sp-action-button>
222
+ </div>
223
+ <p class="welcome-install-note">
224
+ Grants repository access so you can create and open projects — choose “All repositories”.
225
+ </p>
226
+ </section>
227
+ `;
228
+ }
229
+
230
+ /** One row of the Recent list: the project, its distinguishing folder, and when it was last open. */
231
+ function recentRowTpl(
232
+ ctx: WelcomeCtx,
233
+ entry: { name: string; root: string; timestamp: number },
234
+ location: string,
235
+ ): TemplateResult {
236
+ return html`
237
+ <li class="welcome-recent-row">
238
+ <button
239
+ class="welcome-recent"
240
+ title=${entry.root}
241
+ @click=${() => ctx.openRecentProject(entry.root)}
242
+ >
243
+ <span class="welcome-recent-name">${entry.name}</span>
244
+ <span class="welcome-recent-path">${location}</span>
245
+ <span class="welcome-recent-when">${lastOpenedLabel(entry.timestamp)}</span>
246
+ </button>
247
+ <sp-action-button
248
+ class="welcome-recent-remove"
249
+ quiet
250
+ size="s"
251
+ label="Remove ${entry.name} from Recent"
252
+ @click=${() => {
253
+ removeRecentProject(entry.root);
254
+ renderOnly("canvas");
255
+ }}
256
+ >
257
+ <sp-icon-close slot="icon"></sp-icon-close>
258
+ </sp-action-button>
259
+ </li>
260
+ `;
261
+ }
262
+
263
+ function recentSectionTpl(
264
+ ctx: WelcomeCtx,
265
+ recent: readonly { name: string; root: string; timestamp: number }[],
266
+ ): TemplateResult {
267
+ const locations = recentLocations(recent);
268
+ return html`
269
+ <section class="welcome-section">
270
+ <div class="welcome-section-header">
271
+ <h2 class="welcome-section-title">Recent</h2>
272
+ <sp-action-button
273
+ class="welcome-clear"
274
+ quiet
275
+ size="s"
276
+ @click=${() => {
277
+ clearRecentProjects();
278
+ renderOnly("canvas");
279
+ }}
280
+ >
281
+ Clear all
282
+ </sp-action-button>
283
+ </div>
284
+ <ul class="welcome-list">
285
+ ${recent.map((entry) => recentRowTpl(ctx, entry, locations.get(entry.root) ?? entry.root))}
286
+ </ul>
287
+ </section>
288
+ `;
289
+ }
290
+
291
+ /**
292
+ * Projects the platform enumerates that are not already in Recent. Cloud catalogues carry their own
293
+ * one-line description; anything else gets the same location treatment the recents get.
294
+ */
295
+ function catalogueSectionTpl(
296
+ ctx: WelcomeCtx,
297
+ catalogue: readonly { name: string; root: string; description?: string | undefined }[],
298
+ ): TemplateResult {
299
+ const locations = recentLocations(catalogue);
300
+ return html`
301
+ <section class="welcome-section">
302
+ <h2 class="welcome-section-title">Projects</h2>
303
+ <ul class="welcome-list">
304
+ ${catalogue.map(
305
+ (project) => html`
306
+ <li class="welcome-recent-row">
307
+ <button
308
+ class="welcome-recent welcome-catalogue"
309
+ title=${project.root}
310
+ @click=${() => ctx.openRecentProject(project.root)}
311
+ >
312
+ <span class="welcome-recent-name">${project.name}</span>
313
+ <span class="welcome-recent-path">
314
+ ${project.description ?? locations.get(project.root) ?? project.root}
315
+ </span>
316
+ </button>
317
+ </li>
318
+ `,
319
+ )}
320
+ </ul>
321
+ </section>
322
+ `;
323
+ }
324
+
30
325
  /** @param {HTMLElement} host */
31
326
  export function renderWelcome(host: HTMLElement) {
32
327
  const ctx = _ctx as WelcomeCtx;
33
328
  const recent = getRecentProjects();
34
329
  // Catalogue entries already in Recent stay in that section only.
35
330
  const catalogue = getProjectList().filter((p) => !recent.some((r) => r.root === p.root));
36
- const showClone = platformSupportsClone();
37
- const showAddRepo = platformSupportsAddRepo();
38
331
 
39
332
  litRender(
40
333
  html`
41
334
  <div class="welcome-screen">
42
335
  <div class="welcome-content">
43
336
  <h1 class="welcome-title">Jx Studio</h1>
44
- <p class="welcome-subtitle">Visual component builder</p>
45
-
46
- <div class="welcome-section">
47
- <h2 class="welcome-section-title">Start</h2>
48
- <button class="welcome-action" @click=${() => ctx.openNewProject()}>
49
- <svg
50
- class="welcome-action-icon"
51
- width="16"
52
- height="16"
53
- viewBox="0 0 16 16"
54
- fill="currentColor"
55
- >
56
- <path
57
- d="M9.5 1.1l3.4 3.5.1.4v2h-1V6H8.5L8 5.5V2H3.5l-.5.5v11l.5.5H6v1H3.5l-1.5-1.5v-11l1.5-1.5h5.7l.3.1zM9 2v3h2.9L9 2zm4 14h-1v-3H9v-1h3V9h1v3h3v1h-3v3z"
58
- />
59
- </svg>
60
- New Project...
61
- </button>
62
- <button class="welcome-action" @click=${() => ctx.openNewProject({ tab: "starter" })}>
63
- <svg
64
- class="welcome-action-icon"
65
- width="16"
66
- height="16"
67
- viewBox="0 0 16 16"
68
- fill="currentColor"
69
- >
70
- <path
71
- d="M1 1h6v6H1V1zm1 1v4h4V2H2zm7-1h6v6H9V1zm1 1v4h4V2h-4zM1 9h6v6H1V9zm1 1v4h4v-4H2zm7-1h6v6H9V9zm1 1v4h4v-4h-4z"
72
- />
73
- </svg>
74
- Start from an Example...
75
- </button>
76
- <button class="welcome-action" @click=${() => ctx.openProject()}>
77
- <svg
78
- class="welcome-action-icon"
79
- width="16"
80
- height="16"
81
- viewBox="0 0 16 16"
82
- fill="currentColor"
83
- >
84
- <path
85
- d="M14.5 3H7.71l-.85-.85L6.51 2h-5l-.5.5v11l.5.5h13l.5-.5v-10L14.5 3zm-.51 8.49V13h-12V7h4.49l.35-.15.86-.86H14v5.5zM6.51 6l-.35.15-.86.86H2v-3h4.29l.85.85.36.15H14V6H6.51z"
86
- />
87
- </svg>
88
- Open Project...
89
- </button>
90
- ${
91
- showClone
92
- ? html`<button class="welcome-action" @click=${() => ctx.cloneRepository()}>
93
- <svg
94
- class="welcome-action-icon"
95
- width="16"
96
- height="16"
97
- viewBox="0 0 16 16"
98
- fill="currentColor"
99
- >
100
- <path
101
- d="M4.7 12.3a4.2 4.2 0 0 1-1.2-1.7A4.4 4.4 0 0 1 3 8.9a4 4 0 0 1 .3-1.5 3.8 3.8 0 0 1 .8-1.3c.4-.4.8-.7 1.3-.9.5-.2 1-.4 1.6-.4V3l3.5 2.5L7 8V6.2c-.9.1-1.6.5-2.1 1.1a3 3 0 0 0-.8 2.1c0 .4.1.8.2 1.2.1.3.3.7.5 1l-.1.7zM11 6.9c.9-.1 1.6-.5 2.1-1.1a3 3 0 0 0 .8-2.1 3 3 0 0 0-.2-1.2 3.5 3.5 0 0 0-.5-1l.1-.7a4.2 4.2 0 0 1 1.2 1.7c.3.5.4 1.1.4 1.7a4 4 0 0 1-.3 1.5 3.8 3.8 0 0 1-.8 1.3c-.4.4-.8.7-1.3.9-.5.2-1 .4-1.6.4V11L7.5 8.5 11 6v.9z"
102
- />
103
- </svg>
104
- Clone Git Repository...
105
- </button>`
106
- : nothing
107
- }
108
- ${
109
- showAddRepo
110
- ? html`<button class="welcome-action" @click=${() => ctx.addExistingRepo()}>
111
- <svg
112
- class="welcome-action-icon"
113
- width="16"
114
- height="16"
115
- viewBox="0 0 16 16"
116
- fill="currentColor"
117
- >
118
- <path
119
- d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.5 2.5 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.25.25 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"
120
- />
121
- </svg>
122
- Add Existing Repository...
123
- </button>`
124
- : nothing
125
- }
126
- </div>
127
-
128
- ${
129
- needsAppInstall()
130
- ? html`
131
- <div class="welcome-section">
132
- <h2 class="welcome-section-title">Repository access</h2>
133
- <a
134
- class="welcome-action"
135
- href=${getAccountStatus()?.appInstallUrl ?? "#"}
136
- target="_blank"
137
- rel="noreferrer"
138
- >
139
- <svg
140
- class="welcome-action-icon"
141
- width="16"
142
- height="16"
143
- viewBox="0 0 16 16"
144
- fill="currentColor"
145
- >
146
- <path
147
- d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8z"
148
- />
149
- </svg>
150
- Install the Jx Suite GitHub App
151
- </a>
152
- <p class="welcome-install-note">
153
- Grants repository access so you can create and open projects — choose “All
154
- repositories”.
155
- </p>
156
- </div>
157
- `
158
- : nothing
159
- }
160
- ${
161
- catalogue.length > 0
162
- ? html`
163
- <div class="welcome-section">
164
- <h2 class="welcome-section-title">Projects</h2>
165
- ${catalogue.map(
166
- (p) => html`
167
- <div class="welcome-recent-row">
168
- <button
169
- class="welcome-recent welcome-catalogue"
170
- @click=${() => ctx.openRecentProject(p.root)}
171
- title=${p.root}
172
- >
173
- <span class="welcome-recent-name">${p.name}</span>
174
- <span class="welcome-recent-path">
175
- ${p.description ?? shortenPath(p.root)}
176
- </span>
177
- </button>
178
- </div>
179
- `,
180
- )}
181
- </div>
182
- `
183
- : nothing
184
- }
185
- ${
186
- recent.length > 0
187
- ? html`
188
- <div class="welcome-section">
189
- <div class="welcome-section-header">
190
- <h2 class="welcome-section-title">Recent</h2>
191
- <button
192
- class="welcome-clear"
193
- @click=${() => {
194
- clearRecentProjects();
195
- renderOnly("canvas");
196
- }}
197
- >
198
- Clear
199
- </button>
200
- </div>
201
- ${recent.map(
202
- (p) => html`
203
- <div class="welcome-recent-row">
204
- <button
205
- class="welcome-recent"
206
- @click=${() => ctx.openRecentProject(p.root)}
207
- title=${p.root}
208
- >
209
- <span class="welcome-recent-name">${p.name}</span>
210
- <span class="welcome-recent-path">${shortenPath(p.root)}</span>
211
- </button>
212
- <button
213
- class="welcome-recent-remove"
214
- title="Remove from recent"
215
- @click=${() => {
216
- removeRecentProject(p.root);
217
- renderOnly("canvas");
218
- }}
219
- >
220
- ✕
221
- </button>
222
- </div>
223
- `,
224
- )}
225
- </div>
226
- `
227
- : nothing
228
- }
337
+ <p class="welcome-subtitle">Design, build, and publish websites</p>
338
+ ${startSectionTpl(ctx)} ${needsAppInstall() ? appInstallTpl() : nothing}
339
+ ${recent.length > 0 ? recentSectionTpl(ctx, recent) : nothing}
340
+ ${catalogue.length > 0 ? catalogueSectionTpl(ctx, catalogue) : nothing}
229
341
  </div>
230
342
  </div>
231
343
  `,
232
344
  host,
233
345
  );
234
346
  }
235
-
236
- /** @param {string} path */
237
- function shortenPath(path: string) {
238
- if (path.startsWith("/home/")) {
239
- const parts = path.split("/");
240
- return `~/${parts.slice(3).join("/")}`;
241
- }
242
- return path;
243
- }
@@ -4,21 +4,44 @@
4
4
  * "needs_installation_access"` + `installUrl`); adapters preserve them on the thrown Error via
5
5
  * `Object.assign`, and UI surfaces recover them here to render actions (an install link) instead of
6
6
  * plain text.
7
+ *
8
+ * **RFC 9457 reconciles cleanly with this, because a problem's `type` IS the code.** A backend
9
+ * answering `type: "https://jxsuite.com/problems/needs-installation-access"` is saying exactly what
10
+ * `code: "needs_installation_access"` said; `problemSlug` derives the one from the other, and
11
+ * `installUrl` is the extension member (§3.2) that type documents. So this module reads both, and
12
+ * every surface above it keeps branching on `code` without knowing which shape arrived.
7
13
  */
8
14
 
15
+ import { problemSlug } from "@jxsuite/protocol";
16
+
9
17
  export interface PlatformErrorInfo {
10
18
  code?: string;
11
19
  installUrl?: string;
12
20
  }
13
21
 
22
+ /**
23
+ * The slug spelling of a code, so a hyphenated problem type and an underscored legacy code compare
24
+ * equal. The two spellings exist because the type is a URI path segment and the code was a JS-ish
25
+ * identifier; neither is worth migrating the other to while both are on the wire.
26
+ */
27
+ function normalizeCode(value: string): string {
28
+ return value.replaceAll("_", "-");
29
+ }
30
+
14
31
  /** Machine-readable fields carried by a thrown platform error (empty object when none). */
15
32
  export function platformErrorInfo(error: unknown): PlatformErrorInfo {
16
33
  if (!error || typeof error !== "object") {
17
34
  return {};
18
35
  }
19
- const { code, installUrl } = error as { code?: unknown; installUrl?: unknown };
36
+ const { code, installUrl, type } = error as {
37
+ code?: unknown;
38
+ installUrl?: unknown;
39
+ type?: unknown;
40
+ };
41
+ // A problem type wins over a legacy code: it is the shape the backend is migrating toward.
42
+ const derived = problemSlug(type) ?? (typeof code === "string" ? normalizeCode(code) : null);
20
43
  return {
21
- ...(typeof code === "string" ? { code } : {}),
44
+ ...(derived === null ? {} : { code: derived }),
22
45
  ...(typeof installUrl === "string" ? { installUrl } : {}),
23
46
  };
24
47
  }
@@ -26,5 +49,5 @@ export function platformErrorInfo(error: unknown): PlatformErrorInfo {
26
49
  /** The GitHub-App install link when the error is the structured needs-installation 403. */
27
50
  export function installUrlOf(error: unknown): string | null {
28
51
  const info = platformErrorInfo(error);
29
- return info.code === "needs_installation_access" && info.installUrl ? info.installUrl : null;
52
+ return info.code === "needs-installation-access" && info.installUrl ? info.installUrl : null;
30
53
  }