@vertesia/ui 0.65.0 → 0.66.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 (226) hide show
  1. package/lib/esm/core/components/EmptyCollection.js +2 -2
  2. package/lib/esm/core/components/EmptyCollection.js.map +1 -1
  3. package/lib/esm/core/components/InputList.js +2 -2
  4. package/lib/esm/core/components/InputList.js.map +1 -1
  5. package/lib/esm/core/components/SidePanel.js +1 -1
  6. package/lib/esm/core/components/SidePanel.js.map +1 -1
  7. package/lib/esm/core/components/Switch.js +2 -2
  8. package/lib/esm/core/components/Switch.js.map +1 -1
  9. package/lib/esm/core/components/shadcn/calendar.js +0 -1
  10. package/lib/esm/core/components/shadcn/calendar.js.map +1 -1
  11. package/lib/esm/core/components/shadcn/checkbox.js +0 -1
  12. package/lib/esm/core/components/shadcn/checkbox.js.map +1 -1
  13. package/lib/esm/core/components/shadcn/command.js +0 -1
  14. package/lib/esm/core/components/shadcn/command.js.map +1 -1
  15. package/lib/esm/core/components/shadcn/dialog.js +0 -1
  16. package/lib/esm/core/components/shadcn/dialog.js.map +1 -1
  17. package/lib/esm/core/components/shadcn/filters/comboBox.js +18 -0
  18. package/lib/esm/core/components/shadcn/filters/comboBox.js.map +1 -1
  19. package/lib/esm/core/components/shadcn/filters/filterBar.js +38 -17
  20. package/lib/esm/core/components/shadcn/filters/filterBar.js.map +1 -1
  21. package/lib/esm/core/components/shadcn/filters/filters.js +11 -5
  22. package/lib/esm/core/components/shadcn/filters/filters.js.map +1 -1
  23. package/lib/esm/core/components/shadcn/filters/selectFilter.js +1 -1
  24. package/lib/esm/core/components/shadcn/filters/selectFilter.js.map +1 -1
  25. package/lib/esm/core/components/shadcn/filters/stringListFilter.js +24 -0
  26. package/lib/esm/core/components/shadcn/filters/stringListFilter.js.map +1 -0
  27. package/lib/esm/core/components/shadcn/filters/textFilter.js +2 -1
  28. package/lib/esm/core/components/shadcn/filters/textFilter.js.map +1 -1
  29. package/lib/esm/core/components/shadcn/label.js +0 -1
  30. package/lib/esm/core/components/shadcn/label.js.map +1 -1
  31. package/lib/esm/features/agent/PayloadBuilder.js +27 -0
  32. package/lib/esm/features/agent/PayloadBuilder.js.map +1 -1
  33. package/lib/esm/features/agent/chat/ModernAgentOutput/MessageItem.js +2 -2
  34. package/lib/esm/features/agent/chat/ModernAgentOutput/MessageItem.js.map +1 -1
  35. package/lib/esm/features/facets/VEnvironmentFacet.js +24 -0
  36. package/lib/esm/features/facets/VEnvironmentFacet.js.map +1 -0
  37. package/lib/esm/features/facets/VFacetsNav.js +69 -26
  38. package/lib/esm/features/facets/VFacetsNav.js.map +1 -1
  39. package/lib/esm/features/facets/VInteractionFacet.js +45 -0
  40. package/lib/esm/features/facets/VInteractionFacet.js.map +1 -0
  41. package/lib/esm/features/facets/VStringFacet.js +6 -5
  42. package/lib/esm/features/facets/VStringFacet.js.map +1 -1
  43. package/lib/esm/features/facets/VUserFacet.js +6 -6
  44. package/lib/esm/features/facets/VUserFacet.js.map +1 -1
  45. package/lib/esm/features/layout/GenericPageNavHeader.js +1 -1
  46. package/lib/esm/features/magic-pdf/TextPageView.js +1 -2
  47. package/lib/esm/features/magic-pdf/TextPageView.js.map +1 -1
  48. package/lib/esm/features/store/collections/CollectionsTable.js +9 -5
  49. package/lib/esm/features/store/collections/CollectionsTable.js.map +1 -1
  50. package/lib/esm/features/store/collections/{CollectionsView.js → CreateCollection.js} +6 -14
  51. package/lib/esm/features/store/collections/CreateCollection.js.map +1 -0
  52. package/lib/esm/features/store/collections/EditCollectionView.js +1 -1
  53. package/lib/esm/features/store/collections/EditCollectionView.js.map +1 -1
  54. package/lib/esm/features/store/collections/SelectCollection.js +24 -0
  55. package/lib/esm/features/store/collections/SelectCollection.js.map +1 -0
  56. package/lib/esm/features/store/collections/index.js +2 -2
  57. package/lib/esm/features/store/collections/index.js.map +1 -1
  58. package/lib/esm/features/store/objects/DocumentSearchResults.js +6 -3
  59. package/lib/esm/features/store/objects/DocumentSearchResults.js.map +1 -1
  60. package/lib/esm/features/store/objects/components/ContentOverview.js +14 -14
  61. package/lib/esm/features/store/objects/components/ContentOverview.js.map +1 -1
  62. package/lib/esm/features/store/objects/components/DocumentIcon.js +7 -10
  63. package/lib/esm/features/store/objects/components/DocumentIcon.js.map +1 -1
  64. package/lib/esm/features/store/objects/components/DocumentInput.js +1 -2
  65. package/lib/esm/features/store/objects/components/DocumentInput.js.map +1 -1
  66. package/lib/esm/features/store/objects/components/PropertiesEditorModal.js +4 -2
  67. package/lib/esm/features/store/objects/components/PropertiesEditorModal.js.map +1 -1
  68. package/lib/esm/features/store/objects/components/SaveVersionConfirmModal.js +1 -2
  69. package/lib/esm/features/store/objects/components/SaveVersionConfirmModal.js.map +1 -1
  70. package/lib/esm/features/store/objects/components/SelectDocument.js +9 -3
  71. package/lib/esm/features/store/objects/components/SelectDocument.js.map +1 -1
  72. package/lib/esm/features/store/objects/components/SelectDocumentModal.js +2 -2
  73. package/lib/esm/features/store/objects/components/SelectDocumentModal.js.map +1 -1
  74. package/lib/esm/features/store/objects/layout/documentLayout.js +2 -2
  75. package/lib/esm/features/store/objects/layout/documentLayout.js.map +1 -1
  76. package/lib/esm/features/store/objects/search/DocumentSearchContext.js +4 -2
  77. package/lib/esm/features/store/objects/search/DocumentSearchContext.js.map +1 -1
  78. package/lib/esm/features/store/objects/selection/SelectionActions.js +1 -1
  79. package/lib/esm/features/store/objects/selection/SelectionActions.js.map +1 -1
  80. package/lib/esm/features/store/objects/selection/actions/AddToCollectionAction.js +7 -10
  81. package/lib/esm/features/store/objects/selection/actions/AddToCollectionAction.js.map +1 -1
  82. package/lib/esm/features/store/objects/selection/actions/ChangeTypeAction.js +1 -1
  83. package/lib/esm/features/store/objects/selection/actions/ChangeTypeAction.js.map +1 -1
  84. package/lib/esm/features/store/objects/selection/actions/DeleteObjectsAction.js +2 -2
  85. package/lib/esm/features/store/objects/selection/actions/DeleteObjectsAction.js.map +1 -1
  86. package/lib/esm/features/store/objects/selection/actions/ExportPropertiesAction.js +1 -1
  87. package/lib/esm/features/store/objects/selection/actions/ExportPropertiesAction.js.map +1 -1
  88. package/lib/esm/features/store/objects/selection/actions/RemoveFromCollectionAction.js +1 -1
  89. package/lib/esm/features/store/objects/selection/actions/RemoveFromCollectionAction.js.map +1 -1
  90. package/lib/esm/features/store/types/ContentObjectTypesSearch.js +2 -3
  91. package/lib/esm/features/store/types/ContentObjectTypesSearch.js.map +1 -1
  92. package/lib/esm/features/store/types/ContentObjectTypesTable.js +1 -1
  93. package/lib/esm/features/store/types/ContentObjectTypesTable.js.map +1 -1
  94. package/lib/esm/features/store/types/CreateOrUpdateTypeModal.js +2 -2
  95. package/lib/esm/features/store/types/CreateOrUpdateTypeModal.js.map +1 -1
  96. package/lib/esm/features/store/types/ObjectSchemaEditor.js +2 -3
  97. package/lib/esm/features/store/types/ObjectSchemaEditor.js.map +1 -1
  98. package/lib/esm/features/store/types/TableLayoutEditor.js +1 -1
  99. package/lib/esm/features/store/types/TableLayoutEditor.js.map +1 -1
  100. package/lib/esm/features/store/types/index.js +0 -2
  101. package/lib/esm/features/store/types/index.js.map +1 -1
  102. package/lib/esm/features/user/UserInfo.js +1 -2
  103. package/lib/esm/features/user/UserInfo.js.map +1 -1
  104. package/lib/esm/features/utils/rendition.js +22 -2
  105. package/lib/esm/features/utils/rendition.js.map +1 -1
  106. package/lib/esm/session/UserSession.js +2 -2
  107. package/lib/esm/session/UserSession.js.map +1 -1
  108. package/lib/esm/session/auth/composable.js +1 -1
  109. package/lib/esm/session/auth/composable.js.map +1 -1
  110. package/lib/esm/session/constants.js +3 -0
  111. package/lib/esm/session/constants.js.map +1 -0
  112. package/lib/esm/widgets/codemirror/CodeMirrorEditor.js +2 -2
  113. package/lib/esm/widgets/codemirror/CodeMirrorEditor.js.map +1 -1
  114. package/lib/esm/widgets/properties/PropertiesView.js +4 -2
  115. package/lib/esm/widgets/properties/PropertiesView.js.map +1 -1
  116. package/lib/esm/widgets/schema-editor/editor/SchemaEditor.js +1 -1
  117. package/lib/esm/widgets/schema-editor/editor/SchemaEditor.js.map +1 -1
  118. package/lib/tsconfig.tsbuildinfo +1 -1
  119. package/lib/types/core/components/InputList.d.ts +2 -1
  120. package/lib/types/core/components/Switch.d.ts +2 -1
  121. package/lib/types/core/components/shadcn/filters/comboBox.d.ts +5 -0
  122. package/lib/types/core/components/shadcn/filters/stringListFilter.d.ts +10 -0
  123. package/lib/types/core/components/shadcn/filters/types.d.ts +3 -3
  124. package/lib/types/features/agent/PayloadBuilder.d.ts +8 -1
  125. package/lib/types/features/facets/VEnvironmentFacet.d.ts +11 -0
  126. package/lib/types/features/facets/VFacetsNav.d.ts +9 -1
  127. package/lib/types/features/facets/VInteractionFacet.d.ts +14 -0
  128. package/lib/types/features/facets/VStringFacet.d.ts +3 -2
  129. package/lib/types/features/facets/VUserFacet.d.ts +3 -2
  130. package/lib/types/features/store/collections/{CollectionsView.d.ts → CreateCollection.d.ts} +5 -3
  131. package/lib/types/features/store/collections/SelectCollection.d.ts +14 -0
  132. package/lib/types/features/store/collections/index.d.ts +2 -2
  133. package/lib/types/features/store/objects/components/ContentOverview.d.ts +2 -1
  134. package/lib/types/features/store/objects/components/DocumentIcon.d.ts +2 -1
  135. package/lib/types/features/store/objects/components/PropertiesEditorModal.d.ts +2 -1
  136. package/lib/types/features/store/objects/layout/documentLayout.d.ts +1 -1
  137. package/lib/types/features/store/objects/search/DocumentSearchContext.d.ts +3 -2
  138. package/lib/types/features/store/objects/selection/actions/DeleteObjectsAction.d.ts +2 -1
  139. package/lib/types/features/store/objects/selection/actions/RemoveFromCollectionAction.d.ts +2 -1
  140. package/lib/types/features/store/types/index.d.ts +0 -2
  141. package/lib/types/features/utils/rendition.d.ts +1 -1
  142. package/lib/types/session/UserSession.d.ts +2 -2
  143. package/lib/types/session/constants.d.ts +2 -0
  144. package/lib/vertesia-ui-core.js +1 -1
  145. package/lib/vertesia-ui-core.js.map +1 -1
  146. package/lib/vertesia-ui-features.js +1 -1
  147. package/lib/vertesia-ui-features.js.map +1 -1
  148. package/lib/vertesia-ui-session.js +1 -1
  149. package/lib/vertesia-ui-session.js.map +1 -1
  150. package/lib/vertesia-ui-widgets.js +1 -1
  151. package/lib/vertesia-ui-widgets.js.map +1 -1
  152. package/package.json +4 -4
  153. package/src/core/components/EmptyCollection.tsx +26 -24
  154. package/src/core/components/InputList.tsx +3 -1
  155. package/src/core/components/SidePanel.tsx +2 -2
  156. package/src/core/components/Switch.tsx +4 -3
  157. package/src/core/components/shadcn/calendar.tsx +0 -2
  158. package/src/core/components/shadcn/checkbox.tsx +0 -2
  159. package/src/core/components/shadcn/command.tsx +0 -2
  160. package/src/core/components/shadcn/dialog.tsx +0 -2
  161. package/src/core/components/shadcn/filters/comboBox.tsx +73 -0
  162. package/src/core/components/shadcn/filters/filterBar.tsx +41 -17
  163. package/src/core/components/shadcn/filters/filters.tsx +30 -14
  164. package/src/core/components/shadcn/filters/selectFilter.tsx +3 -3
  165. package/src/core/components/shadcn/filters/stringListFilter.tsx +58 -0
  166. package/src/core/components/shadcn/filters/textFilter.tsx +2 -1
  167. package/src/core/components/shadcn/filters/types.ts +3 -3
  168. package/src/core/components/shadcn/label.tsx +0 -2
  169. package/src/features/agent/PayloadBuilder.tsx +34 -1
  170. package/src/features/agent/chat/ModernAgentOutput/MessageItem.tsx +11 -12
  171. package/src/features/facets/VEnvironmentFacet.tsx +42 -0
  172. package/src/features/facets/VFacetsNav.tsx +87 -29
  173. package/src/features/facets/VInteractionFacet.tsx +73 -0
  174. package/src/features/facets/VStringFacet.tsx +7 -6
  175. package/src/features/facets/VUserFacet.tsx +7 -6
  176. package/src/features/layout/GenericPageNavHeader.tsx +1 -1
  177. package/src/features/magic-pdf/TextPageView.tsx +1 -2
  178. package/src/features/store/collections/CollectionsTable.tsx +49 -40
  179. package/src/features/store/collections/{CollectionsView.tsx → CreateCollection.tsx} +15 -42
  180. package/src/features/store/collections/EditCollectionView.tsx +1 -1
  181. package/src/features/store/collections/SelectCollection.tsx +46 -0
  182. package/src/features/store/collections/index.ts +2 -2
  183. package/src/features/store/objects/DocumentSearchResults.tsx +6 -3
  184. package/src/features/store/objects/components/ContentOverview.tsx +33 -95
  185. package/src/features/store/objects/components/DocumentIcon.tsx +27 -14
  186. package/src/features/store/objects/components/DocumentInput.tsx +1 -2
  187. package/src/features/store/objects/components/PropertiesEditorModal.tsx +7 -3
  188. package/src/features/store/objects/components/SaveVersionConfirmModal.tsx +2 -2
  189. package/src/features/store/objects/components/SelectDocument.tsx +18 -3
  190. package/src/features/store/objects/components/SelectDocumentModal.tsx +6 -6
  191. package/src/features/store/objects/layout/documentLayout.tsx +2 -2
  192. package/src/features/store/objects/search/DocumentSearchContext.ts +6 -3
  193. package/src/features/store/objects/selection/ObjectsActionContext.tsx +1 -1
  194. package/src/features/store/objects/selection/SelectionActions.tsx +0 -1
  195. package/src/features/store/objects/selection/actions/AddToCollectionAction.tsx +10 -21
  196. package/src/features/store/objects/selection/actions/ChangeTypeAction.tsx +1 -1
  197. package/src/features/store/objects/selection/actions/DeleteObjectsAction.tsx +2 -2
  198. package/src/features/store/objects/selection/actions/ExportPropertiesAction.tsx +1 -1
  199. package/src/features/store/objects/selection/actions/RemoveFromCollectionAction.tsx +1 -1
  200. package/src/features/store/types/ContentObjectTypesSearch.tsx +3 -4
  201. package/src/features/store/types/ContentObjectTypesTable.tsx +3 -1
  202. package/src/features/store/types/CreateOrUpdateTypeModal.tsx +2 -9
  203. package/src/features/store/types/ObjectSchemaEditor.tsx +4 -5
  204. package/src/features/store/types/TableLayoutEditor.tsx +4 -4
  205. package/src/features/store/types/index.ts +0 -2
  206. package/src/features/user/UserInfo.tsx +1 -2
  207. package/src/features/utils/rendition.ts +23 -1
  208. package/src/session/UserSession.ts +2 -2
  209. package/src/session/auth/composable.ts +1 -1
  210. package/src/session/constants.ts +2 -0
  211. package/src/widgets/codemirror/CodeMirrorEditor.tsx +2 -2
  212. package/src/widgets/properties/PropertiesView.tsx +10 -2
  213. package/src/widgets/schema-editor/editor/SchemaEditor.tsx +1 -1
  214. package/lib/esm/features/store/collections/CollectionView.js +0 -53
  215. package/lib/esm/features/store/collections/CollectionView.js.map +0 -1
  216. package/lib/esm/features/store/collections/CollectionsView.js.map +0 -1
  217. package/lib/esm/features/store/types/ContentObjectTypeView.js +0 -158
  218. package/lib/esm/features/store/types/ContentObjectTypeView.js.map +0 -1
  219. package/lib/esm/features/store/types/ContentObjectTypesView.js +0 -55
  220. package/lib/esm/features/store/types/ContentObjectTypesView.js.map +0 -1
  221. package/lib/types/features/store/collections/CollectionView.d.ts +0 -5
  222. package/lib/types/features/store/types/ContentObjectTypeView.d.ts +0 -5
  223. package/lib/types/features/store/types/ContentObjectTypesView.d.ts +0 -8
  224. package/src/features/store/collections/CollectionView.tsx +0 -94
  225. package/src/features/store/types/ContentObjectTypeView.tsx +0 -244
  226. package/src/features/store/types/ContentObjectTypesView.tsx +0 -71
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vertesia/ui",
3
- "version": "0.65.0",
3
+ "version": "0.66.0",
4
4
  "description": "Vertesia UI components and and hooks",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",
