diff --git a/dist/img/help/36/2.png b/dist/img/help/36/2.png deleted file mode 100644 index 35a60b90ea..0000000000 Binary files a/dist/img/help/36/2.png and /dev/null differ diff --git a/dist/workers/graph.js b/dist/workers/graph.js index 5b1489197a..b6a6794884 100644 --- a/dist/workers/graph.js +++ b/dist/workers/graph.js @@ -15,6 +15,7 @@ const util = new Util(); // CONSTANTS const transformThreshold = 1.5; +const delayFocus = 1000; const ObjectLayout = { Human: 1, @@ -70,7 +71,9 @@ let edgeMap = new Map(); let hoverAlpha = 0.2; let fontFamily = 'Helvetica, san-serif'; let timeoutHover = 0; +let rootId = ''; let root = null; +let paused = false; addEventListener('message', ({ data }) => { if (this[data.id]) { @@ -82,7 +85,7 @@ init = (param) => { data = param; canvas = data.canvas; settings = data.settings; - + rootId = data.rootId; ctx = canvas.getContext('2d'); util.ctx = ctx; @@ -99,16 +102,15 @@ init = (param) => { initForces(); - simulation.on('tick', () => { redraw(); }); + simulation.on('tick', () => redraw()); simulation.tick(100); - // Center initially on root node setTimeout(() => { - root = getNodeById(data.rootId); + root = getNodeById(rootId); let x = width / 2; let y = height / 2; - + if (root) { x = root.x; y = root.y; @@ -199,10 +201,11 @@ initForces = () => { .y(height * forceY.y); updateForces(); + redraw(); }; updateForces = () => { - let old = getNodeMap(); + const old = getNodeMap(); edges = util.objectCopy(data.edges); nodes = util.objectCopy(data.nodes); @@ -217,6 +220,14 @@ updateForces = () => { edges = edges.filter(d => d.type != EdgeType.Relation); }; + // Filte local only edges + if (settings.local) { + edges = edges.filter(d => (d.source == rootId) || (d.target == rootId)); + + const nodeIds = util.arrayUnique([ rootId ].concat(edges.map(d => d.source)).concat(edges.map(d => d.target))); + nodes = nodes.filter(d => nodeIds.includes(d.id)); + }; + let map = getNodeMap(); edges = edges.filter(d => map.get(d.source) && map.get(d.target)); @@ -237,7 +248,13 @@ updateForces = () => { edges = edges.filter(d => map.get(d.source) && map.get(d.target)); // Shallow copy to disable mutations - nodes = nodes.map(d => Object.assign(old.get(d.id) || {}, d)); + nodes = nodes.map(d => { + let o = old.get(d.id); + if (!o) { + o = settings.local ? { x: width / 2, y: width / 2 } : {}; + }; + return Object.assign(o, d); + }); edges = edges.map(d => Object.assign({}, d)); simulation.nodes(nodes); @@ -258,16 +275,28 @@ updateForces = () => { }; updateSettings = (param) => { - const needUpdate = (param.link != settings.link) || - (param.relation != settings.relation) || - (param.orphan != settings.orphan); + const updateKeys = [ 'link', 'relation', 'orphan', 'local' ]; + + let needUpdate = false; + let needFocus = false; + + for (let key of updateKeys) { + if (param[key] != settings[key]) { + needUpdate = true; + + if (key == 'local') { + needFocus = true; + }; + + break; + }; + }; settings = Object.assign(settings, param); + needUpdate ? updateForces() : redraw(); - if (needUpdate) { - updateForces(); - } else { - redraw(); + if (needFocus) { + setTimeout(() => this.setRootId({ rootId }), delayFocus); }; }; @@ -289,7 +318,7 @@ draw = (t) => { ctx.font = getFont(); edges.forEach(d => { - drawLine(d, radius, radius * 1.3, settings.marker && d.isDouble, settings.marker); + drawEdge(d, radius, radius * 1.3, settings.marker && d.isDouble, settings.marker); }); nodes.forEach(d => { @@ -303,10 +332,12 @@ draw = (t) => { redraw = () => { cancelAnimationFrame(frame); - frame = requestAnimationFrame(draw); + if (!paused) { + frame = requestAnimationFrame(draw); + }; }; -drawLine = (d, arrowWidth, arrowHeight, arrowStart, arrowEnd) => { +drawEdge = (d, arrowWidth, arrowHeight, arrowStart, arrowEnd) => { const x1 = d.source.x; const y1 = d.source.y; const r1 = getRadius(d.source); @@ -577,6 +608,22 @@ onSelect = ({ x, y, selectRelated }) => { }; }; +onSetRootId = ({ x, y }) => { + const d = getNodeByCoords(x, y); + if (d) { + this.setRootId({ rootId: d.id }); + }; +}; + +onSetEdges = (param) => { + data.edges = param.edges; + updateForces(); +}; + +onSetSelected = ({ ids }) => { + selected = ids; +}; + onMouseMove = ({ x, y }) => { const active = nodes.find(d => d.isOver); const d = getNodeByCoords(x, y); @@ -618,12 +665,11 @@ onContextMenu = ({ x, y }) => { const d = getNodeByCoords(x, y); if (!d) { send('onContextSpaceClick', { x, y }); - return; + } else { + send('onContextMenu', { node: d, x, y }); + d.isOver = true; + redraw(); }; - - d.isOver = true; - send('onContextMenu', { node: d, x, y }); - redraw(); }; onAddNode = ({ target, sourceId }) => { @@ -667,21 +713,12 @@ onRemoveNode = ({ ids }) => { data.edges = data.edges.filter(d => !ids.includes(d.source.id) && !ids.includes(d.target.id)); updateForces(); - redraw(); }; -onSetEdges = (param) => { - data.edges = param.edges; +setRootId = (param) => { + rootId = param.rootId; + root = getNodeById(rootId); - updateForces(); -}; - -onSetSelected = ({ ids }) => { - selected = ids; -}; - -onSetRootId = ({ rootId }) => { - root = nodes.find(d => d.id == rootId); if (!root) { return; }; @@ -696,12 +733,14 @@ onSetRootId = ({ rootId }) => { transform = Object.assign(transform, coords); redraw(); }) - .onComplete(() => { - send('onTransform', { ...transform }); - }) + .onComplete(() => send('onTransform', { ...transform })) .start(); - redraw(); + if (settings.local) { + updateForces(); + } else { + redraw(); + }; }; restart = (alpha) => { diff --git a/dist/workers/lib/util.js b/dist/workers/lib/util.js index 6ccf9a0417..9d2cca2928 100644 --- a/dist/workers/lib/util.js +++ b/dist/workers/lib/util.js @@ -78,4 +78,8 @@ class Util { this.ctx.restore(); }; + arrayUnique (a) { + return [ ...new Set(a) ]; + }; + }; \ No newline at end of file diff --git a/middleware.version b/middleware.version index 780bb908f0..00218d1f54 100644 --- a/middleware.version +++ b/middleware.version @@ -1 +1 @@ -0.29.9 \ No newline at end of file +0.29.11 \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index b81a149cf5..c8dd6f5db0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "anytype", - "version": "0.35.20-beta", + "version": "0.35.23-beta", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "anytype", - "version": "0.35.20-beta", + "version": "0.35.23-beta", "hasInstallScript": true, "license": "SEE LICENSE IN LICENSE.md", "dependencies": { diff --git a/package.json b/package.json index 8daa744543..1488ea92b5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "anytype", - "version": "0.35.20-beta", + "version": "0.35.23-beta", "description": "Anytype", "main": "electron.js", "scripts": { diff --git a/src/json/text.json b/src/json/text.json index 884d9fd417..15a02afb21 100644 --- a/src/json/text.json +++ b/src/json/text.json @@ -1173,6 +1173,7 @@ "menuGraphSettingsLinks": "Links", "menuGraphSettingsRelations": "Relations", "menuGraphSettingsUnlinkedObjects": "Unlinked Objects", + "menuGraphSettingsLocal": "Local graph", "menuHelpWhatsNew": "What's New", "menuHelpShortcut": "Keyboard Shortcuts", @@ -1440,8 +1441,7 @@ "dispatcherImportTryAgain": "Try again", "onboardingMainGraph": "Onboarding", - "onboardingMainGraph11": "Welcome to your Anytype Space. Space is a graph of interconnected objects, providing a natural way to organize information.", - "onboardingMainGraph12": "To access your Homepage, click on the Next button.", + "onboardingMainGraph11": "Space is essentially a graph, and Anytype aims to provide a natural way of thinking where everything is represented as objects with specific relationships, just like in the real world.", "onboardingMainSet": "Set & Collection", "onboardingMainSet11": "Anytype has two basic formats: Sets and Collections. As in computer science, a Set is a data structure that contains only unique elements, while a Collection is any group of objects that are stored together. You can convert any set into a collection, but not the other way around.", @@ -1471,13 +1471,9 @@ "onboardingObjectCreationFinish1Button": "Ok! I like it", "onboardingDashboard": "Onboarding", - "onboardingDashboard11": "Welcome to your Homepage. This is your personalized page, which you can customize to your liking.
We've included some materials to help you get started, but feel free to make adjustments as needed.", - "onboardingDashboard12": "Let's take a few minutes to explore the features together.", - "onboardingDashboard21": "Sets, acting as filters for your objects, are featured on your Homepage.", - "onboardingDashboard22": "Sets make it easy to navigate and collect specific Objects, such as Notes, Links, Tasks, ideas, and more.", - "onboardingDashboard23": "To access different Set Views, simply select them.", - "onboardingDashboard31": "Objects in Anytype have specific types depending on their purpose. You can use system types or define custom ones. Structure objects with Relations and links.", - "onboardingDashboard32": "To add an Object to a Set, click the New button and view its relation as properties in columns.", + "onboardingDashboard11": "Welcome to your Homepage. This is your personalized page, which you can customize to your liking.", + "onboardingDashboard12": "Feel free to make adjustments as needed.", + "onboardingDashboard13": "Let's take a few minutes to explore the features together.", "onboardingDashboard41": "You'll find the Sidebar on the left. It's a navigation tool that you can customize with multiple widget types.", "onboardingDashboard42": "Change the Widget appearance and see what looks best. Make your Favorites as a Tree Widget.", "onboardingDashboard51": "Great job! You have completed this section. Feel free to explore other menus in the interface, such as Library and Sets.", @@ -1577,13 +1573,13 @@ "errorAccountRecover109": "Account has been deleted", "errorObjectImport7": "Import has not been completed. CSV import supports up to 1000 rows and 10 columns.", - "objectOrigin0": "User", - "objectOrigin1": "Clipboard", - "objectOrigin2": "Drag'n'Drop", - "objectOrigin3": "Import", - "objectOrigin4": "Webclipper", - "objectOrigin5": "Sharing Extension", - "objectOrigin6": "Usecase", - "objectOrigin7": "Built-in" + "origin0": "User", + "origin1": "Clipboard", + "origin2": "Drag'n'Drop", + "origin3": "Import", + "origin4": "Webclipper", + "origin5": "Sharing Extension", + "origin6": "Usecase", + "origin7": "Built-in" } diff --git a/src/scss/block/dataview/view/calendar.scss b/src/scss/block/dataview/view/calendar.scss index 6ff71d63fa..f687526769 100644 --- a/src/scss/block/dataview/view/calendar.scss +++ b/src/scss/block/dataview/view/calendar.scss @@ -28,9 +28,9 @@ .day.first { border-top-width: 0px; } .day.active { - .number { - display: inline-block; color: $colorTextInversion; background-color: $colorSystemAccent100; border-radius: 12px; - padding: 0px 7px; align-self: flex-end; + .number { padding: 0px; color: $colorTextInversion; } + .number { + .inner { background-color: $colorSystemAccent100; border-radius: 12px; padding: 0px 7px; align-self: flex-end; } } } @@ -39,7 +39,11 @@ } .day { - .number { @include text-paragraph; text-align: right; } + .number { @include text-paragraph; text-align: right; padding: 0px 8px; } + .number { + .inner { display: inline-block; } + } + .item { display: flex; flex-direction: row; align-items: center; gap: 0px 4px; @include text-small; @include text-overflow-nw; margin: 0px 0px 2px 0px; position: relative; padding: 0px 8px; border-radius: 4px; diff --git a/src/scss/block/dataview/view/gallery.scss b/src/scss/block/dataview/view/gallery.scss index 7c20a48238..bd81e03d42 100644 --- a/src/scss/block/dataview/view/gallery.scss +++ b/src/scss/block/dataview/view/gallery.scss @@ -19,6 +19,14 @@ } .card { + .dropTarget { height: 100%; } + .dropTarget.isOver { box-shadow: 0px 0px; } + .dropTarget.isOver::before { content: ""; position: absolute; background: $colorSystemAccent100; width: 2px; height: 100%; border-radius: 2px; top: 0px; } + .dropTarget.isOver.top::before { left: -10px; } + .dropTarget.isOver.bottom::before { right: -10px; } + + .selectable.isSelectionSelected::after { border-radius: 12px; } + .selectable { height: 100%; } .itemContent > .inner { padding: 16px; } @@ -92,13 +100,6 @@ .input.name { padding: 0; height: unset; } } } - - .viewContent.viewGallery.isCollection { - .dropTarget.isOver { box-shadow: 0px 0px; } - .dropTarget.isOver::before { content: ""; position: absolute; background: $colorSystemAccent100; width: 2px; height: 100%; border-radius: 2px; top: 0px; } - .dropTarget.isOver.top::before { left: -10px; } - .dropTarget.isOver.bottom::before { right: -10px; } - } } } diff --git a/src/scss/block/link.scss b/src/scss/block/link.scss index 78fbd54aaa..073780d9b7 100644 --- a/src/scss/block/link.scss +++ b/src/scss/block/link.scss @@ -112,7 +112,7 @@ .cardName { flex-wrap: nowrap; vertical-align: top; max-width: 100%; } .cardName { - .name { @include text-overflow-nw; line-height: 19px; } + .name { @include text-overflow-nw; line-height: 19px; border-bottom: 0.075em solid; border-color: inherit; } } .cardDescription { @include text-small; } diff --git a/src/scss/component/dragLayer.scss b/src/scss/component/dragLayer.scss index 0354090ff4..118804ca18 100644 --- a/src/scss/component/dragLayer.scss +++ b/src/scss/component/dragLayer.scss @@ -22,8 +22,14 @@ .block.blockDataview { .dropTarget { padding: 0px !important; } - .viewItem { - .record { left: 0px !important; top: 0px !important; overflow: hidden; } + .viewContent { + .record { position: relative !important; left: 0px !important; top: 0px !important; overflow: hidden; } + .record { + .selectable.isSelectionSelected::after { display: none; } + } + } + .viewContent.viewGallery { + .record { margin: 0px 10px 10px 0px; } } } } diff --git a/src/scss/menu/dataview/calendar.scss b/src/scss/menu/dataview/calendar.scss index 3f3ad716bf..867514e258 100644 --- a/src/scss/menu/dataview/calendar.scss +++ b/src/scss/menu/dataview/calendar.scss @@ -57,9 +57,15 @@ .day { display: flex; flex-direction: column; } .day { .number { @include text-paragraph; text-align: right; position: relative; z-index: 1; padding: 0px 8px; flex-shrink: 0; } + .number { + .inner { display: inline-block; } + } } .day.active { - .number { color: $colorSystemAccent100; } + .number { padding: 0px; color: $colorTextInversion; } + .number { + .inner { background-color: $colorSystemAccent100; border-radius: 12px; padding: 0px 7px; align-self: flex-end; } + } } .day.other { .number { color: $colorTextSecondary; } diff --git a/src/scss/page/main/navigation.scss b/src/scss/page/main/navigation.scss index 0386f015d8..a6524475f1 100644 --- a/src/scss/page/main/navigation.scss +++ b/src/scss/page/main/navigation.scss @@ -3,7 +3,14 @@ .pageMainNavigation { .wrapper > #loader { position: fixed; top: 0px; width: 100%; height: 100%; background: $colorBgPrimary; z-index: 1; } + .sides { display: flex; padding: 0px 16px; } + .sideName { margin-bottom: 13px; @include text-common; font-weight: 500; padding: 0px 16px; } + + .items { width: 33.33%; padding: 4px 0px; } + .items.center { padding: 39px 16px 4px 16px; } .items { + .row { width: 100%; padding: 0px 32px 0px 16px; } + .item { transition: $transitionAllCommon; position: relative; line-height: 48px; margin-bottom: 16px; padding: 0px; height: 80px; border: 1px solid $colorShapeSecondary; border-radius: 8px; @@ -21,24 +28,31 @@ width: 24px; height: 24px; position: absolute; right: -24px; top: 50%; transform: translateY(-50%); background-image: url('~img/arrow/nav0.svg'); } - } - .item.active { background-color: $colorShapeHighlightMedium; } - } - - .sides { display: flex; padding: 0px 16px; } - - .items { width: 33.33%; padding: 4px 0px; } - .items.center { padding: 39px 16px 4px 16px; } - .items { - .row { width: 100%; padding: 0px 32px 0px 16px; } - .item { .icon.arrow { width: 24px; height: 24px; position: absolute; right: -24px; top: 50%; transform: translateY(-50%); background-image: url('~img/arrow/nav0.svg'); } } + .item.selected { + padding: 16px; border-radius: 8px; border: 1px solid $colorShapeSecondary; transition: $transitionAllCommon; height: auto; + } + .item.selected { + .iconObject { margin-bottom: 8px; } + .name { margin-bottom: 1px; @include text-overflow-nw; height: 22px; } + .descr { @include text-small; color: $colorTextSecondary; @include text-overflow; max-height: 54px; } + .cover { position: relative; height: 156px; margin-top: 11px; border-radius: 2px; } + + .buttons { margin-top: 16px; display: flex; flex-direction: row; align-items: center; gap: 0px 8px; } + .buttons { + .button { width: 100%; } + .button { + .icon.expand { background-image: url('~img/icon/expand.svg'); width: 20px; height: 20px; position: absolute; left: 8px; top: 6px; } + } + } + } + .item.active { background: none; border-color: $colorSystemAccent100 !important; box-shadow: 0px 0px 0px 1px $colorSystemAccent100 inset; } .item.active { .icon.arrow { background-image: url('~img/arrow/nav1.svg'); } @@ -50,25 +64,6 @@ } } - .sideName { margin-bottom: 13px; @include text-common; font-weight: 500; padding: 0px 16px; } - - .selected { padding: 16px; border-radius: 8px; border: 1px solid $colorShapeSecondary; transition: $transitionAllCommon; } - .selected { - .iconObject { margin-bottom: 8px; } - .name { margin-bottom: 1px; @include text-overflow-nw; height: 22px; } - .descr { @include text-small; color: $colorTextSecondary; @include text-overflow; max-height: 54px; } - .cover { position: relative; height: 156px; margin-top: 11px; border-radius: 2px; } - - .buttons { margin-top: 16px; display: flex; flex-direction: row; align-items: center; gap: 0px 8px; } - .buttons { - .button { width: 100%; } - .button { - .icon.expand { background-image: url('~img/icon/expand.svg'); width: 20px; height: 20px; position: absolute; left: 8px; top: 6px; } - } - } - } - .selected.active { border-color: $colorSystemAccent100 !important; box-shadow: 0px 0px 0px 1px $colorSystemAccent100; } - .items.right { .item { .icon.arrow { right: auto; left: -24px; } diff --git a/src/scss/theme/dark/block.scss b/src/scss/theme/dark/block.scss index 2654e38375..44edeff31c 100644 --- a/src/scss/theme/dark/block.scss +++ b/src/scss/theme/dark/block.scss @@ -265,11 +265,6 @@ .iconObject { background-color: $colorShapeTertiary; } } } - .block.blockLink.text { - .linkCard { - .cardName .name { border-color: $colorShapeTertiary; } - } - } .block.blockLink.card { .linkCard { .side.left, .side.right { border-color: $colorShapeTertiary; } diff --git a/src/ts/app.tsx b/src/ts/app.tsx index 65587b8cb6..387a46033d 100644 --- a/src/ts/app.tsx +++ b/src/ts/app.tsx @@ -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, UtilCommon, UtilRouter, UtilFile, UtilData, UtilObject, UtilMenu, keyboard, Storage, analytics, dispatcher, translate, Renderer, - focus, Preview, Mark, Animation, Onboarding, Survey, UtilDate + focus, Preview, Mark, Animation, Onboarding, Survey, UtilDate, Encode, Decode, } from 'Lib'; import * as Docs from 'Docs'; @@ -183,6 +183,8 @@ window.Lib = { Onboarding, Survey, Docs, + Encode, + Decode, }; /* diff --git a/src/ts/component/block/dataview.tsx b/src/ts/component/block/dataview.tsx index 0f4565e036..63d3667ff6 100644 --- a/src/ts/component/block/dataview.tsx +++ b/src/ts/component/block/dataview.tsx @@ -729,8 +729,8 @@ const BlockDataview = observer(class BlockDataview extends React.Component { ref.onClick(e); }, 15); }; - analytics.event('CreateObject', { - route: (isCollection ? 'Collection' : 'Set'), + analytics.event('CreateObject', { + route: this.analyticsRoute(), objectType: object.type, layout: object.layout, }); @@ -791,7 +791,7 @@ const BlockDataview = observer(class BlockDataview extends React.Component { selection.clear(); }, + onClose: () => selection.clear(), data: { targetId: this.getObjectId(), objectIds: ids, subId, isCollection, - route: isCollection ? 'Collection' : 'Set', + route: this.analyticsRoute(), } }); }; @@ -1319,6 +1318,8 @@ const BlockDataview = observer(class BlockDataview extends React.Component detailStore.get(subId, id, [])); value = value.filter(it => !it._empty_); + return value; }; diff --git a/src/ts/component/block/dataview/controls.tsx b/src/ts/component/block/dataview/controls.tsx index 2af11aeb68..5c4bcc8552 100644 --- a/src/ts/component/block/dataview/controls.tsx +++ b/src/ts/component/block/dataview/controls.tsx @@ -328,6 +328,8 @@ const Controls = observer(class Controls extends React.Component { type: I.ViewType.Grid, groupRelationKey: view.groupRelationKey || Relation.getGroupOption(rootId, block.id, view.type, '')?.id, cardSize: view.cardSize || I.CardSize.Medium, + filters: [], + sorts: [], }; C.BlockDataviewViewCreate(rootId, block.id, newView, sources, (message: any) => { diff --git a/src/ts/component/block/dataview/view/calendar/item.tsx b/src/ts/component/block/dataview/view/calendar/item.tsx index d3eaa00e69..22f05be201 100644 --- a/src/ts/component/block/dataview/view/calendar/item.tsx +++ b/src/ts/component/block/dataview/view/calendar/item.tsx @@ -80,7 +80,9 @@ const Item = observer(class Item extends React.Component { ref={node => this.node = node} className={cn.join(' ')} > -
{d}
+
+
{d}
+
{slice.map((item, i) => ( diff --git a/src/ts/component/block/link.tsx b/src/ts/component/block/link.tsx index f15ac557fb..02d593bf1c 100644 --- a/src/ts/component/block/link.tsx +++ b/src/ts/component/block/link.tsx @@ -357,6 +357,9 @@ const BlockLink = observer(class BlockLink extends React.Component { return; }; - items.each((i: number, item) => { - this.textStyle($(item)); - }); + items.each((i: number, item) => this.textStyle($(item))); items.off('mouseenter.link'); items.on('mouseenter.link', e => { diff --git a/src/ts/component/drag/layer.tsx b/src/ts/component/drag/layer.tsx index 5c3400a8ca..5081c09164 100644 --- a/src/ts/component/drag/layer.tsx +++ b/src/ts/component/drag/layer.tsx @@ -90,15 +90,13 @@ class DragLayer extends React.Component { const node = $(this.node); const inner = node.find('#inner').html(''); const container = UtilCommon.getPageContainer(keyboard.isPopup()); - const wrap = $('
'); - let items: any[] = []; switch (type) { case I.DropType.Block: { wrap.addClass('blocks'); - items = ids.map(id => blockStore.getLeaf(rootId, id)).filter(it => it).map(it => new M.Block(UtilCommon.objectCopy(it))); + const items = ids.map(id => blockStore.getLeaf(rootId, id)).filter(it => it).map(it => new M.Block(UtilCommon.objectCopy(it))); items.forEach(block => { const clone = container.find(`#block-${block.id}`).clone(); @@ -122,7 +120,7 @@ class DragLayer extends React.Component { wrap.addClass('menus').append(add); - items = ids.map(relationKey => dbStore.getRelationByKey(relationKey)).filter(it => it); + const items = ids.map(relationKey => dbStore.getRelationByKey(relationKey)).filter(it => it); items.forEach(item => { const el = $(`#menuBlockRelationView #item-${item.id}`); @@ -148,11 +146,10 @@ class DragLayer extends React.Component { ids.forEach((id: string, idx: number) => { const el = container.find(`#record-${id}`); - const margin = idx * 10; const clone = el.clone().addClass('record'); view.append(clone); - clone.css({ marginLeft: margin, marginTop: margin, zIndex: (ids.length - idx), width: el.width() }); + clone.css({ width: el.width() }); }); break; }; diff --git a/src/ts/component/editor/page.tsx b/src/ts/component/editor/page.tsx index 4f288440a9..0274dc4274 100644 --- a/src/ts/component/editor/page.tsx +++ b/src/ts/component/editor/page.tsx @@ -837,9 +837,7 @@ const EditorPage = observer(class EditorPage extends React.Component { - keyboard.onSearchPopup(); - }); + keyboard.shortcut(`${cmd}+k`, e, () => keyboard.onSearchPopup('Shortcut')); }; if (!isInsideTable && block.isText()) { diff --git a/src/ts/component/header/index.tsx b/src/ts/component/header/index.tsx index f971ce88c1..ca1f338069 100644 --- a/src/ts/component/header/index.tsx +++ b/src/ts/component/header/index.tsx @@ -76,7 +76,7 @@ class Header extends React.Component { }; onSearch () { - keyboard.onSearchPopup(); + keyboard.onSearchPopup('Header'); }; onNavigation () { diff --git a/src/ts/component/menu/dataview/calendar/day.tsx b/src/ts/component/menu/dataview/calendar/day.tsx index 3ca8c6f170..89ba6fa7ca 100644 --- a/src/ts/component/menu/dataview/calendar/day.tsx +++ b/src/ts/component/menu/dataview/calendar/day.tsx @@ -56,7 +56,9 @@ const MenuCalendarDay = observer(class MenuCalendarDay extends React.Component -
{d}
+
+
{d}
+
{items.map((item, i) => ( diff --git a/src/ts/component/menu/dataview/filter/values.tsx b/src/ts/component/menu/dataview/filter/values.tsx index 5b1621ccc2..6c2376f5c5 100644 --- a/src/ts/component/menu/dataview/filter/values.tsx +++ b/src/ts/component/menu/dataview/filter/values.tsx @@ -77,7 +77,7 @@ const MenuDataviewFilterValues = observer(class MenuDataviewFilterValues extends switch (relation.format) { case I.RelationType.Tag: - case I.RelationType.Status: + case I.RelationType.Status: { Item = (element: any) => { return (
); break; + }; - case I.RelationType.Object: + case I.RelationType.Object: { Item = (element: any) => { const type = dbStore.getTypeById(element.type); @@ -150,8 +151,9 @@ const MenuDataviewFilterValues = observer(class MenuDataviewFilterValues extends ); break; + }; - case I.RelationType.Checkbox: + case I.RelationType.Checkbox: { value = (
{ this.onChange('value', v, true); }} - onSelect={(e: any) => { this.onSelect(e); }} + onKeyUp={(e: any, v: string) => this.onChange('value', v, true)} + onSelect={e => this.onSelect(e)} />
); break; + }; + }; + + if (Relation.isDictionary(item.relationKey)) { + value = ( +
+