Skip to content

Commit 16a1d81

Browse files
authored
fix algolia and refactor components (dotansimha#8089)
* fix algolia * bump components to fix reactpaginate
1 parent 91ae040 commit 16a1d81

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+96
-200
lines changed

patches/nextra-theme-docs+2.0.0-alpha.59.patch

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ index 0f5435d..0aa53c7
4848
+++ b/node_modules/nextra-theme-docs/dist/index.js
4949
@@ -51,7 +51,7 @@ var __async = (__this, __arguments, generator) => {
5050
};
51-
51+
5252
// src/index.tsx
5353
-import React28, { useMemo as useMemo3, useState as useState7 } from "react";
5454
+import React32, { useMemo as useMemo3, useState as useState7 } from "react";
@@ -58,7 +58,7 @@ index 0f5435d..0aa53c7
5858
@@ -77,9 +77,21 @@ var renderComponent = (ComponentOrNode, props, functionOnly) => {
5959
};
6060
var render_component_default = renderComponent;
61-
61+
6262
+// src/utils/use-mounted.ts
6363
+import { useEffect, useState } from "react";
6464
+var useMounted = () => {
@@ -76,7 +76,7 @@ index 0f5435d..0aa53c7
7676
+ newNextLinkBehavior: false
7777
+});
7878
var useConfig = () => React2.useContext(ThemeConfigContext);
79-
79+
8080
// src/head.tsx
8181
@@ -87,8 +99,7 @@ function Head({ title, locale, meta }) {
8282
const config = useConfig();
@@ -90,7 +90,7 @@ index 0f5435d..0aa53c7
9090
href: `data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text x='50' y='.9em' font-size='90' text-anchor='middle'>${config.unstable_faviconGlyph}</text><style>text{font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";fill:black}@media(prefers-color-scheme:dark){text{fill:white}}</style></svg>`
9191
@@ -110,9 +121,44 @@ function Head({ title, locale, meta }) {
9292
}
93-
93+
9494
// src/navbar.tsx
9595
-import React8 from "react";
9696
+import React17 from "react";
@@ -133,11 +133,11 @@ index 0f5435d..0aa53c7
133133
+
134134
+// src/navbar.tsx
135135
import { useRouter as useRouter3 } from "next/router";
136-
136+
137137
// src/utils/get-fs-route.ts
138138
@@ -134,33 +180,30 @@ function useMenuContext() {
139139
}
140-
140+
141141
// src/search.tsx
142142
-import React4, { useMemo, useCallback, useRef, useState, useEffect } from "react";
143143
+import React5, { useMemo, useCallback, useRef, useState as useState2, useEffect as useEffect2 } from "react";
@@ -230,7 +230,7 @@ index 0f5435d..0aa53c7
230230
href: res.route,
231231
@@ -254,19 +297,204 @@ var Search = ({ directories = [] }) => {
232232
var search_default = Search;
233-
233+
234234
// src/flexsearch.js
235235
-import React5, {
236236
+import React16, {
@@ -630,7 +630,7 @@ index 0f5435d..0aa53c7
630630
});
631631
}))));
632632
}
633-
633+
634634
-// src/icons/github.tsx
635635
-import React6 from "react";
636636
-var Github = ({ height = 40 }) => {
@@ -807,14 +807,14 @@ index 0f5435d..0aa53c7
807807
- })))))));
808808
+ })))));
809809
}
810-
810+
811811
// src/footer.tsx
812812
-import React17 from "react";
813813
+import React21 from "react";
814814
import cn5 from "classnames";
815815
-import Link4 from "next/link";
816816
import { useRouter as useRouter5 } from "next/router";
817-
817+
818818
-// src/icons/arrow-right.tsx
819819
-import React9 from "react";
820820
-var ArrowRight = (_a) => {
@@ -836,7 +836,7 @@ index 0f5435d..0aa53c7
836836
-import React13 from "react";
837837
+import React19 from "react";
838838
import { useRouter as useRouter4 } from "next/router";
839-
839+
840840
// src/select.tsx
841841
-import React11 from "react";
842842
+import React18 from "react";
@@ -904,7 +904,7 @@ index 0f5435d..0aa53c7
904904
- }));
905905
+ }, /* @__PURE__ */ React18.createElement(CheckIcon, null)) : null))))));
906906
}
907-
907+
908908
// src/locale-switch.tsx
909909
@@ -852,7 +951,7 @@ function LocaleSwitch({ options }) {
910910
const router = useRouter4();
@@ -929,7 +929,7 @@ index 0f5435d..0aa53c7
929929
key: l.locale,
930930
@@ -872,100 +971,36 @@ function LocaleSwitch({ options }) {
931931
}
932-
932+
933933
// src/theme-switch.tsx
934934
-import React16, { memo as memo2 } from "react";
935935
+import React20, { memo as memo2 } from "react";
@@ -1007,7 +1007,7 @@ index 0f5435d..0aa53c7
10071007
});
10081008
}
10091009
var theme_switch_default = memo2(ThemeSwitch);
1010-
1010+
10111011
// src/footer.tsx
10121012
-var NextLink = ({ route, title, isRTL }) => {
10131013
- return /* @__PURE__ */ React17.createElement(Link4, {
@@ -1121,7 +1121,7 @@ index 0f5435d..0aa53c7
11211121
}))));
11221122
};
11231123
var footer_default = Footer;
1124-
1124+
11251125
// src/misc/theme.tsx
11261126
-import Link5 from "next/link";
11271127
-import React23, {
@@ -1134,7 +1134,7 @@ index 0f5435d..0aa53c7
11341134
useContext as useContext3
11351135
} from "react";
11361136
import "intersection-observer";
1137-
1137+
11381138
// src/misc/active-anchor.tsx
11391139
-import React18, { createContext as createContext2, useContext as useContext2, useState as useState3 } from "react";
11401140
+import React22, { createContext as createContext2, useContext as useContext2, useState as useState4 } from "react";
@@ -1155,7 +1155,7 @@ index 0f5435d..0aa53c7
11551155
};
11561156
@@ -1052,7 +1092,7 @@ var ActiveAnchor = ({ children }) => {
11571157
import { MDXProvider } from "@mdx-js/react";
1158-
1158+
11591159
// src/components/collapse.tsx
11601160
-import React19, { useRef as useRef3, useEffect as useEffect3 } from "react";
11611161
+import React23, { useRef as useRef3, useEffect as useEffect4 } from "react";
@@ -1193,7 +1193,7 @@ index 0f5435d..0aa53c7
11931193
style: {
11941194
@@ -1121,7 +1161,7 @@ function Collapse({
11951195
}
1196-
1196+
11971197
// src/components/tabs.tsx
11981198
-import React20 from "react";
11991199
+import React24 from "react";
@@ -1232,7 +1232,7 @@ index 0f5435d..0aa53c7
12321232
className: "focus:outline-none focus-visible:ring"
12331233
}, children);
12341234
}
1235-
1235+
12361236
// src/bleed.tsx
12371237
-import React21 from "react";
12381238
+import React25 from "react";
@@ -1247,7 +1247,7 @@ index 0f5435d..0aa53c7
12471247
}, children);
12481248
};
12491249
var bleed_default = Bleed;
1250-
1250+
12511251
// src/callout.tsx
12521252
-import React22 from "react";
12531253
+import React26 from "react";
@@ -1507,7 +1507,7 @@ index 0f5435d..0aa53c7
15071507
+ components
15081508
}, children);
15091509
};
1510-
1510+
15111511
// src/sidebar.tsx
15121512
-import React24, { useState as useState5, useEffect as useEffect5, useMemo as useMemo2 } from "react";
15131513
+import React28, { useState as useState6, useEffect as useEffect6, useMemo as useMemo2 } from "react";
@@ -1516,10 +1516,10 @@ index 0f5435d..0aa53c7
15161516
import { useRouter as useRouter6 } from "next/router";
15171517
-import Link6 from "next/link";
15181518
import scrollIntoView from "scroll-into-view-if-needed";
1519-
1519+
15201520
// src/utils/get-heading-text.ts
15211521
@@ -1438,7 +1421,7 @@ function getHeadingText(heading) {
1522-
1522+
15231523
// src/sidebar.tsx
15241524
var TreeState = {};
15251525
-var Folder = React24.memo(FolderImpl);
@@ -1787,7 +1787,7 @@ index 0f5435d..0aa53c7
17871787
lite: !!config.i18n
17881788
}))) : null)))));
17891789
}
1790-
1790+
17911791
// src/toc.tsx
17921792
-import React25 from "react";
17931793
+import React29 from "react";
@@ -1906,7 +1906,7 @@ index 0f5435d..0aa53c7
19061906
className: "pt-4 leading-4"
19071907
}, render_component_default(config.tocExtraContent, { locale })) : null) : null));
19081908
}
1909-
1909+
19101910
// src/misc/default.config.tsx
19111911
-import React26 from "react";
19121912
+import React30 from "react";
@@ -1969,15 +1969,15 @@ index 0f5435d..0aa53c7
19691969
@@ -1901,7 +1872,7 @@ var default_config_default = defaultTheme;
19701970
// src/utils/normalize-pages.tsx
19711971
import getTitle from "title";
1972-
1972+
19731973
-// src/misc/theme-context.tsx
19741974
+// src/misc/theme-context.ts
19751975
var theme_context_default = {
19761976
navbar: true,
19771977
sidebar: true,
19781978
@@ -2163,31 +2134,29 @@ if (typeof window !== "undefined") {
19791979
}
1980-
1980+
19811981
// src/breadcrumb.tsx
19821982
-import React27 from "react";
19831983
-import Link7 from "next/link";
@@ -2015,7 +2015,7 @@ index 0f5435d..0aa53c7
20152015
+ }, item.title) : item.title));
20162016
}));
20172017
}
2018-
2018+
20192019
@@ -2215,9 +2184,9 @@ var Body = ({
20202020
const config = useConfig();
20212021
const { locale } = useRouter8();
@@ -2101,7 +2101,7 @@ index 0f5435d..0aa53c7
21012101
asPopover: activeType === "page" || hideSidebar,
21022102
includePlaceholder: themeContext.layout === "default"
21032103
- }), activeType === "page" || hideToc || themeContext.layout !== "default" ? themeContext.layout === "full" || themeContext.layout === "raw" ? null : /* @__PURE__ */ React28.createElement("div", {
2104-
+ }), console.log("(activeType === 'page'", activeType === "page", "hideSidebar", hideSidebar), activeType === "page" || hideToc || themeContext.layout !== "default" ? themeContext.layout === "full" || themeContext.layout === "raw" ? null : /* @__PURE__ */ React32.createElement("div", {
2104+
+ }), activeType === "page" || hideToc || themeContext.layout !== "default" ? themeContext.layout === "full" || themeContext.layout === "raw" ? null : /* @__PURE__ */ React32.createElement("div", {
21052105
className: "nextra-toc w-64 hidden xl:block text-sm px-4 order-last flex-shrink-0"
21062106
- }) : /* @__PURE__ */ React28.createElement(ToC, {
21072107
+ }) : /* @__PURE__ */ React32.createElement(ToC, {

website/package.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"autoprefixer": "10.4.7",
2323
"cssnano": "5.1.12",
2424
"eslint-config-next": "12.2.2",
25-
"fast-xml-parser": "^4.0.9",
25+
"fast-xml-parser": "4.0.9",
2626
"jsonpath": "1.1.1",
2727
"postcss": "8.4.14",
2828
"prettier-plugin-tailwindcss": "0.1.11",
@@ -77,7 +77,7 @@
7777
"@guild-docs/client": "4.0.0-alpha-977f9d3.0",
7878
"@guild-docs/server": "4.0.0",
7979
"@monaco-editor/react": "4.4.5",
80-
"@theguild/components": "2.0.0-alpha-8c5e72a.0",
80+
"@theguild/components": "2.0.0-alpha-9d29815.0",
8181
"classnames": "2.3.1",
8282
"date-fns": "2.28.0",
8383
"dedent": "0.7.0",
@@ -89,16 +89,15 @@
8989
"next-mdx-remote": "4.0.3",
9090
"next-seo": "5.4.0",
9191
"nextra": "2.0.0-alpha.56",
92-
"nextra-theme-docs": "2.0.0-alpha.59",
9392
"react": "17.0.2",
9493
"react-dom": "17.0.2",
9594
"react-icons": "4.4.0",
96-
"next-sitemap": "^3.1.10",
95+
"next-sitemap": "3.1.10",
9796
"node-polyfill-webpack-plugin": "2.0.0",
9897
"react-markdown": "8.0.3",
9998
"react-select": "5.4.0",
10099
"react-use": "17.4.0",
101-
"rehype-mdx-title": "^1.0.0",
100+
"rehype-mdx-title": "1.0.0",
102101
"typescript-json-schema": "0.54.0"
103102
},
104103
"browserslist": {

website/src/components/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
export { PackageCmd } from './package-cmd';
21
export { PackageApiDocs, PackageHeader } from './package-api-docs';

website/src/components/package-api-docs.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import { ReactElement } from 'react';
22
import { useSSG } from 'nextra/ssg';
33
import { components } from 'nextra-theme-docs/theme';
4-
import Callout from 'nextra-theme-docs/callout';
4+
import { Callout, PackageCmd } from '@theguild/components';
55
import { MDXRemote } from 'next-mdx-remote';
6-
import { PackageCmd } from './package-cmd';
76
import { format } from 'date-fns';
87

98
export const PackageApiDocs = (): ReactElement => {

website/src/components/package-cmd.tsx

Lines changed: 0 additions & 87 deletions
This file was deleted.

website/src/pages/docs/advanced/generated-files-colocation.mdx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import Callout from 'nextra-theme-docs/callout'
2-
import { PackageCmd } from '@/components'
1+
import { PackageCmd, Callout } from '@theguild/components'
32

43
# Generated files colocation
54

0 commit comments

Comments
 (0)