@@ -56,9 +56,9 @@
56
56
  "tailwind-merge": "^3.3.0",
57
57
  "ts-md5": "^1.3.1",
58
58
  "json-schema": "^0.4.0",
59
- "@vertesia/client": "0.65.0",
60
- "@vertesia/common": "0.65.0",
61
- "@vertesia/json": "0.65.0"
59
+ "@vertesia/client": "0.66.0",
60
+ "@vertesia/common": "0.66.0",
61
+ "@vertesia/json": "0.66.0"
62
62
  },
63
63
  "devDependencies": {
64
64
  "@eslint/js": "^9.27.0",
@@ -1,5 +1,5 @@
1
1
  import { Plus } from "lucide-react";
2
- import { Button } from "./Button.js";
2
+ import { Button } from "@vertesia/ui/core";
3
3
 
4
4
 
5
5
  interface EmptyInteractionsProps {
@@ -10,29 +10,31 @@ interface EmptyInteractionsProps {
10
10
  }
11
11
  export function EmptyCollection({ buttonLabel, title, children, onClick }: EmptyInteractionsProps) {
12
12
  return (
13
- <div className="text-center py-12">
14
- <svg
15
- className="mx-auto h-12 w-12 text-gray-400 dark:text-gray-200"
16
- fill="none"
17
- viewBox="0 0 24 24"
18
- stroke="currentColor"
19
- aria-hidden="true"
20
- >
21
- <path
22
- vectorEffect="non-scaling-stroke"
23
- strokeLinecap="round"
24
- strokeLinejoin="round"
25
- strokeWidth={2}
26
- d="M9 13h6m-3-3v6m-9 1V7a2 2 0 012-2h6l2 2h6a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2z"
27
- />
28
- </svg>
29
- <h3 className="mt-2 text-sm font-semibold text-gray-500">{title}</h3>
30
- <p className="mt-1 text-sm text-gray-500">{children}</p>
31
- <div className="mt-6">
32
- <Button onClick={onClick} size='lg'>
33
- <Plus className="-ml-0.5 mr-1.5 size-5" aria-hidden="true" />
34
- {buttonLabel}
35
- </Button>
13
+ <div className="flex items-center justify-center h-full text-center">
14
+ <div className="py-12">
15
+ <svg
16
+ className="mx-auto size-12"
17
+ fill="none"
18
+ viewBox="0 0 24 24"
19
+ stroke="currentColor"
20
+ aria-hidden="true"
21
+ >
22
+ <path
23
+ vectorEffect="non-scaling-stroke"
24
+ strokeLinecap="round"
25
+ strokeLinejoin="round"
26
+ strokeWidth={2}
27
+ d="M9 13h6m-3-3v6m-9 1V7a2 2 0 012-2h6l2 2h6a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2z"
28
+ />
29
+ </svg>
30
+ <h3 className="mt-2 text-sm font-semibold">{title}</h3>
31
+ <p className="mt-1 text-sm text-muted">{children}</p>
32
+ <div className="mt-6">
33
+ <Button onClick={onClick}>
34
+ <Plus className="-ml-0.5 mr-1.5 size-5" aria-hidden="true" />
35
+ {buttonLabel}
36
+ </Button>
37
+ </div>
36
38
  </div>
37
39
  </div>
38
40
  )
@@ -12,8 +12,9 @@ interface InputListProps {
12
12
  allowSpaces?: boolean;
13
13
  delimiters?: string; // space and , by default
14
14
  placeholder?: string;
15
+ autoFocus?: boolean;
15
16
  }
16
- export function InputList({ value = [], onChange, className, delimiters = ", ", placeholder }: InputListProps) {
17
+ export function InputList({ value = [], onChange, className, delimiters = ", ", placeholder, autoFocus }: InputListProps) {
17
18
  const [text, setText] = useState<string>('');
18
19
 
19
20
  const onBlur = (ev: any) => {
@@ -69,6 +70,7 @@ export function InputList({ value = [], onChange, className, delimiters = ", ",
69
70
  onKeyDown={onKeyDown}
70
71
  onChange={setText}
71
72
  placeholder={!value || value.length === 0 ? placeholder : ''}
73
+ autoFocus={autoFocus}
72
74
  />
73
75
  </div>
74
76
  </div>
@@ -42,8 +42,8 @@ export function SidePanel({ isOpen, title, onClose, children }: SidePanelProps)
42
42
  return (
43
43
  <Transition show={isOpen} as={Fragment}>
44
44
  <Dialog as="div" className="relative z-10" onClose={onClose}>
45
- <div className="fixed inset-0" />
46
- <div className="fixed inset-0 overflow-hidden">
45
+ <div className="fixed inset-y-0 right-0" />
46
+ <div className="fixed inset-y-0 right-0 overflow-hidden">
47
47
  <div className="absolute inset-0 overflow-hidden">
48
48
  <div className="pointer-events-none fixed inset-y-0 right-0 flex max-w-full pl-10 sm:pl-16">
49
49
  <TransitionChild
@@ -12,12 +12,13 @@ interface SwitchProps {
12
12
  onChange: (value: boolean) => void;
13
13
  children?: React.ReactNode;
14
14
  className?: string;
15
+ disabled?: boolean;
15
16
  }
16
- export function Switch({ value, onChange, size = 'md', children, className }: SwitchProps) {
17
+ export function Switch({ value, onChange, size = 'md', children, className, disabled }: SwitchProps) {
17
18
  const sizeClass = sizes[size];
18
19
  return (
19
- <UISwitch checked={value} onChange={() => onChange(!value)} className={`flex items-center ${className} hover:cursor-pointer`}>
20
- <div className={`${value ? 'bg-primary' : 'bg-muted'} relative inline-flex ${sizeClass[0]} items-center rounded-full`}>
20
+ <UISwitch checked={value} onChange={() => onChange(!value)} className={`flex items-center ${className} ${disabled ? 'cursor-not-allowed opacity-50' : 'hover:cursor-pointer'}`}>
21
+ <div className={`${value ? 'bg-primary' : 'bg-muted/50'} relative inline-flex ${sizeClass[0]} items-center rounded-full border-1`}>
21
22
  <span
22
23
  className={`${value ? sizeClass[2] : 'translate-x-1'
23
24
  } inline-block ${sizeClass[1]} transform rounded-full bg-white transition`}
@@ -1,5 +1,3 @@
1
- "use client"
2
-
3
1
  import * as React from "react"
4
2
  import DatePicker from "react-date-picker"
5
3
 
@@ -1,5 +1,3 @@
1
- "use client"
2
-
3
1
  import * as React from "react"
4
2
  import * as CheckboxPrimitive from "@radix-ui/react-checkbox"
5
3
  import { Check } from "lucide-react"
@@ -1,5 +1,3 @@
1
- "use client"
2
-
3
1
  import * as React from "react"
4
2
  import { type DialogProps } from "@radix-ui/react-dialog"
5
3
  import { Command as CommandPrimitive } from "cmdk"
@@ -1,5 +1,3 @@
1
- "use client";
2
-
3
1
  import * as React from "react";
4
2
  import * as DialogPrimitive from "@radix-ui/react-dialog";
5
3
  import { cn } from "../libs/utils";
@@ -11,6 +11,7 @@ import { Popover, PopoverContent, PopoverTrigger } from "../popover";
11
11
  import { AnimateChangeInHeight } from "./animateChangeInHeight";
12
12
  import { FilterGroupOption, FilterOption } from "./types";
13
13
  import { DynamicLabel } from "./DynamicLabel";
14
+ import { InputList } from "../../index";
14
15
 
15
16
 
16
17
  export const SelectionCombobox = ({
@@ -253,4 +254,76 @@ export const TextCombobox = ({
253
254
  </PopoverContent>
254
255
  </Popover>
255
256
  );
257
+ };
258
+
259
+ export const StringListCombobox = ({
260
+ filterType,
261
+ filterValues,
262
+ setFilterValues,
263
+ }: {
264
+ filterType: string;
265
+ filterValues: string[];
266
+ setFilterValues: (values: string[]) => void;
267
+ }) => {
268
+ const [open, setOpen] = useState(false);
269
+ const [tags, setTags] = useState<string[]>(filterValues);
270
+
271
+ const handleApply = () => {
272
+ setFilterValues(tags);
273
+ setOpen(false);
274
+ };
275
+
276
+ return (
277
+ <Popover
278
+ _open={open}
279
+ onOpenChange={(open) => {
280
+ setOpen(open);
281
+ if (!open && JSON.stringify(tags) !== JSON.stringify(filterValues)) {
282
+ setTags(filterValues);
283
+ }
284
+ }}
285
+ >
286
+ <PopoverTrigger
287
+ className="rounded-none p-1 h-8 bg-muted hover:bg-muted/50 text-muted hover:text-primary shrink-0 transition"
288
+ >
289
+ <div className="flex gap-1.5 items-center">
290
+ {filterValues.length > 0 ? (
291
+ filterValues.length === 1 ? filterValues[0] : `${filterValues.length} tags`
292
+ ) : (
293
+ "Add tags..."
294
+ )}
295
+ </div>
296
+ </PopoverTrigger>
297
+ <PopoverContent className="w-[300px] p-3">
298
+ <div className="flex flex-col gap-3">
299
+ <div className="flex items-center p-1.5 text-xs text-muted">
300
+ <span>{filterType}</span>
301
+ </div>
302
+ <InputList
303
+ value={tags}
304
+ onChange={setTags}
305
+ placeholder={`Add ${filterType.toLowerCase()}...`}
306
+ />
307
+ <div className="flex gap-2 justify-end">
308
+ <Button
309
+ size="sm"
310
+ variant="ghost"
311
+ onClick={() => {
312
+ setTags(filterValues);
313
+ setOpen(false);
314
+ }}
315
+ >
316
+ Cancel
317
+ </Button>
318
+ <Button
319
+ size="sm"
320
+ onClick={handleApply}
321
+ >
322
+ Apply
323
+ </Button>
324
+ </div>
325
+ </div>
326
+ </PopoverContent>
327
+ </Popover>
328
+ );
256
329
  };
@@ -1,6 +1,8 @@
1
1
  import React, { Dispatch, SetStateAction, useEffect } from "react";
2
2
  import { cn } from "../../libs/utils";
3
- import { Button, Popover, PopoverTrigger, PopoverContent, Command, CommandInput, CommandList, CommandGroup, CommandItem, CommandEmpty } from "../index";
3
+ import { Button } from "../button";
4
+ import { Popover, PopoverTrigger, PopoverContent } from "../popover";
5
+ import { Command, CommandInput, CommandList, CommandGroup, CommandItem, CommandEmpty } from "../command";
4
6
  import { ListFilter } from "lucide-react";
5
7
 
6
8
  import { Filter, FilterGroup } from "./types";
@@ -9,6 +11,7 @@ import Filters from "./filters";
9
11
  import TextFilter from "./textFilter";
10
12
  import DateFilter from "./dateFilter";
11
13
  import SelectFilter from "./selectFilter";
14
+ import StringListFilter from "./stringListFilter";
12
15
 
13
16
  interface FilterBarProps {
14
17
  filters: Filter[];
@@ -39,13 +42,16 @@ export function FilterBar({ filters, setFilters, filterGroups }: FilterBarProps)
39
42
  return filter.name === group.name;
40
43
  }
41
44
  return filter.name === group.name &&
42
- filter.value.some(val => val.value === option.value);
45
+ (Array.isArray(filter.value) && typeof filter.value[0] === 'string'
46
+ ? filter.value.some(val => val === option.value)
47
+ : filter.value.some(val => (val as any).value === option.value));
43
48
  })
44
49
  )
45
50
  })).filter(group =>
46
51
  ((group.options ?? []).length > 0) ||
47
52
  (group.type === "date" && !filters.some(filter => filter.name === group.name)) ||
48
- (group.type === "text" && !filters.some(filter => filter.name === group.name))
53
+ (group.type === "text" && !filters.some(filter => filter.name === group.name)) ||
54
+ (group.type === "stringList" && !filters.some(filter => filter.name === group.name))
49
55
  );
50
56
 
51
57
  if (options.length === 0) {
@@ -127,6 +133,15 @@ export function FilterBar({ filters, setFilters, filterGroups }: FilterBarProps)
127
133
  filterGroups={filterGroups}
128
134
  />
129
135
  );
136
+ case "stringList":
137
+ return (
138
+ <StringListFilter
139
+ selectedView={selectedView}
140
+ setFilters={setFilters}
141
+ handleClose={handleClose}
142
+ filterGroups={filterGroups}
143
+ />
144
+ );
130
145
  default:
131
146
  return (
132
147
  <SelectFilter
@@ -148,9 +163,16 @@ export function FilterBar({ filters, setFilters, filterGroups }: FilterBarProps)
148
163
  if (filters.length > 0) {
149
164
  // Convert filters to simple format with URL-safe encoding: filterName:value,value;filterName2:value
150
165
  const filterString = filters.map(filter => {
151
- const values = Array.isArray(filter.value)
152
- ? filter.value.map(item => encodeURIComponent(item.value || '')).join(',')
153
- : encodeURIComponent(filter.value || '');
166
+ let values;
167
+ if (filter.type === 'stringList' && Array.isArray(filter.value) && typeof filter.value[0] === 'string') {
168
+ // Handle stringList with direct string array
169
+ values = (filter.value as string[]).map(item => encodeURIComponent(item)).join(',');
170
+ } else if (Array.isArray(filter.value)) {
171
+ // Handle other types with FilterOption array
172
+ values = filter.value.map((item: any) => encodeURIComponent(item.value || '')).join(',');
173
+ } else {
174
+ values = encodeURIComponent(filter.value || '');
175
+ }
154
176
  return `${encodeURIComponent(filter.name)}:${values}`;
155
177
  }).join(';');
156
178
  params.set('filters', filterString);
@@ -177,13 +199,17 @@ export function FilterBar({ filters, setFilters, filterGroups }: FilterBarProps)
177
199
  const values = valuesString.split(',').map(encodedValue => decodeURIComponent(encodedValue));
178
200
 
179
201
  const group = filterGroups.find(g => g.name === name);
180
- console.log("group", group);
202
+ let filterValue;
181
203
 
182
- const filterOptions = values.map(value => {
183
- if (group?.type === 'text') {
184
- return { value, label: value };
185
- } else {
186
- // Try to find option with label, or use labelRenderer, or fallback to value
204
+ if (group?.type === 'stringList') {
205
+ // For stringList, return direct string array
206
+ filterValue = values;
207
+ } else if (group?.type === 'text') {
208
+ // For text, return FilterOption array
209
+ filterValue = values.map(value => ({ value, label: value }));
210
+ } else {
211
+ // For other types, find options with labels
212
+ filterValue = values.map(value => {
187
213
  const matchingOption = group?.options?.find(opt => opt.value === value);
188
214
  let label = value;
189
215
 
@@ -199,16 +225,14 @@ export function FilterBar({ filters, setFilters, filterGroups }: FilterBarProps)
199
225
  value,
200
226
  label
201
227
  };
202
- }
203
- });
204
-
205
- console.log("valuesWithLabels", filterOptions);
228
+ });
229
+ }
206
230
 
207
231
  return {
208
232
  name,
209
233
  type: group?.type || 'select',
210
234
  placeholder: group?.placeholder,
211
- value: filterOptions
235
+ value: filterValue
212
236
  };
213
237
  });
214
238
 
@@ -2,8 +2,8 @@ import { X } from "lucide-react";
2
2
  import { Dispatch, SetStateAction } from "react";
3
3
  import { Button } from "../button";
4
4
 
5
- import { DateCombobox, SelectionCombobox, TextCombobox } from "./comboBox";
6
- import { Filter, FilterGroup } from "./types";
5
+ import { DateCombobox, SelectionCombobox, TextCombobox, StringListCombobox } from "./comboBox";
6
+ import { Filter, FilterGroup, FilterOption } from "./types";
7
7
  import dayjs from "dayjs";
8
8
 
9
9
  interface FiltersProps {
@@ -21,7 +21,7 @@ function generateComboboxOptions(
21
21
  case "date":
22
22
  return (
23
23
  <DateCombobox
24
- filterValues={filter.value.map(v => v.value || '')}
24
+ filterValues={Array.isArray(filter.value) && typeof filter.value[0] === 'object' ? filter.value.map((v: any) => v.value || '') : []}
25
25
  setFilterValues={(filterValues) => {
26
26
  setFilters((prev) =>
27
27
  prev.map((f) =>
@@ -41,20 +41,36 @@ function generateComboboxOptions(
41
41
  return (
42
42
  <TextCombobox
43
43
  filterType={filter.placeholder || filter.name}
44
- filterValue={filter.value[0]?.value || ""}
44
+ filterValue={Array.isArray(filter.value) && filter.value[0] && typeof filter.value[0] === 'object' ? filter.value[0].value || "" : ""}
45
45
  setFilterValue={(textValue) => {
46
46
  setFilters((prev) =>
47
47
  prev.map((f) =>
48
48
  f === filter
49
49
  ? {
50
- ...f,
51
- value: [
52
- {
53
- value: textValue,
54
- label: textValue,
55
- },
56
- ],
57
- }
50
+ ...f,
51
+ value: [
52
+ {
53
+ value: textValue,
54
+ label: textValue,
55
+ },
56
+ ],
57
+ }
58
+ : f,
59
+ ),
60
+ );
61
+ }}
62
+ />
63
+ );
64
+ case "stringList":
65
+ return (
66
+ <StringListCombobox
67
+ filterType={filter.placeholder || filter.name}
68
+ filterValues={Array.isArray(filter.value) && typeof filter.value[0] === 'string' ? filter.value as string[] : []}
69
+ setFilterValues={(values) => {
70
+ setFilters((prev) =>
71
+ prev.map((f) =>
72
+ f === filter
73
+ ? { ...f, value: values }
58
74
  : f,
59
75
  ),
60
76
  );
@@ -67,7 +83,7 @@ function generateComboboxOptions(
67
83
  return (
68
84
  <SelectionCombobox
69
85
  filterType={filter.placeholder || filter.name}
70
- filterValues={filter.value}
86
+ filterValues={Array.isArray(filter.value) && typeof filter.value[0] === 'object' ? filter.value as FilterOption[] : []}
71
87
  setFilterValues={(filterValues) => {
72
88
  setFilters((prev) =>
73
89
  prev.map((f) =>
@@ -95,7 +111,7 @@ export default function Filters({
95
111
  {filters
96
112
  .filter((filter) => filter.value?.length > 0)
97
113
  .map((filter) => (
98
- <div className="flex gap-[1px] items-center text-sm" key={filter.name + '-' + (filter.type == 'date' ? 'date' : filter.value.map(v => v.value).join(','))}>
114
+ <div className="flex gap-[1px] items-center text-sm" key={filter.name + '-' + (filter.type == 'date' ? 'date' : filter.type === 'stringList' && typeof filter.value[0] === 'string' ? (filter.value as string[]).join(',') : Array.isArray(filter.value) ? filter.value.map((v: any) => v.value).join(',') : '')}>
99
115
  <div className="flex gap-1.5 shrink-0 rounded-l bg-muted p-1.5 h-8 items-center">
100
116
  {filter.placeholder || filter.name}
101
117
  </div>
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
- import { CommandItem, CommandEmpty } from "../index";
3
- import { Filter, FilterGroup, FilterGroupOption } from "./types";
2
+ import { CommandItem, CommandEmpty } from "../command";
3
+ import { Filter, FilterGroup, FilterGroupOption, FilterOption } from "./types";
4
4
  import { DynamicLabel } from "./DynamicLabel";
5
5
 
6
6
  interface SelectFilterProps {
@@ -81,7 +81,7 @@ export default function SelectFilter({
81
81
  const updatedFilters = [...prev];
82
82
  updatedFilters[existingFilterIndex] = {
83
83
  ...updatedFilters[existingFilterIndex],
84
- value: [...updatedFilters[existingFilterIndex].value, filterOption]
84
+ value: [...(updatedFilters[existingFilterIndex].value as FilterOption[]), filterOption]
85
85
  };
86
86
  return updatedFilters;
87
87
  } else {
@@ -0,0 +1,58 @@
1
+ import { Dispatch, SetStateAction, useState } from "react";
2
+ import { InputList } from "../../index";
3
+ import { Button } from "../button";
4
+ import { Filter, FilterGroup } from "./types";
5
+
6
+ interface StringListFilterProps {
7
+ selectedView: string;
8
+ setFilters: Dispatch<SetStateAction<Filter[]>>;
9
+ handleClose: () => void;
10
+ filterGroups: FilterGroup[];
11
+ }
12
+
13
+ export default function StringListFilter({
14
+ selectedView,
15
+ setFilters,
16
+ handleClose,
17
+ filterGroups,
18
+ }: StringListFilterProps) {
19
+ const [tags, setTags] = useState<string[]>([]);
20
+
21
+ const selectedGroup = filterGroups.find(g => g.name === selectedView);
22
+
23
+ const handleApply = () => {
24
+ if (tags.length > 0) {
25
+ setFilters(prev => [
26
+ ...prev.filter(f => f.name !== selectedView),
27
+ {
28
+ name: selectedView,
29
+ placeholder: selectedGroup?.placeholder,
30
+ value: tags,
31
+ type: "stringList" as const
32
+ }
33
+ ]);
34
+ }
35
+ handleClose();
36
+ };
37
+
38
+ return (
39
+ <div className="p-2 space-y-3">
40
+ <div className="space-y-2">
41
+ <InputList
42
+ value={tags}
43
+ onChange={setTags}
44
+ placeholder={selectedGroup?.placeholder || `Add ${selectedView}...`}
45
+ autoFocus
46
+ />
47
+ </div>
48
+ <div className="flex gap-2 justify-end">
49
+ <Button variant="ghost" size="sm" onClick={handleClose}>
50
+ Cancel
51
+ </Button>
52
+ <Button size="sm" onClick={handleApply} disabled={tags.length === 0}>
53
+ Apply
54
+ </Button>
55
+ </div>
56
+ </div>
57
+ );
58
+ }
@@ -1,5 +1,6 @@
1
1
  import React from "react";
2
- import { Button, Input } from "../index";
2
+ import { Button } from "../button";
3
+ import { Input } from "../input";
3
4
  import { Filter, FilterGroup } from "./types";
4
5
 
5
6
  interface TextFilterProps {
@@ -12,7 +12,7 @@ export interface FilterGroupOption {
12
12
  export interface FilterGroup {
13
13
  name: string;
14
14
  placeholder?: string;
15
- type?: "select" | "date" | "text";
15
+ type?: "select" | "date" | "text" | "stringList";
16
16
  options?: FilterGroupOption[];
17
17
  allowCreate?: boolean;
18
18
  filterBy?: (value: string, searchText: string) => boolean;
@@ -22,8 +22,8 @@ export interface FilterGroup {
22
22
  export interface Filter {
23
23
  name: string;
24
24
  placeholder?: string;
25
- value: FilterOption[];
26
- type?: "select" | "date" | "text";
25
+ value: FilterOption[] | string[];
26
+ type?: "select" | "date" | "text" | "stringList";
27
27
  }
28
28
 
29
29
  export enum FilterOperator {
@@ -1,5 +1,3 @@
1
- "use client"
2
-
3
1
  import * as React from "react"
4
2
  import * as LabelPrimitive from "@radix-ui/react-label"
5
3
  import { cva, type VariantProps } from "class-variance-authority"
@@ -3,8 +3,8 @@ import { ExecutionEnvironmentRef, Interaction, mergePromptsSchema, PopulatedInte
3
3
  import { JSONObject } from "@vertesia/json";
4
4
  import { useUserSession } from "@vertesia/ui/session";
5
5
  import Ajv, { ValidateFunction } from "ajv";
6
- import React, { createContext, useContext, useEffect, useState } from "react";
7
6
  import type { JSONSchema4 } from "json-schema";
7
+ import React, { createContext, useContext, useEffect, useState } from "react";
8
8
 
9
9
  export interface ConversationWorkflowPayload {
10
10
  interaction?: Interaction | undefined;
@@ -16,6 +16,8 @@ export interface ConversationWorkflowPayload {
16
16
 
17
17
  export class PayloadBuilder implements ConversationWorkflowPayload {
18
18
  _interactive: boolean = true;
19
+ _debug_mode: boolean = false;
20
+ _collection: string | undefined;
19
21
  _start: boolean = false;
20
22
 
21
23
  payload: ConversationWorkflowPayload;
@@ -42,14 +44,17 @@ export class PayloadBuilder implements ConversationWorkflowPayload {
42
44
  builder._interactionParamsSchema = this._interactionParamsSchema;
43
45
  builder.payload = this.payload;
44
46
  builder._interactive = this._interactive;
47
+ builder._debug_mode = this._debug_mode;
45
48
  builder._inputValidator = this._inputValidator;
46
49
  builder._start = this._start;
50
+ builder._collection = this._collection;
47
51
  return builder;
48
52
  }
49
53
 
50
54
  get interactive() {
51
55
  return this._interactive;
52
56
  }
57
+
53
58
  set interactive(interactive: boolean) {
54
59
  if (interactive !== this._interactive) {
55
60
  this._interactive = interactive;
@@ -57,6 +62,32 @@ export class PayloadBuilder implements ConversationWorkflowPayload {
57
62
  }
58
63
  }
59
64
 
65
+ get debug_mode() {
66
+ return this._debug_mode;
67
+ }
68
+
69
+ set debug_mode(debug_mode: boolean) {
70
+ if (debug_mode !== this._debug_mode) {
71
+ this._debug_mode = debug_mode;
72
+ this.onStateChanged();
73
+ }
74
+ }
75
+
76
+ get collection() {
77
+ return this._collection;
78
+ }
79
+
80
+ set collection(collection: string | undefined) {
81
+ if (collection !== this._collection) {
82
+ this._collection = collection;
83
+ this.onStateChanged();
84
+ }
85
+ }
86
+
87
+ get search_scope() {
88
+ return this._collection ? "collection" : undefined;
89
+ }
90
+
60
91
  get interaction() {
61
92
  return this.payload.interaction;
62
93
  }
@@ -154,6 +185,8 @@ export class PayloadBuilder implements ConversationWorkflowPayload {
154
185
  reset() {
155
186
  this._start = false;
156
187
  this._interactive = true;
188
+ this._debug_mode = false;
189
+ this._collection = undefined;
157
190
  this.payload = {
158
191
  model: '',
159
192
  tools: [],