mirror of
https://github.com/anyproto/anytype-ts.git
synced 2025-06-08 05:57:02 +09:00
merge
This commit is contained in:
commit
f98f2e3ab0
20 changed files with 519 additions and 251 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -10,3 +10,4 @@ done.md
|
|||
commands.md
|
||||
.idea
|
||||
tools
|
||||
dist/*.node
|
18
electron.js
18
electron.js
|
@ -15,10 +15,12 @@ const Util = require('./electron/util.js');
|
|||
const windowStateKeeper = require('electron-window-state');
|
||||
const port = process.env.SERVER_PORT;
|
||||
const openAboutWindow = require('about-window').default;
|
||||
const keytar = require('keytar');
|
||||
|
||||
const TIMEOUT_UPDATE = 600 * 1000;
|
||||
const MIN_WIDTH = 980;
|
||||
const MIN_HEIGHT = 640;
|
||||
const KEYTAR_SERVICE = 'Anytype';
|
||||
|
||||
let isUpdating = false;
|
||||
let userPath = app.getPath('userData');
|
||||
|
@ -258,6 +260,22 @@ function createWindow () {
|
|||
send('config', config);
|
||||
});
|
||||
|
||||
ipcMain.on('keytarSet', (e, key, value) => {
|
||||
if (key && value) {
|
||||
keytar.setPassword(KEYTAR_SERVICE, key, value);
|
||||
};
|
||||
});
|
||||
|
||||
ipcMain.on('keytarGet', (e, key) => {
|
||||
keytar.getPassword(KEYTAR_SERVICE, key).then((value) => {
|
||||
send('keytarGet', key, value);
|
||||
});
|
||||
});
|
||||
|
||||
ipcMain.on('keytarDelete', (e, key) => {
|
||||
keytar.deletePassword(KEYTAR_SERVICE, key);
|
||||
});
|
||||
|
||||
ipcMain.on('exit', (e, relaunch) => {
|
||||
exit(relaunch);
|
||||
});
|
||||
|
|
285
package-lock.json
generated
285
package-lock.json
generated
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "anytype2",
|
||||
"version": "0.16.4",
|
||||
"version": "0.16.8",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
@ -2124,8 +2124,7 @@
|
|||
"base64-js": {
|
||||
"version": "1.3.1",
|
||||
"resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz",
|
||||
"integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==",
|
||||
"dev": true
|
||||
"integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g=="
|
||||
},
|
||||
"batch": {
|
||||
"version": "0.6.1",
|
||||
|
@ -2171,6 +2170,37 @@
|
|||
"file-uri-to-path": "1.0.0"
|
||||
}
|
||||
},
|
||||
"bl": {
|
||||
"version": "4.0.3",
|
||||
"resolved": "https://registry.npmjs.org/bl/-/bl-4.0.3.tgz",
|
||||
"integrity": "sha512-fs4G6/Hu4/EE+F75J8DuN/0IpQqNjAdC7aEQv7Qt8MHGUH7Ckv2MwTEEeN9QehD0pfIDkMI1bkHYkKy7xHyKIg==",
|
||||
"requires": {
|
||||
"buffer": "^5.5.0",
|
||||
"inherits": "^2.0.4",
|
||||
"readable-stream": "^3.4.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"buffer": {
|
||||
"version": "5.7.0",
|
||||
"resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.0.tgz",
|
||||
"integrity": "sha512-cd+5r1VLBwUqTrmnzW+D7ABkJUM6mr7uv1dv+6jRw4Rcl7tFIFHDqHPL98LhpGFn3dbAt3gtLxtrWp4m1kFrqg==",
|
||||
"requires": {
|
||||
"base64-js": "^1.3.1",
|
||||
"ieee754": "^1.1.13"
|
||||
}
|
||||
},
|
||||
"readable-stream": {
|
||||
"version": "3.6.0",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
|
||||
"integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==",
|
||||
"requires": {
|
||||
"inherits": "^2.0.3",
|
||||
"string_decoder": "^1.1.1",
|
||||
"util-deprecate": "^1.0.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"block-stream": {
|
||||
"version": "0.0.9",
|
||||
"resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz",
|
||||
|
@ -2810,8 +2840,7 @@
|
|||
"chownr": {
|
||||
"version": "1.1.4",
|
||||
"resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz",
|
||||
"integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==",
|
||||
"dev": true
|
||||
"integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg=="
|
||||
},
|
||||
"chrome-trace-event": {
|
||||
"version": "1.0.2",
|
||||
|
@ -3499,8 +3528,7 @@
|
|||
"deep-extend": {
|
||||
"version": "0.6.0",
|
||||
"resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz",
|
||||
"integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==",
|
||||
"dev": true
|
||||
"integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA=="
|
||||
},
|
||||
"default-gateway": {
|
||||
"version": "4.2.0",
|
||||
|
@ -3631,6 +3659,11 @@
|
|||
"integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=",
|
||||
"dev": true
|
||||
},
|
||||
"detect-libc": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz",
|
||||
"integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups="
|
||||
},
|
||||
"detect-node": {
|
||||
"version": "2.0.4",
|
||||
"resolved": "https://registry.npmjs.org/detect-node/-/detect-node-2.0.4.tgz",
|
||||
|
@ -4252,7 +4285,6 @@
|
|||
"version": "1.4.1",
|
||||
"resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz",
|
||||
"integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"once": "^1.4.0"
|
||||
}
|
||||
|
@ -4501,6 +4533,11 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"expand-template": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz",
|
||||
"integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg=="
|
||||
},
|
||||
"expand-tilde": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz",
|
||||
|
@ -4961,6 +4998,11 @@
|
|||
"resolved": "https://registry.npmjs.org/fs/-/fs-0.0.1-security.tgz",
|
||||
"integrity": "sha1-invTcYa23d84E/I4WLV+yq9eQdQ="
|
||||
},
|
||||
"fs-constants": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz",
|
||||
"integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow=="
|
||||
},
|
||||
"fs-extra": {
|
||||
"version": "8.1.0",
|
||||
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz",
|
||||
|
@ -5636,6 +5678,11 @@
|
|||
"integrity": "sha512-vW/9dBahGbpKPcccy3xKkHgdWoH/cAPPc3lQw+3edl7b4j29JfNGVrja0a1d8ZoRe4nTN8GCPrF9aBErDnzx5Q==",
|
||||
"dev": true
|
||||
},
|
||||
"github-from-package": {
|
||||
"version": "0.0.0",
|
||||
"resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz",
|
||||
"integrity": "sha1-l/tdlr/eiXMxPyDoKI75oWf6ZM4="
|
||||
},
|
||||
"glob": {
|
||||
"version": "7.1.4",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz",
|
||||
|
@ -6240,8 +6287,7 @@
|
|||
"ieee754": {
|
||||
"version": "1.1.13",
|
||||
"resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz",
|
||||
"integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==",
|
||||
"dev": true
|
||||
"integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg=="
|
||||
},
|
||||
"ifdef-loader": {
|
||||
"version": "2.1.5",
|
||||
|
@ -6330,8 +6376,7 @@
|
|||
"ini": {
|
||||
"version": "1.3.5",
|
||||
"resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz",
|
||||
"integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==",
|
||||
"dev": true
|
||||
"integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw=="
|
||||
},
|
||||
"inputmask": {
|
||||
"version": "5.0.5",
|
||||
|
@ -6842,6 +6887,15 @@
|
|||
"set-immediate-shim": "~1.0.1"
|
||||
}
|
||||
},
|
||||
"keytar": {
|
||||
"version": "7.0.0",
|
||||
"resolved": "https://registry.npmjs.org/keytar/-/keytar-7.0.0.tgz",
|
||||
"integrity": "sha512-uvmdb5ZE2NgegcUDrmhutI9BUh+bTbt8+bwPliOMiLiWmrV76Tfg6DyI7Ud903a/4xlkJpKGnR0TyRpRyFOc3A==",
|
||||
"requires": {
|
||||
"node-addon-api": "^3.0.0",
|
||||
"prebuild-install": "5.3.5"
|
||||
}
|
||||
},
|
||||
"keyv": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/keyv/-/keyv-3.1.0.tgz",
|
||||
|
@ -7310,6 +7364,11 @@
|
|||
"minimist": "^1.2.5"
|
||||
}
|
||||
},
|
||||
"mkdirp-classic": {
|
||||
"version": "0.5.3",
|
||||
"resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz",
|
||||
"integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A=="
|
||||
},
|
||||
"mobx": {
|
||||
"version": "5.15.7",
|
||||
"resolved": "https://registry.npmjs.org/mobx/-/mobx-5.15.7.tgz",
|
||||
|
@ -7427,6 +7486,11 @@
|
|||
"to-regex": "^3.0.1"
|
||||
}
|
||||
},
|
||||
"napi-build-utils": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz",
|
||||
"integrity": "sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg=="
|
||||
},
|
||||
"negotiator": {
|
||||
"version": "0.6.2",
|
||||
"resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz",
|
||||
|
@ -7453,6 +7517,19 @@
|
|||
"resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz",
|
||||
"integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ=="
|
||||
},
|
||||
"node-abi": {
|
||||
"version": "2.19.1",
|
||||
"resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.19.1.tgz",
|
||||
"integrity": "sha512-HbtmIuByq44yhAzK7b9j/FelKlHYISKQn0mtvcBrU5QBkhoCMp5bu8Hv5AI34DcKfOAcJBcOEMwLlwO62FFu9A==",
|
||||
"requires": {
|
||||
"semver": "^5.4.1"
|
||||
}
|
||||
},
|
||||
"node-addon-api": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-3.0.2.tgz",
|
||||
"integrity": "sha512-+D4s2HCnxPd5PjjI0STKwncjXTUKKqm74MDMz9OPXavjsGmjkvwgLtA5yoxJUdmpj52+2u+RrXgPipahKczMKg=="
|
||||
},
|
||||
"node-fetch": {
|
||||
"version": "1.7.3",
|
||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.7.3.tgz",
|
||||
|
@ -7533,6 +7610,76 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"node-loader": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/node-loader/-/node-loader-1.0.2.tgz",
|
||||
"integrity": "sha512-myxAxpyMR7knjA4Uzwf3gjxaMtxSWj2vpm9o6AYWWxQ1S3XMBNeG2vzYcp/5eW03cBGfgSxyP+wntP8qhBJNhQ==",
|
||||
"requires": {
|
||||
"loader-utils": "^2.0.0",
|
||||
"schema-utils": "^3.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/json-schema": {
|
||||
"version": "7.0.6",
|
||||
"resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.6.tgz",
|
||||
"integrity": "sha512-3c+yGKvVP5Y9TYBEibGNR+kLtijnj7mYrXRg+WpFb2X9xm04g/DXYkfg4hmzJQosc9snFNUPkbYIhu+KAm6jJw=="
|
||||
},
|
||||
"ajv": {
|
||||
"version": "6.12.6",
|
||||
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
|
||||
"integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==",
|
||||
"requires": {
|
||||
"fast-deep-equal": "^3.1.1",
|
||||
"fast-json-stable-stringify": "^2.0.0",
|
||||
"json-schema-traverse": "^0.4.1",
|
||||
"uri-js": "^4.2.2"
|
||||
}
|
||||
},
|
||||
"ajv-keywords": {
|
||||
"version": "3.5.2",
|
||||
"resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz",
|
||||
"integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ=="
|
||||
},
|
||||
"emojis-list": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz",
|
||||
"integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q=="
|
||||
},
|
||||
"fast-deep-equal": {
|
||||
"version": "3.1.3",
|
||||
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
|
||||
"integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q=="
|
||||
},
|
||||
"json5": {
|
||||
"version": "2.1.3",
|
||||
"resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz",
|
||||
"integrity": "sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==",
|
||||
"requires": {
|
||||
"minimist": "^1.2.5"
|
||||
}
|
||||
},
|
||||
"loader-utils": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz",
|
||||
"integrity": "sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==",
|
||||
"requires": {
|
||||
"big.js": "^5.2.2",
|
||||
"emojis-list": "^3.0.0",
|
||||
"json5": "^2.1.2"
|
||||
}
|
||||
},
|
||||
"schema-utils": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.0.0.tgz",
|
||||
"integrity": "sha512-6D82/xSzO094ajanoOSbe4YvXWMfn2A//8Y1+MUqFAJul5Bs+yn36xbK9OtNDcRVSBJ9jjeoXftM6CfztsjOAA==",
|
||||
"requires": {
|
||||
"@types/json-schema": "^7.0.6",
|
||||
"ajv": "^6.12.5",
|
||||
"ajv-keywords": "^3.5.2"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"node-sass": {
|
||||
"version": "4.14.1",
|
||||
"resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.14.1.tgz",
|
||||
|
@ -7595,6 +7742,11 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"noop-logger": {
|
||||
"version": "0.1.1",
|
||||
"resolved": "https://registry.npmjs.org/noop-logger/-/noop-logger-0.1.1.tgz",
|
||||
"integrity": "sha1-lKKxYzxPExdVMAfYlm/Q6EG2pMI="
|
||||
},
|
||||
"nopt": {
|
||||
"version": "3.0.6",
|
||||
"resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz",
|
||||
|
@ -11435,6 +11587,28 @@
|
|||
"resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.1.0.tgz",
|
||||
"integrity": "sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ=="
|
||||
},
|
||||
"prebuild-install": {
|
||||
"version": "5.3.5",
|
||||
"resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-5.3.5.tgz",
|
||||
"integrity": "sha512-YmMO7dph9CYKi5IR/BzjOJlRzpxGGVo1EsLSUZ0mt/Mq0HWZIHOKHHcHdT69yG54C9m6i45GpItwRHpk0Py7Uw==",
|
||||
"requires": {
|
||||
"detect-libc": "^1.0.3",
|
||||
"expand-template": "^2.0.3",
|
||||
"github-from-package": "0.0.0",
|
||||
"minimist": "^1.2.3",
|
||||
"mkdirp": "^0.5.1",
|
||||
"napi-build-utils": "^1.0.1",
|
||||
"node-abi": "^2.7.0",
|
||||
"noop-logger": "^0.1.1",
|
||||
"npmlog": "^4.0.1",
|
||||
"pump": "^3.0.0",
|
||||
"rc": "^1.2.7",
|
||||
"simple-get": "^3.0.3",
|
||||
"tar-fs": "^2.0.0",
|
||||
"tunnel-agent": "^0.6.0",
|
||||
"which-pm-runs": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"prepend-http": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz",
|
||||
|
@ -11595,7 +11769,6 @@
|
|||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz",
|
||||
"integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"end-of-stream": "^1.1.0",
|
||||
"once": "^1.3.1"
|
||||
|
@ -11737,7 +11910,6 @@
|
|||
"version": "1.2.8",
|
||||
"resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz",
|
||||
"integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"deep-extend": "^0.6.0",
|
||||
"ini": "~1.3.0",
|
||||
|
@ -12954,6 +13126,36 @@
|
|||
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz",
|
||||
"integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0="
|
||||
},
|
||||
"simple-concat": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz",
|
||||
"integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q=="
|
||||
},
|
||||
"simple-get": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/simple-get/-/simple-get-3.1.0.tgz",
|
||||
"integrity": "sha512-bCR6cP+aTdScaQCnQKbPKtJOKDp/hj9EDLJo3Nw4y1QksqaovlW/bnptB6/c1e+qmNIDHRK+oXFDdEqBT8WzUA==",
|
||||
"requires": {
|
||||
"decompress-response": "^4.2.0",
|
||||
"once": "^1.3.1",
|
||||
"simple-concat": "^1.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"decompress-response": {
|
||||
"version": "4.2.1",
|
||||
"resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-4.2.1.tgz",
|
||||
"integrity": "sha512-jOSne2qbyE+/r8G1VU+G/82LBs2Fs4LAsTiLSHOCOMZQl2OKZ6i8i4IyHemTe+/yIXOtTcRQMzPcgyhoFlqPkw==",
|
||||
"requires": {
|
||||
"mimic-response": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"mimic-response": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-2.1.0.tgz",
|
||||
"integrity": "sha512-wXqjST+SLt7R009ySCglWBCFpjUygmCIfD790/kVbiGmUgfYGuB14PiTd5DwVxSV4NcYHjzMkoj5LjQZwTQLEA=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"snapdragon": {
|
||||
"version": "0.8.2",
|
||||
"resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz",
|
||||
|
@ -13713,8 +13915,7 @@
|
|||
"strip-json-comments": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz",
|
||||
"integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=",
|
||||
"dev": true
|
||||
"integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo="
|
||||
},
|
||||
"style-loader": {
|
||||
"version": "1.3.0",
|
||||
|
@ -13844,6 +14045,41 @@
|
|||
"inherits": "2"
|
||||
}
|
||||
},
|
||||
"tar-fs": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.0.tgz",
|
||||
"integrity": "sha512-9uW5iDvrIMCVpvasdFHW0wJPez0K4JnMZtsuIeDI7HyMGJNxmDZDOCQROr7lXyS+iL/QMpj07qcjGYTSdRFXUg==",
|
||||
"requires": {
|
||||
"chownr": "^1.1.1",
|
||||
"mkdirp-classic": "^0.5.2",
|
||||
"pump": "^3.0.0",
|
||||
"tar-stream": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"tar-stream": {
|
||||
"version": "2.1.4",
|
||||
"resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.1.4.tgz",
|
||||
"integrity": "sha512-o3pS2zlG4gxr67GmFYBLlq+dM8gyRGUOvsrHclSkvtVtQbjV0s/+ZE8OpICbaj8clrX3tjeHngYGP7rweaBnuw==",
|
||||
"requires": {
|
||||
"bl": "^4.0.3",
|
||||
"end-of-stream": "^1.4.1",
|
||||
"fs-constants": "^1.0.0",
|
||||
"inherits": "^2.0.3",
|
||||
"readable-stream": "^3.1.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"readable-stream": {
|
||||
"version": "3.6.0",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
|
||||
"integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==",
|
||||
"requires": {
|
||||
"inherits": "^2.0.3",
|
||||
"string_decoder": "^1.1.1",
|
||||
"util-deprecate": "^1.0.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"temp-file": {
|
||||
"version": "3.3.4",
|
||||
"resolved": "https://registry.npmjs.org/temp-file/-/temp-file-3.3.4.tgz",
|
||||
|
@ -14650,9 +14886,9 @@
|
|||
"integrity": "sha512-FOmRr+FmWEIG8uhZv6C2bTgEVXsHk08kE7mPlrBbEe+c3r9pjceVPgupIfNIhc4yx55H69OXANrUaSuu9eInKg=="
|
||||
},
|
||||
"v8-compile-cache": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.1.1.tgz",
|
||||
"integrity": "sha512-8OQ9CL+VWyt3JStj7HX7/ciTL2V3Rl1Wf5OL+SNTm0yK1KvtReVulksyeRnCANHHuUxHlQig+JJDlUhBt1NQDQ==",
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.2.0.tgz",
|
||||
"integrity": "sha512-gTpR5XQNKFwOd4clxfnhaqvfqMpqEwr4tOtCyz4MtYZX2JYhfr1JvBFKdS+7K/9rfpZR3VLX+YWBbKoxCgS43Q==",
|
||||
"dev": true
|
||||
},
|
||||
"validate-npm-package-license": {
|
||||
|
@ -15187,9 +15423,9 @@
|
|||
"dev": true
|
||||
},
|
||||
"enhanced-resolve": {
|
||||
"version": "4.2.0",
|
||||
"resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.2.0.tgz",
|
||||
"integrity": "sha512-S7eiFb/erugyd1rLb6mQ3Vuq+EXHv5cpCkNqqIkYkBgN2QdFnyCZzFBleqwGEx4lgNGYij81BWnCrFNK7vxvjQ==",
|
||||
"version": "4.3.0",
|
||||
"resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.3.0.tgz",
|
||||
"integrity": "sha512-3e87LvavsdxyoCfGusJnrZ5G8SLPOFeHSNpZI/ATL9a5leXo2k0w6MKnbqhdBad9qTobSfB20Ld7UmgoNbAZkQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"graceful-fs": "^4.1.2",
|
||||
|
@ -15423,6 +15659,11 @@
|
|||
"resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz",
|
||||
"integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho="
|
||||
},
|
||||
"which-pm-runs": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.0.0.tgz",
|
||||
"integrity": "sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs="
|
||||
},
|
||||
"wide-align": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "anytype2",
|
||||
"version": "0.16.4",
|
||||
"version": "0.16.8",
|
||||
"description": "Anytype",
|
||||
"main": "electron.js",
|
||||
"scripts": {
|
||||
|
@ -104,6 +104,7 @@
|
|||
"install": "^0.13.0",
|
||||
"is": "^3.3.0",
|
||||
"jquery": "^3.5.1",
|
||||
"keytar": "^7.0.0",
|
||||
"lazy-val": "^1.0.4",
|
||||
"linebyline": "^1.3.0",
|
||||
"lodash": "^4.17.20",
|
||||
|
@ -115,6 +116,7 @@
|
|||
"mobx-logger": "^0.7.1",
|
||||
"mobx-react": "^6.3.1",
|
||||
"mobx-state-tree": "^3.17.2",
|
||||
"node-loader": "^1.0.2",
|
||||
"node-sass": "^4.14.1",
|
||||
"npm": "^6.14.8",
|
||||
"npm-run-all": "^4.1.5",
|
||||
|
@ -227,6 +229,7 @@
|
|||
"node_modules/is-plain-obj",
|
||||
"node_modules/js-yaml",
|
||||
"node_modules/jsonfile",
|
||||
"node_modules/keytar",
|
||||
"node_modules/lazy-val",
|
||||
"node_modules/lockfile",
|
||||
"node_modules/lodash",
|
||||
|
|
|
@ -62,7 +62,10 @@ body.platformWindows {
|
|||
|
||||
.header { top: 30px !important; }
|
||||
.header {
|
||||
.logo { width: 20px; height: 20px; left: 16px; margin: 0px; top: 9px; background-image: url('~img/logoSmall.svg'); }
|
||||
.icon.logo {
|
||||
width: 40px !important; height: 28px !important; background-size: 20px 20px !important; left: 6px; margin: 0px; top: 5px;
|
||||
background-image: url('~img/logoSmall.svg');
|
||||
}
|
||||
}
|
||||
|
||||
.pageMainEdit .wrapper { padding-top: 68px; }
|
||||
|
|
|
@ -296,21 +296,35 @@ class App extends React.Component<Props, State> {
|
|||
};
|
||||
|
||||
setIpcEvents () {
|
||||
const phrase = Storage.get('phrase');
|
||||
const accountId = Storage.get('accountId');
|
||||
const html = $('html');
|
||||
const phrase = Storage.get('phrase');
|
||||
|
||||
ipcRenderer.send('appLoaded', true);
|
||||
ipcRenderer.send('keytarGet', 'phrase');
|
||||
|
||||
ipcRenderer.on('keytarGet', (e: any, key: string, value: string) => {
|
||||
if ((key == 'phrase') && accountId) {
|
||||
if (!value) {
|
||||
if (phrase) {
|
||||
value = phrase;
|
||||
ipcRenderer.send('keytarSet', 'phrase', phrase);
|
||||
Storage.delete('phrase');
|
||||
} else {
|
||||
return;
|
||||
};
|
||||
};
|
||||
|
||||
authStore.phraseSet(value);
|
||||
history.push('/auth/setup/init');
|
||||
};
|
||||
});
|
||||
|
||||
ipcRenderer.on('dataPath', (e: any, dataPath: string) => {
|
||||
authStore.pathSet(dataPath);
|
||||
|
||||
this.setState({ loading: false });
|
||||
this.preload();
|
||||
|
||||
if (phrase && accountId) {
|
||||
history.push('/auth/setup/init');
|
||||
};
|
||||
});
|
||||
|
||||
ipcRenderer.on('route', (e: any, route: string) => {
|
||||
|
|
|
@ -18,6 +18,7 @@ interface Props extends I.BlockComponent, RouteComponentProps<any> {
|
|||
const { ipcRenderer } = window.require('electron');
|
||||
const Constant = require('json/constant.json');
|
||||
const $ = require('jquery');
|
||||
const raf = require('raf');
|
||||
|
||||
// Prism languages
|
||||
const langs = [
|
||||
|
@ -527,7 +528,7 @@ class BlockText extends React.Component<Props, {}> {
|
|||
focus.set(message.blockId, { from: 0, to: 0 });
|
||||
focus.apply();
|
||||
};
|
||||
let symbolBefore = value[range.from - 1];
|
||||
let symbolBefore = range ? value[range.from - 1] : '';
|
||||
|
||||
if (commonStore.menuIsOpen('blockAdd')) {
|
||||
if (k == Key.space) {
|
||||
|
@ -876,19 +877,11 @@ class BlockText extends React.Component<Props, {}> {
|
|||
const { range } = focus;
|
||||
const currentFrom = range.from;
|
||||
const currentTo = range.to;
|
||||
|
||||
if (!currentTo || (currentFrom == currentTo)) {
|
||||
commonStore.menuClose('blockContext');
|
||||
};
|
||||
|
||||
if (!currentTo || (currentFrom == currentTo) || (from == currentFrom && to == currentTo)) {
|
||||
|
||||
if (!currentTo || (currentFrom == currentTo) || (from == currentFrom && to == currentTo) || block.isTextTitle()) {
|
||||
return;
|
||||
};
|
||||
|
||||
if (block.isTextTitle()) {
|
||||
return;
|
||||
};
|
||||
|
||||
const el = $('#block-' + id);
|
||||
const offset = el.offset();
|
||||
const rect = Util.selectionRect();
|
||||
|
@ -911,16 +904,18 @@ class BlockText extends React.Component<Props, {}> {
|
|||
passThrough: true,
|
||||
data: {
|
||||
blockId: id,
|
||||
blockIds: DataUtil.selectionGet(id, true, this.props),
|
||||
blockIds: [ id ],
|
||||
rootId: rootId,
|
||||
dataset: dataset,
|
||||
range: { from: currentFrom, to: currentTo },
|
||||
onChange: (marks: I.Mark[]) => {
|
||||
this.marks = Util.objectCopy(marks);
|
||||
this.marks = marks;
|
||||
this.setMarks(marks);
|
||||
|
||||
focus.set(id, { from: currentFrom, to: currentTo });
|
||||
focus.apply();
|
||||
raf(() => {
|
||||
focus.set(id, { from: currentFrom, to: currentTo });
|
||||
focus.apply();
|
||||
});
|
||||
},
|
||||
},
|
||||
});
|
||||
|
|
|
@ -100,6 +100,7 @@ class DragProvider extends React.Component<Props, {}> {
|
|||
};
|
||||
|
||||
this.objectData.set(key, {
|
||||
...data,
|
||||
obj: item,
|
||||
index: i,
|
||||
width: w,
|
||||
|
@ -108,7 +109,6 @@ class DragProvider extends React.Component<Props, {}> {
|
|||
y: y,
|
||||
isTargetTop: isTargetTop,
|
||||
isTargetBot: isTargetBot,
|
||||
...data
|
||||
});
|
||||
});
|
||||
};
|
||||
|
@ -137,7 +137,7 @@ class DragProvider extends React.Component<Props, {}> {
|
|||
C.ExternalDropFiles(rootId, targetId, this.position, paths);
|
||||
} else
|
||||
if (this.hoverData && this.canDrop && (this.position != I.BlockPosition.None)) {
|
||||
this.onDrop (e, data.dropType, data.rootId, targetId, this.position);
|
||||
this.onDrop(e, data.dropType, data.rootId, targetId, this.position);
|
||||
};
|
||||
|
||||
this.clear();
|
||||
|
@ -230,7 +230,8 @@ class DragProvider extends React.Component<Props, {}> {
|
|||
};
|
||||
};
|
||||
|
||||
let { type, style, x, y, width, height } = this.hoverData;
|
||||
let { x, y, width, height } = this.hoverData;
|
||||
let { type, style } = $(this.hoverData.obj).data();
|
||||
let col1 = x - Constant.size.blockMenu / 4;
|
||||
let col2 = x + 28;
|
||||
let col3 = x + width - 28;
|
||||
|
|
|
@ -237,7 +237,8 @@ class MenuBlockAction extends React.Component<Props, State> {
|
|||
},
|
||||
];
|
||||
|
||||
let hasTurn = true;
|
||||
let hasTurnText = true;
|
||||
let hasTurnDiv = true;
|
||||
let hasFile = true;
|
||||
let hasTitle = false;
|
||||
let hasAlign = true;
|
||||
|
@ -246,7 +247,12 @@ class MenuBlockAction extends React.Component<Props, State> {
|
|||
|
||||
for (let id of blockIds) {
|
||||
const block = blockStore.getLeaf(rootId, id);
|
||||
if (!block.canTurnText()) hasTurn = false;
|
||||
if (!block.canTurnText() || block.isDiv()) {
|
||||
hasTurnText = false;
|
||||
};
|
||||
if (block.canTurnText() || !block.isDiv()) {
|
||||
hasTurnDiv = false;
|
||||
};
|
||||
if (!block.isFile()) hasFile = false;
|
||||
if (!block.canHaveAlign()) hasAlign = false;
|
||||
if (!block.canHaveColor()) hasColor = false;
|
||||
|
@ -255,7 +261,7 @@ class MenuBlockAction extends React.Component<Props, State> {
|
|||
if (block.isTextTitle()) hasTitle = true;
|
||||
};
|
||||
|
||||
if (hasTurn) {
|
||||
if (hasTurnText || hasTurnDiv) {
|
||||
sections[0].children.push({ id: 'turn', icon: 'turn', name: 'Turn into', arrow: true });
|
||||
};
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ class MenuBlockContext extends React.Component<Props, {}> {
|
|||
<div className="flex" onClick={this.onMenuClick}>
|
||||
{block.canTurn() ? (
|
||||
<div className="section">
|
||||
<Icon id={'button-' + blockId + '-switch'} arrow={true} tooltip="Switch style" menuId="blockStyle" className={[ icon, 'blockStyle' ].join(' ')} onClick={(e: any) => { this.onMark(e, 'style'); }} />
|
||||
<Icon id={'button-' + blockId + '-style'} arrow={true} tooltip="Switch style" menuId="blockStyle" className={[ icon, 'blockStyle' ].join(' ')} onClick={(e: any) => { this.onMark(e, 'style'); }} />
|
||||
</div>
|
||||
) : ''}
|
||||
|
||||
|
@ -83,8 +83,8 @@ class MenuBlockContext extends React.Component<Props, {}> {
|
|||
|
||||
{block.canHaveMarks() ? (
|
||||
<div className="section">
|
||||
<Icon id={'button-' + blockId + '-color'} menuId="blockColor" className="color" inner={color} tooltip="Сolor" onClick={(e: any) => { this.onMark(e, I.MarkType.TextColor); }} />
|
||||
<Icon id={'button-' + blockId + '-background'} menuId="blockBackground" className="color" inner={background} tooltip="Background" onClick={(e: any) => { this.onMark(e, I.MarkType.BgColor); }} />
|
||||
<Icon id={'button-' + blockId + '-color'} menuId="blockColor" className="color" inner={color} tooltip="Сolor" onClick={(e: any) => { this.onMark(e, 'color'); }} />
|
||||
<Icon id={'button-' + blockId + '-background'} menuId="blockBackground" className="color" inner={background} tooltip="Background" onClick={(e: any) => { this.onMark(e, 'background'); }} />
|
||||
</div>
|
||||
) : ''}
|
||||
|
||||
|
@ -97,6 +97,9 @@ class MenuBlockContext extends React.Component<Props, {}> {
|
|||
};
|
||||
|
||||
onMark (e: any, type: any) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
||||
const { param, close } = this.props;
|
||||
const { data } = param;
|
||||
const { blockId, blockIds, rootId, onChange, dataset, range } = data;
|
||||
|
@ -110,203 +113,152 @@ class MenuBlockContext extends React.Component<Props, {}> {
|
|||
const { content } = block;
|
||||
const node = $(ReactDOM.findDOMNode(this));
|
||||
const obj = $('#menuBlockContext');
|
||||
|
||||
|
||||
focus.set(blockId, range);
|
||||
focus.apply();
|
||||
|
||||
let { marks } = content;
|
||||
let marks = Util.objectCopy(content.marks);
|
||||
let mark: any = null;
|
||||
let isOpen = false;
|
||||
|
||||
if ((type == 'style') && commonStore.menuIsOpen('blockStyle')) {
|
||||
isOpen = true;
|
||||
let menuId = '';
|
||||
let menuParam = {
|
||||
element: '#button-' + blockId + '-' + type,
|
||||
type: I.MenuType.Vertical,
|
||||
offsetX: 0,
|
||||
offsetY: 15,
|
||||
vertical: I.MenuDirection.Bottom,
|
||||
horizontal: I.MenuDirection.Center,
|
||||
data: {
|
||||
rootId: rootId,
|
||||
blockId: blockId,
|
||||
blockIds: blockIds,
|
||||
dataset: dataset,
|
||||
} as any,
|
||||
};
|
||||
|
||||
if ((type == 'more') && commonStore.menuIsOpen('blockMore')) {
|
||||
isOpen = true;
|
||||
};
|
||||
|
||||
if ((type == I.MarkType.TextColor) && commonStore.menuIsOpen('blockColor')) {
|
||||
isOpen = true;
|
||||
};
|
||||
|
||||
commonStore.menuClose('blockStyle');
|
||||
commonStore.menuClose('blockMore');
|
||||
commonStore.menuClose('blockLink');
|
||||
commonStore.menuClose('blockColor');
|
||||
commonStore.menuClose('blockBackground');
|
||||
commonStore.menuClose('select');
|
||||
|
||||
window.clearTimeout(this.timeout);
|
||||
this.timeout = window.setTimeout(() => {
|
||||
switch (type) {
|
||||
|
||||
switch (type) {
|
||||
default:
|
||||
marks = Mark.toggle(marks, { type: type, param: '', range: { from: from, to: to } });
|
||||
onChange(marks);
|
||||
break;
|
||||
|
||||
default:
|
||||
marks = Mark.toggle(marks, { type: type, param: '', range: { from: from, to: to } });
|
||||
onChange(marks);
|
||||
break;
|
||||
|
||||
case 'style':
|
||||
if (isOpen) {
|
||||
break;
|
||||
};
|
||||
|
||||
focus.clear(false);
|
||||
commonStore.menuOpen('blockStyle', {
|
||||
element: '#button-' + blockId + '-switch',
|
||||
type: I.MenuType.Vertical,
|
||||
offsetX: 0,
|
||||
offsetY: 15,
|
||||
vertical: I.MenuDirection.Bottom,
|
||||
horizontal: I.MenuDirection.Center,
|
||||
data: {
|
||||
rootId: rootId,
|
||||
blockId: blockId,
|
||||
dataset: dataset,
|
||||
onSelect: (item: any) => {
|
||||
if (item.type == I.BlockType.Text) {
|
||||
C.BlockListTurnInto(rootId, blockIds, item.key, (message: any) => {
|
||||
focus.set(message.blockId, { from: length, to: length });
|
||||
focus.apply();
|
||||
});
|
||||
};
|
||||
|
||||
if (item.type == I.BlockType.Div) {
|
||||
C.BlockListSetDivStyle(rootId, blockIds, item.key, (message: any) => {
|
||||
focus.set(message.blockId, { from: 0, to: 0 });
|
||||
focus.apply();
|
||||
});
|
||||
};
|
||||
|
||||
if (item.type == I.BlockType.Page) {
|
||||
C.BlockListConvertChildrenToPages(rootId, blockIds);
|
||||
};
|
||||
|
||||
close();
|
||||
},
|
||||
}
|
||||
});
|
||||
break;
|
||||
|
||||
case 'more':
|
||||
if (isOpen) {
|
||||
break;
|
||||
};
|
||||
|
||||
commonStore.menuOpen('blockMore', {
|
||||
element: '#button-' + blockId + '-more',
|
||||
type: I.MenuType.Vertical,
|
||||
offsetX: 0,
|
||||
offsetY: 15,
|
||||
vertical: I.MenuDirection.Bottom,
|
||||
horizontal: I.MenuDirection.Center,
|
||||
data: {
|
||||
rootId: rootId,
|
||||
blockId: blockId,
|
||||
blockIds: blockIds,
|
||||
onSelect: (item: any) => {
|
||||
close();
|
||||
},
|
||||
}
|
||||
});
|
||||
break;
|
||||
|
||||
case I.MarkType.Link:
|
||||
const offset = obj.offset();
|
||||
mark = Mark.getInRange(marks, type, { from: from, to: to });
|
||||
case 'style':
|
||||
focus.clear(false);
|
||||
menuParam.data = Object.assign(menuParam.data, {
|
||||
onSelect: (item: any) => {
|
||||
if (item.type == I.BlockType.Text) {
|
||||
C.BlockListTurnInto(rootId, blockIds, item.key, (message: any) => {
|
||||
focus.set(message.blockId, { from: length, to: length });
|
||||
focus.apply();
|
||||
});
|
||||
};
|
||||
|
||||
if (item.type == I.BlockType.Div) {
|
||||
C.BlockListSetDivStyle(rootId, blockIds, item.key, (message: any) => {
|
||||
focus.set(message.blockId, { from: 0, to: 0 });
|
||||
focus.apply();
|
||||
});
|
||||
};
|
||||
|
||||
if (item.type == I.BlockType.Page) {
|
||||
C.BlockListConvertChildrenToPages(rootId, blockIds);
|
||||
};
|
||||
|
||||
close();
|
||||
},
|
||||
});
|
||||
|
||||
commonStore.menuClose(this.props.id, () => {
|
||||
commonStore.menuOpen('blockLink', {
|
||||
type: I.MenuType.Horizontal,
|
||||
element: node,
|
||||
offsetX: 0,
|
||||
offsetY: 0,
|
||||
forceX: offset.left,
|
||||
forceY: offset.top,
|
||||
vertical: I.MenuDirection.Top,
|
||||
horizontal: I.MenuDirection.Center,
|
||||
data: {
|
||||
value: (mark ? mark.param : ''),
|
||||
onChange: (param: string) => {
|
||||
if (!mark && !param) {
|
||||
return;
|
||||
};
|
||||
menuId = 'blockStyle';
|
||||
break;
|
||||
|
||||
case 'more':
|
||||
menuParam.data = Object.assign(menuParam.data, {
|
||||
onSelect: (item: any) => {
|
||||
close();
|
||||
},
|
||||
});
|
||||
|
||||
marks = Mark.toggle(marks, { type: type, param: param, range: { from: from, to: to } });
|
||||
onChange(marks);
|
||||
window.setTimeout(() => { focus.apply(); }, 15);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
break;
|
||||
|
||||
case I.MarkType.TextColor:
|
||||
if (isOpen) {
|
||||
break;
|
||||
};
|
||||
|
||||
mark = Mark.getInRange(marks, I.MarkType.TextColor, { from: from, to: to });
|
||||
|
||||
commonStore.menuOpen('blockColor', {
|
||||
element: '#button-' + blockId + '-color',
|
||||
type: I.MenuType.Vertical,
|
||||
offsetX: 0,
|
||||
offsetY: 15,
|
||||
vertical: I.MenuDirection.Bottom,
|
||||
horizontal: I.MenuDirection.Center,
|
||||
data: {
|
||||
rootId: rootId,
|
||||
blockId: blockId,
|
||||
blockIds: blockIds,
|
||||
value: (mark ? mark.param : ''),
|
||||
onChange: (param: string) => {
|
||||
if (!mark && !param) {
|
||||
return;
|
||||
};
|
||||
menuId = 'blockMore';
|
||||
break;
|
||||
|
||||
case I.MarkType.Link:
|
||||
const offset = obj.offset();
|
||||
mark = Mark.getInRange(marks, type, { from: from, to: to });
|
||||
commonStore.menuClose(this.props.id);
|
||||
|
||||
marks = Mark.toggle(marks, { type: I.MarkType.TextColor, param: param, range: { from: from, to: to } });
|
||||
onChange(marks);
|
||||
close();
|
||||
}
|
||||
},
|
||||
});
|
||||
break;
|
||||
|
||||
case I.MarkType.BgColor:
|
||||
if (isOpen) {
|
||||
break;
|
||||
};
|
||||
|
||||
mark = Mark.getInRange(marks, I.MarkType.BgColor, { from: from, to: to });
|
||||
|
||||
commonStore.menuOpen('blockBackground', {
|
||||
element: '#button-' + blockId + '-background',
|
||||
type: I.MenuType.Vertical,
|
||||
offsetX: 0,
|
||||
offsetY: 15,
|
||||
vertical: I.MenuDirection.Bottom,
|
||||
horizontal: I.MenuDirection.Center,
|
||||
data: {
|
||||
rootId: rootId,
|
||||
blockId: blockId,
|
||||
blockIds: blockIds,
|
||||
value: (mark ? mark.param : ''),
|
||||
onChange: (param: string) => {
|
||||
if (!mark && !param) {
|
||||
return;
|
||||
};
|
||||
menuParam = Object.assign(menuParam, {
|
||||
type: I.MenuType.Horizontal,
|
||||
element: node,
|
||||
offsetX: 0,
|
||||
offsetY: 0,
|
||||
forceX: offset.left,
|
||||
forceY: offset.top,
|
||||
vertical: I.MenuDirection.Top,
|
||||
horizontal: I.MenuDirection.Center,
|
||||
});
|
||||
menuParam.data = Object.assign(menuParam.data, {
|
||||
value: (mark ? mark.param : ''),
|
||||
onChange: (param: string) => {
|
||||
if (!mark && !param) {
|
||||
return;
|
||||
};
|
||||
|
||||
marks = Mark.toggle(marks, { type: I.MarkType.BgColor, param: param, range: { from: from, to: to } });
|
||||
onChange(marks);
|
||||
close();
|
||||
},
|
||||
},
|
||||
});
|
||||
break;
|
||||
};
|
||||
}, Constant.delay.menu);
|
||||
marks = Mark.toggle(marks, { type: type, param: param, range: { from: from, to: to } });
|
||||
onChange(marks);
|
||||
window.setTimeout(() => { focus.apply(); }, 15);
|
||||
}
|
||||
});
|
||||
|
||||
menuId = 'blockLink';
|
||||
break;
|
||||
|
||||
case 'color':
|
||||
mark = Mark.getInRange(marks, I.MarkType.TextColor, { from: from, to: to });
|
||||
menuParam.data = Object.assign(menuParam.data, {
|
||||
value: (mark ? mark.param : ''),
|
||||
onChange: (param: string) => {
|
||||
if (!mark && !param) {
|
||||
return;
|
||||
};
|
||||
|
||||
marks = Mark.toggle(marks, { type: I.MarkType.TextColor, param: param, range: { from: from, to: to } });
|
||||
onChange(marks);
|
||||
},
|
||||
});
|
||||
|
||||
menuId = 'blockColor';
|
||||
break;
|
||||
|
||||
case 'background':
|
||||
mark = Mark.getInRange(marks, I.MarkType.BgColor, { from: from, to: to });
|
||||
menuParam.data = Object.assign(menuParam.data, {
|
||||
value: (mark ? mark.param : ''),
|
||||
onChange: (param: string) => {
|
||||
if (!mark && !param) {
|
||||
return;
|
||||
};
|
||||
|
||||
marks = Mark.toggle(marks, { type: I.MarkType.BgColor, param: param, range: { from: from, to: to } });
|
||||
onChange(marks);
|
||||
},
|
||||
});
|
||||
menuId = 'blockBackground';
|
||||
break;
|
||||
};
|
||||
|
||||
if (menuId && !commonStore.menuIsOpen(menuId)) {
|
||||
commonStore.menuClose('blockStyle');
|
||||
commonStore.menuClose('blockMore');
|
||||
commonStore.menuClose('blockLink');
|
||||
commonStore.menuClose('blockColor');
|
||||
commonStore.menuClose('blockBackground');
|
||||
commonStore.menuClose('select');
|
||||
|
||||
window.clearTimeout(this.timeout);
|
||||
this.timeout = window.setTimeout(() => {
|
||||
commonStore.menuOpen(menuId, menuParam);
|
||||
}, Constant.delay.menu);
|
||||
};
|
||||
};
|
||||
|
||||
onMenuClick () {
|
||||
|
|
|
@ -62,8 +62,7 @@ class PageAccountSelect extends React.Component<Props, State> {
|
|||
};
|
||||
|
||||
componentDidMount () {
|
||||
const { path } = authStore;
|
||||
const phrase = Storage.get('phrase');
|
||||
const { path, phrase } = authStore;
|
||||
|
||||
authStore.accountClear();
|
||||
|
||||
|
|
|
@ -10,6 +10,8 @@ interface State {
|
|||
error: string;
|
||||
};
|
||||
|
||||
const { ipcRenderer } = window.require('electron');
|
||||
|
||||
@observer
|
||||
class PageAuthLogin extends React.Component<Props, State> {
|
||||
|
||||
|
@ -66,17 +68,17 @@ class PageAuthLogin extends React.Component<Props, State> {
|
|||
|
||||
const { history } = this.props;
|
||||
const { path } = authStore;
|
||||
const phrase = this.phraseRef.getValue();
|
||||
|
||||
this.phraseRef.setError(false);
|
||||
|
||||
const phrase = this.phraseRef.getValue();
|
||||
|
||||
C.WalletRecover(path, phrase, (message: any) => {
|
||||
if (message.error.code) {
|
||||
this.phraseRef.setError(true);
|
||||
this.setState({ error: message.error.description });
|
||||
} else {
|
||||
authStore.phraseSet(phrase);
|
||||
ipcRenderer.send('keytarSet', 'phrase', phrase);
|
||||
history.push('/auth/account-select');
|
||||
};
|
||||
});
|
||||
|
|
|
@ -10,6 +10,8 @@ interface State {
|
|||
error: string;
|
||||
};
|
||||
|
||||
const { ipcRenderer } = window.require('electron');
|
||||
|
||||
@observer
|
||||
class PageAuthSelect extends React.Component<Props, State> {
|
||||
|
||||
|
@ -64,6 +66,7 @@ class PageAuthSelect extends React.Component<Props, State> {
|
|||
this.setState({ error: message.error.description });
|
||||
} else {
|
||||
authStore.phraseSet(message.mnemonic);
|
||||
ipcRenderer.send('keytarSet', 'phrase', message.mnemonic);
|
||||
history.push('/auth/register/register');
|
||||
};
|
||||
});
|
||||
|
|
|
@ -102,8 +102,7 @@ class PageAuthSetup extends React.Component<Props, State> {
|
|||
|
||||
init () {
|
||||
const { history } = this.props;
|
||||
const { path } = authStore;
|
||||
const phrase = Storage.get('phrase');
|
||||
const { path, phrase } = authStore;
|
||||
const accountId = Storage.get('accountId');
|
||||
|
||||
if (!phrase) {
|
||||
|
|
|
@ -192,7 +192,7 @@ class PopupShortcut extends React.Component<Props, State> {
|
|||
|
||||
markdown: [
|
||||
{
|
||||
description: 'To format your blocks using Markdown, simply use any of these commands at the beginning of any new line or existing block of content.',
|
||||
description: 'To format your blocks using Markdown, simply use any of these commands at the beginning of any new line.',
|
||||
children: [
|
||||
{ com: '# + Space', name: 'Create an H1 heading' },
|
||||
{ com: '# # + Space', name: 'Create an H2 heading' },
|
||||
|
|
|
@ -122,12 +122,12 @@ class Smile extends React.Component<Props, State> {
|
|||
};
|
||||
|
||||
onClick (e: any) {
|
||||
e.stopPropagation();
|
||||
|
||||
const { id, canEdit, offsetX, offsetY, onSelect, onUpload } = this.props;
|
||||
if (!id || !canEdit) {
|
||||
return;
|
||||
};
|
||||
|
||||
e.stopPropagation();
|
||||
|
||||
commonStore.menuOpen('smile', {
|
||||
element: '#' + id,
|
||||
|
|
|
@ -6,7 +6,30 @@ export default [
|
|||
|
||||
{ type: I.BlockType.IconPage, icon: '👋' },
|
||||
|
||||
{ style: I.TextStyle.Title, text: `Updates for 30 October, 2020` },
|
||||
{ style: I.TextStyle.Title, text: `Updates for 20 November, 2020` },
|
||||
{ text: `New encryption. We now using AES with stream encryption with CFB mode. Old encryption could increase the RAM consumption to 13,46 GB with 4GB file and could even crash Anytype. Now it takes less than 100 megabytes with any size of the file. For the best performance, you need to be up-to-date in each Desktop app and use the latest Android version. It starts to work with the new files added to Anytype, so, please, re-upload big files. ` },
|
||||
|
||||
{ style: I.TextStyle.Header3, text: `Enhancements:` },
|
||||
{ style: I.TextStyle.Bulleted, text: `Turn into now can turn page links into mentions with other text styles.` },
|
||||
{ style: I.TextStyle.Bulleted, text: `We now show the loading object state for pages that downloading from the remote node.` },
|
||||
|
||||
{ style: I.TextStyle.Header3, text: `Bug fixes:` },
|
||||
{ style: I.TextStyle.Bulleted, text: `<span class="${sc}">Shift + Enter</span> doesn’t create a new line within a block. Thanks, Poochy!` },
|
||||
{ style: I.TextStyle.Bulleted, text: `Markup menu remains open when click outside the editor container. Thanks, BGray!` },
|
||||
{ style: I.TextStyle.Bulleted, text: `The text disappears if you type and press the system button back after typing and open the page again. Thanks, BGray!` },
|
||||
{ style: I.TextStyle.Bulleted, text: `Markup menu remains open when click outside the editor container. Thanks, BGray!` },
|
||||
{ style: I.TextStyle.Bulleted, text: `Clipboard. Dismiss after pasting an URL gets pasted as plain text not as URL. Thanks, Luuk!` },
|
||||
{ style: I.TextStyle.Bulleted, text: `Clipboard. Columns cut and copy part of the text block doesn't work properly.` },
|
||||
{ style: I.TextStyle.Bulleted, text: `Mention. Several creation and deletion attempts can break the style range.` },
|
||||
{ style: I.TextStyle.Bulleted, text: `Selection with shift pressed. If there is a carriage inside the block and you press shift and click on another block, the first block should also become selected. ` },
|
||||
{ style: I.TextStyle.Bulleted, text: `Selection with shift should work from bottom to top and select all blocks between. If users starting to click in another direction the selection should always extend.` },
|
||||
{ style: I.TextStyle.Bulleted, text: `The search window doesn't match with the search pane frame.` },
|
||||
{ style: I.TextStyle.Bulleted, text: `Undo / Redo can return events with wrong order.` },
|
||||
{ style: I.TextStyle.Bulleted, text: `You cannot open the page from the dashboard if you click in the icon zone.` },
|
||||
|
||||
{ type: I.BlockType.Div, style: I.DivStyle.Dot },
|
||||
|
||||
{ style: I.TextStyle.Header1, text: `Updates for 30 October, 2020` },
|
||||
{ text: `This is a technical minor release with bug fixes and minor enchancements.` },
|
||||
|
||||
{ style: I.TextStyle.Header3, text: `Enhancements:` },
|
||||
|
|
|
@ -5,6 +5,8 @@ import { commonStore } from './common';
|
|||
import * as Sentry from '@sentry/browser';
|
||||
import { keyboard } from 'ts/lib';
|
||||
|
||||
const { ipcRenderer } = window.require('electron');
|
||||
|
||||
class AuthStore {
|
||||
@observable public dataPath: string = '';
|
||||
@observable public accountItem: I.Account = null;
|
||||
|
@ -44,8 +46,6 @@ class AuthStore {
|
|||
@action
|
||||
phraseSet (v: string) {
|
||||
this.phrase = v;
|
||||
Storage.set('phrase', v);
|
||||
Storage.set('phraseBackup', v);
|
||||
};
|
||||
|
||||
@action
|
||||
|
@ -94,6 +94,7 @@ class AuthStore {
|
|||
|
||||
this.accountItem = null;
|
||||
this.phraseSet('');
|
||||
ipcRenderer.send('keytarDelete', 'phrase');
|
||||
};
|
||||
|
||||
};
|
||||
|
|
|
@ -6,7 +6,7 @@ const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPl
|
|||
module.exports = (env) => {
|
||||
const useGRPC = !process.env.ANYTYPE_USE_ADDON && (process.env.ANYTYPE_USE_GRPC || (process.platform == 'win32') || (env.NODE_ENV == 'development'));
|
||||
const port = env.SERVER_PORT;
|
||||
|
||||
|
||||
return {
|
||||
mode: env.NODE_ENV,
|
||||
|
||||
|
@ -65,6 +65,7 @@ module.exports = (env) => {
|
|||
},
|
||||
]
|
||||
},
|
||||
{ test: /\.node$/, loader: 'node-loader' },
|
||||
{
|
||||
enforce: 'pre',
|
||||
test: /\.js$/,
|
||||
|
|
|
@ -13,6 +13,12 @@ module.exports = (env) => {
|
|||
output: {
|
||||
filename: "bundle-back.js"
|
||||
},
|
||||
|
||||
module: {
|
||||
rules: [
|
||||
{ test: /\.node$/, loader: 'node-loader' },
|
||||
]
|
||||
}
|
||||
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue