Skip to content

Commit

Permalink
Merge pull request #183 from thematters/develop
Browse files Browse the repository at this point in the history
Release: v1.2.0
  • Loading branch information
devformatters authored Apr 2, 2019
2 parents fd22674 + 1a03c66 commit 7029b3e
Show file tree
Hide file tree
Showing 97 changed files with 2,039 additions and 1,020 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,4 @@ yarn.lock

# exclude sources.list
sources.list
*.rdb
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,20 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.2.0] - 2019-04-02

### Added

- Editor: Embed - YouTube, Vimeo and JSFiddle #166
- Editor: @user #169
- Editor: SmartBreak #168 #170
- About Page #180
- OpenSearch #176

# Changed

- Fix notice dropdown positioning issue with max-height #167

## [1.1.1] - 2019-03-28

### Added
Expand Down
7 changes: 6 additions & 1 deletion common/enums/keyCodes.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
export const KEYCODES = {
escape: 27
enter: 13,
escape: 27,
tab: 9,
up: 38,
down: 40,
v: 86
}
20 changes: 20 additions & 0 deletions common/styles/layouts/grids.css
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,23 @@
}
}
}

/*
* Waffle
*/
@each $i in 1, 2, 3, 4 {
.l-waffle-$(i) {
/* prettier-ignore */
lost-column: 1/$(i);
}
}
@each $device in sm, md, lg, xl {
@media (--$(device)-up) {
@each $i in 1, 2, 3, 4 {
.l-waffle-$(device)-$(i) {
/* prettier-ignore */
lost-column: 1/$(i);
}
}
}
}
8 changes: 8 additions & 0 deletions common/styles/mixins/mixins.css
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@
justify-content: space-between;
}

@define-mixin font-serif {
font-family: var(--font-serif-tc);

&[lang='zh-hans'] {
font-family: var(--font-serif-sc);
}
}

@define-mixin border-bottom-grey {
border-bottom: 1px solid var(--color-line-grey); /* fallback */
border-bottom: 0.5px solid var(--color-line-grey);
Expand Down
40 changes: 31 additions & 9 deletions common/styles/utils/content.article.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
& :global(> * + *) {
margin: var(--spacing-default) 0;
}
& :global(> *:first-child) {
margin-top: 0;
}
& :global(> *:last-child) {
margin-bottom: var(--spacing-default);
}
Expand Down Expand Up @@ -43,6 +46,26 @@
}
}

/* Embed
========================================================================== */
& :global(figure[class*='embed']) {
position: relative;
width: 100%;
height: 0;
padding-top: 56.25%;
background: var(--color-grey-lighter);

& iframe {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
width: 100%;
height: 100%;
}
}

/* Blockquote
========================================================================== */
& :global(blockquote) {
Expand Down Expand Up @@ -107,24 +130,17 @@
line-height: var(--line-height-article-heading);
}

/* Paragraph
========================================================================== */
& :global(> p) {
text-align: justify;
text-justify: inter-ideograph;
}

/* Link
========================================================================== */
& :global(a) {
color: var(--color-matters-gold);
color: var(--color-matters-green);
border-bottom: 1px solid currentcolor;
padding-bottom: 2px;

&:hover,
&:active,
&:focus {
color: var(--color-matters-gold-hover);
color: var(--color-matters-green-hover);
}
}
/* fix frequent misuse of links */
Expand All @@ -147,3 +163,9 @@
border-bottom: 1px solid var(--color-line-grey-dark);
}
}

.ql-editor {
& input.embed-clipboard {
line-height: 1.875;
}
}
11 changes: 2 additions & 9 deletions common/styles/utils/content.comment.css
Original file line number Diff line number Diff line change
Expand Up @@ -102,24 +102,17 @@
line-height: var(--line-height-article-heading);
}

/* Paragraph
========================================================================== */
& :global(> p) {
text-align: justify;
text-justify: inter-ideograph;
}

/* Link
========================================================================== */
& :global(a) {
color: var(--color-matters-gold);
color: var(--color-matters-green);
border-bottom: 1px solid currentcolor;
padding-bottom: 2px;

&:hover,
&:active,
&:focus {
color: var(--color-matters-gold-hover);
color: var(--color-matters-green-hover);
}
}
/* fix frequent misuse of links */
Expand Down
9 changes: 9 additions & 0 deletions common/styles/variables/shadows.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/* @styled-jsx=global */

