@mandaitor/react 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/dist/components/APIKeyManager.d.ts +4 -0
- package/dist/components/APIKeyManager.d.ts.map +1 -0
- package/dist/components/APIKeyManager.js +58 -0
- package/dist/components/APIKeyManager.js.map +1 -0
- package/dist/components/MandaitorProvider.d.ts +31 -0
- package/dist/components/MandaitorProvider.d.ts.map +1 -0
- package/dist/components/MandaitorProvider.js +29 -0
- package/dist/components/MandaitorProvider.js.map +1 -0
- package/dist/components/MandateCreator.d.ts +16 -0
- package/dist/components/MandateCreator.d.ts.map +1 -0
- package/dist/components/MandateCreator.js +57 -0
- package/dist/components/MandateCreator.js.map +1 -0
- package/dist/components/MandateManager.d.ts +22 -0
- package/dist/components/MandateManager.d.ts.map +1 -0
- package/dist/components/MandateManager.js +119 -0
- package/dist/components/MandateManager.js.map +1 -0
- package/dist/components/MandateVerifier.d.ts +18 -0
- package/dist/components/MandateVerifier.d.ts.map +1 -0
- package/dist/components/MandateVerifier.js +104 -0
- package/dist/components/MandateVerifier.js.map +1 -0
- package/dist/components/MandateViewer.d.ts +13 -0
- package/dist/components/MandateViewer.d.ts.map +1 -0
- package/dist/components/MandateViewer.js +83 -0
- package/dist/components/MandateViewer.js.map +1 -0
- package/dist/components/WidgetConfigDashboard.d.ts +2 -0
- package/dist/components/WidgetConfigDashboard.d.ts.map +1 -0
- package/dist/components/WidgetConfigDashboard.js +365 -0
- package/dist/components/WidgetConfigDashboard.js.map +1 -0
- package/dist/hooks/useMandaitorSDK.d.ts +13 -0
- package/dist/hooks/useMandaitorSDK.d.ts.map +1 -0
- package/dist/hooks/useMandaitorSDK.js +13 -0
- package/dist/hooks/useMandaitorSDK.js.map +1 -0
- package/dist/hooks/useMandate.d.ts +16 -0
- package/dist/hooks/useMandate.d.ts.map +1 -0
- package/dist/hooks/useMandate.js +42 -0
- package/dist/hooks/useMandate.js.map +1 -0
- package/dist/hooks/useMandates.d.ts +20 -0
- package/dist/hooks/useMandates.d.ts.map +1 -0
- package/dist/hooks/useMandates.js +69 -0
- package/dist/hooks/useMandates.js.map +1 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -0
- package/package.json +51 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Mandate, AuditEvent } from "@mandaitor/sdk";
|
|
2
|
+
export interface UseMandateOptions {
|
|
3
|
+
/** Also fetch audit events for this mandate */
|
|
4
|
+
includeEvents?: boolean;
|
|
5
|
+
/** Auto-refetch interval in milliseconds (0 = disabled) */
|
|
6
|
+
refetchInterval?: number;
|
|
7
|
+
}
|
|
8
|
+
export interface UseMandateResult {
|
|
9
|
+
mandate: Mandate | null;
|
|
10
|
+
events: AuditEvent[];
|
|
11
|
+
isLoading: boolean;
|
|
12
|
+
error: string | null;
|
|
13
|
+
refetch: () => void;
|
|
14
|
+
}
|
|
15
|
+
export declare function useMandate(mandateId: string | null, options?: UseMandateOptions): UseMandateResult;
|
|
16
|
+
//# sourceMappingURL=useMandate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMandate.d.ts","sourceRoot":"","sources":["../../src/hooks/useMandate.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE1D,MAAM,WAAW,iBAAiB;IAChC,+CAA+C;IAC/C,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,2DAA2D;IAC3D,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IACxB,MAAM,EAAE,UAAU,EAAE,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,wBAAgB,UAAU,CACxB,SAAS,EAAE,MAAM,GAAG,IAAI,EACxB,OAAO,GAAE,iBAAsB,GAC9B,gBAAgB,CAwClB"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { useState, useEffect, useCallback } from "react";
|
|
2
|
+
import { useMandaitorContext } from "../components/MandaitorProvider";
|
|
3
|
+
export function useMandate(mandateId, options = {}) {
|
|
4
|
+
const { client } = useMandaitorContext();
|
|
5
|
+
const [mandate, setMandate] = useState(null);
|
|
6
|
+
const [events, setEvents] = useState([]);
|
|
7
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
8
|
+
const [error, setError] = useState(null);
|
|
9
|
+
const fetchMandate = useCallback(async () => {
|
|
10
|
+
if (!mandateId)
|
|
11
|
+
return;
|
|
12
|
+
setIsLoading(true);
|
|
13
|
+
setError(null);
|
|
14
|
+
try {
|
|
15
|
+
const m = await client.getMandate(mandateId);
|
|
16
|
+
setMandate(m);
|
|
17
|
+
if (options.includeEvents) {
|
|
18
|
+
const evtResponse = await client.getMandateEvents(mandateId, { limit: 50 });
|
|
19
|
+
setEvents(evtResponse.items);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
catch (err) {
|
|
23
|
+
setError(err instanceof Error ? err.message : "Failed to fetch mandate");
|
|
24
|
+
setMandate(null);
|
|
25
|
+
}
|
|
26
|
+
finally {
|
|
27
|
+
setIsLoading(false);
|
|
28
|
+
}
|
|
29
|
+
}, [client, mandateId, options.includeEvents]);
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
fetchMandate();
|
|
32
|
+
}, [fetchMandate]);
|
|
33
|
+
// Auto-refetch interval
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
if (!options.refetchInterval || options.refetchInterval <= 0)
|
|
36
|
+
return;
|
|
37
|
+
const interval = setInterval(fetchMandate, options.refetchInterval);
|
|
38
|
+
return () => clearInterval(interval);
|
|
39
|
+
}, [fetchMandate, options.refetchInterval]);
|
|
40
|
+
return { mandate, events, isLoading, error, refetch: fetchMandate };
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=useMandate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMandate.js","sourceRoot":"","sources":["../../src/hooks/useMandate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAkBtE,MAAM,UAAU,UAAU,CACxB,SAAwB,EACxB,UAA6B,EAAE;IAE/B,MAAM,EAAE,MAAM,EAAE,GAAG,mBAAmB,EAAE,CAAC;IACzC,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAiB,IAAI,CAAC,CAAC;IAC7D,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAe,EAAE,CAAC,CAAC;IACvD,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAClD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAC;IAExD,MAAM,YAAY,GAAG,WAAW,CAAC,KAAK,IAAI,EAAE;QAC1C,IAAI,CAAC,SAAS;YAAE,OAAO;QACvB,YAAY,CAAC,IAAI,CAAC,CAAC;QACnB,QAAQ,CAAC,IAAI,CAAC,CAAC;QAEf,IAAI,CAAC;YACH,MAAM,CAAC,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;YAC7C,UAAU,CAAC,CAAC,CAAC,CAAC;YAEd,IAAI,OAAO,CAAC,aAAa,EAAE,CAAC;gBAC1B,MAAM,WAAW,GAAG,MAAM,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;gBAC5E,SAAS,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;YAC/B,CAAC;QACH,CAAC;QAAC,OAAO,GAAY,EAAE,CAAC;YACtB,QAAQ,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,yBAAyB,CAAC,CAAC;YACzE,UAAU,CAAC,IAAI,CAAC,CAAC;QACnB,CAAC;gBAAS,CAAC;YACT,YAAY,CAAC,KAAK,CAAC,CAAC;QACtB,CAAC;IACH,CAAC,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC;IAE/C,SAAS,CAAC,GAAG,EAAE;QACb,YAAY,EAAE,CAAC;IACjB,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;IAEnB,wBAAwB;IACxB,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,OAAO,CAAC,eAAe,IAAI,OAAO,CAAC,eAAe,IAAI,CAAC;YAAE,OAAO;QACrE,MAAM,QAAQ,GAAG,WAAW,CAAC,YAAY,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;QACpE,OAAO,GAAG,EAAE,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IACvC,CAAC,EAAE,CAAC,YAAY,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC;IAE5C,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC;AACtE,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Mandate } from "@mandaitor/sdk";
|
|
2
|
+
export interface UseMandatesOptions {
|
|
3
|
+
/** Filter by status (comma-separated for multiple) */
|
|
4
|
+
status?: string;
|
|
5
|
+
/** Page size (default: 20) */
|
|
6
|
+
limit?: number;
|
|
7
|
+
/** Auto-refetch interval in milliseconds (0 = disabled) */
|
|
8
|
+
refetchInterval?: number;
|
|
9
|
+
}
|
|
10
|
+
export interface UseMandatesResult {
|
|
11
|
+
mandates: Mandate[];
|
|
12
|
+
isLoading: boolean;
|
|
13
|
+
error: string | null;
|
|
14
|
+
hasMore: boolean;
|
|
15
|
+
loadMore: () => void;
|
|
16
|
+
refetch: () => void;
|
|
17
|
+
totalLoaded: number;
|
|
18
|
+
}
|
|
19
|
+
export declare function useMandates(options?: UseMandatesOptions): UseMandatesResult;
|
|
20
|
+
//# sourceMappingURL=useMandates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMandates.d.ts","sourceRoot":"","sources":["../../src/hooks/useMandates.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAE9C,MAAM,WAAW,kBAAkB;IACjC,sDAAsD;IACtD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,8BAA8B;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2DAA2D;IAC3D,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,WAAW,CAAC,OAAO,GAAE,kBAAuB,GAAG,iBAAiB,CAyE/E"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { useState, useEffect, useCallback, useRef } from "react";
|
|
2
|
+
import { useMandaitorContext } from "../components/MandaitorProvider";
|
|
3
|
+
export function useMandates(options = {}) {
|
|
4
|
+
const { client } = useMandaitorContext();
|
|
5
|
+
const [mandates, setMandates] = useState([]);
|
|
6
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
7
|
+
const [error, setError] = useState(null);
|
|
8
|
+
const [hasMore, setHasMore] = useState(false);
|
|
9
|
+
const cursorRef = useRef(undefined);
|
|
10
|
+
const limit = options.limit || 20;
|
|
11
|
+
const fetchPage = useCallback(async (cursor, append = false) => {
|
|
12
|
+
setIsLoading(true);
|
|
13
|
+
setError(null);
|
|
14
|
+
try {
|
|
15
|
+
const response = await client.listMandates({
|
|
16
|
+
status: options.status,
|
|
17
|
+
limit,
|
|
18
|
+
cursor,
|
|
19
|
+
});
|
|
20
|
+
if (append) {
|
|
21
|
+
setMandates((prev) => [...prev, ...response.items]);
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
setMandates(response.items);
|
|
25
|
+
}
|
|
26
|
+
cursorRef.current = response.next_cursor;
|
|
27
|
+
setHasMore(!!response.next_cursor);
|
|
28
|
+
}
|
|
29
|
+
catch (err) {
|
|
30
|
+
setError(err instanceof Error ? err.message : "Failed to fetch mandates");
|
|
31
|
+
}
|
|
32
|
+
finally {
|
|
33
|
+
setIsLoading(false);
|
|
34
|
+
}
|
|
35
|
+
}, [client, options.status, limit]);
|
|
36
|
+
// Initial fetch
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
cursorRef.current = undefined;
|
|
39
|
+
fetchPage();
|
|
40
|
+
}, [fetchPage]);
|
|
41
|
+
// Load more (pagination)
|
|
42
|
+
const loadMore = useCallback(() => {
|
|
43
|
+
if (!isLoading && hasMore && cursorRef.current) {
|
|
44
|
+
fetchPage(cursorRef.current, true);
|
|
45
|
+
}
|
|
46
|
+
}, [isLoading, hasMore, fetchPage]);
|
|
47
|
+
// Refetch from beginning
|
|
48
|
+
const refetch = useCallback(() => {
|
|
49
|
+
cursorRef.current = undefined;
|
|
50
|
+
fetchPage();
|
|
51
|
+
}, [fetchPage]);
|
|
52
|
+
// Auto-refetch interval
|
|
53
|
+
useEffect(() => {
|
|
54
|
+
if (!options.refetchInterval || options.refetchInterval <= 0)
|
|
55
|
+
return;
|
|
56
|
+
const interval = setInterval(refetch, options.refetchInterval);
|
|
57
|
+
return () => clearInterval(interval);
|
|
58
|
+
}, [refetch, options.refetchInterval]);
|
|
59
|
+
return {
|
|
60
|
+
mandates,
|
|
61
|
+
isLoading,
|
|
62
|
+
error,
|
|
63
|
+
hasMore,
|
|
64
|
+
loadMore,
|
|
65
|
+
refetch,
|
|
66
|
+
totalLoaded: mandates.length,
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=useMandates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMandates.js","sourceRoot":"","sources":["../../src/hooks/useMandates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAsBtE,MAAM,UAAU,WAAW,CAAC,UAA8B,EAAE;IAC1D,MAAM,EAAE,MAAM,EAAE,GAAG,mBAAmB,EAAE,CAAC;IACzC,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAY,EAAE,CAAC,CAAC;IACxD,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAClD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAC;IACxD,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC9C,MAAM,SAAS,GAAG,MAAM,CAAqB,SAAS,CAAC,CAAC;IACxD,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,EAAE,CAAC;IAElC,MAAM,SAAS,GAAG,WAAW,CAC3B,KAAK,EAAE,MAAe,EAAE,MAAM,GAAG,KAAK,EAAE,EAAE;QACxC,YAAY,CAAC,IAAI,CAAC,CAAC;QACnB,QAAQ,CAAC,IAAI,CAAC,CAAC;QAEf,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC;gBACzC,MAAM,EAAE,OAAO,CAAC,MAAM;gBACtB,KAAK;gBACL,MAAM;aACP,CAAC,CAAC;YAEH,IAAI,MAAM,EAAE,CAAC;gBACX,WAAW,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;YACtD,CAAC;iBAAM,CAAC;gBACN,WAAW,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;YAC9B,CAAC;YAED,SAAS,CAAC,OAAO,GAAG,QAAQ,CAAC,WAAW,CAAC;YACzC,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;QACrC,CAAC;QAAC,OAAO,GAAY,EAAE,CAAC;YACtB,QAAQ,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAC;QAC5E,CAAC;gBAAS,CAAC;YACT,YAAY,CAAC,KAAK,CAAC,CAAC;QACtB,CAAC;IACH,CAAC,EACD,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,CAChC,CAAC;IAEF,gBAAgB;IAChB,SAAS,CAAC,GAAG,EAAE;QACb,SAAS,CAAC,OAAO,GAAG,SAAS,CAAC;QAC9B,SAAS,EAAE,CAAC;IACd,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;IAEhB,yBAAyB;IACzB,MAAM,QAAQ,GAAG,WAAW,CAAC,GAAG,EAAE;QAChC,IAAI,CAAC,SAAS,IAAI,OAAO,IAAI,SAAS,CAAC,OAAO,EAAE,CAAC;YAC/C,SAAS,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QACrC,CAAC;IACH,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC;IAEpC,yBAAyB;IACzB,MAAM,OAAO,GAAG,WAAW,CAAC,GAAG,EAAE;QAC/B,SAAS,CAAC,OAAO,GAAG,SAAS,CAAC;QAC9B,SAAS,EAAE,CAAC;IACd,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;IAEhB,wBAAwB;IACxB,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,OAAO,CAAC,eAAe,IAAI,OAAO,CAAC,eAAe,IAAI,CAAC;YAAE,OAAO;QACrE,MAAM,QAAQ,GAAG,WAAW,CAAC,OAAO,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;QAC/D,OAAO,GAAG,EAAE,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IACvC,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC;IAEvC,OAAO;QACL,QAAQ;QACR,SAAS;QACT,KAAK;QACL,OAAO;QACP,QAAQ;QACR,OAAO;QACP,WAAW,EAAE,QAAQ,CAAC,MAAM;KAC7B,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export { MandaitorProvider, useMandaitorContext } from "./components/MandaitorProvider";
|
|
2
|
+
export type { MandaitorProviderProps, MandaitorTheme, MandaitorContextValue, } from "./components/MandaitorProvider";
|
|
3
|
+
export { MandateCreator } from "./components/MandateCreator";
|
|
4
|
+
export type { MandateCreatorProps, ActionOption } from "./components/MandateCreator";
|
|
5
|
+
export { MandateManager } from "./components/MandateManager";
|
|
6
|
+
export type { MandateManagerProps } from "./components/MandateManager";
|
|
7
|
+
export { MandateViewer } from "./components/MandateViewer";
|
|
8
|
+
export type { MandateViewerProps } from "./components/MandateViewer";
|
|
9
|
+
export { MandateVerifier } from "./components/MandateVerifier";
|
|
10
|
+
export type { MandateVerifierProps } from "./components/MandateVerifier";
|
|
11
|
+
export { useMandate } from "./hooks/useMandate";
|
|
12
|
+
export type { UseMandateOptions, UseMandateResult } from "./hooks/useMandate";
|
|
13
|
+
export { useMandates } from "./hooks/useMandates";
|
|
14
|
+
export type { UseMandatesOptions, UseMandatesResult } from "./hooks/useMandates";
|
|
15
|
+
export { useMandaitorSDK } from "./hooks/useMandaitorSDK";
|
|
16
|
+
export type { UseMandaitorSDKResult } from "./hooks/useMandaitorSDK";
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACxF,YAAY,EACV,sBAAsB,EACtB,cAAc,EACd,qBAAqB,GACtB,MAAM,gCAAgC,CAAC;AAExC,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,YAAY,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAErF,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,YAAY,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAEvE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,YAAY,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAErE,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,YAAY,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAGzE,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,YAAY,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE9E,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,YAAY,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAEjF,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,YAAY,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// @mandaitor/react — Public API
|
|
2
|
+
// Single entry point for all React widget consumers.
|
|
3
|
+
// ── Components ──
|
|
4
|
+
export { MandaitorProvider, useMandaitorContext } from "./components/MandaitorProvider";
|
|
5
|
+
export { MandateCreator } from "./components/MandateCreator";
|
|
6
|
+
export { MandateManager } from "./components/MandateManager";
|
|
7
|
+
export { MandateViewer } from "./components/MandateViewer";
|
|
8
|
+
export { MandateVerifier } from "./components/MandateVerifier";
|
|
9
|
+
// ── Hooks ──
|
|
10
|
+
export { useMandate } from "./hooks/useMandate";
|
|
11
|
+
export { useMandates } from "./hooks/useMandates";
|
|
12
|
+
export { useMandaitorSDK } from "./hooks/useMandaitorSDK";
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,qDAAqD;AAErD,mBAAmB;AACnB,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAOxF,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAG7D,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAG7D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAG3D,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAG/D,cAAc;AACd,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGhD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGlD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@mandaitor/react",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Mandaitor — React UI components and hooks",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist"
|
|
16
|
+
],
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"@mandaitor/sdk": "0.2.0"
|
|
19
|
+
},
|
|
20
|
+
"peerDependencies": {
|
|
21
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
22
|
+
"react-dom": "^18.0.0 || ^19.0.0"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@types/react": "^19.0.0",
|
|
26
|
+
"@types/react-dom": "^19.0.0",
|
|
27
|
+
"react": "^19.0.0",
|
|
28
|
+
"react-dom": "^19.0.0",
|
|
29
|
+
"typescript": "^5.6.0",
|
|
30
|
+
"vitest": "^2.0.0"
|
|
31
|
+
},
|
|
32
|
+
"publishConfig": {
|
|
33
|
+
"registry": "https://registry.npmjs.org",
|
|
34
|
+
"access": "public"
|
|
35
|
+
},
|
|
36
|
+
"license": "MIT",
|
|
37
|
+
"repository": {
|
|
38
|
+
"type": "git",
|
|
39
|
+
"url": "https://github.com/C4RR13P0TT3R/mandaitor.git",
|
|
40
|
+
"directory": "packages/react"
|
|
41
|
+
},
|
|
42
|
+
"scripts": {
|
|
43
|
+
"build": "tsc",
|
|
44
|
+
"test": "vitest run",
|
|
45
|
+
"test:unit": "vitest run",
|
|
46
|
+
"typecheck": "tsc -p tsconfig.typecheck.json",
|
|
47
|
+
"lint": "eslint src/",
|
|
48
|
+
"lint:fix": "eslint src/ --fix",
|
|
49
|
+
"clean": "rm -rf dist tsconfig.tsbuildinfo"
|
|
50
|
+
}
|
|
51
|
+
}
|