zudoku 0.21.15 → 0.23.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/demo.js +1 -1
- package/dist/app/demo.js.map +1 -1
- package/dist/app/entry.client.js +1 -15
- package/dist/app/entry.client.js.map +1 -1
- package/dist/app/entry.server.js +1 -2
- package/dist/app/entry.server.js.map +1 -1
- package/dist/app/main.d.ts +1 -1
- package/dist/app/sentry.js +1 -1
- package/dist/app/sentry.js.map +1 -1
- package/dist/app/standalone.js +1 -1
- package/dist/app/standalone.js.map +1 -1
- package/dist/cli/cmds/build.js +1 -0
- package/dist/cli/cmds/build.js.map +1 -1
- package/dist/config/validators/common.d.ts +104 -104
- package/dist/config/validators/icon-types.d.ts +1 -1
- package/dist/config/validators/validate.d.ts +90 -90
- package/dist/lib/authentication/components/CallbackHandler.js +1 -1
- package/dist/lib/authentication/components/CallbackHandler.js.map +1 -1
- package/dist/lib/authentication/components/SignIn.js +1 -1
- package/dist/lib/authentication/components/SignIn.js.map +1 -1
- package/dist/lib/authentication/components/SignOut.js +1 -1
- package/dist/lib/authentication/components/SignOut.js.map +1 -1
- package/dist/lib/components/AnchorLink.d.ts +1 -1
- package/dist/lib/components/AnchorLink.js +1 -1
- package/dist/lib/components/AnchorLink.js.map +1 -1
- package/dist/lib/components/Bootstrap.d.ts +1 -2
- package/dist/lib/components/Bootstrap.js +3 -3
- package/dist/lib/components/Bootstrap.js.map +1 -1
- package/dist/lib/components/Header.js +1 -1
- package/dist/lib/components/Header.js.map +1 -1
- package/dist/lib/components/Layout.js +1 -1
- package/dist/lib/components/Layout.js.map +1 -1
- package/dist/lib/components/Markdown.js +1 -1
- package/dist/lib/components/Markdown.js.map +1 -1
- package/dist/lib/components/NotFoundPage.js +1 -1
- package/dist/lib/components/NotFoundPage.js.map +1 -1
- package/dist/lib/components/ReactMarkdown.d.ts +29 -0
- package/dist/lib/components/ReactMarkdown.js +182 -0
- package/dist/lib/components/ReactMarkdown.js.map +1 -0
- package/dist/lib/components/SlotletProvider.d.ts +2 -2
- package/dist/lib/components/TopNavigation.js +1 -1
- package/dist/lib/components/TopNavigation.js.map +1 -1
- package/dist/lib/components/Zudoku.js +1 -1
- package/dist/lib/components/Zudoku.js.map +1 -1
- package/dist/lib/components/context/ZudokuContext.js +1 -1
- package/dist/lib/components/context/ZudokuContext.js.map +1 -1
- package/dist/lib/components/index.d.ts +4 -4
- package/dist/lib/components/index.js +1 -1
- package/dist/lib/components/index.js.map +1 -1
- package/dist/lib/components/navigation/SidebarCategory.js +1 -1
- package/dist/lib/components/navigation/SidebarCategory.js.map +1 -1
- package/dist/lib/components/navigation/SidebarItem.js +1 -1
- package/dist/lib/components/navigation/SidebarItem.js.map +1 -1
- package/dist/lib/components/navigation/utils.js +1 -1
- package/dist/lib/components/navigation/utils.js.map +1 -1
- package/dist/lib/core/plugins.d.ts +3 -5
- package/dist/lib/core/plugins.js.map +1 -1
- package/dist/lib/errors/RouterError.js +1 -1
- package/dist/lib/errors/RouterError.js.map +1 -1
- package/dist/lib/plugins/api-keys/CreateApiKey.js +1 -1
- package/dist/lib/plugins/api-keys/CreateApiKey.js.map +1 -1
- package/dist/lib/plugins/api-keys/ProtectedRoute.js +1 -1
- package/dist/lib/plugins/api-keys/ProtectedRoute.js.map +1 -1
- package/dist/lib/plugins/api-keys/SettingsApiKeys.js +1 -1
- package/dist/lib/plugins/api-keys/SettingsApiKeys.js.map +1 -1
- package/dist/lib/plugins/markdown/MdxPage.js +1 -1
- package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
- package/dist/lib/plugins/markdown/index.d.ts +1 -0
- package/dist/lib/plugins/markdown/index.js.map +1 -1
- package/dist/lib/plugins/openapi/Route.js +1 -1
- package/dist/lib/plugins/openapi/Route.js.map +1 -1
- package/dist/lib/plugins/openapi/Sidecar.js +1 -1
- package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
- package/dist/lib/plugins/openapi/index.js +1 -1
- package/dist/lib/plugins/openapi/index.js.map +1 -1
- package/dist/lib/plugins/redirect/index.js +1 -1
- package/dist/lib/plugins/redirect/index.js.map +1 -1
- package/dist/lib/plugins/search-inkeep/index.d.ts +22 -3
- package/dist/lib/plugins/search-inkeep/index.js +27 -5
- package/dist/lib/plugins/search-inkeep/index.js.map +1 -1
- package/dist/lib/plugins/search-inkeep/inkeep.d.ts +3 -4
- package/dist/lib/plugins/search-inkeep/inkeep.js.map +1 -1
- package/dist/lib/util/MdxComponents.d.ts +16 -16
- package/dist/lib/util/MdxComponents.js +1 -3
- package/dist/lib/util/MdxComponents.js.map +1 -1
- package/dist/lib/util/createVariantComponent.d.ts +2 -2
- package/dist/lib/util/useExposedProps.js +1 -1
- package/dist/lib/util/useExposedProps.js.map +1 -1
- package/dist/lib/util/useOnScreen.d.ts +1 -1
- package/dist/lib/util/useScrollToAnchor.js +1 -1
- package/dist/lib/util/useScrollToAnchor.js.map +1 -1
- package/dist/lib/util/useScrollToTop.js +1 -1
- package/dist/lib/util/useScrollToTop.js.map +1 -1
- package/dist/vite/config.js +15 -8
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/css/collect.d.ts +2 -0
- package/dist/vite/css/collect.js +27 -0
- package/dist/vite/css/collect.js.map +1 -0
- package/dist/vite/css/plugin.d.ts +5 -0
- package/dist/vite/css/plugin.js +79 -0
- package/dist/vite/css/plugin.js.map +1 -0
- package/dist/vite/dev-server.js +7 -3
- package/dist/vite/dev-server.js.map +1 -1
- package/dist/vite/plugin-mdx.js +2 -0
- package/dist/vite/plugin-mdx.js.map +1 -1
- package/dist/vite/plugin.js +4 -0
- package/dist/vite/plugin.js.map +1 -1
- package/lib/{AnchorLink-BR0MvI7n.js → AnchorLink-DFZZbmvr.js} +13 -14
- package/lib/AnchorLink-DFZZbmvr.js.map +1 -0
- package/lib/{AuthenticationPlugin-D0Em0SwR.js → AuthenticationPlugin-DQy635W9.js} +15 -16
- package/lib/AuthenticationPlugin-DQy635W9.js.map +1 -0
- package/lib/{Button-jK0EsymC.js → Button-DeAoTouo.js} +4 -4
- package/lib/{Button-jK0EsymC.js.map → Button-DeAoTouo.js.map} +1 -1
- package/lib/{CategoryHeading-Bb9dqxD3.js → CategoryHeading-CBconmtI.js} +3 -3
- package/lib/{CategoryHeading-Bb9dqxD3.js.map → CategoryHeading-CBconmtI.js.map} +1 -1
- package/lib/ClientOnly-E7hGysn1.js.map +1 -1
- package/lib/{Dialog-k70Qfukb.js → Dialog-Bxv1yEIg.js} +3 -3
- package/lib/{Dialog-k70Qfukb.js.map → Dialog-Bxv1yEIg.js.map} +1 -1
- package/lib/{Markdown-CdkU5HcM.js → Markdown-CZDLNOFc.js} +13235 -13225
- package/lib/Markdown-CZDLNOFc.js.map +1 -0
- package/lib/{MdxPage-ChziqNPp.js → MdxPage-CBa4X6L5.js} +9 -9
- package/lib/MdxPage-CBa4X6L5.js.map +1 -0
- package/lib/OperationList-Bj-6EKhp.js +4889 -0
- package/lib/{OperationList-CQKkyrZH.js.map → OperationList-Bj-6EKhp.js.map} +1 -1
- package/lib/Route-C9cYcP-j.js +11 -0
- package/lib/Route-C9cYcP-j.js.map +1 -0
- package/lib/{Select-O9ZM3ZgX.js → Select-Bb_Hqc70.js} +5 -5
- package/lib/{Select-O9ZM3ZgX.js.map → Select-Bb_Hqc70.js.map} +1 -1
- package/lib/{SidebarBadge-DxFJcJ6V.js → SidebarBadge-Bm793GDY.js} +3 -3
- package/lib/{SidebarBadge-DxFJcJ6V.js.map → SidebarBadge-Bm793GDY.js.map} +1 -1
- package/lib/SlotletProvider-pfc9oejW.js +221 -0
- package/lib/SlotletProvider-pfc9oejW.js.map +1 -0
- package/lib/{Spinner-3cQDBVGr.js → Spinner-DuxJLLNE.js} +2 -2
- package/lib/{Spinner-3cQDBVGr.js.map → Spinner-DuxJLLNE.js.map} +1 -1
- package/lib/{SyntaxHighlight-C31iouiO.js → SyntaxHighlight-Bz-lOJtH.js} +8 -10
- package/lib/{SyntaxHighlight-C31iouiO.js.map → SyntaxHighlight-Bz-lOJtH.js.map} +1 -1
- package/lib/assets/{index-B_Jk_Yzp.js → index-C7jnHK4b.js} +218 -197
- package/lib/assets/index-C7jnHK4b.js.map +1 -0
- package/lib/assets/{worker-C_2va8B8.js → worker-BmEAZjUP.js} +5249 -4922
- package/lib/assets/worker-BmEAZjUP.js.map +1 -0
- package/lib/chunk-D52XG6IA-Dl7HLe6j.js +1823 -0
- package/lib/chunk-D52XG6IA-Dl7HLe6j.js.map +1 -0
- package/lib/{cn-BmFQLtkS.js → cn-qaFjX9_3.js} +2 -2
- package/lib/cn-qaFjX9_3.js.map +1 -0
- package/lib/{context-D1nXWxm7.js → context-h_UkBLvr.js} +2 -2
- package/lib/{context-D1nXWxm7.js.map → context-h_UkBLvr.js.map} +1 -1
- package/lib/{createServer-BCAHdrpE.js → createServer-BVFp6Bl3.js} +4521 -4195
- package/lib/createServer-BVFp6Bl3.js.map +1 -0
- package/lib/{hook-hEqe7fPB.js → hook-DMHiUaIV.js} +3 -3
- package/lib/{hook-hEqe7fPB.js.map → hook-DMHiUaIV.js.map} +1 -1
- package/lib/{index-DjB6H4GT.js → index-B6rTMjdI.js} +47 -47
- package/lib/{index-DjB6H4GT.js.map → index-B6rTMjdI.js.map} +1 -1
- package/lib/{index-CkwDvuPt.js → index-CBXSgjaE.js} +259 -238
- package/lib/index-CBXSgjaE.js.map +1 -0
- package/lib/index-CPNSgwSb.js +36 -0
- package/lib/index-CPNSgwSb.js.map +1 -0
- package/lib/index-LNp6rxyU.js.map +1 -1
- package/lib/index.esm-BSV1C092.js +692 -0
- package/lib/{index.esm-Bm8pj-bc.js.map → index.esm-BSV1C092.js.map} +1 -1
- package/lib/index.esm-BnnBRKJX.js +1214 -0
- package/lib/index.esm-BnnBRKJX.js.map +1 -0
- package/lib/invariant-Caa8-XvF.js.map +1 -1
- package/lib/jsx-runtime-Dx-03ztt.js +446 -0
- package/lib/jsx-runtime-Dx-03ztt.js.map +1 -0
- package/lib/object_hash-BNWPnMN9.js +787 -0
- package/lib/object_hash-BNWPnMN9.js.map +1 -0
- package/lib/post-processors/removeExtensions.js.map +1 -1
- package/lib/post-processors/removePaths.js.map +1 -1
- package/lib/post-processors/traverse.js.map +1 -1
- package/lib/prism-csharp.min-DUwvItt4.js +63 -0
- package/lib/{prism-csharp.min-Yizuc34Y.js.map → prism-csharp.min-DUwvItt4.js.map} +1 -1
- package/lib/prism-java.min-BtgBR4yd.js +35 -0
- package/lib/{prism-java.min-d5iT_mOd.js.map → prism-java.min-BtgBR4yd.js.map} +1 -1
- package/lib/prism-markup-BNGj0Tvm.js.map +1 -1
- package/lib/prism-ruby.min-DeDXCp1r.js +38 -0
- package/lib/{prism-ruby.min-C7LwcKyz.js.map → prism-ruby.min-DeDXCp1r.js.map} +1 -1
- package/lib/prism-typescript.min-CD7H2IYQ.js +34 -0
- package/lib/{prism-typescript.min-oSVeWCAd.js.map → prism-typescript.min-CD7H2IYQ.js.map} +1 -1
- package/lib/state-CFQsUZUP.js +202 -0
- package/lib/state-CFQsUZUP.js.map +1 -0
- package/lib/ui/Accordion.js +2 -2
- package/lib/ui/Accordion.js.map +1 -1
- package/lib/ui/ActionButton.js +4 -4
- package/lib/ui/ActionButton.js.map +1 -1
- package/lib/ui/Alert.js +3 -3
- package/lib/ui/Alert.js.map +1 -1
- package/lib/ui/AlertDialog.js +2 -2
- package/lib/ui/AlertDialog.js.map +1 -1
- package/lib/ui/Badge.js +3 -3
- package/lib/ui/Badge.js.map +1 -1
- package/lib/ui/Breadcrumb.js +2 -2
- package/lib/ui/Breadcrumb.js.map +1 -1
- package/lib/ui/Button.js +3 -3
- package/lib/ui/Button.js.map +1 -1
- package/lib/ui/Callout.js +2 -2
- package/lib/ui/Callout.js.map +1 -1
- package/lib/ui/Card.js +2 -2
- package/lib/ui/Card.js.map +1 -1
- package/lib/ui/Carousel.js +407 -401
- package/lib/ui/Carousel.js.map +1 -1
- package/lib/ui/Checkbox.js +2 -2
- package/lib/ui/Checkbox.js.map +1 -1
- package/lib/ui/Command.js +111 -108
- package/lib/ui/Command.js.map +1 -1
- package/lib/ui/Dialog.js +2 -2
- package/lib/ui/Dialog.js.map +1 -1
- package/lib/ui/Drawer.js +2 -2
- package/lib/ui/Drawer.js.map +1 -1
- package/lib/ui/DropdownMenu.js +2 -2
- package/lib/ui/DropdownMenu.js.map +1 -1
- package/lib/ui/Form.js +3 -3
- package/lib/ui/Form.js.map +1 -1
- package/lib/ui/HoverCard.js +2 -2
- package/lib/ui/Input.js +2 -2
- package/lib/ui/Input.js.map +1 -1
- package/lib/ui/Label.js +3 -3
- package/lib/ui/Pagination.js +2 -2
- package/lib/ui/Pagination.js.map +1 -1
- package/lib/ui/Popover.js +2 -2
- package/lib/ui/Popover.js.map +1 -1
- package/lib/ui/Progress.js +2 -2
- package/lib/ui/Progress.js.map +1 -1
- package/lib/ui/RadioGroup.js +2 -2
- package/lib/ui/RadioGroup.js.map +1 -1
- package/lib/ui/ScrollArea.js +2 -2
- package/lib/ui/ScrollArea.js.map +1 -1
- package/lib/ui/Select.js +2 -2
- package/lib/ui/Select.js.map +1 -1
- package/lib/ui/Skeleton.js +2 -2
- package/lib/ui/Skeleton.js.map +1 -1
- package/lib/ui/Slider.js +2 -2
- package/lib/ui/Switch.js +2 -2
- package/lib/ui/Switch.js.map +1 -1
- package/lib/ui/Tabs.js +2 -2
- package/lib/ui/Textarea.js +2 -2
- package/lib/ui/Textarea.js.map +1 -1
- package/lib/ui/Toggle.js +3 -3
- package/lib/ui/Toggle.js.map +1 -1
- package/lib/ui/ToggleGroup.js +2 -2
- package/lib/ui/ToggleGroup.js.map +1 -1
- package/lib/ui/Tooltip.js +2 -2
- package/lib/useExposedProps-DE9lR6MF.js +9 -0
- package/lib/useExposedProps-DE9lR6MF.js.map +1 -0
- package/lib/{utils-DcpDOncX.js → utils-R0j3Raw1.js} +30 -31
- package/lib/{utils-DcpDOncX.js.map → utils-R0j3Raw1.js.map} +1 -1
- package/lib/zudoku.auth-auth0.js +1 -1
- package/lib/zudoku.auth-auth0.js.map +1 -1
- package/lib/zudoku.auth-clerk.js +2 -2
- package/lib/zudoku.auth-clerk.js.map +1 -1
- package/lib/zudoku.auth-openid.js +348 -346
- package/lib/zudoku.auth-openid.js.map +1 -1
- package/lib/zudoku.components.js +679 -939
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.openapi-worker.js +1 -1
- package/lib/zudoku.openapi-worker.js.map +1 -1
- package/lib/zudoku.plugin-api-catalog.js +3 -3
- package/lib/zudoku.plugin-api-catalog.js.map +1 -1
- package/lib/zudoku.plugin-api-keys.js +15 -16
- package/lib/zudoku.plugin-api-keys.js.map +1 -1
- package/lib/zudoku.plugin-custom-pages.js +4 -4
- package/lib/zudoku.plugin-custom-pages.js.map +1 -1
- package/lib/zudoku.plugin-markdown.js +2 -2
- package/lib/zudoku.plugin-markdown.js.map +1 -1
- package/lib/zudoku.plugin-openapi.js +5 -5
- package/lib/zudoku.plugin-redirect.js +1 -1
- package/lib/zudoku.plugin-redirect.js.map +1 -1
- package/lib/zudoku.plugin-search-inkeep.js +45 -24
- package/lib/zudoku.plugin-search-inkeep.js.map +1 -1
- package/package.json +43 -37
- package/src/app/demo.tsx +1 -1
- package/src/app/entry.client.tsx +1 -15
- package/src/app/entry.server.tsx +2 -2
- package/src/app/main.tsx +1 -1
- package/src/app/sentry.ts +1 -1
- package/src/app/standalone.tsx +1 -1
- package/src/lib/authentication/components/CallbackHandler.tsx +1 -1
- package/src/lib/authentication/components/SignIn.tsx +1 -1
- package/src/lib/authentication/components/SignOut.tsx +1 -1
- package/src/lib/components/AnchorLink.tsx +1 -1
- package/src/lib/components/Bootstrap.tsx +4 -6
- package/src/lib/components/Header.tsx +1 -1
- package/src/lib/components/Layout.tsx +1 -1
- package/src/lib/components/Markdown.tsx +1 -1
- package/src/lib/components/NotFoundPage.tsx +1 -1
- package/src/lib/components/ReactMarkdown.license.txt +21 -0
- package/src/lib/components/ReactMarkdown.tsx +264 -0
- package/src/lib/components/SlotletProvider.tsx +1 -1
- package/src/lib/components/TopNavigation.tsx +1 -1
- package/src/lib/components/Zudoku.tsx +1 -1
- package/src/lib/components/context/ZudokuContext.ts +1 -1
- package/src/lib/components/index.ts +1 -1
- package/src/lib/components/navigation/SidebarCategory.tsx +1 -1
- package/src/lib/components/navigation/SidebarItem.tsx +1 -1
- package/src/lib/components/navigation/utils.ts +1 -1
- package/src/lib/core/plugins.ts +3 -7
- package/src/lib/errors/RouterError.tsx +1 -1
- package/src/lib/plugins/api-keys/CreateApiKey.tsx +1 -1
- package/src/lib/plugins/api-keys/ProtectedRoute.tsx +1 -1
- package/src/lib/plugins/api-keys/SettingsApiKeys.tsx +1 -1
- package/src/lib/plugins/api-keys/index.tsx +1 -1
- package/src/lib/plugins/custom-pages/index.tsx +1 -1
- package/src/lib/plugins/markdown/MdxPage.tsx +1 -1
- package/src/lib/plugins/markdown/index.tsx +2 -1
- package/src/lib/plugins/openapi/Route.tsx +1 -1
- package/src/lib/plugins/openapi/Sidecar.tsx +1 -1
- package/src/lib/plugins/openapi/index.tsx +1 -1
- package/src/lib/plugins/redirect/index.tsx +1 -1
- package/src/lib/plugins/search-inkeep/index.tsx +59 -23
- package/src/lib/plugins/search-inkeep/inkeep.ts +3 -9
- package/src/lib/util/MdxComponents.tsx +1 -3
- package/src/lib/util/createVariantComponent.tsx +2 -2
- package/src/lib/util/useExposedProps.tsx +1 -1
- package/src/lib/util/useScrollToAnchor.ts +1 -1
- package/src/lib/util/useScrollToTop.ts +1 -1
- package/dist/lib/plugins/search-inkeep/InkeepCustomTrigger.d.ts +0 -2
- package/dist/lib/plugins/search-inkeep/InkeepCustomTrigger.js +0 -3
- package/dist/lib/plugins/search-inkeep/InkeepCustomTrigger.js.map +0 -1
- package/lib/AnchorLink-BR0MvI7n.js.map +0 -1
- package/lib/AuthenticationPlugin-D0Em0SwR.js.map +0 -1
- package/lib/InkeepCustomTrigger-CE5-K5ex.js +0 -6
- package/lib/InkeepCustomTrigger-CE5-K5ex.js.map +0 -1
- package/lib/Markdown-CdkU5HcM.js.map +0 -1
- package/lib/MdxPage-ChziqNPp.js.map +0 -1
- package/lib/OperationList-CQKkyrZH.js +0 -4706
- package/lib/Route-DlG_HTMu.js +0 -11
- package/lib/Route-DlG_HTMu.js.map +0 -1
- package/lib/SlotletProvider-D77pO-fA.js +0 -252
- package/lib/SlotletProvider-D77pO-fA.js.map +0 -1
- package/lib/assets/index-B_Jk_Yzp.js.map +0 -1
- package/lib/assets/worker-C_2va8B8.js.map +0 -1
- package/lib/cn-BmFQLtkS.js.map +0 -1
- package/lib/createServer-BCAHdrpE.js.map +0 -1
- package/lib/index-BuAyrJe3.js +0 -46
- package/lib/index-BuAyrJe3.js.map +0 -1
- package/lib/index-CkwDvuPt.js.map +0 -1
- package/lib/index-Czzd9rjU.js +0 -899
- package/lib/index-Czzd9rjU.js.map +0 -1
- package/lib/index-Yn8c3UWE.js +0 -921
- package/lib/index-Yn8c3UWE.js.map +0 -1
- package/lib/index.esm-Bm8pj-bc.js +0 -675
- package/lib/index.esm-C5mr_sKO.js +0 -1193
- package/lib/index.esm-C5mr_sKO.js.map +0 -1
- package/lib/jsx-runtime-B6kdoens.js +0 -635
- package/lib/jsx-runtime-B6kdoens.js.map +0 -1
- package/lib/object_hash-CvlLgU-M.js +0 -785
- package/lib/object_hash-CvlLgU-M.js.map +0 -1
- package/lib/prism-csharp.min-Yizuc34Y.js +0 -35
- package/lib/prism-java.min-d5iT_mOd.js +0 -7
- package/lib/prism-ruby.min-C7LwcKyz.js +0 -10
- package/lib/prism-typescript.min-oSVeWCAd.js +0 -6
- package/lib/router-lfyopgBI.js +0 -3024
- package/lib/router-lfyopgBI.js.map +0 -1
- package/lib/state-tsXBLONe.js +0 -203
- package/lib/state-tsXBLONe.js.map +0 -1
- package/lib/useExposedProps-CTPtylCV.js +0 -10
- package/lib/useExposedProps-CTPtylCV.js.map +0 -1
- package/src/lib/plugins/search-inkeep/InkeepCustomTrigger.tsx +0 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zudoku",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.23.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"homepage": "https://zudoku.dev",
|
|
6
6
|
"repository": {
|
|
@@ -117,14 +117,13 @@
|
|
|
117
117
|
"dependencies": {
|
|
118
118
|
"@envelop/core": "5.0.2",
|
|
119
119
|
"@graphql-typed-document-node/core": "3.2.0",
|
|
120
|
-
"@hiogawa/vite-plugin-ssr-css": "0.0.1",
|
|
121
120
|
"@hookform/resolvers": "3.9.1",
|
|
122
121
|
"@lekoarts/rehype-meta-as-attributes": "3.0.1",
|
|
123
|
-
"@mdx-js/react": "3.0
|
|
124
|
-
"@mdx-js/rollup": "3.0
|
|
122
|
+
"@mdx-js/react": "3.1.0",
|
|
123
|
+
"@mdx-js/rollup": "3.1.0",
|
|
125
124
|
"@pothos/core": "3.41.0",
|
|
126
125
|
"@radix-ui/react-accordion": "1.2.1",
|
|
127
|
-
"@radix-ui/react-alert-dialog": "1.1.
|
|
126
|
+
"@radix-ui/react-alert-dialog": "1.1.4",
|
|
128
127
|
"@radix-ui/react-aspect-ratio": "1.1.0",
|
|
129
128
|
"@radix-ui/react-checkbox": "1.1.2",
|
|
130
129
|
"@radix-ui/react-collapsible": "1.1.1",
|
|
@@ -143,50 +142,53 @@
|
|
|
143
142
|
"@radix-ui/react-tabs": "1.1.1",
|
|
144
143
|
"@radix-ui/react-toggle": "1.1.0",
|
|
145
144
|
"@radix-ui/react-toggle-group": "1.1.0",
|
|
146
|
-
"@radix-ui/react-tooltip": "1.1.
|
|
145
|
+
"@radix-ui/react-tooltip": "1.1.4",
|
|
147
146
|
"@radix-ui/react-visually-hidden": "1",
|
|
148
|
-
"@sentry/node": "8.
|
|
147
|
+
"@sentry/node": "8.42.0",
|
|
149
148
|
"@sindresorhus/slugify": "2.2.1",
|
|
150
149
|
"@stefanprobst/rehype-extract-toc": "2.2.0",
|
|
151
150
|
"@tailwindcss/typography": "0.5.15",
|
|
152
|
-
"@tanstack/react-query": "5.
|
|
153
|
-
"@types/react": "
|
|
154
|
-
"@types/react-dom": "
|
|
151
|
+
"@tanstack/react-query": "5.62.3",
|
|
152
|
+
"@types/react": "19.0.1",
|
|
153
|
+
"@types/react-dom": "19.0.1",
|
|
155
154
|
"@vitejs/plugin-react": "4.3.4",
|
|
156
155
|
"@zudoku/httpsnippet": "10.0.9",
|
|
157
156
|
"@zudoku/react-helmet-async": "2.0.4",
|
|
158
157
|
"autoprefixer": "10.4.20",
|
|
159
158
|
"chokidar": "3.6.0",
|
|
160
|
-
"class-variance-authority": "0.7.
|
|
159
|
+
"class-variance-authority": "0.7.1",
|
|
161
160
|
"clsx": "2.1.1",
|
|
162
161
|
"cmdk": "1.0.4",
|
|
163
|
-
"
|
|
162
|
+
"devlop": "^1.1.0",
|
|
163
|
+
"dotenv": "16.4.7",
|
|
164
|
+
"embla-carousel-react": "8.5.1",
|
|
164
165
|
"estree-util-value-to-estree": "3.2.1",
|
|
165
|
-
"express": "4.21.
|
|
166
|
+
"express": "4.21.2",
|
|
166
167
|
"glob": "11.0.0",
|
|
167
168
|
"graphql": "16.9.0",
|
|
168
169
|
"graphql-type-json": "0.3.2",
|
|
169
|
-
"graphql-yoga": "5.
|
|
170
|
+
"graphql-yoga": "5.10.4",
|
|
170
171
|
"gray-matter": "4.0.3",
|
|
172
|
+
"hast-util-to-jsx-runtime": "^2.3.2",
|
|
171
173
|
"hast-util-to-string": "3.0.1",
|
|
174
|
+
"html-url-attributes": "^3.0.1",
|
|
172
175
|
"http-terminator": "3.2.0",
|
|
173
176
|
"loglevel": "1.9.2",
|
|
174
|
-
"lru-cache": "11.0.
|
|
175
|
-
"lucide-react": "0.
|
|
176
|
-
"next-themes": "0.4.
|
|
177
|
+
"lru-cache": "11.0.2",
|
|
178
|
+
"lucide-react": "0.468.0",
|
|
179
|
+
"next-themes": "0.4.4",
|
|
177
180
|
"oauth4webapi": "2.17.0",
|
|
178
181
|
"object-hash": "3.0.0",
|
|
179
182
|
"openapi-types": "12.1.3",
|
|
180
|
-
"picocolors": "1.1.
|
|
181
|
-
"postcss": "8.4.
|
|
182
|
-
"posthog-node": "4.
|
|
183
|
+
"picocolors": "1.1.1",
|
|
184
|
+
"postcss": "8.4.49",
|
|
185
|
+
"posthog-node": "4.3.1",
|
|
183
186
|
"prism-react-renderer": "2.4.0",
|
|
184
187
|
"prismjs": "1.29.0",
|
|
185
188
|
"react-error-boundary": "4.1.2",
|
|
186
|
-
"react-hook-form": "7.
|
|
187
|
-
"react-is": "
|
|
188
|
-
"react-
|
|
189
|
-
"react-router-dom": "6.27.0",
|
|
189
|
+
"react-hook-form": "7.54.0",
|
|
190
|
+
"react-is": "19.0.0",
|
|
191
|
+
"react-router": "7.0.2",
|
|
190
192
|
"rehype-raw": "7.0.0",
|
|
191
193
|
"rehype-slug": "6.0.0",
|
|
192
194
|
"remark-comment": "1.0.0",
|
|
@@ -195,44 +197,49 @@
|
|
|
195
197
|
"remark-frontmatter": "5.0.0",
|
|
196
198
|
"remark-gfm": "4.0.0",
|
|
197
199
|
"remark-mdx-frontmatter": "5.0.0",
|
|
198
|
-
"
|
|
200
|
+
"remark-parse": "^11.0.0",
|
|
201
|
+
"remark-rehype": "^11.1.1",
|
|
202
|
+
"rollup": "4.28.1",
|
|
199
203
|
"semver": "7.6.3",
|
|
200
204
|
"sitemap": "8.0.0",
|
|
201
205
|
"spin-delay": "2.0.1",
|
|
202
206
|
"strip-ansi": "7.1.0",
|
|
203
|
-
"tailwind-merge": "2.5.
|
|
204
|
-
"tailwindcss": "3.4.
|
|
207
|
+
"tailwind-merge": "2.5.5",
|
|
208
|
+
"tailwindcss": "3.4.16",
|
|
205
209
|
"tsx": "^4.19.2",
|
|
206
210
|
"ulidx": "2.4.1",
|
|
211
|
+
"unified": "^11.0.5",
|
|
207
212
|
"unist-util-visit": "5.0.0",
|
|
208
|
-
"urql": "4.1
|
|
213
|
+
"urql": "4.2.1",
|
|
209
214
|
"vaul": "1.1.1",
|
|
210
215
|
"vfile": "6.0.3",
|
|
211
|
-
"vite": "
|
|
212
|
-
"yaml": "2.6.
|
|
216
|
+
"vite": "6.0.3",
|
|
217
|
+
"yaml": "2.6.1",
|
|
213
218
|
"yargs": "17.7.2",
|
|
214
219
|
"zod": "3.23.8",
|
|
215
220
|
"zod-validation-error": "3.4.0",
|
|
216
|
-
"zustand": "5.0.
|
|
221
|
+
"zustand": "5.0.2"
|
|
217
222
|
},
|
|
218
223
|
"devDependencies": {
|
|
219
224
|
"@graphql-codegen/cli": "5.0.3",
|
|
220
|
-
"@graphql-codegen/client-preset": "4.5.
|
|
225
|
+
"@graphql-codegen/client-preset": "4.5.1",
|
|
221
226
|
"@types/estree": "1.0.6",
|
|
222
227
|
"@types/express": "5.0.0",
|
|
223
|
-
"@types/har-format": "1.2.
|
|
228
|
+
"@types/har-format": "1.2.16",
|
|
229
|
+
"@types/hast": "^3.0.4",
|
|
224
230
|
"@types/json-schema": "7.0.15",
|
|
225
231
|
"@types/mdast": "4.0.4",
|
|
226
232
|
"@types/mdx": "2.0.13",
|
|
227
233
|
"@types/node": "20.16.11",
|
|
228
234
|
"@types/object-hash": "3.0.6",
|
|
229
|
-
"@types/react-is": "
|
|
235
|
+
"@types/react-is": "19.0.0",
|
|
230
236
|
"@types/semver": "7.5.8",
|
|
237
|
+
"@types/unist": "^3.0.3",
|
|
231
238
|
"@types/yargs": "17.0.33",
|
|
232
239
|
"@vitest/coverage-v8": "2.1.8",
|
|
233
240
|
"mdast-util-mdx": "3.0.0",
|
|
234
|
-
"react": "
|
|
235
|
-
"react-dom": "
|
|
241
|
+
"react": "19.0.0",
|
|
242
|
+
"react-dom": "19.0.0",
|
|
236
243
|
"rollup-plugin-visualizer": "5.12.0",
|
|
237
244
|
"typescript": "5.7.2",
|
|
238
245
|
"vitest": "2.1.8"
|
|
@@ -243,7 +250,6 @@
|
|
|
243
250
|
},
|
|
244
251
|
"optionalDependencies": {
|
|
245
252
|
"@clerk/clerk-js": "5.11.0",
|
|
246
|
-
"@inkeep/widgets": "^0.2.289",
|
|
247
253
|
"@sentry/react": "^8.45.1"
|
|
248
254
|
},
|
|
249
255
|
"scripts": {
|
package/src/app/demo.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import logger from "loglevel";
|
|
2
2
|
import { createRoot } from "react-dom/client";
|
|
3
|
-
import { createBrowserRouter } from "react-router
|
|
3
|
+
import { createBrowserRouter } from "react-router";
|
|
4
4
|
import { Bootstrap } from "zudoku/components";
|
|
5
5
|
import type { ZudokuConfig } from "../config/validators/validate.js";
|
|
6
6
|
import DemoAnnouncement from "../lib/demo/DemoAnnouncement.js";
|
package/src/app/entry.client.tsx
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
createBrowserRouter,
|
|
4
4
|
matchRoutes,
|
|
5
5
|
type RouteObject,
|
|
6
|
-
} from "react-router
|
|
6
|
+
} from "react-router";
|
|
7
7
|
import config from "virtual:zudoku-config";
|
|
8
8
|
import "virtual:zudoku-theme.css";
|
|
9
9
|
import "vite/modulepreload-polyfill";
|
|
@@ -45,13 +45,6 @@ async function hydrateLazyRoutes(routes: RouteObject[]) {
|
|
|
45
45
|
function render(routes: RouteObject[]) {
|
|
46
46
|
const router = createBrowserRouter(routes, {
|
|
47
47
|
basename: config.basePath,
|
|
48
|
-
future: {
|
|
49
|
-
v7_relativeSplatPath: true,
|
|
50
|
-
v7_fetcherPersist: true,
|
|
51
|
-
v7_partialHydration: true,
|
|
52
|
-
v7_skipActionErrorRevalidation: true,
|
|
53
|
-
v7_normalizeFormMethod: true,
|
|
54
|
-
},
|
|
55
48
|
});
|
|
56
49
|
createRoot(root).render(<Bootstrap router={router} />);
|
|
57
50
|
}
|
|
@@ -60,13 +53,6 @@ async function hydrate(routes: RouteObject[]) {
|
|
|
60
53
|
await hydrateLazyRoutes(routes);
|
|
61
54
|
const router = createBrowserRouter(routes, {
|
|
62
55
|
basename: config.basePath,
|
|
63
|
-
future: {
|
|
64
|
-
v7_relativeSplatPath: true,
|
|
65
|
-
v7_fetcherPersist: true,
|
|
66
|
-
v7_partialHydration: true,
|
|
67
|
-
v7_skipActionErrorRevalidation: true,
|
|
68
|
-
v7_normalizeFormMethod: true,
|
|
69
|
-
},
|
|
70
56
|
});
|
|
71
57
|
|
|
72
58
|
hydrateRoot(root, <Bootstrap hydrate router={router} />);
|
package/src/app/entry.server.tsx
CHANGED
|
@@ -4,11 +4,11 @@ import type express from "express";
|
|
|
4
4
|
import logger from "loglevel";
|
|
5
5
|
import { Transform } from "node:stream";
|
|
6
6
|
import { renderToPipeableStream, renderToStaticMarkup } from "react-dom/server";
|
|
7
|
-
import { isRouteErrorResponse } from "react-router-dom";
|
|
8
7
|
import {
|
|
9
8
|
createStaticHandler,
|
|
10
9
|
createStaticRouter,
|
|
11
|
-
|
|
10
|
+
isRouteErrorResponse,
|
|
11
|
+
} from "react-router";
|
|
12
12
|
import "virtual:zudoku-theme.css";
|
|
13
13
|
import "vite/modulepreload-polyfill";
|
|
14
14
|
import { BootstrapStatic, ServerError } from "zudoku/components";
|
package/src/app/main.tsx
CHANGED
package/src/app/sentry.ts
CHANGED
package/src/app/standalone.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRoot } from "react-dom/client";
|
|
2
|
-
import { createBrowserRouter } from "react-router
|
|
2
|
+
import { createBrowserRouter } from "react-router";
|
|
3
3
|
import { Bootstrap } from "zudoku/components";
|
|
4
4
|
import type { ZudokuConfig } from "../config/validators/validate.js";
|
|
5
5
|
import { openApiPlugin } from "../lib/plugins/openapi/index.js";
|
|
@@ -5,12 +5,13 @@ import {
|
|
|
5
5
|
} from "@tanstack/react-query";
|
|
6
6
|
import { type HelmetData, HelmetProvider } from "@zudoku/react-helmet-async";
|
|
7
7
|
import { StrictMode } from "react";
|
|
8
|
-
import { type createBrowserRouter, RouterProvider } from "react-router-dom";
|
|
9
8
|
import {
|
|
9
|
+
type createBrowserRouter,
|
|
10
10
|
type createStaticRouter,
|
|
11
11
|
type StaticHandlerContext,
|
|
12
12
|
StaticRouterProvider,
|
|
13
|
-
} from "react-router
|
|
13
|
+
} from "react-router";
|
|
14
|
+
import { RouterProvider } from "react-router/dom";
|
|
14
15
|
import { StaggeredRenderContext } from "../plugins/openapi/StaggeredRender.js";
|
|
15
16
|
|
|
16
17
|
const queryClient = new QueryClient({
|
|
@@ -33,10 +34,7 @@ const Bootstrap = ({
|
|
|
33
34
|
<HydrationBoundary state={hydrate ? (window as any).DATA : undefined}>
|
|
34
35
|
<HelmetProvider>
|
|
35
36
|
<StaggeredRenderContext.Provider value={{ stagger: !hydrate }}>
|
|
36
|
-
<RouterProvider
|
|
37
|
-
router={router}
|
|
38
|
-
future={{ v7_startTransition: true }}
|
|
39
|
-
/>
|
|
37
|
+
<RouterProvider router={router} />
|
|
40
38
|
</StaggeredRenderContext.Provider>
|
|
41
39
|
</HelmetProvider>
|
|
42
40
|
</HydrationBoundary>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Helmet } from "@zudoku/react-helmet-async";
|
|
2
2
|
import { PanelLeftIcon } from "lucide-react";
|
|
3
3
|
import { Suspense, useEffect, useRef, useState, type ReactNode } from "react";
|
|
4
|
-
import { Outlet, useLocation, useNavigation } from "react-router
|
|
4
|
+
import { Outlet, useLocation, useNavigation } from "react-router";
|
|
5
5
|
import { useSpinDelay } from "spin-delay";
|
|
6
6
|
import { Drawer, DrawerTrigger } from "../ui/Drawer.js";
|
|
7
7
|
import { cn } from "../util/cn.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import ReactMarkdown from "react-markdown";
|
|
2
1
|
import rehypeRaw from "rehype-raw";
|
|
3
2
|
import remarkGfm from "remark-gfm";
|
|
4
3
|
import { visit } from "unist-util-visit";
|
|
5
4
|
import { MdxComponents } from "../util/MdxComponents.js";
|
|
5
|
+
import { ReactMarkdown } from "./ReactMarkdown.js";
|
|
6
6
|
|
|
7
7
|
// same as in packages/dev-portal/framework/vite.ts
|
|
8
8
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UnlinkIcon } from "lucide-react";
|
|
2
|
-
import { Link, useParams } from "react-router
|
|
2
|
+
import { Link, useParams } from "react-router";
|
|
3
3
|
import { CategoryHeading } from "./CategoryHeading.js";
|
|
4
4
|
import { DeveloperHint } from "./DeveloperHint.js";
|
|
5
5
|
import { Heading } from "./Heading.js";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) Espen Hovlandsdal
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-unnecessary-condition */
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* This is a fork of `react-markdown` converted to typescript.
|
|
6
|
+
* The reason we fork it is because react-markdown is comptaible with
|
|
7
|
+
* unified 11, but references the unified 10 and related packages causing
|
|
8
|
+
* type errors and a bunch of extra imports
|
|
9
|
+
*
|
|
10
|
+
* Source: https://github.com/remarkjs/react-markdown/blob/main/index.js
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { unreachable } from "devlop";
|
|
14
|
+
import type { Element, ElementContent, Nodes, Parents } from "hast";
|
|
15
|
+
import {
|
|
16
|
+
Components as JsxRuntimeComponents,
|
|
17
|
+
toJsxRuntime,
|
|
18
|
+
} from "hast-util-to-jsx-runtime";
|
|
19
|
+
import { urlAttributes } from "html-url-attributes";
|
|
20
|
+
import { ReactElement } from "react";
|
|
21
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
22
|
+
import remarkParse from "remark-parse";
|
|
23
|
+
import remarkRehype, { Options as RemarkRehypeOptions } from "remark-rehype";
|
|
24
|
+
import { PluggableList, unified } from "unified";
|
|
25
|
+
import { visit } from "unist-util-visit";
|
|
26
|
+
import { VFile } from "vfile";
|
|
27
|
+
|
|
28
|
+
const changelog =
|
|
29
|
+
"https://github.com/remarkjs/react-markdown/blob/main/changelog.md";
|
|
30
|
+
|
|
31
|
+
const emptyPlugins: PluggableList = [];
|
|
32
|
+
const emptyRemarkRehypeOptions: Readonly<RemarkRehypeOptions> = {
|
|
33
|
+
allowDangerousHtml: true,
|
|
34
|
+
};
|
|
35
|
+
const safeProtocol = /^(https?|ircs?|mailto|xmpp)$/i;
|
|
36
|
+
|
|
37
|
+
interface Deprecation {
|
|
38
|
+
from: string;
|
|
39
|
+
id: string;
|
|
40
|
+
to?: keyof Options;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
interface AllowElement {
|
|
44
|
+
(
|
|
45
|
+
element: Readonly<Element>,
|
|
46
|
+
index: number,
|
|
47
|
+
parent: Readonly<Parents> | undefined,
|
|
48
|
+
): boolean | null | undefined;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
interface UrlTransform {
|
|
52
|
+
(
|
|
53
|
+
url: string,
|
|
54
|
+
key: string,
|
|
55
|
+
node: Readonly<Element>,
|
|
56
|
+
): string | null | undefined;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
60
|
+
interface Components extends Partial<JsxRuntimeComponents> {}
|
|
61
|
+
|
|
62
|
+
interface Options {
|
|
63
|
+
allowElement?: AllowElement | null;
|
|
64
|
+
allowedElements?: ReadonlyArray<string> | null;
|
|
65
|
+
children?: string | null;
|
|
66
|
+
className?: string | null;
|
|
67
|
+
components?: Components | null;
|
|
68
|
+
disallowedElements?: ReadonlyArray<string> | null;
|
|
69
|
+
rehypePlugins?: PluggableList | null;
|
|
70
|
+
remarkPlugins?: PluggableList | null;
|
|
71
|
+
remarkRehypeOptions?: Readonly<RemarkRehypeOptions> | null;
|
|
72
|
+
skipHtml?: boolean | null;
|
|
73
|
+
unwrapDisallowed?: boolean | null;
|
|
74
|
+
urlTransform?: UrlTransform | null;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
const deprecations: ReadonlyArray<Readonly<Deprecation>> = [
|
|
78
|
+
{ from: "astPlugins", id: "remove-buggy-html-in-markdown-parser" },
|
|
79
|
+
{ from: "allowDangerousHtml", id: "remove-buggy-html-in-markdown-parser" },
|
|
80
|
+
{
|
|
81
|
+
from: "allowNode",
|
|
82
|
+
id: "replace-allownode-allowedtypes-and-disallowedtypes",
|
|
83
|
+
to: "allowElement",
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
from: "allowedTypes",
|
|
87
|
+
id: "replace-allownode-allowedtypes-and-disallowedtypes",
|
|
88
|
+
to: "allowedElements",
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
from: "disallowedTypes",
|
|
92
|
+
id: "replace-allownode-allowedtypes-and-disallowedtypes",
|
|
93
|
+
to: "disallowedElements",
|
|
94
|
+
},
|
|
95
|
+
{ from: "escapeHtml", id: "remove-buggy-html-in-markdown-parser" },
|
|
96
|
+
{ from: "includeElementIndex", id: "#remove-includeelementindex" },
|
|
97
|
+
{
|
|
98
|
+
from: "includeNodeIndex",
|
|
99
|
+
id: "change-includenodeindex-to-includeelementindex",
|
|
100
|
+
},
|
|
101
|
+
{ from: "linkTarget", id: "remove-linktarget" },
|
|
102
|
+
{
|
|
103
|
+
from: "plugins",
|
|
104
|
+
id: "change-plugins-to-remarkplugins",
|
|
105
|
+
to: "remarkPlugins",
|
|
106
|
+
},
|
|
107
|
+
{ from: "rawSourcePos", id: "#remove-rawsourcepos" },
|
|
108
|
+
{ from: "renderers", id: "change-renderers-to-components", to: "components" },
|
|
109
|
+
{ from: "source", id: "change-source-to-children", to: "children" },
|
|
110
|
+
{ from: "sourcePos", id: "#remove-sourcepos" },
|
|
111
|
+
{ from: "transformImageUri", id: "#add-urltransform", to: "urlTransform" },
|
|
112
|
+
{ from: "transformLinkUri", id: "#add-urltransform", to: "urlTransform" },
|
|
113
|
+
];
|
|
114
|
+
|
|
115
|
+
export function ReactMarkdown(options: Readonly<Options>): ReactElement {
|
|
116
|
+
const allowedElements = options.allowedElements;
|
|
117
|
+
const allowElement = options.allowElement;
|
|
118
|
+
const children = options.children || "";
|
|
119
|
+
const className = options.className;
|
|
120
|
+
const components = options.components;
|
|
121
|
+
const disallowedElements = options.disallowedElements;
|
|
122
|
+
const rehypePlugins = options.rehypePlugins || emptyPlugins;
|
|
123
|
+
const remarkPlugins = options.remarkPlugins || emptyPlugins;
|
|
124
|
+
const remarkRehypeOptions = options.remarkRehypeOptions
|
|
125
|
+
? { ...options.remarkRehypeOptions, ...emptyRemarkRehypeOptions }
|
|
126
|
+
: emptyRemarkRehypeOptions;
|
|
127
|
+
const skipHtml = options.skipHtml;
|
|
128
|
+
const unwrapDisallowed = options.unwrapDisallowed;
|
|
129
|
+
const urlTransform = options.urlTransform || defaultUrlTransform;
|
|
130
|
+
|
|
131
|
+
const processor = unified()
|
|
132
|
+
.use(remarkParse)
|
|
133
|
+
.use(remarkPlugins)
|
|
134
|
+
.use(remarkRehype, remarkRehypeOptions)
|
|
135
|
+
.use(rehypePlugins);
|
|
136
|
+
|
|
137
|
+
const file = new VFile();
|
|
138
|
+
|
|
139
|
+
if (typeof children === "string") {
|
|
140
|
+
file.value = children;
|
|
141
|
+
} else {
|
|
142
|
+
unreachable(
|
|
143
|
+
`Unexpected value '${children}' for 'children' prop, expected 'string'`,
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
if (allowedElements && disallowedElements) {
|
|
148
|
+
unreachable(
|
|
149
|
+
"Unexpected combined `allowedElements` and `disallowedElements`, expected one or the other",
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
for (const deprecation of deprecations) {
|
|
154
|
+
if (Object.prototype.hasOwnProperty.call(options, deprecation.from)) {
|
|
155
|
+
unreachable(
|
|
156
|
+
`Unexpected '${deprecation.from}' prop, ` +
|
|
157
|
+
(deprecation.to ? `use '${deprecation.to}' instead` : "remove it") +
|
|
158
|
+
` (see <${changelog}#${deprecation.id}> for more info)`,
|
|
159
|
+
);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
const mdastTree = processor.parse(file);
|
|
164
|
+
let hastTree: Nodes = processor.runSync(mdastTree, file);
|
|
165
|
+
|
|
166
|
+
if (className) {
|
|
167
|
+
hastTree = {
|
|
168
|
+
type: "element",
|
|
169
|
+
tagName: "div",
|
|
170
|
+
properties: { className },
|
|
171
|
+
children:
|
|
172
|
+
hastTree.type === "root"
|
|
173
|
+
? (hastTree.children as ElementContent[])
|
|
174
|
+
: [hastTree],
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
// Nodes type is slightly off, different versions of `hast` have different types
|
|
179
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
180
|
+
// @ts-ignore
|
|
181
|
+
visit(hastTree, transform);
|
|
182
|
+
|
|
183
|
+
return toJsxRuntime(hastTree, {
|
|
184
|
+
Fragment,
|
|
185
|
+
components,
|
|
186
|
+
ignoreInvalidStyle: true,
|
|
187
|
+
jsx,
|
|
188
|
+
jsxs,
|
|
189
|
+
passKeys: true,
|
|
190
|
+
passNode: true,
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
function transform(
|
|
194
|
+
node: Nodes,
|
|
195
|
+
index: number | null,
|
|
196
|
+
parent: Parents | undefined,
|
|
197
|
+
): number | void {
|
|
198
|
+
if (node.type === "raw" && parent && typeof index === "number") {
|
|
199
|
+
if (skipHtml) {
|
|
200
|
+
parent.children.splice(index, 1);
|
|
201
|
+
} else {
|
|
202
|
+
parent.children[index] = { type: "text", value: node.value };
|
|
203
|
+
}
|
|
204
|
+
return index;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
if (node.type === "element") {
|
|
208
|
+
for (const key in urlAttributes) {
|
|
209
|
+
if (
|
|
210
|
+
Object.prototype.hasOwnProperty.call(urlAttributes, key) &&
|
|
211
|
+
Object.prototype.hasOwnProperty.call(node.properties, key)
|
|
212
|
+
) {
|
|
213
|
+
const value = node.properties[key];
|
|
214
|
+
const test = urlAttributes[key];
|
|
215
|
+
if (
|
|
216
|
+
test === null ||
|
|
217
|
+
test === undefined ||
|
|
218
|
+
test.includes(node.tagName)
|
|
219
|
+
) {
|
|
220
|
+
node.properties[key] = urlTransform(String(value || ""), key, node);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
let remove = allowedElements
|
|
226
|
+
? !allowedElements.includes(node.tagName)
|
|
227
|
+
: disallowedElements
|
|
228
|
+
? disallowedElements.includes(node.tagName)
|
|
229
|
+
: false;
|
|
230
|
+
|
|
231
|
+
if (!remove && allowElement && typeof index === "number") {
|
|
232
|
+
remove = !allowElement(node, index, parent);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
if (remove && parent && typeof index === "number") {
|
|
236
|
+
if (unwrapDisallowed && node.children) {
|
|
237
|
+
parent.children.splice(index, 1, ...node.children);
|
|
238
|
+
} else {
|
|
239
|
+
parent.children.splice(index, 1);
|
|
240
|
+
}
|
|
241
|
+
return index;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
function defaultUrlTransform(value: string): string {
|
|
248
|
+
const colon = value.indexOf(":");
|
|
249
|
+
const questionMark = value.indexOf("?");
|
|
250
|
+
const numberSign = value.indexOf("#");
|
|
251
|
+
const slash = value.indexOf("/");
|
|
252
|
+
|
|
253
|
+
if (
|
|
254
|
+
colon < 0 ||
|
|
255
|
+
(slash > -1 && colon > slash) ||
|
|
256
|
+
(questionMark > -1 && colon > questionMark) ||
|
|
257
|
+
(numberSign > -1 && colon > numberSign) ||
|
|
258
|
+
safeProtocol.test(value.slice(0, colon))
|
|
259
|
+
) {
|
|
260
|
+
return value;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
return "";
|
|
264
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { cx } from "class-variance-authority";
|
|
2
2
|
import { Suspense } from "react";
|
|
3
|
-
import { NavLink, useNavigation } from "react-router
|
|
3
|
+
import { NavLink, useNavigation } from "react-router";
|
|
4
4
|
import { TopNavigationItem } from "../../config/validators/common.js";
|
|
5
5
|
import { useAuth } from "../authentication/hook.js";
|
|
6
6
|
import { ZudokuError } from "../util/invariant.js";
|