@manta-eu/react 0.12.0 → 0.13.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 (585) hide show
  1. package/README.md +59 -0
  2. package/dist/components/AppErrorBoundary.d.ts.map +1 -1
  3. package/dist/components/AppErrorBoundary.js +14 -11
  4. package/dist/components/AppErrorBoundary.js.map +1 -1
  5. package/dist/components/app-gate/AppGate.d.ts +8 -0
  6. package/dist/components/app-gate/AppGate.d.ts.map +1 -0
  7. package/dist/components/app-gate/AppGate.js +68 -0
  8. package/dist/components/app-gate/AppGate.js.map +1 -0
  9. package/dist/components/app-gate/AwaitingDatastoreStatus.d.ts +7 -0
  10. package/dist/components/app-gate/AwaitingDatastoreStatus.d.ts.map +1 -0
  11. package/dist/components/app-gate/AwaitingDatastoreStatus.js +19 -0
  12. package/dist/components/app-gate/AwaitingDatastoreStatus.js.map +1 -0
  13. package/dist/components/app-gate/EnterDatastoreRoute.d.ts +2 -0
  14. package/dist/components/app-gate/EnterDatastoreRoute.d.ts.map +1 -0
  15. package/dist/components/app-gate/EnterDatastoreRoute.js +25 -0
  16. package/dist/components/app-gate/EnterDatastoreRoute.js.map +1 -0
  17. package/dist/components/app-gate/ErrorRoute.d.ts +2 -0
  18. package/dist/components/app-gate/ErrorRoute.d.ts.map +1 -0
  19. package/dist/components/app-gate/ErrorRoute.js +27 -0
  20. package/dist/components/app-gate/ErrorRoute.js.map +1 -0
  21. package/dist/components/app-gate/FailureAlert.d.ts +5 -0
  22. package/dist/components/app-gate/FailureAlert.d.ts.map +1 -0
  23. package/dist/components/app-gate/FailureAlert.js +9 -0
  24. package/dist/components/app-gate/FailureAlert.js.map +1 -0
  25. package/dist/components/app-gate/NoDatastoreAccess.d.ts +8 -0
  26. package/dist/components/app-gate/NoDatastoreAccess.d.ts.map +1 -0
  27. package/dist/components/app-gate/NoDatastoreAccess.js +9 -0
  28. package/dist/components/app-gate/NoDatastoreAccess.js.map +1 -0
  29. package/dist/components/app-gate/NotFoundRoute.d.ts +2 -0
  30. package/dist/components/app-gate/NotFoundRoute.d.ts.map +1 -0
  31. package/dist/components/app-gate/NotFoundRoute.js +9 -0
  32. package/dist/components/app-gate/NotFoundRoute.js.map +1 -0
  33. package/dist/components/app-gate/PendingInvitations.d.ts +5 -0
  34. package/dist/components/app-gate/PendingInvitations.d.ts.map +1 -0
  35. package/dist/components/app-gate/PendingInvitations.js +58 -0
  36. package/dist/components/app-gate/PendingInvitations.js.map +1 -0
  37. package/dist/components/app-gate/ServiceError.d.ts +8 -0
  38. package/dist/components/app-gate/ServiceError.d.ts.map +1 -0
  39. package/dist/components/app-gate/ServiceError.js +10 -0
  40. package/dist/components/app-gate/ServiceError.js.map +1 -0
  41. package/dist/components/app-gate/index.d.ts +3 -0
  42. package/dist/components/app-gate/index.d.ts.map +1 -0
  43. package/dist/components/app-gate/index.js +3 -0
  44. package/dist/components/app-gate/index.js.map +1 -0
  45. package/dist/components/app-gate/sdk-route-elements.d.ts +23 -0
  46. package/dist/components/app-gate/sdk-route-elements.d.ts.map +1 -0
  47. package/dist/components/app-gate/sdk-route-elements.js +35 -0
  48. package/dist/components/app-gate/sdk-route-elements.js.map +1 -0
  49. package/dist/components/app-shell/AppShell.d.ts +7 -0
  50. package/dist/components/app-shell/AppShell.d.ts.map +1 -0
  51. package/dist/components/app-shell/AppShell.js +10 -0
  52. package/dist/components/app-shell/AppShell.js.map +1 -0
  53. package/dist/components/app-shell/AppShellRoutes.d.ts +9 -0
  54. package/dist/components/app-shell/AppShellRoutes.d.ts.map +1 -0
  55. package/dist/components/app-shell/AppShellRoutes.js +20 -0
  56. package/dist/components/app-shell/AppShellRoutes.js.map +1 -0
  57. package/dist/components/app-shell/GroupDatastores.d.ts +8 -0
  58. package/dist/components/app-shell/GroupDatastores.d.ts.map +1 -0
  59. package/dist/components/app-shell/GroupDatastores.js +15 -0
  60. package/dist/components/app-shell/GroupDatastores.js.map +1 -0
  61. package/dist/components/app-shell/GroupRoute.d.ts +2 -0
  62. package/dist/components/app-shell/GroupRoute.d.ts.map +1 -0
  63. package/dist/components/app-shell/GroupRoute.js +22 -0
  64. package/dist/components/app-shell/GroupRoute.js.map +1 -0
  65. package/dist/components/app-shell/index.d.ts +3 -0
  66. package/dist/components/app-shell/index.d.ts.map +1 -0
  67. package/dist/components/app-shell/index.js +3 -0
  68. package/dist/components/app-shell/index.js.map +1 -0
  69. package/dist/components/authenticated-chat/index.d.ts +1 -2
  70. package/dist/components/authenticated-chat/index.d.ts.map +1 -1
  71. package/dist/components/authenticated-chat/index.js +1 -12
  72. package/dist/components/authenticated-chat/index.js.map +1 -1
  73. package/dist/components/chat-view/Chat.d.ts +2 -1
  74. package/dist/components/chat-view/Chat.d.ts.map +1 -1
  75. package/dist/components/chat-view/Chat.js +3 -2
  76. package/dist/components/chat-view/Chat.js.map +1 -1
  77. package/dist/components/chat-view/MessageItem.d.ts.map +1 -1
  78. package/dist/components/chat-view/MessageItem.js +4 -2
  79. package/dist/components/chat-view/MessageItem.js.map +1 -1
  80. package/dist/components/chat-view/tool-part-rendering.d.ts +1 -0
  81. package/dist/components/chat-view/tool-part-rendering.d.ts.map +1 -1
  82. package/dist/components/chat-view/tool-part-rendering.js +8 -1
  83. package/dist/components/chat-view/tool-part-rendering.js.map +1 -1
  84. package/dist/components/chip/index.d.ts +1 -0
  85. package/dist/components/chip/index.d.ts.map +1 -1
  86. package/dist/components/chip/index.js +2 -1
  87. package/dist/components/chip/index.js.map +1 -1
  88. package/dist/components/embedded-chat/index.d.ts +1 -1
  89. package/dist/components/embedded-chat/index.d.ts.map +1 -1
  90. package/dist/components/embedded-chat/index.js +1 -1
  91. package/dist/components/embedded-chat/index.js.map +1 -1
  92. package/dist/components/input/input-date-time.d.ts +6 -0
  93. package/dist/components/input/input-date-time.d.ts.map +1 -1
  94. package/dist/components/input/input-date-time.js +2 -1
  95. package/dist/components/input/input-date-time.js.map +1 -1
  96. package/dist/components/input/input-date.d.ts +22 -0
  97. package/dist/components/input/input-date.d.ts.map +1 -1
  98. package/dist/components/input/input-date.js +28 -14
  99. package/dist/components/input/input-date.js.map +1 -1
  100. package/dist/components/input/input-time.d.ts +9 -0
  101. package/dist/components/input/input-time.d.ts.map +1 -1
  102. package/dist/components/input/input-time.js +29 -18
  103. package/dist/components/input/input-time.js.map +1 -1
  104. package/dist/components/layouts/RouteLayout.d.ts +0 -9
  105. package/dist/components/layouts/RouteLayout.d.ts.map +1 -1
  106. package/dist/components/layouts/RouteLayout.js +7 -4
  107. package/dist/components/layouts/RouteLayout.js.map +1 -1
  108. package/dist/components/layouts/Sidebar.d.ts +1 -8
  109. package/dist/components/layouts/Sidebar.d.ts.map +1 -1
  110. package/dist/components/layouts/Sidebar.js +7 -14
  111. package/dist/components/layouts/Sidebar.js.map +1 -1
  112. package/dist/components/plan-limits/PlanLimitsDialog.d.ts +20 -0
  113. package/dist/components/plan-limits/PlanLimitsDialog.d.ts.map +1 -0
  114. package/dist/components/plan-limits/PlanLimitsDialog.js +109 -0
  115. package/dist/components/plan-limits/PlanLimitsDialog.js.map +1 -0
  116. package/dist/components/plan-limits/index.d.ts +4 -0
  117. package/dist/components/plan-limits/index.d.ts.map +1 -0
  118. package/dist/components/plan-limits/index.js +2 -0
  119. package/dist/components/plan-limits/index.js.map +1 -0
  120. package/dist/components/plan-limits/plan-limits-client.d.ts +15 -0
  121. package/dist/components/plan-limits/plan-limits-client.d.ts.map +1 -0
  122. package/dist/components/plan-limits/plan-limits-client.js +44 -0
  123. package/dist/components/plan-limits/plan-limits-client.js.map +1 -0
  124. package/dist/components/plan-limits/plan-limits-model.d.ts +66 -0
  125. package/dist/components/plan-limits/plan-limits-model.d.ts.map +1 -0
  126. package/dist/components/plan-limits/plan-limits-model.js +123 -0
  127. package/dist/components/plan-limits/plan-limits-model.js.map +1 -0
  128. package/dist/components/plan-limits/plan-limits-save.d.ts +31 -0
  129. package/dist/components/plan-limits/plan-limits-save.d.ts.map +1 -0
  130. package/dist/components/plan-limits/plan-limits-save.js +43 -0
  131. package/dist/components/plan-limits/plan-limits-save.js.map +1 -0
  132. package/dist/components/planning/PlanLimitsAction.d.ts +6 -0
  133. package/dist/components/planning/PlanLimitsAction.d.ts.map +1 -0
  134. package/dist/components/planning/PlanLimitsAction.js +19 -0
  135. package/dist/components/planning/PlanLimitsAction.js.map +1 -0
  136. package/dist/components/slider/index.d.ts.map +1 -1
  137. package/dist/components/slider/index.js +2 -1
  138. package/dist/components/slider/index.js.map +1 -1
  139. package/dist/datastore-picker/datastore-picker-rows.d.ts +7 -0
  140. package/dist/datastore-picker/datastore-picker-rows.d.ts.map +1 -1
  141. package/dist/datastore-picker/datastore-picker-rows.js +26 -22
  142. package/dist/datastore-picker/datastore-picker-rows.js.map +1 -1
  143. package/dist/globals.css +85 -2
  144. package/dist/hooks/use-action-plans-list.d.ts +3 -0
  145. package/dist/hooks/use-action-plans-list.d.ts.map +1 -1
  146. package/dist/hooks/use-action-plans-list.js +8 -9
  147. package/dist/hooks/use-action-plans-list.js.map +1 -1
  148. package/dist/hooks/use-activity-feed.d.ts +10 -1
  149. package/dist/hooks/use-activity-feed.d.ts.map +1 -1
  150. package/dist/hooks/use-activity-feed.js +9 -11
  151. package/dist/hooks/use-activity-feed.js.map +1 -1
  152. package/dist/hooks/use-entity.d.ts +4 -3
  153. package/dist/hooks/use-entity.d.ts.map +1 -1
  154. package/dist/hooks/use-entity.js +4 -4
  155. package/dist/hooks/use-entity.js.map +1 -1
  156. package/dist/hooks/use-manual-actions.d.ts +1 -1
  157. package/dist/hooks/use-manual-actions.d.ts.map +1 -1
  158. package/dist/hooks/use-manual-actions.js +5 -5
  159. package/dist/hooks/use-manual-actions.js.map +1 -1
  160. package/dist/hooks/use-unsaved-changes-warning.d.ts +2 -0
  161. package/dist/hooks/use-unsaved-changes-warning.d.ts.map +1 -0
  162. package/dist/hooks/use-unsaved-changes-warning.js +13 -0
  163. package/dist/hooks/use-unsaved-changes-warning.js.map +1 -0
  164. package/dist/hooks/useAuth.d.ts.map +1 -1
  165. package/dist/hooks/useAuth.js +4 -3
  166. package/dist/hooks/useAuth.js.map +1 -1
  167. package/dist/hooks/useChatPanelSync.d.ts.map +1 -1
  168. package/dist/hooks/useChatPanelSync.js +2 -3
  169. package/dist/hooks/useChatPanelSync.js.map +1 -1
  170. package/dist/hooks/useDatastoreSelection.d.ts.map +1 -1
  171. package/dist/hooks/useDatastoreSelection.js +11 -4
  172. package/dist/hooks/useDatastoreSelection.js.map +1 -1
  173. package/dist/hooks/useExecuteAction.d.ts +1 -0
  174. package/dist/hooks/useExecuteAction.d.ts.map +1 -1
  175. package/dist/hooks/useExecuteAction.js.map +1 -1
  176. package/dist/hooks/useLoginRedirect.d.ts +6 -0
  177. package/dist/hooks/useLoginRedirect.d.ts.map +1 -0
  178. package/dist/hooks/useLoginRedirect.js +51 -0
  179. package/dist/hooks/useLoginRedirect.js.map +1 -0
  180. package/dist/hooks/usePlanLimits.d.ts +18 -0
  181. package/dist/hooks/usePlanLimits.d.ts.map +1 -0
  182. package/dist/hooks/usePlanLimits.js +56 -0
  183. package/dist/hooks/usePlanLimits.js.map +1 -0
  184. package/dist/ldo-ui.d.ts +1 -1
  185. package/dist/ldo-ui.d.ts.map +1 -1
  186. package/dist/ldo-ui.js.map +1 -1
  187. package/dist/lib/app-tools.d.ts +18 -0
  188. package/dist/lib/app-tools.d.ts.map +1 -0
  189. package/dist/lib/app-tools.js +42 -0
  190. package/dist/lib/app-tools.js.map +1 -0
  191. package/dist/lib/chat-types.d.ts +3 -0
  192. package/dist/lib/chat-types.d.ts.map +1 -1
  193. package/dist/lib/chat-types.js.map +1 -1
  194. package/dist/lib/datastore-route-table.d.ts +3 -0
  195. package/dist/lib/datastore-route-table.d.ts.map +1 -1
  196. package/dist/lib/datastore-route-table.js +6 -0
  197. package/dist/lib/datastore-route-table.js.map +1 -1
  198. package/dist/lib/graphql-error.d.ts +2 -0
  199. package/dist/lib/graphql-error.d.ts.map +1 -0
  200. package/dist/lib/graphql-error.js +7 -0
  201. package/dist/lib/graphql-error.js.map +1 -0
  202. package/dist/lib/update-notice.d.ts +2 -1
  203. package/dist/lib/update-notice.d.ts.map +1 -1
  204. package/dist/lib/update-notice.js +8 -2
  205. package/dist/lib/update-notice.js.map +1 -1
  206. package/dist/providers/ActiveChatProvider.d.ts +2 -0
  207. package/dist/providers/ActiveChatProvider.d.ts.map +1 -1
  208. package/dist/providers/ActiveChatProvider.js +6 -3
  209. package/dist/providers/ActiveChatProvider.js.map +1 -1
  210. package/dist/providers/ActiveDatastoreProvider.d.ts +12 -0
  211. package/dist/providers/ActiveDatastoreProvider.d.ts.map +1 -1
  212. package/dist/providers/ActiveDatastoreProvider.js +114 -11
  213. package/dist/providers/ActiveDatastoreProvider.js.map +1 -1
  214. package/dist/providers/AuthContext.d.ts +1 -0
  215. package/dist/providers/AuthContext.d.ts.map +1 -1
  216. package/dist/providers/AuthContext.js.map +1 -1
  217. package/dist/providers/MantaClientProvider.d.ts.map +1 -1
  218. package/dist/providers/MantaClientProvider.js +3 -3
  219. package/dist/providers/MantaClientProvider.js.map +1 -1
  220. package/dist/providers/index.d.ts +3 -1
  221. package/dist/providers/index.d.ts.map +1 -1
  222. package/dist/providers/index.js +2 -2
  223. package/dist/providers/index.js.map +1 -1
  224. package/dist/routes/activity/detail/ActivityDetailRoute.d.ts.map +1 -1
  225. package/dist/routes/activity/detail/ActivityDetailRoute.js +1 -3
  226. package/dist/routes/activity/detail/ActivityDetailRoute.js.map +1 -1
  227. package/dist/routes/activity/index.d.ts.map +1 -1
  228. package/dist/routes/activity/index.js +1 -3
  229. package/dist/routes/activity/index.js.map +1 -1
  230. package/dist/routes/chat/index.d.ts +2 -21
  231. package/dist/routes/chat/index.d.ts.map +1 -1
  232. package/dist/routes/chat/index.js +4 -2
  233. package/dist/routes/chat/index.js.map +1 -1
  234. package/dist/routes/data-collection/index.d.ts.map +1 -1
  235. package/dist/routes/data-collection/index.js +1 -3
  236. package/dist/routes/data-collection/index.js.map +1 -1
  237. package/dist/routes/data-explorer/components/DataExplorerLayout.d.ts.map +1 -1
  238. package/dist/routes/data-explorer/components/DataExplorerLayout.js +1 -3
  239. package/dist/routes/data-explorer/components/DataExplorerLayout.js.map +1 -1
  240. package/dist/routes/data-explorer/components/class-detail/UsedByRules.js +2 -2
  241. package/dist/routes/data-explorer/components/class-detail/UsedByRules.js.map +1 -1
  242. package/dist/routes/datastores/index.d.ts.map +1 -1
  243. package/dist/routes/datastores/index.js +2 -2
  244. package/dist/routes/datastores/index.js.map +1 -1
  245. package/dist/routes/explain/index.d.ts.map +1 -1
  246. package/dist/routes/explain/index.js +1 -3
  247. package/dist/routes/explain/index.js.map +1 -1
  248. package/dist/routes/integrations/components/connect-forms/DashConnectForm.d.ts.map +1 -1
  249. package/dist/routes/integrations/components/connect-forms/DashConnectForm.js +0 -1
  250. package/dist/routes/integrations/components/connect-forms/DashConnectForm.js.map +1 -1
  251. package/dist/routes/integrations/components/connect-forms/GoogleAdsConnectForm.d.ts.map +1 -1
  252. package/dist/routes/integrations/components/connect-forms/GoogleAdsConnectForm.js +0 -1
  253. package/dist/routes/integrations/components/connect-forms/GoogleAdsConnectForm.js.map +1 -1
  254. package/dist/routes/integrations/components/connect-forms/GoogleAnalyticsConnectForm.d.ts.map +1 -1
  255. package/dist/routes/integrations/components/connect-forms/GoogleAnalyticsConnectForm.js +0 -1
  256. package/dist/routes/integrations/components/connect-forms/GoogleAnalyticsConnectForm.js.map +1 -1
  257. package/dist/routes/integrations/components/connect-forms/GoogleMerchantCenterConnectForm.d.ts.map +1 -1
  258. package/dist/routes/integrations/components/connect-forms/GoogleMerchantCenterConnectForm.js +0 -1
  259. package/dist/routes/integrations/components/connect-forms/GoogleMerchantCenterConnectForm.js.map +1 -1
  260. package/dist/routes/integrations/components/connect-forms/InferalCredentialConnectForm.d.ts +0 -1
  261. package/dist/routes/integrations/components/connect-forms/InferalCredentialConnectForm.d.ts.map +1 -1
  262. package/dist/routes/integrations/components/connect-forms/InferalCredentialConnectForm.js +3 -2
  263. package/dist/routes/integrations/components/connect-forms/InferalCredentialConnectForm.js.map +1 -1
  264. package/dist/routes/integrations/components/connect-forms/KlaviyoConnectForm.d.ts.map +1 -1
  265. package/dist/routes/integrations/components/connect-forms/KlaviyoConnectForm.js +0 -1
  266. package/dist/routes/integrations/components/connect-forms/KlaviyoConnectForm.js.map +1 -1
  267. package/dist/routes/integrations/components/connect-forms/MicrosoftAdsConnectForm.d.ts.map +1 -1
  268. package/dist/routes/integrations/components/connect-forms/MicrosoftAdsConnectForm.js +0 -1
  269. package/dist/routes/integrations/components/connect-forms/MicrosoftAdsConnectForm.js.map +1 -1
  270. package/dist/routes/integrations/components/connect-forms/OAuthSetupConnectForm.d.ts +0 -1
  271. package/dist/routes/integrations/components/connect-forms/OAuthSetupConnectForm.d.ts.map +1 -1
  272. package/dist/routes/integrations/components/connect-forms/OAuthSetupConnectForm.js +4 -3
  273. package/dist/routes/integrations/components/connect-forms/OAuthSetupConnectForm.js.map +1 -1
  274. package/dist/routes/integrations/components/connect-forms/TriplewhaleConnectForm.d.ts.map +1 -1
  275. package/dist/routes/integrations/components/connect-forms/TriplewhaleConnectForm.js +0 -1
  276. package/dist/routes/integrations/components/connect-forms/TriplewhaleConnectForm.js.map +1 -1
  277. package/dist/routes/integrations/components/connect-forms/WoocommerceConnectForm.d.ts.map +1 -1
  278. package/dist/routes/integrations/components/connect-forms/WoocommerceConnectForm.js +0 -1
  279. package/dist/routes/integrations/components/connect-forms/WoocommerceConnectForm.js.map +1 -1
  280. package/dist/routes/integrations/types.d.ts +2 -1
  281. package/dist/routes/integrations/types.d.ts.map +1 -1
  282. package/dist/routes/integrations/types.js +16 -0
  283. package/dist/routes/integrations/types.js.map +1 -1
  284. package/dist/routes/memories/components/DateValueInput.d.ts +16 -0
  285. package/dist/routes/memories/components/DateValueInput.d.ts.map +1 -0
  286. package/dist/routes/memories/components/DateValueInput.js +35 -0
  287. package/dist/routes/memories/components/DateValueInput.js.map +1 -0
  288. package/dist/routes/memories/components/EntityValuePicker.d.ts +11 -0
  289. package/dist/routes/memories/components/EntityValuePicker.d.ts.map +1 -0
  290. package/dist/routes/memories/components/EntityValuePicker.js +61 -0
  291. package/dist/routes/memories/components/EntityValuePicker.js.map +1 -0
  292. package/dist/routes/memories/components/FieldLabel.d.ts +12 -0
  293. package/dist/routes/memories/components/FieldLabel.d.ts.map +1 -0
  294. package/dist/routes/memories/components/FieldLabel.js +12 -0
  295. package/dist/routes/memories/components/FieldLabel.js.map +1 -0
  296. package/dist/routes/memories/components/ImportanceSlider.d.ts +2 -0
  297. package/dist/routes/memories/components/ImportanceSlider.d.ts.map +1 -1
  298. package/dist/routes/memories/components/ImportanceSlider.js +4 -1
  299. package/dist/routes/memories/components/ImportanceSlider.js.map +1 -1
  300. package/dist/routes/memories/components/MemoriesFilters.d.ts +2 -2
  301. package/dist/routes/memories/components/MemoriesFilters.d.ts.map +1 -1
  302. package/dist/routes/memories/components/MemoriesFilters.js.map +1 -1
  303. package/dist/routes/memories/components/MemoriesPanel.d.ts.map +1 -1
  304. package/dist/routes/memories/components/MemoriesPanel.js +4 -0
  305. package/dist/routes/memories/components/MemoriesPanel.js.map +1 -1
  306. package/dist/routes/memories/components/MemoriesTabPanel.d.ts +2 -2
  307. package/dist/routes/memories/components/MemoriesTabPanel.d.ts.map +1 -1
  308. package/dist/routes/memories/components/MemoryActions.d.ts +2 -0
  309. package/dist/routes/memories/components/MemoryActions.d.ts.map +1 -1
  310. package/dist/routes/memories/components/MemoryActions.js +3 -3
  311. package/dist/routes/memories/components/MemoryActions.js.map +1 -1
  312. package/dist/routes/memories/components/MemoryFields.d.ts +15 -3
  313. package/dist/routes/memories/components/MemoryFields.d.ts.map +1 -1
  314. package/dist/routes/memories/components/MemoryFields.js +34 -5
  315. package/dist/routes/memories/components/MemoryFields.js.map +1 -1
  316. package/dist/routes/memories/components/MemoryFormDialog.d.ts +6 -3
  317. package/dist/routes/memories/components/MemoryFormDialog.d.ts.map +1 -1
  318. package/dist/routes/memories/components/MemoryFormDialog.js +105 -59
  319. package/dist/routes/memories/components/MemoryFormDialog.js.map +1 -1
  320. package/dist/routes/memories/components/MemoryPropertyFields.d.ts +10 -0
  321. package/dist/routes/memories/components/MemoryPropertyFields.d.ts.map +1 -0
  322. package/dist/routes/memories/components/MemoryPropertyFields.js +67 -0
  323. package/dist/routes/memories/components/MemoryPropertyFields.js.map +1 -0
  324. package/dist/routes/memories/components/RuleDraftDialog.d.ts +7 -0
  325. package/dist/routes/memories/components/RuleDraftDialog.d.ts.map +1 -0
  326. package/dist/routes/memories/components/RuleDraftDialog.js +20 -0
  327. package/dist/routes/memories/components/RuleDraftDialog.js.map +1 -0
  328. package/dist/routes/memories/components/SchemasTab.d.ts +17 -2
  329. package/dist/routes/memories/components/SchemasTab.d.ts.map +1 -1
  330. package/dist/routes/memories/components/SchemasTab.js +146 -28
  331. package/dist/routes/memories/components/SchemasTab.js.map +1 -1
  332. package/dist/routes/memories/components/badges.d.ts +7 -0
  333. package/dist/routes/memories/components/badges.d.ts.map +1 -1
  334. package/dist/routes/memories/components/badges.js +11 -3
  335. package/dist/routes/memories/components/badges.js.map +1 -1
  336. package/dist/routes/memories/hooks/useMemoryColumns.d.ts +4 -2
  337. package/dist/routes/memories/hooks/useMemoryColumns.d.ts.map +1 -1
  338. package/dist/routes/memories/hooks/useMemoryColumns.js +31 -15
  339. package/dist/routes/memories/hooks/useMemoryColumns.js.map +1 -1
  340. package/dist/routes/memories/index.d.ts +2 -1
  341. package/dist/routes/memories/index.d.ts.map +1 -1
  342. package/dist/routes/memories/index.js +72 -30
  343. package/dist/routes/memories/index.js.map +1 -1
  344. package/dist/routes/memories/memory-mutation-input.d.ts.map +1 -1
  345. package/dist/routes/memories/memory-mutation-input.js +5 -2
  346. package/dist/routes/memories/memory-mutation-input.js.map +1 -1
  347. package/dist/routes/memories/memory-property-values.d.ts +13 -0
  348. package/dist/routes/memories/memory-property-values.d.ts.map +1 -0
  349. package/dist/routes/memories/memory-property-values.js +40 -0
  350. package/dist/routes/memories/memory-property-values.js.map +1 -0
  351. package/dist/routes/memories/schemas/AllowedValuesField.d.ts +14 -0
  352. package/dist/routes/memories/schemas/AllowedValuesField.d.ts.map +1 -0
  353. package/dist/routes/memories/schemas/AllowedValuesField.js +64 -0
  354. package/dist/routes/memories/schemas/AllowedValuesField.js.map +1 -0
  355. package/dist/routes/memories/schemas/MemorySchemaPage.d.ts +127 -0
  356. package/dist/routes/memories/schemas/MemorySchemaPage.d.ts.map +1 -0
  357. package/dist/routes/memories/schemas/MemorySchemaPage.js +285 -0
  358. package/dist/routes/memories/schemas/MemorySchemaPage.js.map +1 -0
  359. package/dist/routes/memories/schemas/SchemaChangeReviewDialog.d.ts +20 -0
  360. package/dist/routes/memories/schemas/SchemaChangeReviewDialog.d.ts.map +1 -0
  361. package/dist/routes/memories/schemas/SchemaChangeReviewDialog.js +54 -0
  362. package/dist/routes/memories/schemas/SchemaChangeReviewDialog.js.map +1 -0
  363. package/dist/routes/memories/schemas/SchemaConfirmDialog.d.ts +15 -0
  364. package/dist/routes/memories/schemas/SchemaConfirmDialog.d.ts.map +1 -0
  365. package/dist/routes/memories/schemas/SchemaConfirmDialog.js +8 -0
  366. package/dist/routes/memories/schemas/SchemaConfirmDialog.js.map +1 -0
  367. package/dist/routes/memories/schemas/SchemaDetailPage.d.ts +15 -0
  368. package/dist/routes/memories/schemas/SchemaDetailPage.d.ts.map +1 -0
  369. package/dist/routes/memories/schemas/SchemaDetailPage.js +74 -0
  370. package/dist/routes/memories/schemas/SchemaDetailPage.js.map +1 -0
  371. package/dist/routes/memories/schemas/SchemaEditorForm.d.ts +10 -0
  372. package/dist/routes/memories/schemas/SchemaEditorForm.d.ts.map +1 -0
  373. package/dist/routes/memories/schemas/SchemaEditorForm.js +242 -0
  374. package/dist/routes/memories/schemas/SchemaEditorForm.js.map +1 -0
  375. package/dist/routes/memories/schemas/SchemaTemplatesDialog.d.ts +13 -0
  376. package/dist/routes/memories/schemas/SchemaTemplatesDialog.d.ts.map +1 -0
  377. package/dist/routes/memories/schemas/SchemaTemplatesDialog.js +13 -0
  378. package/dist/routes/memories/schemas/SchemaTemplatesDialog.js.map +1 -0
  379. package/dist/routes/memories/schemas/ValueTypeSelect.d.ts +12 -0
  380. package/dist/routes/memories/schemas/ValueTypeSelect.d.ts.map +1 -0
  381. package/dist/routes/memories/schemas/ValueTypeSelect.js +10 -0
  382. package/dist/routes/memories/schemas/ValueTypeSelect.js.map +1 -0
  383. package/dist/routes/memories/schemas/schema-form.d.ts +72 -0
  384. package/dist/routes/memories/schemas/schema-form.d.ts.map +1 -0
  385. package/dist/routes/memories/schemas/schema-form.js +279 -0
  386. package/dist/routes/memories/schemas/schema-form.js.map +1 -0
  387. package/dist/routes/memories/schemas/schema-impact.d.ts +13 -0
  388. package/dist/routes/memories/schemas/schema-impact.d.ts.map +1 -0
  389. package/dist/routes/memories/schemas/schema-impact.js +40 -0
  390. package/dist/routes/memories/schemas/schema-impact.js.map +1 -0
  391. package/dist/routes/memories/schemas/schema-route.d.ts +18 -0
  392. package/dist/routes/memories/schemas/schema-route.d.ts.map +1 -0
  393. package/dist/routes/memories/schemas/schema-route.js +21 -0
  394. package/dist/routes/memories/schemas/schema-route.js.map +1 -0
  395. package/dist/routes/memories/schemas/schema-rule-context.d.ts +17 -0
  396. package/dist/routes/memories/schemas/schema-rule-context.d.ts.map +1 -0
  397. package/dist/routes/memories/schemas/schema-rule-context.js +83 -0
  398. package/dist/routes/memories/schemas/schema-rule-context.js.map +1 -0
  399. package/dist/routes/memories/schemas/schema-table.d.ts +11 -0
  400. package/dist/routes/memories/schemas/schema-table.d.ts.map +1 -0
  401. package/dist/routes/memories/schemas/schema-table.js +34 -0
  402. package/dist/routes/memories/schemas/schema-table.js.map +1 -0
  403. package/dist/routes/memories/schemas/useMemorySchemaMutations.d.ts +32 -0
  404. package/dist/routes/memories/schemas/useMemorySchemaMutations.d.ts.map +1 -0
  405. package/dist/routes/memories/schemas/useMemorySchemaMutations.js +31 -0
  406. package/dist/routes/memories/schemas/useMemorySchemaMutations.js.map +1 -0
  407. package/dist/routes/memories/schemas/useSchemaChangeReview.d.ts +51 -0
  408. package/dist/routes/memories/schemas/useSchemaChangeReview.d.ts.map +1 -0
  409. package/dist/routes/memories/schemas/useSchemaChangeReview.js +175 -0
  410. package/dist/routes/memories/schemas/useSchemaChangeReview.js.map +1 -0
  411. package/dist/routes/memories/schemas/useSchemaLifecycle.d.ts +46 -0
  412. package/dist/routes/memories/schemas/useSchemaLifecycle.d.ts.map +1 -0
  413. package/dist/routes/memories/schemas/useSchemaLifecycle.js +93 -0
  414. package/dist/routes/memories/schemas/useSchemaLifecycle.js.map +1 -0
  415. package/dist/routes/memories/schemas/useSchemasTab.d.ts +18 -0
  416. package/dist/routes/memories/schemas/useSchemasTab.d.ts.map +1 -0
  417. package/dist/routes/memories/schemas/useSchemasTab.js +92 -0
  418. package/dist/routes/memories/schemas/useSchemasTab.js.map +1 -0
  419. package/dist/routes/plans/index.d.ts.map +1 -1
  420. package/dist/routes/plans/index.js +2 -2
  421. package/dist/routes/plans/index.js.map +1 -1
  422. package/dist/routes/rules/components/CreateRuleChatModal.d.ts +7 -1
  423. package/dist/routes/rules/components/CreateRuleChatModal.d.ts.map +1 -1
  424. package/dist/routes/rules/components/CreateRuleChatModal.js +9 -4
  425. package/dist/routes/rules/components/CreateRuleChatModal.js.map +1 -1
  426. package/dist/routes/rules/components/RuleValueControls.d.ts.map +1 -1
  427. package/dist/routes/rules/components/RuleValueControls.js +3 -24
  428. package/dist/routes/rules/components/RuleValueControls.js.map +1 -1
  429. package/dist/routes/rules/components/rule-value-input.d.ts +11 -0
  430. package/dist/routes/rules/components/rule-value-input.d.ts.map +1 -0
  431. package/dist/routes/rules/components/rule-value-input.js +24 -0
  432. package/dist/routes/rules/components/rule-value-input.js.map +1 -0
  433. package/dist/routes/rules/components/rules.utils.d.ts +5 -0
  434. package/dist/routes/rules/components/rules.utils.d.ts.map +1 -1
  435. package/dist/routes/rules/components/rules.utils.js +18 -3
  436. package/dist/routes/rules/components/rules.utils.js.map +1 -1
  437. package/dist/routes/rules/pages.d.ts +1 -1
  438. package/dist/routes/rules/pages.d.ts.map +1 -1
  439. package/dist/routes/rules/pages.js +1 -1
  440. package/dist/routes/rules/pages.js.map +1 -1
  441. package/dist/shared/graph-derived-queries.d.ts.map +1 -1
  442. package/dist/shared/graph-derived-queries.js +4 -1
  443. package/dist/shared/graph-derived-queries.js.map +1 -1
  444. package/dist/worker/index.d.ts +22 -0
  445. package/dist/worker/index.d.ts.map +1 -0
  446. package/dist/worker/index.js +110 -0
  447. package/dist/worker/index.js.map +1 -0
  448. package/dist/worker/policy.d.ts +21 -0
  449. package/dist/worker/policy.d.ts.map +1 -0
  450. package/dist/worker/policy.js +42 -0
  451. package/dist/worker/policy.js.map +1 -0
  452. package/dist/worker/proxy.d.ts +14 -0
  453. package/dist/worker/proxy.d.ts.map +1 -0
  454. package/dist/worker/proxy.js +58 -0
  455. package/dist/worker/proxy.js.map +1 -0
  456. package/dist/worker/session.d.ts +24 -0
  457. package/dist/worker/session.d.ts.map +1 -0
  458. package/dist/worker/session.js +72 -0
  459. package/dist/worker/session.js.map +1 -0
  460. package/package.json +52 -7
  461. package/src/app-subpaths.json +9 -1
  462. package/src/components/AppErrorBoundary.tsx +14 -11
  463. package/src/components/app-gate/AppGate.tsx +122 -0
  464. package/src/components/app-gate/AwaitingDatastoreStatus.tsx +35 -0
  465. package/src/components/app-gate/EnterDatastoreRoute.tsx +30 -0
  466. package/src/components/app-gate/ErrorRoute.tsx +43 -0
  467. package/src/components/app-gate/FailureAlert.tsx +15 -0
  468. package/src/components/app-gate/NoDatastoreAccess.tsx +26 -0
  469. package/src/components/app-gate/NotFoundRoute.tsx +20 -0
  470. package/src/components/app-gate/PendingInvitations.tsx +134 -0
  471. package/src/components/app-gate/ServiceError.tsx +27 -0
  472. package/src/components/app-gate/index.ts +2 -0
  473. package/src/components/app-gate/sdk-route-elements.tsx +46 -0
  474. package/src/components/app-shell/AppShell.tsx +22 -0
  475. package/src/components/app-shell/AppShellRoutes.tsx +34 -0
  476. package/src/components/app-shell/GroupDatastores.tsx +28 -0
  477. package/src/components/app-shell/GroupRoute.tsx +34 -0
  478. package/src/components/app-shell/index.ts +2 -0
  479. package/src/components/authenticated-chat/index.tsx +1 -34
  480. package/src/components/chat-view/Chat.tsx +9 -3
  481. package/src/components/chat-view/MessageItem.tsx +10 -2
  482. package/src/components/chat-view/tool-part-rendering.ts +10 -1
  483. package/src/components/chip/index.tsx +8 -1
  484. package/src/components/embedded-chat/index.tsx +2 -1
  485. package/src/components/input/input-date-time.tsx +10 -3
  486. package/src/components/input/input-date.tsx +93 -21
  487. package/src/components/input/input-time.tsx +59 -26
  488. package/src/components/layouts/RouteLayout.tsx +11 -50
  489. package/src/components/layouts/Sidebar.tsx +21 -23
  490. package/src/components/plan-limits/PlanLimitsDialog.tsx +331 -0
  491. package/src/components/plan-limits/index.tsx +3 -0
  492. package/src/components/plan-limits/plan-limits-client.ts +71 -0
  493. package/src/components/plan-limits/plan-limits-model.ts +180 -0
  494. package/src/components/plan-limits/plan-limits-save.ts +68 -0
  495. package/src/components/planning/PlanLimitsAction.tsx +44 -0
  496. package/src/components/slider/index.tsx +2 -1
  497. package/src/datastore-picker/datastore-picker-rows.ts +36 -20
  498. package/src/hooks/use-action-plans-list.ts +20 -12
  499. package/src/hooks/use-activity-feed.ts +30 -14
  500. package/src/hooks/use-entity.ts +11 -6
  501. package/src/hooks/use-manual-actions.ts +11 -6
  502. package/src/hooks/use-unsaved-changes-warning.ts +12 -0
  503. package/src/hooks/useAuth.ts +5 -3
  504. package/src/hooks/useChatPanelSync.ts +2 -3
  505. package/src/hooks/useDatastoreSelection.ts +10 -4
  506. package/src/hooks/useExecuteAction.ts +2 -0
  507. package/src/hooks/useLoginRedirect.ts +66 -0
  508. package/src/hooks/usePlanLimits.ts +97 -0
  509. package/src/ldo-ui.ts +1 -0
  510. package/src/lib/app-tools.ts +63 -0
  511. package/src/lib/chat-types.ts +5 -0
  512. package/src/lib/datastore-route-table.ts +9 -0
  513. package/src/lib/graphql-error.ts +7 -0
  514. package/src/lib/update-notice.ts +12 -2
  515. package/src/providers/ActiveChatProvider.tsx +8 -3
  516. package/src/providers/ActiveDatastoreProvider.tsx +179 -9
  517. package/src/providers/AuthContext.ts +1 -0
  518. package/src/providers/MantaClientProvider.tsx +8 -3
  519. package/src/providers/index.tsx +7 -4
  520. package/src/routes/activity/detail/ActivityDetailRoute.tsx +1 -10
  521. package/src/routes/activity/index.tsx +1 -10
  522. package/src/routes/chat/index.tsx +11 -47
  523. package/src/routes/data-collection/index.tsx +1 -11
  524. package/src/routes/data-explorer/components/DataExplorerLayout.tsx +1 -11
  525. package/src/routes/data-explorer/components/class-detail/UsedByRules.tsx +2 -2
  526. package/src/routes/datastores/index.tsx +3 -9
  527. package/src/routes/explain/index.tsx +1 -11
  528. package/src/routes/integrations/components/connect-forms/DashConnectForm.tsx +0 -1
  529. package/src/routes/integrations/components/connect-forms/GoogleAdsConnectForm.tsx +0 -1
  530. package/src/routes/integrations/components/connect-forms/GoogleAnalyticsConnectForm.tsx +0 -1
  531. package/src/routes/integrations/components/connect-forms/GoogleMerchantCenterConnectForm.tsx +0 -1
  532. package/src/routes/integrations/components/connect-forms/InferalCredentialConnectForm.tsx +5 -3
  533. package/src/routes/integrations/components/connect-forms/KlaviyoConnectForm.tsx +0 -1
  534. package/src/routes/integrations/components/connect-forms/MicrosoftAdsConnectForm.tsx +0 -1
  535. package/src/routes/integrations/components/connect-forms/OAuthSetupConnectForm.tsx +7 -7
  536. package/src/routes/integrations/components/connect-forms/TriplewhaleConnectForm.tsx +0 -1
  537. package/src/routes/integrations/components/connect-forms/WoocommerceConnectForm.tsx +0 -1
  538. package/src/routes/integrations/types.ts +22 -6
  539. package/src/routes/memories/components/DateValueInput.tsx +72 -0
  540. package/src/routes/memories/components/EntityValuePicker.tsx +132 -0
  541. package/src/routes/memories/components/FieldLabel.tsx +49 -0
  542. package/src/routes/memories/components/ImportanceSlider.tsx +5 -1
  543. package/src/routes/memories/components/MemoriesFilters.tsx +2 -2
  544. package/src/routes/memories/components/MemoriesPanel.tsx +7 -3
  545. package/src/routes/memories/components/MemoriesTabPanel.tsx +2 -2
  546. package/src/routes/memories/components/MemoryActions.tsx +26 -2
  547. package/src/routes/memories/components/MemoryFields.tsx +75 -12
  548. package/src/routes/memories/components/MemoryFormDialog.tsx +305 -199
  549. package/src/routes/memories/components/MemoryPropertyFields.tsx +288 -0
  550. package/src/routes/memories/components/RuleDraftDialog.tsx +35 -0
  551. package/src/routes/memories/components/SchemasTab.tsx +481 -118
  552. package/src/routes/memories/components/badges.tsx +16 -4
  553. package/src/routes/memories/hooks/useMemoryColumns.tsx +69 -35
  554. package/src/routes/memories/index.tsx +125 -51
  555. package/src/routes/memories/memory-mutation-input.ts +5 -2
  556. package/src/routes/memories/memory-property-values.ts +83 -0
  557. package/src/routes/memories/schemas/AllowedValuesField.tsx +188 -0
  558. package/src/routes/memories/schemas/MemorySchemaPage.tsx +476 -0
  559. package/src/routes/memories/schemas/SchemaChangeReviewDialog.tsx +290 -0
  560. package/src/routes/memories/schemas/SchemaConfirmDialog.tsx +62 -0
  561. package/src/routes/memories/schemas/SchemaDetailPage.tsx +373 -0
  562. package/src/routes/memories/schemas/SchemaEditorForm.tsx +990 -0
  563. package/src/routes/memories/schemas/SchemaTemplatesDialog.tsx +81 -0
  564. package/src/routes/memories/schemas/ValueTypeSelect.tsx +37 -0
  565. package/src/routes/memories/schemas/schema-form.ts +360 -0
  566. package/src/routes/memories/schemas/schema-impact.ts +66 -0
  567. package/src/routes/memories/schemas/schema-route.ts +30 -0
  568. package/src/routes/memories/schemas/schema-rule-context.ts +103 -0
  569. package/src/routes/memories/schemas/schema-table.ts +54 -0
  570. package/src/routes/memories/schemas/useMemorySchemaMutations.ts +49 -0
  571. package/src/routes/memories/schemas/useSchemaChangeReview.ts +238 -0
  572. package/src/routes/memories/schemas/useSchemaLifecycle.tsx +151 -0
  573. package/src/routes/memories/schemas/useSchemasTab.ts +119 -0
  574. package/src/routes/plans/index.tsx +3 -14
  575. package/src/routes/rules/components/CreateRuleChatModal.tsx +46 -22
  576. package/src/routes/rules/components/RuleValueControls.tsx +3 -35
  577. package/src/routes/rules/components/rule-value-input.ts +34 -0
  578. package/src/routes/rules/components/rules.utils.ts +25 -3
  579. package/src/routes/rules/pages.ts +5 -1
  580. package/src/shared/graph-derived-queries.ts +6 -0
  581. package/src/themes/manta-dark.css +4 -0
  582. package/src/worker/index.ts +175 -0
  583. package/src/worker/policy.ts +62 -0
  584. package/src/worker/proxy.ts +101 -0
  585. package/src/worker/session.ts +111 -0
