├── .eslintrc.json ├── .gitattributes ├── .github └── workflows │ ├── artifact-upload.yml │ ├── cd.yml │ ├── playwright.yml │ └── pr-comment-artifact-url.yml ├── .gitignore ├── .prettierignore ├── .prettierrc.json ├── .stylelintrc ├── .travis.yml ├── .unimportedrc.json ├── .vscode ├── extensions.json └── settings.json ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── STYLE_GUIDE.md ├── docs ├── images │ ├── dapplet-extension.png │ └── typescript-examples.png ├── index.md ├── readme-banner-dark.png ├── readme-banner-light.png └── uml │ ├── dapplet-extension.puml │ ├── pic0-overview.puml │ ├── pic1-overview.puml │ ├── pic2-implementationScheme.puml │ ├── pic3-adapter,inspoint,button.puml │ └── typescript-examples.puml ├── jslib ├── fakeapi_contentscript.js ├── fakeapi_frame.js └── index.js ├── link.sh ├── manifest.json ├── merge.sh ├── package-lock.json ├── package.json ├── playwright.config.ts ├── resources ├── custom-elements.min.js ├── icons │ ├── icon-grayed16.png │ ├── icon128.png │ ├── icon16.png │ ├── icon19.png │ ├── icon32.png │ ├── icon36.png │ ├── icon38.png │ ├── icon48.png │ ├── icon512.png │ ├── icon64.png │ └── icon96.png ├── mnw-patch-cs.js └── mnw-patch-inpage.js ├── src ├── background │ ├── browserStorages │ │ ├── baseBrowserStorage.ts │ │ ├── fileBrowserStorage.ts │ │ ├── globalConfigBrowserStorage.ts │ │ ├── loginConfirmationBrowserStorage.ts │ │ ├── loginSessionBrowserStorage.ts │ │ ├── notificationBrowserStorage.ts │ │ ├── sessionEntryBrowserStorage.ts │ │ └── versionInfoStorage.ts │ ├── dto │ │ └── manifestDTO.ts │ ├── index.ts │ ├── models │ │ ├── file.ts │ │ ├── globalConfig.ts │ │ ├── loginConfirmation.ts │ │ ├── loginSession.ts │ │ ├── moduleInfo.ts │ │ ├── sessionEntry.ts │ │ ├── siteConfig.ts │ │ └── versionInfo.ts │ ├── moduleStorages │ │ ├── centralizedModuleStorage.ts │ │ ├── httpModuleStorage.ts │ │ ├── ipfsModuleStorage.ts │ │ ├── moduleStorage.ts │ │ ├── storage.ts │ │ └── swarmModuleStorage.ts │ ├── registries │ │ ├── devRegistry.ts │ │ ├── ethRegistry.ts │ │ ├── ethRegistryAbi.ts │ │ ├── nearRegistry.ts │ │ ├── nftContractAbi.ts │ │ └── registry.ts │ ├── services │ │ ├── alertService.ts │ │ ├── analyticsService.ts │ │ ├── connectedAccountService.ts │ │ ├── discordService.ts │ │ ├── ensService.ts │ │ ├── featureService.ts │ │ ├── githubService.ts │ │ ├── globalConfigService.ts │ │ ├── moduleManagerService.ts │ │ ├── notificationService.ts │ │ ├── offscreenService.ts │ │ ├── overlayService.ts │ │ ├── proxyService.ts │ │ ├── registryAggregatorService.ts │ │ ├── sessionService.ts │ │ ├── suspendService.ts │ │ ├── tokenomicsService │ │ │ ├── ERC20Interface.json │ │ │ ├── app-token-registry.json │ │ │ └── index.ts │ │ ├── underConstructionServices │ │ │ ├── app-token-registry.json │ │ │ └── index.ts │ │ └── walletService.ts │ └── wallets │ │ ├── ethereum │ │ ├── dapplets.ts │ │ ├── index.ts │ │ ├── interface.ts │ │ ├── metamask.ts │ │ └── walletconnect.ts │ │ ├── index.ts │ │ ├── interface.ts │ │ └── near │ │ ├── interface.ts │ │ └── near │ │ ├── customConnectedWalletAccount.ts │ │ ├── customWalletConnection.ts │ │ ├── index.ts │ │ ├── mainnet.ts │ │ ├── testnet.ts │ │ └── webExtensionKeyStorage.ts ├── common │ ├── base64ArrayBuffer.ts │ ├── bus.ts │ ├── chrome-extension-websocket-wrapper │ │ ├── constants.ts │ │ ├── index.ts │ │ ├── webSocketProxy.ts │ │ └── webSocketProxyClient.ts │ ├── constants.ts │ ├── decorators │ │ └── mutex-queue.ts │ ├── errors.ts │ ├── generateGuid.ts │ ├── global-event-bus.ts │ ├── helpers.ts │ ├── jsonrpc.ts │ ├── models │ │ ├── base.ts │ │ └── notification.ts │ ├── resources.ts │ ├── resources │ │ ├── nft-no-icon.svg │ │ ├── nft-template.svg │ │ ├── no-logo.png │ │ ├── social │ │ │ ├── github.svg │ │ │ ├── twitter-icon.svg │ │ │ └── x.svg │ │ └── wallets │ │ │ ├── dapplets.svg │ │ │ ├── eth.svg │ │ │ ├── index.ts │ │ │ ├── metamask.svg │ │ │ ├── near-black.svg │ │ │ ├── near.svg │ │ │ └── walletconnect.svg │ ├── state.ts │ ├── tar.ts │ ├── tracing.ts │ └── types.ts ├── contentscript │ ├── core.ts │ ├── index.ts │ ├── injector.ts │ ├── modules │ │ ├── adapter-overlay │ │ │ └── index.ts │ │ ├── config-adapter │ │ │ ├── index.ts │ │ │ └── widgets │ │ │ │ ├── avatar-badge │ │ │ │ ├── description.ts │ │ │ │ ├── index.ts │ │ │ │ └── types.ts │ │ │ │ ├── button │ │ │ │ ├── description.ts │ │ │ │ ├── index.ts │ │ │ │ └── loader.svg │ │ │ │ └── index.ts │ │ ├── dynamic-adapter │ │ │ ├── index.ts │ │ │ ├── locator.ts │ │ │ ├── types.ts │ │ │ └── widgets.ts │ │ ├── index.ts │ │ ├── state.ts │ │ └── types.ts │ ├── overlay │ │ ├── iframe │ │ │ ├── overlay.ts │ │ │ └── overlayManager.ts │ │ ├── interfaces.ts │ │ └── root │ │ │ ├── App.css │ │ │ ├── App.tsx │ │ │ ├── TabItem.tsx │ │ │ ├── assets │ │ │ ├── fonts │ │ │ │ ├── roboto-100-normal.woff2 │ │ │ │ ├── roboto-300-normal.woff2 │ │ │ │ ├── roboto-400-italic.woff2 │ │ │ │ ├── roboto-400-normal.woff2 │ │ │ │ ├── roboto-500-normal.woff2 │ │ │ │ └── roboto-700-normal.woff2 │ │ │ ├── icons │ │ │ │ ├── arrow-01.svg │ │ │ │ ├── checkboxOnMainSettingsNotification.svg │ │ │ │ ├── close-notification-mini.svg │ │ │ │ ├── close.svg │ │ │ │ ├── closeLocalhost.svg │ │ │ │ ├── copyShare.svg │ │ │ │ ├── error.svg │ │ │ │ ├── iconDropdown.svg │ │ │ │ ├── iconsWidgetButton │ │ │ │ │ ├── account.svg │ │ │ │ │ ├── edit.svg │ │ │ │ │ ├── help.svg │ │ │ │ │ ├── login.svg │ │ │ │ │ ├── max.svg │ │ │ │ │ ├── notification.svg │ │ │ │ │ ├── pause.svg │ │ │ │ │ ├── pinned.svg │ │ │ │ │ ├── power.svg │ │ │ │ │ ├── show.svg │ │ │ │ │ └── store.svg │ │ │ │ ├── mini-close.svg │ │ │ │ ├── notificationIcons │ │ │ │ │ ├── bell.svg │ │ │ │ │ ├── bellWithCounter.svg │ │ │ │ │ ├── bellWithNotification.svg │ │ │ │ │ ├── bg.png │ │ │ │ │ ├── closeNotification.svg │ │ │ │ │ ├── defaultIcon.svg │ │ │ │ │ └── error.svg │ │ │ │ ├── share.svg │ │ │ │ ├── tokenomics │ │ │ │ │ ├── copy.svg │ │ │ │ │ ├── dot.svg │ │ │ │ │ ├── down.svg │ │ │ │ │ ├── folder.svg │ │ │ │ │ ├── plus.svg │ │ │ │ │ ├── refresh.svg │ │ │ │ │ └── up.svg │ │ │ │ └── up.svg │ │ │ ├── newIcon │ │ │ │ ├── bell.svg │ │ │ │ ├── bellNoCircle.svg │ │ │ │ ├── collapsed.svg │ │ │ │ ├── connected.svg │ │ │ │ ├── dapset.svg │ │ │ │ ├── hide.svg │ │ │ │ ├── home_top.svg │ │ │ │ ├── mainset.svg │ │ │ │ ├── mustache.svg │ │ │ │ ├── notification.svg │ │ │ │ ├── plus.svg │ │ │ │ ├── search.svg │ │ │ │ ├── share.svg │ │ │ │ ├── squares.svg │ │ │ │ └── store.svg │ │ │ ├── styles │ │ │ │ ├── animate.scss │ │ │ │ ├── color.variables.scss │ │ │ │ ├── null.scss │ │ │ │ └── pages.scss │ │ │ └── svg │ │ │ │ ├── back.svg │ │ │ │ ├── burn.svg │ │ │ │ ├── card.svg │ │ │ │ ├── copied.svg │ │ │ │ ├── copyModal.svg │ │ │ │ ├── copyModal16.svg │ │ │ │ ├── default.svg │ │ │ │ ├── disconnect.svg │ │ │ │ ├── garbage.svg │ │ │ │ ├── home.svg │ │ │ │ ├── loadAddLocalhost.svg │ │ │ │ ├── loaderBtnDisabled.svg │ │ │ │ ├── loaderBtnEnable.svg │ │ │ │ ├── loaderBtnError.svg │ │ │ │ ├── loaderCopy.svg │ │ │ │ ├── loaderDeploy.svg │ │ │ │ ├── loaderNotification.svg │ │ │ │ ├── loaderSettings.svg │ │ │ │ ├── logOut.svg │ │ │ │ ├── modalClose.svg │ │ │ │ ├── newDelete.svg │ │ │ │ ├── newHome.svg │ │ │ │ ├── newLinks.svg │ │ │ │ ├── newSettings.svg │ │ │ │ ├── opensea.svg │ │ │ │ ├── plus.svg │ │ │ │ ├── refresh_search.svg │ │ │ │ ├── setting.svg │ │ │ │ ├── unlink.svg │ │ │ │ └── wallet.svg │ │ │ ├── common │ │ │ ├── constants.ts │ │ │ └── helpers.ts │ │ │ ├── components │ │ │ ├── AlertConfirmPopup │ │ │ │ ├── AlertConfirmPopup.module.scss │ │ │ │ └── index.tsx │ │ │ ├── BaseOnboarding │ │ │ │ ├── BaseOnboarding.module.scss │ │ │ │ ├── assets │ │ │ │ │ ├── Normal_switch.svg │ │ │ │ │ ├── end.svg │ │ │ │ │ └── promo.svg │ │ │ │ ├── components │ │ │ │ │ ├── Button │ │ │ │ │ │ ├── Button.module.scss │ │ │ │ │ │ └── index.tsx │ │ │ │ │ ├── SkipButton │ │ │ │ │ │ ├── SkipButton.module.scss │ │ │ │ │ │ └── index.tsx │ │ │ │ │ └── Title │ │ │ │ │ │ ├── Title.module.scss │ │ │ │ │ │ └── index.tsx │ │ │ │ └── index.tsx │ │ │ ├── CAUserButton │ │ │ │ ├── CAUserButton.module.scss │ │ │ │ └── index.tsx │ │ │ ├── Checkbox │ │ │ │ ├── Checkbox.module.scss │ │ │ │ ├── adaptive.scss │ │ │ │ └── index.tsx │ │ │ ├── CloseIcon │ │ │ │ ├── CloseIcon.module.scss │ │ │ │ └── index.tsx │ │ │ ├── ContentItem │ │ │ │ ├── ContentItem.module.scss │ │ │ │ └── index.tsx │ │ │ ├── Dapplet │ │ │ │ ├── Dapplet.module.scss │ │ │ │ ├── adaptive.scss │ │ │ │ └── index.tsx │ │ │ ├── DappletImage │ │ │ │ ├── DappletImage.module.scss │ │ │ │ └── index.tsx │ │ │ ├── DappletInfo │ │ │ │ ├── DappletInfo.module.scss │ │ │ │ └── index.tsx │ │ │ ├── DappletTitle │ │ │ │ ├── DappletTitle.module.scss │ │ │ │ ├── adaptive.scss │ │ │ │ └── index.tsx │ │ │ ├── DevModulesList │ │ │ │ ├── DevModulesList.module.scss │ │ │ │ ├── adaptive.scss │ │ │ │ ├── index.tsx │ │ │ │ └── modalWindowStyles.scss │ │ │ ├── Dropdown │ │ │ │ ├── Dropdown.module.scss │ │ │ │ ├── dropdown-list.ts │ │ │ │ └── index.tsx │ │ │ ├── DropdownAccounts │ │ │ │ ├── DropdownAccounts.module.scss │ │ │ │ └── index.tsx │ │ │ ├── DropdownCAListReceiver │ │ │ │ └── index.tsx │ │ │ ├── DropdownCAModal │ │ │ │ └── index.tsx │ │ │ ├── DropdownPreferedOverlayStorage │ │ │ │ └── index.tsx │ │ │ ├── DropdownPreferredCANetwork │ │ │ │ └── index.tsx │ │ │ ├── DropdownRegistry │ │ │ │ ├── DropdownRegistry.module.scss │ │ │ │ └── index.tsx │ │ │ ├── DropdownSettings │ │ │ │ ├── DropdownSettings.module.scss │ │ │ │ └── index.tsx │ │ │ ├── DropdownTrustedUsers │ │ │ │ ├── DropdownTrustedUsers.module.scss │ │ │ │ └── index.tsx │ │ │ ├── Icon │ │ │ │ ├── Icon.module.scss │ │ │ │ └── index.tsx │ │ │ ├── InputGroup │ │ │ │ ├── InputGroup.module.scss │ │ │ │ └── index.tsx │ │ │ ├── InputPanelSettings │ │ │ │ ├── InputPanelSettings.module.scss │ │ │ │ └── index.tsx │ │ │ ├── LinkifyText │ │ │ │ └── index.tsx │ │ │ ├── Localhost │ │ │ │ ├── Localhost.module.scss │ │ │ │ ├── adaptive.scss │ │ │ │ └── index.tsx │ │ │ ├── Message │ │ │ │ ├── Message.module.scss │ │ │ │ └── index.tsx │ │ │ ├── Modal │ │ │ │ ├── Modal.module.scss │ │ │ │ └── index.tsx │ │ │ ├── ModalReward │ │ │ │ ├── ModalReward.module.scss │ │ │ │ └── index.tsx │ │ │ ├── ModuleIcon │ │ │ │ └── index.tsx │ │ │ ├── Notification │ │ │ │ ├── Notification.module.scss │ │ │ │ ├── adaptive.scss │ │ │ │ └── index.tsx │ │ │ ├── Overlay │ │ │ │ ├── Overlay.module.scss │ │ │ │ └── adaptive.scss │ │ │ ├── OverlayTab │ │ │ │ ├── index.tsx │ │ │ │ ├── styles │ │ │ │ │ ├── OverlayTab.module.scss │ │ │ │ │ ├── adaptive.scss │ │ │ │ │ └── menuWidgets.scss │ │ │ │ └── types.ts │ │ │ ├── OverlayToolbar │ │ │ │ ├── ModalTabs │ │ │ │ │ ├── ModalTabs.module.scss │ │ │ │ │ └── index.tsx │ │ │ │ ├── Notification │ │ │ │ │ └── index.tsx │ │ │ │ ├── OverlayToolbar.module.scss │ │ │ │ ├── adaptive.scss │ │ │ │ └── index.tsx │ │ │ ├── PopupItem │ │ │ │ ├── PopupItem.module.scss │ │ │ │ └── index.tsx │ │ │ ├── Profile │ │ │ │ ├── HeaderLogIn │ │ │ │ │ ├── HeaderLogIn.module.scss │ │ │ │ │ └── index.tsx │ │ │ │ ├── LoginButtons │ │ │ │ │ ├── LoginButtons.module.scss │ │ │ │ │ └── index.tsx │ │ │ │ ├── ModalLogin │ │ │ │ │ ├── Modal.module.scss │ │ │ │ │ └── index.tsx │ │ │ │ ├── Profile.module.scss │ │ │ │ └── index.tsx │ │ │ ├── Registry │ │ │ │ ├── Registry.module.scss │ │ │ │ └── index.tsx │ │ │ ├── Search │ │ │ │ ├── Search.module.scss │ │ │ │ ├── adaptive.scss │ │ │ │ └── index.tsx │ │ │ ├── SettingItem │ │ │ │ ├── SettingItem.module.scss │ │ │ │ ├── adaptive.scss │ │ │ │ └── index.tsx │ │ │ ├── SettingTitle │ │ │ │ ├── SettingTitle.module.scss │ │ │ │ └── index.tsx │ │ │ ├── SettingWrapper │ │ │ │ ├── SettingWrapper.module.scss │ │ │ │ ├── adaptive.scss │ │ │ │ └── index.tsx │ │ │ ├── ShareButton │ │ │ │ └── index.tsx │ │ │ ├── SquaredButton │ │ │ │ ├── SquaredButton.module.scss │ │ │ │ └── index.tsx │ │ │ ├── StorageRefImage │ │ │ │ ├── StorageRefImage.module.scss │ │ │ │ ├── adaptive.scss │ │ │ │ └── index.tsx │ │ │ ├── StorageRefImg │ │ │ │ └── index.tsx │ │ │ ├── Switch │ │ │ │ ├── Switch.module.scss │ │ │ │ └── index.tsx │ │ │ ├── SystemPopup │ │ │ │ ├── SystemPopup.module.scss │ │ │ │ ├── assests │ │ │ │ │ ├── arrow-left.svg │ │ │ │ │ ├── arrow-right.svg │ │ │ │ │ ├── close.svg │ │ │ │ │ ├── dapplets.svg │ │ │ │ │ ├── loader.svg │ │ │ │ │ ├── metamask.svg │ │ │ │ │ ├── near_mainnet.svg │ │ │ │ │ ├── near_testnet.svg │ │ │ │ │ └── walletconnect.svg │ │ │ │ ├── components │ │ │ │ │ ├── Base.module.scss │ │ │ │ │ ├── Button │ │ │ │ │ │ ├── Button.module.scss │ │ │ │ │ │ ├── Button.props.ts │ │ │ │ │ │ └── index.tsx │ │ │ │ │ ├── Close │ │ │ │ │ │ ├── Close.module.scss │ │ │ │ │ │ ├── Close.props.ts │ │ │ │ │ │ └── index.tsx │ │ │ │ │ ├── DappletCard.tsx │ │ │ │ │ ├── Loading │ │ │ │ │ │ ├── Loading.module.scss │ │ │ │ │ │ └── index.tsx │ │ │ │ │ ├── Overlay │ │ │ │ │ │ ├── Overlay.module.scss │ │ │ │ │ │ └── index.tsx │ │ │ │ │ └── Session │ │ │ │ │ │ ├── Session.module.scss │ │ │ │ │ │ ├── Session.props.ts │ │ │ │ │ │ └── index.tsx │ │ │ │ ├── fonts │ │ │ │ │ ├── roboto-v29-latin-500.woff2 │ │ │ │ │ ├── roboto-v29-latin-700.woff2 │ │ │ │ │ └── roboto-v29-latin-regular.woff2 │ │ │ │ ├── index.tsx │ │ │ │ └── pages │ │ │ │ │ ├── ConnectedAccountsModal │ │ │ │ │ ├── ConnectedAccountsModal.module.scss │ │ │ │ │ ├── Modal.module.scss │ │ │ │ │ ├── helpers │ │ │ │ │ │ ├── areConnectedAccountsUsersWallets.ts │ │ │ │ │ │ ├── checkIfTheAccountsHaveBeenAlreadyConnected.ts │ │ │ │ │ │ ├── getSignature.ts │ │ │ │ │ │ ├── getSocialOriginTitle.ts │ │ │ │ │ │ └── isThereAPendingRequestForThisCAUsers.ts │ │ │ │ │ ├── index.tsx │ │ │ │ │ └── modal.tsx │ │ │ │ │ ├── dapplet-confirmation │ │ │ │ │ └── index.tsx │ │ │ │ │ └── login-session │ │ │ │ │ ├── ConnectWallet │ │ │ │ │ ├── ConnectWallet.module.scss │ │ │ │ │ └── index.tsx │ │ │ │ │ ├── ConnectedWallets.tsx │ │ │ │ │ ├── LoginConfirmations.tsx │ │ │ │ │ ├── WalletPairing.tsx │ │ │ │ │ ├── index.tsx │ │ │ │ │ └── wallets │ │ │ │ │ ├── Dapplets.tsx │ │ │ │ │ ├── MetaMask.tsx │ │ │ │ │ ├── Near.tsx │ │ │ │ │ └── WalletConnect.tsx │ │ │ ├── TabLoader │ │ │ │ ├── TabLoader.module.scss │ │ │ │ ├── adaptive.scss │ │ │ │ └── index.tsx │ │ │ └── UnderConstruction │ │ │ │ ├── UnderConstruction.module.scss │ │ │ │ └── index.tsx │ │ │ ├── constants │ │ │ └── index.ts │ │ │ ├── contexts │ │ │ └── ModalContext │ │ │ │ ├── ModalContext.tsx │ │ │ │ ├── ModalProvider.tsx │ │ │ │ ├── index.ts │ │ │ │ └── useModal.ts │ │ │ ├── helpers │ │ │ ├── addZero.ts │ │ │ ├── smartTitleSlice.ts │ │ │ └── truncateEthAddress.ts │ │ │ ├── hooks │ │ │ ├── useAbortController.ts │ │ │ ├── useCopyed.tsx │ │ │ ├── useDappletActions.ts │ │ │ ├── useSelected.ts │ │ │ └── useToggle.ts │ │ │ ├── models │ │ │ └── dropdown.model.ts │ │ │ ├── overlay.scss │ │ │ ├── overlay.ts │ │ │ ├── overlayManager.css │ │ │ ├── overlayManager.tsx │ │ │ ├── pages │ │ │ ├── ConnectedAccount │ │ │ │ ├── ConnectedAccount.module.scss │ │ │ │ ├── assets │ │ │ │ │ ├── attention.svg │ │ │ │ │ ├── info.svg │ │ │ │ │ ├── newHome.svg │ │ │ │ │ ├── ok.svg │ │ │ │ │ ├── time.svg │ │ │ │ │ └── trash.svg │ │ │ │ └── index.tsx │ │ │ ├── Dapplets │ │ │ │ ├── Dapplets.module.scss │ │ │ │ ├── DevMessage │ │ │ │ │ ├── DevMesage.module.scss │ │ │ │ │ └── index.tsx │ │ │ │ ├── adaptive.scss │ │ │ │ └── index.tsx │ │ │ ├── DappletsInfo │ │ │ │ ├── DappletsInfo.module.scss │ │ │ │ ├── adaptive.scss │ │ │ │ ├── index.tsx │ │ │ │ └── modalStyles.scss │ │ │ ├── Notifications │ │ │ │ ├── Notifications.module.scss │ │ │ │ ├── adaptive.scss │ │ │ │ └── index.tsx │ │ │ ├── Rewards │ │ │ │ ├── Rewards.module.scss │ │ │ │ ├── index.tsx │ │ │ │ └── rewards.scss │ │ │ ├── Settings │ │ │ │ ├── Developer │ │ │ │ │ ├── Developer.module.scss │ │ │ │ │ ├── Developer.tsx │ │ │ │ │ └── adaptive.scss │ │ │ │ ├── Main │ │ │ │ │ ├── Main.module.scss │ │ │ │ │ └── Main.tsx │ │ │ │ ├── Settings │ │ │ │ │ ├── Settings.module.scss │ │ │ │ │ ├── Settings.tsx │ │ │ │ │ └── adaptive.scss │ │ │ │ └── index.tsx │ │ │ ├── Tokenomics │ │ │ │ ├── Button │ │ │ │ │ ├── Button.module.scss │ │ │ │ │ ├── Button.tsx │ │ │ │ │ └── index.ts │ │ │ │ ├── CreateTokenSchema.ts │ │ │ │ ├── Field │ │ │ │ │ ├── Field.module.scss │ │ │ │ │ └── Field.tsx │ │ │ │ ├── IconField │ │ │ │ │ ├── IconField.module.scss │ │ │ │ │ ├── IconField.tsx │ │ │ │ │ └── Preview.tsx │ │ │ │ ├── RadioButton │ │ │ │ │ ├── radioButtons.module.scss │ │ │ │ │ └── radioButtons.tsx │ │ │ │ ├── Tokenomics.module.scss │ │ │ │ ├── index.tsx │ │ │ │ ├── newToken.module.scss │ │ │ │ ├── newToken.tsx │ │ │ │ ├── selectToken.module.scss │ │ │ │ └── selectToken.tsx │ │ │ ├── UnderConstruction │ │ │ │ ├── UnderConstruction.module.scss │ │ │ │ └── index.tsx │ │ │ ├── UnderConstructionInfo │ │ │ │ ├── UnderConstructionInfo.module.scss │ │ │ │ ├── index.tsx │ │ │ │ └── valid.scss │ │ │ ├── UserSettings │ │ │ │ ├── SelectWiget │ │ │ │ │ ├── SelectWiget.module.scss │ │ │ │ │ └── SelectWigets.tsx │ │ │ │ ├── SettingsPage.tsx │ │ │ │ ├── TextWiget │ │ │ │ │ ├── TextWiget.module.scss │ │ │ │ │ └── TextWigets.tsx │ │ │ │ ├── UserSettings.module.scss │ │ │ │ ├── index.tsx │ │ │ │ └── utils.ts │ │ │ └── Wallet │ │ │ │ └── index.tsx │ │ │ ├── types │ │ │ └── index.ts │ │ │ ├── utils │ │ │ ├── addInfoInputGroup.ts │ │ │ ├── addSettingsValueDropdown.tsx │ │ │ ├── createUserEnvInfo.ts │ │ │ ├── formatIconRefUrl.ts │ │ │ ├── getDefaultValue.tsx │ │ │ ├── openLink.ts │ │ │ ├── refreshModules.ts │ │ │ ├── removeInfoInputGroup.ts │ │ │ └── useStorageRef.tsx │ │ │ └── widgets │ │ │ ├── button │ │ │ ├── WidgetButton.module.scss │ │ │ └── index.tsx │ │ │ └── label │ │ │ ├── WidgetLabel.module.scss │ │ │ └── index.tsx │ ├── sandbox │ │ ├── dappletExecutor.ts │ │ ├── iframeContainer.ts │ │ └── iframeWorker.ts │ ├── swiper.ts │ └── types.ts ├── index.ts ├── inpage │ ├── dappletsProvider.ts │ └── index.ts ├── offscreen │ ├── index.html │ └── index.ts ├── popup │ ├── App.tsx │ ├── components │ │ └── InfoIcon.tsx │ ├── index.css │ ├── index.html │ └── index.tsx ├── sandbox │ ├── index.html │ └── index.ts ├── typesPatch.d.ts └── worker │ ├── communication.ts │ ├── core │ ├── appStorage.ts │ ├── connectedAccounts.ts │ ├── connection.ts │ ├── ethereum │ │ ├── index.ts │ │ └── types.ts │ ├── events │ │ ├── baseEvent.ts │ │ └── eventBus.ts │ ├── index.ts │ ├── login │ │ ├── login-session.ts │ │ └── types.ts │ ├── near │ │ ├── backgroundJsonRpcProvider.ts │ │ ├── backgroundKeyStore.ts │ │ ├── backgroundNear.ts │ │ ├── backgroundWalletConnection.ts │ │ ├── customConnectedWalletAccount.ts │ │ └── index.ts │ ├── proxySigner.ts │ ├── state.ts │ ├── types.ts │ └── wsJsonRpc.ts │ ├── index.ts │ ├── injector.ts │ ├── overlay │ ├── interfaces.ts │ ├── overlay.ts │ └── overlayManager.ts │ ├── proxyAdapter.ts │ └── state.ts ├── tests ├── e2e │ ├── fixtures │ │ ├── browser.ts │ │ ├── dapplet-runner.ts │ │ └── pass-fail-dapplet.ts │ ├── pages │ │ ├── connect-wallet-popup.ts │ │ ├── dapplets.ts │ │ ├── developer.ts │ │ ├── login-modal.ts │ │ ├── notifications.ts │ │ ├── overlay.ts │ │ └── settings.ts │ └── scenarios │ │ ├── no-available-dapplets.spec.ts │ │ ├── overlay-and-settings │ │ └── dapplet-settings-and-overlay.spec.ts │ │ ├── run-test-dapplets.spec.ts │ │ └── wallets │ │ └── connect-built-in-wallet.spec.ts └── modules │ ├── DappletManifestPlugin.js │ ├── adapters │ ├── test-common-adapter │ │ ├── dapplet.json │ │ ├── index.json │ │ └── styles │ │ │ └── body │ │ │ ├── button.css │ │ │ └── popup.css │ ├── test-e2e-adapter │ │ ├── dapplet.json │ │ ├── index.json │ │ └── styles │ │ │ ├── post │ │ │ └── button.css │ │ │ └── profile │ │ │ └── button.css │ ├── test-github-adapter │ │ ├── dapplet.json │ │ ├── index.json │ │ └── styles │ │ │ ├── post │ │ │ ├── avatarBadge.css │ │ │ └── button.css │ │ │ └── profile │ │ │ ├── avatarBadge.css │ │ │ └── button.css │ ├── test-twitter-adapter │ │ ├── dapplet.json │ │ ├── index.json │ │ └── styles │ │ │ ├── post │ │ │ ├── avatarBadge.css │ │ │ └── button.css │ │ │ └── profile │ │ │ ├── avatarBadge.css │ │ │ └── button.css │ └── test-virtual-adapter │ │ └── dapplet.json │ ├── dapplets │ ├── core-alert │ │ ├── dapplet.json │ │ └── src │ │ │ ├── Black_Icon2.svg │ │ │ ├── index.ts │ │ │ └── target.png │ ├── core-confirm-cancel │ │ ├── dapplet.json │ │ └── src │ │ │ ├── Black_Icon2.svg │ │ │ ├── index.ts │ │ │ └── target.png │ ├── core-confirm-ok │ │ ├── dapplet.json │ │ └── src │ │ │ ├── Black_Icon2.svg │ │ │ ├── index.ts │ │ │ └── target.png │ ├── core-notify-subscribe-decorator │ │ ├── dapplet.json │ │ └── src │ │ │ └── index.ts │ ├── core-notify-subscribe-manually │ │ ├── dapplet.json │ │ └── src │ │ │ └── index.ts │ ├── core-notify-without-actions │ │ ├── dapplet.json │ │ └── src │ │ │ └── index.ts │ ├── dapplet-actions │ │ ├── dapplet.json │ │ └── src │ │ │ ├── icon.svg │ │ │ └── index.ts │ ├── demo-e2e-dapplet │ │ ├── dapplet.json │ │ └── src │ │ │ ├── images │ │ │ ├── Black_Icon2.svg │ │ │ ├── Black_Icon3.svg │ │ │ ├── Red_Icon2.svg │ │ │ ├── Red_Icon3.png │ │ │ ├── Red_Icon3.svg │ │ │ ├── White_Icon2.svg │ │ │ └── White_Icon3.svg │ │ │ └── index.ts │ ├── failing-dapplet │ │ ├── dapplet.json │ │ └── src │ │ │ └── index.ts │ ├── home-action-button │ │ ├── dapplet.json │ │ └── src │ │ │ ├── example.png │ │ │ └── index.ts │ ├── inject-via-activate │ │ ├── dapplet.json │ │ └── src │ │ │ └── index.ts │ ├── inject-via-constructor │ │ ├── dapplet.json │ │ └── src │ │ │ └── index.ts │ ├── inject-via-props │ │ ├── dapplet.json │ │ └── src │ │ │ └── index.ts │ ├── server-interaction │ │ ├── config │ │ │ ├── default.json │ │ │ └── schema.json │ │ ├── dapplet.json │ │ └── src │ │ │ └── index.ts │ ├── test-common-dapplet │ │ ├── config │ │ │ ├── default.json │ │ │ └── schema.json │ │ ├── dapplet.json │ │ └── src │ │ │ ├── globals.d.ts │ │ │ ├── icons │ │ │ └── ex06.png │ │ │ └── index.ts │ ├── test-dynamic-dapplet │ │ ├── dapplet.json │ │ └── src │ │ │ ├── Black_Icon2.svg │ │ │ ├── index.ts │ │ │ └── target.png │ ├── twitter-demo │ │ ├── dapplet.json │ │ └── src │ │ │ ├── images │ │ │ ├── Black_Icon2.svg │ │ │ ├── Black_Icon3.svg │ │ │ ├── Red_Icon2.svg │ │ │ ├── Red_Icon3.png │ │ │ ├── Red_Icon3.svg │ │ │ ├── White_Icon2.svg │ │ │ └── White_Icon3.svg │ │ │ └── index.ts │ └── update-parsed-context │ │ ├── dapplet.json │ │ └── src │ │ └── index.ts │ ├── overlays │ ├── overlay │ │ ├── .eslintignore │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── public │ │ │ └── index.html │ │ ├── src │ │ │ ├── App.tsx │ │ │ ├── index.css │ │ │ └── index.tsx │ │ ├── tsconfig.json │ │ └── webpack.config.js │ └── twitter-demo-overlay │ │ ├── .eslintignore │ │ ├── .gitignore │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── public │ │ └── index.html │ │ ├── src │ │ ├── App.tsx │ │ ├── Widget.tsx │ │ ├── dappletBridge.ts │ │ ├── dappletData.ts │ │ ├── index.css │ │ ├── index.tsx │ │ └── secret │ │ │ ├── CA.key │ │ │ ├── CA.pem │ │ │ └── localhost │ │ │ ├── localhost.crt │ │ │ ├── localhost.csr │ │ │ ├── localhost.decrypted.key │ │ │ ├── localhost.ext │ │ │ └── localhost.key │ │ ├── tsconfig.json │ │ └── webpack.config.js │ ├── servers │ └── server-interaction │ │ ├── index.js │ │ ├── package-lock.json │ │ ├── package.json │ │ └── secret │ │ ├── CA.key │ │ ├── CA.pem │ │ └── localhost │ │ ├── localhost.crt │ │ ├── localhost.csr │ │ ├── localhost.decrypted.key │ │ ├── localhost.ext │ │ └── localhost.key │ ├── tsconfig.json │ ├── typesPatch.d.ts │ └── webpack.config.js ├── tsconfig.json ├── webpack.common.js ├── webpack.dev.js ├── webpack.jslib.js └── webpack.prod.js /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto eol=lf 2 | -------------------------------------------------------------------------------- /.github/workflows/playwright.yml: -------------------------------------------------------------------------------- 1 | name: Playwright Tests 2 | on: 3 | push: 4 | branches: [develop] 5 | pull_request: 6 | branches: [develop] 7 | jobs: 8 | test: 9 | timeout-minutes: 60 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/checkout@v3 13 | - uses: actions/setup-node@v3 14 | with: 15 | node-version: 18 16 | - name: Install dependencies 17 | run: npm ci 18 | - name: Install Playwright Browsers 19 | run: npx playwright install --with-deps 20 | - name: Build extension 21 | run: npm run build 22 | - name: Run Playwright tests 23 | run: npx playwright test 24 | - uses: actions/upload-artifact@v3 25 | if: always() 26 | with: 27 | name: playwright-report 28 | path: playwright-report/ 29 | retention-days: 30 30 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | build 3 | secrets.*.js 4 | dist 5 | lib 6 | .env 7 | .DS_Store 8 | /test-results/ 9 | /playwright-report/ 10 | /playwright/.cache/ 11 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | /src/contentscript/global.js 2 | /src/contentscript/dynamicAdapter/custom-elements.min.js 3 | *.scss 4 | *.css 5 | node_modules -------------------------------------------------------------------------------- /.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "semi": false, 3 | "trailingComma": "es5", 4 | "singleQuote": true, 5 | "tabWidth": 2, 6 | "useTabs": false, 7 | "printWidth": 100, 8 | "endOfLine": "lf" 9 | } 10 | -------------------------------------------------------------------------------- /.stylelintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "stylelint-config-standard-scss", 4 | "stylelint-config-prettier-scss", 5 | "stylelint-config-clean-order" 6 | ], 7 | "rules": { 8 | "selector-class-pattern": null 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: node 3 | services: xvfb 4 | 5 | addons: 6 | chrome: stable 7 | 8 | script: 9 | - npm run build:extension 10 | - travis_retry npm run test 11 | 12 | -------------------------------------------------------------------------------- /.unimportedrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "entry": [ 3 | "./src/background/index.ts", 4 | "./src/contentscript/index.ts", 5 | "./src/inpage/index.ts", 6 | "./src/offscreen/index.ts", 7 | "./src/sandbox/index.ts", 8 | "./src/worker/index.ts", 9 | "./src/index.ts" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "stylelint.vscode-stylelint", 4 | "esbenp.prettier-vscode", 5 | "dbaeumer.vscode-eslint" 6 | ] 7 | } -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "editor.codeActionsOnSave": { 3 | "source.fixAll": "explicit" 4 | }, 5 | "editor.formatOnSave": true, 6 | "editor.defaultFormatter": "esbenp.prettier-vscode", 7 | "css.validate": false, 8 | "less.validate": false, 9 | "scss.validate": false, 10 | "stylelint.validate": ["css", "scss"], 11 | "[css]": { 12 | "editor.defaultFormatter": "stylelint.vscode-stylelint" 13 | }, 14 | "[scss]": { 15 | "editor.defaultFormatter": "stylelint.vscode-stylelint" 16 | }, 17 | "stylelint.customSyntax": "postcss-scss", 18 | "files.eol": "\n", 19 | "editor.tabSize": 2 20 | } 21 | -------------------------------------------------------------------------------- /docs/images/dapplet-extension.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapplets/dapplet-extension/9074291617dd1830cc8573afbfa74de0090dcda0/docs/images/dapplet-extension.png -------------------------------------------------------------------------------- /docs/images/typescript-examples.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapplets/dapplet-extension/9074291617dd1830cc8573afbfa74de0090dcda0/docs/images/typescript-examples.png -------------------------------------------------------------------------------- /docs/readme-banner-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapplets/dapplet-extension/9074291617dd1830cc8573afbfa74de0090dcda0/docs/readme-banner-dark.png -------------------------------------------------------------------------------- /docs/readme-banner-light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapplets/dapplet-extension/9074291617dd1830cc8573afbfa74de0090dcda0/docs/readme-banner-light.png -------------------------------------------------------------------------------- /docs/uml/dapplet-extension.puml: -------------------------------------------------------------------------------- 1 | @startuml "dapplet-extension" 2 | 3 | cloud ExternalAPI 4 | cloud Ethereum 5 | 6 | package "pkg: web-page" { 7 | node DOM 8 | } 9 | 10 | database "InBrowser\nStorage" as Storage 11 | 12 | package "pkg: dapplet-extension" { 13 | [Background] 14 | [ContentScript] 15 | [Popup] 16 | [Options] 17 | 18 | Background <..> ContentScript : (9) scripts of modules 19 | Background <..> Popup : (3) feature list 20 | Background <..> Options 21 | 22 | Background <-> Storage : (2) settings, cache 23 | Ethereum -down-> Background : (1) modules 24 | ExternalAPI -down-> Background : (6) augmentation data 25 | 26 | ContentScript <-down-> DOM : (5) widgets 27 | } 28 | 29 | @enduml -------------------------------------------------------------------------------- /docs/uml/typescript-examples.puml: -------------------------------------------------------------------------------- 1 | @startuml "typescript-examples" 2 | 3 | package "pkg: web-page" { 4 | node DOM 5 | } 6 | 7 | package "pkg: typescript-examples" { 8 | [common-lib] 9 | [twitter-adapter] 10 | [twitter-feature-1] 11 | [twitter-feature-2] 12 | 13 | [twitter-feature-1] ..> [twitter-adapter] 14 | [twitter-feature-2] ..> [twitter-adapter] 15 | [twitter-adapter] ..> [common-lib] 16 | [twitter-adapter] ..left.. DOM 17 | } 18 | 19 | @enduml -------------------------------------------------------------------------------- /jslib/index.js: -------------------------------------------------------------------------------- 1 | import '../build/contentscript.js' 2 | import '../build/inpage.js' 3 | import '../build/service-worker.js' 4 | import './fakeapi_contentscript.js' 5 | -------------------------------------------------------------------------------- /link.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | npm link 3 | -------------------------------------------------------------------------------- /merge.sh: -------------------------------------------------------------------------------- 1 | git pull && git checkout master && git pull && git merge develop && git push && git checkout develop && git merge master && git push -------------------------------------------------------------------------------- /resources/icons/icon-grayed16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapplets/dapplet-extension/9074291617dd1830cc8573afbfa74de0090dcda0/resources/icons/icon-grayed16.png -------------------------------------------------------------------------------- /resources/icons/icon128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapplets/dapplet-extension/9074291617dd1830cc8573afbfa74de0090dcda0/resources/icons/icon128.png -------------------------------------------------------------------------------- /resources/icons/icon16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapplets/dapplet-extension/9074291617dd1830cc8573afbfa74de0090dcda0/resources/icons/icon16.png -------------------------------------------------------------------------------- /resources/icons/icon19.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapplets/dapplet-extension/9074291617dd1830cc8573afbfa74de0090dcda0/resources/icons/icon19.png -------------------------------------------------------------------------------- /resources/icons/icon32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapplets/dapplet-extension/9074291617dd1830cc8573afbfa74de0090dcda0/resources/icons/icon32.png -------------------------------------------------------------------------------- /resources/icons/icon36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapplets/dapplet-extension/9074291617dd1830cc8573afbfa74de0090dcda0/resources/icons/icon36.png -------------------------------------------------------------------------------- /resources/icons/icon38.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapplets/dapplet-extension/9074291617dd1830cc8573afbfa74de0090dcda0/resources/icons/icon38.png -------------------------------------------------------------------------------- /resources/icons/icon48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapplets/dapplet-extension/9074291617dd1830cc8573afbfa74de0090dcda0/resources/icons/icon48.png -------------------------------------------------------------------------------- /resources/icons/icon512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapplets/dapplet-extension/9074291617dd1830cc8573afbfa74de0090dcda0/resources/icons/icon512.png -------------------------------------------------------------------------------- /resources/icons/icon64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapplets/dapplet-extension/9074291617dd1830cc8573afbfa74de0090dcda0/resources/icons/icon64.png -------------------------------------------------------------------------------- /resources/icons/icon96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapplets/dapplet-extension/9074291617dd1830cc8573afbfa74de0090dcda0/resources/icons/icon96.png -------------------------------------------------------------------------------- /resources/mnw-patch-cs.js: -------------------------------------------------------------------------------- 1 | function injectScript(url) { 2 | try { 3 | const container = document.head || document.documentElement 4 | const scriptTag = document.createElement('script') 5 | scriptTag.setAttribute('async', 'false') 6 | scriptTag.src = url 7 | container.insertBefore(scriptTag, container.children[0]) 8 | container.removeChild(scriptTag) 9 | } catch (error) { 10 | console.error('MyNearWallet patching failed', error) 11 | } 12 | } 13 | 14 | // Near Wallet displays "Unknown App" for transactions with empty HTTP header "referer" 15 | // It's a workaround replacing document.referrer value 16 | if (new URL(document.location.href).searchParams.get('referrer') === 'Dapplets Extension') { 17 | if (typeof chrome !== 'undefined' && chrome.runtime !== undefined) { 18 | injectScript(chrome.runtime.getURL('mnw-patch-inpage.js')) 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /resources/mnw-patch-inpage.js: -------------------------------------------------------------------------------- 1 | // Near Wallet displays "Unknown App" for transactions with empty HTTP header "referer" 2 | // It's a workaround replacing document.referrer value 3 | Object.defineProperty(document, 'referrer', { 4 | value: 'https://dapplets-extension/', 5 | writable: true, 6 | configurable: true, 7 | }) 8 | -------------------------------------------------------------------------------- /src/background/browserStorages/fileBrowserStorage.ts: -------------------------------------------------------------------------------- 1 | import File from '../models/file' 2 | import BaseBrowserStorage from './baseBrowserStorage' 3 | 4 | export default class FileBrowserStorage extends BaseBrowserStorage { 5 | constructor() { 6 | super(File, 'File') 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/background/browserStorages/globalConfigBrowserStorage.ts: -------------------------------------------------------------------------------- 1 | import { GlobalConfig } from '../models/globalConfig' 2 | import BaseBrowserStorage from './baseBrowserStorage' 3 | 4 | export default class GlobalConfigBrowserStorage extends BaseBrowserStorage { 5 | constructor() { 6 | super(GlobalConfig, 'GlobalConfig') 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/background/browserStorages/loginConfirmationBrowserStorage.ts: -------------------------------------------------------------------------------- 1 | import LoginConfirmation from '../models/loginConfirmation' 2 | import BaseBrowserStorage from './baseBrowserStorage' 3 | 4 | export default class LoginConfirmationBrowserStorage extends BaseBrowserStorage { 5 | constructor() { 6 | super(LoginConfirmation, 'LoginConfirmation') 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/background/browserStorages/loginSessionBrowserStorage.ts: -------------------------------------------------------------------------------- 1 | import LoginSession from '../models/loginSession' 2 | import BaseBrowserStorage from './baseBrowserStorage' 3 | 4 | export default class LoginSessionBrowserStorage extends BaseBrowserStorage { 5 | constructor() { 6 | super(LoginSession, 'LoginSession') 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/background/browserStorages/notificationBrowserStorage.ts: -------------------------------------------------------------------------------- 1 | import { Notification } from '../../common/models/notification' 2 | import BaseBrowserStorage from './baseBrowserStorage' 3 | 4 | export default class NotificationBrowserStorage extends BaseBrowserStorage { 5 | constructor() { 6 | super(Notification, 'Notification') 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/background/browserStorages/sessionEntryBrowserStorage.ts: -------------------------------------------------------------------------------- 1 | import SessionEntry from '../models/sessionEntry' 2 | import BaseBrowserStorage from './baseBrowserStorage' 3 | 4 | export default class SessionEntryBrowserStorage extends BaseBrowserStorage { 5 | constructor() { 6 | super(SessionEntry, 'SessionEntry') 7 | } 8 | 9 | public async getBySessionKey(sessionId: string, key: string): Promise { 10 | return this.getById(sessionId + '/' + key) 11 | } 12 | 13 | public async deleteBySessionKey(sessionId: string, key: string): Promise { 14 | return this.deleteBySessionKey(sessionId, key) 15 | } 16 | 17 | public async clearBySessionKey(sessionId: string): Promise { 18 | const entries = await this.getAll((x) => x.sessionId === sessionId) 19 | await Promise.all(entries.map((x) => this.delete(x))) 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/background/browserStorages/versionInfoStorage.ts: -------------------------------------------------------------------------------- 1 | import { DEFAULT_BRANCH_NAME } from '../../common/constants' 2 | import VersionInfo from '../models/versionInfo' 3 | import BaseBrowserStorage from './baseBrowserStorage' 4 | 5 | export default class VersionInfoBrowserStorage extends BaseBrowserStorage { 6 | constructor() { 7 | super(VersionInfo, 'VersionInfo') 8 | } 9 | 10 | get(registryUrl: string, name: string, branch: string, version: string) { 11 | if (!branch) branch = DEFAULT_BRANCH_NAME 12 | const id = registryUrl + ':' + name + '#' + branch + '@' + version 13 | return super.getById(id) 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/background/dto/manifestDTO.ts: -------------------------------------------------------------------------------- 1 | import { ModuleTypes } from '../../common/constants' 2 | import { StorageRef } from '../../common/types' 3 | 4 | export default class ManifestDTO { 5 | name: string = null 6 | //branch: string = null; 7 | //version: string = null; 8 | type: ModuleTypes = null 9 | title: string = null 10 | description: string = null 11 | author: string = null 12 | icon: StorageRef = null 13 | isActive: boolean = null 14 | isActionHandler: boolean = null 15 | isHomeHandler: boolean = null 16 | activeVersion?: string | null = null 17 | lastVersion?: string | null = null 18 | //dist: string = null; 19 | order: number = null 20 | hostnames: string[] = [] 21 | sourceRegistry: { 22 | url: string 23 | isDev: boolean 24 | } = null 25 | // ToDo: Add "hasUpdate", which are used in Features.tsx 26 | available: boolean 27 | isUnderConstruction: boolean 28 | isMyDapplet: boolean 29 | } 30 | -------------------------------------------------------------------------------- /src/background/models/file.ts: -------------------------------------------------------------------------------- 1 | import { base64ArrayBuffer } from '../../common/base64ArrayBuffer' 2 | import Base from '../../common/models/base' 3 | 4 | function base64ToBufferAsync(base64: string): ArrayBuffer { 5 | const binaryString = atob(base64) 6 | const len = binaryString.length 7 | const bytes = new Uint8Array(len) 8 | for (let i = 0; i < len; i++) { 9 | bytes[i] = binaryString.charCodeAt(i) 10 | } 11 | return bytes.buffer 12 | } 13 | 14 | export default class File extends Base { 15 | getId = () => this.id 16 | 17 | id: string = null 18 | data: string = null 19 | 20 | getData(): ArrayBuffer { 21 | return base64ToBufferAsync(this.data) 22 | } 23 | 24 | setData(buffer: ArrayBuffer) { 25 | this.data = base64ArrayBuffer(buffer) 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/background/models/loginSession.ts: -------------------------------------------------------------------------------- 1 | import Base from '../../common/models/base' 2 | 3 | export default class LoginSession extends Base { 4 | getId = () => this.sessionId 5 | 6 | sessionId: string = null 7 | moduleName: string = null 8 | authMethod: string = null 9 | walletType: string = null 10 | expiresAt: string = null 11 | createdAt: string = null 12 | loginConfirmationId: string = null 13 | 14 | isExpired() { 15 | const expiresAt = new Date(this.expiresAt).getTime() 16 | const now = Date.now() 17 | return expiresAt < now 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/background/models/moduleInfo.ts: -------------------------------------------------------------------------------- 1 | import { ModuleTypes } from '../../common/constants' 2 | import Base from '../../common/models/base' 3 | import { StorageRef } from '../../common/types' 4 | 5 | export default class ModuleInfo extends Base { 6 | getId = () => this.registryUrl + ':' + this.name 7 | 8 | registryUrl: string = null 9 | name: string = null 10 | type: ModuleTypes = null 11 | title: string = null 12 | description: string = null 13 | author: string = null 14 | image?: StorageRef = null 15 | metadata?: StorageRef = null 16 | icon?: StorageRef = null 17 | interfaces: string[] = [] 18 | contextIds: string[] = [] 19 | isUnderConstruction: boolean = null 20 | } 21 | -------------------------------------------------------------------------------- /src/background/models/sessionEntry.ts: -------------------------------------------------------------------------------- 1 | import Base from '../../common/models/base' 2 | import { JsonValue } from '../../common/types' 3 | 4 | export default class SessionEntry extends Base { 5 | getId = () => this.sessionId + '/' + this.key 6 | 7 | sessionId: string = null 8 | key: string = null 9 | value: JsonValue = null 10 | } 11 | -------------------------------------------------------------------------------- /src/background/models/siteConfig.ts: -------------------------------------------------------------------------------- 1 | import Base from '../../common/models/base' 2 | import { DappletRuntimeResult } from '../../common/types' 3 | 4 | // ToDo: It should be UserConfig 5 | export default class SiteConfig extends Base { 6 | getId = () => this.hostname 7 | 8 | hostname: string = null 9 | 10 | activeFeatures: { 11 | [name: string]: { 12 | version: string 13 | isActive: boolean 14 | order: number 15 | runtime: DappletRuntimeResult 16 | registryUrl: string 17 | } 18 | } = {} 19 | 20 | paused: boolean = null 21 | } 22 | -------------------------------------------------------------------------------- /src/background/models/versionInfo.ts: -------------------------------------------------------------------------------- 1 | import { ModuleTypes } from '../../common/constants' 2 | import Base from '../../common/models/base' 3 | import { Environments, StorageRef } from '../../common/types' 4 | 5 | export default class VersionInfo extends Base { 6 | getId = () => this.registryUrl + ':' + this.name + '#' + this.branch + '@' + this.version 7 | 8 | registryUrl: string = null 9 | type: ModuleTypes = null 10 | 11 | name: string = null 12 | branch: string = null 13 | version: string = null 14 | main: StorageRef = null 15 | dist: StorageRef = null 16 | dependencies: { 17 | [name: string]: string 18 | } = null 19 | interfaces: { 20 | [name: string]: string 21 | } = null 22 | environment?: Environments = null 23 | schemaConfig: StorageRef = null 24 | defaultConfig: StorageRef = null 25 | overlays: { 26 | [name: string]: StorageRef 27 | } = null 28 | extensionVersion?: string = null 29 | createdAt?: string = null 30 | actions?: string = null 31 | } 32 | -------------------------------------------------------------------------------- /src/background/moduleStorages/storage.ts: -------------------------------------------------------------------------------- 1 | export type DirectoryData = { 2 | files: { url: string; arr: ArrayBuffer }[] 3 | hash: string 4 | tar: Blob 5 | } 6 | 7 | export interface Storage { 8 | timeout: number 9 | getResource(uri: string, fetchController: AbortController): Promise 10 | save(blob: Blob, cfg?: any): Promise 11 | saveDir?(data: DirectoryData): Promise 12 | } 13 | -------------------------------------------------------------------------------- /src/background/services/alertService.ts: -------------------------------------------------------------------------------- 1 | import browser from 'webextension-polyfill' 2 | import { TAlertAndConfirmPayload } from '../../common/types' 3 | 4 | export const showAlertOrConfirm = async ( 5 | payload: TAlertAndConfirmPayload, 6 | tabId: number 7 | ): Promise => 8 | browser.tabs.sendMessage(tabId, { 9 | type: 'ALERT_OR_CONFIRM', 10 | payload, 11 | }) 12 | -------------------------------------------------------------------------------- /src/background/services/ensService.ts: -------------------------------------------------------------------------------- 1 | import { ChainTypes, DefaultSigners } from '../../common/types' 2 | import { WalletService } from './walletService' 3 | 4 | export default class EnsService { 5 | constructor(private _walletService: WalletService) {} 6 | 7 | async resolveName(name: string): Promise { 8 | const signer = await this._walletService.eth_getSignerFor( 9 | DefaultSigners.EXTENSION, 10 | ChainTypes.ETHEREUM_SEPOLIA 11 | ) 12 | return signer.resolveName(name) 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/background/wallets/ethereum/index.ts: -------------------------------------------------------------------------------- 1 | import { WalletTypes } from '../../../common/types' 2 | import dapplets from './dapplets' 3 | import metamask from './metamask' 4 | // import walletconnect from './walletconnect' 5 | 6 | export default { 7 | [WalletTypes.METAMASK]: metamask, 8 | [WalletTypes.DAPPLETS]: dapplets, 9 | // ToDo: migrate to WalletConnect v2 10 | // [WalletTypes.WALLETCONNECT]: walletconnect, 11 | } 12 | -------------------------------------------------------------------------------- /src/background/wallets/ethereum/interface.ts: -------------------------------------------------------------------------------- 1 | import { ethers, Signer } from 'ethers' 2 | import { GenericWallet } from '../interface' 3 | 4 | export interface EthereumWallet extends GenericWallet, Signer { 5 | sendTransactionOutHash(transaction: ethers.providers.TransactionRequest): Promise 6 | sendCustomRequest(method: string, params: any[]): Promise 7 | signMessage(message: string): Promise 8 | } 9 | -------------------------------------------------------------------------------- /src/background/wallets/index.ts: -------------------------------------------------------------------------------- 1 | import { ChainTypes, WalletTypes } from '../../common/types' 2 | import ethereum from './ethereum' 3 | import near_mainnet from './near/near/mainnet' 4 | import near_testnet from './near/near/testnet' 5 | 6 | export default { 7 | [ChainTypes.ETHEREUM_SEPOLIA]: ethereum, 8 | [ChainTypes.ETHEREUM_XDAI]: ethereum, 9 | [ChainTypes.NEAR_MAINNET]: { [WalletTypes.NEAR]: near_mainnet }, 10 | [ChainTypes.NEAR_TESTNET]: { [WalletTypes.NEAR]: near_testnet }, 11 | } 12 | -------------------------------------------------------------------------------- /src/background/wallets/interface.ts: -------------------------------------------------------------------------------- 1 | export interface GenericWallet { 2 | getAddress(): Promise 3 | getChainId(): Promise 4 | isAvailable(): Promise 5 | isConnected(): Promise 6 | connectWallet(params: any): Promise 7 | disconnectWallet(): Promise 8 | getLastUsage(): Promise 9 | getMeta(): Promise<{ 10 | icon: string 11 | name: string 12 | description: string 13 | } | null> 14 | signMessage(message: string): Promise 15 | } 16 | -------------------------------------------------------------------------------- /src/background/wallets/near/near/mainnet.ts: -------------------------------------------------------------------------------- 1 | import * as walletIcons from '../../../../common/resources/wallets' 2 | import NearWallet from './index' 3 | 4 | export default class MainnetNearWallet extends NearWallet { 5 | constructor() { 6 | super({ 7 | networkId: 'mainnet', 8 | nodeUrl: 'https://rpc.mainnet.near.org', 9 | walletUrl: 'https://app.mynearwallet.com', 10 | helperUrl: 'https://helper.mainnet.near.org', 11 | explorerUrl: 'https://explorer.near.org', 12 | }) 13 | } 14 | 15 | override async getMeta() { 16 | return { 17 | name: 'MyNearWallet (Mainnet)', 18 | description: 'MyNearWallet (Mainnet)', 19 | icon: walletIcons['near'], 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/background/wallets/near/near/testnet.ts: -------------------------------------------------------------------------------- 1 | import * as walletIcons from '../../../../common/resources/wallets' 2 | import NearWallet from './index' 3 | 4 | export default class TestnetNearWallet extends NearWallet { 5 | constructor() { 6 | super({ 7 | networkId: 'testnet', 8 | nodeUrl: 'https://rpc.testnet.near.org', 9 | walletUrl: 'https://testnet.mynearwallet.com', 10 | helperUrl: 'https://helper.testnet.near.org', 11 | explorerUrl: 'https://explorer.testnet.near.org', 12 | }) 13 | } 14 | 15 | override async getMeta() { 16 | return { 17 | name: 'MyNearWallet (Testnet)', 18 | description: 'MyNearWallet (Testnet)', 19 | icon: walletIcons['near'], 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/common/chrome-extension-websocket-wrapper/constants.ts: -------------------------------------------------------------------------------- 1 | export const MESSAGE_BUS_NAME = 'WSPROXY' 2 | export const GLOBAL_EVENT_BUS_NAME = 'GLOBAL_EVENT_BUS' 3 | -------------------------------------------------------------------------------- /src/common/chrome-extension-websocket-wrapper/index.ts: -------------------------------------------------------------------------------- 1 | import WebSocketProxy from './webSocketProxy' 2 | import WebSocketProxyClient from './webSocketProxyClient' 3 | 4 | export { WebSocketProxy, WebSocketProxyClient } 5 | -------------------------------------------------------------------------------- /src/common/constants.ts: -------------------------------------------------------------------------------- 1 | import { ChainTypes } from './types' 2 | 3 | export const enum ModuleTypes { 4 | Feature = 'FEATURE', 5 | Adapter = 'ADAPTER', 6 | Library = 'LIBRARY', 7 | Interface = 'INTERFACE', 8 | ParserConfig = 'CONFIG', 9 | } 10 | 11 | export const enum StorageTypes { 12 | Swarm = 'swarm', 13 | TestRegsitry = 'test-registry', 14 | Ipfs = 'ipfs', 15 | } 16 | 17 | export type WalletInfo = { 18 | compatible: boolean 19 | protocolVersion: string 20 | engineVersion: string 21 | device: { 22 | manufacturer: string 23 | model: string 24 | } 25 | } 26 | 27 | export const DEFAULT_BRANCH_NAME = 'default' 28 | 29 | export const CONTEXT_ID_WILDCARD = '*' 30 | 31 | export const DAPPLETS_STORE_URL = 'https://store.dapplets.org' 32 | 33 | export const SECURE_AUTH_METHODS: string[] = [ 34 | ChainTypes.ETHEREUM_SEPOLIA, 35 | ChainTypes.ETHEREUM_XDAI, 36 | ChainTypes.NEAR_MAINNET, 37 | ChainTypes.NEAR_TESTNET, 38 | ] 39 | -------------------------------------------------------------------------------- /src/common/errors.ts: -------------------------------------------------------------------------------- 1 | export class NotImplementedError extends Error { 2 | constructor() { 3 | super('The method or operation is not implemented.') 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /src/common/generateGuid.ts: -------------------------------------------------------------------------------- 1 | export function generateGuid() { 2 | return 'xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx'.replace(/[xy]/g, function (c) { 3 | const r = (Math.random() * 16) | 0, 4 | v = c == 'x' ? r : (r & 0x3) | 0x8 5 | return v.toString(16) 6 | }) 7 | } 8 | -------------------------------------------------------------------------------- /src/common/models/base.ts: -------------------------------------------------------------------------------- 1 | export default abstract class Base { 2 | abstract getId: () => string 3 | } 4 | -------------------------------------------------------------------------------- /src/common/resources/no-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapplets/dapplet-extension/9074291617dd1830cc8573afbfa74de0090dcda0/src/common/resources/no-logo.png -------------------------------------------------------------------------------- /src/common/resources/social/github.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/common/resources/social/twitter-icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/common/resources/social/x.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/common/resources/wallets/eth.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/common/resources/wallets/index.ts: -------------------------------------------------------------------------------- 1 | import dapplets from './dapplets.svg' 2 | import metamask from './metamask.svg' 3 | import near from './near.svg' 4 | import walletconnect from './walletconnect.svg' 5 | 6 | export { metamask, walletconnect, near, dapplets } 7 | -------------------------------------------------------------------------------- /src/common/resources/wallets/near-black.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | > 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/common/resources/wallets/near.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/common/tracing.ts: -------------------------------------------------------------------------------- 1 | import * as Sentry from '@sentry/browser' 2 | 3 | export function startTracing() { 4 | const IS_SERVICE_WORKER = typeof window === 'undefined' 5 | 6 | if (EXTENSION_ENV !== 'production') return 7 | if (!IS_SERVICE_WORKER && window['DAPPLETS_JSLIB'] === true) return // ToDo: log errors in jslib 8 | 9 | Sentry.init({ 10 | dsn: 'https://41ee3f6e2cdc41b89f14b6377d56d1d5@o880231.ingest.sentry.io/5833728', 11 | integrations: IS_SERVICE_WORKER ? [] : [new Sentry.BrowserTracing()], // ToDo: split bundles for service worker and content script 12 | release: `dapplet-extension@${EXTENSION_VERSION}`, 13 | tracesSampleRate: 1.0, 14 | ignoreErrors: ['ResizeObserver loop limit exceeded'], 15 | }) 16 | } 17 | -------------------------------------------------------------------------------- /src/contentscript/modules/config-adapter/widgets/avatar-badge/types.ts: -------------------------------------------------------------------------------- 1 | export interface IAvatarBadgeState { 2 | img?: string | null 3 | video?: string 4 | mediaType?: string 5 | basic?: boolean 6 | horizontal: 'left' | 'right' 7 | vertical: 'top' | 'bottom' 8 | tooltip?: string | string[] 9 | accounts?: IConnectedAccountUser[] 10 | showAccounts?: boolean 11 | hidden?: boolean 12 | theme?: 'DARK' | 'LIGHT' 13 | exec?: (ctx: any, me: IAvatarBadgeState) => void 14 | init?: (tx: any, me: IAvatarBadgeState) => void 15 | ctx: any 16 | username: string 17 | insPointName: string 18 | } 19 | 20 | export interface IConnectedAccountUser { 21 | img: string 22 | name: string 23 | origin: string 24 | accountActive: boolean 25 | } 26 | -------------------------------------------------------------------------------- /src/contentscript/modules/config-adapter/widgets/button/loader.svg: -------------------------------------------------------------------------------- 1 | 10 | 20 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/contentscript/modules/config-adapter/widgets/index.ts: -------------------------------------------------------------------------------- 1 | import { AvatarBadge } from './avatar-badge' 2 | import { Button } from './button' 3 | 4 | export default { 5 | button: Button, 6 | avatarBadge: AvatarBadge, 7 | } 8 | -------------------------------------------------------------------------------- /src/contentscript/modules/index.ts: -------------------------------------------------------------------------------- 1 | import OverlayAdapter from './adapter-overlay' 2 | 3 | export = { 4 | 'overlay-adapter.dapplet-base.eth': OverlayAdapter, 5 | } 6 | -------------------------------------------------------------------------------- /src/contentscript/modules/types.ts: -------------------------------------------------------------------------------- 1 | export type Exports = { 2 | // eslint-disable-next-line @typescript-eslint/no-explicit-any 3 | [propName: string]: any 4 | } 5 | 6 | export type WidgetConfig = { 7 | [key: string]: T 8 | } & { 9 | id?: string 10 | initial?: string 11 | } 12 | 13 | export interface IWidget { 14 | mount(): void 15 | unmount(): void 16 | el: HTMLElement 17 | state: T 18 | insPointName: string 19 | } 20 | export type Context = { 21 | parsed: any 22 | eventHandlers: { [event: string]: Function[] } 23 | } 24 | -------------------------------------------------------------------------------- /src/contentscript/overlay/iframe/overlayManager.ts: -------------------------------------------------------------------------------- 1 | import { JsonRpc } from '../../../common/jsonrpc' 2 | import { IOverlayManager, OverlayConfig } from '../interfaces' 3 | import { OverlayIframe } from './overlay' 4 | 5 | export class OverlayManagerIframe implements IOverlayManager { 6 | constructor(private _iframeMessenger: JsonRpc) {} 7 | 8 | createOverlay(config: OverlayConfig): OverlayIframe { 9 | const overlay = new OverlayIframe(this._iframeMessenger, config) 10 | return overlay 11 | } 12 | show(): void {} 13 | togglePanel(): void {} 14 | openPopup(): void {} 15 | unregisterAll(source: string): void { 16 | this._iframeMessenger.call('OVERLAY_MANAGER_UNREGISTER_ALL', [source], window.top) 17 | } 18 | close(): void {} 19 | open(): void {} 20 | getOverlays(): OverlayIframe[] { 21 | return [] 22 | } 23 | toggle(): void {} 24 | destroy(): void {} 25 | } 26 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/assets/fonts/roboto-100-normal.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapplets/dapplet-extension/9074291617dd1830cc8573afbfa74de0090dcda0/src/contentscript/overlay/root/assets/fonts/roboto-100-normal.woff2 -------------------------------------------------------------------------------- /src/contentscript/overlay/root/assets/fonts/roboto-300-normal.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapplets/dapplet-extension/9074291617dd1830cc8573afbfa74de0090dcda0/src/contentscript/overlay/root/assets/fonts/roboto-300-normal.woff2 -------------------------------------------------------------------------------- /src/contentscript/overlay/root/assets/fonts/roboto-400-italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapplets/dapplet-extension/9074291617dd1830cc8573afbfa74de0090dcda0/src/contentscript/overlay/root/assets/fonts/roboto-400-italic.woff2 -------------------------------------------------------------------------------- /src/contentscript/overlay/root/assets/fonts/roboto-400-normal.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapplets/dapplet-extension/9074291617dd1830cc8573afbfa74de0090dcda0/src/contentscript/overlay/root/assets/fonts/roboto-400-normal.woff2 -------------------------------------------------------------------------------- /src/contentscript/overlay/root/assets/fonts/roboto-500-normal.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapplets/dapplet-extension/9074291617dd1830cc8573afbfa74de0090dcda0/src/contentscript/overlay/root/assets/fonts/roboto-500-normal.woff2 -------------------------------------------------------------------------------- /src/contentscript/overlay/root/assets/fonts/roboto-700-normal.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapplets/dapplet-extension/9074291617dd1830cc8573afbfa74de0090dcda0/src/contentscript/overlay/root/assets/fonts/roboto-700-normal.woff2 -------------------------------------------------------------------------------- /src/contentscript/overlay/root/assets/icons/arrow-01.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/assets/icons/checkboxOnMainSettingsNotification.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/assets/icons/close-notification-mini.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/assets/icons/close.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/assets/icons/closeLocalhost.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/assets/icons/copyShare.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/assets/icons/iconDropdown.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/assets/icons/iconsWidgetButton/edit.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/assets/icons/iconsWidgetButton/help.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/assets/icons/iconsWidgetButton/login.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/assets/icons/iconsWidgetButton/max.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/assets/icons/iconsWidgetButton/notification.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/assets/icons/iconsWidgetButton/pause.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/assets/icons/iconsWidgetButton/power.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/assets/icons/iconsWidgetButton/show.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/assets/icons/mini-close.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/assets/icons/notificationIcons/bell.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/assets/icons/notificationIcons/bellWithNotification.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/assets/icons/notificationIcons/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapplets/dapplet-extension/9074291617dd1830cc8573afbfa74de0090dcda0/src/contentscript/overlay/root/assets/icons/notificationIcons/bg.png -------------------------------------------------------------------------------- /src/contentscript/overlay/root/assets/icons/notificationIcons/closeNotification.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/assets/icons/notificationIcons/defaultIcon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/assets/icons/tokenomics/dot.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/assets/icons/tokenomics/down.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/assets/icons/tokenomics/folder.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/assets/icons/tokenomics/plus.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/assets/icons/tokenomics/refresh.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/assets/icons/tokenomics/up.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/assets/icons/up.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/assets/newIcon/bell.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/assets/newIcon/bellNoCircle.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/assets/newIcon/collapsed.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/assets/newIcon/hide.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/assets/newIcon/home_top.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/assets/newIcon/notification.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/assets/newIcon/plus.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/assets/newIcon/search.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/assets/newIcon/squares.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/assets/styles/color.variables.scss: -------------------------------------------------------------------------------- 1 | $primary: #d9304f; 2 | $primary-hover: #eb9dab; 3 | $primary-pressed: #a6253c; 4 | $secondary: #588ca3; 5 | $secondary-hover: #5ab5e8; 6 | $secondary-pressed: #468db5; 7 | $main-grey: #919191; 8 | $web-bg: #eaf0f0; 9 | $pure-white: #fff; 10 | $main-black: #2a2a2a; 11 | $content-black: #747376; 12 | $success: #41ae60; 13 | $success-hover: #198638; 14 | $success-pressed: #69d688; 15 | $error: #FF6442; 16 | $median-price-bg: #F9F9F9; 17 | $app-bg: #f5f5f5; 18 | $overlay-bg: #f4f4f4; 19 | $stroke-color: #e3e3e3; 20 | $pure-black: #000; 21 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/assets/styles/pages.scss: -------------------------------------------------------------------------------- 1 | .wrapper { 2 | overflow: hidden; 3 | display: flex; 4 | flex: 1 1 auto; 5 | flex-direction: column; 6 | 7 | width: 100%; 8 | } 9 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/assets/svg/back.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/assets/svg/burn.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/assets/svg/card.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/assets/svg/copied.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/assets/svg/copyModal.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/assets/svg/copyModal16.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/assets/svg/default.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/assets/svg/disconnect.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/assets/svg/garbage.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/assets/svg/home.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/assets/svg/loadAddLocalhost.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/assets/svg/loaderCopy.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/assets/svg/loaderNotification.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/assets/svg/loaderSettings.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/assets/svg/logOut.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/assets/svg/modalClose.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/assets/svg/newDelete.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/assets/svg/newHome.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/assets/svg/plus.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/assets/svg/refresh_search.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/assets/svg/unlink.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/common/constants.ts: -------------------------------------------------------------------------------- 1 | export const regExpIndexNearTestnet = new RegExp( 2 | /^(?:[a-z0-9](?:[a-z0-9-_]{0,61}[a-z0-9])?\.)+testnet$/ 3 | ) 4 | export const regExpIndexNear = new RegExp(/^(?:[a-z0-9](?:[a-z0-9-_]{0,61}[a-z0-9])?\.)+near$/) 5 | export const regExpIndexENS = new RegExp(/^(?:[a-z0-9](?:[a-z0-9-_]{0,61}[a-z0-9])?\.)+eth$/) 6 | export const regExpIndexEthereum = new RegExp(/^0x[a-fA-F0-9]{40}$/) 7 | export const regExpIndexNEARImplicit = new RegExp(/^[0-9a-z]{64}$/) 8 | export const regExpIndexNEARDev = new RegExp(/^dev-\d*-\d*$/) 9 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/common/helpers.ts: -------------------------------------------------------------------------------- 1 | export const getValidationAddress = (value, reg) => { 2 | try { 3 | const valueReg = value.match(reg) 4 | 5 | return valueReg 6 | } catch {} 7 | } 8 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/components/AlertConfirmPopup/AlertConfirmPopup.module.scss: -------------------------------------------------------------------------------- 1 | .wrapper { 2 | width: 200px; 3 | } 4 | 5 | .iconAlert { 6 | position: relative; 7 | display: block; 8 | border-radius: 5px; 9 | 10 | img { 11 | width: 100%; 12 | height: 100%; 13 | 14 | background-image: inherit; 15 | background-size: cover; 16 | border-radius: 5px; 17 | } 18 | } 19 | 20 | .textPartSmall { 21 | width: 160px; 22 | } 23 | 24 | .textPartBig { 25 | width: 340px; 26 | } 27 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/components/BaseOnboarding/assets/Normal_switch.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/components/BaseOnboarding/components/Button/Button.module.scss: -------------------------------------------------------------------------------- 1 | @import '../../../../assets/styles/null'; 2 | @import '../../../../assets/styles/color.variables'; 3 | 4 | .default{ 5 | display: flex; 6 | align-items: center; 7 | justify-content: center; 8 | 9 | width: 135px; 10 | height: 32px; 11 | 12 | 13 | font-size: 14px; 14 | font-weight: 400; 15 | line-height: 149%; 16 | color: $primary; 17 | 18 | background: inherit; 19 | border: 1px solid $primary; 20 | border-radius: 8px; 21 | 22 | &:hover{ 23 | color: $primary-hover; 24 | border: 1px solid $primary-hover; 25 | } 26 | } 27 | 28 | .big{ 29 | width: 100%; 30 | border-radius: 8px; 31 | } -------------------------------------------------------------------------------- /src/contentscript/overlay/root/components/BaseOnboarding/components/Button/index.tsx: -------------------------------------------------------------------------------- 1 | import cn from 'classnames' 2 | import React, { FC } from 'react' 3 | import styles from './Button.module.scss' 4 | 5 | export type ButtonProps = { 6 | big?: boolean 7 | label: string 8 | onClick: () => void 9 | } 10 | 11 | export const Button: FC = (props: ButtonProps) => { 12 | const { label, big, onClick: onNext } = props 13 | 14 | return ( 15 | 23 | ) 24 | } 25 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/components/BaseOnboarding/components/SkipButton/SkipButton.module.scss: -------------------------------------------------------------------------------- 1 | @import '../../../../assets/styles/null'; 2 | @import '../../../../assets/styles/color.variables'; 3 | 4 | .skip{ 5 | display: flex; 6 | align-items: center; 7 | justify-content: center; 8 | 9 | width: 135px; 10 | height: 32px; 11 | 12 | 13 | font-size: 14px; 14 | font-weight: 400; 15 | line-height: 149%; 16 | color: $main-grey; 17 | text-decoration-line: underline; 18 | 19 | background: inherit; 20 | 21 | &:hover{ 22 | color: $content-black; 23 | } 24 | } -------------------------------------------------------------------------------- /src/contentscript/overlay/root/components/BaseOnboarding/components/SkipButton/index.tsx: -------------------------------------------------------------------------------- 1 | import cn from 'classnames' 2 | import React, { FC } from 'react' 3 | import styles from './SkipButton.module.scss' 4 | 5 | export type Props = { 6 | onClick: () => void 7 | } 8 | 9 | export const SkipButton: FC = (props: Props) => { 10 | const { onClick } = props 11 | 12 | return ( 13 | 16 | ) 17 | } 18 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/components/BaseOnboarding/components/Title/Title.module.scss: -------------------------------------------------------------------------------- 1 | @import '../../../../assets/styles/null'; 2 | @import '../../../../assets/styles/color.variables'; 3 | 4 | .wrapper{ 5 | display: flex; 6 | align-items: center; 7 | justify-content: space-between; 8 | 9 | width: 100%;; 10 | height: 27px; 11 | margin-bottom: 10px; 12 | 13 | background: inherit; 14 | } 15 | 16 | .title{ 17 | font-size: 18px; 18 | font-weight: 400; 19 | line-height: 149%; 20 | color: #5AB5E8; 21 | } 22 | 23 | .indicatorBlock{ 24 | display: flex; 25 | align-items: center; 26 | justify-content: space-between; 27 | 28 | 29 | width: 78px; 30 | height: 18px; 31 | padding: 4px; 32 | } 33 | 34 | .indicator{ 35 | cursor: pointer; 36 | 37 | width: 10px; 38 | height: 10px; 39 | 40 | background: $stroke-color; 41 | border-radius: 50%; 42 | } 43 | 44 | .indicatorActive{ 45 | background: $primary; 46 | } -------------------------------------------------------------------------------- /src/contentscript/overlay/root/components/Checkbox/adaptive.scss: -------------------------------------------------------------------------------- 1 | @media (min-width: 320px) and (max-width: 640px) { 2 | .inputCheckboxTitle { 3 | margin-right: 8px; 4 | padding: 0 0 0 4px; 5 | font-size: 10px; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/components/CloseIcon/CloseIcon.module.scss: -------------------------------------------------------------------------------- 1 | @import "../../assets/styles/color.variables"; 2 | @import "../../assets/styles/null"; 3 | 4 | .button { 5 | cursor: pointer; 6 | background-color: transparent; 7 | border: none; 8 | } 9 | 10 | .small { 11 | width: 20px; 12 | height: 20px; 13 | } 14 | 15 | .big { 16 | width: 39px; 17 | height: 39px; 18 | } 19 | 20 | .red path { 21 | fill: $primary; 22 | } 23 | 24 | .black path { 25 | fill: $main-black; 26 | } 27 | 28 | .red:active path { 29 | fill: $primary-pressed; 30 | } 31 | 32 | .red:hover path { 33 | fill: $primary-hover; 34 | } 35 | 36 | .black:hover path { 37 | fill: $content-black; 38 | } 39 | 40 | .black:active path { 41 | fill: $main-grey; 42 | } 43 | 44 | .notification:active path{ 45 | fill: none; 46 | stroke: $primary-pressed; 47 | } 48 | 49 | .notification:hover path{ 50 | fill: none; 51 | stroke: $primary-hover; 52 | } -------------------------------------------------------------------------------- /src/contentscript/overlay/root/components/Dapplet/adaptive.scss: -------------------------------------------------------------------------------- 1 | @media (min-width: 320px) and (max-width: 640px) { 2 | .wrapperCard { 3 | width: 100%; 4 | min-width: 100%; 5 | max-width: none; 6 | background: $pure-white; 7 | } 8 | 9 | .wrapperBlock { 10 | width: calc(100% - 50px); 11 | } 12 | 13 | .blockTop { 14 | display: flex; 15 | } 16 | 17 | .blockText { 18 | width: 100%; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/components/DappletImage/DappletImage.module.scss: -------------------------------------------------------------------------------- 1 | @import "../../assets/styles/color.variables"; 2 | @import "../../assets/styles/null"; 3 | 4 | .img { 5 | position: relative; 6 | 7 | display: block; 8 | 9 | width: 50px; 10 | height: 50px; 11 | 12 | border-radius: 5px; 13 | 14 | img { 15 | width: 100%; 16 | height: 100%; 17 | 18 | background-image: inherit; 19 | background-size: cover; 20 | border-radius: 5px; 21 | } 22 | } 23 | 24 | .errorImg { 25 | background-image: inherit; 26 | background-size: cover; 27 | } 28 | 29 | .label { 30 | position: absolute; 31 | top: 5%; 32 | left: 67%; 33 | width: 14px; 34 | } 35 | 36 | .true { 37 | svg { 38 | path { 39 | fill: $primary; 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/components/DappletImage/index.tsx: -------------------------------------------------------------------------------- 1 | import cn from 'classnames' 2 | import React, { FC } from 'react' 3 | import NO_LOGO from '../../../../../common/resources/no-logo.png' 4 | import { StorageRef } from '../../../../../common/types' 5 | import { useStorageRef } from '../../utils/useStorageRef' 6 | import styles from './DappletImage.module.scss' 7 | 8 | export interface DappletImageProps { 9 | storageRef: StorageRef 10 | className?: string 11 | } 12 | 13 | export const DappletImage: FC = (props: DappletImageProps) => { 14 | const { storageRef, className } = props 15 | const { data } = useStorageRef(storageRef) 16 | 17 | return ( 18 |
19 |
20 | 21 |
22 |
23 | ) 24 | } 25 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/components/DappletTitle/DappletTitle.module.scss: -------------------------------------------------------------------------------- 1 | @import '../../assets/styles/color.variables'; 2 | @import '../../assets/styles/null'; 3 | @import './adaptive'; 4 | 5 | .BlockTitleCard { 6 | display: flex; 7 | flex-grow: 1; 8 | align-items: center; 9 | 10 | .titleCard { 11 | font-size: 14px; 12 | font-weight: 700; 13 | font-style: normal; 14 | line-height: 100%; 15 | color: $main-black; 16 | 17 | .false { 18 | margin: 0 0 0 -3%; 19 | } 20 | } 21 | 22 | .iconCard { 23 | margin-left: 4px; 24 | 25 | path { 26 | fill: $content-black; 27 | } 28 | } 29 | 30 | .isShowDescription { 31 | svg { 32 | transform: rotate(180deg); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/components/DappletTitle/adaptive.scss: -------------------------------------------------------------------------------- 1 | @media (min-width: 320px) and (max-width: 640px) { 2 | .BlockTitleCard { 3 | width: 100%; 4 | min-width: 105px; 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/components/DappletTitle/index.tsx: -------------------------------------------------------------------------------- 1 | import cn from 'classnames' 2 | import React, { FC, ReactChild, ReactNode } from 'react' 3 | import styles from './DappletTitle.module.scss' 4 | 5 | export interface DappletTitleProps { 6 | title: string 7 | isShowDescription?: boolean 8 | children?: ReactChild | ReactNode 9 | className? 10 | } 11 | export const DappletTitle: FC = (props: DappletTitleProps) => { 12 | const { title, children, className } = props 13 | 14 | return ( 15 |
16 |
17 |

{title}

18 |
19 | {children} 20 |
21 | ) 22 | } 23 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/components/DevModulesList/adaptive.scss: -------------------------------------------------------------------------------- 1 | @media (min-width: 320px) and (max-width: 640px) { 2 | .dappletsLabelSpanInfo { 3 | margin: 0; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/components/Dropdown/dropdown-list.ts: -------------------------------------------------------------------------------- 1 | import { IDropdown } from '../../models/dropdown.model' 2 | 3 | export const DROPDOWN_LIST: IDropdown[] = [ 4 | { _id: '0', label: 'Local', value: 'local' }, 5 | { _id: '1', label: 'Public', value: 'public' }, 6 | { _id: '2', label: 'Trusted Users', value: 'trusted' }, 7 | { _id: '3', label: 'All', value: 'all' }, 8 | { _id: '4', label: 'Active', value: 'active' }, 9 | ] 10 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/components/DropdownCAListReceiver/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { WalletDescriptorWithCAMainStatus } from '../../../../../common/types' 3 | import { DropdownAccounts } from '../DropdownAccounts' 4 | 5 | type TDropdownCAListReceiverProps = { 6 | values: WalletDescriptorWithCAMainStatus[] 7 | selected?: WalletDescriptorWithCAMainStatus 8 | setter: React.Dispatch> 9 | maxLength?: number 10 | } 11 | 12 | export const DropdownCAListReceiver = (props: TDropdownCAListReceiverProps) => { 13 | const { values, selected, setter, maxLength } = props 14 | 15 | return ( 16 | 17 | values={values} 18 | selected={selected} 19 | setter={setter} 20 | nameId="account" 21 | originId="chain" 22 | maxLength={maxLength} 23 | /> 24 | ) 25 | } 26 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/components/DropdownCAModal/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { IConnectedAccountUser } from '../../../../../common/types' 3 | import { DropdownAccounts } from '../DropdownAccounts' 4 | 5 | type TDropdownCAModalProps = { 6 | values: IConnectedAccountUser[] 7 | selected?: IConnectedAccountUser 8 | setter: React.Dispatch> 9 | } 10 | 11 | export const DropdownCAModal = (props: TDropdownCAModalProps) => { 12 | const { values, selected, setter } = props 13 | 14 | return ( 15 | 16 | values={values} 17 | selected={selected} 18 | setter={setter} 19 | nameId="name" 20 | originId="origin" 21 | /> 22 | ) 23 | } 24 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/components/DropdownPreferedOverlayStorage/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { OverlayStorages } from '../../../../../common/types' 3 | import { DropdownSettings } from '../DropdownSettings' 4 | 5 | export const DropdownPreferedOverlayStorage = () => ( 6 | 11 | ) 12 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/components/DropdownPreferredCANetwork/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { NearNetworks } from '../../../../../common/types' 3 | import { DropdownSettings } from '../DropdownSettings' 4 | 5 | export const DropdownPreferredCANetwork = () => ( 6 | 12 | ) 13 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/components/Icon/Icon.module.scss: -------------------------------------------------------------------------------- 1 | @import "../../assets/styles/null"; 2 | 3 | .iconsTitle { 4 | display: flex; 5 | justify-content: space-between; 6 | 7 | .small { 8 | svg { 9 | width: 16px; 10 | } 11 | } 12 | 13 | .big { 14 | width: 26px; 15 | height: 26px; 16 | background: #fff; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/components/Icon/index.tsx: -------------------------------------------------------------------------------- 1 | import cn from 'classnames' 2 | import React, { FC, FunctionComponent } from 'react' 3 | import styles from './Icon.module.scss' 4 | 5 | export interface IconsTitleProps { 6 | icon: FunctionComponent 7 | size: 'small' | 'big' 8 | } 9 | export const Icon: FC = (props: IconsTitleProps) => { 10 | const { icon: Icon, size, ...anotherProps } = props 11 | return ( 12 |
19 | 20 |
21 | ) 22 | } 23 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/components/Localhost/adaptive.scss: -------------------------------------------------------------------------------- 1 | @import "../../assets/styles/null"; 2 | @import "../../assets/styles/color.variables"; 3 | 4 | @media (min-width: 320px) and (max-width: 640px) { 5 | .label { 6 | overflow: hidden; 7 | display: inline-block; 8 | width: 100%; 9 | max-width: 100%; 10 | } 11 | 12 | .buttonLocalhost { 13 | margin-right: 0; 14 | } 15 | 16 | .labelLocalhost { 17 | flex: 1 1 auto; 18 | max-width: 65%; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/components/Notification/adaptive.scss: -------------------------------------------------------------------------------- 1 | @media (max-width: 640px) and (min-width: 320px) { 2 | .wrapper { 3 | max-width: 98%; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/components/Overlay/adaptive.scss: -------------------------------------------------------------------------------- 1 | @media (min-width: 320px) and (max-width: 640px) { 2 | .overlay { 3 | width: 100%; 4 | min-width: 100%; 5 | } 6 | 7 | .wrapper { 8 | overflow: hidden; 9 | width: 100%; 10 | height: 100%; 11 | padding: 0 15px 7px; 12 | } 13 | 14 | .inner { 15 | flex: 1 1 auto; 16 | max-width: 100%; 17 | height: 100%; 18 | padding: 0; 19 | } 20 | 21 | .header { 22 | padding: 8px 0; 23 | } 24 | 25 | .children { 26 | height: 95%; 27 | } 28 | 29 | .searchBlock { 30 | top: inherit; 31 | padding: 0 0 7px; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/components/OverlayTab/styles/adaptive.scss: -------------------------------------------------------------------------------- 1 | @import '../../../assets/styles/color.variables'; 2 | 3 | @media (min-width: 320px) and (max-width: 640px) { 4 | .tab { 5 | display: flex; 6 | justify-content: space-between; 7 | 8 | width: max-content; 9 | max-width: none; 10 | height: 52px; 11 | margin: 0; 12 | 13 | background: #fff; 14 | border-radius: 10px; 15 | } 16 | 17 | .list { 18 | display: flex; 19 | flex-direction: row; 20 | align-items: center; 21 | } 22 | 23 | .item { 24 | margin-top: 0; 25 | 26 | &:not(:last-child) { 27 | margin: 0; 28 | } 29 | 30 | &:nth-child(2) { 31 | margin: 0; 32 | } 33 | } 34 | 35 | .isOpenWallet { 36 | &::before { 37 | background-color: rgb(255 255 255 / 0%); 38 | border-radius: 10px; 39 | } 40 | } 41 | 42 | .tabNotActive { 43 | width: auto; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/components/OverlayToolbar/ModalTabs/ModalTabs.module.scss: -------------------------------------------------------------------------------- 1 | .modal { 2 | position: fixed; 3 | z-index: 9999; 4 | top: 0; 5 | right: 0; 6 | bottom: 0; 7 | left: 0; 8 | 9 | display: flex; 10 | align-items: flex-start; 11 | justify-content: flex-end; 12 | 13 | width: 100%; 14 | 15 | background: rgb(196 196 196 / 10%); 16 | backdrop-filter: blur(2px); 17 | 18 | animation-name: appear; 19 | animation-duration: 300ms; 20 | 21 | span { 22 | position: absolute; 23 | top: 15px; 24 | right: 14px; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/components/PopupItem/PopupItem.module.scss: -------------------------------------------------------------------------------- 1 | .dapplets-popup-container { 2 | position: absolute; 3 | z-index: 5; 4 | top: 0; 5 | left: 0; 6 | 7 | width: 100%; 8 | height: 100%; 9 | 10 | background: rgb(0 0 0 / 10%); 11 | backdrop-filter: blur(4px); 12 | } 13 | 14 | .dapplets-popup-container > * { 15 | position: absolute; 16 | top: calc(50% - 271px); 17 | left: calc(50% - 187.5px); 18 | 19 | width: 375px; 20 | height: 542px; 21 | 22 | border: none; 23 | } 24 | 25 | .popup-loader-container { 26 | box-sizing: border-box; 27 | padding: 18px; 28 | background: #fff; 29 | border-radius: 10px; 30 | } 31 | 32 | .popup-loader-container img { 33 | position: absolute; 34 | top: 50%; 35 | left: 50%; 36 | 37 | width: 143px; 38 | height: 143px; 39 | margin: -71.5px 0 0 -71.5px; 40 | } 41 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/components/Profile/LoginButtons/LoginButtons.module.scss: -------------------------------------------------------------------------------- 1 | @import "../../../assets/styles/null"; 2 | @import "../../../assets/styles/color.variables"; 3 | 4 | .buttonLogin { 5 | display: inline-block; 6 | 7 | padding: 10px 20px; 8 | 9 | 10 | font-size: 10px; 11 | font-weight: 400; 12 | font-style: normal; 13 | line-height: 100%; 14 | color: $primary; 15 | text-align: center; 16 | text-transform: capitalize; 17 | 18 | background: #fff; 19 | border-radius: 200px; 20 | 21 | &:hover { 22 | color: $primary-hover; 23 | } 24 | 25 | &:active { 26 | color: $primary-pressed; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/components/Profile/LoginButtons/index.tsx: -------------------------------------------------------------------------------- 1 | import cn from 'classnames' 2 | import React, { ButtonHTMLAttributes, DetailedHTMLProps, FC } from 'react' 3 | import styles from './LoginButtons.module.scss' 4 | 5 | export interface LogInButtonProps 6 | extends DetailedHTMLProps, HTMLButtonElement> { 7 | label: string 8 | onLogin?: () => void 9 | disabled?: boolean 10 | } 11 | export const LogInButton: FC = (props: LogInButtonProps) => { 12 | const { label, onLogin, disabled, ...otherProps } = props 13 | return ( 14 | 22 | ) 23 | } 24 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/components/Profile/Profile.module.scss: -------------------------------------------------------------------------------- 1 | @import "../../assets/styles/null"; 2 | @import "../../assets/styles/color.variables"; 3 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/components/Search/adaptive.scss: -------------------------------------------------------------------------------- 1 | @media (min-width: 320px) and (max-width: 640px) { 2 | .wrapper { 3 | // left: 10%; 4 | } 5 | 6 | .labelSearchModule { 7 | // width: 65%; 8 | } 9 | 10 | .close { 11 | // left: 55%; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/components/SettingItem/adaptive.scss: -------------------------------------------------------------------------------- 1 | @media (max-width: 640px) and (min-width: 320px) { 2 | .MainSettingsAuto { 3 | max-width: 100%; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/components/SettingWrapper/SettingWrapper.module.scss: -------------------------------------------------------------------------------- 1 | @import "../../assets/styles/color.variables"; 2 | @import "../../assets/styles/null"; 3 | @import "./adaptive"; 4 | 5 | .wrapper { 6 | position: relative; 7 | 8 | width: 100%; 9 | margin: 0 0 15px; 10 | padding: 25px 17px 15px; 11 | 12 | 13 | 14 | border: 1px solid $main-grey; 15 | border-radius: 5px; 16 | } 17 | 18 | .title { 19 | position: absolute; 20 | z-index: 2; 21 | top: -12px; 22 | left: 16px; 23 | 24 | display: inline-block; 25 | 26 | padding: 0 10px; 27 | 28 | font-size: 10px; 29 | font-weight: 500; 30 | color: $content-black; 31 | 32 | border: 1px solid $main-grey; 33 | border-radius: 4px; 34 | 35 | &::before { 36 | content: ""; 37 | 38 | position: absolute; 39 | z-index: -1; 40 | top: 0; 41 | left: 0; 42 | 43 | width: 100%; 44 | height: 100%; 45 | 46 | background-color: $overlay-bg; 47 | border-radius: 3px; 48 | } 49 | } 50 | 51 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/components/SettingWrapper/adaptive.scss: -------------------------------------------------------------------------------- 1 | @media (max-width: 640px) and (min-width: 320px) { 2 | .wrapper { 3 | max-width: 100%; 4 | padding: 25px 10px 15px; 5 | } 6 | 7 | .title { 8 | z-index: 0; 9 | top: -12px; 10 | left: 10px; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/components/SettingWrapper/index.tsx: -------------------------------------------------------------------------------- 1 | import cn from 'classnames' 2 | import React, { DetailedHTMLProps, HTMLAttributes, ReactElement } from 'react' 3 | import styles from './SettingWrapper.module.scss' 4 | 5 | export interface SettingWrapperProps 6 | extends DetailedHTMLProps, HTMLDivElement> { 7 | title: string 8 | } 9 | 10 | export const SettingWrapper = (props: SettingWrapperProps): ReactElement => { 11 | const { title, children, className, ...anotherProps } = props 12 | 13 | return ( 14 |
15 |
{title}
16 |
{children}
17 |
18 | ) 19 | } 20 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/components/StorageRefImage/StorageRefImage.module.scss: -------------------------------------------------------------------------------- 1 | @import "../../assets/styles/null"; 2 | @import "../../assets/styles/color.variables"; 3 | @import "./adaptive"; 4 | 5 | .dappletsImg { 6 | display: flex; 7 | align-items: center; 8 | justify-content: center; 9 | 10 | width: 35px; 11 | height: 35px; 12 | 13 | background: inherit; 14 | border-radius: 5px; 15 | 16 | img { 17 | width: 100%; 18 | height: 100%; 19 | border-radius: 5px; 20 | } 21 | } 22 | 23 | .noLogo { 24 | display: inline-block; 25 | 26 | box-sizing: border-box; 27 | width: 35px; 28 | height: 35px; 29 | 30 | background: #c4c4c4; 31 | border: 1px solid $web-bg; 32 | border-radius: 20px; 33 | box-shadow: 0 0 4px rgb(0 0 0 / 25%); 34 | } 35 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/components/StorageRefImage/adaptive.scss: -------------------------------------------------------------------------------- 1 | @media (min-width: 320px) and (max-width: 640px) { 2 | .dappletsImg { 3 | img { 4 | height: auto; 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/components/StorageRefImage/index.tsx: -------------------------------------------------------------------------------- 1 | import cn from 'classnames' 2 | import React, { FC } from 'react' 3 | import { StorageRef } from '../../../../../common/types' 4 | import { useStorageRef } from '../../utils/useStorageRef' 5 | import styles from './StorageRefImage.module.scss' 6 | 7 | interface PropsStorageRefImage { 8 | storageRef: StorageRef | string 9 | className?: string 10 | onClick?: React.MouseEventHandler 11 | } 12 | 13 | export const StorageRefImage: FC = (props) => { 14 | const { storageRef, className, onClick } = props 15 | 16 | const { data } = useStorageRef(storageRef) 17 | 18 | return ( 19 |
20 | {data ? : } 21 |
22 | ) 23 | } 24 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/components/StorageRefImg/index.tsx: -------------------------------------------------------------------------------- 1 | import React, { FC } from 'react' 2 | import { StorageRef } from '../../../../../common/types' 3 | import { useStorageRef } from '../../utils/useStorageRef' 4 | 5 | interface PropsStorageRefImage 6 | extends React.DetailedHTMLProps, HTMLImageElement> { 7 | storageRef: StorageRef | string 8 | noImgSrc: string 9 | } 10 | 11 | // ToDo: the following component repeats the same logic as in StorageRefImage. Need to unify them 12 | 13 | export const StorageRefImg: FC = (props) => { 14 | const { storageRef, noImgSrc, ...anotherProps } = props 15 | 16 | const { data: dataUri } = useStorageRef(storageRef) 17 | 18 | return dataUri ? ( 19 | 20 | ) : ( 21 | 22 | ) 23 | } 24 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/components/Switch/index.tsx: -------------------------------------------------------------------------------- 1 | import cn from 'classnames' 2 | import React, { DetailedHTMLProps, FC, InputHTMLAttributes } from 'react' 3 | import styles from './Switch.module.scss' 4 | 5 | export interface SwitchProps 6 | extends DetailedHTMLProps, HTMLInputElement> { 7 | checked?: boolean 8 | isLoad?: boolean 9 | className?: string 10 | } 11 | 12 | export const Switch: FC = ({ 13 | checked = false, 14 | onChange, 15 | isLoad, 16 | className, 17 | ...props 18 | }) => { 19 | return ( 20 | 28 | ) 29 | } 30 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/components/SystemPopup/SystemPopup.module.scss: -------------------------------------------------------------------------------- 1 | .dapplets-popup-container { 2 | position: absolute; 3 | z-index: 5; 4 | top: 0; 5 | left: 0; 6 | 7 | width: 100%; 8 | height: 100%; 9 | 10 | background: rgb(0 0 0 / 10%); 11 | backdrop-filter: blur(4px); 12 | } 13 | 14 | .dapplets-popup-container > * { 15 | position: absolute; 16 | top: calc(50% - 271px); 17 | left: calc(50% - 187.5px); 18 | 19 | width: 375px; 20 | height: 542px; 21 | 22 | border: none; 23 | } 24 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/components/SystemPopup/assests/arrow-left.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/components/SystemPopup/assests/arrow-right.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/components/SystemPopup/assests/close.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/components/SystemPopup/components/Button/Button.module.scss: -------------------------------------------------------------------------------- 1 | .button { 2 | cursor: pointer; 3 | 4 | padding: 5px 10px; 5 | 6 | font-size: 14px; 7 | color: #fff; 8 | 9 | background-color: #d9304f; 10 | border: none; 11 | border-radius: 5px; 12 | } 13 | 14 | .button:hover { 15 | background-color: #e52347; 16 | } 17 | 18 | .button:active { 19 | background-color: #95132b; 20 | } 21 | 22 | .basic { 23 | cursor: pointer; 24 | 25 | padding: 5px 10px; 26 | 27 | font-size: 14px; 28 | font-weight: 500; 29 | color: #d9304f; 30 | 31 | background-color: #0000; 32 | border: none; 33 | border-radius: 5px; 34 | } 35 | 36 | .basic:hover { 37 | color: #e52347; 38 | } 39 | 40 | .basic:active { 41 | color: #95132b; 42 | } 43 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/components/SystemPopup/components/Button/Button.props.ts: -------------------------------------------------------------------------------- 1 | import { ButtonHTMLAttributes, DetailedHTMLProps } from 'react' 2 | 3 | export interface ButtonProps 4 | extends DetailedHTMLProps, HTMLButtonElement> { 5 | children: string 6 | basic?: boolean 7 | } 8 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/components/SystemPopup/components/Button/index.tsx: -------------------------------------------------------------------------------- 1 | import cn from 'classnames' 2 | import React, { FC } from 'react' 3 | import styles from './Button.module.scss' 4 | import { ButtonProps } from './Button.props' 5 | 6 | export const Button: FC = ({ className, children, basic, ...props }: ButtonProps) => { 7 | return ( 8 | 14 | ) 15 | } 16 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/components/SystemPopup/components/Close/Close.module.scss: -------------------------------------------------------------------------------- 1 | @import '../../../../assets/styles/color.variables'; 2 | 3 | .close { 4 | cursor: pointer; 5 | 6 | display: flex; 7 | align-items: center; 8 | justify-content: center; 9 | 10 | width: 20px; 11 | height: 20px; 12 | padding: 0; 13 | 14 | background-color: $primary; 15 | border: none; 16 | border-radius: 50%; 17 | } 18 | 19 | .close:hover { 20 | background-color: $primary-hover; 21 | 22 | svg{ 23 | path{ 24 | fill:#fff!important; 25 | } 26 | } 27 | } 28 | 29 | .close:active { 30 | background-color: $primary-pressed; 31 | 32 | svg{ 33 | path{ 34 | fill:#fff!important; 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/components/SystemPopup/components/Close/Close.props.ts: -------------------------------------------------------------------------------- 1 | import { ButtonHTMLAttributes, DetailedHTMLProps } from 'react' 2 | 3 | export type CloseProps = DetailedHTMLProps< 4 | ButtonHTMLAttributes, 5 | HTMLButtonElement 6 | > 7 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/components/SystemPopup/components/Close/index.tsx: -------------------------------------------------------------------------------- 1 | import cn from 'classnames' 2 | import React, { FC } from 'react' 3 | import { ReactComponent as CloseModal } from '../../../../assets/svg/modalClose.svg' 4 | import styles from './Close.module.scss' 5 | import { CloseProps } from './Close.props' 6 | 7 | export const Close: FC = ({ className, ...props }: CloseProps) => { 8 | return ( 9 | 13 | ) 14 | } 15 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/components/SystemPopup/components/Loading/Loading.module.scss: -------------------------------------------------------------------------------- 1 | .wrapper { 2 | display: flex; 3 | flex-direction: column; 4 | max-width: 240px; 5 | background-color: #fff; 6 | } 7 | 8 | .subtitle { 9 | max-width: 208px; 10 | margin-right: auto; 11 | margin-left: auto; 12 | text-align: center; 13 | } 14 | 15 | .loading { 16 | position: relative; 17 | 18 | overflow: hidden; 19 | display: flex; 20 | align-items: center; 21 | justify-content: center; 22 | 23 | width: 143px; 24 | height: 143px; 25 | margin: 20px auto; 26 | 27 | border-radius: 50%; 28 | } 29 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/components/SystemPopup/components/Session/Session.props.ts: -------------------------------------------------------------------------------- 1 | import { ReactElement } from 'react' 2 | 3 | export interface SessionProps { 4 | providerIcon: string 5 | lastUsage: string 6 | accountIcon: string 7 | walletIcon: string 8 | account: string 9 | buttons: ReactElement[] | ReactElement 10 | } 11 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/components/SystemPopup/fonts/roboto-v29-latin-500.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapplets/dapplet-extension/9074291617dd1830cc8573afbfa74de0090dcda0/src/contentscript/overlay/root/components/SystemPopup/fonts/roboto-v29-latin-500.woff2 -------------------------------------------------------------------------------- /src/contentscript/overlay/root/components/SystemPopup/fonts/roboto-v29-latin-700.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapplets/dapplet-extension/9074291617dd1830cc8573afbfa74de0090dcda0/src/contentscript/overlay/root/components/SystemPopup/fonts/roboto-v29-latin-700.woff2 -------------------------------------------------------------------------------- /src/contentscript/overlay/root/components/SystemPopup/fonts/roboto-v29-latin-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapplets/dapplet-extension/9074291617dd1830cc8573afbfa74de0090dcda0/src/contentscript/overlay/root/components/SystemPopup/fonts/roboto-v29-latin-regular.woff2 -------------------------------------------------------------------------------- /src/contentscript/overlay/root/components/SystemPopup/pages/ConnectedAccountsModal/helpers/areConnectedAccountsUsersWallets.ts: -------------------------------------------------------------------------------- 1 | import { resources } from '../../../../../../../../common/resources' 2 | import { IConnectedAccountUser } from '../../../../../../../../common/types' 3 | 4 | const areConnectedAccountsUsersWallets = (...users: IConnectedAccountUser[]) => 5 | users.every((user) => resources[user.origin].type === 'wallet') 6 | 7 | export default areConnectedAccountsUsersWallets 8 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/components/SystemPopup/pages/ConnectedAccountsModal/helpers/checkIfTheAccountsHaveBeenAlreadyConnected.ts: -------------------------------------------------------------------------------- 1 | import { initBGFunctions } from 'chrome-extension-message-wrapper' 2 | import browser from 'webextension-polyfill' 3 | import { IConnectedAccountUser, TConnectedAccount } from '../../../../../../../../common/types' 4 | 5 | const checkIfTheAccountsHaveBeenAlreadyConnected = async ( 6 | accounts: [IConnectedAccountUser, IConnectedAccountUser] 7 | ) => { 8 | const { getConnectedAccounts } = await initBGFunctions(browser) 9 | const accountFirstCA: TConnectedAccount[][] = await getConnectedAccounts( 10 | accounts[0].name, 11 | accounts[0].origin, 12 | 1 13 | ) 14 | const caGlobalNames = accountFirstCA[0].map((acc) => acc.id) 15 | const secondAccountGlobalId = accounts[1].name + '/' + accounts[1].origin 16 | return caGlobalNames.includes(secondAccountGlobalId) 17 | } 18 | 19 | export default checkIfTheAccountsHaveBeenAlreadyConnected 20 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/components/SystemPopup/pages/ConnectedAccountsModal/helpers/getSocialOriginTitle.ts: -------------------------------------------------------------------------------- 1 | import { resources } from '../../../../../../../../common/resources' 2 | import { IConnectedAccountUser } from '../../../../../../../../common/types' 3 | 4 | const getSocialOriginTitle = ([firstAccount, secondAccount]: IConnectedAccountUser[]) => 5 | resources[firstAccount.origin].type === 'social' 6 | ? resources[firstAccount.origin].title 7 | : resources[secondAccount.origin].title 8 | 9 | export default getSocialOriginTitle 10 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/components/SystemPopup/pages/login-session/ConnectWallet/ConnectWallet.module.scss: -------------------------------------------------------------------------------- 1 | .list { 2 | display: flex; 3 | flex-wrap: wrap; 4 | justify-content: center; 5 | 6 | margin-top: 12px; 7 | margin-bottom: 0; 8 | padding-left: 0; 9 | 10 | list-style: none; 11 | } 12 | 13 | .otherServices { 14 | margin-top: 20px; 15 | } 16 | 17 | .item { 18 | cursor: pointer; 19 | 20 | display: flex; 21 | align-items: center; 22 | justify-content: center; 23 | 24 | width: 77px; 25 | height: 77px; 26 | margin-right: 5px; 27 | margin-bottom: 5px; 28 | 29 | border-radius: 5px; 30 | 31 | img { 32 | width: 100%; 33 | border-radius: 5px; 34 | } 35 | } 36 | 37 | .item:hover { 38 | background: #00000010; 39 | filter: brightness(0.9); 40 | } 41 | 42 | .FAQ { 43 | margin-top: 80px; 44 | } 45 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/components/TabLoader/TabLoader.module.scss: -------------------------------------------------------------------------------- 1 | @import './adaptive'; 2 | 3 | .loadingListDapplets { 4 | z-index: 3; 5 | 6 | display: flex; 7 | 8 | width: 100%; 9 | height: calc(100vh - 140px); 10 | margin: 0 auto; 11 | 12 | background: #fff; 13 | background-image: url("../../assets/svg/loaderSettings.svg"); 14 | background-repeat: no-repeat; 15 | background-position: center; 16 | background-size: 139px 139px; 17 | } 18 | 19 | .isGrayPageColor{ 20 | background: #f4f4f4; 21 | } 22 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/components/TabLoader/adaptive.scss: -------------------------------------------------------------------------------- 1 | @media (min-width: 320px) and (max-width: 640px) { 2 | .loadingListDapplets { 3 | width: 80%; 4 | height: 80%; 5 | background-size: 100px 100px; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/components/TabLoader/index.tsx: -------------------------------------------------------------------------------- 1 | import cn from 'classnames' 2 | import React, { FC } from 'react' 3 | import styles from './TabLoader.module.scss' 4 | export interface TabLoaderProps { 5 | isGrayPageColor?: boolean 6 | } 7 | export const TabLoader: FC = (props) => { 8 | const { isGrayPageColor } = props 9 | return ( 10 |
15 | ) 16 | } 17 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/constants/index.ts: -------------------------------------------------------------------------------- 1 | const IPFS_GATEWAY = 'https://ipfs-gateway.mooo.com' 2 | 3 | const DEFAULT_NETWORK = 'sepolia' 4 | 5 | const DEFAULT_CHAIN_ID = 11155111 6 | 7 | const DEFAULT_ECOSYSTEM = 'zoo' 8 | 9 | const DEFAULT_APP_TYPE = 1 10 | 11 | // text 12 | const ERROR_MESSAGES = { 13 | IPFS_UPLOAD_FAIL: 'Cannot upload file to IPFS.', 14 | MINING_ERROR: 'Transaction mining failed. Please, try again.', 15 | PROVIDER_ADDITION_INCORRECT_ADDRESS: 'You are trying to enter the wrong address', 16 | PROVIDER_ADDITION_INCORRECT_ADDRESS_WRONG_NETWORK: 17 | 'This provider does not match the current network', 18 | TOKEN_ICON_INPUT_OVER_SIZE: 'Image dimensions are larger than 128px*128px', 19 | TOKEN_ICON_INPUT_UNSUPPORTED_EXTENSION: 'Only PNG or SVG supported', 20 | } 21 | 22 | export { 23 | DEFAULT_ECOSYSTEM, 24 | DEFAULT_APP_TYPE, 25 | IPFS_GATEWAY, 26 | DEFAULT_NETWORK, 27 | DEFAULT_CHAIN_ID, 28 | ERROR_MESSAGES, 29 | } 30 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/contexts/ModalContext/ModalContext.tsx: -------------------------------------------------------------------------------- 1 | import { createContext } from 'react' 2 | import { TAlertAndConfirmPayload } from '../../../../../common/types' 3 | 4 | export interface ModalProps extends TAlertAndConfirmPayload { 5 | id: string 6 | onResolve: (value: boolean) => void 7 | } 8 | 9 | export type ModalContextState = { 10 | modals: ModalProps[] 11 | } 12 | 13 | export const contextDefaultValues: ModalContextState = { 14 | modals: [], 15 | } 16 | 17 | export const ModalContext = createContext(contextDefaultValues) 18 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/contexts/ModalContext/index.ts: -------------------------------------------------------------------------------- 1 | export { ModalContext } from './ModalContext' 2 | export { ModalProvider } from './ModalProvider' 3 | export { useModal } from './useModal' 4 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/contexts/ModalContext/useModal.ts: -------------------------------------------------------------------------------- 1 | import { useContext } from 'react' 2 | 3 | import { ModalContext } from './ModalContext' 4 | 5 | export function useModal() { 6 | return useContext(ModalContext) 7 | } 8 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/helpers/addZero.ts: -------------------------------------------------------------------------------- 1 | export const addZero = (num) => { 2 | if (num >= 0 && num <= 9) { 3 | return '0' + num 4 | } else { 5 | return num 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/helpers/smartTitleSlice.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns a string, shortened to 50 or n letters by reducing the title/name, not the address! 3 | * 4 | * Examples: 5 | * 6 | * "Chalice Gianna (98793cd91a3f8706cfc4ed)" 7 | * "Chalice Gianna (98793cd91a3f870fb126f6cfc4jhamsed)" 8 | * "Chalice Gi… (98793cd91a3f870fb126sklf6cfc4jhamsed)" 9 | * "Cha… (98793cd91a3f870fb126f66285808c7e094afcfc4ed)" 10 | * "98793cd91a3f870fb126f66285808c7e094afcfc4ed876" 11 | * "98793cd91a3f870fb126f66285808c7e094afcfc4e72bkdfw6kjd68qd876" 12 | */ 13 | const smartTitleSlice = (title: string, address: string, n = 50): string => { 14 | if (address.length >= n - 5) { 15 | return address 16 | } else if ((title + ' (' + address + ')').length > n) { 17 | const l = (title + ' (' + address + ')').length - n 18 | return title.slice(0, -(l + 1)) + '… (' + address + ')' 19 | } else { 20 | return title + ' (' + address + ')' 21 | } 22 | } 23 | 24 | export default smartTitleSlice 25 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/helpers/truncateEthAddress.ts: -------------------------------------------------------------------------------- 1 | export const truncateEthAddress = (hash: string, length?: number): string => { 2 | if (length && hash.length > length) { 3 | const firstCharacters = hash.substring(0, Math.round((length - 3) / 2)) 4 | 5 | const lastCharacters = hash.substring( 6 | hash.length - 0, 7 | hash.length - Math.round((length - 3) / 2) 8 | ) 9 | 10 | return `${firstCharacters}...${lastCharacters}` 11 | } else if (hash.length > 14 && !length) { 12 | const firstCharacters = hash.substring(0, 6) 13 | const lastCharacters = hash.substring(hash.length - 0, hash.length - 4) 14 | return `${firstCharacters}...${lastCharacters}` 15 | } else { 16 | return hash 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/hooks/useAbortController.ts: -------------------------------------------------------------------------------- 1 | import { useEffect, useMemo } from 'react' 2 | 3 | const useAbortController = () => { 4 | const abortController = useMemo(() => new AbortController(), []) 5 | useEffect(() => () => abortController.abort(), [abortController]) 6 | 7 | return abortController 8 | } 9 | 10 | export default useAbortController 11 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/hooks/useCopyed.tsx: -------------------------------------------------------------------------------- 1 | import copyToClipboard from 'copy-to-clipboard' 2 | import { useCallback, useEffect, useRef, useState } from 'react' 3 | 4 | export default function useCopied(str: string): [boolean, () => void, (value: boolean) => void] { 5 | const copyableString = useRef(str) 6 | const [copied, setCopied] = useState(false) 7 | 8 | const copyAction = useCallback(() => { 9 | const copiedString = copyToClipboard(copyableString.current) 10 | setCopied(copiedString) 11 | }, [copyableString]) 12 | 13 | useEffect(() => { 14 | copyableString.current = str 15 | }, [str]) 16 | 17 | return [copied, copyAction, setCopied] 18 | } 19 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/hooks/useSelected.ts: -------------------------------------------------------------------------------- 1 | import { useState } from 'react' 2 | 3 | export const useSelected = (initialValue: T): [isToggle: T, onSelected: (value: T) => void] => { 4 | const [selected, setSelected] = useState(initialValue) 5 | 6 | const onSelected = (value: T): void => setSelected(value) 7 | 8 | return [selected, onSelected] 9 | } 10 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/hooks/useToggle.ts: -------------------------------------------------------------------------------- 1 | import { useState } from 'react' 2 | 3 | export const useToggle = (initialValue = false): [isToggle: boolean, toggle: () => void] => { 4 | const [isToggle, setToggle] = useState(initialValue) 5 | 6 | const toggle = (): void => setToggle(!isToggle) 7 | 8 | return [isToggle, toggle] 9 | } 10 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/models/dropdown.model.ts: -------------------------------------------------------------------------------- 1 | // ToDo: remove it 2 | export interface IDropdown { 3 | _id: string 4 | label: string 5 | value: string 6 | } 7 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/pages/ConnectedAccount/assets/attention.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/pages/ConnectedAccount/assets/info.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/pages/ConnectedAccount/assets/newHome.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/pages/ConnectedAccount/assets/ok.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/pages/ConnectedAccount/assets/time.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/pages/ConnectedAccount/assets/trash.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/pages/Dapplets/adaptive.scss: -------------------------------------------------------------------------------- 1 | @media (min-width: 320px) and (max-width: 640px) { 2 | .wrapper { 3 | margin-top: 0; 4 | margin-bottom: 22px; 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/pages/DappletsInfo/adaptive.scss: -------------------------------------------------------------------------------- 1 | @media (min-width: 320px) and (max-width: 640px) { 2 | .wrapper { 3 | height: 85%; 4 | } 5 | 6 | .linkNavigation { 7 | height: 40px; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/pages/Notifications/adaptive.scss: -------------------------------------------------------------------------------- 1 | @media (max-width: 640px) and (min-width: 320px) { 2 | .wrapper { 3 | padding: 0; 4 | } 5 | 6 | .block { 7 | height: calc(100% - 145px); 8 | } 9 | 10 | .notificationClose { 11 | padding: 10px 0 0; 12 | } 13 | 14 | .notification { 15 | flex: 1 1 auto; 16 | } 17 | 18 | .noNot { 19 | height: 73vh; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/pages/Rewards/rewards.scss: -------------------------------------------------------------------------------- 1 | .valid { 2 | display: flex; 3 | } 4 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/pages/Settings/Developer/adaptive.scss: -------------------------------------------------------------------------------- 1 | @media (min-width: 320px) and (max-width: 640px) { 2 | .wrapper { 3 | height: 100%; 4 | max-height: none; 5 | } 6 | 7 | .host { 8 | height: 100%; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/pages/Settings/Main/Main.module.scss: -------------------------------------------------------------------------------- 1 | @import "../../../assets/styles/color.variables"; 2 | @import "../../../assets/styles/null"; 3 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/pages/Settings/Settings/adaptive.scss: -------------------------------------------------------------------------------- 1 | @media (max-width: 640px) and (min-width: 320px) { 2 | .wrapper { 3 | padding: 0; 4 | } 5 | 6 | .title { 7 | justify-content: center; 8 | padding: 15px 26px 25.5px; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/pages/Tokenomics/Button/index.ts: -------------------------------------------------------------------------------- 1 | import { Button } from './Button' 2 | 3 | export default Button 4 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/pages/Tokenomics/Field/Field.module.scss: -------------------------------------------------------------------------------- 1 | @import '../../../assets/styles/null'; 2 | @import '../../../assets/styles/color.variables'; 3 | 4 | .root { 5 | display: flex; 6 | flex-direction: column; 7 | } 8 | 9 | .label { 10 | margin-top: 10px; 11 | margin-left: 10px; 12 | 13 | 14 | font-size: 14px; 15 | line-height: 16px; 16 | color: $pure-black; 17 | } 18 | 19 | .field { 20 | height: 31px; 21 | margin: 10px; 22 | padding: 5px 13px; 23 | 24 | 25 | font-size: 14px; 26 | font-weight: 400; 27 | line-height: 149%; 28 | color: #919191; 29 | 30 | background: #f5f5f5; 31 | border: 1px solid $stroke-color; 32 | border-radius: 5px; 33 | outline: none; 34 | } 35 | 36 | .error { 37 | border: 1px solid $error; 38 | } 39 | 40 | .disabled { 41 | background-color: $median-price-bg; 42 | } 43 | 44 | .divName { 45 | display: flex; 46 | flex-direction: column; 47 | } 48 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/pages/Tokenomics/IconField/Preview.tsx: -------------------------------------------------------------------------------- 1 | import React, { useEffect, useState } from 'react' 2 | 3 | type PreviewProps = { 4 | file: File | null 5 | } 6 | 7 | const Preview = ({ file }: PreviewProps) => { 8 | const [source, setSource] = useState(null) 9 | 10 | useEffect(() => { 11 | if (file) { 12 | const reader = new FileReader() 13 | 14 | reader.onloadend = () => { 15 | if (typeof reader.result === 'string') setSource(reader.result) 16 | } 17 | 18 | reader.readAsDataURL(file) 19 | } 20 | }, [file]) 21 | 22 | if (!file) return null 23 | 24 | if (!source) return null 25 | 26 | return {file.name} 27 | } 28 | 29 | export default Preview 30 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/pages/Tokenomics/RadioButton/radioButtons.tsx: -------------------------------------------------------------------------------- 1 | import cn from 'classnames' 2 | import React, { DetailedHTMLProps, FC, HTMLAttributes } from 'react' 3 | import styles from './radioButtons.module.scss' 4 | 5 | export interface RadioButtonsProps 6 | extends DetailedHTMLProps, HTMLInputElement> { 7 | name?: string 8 | id?: string 9 | value?: string 10 | checked?: any 11 | } 12 | 13 | export const RadioButtons: FC = (props: RadioButtonsProps) => { 14 | const { name, id, value, ...anotherProps } = props 15 | return ( 16 |
17 | 18 | 21 |
22 | ) 23 | } 24 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/pages/UnderConstructionInfo/valid.scss: -------------------------------------------------------------------------------- 1 | .valid { 2 | display: none !important; 3 | } 4 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/pages/UserSettings/utils.ts: -------------------------------------------------------------------------------- 1 | export function getSemanticProps({ 2 | formContext = {}, 3 | uiSchema = {}, 4 | options = {}, 5 | defaultSchemaProps = { fluid: 'true', inverted: 'false' }, 6 | defaultContextProps = {}, 7 | }: any) { 8 | const formContextProps = formContext.semantic 9 | const schemaProps = uiSchema['ui:widget'] && uiSchema['ui:widget'].semantic 10 | const optionProps = options.semantic 11 | 12 | // formContext props should overide other props 13 | return Object.assign( 14 | {}, 15 | { ...(defaultSchemaProps && defaultSchemaProps) }, 16 | { ...(defaultContextProps && defaultContextProps) }, 17 | schemaProps, 18 | optionProps, 19 | formContextProps 20 | ) 21 | } 22 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/types/index.ts: -------------------------------------------------------------------------------- 1 | import { StorageRef } from '../../../../common/types' 2 | import { ModuleIconProps } from '../components/ModuleIcon' 3 | 4 | export type ToolbarTabMenu = { 5 | id: string 6 | title: string 7 | icon: string | StorageRef | React.FC> | ModuleIconProps 8 | props?: any 9 | hidden?: boolean 10 | } 11 | 12 | export type ToolbarTab = { 13 | id: string 14 | pinned: boolean 15 | title: string 16 | icon: string | StorageRef | React.FC> | ModuleIconProps 17 | menus: ToolbarTabMenu[] 18 | } 19 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/utils/formatIconRefUrl.ts: -------------------------------------------------------------------------------- 1 | const IPFS_GATEWAY = 'https://ipfs-gateway.mooo.com' 2 | const formatIconRefUrl = (rawUrl: string) => { 3 | const addr = rawUrl.split('//').pop() 4 | const newAddr = addr?.includes('ipfs-gateway.mooo.com') 5 | ? addr.replace('ipfs-gateway.mooo.com/ipfs/', '') 6 | : addr 7 | 8 | return `${IPFS_GATEWAY}/ipfs/${newAddr}` 9 | } 10 | 11 | export default formatIconRefUrl 12 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/utils/getDefaultValue.tsx: -------------------------------------------------------------------------------- 1 | import { initBGFunctions } from 'chrome-extension-message-wrapper' 2 | import browser from 'webextension-polyfill' 3 | 4 | export const getDefaultValueProvider = async ( 5 | inputValue: string, 6 | providerUrl: string, 7 | setProvider: any 8 | ) => { 9 | const { getInitialConfig } = await initBGFunctions(browser) 10 | const config = await getInitialConfig() 11 | 12 | if (config[providerUrl] !== inputValue) { 13 | await setProvider(config[providerUrl]) 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/utils/openLink.ts: -------------------------------------------------------------------------------- 1 | export const openLink = (address: string) => { 2 | window.open(address) 3 | } 4 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/widgets/label/WidgetLabel.module.scss: -------------------------------------------------------------------------------- 1 | @import '../../assets/styles/color.variables'; 2 | 3 | .widgetLabel { 4 | display: flex; 5 | 6 | width: 30px; 7 | height: 30px; 8 | margin: 0 auto; 9 | margin: 5px 0; 10 | 11 | background: #f5f5f5; 12 | border-radius: 6px; 13 | } 14 | 15 | .widgetLabelImg { 16 | display: block; 17 | width: 18px; 18 | height: 18px; 19 | margin: auto; 20 | } 21 | 22 | .widgetHidden{ 23 | display: none; 24 | } 25 | -------------------------------------------------------------------------------- /src/contentscript/overlay/root/widgets/label/index.tsx: -------------------------------------------------------------------------------- 1 | import cn from 'classnames' 2 | import React, { FC } from 'react' 3 | import { DappletActionProps } from '../../hooks/useDappletActions' 4 | import styles from './WidgetLabel.module.scss' 5 | 6 | export interface LabelProps { 7 | action: DappletActionProps 8 | } 9 | 10 | export const LabelButton: FC = (props: LabelProps) => { 11 | const { title = null, icon = null, hidden = false } = props.action 12 | 13 | return ( 14 | 20 | {icon && icon.length > 0 ? : null} 21 | 22 | ) 23 | } 24 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | import { IContentAdapter, IFeature, IResolver, ISharedState } from './contentscript/types' 2 | import { Core, IEthWallet, INearWallet } from './worker/core' 3 | import { IConnection, Listener } from './worker/core/connection' 4 | import { IEtherneumWallet } from './worker/core/ethereum/types' 5 | 6 | declare global { 7 | export function Injectable(constructor: Function) 8 | export function Inject(name: string): Function 9 | export function OnEvent(type: string): Function 10 | export var Core: Core 11 | } 12 | 13 | export { 14 | IContentAdapter, 15 | IFeature, 16 | IResolver, 17 | IConnection, 18 | Listener, 19 | ISharedState, 20 | IEthWallet, 21 | INearWallet, 22 | IEtherneumWallet, 23 | } 24 | -------------------------------------------------------------------------------- /src/inpage/index.ts: -------------------------------------------------------------------------------- 1 | import * as EventBus from '../common/global-event-bus' 2 | import { JsonRpc } from '../common/jsonrpc' 3 | import { DappletsProvider } from './dappletsProvider' 4 | 5 | const jsonrpc = new JsonRpc(window) 6 | const dappletsProvider = new DappletsProvider(jsonrpc) 7 | 8 | ;(window as Record).dapplets = dappletsProvider 9 | window.dispatchEvent(new Event('dapplets#initialized')) 10 | 11 | EventBus.on('disconnect', () => { 12 | ;(window as Record).dapplets = undefined 13 | EventBus.destroy() 14 | jsonrpc.destroy() 15 | }) 16 | -------------------------------------------------------------------------------- /src/offscreen/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/popup/index.css: -------------------------------------------------------------------------------- 1 | 2 | body { 3 | display: flex; 4 | flex-direction: column; 5 | 6 | width: 305px; 7 | height: 80px; 8 | padding: 6px; 9 | } 10 | 11 | header { 12 | display: flex; 13 | align-items: center; 14 | 15 | margin-bottom: 6px; 16 | 17 | 18 | font-size: 14px; 19 | font-weight: 400; 20 | line-height: 149%; 21 | color: #5AB5E8; 22 | } 23 | 24 | svg { 25 | margin-right: 5px; 26 | } 27 | 28 | div{ 29 | font-size: 12px; 30 | font-weight: 400; 31 | font-style: normal; 32 | line-height: 149%; 33 | color: #747376; 34 | } 35 | 36 | a{ 37 | font-size: 12px; 38 | font-weight: 400; 39 | font-style: normal; 40 | line-height: 149%; 41 | color: #588ca3; 42 | text-decoration-line: underline; 43 | } -------------------------------------------------------------------------------- /src/popup/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/popup/index.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react' 2 | import * as ReactDOM from 'react-dom' 3 | 4 | import { App } from './App' 5 | import './index.css' 6 | 7 | const container = document.getElementById('app') 8 | 9 | ReactDOM.render(, container) 10 | -------------------------------------------------------------------------------- /src/sandbox/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Sandbox IFrame 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/worker/core/ethereum/types.ts: -------------------------------------------------------------------------------- 1 | export interface ITransactionReceipt { 2 | transactionHash: string 3 | transactionIndex: string 4 | blockNumber: string 5 | blockHash: string 6 | cumulativeGasUsed: string 7 | gasUsed: string 8 | contractAddress: string | null 9 | logs: any[] 10 | logsBloom: string 11 | status: string 12 | } 13 | 14 | export interface IEtherneumWallet { 15 | request: ({ method, params }: { method: string; params: any[] }) => Promise 16 | waitTransaction: (txHash: string, confirmations?: number) => Promise 17 | } 18 | -------------------------------------------------------------------------------- /src/worker/core/events/baseEvent.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @description 3 | * The base type for all module-level events used by the EventBus system. 4 | * */ 5 | export type BaseEvent = { 6 | namespace: string 7 | type: string 8 | } 9 | -------------------------------------------------------------------------------- /src/worker/core/events/eventBus.ts: -------------------------------------------------------------------------------- 1 | import { Observable, Subject } from 'rxjs' 2 | import { filter, takeUntil } from 'rxjs/operators' 3 | import { BaseEvent } from './baseEvent' 4 | 5 | export class EventBus { 6 | private destroy$ = new Subject() 7 | 8 | constructor(private _eventStream: Observable) {} 9 | 10 | ofType(type: string): Observable { 11 | return this._eventStream.pipe( 12 | takeUntil(this.destroy$), 13 | filter((e) => e.type === type) 14 | ) as Observable 15 | } 16 | 17 | destroy() { 18 | this.destroy$.next() 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/worker/core/login/types.ts: -------------------------------------------------------------------------------- 1 | export type LoginRequestSettings = {} 2 | 3 | export type LoginHooks = { 4 | onLogin?: (ls: any) => void 5 | onLogout?: (ls: any) => void 6 | // onReject?: (ls: any) => void // ToDo: implement 7 | // onSwitch?: (ls: any) => void // ToDo: implement 8 | } 9 | -------------------------------------------------------------------------------- /src/worker/core/near/backgroundJsonRpcProvider.ts: -------------------------------------------------------------------------------- 1 | import { providers } from 'near-api-js' 2 | import { initBGFunctions } from '../../communication' 3 | 4 | export class BackgroundJsonRpcProvider extends providers.JsonRpcProvider { 5 | constructor(private _app: string, private _network: string) { 6 | super({ url: '' }) // ToDo: unfake values 7 | } 8 | 9 | async sendJsonRpc(method: string, params: object): Promise { 10 | const { near_sendCustomRequest } = initBGFunctions() 11 | return near_sendCustomRequest(this._app, this._network, method, params) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/worker/core/near/backgroundNear.ts: -------------------------------------------------------------------------------- 1 | import { Connection, InMemorySigner, Near } from 'near-api-js' 2 | import { BackgroundJsonRpcProvider } from './backgroundJsonRpcProvider' 3 | import { BackgroundKeyStore } from './backgroundKeyStore' 4 | 5 | export class BackgroundNear extends Near { 6 | constructor( 7 | app: string, 8 | cfg: { networkId: string; nodeUrl: string; walletUrl: string; helperUrl?: string }, 9 | keyStorePrefix?: string 10 | ) { 11 | const keyStore = new BackgroundKeyStore(keyStorePrefix) 12 | const signer = new InMemorySigner(keyStore) 13 | super({ ...cfg, deps: { keyStore }, signer }) 14 | const provider = new BackgroundJsonRpcProvider(app, cfg.networkId) 15 | const connection = new Connection(cfg.networkId, provider, signer, `jsvm.${cfg.networkId}`) 16 | Object.defineProperty(this, 'connection', { 17 | value: connection, 18 | }) 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/worker/overlay/overlayManager.ts: -------------------------------------------------------------------------------- 1 | import { JsonRpc } from '../../common/jsonrpc' 2 | import { IOverlayManager, OverlayConfig } from './interfaces' 3 | import { OverlayIframe } from './overlay' 4 | 5 | export class OverlayManagerIframe implements IOverlayManager { 6 | constructor(private _iframeMessenger: JsonRpc) {} 7 | 8 | createOverlay(config: OverlayConfig): OverlayIframe { 9 | const overlay = new OverlayIframe(this._iframeMessenger, config) 10 | return overlay 11 | } 12 | togglePanel(): void {} 13 | openPopup(): void {} 14 | unregisterAll(source: string): void { 15 | this._iframeMessenger.call('OVERLAY_MANAGER_UNREGISTER_ALL', [source], self) 16 | } 17 | close(): void {} 18 | open(): void {} 19 | getOverlays(): OverlayIframe[] { 20 | return [] 21 | } 22 | toggle(): void {} 23 | destroy(): void {} 24 | } 25 | -------------------------------------------------------------------------------- /tests/e2e/pages/connect-wallet-popup.ts: -------------------------------------------------------------------------------- 1 | import { Locator, Page } from '@playwright/test' 2 | 3 | export enum WalletTypes { 4 | BuiltIn = 'dapplets_sepolia', 5 | NearMainnet = 'near_mainnet', 6 | NearTestnet = 'near_testnet', 7 | } 8 | 9 | export class ConnectWalletPopup { 10 | public readonly root: Locator 11 | 12 | constructor(public readonly page: Page) { 13 | this.root = this.page.getByTestId('connect-wallet-to-extension-popup') 14 | } 15 | 16 | async connectWallet(walletType: WalletTypes) { 17 | await this.root.getByTestId(`wallet-to-connect-${walletType}`).click() 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /tests/e2e/pages/developer.ts: -------------------------------------------------------------------------------- 1 | import type { Locator, Page } from '@playwright/test' 2 | 3 | export class Developer { 4 | private readonly overlay: Locator 5 | 6 | constructor(public readonly page: Page) { 7 | this.overlay = this.page.locator('#dapplets-overlay-manager') 8 | } 9 | 10 | async enableServer(url: string) { 11 | await this.overlay 12 | .getByTestId('dev-server') 13 | .filter({ hasText: url }) 14 | .locator('button', { hasText: 'Disabled' }) 15 | .click() 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /tests/e2e/pages/login-modal.ts: -------------------------------------------------------------------------------- 1 | import { Locator, Page } from '@playwright/test' 2 | 3 | export class LoginModal { 4 | public readonly root: Locator 5 | 6 | constructor(public readonly page: Page) { 7 | this.root = this.page.getByTestId('profile-modal-login') 8 | } 9 | 10 | async clickAddWallet() { 11 | await this.root.getByTestId('add-wallet-btn-profile-widget').click() 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /tests/e2e/pages/notifications.ts: -------------------------------------------------------------------------------- 1 | import type { Locator, Page } from '@playwright/test' 2 | 3 | export class Notifications { 4 | private readonly overlay: Locator 5 | public readonly root: Locator 6 | 7 | constructor(public readonly page: Page) { 8 | this.overlay = this.page.locator('#dapplets-overlay-manager') 9 | this.root = this.overlay.getByTestId('notification') 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /tests/e2e/pages/settings.ts: -------------------------------------------------------------------------------- 1 | import type { Locator, Page } from '@playwright/test' 2 | 3 | export class Settings { 4 | private readonly overlay: Locator 5 | private readonly developerTab: Locator 6 | 7 | constructor(public readonly page: Page) { 8 | this.overlay = this.page.locator('#dapplets-overlay-manager') 9 | this.developerTab = this.overlay.getByTestId('settings-page-developer') 10 | } 11 | 12 | async clickDeveloperTab() { 13 | await this.developerTab.click() 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /tests/e2e/scenarios/no-available-dapplets.spec.ts: -------------------------------------------------------------------------------- 1 | import { expect, test } from '../fixtures/browser' 2 | import { Overlay } from '../pages/overlay' 3 | 4 | test('should show empty dapplets list', async ({ page }) => { 5 | const overlay = new Overlay(page) 6 | 7 | await page.goto('https://example.com/') 8 | await overlay.goto() 9 | await overlay.clickToggle() 10 | await expect(overlay.root).toContainText('No available dapplets for current site') 11 | }) 12 | -------------------------------------------------------------------------------- /tests/e2e/scenarios/wallets/connect-built-in-wallet.spec.ts: -------------------------------------------------------------------------------- 1 | import { expect, test } from '../../fixtures/dapplet-runner' 2 | import { ConnectWalletPopup, WalletTypes } from '../../pages/connect-wallet-popup' 3 | import { LoginModal } from '../../pages/login-modal' 4 | import { Overlay } from '../../pages/overlay' 5 | 6 | // ToDo: qase 14 7 | 8 | test('should connect built-in Ethereum wallet', async ({ page, enableDevMode }) => { 9 | const overlay = new Overlay(page) 10 | const loginModal = new LoginModal(page) 11 | const connectWalletPopup = new ConnectWalletPopup(page) 12 | 13 | await page.goto('/') 14 | 15 | // Built-in wallet is available in dev mode only 16 | await enableDevMode() 17 | 18 | await overlay.goto() 19 | await overlay.skipTutorial() 20 | await overlay.clickToggle() 21 | await overlay.clickProfile() 22 | await loginModal.clickAddWallet() 23 | await connectWalletPopup.connectWallet(WalletTypes.BuiltIn) 24 | 25 | await expect(overlay.profile).toContainText('0x87e1...beC1') 26 | }) 27 | -------------------------------------------------------------------------------- /tests/modules/adapters/test-common-adapter/dapplet.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "test-common-adapter", 3 | "branch": "default", 4 | "version": "0.1.0", 5 | "type": "CONFIG", 6 | "title": "Test Common Adapter", 7 | "description": "Parser config for Web", 8 | "main": "index.json", 9 | "contextIds": [ 10 | "twitter.com", 11 | "instagram.com", 12 | "google.com", 13 | "youtube.com", 14 | "facebook.com", 15 | "example.com", 16 | "dapplets-e2e.netlify.app" 17 | ], 18 | "dependencies": {} 19 | } 20 | -------------------------------------------------------------------------------- /tests/modules/adapters/test-common-adapter/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "themes": { 3 | "LIGHT": "boolean(//body[@style='background-color: #FFFFFF;'] | //body[@style='background-color: rgb(255, 255, 255);'])", 4 | "DARK": "boolean(//body[@style='background-color: rgb(21, 32, 43);'] | //body[@style='background-color: rgb(0, 0, 0);'])" 5 | }, 6 | "contexts": { 7 | "GLOBAL": { 8 | "containerSelector": "html", 9 | "contextBuilder": { 10 | "id": "string('global')", 11 | "websiteName": "string(//title)" 12 | } 13 | }, 14 | "BODY": { 15 | "containerSelector": "html", 16 | "contextSelector": "", 17 | "widgets": { 18 | "button": { 19 | "styles": "styles/body/button.css", 20 | "insertionPoint": "body", 21 | "insert": "end" 22 | } 23 | }, 24 | "contextBuilder": { 25 | "id": "string(//title)" 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /tests/modules/adapters/test-common-adapter/styles/body/button.css: -------------------------------------------------------------------------------- 1 | :host { 2 | position:fixed; 3 | width:60px; 4 | height:60px; 5 | bottom:40px; 6 | left:40px; 7 | color:#FFF; 8 | border-radius:99em; 9 | text-align:center; 10 | box-shadow: 2px 2px 3px #999; 11 | cursor: pointer; 12 | display: block; 13 | box-sizing: content-box; 14 | background: no-repeat center/100% url(${img}) #d4e0e9; 15 | z-index:9999; 16 | } -------------------------------------------------------------------------------- /tests/modules/adapters/test-e2e-adapter/dapplet.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "test-e2e-adapter", 3 | "branch": "default", 4 | "version": "0.1.0", 5 | "type": "CONFIG", 6 | "title": "Test E2E Adapter", 7 | "description": "Parser config for Dapplets e2e Test Website", 8 | "main": "index.json", 9 | "contextIds": ["dapplets-e2e.netlify.app"], 10 | "dependencies": {}, 11 | "interfaces": { 12 | "test-virtual-adapter": "0.1.0" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /tests/modules/adapters/test-github-adapter/dapplet.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "test-github-adapter", 3 | "branch": "default", 4 | "version": "0.1.0", 5 | "type": "CONFIG", 6 | "title": "Test GitHub Adapter", 7 | "description": "Parser config for GitHub", 8 | "main": "index.json", 9 | "contextIds": [ 10 | "github.com", 11 | "http://github.com" 12 | ], 13 | "dependencies": {}, 14 | "interfaces": { 15 | "test-virtual-adapter": "0.1.0" 16 | } 17 | } -------------------------------------------------------------------------------- /tests/modules/adapters/test-github-adapter/styles/post/avatarBadge.css: -------------------------------------------------------------------------------- 1 | :host { 2 | z-index: 50100; 3 | } 4 | 5 | .avatar-badge { 6 | display: block; 7 | } 8 | 9 | .wrapper { 10 | position: absolute; 11 | overflow: hidden; 12 | display: flex; 13 | align-items: center; 14 | } 15 | 16 | .active { 17 | cursor: pointer; 18 | } 19 | 20 | .badge { 21 | width: 24px; 22 | height: 24px; 23 | } 24 | 25 | .not-basic { 26 | background-color: white; 27 | border-radius: 99em; 28 | } 29 | 30 | .not-basic.badge { 31 | border: 1px solid white; 32 | } 33 | 34 | .not-basic.dark { 35 | background-color: black; 36 | } 37 | 38 | .not-basic.dark.badge { 39 | border: 1px solid black; 40 | } 41 | 42 | .top-left { 43 | top: -2px; 44 | left: -7px; 45 | } 46 | 47 | .top-right { 48 | top: -2px; 49 | right: -7px; 50 | } 51 | 52 | .bottom-left { 53 | bottom: -2px; 54 | left: -7px; 55 | } 56 | 57 | .bottom-right { 58 | bottom: -2px; 59 | right: -7px; 60 | } 61 | -------------------------------------------------------------------------------- /tests/modules/adapters/test-github-adapter/styles/profile/avatarBadge.css: -------------------------------------------------------------------------------- 1 | :host { 2 | z-index: 50100; 3 | } 4 | 5 | .avatar-badge { 6 | display: block; 7 | } 8 | 9 | .wrapper { 10 | position: absolute; 11 | overflow: hidden; 12 | display: flex; 13 | align-items: center; 14 | } 15 | 16 | .active { 17 | cursor: pointer; 18 | } 19 | 20 | .not-basic { 21 | background-color: white; 22 | border-radius: 99em; 23 | } 24 | 25 | .not-basic.badge { 26 | border: 1px solid white; 27 | } 28 | 29 | .not-basic.dark { 30 | background-color: black; 31 | } 32 | 33 | .not-basic.dark.badge { 34 | border: 1px solid black; 35 | } 36 | 37 | .badge { 38 | width: 40px; 39 | height: 40px; 40 | transform: translateY(-5px); 41 | } 42 | 43 | .top-left { 44 | top: -2px; 45 | left: -7px; 46 | } 47 | 48 | .top-right { 49 | top: -2px; 50 | right: -7px; 51 | } 52 | 53 | .bottom-left { 54 | bottom: -2px; 55 | left: -7px; 56 | } 57 | 58 | .bottom-right { 59 | bottom: -2px; 60 | right: -7px; 61 | } 62 | -------------------------------------------------------------------------------- /tests/modules/adapters/test-twitter-adapter/dapplet.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "test-twitter-adapter", 3 | "branch": "default", 4 | "version": "0.1.0", 5 | "type": "CONFIG", 6 | "title": "Test Twitter Adapter", 7 | "description": "Parser config for Twitter", 8 | "main": "index.json", 9 | "contextIds": [ 10 | "twitter.com", 11 | "http://twitter.com" 12 | ], 13 | "dependencies": {}, 14 | "interfaces": { 15 | "test-virtual-adapter": "0.1.0" 16 | } 17 | } -------------------------------------------------------------------------------- /tests/modules/adapters/test-twitter-adapter/styles/post/avatarBadge.css: -------------------------------------------------------------------------------- 1 | :host { 2 | z-index: 50100; 3 | } 4 | 5 | .avatar-badge { 6 | display: block; 7 | } 8 | 9 | .wrapper { 10 | position: absolute; 11 | overflow: hidden; 12 | display: flex; 13 | align-items: center; 14 | } 15 | 16 | .active { 17 | cursor: pointer; 18 | } 19 | 20 | .badge { 21 | width: 24px; 22 | height: 24px; 23 | } 24 | 25 | .not-basic { 26 | background-color: white; 27 | border-radius: 99em; 28 | } 29 | 30 | .not-basic.badge { 31 | border: 1px solid white; 32 | } 33 | 34 | .not-basic.dark { 35 | background-color: black; 36 | } 37 | 38 | .not-basic.dark.badge { 39 | border: 1px solid black; 40 | } 41 | 42 | .top-left { 43 | top: -2px; 44 | left: -7px; 45 | } 46 | 47 | .top-right { 48 | top: -2px; 49 | right: -7px; 50 | } 51 | 52 | .bottom-left { 53 | bottom: -2px; 54 | left: -7px; 55 | } 56 | 57 | .bottom-right { 58 | bottom: -2px; 59 | right: -7px; 60 | } 61 | -------------------------------------------------------------------------------- /tests/modules/adapters/test-twitter-adapter/styles/profile/avatarBadge.css: -------------------------------------------------------------------------------- 1 | :host { 2 | z-index: 50100; 3 | } 4 | 5 | .avatar-badge { 6 | display: block; 7 | } 8 | 9 | .wrapper { 10 | position: absolute; 11 | overflow: hidden; 12 | display: flex; 13 | align-items: center; 14 | } 15 | 16 | .active { 17 | cursor: pointer; 18 | } 19 | 20 | .not-basic { 21 | background-color: white; 22 | border-radius: 99em; 23 | } 24 | 25 | .not-basic.badge { 26 | border: 1px solid white; 27 | } 28 | 29 | .not-basic.dark { 30 | background-color: black; 31 | } 32 | 33 | .not-basic.dark.badge { 34 | border: 1px solid black; 35 | } 36 | 37 | .badge { 38 | width: 40px; 39 | height: 40px; 40 | transform: translateY(-5px); 41 | } 42 | 43 | .top-left { 44 | top: -2px; 45 | left: -7px; 46 | } 47 | 48 | .top-right { 49 | top: -2px; 50 | right: -7px; 51 | } 52 | 53 | .bottom-left { 54 | bottom: -2px; 55 | left: -7px; 56 | } 57 | 58 | .bottom-right { 59 | bottom: -2px; 60 | right: -7px; 61 | } 62 | -------------------------------------------------------------------------------- /tests/modules/adapters/test-virtual-adapter/dapplet.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "test-virtual-adapter", 3 | "branch": "default", 4 | "version": "0.1.0", 5 | "type": "INTERFACE", 6 | "title": "Test Virtual Adapter", 7 | "description": "The testing virtual adapter for Twitter and GitHub" 8 | } -------------------------------------------------------------------------------- /tests/modules/dapplets/core-alert/dapplet.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "core-alert", 3 | "version": "0.1.0", 4 | "description": "Testing of Core.alert()", 5 | "main": "build/index.js", 6 | "branch": "default", 7 | "type": "FEATURE", 8 | "title": "Test Alerts", 9 | "icon": "src/target.png", 10 | "contextIds": ["test-common-adapter"], 11 | "dependencies": { 12 | "test-common-adapter": "0.1.0" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /tests/modules/dapplets/core-alert/src/Black_Icon2.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/modules/dapplets/core-alert/src/index.ts: -------------------------------------------------------------------------------- 1 | import {} from '../../../../../lib' 2 | import MAIN_IMG from './Black_Icon2.svg' 3 | 4 | @Injectable 5 | export default class DemoDapplet { 6 | @Inject('test-common-adapter') 7 | public adapter: any 8 | 9 | // current user from twitter 10 | private _globalContext = {} 11 | 12 | async activate(): Promise { 13 | const { button } = this.adapter.exports 14 | this.adapter.attachConfig({ 15 | GLOBAL: (global) => { 16 | // Save reference to the global context 17 | Object.assign(this._globalContext, global) 18 | }, 19 | BODY: (ctx) => [ 20 | button({ 21 | DEFAULT: { 22 | label: 'alert', 23 | img: MAIN_IMG, 24 | exec: async () => { 25 | await Core.alert('Click OK to continue') 26 | await Core.notify('PASS') 27 | }, 28 | }, 29 | }), 30 | ], 31 | }) 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /tests/modules/dapplets/core-alert/src/target.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapplets/dapplet-extension/9074291617dd1830cc8573afbfa74de0090dcda0/tests/modules/dapplets/core-alert/src/target.png -------------------------------------------------------------------------------- /tests/modules/dapplets/core-confirm-cancel/dapplet.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "core-confirm-cancel", 3 | "version": "0.1.0", 4 | "description": "Testing of Core.confirm()", 5 | "main": "build/index.js", 6 | "branch": "default", 7 | "type": "FEATURE", 8 | "title": "Test Alerts", 9 | "icon": "src/target.png", 10 | "contextIds": ["test-common-adapter"], 11 | "dependencies": { 12 | "test-common-adapter": "0.1.0" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /tests/modules/dapplets/core-confirm-cancel/src/Black_Icon2.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/modules/dapplets/core-confirm-cancel/src/index.ts: -------------------------------------------------------------------------------- 1 | import {} from '../../../../../lib' 2 | import MAIN_IMG from './Black_Icon2.svg' 3 | 4 | @Injectable 5 | export default class DemoDapplet { 6 | @Inject('test-common-adapter') 7 | public adapter: any 8 | 9 | async activate(): Promise { 10 | const { button } = this.adapter.exports 11 | this.adapter.attachConfig({ 12 | BODY: (ctx) => [ 13 | button({ 14 | DEFAULT: { 15 | label: 'confirm', 16 | img: MAIN_IMG, 17 | exec: async () => { 18 | const result = await Core.confirm('Click Cancel to continue') 19 | Core.notify(!result ? 'PASS' : 'FAIL') 20 | }, 21 | }, 22 | }), 23 | ], 24 | }) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /tests/modules/dapplets/core-confirm-cancel/src/target.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapplets/dapplet-extension/9074291617dd1830cc8573afbfa74de0090dcda0/tests/modules/dapplets/core-confirm-cancel/src/target.png -------------------------------------------------------------------------------- /tests/modules/dapplets/core-confirm-ok/dapplet.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "core-confirm-ok", 3 | "version": "0.1.0", 4 | "description": "Testing of Core.confirm()", 5 | "main": "build/index.js", 6 | "branch": "default", 7 | "type": "FEATURE", 8 | "title": "Test Alerts", 9 | "icon": "src/target.png", 10 | "contextIds": ["test-common-adapter"], 11 | "dependencies": { 12 | "test-common-adapter": "0.1.0" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /tests/modules/dapplets/core-confirm-ok/src/Black_Icon2.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/modules/dapplets/core-confirm-ok/src/index.ts: -------------------------------------------------------------------------------- 1 | import {} from '../../../../../lib' 2 | import MAIN_IMG from './Black_Icon2.svg' 3 | 4 | @Injectable 5 | export default class DemoDapplet { 6 | @Inject('test-common-adapter') 7 | public adapter: any 8 | 9 | async activate(): Promise { 10 | const { button } = this.adapter.exports 11 | this.adapter.attachConfig({ 12 | BODY: (ctx) => [ 13 | button({ 14 | DEFAULT: { 15 | label: 'confirm', 16 | img: MAIN_IMG, 17 | exec: async () => { 18 | const result = await Core.confirm('Click OK to continue') 19 | Core.notify(result ? 'PASS' : 'FAIL') 20 | }, 21 | }, 22 | }), 23 | ], 24 | }) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /tests/modules/dapplets/core-confirm-ok/src/target.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapplets/dapplet-extension/9074291617dd1830cc8573afbfa74de0090dcda0/tests/modules/dapplets/core-confirm-ok/src/target.png -------------------------------------------------------------------------------- /tests/modules/dapplets/core-notify-subscribe-decorator/dapplet.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "core-notify-subscribe-decorator", 3 | "version": "0.1.0", 4 | "description": "Testing of Core.notify() + subscribe using decorator", 5 | "main": "build/index.js", 6 | "branch": "default", 7 | "type": "FEATURE", 8 | "title": "Notify and decorator", 9 | "contextIds": ["test-common-adapter"], 10 | "dependencies": { 11 | "test-common-adapter": "0.1.0" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /tests/modules/dapplets/core-notify-subscribe-manually/dapplet.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "core-notify-subscribe-manually", 3 | "version": "0.1.0", 4 | "description": "Testing of Core.notify() + Core.events.ofType().subscribe()", 5 | "main": "build/index.js", 6 | "branch": "default", 7 | "type": "FEATURE", 8 | "title": "Notify and subscription", 9 | "contextIds": ["test-common-adapter"], 10 | "dependencies": { 11 | "test-common-adapter": "0.1.0" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /tests/modules/dapplets/core-notify-without-actions/dapplet.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "core-notify-without-actions", 3 | "version": "0.1.0", 4 | "description": "Testing of Core.notify() without paypoad and actions", 5 | "main": "build/index.js", 6 | "branch": "default", 7 | "type": "FEATURE", 8 | "title": "Simple Notify", 9 | "contextIds": ["test-common-adapter"], 10 | "dependencies": { 11 | "test-common-adapter": "0.1.0" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /tests/modules/dapplets/core-notify-without-actions/src/index.ts: -------------------------------------------------------------------------------- 1 | import {} from '../../../../../lib' 2 | 3 | @Injectable 4 | export default class DemoDapplet { 5 | @Inject('test-common-adapter') 6 | public adapter: any 7 | 8 | async activate(): Promise { 9 | const { button } = this.adapter.exports 10 | this.adapter.attachConfig({ 11 | BODY: () => [ 12 | button({ 13 | DEFAULT: { 14 | label: 'Notify', 15 | exec: async () => { 16 | await Core.notify('PASS') 17 | }, 18 | }, 19 | }), 20 | ], 21 | }) 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /tests/modules/dapplets/dapplet-actions/dapplet.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "dapplet-actions", 3 | "version": "0.1.0", 4 | "description": "dapplet-actions", 5 | "main": "build/index.js", 6 | "branch": "default", 7 | "type": "FEATURE", 8 | "title": "dapplet-actions", 9 | "contextIds": ["test-common-adapter"], 10 | "dependencies": { 11 | "test-common-adapter": "0.1.0" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /tests/modules/dapplets/dapplet-actions/src/icon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/modules/dapplets/demo-e2e-dapplet/dapplet.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "demo-e2e-dapplet", 3 | "version": "0.2.0", 4 | "description": "Demonstration of adapters capabilities", 5 | "main": "build/index.js", 6 | "branch": "default", 7 | "type": "FEATURE", 8 | "title": "Demo e2e Dapplet", 9 | "icon": "src/images/Red_Icon3.png", 10 | "contextIds": [ 11 | "test-e2e-adapter" 12 | ], 13 | "dependencies": { 14 | "test-e2e-adapter": "0.1.0" 15 | } 16 | } -------------------------------------------------------------------------------- /tests/modules/dapplets/demo-e2e-dapplet/src/images/Black_Icon2.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/modules/dapplets/demo-e2e-dapplet/src/images/Red_Icon2.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/modules/dapplets/demo-e2e-dapplet/src/images/Red_Icon3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapplets/dapplet-extension/9074291617dd1830cc8573afbfa74de0090dcda0/tests/modules/dapplets/demo-e2e-dapplet/src/images/Red_Icon3.png -------------------------------------------------------------------------------- /tests/modules/dapplets/demo-e2e-dapplet/src/images/White_Icon2.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/modules/dapplets/failing-dapplet/dapplet.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "failing-dapplet", 3 | "version": "0.1.0", 4 | "description": "The dapplet is failing to load", 5 | "main": "build/index.js", 6 | "branch": "default", 7 | "type": "FEATURE", 8 | "title": "Failing Dapplet", 9 | "contextIds": ["test-common-adapter"], 10 | "dependencies": { 11 | "test-common-adapter": "0.1.0" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /tests/modules/dapplets/failing-dapplet/src/index.ts: -------------------------------------------------------------------------------- 1 | import {} from '../../../../../lib' 2 | 3 | @Injectable 4 | export default class Dapplet { 5 | @Inject('test-common-adapter') 6 | public adapter: any 7 | 8 | async activate(): Promise { 9 | await new Promise((_, reject) => setTimeout(reject, 3000)) 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /tests/modules/dapplets/home-action-button/dapplet.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "home-action-button", 3 | "branch": "default", 4 | "version": "0.1.0", 5 | "type": "FEATURE", 6 | "title": "Home Action Button Tester", 7 | "description": "", 8 | "main": "build/index.js", 9 | "icon": "src/example.png", 10 | "contextIds": [ 11 | "test-virtual-adapter" 12 | ], 13 | "overlays": { 14 | "overlay": "http://localhost:8082" 15 | }, 16 | "dependencies": { 17 | "test-virtual-adapter": "0.1.0" 18 | } 19 | } -------------------------------------------------------------------------------- /tests/modules/dapplets/home-action-button/src/example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapplets/dapplet-extension/9074291617dd1830cc8573afbfa74de0090dcda0/tests/modules/dapplets/home-action-button/src/example.png -------------------------------------------------------------------------------- /tests/modules/dapplets/inject-via-activate/dapplet.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "inject-via-activate", 3 | "version": "0.1.0", 4 | "description": "Inject via activate", 5 | "main": "build/index.js", 6 | "branch": "default", 7 | "type": "FEATURE", 8 | "title": "Inject via activate", 9 | "contextIds": ["test-common-adapter"], 10 | "dependencies": { 11 | "test-common-adapter": "0.1.0" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /tests/modules/dapplets/inject-via-activate/src/index.ts: -------------------------------------------------------------------------------- 1 | import {} from '../../../../../lib' 2 | 3 | @Injectable 4 | export default class Dapplet { 5 | async activate( 6 | @Inject('test-common-adapter') 7 | adapter: any 8 | ): Promise { 9 | const { button } = adapter.exports 10 | adapter.attachConfig({ 11 | BODY: () => 12 | button({ 13 | DEFAULT: { 14 | label: 'TEST', 15 | exec: () => Core.notify('PASS'), 16 | }, 17 | }), 18 | }) 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /tests/modules/dapplets/inject-via-constructor/dapplet.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "inject-via-constructor", 3 | "version": "0.1.0", 4 | "description": "Inject via constructor", 5 | "main": "build/index.js", 6 | "branch": "default", 7 | "type": "FEATURE", 8 | "title": "Inject via constructor", 9 | "contextIds": ["test-common-adapter"], 10 | "dependencies": { 11 | "test-common-adapter": "0.1.0" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /tests/modules/dapplets/inject-via-constructor/src/index.ts: -------------------------------------------------------------------------------- 1 | import {} from '../../../../../lib' 2 | 3 | @Injectable 4 | export default class DemoDapplet { 5 | constructor( 6 | @Inject('test-common-adapter') 7 | private adapter: any 8 | ) {} 9 | 10 | async activate(): Promise { 11 | const { button } = this.adapter.exports 12 | this.adapter.attachConfig({ 13 | BODY: () => 14 | button({ 15 | DEFAULT: { 16 | label: 'TEST', 17 | exec: () => Core.notify('PASS'), 18 | }, 19 | }), 20 | }) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tests/modules/dapplets/inject-via-props/dapplet.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "inject-via-props", 3 | "version": "0.1.0", 4 | "description": "Inject via props", 5 | "main": "build/index.js", 6 | "branch": "default", 7 | "type": "FEATURE", 8 | "title": "Inject via props", 9 | "contextIds": ["test-common-adapter"], 10 | "dependencies": { 11 | "test-common-adapter": "0.1.0" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /tests/modules/dapplets/inject-via-props/src/index.ts: -------------------------------------------------------------------------------- 1 | import {} from '../../../../../lib' 2 | 3 | @Injectable 4 | export default class Dapplet { 5 | @Inject('test-common-adapter') 6 | public adapter: any 7 | 8 | async activate(): Promise { 9 | const { button } = this.adapter.exports 10 | this.adapter.attachConfig({ 11 | BODY: () => 12 | button({ 13 | DEFAULT: { 14 | label: 'TEST', 15 | exec: () => Core.notify('PASS'), 16 | }, 17 | }), 18 | }) 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /tests/modules/dapplets/server-interaction/config/default.json: -------------------------------------------------------------------------------- 1 | { 2 | "main": { 3 | "exampleString": "some string value", 4 | "exampleHiddenString": "some string value" 5 | }, 6 | "test": { 7 | "exampleString": "some string value", 8 | "exampleHiddenString": "some string value" 9 | }, 10 | "dev": { 11 | "serverUrl": "ws://localhost:8081/feature-1", 12 | "exampleString": "some string value", 13 | "exampleHiddenString": "some string value" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /tests/modules/dapplets/server-interaction/config/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "object", 3 | "required": ["exampleString", "exampleHiddenString"], 4 | "properties": { 5 | "serverUrl": { 6 | "type": "string", 7 | "title": "Server URL" 8 | }, 9 | "exampleString": { 10 | "type": "string", 11 | "title": "Example of string property" 12 | }, 13 | "exampleHiddenString": { 14 | "type": "string", 15 | "title": "Example of hidden string property", 16 | "hidden": true 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /tests/modules/dapplets/server-interaction/dapplet.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "server-interaction", 3 | "version": "0.1.0", 4 | "description": "Testing of Core.connect()", 5 | "main": "build/index.js", 6 | "branch": "default", 7 | "type": "FEATURE", 8 | "title": "Test Server", 9 | "contextIds": ["test-common-adapter"], 10 | "config": { 11 | "schema": "config/schema.json", 12 | "default": "config/default.json" 13 | }, 14 | "dependencies": { 15 | "test-common-adapter": "0.1.0" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /tests/modules/dapplets/server-interaction/src/index.ts: -------------------------------------------------------------------------------- 1 | import {} from '../../../../../lib' 2 | 3 | interface IDappState { 4 | amount: any 5 | } 6 | 7 | @Injectable 8 | export default class TwitterFeature { 9 | @Inject('test-common-adapter') public adapter: any 10 | async activate() { 11 | const serverUrl = await Core.storage.get('serverUrl') 12 | const defaultState: IDappState = { amount: 0 } 13 | const server = Core.connect({ url: serverUrl }, defaultState) 14 | const state = Core.state(defaultState) 15 | const { button } = this.adapter.exports 16 | this.adapter.attachConfig({ 17 | BODY: (ctx: { id: string }) => { 18 | state[ctx.id].amount.next(server.state[ctx.id].amount) 19 | return button({ 20 | initial: 'DEFAULT', 21 | DEFAULT: { 22 | label: state[ctx.id].amount.value, 23 | exec: () => server.send('increment', ctx.id), 24 | }, 25 | }) 26 | }, 27 | }) 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /tests/modules/dapplets/test-common-dapplet/config/default.json: -------------------------------------------------------------------------------- 1 | { 2 | "main": { 3 | "exampleString": "main environment", 4 | "exampleHiddenString": "MAIN ENVIRONMENT" 5 | }, 6 | "test": { 7 | "exampleString": "test environment", 8 | "exampleHiddenString": "TEST ENVIRONMENT" 9 | }, 10 | "dev": { 11 | "exampleString": "dev environment", 12 | "exampleHiddenString": "DEV ENVIRONMENT" 13 | } 14 | } -------------------------------------------------------------------------------- /tests/modules/dapplets/test-common-dapplet/config/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "object", 3 | "required": ["exampleString", "exampleHiddenString"], 4 | "properties": { 5 | "exampleString": { 6 | "type": "string", 7 | "title": "Example of string property" 8 | }, 9 | "exampleHiddenString": { 10 | "type": "string", 11 | "title": "Example of hidden string property", 12 | "hidden": true 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /tests/modules/dapplets/test-common-dapplet/dapplet.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "test-common-dapplet", 3 | "version": "0.1.0", 4 | "description": "Test Common Adapter", 5 | "main": "build/index.js", 6 | "branch": "default", 7 | "type": "FEATURE", 8 | "title": "Test Common Dapplet", 9 | "icon": "src/icons/ex06.png", 10 | "contextIds": ["test-common-adapter"], 11 | "config": { 12 | "schema": "config/schema.json", 13 | "default": "config/default.json" 14 | }, 15 | "dependencies": { 16 | "test-common-adapter": "0.1.0" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tests/modules/dapplets/test-common-dapplet/src/globals.d.ts: -------------------------------------------------------------------------------- 1 | declare module '*.png' { 2 | const content: string 3 | export default content 4 | } 5 | -------------------------------------------------------------------------------- /tests/modules/dapplets/test-common-dapplet/src/icons/ex06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapplets/dapplet-extension/9074291617dd1830cc8573afbfa74de0090dcda0/tests/modules/dapplets/test-common-dapplet/src/icons/ex06.png -------------------------------------------------------------------------------- /tests/modules/dapplets/test-common-dapplet/src/index.ts: -------------------------------------------------------------------------------- 1 | import {} from '../../../../../lib' 2 | import EXAMPLE_IMG from './icons/ex06.png' 3 | 4 | @Injectable 5 | export default class ViewportFeature { 6 | // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types 7 | @Inject('test-common-adapter') public adapter: any 8 | 9 | activate() { 10 | const { button } = this.adapter.exports 11 | this.adapter.attachConfig({ 12 | BODY: async (ctx) => { 13 | const tooltip = await Core.storage.get('exampleString') 14 | return button({ 15 | DEFAULT: { 16 | tooltip, 17 | img: EXAMPLE_IMG, 18 | exec: () => { 19 | Core.notify('PASS') 20 | }, 21 | }, 22 | }) 23 | }, 24 | }) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /tests/modules/dapplets/test-dynamic-dapplet/dapplet.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "test-dynamic-dapplet", 3 | "version": "0.1.0", 4 | "description": "Demonstration of dynamic dapplet", 5 | "main": "build/index.js", 6 | "branch": "default", 7 | "type": "FEATURE", 8 | "title": "Test Dynamic Dapplet", 9 | "icon": "src/target.png", 10 | "contextIds": [ 11 | "twitter.com/1489972957011394560" 12 | ], 13 | "dependencies": { 14 | "test-twitter-adapter": "0.1.0" 15 | } 16 | } -------------------------------------------------------------------------------- /tests/modules/dapplets/test-dynamic-dapplet/src/Black_Icon2.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/modules/dapplets/test-dynamic-dapplet/src/index.ts: -------------------------------------------------------------------------------- 1 | import {} from '../../../../../lib' 2 | import MAIN_IMG from './Black_Icon2.svg' 3 | 4 | @Injectable 5 | export default class DemoDapplet { 6 | @Inject('test-twitter-adapter') 7 | public adapter: any 8 | 9 | // current user from twitter 10 | private _globalContext = {} 11 | 12 | async activate(): Promise { 13 | const { button } = this.adapter.exports 14 | this.adapter.attachConfig({ 15 | GLOBAL: (global) => { 16 | // Save reference to the global context 17 | Object.assign(this._globalContext, global) 18 | }, 19 | POST: (ctx) => 20 | button({ 21 | DEFAULT: { 22 | label: 'FAKE', 23 | img: MAIN_IMG, 24 | exec: () => console.log('ctx = ', ctx), 25 | }, 26 | }), 27 | }) 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /tests/modules/dapplets/test-dynamic-dapplet/src/target.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapplets/dapplet-extension/9074291617dd1830cc8573afbfa74de0090dcda0/tests/modules/dapplets/test-dynamic-dapplet/src/target.png -------------------------------------------------------------------------------- /tests/modules/dapplets/twitter-demo/dapplet.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "twitter-demo", 3 | "version": "0.2.0", 4 | "description": "Demonstration of adapters capabilities", 5 | "main": "build/index.js", 6 | "branch": "default", 7 | "type": "FEATURE", 8 | "title": "Demo Dapplet", 9 | "icon": "src/images/Red_Icon3.png", 10 | "contextIds": [ 11 | "test-virtual-adapter" 12 | ], 13 | "dependencies": { 14 | "test-virtual-adapter": "0.1.0" 15 | }, 16 | "overlays": { 17 | "twitter-demo-overlay": "http://localhost:8080" 18 | } 19 | } -------------------------------------------------------------------------------- /tests/modules/dapplets/twitter-demo/src/images/Black_Icon2.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/modules/dapplets/twitter-demo/src/images/Red_Icon2.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/modules/dapplets/twitter-demo/src/images/Red_Icon3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dapplets/dapplet-extension/9074291617dd1830cc8573afbfa74de0090dcda0/tests/modules/dapplets/twitter-demo/src/images/Red_Icon3.png -------------------------------------------------------------------------------- /tests/modules/dapplets/twitter-demo/src/images/White_Icon2.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/modules/dapplets/update-parsed-context/dapplet.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "update-parsed-context", 3 | "version": "0.1.0", 4 | "description": "Checks that parsed context is updated when its DOM changes", 5 | "main": "build/index.js", 6 | "branch": "default", 7 | "type": "FEATURE", 8 | "title": "Update parsed context", 9 | "contextIds": ["test-twitter-adapter"], 10 | "dependencies": { 11 | "test-twitter-adapter": "0.1.0" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /tests/modules/overlays/overlay/.eslintignore: -------------------------------------------------------------------------------- 1 | lib 2 | node_modules 3 | build 4 | dist 5 | coverage -------------------------------------------------------------------------------- /tests/modules/overlays/overlay/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | -------------------------------------------------------------------------------- /tests/modules/overlays/overlay/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: #fff; 3 | } 4 | -------------------------------------------------------------------------------- /tests/modules/overlays/overlay/src/index.tsx: -------------------------------------------------------------------------------- 1 | import { dappletState } from '@dapplets/dapplet-overlay-bridge' 2 | import React from 'react' 3 | import ReactDOM from 'react-dom' 4 | // LP: 7. Change by adding Share State HOC 5 | import App, { IState } from './App' 6 | import './index.css' 7 | 8 | const DappletState = dappletState(App) 9 | 10 | ReactDOM.render( 11 | 12 | 13 | , 14 | document.getElementById('root') 15 | ) 16 | // LP end 17 | -------------------------------------------------------------------------------- /tests/modules/overlays/overlay/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es6", 4 | "lib": ["dom", "dom.iterable", "esnext", "es5", "es6"], 5 | "allowJs": true, 6 | "allowSyntheticDefaultImports": true, 7 | "skipLibCheck": true, 8 | "esModuleInterop": true, 9 | "strict": true, 10 | "forceConsistentCasingInFileNames": true, 11 | "moduleResolution": "node", 12 | "resolveJsonModule": true, 13 | "isolatedModules": true, 14 | "jsx": "react", 15 | "module": "esnext", 16 | "types": ["node"] 17 | }, 18 | "include": ["src"], 19 | "exclude": ["node_modules"] 20 | } 21 | -------------------------------------------------------------------------------- /tests/modules/overlays/twitter-demo-overlay/.eslintignore: -------------------------------------------------------------------------------- 1 | lib 2 | node_modules 3 | build 4 | dist 5 | coverage -------------------------------------------------------------------------------- /tests/modules/overlays/twitter-demo-overlay/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | 25 | .eslintcache -------------------------------------------------------------------------------- /tests/modules/overlays/twitter-demo-overlay/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | React App 7 | 8 | 9 | 10 |
11 | 12 | 13 | -------------------------------------------------------------------------------- /tests/modules/overlays/twitter-demo-overlay/src/Widget.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { Accordion, Icon, Ref } from 'semantic-ui-react' 3 | 4 | interface IWidgetProps { 5 | index: string 6 | name: string 7 | text: string 8 | activeIndexes: string[] 9 | handleClick: any 10 | refs: any 11 | } 12 | 13 | export default (props: IWidgetProps) => { 14 | const { index, name, text, activeIndexes, handleClick, refs } = props 15 | return ( 16 | 17 | <> 18 | 19 | 20 | {name} 21 | 22 | 23 |

{text}

24 |
25 | 26 |
27 | ) 28 | } 29 | -------------------------------------------------------------------------------- /tests/modules/overlays/twitter-demo-overlay/src/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import ReactDOM from 'react-dom' 3 | import 'semantic-ui-css/semantic.min.css' 4 | import App from './App' 5 | import './index.css' 6 | 7 | ReactDOM.render( 8 | // 9 | , 10 | //, 11 | document.getElementById('root') 12 | ) 13 | -------------------------------------------------------------------------------- /tests/modules/overlays/twitter-demo-overlay/src/secret/localhost/localhost.ext: -------------------------------------------------------------------------------- 1 | authorityKeyIdentifier = keyid,issuer 2 | basicConstraints = CA:FALSE 3 | keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment 4 | subjectAltName = @alt_names 5 | 6 | [alt_names] 7 | DNS.1 = localhost 8 | IP.1 = 127.0.0.1 -------------------------------------------------------------------------------- /tests/modules/overlays/twitter-demo-overlay/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es6", 4 | "lib": ["dom", "dom.iterable", "esnext"], 5 | "allowJs": true, 6 | "allowSyntheticDefaultImports": true, 7 | "skipLibCheck": true, 8 | "esModuleInterop": true, 9 | "strict": true, 10 | "forceConsistentCasingInFileNames": true, 11 | "moduleResolution": "node", 12 | "resolveJsonModule": true, 13 | "isolatedModules": true, 14 | "jsx": "react", 15 | "types": ["node"] 16 | }, 17 | "include": ["src"], 18 | "exclude": ["node_modules"] 19 | } 20 | -------------------------------------------------------------------------------- /tests/modules/servers/server-interaction/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "server", 3 | "type": "module", 4 | "version": "1.0.0", 5 | "description": "Server for the Dapplet Example 15", 6 | "main": "index.js", 7 | "scripts": { 8 | "start": "node .", 9 | "test": "echo \"Error: no test specified\" && exit 1" 10 | }, 11 | "author": "Dapplets Project", 12 | "license": "ISC", 13 | "dependencies": { 14 | "express": "^4.17.1", 15 | "express-ws": "^4.0.0" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /tests/modules/servers/server-interaction/secret/localhost/localhost.ext: -------------------------------------------------------------------------------- 1 | authorityKeyIdentifier = keyid,issuer 2 | basicConstraints = CA:FALSE 3 | keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment 4 | subjectAltName = @alt_names 5 | 6 | [alt_names] 7 | DNS.1 = localhost 8 | IP.1 = 127.0.0.1 -------------------------------------------------------------------------------- /tests/modules/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "baseUrl": ".", 4 | "module": "commonjs", 5 | "declaration": true, 6 | "noImplicitAny": false, 7 | "removeComments": false, 8 | "noLib": false, 9 | "emitDecoratorMetadata": false, 10 | "experimentalDecorators": true, 11 | "target": "es2019", 12 | "sourceMap": false, 13 | "lib": ["es2019", "dom"], 14 | "types": ["./typesPatch"], 15 | "composite": true 16 | }, 17 | "include": ["dapplets/**/*"] 18 | } 19 | -------------------------------------------------------------------------------- /tests/modules/typesPatch.d.ts: -------------------------------------------------------------------------------- 1 | declare module '*.png' { 2 | const value: any 3 | export default value 4 | } 5 | 6 | declare module '*.jpg' { 7 | const value: any 8 | export default value 9 | } 10 | 11 | declare module '*.jpeg' { 12 | const value: any 13 | export default value 14 | } 15 | 16 | declare module '*.svg' { 17 | const value: any 18 | export default value 19 | } 20 | 21 | declare module '*.html' { 22 | const value: any 23 | export default value 24 | } 25 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES2017", 4 | "module": "commonjs", 5 | "moduleResolution": "node", 6 | "rootDir": "src", 7 | "outDir": "lib", 8 | "sourceMap": true, 9 | "jsx": "react", 10 | "lib": ["esnext", "dom", "DOM.Iterable"], 11 | "experimentalDecorators": true, 12 | "allowSyntheticDefaultImports": true, 13 | "downlevelIteration": true, 14 | "declaration": true, 15 | "esModuleInterop": true, 16 | "skipLibCheck": true, 17 | "resolveJsonModule": true 18 | }, 19 | "exclude": ["tests", "lib", "jslib", "build", "node_modules"], 20 | "include": ["src/**/*"] 21 | } 22 | -------------------------------------------------------------------------------- /webpack.dev.js: -------------------------------------------------------------------------------- 1 | const { merge } = require('webpack-merge') 2 | const common = require('./webpack.common.js') 3 | const webpack = require('webpack') 4 | const CopyWebpackPlugin = require('copy-webpack-plugin') 5 | 6 | module.exports = merge(common, { 7 | mode: 'development', 8 | devtool: 'source-map', // Use `false` for quick rebuild 9 | plugins: [ 10 | new webpack.DefinePlugin({ 11 | EXTENSION_ENV: JSON.stringify('development'), 12 | }), 13 | // create empty common.js 14 | // optimization in dev mode is disabled 15 | new CopyWebpackPlugin({ 16 | patterns: [ 17 | { 18 | from: 'manifest.json', 19 | to: 'common.js', 20 | transform: () => '', 21 | }, 22 | ], 23 | }), 24 | ], 25 | }) 26 | -------------------------------------------------------------------------------- /webpack.prod.js: -------------------------------------------------------------------------------- 1 | const { merge } = require('webpack-merge') 2 | const common = require('./webpack.common.js') 3 | const webpack = require('webpack') 4 | const TerserPlugin = require('terser-webpack-plugin') 5 | 6 | module.exports = merge(common, { 7 | mode: 'production', 8 | optimization: { 9 | // splitChunks: { 10 | // chunks(chunk) { 11 | // // exclude `inpage` 12 | // return chunk.name !== 'inpage' 13 | // }, 14 | // name: 'common', 15 | // }, 16 | minimize: true, 17 | minimizer: [ 18 | new TerserPlugin({ 19 | extractComments: false, 20 | }), 21 | ], 22 | }, 23 | plugins: [ 24 | new webpack.DefinePlugin({ 25 | EXTENSION_ENV: JSON.stringify('production'), 26 | }), 27 | ], 28 | }) 29 | --------------------------------------------------------------------------------