1
0
Fork 0
mirror of https://github.com/anyproto/anytype-ts.git synced 2025-06-10 01:51:10 +09:00
This commit is contained in:
Andrew Simachev 2023-04-26 14:37:11 +02:00
commit 8e2777c900
No known key found for this signature in database
GPG key ID: 49A163D0D14E6FD8
108 changed files with 1019 additions and 815 deletions

23
dist/workers/graph.js vendored
View file

@ -71,6 +71,7 @@ let isHovering = false;
let edgeMap = new Map();
let hoverAlpha = 0.2;
let fontFamily = 'Helvetica';
let timeoutHover = 0;
addEventListener('message', ({ data }) => {
if (this[data.id]) {
@ -577,21 +578,32 @@ onSelect = ({ x, y, selectRelated }) => {
};
onMouseMove = ({ x, y }) => {
isHovering = false;
const active = nodes.find(d => d.isOver);
const d = getNodeByCoords(x, y);
if (active) {
active.isOver = false;
};
const d = getNodeByCoords(x, y);
if (d) {
d.isOver = true;
isHovering = true;
} else {
isHovering = false;
};
send('onMouseMove', { node: (d ? d.id : ''), x, y, k: transform.k });
redraw();
clearTimeout(timeoutHover);
timeoutHover = setTimeout(() => {
const d = getNodeByCoords(x, y);
if (d) {
isHovering = true;
};
send('onMouseMove', { node: (d ? d.id : ''), x, y, k: transform.k });
redraw();
}, 300);
};
onContextMenu = ({ x, y }) => {
@ -619,13 +631,14 @@ onAddNode = ({ target, sourceId }) => {
if (sourceId) {
const source = nodes.find(it => it.id == sourceId);
if (!source) {
return;
};
x = source.x + target.radius * 2;
y = source.y + target.radius * 2;
data.edges.push({ type: EdgeType.Link, source: source.id, target: target.id });
};

View file

@ -308,7 +308,7 @@ class MenuManager {
Separator,
{ label: 'Space debug', click: () => { show(); Util.send(this.win, 'command', 'debugSync'); } },
{ label: 'Space debug', click: () => { show(); Util.send(this.win, 'command', 'debugSpace'); } },
{ label: 'Tree diagnostics', click: () => { show(); Util.send(this.win, 'command', 'debugTree'); } },
Separator,

View file

@ -1 +1 @@
0.26.0-rc9
0.26.0-rc11

237
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
{
"name": "anytype",
"version": "0.31.22-alpha",
"version": "0.31.26-alpha",
"description": "Anytype",
"main": "electron.js",
"scripts": {
@ -69,6 +69,7 @@
"npm-run-all": "^4.1.5",
"patch-package": "^6.4.7",
"prettier": "^2.7.1",
"sass": "^1.62.0",
"sass-loader": "^8.0.2",
"source-map-loader": "^0.2.4",
"style-loader": "^1.2.1",
@ -102,7 +103,7 @@
"file-type": "^12.4.2",
"findandreplacedomtext": "^0.4.6",
"google-protobuf": "^3.14.0",
"grpc-web": "^1.2.1",
"grpc-web": "^1.4.2",
"history": "^4.10.1",
"inputmask": "^5.0.5",
"install": "^0.13.0",
@ -549,4 +550,4 @@
"pre-commit": "npm run precommit && git add licenses.json"
}
}
}
}

View file

@ -1,9 +1,3 @@
<svg width="16" height="18" viewBox="0 0 16 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="8" cy="9" r="2.5" fill="#b6b6b6"/>
<circle cx="8" cy="15.5" r="2" fill="#b6b6b6"/>
<circle cx="8" cy="2.5" r="2" fill="#b6b6b6"/>
<circle cx="14" cy="12.5" r="2" fill="#b6b6b6"/>
<circle cx="2" cy="5.5" r="2" fill="#b6b6b6"/>
<circle cx="14" cy="5.5" r="2" fill="#b6b6b6"/>
<circle cx="2" cy="12.5" r="2" fill="#b6b6b6"/>
</svg>
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.0002 5.5C11.1048 5.5 12.0002 4.60457 12.0002 3.5C12.0002 2.39543 11.1048 1.5 10.0002 1.5C8.89561 1.5 8.00018 2.39543 8.00018 3.5C8.00018 4.60457 8.89561 5.5 10.0002 5.5ZM12.5 10C12.5 11.3807 11.3807 12.5 10 12.5C8.61929 12.5 7.5 11.3807 7.5 10C7.5 8.61929 8.61929 7.5 10 7.5C11.3807 7.5 12.5 8.61929 12.5 10ZM12.0002 16.5C12.0002 17.6046 11.1048 18.5 10.0002 18.5C8.89561 18.5 8.00018 17.6046 8.00018 16.5C8.00018 15.3954 8.89561 14.5 10.0002 14.5C11.1048 14.5 12.0002 15.3954 12.0002 16.5ZM18 13.5C18 14.6046 17.1046 15.5 16 15.5C14.8954 15.5 14 14.6046 14 13.5C14 12.3954 14.8954 11.5 16 11.5C17.1046 11.5 18 12.3954 18 13.5ZM4 8.5C5.10457 8.5 6 7.60457 6 6.5C6 5.39543 5.10457 4.5 4 4.5C2.89543 4.5 2 5.39543 2 6.5C2 7.60457 2.89543 8.5 4 8.5ZM18 6.5C18 7.60457 17.1046 8.5 16 8.5C14.8954 8.5 14 7.60457 14 6.5C14 5.39543 14.8954 4.5 16 4.5C17.1046 4.5 18 5.39543 18 6.5ZM4 15.5C5.10457 15.5 6 14.6046 6 13.5C6 12.3954 5.10457 11.5 4 11.5C2.89543 11.5 2 12.3954 2 13.5C2 14.6046 2.89543 15.5 4 15.5Z" fill="#B6B6B6"/>
</svg>

Before

Width:  |  Height:  |  Size: 437 B

After

Width:  |  Height:  |  Size: 1.1 KiB

Before After
Before After

View file

@ -18,7 +18,9 @@ $colorGreen: #57c600;
$colorBorderLight: #ebebeb;
$colorBorderDark: #e3e3e3;
$colorSecondary: #d4d4d4;
$colorHover: rgba(79,79,79,0.08);
$colorHoverMedium: rgba(79,79,79,0.08);
$colorHoverLight: rgba(79,79,79,0.04);
$easeInQuint: cubic-bezier(0.22, 1, 0.36, 1);
$transitionCommon: 0.1s $easeInQuint;

View file

@ -46,7 +46,7 @@
}
.btn {
font-weight: 500; font-size: 14px; height: 28px; line-height: 28px; cursor: pointer; display: inline-block;
font-weight: 500; font-size: 14px; height: 28px; line-height: 28px; display: inline-block;
padding: 0px 8px; border-radius: 6px; margin-right: 8px; white-space: nowrap; transition: background $transitionCommon;
}
.btn:last-child { margin: 0px; }

View file

@ -55,7 +55,7 @@
padding: 4px; border-radius: 4px; transition: $transitionAllCommon; cursor: pointer; display: flex; align-items: center;
line-height: 20px; @include text-small; color: $colorMediumGrey;
}
.iconWrap:hover { background-color: $colorHover; }
.iconWrap:hover { background-color: $colorHoverMedium; }
.iconWrap.icon { flex-shrink: 0; }
.iconWrap {
.icon { width: 20px; height: 20px; }
@ -92,7 +92,7 @@
.side.left { padding-left: 14px; }
.icon { cursor: pointer; position: relative; width: 28px; height: 28px; background-size: 20px; border-radius: 4px; transition: $transitionAllCommon; }
.icon:hover, .icon.active { background-color: $colorHover; }
.icon:hover, .icon.active { background-color: $colorHoverMedium; }
.icon.filter { background-image: url('~img/icon/dataview/button/filter0.svg'); }
.icon.filter.on { background-image: url('~img/icon/dataview/button/filter1.svg'); }
@ -139,7 +139,7 @@
}
.element.black { color: $colorBlack; }
.element.orange { color: #f09c0e; font-weight: 500; }
.element:hover { background-color: $colorHover; }
.element:hover { background-color: $colorHoverMedium; }
}
}

View file

@ -45,7 +45,7 @@
flex-shrink: 0; width: 24px; height: 24px; background-size: 20px; border-radius: 4px; cursor: pointer; vertical-align: top;
opacity: 0;
}
.icon:hover { background-color: $colorHover; }
.icon:hover { background-color: $colorHoverMedium; }
.icon.more { background-image: url('~img/icon/menu/action/more0.svg'); }
.icon.add { background-image: url('~img/icon/plus/menu0.svg'); }
@ -86,7 +86,7 @@
}
.cardContent {
border: 1px solid $colorHover; border-radius: 12px; padding: 16px; background: $colorWhite; transition: border-color $transitionCommon;
border: 1px solid $colorHoverMedium; border-radius: 12px; padding: 16px; background: $colorWhite; transition: border-color $transitionCommon;
}
.cellContent {

View file

@ -7,7 +7,7 @@
.galleryWrap { margin-left: 14px; }
.card {
width: 260px; border: 1px solid $colorHover; transition: border-color $transitionCommon; border-radius: 12px; display: inline-block;
width: 260px; border: 1px solid $colorHoverMedium; transition: border-color $transitionCommon; border-radius: 12px; display: inline-block;
cursor: pointer; background: $colorWhite; overflow: hidden;
}
.card {
@ -15,7 +15,7 @@
.cover {
position: relative; aspect-ratio: 7/3; background-position: top center; display: flex; align-items: center;
background-color: $colorHover; width: 100%; justify-content: center;
background-color: $colorHoverMedium; width: 100%; justify-content: center;
}
.cover {

View file

@ -13,8 +13,8 @@
.bullet { width: 4px; height: 4px; border-radius: 100%; background: $colorDarkGrey; display: inline-block; vertical-align: middle; margin: 0px 2px; }
.cellContent { display: inline; border-radius: 4px; vertical-align: top; padding: 5.5px 6px; transition: background $transitionCommon; cursor: pointer; }
.cellContent:hover, .cellContent.hover { background: $colorHover; }
.cellContent { display: inline; border-radius: 4px; vertical-align: top; padding: 5.5px 6px; transition: background $transitionCommon; }
.cellContent:hover, .cellContent.hover { background: $colorHoverMedium; }
.cellContent > .wrap { display: inline; }
.cellContent.isName .name { display: inline; }
.cellContent {

View file

@ -38,7 +38,7 @@
}
.cell { @include text-common; width: 70%; position: relative; padding: 5px 8px; border-radius: 4px; transition: background $transitionCommon; }
.cell.canEdit:hover { background: $colorHover; }
.cell.canEdit:hover { background: $colorHoverMedium; }
.cell.c-select { padding: 4px 8px; }
.cell.c-select {

View file

@ -20,10 +20,7 @@
.selectionFrame.bottom { border-width: 0px; border-bottom-width: 2px; border-radius: 0px; }
}
.handle {
cursor: pointer; z-index: 11; position: absolute; display: none; transition: none; padding: 6px;
transform: translateX(-50%) translateY(-50%);
}
.handle { z-index: 11; position: absolute; display: none; transition: none; padding: 6px; transform: translateX(-50%) translateY(-50%); }
.handle.canDrag { cursor: grab; }
.handle {
@ -51,7 +48,7 @@
.plusButton { z-index: 10; }
.plusButton {
.icon {
background-color: $colorBorderLight; background-image: url('~img/icon/table/plus.svg'); background-size: 10px; cursor: pointer; opacity: 0;
background-color: $colorBorderLight; background-image: url('~img/icon/table/plus.svg'); background-size: 10px; opacity: 0;
transition: $transitionAllCommon; width: 100%; height: 100%; border-radius: 4px;
}
}
@ -173,7 +170,7 @@
.placeholder { display: none !important; }
}
.icon.menu { width: 20px; height: 100%; position: absolute; right: 0px; top: 0px; z-index: 2; cursor: pointer; opacity: 0; pointer-events: none; }
.icon.menu { width: 20px; height: 100%; position: absolute; right: 0px; top: 0px; z-index: 2; cursor: default; opacity: 0; pointer-events: none; }
.icon.menu {
.inner {
width: 8px; height: 20px; border-radius: 4px; background-image: url('~img/icon/table/handle/cell.svg'); background-size: 8px 16px;

View file

@ -12,7 +12,7 @@
position: relative; padding: 3px 8px; cursor: pointer; border-radius: 2px; border-radius: 6px; border: 1px solid $colorBorderDark;
display: inline-block; display: flex; align-items: center; gap: 0px 4px; color: $colorDarkGrey; @include text-overflow-nw;
}
.item.hover, .item.active { background: $colorHover; }
.item.hover, .item.active { background: $colorHoverMedium; }
.item {
.icon { flex-shrink: 0; }

View file

@ -23,10 +23,10 @@
.button.dark:not(.disabled):hover { background: rgba(0,0,0,0.4); }
.button.blank { background: none; border: solid 1px $colorBorderDark; font-weight: 400; }
.button.blank:not(.disabled):hover { background: $colorHover; }
.button.blank:not(.disabled):hover { background: $colorHoverMedium; }
.button.outlined { background: none; border: solid 1px $colorBorderDark; color: $colorBlack; }
.button.outlined:not(.disabled):hover { background: $colorHover; }
.button.outlined:not(.disabled):hover { background: $colorHoverMedium; }
.button.c36 { @include text-common; height: 36px; border-radius: 6px; padding: 0px 12px; }
.button.c28 { @include text-small; height: 28px; border-radius: 6px; padding: 0px 10px; }

View file

@ -17,8 +17,8 @@
.editor {
.icon.buttonAdd {
width: 20px; height: 20px; position: absolute; z-index: 5; cursor: pointer; user-select: none;
background-image: url('~img/icon/block/add.svg'); transition: opacity 0.075s ease-in-out, transform 0.075s ease-in-out; display: none;
width: 20px; height: 20px; position: absolute; z-index: 5; user-select: none; background-image: url('~img/icon/block/add.svg');
transition: opacity 0.075s ease-in-out, transform 0.075s ease-in-out; display: none;
}
.icon.buttonAdd.show { display: block; }
@ -35,11 +35,11 @@
.controlButtons { position: absolute; bottom: 0px; width: 100%; display: flex; flex-direction: row; align-items: center; gap: 0px 8px; }
.btn {
background: $colorWhite; font-weight: 500; font-size: 14px; color: $colorMediumGrey; cursor: pointer; display: inline-block;
background: $colorWhite; font-weight: 500; font-size: 14px; color: $colorMediumGrey; display: inline-block;
transition: background $transitionCommon, color $transitionCommon; height: 28px; padding: 0px 8px 0px 6px; border-radius: 6px; display: flex;
flex-direction: row; align-items: center;
}
.btn:hover, .btn.hover { background: $colorHover; color: $colorBlack; }
.btn:hover, .btn.hover { background: $colorHoverMedium; color: $colorBlack; }
.btn {
.icon { width: 20px; height: 20px; margin-right: 4px; }

View file

@ -7,14 +7,24 @@
opacity: 0.6;
}
.icon { cursor: pointer; z-index: 10; }
.icon.big {
width: 44px; height: 44px; background-color: $colorWhite; box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.2); border-radius: 100%;
background-size: 20px 20px;
.iconWrap { width: 44px; height: 44px; position: relative; cursor: pointer; z-index: 10; position: absolute; bottom: 14px; }
.iconWrap {
.bg {
background-color: $colorWhite; box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.2); border-radius: 100%; width: 100%; height: 100%;
position: absolute; left: 0px; top: 0px; transition: transform 0.3s $easeInQuint;
}
.icon { width: 20px; height: 20px; position: absolute; left: 50%; top: 50%; margin: -10px 0px 0px -10px; z-index: 1; }
}
.iconWrap:hover .bg { transform: scale(0.95); }
#button-add { position: absolute; left: 14px; bottom: 14px; background-image: url('~img/icon/sidebar/add.svg'); }
#button-help { position: absolute; right: 14px; bottom: 14px; }
#button-add { left: 14px; }
#button-add {
.icon { background-image: url('~img/icon/sidebar/add.svg'); }
}
#button-help { right: 14px; }
#button-help {
.icon { background-image: url('~img/icon/footer/help.svg'); }
}
}
.footer.snapRight { left: 0px; }

View file

@ -13,7 +13,7 @@
.side { height: 100%; display: flex; align-items: center; flex-direction: row; }
.side.left { padding: 0px 6px; width: 20%; flex-shrink: 0; }
.side.center { width: 60%; flex-grow: 1; justify-content: center; }
.side.right { padding: 0px 10px; width: 20%; flex-shrink: 0; justify-content: end; gap: 0px 16px; }
.side.right { padding: 0px 12px; width: 20%; flex-shrink: 0; justify-content: end; gap: 0px 16px; }
.path {
width: 66%; display: inline-block; border-radius: 6px; height: 28px; line-height: 26px; cursor: pointer; transition: $transitionAllCommon;
@ -23,7 +23,7 @@
.tabs { @include text-paragraph; display: inline-flex; flex-direction: row; align-items: center; height: 100%; }
.tabs {
.tab {
font-weight: 700; cursor: pointer; color: $colorMediumGrey; transition: $transitionAllCommon; text-align: center;
font-weight: 700; color: $colorMediumGrey; transition: $transitionAllCommon; text-align: center;
vertical-align: top; padding: 0px 16px; display: flex; align-items: center; height: 100%; border-bottom: 1px solid rgba(0,0,0,0);
}
.tab:hover { color: $colorBlack; }
@ -32,9 +32,9 @@
.icon { -webkit-app-region: no-drag; flex-shrink: 0; }
.icon.big { width: 28px; height: 28px; background-size: 20px; border-radius: 6px; cursor: pointer; }
.icon.big.expand, .icon.big.toggleSidebar { width: 32px; margin-right: 10px; }
.icon.big.nav, .icon.big.graph { width: 32px; margin-left: 10px; }
.icon.big { width: 28px; height: 28px; background-size: 20px; border-radius: 6px; }
.icon.big.expand, .icon.big.toggleSidebar { margin-right: 12px; }
.icon.big.nav, .icon.big.graph { margin-left: 12px; }
.icon.big:hover, .icon.big.hover { background-color: $colorVeryLightGrey; }
.icon.back { background-image: url('~img/icon/header/back.svg'); }
@ -140,7 +140,7 @@ html.platformMac {
}
.header.withSidebar.snapLeft {
.side.left { padding-left: 6px; }
.side.left { padding-left: 12px; }
}
}

View file

@ -13,8 +13,6 @@
.icon.back, .icon.forward { background-image: url('~img/icon/back.svg'); }
.icon.forward { transform: rotateZ(180deg); }
.icon.help { width: 44px; height: 44px; background-image: url('~img/icon/footer/help.svg'); }
.icon.toggleSidebar { background-image: url('~img/icon/sidebar/toggle-sidebar.svg'); }
.icon.lock { width: 8px !important; height: 20px !important; background-image: url('~img/icon/lock.svg'); }

View file

@ -11,7 +11,7 @@
.icon.plus { width: 28px; height: 28px; position: absolute; left: 50%; top: 50%; margin: -14px 0px 0px -14px; background-image: url('~img/icon/plus/templateBig.svg'); }
}
.item:before {
content: ""; background: $colorHover; position: absolute; left: 0px; top: 0px; width: 100%; height: 100%;
content: ""; background: $colorHoverMedium; position: absolute; left: 0px; top: 0px; width: 100%; height: 100%;
z-index: 2; height: 216px; border-radius: 8px; display: none; pointer-events: none;
}

View file

@ -22,7 +22,7 @@
.button.disabled { background: $colorVeryLightGrey; max-width: 80px; }
.button.edit {
box-shadow: 0px 0px; background: $colorHover; border-radius: 6px; @include text-common; color: $colorBlack; line-height: 26px; width: auto;
box-shadow: 0px 0px; background: $colorHoverMedium; border-radius: 6px; @include text-common; color: $colorBlack; line-height: 26px; width: auto;
padding: 0px 10px;
}
}

View file

@ -11,15 +11,11 @@
.name span { display: inline-block; min-width: 100%; height: 100%; @include clamp1; }
.icon { vertical-align: top; transition: none; }
.icon.play {
width: 20px; height: 20px; margin-right: 6px; background-image: url('~img/icon/audio/play.svg');
cursor: pointer; margin-left: -4px;
width: 20px; height: 20px; margin-right: 6px; background-image: url('~img/icon/audio/play.svg'); cursor: pointer; margin-left: -4px;
}
.icon.play.active { background-image: url('~img/icon/audio/pause.svg'); }
.icon.volume {
width: 20px; height: 20px; margin-right: 6px; background-image: url('~img/icon/audio/volume.svg');
cursor: pointer; margin-left: -2px;
}
.icon.volume { width: 20px; height: 20px; margin-right: 6px; background-image: url('~img/icon/audio/volume.svg'); cursor: pointer; margin-left: -2px; }
.icon.volume.active { background-image: url('~img/icon/audio/mute.svg'); }
.time { @include text-small; text-align: right; line-height: 20px; position: absolute; right: 0px; bottom: 0px; }
@ -29,7 +25,7 @@
.icon { width: 6px; height: 6px; border: 0px; background: none; }
.bullet { width: 6px; height: 6px; border-radius: 100%; background: #f09c0e; }
.fill { background: #f09c0e; }
.back { background: $colorHover; }
.back { background: $colorHoverMedium; }
}
#time { margin: 6px 0px; width: 100%; display: block; }

View file

@ -20,7 +20,7 @@
> .head { height: 52px; cursor: default; }
> .head {
.icon { display: block; }
.icon:hover { background-color: $colorHover; }
.icon:hover { background-color: $colorHoverMedium; }
}
}
.sidebar.anim { transition-property: left, top, box-shadow, transform; transition-duration: 0.2s; transition-timing-function: ease-in-out; }
@ -47,10 +47,10 @@
> .top { display: flex; flex-direction: row-reverse; }
> .body { height: calc(100% - 52px); padding: 0px 12px 12px 12px; position: relative; flex-grow: 1; overflow: hidden; overscroll-behavior: none; }
> .head { display: flex; flex-direction: row; align-items: center; justify-content: flex-end; padding: 0px 12px; height: 12px; cursor: grab; }
> .head { display: flex; flex-direction: row; align-items: center; justify-content: flex-end; padding: 0px 16px 0px 0px; height: 12px; cursor: grab; }
> .head {
.icon { width: 32px; height: 28px; cursor: pointer; background-size: 20px; cursor: pointer; border-radius: 6px; display: none; }
.icon:hover { background-color: $colorHover; }
.icon { width: 28px; height: 28px; background-size: 20px; border-radius: 6px; display: none; }
.icon:hover { background-color: $colorHoverMedium; }
}
}
.sidebar:hover {

View file

@ -2,7 +2,7 @@
.sync {
background: $colorVeryLightGrey; border-radius: 4px; @include text-small; padding: 0px 6px; display: inline-block; vertical-align: middle;
color: $colorDarkGrey; white-space: nowrap; height: 18px; display: flex; align-items: center; gap: 0px 4px; cursor: pointer;
color: $colorDarkGrey; white-space: nowrap; height: 18px; display: flex; align-items: center; gap: 0px 4px;
}
.sync {
.bullet { width: 8px; height: 8px; border-radius: 100%; background: $colorBorderLight; }

View file

@ -15,8 +15,8 @@
}
.iconWrap { width: 24px; height: 24px; border-radius: 4px; cursor: default; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.iconWrap:hover { background-color: $colorHover; }
.iconWrap.active { opacity: 1; background-color: $colorHover; }
.iconWrap:hover { background-color: $colorHoverMedium; }
.iconWrap.active { opacity: 1; background-color: $colorHoverMedium; }
.icon { width: 20px; height: 20px; flex-shrink: 0; }
.icon.back { background-image: url('~img/icon/widget/back.svg'); }
@ -52,7 +52,7 @@
.head {
.clickable { width: calc(100% - 60px); }
.buttons { display: flex; }
.iconWrap.options { background-color: $colorHover; }
.iconWrap.options { background-color: $colorHoverMedium; }
}
}

View file

@ -41,11 +41,11 @@
}
.item.active {
.icon.more { background-color: $colorHover; }
.icon.more { background-color: $colorHoverMedium; }
}
.item::before {
content: ""; position: absolute; left: 0px; top: 0px; width: 100%; height: 100%; background: $colorHover; z-index: 1; pointer-events: none;
content: ""; position: absolute; left: 0px; top: 0px; width: 100%; height: 100%; background: $colorHoverMedium; z-index: 1; pointer-events: none;
border-radius: 8px; opacity: 0;
}
.item:hover::before { opacity: 1; }
@ -63,8 +63,8 @@
.buttons { flex-shrink: 0; display: flex; flex-direction: row; align-items: center; gap: 0px 6px; display: none; }
.buttons {
.icon { width: 24px; height: 24px; border-radius: 4px; cursor: pointer; flex-shrink: 0; background-size: 20px; z-index: 2; cursor: default; }
.icon:hover { background-color: $colorHover; }
.icon.active { opacity: 1; background-color: $colorHover; }
.icon:hover { background-color: $colorHoverMedium; }
.icon.active { opacity: 1; background-color: $colorHoverMedium; }
.icon.more { background-image: url('~img/icon/menu/action/more0.svg'); }
}
}

