zudoku 0.64.1 → 0.65.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/app/main.d.ts +91 -1
- package/dist/app/main.js +5 -1
- package/dist/app/main.js.map +1 -1
- package/dist/config/config.d.ts +15 -46
- package/dist/config/validators/InputNavigationSchema.d.ts +61 -61
- package/dist/config/validators/NavigationSchema.js +2 -4
- package/dist/config/validators/NavigationSchema.js.map +1 -1
- package/dist/config/validators/ProtectedRoutesSchema.d.ts +1 -1
- package/dist/config/validators/validate.d.ts +158 -2
- package/dist/config/validators/validate.js +37 -0
- package/dist/config/validators/validate.js.map +1 -1
- package/dist/config/validators/validate.test.js +43 -0
- package/dist/config/validators/validate.test.js.map +1 -1
- package/dist/flat-config.d.ts +22 -0
- package/dist/lib/auth/issuer.js +3 -0
- package/dist/lib/auth/issuer.js.map +1 -1
- package/dist/lib/authentication/authentication.d.ts +1 -1
- package/dist/lib/authentication/providers/auth0.js +6 -1
- package/dist/lib/authentication/providers/auth0.js.map +1 -1
- package/dist/lib/authentication/providers/firebase.d.ts +4 -0
- package/dist/lib/authentication/providers/firebase.js +215 -0
- package/dist/lib/authentication/providers/firebase.js.map +1 -0
- package/dist/lib/authentication/providers/supabase.js +1 -6
- package/dist/lib/authentication/providers/supabase.js.map +1 -1
- package/dist/lib/authentication/ui/ZudokuAuthUi.d.ts +24 -0
- package/dist/lib/authentication/ui/ZudokuAuthUi.js +124 -0
- package/dist/lib/authentication/ui/ZudokuAuthUi.js.map +1 -0
- package/dist/lib/authentication/ui/icons/Apple.d.ts +3 -0
- package/dist/lib/authentication/ui/icons/Apple.js +4 -0
- package/dist/lib/authentication/ui/icons/Apple.js.map +1 -0
- package/dist/lib/authentication/ui/icons/Facebook.d.ts +3 -0
- package/dist/lib/authentication/ui/icons/Facebook.js +4 -0
- package/dist/lib/authentication/ui/icons/Facebook.js.map +1 -0
- package/dist/lib/authentication/ui/icons/Github.d.ts +3 -0
- package/dist/lib/authentication/ui/icons/Github.js +4 -0
- package/dist/lib/authentication/ui/icons/Github.js.map +1 -0
- package/dist/lib/authentication/ui/icons/Google.d.ts +3 -0
- package/dist/lib/authentication/ui/icons/Google.js +4 -0
- package/dist/lib/authentication/ui/icons/Google.js.map +1 -0
- package/dist/lib/authentication/ui/icons/Microsoft.d.ts +3 -0
- package/dist/lib/authentication/ui/icons/Microsoft.js +4 -0
- package/dist/lib/authentication/ui/icons/Microsoft.js.map +1 -0
- package/dist/lib/authentication/ui/icons/X.d.ts +3 -0
- package/dist/lib/authentication/ui/icons/X.js +4 -0
- package/dist/lib/authentication/ui/icons/X.js.map +1 -0
- package/dist/lib/components/Autocomplete.d.ts +3 -1
- package/dist/lib/components/Autocomplete.js +6 -2
- package/dist/lib/components/Autocomplete.js.map +1 -1
- package/dist/lib/components/Heading.d.ts +1 -1
- package/dist/lib/components/Layout.js +3 -2
- package/dist/lib/components/Layout.js.map +1 -1
- package/dist/lib/components/navigation/NavigationItem.js +2 -2
- package/dist/lib/components/navigation/NavigationItem.js.map +1 -1
- package/dist/lib/core/RouteGuard.js +6 -6
- package/dist/lib/core/RouteGuard.js.map +1 -1
- package/dist/lib/errors/ErrorAlert.js +1 -1
- package/dist/lib/errors/RouterError.d.ts +3 -1
- package/dist/lib/errors/RouterError.js +3 -2
- package/dist/lib/errors/RouterError.js.map +1 -1
- package/dist/lib/oas/parser/index.js +7 -3
- package/dist/lib/oas/parser/index.js.map +1 -1
- package/dist/lib/plugins/api-keys/ProtectedRoute.js +4 -1
- package/dist/lib/plugins/api-keys/ProtectedRoute.js.map +1 -1
- package/dist/lib/plugins/openapi/CollapsibleCode.d.ts +1 -0
- package/dist/lib/plugins/openapi/CollapsibleCode.js +2 -1
- package/dist/lib/plugins/openapi/CollapsibleCode.js.map +1 -1
- package/dist/lib/plugins/openapi/GeneratedExampleSidecarBox.d.ts +5 -0
- package/dist/lib/plugins/openapi/GeneratedExampleSidecarBox.js +10 -0
- package/dist/lib/plugins/openapi/GeneratedExampleSidecarBox.js.map +1 -0
- package/dist/lib/plugins/openapi/OperationList.js +5 -1
- package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationListItem.d.ts +2 -1
- package/dist/lib/plugins/openapi/OperationListItem.js +3 -2
- package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
- package/dist/lib/plugins/openapi/ParameterList.js +7 -4
- package/dist/lib/plugins/openapi/ParameterList.js.map +1 -1
- package/dist/lib/plugins/openapi/ParameterListItem.js +17 -6
- package/dist/lib/plugins/openapi/ParameterListItem.js.map +1 -1
- package/dist/lib/plugins/openapi/RequestBodySidecarBox.d.ts +9 -2
- package/dist/lib/plugins/openapi/RequestBodySidecarBox.js +5 -2
- package/dist/lib/plugins/openapi/RequestBodySidecarBox.js.map +1 -1
- package/dist/lib/plugins/openapi/ResponsesSidecarBox.d.ts +3 -2
- package/dist/lib/plugins/openapi/ResponsesSidecarBox.js +25 -4
- package/dist/lib/plugins/openapi/ResponsesSidecarBox.js.map +1 -1
- package/dist/lib/plugins/openapi/Sidecar.d.ts +2 -2
- package/dist/lib/plugins/openapi/Sidecar.js +53 -26
- package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
- package/dist/lib/plugins/openapi/SidecarBox.js +4 -4
- package/dist/lib/plugins/openapi/SidecarBox.js.map +1 -1
- package/dist/lib/plugins/openapi/SidecarExamples.d.ts +9 -2
- package/dist/lib/plugins/openapi/SidecarExamples.js +24 -43
- package/dist/lib/plugins/openapi/SidecarExamples.js.map +1 -1
- package/dist/lib/plugins/openapi/components/ConstValue.js +1 -1
- package/dist/lib/plugins/openapi/components/ConstValue.js.map +1 -1
- package/dist/lib/plugins/openapi/components/EnumValues.js +1 -1
- package/dist/lib/plugins/openapi/components/EnumValues.js.map +1 -1
- package/dist/lib/plugins/openapi/components/NonHighlightedCode.d.ts +4 -0
- package/dist/lib/plugins/openapi/components/NonHighlightedCode.js +5 -0
- package/dist/lib/plugins/openapi/components/NonHighlightedCode.js.map +1 -0
- package/dist/lib/plugins/openapi/components/ResponseContent.js +5 -6
- package/dist/lib/plugins/openapi/components/ResponseContent.js.map +1 -1
- package/dist/lib/plugins/openapi/interfaces.d.ts +13 -0
- package/dist/lib/plugins/openapi/playground/BodyPanel.js +67 -15
- package/dist/lib/plugins/openapi/playground/BodyPanel.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/CollapsibleHeader.js +2 -2
- package/dist/lib/plugins/openapi/playground/CollapsibleHeader.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/ExamplesDropdown.js +1 -1
- package/dist/lib/plugins/openapi/playground/ExamplesDropdown.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/Headers.js +23 -83
- package/dist/lib/plugins/openapi/playground/Headers.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/ParamsGrid.d.ts +10 -2
- package/dist/lib/plugins/openapi/playground/ParamsGrid.js +8 -1
- package/dist/lib/plugins/openapi/playground/ParamsGrid.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/PathParams.js +2 -3
- package/dist/lib/plugins/openapi/playground/PathParams.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/Playground.d.ts +7 -0
- package/dist/lib/plugins/openapi/playground/Playground.js +56 -28
- package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js +3 -2
- package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/QueryParams.js +16 -40
- package/dist/lib/plugins/openapi/playground/QueryParams.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/request-panel/MultipartField.d.ts +8 -0
- package/dist/lib/plugins/openapi/playground/request-panel/MultipartField.js +19 -0
- package/dist/lib/plugins/openapi/playground/request-panel/MultipartField.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/request-panel/UrlQueryParams.js +1 -1
- package/dist/lib/plugins/openapi/playground/request-panel/UrlQueryParams.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/request-panel/fieldManager/useKeyValueFieldManager.test.d.ts +1 -0
- package/dist/lib/plugins/openapi/playground/request-panel/fieldManager/useKeyValueFieldManager.test.js +540 -0
- package/dist/lib/plugins/openapi/playground/request-panel/fieldManager/useKeyValueFieldManager.test.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/request-panel/useKeyValueFieldManager.d.ts +40 -0
- package/dist/lib/plugins/openapi/playground/request-panel/useKeyValueFieldManager.js +205 -0
- package/dist/lib/plugins/openapi/playground/request-panel/useKeyValueFieldManager.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js +2 -2
- package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/SchemaExampleAndDefault.js +1 -1
- package/dist/lib/plugins/openapi/schema/SchemaExampleAndDefault.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.js +17 -8
- package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/SchemaView.d.ts +1 -1
- package/dist/lib/plugins/openapi/schema/SchemaView.js +20 -13
- package/dist/lib/plugins/openapi/schema/SchemaView.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/UnionView.js +2 -5
- package/dist/lib/plugins/openapi/schema/UnionView.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/union-helpers.js +0 -1
- package/dist/lib/plugins/openapi/schema/union-helpers.js.map +1 -1
- package/dist/lib/plugins/openapi/util/generateSchemaExample.js +5 -14
- package/dist/lib/plugins/openapi/util/generateSchemaExample.js.map +1 -1
- package/dist/lib/ui/Badge.d.ts +3 -3
- package/dist/lib/ui/Badge.js +9 -7
- package/dist/lib/ui/Badge.js.map +1 -1
- package/dist/lib/ui/Button.d.ts +1 -1
- package/dist/lib/ui/Button.js +1 -0
- package/dist/lib/ui/Button.js.map +1 -1
- package/dist/lib/ui/Checkbox.d.ts +2 -2
- package/dist/lib/ui/Checkbox.js +4 -4
- package/dist/lib/ui/Checkbox.js.map +1 -1
- package/dist/lib/ui/CodeBlock.d.ts +0 -1
- package/dist/lib/ui/CodeBlock.js +1 -1
- package/dist/lib/ui/CodeBlock.js.map +1 -1
- package/dist/lib/ui/Collapsible.d.ts +4 -4
- package/dist/lib/ui/Collapsible.js +11 -4
- package/dist/lib/ui/Collapsible.js.map +1 -1
- package/dist/lib/ui/Command.d.ts +3 -3
- package/dist/lib/ui/EmbeddedCodeBlock.d.ts +0 -1
- package/dist/lib/ui/EmbeddedCodeBlock.js +3 -2
- package/dist/lib/ui/EmbeddedCodeBlock.js.map +1 -1
- package/dist/lib/ui/Frame.d.ts +8 -0
- package/dist/lib/ui/Frame.js +22 -0
- package/dist/lib/ui/Frame.js.map +1 -0
- package/dist/lib/ui/Item.d.ts +23 -0
- package/dist/lib/ui/Item.js +67 -0
- package/dist/lib/ui/Item.js.map +1 -0
- package/dist/lib/ui/NativeSelect.d.ts +5 -0
- package/dist/lib/ui/NativeSelect.js +14 -0
- package/dist/lib/ui/NativeSelect.js.map +1 -0
- package/dist/lib/ui/Select.d.ts +13 -11
- package/dist/lib/ui/Select.js +34 -23
- package/dist/lib/ui/Select.js.map +1 -1
- package/dist/lib/ui/Separator.d.ts +4 -0
- package/dist/lib/ui/Separator.js +8 -0
- package/dist/lib/ui/Separator.js.map +1 -0
- package/dist/lib/ui/Tooltip.d.ts +7 -7
- package/dist/lib/ui/Tooltip.js +16 -10
- package/dist/lib/ui/Tooltip.js.map +1 -1
- package/dist/lib/util/createVariantComponent.d.ts +5 -2
- package/dist/lib/util/createVariantComponent.js +5 -2
- package/dist/lib/util/createVariantComponent.js.map +1 -1
- package/dist/lib/util/flattenAllOf.d.ts +4 -0
- package/dist/lib/util/flattenAllOf.js +65 -0
- package/dist/lib/util/flattenAllOf.js.map +1 -0
- package/dist/lib/util/flattenAllOf.test.d.ts +1 -0
- package/dist/lib/util/flattenAllOf.test.js +532 -0
- package/dist/lib/util/flattenAllOf.test.js.map +1 -0
- package/dist/lib/util/readFrontmatter.d.ts +6 -0
- package/dist/lib/util/readFrontmatter.js +12 -0
- package/dist/lib/util/readFrontmatter.js.map +1 -0
- package/dist/vite/api/SchemaManager.js +6 -18
- package/dist/vite/api/SchemaManager.js.map +1 -1
- package/dist/vite/mdx/remark-last-modified.js +57 -3
- package/dist/vite/mdx/remark-last-modified.js.map +1 -1
- package/dist/vite/plugin-api.js +2 -2
- package/dist/vite/plugin-api.js.map +1 -1
- package/dist/vite/plugin-frontmatter.js +3 -5
- package/dist/vite/plugin-frontmatter.js.map +1 -1
- package/dist/vite/plugin-markdown-export.js +3 -4
- package/dist/vite/plugin-markdown-export.js.map +1 -1
- package/dist/vite/plugin-theme.js +10 -1
- package/dist/vite/plugin-theme.js.map +1 -1
- package/lib/{Button-DmS4u8Lj.js → Button-B3ucvvQw.js} +7 -6
- package/lib/Button-B3ucvvQw.js.map +1 -0
- package/lib/{ErrorAlert-DE3Sf66a.js → ErrorAlert-BOVgwTRP.js} +2832 -2857
- package/lib/ErrorAlert-BOVgwTRP.js.map +1 -0
- package/lib/{MdxPage-DZfeC0QY.js → MdxPage-CBYFyqUs.js} +6 -6
- package/lib/{MdxPage-DZfeC0QY.js.map → MdxPage-CBYFyqUs.js.map} +1 -1
- package/lib/{OAuthErrorPage-BycMozgn.js → OAuthErrorPage-DlTYnbLO.js} +4 -4
- package/lib/{OAuthErrorPage-BycMozgn.js.map → OAuthErrorPage-DlTYnbLO.js.map} +1 -1
- package/lib/{OasProvider-1XEOsIiW.js → OasProvider-DIPAQ79S.js} +2 -2
- package/lib/{OasProvider-1XEOsIiW.js.map → OasProvider-DIPAQ79S.js.map} +1 -1
- package/lib/OperationList-BOTFIfda.js +5688 -0
- package/lib/OperationList-BOTFIfda.js.map +1 -0
- package/lib/{Pagination-CJszmeSA.js → Pagination-BOZ9Pxcw.js} +2 -2
- package/lib/{Pagination-CJszmeSA.js.map → Pagination-BOZ9Pxcw.js.map} +1 -1
- package/lib/RouteGuard-Brz95MSt.js +77 -0
- package/lib/RouteGuard-Brz95MSt.js.map +1 -0
- package/lib/RouterError-DQS_bMwf.js +42 -0
- package/lib/RouterError-DQS_bMwf.js.map +1 -0
- package/lib/{SchemaList-qOHkDzSz.js → SchemaList-Bu95q_q2.js} +7 -7
- package/lib/{SchemaList-qOHkDzSz.js.map → SchemaList-Bu95q_q2.js.map} +1 -1
- package/lib/SchemaView-CaxK_HV4.js +586 -0
- package/lib/SchemaView-CaxK_HV4.js.map +1 -0
- package/lib/Select-DFRCS31-.js +399 -0
- package/lib/Select-DFRCS31-.js.map +1 -0
- package/lib/{SignUp-6SGx9Yyq.js → SignUp-CfB278ao.js} +2 -2
- package/lib/{SignUp-6SGx9Yyq.js.map → SignUp-CfB278ao.js.map} +1 -1
- package/lib/{SyntaxHighlight-zvlnSnHB.js → SyntaxHighlight-C19vH0V_.js} +525 -509
- package/lib/SyntaxHighlight-C19vH0V_.js.map +1 -0
- package/lib/{Toc-Da9yp7lo.js → Toc-DQIqdghO.js} +2 -2
- package/lib/{Toc-Da9yp7lo.js.map → Toc-DQIqdghO.js.map} +1 -1
- package/lib/{circular-CSSuz-LS.js → circular-B-_VyILZ.js} +6360 -5953
- package/lib/circular-B-_VyILZ.js.map +1 -0
- package/lib/{createServer-CLbcVLbK.js → createServer-C5lXk4ba.js} +4732 -4273
- package/lib/createServer-C5lXk4ba.js.map +1 -0
- package/lib/{errors-CuGgh3hf.js → errors-DqoyOKev.js} +2 -2
- package/lib/{errors-CuGgh3hf.js.map → errors-DqoyOKev.js.map} +1 -1
- package/lib/index-B7yD7ZUk.js +3680 -0
- package/lib/index-B7yD7ZUk.js.map +1 -0
- package/lib/{index-rYHsvtTo.js → index-BG79m3lF.js} +2 -2
- package/lib/{index-rYHsvtTo.js.map → index-BG79m3lF.js.map} +1 -1
- package/lib/{index-B1rmok4X.js → index-DHDtI9H5.js} +3 -3
- package/lib/{index-B1rmok4X.js.map → index-DHDtI9H5.js.map} +1 -1
- package/lib/ui/ActionButton.js +1 -1
- package/lib/ui/Badge.js +27 -13
- package/lib/ui/Badge.js.map +1 -1
- package/lib/ui/Button.js +6 -5
- package/lib/ui/Button.js.map +1 -1
- package/lib/ui/Checkbox.js +29 -26
- package/lib/ui/Checkbox.js.map +1 -1
- package/lib/ui/CodeBlock.js +7 -7
- package/lib/ui/CodeBlock.js.map +1 -1
- package/lib/ui/Collapsible.js +32 -5
- package/lib/ui/Collapsible.js.map +1 -1
- package/lib/ui/EmbeddedCodeBlock.js +26 -25
- package/lib/ui/EmbeddedCodeBlock.js.map +1 -1
- package/lib/ui/Frame.js +81 -0
- package/lib/ui/Frame.js.map +1 -0
- package/lib/ui/Item.js +188 -0
- package/lib/ui/Item.js.map +1 -0
- package/lib/ui/NativeSelect.js +57 -0
- package/lib/ui/NativeSelect.js.map +1 -0
- package/lib/ui/Select.js +166 -116
- package/lib/ui/Select.js.map +1 -1
- package/lib/ui/Separator.js +27 -0
- package/lib/ui/Separator.js.map +1 -0
- package/lib/ui/SyntaxHighlight.js +1 -1
- package/lib/ui/Tabs.js +10 -10
- package/lib/ui/Tooltip.js +55 -28
- package/lib/ui/Tooltip.js.map +1 -1
- package/lib/zudoku.__internal.js +345 -345
- package/lib/zudoku.__internal.js.map +1 -1
- package/lib/zudoku.auth-auth0.js +7 -7
- package/lib/zudoku.auth-auth0.js.map +1 -1
- package/lib/zudoku.auth-azureb2c.js +3 -3
- package/lib/zudoku.auth-clerk.js +1 -1
- package/lib/zudoku.auth-openid.js +3 -3
- package/lib/zudoku.auth-supabase.js +30 -33
- package/lib/zudoku.auth-supabase.js.map +1 -1
- package/lib/zudoku.components.js +2 -2
- package/lib/zudoku.plugin-api-catalog.js +3 -3
- package/lib/zudoku.plugin-api-keys.js +5 -5
- package/lib/zudoku.plugin-api-keys.js.map +1 -1
- package/lib/zudoku.plugin-markdown.js +1 -1
- package/lib/zudoku.plugin-openapi.js +1 -1
- package/lib/zudoku.plugin-search-pagefind.js +2 -2
- package/package.json +18 -13
- package/src/app/main.css +1 -1
- package/src/app/main.tsx +5 -1
- package/src/lib/auth/issuer.ts +3 -0
- package/src/lib/authentication/authentication.ts +1 -1
- package/src/lib/authentication/providers/auth0.tsx +6 -1
- package/src/lib/authentication/providers/firebase.tsx +284 -0
- package/src/lib/authentication/providers/supabase.tsx +2 -7
- package/src/lib/authentication/ui/ZudokuAuthUi.tsx +335 -0
- package/src/lib/authentication/ui/icons/Apple.tsx +10 -0
- package/src/lib/authentication/ui/icons/Facebook.tsx +15 -0
- package/src/lib/authentication/ui/icons/Github.tsx +16 -0
- package/src/lib/authentication/ui/icons/Google.tsx +16 -0
- package/src/lib/authentication/ui/icons/Microsoft.tsx +12 -0
- package/src/lib/authentication/ui/icons/X.tsx +10 -0
- package/src/lib/components/Autocomplete.tsx +11 -2
- package/src/lib/components/Layout.tsx +3 -2
- package/src/lib/components/navigation/NavigationItem.tsx +7 -20
- package/src/lib/core/RouteGuard.tsx +8 -8
- package/src/lib/errors/ErrorAlert.tsx +1 -1
- package/src/lib/errors/RouterError.tsx +7 -2
- package/src/lib/oas/parser/index.ts +8 -3
- package/src/lib/plugins/api-keys/ProtectedRoute.tsx +11 -7
- package/src/lib/plugins/openapi/CollapsibleCode.tsx +5 -3
- package/src/lib/plugins/openapi/GeneratedExampleSidecarBox.tsx +52 -0
- package/src/lib/plugins/openapi/OperationList.tsx +7 -0
- package/src/lib/plugins/openapi/OperationListItem.tsx +10 -7
- package/src/lib/plugins/openapi/ParameterList.tsx +37 -23
- package/src/lib/plugins/openapi/ParameterListItem.tsx +105 -54
- package/src/lib/plugins/openapi/RequestBodySidecarBox.tsx +48 -7
- package/src/lib/plugins/openapi/ResponsesSidecarBox.tsx +81 -33
- package/src/lib/plugins/openapi/Sidecar.tsx +129 -65
- package/src/lib/plugins/openapi/SidecarBox.tsx +26 -4
- package/src/lib/plugins/openapi/SidecarExamples.tsx +91 -79
- package/src/lib/plugins/openapi/components/ConstValue.tsx +1 -1
- package/src/lib/plugins/openapi/components/EnumValues.tsx +2 -2
- package/src/lib/plugins/openapi/components/NonHighlightedCode.tsx +22 -0
- package/src/lib/plugins/openapi/components/ResponseContent.tsx +63 -53
- package/src/lib/plugins/openapi/interfaces.ts +12 -0
- package/src/lib/plugins/openapi/playground/BodyPanel.tsx +246 -30
- package/src/lib/plugins/openapi/playground/CollapsibleHeader.tsx +10 -6
- package/src/lib/plugins/openapi/playground/ExamplesDropdown.tsx +3 -2
- package/src/lib/plugins/openapi/playground/Headers.tsx +103 -219
- package/src/lib/plugins/openapi/playground/ParamsGrid.tsx +33 -1
- package/src/lib/plugins/openapi/playground/PathParams.tsx +26 -34
- package/src/lib/plugins/openapi/playground/Playground.tsx +73 -35
- package/src/lib/plugins/openapi/playground/PlaygroundDialog.tsx +9 -30
- package/src/lib/plugins/openapi/playground/QueryParams.tsx +82 -136
- package/src/lib/plugins/openapi/playground/request-panel/MultipartField.tsx +91 -0
- package/src/lib/plugins/openapi/playground/request-panel/UrlQueryParams.tsx +1 -1
- package/src/lib/plugins/openapi/playground/request-panel/fieldManager/useKeyValueFieldManager.test.tsx +872 -0
- package/src/lib/plugins/openapi/playground/request-panel/useKeyValueFieldManager.ts +349 -0
- package/src/lib/plugins/openapi/playground/result-panel/ResponseTab.tsx +2 -6
- package/src/lib/plugins/openapi/schema/SchemaExampleAndDefault.tsx +1 -1
- package/src/lib/plugins/openapi/schema/SchemaPropertyItem.tsx +89 -55
- package/src/lib/plugins/openapi/schema/SchemaView.tsx +82 -53
- package/src/lib/plugins/openapi/schema/UnionView.tsx +6 -17
- package/src/lib/plugins/openapi/schema/union-helpers.ts +0 -1
- package/src/lib/plugins/openapi/util/generateSchemaExample.ts +5 -15
- package/src/lib/ui/Badge.tsx +21 -12
- package/src/lib/ui/Button.tsx +1 -0
- package/src/lib/ui/Checkbox.tsx +23 -24
- package/src/lib/ui/CodeBlock.tsx +3 -4
- package/src/lib/ui/Collapsible.tsx +26 -4
- package/src/lib/ui/EmbeddedCodeBlock.tsx +21 -19
- package/src/lib/ui/Frame.tsx +81 -0
- package/src/lib/ui/Item.tsx +192 -0
- package/src/lib/ui/NativeSelect.tsx +47 -0
- package/src/lib/ui/Select.tsx +153 -126
- package/src/lib/ui/Separator.tsx +25 -0
- package/src/lib/ui/Tooltip.tsx +54 -32
- package/src/lib/util/createVariantComponent.tsx +31 -5
- package/src/lib/util/flattenAllOf.test.ts +637 -0
- package/src/lib/util/flattenAllOf.ts +101 -0
- package/src/lib/util/readFrontmatter.ts +13 -0
- package/dist/lib/plugins/openapi/playground/InlineInput.d.ts +0 -4
- package/dist/lib/plugins/openapi/playground/InlineInput.js +0 -3
- package/dist/lib/plugins/openapi/playground/InlineInput.js.map +0 -1
- package/dist/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupConnector.d.ts +0 -5
- package/dist/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupConnector.js +0 -7
- package/dist/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupConnector.js.map +0 -1
- package/dist/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupItem.d.ts +0 -4
- package/dist/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupItem.js +0 -10
- package/dist/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupItem.js.map +0 -1
- package/dist/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupView.d.ts +0 -5
- package/dist/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupView.js +0 -16
- package/dist/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupView.js.map +0 -1
- package/lib/Button-DmS4u8Lj.js.map +0 -1
- package/lib/ErrorAlert-DE3Sf66a.js.map +0 -1
- package/lib/OperationList-DCJw6wXL.js +0 -5450
- package/lib/OperationList-DCJw6wXL.js.map +0 -1
- package/lib/RouteGuard-DhU3LRr1.js +0 -81
- package/lib/RouteGuard-DhU3LRr1.js.map +0 -1
- package/lib/RouterError-VDLnrFqF.js +0 -41
- package/lib/RouterError-VDLnrFqF.js.map +0 -1
- package/lib/SchemaView-D3hm65cc.js +0 -458
- package/lib/SchemaView-D3hm65cc.js.map +0 -1
- package/lib/Select-C1DeCqKv.js +0 -372
- package/lib/Select-C1DeCqKv.js.map +0 -1
- package/lib/SyntaxHighlight-zvlnSnHB.js.map +0 -1
- package/lib/circular-CSSuz-LS.js.map +0 -1
- package/lib/createServer-CLbcVLbK.js.map +0 -1
- package/lib/index-RNAxx6IF.js +0 -3364
- package/lib/index-RNAxx6IF.js.map +0 -1
- package/src/lib/plugins/openapi/playground/InlineInput.tsx +0 -6
- package/src/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupConnector.tsx +0 -36
- package/src/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupItem.tsx +0 -25
- package/src/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupView.tsx +0 -42
|
@@ -0,0 +1,586 @@
|
|
|
1
|
+
import { j as t } from "./jsx-runtime-BzflLqGi.js";
|
|
2
|
+
import { ChevronUpIcon as L, ChevronDownIcon as M, ChevronsLeftRightIcon as T, MinusIcon as _, PlusIcon as J, RefreshCcwDotIcon as U, InfoIcon as G } from "lucide-react";
|
|
3
|
+
import { useState as f, isValidElement as K, Fragment as A } from "react";
|
|
4
|
+
import { c as a } from "./cn-dYga0KKN.js";
|
|
5
|
+
import { Slot as W } from "@radix-ui/react-slot";
|
|
6
|
+
import { c as Q } from "./index-DI5SPFK9.js";
|
|
7
|
+
import { Separator as X } from "./ui/Separator.js";
|
|
8
|
+
import { S as m, I as V, M as q } from "./ErrorAlert-BOVgwTRP.js";
|
|
9
|
+
import { B as Y } from "./Button-B3ucvvQw.js";
|
|
10
|
+
import * as C from "@radix-ui/react-collapsible";
|
|
11
|
+
import { Button as Z } from "./ui/Button.js";
|
|
12
|
+
import { Badge as H } from "./ui/Badge.js";
|
|
13
|
+
import { Frame as ee, FramePanel as te } from "./ui/Frame.js";
|
|
14
|
+
import { C as re } from "./circular-B-_VyILZ.js";
|
|
15
|
+
const ne = (e, r) => e.reduce(
|
|
16
|
+
(n, s) => {
|
|
17
|
+
const o = r(s);
|
|
18
|
+
return n[o] || (n[o] = []), n[o].push(s), n;
|
|
19
|
+
},
|
|
20
|
+
{}
|
|
21
|
+
);
|
|
22
|
+
function g({ className: e, ...r }) {
|
|
23
|
+
return /* @__PURE__ */ t.jsx(
|
|
24
|
+
"div",
|
|
25
|
+
{
|
|
26
|
+
"data-slot": "frame",
|
|
27
|
+
className: a(
|
|
28
|
+
"relative flex flex-col rounded-2xl bg-muted p-1",
|
|
29
|
+
e
|
|
30
|
+
),
|
|
31
|
+
...r
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
function N({ className: e, ...r }) {
|
|
36
|
+
return /* @__PURE__ */ t.jsx(
|
|
37
|
+
"div",
|
|
38
|
+
{
|
|
39
|
+
"data-slot": "frame-panel",
|
|
40
|
+
className: a(
|
|
41
|
+
"relative bg-clip-padding rounded-xl border bg-card p-5 shadow-xs",
|
|
42
|
+
"before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-xl)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] dark:bg-clip-border dark:before:shadow-[0_-1px_--theme(--color-white/8%)]",
|
|
43
|
+
e
|
|
44
|
+
),
|
|
45
|
+
...r
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
function se({ className: e, ...r }) {
|
|
50
|
+
return /* @__PURE__ */ t.jsx(
|
|
51
|
+
"header",
|
|
52
|
+
{
|
|
53
|
+
"data-slot": "frame-panel-header",
|
|
54
|
+
className: a("flex flex-col p-4", e),
|
|
55
|
+
...r
|
|
56
|
+
}
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
function ie({
|
|
60
|
+
className: e,
|
|
61
|
+
...r
|
|
62
|
+
}) {
|
|
63
|
+
return /* @__PURE__ */ t.jsx(
|
|
64
|
+
"div",
|
|
65
|
+
{
|
|
66
|
+
"data-slot": "frame-panel-description",
|
|
67
|
+
className: a("text-sm text-muted-foreground", e),
|
|
68
|
+
...r
|
|
69
|
+
}
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
function oe({ className: e, ...r }) {
|
|
73
|
+
return /* @__PURE__ */ t.jsx(
|
|
74
|
+
"footer",
|
|
75
|
+
{
|
|
76
|
+
"data-slot": "frame-panel-footer",
|
|
77
|
+
className: a("flex flex-col gap-1 px-5 py-4", e),
|
|
78
|
+
...r
|
|
79
|
+
}
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
function le({ className: e, ...r }) {
|
|
83
|
+
return /* @__PURE__ */ t.jsx(
|
|
84
|
+
"div",
|
|
85
|
+
{
|
|
86
|
+
role: "list",
|
|
87
|
+
"data-slot": "item-group",
|
|
88
|
+
className: a("group/item-group flex flex-col", e),
|
|
89
|
+
...r
|
|
90
|
+
}
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
function P({
|
|
94
|
+
className: e,
|
|
95
|
+
...r
|
|
96
|
+
}) {
|
|
97
|
+
return /* @__PURE__ */ t.jsx(
|
|
98
|
+
X,
|
|
99
|
+
{
|
|
100
|
+
"data-slot": "item-separator",
|
|
101
|
+
orientation: "horizontal",
|
|
102
|
+
className: a("my-0", e),
|
|
103
|
+
...r
|
|
104
|
+
}
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
const ae = Q(
|
|
108
|
+
"group/item flex items-center border border-transparent text-sm rounded-md transition-colors [a]:hover:bg-accent/50 [a]:transition-colors duration-100 flex-wrap outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
|
|
109
|
+
{
|
|
110
|
+
variants: {
|
|
111
|
+
variant: {
|
|
112
|
+
default: "bg-transparent",
|
|
113
|
+
outline: "border-border",
|
|
114
|
+
muted: "bg-muted/50"
|
|
115
|
+
},
|
|
116
|
+
size: {
|
|
117
|
+
default: "p-4 gap-4 ",
|
|
118
|
+
sm: "py-3 px-4 gap-2.5"
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
defaultVariants: {
|
|
122
|
+
variant: "default",
|
|
123
|
+
size: "default"
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
);
|
|
127
|
+
function $({
|
|
128
|
+
className: e,
|
|
129
|
+
variant: r = "default",
|
|
130
|
+
size: n = "default",
|
|
131
|
+
asChild: s = !1,
|
|
132
|
+
...o
|
|
133
|
+
}) {
|
|
134
|
+
const i = s ? W : "div";
|
|
135
|
+
return /* @__PURE__ */ t.jsx(
|
|
136
|
+
i,
|
|
137
|
+
{
|
|
138
|
+
"data-slot": "item",
|
|
139
|
+
"data-variant": r,
|
|
140
|
+
"data-size": n,
|
|
141
|
+
className: a(ae({ variant: r, size: n, className: e })),
|
|
142
|
+
...o
|
|
143
|
+
}
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
function y({ className: e, ...r }) {
|
|
147
|
+
return /* @__PURE__ */ t.jsx(
|
|
148
|
+
"div",
|
|
149
|
+
{
|
|
150
|
+
"data-slot": "item-content",
|
|
151
|
+
className: a(
|
|
152
|
+
"flex flex-1 flex-col gap-1 [&+[data-slot=item-content]]:flex-none",
|
|
153
|
+
e
|
|
154
|
+
),
|
|
155
|
+
...r
|
|
156
|
+
}
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
function S({ className: e, ...r }) {
|
|
160
|
+
return /* @__PURE__ */ t.jsx(
|
|
161
|
+
"div",
|
|
162
|
+
{
|
|
163
|
+
"data-slot": "item-title",
|
|
164
|
+
className: a(
|
|
165
|
+
"flex w-fit items-center gap-2 text-sm leading-snug font-medium",
|
|
166
|
+
e
|
|
167
|
+
),
|
|
168
|
+
...r
|
|
169
|
+
}
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
function de({ className: e, ...r }) {
|
|
173
|
+
return /* @__PURE__ */ t.jsx(
|
|
174
|
+
"div",
|
|
175
|
+
{
|
|
176
|
+
"data-slot": "item-actions",
|
|
177
|
+
className: a("flex items-center gap-2", e),
|
|
178
|
+
...r
|
|
179
|
+
}
|
|
180
|
+
);
|
|
181
|
+
}
|
|
182
|
+
const E = ({
|
|
183
|
+
schema: e,
|
|
184
|
+
hideDescription: r = !1
|
|
185
|
+
}) => /* @__PURE__ */ t.jsx("div", { className: "flex flex-col gap-1", children: /* @__PURE__ */ t.jsxs("div", { children: [
|
|
186
|
+
/* @__PURE__ */ t.jsx("span", { className: "text-muted-foreground", children: "Const value: " }),
|
|
187
|
+
/* @__PURE__ */ t.jsx(m, { className: "border rounded px-1 font-mono", children: e.const }),
|
|
188
|
+
!r && e.description && /* @__PURE__ */ t.jsx("div", { className: "text-muted-foreground", children: e.description })
|
|
189
|
+
] }) }), b = ({
|
|
190
|
+
values: e,
|
|
191
|
+
className: r,
|
|
192
|
+
maxVisibleValues: n = 8
|
|
193
|
+
}) => {
|
|
194
|
+
const [s, o] = f(!1);
|
|
195
|
+
if (!e.length) return null;
|
|
196
|
+
const i = e.length > n, l = i && !s ? e.slice(0, n) : e;
|
|
197
|
+
return /* @__PURE__ */ t.jsxs("div", { className: a("flex flex-wrap gap-1.5", r), children: [
|
|
198
|
+
/* @__PURE__ */ t.jsx("span", { className: "text-muted-foreground", children: "Enum values:" }),
|
|
199
|
+
l.map((d) => /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(m, { className: "border rounded-sm px-1 font-mono", children: d }) }, d)),
|
|
200
|
+
i && /* @__PURE__ */ t.jsx(
|
|
201
|
+
Y,
|
|
202
|
+
{
|
|
203
|
+
variant: "ghost",
|
|
204
|
+
size: "sm",
|
|
205
|
+
className: "h-fit px-0",
|
|
206
|
+
onClick: () => o(!s),
|
|
207
|
+
children: s ? /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-1", children: [
|
|
208
|
+
/* @__PURE__ */ t.jsx(L, { size: 12 }),
|
|
209
|
+
/* @__PURE__ */ t.jsx("span", { className: "text-muted-foreground", children: "show less" })
|
|
210
|
+
] }) : /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-1", children: [
|
|
211
|
+
/* @__PURE__ */ t.jsx(M, { size: 12 }),
|
|
212
|
+
/* @__PURE__ */ t.jsxs("span", { className: "text-muted-foreground", children: [
|
|
213
|
+
"show ",
|
|
214
|
+
e.length - n,
|
|
215
|
+
" more"
|
|
216
|
+
] })
|
|
217
|
+
] })
|
|
218
|
+
}
|
|
219
|
+
)
|
|
220
|
+
] });
|
|
221
|
+
}, ce = ({ pattern: e }) => {
|
|
222
|
+
const [r, n] = f(!1), s = e.length > 20, o = s ? `${e.slice(0, 20)}…` : e;
|
|
223
|
+
return /* @__PURE__ */ t.jsxs(
|
|
224
|
+
V,
|
|
225
|
+
{
|
|
226
|
+
className: a("text-xs", s && "cursor-pointer"),
|
|
227
|
+
onClick: () => n(!r),
|
|
228
|
+
selectOnClick: !1,
|
|
229
|
+
children: [
|
|
230
|
+
r ? e : o,
|
|
231
|
+
s && /* @__PURE__ */ t.jsx("button", { type: "button", className: "p-1 translate-y-[2px]", children: !r && /* @__PURE__ */ t.jsx(T, { size: 12 }) })
|
|
232
|
+
]
|
|
233
|
+
}
|
|
234
|
+
);
|
|
235
|
+
}, xe = (e) => e ? [
|
|
236
|
+
e.type === "array" && e.items.type ? Array.isArray(e.items.type) ? `(${e.items.type.join(" | ")})[]` : `${e.items.type}[]` : Array.isArray(e.type) ? e.type.join(" | ") : e.type,
|
|
237
|
+
e.enum && "enum",
|
|
238
|
+
e.const && "const",
|
|
239
|
+
e.format,
|
|
240
|
+
e.minimum !== void 0 && `min: ${e.minimum}`,
|
|
241
|
+
e.maximum !== void 0 && `max: ${e.maximum}`,
|
|
242
|
+
e.minLength !== void 0 && `minLength: ${e.minLength}`,
|
|
243
|
+
e.maxLength !== void 0 && `maxLength: ${e.maxLength}`,
|
|
244
|
+
e.minItems !== void 0 && `minItems: ${e.minItems}`,
|
|
245
|
+
e.maxItems !== void 0 && `maxItems: ${e.maxItems}`,
|
|
246
|
+
e.minProperties !== void 0 && `minProps: ${e.minProperties}`,
|
|
247
|
+
e.maxProperties !== void 0 && `maxProps: ${e.maxProperties}`,
|
|
248
|
+
e.uniqueItems && "unique",
|
|
249
|
+
e.readOnly && "readOnly",
|
|
250
|
+
e.writeOnly && "writeOnly",
|
|
251
|
+
e.deprecated && "deprecated",
|
|
252
|
+
e.pattern && /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
253
|
+
"pattern: ",
|
|
254
|
+
/* @__PURE__ */ t.jsx(ce, { pattern: e.pattern })
|
|
255
|
+
] })
|
|
256
|
+
] : [], v = ({
|
|
257
|
+
schema: e,
|
|
258
|
+
extraItems: r = [],
|
|
259
|
+
className: n
|
|
260
|
+
}) => {
|
|
261
|
+
const s = [...xe(e), ...r].flatMap(
|
|
262
|
+
(o) => typeof o == "string" || K(o) ? o : []
|
|
263
|
+
);
|
|
264
|
+
return /* @__PURE__ */ t.jsx("span", { className: n, children: s.map((o, i) => (
|
|
265
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: index should be stable
|
|
266
|
+
/* @__PURE__ */ t.jsxs("span", { className: "text-muted-foreground", children: [
|
|
267
|
+
o,
|
|
268
|
+
i < s.length - 1 && /* @__PURE__ */ t.jsx("span", { className: "text-muted-foreground/50", children: " · " })
|
|
269
|
+
] }, i)
|
|
270
|
+
)) });
|
|
271
|
+
}, h = ({
|
|
272
|
+
schema: e
|
|
273
|
+
}) => {
|
|
274
|
+
const r = e.examples?.at(0), n = e.default;
|
|
275
|
+
return r === void 0 && n === void 0 ? null : /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
276
|
+
r !== void 0 && /* @__PURE__ */ t.jsxs("div", { children: [
|
|
277
|
+
/* @__PURE__ */ t.jsx("span", { className: "text-muted-foreground", children: "Example: " }),
|
|
278
|
+
/* @__PURE__ */ t.jsx(m, { className: "border rounded-sm px-1 font-mono", children: typeof r == "object" || typeof r == "boolean" ? JSON.stringify(r) : r })
|
|
279
|
+
] }),
|
|
280
|
+
n !== void 0 && /* @__PURE__ */ t.jsxs("div", { children: [
|
|
281
|
+
/* @__PURE__ */ t.jsx("span", { className: "text-muted-foreground", children: "Default: " }),
|
|
282
|
+
/* @__PURE__ */ t.jsx(m, { className: "border rounded-sm px-1 font-mono", children: typeof n == "object" || typeof n == "boolean" ? JSON.stringify(n) : n })
|
|
283
|
+
] })
|
|
284
|
+
] });
|
|
285
|
+
}, z = (e) => typeof e == "string" && ["string", "number", "boolean", "integer", "null"].includes(e) || Array.isArray(e) && e.every(z), I = (e) => e.type === "array" || // schema.type might be an array of types, so we need to check if "array" is one of them
|
|
286
|
+
Array.isArray(e.type) && e.type.includes("array"), w = (e) => e && (e.type === "object" && Object.keys(e.properties ?? {}).length > 0 || e.type === "array" && typeof e.items == "object" && (!e.items.type || e.items.type === "object")), R = (e) => typeof e == "string" && e.startsWith(re), k = (e) => I(e) && "items" in e && R(e.items), pe = (e) => typeof e == "string" ? e.split(":")[1] : void 0, F = ({ circularProp: e }) => /* @__PURE__ */ t.jsxs(
|
|
287
|
+
V,
|
|
288
|
+
{
|
|
289
|
+
className: "inline-flex items-center gap-1.5 text-xs translate-y-0.5",
|
|
290
|
+
selectOnClick: !1,
|
|
291
|
+
children: [
|
|
292
|
+
/* @__PURE__ */ t.jsx(U, { size: 13 }),
|
|
293
|
+
/* @__PURE__ */ t.jsx("span", { children: e ? `${e} (circular)` : "circular" })
|
|
294
|
+
]
|
|
295
|
+
}
|
|
296
|
+
), ue = ({
|
|
297
|
+
name: e,
|
|
298
|
+
schema: r,
|
|
299
|
+
group: n,
|
|
300
|
+
defaultOpen: s = !1,
|
|
301
|
+
showCollapseButton: o = !0
|
|
302
|
+
}) => {
|
|
303
|
+
const [i, l] = f(s);
|
|
304
|
+
if (R(r))
|
|
305
|
+
return /* @__PURE__ */ t.jsx($, { children: /* @__PURE__ */ t.jsxs(y, { className: "gap-y-2", children: [
|
|
306
|
+
/* @__PURE__ */ t.jsxs("div", { children: [
|
|
307
|
+
/* @__PURE__ */ t.jsx(S, { className: "inline me-2", children: /* @__PURE__ */ t.jsx("code", { children: e }) }),
|
|
308
|
+
/* @__PURE__ */ t.jsx(
|
|
309
|
+
v,
|
|
310
|
+
{
|
|
311
|
+
className: "inline",
|
|
312
|
+
schema: r,
|
|
313
|
+
extraItems: [
|
|
314
|
+
n !== "optional" && /* @__PURE__ */ t.jsx("span", { className: "text-primary", children: "required" }),
|
|
315
|
+
/* @__PURE__ */ t.jsx(F, {}, "circular-ref")
|
|
316
|
+
]
|
|
317
|
+
}
|
|
318
|
+
)
|
|
319
|
+
] }),
|
|
320
|
+
/* @__PURE__ */ t.jsx(h, { schema: r })
|
|
321
|
+
] }) });
|
|
322
|
+
const d = !!((r.allOf || r.anyOf || r.oneOf || w(r) || I(r) && "items" in r && w(r.items) || r.additionalProperties) && !k(r)), c = !!(r.description || "items" in r && r.items?.enum || r.const || r.enum || r.example !== void 0 || r.default !== void 0);
|
|
323
|
+
return /* @__PURE__ */ t.jsxs($, { children: [
|
|
324
|
+
/* @__PURE__ */ t.jsxs(y, { className: "gap-y-2", children: [
|
|
325
|
+
/* @__PURE__ */ t.jsxs("div", { children: [
|
|
326
|
+
/* @__PURE__ */ t.jsx(S, { className: "inline me-2", children: d ? /* @__PURE__ */ t.jsx(
|
|
327
|
+
"button",
|
|
328
|
+
{
|
|
329
|
+
onClick: () => l(!i),
|
|
330
|
+
type: "button",
|
|
331
|
+
className: "hover:underline",
|
|
332
|
+
children: /* @__PURE__ */ t.jsx("code", { children: e })
|
|
333
|
+
}
|
|
334
|
+
) : /* @__PURE__ */ t.jsx("code", { children: e }) }),
|
|
335
|
+
/* @__PURE__ */ t.jsx(
|
|
336
|
+
v,
|
|
337
|
+
{
|
|
338
|
+
className: "inline",
|
|
339
|
+
schema: r,
|
|
340
|
+
extraItems: [
|
|
341
|
+
n !== "optional" && /* @__PURE__ */ t.jsx("span", { className: "text-primary", children: "required" }),
|
|
342
|
+
k(r) && /* @__PURE__ */ t.jsx(
|
|
343
|
+
F,
|
|
344
|
+
{
|
|
345
|
+
circularProp: pe(r.items)
|
|
346
|
+
}
|
|
347
|
+
)
|
|
348
|
+
]
|
|
349
|
+
}
|
|
350
|
+
)
|
|
351
|
+
] }),
|
|
352
|
+
c && /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col gap-1.5", children: [
|
|
353
|
+
r.description && /* @__PURE__ */ t.jsx(q, { className: "prose-sm", content: r.description }),
|
|
354
|
+
"items" in r && r.items?.enum && /* @__PURE__ */ t.jsx(b, { values: r.items.enum }),
|
|
355
|
+
r.const && /* @__PURE__ */ t.jsx(E, { schema: r, hideDescription: !0 }),
|
|
356
|
+
r.enum && /* @__PURE__ */ t.jsx(b, { values: r.enum }),
|
|
357
|
+
/* @__PURE__ */ t.jsx(h, { schema: r })
|
|
358
|
+
] })
|
|
359
|
+
] }),
|
|
360
|
+
d && o && /* @__PURE__ */ t.jsx(de, { className: "self-start", children: /* @__PURE__ */ t.jsx(
|
|
361
|
+
Z,
|
|
362
|
+
{
|
|
363
|
+
variant: "ghost",
|
|
364
|
+
size: "icon",
|
|
365
|
+
className: "rounded-full",
|
|
366
|
+
onClick: () => l(!i),
|
|
367
|
+
"aria-label": "Toggle properties",
|
|
368
|
+
children: i ? /* @__PURE__ */ t.jsx(_, { size: 16 }) : /* @__PURE__ */ t.jsx(J, { size: 16 })
|
|
369
|
+
}
|
|
370
|
+
) }),
|
|
371
|
+
d && /* @__PURE__ */ t.jsx(
|
|
372
|
+
C.Root,
|
|
373
|
+
{
|
|
374
|
+
defaultOpen: s,
|
|
375
|
+
open: i,
|
|
376
|
+
onOpenChange: l,
|
|
377
|
+
className: a("w-full", !i && "contents"),
|
|
378
|
+
children: /* @__PURE__ */ t.jsx(C.Content, { asChild: !0, children: /* @__PURE__ */ t.jsx(y, { children: r.anyOf || r.oneOf || r.type === "object" ? /* @__PURE__ */ t.jsx(p, { schema: r }) : I(r) && "items" in r ? /* @__PURE__ */ t.jsx(p, { schema: r.items }) : null }) })
|
|
379
|
+
}
|
|
380
|
+
)
|
|
381
|
+
] });
|
|
382
|
+
}, B = (e) => {
|
|
383
|
+
const r = e.oneOf ?? e.anyOf ?? [];
|
|
384
|
+
return e.properties && Object.keys(e.properties).length > 0 ? r.map((n) => !n.properties && !n.type && !n.oneOf && !n.anyOf ? {
|
|
385
|
+
...n,
|
|
386
|
+
type: "object",
|
|
387
|
+
properties: e.properties,
|
|
388
|
+
required: n.required ?? e.required
|
|
389
|
+
} : n) : r;
|
|
390
|
+
}, me = (e) => {
|
|
391
|
+
if (Array.isArray(e.oneOf)) return "exactly-one";
|
|
392
|
+
const r = e.discriminator?.propertyName;
|
|
393
|
+
if (!r) return "at-least-one";
|
|
394
|
+
const n = B(e), s = /* @__PURE__ */ new Set();
|
|
395
|
+
for (const o of n) {
|
|
396
|
+
const i = o.properties?.[r], l = i?.const ?? (Array.isArray(i?.enum) && i.enum.length === 1 ? String(i.enum[0]) : void 0);
|
|
397
|
+
if (l == null || s.has(String(l))) return "at-least-one";
|
|
398
|
+
s.add(String(l));
|
|
399
|
+
}
|
|
400
|
+
return "exactly-one";
|
|
401
|
+
}, O = (e, r) => r.title?.trim() || `Variant ${e + 1}`, fe = (e, r) => {
|
|
402
|
+
const n = [];
|
|
403
|
+
e.type && n.push(
|
|
404
|
+
`type = ${Array.isArray(e.type) ? e.type.join("|") : e.type}`
|
|
405
|
+
);
|
|
406
|
+
const s = r?.discriminator?.propertyName;
|
|
407
|
+
if (s) {
|
|
408
|
+
const i = e.properties?.[s], l = i?.const ?? (Array.isArray(i?.enum) && i.enum.length === 1 ? i.enum[0] : void 0);
|
|
409
|
+
l !== void 0 && n.push(`${s}=${JSON.stringify(l)}`);
|
|
410
|
+
}
|
|
411
|
+
const o = (e.required ?? []).filter((i) => i !== s);
|
|
412
|
+
if (o.length) {
|
|
413
|
+
const i = o.slice(0, 3).join(", "), l = o.length > 3 ? ` +${o.length - 3} more` : "";
|
|
414
|
+
n.push(`requires: ${i}${l}`);
|
|
415
|
+
}
|
|
416
|
+
return n;
|
|
417
|
+
}, je = ({
|
|
418
|
+
variants: e,
|
|
419
|
+
schema: r,
|
|
420
|
+
selectedVariant: n,
|
|
421
|
+
onSelectVariant: s
|
|
422
|
+
}) => {
|
|
423
|
+
const o = e.map((i, l) => ({
|
|
424
|
+
label: O(l, i),
|
|
425
|
+
guards: fe(i, r)
|
|
426
|
+
}));
|
|
427
|
+
return /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col gap-2 text-sm", children: [
|
|
428
|
+
/* @__PURE__ */ t.jsx("h4", { className: "font-medium", children: "Decision Table" }),
|
|
429
|
+
/* @__PURE__ */ t.jsx("div", { className: "border rounded-md overflow-hidden", children: /* @__PURE__ */ t.jsxs("table", { className: "w-full", children: [
|
|
430
|
+
/* @__PURE__ */ t.jsx("thead", { children: /* @__PURE__ */ t.jsxs("tr", { className: "border-b bg-muted/50", children: [
|
|
431
|
+
/* @__PURE__ */ t.jsx("th", { className: "text-left p-2 font-medium", children: "Variant" }),
|
|
432
|
+
/* @__PURE__ */ t.jsx("th", { className: "text-left p-2 font-medium", children: "Matching Criteria" })
|
|
433
|
+
] }) }),
|
|
434
|
+
/* @__PURE__ */ t.jsx("tbody", { className: "divide-y", children: o.map((i) => /* @__PURE__ */ t.jsxs("tr", { className: "hover:bg-muted/30", children: [
|
|
435
|
+
/* @__PURE__ */ t.jsx("td", { className: "p-2 font-medium", children: /* @__PURE__ */ t.jsx(
|
|
436
|
+
"button",
|
|
437
|
+
{
|
|
438
|
+
type: "button",
|
|
439
|
+
className: a(
|
|
440
|
+
"hover:underline",
|
|
441
|
+
n === i.label && "text-primary"
|
|
442
|
+
),
|
|
443
|
+
onClick: () => s(i.label),
|
|
444
|
+
children: i.label
|
|
445
|
+
}
|
|
446
|
+
) }),
|
|
447
|
+
/* @__PURE__ */ t.jsx("td", { className: "p-2 text-muted-foreground text-xs", children: i.guards.length > 0 ? i.guards.join(" · ") : "No specific criteria" })
|
|
448
|
+
] }, i.label)) })
|
|
449
|
+
] }) })
|
|
450
|
+
] });
|
|
451
|
+
}, ye = ({
|
|
452
|
+
schema: e,
|
|
453
|
+
cardHeader: r
|
|
454
|
+
}) => {
|
|
455
|
+
const n = Array.isArray(e.oneOf) ? "oneOf" : Array.isArray(e.anyOf) ? "anyOf" : void 0, s = n ? B(e) : [], [o, i] = f(
|
|
456
|
+
() => s[0] ? O(0, s[0]) : ""
|
|
457
|
+
);
|
|
458
|
+
if (!n) return null;
|
|
459
|
+
const d = me(e) === "exactly-one" ? /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
460
|
+
"Exactly one variant ",
|
|
461
|
+
/* @__PURE__ */ t.jsx("b", { children: "must match" }),
|
|
462
|
+
"."
|
|
463
|
+
] }) : /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
464
|
+
"At least one variant ",
|
|
465
|
+
/* @__PURE__ */ t.jsx("b", { children: "must match" }),
|
|
466
|
+
". Multiple variants",
|
|
467
|
+
" ",
|
|
468
|
+
/* @__PURE__ */ t.jsx("i", { children: "may match" }),
|
|
469
|
+
" simultaneously."
|
|
470
|
+
] }), c = s.findIndex(
|
|
471
|
+
(u, j) => O(j, u) === o
|
|
472
|
+
), x = c >= 0 ? s[c] : null;
|
|
473
|
+
return /* @__PURE__ */ t.jsxs(ee, { children: [
|
|
474
|
+
r,
|
|
475
|
+
/* @__PURE__ */ t.jsxs(te, { className: "text-sm flex flex-col gap-4", children: [
|
|
476
|
+
/* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
477
|
+
/* @__PURE__ */ t.jsx(H, { variant: "outline", children: n }),
|
|
478
|
+
/* @__PURE__ */ t.jsx("div", { className: "flex-1 p-2", children: /* @__PURE__ */ t.jsx("span", { className: "text-sm", children: d }) })
|
|
479
|
+
] }),
|
|
480
|
+
/* @__PURE__ */ t.jsx(
|
|
481
|
+
je,
|
|
482
|
+
{
|
|
483
|
+
variants: s,
|
|
484
|
+
schema: e,
|
|
485
|
+
selectedVariant: o,
|
|
486
|
+
onSelectVariant: i
|
|
487
|
+
}
|
|
488
|
+
),
|
|
489
|
+
/* @__PURE__ */ t.jsxs("strong", { children: [
|
|
490
|
+
"Properties for ",
|
|
491
|
+
o,
|
|
492
|
+
":"
|
|
493
|
+
] }),
|
|
494
|
+
x && /* @__PURE__ */ t.jsx(p, { schema: x })
|
|
495
|
+
] })
|
|
496
|
+
] });
|
|
497
|
+
}, ge = (e) => e && /* @__PURE__ */ t.jsx(
|
|
498
|
+
q,
|
|
499
|
+
{
|
|
500
|
+
className: "text-sm leading-normal line-clamp-4",
|
|
501
|
+
content: e
|
|
502
|
+
}
|
|
503
|
+
), Ne = (e, r, n) => {
|
|
504
|
+
const s = /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
505
|
+
/* @__PURE__ */ t.jsx("span", { className: "text-sm text-muted-foreground", children: /* @__PURE__ */ t.jsx(v, { schema: e }) }),
|
|
506
|
+
e.enum && /* @__PURE__ */ t.jsx(b, { values: e.enum }),
|
|
507
|
+
ge(e.description),
|
|
508
|
+
/* @__PURE__ */ t.jsx(h, { schema: e })
|
|
509
|
+
] });
|
|
510
|
+
return n ? /* @__PURE__ */ t.jsx("div", { className: "space-y-2 p-4", children: s }) : /* @__PURE__ */ t.jsxs(g, { children: [
|
|
511
|
+
r,
|
|
512
|
+
/* @__PURE__ */ t.jsx(N, { className: "space-y-2", children: s })
|
|
513
|
+
] });
|
|
514
|
+
}, p = ({
|
|
515
|
+
schema: e,
|
|
516
|
+
defaultOpen: r = !1,
|
|
517
|
+
cardHeader: n,
|
|
518
|
+
embedded: s
|
|
519
|
+
}) => {
|
|
520
|
+
if (!e || Object.keys(e).length === 0)
|
|
521
|
+
return /* @__PURE__ */ t.jsxs(g, { children: [
|
|
522
|
+
n,
|
|
523
|
+
/* @__PURE__ */ t.jsx(N, { children: /* @__PURE__ */ t.jsx("div", { className: "text-sm text-muted-foreground italic", children: "No data returned" }) })
|
|
524
|
+
] });
|
|
525
|
+
if (e.const)
|
|
526
|
+
return /* @__PURE__ */ t.jsx(E, { schema: e });
|
|
527
|
+
if (Array.isArray(e.oneOf) || Array.isArray(e.anyOf))
|
|
528
|
+
return /* @__PURE__ */ t.jsx(ye, { schema: e, cardHeader: n });
|
|
529
|
+
if (z(e.type))
|
|
530
|
+
return Ne(e, n, s);
|
|
531
|
+
if (e.type === "array" && typeof e.items == "object")
|
|
532
|
+
return /* @__PURE__ */ t.jsx(p, { schema: e.items, cardHeader: n });
|
|
533
|
+
if (e.type === "object") {
|
|
534
|
+
const o = ne(
|
|
535
|
+
Object.entries(e.properties ?? {}),
|
|
536
|
+
([c, x]) => x.deprecated ? "deprecated" : e.required?.includes(c) ? "required" : "optional"
|
|
537
|
+
), i = ["required", "optional", "deprecated"], l = typeof e.additionalProperties == "object" && /* @__PURE__ */ t.jsx(p, { schema: e.additionalProperties, embedded: !0 }), d = i.map(
|
|
538
|
+
(c, x) => o[c] && /* @__PURE__ */ t.jsxs(A, { children: [
|
|
539
|
+
x > 0 && /* @__PURE__ */ t.jsx(P, {}),
|
|
540
|
+
/* @__PURE__ */ t.jsx(le, { className: "overflow-clip", children: o[c].map(([u, j], D) => /* @__PURE__ */ t.jsxs(A, { children: [
|
|
541
|
+
D > 0 && /* @__PURE__ */ t.jsx(P, {}),
|
|
542
|
+
/* @__PURE__ */ t.jsx(
|
|
543
|
+
ue,
|
|
544
|
+
{
|
|
545
|
+
name: u,
|
|
546
|
+
schema: j,
|
|
547
|
+
group: c,
|
|
548
|
+
defaultOpen: r
|
|
549
|
+
}
|
|
550
|
+
)
|
|
551
|
+
] }, u)) })
|
|
552
|
+
] }, c)
|
|
553
|
+
);
|
|
554
|
+
return s ? d : /* @__PURE__ */ t.jsxs(g, { children: [
|
|
555
|
+
n,
|
|
556
|
+
e.description && /* @__PURE__ */ t.jsx(se, { children: /* @__PURE__ */ t.jsx(ie, { children: e.description }) }),
|
|
557
|
+
/* @__PURE__ */ t.jsxs(N, { className: "p-0!", children: [
|
|
558
|
+
d,
|
|
559
|
+
l
|
|
560
|
+
] }),
|
|
561
|
+
e.additionalProperties === !0 && /* @__PURE__ */ t.jsx(oe, { children: /* @__PURE__ */ t.jsxs(
|
|
562
|
+
"a",
|
|
563
|
+
{
|
|
564
|
+
className: "text-sm flex items-center gap-1 hover:underline",
|
|
565
|
+
href: "https://swagger.io/docs/specification/v3_0/data-models/dictionaries/",
|
|
566
|
+
rel: "noopener noreferrer",
|
|
567
|
+
target: "_blank",
|
|
568
|
+
children: [
|
|
569
|
+
"Additional properties are allowed",
|
|
570
|
+
/* @__PURE__ */ t.jsx(G, { size: 14 })
|
|
571
|
+
]
|
|
572
|
+
}
|
|
573
|
+
) })
|
|
574
|
+
] });
|
|
575
|
+
}
|
|
576
|
+
};
|
|
577
|
+
export {
|
|
578
|
+
b as E,
|
|
579
|
+
v as P,
|
|
580
|
+
p as S,
|
|
581
|
+
h as a,
|
|
582
|
+
R as b,
|
|
583
|
+
ne as g,
|
|
584
|
+
I as i
|
|
585
|
+
};
|
|
586
|
+
//# sourceMappingURL=SchemaView-CaxK_HV4.js.map
|