Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
})
// the default theme until i figure out how to customize it on the fly
// http://chriskempson.github.io/base16/
// const defaultTheme = 'atliersavanah'
// const defaultTheme = 'ocean'
// const defaultTheme = 'mocha'
// const defaultTheme = 'railscasts'
// const defaultTheme = 'greenscreen'
const defaultTheme = "twilight"
// the natural or inverted look
const invertTheme = false
// some kind of wierd factory?
const createStylingFromTheme = createStyling(getStylingFromBase16, {})
// here's where I think i should be allowing user customization?
const styling = createStylingFromTheme(defaultTheme)
// fish out the roles because I haven't committed fully to styling in the components just yet
const roles = styling("roles").style
// awkwardly expose the theme for the ObjectTree component
const theme = styling("theme").style
export default {
...roles,
theme,
invertTheme,
}
function getStateFromProps(props) {
let theme = checkLegacyTheming(props.theme, props);
if (props.invertTheme) {
if (typeof theme === 'string') {
theme = `${theme}:inverted`;
} else if (theme && theme.extend) {
if (typeof theme === 'string') {
theme = { ...theme, extend: `${theme.extend}:inverted` };
} else {
theme = { ...theme, extend: invertTheme(theme.extend) };
}
} else if (theme) {
theme = invertTheme(theme);
}
}
return {
styling: createStylingFromTheme(theme)
};
}
function getStateFromProps(props) {
let theme = checkLegacyTheming(props.theme, props);
if (props.invertTheme) {
if (typeof theme === 'string') {
theme = `${theme}:inverted`;
} else if (theme && theme.extend) {
if (typeof theme === 'string') {
theme = { ...theme, extend: `${theme.extend}:inverted` };
} else {
theme = { ...theme, extend: invertTheme(theme.extend) };
}
} else if (theme) {
theme = invertTheme(theme);
}
}
return {
styling: createStylingFromTheme(theme)
};
}
function getStateFromProps(props) {
let theme = checkLegacyTheming(props.theme, props);
if (props.invertTheme) {
if (typeof theme === 'string') {
theme = `${theme}:inverted`;
} else if (theme && theme.extend) {
if (typeof theme === 'string') {
theme = { ...theme, extend: `${theme.extend}:inverted` };
} else {
theme = { ...theme, extend: invertTheme(theme.extend) };
}
} else if (theme) {
theme = invertTheme(theme);
}
}
return {
styling: createStylingFromTheme(theme)
};
}
function getStateFromProps(props) {
let theme = checkLegacyTheming(props.theme, props);
if (props.invertTheme) {
if (typeof theme === 'string') {
theme = `${theme}:inverted`;
} else if (theme && theme.extend) {
if (typeof theme === 'string') {
theme = { ...theme, extend: `${theme.extend}:inverted` };
} else {
theme = { ...theme, extend: invertTheme(theme.extend) };
}
} else if (theme) {
theme = invertTheme(theme);
}
}
return {
styling: createStylingFromTheme(theme)
};
}
const getStyle = theme => {
let rjv_theme = rjv_default;
if (theme === false || theme === 'none') {
rjv_theme = rjv_grey;
}
return createStyling(getDefaultThemeStyling, { defaultBase16: rjv_theme })(
theme
);
};
color: expanded ? colors.ITEM_STRING_EXPANDED_COLOR : colors.ITEM_STRING_COLOR,
marginLeft: 5,
...style,
},
}),
nestedNodeChildren: ({ style }) => ({
style: {
marginLeft: 10,
...style,
},
}),
};
};
const createStylingFromTheme = createStyling(getStylingFromBase16, {
defaultBase16: solarized,
});
export default createStylingFromTheme;
const getDefaultThemeStyling = theme => {
if (themeSheet) {
themeSheet.detach();
}
themeSheet = jss.createStyleSheet(
getSheetFromColorMap(colorMap(theme))
).attach();
return themeSheet.classes;
};
export const base16Themes = { ...reduxThemes, ...inspectorThemes };
export const createStylingFromTheme = createStyling(getDefaultThemeStyling, {
defaultBase16: inspector,
base16Themes
});
padding: 0,
margin: 0,
listStyle: 'none',
display: expanded ? 'block' : 'none'
}
}),
rootNodeChildren: {
padding: 0,
margin: 0,
listStyle: 'none'
}
};
};
export default createStyling(getDefaultThemeStyling, {
defaultBase16: solarized
});
left: 0,
top: '100%',
zIndex: 10000,
maxHeight: '36rem',
minWidth: '22rem',
backgroundColor: '#FFFFFF',
boxShadow: '1px 1px 4px rgba(100, 100, 100, 0.3)',
flexDirection: 'column'
}),
inputEnhancementsInput: {
paddingRight: '15px'
}
};
}
export default createStyling(getStylingFromBase16, {
defaultBase16: defaultTheme
});