@apify/ui-library 0.65.3 → 0.66.1-featuresyntaxhighlighter-48cb44.19
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 +11 -0
- package/dist/src/components/action_link.d.ts +3 -1
- package/dist/src/components/action_link.d.ts.map +1 -1
- package/dist/src/components/action_link.js +2 -2
- package/dist/src/components/action_link.js.map +1 -1
- package/dist/src/components/code/code_block/code_block.d.ts.map +1 -1
- package/dist/src/components/code/code_block/code_block.js +14 -20
- package/dist/src/components/code/code_block/code_block.js.map +1 -1
- package/dist/src/components/code/code_block/code_block.styled.d.ts +8 -2
- package/dist/src/components/code/code_block/code_block.styled.d.ts.map +1 -1
- package/dist/src/components/code/code_block/code_block.styled.js +14 -68
- package/dist/src/components/code/code_block/code_block.styled.js.map +1 -1
- package/dist/src/components/code/code_block/utils.d.ts +5 -1
- package/dist/src/components/code/code_block/utils.d.ts.map +1 -1
- package/dist/src/components/code/code_block/utils.js +23 -12
- package/dist/src/components/code/code_block/utils.js.map +1 -1
- package/dist/src/components/code/index.d.ts +1 -0
- package/dist/src/components/code/index.d.ts.map +1 -1
- package/dist/src/components/code/index.js +1 -0
- package/dist/src/components/code/index.js.map +1 -1
- package/dist/src/components/code/one_line_code/one_line_code.d.ts.map +1 -1
- package/dist/src/components/code/one_line_code/one_line_code.js +15 -22
- package/dist/src/components/code/one_line_code/one_line_code.js.map +1 -1
- package/dist/src/components/code/prism_highlighter.d.ts +20 -0
- package/dist/src/components/code/prism_highlighter.d.ts.map +1 -0
- package/dist/src/components/code/prism_highlighter.js +117 -0
- package/dist/src/components/code/prism_highlighter.js.map +1 -0
- package/dist/src/components/image.d.ts +4 -5
- package/dist/src/components/image.d.ts.map +1 -1
- package/dist/src/components/image.js.map +1 -1
- package/dist/src/ui_dependency_provider.d.ts +8 -7
- package/dist/src/ui_dependency_provider.d.ts.map +1 -1
- package/dist/src/ui_dependency_provider.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/src/components/action_link.tsx +5 -4
- package/src/components/code/code_block/code_block.styled.tsx +21 -69
- package/src/components/code/code_block/code_block.tsx +25 -36
- package/src/components/code/code_block/utils.tsx +53 -0
- package/src/components/code/index.ts +1 -0
- package/src/components/code/one_line_code/one_line_code.tsx +24 -27
- package/src/components/code/prism_highlighter.tsx +180 -0
- package/src/components/image.tsx +2 -1
- package/src/ui_dependency_provider.tsx +9 -1
- package/dist/src/components/code/syntax_highlighter.d.ts +0 -15
- package/dist/src/components/code/syntax_highlighter.d.ts.map +0 -1
- package/dist/src/components/code/syntax_highlighter.js +0 -103
- package/dist/src/components/code/syntax_highlighter.js.map +0 -1
- package/src/components/code/code_block/utils.ts +0 -19
- package/src/components/code/syntax_highlighter.tsx +0 -134
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import _ from 'lodash';
|
|
4
|
+
import { Highlight, Prism, themes } from 'prism-react-renderer';
|
|
5
|
+
import { forwardRef, useRef } from 'react';
|
|
6
|
+
import styled, { css } from 'styled-components';
|
|
7
|
+
import { theme } from '../../design_system/theme.js';
|
|
8
|
+
import { useSharedUiDependencies } from '../../ui_dependency_provider.js';
|
|
9
|
+
import { Text } from '../text/index.js';
|
|
10
|
+
(typeof global !== 'undefined' ? global : window).Prism = Prism;
|
|
11
|
+
const HIGHLIGHT_BACKGROUND_COLOR = 'rgba(22, 114, 235, 0.05)';
|
|
12
|
+
const loadLanguages = async () => {
|
|
13
|
+
await Promise.all([
|
|
14
|
+
// @ts-expect-error The library is badly typed and does not export the type
|
|
15
|
+
import('prismjs/components/prism-bash.js'),
|
|
16
|
+
// @ts-expect-error The library is badly typed and does not export the type
|
|
17
|
+
import('prismjs/components/prism-rust.js'),
|
|
18
|
+
// @ts-expect-error The library is badly typed and does not export the type
|
|
19
|
+
import('prismjs/components/prism-bash.js'),
|
|
20
|
+
// @ts-expect-error The library is badly typed and does not export the type
|
|
21
|
+
import('prismjs/components/prism-docker.js'),
|
|
22
|
+
// @ts-expect-error The library is badly typed and does not export the type
|
|
23
|
+
import('prismjs/components/prism-http.js'),
|
|
24
|
+
// @ts-expect-error The library is badly typed and does not export the type
|
|
25
|
+
import('prismjs/components/prism-javascript.js'),
|
|
26
|
+
// @ts-expect-error The library is badly typed and does not export the type
|
|
27
|
+
import('prismjs/components/prism-json.js'),
|
|
28
|
+
// @ts-expect-error The library is badly typed and does not export the type
|
|
29
|
+
import('prismjs/components/prism-markup.js'),
|
|
30
|
+
// @ts-expect-error The library is badly typed and does not export the type
|
|
31
|
+
import('prismjs/components/prism-python.js'),
|
|
32
|
+
// @ts-expect-error The library is badly typed and does not export the type
|
|
33
|
+
import('prismjs/components/prism-typescript.js'),
|
|
34
|
+
// @ts-expect-error The library is badly typed and does not export the type
|
|
35
|
+
import('prismjs/components/prism-xml-doc.js'),
|
|
36
|
+
// @ts-expect-error The library is badly typed and does not export the type
|
|
37
|
+
import('prismjs/components/prism-yaml.js'),
|
|
38
|
+
]);
|
|
39
|
+
};
|
|
40
|
+
void loadLanguages();
|
|
41
|
+
const StyledPre = styled.pre `
|
|
42
|
+
width: 100%;
|
|
43
|
+
position: relative;
|
|
44
|
+
overflow: auto;
|
|
45
|
+
z-index: 2;
|
|
46
|
+
padding: ${({ $isSingleLine }) => ($isSingleLine ? 0 : `${theme.space.space16} 0`)};
|
|
47
|
+
margin: 0;
|
|
48
|
+
|
|
49
|
+
code {
|
|
50
|
+
min-width: 100%;
|
|
51
|
+
display: inline-block;
|
|
52
|
+
vertical-align: middle;
|
|
53
|
+
|
|
54
|
+
*,
|
|
55
|
+
*::before,
|
|
56
|
+
*::after {
|
|
57
|
+
text-shadow: none !important;
|
|
58
|
+
font-style: normal !important;
|
|
59
|
+
font-family: inherit !important;
|
|
60
|
+
font-size: inherit !important;
|
|
61
|
+
font-weight: inherit !important;
|
|
62
|
+
line-height: inherit !important;
|
|
63
|
+
background-color: transparent !important;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
& > div {
|
|
67
|
+
display: block;
|
|
68
|
+
|
|
69
|
+
&.highlighted {
|
|
70
|
+
background-color: ${HIGHLIGHT_BACKGROUND_COLOR} !important;
|
|
71
|
+
border-left: 6px solid ${theme.color.neutral.border} !important;
|
|
72
|
+
padding-left: ${({ $hasLinePrefixes }) => ($hasLinePrefixes ? '0.2' : '1')}rem;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
${({ $isSingleLine }) => !$isSingleLine && css `
|
|
76
|
+
&:hover {
|
|
77
|
+
background-color: ${HIGHLIGHT_BACKGROUND_COLOR} !important;
|
|
78
|
+
border-left: 6px solid ${theme.color.neutral.border} !important;
|
|
79
|
+
padding-left: ${({ $hasLinePrefixes }) => ($hasLinePrefixes ? '0.2' : '1')}rem;
|
|
80
|
+
}
|
|
81
|
+
`}
|
|
82
|
+
|
|
83
|
+
${({ $isSingleLine }) => ($isSingleLine ? css `
|
|
84
|
+
white-space: nowrap;
|
|
85
|
+
vertical-align: text-top;
|
|
86
|
+
` : css `
|
|
87
|
+
padding-left: ${({ $hasLinePrefixes }) => ($hasLinePrefixes ? theme.space.space8 : theme.space.space16)};
|
|
88
|
+
padding-right: ${theme.space.space16};
|
|
89
|
+
|
|
90
|
+
&:hover {
|
|
91
|
+
background-color: ${HIGHLIGHT_BACKGROUND_COLOR} !important;
|
|
92
|
+
border-left: 6px solid ${theme.color.neutral.border} !important;
|
|
93
|
+
padding-left: ${({ $hasLinePrefixes }) => ($hasLinePrefixes ? '0.2' : '1')}rem;
|
|
94
|
+
}
|
|
95
|
+
`)}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
`;
|
|
99
|
+
export const CodeHighlighterLinePrefix = styled(Text).attrs({ as: 'span' }) `
|
|
100
|
+
display: inline-block;
|
|
101
|
+
margin-right: ${theme.space.space16};
|
|
102
|
+
text-align: right;
|
|
103
|
+
min-width: ${theme.space.space24};
|
|
104
|
+
color: ${({ color }) => color || theme.color.neutral.textSubtle};
|
|
105
|
+
user-select: none;
|
|
106
|
+
-webkit-user-select: none;
|
|
107
|
+
`;
|
|
108
|
+
export const CodeHighlighterLineBashPrefix = styled(CodeHighlighterLinePrefix) `
|
|
109
|
+
min-width: ${({ $isOneLine }) => ($isOneLine ? 'unset' : theme.space.space16)} !important;
|
|
110
|
+
`;
|
|
111
|
+
export const PrismSyntaxHighlighter = forwardRef(({ size = 'regular', linePrefixes = {}, highlightLines = [], language = 'javascript', className, isSingleLine, ...rest }, ref) => {
|
|
112
|
+
const { uiTheme } = useSharedUiDependencies();
|
|
113
|
+
const hasLinePrefixes = !_.isEmpty(linePrefixes);
|
|
114
|
+
const highlightedLinesObject = useRef(Object.fromEntries(highlightLines.map((e) => [e, true])));
|
|
115
|
+
return (_jsx(Highlight, { theme: uiTheme === 'DARK' ? themes.nightOwl : themes.oneLight, language: language, ...rest, children: ({ className: prismClassName, tokens, getLineProps, getTokenProps }) => (_jsx(StyledPre, { className: clsx(className, prismClassName), "$hasLinePrefixes": hasLinePrefixes, "$isSingleLine": isSingleLine, ref: ref, children: _jsx(Text, { size: size, type: 'code', as: 'code', children: tokens.map((line, i) => (_jsxs("div", { ...getLineProps({ line, className: highlightedLinesObject.current[i + 1] ? 'highlighted' : '' }), children: [hasLinePrefixes && (linePrefixes[i + 1] || _jsx(CodeHighlighterLinePrefix, {})), line.map((token, key) => (_jsx("span", { ...getTokenProps({ token }) }, key)))] }, i))) }) })) }));
|
|
116
|
+
});
|
|
117
|
+
//# sourceMappingURL=prism_highlighter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prism_highlighter.js","sourceRoot":"","sources":["../../../../src/components/code/prism_highlighter.tsx"],"names":[],"mappings":";AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,CAAC,MAAM,QAAQ,CAAC;AAEvB,OAAO,EAAE,S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AQ,EAC7D,QAAQ,EAAE,QAAQ,KACd,IAAI,YAEP,CAAC,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,EAAE,YAAY,EAAE,aAAa,EAAE,EAAE,EAAE,CAAC,CACrE,KAAC,SAAS,IACN,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,cAAc,CAAC,sBACxB,eAAe,mBAClB,YAAY,EAC3B,GAAG,EAAE,GAAG,YAER,KAAC,IAAI,IACD,IAAI,EAAE,IAAI,EACV,IAAI,EAAC,MAAM,EACX,EAAE,EAAC,MAAM,YAER,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CACrB,kBAAiB,YAAY,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,sBAAsB,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,aACzG,eAAe,IAAI,CAAC,YAAY,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,KAAC,yBAAyB,KAAG,CAAC,EACzE,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,CAAC,CACtB,kBAAoB,aAAa,CAAC,EAAE,KAAK,EAAE,CAAC,IAAjC,GAAG,CAAkC,CACnD,CAAC,KAJI,CAAC,CAKL,CACT,CAAC,GACC,GACC,CACf,GACO,CACf,CAAC;AACN,CAAC,CAAC,CAAC"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
+
import type { ImageProxyOptions } from '../ui_dependency_provider.js';
|
|
1
2
|
import { type BoxProps } from './box.js';
|
|
2
|
-
|
|
3
|
+
export declare const Image: import("react").ForwardRefExoticComponent<{
|
|
3
4
|
src: string;
|
|
4
5
|
alt?: string;
|
|
5
6
|
width?: number;
|
|
6
7
|
height?: number;
|
|
7
|
-
loading?:
|
|
8
|
-
}
|
|
9
|
-
export declare const Image: import("react").ForwardRefExoticComponent<ImageProps & Omit<BoxProps, "as"> & import("react").RefAttributes<HTMLImageElement>>;
|
|
10
|
-
export {};
|
|
8
|
+
loading?: "eager" | "lazy" | undefined;
|
|
9
|
+
} & ImageProxyOptions & Omit<BoxProps, "as"> & import("react").RefAttributes<HTMLImageElement>>;
|
|
11
10
|
//# sourceMappingURL=image.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../../src/components/image.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../../src/components/image.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEtE,OAAO,EAAO,KAAK,QAAQ,EAAE,MAAM,UAAU,CAAC;AAU9C,eAAO,MAAM,KAAK;SAPT,MAAM;UACL,MAAM;YACJ,MAAM;aACL,MAAM;cACL,OAAO,GAAG,MAAM,GAAG,SAAS;+FAYxC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image.js","sourceRoot":"","sources":["../../../src/components/image.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"image.js","sourceRoot":"","sources":["../../../src/components/image.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAGnC,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,GAAG,EAAiB,MAAM,UAAU,CAAC;AAU9C,MAAM,CAAC,MAAM,KAAK,GAAG,UAAU,CAAsD,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IAChG,MAAM,EAAE,aAAa,EAAE,GAAG,uBAAuB,EAAE,CAAC;IACpD,OAAO,CACH,KAAC,GAAG,IACA,GAAG,EAAE,GAAG,KACJ,KAAK,EACT,EAAE,EAAE,aAAa,GACnB,CACL,CAAC;AACN,CAAC,CAAC,CAAC"}
|
|
@@ -4,6 +4,13 @@ export interface AgnosticInternalLinkProps extends Omit<React.AnchorHTMLAttribut
|
|
|
4
4
|
replace?: boolean;
|
|
5
5
|
href: string;
|
|
6
6
|
}
|
|
7
|
+
export type ImageProxyOptions = {
|
|
8
|
+
extension?: string;
|
|
9
|
+
resize?: {
|
|
10
|
+
width?: number;
|
|
11
|
+
height?: number;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
7
14
|
export interface UiDependencies {
|
|
8
15
|
InternalLink: React.ForwardRefExoticComponent<AgnosticInternalLinkProps & React.RefAttributes<HTMLAnchorElement>>;
|
|
9
16
|
InternalImage: React.ForwardRefExoticComponent<React.RefAttributes<HTMLImageElement>>;
|
|
@@ -11,13 +18,7 @@ export interface UiDependencies {
|
|
|
11
18
|
windowLocationHost: string;
|
|
12
19
|
isHrefTrusted: (href: string) => boolean;
|
|
13
20
|
uiTheme?: UiThemeOption;
|
|
14
|
-
generateProxyImageUrl?: (url: string, options:
|
|
15
|
-
extension?: string;
|
|
16
|
-
resize?: {
|
|
17
|
-
width?: number;
|
|
18
|
-
height?: number;
|
|
19
|
-
};
|
|
20
|
-
}) => string;
|
|
21
|
+
generateProxyImageUrl?: (url: string, options: ImageProxyOptions) => string;
|
|
21
22
|
}
|
|
22
23
|
interface UiDependencyProviderProps {
|
|
23
24
|
children: React.ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui_dependency_provider.d.ts","sourceRoot":"","sources":["../../src/ui_dependency_provider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAC;AAEzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D,MAAM,WAAW,yBAA0B,SAAQ,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAI1G,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB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,CAAC,CAAC;IAClH,aAAa,EAAE,KAAK,CAAC,yBAAyB,CAAC,KAAK,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC,CAAC;IAGtF,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAEjD,kBAAkB,EAAE,MAAM,CAAC;IAE3B,aAAa,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;IACzC,OAAO,CAAC,EAAE,aAAa,CAAC;IAExB,qBAAqB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,iBAAiB,KAAK,MAAM,CAAA;CAC9E;AAED,UAAU,yBAAyB;IAC/B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,YAAY,EAAE,cAAc,CAAA;CAC/B;AAID,eAAO,MAAM,uBAAuB,sBAInC,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CASpE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui_dependency_provider.js","sourceRoot":"","sources":["../../src/ui_dependency_provider.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ui_dependency_provider.js","sourceRoot":"","sources":["../../src/ui_dependency_provider.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAwCzD,MAAM,yBAAyB,GAAG,aAAa,CAAwB,IAAI,CAAC,CAAC;AAE7E,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,EAAE;IACxC,MAAM,cAAc,GAAG,UAAU,CAAC,yBAAyB,CAAC,CAAC;IAC7D,IAAI,CAAC,cAAc;QAAE,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;IAC5F,OAAO,cAAc,CAAC;AAC1B,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAwC,CAAC,EACtE,QAAQ,EACR,YAAY,GACf,EAAE,EAAE;IACD,OAAO,CACH,KAAC,yBAAyB,CAAC,QAAQ,IAAC,KAAK,EAAE,YAAY,YAClD,QAAQ,GACwB,CACxC,CAAC;AACN,CAAC,CAAC"}
|