fix(extension): fix code editor styles (#817)

This commit is contained in:
Nathan Bierema 2021-08-30 01:32:29 +00:00 committed by GitHub
parent d38a438764
commit 1258902c35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 27 additions and 16 deletions

View File

@ -2,4 +2,7 @@ module.exports = {
setupFilesAfterEnv: ['<rootDir>/test/setup.js'], setupFilesAfterEnv: ['<rootDir>/test/setup.js'],
testPathIgnorePatterns: ['<rootDir>/examples'], testPathIgnorePatterns: ['<rootDir>/examples'],
testEnvironment: 'jsdom', testEnvironment: 'jsdom',
moduleNameMapper: {
'\\.css$': '<rootDir>/test/__mocks__/styleMock.ts',
},
}; };

View File

@ -7,9 +7,9 @@ import { StoreState } from '@redux-devtools/app/lib/reducers';
import App from '../../../app/containers/App'; import App from '../../../app/containers/App';
import configureStore from '../../../app/stores/windowStore'; import configureStore from '../../../app/stores/windowStore';
import getPreloadedState from '../background/getPreloadedState'; import getPreloadedState from '../background/getPreloadedState';
import { MonitorMessage } from '../../../app/middlewares/api';
import '../../views/window.pug'; import '../../views/window.pug';
import { MonitorMessage } from '../../../app/middlewares/api';
const position = location.hash; const position = location.hash;
let preloadedState: PreloadedState<StoreState>; let preloadedState: PreloadedState<StoreState>;

View File

@ -0,0 +1 @@
export default {};

View File

@ -77,7 +77,7 @@ const baseConfig = (params) => ({
]), ]),
{ {
test: /\.css?$/, test: /\.css?$/,
use: ['style-loader', 'raw-loader'], use: ['style-loader', 'css-loader'],
}, },
{ {
test: /\.pug$/, test: /\.pug$/,

View File

@ -1,7 +1,6 @@
import React from 'react'; import React from 'react';
import { Container } from '../src'; import { Container } from '../src';
import { listSchemes, listThemes } from '../src/utils/theme'; import { listSchemes, listThemes } from '../src/utils/theme';
import '../src/presets';
export const parameters = { export const parameters = {
actions: { argTypesRegex: '^on[A-Z].*' }, actions: { argTypesRegex: '^on[A-Z].*' },

View File

@ -2,4 +2,7 @@ module.exports = {
preset: 'ts-jest', preset: 'ts-jest',
setupFilesAfterEnv: ['<rootDir>/tests/setup.ts'], setupFilesAfterEnv: ['<rootDir>/tests/setup.ts'],
testEnvironment: 'jsdom', testEnvironment: 'jsdom',
moduleNameMapper: {
'\\.css$': '<rootDir>/tests/__mocks__/styleMock.ts',
},
}; };

View File

@ -6,6 +6,15 @@ import { Base16Theme } from 'base16';
import { defaultStyle, themedStyle } from './styles'; import { defaultStyle, themedStyle } from './styles';
import { Theme } from '../themes/default'; import { Theme } from '../themes/default';
import 'codemirror/mode/javascript/javascript';
import 'codemirror/addon/fold/foldgutter';
import 'codemirror/addon/fold/foldcode';
import 'codemirror/addon/fold/brace-fold';
import '../../fonts/index.css';
import 'codemirror/lib/codemirror.css';
import 'codemirror/addon/fold/foldgutter.css';
const EditorContainer = styled.div( const EditorContainer = styled.div(
'' as unknown as TemplateStringsArray, '' as unknown as TemplateStringsArray,
({ theme }: { theme: Theme }) => ({ theme }: { theme: Theme }) =>

View File

@ -1,12 +0,0 @@
/* eslint-disable global-require */
import 'codemirror/mode/javascript/javascript';
import 'codemirror/addon/fold/foldgutter';
import 'codemirror/addon/fold/foldcode';
import 'codemirror/addon/fold/brace-fold';
if (process.env.NODE_ENV !== 'test') {
require('../fonts/index.css');
require('codemirror/lib/codemirror.css');
require('codemirror/addon/fold/foldgutter.css');
}

View File

@ -0,0 +1 @@
export default {};

View File

@ -2,4 +2,7 @@ module.exports = {
preset: 'ts-jest', preset: 'ts-jest',
setupFilesAfterEnv: ['<rootDir>/test/setup.ts'], setupFilesAfterEnv: ['<rootDir>/test/setup.ts'],
testEnvironment: 'jsdom', testEnvironment: 'jsdom',
moduleNameMapper: {
'\\.css$': '<rootDir>/test/__mocks__/styleMock.ts',
},
}; };

View File

@ -1,4 +1,3 @@
import 'devui/lib/presets';
import React, { Component } from 'react'; import React, { Component } from 'react';
import { Provider } from 'react-redux'; import { Provider } from 'react-redux';
import { Store } from 'redux'; import { Store } from 'redux';

View File

@ -0,0 +1 @@
export default {};

View File

@ -2,4 +2,7 @@ module.exports = {
preset: 'ts-jest', preset: 'ts-jest',
setupFilesAfterEnv: ['<rootDir>/test/setup.ts'], setupFilesAfterEnv: ['<rootDir>/test/setup.ts'],
testEnvironment: 'jsdom', testEnvironment: 'jsdom',
moduleNameMapper: {
'\\.css$': '<rootDir>/test/__mocks__/styleMock.ts',
},
}; };

View File

@ -0,0 +1 @@
export default {};