Keyboard popup (#1625)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev
2022-05-04 15:08:12 +07:00
committed by GitHub
parent 0cec2cb1d1
commit 8d7e3078e1
63 changed files with 1627 additions and 909 deletions
@@ -22,10 +22,10 @@
import { Avatar, createQuery, setClient } from '@anticrm/presentation'
import {
AnyComponent,
closePanel,
closePopup,
closeTooltip,
Component,
DatePickerPopup,
getCurrentLocation,
location,
Location,
@@ -33,12 +33,12 @@
PanelInstance,
Popup,
showPopup,
DatePickerPopup,
TooltipInstance
} from '@anticrm/ui'
import { ActionContext, ActionHandler } from '@anticrm/view-resources'
import type { Application, NavigatorModel, SpecialNavModel, ViewConfiguration } from '@anticrm/workbench'
import { onDestroy, tick } from 'svelte'
import { doNavigate } from '../utils'
import workbench from '../plugin'
import AccountPopup from './AccountPopup.svelte'
import AppItem from './AppItem.svelte'
@@ -182,36 +182,31 @@
}
visibileNav = true
closePanel()
const loc = getCurrentLocation()
loc.path[1] = app._id
loc.path.length = 2
navigate(loc)
doNavigate([], undefined, {
mode: 'app',
application: app._id
})
}
function selectSpecial (id: string): void {
if (currentSpecial === id) return
closePanel()
const loc = getCurrentLocation()
loc.path[2] = id
loc.path.length = 3
doNavigate([], undefined, {
mode: 'special',
special: id
})
checkOnHide()
navigate(loc)
}
function selectSpace (spaceId?: Ref<Space>, spaceSpecial?: string): void {
if (currentSpace === spaceId && (spaceSpecial === currentSpecial || spaceSpecial === asideId)) return
closePanel()
const loc = getCurrentLocation()
if (spaceId !== undefined) {
loc.path[2] = spaceId
const special = spaceSpecial
if (special !== undefined) {
loc.path[3] = special
}
}
doNavigate([], undefined, {
mode: 'space',
space: spaceId,
spaceSpecial: spaceSpecial
})
checkOnHide()
navigate(loc)
}
function closeAside (): void {
@@ -52,7 +52,7 @@
const addSpace: Action = {
label: model.addSpaceLabel,
icon: IconAdd,
action: async (_id: Ref<Doc>, ev?: Event): Promise<void> => {
action: async (_id: Ref<Doc>): Promise<void> => {
dispatch('open')
showPopup(model.createComponent, {}, 'top')
}
@@ -61,7 +61,7 @@
const browseSpaces: Action = {
label: plugin.string.BrowseSpaces,
icon: IconSearch,
action: async (_id: Ref<Doc>, ev?: Event): Promise<void> => {
action: async (_id: Ref<Doc>): Promise<void> => {
const loc = getCurrentLocation()
loc.path[2] = 'spaceBrowser'
dispatch('open')
@@ -111,7 +111,7 @@
label: act.label,
action: async (evt: Event) => {
const impl = await getResource(act.action)
await impl(space, evt)
await impl(space, evt, act.actionProps)
}
})
}
@@ -74,7 +74,7 @@
label: act.label,
action: async (evt: Event) => {
const impl = await getResource(act.action)
await impl(space, evt)
await impl(space, evt, act.actionProps)
}
})
}