View file

@ -18,7 +18,7 @@
.side.right { flex-shrink: 0; display: none; }
.icon { width: 28px; height: 28px; border-radius: 4px; background-size: 20px; }
.icon:hover { background-color: $colorHover; }
.icon:hover { background-color: $colorHoverMedium; }
.icon.settings { background-image: url('~img/icon/widget/settings.svg'); }
}

View file

@ -10,7 +10,7 @@
height: 28px; padding: 0px 8px;
}
.inner::before {
content: ""; position: absolute; left: 0px; top: 0px; width: 100%; height: 100%; background: $colorHover; z-index: 1; pointer-events: none;
content: ""; position: absolute; left: 0px; top: 0px; width: 100%; height: 100%; background: $colorHoverMedium; z-index: 1; pointer-events: none;
border-radius: 4px; opacity: 0;
}
.inner:hover::before, .inner.hover::before { opacity: 1; }
@ -21,7 +21,7 @@
.arrowWrap { width: 24px; height: 24px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; cursor: default; }
.arrowWrap:hover {
.icon.arrow { background-color: $colorHover; }
.icon.arrow { background-color: $colorHoverMedium; }
}
.icon { width: 20px; height: 20px; flex-shrink: 0; transition: background $transitionCommon; border-radius: 4px; cursor: default; }
@ -39,8 +39,8 @@
.buttons { flex-shrink: 0; flex-direction: row; align-items: center; gap: 0px 6px; display: none; }
.buttons {
.icon { margin: 0px; }
.icon:hover { background-color: $colorHover; }
.icon.active { opacity: 1; background-color: $colorHover; }
.icon:hover { background-color: $colorHoverMedium; }
.icon.active { opacity: 1; background-color: $colorHoverMedium; }
.icon.more { background-image: url('~img/icon/menu/action/more0.svg'); }
.icon.preview { background-size: 16px 14px; background-image: url('~img/icon/sidebar/preview.svg'); }
}
@ -51,11 +51,11 @@
.buttons { display: flex; }
}
.item.active {
.icon.more { background-color: $colorHover; }
.icon.more { background-color: $colorHoverMedium; }
}
.item.hover {
.inner::before { background: $colorHover; }
.inner::before { background: $colorHoverMedium; }
.icon.preview { display: block; }
}
.item.isOpen {

View file

@ -14,7 +14,7 @@
.item {
.name { @include text-overflow-nw; }
}
.item:hover::before { background: $colorHover; }
.item:hover::before { background: $colorHoverMedium; }
.item.isReadonly::before { opacity: 0 !important; }
}

View file

@ -12,7 +12,7 @@
flex-shrink: 0;
}
.head {
.btn { display: inline-block; margin-right: 16px; transition: $transitionAllCommon; cursor: pointer; }
.btn { display: inline-block; margin-right: 16px; transition: $transitionAllCommon; }
.btn:hover, .btn.active { color: $colorBlack; }
.btn:last-child { margin: 0px; }
}

View file

@ -13,7 +13,7 @@
.button { width: 100%; }
.button.grey { cursor: default; }
.item:hover::before { background: $colorHover; }
.item:hover::before { background: $colorHoverMedium; }
.item.disabled:hover::before { opacity: 0; }
.item.withCaption {
@ -31,14 +31,13 @@
.icon.edit { display: none; }
.icon.checkbox { width: 20px; height: 20px; vertical-align: top; background-image: url('~img/icon/dataview/checkbox0.svg'); }
.icon.checkbox.active { background-image: url('~img/icon/dataview/checkbox1.svg'); }
.icon.plus { width: 20px; height: 20px; background-image: url('~img/icon/plus/menu0.svg'); transition: $transitionAllCommon; }
.sides { display: flex; align-items: flex-start; gap: 0px 6px; }
.content { overflow: hidden; max-height: unset; padding: 0px; }
.input { @include text-common; line-height: 20px; vertical-align: top; display: inline-block; height: 21px; padding: 0px; border: 0px; padding: 0px; }
.icon.plus { width: 20px; height: 20px; background-image: url('~img/icon/plus/menu0.svg'); }
.sections { display: flex; flex-direction: column; height: 100%; }
.section { padding: 0px; }
@ -75,14 +74,12 @@
margin: 0px; position: absolute; right: -38px; top: 0px; opacity: 0;
}
.icon.fav.active { background-image: url('~img/icon/fav1.svg'); }
.icon.fav:hover { background-color: $colorHover; }
.info {
width: 192px; @include text-overflow-nw; line-height: 20px; border-radius: 4px; transition: background $transitionCommon;
flex-shrink: 0; padding: 6px; color: $colorDarkGrey; display: flex; gap: 0px 6px; align-items: center; position: relative;
}
.info.canEdit { cursor: pointer; }
.info.canEdit:hover { background: $colorHover; }
.info.canEdit:hover { background: $colorHoverLight; }
.cellContent { min-height: 22px; }
.cellContent {
@ -95,7 +92,7 @@
padding: 5px 8px; border-radius: 4px; width: calc(100% - 236px); line-height: 22px; transition: background $transitionCommon;
position: relative; margin-right: 6px;
}
.cell.canEdit:hover { background: $colorHover; }
.cell.canEdit:hover { background: $colorHoverLight; }
.cell.canEdit {
.cellContent {
.empty { display: block; }
@ -167,10 +164,11 @@
.item.add { padding: 7px 26px 8px 26px; cursor: pointer; background: none; }
.item.add {
.line { margin: 0px; position: absolute; top: 0px; left: 32px; width: calc(100% - 64px); }
.info { width: 100%; }
.info { width: 100%; transition: $transitionAllCommon; }
}
.item.add:hover {
.info { background: $colorHover; }
.info { color: $colorBlack; }
.icon.plus { background-image: url('~img/icon/plus/menu1.svg'); }
}
}

View file

@ -83,7 +83,7 @@
content: ""; position: absolute; left: 0px; top: 0px; width: 100%; height: 100%; background: rgba(80,73,28,0); z-index: 1;
pointer-events: none;
}
.item.hover::before { background: $colorHover; }
.item.hover::before { background: $colorHoverMedium; }
.item.hover, .item:hover {
.icon.delete, .icon.more { opacity: 1; }
}
@ -104,7 +104,7 @@
margin: -12px 0px 0px 0px; border-radius: 4px; opacity: 0; z-index: 1;
}
.icon.delete { background-image: url('~img/icon/menu/delete.svg'); }
.icon.delete:hover, .icon.more:hover { background-color: $colorHover; }
.icon.delete:hover, .icon.more:hover { background-color: $colorHoverMedium; }
.icon.arrow { width: 20px; height: 20px; position: absolute; right: 6px; top: 50%; margin: -10px 0px 0px 0px; background-image: url('~img/arrow/menu.svg'); }
.icon.chk { width: 20px; height: 20px; position: absolute; right: 6px; top: 50%; margin: -10px 0px 0px 0px; background-image: url('~img/icon/menu/checkbox.svg'); }

View file

@ -32,7 +32,7 @@
.item.isFile:hover, .item.isFile.active {
.clickable { width: calc(100% - 46px); }
}
.item:hover::before { background: $colorHover; }
.item:hover::before { background: $colorHoverMedium; }
.item:hover, .item.active {
.icon.more { opacity: 1; }
}

View file

@ -21,7 +21,7 @@
.over { white-space: nowrap; overflow: hidden; width: 100%; }
}
}
.item:hover::before { background: $colorHover; }
.item:hover::before { background: $colorHoverMedium; }
.bottom { flex-shrink: 0; }
.bottom {

View file

@ -44,7 +44,7 @@
width: 24px; height: 24px; background-size: 20px; right: 10px; margin-top: -12px; border-radius: 4px;
opacity: 0; z-index: 1; transition: none;
}
.icon.delete:hover { background-color: $colorHover; }
.icon.delete:hover { background-color: $colorHoverMedium; }
}
.item.hover, .item:hover {
.clickable { width: calc(100% - 44px) !important; }

View file

@ -47,7 +47,7 @@
.menu.menuDataviewOptionEdit {
.filter { margin-bottom: 8px; }
.item:hover::before { background: $colorHover; }
.item:hover::before { background: $colorHoverMedium; }
.item.active::before { z-index: 1; }
}

View file

@ -13,7 +13,7 @@
.switch { position: absolute; right: 16px; top: 50%; margin-top: -8px; }
.name { @include text-overflow-nw; width: calc(100% - 90px); }
}
.item:hover::before { background: $colorHover; }
.item:hover::before { background: $colorHoverMedium; }
.bottom { flex-shrink: 0; }
.bottom {
@ -29,7 +29,7 @@
.button { width: 100%; }
.button.grey { cursor: default; }
.item:hover::before { background: $colorHover; }
.item:hover::before { background: $colorHoverMedium; }
.item.disabled { cursor: default; opacity: 1 !important; }
.item.disabled:hover::before { opacity: 0; }

View file

@ -23,7 +23,7 @@
background-image: url('~img/arrow/search.svg');
}
.icon.arrow.right { transform: rotateZ(180deg); }
.icon.arrow:hover { background-color: $colorHover; }
.icon.arrow:hover { background-color: $colorHoverMedium; }
.icon.clear { width: 20px; height: 20px; background-image: url('~img/icon/clearFilter0.svg') !important; cursor: pointer; }
.icon.clear:hover { background-image: url('~img/icon/clearFilter1.svg') !important; }

