Skip to content

Commit 16f7740

Browse files
committed
chore: Merge branch 'brendanmoore-feature/remove-style-loader'
BREAKING CHANGE: from v2.0.0 on, you must import the css for the component yourself, using `import 'react-sortable-tree/styles.css';`. You only need to do this once in your application.
2 parents 97610d1 + 35b2255 commit 16f7740

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+2055
-2700
lines changed

.babelrc

+2-12
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,4 @@
11
{
2-
"presets": [
3-
["env", {
4-
"targets": {
5-
"browsers": ["last 2 versions", "ie >= 9"]
6-
}
7-
}],
8-
"react"
9-
],
10-
"plugins": [
11-
"transform-object-rest-spread",
12-
"react-hot-loader/babel"
13-
]
2+
"presets": ["env", "react"],
3+
"plugins": ["transform-object-rest-spread", "react-hot-loader/babel"]
144
}

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,5 @@ cc-test-reporter
1717
# Build directories (Will be preserved by npm)
1818
dist
1919
build
20+
style.css
21+
style.css.map

.storybook/addons.js

-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
11
/* eslint-disable import/no-extraneous-dependencies */
22
import '@storybook/addon-options/register';
3-
import '@storybook/addon-notes/register';
4-
import '@storybook/addon-actions/register';

.storybook/config.js

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { setOptions } from '@storybook/addon-options';
55
setOptions({
66
name: 'React Sortable Tree',
77
url: 'https://github.com/fritz-c/react-sortable-tree',
8+
showAddonPanel: false,
89
});
910

