@trustgraph/react-state 0.2.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.
- package/LICENSE +176 -0
- package/README.md +722 -0
- package/dist/NotificationProvider.d.ts +31 -0
- package/dist/NotificationProvider.d.ts.map +1 -0
- package/dist/hooks/useActivity.d.ts +18 -0
- package/dist/hooks/useActivity.d.ts.map +1 -0
- package/dist/hooks/useNotification.d.ts +27 -0
- package/dist/hooks/useNotification.d.ts.map +1 -0
- package/dist/index.cjs +6079 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +60 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.esm.js +6019 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.js +6018 -0
- package/dist/index.js.map +1 -0
- package/dist/model/document-metadata.d.ts +15 -0
- package/dist/model/document-metadata.d.ts.map +1 -0
- package/dist/model/entity.d.ts +9 -0
- package/dist/model/entity.d.ts.map +1 -0
- package/dist/model/llm-models.d.ts +13 -0
- package/dist/model/llm-models.d.ts.map +1 -0
- package/dist/model/message.d.ts +6 -0
- package/dist/model/message.d.ts.map +1 -0
- package/dist/model/settings-types.d.ts +28 -0
- package/dist/model/settings-types.d.ts.map +1 -0
- package/dist/state/agent-tools.d.ts +18 -0
- package/dist/state/agent-tools.d.ts.map +1 -0
- package/dist/state/chat-query.d.ts +13 -0
- package/dist/state/chat-query.d.ts.map +1 -0
- package/dist/state/chat-session.d.ts +20 -0
- package/dist/state/chat-session.d.ts.map +1 -0
- package/dist/state/chat.d.ts +13 -0
- package/dist/state/chat.d.ts.map +1 -0
- package/dist/state/collections.d.ts +31 -0
- package/dist/state/collections.d.ts.map +1 -0
- package/dist/state/conversation.d.ts +13 -0
- package/dist/state/conversation.d.ts.map +1 -0
- package/dist/state/embeddings.d.ts +17 -0
- package/dist/state/embeddings.d.ts.map +1 -0
- package/dist/state/entity-query.d.ts +24 -0
- package/dist/state/entity-query.d.ts.map +1 -0
- package/dist/state/flow-classes.d.ts +63 -0
- package/dist/state/flow-classes.d.ts.map +1 -0
- package/dist/state/flow-parameters.d.ts +65 -0
- package/dist/state/flow-parameters.d.ts.map +1 -0
- package/dist/state/flows.d.ts +32 -0
- package/dist/state/flows.d.ts.map +1 -0
- package/dist/state/graph-embeddings.d.ts +19 -0
- package/dist/state/graph-embeddings.d.ts.map +1 -0
- package/dist/state/graph-query.d.ts +29 -0
- package/dist/state/graph-query.d.ts.map +1 -0
- package/dist/state/inference.d.ts +38 -0
- package/dist/state/inference.d.ts.map +1 -0
- package/dist/state/knowledge-cores.d.ts +23 -0
- package/dist/state/knowledge-cores.d.ts.map +1 -0
- package/dist/state/library.d.ts +25 -0
- package/dist/state/library.d.ts.map +1 -0
- package/dist/state/llm-models.d.ts +29 -0
- package/dist/state/llm-models.d.ts.map +1 -0
- package/dist/state/load.d.ts +33 -0
- package/dist/state/load.d.ts.map +1 -0
- package/dist/state/mcp-tools.d.ts +18 -0
- package/dist/state/mcp-tools.d.ts.map +1 -0
- package/dist/state/nlp-query.d.ts +24 -0
- package/dist/state/nlp-query.d.ts.map +1 -0
- package/dist/state/node-details.d.ts +60 -0
- package/dist/state/node-details.d.ts.map +1 -0
- package/dist/state/objects-query.d.ts +24 -0
- package/dist/state/objects-query.d.ts.map +1 -0
- package/dist/state/ontologies.d.ts +76 -0
- package/dist/state/ontologies.d.ts.map +1 -0
- package/dist/state/processing.d.ts +13 -0
- package/dist/state/processing.d.ts.map +1 -0
- package/dist/state/progress.d.ts +9 -0
- package/dist/state/progress.d.ts.map +1 -0
- package/dist/state/prompts.d.ts +22 -0
- package/dist/state/prompts.d.ts.map +1 -0
- package/dist/state/schemas.d.ts +13 -0
- package/dist/state/schemas.d.ts.map +1 -0
- package/dist/state/search.d.ts +9 -0
- package/dist/state/search.d.ts.map +1 -0
- package/dist/state/session.d.ts +9 -0
- package/dist/state/session.d.ts.map +1 -0
- package/dist/state/settings.d.ts +21 -0
- package/dist/state/settings.d.ts.map +1 -0
- package/dist/state/structured-query.d.ts +24 -0
- package/dist/state/structured-query.d.ts.map +1 -0
- package/dist/state/token-costs.d.ts +28 -0
- package/dist/state/token-costs.d.ts.map +1 -0
- package/dist/state/triples.d.ts +21 -0
- package/dist/state/triples.d.ts.map +1 -0
- package/dist/state/vector-search.d.ts +19 -0
- package/dist/state/vector-search.d.ts.map +1 -0
- package/dist/state/workbench.d.ts +20 -0
- package/dist/state/workbench.d.ts.map +1 -0
- package/dist/types.d.ts +27 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/utils/document-encoding.d.ts +23 -0
- package/dist/utils/document-encoding.d.ts.map +1 -0
- package/dist/utils/knowledge-graph-viz.d.ts +23 -0
- package/dist/utils/knowledge-graph-viz.d.ts.map +1 -0
- package/dist/utils/knowledge-graph.d.ts +22 -0
- package/dist/utils/knowledge-graph.d.ts.map +1 -0
- package/dist/utils/row.d.ts +16 -0
- package/dist/utils/row.d.ts.map +1 -0
- package/dist/utils/vector-search.d.ts +2 -0
- package/dist/utils/vector-search.d.ts.map +1 -0
- package/package.json +89 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
import type { NotificationHandler } from "./types";
|
|
3
|
+
export declare const NotificationContext: React.Context<NotificationHandler>;
|
|
4
|
+
/**
|
|
5
|
+
* Props for NotificationProvider
|
|
6
|
+
*/
|
|
7
|
+
export interface NotificationProviderProps {
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
handler: NotificationHandler;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* NotificationProvider component
|
|
13
|
+
* Provides a notification handler to all child components via context
|
|
14
|
+
* This allows applications to inject their own notification/toast UI implementation
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```tsx
|
|
18
|
+
* const toasterHandler: NotificationHandler = {
|
|
19
|
+
* success: (msg) => toast.success(msg),
|
|
20
|
+
* error: (msg) => toast.error(msg),
|
|
21
|
+
* warning: (msg) => toast.warning(msg),
|
|
22
|
+
* info: (msg) => toast.info(msg)
|
|
23
|
+
* };
|
|
24
|
+
*
|
|
25
|
+
* <NotificationProvider handler={toasterHandler}>
|
|
26
|
+
* <App />
|
|
27
|
+
* </NotificationProvider>
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export declare const NotificationProvider: React.FC<NotificationProviderProps>;
|
|
31
|
+
//# sourceMappingURL=NotificationProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NotificationProvider.d.ts","sourceRoot":"","sources":["../src/NotificationProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAiB,SAAS,EAAE,MAAM,OAAO,CAAC;AACxD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAGnD,eAAO,MAAM,mBAAmB,oCAE/B,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,EAAE,mBAAmB,CAAC;CAC9B;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CASpE,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom hook for managing activity notifications in the UI
|
|
3
|
+
* Automatically adds/removes activity indicators based on a boolean condition
|
|
4
|
+
*
|
|
5
|
+
* @param {boolean} isActive - Boolean condition that determines if activity
|
|
6
|
+
* is ongoing
|
|
7
|
+
* @param {string} description - Description text to display for the activity
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* // Show "Loading documents" while documentsQuery.isLoading is true
|
|
11
|
+
* useActivity(documentsQuery.isLoading, "Loading documents");
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* // Show "Saving data" while mutation is pending
|
|
15
|
+
* useActivity(saveMutation.isPending, "Saving data");
|
|
16
|
+
*/
|
|
17
|
+
export declare const useActivity: (isActive: boolean, description: string) => void;
|
|
18
|
+
//# sourceMappingURL=useActivity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useActivity.d.ts","sourceRoot":"","sources":["../../src/hooks/useActivity.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,WAAW,GAAI,UAAU,OAAO,EAAE,aAAa,MAAM,SAsBjE,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { NotificationHandler } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* Custom hook for accessing the notification handler
|
|
4
|
+
* Must be used within a NotificationProvider
|
|
5
|
+
*
|
|
6
|
+
* @returns {NotificationHandler} The notification handler methods
|
|
7
|
+
* @throws {Error} If used outside of NotificationProvider
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* function MyComponent() {
|
|
12
|
+
* const notify = useNotification();
|
|
13
|
+
*
|
|
14
|
+
* const handleSuccess = () => {
|
|
15
|
+
* notify.success("Operation completed!");
|
|
16
|
+
* };
|
|
17
|
+
*
|
|
18
|
+
* const handleError = () => {
|
|
19
|
+
* notify.error("Something went wrong");
|
|
20
|
+
* };
|
|
21
|
+
*
|
|
22
|
+
* return <button onClick={handleSuccess}>Do Something</button>;
|
|
23
|
+
* }
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export declare const useNotification: () => NotificationHandler;
|
|
27
|
+
//# sourceMappingURL=useNotification.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useNotification.d.ts","sourceRoot":"","sources":["../../src/hooks/useNotification.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAEpD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,eAAe,QAAO,mBAUlC,CAAC"}
|