Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
1c58fac
initial docs folder replacement
leightkt Apr 27, 2023
f4e5212
update links on intro page
leightkt Apr 27, 2023
d197771
add export NODE_OPTIONS to build command
leightkt Apr 27, 2023
22160b5
update links on contribution guide
leightkt Apr 27, 2023
15ef4f8
audit and fix remainder of links
leightkt Apr 27, 2023
7675c2f
update svelte config to warn for handleHttpError and handleMissingId
leightkt Apr 27, 2023
b24f9fc
rename Introduction file
leightkt Apr 28, 2023
89b029c
cleanup introduction file
leightkt Apr 28, 2023
f4bc931
copy over docs readme
leightkt Apr 28, 2023
03cd06f
match font color
leightkt Apr 28, 2023
82b7936
fix merge conficts with dev
leightkt Apr 28, 2023
589e72d
format everything
leightkt Apr 28, 2023
d3614be
upate .prettierrc to match previous docs- reformat
leightkt May 1, 2023
9c31556
remove redunant line from .gitignore
leightkt May 1, 2023
98fc790
add GA tag fix package name, remove comment
leightkt May 1, 2023
0a49ff2
add unstoppable resolution to modules
leightkt May 1, 2023
e142853
add new graphic
leightkt May 2, 2023
1a1deba
add apikey to react module
leightkt May 2, 2023
f47e5c4
add cede.store
leightkt May 2, 2023
214b88f
add cede warning
leightkt May 2, 2023
b6a7151
update network list
leightkt May 3, 2023
4b9504b
merge dev
leightkt May 4, 2023
53b0ea0
cede updates
leightkt May 4, 2023
bfae7ba
merge develop
leightkt May 5, 2023
6be290e
add secondary tokens
leightkt May 5, 2023
2f1273f
add core package note
leightkt May 8, 2023
86f2cc9
Merge branch 'develop' into kitdocs-upgrade
leightkt May 8, 2023
e9cb50a
fix accountCenter double declaration
leightkt May 8, 2023
6c2143d
update Tabs component colors
gesquinca May 9, 2023
d85e9b6
updates
leightkt May 9, 2023
1e82869
remove extra tabs component
leightkt May 9, 2023
1eda20a
merge develop
leightkt May 9, 2023
1aa8084
move cede.store
leightkt May 9, 2023
37301eb
update packages add secondary chains to docs connect module and bn icon
leightkt May 9, 2023
b65c5b3
add frame to docs
leightkt May 10, 2023
9bd47cf
merge develop
leightkt May 11, 2023
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
13 changes: 0 additions & 13 deletions docs/.eslintignore

This file was deleted.

20 changes: 0 additions & 20 deletions docs/.eslintrc.cjs

This file was deleted.

2 changes: 1 addition & 1 deletion docs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ node_modules
.env
.env.*
!.env.example
.vercel
vite.config.js.timestamp-*
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ Run `yarn build` and confirm no errors present from the proposed changes.

Confirm vercel build within PR builds without error and check instance deployment for accuracy.

