@vertesia/ui 0.79.0 → 0.80.0-dev-20251118

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 (296) hide show
  1. package/lib/esm/core/components/Panel.js +8 -0
  2. package/lib/esm/core/components/Panel.js.map +1 -0
  3. package/lib/esm/core/components/SelectBox.js +1 -1
  4. package/lib/esm/core/components/SelectBox.js.map +1 -1
  5. package/lib/esm/core/components/SidePanel.js +2 -2
  6. package/lib/esm/core/components/SidePanel.js.map +1 -1
  7. package/lib/esm/core/components/index.js +1 -1
  8. package/lib/esm/core/components/index.js.map +1 -1
  9. package/lib/esm/core/components/shadcn/breadcrumb.js +29 -8
  10. package/lib/esm/core/components/shadcn/breadcrumb.js.map +1 -1
  11. package/lib/esm/core/components/shadcn/button.js +3 -2
  12. package/lib/esm/core/components/shadcn/button.js.map +1 -1
  13. package/lib/esm/core/components/shadcn/filters/filterBar.js +2 -2
  14. package/lib/esm/core/components/shadcn/filters/filterBar.js.map +1 -1
  15. package/lib/esm/core/components/shadcn/index.js +1 -0
  16. package/lib/esm/core/components/shadcn/index.js.map +1 -1
  17. package/lib/esm/core/components/shadcn/input.js +4 -1
  18. package/lib/esm/core/components/shadcn/input.js.map +1 -1
  19. package/lib/esm/core/components/shadcn/resizeable.js +2 -2
  20. package/lib/esm/core/components/shadcn/resizeable.js.map +1 -1
  21. package/lib/esm/core/components/shadcn/selectBox.js +15 -9
  22. package/lib/esm/core/components/shadcn/selectBox.js.map +1 -1
  23. package/lib/esm/core/components/shadcn/tabs.js +10 -3
  24. package/lib/esm/core/components/shadcn/tabs.js.map +1 -1
  25. package/lib/esm/core/components/shadcn/textarea.js +7 -0
  26. package/lib/esm/core/components/shadcn/textarea.js.map +1 -0
  27. package/lib/esm/core/hooks/CompositeState.js +139 -1
  28. package/lib/esm/core/hooks/CompositeState.js.map +1 -1
  29. package/lib/esm/core/hooks/index.js +1 -0
  30. package/lib/esm/core/hooks/index.js.map +1 -1
  31. package/lib/esm/core/hooks/useScrollableSearch.js +92 -0
  32. package/lib/esm/core/hooks/useScrollableSearch.js.map +1 -0
  33. package/lib/esm/env/index.js +1 -1
  34. package/lib/esm/env/index.js.map +1 -1
  35. package/lib/esm/features/agent/PayloadBuilder.js +80 -55
  36. package/lib/esm/features/agent/PayloadBuilder.js.map +1 -1
  37. package/lib/esm/features/agent/chat/ModernAgentConversation.js +22 -24
  38. package/lib/esm/features/agent/chat/ModernAgentConversation.js.map +1 -1
  39. package/lib/esm/features/agent/chat/ModernAgentOutput/AllMessagesMixed.js +2 -3
  40. package/lib/esm/features/agent/chat/ModernAgentOutput/AllMessagesMixed.js.map +1 -1
  41. package/lib/esm/features/agent/chat/ModernAgentOutput/Header.js +2 -2
  42. package/lib/esm/features/agent/chat/ModernAgentOutput/Header.js.map +1 -1
  43. package/lib/esm/features/agent/chat/ModernAgentOutput/InlineSlidingPlanPanel.js +15 -20
  44. package/lib/esm/features/agent/chat/ModernAgentOutput/InlineSlidingPlanPanel.js.map +1 -1
  45. package/lib/esm/features/agent/chat/ModernAgentOutput/PlanPanel.js +1 -0
  46. package/lib/esm/features/agent/chat/ModernAgentOutput/PlanPanel.js.map +1 -1
  47. package/lib/esm/features/agent/chat/ModernAgentOutput/SlidingPlanPanel.js +3 -3
  48. package/lib/esm/features/agent/chat/ModernAgentOutput/SlidingPlanPanel.js.map +1 -1
  49. package/lib/esm/features/agent/chat/ModernAgentOutput/WorkstreamTabs.js +6 -6
  50. package/lib/esm/features/agent/chat/ModernAgentOutput/WorkstreamTabs.js.map +1 -1
  51. package/lib/esm/features/facets/CollectionsFacetsNav.js +19 -0
  52. package/lib/esm/features/facets/CollectionsFacetsNav.js.map +1 -1
  53. package/lib/esm/features/facets/InteractionsFacetsNav.js +9 -3
  54. package/lib/esm/features/facets/InteractionsFacetsNav.js.map +1 -1
  55. package/lib/esm/features/facets/utils/VTypeFacet.js +4 -1
  56. package/lib/esm/features/facets/utils/VTypeFacet.js.map +1 -1
  57. package/lib/esm/features/layout/GenericPageNavHeader.js +58 -5
  58. package/lib/esm/features/layout/GenericPageNavHeader.js.map +1 -1
  59. package/lib/esm/features/store/collections/BrowseCollectionView.js +3 -0
  60. package/lib/esm/features/store/collections/BrowseCollectionView.js.map +1 -1
  61. package/lib/esm/features/store/collections/CreateCollection.js +2 -2
  62. package/lib/esm/features/store/collections/CreateCollection.js.map +1 -1
  63. package/lib/esm/features/store/collections/EditCollectionView.js +29 -30
  64. package/lib/esm/features/store/collections/EditCollectionView.js.map +1 -1
  65. package/lib/esm/features/store/collections/SelectCollection.js +46 -45
  66. package/lib/esm/features/store/collections/SelectCollection.js.map +1 -1
  67. package/lib/esm/features/store/objects/DocumentSearchResults.js +35 -9
  68. package/lib/esm/features/store/objects/DocumentSearchResults.js.map +1 -1
  69. package/lib/esm/features/store/objects/DocumentTable.js +6 -6
  70. package/lib/esm/features/store/objects/DocumentTable.js.map +1 -1
  71. package/lib/esm/features/store/objects/components/ContentOverview.js +158 -114
  72. package/lib/esm/features/store/objects/components/ContentOverview.js.map +1 -1
  73. package/lib/esm/features/store/objects/components/DocumentIcon.js +5 -3
  74. package/lib/esm/features/store/objects/components/DocumentIcon.js.map +1 -1
  75. package/lib/esm/features/store/objects/components/SaveVersionConfirmModal.js +11 -2
  76. package/lib/esm/features/store/objects/components/SaveVersionConfirmModal.js.map +1 -1
  77. package/lib/esm/features/store/objects/components/useDownloadObject.js +2 -2
  78. package/lib/esm/features/store/objects/components/useDownloadObject.js.map +1 -1
  79. package/lib/esm/features/store/objects/layout/DocumentTableColumn.js +13 -1
  80. package/lib/esm/features/store/objects/layout/DocumentTableColumn.js.map +1 -1
  81. package/lib/esm/features/store/objects/layout/documentLayout.js +5 -5
  82. package/lib/esm/features/store/objects/layout/documentLayout.js.map +1 -1
  83. package/lib/esm/features/store/objects/layout/renderers.js +28 -12
  84. package/lib/esm/features/store/objects/layout/renderers.js.map +1 -1
  85. package/lib/esm/features/store/objects/search/DocumentSearchContext.js +5 -1
  86. package/lib/esm/features/store/objects/search/DocumentSearchContext.js.map +1 -1
  87. package/lib/esm/features/store/objects/search/DocumentSearchProvider.js +1 -1
  88. package/lib/esm/features/store/objects/search/DocumentSearchProvider.js.map +1 -1
  89. package/lib/esm/features/store/objects/selection/ObjectsActionContext.js +3 -2
  90. package/lib/esm/features/store/objects/selection/ObjectsActionContext.js.map +1 -1
  91. package/lib/esm/features/store/objects/selection/SelectionActions.js +2 -0
  92. package/lib/esm/features/store/objects/selection/SelectionActions.js.map +1 -1
  93. package/lib/esm/features/store/objects/selection/actions/AddToCollectionAction.js +10 -2
  94. package/lib/esm/features/store/objects/selection/actions/AddToCollectionAction.js.map +1 -1
  95. package/lib/esm/features/store/objects/selection/actions/DeleteObjectsAction.js +20 -2
  96. package/lib/esm/features/store/objects/selection/actions/DeleteObjectsAction.js.map +1 -1
  97. package/lib/esm/features/store/objects/upload/DocumentUploadModal.js +15 -7
  98. package/lib/esm/features/store/objects/upload/DocumentUploadModal.js.map +1 -1
  99. package/lib/esm/features/store/types/CreateOrUpdateTypeModal.js +1 -1
  100. package/lib/esm/features/store/types/CreateOrUpdateTypeModal.js.map +1 -1
  101. package/lib/esm/features/user/UserInfo.js +2 -0
  102. package/lib/esm/features/user/UserInfo.js.map +1 -1
  103. package/lib/esm/router/HistoryNavigator.js +25 -2
  104. package/lib/esm/router/HistoryNavigator.js.map +1 -1
  105. package/lib/esm/router/Nav.js +3 -3
  106. package/lib/esm/router/Nav.js.map +1 -1
  107. package/lib/esm/session/UserSession.js +1 -0
  108. package/lib/esm/session/UserSession.js.map +1 -1
  109. package/lib/esm/session/UserSessionProvider.js +9 -2
  110. package/lib/esm/session/UserSessionProvider.js.map +1 -1
  111. package/lib/esm/session/auth/composable.js +66 -67
  112. package/lib/esm/session/auth/composable.js.map +1 -1
  113. package/lib/esm/widgets/form/Form.js +17 -30
  114. package/lib/esm/widgets/form/Form.js.map +1 -1
  115. package/lib/esm/widgets/form/FormContext.js +4 -2
  116. package/lib/esm/widgets/form/FormContext.js.map +1 -1
  117. package/lib/esm/widgets/form/ManagedObject.js +4 -0
  118. package/lib/esm/widgets/form/ManagedObject.js.map +1 -1
  119. package/lib/esm/widgets/form/fields.js +4 -3
  120. package/lib/esm/widgets/form/fields.js.map +1 -1
  121. package/lib/esm/widgets/form/inputs.js +2 -0
  122. package/lib/esm/widgets/form/inputs.js.map +1 -1
  123. package/lib/tsconfig.tsbuildinfo +1 -1
  124. package/lib/types/core/components/Panel.d.ts +11 -0
  125. package/lib/types/core/components/Panel.d.ts.map +1 -0
  126. package/lib/types/core/components/SidePanel.d.ts.map +1 -1
  127. package/lib/types/core/components/index.d.ts +1 -1
  128. package/lib/types/core/components/index.d.ts.map +1 -1
  129. package/lib/types/core/components/shadcn/breadcrumb.d.ts +3 -2
  130. package/lib/types/core/components/shadcn/breadcrumb.d.ts.map +1 -1
  131. package/lib/types/core/components/shadcn/button.d.ts.map +1 -1
  132. package/lib/types/core/components/shadcn/filters/filterBar.d.ts.map +1 -1
  133. package/lib/types/core/components/shadcn/index.d.ts +1 -0
  134. package/lib/types/core/components/shadcn/index.d.ts.map +1 -1
  135. package/lib/types/core/components/shadcn/input.d.ts.map +1 -1
  136. package/lib/types/core/components/shadcn/selectBox.d.ts +3 -2
  137. package/lib/types/core/components/shadcn/selectBox.d.ts.map +1 -1
  138. package/lib/types/core/components/shadcn/tabs.d.ts.map +1 -1
  139. package/lib/types/core/components/shadcn/textarea.d.ts +4 -0
  140. package/lib/types/core/components/shadcn/textarea.d.ts.map +1 -0
  141. package/lib/types/core/hooks/CompositeState.d.ts +115 -6
  142. package/lib/types/core/hooks/CompositeState.d.ts.map +1 -1
  143. package/lib/types/core/hooks/index.d.ts +1 -0
  144. package/lib/types/core/hooks/index.d.ts.map +1 -1
  145. package/lib/types/core/hooks/useScrollableSearch.d.ts +82 -0
  146. package/lib/types/core/hooks/useScrollableSearch.d.ts.map +1 -0
  147. package/lib/types/env/index.d.ts +3 -1
  148. package/lib/types/env/index.d.ts.map +1 -1
  149. package/lib/types/features/agent/PayloadBuilder.d.ts +11 -19
  150. package/lib/types/features/agent/PayloadBuilder.d.ts.map +1 -1
  151. package/lib/types/features/agent/chat/ModernAgentConversation.d.ts.map +1 -1
  152. package/lib/types/features/agent/chat/ModernAgentOutput/AllMessagesMixed.d.ts +1 -1
  153. package/lib/types/features/agent/chat/ModernAgentOutput/AllMessagesMixed.d.ts.map +1 -1
  154. package/lib/types/features/agent/chat/ModernAgentOutput/Header.d.ts.map +1 -1
  155. package/lib/types/features/agent/chat/ModernAgentOutput/InlineSlidingPlanPanel.d.ts.map +1 -1
  156. package/lib/types/features/agent/chat/ModernAgentOutput/PlanPanel.d.ts.map +1 -1
  157. package/lib/types/features/facets/CollectionsFacetsNav.d.ts.map +1 -1
  158. package/lib/types/features/facets/InteractionsFacetsNav.d.ts +1 -0
  159. package/lib/types/features/facets/InteractionsFacetsNav.d.ts.map +1 -1
  160. package/lib/types/features/facets/utils/SearchInterface.d.ts +6 -1
  161. package/lib/types/features/facets/utils/SearchInterface.d.ts.map +1 -1
  162. package/lib/types/features/facets/utils/VTypeFacet.d.ts +2 -1
  163. package/lib/types/features/facets/utils/VTypeFacet.d.ts.map +1 -1
  164. package/lib/types/features/layout/GenericPageNavHeader.d.ts +2 -1
  165. package/lib/types/features/layout/GenericPageNavHeader.d.ts.map +1 -1
  166. package/lib/types/features/store/collections/BrowseCollectionView.d.ts.map +1 -1
  167. package/lib/types/features/store/collections/CreateCollection.d.ts.map +1 -1
  168. package/lib/types/features/store/collections/EditCollectionView.d.ts.map +1 -1
  169. package/lib/types/features/store/collections/SelectCollection.d.ts +6 -4
  170. package/lib/types/features/store/collections/SelectCollection.d.ts.map +1 -1
  171. package/lib/types/features/store/objects/DocumentSearchResults.d.ts.map +1 -1
  172. package/lib/types/features/store/objects/DocumentTable.d.ts +4 -0
  173. package/lib/types/features/store/objects/DocumentTable.d.ts.map +1 -1
  174. package/lib/types/features/store/objects/components/ContentOverview.d.ts.map +1 -1
  175. package/lib/types/features/store/objects/components/DocumentIcon.d.ts +3 -1
  176. package/lib/types/features/store/objects/components/DocumentIcon.d.ts.map +1 -1
  177. package/lib/types/features/store/objects/components/SaveVersionConfirmModal.d.ts.map +1 -1
  178. package/lib/types/features/store/objects/components/useDownloadObject.d.ts +1 -1
  179. package/lib/types/features/store/objects/components/useDownloadObject.d.ts.map +1 -1
  180. package/lib/types/features/store/objects/layout/DocumentTableColumn.d.ts +2 -1
  181. package/lib/types/features/store/objects/layout/DocumentTableColumn.d.ts.map +1 -1
  182. package/lib/types/features/store/objects/layout/documentLayout.d.ts +4 -2
  183. package/lib/types/features/store/objects/layout/documentLayout.d.ts.map +1 -1
  184. package/lib/types/features/store/objects/layout/renderers.d.ts +1 -1
  185. package/lib/types/features/store/objects/layout/renderers.d.ts.map +1 -1
  186. package/lib/types/features/store/objects/search/DocumentSearchContext.d.ts +1 -0
  187. package/lib/types/features/store/objects/search/DocumentSearchContext.d.ts.map +1 -1
  188. package/lib/types/features/store/objects/selection/ObjectsActionContext.d.ts.map +1 -1
  189. package/lib/types/features/store/objects/selection/SelectionActions.d.ts.map +1 -1
  190. package/lib/types/features/store/objects/selection/actions/DeleteObjectsAction.d.ts +1 -0
  191. package/lib/types/features/store/objects/selection/actions/DeleteObjectsAction.d.ts.map +1 -1
  192. package/lib/types/features/store/objects/upload/DocumentUploadModal.d.ts.map +1 -1
  193. package/lib/types/features/user/UserInfo.d.ts.map +1 -1
  194. package/lib/types/router/HistoryNavigator.d.ts.map +1 -1
  195. package/lib/types/router/Nav.d.ts +2 -1
  196. package/lib/types/router/Nav.d.ts.map +1 -1
  197. package/lib/types/session/UserSession.d.ts.map +1 -1
  198. package/lib/types/session/UserSessionProvider.d.ts.map +1 -1
  199. package/lib/types/session/auth/composable.d.ts.map +1 -1
  200. package/lib/types/widgets/form/Form.d.ts +2 -1
  201. package/lib/types/widgets/form/Form.d.ts.map +1 -1
  202. package/lib/types/widgets/form/FormContext.d.ts +5 -2
  203. package/lib/types/widgets/form/FormContext.d.ts.map +1 -1
  204. package/lib/types/widgets/form/ManagedObject.d.ts.map +1 -1
  205. package/lib/types/widgets/form/fields.d.ts +2 -2
  206. package/lib/types/widgets/form/fields.d.ts.map +1 -1
  207. package/lib/types/widgets/form/inputs.d.ts.map +1 -1
  208. package/lib/vertesia-ui-core.js +1 -1
  209. package/lib/vertesia-ui-core.js.map +1 -1
  210. package/lib/vertesia-ui-env.js +1 -1
  211. package/lib/vertesia-ui-env.js.map +1 -1
  212. package/lib/vertesia-ui-features.js +1 -1
  213. package/lib/vertesia-ui-features.js.map +1 -1
  214. package/lib/vertesia-ui-router.js +1 -1
  215. package/lib/vertesia-ui-router.js.map +1 -1
  216. package/lib/vertesia-ui-session.js +1 -1
  217. package/lib/vertesia-ui-session.js.map +1 -1
  218. package/lib/vertesia-ui-shell.js.map +1 -1
  219. package/lib/vertesia-ui-widgets.js +1 -1
  220. package/lib/vertesia-ui-widgets.js.map +1 -1
  221. package/package.json +170 -165
  222. package/src/core/components/Panel.tsx +34 -0
  223. package/src/core/components/SelectBox.tsx +1 -1
  224. package/src/core/components/SidePanel.tsx +5 -3
  225. package/src/core/components/TagsInput.tsx +388 -0
  226. package/src/core/components/index.ts +2 -1
  227. package/src/core/components/shadcn/breadcrumb.tsx +49 -30
  228. package/src/core/components/shadcn/button.tsx +3 -2
  229. package/src/core/components/shadcn/filters/filterBar.tsx +3 -3
  230. package/src/core/components/shadcn/index.ts +2 -1
  231. package/src/core/components/shadcn/input.tsx +10 -7
  232. package/src/core/components/shadcn/popover.tsx +2 -2
  233. package/src/core/components/shadcn/resizeable.tsx +4 -4
  234. package/src/core/components/shadcn/selectBox.tsx +87 -67
  235. package/src/core/components/shadcn/tabs.tsx +10 -3
  236. package/src/core/components/shadcn/textarea.tsx +21 -0
  237. package/src/core/hooks/CompositeState.tsx +156 -6
  238. package/src/core/hooks/index.ts +1 -0
  239. package/src/core/hooks/useScrollableSearch.tsx +193 -0
  240. package/src/env/index.ts +4 -3
  241. package/src/features/agent/PayloadBuilder.tsx +92 -65
  242. package/src/features/agent/chat/ModernAgentConversation.tsx +109 -118
  243. package/src/features/agent/chat/ModernAgentOutput/AllMessagesMixed.tsx +3 -23
  244. package/src/features/agent/chat/ModernAgentOutput/Header.tsx +3 -11
  245. package/src/features/agent/chat/ModernAgentOutput/InlineSlidingPlanPanel.tsx +39 -55
  246. package/src/features/agent/chat/ModernAgentOutput/PlanPanel.tsx +1 -0
  247. package/src/features/agent/chat/ModernAgentOutput/SlidingPlanPanel.tsx +8 -8
  248. package/src/features/agent/chat/ModernAgentOutput/WorkstreamTabs.tsx +9 -9
  249. package/src/features/facets/CollectionsFacetsNav.tsx +21 -0
  250. package/src/features/facets/InteractionsFacetsNav.tsx +13 -3
  251. package/src/features/facets/utils/SearchInterface.tsx +5 -1
  252. package/src/features/facets/utils/VTypeFacet.tsx +6 -2
  253. package/src/features/layout/GenericPageNavHeader.tsx +73 -10
  254. package/src/features/store/collections/BrowseCollectionView.tsx +4 -0
  255. package/src/features/store/collections/CreateCollection.tsx +3 -4
  256. package/src/features/store/collections/EditCollectionView.tsx +112 -85
  257. package/src/features/store/collections/SelectCollection.tsx +105 -49
  258. package/src/features/store/collections/SharedPropsEditor.tsx +61 -0
  259. package/src/features/store/collections/SyncMemberHeadsToggle.tsx +48 -0
  260. package/src/features/store/collections/index.ts +3 -1
  261. package/src/features/store/objects/DocumentSearchResults.tsx +128 -53
  262. package/src/features/store/objects/DocumentTable.tsx +14 -4
  263. package/src/features/store/objects/components/ContentOverview.tsx +208 -110
  264. package/src/features/store/objects/components/DocumentIcon.tsx +11 -12
  265. package/src/features/store/objects/components/SaveVersionConfirmModal.tsx +12 -2
  266. package/src/features/store/objects/components/useDownloadObject.ts +7 -2
  267. package/src/features/store/objects/layout/DocumentTableColumn.tsx +16 -1
  268. package/src/features/store/objects/layout/documentLayout.tsx +7 -5
  269. package/src/features/store/objects/layout/knowledge.md +10 -10
  270. package/src/features/store/objects/layout/renderers.tsx +39 -18
  271. package/src/features/store/objects/search/DocumentSearchContext.ts +6 -1
  272. package/src/features/store/objects/search/DocumentSearchProvider.tsx +1 -1
  273. package/src/features/store/objects/selection/ObjectsActionContext.tsx +3 -2
  274. package/src/features/store/objects/selection/SelectionActions.tsx +2 -0
  275. package/src/features/store/objects/selection/actions/AddToCollectionAction.tsx +8 -2
  276. package/src/features/store/objects/selection/actions/DeleteObjectsAction.tsx +22 -2
  277. package/src/features/store/objects/upload/DocumentUploadModal.tsx +18 -9
  278. package/src/features/store/objects/upload/useSmartFileUploadProcessing.ts +10 -7
  279. package/src/features/store/types/CreateOrUpdateTypeModal.tsx +1 -1
  280. package/src/features/user/UserInfo.tsx +2 -0
  281. package/src/router/HistoryNavigator.ts +33 -2
  282. package/src/router/Nav.tsx +4 -3
  283. package/src/session/UserSession.ts +1 -0
  284. package/src/session/UserSessionProvider.tsx +10 -2
  285. package/src/session/auth/composable.ts +71 -70
  286. package/src/shell/apps/AppProjectSelector.tsx +2 -2
  287. package/src/widgets/form/Form.tsx +19 -43
  288. package/src/widgets/form/FormContext.ts +5 -2
  289. package/src/widgets/form/ManagedObject.ts +4 -0
  290. package/src/widgets/form/fields.tsx +8 -6
  291. package/src/widgets/form/inputs.tsx +1 -0
  292. package/lib/esm/core/components/Textarea.js +0 -15
  293. package/lib/esm/core/components/Textarea.js.map +0 -1
  294. package/lib/types/core/components/Textarea.d.ts +0 -8
  295. package/lib/types/core/components/Textarea.d.ts.map +0 -1
  296. package/src/core/components/Textarea.tsx +0 -25
