diff options
29 files changed, 28 insertions, 28 deletions
diff --git a/docs/api/node.md b/docs/api/node.md index 99bf1a7..be0cce2 100644 --- a/docs/api/node.md +++ b/docs/api/node.md @@ -1,4 +1,4 @@ -# Context and APIs +# Node APIs GitBooks provides different Node APIs and contexts to plugins. These APIs can vary according to the GitBook version being used, your plugin should specify the `engines.gitbook` field in `package.json` accordingly. diff --git a/packages/gitbook-core/src/components/ContextProvider.js b/packages/gitbook-core/src/components/ContextProvider.js index 86c8d41..96a44e3 100644 --- a/packages/gitbook-core/src/components/ContextProvider.js +++ b/packages/gitbook-core/src/components/ContextProvider.js @@ -1,7 +1,7 @@ const React = require('react'); const { Provider } = require('react-redux'); -const ContextShape = require('../shapes/Context'); +const ContextShape = require('../propTypes/Context'); /** * React component to provide a GitBook context to children components. diff --git a/packages/gitbook-core/src/components/Link.js b/packages/gitbook-core/src/components/Link.js index 65f4eb5..ab364bb 100644 --- a/packages/gitbook-core/src/components/Link.js +++ b/packages/gitbook-core/src/components/Link.js @@ -3,8 +3,8 @@ const ReactRedux = require('react-redux'); const File = require('../models/File'); const SummaryArticle = require('../models/SummaryArticle'); -const SummaryArticleShape = require('../shapes/SummaryArticle'); -const FileShape = require('../shapes/File'); +const SummaryArticleShape = require('../propTypes/SummaryArticle'); +const FileShape = require('../propTypes/File'); const Link = React.createClass({ propTypes: { diff --git a/packages/gitbook-core/src/index.js b/packages/gitbook-core/src/index.js index a1782e0..7b74150 100644 --- a/packages/gitbook-core/src/index.js +++ b/packages/gitbook-core/src/index.js @@ -23,7 +23,7 @@ const I18nProvider = require('./components/I18nProvider'); const ACTIONS = require('./actions/TYPES'); -const Shapes = require('./shapes'); +const PropTypes = require('./propTypes'); const connect = require('./lib/connect'); const createPlugin = require('./lib/createPlugin'); const createReducer = require('./lib/createReducer'); @@ -63,7 +63,7 @@ module.exports = { Backdrop, Tooltipped, // Utilities - Shapes, + PropTypes, // Librairies React, Immutable, diff --git a/packages/gitbook-core/src/lib/connect.js b/packages/gitbook-core/src/lib/connect.js index 2f2a212..a34299d 100644 --- a/packages/gitbook-core/src/lib/connect.js +++ b/packages/gitbook-core/src/lib/connect.js @@ -2,7 +2,7 @@ const React = require('react'); const ReactRedux = require('react-redux'); const { injectIntl } = require('react-intl'); -const ContextShape = require('../shapes/Context'); +const ContextShape = require('../propTypes/Context'); /** * Use the GitBook context provided by ContextProvider to map actions to props diff --git a/packages/gitbook-core/src/lib/renderWithContext.js b/packages/gitbook-core/src/lib/renderWithContext.js index c84c221..dc7e1f2 100644 --- a/packages/gitbook-core/src/lib/renderWithContext.js +++ b/packages/gitbook-core/src/lib/renderWithContext.js @@ -5,7 +5,7 @@ const PJAXWrapper = require('../components/PJAXWrapper'); const I18nProvider = require('../components/I18nProvider'); const ContextProvider = require('../components/ContextProvider'); const History = require('../actions/history'); -const contextShape = require('../shapes/context'); +const contextShape = require('../propTypes/context'); const GitBookApplication = React.createClass({ propTypes: { diff --git a/packages/gitbook-core/src/shapes/Context.js b/packages/gitbook-core/src/propTypes/Context.js index dd6d010..dd6d010 100644 --- a/packages/gitbook-core/src/shapes/Context.js +++ b/packages/gitbook-core/src/propTypes/Context.js diff --git a/packages/gitbook-core/src/shapes/File.js b/packages/gitbook-core/src/propTypes/File.js index fb7bc06..fb7bc06 100644 --- a/packages/gitbook-core/src/shapes/File.js +++ b/packages/gitbook-core/src/propTypes/File.js diff --git a/packages/gitbook-core/src/shapes/History.js b/packages/gitbook-core/src/propTypes/History.js index 1b59ea0..1b59ea0 100644 --- a/packages/gitbook-core/src/shapes/History.js +++ b/packages/gitbook-core/src/propTypes/History.js diff --git a/packages/gitbook-core/src/shapes/Language.js b/packages/gitbook-core/src/propTypes/Language.js index eea37a7..eea37a7 100644 --- a/packages/gitbook-core/src/shapes/Language.js +++ b/packages/gitbook-core/src/propTypes/Language.js diff --git a/packages/gitbook-core/src/shapes/Languages.js b/packages/gitbook-core/src/propTypes/Languages.js index 076aec5..076aec5 100644 --- a/packages/gitbook-core/src/shapes/Languages.js +++ b/packages/gitbook-core/src/propTypes/Languages.js diff --git a/packages/gitbook-core/src/shapes/Location.js b/packages/gitbook-core/src/propTypes/Location.js index 13e0a34..13e0a34 100644 --- a/packages/gitbook-core/src/shapes/Location.js +++ b/packages/gitbook-core/src/propTypes/Location.js diff --git a/packages/gitbook-core/src/shapes/Page.js b/packages/gitbook-core/src/propTypes/Page.js index c589f54..c589f54 100644 --- a/packages/gitbook-core/src/shapes/Page.js +++ b/packages/gitbook-core/src/propTypes/Page.js diff --git a/packages/gitbook-core/src/shapes/Readme.js b/packages/gitbook-core/src/propTypes/Readme.js index 8414f05..8414f05 100644 --- a/packages/gitbook-core/src/shapes/Readme.js +++ b/packages/gitbook-core/src/propTypes/Readme.js diff --git a/packages/gitbook-core/src/shapes/Summary.js b/packages/gitbook-core/src/propTypes/Summary.js index f97e66c..f97e66c 100644 --- a/packages/gitbook-core/src/shapes/Summary.js +++ b/packages/gitbook-core/src/propTypes/Summary.js diff --git a/packages/gitbook-core/src/shapes/SummaryArticle.js b/packages/gitbook-core/src/propTypes/SummaryArticle.js index c93bdd9..c93bdd9 100644 --- a/packages/gitbook-core/src/shapes/SummaryArticle.js +++ b/packages/gitbook-core/src/propTypes/SummaryArticle.js diff --git a/packages/gitbook-core/src/shapes/SummaryPart.js b/packages/gitbook-core/src/propTypes/SummaryPart.js index 769ddd1..769ddd1 100644 --- a/packages/gitbook-core/src/shapes/SummaryPart.js +++ b/packages/gitbook-core/src/propTypes/SummaryPart.js diff --git a/packages/gitbook-core/src/shapes/i18n.js b/packages/gitbook-core/src/propTypes/i18n.js index 372a240..372a240 100644 --- a/packages/gitbook-core/src/shapes/i18n.js +++ b/packages/gitbook-core/src/propTypes/i18n.js diff --git a/packages/gitbook-core/src/shapes/index.js b/packages/gitbook-core/src/propTypes/index.js index f56b78c..f56b78c 100644 --- a/packages/gitbook-core/src/shapes/index.js +++ b/packages/gitbook-core/src/propTypes/index.js diff --git a/packages/gitbook-plugin-copy-code/src/index.js b/packages/gitbook-plugin-copy-code/src/index.js index 4f90078..73d46c6 100644 --- a/packages/gitbook-plugin-copy-code/src/index.js +++ b/packages/gitbook-plugin-copy-code/src/index.js @@ -23,7 +23,7 @@ function getChildrenToText(children) { let CodeBlockWithCopy = React.createClass({ propTypes: { children: React.PropTypes.node, - i18n: GitBook.Shapes.I18n + i18n: GitBook.PropTypes.I18n }, getInitialState() { diff --git a/packages/gitbook-plugin-search/src/components/Input.js b/packages/gitbook-plugin-search/src/components/Input.js index 457deff..22351cc 100644 --- a/packages/gitbook-plugin-search/src/components/Input.js +++ b/packages/gitbook-plugin-search/src/components/Input.js @@ -6,8 +6,8 @@ const search = require('../actions/search'); const SearchInput = React.createClass({ propTypes: { query: React.PropTypes.string, - i18n: GitBook.Shapes.I18n, - dispatch: GitBook.Shapes.dispatch + i18n: GitBook.PropTypes.I18n, + dispatch: GitBook.PropTypes.dispatch }, onChange(event) { diff --git a/packages/gitbook-plugin-search/src/components/Results.js b/packages/gitbook-plugin-search/src/components/Results.js index ddff87d..16a8cbd 100644 --- a/packages/gitbook-plugin-search/src/components/Results.js +++ b/packages/gitbook-plugin-search/src/components/Results.js @@ -42,8 +42,8 @@ const Result = React.createClass({ const SearchResults = React.createClass({ propTypes: { - i18n: GitBook.Shapes.I18n, - results: GitBook.Shapes.list, + i18n: GitBook.PropTypes.I18n, + results: GitBook.PropTypes.list, query: React.PropTypes.string, children: React.PropTypes.node }, diff --git a/packages/gitbook-plugin-sharing/src/components/SharingButtons.js b/packages/gitbook-plugin-sharing/src/components/SharingButtons.js index 445458a..4f5ada9 100644 --- a/packages/gitbook-plugin-sharing/src/components/SharingButtons.js +++ b/packages/gitbook-plugin-sharing/src/components/SharingButtons.js @@ -12,7 +12,7 @@ const ShareButton = require('./ShareButton'); const SharingButtons = React.createClass({ propTypes: { options: optionsShape.isRequired, - page: GitBook.Shapes.Page.isRequired + page: GitBook.PropTypes.Page.isRequired }, onShare(site) { diff --git a/packages/gitbook-plugin-theme-default/src/components/Body.js b/packages/gitbook-plugin-theme-default/src/components/Body.js index 4f51f0f..2eba09a 100644 --- a/packages/gitbook-plugin-theme-default/src/components/Body.js +++ b/packages/gitbook-plugin-theme-default/src/components/Body.js @@ -6,8 +6,8 @@ const Toolbar = require('./Toolbar'); const Body = React.createClass({ propTypes: { - page: GitBook.Shapes.Page, - readme: GitBook.Shapes.Readme + page: GitBook.PropTypes.Page, + readme: GitBook.PropTypes.Readme }, render() { diff --git a/packages/gitbook-plugin-theme-default/src/components/Page.js b/packages/gitbook-plugin-theme-default/src/components/Page.js index 8e4324c..cbce704 100644 --- a/packages/gitbook-plugin-theme-default/src/components/Page.js +++ b/packages/gitbook-plugin-theme-default/src/components/Page.js @@ -3,7 +3,7 @@ const { React } = GitBook; const Page = React.createClass({ propTypes: { - page: GitBook.Shapes.Page + page: GitBook.PropTypes.Page }, render() { diff --git a/packages/gitbook-plugin-theme-default/src/components/Sidebar.js b/packages/gitbook-plugin-theme-default/src/components/Sidebar.js index 4a7fa53..ad1754e 100644 --- a/packages/gitbook-plugin-theme-default/src/components/Sidebar.js +++ b/packages/gitbook-plugin-theme-default/src/components/Sidebar.js @@ -5,7 +5,7 @@ const Summary = require('./Summary'); const Sidebar = React.createClass({ propTypes: { - summary: GitBook.Shapes.Summary + summary: GitBook.PropTypes.Summary }, render() { diff --git a/packages/gitbook-plugin-theme-default/src/components/Summary.js b/packages/gitbook-plugin-theme-default/src/components/Summary.js index d0fbde6..ef6ab3f 100644 --- a/packages/gitbook-plugin-theme-default/src/components/Summary.js +++ b/packages/gitbook-plugin-theme-default/src/components/Summary.js @@ -5,7 +5,7 @@ const { React } = GitBook; let SummaryArticle = React.createClass({ propTypes: { active: React.PropTypes.bool, - article: GitBook.Shapes.SummaryArticle + article: GitBook.PropTypes.SummaryArticle }, render() { @@ -33,7 +33,7 @@ SummaryArticle = GitBook.connect(SummaryArticle, ({page}, {article}) => { const SummaryArticles = React.createClass({ propTypes: { - articles: GitBook.Shapes.listOf(GitBook.Shapes.SummaryArticle) + articles: GitBook.PropTypes.listOf(GitBook.PropTypes.SummaryArticle) }, render() { @@ -51,7 +51,7 @@ const SummaryArticles = React.createClass({ const SummaryPart = React.createClass({ propTypes: { - part: GitBook.Shapes.SummaryPart + part: GitBook.PropTypes.SummaryPart }, render() { @@ -73,7 +73,7 @@ const SummaryPart = React.createClass({ const SummaryParts = React.createClass({ propTypes: { - parts: GitBook.Shapes.listOf(GitBook.Shapes.SummaryPart) + parts: GitBook.PropTypes.listOf(GitBook.PropTypes.SummaryPart) }, render() { @@ -91,7 +91,7 @@ const SummaryParts = React.createClass({ const Summary = React.createClass({ propTypes: { - summary: GitBook.Shapes.Summary + summary: GitBook.PropTypes.Summary }, render() { diff --git a/packages/gitbook-plugin-theme-default/src/components/Theme.js b/packages/gitbook-plugin-theme-default/src/components/Theme.js index 741b3cc..8f5dce6 100644 --- a/packages/gitbook-plugin-theme-default/src/components/Theme.js +++ b/packages/gitbook-plugin-theme-default/src/components/Theme.js @@ -8,10 +8,10 @@ const LoadingBar = require('./LoadingBar'); const Theme = React.createClass({ propTypes: { // State - page: GitBook.Shapes.Page, - summary: GitBook.Shapes.Summary, - readme: GitBook.Shapes.Readme, - history: GitBook.Shapes.History, + page: GitBook.PropTypes.Page, + summary: GitBook.PropTypes.Summary, + readme: GitBook.PropTypes.Readme, + history: GitBook.PropTypes.History, sidebar: React.PropTypes.object, // Other props children: React.PropTypes.node diff --git a/packages/gitbook-plugin-theme-default/src/components/Toolbar.js b/packages/gitbook-plugin-theme-default/src/components/Toolbar.js index cb90549..298017d 100644 --- a/packages/gitbook-plugin-theme-default/src/components/Toolbar.js +++ b/packages/gitbook-plugin-theme-default/src/components/Toolbar.js @@ -7,7 +7,7 @@ const Toolbar = React.createClass({ propTypes: { title: React.PropTypes.string.isRequired, dispatch: React.PropTypes.func, - readme: GitBook.Shapes.Readme + readme: GitBook.PropTypes.Readme }, onToggle() { |