Skip to content
This repository was archived by the owner on May 25, 2022. It is now read-only.

Commit 2f745f9

Browse files
Merge branch 'release/1.4.0'
2 parents da72744 + bc8a354 commit 2f745f9

27 files changed

Lines changed: 348 additions & 742 deletions

File tree

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
**Ne pas oublier de changer le package.json**
44

5+
## 1.4.0 / 06-04-2020
6+
7+
### :tada: Enhancements
8+
9+
- Update React to the latest version
10+
- Title attribute for emojis
11+
- [#22](https://github.com/O-clock-Dev/formatizer/issues/22) : Remove CSS-in-JS' library and use CSS inline instead.
12+
513
## 1.3.4 / 17-03-2020
614

715
### :bug: Fixes

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
You need these packages to install **Formatizer**.
66

77
- React
8-
- Glamor & Glamorous
9-
10-
If you don't have these, please install `yarn add react glamor glamorous`
118

129
## :rocket: Installation
1310

package.json

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"name": "formatizer",
3-
"version": "1.3.4",
3+
"version": "1.4.0",
44
"repository": {
55
"type": "git",
66
"url": "git+ssh://git@github.com/O-clock-dev/formatizer.git"
77
},
8-
"author": "Alexandre Bourdeaud'hui <alexandre@oclock.io>",
8+
"author": "Team O’clock <dev@oclock.io>",
99
"license": "MIT",
1010
"scripts": {
1111
"start": "brunch watch --server",
@@ -25,12 +25,11 @@
2525
},
2626
"dependencies": {
2727
"emoji-mart": "^2.11.1",
28+
"enzyme-adapter-react-16": "^1.15.2",
2829
"react-syntax-highlighter": "^5.7.0"
2930
},
3031
"peerDependencies": {
31-
"glamor": "^2.20.40",
32-
"glamorous": "^4.11.0",
33-
"react": "^15.4.1 || ^16.0.0"
32+
"react": "^16.2.0 || ^16.13.1"
3433
},
3534
"devDependencies": {
3635
"auto-reload-brunch": "^2.7.1",
@@ -45,24 +44,21 @@
4544
"brunch": "^2.10.12",
4645
"chai": "^4.1.2",
4746
"enzyme": "^3.2.0",
48-
"enzyme-adapter-react-15": "^1.0.5",
4947
"eslint": "^4.4.1",
5048
"eslint-config-airbnb": "^15.1.0",
5149
"eslint-import-resolver-node": "^0.3.0",
5250
"eslint-plugin-import": "^2.3.0",
5351
"eslint-plugin-jsx-a11y": "^5.0.3",
5452
"eslint-plugin-react": "^7.1.0",
55-
"glamor": "^2.20.40",
56-
"glamorous": "^4.11.0",
5753
"husky": "^0.14.3",
5854
"jsdom": "^11.5.1",
5955
"lint-staged": "^6.0.0",
6056
"mocha": "^4.0.1",
6157
"prettier": "^1.9.1",
6258
"prop-types": "^15.6.0",
63-
"react": "^15.6.2",
64-
"react-dom": "^15.6.2",
65-
"react-test-renderer": "^15.6.2"
59+
"react": "^16.13.1",
60+
"react-dom": "^16.13.1",
61+
"react-test-renderer": "^16.13.1"
6662
},
6763
"main": "dist/index.js",
6864
"files": [
@@ -81,6 +77,7 @@
8177
"react"
8278
],
8379
"contributors": [
80+
"Alexandre Bourdeaud’hui <alexandre@oclock.io>",
8481
"Maxime Vasse <maxime@oclock.io>"
8582
]
8683
}

