From 83c1bf521f88f6895741e2e6c18906d87b0e4615 Mon Sep 17 00:00:00 2001 From: Andrew Simachev Date: Fri, 27 Oct 2023 10:43:02 +0200 Subject: [PATCH 01/88] JS-3230: Space storage --- src/scss/component/progressBar.scss | 6 ++++-- src/scss/popup/settings.scss | 8 -------- src/scss/theme/dark/common.scss | 5 ----- src/scss/theme/dark/popup.scss | 3 --- src/ts/component/util/progressBar.tsx | 20 +++++++------------- 5 files changed, 11 insertions(+), 31 deletions(-) diff --git a/src/scss/component/progressBar.scss b/src/scss/component/progressBar.scss index a8d6e74ecd..5697668ce8 100644 --- a/src/scss/component/progressBar.scss +++ b/src/scss/component/progressBar.scss @@ -1,9 +1,11 @@ @import "~scss/_vars"; .progressBar { - .bar { position: relative; overflow: hidden; height: 6px; border-radius: 8px; background-color: $colorShapeTertiary; } + .bar { position: relative; overflow: hidden; height: 12px; border-radius: 4px; display: flex; flex-direction: row; gap: 0px 2px; } .bar { - .fill { height: 6px; background-color: $colorSystemAccent100; } + .fill { height: 100%; background-color: $colorSystemAccent25; } + .fill.current { background-color: $colorSystemAccent100; } + .fill.empty { background-color: $colorShapeTertiary; } } .labels { display: flex; justify-content: space-between; } .labels { diff --git a/src/scss/popup/settings.scss b/src/scss/popup/settings.scss index 3f8ba411e3..d7bff6cabc 100644 --- a/src/scss/popup/settings.scss +++ b/src/scss/popup/settings.scss @@ -273,14 +273,6 @@ .label { display: inline; } .label.extend { color: $colorRed; } } - .progressBar { - .fill { background: $colorLime; } - } - } - > .item.red { - .progressBar { - .fill { background: $colorRed; } - } } } } diff --git a/src/scss/theme/dark/common.scss b/src/scss/theme/dark/common.scss index 44f51a1006..f9cc514b18 100644 --- a/src/scss/theme/dark/common.scss +++ b/src/scss/theme/dark/common.scss @@ -72,11 +72,6 @@ html.themeDark { .controls, .emptySearch { border-color: $colorShapePrimary; } } - .progressBar { - .bar { background: $colorBgSecondary; } - .fill { background: $colorSystemAccent100; } - } - /* Components */ .loaderWrapper { diff --git a/src/scss/theme/dark/popup.scss b/src/scss/theme/dark/popup.scss index 8e785b02db..f30f1edd7e 100644 --- a/src/scss/theme/dark/popup.scss +++ b/src/scss/theme/dark/popup.scss @@ -91,9 +91,6 @@ .item { .icon.arrow.down { background-image: url('#{$themePath}/arrow/button/black.svg'); } } - .item.red { - .progressBar .fill { background: $colorRed; } - } } } } diff --git a/src/ts/component/util/progressBar.tsx b/src/ts/component/util/progressBar.tsx index f5b3792f10..580cb4b51c 100644 --- a/src/ts/component/util/progressBar.tsx +++ b/src/ts/component/util/progressBar.tsx @@ -1,4 +1,5 @@ import * as React from 'react'; +import { Label } from 'Component'; interface Props { percent: number; @@ -12,26 +13,19 @@ class ProgressBar extends React.Component { render () { const { percent, current, max } = this.props; - let currentLabel = null; - let maxLabel = null; - - if (current) { - currentLabel =
{current}
; - }; - - if (max) { - maxLabel =
{max}
; - }; return (
-
+
+
+
+
- {currentLabel} - {maxLabel} + {current ?
); From 3046073b338edb447a6a1919f09bb793895778c2 Mon Sep 17 00:00:00 2001 From: Andrew Simachev Date: Fri, 27 Oct 2023 19:47:22 +0200 Subject: [PATCH 02/88] FileNodeUsage integration --- src/ts/lib/api/command.ts | 10 ++++------ src/ts/lib/api/response.ts | 26 ++++++++++++++++++++------ src/ts/lib/util/data.ts | 2 +- src/ts/store/common.ts | 7 +++++++ 4 files changed, 32 insertions(+), 13 deletions(-) diff --git a/src/ts/lib/api/command.ts b/src/ts/lib/api/command.ts index d0a0a4fc10..3bef8564e1 100644 --- a/src/ts/lib/api/command.ts +++ b/src/ts/lib/api/command.ts @@ -253,12 +253,11 @@ const FileListOffload = (ids: string[], notPinned: boolean, callBack?: (message: dispatcher.request(FileListOffload.name, request, callBack); }; -const FileSpaceUsage = (spaceId: string, callBack?: (message: any) => void) => { - const request = new Rpc.File.SpaceUsage.Request(); - request.setSpaceid(spaceId); +const FileNodeUsage = (callBack?: (message: any) => void) => { + const request = new Commands.Empty(); - dispatcher.request(FileSpaceUsage.name, request, callBack); + dispatcher.request(FileNodeUsage.name, request, callBack); }; const NavigationGetObjectInfoWithLinks = (pageId: string, callBack?: (message: any) => void) => { @@ -1607,7 +1606,6 @@ const ObjectApplyTemplate = (contextId: string, templateId: string, callBack?: ( dispatcher.request(ObjectApplyTemplate.name, request, callBack); }; - const ObjectShareByLink = (objectId: string, callBack?: (message: any) => void) => { const request = new Rpc.Object.ShareByLink.Request(); @@ -1826,7 +1824,7 @@ export { FileDownload, FileDrop, FileListOffload, - FileSpaceUsage, + FileNodeUsage, NavigationGetObjectInfoWithLinks, diff --git a/src/ts/lib/api/response.ts b/src/ts/lib/api/response.ts index 770ecdb102..0d373dd7b4 100644 --- a/src/ts/lib/api/response.ts +++ b/src/ts/lib/api/response.ts @@ -56,15 +56,29 @@ export const FileListOffload = (response: Rpc.File.ListOffload.Response) => { }; }; -export const FileSpaceUsage = (response: Rpc.File.SpaceUsage.Response) => { +export const FileNodeUsage = (response: Rpc.File.NodeUsage.Response) => { const usage = response.getUsage(); + + let res = {}; + + if (usage) { + res = Object.assign(res, { + bytesUsed: usage.getBytesusage(), + bytesLeft: usage.getBytesleft(), + bytesLimit: usage.getByteslimit(), + filesCount: usage.getFilescount(), + localUsage: usage.getLocalbytesusage(), + }); + }; return { - bytesUsed: usage.getBytesusage(), - bytesLeft: usage.getBytesleft(), - bytesLimit: usage.getByteslimit(), - filesCount: usage.getFilescount(), - localUsage: usage.getLocalbytesusage(), + ...res, + spaces: (response.getSpacesList() || []).map(it => ({ + spaceId: it.getSpaceid(), + filesCount: it.getFilescount(), + cidsCount: it.getCidscount(), + bytesUsage: it.getBytesusage(), + })), }; }; diff --git a/src/ts/lib/util/data.ts b/src/ts/lib/util/data.ts index 7e39cab409..dc8b704498 100644 --- a/src/ts/lib/util/data.ts +++ b/src/ts/lib/util/data.ts @@ -219,7 +219,7 @@ class UtilData { keyboard.initPinCheck(); analytics.event('OpenAccount'); - C.FileSpaceUsage(space, (message: any) => { + C.FileNodeUsage((message: any) => { if (!message.error.code) { commonStore.spaceStorageSet(message); }; diff --git a/src/ts/store/common.ts b/src/ts/store/common.ts index d1fc15ac93..4d3783e2fc 100644 --- a/src/ts/store/common.ts +++ b/src/ts/store/common.ts @@ -24,6 +24,12 @@ interface SpaceStorage { bytesUsed: number; bytesLimit: number; localUsage: number; + spaces: { + spaceId: string; + filesCount: number; + cidsCount: number; + bytesUsage: number; + }[], }; class CommonStore { @@ -69,6 +75,7 @@ class CommonStore { bytesUsed: 0, bytesLimit: 0, localUsage: 0, + spaces: [], }; constructor() { From 6c78df86bc9c4feccc75f0194de211438cf57619 Mon Sep 17 00:00:00 2001 From: Andrew Simachev Date: Sat, 28 Oct 2023 13:47:37 +0200 Subject: [PATCH 03/88] refactoring --- .../popup/page/settings/space/index.tsx | 20 ++++++---- src/ts/component/util/progressBar.tsx | 19 +++++++--- src/ts/lib/util/file.ts | 38 ++++++++++--------- 3 files changed, 46 insertions(+), 31 deletions(-) diff --git a/src/ts/component/popup/page/settings/space/index.tsx b/src/ts/component/popup/page/settings/space/index.tsx index 6fd94d5b67..51214a309c 100644 --- a/src/ts/component/popup/page/settings/space/index.tsx +++ b/src/ts/component/popup/page/settings/space/index.tsx @@ -22,18 +22,22 @@ const PopupSettingsSpaceIndex = observer(class PopupSettingsSpaceIndex extends R render () { const { onPage, onSpaceTypeTooltip } = this.props; - const { localUsage, bytesUsed, bytesLimit } = commonStore.spaceStorage; + const { localUsage, bytesUsed, bytesLimit, spaces } = commonStore.spaceStorage; const { account, accountSpaceId } = authStore; const space = UtilObject.getSpaceview(); - const name = this.checkName(space.name); const home = UtilObject.getSpaceDashboard(); - const percentageUsed = Math.floor(UtilCommon.getPercent(bytesUsed, bytesLimit)); - const currentUsage = String(UtilFile.size(bytesUsed)); - const limitUsage = String(UtilFile.size(bytesLimit)); - const isRed = (percentageUsed >= 90) || (localUsage > bytesLimit); + const isRed = (bytesUsed / bytesLimit >= 0.9) || (localUsage > bytesLimit); const usageCn = [ 'item' ]; const canDelete = space.targetSpaceId != accountSpaceId; + const progressSegments = (spaces || []).map(it => { + const object = UtilObject.getSpaceviewBySpaceId(it.spaceId); + if (object._empty_) { + return null; + }; + + return { name: object.name, percent: it.bytesUsage / bytesLimit, isActive: (it.spaceId == commonStore.space) }; + }).filter(it => it); let extend = null; let createdDate = null; @@ -79,7 +83,7 @@ const PopupSettingsSpaceIndex = observer(class PopupSettingsSpaceIndex extends R
- +
diff --git a/src/ts/component/util/progressBar.tsx b/src/ts/component/util/progressBar.tsx index 580cb4b51c..dec4a6c464 100644 --- a/src/ts/component/util/progressBar.tsx +++ b/src/ts/component/util/progressBar.tsx @@ -2,7 +2,7 @@ import * as React from 'react'; import { Label } from 'Component'; interface Props { - percent: number; + segments: { name: string; percent: number; isActive: boolean; }[]; current?: string; max?: string; }; @@ -12,15 +12,22 @@ class ProgressBar extends React.Component { node: any = null; render () { - const { percent, current, max } = this.props; + const { segments, current, max } = this.props; + const total = segments.reduce((res, current) => res += current.percent, 0); return (
-
-
-
-
+ {segments.map((item, i) => { + const cn = [ 'fill' ]; + if (item.isActive) { + cn.push('isActive'); + }; + + return
; + })} + +
diff --git a/src/ts/lib/util/file.ts b/src/ts/lib/util/file.ts index 53406d2a92..15c7792668 100644 --- a/src/ts/lib/util/file.ts +++ b/src/ts/lib/util/file.ts @@ -2,6 +2,15 @@ import loadImage from 'blueimp-load-image'; import { UtilCommon } from 'Lib'; import Constant from 'json/constant.json'; +const SIZE_UNIT = 1000; +const UNITS = { + 1: 'B', + 2: 'KB', + 3: 'MB', + 4: 'GB', + 5: 'TB', +}; + class UtilFile { fromPath (path: string) { @@ -15,27 +24,22 @@ class UtilFile { return file; }; - size (v: number) { + size (v: number): string { v = Number(v) || 0; - const trimmer = (n, afterComma) => { - return Number.isInteger(n) ? 0 : afterComma; + let ret = 0; + let unit = ''; + + for (let i = 5; i >= 1; --i) { + const n = v / Math.pow(SIZE_UNIT, i - 1); + if ((n >= 1) || (i == 1)) { + ret = n; + unit = UNITS[i]; + break; + }; }; - const unit = 1000; - const g = v / (unit * unit * unit); - const m = v / (unit * unit); - const k = v / unit; - if (g >= 1) { - v = UtilCommon.sprintf(`%0.${trimmer(g, 2)}fGB`, UtilCommon.round(g, trimmer(g, 2))); - } else if (m > 1) { - v = UtilCommon.sprintf(`%0.${trimmer(m, 1)}fMB`, UtilCommon.round(m, trimmer(m, 1))); - } else if (k > 1) { - v = UtilCommon.sprintf(`%0.${trimmer(k, 1)}fKB`, UtilCommon.round(k, trimmer(k, 1))); - } else { - v = UtilCommon.sprintf('%dB', UtilCommon.round(v, 0)); - }; - return v; + return ret ? Number(UtilCommon.sprintf(`%0.2f`, ret)) + unit : ''; }; icon (obj: any): string { From 8f568d6e2c96b80b0730a63fe9ba1a146ae96eaa Mon Sep 17 00:00:00 2001 From: Andrew Simachev Date: Sat, 28 Oct 2023 13:50:28 +0200 Subject: [PATCH 04/88] refactoring --- src/ts/lib/util/file.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ts/lib/util/file.ts b/src/ts/lib/util/file.ts index 15c7792668..40db0a589a 100644 --- a/src/ts/lib/util/file.ts +++ b/src/ts/lib/util/file.ts @@ -39,7 +39,7 @@ class UtilFile { }; }; - return ret ? Number(UtilCommon.sprintf(`%0.2f`, ret)) + unit : ''; + return ret ? UtilCommon.formatNumber(Number(UtilCommon.sprintf(`%0.2f`, ret))) + unit : ''; }; icon (obj: any): string { From 6f85f9277291d0b0838cb1c995d1444c0821699a Mon Sep 17 00:00:00 2001 From: Andrew Simachev Date: Sat, 28 Oct 2023 13:58:24 +0200 Subject: [PATCH 05/88] refactoring --- src/ts/lib/util/file.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ts/lib/util/file.ts b/src/ts/lib/util/file.ts index 40db0a589a..d3e17ec413 100644 --- a/src/ts/lib/util/file.ts +++ b/src/ts/lib/util/file.ts @@ -30,7 +30,7 @@ class UtilFile { let ret = 0; let unit = ''; - for (let i = 5; i >= 1; --i) { + for (let i = UtilCommon.objectLength(UNITS); i >= 1; --i) { const n = v / Math.pow(SIZE_UNIT, i - 1); if ((n >= 1) || (i == 1)) { ret = n; From 60a74f3a1bd96b6936bbc6913224db261eb0d11f Mon Sep 17 00:00:00 2001 From: Andrew Simachev Date: Sat, 28 Oct 2023 13:59:19 +0200 Subject: [PATCH 06/88] refactoring --- src/scss/component/progressBar.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scss/component/progressBar.scss b/src/scss/component/progressBar.scss index 5697668ce8..3931f7682e 100644 --- a/src/scss/component/progressBar.scss +++ b/src/scss/component/progressBar.scss @@ -4,7 +4,7 @@ .bar { position: relative; overflow: hidden; height: 12px; border-radius: 4px; display: flex; flex-direction: row; gap: 0px 2px; } .bar { .fill { height: 100%; background-color: $colorSystemAccent25; } - .fill.current { background-color: $colorSystemAccent100; } + .fill.isActive { background-color: $colorSystemAccent100; } .fill.empty { background-color: $colorShapeTertiary; } } .labels { display: flex; justify-content: space-between; } From ddcfc99c19a84dffb0e7f0ae412db5200f7ffa6f Mon Sep 17 00:00:00 2001 From: Andrew Simachev Date: Mon, 30 Oct 2023 12:06:00 +0100 Subject: [PATCH 07/88] error handling on account and space deletion --- src/ts/component/page/head/banner.tsx | 4 ++-- .../component/popup/page/settings/delete.tsx | 16 +++++++++++++-- .../popup/page/settings/space/index.tsx | 20 ++++++++++++++++--- src/ts/lib/action.ts | 10 ++++------ 4 files changed, 37 insertions(+), 13 deletions(-) diff --git a/src/ts/component/page/head/banner.tsx b/src/ts/component/page/head/banner.tsx index 6196b2f766..132bc49f4f 100644 --- a/src/ts/component/page/head/banner.tsx +++ b/src/ts/component/page/head/banner.tsx @@ -123,7 +123,7 @@ class HeaderBanner extends React.Component { onSelect: (item: any) => { C.ObjectApplyTemplate(object.id, item.id); - analytics.event('SelectTemplate'); + analytics.event('SelectTemplate', { route: 'Banner' }); menuContext.close(); }, }, @@ -131,4 +131,4 @@ class HeaderBanner extends React.Component { }; }; -export default HeaderBanner; +export default HeaderBanner; \ No newline at end of file diff --git a/src/ts/component/popup/page/settings/delete.tsx b/src/ts/component/popup/page/settings/delete.tsx index b1d47e965c..9917715ff3 100644 --- a/src/ts/component/popup/page/settings/delete.tsx +++ b/src/ts/component/popup/page/settings/delete.tsx @@ -1,14 +1,21 @@ import * as React from 'react'; -import { Title, Button, Checkbox } from 'Component'; +import { Title, Button, Checkbox, Error } from 'Component'; import { I, C, translate, UtilRouter, analytics } from 'Lib'; import { authStore } from 'Store'; import { observer } from 'mobx-react'; import Head from './head'; -const PopupSettingsPageDelete = observer(class PopupSettingsPageDelete extends React.Component { +interface State { + error: string; +}; + +const PopupSettingsPageDelete = observer(class PopupSettingsPageDelete extends React.Component { refCheckbox: any = null; node: any = null; + state = { + error: '', + }; constructor (props: I.PopupSettings) { super(props); @@ -18,6 +25,8 @@ const PopupSettingsPageDelete = observer(class PopupSettingsPageDelete extends R }; render () { + const { error } = this.state; + return (
this.node = node} @@ -38,6 +47,8 @@ const PopupSettingsPageDelete = observer(class PopupSettingsPageDelete extends R
); }; @@ -50,6 +61,7 @@ const PopupSettingsPageDelete = observer(class PopupSettingsPageDelete extends R C.AccountDelete((message: any) => { if (message.error.code) { + this.setState({ error: message.error.description }); return; }; diff --git a/src/ts/component/popup/page/settings/space/index.tsx b/src/ts/component/popup/page/settings/space/index.tsx index 51214a309c..0542bb368a 100644 --- a/src/ts/component/popup/page/settings/space/index.tsx +++ b/src/ts/component/popup/page/settings/space/index.tsx @@ -1,14 +1,21 @@ import * as React from 'react'; -import { Icon, Title, Label, Input, IconObject, Button, ProgressBar } from 'Component'; +import { Icon, Title, Label, Input, IconObject, Button, ProgressBar, Error } from 'Component'; import { I, C, UtilObject, UtilMenu, UtilCommon, UtilFile, translate, Renderer, Preview, analytics, UtilDate, Action } from 'Lib'; import { observer } from 'mobx-react'; import { detailStore, menuStore, commonStore, authStore } from 'Store'; import Constant from 'json/constant.json'; import Url from 'json/url.json'; -const PopupSettingsSpaceIndex = observer(class PopupSettingsSpaceIndex extends React.Component { +interface State { + error: string; +}; + +const PopupSettingsSpaceIndex = observer(class PopupSettingsSpaceIndex extends React.Component { refName: any = null; + state = { + error: '', + }; constructor (props: any) { super(props); @@ -22,6 +29,7 @@ const PopupSettingsSpaceIndex = observer(class PopupSettingsSpaceIndex extends R render () { const { onPage, onSpaceTypeTooltip } = this.props; + const { error } = this.state; const { localUsage, bytesUsed, bytesLimit, spaces } = commonStore.spaceStorage; const { account, accountSpaceId } = authStore; const space = UtilObject.getSpaceview(); @@ -233,6 +241,8 @@ const PopupSettingsSpaceIndex = observer(class PopupSettingsSpaceIndex extends R
) : ''} + +
@@ -282,7 +292,11 @@ const PopupSettingsSpaceIndex = observer(class PopupSettingsSpaceIndex extends R }; onDelete () { - Action.removeSpace(commonStore.space, 'Settings'); + Action.removeSpace(commonStore.space, 'Settings', (message: any) => { + if (message.error.code) { + this.setState({ error: message.error.description }); + }; + }); }; checkName (v: string): string { diff --git a/src/ts/lib/action.ts b/src/ts/lib/action.ts index 7a3cdd156d..ed21dc4efd 100644 --- a/src/ts/lib/action.ts +++ b/src/ts/lib/action.ts @@ -545,16 +545,14 @@ class Action { const cb = () => { C.SpaceDelete(id, (message: any) => { - if (message.error.code) { - return; - }; - if (callBack) { callBack(message); }; - Preview.toastShow({ text: UtilCommon.sprintf(translate('spaceDeleteToast'), deleted.name) }); - analytics.event('DeleteSpace', { type: deleted.spaceType }); + if (!message.error.code) { + Preview.toastShow({ text: UtilCommon.sprintf(translate('spaceDeleteToast'), deleted.name) }); + analytics.event('DeleteSpace', { type: deleted.spaceType }); + }; }); }; From ab446b69777293da5f551b8c17ef4b0fb9d9a39a Mon Sep 17 00:00:00 2001 From: Andrew Simachev Date: Mon, 30 Oct 2023 12:11:58 +0100 Subject: [PATCH 08/88] fix space events --- src/ts/component/page/auth/onboard.tsx | 1 + src/ts/component/popup/page/settings/space/create.tsx | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ts/component/page/auth/onboard.tsx b/src/ts/component/page/auth/onboard.tsx index 91979253b6..912ac822db 100644 --- a/src/ts/component/page/auth/onboard.tsx +++ b/src/ts/component/page/auth/onboard.tsx @@ -297,6 +297,7 @@ const PageAuthOnboard = observer(class PageAuthOnboard extends React.Component { Action.importUsecase(commonStore.space, I.Usecase.Skip, callBack); diff --git a/src/ts/component/popup/page/settings/space/create.tsx b/src/ts/component/popup/page/settings/space/create.tsx index 1da9d920de..cb96ddab40 100644 --- a/src/ts/component/popup/page/settings/space/create.tsx +++ b/src/ts/component/popup/page/settings/space/create.tsx @@ -158,7 +158,7 @@ const PopupSettingsSpaceIndex = observer(class PopupSettingsSpaceIndex extends R this.setState({ isLoading: false }); if (!message.error.code) { - analytics.event('CreateSpace', { usecase }); + analytics.event('CreateSpace', { usecase, middleTime: message.middleTime, }); analytics.event('SelectUsecase', { type: usecase }); UtilRouter.switchSpace(message.objectId, '', () => close()); From 493acf07aed87e52ef3dd54dc564f5ed2825539c Mon Sep 17 00:00:00 2001 From: Andrew Simachev Date: Mon, 30 Oct 2023 14:02:17 +0100 Subject: [PATCH 09/88] JS-3259: fix --- electron/js/api.js | 20 ++++++++++++++++ electron/js/menu.js | 9 ++++++- electron/js/window.js | 7 +++++- src/json/text.json | 1 + .../popup/page/settings/appearance.tsx | 2 -- .../popup/page/settings/personal.tsx | 24 +++++++++++++++---- src/ts/model/block.ts | 2 +- 7 files changed, 55 insertions(+), 10 deletions(-) diff --git a/electron/js/api.js b/electron/js/api.js index 97e97ced79..544ce7666c 100644 --- a/electron/js/api.js +++ b/electron/js/api.js @@ -70,6 +70,26 @@ class Api { this.setConfig(win, { zoom }); }; + setHideTray (win, show) { + ConfigManager.set({ hideTray: !show }, () => { + Util.send(win, 'config', ConfigManager.config); + + MenuManager.initMenu(); + MenuManager.initTray(); + }); + }; + + setMenuBarVisibility (win, show) { + const hide = !show; + + ConfigManager.set({ hideMenuBar: hide }, () => { + Util.send(win, 'config', ConfigManager.config); + + win.setMenuBarVisibility(show); + win.setAutoHideMenuBar(hide); + }); + }; + spellcheckAdd (win, s) { win.webContents.session.addWordToSpellCheckerDictionary(s); }; diff --git a/electron/js/menu.js b/electron/js/menu.js index 4fb3748dc9..65629d8960 100644 --- a/electron/js/menu.js +++ b/electron/js/menu.js @@ -322,6 +322,13 @@ class MenuManager { } }, + (is.windows || is.linux) ? { + label: Util.translate('electronMenuShowMenu'), type: 'checkbox', checked: !config.hideMenuBar, click: () => { + Api.setConfig(this.win, { hideMenuBar: !config.hideMenuBar }); + this.initTray(); + } + } : null, + Separator, { @@ -359,7 +366,7 @@ class MenuManager { Util.send(this.win, 'commandGlobal', 'create'); } }, - ]; + ].filter(it => it); }; openSettings (page, param) { diff --git a/electron/js/window.js b/electron/js/window.js index e47704679f..1716c748a3 100644 --- a/electron/js/window.js +++ b/electron/js/window.js @@ -24,7 +24,7 @@ class WindowManager { create (options, param) { const Api = require('./api.js'); const { route, isChild } = options; - const { languages, zoom } = ConfigManager.config; + const { languages, zoom, hideMenuBar } = ConfigManager.config; param = Object.assign({ backgroundColor: Util.getBgColor('dark'), @@ -67,6 +67,11 @@ class WindowManager { Api.setSpellingLang(win, languages); Api.setZoom(win, zoom); + if (hideMenuBar) { + win.setMenuBarVisibility(false); + win.setAutoHideMenuBar(true); + }; + return win; }; diff --git a/src/json/text.json b/src/json/text.json index 42d3de4781..51081fd52c 100644 --- a/src/json/text.json +++ b/src/json/text.json @@ -139,6 +139,7 @@ "electronMenuSpaceSettings": "Space", "electronMenuAccountSettings": "Account", "electronMenuShowTray": "Show Anytype in Menu Bar", + "electronMenuShowMenu": "Show system menu", "electronMenuQuit": "Quit", "electronMenuFile": "File", "electronMenuDirectory": "Show Work Directory", diff --git a/src/ts/component/popup/page/settings/appearance.tsx b/src/ts/component/popup/page/settings/appearance.tsx index c4d41215ee..d77e7ba699 100644 --- a/src/ts/component/popup/page/settings/appearance.tsx +++ b/src/ts/component/popup/page/settings/appearance.tsx @@ -40,9 +40,7 @@ const PopupSettingsPageAppearance = observer(class PopupSettingsPageAppearance e
-
diff --git a/src/ts/component/popup/page/settings/personal.tsx b/src/ts/component/popup/page/settings/personal.tsx index aeb0d5699c..37e74e8c0d 100644 --- a/src/ts/component/popup/page/settings/personal.tsx +++ b/src/ts/component/popup/page/settings/personal.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import { observer } from 'mobx-react'; -import { Icon, Title, Label, Select } from 'Component'; -import { I, translate, analytics, Renderer, UtilObject, Action } from 'Lib'; +import { Icon, Title, Label, Select, Switch } from 'Component'; +import { I, translate, analytics, UtilObject, UtilCommon, Action, Renderer } from 'Lib'; import { commonStore, menuStore, dbStore } from 'Store'; import Constant from 'json/constant.json'; @@ -14,10 +14,12 @@ const PopupSettingsPagePersonal = observer(class PopupSettingsPagePersonal exten }; render () { - const { config } = commonStore; + const { config, interfaceLang } = commonStore; + const { languages, hideTray, hideMenuBar } = config; const type = dbStore.getTypeById(commonStore.type); const interfaceLanguages = this.getInterfaceLanguages(); const spellingLanguages = this.getSpellinngLanguages(); + const canHideMenu = UtilCommon.isPlatformWindows() || UtilCommon.isPlatformLinux(); return ( @@ -40,7 +42,7 @@ const PopupSettingsPagePersonal = observer(class PopupSettingsPagePersonal exten Action.setInterfaceLang(v)} arrowClassName="black" @@ -66,6 +68,18 @@ const PopupSettingsPagePersonal = observer(class PopupSettingsPagePersonal exten }} />
+ +
+
+ + {canHideMenu ? ( +
+
+ ) : ''}
diff --git a/src/ts/model/block.ts b/src/ts/model/block.ts index 24ce52576e..b08ced1134 100644 --- a/src/ts/model/block.ts +++ b/src/ts/model/block.ts @@ -123,7 +123,7 @@ class Block implements I.Block { }; canBecomeWidget (): boolean { - return this.isLink() || this.isBookmark() || this.isFile() || this.isText(); + return this.isLink() || this.isBookmark() || this.isFile() || this.isText() || this.isDataview(); }; isSystem () { From 364cbd9cc0dc9bc0a86f96e89fce4fd7f2f0c242 Mon Sep 17 00:00:00 2001 From: Andrew Simachev Date: Mon, 30 Oct 2023 14:25:01 +0100 Subject: [PATCH 10/88] space storage updates --- .../popup/page/settings/space/index.tsx | 13 ++++--- src/ts/component/util/progressBar.tsx | 39 ++++++++++++++----- src/ts/lib/api/dispatcher.ts | 9 ++++- src/ts/lib/util/file.ts | 2 +- 4 files changed, 46 insertions(+), 17 deletions(-) diff --git a/src/ts/component/popup/page/settings/space/index.tsx b/src/ts/component/popup/page/settings/space/index.tsx index 0542bb368a..841a50573a 100644 --- a/src/ts/component/popup/page/settings/space/index.tsx +++ b/src/ts/component/popup/page/settings/space/index.tsx @@ -30,25 +30,28 @@ const PopupSettingsSpaceIndex = observer(class PopupSettingsSpaceIndex extends R render () { const { onPage, onSpaceTypeTooltip } = this.props; const { error } = this.state; - const { localUsage, bytesUsed, bytesLimit, spaces } = commonStore.spaceStorage; + const { localUsage, bytesLimit, spaces } = commonStore.spaceStorage; const { account, accountSpaceId } = authStore; const space = UtilObject.getSpaceview(); const home = UtilObject.getSpaceDashboard(); - const isRed = (bytesUsed / bytesLimit >= 0.9) || (localUsage > bytesLimit); const usageCn = [ 'item' ]; const canDelete = space.targetSpaceId != accountSpaceId; + + let bytesUsed = 0; + let extend = null; + let createdDate = null; + const progressSegments = (spaces || []).map(it => { const object = UtilObject.getSpaceviewBySpaceId(it.spaceId); if (object._empty_) { return null; }; + bytesUsed += it.bytesUsage; return { name: object.name, percent: it.bytesUsage / bytesLimit, isActive: (it.spaceId == commonStore.space) }; }).filter(it => it); - - let extend = null; - let createdDate = null; + const isRed = (bytesUsed / bytesLimit >= 0.9) || (localUsage > bytesLimit); if (isRed) { usageCn.push('red'); diff --git a/src/ts/component/util/progressBar.tsx b/src/ts/component/util/progressBar.tsx index dec4a6c464..ed635b2cd3 100644 --- a/src/ts/component/util/progressBar.tsx +++ b/src/ts/component/util/progressBar.tsx @@ -1,5 +1,6 @@ import * as React from 'react'; import { Label } from 'Component'; +import { Preview } from 'Lib'; interface Props { segments: { name: string; percent: number; isActive: boolean; }[]; @@ -11,22 +12,38 @@ class ProgressBar extends React.Component { node: any = null; + constructor (props: Props) { + super(props); + + this.onTooltipShow = this.onTooltipShow.bind(this); + }; + render () { const { segments, current, max } = this.props; const total = segments.reduce((res, current) => res += current.percent, 0); + const Item = (item: any) => { + const cn = [ 'fill' ]; + if (item.isActive) { + cn.push('isActive'); + }; + + return ( +
this.onTooltipShow(e, item)} + onMouseLeave={() => Preview.tooltipHide(false)} + /> + ); + }; + return (
- {segments.map((item, i) => { - const cn = [ 'fill' ]; - if (item.isActive) { - cn.push('isActive'); - }; - - return
; - })} - + {segments.map((item, i) => ( + + ))}
@@ -37,6 +54,10 @@ class ProgressBar extends React.Component {
); }; + + onTooltipShow (e: any, item: any) { + Preview.tooltipShow({ text: item.name, element: $(e.currentTarget) }); + }; }; diff --git a/src/ts/lib/api/dispatcher.ts b/src/ts/lib/api/dispatcher.ts index 1d04a85764..b859ba0697 100644 --- a/src/ts/lib/api/dispatcher.ts +++ b/src/ts/lib/api/dispatcher.ts @@ -1,6 +1,6 @@ import * as Sentry from '@sentry/browser'; import arrayMove from 'array-move'; -import { observable } from 'mobx'; +import { observable, set } from 'mobx'; import Commands from 'protobuf/pb/protos/commands_pb'; import Events from 'protobuf/pb/protos/events_pb'; import Service from 'protobuf/pb/protos/service/service_grpc_web_pb'; @@ -245,7 +245,12 @@ class Dispatcher { }; case 'fileSpaceUsage': { - commonStore.spaceStorageSet({ bytesUsed: data.getBytesusage() }); + const spaceId = data.getSpaceid(); + const space = (commonStore.spaceStorage.spaces || []).find(it => it.spaceId == spaceId); + + if (space) { + set(space, { bytesUsage: data.getBytesusage() }); + }; break; }; diff --git a/src/ts/lib/util/file.ts b/src/ts/lib/util/file.ts index d3e17ec413..b812b0bd46 100644 --- a/src/ts/lib/util/file.ts +++ b/src/ts/lib/util/file.ts @@ -39,7 +39,7 @@ class UtilFile { }; }; - return ret ? UtilCommon.formatNumber(Number(UtilCommon.sprintf(`%0.2f`, ret))) + unit : ''; + return UtilCommon.formatNumber(Number(UtilCommon.sprintf(`%0.2f`, ret))) + unit; }; icon (obj: any): string { From 48ba19c7c1110e4d5bba01953a3080746ff093e6 Mon Sep 17 00:00:00 2001 From: Andrew Simachev Date: Mon, 30 Oct 2023 14:32:35 +0100 Subject: [PATCH 11/88] space storage updates --- src/ts/lib/api/dispatcher.ts | 11 ++++++++--- src/ts/lib/api/response.ts | 5 ----- src/ts/store/common.ts | 16 ++-------------- 3 files changed, 10 insertions(+), 22 deletions(-) diff --git a/src/ts/lib/api/dispatcher.ts b/src/ts/lib/api/dispatcher.ts index b859ba0697..4246c0495a 100644 --- a/src/ts/lib/api/dispatcher.ts +++ b/src/ts/lib/api/dispatcher.ts @@ -246,10 +246,14 @@ class Dispatcher { case 'fileSpaceUsage': { const spaceId = data.getSpaceid(); - const space = (commonStore.spaceStorage.spaces || []).find(it => it.spaceId == spaceId); + const { spaces } = commonStore.spaceStorage; + const space = spaces.find(it => it.spaceId == spaceId); + const bytesUsage = data.getBytesusage(); if (space) { - set(space, { bytesUsage: data.getBytesusage() }); + set(space, { bytesUsage }); + } else { + spaces.push({ spaceId, bytesUsage }); }; break; }; @@ -260,7 +264,8 @@ class Dispatcher { }; case 'fileLimitReached': { - const { bytesUsed, bytesLimit, localUsage } = commonStore.spaceStorage; + const { bytesLimit, localUsage, spaces } = commonStore.spaceStorage; + const bytesUsed = spaces.reduce((res, current) => res += current.bytesUsage, 0); const percentageUsed = Math.floor(UtilCommon.getPercent(bytesUsed, bytesLimit)); if (percentageUsed >= 99) { diff --git a/src/ts/lib/api/response.ts b/src/ts/lib/api/response.ts index 0d373dd7b4..57c3f485f5 100644 --- a/src/ts/lib/api/response.ts +++ b/src/ts/lib/api/response.ts @@ -63,10 +63,7 @@ export const FileNodeUsage = (response: Rpc.File.NodeUsage.Response) => { if (usage) { res = Object.assign(res, { - bytesUsed: usage.getBytesusage(), - bytesLeft: usage.getBytesleft(), bytesLimit: usage.getByteslimit(), - filesCount: usage.getFilescount(), localUsage: usage.getLocalbytesusage(), }); }; @@ -75,8 +72,6 @@ export const FileNodeUsage = (response: Rpc.File.NodeUsage.Response) => { ...res, spaces: (response.getSpacesList() || []).map(it => ({ spaceId: it.getSpaceid(), - filesCount: it.getFilescount(), - cidsCount: it.getCidscount(), bytesUsage: it.getBytesusage(), })), }; diff --git a/src/ts/store/common.ts b/src/ts/store/common.ts index d0e5d7c6cc..05e72189e5 100644 --- a/src/ts/store/common.ts +++ b/src/ts/store/common.ts @@ -21,13 +21,10 @@ interface Graph { }; interface SpaceStorage { - bytesUsed: number; bytesLimit: number; localUsage: number; spaces: { spaceId: string; - filesCount: number; - cidsCount: number; bytesUsage: number; }[], }; @@ -72,7 +69,6 @@ class CommonStore { }; public spaceStorageObj: SpaceStorage = { - bytesUsed: 0, bytesLimit: 0, localUsage: 0, spaces: [], @@ -196,16 +192,8 @@ class CommonStore { }; get spaceStorage (): SpaceStorage { - let { bytesUsed, localUsage } = this.spaceStorageObj; - - if (bytesUsed <= 1024 * 1024) { - bytesUsed = 0; - }; - if (localUsage <= 1024 * 1024) { - localUsage = 0; - }; - - return { ...this.spaceStorageObj, bytesUsed, localUsage }; + const spaces = this.spaceStorageObj.spaces || []; + return { ...this.spaceStorageObj, spaces }; }; get interfaceLang (): string { From c0baa730eaa42b28b7a1b4c638bca51d27d2dbd4 Mon Sep 17 00:00:00 2001 From: Andrew Simachev Date: Mon, 30 Oct 2023 14:37:57 +0100 Subject: [PATCH 12/88] JS-3260: fix --- src/ts/component/popup/export.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ts/component/popup/export.tsx b/src/ts/component/popup/export.tsx index 0f0a640e50..9e2482d41a 100644 --- a/src/ts/component/popup/export.tsx +++ b/src/ts/component/popup/export.tsx @@ -49,7 +49,7 @@ const PopupExport = observer(class PopupExport extends React.Component control = ( { this.data[item.id] = v; this.save(); From 5643621645f628a891aab41d97f8d1e34b331b9b Mon Sep 17 00:00:00 2001 From: Andrew Simachev Date: Mon, 30 Oct 2023 14:48:17 +0100 Subject: [PATCH 13/88] JS-3260: fix --- src/scss/component/progressBar.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scss/component/progressBar.scss b/src/scss/component/progressBar.scss index 3931f7682e..c5e42d8a2c 100644 --- a/src/scss/component/progressBar.scss +++ b/src/scss/component/progressBar.scss @@ -3,7 +3,7 @@ .progressBar { .bar { position: relative; overflow: hidden; height: 12px; border-radius: 4px; display: flex; flex-direction: row; gap: 0px 2px; } .bar { - .fill { height: 100%; background-color: $colorSystemAccent25; } + .fill { height: 100%; background-color: $colorSystemAccent25; min-width: 6px; } .fill.isActive { background-color: $colorSystemAccent100; } .fill.empty { background-color: $colorShapeTertiary; } } From bb17db006c54c55cf9cceab5ee572b1ea325e88f Mon Sep 17 00:00:00 2001 From: Andrew Simachev Date: Mon, 30 Oct 2023 14:49:42 +0100 Subject: [PATCH 14/88] fix --- src/ts/component/block/dataview/controls.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/ts/component/block/dataview/controls.tsx b/src/ts/component/block/dataview/controls.tsx index 7b53e1da3c..b1b2c07a63 100644 --- a/src/ts/component/block/dataview/controls.tsx +++ b/src/ts/component/block/dataview/controls.tsx @@ -414,12 +414,15 @@ const Controls = observer(class Controls extends React.Component { return; }; - const { isPopup } = this.props; + const { isPopup, isInline } = this.props; const container = UtilCommon.getPageContainer(isPopup); const win = $(window); this.refFilter.setActive(true); - this.refFilter.focus(); + + if (!isInline) { + this.refFilter.focus(); + }; container.off('mousedown.filter').on('mousedown.filter', (e: any) => { const value = this.refFilter.getValue(); From 30531713c4059db21684f417164efa995241a560 Mon Sep 17 00:00:00 2001 From: Andrew Simachev Date: Tue, 31 Oct 2023 13:42:53 +0100 Subject: [PATCH 15/88] JS-3230: fixes --- src/ts/component/menu/smile.tsx | 9 +++---- src/ts/component/menu/space.tsx | 14 +---------- .../popup/page/settings/space/index.tsx | 17 +++++++------ src/ts/component/util/progressBar.tsx | 5 ++-- src/ts/component/widget/space.tsx | 2 +- src/ts/store/db.ts | 24 ++++++++++++++++--- 6 files changed, 37 insertions(+), 34 deletions(-) diff --git a/src/ts/component/menu/smile.tsx b/src/ts/component/menu/smile.tsx index dc1f223219..6806c077c7 100644 --- a/src/ts/component/menu/smile.tsx +++ b/src/ts/component/menu/smile.tsx @@ -513,14 +513,11 @@ class MenuSmile extends React.Component { this.active = item; if (this.active) { - const item = node.find(`#item-${$.escapeSelector(this.active.id)}`); + const element = node.find(`#item-${$.escapeSelector(this.active.id)}`); - item.addClass('active'); + element.addClass('active'); - Preview.tooltipShow({ - text: this.aliases[this.active.itemId] || this.active.itemId, - element: item, - }); + Preview.tooltipShow({ text: (this.aliases[this.active.itemId] || this.active.itemId), element }); }; }; diff --git a/src/ts/component/menu/space.tsx b/src/ts/component/menu/space.tsx index d36b0e030f..bd3c93fb80 100644 --- a/src/ts/component/menu/space.tsx +++ b/src/ts/component/menu/space.tsx @@ -193,19 +193,7 @@ const MenuSpace = observer(class MenuSpace extends React.Component { }; getItems () { - const subId = Constant.subId.space; - const { spaceview } = blockStore; - - const items = UtilCommon.objectCopy(dbStore.getRecords(subId, '')). - map(id => detailStore.get(subId, id, UtilData.spaceRelationKeys())). - filter(it => (it.spaceAccountStatus != I.SpaceStatus.Deleted) && (it.spaceLocalStatus == I.SpaceStatus.Ok)). - map(it => ({ ...it, isActive: spaceview == it.id })); - - items.sort((c1, c2) => { - if (c1.isActive && !c2.isActive) return -1; - if (!c1.isActive && c2.isActive) return 1; - return 0; - }); + const items = UtilCommon.objectCopy(dbStore.getSpaces()); if (items.length < Constant.limit.space) { items.push({ id: 'add' }); diff --git a/src/ts/component/popup/page/settings/space/index.tsx b/src/ts/component/popup/page/settings/space/index.tsx index 841a50573a..451ec5b3ad 100644 --- a/src/ts/component/popup/page/settings/space/index.tsx +++ b/src/ts/component/popup/page/settings/space/index.tsx @@ -2,7 +2,7 @@ import * as React from 'react'; import { Icon, Title, Label, Input, IconObject, Button, ProgressBar, Error } from 'Component'; import { I, C, UtilObject, UtilMenu, UtilCommon, UtilFile, translate, Renderer, Preview, analytics, UtilDate, Action } from 'Lib'; import { observer } from 'mobx-react'; -import { detailStore, menuStore, commonStore, authStore } from 'Store'; +import { detailStore, menuStore, commonStore, authStore, dbStore } from 'Store'; import Constant from 'json/constant.json'; import Url from 'json/url.json'; @@ -30,7 +30,8 @@ const PopupSettingsSpaceIndex = observer(class PopupSettingsSpaceIndex extends R render () { const { onPage, onSpaceTypeTooltip } = this.props; const { error } = this.state; - const { localUsage, bytesLimit, spaces } = commonStore.spaceStorage; + const { localUsage, bytesLimit } = commonStore.spaceStorage; + const spaces = dbStore.getSpaces(); const { account, accountSpaceId } = authStore; const space = UtilObject.getSpaceview(); const home = UtilObject.getSpaceDashboard(); @@ -42,14 +43,12 @@ const PopupSettingsSpaceIndex = observer(class PopupSettingsSpaceIndex extends R let extend = null; let createdDate = null; - const progressSegments = (spaces || []).map(it => { - const object = UtilObject.getSpaceviewBySpaceId(it.spaceId); - if (object._empty_) { - return null; - }; + const progressSegments = (spaces || []).map(space => { + const object: any = commonStore.spaceStorage.spaces.find(it => it.spaceId == space.targetSpaceId) || {}; + const usage = Number(object.bytesUsage) || 0; - bytesUsed += it.bytesUsage; - return { name: object.name, percent: it.bytesUsage / bytesLimit, isActive: (it.spaceId == commonStore.space) }; + bytesUsed += usage; + return { name: space.name, caption: UtilFile.size(usage), percent: usage / bytesLimit, isActive: space.isActive }; }).filter(it => it); const isRed = (bytesUsed / bytesLimit >= 0.9) || (localUsage > bytesLimit); diff --git a/src/ts/component/util/progressBar.tsx b/src/ts/component/util/progressBar.tsx index ed635b2cd3..4d3b3e4d6e 100644 --- a/src/ts/component/util/progressBar.tsx +++ b/src/ts/component/util/progressBar.tsx @@ -3,7 +3,7 @@ import { Label } from 'Component'; import { Preview } from 'Lib'; interface Props { - segments: { name: string; percent: number; isActive: boolean; }[]; + segments: { name: string; caption: string; percent: number; isActive: boolean; }[]; current?: string; max?: string; }; @@ -56,7 +56,8 @@ class ProgressBar extends React.Component { }; onTooltipShow (e: any, item: any) { - Preview.tooltipShow({ text: item.name, element: $(e.currentTarget) }); + const t = Preview.tooltipCaption(item.name, item.caption); + Preview.tooltipShow({ text: t, element: $(e.currentTarget) }); }; }; diff --git a/src/ts/component/widget/space.tsx b/src/ts/component/widget/space.tsx index 1d4b715406..f801387985 100644 --- a/src/ts/component/widget/space.tsx +++ b/src/ts/component/widget/space.tsx @@ -29,7 +29,7 @@ const WidgetSpace = observer(class WidgetSpace extends React.Component
- {space ?
{translate(`spaceType${space.spaceType}`)}
: ''} + {space && !space._empty_ ?
{translate(`spaceType${space.spaceType}`)}
: ''}
); diff --git a/src/ts/store/db.ts b/src/ts/store/db.ts index 317ffe1efd..51ee6a6934 100644 --- a/src/ts/store/db.ts +++ b/src/ts/store/db.ts @@ -1,6 +1,6 @@ import { observable, action, set, intercept, makeObservable } from 'mobx'; -import { I, M, UtilCommon, Dataview } from 'ts/lib'; -import { detailStore, commonStore } from 'ts/store'; +import { I, M, UtilCommon, UtilData, Dataview } from 'Lib'; +import { detailStore, commonStore, blockStore } from 'Store'; import Constant from 'json/constant.json'; enum KeyMapType { @@ -295,7 +295,25 @@ class DbStore { getRelations () { return dbStore.getRecords(Constant.subId.relation, '').map(id => this.getRelationById(id)). - filter(it => it && !it.isArchived); + filter(it => it && !it.isArchived && !it.isDeleted); + }; + + getSpaces () { + const subId = Constant.subId.space; + const { spaceview } = blockStore; + + let items = dbStore.getRecords(subId, '').map(id => detailStore.get(subId, id, UtilData.spaceRelationKeys())); + + items = items.filter(it => (it.spaceAccountStatus != I.SpaceStatus.Deleted) && (it.spaceLocalStatus == I.SpaceStatus.Ok)); + items = items.map(it => ({ ...it, isActive: spaceview == it.id })); + + items.sort((c1, c2) => { + if (c1.isActive && !c2.isActive) return -1; + if (!c1.isActive && c2.isActive) return 1; + return 0; + }); + + return items; }; getObjectRelationKeys (rootId: string, blockId: string): any[] { From 1400a9ee20865faab028bac133e09eafcb961414 Mon Sep 17 00:00:00 2001 From: Andrew Simachev Date: Wed, 1 Nov 2023 10:30:05 +0100 Subject: [PATCH 16/88] JS-3269: add row in inline sets --- dist/workers/graph.js | 6 +----- src/ts/component/block/dataview/view/grid.tsx | 12 ++++++------ src/ts/component/block/dataview/view/list.tsx | 12 ++++++------ 3 files changed, 13 insertions(+), 17 deletions(-) diff --git a/dist/workers/graph.js b/dist/workers/graph.js index 608f344344..5b1489197a 100644 --- a/dist/workers/graph.js +++ b/dist/workers/graph.js @@ -470,7 +470,7 @@ drawNode = (d) => { x = d.x - radius; y = d.y - radius; - if (isIconCircle(d)) { + if (isLayoutHuman(d)) { util.circle(d.x, d.y, radius); } else { util.roundedRect(d.x - radius, d.y - radius, diameter, diameter, getBorderRadius()); @@ -742,10 +742,6 @@ const isLayoutBookmark = (d) => { return d.layout == ObjectLayout.Bookmark; }; -const isIconCircle = (d) => { - return isLayoutHuman(d); -}; - const getNodeById = (id) => { return nodes.find(d => d.id == id); }; diff --git a/src/ts/component/block/dataview/view/grid.tsx b/src/ts/component/block/dataview/view/grid.tsx index 2e32699505..3c8e4c4d1b 100644 --- a/src/ts/component/block/dataview/view/grid.tsx +++ b/src/ts/component/block/dataview/view/grid.tsx @@ -126,20 +126,20 @@ const ViewGrid = observer(class ViewGrid extends React.Component - ) : ''} - - {isAllowedObject && !isInline ? ( + {isAllowedObject ? (
-
{ onRecordAdd(e, 1); }}> +
onRecordAdd(e, 1)}>
{translate('blockDataviewNew')}
) : null} + + {isInline && (limit + offset < total) ? ( + + ) : ''}
diff --git a/src/ts/component/block/dataview/view/list.tsx b/src/ts/component/block/dataview/view/list.tsx index 84e58de5bd..d2de4330e9 100644 --- a/src/ts/component/block/dataview/view/list.tsx +++ b/src/ts/component/block/dataview/view/list.tsx @@ -103,20 +103,20 @@ const ViewList = observer(class ViewList extends React.Component {content} - {isInline && (limit + offset < total) ? ( - - ) : ''} - - {isAllowedObject && !isInline ? ( + {isAllowedObject ? (
-
{ onRecordAdd(e, 1); }}> +
onRecordAdd(e, 1)}>
{translate('blockDataviewNew')}
) : null} + + {isInline && (limit + offset < total) ? ( + + ) : ''}
From 6561b40bac93746d8b277850919c231a50ee132a Mon Sep 17 00:00:00 2001 From: Andrew Simachev Date: Wed, 1 Nov 2023 10:40:08 +0100 Subject: [PATCH 17/88] fix --- src/ts/lib/survey.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ts/lib/survey.ts b/src/ts/lib/survey.ts index c1e1104ab2..849eef3f9a 100644 --- a/src/ts/lib/survey.ts +++ b/src/ts/lib/survey.ts @@ -99,7 +99,7 @@ class Survey { return; }; - if (!popupStore.isOpen() && (cancelTime || !lastCompleted)) { + if (!popupStore.isOpen() && (cancelTime || !lastCompleted) && !completeTime) { this.show(I.SurveyType.Pmf); }; }; From 38bc0d5a62380d9773a29588af871dad3dd4a0f3 Mon Sep 17 00:00:00 2001 From: Andrew Simachev Date: Wed, 1 Nov 2023 12:47:58 +0100 Subject: [PATCH 18/88] JS-3272: MenuSpace update --- src/img/icon/menu/space/settings.svg | 26 +++++++++---------- src/img/icon/plus/space.svg | 4 +-- src/json/text.json | 1 + src/scss/menu/space.scss | 37 ++++++++++++++-------------- src/scss/theme/dark/menu.scss | 4 --- src/ts/component/menu/space.tsx | 5 +++- 6 files changed, 38 insertions(+), 39 deletions(-) diff --git a/src/img/icon/menu/space/settings.svg b/src/img/icon/menu/space/settings.svg index f4fe3725ec..a0a35259ee 100644 --- a/src/img/icon/menu/space/settings.svg +++ b/src/img/icon/menu/space/settings.svg @@ -1,15 +1,15 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + diff --git a/src/img/icon/plus/space.svg b/src/img/icon/plus/space.svg index 9670fb62a3..946944a976 100644 --- a/src/img/icon/plus/space.svg +++ b/src/img/icon/plus/space.svg @@ -1,10 +1,10 @@ - + - + diff --git a/src/json/text.json b/src/json/text.json index bf17115a15..a9cbc782d9 100644 --- a/src/json/text.json +++ b/src/json/text.json @@ -110,6 +110,7 @@ "commonSetDefault": "Set as default", "commonTemplates": "Templates", "commonSkip": "Skip", + "commonCreateNew": "Create new", "commonLCCollection": "Collection", "commonLCSet": "Set", diff --git a/src/scss/menu/space.scss b/src/scss/menu/space.scss index 41cc79bf60..693dd97641 100644 --- a/src/scss/menu/space.scss +++ b/src/scss/menu/space.scss @@ -2,7 +2,7 @@ .menus { .menu.menuSpace { - border-radius: 16px; background: rgba(37, 37, 37, 0.15) !important; backdrop-filter: blur(12.5px); padding: 24px 24px 16px 24px; + border-radius: 16px; background: rgba(37, 37, 37, 0.4) !important; backdrop-filter: blur(12.5px); padding: 20px 12px 16px 12px; box-shadow: 0px 0px; min-width: 368px; } @@ -11,7 +11,7 @@ .head { display: flex; flex-direction: row; align-items: center; justify-content: space-between; margin: 0px 0px 24px 0px; - @include text-paragraph; font-weight: 600; gap: 0px 16px; + @include text-paragraph; font-weight: 600; gap: 0px 16px; padding: 0px 8px; color: $colorTextInversion; } .head { .side.left { display: flex; flex-direction: row; align-items: center; gap: 0px 10px; width: calc(100% - 36px); } @@ -25,30 +25,29 @@ .items { display: flex; flex-direction: row; gap: 16px; flex-wrap: wrap; } .items { - .item { width: 96px; } - .item.space { display: flex; flex-direction: column; align-items: center; gap: 8px 0px; } - .item.space { - .iconWrap { - width: 96px; height: 96px; border-radius: 4px; overflow: hidden; transition: all 0.2s $easeInQuint; - transform-origin: 50% 100%; + .item { + width: 112px; border-radius: 8px; padding: 8px; transition: all 0.2s $easeInQuint; + display: flex; flex-direction: column; align-items: center; gap: 8px 0px; + } + .item { + .iconWrap { width: 96px; height: 96px; border-radius: 4px; overflow: hidden; } + .name { + @include text-overflow-nw; @include text-small; width: 100%; text-align: center; color: $colorTextInversion; opacity: 0; + transition: all 0.2s $easeInQuint; } - .iconObject { border-radius: 0px; } - .name { @include text-overflow-nw; width: 100%; text-align: center; } } .item.add { - border-radius: 4px; height: 96px; background-color: rgba(255, 255, 255, 0.3); - background-image: url('~img/icon/plus/space.svg'); background-size: 20px; background-position: center; - background-repeat: no-repeat; margin: 0px 0px 26px 0px; transition: all 0.2s $easeInQuint; transform-origin: 50% 100%; + .iconWrap { + background-image: url('~img/icon/plus/space.svg'); background-size: 20px; + background-position: center; background-repeat: no-repeat; box-shadow: 0px 0px 0px 1px $colorBgPrimary; + } } - .item.space.hover { - .iconWrap { transform: scale(1.06, 1.06); } + .item.hover { background: rgba(37, 37, 37, 0.15); } + .item.hover { + .name { opacity: 1; } } - .item.space.isActive { - .iconWrap { box-shadow: 0px 0px 0px 4px #fff, 0px 0px 6px rgba(0,0,0,0.1); } - } - .item.add.hover { transform: scale(1.06, 1.06); } } } } \ No newline at end of file diff --git a/src/scss/theme/dark/menu.scss b/src/scss/theme/dark/menu.scss index 24c078c3c5..50ce95a7fc 100644 --- a/src/scss/theme/dark/menu.scss +++ b/src/scss/theme/dark/menu.scss @@ -407,9 +407,5 @@ .head { .icon.settings { background-image: url('#{$themePath}/icon/menu/space/settings.svg'); } } - - .items { - .item.add { background-color: rgba(255, 255, 255, 0.1); background-image: url('#{$themePath}/icon/plus/space.svg'); } - } } } diff --git a/src/ts/component/menu/space.tsx b/src/ts/component/menu/space.tsx index bd3c93fb80..915a9aaf95 100644 --- a/src/ts/component/menu/space.tsx +++ b/src/ts/component/menu/space.tsx @@ -55,7 +55,10 @@ const MenuSpace = observer(class MenuSpace extends React.Component { onClick={this.onAdd} onMouseEnter={e => this.onMouseEnter(e, item)} onMouseLeave={e => setHover()} - /> + > +
+
{translate('commonCreateNew')}
+
); return ( From 9e368bb22d56fe7977c8924795ded832ab16dd2b Mon Sep 17 00:00:00 2001 From: Andrew Simachev Date: Wed, 1 Nov 2023 12:57:39 +0100 Subject: [PATCH 19/88] fix texts --- src/json/text.json | 3 ++- src/ts/component/page/main/relation.tsx | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/json/text.json b/src/json/text.json index bf17115a15..53465ca3b1 100644 --- a/src/json/text.json +++ b/src/json/text.json @@ -122,7 +122,7 @@ "pluralTemplate": "template|templates", "pluralRelation": "Relation|Relations", "pluralBlock": "Block|Blocks", - "pluralType": "Type|Types", + "pluralType": "Object Type|Object Types", "pluralUCRelation": "Relation|Relations", "electronAboutVersion": "Version:", @@ -375,6 +375,7 @@ "pageMainArchiveEmpty": "Your Bin is empty", "pageMainBlockEmpty": "Block not found", + "pageMainRelationObjectsCreated": "%s created", "editorControlIcon": "Icon", "editorControlCover": "Cover", diff --git a/src/ts/component/page/main/relation.tsx b/src/ts/component/page/main/relation.tsx index 65b7be5e87..72bf0cdd10 100644 --- a/src/ts/component/page/main/relation.tsx +++ b/src/ts/component/page/main/relation.tsx @@ -75,7 +75,7 @@ const PageMainRelation = observer(class PageMainRelation extends React.Component {object.isInstalled ? (
-
{totalObject} {UtilCommon.plural(totalObject, translate('pluralObject'))}
+
{totalObject} {UtilCommon.sprintf(translate('pageMainRelationObjectsCreated'), UtilCommon.plural(totalObject, translate('pluralObject')))}
From 4b6b74b77f53dad03c3c7f1f5fc4751f0e87570c Mon Sep 17 00:00:00 2001 From: Andrew Simachev Date: Wed, 1 Nov 2023 14:58:10 +0100 Subject: [PATCH 20/88] JS-3278: fix --- src/ts/component/block/dataview.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/ts/component/block/dataview.tsx b/src/ts/component/block/dataview.tsx index b11c3280f5..64afe96da1 100644 --- a/src/ts/component/block/dataview.tsx +++ b/src/ts/component/block/dataview.tsx @@ -855,11 +855,9 @@ const BlockDataview = observer(class BlockDataview extends React.Component Date: Wed, 1 Nov 2023 15:24:14 +0100 Subject: [PATCH 21/88] JS-3279: fix --- src/scss/popup/settings.scss | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/scss/popup/settings.scss b/src/scss/popup/settings.scss index d7bff6cabc..3145eb608c 100644 --- a/src/scss/popup/settings.scss +++ b/src/scss/popup/settings.scss @@ -216,7 +216,9 @@ .input { padding: 0; } .name { margin-bottom: 8px; } - .name .input { @include text-header1; } + .name { + .input { @include text-header1; height: 32px; } + } .spaceType { display: inline-block; width: unset; padding: 3px 7px 3px 26px; border-radius: 6px; From 39be5693ff45e7e320ed7e1878180ce3d7501b0e Mon Sep 17 00:00:00 2001 From: Andrew Simachev Date: Wed, 1 Nov 2023 15:57:22 +0100 Subject: [PATCH 22/88] design review --- src/img/theme/dark/icon/plus/space.svg | 4 ++-- src/scss/menu/space.scss | 12 +++--------- src/scss/theme/dark/menu.scss | 9 +++++++++ 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/img/theme/dark/icon/plus/space.svg b/src/img/theme/dark/icon/plus/space.svg index 64a2fd0137..b135a633f5 100644 --- a/src/img/theme/dark/icon/plus/space.svg +++ b/src/img/theme/dark/icon/plus/space.svg @@ -1,10 +1,10 @@ - + - + diff --git a/src/scss/menu/space.scss b/src/scss/menu/space.scss index 693dd97641..68a65f8c09 100644 --- a/src/scss/menu/space.scss +++ b/src/scss/menu/space.scss @@ -3,7 +3,7 @@ .menus { .menu.menuSpace { border-radius: 16px; background: rgba(37, 37, 37, 0.4) !important; backdrop-filter: blur(12.5px); padding: 20px 12px 16px 12px; - box-shadow: 0px 0px; min-width: 368px; + box-shadow: 0px 0px; min-width: 368px; color: $colorTextInversion; } .menu.menuSpace { @@ -11,7 +11,7 @@ .head { display: flex; flex-direction: row; align-items: center; justify-content: space-between; margin: 0px 0px 24px 0px; - @include text-paragraph; font-weight: 600; gap: 0px 16px; padding: 0px 8px; color: $colorTextInversion; + @include text-paragraph; font-weight: 600; gap: 0px 16px; padding: 0px 8px; } .head { .side.left { display: flex; flex-direction: row; align-items: center; gap: 0px 10px; width: calc(100% - 36px); } @@ -31,10 +31,7 @@ } .item { .iconWrap { width: 96px; height: 96px; border-radius: 4px; overflow: hidden; } - .name { - @include text-overflow-nw; @include text-small; width: 100%; text-align: center; color: $colorTextInversion; opacity: 0; - transition: all 0.2s $easeInQuint; - } + .name { @include text-overflow-nw; @include text-small; width: 100%; text-align: center; } } .item.add { @@ -45,9 +42,6 @@ } .item.hover { background: rgba(37, 37, 37, 0.15); } - .item.hover { - .name { opacity: 1; } - } } } } \ No newline at end of file diff --git a/src/scss/theme/dark/menu.scss b/src/scss/theme/dark/menu.scss index 50ce95a7fc..65dd6ee3e3 100644 --- a/src/scss/theme/dark/menu.scss +++ b/src/scss/theme/dark/menu.scss @@ -403,9 +403,18 @@ /* MenuSpace */ + .menu.menuSpace { color: $colorTextPrimary; } .menu.menuSpace { .head { .icon.settings { background-image: url('#{$themePath}/icon/menu/space/settings.svg'); } } + + .items { + .item.add { + .iconWrap { box-shadow: 0px 0px 0px 1px $colorControlActive; background-image: url('#{$themePath}/icon/plus/space.svg'); } + } + + .item.hover { background-color: rgba(255, 255, 255, 0.10); } + } } } From 7b79818aaf5d1edb225b9c7b15f82a15c40bd26c Mon Sep 17 00:00:00 2001 From: Andrew Simachev Date: Wed, 1 Nov 2023 16:22:45 +0100 Subject: [PATCH 23/88] design review --- src/scss/menu/space.scss | 6 +++--- src/ts/component/menu/space.tsx | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/scss/menu/space.scss b/src/scss/menu/space.scss index 68a65f8c09..fff26e239c 100644 --- a/src/scss/menu/space.scss +++ b/src/scss/menu/space.scss @@ -2,7 +2,7 @@ .menus { .menu.menuSpace { - border-radius: 16px; background: rgba(37, 37, 37, 0.4) !important; backdrop-filter: blur(12.5px); padding: 20px 12px 16px 12px; + border-radius: 16px; background: rgba(37, 37, 37, 0.4) !important; backdrop-filter: blur(12.5px); padding: 20px 16px 16px 16px; box-shadow: 0px 0px; min-width: 368px; color: $colorTextInversion; } @@ -10,7 +10,7 @@ .wrap { width: 100%; } .head { - display: flex; flex-direction: row; align-items: center; justify-content: space-between; margin: 0px 0px 24px 0px; + display: flex; flex-direction: row; align-items: center; justify-content: space-between; margin: 0px 0px 12px 0px; @include text-paragraph; font-weight: 600; gap: 0px 16px; padding: 0px 8px; } .head { @@ -31,7 +31,7 @@ } .item { .iconWrap { width: 96px; height: 96px; border-radius: 4px; overflow: hidden; } - .name { @include text-overflow-nw; @include text-small; width: 100%; text-align: center; } + .name { @include text-overflow-nw; @include text-small; width: 100%; text-align: center; font-weight: 500; } } .item.add { diff --git a/src/ts/component/menu/space.tsx b/src/ts/component/menu/space.tsx index 915a9aaf95..2b4afe8c55 100644 --- a/src/ts/component/menu/space.tsx +++ b/src/ts/component/menu/space.tsx @@ -68,7 +68,7 @@ const MenuSpace = observer(class MenuSpace extends React.Component { >
- +
From 6ddf5f356e86a9cd58082c61f56861b5eef3b5dd Mon Sep 17 00:00:00 2001 From: Andrew Simachev Date: Wed, 1 Nov 2023 16:23:22 +0100 Subject: [PATCH 24/88] design review --- src/scss/menu/space.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scss/menu/space.scss b/src/scss/menu/space.scss index fff26e239c..69023c2e18 100644 --- a/src/scss/menu/space.scss +++ b/src/scss/menu/space.scss @@ -3,7 +3,7 @@ .menus { .menu.menuSpace { border-radius: 16px; background: rgba(37, 37, 37, 0.4) !important; backdrop-filter: blur(12.5px); padding: 20px 16px 16px 16px; - box-shadow: 0px 0px; min-width: 368px; color: $colorTextInversion; + box-shadow: 0px 0px; min-width: 480px; color: $colorTextInversion; } .menu.menuSpace { From 66c7b568697da03bae0edb4a46d1753d23db0aaa Mon Sep 17 00:00:00 2001 From: Andrew Simachev Date: Wed, 1 Nov 2023 16:32:26 +0100 Subject: [PATCH 25/88] design review --- src/scss/component/navigation.scss | 2 +- src/scss/menu/space.scss | 2 +- src/scss/theme/dark/common.scss | 2 +- src/scss/theme/dark/menu.scss | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/scss/component/navigation.scss b/src/scss/component/navigation.scss index 099cb9d611..55f3e379f2 100644 --- a/src/scss/component/navigation.scss +++ b/src/scss/component/navigation.scss @@ -14,7 +14,7 @@ width: 32px; height: 32px; border-radius: 4px; display: flex; align-items: center; justify-content: center; transition: $transitionAllCommon; } - .iconWrap:not(.disabled):hover { background-color: $colorShapeHighlightMedium; } + .iconWrap:not(.disabled):hover { background-color: rgba(37, 37, 37, 0.15); } .icon { width: 20px; height: 20px; } .icon.back, .icon.forward { background-image: url('~img/icon/navigation/back.svg'); } diff --git a/src/scss/menu/space.scss b/src/scss/menu/space.scss index 69023c2e18..1e7b947140 100644 --- a/src/scss/menu/space.scss +++ b/src/scss/menu/space.scss @@ -23,7 +23,7 @@ .icon.settings { background-image: url('~img/icon/menu/space/settings.svg'); } } - .items { display: flex; flex-direction: row; gap: 16px; flex-wrap: wrap; } + .items { display: flex; flex-direction: row; flex-wrap: wrap; } .items { .item { width: 112px; border-radius: 8px; padding: 8px; transition: all 0.2s $easeInQuint; diff --git a/src/scss/theme/dark/common.scss b/src/scss/theme/dark/common.scss index 5ba0f4696f..1772194868 100644 --- a/src/scss/theme/dark/common.scss +++ b/src/scss/theme/dark/common.scss @@ -357,7 +357,7 @@ html.themeDark { .navigationPanel { background: rgba(141, 141, 141, 0.2); } .navigationPanel { - .iconWrap:hover { background-color: $colorShapeHighlightMedium; } + .iconWrap:hover { background-color: rgba(255, 255, 255, 0.1); } } @import "./menu.scss"; diff --git a/src/scss/theme/dark/menu.scss b/src/scss/theme/dark/menu.scss index 65dd6ee3e3..b2e50daf43 100644 --- a/src/scss/theme/dark/menu.scss +++ b/src/scss/theme/dark/menu.scss @@ -414,7 +414,7 @@ .iconWrap { box-shadow: 0px 0px 0px 1px $colorControlActive; background-image: url('#{$themePath}/icon/plus/space.svg'); } } - .item.hover { background-color: rgba(255, 255, 255, 0.10); } + .item.hover { background-color: rgba(255, 255, 255, 0.1); } } } } From b94cd6cdeca0ad25252bea478907c019212053aa Mon Sep 17 00:00:00 2001 From: Andrew Simachev Date: Wed, 1 Nov 2023 16:37:06 +0100 Subject: [PATCH 26/88] bump middleware version --- middleware.version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/middleware.version b/middleware.version index f9fa7c8fce..6b0ed1aeeb 100644 --- a/middleware.version +++ b/middleware.version @@ -1 +1 @@ -0.29.3 \ No newline at end of file +0.29.4 \ No newline at end of file From d880336e56d0e860902bacd670c3f61ab2c0c1f1 Mon Sep 17 00:00:00 2001 From: Andrew Simachev Date: Wed, 1 Nov 2023 16:44:15 +0100 Subject: [PATCH 27/88] 0.35.10-alpha --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9f3ff1f005..717d31b126 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "anytype", - "version": "0.35.9-alpha", + "version": "0.35.10-alpha", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "anytype", - "version": "0.35.9-alpha", + "version": "0.35.10-alpha", "hasInstallScript": true, "license": "SEE LICENSE IN LICENSE.md", "dependencies": { diff --git a/package.json b/package.json index 2ea36a67bd..96633ee8c0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "anytype", - "version": "0.35.9-alpha", + "version": "0.35.10-alpha", "description": "Anytype", "main": "electron.js", "scripts": { From 52325e64324502ebe5222d79e6375e0da54ac180 Mon Sep 17 00:00:00 2001 From: Andrew Simachev Date: Wed, 1 Nov 2023 17:11:48 +0100 Subject: [PATCH 28/88] MenuSpace design fixes --- src/scss/menu/space.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scss/menu/space.scss b/src/scss/menu/space.scss index 1e7b947140..9302073ec7 100644 --- a/src/scss/menu/space.scss +++ b/src/scss/menu/space.scss @@ -37,7 +37,7 @@ .item.add { .iconWrap { background-image: url('~img/icon/plus/space.svg'); background-size: 20px; - background-position: center; background-repeat: no-repeat; box-shadow: 0px 0px 0px 1px $colorBgPrimary; + background-position: center; background-repeat: no-repeat; box-shadow: 0px 0px 0px 1px $colorBgPrimary inset; } } From 7e2b1ec70d2df2a63ffb198c3ee2c5f15768de2a Mon Sep 17 00:00:00 2001 From: Andrew Simachev Date: Wed, 1 Nov 2023 17:54:53 +0100 Subject: [PATCH 29/88] JS-3283: fix --- src/ts/component/block/text.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ts/component/block/text.tsx b/src/ts/component/block/text.tsx index 0c05ad3a51..a05d7f9d44 100644 --- a/src/ts/component/block/text.tsx +++ b/src/ts/component/block/text.tsx @@ -674,10 +674,12 @@ const BlockText = observer(class BlockText extends React.Component { { key: `${cmd}+-`, preventDefault: false }, { key: `${cmd}+z`, preventDefault: true }, { key: `${cmd}+shift+z`, preventDefault: true }, + { key: `${cmd}+/`, preventDefault: false }, { key: `tab`, preventDefault: true }, { key: `shift+tab`, preventDefault: true }, { key: `shift+space`, preventDefault: false }, { key: `ctrl+shift+l`, preventDefault: false }, + { key: `ctrl+shift+/`, preventDefault: false }, ]; if (isInsideTable) { From 03503bb3cd40ab4433ef5a1bc0bb0e31f25ddd79 Mon Sep 17 00:00:00 2001 From: Andrew Simachev Date: Wed, 1 Nov 2023 18:58:59 +0100 Subject: [PATCH 30/88] MenuSpace design fixes --- src/scss/theme/dark/menu.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scss/theme/dark/menu.scss b/src/scss/theme/dark/menu.scss index b2e50daf43..045ac04cb7 100644 --- a/src/scss/theme/dark/menu.scss +++ b/src/scss/theme/dark/menu.scss @@ -411,7 +411,7 @@ .items { .item.add { - .iconWrap { box-shadow: 0px 0px 0px 1px $colorControlActive; background-image: url('#{$themePath}/icon/plus/space.svg'); } + .iconWrap { box-shadow: 0px 0px 0px 1px $colorControlActive inset; background-image: url('#{$themePath}/icon/plus/space.svg'); } } .item.hover { background-color: rgba(255, 255, 255, 0.1); } From b94565d34951185003962f9378b7d7c082e495a3 Mon Sep 17 00:00:00 2001 From: Andrew Simachev Date: Thu, 2 Nov 2023 09:59:21 +0100 Subject: [PATCH 31/88] JS-3284: fix --- src/ts/component/block/type.tsx | 4 ++-- src/ts/component/menu/dataview/object/list.tsx | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ts/component/block/type.tsx b/src/ts/component/block/type.tsx index 6425c309bc..2ecc147014 100644 --- a/src/ts/component/block/type.tsx +++ b/src/ts/component/block/type.tsx @@ -217,7 +217,7 @@ const BlockType = observer(class BlockType extends React.Component dbStore.getTypeById(id)?.uniqueKey).filter(it => it); - filters.push({ operator: I.FilterOperator.And, relationKey: 'type.uniqueKey', condition: I.FilterCondition.In, value: map }); + if (map.length) { + filters.push({ operator: I.FilterOperator.And, relationKey: 'type.uniqueKey', condition: I.FilterCondition.In, value: map }); + }; } else { filters.push({ operator: I.FilterOperator.And, relationKey: 'layout', condition: I.FilterCondition.NotIn, value: UtilObject.getSystemLayouts() }); }; From ed78d5da9231562d87579820a12b92a0a6d4686a Mon Sep 17 00:00:00 2001 From: Andrew Simachev Date: Thu, 2 Nov 2023 10:28:02 +0100 Subject: [PATCH 32/88] JS-3284: fix + refactoring --- .../component/block/dataview/cell/object.tsx | 10 +----- .../component/menu/dataview/object/list.tsx | 28 +---------------- src/ts/lib/relation.ts | 31 ++++++++++++++++++- 3 files changed, 32 insertions(+), 37 deletions(-) diff --git a/src/ts/component/block/dataview/cell/object.tsx b/src/ts/component/block/dataview/cell/object.tsx index 793fbc9402..5679aede9d 100644 --- a/src/ts/component/block/dataview/cell/object.tsx +++ b/src/ts/component/block/dataview/cell/object.tsx @@ -372,15 +372,7 @@ const CellObject = observer(class CellObject extends React.Component { if (!message.error.code) { diff --git a/src/ts/component/menu/dataview/object/list.tsx b/src/ts/component/menu/dataview/object/list.tsx index 15db3783fa..39e70375d5 100644 --- a/src/ts/component/menu/dataview/object/list.tsx +++ b/src/ts/component/menu/dataview/object/list.tsx @@ -338,8 +338,6 @@ const MenuDataviewObjectList = observer(class MenuDataviewObjectList extends Rea cellRef.clear(); }; - const objectTypes = Relation.getArrayValue(relation.objectTypes); - const cb = (id: string) => { if (!id) { return; @@ -359,31 +357,7 @@ const MenuDataviewObjectList = observer(class MenuDataviewObjectList extends Rea }; if (item.id == 'add') { - const details: any = { name: filter }; - const flags: I.ObjectFlag[] = [ I.ObjectFlag.SelectTemplate ]; - - let type = null; - - if (objectTypes.length) { - const allowedTypes = objectTypes.map(id => dbStore.getTypeById(id)).filter(it => { - return it && !UtilObject.isFileOrSystemLayout(it.recommendedLayout); - }); - const l = allowedTypes.length; - - if (l) { - type = allowedTypes[0]; - - if (l > 1) { - flags.push(I.ObjectFlag.SelectType); - }; - }; - }; - - if (type) { - details.type = type.id; - } else { - flags.push(I.ObjectFlag.SelectType); - }; + const { details, flags } = Relation.getParamForNewObject(filter, relation); UtilObject.create('', '', details, I.BlockPosition.Bottom, '', {}, flags, (message: any) => { cb(message.targetId); diff --git a/src/ts/lib/relation.ts b/src/ts/lib/relation.ts index f9a3c75414..cd9e13c95c 100644 --- a/src/ts/lib/relation.ts +++ b/src/ts/lib/relation.ts @@ -1,4 +1,4 @@ -import { I, UtilCommon, UtilFile, UtilDate, translate, Dataview } from 'Lib'; +import { I, UtilCommon, UtilFile, UtilDate, translate, Dataview, UtilObject } from 'Lib'; import { dbStore, detailStore } from 'Store'; import Constant from 'json/constant.json'; @@ -513,6 +513,35 @@ class Relation { return value; }; + getParamForNewObject (name: string, relation: any): { flags: I.ObjectFlag[], details: any } { + const details: any = { name }; + const flags: I.ObjectFlag[] = [ I.ObjectFlag.SelectTemplate ]; + const objectTypes = this.getArrayValue(relation.objectTypes); + + let type = null; + + if (objectTypes.length) { + const allowedTypes = objectTypes.map(id => dbStore.getTypeById(id)).filter(it => it && !UtilObject.isFileOrSystemLayout(it.recommendedLayout)); + const l = allowedTypes.length; + + if (l) { + type = allowedTypes[0]; + + if (l > 1) { + flags.push(I.ObjectFlag.SelectType); + }; + }; + }; + + if (type) { + details.type = type.id; + } else { + flags.push(I.ObjectFlag.SelectType); + }; + + return { flags, details } + }; + systemKeys () { return require('lib/json/generated/systemRelations.json'); }; From 48a1bc240afb192f9943b0baaef75285b159bbd5 Mon Sep 17 00:00:00 2001 From: Andrew Simachev Date: Thu, 2 Nov 2023 11:21:34 +0100 Subject: [PATCH 33/88] add shortcut + refactoring --- src/json/text.json | 3 +- src/ts/component/popup/shortcut.tsx | 437 +++++++++++++++------------- 2 files changed, 235 insertions(+), 205 deletions(-) diff --git a/src/json/text.json b/src/json/text.json index cbace2962b..185dbb0b0c 100644 --- a/src/json/text.json +++ b/src/json/text.json @@ -813,7 +813,7 @@ "popupShortcutMain": "Main", "popupShortcutNavigation": "Navigation", "popupShortcutMarkdown": "Markdown", - "popupShortcutCommands": "Commands", + "popupShortcutCommand": "Commands", "popupShortcutBasics": "Basics", "popupShortcutMainBasics1": "Create new Object", @@ -874,6 +874,7 @@ "popupShortcutNavigationBasics6": "Return to the home screen", "popupShortcutNavigationBasics7": "Show previous object from History", "popupShortcutNavigationBasics8": "Show next Object from History", + "popupShortcutNavigationBasics9": "Switch spaces", "popupShortcutNavigationMenu": "Menu, search and navigation pane", "popupShortcutNavigationMenu1": "Go the next option", "popupShortcutNavigationMenu2": "Go to the previous option", diff --git a/src/ts/component/popup/shortcut.tsx b/src/ts/component/popup/shortcut.tsx index 53897d6762..5b736839b0 100644 --- a/src/ts/component/popup/shortcut.tsx +++ b/src/ts/component/popup/shortcut.tsx @@ -7,6 +7,23 @@ interface State { page: string; }; +interface Section { + id?: string; + name: string; + children: { + name?: string; + description?: string; + className?: string; + children: Item[]; + }[]; +}; + +interface Item { + com?: string; + mac?: string; + name: string; +}; + class PopupShortcut extends React.Component { state = { @@ -17,22 +34,18 @@ class PopupShortcut extends React.Component { render () { const { page } = this.state; const isMac = UtilCommon.isPlatformMac(); - const tabs = [ - { id: 'main', name: translate('popupShortcutMain') }, - { id: 'navigation', name: translate('popupShortcutNavigation') }, - { id: 'markdown', name: translate('popupShortcutMarkdown') }, - { id: 'command', name: translate('popupShortcutCommands') }, - ]; - const sections = this.getSections(page); + const sections = this.getSections(); + const section = sections.find(it => it.id == page); const Tab = (item: any) => ( -
{ this.onPage(item.id); }}> +
this.onPage(item.id)}> {item.name}
); const Section = (item: any) => { const cn = [ 'section' ]; + if (item.className) { cn.push(item.className); }; @@ -41,6 +54,7 @@ class PopupShortcut extends React.Component {
{item.name ?
{item.name}
: ''} {item.description ?
{item.description}
: ''} +
{item.children.map((item: any, i: number) => ( @@ -63,14 +77,14 @@ class PopupShortcut extends React.Component {
- {tabs.map((item: any, i: number) => ( + {sections.map((item: any, i: number) => ( ))}
- {sections.map((item: any, i: number) => ( + {(section.children || []).map((item: any, i: number) => (
))}
@@ -102,217 +116,232 @@ class PopupShortcut extends React.Component { this.setState({ page: id }); }; - getSections (id: string) { + getSections (): Section[] { const cmd = keyboard.cmdSymbol(); const alt = keyboard.altSymbol(); - const sections = { + const sections = [ + { + id: 'main', + name: translate('popupShortcutMain'), + children: [ + { + name: translate('popupShortcutBasics'), children: [ + { com: `${cmd} + N`, name: translate('popupShortcutMainBasics1') }, + { com: `${cmd} + Shift + N`, name: translate('popupShortcutMainBasics2') }, + { com: `${cmd} + ${alt} + N`, name: translate('popupShortcutMainBasics3') }, + { com: `${cmd} + Enter`, name: translate('popupShortcutMainBasics4') }, + { com: `${cmd} + ${alt} + F`, name: translate('popupShortcutMainBasics5') }, + { com: `${cmd} + Z`, name: translate('popupShortcutMainBasics6') }, + { com: `${cmd} + Shift + Z`, name: translate('popupShortcutMainBasics7') }, + { com: `${cmd} + P`, name: translate('popupShortcutMainBasics8') }, + { com: `${cmd} + F`, name: translate('popupShortcutMainBasics9') }, + { com: `${cmd} + Q`, name: translate('popupShortcutMainBasics10') }, + { mac: `${cmd} + Y`, com: 'Ctrl + H', name: translate('popupShortcutMainBasics11') }, + { com: 'Shift + Click', name: translate('popupShortcutMainBasics12') }, + { com: `${cmd} + Click`, name: translate('popupShortcutMainBasics13') }, + { com: 'Ctrl + Space', name: translate('popupShortcutMainBasics14') }, + { com: `${cmd} + \\, ${cmd} + .`, name: translate('popupShortcutMainBasics15') }, + { com: `${cmd} + =`, name: translate('popupShortcutMainBasics16') }, + { com: `${cmd} + Minus`, name: translate('popupShortcutMainBasics17') }, + { com: `${cmd} + 0`, name: translate('popupShortcutMainBasics18') }, + ] + }, - main: [ - { - name: translate('popupShortcutBasics'), children: [ - { com: `${cmd} + N`, name: translate('popupShortcutMainBasics1') }, - { com: `${cmd} + Shift + N`, name: translate('popupShortcutMainBasics2') }, - { com: `${cmd} + ${alt} + N`, name: translate('popupShortcutMainBasics3') }, - { com: `${cmd} + Enter`, name: translate('popupShortcutMainBasics4') }, - { com: `${cmd} + ${alt} + F`, name: translate('popupShortcutMainBasics5') }, - { com: `${cmd} + Z`, name: translate('popupShortcutMainBasics6') }, - { com: `${cmd} + Shift + Z`, name: translate('popupShortcutMainBasics7') }, - { com: `${cmd} + P`, name: translate('popupShortcutMainBasics8') }, - { com: `${cmd} + F`, name: translate('popupShortcutMainBasics9') }, - { com: `${cmd} + Q`, name: translate('popupShortcutMainBasics10') }, - { mac: `${cmd} + Y`, com: 'Ctrl + H', name: translate('popupShortcutMainBasics11') }, - { com: 'Shift + Click', name: translate('popupShortcutMainBasics12') }, - { com: `${cmd} + Click`, name: translate('popupShortcutMainBasics13') }, - { com: 'Ctrl + Space', name: translate('popupShortcutMainBasics14') }, - { com: `${cmd} + \\, ${cmd} + .`, name: translate('popupShortcutMainBasics15') }, - { com: `${cmd} + =`, name: translate('popupShortcutMainBasics16') }, - { com: `${cmd} + Minus`, name: translate('popupShortcutMainBasics17') }, - { com: `${cmd} + 0`, name: translate('popupShortcutMainBasics18') }, - ] - }, + { + name: translate('popupShortcutMainStructuring'), children: [ + { com: 'Enter', name: translate('popupShortcutMainStructuring1') }, + { com: 'Shift + Enter', name: translate('popupShortcutMainStructuring2') }, + { com: 'Delete', name: translate('popupShortcutMainStructuring3') }, + { com: 'Tab', name: translate('popupShortcutMainStructuring4') }, + { com: 'Shift + Tab', name: translate('popupShortcutMainStructuring5') }, + ] + }, - { - name: translate('popupShortcutMainStructuring'), children: [ - { com: 'Enter', name: translate('popupShortcutMainStructuring1') }, - { com: 'Shift + Enter', name: translate('popupShortcutMainStructuring2') }, - { com: 'Delete', name: translate('popupShortcutMainStructuring3') }, - { com: 'Tab', name: translate('popupShortcutMainStructuring4') }, - { com: 'Shift + Tab', name: translate('popupShortcutMainStructuring5') }, - ] - }, + { + name: translate('popupShortcutMainSelection'), children: [ + { com: 'Double Click', name: translate('popupShortcutMainSelection1') }, + { com: 'Triple Click', name: translate('popupShortcutMainSelection2') }, + { com: `${cmd} + A`, name: translate('popupShortcutMainSelection3') }, + { com: 'Shift + ↑ or ↓', name: translate('popupShortcutMainSelection4') }, + { com: `${cmd} + Click`, name: translate('popupShortcutMainSelection5') }, + { com: 'Shift + Click', name: translate('popupShortcutMainSelection6') }, + ] + }, - { - name: translate('popupShortcutMainSelection'), children: [ - { com: 'Double Click', name: translate('popupShortcutMainSelection1') }, - { com: 'Triple Click', name: translate('popupShortcutMainSelection2') }, - { com: `${cmd} + A`, name: translate('popupShortcutMainSelection3') }, - { com: 'Shift + ↑ or ↓', name: translate('popupShortcutMainSelection4') }, - { com: `${cmd} + Click`, name: translate('popupShortcutMainSelection5') }, - { com: 'Shift + Click', name: translate('popupShortcutMainSelection6') }, - ] - }, + { + name: translate('popupShortcutMainActions'), children: [ + { com: '/', name: translate('popupShortcutMainActions1') }, + { com: `${cmd} + /`, name: translate('popupShortcutMainActions2') }, + { mac: `${cmd} + Delete`, com: 'Ctrl + Backspace', name: translate('popupShortcutMainActions3') }, + { com: `${cmd} + C`, name: translate('popupShortcutMainActions4') }, + { com: `${cmd} + X`, name: translate('popupShortcutMainActions5') }, + { com: `${cmd} + V`, name: translate('popupShortcutMainActions6') }, + { com: `${cmd} + D`, name: translate('popupShortcutMainActions7') }, + { com: `${cmd} + E`, name: translate('popupShortcutMainActions8') + ' 🏄‍♂' }, + ] + }, - { - name: translate('popupShortcutMainActions'), children: [ - { com: '/', name: translate('popupShortcutMainActions1') }, - { com: `${cmd} + /`, name: translate('popupShortcutMainActions2') }, - { mac: `${cmd} + Delete`, com: 'Ctrl + Backspace', name: translate('popupShortcutMainActions3') }, - { com: `${cmd} + C`, name: translate('popupShortcutMainActions4') }, - { com: `${cmd} + X`, name: translate('popupShortcutMainActions5') }, - { com: `${cmd} + V`, name: translate('popupShortcutMainActions6') }, - { com: `${cmd} + D`, name: translate('popupShortcutMainActions7') }, - { com: `${cmd} + E`, name: translate('popupShortcutMainActions8') + ' 🏄‍♂' }, - ] - }, + { + name: translate('popupShortcutMainTextStyle'), children: [ + { com: `${cmd} + B`, name: translate('popupShortcutMainTextStyle1') }, + { com: `${cmd} + I`, name: translate('popupShortcutMainTextStyle2') }, + { com: `${cmd} + U`, name: translate('popupShortcutMainTextStyle3') }, + { com: `${cmd} + Shift +S`, name: translate('popupShortcutMainTextStyle4') }, + { com: `${cmd} + K`, name: translate('popupShortcutMainTextStyle5') }, + { com: `${cmd} + L`, name: translate('popupShortcutMainTextStyle6') }, + { com: `${cmd} + Shift + C`, name: translate('popupShortcutMainTextStyle7') }, + { com: `${cmd} + Shift + H`, name: translate('popupShortcutMainTextStyle8') }, + ] + }, + ], + }, - { - name: translate('popupShortcutMainTextStyle'), children: [ - { com: `${cmd} + B`, name: translate('popupShortcutMainTextStyle1') }, - { com: `${cmd} + I`, name: translate('popupShortcutMainTextStyle2') }, - { com: `${cmd} + U`, name: translate('popupShortcutMainTextStyle3') }, - { com: `${cmd} + Shift +S`, name: translate('popupShortcutMainTextStyle4') }, - { com: `${cmd} + K`, name: translate('popupShortcutMainTextStyle5') }, - { com: `${cmd} + L`, name: translate('popupShortcutMainTextStyle6') }, - { com: `${cmd} + Shift + C`, name: translate('popupShortcutMainTextStyle7') }, - { com: `${cmd} + Shift + H`, name: translate('popupShortcutMainTextStyle8') }, - ] - }, - ], + { + id: 'navigation', + name: translate('popupShortcutNavigation'), + children: [ + { + name: translate('popupShortcutBasics'), children: [ + { com: `${cmd} + ,(comma)`, name: translate('popupShortcutNavigationBasics1') }, + { com: `${cmd} + O`, name: translate('popupShortcutNavigationBasics2') }, + { com: `${cmd} + ${alt} + O`, name: translate('popupShortcutNavigationBasics3') }, + { com: `${cmd} + S, ${cmd} + K`, name: translate('popupShortcutNavigationBasics4') }, + { com: `${cmd} + L`, name: translate('popupShortcutNavigationBasics5') }, + { com: `${alt} + H`, name: translate('popupShortcutNavigationBasics6') }, + { mac: `${cmd} + [, ${cmd} + ←`, com: 'Alt + ←', name: translate('popupShortcutNavigationBasics7') }, + { mac: `${cmd} + ], ${cmd} + →`, com: 'Alt + →', name: translate('popupShortcutNavigationBasics8') }, + { com: 'Ctrl + Tab', name: translate('popupShortcutNavigationBasics9') }, + ] + }, - navigation: [ - { - name: translate('popupShortcutBasics'), children: [ - { com: `${cmd} + ,(comma)`, name: translate('popupShortcutNavigationBasics1') }, - { com: `${cmd} + O`, name: translate('popupShortcutNavigationBasics2') }, - { com: `${cmd} + ${alt} + O`, name: translate('popupShortcutNavigationBasics3') }, - { com: `${cmd} + S, ${cmd} + K`, name: translate('popupShortcutNavigationBasics4') }, - { com: `${cmd} + L`, name: translate('popupShortcutNavigationBasics5') }, - { com: `${alt} + H`, name: translate('popupShortcutNavigationBasics6') }, - { mac: `${cmd} + [, ${cmd} + ←`, com: 'Alt + ←', name: translate('popupShortcutNavigationBasics7') }, - { mac: `${cmd} + ], ${cmd} + →`, com: 'Alt + →', name: translate('popupShortcutNavigationBasics8') }, - ] - }, + { + name: translate('popupShortcutNavigationMenu'), children: [ + { com: '↓ or Tab', name: translate('popupShortcutNavigationMenu1') }, + { com: '↑ or Shift + Tab', name: translate('popupShortcutNavigationMenu2') }, + { com: '←', name: translate('popupShortcutNavigationMenu3') }, + { com: '→', name: translate('popupShortcutNavigationMenu4') }, + { com: 'Enter', name: translate('popupShortcutNavigationMenu5') }, + ] + }, - { - name: translate('popupShortcutNavigationMenu'), children: [ - { com: '↓ or Tab', name: translate('popupShortcutNavigationMenu1') }, - { com: '↑ or Shift + Tab', name: translate('popupShortcutNavigationMenu2') }, - { com: '←', name: translate('popupShortcutNavigationMenu3') }, - { com: '→', name: translate('popupShortcutNavigationMenu4') }, - { com: 'Enter', name: translate('popupShortcutNavigationMenu5') }, - ] - }, + { + name: translate('popupShortcutNavigationPage'), children: [ + { com: `${cmd} + Shift + T`, name: translate('popupShortcutNavigationPage1') }, + { com: '↓', name: translate('popupShortcutNavigationPage2') }, + { com: '↑', name: translate('popupShortcutNavigationPage3') }, + { com: `${cmd} + ←`, name: translate('popupShortcutNavigationPage4') }, + { com: `${cmd} + →`, name: translate('popupShortcutNavigationPage5') }, + { com: `${cmd} + ↑`, name: translate('popupShortcutNavigationPage6') }, + { com: `${cmd} + ↓`, name: translate('popupShortcutNavigationPage7') }, + { com: `${cmd} + Shift + ↑↓`, name: translate('popupShortcutNavigationPage8') }, + { com: `${cmd} + Shift + R`, name: translate('popupShortcutNavigationPage9') }, + ] + }, + ], + }, - { - name: translate('popupShortcutNavigationPage'), children: [ - { com: `${cmd} + Shift + T`, name: translate('popupShortcutNavigationPage1') }, - { com: '↓', name: translate('popupShortcutNavigationPage2') }, - { com: '↑', name: translate('popupShortcutNavigationPage3') }, - { com: `${cmd} + ←`, name: translate('popupShortcutNavigationPage4') }, - { com: `${cmd} + →`, name: translate('popupShortcutNavigationPage5') }, - { com: `${cmd} + ↑`, name: translate('popupShortcutNavigationPage6') }, - { com: `${cmd} + ↓`, name: translate('popupShortcutNavigationPage7') }, - { com: `${cmd} + Shift + ↑↓`, name: translate('popupShortcutNavigationPage8') }, - { com: `${cmd} + Shift + R`, name: translate('popupShortcutNavigationPage9') }, - ] - }, - ], + { + id: 'markdown', + name: translate('popupShortcutMarkdown'), + children: [ + { + name: translate('popupShortcutMarkdownWhileTyping'), + children: [ + { com: '`', name: translate('popupShortcutMarkdownWhileTyping1') }, + { com: '** or __', name: translate('popupShortcutMarkdownWhileTyping2') }, + { com: '* or _', name: translate('popupShortcutMarkdownWhileTyping3') }, + { com: '~~', name: translate('popupShortcutMarkdownWhileTyping4') }, + { com: '-->', name: UtilCommon.sprintf(translate('popupShortcutMarkdownWhileTypingInserts'), '⟶') }, + { com: '<--', name: UtilCommon.sprintf(translate('popupShortcutMarkdownWhileTypingInserts'), '⟵') }, + { com: '<-->', name: UtilCommon.sprintf(translate('popupShortcutMarkdownWhileTypingInserts'), '⟷') }, + { com: '->', name: UtilCommon.sprintf(translate('popupShortcutMarkdownWhileTypingInserts'), '→') }, + { com: '<-', name: UtilCommon.sprintf(translate('popupShortcutMarkdownWhileTypingInserts'), '←') }, + { com: '--', name: UtilCommon.sprintf(translate('popupShortcutMarkdownWhileTypingInserts'), '—') }, + { com: '—>', name: UtilCommon.sprintf(translate('popupShortcutMarkdownWhileTypingInserts'), '⟶') }, + { com: '<—', name: UtilCommon.sprintf(translate('popupShortcutMarkdownWhileTypingInserts'), '⟵') }, + { com: '(c)', name: UtilCommon.sprintf(translate('popupShortcutMarkdownWhileTypingInserts'), '©') }, + { com: '(r)', name: UtilCommon.sprintf(translate('popupShortcutMarkdownWhileTypingInserts'), '®') }, + { com: '(tm)', name: UtilCommon.sprintf(translate('popupShortcutMarkdownWhileTypingInserts'), '™') }, + { com: '...', name: UtilCommon.sprintf(translate('popupShortcutMarkdownWhileTypingInserts'), '…') }, + ] + }, + { + name: translate('popupShortcutMarkdownBeginningOfLine'), + children: [ + { com: '# + Space', name: translate('popupShortcutMarkdownBeginningOfLine1') }, + { com: '# # + Space', name: translate('popupShortcutMarkdownBeginningOfLine2') }, + { com: '# # # + Space', name: translate('popupShortcutMarkdownBeginningOfLine3') }, + { com: '" + Space', name: translate('popupShortcutMarkdownBeginningOfLine4') }, + { com: '* or + or - and Space', name: translate('popupShortcutMarkdownBeginningOfLine5') }, + { com: '[] + Space', name: translate('popupShortcutMarkdownBeginningOfLine6') }, + { com: '1. + Space', name: translate('popupShortcutMarkdownBeginningOfLine7') }, + { com: '> + Space', name: translate('popupShortcutMarkdownBeginningOfLine8') }, + { com: '```', name: translate('popupShortcutMarkdownBeginningOfLine9') }, + { com: '---', name: translate('popupShortcutMarkdownBeginningOfLine10') }, + { com: '***', name: translate('popupShortcutMarkdownBeginningOfLine11') }, + ] + }, + ], + }, - markdown: [ - { - name: translate('popupShortcutMarkdownWhileTyping'), - children: [ - { com: '`', name: translate('popupShortcutMarkdownWhileTyping1') }, - { com: '** or __', name: translate('popupShortcutMarkdownWhileTyping2') }, - { com: '* or _', name: translate('popupShortcutMarkdownWhileTyping3') }, - { com: '~~', name: translate('popupShortcutMarkdownWhileTyping4') }, - { com: '-->', name: UtilCommon.sprintf(translate('popupShortcutMarkdownWhileTypingInserts'), '⟶') }, - { com: '<--', name: UtilCommon.sprintf(translate('popupShortcutMarkdownWhileTypingInserts'), '⟵') }, - { com: '<-->', name: UtilCommon.sprintf(translate('popupShortcutMarkdownWhileTypingInserts'), '⟷') }, - { com: '->', name: UtilCommon.sprintf(translate('popupShortcutMarkdownWhileTypingInserts'), '→') }, - { com: '<-', name: UtilCommon.sprintf(translate('popupShortcutMarkdownWhileTypingInserts'), '←') }, - { com: '--', name: UtilCommon.sprintf(translate('popupShortcutMarkdownWhileTypingInserts'), '—') }, - { com: '—>', name: UtilCommon.sprintf(translate('popupShortcutMarkdownWhileTypingInserts'), '⟶') }, - { com: '<—', name: UtilCommon.sprintf(translate('popupShortcutMarkdownWhileTypingInserts'), '⟵') }, - { com: '(c)', name: UtilCommon.sprintf(translate('popupShortcutMarkdownWhileTypingInserts'), '©') }, - { com: '(r)', name: UtilCommon.sprintf(translate('popupShortcutMarkdownWhileTypingInserts'), '®') }, - { com: '(tm)', name: UtilCommon.sprintf(translate('popupShortcutMarkdownWhileTypingInserts'), '™') }, - { com: '...', name: UtilCommon.sprintf(translate('popupShortcutMarkdownWhileTypingInserts'), '…') }, - ] - }, - { - name: translate('popupShortcutMarkdownBeginningOfLine'), - children: [ - { com: '# + Space', name: translate('popupShortcutMarkdownBeginningOfLine1') }, - { com: '# # + Space', name: translate('popupShortcutMarkdownBeginningOfLine2') }, - { com: '# # # + Space', name: translate('popupShortcutMarkdownBeginningOfLine3') }, - { com: '" + Space', name: translate('popupShortcutMarkdownBeginningOfLine4') }, - { com: '* or + or - and Space', name: translate('popupShortcutMarkdownBeginningOfLine5') }, - { com: '[] + Space', name: translate('popupShortcutMarkdownBeginningOfLine6') }, - { com: '1. + Space', name: translate('popupShortcutMarkdownBeginningOfLine7') }, - { com: '> + Space', name: translate('popupShortcutMarkdownBeginningOfLine8') }, - { com: '```', name: translate('popupShortcutMarkdownBeginningOfLine9') }, - { com: '---', name: translate('popupShortcutMarkdownBeginningOfLine10') }, - { com: '***', name: translate('popupShortcutMarkdownBeginningOfLine11') }, - ] - }, - ], + { + id: 'command', + name: translate('popupShortcutCommand'), + children: [ + { + name: translate('popupShortcutCommandMenu'), children: [ + { com: '/', name: translate('popupShortcutCommandMenu1') }, + { com: '↓ & ↑', name: translate('popupShortcutCommandMenu2') }, + { com: '→ & ←', name: translate('popupShortcutCommandMenu3') }, + { com: 'Esc or Clear /', name: translate('popupShortcutCommandMenu4') }, + ] + }, - command: [ - { - name: translate('popupShortcutCommandMenu'), children: [ - { com: '/', name: translate('popupShortcutCommandMenu1') }, - { com: '↓ & ↑', name: translate('popupShortcutCommandMenu2') }, - { com: '→ & ←', name: translate('popupShortcutCommandMenu3') }, - { com: 'Esc or Clear /', name: translate('popupShortcutCommandMenu4') }, - ] - }, + { description: translate('popupShortcutCommandDescription'), children: [], className: 'separator' }, + { + name: translate('popupShortcutCommandText'), children: [ + { com: '/text', name: translate('popupShortcutCommandText1') }, + { com: '/h1', name: translate('popupShortcutCommandText2') }, + { com: '/h2', name: translate('popupShortcutCommandText3') }, + { com: '/h3', name: translate('popupShortcutCommandText4') }, + { com: '/high', name: translate('popupShortcutCommandText5') }, + ] + }, - { description: translate('popupShortcutCommandDescription'), children: [], className: 'separator' }, - { - name: translate('popupShortcutCommandText'), children: [ - { com: '/text', name: translate('popupShortcutCommandText1') }, - { com: '/h1', name: translate('popupShortcutCommandText2') }, - { com: '/h2', name: translate('popupShortcutCommandText3') }, - { com: '/h3', name: translate('popupShortcutCommandText4') }, - { com: '/high', name: translate('popupShortcutCommandText5') }, - ] - }, + { + name: translate('popupShortcutCommandLists'), children: [ + { com: '/todo', name: translate('popupShortcutCommandLists1') }, + { com: '/bullet', name: translate('popupShortcutCommandLists2') }, + { com: '/num', name: translate('popupShortcutCommandLists3') }, + { com: '/toggle', name: translate('popupShortcutCommandLists4') }, + ] + }, - { - name: translate('popupShortcutCommandLists'), children: [ - { com: '/todo', name: translate('popupShortcutCommandLists1') }, - { com: '/bullet', name: translate('popupShortcutCommandLists2') }, - { com: '/num', name: translate('popupShortcutCommandLists3') }, - { com: '/toggle', name: translate('popupShortcutCommandLists4') }, - ] - }, + { + name: translate('popupShortcutCommandObjects'), children: [ + { com: '@today, @tomorrow', name: translate('popupShortcutCommandObjects1') }, + { com: '/page', name: translate('popupShortcutCommandObjects2') }, + { com: '/file', name: translate('popupShortcutCommandObjects3') }, + { com: '/image', name: translate('popupShortcutCommandObjects4') }, + { com: '/video', name: translate('popupShortcutCommandObjects5') }, + { com: '/bookmark', name: translate('popupShortcutCommandObjects6') }, + { com: '/link', name: translate('popupShortcutCommandObjects7') }, + ] + }, - { - name: translate('popupShortcutCommandObjects'), children: [ - { com: '@today, @tomorrow', name: translate('popupShortcutCommandObjects1') }, - { com: '/page', name: translate('popupShortcutCommandObjects2') }, - { com: '/file', name: translate('popupShortcutCommandObjects3') }, - { com: '/image', name: translate('popupShortcutCommandObjects4') }, - { com: '/video', name: translate('popupShortcutCommandObjects5') }, - { com: '/bookmark', name: translate('popupShortcutCommandObjects6') }, - { com: '/link', name: translate('popupShortcutCommandObjects7') }, - ] - }, + { + name: translate('popupShortcutCommandOther'), children: [ + { com: '/line', name: translate('popupShortcutCommandOther1') }, + { com: '/dots', name: translate('popupShortcutCommandOther2') }, + { com: '/code', name: translate('popupShortcutCommandOther3') }, + ] + }, + ], + }, + ]; - { - name: translate('popupShortcutCommandOther'), children: [ - { com: '/line', name: translate('popupShortcutCommandOther1') }, - { com: '/dots', name: translate('popupShortcutCommandOther2') }, - { com: '/code', name: translate('popupShortcutCommandOther3') }, - ] - }, - ] - - }; - - return sections[id] || []; + return sections; }; resize () { From 5e82141f7c34c14e02452f6ed2893165f17069a4 Mon Sep 17 00:00:00 2001 From: Andrew Simachev Date: Thu, 2 Nov 2023 11:24:39 +0100 Subject: [PATCH 34/88] fix file size units --- src/ts/lib/util/file.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ts/lib/util/file.ts b/src/ts/lib/util/file.ts index b812b0bd46..282cbb0633 100644 --- a/src/ts/lib/util/file.ts +++ b/src/ts/lib/util/file.ts @@ -2,7 +2,7 @@ import loadImage from 'blueimp-load-image'; import { UtilCommon } from 'Lib'; import Constant from 'json/constant.json'; -const SIZE_UNIT = 1000; +const SIZE_UNIT = 1024; const UNITS = { 1: 'B', 2: 'KB', From a7281a924a72064dbd75a397766ccc0f1f1c2efd Mon Sep 17 00:00:00 2001 From: Andrew Simachev Date: Thu, 2 Nov 2023 16:07:16 +0100 Subject: [PATCH 35/88] bump middleware version --- middleware.version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/middleware.version b/middleware.version index 6b0ed1aeeb..26ed3c0698 100644 --- a/middleware.version +++ b/middleware.version @@ -1 +1 @@ -0.29.4 \ No newline at end of file +0.29.5 \ No newline at end of file From 409f6d1cef41c6e9612afbdd9ccc2160d36f694c Mon Sep 17 00:00:00 2001 From: Andrew Simachev Date: Thu, 2 Nov 2023 16:42:04 +0100 Subject: [PATCH 36/88] 0.35.11-beta --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 717d31b126..7c45348862 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "anytype", - "version": "0.35.10-alpha", + "version": "0.35.11-beta", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "anytype", - "version": "0.35.10-alpha", + "version": "0.35.11-beta", "hasInstallScript": true, "license": "SEE LICENSE IN LICENSE.md", "dependencies": { diff --git a/package.json b/package.json index 96633ee8c0..82d02d3747 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "anytype", - "version": "0.35.10-alpha", + "version": "0.35.11-beta", "description": "Anytype", "main": "electron.js", "scripts": { From 6a7e31bad5db960ad4a39eeb92559288b90ea036 Mon Sep 17 00:00:00 2001 From: Andrew Simachev Date: Thu, 2 Nov 2023 17:04:42 +0100 Subject: [PATCH 37/88] fix notarization --- electron/hook/aftersign.js | 2 +- package-lock.json | 89 +++++++++++++++----------------------- package.json | 4 +- 3 files changed, 37 insertions(+), 58 deletions(-) diff --git a/electron/hook/aftersign.js b/electron/hook/aftersign.js index ce42cc6575..69b20525a4 100644 --- a/electron/hook/aftersign.js +++ b/electron/hook/aftersign.js @@ -1,4 +1,4 @@ -const { notarize } = require('electron-notarize'); +import { notarize } from '@electron/notarize'; require('dotenv').config(); diff --git a/package-lock.json b/package-lock.json index 7c45348862..ced1c2e7fb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -62,6 +62,7 @@ "sha1": "^1.1.1" }, "devDependencies": { + "@electron/notarize": "^2.1.0", "@types/history": "^4.7.8", "@types/jquery": "^3.5.14", "@types/katex": "^0.14.0", @@ -78,7 +79,6 @@ "css-loader": "^3.6.0", "electron": "^25.0.0", "electron-builder": "^24.6.3", - "electron-notarize": "^1.2.2", "eslint": "^8.29.0", "eslint-plugin-react": "^7.31.11", "husky": "^8.0.3", @@ -231,13 +231,14 @@ } }, "node_modules/@electron/notarize": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@electron/notarize/-/notarize-1.2.4.tgz", - "integrity": "sha512-W5GQhJEosFNafewnS28d3bpQ37/s91CDWqxVchHfmv2dQSTWpOzNlUVQwYzC1ay5bChRV/A9BTL68yj0Pa+TSg==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@electron/notarize/-/notarize-2.1.0.tgz", + "integrity": "sha512-Q02xem1D0sg4v437xHgmBLxI2iz/fc0D4K7fiVWHa/AnW8o7D751xyKNXgziA6HrTOme9ul1JfWN5ark8WH1xA==", "dev": true, "dependencies": { "debug": "^4.1.1", - "fs-extra": "^9.0.1" + "fs-extra": "^9.0.1", + "promise-retry": "^2.0.1" }, "engines": { "node": ">= 10.0.0" @@ -1893,6 +1894,34 @@ "node": ">=14.0.0" } }, + "node_modules/app-builder-lib/node_modules/@electron/notarize": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@electron/notarize/-/notarize-1.2.4.tgz", + "integrity": "sha512-W5GQhJEosFNafewnS28d3bpQ37/s91CDWqxVchHfmv2dQSTWpOzNlUVQwYzC1ay5bChRV/A9BTL68yj0Pa+TSg==", + "dev": true, + "dependencies": { + "debug": "^4.1.1", + "fs-extra": "^9.0.1" + }, + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/app-builder-lib/node_modules/@electron/notarize/node_modules/fs-extra": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", + "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", + "dev": true, + "dependencies": { + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/app-builder-lib/node_modules/brace-expansion": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", @@ -4199,56 +4228,6 @@ "version": "3.0.9", "license": "MIT" }, - "node_modules/electron-notarize": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/electron-notarize/-/electron-notarize-1.2.2.tgz", - "integrity": "sha512-ZStVWYcWI7g87/PgjPJSIIhwQXOaw4/XeXU+pWqMMktSLHaGMLHdyPPN7Cmao7+Cr7fYufA16npdtMndYciHNw==", - "deprecated": "Please use @electron/notarize moving forward. There is no API change, just a package name change", - "dev": true, - "dependencies": { - "debug": "^4.1.1", - "fs-extra": "^9.0.1" - }, - "engines": { - "node": ">= 10.0.0" - } - }, - "node_modules/electron-notarize/node_modules/fs-extra": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", - "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", - "dev": true, - "dependencies": { - "at-least-node": "^1.0.0", - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/electron-notarize/node_modules/jsonfile": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", - "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", - "dev": true, - "dependencies": { - "universalify": "^2.0.0" - }, - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, - "node_modules/electron-notarize/node_modules/universalify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", - "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", - "dev": true, - "engines": { - "node": ">= 10.0.0" - } - }, "node_modules/electron-publish": { "version": "24.5.0", "resolved": "https://registry.npmjs.org/electron-publish/-/electron-publish-24.5.0.tgz", diff --git a/package.json b/package.json index 82d02d3747..b04de59180 100644 --- a/package.json +++ b/package.json @@ -44,6 +44,7 @@ }, "homepage": "https://anytype.io", "devDependencies": { + "@electron/notarize": "^2.1.0", "@types/history": "^4.7.8", "@types/jquery": "^3.5.14", "@types/katex": "^0.14.0", @@ -60,7 +61,6 @@ "css-loader": "^3.6.0", "electron": "^25.0.0", "electron-builder": "^24.6.3", - "electron-notarize": "^1.2.2", "eslint": "^8.29.0", "eslint-plugin-react": "^7.31.11", "husky": "^8.0.3", @@ -562,4 +562,4 @@ "pre-commit": "npm run precommit && git add licenses.json" } } -} +} \ No newline at end of file From 363f5ff130cbc180b8ea1cccbbb2b9889f549dd8 Mon Sep 17 00:00:00 2001 From: Andrew Simachev Date: Thu, 2 Nov 2023 17:05:11 +0100 Subject: [PATCH 38/88] 0.35.12-alpha --- package-lock.json | 4 ++-- package.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index ced1c2e7fb..faa80f3e0d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "anytype", - "version": "0.35.11-beta", + "version": "0.35.12-alpha", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "anytype", - "version": "0.35.11-beta", + "version": "0.35.12-alpha", "hasInstallScript": true, "license": "SEE LICENSE IN LICENSE.md", "dependencies": { diff --git a/package.json b/package.json index b04de59180..1987a4b50a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "anytype", - "version": "0.35.11-beta", + "version": "0.35.12-alpha", "description": "Anytype", "main": "electron.js", "scripts": { @@ -562,4 +562,4 @@ "pre-commit": "npm run precommit && git add licenses.json" } } -} \ No newline at end of file +} From c0b107f7811fedadabcab7298d23ff059171f03f Mon Sep 17 00:00:00 2001 From: Andrew Simachev Date: Thu, 2 Nov 2023 17:12:06 +0100 Subject: [PATCH 39/88] fix notarization --- electron/hook/aftersign.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/electron/hook/aftersign.js b/electron/hook/aftersign.js index 69b20525a4..739a40c74a 100644 --- a/electron/hook/aftersign.js +++ b/electron/hook/aftersign.js @@ -1,4 +1,4 @@ -import { notarize } from '@electron/notarize'; +const { notarize } = require('@electron/notarize'); require('dotenv').config(); From cff83274605937582bf1a17d1f190528fb055dfa Mon Sep 17 00:00:00 2001 From: Andrew Simachev Date: Thu, 2 Nov 2023 17:12:34 +0100 Subject: [PATCH 40/88] 0.35.13-alpha --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index faa80f3e0d..af92a3a97d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "anytype", - "version": "0.35.12-alpha", + "version": "0.35.13-alpha", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "anytype", - "version": "0.35.12-alpha", + "version": "0.35.13-alpha", "hasInstallScript": true, "license": "SEE LICENSE IN LICENSE.md", "dependencies": { diff --git a/package.json b/package.json index 1987a4b50a..a541a34182 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "anytype", - "version": "0.35.12-alpha", + "version": "0.35.13-alpha", "description": "Anytype", "main": "electron.js", "scripts": { From 2638abd7f94a80579f84816736cd33a9c9d1fe30 Mon Sep 17 00:00:00 2001 From: Andrew Simachev Date: Thu, 2 Nov 2023 17:21:23 +0100 Subject: [PATCH 41/88] fix notarization --- electron/hook/aftersign.js | 1 + 1 file changed, 1 insertion(+) diff --git a/electron/hook/aftersign.js b/electron/hook/aftersign.js index 739a40c74a..48275f22cd 100644 --- a/electron/hook/aftersign.js +++ b/electron/hook/aftersign.js @@ -18,6 +18,7 @@ exports.default = async function notarizing (context) { appleId: process.env.APPLEID, appleIdPassword: process.env.APPLEIDPASS, ascProvider: process.env.APPLETEAM, + teamId: process.env.APPLETEAM, }); }; From db2ec06cf6f88e9e5736a5938bb7a154fcb25967 Mon Sep 17 00:00:00 2001 From: Andrew Simachev Date: Thu, 2 Nov 2023 17:21:40 +0100 Subject: [PATCH 42/88] 0.35.14-alpha --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index af92a3a97d..f4e6f0773e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "anytype", - "version": "0.35.13-alpha", + "version": "0.35.14-alpha", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "anytype", - "version": "0.35.13-alpha", + "version": "0.35.14-alpha", "hasInstallScript": true, "license": "SEE LICENSE IN LICENSE.md", "dependencies": { diff --git a/package.json b/package.json index a541a34182..08d623382e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "anytype", - "version": "0.35.13-alpha", + "version": "0.35.14-alpha", "description": "Anytype", "main": "electron.js", "scripts": { From 83e028685bd527edb6e90ae6dd83008456e42615 Mon Sep 17 00:00:00 2001 From: Andrew Simachev Date: Thu, 2 Nov 2023 17:39:09 +0100 Subject: [PATCH 43/88] bump middleware version --- middleware.version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/middleware.version b/middleware.version index 26ed3c0698..9c2255d5e8 100644 --- a/middleware.version +++ b/middleware.version @@ -1 +1 @@ -0.29.5 \ No newline at end of file +0.29.6 \ No newline at end of file From fcabaa65496638aa35783af264d6e6a32f5d137c Mon Sep 17 00:00:00 2001 From: Andrew Simachev Date: Thu, 2 Nov 2023 17:49:40 +0100 Subject: [PATCH 44/88] debug notarize --- .github/workflows/build.yml | 8 +++++--- electron/hook/aftersign.js | 5 +++-- package.json | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c2803f110b..5918f833c7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,9 +1,11 @@ name: Release +#on: +# push: +# tags: +# - v* on: - push: - tags: - - v* + push jobs: release: diff --git a/electron/hook/aftersign.js b/electron/hook/aftersign.js index 48275f22cd..70f849d8ca 100644 --- a/electron/hook/aftersign.js +++ b/electron/hook/aftersign.js @@ -13,12 +13,13 @@ exports.default = async function notarizing (context) { const appName = context.packager.appInfo.productFilename; return await notarize({ - appBundleId: 'com.anytype.anytype', + tool: 'notarytool', appPath: `${appOutDir}/${appName}.app`, appleId: process.env.APPLEID, appleIdPassword: process.env.APPLEIDPASS, - ascProvider: process.env.APPLETEAM, teamId: process.env.APPLETEAM, + //appBundleId: 'com.anytype.anytype', + //ascProvider: process.env.APPLETEAM, }); }; diff --git a/package.json b/package.json index 08d623382e..4247a99aa0 100644 --- a/package.json +++ b/package.json @@ -562,4 +562,4 @@ "pre-commit": "npm run precommit && git add licenses.json" } } -} +} \ No newline at end of file From 49f0be6c51bc9cbe5880a841f037275d9abd9d8d Mon Sep 17 00:00:00 2001 From: Andrew Simachev Date: Thu, 2 Nov 2023 18:06:45 +0100 Subject: [PATCH 45/88] remove debug --- .github/workflows/build.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5918f833c7..c2803f110b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,11 +1,9 @@ name: Release -#on: -# push: -# tags: -# - v* on: - push + push: + tags: + - v* jobs: release: From 404e0f438d5aa9b50f78f26196b473a6ae49a32a Mon Sep 17 00:00:00 2001 From: Andrew Simachev Date: Thu, 2 Nov 2023 18:07:16 +0100 Subject: [PATCH 46/88] 0.35.15-beta --- package-lock.json | 4 ++-- package.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index f4e6f0773e..646242ebbf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "anytype", - "version": "0.35.14-alpha", + "version": "0.35.15-beta", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "anytype", - "version": "0.35.14-alpha", + "version": "0.35.15-beta", "hasInstallScript": true, "license": "SEE LICENSE IN LICENSE.md", "dependencies": { diff --git a/package.json b/package.json index 4247a99aa0..ebd2051b9b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "anytype", - "version": "0.35.14-alpha", + "version": "0.35.15-beta", "description": "Anytype", "main": "electron.js", "scripts": { @@ -562,4 +562,4 @@ "pre-commit": "npm run precommit && git add licenses.json" } } -} \ No newline at end of file +} From 5a4b64c38385919f80a4d33ba8cbbc4cb04d0f80 Mon Sep 17 00:00:00 2001 From: Andrew Simachev Date: Thu, 2 Nov 2023 20:06:24 +0100 Subject: [PATCH 47/88] JS-3286: fix --- src/json/text.json | 3 +++ src/ts/component/block/dataview.tsx | 12 +++++------- src/ts/docs/help/onboarding.ts | 23 ++++++++++++++++++++++- src/ts/lib/onboarding.ts | 16 +++++++++------- 4 files changed, 39 insertions(+), 15 deletions(-) diff --git a/src/json/text.json b/src/json/text.json index 185dbb0b0c..9b451b6904 100644 --- a/src/json/text.json +++ b/src/json/text.json @@ -1508,6 +1508,9 @@ "onboardingInlineCollection2Title": "Views", "onboardingInlineCollection2Description": "Adjust rules and views to suit the current context.", + "onboardingDefaultTypeTitle": "Change Types Easily", + "onboardingDefaultTypeDescription": "You can change type and template of a new object in this menu.", + "libDataviewRelations": "Relations", "libDataviewGroups": "Groups", "libDataviewView": "View", diff --git a/src/ts/component/block/dataview.tsx b/src/ts/component/block/dataview.tsx index 64afe96da1..ed43a3d1c0 100644 --- a/src/ts/component/block/dataview.tsx +++ b/src/ts/component/block/dataview.tsx @@ -237,21 +237,19 @@ const BlockDataview = observer(class BlockDataview extends React.Component ({ @@ -53,6 +53,9 @@ export default { buttonText: translate('onboardingMainSet3Button'), } ], + onComplete: (force: boolean) => { + Onboarding.start('changeDefaultTypeInSet', keyboard.isPopup(), force); + }, param: { element: '#page.isFull #footer #button-help', classNameWrap: 'fixed', @@ -353,4 +356,22 @@ export default { ], }), + changeDefaultTypeInSet: () => ( + { + items: [ + { + name: translate('onboardingDefaultTypeTitle'), + description: translate('onboardingDefaultTypeDescription'), + }, + ], + + param: { + element: '#button-dataview-add-record-select', + horizontal: I.MenuDirection.Right, + offsetX: -4, + offsetY: 12, + }, + } + ), + }; diff --git a/src/ts/lib/onboarding.ts b/src/ts/lib/onboarding.ts index f2753e6b30..ffb6bfe19a 100644 --- a/src/ts/lib/onboarding.ts +++ b/src/ts/lib/onboarding.ts @@ -34,9 +34,11 @@ class Onboarding { noFlipY: true, noFlipX: true, onClose: () => { - this.start(this.getReminderKey(key), isPopup, force); - - Storage.setOnboarding(key); + Storage.setOnboarding(key); + + if (section.onComplete) { + section.onComplete(force); + }; }, data: { ...param.data, @@ -50,10 +52,6 @@ class Onboarding { }); }; - getReminderKey (key: string) { - return UtilCommon.toCamelCase([ key, 'reminder' ].join('-')); - }; - getParam (section: any, item: any, isPopup: boolean, force?: boolean): any { section.param = section.param || {}; item.param = item.param || {}; @@ -139,6 +137,10 @@ class Onboarding { return param; }; + + isCompleted (key: string): boolean { + return Storage.getOnboarding(key); + }; }; From 811804da2f4e6cc0b8d6719ea275bf7020efd793 Mon Sep 17 00:00:00 2001 From: Mike Mhlv Date: Thu, 2 Nov 2023 19:20:44 +0000 Subject: [PATCH 48/88] JS-3288: default type in space settings --- src/json/text.json | 1 + src/scss/popup/settings.scss | 3 +- .../popup/page/settings/personal.tsx | 36 +--------------- .../popup/page/settings/space/index.tsx | 41 ++++++++++++++++++- 4 files changed, 45 insertions(+), 36 deletions(-) diff --git a/src/json/text.json b/src/json/text.json index 185dbb0b0c..864d2341eb 100644 --- a/src/json/text.json +++ b/src/json/text.json @@ -582,6 +582,7 @@ "popupSettingsPersonalTitle": "Preferences", "popupSettingsPersonalDefaultObjectType": "Default Object Type", + "popupSettingsPersonalDefaultObjectTypeDescription": "Set the default type for newly created objects", "popupSettingsPersonalDefaultObjectTypeSelect": "Select", "popupSettingsPersonalSpellcheckLanguage": "Spellcheck Languages", "popupSettingsPersonalInterfaceLanguage": "Interface Language", diff --git a/src/scss/popup/settings.scss b/src/scss/popup/settings.scss index 3145eb608c..d548f69b2e 100644 --- a/src/scss/popup/settings.scss +++ b/src/scss/popup/settings.scss @@ -244,6 +244,7 @@ > .item { .sides { display: flex; justify-content: space-between; gap: 0px 16px; } + .sides:not(.alignTop) { align-items: center; } .sides { .side { width: unset; background: unset; padding: unset; } .side.left { flex-grow: 1; } @@ -603,4 +604,4 @@ .popupSettings.isSpaceCreate { .innerWrap { width: 684px; height: 406px; } } -} \ No newline at end of file +} diff --git a/src/ts/component/popup/page/settings/personal.tsx b/src/ts/component/popup/page/settings/personal.tsx index 37e74e8c0d..b7714ccf00 100644 --- a/src/ts/component/popup/page/settings/personal.tsx +++ b/src/ts/component/popup/page/settings/personal.tsx @@ -1,22 +1,19 @@ import * as React from 'react'; import { observer } from 'mobx-react'; import { Icon, Title, Label, Select, Switch } from 'Component'; -import { I, translate, analytics, UtilObject, UtilCommon, Action, Renderer } from 'Lib'; -import { commonStore, menuStore, dbStore } from 'Store'; +import { I, translate, UtilCommon, Action, Renderer } from 'Lib'; +import { commonStore } from 'Store'; import Constant from 'json/constant.json'; const PopupSettingsPagePersonal = observer(class PopupSettingsPagePersonal extends React.Component { constructor (props: I.PopupSettings) { super(props); - - this.onType = this.onType.bind(this); }; render () { const { config, interfaceLang } = commonStore; const { languages, hideTray, hideMenuBar } = config; - const type = dbStore.getTypeById(commonStore.type); const interfaceLanguages = this.getInterfaceLanguages(); const spellingLanguages = this.getSpellinngLanguages(); const canHideMenu = UtilCommon.isPlatformWindows() || UtilCommon.isPlatformLinux(); @@ -26,16 +23,6 @@ const PopupSettingsPagePersonal = observer(class PopupSettingsPagePersonal exten <div className="actionItems"> - <div className="item"> - <Label text={translate('popupSettingsPersonalDefaultObjectType')} /> - - <div id="defaultType" className="select" onClick={this.onType}> - <div className="item"> - <div className="name">{type?.name || translate('commonSelect')}</div> - </div> - <Icon className="arrow black" /> - </div> - </div> <div className="item"> <Label text={translate('popupSettingsPersonalSpellcheckLanguage')} /> @@ -86,25 +73,6 @@ const PopupSettingsPagePersonal = observer(class PopupSettingsPagePersonal exten ); }; - onType (e: any) { - const { getId } = this.props; - - menuStore.open('typeSuggest', { - element: `#${getId()} #defaultType`, - horizontal: I.MenuDirection.Right, - data: { - filter: '', - filters: [ - { operator: I.FilterOperator.And, relationKey: 'recommendedLayout', condition: I.FilterCondition.In, value: UtilObject.getPageLayouts() }, - ], - onClick: (item: any) => { - commonStore.typeSet(item.uniqueKey); - analytics.event('DefaultTypeChange', { objectType: item.uniqueKey, route: 'Settings' }); - }, - } - }); - }; - getInterfaceLanguages () { const ret: any[] = []; const Locale = require('lib/json/locale.json'); diff --git a/src/ts/component/popup/page/settings/space/index.tsx b/src/ts/component/popup/page/settings/space/index.tsx index 451ec5b3ad..ba4b5d2946 100644 --- a/src/ts/component/popup/page/settings/space/index.tsx +++ b/src/ts/component/popup/page/settings/space/index.tsx @@ -21,6 +21,7 @@ const PopupSettingsSpaceIndex = observer(class PopupSettingsSpaceIndex extends R super(props); this.onDashboard = this.onDashboard.bind(this); + this.onType = this.onType.bind(this); this.onSelect = this.onSelect.bind(this); this.onUpload = this.onUpload.bind(this); this.onName = this.onName.bind(this); @@ -35,6 +36,7 @@ const PopupSettingsSpaceIndex = observer(class PopupSettingsSpaceIndex extends R const { account, accountSpaceId } = authStore; const space = UtilObject.getSpaceview(); const home = UtilObject.getSpaceDashboard(); + const type = dbStore.getTypeById(commonStore.type); const usageCn = [ 'item' ]; const canDelete = space.targetSpaceId != accountSpaceId; @@ -115,7 +117,7 @@ const PopupSettingsSpaceIndex = observer(class PopupSettingsSpaceIndex extends R <div className="sectionContent"> <div className={usageCn.join(' ')}> - <div className="sides"> + <div className="sides alignTop"> <div className="side left"> <Title text={translate(`popupSettingsSpaceIndexRemoteStorageTitle`)} /> <div className="storageLabel"> @@ -150,6 +152,24 @@ const PopupSettingsSpaceIndex = observer(class PopupSettingsSpaceIndex extends R </div> </div> + <div className="item"> + <div className="sides"> + <div className="side left"> + <Title text={translate('popupSettingsPersonalDefaultObjectType')} /> + <Label text={translate('popupSettingsPersonalDefaultObjectTypeDescription')} /> + </div> + + <div className="side right"> + <div id="defaultType" className="select" onClick={this.onType}> + <div className="item"> + <div className="name">{type?.name || translate('commonSelect')}</div> + </div> + <Icon className="arrow black" /> + </div> + </div> + </div> + </div> + </div> </div> @@ -259,6 +279,25 @@ const PopupSettingsSpaceIndex = observer(class PopupSettingsSpaceIndex extends R UtilMenu.dashboardSelect(`#${this.props.getId()} #empty-dashboard-select`); }; + onType (e: any) { + const { getId } = this.props; + + menuStore.open('typeSuggest', { + element: `#${getId()} #defaultType`, + horizontal: I.MenuDirection.Right, + data: { + filter: '', + filters: [ + { operator: I.FilterOperator.And, relationKey: 'recommendedLayout', condition: I.FilterCondition.In, value: UtilObject.getPageLayouts() }, + ], + onClick: (item: any) => { + commonStore.typeSet(item.uniqueKey); + analytics.event('DefaultTypeChange', { objectType: item.uniqueKey, route: 'Settings' }); + }, + } + }); + }; + onExtend () { const { account } = authStore; const { bytesLimit } = commonStore.spaceStorage; From c829591220e8f079531852570128a315cf2f4aa9 Mon Sep 17 00:00:00 2001 From: Andrew Simachev <andrew.simachev@gmail.com> Date: Thu, 2 Nov 2023 20:22:02 +0100 Subject: [PATCH 49/88] JS-3285: fix --- src/ts/component/block/relation.tsx | 1 + src/ts/component/menu/block/relation/view.tsx | 2 +- src/ts/component/menu/dataview/relation/edit.tsx | 2 +- src/ts/component/menu/dataview/relation/list.tsx | 2 +- src/ts/component/menu/relation/suggest.tsx | 3 +-- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ts/component/block/relation.tsx b/src/ts/component/block/relation.tsx index 3affe939a7..aaa4cc3132 100644 --- a/src/ts/component/block/relation.tsx +++ b/src/ts/component/block/relation.tsx @@ -137,6 +137,7 @@ const BlockRelation = observer(class BlockRelation extends React.Component<I.Blo filter: '', menuIdEdit: 'blockRelationEdit', ref: 'block', + skipKeys: Relation.systemKeysWithoutUser(), addCommand: (rootId: string, blockId: string, relation: any, onChange: (message: any) => void) => { C.ObjectRelationAdd(rootId, [ relation.relationKey ], (message: any) => { if (message.error.code) { diff --git a/src/ts/component/menu/block/relation/view.tsx b/src/ts/component/menu/block/relation/view.tsx index a4f38a1a7c..83d55ac8bc 100644 --- a/src/ts/component/menu/block/relation/view.tsx +++ b/src/ts/component/menu/block/relation/view.tsx @@ -252,7 +252,7 @@ const MenuBlockRelationView = observer(class MenuBlockRelationView extends React filter: '', ref: 'menu', menuIdEdit: 'blockRelationEdit', - skipKeys: dbStore.getObjectRelationKeys(rootId, rootId), + skipKeys: dbStore.getObjectRelationKeys(rootId, rootId).concat(Relation.systemKeysWithoutUser()), addCommand: (rootId: string, blockId: string, relation: any, onChange: (message: any) => void) => { C.ObjectRelationAdd(rootId, [ relation.relationKey ], onChange); }, diff --git a/src/ts/component/menu/dataview/relation/edit.tsx b/src/ts/component/menu/dataview/relation/edit.tsx index 1413bdfcc4..94588301c4 100644 --- a/src/ts/component/menu/dataview/relation/edit.tsx +++ b/src/ts/component/menu/dataview/relation/edit.tsx @@ -356,7 +356,7 @@ const MenuRelationEdit = observer(class MenuRelationEdit extends React.Component menuIdEdit: 'blockRelationEdit', filter: '', ref: 'dataview', - skipKeys: relations.map(it => it.relationKey), + skipKeys: relations.map(it => it.relationKey).concat(Relation.systemKeysWithoutUser()), addCommand: (rootId: string, blockId: string, relation: any, onChange: (message: any) => void) => { Dataview.relationAdd(rootId, blockId, relation.relationKey, Math.max(0, idx + item.dir), view, (message: any) => { menuStore.closeAll([ this.props.id, 'relationSuggest' ]); diff --git a/src/ts/component/menu/dataview/relation/list.tsx b/src/ts/component/menu/dataview/relation/list.tsx index fd3ab7dca5..b4fd5d93c6 100644 --- a/src/ts/component/menu/dataview/relation/list.tsx +++ b/src/ts/component/menu/dataview/relation/list.tsx @@ -251,7 +251,7 @@ const MenuRelationList = observer(class MenuRelationList extends React.Component menuIdEdit: 'dataviewRelationEdit', filter: '', ref: 'dataview', - skipKeys: relations.map(it => it.relationKey), + skipKeys: relations.map(it => it.relationKey).concat(Relation.systemKeysWithoutUser()), onAdd, addCommand: (rootId: string, blockId: string, relation: any, onChange: (message: any) => void) => { Dataview.relationAdd(rootId, blockId, relation.relationKey, relations.length, getView(), (message: any) => { diff --git a/src/ts/component/menu/relation/suggest.tsx b/src/ts/component/menu/relation/suggest.tsx index ce611cdcbd..f5c82138c0 100644 --- a/src/ts/component/menu/relation/suggest.tsx +++ b/src/ts/component/menu/relation/suggest.tsx @@ -223,11 +223,10 @@ const MenuRelationSuggest = observer(class MenuRelationSuggest extends React.Com const { param } = this.props; const { data } = param; const filter = String(data.filter || ''); - const skipKeys = (data.skipKeys || []).concat(Relation.systemKeysWithoutUser()); const filters: any[] = [ { operator: I.FilterOperator.And, relationKey: 'spaceId', condition: I.FilterCondition.In, value: [ commonStore.space, Constant.storeSpaceId ] }, { operator: I.FilterOperator.And, relationKey: 'layout', condition: I.FilterCondition.In, value: I.ObjectLayout.Relation }, - { operator: I.FilterOperator.And, relationKey: 'relationKey', condition: I.FilterCondition.NotIn, value: skipKeys }, + { operator: I.FilterOperator.And, relationKey: 'relationKey', condition: I.FilterCondition.NotIn, value: data.skipKeys || [] }, ]; const sorts = [ { relationKey: 'spaceId', type: I.SortType.Desc }, From edb23585db5aa6fcccdeafbea4709d9a0b1e56e1 Mon Sep 17 00:00:00 2001 From: Mike Mhlv <mhlv@anytype.io> Date: Fri, 3 Nov 2023 09:12:03 +0000 Subject: [PATCH 50/88] JS-3288: defaultTypeId key in storage --- src/ts/component/popup/page/settings/space/index.tsx | 8 +++++--- src/ts/lib/storage.ts | 3 ++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/ts/component/popup/page/settings/space/index.tsx b/src/ts/component/popup/page/settings/space/index.tsx index ba4b5d2946..73abac4f27 100644 --- a/src/ts/component/popup/page/settings/space/index.tsx +++ b/src/ts/component/popup/page/settings/space/index.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import { Icon, Title, Label, Input, IconObject, Button, ProgressBar, Error } from 'Component'; -import { I, C, UtilObject, UtilMenu, UtilCommon, UtilFile, translate, Renderer, Preview, analytics, UtilDate, Action } from 'Lib'; +import { I, C, UtilObject, UtilMenu, UtilCommon, UtilFile, translate, Renderer, Preview, analytics, UtilDate, Action, Storage } from 'Lib'; import { observer } from 'mobx-react'; import { detailStore, menuStore, commonStore, authStore, dbStore } from 'Store'; import Constant from 'json/constant.json'; @@ -36,7 +36,8 @@ const PopupSettingsSpaceIndex = observer(class PopupSettingsSpaceIndex extends R const { account, accountSpaceId } = authStore; const space = UtilObject.getSpaceview(); const home = UtilObject.getSpaceDashboard(); - const type = dbStore.getTypeById(commonStore.type); + const defaultTypeId = Storage.get('defaultTypeId'); + const type = dbStore.getTypeById(defaultTypeId); const usageCn = [ 'item' ]; const canDelete = space.targetSpaceId != accountSpaceId; @@ -291,8 +292,9 @@ const PopupSettingsSpaceIndex = observer(class PopupSettingsSpaceIndex extends R { operator: I.FilterOperator.And, relationKey: 'recommendedLayout', condition: I.FilterCondition.In, value: UtilObject.getPageLayouts() }, ], onClick: (item: any) => { - commonStore.typeSet(item.uniqueKey); + Storage.set('defaultTypeId', item.id); analytics.event('DefaultTypeChange', { objectType: item.uniqueKey, route: 'Settings' }); + this.forceUpdate(); }, } }); diff --git a/src/ts/lib/storage.ts b/src/ts/lib/storage.ts index 274492d924..369224270a 100644 --- a/src/ts/lib/storage.ts +++ b/src/ts/lib/storage.ts @@ -5,6 +5,7 @@ const SPACE_KEYS = [ 'toggle', 'lastOpened', 'scroll', + 'defaultTypeId' ]; class Storage { @@ -212,4 +213,4 @@ class Storage { }; -export default new Storage(); \ No newline at end of file +export default new Storage(); From 79ca07c23c66ba1a9bb4acfd300c4117a6743684 Mon Sep 17 00:00:00 2001 From: Andrew Simachev <andrew.simachev@gmail.com> Date: Fri, 3 Nov 2023 10:20:23 +0100 Subject: [PATCH 51/88] code review --- src/ts/component/popup/page/settings/space/index.tsx | 6 ++---- src/ts/lib/storage.ts | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/ts/component/popup/page/settings/space/index.tsx b/src/ts/component/popup/page/settings/space/index.tsx index 73abac4f27..2594c5c523 100644 --- a/src/ts/component/popup/page/settings/space/index.tsx +++ b/src/ts/component/popup/page/settings/space/index.tsx @@ -36,8 +36,7 @@ const PopupSettingsSpaceIndex = observer(class PopupSettingsSpaceIndex extends R const { account, accountSpaceId } = authStore; const space = UtilObject.getSpaceview(); const home = UtilObject.getSpaceDashboard(); - const defaultTypeId = Storage.get('defaultTypeId'); - const type = dbStore.getTypeById(defaultTypeId); + const type = dbStore.getTypeById(commonStore.type); const usageCn = [ 'item' ]; const canDelete = space.targetSpaceId != accountSpaceId; @@ -292,9 +291,8 @@ const PopupSettingsSpaceIndex = observer(class PopupSettingsSpaceIndex extends R { operator: I.FilterOperator.And, relationKey: 'recommendedLayout', condition: I.FilterCondition.In, value: UtilObject.getPageLayouts() }, ], onClick: (item: any) => { - Storage.set('defaultTypeId', item.id); + commonStore.typeSet(item.uniqueKey); analytics.event('DefaultTypeChange', { objectType: item.uniqueKey, route: 'Settings' }); - this.forceUpdate(); }, } }); diff --git a/src/ts/lib/storage.ts b/src/ts/lib/storage.ts index 369224270a..d67fe35fb8 100644 --- a/src/ts/lib/storage.ts +++ b/src/ts/lib/storage.ts @@ -5,7 +5,7 @@ const SPACE_KEYS = [ 'toggle', 'lastOpened', 'scroll', - 'defaultTypeId' + 'defaultType', ]; class Storage { From b3437c4e5d36f31fa8ffb2e0f3dd3c61b09491cc Mon Sep 17 00:00:00 2001 From: Andrew Simachev <andrew.simachev@gmail.com> Date: Fri, 3 Nov 2023 10:43:02 +0100 Subject: [PATCH 52/88] JS-3290: fix --- src/json/constant.json | 3 ++- src/ts/lib/api/command.ts | 3 ++- src/ts/store/common.ts | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/json/constant.json b/src/json/constant.json index c42102494a..d4df5a3f26 100644 --- a/src/json/constant.json +++ b/src/json/constant.json @@ -26,7 +26,8 @@ "interfaceLang": "en-US", "cover": "sky", "codeLang": "javascript", - "pinTime": 600 + "pinTime": 600, + "typeKey": "ot-note" }, "delay": { diff --git a/src/ts/lib/api/command.ts b/src/ts/lib/api/command.ts index 3bef8564e1..fe69f6c614 100644 --- a/src/ts/lib/api/command.ts +++ b/src/ts/lib/api/command.ts @@ -2,6 +2,7 @@ import Commands from 'protobuf/pb/protos/commands_pb'; import Model from 'protobuf/pkg/lib/pb/model/protos/models_pb'; import { detailStore } from 'Store'; import { I, UtilCommon, Mark, Storage, dispatcher, Encode, Mapper } from 'Lib'; +import Constant from 'json/constant.json'; const Rpc = Commands.Rpc; @@ -1172,7 +1173,7 @@ const ObjectCreate = (details: any, flags: I.ObjectFlag[], templateId: string, t request.setInternalflagsList(flags.map(Mapper.To.InternalFlag)); request.setTemplateid(templateId); request.setSpaceid(spaceId); - request.setObjecttypeuniquekey(typeKey); + request.setObjecttypeuniquekey(typeKey || Constant.default.typeKey); dispatcher.request(ObjectCreate.name, request, callBack); }; diff --git a/src/ts/store/common.ts b/src/ts/store/common.ts index 05e72189e5..a9bdfdad63 100644 --- a/src/ts/store/common.ts +++ b/src/ts/store/common.ts @@ -145,11 +145,11 @@ class CommonStore { }; get type(): string { - const key = String(this.defaultType || Storage.get('defaultType') || Constant.typeKey.note); + const key = String(this.defaultType || Storage.get('defaultType') || Constant.default.typeKey); let type = dbStore.getTypeByKey(key); if (!type || !type.isInstalled || !UtilObject.getPageLayouts().includes(type.recommendedLayout)) { - type = dbStore.getTypeByKey(Constant.typeKey.note); + type = dbStore.getTypeByKey(Constant.default.typeKey); }; return type ? type.id : ''; From 98c7f73622bea08b48a2fe65c576a83b6aa78af2 Mon Sep 17 00:00:00 2001 From: Andrew Simachev <andrew.simachev@gmail.com> Date: Fri, 3 Nov 2023 11:51:32 +0100 Subject: [PATCH 53/88] crash fixes --- src/ts/component/block/dataview.tsx | 2 -- src/ts/component/page/auth/login.tsx | 8 ++++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/ts/component/block/dataview.tsx b/src/ts/component/block/dataview.tsx index ed43a3d1c0..1925da858f 100644 --- a/src/ts/component/block/dataview.tsx +++ b/src/ts/component/block/dataview.tsx @@ -836,8 +836,6 @@ const BlockDataview = observer(class BlockDataview extends React.Component<Props }; onTemplateAdd (id?: string) { - const { rootId, block } = this.props; - const view = this.getView(); const typeId = id || this.getTypeId(); const type = dbStore.getTypeById(typeId); const route = this.isCollection() ? 'Collection' : 'Set'; diff --git a/src/ts/component/page/auth/login.tsx b/src/ts/component/page/auth/login.tsx index 39d1a54157..ab8f6033c8 100644 --- a/src/ts/component/page/auth/login.tsx +++ b/src/ts/component/page/auth/login.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import { Frame, Error, Button, Header, Icon, Phrase } from 'Component'; -import { I, UtilRouter, UtilData, UtilCommon, translate, C, keyboard, Animation, Renderer, analytics, Storage } from 'Lib'; +import { I, UtilRouter, UtilData, UtilCommon, translate, C, keyboard, Animation, Renderer, analytics } from 'Lib'; import { commonStore, authStore, popupStore } from 'Store'; import { observer } from 'mobx-react'; @@ -117,7 +117,7 @@ const PageAuthLogin = observer(class PageAuthLogin extends React.Component<I.Pag authStore.accountListClear(); UtilData.createSession(() => { - C.AccountRecover((message) => this.setError(message.error)); + C.AccountRecover(message => this.setError(message.error)); }); }); }; @@ -145,7 +145,7 @@ const PageAuthLogin = observer(class PageAuthLogin extends React.Component<I.Pag }; this.setState({ error: error.description }); - this.refPhrase.setError(true); + this.refPhrase?.setError(true); this.refSubmit.setLoading(false); UtilCommon.checkError(error.code); @@ -161,7 +161,7 @@ const PageAuthLogin = observer(class PageAuthLogin extends React.Component<I.Pag }; onKeyDown (e: any) { - keyboard.shortcut('enter', e, () => { this.onSubmit(e); }); + keyboard.shortcut('enter', e, () => this.onSubmit(e)); }; onCancel () { From e21d0f9000de7b11d39e153c5e13841a2eec7982 Mon Sep 17 00:00:00 2001 From: Andrew Simachev <andrew.simachev@gmail.com> Date: Fri, 3 Nov 2023 12:22:32 +0100 Subject: [PATCH 54/88] fix MenuTypeSuggest spacee filter --- src/ts/component/menu/type/suggest.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ts/component/menu/type/suggest.tsx b/src/ts/component/menu/type/suggest.tsx index 571094b65a..e73c85d2c7 100644 --- a/src/ts/component/menu/type/suggest.tsx +++ b/src/ts/component/menu/type/suggest.tsx @@ -232,6 +232,7 @@ const MenuTypeSuggest = observer(class MenuTypeSuggest extends React.Component<I ]; let filters: any[] = [ + { operator: I.FilterOperator.And, relationKey: 'spaceId', condition: I.FilterCondition.In, value: [ Constant.storeSpaceId, commonStore.space ] }, { operator: I.FilterOperator.And, relationKey: 'layout', condition: I.FilterCondition.In, value: I.ObjectLayout.Type }, ]; if (data.filters) { From aaec7f2a3572f5ca6461b925b1416511cba8d4dd Mon Sep 17 00:00:00 2001 From: Andrew Simachev <andrew.simachev@gmail.com> Date: Fri, 3 Nov 2023 14:14:34 +0100 Subject: [PATCH 55/88] JS-3292: fix --- src/ts/component/menu/space.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ts/component/menu/space.tsx b/src/ts/component/menu/space.tsx index 2b4afe8c55..f389e4ca83 100644 --- a/src/ts/component/menu/space.tsx +++ b/src/ts/component/menu/space.tsx @@ -192,7 +192,11 @@ const MenuSpace = observer(class MenuSpace extends React.Component<I.Menu> { this.n = 0; }; - this.props.setActive(); + if (items[this.n] && (items[this.n].id == 'add')) { + this.onArrow(dir); + } else { + this.props.setActive(); + }; }; getItems () { From ff14db2d3f5f7c7a0a2e261d1d94d5e39c65de36 Mon Sep 17 00:00:00 2001 From: Andrew Simachev <andrew.simachev@gmail.com> Date: Fri, 3 Nov 2023 15:04:12 +0100 Subject: [PATCH 56/88] JS-3295: fix --- src/ts/component/block/dataview/controls.tsx | 3 +++ src/ts/component/form/filter.tsx | 23 ++++++++++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/src/ts/component/block/dataview/controls.tsx b/src/ts/component/block/dataview/controls.tsx index b1b2c07a63..2af11aeb68 100644 --- a/src/ts/component/block/dataview/controls.tsx +++ b/src/ts/component/block/dataview/controls.tsx @@ -48,6 +48,7 @@ const Controls = observer(class Controls extends React.Component<Props> { const hasSources = (isCollection || getSources().length); const isAllowedObject = this.props.isAllowedObject(); const isAllowedTemplate = UtilObject.isAllowedTemplate(getTypeId()) || (target && UtilObject.isSetLayout(target.layout) && hasSources); + const cmd = keyboard.cmdSymbol(); if (isAllowedTemplate) { buttonWrapCn.push('withSelect'); @@ -148,6 +149,8 @@ const Controls = observer(class Controls extends React.Component<Props> { ref={ref => this.refFilter = ref} placeholder={translate('blockDataviewSearch')} icon="search" + tooltip={translate('commonSearch')} + tooltipCaption={`${cmd} + F`} onChange={onFilterChange} onIconClick={this.onFilterShow} /> diff --git a/src/ts/component/form/filter.tsx b/src/ts/component/form/filter.tsx index 97984a6e71..fabb85551f 100644 --- a/src/ts/component/form/filter.tsx +++ b/src/ts/component/form/filter.tsx @@ -11,6 +11,10 @@ interface Props { value?: string; placeholder?: string; placeholderFocus?: string; + tooltip?: string; + tooltipCaption?: string; + tooltipX?: I.MenuDirection.Left | I.MenuDirection.Center | I.MenuDirection.Right; + tooltipY?: I.MenuDirection.Top | I.MenuDirection.Bottom; onClick?(e: any): void; onFocus?(e: any): void; onBlur?(e: any): void; @@ -31,6 +35,7 @@ class Filter extends React.Component<Props, State> { className: '', inputClassName: '', placeholder: translate('commonFilterClick'), + tooltipY: I.MenuDirection.Bottom, }; state = { @@ -53,7 +58,7 @@ class Filter extends React.Component<Props, State> { render () { const { isActive } = this.state; - const { id, value, icon, placeholder, className, inputClassName, onKeyDown, onKeyUp, onClick, onIconClick } = this.props; + const { id, value, icon, tooltip, tooltipCaption, tooltipX, tooltipY, placeholder, className, inputClassName, onKeyDown, onKeyUp, onClick, onIconClick } = this.props; const cn = [ 'filter' ]; if (className) { @@ -64,6 +69,20 @@ class Filter extends React.Component<Props, State> { cn.push('isActive'); }; + let iconObj = null; + if (icon) { + iconObj = ( + <Icon + className={icon} + tooltip={tooltip} + tooltipCaption={tooltipCaption} + tooltipX={tooltipX} + tooltipY={tooltipY} + onClick={onIconClick} + /> + ); + }; + return ( <div ref={node => this.node = node} @@ -72,7 +91,7 @@ class Filter extends React.Component<Props, State> { onClick={onClick} > <div className="inner"> - {icon ? <Icon className={icon} onClick={onIconClick} /> : ''} + {iconObj} <div className="filterInputWrap"> <Input From b01ec327559a637b49b022793d2bf1a463e0e1b5 Mon Sep 17 00:00:00 2001 From: Andrew Simachev <andrew.simachev@gmail.com> Date: Fri, 3 Nov 2023 15:46:57 +0100 Subject: [PATCH 57/88] fix crash --- src/ts/component/menu/smile.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ts/component/menu/smile.tsx b/src/ts/component/menu/smile.tsx index 6806c077c7..548e18b6ee 100644 --- a/src/ts/component/menu/smile.tsx +++ b/src/ts/component/menu/smile.tsx @@ -503,7 +503,7 @@ class MenuSmile extends React.Component<I.Menu, State> { setActive (item?: any, row?: number) { const node = $(this.node); - if (row) { + if (row && this.refList) { this.refList.scrollToRow(Math.max(0, row)); }; From 97b407d9ee3b009689f6303ab6a91282c0ff2957 Mon Sep 17 00:00:00 2001 From: Andrew Simachev <andrew.simachev@gmail.com> Date: Fri, 3 Nov 2023 16:01:47 +0100 Subject: [PATCH 58/88] add UtilRouter to debug --- src/ts/app.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ts/app.tsx b/src/ts/app.tsx index 653e9d98c6..db30e9dfbc 100644 --- a/src/ts/app.tsx +++ b/src/ts/app.tsx @@ -238,6 +238,7 @@ window.Lib = { UtilFile, UtilObject, UtilMenu, + UtilRouter, analytics, dispatcher, keyboard, From d96e5975b6c994d4d177ee0b647fe5cd91c76e73 Mon Sep 17 00:00:00 2001 From: Andrew Simachev <andrew.simachev@gmail.com> Date: Fri, 3 Nov 2023 16:08:37 +0100 Subject: [PATCH 59/88] JS-3298: fix --- src/ts/component/menu/dataview/view/layout.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/ts/component/menu/dataview/view/layout.tsx b/src/ts/component/menu/dataview/view/layout.tsx index c0f79b0fd5..ee3b2148d1 100644 --- a/src/ts/component/menu/dataview/view/layout.tsx +++ b/src/ts/component/menu/dataview/view/layout.tsx @@ -148,14 +148,20 @@ const MenuViewLayout = observer(class MenuViewLayout extends React.Component<I.M if (readonly || !block) { return; }; - + + const isBoard = this.param.type == I.ViewType.Board; + const isCalendar = this.param.type == I.ViewType.Calendar; const current = data.view.get(); const clearGroups = (current.type == I.ViewType.Board) && this.param.groupRelationKey && (current.groupRelationKey != this.param.groupRelationKey); - if ([ I.ViewType.Board, I.ViewType.Calendar ].includes(this.param.type) && !this.param.groupRelationKey) { + if (isBoard && !this.param.groupRelationKey) { this.param.groupRelationKey = Relation.getGroupOption(rootId, blockId, this.param.type, this.param.groupRelationKey)?.id; }; + if (isCalendar && !this.param.groupRelationKey) { + this.param.groupRelationKey = 'lastModifiedDate'; + }; + this.param.name = view.name; C.BlockDataviewViewUpdate(rootId, blockId, current.id, this.param, () => { From 8257754f6e0c706e61e1d7fef6cf2d7d61d7dd4a Mon Sep 17 00:00:00 2001 From: Andrew Simachev <andrew.simachev@gmail.com> Date: Fri, 3 Nov 2023 16:34:22 +0100 Subject: [PATCH 60/88] fix gallery jumping --- src/ts/component/block/dataview/view/gallery.tsx | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/ts/component/block/dataview/view/gallery.tsx b/src/ts/component/block/dataview/view/gallery.tsx index b050e24618..d7f5874622 100644 --- a/src/ts/component/block/dataview/view/gallery.tsx +++ b/src/ts/component/block/dataview/view/gallery.tsx @@ -157,14 +157,6 @@ const ViewGallery = observer(class ViewGallery extends React.Component<I.ViewCom ); }; - componentDidMount () { - this.reset(); - }; - - componentDidUpdate () { - this.reset(); - }; - componentWillUnmount () { window.clearTimeout(this.timeout); }; @@ -235,6 +227,10 @@ const ViewGallery = observer(class ViewGallery extends React.Component<I.ViewCom }; getItems () { + if (!this.width) { + return []; + }; + this.setColumnCount(); const records = this.getRecords(); From 5c7a7a17cbaf3f66caf3e7862325997085790c25 Mon Sep 17 00:00:00 2001 From: Andrew Simachev <andrew.simachev@gmail.com> Date: Fri, 3 Nov 2023 16:37:15 +0100 Subject: [PATCH 61/88] fix WidgetList dropTarget --- src/scss/widget/list.scss | 1 - 1 file changed, 1 deletion(-) diff --git a/src/scss/widget/list.scss b/src/scss/widget/list.scss index dea548174d..344a67c688 100644 --- a/src/scss/widget/list.scss +++ b/src/scss/widget/list.scss @@ -79,7 +79,6 @@ .item.canDrag { .inner { padding-left: 0px; } - .dropTarget { width: calc(100% - 20px); } } .item.isDragging { margin-top: -46px; margin-left: -12px; } From b2c5c5f4b2c984339c72481d31ca4cd85a7130ea Mon Sep 17 00:00:00 2001 From: Andrew Simachev <andrew.simachev@gmail.com> Date: Fri, 3 Nov 2023 19:19:12 +0100 Subject: [PATCH 62/88] add Layout.Space to system layouts --- src/ts/lib/util/object.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ts/lib/util/object.ts b/src/ts/lib/util/object.ts index 1f3fcf8bd7..d690aa7dc9 100644 --- a/src/ts/lib/util/object.ts +++ b/src/ts/lib/util/object.ts @@ -399,6 +399,7 @@ class UtilObject { I.ObjectLayout.Relation, I.ObjectLayout.Option, I.ObjectLayout.Dashboard, + I.ObjectLayout.Space, I.ObjectLayout.SpaceView, ]; }; From c5c48987d5d2dff62cbeaac9e28f6dbe56e53a95 Mon Sep 17 00:00:00 2001 From: Andrew Simachev <andrew.simachev@gmail.com> Date: Fri, 3 Nov 2023 19:58:18 +0100 Subject: [PATCH 63/88] fix filter --- src/ts/component/menu/dataview/object/list.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ts/component/menu/dataview/object/list.tsx b/src/ts/component/menu/dataview/object/list.tsx index 39e70375d5..06b7af5567 100644 --- a/src/ts/component/menu/dataview/object/list.tsx +++ b/src/ts/component/menu/dataview/object/list.tsx @@ -252,7 +252,9 @@ const MenuDataviewObjectList = observer(class MenuDataviewObjectList extends Rea const { param } = this.props; const { data } = param; const { types, filter } = data; - const filters: I.Filter[] = [].concat(data.filters || []); + const filters: I.Filter[] = [ + { operator: I.FilterOperator.And, relationKey: 'layout', condition: I.FilterCondition.NotIn, value: UtilObject.getSystemLayouts() } + ].concat(data.filters || []); const sorts = [ { relationKey: 'lastOpenedDate', type: I.SortType.Desc }, ]; @@ -262,8 +264,6 @@ const MenuDataviewObjectList = observer(class MenuDataviewObjectList extends Rea if (map.length) { filters.push({ operator: I.FilterOperator.And, relationKey: 'type.uniqueKey', condition: I.FilterCondition.In, value: map }); }; - } else { - filters.push({ operator: I.FilterOperator.And, relationKey: 'layout', condition: I.FilterCondition.NotIn, value: UtilObject.getSystemLayouts() }); }; if (clear) { From 907057f707489f0cc2663230d0c84f985b4f19cc Mon Sep 17 00:00:00 2001 From: Andrew Simachev <andrew.simachev@gmail.com> Date: Mon, 6 Nov 2023 11:13:22 +0100 Subject: [PATCH 64/88] clear defaultType on space change --- src/ts/lib/util/router.ts | 1 + src/ts/store/common.ts | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ts/lib/util/router.ts b/src/ts/lib/util/router.ts index 51694c1851..76fa4e4644 100644 --- a/src/ts/lib/util/router.ts +++ b/src/ts/lib/util/router.ts @@ -141,6 +141,7 @@ class UtilRouter { analytics.removeContext(); blockStore.clear(blockStore.widgets); + commonStore.defaultType = ''; Storage.set('spaceId', id); UtilData.onInfo(message.info); diff --git a/src/ts/store/common.ts b/src/ts/store/common.ts index a9bdfdad63..9abcbac13d 100644 --- a/src/ts/store/common.ts +++ b/src/ts/store/common.ts @@ -1,9 +1,8 @@ import { action, computed, intercept, makeObservable, observable, set } from 'mobx'; import $ from 'jquery'; -import { analytics, I, Storage, UtilCommon, UtilObject, Renderer } from 'Lib'; -import { blockStore, dbStore } from 'Store'; +import { I, Storage, UtilCommon, UtilObject, Renderer } from 'Lib'; +import { dbStore } from 'Store'; import Constant from 'json/constant.json'; -import * as Sentry from '@sentry/browser'; interface Filter { from: number; From 8051e82cfebbc9b6b63c703c109f6b74e914c74b Mon Sep 17 00:00:00 2001 From: Andrew Simachev <andrew.simachev@gmail.com> Date: Mon, 6 Nov 2023 12:04:52 +0100 Subject: [PATCH 65/88] JS-3288: fix --- src/ts/component/block/dataview.tsx | 2 -- src/ts/component/popup/page/settings/space/index.tsx | 1 + src/ts/lib/action.ts | 8 ++++---- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/ts/component/block/dataview.tsx b/src/ts/component/block/dataview.tsx index 1925da858f..8f67434327 100644 --- a/src/ts/component/block/dataview.tsx +++ b/src/ts/component/block/dataview.tsx @@ -818,8 +818,6 @@ const BlockDataview = observer(class BlockDataview extends React.Component<Props C.BlockDataviewViewUpdate(rootId, block.id, view.id, { ...view, defaultTemplateId: item.id }); }, onSelect: (item: any) => { - console.log('ITEM', JSON.stringify(item)); - if (item.id == Constant.templateId.new) { this.onTemplateAdd(item.targetObjectType); } else { diff --git a/src/ts/component/popup/page/settings/space/index.tsx b/src/ts/component/popup/page/settings/space/index.tsx index 2594c5c523..2cba9bb388 100644 --- a/src/ts/component/popup/page/settings/space/index.tsx +++ b/src/ts/component/popup/page/settings/space/index.tsx @@ -293,6 +293,7 @@ const PopupSettingsSpaceIndex = observer(class PopupSettingsSpaceIndex extends R onClick: (item: any) => { commonStore.typeSet(item.uniqueKey); analytics.event('DefaultTypeChange', { objectType: item.uniqueKey, route: 'Settings' }); + this.forceUpdate(); }, } }); diff --git a/src/ts/lib/action.ts b/src/ts/lib/action.ts index ed21dc4efd..5defd3c7f7 100644 --- a/src/ts/lib/action.ts +++ b/src/ts/lib/action.ts @@ -221,10 +221,6 @@ class Action { return; }; - if (callBack) { - callBack(message); - }; - const { details } = message; const eventParam: any = { layout: object.layout }; @@ -255,6 +251,10 @@ class Action { detailStore.update(subId, { id: details.id, details }, false); analytics.event('ObjectInstall', eventParam); + + if (callBack) { + callBack(message); + }; }); }; From 4ca7b23208dd12fb021837fb05e4f90d1daf25f0 Mon Sep 17 00:00:00 2001 From: Andrew Simachev <andrew.simachev@gmail.com> Date: Mon, 6 Nov 2023 15:51:52 +0100 Subject: [PATCH 66/88] endless login recursion --- src/ts/component/page/auth/login.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ts/component/page/auth/login.tsx b/src/ts/component/page/auth/login.tsx index ab8f6033c8..80cdade58b 100644 --- a/src/ts/component/page/auth/login.tsx +++ b/src/ts/component/page/auth/login.tsx @@ -148,6 +148,8 @@ const PageAuthLogin = observer(class PageAuthLogin extends React.Component<I.Pag this.refPhrase?.setError(true); this.refSubmit.setLoading(false); + authStore.accountListClear(); + UtilCommon.checkError(error.code); return true; }; From f05efadfbb6ce2b88b973bbc0811abc604efb2a8 Mon Sep 17 00:00:00 2001 From: Andrew Simachev <andrew.simachev@gmail.com> Date: Mon, 6 Nov 2023 19:53:34 +0100 Subject: [PATCH 67/88] JS-3316: tooltips --- src/json/text.json | 6 +++ src/scss/theme/dark/menu.scss | 3 ++ src/ts/component/block/dataview.tsx | 4 +- src/ts/component/page/head/banner.tsx | 11 +++++- src/ts/docs/help/onboarding.ts | 57 ++++++++++++++++++++++++--- 5 files changed, 73 insertions(+), 8 deletions(-) diff --git a/src/json/text.json b/src/json/text.json index 090f2c4ba0..adf6fee64b 100644 --- a/src/json/text.json +++ b/src/json/text.json @@ -1512,6 +1512,12 @@ "onboardingDefaultTypeTitle": "Change Types Easily", "onboardingDefaultTypeDescription": "You can change type and template of a new object in this menu.", + "onboardingCalendarDescription": "Check out the calendar view.", + + "onboardingTemplateSelectDescription": "Easily switch your templates when creating objects.", + + "onboardingSpaceSelect": "Here is your Spaces selector! Swipe between spaces or create a new one.", + "libDataviewRelations": "Relations", "libDataviewGroups": "Groups", "libDataviewView": "View", diff --git a/src/scss/theme/dark/menu.scss b/src/scss/theme/dark/menu.scss index 045ac04cb7..d0ef142bc7 100644 --- a/src/scss/theme/dark/menu.scss +++ b/src/scss/theme/dark/menu.scss @@ -324,6 +324,9 @@ .menu.menuOnboarding { width: 288px; background: #373632; color: #fff; box-shadow: 0px 4px 16px rgb(0 0 0 / 20%); } .menu.menuOnboarding { a { color: $colorBgPrimary; } + + video { border-color: $colorShapeSecondary; } + .highlight { background: $colorShapeSecondary; color: $colorOrange; } .bottom { diff --git a/src/ts/component/block/dataview.tsx b/src/ts/component/block/dataview.tsx index 8f67434327..9606b05908 100644 --- a/src/ts/component/block/dataview.tsx +++ b/src/ts/component/block/dataview.tsx @@ -247,8 +247,8 @@ const BlockDataview = observer(class BlockDataview extends React.Component<Props const eventName = this.isCollection() ? 'ScreenCollection' : 'ScreenSet'; analytics.event(eventName, { embedType: analytics.embedType(isInline) }); - if (!isInline && Onboarding.isCompleted('mainSet')) { - Onboarding.start('changeDefaultTypeInSet', isPopup); + if (!isInline && Onboarding.isCompleted('mainSet') && this.isAllowedObject()) { + Onboarding.start('setSettings', isPopup); }; }; diff --git a/src/ts/component/page/head/banner.tsx b/src/ts/component/page/head/banner.tsx index 132bc49f4f..3fed00302b 100644 --- a/src/ts/component/page/head/banner.tsx +++ b/src/ts/component/page/head/banner.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import $ from 'jquery'; import { IconObject, Label, ObjectName } from 'Component'; -import { I, Action, translate, UtilObject, UtilCommon, C, analytics } from 'Lib'; +import { I, Action, translate, UtilObject, UtilCommon, C, analytics, Onboarding } from 'Lib'; import { dbStore, menuStore } from 'Store'; import Constant from 'json/constant.json'; @@ -85,6 +85,14 @@ class HeaderBanner extends React.Component<Props> { ); }; + componentDidMount (): void { + const { type, isPopup } = this.props; + + if (type == I.BannerType.TemplateSelect) { + Onboarding.start('templateSelect', isPopup); + }; + }; + onTemplateMenu () { const { object, isPopup } = this.props; const { sourceObject } = object; @@ -129,6 +137,7 @@ class HeaderBanner extends React.Component<Props> { }, }); }; + }; export default HeaderBanner; \ No newline at end of file diff --git a/src/ts/docs/help/onboarding.ts b/src/ts/docs/help/onboarding.ts index 9946ec37f1..64fa76c36c 100644 --- a/src/ts/docs/help/onboarding.ts +++ b/src/ts/docs/help/onboarding.ts @@ -54,7 +54,7 @@ export default { } ], onComplete: (force: boolean) => { - Onboarding.start('changeDefaultTypeInSet', keyboard.isPopup(), force); + Onboarding.start('setSettings', keyboard.isPopup(), force); }, param: { element: '#page.isFull #footer #button-help', @@ -187,6 +187,9 @@ export default { dashboard: () => ({ category: translate('onboardingDashboard'), showConfetti: true, + onComplete: (force: boolean) => { + Onboarding.start('navigation', keyboard.isPopup(), force); + }, items: [ { description: ` @@ -356,20 +359,64 @@ export default { ], }), - changeDefaultTypeInSet: () => ( + setSettings: () => ( { items: [ { name: translate('onboardingDefaultTypeTitle'), description: translate('onboardingDefaultTypeDescription'), + param: { + element: '#button-dataview-add-record-select', + horizontal: I.MenuDirection.Right, + offsetX: -4, + offsetY: 12, + }, + }, + + { + description: translate('onboardingCalendarDescription'), + param: { + element: '#button-dataview-settings', + horizontal: I.MenuDirection.Right, + offsetX: -4, + offsetY: 12, + }, + }, + ], + } + ), + + templateSelect: () => ( + { + items: [ + { + description: translate('onboardingTemplateSelectDescription'), }, ], param: { - element: '#button-dataview-add-record-select', - horizontal: I.MenuDirection.Right, - offsetX: -4, + element: '#headerBanner', + horizontal: I.MenuDirection.Center, offsetY: 12, + noButton: true, + }, + } + ), + + navigation: () => ( + { + items: [ + { + description: translate('onboardingSpaceSelect'), + }, + ], + + param: { + element: '#navigationPanel #button-navigation-profile', + vertical: I.MenuDirection.Top, + horizontal: I.MenuDirection.Center, + offsetY: -24, + noButton: true, }, } ), From 9236a9d4d79e1b524b9ba68974c8fa9e4671b844 Mon Sep 17 00:00:00 2001 From: Andrew Simachev <andrew.simachev@gmail.com> Date: Mon, 6 Nov 2023 20:12:46 +0100 Subject: [PATCH 68/88] JS-3315: fix + refactoring --- src/scss/menu/dataview/template.scss | 8 ++------ src/scss/theme/dark/menu.scss | 2 ++ src/ts/component/menu/dataview/template/context.tsx | 3 ++- src/ts/component/menu/dataview/template/list.tsx | 6 +++--- src/ts/component/page/head/banner.tsx | 5 ++++- 5 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/scss/menu/dataview/template.scss b/src/scss/menu/dataview/template.scss index e4a96a625d..d3cb428d26 100644 --- a/src/scss/menu/dataview/template.scss +++ b/src/scss/menu/dataview/template.scss @@ -16,16 +16,12 @@ .item::before { display: none; } .item { - .icon.more { - position: static; - width: 20px; - height: 20px; - margin: 0px; - } + .icon.more { position: static; width: 20px; height: 20px; margin: 0px; opacity: 1; } .icon.more:hover { background-color: unset; } .previewObject { .add { width: 20px; height: 20px; @include pos-abs-mid; margin: -10px 0px 0px -10px; } + .moreWrapper.hover { opacity: 1; } } .previewObject.isDefault { .border { border-color: $colorSystemAccent100; border-width: 2px; } diff --git a/src/scss/theme/dark/menu.scss b/src/scss/theme/dark/menu.scss index d0ef142bc7..2c1e2ec6b3 100644 --- a/src/scss/theme/dark/menu.scss +++ b/src/scss/theme/dark/menu.scss @@ -391,6 +391,8 @@ .emptySearch { border-color: $colorShapePrimary; } .items { .item { + .icon.more:hover { background-color: unset; } + .previewObject { background-color: $colorBgPrimary; } .previewObject::before { background-color: $colorShapeHighlightMedium; } } diff --git a/src/ts/component/menu/dataview/template/context.tsx b/src/ts/component/menu/dataview/template/context.tsx index 59f56dce82..743eac574d 100644 --- a/src/ts/component/menu/dataview/template/context.tsx +++ b/src/ts/component/menu/dataview/template/context.tsx @@ -52,9 +52,10 @@ class MenuTemplateContext extends React.Component<I.Menu> { const { template, isView, onSetDefault, templateId } = data; const isBlank = template.id == Constant.templateId.blank; const isDefault = template.id == templateId; + const defaultName = isView ? translate('menuDataviewTemplateSetDefaultForView') : translate('commonSetDefault'); return [ - !isDefault && onSetDefault ? ({ id: 'default', name: isView ? translate('menuDataviewTemplateSetDefaultForView') : translate('commonSetDefault') }) : null, + !isDefault && onSetDefault ? ({ id: 'default', name: defaultName }) : null, !isBlank ? ({ id: 'edit', name: translate('menuDataviewTemplateEdit') }) : null, { id: 'duplicate', name: translate('commonDuplicate') }, !isBlank ? ({ id: 'remove', name: translate('commonDelete'), color: 'red' }) : null, diff --git a/src/ts/component/menu/dataview/template/list.tsx b/src/ts/component/menu/dataview/template/list.tsx index 72f4f1aecd..3272713f5c 100644 --- a/src/ts/component/menu/dataview/template/list.tsx +++ b/src/ts/component/menu/dataview/template/list.tsx @@ -245,7 +245,7 @@ const MenuTemplateList = observer(class MenuTemplateList extends React.Component onMore (e: any, template: any) { const { param, getId } = this.props; const { data } = param; - const { onSetDefault, route, typeId } = data; + const { onSetDefault, route, typeId, getView } = data; const item = UtilCommon.objectCopy(template); const node = $(`#item-${item.id}`); const templateId = this.getTemplateId(); @@ -278,11 +278,11 @@ const MenuTemplateList = observer(class MenuTemplateList extends React.Component data: { rebind: this.rebind, template: item, - isView: true, + isView: !!getView, typeId, templateId, route, - onDuplicate: (object) => UtilObject.openPopup(object, {}), + onDuplicate: object => UtilObject.openPopup(object, {}), onSetDefault, } }); diff --git a/src/ts/component/page/head/banner.tsx b/src/ts/component/page/head/banner.tsx index 3fed00302b..71c280bac2 100644 --- a/src/ts/component/page/head/banner.tsx +++ b/src/ts/component/page/head/banner.tsx @@ -100,7 +100,7 @@ class HeaderBanner extends React.Component<Props> { const templateId = sourceObject || Constant.templateId.blank; const node = $(this.node); - if (menuStore.isOpen('dataviewTemplateList')) { + if (!type || menuStore.isOpen('dataviewTemplateList')) { return; }; @@ -128,6 +128,9 @@ class HeaderBanner extends React.Component<Props> { typeId: type.id, templateId, previewSize: I.PreviewSize.Medium, + onSetDefault: () => { + UtilObject.setDefaultTemplateId(type.id, templateId); + }, onSelect: (item: any) => { C.ObjectApplyTemplate(object.id, item.id); From b731b1d70bbc4f1ab46fd955e189708a71a8f6ea Mon Sep 17 00:00:00 2001 From: Andrew Simachev <andrew.simachev@gmail.com> Date: Mon, 6 Nov 2023 20:15:47 +0100 Subject: [PATCH 69/88] small refactoring --- src/ts/component/page/head/controls.tsx | 14 ++++---------- src/ts/component/page/main/type.tsx | 2 +- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/ts/component/page/head/controls.tsx b/src/ts/component/page/head/controls.tsx index 83e2d63b3a..b0b13e9812 100644 --- a/src/ts/component/page/head/controls.tsx +++ b/src/ts/component/page/head/controls.tsx @@ -145,21 +145,15 @@ const Controls = observer(class Controls extends React.Component<Props, State> { }; onCoverOpen () { - if (!this._isMounted) { - return; + if (this._isMounted) { + $(this.node).addClass('hover'); }; - - const node = $(this.node); - node.addClass('hover'); }; onCoverClose () { - if (!this._isMounted) { - return; + if (this._isMounted) { + $(this.node).removeClass('hover'); }; - - const node = $(this.node); - node.removeClass('hover'); }; onCoverSelect (item: any) { diff --git a/src/ts/component/page/main/type.tsx b/src/ts/component/page/main/type.tsx index c9aa7b5f4e..bb7fa58b7e 100644 --- a/src/ts/component/page/main/type.tsx +++ b/src/ts/component/page/main/type.tsx @@ -506,7 +506,7 @@ const PageMainType = observer(class PageMainType extends React.Component<I.PageC menuStore.closeAll(Constant.menuIds.dataviewTemplate, () => { menuStore.open('dataviewTemplateContext', { menuKey: item.id, - element: `#item-${item.id} .more`, + element: `#item-more-${item.id}`, vertical: I.MenuDirection.Bottom, horizontal: I.MenuDirection.Right, onOpen: () => $(`#item-${item.id}`).addClass('active'), From 54b95414550c0bda1eb7654eeeefd9120e9e8d1a Mon Sep 17 00:00:00 2001 From: Andrew Simachev <andrew.simachev@gmail.com> Date: Tue, 7 Nov 2023 11:12:13 +0100 Subject: [PATCH 70/88] fix text --- src/json/text.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/json/text.json b/src/json/text.json index adf6fee64b..d9e58deef4 100644 --- a/src/json/text.json +++ b/src/json/text.json @@ -1516,7 +1516,7 @@ "onboardingTemplateSelectDescription": "Easily switch your templates when creating objects.", - "onboardingSpaceSelect": "Here is your Spaces selector! Swipe between spaces or create a new one.", + "onboardingSpaceSelect": "Here is your Spaces selector! Switch between spaces or create a new one.", "libDataviewRelations": "Relations", "libDataviewGroups": "Groups", From 1409061b0a9c113818ad975dccd3fb18e3c9f72a Mon Sep 17 00:00:00 2001 From: Andrew Simachev <andrew.simachev@gmail.com> Date: Tue, 7 Nov 2023 19:00:30 +0100 Subject: [PATCH 71/88] JS-3321: fix --- src/ts/component/menu/dataview/calendar/day.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ts/component/menu/dataview/calendar/day.tsx b/src/ts/component/menu/dataview/calendar/day.tsx index 775c419f4b..3ca8c6f170 100644 --- a/src/ts/component/menu/dataview/calendar/day.tsx +++ b/src/ts/component/menu/dataview/calendar/day.tsx @@ -108,7 +108,7 @@ const MenuCalendarDay = observer(class MenuCalendarDay extends React.Component<I }; onClick (e: any, item: any) { - UtilObject.openAuto(item); + UtilObject.openPopup(item); }; onSelect (item: any, icon: string) { From 624f8efdff8c7b7af30ecb2b3fa22dec88b65fb4 Mon Sep 17 00:00:00 2001 From: Andrew Simachev <andrew.simachev@gmail.com> Date: Wed, 8 Nov 2023 09:30:46 +0100 Subject: [PATCH 72/88] bump middleware version --- middleware.version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/middleware.version b/middleware.version index 9c2255d5e8..35711f7367 100644 --- a/middleware.version +++ b/middleware.version @@ -1 +1 @@ -0.29.6 \ No newline at end of file +0.29.8 \ No newline at end of file From b67b5c6c15e0671537dd15bbc33d4f9fc23659ab Mon Sep 17 00:00:00 2001 From: Andrew Simachev <andrew.simachev@gmail.com> Date: Wed, 8 Nov 2023 09:32:08 +0100 Subject: [PATCH 73/88] 0.35.16-beta --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 646242ebbf..22cbc8af3d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "anytype", - "version": "0.35.15-beta", + "version": "0.35.16-beta", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "anytype", - "version": "0.35.15-beta", + "version": "0.35.16-beta", "hasInstallScript": true, "license": "SEE LICENSE IN LICENSE.md", "dependencies": { diff --git a/package.json b/package.json index ebd2051b9b..e548ee67de 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "anytype", - "version": "0.35.15-beta", + "version": "0.35.16-beta", "description": "Anytype", "main": "electron.js", "scripts": { From aaa98182aa233c249bddd95a65564e260dbf3fc0 Mon Sep 17 00:00:00 2001 From: Andrew Simachev <andrew.simachev@gmail.com> Date: Wed, 8 Nov 2023 09:39:51 +0100 Subject: [PATCH 74/88] fix node version --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c2803f110b..3fe14d8106 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,7 +30,7 @@ jobs: - name: Install Node.js, NPM and Yarn uses: actions/setup-node@v1 with: - node-version: 16.19.0 + node-version: 18.15.0 - name: Install Webpack run: npm install --save-dev webpack-cli --legacy-peer-deps From aac390c4517b5066799b139e71bb9d1c406c5cea Mon Sep 17 00:00:00 2001 From: Andrew Simachev <andrew.simachev@gmail.com> Date: Wed, 8 Nov 2023 09:40:27 +0100 Subject: [PATCH 75/88] 0.35.17-beta --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 22cbc8af3d..2b81cd52db 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "anytype", - "version": "0.35.16-beta", + "version": "0.35.17-beta", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "anytype", - "version": "0.35.16-beta", + "version": "0.35.17-beta", "hasInstallScript": true, "license": "SEE LICENSE IN LICENSE.md", "dependencies": { diff --git a/package.json b/package.json index e548ee67de..b408509073 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "anytype", - "version": "0.35.16-beta", + "version": "0.35.17-beta", "description": "Anytype", "main": "electron.js", "scripts": { From 6d6265e6121591755b1996d4db6e4862659426f7 Mon Sep 17 00:00:00 2001 From: Andrew Simachev <andrew.simachev@gmail.com> Date: Wed, 8 Nov 2023 10:08:39 +0100 Subject: [PATCH 76/88] fix styles --- src/scss/common.scss | 2 +- src/scss/theme/dark/common.scss | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/scss/common.scss b/src/scss/common.scss index f80e750344..b26b345e1c 100644 --- a/src/scss/common.scss +++ b/src/scss/common.scss @@ -48,7 +48,7 @@ input, textarea, select { font-family: 'Inter'; } } #globalFade { - position: fixed; z-index: 10000; background: $colorBgPrimary; left: 0px; top: 0px; width: 100%; height: 100%; display: none; opacity: 0; + position: fixed; z-index: 999; background: $colorBgPrimary; left: 0px; top: 0px; width: 100%; height: 100%; display: none; opacity: 0; transition: opacity 0.25s ease-in-out; } #globalFade.show { opacity: 1; } diff --git a/src/scss/theme/dark/common.scss b/src/scss/theme/dark/common.scss index 1772194868..1e817207d4 100644 --- a/src/scss/theme/dark/common.scss +++ b/src/scss/theme/dark/common.scss @@ -258,6 +258,12 @@ html.themeDark { } } + .progressBar { + .bar { + .fill.empty { background-color: $colorShapeTertiary; } + } + } + .tooltip { background: $colorShapeSecondary; color: $colorTextPrimary; } .tooltip.big { background: $colorBgSecondary; border: 1px solid rgba(229, 229, 229, 0.1); } From 8818ac955d110488ad41db36bd49b1490f821c8d Mon Sep 17 00:00:00 2001 From: Andrew Simachev <andrew.simachev@gmail.com> Date: Wed, 8 Nov 2023 12:11:25 +0100 Subject: [PATCH 77/88] JS-3329: fix --- src/scss/block/dataview/view/calendar.scss | 14 +++++++++++--- src/ts/component/block/dataview.tsx | 6 +++++- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/scss/block/dataview/view/calendar.scss b/src/scss/block/dataview/view/calendar.scss index 734ff4164d..6fe5e589b4 100644 --- a/src/scss/block/dataview/view/calendar.scss +++ b/src/scss/block/dataview/view/calendar.scss @@ -22,12 +22,20 @@ } .day { - text-align: left; vertical-align: top; border-color: $colorShapeSecondary; border-style: solid; + text-align: left; vertical-align: top; border-color: $colorShapeSecondary; border-style: solid; display: flex; flex-direction: column; border-right-width: 1px; border-top-width: 1px; padding: 6px 8px; position: relative; height: 136px; } .day.first { border-top-width: 0px; } - .day.active .number { color: $colorSystemAccent100; } - .day.other .number { color: $colorTextSecondary; } + + .day.active { + .number { + display: inline-block; color: $colorTextInversion; background-color: $colorSystemAccent100; border-radius: 12px; padding: 0px 7px; align-self: flex-end; + } + } + + .day.other { + .number { color: $colorTextSecondary; } + } .day { .number { @include text-paragraph; text-align: right; } diff --git a/src/ts/component/block/dataview.tsx b/src/ts/component/block/dataview.tsx index 9606b05908..3568ebfe70 100644 --- a/src/ts/component/block/dataview.tsx +++ b/src/ts/component/block/dataview.tsx @@ -4,7 +4,7 @@ import raf from 'raf'; import arrayMove from 'array-move'; import { observer } from 'mobx-react'; import { set } from 'mobx'; -import { I, C, UtilCommon, UtilData, UtilObject, analytics, Dataview, keyboard, Onboarding, Relation, Renderer, focus, translate, Action } from 'Lib'; +import { I, C, UtilCommon, UtilData, UtilObject, analytics, Dataview, keyboard, Onboarding, Relation, Renderer, focus, translate, Action, UtilDate } from 'Lib'; import { blockStore, menuStore, dbStore, detailStore, commonStore } from 'Store'; import Constant from 'json/constant.json'; @@ -580,6 +580,10 @@ const BlockDataview = observer(class BlockDataview extends React.Component<Props }); }; + if ((view.type == I.ViewType.Calendar) && view.groupRelationKey) { + details[view.groupRelationKey] = UtilDate.now(); + }; + for (const filter of view.filters) { if (!conditions.includes(filter.condition)) { continue; From 75064c49f365b3fd3d5aac0266f5504917603c89 Mon Sep 17 00:00:00 2001 From: Andrew Simachev <andrew.simachev@gmail.com> Date: Wed, 8 Nov 2023 12:47:44 +0100 Subject: [PATCH 78/88] fix menu maxY for navigation --- src/ts/component/menu/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ts/component/menu/index.tsx b/src/ts/component/menu/index.tsx index cee1fb3a78..fa0cefd08a 100644 --- a/src/ts/component/menu/index.tsx +++ b/src/ts/component/menu/index.tsx @@ -565,7 +565,7 @@ const Menu = observer(class Menu extends React.Component<I.Menu, State> { x = Math.min(ww - width - BORDER, x); y = Math.max(minY, y); - y = Math.min(wh - height - BORDER, y); + y = Math.min(wh - height - 80, y); if (undefined !== fixedX) x = fixedX; if (undefined !== fixedY) y = fixedY; From f63b1a44db11c4dff4bf5a9b7aed9d9b8c0a13c6 Mon Sep 17 00:00:00 2001 From: Andrew Simachev <andrew.simachev@gmail.com> Date: Wed, 8 Nov 2023 15:11:52 +0100 Subject: [PATCH 79/88] fix calendar styles --- src/scss/block/dataview/view/calendar.scss | 2 +- src/scss/theme/dark/block.scss | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/scss/block/dataview/view/calendar.scss b/src/scss/block/dataview/view/calendar.scss index 6fe5e589b4..e9709f8247 100644 --- a/src/scss/block/dataview/view/calendar.scss +++ b/src/scss/block/dataview/view/calendar.scss @@ -34,7 +34,7 @@ } .day.other { - .number { color: $colorTextSecondary; } + .number { color: $colorTextTertiary; } } .day { diff --git a/src/scss/theme/dark/block.scss b/src/scss/theme/dark/block.scss index 8c33a5bb18..38f6c46c66 100644 --- a/src/scss/theme/dark/block.scss +++ b/src/scss/theme/dark/block.scss @@ -223,6 +223,10 @@ .item { border-color: $colorShapeSecondary; } } } + + .day.other { + .number { color: $colorTextTertiary; } + } } .content { From 4ea6e7dc45c135bc93a1cd53325c2a28486bdf1f Mon Sep 17 00:00:00 2001 From: Andrew Simachev <andrew.simachev@gmail.com> Date: Thu, 9 Nov 2023 14:17:49 +0100 Subject: [PATCH 80/88] calendar hover --- src/scss/block/dataview/view/calendar.scss | 10 ++++++++-- src/scss/menu/common.scss | 2 +- src/scss/theme/dark/menu.scss | 1 + 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/scss/block/dataview/view/calendar.scss b/src/scss/block/dataview/view/calendar.scss index e9709f8247..16e39b5da6 100644 --- a/src/scss/block/dataview/view/calendar.scss +++ b/src/scss/block/dataview/view/calendar.scss @@ -23,13 +23,14 @@ .day { text-align: left; vertical-align: top; border-color: $colorShapeSecondary; border-style: solid; display: flex; flex-direction: column; - border-right-width: 1px; border-top-width: 1px; padding: 6px 8px; position: relative; height: 136px; + border-right-width: 1px; border-top-width: 1px; padding: 6px 0px; position: relative; height: 136px; } .day.first { border-top-width: 0px; } .day.active { .number { display: inline-block; color: $colorTextInversion; background-color: $colorSystemAccent100; border-radius: 12px; padding: 0px 7px; align-self: flex-end; + padding: 0px 8x; } } @@ -41,12 +42,17 @@ .number { @include text-paragraph; text-align: right; } .item { display: flex; flex-direction: row; align-items: center; gap: 0px 4px; @include text-small; @include text-overflow-nw; - margin: 0px 0px 2px 0px; + margin: 0px 0px 2px 0px; position: relative; padding: 0px 8px; } .item { .iconObject { flex-shrink: 0; } .name { @include text-overflow-nw; } } + .item::before { + content: ""; position: absolute; left: 0px; top: 0px; width: 100%; height: 100%; background: rgba(79,79,79,0); z-index: 1; + pointer-events: none; + } + .item:hover::before { background: $colorShapeHighlightMedium; } .item.more { display: block; color: $colorTextSecondary; } } diff --git a/src/scss/menu/common.scss b/src/scss/menu/common.scss index 9dcc10bcb8..d251cf5dd8 100644 --- a/src/scss/menu/common.scss +++ b/src/scss/menu/common.scss @@ -87,7 +87,7 @@ .item.isReadonly { cursor: default; } .item::before { - content: ""; position: absolute; left: 0px; top: 0px; width: 100%; height: 100%; background: rgba(80,73,28,0); z-index: 1; + content: ""; position: absolute; left: 0px; top: 0px; width: 100%; height: 100%; background: rgba(79,79,79,0); z-index: 1; pointer-events: none; } .item.hover::before { background: $colorShapeHighlightMedium; } diff --git a/src/scss/theme/dark/menu.scss b/src/scss/theme/dark/menu.scss index 2c1e2ec6b3..fc4e547bb3 100644 --- a/src/scss/theme/dark/menu.scss +++ b/src/scss/theme/dark/menu.scss @@ -52,6 +52,7 @@ .separator .inner { background: $colorShapeSecondary; } .item { background: none; } + .item::before { background: rgba(238, 238, 238, 0.12); } .item.hover::before { background: $colorShapeHighlightMedium; } .item { .icon.delete:hover, .icon.more:hover { background-color: $colorShapeHighlightMedium; } From 2e3f3574b8d9b26d9a37931cca0460e7d982d31a Mon Sep 17 00:00:00 2001 From: Andrew Simachev <andrew.simachev@gmail.com> Date: Thu, 9 Nov 2023 14:18:59 +0100 Subject: [PATCH 81/88] remove recent offset --- src/ts/component/widget/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ts/component/widget/index.tsx b/src/ts/component/widget/index.tsx index 3680f740d9..0b62d59a03 100644 --- a/src/ts/component/widget/index.tsx +++ b/src/ts/component/widget/index.tsx @@ -403,7 +403,7 @@ const WidgetIndex = observer(class WidgetIndex extends React.Component<Props> { }; case Constant.widgetId.recentEdit: { - filters.push({ operator: I.FilterOperator.And, relationKey: 'lastModifiedDate', condition: I.FilterCondition.Greater, value: space.createdDate + 60 }); + filters.push({ operator: I.FilterOperator.And, relationKey: 'lastModifiedDate', condition: I.FilterCondition.Greater, value: space.createdDate }); break; }; From 01694fec2d4b4af7e32e7d64d594a1e3d03fe5eb Mon Sep 17 00:00:00 2001 From: Andrew Simachev <andrew.simachev@gmail.com> Date: Thu, 9 Nov 2023 14:41:39 +0100 Subject: [PATCH 82/88] fix menu hover --- src/scss/theme/dark/menu.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scss/theme/dark/menu.scss b/src/scss/theme/dark/menu.scss index fc4e547bb3..f03c6b677f 100644 --- a/src/scss/theme/dark/menu.scss +++ b/src/scss/theme/dark/menu.scss @@ -52,7 +52,7 @@ .separator .inner { background: $colorShapeSecondary; } .item { background: none; } - .item::before { background: rgba(238, 238, 238, 0.12); } + .item::before { background: rgba(238, 238, 238, 0); } .item.hover::before { background: $colorShapeHighlightMedium; } .item { .icon.delete:hover, .icon.more:hover { background-color: $colorShapeHighlightMedium; } From 0f6a0c7506f86a790ca9258c9b8ef88c04591ecb Mon Sep 17 00:00:00 2001 From: Andrew Simachev <andrew.simachev@gmail.com> Date: Thu, 9 Nov 2023 19:29:23 +0100 Subject: [PATCH 83/88] JS-3340: fix --- src/ts/component/menu/space.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ts/component/menu/space.tsx b/src/ts/component/menu/space.tsx index f389e4ca83..257030a137 100644 --- a/src/ts/component/menu/space.tsx +++ b/src/ts/component/menu/space.tsx @@ -103,7 +103,7 @@ const MenuSpace = observer(class MenuSpace extends React.Component<I.Menu> { }; componentDidUpdate (): void { - this.beforePosition(); + this.props.position(); }; componentWillUnmount (): void { From b3fd1a14aba24e9af5865d8bd21fe3a285ab04d5 Mon Sep 17 00:00:00 2001 From: Andrew Simachev <andrew.simachev@gmail.com> Date: Thu, 9 Nov 2023 19:39:49 +0100 Subject: [PATCH 84/88] JS-3245: fix --- src/scss/page/main/store.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/scss/page/main/store.scss b/src/scss/page/main/store.scss index aeb2b5b00b..02a66979f8 100644 --- a/src/scss/page/main/store.scss +++ b/src/scss/page/main/store.scss @@ -29,6 +29,10 @@ @media (max-width: 960px) { .title { @include text-header1; } } + + @media (max-width: 660px) { + .title { @include text-header2; } + } } .tabs { white-space: nowrap; text-align: left; display: flex; flex-direction: row; gap: 0px 24px; } From 96386cad28a0cf91223367a33653f2a918d5e7cb Mon Sep 17 00:00:00 2001 From: Andrew Simachev <andrew.simachev@gmail.com> Date: Thu, 9 Nov 2023 20:06:12 +0100 Subject: [PATCH 85/88] JS-3286: fix --- src/ts/component/block/dataview.tsx | 2 +- src/ts/docs/help/onboarding.ts | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/ts/component/block/dataview.tsx b/src/ts/component/block/dataview.tsx index 3568ebfe70..ad6389fff8 100644 --- a/src/ts/component/block/dataview.tsx +++ b/src/ts/component/block/dataview.tsx @@ -247,7 +247,7 @@ const BlockDataview = observer(class BlockDataview extends React.Component<Props const eventName = this.isCollection() ? 'ScreenCollection' : 'ScreenSet'; analytics.event(eventName, { embedType: analytics.embedType(isInline) }); - if (!isInline && Onboarding.isCompleted('mainSet') && this.isAllowedObject()) { + if (!isInline && Onboarding.isCompleted('mainSet') && this.isAllowedObject() && this.isAllowedDefaultType()) { Onboarding.start('setSettings', isPopup); }; }; diff --git a/src/ts/docs/help/onboarding.ts b/src/ts/docs/help/onboarding.ts index 64fa76c36c..9ef74eee70 100644 --- a/src/ts/docs/help/onboarding.ts +++ b/src/ts/docs/help/onboarding.ts @@ -53,9 +53,6 @@ export default { buttonText: translate('onboardingMainSet3Button'), } ], - onComplete: (force: boolean) => { - Onboarding.start('setSettings', keyboard.isPopup(), force); - }, param: { element: '#page.isFull #footer #button-help', classNameWrap: 'fixed', From f54e6460a0c12fff22f0c4af25feff566924e8b7 Mon Sep 17 00:00:00 2001 From: Andrew Simachev <andrew.simachev@gmail.com> Date: Thu, 9 Nov 2023 20:14:07 +0100 Subject: [PATCH 86/88] JS-3334: fix --- src/ts/component/menu/dataview/source.tsx | 11 ++--------- src/ts/lib/api/dispatcher.ts | 1 + 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/ts/component/menu/dataview/source.tsx b/src/ts/component/menu/dataview/source.tsx index 3d7353ef07..6bd62f97d3 100644 --- a/src/ts/component/menu/dataview/source.tsx +++ b/src/ts/component/menu/dataview/source.tsx @@ -161,16 +161,9 @@ const MenuSource = observer(class MenuSource extends React.Component<I.Menu> { save (value: string[], callBack?: () => void) { const { param } = this.props; const { data } = param; - const { objectId, blockId } = data; - - C.ObjectSetSource(objectId, value, () => { - $(window).trigger(`updateDataviewData.${blockId}`); - - if (callBack) { - callBack(); - }; - }); + const { objectId } = data; + C.ObjectSetSource(objectId, value, callBack); this.forceUpdate(); }; diff --git a/src/ts/lib/api/dispatcher.ts b/src/ts/lib/api/dispatcher.ts index 4246c0495a..a0ef69a7c4 100644 --- a/src/ts/lib/api/dispatcher.ts +++ b/src/ts/lib/api/dispatcher.ts @@ -1076,6 +1076,7 @@ class Dispatcher { if (undefined !== details.setOf) { blockStore.updateWidgetData(rootId); + $(window).trigger(`updateDataviewData.dataview`); }; blockStore.checkTypeSelect(rootId); From 2b80f5407460a5303b860205535fb9f10a1f6b95 Mon Sep 17 00:00:00 2001 From: Andrew Simachev <andrew.simachev@gmail.com> Date: Fri, 10 Nov 2023 10:14:24 +0100 Subject: [PATCH 87/88] JS-3316: new texts --- src/json/text.json | 7 +++++-- src/ts/docs/help/onboarding.ts | 5 ++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/json/text.json b/src/json/text.json index d9e58deef4..884d9fd417 100644 --- a/src/json/text.json +++ b/src/json/text.json @@ -1512,11 +1512,14 @@ "onboardingDefaultTypeTitle": "Change Types Easily", "onboardingDefaultTypeDescription": "You can change type and template of a new object in this menu.", - "onboardingCalendarDescription": "Check out the calendar view.", + "onboardingCalendarTitle": "New Calendar View", + "onboardingCalendarDescription": "Display objects on a calendar based on selected date attributes.", + "onboardingTemplateSelectTitle": "New Template Selector", "onboardingTemplateSelectDescription": "Easily switch your templates when creating objects.", - "onboardingSpaceSelect": "Here is your Spaces selector! Switch between spaces or create a new one.", + "onboardingSpaceSelectTitle": "Meet Multiple Spaces", + "onboardingSpaceSelectDescription": "Click your profile icon to access the space selector. Switch between spaces or create new ones here.", "libDataviewRelations": "Relations", "libDataviewGroups": "Groups", diff --git a/src/ts/docs/help/onboarding.ts b/src/ts/docs/help/onboarding.ts index 9ef74eee70..193469215b 100644 --- a/src/ts/docs/help/onboarding.ts +++ b/src/ts/docs/help/onboarding.ts @@ -371,6 +371,7 @@ export default { }, { + name: translate('onboardingCalendarTitle'), description: translate('onboardingCalendarDescription'), param: { element: '#button-dataview-settings', @@ -387,6 +388,7 @@ export default { { items: [ { + name: translate('onboardingTemplateSelectTitle'), description: translate('onboardingTemplateSelectDescription'), }, ], @@ -404,7 +406,8 @@ export default { { items: [ { - description: translate('onboardingSpaceSelect'), + name: translate('onboardingSpaceSelectTitle'), + description: translate('onboardingSpaceSelectDescription'), }, ], From f7abf7cb0517b9763d8f3e9a4081f42645e20414 Mon Sep 17 00:00:00 2001 From: Andrew Simachev <andrew.simachev@gmail.com> Date: Fri, 10 Nov 2023 12:05:42 +0100 Subject: [PATCH 88/88] JS-3347: fix --- src/ts/component/block/dataview.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ts/component/block/dataview.tsx b/src/ts/component/block/dataview.tsx index ad6389fff8..7b5e519f37 100644 --- a/src/ts/component/block/dataview.tsx +++ b/src/ts/component/block/dataview.tsx @@ -371,7 +371,9 @@ const BlockDataview = observer(class BlockDataview extends React.Component<Props this.setState({ loading: true }); }; - const filters = []; + const filters = [ + { operator: I.FilterOperator.And, relationKey: 'layout', condition: I.FilterCondition.NotIn, value: [ I.ObjectLayout.Option, I.ObjectLayout.SpaceView, I.ObjectLayout.Space ] }, + ]; if (this.searchIds) { filters.push({ operator: I.FilterOperator.And, relationKey: 'id', condition: I.FilterCondition.In, value: this.searchIds || [] }); };