@kortix/ui 0.15.10 → 0.16.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 (469) hide show
  1. package/dist/_vendor/kortix-shared.js +769 -76
  2. package/dist/_vendor/shared/app-config.d.ts +6 -30
  3. package/dist/_vendor/shared/channel-descriptors.d.ts +0 -34
  4. package/dist/_vendor/shared/channel-header.d.ts +2 -1
  5. package/dist/_vendor/shared/connector-sections.d.ts +0 -25
  6. package/dist/_vendor/shared/file-tags.d.ts +2 -1
  7. package/dist/_vendor/shared/my-kortix-agent.d.ts +5 -3
  8. package/dist/_vendor/shared/pasted-content.d.ts +0 -4
  9. package/dist/_vendor/shared/pixel-mark.d.ts +0 -17
  10. package/dist/_vendor/shared/project-glyphs.d.ts +0 -1
  11. package/dist/_vendor/shared/session/attachment-tile.d.ts +8 -0
  12. package/dist/_vendor/shared/workspace-settings.d.ts +3 -0
  13. package/dist/access/access/copy-row.d.ts +7 -1
  14. package/dist/access/access/copy-row.js +2 -2
  15. package/dist/animated-copy-icon.js +2 -1
  16. package/dist/browser/sandbox-browser-chrome.d.ts +2 -1
  17. package/dist/browser/sandbox-browser-chrome.js +1 -1
  18. package/dist/customize/agents/agent-cover-card.d.ts +1 -1
  19. package/dist/customize/agents/agent-cover-card.js +10 -2
  20. package/dist/customize/agents/agent-filter.js +3 -1
  21. package/dist/customize/agents/agent-model-view.d.ts +11 -1
  22. package/dist/customize/agents/agent-model-view.js +12 -1
  23. package/dist/customize/agents/agent-overview.d.ts +10 -0
  24. package/dist/customize/agents/agent-overview.js +5 -4
  25. package/dist/customize/agents/agent-page-chrome.d.ts +5 -6
  26. package/dist/customize/agents/agent-page-chrome.js +16 -13
  27. package/dist/customize/agents/agent-page.js +25 -34
  28. package/dist/customize/agents/agent-tabs.d.ts +3 -0
  29. package/dist/customize/agents/agent-tabs.js +3 -0
  30. package/dist/customize/agents/agents-page.js +3 -3
  31. package/dist/customize/agents/create-agent-modal.d.ts +9 -0
  32. package/dist/customize/agents/create-agent-modal.js +21 -3
  33. package/dist/customize/agents/use-default-agent.js +2 -2
  34. package/dist/customize/connectors/connector-identity.d.ts +11 -2
  35. package/dist/customize/connectors/connector-identity.js +16 -4
  36. package/dist/customize/connectors/connectors-page.js +10 -6
  37. package/dist/customize/connectors/detail/app-page.js +2 -2
  38. package/dist/customize/connectors/detail/connector-triggers.js +1 -1
  39. package/dist/customize/connectors/install/install-dialog.d.ts +2 -0
  40. package/dist/customize/connectors/install/install-dialog.js +6 -1
  41. package/dist/customize/connectors/use-agent-access.d.ts +2 -0
  42. package/dist/customize/evals/eval-compare-view.d.ts +10 -0
  43. package/dist/customize/evals/eval-compare-view.js +68 -0
  44. package/dist/customize/evals/eval-dataset-view.d.ts +20 -0
  45. package/dist/customize/evals/eval-dataset-view.js +81 -0
  46. package/dist/customize/evals/eval-datasets-page.d.ts +25 -0
  47. package/dist/customize/evals/eval-datasets-page.js +91 -0
  48. package/dist/customize/evals/eval-job-view.d.ts +12 -0
  49. package/dist/customize/evals/eval-job-view.js +360 -0
  50. package/dist/customize/evals/eval-jobs-page.d.ts +4 -0
  51. package/dist/customize/evals/eval-jobs-page.js +69 -0
  52. package/dist/customize/evals/eval-meta.d.ts +97 -0
  53. package/dist/customize/evals/eval-meta.js +228 -0
  54. package/dist/customize/evals/eval-task-view.d.ts +13 -0
  55. package/dist/customize/evals/eval-task-view.js +123 -0
  56. package/dist/customize/evals/eval-tasks-page.d.ts +8 -0
  57. package/dist/customize/evals/eval-tasks-page.js +56 -0
  58. package/dist/customize/evals/eval-ui.d.ts +97 -0
  59. package/dist/customize/evals/eval-ui.js +153 -0
  60. package/dist/customize/evals/evals-page.d.ts +10 -0
  61. package/dist/customize/evals/evals-page.js +56 -0
  62. package/dist/customize/evals/run-eval-modal.d.ts +28 -0
  63. package/dist/customize/evals/run-eval-modal.js +167 -0
  64. package/dist/customize/project-settings/project-admin-sections.d.ts +3 -2
  65. package/dist/customize/project-settings/project-admin-sections.js +6 -1
  66. package/dist/customize/providers/provider-connect.d.ts +13 -0
  67. package/dist/customize/providers/provider-connect.js +29 -5
  68. package/dist/customize/providers/provider-sheet.js +5 -4
  69. package/dist/customize/sections/component/teams-byo-wizard.js +4 -1
  70. package/dist/customize/sections/view/gateway/gateway-overview.d.ts +5 -0
  71. package/dist/customize/sections/view/gateway/gateway-overview.js +32 -6
  72. package/dist/customize/sections/view/gateway/routing-parts.d.ts +6 -0
  73. package/dist/customize/sections/view/gateway/routing-parts.js +21 -13
  74. package/dist/customize/sections/view/git-view.d.ts +19 -1
  75. package/dist/customize/sections/view/git-view.js +7 -3
  76. package/dist/customize/sections/view/manifest-issue-list.d.ts +16 -0
  77. package/dist/customize/sections/view/manifest-issue-list.js +41 -0
  78. package/dist/customize/sections/view/manifest-issues-row.d.ts +24 -0
  79. package/dist/customize/sections/view/manifest-issues-row.js +39 -0
  80. package/dist/customize/sections/view/sandbox-provider-coverage.d.ts +7 -1
  81. package/dist/customize/sections/view/sandbox-provider-coverage.js +7 -5
  82. package/dist/customize/sections/view/secrets-view.d.ts +13 -0
  83. package/dist/customize/sections/view/secrets-view.js +10 -6
  84. package/dist/customize/sections/view/subscription-usage.d.ts +2 -7
  85. package/dist/customize/sections/view/subscription-usage.js +4 -8
  86. package/dist/customize/settings/settings-tab-header.js +12 -3
  87. package/dist/customize/settings/tabs/experimental-tab.d.ts +16 -5
  88. package/dist/customize/settings/tabs/experimental-tab.js +36 -11
  89. package/dist/customize/settings/tabs/general-tab.js +1 -1
  90. package/dist/customize/settings/tabs/sandbox-tab.d.ts +10 -0
  91. package/dist/customize/settings/tabs/sandbox-tab.js +27 -4
  92. package/dist/customize/settings/tabs/snapshots-tab.d.ts +31 -0
  93. package/dist/customize/settings/tabs/snapshots-tab.js +61 -5
  94. package/dist/customize/settings/tabs/workspace-keys.js +6 -3
  95. package/dist/customize/shared/capability-page-shell.js +9 -1
  96. package/dist/customize/shared/catalog/catalog-card.d.ts +1 -1
  97. package/dist/customize/shared/catalog/catalog-card.js +15 -5
  98. package/dist/customize/shared/customize-tab-bar.js +1 -1
  99. package/dist/customize/shared/new-entity-menu.d.ts +1 -1
  100. package/dist/customize/shared/new-entity-menu.js +38 -1
  101. package/dist/customize/triggers/runtime-triggers.d.ts +4 -0
  102. package/dist/customize/triggers/runtime-triggers.js +33 -3
  103. package/dist/customize/triggers/schedule/event-trigger-copy.js +1 -1
  104. package/dist/customize/triggers/schedule/post-to-field.js +2 -2
  105. package/dist/customize/triggers/schedule/schedule-detail-sheet.js +5 -4
  106. package/dist/customize/triggers/schedule/then-fields.d.ts +5 -1
  107. package/dist/customize/triggers/schedule/then-fields.js +23 -3
  108. package/dist/customize/triggers/schedule/trigger-callouts.js +1 -1
  109. package/dist/customize/triggers/schedule/trigger-composer-logic.d.ts +27 -0
  110. package/dist/customize/triggers/schedule/trigger-composer-logic.js +51 -5
  111. package/dist/customize/triggers/schedule/trigger-composer.js +19 -13
  112. package/dist/customize/triggers/schedule/trigger-edit-logic.js +25 -5
  113. package/dist/customize/triggers/schedule/trigger-filter.d.ts +10 -3
  114. package/dist/customize/triggers/schedule/trigger-filter.js +7 -6
  115. package/dist/customize/triggers/schedule/trigger-readonly.js +1 -1
  116. package/dist/customize/triggers/schedule/trigger-runs-panel.js +1 -1
  117. package/dist/customize/triggers/schedule/when-event.js +1 -1
  118. package/dist/customize/triggers/schedule/when-schedule.d.ts +5 -1
  119. package/dist/customize/triggers/schedule/when-schedule.js +16 -1
  120. package/dist/customize/triggers/schedule-view.js +6 -3
  121. package/dist/files/project/components/drive-explorer.js +33 -70
  122. package/dist/files/project/components/drive-grid-view.d.ts +2 -31
  123. package/dist/files/project/components/drive-grid-view.js +12 -22
  124. package/dist/files/project/components/drive-list-view.d.ts +3 -30
  125. package/dist/files/project/components/drive-list-view.js +8 -18
  126. package/dist/files/project/components/drive-selection-bar.d.ts +4 -5
  127. package/dist/files/project/components/drive-selection-bar.js +13 -20
  128. package/dist/files/project/components/explorer-listing.d.ts +48 -0
  129. package/dist/files/project/components/explorer-listing.js +64 -0
  130. package/dist/files/project/components/file-explorer-page.js +7 -204
  131. package/dist/files/project/components/file-thumbnail.js +3 -1
  132. package/dist/files/project/components/manifest-issue-mark.d.ts +9 -0
  133. package/dist/files/project/components/manifest-issue-mark.js +26 -0
  134. package/dist/files/project/hooks/use-change-requests.d.ts +10 -0
  135. package/dist/files/project/hooks/use-change-requests.js +17 -0
  136. package/dist/files/project/manifest-annotations.d.ts +16 -0
  137. package/dist/files/project/manifest-annotations.js +19 -0
  138. package/dist/files/project/store/version-store.d.ts +1 -1
  139. package/dist/files/project/upload-batch.d.ts +20 -0
  140. package/dist/files/project/upload-batch.js +20 -0
  141. package/dist/files/runtime/hooks/use-binary-blob.js +3 -2
  142. package/dist/files/runtime/hooks/use-file-content.js +3 -2
  143. package/dist/files/runtime/hooks/use-file-list.js +1 -2
  144. package/dist/files/runtime/hooks/use-file-mutations.js +69 -6
  145. package/dist/files/runtime/hooks/use-file-refresh.d.ts +4 -0
  146. package/dist/files/runtime/hooks/use-file-refresh.js +6 -0
  147. package/dist/files/tree/components/file-tree-item.js +1 -4
  148. package/dist/files/viewer/file-annotations.d.ts +18 -0
  149. package/dist/files/viewer/file-annotations.js +21 -0
  150. package/dist/files/viewer/file-content-renderer.js +1 -1
  151. package/dist/files/viewer/file-viewer.js +2 -1
  152. package/dist/files/viewer/index.d.ts +1 -0
  153. package/dist/files/viewer/index.js +1 -0
  154. package/dist/files/viewer/use-file-content-state.js +8 -1
  155. package/dist/i18n/en.d.ts +544 -46
  156. package/dist/i18n/en.js +593 -95
  157. package/dist/i18n/ui-catalog/remaining-ui-translation-keys.generated.js +0 -4
  158. package/dist/icons/caret-right-solid.d.ts +11 -0
  159. package/dist/icons/caret-right-solid.js +15 -0
  160. package/dist/internal/auth/auth-art.d.ts +12 -0
  161. package/dist/internal/auth/auth-art.js +118 -0
  162. package/dist/internal/auth/auth-card-shell.d.ts +14 -10
  163. package/dist/internal/auth/auth-card-shell.js +20 -31
  164. package/dist/internal/auth/auth-consent.d.ts +3 -1
  165. package/dist/internal/auth/auth-consent.js +2 -2
  166. package/dist/internal/auth/auth-primitives.d.ts +26 -1
  167. package/dist/internal/auth/auth-primitives.js +37 -8
  168. package/dist/internal/connector-logo/connector-logo.d.ts +2 -1
  169. package/dist/internal/connector-logo/connector-logo.js +11 -2
  170. package/dist/internal/files/file-read-retry.d.ts +18 -2
  171. package/dist/internal/files/file-read-retry.js +42 -4
  172. package/dist/internal/hooks/projects/use-new-project-session.js +5 -10
  173. package/dist/internal/hooks/use-auto-scroll-physics.d.ts +1 -1
  174. package/dist/internal/hooks/use-auto-scroll-physics.js +2 -10
  175. package/dist/internal/hooks/use-reduced-motion.d.ts +4 -0
  176. package/dist/internal/hooks/use-reduced-motion.js +12 -0
  177. package/dist/internal/hooks/use-save-shortcut.d.ts +8 -0
  178. package/dist/internal/hooks/use-save-shortcut.js +28 -0
  179. package/dist/internal/layout/connect-mcp-modal.d.ts +1 -1
  180. package/dist/internal/layout/connect-mcp-modal.js +9 -4
  181. package/dist/internal/layout/panel-chrome.d.ts +28 -0
  182. package/dist/internal/layout/panel-chrome.js +27 -0
  183. package/dist/internal/layout/project-page-header.js +5 -1
  184. package/dist/internal/layout/project-settings-nav.d.ts +17 -0
  185. package/dist/internal/layout/project-settings-nav.js +24 -0
  186. package/dist/internal/lib/browser-noise/rules/webview.js +16 -0
  187. package/dist/internal/lib/capability-tab-routes.d.ts +8 -0
  188. package/dist/internal/lib/capability-tab-routes.js +11 -0
  189. package/dist/internal/lib/manifest-health.d.ts +25 -1
  190. package/dist/internal/lib/manifest-health.js +56 -0
  191. package/dist/internal/lib/project-preamble.js +1 -1
  192. package/dist/internal/lib/web-notifications.d.ts +1 -1
  193. package/dist/internal/lib/web-notifications.js +3 -0
  194. package/dist/internal/notifications/notification-inbox.js +2 -1
  195. package/dist/internal/notifications/notification-rows.d.ts +1 -1
  196. package/dist/internal/notifications/notification-rows.js +15 -1
  197. package/dist/internal/selection/selection-bar.d.ts +2 -8
  198. package/dist/internal/selection/selection-bar.js +15 -38
  199. package/dist/internal/stores/active-space-store.d.ts +1 -1
  200. package/dist/internal/stores/browser-recents-store.d.ts +1 -1
  201. package/dist/internal/stores/composer-prefill-store.d.ts +7 -0
  202. package/dist/internal/stores/composer-prefill-store.js +1 -0
  203. package/dist/internal/stores/current-account-store.d.ts +1 -1
  204. package/dist/internal/stores/first-chat-store.d.ts +1 -1
  205. package/dist/internal/stores/mobile-app-promo-store.d.ts +1 -1
  206. package/dist/internal/stores/session-browser-store.d.ts +1 -1
  207. package/dist/internal/stores/session-expanded-store.d.ts +1 -1
  208. package/dist/internal/stores/session-filter-store.d.ts +1 -1
  209. package/dist/internal/stores/session-history-view-store.d.ts +1 -1
  210. package/dist/internal/stores/session-panel-memory-store.d.ts +1 -1
  211. package/dist/internal/stores/sound-store.d.ts +1 -1
  212. package/dist/internal/stores/tab-store.d.ts +1 -1
  213. package/dist/internal/stores/user-preferences-store.d.ts +9 -1
  214. package/dist/internal/stores/user-preferences-store.js +2 -0
  215. package/dist/internal/stores/web-notification-store.d.ts +1 -1
  216. package/dist/lib/base-ui-compat.js +28 -1
  217. package/dist/lib/dotmatrix-hooks.d.ts +1 -0
  218. package/dist/lib/dotmatrix-hooks.js +3 -13
  219. package/dist/lib/reduced-motion.d.ts +10 -0
  220. package/dist/lib/reduced-motion.js +104 -0
  221. package/dist/lib/routes.d.ts +9 -0
  222. package/dist/lib/routes.js +7 -4
  223. package/dist/markdown/artifact-link.d.ts +11 -0
  224. package/dist/markdown/artifact-link.js +62 -0
  225. package/dist/markdown/code/index.d.ts +1 -1
  226. package/dist/markdown/code/index.js +1 -1
  227. package/dist/markdown/code/inline-code.d.ts +1 -1
  228. package/dist/markdown/code/inline-code.js +1 -1
  229. package/dist/markdown/genui/components/map-canvas.js +2 -1
  230. package/dist/markdown/index.d.ts +3 -1
  231. package/dist/markdown/index.js +2 -1
  232. package/dist/markdown/{code/inline-chip.js → inline-chip.js} +2 -2
  233. package/dist/markdown/inline-code-text.d.ts +34 -0
  234. package/dist/markdown/inline-code-text.js +68 -0
  235. package/dist/markdown/setup-links/approval-decision.js +3 -3
  236. package/dist/markdown/soft-breaks.d.ts +21 -0
  237. package/dist/markdown/soft-breaks.js +33 -0
  238. package/dist/markdown/unified-markdown.d.ts +9 -1
  239. package/dist/markdown/unified-markdown.js +31 -9
  240. package/dist/primitives/action-bar.d.ts +50 -0
  241. package/dist/primitives/action-bar.js +87 -0
  242. package/dist/primitives/calendar.js +4 -2
  243. package/dist/primitives/inline-meta.js +2 -2
  244. package/dist/primitives/kortix-loader.js +2 -1
  245. package/dist/primitives/modal.d.ts +1 -1
  246. package/dist/primitives/paper-wallpaper-shaders.d.ts +1 -0
  247. package/dist/primitives/paper-wallpaper-shaders.js +6 -0
  248. package/dist/primitives/resizable.d.ts +1 -1
  249. package/dist/primitives/resize-seam.d.ts +3 -2
  250. package/dist/primitives/resize-seam.js +4 -3
  251. package/dist/primitives/settings-section-header.d.ts +30 -1
  252. package/dist/primitives/settings-section-header.js +37 -0
  253. package/dist/primitives/sliding-tab-indicator.js +2 -1
  254. package/dist/primitives/switch.js +15 -8
  255. package/dist/primitives/text-shimmer.js +6 -0
  256. package/dist/primitives/toast-clearance.d.ts +52 -0
  257. package/dist/primitives/toast-clearance.js +116 -0
  258. package/dist/primitives/toast.d.ts +3 -1
  259. package/dist/primitives/toast.js +2 -0
  260. package/dist/primitives/typed-title.js +1 -1
  261. package/dist/primitives/wallpaper-shaders.js +1 -1
  262. package/dist/session/actions/project-session-list-helpers.d.ts +16 -0
  263. package/dist/session/actions/project-session-list-helpers.js +18 -0
  264. package/dist/session/actions/session-label.js +2 -2
  265. package/dist/session/agents/agent-model.d.ts +1 -0
  266. package/dist/session/agents/agent-model.js +2 -1
  267. package/dist/session/agents/agent-strip.d.ts +10 -5
  268. package/dist/session/agents/agent-strip.js +49 -15
  269. package/dist/session/agents/held-messages.d.ts +6 -2
  270. package/dist/session/agents/held-messages.js +6 -3
  271. package/dist/session/agents/workflow-run-controls.d.ts +27 -4
  272. package/dist/session/agents/workflow-run-controls.js +63 -10
  273. package/dist/session/composer/ComposerCard.js +7 -1
  274. package/dist/session/composer/agent-selector.d.ts +2 -0
  275. package/dist/session/composer/agent-selector.js +11 -4
  276. package/dist/session/composer/animated-placeholder.js +2 -1
  277. package/dist/session/composer/attachment-tile.d.ts +2 -2
  278. package/dist/session/composer/attachment-tile.js +25 -3
  279. package/dist/session/composer/composer-agent-access.d.ts +10 -1
  280. package/dist/session/composer/composer-agent-access.js +18 -4
  281. package/dist/session/composer/composer-chat-input.d.ts +1 -0
  282. package/dist/session/composer/composer-chat-input.js +7 -2
  283. package/dist/session/composer/composer-logic.d.ts +7 -0
  284. package/dist/session/composer/composer-logic.js +18 -0
  285. package/dist/session/composer/composer-reset.d.ts +8 -14
  286. package/dist/session/composer/composer-toolbar.d.ts +3 -1
  287. package/dist/session/composer/composer-toolbar.js +3 -3
  288. package/dist/session/composer/composer.d.ts +9 -2
  289. package/dist/session/composer/composer.js +24 -9
  290. package/dist/session/composer/editor/composer-editor.js +6 -4
  291. package/dist/session/composer/hooks/use-file-search.d.ts +12 -2
  292. package/dist/session/composer/hooks/use-file-search.js +71 -7
  293. package/dist/session/composer/menus/menu-items.js +6 -2
  294. package/dist/session/composer/menus/menu-shell.d.ts +3 -1
  295. package/dist/session/composer/menus/menu-shell.js +2 -2
  296. package/dist/session/composer/menus/slash-menu.d.ts +7 -0
  297. package/dist/session/composer/menus/slash-menu.js +48 -1
  298. package/dist/session/composer/use-instant-session-send.js +7 -1
  299. package/dist/session/header/session-reminders-indicator.js +3 -2
  300. package/dist/session/header/session-site-header.d.ts +3 -1
  301. package/dist/session/header/session-site-header.js +27 -8
  302. package/dist/session/media/sandbox-url-detector.js +1 -1
  303. package/dist/session/models/connect-model-step.d.ts +29 -0
  304. package/dist/session/models/connect-model-step.js +50 -0
  305. package/dist/session/models/model-connection-gate.js +2 -1
  306. package/dist/session/models/model-selector.js +1 -1
  307. package/dist/session/models/subscription-switcher.d.ts +7 -0
  308. package/dist/session/models/subscription-switcher.js +52 -10
  309. package/dist/session/models/subscription-windows.d.ts +2 -0
  310. package/dist/session/models/subscription-windows.js +2 -0
  311. package/dist/session/models/use-workspace-model-gate.d.ts +11 -0
  312. package/dist/session/models/use-workspace-model-gate.js +62 -0
  313. package/dist/session/models/workspace-model-gate.d.ts +46 -0
  314. package/dist/session/models/workspace-model-gate.js +66 -0
  315. package/dist/session/outcomes/session-outcomes-provider.js +14 -7
  316. package/dist/session/panel/action-panel.js +8 -19
  317. package/dist/session/panel/easy/app-preview.d.ts +4 -1
  318. package/dist/session/panel/easy/app-preview.js +95 -33
  319. package/dist/session/panel/easy/apps-card.js +6 -11
  320. package/dist/session/panel/easy/change-requests-card.js +1 -1
  321. package/dist/session/panel/easy/changes-card.d.ts +14 -0
  322. package/dist/session/panel/easy/changes-card.js +60 -0
  323. package/dist/session/panel/easy/context-card.d.ts +5 -1
  324. package/dist/session/panel/easy/context-card.js +13 -28
  325. package/dist/session/panel/easy/context-meter.d.ts +18 -0
  326. package/dist/session/panel/easy/context-meter.js +73 -0
  327. package/dist/session/panel/easy/detail-view.d.ts +1 -1
  328. package/dist/session/panel/easy/detail-view.js +24 -21
  329. package/dist/session/panel/easy/easy-panel.js +7 -5
  330. package/dist/session/panel/easy/file-preview.js +3 -1
  331. package/dist/session/panel/easy/frame-history.d.ts +91 -0
  332. package/dist/session/panel/easy/frame-history.js +198 -0
  333. package/dist/session/panel/easy/outputs-card.d.ts +10 -0
  334. package/dist/session/panel/easy/outputs-card.js +28 -31
  335. package/dist/session/panel/easy/panel-card.d.ts +1 -3
  336. package/dist/session/panel/easy/panel-card.js +24 -8
  337. package/dist/session/panel/easy/plan-card.js +2 -2
  338. package/dist/session/panel/easy/step-icon.d.ts +4 -1
  339. package/dist/session/panel/easy/step-icon.js +2 -2
  340. package/dist/session/panel/session-action-panel-column.d.ts +5 -0
  341. package/dist/session/panel/session-action-panel-column.js +198 -101
  342. package/dist/session/panel/session-desktop.js +5 -1
  343. package/dist/session/panel/session-diff-viewer.d.ts +3 -1
  344. package/dist/session/panel/session-diff-viewer.js +7 -4
  345. package/dist/session/panel/session-panel-provider.js +29 -5
  346. package/dist/session/panel/shared/derive-panels.js +64 -4
  347. package/dist/session/prompts/session-connect-card.d.ts +63 -0
  348. package/dist/session/prompts/{session-connect-prompt.js → session-connect-card.js} +53 -42
  349. package/dist/session/status/session-busy-indicator.js +2 -1
  350. package/dist/session/status/session-error-banner.js +1 -1
  351. package/dist/session/thread/chat-minimap.js +2 -1
  352. package/dist/session/thread/session-body.js +4 -1
  353. package/dist/session/thread/session-chat.js +311 -300
  354. package/dist/session/thread/session-turn-meta-rows.d.ts +13 -5
  355. package/dist/session/thread/session-turn-meta-rows.js +33 -5
  356. package/dist/session/thread/transcript.d.ts +3 -3
  357. package/dist/session/thread/transcript.js +33 -27
  358. package/dist/session/thread/typing-indicator.d.ts +2 -2
  359. package/dist/session/thread/typing-indicator.js +10 -3
  360. package/dist/session/tool/tool-part-renderer.js +7 -2
  361. package/dist/session/tool/tools/kortix-action-tool.js +10 -2
  362. package/dist/session/tool/tools/session-spawn-tool.js +3 -3
  363. package/dist/session/tool/tools/workflow-run-card.d.ts +11 -1
  364. package/dist/session/tool/tools/workflow-run-card.js +31 -7
  365. package/dist/session/tool/tools/workflow-run-cost.d.ts +29 -0
  366. package/dist/session/tool/tools/workflow-run-cost.js +75 -0
  367. package/dist/session/tool/tools/workflow-tool.d.ts +1 -1
  368. package/dist/session/tool/tools/workflow-tool.js +40 -15
  369. package/dist/session/turn/peer-message-row.js +1 -1
  370. package/dist/session/turn/queued-prompt-bubbles.d.ts +3 -2
  371. package/dist/session/turn/queued-prompt-bubbles.js +1 -1
  372. package/dist/session/turn/throttled-markdown.js +1 -1
  373. package/dist/session/turn/turn-viewport.d.ts +66 -10
  374. package/dist/session/turn/turn-viewport.js +92 -12
  375. package/dist/session/turn/user-message.js +7 -5
  376. package/dist/styles/theme.css +68 -0
  377. package/dist/styles.css +1 -1
  378. package/dist/terminal/pty-terminal.js +1 -1
  379. package/dist/terminal/session-terminal-connect-bar.js +2 -1
  380. package/dist/test-utils/intl.d.ts +544 -46
  381. package/dist/workspace/admin/project-admin-dashboard.js +23 -11
  382. package/dist/workspace/admin/settings-search-landing.js +2 -1
  383. package/dist/workspace/calendar/calendar-dates.d.ts +31 -0
  384. package/dist/workspace/calendar/calendar-dates.js +64 -0
  385. package/dist/workspace/calendar/calendar-new-item.d.ts +11 -0
  386. package/dist/workspace/calendar/calendar-new-item.js +47 -0
  387. package/dist/workspace/calendar/calendar-page.d.ts +3 -0
  388. package/dist/workspace/calendar/calendar-page.js +177 -0
  389. package/dist/workspace/calendar/calendar-panel.d.ts +13 -0
  390. package/dist/workspace/calendar/calendar-panel.js +103 -0
  391. package/dist/workspace/calendar/calendar-people.d.ts +52 -0
  392. package/dist/workspace/calendar/calendar-people.js +117 -0
  393. package/dist/workspace/calendar/calendar-scheduled.d.ts +29 -0
  394. package/dist/workspace/calendar/calendar-scheduled.js +118 -0
  395. package/dist/workspace/calendar/calendar-views.d.ts +32 -0
  396. package/dist/workspace/calendar/calendar-views.js +124 -0
  397. package/dist/workspace/calendar/calendar-when.d.ts +14 -0
  398. package/dist/workspace/calendar/calendar-when.js +81 -0
  399. package/dist/workspace/calendar/mention-textarea.d.ts +19 -0
  400. package/dist/workspace/calendar/mention-textarea.js +84 -0
  401. package/dist/workspace/home/access-requests-bell.js +2 -1
  402. package/dist/workspace/home/existing-repo-setup-prompt.d.ts +5 -8
  403. package/dist/workspace/home/existing-repo-setup-prompt.js +16 -42
  404. package/dist/workspace/home/no-agent-home.d.ts +3 -1
  405. package/dist/workspace/home/no-agent-home.js +2 -2
  406. package/dist/workspace/inbox/workspace-inbox.d.ts +1 -1
  407. package/dist/workspace/inbox/workspace-inbox.js +1 -1
  408. package/dist/workspace/layout/project-files-view.js +2 -1
  409. package/dist/workspace/layout/project-home.js +16 -9
  410. package/dist/workspace/memory/memory-page-list.js +1 -1
  411. package/dist/workspace/new/workspace-handoff.js +2 -1
  412. package/dist/workspace/projects/modal/project-icon-field.js +2 -1
  413. package/dist/workspace/session-workspace.js +13 -12
  414. package/dist/workspace/setup/setup-steps.d.ts +43 -0
  415. package/dist/workspace/setup/setup-steps.js +38 -0
  416. package/dist/workspace/setup/workspace-setup-page.d.ts +10 -0
  417. package/dist/workspace/setup/workspace-setup-page.js +124 -0
  418. package/dist/workspace/sidebar/footer/project-artifacts-nav.js +5 -1
  419. package/dist/workspace/sidebar/footer/project-calendar-nav.d.ts +8 -0
  420. package/dist/workspace/sidebar/footer/project-calendar-nav.js +31 -0
  421. package/dist/workspace/sidebar/footer/project-chrome-nav.d.ts +14 -6
  422. package/dist/workspace/sidebar/footer/project-chrome-nav.js +37 -25
  423. package/dist/workspace/sidebar/footer/project-computer-nav.d.ts +17 -9
  424. package/dist/workspace/sidebar/footer/project-computer-nav.js +36 -26
  425. package/dist/workspace/sidebar/footer/project-download-app-nav.d.ts +7 -7
  426. package/dist/workspace/sidebar/footer/project-download-app-nav.js +25 -13
  427. package/dist/workspace/sidebar/footer/project-inbox-nav.d.ts +8 -0
  428. package/dist/workspace/sidebar/footer/project-inbox-nav.js +29 -0
  429. package/dist/workspace/sidebar/footer/project-manifest-issues-alert.d.ts +3 -13
  430. package/dist/workspace/sidebar/footer/project-manifest-issues-alert.js +6 -48
  431. package/dist/workspace/sidebar/footer/project-mcp-nav.d.ts +7 -7
  432. package/dist/workspace/sidebar/footer/project-mcp-nav.js +31 -13
  433. package/dist/workspace/sidebar/footer/project-phone-app-nav.d.ts +10 -0
  434. package/dist/workspace/sidebar/footer/project-phone-app-nav.js +61 -0
  435. package/dist/workspace/sidebar/footer/project-promo-cards.d.ts +21 -0
  436. package/dist/workspace/sidebar/footer/project-promo-cards.js +33 -0
  437. package/dist/workspace/sidebar/footer/promo-card.d.ts +41 -0
  438. package/dist/workspace/sidebar/footer/promo-card.js +47 -0
  439. package/dist/workspace/sidebar/project-nav-items.d.ts +3 -1
  440. package/dist/workspace/sidebar/project-nav-items.js +12 -4
  441. package/dist/workspace/sidebar/project-session-list.js +58 -26
  442. package/dist/workspace/sidebar/project-sidebar.js +2 -5
  443. package/dist/workspace/sidebar/project-spaces-nav.js +2 -1
  444. package/dist/workspace/sidebar/session-brief-hover-card.d.ts +24 -0
  445. package/dist/workspace/sidebar/session-brief-hover-card.js +4 -3
  446. package/dist/workspace/sidebar/session-group-sections.d.ts +26 -7
  447. package/dist/workspace/sidebar/session-group-sections.js +121 -41
  448. package/dist/workspace/sidebar/session-grouping.d.ts +1 -1
  449. package/dist/workspace/sidebar/session-grouping.js +1 -1
  450. package/dist/workspace/sidebar/sidebar-drill.js +6 -0
  451. package/dist/workspace/sidebar/sidebar-more-group.js +3 -2
  452. package/dist/workspace/sidebar/use-workspace-list.d.ts +7 -0
  453. package/dist/workspace/sidebar/use-workspace-list.js +11 -1
  454. package/dist/workspace/sidebar/workspace-settings-sidebar-nav.d.ts +14 -0
  455. package/dist/workspace/sidebar/workspace-settings-sidebar-nav.js +46 -2
  456. package/dist/workspace/space/space-tab-panels.js +1 -1
  457. package/dist/workspace/spaces/space-details-panel.js +2 -2
  458. package/dist/workspace/spaces/space-timeline.js +2 -2
  459. package/dist/workspace/spaces/space-triggers.js +2 -2
  460. package/dist/workspace/spaces/space-view.js +11 -5
  461. package/package.json +79 -10
  462. package/skills/kortix-ui/SKILL.md +2 -2
  463. package/skills/kortix-ui/references/modules.md +5 -3
  464. package/dist/session/prompts/session-connect-prompt.d.ts +0 -40
  465. package/dist/session/thread/turn-share.d.ts +0 -16
  466. package/dist/session/thread/turn-share.js +0 -161
  467. package/dist/workspace/sidebar/footer/promo-nav-row.d.ts +0 -11
  468. package/dist/workspace/sidebar/footer/promo-nav-row.js +0 -7
  469. /package/dist/markdown/{code/inline-chip.d.ts → inline-chip.d.ts} +0 -0
