@mittwald/flow-react-components 0.2.0-alpha.394 → 0.2.0-alpha.395
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/dist/assets/doc-properties.json +9960 -9656
- package/dist/js/components/src/components/CodeBlock/CodeBlock.mjs +1 -2
- package/dist/js/components/src/components/CodeBlock/CodeBlock.mjs.map +1 -1
- package/dist/types/components/CodeBlock/CodeBlock.d.ts +18 -3
- package/dist/types/components/CodeBlock/CodeBlock.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -2,12 +2,11 @@
|
|
|
2
2
|
/* */
|
|
3
3
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
4
|
import 'react';
|
|
5
|
-
import
|
|
5
|
+
import SyntaxHighlighter from 'react-syntax-highlighter';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
7
|
import { CopyButton } from '../CopyButton/CopyButton.mjs';
|
|
8
8
|
import styles from './CodeBlock.module.scss.mjs';
|
|
9
9
|
|
|
10
|
-
const SyntaxHighlighter = SyntaxHighlighterNative;
|
|
11
10
|
const CodeBlock = (props) => {
|
|
12
11
|
const { code, className, copyable, color = "default", ...rest } = props;
|
|
13
12
|
const rootClassName = clsx(styles.codeBlock, styles[color], className);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeBlock.mjs","sources":["../../../../../../src/components/CodeBlock/CodeBlock.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport React from \"react\";\nimport
|
|
1
|
+
{"version":3,"file":"CodeBlock.mjs","sources":["../../../../../../src/components/CodeBlock/CodeBlock.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport React from \"react\";\nimport SyntaxHighlighter from \"react-syntax-highlighter\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\nimport clsx from \"clsx\";\nimport { CopyButton } from \"@/components/CopyButton\";\nimport styles from \"./CodeBlock.module.scss\";\n\nexport interface CodeBlockProps extends PropsWithClassName {\n /** Adds a copy icon to the code block to copy its content. */\n copyable?: boolean;\n /** The color of the code block. @default \"default\" */\n color?: \"default\" | \"light\" | \"dark\";\n /** The code to display inside the code block. */\n code: string | string[];\n\n // ATTENTION\n // we reexport by copy the props here - react-typescript-docgen\n // will not correctly export the props from react-syntax-highlighter\n // when using OMIT duo some wired circumstances how react-syntax-highlighter\n // exports his types - the following types are excluded\n //\n // children: string | string[];\n //\n language?: string | undefined;\n style?: Record<string, React.CSSProperties> | undefined;\n customStyle?: React.CSSProperties | undefined;\n codeTagProps?: React.HTMLProps<HTMLElement> | undefined;\n useInlineStyles?: boolean | undefined;\n showLineNumbers?: boolean | undefined;\n showInlineLineNumbers?: boolean | undefined;\n startingLineNumber?: number | undefined;\n lineNumberContainerStyle?: React.CSSProperties | undefined;\n lineNumberStyle?: React.CSSProperties | lineNumberStyleFunction | undefined;\n wrapLines?: boolean | undefined;\n wrapLongLines?: boolean | undefined;\n lineProps?: lineTagPropsFunction | React.HTMLProps<HTMLElement> | undefined;\n renderer?: (props: rendererProps) => React.ReactNode;\n PreTag?:\n | keyof React.JSX.IntrinsicElements\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n | React.ComponentType<any>\n | undefined;\n CodeTag?:\n | keyof React.JSX.IntrinsicElements\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n | React.ComponentType<any>\n | undefined;\n}\n\n/** @flr-generate all */\nexport const CodeBlock: FC<CodeBlockProps> = (props) => {\n const { code, className, copyable, color = \"default\", ...rest } = props;\n\n const rootClassName = clsx(styles.codeBlock, styles[color], className);\n\n return (\n <div className={rootClassName}>\n <SyntaxHighlighter\n customStyle={{\n background: \"none\",\n padding: \"none\",\n margin: \"none\",\n }}\n useInlineStyles={false}\n {...rest}\n >\n {code}\n </SyntaxHighlighter>\n {copyable && (\n <CopyButton\n className={styles.copyButton}\n size=\"s\"\n color={color === \"default\" ? \"dark\" : color}\n text={Array.isArray(code) ? code.join(\"\\r\\n\") : code}\n />\n )}\n </div>\n );\n};\n\nexport default CodeBlock;\n"],"names":[],"mappings":";;;;;;;AAmDa,MAAA,SAAA,GAAgC,CAAC,KAAU,KAAA;AACtD,EAAM,MAAA,EAAE,MAAM,SAAW,EAAA,QAAA,EAAU,QAAQ,SAAW,EAAA,GAAG,MAAS,GAAA,KAAA;AAElE,EAAA,MAAM,gBAAgB,IAAK,CAAA,MAAA,CAAO,WAAW,MAAO,CAAA,KAAK,GAAG,SAAS,CAAA;AAErE,EACE,uBAAA,IAAA,CAAC,KAAI,EAAA,EAAA,SAAA,EAAW,aACd,EAAA,QAAA,EAAA;AAAA,oBAAA,GAAA;AAAA,MAAC,iBAAA;AAAA,MAAA;AAAA,QACC,WAAa,EAAA;AAAA,UACX,UAAY,EAAA,MAAA;AAAA,UACZ,OAAS,EAAA,MAAA;AAAA,UACT,MAAQ,EAAA;AAAA,SACV;AAAA,QACA,eAAiB,EAAA,KAAA;AAAA,QAChB,GAAG,IAAA;AAAA,QAEH,QAAA,EAAA;AAAA;AAAA,KACH;AAAA,IACC,QACC,oBAAA,GAAA;AAAA,MAAC,UAAA;AAAA,MAAA;AAAA,QACC,WAAW,MAAO,CAAA,UAAA;AAAA,QAClB,IAAK,EAAA,GAAA;AAAA,QACL,KAAA,EAAO,KAAU,KAAA,SAAA,GAAY,MAAS,GAAA,KAAA;AAAA,QACtC,IAAA,EAAM,MAAM,OAAQ,CAAA,IAAI,IAAI,IAAK,CAAA,IAAA,CAAK,MAAM,CAAI,GAAA;AAAA;AAAA;AAClD,GAEJ,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,13 +1,28 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import { SyntaxHighlighterProps } from 'react-syntax-highlighter';
|
|
1
|
+
import { FC, default as React } from 'react';
|
|
3
2
|
import { PropsWithClassName } from '../../lib/types/props';
|
|
4
|
-
export interface CodeBlockProps extends
|
|
3
|
+
export interface CodeBlockProps extends PropsWithClassName {
|
|
5
4
|
/** Adds a copy icon to the code block to copy its content. */
|
|
6
5
|
copyable?: boolean;
|
|
7
6
|
/** The color of the code block. @default "default" */
|
|
8
7
|
color?: "default" | "light" | "dark";
|
|
9
8
|
/** The code to display inside the code block. */
|
|
10
9
|
code: string | string[];
|
|
10
|
+
language?: string | undefined;
|
|
11
|
+
style?: Record<string, React.CSSProperties> | undefined;
|
|
12
|
+
customStyle?: React.CSSProperties | undefined;
|
|
13
|
+
codeTagProps?: React.HTMLProps<HTMLElement> | undefined;
|
|
14
|
+
useInlineStyles?: boolean | undefined;
|
|
15
|
+
showLineNumbers?: boolean | undefined;
|
|
16
|
+
showInlineLineNumbers?: boolean | undefined;
|
|
17
|
+
startingLineNumber?: number | undefined;
|
|
18
|
+
lineNumberContainerStyle?: React.CSSProperties | undefined;
|
|
19
|
+
lineNumberStyle?: React.CSSProperties | lineNumberStyleFunction | undefined;
|
|
20
|
+
wrapLines?: boolean | undefined;
|
|
21
|
+
wrapLongLines?: boolean | undefined;
|
|
22
|
+
lineProps?: lineTagPropsFunction | React.HTMLProps<HTMLElement> | undefined;
|
|
23
|
+
renderer?: (props: rendererProps) => React.ReactNode;
|
|
24
|
+
PreTag?: keyof React.JSX.IntrinsicElements | React.ComponentType<any> | undefined;
|
|
25
|
+
CodeTag?: keyof React.JSX.IntrinsicElements | React.ComponentType<any> | undefined;
|
|
11
26
|
}
|
|
12
27
|
/** @flr-generate all */
|
|
13
28
|
export declare const CodeBlock: FC<CodeBlockProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeBlock.d.ts","sourceRoot":"","sources":["../../../../src/components/CodeBlock/CodeBlock.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"CodeBlock.d.ts","sourceRoot":"","sources":["../../../../src/components/CodeBlock/CodeBlock.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAA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ACrD,MAAM,CAAC,EACH,MAAM,KAAK,CAAC,GAAG,CAAC,iBAAiB,GAEjC,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,GACxB,SAAS,CAAC;IACd,OAAO,CAAC,EACJ,MAAM,KAAK,CAAC,GAAG,CAAC,iBAAiB,GAEjC,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,GACxB,SAAS,CAAC;CACf;AAED,wBAAwB;AACxB,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,CA4BxC,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mittwald/flow-react-components",
|
|
3
|
-
"version": "0.2.0-alpha.
|
|
3
|
+
"version": "0.2.0-alpha.395",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A React implementation of Flow, mittwald’s design system",
|
|
6
6
|
"homepage": "https://mittwald.github.io/flow",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"@chakra-ui/live-region": "^2.1.0",
|
|
59
59
|
"@internationalized/string-compiler": "^3.2.6",
|
|
60
60
|
"@mittwald/password-tools-js": "3.0.0-alpha.15",
|
|
61
|
-
"@mittwald/react-tunnel": "0.2.0-alpha.
|
|
61
|
+
"@mittwald/react-tunnel": "0.2.0-alpha.395",
|
|
62
62
|
"@mittwald/react-use-promise": "^3.0.4",
|
|
63
63
|
"@react-aria/form": "^3.1.0",
|
|
64
64
|
"@react-aria/utils": "^3.30.0",
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
"@faker-js/faker": "^9.9.0",
|
|
100
100
|
"@internationalized/date": "^3.8.2",
|
|
101
101
|
"@mittwald/flow-core": "",
|
|
102
|
-
"@mittwald/flow-design-tokens": "0.2.0-alpha.
|
|
102
|
+
"@mittwald/flow-design-tokens": "0.2.0-alpha.395",
|
|
103
103
|
"@mittwald/react-use-promise": "^3.0.4",
|
|
104
104
|
"@mittwald/remote-dom-react": "1.2.2-mittwald.3",
|
|
105
105
|
"@mittwald/typescript-config": "",
|
|
@@ -175,5 +175,5 @@
|
|
|
175
175
|
"optional": true
|
|
176
176
|
}
|
|
177
177
|
},
|
|
178
|
-
"gitHead": "
|
|
178
|
+
"gitHead": "5563080ab64438085b0faf3ef1278d56f1dae395"
|
|
179
179
|
}
|