@typespec/playground 0.14.0-dev.3 → 0.14.0-dev.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/dist/index.js +17 -19
- package/dist/react/index.js +2597 -3056
- package/dist/react/viewers/index.js +23 -17
- package/dist/react-wrapper-B-poU4Lv.js +18 -0
- package/dist/services-CELCHECS.js +723 -0
- package/dist/state-storage.js +65 -79
- package/dist/style.css +2 -1
- package/dist/tooling/index.js +24 -23
- package/dist/vite/index.js +54 -78
- package/package.json +13 -13
- package/dist/react-wrapper-BE4armyk.js +0 -20
- package/dist/services-Z619RuQS.js +0 -760
|
@@ -1,20 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { Suspense, lazy } from "react";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import "swagger-ui-dist/swagger-ui.css";
|
|
4
|
+
//#region src/react/viewers/swagger-ui.module.css
|
|
5
|
+
var swagger_ui_module_default = { "swagger-ui-container": "_swagger-ui-container_1c81n_1" };
|
|
6
|
+
//#endregion
|
|
7
|
+
//#region src/react/viewers/swagger-ui.tsx
|
|
8
|
+
var LazySwaggerUI = lazy(() => import("../../react-wrapper-B-poU4Lv.js"));
|
|
9
|
+
var SwaggerUI = (props) => {
|
|
10
|
+
return /* @__PURE__ */ jsx(Suspense, {
|
|
11
|
+
fallback: /* @__PURE__ */ jsx("div", {}),
|
|
12
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
13
|
+
className: swagger_ui_module_default["swagger-ui-container"],
|
|
14
|
+
children: /* @__PURE__ */ jsx(LazySwaggerUI, { spec: props.spec })
|
|
15
|
+
})
|
|
16
|
+
});
|
|
7
17
|
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region src/react/viewers/index.tsx
|
|
20
|
+
var SwaggerUIViewer = {
|
|
21
|
+
key: "swaggerUI",
|
|
22
|
+
label: "Swagger UI",
|
|
23
|
+
render: ({ content }) => /* @__PURE__ */ jsx(SwaggerUI, { spec: content })
|
|
12
24
|
};
|
|
13
|
-
|
|
14
|
-
const SwaggerUIViewer = {
|
|
15
|
-
key: "swaggerUI",
|
|
16
|
-
label: "Swagger UI",
|
|
17
|
-
render: ({ content }) => /* @__PURE__ */ jsx(SwaggerUI, { spec: content })
|
|
18
|
-
};
|
|
19
|
-
|
|
25
|
+
//#endregion
|
|
20
26
|
export { SwaggerUIViewer };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { useEffect, useRef } from "react";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import SwaggerUIBundle from "swagger-ui-dist/swagger-ui-es-bundle.js";
|
|
4
|
+
//#region src/react/viewers/react-wrapper.tsx
|
|
5
|
+
var react_wrapper_default = (props) => {
|
|
6
|
+
const uiRef = useRef(null);
|
|
7
|
+
const uiInstance = useRef(null);
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
if (uiInstance.current === null) uiInstance.current = SwaggerUIBundle({
|
|
10
|
+
domNode: uiRef.current,
|
|
11
|
+
spec: {}
|
|
12
|
+
});
|
|
13
|
+
uiInstance.current.specActions.updateSpec(props.spec);
|
|
14
|
+
}, [props.spec]);
|
|
15
|
+
return /* @__PURE__ */ jsx("div", { ref: uiRef });
|
|
16
|
+
};
|
|
17
|
+
//#endregion
|
|
18
|
+
export { react_wrapper_default as default };
|