1011
function loadStories() {

.storybook/webpack.config.js

-18
This file was deleted.

README.md

+52-48
Large diffs are not rendered by default.

examples/basic-example/app.js

+10-8
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ import {
33
SortableTreeWithoutDndContext as SortableTree,
44
toggleExpandedForAll,
55
} from '../../src/index';
6-
import styles from './stylesheets/app.scss';
6+
import './stylesheets/vendor/stylesheet.css';
7+
import './stylesheets/vendor/github-light.css';
8+
import './stylesheets/app.css';
79
import '../shared/favicon/apple-touch-icon.png';
810
import '../shared/favicon/favicon-16x16.png';
911
import '../shared/favicon/favicon-32x32.png';
@@ -218,15 +220,15 @@ class App extends Component {
218220

219221
return (
220222
<div>
221-
<section className={styles['page-header']}>
222-
<h1 className={styles['project-name']}>{projectName}</h1>
223+
<section className="page-header">
224+
<h1 className="project-name">{projectName}</h1>
223225

224-
<h2 className={styles['project-tagline']}>
226+
<h2 className="project-tagline">
225227
Drag-and-drop sortable representation of hierarchical data
226228
</h2>
227229
</section>
228230

229-
<section className={styles['main-content']}>
231+
<section className="main-content">
230232
<h3>Demo</h3>
231233
<button onClick={this.expandAll}>Expand All</button>
232234
<button onClick={this.collapseAll}>Collapse All</button>
@@ -318,13 +320,13 @@ class App extends Component {
318320
<a href={githubUrl}>Documentation on Github</a>
319321
<br />
320322
<a href="storybook/index.html">More examples on Storybook</a>
321-
<footer className={styles['site-footer']}>
322-
<span className={styles['site-footer-owner']}>
323+
<footer className="site-footer">
324+
<span className="site-footer-owner">
323325
<a href={githubUrl}>{projectName}</a> is maintained by{' '}
324326
<a href={authorUrl}>{authorName}</a>.
325327
</span>
326328

327-
<span className={styles['site-footer-credits']}>
329+
<span className="site-footer-credits">
328330
This page was generated by{' '}
329331
<a href="https://pages.github.com">GitHub Pages</a> using the{' '}
330332
<a href="https://github.com/jasonlong/cayman-theme">
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
@import './vendor/stylesheet';
2-
@import './vendor/github-light';
3-
41
.page-header {
52
padding: 1rem 6rem;
63
}
@@ -17,10 +14,12 @@ body {
1714
/**
1815
* Uncomment to simulate bootstrap environment
1916
*/
20-
// html {
21-
// box-sizing: border-box;
22-
// }
17+
/*
18+
html {
19+
box-sizing: border-box;
20+
}
2321
24-
// *, *::before, *::after {
25-
// box-sizing: inherit;
26-
// }
22+
*, *::before, *::after {
23+
box-sizing: inherit;
24+
}
25+
*/

examples/basic-example/stylesheets/vendor/github-light.css

+20-21
Original file line numberDiff line numberDiff line change
@@ -15,30 +15,30 @@
1515
1616
*/
1717

18-
.pl-c /* comment */ {
18+
.pl-c {
1919
color: #969896;
2020
}
2121

2222
.pl-c1 /* constant, markup.raw, meta.diff.header, meta.module-reference, meta.property-name, support, support.constant, support.variable, variable.other.constant */,
23-
.pl-s .pl-v /* string variable */ {
23+
.pl-s .pl-v {
2424
color: #0086b3;
2525
}
2626

2727
.pl-e /* entity */,
28-
.pl-en /* entity.name */ {
28+
.pl-en {
2929
color: #795da3;
3030
}
3131

3232
.pl-s .pl-s1 /* string source */,
33-
.pl-smi /* storage.modifier.import, storage.modifier.package, storage.type.java, variable.other, variable.parameter.function */ {
33+
.pl-smi {
3434
color: #333;
3535
}
3636

37-
.pl-ent /* entity.name.tag */ {
37+
.pl-ent {
3838
color: #63a35c;
3939
}
4040

41-
.pl-k /* keyword, storage, storage.type */ {
41+
.pl-k {
4242
color: #a71d5d;
4343
}
4444

@@ -48,69 +48,68 @@
4848
.pl-sr /* string.regexp */,
4949
.pl-sr .pl-cce /* string.regexp constant.character.escape */,
5050
.pl-sr .pl-sra /* string.regexp string.regexp.arbitrary-repitition */,
51-
.pl-sr .pl-sre /* string.regexp source.ruby.embedded */ {
51+
.pl-sr .pl-sre {
5252
color: #183691;
5353
}
5454

55-
.pl-v /* variable */ {
55+
.pl-v {
5656
color: #ed6a43;
5757
}
5858

59-
.pl-id /* invalid.deprecated */ {
59+
.pl-id {
6060
color: #b52a1d;
6161
}
6262

63-
.pl-ii /* invalid.illegal */ {
63+
.pl-ii {
6464
background-color: #b52a1d;
6565
color: #f8f8f8;
6666
}
6767

68-
.pl-sr .pl-cce /* string.regexp constant.character.escape */ {
68+
.pl-sr .pl-cce {
6969
color: #63a35c;
7070
font-weight: bold;
7171
}
7272

73-
.pl-ml /* markup.list */ {
73+
.pl-ml {
7474
color: #693a17;
7575
}
7676

7777
.pl-mh /* markup.heading */,
7878
.pl-mh .pl-en /* markup.heading entity.name */,
79-
.pl-ms /* meta.separator */ {
79+
.pl-ms {
8080
color: #1d3e81;
8181
font-weight: bold;
8282
}
8383

84-
.pl-mq /* markup.quote */ {
84+
.pl-mq {
8585
color: #008080;
8686
}
8787

88-
.pl-mi /* markup.italic */ {
88+
.pl-mi {
8989
color: #333;
9090
font-style: italic;
9191
}
9292

93-
.pl-mb /* markup.bold */ {
93+
.pl-mb {
9494
color: #333;
9595
font-weight: bold;
9696
}
9797

98-
.pl-md /* markup.deleted, meta.diff.header.from-file */ {
98+
.pl-md {
9999
background-color: #ffecec;
100100
color: #bd2c00;
101101
}
102102

103-
.pl-mi1 /* markup.inserted, meta.diff.header.to-file */ {
103+
.pl-mi1 {
104104
background-color: #eaffea;
105105
color: #55a532;
106106
}
107107

108-
.pl-mdr /* meta.diff.range */ {
108+
.pl-mdr {
109109
color: #795da3;
110110
font-weight: bold;
111111
}
112112

113-
.pl-mo /* meta.output */ {
113+
.pl-mo {
114114
color: #1d3e81;
115115
}
116-

0 commit comments

Comments
 (0)