@@ -0,0 +1,279 @@
1
+ import { GQLMemoryKind, GQLMemorySchemaValueType, GQLMemoryScope, GQLMemoryVolatility, } from "@manta-eu/client";
2
+ import { memorySchemaLimits } from "@manta-eu/client/shared/memory-schema-limits";
3
+ import { checkMemorySchemaProperty, deriveMemoryPropertyKey, memoryPropertyKeyProblem, } from "@manta-eu/client/shared/memory-schema-property";
4
+ import { memorySchemaValueTypes, parseMemoryValue, } from "@manta-eu/client/shared/memory-schema-values";
5
+ import { humanCount } from "@manta-eu/lib/humanize";
6
+ import { isPresent } from "@manta-eu/lib/present";
7
+ let compilePattern = null;
8
+ // RE2 is large, so it loads with the schema editor rather than with the app. Until it has, only the server checks a
9
+ // pattern, and it does so again on every save anyway.
10
+ export async function loadPatternCheck() {
11
+ compilePattern ??= (await import("@manta-eu/client/shared/memory-schema-pattern")).compileMemoryValuePattern;
12
+ }
13
+ export const memorySchemaPropertyLimit = memorySchemaLimits.properties;
14
+ export const memorySchemaOptionLimit = memorySchemaLimits.options;
15
+ export const kindLabels = {
16
+ [GQLMemoryKind.Fact]: "Fact",
17
+ [GQLMemoryKind.Preference]: "Preference",
18
+ [GQLMemoryKind.Objective]: "Objective",
19
+ [GQLMemoryKind.Context]: "Context",
20
+ };
21
+ export const volatilityLabels = {
22
+ [GQLMemoryVolatility.Stable]: "Stable",
23
+ [GQLMemoryVolatility.Slow]: "Changes slowly",
24
+ [GQLMemoryVolatility.Volatile]: "Changes often",
25
+ };
26
+ export const scopeLabels = {
27
+ [GQLMemoryScope.User]: "Personal",
28
+ [GQLMemoryScope.Team]: "Team",
29
+ [GQLMemoryScope.Company]: "Company",
30
+ };
31
+ export const valueTypeLabels = {
32
+ [GQLMemorySchemaValueType.Text]: "Text",
33
+ [GQLMemorySchemaValueType.LongText]: "Long text",
34
+ [GQLMemorySchemaValueType.Integer]: "Whole number",
35
+ [GQLMemorySchemaValueType.Decimal]: "Decimal number",
36
+ [GQLMemorySchemaValueType.Boolean]: "Yes / no",
37
+ [GQLMemorySchemaValueType.Date]: "Date",
38
+ [GQLMemorySchemaValueType.DateTime]: "Date and time",
39
+ [GQLMemorySchemaValueType.Url]: "Web address",
40
+ [GQLMemorySchemaValueType.Entity]: "Linked record",
41
+ };
42
+ const boundTypes = [
43
+ GQLMemorySchemaValueType.Integer,
44
+ GQLMemorySchemaValueType.Decimal,
45
+ GQLMemorySchemaValueType.Date,
46
+ GQLMemorySchemaValueType.DateTime,
47
+ ];
48
+ const textTypes = [
49
+ GQLMemorySchemaValueType.Text,
50
+ GQLMemorySchemaValueType.LongText,
51
+ ];
52
+ const numberTypes = [
53
+ GQLMemorySchemaValueType.Integer,
54
+ GQLMemorySchemaValueType.Decimal,
55
+ ];
56
+ // Mirrors which settings the server accepts per type, so switching type never sends one it would refuse.
57
+ export function propertySettings(valueType) {
58
+ return {
59
+ options: valueType === GQLMemorySchemaValueType.Text,
60
+ bounds: boundTypes.includes(valueType),
61
+ maxLength: [...textTypes, GQLMemorySchemaValueType.Url].includes(valueType),
62
+ pattern: textTypes.includes(valueType),
63
+ unit: numberTypes.includes(valueType),
64
+ entityClass: valueType === GQLMemorySchemaValueType.Entity,
65
+ keyProperty: valueType !== GQLMemorySchemaValueType.LongText,
66
+ };
67
+ }
68
+ // Only what the save keeps for this type, so a setting left behind by a type switch is not shown as in effect.
69
+ export function propertyTags(property) {
70
+ const settings = propertySettings(property.valueType);
71
+ return [
72
+ property.computed ? "Computed" : property.required ? "Required" : "",
73
+ property.multiValued ? "List" : "",
74
+ settings.keyProperty && property.keyProperty && !property.multiValued && !property.computed ? "Identifies" : "",
75
+ settings.unit ? property.unit.trim() : "",
76
+ settings.options && isPresent(property.options) ? humanCount(property.options.length, "allowed value") : "",
77
+ ].filter(isPresent);
78
+ }
79
+ export function withValueType(property, valueType) {
80
+ const type = memorySchemaValueTypes.find((candidate) => candidate === valueType);
81
+ const kept = (raw) => (type !== undefined && parseMemoryValue(type, raw) !== null ? raw : "");
82
+ return {
83
+ ...property,
84
+ valueType,
85
+ minValue: kept(property.minValue),
86
+ maxValue: kept(property.maxValue),
87
+ defaultValue: kept(property.defaultValue),
88
+ };
89
+ }
90
+ export function newFormId() {
91
+ return crypto.randomUUID();
92
+ }
93
+ export function emptyPropertyForm() {
94
+ return {
95
+ id: newFormId(),
96
+ path: null,
97
+ key: "",
98
+ label: "",
99
+ description: "",
100
+ valueType: GQLMemorySchemaValueType.Text,
101
+ entityClass: "",
102
+ required: false,
103
+ multiValued: false,
104
+ keyProperty: false,
105
+ computed: false,
106
+ options: [],
107
+ minValue: "",
108
+ maxValue: "",
109
+ maxLength: "",
110
+ pattern: "",
111
+ defaultValue: "",
112
+ unit: "",
113
+ };
114
+ }
115
+ export function emptySchemaForm() {
116
+ return {
117
+ key: "",
118
+ label: "",
119
+ description: "",
120
+ defaultMemoryKind: null,
121
+ defaultVolatility: null,
122
+ defaultImportance: null,
123
+ defaultScope: null,
124
+ extractionEnabled: true,
125
+ extractionGuidance: "",
126
+ properties: [],
127
+ };
128
+ }
129
+ export function schemaFormFromSchema(schema) {
130
+ return {
131
+ key: "",
132
+ label: schema.label,
133
+ description: schema.description ?? "",
134
+ defaultMemoryKind: schema.defaultMemoryKind ?? null,
135
+ defaultVolatility: schema.defaultVolatility ?? null,
136
+ defaultImportance: schema.defaultImportance ?? null,
137
+ defaultScope: schema.defaultScope ?? null,
138
+ extractionEnabled: schema.extractionEnabled,
139
+ extractionGuidance: schema.extractionGuidance ?? "",
140
+ properties: [...schema.properties]
141
+ .sort((a, b) => a.order - b.order)
142
+ .map((property) => ({
143
+ id: newFormId(),
144
+ path: property.path,
145
+ key: "",
146
+ label: property.label,
147
+ description: property.description ?? "",
148
+ valueType: property.valueType,
149
+ entityClass: property.entityClass ?? "",
150
+ required: property.required,
151
+ multiValued: property.multiValued,
152
+ keyProperty: property.keyProperty,
153
+ computed: property.computed,
154
+ options: property.options.map((option) => ({
155
+ id: newFormId(),
156
+ value: option.value,
157
+ label: option.label ?? "",
158
+ description: option.description ?? "",
159
+ })),
160
+ minValue: property.minValue ?? "",
161
+ maxValue: property.maxValue ?? "",
162
+ maxLength: property.maxLength != null ? String(property.maxLength) : "",
163
+ pattern: property.pattern ?? "",
164
+ defaultValue: property.defaultValue ?? "",
165
+ unit: property.unit ?? "",
166
+ })),
167
+ };
168
+ }
169
+ function textOrNull(value) {
170
+ const trimmed = value.trim();
171
+ return isPresent(trimmed) ? trimmed : null;
172
+ }
173
+ function maxLengthOrNull(value) {
174
+ const trimmed = value.trim();
175
+ return isPresent(trimmed) && /^\d+$/.test(trimmed) ? Number(trimmed) : null;
176
+ }
177
+ function propertyInput(property) {
178
+ const settings = propertySettings(property.valueType);
179
+ const key = textOrNull(property.key);
180
+ return {
181
+ ...(property.path !== null ? { path: property.path } : key !== null ? { key } : {}),
182
+ label: property.label.trim(),
183
+ description: textOrNull(property.description),
184
+ valueType: property.valueType,
185
+ entityClass: settings.entityClass ? textOrNull(property.entityClass) : null,
186
+ required: property.required && !property.computed,
187
+ multiValued: property.multiValued,
188
+ keyProperty: settings.keyProperty && property.keyProperty && !property.multiValued && !property.computed,
189
+ computed: property.computed,
190
+ options: settings.options
191
+ ? property.options.map((option) => ({
192
+ value: option.value.trim(),
193
+ label: textOrNull(option.label),
194
+ description: textOrNull(option.description),
195
+ }))
196
+ : [],
197
+ minValue: settings.bounds ? textOrNull(property.minValue) : null,
198
+ maxValue: settings.bounds ? textOrNull(property.maxValue) : null,
199
+ maxLength: settings.maxLength ? maxLengthOrNull(property.maxLength) : null,
200
+ pattern: settings.pattern ? textOrNull(property.pattern) : null,
201
+ defaultValue: property.computed ? null : textOrNull(property.defaultValue),
202
+ unit: settings.unit ? textOrNull(property.unit) : null,
203
+ };
204
+ }
205
+ export function schemaDefinitionInput(form, options) {
206
+ const key = textOrNull(form.key);
207
+ return {
208
+ ...(options.isNew && key !== null ? { key } : {}),
209
+ label: form.label.trim(),
210
+ description: textOrNull(form.description),
211
+ defaultMemoryKind: form.defaultMemoryKind,
212
+ defaultVolatility: form.defaultVolatility,
213
+ defaultImportance: form.defaultImportance,
214
+ defaultScope: form.defaultScope,
215
+ extractionEnabled: form.extractionEnabled,
216
+ extractionGuidance: form.extractionEnabled ? textOrNull(form.extractionGuidance) : null,
217
+ properties: form.properties.map(propertyInput),
218
+ };
219
+ }
220
+ export function propertyFormErrors(property, prefix, siblings = []) {
221
+ const errors = new Map();
222
+ function add(field, message) {
223
+ if (!errors.has(field))
224
+ errors.set(field, message);
225
+ }
226
+ const maxLength = property.maxLength.trim();
227
+ if (propertySettings(property.valueType).maxLength && isPresent(maxLength) && !/^\d+$/.test(maxLength)) {
228
+ add(`${prefix}.maxLength`, "The maximum length must be a whole number");
229
+ }
230
+ for (const error of checkMemorySchemaProperty(propertyInput(property), prefix, compilePattern).errors)
231
+ add(error.field, error.message);
232
+ const label = property.label.trim();
233
+ const key = textOrNull(property.key);
234
+ if (property.path === null && (key !== null || isPresent(label))) {
235
+ const problem = memoryPropertyKeyProblem(key ?? deriveMemoryPropertyKey(label));
236
+ if (problem !== null)
237
+ add(`${prefix}.key`, problem);
238
+ }
239
+ if (isPresent(label)) {
240
+ const clash = siblings.find((other) => other.id !== property.id && other.label.trim().toLowerCase() === label.toLowerCase());
241
+ if (clash !== undefined)
242
+ add(`${prefix}.label`, "Another property already uses this label");
243
+ }
244
+ return errors;
245
+ }
246
+ export function localSchemaFormErrors(form) {
247
+ const errors = new Map();
248
+ form.properties.forEach((property, index) => {
249
+ for (const [field, message] of propertyFormErrors(property, propertyErrorPrefix(index), form.properties)) {
250
+ errors.set(field, message);
251
+ }
252
+ });
253
+ return errors;
254
+ }
255
+ // The server names a field by its place in the submitted definition, e.g. `properties.2.options.0.value`.
256
+ export function schemaFormErrors(errors) {
257
+ const byField = new Map();
258
+ for (const { field, message } of errors) {
259
+ if (!byField.has(field))
260
+ byField.set(field, message);
261
+ }
262
+ return byField;
263
+ }
264
+ export function propertyErrorPrefix(index) {
265
+ return `properties.${index}`;
266
+ }
267
+ export function hasErrorsUnder(errors, prefix) {
268
+ return [...errors.keys()].some((field) => field === prefix || field.startsWith(`${prefix}.`));
269
+ }
270
+ export function moveItem(items, from, to) {
271
+ if (to < 0 || to >= items.length || from === to)
272
+ return [...items];
273
+ const next = [...items];
274
+ const [moved] = next.splice(from, 1);
275
+ if (moved !== undefined)
276
+ next.splice(to, 0, moved);
277
+ return next;
278
+ }
279
+ //# sourceMappingURL=schema-form.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-form.js","sourceRoot":"","sources":["../../../../src/routes/memories/schemas/schema-form.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,wBAAwB,EACxB,cAAc,EACd,mBAAmB,GAKpB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,8CAA8C,CAAC;AAClF,OAAO,EACL,yBAAyB,EACzB,uBAAuB,EACvB,wBAAwB,GACzB,MAAM,gDAAgD,CAAC;AACxD,OAAO,EACL,sBAAsB,EACtB,gBAAgB,GAEjB,MAAM,8CAA8C,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,IAAI,cAAc,GAAqC,IAAI,CAAC;AAE5D,oHAAoH;AACpH,sDAAsD;AACt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,GAAG,CAAC,CAAC,CAAC;AAChG,CAAC;AAED,MAAM,UAAU,QAAQ,CAAI,KAAmB,EAAE,IAAY,EAAE,EAAU;IACvE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,IAAI,KAAK,CAAC,MAAM,IAAI,IAAI,KAAK,EAAE;QAAE,OAAO,CAAC,GAAG,KAAK,CAAC,CAAC;IACnE,MAAM,IAAI,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC;IACxB,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IACrC,IAAI,KAAK,KAAK,SAAS;QAAE,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC;IACnD,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,13 @@
1
+ import type { GQLMemorySchemaFieldsFragment, GQLMemorySchemaMutationResultFragment, GQLMemorySchemaOptionRemapInput } from "@manta-eu/client";
2
+ export type MemorySchemaImpact = NonNullable<GQLMemorySchemaMutationResultFragment["impact"]>;
3
+ export type RemovedOptionInUse = MemorySchemaImpact["removedOptions"][number];
4
+ export type OptionRemapChoices = Record<string, string>;
5
+ export declare const clearValueChoice = "__clear__";
6
+ export declare function readableBlockers(impact: Pick<MemorySchemaImpact, "blockers" | "ruleReferences">): string[];
7
+ export declare function remapChoiceKey(option: Pick<RemovedOptionInUse, "path" | "value">): string;
8
+ export declare function impactNeedsReview(impact: MemorySchemaImpact): boolean;
9
+ export declare function removedOptionsInUse(impact: MemorySchemaImpact): RemovedOptionInUse[];
10
+ export declare function remapTargets(proposed: GQLMemorySchemaFieldsFragment | null | undefined, path: string): string[];
11
+ export declare function optionRemapsInput(impact: MemorySchemaImpact, choices: OptionRemapChoices): GQLMemorySchemaOptionRemapInput[];
12
+ export declare function hasInvalidValues(impact: MemorySchemaImpact): boolean;
13
+ //# sourceMappingURL=schema-impact.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-impact.d.ts","sourceRoot":"","sources":["../../../../src/routes/memories/schemas/schema-impact.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,6BAA6B,EAC7B,qCAAqC,EACrC,+BAA+B,EAChC,MAAM,kBAAkB,CAAC;AAI1B,MAAM,MAAM,kBAAkB,GAAG,WAAW,CAAC,qCAAqC,CAAC,QAAQ,CAAC,CAAC,CAAC;AAE9F,MAAM,MAAM,kBAAkB,GAAG,kBAAkB,CAAC,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE9E,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAExD,eAAO,MAAM,gBAAgB,cAAc,CAAC;AAG5C,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,IAAI,CAAC,kBAAkB,EAAE,UAAU,GAAG,gBAAgB,CAAC,GAAG,MAAM,EAAE,CAO1G;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,IAAI,CAAC,kBAAkB,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,MAAM,CAEzF;AAGD,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAWrE;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,kBAAkB,GAAG,kBAAkB,EAAE,CAEpF;AAED,wBAAgB,YAAY,CAAC,QAAQ,EAAE,6BAA6B,GAAG,IAAI,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAE/G;AAED,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,kBAAkB,EAC1B,OAAO,EAAE,kBAAkB,GAC1B,+BAA+B,EAAE,CAMnC;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAEpE"}
@@ -0,0 +1,40 @@
1
+ import { isPresent } from "@manta-eu/lib/present";
2
+ import { getRuleDisplayName } from "#routes/rules/components/rules.utils";
3
+ export const clearValueChoice = "__clear__";
4
+ // Longest IRI first, so a rule IRI that is a prefix of another never rewrites part of the longer one.
5
+ export function readableBlockers(impact) {
6
+ const ruleIris = [...new Set(impact.ruleReferences.map((reference) => reference.ruleIri))].sort((a, b) => b.length - a.length);
7
+ return impact.blockers.map((blocker) => ruleIris.reduce((text, ruleIri) => text.split(ruleIri).join(getRuleDisplayName(ruleIri)), blocker));
8
+ }
9
+ export function remapChoiceKey(option) {
10
+ return `${option.path}\u0000${option.value}`;
11
+ }
12
+ // A change that moves no stored value and names no rule can be saved without a review step.
13
+ export function impactNeedsReview(impact) {
14
+ return (isPresent(impact.blockers) ||
15
+ isPresent(impact.ruleReferences) ||
16
+ impact.removedProperties.some((property) => property.memoryCount > 0) ||
17
+ impact.typeChanges.some((change) => change.valueCount > 0) ||
18
+ impact.removedOptions.some((option) => option.memoryCount > 0) ||
19
+ isPresent(impact.limitViolations) ||
20
+ isPresent(impact.multiValueConflicts) ||
21
+ impact.clearedValues.some((property) => property.memoryCount > 0));
22
+ }
23
+ export function removedOptionsInUse(impact) {
24
+ return impact.removedOptions.filter((option) => option.memoryCount > 0);
25
+ }
26
+ export function remapTargets(proposed, path) {
27
+ return proposed?.properties.find((property) => property.path === path)?.allowedValues ?? [];
28
+ }
29
+ export function optionRemapsInput(impact, choices) {
30
+ return removedOptionsInUse(impact).flatMap((option) => {
31
+ const choice = choices[remapChoiceKey(option)];
32
+ if (choice === undefined)
33
+ return [];
34
+ return [{ path: option.path, from: option.value, to: choice === clearValueChoice ? null : choice }];
35
+ });
36
+ }
37
+ export function hasInvalidValues(impact) {
38
+ return impact.typeChanges.some((change) => change.unconvertibleCount > 0) || isPresent(impact.limitViolations);
39
+ }
40
+ //# sourceMappingURL=schema-impact.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-impact.js","sourceRoot":"","sources":["../../../../src/routes/memories/schemas/schema-impact.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,C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,OAAO,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,kBAAkB,GAAG,CAAC,CAAC,IAAI,SAAS,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;AACjH,CAAC"}
@@ -0,0 +1,18 @@
1
+ export declare const memorySchemasPath = "/memories?tab=schemas";
2
+ export declare const newMemorySchemaPath = "/memories/schemas/new";
3
+ export declare function memorySchemaPath(iri: string): string;
4
+ export declare function memorySchemaEditPath(iri: string): string;
5
+ export declare function findMemorySchemaByRouteName<T extends {
6
+ iri: string;
7
+ }>(schemas: readonly T[], routeName: string): T | null;
8
+ export type MemorySchemaView = {
9
+ kind: "new";
10
+ } | {
11
+ kind: "detail";
12
+ routeName: string;
13
+ } | {
14
+ kind: "edit";
15
+ routeName: string;
16
+ };
17
+ export declare function memorySchemaView(pathname: string, schemaName: string | undefined): MemorySchemaView | null;
18
+ //# sourceMappingURL=schema-route.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-route.d.ts","sourceRoot":"","sources":["../../../../src/routes/memories/schemas/schema-route.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,0BAA0B,CAAC;AACzD,eAAO,MAAM,mBAAmB,0BAA0B,CAAC;AAG3D,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAExD;AAED,wBAAgB,2BAA2B,CAAC,CAAC,SAAS;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,EACnE,OAAO,EAAE,SAAS,CAAC,EAAE,EACrB,SAAS,EAAE,MAAM,GAChB,CAAC,GAAG,IAAI,CAEV;AAED,MAAM,MAAM,gBAAgB,GACxB;IAAE,IAAI,EAAE,KAAK,CAAA;CAAE,GACf;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GACrC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC;AAExC,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,SAAS,GAAG,gBAAgB,GAAG,IAAI,CAK1G"}
@@ -0,0 +1,21 @@
1
+ export const memorySchemasPath = "/memories?tab=schemas";
2
+ export const newMemorySchemaPath = "/memories/schemas/new";
3
+ // The whole IRI names the page: IRIs are opaque, so no part of one is a name to route by.
4
+ export function memorySchemaPath(iri) {
5
+ return `/memories/schemas/${encodeURIComponent(iri)}`;
6
+ }
7
+ export function memorySchemaEditPath(iri) {
8
+ return `${memorySchemaPath(iri)}/edit`;
9
+ }
10
+ export function findMemorySchemaByRouteName(schemas, routeName) {
11
+ return schemas.find((schema) => schema.iri === routeName) ?? null;
12
+ }
13
+ export function memorySchemaView(pathname, schemaName) {
14
+ const path = pathname.replace(/\/+$/, "");
15
+ if (path.endsWith(newMemorySchemaPath))
16
+ return { kind: "new" };
17
+ if (schemaName === undefined || !path.includes("/memories/schemas/"))
18
+ return null;
19
+ return path.endsWith("/edit") ? { kind: "edit", routeName: schemaName } : { kind: "detail", routeName: schemaName };
20
+ }
21
+ //# sourceMappingURL=schema-route.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-route.js","sourceRoot":"","sources":["../../../../src/routes/memories/schemas/schema-route.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,iBAAiB,GAAG,uBAAuB,CAAC;AACzD,MAAM,CAAC,MAAM,mBAAmB,GAAG,uBAAuB,CAAC;AAE3D,0FAA0F;AAC1F,MAAM,UAAU,gBAAgB,CAAC,GAAW;IAC1C,OAAO,qBAAqB,kBAAkB,CAAC,GAAG,CAAC,EAAE,CAAC;AACxD,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,GAAW;IAC9C,OAAO,GAAG,gBAAgB,CAAC,GAAG,CAAC,OAAO,CAAC;AACzC,CAAC;AAED,MAAM,UAAU,2BAA2B,CACzC,OAAqB,EACrB,SAAiB;IAEjB,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,KAAK,SAAS,CAAC,IAAI,IAAI,CAAC;AACpE,CAAC;AAOD,MAAM,UAAU,gBAAgB,CAAC,QAAgB,EAAE,UAA8B;IAC/E,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAC1C,IAAI,IAAI,CAAC,QAAQ,CAAC,mBAAmB,CAAC;QAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;IAC/D,IAAI,UAAU,KAAK,SAAS,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,oBAAoB,CAAC;QAAE,OAAO,IAAI,CAAC;IAClF,OAAO,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC;AACtH,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { type GQLMemory, type GQLMemorySchemaFieldsFragment, type GQLMemorySchemaPropertyFieldsFragment } from "@manta-eu/client";
2
+ import type { CreateRuleChatSubject } from "#routes/rules/components/CreateRuleChatModal";
3
+ export type RuleDraftRequest = {
4
+ key: string;
5
+ subject: CreateRuleChatSubject;
6
+ suggestions: string[];
7
+ };
8
+ type Schema = GQLMemorySchemaFieldsFragment;
9
+ type Property = GQLMemorySchemaPropertyFieldsFragment;
10
+ export declare function memorySchemaRuleContext(schema: Schema): string;
11
+ export declare function memorySchemaRuleSuggestions(schema: Schema): string[];
12
+ export declare function schemaRuleDraft(schema: Schema): RuleDraftRequest;
13
+ export declare function computedPropertyRuleDraft(schema: Schema, property: Property): RuleDraftRequest;
14
+ type ExampleMemory = Pick<GQLMemory, "iri" | "label" | "customPropertyValues">;
15
+ export declare function memoryRuleDraft(schema: Schema, memory: ExampleMemory): RuleDraftRequest;
16
+ export {};
17
+ //# sourceMappingURL=schema-rule-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-rule-context.d.ts","sourceRoot":"","sources":["../../../../src/routes/memories/schemas/schema-rule-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,SAAS,EACd,KAAK,6BAA6B,EAClC,KAAK,qCAAqC,EAC3C,MAAM,kBAAkB,CAAC;AAG1B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,8CAA8C,CAAC;AAE1F,MAAM,MAAM,gBAAgB,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,qBAAqB,CAAC;IAAC,WAAW,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AAEtG,KAAK,MAAM,GAAG,6BAA6B,CAAC;AAE5C,KAAK,QAAQ,GAAG,qCAAqC,CAAC;AAEtD,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAiB9D;AAKD,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAqBpE;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,gBAAgB,CAMhE;AAED,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,gBAAgB,CAY9F;AAED,KAAK,aAAa,GAAG,IAAI,CAAC,SAAS,EAAE,KAAK,GAAG,OAAO,GAAG,sBAAsB,CAAC,CAAC;AAE/E,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,GAAG,gBAAgB,CAiBvF"}
@@ -0,0 +1,83 @@
1
+ import { GQLMemorySchemaValueType, } from "@manta-eu/client";
2
+ import { isPresent } from "@manta-eu/lib/present";
3
+ import { valueTypeLabels } from "./schema-form.js";
4
+ export function memorySchemaRuleContext(schema) {
5
+ const fields = [...schema.properties]
6
+ .sort((a, b) => a.order - b.order)
7
+ .map((property) => {
8
+ const traits = [
9
+ valueTypeLabels[property.valueType],
10
+ property.multiValued ? "list" : null,
11
+ property.computed ? "computed by a rule" : null,
12
+ property.unit ? `unit ${property.unit}` : null,
13
+ isPresent(property.allowedValues) ? `allowed values: ${property.allowedValues.join(", ")}` : null,
14
+ ].filter(isPresent);
15
+ return `- ${property.label} <${property.path}>: ${traits.join("; ")}`;
16
+ });
17
+ return [
18
+ `The rule is about memories of the "${schema.label}" memory schema <${schema.iri}>.`,
19
+ ...(isPresent(fields) ? ["Its fields:", ...fields] : []),
20
+ ].join("\n");
21
+ }
22
+ const numberTypes = [GQLMemorySchemaValueType.Integer, GQLMemorySchemaValueType.Decimal];
23
+ const dateTypes = [GQLMemorySchemaValueType.Date, GQLMemorySchemaValueType.DateTime];
24
+ export function memorySchemaRuleSuggestions(schema) {
25
+ const name = schema.label;
26
+ const written = schema.properties.filter((property) => !property.computed);
27
+ const computed = schema.properties.find((property) => property.computed);
28
+ const key = written.find((property) => property.keyProperty);
29
+ const number = written.find((property) => numberTypes.includes(property.valueType));
30
+ const choice = written.find((property) => isPresent(property.options));
31
+ const date = written.find((property) => dateTypes.includes(property.valueType));
32
+ const firstChoice = choice?.options[0];
33
+ return [
34
+ computed ? `Fill in ${computed.label} on every ${name} memory from its other fields` : null,
35
+ number && key ? `For each ${key.label}, use the latest company ${name}'s ${number.label} as the target` : null,
36
+ number && !key ? `Use the latest company ${name}'s ${number.label} as the target` : null,
37
+ choice && firstChoice
38
+ ? `Flag company ${name} memories whose ${choice.label} is "${firstChoice.label ?? firstChoice.value}"`
39
+ : null,
40
+ date ? `Flag company ${name} memories whose ${date.label} is in the next 14 days` : null,
41
+ ]
42
+ .filter((suggestion) => suggestion !== null)
43
+ .slice(0, 3);
44
+ }
45
+ export function schemaRuleDraft(schema) {
46
+ return {
47
+ key: schema.iri,
48
+ subject: { name: schema.label, context: memorySchemaRuleContext(schema) },
49
+ suggestions: memorySchemaRuleSuggestions(schema),
50
+ };
51
+ }
52
+ export function computedPropertyRuleDraft(schema, property) {
53
+ return {
54
+ key: `${schema.iri} ${property.path}`,
55
+ subject: {
56
+ name: `${property.label} on ${schema.label}`,
57
+ context: [
58
+ memorySchemaRuleContext(schema),
59
+ `The rule computes ${property.label} <${property.path}>, writing it onto the same memory it reads.`,
60
+ ].join("\n"),
61
+ },
62
+ suggestions: [`Fill in ${property.label} on every ${schema.label} memory from its other fields`],
63
+ };
64
+ }
65
+ export function memoryRuleDraft(schema, memory) {
66
+ const labelByPath = new Map(schema.properties.map((property) => [property.path, property.label]));
67
+ const values = memory.customPropertyValues
68
+ .filter(({ path, values: given }) => labelByPath.has(path) && isPresent(given))
69
+ .map(({ path, values: given }) => `- ${labelByPath.get(path)}: ${given.join(", ")}`);
70
+ return {
71
+ key: `${schema.iri} ${memory.iri}`,
72
+ subject: {
73
+ name: schema.label,
74
+ context: [
75
+ memorySchemaRuleContext(schema),
76
+ `An example company memory of this schema, "${memory.label}" <${memory.iri}>, holds:`,
77
+ ...(isPresent(values) ? values : ["- no field values yet"]),
78
+ ].join("\n"),
79
+ },
80
+ suggestions: memorySchemaRuleSuggestions(schema),
81
+ };
82
+ }
83
+ //# sourceMappingURL=schema-rule-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-rule-context.js","sourceRoot":"","sources":["../../../../src/routes/memories/schemas/schema-rule-context.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,GAIzB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAShD,MAAM,UAAU,uBAAuB,CAAC,MAAc;IACpD,MAAM,MAAM,GAAG,CAAC,GAAG,MAAM,CAAC,UAAU,CAAC;SAClC,IAAI,CAAC,CA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U,eAAe,CAAC,MAAc,EAAE,MAAqB;IACnE,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAClG,MAAM,MAAM,GAAG,MAAM,CAAC,oBAAoB;SACvC,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,SAAS,CAAC,KAAK,CAAC,CAAC;SAC9E,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACvF,OAAO;QACL,GAAG,EAAE,GAAG,MAAM,CAAC,GAAG,IAAI,MAAM,CAAC,GAAG,EAAE;QAClC,OAAO,EAAE;YACP,IAAI,EAAE,MAAM,CAAC,KAAK;YAClB,OAAO,EAAE;gBACP,uBAAuB,CAAC,MAAM,CAAC;gBAC/B,8CAA8C,MAAM,CAAC,KAAK,MAAM,MAAM,CAAC,GAAG,WAAW;gBACrF,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC;aAC5D,CAAC,IAAI,CAAC,IAAI,CAAC;SACb;QACD,WAAW,EAAE,2BAA2B,CAAC,MAAM,CAAC;KACjD,CAAC;AACJ,CAAC"}
@@ -0,0 +1,11 @@
1
+ import type { GQLMemorySchemaFieldsFragment, GQLMemorySchemaRuleCountsQuery } from "@manta-eu/client";
2
+ export declare function ruleCountsFrom(response: GQLMemorySchemaRuleCountsQuery["memorySchemaRuleCounts"] | undefined): ReadonlyMap<string, number> | undefined;
3
+ export type CountFilter = "ANY" | "NONE" | "SOME";
4
+ export type SchemaCountKey = "properties" | "rules" | "memories";
5
+ export type SchemaCountFilters = Record<SchemaCountKey, CountFilter>;
6
+ export declare const anyCount: SchemaCountFilters;
7
+ export type SchemaCounts = Record<SchemaCountKey, number | null>;
8
+ export declare function schemaCounts(schema: GQLMemorySchemaFieldsFragment, ruleCounts: ReadonlyMap<string, number> | undefined): SchemaCounts;
9
+ export declare function countMatches(count: number | null, filter: CountFilter): boolean;
10
+ export declare function filterSchemas(schemas: readonly GQLMemorySchemaFieldsFragment[], search: string, filters: SchemaCountFilters, ruleCounts: ReadonlyMap<string, number> | undefined): GQLMemorySchemaFieldsFragment[];
11
+ //# sourceMappingURL=schema-table.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-table.d.ts","sourceRoot":"","sources":["../../../../src/routes/memories/schemas/schema-table.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,8BAA8B,EAAE,MAAM,kBAAkB,CAAC;AAGtG,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,8BAA8B,CAAC,wBAAwB,CAAC,GAAG,SAAS,GAC7E,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAGzC;AAED,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;AAElD,MAAM,MAAM,cAAc,GAAG,YAAY,GAAG,OAAO,GAAG,UAAU,CAAC;AAEjE,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC;AAErE,eAAO,MAAM,QAAQ,EAAE,kBAAyE,CAAC;AAEjG,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC;AAEjE,wBAAgB,YAAY,CAC1B,MAAM,EAAE,6BAA6B,EACrC,UAAU,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,GAClD,YAAY,CAMd;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAI/E;AAED,wBAAgB,aAAa,CAC3B,OAAO,EAAE,SAAS,6BAA6B,EAAE,EACjD,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,kBAAkB,EAC3B,UAAU,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,GAClD,6BAA6B,EAAE,CAWjC"}
@@ -0,0 +1,34 @@
1
+ import { isPresent } from "@manta-eu/lib/present";
2
+ export function ruleCountsFrom(response) {
3
+ if (!response || isPresent(response.error))
4
+ return undefined;
5
+ return new Map(response.counts.map(({ iri, ruleCount }) => [iri, ruleCount]));
6
+ }
7
+ export const anyCount = { properties: "ANY", rules: "ANY", memories: "ANY" };
8
+ export function schemaCounts(schema, ruleCounts) {
9
+ return {
10
+ properties: schema.properties.filter((property) => !property.computed).length,
11
+ rules: ruleCounts ? (ruleCounts.get(schema.iri) ?? 0) : null,
12
+ memories: schema.memoryCount ?? null,
13
+ };
14
+ }
15
+ export function countMatches(count, filter) {
16
+ if (filter === "ANY")
17
+ return true;
18
+ if (count === null)
19
+ return false;
20
+ return filter === "NONE" ? count === 0 : count > 0;
21
+ }
22
+ export function filterSchemas(schemas, search, filters, ruleCounts) {
23
+ const needle = search.trim().toLowerCase();
24
+ return schemas.filter((schema) => {
25
+ const matchesSearch = !isPresent(needle) ||
26
+ schema.label.toLowerCase().includes(needle) ||
27
+ (schema.description ?? "").toLowerCase().includes(needle);
28
+ if (!matchesSearch)
29
+ return false;
30
+ const counts = schemaCounts(schema, ruleCounts);
31
+ return Object.keys(filters).every((key) => countMatches(counts[key], filters[key]));
32
+ });
33
+ }
34
+ //# sourceMappingURL=schema-table.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-table.js","sourceRoot":"","sources":["../../../../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AAa,CAC3B,OAAiD,EACjD,MAAc,EACd,OAA2B,EAC3B,UAAmD;IAEnD,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAC3C,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE;QAC/B,MAAM,aAAa,GACjB,CAAC,SAAS,CAAC,MAAM,CAAC;YAClB,MAAM,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC;YAC3C,CAAC,MAAM,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QAC5D,IAAI,CAAC,aAAa;YAAE,OAAO,KAAK,CAAC;QACjC,MAAM,MAAM,GAAG,YAAY,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;QAChD,OAAQ,MAAM,CAAC,IAAI,CAAC,OAAO,CAAsB,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAC5G,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,32 @@
1
+ export declare function useMemorySchemaMutations(): {
2
+ refresh: () => Promise<void>;
3
+ create: import("@tanstack/react-query").UseMutationResult<import("@manta-eu/client").GQLCreateMemorySchemaMutation, unknown, import("@manta-eu/client").Exact<{
4
+ input: import("@manta-eu/client").GQLCreateMemorySchemaInput;
5
+ }>, unknown>;
6
+ update: import("@tanstack/react-query").UseMutationResult<import("@manta-eu/client").GQLUpdateMemorySchemaMutation, unknown, import("@manta-eu/client").Exact<{
7
+ input: import("@manta-eu/client").GQLUpdateMemorySchemaInput;
8
+ }>, unknown>;
9
+ archive: import("@tanstack/react-query").UseMutationResult<import("@manta-eu/client").GQLArchiveMemorySchemaMutation, unknown, import("@manta-eu/client").Exact<{
10
+ input: import("@manta-eu/client").GQLMemorySchemaRevisionInput;
11
+ }>, unknown>;
12
+ unarchive: import("@tanstack/react-query").UseMutationResult<import("@manta-eu/client").GQLUnarchiveMemorySchemaMutation, unknown, import("@manta-eu/client").Exact<{
13
+ input: import("@manta-eu/client").GQLMemorySchemaRevisionInput;
14
+ }>, unknown>;
15
+ remove: import("@tanstack/react-query").UseMutationResult<import("@manta-eu/client").GQLDeleteMemorySchemaMutation, unknown, import("@manta-eu/client").Exact<{
16
+ input: import("@manta-eu/client").GQLMemorySchemaRevisionInput;
17
+ }>, unknown>;
18
+ addFromTemplate: import("@tanstack/react-query").UseMutationResult<import("@manta-eu/client").GQLAddMemorySchemaFromTemplateMutation, unknown, import("@manta-eu/client").Exact<{
19
+ templateIri: import("@manta-eu/client").Scalars["IRI"]["input"];
20
+ }>, unknown>;
21
+ resetToTemplate: import("@tanstack/react-query").UseMutationResult<import("@manta-eu/client").GQLResetMemorySchemaToTemplateMutation, unknown, import("@manta-eu/client").Exact<{
22
+ input: import("@manta-eu/client").GQLResetMemorySchemaInput;
23
+ }>, unknown>;
24
+ dismissTemplateUpdate: import("@tanstack/react-query").UseMutationResult<import("@manta-eu/client").GQLDismissMemorySchemaTemplateUpdateMutation, unknown, import("@manta-eu/client").Exact<{
25
+ input: import("@manta-eu/client").GQLMemorySchemaRevisionInput;
26
+ }>, unknown>;
27
+ clearValues: import("@tanstack/react-query").UseMutationResult<import("@manta-eu/client").GQLClearMemorySchemaPropertyValuesMutation, unknown, import("@manta-eu/client").Exact<{
28
+ input: import("@manta-eu/client").GQLClearMemorySchemaPropertyValuesInput;
29
+ }>, unknown>;
30
+ };
31
+ export type MemorySchemaMutations = ReturnType<typeof useMemorySchemaMutations>;
32
+ //# sourceMappingURL=useMemorySchemaMutations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useMemorySchemaMutations.d.ts","sourceRoot":"","sources":["../../../../src/routes/memories/schemas/useMemorySchemaMutations.ts"],"names":[],"mappings":"AAqBA,wBAAgB,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyBvC;AAED,MAAM,MAAM,qBAAqB,GAAG,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAC"}