diff --git a/README.md b/README.md
index 382b913..697a707 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
# SelfID
-Monorepo for the SelfID [application](#application) and [SDK](#sdk).
+Monorepo for the SelfID [SDK](#sdk) and [reference application](#application).
## Installation
@@ -60,10 +60,11 @@ Predefined setups using common technologies to build applications using the Self
| Name | Description |
| ------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------- |
| [`next-notes-typescript`](./templates/next-notes-typescript) | Notes taking application setup using [Next.js](https://nextjs.org/) and [TypeScript](https://www.typescriptlang.org/) |
-| [`vite-basic`](./templates/vite-basic) | Basic [Vite](https://vitejs.dev/) setup |
| [`webpack-basic`](./templates/webpack-basic) | Basic [Webpack](https://webpack.js.org/) setup |
| [`webpack-basic-typescript`](./templates/webpack-basic-typescript) | Basic [Webpack](https://webpack.js.org/) setup using [TypeScript](https://www.typescriptlang.org/) |
+
+
## Maintainers
- Paul Le Cam ([@paullecam](http://github.com/paullecam))
diff --git a/apps/developers/package.json b/apps/developers/package.json
index 2a51edc..54b61ec 100644
--- a/apps/developers/package.json
+++ b/apps/developers/package.json
@@ -5,7 +5,7 @@
"scripts": {
"docusaurus": "docusaurus",
"start": "docusaurus start",
- "build": "docusaurus build",
+ "--build": "docusaurus build",
"swizzle": "docusaurus swizzle",
"deploy": "docusaurus deploy",
"clear": "docusaurus clear",
@@ -14,8 +14,8 @@
"write-heading-ids": "docusaurus write-heading-ids"
},
"dependencies": {
- "@docusaurus/core": "2.0.0-beta.9",
- "@docusaurus/preset-classic": "2.0.0-beta.9",
+ "@docusaurus/core": "2.0.0-beta.15",
+ "@docusaurus/preset-classic": "2.0.0-beta.15",
"@docusaurus/theme-live-codeblock": "^2.0.0-beta.9",
"@mdx-js/react": "^1.6.21",
"@self.id/docusaurus-plugin": "^0.1.0",
@@ -48,7 +48,7 @@
"@types/react": "^17.0.37",
"@types/react-helmet": "^6.1.3",
"@types/react-router-dom": "^5.3.2",
- "docusaurus-plugin-typedoc": "^0.16.5",
+ "docusaurus-plugin-typedoc": "^0.17.0",
"typescript": "^4.5.2"
}
}
diff --git a/apps/self.id/.babelrc b/apps/self.id/.babelrc
deleted file mode 100644
index 854cb73..0000000
--- a/apps/self.id/.babelrc
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "presets": ["next/babel"],
- "plugins": [["styled-components", { "ssr": true }]]
-}
diff --git a/apps/self.id/next-env.d.ts b/apps/self.id/next-env.d.ts
index 9bc3dd4..4f11a03 100644
--- a/apps/self.id/next-env.d.ts
+++ b/apps/self.id/next-env.d.ts
@@ -1,5 +1,4 @@
///
-///
///
// NOTE: This file should not be edited
diff --git a/apps/self.id/next.config.js b/apps/self.id/next.config.js
index aaf1908..7e5340b 100644
--- a/apps/self.id/next.config.js
+++ b/apps/self.id/next.config.js
@@ -3,6 +3,9 @@ const withBundleAnalyzer = require('@next/bundle-analyzer')({
})
module.exports = withBundleAnalyzer({
+ compiler: {
+ styledComponents: true,
+ },
async headers() {
return [
{
diff --git a/apps/self.id/package.json b/apps/self.id/package.json
index 858276c..0cbedf4 100644
--- a/apps/self.id/package.json
+++ b/apps/self.id/package.json
@@ -10,32 +10,32 @@
"start": "next start"
},
"dependencies": {
- "@self.id/3box-legacy": "^0.1.0",
- "@self.id/framework": "^0.1.0",
- "copy-to-clipboard": "^3.3.1",
- "grommet": "^2.19.1",
- "next": "^12.0.4",
- "react": "^17.0.2",
- "react-dom": "^17.0.2",
- "react-hot-toast": "^2.1.1",
- "react-is": "^17.0.2",
- "scheduler": "^0.20.2",
- "styled-components": "^5.3.3",
- "uint8arrays": "^3.0.0"
+ "@self.id/3box-legacy": "0.2.0",
+ "@self.id/framework": "0.2.0",
+ "@self.id/multiauth": "0.2.0",
+ "copy-to-clipboard": "3.3.1",
+ "grommet": "2.21.0",
+ "next": "12.1.0",
+ "react": "17.0.2",
+ "react-dom": "17.0.2",
+ "react-hot-toast": "2.2.0",
+ "react-is": "17.0.2",
+ "scheduler": "0.20.2",
+ "styled-components": "5.3.3",
+ "uint8arrays": "3.0.0"
},
"devDependencies": {
- "@next/bundle-analyzer": "^12.0.4",
- "@self.id/multiauth": "^0.1.0",
- "@types/node": "^16.11.11",
- "@types/pica": "^5.1.3",
- "@types/react": "^17.0.37",
- "@types/styled-components": "^5.1.15",
- "babel-plugin-styled-components": "^2.0.2",
- "eslint": "^8.3.0",
- "eslint-config-3box": "^0.4.0",
- "eslint-config-next": "^12.0.4",
- "key-did-provider-ed25519": "^1.1.0",
- "prettier": "^2.5.0",
- "typescript": "^4.5.2"
+ "@next/bundle-analyzer": "12.1.0",
+ "@types/node": "17.0.21",
+ "@types/pica": "9.0.0",
+ "@types/react": "17.0.39",
+ "@types/styled-components": "5.1.23",
+ "babel-plugin-styled-components": "2.0.5",
+ "eslint": "8.9.0",
+ "eslint-config-3box": "0.4.1",
+ "eslint-config-next": "12.1.0",
+ "key-did-provider-ed25519": "1.1.0",
+ "prettier": "2.5.1",
+ "typescript": "4.5.5"
}
}
diff --git a/apps/self.id/src/auth.ts b/apps/self.id/src/auth.ts
index 770afb9..04497ad 100644
--- a/apps/self.id/src/auth.ts
+++ b/apps/self.id/src/auth.ts
@@ -1,12 +1,21 @@
import type { PartialConnectorConfig, PartialNetworkConfig } from '@self.id/multiauth'
+import ethereumLogo from '@self.id/multiauth/assets/ethereum.png'
+import fortmaticLogo from '@self.id/multiauth/assets/fortmatic.png'
+import metaMaskLogo from '@self.id/multiauth/assets/metamask.png'
+import portisLogo from '@self.id/multiauth/assets/portis.png'
+import torusLogo from '@self.id/multiauth/assets/torus.png'
+import walletConnectLogo from '@self.id/multiauth/assets/walletconnect.png'
-const ethereumConnectors: Array = [{ key: 'injected' }]
+const ethereumConnectors: Array = [
+ { key: 'injected', logo: metaMaskLogo.src },
+]
const walletConnectChainId = process.env.NEXT_PUBLIC_WALLETCONNECT_CHAIN_ID
const walletConnectRpcUrl = process.env.NEXT_PUBLIC_WALLETCONNECT_RPC_URL
if (typeof walletConnectChainId === 'string' && typeof walletConnectRpcUrl === 'string') {
ethereumConnectors.push({
key: 'walletConnect',
+ logo: walletConnectLogo.src,
params: {
rpc: { [walletConnectChainId]: walletConnectRpcUrl },
},
@@ -18,6 +27,7 @@ const fortmaticChainId = process.env.NEXT_PUBLIC_FORTMATIC_CHAIN_ID
if (typeof fortmaticApiKey === 'string' && typeof fortmaticChainId === 'string') {
ethereumConnectors.push({
key: 'fortmatic',
+ logo: fortmaticLogo.src,
params: {
apiKey: fortmaticApiKey,
},
@@ -29,6 +39,7 @@ const portisNetwork = process.env.NEXT_PUBLIC_PORTIS_NETWORK
if (typeof portisDappId === 'string' && typeof portisNetwork === 'string') {
ethereumConnectors.push({
key: 'portis',
+ logo: portisLogo.src,
params: {
dAppId: portisDappId,
network: portisNetwork,
@@ -40,6 +51,7 @@ const torusNetworkHost = process.env.NEXT_PUBLIC_TORUS_NETWORK_HOST
if (typeof torusNetworkHost === 'string') {
ethereumConnectors.push({
key: 'torus',
+ logo: torusLogo.src,
params: {
network: { host: torusNetworkHost },
},
@@ -49,6 +61,7 @@ if (typeof torusNetworkHost === 'string') {
export const networks: Array = [
{
key: 'ethereum',
+ logo: ethereumLogo.src,
connectors: ethereumConnectors,
},
]
diff --git a/apps/self.id/src/components/client/EditProfileScreen.tsx b/apps/self.id/src/components/client/EditProfileScreen.tsx
index 844bd33..28e21ee 100644
--- a/apps/self.id/src/components/client/EditProfileScreen.tsx
+++ b/apps/self.id/src/components/client/EditProfileScreen.tsx
@@ -30,17 +30,29 @@ function profileToForm({ nationalities, ...profile }: BasicProfile): FormValue {
return { ...profile, nationality: nationalities?.[0] }
}
-function changeProfile(profile: BasicProfile, { nationality, ...value }: FormValue): BasicProfile {
+function changeProfile(
+ profile: BasicProfile,
+ { nationality, residenceCountry, ...value }: FormValue
+): BasicProfile {
const changed = { ...profile, ...value }
+ // Turn single-value nationality into array, with uppercase value
const nationalities = profile.nationalities
- if (nationality && Array.isArray(nationalities) && !nationalities.includes(nationality)) {
- nationalities.unshift(nationality)
+ if (nationality && Array.isArray(nationalities)) {
+ const formattedNationality = nationality.toUpperCase()
+ if (!nationalities.includes(formattedNationality)) {
+ nationalities.unshift(formattedNationality)
+ }
}
if (nationalities?.length) {
changed.nationalities = nationalities
}
+ // Residence country code must be uppercase
+ if (residenceCountry != null && residenceCountry !== '') {
+ changed.residenceCountry = residenceCountry.toUpperCase()
+ }
+
return changed
}
diff --git a/apps/self.id/src/pages/_app.tsx b/apps/self.id/src/pages/_app.tsx
index d0259c9..b509837 100644
--- a/apps/self.id/src/pages/_app.tsx
+++ b/apps/self.id/src/pages/_app.tsx
@@ -1,5 +1,6 @@
import { Provider } from '@self.id/framework'
-
+import closeIcon from '@self.id/multiauth/assets/icon-close.svg'
+import selectedIcon from '@self.id/multiauth/assets/icon-selected.svg'
import type { AppProps } from 'next/app'
import Head from 'next/head'
import { Toaster } from 'react-hot-toast'
@@ -50,7 +51,7 @@ export default function App({ Component, pageProps }: AppProps): JSX.Element {
return (
diff --git a/packages/3box-legacy/package.json b/packages/3box-legacy/package.json
index 6cbb01b..fc8fef0 100644
--- a/packages/3box-legacy/package.json
+++ b/packages/3box-legacy/package.json
@@ -1,6 +1,6 @@
{
"name": "@self.id/3box-legacy",
- "version": "0.1.0",
+ "version": "0.2.0",
"author": "3Box Labs",
"license": "(Apache-2.0 OR MIT)",
"homepage": "https://github.com/ceramicstudio/self.id#readme",
@@ -14,10 +14,8 @@
"directory": "packages/3box-legacy"
},
"main": "dist/lib.cjs",
- "module": "dist/lib.mjs",
"typings": "dist/index.d.ts",
"exports": {
- "import": "./dist/lib.mjs",
"require": "./dist/lib.cjs",
"default": "./dist/lib.cjs"
},
@@ -33,8 +31,7 @@
"build": "del dist && tsc --emitDeclarationOnly --skipLibCheck && rollup -c ../../rollup.config.js",
"lint": "eslint --fix",
"test": "jest",
- "prepare": "yarn build",
- "prepublishOnly": "package-check"
+ "prepare": "yarn build"
},
"dependencies": {
"cross-fetch": "^3.1.4"
diff --git a/packages/core/package.json b/packages/core/package.json
index effc733..0c1c668 100644
--- a/packages/core/package.json
+++ b/packages/core/package.json
@@ -1,6 +1,6 @@
{
"name": "@self.id/core",
- "version": "0.2.0",
+ "version": "0.3.0",
"author": "3Box Labs",
"license": "(Apache-2.0 OR MIT)",
"homepage": "https://github.com/ceramicstudio/self.id#readme",
@@ -14,10 +14,8 @@
"directory": "packages/core"
},
"main": "dist/lib.cjs",
- "module": "dist/lib.mjs",
"typings": "dist/index.d.ts",
"exports": {
- "import": "./dist/lib.mjs",
"require": "./dist/lib.cjs",
"default": "./dist/lib.cjs"
},
@@ -34,8 +32,7 @@
"build": "del dist && tsc --emitDeclarationOnly --skipLibCheck && rollup -c ../../rollup.config.js",
"lint": "eslint --fix",
"test": "jest",
- "prepare": "yarn build",
- "prepublishOnly": "package-check"
+ "prepare": "yarn build"
},
"dependencies": {
"@ceramicnetwork/3id-did-resolver": "^1.4.9",
diff --git a/packages/framework/package.json b/packages/framework/package.json
index 9890670..58c770b 100644
--- a/packages/framework/package.json
+++ b/packages/framework/package.json
@@ -1,6 +1,6 @@
{
"name": "@self.id/framework",
- "version": "0.1.0",
+ "version": "0.2.0",
"author": "3Box Labs",
"license": "(Apache-2.0 OR MIT)",
"homepage": "https://github.com/ceramicstudio/self.id#readme",
@@ -15,10 +15,8 @@
"directory": "packages/framework"
},
"main": "dist/lib.cjs",
- "module": "dist/lib.mjs",
"typings": "dist/index.d.ts",
"exports": {
- "import": "./dist/lib.mjs",
"require": "./dist/lib.cjs",
"default": "./dist/lib.cjs"
},
@@ -34,18 +32,17 @@
"build": "del dist && tsc --emitDeclarationOnly --skipLibCheck && rollup -c ../../rollup.config.js",
"lint": "eslint --fix",
"test": "jest",
- "prepare": "yarn build",
- "prepublishOnly": "package-check"
+ "prepare": "yarn build"
},
"dependencies": {
"@datamodels/identity-accounts-web": "^0.1.2",
"@datamodels/identity-profile-basic": "^0.1.2",
- "@self.id/core": "^0.2.0",
- "@self.id/image-utils": "^0.1.0",
- "@self.id/multiauth": "^0.1.0",
- "@self.id/react": "^0.1.0",
- "@self.id/ui": "^0.1.0",
- "@self.id/web": "^0.2.0",
+ "@self.id/core": "^0.3.0",
+ "@self.id/image-utils": "^0.2.0",
+ "@self.id/multiauth": "^0.2.0",
+ "@self.id/react": "^0.2.0",
+ "@self.id/ui": "^0.2.0",
+ "@self.id/web": "^0.3.0",
"boring-avatars": "^1.5.8",
"grommet": "^2.19.1"
},
@@ -56,6 +53,9 @@
"react": "^17.0.2"
},
"jest": {
- "preset": "ts-jest"
+ "preset": "ts-jest",
+ "moduleNameMapper": {
+ "\\.(png|svg)$": "/test/__mocks__/fileMock.js"
+ }
}
}
diff --git a/packages/framework/test/__mocks__/fileMock.js b/packages/framework/test/__mocks__/fileMock.js
new file mode 100644
index 0000000..f06d152
--- /dev/null
+++ b/packages/framework/test/__mocks__/fileMock.js
@@ -0,0 +1 @@
+module.exports = ''
\ No newline at end of file
diff --git a/packages/image-utils/package.json b/packages/image-utils/package.json
index b6581c2..b2fe73d 100644
--- a/packages/image-utils/package.json
+++ b/packages/image-utils/package.json
@@ -1,6 +1,6 @@
{
"name": "@self.id/image-utils",
- "version": "0.1.0",
+ "version": "0.2.0",
"author": "3Box Labs",
"license": "(Apache-2.0 OR MIT)",
"homepage": "https://github.com/ceramicstudio/self.id#readme",
@@ -14,10 +14,8 @@
"directory": "packages/image-utils"
},
"main": "dist/lib.cjs",
- "module": "dist/lib.mjs",
"typings": "dist/index.d.ts",
"exports": {
- "import": "./dist/lib.mjs",
"require": "./dist/lib.cjs",
"default": "./dist/lib.cjs"
},
@@ -32,11 +30,10 @@
"scripts": {
"build": "del dist && tsc --emitDeclarationOnly --skipLibCheck && rollup -c ../../rollup.config.js",
"lint": "eslint --fix",
- "prepare": "yarn build",
- "prepublishOnly": "package-check"
+ "prepare": "yarn build"
},
"dependencies": {
- "pica": "^8.0.0"
+ "pica": "^9.0.1"
},
"devDependencies": {
"@datamodels/identity-profile-basic": "^0.1.2"
diff --git a/packages/multiauth/package.json b/packages/multiauth/package.json
index 3223be3..af77f72 100644
--- a/packages/multiauth/package.json
+++ b/packages/multiauth/package.json
@@ -1,6 +1,6 @@
{
"name": "@self.id/multiauth",
- "version": "0.1.0",
+ "version": "0.2.0",
"author": "3Box Labs",
"license": "(Apache-2.0 OR MIT)",
"homepage": "https://github.com/ceramicstudio/self.id#readme",
@@ -16,12 +16,10 @@
"directory": "packages/multiauth"
},
"main": "dist/lib.cjs",
- "module": "dist/lib.mjs",
"typings": "dist/index.d.ts",
"exports": {
"./assets/*": "./assets/*",
".": {
- "import": "./dist/lib.mjs",
"require": "./dist/lib.cjs",
"default": "./dist/lib.cjs"
}
@@ -39,8 +37,7 @@
"build": "del dist && tsc --emitDeclarationOnly --skipLibCheck && rollup -c ../../rollup.config.js",
"lint": "eslint --fix",
"test": "jest",
- "prepare": "yarn build",
- "prepublishOnly": "package-check"
+ "prepare": "yarn build"
},
"dependencies": {
"@portis/web3": "^4.0.6",
@@ -55,6 +52,9 @@
"react": "^17.0.2"
},
"jest": {
- "preset": "ts-jest"
+ "preset": "ts-jest",
+ "moduleNameMapper": {
+ "\\.(png|svg)$": "/test/__mocks__/fileMock.js"
+ }
}
}
diff --git a/packages/multiauth/src/components/Modal.tsx b/packages/multiauth/src/components/Modal.tsx
index a96613f..309c953 100644
--- a/packages/multiauth/src/components/Modal.tsx
+++ b/packages/multiauth/src/components/Modal.tsx
@@ -17,7 +17,7 @@ function ModalGrid({ children }: ModalGridProps) {
return {children}
}
-const defaultCloseIconSrc = new URL('../assets/icon-close.svg', import.meta.url).href
+const defaultCloseIconSrc = require('../assets/icon-close.svg')
export type ModalConfig = {
closeIcon?: string | ReactElement
diff --git a/packages/multiauth/src/components/ModalItem.tsx b/packages/multiauth/src/components/ModalItem.tsx
index 1a2a140..9a36279 100644
--- a/packages/multiauth/src/components/ModalItem.tsx
+++ b/packages/multiauth/src/components/ModalItem.tsx
@@ -2,7 +2,7 @@ import { Box, Spinner, Text } from 'grommet'
import React from 'react'
import type { ReactElement, ReactNode } from 'react'
-const defaultSelectedIconSrc = new URL('../assets/icon-selected.svg', import.meta.url).href
+const defaultSelectedIconSrc = require('../assets/icon-selected.svg')
function noop() {
// Do nothing
diff --git a/packages/multiauth/src/connectors/fortmatic.ts b/packages/multiauth/src/connectors/fortmatic.ts
index cc1c7eb..2fe9efc 100644
--- a/packages/multiauth/src/connectors/fortmatic.ts
+++ b/packages/multiauth/src/connectors/fortmatic.ts
@@ -9,7 +9,7 @@ export type FortmaticParams = {
/** @internal */
export const fortmatic: ConnectorConfigDefaults = {
label: 'Fortmatic',
- logo: new URL('../assets/fortmatic.png', import.meta.url).href,
+ logo: require('../assets/fortmatic.png'),
getNetworkProvider(key, params?: FortmaticParams) {
return key === 'ethereum' && params?.apiKey != null ? 'web3' : null
},
diff --git a/packages/multiauth/src/connectors/injected.ts b/packages/multiauth/src/connectors/injected.ts
index 2f1b0d8..34c5511 100644
--- a/packages/multiauth/src/connectors/injected.ts
+++ b/packages/multiauth/src/connectors/injected.ts
@@ -11,7 +11,7 @@ declare global {
/** @internal */
export const injected: ConnectorConfigDefaults = {
label: 'MetaMask',
- logo: new URL('../assets/metamask.png', import.meta.url).href,
+ logo: require('../assets/metamask.png'),
getNetworkProvider(key) {
return key === 'ethereum' && typeof window !== 'undefined' && window.ethereum != null
? 'eip1193'
diff --git a/packages/multiauth/src/connectors/portis.ts b/packages/multiauth/src/connectors/portis.ts
index 477173a..0663b42 100644
--- a/packages/multiauth/src/connectors/portis.ts
+++ b/packages/multiauth/src/connectors/portis.ts
@@ -10,7 +10,7 @@ export type PortisParams = {
/** @internal */
export const portis: ConnectorConfigDefaults = {
label: 'Portis',
- logo: new URL('../assets/portis.png', import.meta.url).href,
+ logo: require('../assets/portis.png'),
getNetworkProvider(key, params?: PortisParams) {
return key === 'ethereum' && params != null && params.dAppId != null && params.network != null
? 'web3'
diff --git a/packages/multiauth/src/connectors/torus.ts b/packages/multiauth/src/connectors/torus.ts
index 1ec6e90..62c2458 100644
--- a/packages/multiauth/src/connectors/torus.ts
+++ b/packages/multiauth/src/connectors/torus.ts
@@ -12,7 +12,7 @@ export type TorusParams = {
/** @internal */
export const torus: ConnectorConfigDefaults = {
label: 'Torus',
- logo: new URL('../assets/torus.png', import.meta.url).href,
+ logo: require('../assets/torus.png'),
getNetworkProvider(key, params?: TorusParams) {
return key === 'ethereum' && params?.network != null ? 'eip1193' : null
},
diff --git a/packages/multiauth/src/connectors/walletConnect.ts b/packages/multiauth/src/connectors/walletConnect.ts
index 2eb05a6..2a11f45 100644
--- a/packages/multiauth/src/connectors/walletConnect.ts
+++ b/packages/multiauth/src/connectors/walletConnect.ts
@@ -10,7 +10,7 @@ export type WalletConnectParams = {
/** @internal */
export const walletConnect: ConnectorConfigDefaults = {
label: 'WalletConnect',
- logo: new URL('../assets/walletconnect.png', import.meta.url).href,
+ logo: require('../assets/walletconnect.png'),
getNetworkProvider(key, params?: WalletConnectParams) {
return key === 'ethereum' && params != null && (params.infuraId != null || params.rpc != null)
? 'eip1193'
diff --git a/packages/multiauth/src/networks.ts b/packages/multiauth/src/networks.ts
index 49b0e77..a0b9edc 100644
--- a/packages/multiauth/src/networks.ts
+++ b/packages/multiauth/src/networks.ts
@@ -11,7 +11,7 @@ import type {
export const networksDefaults: Record = {
ethereum: {
label: 'Ethereum',
- logo: new URL('../assets/ethereum.png', import.meta.url).href,
+ logo: require('../assets/ethereum.png'),
connectors: ['injected'],
getState: getEthereumProviderState,
},
diff --git a/packages/multiauth/test/__mocks__/fileMock.js b/packages/multiauth/test/__mocks__/fileMock.js
new file mode 100644
index 0000000..f06d152
--- /dev/null
+++ b/packages/multiauth/test/__mocks__/fileMock.js
@@ -0,0 +1 @@
+module.exports = ''
\ No newline at end of file
diff --git a/packages/multiauth/test/connectors.test.ts b/packages/multiauth/test/connectors.test.ts
index bfbcb0f..b2cd829 100644
--- a/packages/multiauth/test/connectors.test.ts
+++ b/packages/multiauth/test/connectors.test.ts
@@ -7,7 +7,7 @@ import Torus from '@toruslabs/torus-embed'
import WalletConnect from '@walletconnect/ethereum-provider'
import Fortmatic from 'fortmatic'
-// Use compiled files for tests as Jest doesn't support ESM/import.meta
+// Use compiled files for tests as Jest doesn't support image imports
import {
connectorsDefaults,
getConnectorConfig,
diff --git a/packages/multiauth/test/hooks.test.tsx b/packages/multiauth/test/hooks.test.tsx
index b6155a9..ce29dde 100644
--- a/packages/multiauth/test/hooks.test.tsx
+++ b/packages/multiauth/test/hooks.test.tsx
@@ -6,7 +6,7 @@ import { act, renderHook } from '@testing-library/react-hooks'
import React from 'react'
import type { ReactNode } from 'react'
-// Use compiled files for tests as Jest doesn't support ESM/import.meta
+// Use compiled files for tests as Jest doesn't support image imports
import { Provider, useMultiAuth } from '..'
type ChildrenProps = { children: ReactNode }
diff --git a/packages/react/package.json b/packages/react/package.json
index 8056aee..85ec77c 100644
--- a/packages/react/package.json
+++ b/packages/react/package.json
@@ -1,6 +1,6 @@
{
"name": "@self.id/react",
- "version": "0.1.0",
+ "version": "0.2.0",
"author": "3Box Labs",
"license": "(Apache-2.0 OR MIT)",
"homepage": "https://github.com/ceramicstudio/self.id#readme",
@@ -15,10 +15,8 @@
"directory": "packages/react"
},
"main": "dist/lib.cjs",
- "module": "dist/lib.mjs",
"typings": "dist/index.d.ts",
"exports": {
- "import": "./dist/lib.mjs",
"require": "./dist/lib.cjs",
"default": "./dist/lib.cjs"
},
@@ -34,13 +32,12 @@
"build": "del dist && tsc --emitDeclarationOnly --skipLibCheck && rollup -c ../../rollup.config.js",
"lint": "eslint --fix",
"test": "jest",
- "prepare": "yarn build",
- "prepublishOnly": "package-check"
+ "prepare": "yarn build"
},
"dependencies": {
- "@self.id/core": "^0.2.0",
- "@self.id/web": "^0.2.0",
- "jotai": "^1.4.6",
+ "@self.id/core": "^0.3.0",
+ "@self.id/web": "^0.3.0",
+ "jotai": "^1.6.0",
"react-query": "^3.33.7"
},
"devDependencies": {
diff --git a/packages/react/src/storage.ts b/packages/react/src/storage.ts
index deb2812..4c0ff70 100644
--- a/packages/react/src/storage.ts
+++ b/packages/react/src/storage.ts
@@ -53,4 +53,7 @@ export const CookieStorage = {
setBrowserCookie(key, value)
}
},
+ removeItem: (key: string): void => {
+ deleteBrowserCookie(key)
+ },
}
diff --git a/packages/ui/package.json b/packages/ui/package.json
index 3233e36..a541b59 100644
--- a/packages/ui/package.json
+++ b/packages/ui/package.json
@@ -1,6 +1,6 @@
{
"name": "@self.id/ui",
- "version": "0.1.0",
+ "version": "0.2.0",
"author": "3Box Labs",
"license": "(Apache-2.0 OR MIT)",
"homepage": "https://github.com/ceramicstudio/self.id#readme",
@@ -15,10 +15,8 @@
"directory": "packages/ui"
},
"main": "dist/lib.cjs",
- "module": "dist/lib.mjs",
"typings": "dist/index.d.ts",
"exports": {
- "import": "./dist/lib.mjs",
"require": "./dist/lib.cjs",
"default": "./dist/lib.cjs"
},
@@ -34,15 +32,15 @@
"build": "del dist && tsc --emitDeclarationOnly --skipLibCheck && rollup -c ../../rollup.config.js",
"lint": "eslint --fix",
"test": "jest",
- "prepare": "yarn build",
- "prepublishOnly": "package-check"
+ "prepare": "yarn build"
},
"dependencies": {
"boring-avatars": "^1.5.8",
- "grommet": "^2.19.1"
+ "grommet": "^2.21.0"
},
"peerDependencies": {
- "react": "^17.0.2"
+ "react": "^17.0.2",
+ "styled-components": "^5.3.3"
},
"jest": {
"preset": "ts-jest"
diff --git a/packages/ui/src/theme.ts b/packages/ui/src/theme.ts
index ac5e989..d4c5e2b 100644
--- a/packages/ui/src/theme.ts
+++ b/packages/ui/src/theme.ts
@@ -27,6 +27,9 @@ export const theme: ThemeType = {
color: 'neutral-5',
},
},
+ font: {
+ family: 'sans-serif',
+ },
},
anchor: {
fontWeight: 400,
diff --git a/packages/ui/test/__snapshots__/AvatarPlaceholder.test.tsx.snap b/packages/ui/test/__snapshots__/AvatarPlaceholder.test.tsx.snap
index 6ae1cc0..4dfe074 100644
--- a/packages/ui/test/__snapshots__/AvatarPlaceholder.test.tsx.snap
+++ b/packages/ui/test/__snapshots__/AvatarPlaceholder.test.tsx.snap
@@ -5,10 +5,14 @@ exports[`AvatarPlaceholder uses a default value when the did prop is not provide