Skip to content

Commit

Permalink
Merge pull request #548 from Adamant-im/dev
Browse files Browse the repository at this point in the history
Release v4.3.0
  • Loading branch information
bludnic authored Nov 26, 2023
2 parents 039b4ca + 54154fb commit eda8de5
Show file tree
Hide file tree
Showing 116 changed files with 6,224 additions and 4,018 deletions.
4,513 changes: 2,379 additions & 2,134 deletions package-lock.json

Large diffs are not rendered by default.

86 changes: 49 additions & 37 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "adamant-im",
"version": "4.2.2",
"version": "4.3.1",
"author": "ADAMANT Foundation <[email protected]>",
"license": "GPLv3",
"description": "Decentralized Messenger",
Expand All @@ -9,7 +9,9 @@
"serve": "vite preview --config vite-pwa.config.ts",
"dev": "vite --config vite-pwa.config.ts",
"serve:test": "cross-env ADM_CONFIG_FILE=test vue-cli-service serve",
"update-wallets": "node scripts/wallets.mjs",
"wallets:generate": "npm run wallets:data:generate && npm run wallets:types:generate",
"wallets:data:generate": "node scripts/wallets.mjs",
"wallets:types:generate": "swagger-typescript-api -p ./adamant-wallets/specification/openapi.json -o ./src/types/wallets -n index.ts --no-client",
"build": "vue-tsc && vite build --config vite-pwa.config.ts",
"lint": "eslint --ext .js,.vue --ignore-path .gitignore --fix src",
"prettify": "prettier --write src/",
Expand All @@ -26,17 +28,16 @@
"@emoji-mart/data": "^1.1.2",
"@liskhq/lisk-cryptography": "3.2.1",
"@liskhq/lisk-transactions": "5.2.2",
"@mdi/font": "^7.2.96",
"@mdi/font": "^7.3.67",
"@stablelib/utf8": "^1.0.1",
"@zxing/browser": "^0.1.4",
"@zxing/library": "^0.20.0",
"abi-decoder": "^2.4.0",
"assert": "^2.1.0",
"axios": "^1.5.0",
"axios": "^1.6.2",
"b64-to-blob": "^1.2.19",
"bignumber.js": "^9.1.2",
"bip39": "^3.1.0",
"bitcoinjs-lib": "^5.2.0",
"bitcoinjs-lib": "6.1.5",
"buffer": "^6.0.3",
"bytebuffer": "^5.0.1",
"coininfo": "^5.2.1",
Expand All @@ -45,17 +46,18 @@
"dayjs": "^1.11.10",
"deepmerge": "^4.3.1",
"detect-browser": "^5.3.0",
"dompurify": "^3.0.5",
"dompurify": "^3.0.6",
"ecpair": "^2.1.0",
"ed2curve": "^0.3.0",
"emoji-mart": "^5.5.2",
"file-saver": "^2.0.5",
"hdkey": "^2.1.0",
"https-browserify": "^1.0.0",
"idb": "^7.1.1",
"js-base64": "^3.7.5",
"js-md5": "^0.7.3",
"js-md5": "^0.8.3",
"lodash": "^4.17.21",
"marked": "^9.0.3",
"marked": "^10.0.0",
"mitt": "^3.0.1",
"notifyjs": "^3.0.0",
"os-browserify": "^0.3.0",
Expand All @@ -75,59 +77,69 @@
"stream-http": "^3.2.0",
"stylefire": "^7.0.3",
"throttle-promise": "^1.0.4",
"tiny-secp256k1": "^2.2.3",
"tweetnacl": "^1.0.3",
"visibilityjs": "^2.0.2",
"vue": "^3.3.4",
"vue-i18n": "^9.4.1",
"vue": "^3.3.8",
"vue-i18n": "^9.7.0",
"vue-router": "^4.2.5",
"vuetify": "^3.3.17",
"vuetify": "^3.4.2",
"vuex": "^4.1.0",
"vuex-persist": "^3.1.3",
"web3-eth": "^1.9.0",
"web3-utils": "^1.9.0"
"web3-errors": "^1.1.4",
"web3-eth": "^4.3.1",
"web3-eth-abi": "^4.1.4",
"web3-eth-accounts": "^4.1.0",
"web3-eth-contract": "^4.1.3",
"web3-providers-http": "^4.1.0",
"web3-utils": "^4.0.7"
},
"devDependencies": {
"@electron/notarize": "^2.1.0",
"@electron/notarize": "^2.2.0",
"@esbuild-plugins/node-globals-polyfill": "^0.2.3",
"@openapitools/openapi-generator-cli": "^2.7.0",
"@rollup/plugin-commonjs": "^25.0.4",
"@rollup/plugin-inject": "^5.0.3",
"@rushstack/eslint-patch": "^1.4.0",
"@types/dompurify": "^3.0.2",
"@types/emoji-mart": "^3.0.9",
"@types/marked": "^5.0.1",
"@typescript-eslint/eslint-plugin": "^6.7.2",
"@typescript-eslint/parser": "^6.7.2",
"@vitejs/plugin-vue": "^4.3.4",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-inject": "^5.0.5",
"@rushstack/eslint-patch": "^1.5.1",
"@types/dompurify": "^3.0.5",
"@types/emoji-mart": "^3.0.12",
"@types/marked": "^5.0.2",
"@typescript-eslint/eslint-plugin": "^6.11.0",
"@typescript-eslint/parser": "^6.11.0",
"@vitejs/plugin-vue": "^4.5.0",
"@vue/eslint-config-prettier": "^8.0.0",
"@vue/test-utils": "^2.4.1",
"@vue/test-utils": "^2.4.2",
"autoprefixer": "^10.4.16",
"cross-env": "^7.0.3",
"electron": "^26.2.2",
"electron": "^26.2.4",
"electron-builder": "^24.6.4",
"electron-devtools-installer": "^3.2.0",
"eslint": "^8.49.0",
"eslint-plugin-vue": "^9.17.0",
"eslint": "^8.54.0",
"eslint-plugin-vue": "^9.18.1",
"execa": "^8.0.1",
"jest-serializer-vue": "^3.1.0",
"jsdom": "^22.1.0",
"lorem-ipsum": "^2.0.8",
"postcss": "latest",
"prettier": "^3.0.3",
"sass": "^1.68.0",
"prettier": "^3.1.0",
"sass": "^1.69.5",
"sass-loader": "^13.3.2",
"sinon": "^16.0.0",
"sinon": "^17.0.1",
"swagger-typescript-api": "^13.0.3",
"typescript": "^5.2.2",
"uuid": "^9.0.1",
"vite": "^4.4.9",
"vite-plugin-electron": "^0.14.1",
"vite-plugin-pwa": "^0.16.5",
"vitest": "^0.34.5",
"vite-plugin-electron": "^0.15.4",
"vite-plugin-pwa": "^0.16.7",
"vite-plugin-top-level-await": "^1.3.1",
"vite-plugin-wasm": "^3.2.2",
"vitest": "^0.34.6",
"vue-cli-plugin-i18n": "^2.3.2",
"vue-cli-plugin-vuetify": "~2.5.8",
"vue-eslint-parser": "^9.3.1",
"vue-template-compiler": "^2.7.14",
"vue-tsc": "^1.8.13"
"vue-eslint-parser": "^9.3.2",
"vue-template-compiler": "^2.7.15",
"vue-tsc": "^1.8.22",
"web3-types": "^1.3.1"
},
"main": "dist-electron/main.js",
"keywords": [
Expand Down
72 changes: 51 additions & 21 deletions scripts/wallets.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,21 @@ async function run() {
// update adamant-wallets repo
await $`git submodule foreach git pull origin master`

const [coins, nodes, { coinDirNames, coinSymbols }] = await initCoins()
const { coins, config, coinDirNames, coinSymbols } = await initCoins()
await applyBlockchains(coins, coinSymbols)

await copyIcons(coins, coinDirNames)

await writeFile(CRYPTOS_DATA_FILE_PATH, JSON.stringify(coins, null, 2))

await updateConfig(nodes)
await updateProductionConfig(config)
await updateDevelopmentConfig(config)
await updateTorConfig(config)
}

async function initCoins() {
const config = {}
const coins = {}
const nodes = {}

const coinDirNames = {}
const coinSymbols = {}
Expand Down Expand Up @@ -69,18 +71,16 @@ async function initCoins() {

if (coin.createCoin) {
const nodeName = coin.symbol.toLowerCase()

if (coin.nodes) {
nodes[nodeName] = coin.nodes
}

if (coin.serviceNodes) {
nodes[`${nodeName}service`] = coin.serviceNodes
}
config[nodeName] = coin
}
})

return [coins, nodes, { coinDirNames, coinSymbols }]
return {
coins,
config,
coinDirNames,
coinSymbols
}
}

