diff --git a/package.json b/package.json index 12330fb4..dfea0901 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "frontend", - "version": "0.6.0", + "version": "0.7.0", "homepage": "/", "private": true, "dependencies": { @@ -14,9 +14,9 @@ "@near-wallet-selector/near-wallet": "^7.4.0", "@near-wallet-selector/neth": "^7.4.0", "@near-wallet-selector/sender": "^7.4.0", - "@web3-onboard/core": "^2.13.1", - "@web3-onboard/injected-wallets": "^2.6.0", - "@web3-onboard/react": "^2.5.5", + "@web3-onboard/core": "^2.15.0", + "@web3-onboard/injected-wallets": "^2.7.0", + "@web3-onboard/react": "^2.6.2", "acorn": "^8.8.0", "acorn-jsx": "^5.3.2", "big.js": "^6.1.1", diff --git a/public/index.html b/public/index.html index 838f9962..cfddb1aa 100644 --- a/public/index.html +++ b/public/index.html @@ -7,24 +7,21 @@ - - - + + - - + + - Near Social - - + Blockchain Operating System (BOS) diff --git a/public/manifest.json b/public/manifest.json index 642b9a57..78e429e8 100644 --- a/public/manifest.json +++ b/public/manifest.json @@ -1,6 +1,6 @@ { - "short_name": "Near Social", - "name": "Near Social", + "short_name": "BOS", + "name": "Blockchain Operating System (BOS)", "icons": [ { "src": "favicon.png", @@ -10,6 +10,6 @@ ], "start_url": ".", "display": "standalone", - "theme_color": "#333333", - "background_color": "#ffffff" + "theme_color": "#ffffff", + "background_color": "#000000" } diff --git a/src/App.scss b/src/App.scss index da794f22..799b184c 100644 --- a/src/App.scss +++ b/src/App.scss @@ -1,9 +1,25 @@ +$primary: #ffffff; +$danger: #ff4136; +$body-bg: #000; +$body-color: #eee; +@import url('https://fonts.googleapis.com/css2?family=Silkscreen&display=swap'); +@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@300&family=Silkscreen&display=swap'); +$dark: #eee; +$light: #222; +$font-family-sans-serif: 'IBM Plex Mono', monospace; +$font-family-monospace: 'IBM Plex Mono', monospace; +$component-active-color: #000; + @import "bootstrap"; body, html { -webkit-font-smoothing: antialiased; } +h1, h2, h3, h4, h5, h6 { + font-family: 'Silkscreen', serif; +} + .pointer { cursor: pointer; } diff --git a/src/components/ethers/Web3ConnectButton.js b/src/components/ethers/Web3ConnectButton.js index eed39047..951c733c 100644 --- a/src/components/ethers/Web3ConnectButton.js +++ b/src/components/ethers/Web3ConnectButton.js @@ -7,13 +7,14 @@ export default function Web3ConnectButton() { return (
); diff --git a/src/components/navigation/Logotype.js b/src/components/navigation/Logotype.js index 8e76da66..a5950578 100644 --- a/src/components/navigation/Logotype.js +++ b/src/components/navigation/Logotype.js @@ -1,33 +1,34 @@ import React from "react"; export function Logotype({ color = "white" }) { - return ( - - - - - - ); + return

bOS

; + // return ( + // + // + // + // + // + // ); } diff --git a/src/components/navigation/NavigationButton.js b/src/components/navigation/NavigationButton.js index cec0cdce..dd571846 100644 --- a/src/components/navigation/NavigationButton.js +++ b/src/components/navigation/NavigationButton.js @@ -8,6 +8,7 @@ const StyledNavigationButton = styled.div` font-size: 16px; padding: 10px; border-radius: 8px; + font-family: "Silkscreen", serif; font-weight: var(--font-weight-bold); height: 40px; display: flex; diff --git a/src/components/navigation/NavigationWrapper.js b/src/components/navigation/NavigationWrapper.js index c92aeffb..87e00e41 100644 --- a/src/components/navigation/NavigationWrapper.js +++ b/src/components/navigation/NavigationWrapper.js @@ -3,20 +3,10 @@ import { DesktopNavigation } from "./desktop/DesktopNavigation"; import { MobileNavigation } from "./mobile/MobileNavigation"; export function NavigationWrapper(props) { - const [matches, setMatches] = useState( - window.matchMedia("(min-width: 992px)").matches - ); - - useEffect(() => { - window - .matchMedia("(min-width: 992px)") - .addEventListener("change", (e) => setMatches(e.matches)); - }, []); return ( <> - {matches && } - {!matches && } -
+ +
); } diff --git a/src/components/navigation/desktop/DesktopNavigation.js b/src/components/navigation/desktop/DesktopNavigation.js index 729f8159..ebb00cf8 100644 --- a/src/components/navigation/desktop/DesktopNavigation.js +++ b/src/components/navigation/desktop/DesktopNavigation.js @@ -27,7 +27,7 @@ const StyledNavigation = styled.div` } } - .container { + .container-fluid { display: flex; align-items: center; @@ -60,34 +60,21 @@ const StyledNavigation = styled.div` export function DesktopNavigation(props) { return ( -
+
Home - Create + Editor Documentation
+ - {!props.signedIn && ( - props.requestSignIn()} /> - )} - {props.signedIn && ( - <> - - - - - )}
diff --git a/src/components/navigation/desktop/DevActionsDropdown.js b/src/components/navigation/desktop/DevActionsDropdown.js index 1a008a65..4a42c0c2 100644 --- a/src/components/navigation/desktop/DevActionsDropdown.js +++ b/src/components/navigation/desktop/DevActionsDropdown.js @@ -105,7 +105,7 @@ export function DevActionsDropdown(props) {
    {props.widgetSrc?.edit && ( -
  • +
  • {props.widgetSrc.edit.startsWith(`${account.accountId}/widget/`) @@ -115,7 +115,7 @@ export function DevActionsDropdown(props) {
  • )} {props.widgetSrc?.view && ( -
  • +
  • diff --git a/src/components/navigation/desktop/EditorSignIn.js b/src/components/navigation/desktop/EditorSignIn.js new file mode 100644 index 00000000..aab22d06 --- /dev/null +++ b/src/components/navigation/desktop/EditorSignIn.js @@ -0,0 +1,11 @@ +import { SignInButton } from "../SignInButton"; +import { UserDropdown } from "./UserDropdown"; +import React from "react"; + +export default function EditorSignIn(props) { + return props.signedIn ? ( + + ) : ( + props.requestSignIn()} /> + ); +} diff --git a/src/data/ethersProvider.js b/src/data/ethersProvider.js index 96c6dbf5..507a083e 100644 --- a/src/data/ethersProvider.js +++ b/src/data/ethersProvider.js @@ -16,27 +16,46 @@ export const onboard = init({ wallets: [injected], chains: [ { - id: "0x1", + id: 1, token: "ETH", label: "Ethereum Mainnet", rpcUrl: "https://rpc.ankr.com/eth", }, + { + id: 3, + token: "ETH", + label: "Ropsten - Ethereum Testnet", + rpcUrl: "https://rpc.ankr.com/eth_ropsten", + }, + { + id: 5, + token: "ETH", + label: "Goerli - Ethereum Testnet", + rpcUrl: "https://rpc.ankr.com/eth_goerli", + }, { id: "0x4e454152", token: "ETH", label: "Aurora Mainnet", rpcUrl: "https://mainnet.aurora.dev", }, + { + id: 137, + token: "MATIC", + label: "Matic Mainnet", + rpcUrl: "https://rpc.ankr.com/polygon", + }, ], appMetadata: { - name: "NEAR Discovery", - icon: "", - description: "Decentralized Frontends hosted on a NEAR Blockchain" + name: "bOS", + icon: '', + description: "Blockchain Operating System", }, + theme: "dark", containerElements: { - // connectModal: '#near-social-navigation-bar', - // accountCenter: '#near-social-navigation-bar' - } + // connectModal: '#near-social-navigation-bar', + // accountCenter: "#near-social-web3-account", + }, }); export const useEthersProvider = singletonHook(defaultEthersProvider, () => { diff --git a/src/index.css b/src/index.css index 15a37fbe..2bfa2dc9 100644 --- a/src/index.css +++ b/src/index.css @@ -12,5 +12,7 @@ --font-weight-bold: 600; /* For web3 onboard */ - --account-center-position-top: 60px; + --account-center-z-index: 1070; + --account-center-position-top: -10px; + --account-center-position-right: -10px; } diff --git a/src/pages/EditorPage.js b/src/pages/EditorPage.js index fc34e7a1..f809a095 100644 --- a/src/pages/EditorPage.js +++ b/src/pages/EditorPage.js @@ -12,6 +12,7 @@ import { Nav, OverlayTrigger, Tooltip } from "react-bootstrap"; import RenameModal from "../components/Editor/RenameModal"; import OpenModal from "../components/Editor/OpenModal"; import { useAccountId } from "../data/account"; +import EditorSignIn from "../components/navigation/desktop/EditorSignIn"; const StorageDomain = { page: "editor", @@ -70,7 +71,7 @@ export default function EditorPage(props) { const [tab, setTab] = useState(Tab.Editor); const [layout, setLayoutState] = useState( - ls.get(EditorLayoutKey) || Layout.Tabs + ls.get(EditorLayoutKey) || Layout.Split ); const setLayout = useCallback( @@ -284,11 +285,6 @@ export default function EditorPage(props) { } else { loadFile(widgetSrc); } - analytics("edit", { - props: { - widget: widgetSrc, - }, - }); history.replace(`/edit/`); } else if (path === undefined) { if (files.length === 0) { @@ -557,6 +553,7 @@ export default function EditorPage(props) { updateCode(path, code)} wrapperProps={{ @@ -598,11 +595,15 @@ export default function EditorPage(props) { )}
+
+ +
setWidgetProps(props)} wrapperProps={{ diff --git a/src/pages/EmbedPage.js b/src/pages/EmbedPage.js index 68680874..7a828b3e 100644 --- a/src/pages/EmbedPage.js +++ b/src/pages/EmbedPage.js @@ -20,14 +20,6 @@ export default function EmbedPage(props) { ); }, [query]); - useEffect(() => { - analytics("embed", { - props: { - widget: src, - }, - }); - }, [src]); - return (
{" "} diff --git a/src/pages/ViewPage.js b/src/pages/ViewPage.js index 736b6f37..7687167a 100644 --- a/src/pages/ViewPage.js +++ b/src/pages/ViewPage.js @@ -29,21 +29,8 @@ export default function ViewPage(props) { view: src, } ); - analytics("view", { - props: { - widget: src, - }, - }); }, 1); }, [src, query, setWidgetSrc]); - return ( -
-
-
- {" "} -
-
-
- ); + return ; } diff --git a/src/vm/vm.js b/src/vm/vm.js index 1dcf808a..c151d13b 100644 --- a/src/vm/vm.js +++ b/src/vm/vm.js @@ -1340,6 +1340,8 @@ class VmStack { if (result) { if (result.break) { break; + } else if (result.continue) { + // continue } else { return result; } @@ -1380,6 +1382,8 @@ class VmStack { if (result) { if (result.break) { break; + } else if (result.continue) { + // continue } else { return result; } @@ -1396,6 +1400,8 @@ class VmStack { if (result) { if (result.break) { break; + } else if (result.continue) { + // continue } else { return result; } @@ -1417,6 +1423,10 @@ class VmStack { return { break: true, }; + } else if (token.type === "ContinueStatement") { + return { + continue: true, + }; } else if (token.type === "ThrowStatement") { throw this.executeExpression(token.argument); } else if (token.type === "TryStatement") { @@ -1705,6 +1715,9 @@ export default class VM { if (executionResult?.break) { throw new Error("BreakStatement outside of a loop"); } + if (executionResult?.continue) { + throw new Error("ContinueStatement outside of a loop"); + } const result = executionResult?.result; return isReactObject(result) || diff --git a/yarn.lock b/yarn.lock index 557eb4f4..59189831 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2306,15 +2306,15 @@ ethers "5.5.4" joi "^17.6.1" -"@web3-onboard/core@^2.13.1": - version "2.13.1" - resolved "https://registry.yarnpkg.com/@web3-onboard/core/-/core-2.13.1.tgz#c9d953751b239798ba1792c480babbd5b03ba015" - integrity sha512-1NL7Eev7Pjy/KxE9LaeoAhaNT+/UVoezXiW/GGFCe7Qx2efb74doCRQjjCf82KInyQAvfr8a/0lOQie4xFZ6ig== +"@web3-onboard/core@^2.15.0": + version "2.15.0" + resolved "https://registry.yarnpkg.com/@web3-onboard/core/-/core-2.15.0.tgz#23b0532c9d01aefed086725eeab2ad060a5b4057" + integrity sha512-YE4nBNT90VYxKCfpeyJEACA1W36kmuOlVcaGk/IMrZRUqKxtxFRdvheK7PhD6A5n4u5sEpDafSr7+bH6w6DiOw== dependencies: "@unstoppabledomains/resolution" "^8.0" "@web3-onboard/common" "^2.2.3" bignumber.js "^9.0.0" - bnc-sdk "^4.6.2" + bnc-sdk "^4.6.6" bowser "^2.11.0" ethers "5.5.3" eventemitter3 "^4.0.7" @@ -2326,22 +2326,22 @@ svelte "^3.49.0" svelte-i18n "^3.3.13" -"@web3-onboard/injected-wallets@^2.6.0": - version "2.6.0" - resolved "https://registry.yarnpkg.com/@web3-onboard/injected-wallets/-/injected-wallets-2.6.0.tgz#6f59ded7728da42a1015215df6f27d016e7094d9" - integrity sha512-j/7hZM4RDCcLwhAARvgX9vjAXkahD59r3YywCPLsttih9YEXAfwyEvbi2aOYXyTMtNt8sEowl0oRBzYA4v2Ckw== +"@web3-onboard/injected-wallets@^2.7.0": + version "2.7.0" + resolved "https://registry.yarnpkg.com/@web3-onboard/injected-wallets/-/injected-wallets-2.7.0.tgz#31725e026b52d55e49ebb2d2bed6d77c1090a4cc" + integrity sha512-Prz9Ts38NnptpPOvBzzk0KyIDDqZ5x18U/CSLE9yqvbovQxlHteBGqWduJKmV4R5fvOHcggpZRD+EaExkpmFlg== dependencies: "@web3-onboard/common" "^2.2.3" joi "^17.6.1" lodash.uniqby "^4.7.0" -"@web3-onboard/react@^2.5.5": - version "2.5.5" - resolved "https://registry.yarnpkg.com/@web3-onboard/react/-/react-2.5.5.tgz#009c437e279108e3d5453fd1fb86eada933f0f23" - integrity sha512-Pli/FIH1BjtAQiD/F9yI+AqmhYBZ3gnhSRMOgbWd10Kwj9E+4Lv49SJP91JJ7lFU34gQpLPNh3NoQxI5/f5VUw== +"@web3-onboard/react@^2.6.2": + version "2.6.2" + resolved "https://registry.yarnpkg.com/@web3-onboard/react/-/react-2.6.2.tgz#330f8f1f162466bbddff89a4a6c6d041d175d811" + integrity sha512-5Q2YBnyiLdVAvDJXrHGORsXvUAeZGDl5fb/MWVF1J9+AguNgqkH0LpFrl4DF5pDwBYWTGUW21y9YkuUszOiX+g== dependencies: "@web3-onboard/common" "^2.2.3" - "@web3-onboard/core" "^2.13.1" + "@web3-onboard/core" "^2.15.0" use-sync-external-store "1.0.0" "@webassemblyjs/ast@1.11.1": @@ -2877,10 +2877,10 @@ bn.js@^5.0.0, bn.js@^5.1.1, bn.js@^5.2.0, bn.js@^5.2.1: resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70" integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ== -bnc-sdk@^4.6.2: - version "4.6.4" - resolved "https://registry.yarnpkg.com/bnc-sdk/-/bnc-sdk-4.6.4.tgz#2fd2f9996b4b4c262a43b91b70e9af8ceae67fba" - integrity sha512-qv310dYLFSIwDhFFFmwPHXpoLFzyneK0f2YFji1ISaFH36hkOVLyD94vx2G5uT66RljxMHUQ8GushqraGKM+bg== +bnc-sdk@^4.6.6: + version "4.6.6" + resolved "https://registry.yarnpkg.com/bnc-sdk/-/bnc-sdk-4.6.6.tgz#ef5501a0c68014efae24d00d2e3fb706318fa00d" + integrity sha512-cpavy/WBQrkw5PZpnuUAvxzj/RjmP1vSldOEG+nonf7n/4sykScDO6KrJN2oVhEMaxHOqOVf2rOugSL5t515eA== dependencies: crypto-es "^1.2.2" nanoid "^3.3.1"