diff --git a/data/index.js b/data/index.js index d125769efd977..ef5fabae96243 100644 --- a/data/index.js +++ b/data/index.js @@ -2,7 +2,15 @@ * External dependencies */ import { createStore, combineReducers } from 'redux'; -import { flowRight } from 'lodash'; +import { flowRight, merge } from 'lodash'; +import { ApolloLink, Observable, execute as executeLink } from 'apollo-link'; +import { execute } from 'graphql'; +import { makeExecutableSchema } from 'graphql-tools'; + +/** + * Internal dependencies + */ +import createQueryHigherOrderComponent from './query'; /** * Module constants @@ -32,3 +40,61 @@ export const subscribe = store.subscribe; export const dispatch = store.dispatch; export const getState = store.getState; + +const schemas = [ ` + type Query { + hello: String + } +` ]; + +const resolvers = [ { + Query: { hello: () => 'dolly' }, +} ]; + +let schema = makeExecutableSchema( { + typeDefs: schemas[ 0 ], + resolvers: resolvers[ 0 ], +} ); + +/** + * Registers a sub GraphQL schema + * + * @param {String} registeredSchema The GraphQL schema to register + * @param {Object} registeredResolver The GraphQL resolver to register for this schema + */ +export function registerSchema( registeredSchema, registeredResolver ) { + schemas.push( registeredSchema ); + resolvers.push( registeredResolver ); + schema = makeExecutableSchema( { + typeDefs: schemas, + resolvers: merge( ...resolvers ), + } ); +} + +const graphLink = new ApolloLink( ( operation ) => { + return new Observable( observer => { + return store.subscribe( () => { + const result = execute( + schema, + operation.query, + null, + { state: store.getState() }, + operation.variables, + operation.operationName + ); + if ( result.data || result.errors ) { + observer.next( result ); + } else { + result.then( observer.next.bind( observer ) ); + } + } ); + } ); +} ); + +const client = { + query: ( operation ) => { + return executeLink( graphLink, operation ); + }, +}; + +export const query = createQueryHigherOrderComponent( client ); diff --git a/data/query.js b/data/query.js new file mode 100644 index 0000000000000..15fd33c3006fe --- /dev/null +++ b/data/query.js @@ -0,0 +1,66 @@ +/** + * External Dependencies + */ +import { isFunction } from 'lodash'; + +/** + * WordPress Dependencies + */ +import { Component } from '@wordpress/element'; + +const createQueryHigherOrderComponent = ( client ) => ( mapPropsToQuery, mapPropsToVariables = () => ( {} ) ) => ( WrappedComponent ) => { + return class GraphQueryComponent extends Component { + constructor() { + super( ...arguments ); + this.state = { + data: null, errors: null, + }; + } + + componentDidMount() { + this.buildQuery( this.props ); + this.request(); + } + + componentWillUnmount() { + this.cancelRequest(); + } + + componentWillReceiveProps( newProps ) { + this.buildQuery( newProps ); + this.request(); + } + + buildQuery( props ) { + if ( isFunction( mapPropsToQuery ) ) { + this.query = mapPropsToQuery( props ); + } else { + this.query = mapPropsToQuery; + } + this.variables = mapPropsToVariables( props ); + } + + cancelRequest() { + if ( this.unsubscribe ) { + this.unsubscribe(); + } + } + + request() { + this.cancelRequest(); + const query = client.query( { query: this.query, variables: this.variables } ); + const observer = query.subscribe( ( results ) => { + this.setState( results ); + } ); + this.unsubscribe = observer.unsubscribe; + } + + render() { + return ( + + ); + } + }; +}; + +export default createQueryHigherOrderComponent; diff --git a/editor/store/data.js b/editor/store/data.js new file mode 100644 index 0000000000000..e20228767c376 --- /dev/null +++ b/editor/store/data.js @@ -0,0 +1,35 @@ +/** + * Internal Dependencies + */ +import { getEditedPostTitle } from './selectors'; + +export const schema = ` + type CoreEditedPost { + title: String + } + + type CoreEditor { + post: CoreEditedPost + } + + extend type Query { + editor: CoreEditor + } +`; + +export const resolver = { + Query: { + editor: ( _, args, context ) => ( { + post: () => ( { + title() { + const state = context.state[ 'core/editor' ]; + return getEditedPostTitle( state ); + }, + } ), + } ), + }, + + CoreEditor: editor => editor, + + CoreEditedPost: post => post, +}; diff --git a/editor/store/index.js b/editor/store/index.js index 8bab19dea5ff5..a7f21a3eda949 100644 --- a/editor/store/index.js +++ b/editor/store/index.js @@ -1,7 +1,7 @@ /** * WordPress Dependencies */ -import { registerReducer } from '@wordpress/data'; +import { registerReducer, registerSchema } from '@wordpress/data'; /** * Internal dependencies @@ -11,6 +11,7 @@ import reducer from './reducer'; import { withRehydratation, loadAndPersist } from './persist'; import enhanceWithBrowserSize from './browser'; import store from './store'; +import { schema, resolver } from './data'; /** * Module Constants @@ -18,6 +19,7 @@ import store from './store'; const STORAGE_KEY = `GUTENBERG_PREFERENCES_${ window.userSettings.uid }`; registerReducer( 'core/editor', withRehydratation( reducer, 'preferences' ) ); +registerSchema( schema, resolver ); loadAndPersist( store, 'preferences', STORAGE_KEY, PREFERENCES_DEFAULTS ); enhanceWithBrowserSize( store ); diff --git a/lib/client-assets.php b/lib/client-assets.php index 31507acc2d493..b9f2722fd394f 100644 --- a/lib/client-assets.php +++ b/lib/client-assets.php @@ -79,7 +79,7 @@ function gutenberg_register_scripts_and_styles() { wp_register_script( 'wp-data', gutenberg_url( 'data/build/index.js' ), - array(), + array( 'wp-element' ), filemtime( gutenberg_dir_path() . 'data/build/index.js' ) ); wp_register_script( diff --git a/package-lock.json b/package-lock.json index 3b094378eea0a..c60c7cd0ca9d0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -179,6 +179,12 @@ "postcss": "5.2.18" } }, + "@types/async": { + "version": "2.0.45", + "resolved": "https://registry.npmjs.org/@types/async/-/async-2.0.45.tgz", + "integrity": "sha512-Gul4iUqYqrQQypJpwjqR24dcgJAAjvwncznGBGrINmcz73eHLWkmE8/YGAo4Dr0ADKBCBlkA+f58plzFIh6XAA==", + "optional": true + }, "@types/autosize": { "version": "3.0.6", "resolved": "https://registry.npmjs.org/@types/autosize/-/autosize-3.0.6.tgz", @@ -208,10 +214,15 @@ "resolved": "https://registry.npmjs.org/@types/react/-/react-15.6.7.tgz", "integrity": "sha512-HMfRuwiTp7/MfjPOsVlvlduouJH3haDzjc0oXqZy3ZMn3OTl3i4gGgbxsqzA/u9gNyl/oKkwOrU2oVR6vG5SAw==" }, + "@types/zen-observable": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/@types/zen-observable/-/zen-observable-0.5.3.tgz", + "integrity": "sha512-aDvGDAHcVfUqNmd8q4//cHAP+HGxsbChbBbuk3+kMVk5TTxfWLpQWvVN3+UPjohLnwMYN7jr6BWNn2cYNqdm7g==" + }, "@wordpress/a11y": { "version": "0.1.0-beta.1", "resolved": "https://registry.npmjs.org/@wordpress/a11y/-/a11y-0.1.0-beta.1.tgz", - "integrity": "sha512-fQ32qTaXp5Syg1csYe4qRCgErfREoZ95hbCl6b4Xky/Pwts7M5LkDdEDFL6/OFIBhqoVxuoVY07m0bAZfgFwqw==", + "integrity": "sha1-z0HNWwWkh9yc/IPtdZ39tX7ATVc=", "requires": { "@wordpress/dom-ready": "0.1.0-beta.6" } @@ -229,7 +240,7 @@ "@wordpress/url": { "version": "0.1.0-beta.1", "resolved": "https://registry.npmjs.org/@wordpress/url/-/url-0.1.0-beta.1.tgz", - "integrity": "sha512-vvP38dkX09ANuf6Ktwx8+BXODJkrqNUj5axhAZue5xKaayBSZe0o40u7uUs5hrwoueL6svnv16qXj5qr0ZLeiw==" + "integrity": "sha1-D6UMnp1dnWqShnvShFIvs3rVfNI=" }, "abab": { "version": "1.0.4", @@ -350,13 +361,59 @@ "anymatch": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.2.tgz", - "integrity": "sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA==", + "integrity": "sha1-VT3Lj5HjyImEXf26NMd3IbkLnXo=", "dev": true, "requires": { "micromatch": "2.3.11", "normalize-path": "2.1.1" } }, + "apollo-cache": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/apollo-cache/-/apollo-cache-1.0.2.tgz", + "integrity": "sha512-VolOQhSlS9LNjAJP2QjEw0c8dDBZ47rqbeu/ygA3DabCdY/cTGOeybpBHmFePHA7ZzOE6+2EPxIhGmTRIZhS7A==", + "requires": { + "apollo-utilities": "1.0.3" + } + }, + "apollo-client": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/apollo-client/-/apollo-client-2.0.4.tgz", + "integrity": "sha512-xkm6VbzKZoIfzsGLCOQTJ56PnPFtKpzDzzQuROAF2bsqDI7kq7Z24SF7wadwxiFlAEzjrLNyzHcTHa9yllD+Bg==", + "requires": { + "@types/async": "2.0.45", + "@types/zen-observable": "0.5.3", + "apollo-cache": "1.0.2", + "apollo-link": "1.0.6", + "apollo-link-dedup": "1.0.4", + "apollo-utilities": "1.0.3", + "symbol-observable": "1.1.0", + "zen-observable": "0.6.0" + } + }, + "apollo-link": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/apollo-link/-/apollo-link-1.0.6.tgz", + "integrity": "sha512-g/rEC0LeQv+T3gFcIpOuV3o/xC6eF7Rf2fttty2E8KanfkNn82cj19hiULZvcdIpmWGWmWE38AlNdxfY0ce3qg==", + "requires": { + "@types/zen-observable": "0.5.3", + "apollo-utilities": "1.0.3", + "zen-observable": "0.6.0" + } + }, + "apollo-link-dedup": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/apollo-link-dedup/-/apollo-link-dedup-1.0.4.tgz", + "integrity": "sha512-RtqPY8o+JNwTXiYAdNSGwEwfQWWlQ4n8dofNoGSBRHZnP8n8UL9MZ0kDV6VTiKl/LennGMPtWVbDaz4tIgnK6w==", + "requires": { + "apollo-link": "1.0.6" + } + }, + "apollo-utilities": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/apollo-utilities/-/apollo-utilities-1.0.3.tgz", + "integrity": "sha512-wNKf0GAXfvnmZFYVl1YIzZ6LDSUe+zo4SKd2kbzi7YquNZUuSwJnG1FfEphvfwRRTI2dnpcGZEq26I7uUBrWNw==" + }, "append-transform": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-0.4.0.tgz", @@ -426,7 +483,7 @@ "arr-flatten": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "integrity": "sha1-NgSLv/TntH4TZkQxbJlmnqWukfE=", "dev": true }, "array-equal": { @@ -1231,7 +1288,7 @@ "babel-preset-env": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/babel-preset-env/-/babel-preset-env-1.6.0.tgz", - "integrity": "sha512-OVgtQRuOZKckrILgMA5rvctvFZPv72Gua9Rt006AiPoB0DJKGN07UmaQA+qRrYgK71MVct8fFhT0EyNWYorVew==", + "integrity": "sha1-LeHHgqeAoKXWBdGZyVdZbaQ8ROQ=", "dev": true, "requires": { "babel-plugin-check-es2015-constants": "6.22.0", @@ -1374,7 +1431,7 @@ "babylon": { "version": "6.18.0", "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz", - "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==", + "integrity": "sha1-ry87iPpvXB5MY00aD46sT1WzleM=", "dev": true }, "balanced-match": { @@ -1843,7 +1900,7 @@ "circular-json": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz", - "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==", + "integrity": "sha1-gVyZ6oT2gJUp0vRXkb34JxE1LWY=", "dev": true }, "clap": { @@ -2257,7 +2314,7 @@ "cosmiconfig": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-2.2.2.tgz", - "integrity": "sha512-GiNXLwAFPYHy25XmTPpafYvn3CLAkJ8FLsscq78MQd1Kh0OU6Yzhn4eV2MVF4G9WEQZoWEGltatdR+ntGPMl5A==", + "integrity": "sha1-YXPOvVb6wELB9DkO33r2wHx8uJI=", "dev": true, "requires": { "is-directory": "0.3.1", @@ -2336,7 +2393,7 @@ "lru-cache": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.1.tgz", - "integrity": "sha512-q4spe4KTfsAS1SUHLO0wz8Qiyf1+vMIAgpRYioFYDMNqKfHQbg+AVDH3i4fvpl71/P1L0dBl+fQi+P37UYf0ew==", + "integrity": "sha1-Yi4y6CSItJJ5EUpPns9F581rulU=", "requires": { "pseudomap": "1.0.2", "yallist": "2.1.2" @@ -2714,6 +2771,11 @@ "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", "dev": true }, + "deprecated-decorator": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/deprecated-decorator/-/deprecated-decorator-0.1.6.tgz", + "integrity": "sha1-AJZjF7ehL+kvPMgx91g68ym4bDc=" + }, "des.js": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.0.tgz", @@ -2855,7 +2917,7 @@ "editorconfig": { "version": "0.13.3", "resolved": "https://registry.npmjs.org/editorconfig/-/editorconfig-0.13.3.tgz", - "integrity": "sha512-WkjsUNVCu+ITKDj73QDvi0trvpdDWdkDyHybDGSXPfekLCqwmpD7CP7iPbvBgosNuLcI96XTDwNa75JyFl7tEQ==", + "integrity": "sha1-5SGeWHlR1glY/ZTqmpoAjN7/GzQ=", "requires": { "bluebird": "3.5.1", "commander": "2.12.2", @@ -2899,7 +2961,7 @@ "emoji-regex": { "version": "6.5.1", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-6.5.1.tgz", - "integrity": "sha512-PAHp6TxrCy7MGMFidro8uikr+zlJJKJ/Q6mm2ExZ7HwkyR9lSVFfE3kt36qcwa24BQL7y0G9axycGjK1A/0uNQ==", + "integrity": "sha1-m66pKbFVVlwR6kHGYm6qZc75ksI=", "dev": true }, "emojis-list": { @@ -3437,7 +3499,7 @@ "esprima": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz", - "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==", + "integrity": "sha1-RJnt3NERDgshi6zy+n9/WfVcqAQ=", "dev": true }, "esquery": { @@ -4847,7 +4909,7 @@ "function.prototype.name": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.0.3.tgz", - "integrity": "sha1-AJmuVXLp3W8DyX0CP9krzF5jnqw=", + "integrity": "sha512-5EblxZUdioXi2JiMZ9FUbwYj40eQ9MFHyzFLBSPdlRl3SO8l7SLWuAnQ/at/1Wi4hjJwME/C5WpF2ZfAc8nGNw==", "dev": true, "requires": { "define-properties": "1.1.2", @@ -4944,7 +5006,7 @@ "gettext-parser": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/gettext-parser/-/gettext-parser-1.3.0.tgz", - "integrity": "sha512-iloxjcw+uTPnQ8DrGICWtqkHNgk3mAiDI77pLmXQCnhM+BxFQXstzTA4zj3EpIYMysRQnnNzHyHzBUEazz80Sw==", + "integrity": "sha1-YUZYUcJm+FIbpp5h71BapU9jXQo=", "dev": true, "requires": { "encoding": "0.1.12", @@ -4954,7 +5016,7 @@ "glob": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "integrity": "sha1-wZyd+aAocC1nhhI4SmVSQExjbRU=", "dev": true, "requires": { "fs.realpath": "1.0.0", @@ -4996,7 +5058,7 @@ "globals": { "version": "9.18.0", "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", - "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", + "integrity": "sha1-qjiWs+abSH8X4x7SFD1pqOMMLYo=", "dev": true }, "globby": { @@ -5037,6 +5099,29 @@ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=" }, + "graphql": { + "version": "0.12.3", + "resolved": "https://registry.npmjs.org/graphql/-/graphql-0.12.3.tgz", + "integrity": "sha512-Hn9rdu4zacplKXNrLCvR8YFiTGnbM4Zw/UH8FDmzBDsH7ou40lSNH4tIlsxcYnz2TGNVJCpu1WxCM23yd6kzhA==", + "requires": { + "iterall": "1.1.3" + } + }, + "graphql-tag": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/graphql-tag/-/graphql-tag-2.6.0.tgz", + "integrity": "sha1-D7G59tZlEmPEejQg6CeRDm/tOVI=" + }, + "graphql-tools": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/graphql-tools/-/graphql-tools-2.14.0.tgz", + "integrity": "sha512-1MoTjyQ1wzWzspxrEVgDeoBTBTsX5RLbFfyvdhFfDB5LrYGhud/XXsz+iHvod5Z97H4vpvg9Ax+HLYIeApUyKQ==", + "requires": { + "apollo-utilities": "1.0.3", + "deprecated-decorator": "0.1.6", + "uuid": "3.1.0" + } + }, "growly": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/growly/-/growly-1.3.0.tgz", @@ -5183,7 +5268,7 @@ "hosted-git-info": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.5.0.tgz", - "integrity": "sha512-pNgbURSuab90KbTqvRPsseaTxOJCZBD0a7t+haSN33piP9cCM4l0CqdzAif2hUqm716UovKB2ROmiabGAKVXyg==" + "integrity": "sha1-bWDjSzq7yDEwYsO3mO+NkBoHrzw=" }, "hpq": { "version": "1.2.0", @@ -5608,7 +5693,7 @@ "is-plain-object": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "integrity": "sha1-LBY7P6+xtgbZ0Xko8FwqHDjgdnc=", "dev": true, "requires": { "isobject": "3.0.1" @@ -5755,7 +5840,7 @@ "istanbul-lib-coverage": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-1.1.1.tgz", - "integrity": "sha512-0+1vDkmzxqJIn5rcoEqapSB4DmPxE31EtI2dF2aCkV5esN9EWHxZ0dwgDClivMXJqE7zaYQxq30hj5L0nlTN5Q==", + "integrity": "sha1-c7+5mIhSmUFck9OKPprfeEp3qdo=", "dev": true }, "istanbul-lib-hook": { @@ -5827,6 +5912,11 @@ "handlebars": "4.0.11" } }, + "iterall": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/iterall/-/iterall-1.1.3.tgz", + "integrity": "sha512-Cu/kb+4HiNSejAPhSaN1VukdNTTi/r4/e+yykqjlG/IW+1gZH5b4+Bq3whDX4tvbYugta3r8KTMUiqT3fIGxuQ==" + }, "jed": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/jed/-/jed-1.1.1.tgz", @@ -7473,7 +7563,7 @@ "memize": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/memize/-/memize-1.0.4.tgz", - "integrity": "sha512-S3vLa1noiP99NeP3z3am1ElEYUnTbcDZXBW1N0+diQYVR2ONUeDXRZ1z4s+Wyac+SBHtvJCsgos+ehnVUv/bTA==" + "integrity": "sha1-2Ty9Clu4AF3Cqr0Gw+zRnCQXoJU=" }, "memory-fs": { "version": "0.4.1", @@ -7646,7 +7736,7 @@ "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "integrity": "sha1-UWbihkV/AzBgZL5Ul+jbsMPTIIM=", "requires": { "brace-expansion": "1.1.8" } @@ -7860,7 +7950,7 @@ "lru-cache": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.1.tgz", - "integrity": "sha512-q4spe4KTfsAS1SUHLO0wz8Qiyf1+vMIAgpRYioFYDMNqKfHQbg+AVDH3i4fvpl71/P1L0dBl+fQi+P37UYf0ew==", + "integrity": "sha1-Yi4y6CSItJJ5EUpPns9F581rulU=", "dev": true, "requires": { "pseudomap": "1.0.2", @@ -7890,7 +7980,7 @@ "normalize-package-data": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", - "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", + "integrity": "sha1-EvlaMH1YNSB1oEkHuErIvpisAS8=", "requires": { "hosted-git-info": "2.5.0", "is-builtin-module": "1.0.0", @@ -7936,7 +8026,7 @@ "npmlog": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", - "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", + "integrity": "sha1-CKfyqL9zRgR3mp76StXMcXq7lUs=", "dev": true, "requires": { "are-we-there-yet": "1.1.4", @@ -8296,7 +8386,7 @@ "pegjs-loader": { "version": "0.5.4", "resolved": "https://registry.npmjs.org/pegjs-loader/-/pegjs-loader-0.5.4.tgz", - "integrity": "sha512-ViH8WwUkc/N8H59zuarORrgCi7uxn+gDIq+Ydriw1GFJi/oUg2xvhsgDDujO6dAxRsxXMgqWESx6TKYIqHorqA==", + "integrity": "sha1-OSHta0VOgtNgKbiWzsb4psL2sJg=", "dev": true, "requires": { "loader-utils": "0.2.17" @@ -8852,7 +8942,7 @@ "promise": { "version": "7.3.1", "resolved": "https://registry.npmjs.org/promise/-/promise-7.3.1.tgz", - "integrity": "sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg==", + "integrity": "sha1-BktyYCsY+Q8pGSuLG8QY/9Hr078=", "requires": { "asap": "2.0.6" } @@ -8982,7 +9072,7 @@ "randomatic": { "version": "1.1.7", "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.7.tgz", - "integrity": "sha512-D5JUjPyJbaJDkuAazpVnSfVkLlpeO3wDlPROTMLGKG1zMFNFRgrciKo1ltz/AzNTkqE0HzDx655QOL51N06how==", + "integrity": "sha1-x6vpzIuHwLqodrGf3oP9RkeX44w=", "dev": true, "requires": { "is-number": "3.0.0", @@ -9097,7 +9187,7 @@ "react-color": { "version": "2.13.4", "resolved": "https://registry.npmjs.org/react-color/-/react-color-2.13.4.tgz", - "integrity": "sha512-rNJTTxMPTImI1NpFaKLggDIvHgKOYRXj0krVh8c+Mo1YNsrLko8O94yiFqqdnSQgtIPteiAcGEJgBo9V5+uqaw==", + "integrity": "sha1-Q/HMXgtjrDfJuxkqO9zmWxUfbDU=", "requires": { "lodash": "4.17.4", "material-colors": "1.2.5", @@ -9189,7 +9279,7 @@ "react-redux": { "version": "5.0.6", "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-5.0.6.tgz", - "integrity": "sha512-8taaaGu+J7PMJQDJrk/xiWEYQmdo3mkXw6wPr3K3LxvXis3Fymiq7c13S+Tpls/AyNUAsoONkU81AP0RA6y6Vw==", + "integrity": "sha1-I+06T5hjWdaLUhLqqmgeYNZXSUY=", "requires": { "hoist-non-react-statics": "2.3.1", "invariant": "2.2.2", @@ -9256,7 +9346,7 @@ "readable-stream": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz", - "integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==", + "integrity": "sha1-No8lEtefnUb9/HE0mueHi7weuVw=", "dev": true, "requires": { "core-util-is": "1.0.2", @@ -9338,7 +9428,7 @@ "redux": { "version": "3.7.2", "resolved": "https://registry.npmjs.org/redux/-/redux-3.7.2.tgz", - "integrity": "sha512-pNqnf9q1hI5HHZRBkj3bAngGZW/JMCmexDlOxw4XagXY2o1327nHH54LoTjiPJ0gizoqPDRqWyX/00g0hD6w+A==", + "integrity": "sha1-BrcxIyFZAdJdBlvjQusCa8HIU3s=", "requires": { "lodash": "4.17.4", "lodash-es": "4.17.4", @@ -9359,7 +9449,7 @@ "refx": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/refx/-/refx-2.1.0.tgz", - "integrity": "sha512-E3+04cMfJkrnDb8LQVA68nn070NKXpU5Lkl0WPEM6x+RWoH2vCTDBJQjl04UV2ix//TEQDVoZoQ0FJTpksa+Dw==" + "integrity": "sha1-4iZoMQRuzOiRNYPfixdiezrHN74=" }, "regenerate": { "version": "1.3.3", @@ -9376,7 +9466,7 @@ "regenerator-transform": { "version": "0.10.1", "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.10.1.tgz", - "integrity": "sha512-PJepbvDbuK1xgIgnau7Y90cwaAmO/LCLMI2mPvaXq2heGMR3aWW5/BQvYrhJ8jgmQjXewXvBjzfqKcVOmhjZ6Q==", + "integrity": "sha1-HkmWg3Ix2ot/PPQRTXG1aRoGgN0=", "dev": true, "requires": { "babel-runtime": "6.26.0", @@ -9430,7 +9520,7 @@ "rememo": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/rememo/-/rememo-2.3.3.tgz", - "integrity": "sha512-dI1p0g5OveyMEcjcPiccg6y20AhPLAjDJBCqKpjuORVDXTALg5fA8OIzWm7m/RrGi+QLUG8T8hoKZLY0OBk2IA==", + "integrity": "sha1-z5mWFwt2WUBVgYodrw+VPz2m8qU=", "requires": { "shallow-equal": "1.0.0" } @@ -9738,7 +9828,7 @@ "safe-buffer": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", - "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==", + "integrity": "sha1-iTMSr2myEj3vcfV4iQAWce6yyFM=", "dev": true }, "sane": { @@ -9898,7 +9988,7 @@ "sass-loader": { "version": "6.0.6", "resolved": "https://registry.npmjs.org/sass-loader/-/sass-loader-6.0.6.tgz", - "integrity": "sha512-c3/Zc+iW+qqDip6kXPYLEgsAu2lf4xz0EZDplB7EmSUMda12U1sGJPetH55B/j9eu0bTtKzKlNPWWyYC7wFNyQ==", + "integrity": "sha1-6dXmwfFV+qMqSybXqbcQfCJeQPk=", "dev": true, "requires": { "async": "2.6.0", @@ -9989,7 +10079,7 @@ "semver": { "version": "5.4.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", - "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==" + "integrity": "sha1-4FnAnYVx8FQII3M0M1BdOi8AsY4=" }, "set-blocking": { "version": "2.0.0", @@ -10126,7 +10216,7 @@ "source-list-map": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.0.tgz", - "integrity": "sha512-I2UmuJSRr/T8jisiROLU3A3ltr+swpniSmNPI4Ml3ZCX6tVnDsuZzK7F2hl5jTqbZBWCEKlj5HRQiPExXLgE8A==", + "integrity": "sha1-qqR0A/eyRakvvJfqCPJQ1gh+0IU=", "dev": true }, "source-map": { @@ -10319,7 +10409,7 @@ "string_decoder": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", - "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "integrity": "sha1-D8Z9fBQYJd6UKC3VNr7GubzoYKs=", "dev": true, "requires": { "safe-buffer": "5.1.1" @@ -10531,7 +10621,7 @@ "test-exclude": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-4.1.1.tgz", - "integrity": "sha512-35+Asrsk3XHJDBgf/VRFexPgh3UyETv8IAn/LRTiZjVy6rjPVqdEk8dJcJYBzl1w0XCJM48lvTy8SfEsCWS4nA==", + "integrity": "sha1-TYSWSwlmsAh+zDNKLOAC09k0HiY=", "dev": true, "requires": { "arrify": "1.0.1", @@ -10633,7 +10723,7 @@ "tiny-emitter": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/tiny-emitter/-/tiny-emitter-2.0.2.tgz", - "integrity": "sha512-2NM0auVBGft5tee/OxP4PI3d8WItkDM+fPnaRAVo6xTDI2knbz9eC5ArWGqtGlYqiH3RU5yMpdyTTO7MguC4ow==" + "integrity": "sha1-gtJ0aKylrejl/R5tIrV91D69+3w=" }, "tinycolor2": { "version": "1.4.1", @@ -10918,7 +11008,7 @@ "uuid": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.1.0.tgz", - "integrity": "sha512-DIWtzUkw04M4k3bf1IcpS2tngXEL26YUD2M0tMDUpnUrz2hgzUBlD55a4FjdLGPvfHxS6uluGWvaVEqgBcVa+g==" + "integrity": "sha1-PdPT55Crwk17DToDT/q6vijrvAQ=" }, "validate-npm-package-license": { "version": "3.0.1", @@ -11159,7 +11249,7 @@ "which": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", - "integrity": "sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg==", + "integrity": "sha1-/wS9/AEO5UfXgL7DjhrBwnd9JTo=", "requires": { "isexe": "2.0.0" } @@ -11172,7 +11262,7 @@ "wide-align": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.2.tgz", - "integrity": "sha512-ijDLlyQ7s6x1JgCLur53osjm/UXUYD9+0PbYKrBsYisYXzCxN+HC3mYDNy/dWdmf3AwqwU3CXwDCvsNgGK1S0w==", + "integrity": "sha1-Vx4PGwYEY268DfwhsDObvjE0FxA=", "dev": true, "requires": { "string-width": "1.0.2" @@ -11315,6 +11405,11 @@ "buffer-crc32": "0.2.13", "fd-slicer": "1.0.1" } + }, + "zen-observable": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/zen-observable/-/zen-observable-0.6.0.tgz", + "integrity": "sha512-G5v4eFZ1+qJC9U3iyldcc7OLsYfFf6/+/vywU3acbq0qq1PdFXsyfqtOUaQSTwhdbejO7AQWil3GzHxYlMchIg==" } } } diff --git a/package.json b/package.json index b44beab15d495..b7e730c3e7d25 100644 --- a/package.json +++ b/package.json @@ -18,12 +18,16 @@ "@wordpress/a11y": "0.1.0-beta.1", "@wordpress/hooks": "1.0.1", "@wordpress/url": "0.1.0-beta.1", + "apollo-client": "2.0.4", "classnames": "2.2.5", "clipboard": "1.7.1", "dom-react": "2.2.0", "dom-scroll-into-view": "1.2.1", "element-closest": "2.0.2", "escape-string-regexp": "1.0.5", + "graphql": "0.12.3", + "graphql-tag": "2.6.0", + "graphql-tools": "2.14.0", "hpq": "1.2.0", "jed": "1.1.1", "jquery": "3.2.1",