Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bright

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bright - npm Package Compare versions

Comparing version 0.7.2 to 0.7.3

2

dist/index.d.ts

@@ -45,2 +45,3 @@ import { Annotation, Theme, LanguageAlias, ThemeColors, Lines, Tokens, Token } from '@code-hike/lighter';

type DoubleTheme = {
lightSelector?: string;
dark: Theme;

@@ -74,2 +75,3 @@ light: Theme;

mode?: "dark" | "light";
lightThemeSelector?: string;
style?: React.CSSProperties;

@@ -76,0 +78,0 @@ className?: string;

40

dist/index.js

@@ -323,3 +323,10 @@ "use strict";

children: [
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Style, { mode, lineNumbers: props.lineNumbers }),
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
Style,
{
mode,
lineNumbers: props.lineNumbers,
lightThemeSelector: props.lightThemeSelector
}
),
title && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(TitleBar, { ...props }),

@@ -357,3 +364,4 @@ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Pre2, { ...props })

mode,
lineNumbers
lineNumbers,
lightThemeSelector
}) {

@@ -367,3 +375,3 @@ const lineNumbersStyle = `[data-bright-theme] [data-bright-ln] {

}`;
const css = `${displayStyle(mode)}
const css = `${displayStyle(mode, lightThemeSelector)}
[data-bright-theme] ::selection { background-color: var(--selection-background) }

@@ -374,3 +382,3 @@ ${lineNumbers ? lineNumbersStyle : ""}

}
function displayStyle(mode) {
function displayStyle(mode, lightThemeSelector = '[data-theme="light"]') {
if (!mode)

@@ -380,6 +388,6 @@ return "";

return `[data-bright-mode="dark"] { display: block }
[data-theme="light"] [data-bright-mode="dark"] { display: none }`;
${lightThemeSelector} [data-bright-mode="dark"] { display: none }`;
if (mode === "light")
return `[data-bright-mode="light"] { display: none }
[data-theme="light"] [data-bright-mode="light"] { display: block }`;
${lightThemeSelector} [data-bright-mode="light"] { display: block }`;
return "";

@@ -425,4 +433,20 @@ }

return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(AnnotatedCode, { ...props, theme: darkTheme, mode: "dark" }),
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(AnnotatedCode, { ...props, theme: lightTheme, mode: "light" })
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
AnnotatedCode,
{
...props,
theme: darkTheme,
mode: "dark",
lightThemeSelector: doubleTheme.lightSelector
}
),
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
AnnotatedCode,
{
...props,
theme: lightTheme,
mode: "light",
lightThemeSelector: doubleTheme.lightSelector
}
)
] });

@@ -429,0 +453,0 @@ };

{
"name": "bright",
"version": "0.7.2",
"version": "0.7.3",
"main": "./dist/index.js",

@@ -19,3 +19,3 @@ "module": "./dist/index.mjs",

"dependencies": {
"@code-hike/lighter": "0.6.2",
"@code-hike/lighter": "0.6.6",
"server-only": "^0.0.1"

@@ -22,0 +22,0 @@ },

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc