@assistant-ui/react-mcp 0.0.0 → 0.0.1
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 +21 -0
- package/dist/_virtual/_rolldown/runtime.js +13 -0
- package/dist/auth/buildHeaders.d.ts +7 -3
- package/dist/auth/buildHeaders.d.ts.map +1 -1
- package/dist/auth/buildHeaders.js +14 -12
- package/dist/auth/buildHeaders.js.map +1 -1
- package/dist/auth/createOAuthProvider.d.ts +17 -15
- package/dist/auth/createOAuthProvider.d.ts.map +1 -1
- package/dist/auth/createOAuthProvider.js +111 -137
- package/dist/auth/createOAuthProvider.js.map +1 -1
- package/dist/auth/types.d.ts +10 -7
- package/dist/auth/types.d.ts.map +1 -1
- package/dist/auth/types.js +0 -2
- package/dist/connector.d.ts +6 -2
- package/dist/connector.d.ts.map +1 -1
- package/dist/connector.js +7 -3
- package/dist/connector.js.map +1 -1
- package/dist/context/McpConnectorByIndexProvider.d.ts +7 -3
- package/dist/context/McpConnectorByIndexProvider.d.ts.map +1 -1
- package/dist/context/McpConnectorByIndexProvider.js +18 -11
- package/dist/context/McpConnectorByIndexProvider.js.map +1 -1
- package/dist/context/McpCustomServerByIndexProvider.d.ts +7 -3
- package/dist/context/McpCustomServerByIndexProvider.d.ts.map +1 -1
- package/dist/context/McpCustomServerByIndexProvider.js +18 -11
- package/dist/context/McpCustomServerByIndexProvider.js.map +1 -1
- package/dist/context/McpServerByIdProvider.d.ts +7 -3
- package/dist/context/McpServerByIdProvider.d.ts.map +1 -1
- package/dist/context/McpServerByIdProvider.js +15 -11
- package/dist/context/McpServerByIdProvider.js.map +1 -1
- package/dist/hooks/useMcpOAuthCallback.d.ts +16 -13
- package/dist/hooks/useMcpOAuthCallback.d.ts.map +1 -1
- package/dist/hooks/useMcpOAuthCallback.js +59 -55
- package/dist/hooks/useMcpOAuthCallback.js.map +1 -1
- package/dist/index.d.ts +17 -18
- package/dist/index.js +14 -26
- package/dist/mcp-scope.d.ts +91 -94
- package/dist/mcp-scope.d.ts.map +1 -1
- package/dist/mcp-scope.js +0 -1
- package/dist/primitives/addForm/McpAddFormAuthFields.d.ts +17 -13
- package/dist/primitives/addForm/McpAddFormAuthFields.d.ts.map +1 -1
- package/dist/primitives/addForm/McpAddFormAuthFields.js +23 -14
- package/dist/primitives/addForm/McpAddFormAuthFields.js.map +1 -1
- package/dist/primitives/addForm/McpAddFormAuthSelect.d.ts +9 -5
- package/dist/primitives/addForm/McpAddFormAuthSelect.d.ts.map +1 -1
- package/dist/primitives/addForm/McpAddFormAuthSelect.js +36 -16
- package/dist/primitives/addForm/McpAddFormAuthSelect.js.map +1 -1
- package/dist/primitives/addForm/McpAddFormCancel.d.ts +10 -6
- package/dist/primitives/addForm/McpAddFormCancel.d.ts.map +1 -1
- package/dist/primitives/addForm/McpAddFormCancel.js +19 -11
- package/dist/primitives/addForm/McpAddFormCancel.js.map +1 -1
- package/dist/primitives/addForm/McpAddFormError.d.ts +10 -6
- package/dist/primitives/addForm/McpAddFormError.d.ts.map +1 -1
- package/dist/primitives/addForm/McpAddFormError.js +15 -8
- package/dist/primitives/addForm/McpAddFormError.js.map +1 -1
- package/dist/primitives/addForm/McpAddFormNameField.d.ts +9 -5
- package/dist/primitives/addForm/McpAddFormNameField.d.ts.map +1 -1
- package/dist/primitives/addForm/McpAddFormNameField.js +17 -6
- package/dist/primitives/addForm/McpAddFormNameField.js.map +1 -1
- package/dist/primitives/addForm/McpAddFormRoot.d.ts +15 -11
- package/dist/primitives/addForm/McpAddFormRoot.d.ts.map +1 -1
- package/dist/primitives/addForm/McpAddFormRoot.js +134 -94
- package/dist/primitives/addForm/McpAddFormRoot.js.map +1 -1
- package/dist/primitives/addForm/McpAddFormSubmit.d.ts +10 -6
- package/dist/primitives/addForm/McpAddFormSubmit.d.ts.map +1 -1
- package/dist/primitives/addForm/McpAddFormSubmit.js +16 -6
- package/dist/primitives/addForm/McpAddFormSubmit.js.map +1 -1
- package/dist/primitives/addForm/McpAddFormUrlField.d.ts +9 -5
- package/dist/primitives/addForm/McpAddFormUrlField.d.ts.map +1 -1
- package/dist/primitives/addForm/McpAddFormUrlField.js +18 -6
- package/dist/primitives/addForm/McpAddFormUrlField.js.map +1 -1
- package/dist/primitives/addForm/context.d.ts +22 -18
- package/dist/primitives/addForm/context.d.ts.map +1 -1
- package/dist/primitives/addForm/context.js +9 -7
- package/dist/primitives/addForm/context.js.map +1 -1
- package/dist/primitives/addForm.d.ts +15 -8
- package/dist/primitives/addForm.d.ts.map +1 -1
- package/dist/primitives/addForm.js +23 -8
- package/dist/primitives/addForm.js.map +1 -1
- package/dist/primitives/manager/McpManagerAddCustomTrigger.d.ts +10 -6
- package/dist/primitives/manager/McpManagerAddCustomTrigger.d.ts.map +1 -1
- package/dist/primitives/manager/McpManagerAddCustomTrigger.js +13 -6
- package/dist/primitives/manager/McpManagerAddCustomTrigger.js.map +1 -1
- package/dist/primitives/manager/McpManagerConnectors.d.ts +18 -14
- package/dist/primitives/manager/McpManagerConnectors.d.ts.map +1 -1
- package/dist/primitives/manager/McpManagerConnectors.js +37 -35
- package/dist/primitives/manager/McpManagerConnectors.js.map +1 -1
- package/dist/primitives/manager/McpManagerCustomServers.d.ts +18 -14
- package/dist/primitives/manager/McpManagerCustomServers.d.ts.map +1 -1
- package/dist/primitives/manager/McpManagerCustomServers.js +38 -32
- package/dist/primitives/manager/McpManagerCustomServers.js.map +1 -1
- package/dist/primitives/manager/McpManagerRoot.d.ts +10 -6
- package/dist/primitives/manager/McpManagerRoot.d.ts.map +1 -1
- package/dist/primitives/manager/McpManagerRoot.js +14 -6
- package/dist/primitives/manager/McpManagerRoot.js.map +1 -1
- package/dist/primitives/manager.d.ts +11 -4
- package/dist/primitives/manager.d.ts.map +1 -1
- package/dist/primitives/manager.js +15 -4
- package/dist/primitives/manager.js.map +1 -1
- package/dist/primitives/server/McpServerConnectButton.d.ts +10 -6
- package/dist/primitives/server/McpServerConnectButton.d.ts.map +1 -1
- package/dist/primitives/server/McpServerConnectButton.js +28 -17
- package/dist/primitives/server/McpServerConnectButton.js.map +1 -1
- package/dist/primitives/server/McpServerDisconnectButton.d.ts +10 -6
- package/dist/primitives/server/McpServerDisconnectButton.d.ts.map +1 -1
- package/dist/primitives/server/McpServerDisconnectButton.js +27 -17
- package/dist/primitives/server/McpServerDisconnectButton.js.map +1 -1
- package/dist/primitives/server/McpServerError.d.ts +10 -6
- package/dist/primitives/server/McpServerError.d.ts.map +1 -1
- package/dist/primitives/server/McpServerError.js +15 -8
- package/dist/primitives/server/McpServerError.js.map +1 -1
- package/dist/primitives/server/McpServerIcon.d.ts +16 -14
- package/dist/primitives/server/McpServerIcon.d.ts.map +1 -1
- package/dist/primitives/server/McpServerIcon.js +18 -10
- package/dist/primitives/server/McpServerIcon.js.map +1 -1
- package/dist/primitives/server/McpServerName.d.ts +10 -6
- package/dist/primitives/server/McpServerName.d.ts.map +1 -1
- package/dist/primitives/server/McpServerName.js +14 -6
- package/dist/primitives/server/McpServerName.js.map +1 -1
- package/dist/primitives/server/McpServerOAuthLink.d.ts +13 -11
- package/dist/primitives/server/McpServerOAuthLink.d.ts.map +1 -1
- package/dist/primitives/server/McpServerOAuthLink.js +18 -9
- package/dist/primitives/server/McpServerOAuthLink.js.map +1 -1
- package/dist/primitives/server/McpServerRemoveButton.d.ts +10 -6
- package/dist/primitives/server/McpServerRemoveButton.d.ts.map +1 -1
- package/dist/primitives/server/McpServerRemoveButton.js +21 -14
- package/dist/primitives/server/McpServerRemoveButton.js.map +1 -1
- package/dist/primitives/server/McpServerRoot.d.ts +10 -6
- package/dist/primitives/server/McpServerRoot.d.ts.map +1 -1
- package/dist/primitives/server/McpServerRoot.js +20 -9
- package/dist/primitives/server/McpServerRoot.js.map +1 -1
- package/dist/primitives/server/McpServerStatus.d.ts +10 -6
- package/dist/primitives/server/McpServerStatus.d.ts.map +1 -1
- package/dist/primitives/server/McpServerStatus.js +15 -6
- package/dist/primitives/server/McpServerStatus.js.map +1 -1
- package/dist/primitives/server/McpServerToolName.d.ts +10 -6
- package/dist/primitives/server/McpServerToolName.d.ts.map +1 -1
- package/dist/primitives/server/McpServerToolName.js +15 -6
- package/dist/primitives/server/McpServerToolName.js.map +1 -1
- package/dist/primitives/server/McpServerTools.d.ts +12 -8
- package/dist/primitives/server/McpServerTools.d.ts.map +1 -1
- package/dist/primitives/server/McpServerTools.js +17 -13
- package/dist/primitives/server/McpServerTools.js.map +1 -1
- package/dist/primitives/server.d.ts +18 -11
- package/dist/primitives/server.d.ts.map +1 -1
- package/dist/primitives/server.js +30 -11
- package/dist/primitives/server.js.map +1 -1
- package/dist/resources/McpManagerResource.d.ts +13 -11
- package/dist/resources/McpManagerResource.d.ts.map +1 -1
- package/dist/resources/McpManagerResource.js +149 -183
- package/dist/resources/McpManagerResource.js.map +1 -1
- package/dist/resources/McpServerResource.d.ts +19 -15
- package/dist/resources/McpServerResource.d.ts.map +1 -1
- package/dist/resources/McpServerResource.js +186 -235
- package/dist/resources/McpServerResource.js.map +1 -1
- package/dist/resources/storage/McpCustomStorage.d.ts +6 -2
- package/dist/resources/storage/McpCustomStorage.d.ts.map +1 -1
- package/dist/resources/storage/McpCustomStorage.js +5 -1
- package/dist/resources/storage/McpCustomStorage.js.map +1 -1
- package/dist/resources/storage/McpLocalStorage.d.ts +9 -7
- package/dist/resources/storage/McpLocalStorage.d.ts.map +1 -1
- package/dist/resources/storage/McpLocalStorage.js +51 -62
- package/dist/resources/storage/McpLocalStorage.js.map +1 -1
- package/dist/resources/storage/McpMemoryStorage.d.ts +6 -2
- package/dist/resources/storage/McpMemoryStorage.d.ts.map +1 -1
- package/dist/resources/storage/McpMemoryStorage.js +20 -16
- package/dist/resources/storage/McpMemoryStorage.js.map +1 -1
- package/dist/resources/storage/types.d.ts +14 -10
- package/dist/resources/storage/types.d.ts.map +1 -1
- package/dist/resources/storage/types.js +0 -2
- package/dist/utils/serverId.d.ts +4 -1
- package/dist/utils/serverId.d.ts.map +1 -1
- package/dist/utils/serverId.js +8 -14
- package/dist/utils/serverId.js.map +1 -1
- package/package.json +12 -12
- package/dist/auth/types.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/mcp-scope.js.map +0 -1
- package/dist/resources/storage/types.js.map +0 -1
|
@@ -1,102 +1,142 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef, useCallback, useMemo, useState, } from "react";
|
|
3
|
-
import { Primitive } from "@radix-ui/react-primitive";
|
|
4
|
-
import { useAui } from "@assistant-ui/store";
|
|
5
1
|
import { AddFormContext } from "./context.js";
|
|
2
|
+
import { useAui } from "@assistant-ui/store";
|
|
3
|
+
import { forwardRef, useCallback, useMemo, useState } from "react";
|
|
4
|
+
import { Primitive } from "@radix-ui/react-primitive";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
//#region src/primitives/addForm/McpAddFormRoot.tsx
|
|
6
7
|
const INITIAL = {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
name: "",
|
|
9
|
+
url: "",
|
|
10
|
+
authType: "oauth",
|
|
11
|
+
bearerToken: "",
|
|
12
|
+
scopes: "",
|
|
13
|
+
submitting: false,
|
|
14
|
+
error: null
|
|
14
15
|
};
|
|
15
16
|
function validateUrl(raw) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
if (parsed.protocol !== "http:" && parsed.protocol !== "https:") {
|
|
27
|
-
return { error: "URL must be http(s)" };
|
|
28
|
-
}
|
|
29
|
-
return { url: trimmed };
|
|
17
|
+
const trimmed = raw.trim();
|
|
18
|
+
if (!trimmed) return { error: "URL is required" };
|
|
19
|
+
let parsed;
|
|
20
|
+
try {
|
|
21
|
+
parsed = new URL(trimmed);
|
|
22
|
+
} catch {
|
|
23
|
+
return { error: "Invalid URL" };
|
|
24
|
+
}
|
|
25
|
+
if (parsed.protocol !== "http:" && parsed.protocol !== "https:") return { error: "URL must be http(s)" };
|
|
26
|
+
return { url: trimmed };
|
|
30
27
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
28
|
+
const McpAddFormPrimitiveRoot = forwardRef(({ onSubmitted, onCancel, ...props }, ref) => {
|
|
29
|
+
const aui = useAui();
|
|
30
|
+
const [state, setState] = useState(INITIAL);
|
|
31
|
+
const setField = useCallback((key, value) => {
|
|
32
|
+
setState((prev) => ({
|
|
33
|
+
...prev,
|
|
34
|
+
[key]: value
|
|
35
|
+
}));
|
|
36
|
+
}, []);
|
|
37
|
+
const reset = useCallback(() => setState(INITIAL), []);
|
|
38
|
+
const buildAuth = useCallback(() => {
|
|
39
|
+
switch (state.authType) {
|
|
40
|
+
case "none": return { type: "none" };
|
|
41
|
+
case "bearer": return {
|
|
42
|
+
type: "bearer",
|
|
43
|
+
token: state.bearerToken || void 0
|
|
44
|
+
};
|
|
45
|
+
case "oauth": {
|
|
46
|
+
const scopeList = state.scopes.split(/[\s,]+/).map((s) => s.trim()).filter(Boolean);
|
|
47
|
+
return {
|
|
48
|
+
type: "oauth",
|
|
49
|
+
scopes: scopeList.length > 0 ? scopeList : void 0
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}, [
|
|
54
|
+
state.authType,
|
|
55
|
+
state.bearerToken,
|
|
56
|
+
state.scopes
|
|
57
|
+
]);
|
|
58
|
+
const submit = useCallback(async () => {
|
|
59
|
+
if (state.submitting) return;
|
|
60
|
+
if (!state.name.trim()) {
|
|
61
|
+
setState((p) => ({
|
|
62
|
+
...p,
|
|
63
|
+
error: "Name is required"
|
|
64
|
+
}));
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
if (state.authType === "bearer" && !state.bearerToken.trim()) {
|
|
68
|
+
setState((p) => ({
|
|
69
|
+
...p,
|
|
70
|
+
error: "Bearer token is required"
|
|
71
|
+
}));
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
const urlResult = validateUrl(state.url);
|
|
75
|
+
if ("error" in urlResult) {
|
|
76
|
+
setState((p) => ({
|
|
77
|
+
...p,
|
|
78
|
+
error: urlResult.error
|
|
79
|
+
}));
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
setState((p) => ({
|
|
83
|
+
...p,
|
|
84
|
+
submitting: true,
|
|
85
|
+
error: null
|
|
86
|
+
}));
|
|
87
|
+
try {
|
|
88
|
+
const id = await aui.mcp().addCustomServer({
|
|
89
|
+
name: state.name.trim(),
|
|
90
|
+
url: urlResult.url,
|
|
91
|
+
auth: buildAuth()
|
|
92
|
+
});
|
|
93
|
+
setState(INITIAL);
|
|
94
|
+
onSubmitted?.(id);
|
|
95
|
+
} catch (err) {
|
|
96
|
+
setState((p) => ({
|
|
97
|
+
...p,
|
|
98
|
+
submitting: false,
|
|
99
|
+
error: err instanceof Error ? err.message : String(err)
|
|
100
|
+
}));
|
|
101
|
+
}
|
|
102
|
+
}, [
|
|
103
|
+
aui,
|
|
104
|
+
buildAuth,
|
|
105
|
+
onSubmitted,
|
|
106
|
+
state
|
|
107
|
+
]);
|
|
108
|
+
const cancel = useCallback(() => {
|
|
109
|
+
setState(INITIAL);
|
|
110
|
+
onCancel?.();
|
|
111
|
+
}, [onCancel]);
|
|
112
|
+
const value = useMemo(() => ({
|
|
113
|
+
state,
|
|
114
|
+
setField,
|
|
115
|
+
reset,
|
|
116
|
+
submit,
|
|
117
|
+
cancel
|
|
118
|
+
}), [
|
|
119
|
+
state,
|
|
120
|
+
setField,
|
|
121
|
+
reset,
|
|
122
|
+
submit,
|
|
123
|
+
cancel
|
|
124
|
+
]);
|
|
125
|
+
const onFormSubmit = (e) => {
|
|
126
|
+
e.preventDefault();
|
|
127
|
+
submit();
|
|
128
|
+
};
|
|
129
|
+
return /* @__PURE__ */ jsx(AddFormContext.Provider, {
|
|
130
|
+
value,
|
|
131
|
+
children: /* @__PURE__ */ jsx(Primitive.form, {
|
|
132
|
+
...props,
|
|
133
|
+
ref,
|
|
134
|
+
onSubmit: onFormSubmit
|
|
135
|
+
})
|
|
136
|
+
});
|
|
100
137
|
});
|
|
101
138
|
McpAddFormPrimitiveRoot.displayName = "McpAddFormPrimitive.Root";
|
|
139
|
+
//#endregion
|
|
140
|
+
export { McpAddFormPrimitiveRoot };
|
|
141
|
+
|
|
102
142
|
//# sourceMappingURL=McpAddFormRoot.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"McpAddFormRoot.js","
|
|
1
|
+
{"version":3,"file":"McpAddFormRoot.js","names":[],"sources":["../../../src/primitives/addForm/McpAddFormRoot.tsx"],"sourcesContent":["import {\n type ComponentPropsWithoutRef,\n type ComponentRef,\n type FormEventHandler,\n forwardRef,\n useCallback,\n useMemo,\n useState,\n} from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useAui } from \"@assistant-ui/store\";\nimport { AddFormContext, type AddFormState } from \"./context\";\nimport type { MCPAuthConfig } from \"../../mcp-scope\";\n\nconst INITIAL: AddFormState = {\n name: \"\",\n url: \"\",\n authType: \"oauth\",\n bearerToken: \"\",\n scopes: \"\",\n submitting: false,\n error: null,\n};\n\nfunction validateUrl(raw: string): { url: string } | { error: string } {\n const trimmed = raw.trim();\n if (!trimmed) return { error: \"URL is required\" };\n let parsed: URL;\n try {\n parsed = new URL(trimmed);\n } catch {\n return { error: \"Invalid URL\" };\n }\n if (parsed.protocol !== \"http:\" && parsed.protocol !== \"https:\") {\n return { error: \"URL must be http(s)\" };\n }\n return { url: trimmed };\n}\n\nexport namespace McpAddFormPrimitiveRoot {\n export type Element = ComponentRef<typeof Primitive.form>;\n export type Props = Omit<\n ComponentPropsWithoutRef<typeof Primitive.form>,\n \"onSubmit\"\n > & {\n onSubmitted?: (id: string) => void;\n onCancel?: () => void;\n };\n}\n\nexport const McpAddFormPrimitiveRoot = forwardRef<\n McpAddFormPrimitiveRoot.Element,\n McpAddFormPrimitiveRoot.Props\n>(({ onSubmitted, onCancel, ...props }, ref) => {\n const aui = useAui();\n const [state, setState] = useState<AddFormState>(INITIAL);\n\n const setField = useCallback(\n <K extends keyof AddFormState>(key: K, value: AddFormState[K]) => {\n setState((prev) => ({ ...prev, [key]: value }));\n },\n [],\n );\n\n const reset = useCallback(() => setState(INITIAL), []);\n\n const buildAuth = useCallback((): MCPAuthConfig => {\n switch (state.authType) {\n case \"none\":\n return { type: \"none\" };\n case \"bearer\":\n return { type: \"bearer\", token: state.bearerToken || undefined };\n case \"oauth\": {\n const scopeList = state.scopes\n .split(/[\\s,]+/)\n .map((s) => s.trim())\n .filter(Boolean);\n return {\n type: \"oauth\",\n scopes: scopeList.length > 0 ? scopeList : undefined,\n };\n }\n }\n }, [state.authType, state.bearerToken, state.scopes]);\n\n const submit = useCallback(async () => {\n if (state.submitting) return;\n if (!state.name.trim()) {\n setState((p) => ({ ...p, error: \"Name is required\" }));\n return;\n }\n if (state.authType === \"bearer\" && !state.bearerToken.trim()) {\n setState((p) => ({ ...p, error: \"Bearer token is required\" }));\n return;\n }\n const urlResult = validateUrl(state.url);\n if (\"error\" in urlResult) {\n setState((p) => ({ ...p, error: urlResult.error }));\n return;\n }\n setState((p) => ({ ...p, submitting: true, error: null }));\n try {\n const id = await aui.mcp().addCustomServer({\n name: state.name.trim(),\n url: urlResult.url,\n auth: buildAuth(),\n });\n setState(INITIAL);\n onSubmitted?.(id);\n } catch (err) {\n setState((p) => ({\n ...p,\n submitting: false,\n error: err instanceof Error ? err.message : String(err),\n }));\n }\n }, [aui, buildAuth, onSubmitted, state]);\n\n const cancel = useCallback(() => {\n setState(INITIAL);\n onCancel?.();\n }, [onCancel]);\n\n const value = useMemo(\n () => ({ state, setField, reset, submit, cancel }),\n [state, setField, reset, submit, cancel],\n );\n\n const onFormSubmit: FormEventHandler<HTMLFormElement> = (e) => {\n e.preventDefault();\n void submit();\n };\n\n return (\n <AddFormContext.Provider value={value}>\n <Primitive.form {...props} ref={ref} onSubmit={onFormSubmit} />\n </AddFormContext.Provider>\n );\n});\n\nMcpAddFormPrimitiveRoot.displayName = \"McpAddFormPrimitive.Root\";\n"],"mappings":"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"}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ComponentPropsWithoutRef, ComponentRef } from "react";
|
|
2
2
|
import { Primitive } from "@radix-ui/react-primitive";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
|
|
4
|
+
//#region src/primitives/addForm/McpAddFormSubmit.d.ts
|
|
5
|
+
declare namespace McpAddFormPrimitiveSubmit {
|
|
6
|
+
type Element = ComponentRef<typeof Primitive.button>;
|
|
7
|
+
type Props = ComponentPropsWithoutRef<typeof Primitive.button>;
|
|
6
8
|
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
+
declare const McpAddFormPrimitiveSubmit: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
10
|
+
asChild?: boolean;
|
|
9
11
|
}, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { McpAddFormPrimitiveSubmit };
|
|
10
14
|
//# sourceMappingURL=McpAddFormSubmit.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"McpAddFormSubmit.d.ts","
|
|
1
|
+
{"version":3,"file":"McpAddFormSubmit.d.ts","names":[],"sources":["../../../src/primitives/addForm/McpAddFormSubmit.tsx"],"mappings":";;;;kBAQiB,yBAAA;EAAA,KACH,OAAA,GAAU,YAAA,QAAoB,SAAA,CAAU,MAAA;EAAA,KACxC,KAAA,GAAQ,wBAAA,QAAgC,SAAA,CAAU,MAAA;AAAA;AAAA,cAGnD,yBAAA,kBAAyB,yBAAA,CAAA,IAAA,iBAAA,eAAA,CAAA,iBAAA,oBAAA,oBAAA,CAAA,iBAAA"}
|
|
@@ -1,10 +1,20 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef, } from "react";
|
|
3
|
-
import { Primitive } from "@radix-ui/react-primitive";
|
|
4
1
|
import { useAddForm } from "./context.js";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { Primitive } from "@radix-ui/react-primitive";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
//#region src/primitives/addForm/McpAddFormSubmit.tsx
|
|
6
|
+
const McpAddFormPrimitiveSubmit = forwardRef((props, ref) => {
|
|
7
|
+
const { state } = useAddForm();
|
|
8
|
+
return /* @__PURE__ */ jsx(Primitive.button, {
|
|
9
|
+
type: "submit",
|
|
10
|
+
...props,
|
|
11
|
+
ref,
|
|
12
|
+
disabled: props.disabled || state.submitting,
|
|
13
|
+
"data-submitting": state.submitting || void 0
|
|
14
|
+
});
|
|
8
15
|
});
|
|
9
16
|
McpAddFormPrimitiveSubmit.displayName = "McpAddFormPrimitive.Submit";
|
|
17
|
+
//#endregion
|
|
18
|
+
export { McpAddFormPrimitiveSubmit };
|
|
19
|
+
|
|
10
20
|
//# sourceMappingURL=McpAddFormSubmit.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"McpAddFormSubmit.js","
|
|
1
|
+
{"version":3,"file":"McpAddFormSubmit.js","names":[],"sources":["../../../src/primitives/addForm/McpAddFormSubmit.tsx"],"sourcesContent":["import {\n type ComponentPropsWithoutRef,\n type ComponentRef,\n forwardRef,\n} from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useAddForm } from \"./context\";\n\nexport namespace McpAddFormPrimitiveSubmit {\n export type Element = ComponentRef<typeof Primitive.button>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.button>;\n}\n\nexport const McpAddFormPrimitiveSubmit = forwardRef<\n McpAddFormPrimitiveSubmit.Element,\n McpAddFormPrimitiveSubmit.Props\n>((props, ref) => {\n const { state } = useAddForm();\n return (\n <Primitive.button\n type=\"submit\"\n {...props}\n ref={ref}\n disabled={props.disabled || state.submitting}\n data-submitting={state.submitting || undefined}\n />\n );\n});\n\nMcpAddFormPrimitiveSubmit.displayName = \"McpAddFormPrimitive.Submit\";\n"],"mappings":";;;;;AAaA,MAAa,4BAA4B,YAGtC,OAAO,QAAQ;CAChB,MAAM,EAAE,UAAU,WAAW;CAC7B,OACE,oBAAC,UAAU,QAAX;EACE,MAAK;EACL,GAAI;EACC;EACL,UAAU,MAAM,YAAY,MAAM;EAClC,mBAAiB,MAAM,cAAc,KAAA;CACtC,CAAA;AAEL,CAAC;AAED,0BAA0B,cAAc"}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ComponentPropsWithoutRef, ComponentRef } from "react";
|
|
2
2
|
import { Primitive } from "@radix-ui/react-primitive";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
|
|
4
|
+
//#region src/primitives/addForm/McpAddFormUrlField.d.ts
|
|
5
|
+
declare namespace McpAddFormPrimitiveUrlField {
|
|
6
|
+
type Element = ComponentRef<typeof Primitive.input>;
|
|
7
|
+
type Props = Omit<ComponentPropsWithoutRef<typeof Primitive.input>, "value" | "onChange" | "type">;
|
|
6
8
|
}
|
|
7
|
-
|
|
9
|
+
declare const McpAddFormPrimitiveUrlField: import("react").ForwardRefExoticComponent<McpAddFormPrimitiveUrlField.Props & import("react").RefAttributes<HTMLInputElement>>;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { McpAddFormPrimitiveUrlField };
|
|
8
12
|
//# sourceMappingURL=McpAddFormUrlField.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"McpAddFormUrlField.d.ts","
|
|
1
|
+
{"version":3,"file":"McpAddFormUrlField.d.ts","names":[],"sources":["../../../src/primitives/addForm/McpAddFormUrlField.tsx"],"mappings":";;;;kBAQiB,2BAAA;EAAA,KACH,OAAA,GAAU,YAAA,QAAoB,SAAA,CAAU,KAAA;EAAA,KACxC,KAAA,GAAQ,IAAA,CAClB,wBAAA,QAAgC,SAAA,CAAU,KAAA;AAAA;AAAA,cAKjC,2BAAA,kBAA2B,yBAAA,CAAA,2BAAA,CAAA,KAAA,mBAAA,aAAA,CAAA,gBAAA"}
|
|
@@ -1,10 +1,22 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef, } from "react";
|
|
3
|
-
import { Primitive } from "@radix-ui/react-primitive";
|
|
4
1
|
import { useAddForm } from "./context.js";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { Primitive } from "@radix-ui/react-primitive";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
//#region src/primitives/addForm/McpAddFormUrlField.tsx
|
|
6
|
+
const McpAddFormPrimitiveUrlField = forwardRef((props, ref) => {
|
|
7
|
+
const { state, setField } = useAddForm();
|
|
8
|
+
return /* @__PURE__ */ jsx(Primitive.input, {
|
|
9
|
+
type: "url",
|
|
10
|
+
inputMode: "url",
|
|
11
|
+
placeholder: "https://example.com/mcp",
|
|
12
|
+
...props,
|
|
13
|
+
ref,
|
|
14
|
+
value: state.url,
|
|
15
|
+
onChange: (e) => setField("url", e.target.value)
|
|
16
|
+
});
|
|
8
17
|
});
|
|
9
18
|
McpAddFormPrimitiveUrlField.displayName = "McpAddFormPrimitive.UrlField";
|
|
19
|
+
//#endregion
|
|
20
|
+
export { McpAddFormPrimitiveUrlField };
|
|
21
|
+
|
|
10
22
|
//# sourceMappingURL=McpAddFormUrlField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"McpAddFormUrlField.js","
|
|
1
|
+
{"version":3,"file":"McpAddFormUrlField.js","names":[],"sources":["../../../src/primitives/addForm/McpAddFormUrlField.tsx"],"sourcesContent":["import {\n type ComponentPropsWithoutRef,\n type ComponentRef,\n forwardRef,\n} from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useAddForm } from \"./context\";\n\nexport namespace McpAddFormPrimitiveUrlField {\n export type Element = ComponentRef<typeof Primitive.input>;\n export type Props = Omit<\n ComponentPropsWithoutRef<typeof Primitive.input>,\n \"value\" | \"onChange\" | \"type\"\n >;\n}\n\nexport const McpAddFormPrimitiveUrlField = forwardRef<\n McpAddFormPrimitiveUrlField.Element,\n McpAddFormPrimitiveUrlField.Props\n>((props, ref) => {\n const { state, setField } = useAddForm();\n return (\n <Primitive.input\n type=\"url\"\n inputMode=\"url\"\n placeholder=\"https://example.com/mcp\"\n {...props}\n ref={ref}\n value={state.url}\n onChange={(e) => setField(\"url\", e.target.value)}\n />\n );\n});\n\nMcpAddFormPrimitiveUrlField.displayName = \"McpAddFormPrimitive.UrlField\";\n"],"mappings":";;;;;AAgBA,MAAa,8BAA8B,YAGxC,OAAO,QAAQ;CAChB,MAAM,EAAE,OAAO,aAAa,WAAW;CACvC,OACE,oBAAC,UAAU,OAAX;EACE,MAAK;EACL,WAAU;EACV,aAAY;EACZ,GAAI;EACC;EACL,OAAO,MAAM;EACb,WAAW,MAAM,SAAS,OAAO,EAAE,OAAO,KAAK;CAChD,CAAA;AAEL,CAAC;AAED,4BAA4B,cAAc"}
|
|
@@ -1,21 +1,25 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { MCPAuthConfig } from "../../mcp-scope.js";
|
|
2
|
+
|
|
3
|
+
//#region src/primitives/addForm/context.d.ts
|
|
4
|
+
type AddFormAuthType = MCPAuthConfig["type"];
|
|
5
|
+
type AddFormState = {
|
|
6
|
+
name: string;
|
|
7
|
+
url: string;
|
|
8
|
+
authType: AddFormAuthType;
|
|
9
|
+
bearerToken: string;
|
|
10
|
+
scopes: string;
|
|
11
|
+
submitting: boolean;
|
|
12
|
+
error: string | null;
|
|
11
13
|
};
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
type AddFormContextValue = {
|
|
15
|
+
state: AddFormState;
|
|
16
|
+
setField: <K extends keyof AddFormState>(key: K, value: AddFormState[K]) => void;
|
|
17
|
+
reset: () => void;
|
|
18
|
+
submit: () => Promise<void>;
|
|
19
|
+
cancel: () => void;
|
|
18
20
|
};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
declare const AddFormContext: import("react").Context<AddFormContextValue | null>;
|
|
22
|
+
declare const useAddForm: () => AddFormContextValue;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { AddFormAuthType, AddFormContext, AddFormContextValue, AddFormState, useAddForm };
|
|
21
25
|
//# sourceMappingURL=context.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","
|
|
1
|
+
{"version":3,"file":"context.d.ts","names":[],"sources":["../../../src/primitives/addForm/context.tsx"],"mappings":";;;KAGY,eAAA,GAAkB,aAAa;AAAA,KAE/B,YAAA;EACV,IAAA;EACA,GAAA;EACA,QAAA,EAAU,eAAe;EACzB,WAAA;EACA,MAAA;EACA,UAAA;EACA,KAAA;AAAA;AAAA,KAGU,mBAAA;EACV,KAAA,EAAO,YAAA;EACP,QAAA,mBAA2B,YAAA,EACzB,GAAA,EAAK,CAAA,EACL,KAAA,EAAO,YAAA,CAAa,CAAA;EAEtB,KAAA;EACA,MAAA,QAAc,OAAA;EACd,MAAA;AAAA;AAAA,cAGW,cAAA,kBAAc,OAAA,CAAA,mBAAA;AAAA,cAEd,UAAA,QAAiB,mBAQ7B"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { createContext, useContext } from "react";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
return ctx;
|
|
2
|
+
//#region src/primitives/addForm/context.tsx
|
|
3
|
+
const AddFormContext = createContext(null);
|
|
4
|
+
const useAddForm = () => {
|
|
5
|
+
const ctx = useContext(AddFormContext);
|
|
6
|
+
if (!ctx) throw new Error("McpAddFormPrimitive.* must be used inside McpAddFormPrimitive.Root");
|
|
7
|
+
return ctx;
|
|
9
8
|
};
|
|
9
|
+
//#endregion
|
|
10
|
+
export { AddFormContext, useAddForm };
|
|
11
|
+
|
|
10
12
|
//# sourceMappingURL=context.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","
|
|
1
|
+
{"version":3,"file":"context.js","names":[],"sources":["../../../src/primitives/addForm/context.tsx"],"sourcesContent":["import { createContext, useContext } from \"react\";\nimport type { MCPAuthConfig } from \"../../mcp-scope\";\n\nexport type AddFormAuthType = MCPAuthConfig[\"type\"];\n\nexport type AddFormState = {\n name: string;\n url: string;\n authType: AddFormAuthType;\n bearerToken: string;\n scopes: string;\n submitting: boolean;\n error: string | null;\n};\n\nexport type AddFormContextValue = {\n state: AddFormState;\n setField: <K extends keyof AddFormState>(\n key: K,\n value: AddFormState[K],\n ) => void;\n reset: () => void;\n submit: () => Promise<void>;\n cancel: () => void;\n};\n\nexport const AddFormContext = createContext<AddFormContextValue | null>(null);\n\nexport const useAddForm = (): AddFormContextValue => {\n const ctx = useContext(AddFormContext);\n if (!ctx) {\n throw new Error(\n \"McpAddFormPrimitive.* must be used inside McpAddFormPrimitive.Root\",\n );\n }\n return ctx;\n};\n"],"mappings":";;AA0BA,MAAa,iBAAiB,cAA0C,IAAI;AAE5E,MAAa,mBAAwC;CACnD,MAAM,MAAM,WAAW,cAAc;CACrC,IAAI,CAAC,KACH,MAAM,IAAI,MACR,oEACF;CAEF,OAAO;AACT"}
|
|
@@ -1,9 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { McpAddFormPrimitiveRoot } from "./addForm/McpAddFormRoot.js";
|
|
2
|
+
import { McpAddFormPrimitiveNameField } from "./addForm/McpAddFormNameField.js";
|
|
3
|
+
import { McpAddFormPrimitiveUrlField } from "./addForm/McpAddFormUrlField.js";
|
|
4
|
+
import { McpAddFormPrimitiveAuthSelect } from "./addForm/McpAddFormAuthSelect.js";
|
|
5
|
+
import { McpAddFormPrimitiveAuthFields } from "./addForm/McpAddFormAuthFields.js";
|
|
6
|
+
import { McpAddFormPrimitiveSubmit } from "./addForm/McpAddFormSubmit.js";
|
|
7
|
+
import { McpAddFormPrimitiveCancel } from "./addForm/McpAddFormCancel.js";
|
|
8
|
+
import { McpAddFormPrimitiveError } from "./addForm/McpAddFormError.js";
|
|
9
|
+
|
|
10
|
+
//#region src/primitives/addForm.d.ts
|
|
11
|
+
declare namespace addForm_d_exports {
|
|
12
|
+
export { McpAddFormPrimitiveAuthFields as AuthFields, McpAddFormPrimitiveAuthSelect as AuthSelect, McpAddFormPrimitiveCancel as Cancel, McpAddFormPrimitiveError as Error, McpAddFormPrimitiveNameField as NameField, McpAddFormPrimitiveRoot as Root, McpAddFormPrimitiveSubmit as Submit, McpAddFormPrimitiveUrlField as UrlField };
|
|
13
|
+
}
|
|
14
|
+
//#endregion
|
|
15
|
+
export { McpAddFormPrimitiveAuthFields as AuthFields, McpAddFormPrimitiveAuthSelect as AuthSelect, McpAddFormPrimitiveCancel as Cancel, McpAddFormPrimitiveError as Error, McpAddFormPrimitiveNameField as NameField, McpAddFormPrimitiveRoot as Root, McpAddFormPrimitiveSubmit as Submit, McpAddFormPrimitiveUrlField as UrlField, addForm_d_exports };
|
|
9
16
|
//# sourceMappingURL=addForm.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addForm.d.ts","
|
|
1
|
+
{"version":3,"file":"addForm.d.ts","names":[],"sources":["../../src/primitives/addForm.ts"],"mappings":""}
|
|
@@ -1,9 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { __exportAll } from "../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { McpAddFormPrimitiveRoot } from "./addForm/McpAddFormRoot.js";
|
|
3
|
+
import { McpAddFormPrimitiveNameField } from "./addForm/McpAddFormNameField.js";
|
|
4
|
+
import { McpAddFormPrimitiveUrlField } from "./addForm/McpAddFormUrlField.js";
|
|
5
|
+
import { McpAddFormPrimitiveAuthSelect } from "./addForm/McpAddFormAuthSelect.js";
|
|
6
|
+
import { McpAddFormPrimitiveAuthFields } from "./addForm/McpAddFormAuthFields.js";
|
|
7
|
+
import { McpAddFormPrimitiveSubmit } from "./addForm/McpAddFormSubmit.js";
|
|
8
|
+
import { McpAddFormPrimitiveCancel } from "./addForm/McpAddFormCancel.js";
|
|
9
|
+
import { McpAddFormPrimitiveError } from "./addForm/McpAddFormError.js";
|
|
10
|
+
//#region src/primitives/addForm.ts
|
|
11
|
+
var addForm_exports = /* @__PURE__ */ __exportAll({
|
|
12
|
+
AuthFields: () => McpAddFormPrimitiveAuthFields,
|
|
13
|
+
AuthSelect: () => McpAddFormPrimitiveAuthSelect,
|
|
14
|
+
Cancel: () => McpAddFormPrimitiveCancel,
|
|
15
|
+
Error: () => McpAddFormPrimitiveError,
|
|
16
|
+
NameField: () => McpAddFormPrimitiveNameField,
|
|
17
|
+
Root: () => McpAddFormPrimitiveRoot,
|
|
18
|
+
Submit: () => McpAddFormPrimitiveSubmit,
|
|
19
|
+
UrlField: () => McpAddFormPrimitiveUrlField
|
|
20
|
+
});
|
|
21
|
+
//#endregion
|
|
22
|
+
export { McpAddFormPrimitiveAuthFields as AuthFields, McpAddFormPrimitiveAuthSelect as AuthSelect, McpAddFormPrimitiveCancel as Cancel, McpAddFormPrimitiveError as Error, McpAddFormPrimitiveNameField as NameField, McpAddFormPrimitiveRoot as Root, McpAddFormPrimitiveSubmit as Submit, McpAddFormPrimitiveUrlField as UrlField, addForm_exports };
|
|
23
|
+
|
|
9
24
|
//# sourceMappingURL=addForm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addForm.js","
|
|
1
|
+
{"version":3,"file":"addForm.js","names":[],"sources":["../../src/primitives/addForm.ts"],"sourcesContent":["export { McpAddFormPrimitiveRoot as Root } from \"./addForm/McpAddFormRoot\";\nexport { McpAddFormPrimitiveNameField as NameField } from \"./addForm/McpAddFormNameField\";\nexport { McpAddFormPrimitiveUrlField as UrlField } from \"./addForm/McpAddFormUrlField\";\nexport { McpAddFormPrimitiveAuthSelect as AuthSelect } from \"./addForm/McpAddFormAuthSelect\";\nexport { McpAddFormPrimitiveAuthFields as AuthFields } from \"./addForm/McpAddFormAuthFields\";\nexport { McpAddFormPrimitiveSubmit as Submit } from \"./addForm/McpAddFormSubmit\";\nexport { McpAddFormPrimitiveCancel as Cancel } from \"./addForm/McpAddFormCancel\";\nexport { McpAddFormPrimitiveError as Error } from \"./addForm/McpAddFormError\";\n"],"mappings":""}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ComponentPropsWithoutRef, ComponentRef } from "react";
|
|
2
2
|
import { Primitive } from "@radix-ui/react-primitive";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
|
|
4
|
+
//#region src/primitives/manager/McpManagerAddCustomTrigger.d.ts
|
|
5
|
+
declare namespace McpManagerPrimitiveAddCustomTrigger {
|
|
6
|
+
type Element = ComponentRef<typeof Primitive.button>;
|
|
7
|
+
type Props = ComponentPropsWithoutRef<typeof Primitive.button>;
|
|
6
8
|
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
+
declare const McpManagerPrimitiveAddCustomTrigger: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
10
|
+
asChild?: boolean;
|
|
9
11
|
}, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { McpManagerPrimitiveAddCustomTrigger };
|
|
10
14
|
//# sourceMappingURL=McpManagerAddCustomTrigger.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"McpManagerAddCustomTrigger.d.ts","
|
|
1
|
+
{"version":3,"file":"McpManagerAddCustomTrigger.d.ts","names":[],"sources":["../../../src/primitives/manager/McpManagerAddCustomTrigger.tsx"],"mappings":";;;;kBAOiB,mCAAA;EAAA,KACH,OAAA,GAAU,YAAA,QAAoB,SAAA,CAAU,MAAA;EAAA,KACxC,KAAA,GAAQ,wBAAA,QAAgC,SAAA,CAAU,MAAA;AAAA;AAAA,cAGnD,mCAAA,kBAAmC,yBAAA,CAAA,IAAA,iBAAA,eAAA,CAAA,iBAAA,oBAAA,oBAAA,CAAA,iBAAA"}
|