Comparing version 0.8.3 to 0.8.4
import { Annotation, Theme, LanguageAlias, getThemeColorsSync, Lines, Tokens, Token } from '@code-hike/lighter'; | ||
import * as react_jsx_runtime from 'react/jsx-runtime'; | ||
import { ReactNode, FunctionComponent } from 'react'; | ||
declare function Root(props: BrightProps): JSX.Element; | ||
declare function Pre(brightProps: BrightProps): JSX.Element; | ||
declare function Root(props: BrightProps): react_jsx_runtime.JSX.Element; | ||
declare function Pre(brightProps: BrightProps): react_jsx_runtime.JSX.Element; | ||
declare function TitleBarContent(props: BrightProps): JSX.Element; | ||
declare function Tab(props: BrightProps): JSX.Element; | ||
declare function TabContent(props: BrightProps): JSX.Element; | ||
declare function TitleBarContent(props: BrightProps): react_jsx_runtime.JSX.Element; | ||
declare function Tab(props: BrightProps): react_jsx_runtime.JSX.Element; | ||
declare function TabContent(props: BrightProps): react_jsx_runtime.JSX.Element; | ||
@@ -11,0 +12,0 @@ declare const components: { |
@@ -527,15 +527,19 @@ "use strict"; | ||
} | ||
function trimTrailingNewline(code) { | ||
var _a; | ||
return (_a = code == null ? void 0 : code.replace(/\n$/, "")) != null ? _a : void 0; | ||
} | ||
function parseChildren(children, lang, code) { | ||
var _a, _b, _c; | ||
var _a, _b; | ||
if (typeof children === "object" && (children == null ? void 0 : children.type) === "code") { | ||
return { | ||
code: (_b = (_a = children.props) == null ? void 0 : _a.children) == null ? void 0 : _b.trim(), | ||
...getLanguageAndTitle((_c = children.props) == null ? void 0 : _c.className) | ||
code: trimTrailingNewline((_a = children.props) == null ? void 0 : _a.children), | ||
...getLanguageAndTitle((_b = children.props) == null ? void 0 : _b.className) | ||
}; | ||
} else if (typeof children === "object") { | ||
const subProps = import_react.default.Children.toArray(children).map((c) => { | ||
var _a2, _b2, _c2; | ||
var _a2, _b2; | ||
const codeProps = (_b2 = (_a2 = c.props) == null ? void 0 : _a2.children) == null ? void 0 : _b2.props; | ||
return { | ||
code: (_c2 = codeProps.children) == null ? void 0 : _c2.trim(), | ||
code: trimTrailingNewline(codeProps.children), | ||
...getLanguageAndTitle(codeProps.className) | ||
@@ -542,0 +546,0 @@ }; |
{ | ||
"name": "bright", | ||
"version": "0.8.3", | ||
"version": "0.8.4", | ||
"main": "./dist/index.js", | ||
@@ -5,0 +5,0 @@ "module": "./dist/index.mjs", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
38180
1211