@atlaskit/code 14.4.1 → 14.4.2
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 +6 -0
- package/codemods/13.0.0-remove-unnecessary-code-props.tsx +9 -11
- package/codemods/utils/helpers.tsx +17 -22
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/version.json +1 -1
- package/package.json +3 -11
- package/report.api.md +407 -474
- package/dist/types-ts4.0/bidi-warning/bidi-warning-decorator.d.ts +0 -5
- package/dist/types-ts4.0/bidi-warning/index.d.ts +0 -1
- package/dist/types-ts4.0/bidi-warning/ui/index.d.ts +0 -3
- package/dist/types-ts4.0/bidi-warning/ui/styled.d.ts +0 -8
- package/dist/types-ts4.0/bidi-warning/ui/types.d.ts +0 -33
- package/dist/types-ts4.0/code-block.d.ts +0 -13
- package/dist/types-ts4.0/code.d.ts +0 -16
- package/dist/types-ts4.0/constants.d.ts +0 -625
- package/dist/types-ts4.0/entry-points/block.d.ts +0 -2
- package/dist/types-ts4.0/entry-points/constants.d.ts +0 -1
- package/dist/types-ts4.0/entry-points/inline.d.ts +0 -2
- package/dist/types-ts4.0/entry-points/types.d.ts +0 -1
- package/dist/types-ts4.0/extract-react-types/code-block.d.ts +0 -37
- package/dist/types-ts4.0/extract-react-types/code.d.ts +0 -2
- package/dist/types-ts4.0/index.d.ts +0 -4
- package/dist/types-ts4.0/internal/hooks/use-highlight.d.ts +0 -6
- package/dist/types-ts4.0/internal/theme/constants.d.ts +0 -8
- package/dist/types-ts4.0/internal/theme/get-theme.d.ts +0 -7
- package/dist/types-ts4.0/internal/theme/styles.d.ts +0 -27
- package/dist/types-ts4.0/internal/theme/types.d.ts +0 -57
- package/dist/types-ts4.0/internal/types.d.ts +0 -57
- package/dist/types-ts4.0/internal/utils/get-normalized-language.d.ts +0 -2
- package/dist/types-ts4.0/react-syntax-highlighter-bidi-warning-renderer.d.ts +0 -9
- package/dist/types-ts4.0/types.d.ts +0 -32
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { CSSObject } from '@emotion/react';
|
|
2
|
-
import type { Theme } from '@atlaskit/theme/types';
|
|
3
|
-
import type { CodeBlockTheme, CodeTheme } from './types';
|
|
4
|
-
export declare const getLineNumWidth: (numLines: number) => string;
|
|
5
|
-
/**
|
|
6
|
-
* Styles applied at the root element level, common across code/codeblock
|
|
7
|
-
*/
|
|
8
|
-
export declare const getBaseCodeStyles: (theme: CodeTheme) => {
|
|
9
|
-
fontSize: number;
|
|
10
|
-
fontFamily: string | undefined;
|
|
11
|
-
fontWeight: string;
|
|
12
|
-
backgroundColor: string;
|
|
13
|
-
color: string | undefined;
|
|
14
|
-
borderStyle: string;
|
|
15
|
-
borderRadius: string;
|
|
16
|
-
};
|
|
17
|
-
/**
|
|
18
|
-
* Takes an implemented CodeBlock theme, and returns styles required for
|
|
19
|
-
* react-syntax-highlighter.
|
|
20
|
-
*
|
|
21
|
-
* @param theme
|
|
22
|
-
*/
|
|
23
|
-
export declare const getCodeBlockStyles: (theme: CodeBlockTheme) => (highlightedStartText: string, highlightedEndText: string, hasLineNumbers?: boolean | undefined) => CSSObject;
|
|
24
|
-
export declare const getCodeStyles: (globalTheme: Theme | {
|
|
25
|
-
theme: Theme;
|
|
26
|
-
}) => CSSObject;
|
|
27
|
-
export declare const getCodeBlockTheme: (globalTheme: Theme, maxLines?: number | undefined) => CodeBlockTheme;
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
export interface CodeTheme {
|
|
2
|
-
backgroundColor?: string;
|
|
3
|
-
textColor?: string;
|
|
4
|
-
fontFamilyItalic?: string;
|
|
5
|
-
fontFamily?: string;
|
|
6
|
-
lineNumberColor?: string;
|
|
7
|
-
lineNumberBgColor?: string;
|
|
8
|
-
}
|
|
9
|
-
export interface CodeBlockTheme extends CodeTheme {
|
|
10
|
-
substringColor?: string;
|
|
11
|
-
keywordColor?: string;
|
|
12
|
-
attributeColor?: string;
|
|
13
|
-
selectorTagColor?: string;
|
|
14
|
-
docTagColor?: string;
|
|
15
|
-
nameColor?: string;
|
|
16
|
-
builtInColor?: string;
|
|
17
|
-
literalColor?: string;
|
|
18
|
-
bulletColor?: string;
|
|
19
|
-
codeColor?: string;
|
|
20
|
-
additionColor?: string;
|
|
21
|
-
regexpColor?: string;
|
|
22
|
-
symbolColor?: string;
|
|
23
|
-
variableColor?: string;
|
|
24
|
-
templateVariableColor?: string;
|
|
25
|
-
linkColor?: string;
|
|
26
|
-
selectorAttributeColor?: string;
|
|
27
|
-
selectorPseudoColor?: string;
|
|
28
|
-
typeColor?: string;
|
|
29
|
-
stringColor?: string;
|
|
30
|
-
selectorIdColor?: string;
|
|
31
|
-
selectorClassColor?: string;
|
|
32
|
-
quoteColor?: string;
|
|
33
|
-
templateTagColor?: string;
|
|
34
|
-
deletionColor?: string;
|
|
35
|
-
titleColor?: string;
|
|
36
|
-
sectionColor?: string;
|
|
37
|
-
commentColor?: string;
|
|
38
|
-
metaKeywordColor?: string;
|
|
39
|
-
metaColor?: string;
|
|
40
|
-
functionColor?: string;
|
|
41
|
-
numberColor?: string;
|
|
42
|
-
prologColor?: string;
|
|
43
|
-
cdataColor?: string;
|
|
44
|
-
punctuationColor?: string;
|
|
45
|
-
propertyColor?: string;
|
|
46
|
-
constantColor?: string;
|
|
47
|
-
deletedColor?: string;
|
|
48
|
-
booleanColor?: string;
|
|
49
|
-
charColor?: string;
|
|
50
|
-
insertedColor?: string;
|
|
51
|
-
operatorColor?: string;
|
|
52
|
-
atruleColor?: string;
|
|
53
|
-
importantColor?: string;
|
|
54
|
-
highlightedLineBgColor?: string;
|
|
55
|
-
highlightedLineBorderColor?: string;
|
|
56
|
-
lineNumberWidth?: string | number;
|
|
57
|
-
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import type { SupportedLanguages } from '../constants';
|
|
2
|
-
export interface CodeBlockProps {
|
|
3
|
-
/**
|
|
4
|
-
* The code to be formatted
|
|
5
|
-
*/
|
|
6
|
-
text: string;
|
|
7
|
-
/**
|
|
8
|
-
* A unique string that appears as a data attribute `data-testid`
|
|
9
|
-
* in the rendered code. Serves as a hook for automated tests.
|
|
10
|
-
*/
|
|
11
|
-
testId?: string;
|
|
12
|
-
/**
|
|
13
|
-
* Whether to showLineNumbers or not, defaults to true
|
|
14
|
-
*/
|
|
15
|
-
showLineNumbers?: boolean;
|
|
16
|
-
/**
|
|
17
|
-
* The language in which the code is written
|
|
18
|
-
*/
|
|
19
|
-
language?: SupportedLanguages;
|
|
20
|
-
/**
|
|
21
|
-
* Lines to highlight comma delimited.
|
|
22
|
-
* Example uses:
|
|
23
|
-
* - To highlight one line `highlight="3"`
|
|
24
|
-
* - To highlight a group of lines `highlight="1-5"`
|
|
25
|
-
* - To highlight multiple groups `highlight="1-5,7,10,15-20"`
|
|
26
|
-
*/
|
|
27
|
-
highlight?: string;
|
|
28
|
-
/**
|
|
29
|
-
* Screen reader text for the start of a highlighted line
|
|
30
|
-
*/
|
|
31
|
-
highlightedStartText?: string;
|
|
32
|
-
/**
|
|
33
|
-
* Screen reader text for the end of a highlighted line
|
|
34
|
-
*/
|
|
35
|
-
highlightedEndText?: string;
|
|
36
|
-
/**
|
|
37
|
-
* When false, disables decorating code with bidi warnings
|
|
38
|
-
*
|
|
39
|
-
* defaults to true
|
|
40
|
-
*/
|
|
41
|
-
codeBidiWarnings?: boolean;
|
|
42
|
-
/**
|
|
43
|
-
* Labels for the previous and next buttons used in pagination.
|
|
44
|
-
* Defaults to `Bidirectional characters change the order that text is rendered. This could be used to obscure malicious code.`.
|
|
45
|
-
*/
|
|
46
|
-
codeBidiWarningLabel?: string;
|
|
47
|
-
/**
|
|
48
|
-
* Defaults to enabled (true)
|
|
49
|
-
*
|
|
50
|
-
* Intended to be disabled when used in a mobile view, such as in the editor
|
|
51
|
-
* via mobile bridge, where the tooltip could end up being cut off of otherwise
|
|
52
|
-
* not work as expected.
|
|
53
|
-
*/
|
|
54
|
-
codeBidiWarningTooltipEnabled?: boolean;
|
|
55
|
-
}
|
|
56
|
-
export type { SupportedLanguages, LanguageAlias, Language } from '../constants';
|
|
57
|
-
export type { CodeBlockTheme, CodeTheme } from './theme/types';
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
declare type CodeBidiWarningConfig = {
|
|
2
|
-
codeBidiWarningLabel?: string;
|
|
3
|
-
codeBidiWarningTooltipEnabled: boolean;
|
|
4
|
-
};
|
|
5
|
-
export declare function createBidiWarningRenderer(codeBidiWarningConfig: CodeBidiWarningConfig): ({ rows, stylesheet, useInlineStyles, }: any) => any;
|
|
6
|
-
export declare function createStyleObject(classNames: any, elementStyle: {} | undefined, stylesheet: any): any;
|
|
7
|
-
export declare function createClassNameString(classNames: any): any;
|
|
8
|
-
export declare function createChildren(stylesheet: any, useInlineStyles: any, codeBidiWarningConfig: any): (children: any) => any;
|
|
9
|
-
export {};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { HTMLProps, ReactNode } from 'react';
|
|
2
|
-
export type { SupportedLanguages, Language, LanguageAlias, CodeBlockProps, } from './internal/types';
|
|
3
|
-
export interface CodeProps extends HTMLProps<HTMLElement> {
|
|
4
|
-
/**
|
|
5
|
-
* A unique string that appears as a data attribute `data-testid`
|
|
6
|
-
* in the rendered code. Serves as a hook for automated tests.
|
|
7
|
-
*/
|
|
8
|
-
testId?: string;
|
|
9
|
-
/**
|
|
10
|
-
* Content to be rendered in the inline code block
|
|
11
|
-
*/
|
|
12
|
-
children?: ReactNode;
|
|
13
|
-
/**
|
|
14
|
-
* When false, disables decorating code with bidi warnings
|
|
15
|
-
*
|
|
16
|
-
* defaults to true
|
|
17
|
-
*/
|
|
18
|
-
codeBidiWarnings?: boolean;
|
|
19
|
-
/**
|
|
20
|
-
* Labels for the previous and next buttons used in pagination.
|
|
21
|
-
* Defaults to `Bidirectional characters change the order that text is rendered. This could be used to obscure malicious code.`.
|
|
22
|
-
*/
|
|
23
|
-
codeBidiWarningLabel?: string;
|
|
24
|
-
/**
|
|
25
|
-
* Defaults to enabled (true)
|
|
26
|
-
*
|
|
27
|
-
* Intended to be disabled when used in a mobile view, such as in the editor
|
|
28
|
-
* via mobile bridge, where the tooltip could end up being cut off of otherwise
|
|
29
|
-
* not work as expected.
|
|
30
|
-
*/
|
|
31
|
-
codeBidiWarningTooltipEnabled?: boolean;
|
|
32
|
-
}
|