From 5908f189a7fc060f2fa53cc41cdc991eff78a362 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Thu, 1 Mar 2018 09:18:46 +0100 Subject: Fix bug where contract event anchor ids were incorrect --- packages/website/ts/pages/documentation/event_definition.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'packages/website') diff --git a/packages/website/ts/pages/documentation/event_definition.tsx b/packages/website/ts/pages/documentation/event_definition.tsx index 0e53e38e7..e62c9ecbd 100644 --- a/packages/website/ts/pages/documentation/event_definition.tsx +++ b/packages/website/ts/pages/documentation/event_definition.tsx @@ -25,9 +25,10 @@ export class EventDefinition extends React.Component
-- cgit v1.2.3 From 31f03fcf3a246d2e2b08619df21f7d628ce05ce0 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Fri, 2 Mar 2018 02:17:23 +0100 Subject: Use custom fork of react-highlight with support for Solidity syntax highlighting --- packages/website/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/website') diff --git a/packages/website/package.json b/packages/website/package.json index ceb3853f9..c68edf369 100644 --- a/packages/website/package.json +++ b/packages/website/package.json @@ -43,7 +43,7 @@ "react-document-title": "^2.0.3", "react-dom": "15.6.1", "react-ga": "^2.4.1", - "react-highlight": "^0.10.0", + "react-highlight": "0xproject/react-highlight", "react-html5video": "^2.1.0", "react-inlinesvg": "^0.5.5", "react-markdown": "^2.5.0", -- cgit v1.2.3 From 67c834841ea0f8fb4d8d194c0f68802f48e764ee Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Fri, 2 Mar 2018 14:40:26 +0100 Subject: Update react-markdown, properly scroll to section for wiki internal links, consolidate scrollTo logic and make external links open in new tabs --- packages/website/package.json | 2 +- .../website/ts/pages/documentation/comment.tsx | 2 +- .../ts/pages/documentation/documentation.tsx | 25 +++++-------- .../ts/pages/shared/markdown_code_block.tsx | 6 ++-- .../ts/pages/shared/markdown_link_block.tsx | 41 ++++++++++++++++++++++ .../website/ts/pages/shared/markdown_section.tsx | 10 +++++- .../website/ts/pages/shared/version_drop_down.tsx | 7 ++-- packages/website/ts/pages/wiki/wiki.tsx | 19 ++-------- packages/website/ts/utils/configs.ts | 9 ++--- packages/website/ts/utils/utils.ts | 19 ++++++++++ 10 files changed, 93 insertions(+), 47 deletions(-) create mode 100644 packages/website/ts/pages/shared/markdown_link_block.tsx (limited to 'packages/website') diff --git a/packages/website/package.json b/packages/website/package.json index c68edf369..07122cc7c 100644 --- a/packages/website/package.json +++ b/packages/website/package.json @@ -46,7 +46,7 @@ "react-highlight": "0xproject/react-highlight", "react-html5video": "^2.1.0", "react-inlinesvg": "^0.5.5", - "react-markdown": "^2.5.0", + "react-markdown": "^3.2.2", "react-recaptcha": "^2.3.2", "react-redux": "^5.0.3", "react-router-dom": "^4.1.1", diff --git a/packages/website/ts/pages/documentation/comment.tsx b/packages/website/ts/pages/documentation/comment.tsx index 23cfd96bd..5f177e97e 100644 --- a/packages/website/ts/pages/documentation/comment.tsx +++ b/packages/website/ts/pages/documentation/comment.tsx @@ -15,7 +15,7 @@ const defaultProps = { export const Comment: React.SFC = (props: CommentProps) => { return (
- +
); }; diff --git a/packages/website/ts/pages/documentation/documentation.tsx b/packages/website/ts/pages/documentation/documentation.tsx index 7eed78fc3..5963fe851 100644 --- a/packages/website/ts/pages/documentation/documentation.tsx +++ b/packages/website/ts/pages/documentation/documentation.tsx @@ -29,11 +29,11 @@ import { TypescriptMethod, } from 'ts/types'; import { colors } from 'ts/utils/colors'; +import { configs } from 'ts/utils/configs'; import { constants } from 'ts/utils/constants'; import { utils } from 'ts/utils/utils'; const TOP_BAR_HEIGHT = 60; -const SCROLL_TOP_ID = 'docsScrollTop'; const networkNameToColor: { [network: string]: string } = { [Networks.Kovan]: colors.purple, @@ -76,7 +76,7 @@ const styles: Styles = { export class Documentation extends React.Component { public componentDidUpdate(prevProps: DocumentationProps, prevState: DocumentationState) { if (!_.isEqual(prevProps.docAgnosticFormat, this.props.docAgnosticFormat)) { - this._scrollToHash(); + utils.scrollToHash(this.props.location.hash, configs.SCROLL_CONTAINER_ID); } } public render() { @@ -115,8 +115,12 @@ export class Documentation extends React.Component -
-
+
+
{this._renderDocumentation()}
@@ -325,17 +329,4 @@ export class Documentation extends React.Component ); } - private _scrollToHash(): void { - const hashWithPrefix = this.props.location.hash; - let hash = hashWithPrefix.slice(1); - if (_.isEmpty(hash)) { - hash = SCROLL_TOP_ID; // scroll to the top - } - - scroller.scrollTo(hash, { - duration: 0, - offset: 0, - containerId: 'documentation', - }); - } } diff --git a/packages/website/ts/pages/shared/markdown_code_block.tsx b/packages/website/ts/pages/shared/markdown_code_block.tsx index 98ca3aee6..6dfb74554 100644 --- a/packages/website/ts/pages/shared/markdown_code_block.tsx +++ b/packages/website/ts/pages/shared/markdown_code_block.tsx @@ -3,7 +3,7 @@ import * as React from 'react'; import * as HighLight from 'react-highlight'; interface MarkdownCodeBlockProps { - literal: string; + value: string; language: string; } @@ -13,12 +13,12 @@ export class MarkdownCodeBlock extends React.Component - {this.props.literal} + {this.props.value} ); } diff --git a/packages/website/ts/pages/shared/markdown_link_block.tsx b/packages/website/ts/pages/shared/markdown_link_block.tsx new file mode 100644 index 000000000..73c447636 --- /dev/null +++ b/packages/website/ts/pages/shared/markdown_link_block.tsx @@ -0,0 +1,41 @@ +import * as _ from 'lodash'; +import * as React from 'react'; +import { configs } from 'ts/utils/configs'; +import { utils } from 'ts/utils/utils'; + +interface MarkdownLinkBlockProps { + href: string; +} + +interface MarkdownLinkBlockState {} + +export class MarkdownLinkBlock extends React.Component { + // Re-rendering a linkBlock causes any use selection to become de-selected making the link unclickable. + // We therefore noop re-renders on this component if it's props haven't changed. + public shouldComponentUpdate(nextProps: MarkdownLinkBlockProps, nextState: MarkdownLinkBlockState) { + return nextProps.href !== this.props.href; + } + public render() { + const href = this.props.href; + // If protocol is http or https, we can open in a new tab, otherwise don't for security reasons + if (_.startsWith(href, 'http') || _.startsWith(href, 'https')) { + return ( + + {this.props.children} + + ); + } else if (_.startsWith(href, '#')) { + return ( + + {this.props.children} + + ); + } else { + return {this.props.children}; + } + } + private _onHashUrlClick(href: string) { + const hashWithPrefix = `#${href.split('#')[1]}`; + utils.scrollToHash(hashWithPrefix, configs.SCROLL_CONTAINER_ID); + } +} diff --git a/packages/website/ts/pages/shared/markdown_section.tsx b/packages/website/ts/pages/shared/markdown_section.tsx index 4d7d8b4ca..7253072d9 100644 --- a/packages/website/ts/pages/shared/markdown_section.tsx +++ b/packages/website/ts/pages/shared/markdown_section.tsx @@ -5,6 +5,7 @@ import * as ReactMarkdown from 'react-markdown'; import { Element as ScrollElement } from 'react-scroll'; import { AnchorTitle } from 'ts/pages/shared/anchor_title'; import { MarkdownCodeBlock } from 'ts/pages/shared/markdown_code_block'; +import { MarkdownLinkBlock } from 'ts/pages/shared/markdown_link_block'; import { HeaderSizes } from 'ts/types'; import { colors } from 'ts/utils/colors'; import { utils } from 'ts/utils/utils'; @@ -64,7 +65,14 @@ export class MarkdownSection extends React.Component

- +
); diff --git a/packages/website/ts/pages/shared/version_drop_down.tsx b/packages/website/ts/pages/shared/version_drop_down.tsx index 3b331af9b..1b4dbb375 100644 --- a/packages/website/ts/pages/shared/version_drop_down.tsx +++ b/packages/website/ts/pages/shared/version_drop_down.tsx @@ -2,6 +2,7 @@ import * as _ from 'lodash'; import DropDownMenu from 'material-ui/DropDownMenu'; import MenuItem from 'material-ui/MenuItem'; import * as React from 'react'; +import { utils } from 'ts/utils/utils'; interface VersionDropDownProps { selectedVersion: string; @@ -31,8 +32,6 @@ export class VersionDropDown extends React.Component { }} >
-
+
{this._renderWikiArticles()}
@@ -188,19 +188,6 @@ export class Wiki extends React.Component {
); } - private _scrollToHash(): void { - const hashWithPrefix = this.props.location.hash; - let hash = hashWithPrefix.slice(1); - if (_.isEmpty(hash)) { - hash = '0xProtocolWiki'; // scroll to the top - } - - scroller.scrollTo(hash, { - duration: 0, - offset: 0, - containerId: 'documentation', - }); - } private async _fetchArticlesBySectionAsync(): Promise { const endpoint = `${configs.BACKEND_BASE_URL}${WebsitePaths.Wiki}`; const response = await fetch(endpoint); @@ -225,7 +212,7 @@ export class Wiki extends React.Component { articlesBySection, }, () => { - this._scrollToHash(); + utils.scrollToHash(this.props.location.hash, configs.SCROLL_CONTAINER_ID); }, ); } diff --git a/packages/website/ts/utils/configs.ts b/packages/website/ts/utils/configs.ts index 7e9ba69de..44d64e875 100644 --- a/packages/website/ts/utils/configs.ts +++ b/packages/website/ts/utils/configs.ts @@ -2,10 +2,8 @@ import * as _ from 'lodash'; import { ContractAddresses, Environments, OutdatedWrappedEtherByNetworkId, PublicNodeUrlsByNetworkId } from 'ts/types'; const BASE_URL = window.location.origin; -const isDevelopment = _.includes( - ['https://0xproject.localhost:3572', 'https://localhost:3572', 'https://127.0.0.1'], - BASE_URL, -); +const developmentUrls = ['https://0xproject.localhost:3572', 'https://localhost:3572', 'https://127.0.0.1']; +const isDevelopment = _.includes(developmentUrls, BASE_URL); const INFURA_API_KEY = 'T5WSC8cautR4KXyYgsRs'; export const configs = { @@ -15,6 +13,7 @@ export const configs = { DEFAULT_DERIVATION_PATH: `44'/60'/0'`, // WARNING: ZRX & WETH MUST always be default trackedTokens DEFAULT_TRACKED_TOKEN_SYMBOLS: ['WETH', 'ZRX'], + DEVELOPMENT_URLS: developmentUrls, DOMAIN_STAGING: 'staging-0xproject.s3-website-us-east-1.amazonaws.com', DOMAIN_DEVELOPMENT: '0xproject.localhost:3572', DOMAIN_PRODUCTION: '0xproject.com', @@ -94,6 +93,8 @@ export const configs = { [3]: [`https://ropsten.infura.io/${INFURA_API_KEY}`], [4]: [`https://rinkeby.infura.io/${INFURA_API_KEY}`], } as PublicNodeUrlsByNetworkId, + SCROLL_CONTAINER_ID: 'documentation', + SCROLL_TOP_ID: 'pageScrollTop', SHOULD_DEPRECATE_OLD_WETH_TOKEN: true, SYMBOLS_OF_MINTABLE_KOVAN_TOKENS: ['MKR', 'MLN', 'GNT', 'DGD', 'REP'], SYMBOLS_OF_MINTABLE_RINKEBY_ROPSTEN_TOKENS: [ diff --git a/packages/website/ts/utils/utils.ts b/packages/website/ts/utils/utils.ts index c38f84c92..4d04d915d 100644 --- a/packages/website/ts/utils/utils.ts +++ b/packages/website/ts/utils/utils.ts @@ -4,6 +4,7 @@ import deepEqual = require('deep-equal'); import isMobile = require('is-mobile'); import * as _ from 'lodash'; import * as moment from 'moment'; +import { scroller } from 'react-scroll'; import { EtherscanLinkSuffixes, Networks, @@ -290,4 +291,22 @@ export const utils = { ); return isTestNetwork; }, + getCurrentBaseUrl() { + const port = window.location.port; + const hasPort = !_.isUndefined(port); + const baseUrl = `https://${window.location.hostname}${hasPort ? `:${port}` : ''}`; + return baseUrl; + }, + scrollToHash(hashWithPrefix: string, containerId: string): void { + let hash = hashWithPrefix.slice(1); + if (_.isEmpty(hash)) { + hash = configs.SCROLL_TOP_ID; // scroll to the top + } + + scroller.scrollTo(hash, { + duration: 0, + offset: 0, + containerId, + }); + }, }; -- cgit v1.2.3 From da8edd2226d79db78398a1e1e496f97e707e1525 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Fri, 2 Mar 2018 14:47:43 +0100 Subject: Undo config changes --- packages/website/ts/utils/configs.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'packages/website') diff --git a/packages/website/ts/utils/configs.ts b/packages/website/ts/utils/configs.ts index 44d64e875..388fc8530 100644 --- a/packages/website/ts/utils/configs.ts +++ b/packages/website/ts/utils/configs.ts @@ -2,8 +2,10 @@ import * as _ from 'lodash'; import { ContractAddresses, Environments, OutdatedWrappedEtherByNetworkId, PublicNodeUrlsByNetworkId } from 'ts/types'; const BASE_URL = window.location.origin; -const developmentUrls = ['https://0xproject.localhost:3572', 'https://localhost:3572', 'https://127.0.0.1']; -const isDevelopment = _.includes(developmentUrls, BASE_URL); +const isDevelopment = _.includes( + ['https://0xproject.localhost:3572', 'https://localhost:3572', 'https://127.0.0.1'], + BASE_URL, +); const INFURA_API_KEY = 'T5WSC8cautR4KXyYgsRs'; export const configs = { @@ -13,7 +15,6 @@ export const configs = { DEFAULT_DERIVATION_PATH: `44'/60'/0'`, // WARNING: ZRX & WETH MUST always be default trackedTokens DEFAULT_TRACKED_TOKEN_SYMBOLS: ['WETH', 'ZRX'], - DEVELOPMENT_URLS: developmentUrls, DOMAIN_STAGING: 'staging-0xproject.s3-website-us-east-1.amazonaws.com', DOMAIN_DEVELOPMENT: '0xproject.localhost:3572', DOMAIN_PRODUCTION: '0xproject.com', -- cgit v1.2.3 From 5906f4c9953b65421a16b947a5e03898281483bc Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Fri, 2 Mar 2018 15:02:50 +0100 Subject: Add underline to internal linksx --- packages/website/ts/pages/shared/markdown_link_block.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'packages/website') diff --git a/packages/website/ts/pages/shared/markdown_link_block.tsx b/packages/website/ts/pages/shared/markdown_link_block.tsx index 73c447636..a8246f654 100644 --- a/packages/website/ts/pages/shared/markdown_link_block.tsx +++ b/packages/website/ts/pages/shared/markdown_link_block.tsx @@ -26,7 +26,10 @@ export class MarkdownLinkBlock extends React.Component + {this.props.children} ); -- cgit v1.2.3 From a2b262c9df127102a4508273d2a3564c5c004788 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Fri, 2 Mar 2018 15:10:44 +0100 Subject: Add hash to URL onClick --- packages/website/ts/pages/shared/markdown_link_block.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'packages/website') diff --git a/packages/website/ts/pages/shared/markdown_link_block.tsx b/packages/website/ts/pages/shared/markdown_link_block.tsx index a8246f654..45bb41478 100644 --- a/packages/website/ts/pages/shared/markdown_link_block.tsx +++ b/packages/website/ts/pages/shared/markdown_link_block.tsx @@ -38,7 +38,9 @@ export class MarkdownLinkBlock extends React.Component Date: Fri, 2 Mar 2018 16:21:10 +0100 Subject: Give all container files the proper file suffix: ts --- packages/website/ts/containers/about.ts | 26 ++++ packages/website/ts/containers/about.tsx | 26 ---- .../website/ts/containers/connect_documentation.ts | 101 ++++++++++++ .../ts/containers/connect_documentation.tsx | 101 ------------ packages/website/ts/containers/faq.ts | 26 ++++ packages/website/ts/containers/faq.tsx | 26 ---- .../website/ts/containers/generate_order_form.ts | 48 ++++++ .../website/ts/containers/generate_order_form.tsx | 48 ------ packages/website/ts/containers/landing.ts | 28 ++++ packages/website/ts/containers/landing.tsx | 28 ---- packages/website/ts/containers/not_found.ts | 28 ++++ packages/website/ts/containers/not_found.tsx | 28 ---- packages/website/ts/containers/portal.ts | 88 +++++++++++ packages/website/ts/containers/portal.tsx | 88 ----------- .../ts/containers/smart_contracts_documentation.ts | 98 ++++++++++++ .../containers/smart_contracts_documentation.tsx | 98 ------------ packages/website/ts/containers/wiki.ts | 26 ++++ packages/website/ts/containers/wiki.tsx | 26 ---- .../ts/containers/zero_ex_js_documentation.ts | 173 +++++++++++++++++++++ .../ts/containers/zero_ex_js_documentation.tsx | 173 --------------------- 20 files changed, 642 insertions(+), 642 deletions(-) create mode 100644 packages/website/ts/containers/about.ts delete mode 100644 packages/website/ts/containers/about.tsx create mode 100644 packages/website/ts/containers/connect_documentation.ts delete mode 100644 packages/website/ts/containers/connect_documentation.tsx create mode 100644 packages/website/ts/containers/faq.ts delete mode 100644 packages/website/ts/containers/faq.tsx create mode 100644 packages/website/ts/containers/generate_order_form.ts delete mode 100644 packages/website/ts/containers/generate_order_form.tsx create mode 100644 packages/website/ts/containers/landing.ts delete mode 100644 packages/website/ts/containers/landing.tsx create mode 100644 packages/website/ts/containers/not_found.ts delete mode 100644 packages/website/ts/containers/not_found.tsx create mode 100644 packages/website/ts/containers/portal.ts delete mode 100644 packages/website/ts/containers/portal.tsx create mode 100644 packages/website/ts/containers/smart_contracts_documentation.ts delete mode 100644 packages/website/ts/containers/smart_contracts_documentation.tsx create mode 100644 packages/website/ts/containers/wiki.ts delete mode 100644 packages/website/ts/containers/wiki.tsx create mode 100644 packages/website/ts/containers/zero_ex_js_documentation.ts delete mode 100644 packages/website/ts/containers/zero_ex_js_documentation.tsx (limited to 'packages/website') diff --git a/packages/website/ts/containers/about.ts b/packages/website/ts/containers/about.ts new file mode 100644 index 000000000..ce8fd3afb --- /dev/null +++ b/packages/website/ts/containers/about.ts @@ -0,0 +1,26 @@ +import * as _ from 'lodash'; +import * as React from 'react'; +import { connect } from 'react-redux'; +import { Dispatch } from 'redux'; +import { About as AboutComponent, AboutProps } from 'ts/pages/about/about'; +import { Dispatcher } from 'ts/redux/dispatcher'; +import { State } from 'ts/redux/reducer'; +import { Translate } from 'ts/utils/translate'; + +interface ConnectedState { + translate: Translate; +} + +interface ConnectedDispatch { + dispatcher: Dispatcher; +} + +const mapStateToProps = (state: State, ownProps: AboutProps): ConnectedState => ({ + translate: state.translate, +}); + +const mapDispatchToProps = (dispatch: Dispatch): ConnectedDispatch => ({ + dispatcher: new Dispatcher(dispatch), +}); + +export const About: React.ComponentClass = connect(mapStateToProps, mapDispatchToProps)(AboutComponent); diff --git a/packages/website/ts/containers/about.tsx b/packages/website/ts/containers/about.tsx deleted file mode 100644 index ce8fd3afb..000000000 --- a/packages/website/ts/containers/about.tsx +++ /dev/null @@ -1,26 +0,0 @@ -import * as _ from 'lodash'; -import * as React from 'react'; -import { connect } from 'react-redux'; -import { Dispatch } from 'redux'; -import { About as AboutComponent, AboutProps } from 'ts/pages/about/about'; -import { Dispatcher } from 'ts/redux/dispatcher'; -import { State } from 'ts/redux/reducer'; -import { Translate } from 'ts/utils/translate'; - -interface ConnectedState { - translate: Translate; -} - -interface ConnectedDispatch { - dispatcher: Dispatcher; -} - -const mapStateToProps = (state: State, ownProps: AboutProps): ConnectedState => ({ - translate: state.translate, -}); - -const mapDispatchToProps = (dispatch: Dispatch): ConnectedDispatch => ({ - dispatcher: new Dispatcher(dispatch), -}); - -export const About: React.ComponentClass = connect(mapStateToProps, mapDispatchToProps)(AboutComponent); diff --git a/packages/website/ts/containers/connect_documentation.ts b/packages/website/ts/containers/connect_documentation.ts new file mode 100644 index 000000000..464bdcd74 --- /dev/null +++ b/packages/website/ts/containers/connect_documentation.ts @@ -0,0 +1,101 @@ +import * as _ from 'lodash'; +import * as React from 'react'; +import { connect } from 'react-redux'; +import { Dispatch } from 'redux'; +import { DocPage as DocPageComponent, DocPageProps } from 'ts/pages/documentation/doc_page'; +import { DocsInfo } from 'ts/pages/documentation/docs_info'; +import { Dispatcher } from 'ts/redux/dispatcher'; +import { State } from 'ts/redux/reducer'; +import { DocPackages, DocsInfoConfig, Environments, SupportedDocJson, WebsitePaths } from 'ts/types'; +import { configs } from 'ts/utils/configs'; +import { constants } from 'ts/utils/constants'; +import { Translate } from 'ts/utils/translate'; + +/* tslint:disable:no-var-requires */ +const IntroMarkdown = require('md/docs/connect/introduction'); +const InstallationMarkdown = require('md/docs/connect/installation'); +/* tslint:enable:no-var-requires */ + +const connectDocSections = { + introduction: 'introduction', + installation: 'installation', + httpClient: 'httpClient', + webSocketOrderbookChannel: 'webSocketOrderbookChannel', + types: constants.TYPES_SECTION_NAME, +}; + +const docsInfoConfig: DocsInfoConfig = { + id: DocPackages.Connect, + type: SupportedDocJson.TypeDoc, + displayName: '0x Connect', + packageUrl: 'https://github.com/0xProject/0x.js', + menu: { + introduction: [connectDocSections.introduction], + install: [connectDocSections.installation], + httpClient: [connectDocSections.httpClient], + webSocketOrderbookChannel: [connectDocSections.webSocketOrderbookChannel], + types: [connectDocSections.types], + }, + sectionNameToMarkdown: { + [connectDocSections.introduction]: IntroMarkdown, + [connectDocSections.installation]: InstallationMarkdown, + }, + // Note: This needs to be kept in sync with the types exported in index.ts. Unfortunately there is + // currently no way to extract the re-exported types from index.ts via TypeDoc :( + publicTypes: [ + 'Client', + 'FeesRequest', + 'FeesResponse', + 'OrderbookChannel', + 'OrderbookChannelHandler', + 'OrderbookChannelSubscriptionOpts', + 'OrderbookRequest', + 'OrderbookResponse', + 'OrdersRequest', + 'OrdersRequestOpts', + 'PagedRequestOpts', + 'TokenPairsItem', + 'TokenPairsRequest', + 'TokenPairsRequestOpts', + 'TokenTradeInfo', + 'WebSocketOrderbookChannelConfig', + 'Order', + 'SignedOrder', + 'ECSignature', + ], + sectionNameToModulePath: { + [connectDocSections.httpClient]: ['"src/http_client"'], + [connectDocSections.webSocketOrderbookChannel]: ['"src/ws_orderbook_channel"'], + [connectDocSections.types]: ['"src/types"'], + }, + menuSubsectionToVersionWhenIntroduced: {}, + sections: connectDocSections, + visibleConstructors: [connectDocSections.httpClient, connectDocSections.webSocketOrderbookChannel], +}; +const docsInfo = new DocsInfo(docsInfoConfig); + +interface ConnectedState { + docsVersion: string; + availableDocVersions: string[]; + docsInfo: DocsInfo; + translate: Translate; +} + +interface ConnectedDispatch { + dispatcher: Dispatcher; +} + +const mapStateToProps = (state: State, ownProps: DocPageProps): ConnectedState => ({ + docsVersion: state.docsVersion, + availableDocVersions: state.availableDocVersions, + translate: state.translate, + docsInfo, +}); + +const mapDispatchToProps = (dispatch: Dispatch): ConnectedDispatch => ({ + dispatcher: new Dispatcher(dispatch), +}); + +export const Documentation: React.ComponentClass = connect(mapStateToProps, mapDispatchToProps)( + DocPageComponent, +); diff --git a/packages/website/ts/containers/connect_documentation.tsx b/packages/website/ts/containers/connect_documentation.tsx deleted file mode 100644 index 464bdcd74..000000000 --- a/packages/website/ts/containers/connect_documentation.tsx +++ /dev/null @@ -1,101 +0,0 @@ -import * as _ from 'lodash'; -import * as React from 'react'; -import { connect } from 'react-redux'; -import { Dispatch } from 'redux'; -import { DocPage as DocPageComponent, DocPageProps } from 'ts/pages/documentation/doc_page'; -import { DocsInfo } from 'ts/pages/documentation/docs_info'; -import { Dispatcher } from 'ts/redux/dispatcher'; -import { State } from 'ts/redux/reducer'; -import { DocPackages, DocsInfoConfig, Environments, SupportedDocJson, WebsitePaths } from 'ts/types'; -import { configs } from 'ts/utils/configs'; -import { constants } from 'ts/utils/constants'; -import { Translate } from 'ts/utils/translate'; - -/* tslint:disable:no-var-requires */ -const IntroMarkdown = require('md/docs/connect/introduction'); -const InstallationMarkdown = require('md/docs/connect/installation'); -/* tslint:enable:no-var-requires */ - -const connectDocSections = { - introduction: 'introduction', - installation: 'installation', - httpClient: 'httpClient', - webSocketOrderbookChannel: 'webSocketOrderbookChannel', - types: constants.TYPES_SECTION_NAME, -}; - -const docsInfoConfig: DocsInfoConfig = { - id: DocPackages.Connect, - type: SupportedDocJson.TypeDoc, - displayName: '0x Connect', - packageUrl: 'https://github.com/0xProject/0x.js', - menu: { - introduction: [connectDocSections.introduction], - install: [connectDocSections.installation], - httpClient: [connectDocSections.httpClient], - webSocketOrderbookChannel: [connectDocSections.webSocketOrderbookChannel], - types: [connectDocSections.types], - }, - sectionNameToMarkdown: { - [connectDocSections.introduction]: IntroMarkdown, - [connectDocSections.installation]: InstallationMarkdown, - }, - // Note: This needs to be kept in sync with the types exported in index.ts. Unfortunately there is - // currently no way to extract the re-exported types from index.ts via TypeDoc :( - publicTypes: [ - 'Client', - 'FeesRequest', - 'FeesResponse', - 'OrderbookChannel', - 'OrderbookChannelHandler', - 'OrderbookChannelSubscriptionOpts', - 'OrderbookRequest', - 'OrderbookResponse', - 'OrdersRequest', - 'OrdersRequestOpts', - 'PagedRequestOpts', - 'TokenPairsItem', - 'TokenPairsRequest', - 'TokenPairsRequestOpts', - 'TokenTradeInfo', - 'WebSocketOrderbookChannelConfig', - 'Order', - 'SignedOrder', - 'ECSignature', - ], - sectionNameToModulePath: { - [connectDocSections.httpClient]: ['"src/http_client"'], - [connectDocSections.webSocketOrderbookChannel]: ['"src/ws_orderbook_channel"'], - [connectDocSections.types]: ['"src/types"'], - }, - menuSubsectionToVersionWhenIntroduced: {}, - sections: connectDocSections, - visibleConstructors: [connectDocSections.httpClient, connectDocSections.webSocketOrderbookChannel], -}; -const docsInfo = new DocsInfo(docsInfoConfig); - -interface ConnectedState { - docsVersion: string; - availableDocVersions: string[]; - docsInfo: DocsInfo; - translate: Translate; -} - -interface ConnectedDispatch { - dispatcher: Dispatcher; -} - -const mapStateToProps = (state: State, ownProps: DocPageProps): ConnectedState => ({ - docsVersion: state.docsVersion, - availableDocVersions: state.availableDocVersions, - translate: state.translate, - docsInfo, -}); - -const mapDispatchToProps = (dispatch: Dispatch): ConnectedDispatch => ({ - dispatcher: new Dispatcher(dispatch), -}); - -export const Documentation: React.ComponentClass = connect(mapStateToProps, mapDispatchToProps)( - DocPageComponent, -); diff --git a/packages/website/ts/containers/faq.ts b/packages/website/ts/containers/faq.ts new file mode 100644 index 000000000..b539e33c9 --- /dev/null +++ b/packages/website/ts/containers/faq.ts @@ -0,0 +1,26 @@ +import * as _ from 'lodash'; +import * as React from 'react'; +import { connect } from 'react-redux'; +import { Dispatch } from 'redux'; +import { FAQ as FAQComponent, FAQProps } from 'ts/pages/faq/faq'; +import { Dispatcher } from 'ts/redux/dispatcher'; +import { State } from 'ts/redux/reducer'; +import { Translate } from 'ts/utils/translate'; + +interface ConnectedState { + translate: Translate; +} + +interface ConnectedDispatch { + dispatcher: Dispatcher; +} + +const mapStateToProps = (state: State, ownProps: FAQProps): ConnectedState => ({ + translate: state.translate, +}); + +const mapDispatchToProps = (dispatch: Dispatch): ConnectedDispatch => ({ + dispatcher: new Dispatcher(dispatch), +}); + +export const FAQ: React.ComponentClass = connect(mapStateToProps, mapDispatchToProps)(FAQComponent); diff --git a/packages/website/ts/containers/faq.tsx b/packages/website/ts/containers/faq.tsx deleted file mode 100644 index b539e33c9..000000000 --- a/packages/website/ts/containers/faq.tsx +++ /dev/null @@ -1,26 +0,0 @@ -import * as _ from 'lodash'; -import * as React from 'react'; -import { connect } from 'react-redux'; -import { Dispatch } from 'redux'; -import { FAQ as FAQComponent, FAQProps } from 'ts/pages/faq/faq'; -import { Dispatcher } from 'ts/redux/dispatcher'; -import { State } from 'ts/redux/reducer'; -import { Translate } from 'ts/utils/translate'; - -interface ConnectedState { - translate: Translate; -} - -interface ConnectedDispatch { - dispatcher: Dispatcher; -} - -const mapStateToProps = (state: State, ownProps: FAQProps): ConnectedState => ({ - translate: state.translate, -}); - -const mapDispatchToProps = (dispatch: Dispatch): ConnectedDispatch => ({ - dispatcher: new Dispatcher(dispatch), -}); - -export const FAQ: React.ComponentClass = connect(mapStateToProps, mapDispatchToProps)(FAQComponent); diff --git a/packages/website/ts/containers/generate_order_form.ts b/packages/website/ts/containers/generate_order_form.ts new file mode 100644 index 000000000..8c5deb690 --- /dev/null +++ b/packages/website/ts/containers/generate_order_form.ts @@ -0,0 +1,48 @@ +import { ECSignature } from '0x.js'; +import { BigNumber } from '@0xproject/utils'; +import * as _ from 'lodash'; +import * as React from 'react'; +import { connect } from 'react-redux'; +import { Blockchain } from 'ts/blockchain'; +import { GenerateOrderForm as GenerateOrderFormComponent } from 'ts/components/generate_order/generate_order_form'; +import { Dispatcher } from 'ts/redux/dispatcher'; +import { State } from 'ts/redux/reducer'; +import { BlockchainErrs, HashData, SideToAssetToken, TokenByAddress } from 'ts/types'; + +interface GenerateOrderFormProps { + blockchain: Blockchain; + hashData: HashData; + dispatcher: Dispatcher; +} + +interface ConnectedState { + blockchainErr: BlockchainErrs; + blockchainIsLoaded: boolean; + orderExpiryTimestamp: BigNumber; + orderECSignature: ECSignature; + userAddress: string; + orderTakerAddress: string; + orderSalt: BigNumber; + networkId: number; + sideToAssetToken: SideToAssetToken; + tokenByAddress: TokenByAddress; + lastForceTokenStateRefetch: number; +} + +const mapStateToProps = (state: State, ownProps: GenerateOrderFormProps): ConnectedState => ({ + blockchainErr: state.blockchainErr, + blockchainIsLoaded: state.blockchainIsLoaded, + orderExpiryTimestamp: state.orderExpiryTimestamp, + orderECSignature: state.orderECSignature, + orderTakerAddress: state.orderTakerAddress, + orderSalt: state.orderSalt, + networkId: state.networkId, + sideToAssetToken: state.sideToAssetToken, + tokenByAddress: state.tokenByAddress, + userAddress: state.userAddress, + lastForceTokenStateRefetch: state.lastForceTokenStateRefetch, +}); + +export const GenerateOrderForm: React.ComponentClass = connect(mapStateToProps)( + GenerateOrderFormComponent, +); diff --git a/packages/website/ts/containers/generate_order_form.tsx b/packages/website/ts/containers/generate_order_form.tsx deleted file mode 100644 index 8c5deb690..000000000 --- a/packages/website/ts/containers/generate_order_form.tsx +++ /dev/null @@ -1,48 +0,0 @@ -import { ECSignature } from '0x.js'; -import { BigNumber } from '@0xproject/utils'; -import * as _ from 'lodash'; -import * as React from 'react'; -import { connect } from 'react-redux'; -import { Blockchain } from 'ts/blockchain'; -import { GenerateOrderForm as GenerateOrderFormComponent } from 'ts/components/generate_order/generate_order_form'; -import { Dispatcher } from 'ts/redux/dispatcher'; -import { State } from 'ts/redux/reducer'; -import { BlockchainErrs, HashData, SideToAssetToken, TokenByAddress } from 'ts/types'; - -interface GenerateOrderFormProps { - blockchain: Blockchain; - hashData: HashData; - dispatcher: Dispatcher; -} - -interface ConnectedState { - blockchainErr: BlockchainErrs; - blockchainIsLoaded: boolean; - orderExpiryTimestamp: BigNumber; - orderECSignature: ECSignature; - userAddress: string; - orderTakerAddress: string; - orderSalt: BigNumber; - networkId: number; - sideToAssetToken: SideToAssetToken; - tokenByAddress: TokenByAddress; - lastForceTokenStateRefetch: number; -} - -const mapStateToProps = (state: State, ownProps: GenerateOrderFormProps): ConnectedState => ({ - blockchainErr: state.blockchainErr, - blockchainIsLoaded: state.blockchainIsLoaded, - orderExpiryTimestamp: state.orderExpiryTimestamp, - orderECSignature: state.orderECSignature, - orderTakerAddress: state.orderTakerAddress, - orderSalt: state.orderSalt, - networkId: state.networkId, - sideToAssetToken: state.sideToAssetToken, - tokenByAddress: state.tokenByAddress, - userAddress: state.userAddress, - lastForceTokenStateRefetch: state.lastForceTokenStateRefetch, -}); - -export const GenerateOrderForm: React.ComponentClass = connect(mapStateToProps)( - GenerateOrderFormComponent, -); diff --git a/packages/website/ts/containers/landing.ts b/packages/website/ts/containers/landing.ts new file mode 100644 index 000000000..a620bb12e --- /dev/null +++ b/packages/website/ts/containers/landing.ts @@ -0,0 +1,28 @@ +import * as _ from 'lodash'; +import * as React from 'react'; +import { connect } from 'react-redux'; +import { Dispatch } from 'redux'; +import { Landing as LandingComponent, LandingProps } from 'ts/pages/landing/landing'; +import { Dispatcher } from 'ts/redux/dispatcher'; +import { State } from 'ts/redux/reducer'; +import { Translate } from 'ts/utils/translate'; + +interface ConnectedState { + translate: Translate; +} + +interface ConnectedDispatch { + dispatcher: Dispatcher; +} + +const mapStateToProps = (state: State, ownProps: LandingProps): ConnectedState => ({ + translate: state.translate, +}); + +const mapDispatchToProps = (dispatch: Dispatch): ConnectedDispatch => ({ + dispatcher: new Dispatcher(dispatch), +}); + +export const Landing: React.ComponentClass = connect(mapStateToProps, mapDispatchToProps)( + LandingComponent, +); diff --git a/packages/website/ts/containers/landing.tsx b/packages/website/ts/containers/landing.tsx deleted file mode 100644 index a620bb12e..000000000 --- a/packages/website/ts/containers/landing.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import * as _ from 'lodash'; -import * as React from 'react'; -import { connect } from 'react-redux'; -import { Dispatch } from 'redux'; -import { Landing as LandingComponent, LandingProps } from 'ts/pages/landing/landing'; -import { Dispatcher } from 'ts/redux/dispatcher'; -import { State } from 'ts/redux/reducer'; -import { Translate } from 'ts/utils/translate'; - -interface ConnectedState { - translate: Translate; -} - -interface ConnectedDispatch { - dispatcher: Dispatcher; -} - -const mapStateToProps = (state: State, ownProps: LandingProps): ConnectedState => ({ - translate: state.translate, -}); - -const mapDispatchToProps = (dispatch: Dispatch): ConnectedDispatch => ({ - dispatcher: new Dispatcher(dispatch), -}); - -export const Landing: React.ComponentClass = connect(mapStateToProps, mapDispatchToProps)( - LandingComponent, -); diff --git a/packages/website/ts/containers/not_found.ts b/packages/website/ts/containers/not_found.ts new file mode 100644 index 000000000..dd151e2c8 --- /dev/null +++ b/packages/website/ts/containers/not_found.ts @@ -0,0 +1,28 @@ +import * as _ from 'lodash'; +import * as React from 'react'; +import { connect } from 'react-redux'; +import { Dispatch } from 'redux'; +import { NotFound as NotFoundComponent, NotFoundProps } from 'ts/pages/not_found'; +import { Dispatcher } from 'ts/redux/dispatcher'; +import { State } from 'ts/redux/reducer'; +import { Translate } from 'ts/utils/translate'; + +interface ConnectedState { + translate: Translate; +} + +interface ConnectedDispatch { + dispatcher: Dispatcher; +} + +const mapStateToProps = (state: State, ownProps: NotFoundProps): ConnectedState => ({ + translate: state.translate, +}); + +const mapDispatchToProps = (dispatch: Dispatch): ConnectedDispatch => ({ + dispatcher: new Dispatcher(dispatch), +}); + +export const NotFound: React.ComponentClass = connect(mapStateToProps, mapDispatchToProps)( + NotFoundComponent, +); diff --git a/packages/website/ts/containers/not_found.tsx b/packages/website/ts/containers/not_found.tsx deleted file mode 100644 index dd151e2c8..000000000 --- a/packages/website/ts/containers/not_found.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import * as _ from 'lodash'; -import * as React from 'react'; -import { connect } from 'react-redux'; -import { Dispatch } from 'redux'; -import { NotFound as NotFoundComponent, NotFoundProps } from 'ts/pages/not_found'; -import { Dispatcher } from 'ts/redux/dispatcher'; -import { State } from 'ts/redux/reducer'; -import { Translate } from 'ts/utils/translate'; - -interface ConnectedState { - translate: Translate; -} - -interface ConnectedDispatch { - dispatcher: Dispatcher; -} - -const mapStateToProps = (state: State, ownProps: NotFoundProps): ConnectedState => ({ - translate: state.translate, -}); - -const mapDispatchToProps = (dispatch: Dispatch): ConnectedDispatch => ({ - dispatcher: new Dispatcher(dispatch), -}); - -export const NotFound: React.ComponentClass = connect(mapStateToProps, mapDispatchToProps)( - NotFoundComponent, -); diff --git a/packages/website/ts/containers/portal.ts b/packages/website/ts/containers/portal.ts new file mode 100644 index 000000000..befa16bdb --- /dev/null +++ b/packages/website/ts/containers/portal.ts @@ -0,0 +1,88 @@ +import { BigNumber } from '@0xproject/utils'; +import * as _ from 'lodash'; +import * as React from 'react'; +import { connect } from 'react-redux'; +import { Dispatch } from 'redux'; +import { Portal as PortalComponent, PortalAllProps as PortalComponentAllProps } from 'ts/components/portal'; +import { Dispatcher } from 'ts/redux/dispatcher'; +import { State } from 'ts/redux/reducer'; +import { BlockchainErrs, HashData, Order, ProviderType, ScreenWidths, Side, TokenByAddress } from 'ts/types'; +import { constants } from 'ts/utils/constants'; +import { Translate } from 'ts/utils/translate'; + +interface ConnectedState { + blockchainErr: BlockchainErrs; + blockchainIsLoaded: boolean; + hashData: HashData; + injectedProviderName: string; + networkId: number; + nodeVersion: string; + orderFillAmount: BigNumber; + providerType: ProviderType; + tokenByAddress: TokenByAddress; + lastForceTokenStateRefetch: number; + userEtherBalance: BigNumber; + screenWidth: ScreenWidths; + shouldBlockchainErrDialogBeOpen: boolean; + userAddress: string; + userSuppliedOrderCache: Order; + flashMessage?: string | React.ReactNode; + translate: Translate; +} + +interface ConnectedDispatch { + dispatcher: Dispatcher; +} + +const mapStateToProps = (state: State, ownProps: PortalComponentAllProps): ConnectedState => { + const receiveAssetToken = state.sideToAssetToken[Side.Receive]; + const depositAssetToken = state.sideToAssetToken[Side.Deposit]; + const receiveAddress = !_.isUndefined(receiveAssetToken.address) + ? receiveAssetToken.address + : constants.NULL_ADDRESS; + const depositAddress = !_.isUndefined(depositAssetToken.address) + ? depositAssetToken.address + : constants.NULL_ADDRESS; + const receiveAmount = !_.isUndefined(receiveAssetToken.amount) ? receiveAssetToken.amount : new BigNumber(0); + const depositAmount = !_.isUndefined(depositAssetToken.amount) ? depositAssetToken.amount : new BigNumber(0); + const hashData = { + depositAmount, + depositTokenContractAddr: depositAddress, + feeRecipientAddress: constants.NULL_ADDRESS, + makerFee: constants.MAKER_FEE, + orderExpiryTimestamp: state.orderExpiryTimestamp, + orderMakerAddress: state.userAddress, + orderTakerAddress: state.orderTakerAddress !== '' ? state.orderTakerAddress : constants.NULL_ADDRESS, + receiveAmount, + receiveTokenContractAddr: receiveAddress, + takerFee: constants.TAKER_FEE, + orderSalt: state.orderSalt, + }; + return { + blockchainErr: state.blockchainErr, + blockchainIsLoaded: state.blockchainIsLoaded, + hashData, + injectedProviderName: state.injectedProviderName, + networkId: state.networkId, + nodeVersion: state.nodeVersion, + orderFillAmount: state.orderFillAmount, + providerType: state.providerType, + screenWidth: state.screenWidth, + shouldBlockchainErrDialogBeOpen: state.shouldBlockchainErrDialogBeOpen, + tokenByAddress: state.tokenByAddress, + lastForceTokenStateRefetch: state.lastForceTokenStateRefetch, + userAddress: state.userAddress, + userEtherBalance: state.userEtherBalance, + userSuppliedOrderCache: state.userSuppliedOrderCache, + flashMessage: state.flashMessage, + translate: state.translate, + }; +}; + +const mapDispatchToProps = (dispatch: Dispatch): ConnectedDispatch => ({ + dispatcher: new Dispatcher(dispatch), +}); + +export const Portal: React.ComponentClass = connect(mapStateToProps, mapDispatchToProps)( + PortalComponent, +); diff --git a/packages/website/ts/containers/portal.tsx b/packages/website/ts/containers/portal.tsx deleted file mode 100644 index befa16bdb..000000000 --- a/packages/website/ts/containers/portal.tsx +++ /dev/null @@ -1,88 +0,0 @@ -import { BigNumber } from '@0xproject/utils'; -import * as _ from 'lodash'; -import * as React from 'react'; -import { connect } from 'react-redux'; -import { Dispatch } from 'redux'; -import { Portal as PortalComponent, PortalAllProps as PortalComponentAllProps } from 'ts/components/portal'; -import { Dispatcher } from 'ts/redux/dispatcher'; -import { State } from 'ts/redux/reducer'; -import { BlockchainErrs, HashData, Order, ProviderType, ScreenWidths, Side, TokenByAddress } from 'ts/types'; -import { constants } from 'ts/utils/constants'; -import { Translate } from 'ts/utils/translate'; - -interface ConnectedState { - blockchainErr: BlockchainErrs; - blockchainIsLoaded: boolean; - hashData: HashData; - injectedProviderName: string; - networkId: number; - nodeVersion: string; - orderFillAmount: BigNumber; - providerType: ProviderType; - tokenByAddress: TokenByAddress; - lastForceTokenStateRefetch: number; - userEtherBalance: BigNumber; - screenWidth: ScreenWidths; - shouldBlockchainErrDialogBeOpen: boolean; - userAddress: string; - userSuppliedOrderCache: Order; - flashMessage?: string | React.ReactNode; - translate: Translate; -} - -interface ConnectedDispatch { - dispatcher: Dispatcher; -} - -const mapStateToProps = (state: State, ownProps: PortalComponentAllProps): ConnectedState => { - const receiveAssetToken = state.sideToAssetToken[Side.Receive]; - const depositAssetToken = state.sideToAssetToken[Side.Deposit]; - const receiveAddress = !_.isUndefined(receiveAssetToken.address) - ? receiveAssetToken.address - : constants.NULL_ADDRESS; - const depositAddress = !_.isUndefined(depositAssetToken.address) - ? depositAssetToken.address - : constants.NULL_ADDRESS; - const receiveAmount = !_.isUndefined(receiveAssetToken.amount) ? receiveAssetToken.amount : new BigNumber(0); - const depositAmount = !_.isUndefined(depositAssetToken.amount) ? depositAssetToken.amount : new BigNumber(0); - const hashData = { - depositAmount, - depositTokenContractAddr: depositAddress, - feeRecipientAddress: constants.NULL_ADDRESS, - makerFee: constants.MAKER_FEE, - orderExpiryTimestamp: state.orderExpiryTimestamp, - orderMakerAddress: state.userAddress, - orderTakerAddress: state.orderTakerAddress !== '' ? state.orderTakerAddress : constants.NULL_ADDRESS, - receiveAmount, - receiveTokenContractAddr: receiveAddress, - takerFee: constants.TAKER_FEE, - orderSalt: state.orderSalt, - }; - return { - blockchainErr: state.blockchainErr, - blockchainIsLoaded: state.blockchainIsLoaded, - hashData, - injectedProviderName: state.injectedProviderName, - networkId: state.networkId, - nodeVersion: state.nodeVersion, - orderFillAmount: state.orderFillAmount, - providerType: state.providerType, - screenWidth: state.screenWidth, - shouldBlockchainErrDialogBeOpen: state.shouldBlockchainErrDialogBeOpen, - tokenByAddress: state.tokenByAddress, - lastForceTokenStateRefetch: state.lastForceTokenStateRefetch, - userAddress: state.userAddress, - userEtherBalance: state.userEtherBalance, - userSuppliedOrderCache: state.userSuppliedOrderCache, - flashMessage: state.flashMessage, - translate: state.translate, - }; -}; - -const mapDispatchToProps = (dispatch: Dispatch): ConnectedDispatch => ({ - dispatcher: new Dispatcher(dispatch), -}); - -export const Portal: React.ComponentClass = connect(mapStateToProps, mapDispatchToProps)( - PortalComponent, -); diff --git a/packages/website/ts/containers/smart_contracts_documentation.ts b/packages/website/ts/containers/smart_contracts_documentation.ts new file mode 100644 index 000000000..a839529aa --- /dev/null +++ b/packages/website/ts/containers/smart_contracts_documentation.ts @@ -0,0 +1,98 @@ +import * as _ from 'lodash'; +import * as React from 'react'; +import { connect } from 'react-redux'; +import { Dispatch } from 'redux'; +import { DocPage as DocPageComponent, DocPageProps } from 'ts/pages/documentation/doc_page'; +import { DocsInfo } from 'ts/pages/documentation/docs_info'; +import { Dispatcher } from 'ts/redux/dispatcher'; +import { State } from 'ts/redux/reducer'; +import { + DocPackages, + DocsInfoConfig, + Networks, + SmartContractDocSections as Sections, + SupportedDocJson, + WebsitePaths, +} from 'ts/types'; +import { Translate } from 'ts/utils/translate'; + +/* tslint:disable:no-var-requires */ +const IntroMarkdown = require('md/docs/smart_contracts/introduction'); +/* tslint:enable:no-var-requires */ + +const docsInfoConfig: DocsInfoConfig = { + id: DocPackages.SmartContracts, + type: SupportedDocJson.Doxity, + displayName: '0x Smart Contracts', + packageUrl: 'https://github.com/0xProject/contracts', + menu: { + introduction: [Sections.Introduction], + contracts: [Sections.Exchange, Sections.TokenRegistry, Sections.ZRXToken, Sections.TokenTransferProxy], + }, + sectionNameToMarkdown: { + [Sections.Introduction]: IntroMarkdown, + }, + sections: { + Introduction: Sections.Introduction, + Exchange: Sections.Exchange, + TokenTransferProxy: Sections.TokenTransferProxy, + TokenRegistry: Sections.TokenRegistry, + ZRXToken: Sections.ZRXToken, + }, + visibleConstructors: [Sections.Exchange, Sections.TokenRegistry, Sections.ZRXToken, Sections.TokenTransferProxy], + contractsByVersionByNetworkId: { + '1.0.0': { + [Networks.Mainnet]: { + [Sections.Exchange]: '0x12459c951127e0c374ff9105dda097662a027093', + [Sections.TokenTransferProxy]: '0x8da0d80f5007ef1e431dd2127178d224e32c2ef4', + [Sections.ZRXToken]: '0xe41d2489571d322189246dafa5ebde1f4699f498', + [Sections.TokenRegistry]: '0x926a74c5c36adf004c87399e65f75628b0f98d2c', + }, + [Networks.Ropsten]: { + [Sections.Exchange]: '0x479cc461fecd078f766ecc58533d6f69580cf3ac', + [Sections.TokenTransferProxy]: '0x4e9aad8184de8833365fea970cd9149372fdf1e6', + [Sections.ZRXToken]: '0xa8e9fa8f91e5ae138c74648c9c304f1c75003a8d', + [Sections.TokenRegistry]: '0x6b1a50f0bb5a7995444bd3877b22dc89c62843ed', + }, + [Networks.Kovan]: { + [Sections.Exchange]: '0x90fe2af704b34e0224bf2299c838e04d4dcf1364', + [Sections.TokenTransferProxy]: '0x087Eed4Bc1ee3DE49BeFbd66C662B434B15d49d4', + [Sections.ZRXToken]: '0x6ff6c0ff1d68b964901f986d4c9fa3ac68346570', + [Sections.TokenRegistry]: '0xf18e504561f4347bea557f3d4558f559dddbae7f', + }, + [Networks.Rinkeby]: { + [Sections.Exchange]: '0x1d16ef40fac01cec8adac2ac49427b9384192c05', + [Sections.TokenTransferProxy]: '0xa8e9fa8f91e5ae138c74648c9c304f1c75003a8d', + [Sections.ZRXToken]: '0x00f58d6d585f84b2d7267940cede30ce2fe6eae8', + [Sections.TokenRegistry]: '0x4e9aad8184de8833365fea970cd9149372fdf1e6', + }, + }, + }, +}; +const docsInfo = new DocsInfo(docsInfoConfig); + +interface ConnectedState { + docsVersion: string; + availableDocVersions: string[]; + translate: Translate; +} + +interface ConnectedDispatch { + dispatcher: Dispatcher; + docsInfo: DocsInfo; +} + +const mapStateToProps = (state: State, ownProps: DocPageProps): ConnectedState => ({ + docsVersion: state.docsVersion, + availableDocVersions: state.availableDocVersions, + translate: state.translate, +}); + +const mapDispatchToProps = (dispatch: Dispatch): ConnectedDispatch => ({ + dispatcher: new Dispatcher(dispatch), + docsInfo, +}); + +export const Documentation: React.ComponentClass = connect(mapStateToProps, mapDispatchToProps)( + DocPageComponent, +); diff --git a/packages/website/ts/containers/smart_contracts_documentation.tsx b/packages/website/ts/containers/smart_contracts_documentation.tsx deleted file mode 100644 index a839529aa..000000000 --- a/packages/website/ts/containers/smart_contracts_documentation.tsx +++ /dev/null @@ -1,98 +0,0 @@ -import * as _ from 'lodash'; -import * as React from 'react'; -import { connect } from 'react-redux'; -import { Dispatch } from 'redux'; -import { DocPage as DocPageComponent, DocPageProps } from 'ts/pages/documentation/doc_page'; -import { DocsInfo } from 'ts/pages/documentation/docs_info'; -import { Dispatcher } from 'ts/redux/dispatcher'; -import { State } from 'ts/redux/reducer'; -import { - DocPackages, - DocsInfoConfig, - Networks, - SmartContractDocSections as Sections, - SupportedDocJson, - WebsitePaths, -} from 'ts/types'; -import { Translate } from 'ts/utils/translate'; - -/* tslint:disable:no-var-requires */ -const IntroMarkdown = require('md/docs/smart_contracts/introduction'); -/* tslint:enable:no-var-requires */ - -const docsInfoConfig: DocsInfoConfig = { - id: DocPackages.SmartContracts, - type: SupportedDocJson.Doxity, - displayName: '0x Smart Contracts', - packageUrl: 'https://github.com/0xProject/contracts', - menu: { - introduction: [Sections.Introduction], - contracts: [Sections.Exchange, Sections.TokenRegistry, Sections.ZRXToken, Sections.TokenTransferProxy], - }, - sectionNameToMarkdown: { - [Sections.Introduction]: IntroMarkdown, - }, - sections: { - Introduction: Sections.Introduction, - Exchange: Sections.Exchange, - TokenTransferProxy: Sections.TokenTransferProxy, - TokenRegistry: Sections.TokenRegistry, - ZRXToken: Sections.ZRXToken, - }, - visibleConstructors: [Sections.Exchange, Sections.TokenRegistry, Sections.ZRXToken, Sections.TokenTransferProxy], - contractsByVersionByNetworkId: { - '1.0.0': { - [Networks.Mainnet]: { - [Sections.Exchange]: '0x12459c951127e0c374ff9105dda097662a027093', - [Sections.TokenTransferProxy]: '0x8da0d80f5007ef1e431dd2127178d224e32c2ef4', - [Sections.ZRXToken]: '0xe41d2489571d322189246dafa5ebde1f4699f498', - [Sections.TokenRegistry]: '0x926a74c5c36adf004c87399e65f75628b0f98d2c', - }, - [Networks.Ropsten]: { - [Sections.Exchange]: '0x479cc461fecd078f766ecc58533d6f69580cf3ac', - [Sections.TokenTransferProxy]: '0x4e9aad8184de8833365fea970cd9149372fdf1e6', - [Sections.ZRXToken]: '0xa8e9fa8f91e5ae138c74648c9c304f1c75003a8d', - [Sections.TokenRegistry]: '0x6b1a50f0bb5a7995444bd3877b22dc89c62843ed', - }, - [Networks.Kovan]: { - [Sections.Exchange]: '0x90fe2af704b34e0224bf2299c838e04d4dcf1364', - [Sections.TokenTransferProxy]: '0x087Eed4Bc1ee3DE49BeFbd66C662B434B15d49d4', - [Sections.ZRXToken]: '0x6ff6c0ff1d68b964901f986d4c9fa3ac68346570', - [Sections.TokenRegistry]: '0xf18e504561f4347bea557f3d4558f559dddbae7f', - }, - [Networks.Rinkeby]: { - [Sections.Exchange]: '0x1d16ef40fac01cec8adac2ac49427b9384192c05', - [Sections.TokenTransferProxy]: '0xa8e9fa8f91e5ae138c74648c9c304f1c75003a8d', - [Sections.ZRXToken]: '0x00f58d6d585f84b2d7267940cede30ce2fe6eae8', - [Sections.TokenRegistry]: '0x4e9aad8184de8833365fea970cd9149372fdf1e6', - }, - }, - }, -}; -const docsInfo = new DocsInfo(docsInfoConfig); - -interface ConnectedState { - docsVersion: string; - availableDocVersions: string[]; - translate: Translate; -} - -interface ConnectedDispatch { - dispatcher: Dispatcher; - docsInfo: DocsInfo; -} - -const mapStateToProps = (state: State, ownProps: DocPageProps): ConnectedState => ({ - docsVersion: state.docsVersion, - availableDocVersions: state.availableDocVersions, - translate: state.translate, -}); - -const mapDispatchToProps = (dispatch: Dispatch): ConnectedDispatch => ({ - dispatcher: new Dispatcher(dispatch), - docsInfo, -}); - -export const Documentation: React.ComponentClass = connect(mapStateToProps, mapDispatchToProps)( - DocPageComponent, -); diff --git a/packages/website/ts/containers/wiki.ts b/packages/website/ts/containers/wiki.ts new file mode 100644 index 000000000..2cb87d0a1 --- /dev/null +++ b/packages/website/ts/containers/wiki.ts @@ -0,0 +1,26 @@ +import * as _ from 'lodash'; +import * as React from 'react'; +import { connect } from 'react-redux'; +import { Dispatch } from 'redux'; +import { Wiki as WikiComponent, WikiProps } from 'ts/pages/wiki/wiki'; +import { Dispatcher } from 'ts/redux/dispatcher'; +import { State } from 'ts/redux/reducer'; +import { Translate } from 'ts/utils/translate'; + +interface ConnectedState { + translate: Translate; +} + +interface ConnectedDispatch { + dispatcher: Dispatcher; +} + +const mapStateToProps = (state: State, ownProps: WikiProps): ConnectedState => ({ + translate: state.translate, +}); + +const mapDispatchToProps = (dispatch: Dispatch): ConnectedDispatch => ({ + dispatcher: new Dispatcher(dispatch), +}); + +export const Wiki: React.ComponentClass = connect(mapStateToProps, mapDispatchToProps)(WikiComponent); diff --git a/packages/website/ts/containers/wiki.tsx b/packages/website/ts/containers/wiki.tsx deleted file mode 100644 index 2cb87d0a1..000000000 --- a/packages/website/ts/containers/wiki.tsx +++ /dev/null @@ -1,26 +0,0 @@ -import * as _ from 'lodash'; -import * as React from 'react'; -import { connect } from 'react-redux'; -import { Dispatch } from 'redux'; -import { Wiki as WikiComponent, WikiProps } from 'ts/pages/wiki/wiki'; -import { Dispatcher } from 'ts/redux/dispatcher'; -import { State } from 'ts/redux/reducer'; -import { Translate } from 'ts/utils/translate'; - -interface ConnectedState { - translate: Translate; -} - -interface ConnectedDispatch { - dispatcher: Dispatcher; -} - -const mapStateToProps = (state: State, ownProps: WikiProps): ConnectedState => ({ - translate: state.translate, -}); - -const mapDispatchToProps = (dispatch: Dispatch): ConnectedDispatch => ({ - dispatcher: new Dispatcher(dispatch), -}); - -export const Wiki: React.ComponentClass = connect(mapStateToProps, mapDispatchToProps)(WikiComponent); diff --git a/packages/website/ts/containers/zero_ex_js_documentation.ts b/packages/website/ts/containers/zero_ex_js_documentation.ts new file mode 100644 index 000000000..500bf8d96 --- /dev/null +++ b/packages/website/ts/containers/zero_ex_js_documentation.ts @@ -0,0 +1,173 @@ +import * as _ from 'lodash'; +import * as React from 'react'; +import { connect } from 'react-redux'; +import { Dispatch } from 'redux'; +import { DocPage as DocPageComponent, DocPageProps } from 'ts/pages/documentation/doc_page'; +import { DocsInfo } from 'ts/pages/documentation/docs_info'; +import { Dispatcher } from 'ts/redux/dispatcher'; +import { State } from 'ts/redux/reducer'; +import { DocPackages, DocsInfoConfig, Environments, SupportedDocJson, WebsitePaths } from 'ts/types'; +import { configs } from 'ts/utils/configs'; +import { constants } from 'ts/utils/constants'; +import { Translate } from 'ts/utils/translate'; + +/* tslint:disable:no-var-requires */ +const IntroMarkdown = require('md/docs/0xjs/introduction'); +const InstallationMarkdown = require('md/docs/0xjs/installation'); +const AsyncMarkdown = require('md/docs/0xjs/async'); +const ErrorsMarkdown = require('md/docs/0xjs/errors'); +const versioningMarkdown = require('md/docs/0xjs/versioning'); +/* tslint:enable:no-var-requires */ + +const zeroExJsDocSections = { + introduction: 'introduction', + installation: 'installation', + testrpc: 'testrpc', + async: 'async', + errors: 'errors', + versioning: 'versioning', + zeroEx: 'zeroEx', + exchange: 'exchange', + token: 'token', + tokenRegistry: 'tokenRegistry', + etherToken: 'etherToken', + proxy: 'proxy', + orderWatcher: 'orderWatcher', + types: constants.TYPES_SECTION_NAME, +}; + +const docsInfoConfig: DocsInfoConfig = { + id: DocPackages.ZeroExJs, + type: SupportedDocJson.TypeDoc, + displayName: '0x.js', + packageUrl: 'https://github.com/0xProject/0x.js', + menu: { + introduction: [zeroExJsDocSections.introduction], + install: [zeroExJsDocSections.installation], + topics: [zeroExJsDocSections.async, zeroExJsDocSections.errors, zeroExJsDocSections.versioning], + zeroEx: [zeroExJsDocSections.zeroEx], + contracts: [ + zeroExJsDocSections.exchange, + zeroExJsDocSections.token, + zeroExJsDocSections.tokenRegistry, + zeroExJsDocSections.etherToken, + zeroExJsDocSections.proxy, + ], + orderWatcher: [zeroExJsDocSections.orderWatcher], + types: [zeroExJsDocSections.types], + }, + sectionNameToMarkdown: { + [zeroExJsDocSections.introduction]: IntroMarkdown, + [zeroExJsDocSections.installation]: InstallationMarkdown, + [zeroExJsDocSections.async]: AsyncMarkdown, + [zeroExJsDocSections.errors]: ErrorsMarkdown, + [zeroExJsDocSections.versioning]: versioningMarkdown, + }, + // Note: This needs to be kept in sync with the types exported in index.ts. Unfortunately there is + // currently no way to extract the re-exported types from index.ts via TypeDoc :( Make sure to only + // ADD types here, DO NOT REMOVE types since they might still be needed for older supported versions + publicTypes: [ + 'Order', + 'SignedOrder', + 'ECSignature', + 'ZeroExError', + 'EventCallback', + 'EventCallbackAsync', + 'EventCallbackSync', + 'ExchangeContractErrs', + 'ContractEvent', + 'Token', + 'ExchangeEvents', + 'IndexedFilterValues', + 'SubscriptionOpts', + 'BlockRange', + 'BlockParam', + 'OrderFillOrKillRequest', + 'OrderCancellationRequest', + 'OrderFillRequest', + 'ContractEventEmitter', + 'Web3Provider', + 'ContractEventArgs', + 'LogCancelArgs', + 'LogFillArgs', + 'LogErrorContractEventArgs', + 'LogFillContractEventArgs', + 'LogCancelContractEventArgs', + 'EtherTokenContractEventArgs', + 'WithdrawalContractEventArgs', + 'DepositContractEventArgs', + 'TokenEvents', + 'ExchangeContractEventArgs', + 'TransferContractEventArgs', + 'ApprovalContractEventArgs', + 'TokenContractEventArgs', + 'ZeroExConfig', + 'TransactionReceiptWithDecodedLogs', + 'LogWithDecodedArgs', + 'EtherTokenEvents', + 'BlockParamLiteral', + 'DecodedLogArgs', + 'MethodOpts', + 'ValidateOrderFillableOpts', + 'OrderTransactionOpts', + 'TransactionOpts', + 'ContractEventArg', + 'LogEvent', + 'LogEntry', + 'DecodedLogEvent', + 'EventWatcherCallback', + 'OnOrderStateChangeCallback', + 'OrderStateValid', + 'OrderStateInvalid', + 'OrderState', + 'OrderStateWatcherConfig', + 'FilterObject', + ], + sectionNameToModulePath: { + [zeroExJsDocSections.zeroEx]: ['"src/0x"'], + [zeroExJsDocSections.exchange]: ['"src/contract_wrappers/exchange_wrapper"'], + [zeroExJsDocSections.tokenRegistry]: ['"src/contract_wrappers/token_registry_wrapper"'], + [zeroExJsDocSections.token]: ['"src/contract_wrappers/token_wrapper"'], + [zeroExJsDocSections.etherToken]: ['"src/contract_wrappers/ether_token_wrapper"'], + [zeroExJsDocSections.proxy]: [ + '"src/contract_wrappers/proxy_wrapper"', + '"src/contract_wrappers/token_transfer_proxy_wrapper"', + ], + [zeroExJsDocSections.orderWatcher]: ['"src/order_watcher/order_state_watcher"'], + [zeroExJsDocSections.types]: ['"src/types"'], + }, + menuSubsectionToVersionWhenIntroduced: { + [zeroExJsDocSections.etherToken]: '0.7.1', + [zeroExJsDocSections.proxy]: '0.8.0', + [zeroExJsDocSections.orderWatcher]: '0.27.1', + }, + sections: zeroExJsDocSections, + visibleConstructors: [zeroExJsDocSections.zeroEx], +}; +const docsInfo = new DocsInfo(docsInfoConfig); + +interface ConnectedState { + docsVersion: string; + availableDocVersions: string[]; + docsInfo: DocsInfo; + translate: Translate; +} + +interface ConnectedDispatch { + dispatcher: Dispatcher; +} + +const mapStateToProps = (state: State, ownProps: DocPageProps): ConnectedState => ({ + docsVersion: state.docsVersion, + availableDocVersions: state.availableDocVersions, + docsInfo, + translate: state.translate, +}); + +const mapDispatchToProps = (dispatch: Dispatch): ConnectedDispatch => ({ + dispatcher: new Dispatcher(dispatch), +}); + +export const Documentation: React.ComponentClass = connect(mapStateToProps, mapDispatchToProps)( + DocPageComponent, +); diff --git a/packages/website/ts/containers/zero_ex_js_documentation.tsx b/packages/website/ts/containers/zero_ex_js_documentation.tsx deleted file mode 100644 index 500bf8d96..000000000 --- a/packages/website/ts/containers/zero_ex_js_documentation.tsx +++ /dev/null @@ -1,173 +0,0 @@ -import * as _ from 'lodash'; -import * as React from 'react'; -import { connect } from 'react-redux'; -import { Dispatch } from 'redux'; -import { DocPage as DocPageComponent, DocPageProps } from 'ts/pages/documentation/doc_page'; -import { DocsInfo } from 'ts/pages/documentation/docs_info'; -import { Dispatcher } from 'ts/redux/dispatcher'; -import { State } from 'ts/redux/reducer'; -import { DocPackages, DocsInfoConfig, Environments, SupportedDocJson, WebsitePaths } from 'ts/types'; -import { configs } from 'ts/utils/configs'; -import { constants } from 'ts/utils/constants'; -import { Translate } from 'ts/utils/translate'; - -/* tslint:disable:no-var-requires */ -const IntroMarkdown = require('md/docs/0xjs/introduction'); -const InstallationMarkdown = require('md/docs/0xjs/installation'); -const AsyncMarkdown = require('md/docs/0xjs/async'); -const ErrorsMarkdown = require('md/docs/0xjs/errors'); -const versioningMarkdown = require('md/docs/0xjs/versioning'); -/* tslint:enable:no-var-requires */ - -const zeroExJsDocSections = { - introduction: 'introduction', - installation: 'installation', - testrpc: 'testrpc', - async: 'async', - errors: 'errors', - versioning: 'versioning', - zeroEx: 'zeroEx', - exchange: 'exchange', - token: 'token', - tokenRegistry: 'tokenRegistry', - etherToken: 'etherToken', - proxy: 'proxy', - orderWatcher: 'orderWatcher', - types: constants.TYPES_SECTION_NAME, -}; - -const docsInfoConfig: DocsInfoConfig = { - id: DocPackages.ZeroExJs, - type: SupportedDocJson.TypeDoc, - displayName: '0x.js', - packageUrl: 'https://github.com/0xProject/0x.js', - menu: { - introduction: [zeroExJsDocSections.introduction], - install: [zeroExJsDocSections.installation], - topics: [zeroExJsDocSections.async, zeroExJsDocSections.errors, zeroExJsDocSections.versioning], - zeroEx: [zeroExJsDocSections.zeroEx], - contracts: [ - zeroExJsDocSections.exchange, - zeroExJsDocSections.token, - zeroExJsDocSections.tokenRegistry, - zeroExJsDocSections.etherToken, - zeroExJsDocSections.proxy, - ], - orderWatcher: [zeroExJsDocSections.orderWatcher], - types: [zeroExJsDocSections.types], - }, - sectionNameToMarkdown: { - [zeroExJsDocSections.introduction]: IntroMarkdown, - [zeroExJsDocSections.installation]: InstallationMarkdown, - [zeroExJsDocSections.async]: AsyncMarkdown, - [zeroExJsDocSections.errors]: ErrorsMarkdown, - [zeroExJsDocSections.versioning]: versioningMarkdown, - }, - // Note: This needs to be kept in sync with the types exported in index.ts. Unfortunately there is - // currently no way to extract the re-exported types from index.ts via TypeDoc :( Make sure to only - // ADD types here, DO NOT REMOVE types since they might still be needed for older supported versions - publicTypes: [ - 'Order', - 'SignedOrder', - 'ECSignature', - 'ZeroExError', - 'EventCallback', - 'EventCallbackAsync', - 'EventCallbackSync', - 'ExchangeContractErrs', - 'ContractEvent', - 'Token', - 'ExchangeEvents', - 'IndexedFilterValues', - 'SubscriptionOpts', - 'BlockRange', - 'BlockParam', - 'OrderFillOrKillRequest', - 'OrderCancellationRequest', - 'OrderFillRequest', - 'ContractEventEmitter', - 'Web3Provider', - 'ContractEventArgs', - 'LogCancelArgs', - 'LogFillArgs', - 'LogErrorContractEventArgs', - 'LogFillContractEventArgs', - 'LogCancelContractEventArgs', - 'EtherTokenContractEventArgs', - 'WithdrawalContractEventArgs', - 'DepositContractEventArgs', - 'TokenEvents', - 'ExchangeContractEventArgs', - 'TransferContractEventArgs', - 'ApprovalContractEventArgs', - 'TokenContractEventArgs', - 'ZeroExConfig', - 'TransactionReceiptWithDecodedLogs', - 'LogWithDecodedArgs', - 'EtherTokenEvents', - 'BlockParamLiteral', - 'DecodedLogArgs', - 'MethodOpts', - 'ValidateOrderFillableOpts', - 'OrderTransactionOpts', - 'TransactionOpts', - 'ContractEventArg', - 'LogEvent', - 'LogEntry', - 'DecodedLogEvent', - 'EventWatcherCallback', - 'OnOrderStateChangeCallback', - 'OrderStateValid', - 'OrderStateInvalid', - 'OrderState', - 'OrderStateWatcherConfig', - 'FilterObject', - ], - sectionNameToModulePath: { - [zeroExJsDocSections.zeroEx]: ['"src/0x"'], - [zeroExJsDocSections.exchange]: ['"src/contract_wrappers/exchange_wrapper"'], - [zeroExJsDocSections.tokenRegistry]: ['"src/contract_wrappers/token_registry_wrapper"'], - [zeroExJsDocSections.token]: ['"src/contract_wrappers/token_wrapper"'], - [zeroExJsDocSections.etherToken]: ['"src/contract_wrappers/ether_token_wrapper"'], - [zeroExJsDocSections.proxy]: [ - '"src/contract_wrappers/proxy_wrapper"', - '"src/contract_wrappers/token_transfer_proxy_wrapper"', - ], - [zeroExJsDocSections.orderWatcher]: ['"src/order_watcher/order_state_watcher"'], - [zeroExJsDocSections.types]: ['"src/types"'], - }, - menuSubsectionToVersionWhenIntroduced: { - [zeroExJsDocSections.etherToken]: '0.7.1', - [zeroExJsDocSections.proxy]: '0.8.0', - [zeroExJsDocSections.orderWatcher]: '0.27.1', - }, - sections: zeroExJsDocSections, - visibleConstructors: [zeroExJsDocSections.zeroEx], -}; -const docsInfo = new DocsInfo(docsInfoConfig); - -interface ConnectedState { - docsVersion: string; - availableDocVersions: string[]; - docsInfo: DocsInfo; - translate: Translate; -} - -interface ConnectedDispatch { - dispatcher: Dispatcher; -} - -const mapStateToProps = (state: State, ownProps: DocPageProps): ConnectedState => ({ - docsVersion: state.docsVersion, - availableDocVersions: state.availableDocVersions, - docsInfo, - translate: state.translate, -}); - -const mapDispatchToProps = (dispatch: Dispatch): ConnectedDispatch => ({ - dispatcher: new Dispatcher(dispatch), -}); - -export const Documentation: React.ComponentClass = connect(mapStateToProps, mapDispatchToProps)( - DocPageComponent, -); -- cgit v1.2.3 From 0fbb443e4bb3ee6d522f4a4099aacae1b3da2488 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Fri, 2 Mar 2018 17:01:46 +0100 Subject: Move onPageLoadAsync to utils --- packages/website/ts/blockchain.ts | 10 +--------- packages/website/ts/utils/utils.ts | 8 ++++++++ 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'packages/website') diff --git a/packages/website/ts/blockchain.ts b/packages/website/ts/blockchain.ts index 85b4e892f..156dc44e8 100644 --- a/packages/website/ts/blockchain.ts +++ b/packages/website/ts/blockchain.ts @@ -69,14 +69,6 @@ export class Blockchain { private _cachedProviderNetworkId: number; private _ledgerSubprovider: LedgerWalletSubprovider; private _defaultGasPrice: BigNumber; - private static async _onPageLoadAsync(): Promise { - if (document.readyState === 'complete') { - return; // Already loaded - } - return new Promise((resolve, reject) => { - window.onload = () => resolve(); - }); - } private static _getNameGivenProvider(provider: Web3.Provider): string { if (!_.isUndefined((provider as any).isMetaMask)) { return constants.PROVIDER_NAME_METAMASK; @@ -710,7 +702,7 @@ export class Blockchain { return tokenByAddress; } private async _onPageLoadInitFireAndForgetAsync() { - await Blockchain._onPageLoadAsync(); // wait for page to load + await utils.onPageLoadAsync(); // wait for page to load // Hack: We need to know the networkId the injectedWeb3 is connected to (if it is defined) in // order to properly instantiate the web3Wrapper. Since we must use the async call, we cannot diff --git a/packages/website/ts/utils/utils.ts b/packages/website/ts/utils/utils.ts index 4d04d915d..27cd87be1 100644 --- a/packages/website/ts/utils/utils.ts +++ b/packages/website/ts/utils/utils.ts @@ -309,4 +309,12 @@ export const utils = { containerId, }); }, + async onPageLoadAsync(): Promise { + if (document.readyState === 'complete') { + return; // Already loaded + } + return new Promise((resolve, reject) => { + window.onload = () => resolve(); + }); + }, }; -- cgit v1.2.3 From 52232e98c7b2b1d1110821992bf3f86c239dd6e7 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Fri, 2 Mar 2018 17:02:14 +0100 Subject: Make sure the page has loaded (including all images) before scrolling to hash --- packages/website/ts/pages/wiki/wiki.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'packages/website') diff --git a/packages/website/ts/pages/wiki/wiki.tsx b/packages/website/ts/pages/wiki/wiki.tsx index d0cbf0d3e..66fa960d7 100644 --- a/packages/website/ts/pages/wiki/wiki.tsx +++ b/packages/website/ts/pages/wiki/wiki.tsx @@ -211,7 +211,8 @@ export class Wiki extends React.Component { { articlesBySection, }, - () => { + async () => { + await utils.onPageLoadAsync(); utils.scrollToHash(this.props.location.hash, configs.SCROLL_CONTAINER_ID); }, ); -- cgit v1.2.3 From f9a37168b034dd20868d1ffe1d2934db6effd39a Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Fri, 2 Mar 2018 17:07:32 +0100 Subject: Fix link to intro tutorial wiki article --- packages/website/md/docs/connect/installation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/website') diff --git a/packages/website/md/docs/connect/installation.md b/packages/website/md/docs/connect/installation.md index 184fa6e0d..950bf92ca 100644 --- a/packages/website/md/docs/connect/installation.md +++ b/packages/website/md/docs/connect/installation.md @@ -12,4 +12,4 @@ import { HttpClient } from '@0xproject/connect'; ### Wiki -Check out our [0x Connect introduction tutorial](https://0xproject.com/wiki#Intro-Tutorial:-Connect) for information on how to integrate relayers into your application. +Check out our [0x Connect introduction tutorial](https://0xproject.com/wiki#Intro-Tutorial) for information on how to integrate relayers into your application. -- cgit v1.2.3 From 0afe45b3a830bfefc4f9b51823891b99be5261fa Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Sat, 3 Mar 2018 05:36:08 +0100 Subject: Hash hash instead of prefixedHash to scrollToHash function --- packages/website/ts/pages/documentation/documentation.tsx | 3 ++- packages/website/ts/pages/shared/markdown_link_block.tsx | 3 +-- packages/website/ts/pages/wiki/wiki.tsx | 3 ++- packages/website/ts/utils/utils.ts | 8 ++++---- 4 files changed, 9 insertions(+), 8 deletions(-) (limited to 'packages/website') diff --git a/packages/website/ts/pages/documentation/documentation.tsx b/packages/website/ts/pages/documentation/documentation.tsx index 5963fe851..699bef7a8 100644 --- a/packages/website/ts/pages/documentation/documentation.tsx +++ b/packages/website/ts/pages/documentation/documentation.tsx @@ -76,7 +76,8 @@ const styles: Styles = { export class Documentation extends React.Component { public componentDidUpdate(prevProps: DocumentationProps, prevState: DocumentationState) { if (!_.isEqual(prevProps.docAgnosticFormat, this.props.docAgnosticFormat)) { - utils.scrollToHash(this.props.location.hash, configs.SCROLL_CONTAINER_ID); + const hash = this.props.location.hash.slice(1); + utils.scrollToHash(hash, configs.SCROLL_CONTAINER_ID); } } public render() { diff --git a/packages/website/ts/pages/shared/markdown_link_block.tsx b/packages/website/ts/pages/shared/markdown_link_block.tsx index 45bb41478..ed78e4e53 100644 --- a/packages/website/ts/pages/shared/markdown_link_block.tsx +++ b/packages/website/ts/pages/shared/markdown_link_block.tsx @@ -39,8 +39,7 @@ export class MarkdownLinkBlock extends React.Component { }, async () => { await utils.onPageLoadAsync(); - utils.scrollToHash(this.props.location.hash, configs.SCROLL_CONTAINER_ID); + const hash = this.props.location.hash.slice(1); + utils.scrollToHash(hash, configs.SCROLL_CONTAINER_ID); }, ); } diff --git a/packages/website/ts/utils/utils.ts b/packages/website/ts/utils/utils.ts index 27cd87be1..a1e045af7 100644 --- a/packages/website/ts/utils/utils.ts +++ b/packages/website/ts/utils/utils.ts @@ -297,13 +297,13 @@ export const utils = { const baseUrl = `https://${window.location.hostname}${hasPort ? `:${port}` : ''}`; return baseUrl; }, - scrollToHash(hashWithPrefix: string, containerId: string): void { - let hash = hashWithPrefix.slice(1); + scrollToHash(hash: string, containerId: string): void { + let finalHash = hash; if (_.isEmpty(hash)) { - hash = configs.SCROLL_TOP_ID; // scroll to the top + finalHash = configs.SCROLL_TOP_ID; // scroll to the top } - scroller.scrollTo(hash, { + scroller.scrollTo(finalHash, { duration: 0, offset: 0, containerId, -- cgit v1.2.3 From fdaf9f0bfc24a93933fb492d727d970d8c82d8ee Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Sat, 3 Mar 2018 05:36:26 +0100 Subject: Fix comment and use named variable in conditional --- packages/website/ts/pages/shared/markdown_link_block.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'packages/website') diff --git a/packages/website/ts/pages/shared/markdown_link_block.tsx b/packages/website/ts/pages/shared/markdown_link_block.tsx index ed78e4e53..e4553c87f 100644 --- a/packages/website/ts/pages/shared/markdown_link_block.tsx +++ b/packages/website/ts/pages/shared/markdown_link_block.tsx @@ -10,13 +10,14 @@ interface MarkdownLinkBlockProps { interface MarkdownLinkBlockState {} export class MarkdownLinkBlock extends React.Component { - // Re-rendering a linkBlock causes any use selection to become de-selected making the link unclickable. + // Re-rendering a linkBlock causes it to remain unclickable. // We therefore noop re-renders on this component if it's props haven't changed. public shouldComponentUpdate(nextProps: MarkdownLinkBlockProps, nextState: MarkdownLinkBlockState) { return nextProps.href !== this.props.href; } public render() { const href = this.props.href; + const isLinkToSection = _.startsWith(href, '#'); // If protocol is http or https, we can open in a new tab, otherwise don't for security reasons if (_.startsWith(href, 'http') || _.startsWith(href, 'https')) { return ( @@ -24,7 +25,7 @@ export class MarkdownLinkBlock extends React.Component ); - } else if (_.startsWith(href, '#')) { + } else if (isLinkToSection) { return ( Date: Sat, 3 Mar 2018 05:42:32 +0100 Subject: Improve icon sizes --- packages/website/public/images/doc_icons/connect.png | Bin 361 -> 289 bytes .../website/public/images/doc_icons/contracts.png | Bin 1104 -> 930 bytes packages/website/public/images/doc_icons/zeroExJs.png | Bin 1318 -> 1209 bytes 3 files changed, 0 insertions(+), 0 deletions(-) (limited to 'packages/website') diff --git a/packages/website/public/images/doc_icons/connect.png b/packages/website/public/images/doc_icons/connect.png index ba9bb8a3a..244f504b3 100644 Binary files a/packages/website/public/images/doc_icons/connect.png and b/packages/website/public/images/doc_icons/connect.png differ diff --git a/packages/website/public/images/doc_icons/contracts.png b/packages/website/public/images/doc_icons/contracts.png index f5c6545ca..03956f162 100644 Binary files a/packages/website/public/images/doc_icons/contracts.png and b/packages/website/public/images/doc_icons/contracts.png differ diff --git a/packages/website/public/images/doc_icons/zeroExJs.png b/packages/website/public/images/doc_icons/zeroExJs.png index 029777ffe..fe0c49a0f 100644 Binary files a/packages/website/public/images/doc_icons/zeroExJs.png and b/packages/website/public/images/doc_icons/zeroExJs.png differ -- cgit v1.2.3 From 212d680a477917817138790560d88d06cea5ec6f Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Sat, 3 Mar 2018 05:46:12 +0100 Subject: Small stylistic improvements --- packages/website/ts/pages/shared/nested_sidebar_menu.tsx | 6 +++--- packages/website/ts/pages/shared/section_header.tsx | 15 ++++++++++++++- 2 files changed, 17 insertions(+), 4 deletions(-) (limited to 'packages/website') diff --git a/packages/website/ts/pages/shared/nested_sidebar_menu.tsx b/packages/website/ts/pages/shared/nested_sidebar_menu.tsx index 1a08ca9f9..82a40eb7e 100644 --- a/packages/website/ts/pages/shared/nested_sidebar_menu.tsx +++ b/packages/website/ts/pages/shared/nested_sidebar_menu.tsx @@ -86,14 +86,14 @@ export class NestedSidebarMenu extends React.Component
-
+
|
- +
-
+
{this.props.title}
diff --git a/packages/website/ts/pages/shared/section_header.tsx b/packages/website/ts/pages/shared/section_header.tsx index a5f5f52cf..52a1f30d9 100644 --- a/packages/website/ts/pages/shared/section_header.tsx +++ b/packages/website/ts/pages/shared/section_header.tsx @@ -2,6 +2,7 @@ import * as React from 'react'; import { Element as ScrollElement } from 'react-scroll'; import { AnchorTitle } from 'ts/pages/shared/anchor_title'; import { HeaderSizes } from 'ts/types'; +import { colors } from 'ts/utils/colors'; import { utils } from 'ts/utils/utils'; interface SectionHeaderProps { @@ -34,7 +35,19 @@ export class SectionHeader extends React.Component {sectionName}} + title={ + + {sectionName} + + } id={id} shouldShowAnchor={this.state.shouldShowAnchor} /> -- cgit v1.2.3 From 45b9647ba0b5a29b0c021327398fe703c3ae1427 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Sat, 3 Mar 2018 13:47:39 +0100 Subject: Fix small bug where onHover type declarations with comments was taking up the entire window width --- packages/website/ts/pages/documentation/type_definition.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'packages/website') diff --git a/packages/website/ts/pages/documentation/type_definition.tsx b/packages/website/ts/pages/documentation/type_definition.tsx index d46eec76c..02bf63258 100644 --- a/packages/website/ts/pages/documentation/type_definition.tsx +++ b/packages/website/ts/pages/documentation/type_definition.tsx @@ -113,7 +113,9 @@ export class TypeDefinition extends React.Component{codeSnippet}
- {customType.comment && } +
+ {customType.comment && } +
); } -- cgit v1.2.3 From 9e7b45ea4cf8d0fabec5f293efc448262e0a7cb2 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Sat, 3 Mar 2018 16:50:58 +0100 Subject: Add support for backward compatibility for TypeDoc versions <0.9.0 --- packages/website/ts/types.ts | 2 +- packages/website/ts/utils/typedoc_utils.ts | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'packages/website') diff --git a/packages/website/ts/types.ts b/packages/website/ts/types.ts index f0db537e6..5786787c0 100644 --- a/packages/website/ts/types.ts +++ b/packages/website/ts/types.ts @@ -308,7 +308,7 @@ export interface TypeDocNode { returns?: string; declaration: TypeDocNode; flags?: TypeDocFlags; - indexSignature?: TypeDocNode[]; + indexSignature?: TypeDocNode | TypeDocNode[]; signatures?: TypeDocNode[]; parameters?: TypeDocNode[]; typeParameter?: TypeDocNode[]; diff --git a/packages/website/ts/utils/typedoc_utils.ts b/packages/website/ts/utils/typedoc_utils.ts index 992475911..0f79410ae 100644 --- a/packages/website/ts/utils/typedoc_utils.ts +++ b/packages/website/ts/utils/typedoc_utils.ts @@ -170,8 +170,16 @@ export const typeDocUtils = { const methodIfExists = !_.isUndefined(entity.declaration) ? typeDocUtils._convertMethod(entity.declaration, isConstructor, sections, sectionName, docId) : undefined; - const indexSignatureIfExists = !_.isUndefined(entity.indexSignature) - ? typeDocUtils._convertIndexSignature(entity.indexSignature[0], sections, sectionName, docId) + const doesIndexSignatureExist = !_.isUndefined(entity.indexSignature); + const isIndexSignatureArray = _.isArray(entity.indexSignature); + // HACK: TypeDoc Versions <0.9.0 indexSignature is of type TypeDocNode[] + // Versions >0.9.0 have it as type TypeDocNode + const indexSignature = + doesIndexSignatureExist && isIndexSignatureArray + ? ((entity.indexSignature as TypeDocNode[])[0] as TypeDocNode) + : (entity.indexSignature as TypeDocNode); + const indexSignatureIfExists = doesIndexSignatureExist + ? typeDocUtils._convertIndexSignature(indexSignature, sections, sectionName, docId) : undefined; const commentIfExists = !_.isUndefined(entity.comment) && !_.isUndefined(entity.comment.shortText) -- cgit v1.2.3 From abb9eb0df4cff1bfc24831ae82707d8755486fc6 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Sat, 3 Mar 2018 16:51:45 +0100 Subject: Because we now include non-0x.js source, the keys changed. Needed to add both for backward compatibility with old doc JSON's --- .../ts/containers/zero_ex_js_documentation.ts | 33 ++++++++++++++++------ 1 file changed, 25 insertions(+), 8 deletions(-) (limited to 'packages/website') diff --git a/packages/website/ts/containers/zero_ex_js_documentation.ts b/packages/website/ts/containers/zero_ex_js_documentation.ts index 500bf8d96..536639ee5 100644 --- a/packages/website/ts/containers/zero_ex_js_documentation.ts +++ b/packages/website/ts/containers/zero_ex_js_documentation.ts @@ -102,6 +102,7 @@ const docsInfoConfig: DocsInfoConfig = { 'ApprovalContractEventArgs', 'TokenContractEventArgs', 'ZeroExConfig', + 'TransactionReceipt', 'TransactionReceiptWithDecodedLogs', 'LogWithDecodedArgs', 'EtherTokenEvents', @@ -124,17 +125,33 @@ const docsInfoConfig: DocsInfoConfig = { 'FilterObject', ], sectionNameToModulePath: { - [zeroExJsDocSections.zeroEx]: ['"src/0x"'], - [zeroExJsDocSections.exchange]: ['"src/contract_wrappers/exchange_wrapper"'], - [zeroExJsDocSections.tokenRegistry]: ['"src/contract_wrappers/token_registry_wrapper"'], - [zeroExJsDocSections.token]: ['"src/contract_wrappers/token_wrapper"'], - [zeroExJsDocSections.etherToken]: ['"src/contract_wrappers/ether_token_wrapper"'], + [zeroExJsDocSections.zeroEx]: ['"0x.js/src/0x"', '"src/0x"'], + [zeroExJsDocSections.exchange]: [ + '"0x.js/src/contract_wrappers/exchange_wrapper"', + '"src/contract_wrappers/exchange_wrapper"', + ], + [zeroExJsDocSections.tokenRegistry]: [ + '"0x.js/src/contract_wrappers/token_registry_wrapper"', + '"src/contract_wrappers/token_registry_wrapper"', + ], + [zeroExJsDocSections.token]: [ + '"0x.js/src/contract_wrappers/token_wrapper"', + '"src/contract_wrappers/token_wrapper"', + ], + [zeroExJsDocSections.etherToken]: [ + '"0x.js/src/contract_wrappers/ether_token_wrapper"', + '"src/contract_wrappers/ether_token_wrapper"', + ], [zeroExJsDocSections.proxy]: [ - '"src/contract_wrappers/proxy_wrapper"', + '"0x.js/src/contract_wrappers/proxy_wrapper"', + '"0x.js/src/contract_wrappers/token_transfer_proxy_wrapper"', '"src/contract_wrappers/token_transfer_proxy_wrapper"', ], - [zeroExJsDocSections.orderWatcher]: ['"src/order_watcher/order_state_watcher"'], - [zeroExJsDocSections.types]: ['"src/types"'], + [zeroExJsDocSections.orderWatcher]: [ + '"0x.js/src/order_watcher/order_state_watcher"', + '"src/order_watcher/order_state_watcher"', + ], + [zeroExJsDocSections.types]: ['"0x.js/src/types"', '"src/types"', '"types/src/index"'], }, menuSubsectionToVersionWhenIntroduced: { [zeroExJsDocSections.etherToken]: '0.7.1', -- cgit v1.2.3 From 456f09491354ca573475f0fc44009b83b2d72bf5 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Sat, 3 Mar 2018 16:52:59 +0100 Subject: Add support for merging multiple topLevel packages under a single section. For now, we simply merge the two package's children (works well for merging 0x.js types and @0xproject/types) --- packages/website/ts/utils/typedoc_utils.ts | 47 +++++++++++++++++------------- 1 file changed, 27 insertions(+), 20 deletions(-) (limited to 'packages/website') diff --git a/packages/website/ts/utils/typedoc_utils.ts b/packages/website/ts/utils/typedoc_utils.ts index 0f79410ae..7acb0a7cb 100644 --- a/packages/website/ts/utils/typedoc_utils.ts +++ b/packages/website/ts/utils/typedoc_utils.ts @@ -41,18 +41,17 @@ export const typeDocUtils = { isPrivateOrProtectedProperty(propertyName: string): boolean { return _.startsWith(propertyName, '_'); }, - getModuleDefinitionBySectionNameIfExists( - versionDocObj: TypeDocNode, - modulePaths: string[], - ): TypeDocNode | undefined { - const modules = versionDocObj.children; - for (const mod of modules) { - if (_.includes(modulePaths, mod.name)) { - const moduleWithName = mod; - return moduleWithName; - } - } - return undefined; + getModuleDefinitionsBySectionName(versionDocObj: TypeDocNode, configModulePaths: string[]): TypeDocNode[] { + const moduleDefinitions: TypeDocNode[] = []; + const jsonModules = versionDocObj.children; + _.each(jsonModules, jsonMod => { + _.each(configModulePaths, configModulePath => { + if (_.includes(configModulePath, jsonMod.name)) { + moduleDefinitions.push(jsonMod); + } + }); + }); + return moduleDefinitions; }, convertToDocAgnosticFormat(typeDocJson: TypeDocNode, docsInfo: DocsInfo): DocAgnosticFormat { const subMenus = _.values(docsInfo.getMenu()); @@ -63,12 +62,20 @@ export const typeDocUtils = { if (_.isUndefined(modulePathsIfExists)) { return; // no-op } - const packageDefinitionIfExists = typeDocUtils.getModuleDefinitionBySectionNameIfExists( - typeDocJson, - modulePathsIfExists, - ); - if (_.isUndefined(packageDefinitionIfExists)) { + const packageDefinitions = typeDocUtils.getModuleDefinitionsBySectionName(typeDocJson, modulePathsIfExists); + let packageDefinitionWithMergedChildren; + if (_.isEmpty(packageDefinitions)) { return; // no-op + } else if (packageDefinitions.length === 1) { + packageDefinitionWithMergedChildren = packageDefinitions[0]; + } else { + packageDefinitionWithMergedChildren = packageDefinitions[0]; + for (let i = 1; i < packageDefinitions.length; i++) { + packageDefinitionWithMergedChildren.children = [ + ...packageDefinitionWithMergedChildren.children, + ...packageDefinitions[i].children, + ]; + } } // Since the `types.ts` file is the only file that does not export a module/class but @@ -77,10 +84,10 @@ export const typeDocUtils = { let entities; let packageComment = ''; if (sectionName === docsInfo.sections.types) { - entities = packageDefinitionIfExists.children; + entities = packageDefinitionWithMergedChildren.children; } else { - entities = packageDefinitionIfExists.children[0].children; - const commentObj = packageDefinitionIfExists.children[0].comment; + entities = packageDefinitionWithMergedChildren.children[0].children; + const commentObj = packageDefinitionWithMergedChildren.children[0].comment; packageComment = !_.isUndefined(commentObj) ? commentObj.shortText : packageComment; } -- cgit v1.2.3 From 5794349d979be64deef0cf1cbb9e69b5691f99df Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Sat, 3 Mar 2018 17:02:12 +0100 Subject: Add comment about typeDoc versions --- packages/website/ts/types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/website') diff --git a/packages/website/ts/types.ts b/packages/website/ts/types.ts index 5786787c0..28663270e 100644 --- a/packages/website/ts/types.ts +++ b/packages/website/ts/types.ts @@ -308,7 +308,7 @@ export interface TypeDocNode { returns?: string; declaration: TypeDocNode; flags?: TypeDocFlags; - indexSignature?: TypeDocNode | TypeDocNode[]; + indexSignature?: TypeDocNode | TypeDocNode[]; // TypeDocNode in TypeDoc V0.9.0 signatures?: TypeDocNode[]; parameters?: TypeDocNode[]; typeParameter?: TypeDocNode[]; -- cgit v1.2.3 From 1b5742fbf094ae9e5e745fa61760fb0a4eb871ec Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Sat, 3 Mar 2018 17:03:51 +0100 Subject: Add hack comment --- packages/website/ts/utils/typedoc_utils.ts | 3 +++ 1 file changed, 3 insertions(+) (limited to 'packages/website') diff --git a/packages/website/ts/utils/typedoc_utils.ts b/packages/website/ts/utils/typedoc_utils.ts index 7acb0a7cb..eb4b05e04 100644 --- a/packages/website/ts/utils/typedoc_utils.ts +++ b/packages/website/ts/utils/typedoc_utils.ts @@ -69,6 +69,9 @@ export const typeDocUtils = { } else if (packageDefinitions.length === 1) { packageDefinitionWithMergedChildren = packageDefinitions[0]; } else { + // HACK: For now, if there are two modules to display in a single section, + // we simply concat the children. This works for our limited use-case where + // we want to display types stored in two files under a single section packageDefinitionWithMergedChildren = packageDefinitions[0]; for (let i = 1; i < packageDefinitions.length; i++) { packageDefinitionWithMergedChildren.children = [ -- cgit v1.2.3 From c797c720be1bf77b520c695ff2cb6940e9d9dd14 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Sat, 3 Mar 2018 19:11:09 +0100 Subject: Update all mentions of the repo name being `0x.js` to `0x-monorepo` --- packages/website/md/docs/0xjs/installation.md | 2 +- packages/website/md/docs/0xjs/introduction.md | 2 +- packages/website/md/docs/connect/introduction.md | 2 +- packages/website/ts/containers/connect_documentation.ts | 2 +- packages/website/ts/containers/zero_ex_js_documentation.ts | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) (limited to 'packages/website') diff --git a/packages/website/md/docs/0xjs/installation.md b/packages/website/md/docs/0xjs/installation.md index 5f5c9137e..ac0a47699 100644 --- a/packages/website/md/docs/0xjs/installation.md +++ b/packages/website/md/docs/0xjs/installation.md @@ -18,7 +18,7 @@ import { ZeroEx } from '0x.js'; **Install** -Download the UMD module from our [releases page](https://github.com/0xProject/0x.js/releases) and add it to your project. +Download the UMD module from our [releases page](https://github.com/0xProject/0x-monorepo/releases) and add it to your project. **Import** diff --git a/packages/website/md/docs/0xjs/introduction.md b/packages/website/md/docs/0xjs/introduction.md index 7bad3eaa9..008376d33 100644 --- a/packages/website/md/docs/0xjs/introduction.md +++ b/packages/website/md/docs/0xjs/introduction.md @@ -1 +1 @@ -Welcome to the [0x.js](https://github.com/0xProject/0x.js) documentation! 0x.js is a Javascript library for interacting with the 0x protocol. With it, you can easily make calls to the 0x smart contracts as well as any ERC20 token. Functionality includes generating, signing, filling and cancelling orders, verifying an orders signature, setting or checking a users ERC20 token balance/allowance and much more. +Welcome to the [0x.js](https://github.com/0xProject/0x-monorepo) documentation! 0x.js is a Javascript library for interacting with the 0x protocol. With it, you can easily make calls to the 0x smart contracts as well as any ERC20 token. Functionality includes generating, signing, filling and cancelling orders, verifying an orders signature, setting or checking a users ERC20 token balance/allowance and much more. diff --git a/packages/website/md/docs/connect/introduction.md b/packages/website/md/docs/connect/introduction.md index 533e1481a..4e3039442 100644 --- a/packages/website/md/docs/connect/introduction.md +++ b/packages/website/md/docs/connect/introduction.md @@ -1 +1 @@ -Welcome to the [0x Connect](https://github.com/0xProject/0x.js/tree/development/packages/connect) documentation! 0x Connect is a Javascript library that makes it easy to interact with relayers that conform to the [Standard Relayer API](https://github.com/0xProject/standard-relayer-api). Functionality includes getting supported token pairs from a relayer, getting orders filtered by different attributes, getting individual orders specified by order hash, getting orderbooks for specific token pairs, getting fee information, and submitting orders. +Welcome to the [0x Connect](https://github.com/0xProject/0x-monorepo/tree/development/packages/connect) documentation! 0x Connect is a Javascript library that makes it easy to interact with relayers that conform to the [Standard Relayer API](https://github.com/0xProject/standard-relayer-api). Functionality includes getting supported token pairs from a relayer, getting orders filtered by different attributes, getting individual orders specified by order hash, getting orderbooks for specific token pairs, getting fee information, and submitting orders. diff --git a/packages/website/ts/containers/connect_documentation.ts b/packages/website/ts/containers/connect_documentation.ts index 464bdcd74..6a5ba1f99 100644 --- a/packages/website/ts/containers/connect_documentation.ts +++ b/packages/website/ts/containers/connect_documentation.ts @@ -28,7 +28,7 @@ const docsInfoConfig: DocsInfoConfig = { id: DocPackages.Connect, type: SupportedDocJson.TypeDoc, displayName: '0x Connect', - packageUrl: 'https://github.com/0xProject/0x.js', + packageUrl: 'https://github.com/0xProject/0x-monorepo', menu: { introduction: [connectDocSections.introduction], install: [connectDocSections.installation], diff --git a/packages/website/ts/containers/zero_ex_js_documentation.ts b/packages/website/ts/containers/zero_ex_js_documentation.ts index 500bf8d96..a9d3249ee 100644 --- a/packages/website/ts/containers/zero_ex_js_documentation.ts +++ b/packages/website/ts/containers/zero_ex_js_documentation.ts @@ -40,7 +40,7 @@ const docsInfoConfig: DocsInfoConfig = { id: DocPackages.ZeroExJs, type: SupportedDocJson.TypeDoc, displayName: '0x.js', - packageUrl: 'https://github.com/0xProject/0x.js', + packageUrl: 'https://github.com/0xProject/0x-monorepo', menu: { introduction: [zeroExJsDocSections.introduction], install: [zeroExJsDocSections.installation], -- cgit v1.2.3 From 82c5be25644c69a71386b8ef50e4491356b47536 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Sun, 4 Mar 2018 15:29:14 +0100 Subject: Remove unnecessary type assertion --- packages/website/ts/utils/typedoc_utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/website') diff --git a/packages/website/ts/utils/typedoc_utils.ts b/packages/website/ts/utils/typedoc_utils.ts index eb4b05e04..ce7df4dbb 100644 --- a/packages/website/ts/utils/typedoc_utils.ts +++ b/packages/website/ts/utils/typedoc_utils.ts @@ -186,7 +186,7 @@ export const typeDocUtils = { // Versions >0.9.0 have it as type TypeDocNode const indexSignature = doesIndexSignatureExist && isIndexSignatureArray - ? ((entity.indexSignature as TypeDocNode[])[0] as TypeDocNode) + ? (entity.indexSignature as TypeDocNode[])[0] : (entity.indexSignature as TypeDocNode); const indexSignatureIfExists = doesIndexSignatureExist ? typeDocUtils._convertIndexSignature(indexSignature, sections, sectionName, docId) -- cgit v1.2.3 From 65eb3997d93a666165a9df1cff25dbe3d0dd5712 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Sun, 4 Mar 2018 19:35:59 +0100 Subject: Publish - 0x.js@0.33.0 - @0xproject/abi-gen@0.2.4 - @0xproject/assert@0.1.0 - @0xproject/base-contract@0.0.2 - chai-as-promised-typescript-typings@0.0.10 - chai-typescript-typings@0.0.4 - @0xproject/connect@0.6.2 - contracts@2.1.14 - @0xproject/deployer@0.2.0 - @0xproject/dev-utils@0.2.0 - ethers-typescript-typings@0.0.2 - @0xproject/json-schemas@0.7.13 - @0xproject/monorepo-scripts@0.1.12 - @0xproject/subproviders@0.6.0 - @0xproject/testnet-faucets@1.0.15 - @0xproject/tslint-config@0.4.10 - @0xproject/types@0.3.0 - @0xproject/utils@0.4.0 - web3-typescript-typings@0.10.0 - @0xproject/web3-wrapper@0.2.0 - @0xproject/website@0.0.17 --- packages/website/package.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'packages/website') diff --git a/packages/website/package.json b/packages/website/package.json index 07122cc7c..ca1b596f3 100644 --- a/packages/website/package.json +++ b/packages/website/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/website", - "version": "0.0.16", + "version": "0.0.17", "private": true, "description": "Website and 0x portal dapp", "scripts": { @@ -18,9 +18,9 @@ "author": "Fabio Berger", "license": "Apache-2.0", "dependencies": { - "0x.js": "^0.32.4", - "@0xproject/subproviders": "^0.5.0", - "@0xproject/utils": "^0.3.4", + "0x.js": "^0.33.0", + "@0xproject/subproviders": "^0.6.0", + "@0xproject/utils": "^0.4.0", "accounting": "^0.4.1", "basscss": "^8.0.3", "blockies": "^0.0.2", @@ -87,7 +87,7 @@ "copy-webpack-plugin": "^4.0.1", "copyfiles": "^1.2.0", "css-loader": "0.23.x", - "ethers-typescript-typings": "^0.0.1", + "ethers-typescript-typings": "^0.0.2", "exports-loader": "0.6.x", "imports-loader": "0.6.x", "json-loader": "^0.5.4", @@ -99,7 +99,7 @@ "tslint": "5.8.0", "tslint-config-0xproject": "^0.0.2", "typescript": "2.7.1", - "web3-typescript-typings": "^0.9.11", + "web3-typescript-typings": "^0.10.0", "webpack": "^3.1.0", "webpack-dev-middleware": "^1.10.0", "webpack-dev-server": "^2.5.0" -- cgit v1.2.3