@@ -1,37 +1,10 @@
1
- import type { DroppedEntry } from '../drop-tree.js';
2
- import type { GitStatusType } from '../../tree/components/file-tree-item.js';
3
- import type { FileNode } from '../../../internal/files/types.js';
4
- interface DriveListViewProps {
5
- elevatedDirs: FileNode[];
6
- dirs: FileNode[];
7
- files: FileNode[];
8
- onNavigateToDir: (node: FileNode) => void;
9
- onOpenFile: (node: FileNode) => void;
10
- onPreviewFile: (node: FileNode) => void;
11
- onDownload: (node: FileNode) => void;
12
- onDownloadDir: (node: FileNode) => void;
13
- onRename: (node: FileNode, newName: string) => void;
14
- onDelete: (node: FileNode) => void;
15
- onHistory: (node: FileNode) => void;
16
- onCopy: (node: FileNode) => void;
17
- onCut: (node: FileNode) => void;
18
- onDropMove: (sourcePath: string, targetDirPath: string) => void;
19
- /** External files dropped onto a folder row upload into THAT folder. */
20
- onDropUpload?: (files: File[], targetDirPath: string, entries?: DroppedEntry[]) => void;
21
- gitStatusMap: Map<string, GitStatusType>;
22
- clipboardPath?: string;
23
- clipboardOperation?: string;
24
- isDirDownloading: (path: string) => boolean;
25
- readOnly?: boolean;
26
- /** Folders that cannot be renamed, cut or deleted (see `ExplorerCapabilities.fixedAt`). */
27
- isFixed?: (path: string) => boolean;
28
- /** Paths still uploading. */
29
- uploadingPaths?: ReadonlySet<string>;
1
+ import { type DriveListingProps } from './explorer-listing.js';
2
+ interface DriveListViewProps extends DriveListingProps {
30
3
  /**
31
4
  * The rows keep the server's name order (a partly loaded folder): the
32
5
  * column headers do not sort and show no arrow.
33
6
  */
34
7
  sortDisabled?: boolean;
35
8
  }
36
- export declare function DriveListView({ elevatedDirs, dirs, files, onNavigateToDir, onOpenFile, onPreviewFile, onDownload, onDownloadDir, onRename: rawOnRename, onDelete: rawOnDelete, onHistory: rawOnHistory, onCopy: rawOnCopy, onCut: rawOnCut, onDropMove: rawOnDropMove, onDropUpload: rawOnDropUpload, gitStatusMap, clipboardPath, clipboardOperation, isDirDownloading, readOnly, isFixed, uploadingPaths, sortDisabled, }: DriveListViewProps): import("react").JSX.Element;
9
+ export declare function DriveListView(props: DriveListViewProps): import("react").JSX.Element;
37
10
  export {};
@@ -2,6 +2,7 @@
2
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
3
  import { Badge } from '../../../primitives/badge.js';
4
4
  import { Button } from '../../../primitives/button.js';
5
+ import { listingWriteHandlers } from './explorer-listing.js';
5
6
  import { useItemSelection } from './drive-selection.js';
6
7
  import { SelectionCheck, SelectMenuItem } from './drive-selection-ui.js';
7
8
  import { ContextMenu, ContextMenuContent, ContextMenuItem, ContextMenuSeparator, ContextMenuTrigger, } from '../../../primitives/context-menu.js';
@@ -9,17 +10,15 @@ import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSepara
9
10
  import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow, } from '../../../primitives/table.js';