@@ -32,95 +32,96 @@ export async function fetchComposableToken(getIdToken: () => Promise<string | nu
32
32
  throw new Error('No id token found');
33
33
  }
34
34
 
35
- console.log('Fetching composable token from ' + Env.endpoints.studio);
36
- Env.logger.info('Fetching composable token from' + Env.endpoints.studio, {
35
+ // Use STS endpoint - either configured or default to sts.vertesia.io
36
+ const stsEndpoint = Env.endpoints.sts;
37
+ console.log('Using STS for token generation:', stsEndpoint);
38
+ Env.logger.info('Using STS for token generation', {
37
39
  vertesia: {
38
40
  account_id: accountId,
39
41
  project_id: projectId,
42
+ sts_url: stsEndpoint,
40
43
  },
41
44
  });
42
45
 
43
- const url = new URL(Env.endpoints.studio + '/auth/token');
44
- if (accountId) url.searchParams.set('accountId', accountId);
45
- if (projectId) url.searchParams.set('projectId', projectId);
46
- if (ttl) url.searchParams.set('ttl', String(ttl));
47
-
48
- console.log(`Getting composable token for account ${accountId} and project ${projectId}`);
49
- Env.logger.info('Getting composable token', {
50
- vertesia: {
46
+ try {
47
+ // Call STS to generate a user token
48
+ const stsUrl = new URL(stsEndpoint + '/token/issue');
49
+ const requestBody = {
50
+ type: 'user',
51
51
  account_id: accountId,
52
52
  project_id: projectId,
53
- },
54
- });
55
-
56
- const res = await fetch(url, {
57
- method: 'GET',
58
- headers: {
59
- 'Content-Type': 'application/json',
60
- 'Authorization': `Bearer ${idToken}`
61
- }
62
- }).catch(err => {
63
- localStorage.removeItem(LastSelectedAccountId_KEY);
64
- localStorage.removeItem(LastSelectedProjectId_KEY);
65
- console.error('Failed to get composable token', err);
66
- Env.logger.error('Failed to get composable token', {
67
- vertesia: {
68
- account_id: accountId,
69
- project_id: projectId,
70
- error: err,
53
+ expires_at: ttl ? Math.floor(Date.now() / 1000) + ttl : undefined,
54
+ };
55
+
56
+ const stsRes = await fetch(stsUrl, {
57
+ method: 'POST',
58
+ headers: {
59
+ 'Content-Type': 'application/json',
60
+ 'Authorization': `Bearer ${idToken}` // Firebase token for authentication
71
61
  },
62
+ body: JSON.stringify(requestBody)
72
63
  });
73
- throw new Error('Failed to get composable token');
74
- });
75
64
 
76
- if (idToken && res?.status === 412) {
77
- console.log("412: auth succeeded but user doesn't exist - signup required", res?.status);
78
- Env.logger.error("412: auth succeeded but user doesn't exist - signup required", {
79
- vertesia: {
80
- account_id: accountId,
81
- project_id: projectId,
82
- status: res?.status
83
- },
84
- });
85
- const idTokenDecoded = jwtDecode(idToken) as any;
86
- if (!idTokenDecoded?.email) {
87
- Env.logger.error('No email found in id token');
88
- throw new Error('No email found in id token');
89
- }
90
- Env.logger.error('User not found', {
91
- vertesia: {
92
- account_id: accountId,
93
- project_id: projectId,
94
- email: idTokenDecoded.email
65
+ if (idToken && stsRes?.status === 412) {
66
+ console.log("412: auth succeeded but user doesn't exist - signup required", stsRes?.status);
67
+ Env.logger.error("412: auth succeeded but user doesn't exist - signup required", {
68
+ vertesia: {
69
+ account_id: accountId,
70
+ project_id: projectId,
71
+ status: stsRes?.status
72
+ },
73
+ });
74
+ const idTokenDecoded = jwtDecode(idToken) as any;
75
+ if (!idTokenDecoded?.email) {
76
+ Env.logger.error('No email found in id token');
77
+ throw new Error('No email found in id token');
95
78
  }
96
- });
97
- throw new UserNotFoundError('User not found', idTokenDecoded.email);
98
- }
79
+ Env.logger.error('User not found', {
80
+ vertesia: {
81
+ account_id: accountId,
82
+ project_id: projectId,
83
+ email: idTokenDecoded.email
84
+ }
85
+ });
86
+ throw new UserNotFoundError('User not found', idTokenDecoded.email);
87
+ }
88
+
89
+ if (!stsRes.ok) {
90
+ const errorText = await stsRes.text();
91
+ console.error('STS token generation failed:', stsRes.status, errorText);
92
+ Env.logger.error('STS token generation failed', {
93
+ vertesia: {
94
+ status: stsRes.status,
95
+ error: errorText,
96
+ account_id: accountId,
97
+ project_id: projectId,
98
+ },
99
+ });
100
+ throw new Error(`Failed to get token from STS: ${stsRes.status}`);
101
+ }
102
+
103
+ const { token } = await stsRes.json();
104
+ console.log('Successfully got token from STS');
105
+ Env.logger.info('Successfully got token from STS');
106
+ return token;
99
107
 
100
- if (!res || !res.ok) {
101
- console.error('Failed to get composable token', res);
102
- Env.logger.error('Failed to get composable token', {
108
+ } catch (error) {
109
+ if (error instanceof UserNotFoundError) {
110
+ throw error; // Re-throw UserNotFoundError
111
+ }
112
+
113
+ localStorage.removeItem(LastSelectedAccountId_KEY);
114
+ localStorage.removeItem(LastSelectedProjectId_KEY);
115
+ console.error('Failed to get composable token from STS', error);
116
+ Env.logger.error('Failed to get composable token from STS', {
103
117
  vertesia: {
104
118
  account_id: accountId,
105
119
  project_id: projectId,
106
- status: res?.status,
120
+ error: error,
107
121
  },
108
122
  });
109
123
  throw new Error('Failed to get composable token');
110
124
  }
111
-
112
- const { token } = await res.json().catch(err => {
113
- Env.logger.error('Failed to parse composable token', {
114
- vertesia: {
115
- account_id: accountId,
116
- project_id: projectId,
117
- error: err,
118
- },
119
- });
120
- console.error('Failed to parse composable token', err);
121
- });
122
-
123
- return token;
124
125
  }
125
126
 
126
127
  /**
@@ -187,4 +188,4 @@ export class UserNotFoundError extends Error {
187
188
  this.name = 'UserNotFoundError';
188
189
  this.email = email;
189
190
  }
190
- }
191
+ }
@@ -1,5 +1,5 @@
1
1
  import { ProjectRef, RequireAtLeastOne } from "@vertesia/common";
2
- import { SelectBox, useFetch } from "@vertesia/ui/core";
2
+ import { VSelectBox, useFetch } from "@vertesia/ui/core";
3
3
  import { LastSelectedAccountId_KEY, LastSelectedProjectId_KEY, useUserSession } from "@vertesia/ui/session";
4
4
  import { useState } from "react";
5
5
 
@@ -47,7 +47,7 @@ function SelectProject({ initialValue, projects, onChange, placeholder = "Select
47
47
  }
48
48
  let actualValue = !value && initialValue ? projects.find(p => p.id === initialValue) : value;
49
49
  return (
50
- <SelectBox
50
+ <VSelectBox
51
51
  by="id"
52
52
  value={actualValue}
53
53
  options={projects}
@@ -1,25 +1,22 @@
1
1
 
2
2
  import { Plus, Trash2 } from "lucide-react";
3
- import { Button } from "@vertesia/ui/core";
3
+ import { Button, FormItem } from "@vertesia/ui/core";
4
4
  import clsx from "clsx";
5
5
  import type { JSONSchemaObject } from "@vertesia/common";
6
6
  import { ComponentType, ReactNode, SyntheticEvent, useState } from "react";
7
- import { FormContextProvider, InputComponentProps, useForm } from "./FormContext.js";
7
+ import { FormContext, FormContextProvider, InputComponentProps, useForm } from "./FormContext.js";
8
8
  import { ManagedListProperty, ManagedObject, ManagedObjectBase, ManagedProperty, Node } from "./ManagedObject.js";
9
- import { FormLabel, FormHelper } from "./fields.js";
10
9
  import { Input } from "./inputs.js";
11
10
 
12
-
13
-
14
-
15
11
  interface FormProps {
16
12
  object: ManagedObject;
17
13
  components?: Record<string, ComponentType<InputComponentProps>>;
18
14
  children?: ReactNode | ReactNode[];
19
15
  onSubmit?: (data: JSONSchemaObject) => void;
20
16
  onChange?: (prop: Node) => void;
17
+ disabled?: boolean;
21
18
  }
22
- export function Form({ object, components, onSubmit, children, onChange }: FormProps) {
19
+ export function Form({ object, components, onSubmit, children, onChange, disabled }: FormProps) {
23
20
  const _onSubmit = (evt: SyntheticEvent) => {
24
21
  evt.stopPropagation();
25
22
  evt.preventDefault();
@@ -27,10 +24,7 @@ export function Form({ object, components, onSubmit, children, onChange }: FormP
27
24
  }
28
25
  object.observer = onChange;
29
26
  return (
30
- <FormContextProvider value={{
31
- object,
32
- components: components || {}
33
- }}>
27
+ <FormContextProvider value={new FormContext(object, components || {}, disabled ?? false)}>
34
28
  <form className="w-full" onSubmit={_onSubmit}>
35
29
  {children}
36
30
  </form>
@@ -58,24 +52,6 @@ export function GeneratedForm({ children, ...props }: FormProps) {
58
52
  )
59
53
  }
60
54
 
61
-
62
- // interface FieldSetProps {
63
- // name: string;
64
- // children?: ReactNode | ReactNode[];
65
- // }
66
- // export function FieldSet({ name, children }: FieldSetProps) {
67
- // const ctx = useForm();
68
- // const newCtx = {
69
- // ...ctx,
70
- // object: ctx.object.getProperty(name) as ManagedObjectProperty
71
- // }
72
- // return (
73
- // <FormContextProvider value={newCtx}>
74
- // {children}
75
- // </FormContextProvider>
76
- // )
77
- // }
78
-
79
55
  function renderProperty(prop: Node) {
80
56
  if (prop.isList) {
81
57
  return <ListField key={prop.name} object={prop as ManagedListProperty} />
@@ -105,7 +81,7 @@ export function ScalarField({ object, editor, inline = false }: ScalarFieldProps
105
81
  if (!editor) {
106
82
  editor = object.schema.editor;
107
83
  }
108
- const { components } = useForm();
84
+ const { components, disabled } = useForm();
109
85
  const Component = (editor && components[editor]) || Input;
110
86
  const inputType = object.getInputType();
111
87
  if (inputType === 'checkbox') {
@@ -113,20 +89,16 @@ export function ScalarField({ object, editor, inline = false }: ScalarFieldProps
113
89
  }
114
90
 
115
91
  const handleOnChange = (event: any) => {
92
+ if (disabled) return;
116
93
  const { value } = event.target;
117
94
  object.value = object.schema.isNumber ? parseFloat(value) : value
118
95
  }
119
96
 
120
97
  return (
121
- <div className="">
122
- <div className={clsx('flex gap-2', inline ? 'flex-row items-center' : 'flex-col')}>
123
- {!object.isListItem && <FormLabel required={object.schema.isRequired}>{object.title}</FormLabel>}
124
- <Component object={object} type={inputType} onChange={handleOnChange} />
125
- </div>
126
- {
127
- object.schema.description && <FormHelper>{object.schema.description}</FormHelper>
128
- }
129
- </div>
98
+ <FormItem label={object.title} required={object.schema.isRequired} description={object.schema.description}
99
+ className={clsx('flex', inline ? 'flex-row items-center' : 'flex-col')}>
100
+ {!object.isListItem && <Component object={object} type={inputType} onChange={handleOnChange} disabled={disabled} />}
101
+ </FormItem>
130
102
  )
131
103
  }
132
104
 
@@ -149,13 +121,16 @@ interface ListFieldProps {
149
121
  }
150
122
  function ListField({ object }: ListFieldProps) {
151
123
  const [value, setValue] = useState<any[]>(object.value || []);
124
+ const { disabled } = useForm();
152
125
 
153
126
  const addItem = () => {
127
+ if (disabled) return;
154
128
  object.add();
155
129
  setValue([...object.value]);
156
130
  };
157
131
 
158
132
  const deleteItem = (index: number) => {
133
+ if (disabled) return;
159
134
  object.remove(index);
160
135
  setValue([...object.value]);
161
136
  };
@@ -165,11 +140,11 @@ function ListField({ object }: ListFieldProps) {
165
140
  {!object.isListItem && <div className='text-gray-900 dark:text-gray-200 font-semibold'>{object.title}</div>}
166
141
  {
167
142
  object.items.map((item, index) => {
168
- return <ListItem key={`${index}-${value[index] ?? ''}`} object={item} list={object} onDelete={() => deleteItem(index)} />;
143
+ return <ListItem key={`${index}-${value[index] ?? ''}`} object={item} list={object} onDelete={() => deleteItem(index)} disabled={disabled} />;
169
144
  })
170
145
  }
171
146
  <div>
172
- <Button variant='secondary' onClick={addItem}><Plus className="size-6" /> Add</Button>
147
+ <Button variant='secondary' onClick={addItem} disabled={disabled}><Plus className="size-6" /> Add</Button>
173
148
  </div>
174
149
  </div>
175
150
  )
@@ -179,8 +154,9 @@ interface ListItemProps {
179
154
  list: ManagedListProperty;
180
155
  object: Node & { index: number };
181
156
  onDelete: () => void;
157
+ disabled?: boolean;
182
158
  }
183
- function ListItem({ list, object, onDelete }: ListItemProps) {
159
+ function ListItem({ list, object, onDelete, disabled }: ListItemProps) {
184
160
  return (
185
161
  <div className='flex gap-2 w-full'>
186
162
  <div className="flex-1">
@@ -188,7 +164,7 @@ function ListItem({ list, object, onDelete }: ListItemProps) {
188
164
  renderItemProperty(object, list.schema.arraySchema.editor)
189
165
  }
190
166
  </div>
191
- <Button variant='secondary' onClick={onDelete}><Trash2 className='size-4' /></Button>
167
+ <Button variant='secondary' onClick={onDelete} disabled={disabled}><Trash2 className='size-4' /></Button>
192
168
  </div>
193
169
  )
194
170
  }
@@ -15,10 +15,13 @@ export function useFieldSet() {
15
15
  export interface InputComponentProps {
16
16
  object: Node;
17
17
  type: string; // the editor/input type
18
+ onChange?: (event: any) => void;
19
+ disabled?: boolean;
18
20
  }
19
- class FormContext {
21
+ export class FormContext {
20
22
  constructor(public object: ManagedObject,
21
- public components: Record<string, ComponentType<InputComponentProps>> = {}) {
23
+ public components: Record<string, ComponentType<InputComponentProps>> = {},
24
+ public disabled: boolean = false) {
22
25
  }
23
26
 
24
27
  }
@@ -10,6 +10,10 @@ function getInputType(_name: string, schema: PropertySchema) {
10
10
  if (schema.editor) {
11
11
  return schema.editor;
12
12
  }
13
+ // Check format as fallback (e.g., "document", "media", "date", etc.)
14
+ if (schema.schema.format) {
15
+ return schema.schema.format;
16
+ }
13
17
  switch (schema.type) {
14
18
  case 'number':
15
19
  case 'integer':
@@ -1,14 +1,16 @@
1
+ import { FormItem } from "@vertesia/ui/core";
2
+
1
3
  interface FormLabelProps {
2
- htmlFor?: string;
4
+ label?: string;
3
5
  required?: boolean;
4
6
  children: React.ReactNode | React.ReactNode[];
5
7
  }
6
- export function FormLabel({ htmlFor, required, children }: FormLabelProps) {
8
+ export function FormLabel({ label, required, children }: FormLabelProps) {
7
9
  return (
8
- <label htmlFor={htmlFor} className="block text-sm font-medium leading-6 text-gray-900 dark:text-gray-200">
9
- {children}{required && <sup className="text-red-600">*</sup>}
10
- </label>
11
- )
10
+ <FormItem label={label} required={required}>
11
+ {children}
12
+ </FormItem>
13
+ );
12
14
  }
13
15
 
14
16
  interface FormHelperProps {
@@ -17,6 +17,7 @@ const Input = React.forwardRef<HTMLInputElement | HTMLTextAreaElement, InputProp
17
17
  }
18
18
 
19
19
  const _onChange = (ev: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {
20
+ if (props.disabled) return;
20
21
  setValue(ev.target.value);
21
22
  if (object.schema.isBoolean) {
22
23
  object.value = (ev.target as HTMLInputElement).checked;
@@ -1,15 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import clsx from "clsx";
3
- import React, { useState } from "react";
4
- import { Styles } from "./styles";
5
- const Textarea = React.forwardRef(({ unstyled, value, onChange, className, ...others }, ref) => {
6
- const [currentValue, setCurrentValue] = useState(value || "");
7
- const _onChange = (ev) => {
8
- const value = ev.target.value;
9
- setCurrentValue(value);
10
- onChange && onChange(value);
11
- };
12
- return (_jsx("textarea", { ref: ref, ...others, className: clsx('w-full', unstyled ? Styles.INPUT_UNSTYLED : Styles.INPUT, className), value: currentValue, onChange: _onChange }));
13
- });
14
- export { Textarea };
15
- //# sourceMappingURL=Textarea.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Textarea.js","sourceRoot":"","sources":["../../../../src/core/components/Textarea.tsx"],"names":[],"mappings":";AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAOlC,MAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,CAAqC,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,MAAM,EAAiB,EAAE,GAAG,EAAE,EAAE;IAC9I,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;IAC9D,MAAM,SAAS,GAAG,CAAC,EAA0C,EAAE,EAAE;QAC7D,MAAM,KAAK,GAAG,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC;QAC9B,eAAe,CAAC,KAAK,CAAC,CAAC;QACvB,QAAQ,IAAI,QAAQ,CAAC,KAAK,CAAC,CAAC;IAChC,CAAC,CAAA;IACD,OAAO,CACH,mBAAU,GAAG,EAAE,GAAG,KACV,MAAM,EACV,SAAS,EAAE,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,SAAS,CAAC,EACrF,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,SAAS,GAAI,CACnD,CAAA;AACL,CAAC,CAAC,CAAC;AAEH,OAAO,EAAE,QAAQ,EAAE,CAAA"}
@@ -1,8 +0,0 @@
1
- import React from "react";
2
- interface TextareaProps extends Omit<React.HTMLProps<HTMLTextAreaElement>, 'ref' | 'onChange'> {
3
- onChange: (value: string) => void;
4
- unstyled?: boolean;
5
- }
6
- declare const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
7
- export { Textarea };
8
- //# sourceMappingURL=Textarea.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Textarea.d.ts","sourceRoot":"","sources":["../../../../src/core/components/Textarea.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAGxC,UAAU,aAAc,SAAQ,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,mBAAmB,CAAC,EAAE,KAAK,GAAG,UAAU,CAAC;IAC1F,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,QAAA,MAAM,QAAQ,2FAaZ,CAAC;AAEH,OAAO,EAAE,QAAQ,EAAE,CAAA"}
@@ -1,25 +0,0 @@
1
- import clsx from "clsx";
2
- import React, { useState } from "react";
3
- import { Styles } from "./styles";
4
-
5
- interface TextareaProps extends Omit<React.HTMLProps<HTMLTextAreaElement>, 'ref' | 'onChange'> {
6
- onChange: (value: string) => void;
7
- unstyled?: boolean;
8
- }
9
-
10
- const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(({ unstyled, value, onChange, className, ...others }: TextareaProps, ref) => {
11
- const [currentValue, setCurrentValue] = useState(value || "");
12
- const _onChange = (ev: React.ChangeEvent<HTMLTextAreaElement>) => {
13
- const value = ev.target.value;
14
- setCurrentValue(value);
15
- onChange && onChange(value);
16
- }
17
- return (
18
- <textarea ref={ref}
19
- {...others}
20
- className={clsx('w-full', unstyled ? Styles.INPUT_UNSTYLED : Styles.INPUT, className)}
21
- value={currentValue} onChange={_onChange} />
22
- )
23
- });
24
-
25
- export { Textarea }