From a7a5adaf5d33b7fef06f3713a5717bcdff6a3da2 Mon Sep 17 00:00:00 2001
From: kakkokari-gtyih <67428053+kakkokari-gtyih@users.noreply.github.com>
Date: Fri, 6 Sep 2024 18:28:23 +0900
Subject: [PATCH] fix broken imports

---
 packages/frontend-embed/@types/global.d.ts    | 23 +++++++++++++++++++
 .../src/components/EmInstanceTicker.vue       |  3 ++-
 .../frontend-embed/src/components/EmLink.vue  |  2 +-
 .../frontend-embed/src/components/EmMfm.ts    |  7 ++----
 .../frontend-embed/src/components/I18n.vue    |  2 +-
 packages/frontend-embed/tsconfig.json         |  1 -
 6 files changed, 29 insertions(+), 9 deletions(-)
 create mode 100644 packages/frontend-embed/@types/global.d.ts

diff --git a/packages/frontend-embed/@types/global.d.ts b/packages/frontend-embed/@types/global.d.ts
new file mode 100644
index 0000000000..1025d1bedb
--- /dev/null
+++ b/packages/frontend-embed/@types/global.d.ts
@@ -0,0 +1,23 @@
+/*
+ * SPDX-FileCopyrightText: syuilo and misskey-project
+ * SPDX-License-Identifier: AGPL-3.0-only
+ */
+
+type FIXME = any;
+
+declare const _LANGS_: string[][];
+declare const _VERSION_: string;
+declare const _ENV_: string;
+declare const _DEV_: boolean;
+declare const _PERF_PREFIX_: string;
+declare const _DATA_TRANSFER_DRIVE_FILE_: string;
+declare const _DATA_TRANSFER_DRIVE_FOLDER_: string;
+declare const _DATA_TRANSFER_DECK_COLUMN_: string;
+
+// for dev-mode
+declare const _LANGS_FULL_: string[][];
+
+// TagCanvas
+interface Window {
+	TagCanvas: any;
+}
diff --git a/packages/frontend-embed/src/components/EmInstanceTicker.vue b/packages/frontend-embed/src/components/EmInstanceTicker.vue
index 6bea697a65..10eb3cc1c6 100644
--- a/packages/frontend-embed/src/components/EmInstanceTicker.vue
+++ b/packages/frontend-embed/src/components/EmInstanceTicker.vue
@@ -15,6 +15,7 @@ import { computed, inject } from 'vue';
 
 import { DI } from '@/di.js';
 
+const serverMetadata = inject(DI.serverMetadata)!;
 const mediaProxy = inject(DI.mediaProxy)!;
 
 const props = defineProps<{
@@ -27,7 +28,7 @@ const props = defineProps<{
 
 const faviconUrl = computed(() => mediaProxy.getProxiedImageUrlNullable(props.instance.faviconUrl, 'preview'));
 
-const themeColor = instance.themeColor ?? '#777777';
+const themeColor = serverMetadata.themeColor ?? '#777777';
 
 const bg = {
 	background: `linear-gradient(90deg, ${themeColor}, ${themeColor}00)`,
diff --git a/packages/frontend-embed/src/components/EmLink.vue b/packages/frontend-embed/src/components/EmLink.vue
index d67d33e042..319ad72399 100644
--- a/packages/frontend-embed/src/components/EmLink.vue
+++ b/packages/frontend-embed/src/components/EmLink.vue
@@ -14,7 +14,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 </template>
 
 <script lang="ts" setup>
-import { defineAsyncComponent, ref } from 'vue';
+import { ref } from 'vue';
 import EmA from './EmA.vue';
 import { url as local } from '@/config.js';
 
diff --git a/packages/frontend-embed/src/components/EmMfm.ts b/packages/frontend-embed/src/components/EmMfm.ts
index f89565de42..7543d3cd54 100644
--- a/packages/frontend-embed/src/components/EmMfm.ts
+++ b/packages/frontend-embed/src/components/EmMfm.ts
@@ -43,7 +43,7 @@ type MfmProps = {
 	parsedNodes?: mfm.MfmNode[] | null;
 	enableEmojiMenu?: boolean;
 	enableEmojiMenuReaction?: boolean;
-	linkNavigationBehavior?: EmABehavior;
+	linkNavigationBehavior?: string;
 };
 
 type MfmEvents = {
@@ -222,10 +222,7 @@ export default function (props: MfmProps, { emit }: { emit: SetupContext<MfmEven
 						break;
 					}
 					case 'sparkle': {
-						if (!useAnim) {
-							return genEl(token.children, scale);
-						}
-						return h(EmSparkle, {}, genEl(token.children, scale));
+						return genEl(token.children, scale);
 					}
 					case 'rotate': {
 						const degrees = safeParseFloat(token.props.args.deg) ?? 90;
diff --git a/packages/frontend-embed/src/components/I18n.vue b/packages/frontend-embed/src/components/I18n.vue
index 6b7723e6ac..b621110ec9 100644
--- a/packages/frontend-embed/src/components/I18n.vue
+++ b/packages/frontend-embed/src/components/I18n.vue
@@ -9,7 +9,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 
 <script setup lang="ts" generic="T extends string | ParameterizedString">
 import { computed, h } from 'vue';
-import type { ParameterizedString } from '../../../../../locales/index.js';
+import type { ParameterizedString } from '../../../../locales/index.js';
 
 const props = withDefaults(defineProps<{
 	src: T;
diff --git a/packages/frontend-embed/tsconfig.json b/packages/frontend-embed/tsconfig.json
index b88773b598..3701343623 100644
--- a/packages/frontend-embed/tsconfig.json
+++ b/packages/frontend-embed/tsconfig.json
@@ -34,7 +34,6 @@
 		],
 		"types": [
 			"vite/client",
-			"vitest/importMeta",
 		],
 		"lib": [
 			"esnext",