@theguild/components 8.2.0-alpha-20250103134229-59b7cae7900a3bc5e262bfbf14f9433af6cf3e73 → 8.2.0-alpha-20250103141522-0f0514ca373add829e5ba2d8422426460c6240a5

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.
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx } from "react/jsx-runtime";
2
3
  import { createContext, useContext, useEffect, useId, useRef, useState } from "react";
3
4
  import { cn } from "../cn";
@@ -1,16 +1,29 @@
1
1
  "use client";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { cn } from "../cn";
3
4
  import { Dropdown, DropdownContent, DropdownItem, DropdownTrigger } from "./dropdown";
5
+ import { CaretSlimIcon, CheckIcon } from "./icons";
4
6
  function VersionDropdown({ currentVersion, versions }) {
5
7
  return /* @__PURE__ */ jsxs(Dropdown, { type: "hover", className: "relative", children: [
6
- /* @__PURE__ */ jsx(DropdownTrigger, { className: "hive-focus cursor-default rounded p-3 font-medium leading-normal text-green-800 aria-expanded:text-green-1000 dark:text-neutral-300 dark:aria-expanded:text-neutral-100", children: currentVersion }),
7
- /* @__PURE__ */ jsx(DropdownContent, { className: "absolute left-full min-w-16 -translate-x-full translate-y-2 rounded-xl border border-beige-200 bg-white p-1 shadow-[0px_16px_32px_-12px_rgba(14,18,27,0.10)] transition ease-in-out data-[state=closed]:translate-y-0 data-[state=closed]:scale-95 data-[state=closed]:opacity-0 data-[state=open]:fade-in-90 dark:border-neutral-800 dark:bg-neutral-900", children: versions.map((version) => /* @__PURE__ */ jsx(
8
+ /* @__PURE__ */ jsxs(DropdownTrigger, { className: "hive-focus flex cursor-default items-center gap-1 py-2 font-medium leading-normal text-green-800 aria-expanded:text-green-1000 dark:text-neutral-300 dark:aria-expanded:text-neutral-100", children: [
9
+ currentVersion,
10
+ " ",
11
+ /* @__PURE__ */ jsx(CaretSlimIcon, { className: "size-3.5" })
12
+ ] }),
13
+ /* @__PURE__ */ jsx(DropdownContent, { className: "absolute left-full min-w-16 -translate-x-full translate-y-2 rounded-xl border border-beige-200 bg-white p-1 shadow-[0px_16px_32px_-12px_rgba(14,18,27,0.10)] transition ease-in-out data-[state=closed]:pointer-events-none data-[state=closed]:translate-y-0 data-[state=closed]:scale-95 data-[state=closed]:opacity-0 data-[state=open]:fade-in-90 dark:border-neutral-800 dark:bg-neutral-900", children: versions.map((version) => /* @__PURE__ */ jsxs(
8
14
  DropdownItem,
9
15
  {
10
16
  href: version.href,
11
17
  onClick: version.onClick,
12
- className: "block whitespace-nowrap rounded p-2 text-green-800 transition-colors hover:bg-beige-100 hover:text-green-1000 dark:text-neutral-300 dark:hover:bg-neutral-800/50 dark:hover:text-neutral-100",
13
- children: version.label ?? version.value
18
+ className: cn(
19
+ "flex items-center justify-between gap-1 whitespace-nowrap rounded p-2 text-green-800 transition-colors hover:bg-beige-100 hover:text-green-1000 dark:text-neutral-300 dark:hover:bg-neutral-800/50 dark:hover:text-neutral-100",
20
+ version.value === currentVersion && "pointer-events-none font-medium"
21
+ ),
22
+ children: [
23
+ version.label ?? version.value,
24
+ " ",
25
+ version.value === currentVersion && /* @__PURE__ */ jsx(CheckIcon, { className: "size-3.5" })
26
+ ]
14
27
  },
15
28
  version.value
16
29
  )) })
package/dist/index.d.mts CHANGED
@@ -39,6 +39,7 @@ export { IEditorProps, IFeatureListProps, IHeroGradientProps, IHeroIllustrationP
39
39
  export { AngularLettermark, ConductorLettermark, ConfigLettermark, EnvelopLettermark, FetsLettermark, GraphQLESlintLettermark, HeltinLettermark, InspectorLettermark, KitQLLettermark, ModulesLettermark, SSELettermark, ScalarsLettermark, SofaLettermark, StitchingLettermark, ToolsLettermark, WSLettermark, WhatsAppLettermark } from './logos/index.mjs';
40
40
  export { cn } from './cn.mjs';
41
41
  export { NextPageProps } from './next-types.mjs';
42
+ export { normalizePages } from 'nextra/normalize-pages';
42
43
  export { GraphQLConfCard, GraphQLConfCardProps } from './components/hive-navigation/graphql-conf-card.mjs';
43
44
  import 'react';
44
45
  import 'url';
package/dist/index.js CHANGED
@@ -20,6 +20,7 @@ export * from "./types/components";
20
20
  export * from "./logos";
21
21
  import { cn } from "./cn";
22
22
  export * from "./next-types";
23
+ import { normalizePages } from "nextra/normalize-pages";
23
24
  export {
24
25
  Banner,
25
26
  Bleed,
@@ -37,6 +38,7 @@ export {
37
38
  Table,
38
39
  Tabs,
39
40
  cn,
41
+ normalizePages,
40
42
  useConfig,
41
43
  useMounted,
42
44
  useTheme,
@@ -2,14 +2,17 @@ export { useMDXComponents } from './mdx-components.mjs';
2
2
  export { MDXRemote } from 'nextra/mdx-remote';
3
3
  export { fetchFilePathsFromGitHub } from 'nextra/fetch-filepaths-from-github';
4
4
  export { compileMdx } from 'nextra/compile';
5
- export { createIndexPage, getPageMap } from 'nextra/page-map';
5
+ export { convertToPageMap, createIndexPage, getPageMap, mergeMetaWithPageMap, normalizePageMap } from 'nextra/page-map';
6
+ export { evaluate } from 'nextra/evaluate';
6
7
  export { fetchPackageInfo } from './npm.mjs';
8
+ export { sharedMetaItems } from './shared-meta-items.mjs';
7
9
  export { GuildLayout, getDefaultMetadata } from './theme-layout.mjs';
8
10
  import 'next/image';
9
11
  import 'nextra';
10
12
  import 'nextra/mdx-components/pre/index';
11
13
  import 'react/jsx-runtime';
12
14
  import 'react';
15
+ import '../products.mjs';
13
16
  import 'next';
14
17
  import 'nextra-theme-docs';
15
18
  import 'nextra/components';
@@ -2,17 +2,30 @@ import { useMDXComponents } from "./mdx-components.js";
2
2
  import { MDXRemote } from "nextra/mdx-remote";
3
3
  import { fetchFilePathsFromGitHub } from "nextra/fetch-filepaths-from-github";
4
4
  import { compileMdx } from "nextra/compile";
5
- import { getPageMap, createIndexPage } from "nextra/page-map";
5
+ import {
6
+ getPageMap,
7
+ createIndexPage,
8
+ convertToPageMap,
9
+ mergeMetaWithPageMap,
10
+ normalizePageMap
11
+ } from "nextra/page-map";
12
+ import { evaluate } from "nextra/evaluate";
6
13
  import { fetchPackageInfo } from "./npm.js";
14
+ import { sharedMetaItems } from "./shared-meta-items";
7
15
  import { GuildLayout, getDefaultMetadata } from "./theme-layout.js";
8
16
  export {
9
17
  GuildLayout,
10
18
  MDXRemote,
11
19
  compileMdx,
20
+ convertToPageMap,
12
21
  createIndexPage,
22
+ evaluate,
13
23
  fetchFilePathsFromGitHub,
14
24
  fetchPackageInfo,
15
25
  getDefaultMetadata,
16
26
  getPageMap,
27
+ mergeMetaWithPageMap,
28
+ normalizePageMap,
29
+ sharedMetaItems,
17
30
  useMDXComponents
18
31
  };
@@ -50,7 +50,7 @@ const defaultNextraOptions = {
50
50
  defaultShowCopyCode: true,
51
51
  whiteListTagsStyling: ["iframe", "video", "source"],
52
52
  search: {
53
- codeblocks: true
53
+ codeblocks: false
54
54
  },
55
55
  mdxOptions: {
56
56
  // Check front matter only in production (when Webpack is used)
@@ -0,0 +1,57 @@
1
+ import * as react from 'react';
2
+ import { ProductType } from '../products.mjs';
3
+
4
+ declare function sharedMetaItems(options: {
5
+ githubUrl: string;
6
+ product: ProductType;
7
+ }): {
8
+ products: {
9
+ title: string;
10
+ type: string;
11
+ items: {
12
+ [k: string]: {
13
+ type: "separator";
14
+ title: react.ReactElement;
15
+ } | {
16
+ href: string;
17
+ title: react.ReactElement;
18
+ };
19
+ };
20
+ };
21
+ ecosystem: {
22
+ href?: string | undefined;
23
+ title: string;
24
+ type: string;
25
+ };
26
+ blog: {
27
+ title: string;
28
+ type: string;
29
+ href: string;
30
+ };
31
+ github: {
32
+ title: string;
33
+ type: string;
34
+ href: string;
35
+ };
36
+ 'the-guild': {
37
+ title: string;
38
+ type: string;
39
+ items: {
40
+ 'about-us': {
41
+ title: string;
42
+ href: string;
43
+ };
44
+ 'brand-assets': {
45
+ title: string;
46
+ href: string;
47
+ };
48
+ };
49
+ };
50
+ 'graphql-foundation': {
51
+ title: string;
52
+ type: string;
53
+ href: string;
54
+ };
55
+ };
56
+
57
+ export { sharedMetaItems };
@@ -0,0 +1,47 @@
1
+ import { PRODUCTS_MENU_LIST } from "../products";
2
+ function sharedMetaItems(options) {
3
+ return {
4
+ products: {
5
+ title: "Products",
6
+ type: "menu",
7
+ items: PRODUCTS_MENU_LIST
8
+ },
9
+ ecosystem: {
10
+ title: "Ecosystem",
11
+ type: "page",
12
+ ...options.product !== "HIVE" && { href: "https://the-guild.dev/graphql/hive/ecosystem" }
13
+ },
14
+ blog: {
15
+ title: "Blog",
16
+ type: "page",
17
+ href: "https://the-guild.dev/blog"
18
+ },
19
+ github: {
20
+ title: "GitHub",
21
+ type: "page",
22
+ href: options.githubUrl
23
+ },
24
+ "the-guild": {
25
+ title: "The Guild",
26
+ type: "menu",
27
+ items: {
28
+ "about-us": {
29
+ title: "About Us",
30
+ href: "https://the-guild.dev/about-us"
31
+ },
32
+ "brand-assets": {
33
+ title: "Brand Assets",
34
+ href: "https://the-guild.dev/logos"
35
+ }
36
+ }
37
+ },
38
+ "graphql-foundation": {
39
+ title: "GraphQL Foundation",
40
+ type: "page",
41
+ href: "https://graphql.org/community/foundation"
42
+ }
43
+ };
44
+ }
45
+ export {
46
+ sharedMetaItems
47
+ };
@@ -1,5 +1,6 @@
1
1
  import { FC, ReactNode, ComponentProps } from 'react';
2
2
  import { Metadata } from 'next';
3
+ import { PageMapItem } from 'nextra';
3
4
  import { Navbar, Layout } from 'nextra-theme-docs';
4
5
  import { Head } from 'nextra/components';
5
6
  import { HiveNavigation } from '../components/hive-navigation/index.mjs';
@@ -35,6 +36,7 @@ declare const GuildLayout: FC<{
35
36
  * Nextra's Docs Theme `<Navbar>` component props
36
37
  */
37
38
  navbarProps: NavbarProps;
39
+ pageMap?: PageMapItem[];
38
40
  }>;
39
41
  declare function getDefaultMetadata({ websiteName, description, productName, ...additionalMetadata }: {
40
42
  description?: string;
@@ -40,9 +40,10 @@ const GuildLayout = async ({
40
40
  headProps,
41
41
  logo,
42
42
  layoutProps,
43
- navbarProps
43
+ navbarProps,
44
+ ...props
44
45
  }) => {
45
- const [meta, ...pageMap] = await getPageMap();
46
+ const [meta, ...pageMap] = props.pageMap || await getPageMap();
46
47
  const pageMapWithCompanyMenu = [
47
48
  {
48
49
  data: {
@@ -136,12 +137,6 @@ function getDefaultMetadata({
136
137
  site: "https://the-guild.dev",
137
138
  creator: "@TheGuildDev"
138
139
  },
139
- openGraph: {
140
- siteName: websiteName,
141
- type: "website",
142
- images: `https://og-image.the-guild.dev/?product=${productName}`,
143
- url: siteUrl
144
- },
145
140
  applicationName: websiteName,
146
141
  appleWebApp: {
147
142
  title: websiteName
@@ -151,9 +146,20 @@ function getDefaultMetadata({
151
146
  follow: true
152
147
  },
153
148
  alternates: {
154
- canonical: siteUrl
149
+ // https://github.com/vercel/next.js/discussions/50189#discussioncomment-10826632
150
+ canonical: "./"
155
151
  },
156
- ...additionalMetadata
152
+ metadataBase: new URL(siteUrl),
153
+ ...additionalMetadata,
154
+ openGraph: {
155
+ siteName: websiteName,
156
+ type: "website",
157
+ images: `https://og-image.the-guild.dev/?product=${productName}`,
158
+ // https://github.com/vercel/next.js/discussions/50189#discussioncomment-10826632
159
+ url: "./",
160
+ locale: "en_US",
161
+ ...additionalMetadata.openGraph
162
+ }
157
163
  };
158
164
  }
159
165
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theguild/components",
3
- "version": "8.2.0-alpha-20250103134229-59b7cae7900a3bc5e262bfbf14f9433af6cf3e73",
3
+ "version": "8.2.0-alpha-20250103141522-0f0514ca373add829e5ba2d8422426460c6240a5",
4
4
  "repository": {
5
5
  "url": "https://github.com/the-guild-org/docs",
6
6
  "directory": "packages/components"
@@ -45,12 +45,12 @@
45
45
  },
46
46
  "dependencies": {
47
47
  "@giscus/react": "3.0.0",
48
- "@next/bundle-analyzer": "15.1.0",
48
+ "@next/bundle-analyzer": "15.1.1",
49
49
  "@radix-ui/react-navigation-menu": "^1.2.0",
50
50
  "clsx": "2.1.1",
51
51
  "fuzzy": "0.1.3",
52
- "nextra": "4.0.0-app-router.35",
53
- "nextra-theme-docs": "4.0.0-app-router.36",
52
+ "nextra": "4.0.0-app-router.39",
53
+ "nextra-theme-docs": "4.0.0-app-router.39",
54
54
  "react-paginate": "8.2.0",
55
55
  "react-player": "2.16.0",
56
56
  "semver": "^7.3.8",
@@ -60,13 +60,13 @@
60
60
  "@svgr/babel-plugin-remove-jsx-attribute": "^8.0.0",
61
61
  "@theguild/tailwind-config": "0.6.2",
62
62
  "@types/dedent": "0.7.2",
63
- "@types/react": "18.3.17",
63
+ "@types/react": "18.3.18",
64
64
  "@types/react-dom": "18.3.5",
65
65
  "@types/semver": "7.5.8",
66
66
  "dedent": "1.5.3",
67
67
  "esbuild-plugin-svgr": "^3.0.0",
68
68
  "graphql": "16.10.0",
69
- "next": "15.1.0",
69
+ "next": "15.1.1",
70
70
  "react": "18.3.1",
71
71
  "react-dom": "18.3.1",
72
72
  "unified": "^11.0.3",
package/style.css CHANGED
@@ -67,6 +67,10 @@
67
67
  &::before {
68
68
  background-color: rgb(229, 231, 235);
69
69
  }
70
+
71
+ & mark {
72
+ background-color: oklch(0.611752 0.07807 214.47 / 0.8);
73
+ }
70
74
  }
71
75
 
72
76
  /* #endregion search results */