Merge remote-tracking branch 'misskey-dev/master' into develop

This commit is contained in:
2022-06-13 16:31:41 +09:00
10 changed files with 49 additions and 21 deletions

View File

@ -41,7 +41,7 @@ const defaultRoutes = [
{ path: '/gallery', component: page(() => import('./pages/gallery/index.vue')) },
{ path: '/gallery/new', component: page(() => import('./pages/gallery/edit.vue')) },
{ path: '/gallery/:postId/edit', component: page(() => import('./pages/gallery/edit.vue')), props: route => ({ postId: route.params.postId }) },
{ path: '/gallery/:postId', component: page(() => import('./pages/gallery/edit.vue')), props: route => ({ postId: route.params.postId }) },
{ path: '/gallery/:postId', component: page(() => import('./pages/gallery/post.vue')), props: route => ({ postId: route.params.postId }) },
{ path: '/channels', component: page('channels') },
{ path: '/channels/new', component: page('channel-editor') },
{ path: '/channels/:channelId/edit', component: page('channel-editor'), props: true },

View File

@ -1,9 +1,9 @@
import { throttle } from 'throttle-debounce';
import { markRaw } from 'vue';
import { notificationTypes } from 'misskey-js';
import { Storage } from '../../pizzax';
import { i18n } from '@/i18n';
import { api } from '@/os';
import { markRaw } from 'vue';
import { Storage } from '../../pizzax';
import { notificationTypes } from 'misskey-js';
type ColumnWidget = {
name: string;
@ -32,35 +32,35 @@ function copy<T>(x: T): T {
export const deckStore = markRaw(new Storage('deck', {
profile: {
where: 'deviceAccount',
default: 'default'
default: 'default',
},
columns: {
where: 'deviceAccount',
default: [] as Column[]
default: [] as Column[],
},
layout: {
where: 'deviceAccount',
default: [] as Column['id'][][]
default: [] as Column['id'][][],
},
columnAlign: {
where: 'deviceAccount',
default: 'left' as 'left' | 'right' | 'center'
default: 'left' as 'left' | 'right' | 'center',
},
alwaysShowMainColumn: {
where: 'deviceAccount',
default: true
default: true,
},
navWindow: {
where: 'deviceAccount',
default: true
default: true,
},
columnMargin: {
where: 'deviceAccount',
default: 16
default: 16,
},
columnHeaderHeight: {
where: 'deviceAccount',
default: 42
default: 42,
},
}));
@ -109,7 +109,7 @@ export const saveDeck = throttle(1000, () => {
value: {
columns: deckStore.reactiveState.columns.value,
layout: deckStore.reactiveState.layout.value,
}
},
});
});
@ -276,7 +276,7 @@ export function setColumnWidgets(id: Column['id'], widgets: ColumnWidget[]) {
saveDeck();
}
export function updateColumnWidget(id: Column['id'], widgetId: string, WidgetData: any) {
export function updateColumnWidget(id: Column['id'], widgetId: string, widgetData: any) {
const columns = copy(deckStore.state.columns);
const columnIndex = deckStore.state.columns.findIndex(c => c.id === id);
const column = copy(deckStore.state.columns[columnIndex]);

View File

@ -10,9 +10,9 @@
<script lang="ts" setup>
import { } from 'vue';
import XWidgets from '@/components/widgets.vue';
import XColumn from './column.vue';
import { addColumnWidget, Column, removeColumnWidget, setColumnWidgets, updateColumnWidget } from './deck-store';
import XWidgets from '@/components/widgets.vue';
const props = defineProps<{
column: Column;