Merge pull request woocommerce/woocommerce-admin#166 from woocommerce/try/wp-data-orders

Try wp.data store for orders
This commit is contained in:
Paul Sealock 2018-07-30 11:23:04 +12:00 committed by GitHub
commit ddd5c7acfd
14 changed files with 442 additions and 67 deletions

View File

@ -11,6 +11,7 @@ import PropTypes from 'prop-types';
import ExampleReport from './example'; import ExampleReport from './example';
import RevenueReport from './revenue'; import RevenueReport from './revenue';
import ProductsReport from './products'; import ProductsReport from './products';
import OrdersReport from './orders/';
class Report extends Component { class Report extends Component {
render() { render() {
@ -20,6 +21,8 @@ class Report extends Component {
return <RevenueReport { ...this.props } />; return <RevenueReport { ...this.props } />;
case 'products': case 'products':
return <ProductsReport { ...this.props } />; return <ProductsReport { ...this.props } />;
case 'orders':
return <OrdersReport { ...this.props } />;
default: default:
return <ExampleReport />; return <ExampleReport />;
} }

View File

@ -0,0 +1,95 @@
/** @format */
/**
* External dependencies
*/
import { __ } from '@wordpress/i18n';
import { Component, Fragment, compose } from '@wordpress/element';
import { Button } from '@wordpress/components';
import { withSelect, withDispatch } from '@wordpress/data';
import moment from 'moment';
import { partial } from 'lodash';
/**
* Internal dependencies
*/
import Header from 'layout/header/index';
import Card from 'components/card';
class OrdersReport extends Component {
constructor( props ) {
super( props );
this.toggleStatus = this.toggleStatus.bind( this );
}
toggleStatus( order ) {
const { requestUpdateOrder } = this.props;
const updatedOrder = { ...order };
const status = updatedOrder.status === 'completed' ? 'processing' : 'completed';
updatedOrder.status = status;
requestUpdateOrder( updatedOrder );
}
render() {
const { orders, orderIds } = this.props;
return (
<Fragment>
<Header
sections={ [
[ '/analytics', __( 'Analytics', 'wc-admin' ) ],
__( 'Orders', 'wc-admin' ),
] }
/>
<Card title="Orders">
<table style={ { width: '100%' } }>
<thead>
<tr style={ { textAlign: 'left' } }>
<th>Id</th>
<th>Date</th>
<th>Total</th>
<th>Status</th>
<th>Action</th>
</tr>
</thead>
<tbody>
{ orderIds &&
orderIds.map( id => {
const order = orders[ id ];
return (
<tr key={ id }>
<td>{ id }</td>
<td>{ moment( order.date_created ).format( 'LL' ) }</td>
<td>{ order.total }</td>
<td>{ order.status }</td>
<td>
<Button isPrimary onClick={ partial( this.toggleStatus, order ) }>
Toggle Status
</Button>
</td>
</tr>
);
} ) }
</tbody>
</table>
</Card>
</Fragment>
);
}
}
export default compose(
withSelect( select => {
const { getOrders, getOrderIds } = select( 'wc-admin' );
return {
orders: getOrders(),
orderIds: getOrderIds(),
};
} ),
withDispatch( dispatch => {
return {
requestUpdateOrder: function( updatedOrder ) {
dispatch( 'wc-admin' ).requestUpdateOrder( updatedOrder );
},
};
} )
)( OrdersReport );

View File

@ -13,6 +13,7 @@ import 'react-dates/initialize';
*/ */
import './stylesheets/_wpadmin-reset.scss'; import './stylesheets/_wpadmin-reset.scss';
import { PageLayout } from './layout'; import { PageLayout } from './layout';
import 'store';
render( render(
<APIProvider <APIProvider

View File

@ -0,0 +1,32 @@
/** @format */
/**
* External dependencies
*/
import { registerStore } from '@wordpress/data';
import { combineReducers } from 'redux';
/**
* Internal dependencies
*/
import { applyMiddleware, addThunks } from './middleware';
import orders from 'store/orders';
const store = registerStore( 'wc-admin', {
reducer: combineReducers( {
orders: orders.reducer,
} ),
actions: {
...orders.actions,
},
selectors: {
...orders.selectors,
},
resolvers: {
...orders.resolvers,
},
} );
applyMiddleware( store, [ addThunks ] );

View File

@ -0,0 +1,16 @@
/** @format */
export function applyMiddleware( store, middlewares ) {
middlewares = middlewares.slice();
middlewares.reverse();
let dispatch = store.dispatch;
middlewares.forEach( middleware => ( dispatch = middleware( store )( dispatch ) ) );
return Object.assign( store, { dispatch } );
}
export const addThunks = ( { getState } ) => next => action => {
if ( 'function' === typeof action ) {
return action( getState );
}
return next( action );
};

View File

@ -0,0 +1,42 @@
/** @format */
/**
* External dependencies
*/
import { dispatch } from '@wordpress/data';
import apiRequest from '@wordpress/api-request';
export default {
setOrders( orders ) {
return {
type: 'SET_ORDERS',
orders,
};
},
updateOrder( order ) {
return {
type: 'UPDATE_ORDER',
order,
};
},
requestUpdateOrder( order ) {
return async () => {
// Lets be optimistic
dispatch( 'wc-admin' ).updateOrder( order );
try {
const updatedOrder = await apiRequest( {
path: '/wc/v3/orders/' + order.id,
method: 'PUT',
data: order,
} );
dispatch( 'wc-admin' ).updateOrder( updatedOrder );
} catch ( error ) {
if ( error && error.responseJSON ) {
alert( error.responseJSON.message );
} else {
alert( error );
}
}
};
},
};

View File

@ -0,0 +1,16 @@
/** @format */
/**
* Internal dependencies
*/
import reducer from './reducer';
import actions from './actions';
import selectors from './selectors';
import resolvers from './resolvers';
export default {
reducer,
actions,
selectors,
resolvers,
};

View File

@ -0,0 +1,36 @@
/** @format */
/**
* External dependencies
*/
import { union } from 'lodash';
const DEFAULT_STATE = {
orders: {},
ids: [],
};
export default function ordersReducer( state = DEFAULT_STATE, action ) {
switch ( action.type ) {
case 'SET_ORDERS':
const { orders } = action;
const ids = orders.map( order => order.id );
const ordersMap = orders.reduce( ( map, order ) => {
map[ order.id ] = order;
return map;
}, {} );
return {
...state,
orders: Object.assign( {}, state.orders, ordersMap ),
ids: union( state.ids, ids ),
};
case 'UPDATE_ORDER':
const updatedOrders = { ...state.orders };
updatedOrders[ action.order.id ] = action.order;
return {
...state,
orders: updatedOrders,
};
}
return state;
}

View File

@ -0,0 +1,21 @@
/** @format */
/**
* External dependencies
*/
import { dispatch } from '@wordpress/data';
import apiRequest from '@wordpress/api-request';
export default {
async getOrders() {
try {
const orders = await apiRequest( { path: '/wc/v3/orders' } );
dispatch( 'wc-admin' ).setOrders( orders );
} catch ( error ) {
if ( error && error.responseJSON ) {
alert( error.responseJSON.message );
} else {
alert( error );
}
}
},
};

View File

@ -0,0 +1,10 @@
/** @format */
export default {
getOrders( state ) {
return state.orders.orders;
},
getOrderIds( state ) {
return state.orders.ids;
},
};

View File

@ -83,6 +83,15 @@ function wc_admin_register_pages(){
'wc-admin#/analytics/products', 'wc-admin#/analytics/products',
'wc_admin_page' 'wc_admin_page'
); );
add_submenu_page(
'wc-admin#/analytics',
__( 'Orders', 'wc-admin' ),
__( 'Orders', 'wc-admin' ),
'manage_options',
'wc-admin#/analytics/orders',
'wc_admin_page'
);
} }
add_action( 'admin_menu', 'wc_admin_register_pages' ); add_action( 'admin_menu', 'wc_admin_register_pages' );

View File

@ -1005,6 +1005,15 @@
"jquery": "^3.3.1" "jquery": "^3.3.1"
} }
}, },
"@wordpress/api-request": {
"version": "1.0.0-alpha.3",
"resolved": "https://registry.npmjs.org/@wordpress/api-request/-/api-request-1.0.0-alpha.3.tgz",
"integrity": "sha512-MTGUY0nl0DV5BAcfmEBY7cQz39/q1+opG3RvEOo51Wyc8Ifh03DiPSsQqeS0FxuIOSB47ZehLtN29aZyR78b7A==",
"dev": true,
"requires": {
"jquery": "^3.3.1"
}
},
"@wordpress/babel-plugin-import-jsx-pragma": { "@wordpress/babel-plugin-import-jsx-pragma": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/@wordpress/babel-plugin-import-jsx-pragma/-/babel-plugin-import-jsx-pragma-1.0.1.tgz", "resolved": "https://registry.npmjs.org/@wordpress/babel-plugin-import-jsx-pragma/-/babel-plugin-import-jsx-pragma-1.0.1.tgz",
@ -6174,24 +6183,28 @@
"dependencies": { "dependencies": {
"abbrev": { "abbrev": {
"version": "1.1.1", "version": "1.1.1",
"bundled": true, "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
"integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==",
"dev": true, "dev": true,
"optional": true "optional": true
}, },
"ansi-regex": { "ansi-regex": {
"version": "2.1.1", "version": "2.1.1",
"bundled": true, "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
"integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=",
"dev": true "dev": true
}, },
"aproba": { "aproba": {
"version": "1.2.0", "version": "1.2.0",
"bundled": true, "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz",
"integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==",
"dev": true, "dev": true,
"optional": true "optional": true
}, },
"are-we-there-yet": { "are-we-there-yet": {
"version": "1.1.4", "version": "1.1.4",
"bundled": true, "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.4.tgz",
"integrity": "sha1-u13KOCu5TwXhUZQ3PRb9O6HKEQ0=",
"dev": true, "dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
@ -6201,12 +6214,14 @@
}, },
"balanced-match": { "balanced-match": {
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
"dev": true "dev": true
}, },
"brace-expansion": { "brace-expansion": {
"version": "1.1.11", "version": "1.1.11",
"bundled": true, "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
"dev": true, "dev": true,
"requires": { "requires": {
"balanced-match": "^1.0.0", "balanced-match": "^1.0.0",
@ -6215,34 +6230,40 @@
}, },
"chownr": { "chownr": {
"version": "1.0.1", "version": "1.0.1",
"bundled": true, "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.0.1.tgz",
"integrity": "sha1-4qdQQqlVGQi+vSW4Uj1fl2nXkYE=",
"dev": true, "dev": true,
"optional": true "optional": true
}, },
"code-point-at": { "code-point-at": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true, "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz",
"integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=",
"dev": true "dev": true
}, },
"concat-map": { "concat-map": {
"version": "0.0.1", "version": "0.0.1",
"bundled": true, "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
"dev": true "dev": true
}, },
"console-control-strings": { "console-control-strings": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true, "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz",
"integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=",
"dev": true "dev": true
}, },
"core-util-is": { "core-util-is": {
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
"integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=",
"dev": true, "dev": true,
"optional": true "optional": true
}, },
"debug": { "debug": {
"version": "2.6.9", "version": "2.6.9",
"bundled": true, "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
"dev": true, "dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
@ -6251,25 +6272,29 @@
}, },
"deep-extend": { "deep-extend": {
"version": "0.5.1", "version": "0.5.1",
"bundled": true, "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.5.1.tgz",
"integrity": "sha512-N8vBdOa+DF7zkRrDCsaOXoCs/E2fJfx9B9MrKnnSiHNh4ws7eSys6YQE4KvT1cecKmOASYQBhbKjeuDD9lT81w==",
"dev": true, "dev": true,
"optional": true "optional": true
}, },
"delegates": { "delegates": {
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz",
"integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=",
"dev": true, "dev": true,
"optional": true "optional": true
}, },
"detect-libc": { "detect-libc": {
"version": "1.0.3", "version": "1.0.3",
"bundled": true, "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz",
"integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=",
"dev": true, "dev": true,
"optional": true "optional": true
}, },
"fs-minipass": { "fs-minipass": {
"version": "1.2.5", "version": "1.2.5",
"bundled": true, "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.5.tgz",
"integrity": "sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ==",
"dev": true, "dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
@ -6278,13 +6303,15 @@
}, },
"fs.realpath": { "fs.realpath": {
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
"dev": true, "dev": true,
"optional": true "optional": true
}, },
"gauge": { "gauge": {
"version": "2.7.4", "version": "2.7.4",
"bundled": true, "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz",
"integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=",
"dev": true, "dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
@ -6300,7 +6327,8 @@
}, },
"glob": { "glob": {
"version": "7.1.2", "version": "7.1.2",
"bundled": true, "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz",
"integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==",
"dev": true, "dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
@ -6314,13 +6342,15 @@
}, },
"has-unicode": { "has-unicode": {
"version": "2.0.1", "version": "2.0.1",
"bundled": true, "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz",
"integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=",
"dev": true, "dev": true,
"optional": true "optional": true
}, },
"iconv-lite": { "iconv-lite": {
"version": "0.4.21", "version": "0.4.21",
"bundled": true, "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.21.tgz",
"integrity": "sha512-En5V9za5mBt2oUA03WGD3TwDv0MKAruqsuxstbMUZaj9W9k/m1CV/9py3l0L5kw9Bln8fdHQmzHSYtvpvTLpKw==",
"dev": true, "dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
@ -6329,7 +6359,8 @@
}, },
"ignore-walk": { "ignore-walk": {
"version": "3.0.1", "version": "3.0.1",
"bundled": true, "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.1.tgz",
"integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==",
"dev": true, "dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
@ -6338,7 +6369,8 @@
}, },
"inflight": { "inflight": {
"version": "1.0.6", "version": "1.0.6",
"bundled": true, "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
"dev": true, "dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
@ -6348,18 +6380,21 @@
}, },
"inherits": { "inherits": {
"version": "2.0.3", "version": "2.0.3",
"bundled": true, "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=",
"dev": true "dev": true
}, },
"ini": { "ini": {
"version": "1.3.5", "version": "1.3.5",
"bundled": true, "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz",
"integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==",
"dev": true, "dev": true,
"optional": true "optional": true
}, },
"is-fullwidth-code-point": { "is-fullwidth-code-point": {
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz",
"integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=",
"dev": true, "dev": true,
"requires": { "requires": {
"number-is-nan": "^1.0.0" "number-is-nan": "^1.0.0"
@ -6367,13 +6402,15 @@
}, },
"isarray": { "isarray": {
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=",
"dev": true, "dev": true,
"optional": true "optional": true
}, },
"minimatch": { "minimatch": {
"version": "3.0.4", "version": "3.0.4",
"bundled": true, "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
"dev": true, "dev": true,
"requires": { "requires": {
"brace-expansion": "^1.1.7" "brace-expansion": "^1.1.7"
@ -6381,12 +6418,14 @@
}, },
"minimist": { "minimist": {
"version": "0.0.8", "version": "0.0.8",
"bundled": true, "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
"integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
"dev": true "dev": true
}, },
"minipass": { "minipass": {
"version": "2.2.4", "version": "2.2.4",
"bundled": true, "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.2.4.tgz",
"integrity": "sha512-hzXIWWet/BzWhYs2b+u7dRHlruXhwdgvlTMDKC6Cb1U7ps6Ac6yQlR39xsbjWJE377YTCtKwIXIpJ5oP+j5y8g==",
"dev": true, "dev": true,
"requires": { "requires": {
"safe-buffer": "^5.1.1", "safe-buffer": "^5.1.1",
@ -6395,7 +6434,8 @@
}, },
"minizlib": { "minizlib": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true, "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.1.0.tgz",
"integrity": "sha512-4T6Ur/GctZ27nHfpt9THOdRZNgyJ9FZchYO1ceg5S8Q3DNLCKYy44nCZzgCJgcvx2UM8czmqak5BCxJMrq37lA==",
"dev": true, "dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
@ -6404,7 +6444,8 @@
}, },
"mkdirp": { "mkdirp": {
"version": "0.5.1", "version": "0.5.1",
"bundled": true, "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
"integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
"dev": true, "dev": true,
"requires": { "requires": {
"minimist": "0.0.8" "minimist": "0.0.8"
@ -6412,13 +6453,15 @@
}, },
"ms": { "ms": {
"version": "2.0.0", "version": "2.0.0",
"bundled": true, "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
"dev": true, "dev": true,
"optional": true "optional": true
}, },
"needle": { "needle": {
"version": "2.2.0", "version": "2.2.0",
"bundled": true, "resolved": "https://registry.npmjs.org/needle/-/needle-2.2.0.tgz",
"integrity": "sha512-eFagy6c+TYayorXw/qtAdSvaUpEbBsDwDyxYFgLZ0lTojfH7K+OdBqAF7TAFwDokJaGpubpSGG0wO3iC0XPi8w==",
"dev": true, "dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
@ -6429,7 +6472,8 @@
}, },
"node-pre-gyp": { "node-pre-gyp": {
"version": "0.10.0", "version": "0.10.0",
"bundled": true, "resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.10.0.tgz",
"integrity": "sha512-G7kEonQLRbcA/mOoFoxvlMrw6Q6dPf92+t/l0DFSMuSlDoWaI9JWIyPwK0jyE1bph//CUEL65/Fz1m2vJbmjQQ==",
"dev": true, "dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
@ -6447,7 +6491,8 @@
}, },
"nopt": { "nopt": {
"version": "4.0.1", "version": "4.0.1",
"bundled": true, "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.1.tgz",
"integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=",
"dev": true, "dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
@ -6457,13 +6502,15 @@
}, },
"npm-bundled": { "npm-bundled": {
"version": "1.0.3", "version": "1.0.3",
"bundled": true, "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.0.3.tgz",
"integrity": "sha512-ByQ3oJ/5ETLyglU2+8dBObvhfWXX8dtPZDMePCahptliFX2iIuhyEszyFk401PZUNQH20vvdW5MLjJxkwU80Ow==",
"dev": true, "dev": true,
"optional": true "optional": true
}, },
"npm-packlist": { "npm-packlist": {
"version": "1.1.10", "version": "1.1.10",
"bundled": true, "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.1.10.tgz",
"integrity": "sha512-AQC0Dyhzn4EiYEfIUjCdMl0JJ61I2ER9ukf/sLxJUcZHfo+VyEfz2rMJgLZSS1v30OxPQe1cN0LZA1xbcaVfWA==",
"dev": true, "dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
@ -6473,7 +6520,8 @@
}, },
"npmlog": { "npmlog": {
"version": "4.1.2", "version": "4.1.2",
"bundled": true, "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz",
"integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==",
"dev": true, "dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
@ -6485,18 +6533,21 @@
}, },
"number-is-nan": { "number-is-nan": {
"version": "1.0.1", "version": "1.0.1",
"bundled": true, "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz",
"integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=",
"dev": true "dev": true
}, },
"object-assign": { "object-assign": {
"version": "4.1.1", "version": "4.1.1",
"bundled": true, "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
"integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=",
"dev": true, "dev": true,
"optional": true "optional": true
}, },
"once": { "once": {
"version": "1.4.0", "version": "1.4.0",
"bundled": true, "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
"dev": true, "dev": true,
"requires": { "requires": {
"wrappy": "1" "wrappy": "1"
@ -6504,19 +6555,22 @@
}, },
"os-homedir": { "os-homedir": {
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz",
"integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=",
"dev": true, "dev": true,
"optional": true "optional": true
}, },
"os-tmpdir": { "os-tmpdir": {
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
"integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=",
"dev": true, "dev": true,
"optional": true "optional": true
}, },
"osenv": { "osenv": {
"version": "0.1.5", "version": "0.1.5",
"bundled": true, "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz",
"integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==",
"dev": true, "dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
@ -6526,19 +6580,22 @@
}, },
"path-is-absolute": { "path-is-absolute": {
"version": "1.0.1", "version": "1.0.1",
"bundled": true, "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
"dev": true, "dev": true,
"optional": true "optional": true
}, },
"process-nextick-args": { "process-nextick-args": {
"version": "2.0.0", "version": "2.0.0",
"bundled": true, "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz",
"integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==",
"dev": true, "dev": true,
"optional": true "optional": true
}, },
"rc": { "rc": {
"version": "1.2.7", "version": "1.2.7",
"bundled": true, "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.7.tgz",
"integrity": "sha512-LdLD8xD4zzLsAT5xyushXDNscEjB7+2ulnl8+r1pnESlYtlJtVSoCMBGr30eDRJ3+2Gq89jK9P9e4tCEH1+ywA==",
"dev": true, "dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
@ -6550,7 +6607,8 @@
"dependencies": { "dependencies": {
"minimist": { "minimist": {
"version": "1.2.0", "version": "1.2.0",
"bundled": true, "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
"dev": true, "dev": true,
"optional": true "optional": true
} }
@ -6558,7 +6616,8 @@
}, },
"readable-stream": { "readable-stream": {
"version": "2.3.6", "version": "2.3.6",
"bundled": true, "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
"integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
"dev": true, "dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
@ -6573,7 +6632,8 @@
}, },
"rimraf": { "rimraf": {
"version": "2.6.2", "version": "2.6.2",
"bundled": true, "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz",
"integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==",
"dev": true, "dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
@ -6582,42 +6642,49 @@
}, },
"safe-buffer": { "safe-buffer": {
"version": "5.1.1", "version": "5.1.1",
"bundled": true, "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz",
"integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==",
"dev": true "dev": true
}, },
"safer-buffer": { "safer-buffer": {
"version": "2.1.2", "version": "2.1.2",
"bundled": true, "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
"dev": true, "dev": true,
"optional": true "optional": true
}, },
"sax": { "sax": {
"version": "1.2.4", "version": "1.2.4",
"bundled": true, "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz",
"integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==",
"dev": true, "dev": true,
"optional": true "optional": true
}, },
"semver": { "semver": {
"version": "5.5.0", "version": "5.5.0",
"bundled": true, "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz",
"integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==",
"dev": true, "dev": true,
"optional": true "optional": true
}, },
"set-blocking": { "set-blocking": {
"version": "2.0.0", "version": "2.0.0",
"bundled": true, "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
"integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=",
"dev": true, "dev": true,
"optional": true "optional": true
}, },
"signal-exit": { "signal-exit": {
"version": "3.0.2", "version": "3.0.2",
"bundled": true, "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz",
"integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=",
"dev": true, "dev": true,
"optional": true "optional": true
}, },
"string-width": { "string-width": {
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
"integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
"dev": true, "dev": true,
"requires": { "requires": {
"code-point-at": "^1.0.0", "code-point-at": "^1.0.0",
@ -6627,7 +6694,8 @@
}, },
"string_decoder": { "string_decoder": {
"version": "1.1.1", "version": "1.1.1",
"bundled": true, "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
"dev": true, "dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
@ -6636,7 +6704,8 @@
}, },
"strip-ansi": { "strip-ansi": {
"version": "3.0.1", "version": "3.0.1",
"bundled": true, "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
"integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
"dev": true, "dev": true,
"requires": { "requires": {
"ansi-regex": "^2.0.0" "ansi-regex": "^2.0.0"
@ -6644,13 +6713,15 @@
}, },
"strip-json-comments": { "strip-json-comments": {
"version": "2.0.1", "version": "2.0.1",
"bundled": true, "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz",
"integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=",
"dev": true, "dev": true,
"optional": true "optional": true
}, },
"tar": { "tar": {
"version": "4.4.1", "version": "4.4.1",
"bundled": true, "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.1.tgz",
"integrity": "sha512-O+v1r9yN4tOsvl90p5HAP4AEqbYhx4036AGMm075fH9F8Qwi3oJ+v4u50FkT/KkvywNGtwkk0zRI+8eYm1X/xg==",
"dev": true, "dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
@ -6665,13 +6736,15 @@
}, },
"util-deprecate": { "util-deprecate": {
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
"integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=",
"dev": true, "dev": true,
"optional": true "optional": true
}, },
"wide-align": { "wide-align": {
"version": "1.1.2", "version": "1.1.2",
"bundled": true, "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.2.tgz",
"integrity": "sha512-ijDLlyQ7s6x1JgCLur53osjm/UXUYD9+0PbYKrBsYisYXzCxN+HC3mYDNy/dWdmf3AwqwU3CXwDCvsNgGK1S0w==",
"dev": true, "dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
@ -6680,12 +6753,14 @@
}, },
"wrappy": { "wrappy": {
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
"dev": true "dev": true
}, },
"yallist": { "yallist": {
"version": "3.0.2", "version": "3.0.2",
"bundled": true, "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.2.tgz",
"integrity": "sha1-hFK0u36Dx8GI2AQcGoN8dz1ti7k=",
"dev": true "dev": true
} }
} }
@ -13999,6 +14074,22 @@
} }
} }
}, },
"redux": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/redux/-/redux-4.0.0.tgz",
"integrity": "sha512-NnnHF0h0WVE/hXyrB6OlX67LYRuaf/rJcbWvnHHEPCF/Xa/AZpwhs/20WyqzQae5x4SD2F9nPObgBh2rxAgLiA==",
"requires": {
"loose-envify": "^1.1.0",
"symbol-observable": "^1.2.0"
},
"dependencies": {
"symbol-observable": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.2.0.tgz",
"integrity": "sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ=="
}
}
},
"reflect.ownkeys": { "reflect.ownkeys": {
"version": "0.2.0", "version": "0.2.0",
"resolved": "https://registry.npmjs.org/reflect.ownkeys/-/reflect.ownkeys-0.2.0.tgz", "resolved": "https://registry.npmjs.org/reflect.ownkeys/-/reflect.ownkeys-0.2.0.tgz",

View File

@ -28,6 +28,7 @@
"devDependencies": { "devDependencies": {
"@babel/core": "^7.0.0-beta.54", "@babel/core": "^7.0.0-beta.54",
"@babel/plugin-transform-async-to-generator": "^7.0.0-beta.54", "@babel/plugin-transform-async-to-generator": "^7.0.0-beta.54",
"@wordpress/api-request": "^1.0.0-alpha.3",
"@wordpress/babel-plugin-import-jsx-pragma": "^1.0.1", "@wordpress/babel-plugin-import-jsx-pragma": "^1.0.1",
"@wordpress/babel-plugin-makepot": "^2.0.1", "@wordpress/babel-plugin-makepot": "^2.0.1",
"@wordpress/babel-preset-default": "^2.0.2", "@wordpress/babel-preset-default": "^2.0.2",
@ -86,6 +87,7 @@
"lodash": "^4.17.10", "lodash": "^4.17.10",
"react-dates": "^16.7.0", "react-dates": "^16.7.0",
"react-slot-fill": "^2.0.1", "react-slot-fill": "^2.0.1",
"react-transition-group": "^2.4.0" "react-transition-group": "^2.4.0",
"redux": "^4.0.0"
} }
} }

View File

@ -19,6 +19,7 @@ const externals = {
'@wordpress/html-entities': { this: [ 'wp', 'htmlEntities' ] }, '@wordpress/html-entities': { this: [ 'wp', 'htmlEntities' ] },
'@wordpress/i18n': { this: [ 'wp', 'i18n' ] }, '@wordpress/i18n': { this: [ 'wp', 'i18n' ] },
'@wordpress/keycodes': { this: [ 'wp', 'keycodes' ] }, '@wordpress/keycodes': { this: [ 'wp', 'keycodes' ] },
'@wordpress/api-request': { this: [ 'wp', 'apiRequest' ] },
jquery: 'jQuery', jquery: 'jQuery',
tinymce: 'tinymce', tinymce: 'tinymce',
moment: 'moment', moment: 'moment',