src/components/Format/index.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,21 @@ const Format = ({ children, ...props }) => {
2424
/*
2525
* View
2626
*/
27-
28-
// @TODO : Delete <span> when we pass at React 16
2927
return (
30-
<span>
28+
<React.Fragment>
3129
{fragments.map((fragment, index) => {
3230
// If element is a string
3331
if (typeof fragment === 'string') {
34-
return <span key={index}>{fragment}</span>;
32+
return <React.Fragment key={index}>{fragment}</React.Fragment>;
3533
}
3634

3735
// Otherwise, is a Piece of Fragment.
3836
// Clone element to add key
39-
return React.cloneElement(fragment, { key: index });
37+
return React.cloneElement(fragment, {
38+
key: index,
39+
});
4040
})}
41-
</span>
41+
</React.Fragment>
4242
);
4343
};
4444

src/components/Formatizer/index.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,16 @@ import PropTypes from 'prop-types';
88
* Local Import
99
*/
1010
import Format from 'src/components/Format';
11-
import { Container } from './style';
12-
13-
/*
14-
* Code
15-
*/
1611

1712
/*
1813
* Component
1914
*/
2015
const Formatizer = ({ children, ...props }) => (
21-
<Container>
16+
<div style={{ paddingRight: '.2em' }}>
2217
<Format {...props}>
2318
{typeof children === 'object' ? children.join('') : children}
2419
</Format>
25-
</Container>
20+
</div>
2621
);
2722
Formatizer.propTypes = {
2823
children: PropTypes.oneOfType([

src/components/Formatizer/style.js

Lines changed: 0 additions & 15 deletions
This file was deleted.

src/components/Piece/Blockquote/index.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
*/
44
import React from 'react';
55
import PropTypes from 'prop-types';
6-
import glamorous from 'glamorous';
76

87
/*
98
* Local Import
@@ -18,15 +17,12 @@ export const patternBlockquote = /(?:^|\n.)>[^\n]+\n?/gm;
1817
/*
1918
* Style
2019
*/
21-
const Style = glamorous.span({
20+
const style = {
2221
display: 'block',
2322
borderLeft: '3px solid rgba(255,255,255,0.2)',
2423
fontStyle: 'italic',
2524
paddingLeft: '.7em',
26-
'&:last-of-type': {
27-
marginBottom: '.2em',
28-
},
29-
});
25+
};
3026

3127
/*
3228
* Component
@@ -36,9 +32,9 @@ const Blockquote = ({ children }) => {
3632
const value = children.slice(1);
3733

3834
return (
39-
<Style>
35+
<span style={style}>
4036
<Format>{value}</Format>
41-
</Style>
37+
</span>
4238
);
4339
};
4440

src/components/Piece/Character/index.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ export const patternCharacter = /\n+/g;
1616
/*
1717
* Component
1818
*/
19-
// @TODO, get rid of <span>s with React 16.2
2019
const Character = ({ children }) => {
2120
// Line
2221
if (children === '\n') {
@@ -26,15 +25,15 @@ const Character = ({ children }) => {
2625
// Multiline
2726
if (children.slice(0, 1) === '\n') {
2827
return (
29-
<span>
28+
<React.Fragment>
3029
<br />
3130
<br />
32-
</span>
31+
</React.Fragment>
3332
);
3433
}
3534

3635
// Other char
37-
return <span>{children}</span>;
36+
return <React.Fragment>{children}</React.Fragment>;
3837
};
3938

4039
/*

src/components/Piece/Code/index.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,31 @@ import PropTypes from 'prop-types';
77
/*
88
* Local Import
99
*/
10-
import { Style } from './style';
10+
import { Chunk, CodingFont } from '../style';
1111

1212
/*
1313
* Pattern
1414
*/
1515
export const patternCode = /`(.+?)\n?`/g;
1616

17+
/*
18+
* Style
19+
*/
20+
const style = {
21+
...Chunk,
22+
...CodingFont,
23+
color: '#abb2bf',
24+
padding: '.1em .3em',
25+
};
26+
1727
/*
1828
* Component
1929
*/
2030
const Code = ({ children }) => {
2131
// Get rid of first and last `
2232
const value = children.slice(1, -1).trim();
2333

24-
return <Style>{value}</Style>;
34+
return <span style={style}>{value}</span>;
2535
};
2636

2737
/*

src/components/Piece/Code/style.js

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)