update deps (MisskeyIO#950)
This commit is contained in:
parent
b85f6e9b75
commit
60684568e5
24 changed files with 3418 additions and 3463 deletions
14
packages/frontend/@types/vue-gtag.d.ts
vendored
14
packages/frontend/@types/vue-gtag.d.ts
vendored
|
@ -1,14 +0,0 @@
|
|||
declare module 'vue-gtag' {
|
||||
export type GtagConsent = (command: 'consent', arg: 'default' | 'update', params: GtagConsentParams) => void;
|
||||
|
||||
export interface GtagConsentParams {
|
||||
ad_storage?: 'granted' | 'denied',
|
||||
ad_user_data?: 'granted' | 'denied',
|
||||
ad_personalization?: 'granted' | 'denied',
|
||||
analytics_storage?: 'granted' | 'denied',
|
||||
functionality_storage?: 'granted' | 'denied',
|
||||
personalization_storage?: 'granted' | 'denied',
|
||||
security_storage?: 'granted' | 'denied',
|
||||
wait_for_update?: number
|
||||
}
|
||||
}
|
|
@ -26,23 +26,23 @@
|
|||
"@rollup/plugin-typescript": "12.1.2",
|
||||
"@rollup/pluginutils": "5.1.4",
|
||||
"@syuilo/aiscript": "0.19.0",
|
||||
"@tabler/icons-webfont": "3.29.0",
|
||||
"@tabler/icons-webfont": "3.31.0",
|
||||
"@twemoji/parser": "15.1.1",
|
||||
"@vitejs/plugin-vue": "5.2.1",
|
||||
"@vitejs/plugin-vue": "5.2.3",
|
||||
"@vue/compiler-sfc": "3.5.13",
|
||||
"aiscript-vscode": "github:aiscript-dev/aiscript-vscode#v0.1.15",
|
||||
"astring": "1.9.0",
|
||||
"broadcast-channel": "7.0.0",
|
||||
"broadcast-channel": "7.1.0",
|
||||
"buraha": "0.0.1",
|
||||
"canvas-confetti": "1.9.3",
|
||||
"chart.js": "4.4.7",
|
||||
"chart.js": "4.4.8",
|
||||
"chartjs-adapter-date-fns": "3.0.0",
|
||||
"chartjs-chart-matrix": "2.0.1",
|
||||
"chartjs-chart-matrix": "3.0.0",
|
||||
"chartjs-plugin-gradient": "0.6.1",
|
||||
"chartjs-plugin-zoom": "2.2.0",
|
||||
"chromatic": "11.25.2",
|
||||
"chromatic": "11.27.0",
|
||||
"compare-versions": "6.1.1",
|
||||
"cropperjs": "2.0.0-rc.0",
|
||||
"cropperjs": "2.0.0",
|
||||
"date-fns": "4.1.0",
|
||||
"escape-regexp": "0.0.1",
|
||||
"estree-walker": "3.0.3",
|
||||
|
@ -58,87 +58,87 @@
|
|||
"misskey-reversi": "workspace:*",
|
||||
"photoswipe": "5.4.4",
|
||||
"punycode.js": "2.3.1",
|
||||
"rollup": "4.34.0",
|
||||
"sanitize-html": "2.14.0",
|
||||
"sass": "1.83.4",
|
||||
"shiki": "2.2.0",
|
||||
"rollup": "4.38.0",
|
||||
"sanitize-html": "2.15.0",
|
||||
"sass": "1.86.0",
|
||||
"shiki": "3.2.1",
|
||||
"strict-event-emitter-types": "2.0.0",
|
||||
"textarea-caret": "3.1.0",
|
||||
"three": "0.173.0",
|
||||
"three": "0.175.0",
|
||||
"throttle-debounce": "5.0.2",
|
||||
"tinycolor2": "1.6.0",
|
||||
"tsc-alias": "1.8.10",
|
||||
"tsc-alias": "1.8.13",
|
||||
"tsconfig-paths": "4.2.0",
|
||||
"typescript": "5.7.3",
|
||||
"uuid": "11.0.5",
|
||||
"typescript": "5.8.2",
|
||||
"uuid": "11.1.0",
|
||||
"v-code-diff": "1.13.1",
|
||||
"vite": "6.0.11",
|
||||
"vite": "6.2.3",
|
||||
"vue": "3.5.13",
|
||||
"vue-gtag": "2.0.1",
|
||||
"vue-gtag": "3.1.1",
|
||||
"vuedraggable": "next",
|
||||
"webgl-audiovisualizer": "github:tar-bin/webgl-audiovisualizer"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@misskey-dev/eslint-plugin": "1.0.0",
|
||||
"@misskey-dev/summaly": "github:MisskeyIO/summaly#5.1.3",
|
||||
"@storybook/addon-actions": "8.5.2",
|
||||
"@storybook/addon-essentials": "8.5.2",
|
||||
"@storybook/addon-interactions": "8.5.2",
|
||||
"@storybook/addon-links": "8.5.2",
|
||||
"@storybook/addon-mdx-gfm": "8.5.2",
|
||||
"@storybook/addon-storysource": "8.5.2",
|
||||
"@storybook/blocks": "8.5.2",
|
||||
"@storybook/components": "8.5.2",
|
||||
"@storybook/core-events": "8.5.2",
|
||||
"@storybook/manager-api": "8.5.2",
|
||||
"@storybook/preview-api": "8.5.2",
|
||||
"@storybook/react": "8.5.2",
|
||||
"@storybook/react-vite": "8.5.2",
|
||||
"@storybook/test": "8.5.2",
|
||||
"@storybook/theming": "8.5.2",
|
||||
"@storybook/types": "8.5.2",
|
||||
"@storybook/vue3": "8.5.2",
|
||||
"@storybook/vue3-vite": "8.5.2",
|
||||
"@storybook/addon-actions": "8.6.11",
|
||||
"@storybook/addon-essentials": "8.6.11",
|
||||
"@storybook/addon-interactions": "8.6.11",
|
||||
"@storybook/addon-links": "8.6.11",
|
||||
"@storybook/addon-mdx-gfm": "8.6.11",
|
||||
"@storybook/addon-storysource": "8.6.11",
|
||||
"@storybook/blocks": "8.6.11",
|
||||
"@storybook/components": "8.6.11",
|
||||
"@storybook/core-events": "8.6.11",
|
||||
"@storybook/manager-api": "8.6.11",
|
||||
"@storybook/preview-api": "8.6.11",
|
||||
"@storybook/react": "8.6.11",
|
||||
"@storybook/react-vite": "8.6.11",
|
||||
"@storybook/test": "8.6.11",
|
||||
"@storybook/theming": "8.6.11",
|
||||
"@storybook/types": "8.6.11",
|
||||
"@storybook/vue3": "8.6.11",
|
||||
"@storybook/vue3-vite": "8.6.11",
|
||||
"@testing-library/vue": "8.1.0",
|
||||
"@types/escape-regexp": "0.0.3",
|
||||
"@types/estree": "1.0.6",
|
||||
"@types/estree": "1.0.7",
|
||||
"@types/matter-js": "0.19.8",
|
||||
"@types/micromatch": "4.0.9",
|
||||
"@types/node": "22.13.0",
|
||||
"@types/node": "22.13.14",
|
||||
"@types/punycode.js": "npm:@types/punycode@2.1.4",
|
||||
"@types/sanitize-html": "2.13.0",
|
||||
"@types/three": "0.173.0",
|
||||
"@types/sanitize-html": "2.15.0",
|
||||
"@types/three": "0.175.0",
|
||||
"@types/throttle-debounce": "5.0.2",
|
||||
"@types/tinycolor2": "1.4.6",
|
||||
"@types/ws": "8.5.14",
|
||||
"@types/ws": "8.18.0",
|
||||
"@typescript-eslint/eslint-plugin": "7.10.0",
|
||||
"@typescript-eslint/parser": "7.10.0",
|
||||
"@vitest/coverage-v8": "3.0.4",
|
||||
"@vitest/coverage-v8": "3.0.9",
|
||||
"@vue/runtime-core": "3.5.13",
|
||||
"acorn": "8.14.0",
|
||||
"acorn": "8.14.1",
|
||||
"cross-env": "7.0.3",
|
||||
"cypress": "14.0.1",
|
||||
"cypress": "14.2.1",
|
||||
"eslint": "8.57.1",
|
||||
"eslint-plugin-import": "2.31.0",
|
||||
"eslint-plugin-vue": "9.32.0",
|
||||
"fast-glob": "3.3.3",
|
||||
"happy-dom": "16.8.1",
|
||||
"happy-dom": "17.4.4",
|
||||
"intersection-observer": "0.12.2",
|
||||
"micromatch": "4.0.8",
|
||||
"msw": "2.7.0",
|
||||
"msw": "2.7.3",
|
||||
"msw-storybook-addon": "2.0.4",
|
||||
"nodemon": "3.1.9",
|
||||
"prettier": "3.4.2",
|
||||
"react": "19.0.0",
|
||||
"react-dom": "19.0.0",
|
||||
"start-server-and-test": "2.0.10",
|
||||
"storybook": "8.5.2",
|
||||
"prettier": "3.5.3",
|
||||
"react": "19.1.0",
|
||||
"react-dom": "19.1.0",
|
||||
"start-server-and-test": "2.0.11",
|
||||
"storybook": "8.6.11",
|
||||
"storybook-addon-misskey-theme": "github:misskey-dev/storybook-addon-misskey-theme",
|
||||
"vite-plugin-turbosnap": "1.0.3",
|
||||
"vitest": "3.0.4",
|
||||
"vitest": "3.0.9",
|
||||
"vitest-fetch-mock": "0.3.0",
|
||||
"vue-component-type-helpers": "2.2.0",
|
||||
"vue-component-type-helpers": "2.2.8",
|
||||
"vue-eslint-parser": "9.4.3",
|
||||
"vue-tsc": "2.2.0"
|
||||
"vue-tsc": "2.2.8"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,8 @@ import { miLocalStorage } from '@/local-storage.js';
|
|||
import { fetchCustomEmojis } from '@/custom-emojis.js';
|
||||
import { setupRouter } from '@/router/definition.js';
|
||||
import { mainRouter } from '@/router/main.js';
|
||||
import VueGtag, { bootstrap as gtagBootstrap, GtagConsent, GtagConsentParams } from 'vue-gtag';
|
||||
import { createGtag, addGtag, consent as gtagConsent } from 'vue-gtag';
|
||||
import type { GtagConsentParams } from '@/types/gtag.js';
|
||||
|
||||
export async function common(createVue: () => App<Element>) {
|
||||
console.info(`Misskey v${version}`);
|
||||
|
@ -268,21 +269,21 @@ export async function common(createVue: () => App<Element>) {
|
|||
components(app);
|
||||
|
||||
if (instance.googleAnalyticsId) {
|
||||
app.use(VueGtag, {
|
||||
bootstrap: false,
|
||||
appName: `Misskey v${version}`,
|
||||
pageTrackerEnabled: true,
|
||||
pageTrackerScreenviewEnabled: true,
|
||||
app.use(createGtag( {
|
||||
tagId: instance.googleAnalyticsId,
|
||||
config: {
|
||||
id: instance.googleAnalyticsId,
|
||||
params: {
|
||||
anonymize_ip: false,
|
||||
send_page_view: true,
|
||||
},
|
||||
anonymize_ip: false,
|
||||
send_page_view: true,
|
||||
},
|
||||
}, mainRouter);
|
||||
pageTracker: {
|
||||
router: mainRouter,
|
||||
useScreenview: true,
|
||||
},
|
||||
initMode: 'manual',
|
||||
appName: `Misskey v${version}`,
|
||||
}));
|
||||
|
||||
const gtagConsent = miLocalStorage.getItemAsJson('gtagConsent') as GtagConsentParams ?? {
|
||||
const gtagConsentParams = miLocalStorage.getItemAsJson('gtagConsent') as GtagConsentParams ?? {
|
||||
ad_storage: 'denied',
|
||||
ad_user_data: 'denied',
|
||||
ad_personalization: 'denied',
|
||||
|
@ -291,13 +292,12 @@ export async function common(createVue: () => App<Element>) {
|
|||
personalization_storage: 'denied',
|
||||
security_storage: 'granted',
|
||||
};
|
||||
miLocalStorage.setItemAsJson('gtagConsent', gtagConsent);
|
||||
|
||||
if (typeof window['gtag'] === 'function') (window['gtag'] as GtagConsent)('consent', 'default', gtagConsent);
|
||||
miLocalStorage.setItemAsJson('gtagConsent', gtagConsentParams);
|
||||
gtagConsent('default', gtagConsentParams);
|
||||
|
||||
if (miLocalStorage.getItem('gaConsent') === 'true') {
|
||||
// noinspection ES6MissingAwait
|
||||
gtagBootstrap();
|
||||
addGtag();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -59,12 +59,8 @@ import { host } from '@/config.js';
|
|||
import { i18n } from '@/i18n.js';
|
||||
import { $i } from '@/account.js';
|
||||
import * as os from '@/os.js';
|
||||
import {
|
||||
bootstrap as gtagBootstrap,
|
||||
GtagConsent,
|
||||
GtagConsentParams,
|
||||
set as gtagSet
|
||||
} from 'vue-gtag';
|
||||
import { addGtag, consent as gtagConsent, set as gtagSet } from 'vue-gtag';
|
||||
import type { GtagConsentParams } from '@/types/gtag.js';
|
||||
|
||||
const emit = defineEmits<(ev: 'closed') => void>();
|
||||
|
||||
|
@ -76,7 +72,7 @@ const gtagConsentPersonalization = ref(false);
|
|||
|
||||
function consentAll() {
|
||||
miLocalStorage.setItem('gaConsent', 'true');
|
||||
const gtagConsent = <GtagConsentParams>{
|
||||
const params = <GtagConsentParams>{
|
||||
ad_storage: 'granted',
|
||||
ad_user_data: 'granted',
|
||||
ad_personalization: 'granted',
|
||||
|
@ -85,9 +81,8 @@ function consentAll() {
|
|||
personalization_storage: 'granted',
|
||||
security_storage: 'granted',
|
||||
};
|
||||
miLocalStorage.setItemAsJson('gtagConsent', gtagConsent);
|
||||
|
||||
if (typeof window['gtag'] === 'function') (window['gtag'] as GtagConsent)('consent', 'update', gtagConsent);
|
||||
miLocalStorage.setItemAsJson('gtagConsent', params);
|
||||
gtagConsent('update', params);
|
||||
bootstrap();
|
||||
|
||||
emit('closed');
|
||||
|
@ -95,7 +90,7 @@ function consentAll() {
|
|||
|
||||
function consentEssential() {
|
||||
miLocalStorage.setItem('gaConsent', 'true');
|
||||
const gtagConsent = <GtagConsentParams>{
|
||||
const params = <GtagConsentParams>{
|
||||
ad_storage: 'denied',
|
||||
ad_user_data: 'denied',
|
||||
ad_personalization: 'denied',
|
||||
|
@ -104,9 +99,8 @@ function consentEssential() {
|
|||
personalization_storage: 'denied',
|
||||
security_storage: 'granted',
|
||||
};
|
||||
miLocalStorage.setItemAsJson('gtagConsent', gtagConsent);
|
||||
|
||||
if (typeof window['gtag'] === 'function') (window['gtag'] as GtagConsent)('consent', 'update', gtagConsent);
|
||||
miLocalStorage.setItemAsJson('gtagConsent', params);
|
||||
gtagConsent('update', params);
|
||||
bootstrap();
|
||||
|
||||
emit('closed');
|
||||
|
@ -114,7 +108,7 @@ function consentEssential() {
|
|||
|
||||
function consentSelected() {
|
||||
miLocalStorage.setItem('gaConsent', 'true');
|
||||
const gtagConsent = <GtagConsentParams>{
|
||||
const params = <GtagConsentParams>{
|
||||
ad_storage: gtagConsentAnalytics.value ? 'granted' : 'denied',
|
||||
ad_user_data: gtagConsentFunctionality.value ? 'granted' : 'denied',
|
||||
ad_personalization: gtagConsentPersonalization.value ? 'granted' : 'denied',
|
||||
|
@ -123,16 +117,15 @@ function consentSelected() {
|
|||
personalization_storage: gtagConsentPersonalization.value ? 'granted' : 'denied',
|
||||
security_storage: 'granted',
|
||||
};
|
||||
miLocalStorage.setItemAsJson('gtagConsent', gtagConsent);
|
||||
|
||||
if (typeof window['gtag'] === 'function') (window['gtag'] as GtagConsent)('consent', 'update', gtagConsent);
|
||||
miLocalStorage.setItemAsJson('gtagConsent', params);
|
||||
gtagConsent('update', params);
|
||||
bootstrap();
|
||||
|
||||
emit('closed');
|
||||
}
|
||||
|
||||
function bootstrap() {
|
||||
gtagBootstrap();
|
||||
addGtag();
|
||||
gtagSet({
|
||||
'client_id': miLocalStorage.getItem('id'),
|
||||
'user_id': $i?.id,
|
||||
|
|
|
@ -110,7 +110,8 @@ import { unisonReload } from '@/scripts/unison-reload.js';
|
|||
import { miLocalStorage } from '@/local-storage.js';
|
||||
import { instance } from '@/instance.js';
|
||||
import { host } from '@/config.js';
|
||||
import { GtagConsent, GtagConsentParams } from 'vue-gtag';
|
||||
import { consent as gtagConsent } from 'vue-gtag';
|
||||
import type { GtagConsentParams } from '@/types/gtag.js';
|
||||
|
||||
const $i = signinRequired();
|
||||
|
||||
|
@ -137,18 +138,17 @@ const gaConsent = computed({
|
|||
gaConsentInternal.value = value;
|
||||
},
|
||||
});
|
||||
const gtagConsentInternal = ref(
|
||||
(miLocalStorage.getItemAsJson('gtagConsent') as GtagConsentParams) ?? {
|
||||
ad_storage: 'denied',
|
||||
ad_user_data: 'denied',
|
||||
ad_personalization: 'denied',
|
||||
analytics_storage: 'denied',
|
||||
functionality_storage: 'denied',
|
||||
personalization_storage: 'denied',
|
||||
security_storage: 'granted',
|
||||
},
|
||||
);
|
||||
const gtagConsent = computed({
|
||||
const gtagConsentInternal = ref({
|
||||
ad_storage: 'denied',
|
||||
ad_user_data: 'denied',
|
||||
ad_personalization: 'denied',
|
||||
analytics_storage: 'denied',
|
||||
functionality_storage: 'denied',
|
||||
personalization_storage: 'denied',
|
||||
security_storage: 'granted',
|
||||
...(miLocalStorage.getItemAsJson('gtagConsent') as GtagConsentParams),
|
||||
});
|
||||
const gtagConsentParams = computed({
|
||||
get: () => gtagConsentInternal.value,
|
||||
set: (value: GtagConsentParams) => {
|
||||
miLocalStorage.setItemAsJson('gtagConsent', value);
|
||||
|
@ -156,10 +156,10 @@ const gtagConsent = computed({
|
|||
},
|
||||
});
|
||||
const gtagConsentAnalytics = computed({
|
||||
get: () => gtagConsent.value.analytics_storage === 'granted',
|
||||
get: () => gtagConsentParams.value.analytics_storage === 'granted',
|
||||
set: (value: boolean) => {
|
||||
gtagConsent.value = {
|
||||
...gtagConsent.value,
|
||||
gtagConsentParams.value = {
|
||||
...gtagConsentParams.value,
|
||||
ad_storage: value ? 'granted' : 'denied',
|
||||
ad_user_data: value ? 'granted' : 'denied',
|
||||
analytics_storage: value ? 'granted' : 'denied',
|
||||
|
@ -167,19 +167,19 @@ const gtagConsentAnalytics = computed({
|
|||
},
|
||||
});
|
||||
const gtagConsentFunctionality = computed({
|
||||
get: () => gtagConsent.value.functionality_storage === 'granted',
|
||||
get: () => gtagConsentParams.value.functionality_storage === 'granted',
|
||||
set: (value: boolean) => {
|
||||
gtagConsent.value = {
|
||||
...gtagConsent.value,
|
||||
gtagConsentParams.value = {
|
||||
...gtagConsentParams.value,
|
||||
functionality_storage: value ? 'granted' : 'denied',
|
||||
};
|
||||
},
|
||||
});
|
||||
const gtagConsentPersonalization = computed({
|
||||
get: () => gtagConsent.value.personalization_storage === 'granted',
|
||||
get: () => gtagConsentParams.value.personalization_storage === 'granted',
|
||||
set: (value: boolean) => {
|
||||
gtagConsent.value = {
|
||||
...gtagConsent.value,
|
||||
gtagConsentParams.value = {
|
||||
...gtagConsentParams.value,
|
||||
ad_personalization: value ? 'granted' : 'denied',
|
||||
personalization_storage: value ? 'granted' : 'denied',
|
||||
};
|
||||
|
@ -200,8 +200,8 @@ watch(gaConsent, async () => {
|
|||
await reloadAsk();
|
||||
});
|
||||
|
||||
watch(gtagConsent, async () => {
|
||||
if (typeof window['gtag'] === 'function') (window['gtag'] as GtagConsent)('consent', 'update', gtagConsent.value);
|
||||
watch(gtagConsentParams, async () => {
|
||||
gtagConsent('update', gtagConsentParams.value as GtagConsentParams);
|
||||
});
|
||||
|
||||
function save() {
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
|
||||
import { generateClientTransactionId } from '@/scripts/misskey-api.js';
|
||||
import { miLocalStorage } from '@/local-storage.js';
|
||||
import { GtagConsentParams } from 'vue-gtag';
|
||||
import { instance } from '@/instance.js';
|
||||
import type { GtagConsentParams } from '@/types/gtag.js';
|
||||
|
||||
export interface UsageReport {
|
||||
t: number;
|
||||
|
|
11
packages/frontend/src/types/gtag.ts
Normal file
11
packages/frontend/src/types/gtag.ts
Normal file
|
@ -0,0 +1,11 @@
|
|||
export interface GtagConsentParams {
|
||||
ad_storage?: 'granted' | 'denied',
|
||||
ad_user_data?: 'granted' | 'denied',
|
||||
ad_personalization?: 'granted' | 'denied',
|
||||
analytics_storage?: 'granted' | 'denied',
|
||||
functionality_storage?: 'granted' | 'denied',
|
||||
personalization_storage?: 'granted' | 'denied',
|
||||
security_storage?: 'granted' | 'denied',
|
||||
wait_for_update?: number,
|
||||
region?: string[],
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue