@iyio/syn-taxi 0.7.23 → 0.7.24
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.
|
@@ -4,9 +4,10 @@ interface CodeViewProps {
|
|
|
4
4
|
children?: string;
|
|
5
5
|
language?: string;
|
|
6
6
|
noBg?: boolean;
|
|
7
|
+
className?: string;
|
|
7
8
|
}
|
|
8
9
|
/**
|
|
9
10
|
* @acIgnore
|
|
10
11
|
*/
|
|
11
|
-
export declare function CodeView({ value, wrap, children, language, noBg, }: CodeViewProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare function CodeView({ value, wrap, children, language, noBg, className, }: CodeViewProps): import("react/jsx-runtime").JSX.Element;
|
|
12
13
|
export {};
|
package/esm/src/lib/CodeView.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { atDotCss } from '@iyio/at-dot-css';
|
|
3
|
+
import { cn } from '@iyio/common';
|
|
3
4
|
import { useEffect, useState } from 'react';
|
|
4
5
|
import { useShiki } from './shiki';
|
|
5
6
|
/**
|
|
6
7
|
* @acIgnore
|
|
7
8
|
*/
|
|
8
|
-
export function CodeView({ value, wrap, children, language, noBg, }) {
|
|
9
|
+
export function CodeView({ value, wrap, children, language, noBg, className, }) {
|
|
9
10
|
style.root();
|
|
10
11
|
const code = value || children || '';
|
|
11
12
|
const { sh, loadIndex } = useShiki(language);
|
|
@@ -19,7 +20,7 @@ export function CodeView({ value, wrap, children, language, noBg, }) {
|
|
|
19
20
|
elem.querySelectorAll('pre').forEach(e => e.style.backgroundColor = 'transparent');
|
|
20
21
|
}
|
|
21
22
|
}, [sh, loadIndex, code, elem, language, noBg]);
|
|
22
|
-
return (_jsx("pre", { className: "CodeView", style: style.vars({ wrap: wrap ? 'pre-wrap' : 'pre' }), children: _jsx("code", { ref: setElem }) }));
|
|
23
|
+
return (_jsx("pre", { className: cn("CodeView", className), style: style.vars({ wrap: wrap ? 'pre-wrap' : 'pre' }), children: _jsx("code", { ref: setElem }) }));
|
|
23
24
|
}
|
|
24
25
|
const style = atDotCss({ name: 'CodeView', css: `
|
|
25
26
|
.CodeView.pre, .CodeView > code{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeView.js","sourceRoot":"","sources":["../../../../../../packages/syn-taxi/src/lib/CodeView.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"CodeView.js","sourceRoot":"","sources":["../../../../../../packages/syn-taxi/src/lib/CodeView.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAYnC;;GAEG;AACH,MAAM,UAAU,QAAQ,CAAC,EACrB,KAAK,EACL,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,IAAI,EACJ,SAAS,GACE;IAEX,KAAK,CAAC,IAAI,EAAE,CAAC;IAEb,MAAM,IAAI,GAAC,KAAK,IAAE,QAAQ,IAAE,EAAE,CAAC;IAC/B,MAAM,EAAC,EAAE,EAAC,SAAS,EAAC,GAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAExC,MAAM,CAAC,IAAI,EAAC,OAAO,CAAC,GAAC,QAAQ,CAAmB,IAAI,CAAC,CAAC;IAEtD,SAAS,CAAC,GAAE,EAAE;QACV,IAAG,CAAC,IAAI,IAAI,CAAC,EAAE,EAAC,CAAC;YACb,OAAO;QACX,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.8.0",
|
|
9
9
|
"shiki": ">=1.14.1",
|
|
10
|
-
"uuid": ">=9.0.0"
|
|
11
|
-
"zod": ">=3.21.4"
|
|
10
|
+
"uuid": ">=9.0.0"
|
|
12
11
|
},
|
|
13
12
|
"peerDependencies": {
|
|
14
|
-
"@iyio/at-dot-css": "^0.7.
|
|
15
|
-
"@iyio/common": "^0.7.
|
|
16
|
-
"@iyio/react-common": "^0.7.
|
|
17
|
-
"@iyio/rtxt": "^0.7.
|
|
13
|
+
"@iyio/at-dot-css": "^0.7.24",
|
|
14
|
+
"@iyio/common": "^0.7.24",
|
|
15
|
+
"@iyio/react-common": "^0.7.24",
|
|
16
|
+
"@iyio/rtxt": "^0.7.24",
|
|
18
17
|
"react": ">=18 || >=19",
|
|
19
18
|
"react-dom": ">=18 || >=19"
|
|
20
19
|
},
|
package/src/lib/CodeView.d.ts
CHANGED
|
@@ -4,9 +4,10 @@ interface CodeViewProps {
|
|
|
4
4
|
children?: string;
|
|
5
5
|
language?: string;
|
|
6
6
|
noBg?: boolean;
|
|
7
|
+
className?: string;
|
|
7
8
|
}
|
|
8
9
|
/**
|
|
9
10
|
* @acIgnore
|
|
10
11
|
*/
|
|
11
|
-
export declare function CodeView({ value, wrap, children, language, noBg, }: CodeViewProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare function CodeView({ value, wrap, children, language, noBg, className, }: CodeViewProps): import("react/jsx-runtime").JSX.Element;
|
|
12
13
|
export {};
|
package/src/lib/CodeView.js
CHANGED
|
@@ -3,12 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.CodeView = CodeView;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const at_dot_css_1 = require("@iyio/at-dot-css");
|
|
6
|
+
const common_1 = require("@iyio/common");
|
|
6
7
|
const react_1 = require("react");
|
|
7
8
|
const shiki_1 = require("./shiki");
|
|
8
9
|
/**
|
|
9
10
|
* @acIgnore
|
|
10
11
|
*/
|
|
11
|
-
function CodeView({ value, wrap, children, language, noBg, }) {
|
|
12
|
+
function CodeView({ value, wrap, children, language, noBg, className, }) {
|
|
12
13
|
style.root();
|
|
13
14
|
const code = value || children || '';
|
|
14
15
|
const { sh, loadIndex } = (0, shiki_1.useShiki)(language);
|
|
@@ -22,7 +23,7 @@ function CodeView({ value, wrap, children, language, noBg, }) {
|
|
|
22
23
|
elem.querySelectorAll('pre').forEach(e => e.style.backgroundColor = 'transparent');
|
|
23
24
|
}
|
|
24
25
|
}, [sh, loadIndex, code, elem, language, noBg]);
|
|
25
|
-
return ((0, jsx_runtime_1.jsx)("pre", { className: "CodeView", style: style.vars({ wrap: wrap ? 'pre-wrap' : 'pre' }), children: (0, jsx_runtime_1.jsx)("code", { ref: setElem }) }));
|
|
26
|
+
return ((0, jsx_runtime_1.jsx)("pre", { className: (0, common_1.cn)("CodeView", className), style: style.vars({ wrap: wrap ? 'pre-wrap' : 'pre' }), children: (0, jsx_runtime_1.jsx)("code", { ref: setElem }) }));
|
|
26
27
|
}
|
|
27
28
|
const style = (0, at_dot_css_1.atDotCss)({ name: 'CodeView', css: `
|
|
28
29
|
.CodeView.pre, .CodeView > code{
|
package/src/lib/CodeView.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeView.js","sourceRoot":"","sources":["../../../../../packages/syn-taxi/src/lib/CodeView.tsx"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"CodeView.js","sourceRoot":"","sources":["../../../../../packages/syn-taxi/src/lib/CodeView.tsx"],"names":[],"mappings":";;AAkBA,4BA+BC;;AAjDD,iDAA4C;AAC5C,yCAAkC;AAClC,iCAA4C;AAC5C,mCAAmC;AAYnC;;GAEG;AACH,SAAgB,QAAQ,CAAC,EACrB,KAAK,EACL,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,IAAI,EACJ,SAAS,GACE;IAEX,KAAK,CAAC,IAAI,EAAE,CAAC;IAEb,MAAM,IAAI,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