Skip to content
This repository was archived by the owner on Feb 8, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ compiled
.DS_Store
docs
.vscode/
documentation/src/docs.json
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,13 @@ cases (particularly around offer / trade history), properties were renamed for
clarity.

```js
import {
getTokenIdentifier,
getBalanceIdentifier,
DataProvider,
} from "@stellar/wallet-sdk";
import { DataProvider } from "@stellar/wallet-sdk";

// You'll use your DataProvider instance to ask for data from Stellar.
const dataProvider = new DataProvider({
serverUrl: "https://horizon.stellar.org",
accountOrKey: "<<Insert public key>>",
networkPassphrase: "Public Global Stellar Network ; September 2015",
});

// Some class functions will fetch data directly.
Expand Down
4 changes: 2 additions & 2 deletions documentation/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "documentation",
"version": "0.1.0",
"version": "0.2.0",
"private": true,
"dependencies": {
"lodash": "^4.17.19",
Expand All @@ -14,7 +14,7 @@
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"build": "(cp ../dist/docs.json src/ || copy ..\\\\dist\\\\docs.json src) && react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
Expand Down
12 changes: 7 additions & 5 deletions documentation/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,10 @@ const LIBRARY_EXPORTS = {
export const App = () => {
const items = docs.children.reduce((memo, child) => {
if (child.children) {
return [...memo, ...child.children];
if (child.kindString === "Namespace") {
return [...memo, ...child.children];
}
return [...memo, child, ...child.children];
}
return [...memo, child];
}, []);
Expand Down Expand Up @@ -115,10 +118,8 @@ export const App = () => {
);

/*
We want the index to display:
- the kind names in KINDS_TO_DISPLAY
- the exports defined in LIBRARY_EXPORTS
And we want to index them by KIND.
We want the index to display the exports defined in LIBRARY_EXPORTS,
indexed by kind.
*/

const libraryExports = Object.keys(LIBRARY_EXPORTS).reduce((memo, name) => {
Expand All @@ -144,6 +145,7 @@ export const App = () => {
item.kindString === "Interface" ||
item.kindString === "Type alias" ||
item.kindString === "Enumeration" ||
item.kindString === "Variable" ||
item.kindString === "Object literal",
)
.reduce((memo, item) => {
Expand Down
7 changes: 4 additions & 3 deletions documentation/src/components/Comment.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ const El = styled.div`
word-break: break-word;
`;

export const Comment = ({ shortText, text }) => (
export const Comment = ({ summary }) => (
<El>
<Markdown>{shortText}</Markdown>
<Markdown>{text}</Markdown>
<Markdown>
{summary.reduce((accumulator, { text }) => accumulator + text, "")}
</Markdown>
</El>
);
13 changes: 7 additions & 6 deletions documentation/src/components/DisplayInterface.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,13 @@ export const DisplayInterface = (params) => {
))}
</div>

{indexSignature.map(({ parameters, type }) => (
<Block key={parameters[0].id}>
[{parameters[0].name}: <TypePeeker {...parameters[0].type} />
]: <TypePeeker {...type} />;
</Block>
))}
{!!indexSignature.length &&
indexSignature.map(({ parameters, type }) => (
<Block key={parameters[0].id}>
[{parameters[0].name}: <TypePeeker {...parameters[0].type} />
]: <TypePeeker {...type} />;
</Block>
))}

{children
.sort((a, b) => a.sources[0].line - b.sources[0].line)
Expand Down
6 changes: 2 additions & 4 deletions documentation/src/components/DisplayItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const DisplayItem = ({ isRootElement, ...params }) => {

case "Variable":
case "Property":
case "Enumeration member":
case "Enumeration Member":
item = <DisplayProperty {...params} />;
break;

Expand Down Expand Up @@ -90,9 +90,7 @@ export const DisplayItem = ({ isRootElement, ...params }) => {
<LineEl>
{sources[0].fileName}
<LineLinkEl
href={`https://github.com/stellar/js-stellar-wallets/tree/master/${
sources[0].fileName
}#L${sources[0].line}`}
href={`https://github.com/stellar/js-stellar-wallets/tree/master/${sources[0].fileName}#L${sources[0].line}`}
target="_blank"
>
({sources[0].line}:{sources[0].character}) ↗️
Expand Down
4 changes: 2 additions & 2 deletions documentation/src/components/DisplayProperty.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ export const DisplayProperty = ({
{flags.isPrivate && <>private </>}
<Semibold>{name}</Semibold>
{isOptional && "?"}:{" "}
{kindString === "Enumeration member" ? (
<span>{defaultValue}</span>
{kindString === "Enumeration Member" ? (
<span>"{type.value}"</span>
) : (
<TypePeeker
{...type}
Expand Down
2 changes: 1 addition & 1 deletion documentation/src/components/TableOfContents.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const SHORT_NAME = {
Constructor: "func",
Variable: "var",
Property: "prop",
"Enumeration member": "enum",
"Enumeration Member": "enum",
Class: "class",
Interface: "interf",
Enumeration: "enum",
Expand Down
1 change: 0 additions & 1 deletion documentation/src/docs.json

This file was deleted.

Loading