10
11
  import { useFilesStore } from '../../../internal/stores/files-store.js';
11
12
  import { cn } from '../../../lib/utils.js';
13
+ import { ManifestIssueMark } from './manifest-issue-mark.js';
12
14
  import Loading from '../../../primitives/loading.js';
13
15
  import { chalkColors } from '../../../_vendor/kortix-shared.js';
14
- import { ArrowDownIcon as ArrowDown, ArrowUpIcon as ArrowUp, FolderIcon as Folder, FolderIcon as FolderCog, DotsThreeVerticalIcon as MoreVertical, } from '@phosphor-icons/react';
16
+ import { ArrowDownIcon as ArrowDown, ArrowUpIcon as ArrowUp, FolderIcon as Folder, DotsThreeVerticalIcon as MoreVertical, } from '@phosphor-icons/react';
15
17
  import { useTranslations } from '../../../i18n/index.js';
16
18
  import { useDriveRowInteractions } from './use-drive-row-interactions.js';
17
19
  import { FileDriveMenuItems, FolderDriveMenuItems } from './drive-grid-view.js';
18
20
  import { getFileIcon } from './file-icon.js';
19
21
  import { ownClicks } from './own-clicks.js';
20
- const ELEVATED_DIR_META = {
21
- '.kortix': 'Workspace config, tasks, context',
22
- };
23
22
  function ChalkBadge({ label }) {
24
23
  const chalk = chalkColors(label);
25
24
  return (_jsx(Badge, { variant: "transparent", size: "xs", className: "border font-semibold backdrop-blur-sm", style: {
@@ -91,21 +90,12 @@ function ListRow({ node, onClick, onDoubleClick, onDownload, onRename, onDelete,
91
90
  }
92
91
  if (e.key === 'Escape')
93
92
  setIsRenaming(false);
94
- }, onBlur: confirmRename, onClick: (e) => e.stopPropagation(), className: "border-border min-w-0 flex-1 border-b bg-transparent py-0.5 text-sm outline-none" })) : (_jsx("span", { className: cn('truncate text-sm font-medium', node.ignored && 'opacity-50', node.name.startsWith('.') && 'text-muted-foreground'), children: node.name })), uploading ? (_jsx("span", { role: "status", "aria-label": tDrives('uploadingFile', { name: node.name }), className: "shrink-0", children: _jsx(Loading, { variant: "spokes", className: "size-3.5" }) })) : null] }) }), _jsx(TableCell, { children: isDir ? (_jsx(ChalkBadge, { label: tHardcodedUi.raw('i18nComplete.text74ccd4330384') })) : ext ? (_jsx(ChalkBadge, { label: ext })) : (_jsx("span", { className: "text-muted-foreground text-sm", children: "\u2014" })) }), _jsx(TableCell, { children: !isRenaming && (_jsx("div", { className: "flex justify-end", children: _jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(Button, { onClick: (e) => e.stopPropagation(), "aria-label": tHardcodedUi.raw('i18nComplete.textf8d46c2570e7'), variant: "ghost", size: "icon-xs", className: "shrink-0 opacity-0 group-hover:opacity-100", children: _jsx(MoreVertical, { className: "text-muted-foreground size-3.5" }) }) }), _jsx(DropdownMenuContent, { align: "end", className: "w-48", children: isDir ? (_jsx(FolderDriveMenuItems, { Item: DropdownMenuItem, Separator: DropdownMenuSeparator, ...folderMenuProps })) : (_jsx(FileDriveMenuItems, { Item: DropdownMenuItem, Separator: DropdownMenuSeparator, ...fileMenuProps })) })] }) })) })] }) }), _jsx(ContextMenuContent, { className: "w-48", children: selection?.selectionMenu(node, ContextMenuItem, ContextMenuSeparator) ?? (_jsxs(_Fragment, { children: [_jsx(SelectMenuItem, { selection: selection, node: node, Item: ContextMenuItem, Separator: ContextMenuSeparator }), isDir ? (_jsx(FolderDriveMenuItems, { Item: ContextMenuItem, Separator: ContextMenuSeparator, ...folderMenuProps })) : (_jsx(FileDriveMenuItems, { Item: ContextMenuItem, Separator: ContextMenuSeparator, ...fileMenuProps }))] })) })] }));
93
+ }, onBlur: confirmRename, onClick: (e) => e.stopPropagation(), className: "border-border min-w-0 flex-1 border-b bg-transparent py-0.5 text-sm outline-none" })) : (_jsx("span", { className: cn('truncate text-sm font-medium', node.ignored && 'opacity-50', node.name.startsWith('.') && 'text-muted-foreground'), children: node.name })), !isDir && !isRenaming ? _jsx(ManifestIssueMark, { path: node.path, name: node.name }) : null, uploading ? (_jsx("span", { role: "status", "aria-label": tDrives('uploadingFile', { name: node.name }), className: "shrink-0", children: _jsx(Loading, { variant: "spokes", className: "size-3.5" }) })) : null] }) }), _jsx(TableCell, { children: isDir ? (_jsx(ChalkBadge, { label: tHardcodedUi.raw('i18nComplete.text74ccd4330384') })) : ext ? (_jsx(ChalkBadge, { label: ext })) : (_jsx("span", { className: "text-muted-foreground text-sm", children: "\u2014" })) }), _jsx(TableCell, { children: !isRenaming && (_jsx("div", { className: "flex justify-end", children: _jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(Button, { onClick: (e) => e.stopPropagation(), "aria-label": tHardcodedUi.raw('i18nComplete.textf8d46c2570e7'), variant: "ghost", size: "icon-xs", className: "shrink-0 opacity-0 group-hover:opacity-100", children: _jsx(MoreVertical, { className: "text-muted-foreground size-3.5" }) }) }), _jsx(DropdownMenuContent, { align: "end", className: "w-48", children: isDir ? (_jsx(FolderDriveMenuItems, { Item: DropdownMenuItem, Separator: DropdownMenuSeparator, ...folderMenuProps })) : (_jsx(FileDriveMenuItems, { Item: DropdownMenuItem, Separator: DropdownMenuSeparator, ...fileMenuProps })) })] }) })) })] }) }), _jsx(ContextMenuContent, { className: "w-48", children: selection?.selectionMenu(node, ContextMenuItem, ContextMenuSeparator) ?? (_jsxs(_Fragment, { children: [_jsx(SelectMenuItem, { selection: selection, node: node, Item: ContextMenuItem, Separator: ContextMenuSeparator }), isDir ? (_jsx(FolderDriveMenuItems, { Item: ContextMenuItem, Separator: ContextMenuSeparator, ...folderMenuProps })) : (_jsx(FileDriveMenuItems, { Item: ContextMenuItem, Separator: ContextMenuSeparator, ...fileMenuProps }))] })) })] }));
95
94
  }