View file

@ -9,7 +9,7 @@
.head { color: $colorMediumGrey; font-weight: 500; padding: 3px 16px 10px 16px; border-bottom: 1px solid $colorBorderLight; }
.head {
.btn { display: inline-block; vertical-align: top; margin-right: 16px; transition: $transitionAllCommon; cursor: pointer; }
.btn { display: inline-block; vertical-align: top; margin-right: 16px; transition: $transitionAllCommon; }
.btn:last-child { margin-right: 0px; }
.btn:hover { color: $colorBlack; }
}
@ -39,7 +39,7 @@
.foot { padding: 5px 16px 6px 16px; border-top: 1px solid $colorBorderLight; display: flex; justify-content: space-between; }
.foot {
.icon { width: 32px; height: 32px; border-radius: 4px; background-size: 20px; flex-shrink: 0; cursor: pointer; transition: $transitionAllCommon; }
.icon { width: 32px; height: 32px; border-radius: 4px; background-size: 20px; flex-shrink: 0; transition: $transitionAllCommon; }
.icon:hover { background-color: $colorVeryLightGrey; }
.icon.recent { background-image: url('~img/icon/emoji/recent0.svg'); }

View file

@ -26,7 +26,7 @@
.menu.menuThreadList {
.content { padding: 0px; }
.item { padding: 11px 16px; border-bottom: 1px solid $colorBorderLight; }
.item:hover::before { background: $colorHover; }
.item:hover::before { background: $colorHoverMedium; }
.item:last-child { border: 0px; }
.item {

View file

@ -16,7 +16,7 @@
.authBackWrap {
.icon.back { width: 20px; height: 20px; background-size: 8px; background-image: url('~img/icon/popup/settings/back.svg'); transition: none; }
}
.authBackWrap:hover { background: $colorHover; }
.authBackWrap:hover { background: $colorHoverMedium; }
.textareaWrap { margin: 0px 0px 32px 0px; }
.iconObject { margin-bottom: 12px; }

View file

@ -24,7 +24,7 @@
.name { @include text-overflow-nw; width: calc(100% - 26px); }
}
.element:first-child { margin-left: -4px; }
.element:hover { background-color: $colorHover; }
.element:hover { background-color: $colorHoverMedium; }
}
.side.right { justify-content: flex-end; }

View file

@ -27,7 +27,7 @@
.block.blockMedia {
img.media { width: auto; height: auto; max-width: 100%; display: inline-block; object-fit: contain; }
}
.iconObject { width: 100%; height: 100%; border-radius: 6px; background: $colorHover; }
.iconObject { width: 100%; height: 100%; border-radius: 6px; background: $colorHoverMedium; }
}
.blocks {
@ -41,7 +41,7 @@
.descr { @include text-paragraph; word-wrap: break-word; margin-bottom: 10px; }
.descr:empty { display: none; }
.block.blockMedia { padding: 0px; border-radius: 6px; background: $colorHover; }
.block.blockMedia { padding: 0px; border-radius: 6px; background: $colorHoverMedium; }
.block.blockMedia {
.wrap { position: static; overflow: visible; width: 100%; height: 100%; }
.selectable, .dropTarget { height: 100%; }

View file

@ -23,7 +23,7 @@
}
}
.item.active { background-color: $colorHover; }
.item.active { background-color: $colorHoverMedium; }
}
.sides { display: flex; padding: 0px 16px; }

View file

@ -12,7 +12,10 @@
.title { margin-bottom: 25px; line-height: 40px; }
.label { @include text-paragraph; margin: 0px auto 24px auto; width: 610px; }
.filter { width: 512px; height: 48px; margin: 0px auto; border: 1px solid $colorBorderDark; border-radius: 10px; padding: 0px; text-align: center; }
.filter {
width: 512px; height: 48px; margin: 0px auto; border: 1px solid $colorBorderDark; border-radius: 10px; padding: 0px; text-align: center;
cursor: pointer;
}
.filter {
.line { display: none; }
.filterInputWrap { height: 100%; width: auto; }
@ -32,7 +35,7 @@
.tabs { white-space: nowrap; text-align: left; display: flex; flex-direction: row; gap: 0px 24px; }
.tabs {
.tab {
display: inline-block; font-weight: 700; cursor: pointer; font-size: 18px; line-height: 26px; letter-spacing: -0.16px;
display: inline-block; font-weight: 700; font-size: 18px; line-height: 26px; letter-spacing: -0.16px;
color: $colorMediumGrey; transition: $transitionAllCommon;
}
.tab:hover, .tab.active { color: $colorBlack; }
@ -52,13 +55,13 @@
.row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-column-gap: 48px; }
.row.block { display: block; }
.item { height: 48px; line-height: 48px; display: flex; position: relative; cursor: pointer; justify-content: space-between; }
.item { height: 48px; line-height: 48px; display: flex; position: relative; justify-content: space-between; }
.item {
.flex {
flex-direction: row; align-items: center; padding: 14px 16px 14px 14px; border: 1px solid $colorBorderDark; border-radius: 10px; font-weight: 700;
gap: 0px 8px; transition: $transitionAllCommon; max-width: calc(100% - 70px);
}
.flex:hover { background: $colorHover; }
.flex:hover { background: $colorHoverMedium; }
.iconObject { flex-shrink: 0; }
.name { @include text-overflow-nw; width: 100%; }
@ -74,7 +77,10 @@
.icon.plus { background-size: 28px; background-image: url('~img/icon/store/plus0.svg'); opacity: 0; }
.icon.plus:hover { background-image: url('~img/icon/store/plus1.svg'); }
.button { @include text-common; opacity: 0; background: none; color: $colorDarkGrey; border-radius: 0px; padding: 0px; height: 1em; line-height: 1em; }
.button {
@include text-common; opacity: 0; background: none; color: $colorDarkGrey; border-radius: 0px; padding: 0px; height: 1em;
line-height: 1em; cursor: default;
}
.button:hover { color: $colorBlack; }
}
}

View file

@ -55,14 +55,19 @@
.icon { flex-shrink: 0; width: 20px; height: 20px; margin-right: 8px; }
.name { width: 200px; @include text-overflow-nw; line-height: 20px; color: $colorDarkGrey; }
}
.item.canEdit, .item.add {
.item.canEdit {
.clickable { cursor: pointer; }
.clickable:hover { background: $colorHover; }
.clickable:hover { background: $colorHoverLight; }
}
.item.add { line-height: 20px; }
.item.add {
.name { color: $colorDarkGrey; }
.icon { transition: $transitionAllCommon; }
.name { color: $colorDarkGrey; transition: $transitionAllCommon; }
}
.item.add:hover {
.name { color: $colorBlack; }
.icon.plus { background-image: url('~img/icon/plus/menu1.svg'); }
}
}

View file

@ -48,7 +48,7 @@
}
}
.item.active { background-color: $colorHover; }
.item.active { background-color: $colorHoverMedium; }
}
}
}

View file

