scoobie 14.2.1 → 14.3.1
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/README.md +2 -2
- package/package.json +3 -3
- package/remark/tsconfig.json +4 -0
- package/src/components/Blockquote.tsx +2 -2
- package/src/components/CodeBlock/GraphQLPlaygroundAction.tsx +1 -1
- package/src/components/CodeBlock/LineNumbers.tsx +1 -1
- package/src/components/CodeBlock/Lines.tsx +2 -2
- package/src/components/CodeBlock.tsx +2 -2
- package/src/components/CopyableText.tsx +6 -1
- package/src/components/InlineCode.tsx +1 -1
- package/src/components/InternalLink.tsx +2 -2
- package/src/components/MdxProvider.tsx +2 -2
- package/src/components/SmartTextLink.tsx +1 -1
- package/src/components/Table.tsx +5 -5
- package/src/components/TableRow.tsx +2 -2
- package/src/components/TocRenderer.tsx +2 -2
- package/src/components/WrapperRenderer.tsx +1 -1
- package/src/private/ExternalTextLink.tsx +1 -1
- package/src/private/MdxCodeBlock.tsx +2 -2
- package/src/private/MdxOrderedList.tsx +2 -2
- package/src/private/OrderedListContext.tsx +1 -1
- package/src/private/Prism.ts +1 -1
- package/src/private/ScrollableInline.tsx +1 -1
- package/src/private/SpacedHeading.tsx +2 -2
- package/src/private/Table.tsx +3 -3
- package/src/private/TableCell.css.ts +1 -1
- package/src/private/TableCell.tsx +2 -2
- package/src/private/TableContext.ts +1 -1
- package/src/private/TableRow.tsx +1 -1
- package/src/private/Wrapper.tsx +3 -3
- package/src/private/hooks/graphqlPlayground.tsx +1 -2
- package/src/private/types.ts +2 -2
- package/src/private/url.ts +9 -3
- package/src/private/useMdxComponents.tsx +2 -2
- package/src/private/useMdxWrapper.tsx +3 -3
- package/src/private/validation.ts +1 -1
- package/styles/code.css.ts +1 -1
- package/types.d.ts +2 -0
package/README.md
CHANGED
|
@@ -345,7 +345,7 @@ export const MyFirstInlineCode = () => (
|
|
|
345
345
|
|
|
346
346
|
Render an internal link with the same opinions as our [MdxProvider](#mdxprovider):
|
|
347
347
|
|
|
348
|
-
- Internal links pass through the `v` URL
|
|
348
|
+
- Internal links pass through the `v` and `v-panel` URL parameters for UI version switching
|
|
349
349
|
|
|
350
350
|
Unlike [SmartTextLink](#smarttextlink), this is not bound to a parent [Text] as it has no underlying [TextLink].
|
|
351
351
|
It can be used to make complex components navigable rather than just sections of text.
|
|
@@ -398,7 +398,7 @@ export const Component = () => (
|
|
|
398
398
|
|
|
399
399
|
Render all underlying links as follows:
|
|
400
400
|
|
|
401
|
-
- Internal links pass through the `v` URL
|
|
401
|
+
- Internal links pass through the `v` and `v-panel` URL parameters for UI version switching
|
|
402
402
|
- External links open in a new tab
|
|
403
403
|
- Links with a [`download` attribute] prompt the user with a file download
|
|
404
404
|
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"sideEffects": false,
|
|
7
|
-
"version": "14.
|
|
7
|
+
"version": "14.3.1",
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@capsizecss/core": "^3.0.0",
|
|
10
10
|
"@mdx-js/loader": "^1.6.22",
|
|
@@ -34,14 +34,14 @@
|
|
|
34
34
|
"@storybook/storybook-deployer": "2.8.16",
|
|
35
35
|
"@types/react": "18.0.17",
|
|
36
36
|
"@types/react-dom": "18.0.6",
|
|
37
|
-
"braid-design-system": "32.
|
|
37
|
+
"braid-design-system": "32.5.0",
|
|
38
38
|
"loki": "0.31.1",
|
|
39
39
|
"react": "18.2.0",
|
|
40
40
|
"react-dom": "18.2.0",
|
|
41
41
|
"react-helmet-async": "1.3.0",
|
|
42
42
|
"react-router-dom": "6.9.0",
|
|
43
43
|
"semantic-release": "21.0.0",
|
|
44
|
-
"sku": "11.
|
|
44
|
+
"sku": "11.10.0",
|
|
45
45
|
"webpack": "5.76.3"
|
|
46
46
|
},
|
|
47
47
|
"files": [
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Box, Heading, Secondary, Stack } from 'braid-design-system';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
|
|
4
|
-
import { DEFAULT_SIZE, SIZE_TO_SPACE, Size } from '../private/size';
|
|
5
|
-
import { StackChildrenProps } from '../private/types';
|
|
4
|
+
import { DEFAULT_SIZE, SIZE_TO_SPACE, type Size } from '../private/size';
|
|
5
|
+
import type { StackChildrenProps } from '../private/types';
|
|
6
6
|
|
|
7
7
|
import * as styles from './Blockquote.css';
|
|
8
8
|
|
|
@@ -3,7 +3,7 @@ import url from 'url';
|
|
|
3
3
|
import { IconVideo, Text, TextLink } from 'braid-design-system';
|
|
4
4
|
import React from 'react';
|
|
5
5
|
|
|
6
|
-
import { SIZE_TO_SMALLER, Size } from '../../private/size';
|
|
6
|
+
import { SIZE_TO_SMALLER, type Size } from '../../private/size';
|
|
7
7
|
|
|
8
8
|
const URL = url.URL ?? window.URL;
|
|
9
9
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Box, Stack } from 'braid-design-system';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
|
|
4
|
-
import { Size } from '../../private/size';
|
|
4
|
+
import type { Size } from '../../private/size';
|
|
5
5
|
|
|
6
6
|
import { code } from '../../../styles/code.css';
|
|
7
7
|
import * as styles from '../CodeBlock.css';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Box, Stack } from 'braid-design-system';
|
|
2
|
-
import Highlight from 'prism-react-renderer';
|
|
2
|
+
import type Highlight from 'prism-react-renderer';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
|
|
5
|
-
import { Size } from '../../private/size';
|
|
5
|
+
import type { Size } from '../../private/size';
|
|
6
6
|
|
|
7
7
|
import { code } from '../../../styles/code.css';
|
|
8
8
|
|
|
@@ -9,10 +9,10 @@ import {
|
|
|
9
9
|
DEFAULT_SIZE,
|
|
10
10
|
SIZE_TO_SMALLER,
|
|
11
11
|
SIZE_TO_TABLE_PADDING,
|
|
12
|
-
Size,
|
|
12
|
+
type Size,
|
|
13
13
|
} from '../private/size';
|
|
14
14
|
|
|
15
|
-
import { CodeChildProps, normaliseChildren } from './CodeBlock/CodeChild';
|
|
15
|
+
import { type CodeChildProps, normaliseChildren } from './CodeBlock/CodeChild';
|
|
16
16
|
import { GraphQLPlaygroundAction } from './CodeBlock/GraphQLPlaygroundAction';
|
|
17
17
|
import { LineNumbers } from './CodeBlock/LineNumbers';
|
|
18
18
|
import { Lines } from './CodeBlock/Lines';
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { IconCopy, IconTick, Text, TextLinkButton } from 'braid-design-system';
|
|
2
|
-
import React, {
|
|
2
|
+
import React, {
|
|
3
|
+
type ComponentProps,
|
|
4
|
+
type ReactNode,
|
|
5
|
+
useCallback,
|
|
6
|
+
useState,
|
|
7
|
+
} from 'react';
|
|
3
8
|
|
|
4
9
|
interface Props {
|
|
5
10
|
children: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import clsx, { ClassValue } from 'clsx';
|
|
2
|
-
import React, { ComponentProps, forwardRef } from 'react';
|
|
1
|
+
import clsx, { type ClassValue } from 'clsx';
|
|
2
|
+
import React, { type ComponentProps, forwardRef } from 'react';
|
|
3
3
|
import { NavLink, useLocation } from 'react-router-dom';
|
|
4
4
|
|
|
5
5
|
import { parseInternalHref } from '../private/url';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { MDXProvider } from '@mdx-js/react';
|
|
2
|
-
import React, { ReactNode } from 'react';
|
|
2
|
+
import React, { type ReactNode } from 'react';
|
|
3
3
|
|
|
4
4
|
import { GraphQLPlaygroundProvider } from '../private/hooks/graphqlPlayground';
|
|
5
|
-
import { DEFAULT_SIZE, Size } from '../private/size';
|
|
5
|
+
import { DEFAULT_SIZE, type Size } from '../private/size';
|
|
6
6
|
import { useMdxComponents } from '../private/useMdxComponents';
|
|
7
7
|
|
|
8
8
|
interface MdxProviderProps {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TextLink } from 'braid-design-system';
|
|
2
|
-
import React, { ComponentProps, ReactNode } from 'react';
|
|
2
|
+
import React, { type ComponentProps, type ReactNode } from 'react';
|
|
3
3
|
|
|
4
4
|
import { ExternalTextLink } from '../private/ExternalTextLink';
|
|
5
5
|
import { isExternalHref } from '../private/url';
|
package/src/components/Table.tsx
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { Box, Stack } from 'braid-design-system';
|
|
2
|
-
import React, { ComponentProps, ReactNode } from 'react';
|
|
1
|
+
import { Box, type Stack } from 'braid-design-system';
|
|
2
|
+
import React, { type ComponentProps, type ReactNode } from 'react';
|
|
3
3
|
|
|
4
4
|
import { BaseTable } from '../private/Table';
|
|
5
5
|
import {
|
|
6
6
|
DEFAULT_TABLE_TYPE,
|
|
7
|
-
TableAlign,
|
|
7
|
+
type TableAlign,
|
|
8
8
|
TableContext,
|
|
9
|
-
TableType,
|
|
9
|
+
type TableType,
|
|
10
10
|
} from '../private/TableContext';
|
|
11
|
-
import { DEFAULT_SIZE, Size } from '../private/size';
|
|
11
|
+
import { DEFAULT_SIZE, type Size } from '../private/size';
|
|
12
12
|
|
|
13
13
|
import { TableRow } from './TableRow';
|
|
14
14
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Stack, Text } from 'braid-design-system';
|
|
2
|
-
import React, { Children, ComponentProps, useContext } from 'react';
|
|
1
|
+
import { type Stack, Text } from 'braid-design-system';
|
|
2
|
+
import React, { Children, type ComponentProps, useContext } from 'react';
|
|
3
3
|
import flattenChildren from 'react-keyed-flatten-children';
|
|
4
4
|
|
|
5
5
|
import { TableCell } from '../private/TableCell';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React, { Children, FunctionComponent, ReactNode } from 'react';
|
|
1
|
+
import React, { Children, type FunctionComponent, type ReactNode } from 'react';
|
|
2
2
|
|
|
3
|
-
import { HeadingLevel, StackChildrenProps } from '../private/types';
|
|
3
|
+
import type { HeadingLevel, StackChildrenProps } from '../private/types';
|
|
4
4
|
import { isMdxElement } from '../private/validation';
|
|
5
5
|
|
|
6
6
|
import { WrapperRenderer } from './WrapperRenderer';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
3
|
import { CodeBlock } from '../components/CodeBlock';
|
|
4
|
-
import { CodeChildProps } from '../components/CodeBlock/CodeChild';
|
|
4
|
+
import type { CodeChildProps } from '../components/CodeBlock/CodeChild';
|
|
5
5
|
|
|
6
6
|
import { useGraphQLPlayground } from './hooks/graphqlPlayground';
|
|
7
|
-
import { Size } from './size';
|
|
7
|
+
import type { Size } from './size';
|
|
8
8
|
|
|
9
9
|
const toLabel = (meta?: string) => meta?.match(/label="([^"]+)"/)?.[1];
|
|
10
10
|
|
|
@@ -2,8 +2,8 @@ import { List } from 'braid-design-system';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
|
|
4
4
|
import { useOrderedListContext } from './OrderedListContext';
|
|
5
|
-
import { SIZE_TO_SPACE, Size } from './size';
|
|
6
|
-
import { StackChildrenProps } from './types';
|
|
5
|
+
import { SIZE_TO_SPACE, type Size } from './size';
|
|
6
|
+
import type { StackChildrenProps } from './types';
|
|
7
7
|
|
|
8
8
|
type Props = StackChildrenProps & {
|
|
9
9
|
size: Size;
|
package/src/private/Prism.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Box, Heading, IconLink, Text } from 'braid-design-system';
|
|
2
|
-
import React, { FunctionComponent, ReactNode } from 'react';
|
|
2
|
+
import React, { type FunctionComponent, type ReactNode } from 'react';
|
|
3
3
|
|
|
4
4
|
import { SmartTextLink } from '../components/SmartTextLink';
|
|
5
5
|
|
|
6
|
-
import { HeadingLevel } from './types';
|
|
6
|
+
import type { HeadingLevel } from './types';
|
|
7
7
|
|
|
8
8
|
import * as styles from './SpacedHeading.css';
|
|
9
9
|
|
package/src/private/Table.tsx
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Box } from 'braid-design-system';
|
|
2
|
-
import React, { ReactNode } from 'react';
|
|
2
|
+
import React, { type ReactNode } from 'react';
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
DEFAULT_TABLE_CELL_COMPONENT,
|
|
6
6
|
DEFAULT_TABLE_TYPE,
|
|
7
7
|
TableContext,
|
|
8
|
-
TableType,
|
|
8
|
+
type TableType,
|
|
9
9
|
} from './TableContext';
|
|
10
|
-
import { DEFAULT_SIZE, Size } from './size';
|
|
10
|
+
import { DEFAULT_SIZE, type Size } from './size';
|
|
11
11
|
|
|
12
12
|
import * as styles from './Table.css';
|
|
13
13
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { styleVariants } from '@vanilla-extract/css';
|
|
2
2
|
import { vars } from 'braid-design-system/css';
|
|
3
3
|
|
|
4
|
-
import { SIZE_TO_TABLE_PADDING, Size } from './size';
|
|
4
|
+
import { SIZE_TO_TABLE_PADDING, type Size } from './size';
|
|
5
5
|
|
|
6
6
|
import { tableRowSelection } from './TableRow.css';
|
|
7
7
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Box, Stack } from 'braid-design-system';
|
|
2
2
|
import React, { useContext } from 'react';
|
|
3
3
|
|
|
4
|
-
import { TableAlign, TableContext } from './TableContext';
|
|
4
|
+
import { type TableAlign, TableContext } from './TableContext';
|
|
5
5
|
import { SIZE_TO_SPACE, SIZE_TO_TABLE_PADDING } from './size';
|
|
6
|
-
import { StackChildrenProps } from './types';
|
|
6
|
+
import type { StackChildrenProps } from './types';
|
|
7
7
|
|
|
8
8
|
import * as styles from './TableCell.css';
|
|
9
9
|
|
package/src/private/TableRow.tsx
CHANGED
package/src/private/Wrapper.tsx
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Box, Stack } from 'braid-design-system';
|
|
2
|
-
import React, { FunctionComponent } from 'react';
|
|
2
|
+
import React, { type FunctionComponent } from 'react';
|
|
3
3
|
|
|
4
|
-
import { SIZE_TO_SPACE, Size } from './size';
|
|
5
|
-
import { StackChildrenProps } from './types';
|
|
4
|
+
import { SIZE_TO_SPACE, type Size } from './size';
|
|
5
|
+
import type { StackChildrenProps } from './types';
|
|
6
6
|
|
|
7
7
|
import * as styles from './Wrapper.css';
|
|
8
8
|
|
package/src/private/types.ts
CHANGED
package/src/private/url.ts
CHANGED
|
@@ -5,10 +5,13 @@ const URLSearchParams = url.URLSearchParams ?? window.URLSearchParams;
|
|
|
5
5
|
|
|
6
6
|
const EXAMPLE_BASE_URL = 'https://example.com';
|
|
7
7
|
|
|
8
|
-
const
|
|
8
|
+
const parseVersionParams = (search: string) => {
|
|
9
9
|
const urlSearchParams = new URLSearchParams(search);
|
|
10
10
|
|
|
11
|
-
return
|
|
11
|
+
return {
|
|
12
|
+
v: urlSearchParams.get('v'),
|
|
13
|
+
vPanel: urlSearchParams.get('v-panel'),
|
|
14
|
+
};
|
|
12
15
|
};
|
|
13
16
|
|
|
14
17
|
const hrefToUrl = (href: string, pathname: string) => {
|
|
@@ -32,11 +35,14 @@ export const parseInternalHref = (
|
|
|
32
35
|
) => {
|
|
33
36
|
const { hash, pathname, searchParams } = hrefToUrl(href, location.pathname);
|
|
34
37
|
|
|
35
|
-
const v =
|
|
38
|
+
const { v, vPanel } = parseVersionParams(location.search);
|
|
36
39
|
|
|
37
40
|
if (v !== null) {
|
|
38
41
|
searchParams.set('v', v);
|
|
39
42
|
}
|
|
43
|
+
if (vPanel !== null) {
|
|
44
|
+
searchParams.set('v-panel', vPanel);
|
|
45
|
+
}
|
|
40
46
|
|
|
41
47
|
const search = searchParams.toString();
|
|
42
48
|
|
|
@@ -13,10 +13,10 @@ import { MdxTable } from './Table';
|
|
|
13
13
|
import { TableCell } from './TableCell';
|
|
14
14
|
import { BaseTableRow } from './TableRow';
|
|
15
15
|
import { Wrapper } from './Wrapper';
|
|
16
|
-
import { SIZE_TO_SPACE, Size } from './size';
|
|
16
|
+
import { SIZE_TO_SPACE, type Size } from './size';
|
|
17
17
|
|
|
18
|
-
import { img } from '../../styles/img.css';
|
|
19
18
|
import * as styles from './useMdxComponents.css';
|
|
19
|
+
import { img } from '../../styles/img.css';
|
|
20
20
|
|
|
21
21
|
interface Props {
|
|
22
22
|
size: Size;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import { Wrapper, WrapperComponent } from './Wrapper';
|
|
4
|
-
import { Size } from './size';
|
|
5
|
-
import { StackChildrenProps } from './types';
|
|
3
|
+
import { Wrapper, type WrapperComponent } from './Wrapper';
|
|
4
|
+
import type { Size } from './size';
|
|
5
|
+
import type { StackChildrenProps } from './types';
|
|
6
6
|
|
|
7
7
|
export const useMdxWrapper =
|
|
8
8
|
(component: WrapperComponent, size: Size) =>
|
package/styles/code.css.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { createStyleObject, getCapHeight } from '@capsizecss/core';
|
|
|
2
2
|
import { styleVariants } from '@vanilla-extract/css';
|
|
3
3
|
import { responsiveStyle } from 'braid-design-system/css';
|
|
4
4
|
|
|
5
|
-
import { Size } from '../src/private/size';
|
|
5
|
+
import type { Size } from '../src/private/size';
|
|
6
6
|
|
|
7
7
|
import { monospaceFontFamily } from '.';
|
|
8
8
|
|
package/types.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ declare module '*.mdx' {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
declare namespace MDX {
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-imports
|
|
14
15
|
type Document = import('react').FunctionComponent<{
|
|
15
16
|
components?:
|
|
16
17
|
| ProviderComponents
|
|
@@ -20,6 +21,7 @@ declare namespace MDX {
|
|
|
20
21
|
// Braid's type-level strictness does not play well with dynamic ReactNodes,
|
|
21
22
|
// so we simply lie to TypeScript.
|
|
22
23
|
type ProviderComponent<Props = Record<string, unknown>> =
|
|
24
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-imports
|
|
23
25
|
import('react').ComponentType<{ children: any } & Props>;
|
|
24
26
|
|
|
25
27
|
type ProviderComponents = Partial<{
|