@atlaskit/code 14.1.1 → 14.1.5
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 +24 -0
- package/dist/cjs/entry-points/types.js +5 -1
- package/dist/cjs/internal/hooks/use-highlight.js +1 -2
- package/dist/cjs/internal/theme/styles.js +3 -1
- package/dist/cjs/internal/theme/types.js +5 -1
- package/dist/cjs/internal/types.js +5 -1
- package/dist/cjs/types.js +5 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/entry-points/types.js +1 -0
- package/dist/es2019/internal/theme/styles.js +3 -1
- package/dist/es2019/internal/theme/types.js +1 -0
- package/dist/es2019/internal/types.js +1 -0
- package/dist/es2019/types.js +1 -0
- package/dist/es2019/version.json +1 -1
- package/dist/esm/entry-points/types.js +1 -0
- package/dist/esm/internal/hooks/use-highlight.js +1 -2
- package/dist/esm/internal/theme/styles.js +3 -1
- package/dist/esm/internal/theme/types.js +1 -0
- package/dist/esm/internal/types.js +1 -0
- package/dist/esm/types.js +1 -0
- package/dist/esm/version.json +1 -1
- package/dist/types/internal/theme/get-theme.d.ts +1 -1
- package/dist/types/internal/theme/styles.d.ts +3 -1
- package/dist/types/internal/utils/get-normalized-language.d.ts +1 -1
- package/package.json +7 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @atlaskit/code
|
|
2
2
|
|
|
3
|
+
## 14.1.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`b85e7ce12cd`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b85e7ce12cd) - Internal upgrade of memoize-one to 6.0.0
|
|
8
|
+
|
|
9
|
+
## 14.1.4
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
15
|
+
## 14.1.3
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- [`378d1cef00f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/378d1cef00f) - Bump `@atlaskit/theme` to version `^11.3.0`.
|
|
20
|
+
|
|
21
|
+
## 14.1.2
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- [`d827fec15b2`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d827fec15b2) - Fixes a regression in ^14.0.0 that meant the function `getCodeStyles` didn't work correctly with interpolations using the `styled-components` theming.
|
|
26
|
+
|
|
3
27
|
## 14.1.1
|
|
4
28
|
|
|
5
29
|
### Patch Changes
|
|
@@ -40,8 +40,7 @@ var useHighlightLines = function useHighlightLines(_ref) {
|
|
|
40
40
|
if (num.indexOf('-') > 0) {
|
|
41
41
|
// We found a line group, e.g. 1-3
|
|
42
42
|
var _num$split$map$sort = num.split('-').map(Number) // Sort by lowest value first, highest value last.
|
|
43
|
-
.
|
|
44
|
-
sort(function (a, b) {
|
|
43
|
+
.sort(function (a, b) {
|
|
45
44
|
return a - b;
|
|
46
45
|
}),
|
|
47
46
|
_num$split$map$sort2 = (0, _slicedToArray2.default)(_num$split$map$sort, 2),
|
|
@@ -304,7 +304,9 @@ var getCodeBlockStyles = function getCodeBlockStyles(theme) {
|
|
|
304
304
|
exports.getCodeBlockStyles = getCodeBlockStyles;
|
|
305
305
|
|
|
306
306
|
var getCodeStyles = function getCodeStyles(globalTheme) {
|
|
307
|
-
|
|
307
|
+
// Required to have proper compatibility with styled components interpolations
|
|
308
|
+
var akTheme = 'theme' in globalTheme ? globalTheme.theme : globalTheme;
|
|
309
|
+
var theme = (0, _getTheme.getBaseTheme)(akTheme);
|
|
308
310
|
var baseStyles = getBaseCodeStyles(theme);
|
|
309
311
|
return _objectSpread(_objectSpread({}, baseStyles), {}, {
|
|
310
312
|
display: 'inline',
|
package/dist/cjs/types.js
CHANGED
package/dist/cjs/version.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -270,7 +270,9 @@ export const getCodeBlockStyles = theme => (highlightedStartText, highlightedEnd
|
|
|
270
270
|
}
|
|
271
271
|
});
|
|
272
272
|
export const getCodeStyles = globalTheme => {
|
|
273
|
-
|
|
273
|
+
// Required to have proper compatibility with styled components interpolations
|
|
274
|
+
const akTheme = 'theme' in globalTheme ? globalTheme.theme : globalTheme;
|
|
275
|
+
const theme = getBaseTheme(akTheme);
|
|
274
276
|
const baseStyles = getBaseCodeStyles(theme);
|
|
275
277
|
return { ...baseStyles,
|
|
276
278
|
display: 'inline',
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/es2019/types.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/es2019/version.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -29,8 +29,7 @@ export var useHighlightLines = function useHighlightLines(_ref) {
|
|
|
29
29
|
if (num.indexOf('-') > 0) {
|
|
30
30
|
// We found a line group, e.g. 1-3
|
|
31
31
|
var _num$split$map$sort = num.split('-').map(Number) // Sort by lowest value first, highest value last.
|
|
32
|
-
.
|
|
33
|
-
sort(function (a, b) {
|
|
32
|
+
.sort(function (a, b) {
|
|
34
33
|
return a - b;
|
|
35
34
|
}),
|
|
36
35
|
_num$split$map$sort2 = _slicedToArray(_num$split$map$sort, 2),
|
|
@@ -284,7 +284,9 @@ export var getCodeBlockStyles = function getCodeBlockStyles(theme) {
|
|
|
284
284
|
};
|
|
285
285
|
};
|
|
286
286
|
export var getCodeStyles = function getCodeStyles(globalTheme) {
|
|
287
|
-
|
|
287
|
+
// Required to have proper compatibility with styled components interpolations
|
|
288
|
+
var akTheme = 'theme' in globalTheme ? globalTheme.theme : globalTheme;
|
|
289
|
+
var theme = getBaseTheme(akTheme);
|
|
288
290
|
var baseStyles = getBaseCodeStyles(theme);
|
|
289
291
|
return _objectSpread(_objectSpread({}, baseStyles), {}, {
|
|
290
292
|
display: 'inline',
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/esm/types.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/esm/version.json
CHANGED
|
@@ -2,6 +2,6 @@ import type { Theme } from '@atlaskit/theme/types';
|
|
|
2
2
|
import type { CodeBlockTheme, CodeTheme } from './types';
|
|
3
3
|
export declare const getBaseTheme: (theme: Theme) => CodeTheme;
|
|
4
4
|
export declare const defaultBaseTheme: CodeTheme;
|
|
5
|
-
export declare const getColorPalette: (theme: Theme) => CodeBlockTheme
|
|
5
|
+
export declare const getColorPalette: import("memoize-one").MemoizedFn<(theme: Theme) => CodeBlockTheme>;
|
|
6
6
|
declare const getTheme: (theme: Theme) => CodeBlockTheme;
|
|
7
7
|
export default getTheme;
|
|
@@ -13,5 +13,7 @@ export declare const getBaseCodeStyles: (theme: CodeTheme) => CSSObject;
|
|
|
13
13
|
* @param theme
|
|
14
14
|
*/
|
|
15
15
|
export declare const getCodeBlockStyles: (theme: CodeBlockTheme) => (highlightedStartText: string, highlightedEndText: string, hasLineNumbers?: boolean | undefined) => CSSObject;
|
|
16
|
-
export declare const getCodeStyles: (globalTheme: Theme
|
|
16
|
+
export declare const getCodeStyles: (globalTheme: Theme | {
|
|
17
|
+
theme: Theme;
|
|
18
|
+
}) => CSSObject;
|
|
17
19
|
export declare const getCodeBlockTheme: (globalTheme: Theme, maxLines?: number | undefined) => CodeBlockTheme;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const normalizeLanguage: (language?: "PHP" | "php" | "php3" | "php4" | "php5" | "Java" | "java" | "CSharp" | "csharp" | "c#" | "Python" | "python" | "py" | "JavaScript" | "javascript" | "js" | "Html" | "html" | "xml" | "C++" | "c++" | "cpp" | "clike" | "Ruby" | "ruby" | "rb" | "duby" | "Objective-C" | "objective-c" | "objectivec" | "obj-c" | "objc" | "C" | "c" | "Swift" | "swift" | "TeX" | "tex" | "latex" | "Shell" | "shell" | "bash" | "sh" | "ksh" | "zsh" | "Scala" | "scala" | "Go" | "go" | "ActionScript" | "actionscript" | "actionscript3" | "as" | "ColdFusion" | "coldfusion" | "JavaFX" | "javafx" | "jfx" | "VbNet" | "vbnet" | "vb.net" | "vfp" | "clipper" | "xbase" | "JSON" | "json" | "MATLAB" | "matlab" | "Groovy" | "groovy" | "SQL" | "sql" | "postgresql" | "postgres" | "plpgsql" | "psql" | "postgresql-console" | "postgres-console" | "tsql" | "t-sql" | "mysql" | "sqlite" | "R" | "r" | "Perl" | "perl" | "pl" | "Lua" | "lua" | "Pascal" | "pas" | "pascal" | "objectpascal" | "delphi" | "XML" | "TypeScript" | "typescript" | "ts" | "CoffeeScript" | "coffeescript" | "coffee-script" | "coffee" | "Haskell" | "haskell" | "hs" | "Puppet" | "puppet" | "Arduino" | "arduino" | "Fortran" | "fortran" | "Erlang" | "erlang" | "erl" | "PowerShell" | "powershell" | "posh" | "ps1" | "psm1" | "Haxe" | "haxe" | "hx" | "hxsl" | "Elixir" | "elixir" | "ex" | "exs" | "Verilog" | "verilog" | "v" | "Rust" | "rust" | "VHDL" | "vhdl" | "Sass" | "sass" | "OCaml" | "ocaml" | "Dart" | "dart" | "CSS" | "css" | "reStructuredText" | "restructuredtext" | "rst" | "rest" | "Kotlin" | "kotlin" | "D" | "d" | "Octave" | "octave" | "QML" | "qbs" | "qml" | "Prolog" | "prolog" | "FoxPro" | "foxpro" | "purebasic" | "Scheme" | "scheme" | "scm" | "CUDA" | "cuda" | "cu" | "Julia" | "julia" | "jl" | "Racket" | "racket" | "rkt" | "Ada" | "ada" | "ada95" | "ada2005" | "Tcl" | "tcl" | "Mathematica" | "mathematica" | "mma" | "nb" | "Autoit" | "autoit" | "StandardML" | "standardmL" | "sml" | "standardml" | "Objective-J" | "objective-j" | "objectivej" | "obj-j" | "objj" | "Smalltalk" | "smalltalk" | "squeak" | "st" | "Vala" | "vala" | "vapi" | "ABAP" | "abap" | "LiveScript" | "livescript" | "live-script" | "XQuery" | "xquery" | "xqy" | "xq" | "xql" | "xqm" | "PlainText" | "text" | "plaintext" | "Yaml" | "yaml" | "yml" | "GraphQL" | "graphql" | "AppleScript" | "applescript" | "Clojure" | "clojure" | "Diff" | "diff" | "VisualBasic" | "visualbasic" | "JSX" | "jsx" | "TSX" | "tsx" | "SplunkSPL" | "splunk-spl" | undefined) => string
|
|
1
|
+
export declare const normalizeLanguage: import("memoize-one").MemoizedFn<(language?: "PHP" | "php" | "php3" | "php4" | "php5" | "Java" | "java" | "CSharp" | "csharp" | "c#" | "Python" | "python" | "py" | "JavaScript" | "javascript" | "js" | "Html" | "html" | "xml" | "C++" | "c++" | "cpp" | "clike" | "Ruby" | "ruby" | "rb" | "duby" | "Objective-C" | "objective-c" | "objectivec" | "obj-c" | "objc" | "C" | "c" | "Swift" | "swift" | "TeX" | "tex" | "latex" | "Shell" | "shell" | "bash" | "sh" | "ksh" | "zsh" | "Scala" | "scala" | "Go" | "go" | "ActionScript" | "actionscript" | "actionscript3" | "as" | "ColdFusion" | "coldfusion" | "JavaFX" | "javafx" | "jfx" | "VbNet" | "vbnet" | "vb.net" | "vfp" | "clipper" | "xbase" | "JSON" | "json" | "MATLAB" | "matlab" | "Groovy" | "groovy" | "SQL" | "sql" | "postgresql" | "postgres" | "plpgsql" | "psql" | "postgresql-console" | "postgres-console" | "tsql" | "t-sql" | "mysql" | "sqlite" | "R" | "r" | "Perl" | "perl" | "pl" | "Lua" | "lua" | "Pascal" | "pas" | "pascal" | "objectpascal" | "delphi" | "XML" | "TypeScript" | "typescript" | "ts" | "CoffeeScript" | "coffeescript" | "coffee-script" | "coffee" | "Haskell" | "haskell" | "hs" | "Puppet" | "puppet" | "Arduino" | "arduino" | "Fortran" | "fortran" | "Erlang" | "erlang" | "erl" | "PowerShell" | "powershell" | "posh" | "ps1" | "psm1" | "Haxe" | "haxe" | "hx" | "hxsl" | "Elixir" | "elixir" | "ex" | "exs" | "Verilog" | "verilog" | "v" | "Rust" | "rust" | "VHDL" | "vhdl" | "Sass" | "sass" | "OCaml" | "ocaml" | "Dart" | "dart" | "CSS" | "css" | "reStructuredText" | "restructuredtext" | "rst" | "rest" | "Kotlin" | "kotlin" | "D" | "d" | "Octave" | "octave" | "QML" | "qbs" | "qml" | "Prolog" | "prolog" | "FoxPro" | "foxpro" | "purebasic" | "Scheme" | "scheme" | "scm" | "CUDA" | "cuda" | "cu" | "Julia" | "julia" | "jl" | "Racket" | "racket" | "rkt" | "Ada" | "ada" | "ada95" | "ada2005" | "Tcl" | "tcl" | "Mathematica" | "mathematica" | "mma" | "nb" | "Autoit" | "autoit" | "StandardML" | "standardmL" | "sml" | "standardml" | "Objective-J" | "objective-j" | "objectivej" | "obj-j" | "objj" | "Smalltalk" | "smalltalk" | "squeak" | "st" | "Vala" | "vala" | "vapi" | "ABAP" | "abap" | "LiveScript" | "livescript" | "live-script" | "XQuery" | "xquery" | "xqy" | "xq" | "xql" | "xqm" | "PlainText" | "text" | "plaintext" | "Yaml" | "yaml" | "yml" | "GraphQL" | "graphql" | "AppleScript" | "applescript" | "Clojure" | "clojure" | "Diff" | "diff" | "VisualBasic" | "visualbasic" | "JSX" | "jsx" | "TSX" | "tsx" | "SplunkSPL" | "splunk-spl" | undefined) => string>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/code",
|
|
3
|
-
"version": "14.1.
|
|
3
|
+
"version": "14.1.5",
|
|
4
4
|
"description": "Code highlights short strings of code snippets inline with body text.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -26,11 +26,11 @@
|
|
|
26
26
|
"access": "public"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@atlaskit/codemod-utils": "^3.
|
|
30
|
-
"@atlaskit/theme": "^
|
|
29
|
+
"@atlaskit/codemod-utils": "^3.4.0",
|
|
30
|
+
"@atlaskit/theme": "^12.0.0",
|
|
31
31
|
"@babel/runtime": "^7.0.0",
|
|
32
32
|
"@emotion/core": "^10.0.9",
|
|
33
|
-
"memoize-one": "^
|
|
33
|
+
"memoize-one": "^6.0.0",
|
|
34
34
|
"react-syntax-highlighter": "^15.4.3"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
@@ -38,8 +38,9 @@
|
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@atlaskit/build-utils": "*",
|
|
41
|
-
"@atlaskit/button": "^
|
|
41
|
+
"@atlaskit/button": "^16.0.0",
|
|
42
42
|
"@atlaskit/docs": "^9.0.0",
|
|
43
|
+
"@atlaskit/section-message": "^6.0.0",
|
|
43
44
|
"@atlaskit/ssr": "*",
|
|
44
45
|
"@atlaskit/visual-regression": "*",
|
|
45
46
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
@@ -47,7 +48,7 @@
|
|
|
47
48
|
"@types/jscodeshift": "^0.11.0",
|
|
48
49
|
"@types/react-syntax-highlighter": "^13.5.0",
|
|
49
50
|
"color-contrast-checker": "^1.5.0",
|
|
50
|
-
"jscodeshift": "^0.
|
|
51
|
+
"jscodeshift": "^0.13.0",
|
|
51
52
|
"prismjs": "^1.23.0",
|
|
52
53
|
"react-dom": "^16.8.0",
|
|
53
54
|
"typescript": "3.9.6"
|