@ -25,7 +25,7 @@
.space {
display: flex; flex-direction: row; padding: 8px; gap: 0px 12px; align-items: center; margin: 0px 0px 12px 0px;
border-radius: 8px; transition: $transitionAllCommon; cursor: pointer;
border-radius: 8px; transition: $transitionAllCommon;
}
.space:hover, .space.active { background: $colorBorderDark; }
.space {
@ -37,9 +37,7 @@
.items { display: flex; flex-direction: column; gap: 2px 0px; }
.item {
display: flex; flex-direction: row; gap: 0px 10px; padding: 5px 8px; cursor: pointer; border-radius: 8px; transition: $transitionAllCommon;
}
.item { display: flex; flex-direction: row; gap: 0px 10px; padding: 5px 8px; border-radius: 8px; transition: $transitionAllCommon; }
.item:hover, .item.active { background: $colorBorderDark; }
.item {
.icon { width: 22px; height: 22px; }
@ -69,7 +67,7 @@
color: $colorDarkGrey; cursor: pointer; display: inline-flex; gap: 0px 6px; align-items: center; padding: 2px 4px;
border-radius: 6px; margin-left: -5px;
}
.element:hover { background: $colorHover; }
.element:hover { background: $colorHoverMedium; }
}
.title { @include text-header1; font-weight: 700; margin: 0px 0px 12px 0px; }
@ -92,7 +90,10 @@
.label.small, .label.section { @include text-small; }
.label.section { margin: 30px 0px 4px 0px; }
.select { border: 0px; color: $colorDarkGrey; }
.select { border: 0px; color: $colorDarkGrey; cursor: default; }
.select {
.icon.arrow { margin: 0px !important; top: 3px; }
}
.name { width: 100%; }
.name {
@ -139,7 +140,10 @@
.inputs { margin: 0px 0px 54px 0px; }
.title.sub { @include text-header3; margin: 0px 0px 4px 0px; font-weight: 700; }
.qrWrap { padding: 8px; border-radius: 4px; width: 132px; height: 132px; background: $colorVeryLightGrey; overflow: hidden; }
.qrWrap {
padding: 8px; border-radius: 4px; width: 132px; height: 132px; background: $colorVeryLightGrey; overflow: hidden;
cursor: pointer;
}
.qrWrap {
canvas { width: 100%; height: 100%; }
}
@ -154,6 +158,7 @@
.text { margin: 0px 0px 32px 0px; }
.text {
b { margin: 0px 0px 8px 0px; display: block; }
p.first { margin: 0px 0px 20px 0px; }
}
.check { border-top: 1px solid $colorBorderLight; padding: 16px 0px 12px 0px; display: flex; align-items: center; gap: 0px 8px; cursor: pointer; }
@ -201,7 +206,7 @@
.side.right.tabExportIndex {
.items { display: grid; gap: 16px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.item {
width: 132px; height: 94px; border: 1px solid $colorBorderLight; border-radius: 8px; transition: $transitionAllCommon; cursor: pointer;
width: 132px; height: 94px; border: 1px solid $colorBorderLight; border-radius: 8px; transition: $transitionAllCommon;
position: relative; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center;
}
.item:hover { border-color: $colorBlack; }

View file

@ -1,6 +1,6 @@
$themePath: '~img/theme/dark';
$colorBlack: #0d0d0d;
$colorBlack: #171717;
$colorLinePrimary: #555;
$colorLineSecondary: #3f3f3f;
@ -9,7 +9,7 @@ $colorPrimary: #dcdcdc;
$colorSecondary: #8d8d8d;
$colorTertiary: #505050;
$colorHover: rgba(238, 238, 238, 0.12);
$colorHoverMedium: rgba(238, 238, 238, 0.12);
$colorBgLight: #252525;
$colorBgIcon: #464646;

View file

@ -46,7 +46,7 @@
.block.blockFeatured { color: $colorSecondary; }
.block.blockFeatured {
.cellContent:hover, .cellContent.hover { background: $colorHover; }
.cellContent:hover, .cellContent.hover { background: $colorHoverMedium; }
}
/* BlockFile */
@ -58,7 +58,7 @@
/* BlockRelation */
.block.blockRelation {
.cell.canEdit:hover { background: $colorHover; }
.cell.canEdit:hover { background: $colorHoverMedium; }
}
/* BlockMedia */
@ -67,7 +67,7 @@
.loaderWrapper { border: 0px; }
.pdfWrapper { box-shadow: 0px 0px 0px 1px $colorLinePrimary; }
}
.block.blockMedia.isAudio.withFile > .wrapContent { background-color: $colorHover; }
.block.blockMedia.isAudio.withFile > .wrapContent { background-color: $colorHoverMedium; }
/* BlockDataview */
@ -94,7 +94,7 @@
.dataviewHead { border-color: $colorLineSecondary; }
.dataviewHead {
.iconWrap:hover { background-color: $colorHover; }
.iconWrap:hover { background-color: $colorHoverMedium; }
}
.dataviewControls {
@ -104,9 +104,9 @@
.icon.arrow { background-image: url('#{$themePath}/arrow/view.svg'); }
}
.viewItem:hover, .viewItem.active { color: $colorPrimary; }
.viewItem.isDragging { background: $colorHover; }
.viewItem.isDragging { background: $colorHoverMedium; }
.icon:hover, .icon.active { background-color: $colorHover; }
.icon:hover, .icon.active { background-color: $colorHoverMedium; }
/*
.icon.search { background-image: url('#{$themePath}/icon/dataview/button/search0.svg'); }
.icon.manager { background-image: url('#{$themePath}/icon/dataview/button/manager0.svg'); }
@ -122,12 +122,12 @@
.side.left { color: $colorPrimary; }
.side.right {
.element.black { color: $colorPrimary; }
.element:hover { background-color: $colorHover; }
.element:hover { background-color: $colorHoverMedium; }
}
}
.cellHead.isDragging { background: $colorHover; }
.cellHead.isDragging::after { background-color: $colorHover; }
.cellHead.isDragging { background: $colorHoverMedium; }
.cellHead.isDragging::after { background-color: $colorHoverMedium; }
.viewContent.viewGrid,
.viewContent.viewList {
@ -205,19 +205,19 @@
.block.blockType {
.item { border-color: $colorLineSecondary; color: $colorSecondary; }
.item.hover { background: $colorHover; }
.item.hover { background: $colorHoverMedium; }
}
/* BlockText */
.block.blockText {
kbd { background: $colorHover; color: $colorOrange; }
kbd { background: $colorHoverMedium; color: $colorOrange; }
lnk, obj { border-color: $colorSecondary; }
lnk:hover, obj:hover { border-color: $colorPrimary; }
}
.block.blockText.textCallout > .wrapContent { background: $colorHover; }
.block.blockText.textCode > .wrapContent > .selectable > .dropTarget { background: $colorHover; }
.block.blockText.textCallout > .wrapContent { background: $colorHoverMedium; }
.block.blockText.textCode > .wrapContent > .selectable > .dropTarget { background: $colorHoverMedium; }
.block.blockText.textQuote > .wrapContent > .additional > .line { border-color: $colorPrimary; }
/* BlockLink */
@ -268,7 +268,7 @@
.loaderWrapper { border: 0px; }
.deleted { color: $colorSecondary; }
.inner { border-color: transparent; background-color: $colorHover; }
.inner { border-color: transparent; background-color: $colorHoverMedium; }
.inner {
.name { color: $colorPrimary; }
.descr { color: $colorSecondary; }

View file

@ -40,7 +40,7 @@ html.themeDark {
.bgColor-teal { background: rgba(15, 200, 186, 0.25) !important; }
.bgColor-lime { background: rgba(93, 212, 0, 0.25) !important; }
.isTag.archive { background-color: $colorHover; color: $colorSecondary; }
.isTag.archive { background-color: $colorHoverMedium; color: $colorSecondary; }
.isTag.tagColor-default { color: $colorPrimary !important; background: $colorBlack !important; box-shadow: 0px 0px 0px 1px $colorLinePrimary inset; }
.isTag.tagColor-grey { color: #8C9EA5 !important; background: rgba(140, 158, 165, 0.25) !important; }
.isTag.tagColor-yellow { color: $colorYellow !important; background: rgba(236, 217, 27, 0.25) !important; }
@ -81,7 +81,7 @@ html.themeDark {
.icon.volume.active { background-image: url('#{$themePath}/icon/audio/mute.svg'); }
.input-drag {
.back { background: $colorHover; }
.back { background: $colorHoverMedium; }
}
}
}
@ -95,7 +95,7 @@ html.themeDark {
}
.button.blank { color: $colorPrimary; border-color: $colorLineSecondary; }
.button.blank:hover { border-color: #525148; background: $colorHover; }
.button.blank:hover { border-color: #525148; background: $colorHoverMedium; }
.button.red { border-color: $colorLineSecondary; }
.button.red:hover { border-color: #581f0c; background: #311107; }
@ -122,14 +122,14 @@ html.themeDark {
.textareaWrap { background-color: $colorBgLight; }
.select { border-color: $colorLinePrimary; }
.select:hover, .select.active { background: $colorHover; }
.select:hover, .select.active { background: $colorHoverMedium; }
.select {
.icon.arrow { background-image: url('#{$themePath}/arrow/select/dark.svg') !important; }
}
.input.isReadonly { background: rgba(255,255,255,0.1); }
.inputWithFile { background: $colorHover; color: $colorSecondary; border-color: transparent; }
.inputWithFile { background: $colorHoverMedium; color: $colorSecondary; border-color: transparent; }
.inputWithFile {
.input::placeholder { color: $colorSecondary; }
.fileWrap:hover .border { color: $colorPrimary; }
@ -139,7 +139,7 @@ html.themeDark {
.listPreviewObject {
.item.add { border-color: $colorLinePrimary; }
.item:before { background: $colorHover; }
.item:before { background: $colorHoverMedium; }
.icon.arrow { background-image: url('#{$themePath}/arrow/template0.svg'); }
.icon.arrow:hover { background-image: url('#{$themePath}/arrow/template1.svg'); }
@ -218,7 +218,7 @@ html.themeDark {
.inner {
.fill { background: $colorSecondary; }
.label { color: $colorPrimary; }
.bar { background: $colorHover; }
.bar { background: $colorHoverMedium; }
}
}
@ -269,9 +269,9 @@ html.themeDark {
.header.isCommon { background: $colorBlack; }
.header.isCommon {
.path { border: 0px; line-height: 28px; }
.path:hover { background-color: $colorHover; color: $colorPrimary; }
.path:hover { background-color: $colorHoverMedium; color: $colorPrimary; }
.icon.big:hover, .icon.big.hover { background-color: $colorHover; }
.icon.big:hover, .icon.big.hover { background-color: $colorHoverMedium; }
.tabs { color: $colorSecondary; }
.tabs {
@ -279,7 +279,7 @@ html.themeDark {
}
}
.header.isCommon.active {
.path { background-color: $colorHover; color: $colorPrimary; }
.path { background-color: $colorHoverMedium; color: $colorPrimary; }
}
.header.mainHistory { background: $colorBlack; }
@ -302,7 +302,7 @@ html.themeDark {
/* ---------------------------------------------------------------- */
.footer {
.icon.big { background-color: $colorBgIcon; }
.iconWrap .bg { background-color: $colorBgIcon; }
}
/* Sidebar */
@ -315,7 +315,7 @@ html.themeDark {
.sidebar.fixed { box-shadow: 0px 0px rgba(0,0,0,0); }
.sidebar {
> .head {
.icon:hover { background-color: $colorHover; }
.icon:hover { background-color: $colorHoverMedium; }
}
}

View file

@ -44,9 +44,9 @@
.separator .inner { background: $colorLineSecondary; }
.item { background: none; }
.item.hover::before { background: $colorHover; }
.item.hover::before { background: $colorHoverMedium; }
.item {
.icon.delete:hover, .icon.more:hover { background-color: $colorHover; }
.icon.delete:hover, .icon.more:hover { background-color: $colorHoverMedium; }
.icon.arrow { background-image: url('#{$themePath}/arrow/menu.svg'); }
.icon.chk { background-image: url('#{$themePath}/icon/menu/checkbox.svg'); }
}
@ -123,15 +123,15 @@
.icon.dnd { border-color: rgba(217, 212, 184, 0.14); }
.info { color: $colorSecondary; }
.info.canEdit:hover { background: $colorHover; }
.info.canEdit:hover { background: $colorHoverMedium; }
.cell.canEdit:hover { background: $colorHover; }
.cell.canEdit:hover { background: $colorHoverMedium; }
.icon.fav:hover { background-color: $colorHover; }
.icon.fav:hover { background-color: $colorHoverMedium; }
}
.item.add:hover {
.info { background: $colorHover; }
.info { background: $colorHoverMedium; }
}
}
@ -139,14 +139,14 @@
.menu.menuBlockRelationEdit {
.input { border-color: $colorLinePrimary; }
.item:hover::before { background: $colorHover; }
.item:hover::before { background: $colorHoverMedium; }
}
/* MenuDataviewRelationEdit */
.menu.menuDataviewRelationEdit {
.input { border-color: $colorLinePrimary; }
.item:hover::before { background: $colorHover; }
.item:hover::before { background: $colorHoverMedium; }
}
/* MenuDataviewText */
@ -158,16 +158,16 @@
/* MenuDataviewRelationList */
.menu.menuDataviewRelationList {
.item:hover::before { background: $colorHover; }
.item:hover::before { background: $colorHoverMedium; }
}
/* MenuDataviewFileValues */
.menu.menuDataviewFileValues {
.item { color: $colorPrimary; }
.item:hover::before { background: $colorHover; }
.item:hover::before { background: $colorHoverMedium; }
.item {
.icon.more { background-color: $colorHover; }
.icon.more { background-color: $colorHoverMedium; }
}
}
@ -182,7 +182,7 @@
/* MenuDataviewOptionEdit */
.menu.menuDataviewOptionEdit {
.item:hover::before { background: $colorHover; }
.item:hover::before { background: $colorHoverMedium; }
}
/* MenuSearchObject */
@ -197,7 +197,7 @@
.menu.menuThreadList {
.item { border-color: $colorLineSecondary; }
.item:hover::before { background: $colorHover; }
.item:hover::before { background: $colorHoverMedium; }
.item {
.icon.cafe { background-image: url('#{$themePath}/icon/cafe.svg'); }
@ -207,13 +207,13 @@
/* MenuBlockMore */
.menu.menuBlockMore {
.item:hover::before { background: $colorHover; }
.item:hover::before { background: $colorHoverMedium; }
}
/* MenuHelp */
.menu.menuHelp {
.item:hover::before { background: $colorHover; }
.item:hover::before { background: $colorHoverMedium; }
}
/* MenuButton */
@ -242,7 +242,7 @@
/* MenuBlockContext */
.menu.menuBlockContext {
.icon:hover { background-color: $colorHover; }
.icon:hover { background-color: $colorHoverMedium; }
.icon.active.bold { background-image: url('#{$themePath}/icon/menu/action/mark/bold1.svg'); }
.icon.active.kbd { background-image: url('#{$themePath}/icon/menu/action/mark/code1.svg'); }
@ -278,7 +278,7 @@
.icon.style-card { background-image: url('#{$themePath}/icon/menu/linkSettings/card1.svg'); }
}
.item.active { color: $colorPrimary; background: $colorHover; }
.item.active { color: $colorPrimary; background: $colorHoverMedium; }
.item.active {
.icon.style-text { background-image: url('#{$themePath}/icon/menu/linkSettings/text2.svg'); }
.icon.style-card { background-image: url('#{$themePath}/icon/menu/linkSettings/card2.svg'); }

View file

@ -5,7 +5,7 @@
.pageAuth, .pageIndex {
.input { border-color: $colorLinePrimary; }
.authBackWrap:hover { background-color: $colorHover; }
.authBackWrap:hover { background-color: $colorHoverMedium; }
}
.pageAuthRegister {
@ -35,7 +35,7 @@
.section {
.item { background: $colorBlack; }
.item:hover::before { background: $colorHover; }
.item:hover::before { background: $colorHoverMedium; }
}
}
@ -62,7 +62,7 @@
.items {
.item {
.flex { border-color: $colorLineSecondary; }
.flex:hover { border-color: $colorLinePrimary; background-color: $colorHover; }
.flex:hover { border-color: $colorLinePrimary; background-color: $colorHoverMedium; }
.buttons {
.icon.lock { background-image: url('#{$themePath}/icon/store/lock.svg'); }
@ -105,7 +105,7 @@
.name { color: $colorSecondary; }
}
.item.canEdit, .item.add {
.clickable:hover { background: $colorHover; }
.clickable:hover { background: $colorHoverMedium; }
}
}
@ -155,7 +155,7 @@
.list {
.section.fix { background: $colorBlack; }
.item:hover, .item.active { background: $colorHover; }
.item:hover, .item.active { background: $colorHoverMedium; }
.item {
.name { color: $colorSecondary; }
.icon.arrow { background-image: url('#{$themePath}/arrow/historyList.svg'); }
@ -167,7 +167,7 @@
.pageMainBookmark {
.wrapper {
.item.add:hover { background: $colorHover; }
.item.add:hover { background: $colorHoverMedium; }
}
}
@ -190,7 +190,7 @@
.controls { border-color: $colorLinePrimary; }
.controls {
.side.left {
.element:hover { background-color: $colorHover; }
.element:hover { background-color: $colorHoverMedium; }
}
}

View file

@ -17,7 +17,7 @@
.item {
.descr { color: $colorSecondary; }
}
.item.active { background-color: $colorHover; }
.item.active { background-color: $colorHoverMedium; }
}
/* PopupSettings */
@ -27,8 +27,8 @@
.sides {
> .side.left { background: $colorBgLight; }
> .side.left {
.space:hover, .space.active { background: $colorHover; }
.item:hover, .item.active { background: $colorHover; }
.space:hover, .space.active { background: $colorHoverMedium; }
.item:hover, .item.active { background: $colorHoverMedium; }
.iconObject.withLetter { background-color: $colorBgIcon; }
}
@ -36,7 +36,7 @@
> .side.right {
.head { background: $colorBlack; }
.head {
.element:hover { background-color: $colorHover; }
.element:hover { background-color: $colorHoverMedium; }
}
.label.section, .label.small, .label.grey { color: $colorSecondary; }
@ -45,7 +45,7 @@
.input { border-color: $colorLinePrimary; }
.select { color: $colorSecondary; }
.select:hover { background-color: $colorHover; }
.select:hover { background-color: $colorHoverMedium; }
}
}
@ -159,7 +159,7 @@
.icon.twitter:hover { background-image: url('#{$themePath}/icon/social/twitter1.svg'); }
}
.highlight { color: $colorOrange; background: $colorHover; }
.highlight { color: $colorOrange; background: $colorHoverMedium; }
}
/* PopupPrompt */

View file

@ -4,14 +4,14 @@
}
}
.widget { background-color: $colorHover; color: $colorPrimary; border-color: $colorLineSecondary !important; }
.widget { background-color: $colorHoverMedium; color: $colorPrimary; border-color: $colorLineSecondary !important; }
.widget {
.iconWrap:hover, .iconWrap.active { background-color: $colorHover; }
.iconWrap:hover, .iconWrap.active { background-color: $colorHoverMedium; }
.icon.back { background-image: url('#{$themePath}/icon/widget/back.svg'); }
.icon.collapse { background-image: url('#{$themePath}/icon/widget/collapse.svg'); }
.icon.options { background-image: url('#{$themePath}/icon/widget/options.svg'); }
.head::before { background-color: $colorHover; }
.head::before { background-color: $colorHoverMedium; }
.icon.remove .inner { background-color: $colorBgIcon; }
.icon.remove:hover .inner { background-color: $colorTertiary; }
@ -19,12 +19,12 @@
.widget.active {
.head {
.iconWrap.options { background-color: $colorHover; }
.iconWrap.options { background-color: $colorHoverMedium; }
}
}
.widget.widgetSpace {
.icon:hover { background-color: $colorHover; }
.icon:hover { background-color: $colorHoverMedium; }
}
.widget.isPreview {
@ -36,13 +36,13 @@
.icon.collection { background-image: url('#{$themePath}/icon/sidebar/collection.svg'); }
.icon.blank { background-image: url('#{$themePath}/icon/sidebar/blank.svg'); }
.icon.arrow { background-image: url('~img/arrow/select/light.svg'); }
.icon.arrow:hover { background-color: $colorHover; }
.icon.arrow:hover { background-color: $colorHoverMedium; }
.item {
.inner:hover::before { background: $colorHover; }
.inner:hover::before { background: $colorHoverMedium; }
.buttons {
.icon:hover { background-color: $colorHover; }
.icon:hover { background-color: $colorHoverMedium; }
}
}
}
@ -61,13 +61,13 @@
}
.body {
.item:hover { background: $colorHover; }
.item:hover { background: $colorHoverMedium; }
.item {
.iconObject { background: $colorBgIcon; }
.iconObject.isTask, .iconObject.isBookmark { background: none; }
.buttons {
.icon:hover { background-color: $colorHover; }
.icon:hover { background-color: $colorHoverMedium; }
}
}
}

View file

@ -12,7 +12,7 @@ import { Page, SelectionProvider, DragProvider, Progress, Toast, Preview as Prev
import { commonStore, authStore, blockStore, detailStore, dbStore, menuStore, popupStore } from './store';
import {
I, C, Util, FileUtil, keyboard, Storage, analytics, dispatcher, translate, Action, Renderer, DataUtil,
focus, Preview, Mark, Encode, Animation
focus, Preview, Mark, Animation
} from 'Lib';
configure({ enforceActions: 'never' });
@ -230,7 +230,6 @@ window.Lib = {
DataUtil,
Preview,
Storage,
Encode,
Animation,
};
@ -621,13 +620,13 @@ class App extends React.Component<object, State> {
switch (key) {
case 'undo':
if (!keyboard.isFocused) {
keyboard.onUndo(rootId);
keyboard.onUndo(rootId, 'MenuSystem');
};
break;
case 'redo':
if (!keyboard.isFocused) {
keyboard.onRedo(rootId);
keyboard.onRedo(rootId, 'MenuSystem');
};
break;
@ -669,16 +668,6 @@ class App extends React.Component<object, State> {
});
break;
case 'debugSync':
C.DebugSync(100, (message: any) => {
if (!message.error.code) {
window.Electron.fileWrite('debug-sync.json', JSON.stringify(message, null, 5), 'utf8');
Renderer.send('pathOpen', tmpPath);
};
});
break;
case 'debugSpace':
C.DebugSpaceSummary((message: any) => {
if (!message.error.code) {

View file

@ -434,7 +434,9 @@ const BlockCover = observer(class BlockCover extends React.Component<I.BlockComp
cb();
} else {
this.cover.css({ opacity: 0 });
el.onload = cb;
el.onerror = cb;
};
if ([ I.CoverType.Upload, I.CoverType.Source ].includes(coverType)) {

View file

@ -3,7 +3,7 @@ import $ from 'jquery';
import { observer } from 'mobx-react';
import { observable } from 'mobx';
import { Icon, Button } from 'Component';
import { C, I, Util, analytics, Relation, Dataview, keyboard } from 'Lib';
import { C, I, Util, analytics, Relation, Dataview, keyboard, translate } from 'Lib';
import { menuStore, dbStore, blockStore } from 'Store';
import { SortableContainer, SortableElement } from 'react-sortable-hoc';
import arrayMove from 'array-move';
@ -219,7 +219,7 @@ const Controls = observer(class Controls extends React.Component<I.ViewComponent
const object = getTarget();
const newView = {
name: '',
name: translate(`viewName${I.ViewType.Grid}`),
type: I.ViewType.Grid,
groupRelationKey: Relation.getGroupOption(rootId, block.id, '')?.id,
cardSize: I.CardSize.Medium,

View file

@ -184,7 +184,7 @@ const Head = observer(class Head extends React.Component<Props, State> {
addParam.name = 'Create new collection';
addParam.onClick = () => {
C.ObjectCreate({ layout: I.ObjectLayout.Collection, type: Constant.typeId.collection }, [], '', (message: any) => {
C.BlockDataviewCreateFromExistingObject(rootId, block.id, item.id, onCreate);
C.BlockDataviewCreateFromExistingObject(rootId, block.id, message.objectId, onCreate);
analytics.event('InlineSetSetSource', { type: 'newObject' });
});
};

View file

@ -109,7 +109,7 @@ const BlockFeatured = observer(class BlockFeatured extends React.Component<Props
</span>
) : ''}
{object.layout == I.ObjectLayout.Set ? (
{featuredRelations.includes('setOf') && (object.layout == I.ObjectLayout.Set) ? (
<span className={[ 'cell', (!readonly ? 'canEdit' : '') ].join(' ')}>
{bullet}
<div

View file

@ -304,7 +304,7 @@ const Block = observer(class Block extends React.Component<Props> {
if (canSelect) {
object = (
<div
id={'selectable-' + id}
id={`selectable-${id}`}
className={[ 'selectable', 'type-' + I.SelectType.Block ].join(' ')}
{...Util.dataProps({ id, type: I.SelectType.Block })}
>
@ -312,7 +312,14 @@ const Block = observer(class Block extends React.Component<Props> {
</div>
);
} else {
object = <div className="selectable">{object}</div>;
object = (
<div
id={`selectable-${id}`}
className="selectable"
>
{object}
</div>
);
};
return (

View file

@ -166,15 +166,15 @@ const BlockLatex = observer(class BlockLatex extends React.Component<I.BlockComp
if (isEditing) {
// Undo
keyboard.shortcut(`${cmd}+z`, e, (pressed: string) => {
keyboard.shortcut(`${cmd}+z`, e, () => {
e.preventDefault();
keyboard.onUndo(rootId, (message: any) => { focus.clear(true); });
keyboard.onUndo(rootId, 'editor', () => { focus.clear(true); });
});
// Redo
keyboard.shortcut(`${cmd}+shift+z, ${cmd}+y`, e, (pressed: string) => {
keyboard.shortcut(`${cmd}+shift+z, ${cmd}+y`, e, () => {
e.preventDefault();
keyboard.onRedo(rootId, (message: any) => { focus.clear(true); });
keyboard.onRedo(rootId, 'editor', () => { focus.clear(true); });
});
};

View file

@ -306,8 +306,7 @@ const BlockVideo = observer(class BlockVideo extends React.Component<I.BlockComp
getHeight (p: number) {
const { block } = this.props;
const { id } = block;
const el = $('#selectable-' + id);
const el = $('#selectable-' + block.id);
if (!el.length) {
return 0;

View file

@ -502,18 +502,18 @@ const EditorPage = observer(class EditorPage extends React.Component<Props> {
});
// Undo
keyboard.shortcut(`${cmd}+z`, e, (pressed: string) => {
keyboard.shortcut(`${cmd}+z`, e, () => {
if (!readonly) {
e.preventDefault();
keyboard.onUndo(rootId, (message: any) => { focus.clear(true); });
keyboard.onUndo(rootId, 'editor', () => { focus.clear(true); });
};
});
// Redo
keyboard.shortcut(`${cmd}+shift+z, ${cmd}+y`, e, (pressed: string) => {
keyboard.shortcut(`${cmd}+shift+z, ${cmd}+y`, e, () => {
if (readonly) {
e.preventDefault();
keyboard.onRedo(rootId, (message: any) => { focus.clear(true); });
keyboard.onRedo(rootId, 'editor', () => { focus.clear(true); });
};
});
@ -719,18 +719,18 @@ const EditorPage = observer(class EditorPage extends React.Component<Props> {
// Undo
keyboard.shortcut(`${cmd}+z`, e, () => {
e.preventDefault();
keyboard.onUndo(rootId, () => { focus.clear(true); });
keyboard.onUndo(rootId, 'editor', () => { focus.clear(true); });
});
// Redo
keyboard.shortcut(`${cmd}+shift+z, ${cmd}+y`, e, () => {
e.preventDefault();
keyboard.onRedo(rootId, () => { focus.clear(true); });
keyboard.onRedo(rootId, 'editor', () => { focus.clear(true); });
});
// Search
keyboard.shortcut(`${cmd}+f`, e, () => {
keyboard.onSearchMenu(text.substr(range.from, range.to - range.from));
keyboard.onSearchMenu(text.substr(range.from, range.to - range.from), 'editor');
});
if (block.isTextToggle()) {

View file

@ -1,32 +1,45 @@
import * as React from 'react';
import { Icon } from 'Component';
import { I } from 'Lib';
import { I, keyboard, Preview } from 'Lib';
const FooterMainEdit = class FooterMainEdit extends React.Component<I.FooterComponent> {
render () {
const { onHelp, onAdd } = this.props;
const cmd = keyboard.cmdSymbol();
return (
<React.Fragment>
<Icon
id="button-add"
className="big"
tooltip="Add new object"
tooltipY={I.MenuDirection.Top}
<div
id="button-add"
className="iconWrap"
onClick={onAdd}
/>
<Icon
onMouseEnter={e => this.onTooltipShow(e, 'Add new object', `${cmd} + N`)}
>
<Icon />
<div className="bg" />
</div>
<div
id="button-help"
className="big help"
tooltip="Help"
tooltipY={I.MenuDirection.Top}
onClick={onHelp}
/>
className="iconWrap"
onClick={onHelp}
onMouseEnter={e => this.onTooltipShow(e, 'Help')}
>
<Icon />
<div className="bg" />
</div>
</React.Fragment>
);
};
onTooltipShow (e: any, text: string, caption?: string) {
const t = Preview.tooltipCaption(text, caption);
if (t) {
Preview.tooltipShow({ text: t, element: $(e.currentTarget), typeY: I.MenuDirection.Top });
};
};
};
export default FooterMainEdit;

View file

@ -88,8 +88,11 @@ class Header extends React.Component<Props> {
ObjectUtil.openAuto({ id: this.props.rootId, layout: I.ObjectLayout.Graph });
};
onTooltipShow (e: any, text: string) {
Preview.tooltipShow({ text, element: $(e.currentTarget) });
onTooltipShow (e: any, text: string, caption?: string) {
const t = Preview.tooltipCaption(text, caption);
if (t) {
Preview.tooltipShow({ text: t, element: $(e.currentTarget), typeY: I.MenuDirection.Bottom });
};
};
onTooltipHide () {

View file

@ -36,7 +36,7 @@ class HeaderMainGraph extends React.Component<I.HeaderComponent> {
key={i}
className={[ 'tab', (item.id == tab ? 'active' : '') ].join(' ')}
onClick={() => { onTab(item.id); }}
onMouseOver={e => onTooltipShow(e, item.tooltip)}
onMouseOver={e => onTooltipShow(e, item.tooltip, item.tooltipCaption)}
onMouseOut={onTooltipHide}
>
{item.name}

View file

@ -30,7 +30,7 @@ const HeaderMainNavigation = observer(class HeaderMainNavigation extends React.C
key={i}
className={[ 'tab', (item.id == tab ? 'active' : '') ].join(' ')}
onClick={() => { onTab(item.id); }}
onMouseOver={e => onTooltipShow(e, item.tooltip)}
onMouseOver={e => onTooltipShow(e, item.tooltip, item.tooltipCaption)}
onMouseOut={onTooltipHide}
>
{item.name}

View file

@ -30,7 +30,7 @@ const HeaderMainStore = observer(class HeaderMainStore extends React.Component<I
key={`tab-store-${item.id}`}
className={[ 'tab', (item.id == tab ? 'active' : '') ].join(' ')}
onClick={() => { onTab(item.id); }}
onMouseOver={e => onTooltipShow(e, item.tooltip)}
onMouseOver={e => onTooltipShow(e, item.tooltip, item.tooltipCaption)}
onMouseOut={onTooltipHide}
>
{item.name}

View file

@ -121,7 +121,6 @@ class MenuBlockMore extends React.Component<I.Menu> {
let turn = { id: 'turnObject', icon: 'object', name: 'Turn into object', arrow: true };
let align = { id: 'align', name: 'Align', icon: [ 'align', DataUtil.alignIcon(object.layoutAlign) ].join(' '), arrow: true };
let history = { id: 'history', name: 'Version history', caption: (platform == I.Platform.Mac ? `${cmd}+Y` : `Ctrl+H`) };
let share = { id: 'pageShare', icon: 'share', name: 'Share' };
let pageRemove = { id: 'pageRemove', icon: 'remove', name: 'Delete' };
let pageExport = { id: 'pageExport', icon: 'export', name: 'Export' };
let pageCopy = { id: 'pageCopy', icon: 'copy', name: 'Duplicate object' };
@ -165,7 +164,6 @@ class MenuBlockMore extends React.Component<I.Menu> {
const allowedBlock = blockStore.checkFlags(rootId, rootId, [ I.RestrictionObject.Block ]);
const allowedArchive = blockStore.checkFlags(rootId, rootId, [ I.RestrictionObject.Delete ]);
const allowedDelete = object.isInstalled && allowedArchive && object.isArchived;
const allowedShare = block.isObjectSpace() && config.allowSpaces;
const allowedSearch = !block.isObjectSet() && !block.isObjectSpace();
const allowedHistory = block.canHaveHistory() && !object.templateIsBundled;
const allowedTemplate = (object.type != Constant.typeId.note) && (object.id != profile) && blockStore.checkFlags(rootId, rootId, [ I.RestrictionObject.Template ]);
@ -184,7 +182,6 @@ class MenuBlockMore extends React.Component<I.Menu> {
if (!allowedLink) pageLink = null;
if (!allowedCopy) pageCopy = null;
if (!allowedReload) pageReload = null;
if (!allowedShare) share = null;
if (!allowedSearch) search = null;
if (!allowedHistory) history = null;
if (!allowedBlock) undo = redo = null;
@ -204,7 +201,6 @@ class MenuBlockMore extends React.Component<I.Menu> {
{ children: [ fav, pageLink, linkTo, pageCopy ] },
{ children: [ search ] },
{ children: [ print ] },
{ children: [ share ] },
];
} else
if (block.isPage()) {
@ -402,17 +398,17 @@ class MenuBlockMore extends React.Component<I.Menu> {
switch (item.id) {
case 'undo':
keyboard.onUndo(rootId);
keyboard.onUndo(rootId, 'MenuObject');
close = false;
break;
case 'redo':
keyboard.onRedo(rootId);
keyboard.onRedo(rootId, 'MenuObject');
close = false;
break;
case 'print':
keyboard.onPrint();
keyboard.onPrint('MenuObject');
break;
case 'history':
@ -421,15 +417,16 @@ class MenuBlockMore extends React.Component<I.Menu> {
break;
case 'search':
keyboard.onSearchMenu('');
keyboard.onSearchMenu('', 'MenuObject');
break;
case 'pageCopy':
C.ObjectListDuplicate([ rootId ], (message: any) => {
if (!message.error.code && message.ids.length) {
ObjectUtil.openPopup({ id: message.ids[0], layout: object.layout });
analytics.event('DuplicateObject', { count: 1, route: 'MenuObject' });
};
analytics.event('DuplicateObject', { count: 1 });
});
break;
@ -444,7 +441,7 @@ class MenuBlockMore extends React.Component<I.Menu> {
};
onBack();
analytics.event('MoveToBin', { count: 1 });
analytics.event('MoveToBin', { count: 1, route: 'MenuObject' });
});
break;
@ -454,16 +451,16 @@ class MenuBlockMore extends React.Component<I.Menu> {
return;
};
analytics.event('RestoreFromBin', { count: 1 });
analytics.event('RestoreFromBin', { count: 1, route: 'MenuObject' });
});
break;
case 'pageLock':
keyboard.onLock(rootId, true);
keyboard.onLock(rootId, true, 'MenuObject');
break;
case 'pageUnlock':
keyboard.onLock(rootId, false);
keyboard.onLock(rootId, false, 'MenuObject');
break;
case 'pageCreate':
@ -482,39 +479,18 @@ class MenuBlockMore extends React.Component<I.Menu> {
case 'pageRemove':
C.ObjectListDelete([ object.id ], () => {
onBack();
analytics.event('RemoveCompletely', { count: 1 });
});
break;
case 'pageShare':
C.ObjectShareByLink(object.id, (message: any) => {
if (message.error.code) {
return;
};
popupStore.open('prompt', {
data: {
title: 'Link to share',
value: message.link,
readonly: true,
select: true,
textConfirm: 'Copy',
onChange: (v: string) => {
Util.clipboardCopy({ text: v });
Preview.toastShow({ text: 'Link to share copied to clipboard' });
}
}
});
analytics.event('RemoveCompletely', { count: 1, route: 'MenuObject' });
});
break;
case 'pageLink':
Util.clipboardCopy({ text: Url.protocol + ObjectUtil.route(object) });
analytics.event('CopyLink', { route: 'MenuObject' });
break;
case 'pageReload':
C.ObjectBookmarkFetch(rootId, object.source, () => {
analytics.event('ReloadSourceData');
analytics.event('ReloadSourceData', { route: 'MenuObject' });
});
break;
@ -530,13 +506,13 @@ class MenuBlockMore extends React.Component<I.Menu> {
case 'fav':
C.ObjectSetIsFavorite(rootId, true, () => {
analytics.event('AddToFavorites', { count: 1 });
analytics.event('AddToFavorites', { count: 1, route: 'MenuObject' });
});
break;
case 'unfav':
C.ObjectSetIsFavorite(rootId, false, () => {
analytics.event('RemoveFromFavorites', { count: 1 });
analytics.event('RemoveFromFavorites', { count: 1, route: 'MenuObject' });
});
break;
@ -550,7 +526,7 @@ class MenuBlockMore extends React.Component<I.Menu> {
C.TemplateCreateFromObject(rootId, (message: any) => {
ObjectUtil.openPopup({ id: message.id, layout: object.layout });
analytics.event('CreateTemplate', { objectType: object.type });
analytics.event('CreateTemplate', { objectType: object.type, route: 'MenuObject' });
});
break;
};

View file

@ -270,6 +270,10 @@ class MenuContext extends React.Component<I.Menu> {
case 'copy':
C.ObjectListDuplicate(objectIds, (message: any) => {
if (message.error.code || !message.ids.length) {
return;
};
if (count == 1) {
ObjectUtil.openPopup(detailStore.get(subId, message.ids[0], []));
};

View file

@ -233,9 +233,9 @@ const MenuViewEdit = observer(class MenuViewEdit extends React.Component<I.Menu>
this.forceUpdate();
};
getViewName () {
const { name, type } = this.param;
return name || translate(`viewName${type}`);
getViewName (name?: string) {
const { type } = this.param;
return name || this.param.name || translate(`viewName${type}`);
};
getSections () {
@ -438,7 +438,7 @@ const MenuViewEdit = observer(class MenuViewEdit extends React.Component<I.Menu>
switch (item.id) {
case 'copy': {
C.BlockDataviewViewCreate(rootId, blockId, view, sources, (message: any) => {
C.BlockDataviewViewCreate(rootId, blockId, { ...view, name: this.getViewName(view.name) }, sources, (message: any) => {
if (onSave) {
onSave();
};

View file

@ -85,10 +85,8 @@ class MenuHelp extends React.Component<I.Menu> {
onClick (e: any, item: any) {
const { getId, close } = this.props;
const rootId = keyboard.getRootId();
const match = keyboard.getMatch();
const { page, action } = match.params;
const isEditor = (page == 'main') && (action == 'edit');
const isGraph = (page == 'main') && (action == 'graph');
close();
@ -124,7 +122,7 @@ class MenuHelp extends React.Component<I.Menu> {
case 'hints': {
if (isGraph) {
Onboarding.start('wizardGraph', keyboard.isPopup(), true);
Onboarding.start('mainGraph', keyboard.isPopup(), true);
} else {
popupStore.open('migration', { data: { type: 'onboarding' } });
};

View file

@ -176,6 +176,7 @@ const Menu = observer(class Menu extends React.Component<I.Menu, State> {
this.getSize = this.getSize.bind(this);
this.getPosition = this.getPosition.bind(this);
this.onMouseLeave = this.onMouseLeave.bind(this);
this.onDimmerClick = this.onDimmerClick.bind(this);
};
render () {
@ -272,7 +273,7 @@ const Menu = observer(class Menu extends React.Component<I.Menu, State> {
</div>
</div>
{!noDimmer ? (
<Dimmer onClick={() => { menuStore.close(id); }} className={cd.join(' ')} />
<Dimmer onClick={this.onDimmerClick} className={cd.join(' ')} />
) : ''}
</div>
);
@ -628,6 +629,15 @@ const Menu = observer(class Menu extends React.Component<I.Menu, State> {
close () {
menuStore.close(this.props.id);
};
onDimmerClick () {
const { param } = this.props;
const { noClose } = param;
if (!noClose) {
this.close();
};
};
onMouseLeave (e: any) {
const { param } = this.props;
@ -804,7 +814,7 @@ const Menu = observer(class Menu extends React.Component<I.Menu, State> {
});
};
if (!refInput || (refInput && !refInput.isFocused)) {
if (!keyboard.isFocused && (!refInput || (refInput && !refInput.isFocused))) {
if (this.ref && this.ref.onRemove) {
keyboard.shortcut('backspace', e, () => {
e.preventDefault();

View file

@ -120,7 +120,9 @@ class MenuSearchText extends React.Component<I.Menu> {
};
search () {
const { storageSet } = this.props;
const { storageSet, param } = this.props;
const { data } = param;
const { route } = data;
const searchContainer = this.getSearchContainer();
const value = Util.filterFix(this.ref.getValue());
const node = $(this.node);
@ -138,7 +140,7 @@ class MenuSearchText extends React.Component<I.Menu> {
return;
};
analytics.event('SearchWords', { length: value.length });
analytics.event('SearchWords', { length: value.length, route });
findAndReplaceDOMText(searchContainer.get(0), {
preset: 'prose',

View file

@ -272,9 +272,9 @@ const MenuWidget = observer(class MenuWidget extends React.Component<I.Menu> {
dataChange: (items: any[]) => {
const fixed: any[] = [
{ id: Constant.widgetId.favorite, name: 'Favorites', iconEmoji: ':star:' },
{ id: Constant.widgetId.recent, name: 'Recent', iconEmoji: ':date:' },
{ id: Constant.widgetId.set, name: 'Sets', iconEmoji: ':books:' },
{ id: Constant.widgetId.collection, name: 'Collections', iconEmoji: ':open_file_folder:' },
{ id: Constant.widgetId.recent, name: 'Recent', iconEmoji: ':date:' },
];
return !items.length ? fixed : fixed.concat([ { isDiv: true } ]).concat(items);
},
@ -368,7 +368,9 @@ const MenuWidget = observer(class MenuWidget extends React.Component<I.Menu> {
onSave();
};
analytics.event(isEditing ? 'EditWidget' : 'AddWidget', { type: this.layout });
if (!isEditing) {
analytics.event('AddWidget', { type: this.layout });
};
});
close();

View file

@ -246,7 +246,7 @@ const Page = observer(class Page extends React.Component<I.PageComponent> {
const { id } = match.params;
const isPopup = keyboard.isPopup();
if (!home || !id || (home.id != id) || isPopup || Storage.getOnboarding('wizardDashboard')) {
if (!home || !id || (home.id != id) || isPopup || Storage.getOnboarding('dashboard')) {
return;
};

View file

@ -8,8 +8,8 @@ import Constant from 'json/constant.json';
const ctrl = keyboard.cmdSymbol();
const Tabs = [
{ id: 'graph', name: 'Graph', layout: I.ObjectLayout.Graph, tooltip: `${ctrl} + Alt + O` },
{ id: 'navigation', name: 'Flow', layout: I.ObjectLayout.Navigation, tooltip: `${ctrl} + O` },
{ id: 'graph', name: 'Graph', layout: I.ObjectLayout.Graph, tooltipCaption: `${ctrl} + Alt + O` },
{ id: 'navigation', name: 'Flow', layout: I.ObjectLayout.Navigation, tooltipCaption: `${ctrl} + O` },
];
const PageMainGraph = observer(class PageMainGraph extends React.Component<I.PageComponent> {
@ -239,14 +239,34 @@ const PageMainGraph = observer(class PageMainGraph extends React.Component<I.Pag
};
onSelect (id: string, related?: string[]) {
const { root } = blockStore;
const isSelected = this.ids.includes(id);
if (id === root) {
return;
};
let ids = [ id ];
if (related && related.length) {
this.ids = [];
if (!isSelected) {
this.ids = [];
};
ids = ids.concat(related);
};
ids.forEach((id) => {
if (id === root) {
return;
};
if (isSelected) {
this.ids = this.ids.filter(it => it != id);
return;
};
this.ids = this.ids.includes(id) ? this.ids.filter(it => it != id) : this.ids.concat([ id ]);
});
this.refGraph.send('onSetSelected', { ids: this.ids });

View file

@ -26,8 +26,8 @@ enum Panel {
const cmd = keyboard.cmdSymbol();
const Tabs = [
{ id: 'graph', name: 'Graph', layout: I.ObjectLayout.Graph, tooltip: `${cmd} + Alt + O` },
{ id: 'navigation', name: 'Flow', layout: I.ObjectLayout.Navigation, tooltip: `${cmd} + O` },
{ id: 'graph', name: 'Graph', layout: I.ObjectLayout.Graph, tooltipCaption: `${cmd} + Alt + O` },
{ id: 'navigation', name: 'Flow', layout: I.ObjectLayout.Navigation, tooltipCaption: `${cmd} + O` },
];
const PageMainNavigation = observer(class PageMainNavigation extends React.Component<I.PageComponent, State> {
@ -77,8 +77,13 @@ const PageMainNavigation = observer(class PageMainNavigation extends React.Compo
let { layout, name, description, snippet } = item || {};
return (
<div id={'item-' + item.id} className="item" onMouseOver={(e: any) => { this.onOver(e, item); }}>
<div className="inner" onClick={(e: any) => { this.onClick(e, item); }}>
<div
id={'item-' + item.id}
className="item"
onMouseEnter={e => this.onOver(e, item)}
onMouseLeave={() => this.unsetActive()}
>
<div className="inner" onClick={e => this.onClick(e, item)}>
{item.isRoot ? iconHome : <IconObject object={item} forceLetter={true} size={48} iconSize={24} />}
<div className="info">
<ObjectName object={item} />
@ -264,8 +269,6 @@ const PageMainNavigation = observer(class PageMainNavigation extends React.Compo
const { pagesIn, pagesOut } = this.state;
this.loadPage(rootId);
this.resize();
this.setActive();
this.cacheIn = new CellMeasurerCache({
fixedWidth: true,
@ -278,6 +281,9 @@ const PageMainNavigation = observer(class PageMainNavigation extends React.Compo
defaultHeight: HEIGHT,
keyMapper: i => (pagesOut[i] || {}).id,
});
this.resize();
this.setActive();
};
componentWillUnmount () {
@ -427,7 +433,6 @@ const PageMainNavigation = observer(class PageMainNavigation extends React.Compo
unsetActive () {
const node = $(this.node);
node.find('.items .item.active').removeClass('active');
};

View file

@ -23,8 +23,8 @@ enum View {
const cmd = keyboard.cmdSymbol();
const Tabs = [
{ id: Tab.Type, name: 'Types', tooltip: `${cmd} + T` },
{ id: Tab.Relation, name: 'Relations', tooltip: `${cmd} + Alt + T` },
{ id: Tab.Type, name: 'Types', tooltipCaption: `${cmd} + T` },
{ id: Tab.Relation, name: 'Relations', tooltipCaption: `${cmd} + Alt + T` },
];
const PageMainStore = observer(class PageMainStore extends React.Component<I.PageComponent, State> {
@ -446,7 +446,6 @@ const PageMainStore = observer(class PageMainStore extends React.Component<I.Pag
case Tab.Relation:
keys = keys.concat(Constant.relationRelationKeys);
filters.push({ operator: I.FilterOperator.And, relationKey: 'relationKey', condition: I.FilterCondition.NotIn, value: ObjectUtil.getSystemRelationKeys() });
break;
};

View file

@ -72,8 +72,14 @@ const PageMainType = observer(class PageMainType extends React.Component<I.PageC
const allowedRelation = object.isInstalled && blockStore.checkFlags(rootId, rootId, [ I.RestrictionObject.Relation ]);
const allowedTemplate = object.isInstalled && allowedObject && showTemplates;
const relations = (object.recommendedRelations || []).map(id => dbStore.getRelationById(id)).filter((it: any) => {
if (!it || ObjectUtil.getSystemRelationKeys().includes(it.relationKey)) {
const relations = (object.recommendedRelations || []).map(id => dbStore.getRelationById(id)).filter(it => {
if (!it) {
return false;
};
if ([ 'tag', 'description' ].includes(it.relationKey)) {
return true;
};
if (ObjectUtil.getSystemRelationKeys().includes(it.relationKey)) {
return false;
};
return config.debug.ho ? true : !it.isHidden;

View file

@ -92,7 +92,7 @@ const PopupMigration = observer(class PopupMigration extends React.Component<I.P
const { type } = data;
if (type == 'onboarding') {
Onboarding.start('wizardDashboard', false, true);
Onboarding.start('dashboard', false, true);
};
};

View file

@ -26,8 +26,11 @@ const PopupSettingsPageDelete = observer(class PopupSettingsPageDelete extends R
<Title text={translate('popupSettingsAccountDeleteTitle')} />
<div className="text">
<b>We&apos;re sorry to see you go. Once you request your account to be deleted, you have 30 days to cancel this request.</b>
<p>You will be logged out on all other devices. You will have 30 days to recover it. Afterwards it will be deleted permanently</p>
<b>1. You have 30 days to cancel account deletion</b>
<p className="first">We&apos;re sorry to see you go. Once you request your account to be deleted, you have 30 days to cancel this request. After 30 days, your account data is permanently removed from the backup node, you won't be able to sign into Anytype on new devices.</p>
<b>2. Delete data from other devices</b>
<p>Since Anytype stores all your data locally on the device, you need to remove it from other devices also. Launch and remove data in Anytype or just delete the app.</p>
</div>
<div className="check" onClick={this.onCheck}>

View file

@ -2,12 +2,13 @@ import * as React from 'react';
import $ from 'jquery';
import raf from 'raf';
import { observer } from 'mobx-react';
import { PreviewLink, PreviewObject, PreviewDefault } from 'Component';
import { I, Util, DataUtil, ObjectUtil, Preview, Mark, translate, Renderer } from 'Lib';
import { PreviewLink, PreviewObject, PreviewDefault, Loader } from 'Component';
import { I, Util, ObjectUtil, Preview, Mark, translate, Renderer } from 'Lib';
import { commonStore, menuStore } from 'Store';
interface State {
object: any;
loading: boolean;
};
const OFFSET_Y = 8;
@ -17,6 +18,7 @@ const PreviewComponent = observer(class PreviewComponent extends React.Component
state = {
object: null,
loading: false,
};
ref: any = null;
@ -34,7 +36,7 @@ const PreviewComponent = observer(class PreviewComponent extends React.Component
render () {
const { preview } = commonStore;
const { type, target, noUnlink } = preview;
const { object } = this.state;
const { object, loading } = this.state;
const cn = [ 'previewWrapper' ];
let head = null;
@ -92,35 +94,49 @@ const PreviewComponent = observer(class PreviewComponent extends React.Component
return (
<div id="preview" className={cn.join(' ')}>
<div className="polygon" onClick={this.onClick} />
<div className="content">
{head}
{loading ? <Loader /> : (
<div className="content">
{head}
<div className="cp" onClick={this.onClick}>
{content}
<div className="cp" onClick={this.onClick}>
{content}
</div>
</div>
</div>
)}
</div>
);
};
componentDidUpdate () {
componentDidMount(): void {
this.init();
};
componentDidUpdate (): void {
this.init();
};
init () {
const { preview } = commonStore;
const { type, target } = preview;
const { object } = this.state;
const { object, loading } = this.state;
if (type == I.PreviewType.Default) {
if (!object || (object.id != target)) {
ObjectUtil.getById(target, object => {
this.setObject(object);
this.position();
});
} else {
if (type != I.PreviewType.Default) {
return;
};
if (!loading && (!object || (object.id != target))) {
this.setState({ loading: true });
ObjectUtil.getById(target, object => {
this.setState({ object, loading: false });
this.position();
};
});
} else {
this.position();
};
};
onClick (e) {
onClick (e: React.MouseEvent) {
const { preview } = commonStore;
const { type, target } = preview;
const { object } = this.state;

View file

@ -314,9 +314,7 @@ const Graph = observer(class Graph extends React.Component<Props> {
case 'onSelect': {
const { related } = data;
if (data.node != root) {
onSelect(data.node, related);
};
onSelect(data.node, related);
break;
};
@ -326,13 +324,7 @@ const Graph = observer(class Graph extends React.Component<Props> {
};
this.subject = this.nodes.find(d => d.id == data.node);
if (this.subject) {
window.clearTimeout(this.timeoutPreview);
this.timeoutPreview = window.setTimeout(() => { this.onPreviewShow(data); }, 300);
} else {
this.onPreviewHide();
};
this.subject ? this.onPreviewShow(data) : this.onPreviewHide();
break;
};

View file

@ -79,15 +79,10 @@ class Icon extends React.Component<Props> {
onMouseEnter (e: any) {
const { tooltip, tooltipCaption, tooltipX, tooltipY, onMouseEnter } = this.props;
const node = $(this.node);
const t = Preview.tooltipCaption(tooltip, tooltipCaption);
if (tooltip) {
const t = [ tooltip ];
if (tooltipCaption) {
t.push(`<span class="caption">${tooltipCaption}</span>`);
};
Preview.tooltipShow({ text: t.join(' '), element: node, typeX: tooltipX, typeY: tooltipY });
if (t) {
Preview.tooltipShow({ text: t, element: node, typeX: tooltipX, typeY: tooltipY });
};
if (onMouseEnter) {

View file

@ -138,23 +138,20 @@ const Toast = observer(class Toast extends React.Component<object, State> {
onClick (e: any, action: string) {
switch (action) {
case 'open':
case 'open': {
this.onOpen(e);
break;
};
case 'undo':
this.onUndo(e);
case 'undo': {
keyboard.onUndo(commonStore.toast.originId, 'Toast');
break;
};
};
this.close();
};
onUndo (e: any) {
C.ObjectUndo(commonStore.toast.originId);
analytics.event('Undo', { route: 'toast' });
};
onOpen (e: any) {
ObjectUtil.openEvent(e, commonStore.toast.target);
};

View file

@ -35,8 +35,12 @@ const WidgetSpace = observer(class WidgetSpace extends React.Component<I.WidgetC
};
onOpenSpace () {
/*
ObjectUtil.openHome('route');
analytics.event('GoToSpaceDashboard');
*/
popupStore.open('settings', {});
};
onOpenSettings (e: React.MouseEvent) {

View file

@ -1,9 +1,8 @@
import { I } from 'Lib';
export default {
wizardGraph: {
mainGraph: {
category: 'Onboarding',
showConfetti: true,
items: [
{
description: `
@ -27,11 +26,13 @@ export default {
vertical: I.MenuDirection.Top,
horizontal: I.MenuDirection.Right,
noArrow: true,
noClose: true,
passThrough: true,
offsetY: -4,
},
},
wizardDashboard: {
dashboard: {
category: 'Onboarding',
showConfetti: true,
items: [
@ -86,6 +87,8 @@ export default {
vertical: I.MenuDirection.Top,
horizontal: I.MenuDirection.Right,
noArrow: true,
noClose: true,
passThrough: true,
offsetY: -4,
},
},

View file

@ -134,7 +134,7 @@ export interface HeaderComponent extends RouteComponentProps<any> {
onSearch?: () => void;
onNavigation?: () => void;
onGraph?: () => void;
onTooltipShow?: (e: any, text: string) => void;
onTooltipShow?: (e: any, text: string, caption?: string) => void;
onTooltipHide?: () => void;
menuOpen?: (id: string, elementId: string, param: Partial<I.MenuParam>) => void;
};

View file

@ -14,7 +14,6 @@ export interface MenuParam {
menuKey?: string;
element?: any;
rect?: any;
recalcRect?(): { width: number, height: number, x: number, y: number };
type?: MenuType;
vertical?: MenuDirection;
horizontal?: MenuDirection;
@ -24,7 +23,6 @@ export interface MenuParam {
offsetY?: any;
width?: number;
height?: number;
getTabs?(): I.MenuTab[];
initialTab?: string;
data?: any;
isSub?: boolean;
@ -32,14 +30,17 @@ export interface MenuParam {
passThrough?: boolean;
className?: string;
classNameWrap?: string;
withArrow?: boolean;
commonFilter?: boolean;
noAnimation?: boolean;
noDimmer?: boolean;
noFlipX?: boolean;
noFlipY?: boolean;
withArrow?: boolean;
commonFilter?: boolean;
noClose?: boolean;
recalcRect?(): { width: number, height: number, x: number, y: number };
onClose?(): void;
onOpen?(component?: any): void;
getTabs?(): I.MenuTab[];
};
export interface Menu {
@ -71,10 +72,6 @@ export interface MenuItem {
arrow?: boolean;
checkbox?: boolean;
className?: string;
isActive?: boolean;
withDescription?: boolean;
withSwitch?: boolean;
withSelect?: boolean;
switchValue?: boolean;
selectValue?: any;
readonly?: boolean;
@ -83,6 +80,10 @@ export interface MenuItem {
forceLetter?: boolean;
options?: I.Option[];
selectMenuParam?: any;
isActive?: boolean;
withDescription?: boolean;
withSwitch?: boolean;
withSelect?: boolean;
onClick?(e: any): void;
onMouseEnter?(e: any): void;
onMouseLeave?(e: any): void;

View file

@ -328,7 +328,7 @@ class Action {
const { walletPath } = authStore;
this.openFile([ 'zip' ], paths => {
C.AccountRecoverFromLegacyExport(paths[0], walletPath, (message: any) => {
C.AccountRecoverFromLegacyExport(paths[0], walletPath, Util.rand(1, Constant.iconCnt), (message: any) => {
if (onError(message.error)) {
return;
};

View file

@ -239,8 +239,7 @@ class Analytics {
break;
};
case 'AddWidget':
case 'EditWidget': {
case 'AddWidget': {
data.type = I.WidgetLayout[data.type];
break;
};

View file

@ -1,7 +1,10 @@
import { I, Util, Mark, dispatcher, Encode, Mapper } from 'Lib';
import Commands from 'protobuf/pb/protos/commands_pb';
import Model from 'protobuf/pkg/lib/pb/model/protos/models_pb';
import { Encode } from './struct';
import { Mapper } from './mapper';
import { dispatcher } from './dispatcher';
import { I, Util, Mark } from 'Lib';
const Commands = require('lib/pb/protos/commands_pb');
const Model = require('lib/pkg/lib/pb/model/protos/models_pb.js');
const Rpc = Commands.Rpc;
const MetricsSetParameters = (platform: I.Platform, callBack?: (message: any) => void) => {
@ -155,11 +158,12 @@ const AccountMove = (path: string, callBack?: (message: any) => void) => {
dispatcher.request(AccountMove.name, request, callBack);
};
const AccountRecoverFromLegacyExport = (path: string, rootPath: string, callBack?: (message: any) => void) => {
const AccountRecoverFromLegacyExport = (path: string, rootPath: string, icon: number, callBack?: (message: any) => void) => {
const request = new Rpc.Account.RecoverFromLegacyExport.Request();
request.setPath(path);
request.setRootpath(rootPath);
request.setIcon(icon);
dispatcher.request(AccountRecoverFromLegacyExport.name, request, callBack);
};
@ -171,7 +175,7 @@ const FileDrop = (contextId: string, targetId: string, position: I.BlockPosition
request.setContextid(contextId);
request.setDroptargetid(targetId);
request.setPosition(position);
request.setPosition(position as number);
request.setLocalfilepathsList(paths);
dispatcher.request(FileDrop.name, request, callBack);
@ -186,7 +190,7 @@ const FileUpload = (url: string, path: string, type: I.FileType, callBack?: (mes
request.setUrl(url);
request.setLocalpath(path);
request.setType(type);
request.setType(type as number);
dispatcher.request(FileUpload.name, request, callBack);
};
@ -222,7 +226,7 @@ const BlockCreate = (contextId: string, targetId: string, position: I.BlockPosit
request.setContextid(contextId);
request.setTargetid(targetId);
request.setPosition(position);
request.setPosition(position as number);
request.setBlock(Mapper.To.Block(block));
dispatcher.request(BlockCreate.name, request, callBack);
@ -245,14 +249,14 @@ const BlockTextSetText = (contextId: string, blockId: string, text: string, mark
text = text.replace(/&gt;/g, '>');
marks = Util.objectCopy(marks);
marks = Mark.checkRanges(text, marks).map(Mapper.To.Mark);
marks = Mark.checkRanges(text, marks).map(Mapper.To.Mark) as any;
const request = new Rpc.BlockText.SetText.Request();
request.setContextid(contextId);
request.setBlockid(blockId);
request.setText(text);
request.setMarks(new Model.Block.Content.Text.Marks().setMarksList(marks));
request.setMarks(new Model.Block.Content.Text.Marks().setMarksList(marks as any));
dispatcher.request(BlockTextSetText.name, request, callBack);
};
@ -305,8 +309,8 @@ const BlockSplit = (contextId: string, blockId: string, range: I.TextRange, styl
request.setContextid(contextId);
request.setBlockid(blockId);
request.setRange(Mapper.To.Range(range));
request.setStyle(style);
request.setMode(mode);
request.setStyle(style as number);
request.setMode(mode as number);
dispatcher.request(BlockSplit.name, request, callBack);
};
@ -326,7 +330,7 @@ const BlockBookmarkCreateAndFetch = (contextId: string, targetId: string, positi
request.setContextid(contextId);
request.setTargetid(targetId);
request.setPosition(position);
request.setPosition(position as number);
request.setUrl(url);
dispatcher.request(BlockBookmarkCreateAndFetch.name, request, callBack);
@ -392,7 +396,7 @@ const BlockListMoveToExistingObject = (contextId: string, targetContextId: strin
request.setTargetcontextid(targetContextId);
request.setBlockidsList(blockIds);
request.setDroptargetid(targetId);
request.setPosition(position);
request.setPosition(position as number);
dispatcher.request(BlockListMoveToExistingObject.name, request, callBack);
};
@ -414,7 +418,7 @@ const BlockListDuplicate = (contextId: string, targetContextId: string, blockIds
request.setTargetcontextid(targetContextId);
request.setBlockidsList(blockIds);
request.setTargetid(targetId);
request.setPosition(position);
request.setPosition(position as number);
dispatcher.request(BlockListDuplicate.name, request, callBack);
};
@ -424,7 +428,7 @@ const BlockListTurnInto = (contextId: string, blockIds: string[], style: I.TextS
request.setContextid(contextId);
request.setBlockidsList(blockIds);
request.setStyle(style);
request.setStyle(style as number);
dispatcher.request(BlockListTurnInto.name, request, callBack);
};
@ -445,7 +449,7 @@ const BlockDivListSetStyle = (contextId: string, blockIds: string[], style: I.Te
request.setContextid(contextId);
request.setBlockidsList(blockIds);
request.setStyle(style);
request.setStyle(style as number);
dispatcher.request(BlockDivListSetStyle.name, request, callBack);
};
@ -471,7 +475,7 @@ const BlockLinkCreateWithObject = (contextId: string, targetId: string, details:
request.setContextid(contextId);
request.setTargetid(targetId);
request.setPosition(position);
request.setPosition(position as number);
request.setDetails(Encode.encodeStruct(details));
request.setTemplateid(templateId);
request.setFields(Encode.encodeStruct(fields || {}));
@ -485,9 +489,9 @@ const BlockLinkListSetAppearance = (contextId: string, blockIds: any[], iconSize
request.setContextid(contextId);
request.setBlockidsList(blockIds);
request.setIconsize(iconSize);
request.setCardstyle(cardStyle);
request.setDescription(description);
request.setIconsize(iconSize as number);
request.setCardstyle(cardStyle as number);
request.setDescription(description as number);
request.setRelationsList(relations);
dispatcher.request(BlockLinkListSetAppearance.name, request, callBack);
@ -500,7 +504,7 @@ const BlockTableCreate = (contextId: string, targetId: string, position: I.Block
request.setContextid(contextId);
request.setTargetid(targetId);
request.setPosition(position);
request.setPosition(position as number);
request.setRows(rows);
request.setColumns(columns);
request.setWithheaderrow(withHeaderRow);
@ -524,7 +528,7 @@ const BlockTableSort = (contextId: string, columnId: string, type: I.SortType, c
request.setContextid(contextId);
request.setColumnid(columnId);
request.setType(type);
request.setType(type as number);
dispatcher.request(BlockTableSort.name, request, callBack);
};
@ -534,7 +538,7 @@ const BlockTableRowCreate = (contextId: string, targetId: string, position: I.Bl
request.setContextid(contextId);
request.setTargetid(targetId);
request.setPosition(position);
request.setPosition(position as number);
dispatcher.request(BlockTableRowCreate.name, request, callBack);
};
@ -545,7 +549,7 @@ const BlockTableRowDuplicate = (contextId: string, blockId: string, targetId: st
request.setContextid(contextId);
request.setBlockid(blockId);
request.setTargetid(targetId);
request.setPosition(position);
request.setPosition(position as number);
dispatcher.request(BlockTableRowDuplicate.name, request, callBack);
};
@ -583,7 +587,7 @@ const BlockTableColumnCreate = (contextId: string, targetId: string, position: I
request.setContextid(contextId);
request.setTargetid(targetId);
request.setPosition(position);
request.setPosition(position as number);
dispatcher.request(BlockTableColumnCreate.name, request, callBack);
};
@ -603,7 +607,7 @@ const BlockTableColumnMove = (contextId: string, targetId: string, dropTargetId:
request.setContextid(contextId);
request.setTargetid(targetId);
request.setDroptargetid(dropTargetId);
request.setPosition(position);
request.setPosition(position as number);
dispatcher.request(BlockTableColumnMove.name, request, callBack);
};
@ -614,7 +618,7 @@ const BlockTableColumnDuplicate = (contextId: string, blockId: string, targetId:
request.setContextid(contextId);
request.setBlockid(blockId);
request.setTargetid(targetId);
request.setPosition(position);
request.setPosition(position as number);
dispatcher.request(BlockTableColumnDuplicate.name, request, callBack);
};
@ -631,13 +635,13 @@ const BlockTableColumnListFill = (contextId: string, blockIds: string[], callBac
// ---------------------- BLOCK FILE ---------------------- //
const BlockFileCreateAndUpload = (contextId: string, targetId: string, position: I.BlockPosition, url: string, path: string, callBack?: (message: any) => void) => {
const request = new Rpc.BlockfFile.CreateAndUpload.Request();
const request = new Rpc.BlockFile.CreateAndUpload.Request();
request.setContextid(contextId);
request.setTargetid(targetId);
request.setPosition(position);
request.setPosition(position as number);
request.setUrl(url);
request.setFilepath(path);
request.setLocalpath(path);
dispatcher.request(BlockFileCreateAndUpload.name, request, callBack);
};
@ -647,7 +651,7 @@ const BlockFileListSetStyle = (contextId: string, blockIds: string[], style: I.F
request.setContextid(contextId);
request.setBlockidsList(blockIds);
request.setStyle(style);
request.setStyle(style as number);
dispatcher.request(BlockFileListSetStyle.name, request, callBack);
};
@ -679,7 +683,7 @@ const BlockTextListSetStyle = (contextId: string, blockIds: string[], style: I.T
request.setContextid(contextId);
request.setBlockidsList(blockIds);
request.setStyle(style);
request.setStyle(style as number);
dispatcher.request(BlockTextListSetStyle.name, request, callBack);
};
@ -728,7 +732,7 @@ const BlockListSetAlign = (contextId: string, blockIds: string[], align: I.Block
request.setContextid(contextId);
request.setBlockidsList(blockIds);
request.setAlign(align);
request.setAlign(align as number);
dispatcher.request(BlockListSetAlign.name, request, callBack);
};
@ -738,7 +742,7 @@ const BlockListSetVerticalAlign = (contextId: string, blockIds: string[], align:
request.setContextid(contextId);
request.setBlockidsList(blockIds);
request.setVerticalalign(align);
request.setVerticalalign(align as number);
dispatcher.request(BlockListSetVerticalAlign.name, request, callBack);
};
@ -990,8 +994,8 @@ const BlockCreateWidget = (contextId: string, targetId: string, block: any, posi
request.setContextid(contextId);
request.setTargetid(targetId);
request.setBlock(Mapper.To.Block(block));
request.setPosition(position);
request.setWidgetlayout(layout);
request.setPosition(position as number);
request.setWidgetlayout(layout as number);
dispatcher.request(BlockCreateWidget.name, request, callBack);
};
@ -1249,8 +1253,8 @@ const ObjectImport = (options: any, snapshots: any[], existing: boolean, type: I
request.setSnapshotsList((snapshots || []).map(Mapper.To.Snapshot));
request.setUpdateexistingobjects(existing);
request.setType(type);
request.setMode(mode);
request.setType(type as number);
request.setMode(mode as number);
request.setNoprogress(noProgress);
request.setIsmigration(isMigration);
@ -1317,7 +1321,7 @@ const ObjectSearchSubscribe = (subId: string, filters: I.Filter[], sorts: I.Sort
request.setLimit(limit);
request.setKeysList(Util.arrayUnique(keys));
request.setSourceList(sources);
request.setIgnoreworkspace(ignoreWorkspace);
request.setIgnoreworkspace(ignoreWorkspace as any);
request.setAfterid(afterId);
request.setBeforeid(beforeId);
request.setNodepsubscription(noDeps);
@ -1344,7 +1348,7 @@ const ObjectSubscribeIds = (subId: string, ids: string[], keys: string[], ignore
request.setSubid(subId);
request.setIdsList(ids);
request.setKeysList(keys);
request.setIgnoreworkspace(ignoreWorkspace);
request.setIgnoreworkspace(ignoreWorkspace as any);
request.setNodepsubscription(noDeps);
dispatcher.request(ObjectSubscribeIds.name, request, callBack);
@ -1398,7 +1402,7 @@ const ObjectSetLayout = (contextId: string, layout: I.ObjectLayout, callBack?: (
const request = new Rpc.Object.SetLayout.Request();
request.setContextid(contextId);
request.setLayout(layout);
request.setLayout(layout as number);
dispatcher.request(ObjectSetLayout.name, request, callBack);
};
@ -1561,7 +1565,7 @@ const ObjectListExport = (path: string, objectIds: string[], format: I.ExportTyp
request.setPath(path);
request.setObjectidsList(objectIds);
request.setFormat(format);
request.setFormat(format as number);
request.setZip(zip);
request.setIncludenested(includeNested);
request.setIncludefiles(includeFiles);
@ -1625,18 +1629,10 @@ const UnsplashDownload = (id: string, callBack?: (message: any) => void) => {
// ---------------------- DEBUG ---------------------- //
const DebugSync = (limit: number, callBack?: (message: any) => void) => {
const request = new Rpc.Debug.Sync.Request();
request.setRecordstraverselimit(limit);
dispatcher.request(DebugSync.name, request, callBack);
};
const DebugTree = (objectId: string, path: string, callBack?: (message: any) => void) => {
const request = new Rpc.Debug.Tree.Request();
request.setObjectid(objectId);
request.setTreeid(objectId);
request.setPath(path);
dispatcher.request(DebugTree.name, request, callBack);
@ -1682,7 +1678,6 @@ export {
AccountDelete,
AccountMove,
DebugSync,
DebugTree,
DebugExportLocalstore,
DebugSpaceSummary,

View file

@ -1,16 +1,18 @@
import { authStore, commonStore, blockStore, detailStore, dbStore, popupStore } from 'Store';
import { Util, I, M, Decode, translate, analytics, Response, Mapper, Renderer, Action, Dataview, Preview } from 'Lib';
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';
import { authStore, commonStore, blockStore, detailStore, dbStore } from 'Store';
import { Util, I, M, translate, analytics, Renderer, Action, Dataview, Preview } from 'Lib';
import { observable } from 'mobx';
import * as Sentry from '@sentry/browser';
import arrayMove from 'array-move';
import Constant from 'json/constant.json';
const Service = require('lib/pb/protos/service/service_grpc_web_pb');
const Commands = require('lib/pb/protos/commands_pb');
const Events = require('lib/pb/protos/events_pb');
import { Decode } from './struct';
import { Mapper } from './mapper';
import * as Response from './response';
import { ClientReadableStream } from 'grpc-web';
const SORT_IDS = [
'objectShow',
'blockAdd',
'blockDelete',
'blockSetChildrenIds',
@ -27,8 +29,8 @@ const SKIP_SENTRY_ERRORS = [ 'LinkPreview' ];
class Dispatcher {
service: any = null;
stream: any = null;
service: Service.ClientCommandsClient = null;
stream: ClientReadableStream<Events.Event> = null;
timeoutStream = 0;
timeoutEvent: any = {};
reconnects = 0;
@ -50,7 +52,7 @@ class Dispatcher {
this.stream = this.service.listenSessionEvents(request, null);
this.stream.on('data', (event: any) => {
this.stream.on('data', (event) => {
try {
this.event(event, false);
} catch (e) {
@ -58,7 +60,7 @@ class Dispatcher {
};
});
this.stream.on('status', (status: any) => {
this.stream.on('status', (status) => {
if (status.code) {
console.error('[Dispatcher.stream] Restarting', status);
this.listenEvents();
@ -134,12 +136,10 @@ class Dispatcher {
if (v == V.PROCESSUPDATE) t = 'processUpdate';
if (v == V.PROCESSDONE) t = 'processDone';
if (v == V.OBJECTSHOW) t = 'objectShow';
if (v == V.OBJECTREMOVE) t = 'objectRemove';
if (v == V.OBJECTDETAILSSET) t = 'objectDetailsSet';
if (v == V.OBJECTDETAILSAMEND) t = 'objectDetailsAmend';
if (v == V.OBJECTDETAILSUNSET) t = 'objectDetailsUnset';
if (v == V.OBJECTRELATIONSSET) t = 'objectRelationsSet';
if (v == V.OBJECTRELATIONSAMEND) t = 'objectRelationsAmend';
if (v == V.OBJECTRELATIONSREMOVE) t = 'objectRelationsRemove';
if (v == V.OBJECTRESTRICTIONSSET) t = 'objectRestrictionsSet';
@ -147,7 +147,7 @@ class Dispatcher {
return t;
};
event (event: any, skipDebug?: boolean) {
event (event: Events.Event, skipDebug?: boolean) {
const { config } = commonStore;
const traceId = event.getTraceid();
const ctx: string[] = [ event.getContextid() ];
@ -178,7 +178,6 @@ class Dispatcher {
let details: any = null;
let viewId = '';
let keys: string[] = [];
let ids: string[] = [];
let subIds: string[] = [];
let uniqueSubIds: string[] = [];
let subId = '';
@ -223,7 +222,6 @@ class Dispatcher {
};
case 'objectRemove': {
ids = data.getIdsList();
break;
};
@ -557,7 +555,7 @@ class Dispatcher {
const fields = Mapper.From.ViewFields(data.getFields());
const updateKeys = [ 'type', 'groupRelationKey', 'pageLimit' ];
for (let f of updateKeys) {
for (const f of updateKeys) {
if (fields[f] != view[f]) {
updateData = true;
break;
@ -577,7 +575,7 @@ class Dispatcher {
const items = data[Util.toCamelCase(`get-${key.id}-list`)]() || [];
const mapper = Mapper.From[key.mapper];
items.forEach((item: any) => {
items.forEach(item => {
let list = view[key.field];
if (item.hasAdd()) {
@ -586,7 +584,7 @@ class Dispatcher {
const items = (op.getItemsList() || []).map(mapper);
const idx = afterId ? list.findIndex(it => it[key.idField] == afterId) + 1 : list.length;
items.forEach((item: any, i: number) => {
items.forEach((item, i) => {
list.splice(idx + i, 0, item);
});
@ -628,7 +626,7 @@ class Dispatcher {
if (key.id == 'relation') {
const updateKeys = [ 'includeTime' ];
for (let f of updateKeys) {
for (const f of updateKeys) {
if (list[idx][f] != item[f]) {
updateData = true;
break;
@ -748,7 +746,7 @@ class Dispatcher {
block.content.objectOrder.push(el);
};
changes.forEach((it: any) => {
changes.forEach(it => {
const op = it.getOp();
const ids = it.getIdsList() || [];
const afterId = it.getAfterid();
@ -893,7 +891,7 @@ class Dispatcher {
};
case 'subscriptionGroups': {
const [ rid, bid, key ] = data.getSubid().split('-');
const [ rid, bid ] = data.getSubid().split('-');
const group = Mapper.From.BoardGroup(data.getGroup());
if (data.getRemove()) {
@ -1025,7 +1023,7 @@ class Dispatcher {
root.layout = object.layout;
};
const blocks = objectView.blocks.map((it: any) => {
const blocks = objectView.blocks.map(it => {
if (it.type == I.BlockType.Dataview) {
dbStore.relationsSet(contextId, it.id, it.content.relationLinks);
dbStore.viewsSet(contextId, it.id, it.content.views);
@ -1053,6 +1051,8 @@ class Dispatcher {
};
public request (type: string, data: any, callBack?: (message: any) => void) {
type = type.replace(/^command_/, '');
const { config } = commonStore;
const debug = config.debug.mw;
const ct = Util.toCamelCase(type);

View file

@ -1,10 +1,9 @@
import { I, M, Decode, Util, Encode } from 'Lib';
import { Rpc } from 'protobuf/pb/protos/commands_pb';
import Model from 'protobuf/pkg/lib/pb/model/protos/models_pb';
import { Encode, Decode } from './struct';
import { I, M, Util } from 'Lib';
const Commands = require('lib/pb/protos/commands_pb');
const Model = require('lib/pkg/lib/pb/model/protos/models_pb.js');
const Rpc = Commands.Rpc;
const Mapper = {
export const Mapper = {
BlockType: (v: number): I.BlockType => {
const V = Model.Block.ContentCase;
@ -722,12 +721,12 @@ const Mapper = {
item.setId(obj.id);
item.setName(obj.name);
item.setType(obj.type);
item.setType(obj.type as any);
item.setCoverrelationkey(obj.coverRelationKey);
item.setGrouprelationkey(obj.groupRelationKey);
item.setGroupbackgroundcolors(obj.groupBackgroundColors);
item.setCoverfit(obj.coverFit);
item.setCardsize(obj.cardSize);
item.setCardsize(obj.cardSize as any);
item.setHideicon(obj.hideIcon);
item.setPagelimit(obj.pageLimit);
item.setRelationsList(obj.relations.map(Mapper.To.ViewRelation));
@ -777,7 +776,7 @@ const Mapper = {
InternalFlag: (value: I.ObjectFlag) => {
const item = new Model.InternalFlag();
item.setValue(value);
item.setValue(value as any);
return item;
},
@ -794,5 +793,3 @@ const Mapper = {
}
};
export default Mapper;

View file

@ -1,116 +1,114 @@
import { Mapper, Decode } from 'Lib';
import { Rpc } from 'protobuf/pb/protos/commands_pb';
import { Decode } from './struct';
import { Mapper } from './mapper';
const DebugSync = (response: any) => {
export const AccountCreate = (response: Rpc.Account.Create.Response) => {
return {
account: Mapper.From.Account(response.getAccount()),
};
};
export const AccountSelect = (response: Rpc.Account.Select.Response) => {
return {
account: Mapper.From.Account(response.getAccount()),
};
};
export const AccountDelete = (response: Rpc.Account.Delete.Response) => {
return {
status: response.hasStatus() ? Mapper.From.AccountStatus(response.getStatus()) : null,
};
};
export const AccountRecoverFromLegacyExport = (response: Rpc.Account.RecoverFromLegacyExport.Response) => {
return {
accountId: response.getAccountid(),
};
};
export const DebugSpaceSummary = (response: Rpc.Debug.SpaceSummary.Response) => {
return response.toObject();
};
const DebugSpaceSummary = (response: any) => {
return response.toObject();
};
const Export = (response: any) => {
export const Export = (response: any) => {
return {
path: response.getPath(),
};
};
const FileListOffload = (response: any) => {
export const LinkPreview = (response: Rpc.LinkPreview.Response) => {
return {
previewLink: response.hasLinkpreview() ? Mapper.From.PreviewLink(response.getLinkpreview()) : {},
};
};
export const FileListOffload = (response: Rpc.File.ListOffload.Response) => {
return {
files: response.getFilesoffloaded(),
bytes: response.getBytesoffloaded(),
};
};
const LinkPreview = (response: any) => {
return {
previewLink: response.hasLinkpreview() ? Mapper.From.PreviewLink(response.getLinkpreview()) : {},
};
};
const FileUpload = (response: any) => {
export const FileUpload = (response: Rpc.File.Upload.Response) => {
return {
hash: response.getHash(),
};
};
const FileDownload = (response: any) => {
export const FileDownload = (response: Rpc.File.Download.Response) => {
return {
path: response.getLocalpath(),
};
};
const WalletCreate = (response: any) => {
export const WalletCreate = (response: Rpc.Wallet.Create.Response) => {
return {
mnemonic: response.getMnemonic(),
};
};
const WalletConvert = (response: any) => {
export const WalletConvert = (response: Rpc.Wallet.Convert.Response) => {
return {
mnemonic: response.getMnemonic(),
entropy: response.getEntropy(),
};
};
const WalletCreateSession = (response: any) => {
export const WalletCreateSession = (response: Rpc.Wallet.CreateSession.Response) => {
return {
token: response.getToken(),
};
};
const AccountCreate = (response: any) => {
return {
account: Mapper.From.Account(response.getAccount()),
};
};
const AccountSelect = (response: any) => {
return {
account: Mapper.From.Account(response.getAccount()),
};
};
const AccountDelete = (response: any) => {
return {
status: response.hasStatus() ? Mapper.From.AccountStatus(response.getStatus()) : null,
};
};
const AccountRecoverFromLegacyExport = (response: any) => {
return {
accountId: response.getAccountid(),
};
};
const ObjectCreate = (response: any) => {
export const ObjectCreate = (response: Rpc.Object.Create.Response) => {
return {
objectId: response.getObjectid(),
details: Decode.decodeStruct(response.getDetails()),
};
};
const ObjectCreateSet = (response: any) => {
export const ObjectCreateSet = (response: Rpc.Object.CreateSet.Response) => {
return {
objectId: response.getObjectid(),
details: Decode.decodeStruct(response.getDetails()),
};
};
const ObjectCreateBookmark = (response: any) => {
export const ObjectCreateBookmark = (response: Rpc.Object.CreateBookmark.Response) => {
return {
objectId: response.getObjectid(),
details: Decode.decodeStruct(response.getDetails()),
};
};
const ObjectCreateObjectType = (response: any) => {
export const ObjectCreateObjectType = (response: Rpc.Object.CreateObjectType.Response) => {
return {
objectId: response.getObjectid(),
details: Decode.decodeStruct(response.getDetails()),
};
};
const ObjectCreateRelation = (response: any) => {
export const ObjectCreateRelation = (response: Rpc.Object.CreateRelation.Response) => {
return {
objectId: response.getObjectid(),
relationKey: response.getKey(),
@ -118,26 +116,180 @@ const ObjectCreateRelation = (response: any) => {
};
};
const ObjectCreateRelationOption = (response: any) => {
export const ObjectCreateRelationOption = (response: Rpc.Object.CreateRelationOption.Response) => {
return {
objectId: response.getObjectid(),
details: Decode.decodeStruct(response.getDetails()),
};
};
const ObjectOpen = (response: any) => {
export const ObjectOpen = (response: Rpc.Object.Open.Response) => {
return {
objectView: Mapper.From.ObjectView(response.getObjectview()),
};
};
const ObjectShow = (response: any) => {
export const ObjectShow = (response: Rpc.Object.Show.Response) => {
return {
objectView: Mapper.From.ObjectView(response.getObjectview()),
};
};
const NavigationGetObjectInfoWithLinks = (response: any) => {
export const ObjectSearch = (response: Rpc.Object.Search.Response) => {
return {
records: (response.getRecordsList() || []).map(Decode.decodeStruct),
};
};
export const ObjectGroupsSubscribe = (response: Rpc.Object.GroupsSubscribe.Response) => {
return {
subId: response.getSubid(),
groups: (response.getGroupsList() || []).map(Mapper.From.BoardGroup),
};
};
export const ObjectSearchSubscribe = (response: Rpc.Object.SearchSubscribe.Response) => {
const counters = response.getCounters();
return {
counters: {
total: counters.getTotal(),
nextCount: counters.getNextcount(),
prevCount: counters.getPrevcount(),
},
records: (response.getRecordsList() || []).map(Decode.decodeStruct),
dependencies: (response.getDependenciesList() || []).map(Decode.decodeStruct),
};
};
export const ObjectSubscribeIds = (response: Rpc.Object.SubscribeIds.Response) => {
return {
records: (response.getRecordsList() || []).map(Decode.decodeStruct),
dependencies: (response.getDependenciesList() || []).map(Decode.decodeStruct),
};
};
export const ObjectGraph = (response: Rpc.Object.Graph.Response) => {
return {
edges: (response.getEdgesList() || []).map(Mapper.From.GraphEdge),
nodes: (response.getNodesList() || []).map(Decode.decodeStruct),
};
};
export const ObjectToBookmark = (response: Rpc.Object.ToBookmark.Response) => {
return {
objectId: response.getObjectid(),
};
};
export const ObjectShareByLink = (response: Rpc.Object.ShareByLink.Response) => {
return {
link: response.getLink(),
};
};
export const ObjectListDuplicate = (response: Rpc.Object.ListDuplicate.Response) => {
return {
ids: response.getIdsList(),
};
};
export const ObjectImportList = (response: Rpc.Object.ImportList.Response) => {
return {
list: (response.getResponseList() || []).map(it => {
return { type: it.getType() };
}),
};
};
export const BlockCreate = (response: Rpc.Block.Create.Response) => {
return {
blockId: response.getBlockid(),
};
};
export const BlockSplit = (response: Rpc.Block.Split.Response) => {
return {
blockId: response.getBlockid(),
};
};
export const BlockCopy = (response: Rpc.Block.Copy.Response) => {
return {
textSlot: response.getTextslot(),
htmlSlot: response.getHtmlslot(),
anySlot: response.getAnyslotList(),
};
};
export const BlockCut = (response: Rpc.Block.Cut.Response) => {
return {
textSlot: response.getTextslot(),
htmlSlot: response.getHtmlslot(),
anySlot: response.getAnyslotList(),
};
};
export const BlockPaste = (response: Rpc.Block.Paste.Response) => {
return {
blockIds: response.getBlockidsList(),
caretPosition: response.getCaretposition(),
isSameBlockCaret: response.getIssameblockcaret(),
};
};
export const BlockListDuplicate = (response: Rpc.Block.ListDuplicate.Response) => {
return {
blockIds: response.getBlockidsList(),
};
};
export const BlockListConvertToObjects = (response: Rpc.Block.ListConvertToObjects.Response) => {
return {
linkIds: response.getLinkidsList(),
};
};
export const BlockDataviewCreateFromExistingObject = (response: Rpc.BlockDataview.CreateFromExistingObject.Response) => {
return {
blockId: response.getBlockid(),
targetObjectId: response.getTargetobjectid(),
views: (response.getViewList() || []).map(Mapper.From.View),
};
};
export const BlockDataviewViewCreate = (response: Rpc.BlockDataview.View.Create.Response) => {
return {
viewId: response.getViewid(),
};
};
export const BlockLinkCreateWithObject = (response: Rpc.BlockLink.CreateWithObject.Response) => {
return {
blockId: response.getBlockid(),
targetId: response.getTargetid(),
};
};
export const BlockBookmarkCreateAndFetch = (response: Rpc.BlockBookmark.CreateAndFetch.Response) => {
return {
blockId: response.getBlockid(),
};
};
export const BlockFileCreateAndUpload = (response: Rpc.BlockFile.CreateAndUpload.Response) => {
return {
blockId: response.getBlockid(),
};
};
export const HistoryGetVersions = (response: Rpc.History.GetVersions.Response) => {
return {
versions: (response.getVersionsList() || []).map(Mapper.From.HistoryVersion),
};
};
export const NavigationGetObjectInfoWithLinks = (response: Rpc.Navigation.GetObjectInfoWithLinks.Response) => {
const object = response.getObject();
const links = object.getLinks();
@ -153,102 +305,7 @@ const NavigationGetObjectInfoWithLinks = (response: any) => {
};
};
const BlockCreate = (response: any) => {
return {
blockId: response.getBlockid(),
};
};
const BlockDataviewCreateFromExistingObject = (response: any) => {
return {
blockId: response.getBlockid(),
targetObjectId: response.getTargetobjectid(),
views: (response.getViewList() || []).map(Mapper.From.View),
};
};
const BlockLinkCreateWithObject = (response: any) => {
return {
blockId: response.getBlockid(),
targetId: response.getTargetid(),
};
};
const BlockSplit = (response: any) => {
return {
blockId: response.getBlockid(),
};
};
const BlockBookmarkCreateAndFetch = (response: any) => {
return {
blockId: response.getBlockid(),
};
};
const BlockFileCreateAndUpload = (response: any) => {
return {
blockId: response.getBlockid(),
};
};
const BlockCopy = (response: any) => {
return {
textSlot: response.getTextslot(),
htmlSlot: response.getHtmlslot(),
anySlot: response.getAnyslotList(),
};
};
const BlockCut = (response: any) => {
return {
textSlot: response.getTextslot(),
htmlSlot: response.getHtmlslot(),
anySlot: response.getAnyslotList(),
};
};
const BlockPaste = (response: any) => {
return {
blockIds: response.getBlockidsList(),
caretPosition: response.getCaretposition(),
isSameBlockCaret: response.getIssameblockcaret(),
};
};
const ObjectImportList = (response: any) => {
return {
list: (response.getResponseList() || []).map(it => {
return { type: it.getType() };
}),
};
};
const BlockListDuplicate = (response: any) => {
return {
blockIds: response.getBlockidsList(),
};
};
const BlockListConvertToObjects = (response: any) => {
return {
linkIds: response.getLinkidsList(),
};
};
const BlockDataviewViewCreate = (response: any) => {
return {
viewId: response.getViewid(),
};
};
const HistoryGetVersions = (response: any) => {
return {
versions: (response.getVersionsList() || []).map(Mapper.From.HistoryVersion),
};
};
const HistoryShowVersion = (response: any) => {
export const HistoryShowVersion = (response: Rpc.History.ShowVersion.Response) => {
const version = response.getVersion();
return {
version: version ? Mapper.From.HistoryVersion(response.getVersion()) : null,
@ -256,170 +313,39 @@ const HistoryShowVersion = (response: any) => {
};
};
const ObjectSearch = (response: any) => {
return {
records: (response.getRecordsList() || []).map(Decode.decodeStruct),
};
};
const ObjectGroupsSubscribe = (response: any) => {
return {
subId: response.getSubid(),
groups: (response.getGroupsList() || []).map(Mapper.From.BoardGroup),
};
};
const ObjectSearchSubscribe = (response: any) => {
const counters = response.getCounters();
return {
counters: {
total: counters.getTotal(),
nextCount: counters.getNextcount(),
prevCount: counters.getPrevcount(),
},
records: (response.getRecordsList() || []).map(Decode.decodeStruct),
dependencies: (response.getDependenciesList() || []).map(Decode.decodeStruct),
};
};
const ObjectSubscribeIds = (response: any) => {
return {
records: (response.getRecordsList() || []).map(Decode.decodeStruct),
dependencies: (response.getDependenciesList() || []).map(Decode.decodeStruct),
};
};
const ObjectGraph = (response: any) => {
return {
edges: (response.getEdgesList() || []).map(Mapper.From.GraphEdge),
nodes: (response.getNodesList() || []).map(Decode.decodeStruct),
};
};
const ObjectToBookmark = (response: any) => {
return {
objectId: response.getObjectid(),
};
};
const ObjectShareByLink = (response: any) => {
return {
link: response.getLink(),
};
};
const ObjectListDuplicate = (response: any) => {
return {
ids: response.getIdsList(),
};
};
const TemplateCreateFromObject = (response: any) => {
export const TemplateCreateFromObject = (response: Rpc.Template.CreateFromObject.Response) => {
return {
id: response.getId(),
};
};
const TemplateCreateFromObjectType = (response: any) => {
export const TemplateCreateFromObjectType = (response: Rpc.Template.CreateFromObjectType.Response) => {
return {
id: response.getId(),
};
};
const TemplateClone = (response: any) => {
export const TemplateClone = (response: Rpc.Template.Clone.Response) => {
return {
id: response.getId(),
};
};
const WorkspaceObjectAdd = (response: any) => {
export const WorkspaceObjectAdd = (response: Rpc.Workspace.Object.Add.Response) => {
return {
objectId: response.getObjectid(),
details: Decode.decodeStruct(response.getDetails()),
};
};
const UnsplashSearch = (response: any) => {
export const UnsplashSearch = (response: Rpc.Unsplash.Search.Response) => {
return {
pictures: (response.getPicturesList() || []).map(Mapper.From.UnsplashPicture),
};
};
const UnsplashDownload = (response: any) => {
export const UnsplashDownload = (response: Rpc.Unsplash.Download.Response) => {
return {
hash: response.getHash(),
};
};
export {
DebugSync,
DebugSpaceSummary,
Export,
FileUpload,
FileDownload,
LinkPreview,
FileListOffload,
WalletCreate,
WalletConvert,
WalletCreateSession,
AccountCreate,
AccountSelect,
AccountDelete,
AccountRecoverFromLegacyExport,
ObjectCreate,
ObjectCreateSet,
ObjectCreateBookmark,
ObjectCreateObjectType,
ObjectCreateRelation,
ObjectCreateRelationOption,
ObjectSearch,
ObjectSearchSubscribe,
ObjectGroupsSubscribe,
ObjectSubscribeIds,
ObjectGraph,
ObjectShareByLink,
ObjectToBookmark,
ObjectListDuplicate,
NavigationGetObjectInfoWithLinks,
ObjectOpen,
ObjectShow,
ObjectImportList,
BlockSplit,
BlockCopy,
BlockCut,
BlockPaste,
BlockFileCreateAndUpload,
BlockBookmarkCreateAndFetch,
BlockLinkCreateWithObject,
BlockCreate,
BlockDataviewCreateFromExistingObject,
BlockDataviewViewCreate,
BlockListDuplicate,
BlockListConvertToObjects,
HistoryGetVersions,
HistoryShowVersion,
TemplateCreateFromObject,
TemplateCreateFromObjectType,
TemplateClone,
WorkspaceObjectAdd,
UnsplashSearch,
UnsplashDownload,
};
};

View file

@ -462,12 +462,11 @@ class DataUtil {
checkDetails (rootId: string, blockId?: string) {
blockId = blockId || rootId;
const object = detailStore.get(rootId, blockId, [ 'creator', 'layoutAlign', 'templateIsBundled', 'recommendedRelations' ].concat(Constant.coverRelationKeys));
const object = detailStore.get(rootId, blockId, [ 'layoutAlign', 'templateIsBundled' ].concat(Constant.coverRelationKeys));
const childrenIds = blockStore.getChildrenIds(rootId, blockId);
const checkType = blockStore.checkBlockTypeExists(rootId);
const { iconEmoji, iconImage, coverType, coverId, type } = object;
const { iconEmoji, iconImage, coverType, coverId } = object;
const ret: any = {
object,
withCover: Boolean((coverType != I.CoverType.None) && coverId),
withIcon: false,
className: [ this.layoutClass(object.id, object.layout), 'align' + object.layoutAlign ],

Some files were not shown because too many files have changed in this diff Show more