summaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2022-07-16 18:21:44 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2022-07-16 18:21:44 +0900
commitff24811676b7028a39b0b17ab221c2e6e81cca8a (patch)
treef8d869dbbe3289411a96a4df4c53fa5561428ce7 /packages
parentMerge branch 'develop' (diff)
parent12.115.0 (diff)
downloadmisskey-ff24811676b7028a39b0b17ab221c2e6e81cca8a.tar.gz
misskey-ff24811676b7028a39b0b17ab221c2e6e81cca8a.tar.bz2
misskey-ff24811676b7028a39b0b17ab221c2e6e81cca8a.zip
Merge branch 'develop'
Diffstat (limited to 'packages')
-rw-r--r--packages/client/src/components/global/ad.vue14
-rw-r--r--packages/client/src/components/global/emoji.vue77
-rw-r--r--packages/client/src/components/global/page-header.vue4
-rw-r--r--packages/client/src/components/note.vue11
-rw-r--r--packages/client/src/directives/tooltip.ts3
-rw-r--r--packages/client/src/pages/admin/_header_.vue4
-rw-r--r--packages/client/src/pages/settings/deck.vue14
-rw-r--r--packages/client/src/pages/user/home.vue2
-rw-r--r--packages/client/src/pages/user/index.vue5
-rw-r--r--packages/client/src/scripts/get-user-menu.ts7
-rw-r--r--packages/client/src/ui/_common_/navbar-for-mobile.vue2
-rw-r--r--packages/client/src/ui/_common_/navbar.vue16
-rw-r--r--packages/client/src/ui/deck.vue82
-rw-r--r--packages/client/src/ui/deck/deck-store.ts27
14 files changed, 155 insertions, 113 deletions
diff --git a/packages/client/src/components/global/ad.vue b/packages/client/src/components/global/ad.vue
index 180dabb2a2..7725f776a9 100644
--- a/packages/client/src/components/global/ad.vue
+++ b/packages/client/src/components/global/ad.vue
@@ -3,7 +3,7 @@
<div v-if="!showMenu" class="main" :class="ad.place">
<a :href="ad.url" target="_blank">
<img :src="ad.imageUrl">
- <button class="_button menu" @click.prevent.stop="toggleMenu"><span class="fas fa-info-circle"></span></button>
+ <button class="_button menu" @click.prevent.stop="toggleMenu"><span class="fas fa-info-circle info-circle"></span></button>
</a>
</div>
<div v-else class="menu">
@@ -135,13 +135,19 @@ export default defineComponent({
display: block;
object-fit: contain;
margin: auto;
+ border-radius: 5px;
}
> .menu {
position: absolute;
- top: 0;
- right: 0;
- background: var(--panel);
+ top: 1px;
+ right: 1px;
+
+ > .info-circle {
+ border: 3px solid var(--panel);
+ border-radius: 50%;
+ background: var(--panel);
+ }
}
}
diff --git a/packages/client/src/components/global/emoji.vue b/packages/client/src/components/global/emoji.vue
index 23cb649f7a..106778aee2 100644
--- a/packages/client/src/components/global/emoji.vue
+++ b/packages/client/src/components/global/emoji.vue
@@ -1,68 +1,41 @@
-char2filePath<template>
+<template>
<img v-if="customEmoji" class="mk-emoji custom" :class="{ normal, noStyle }" :src="url" :alt="alt" :title="alt" decoding="async"/>
<img v-else-if="char && !useOsNativeEmojis" class="mk-emoji" :src="url" :alt="alt" :title="alt" decoding="async"/>
<span v-else-if="char && useOsNativeEmojis">{{ char }}</span>
<span v-else>{{ emoji }}</span>
</template>
-<script lang="ts">
-import { computed, defineComponent, ref, watch } from 'vue';
+<script lang="ts" setup>
+import { computed, ref, watch } from 'vue';
+import { CustomEmoji } from 'misskey-js/built/entities';
import { getStaticImageUrl } from '@/scripts/get-static-image-url';
import { char2filePath } from '@/scripts/twemoji-base';
import { defaultStore } from '@/store';
import { instance } from '@/instance';
-export default defineComponent({
- props: {
- emoji: {
- type: String,
- required: true
- },
- normal: {
- type: Boolean,
- required: false,
- default: false
- },
- noStyle: {
- type: Boolean,
- required: false,
- default: false
- },
- customEmojis: {
- required: false
- },
- isReaction: {
- type: Boolean,
- default: false
- },
- },
+const props = defineProps<{
+ emoji: string;
+ normal?: boolean;
+ noStyle?: boolean;
+ customEmojis?: CustomEmoji[];
+ isReaction?: boolean;
+}>();
- setup(props) {
- const isCustom = computed(() => props.emoji.startsWith(':'));
- const char = computed(() => isCustom.value ? null : props.emoji);
- const useOsNativeEmojis = computed(() => defaultStore.state.useOsNativeEmojis && !props.isReaction);
- const ce = computed(() => props.customEmojis || instance.emojis || []);
- const customEmoji = computed(() => isCustom.value ? ce.value.find(x => x.name === props.emoji.substr(1, props.emoji.length - 2)) : null);
- const url = computed(() => {
- if (char.value) {
- return char2filePath(char.value);
- } else {
- return defaultStore.state.disableShowingAnimatedImages
- ? getStaticImageUrl(customEmoji.value.url)
- : customEmoji.value.url;
- }
- });
- const alt = computed(() => customEmoji.value ? `:${customEmoji.value.name}:` : char.value);
-
- return {
- url,
- char,
- alt,
- customEmoji,
- useOsNativeEmojis,
- };
- },
+const isCustom = computed(() => props.emoji.startsWith(':'));
+const char = computed(() => isCustom.value ? null : props.emoji);
+const useOsNativeEmojis = computed(() => defaultStore.state.useOsNativeEmojis && !props.isReaction);
+const ce = computed(() => props.customEmojis ?? instance.emojis ?? []);
+const customEmoji = computed(() => isCustom.value ? ce.value.find(x => x.name === props.emoji.substr(1, props.emoji.length - 2)) : null);
+const url = computed(() => {
+ if (char.value) {
+ return char2filePath(char.value);
+ } else {
+ return defaultStore.state.disableShowingAnimatedImages
+ ? getStaticImageUrl(customEmoji.value.url)
+ : customEmoji.value.url;
+ }
});
+const alt = computed(() => customEmoji.value ? `:${customEmoji.value.name}:` : char.value);
</script>
<style lang="scss" scoped>
diff --git a/packages/client/src/components/global/page-header.vue b/packages/client/src/components/global/page-header.vue
index 766f9b6b6a..106e216b9b 100644
--- a/packages/client/src/components/global/page-header.vue
+++ b/packages/client/src/components/global/page-header.vue
@@ -18,7 +18,7 @@
</div>
</div>
<div v-if="!narrow || hideTitle" class="tabs">
- <button v-for="tab in tabs" :ref="(el) => tabRefs[tab.key] = el" v-tooltip="tab.title" class="tab _button" :class="{ active: tab.key != null && tab.key === props.tab }" @mousedown="(ev) => onTabMousedown(tab, ev)" @click="(ev) => onTabClick(tab, ev)">
+ <button v-for="tab in tabs" :ref="(el) => tabRefs[tab.key] = el" v-tooltip.noDelay="tab.title" class="tab _button" :class="{ active: tab.key != null && tab.key === props.tab }" @mousedown="(ev) => onTabMousedown(tab, ev)" @click="(ev) => onTabClick(tab, ev)">
<i v-if="tab.icon" class="icon" :class="tab.icon"></i>
<span v-if="!tab.iconOnly" class="title">{{ tab.title }}</span>
</button>
@@ -27,7 +27,7 @@
</template>
<div class="buttons right">
<template v-for="action in actions">
- <button v-tooltip="action.text" class="_button button" :class="{ highlighted: action.highlighted }" @click.stop="action.handler" @touchstart="preventDrag"><i :class="action.icon"></i></button>
+ <button v-tooltip.noDelay="action.text" class="_button button" :class="{ highlighted: action.highlighted }" @click.stop="action.handler" @touchstart="preventDrag"><i :class="action.icon"></i></button>
</template>
</div>
</div>
diff --git a/packages/client/src/components/note.vue b/packages/client/src/components/note.vue
index 27716cf73d..3c9d361702 100644
--- a/packages/client/src/components/note.vue
+++ b/packages/client/src/components/note.vue
@@ -554,6 +554,13 @@ function readPromo() {
&.max-width_500px {
font-size: 0.9em;
+
+ > .article {
+ > .avatar {
+ width: 50px;
+ height: 50px;
+ }
+ }
}
&.max-width_450px {
@@ -570,8 +577,8 @@ function readPromo() {
> .avatar {
margin: 0 10px 8px 0;
- width: 50px;
- height: 50px;
+ width: 46px;
+ height: 46px;
top: calc(14px + var(--stickyTop, 0px));
}
}
diff --git a/packages/client/src/directives/tooltip.ts b/packages/client/src/directives/tooltip.ts
index e1b85291bd..8b68771cad 100644
--- a/packages/client/src/directives/tooltip.ts
+++ b/packages/client/src/directives/tooltip.ts
@@ -7,10 +7,11 @@ import { popup, alert } from '@/os';
const start = isTouchUsing ? 'touchstart' : 'mouseover';
const end = isTouchUsing ? 'touchend' : 'mouseleave';
-const delay = 100;
export default {
mounted(el: HTMLElement, binding, vn) {
+ const delay = binding.modifiers.noDelay ? 0 : 100;
+
const self = (el as any)._tooltipDirective_ = {} as any;
self.text = binding.value as string;
diff --git a/packages/client/src/pages/admin/_header_.vue b/packages/client/src/pages/admin/_header_.vue
index aea2663c39..b2c33fdc95 100644
--- a/packages/client/src/pages/admin/_header_.vue
+++ b/packages/client/src/pages/admin/_header_.vue
@@ -9,7 +9,7 @@
</div>
</div>
<div class="tabs">
- <button v-for="tab in tabs" :ref="(el) => tabRefs[tab.key] = el" v-tooltip="tab.title" class="tab _button" :class="{ active: tab.key != null && tab.key === props.tab }" @mousedown="(ev) => onTabMousedown(tab, ev)" @click="(ev) => onTabClick(tab, ev)">
+ <button v-for="tab in tabs" :ref="(el) => tabRefs[tab.key] = el" v-tooltip.noDelay="tab.title" class="tab _button" :class="{ active: tab.key != null && tab.key === props.tab }" @mousedown="(ev) => onTabMousedown(tab, ev)" @click="(ev) => onTabClick(tab, ev)">
<i v-if="tab.icon" class="icon" :class="tab.icon"></i>
<span v-if="!tab.iconOnly" class="title">{{ tab.title }}</span>
</button>
@@ -20,7 +20,7 @@
<template v-if="actions">
<template v-for="action in actions">
<MkButton v-if="action.asFullButton" class="fullButton" primary @click.stop="action.handler"><i :class="action.icon" style="margin-right: 6px;"></i>{{ action.text }}</MkButton>
- <button v-else v-tooltip="action.text" class="_button button" :class="{ highlighted: action.highlighted }" @click.stop="action.handler" @touchstart="preventDrag"><i :class="action.icon"></i></button>
+ <button v-else v-tooltip.noDelay="action.text" class="_button button" :class="{ highlighted: action.highlighted }" @click.stop="action.handler" @touchstart="preventDrag"><i :class="action.icon"></i></button>
</template>
</template>
</div>
diff --git a/packages/client/src/pages/settings/deck.vue b/packages/client/src/pages/settings/deck.vue
index c62928eeb0..1285a6641c 100644
--- a/packages/client/src/pages/settings/deck.vue
+++ b/packages/client/src/pages/settings/deck.vue
@@ -9,8 +9,6 @@
<option value="left">{{ i18n.ts.left }}</option>
<option value="center">{{ i18n.ts.center }}</option>
</FormRadios>
-
- <FormLink class="_formBlock" @click="setProfile">{{ i18n.ts._deck.profile }}<template #suffix>{{ profile }}</template></FormLink>
</div>
</template>
@@ -29,18 +27,6 @@ import { definePageMetadata } from '@/scripts/page-metadata';
const navWindow = computed(deckStore.makeGetterSetter('navWindow'));
const alwaysShowMainColumn = computed(deckStore.makeGetterSetter('alwaysShowMainColumn'));
const columnAlign = computed(deckStore.makeGetterSetter('columnAlign'));
-const profile = computed(deckStore.makeGetterSetter('profile'));
-
-async function setProfile() {
- const { canceled, result: name } = await os.inputText({
- title: i18n.ts._deck.profile,
- allowEmpty: false,
- });
- if (canceled) return;
-
- profile.value = name;
- unisonReload();
-}
const headerActions = $computed(() => []);
diff --git a/packages/client/src/pages/user/home.vue b/packages/client/src/pages/user/home.vue
index f7c25f077c..c28079bb32 100644
--- a/packages/client/src/pages/user/home.vue
+++ b/packages/client/src/pages/user/home.vue
@@ -155,7 +155,7 @@ const age = $computed(() => {
});
function menu(ev) {
- os.popupMenu(getUserMenu(props.user), ev.currentTarget ?? ev.target);
+ os.popupMenu(getUserMenu(props.user, router), ev.currentTarget ?? ev.target);
}
function parallaxLoop() {
diff --git a/packages/client/src/pages/user/index.vue b/packages/client/src/pages/user/index.vue
index 99c3413882..4b07beeb8e 100644
--- a/packages/client/src/pages/user/index.vue
+++ b/packages/client/src/pages/user/index.vue
@@ -23,7 +23,6 @@ import calcAge from 's-age';
import * as Acct from 'misskey-js/built/acct';
import * as misskey from 'misskey-js';
import { getScrollPosition } from '@/scripts/scroll';
-import { getUserMenu } from '@/scripts/get-user-menu';
import number from '@/filters/number';
import { userPage, acct as getAcct } from '@/filters/user';
import * as os from '@/os';
@@ -65,10 +64,6 @@ watch(() => props.acct, fetchUser, {
immediate: true,
});
-function menu(ev) {
- os.popupMenu(getUserMenu(user), ev.currentTarget ?? ev.target);
-}
-
const headerActions = $computed(() => []);
const headerTabs = $computed(() => user ? [{
diff --git a/packages/client/src/scripts/get-user-menu.ts b/packages/client/src/scripts/get-user-menu.ts
index 25bcd90e9f..c609fddd51 100644
--- a/packages/client/src/scripts/get-user-menu.ts
+++ b/packages/client/src/scripts/get-user-menu.ts
@@ -7,8 +7,9 @@ import * as os from '@/os';
import { userActions } from '@/store';
import { $i, iAmModerator } from '@/account';
import { mainRouter } from '@/router';
+import { Router } from '@/nirax';
-export function getUserMenu(user) {
+export function getUserMenu(user, router: Router = mainRouter) {
const meId = $i ? $i.id : null;
async function pushList() {
@@ -161,7 +162,7 @@ export function getUserMenu(user) {
icon: 'fas fa-info-circle',
text: i18n.ts.info,
action: () => {
- os.pageWindow(`/user-info/${user.id}`);
+ router.push(`/user-info/${user.id}`);
},
}, {
icon: 'fas fa-envelope',
@@ -227,7 +228,7 @@ export function getUserMenu(user) {
icon: 'fas fa-pencil-alt',
text: i18n.ts.editProfile,
action: () => {
- mainRouter.push('/settings/profile');
+ router.push('/settings/profile');
},
}]);
}
diff --git a/packages/client/src/ui/_common_/navbar-for-mobile.vue b/packages/client/src/ui/_common_/navbar-for-mobile.vue
index cae1d25304..d1b4c30b31 100644
--- a/packages/client/src/ui/_common_/navbar-for-mobile.vue
+++ b/packages/client/src/ui/_common_/navbar-for-mobile.vue
@@ -3,7 +3,7 @@
<div class="body">
<div class="top">
<div class="banner" :style="{ backgroundImage: `url(${ $instance.bannerUrl })` }"></div>
- <button v-click-anime v-tooltip.right="$instance.name ?? i18n.ts.instance" class="item _button instance" @click="openInstanceMenu">
+ <button v-click-anime class="item _button instance" @click="openInstanceMenu">
<img :src="$instance.iconUrl || $instance.faviconUrl || '/favicon.ico'" alt="" class="icon"/>
</button>
</div>
diff --git a/packages/client/src/ui/_common_/navbar.vue b/packages/client/src/ui/_common_/navbar.vue
index fbac8425d7..3eb8c5a37c 100644
--- a/packages/client/src/ui/_common_/navbar.vue
+++ b/packages/client/src/ui/_common_/navbar.vue
@@ -3,12 +3,12 @@
<div class="body">
<div class="top">
<div class="banner" :style="{ backgroundImage: `url(${ $instance.bannerUrl })` }"></div>
- <button v-click-anime v-tooltip.right="$instance.name ?? i18n.ts.instance" class="item _button instance" @click="openInstanceMenu">
+ <button v-click-anime v-tooltip.noDelay.right="$instance.name ?? i18n.ts.instance" class="item _button instance" @click="openInstanceMenu">
<img :src="$instance.iconUrl || $instance.faviconUrl || '/favicon.ico'" alt="" class="icon"/>
</button>
</div>
<div class="middle">
- <MkA v-click-anime v-tooltip.right="i18n.ts.timeline" class="item index" active-class="active" to="/" exact>
+ <MkA v-click-anime v-tooltip.noDelay.right="i18n.ts.timeline" class="item index" active-class="active" to="/" exact>
<i class="icon fas fa-home fa-fw"></i><span class="text">{{ i18n.ts.timeline }}</span>
</MkA>
<template v-for="item in menu">
@@ -17,7 +17,7 @@
:is="navbarItemDef[item].to ? 'MkA' : 'button'"
v-else-if="navbarItemDef[item] && (navbarItemDef[item].show !== false)"
v-click-anime
- v-tooltip.right="i18n.ts[navbarItemDef[item].title]"
+ v-tooltip.noDelay.right="i18n.ts[navbarItemDef[item].title]"
class="item _button"
:class="[item, { active: navbarItemDef[item].active }]"
active-class="active"
@@ -29,22 +29,22 @@
</component>
</template>
<div class="divider"></div>
- <MkA v-if="$i.isAdmin || $i.isModerator" v-click-anime v-tooltip.right="i18n.ts.controlPanel" class="item" active-class="active" to="/admin">
+ <MkA v-if="$i.isAdmin || $i.isModerator" v-click-anime v-tooltip.noDelay.right="i18n.ts.controlPanel" class="item" active-class="active" to="/admin">
<i class="icon fas fa-door-open fa-fw"></i><span class="text">{{ i18n.ts.controlPanel }}</span>
</MkA>
<button v-click-anime class="item _button" @click="more">
<i class="icon fa fa-ellipsis-h fa-fw"></i><span class="text">{{ i18n.ts.more }}</span>
<span v-if="otherMenuItemIndicated" class="indicator"><i class="icon fas fa-circle"></i></span>
</button>
- <MkA v-click-anime v-tooltip.right="i18n.ts.settings" class="item" active-class="active" to="/settings">
+ <MkA v-click-anime v-tooltip.noDelay.right="i18n.ts.settings" class="item" active-class="active" to="/settings">
<i class="icon fas fa-cog fa-fw"></i><span class="text">{{ i18n.ts.settings }}</span>
</MkA>
</div>
<div class="bottom">
- <button v-tooltip.right="i18n.ts.note" class="item _button post" data-cy-open-post-form @click="os.post">
+ <button v-tooltip.noDelay.right="i18n.ts.note" class="item _button post" data-cy-open-post-form @click="os.post">
<i class="icon fas fa-pencil-alt fa-fw"></i><span class="text">{{ i18n.ts.note }}</span>
</button>
- <button v-click-anime v-tooltip.right="i18n.ts.account" class="item _button account" @click="openAccountMenu">
+ <button v-click-anime v-tooltip.noDelay.right="i18n.ts.account" class="item _button account" @click="openAccountMenu">
<MkAvatar :user="$i" class="avatar"/><MkAcct class="text" :user="$i"/>
</button>
</div>
@@ -356,7 +356,7 @@ function more(ev: MouseEvent) {
> .icon {
display: inline-block;
- width: 38px;
+ width: 30px;
aspect-ratio: 1;
}
}
diff --git a/packages/client/src/ui/deck.vue b/packages/client/src/ui/deck.vue
index 94fee1424e..8c9e52063d 100644
--- a/packages/client/src/ui/deck.vue
+++ b/packages/client/src/ui/deck.vue
@@ -33,8 +33,16 @@
<div>{{ i18n.ts._deck.introduction2 }}</div>
</div>
<div class="sideMenu">
- <button v-tooltip.left="i18n.ts._deck.addColumn" class="_button button" @click="addColumn"><i class="fas fa-plus"></i></button>
- <button v-tooltip.left="i18n.ts.settings" class="_button button settings" @click="showSettings"><i class="fas fa-cog"></i></button>
+ <div class="top">
+ <button v-tooltip.noDelay.left="`${i18n.ts._deck.profile}: ${deckStore.state.profile}`" class="_button button" @click="changeProfile"><i class="fas fa-caret-down"></i></button>
+ <button v-tooltip.noDelay.left="i18n.ts._deck.deleteProfile" class="_button button" @click="deleteProfile"><i class="fas fa-trash-can"></i></button>
+ </div>
+ <div class="middle">
+ <button v-tooltip.noDelay.left="i18n.ts._deck.addColumn" class="_button button" @click="addColumn"><i class="fas fa-plus"></i></button>
+ </div>
+ <div class="bottom">
+ <button v-tooltip.noDelay.left="i18n.ts.settings" class="_button button settings" @click="showSettings"><i class="fas fa-cog"></i></button>
+ </div>
</div>
</div>
</div>
@@ -67,7 +75,7 @@
import { computed, defineAsyncComponent, onMounted, provide, ref, watch } from 'vue';
import { v4 as uuid } from 'uuid';
import XCommon from './_common_/common.vue';
-import { deckStore, addColumn as addColumnToStore, loadDeck } from './deck/deck-store';
+import { deckStore, addColumn as addColumnToStore, loadDeck, getProfiles, deleteProfile as deleteProfile_ } from './deck/deck-store';
import DeckColumnCore from '@/ui/deck/column-core.vue';
import XSidebar from '@/ui/_common_/navbar.vue';
import XDrawerMenu from '@/ui/_common_/navbar-for-mobile.vue';
@@ -78,6 +86,7 @@ import { navbarItemDef } from '@/navbar';
import { $i } from '@/account';
import { i18n } from '@/i18n';
import { mainRouter } from '@/router';
+import { unisonReload } from '@/scripts/unison-reload';
const XStatusBars = defineAsyncComponent(() => import('@/ui/_common_/statusbars.vue'));
mainRouter.navHook = (path): boolean => {
@@ -168,6 +177,51 @@ loadDeck();
function moveFocus(id: string, direction: 'up' | 'down' | 'left' | 'right') {
// TODO??
}
+
+function changeProfile(ev: MouseEvent) {
+ const items = ref([{
+ text: deckStore.state.profile,
+ active: true.valueOf,
+ }]);
+ getProfiles().then(profiles => {
+ items.value = [{
+ text: deckStore.state.profile,
+ active: true.valueOf,
+ }, ...(profiles.filter(k => k !== deckStore.state.profile).map(k => ({
+ text: k,
+ action: () => {
+ deckStore.set('profile', k);
+ unisonReload();
+ },
+ }))), null, {
+ text: i18n.ts._deck.newProfile,
+ icon: 'fas fa-plus',
+ action: async () => {
+ const { canceled, result: name } = await os.inputText({
+ title: i18n.ts._deck.profile,
+ allowEmpty: false,
+ });
+ if (canceled) return;
+
+ deckStore.set('profile', name);
+ unisonReload();
+ },
+ }];
+ });
+ os.popupMenu(items, ev.currentTarget ?? ev.target);
+}
+
+async function deleteProfile() {
+ const { canceled } = await os.confirm({
+ type: 'warning',
+ text: i18n.t('deleteAreYouSure', { x: deckStore.state.profile }),
+ });
+ if (canceled) return;
+
+ deleteProfile_(deckStore.state.profile);
+ deckStore.set('profile', 'default');
+ unisonReload();
+}
</script>
<style lang="scss" scoped>
@@ -271,9 +325,25 @@ function moveFocus(id: string, direction: 'up' | 'down' | 'left' | 'right') {
justify-content: center;
width: 32px;
- > .button {
- width: 100%;
- aspect-ratio: 1;
+ > .top, > .middle, > .bottom {
+ > .button {
+ display: block;
+ width: 100%;
+ aspect-ratio: 1;
+ }
+ }
+
+ > .top {
+ margin-bottom: auto;
+ }
+
+ > .middle {
+ margin-top: auto;
+ margin-bottom: auto;
+ }
+
+ > .bottom {
+ margin-top: auto;
}
}
}
diff --git a/packages/client/src/ui/deck/deck-store.ts b/packages/client/src/ui/deck/deck-store.ts
index 3ec53ad556..67fcff4807 100644
--- a/packages/client/src/ui/deck/deck-store.ts
+++ b/packages/client/src/ui/deck/deck-store.ts
@@ -72,18 +72,8 @@ export const loadDeck = async () => {
return;
}
- deckStore.set('columns', [{
- id: 'a',
- type: 'main',
- name: i18n.ts._deck._columns.main,
- width: 350,
- }, {
- id: 'b',
- type: 'notifications',
- name: i18n.ts._deck._columns.notifications,
- width: 330,
- }]);
- deckStore.set('layout', [['a'], ['b']]);
+ deckStore.set('columns', []);
+ deckStore.set('layout', []);
return;
}
throw err;
@@ -105,6 +95,19 @@ export const saveDeck = throttle(1000, () => {
});
});
+export async function getProfiles(): Promise<string[]> {
+ return await api('i/registry/keys', {
+ scope: ['client', 'deck', 'profiles'],
+ });
+}
+
+export async function deleteProfile(key: string): Promise<void> {
+ return await api('i/registry/remove', {
+ scope: ['client', 'deck', 'profiles'],
+ key: key,
+ });
+}
+
export function addColumn(column: Column) {
if (column.name === undefined) column.name = null;
deckStore.push('columns', column);