@scalar/api-client-react 1.0.3 → 1.0.5
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/CHANGELOG.md +15 -0
- package/dist/ApiClientModalProvider.js +24 -19
- package/dist/index.d.ts +2968 -4
- package/dist/style.css +1 -1
- package/package.json +3 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @scalar/api-client-react
|
|
2
2
|
|
|
3
|
+
## 1.0.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [6123165]
|
|
8
|
+
- @scalar/api-client@2.0.32
|
|
9
|
+
|
|
10
|
+
## 1.0.4
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- 240a618: feat: allow multiple api-clients on single page
|
|
15
|
+
- Updated dependencies [240a618]
|
|
16
|
+
- @scalar/api-client@2.0.31
|
|
17
|
+
|
|
3
18
|
## 1.0.3
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
|
@@ -1,33 +1,38 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { createContext as
|
|
2
|
+
import { jsxs as C, jsx as d } from "react/jsx-runtime";
|
|
3
|
+
import { createContext as A, useRef as f, useState as c, useEffect as i, useContext as S } from "react";
|
|
4
4
|
/* empty css */
|
|
5
|
-
const
|
|
5
|
+
const _ = A(null);
|
|
6
6
|
globalThis.__VUE_OPTIONS_API__ = !0;
|
|
7
7
|
globalThis.__VUE_PROD_HYDRATION_MISMATCH_DETAILS__ = !0;
|
|
8
8
|
globalThis.__VUE_PROD_DEVTOOLS__ = !1;
|
|
9
|
-
const
|
|
10
|
-
children:
|
|
11
|
-
|
|
9
|
+
const x = ({
|
|
10
|
+
children: a,
|
|
11
|
+
initialRequest: l,
|
|
12
|
+
configuration: n = {}
|
|
12
13
|
}) => {
|
|
13
|
-
const e =
|
|
14
|
+
const e = f(null), [o, u] = c(null), [p, s] = c(null);
|
|
14
15
|
return i(() => {
|
|
15
16
|
(async () => {
|
|
16
|
-
const { createApiClientModalSync:
|
|
17
|
-
u(() =>
|
|
17
|
+
const { createApiClientModalSync: r } = await import("@scalar/api-client/layouts/Modal");
|
|
18
|
+
u(() => r);
|
|
18
19
|
})();
|
|
19
20
|
}, []), i(() => {
|
|
20
|
-
if (!(e != null && e.current) || !
|
|
21
|
-
const t =
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
if (!(e != null && e.current) || !o) return;
|
|
22
|
+
const t = o(e.current, n);
|
|
23
|
+
s(t);
|
|
24
|
+
const r = async () => {
|
|
25
|
+
await t.updateSpec(n.spec), l && t.route(l);
|
|
24
26
|
};
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
return n.spec ? r() : l && t.route(l), () => {
|
|
28
|
+
t.app.unmount(), s(null);
|
|
29
|
+
};
|
|
30
|
+
}, [e, o]), /* @__PURE__ */ C(_.Provider, { value: p, children: [
|
|
31
|
+
/* @__PURE__ */ d("div", { ref: e }),
|
|
32
|
+
a
|
|
28
33
|
] });
|
|
29
|
-
},
|
|
34
|
+
}, E = () => S(_);
|
|
30
35
|
export {
|
|
31
|
-
|
|
32
|
-
|
|
36
|
+
x as ApiClientModalProvider,
|
|
37
|
+
E as useApiClientModal
|
|
33
38
|
};
|