Merge branch 'main' of github.com:anyproto/anytype-ts into feature/primitives
3
.gitignore
vendored
|
@ -19,6 +19,9 @@ electron/env.json
|
|||
src/json/schema
|
||||
licenses.json
|
||||
|
||||
# generated by rspack
|
||||
/compilation-stats.json
|
||||
|
||||
# generated by update.sh
|
||||
/linux-amd*/
|
||||
/linux-arm*/
|
||||
|
|
|
@ -39,7 +39,7 @@ contextBridge.exposeInMainWorld('Electron', {
|
|||
getGlobal: key => getGlobal(key),
|
||||
showOpenDialog: dialog.showOpenDialog,
|
||||
|
||||
webFilePath: file => webUtils.getPathForFile(file),
|
||||
webFilePath: file => webUtils && webUtils.getPathForFile(file),
|
||||
|
||||
fileWrite: (name, data, options) => {
|
||||
name = String(name || 'temp');
|
||||
|
|
|
@ -1 +1 @@
|
|||
0.37.0-alpha01
|
||||
0.37.0-alpha04
|
1908
package-lock.json
generated
50
package.json
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "anytype",
|
||||
"version": "0.43.10-alpha",
|
||||
"version": "0.43.13-alpha",
|
||||
"description": "Anytype",
|
||||
"main": "electron.js",
|
||||
"scripts": {
|
||||
|
@ -9,26 +9,26 @@
|
|||
"lint": "eslint .",
|
||||
"electron": "npx electron .",
|
||||
"electron-win": "npx electron.cmd .",
|
||||
"start:watch": "cross-env-shell webpack-dev-server --progress --mode=development --node-env=development --env SERVER_PORT=$SERVER_PORT --env DATA_PATH=$DATA_PATH --history-api-fallback --cache",
|
||||
"start:electron-wait-webpack": "cross-env-shell wait-for-localhost $SERVER_PORT && npm run electron",
|
||||
"start:electron-wait-webpack-win": "cross-env-shell wait-for-localhost $SERVER_PORT && npm run electron-win",
|
||||
"start:dev": "npm-run-all --parallel start:watch start:electron-wait-webpack",
|
||||
"start:dev-win": "npm-run-all --parallel start:watch start:electron-wait-webpack-win",
|
||||
"build": "webpack --mode=production --node-env=production --config webpack.config.js",
|
||||
"build:dev": "webpack --mode=development --node-env=development --config webpack.config.js",
|
||||
"build:deps": "webpack --config webpack.node.config.js --stats detailed | grep 'node_modules' | sed -E 's/.*(node_modules[\\/][^\\\\/[:space:]]{1,})[\\\\/].*/\\1/' | uniq | node save-node-deps.js",
|
||||
"start:watch": "cross-env-shell rspack serve --mode=development --node-env=development --env SERVER_PORT=$SERVER_PORT --env DATA_PATH=$DATA_PATH",
|
||||
"start:electron-wait-rspack": "cross-env-shell wait-for-localhost $SERVER_PORT && npm run electron",
|
||||
"start:electron-wait-rspack-win": "cross-env-shell wait-for-localhost $SERVER_PORT && npm run electron-win",
|
||||
"start:dev": "npm-run-all --parallel start:watch start:electron-wait-rspack",
|
||||
"start:dev-win": "npm-run-all --parallel start:watch start:electron-wait-rspack-win",
|
||||
"build": "rspack --mode=production --node-env=production --config rspack.config.js",
|
||||
"build:dev": "rspack --mode=development --node-env=development --config rspack.config.js",
|
||||
"build:deps": "rspack build --config rspack.node.config.js --json=compilation-stats.json && cat compilation-stats.json | grep -o '[^\"]\\+node_modules[^\"]\\+' | sed -E 's/.*(node_modules[\\/][^\\\\/[:space:]]{1,})[\\\\/].*/\\1/' | uniq | node save-node-deps.js",
|
||||
"build:nmh": "go build -o dist/nativeMessagingHost ./go/nativeMessagingHost.go",
|
||||
"build:nmh-win": "go build -o dist/nativeMessagingHost.exe ./go/nativeMessagingHost.go",
|
||||
"dist:mac": "npm run build:deps && webpack --progress --mode=production --node-env=production && DATE=`date '+%Y-%m-%d_%H_%M'` GIT_COMMIT=`git rev-parse --short HEAD` electron-builder --macos --arm64 --x64",
|
||||
"dist:macarm": "npm run build:deps && webpack --mode=production --node-env=production && DATE=`date '+%Y-%m-%d_%H_%M'` GIT_COMMIT=`git rev-parse --short HEAD` electron-builder --macos --arm64",
|
||||
"dist:macamd": "npm run build:deps && webpack --mode=production --node-env=production && DATE=`date '+%Y-%m-%d_%H_%M'` GIT_COMMIT=`git rev-parse --short HEAD` electron-builder --macos --x64",
|
||||
"dist:win": "webpack --mode=production --node-env=production && electron-builder --windows",
|
||||
"dist:linux": "npm run build:deps && webpack --mode=production --node-env=production && DATE=`date '+%Y-%m-%d_%H_%M'` GIT_COMMIT=`git rev-parse --short HEAD` electron-builder --linux --arm64 --x64",
|
||||
"dist:linuxamd": "npm run build:deps && webpack --mode=production --node-env=production && DATE=`date '+%Y-%m-%d_%H_%M'` GIT_COMMIT=`git rev-parse --short HEAD` electron-builder --linux --x64",
|
||||
"dist:linuxarm": "npm run build:deps && webpack --mode=production --node-env=production && DATE=`date '+%Y-%m-%d_%H_%M'` GIT_COMMIT=`git rev-parse --short HEAD` electron-builder --linux --arm64",
|
||||
"publish:mac": "webpack --mode=production --node-env=production && DATE=`date '+%Y-%m-%d_%H_%M'` GIT_COMMIT=`git rev-parse --short HEAD` BUILD_NUMBER=`git rev-parse --short HEAD` electron-builder --macos --publish always",
|
||||
"publish:linux": "webpack --mode=production --node-env=production && DATE=`date '+%Y-%m-%d_%H_%M'` GIT_COMMIT=`git rev-parse --short HEAD` BUILD_NUMBER=`git rev-parse --short HEAD` electron-builder --linux --publish always",
|
||||
"publish:win": "webpack --mode=production --node-env=production && DATE=`date '+%Y-%m-%d_%H_%M'` GIT_COMMIT=`git rev-parse --short HEAD` BUILD_NUMBER=`git rev-parse --short HEAD` electron-builder --windows --publish always",
|
||||
"dist:mac": "npm run build:deps && rspack --mode=production --node-env=production && DATE=`date '+%Y-%m-%d_%H_%M'` GIT_COMMIT=`git rev-parse --short HEAD` electron-builder --macos --arm64 --x64",
|
||||
"dist:macarm": "npm run build:deps && rspack --mode=production --node-env=production && DATE=`date '+%Y-%m-%d_%H_%M'` GIT_COMMIT=`git rev-parse --short HEAD` electron-builder --macos --arm64",
|
||||
"dist:macamd": "npm run build:deps && rspack --mode=production --node-env=production && DATE=`date '+%Y-%m-%d_%H_%M'` GIT_COMMIT=`git rev-parse --short HEAD` electron-builder --macos --x64",
|
||||
"dist:win": "rspack --mode=production --node-env=production && electron-builder --windows",
|
||||
"dist:linux": "npm run build:deps && rspack --mode=production --node-env=production && DATE=`date '+%Y-%m-%d_%H_%M'` GIT_COMMIT=`git rev-parse --short HEAD` electron-builder --linux --arm64 --x64",
|
||||
"dist:linuxamd": "npm run build:deps && rspack --mode=production --node-env=production && DATE=`date '+%Y-%m-%d_%H_%M'` GIT_COMMIT=`git rev-parse --short HEAD` electron-builder --linux --x64",
|
||||
"dist:linuxarm": "npm run build:deps && rspack --mode=production --node-env=production && DATE=`date '+%Y-%m-%d_%H_%M'` GIT_COMMIT=`git rev-parse --short HEAD` electron-builder --linux --arm64",
|
||||
"publish:mac": "rspack --mode=production --node-env=production && DATE=`date '+%Y-%m-%d_%H_%M'` GIT_COMMIT=`git rev-parse --short HEAD` BUILD_NUMBER=`git rev-parse --short HEAD` electron-builder --macos --publish always",
|
||||
"publish:linux": "rspack --mode=production --node-env=production && DATE=`date '+%Y-%m-%d_%H_%M'` GIT_COMMIT=`git rev-parse --short HEAD` BUILD_NUMBER=`git rev-parse --short HEAD` electron-builder --linux --publish always",
|
||||
"publish:win": "rspack --mode=production --node-env=production && DATE=`date '+%Y-%m-%d_%H_%M'` GIT_COMMIT=`git rev-parse --short HEAD` BUILD_NUMBER=`git rev-parse --short HEAD` electron-builder --windows --publish always",
|
||||
"postinstall": "npx patch-package && electron-builder install-app-deps",
|
||||
"prepare": "husky install",
|
||||
"update:locale": "node ./electron/hook/locale.js"
|
||||
|
@ -48,6 +48,10 @@
|
|||
"homepage": "https://anytype.io",
|
||||
"devDependencies": {
|
||||
"@electron/notarize": "^2.5.0",
|
||||
"@rspack/cli": "^1.1.0",
|
||||
"@rspack/core": "^1.1.0",
|
||||
"@rspack/dev-server": "^1.0.9",
|
||||
"@rspack/plugin-react-refresh": "^1.0.0",
|
||||
"@types/history": "^4.7.8",
|
||||
"@types/jquery": "^3.5.14",
|
||||
"@types/katex": "^0.14.0",
|
||||
|
@ -73,19 +77,16 @@
|
|||
"npm": "^10.5.0",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"patch-package": "^6.4.7",
|
||||
"react-refresh": "^0.14.2",
|
||||
"sass": "1.77.6",
|
||||
"sass-loader": "^8.0.2",
|
||||
"source-map-loader": "^0.2.4",
|
||||
"style-loader": "^1.2.1",
|
||||
"ts-loader": "^6.2.2",
|
||||
"typescript": "^5.3.3",
|
||||
"typescript-eslint": "^0.0.1-alpha.0",
|
||||
"url-loader": "^4.1.1",
|
||||
"wait-for-localhost-cli": "^3.0.0",
|
||||
"webpack": "^5.74.0",
|
||||
"webpack-bundle-analyzer": "^4.5.0",
|
||||
"webpack-cli": "^4.10.0",
|
||||
"webpack-dev-server": "^4.13.1"
|
||||
"webpack-dev-server": "^5.1.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@electron/remote": "^2.1.2",
|
||||
|
@ -97,7 +98,6 @@
|
|||
"amplitude-js": "^5.11.0",
|
||||
"array-move": "^2.2.2",
|
||||
"blueimp-load-image": "^2.31.0",
|
||||
"copy-webpack-plugin": "^12.0.2",
|
||||
"d3": "^7.0.1",
|
||||
"d3-force": "^3.0.0",
|
||||
"d3-force-cluster": "^0.1.2",
|
||||
|
|
|
@ -1,14 +1,15 @@
|
|||
const path = require('path');
|
||||
const process = require('process');
|
||||
const webpack = require('webpack');
|
||||
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
||||
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
|
||||
const rspack = require('@rspack/core');
|
||||
const ReactRefreshPlugin = require('@rspack/plugin-react-refresh');
|
||||
// const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
|
||||
|
||||
const pdfjsDistPath = path.dirname(require.resolve('pdfjs-dist/package.json'));
|
||||
const cMapsDir = path.join(pdfjsDistPath, 'cmaps');
|
||||
|
||||
module.exports = (env, argv) => {
|
||||
const port = process.env.SERVER_PORT;
|
||||
const prod = env === 'production';
|
||||
|
||||
return {
|
||||
mode: 'development',
|
||||
|
@ -86,9 +87,49 @@ module.exports = (env, argv) => {
|
|||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.ts(x?)$/,
|
||||
exclude: /node_modules/,
|
||||
loader: 'ts-loader'
|
||||
test: /\.(j|t)s$/,
|
||||
exclude: [/[\\/]node_modules[\\/]/],
|
||||
loader: 'builtin:swc-loader',
|
||||
options: {
|
||||
jsc: {
|
||||
parser: {
|
||||
syntax: 'typescript',
|
||||
},
|
||||
transform: {
|
||||
react: {
|
||||
runtime: 'automatic',
|
||||
development: !prod,
|
||||
refresh: !prod,
|
||||
},
|
||||
},
|
||||
},
|
||||
env: {
|
||||
targets: 'Chrome >= 48',
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
test: /\.(j|t)sx$/,
|
||||
loader: 'builtin:swc-loader',
|
||||
exclude: [/[\\/]node_modules[\\/]/],
|
||||
options: {
|
||||
jsc: {
|
||||
parser: {
|
||||
syntax: 'typescript',
|
||||
tsx: true,
|
||||
},
|
||||
transform: {
|
||||
react: {
|
||||
runtime: 'automatic',
|
||||
development: !prod,
|
||||
refresh: !prod,
|
||||
},
|
||||
},
|
||||
},
|
||||
env: {
|
||||
targets: 'Chrome >= 48', // browser compatibility
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
enforce: 'pre',
|
||||
|
@ -97,11 +138,11 @@ module.exports = (env, argv) => {
|
|||
},
|
||||
{
|
||||
test: /\.(eot|ttf|otf|woff|woff2)$/,
|
||||
loader: 'url-loader'
|
||||
type: 'asset/inline'
|
||||
},
|
||||
{
|
||||
test: /\.(jpe?g|png|gif|svg)$/,
|
||||
loader: 'url-loader'
|
||||
type: 'asset/inline'
|
||||
},
|
||||
{
|
||||
test: /\.s?css/,
|
||||
|
@ -113,18 +154,24 @@ module.exports = (env, argv) => {
|
|||
}
|
||||
]
|
||||
},
|
||||
|
||||
plugins: [
|
||||
!prod && new ReactRefreshPlugin(),
|
||||
//new BundleAnalyzerPlugin(),
|
||||
|
||||
new webpack.optimize.LimitChunkCountPlugin({
|
||||
// new rspack.IgnorePlugin({
|
||||
// resourceRegExp: /osx-temperature-sensor/,
|
||||
// }),
|
||||
|
||||
new rspack.optimize.LimitChunkCountPlugin({
|
||||
maxChunks: 1,
|
||||
}),
|
||||
|
||||
new CopyWebpackPlugin({
|
||||
new rspack.CopyRspackPlugin({
|
||||
patterns: [
|
||||
{ from: cMapsDir, to: './cmaps/' },
|
||||
],
|
||||
}),
|
||||
],
|
||||
].filter(Boolean),
|
||||
};
|
||||
};
|
|
@ -1,3 +1,5 @@
|
|||
const rspack = require('@rspack/core');
|
||||
|
||||
module.exports = (env) => {
|
||||
return {
|
||||
target: 'node',
|
||||
|
@ -18,7 +20,14 @@ module.exports = (env) => {
|
|||
rules: [
|
||||
{ test: /\.node$/, loader: 'node-loader' },
|
||||
]
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
plugins: [
|
||||
new rspack.IgnorePlugin({
|
||||
resourceRegExp: /osx-temperature-sensor/,
|
||||
}),
|
||||
],
|
||||
|
||||
stats: 'detailed',
|
||||
};
|
||||
};
|
|
@ -1,4 +1,3 @@
|
|||
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M4.46967 4.46967C4.76256 4.17678 5.23744 4.17678 5.53033 4.46967L15.5303 14.4697C15.8232 14.7626 15.8232 15.2374 15.5303 15.5303C15.2374 15.8232 14.7626 15.8232 14.4697 15.5303L4.46967 5.53033C4.17678 5.23744 4.17678 4.76256 4.46967 4.46967Z" fill="#b6b6b6"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M15.5303 4.46967C15.2374 4.17678 14.7626 4.17678 14.4697 4.46967L4.46967 14.4697C4.17678 14.7626 4.17678 15.2374 4.46967 15.5303C4.76256 15.8232 5.23744 15.8232 5.53033 15.5303L15.5303 5.53033C15.8232 5.23744 15.8232 4.76256 15.5303 4.46967Z" fill="#b6b6b6"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M10 18.9902C14.9706 18.9902 19 14.9608 19 9.99023C19 5.01967 14.9706 0.990234 10 0.990234C5.02944 0.990234 1 5.01967 1 9.99023C1 14.9608 5.02944 18.9902 10 18.9902ZM6.48659 6.44494C6.7802 6.15276 7.25507 6.15392 7.54725 6.44753L10.0078 8.92014L12.4684 6.44753C12.7606 6.15392 13.2354 6.15276 13.529 6.44494C13.8226 6.73712 13.8238 7.21199 13.5316 7.5056L11.0659 9.9834L13.5316 12.4612C13.8238 12.7548 13.8226 13.2297 13.529 13.5219C13.2354 13.814 12.7606 13.8129 12.4684 13.5193L10.0078 11.0467L7.54725 13.5193C7.25507 13.8129 6.7802 13.814 6.48659 13.5219C6.19298 13.2297 6.19182 12.7548 6.484 12.4612L8.94973 9.9834L6.484 7.5056C6.19182 7.21199 6.19298 6.73712 6.48659 6.44494Z" fill="#b6b6b6"/>
|
||||
</svg>
|
Before Width: | Height: | Size: 720 B After Width: | Height: | Size: 849 B |
|
@ -1,5 +1,5 @@
|
|||
<svg shape-rendering="geometricPrecision" width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M5.42654 13.2986C5.21668 13.1517 4.98994 13 4.73378 13H3C2.44771 13 2 12.5523 2 12V8.00003C2 7.44774 2.44772 7.00003 3 7.00003H4.73378C4.98994 7.00003 5.21668 6.84835 5.42654 6.70145L8.42654 4.60145C9.08931 4.13751 10 4.61166 10 5.42068V14.5794C10 15.3884 9.08932 15.8625 8.42654 15.3986L5.42654 13.2986Z" fill="#a09f92"/>
|
||||
<rect x="12.5" y="7.85718" width="1.21218" height="7.27311" rx="0.606092" transform="rotate(-45 12.5 7.85718)" fill="#a09f92"/>
|
||||
<rect x="17.6428" y="7" width="1.21218" height="7.27311" rx="0.606092" transform="rotate(45 17.6428 7)" fill="#a09f92"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M5.42654 13.2986C5.21668 13.1517 4.98994 13 4.73378 13H3C2.44771 13 2 12.5523 2 12V8.00003C2 7.44774 2.44772 7.00003 3 7.00003H4.73378C4.98994 7.00003 5.21668 6.84835 5.42654 6.70145L8.42654 4.60145C9.08931 4.13751 10 4.61166 10 5.42068V14.5794C10 15.3884 9.08932 15.8625 8.42654 15.3986L5.42654 13.2986Z" fill="#9A9A9A"/>
|
||||
<rect x="12.5" y="7.85718" width="1.21218" height="7.27311" rx="0.606092" transform="rotate(-45 12.5 7.85718)" fill="#9A9A9A"/>
|
||||
<rect x="17.6428" y="7" width="1.21218" height="7.27311" rx="0.606092" transform="rotate(45 17.6428 7)" fill="#9A9A9A"/>
|
||||
</svg>
|
||||
|
|
Before Width: | Height: | Size: 761 B After Width: | Height: | Size: 761 B |
|
@ -1,3 +1,3 @@
|
|||
<svg shape-rendering="geometricPrecision" width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M5 3C4.44772 3 4 3.44772 4 4V16C4 16.5523 4.44772 17 5 17H7C7.55228 17 8 16.5523 8 16V4C8 3.44772 7.55228 3 7 3H5ZM13 3C12.4477 3 12 3.44772 12 4V16C12 16.5523 12.4477 17 13 17H15C15.5523 17 16 16.5523 16 16V4C16 3.44772 15.5523 3 15 3H13Z" fill="#a09f92"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M5 3C4.44772 3 4 3.44772 4 4V16C4 16.5523 4.44772 17 5 17H7C7.55228 17 8 16.5523 8 16V4C8 3.44772 7.55228 3 7 3H5ZM13 3C12.4477 3 12 3.44772 12 4V16C12 16.5523 12.4477 17 13 17H15C15.5523 17 16 16.5523 16 16V4C16 3.44772 15.5523 3 15 3H13Z" fill="#9A9A9A"/>
|
||||
</svg>
|
||||
|
|
Before Width: | Height: | Size: 447 B After Width: | Height: | Size: 447 B |
|
@ -1,3 +1,3 @@
|
|||
<svg shape-rendering="geometricPrecision" width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M4 16.2143V3.79347C4 3.01115 4.85783 2.5318 5.5241 2.94181L15.6161 9.15225C16.2506 9.54273 16.2506 10.4651 15.6161 10.8556L5.5241 17.066C4.85783 17.476 4 16.9967 4 16.2143Z" fill="#a09f92"/>
|
||||
<path d="M4 16.2143V3.79347C4 3.01115 4.85783 2.5318 5.5241 2.94181L15.6161 9.15225C16.2506 9.54273 16.2506 10.4651 15.6161 10.8556L5.5241 17.066C4.85783 17.476 4 16.9967 4 16.2143Z" fill="#9A9A9A"/>
|
||||
</svg>
|
||||
|
|
Before Width: | Height: | Size: 340 B After Width: | Height: | Size: 340 B |
|
@ -1,4 +1,4 @@
|
|||
<svg shape-rendering="geometricPrecision" width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M16.0208 4.50971C15.7362 4.16672 15.2221 4.16893 14.9069 4.48397C14.5915 4.79922 14.5957 5.30793 14.8729 5.65723C15.8197 6.8502 16.3851 8.3592 16.3851 10.0002C16.3851 11.6412 15.8197 13.1502 14.8729 14.3432C14.5957 14.6925 14.5915 15.2012 14.9069 15.5165C15.2221 15.8315 15.7362 15.8337 16.0208 15.4907C17.2568 14.0006 17.9998 12.0871 17.9998 10.0002C17.9998 7.91329 17.2568 5.99983 16.0208 4.50971ZM12.2428 12.8536C12.5579 13.1686 13.0754 13.1718 13.3343 12.809C13.8996 12.0169 14.2322 11.0474 14.2322 10.0002C14.2322 8.95304 13.8996 7.98351 13.3343 7.1914C13.0754 6.82868 12.5579 6.83181 12.2428 7.14684C11.9274 7.46209 11.9383 7.97016 12.1662 8.35345C12.4529 8.83557 12.6175 9.39868 12.6175 10.0002C12.6175 10.6018 12.4529 11.1649 12.1662 11.647C11.9383 12.0303 11.9274 12.5383 12.2428 12.8536Z" fill="#a09f92"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M5.42654 13.2986C5.21668 13.1517 4.98994 13 4.73378 13H3C2.44771 13 2 12.5523 2 12V8.00003C2 7.44774 2.44772 7.00003 3 7.00003H4.73378C4.98994 7.00003 5.21668 6.84835 5.42654 6.70145L8.42654 4.60145C9.08931 4.13751 10 4.61166 10 5.42068V14.5794C10 15.3884 9.08932 15.8625 8.42654 15.3986L5.42654 13.2986Z" fill="#a09f92"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M16.0208 4.50971C15.7362 4.16672 15.2221 4.16893 14.9069 4.48397C14.5915 4.79922 14.5957 5.30793 14.8729 5.65723C15.8197 6.8502 16.3851 8.3592 16.3851 10.0002C16.3851 11.6412 15.8197 13.1502 14.8729 14.3432C14.5957 14.6925 14.5915 15.2012 14.9069 15.5165C15.2221 15.8315 15.7362 15.8337 16.0208 15.4907C17.2568 14.0006 17.9998 12.0871 17.9998 10.0002C17.9998 7.91329 17.2568 5.99983 16.0208 4.50971ZM12.2428 12.8536C12.5579 13.1686 13.0754 13.1718 13.3343 12.809C13.8996 12.0169 14.2322 11.0474 14.2322 10.0002C14.2322 8.95304 13.8996 7.98351 13.3343 7.1914C13.0754 6.82868 12.5579 6.83181 12.2428 7.14684C11.9274 7.46209 11.9383 7.97016 12.1662 8.35345C12.4529 8.83557 12.6175 9.39868 12.6175 10.0002C12.6175 10.6018 12.4529 11.1649 12.1662 11.647C11.9383 12.0303 11.9274 12.5383 12.2428 12.8536Z" fill="#9A9A9A"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M5.42654 13.2986C5.21668 13.1517 4.98994 13 4.73378 13H3C2.44771 13 2 12.5523 2 12V8.00003C2 7.44774 2.44772 7.00003 3 7.00003H4.73378C4.98994 7.00003 5.21668 6.84835 5.42654 6.70145L8.42654 4.60145C9.08931 4.13751 10 4.61166 10 5.42068V14.5794C10 15.3884 9.08932 15.8625 8.42654 15.3986L5.42654 13.2986Z" fill="#9A9A9A"/>
|
||||
</svg>
|
||||
|
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
@ -6,6 +6,7 @@ export default {
|
|||
appName: 'Anytype',
|
||||
blankRouteId: '_blank_',
|
||||
storeSpaceId: '_anytype_marketplace',
|
||||
localLoversSpaceId: 'bafyreigyfkt6rbv24sbv5aq2hko3bhmv5xxlf22b4bypdu6j7hnphm3psq.23me69r569oi1',
|
||||
anytypeProfileId: '_anytype_profile',
|
||||
fontCode: 'plex',
|
||||
popupPinIds: [ 'search' ],
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
"commonHome": "Home",
|
||||
"commonSubmit": "Submit",
|
||||
"commonValue": "Value",
|
||||
"commonProgress": "Processing...",
|
||||
"commonArchived": "Object is in the bin",
|
||||
"commonEmpty": "Empty",
|
||||
"commonBack": "Back",
|
||||
|
@ -169,7 +168,8 @@
|
|||
"commonNothingFound": "Nothing found",
|
||||
"commonEntrySpace": "My First Space",
|
||||
"commonSystem": "System",
|
||||
"commonMainChat": "Main сhat",
|
||||
"commonProgress": "Progress",
|
||||
"commonMainChat": "Chat",
|
||||
"commonMenu": "Menu",
|
||||
|
||||
"pluralDay": "day|days",
|
||||
|
@ -324,12 +324,13 @@
|
|||
"viewName4": "Calendar",
|
||||
"viewName5": "Graph",
|
||||
|
||||
"progress0": "Copying files %s\/%s",
|
||||
"progress1": "Import in progress",
|
||||
"progress2": "Export in progress",
|
||||
"progress3": "Download in progress",
|
||||
"progress4": "Recovering vault",
|
||||
"progress5": "Migration in progress",
|
||||
|
||||
"progressDropFiles": "Copying files...",
|
||||
"progressImport": "Import in progress...",
|
||||
"progressExport": "Export in progress...",
|
||||
"progressSaveFile": "Download in progress...",
|
||||
"progressMigration": "Recovering vault...",
|
||||
"progressRecoverAccount": "Migration in progress...",
|
||||
"progressUpdateCheck": "Checking for update...",
|
||||
|
||||
"spellcheckAdd": "Add to dictionary",
|
||||
|
@ -1073,8 +1074,8 @@
|
|||
"popupConfirmOpenExternalLinkTitle": "Are you sure?",
|
||||
"popupConfirmOpenExternalLinkText": "You are trying to open url that is potentially harmful. Are you sure you want to proceed?",
|
||||
|
||||
"popupConfirmChatDeleteMessageTitle": "Delete message",
|
||||
"popupConfirmChatDeleteMessageText": "Are you sure you want to delete this message?",
|
||||
"popupConfirmChatDeleteMessageTitle": "Delete this message?",
|
||||
"popupConfirmChatDeleteMessageText": "It cannot be restored after confirmation",
|
||||
|
||||
"popupInviteRequestTitle": "Join a space",
|
||||
"popupInviteRequestText": "You've been invited to join <b>%s</b> space, created by <b>%s</b>. Send a request so space owner can let you in.",
|
||||
|
@ -2144,16 +2145,18 @@
|
|||
"notificationGalleryErrorTitle": "Something went wrong",
|
||||
"notificationGalleryErrorText": "Oops! <b>'%s'</b> wasn't installed. Please check your Internet connection and try again or post a report in our community.",
|
||||
|
||||
"notificationImportErrorTitle5": "No Items to Import",
|
||||
"notificationImportErrorText5": "There are no items to import. Please check your file type or Import selection and try again.",
|
||||
"notificationImportErrorTitle6": "Import Canceled",
|
||||
"notificationImportErrorText6": "The import has been canceled.",
|
||||
"notificationImportErrorTitle7": "Import Limit Exceeded",
|
||||
"notificationImportErrorText7": "The file exceeds the import limit of 1,000 rows or 10 columns. Please adjust your file and try again.",
|
||||
"notificationImportErrorTitle8": "File Load Error",
|
||||
"notificationImportErrorText8": "We couldn’t load your files. Please check your files and try again, or manually transfer the files.",
|
||||
"notificationImportErrorTitle9": "Permission Denied",
|
||||
"notificationImportErrorText3": "Internal error during import. Please report it to Anytype devs using Help -> Report a Bug. We will check.",
|
||||
"notificationImportErrorText5": "No objects found in the provided Notion integration. Open Notion and check that you have added the integration to the pages you want to export. Check our FAQ for more details.",
|
||||
"notificationImportErrorText6": "The import was canceled by the user.",
|
||||
"notificationImportErrorText7": "The number of lines of the CSV file exceeds 1000. Try splitting the file into smaller parts.",
|
||||
"notificationImportErrorText8": "Error when uploading a file. Check if you have enough space and try again.",
|
||||
"notificationImportErrorText9": "We don’t have permission to import into this Anytype space.",
|
||||
"notificationImportErrorText10": "An error occurred during HTML rendering. Check the format of your HTML file.",
|
||||
"notificationImportErrorText11": "The imported AnyBlock file has an unsupported format. It may have been exported from an old or unsupported version of Anytype. Update it and try exporting again.",
|
||||
"notificationImportErrorText12": "Notion API returned an internal error. Most likely something is broken on the Notion side. Try running the import again later.",
|
||||
"notificationImportErrorText13": "Notion API returned an exceeded limits error. Wait a few minutes and try running the import again.",
|
||||
"notificationImportErrorText14": "No objects of the required format were found in the imported archive. Make sure you have selected the correct import format, such as HTML or Markdown",
|
||||
"notificationImportErrorText17": "No objects of the required format were found in the imported folder. Make sure you have selected the correct file format, such as HTML or Markdown",
|
||||
|
||||
"notificationJoinSuccessText": "<b>%s</b> has requested to join <b>'%s'</b> space",
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
background: var(--color-shape-tertiary);
|
||||
}
|
||||
.head {
|
||||
.side.left { flex-grow: 1; display: flex; align-items: center; gap: 0px 8px; }
|
||||
.side.left { flex-grow: 1; display: flex; align-items: center; gap: 0px 8px; overflow: hidden; }
|
||||
.side.left {
|
||||
.icon,
|
||||
.iconObject { flex-shrink: 0; width: 32px; height: 32px; }
|
||||
|
|
|
@ -13,7 +13,9 @@
|
|||
a { text-decoration: none; color: unset; }
|
||||
}
|
||||
|
||||
.iconWrap { width: 36px; height: 36px; position: relative; z-index: 10; position: absolute; bottom: 14px; }
|
||||
.buttons { z-index: 10; position: absolute; bottom: 14px; right: 14px; display: flex; flex-direction: row; gap: 0px 8px; align-items: center; }
|
||||
|
||||
.iconWrap { width: 36px; height: 36px; position: relative; }
|
||||
.iconWrap {
|
||||
.bg {
|
||||
background-color: var(--color-bg-primary); border: 1px solid var(--color-shape-secondary); border-radius: 50%; width: 100%; height: 100%;
|
||||
|
@ -23,10 +25,17 @@
|
|||
}
|
||||
.iconWrap:hover .bg { transform: scale(0.95); }
|
||||
|
||||
#button-help { right: 14px; }
|
||||
#button-help {
|
||||
.icon { background-image: url('~img/icon/footer/help.svg'); }
|
||||
}
|
||||
|
||||
#button-progress {
|
||||
.inner {
|
||||
position: absolute; left: 3px; top: 3px; width: calc(100% - 6px); height: calc(100% - 6px); background-color: var(--color-bg-primary);
|
||||
z-index: 1; border-radius: 50%; @include text-small; font-weight: 500; color: var(--color-text-secondary); display: flex; text-align: center;
|
||||
align-items: center; justify-content: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.footer.mainGraph { display: block !important; position: absolute; }
|
|
@ -9,9 +9,7 @@
|
|||
|
||||
.controls { display: flex; align-items: center; column-gap: 10px; }
|
||||
|
||||
@container media-audio (max-width: 500px) {
|
||||
.controls { column-gap: 5px; };
|
||||
}
|
||||
@container media-audio (max-width: 208px) { .controls { column-gap: 5px; }}
|
||||
|
||||
.controls {
|
||||
div { flex: 0 1 auto; }
|
||||
|
@ -28,7 +26,7 @@
|
|||
.icon.volume.muted { background-image: url('~img/icon/audio/mute.svg'); }
|
||||
.time { @include text-small; text-wrap: nowrap; width: 36px; text-align: center; }
|
||||
|
||||
@container media-audio (max-width: 500px) { .time { display: none; }}
|
||||
@container media-audio (max-width: 208px) { .time { display: none; }}
|
||||
|
||||
.input-drag-horizontal { display: inline-block; vertical-align: top; height: 20px; }
|
||||
.input-drag-horizontal {
|
||||
|
|
|
@ -1,32 +1,52 @@
|
|||
@import "~scss/_mixins";
|
||||
|
||||
.progress {
|
||||
position: fixed; left: 0px; top: 0px; z-index: 110; width: 100%; height: 100%; background: rgba(0,0,0,0.4);
|
||||
transition: background 0.05s ease-in-out; user-select: none;
|
||||
}
|
||||
|
||||
.progress.isUnlocked { background: none; pointer-events: none; }
|
||||
.progress.isUnlocked {
|
||||
.inner { top: auto; left: 10px; top: 40px; margin: 0px; }
|
||||
}
|
||||
.progress { position: fixed; left: 0px; top: 0px; z-index: 110; width: 100%; height: 100%; pointer-events: none; user-select: none; }
|
||||
|
||||
.progress {
|
||||
.inner {
|
||||
position: absolute; left: 50%; top: 50%; box-shadow: 0px 6px 24px rgba(0, 0, 0, 0.2); height: 72px; width: 384px; cursor: grab;
|
||||
border-radius: 12px; text-align: center; background: var(--color-bg-primary); overflow: hidden; margin: -36px 0px 0px -192px; padding: 12px 16px;
|
||||
transition-property: opacity, transform; transition-duration: 0.05s; transition-timing-function: ease-in-out; pointer-events: all;
|
||||
position: absolute; box-shadow: 0px 6px 24px rgba(0, 0, 0, 0.2); cursor: grab; width: 288px; border-radius: 12px; text-align: center;
|
||||
background: var(--color-bg-primary); overflow: hidden; transition-property: opacity, transform; transition-duration: 0.05s;
|
||||
transition-timing-function: ease-in-out; pointer-events: all; display: flex; flex-direction: column; bottom: 56px; right: 56px;
|
||||
}
|
||||
.inner {
|
||||
.label { position: absolute; left: 16px; top: 12px; z-index: 1; color: var(--color-text-primary); white-space: nowrap; @include text-paragraph; }
|
||||
.bar { width: calc(100% - 32px); height: 8px; background: var(--color-shape-tertiary); overflow: hidden; border-radius: 8px; position: absolute; bottom: 16px; left: 16px; }
|
||||
.fill { position: absolute; left: 0px; top: 0px; height: 100%; background: var(--color-control-accent); transition: width 0.2s linear; }
|
||||
|
||||
.titleWrap { font-weight: 600; display: flex; gap: 0px 6px; padding: 11px 16px 3px 16px; }
|
||||
.titleWrap {
|
||||
.label.percent { font-weight: 400; color: var(--color-text-secondary); }
|
||||
}
|
||||
|
||||
.icon.close {
|
||||
width: 24px; height: 24px; position: absolute; top: 14px; right: 14px; background-image: url('~img/icon/progress/close.svg');
|
||||
cursor: default; background-size: 20px; border-radius: 4px;
|
||||
|
||||
.item {
|
||||
padding: 8px 16px; position: relative; border-bottom: 1px solid var(--color-shape-secondary); gap: 4px 0px; display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.icon.close:hover { background-color: var(--color-shape-highlight-medium); }
|
||||
.item {
|
||||
.nameWrap { display: flex; flex-direction: row; gap: 0px 6px; justify-content: space-between; align-items: center; }
|
||||
.nameWrap {
|
||||
.label { color: var(--color-text-primary); @include text-overflow-nw; @include text-common; line-height: 28px; }
|
||||
.icon.close { width: 20px; height: 20px; background-image: url('~img/icon/progress/close.svg'); cursor: default; flex-shrink: 0; opacity: 0; }
|
||||
}
|
||||
|
||||
.bar { width: 100%; height: 4px; background: var(--color-shape-secondary); overflow: hidden; border-radius: 8px; position: relative; }
|
||||
|
||||
.fill { position: absolute; left: 0px; top: 0px; height: 100%; background: var(--color-system-accent-25); transition: width 0.2s linear; }
|
||||
.fill::after {
|
||||
content: ''; width: 100%; height: 100%; position: absolute; left: 0px; top: 0px;
|
||||
background-image: linear-gradient(90deg, rgba(0,0,0,0) 0%, var(--color-system-accent-50) 50%, rgba(0,0,0,0) 100%);
|
||||
animation: animateGradient 2s linear infinite;
|
||||
}
|
||||
|
||||
@keyframes animateGradient {
|
||||
0% { opacity: 1; transform: translateX(-100%); }
|
||||
50% { transform: translateX(100%); }
|
||||
50.01% { opacity: 0; }
|
||||
100% { opacity: 0; }
|
||||
}
|
||||
}
|
||||
.item:hover {
|
||||
.nameWrap {
|
||||
.icon.close { opacity: 1; }
|
||||
}
|
||||
}
|
||||
.item:last-child { border-bottom: 0px; }
|
||||
}
|
||||
|
||||
.progress.hide { background: rgba(0,0,0,0); }
|
||||
|
|
|
@ -5,7 +5,10 @@
|
|||
gap: 0px 8px; overflow: hidden;
|
||||
}
|
||||
> .head {
|
||||
.name { @include text-overflow-nw; opacity: 0; transform: translate3d(0px,30px,0px); transition: all 0.2s $easeInQuint; }
|
||||
.name {
|
||||
@include text-overflow-nw; opacity: 0; transform: translate3d(0px,30px,0px); transition: all 0.2s $easeInQuint;
|
||||
max-width: calc(100% - 88px);
|
||||
}
|
||||
}
|
||||
> .head.show {
|
||||
.name { opacity: 1; transform: translate3d(0px,0px,0px); }
|
||||
|
|
|
@ -1,16 +1,14 @@
|
|||
@import "~scss/_mixins";
|
||||
|
||||
.input-drag-vertical { padding: 8px 2px; width: 20px; height: 88px; border-radius: 8px; background-color: var(--color-control-bg); box-shadow: 0px 4px 16px rgba(0, 0, 0, 0.2); }
|
||||
.input-drag-vertical { padding: 8px 2px; width: 20px; height: 88px; border-radius: 8px; background-color: var(--color-bg-primary); box-shadow: 0px 4px 16px rgba(0, 0, 0, 0.2); border: 1px solid var(--color-shape-secondary); }
|
||||
.input-drag-vertical {
|
||||
.vertical-range,
|
||||
.vertical-range::-webkit-slider-runnable-track,
|
||||
.vertical-range::-webkit-slider-thumb { -webkit-appearance: none; }
|
||||
|
||||
.vertical-range { position: absolute; width: 14px; height: 72px; cursor: pointer; writing-mode: vertical-lr; padding: unset; }
|
||||
.vertical-range::-webkit-slider-runnable-track { height: 100%; width: 10px;
|
||||
background: linear-gradient(180deg, var(--color-control-accent) 0%, var(--color-control-accent) var(--background-size, 0%),
|
||||
var(--color-control-inactive) var(--background-size, 0%), var(--color-control-inactive) 100%);;
|
||||
transform: scaleY(-1); /* Flips the background vertically */
|
||||
background-size: 4px 100%; background-repeat: no-repeat; border-radius: 2px; background-position: 4px 0px; }
|
||||
.vertical-range { position: absolute; width: 14px; height: 72px; cursor: pointer; writing-mode: vertical-rl; padding: unset; cursor: auto; }
|
||||
.vertical-range::-webkit-slider-runnable-track { height: 100%; width: 10px; }
|
||||
.vertical-range::-webkit-slider-thumb { width: 0px; height: 0px; background: transparent; border: none; }
|
||||
.slider-track { pointer-events: none; position: absolute; left: 8px; bottom: 8px; background-color: var(--color-control-accent); width: 4px; border-radius: 2px; }
|
||||
.slider-bg { pointer-events: none; position: absolute; left: 8px; bottom: 8px; background-color: var(--color-shape-secondary); width: 4px; border-radius: 2px; height: 72px; }
|
||||
}
|
||||
|
|
|
@ -170,6 +170,8 @@ html.themeDark {
|
|||
}
|
||||
|
||||
.inputWithFile { border-color: transparent; background-color: var(--color-shape-highlight-medium); }
|
||||
.input-drag-vertical { background-color: var(--color-bg-secondary); }
|
||||
|
||||
.input-drag-horizontal {
|
||||
.fill { background: var(--color-text-primary); }
|
||||
.icon { border-color: var(--color-text-secondary); }
|
||||
|
|
|
@ -75,3 +75,7 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
.button.widget {
|
||||
.icon.bin { background-image: url('#{$themePath}/icon/widget/button/bin.svg'); }
|
||||
}
|
|
@ -257,7 +257,7 @@ class App extends React.Component<object, State> {
|
|||
Renderer.on('update-available', this.onUpdateAvailable);
|
||||
Renderer.on('update-confirm', this.onUpdateConfirm);
|
||||
Renderer.on('update-not-available', this.onUpdateUnavailable);
|
||||
Renderer.on('update-downloaded', () => S.Common.progressClear());
|
||||
Renderer.on('update-downloaded', () => S.Progress.delete('update'));
|
||||
Renderer.on('update-error', this.onUpdateError);
|
||||
Renderer.on('download-progress', this.onUpdateProgress);
|
||||
Renderer.on('spellcheck', this.onSpellcheck);
|
||||
|
@ -422,12 +422,12 @@ class App extends React.Component<object, State> {
|
|||
|
||||
onUpdateCheck (e: any, auto: boolean) {
|
||||
if (!auto) {
|
||||
S.Common.progressSet({ status: translate('progressUpdateCheck'), current: 0, total: 1, isUnlocked: true });
|
||||
S.Progress.add({ id: I.ProgressType.UpdateCheck, type: I.ProgressType.UpdateCheck, current: 0, total: 1 });
|
||||
};
|
||||
};
|
||||
|
||||
onUpdateConfirm (e: any, auto: boolean) {
|
||||
S.Common.progressClear();
|
||||
S.Progress.delete(I.ProgressType.UpdateCheck);
|
||||
Storage.setHighlight('whatsNew', true);
|
||||
|
||||
if (auto) {
|
||||
|
@ -453,7 +453,7 @@ class App extends React.Component<object, State> {
|
|||
};
|
||||
|
||||
onUpdateAvailable (e: any, auto: boolean) {
|
||||
S.Common.progressClear();
|
||||
S.Progress.delete(I.ProgressType.UpdateCheck);
|
||||
|
||||
if (auto) {
|
||||
return;
|
||||
|
@ -478,7 +478,7 @@ class App extends React.Component<object, State> {
|
|||
};
|
||||
|
||||
onUpdateUnavailable (e: any, auto: boolean) {
|
||||
S.Common.progressClear();
|
||||
S.Progress.delete(I.ProgressType.UpdateCheck);
|
||||
|
||||
if (auto) {
|
||||
return;
|
||||
|
@ -499,7 +499,7 @@ class App extends React.Component<object, State> {
|
|||
|
||||
onUpdateError (e: any, err: string, auto: boolean) {
|
||||
console.error(err);
|
||||
S.Common.progressClear();
|
||||
S.Progress.delete(I.ProgressType.UpdateCheck);
|
||||
|
||||
if (auto) {
|
||||
return;
|
||||
|
@ -524,11 +524,11 @@ class App extends React.Component<object, State> {
|
|||
};
|
||||
|
||||
onUpdateProgress (e: any, progress: any) {
|
||||
S.Common.progressSet({
|
||||
status: U.Common.sprintf(translate('commonUpdateProgress'), U.File.size(progress.transferred), U.File.size(progress.total)),
|
||||
S.Progress.update({
|
||||
id: I.ProgressType.Update,
|
||||
type: I.ProgressType.Update,
|
||||
current: progress.transferred,
|
||||
total: progress.total,
|
||||
isUnlocked: true,
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
@ -216,8 +216,8 @@ const ChatButtons = observer(class ChatButtons extends React.Component<Props, St
|
|||
{ type: I.MarkType.Underline, icon: 'underline', name: translate('commonUnderline'), caption: `${cmd} + U` },
|
||||
{ type: I.MarkType.Link, icon: 'link', name: translate('commonLink'), caption: `${cmd} + K` },
|
||||
{ type: I.MarkType.Code, icon: 'kbd', name: translate('commonCode'), caption: `${cmd} + L` },
|
||||
{ type: I.MarkType.Color, icon: 'color', name: translate('commonColor'), caption: `${cmd} + Shift + C`, inner: color },
|
||||
{ type: I.MarkType.BgColor, icon: 'color', name: translate('commonBackground'), caption: `${cmd} + Shift + H`, inner: background },
|
||||
//{ type: I.MarkType.Color, icon: 'color', name: translate('commonColor'), caption: `${cmd} + Shift + C`, inner: color },
|
||||
//{ type: I.MarkType.BgColor, icon: 'color', name: translate('commonBackground'), caption: `${cmd} + Shift + H`, inner: background },
|
||||
].map((it: any) => {
|
||||
it.isActive = false;
|
||||
if (it.type == I.MarkType.Link) {
|
||||
|
@ -248,8 +248,8 @@ const ChatButtons = observer(class ChatButtons extends React.Component<Props, St
|
|||
});
|
||||
};
|
||||
|
||||
let data;
|
||||
let menuItem;
|
||||
let menuId = '';
|
||||
let data: any = {};
|
||||
|
||||
if (menu) {
|
||||
if (menu == 'upload') {
|
||||
|
@ -257,7 +257,7 @@ const ChatButtons = observer(class ChatButtons extends React.Component<Props, St
|
|||
return;
|
||||
};
|
||||
|
||||
menuItem = 'searchObject';
|
||||
menuId = 'searchObject';
|
||||
data = {
|
||||
skipIds: attachments.map(it => it.id),
|
||||
filters: [
|
||||
|
@ -268,6 +268,9 @@ const ChatButtons = observer(class ChatButtons extends React.Component<Props, St
|
|||
}
|
||||
};
|
||||
|
||||
if (menu == 'object') {
|
||||
data.filters.push({ relationKey: 'layout', condition: I.FilterCondition.NotIn, value: U.Object.getFileLayouts() });
|
||||
} else
|
||||
if ([ 'file', 'media' ].includes(menu)) {
|
||||
const layouts = {
|
||||
media: [ I.ObjectLayout.Image, I.ObjectLayout.Audio, I.ObjectLayout.Video ],
|
||||
|
@ -285,9 +288,9 @@ const ChatButtons = observer(class ChatButtons extends React.Component<Props, St
|
|||
});
|
||||
};
|
||||
} else {
|
||||
menuItem = 'select';
|
||||
menuId = 'select';
|
||||
data = {
|
||||
options: options,
|
||||
options,
|
||||
onSelect: (e: React.MouseEvent, option: any) => {
|
||||
this.onAttachment(option.id);
|
||||
}
|
||||
|
@ -295,7 +298,7 @@ const ChatButtons = observer(class ChatButtons extends React.Component<Props, St
|
|||
};
|
||||
|
||||
S.Menu.closeAll(null, () => {
|
||||
S.Menu.open(menuItem, {
|
||||
S.Menu.open(menuId, {
|
||||
element: `#block-${blockId} #button-${blockId}-${I.ChatButton.Object}`,
|
||||
className: 'chatAttachment',
|
||||
offsetY: -8,
|
||||
|
|
|
@ -712,6 +712,7 @@ const ChatForm = observer(class ChatForm extends React.Component<Props, State> {
|
|||
this.marks = [];
|
||||
this.updateMarkup('', 0, 0);
|
||||
this.setState({ attachments: [] }, () => this.refEditable.setRange(this.range));
|
||||
this.refButtons.setButtons();
|
||||
};
|
||||
|
||||
onReply (message: I.ChatMessage) {
|
||||
|
@ -741,7 +742,7 @@ const ChatForm = observer(class ChatForm extends React.Component<Props, State> {
|
|||
bgColor: 'red',
|
||||
title: translate('popupConfirmChatDeleteMessageTitle'),
|
||||
text: translate('popupConfirmChatDeleteMessageText'),
|
||||
textConfirm: translate('commonYes'),
|
||||
textConfirm: translate('commonDelete'),
|
||||
onConfirm: () => {
|
||||
C.ChatDeleteMessage(rootId, id, () => {
|
||||
if (this.editingId == id) {
|
||||
|
|
|
@ -56,6 +56,7 @@ const ChatMessage = observer(class ChatMessage extends React.Component<Props> {
|
|||
let reply = null;
|
||||
if (replyToMessageId) {
|
||||
const replyToMessage = S.Chat.getReply(rootId, replyToMessageId);
|
||||
|
||||
if (replyToMessage) {
|
||||
const { text, attachment, isMultiple } = getReplyContent(replyToMessage);
|
||||
const author = U.Space.getParticipant(U.Space.getParticipantId(space, replyToMessage.creator));
|
||||
|
|
|
@ -923,7 +923,7 @@ const BlockDataview = observer(class BlockDataview extends React.Component<Props
|
|||
};
|
||||
|
||||
if (!view.isGrid() && Relation.isUrl(relation.format)) {
|
||||
Action.openUrl(Relation.getUrlScheme(relation.format, record[relationKey]) + record[relationKey]);
|
||||
Action.openUrl(Relation.checkUrlScheme(relation.format, record[relationKey]));
|
||||
return;
|
||||
};
|
||||
|
||||
|
|
|
@ -187,7 +187,7 @@ const Cell = observer(class Cell extends React.Component<Props> {
|
|||
|
||||
if (!canEdit) {
|
||||
if (Relation.isUrl(relation.format) && value) {
|
||||
Action.openUrl(Relation.getUrlScheme(relation.format, value) + value);
|
||||
Action.openUrl(Relation.checkUrlScheme(relation.format, value));
|
||||
return;
|
||||
};
|
||||
|
||||
|
@ -380,8 +380,7 @@ const Cell = observer(class Cell extends React.Component<Props> {
|
|||
});
|
||||
|
||||
if (e.shiftKey && value) {
|
||||
const scheme = Relation.getUrlScheme(relation.format, value);
|
||||
Action.openUrl(scheme + value);
|
||||
Action.openUrl(Relation.checkUrlScheme(relation.format, value));
|
||||
|
||||
ret = true;
|
||||
break;
|
||||
|
@ -409,11 +408,9 @@ const Cell = observer(class Cell extends React.Component<Props> {
|
|||
return;
|
||||
};
|
||||
|
||||
const scheme = Relation.getUrlScheme(relation.format, value);
|
||||
|
||||
switch (item.id) {
|
||||
case 'go': {
|
||||
Action.openUrl(scheme + value);
|
||||
Action.openUrl(Relation.checkUrlScheme(relation.format, value));
|
||||
analytics.event('RelationUrlOpen');
|
||||
break;
|
||||
};
|
||||
|
|
|
@ -1,22 +1,47 @@
|
|||
import * as React from 'react';
|
||||
import { observer } from 'mobx-react';
|
||||
import { PieChart } from 'react-minimal-pie-chart';
|
||||
import { Icon } from 'Component';
|
||||
import { I, Preview, translate } from 'Lib';
|
||||
import { I, S, Preview, translate } from 'Lib';
|
||||
|
||||
const FooterMainEdit = class FooterMainEdit extends React.Component<I.FooterComponent> {
|
||||
const FooterMainEdit = observer(class FooterMainEdit extends React.Component<I.FooterComponent> {
|
||||
|
||||
render () {
|
||||
const { onHelp } = this.props;
|
||||
const { show } = S.Progress;
|
||||
const current = S.Progress.getCurrent();
|
||||
const total = S.Progress.getTotal();
|
||||
|
||||
return (
|
||||
<div
|
||||
id="button-help"
|
||||
className="iconWrap"
|
||||
onClick={onHelp}
|
||||
onMouseEnter={e => this.onTooltipShow(e, translate('commonHelp'))}
|
||||
onMouseLeave={() => Preview.tooltipHide(false)}
|
||||
>
|
||||
<Icon />
|
||||
<div className="bg" />
|
||||
<div className="buttons">
|
||||
{total ? (
|
||||
<div
|
||||
id="button-progress"
|
||||
className="iconWrap"
|
||||
onClick={() => S.Progress.showSet(!show)}
|
||||
>
|
||||
<div className="inner">{current}</div>
|
||||
<PieChart
|
||||
totalValue={total}
|
||||
startAngle={270}
|
||||
lengthAngle={-360}
|
||||
data={[
|
||||
{ title: '', value: 100 - current, color: '#ebebeb' },
|
||||
{ title: '', value: current, color: '#ffd15b' },
|
||||
]}
|
||||
/>
|
||||
</div>
|
||||
) : ''}
|
||||
<div
|
||||
id="button-help"
|
||||
className="iconWrap"
|
||||
onClick={onHelp}
|
||||
onMouseEnter={e => this.onTooltipShow(e, translate('commonHelp'))}
|
||||
onMouseLeave={() => Preview.tooltipHide(false)}
|
||||
>
|
||||
<Icon />
|
||||
<div className="bg" />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
@ -28,6 +53,6 @@ const FooterMainEdit = class FooterMainEdit extends React.Component<I.FooterComp
|
|||
};
|
||||
};
|
||||
|
||||
};
|
||||
});
|
||||
|
||||
export default FooterMainEdit;
|
|
@ -1,5 +1,5 @@
|
|||
import * as React from 'react';
|
||||
import { useEffect, useImperativeHandle, useRef } from 'react';
|
||||
import { useImperativeHandle, useRef } from 'react';
|
||||
import { Input } from 'Component';
|
||||
|
||||
interface Props {
|
||||
|
@ -27,27 +27,17 @@ const DragVertical = React.forwardRef<Input, Props>(({
|
|||
}, forwardedRef) => {
|
||||
const inputRef = useRef(null);
|
||||
const divRef = useRef(null);
|
||||
useImperativeHandle(forwardedRef, () => divRef.current);
|
||||
|
||||
const setBackgroundSize = () => {
|
||||
if (inputRef) {
|
||||
const mn = min || 0;
|
||||
const mx = max || 100;
|
||||
const size = Math.round((value - mn) / (mx - mn) * 100);
|
||||
inputRef.current?.node.style?.setProperty('--background-size', `${size}%`);
|
||||
}
|
||||
};
|
||||
useImperativeHandle(forwardedRef, () => divRef.current);
|
||||
|
||||
const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
||||
if (onChange) {
|
||||
onChange(e, Number(e.target.value));
|
||||
}
|
||||
};
|
||||
|
||||
useEffect(() => { setBackgroundSize(); }, [value]);
|
||||
if (onChange) {
|
||||
onChange(e, 1 - Number(e.target.value));
|
||||
};
|
||||
};
|
||||
|
||||
return (
|
||||
<div
|
||||
|
@ -71,8 +61,10 @@ const DragVertical = React.forwardRef<Input, Props>(({
|
|||
e.stopPropagation();
|
||||
}}
|
||||
/>
|
||||
<div className="slider-bg"></div>
|
||||
<div className="slider-track" style={{ height: `${Math.round(value * 72)}px` }}></div>
|
||||
</div>
|
||||
);
|
||||
});
|
||||
|
||||
export default DragVertical;
|
||||
export default DragVertical;
|
|
@ -117,6 +117,7 @@ class MenuObject extends React.Component<I.Menu> {
|
|||
let createWidget = { id: 'createWidget', icon: 'createWidget', name: translate('menuObjectCreateWidget') };
|
||||
let downloadFile = { id: 'downloadFile', icon: 'download', name: translate('commonDownload') };
|
||||
let openFile = { id: 'openFile', icon: 'expand', name: translate('menuObjectDownloadOpen') };
|
||||
let openObject = { id: 'openAsObject', icon: 'expand', name: translate('commonOpenObject') };
|
||||
|
||||
if (isTemplate) {
|
||||
template = { id: 'pageCreate', icon: 'template', name: translate('commonCreateObject') };
|
||||
|
@ -181,25 +182,27 @@ class MenuObject extends React.Component<I.Menu> {
|
|||
const allowedPrint = !isFilePreview;
|
||||
const allowedDownloadFile = U.Object.isInFileLayouts(object.layout);
|
||||
const allowedOpenFile = U.Object.isInFileLayouts(object.layout);
|
||||
const allowedOpenObject = isFilePreview;
|
||||
|
||||
if (!allowedArchive) archive = null;
|
||||
if (!allowedLock) pageLock = null;
|
||||
if (!allowedCopy) pageCopy = null;
|
||||
if (!allowedReload) pageReload = null;
|
||||
if (!allowedSearch) search = null;
|
||||
if (!allowedHistory) history = null;
|
||||
if (!allowedFav) fav = null;
|
||||
if (!allowedArchive) archive = null;
|
||||
if (!allowedLock) pageLock = null;
|
||||
if (!allowedCopy) pageCopy = null;
|
||||
if (!allowedReload) pageReload = null;
|
||||
if (!allowedSearch) search = null;
|
||||
if (!allowedHistory) history = null;
|
||||
if (!allowedFav) fav = null;
|
||||
if (!allowedInstall && !allowedUninstall) pageInstall = null;
|
||||
if (!isTemplate && !allowedTemplate) template = null;
|
||||
if (allowedUninstall) archive = null;
|
||||
if (!allowedWidget) createWidget = null;
|
||||
if (!allowedLinkTo) linkTo = null;
|
||||
if (!allowedPageLink) pageLink = null;
|
||||
if (allowedUninstall) archive = null;
|
||||
if (!allowedWidget) createWidget = null;
|
||||
if (!allowedLinkTo) linkTo = null;
|
||||
if (!allowedPageLink) pageLink = null;
|
||||
if (!allowedAddCollection) addCollection = null;
|
||||
if (!allowedExport) pageExport = null;
|
||||
if (!allowedPrint) print = null;
|
||||
if (!allowedExport) pageExport = null;
|
||||
if (!allowedPrint) print = null;
|
||||
if (!allowedDownloadFile) downloadFile = null;
|
||||
if (!allowedOpenFile) openFile = null;
|
||||
if (!allowedOpenObject) openObject = null;
|
||||
|
||||
if (!canWrite) {
|
||||
template = null;
|
||||
|
@ -213,33 +216,37 @@ class MenuObject extends React.Component<I.Menu> {
|
|||
pageCopy = null;
|
||||
};
|
||||
|
||||
sections = [
|
||||
sections = sections.concat([
|
||||
{ children: [ openObject ] },
|
||||
{ children: [ createWidget, fav, pageLock, history ] },
|
||||
{ children: [ linkTo, addCollection ] },
|
||||
{ children: [ search, pageLink, pageInstall, pageCopy, archive, remove ] },
|
||||
{ children: [ print ] },
|
||||
{ children: [ openFile, downloadFile ] },
|
||||
];
|
||||
]);
|
||||
} else {
|
||||
if (isTemplate) {
|
||||
sections = [
|
||||
sections = sections.concat([
|
||||
{ children: [ openObject ] },
|
||||
{ children: [ search, template, pageCopy, setDefaultTemplate, pageExport, archive, history ] },
|
||||
{ children: [ print ] },
|
||||
];
|
||||
]);
|
||||
} else
|
||||
if (object.isArchived) {
|
||||
sections = [
|
||||
sections = sections.concat([
|
||||
{ children: [ openObject ] },
|
||||
{ children: [ search, pageExport, remove, archive ] },
|
||||
{ children: [ print ] },
|
||||
];
|
||||
]);
|
||||
} else {
|
||||
sections = [
|
||||
sections = sections.concat([
|
||||
{ children: [ openObject ] },
|
||||
{ children: [ createWidget, fav, pageLock ] },
|
||||
{ children: [ linkTo, addCollection, template ] },
|
||||
{ children: [ search, history, pageCopy, archive ] },
|
||||
{ children: [ pageLink, pageReload ] },
|
||||
{ children: [ print, pageExport ] },
|
||||
];
|
||||
]);
|
||||
};
|
||||
|
||||
sections = sections.map((it: any, i: number) => ({ ...it, id: 'page' + i }));
|
||||
|
@ -538,6 +545,11 @@ class MenuObject extends React.Component<I.Menu> {
|
|||
Action.downloadFile(object.id, route, U.Object.isImageLayout(object.layout));
|
||||
break;
|
||||
};
|
||||
|
||||
case 'openAsObject': {
|
||||
U.Object.openAuto(object);
|
||||
break;
|
||||
};
|
||||
};
|
||||
|
||||
if (close) {
|
||||
|
|
|
@ -316,7 +316,7 @@ class MenuQuickCapture extends React.Component<I.Menu, State> {
|
|||
} else {
|
||||
const pinned = pinnedIds.map(id => S.Record.getTypeById(id)).filter(it => it).slice(0, LIMIT_PINNED);
|
||||
|
||||
items = U.Data.getObjectTypesForNewObject({ withChat: true }).filter(it => !pinnedIds.includes(it.id));
|
||||
items = U.Data.getObjectTypesForNewObject().filter(it => !pinnedIds.includes(it.id));
|
||||
items = items.slice(0, LIMIT_PINNED - pinned.length);
|
||||
items.push(S.Record.getSetType());
|
||||
items.push(S.Record.getCollectionType());
|
||||
|
|
|
@ -97,7 +97,7 @@ const PageAuthDeleted = observer(class PageAuthDeleted extends React.Component<I
|
|||
</Frame>
|
||||
|
||||
<div className="animation small bottom" onClick={this.onLogout}>
|
||||
Log out
|
||||
{translate('popupSettingsLogout')}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
|
|
@ -83,14 +83,13 @@ const PopupSettingsPageLogout = observer(class PopupSettingsPageLogout extends R
|
|||
|
||||
onLogout () {
|
||||
this.props.setPinConfirmed(false);
|
||||
analytics.event('LogOut');
|
||||
|
||||
U.Router.go('/', {
|
||||
replace: true,
|
||||
animate: true,
|
||||
onRouteChange: () => {
|
||||
S.Auth.logout(true, false);
|
||||
|
||||
analytics.event('LogOut');
|
||||
},
|
||||
});
|
||||
};
|
||||
|
|
|
@ -58,7 +58,7 @@ const PopupSettingsSpaceIndex = observer(class PopupSettingsSpaceIndex extends R
|
|||
const hasLink = cid && key;
|
||||
const isOwner = U.Space.isMyOwner();
|
||||
const canWrite = U.Space.canMyParticipantWrite();
|
||||
const canDelete = !space.isPersonal && isOwner;
|
||||
const canDelete = !space.isPersonal;
|
||||
const isShareActive = U.Space.isShareActive();
|
||||
|
||||
let bytesUsed = 0;
|
||||
|
@ -446,9 +446,9 @@ const PopupSettingsSpaceIndex = observer(class PopupSettingsSpaceIndex extends R
|
|||
const space = U.Space.getSpaceview();
|
||||
|
||||
if (space.isShared && !cid && !key) {
|
||||
C.SpaceInviteGetCurrent(S.Common.space, (message: any) => {
|
||||
if (!message.error.code) {
|
||||
this.setInvite(message.inviteCid, message.inviteKey);
|
||||
U.Space.getInvite(S.Common.space, (cid: string, key: string) => {
|
||||
if (cid && key) {
|
||||
this.setInvite(cid, key);
|
||||
};
|
||||
});
|
||||
};
|
||||
|
|
|
@ -271,9 +271,9 @@ const PopupSettingsSpaceShare = observer(class PopupSettingsSpaceShare extends R
|
|||
const space = U.Space.getSpaceview();
|
||||
|
||||
if (space.isShared && !cid && !key) {
|
||||
C.SpaceInviteGetCurrent(S.Common.space, (message: any) => {
|
||||
if (!message.error.code) {
|
||||
this.setInvite(message.inviteCid, message.inviteKey);
|
||||
U.Space.getInvite(S.Common.space, (cid: string, key: string) => {
|
||||
if (cid && key) {
|
||||
this.setInvite(cid, key);
|
||||
};
|
||||
});
|
||||
};
|
||||
|
|
|
@ -160,12 +160,13 @@ class PopupUsecasePageItem extends React.Component<I.PopupUsecase, State> {
|
|||
noVirtualisation: true,
|
||||
onSelect: (e: any, item: any) => {
|
||||
const isNew = item.id == 'add';
|
||||
const withChat = U.Common.isChatAllowed();
|
||||
|
||||
this.setState({ isLoading: true });
|
||||
analytics.event('ClickGalleryInstallSpace', { type: isNew ? 'New' : 'Existing', route });
|
||||
|
||||
if (isNew) {
|
||||
C.WorkspaceCreate({ name: object.title, iconOption: U.Common.rand(1, J.Constant.count.icon) }, I.Usecase.None, config.experimental, (message: any) => {
|
||||
C.WorkspaceCreate({ name: object.title, iconOption: U.Common.rand(1, J.Constant.count.icon) }, I.Usecase.None, withChat, (message: any) => {
|
||||
if (!message.error.code) {
|
||||
cb(message.objectId, true);
|
||||
|
||||
|
|
|
@ -28,6 +28,7 @@ const PopupSpaceCreate = observer(class PopupSpaceCreate extends React.Component
|
|||
|
||||
this.onKeyDown = this.onKeyDown.bind(this);
|
||||
this.onChange = this.onChange.bind(this);
|
||||
this.onIcon = this.onIcon.bind(this);
|
||||
};
|
||||
|
||||
render () {
|
||||
|
@ -52,6 +53,7 @@ const PopupSpaceCreate = observer(class PopupSpaceCreate extends React.Component
|
|||
object={space}
|
||||
canEdit={false}
|
||||
menuParam={{ horizontal: I.MenuDirection.Center }}
|
||||
onClick={this.onIcon}
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
@ -106,7 +108,6 @@ const PopupSpaceCreate = observer(class PopupSpaceCreate extends React.Component
|
|||
};
|
||||
|
||||
onSubmit (withImport: boolean) {
|
||||
const { config } = S.Common;
|
||||
const { param } = this.props;
|
||||
const { isLoading, iconOption } = this.state;
|
||||
const { data } = param;
|
||||
|
@ -119,13 +120,14 @@ const PopupSpaceCreate = observer(class PopupSpaceCreate extends React.Component
|
|||
|
||||
this.setLoading(true);
|
||||
|
||||
const withChat = U.Common.isChatAllowed();
|
||||
const details = {
|
||||
name,
|
||||
iconOption,
|
||||
spaceDashboardId: I.HomePredefinedId.Last,
|
||||
};
|
||||
|
||||
C.WorkspaceCreate(details, I.Usecase.GetStarted, config.experimental, (message: any) => {
|
||||
C.WorkspaceCreate(details, I.Usecase.GetStarted, withChat, (message: any) => {
|
||||
this.setLoading(false);
|
||||
|
||||
if (message.error.code) {
|
||||
|
@ -170,6 +172,17 @@ const PopupSpaceCreate = observer(class PopupSpaceCreate extends React.Component
|
|||
this.setState({ isLoading });
|
||||
};
|
||||
|
||||
onIcon () {
|
||||
let { iconOption } = this.state;
|
||||
|
||||
iconOption++;
|
||||
if (iconOption > J.Constant.count.icon) {
|
||||
iconOption = 1;
|
||||
};
|
||||
|
||||
this.setState({ iconOption });
|
||||
};
|
||||
|
||||
});
|
||||
|
||||
export default PopupSpaceCreate;
|
|
@ -484,6 +484,15 @@ const SidebarPageObject = observer(class SidebarPageObject extends React.Compone
|
|||
subId: J.Constant.subId.allObject,
|
||||
route: analytics.route.allObjects,
|
||||
allowedLinkTo: true,
|
||||
onSelect: id => {
|
||||
switch (id) {
|
||||
case 'archive': {
|
||||
this.selected = [];
|
||||
this.renderSelection();
|
||||
break;
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
|
@ -23,7 +23,7 @@ const SidebarPageWidget = observer(class SidebarPageWidget extends React.Compone
|
|||
position: I.BlockPosition = null;
|
||||
isDragging = false;
|
||||
frame = 0;
|
||||
isSubcribed = false;
|
||||
isSubcribed = '';
|
||||
|
||||
constructor (props) {
|
||||
super(props);
|
||||
|
@ -225,7 +225,11 @@ const SidebarPageWidget = observer(class SidebarPageWidget extends React.Compone
|
|||
);
|
||||
};
|
||||
|
||||
componentDidMount(): void {
|
||||
componentDidMount (): void {
|
||||
this.subscribeArchive();
|
||||
};
|
||||
|
||||
componentDidUpdate (): void {
|
||||
this.subscribeArchive();
|
||||
};
|
||||
|
||||
|
@ -525,21 +529,23 @@ const SidebarPageWidget = observer(class SidebarPageWidget extends React.Compone
|
|||
};
|
||||
|
||||
subscribeArchive () {
|
||||
if (this.isSubcribed) {
|
||||
const { space } = S.Common
|
||||
|
||||
if (this.isSubcribed == space) {
|
||||
return;
|
||||
};
|
||||
|
||||
this.isSubcribed = true;
|
||||
|
||||
U.Data.searchSubscribe({
|
||||
subId: SUB_ID,
|
||||
spaceId: S.Common.space,
|
||||
spaceId: space,
|
||||
withArchived: true,
|
||||
filters: [
|
||||
{ relationKey: 'isArchived', condition: I.FilterCondition.Equal, value: true },
|
||||
],
|
||||
limit: 1,
|
||||
}, () => {});
|
||||
}, () => {
|
||||
this.isSubcribed = space;
|
||||
});
|
||||
};
|
||||
|
||||
});
|
||||
|
|
|
@ -93,18 +93,18 @@ const FontSize = {
|
|||
};
|
||||
|
||||
const DefaultIcons = [ 'page', 'task', 'set', 'chat', 'bookmark', 'type' ];
|
||||
const Ghost = require('img/icon/ghost.svg').default;
|
||||
const Ghost = require('img/icon/ghost.svg');
|
||||
|
||||
const CheckboxTask = {
|
||||
'': {
|
||||
0: require('img/icon/object/checkbox0.svg').default,
|
||||
1: require('img/icon/object/checkbox1.svg').default,
|
||||
2: require('img/icon/object/checkbox2.svg').default,
|
||||
0: require('img/icon/object/checkbox0.svg'),
|
||||
1: require('img/icon/object/checkbox1.svg'),
|
||||
2: require('img/icon/object/checkbox2.svg'),
|
||||
},
|
||||
dark: {
|
||||
0: require('img/icon/object/checkbox0.svg').default,
|
||||
1: require('img/theme/dark/icon/object/checkbox1.svg').default,
|
||||
2: require('img/icon/object/checkbox2.svg').default,
|
||||
0: require('img/icon/object/checkbox0.svg'),
|
||||
1: require('img/theme/dark/icon/object/checkbox1.svg'),
|
||||
2: require('img/icon/object/checkbox2.svg'),
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -239,10 +239,8 @@ const IconObject = observer(class IconObject extends React.Component<Props> {
|
|||
break;
|
||||
};
|
||||
|
||||
const src = require(`img/icon/relation/${Relation.typeName(relationFormat)}.svg`).default;
|
||||
|
||||
icn = icn.concat([ 'iconCommon', 'c' + iconSize ]);
|
||||
icon = <img src={src} className={icn.join(' ')} />;
|
||||
icon = <img src={`./img/icon/relation/${Relation.typeName(relationFormat)}.svg`} className={icn.join(' ')} />;
|
||||
break;
|
||||
};
|
||||
|
||||
|
@ -263,7 +261,7 @@ const IconObject = observer(class IconObject extends React.Component<Props> {
|
|||
icon = <img src={S.Common.imageUrl(id, iconSize * 2)} className={icn.join(' ')} />;
|
||||
} else {
|
||||
icn = icn.concat([ 'iconFile', 'c' + iconSize ]);
|
||||
icon = <img src={U.File.iconImage(object)} className={icn.join(' ')} />;
|
||||
icon = <img src={U.File.iconPath(object)} className={icn.join(' ')} />;
|
||||
};
|
||||
break;
|
||||
};
|
||||
|
@ -273,7 +271,7 @@ const IconObject = observer(class IconObject extends React.Component<Props> {
|
|||
case I.ObjectLayout.Pdf:
|
||||
case I.ObjectLayout.File: {
|
||||
icn = icn.concat([ 'iconFile', 'c' + iconSize ]);
|
||||
icon = <img src={U.File.iconImage(object)} className={icn.join(' ')} />;
|
||||
icon = <img src={U.File.iconPath(object)} className={icn.join(' ')} />;
|
||||
break;
|
||||
};
|
||||
|
||||
|
@ -502,7 +500,7 @@ const IconObject = observer(class IconObject extends React.Component<Props> {
|
|||
};
|
||||
|
||||
defaultIcon (type: string) {
|
||||
return require(`img/icon/default/${type}.svg`).default;
|
||||
return require(`img/icon/default/${type}.svg`);
|
||||
};
|
||||
|
||||
});
|
||||
|
|
|
@ -15,28 +15,28 @@ interface Props {
|
|||
|
||||
const Icons = {
|
||||
checkbox: {
|
||||
0: require('img/icon/marker/checkbox0.svg').default,
|
||||
1: require('img/icon/marker/checkbox1.svg').default,
|
||||
2: require('img/icon/marker/checkbox2.svg').default,
|
||||
0: require('img/icon/marker/checkbox0.svg'),
|
||||
1: require('img/icon/marker/checkbox1.svg'),
|
||||
2: require('img/icon/marker/checkbox2.svg'),
|
||||
},
|
||||
task: {
|
||||
0: require('img/icon/object/checkbox0.svg').default,
|
||||
1: require('img/icon/object/checkbox1.svg').default,
|
||||
2: require('img/icon/object/checkbox2.svg').default,
|
||||
0: require('img/icon/object/checkbox0.svg'),
|
||||
1: require('img/icon/object/checkbox1.svg'),
|
||||
2: require('img/icon/object/checkbox2.svg'),
|
||||
},
|
||||
};
|
||||
|
||||
const Theme = {
|
||||
dark: {
|
||||
checkbox: {
|
||||
0: require('img/icon/marker/checkbox0.svg').default,
|
||||
1: require('img/theme/dark/icon/marker/checkbox1.svg').default,
|
||||
2: require('img/icon/marker/checkbox2.svg').default,
|
||||
0: require('img/icon/marker/checkbox0.svg'),
|
||||
1: require('img/theme/dark/icon/marker/checkbox1.svg'),
|
||||
2: require('img/icon/marker/checkbox2.svg'),
|
||||
},
|
||||
task: {
|
||||
0: require('img/icon/object/checkbox0.svg').default,
|
||||
1: require('img/theme/dark/icon/object/checkbox1.svg').default,
|
||||
2: require('img/icon/object/checkbox2.svg').default,
|
||||
0: require('img/icon/object/checkbox0.svg'),
|
||||
1: require('img/theme/dark/icon/object/checkbox1.svg'),
|
||||
2: require('img/icon/object/checkbox2.svg'),
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -34,7 +34,7 @@ class MediaAudio extends React.PureComponent<Props, State> {
|
|||
playOnSeek = false;
|
||||
current: PlaylistItem = { name: '', src: '' };
|
||||
resizeObserver: ResizeObserver;
|
||||
fadeOutVolumeSlider = _.debounce(() => this.setState({ showVolumeSlider: false }), 500);
|
||||
fadeOutVolumeSlider = _.debounce(() => this.setState({ showVolumeSlider: false }), 250);
|
||||
|
||||
startedPlaying = false;
|
||||
|
||||
|
@ -93,9 +93,7 @@ class MediaAudio extends React.PureComponent<Props, State> {
|
|||
<div className="time">
|
||||
<span id="timeMetric" className="metric">{this.state.timeMetric}</span>
|
||||
</div>
|
||||
<div
|
||||
onMouseLeave={this.fadeOutVolumeSlider}
|
||||
>
|
||||
<div onMouseLeave={this.fadeOutVolumeSlider}>
|
||||
<Icon
|
||||
onMouseEnter={() => {
|
||||
this.fadeOutVolumeSlider.cancel();
|
||||
|
@ -275,6 +273,7 @@ class MediaAudio extends React.PureComponent<Props, State> {
|
|||
};
|
||||
|
||||
const t = this.startedPlaying ? this.getTime(el.currentTime) : this.getTime(el.duration);
|
||||
|
||||
this.setState({ timeMetric: `${U.Common.sprintf('%02d', t.m)}:${U.Common.sprintf('%02d', t.s)}`});
|
||||
this.timeDragRef.setValue(el.currentTime / el.duration);
|
||||
};
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import * as React from 'react';
|
||||
import { observer } from 'mobx-react';
|
||||
import $ from 'jquery';
|
||||
import { Icon, Label } from 'Component';
|
||||
import { S, U, C, J, Storage, keyboard } from 'Lib';
|
||||
import { observer } from 'mobx-react';
|
||||
import { Icon, Label, Error } from 'Component';
|
||||
import { I, S, U, C, J, Storage, keyboard, translate } from 'Lib';
|
||||
|
||||
const Progress = observer(class Progress extends React.Component {
|
||||
|
||||
|
@ -22,26 +22,49 @@ const Progress = observer(class Progress extends React.Component {
|
|||
};
|
||||
|
||||
render () {
|
||||
const { progress } = S.Common;
|
||||
const { status, current, total, isUnlocked, canCancel } = progress || {};
|
||||
const { show } = S.Progress;
|
||||
const list = S.Progress.getList();
|
||||
const cn = [ 'progress' ];
|
||||
|
||||
if (!status) {
|
||||
if (!show || !list.length) {
|
||||
return null;
|
||||
};
|
||||
|
||||
const text = U.Common.sprintf(status, current, total);
|
||||
const cn = [ 'progress', (isUnlocked ? 'isUnlocked' : '') ];
|
||||
|
||||
|
||||
const Item = (item: any) => {
|
||||
const percent = item.total > 0 ? Math.min(100, Math.ceil(item.current / item.total * 100)) : 0;
|
||||
const isError = item.state == I.ProgressState.Error;
|
||||
const canCancel = item.canCancel && !isError;
|
||||
|
||||
return (
|
||||
<div className="item">
|
||||
<div className="nameWrap">
|
||||
<Label text={translate(U.Common.toCamelCase(`progress-${item.type}`))} />
|
||||
{canCancel ? <Icon className="close" onClick={() => this.onCancel(item.id)} /> : ''}
|
||||
</div>
|
||||
|
||||
{isError ? (
|
||||
<Error text={item.error} />
|
||||
) : (
|
||||
<div className="bar">
|
||||
<div className="fill" style={{width: `${percent}%` }} />
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
return (
|
||||
<div
|
||||
ref={node => this.node = node}
|
||||
className={cn.join(' ')}
|
||||
>
|
||||
<div id="inner" className="inner" onMouseDown={this.onDragStart}>
|
||||
<Label text={text} />
|
||||
{canCancel ? <Icon className="close" onClick={this.onCancel} /> : ''}
|
||||
<div className="bar">
|
||||
<div className="fill" style={{width: (Math.ceil(current / total * 100)) + '%'}} />
|
||||
<div className="titleWrap">
|
||||
<Label text={translate('commonProgress')} />
|
||||
<Label className="percent" text={`${S.Progress.getPercent()}%`} />
|
||||
</div>
|
||||
<div className="items">
|
||||
{list.map(item => <Item key={item.id} {...item} />)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -50,39 +73,22 @@ const Progress = observer(class Progress extends React.Component {
|
|||
|
||||
componentDidMount () {
|
||||
this._isMounted = true;
|
||||
this.resize();
|
||||
};
|
||||
|
||||
componentDidUpdate () {
|
||||
const { progress } = S.Common;
|
||||
if (!progress) {
|
||||
return;
|
||||
};
|
||||
|
||||
const { current, total } = progress;
|
||||
const win = $(window);
|
||||
const node = $(this.node);
|
||||
|
||||
node.removeClass('hide');
|
||||
this.resize();
|
||||
|
||||
win.off('resize.progress').on('resize.progress', () => this.resize());
|
||||
|
||||
if (total && (current >= total)) {
|
||||
node.addClass('hide');
|
||||
win.off('resize.progress');
|
||||
|
||||
window.setTimeout(() => S.Common.progressClear(), 200);
|
||||
};
|
||||
};
|
||||
|
||||
componentWillUnmount () {
|
||||
this._isMounted = false;
|
||||
$(window).off('resize.progress');
|
||||
};
|
||||
|
||||
onCancel (e: any) {
|
||||
const { progress } = S.Common;
|
||||
const { id } = progress;
|
||||
|
||||
onCancel (id: string) {
|
||||
C.ProcessCancel(id);
|
||||
};
|
||||
|
||||
|
@ -107,6 +113,7 @@ const Progress = observer(class Progress extends React.Component {
|
|||
const y = e.pageY - this.dy - win.scrollTop();
|
||||
|
||||
this.setStyle(x, y);
|
||||
Storage.set('progress', { x, y }, true);
|
||||
};
|
||||
|
||||
onDragEnd (e: any) {
|
||||
|
@ -119,6 +126,9 @@ const Progress = observer(class Progress extends React.Component {
|
|||
checkCoords (x: number, y: number): { x: number, y: number } {
|
||||
const { ww, wh } = U.Common.getWindowDimensions();
|
||||
|
||||
this.width = Number(this.width) || 0;
|
||||
this.height = Number(this.height) || 0;
|
||||
|
||||
x = Number(x) || 0;
|
||||
x = Math.max(0, x);
|
||||
x = Math.min(ww - this.width, x);
|
||||
|
@ -139,6 +149,10 @@ const Progress = observer(class Progress extends React.Component {
|
|||
const coords = Storage.get('progress');
|
||||
|
||||
this.obj = node.find('#inner');
|
||||
if (!this.obj.length) {
|
||||
return;
|
||||
};
|
||||
|
||||
this.height = this.obj.outerHeight();
|
||||
this.width = this.obj.outerWidth();
|
||||
|
||||
|
@ -150,10 +164,7 @@ const Progress = observer(class Progress extends React.Component {
|
|||
setStyle (x: number, y: number) {
|
||||
const coords = this.checkCoords(x, y);
|
||||
|
||||
if ((coords.x !== null) && (coords.y !== null)) {
|
||||
this.obj.css({ margin: 0, left: coords.x, top: coords.y });
|
||||
Storage.set('progress', coords, true);
|
||||
};
|
||||
this.obj.css({ margin: 0, left: coords.x, top: coords.y, bottom: 'auto' });
|
||||
};
|
||||
|
||||
});
|
||||
|
|
|
@ -66,7 +66,7 @@ const WidgetButtons = observer(class WidgetSpace extends React.Component<I.Widge
|
|||
ret.unshift({ id: 'member', name: translate('commonMembers') });
|
||||
};
|
||||
|
||||
if (space.chatId) {
|
||||
if (space.chatId && U.Common.isChatAllowed()) {
|
||||
ret.push({ id: 'chat', name: translate('commonMainChat') });
|
||||
};
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@ export enum ObjectLayout {
|
|||
SpaceView = 18,
|
||||
Participant = 19,
|
||||
Pdf = 20,
|
||||
ChatOld = 21,
|
||||
Chat = 22,
|
||||
|
||||
Empty = 100,
|
||||
|
|
|
@ -1,26 +1,28 @@
|
|||
export enum ProgressType {
|
||||
File = 0,
|
||||
Import = 1,
|
||||
Export = 2,
|
||||
Download = 3,
|
||||
Recover = 4,
|
||||
Migration = 5,
|
||||
Drop = 'dropFiles',
|
||||
Import = 'import',
|
||||
Export = 'export',
|
||||
Save = 'saveFile',
|
||||
Migrate = 'migration',
|
||||
Update = 'update',
|
||||
UpdateCheck = 'updateCheck',
|
||||
};
|
||||
|
||||
export enum ProgressState {
|
||||
None = 0,
|
||||
Running = 1,
|
||||
Done = 2,
|
||||
Canceled = 3,
|
||||
Error = 4,
|
||||
None = 0,
|
||||
Running = 1,
|
||||
Done = 2,
|
||||
Canceled = 3,
|
||||
Error = 4,
|
||||
};
|
||||
|
||||
export interface Progress {
|
||||
id?: string;
|
||||
spaceId?: string;
|
||||
type?: ProgressType;
|
||||
status?: string;
|
||||
current?: number;
|
||||
total?: number;
|
||||
isUnlocked?: boolean;
|
||||
state?: ProgressState;
|
||||
canCancel?: boolean;
|
||||
error?: string;
|
||||
};
|
|
@ -244,7 +244,6 @@ class Dispatcher {
|
|||
|
||||
if (id == rootId) {
|
||||
S.Block.checkBlockType(rootId);
|
||||
S.Block.checkBlockChat(rootId);
|
||||
};
|
||||
|
||||
updateParents = true;
|
||||
|
@ -816,7 +815,6 @@ class Dispatcher {
|
|||
|
||||
S.Detail.delete(rootId, id, keys);
|
||||
S.Block.checkBlockType(rootId);
|
||||
S.Block.checkBlockChat(rootId);
|
||||
|
||||
updateMarkup = true;
|
||||
break;
|
||||
|
@ -977,40 +975,33 @@ class Dispatcher {
|
|||
break;
|
||||
};
|
||||
|
||||
case 'ProcessNew':
|
||||
case 'ProcessUpdate':
|
||||
case 'ProcessDone': {
|
||||
case 'ProcessNew': {
|
||||
const { process } = mapped;
|
||||
const { id, progress, state, type } = process;
|
||||
const { progress, type } = process;
|
||||
|
||||
switch (state) {
|
||||
case I.ProgressState.Running: {
|
||||
let canCancel = true;
|
||||
let isUnlocked = true;
|
||||
S.Progress.update({
|
||||
...process,
|
||||
current: progress.done,
|
||||
total: progress.total,
|
||||
canCancel: [ I.ProgressType.Migrate ].includes(type),
|
||||
});
|
||||
break;
|
||||
};
|
||||
|
||||
if ([ I.ProgressType.Recover, I.ProgressType.Migration ].includes(type)) {
|
||||
canCancel = false;
|
||||
isUnlocked = false;
|
||||
};
|
||||
case 'ProcessUpdate': {
|
||||
const { process } = mapped;
|
||||
const { progress } = process;
|
||||
|
||||
S.Common.progressSet({
|
||||
id,
|
||||
status: translate(`progress${type}`),
|
||||
current: progress.done,
|
||||
total: progress.total,
|
||||
isUnlocked,
|
||||
canCancel,
|
||||
});
|
||||
break;
|
||||
};
|
||||
S.Progress.update({
|
||||
...process,
|
||||
current: progress.done,
|
||||
total: progress.total,
|
||||
});
|
||||
break;
|
||||
};
|
||||
|
||||
case I.ProgressState.Error:
|
||||
case I.ProgressState.Done:
|
||||
case I.ProgressState.Canceled: {
|
||||
S.Common.progressClear();
|
||||
break;
|
||||
};
|
||||
};
|
||||
case 'ProcessDone': {
|
||||
S.Progress.delete(mapped.process.id);
|
||||
break;
|
||||
};
|
||||
|
||||
|
@ -1073,7 +1064,6 @@ class Dispatcher {
|
|||
};
|
||||
|
||||
S.Block.checkBlockType(rootId);
|
||||
S.Block.checkBlockChat(rootId);
|
||||
};
|
||||
|
||||
if (undefined !== details.setOf) {
|
||||
|
@ -1178,7 +1168,6 @@ class Dispatcher {
|
|||
S.Block.updateNumbers(contextId);
|
||||
S.Block.updateMarkup(contextId);
|
||||
S.Block.checkBlockType(contextId);
|
||||
S.Block.checkBlockChat(contextId);
|
||||
|
||||
keyboard.setWindowTitle();
|
||||
};
|
||||
|
|
|
@ -57,6 +57,19 @@ export const Mapper = {
|
|||
return t;
|
||||
},
|
||||
|
||||
ProcessType (v: Events.Model.Process.MessageCase) {
|
||||
const V = Events.Model.Process.MessageCase;
|
||||
|
||||
let t = '';
|
||||
if (v == V.DROPFILES) t = 'dropFiles';
|
||||
if (v == V.IMPORT) t = 'import';
|
||||
if (v == V.EXPORT) t = 'export';
|
||||
if (v == V.SAVEFILE) t = 'saveFile';
|
||||
if (v == V.MIGRATION) t = 'migration';
|
||||
|
||||
return t;
|
||||
},
|
||||
|
||||
From: {
|
||||
|
||||
Account: (obj: Model.Account): I.Account => {
|
||||
|
@ -591,11 +604,15 @@ export const Mapper = {
|
|||
},
|
||||
|
||||
Process: (obj: Events.Model.Process) => {
|
||||
const type = Mapper.ProcessType(obj.getMessageCase());
|
||||
|
||||
return {
|
||||
id: obj.getId(),
|
||||
state: obj.getState() as number,
|
||||
type: obj.getType() as number,
|
||||
progress: Mapper.From.Progress(obj.getProgress())
|
||||
type,
|
||||
spaceId: obj.getSpaceid(),
|
||||
progress: Mapper.From.Progress(obj.getProgress()),
|
||||
error: obj.getError(),
|
||||
};
|
||||
},
|
||||
|
||||
|
|
|
@ -494,7 +494,7 @@ class Relation {
|
|||
value = String(value || '');
|
||||
|
||||
let ret = '';
|
||||
if (type == I.RelationType.Url && !value.match(/:\/\//)) {
|
||||
if (type == I.RelationType.Url) {
|
||||
ret = 'http://';
|
||||
};
|
||||
if (type == I.RelationType.Email) {
|
||||
|
@ -506,6 +506,17 @@ class Relation {
|
|||
return ret;
|
||||
};
|
||||
|
||||
public checkUrlScheme (type: I.RelationType, value: string): string {
|
||||
value = String(value || '');
|
||||
|
||||
if (!value) {
|
||||
return '';
|
||||
};
|
||||
|
||||
const scheme = U.Common.getScheme(value);
|
||||
return scheme ? value : this.getUrlScheme(type, value) + value;
|
||||
};
|
||||
|
||||
public getSetOfObjects (rootId: string, objectId: string, layout: I.ObjectLayout): any[] {
|
||||
const object = S.Detail.get(rootId, objectId, [ 'setOf' ]);
|
||||
const setOf = this.getArrayValue(object.setOf);
|
||||
|
|
|
@ -441,7 +441,7 @@ class UtilCommon {
|
|||
|
||||
const scheme = this.getScheme(url);
|
||||
if (!scheme) {
|
||||
url = 'http://' + url;
|
||||
url = `http://${url}`;
|
||||
};
|
||||
|
||||
return url;
|
||||
|
@ -636,7 +636,9 @@ class UtilCommon {
|
|||
|
||||
getScheme (url: string): string {
|
||||
url = String(url || '');
|
||||
return url.indexOf('://') >= 0 ? String(url.split('://')[0] || '') : '';
|
||||
|
||||
const m = url.match(/^([a-z]+):/);
|
||||
return m ? m[1] : '';
|
||||
};
|
||||
|
||||
intercept (obj: any, change: any) {
|
||||
|
@ -1010,6 +1012,22 @@ class UtilCommon {
|
|||
};
|
||||
};
|
||||
|
||||
isAlphaVersion (): boolean {
|
||||
return !!this.getElectron().version.app.match(/alpha/);
|
||||
};
|
||||
|
||||
isBetaVersion (): boolean {
|
||||
return !!this.getElectron().version.app.match(/beta/);
|
||||
};
|
||||
|
||||
isChatAllowed () {
|
||||
const { config, space } = S.Common;
|
||||
return config.experimental;
|
||||
|
||||
//return config.experimental || (space == J.Constant.localLoversSpaceId);
|
||||
//return this.isAlphaVersion() || this.isBetaVersion() || !this.getElectron().isPackaged;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
export default new UtilCommon();
|
||||
|
|
|
@ -551,7 +551,7 @@ class UtilData {
|
|||
};
|
||||
|
||||
getObjectTypesForNewObject (param?: any) {
|
||||
const { withSet, withCollection, withChat, limit } = param || {};
|
||||
const { withSet, withCollection, limit } = param || {};
|
||||
const { space, config } = S.Common;
|
||||
const pageLayouts = U.Object.getPageLayouts();
|
||||
const skipLayouts = U.Object.getSetLayouts();
|
||||
|
@ -573,10 +573,6 @@ class UtilData {
|
|||
items.push(S.Record.getSetType());
|
||||
};
|
||||
|
||||
if (withChat && config.experimental) {
|
||||
items.push(S.Record.getChatType());
|
||||
};
|
||||
|
||||
if (withCollection) {
|
||||
items.push(S.Record.getCollectionType());
|
||||
};
|
||||
|
@ -792,8 +788,10 @@ class UtilData {
|
|||
const { config } = S.Common;
|
||||
const { ignoreHidden, ignoreDeleted, withArchived } = param;
|
||||
const filters = param.filters || [];
|
||||
const skipLayouts = [ I.ObjectLayout.Chat, I.ObjectLayout.ChatOld ];
|
||||
|
||||
filters.push({ relationKey: 'layout', condition: I.FilterCondition.NotEqual, value: I.ObjectLayout.Chat });
|
||||
filters.push({ relationKey: 'layout', condition: I.FilterCondition.NotIn, value: skipLayouts });
|
||||
filters.push({ relationKey: 'recommendedLayout', condition: I.FilterCondition.NotIn, value: skipLayouts });
|
||||
|
||||
if (ignoreHidden && !config.debug.hiddenObject) {
|
||||
filters.push({ relationKey: 'isHidden', condition: I.FilterCondition.NotEqual, value: true });
|
||||
|
|
|
@ -121,13 +121,7 @@ class UtilFile {
|
|||
};
|
||||
|
||||
iconPath (object: any) {
|
||||
const tp = S.Common.getThemePath();
|
||||
return `img/${tp}icon/file/${this.icon(object)}.svg`;
|
||||
};
|
||||
|
||||
iconImage (object: any): string {
|
||||
const tp = S.Common.getThemePath();
|
||||
return require(`img/${tp}icon/file/${this.icon(object)}.svg`).default;
|
||||
return `./img/${S.Common.getThemePath()}icon/file/${this.icon(object)}.svg`;
|
||||
};
|
||||
|
||||
loadPreviewCanvas (file: any, param: any, success?: (canvas: any) => void) {
|
||||
|
|
|
@ -109,7 +109,7 @@ class UtilMenu {
|
|||
};
|
||||
|
||||
getBlockObject () {
|
||||
const items = U.Data.getObjectTypesForNewObject({ withSet: true, withCollection: true, withChat: true });
|
||||
const items = U.Data.getObjectTypesForNewObject({ withSet: true, withCollection: true });
|
||||
const ret: any[] = [
|
||||
{ type: I.BlockType.Page, id: 'existingPage', icon: 'existing', lang: 'ExistingPage', arrow: true, aliases: [ 'link' ] },
|
||||
{ type: I.BlockType.File, id: 'existingFile', icon: 'existing', lang: 'ExistingFile', arrow: true, aliases: [ 'file' ] }
|
||||
|
|
|
@ -139,9 +139,10 @@ class UtilRouter {
|
|||
return;
|
||||
};
|
||||
|
||||
const { config } = S.Common;
|
||||
const withChat = U.Common.isChatAllowed();
|
||||
|
||||
S.Menu.closeAllForced();
|
||||
S.Progress.showSet(false);
|
||||
|
||||
if (sendEvent) {
|
||||
analytics.event('SwitchSpace');
|
||||
|
@ -149,7 +150,7 @@ class UtilRouter {
|
|||
|
||||
this.isOpening = true;
|
||||
|
||||
C.WorkspaceOpen(id, config.experimental, (message: any) => {
|
||||
C.WorkspaceOpen(id, withChat, (message: any) => {
|
||||
this.isOpening = false;
|
||||
|
||||
if (message.error.code) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { I, S, U, J, Storage, translate } from 'Lib';
|
||||
import { I, C, S, U, J, Storage, translate } from 'Lib';
|
||||
|
||||
class UtilSpace {
|
||||
|
||||
|
@ -248,6 +248,12 @@ class UtilSpace {
|
|||
};
|
||||
};
|
||||
|
||||
getInvite (id: string, callBack: (cid: string, key: string) => void) {
|
||||
C.SpaceInviteGetCurrent(id, (message: any) => {
|
||||
callBack(message.inviteCid, message.inviteKey);
|
||||
});
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
export default new UtilSpace();
|
||||
export default new UtilSpace();
|
|
@ -51,7 +51,7 @@ class Notification implements I.Notification {
|
|||
];
|
||||
|
||||
if (codes.includes(errorCode)) {
|
||||
this.title = translate(`notificationImportErrorTitle${errorCode}`);
|
||||
this.title = translate('commonError');
|
||||
this.text = translate(`notificationImportErrorText${errorCode}`);
|
||||
};
|
||||
break;
|
||||
|
|
|
@ -585,8 +585,9 @@ class BlockStore {
|
|||
checkBlockType (rootId: string) {
|
||||
const { header, type } = J.Constant.blockId;
|
||||
const element = this.getMapElement(rootId, header);
|
||||
const canWrite = U.Space.canMyParticipantWrite();
|
||||
|
||||
if (!element) {
|
||||
if (!element || !canWrite) {
|
||||
return;
|
||||
};
|
||||
|
||||
|
@ -606,32 +607,6 @@ class BlockStore {
|
|||
return header ? header.childrenIds.includes(J.Constant.blockId.type) : false;
|
||||
};
|
||||
|
||||
checkBlockChat (rootId: string) {
|
||||
return;
|
||||
|
||||
const element = this.getMapElement(rootId, rootId);
|
||||
|
||||
if (!element) {
|
||||
return;
|
||||
};
|
||||
|
||||
const object = S.Detail.get(rootId, rootId, [ 'layout', 'chatId' ], true);
|
||||
if (U.Object.isChatLayout(object.layout)) {
|
||||
return;
|
||||
};
|
||||
|
||||
if (object.chatId && !this.checkBlockChatExists(rootId)) {
|
||||
const childrenIds = element.childrenIds.concat(J.Constant.blockId.chat);
|
||||
|
||||
this.updateStructure(rootId, rootId, childrenIds);
|
||||
};
|
||||
};
|
||||
|
||||
checkBlockChatExists (rootId: string): boolean {
|
||||
const element = this.getMapElement(rootId, rootId);
|
||||
return element ? element.childrenIds.includes(J.Constant.blockId.chat) : false;
|
||||
};
|
||||
|
||||
getLayoutIds (rootId: string, ids: string[]) {
|
||||
if (!ids.length) {
|
||||
return [];
|
||||
|
|
|
@ -106,7 +106,6 @@ class CommonStore {
|
|||
membershipTiersList: observable,
|
||||
showSidebarRightValue: observable,
|
||||
config: computed,
|
||||
progress: computed,
|
||||
preview: computed,
|
||||
toast: computed,
|
||||
filter: computed,
|
||||
|
@ -120,8 +119,6 @@ class CommonStore {
|
|||
showVault: computed,
|
||||
showSidebarRight: computed,
|
||||
gatewaySet: action,
|
||||
progressSet: action,
|
||||
progressClear: action,
|
||||
filterSetFrom: action,
|
||||
filterSetText: action,
|
||||
filterSet: action,
|
||||
|
@ -154,10 +151,6 @@ class CommonStore {
|
|||
return config;
|
||||
};
|
||||
|
||||
get progress (): I.Progress {
|
||||
return this.progressObj;
|
||||
};
|
||||
|
||||
get preview (): I.Preview {
|
||||
return this.previewObj;
|
||||
};
|
||||
|
@ -296,14 +289,6 @@ class CommonStore {
|
|||
return [ this.gateway, 'image', String(id || '') ].join('/') + `?width=${Number(width) || 0}`;
|
||||
};
|
||||
|
||||
progressSet (v: I.Progress) {
|
||||
this.progressObj = v;
|
||||
};
|
||||
|
||||
progressClear () {
|
||||
this.progressObj = null;
|
||||
};
|
||||
|
||||
filterSetFrom (from: number) {
|
||||
this.filterObj.from = from;
|
||||
};
|
||||
|
|
|
@ -8,6 +8,7 @@ import { Popup } from './popup';
|
|||
import { Notification } from './notification';
|
||||
import { Extension } from './extension';
|
||||
import { Chat } from './chat';
|
||||
import { Progress } from './progress';
|
||||
|
||||
export {
|
||||
Common,
|
||||
|
@ -20,4 +21,5 @@ export {
|
|||
Notification,
|
||||
Extension,
|
||||
Chat,
|
||||
Progress,
|
||||
};
|
84
src/ts/store/progress.ts
Normal file
|
@ -0,0 +1,84 @@
|
|||
import { observable, action, makeObservable, set, computed } from 'mobx';
|
||||
import { I, S } from 'Lib';
|
||||
|
||||
class ProgressStore {
|
||||
|
||||
public showValue = false;
|
||||
public listValue: I.Progress[] = [];
|
||||
|
||||
constructor () {
|
||||
makeObservable(this, {
|
||||
listValue: observable,
|
||||
showValue: observable,
|
||||
list: computed,
|
||||
show: computed,
|
||||
add: action,
|
||||
update: action,
|
||||
delete: action,
|
||||
showSet: action,
|
||||
});
|
||||
};
|
||||
|
||||
get show (): boolean {
|
||||
return this.showValue;
|
||||
};
|
||||
|
||||
get list (): I.Progress[] {
|
||||
return this.listValue || [];
|
||||
};
|
||||
|
||||
add (item: Partial<I.Progress>): void {
|
||||
this.listValue.unshift(item);
|
||||
};
|
||||
|
||||
update (param: Partial<I.Progress>): void {
|
||||
const item = this.getItem(param.id);
|
||||
|
||||
if (item) {
|
||||
set(item, param);
|
||||
} else {
|
||||
this.add(param);
|
||||
};
|
||||
};
|
||||
|
||||
delete (id: string) {
|
||||
this.listValue = this.listValue.filter(it => it.id != id);
|
||||
};
|
||||
|
||||
showSet (v: boolean): void {
|
||||
this.showValue = Boolean(v);
|
||||
};
|
||||
|
||||
getList () {
|
||||
const { space } = S.Common;
|
||||
const skip = [ I.ProgressState.Done, I.ProgressState.Canceled ];
|
||||
|
||||
return this.list.filter(it => (!it.spaceId || (it.spaceId == space)) && !skip.includes(it.state));
|
||||
};
|
||||
|
||||
getItem (id: string): I.Progress {
|
||||
return this.getList().find(it => it.id == id);
|
||||
};
|
||||
|
||||
getField (field: string): number {
|
||||
return this.getList().reduce((acc, it) => acc + (Number(it[field]) || 0), 0);
|
||||
};
|
||||
|
||||
getCurrent (): number {
|
||||
return this.getField('current');
|
||||
};
|
||||
|
||||
getTotal (): number {
|
||||
return this.getField('total');
|
||||
};
|
||||
|
||||
getPercent (): number {
|
||||
const current = this.getCurrent();
|
||||
const total = this.getTotal();
|
||||
|
||||
return total > 0 ? Math.min(100, Math.ceil(current / total * 100)) : 0;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
export const Progress: ProgressStore = new ProgressStore();
|