@atlaskit/code 15.2.0 → 15.3.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/CHANGELOG.md +653 -645
- package/__perf__/code-block-syntax-highlighting.tsx +4 -1
- package/__perf__/source-code-examples/100-line-example.tsx +52 -40
- package/codemods/13.0.0-remove-unnecessary-code-props.tsx +61 -75
- package/codemods/13.0.0-rename-imports.tsx +214 -251
- package/codemods/14.0.0-lite-mode.tsx +5 -9
- package/codemods/__tests__/13.0.0-remove-unnecessary-code-props.tsx +43 -43
- package/codemods/__tests__/13.0.0-rename-imports.tsx +143 -143
- package/codemods/__tests__/14.0.0-lite-mode/14.0.0-lite-mode.tsx +35 -35
- package/codemods/__tests__/14.0.0-lite-mode/remove-language.tsx +21 -21
- package/codemods/__tests__/14.0.0-lite-mode/text-to-child.tsx +35 -35
- package/codemods/migrations/14.0.0-lite-mode/remove-language.tsx +1 -6
- package/codemods/migrations/14.0.0-lite-mode/text-to-child.tsx +53 -61
- package/codemods/utils/helpers.tsx +161 -201
- package/dist/cjs/bidi-warning/ui/styled.js +7 -0
- package/dist/cjs/code-block.js +8 -1
- package/dist/cjs/code.js +5 -0
- package/dist/cjs/internal/theme/styles.js +3 -2
- package/dist/cjs/syntax-highlighter/types.js +1 -0
- package/dist/es2019/bidi-warning/ui/styled.js +7 -0
- package/dist/es2019/code-block.js +8 -1
- package/dist/es2019/code.js +6 -0
- package/dist/es2019/internal/theme/styles.js +4 -1
- package/dist/es2019/syntax-highlighter/types.js +3 -0
- package/dist/esm/bidi-warning/ui/styled.js +7 -0
- package/dist/esm/code-block.js +8 -1
- package/dist/esm/code.js +6 -0
- package/dist/esm/internal/theme/styles.js +4 -1
- package/dist/esm/syntax-highlighter/types.js +3 -0
- package/dist/types/bidi-warning/ui/index.d.ts +1 -1
- package/dist/types/bidi-warning/ui/styled.d.ts +4 -1
- package/dist/types/code.d.ts +3 -0
- package/dist/types/extract-react-types/code-block.d.ts +16 -16
- package/dist/types/internal/hooks/use-highlight.d.ts +1 -1
- package/dist/types/internal/utils/get-normalized-language.d.ts +1 -1
- package/dist/types/syntax-highlighter/async.d.ts +1 -1
- package/dist/types/syntax-highlighter/lib/highlight.d.ts +1 -1
- package/dist/types/syntax-highlighter/lib/process/create-line-element.d.ts +1 -1
- package/dist/types/syntax-highlighter/lib/process/create-line.d.ts +1 -1
- package/dist/types/syntax-highlighter/lib/process/flatten-code-tree.d.ts +1 -1
- package/dist/types/syntax-highlighter/lib/process/get-code-tree.d.ts +1 -1
- package/dist/types/syntax-highlighter/lib/process/get-inline-line-number.d.ts +1 -1
- package/dist/types/syntax-highlighter/lib/process/index.d.ts +1 -1
- package/dist/types/syntax-highlighter/lib/react-renderer/create-children.d.ts +2 -2
- package/dist/types/syntax-highlighter/lib/react-renderer/create-element.d.ts +2 -2
- package/dist/types/syntax-highlighter/lib/react-renderer/index.d.ts +1 -1
- package/dist/types/syntax-highlighter/types.d.ts +2 -2
- package/dist/types/types.d.ts +1 -1
- package/dist/types-ts4.5/bidi-warning/ui/index.d.ts +1 -1
- package/dist/types-ts4.5/bidi-warning/ui/styled.d.ts +4 -1
- package/dist/types-ts4.5/code.d.ts +3 -0
- package/dist/types-ts4.5/extract-react-types/code-block.d.ts +16 -16
- package/dist/types-ts4.5/internal/hooks/use-highlight.d.ts +1 -1
- package/dist/types-ts4.5/internal/utils/get-normalized-language.d.ts +1 -1
- package/dist/types-ts4.5/syntax-highlighter/async.d.ts +1 -1
- package/dist/types-ts4.5/syntax-highlighter/lib/highlight.d.ts +1 -1
- package/dist/types-ts4.5/syntax-highlighter/lib/process/create-line-element.d.ts +1 -1
- package/dist/types-ts4.5/syntax-highlighter/lib/process/create-line.d.ts +1 -1
- package/dist/types-ts4.5/syntax-highlighter/lib/process/flatten-code-tree.d.ts +1 -1
- package/dist/types-ts4.5/syntax-highlighter/lib/process/get-code-tree.d.ts +1 -1
- package/dist/types-ts4.5/syntax-highlighter/lib/process/get-inline-line-number.d.ts +1 -1
- package/dist/types-ts4.5/syntax-highlighter/lib/process/index.d.ts +1 -1
- package/dist/types-ts4.5/syntax-highlighter/lib/react-renderer/create-children.d.ts +2 -2
- package/dist/types-ts4.5/syntax-highlighter/lib/react-renderer/create-element.d.ts +2 -2
- package/dist/types-ts4.5/syntax-highlighter/lib/react-renderer/index.d.ts +1 -1
- package/dist/types-ts4.5/syntax-highlighter/types.d.ts +2 -2
- package/dist/types-ts4.5/types.d.ts +1 -1
- package/package.json +108 -110
- package/report.api.md +807 -807
package/dist/esm/code-block.js
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
*/
|
|
1
4
|
/** @jsx jsx */
|
|
2
5
|
import { memo, useCallback, useMemo } from 'react';
|
|
6
|
+
|
|
7
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
3
8
|
import { css, jsx } from '@emotion/react';
|
|
4
9
|
import { useHighlightLines } from './internal/hooks/use-highlight';
|
|
5
10
|
import { getCodeBlockStyles, getCodeBlockTheme } from './internal/theme/styles';
|
|
@@ -43,7 +48,9 @@ var CodeBlock = /*#__PURE__*/memo(function CodeBlock(_ref) {
|
|
|
43
48
|
return getCodeBlockStyles(theme);
|
|
44
49
|
}, [theme]);
|
|
45
50
|
var styles = useMemo(function () {
|
|
46
|
-
return css(
|
|
51
|
+
return css(
|
|
52
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
53
|
+
getStyles(highlightedStartText, highlightedEndText, showLineNumbers, shouldWrapLongLines));
|
|
47
54
|
}, [highlightedStartText, highlightedEndText, showLineNumbers, shouldWrapLongLines, getStyles]);
|
|
48
55
|
var _useHighlightLines = useHighlightLines({
|
|
49
56
|
highlight: highlight,
|
package/dist/esm/code.js
CHANGED
|
@@ -2,8 +2,13 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
var _excluded = ["testId"],
|
|
4
4
|
_excluded2 = ["children", "codeBidiWarnings", "codeBidiWarningLabel", "codeBidiWarningTooltipEnabled"];
|
|
5
|
+
/**
|
|
6
|
+
* @jsxRuntime classic
|
|
7
|
+
*/
|
|
5
8
|
/** @jsx jsx */
|
|
6
9
|
import React, { forwardRef, memo } from 'react';
|
|
10
|
+
|
|
11
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
7
12
|
import { css, jsx } from '@emotion/react';
|
|
8
13
|
import CodeBidiWarning from './bidi-warning';
|
|
9
14
|
import codeBidiWarningDecorator from './bidi-warning/bidi-warning-decorator';
|
|
@@ -20,6 +25,7 @@ import { getCodeStyles } from './internal/theme/styles';
|
|
|
20
25
|
var Code = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function Code(_ref, ref) {
|
|
21
26
|
var testId = _ref.testId,
|
|
22
27
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
28
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
23
29
|
var styles = css(getCodeStyles());
|
|
24
30
|
var children = props.children,
|
|
25
31
|
_props$codeBidiWarnin = props.codeBidiWarnings,
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
5
|
+
|
|
4
6
|
import { CODE_FONT_SIZE, CODE_LINE_HEIGHT, HIGHLIGHT_BORDER_WIDTH, LINE_NUMBER_GUTTER, SPACING, VAR_CODE_BG_COLOR, VAR_CODE_LINE_NUMBER_BG_COLOR } from './constants';
|
|
5
7
|
import { getBaseTheme, getColorPalette } from './get-theme';
|
|
6
8
|
export var getLineNumWidth = function getLineNumWidth(numLines) {
|
|
@@ -212,7 +214,8 @@ export var getCodeBlockStyles = function getCodeBlockStyles(theme) {
|
|
|
212
214
|
// this is required to account for prismjs styles leaking into the codeblock
|
|
213
215
|
'code[class*="language-"], pre[class*="language-"], code': {
|
|
214
216
|
all: 'unset',
|
|
215
|
-
padding: showLineNumbers ? "".concat(SPACING, "px 0") : SPACING
|
|
217
|
+
padding: showLineNumbers ? "".concat(SPACING, "px 0") : SPACING,
|
|
218
|
+
tabSize: 4
|
|
216
219
|
},
|
|
217
220
|
display: 'flex',
|
|
218
221
|
lineHeight: CODE_LINE_HEIGHT,
|
|
@@ -6,6 +6,9 @@ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
|
6
6
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
7
7
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
8
8
|
import React from 'react';
|
|
9
|
+
|
|
10
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
11
|
+
|
|
9
12
|
// This wrapper supports the async loading of refractor and language grammars. The internal Highlight is a memo() functional component as expected
|
|
10
13
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
11
14
|
export var SyntaxHighlighter = /*#__PURE__*/function (_React$PureComponent) {
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
*/
|
|
1
4
|
/** @jsx jsx */
|
|
2
|
-
import { ReactNode } from 'react';
|
|
5
|
+
import { type ReactNode } from 'react';
|
|
3
6
|
import { jsx } from '@emotion/react';
|
|
4
7
|
export declare function Decorator({ bidiCharacter, children, testId, }: {
|
|
5
8
|
bidiCharacter: string;
|
package/dist/types/code.d.ts
CHANGED
|
@@ -12,24 +12,24 @@ export default function CodeBlock(__: {
|
|
|
12
12
|
*/
|
|
13
13
|
showLineNumbers?: boolean;
|
|
14
14
|
/**
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
15
|
+
Language reference designed to be populated from `SUPPORTED_LANGUAGES` in
|
|
16
|
+
`design-system/code`. Run against language grammars from PrismJS (full list
|
|
17
|
+
available at [PrismJS documentation](https://prismjs.com/#supported-languages)).
|
|
18
|
+
|
|
19
|
+
When set to `text` will not perform highlighting. If unsupported language
|
|
20
|
+
provided - code will be treated as "text" with no highlighting.
|
|
21
|
+
|
|
22
|
+
Defaults to `text`.
|
|
23
|
+
*/
|
|
24
24
|
language?: string;
|
|
25
25
|
/**
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
26
|
+
Comma delimited lines to highlight.
|
|
27
|
+
|
|
28
|
+
Example uses:
|
|
29
|
+
- To highlight one line `highlight="3"`
|
|
30
|
+
- To highlight a group of lines `highlight="1-5"`
|
|
31
|
+
- To highlight multiple groups `highlight="1-5,7,10,15-20"`
|
|
32
|
+
*/
|
|
33
33
|
highlight?: string;
|
|
34
34
|
/**
|
|
35
35
|
* Screen reader text for the start of a highlighted line.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HTMLProps } from 'react';
|
|
1
|
+
import { type HTMLProps } from 'react';
|
|
2
2
|
import type { CodeBlockProps } from '../types';
|
|
3
3
|
export declare const useHighlightLines: ({ highlight, testId, }: Pick<CodeBlockProps, 'highlight' | 'testId'>) => {
|
|
4
4
|
getHighlightStyles: (lineNumber: number, highlightedLines: number[]) => HTMLProps<HTMLElement>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { SupportedLanguages } from '../types';
|
|
1
|
+
import { type SupportedLanguages } from '../types';
|
|
2
2
|
export declare const normalizeLanguage: import("memoize-one").MemoizedFn<(language?: SupportedLanguages) => string>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { SyntaxHighlighterProps } from '../types';
|
|
2
|
+
import { type SyntaxHighlighterProps } from '../types';
|
|
3
3
|
/**
|
|
4
4
|
* Takes in a code string and (in the default behaviour):
|
|
5
5
|
* - Uses refractor to turn it into a tree structure with highlighting metadata
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { RefractorNode, SyntaxHighlighterLineProps } from '../../types';
|
|
1
|
+
import { type RefractorNode, type SyntaxHighlighterLineProps } from '../../types';
|
|
2
2
|
declare function createLineGenerator(lineProps: SyntaxHighlighterLineProps, shouldCreateParentElementForLines: boolean, showLineNumbers: boolean): (children: RefractorNode[], lineNumber: number, className?: string[]) => RefractorNode | RefractorNode[];
|
|
3
3
|
export default createLineGenerator;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { RefractorNode } from '../../types';
|
|
1
|
+
import { type RefractorNode } from '../../types';
|
|
2
2
|
export default function flattenCodeTree(tree: RefractorNode[], offset?: number, className?: string[]): RefractorNode[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { AstGenerator, RefractorNode } from '../../types';
|
|
1
|
+
import { type AstGenerator, type RefractorNode } from '../../types';
|
|
2
2
|
export default function getCodeTree(language: string, code: string, astGenerator?: AstGenerator): RefractorNode[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { RefractorNode } from '../../types';
|
|
1
|
+
import { type RefractorNode } from '../../types';
|
|
2
2
|
export default function getInlineLineNumber(lineNumber: number): RefractorNode;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { CodeBidiWarningConfig, RefractorNode } from '../../types';
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type CodeBidiWarningConfig, type RefractorNode } from '../../types';
|
|
3
3
|
export default function createChildren(codeBidiWarningConfig: CodeBidiWarningConfig): (children: RefractorNode[]) => ReactNode[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { CodeBidiWarningConfig, RefractorNode } from '../../types';
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type CodeBidiWarningConfig, type RefractorNode } from '../../types';
|
|
3
3
|
export default function createElement({ node, codeBidiWarningConfig, key, }: {
|
|
4
4
|
node: RefractorNode;
|
|
5
5
|
codeBidiWarningConfig: CodeBidiWarningConfig;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { SerializedStyles } from '@emotion/react';
|
|
3
|
-
import { AST, RefractorNode } from 'refractor';
|
|
2
|
+
import { type SerializedStyles } from '@emotion/react';
|
|
3
|
+
import { type AST, type RefractorNode } from 'refractor';
|
|
4
4
|
export type { AST, RefractorNode } from 'refractor';
|
|
5
5
|
export declare class SyntaxHighlighter extends React.PureComponent<SyntaxHighlighterProps> {
|
|
6
6
|
}
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { HTMLProps, ReactNode } from 'react';
|
|
2
|
-
export type { SupportedLanguages, Language, LanguageAlias, CodeBlockProps
|
|
2
|
+
export type { SupportedLanguages, Language, LanguageAlias, CodeBlockProps } from './internal/types';
|
|
3
3
|
export interface CodeProps extends HTMLProps<HTMLElement> {
|
|
4
4
|
/**
|
|
5
5
|
* A unique string that appears as a data attribute `data-testid`
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
*/
|
|
1
4
|
/** @jsx jsx */
|
|
2
|
-
import { ReactNode } from 'react';
|
|
5
|
+
import { type ReactNode } from 'react';
|
|
3
6
|
import { jsx } from '@emotion/react';
|
|
4
7
|
export declare function Decorator({ bidiCharacter, children, testId, }: {
|
|
5
8
|
bidiCharacter: string;
|
|
@@ -12,24 +12,24 @@ export default function CodeBlock(__: {
|
|
|
12
12
|
*/
|
|
13
13
|
showLineNumbers?: boolean;
|
|
14
14
|
/**
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
15
|
+
Language reference designed to be populated from `SUPPORTED_LANGUAGES` in
|
|
16
|
+
`design-system/code`. Run against language grammars from PrismJS (full list
|
|
17
|
+
available at [PrismJS documentation](https://prismjs.com/#supported-languages)).
|
|
18
|
+
|
|
19
|
+
When set to `text` will not perform highlighting. If unsupported language
|
|
20
|
+
provided - code will be treated as "text" with no highlighting.
|
|
21
|
+
|
|
22
|
+
Defaults to `text`.
|
|
23
|
+
*/
|
|
24
24
|
language?: string;
|
|
25
25
|
/**
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
26
|
+
Comma delimited lines to highlight.
|
|
27
|
+
|
|
28
|
+
Example uses:
|
|
29
|
+
- To highlight one line `highlight="3"`
|
|
30
|
+
- To highlight a group of lines `highlight="1-5"`
|
|
31
|
+
- To highlight multiple groups `highlight="1-5,7,10,15-20"`
|
|
32
|
+
*/
|
|
33
33
|
highlight?: string;
|
|
34
34
|
/**
|
|
35
35
|
* Screen reader text for the start of a highlighted line.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HTMLProps } from 'react';
|
|
1
|
+
import { type HTMLProps } from 'react';
|
|
2
2
|
import type { CodeBlockProps } from '../types';
|
|
3
3
|
export declare const useHighlightLines: ({ highlight, testId, }: Pick<CodeBlockProps, 'highlight' | 'testId'>) => {
|
|
4
4
|
getHighlightStyles: (lineNumber: number, highlightedLines: number[]) => HTMLProps<HTMLElement>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { SupportedLanguages } from '../types';
|
|
1
|
+
import { type SupportedLanguages } from '../types';
|
|
2
2
|
export declare const normalizeLanguage: import("memoize-one").MemoizedFn<(language?: SupportedLanguages) => string>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { SyntaxHighlighterProps } from '../types';
|
|
2
|
+
import { type SyntaxHighlighterProps } from '../types';
|
|
3
3
|
/**
|
|
4
4
|
* Takes in a code string and (in the default behaviour):
|
|
5
5
|
* - Uses refractor to turn it into a tree structure with highlighting metadata
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { RefractorNode, SyntaxHighlighterLineProps } from '../../types';
|
|
1
|
+
import { type RefractorNode, type SyntaxHighlighterLineProps } from '../../types';
|
|
2
2
|
declare function createLineGenerator(lineProps: SyntaxHighlighterLineProps, shouldCreateParentElementForLines: boolean, showLineNumbers: boolean): (children: RefractorNode[], lineNumber: number, className?: string[]) => RefractorNode | RefractorNode[];
|
|
3
3
|
export default createLineGenerator;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { RefractorNode } from '../../types';
|
|
1
|
+
import { type RefractorNode } from '../../types';
|
|
2
2
|
export default function flattenCodeTree(tree: RefractorNode[], offset?: number, className?: string[]): RefractorNode[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { AstGenerator, RefractorNode } from '../../types';
|
|
1
|
+
import { type AstGenerator, type RefractorNode } from '../../types';
|
|
2
2
|
export default function getCodeTree(language: string, code: string, astGenerator?: AstGenerator): RefractorNode[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { RefractorNode } from '../../types';
|
|
1
|
+
import { type RefractorNode } from '../../types';
|
|
2
2
|
export default function getInlineLineNumber(lineNumber: number): RefractorNode;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { CodeBidiWarningConfig, RefractorNode } from '../../types';
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type CodeBidiWarningConfig, type RefractorNode } from '../../types';
|
|
3
3
|
export default function createChildren(codeBidiWarningConfig: CodeBidiWarningConfig): (children: RefractorNode[]) => ReactNode[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { CodeBidiWarningConfig, RefractorNode } from '../../types';
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type CodeBidiWarningConfig, type RefractorNode } from '../../types';
|
|
3
3
|
export default function createElement({ node, codeBidiWarningConfig, key, }: {
|
|
4
4
|
node: RefractorNode;
|
|
5
5
|
codeBidiWarningConfig: CodeBidiWarningConfig;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { SerializedStyles } from '@emotion/react';
|
|
3
|
-
import { AST, RefractorNode } from 'refractor';
|
|
2
|
+
import { type SerializedStyles } from '@emotion/react';
|
|
3
|
+
import { type AST, type RefractorNode } from 'refractor';
|
|
4
4
|
export type { AST, RefractorNode } from 'refractor';
|
|
5
5
|
export declare class SyntaxHighlighter extends React.PureComponent<SyntaxHighlighterProps> {
|
|
6
6
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { HTMLProps, ReactNode } from 'react';
|
|
2
|
-
export type { SupportedLanguages, Language, LanguageAlias, CodeBlockProps
|
|
2
|
+
export type { SupportedLanguages, Language, LanguageAlias, CodeBlockProps } from './internal/types';
|
|
3
3
|
export interface CodeProps extends HTMLProps<HTMLElement> {
|
|
4
4
|
/**
|
|
5
5
|
* A unique string that appears as a data attribute `data-testid`
|