-
Notifications
You must be signed in to change notification settings - Fork 294
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 9a262cd
Showing
673 changed files
with
129,165 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"presets": [ | ||
[ "@babel/env", { | ||
"useBuiltIns": "entry", | ||
"corejs": 2 | ||
} ], | ||
"@babel/preset-react" | ||
], | ||
"plugins": [ | ||
"@babel/plugin-syntax-dynamic-import", | ||
"@babel/plugin-transform-runtime", | ||
[ | ||
"@wordpress/babel-plugin-makepot", | ||
{ | ||
"output": "languages/translation.pot" | ||
} | ||
] | ||
] | ||
} |
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,16 @@ | ||
root = true | ||
|
||
[*.php] | ||
charset = utf-8 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
indent_style = tab | ||
indent_size = 4 | ||
|
||
[{*.json,*.yml}] | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[*.txt,wp-config-sample.php] | ||
end_of_line = crlf |
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,48 @@ | ||
{ | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:react/recommended", | ||
"wordpress" | ||
], | ||
"parser": "babel-eslint", | ||
"env": { | ||
"browser": true, | ||
"es6": true | ||
}, | ||
"rules": { | ||
"yoda": [ 1 ], | ||
"comma-dangle": [ 0 ], | ||
"indent": [ 1, "tab", { "SwitchCase": 2 } ], | ||
"linebreak-style": [ 1, "unix" ], | ||
"quotes": [ 1, "single" ], | ||
"space-in-parens": [ 1, "always" ], | ||
"object-curly-spacing": [ 1, "always" ], | ||
"no-console": [ 1 ], | ||
"no-alert": [ 1 ], | ||
"camelcase": [ 1 ], | ||
"no-debugger": [ 1 ], | ||
"no-extra-boolean-cast": [ 1 ], | ||
"react/react-in-jsx-scope": [ 0 ], | ||
"react/jsx-curly-spacing": [ 2, { "when": "always", "children": true } ], | ||
"no-unused-vars": [ "error", { "varsIgnorePattern": "React" } ], | ||
"react/prop-types": [ 0 ], | ||
"function-paren-newline": [ "error", "consistent" ], | ||
"array-bracket-spacing": [ "error", "always" ] | ||
}, | ||
"settings": { | ||
"react": { | ||
"version": "16.2.0" | ||
} | ||
}, | ||
"globals": { | ||
"React": true, | ||
"googlesitekit": true, | ||
"googlesitekitAdminbar": true, | ||
"googlesitekitDashboard": true, | ||
"googlesitekitSettings": true, | ||
"lodash": true, | ||
"googlesitekitCurrentModule": true, | ||
"gtag": true, | ||
"process": true | ||
} | ||
} |
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,31 @@ | ||
--- | ||
name: Bug report | ||
about: Create a report to help us improve | ||
|
||
--- | ||
|
||
**Describe the bug** | ||
A clear and concise description of what the bug is. | ||
|
||
**To Reproduce** | ||
Steps to reproduce the behavior: | ||
1. Go to '...' | ||
2. Click on '....' | ||
3. Scroll down to '....' | ||
4. See error | ||
|
||
**Expected behavior** | ||
A clear and concise description of what you expected to happen. | ||
|
||
**Screenshots** | ||
If applicable, add screenshots to help explain your problem. | ||
|
||
**System Information (please complete the following information):** | ||
- PHP Version: | ||
- OS: [e.g. iOS] | ||
- Browser [e.g. chrome, safari] | ||
- Plugin Version [e.g. 22] | ||
- Device: [e.g. iPhone6] | ||
|
||
**Additional context** | ||
- Please add any additional information about the bug. |
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,17 @@ | ||
--- | ||
name: Feature request | ||
about: Suggest an idea for this project | ||
|
||
--- | ||
|
||
**Is your feature request related to a problem? Please describe.** | ||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] | ||
|
||
**Describe the solution you'd like** | ||
A clear and concise description of what you want to happen. | ||
|
||
**Describe alternatives you've considered** | ||
A clear and concise description of any alternative solutions or features you've considered. | ||
|
||
**Additional context** | ||
Add any other context or screenshots about the feature request here. |
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,20 @@ | ||
## Summary | ||
|
||
<!-- Please provide one sentence summarizing the PR, to be used in the changelog. --> | ||
This PR can be summarized in the following changelog entry: | ||
|
||
* | ||
|
||
<!-- Please reference the issue this PR addresses. --> | ||
Addresses issue # | ||
|
||
## Relevant technical choices | ||
<!-- Please describe your changes. --> | ||
|
||
## Checklist: | ||
- [ ] My code is tested and passes existing unit tests. | ||
- [ ] My code has an appropriate set of unit tests which all pass. | ||
- [ ] My code is backward-compatible with WordPress 4.7 and PHP 5.4. | ||
- [ ] My code follows the [WordPress](https://make.wordpress.org/core/handbook/best-practices/coding-standards/) coding standards. | ||
- [ ] My code has proper inline documentation. | ||
- [ ] I have signed the Contributor License Agreement (see <https://cla.developers.google.com/>). |
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,36 @@ | ||
node_modules | ||
bower_components | ||
/vendor | ||
release | ||
composer.lock | ||
phpunit.xml | ||
.idea | ||
npm-debug.log | ||
/dist | ||
/languages | ||
google-site-kit.zip | ||
|
||
# Editors | ||
*.esproj | ||
*.tmproj | ||
*.tmproject | ||
tmtags | ||
.*.sw[a-z] | ||
*.un~ | ||
Session.vim | ||
*.swp | ||
.vscode | ||
|
||
# Mac OSX | ||
.DS_Store | ||
._* | ||
.Spotlight-V100 | ||
.Trashes | ||
|
||
# Windows | ||
Thumbs.db | ||
Desktop.ini | ||
|
||
# Backstop | ||
tests/backstop/html_report/ | ||
tests/backstop/tests/ |
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,2 @@ | ||
// Other addons... | ||
import 'storybook-chrome-screenshot/register'; |
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,17 @@ | ||
import React from 'react'; | ||
import { storiesOf, addDecorator } from '@storybook/react'; | ||
|
||
const GoogleSitekitWrapper = ( storyFn ) => ( | ||
<div className="googlesitekit-plugin"> | ||
{ storyFn() } | ||
</div> | ||
) | ||
addDecorator( GoogleSitekitWrapper ); | ||
|
||
storiesOf( 'Example Component', module ) | ||
.add( 'Name of Variation', () => ( | ||
<ExampleComponent props={} /> | ||
) ) | ||
.add( 'Name of Another Variation', () => ( | ||
<ExampleComponent props={} /> | ||
) ); |
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 @@ | ||
import '@storybook/addon-viewport/register'; |
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,100 @@ | ||
import React from 'react'; | ||
import { addDecorator, configure } from '@storybook/react'; | ||
import { | ||
Component, | ||
createRef, | ||
Fragment, | ||
createElement, | ||
} from '@wordpress/element'; | ||
import { | ||
withFilters, | ||
} from '@wordpress/components'; | ||
import { __, sprintf, setLocaleData } from '@wordpress/i18n'; | ||
import { | ||
getQueryString, | ||
addQueryArgs, | ||
} from '@wordpress/url'; | ||
import lodash from 'lodash'; | ||
import { | ||
addFilter, | ||
removeFilter, | ||
addAction, | ||
doAction, | ||
applyFilters, | ||
removeAction, | ||
removeAllFilters, | ||
} from '@wordpress/hooks'; | ||
import '../dist/assets/css/wpdashboard.css'; | ||
import '../dist/assets/css/adminbar.css'; | ||
import '../dist/assets/css/admin.css'; | ||
import '../vendor/johnpbloch/wordpress-core/wp-admin/css/common.css'; | ||
import '../vendor/johnpbloch/wordpress-core/wp-admin/css/dashboard.css'; | ||
import '../vendor/johnpbloch/wordpress-core/wp-admin/css/edit.css'; | ||
import '../vendor/johnpbloch/wordpress-core/wp-admin/css/forms.css'; | ||
import { googlesitekit as dashboardData } from '../.storybook/data/wp-admin-admin.php-page=googlesitekit-dashboard-googlesitekit'; | ||
|
||
// Default Data. | ||
let googlesitekit = dashboardData; | ||
|
||
// Setup. | ||
window.wp = window.wp || {}; | ||
wp.element = wp.element || {}; | ||
wp.components = wp.components || {}; | ||
wp.i18n = wp.i18n || {}; | ||
wp.hooks = wp.hooks || {}; | ||
wp.url = { | ||
getQueryString, | ||
addQueryArgs, | ||
}; | ||
wp.hooks.addFilter = addFilter; | ||
wp.hooks.removeFilter = removeFilter; | ||
wp.hooks.addAction = addAction; | ||
wp.hooks.doAction = doAction; | ||
wp.hooks.applyFilters = applyFilters; | ||
wp.hooks.removeAction = removeAction; | ||
wp.hooks.removeAllFilters = removeAllFilters; | ||
wp.element.Component = Component; | ||
wp.element.createRef = createRef; | ||
wp.element.Fragment = Fragment; | ||
wp.element.createElement = createElement; | ||
wp.components.withFilters = withFilters; | ||
window.lodash = lodash; | ||
wp.i18n.__ = __ || {}; | ||
wp.i18n.setLocaleData = setLocaleData || {}; | ||
wp.i18n.sprintf = sprintf || {}; | ||
window.React = React; | ||
window.lodash = lodash; | ||
window.googlesitekit = window.googlesitekit || googlesitekit; | ||
window.googlesitekit.setup = window.googlesitekit.setup || googlesitekit.setup; | ||
window.googlesitekit.admin = window.googlesitekit.admin || googlesitekit.admin; | ||
window.googlesitekit.modules = window.googlesitekit.modules || googlesitekit.modules; | ||
window.googlesitekit.admin.assetsRoot = '/assets/'; | ||
window.googlesitekit.isStorybook = true; | ||
wp.apiFetch = () => { | ||
return { | ||
then: () => { | ||
return { | ||
catch: () => false | ||
}; | ||
}, | ||
}; | ||
}; | ||
wp.sanitize = { | ||
stripTags: function( s ) { return s; } | ||
}; | ||
|
||
// Global Decorator. | ||
addDecorator( story => <div className="googlesitekit-plugin-preview"> | ||
<div className="googlesitekit-plugin">{ story() }</div> | ||
</div> ); | ||
|
||
const req = require.context( '../stories', true, /\.stories\.js$/ ); | ||
|
||
function loadStories() { | ||
req.keys().forEach( ( filename ) => req( filename ) ); | ||
} | ||
|
||
configure( loadStories, module ); | ||
|
||
// TODO Would be nice if this wrote to a file. This logs our Storybook data to the browser console. Currently it gets put in .storybook/storybook-data and used in tests/backstop/scenarios.js. | ||
console.log( '__STORYBOOK_CLIENT_API__.raw()', __STORYBOOK_CLIENT_API__.raw() ); |
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
.storybook/data/wp-admin-admin.php-page=googlesitekit-dashboard-googlesitekit.js
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.