PR should target branch the main develop branch - [develop](https://github.com/blocknative/web3-onboard/tree/develop).
PR should target branch the main develop branch - [develop](https://github.com/blocknative/web3-onboard/tree/develop).
83 changes: 38 additions & 45 deletions docs/package.json
Original file line number Diff line number Diff line change
@@ -1,58 +1,49 @@
{
"name": "docs",
"version": "0.0.1",
"private": true,
"scripts": {
"dev": "svelte-kit dev",
"build": "NODE_OPTIONS=--max_old_space_size=8192 svelte-kit build",
"package": "svelte-kit package",
"preview": "svelte-kit preview",
"dev": "vite dev",
"build": "export NODE_OPTIONS=--max-old-space-size=32768 && vite build",
"preview": "vite preview",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"lint": "prettier --plugin-search-dir . --check .",
"format": "prettier --plugin-search-dir . --write .",
"prepare": "svelte-kit sync",
"test": "playwright test",
"check": "svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-check --tsconfig ./tsconfig.json --watch",
"lint": "prettier --check --plugin-search-dir=. . && eslint .",
"format": "prettier --write --plugin-search-dir=. .",
"w3o-latest-prod": "yarn add '@web3-onboard/coinbase' '@web3-onboard/core' '@web3-onboard/dcent' '@web3-onboard/enkrypt' '@web3-onboard/fortmatic' '@web3-onboard/gas' '@web3-onboard/gnosis' '@web3-onboard/infinity-wallet' '@web3-onboard/injected-wallets' '@web3-onboard/keepkey' '@web3-onboard/keystone' '@web3-onboard/ledger' '@web3-onboard/magic' '@web3-onboard/mew-wallet' '@web3-onboard/portis' '@web3-onboard/sequence' '@web3-onboard/taho' '@web3-onboard/torus' '@web3-onboard/transaction-preview' '@web3-onboard/trezor' '@web3-onboard/trust' '@web3-onboard/uauth' '@web3-onboard/walletconnect' '@web3-onboard/web3auth' '@web3-onboard/xdefi' '@web3-onboard/frame'",
"w3o-latest-alpha": "yarn add '@web3-onboard/coinbase@next' '@web3-onboard/core@next' '@web3-onboard/dcent@next' '@web3-onboard/enkrypt@next' '@web3-onboard/fortmatic@next' '@web3-onboard/gas@next' '@web3-onboard/gnosis@next' '@web3-onboard/infinity-wallet@next' '@web3-onboard/injected-wallets@next' '@web3-onboard/keepkey@next' '@web3-onboard/keystone@next' '@web3-onboard/ledger@next' '@web3-onboard/magic@next' '@web3-onboard/mew-wallet@next' '@web3-onboard/portis@next' '@web3-onboard/sequence@next' '@web3-onboard/taho@next' '@web3-onboard/torus@next' '@web3-onboard/transaction-preview@next' '@web3-onboard/trezor@next' '@web3-onboard/trust@next' '@web3-onboard/uauth@next' '@web3-onboard/walletconnect@next' '@web3-onboard/web3auth@next' '@web3-onboard/xdefi@next' '@web3-onboard/frame'"
},
"devDependencies": {
"@algolia/client-search": "^4.14.2",
"@docsearch/css": "^3.2.1",
"@docsearch/js": "^3.2.1",
"@iconify-json/ri": "^1.1.3",
"@playwright/test": "^1.22.2",
"@sveltejs/adapter-static": "^1.0.0-next.39",
"@sveltejs/adapter-vercel": "next",
"@sveltejs/kit": "1.0.0-next.357",
"@svelteness/kit-docs": "^0.22.12",
"@tailwindcss/typography": "^0.5.2",
"@types/react": "^18.0.21",
"@types/react-dom": "^18.0.6",
"@typescript-eslint/eslint-plugin": "^5.27.0",
"@typescript-eslint/parser": "^5.27.0",
"@vitebook/client": "^0.100.5",
"@vitebook/core": "^0.100.5",
"@vitebook/markdown-shiki": "^0.100.5",
"@vitebook/markdown-svelte": "^0.100.5",
"autoprefixer": "^10.4.7",
"clsx": "^1.1.1",
"daisyui": "^2.17.0",
"eslint": "^8.16.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-svelte3": "^4.0.0",
"postcss": "^8.4.14",
"prettier": "^2.6.2",
"prettier-plugin-svelte": "^2.7.0",
"@algolia/client-search": "^4.17.0",
"@docsearch/css": "^3.3.3",
"@docsearch/js": "^3.3.3",
"@iconify-json/ri": "^1.0.0",
"@sveltejs/adapter-auto": "^2.0.0",
"@sveltejs/kit": "^1.5.0",
"@svelteness/kit-docs": "^1.1.3",
"@tailwindcss/typography": "^0.5.9",
"@types/animejs": "^3.1.7",
"@types/react": "^18.0.37",
"assert": "^2.0.0",
"autoprefixer": "^10.4.14",
"clsx": "^1.0.0",
"crypto-browserify": "^3.12.0",
"prettier": "^2.8.0",
"prettier-plugin-svelte": "^2.8.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"rollup-plugin-polyfill-node": "^0.11.0",
"shiki": "^0.10.1",
"svelte": "^3.49.0",
"svelte-check": "^2.7.1",
"svelte-preprocess": "^4.10.7",
"tslib": "^2.3.1",
"typescript": "^4.7.2",
"unplugin-icons": "^0.13.4"
"rollup-plugin-polyfill-node": "^0.12.0",
"shiki": "^0.12.0",
"stream-browserify": "^3.0.0",
"svelte": "^3.54.0",
"svelte-check": "^3.0.1",
"svelte-preprocess": "^5.0.3",
"tslib": "^2.4.1",
"typescript": "^5.0.4",
"unplugin-icons": "^0.14.0",
"vite": "^4.2.2"
},
"type": "module",
"dependencies": {
Expand All @@ -62,7 +53,7 @@
"@web3-onboard/dcent": "^2.2.6-alpha.2",
"@web3-onboard/enkrypt": "^2.0.3-alpha.2",
"@web3-onboard/fortmatic": "^2.0.18-alpha.2",
"@web3-onboard/frame": "2.21.2-alpha.1",
"@web3-onboard/frame": "^2.21.2-alpha.1",
"@web3-onboard/gas": "^2.1.7-alpha.2",
"@web3-onboard/gnosis": "^2.1.9-alpha.2",
"@web3-onboard/infinity-wallet": "^2.0.3-alpha.2",
Expand All @@ -81,9 +72,11 @@
"@web3-onboard/trust": "^2.0.3-alpha.2",
"@web3-onboard/uauth": "^2.0.4-alpha.2",
"@web3-onboard/walletconnect": "^2.3.7-alpha.3",
"@web3-onboard/web3auth": "^2.2.1-alpha.1",
"@web3-onboard/xdefi": "^2.0.3-alpha.2",
"animejs": "^3.2.1",
"bnc-sdk": "^4.6.6",
"ethers": "^5.7.0"
"ethers": "^5.7.0",
"tailwindcss": "^3.3.1"
}
}
10 changes: 0 additions & 10 deletions docs/playwright.config.ts

This file was deleted.

16 changes: 8 additions & 8 deletions docs/src/app.d.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/// <reference types="@sveltejs/kit" />
/// <reference types="@svelteness/kit-docs/globals" />

// See https://kit.svelte.dev/docs/types#app
// for information about these interfaces
// and what to do when importing types
declare namespace App {
// interface Locals {}
// interface Platform {}
// interface Session {}
// interface Stuff {}
declare global {
namespace App {
// interface Error {}
// interface Locals {}
// interface PageData {}
// interface Platform {}
}
}

declare module '@svelteness/kit-docs/tailwind.config.cjs'
export {}
24 changes: 9 additions & 15 deletions docs/src/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,8 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" type="image/x-icon" href="https://www.blocknative.com/hubfs/Icons%20and%20Illustrations/blocknative%20favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
%sveltekit.head%

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-121780722-2"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-121780722-2');
gtag('config', 'G-WQ8M55VX1Z');
</script>
<link rel="icon" href="%sveltekit.assets%/favicon.ico" />
<meta name="viewport" content="width=device-width" />

<script>
const key = 'svelteness::color-scheme'
Expand All @@ -26,8 +15,13 @@
document.documentElement.classList.remove('dark')
}
</script>

%sveltekit.head%

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-121780722-2"></script>
</head>
<body>
<div>%sveltekit.body%</div>
<body data-sveltekit-preload-data="hover">
<div style="display: contents">%sveltekit.body%</div>
</body>
</html>
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion docs/src/img/svelte-horizontal.svg

This file was deleted.

112 changes: 112 additions & 0 deletions docs/src/kit-docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
# `kit-docs`

## Global Components

You can create Svelte components that are global by placing them in this directory. Global
components are imported into every single Markdown file. In addition, they're automatically
mapped to Markdown containers, on which you can pass in props and dynamic slot elements.

First, create a component in this directory:

```
src
└─ kit-docs
├─ Button.svelte <-
```

Now, inside your markdown files you can use the `<Button>` component like so:

```svelte title=Component.md
<!-- Use the component as-is. -->
<Button />

<!-- Or, use a markdown container. -->
:::button propA="valueA"|propB=10 Default slot content here. :::

<!-- You can pass in dynamic slot elements! -->
<!-- If you omit `tag`, it'll default to `<p>`. -->
:::button (tag=h1&slot=title)=Title Default slot content here. :::
```

### Configuration

You can configure how global Svelte components are mapped to rules or containers by setting
them in your plugin like so:

```js title=svelte.config.js
kitDocsPlugin({
markdown: {
components: [
// Override inline rule.
// `Image.svelte` must be a global component.
{ name: 'Image', type: 'inline', rule: 'image' },
// Override block rule.
// `Blockquote.svelte` must be a global component.
{ name: 'Blockquote', type: 'block', rule: 'blockquote' },
// Create custom container.
// `Button.svelte` must be a global component.
{ name: 'Button', type: 'custom', container: { marker: '!' } }
]
}
})
```

The configuration above will transform the following Markdown like so:

```md
![alt text](https://...)

> This is a blockquote.

!!!button
...
!!!
```

```svelte
<Image href="https://..." alt="alt text" />

<Blockquote>This is a blockquote.</Blockquote>

<Button>...</Button>
```

## Default Components

There's a few components we provide out of the box such as `CodeFence`, `CodeInline`, `Link` and
others. You can find all of our [default components](https://github.com/svelteness/kit-docs/tree/main/packages/kit-docs/src/lib/kit-docs)
on GitHub.

### Overriding

If you want to override any of the default components, simply create a Svelte component with the
same name in this directory and make sure it accepts the same props.

For example, you can override `CodeFence` by creating it in this directory like so:

```
src
└─ kit-docs
├─ CodeFence.svelte <-
```

Finally, you can use the following minimal boilerplate and style the component as desired:

```svelte title=CodeFence.svelte|copy
<script>
/** @type {string} */
export let lang
/** @type {string} */
export let ext
/** @type {string} */
export let code
/** @type {number} */
export let linesCount
/** @type {[number, number][]} */
export let highlightLines = []
</script>

<div class={`lang-${lang} ext-${ext}`}>
{@html code}
</div>
```
1 change: 0 additions & 1 deletion docs/src/kit-docs/index.ts

This file was deleted.

2 changes: 1 addition & 1 deletion docs/src/kit-docs/tabs/TabItem.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
}

.tab.selected {
color: var(--kd-color-brand);
color: rgb(var(--kd-color-brand));
border-color: currentColor;
}
</style>
8 changes: 7 additions & 1 deletion docs/src/kit-docs/tabs/Tabs.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

<div class="tabs w-full">
<ul
class="flex items-center w-full list-none m-0 p-0 overflow-x-auto border-b border-gray-divider"
class="flex items-center w-full list-none m-0 p-0 overflow-x-auto border-b"
role="tablist"
aria-orientation="horizontal"
>
Expand All @@ -38,3 +38,9 @@
<slot />
</div>
</div>

<style>
.tabs ul {
border-color: var(--kd-color-gray-divider);
}
</style>
Binary file added docs/src/lib/assets/favicon.ico
Binary file not shown.
Loading