:root {
--shadow-light: 0 1px 4px 0 rgba(0, 0, 0, 0.08);
--shadow-default: 0 4px 12px 0 rgba(0, 0, 0, 0.05),
0 1px 4px 0 rgba(0, 0, 0, 0.08);
--shadow-dark: 0 12px 24px 0 rgba(0, 0, 0, 0.12),
0 4px 12px 0 rgba(0, 0, 0, 0.05);
}
3 changes: 1 addition & 2 deletions common/styles/vendors/quill.bubble.css
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@
.ql-bubble .ql-toolbar {
background: var(--background-color);
border: solid 1px var(--border-color);
box-shadow: 0 12px 24px 0 var(--border-color),
0 4px 12px 0 rgba(0, 0, 0, 0.04), 0 1px 4px 0 var(--border-color);
box-shadow: var(--shadow-dark);
border-radius: var(--spacing-xx-tight);

&:after {
Expand Down
8 changes: 0 additions & 8 deletions common/styles/vendors/tippy.css
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
/* @styled-jsx=global */

:root {
--shadow-light: 0 1px 4px 0 rgba(0, 0, 0, 0.08);
--shadow-default: 0 4px 12px 0 rgba(0, 0, 0, 0.05),
0 1px 4px 0 rgba(0, 0, 0, 0.08);
--shadow-dark: 0 12px 24px 0 rgba(0, 0, 0, 0.12),
0 4px 12px 0 rgba(0, 0, 0, 0.05);
}

/**
* reset
* https://github.com/atomiks/tippyjs/blob/master/src/scss/index.scss
Expand Down
14 changes: 13 additions & 1 deletion common/utils/dom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,23 @@ const copyToClipboard = (str: string) => {
document.body.removeChild(el)
}

const getAttributes = (name: string, str: string): string[] | [] => {
const re = new RegExp(`${name}="(.*?)"`, 'g')
const matches = []
let match = re.exec(str)
while (match) {
matches.push(match[1])
match = re.exec(str)
}
return matches.filter(m => !!m)
}

export const dom = {
$,
$$,
getWindowHeight,
getWindowWidth,
offset,
copyToClipboard
copyToClipboard,
getAttributes
}
6 changes: 3 additions & 3 deletions common/utils/validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ export const isValidStrictPassword = (password: string): boolean => {
*
* @see https://mattersnews.slack.com/archives/G8877EQMS/p1546446430005500
*/
export const REGEXP_DISPLAY_NAME = /^[A-Za-z0-9\u4E00-\u9FFF\u3400-\u4DFF\uF900-\uFAFF\u2e80-\u33ffh]*$/

export const isValidDisplayName = (name: string): boolean => {
if (
!name ||
Expand All @@ -43,9 +45,7 @@ export const isValidDisplayName = (name: string): boolean => {
) {
return false
}
return /^[A-Za-z0-9\u4E00-\u9FFF\u3400-\u4DFF\uF900-\uFAFF\u2e80-\u33ffh]*$/.test(
name
)
return REGEXP_DISPLAY_NAME.test(name)
}

/**
Expand Down
2 changes: 1 addition & 1 deletion components/ArticleDigest/FeatureDigest/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

.content-container {
position: relative;
margin: -8rem 0 var(--spacing-x-loose) 0;
margin: -7.5rem 0 var(--spacing-x-loose) 0;
padding: 0;
background: var(--color-white);

Expand Down
2 changes: 1 addition & 1 deletion components/CommentDigest/FooterActions/UpvoteButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ const UpvoteButton = ({
optimisticResponse={{
voteComment: {
id: comment.id,
myVote: null,
myVote: 'up',
__typename: 'Comment'
}
}}
Expand Down
3 changes: 0 additions & 3 deletions components/Dropdown/UserList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@ import styles from './styles.css'
const DropdownUserList = ({
users,
onClick,
hideDropdown,
loading
}: {
users: UserDigestBriefDescUser[]
onClick: (user: UserDigestBriefDescUser) => void
hideDropdown: () => void
loading?: boolean
}) => {
if (loading) {
Expand All @@ -40,7 +38,6 @@ const DropdownUserList = ({
type="button"
onClick={() => {
onClick(user)
hideDropdown()
}}
>
<UserDigest.BriefDesc user={user} />
Expand Down
25 changes: 0 additions & 25 deletions components/Editor/CommentEditor/config.ts

This file was deleted.

Loading

0 comments on commit 7029b3e

Please sign in to comment.