96
- function ElevatedDirRow({ node, onNavigate }) {
95
+ export function DriveListView(props) {
96
+ const { dirs, files, onNavigateToDir, onOpenFile, onPreviewFile, onDownload, onDownloadDir, onHistory, gitStatusMap, clipboardPath, clipboardOperation, isDirDownloading, isFixed, uploadingPaths, sortDisabled = false, } = props;
97
97
  const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
98
- return (_jsxs(TableRow, { onClick: onNavigate, className: "cursor-pointer select-none", children: [_jsx(TableCell, { children: _jsxs("div", { className: "flex min-w-0 items-center gap-2.5", children: [_jsx(FolderCog, { className: "text-muted-foreground size-4 shrink-0" }), _jsx("span", { className: "truncate text-sm font-medium", children: node.name }), ELEVATED_DIR_META[node.name] && (_jsx("span", { className: "text-muted-foreground hidden truncate text-xs sm:inline", children: ELEVATED_DIR_META[node.name] }))] }) }), _jsx(TableCell, { children: _jsx(ChalkBadge, { label: tI18nComplete.raw('text6725e7bbcd28') }) }), _jsx(TableCell, {})] }));
99
- }
100
- export function DriveListView({ elevatedDirs, dirs, files, onNavigateToDir, onOpenFile, onPreviewFile, onDownload, onDownloadDir, onRename: rawOnRename, onDelete: rawOnDelete, onHistory: rawOnHistory, onCopy: rawOnCopy, onCut: rawOnCut, onDropMove: rawOnDropMove, onDropUpload: rawOnDropUpload, gitStatusMap, clipboardPath, clipboardOperation, isDirDownloading, readOnly = false, isFixed, uploadingPaths, sortDisabled = false, }) {
101
- const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
102
- const onRename = readOnly ? undefined : rawOnRename;
103
- const onDelete = readOnly ? undefined : rawOnDelete;
104
- const onHistory = rawOnHistory;
105
- const onCopy = readOnly ? undefined : rawOnCopy;
106
- const onCut = readOnly ? undefined : rawOnCut;
107
- const onDropMove = readOnly ? undefined : rawOnDropMove;
108
- const onDropUpload = readOnly ? undefined : rawOnDropUpload;
98
+ const { onRename, onDelete, onCopy, onCut, onDropMove, onDropUpload } = listingWriteHandlers(props);
109
99
  const sortBy = useFilesStore((s) => s.sortBy);
110
100
  const sortOrder = useFilesStore((s) => s.sortOrder);
111
101
  const setSortBy = useFilesStore((s) => s.setSortBy);
@@ -123,5 +113,5 @@ export function DriveListView({ elevatedDirs, dirs, files, onNavigateToDir, onOp
123
113
  return null;
124
114
  return sortOrder === 'asc' ? (_jsx(ArrowUp, { className: "ml-1 size-3" })) : (_jsx(ArrowDown, { className: "ml-1 size-3" }));
125
115
  };
126
- return (_jsx("div", { className: "space-y-7 p-5", children: _jsxs(Table, { children: [_jsx(TableHeader, { children: _jsxs(TableRow, { className: "hover:bg-transparent", children: [_jsx(TableHead, { children: _jsxs(Button, { onClick: () => handleHeaderClick('name'), disabled: sortDisabled, variant: "transparent", className: "text-muted-foreground hover:text-foreground m-0 h-fit w-fit p-0 font-normal has-[>svg]:p-0", children: [tI18nComplete.raw('textdcd1d5223f73'), renderSortIcon('name')] }) }), _jsx(TableHead, { children: _jsxs(Button, { onClick: () => handleHeaderClick('type'), disabled: sortDisabled, variant: "transparent", className: "text-muted-foreground hover:text-foreground m-0 h-fit w-fit p-0 font-normal has-[>svg]:p-0", children: [tI18nComplete.raw('textbaaddf70fb5d'), renderSortIcon('type')] }) }), _jsx(TableHead, { className: "w-[52px]", children: _jsx("span", { className: "sr-only", children: tI18nComplete.raw('textff8059dc6752') }) })] }) }), _jsxs(TableBody, { children: [elevatedDirs.map((node) => (_jsx(ElevatedDirRow, { node: node, onNavigate: () => onNavigateToDir(node) }, node.path))), dirs.map((node) => (_jsx(ListRow, { node: node, onClick: () => onNavigateToDir(node), onDownload: onDownloadDir, isDownloadingItem: isDirDownloading(node.path), onRename: isFixed?.(node.path) ? undefined : onRename, onDelete: isFixed?.(node.path) ? undefined : onDelete, onCopy: onCopy, onCut: isFixed?.(node.path) ? undefined : onCut, onDropMove: onDropMove, onDropUpload: onDropUpload, isCut: clipboardOperation === 'cut' && clipboardPath === node.path, isCopied: clipboardOperation === 'copy' && clipboardPath === node.path }, node.path))), files.map((node) => (_jsx(ListRow, { node: node, onClick: () => onPreviewFile(node), onDoubleClick: () => onOpenFile(node), onDownload: onDownload, onRename: onRename, onDelete: onDelete, onHistory: onHistory, onCopy: onCopy, onCut: onCut, gitStatus: gitStatusMap.get(node.path), isCut: clipboardOperation === 'cut' && clipboardPath === node.path, isCopied: clipboardOperation === 'copy' && clipboardPath === node.path, uploading: uploadingPaths?.has(node.path) }, node.path)))] })] }) }));
116
+ return (_jsx("div", { className: "space-y-7 p-5", children: _jsxs(Table, { children: [_jsx(TableHeader, { children: _jsxs(TableRow, { className: "hover:bg-transparent", children: [_jsx(TableHead, { children: _jsxs(Button, { onClick: () => handleHeaderClick('name'), disabled: sortDisabled, variant: "transparent", className: "text-muted-foreground hover:text-foreground m-0 h-fit w-fit p-0 font-normal has-[>svg]:p-0", children: [tI18nComplete.raw('textdcd1d5223f73'), renderSortIcon('name')] }) }), _jsx(TableHead, { children: _jsxs(Button, { onClick: () => handleHeaderClick('type'), disabled: sortDisabled, variant: "transparent", className: "text-muted-foreground hover:text-foreground m-0 h-fit w-fit p-0 font-normal has-[>svg]:p-0", children: [tI18nComplete.raw('textbaaddf70fb5d'), renderSortIcon('type')] }) }), _jsx(TableHead, { className: "w-[52px]", children: _jsx("span", { className: "sr-only", children: tI18nComplete.raw('textff8059dc6752') }) })] }) }), _jsxs(TableBody, { children: [dirs.map((node) => (_jsx(ListRow, { node: node, onClick: () => onNavigateToDir(node), onDownload: onDownloadDir, isDownloadingItem: isDirDownloading(node.path), onRename: isFixed?.(node.path) ? undefined : onRename, onDelete: isFixed?.(node.path) ? undefined : onDelete, onCopy: onCopy, onCut: isFixed?.(node.path) ? undefined : onCut, onDropMove: onDropMove, onDropUpload: onDropUpload, isCut: clipboardOperation === 'cut' && clipboardPath === node.path, isCopied: clipboardOperation === 'copy' && clipboardPath === node.path }, node.path))), files.map((node) => (_jsx(ListRow, { node: node, onClick: () => onPreviewFile(node), onDoubleClick: () => onOpenFile(node), onDownload: onDownload, onRename: onRename, onDelete: onDelete, onHistory: onHistory, onCopy: onCopy, onCut: onCut, gitStatus: gitStatusMap.get(node.path), isCut: clipboardOperation === 'cut' && clipboardPath === node.path, isCopied: clipboardOperation === 'copy' && clipboardPath === node.path, uploading: uploadingPaths?.has(node.path) }, node.path)))] })] }) }));
127
117
  }
@@ -1,12 +1,11 @@
1
1
  import type { SelectionStore } from './drive-selection.js';
2
2
  /**
3
- * The multi-selection's actions, floating at the bottom centre of the listing
4
- * like the Triggers page's selection bar (`trigger-selection-bar.tsx`). Two
5
- * rows: the count and close on top, the actions below as one secondary group
6
- * across the full width, so every label fits. Labels drop to icons when narrow.
3
+ * The Drive's select-mode bar: the shared `SelectionBar` (an `ActionBar`) with
4
+ * Download, then Copy, Move and Delete for members who may write. It reads the
5
+ * count from the selection store itself, so only the bar re-renders as the
6
+ * count moves.
7
7
  */
8
8
  export declare function DriveSelectionBar({ store, total, zipping, canWrite, onSelectAll, onClearSelection, onDownload, onCopy, onMove, onDelete, onExit, }: {
9
- /** Read here, so only the bar re-renders as the count moves. */
10
9
  store: SelectionStore;
11
10
  /** Items in view, for "Select all" vs "Deselect all". */
12
11
  total: number;
@@ -1,30 +1,23 @@
1
1
  'use client';
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { Button } from '../../../primitives/button.js';
4
- import { ButtonGroup } from '../../../primitives/button-group.js';
5
- import Hint from '../../../primitives/hint.js';
6
- import Loading from '../../../primitives/loading.js';
7
- import { Download } from '../../../internal/icons/download.js';
2
+ import { jsx as _jsx } from "react/jsx-runtime";
8
3
  import { useTranslations } from '../../../i18n/index.js';
9
- import { ArrowsLeftRightIcon, CheckSquareIcon, ClipboardIcon, TrashIcon, XIcon, } from '@phosphor-icons/react';
4
+ import { SelectionBar } from '../../../internal/selection/selection-bar.js';
10
5
  import { useSyncExternalStore } from 'react';
11
6
  /**
12
- * The multi-selection's actions, floating at the bottom centre of the listing
13
- * like the Triggers page's selection bar (`trigger-selection-bar.tsx`). Two
14
- * rows: the count and close on top, the actions below as one secondary group
15
- * across the full width, so every label fits. Labels drop to icons when narrow.
7
+ * The Drive's select-mode bar: the shared `SelectionBar` (an `ActionBar`) with
8
+ * Download, then Copy, Move and Delete for members who may write. It reads the
9
+ * count from the selection store itself, so only the bar re-renders as the
10
+ * count moves.
16
11
  */
17
12
  export function DriveSelectionBar({ store, total, zipping, canWrite, onSelectAll, onClearSelection, onDownload, onCopy, onMove, onDelete, onExit, }) {
18
13
  const t = useTranslations('drives');
19
14
  const count = useSyncExternalStore(store.subscribe, () => store.paths().size, () => 0);
20
- const allSelected = total > 0 && count === total;
21
15
  const none = count === 0;
22
- const action = (label, icon, onClick, disabled = false) => (_jsx(Hint, { label: label, side: "top", children: _jsxs(Button, { type: "button", variant: "secondary", size: "sm", onClick: onClick, disabled: disabled, "aria-label": label, className: "min-w-0 flex-1 gap-1.5 active:scale-[0.96]", children: [icon, _jsx("span", { className: "hidden truncate @md/bar:inline", children: label })] }) }));
23
- return (_jsxs("div", { className: "bg-popover text-popover-foreground border-border @container/bar flex w-full flex-col gap-2 rounded-lg border p-2 shadow-md", children: [_jsxs("div", { className: "flex items-center gap-2 pl-1.5", children: [_jsx("span", { className: "min-w-0 flex-1 truncate text-sm font-medium tabular-nums", "aria-live": "polite", children: t('selectedCount', { count }) }), _jsx(Hint, { label: t('cancel'), side: "top", children: _jsx(Button, { type: "button", variant: "ghost", size: "icon-sm", onClick: onExit, "aria-label": t('cancel'), className: "text-muted-foreground hover:text-foreground shrink-0", children: _jsx(XIcon, { className: "size-4" }) }) })] }), _jsxs(ButtonGroup, { className: "w-full", children: [action(allSelected ? t('deselectAll') : t('selectAll'), _jsx(CheckSquareIcon, { className: "size-3.5 shrink-0" }), allSelected ? onClearSelection : onSelectAll), action(t('download'), zipping ? _jsx(Loading, { className: "size-3.5 shrink-0" }) : _jsx(Download, { className: "size-3.5 shrink-0" }), onDownload, none || zipping), canWrite
24
- ? action(t('copyItems'), _jsx(ClipboardIcon, { className: "size-3.5 shrink-0" }), onCopy, none)
25
- : null, canWrite
26
- ? action(t('moveItems'), _jsx(ArrowsLeftRightIcon, { className: "size-3.5 shrink-0" }), onMove, none)
27
- : null, canWrite
28
- ? action(t('delete'), _jsx(TrashIcon, { className: "size-3.5 shrink-0" }), onDelete, none)
29
- : null] })] }));
16
+ const actions = [
17
+ { id: 'download', label: t('download'), loading: zipping, disabled: none, onSelect: onDownload },
18
+ ];
19
+ if (canWrite) {
20
+ actions.push({ id: 'copy', label: t('copyItems'), disabled: none, onSelect: onCopy }, { id: 'move', label: t('moveItems'), disabled: none, onSelect: onMove }, { id: 'delete', label: t('delete'), tone: 'destructive', disabled: none, onSelect: onDelete });
21
+ }
22
+ return (_jsx(SelectionBar, { selectedCount: count, allSelected: total > 0 && count === total, canSelectAll: total > 0, onSelectAll: onSelectAll, onClear: onClearSelection, onExit: onExit, actions: actions }));
30
23
  }
@@ -0,0 +1,48 @@
1
+ import type { DroppedEntry } from '../drop-tree.js';
2
+ import type { GitStatusType } from '../../tree/components/file-tree-item.js';
3
+ import { type ViewMode } from '../../../internal/stores/files-store.js';
4
+ import type { FileNode } from '../../../internal/files/types.js';
5
+ /**
6
+ * The listing core both explorers share (`DriveExplorer` and the read-only
7
+ * `FileExplorerPage`): the sorted, partitioned rows, their loading skeleton,
8
+ * and the props contract of the two views that render them.
9
+ */
10
+ /** Sort and separate dirs and files, by the store's sort field and order. */
11
+ export declare function useSortedListing(files: FileNode[] | undefined, partial: boolean): {
12
+ dirs: FileNode[];
13
+ fileItems: FileNode[];
14
+ };
15
+ /** The placeholder rows of a listing that is still loading. */
16
+ export declare function ListingSkeleton({ viewMode }: {
17
+ viewMode: ViewMode;
18
+ }): import("react").JSX.Element;
19
+ /** The props `DriveGridView` and `DriveListView` share. */
20
+ export interface DriveListingProps {
21
+ dirs: FileNode[];
22
+ files: FileNode[];
23
+ onNavigateToDir: (node: FileNode) => void;
24
+ onOpenFile: (node: FileNode) => void;
25
+ onPreviewFile: (node: FileNode) => void;
26
+ onDownload: (node: FileNode) => void;
27
+ onDownloadDir: (node: FileNode) => void;
28
+ onRename?: (node: FileNode, newName: string) => void;
29
+ onDelete?: (node: FileNode) => void;
30
+ onHistory: (node: FileNode) => void;
31
+ onCopy?: (node: FileNode) => void;
32
+ onCut?: (node: FileNode) => void;
33
+ onDropMove?: (sourcePath: string, targetDirPath: string) => void;
34
+ /** External files dropped onto a folder upload into THAT folder. */
35
+ onDropUpload?: (files: File[], targetDirPath: string, entries?: DroppedEntry[]) => void;
36
+ gitStatusMap: Map<string, GitStatusType>;
37
+ clipboardPath?: string;
38
+ clipboardOperation?: string;
39
+ isDirDownloading: (path: string) => boolean;
40
+ /** Hide mutation context-menu entries (delete/rename/cut/copy). */
41
+ readOnly?: boolean;
42
+ /** Folders that cannot be renamed, cut or deleted (see `ExplorerCapabilities.fixedAt`). */
43
+ isFixed?: (path: string) => boolean;
44
+ /** Paths still uploading. */
45
+ uploadingPaths?: ReadonlySet<string>;
46
+ }
47
+ /** The write handlers a listing passes to its rows: none when it is `readOnly`. */
48
+ export declare function listingWriteHandlers(props: DriveListingProps): Pick<DriveListingProps, 'onRename' | 'onDelete' | 'onCopy' | 'onCut' | 'onDropMove' | 'onDropUpload'>;
@@ -0,0 +1,64 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { Skeleton } from '../../../primitives/skeleton.js';
4
+ import { useFilesStore } from '../../../internal/stores/files-store.js';
5
+ import { useMemo } from 'react';
6
+ /**
7
+ * The listing core both explorers share (`DriveExplorer` and the read-only
8
+ * `FileExplorerPage`): the sorted, partitioned rows, their loading skeleton,
9
+ * and the props contract of the two views that render them.
10
+ */
11
+ /** Sort and separate dirs and files, by the store's sort field and order. */
12
+ export function useSortedListing(files, partial) {
13
+ const sortBy = useFilesStore((s) => s.sortBy);
14
+ const sortOrder = useFilesStore((s) => s.sortOrder);
15
+ return useMemo(() => {
16
+ if (!files)
17
+ return {
18
+ dirs: [],
19
+ fileItems: [],
20
+ };
21
+ const sortFn = (a, b) => {
22
+ let cmp = 0;
23
+ switch (sortBy) {
24
+ case 'name':
25
+ cmp = a.name.localeCompare(b.name);
26
+ break;
27
+ case 'type': {
28
+ const extA = a.name.includes('.') ? a.name.split('.').pop() || '' : '';
29
+ const extB = b.name.includes('.') ? b.name.split('.').pop() || '' : '';
30
+ cmp = extA.localeCompare(extB);
31
+ if (cmp === 0)
32
+ cmp = a.name.localeCompare(b.name);
33
+ break;
34
+ }
35
+ case 'modified':
36
+ case 'size':
37
+ cmp = a.name.localeCompare(b.name);
38
+ break;
39
+ }
40
+ return sortOrder === 'desc' ? -cmp : cmp;
41
+ };
42
+ // A partial folder keeps the server's name order: a sorted subset would
43
+ // put a later page's rows above the ones shown (KRTX-1723).
44
+ const sorted = (nodes) => (partial ? nodes : nodes.sort(sortFn));
45
+ const dirs = sorted(files.filter((f) => f.type === 'directory'));
46
+ const fileItems = sorted(files.filter((f) => f.type === 'file'));
47
+ return { dirs, fileItems };
48
+ }, [files, sortBy, sortOrder, partial]);
49
+ }
50
+ /** The placeholder rows of a listing that is still loading. */
51
+ export function ListingSkeleton({ viewMode }) {
52
+ return (_jsx("div", { className: "animate-in fade-in-0 p-4 duration-(--duration-moderate) motion-reduce:animate-none", children: viewMode === 'grid' ? (_jsxs("div", { className: "space-y-6", children: [_jsxs("div", { children: [_jsx(Skeleton, { className: "mb-3 h-4 w-16" }), _jsx("div", { className: "grid gap-2", style: {
53
+ gridTemplateColumns: "repeat(auto-fill, minmax(160px, 1fr))",
54
+ }, children: Array.from({ length: 6 }).map((_, i) => (_jsx(Skeleton, { className: "h-10 rounded-lg" }, `f${i}`))) })] }), _jsxs("div", { children: [_jsx(Skeleton, { className: "mb-3 h-4 w-12" }), _jsx("div", { className: "grid gap-2.5", style: {
55
+ gridTemplateColumns: "repeat(auto-fill, minmax(150px, 1fr))",
56
+ }, children: Array.from({ length: 8 }).map((_, i) => (_jsx(Skeleton, { className: "h-[138px] rounded-lg" }, `fi${i}`))) })] })] })) : (_jsx("div", { className: "space-y-1", children: Array.from({ length: 10 }).map((_, i) => (_jsx(Skeleton, { className: "h-10 w-full rounded-sm" }, i))) })) }));
57
+ }
58
+ /** The write handlers a listing passes to its rows: none when it is `readOnly`. */
59
+ export function listingWriteHandlers(props) {
60
+ if (props.readOnly)
61
+ return {};
62
+ const { onRename, onDelete, onCopy, onCut, onDropMove, onDropUpload } = props;
63
+ return { onRename, onDelete, onCopy, onCut, onDropMove, onDropUpload };
64
+ }
@@ -1,8 +1,6 @@
1
1
  'use client';
2
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
- import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, } from '../../../primitives/alert-dialog.js';
2
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
4
3
  import { Button } from '../../../primitives/button.js';
5
- import { Skeleton } from '../../../primitives/skeleton.js';
6
4
  import { errorToast, successToast } from '../../../primitives/toast.js';
7
5
  import { useFilesStore } from '../../../internal/stores/files-store.js';
8
6
  import { EmptyState } from '../../../primitives/empty-state.js';
@@ -17,7 +15,6 @@ import { useFileExplorerSource } from '../explorer-source.js';
17
15
  import { buildGitStatusMap, useFileEventInvalidation, useFileList, useGitStatus } from '../hooks/index.js';
18
16
  import { useOpenChangeRequestList } from '../hooks/use-change-requests.js';
19
17
  import { useDirectoryDownload } from '../hooks/use-directory-download.js';
20
- import { useFileCopy, useFileDelete, useFileMkdir, useFileRename, } from '../hooks/use-file-mutations.js';
21
18
  import { ChangeRequestDetailDialog } from './change-request-detail-dialog.js';
22
19
  import { ChangeRequestsPanel } from './change-requests-panel.js';
23
20
  import { CheckpointsPanel } from './checkpoints-panel.js';
@@ -28,8 +25,8 @@ import { FileHistoryPopoverContent } from './file-history-popover.js';
28
25
  import { ExplorerFilePreview } from './file-preview-modal.js';
29
26
  import { FileSearch } from './file-search.js';
30
27
  import { isPartialListing, LoadMoreRow } from './load-more-row.js';
28
+ import { ListingSkeleton, useSortedListing } from './explorer-listing.js';
31
29
  import { requestedFilesRightPanel } from './file-route-state.js';
32
- const ELEVATED_DIRS = new Set(['.kortix']);
33
30
  /**
34
31
  * The project-level file explorer. It has no session context — sharing is
35
32
  * scoped to a session's sandbox — so it renders no share control, matching
@@ -43,13 +40,7 @@ export function FileExplorerPage({ embedded = false } = {}) {
43
40
  const currentPath = useFilesStore((s) => s.currentPath);
44
41
  const navigateToPath = useFilesStore((s) => s.navigateToPath);
45
42
  const viewMode = useFilesStore((s) => s.viewMode);
46
- const sortBy = useFilesStore((s) => s.sortBy);
47
- const sortOrder = useFilesStore((s) => s.sortOrder);
48
43
  const openFileWithList = useFilesStore((s) => s.openFileWithList);
49
- const clipboard = useFilesStore((s) => s.clipboard);
50
- const copyToClipboard = useFilesStore((s) => s.copyToClipboard);
51
- const cutToClipboard = useFilesStore((s) => s.cutToClipboard);
52
- const clearClipboard = useFilesStore((s) => s.clearClipboard);
53
44
  // Filename search over the whole repository (KRTX-1723): ⌘P or the `⋯` menu.
54
45
  const searchEnabled = useFileExplorerSource().capabilities.search;
55
46
  const isSearchOpen = useFilesStore((s) => s.isSearchOpen);
@@ -63,12 +54,6 @@ export function FileExplorerPage({ embedded = false } = {}) {
63
54
  const partial = isPartialListing(listing);
64
55
  const { data: gitStatuses } = useGitStatus();
65
56
  const gitStatusMap = useMemo(() => buildGitStatusMap(gitStatuses), [gitStatuses]);
66
- const deleteMutation = useFileDelete();
67
- const mkdirMutation = useFileMkdir();
68
- const renameMutation = useFileRename();
69
- const copyMutation = useFileCopy();
70
- const deleteButtonRef = useRef(null);
71
- const [deleteTarget, setDeleteTarget] = useState(null);
72
57
  const { downloadDir, isDownloading: isDirDownloading } = useDirectoryDownload();
73
58
  // Seeded from isLoading, not false: the route's loading.tsx has already
74
59
  // painted a skeleton by the time this mounts, so starting at false renders an
@@ -91,46 +76,7 @@ export function FileExplorerPage({ embedded = false } = {}) {
91
76
  return () => clearTimeout(timer);
92
77
  }, [isLoading]);
93
78
  const isRootPath = currentPath === '/' || currentPath === '.' || currentPath === '';
94
- const normalizedCurrentPath = isRootPath ? '' : currentPath.replace(/\/$/, '');
95
- const { elevatedDirs, dirs, fileItems } = useMemo(() => {
96
- if (!files)
97
- return {
98
- elevatedDirs: [],
99
- dirs: [],
100
- fileItems: [],
101
- };
102
- const sortFn = (a, b) => {
103
- let cmp = 0;
104
- switch (sortBy) {
105
- case 'name':
106
- cmp = a.name.localeCompare(b.name);
107
- break;
108
- case 'type': {
109
- const extA = a.name.includes('.') ? a.name.split('.').pop() || '' : '';
110
- const extB = b.name.includes('.') ? b.name.split('.').pop() || '' : '';
111
- cmp = extA.localeCompare(extB);
112
- if (cmp === 0)
113
- cmp = a.name.localeCompare(b.name);
114
- break;
115
- }
116
- case 'modified':
117
- case 'size':
118
- cmp = a.name.localeCompare(b.name);
119
- break;
120
- }
121
- return sortOrder === 'desc' ? -cmp : cmp;
122
- };
123
- // A partial folder keeps the server's name order: a sorted subset would
124
- // put a later page's rows above the ones shown (KRTX-1723).
125
- const sorted = (nodes) => (partial ? nodes : nodes.sort(sortFn));
126
- const allDirs = files.filter((f) => f.type === 'directory');
127
- const elevatedDirs = allDirs
128
- .filter((f) => ELEVATED_DIRS.has(f.name))
129
- .sort((a, b) => a.name.localeCompare(b.name));
130
- const dirs = sorted(allDirs.filter((f) => !ELEVATED_DIRS.has(f.name)));
131
- const fileItems = sorted(files.filter((f) => f.type === 'file'));
132
- return { elevatedDirs, dirs, fileItems };
133
- }, [files, sortBy, sortOrder, partial]);
79
+ const { dirs, fileItems } = useSortedListing(files, partial);
134
80
  const handleNavigateToDir = useCallback((node) => {
135
81
  navigateToPath(node.path);
136
82
  }, [navigateToPath]);
@@ -139,11 +85,7 @@ export function FileExplorerPage({ embedded = false } = {}) {
139
85
  const index = allFiles.indexOf(node.path);
140
86
  openFileWithList(node.path, allFiles, Math.max(0, index));
141
87
  }, [fileItems, openFileWithList]);
142
- const handlePreviewFile = useCallback((node) => {
143
- const allFiles = fileItems.map((f) => f.path);
144
- const index = allFiles.indexOf(node.path);
145
- openFileWithList(node.path, allFiles, Math.max(0, index));
146
- }, [fileItems, openFileWithList]);
88
+ const handlePreviewFile = handleOpenFile;
147
89
  const handleDownload = useCallback(async (node) => {
148
90
  if (!projectId || !projectRef)
149
91
  return;
@@ -158,142 +100,14 @@ export function FileExplorerPage({ embedded = false } = {}) {
158
100
  const handleDownloadDir = useCallback((node) => {
159
101
  downloadDir(node.path, node.name);
160
102
  }, [downloadDir]);
161
- const handleRename = useCallback(async (node, newName) => {
162
- if (!newName || newName === node.name)
163
- return;
164
- const parentPath = node.path.substring(0, node.path.lastIndexOf('/'));
165
- const newPath = parentPath ? `${parentPath}/${newName}` : newName;
166
- try {
167
- await renameMutation.mutateAsync({ from: node.path, to: newPath });
168
- successToast(tHardcodedUi('i18nComplete.text3c6bd1e4217c', { value0: newName }));
169
- }
170
- catch (err) {
171
- errorToast(tHardcodedUi('i18nComplete.textd6f8c9c8e719', {
172
- value0: err instanceof Error
173
- ? err.message
174
- : tHardcodedUi.raw('i18nComplete.textada37a724fca'),
175
- }));
176
- }
177
- }, [renameMutation, tHardcodedUi]);
178
- const handleDelete = useCallback((node) => {
179
- setDeleteTarget(node);
180
- }, []);
181
- const confirmDelete = useCallback(async () => {
182
- if (!deleteTarget)
183
- return;
184
- try {
185
- await deleteMutation.mutateAsync({ filePath: deleteTarget.path });
186
- successToast(tHardcodedUi('i18nComplete.text37bad7de9098', { value0: deleteTarget.name }));
187
- }
188
- catch (err) {
189
- errorToast(tHardcodedUi('i18nComplete.text5d4ff119f3d4', {
190
- value0: err instanceof Error ? err.message : tHardcodedUi.raw('i18nComplete.textada37a724fca'),
191
- }));
192
- }
193
- finally {
194
- setDeleteTarget(null);
195
- }
196
- }, [deleteTarget, deleteMutation, tHardcodedUi]);
197
103
  const handleHistory = useCallback((node) => {
198
104
  setHistoryPopoverPath(node.path);
199
105
  }, []);
200
- const handleCopy = useCallback((node) => {
201
- copyToClipboard(node.path, node.name, node.type);
202
- successToast(tHardcodedUi('i18nComplete.textd46dc6f5e3e3', { value0: node.name }));
203
- }, [copyToClipboard, tHardcodedUi]);
204
- const handleCut = useCallback((node) => {
205
- cutToClipboard(node.path, node.name, node.type);
206
- successToast(tHardcodedUi('i18nComplete.text80565873fe1e', { value0: node.name }));
207
- }, [cutToClipboard, tHardcodedUi]);
208
- const handleDropMove = useCallback(async (sourcePath, targetDirPath) => {
209
- const sourceName = sourcePath.split('/').pop() || '';
210
- const destPath = targetDirPath ? `${targetDirPath}/${sourceName}` : sourceName;
211
- if (sourcePath === destPath)
212
- return;
213
- try {
214
- await renameMutation.mutateAsync({ from: sourcePath, to: destPath });
215
- successToast(tHardcodedUi('i18nComplete.text854362dd1a76', { value0: sourceName }));
216
- }
217
- catch (err) {
218
- errorToast(tHardcodedUi('i18nComplete.text66d6798adfa9', {
219
- value0: err instanceof Error
220
- ? err.message
221
- : tHardcodedUi.raw('i18nComplete.text27c2ccd962c2'),
222
- }));
223
- }
224
- }, [renameMutation, tHardcodedUi]);
225
- const handlePaste = useCallback(async () => {
226
- if (!clipboard)
227
- return;
228
- const destDir = normalizedCurrentPath;
229
- let destName = clipboard.name;
230
- if (files) {
231
- const existingNames = new Set(files.map((f) => f.name.toLowerCase()));
232
- if (existingNames.has(destName.toLowerCase())) {
233
- if (clipboard.operation === 'copy') {
234
- const ext = destName.includes('.') ? destName.substring(destName.lastIndexOf('.')) : '';
235
- const baseName = ext ? destName.substring(0, destName.lastIndexOf('.')) : destName;
236
- let counter = 0;
237
- let candidate = `${baseName} (copy)${ext}`;
238
- while (existingNames.has(candidate.toLowerCase())) {
239
- counter++;
240
- candidate = `${baseName} (copy ${counter + 1})${ext}`;
241
- }
242
- destName = candidate;
243
- }
244
- else {
245
- const sourceDir = clipboard.path.substring(0, clipboard.path.lastIndexOf('/')) || '.';
246
- const normalizedSourceDir = sourceDir === '' ? '.' : sourceDir;
247
- const normalizedDestDir = destDir === '' ? '.' : destDir;
248
- if (normalizedSourceDir === normalizedDestDir) {
249
- errorToast(tHardcodedUi.raw('i18nComplete.text7a1bdceb4943'));
250
- return;
251
- }
252
- }
253
- }
254
- }
255
- const destPath = destDir ? `${destDir}/${destName}` : destName;
256
- try {
257
- if (clipboard.operation === 'copy') {
258
- if (clipboard.type === 'file') {
259
- await copyMutation.mutateAsync({ sourcePath: clipboard.path, destPath });
260
- successToast(tHardcodedUi('i18nComplete.textbb45167cfb4d', { value0: clipboard.name }));
261
- }
262
- else {
263
- await mkdirMutation.mutateAsync({ dirPath: destPath });
264
- successToast(tHardcodedUi('i18nComplete.textd6318e7ae71a', { value0: clipboard.name }));
265
- }
266
- }
267
- else {
268
- await renameMutation.mutateAsync({ from: clipboard.path, to: destPath });
269
- successToast(tHardcodedUi('i18nComplete.text59004552be50', { value0: clipboard.name }));
270
- clearClipboard();
271
- }
272
- }
273
- catch (err) {
274
- errorToast(tHardcodedUi('i18nComplete.texta619e901f9c0', {
275
- value0: err instanceof Error ? err.message : tHardcodedUi.raw('i18nComplete.text27c2ccd962c2'),
276
- }));
277
- }
278
- }, [
279
- clipboard,
280
- normalizedCurrentPath,
281
- files,
282
- copyMutation,
283
- renameMutation,
284
- mkdirMutation,
285
- clearClipboard,
286
- tHardcodedUi,
287
- ]);
288
106
  useEffect(() => {
289
107
  const handleKeyDown = (e) => {
290
108
  const target = e.target;
291
109
  if (target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.isContentEditable)
292
110
  return;
293
- if ((e.metaKey || e.ctrlKey) && e.key === 'v' && clipboard) {
294
- e.preventDefault();
295
- handlePaste();
296
- }
297
111
  if ((e.metaKey || e.ctrlKey) && e.key === 'p' && searchEnabled) {
298
112
  e.preventDefault();
299
113
  toggleSearch();
@@ -301,7 +115,7 @@ export function FileExplorerPage({ embedded = false } = {}) {
301
115
  };
302
116
  window.addEventListener('keydown', handleKeyDown);
303
117
  return () => window.removeEventListener('keydown', handleKeyDown);
304
- }, [clipboard, handlePaste, searchEnabled, toggleSearch]);
118
+ }, [searchEnabled, toggleSearch]);
305
119
  const [historyPopoverPath, setHistoryPopoverPath] = useState(null);
306
120
  const [rightPanel, setRightPanel] = useState(null);
307
121
  const [createdCrId, setCreatedCrId] = useState(null);
@@ -335,7 +149,6 @@ export function FileExplorerPage({ embedded = false } = {}) {
335
149
  !error &&
336
150
  Boolean(files) &&
337
151
  !listing.hasNextPage &&
338
- elevatedDirs.length === 0 &&
339
152
  dirs.length === 0 &&
340
153
  fileItems.length === 0;
341
154
  return (_jsxs("div", { className: "bg-background relative flex h-full flex-col", children: [_jsx(DriveHeader, { projectId: projectId || undefined, offsetForSidebarToggle: !embedded, historyToggle: {
@@ -351,17 +164,7 @@ export function FileExplorerPage({ embedded = false } = {}) {
351
164
  : currentPath.split('/').filter(Boolean).pop() || 'directory';
352
165
  const dirPath = isRootPath ? '/workspace' : currentPath;
353
166
  downloadDir(dirPath, dirName);
354
- }, isDownloading: isDirDownloading(isRootPath ? '/workspace' : currentPath), showSearch: searchEnabled, sortDisabled: partial }), _jsxs("div", { className: "relative min-h-0 flex-1", children: [_jsxs("div", { className: "absolute inset-0 overflow-y-auto", children: [isLoading && showSkeleton && (_jsx("div", { className: "animate-in fade-in-0 p-4 duration-200", children: viewMode === 'grid' ? (_jsxs("div", { className: "space-y-6", children: [_jsxs("div", { children: [_jsx(Skeleton, { className: "mb-3 h-4 w-16" }), _jsx("div", { className: "grid gap-2", style: {
355
- gridTemplateColumns: "repeat(auto-fill, minmax(160px, 1fr))",
356
- }, children: Array.from({ length: 6 }).map((_, i) => (_jsx(Skeleton, { className: "h-10 rounded-lg" }, `f${i}`))) })] }), _jsxs("div", { children: [_jsx(Skeleton, { className: "mb-3 h-4 w-12" }), _jsx("div", { className: "grid gap-2.5", style: {
357
- gridTemplateColumns: "repeat(auto-fill, minmax(150px, 1fr))",
358
- }, children: Array.from({ length: 8 }).map((_, i) => (_jsx(Skeleton, { className: "h-[138px] rounded-lg" }, `fi${i}`))) })] })] })) : (_jsx("div", { className: "space-y-1", children: Array.from({ length: 10 }).map((_, i) => (_jsx(Skeleton, { className: "h-10 w-full rounded" }, i))) })) })), !!error && !isLoading && (_jsx(ErrorState, { title: tHardcodedUi.raw('featuresProjectFilesComponentsFileExplorerPage.line658JsxTextFailedToLoadFiles'), description: error instanceof Error
167
+ }, isDownloading: isDirDownloading(isRootPath ? '/workspace' : currentPath), showSearch: searchEnabled, sortDisabled: partial }), _jsxs("div", { className: "relative min-h-0 flex-1", children: [_jsxs("div", { className: "absolute inset-0 overflow-y-auto", children: [isLoading && showSkeleton && _jsx(ListingSkeleton, { viewMode: viewMode }), !!error && !isLoading && (_jsx(ErrorState, { title: tHardcodedUi.raw('featuresProjectFilesComponentsFileExplorerPage.line658JsxTextFailedToLoadFiles'), description: error instanceof Error
359
168
  ? error.message
360
- : tHardcodedUi.raw('i18nComplete.text27c2ccd962c2'), action: _jsx(Button, { variant: "outline", size: "sm", onClick: () => refetchFiles(), children: tHardcodedUi.raw('i18nComplete.text942087cc2d41') }) })), isEmpty && (_jsx(EmptyState, { icon: FolderOpen, title: tHardcodedUi.raw('featuresProjectFilesComponentsDriveListView.line396JsxTextThisFolderIsEmpty'), description: tHardcodedUi.raw('featuresProjectFilesComponentsDriveListView.line398JsxTextNoFilesOrSubfoldersAtThisPathIn') })), !isLoading && !error && files && !isEmpty && (_jsxs(_Fragment, { children: [viewMode === 'grid' ? (_jsx(DriveGridView, { elevatedDirs: elevatedDirs, dirs: dirs, files: fileItems, onNavigateToDir: handleNavigateToDir, onOpenFile: handleOpenFile, onPreviewFile: handlePreviewFile, onDownload: handleDownload, onDownloadDir: handleDownloadDir, onRename: handleRename, onDelete: handleDelete, onHistory: handleHistory, onCopy: handleCopy, onCut: handleCut, onDropMove: handleDropMove, gitStatusMap: gitStatusMap, clipboardPath: clipboard?.path, clipboardOperation: clipboard?.operation, isDirDownloading: isDirDownloading, readOnly: true })) : (_jsx(DriveListView, { elevatedDirs: elevatedDirs, dirs: dirs, files: fileItems, sortDisabled: partial, onNavigateToDir: handleNavigateToDir, onOpenFile: handleOpenFile, onPreviewFile: handlePreviewFile, onDownload: handleDownload, onDownloadDir: handleDownloadDir, onRename: handleRename, onDelete: handleDelete, onHistory: handleHistory, onCopy: handleCopy, onCut: handleCut, onDropMove: handleDropMove, gitStatusMap: gitStatusMap, clipboardPath: clipboard?.path, clipboardOperation: clipboard?.operation, isDirDownloading: isDirDownloading, readOnly: true })), _jsx(LoadMoreRow, { listing: listing })] }))] }), _jsx(CheckpointsPanel, { open: rightPanel === 'history', onClose: () => setRightPanel(null) }), _jsx(ChangeRequestsPanel, { open: rightPanel === 'proposed-changes', onClose: () => setRightPanel(null) })] }), _jsx(ChangeRequestDetailDialog, { crId: createdCrId, onClose: () => setCreatedCrId(null), onOpenChangeRequest: setCreatedCrId }), _jsx(ExplorerFilePreview, {}), searchEnabled && isSearchOpen && _jsx(FileSearch, {}), historyPopoverPath && (_jsx("div", { className: "bg-popover border-border animate-in slide-in-from-bottom-4 fade-in-0 fixed right-4 bottom-4 z-50 overflow-hidden rounded-md border shadow-2xl duration-200", children: _jsx(FileHistoryPopoverContent, { filePath: historyPopoverPath, onClose: () => setHistoryPopoverPath(null) }) })), _jsx(AlertDialog, { open: !!deleteTarget, onOpenChange: () => setDeleteTarget(null), children: _jsxs(AlertDialogContent, { className: "sm:max-w-md", onOpenAutoFocus: (e) => {
361
- e.preventDefault();
362
- deleteButtonRef.current?.focus();
363
- }, children: [_jsxs(AlertDialogHeader, { children: [_jsxs(AlertDialogTitle, { children: [tHardcodedUi.raw('i18nComplete.texte2d0a54968ea'), ' ', deleteTarget?.type === 'directory' ? 'folder' : 'file'] }), _jsxs(AlertDialogDescription, { children: [tHardcodedUi.raw('featuresProjectFilesComponentsFileExplorerPage.line806JsxTextAreYouSureYouWantToDelete'), ' ', _jsxs("span", { className: "text-foreground font-semibold", children: [tHardcodedUi.raw('featuresProjectFilesComponentsFileExplorerPage.line807JsxTextQuot'), deleteTarget?.name, tHardcodedUi.raw('featuresProjectFilesComponentsFileExplorerPage.line807JsxTextQuot32c14d98')] }), tHardcodedUi.raw('featuresProjectFilesComponentsFileExplorerPage.line807JsxTextThisActionCannotBeUndone')] })] }), _jsxs(AlertDialogFooter, { children: [_jsx(AlertDialogCancel, { disabled: deleteMutation.isPending, children: tHardcodedUi.raw('i18nComplete.text19766ed6ccb2') }), _jsx(AlertDialogAction, { ref: deleteButtonRef, onClick: (e) => {
364
- e.preventDefault();
365
- confirmDelete();
366
- }, disabled: deleteMutation.isPending, className: "bg-destructive hover:bg-destructive/90 text-white", children: deleteMutation.isPending ? 'Deleting...' : 'Delete' })] })] }) })] }));
169
+ : tHardcodedUi.raw('i18nComplete.text27c2ccd962c2'), action: _jsx(Button, { variant: "outline", size: "sm", onClick: () => refetchFiles(), children: tHardcodedUi.raw('i18nComplete.text942087cc2d41') }) })), isEmpty && (_jsx(EmptyState, { icon: FolderOpen, title: tHardcodedUi.raw('featuresProjectFilesComponentsDriveListView.line396JsxTextThisFolderIsEmpty'), description: tHardcodedUi.raw('featuresProjectFilesComponentsDriveListView.line398JsxTextNoFilesOrSubfoldersAtThisPathIn') })), !isLoading && !error && files && !isEmpty && (_jsxs(_Fragment, { children: [viewMode === 'grid' ? (_jsx(DriveGridView, { dirs: dirs, files: fileItems, onNavigateToDir: handleNavigateToDir, onOpenFile: handleOpenFile, onPreviewFile: handlePreviewFile, onDownload: handleDownload, onDownloadDir: handleDownloadDir, onHistory: handleHistory, gitStatusMap: gitStatusMap, isDirDownloading: isDirDownloading })) : (_jsx(DriveListView, { dirs: dirs, files: fileItems, sortDisabled: partial, onNavigateToDir: handleNavigateToDir, onOpenFile: handleOpenFile, onPreviewFile: handlePreviewFile, onDownload: handleDownload, onDownloadDir: handleDownloadDir, onHistory: handleHistory, gitStatusMap: gitStatusMap, isDirDownloading: isDirDownloading })), _jsx(LoadMoreRow, { listing: listing })] }))] }), _jsx(CheckpointsPanel, { open: rightPanel === 'history', onClose: () => setRightPanel(null) }), _jsx(ChangeRequestsPanel, { open: rightPanel === 'proposed-changes', onClose: () => setRightPanel(null) })] }), _jsx(ChangeRequestDetailDialog, { crId: createdCrId, onClose: () => setCreatedCrId(null), onOpenChangeRequest: setCreatedCrId }), _jsx(ExplorerFilePreview, {}), searchEnabled && isSearchOpen && _jsx(FileSearch, {}), historyPopoverPath && (_jsx("div", { className: "bg-popover border-border animate-in slide-in-from-bottom-4 fade-in-0 fixed right-4 bottom-4 z-50 overflow-hidden rounded-md border shadow-2xl duration-200", children: _jsx(FileHistoryPopoverContent, { filePath: historyPopoverPath, onClose: () => setHistoryPopoverPath(null) }) }))] }));
367
170
  }
@@ -7,6 +7,8 @@ import { cn } from '../../../lib/utils.js';
7
7
  import { chalkColors } from '../../../_vendor/kortix-shared.js';
8
8
  import { useCallback, useRef, useState } from 'react';
9
9
  import { FileContentRenderer, getFileCategory } from './file-content-renderer.js';
10
+ import { FileAnnotationsProvider } from '../../viewer/file-annotations.js';
11
+ const noAnnotations = () => [];
10
12
  /** How far outside the viewport a card mounts its live preview. */
11
13
  export const THUMBNAIL_NEAR_MARGIN = '400px';
12
14
  /**
@@ -74,7 +76,7 @@ export function FileThumbnail({ filePath, fileName, className, deferPreview, onO
74
76
  transform: `scale(${THUMB_SCALE})`,
75
77
  width: VIRTUAL_PCT,
76
78
  height: VIRTUAL_PCT,
77
- }, "aria-hidden": true, children: _jsx(FileContentRenderer, { filePath: filePath, readOnly: true, showHeader: false, imageControls: "none" }) }), extBadge, onOpen && (extLower === 'md' || extLower === 'mdx') && (_jsx("button", { type: "button", onClick: (event) => {
79
+ }, "aria-hidden": true, children: _jsx(FileAnnotationsProvider, { diagnosticsFor: noAnnotations, children: _jsx(FileContentRenderer, { filePath: filePath, readOnly: true, showHeader: false, imageControls: "none" }) }) }), extBadge, onOpen && (extLower === 'md' || extLower === 'mdx') && (_jsx("button", { type: "button", onClick: (event) => {
78
80
  event.stopPropagation();
79
81
  onOpen();
80
82
  }, className: "bg-popover text-muted-foreground hover:text-foreground absolute bottom-2 left-2 rounded-sm px-2 py-1 text-xs font-medium focus-visible:ring-2 focus-visible:outline-none", children: t.raw('textf5c9bd131486') }))] }));