@scalar/api-client-react 1.0.1 → 1.0.3
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 +33 -0
- package/dist/index.js +3 -658
- package/dist/style.css +1 -1
- package/package.json +5 -3
- package/dist/index.cjs +0 -30
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @scalar/api-client-react
|
|
2
2
|
|
|
3
|
+
## 1.0.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [b4199e9]
|
|
8
|
+
- @scalar/api-client@2.0.30
|
|
9
|
+
|
|
10
|
+
## 1.0.2
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- 5d19345: feat(api-client-react): adds use client directive at the top of file for next.js
|
|
15
|
+
- Updated dependencies [d5408e8]
|
|
16
|
+
- @scalar/api-client@2.0.29
|
|
17
|
+
|
|
3
18
|
## 1.0.1
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as p, jsx as C } from "react/jsx-runtime";
|
|
3
|
+
import { createContext as d, useRef as A, useState as s, useEffect as i, useContext as T } from "react";
|
|
4
|
+
/* empty css */
|
|
5
|
+
const o = d(null);
|
|
6
|
+
globalThis.__VUE_OPTIONS_API__ = !0;
|
|
7
|
+
globalThis.__VUE_PROD_HYDRATION_MISMATCH_DETAILS__ = !0;
|
|
8
|
+
globalThis.__VUE_PROD_DEVTOOLS__ = !1;
|
|
9
|
+
const S = ({
|
|
10
|
+
children: c,
|
|
11
|
+
configuration: l = {}
|
|
12
|
+
}) => {
|
|
13
|
+
const e = A(null), [n, u] = s(null), [_, r] = s(null);
|
|
14
|
+
return i(() => {
|
|
15
|
+
(async () => {
|
|
16
|
+
const { createApiClientModalSync: a } = await import("@scalar/api-client");
|
|
17
|
+
u(() => a);
|
|
18
|
+
})();
|
|
19
|
+
}, []), i(() => {
|
|
20
|
+
if (!(e != null && e.current) || !n) return;
|
|
21
|
+
const t = n(e.current, l, !0, !0);
|
|
22
|
+
return r(t), l.spec && t.updateSpec(l.spec), () => {
|
|
23
|
+
t.app.unmount(), r(null);
|
|
24
|
+
};
|
|
25
|
+
}, [e, n]), /* @__PURE__ */ p(o.Provider, { value: _, children: [
|
|
26
|
+
/* @__PURE__ */ C("div", { ref: e }),
|
|
27
|
+
c
|
|
28
|
+
] });
|
|
29
|
+
}, x = () => T(o);
|
|
30
|
+
export {
|
|
31
|
+
S as ApiClientModalProvider,
|
|
32
|
+
x as useApiClientModal
|
|
33
|
+
};
|