-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into try/jetpack-stories-block-mobile
- Loading branch information
Showing
24 changed files
with
275 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
14 changes: 14 additions & 0 deletions
14
packages/components/src/textarea-control/styles/textarea-control-styles.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import styled from '@emotion/styled'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import { inputControl } from '../../utils/input'; | ||
|
||
export const StyledTextarea = styled.textarea` | ||
width: 100%; | ||
${ inputControl } | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
export default { | ||
huge: '1440px', | ||
wide: '1280px', | ||
'x-large': '1080px', | ||
large: '960px', // admin sidebar auto folds | ||
medium: '782px', // adminbar goes big | ||
small: '600px', | ||
mobile: '480px', | ||
'zoomed-in': '280px', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/** | ||
* Internal dependencies | ||
*/ | ||
import breakpoints from './breakpoint-values'; | ||
|
||
/** | ||
* @param {keyof breakpoints} point | ||
* @return {string} Media query declaration. | ||
*/ | ||
export const breakpoint = ( point ) => | ||
`@media (min-width: ${ breakpoints[ point ] })`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export default { | ||
radiusBlockUi: '2px', | ||
borderWidth: '1px', | ||
borderWidthFocus: '1.5px', | ||
borderWidthTab: '4px', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/** | ||
* Internal dependencies | ||
*/ | ||
import CONFIG from './config-values'; | ||
|
||
/** | ||
* @param {keyof CONFIG} name The variable name | ||
* @return {string} The variable | ||
*/ | ||
export const config = ( name ) => CONFIG[ name ]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,9 @@ | ||
const DEFAULT = { | ||
fontFamily: | ||
export default { | ||
'default.fontFamily': | ||
"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif", | ||
fontSize: '13px', | ||
}; | ||
'default.fontSize': '13px', | ||
|
||
const HELP_TEXT = { | ||
fontSize: '12px', | ||
}; | ||
'helpText.fontSize': '12px', | ||
|
||
export default { | ||
default: DEFAULT, | ||
helpText: HELP_TEXT, | ||
mobileTextMinFontSize: '16px', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import { css } from '@emotion/core'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import { reduceMotion } from '../reduce-motion'; | ||
import { config } from '../config'; | ||
import { color } from '../colors'; | ||
|
||
export const inputStyleNeutral = css` | ||
box-shadow: 0 0 0 transparent; | ||
transition: box-shadow 0.1s linear; | ||
border-radius: ${ config( 'radiusBlockUi' ) }; | ||
border: ${ config( 'borderWidth' ) } solid ${ color( 'ui.border' ) }; | ||
${ reduceMotion( 'transition' ) } | ||
`; | ||
|
||
export const inputStyleFocus = css` | ||
border-color: var( --wp-admin-theme-color ); | ||
box-shadow: 0 0 0 | ||
calc( ${ config( 'borderWidthFocus' ) } - ${ config( 'borderWidth' ) } ) | ||
var( --wp-admin-theme-color ); | ||
// Windows High Contrast mode will show this outline, but not the box-shadow. | ||
outline: 2px solid transparent; | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './input-control'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import { css } from '@emotion/core'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import { inputStyleNeutral, inputStyleFocus } from './base'; | ||
import { font } from '../font'; | ||
import { color } from '../colors'; | ||
import { breakpoint } from '../breakpoint'; | ||
|
||
export const inputControl = css` | ||
font-family: ${ font( 'default.fontFamily' ) }; | ||
padding: 6px 8px; | ||
${ inputStyleNeutral }; | ||
/* Fonts smaller than 16px causes mobile safari to zoom. */ | ||
font-size: ${ font( 'mobileTextMinFontSize' ) }; | ||
/* Override core line-height. To be reviewed. */ | ||
line-height: normal; | ||
${ breakpoint( 'small' ) } { | ||
font-size: ${ font( 'default.fontSize' ) }; | ||
/* Override core line-height. To be reviewed. */ | ||
line-height: normal; | ||
} | ||
&:focus { | ||
${ inputStyleFocus } | ||
} | ||
// Use opacity to work in various editor styles. | ||
&::-webkit-input-placeholder { | ||
color: ${ color( 'darkGray.placeholder' ) }; | ||
} | ||
&::-moz-placeholder { | ||
opacity: 1; // Necessary because Firefox reduces this from 1. | ||
color: ${ color( 'darkGray.placeholder' ) }; | ||
} | ||
&:-ms-input-placeholder { | ||
color: ${ color( 'darkGray.placeholder' ) }; | ||
} | ||
.is-dark-theme & { | ||
&::-webkit-input-placeholder { | ||
color: ${ color( 'lightGray.placeholder' ) }; | ||
} | ||
&::-moz-placeholder { | ||
opacity: 1; // Necessary because Firefox reduces this from 1. | ||
color: ${ color( 'lightGray.placeholder' ) }; | ||
} | ||
&:-ms-input-placeholder { | ||
color: ${ color( 'lightGray.placeholder' ) }; | ||
} | ||
} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
packages/react-native-editor/__device-tests__/gutenberg-editor-unsupported-blocks.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/** | ||
* Internal dependencies | ||
*/ | ||
import EditorPage from './pages/editor-page'; | ||
import { setupDriver, isLocalEnvironment, stopDriver } from './helpers/utils'; | ||
import testData from './helpers/test-data'; | ||
|
||
jest.setTimeout( 1000000 ); | ||
|
||
describe( 'Gutenberg Editor Unsupported Block Editor Tests', () => { | ||
let driver; | ||
let editorPage; | ||
let allPassed = true; | ||
|
||
// Use reporter for setting status for saucelabs Job | ||
if ( ! isLocalEnvironment() ) { | ||
const reporter = { | ||
specDone: async ( result ) => { | ||
allPassed = allPassed && result.status !== 'failed'; | ||
}, | ||
}; | ||
|
||
jasmine.getEnv().addReporter( reporter ); | ||
} | ||
|
||
beforeAll( async () => { | ||
driver = await setupDriver(); | ||
editorPage = new EditorPage( driver ); | ||
} ); | ||
|
||
it( 'should be able to see visual editor', async () => { | ||
await expect( editorPage.getBlockList() ).resolves.toBe( true ); | ||
} ); | ||
|
||
it( 'should be able to open the unsupported block web view editor', async () => { | ||
await editorPage.setHtmlContent( testData.unsupportedBlockHtml ); | ||
|
||
const firstVisibleBlock = await editorPage.getFirstBlockVisible(); | ||
await firstVisibleBlock.click(); | ||
|
||
const helpButton = await editorPage.getUnsupportedBlockHelpButton(); | ||
await helpButton.click(); | ||
|
||
const editButton = await editorPage.getUnsupportedBlockBottomSheetEditButton(); | ||
await editButton.click(); | ||
|
||
await expect( | ||
editorPage.getUnsupportedBlockWebView() | ||
).resolves.toBeTruthy(); | ||
} ); | ||
|
||
afterAll( async () => { | ||
if ( ! isLocalEnvironment() ) { | ||
driver.sauceJobStatus( allPassed ); | ||
} | ||
await stopDriver( driver ); | ||
} ); | ||
} ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.