async function applyBlockchains(coins, coinSymbols) {
Expand Down Expand Up @@ -129,19 +129,49 @@ async function copyIcons(coins, coinDirNames) {
}
}

function updateProductionConfig(configs) {
return updateConfig(configs, 'production')
}

function updateDevelopmentConfig(configs) {
return updateConfig(configs, 'development')
}

function updateTorConfig(configs) {
const torConfigs = _.mapValues(configs, (config) => {
const torConfig = _.mergeWith(config, config.tor, (value, srcValue) => {
// customizer overrides `nodes`, `services` and `links`
// instead of merging them
if (_.isArray(srcValue)) {
return srcValue
}
})

return torConfig
})

return updateConfig(torConfigs, 'tor')
}

/**
* Updates the production config inside src/config
* Updates the config inside src/config
*/
async function updateConfig(nodes) {
const configPath = resolve('src/config/production.json')
const config = await parseJsonFile(configPath)

config.server = {
...config.server, // to keep `infoservice`
...nodes
async function updateConfig(configs, configName) {
const configPath = resolve(`src/config/${configName}.json`)
const configFile = await parseJsonFile(configPath)

for (const configKey in configs) {
const config = configs[configKey]

configFile[configKey].explorer = config.explorer
configFile[configKey].explorerTx = config.explorerTx
configFile[configKey].explorerAddress = config.explorerAddress
configFile[configKey].minNodeVersion = config.minNodeVersion
configFile[configKey].nodes = config.nodes
configFile[configKey].services = config.services
}

await writeFile(configPath, JSON.stringify(config, null, 2))
await writeFile(configPath, JSON.stringify(configFile, null, 2))
}

async function forEachDir(path, callback) {
Expand Down
42 changes: 25 additions & 17 deletions src/assets/styles/components/_chat.scss
Original file line number Diff line number Diff line change
Expand Up @@ -196,19 +196,14 @@ $scroll-bar-width: 4px;
word-wrap: break-word;

code {
line-height: 1rem;
color: #2e7eed;
font-weight: inherit;
font-size: 12px;
padding: 8px;
margin-bottom: 8px;
tab-size: 4;
border-radius: 4px;
border-style: solid;
border-width: 1px;
border-color: rgb(224, 224, 224);
font-size: 14px;
padding: 2px 4px;
border-radius: 6px;
overflow-x: auto;
max-width: 100%;
tab-size: 4;
line-height: 24px;
}

code:before {
Expand Down Expand Up @@ -236,15 +231,12 @@ $scroll-bar-width: 4px;
padding: 8px;
margin-bottom: 8px;
tab-size: 4;
border-radius: 4px;
border-style: solid;
border-width: 1px;
border-radius: 6px;
overflow-x: auto;
max-width: 100%;
border-color: rgb(224, 224, 224);

code:before {
content: '';
code {
padding: 0px;
}
}
}
Expand Down Expand Up @@ -444,6 +436,12 @@ $scroll-bar-width: 4px;
color: map-get($blue, 'base');
}

code {
background-color: map-get($grey, 'lighten-4');
color: map-get($grey, 'darken-3');
border-color: map-get($grey, 'lighten-2');
}

pre {
background-color: map-get($grey, 'lighten-4');
color: map-get($grey, 'darken-3');
Expand Down Expand Up @@ -537,10 +535,20 @@ $scroll-bar-width: 4px;
a {
color: map-get($blue, 'lighten-2');
}

code {
color: map-get($shades, 'white');
border-color: map-get($grey, 'darken-2');
background-color: map-get($adm-colors, 'secondary2-slightly-transparent');
}
pre {
background-color: map-get($grey, 'darken-4');
color: inherit;
border-color: map-get($grey, 'darken-2');
background-color: map-get($adm-colors, 'secondary2-slightly-transparent');

code {
background-color: transparent;
}
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/assets/styles/generic/_vuetify.scss
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ html {
/**
* Remove icon spacer
*/
.v-list-item__prepend > .v-icon ~ .v-list-item__spacer {
.v-list-item__prepend > .v-icon ~ .v-list-item__spacer,
.v-list-item__prepend > .v-badge ~ .v-list-item__spacer {
width: 0;
}

Expand Down
19 changes: 16 additions & 3 deletions src/components/AChat/AChatForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,16 @@ export default {
showDivider: {
type: Boolean,
default: false
},
/**
* Message validator.
*/
validator: {
type: Function,
required: true
}
},
emits: ['message', 'esc'],
emits: ['message', 'esc', 'error'],
data: () => ({
message: ''
}),
Expand Down Expand Up @@ -118,8 +125,14 @@ export default {
},
methods: {
submitMessage() {
this.$emit('message', this.message)
this.message = ''
const error = this.validator(this.message)
if (error === false) {
this.$emit('message', this.message)
this.message = ''
} else {
this.$emit('error', error)
}
// Fix textarea height to 1 row after miltiline message send
this.calculateInputHeight()
this.focus()
Expand Down
Loading

1 comment on commit eda8de5

@vercel
Copy link

@vercel vercel bot commented on eda8de5 Nov 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

adamant-im – ./

adamant-im-adamant-team.vercel.app
adamant-im-git-master-adamant-team.vercel.app
msg2.adamant.im

Please sign in to comment.