wip
This commit is contained in:
parent
6ac86af318
commit
31aed243e2
|
@ -134,7 +134,7 @@ const props = withDefaults(defineProps<{
|
||||||
mention?: Misskey.entities.User;
|
mention?: Misskey.entities.User;
|
||||||
specified?: Misskey.entities.User;
|
specified?: Misskey.entities.User;
|
||||||
initialText?: string;
|
initialText?: string;
|
||||||
initialVisibility?: (typeof misskey.noteVisibilities)[number];
|
initialVisibility?: (typeof Misskey.noteVisibilities)[number];
|
||||||
initialFiles?: Misskey.entities.DriveFile[];
|
initialFiles?: Misskey.entities.DriveFile[];
|
||||||
initialLocalOnly?: boolean;
|
initialLocalOnly?: boolean;
|
||||||
initialVisibleUsers?: Misskey.entities.User[];
|
initialVisibleUsers?: Misskey.entities.User[];
|
||||||
|
@ -174,7 +174,7 @@ let showPreview = $ref(defaultStore.state.showPreview);
|
||||||
watch($$(showPreview), () => defaultStore.set('showPreview', showPreview));
|
watch($$(showPreview), () => defaultStore.set('showPreview', showPreview));
|
||||||
let cw = $ref<string | null>(null);
|
let cw = $ref<string | null>(null);
|
||||||
let localOnly = $ref<boolean>(props.initialLocalOnly ?? defaultStore.state.rememberNoteVisibility ? defaultStore.state.localOnly : defaultStore.state.defaultNoteLocalOnly);
|
let localOnly = $ref<boolean>(props.initialLocalOnly ?? defaultStore.state.rememberNoteVisibility ? defaultStore.state.localOnly : defaultStore.state.defaultNoteLocalOnly);
|
||||||
let visibility = $ref(props.initialVisibility ?? (defaultStore.state.rememberNoteVisibility ? defaultStore.state.visibility : defaultStore.state.defaultNoteVisibility) as typeof misskey.noteVisibilities[number]);
|
let visibility = $ref(props.initialVisibility ?? (defaultStore.state.rememberNoteVisibility ? defaultStore.state.visibility : defaultStore.state.defaultNoteVisibility) as typeof Misskey.noteVisibilities[number]);
|
||||||
let visibleUsers = $ref([]);
|
let visibleUsers = $ref([]);
|
||||||
if (props.initialVisibleUsers) {
|
if (props.initialVisibleUsers) {
|
||||||
props.initialVisibleUsers.forEach(pushVisibleUser);
|
props.initialVisibleUsers.forEach(pushVisibleUser);
|
||||||
|
|
|
@ -22,7 +22,7 @@ const props = defineProps<{
|
||||||
mention?: Misskey.entities.User;
|
mention?: Misskey.entities.User;
|
||||||
specified?: Misskey.entities.User;
|
specified?: Misskey.entities.User;
|
||||||
initialText?: string;
|
initialText?: string;
|
||||||
initialVisibility?: typeof misskey.noteVisibilities;
|
initialVisibility?: typeof Misskey.noteVisibilities;
|
||||||
initialFiles?: Misskey.entities.DriveFile[];
|
initialFiles?: Misskey.entities.DriveFile[];
|
||||||
initialLocalOnly?: boolean;
|
initialLocalOnly?: boolean;
|
||||||
initialVisibleUsers?: Misskey.entities.User[];
|
initialVisibleUsers?: Misskey.entities.User[];
|
||||||
|
|
|
@ -50,20 +50,20 @@ import { i18n } from '@/i18n';
|
||||||
const modal = $shallowRef<InstanceType<typeof MkModal>>();
|
const modal = $shallowRef<InstanceType<typeof MkModal>>();
|
||||||
|
|
||||||
const props = withDefaults(defineProps<{
|
const props = withDefaults(defineProps<{
|
||||||
currentVisibility: typeof misskey.noteVisibilities[number];
|
currentVisibility: typeof Misskey.noteVisibilities[number];
|
||||||
localOnly: boolean;
|
localOnly: boolean;
|
||||||
src?: HTMLElement;
|
src?: HTMLElement;
|
||||||
}>(), {
|
}>(), {
|
||||||
});
|
});
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(ev: 'changeVisibility', v: typeof misskey.noteVisibilities[number]): void;
|
(ev: 'changeVisibility', v: typeof Misskey.noteVisibilities[number]): void;
|
||||||
(ev: 'closed'): void;
|
(ev: 'closed'): void;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
let v = $ref(props.currentVisibility);
|
let v = $ref(props.currentVisibility);
|
||||||
|
|
||||||
function choose(visibility: typeof misskey.noteVisibilities[number]): void {
|
function choose(visibility: typeof Misskey.noteVisibilities[number]): void {
|
||||||
v = visibility;
|
v = visibility;
|
||||||
emit('changeVisibility', visibility);
|
emit('changeVisibility', visibility);
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
|
|
|
@ -33,7 +33,6 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
// SPECIFICATION: https://misskey-hub.net/docs/features/share-form.html
|
// SPECIFICATION: https://misskey-hub.net/docs/features/share-form.html
|
||||||
|
|
||||||
import { } from 'vue';
|
import { } from 'vue';
|
||||||
import { noteVisibilities } from 'misskey-js';
|
|
||||||
import * as Misskey from 'misskey-js';
|
import * as Misskey from 'misskey-js';
|
||||||
import MkButton from '@/components/MkButton.vue';
|
import MkButton from '@/components/MkButton.vue';
|
||||||
import MkPostForm from '@/components/MkPostForm.vue';
|
import MkPostForm from '@/components/MkPostForm.vue';
|
||||||
|
@ -44,7 +43,7 @@ import { i18n } from '@/i18n';
|
||||||
|
|
||||||
const urlParams = new URLSearchParams(window.location.search);
|
const urlParams = new URLSearchParams(window.location.search);
|
||||||
const localOnlyQuery = urlParams.get('localOnly');
|
const localOnlyQuery = urlParams.get('localOnly');
|
||||||
const visibilityQuery = urlParams.get('visibility') as typeof noteVisibilities[number];
|
const visibilityQuery = urlParams.get('visibility') as typeof Misskey.noteVisibilities[number];
|
||||||
|
|
||||||
let state = $ref('fetching' as 'fetching' | 'writing' | 'posted');
|
let state = $ref('fetching' as 'fetching' | 'writing' | 'posted');
|
||||||
let title = $ref(urlParams.get('title'));
|
let title = $ref(urlParams.get('title'));
|
||||||
|
@ -53,7 +52,7 @@ const url = urlParams.get('url');
|
||||||
let initialText = $ref<string | undefined>();
|
let initialText = $ref<string | undefined>();
|
||||||
let reply = $ref<Misskey.entities.Note | undefined>();
|
let reply = $ref<Misskey.entities.Note | undefined>();
|
||||||
let renote = $ref<Misskey.entities.Note | undefined>();
|
let renote = $ref<Misskey.entities.Note | undefined>();
|
||||||
let visibility = $ref(noteVisibilities.includes(visibilityQuery) ? visibilityQuery : undefined);
|
let visibility = $ref(Misskey.noteVisibilities.includes(visibilityQuery) ? visibilityQuery : undefined);
|
||||||
let localOnly = $ref(localOnlyQuery === '0' ? false : localOnlyQuery === '1' ? true : undefined);
|
let localOnly = $ref(localOnlyQuery === '0' ? false : localOnlyQuery === '1' ? true : undefined);
|
||||||
let files = $ref([] as Misskey.entities.DriveFile[]);
|
let files = $ref([] as Misskey.entities.DriveFile[]);
|
||||||
let visibleUsers = $ref([] as Misskey.entities.User[]);
|
let visibleUsers = $ref([] as Misskey.entities.User[]);
|
||||||
|
|
Loading…
Reference in New Issue