diff --git a/src/consts/const.ts b/src/consts/const.ts index 9af800a..09b910b 100644 --- a/src/consts/const.ts +++ b/src/consts/const.ts @@ -1,7 +1,3 @@ -export const MESSAGE_TARGET_EXTENSION = 'BilibiliExtension' -export const MESSAGE_TARGET_INJECT = 'BilibiliInject' -export const MESSAGE_TARGET_APP = 'BilibiliAPP' - export const MESSAGE_TO_EXTENSION_CLOSE_SIDE_PANEL = 'closeSidePanel' export const MESSAGE_TO_EXTENSION_ADD_TASK = 'addTask' export const MESSAGE_TO_EXTENSION_GET_TASK = 'getTask' @@ -24,8 +20,6 @@ export const MESSAGE_TO_APP_SET_VIDEO_INFO = 'setVideoInfo' export const EVENT_EXPAND = 'expand' -export const APP_DOM_ID = 'bilibili-subtitle' - export const IFRAME_ID = 'bilibili-subtitle-iframe' export const STORAGE_ENV = 'bilibili-subtitle_env' diff --git a/src/inject/inject.ts b/src/inject/inject.ts index 5101822..77578ae 100644 --- a/src/inject/inject.ts +++ b/src/inject/inject.ts @@ -1,4 +1,4 @@ -import { TOTAL_HEIGHT_DEF, HEADER_HEIGHT, TOTAL_HEIGHT_MIN, TOTAL_HEIGHT_MAX, IFRAME_ID, MESSAGE_TO_INJECT_DOWNLOAD_AUDIO, MESSAGE_TARGET_INJECT, MESSAGE_TO_APP_SET_INFOS, MESSAGE_TO_INJECT_TOGGLE_DISPLAY, STORAGE_ENV, MESSAGE_TO_EXTENSION_SHOW_FLAG } from '@/consts/const' +import { TOTAL_HEIGHT_DEF, HEADER_HEIGHT, TOTAL_HEIGHT_MIN, TOTAL_HEIGHT_MAX, IFRAME_ID, MESSAGE_TO_INJECT_DOWNLOAD_AUDIO, MESSAGE_TO_APP_SET_INFOS, MESSAGE_TO_INJECT_TOGGLE_DISPLAY, STORAGE_ENV, MESSAGE_TO_EXTENSION_SHOW_FLAG } from '@/consts/const' import { MESSAGE_TO_INJECT_FOLD, MESSAGE_TO_INJECT_MOVE, MESSAGE_TO_APP_SET_VIDEO_INFO, MESSAGE_TO_INJECT_GET_SUBTITLE, MESSAGE_TO_INJECT_GET_VIDEO_STATUS, MESSAGE_TO_INJECT_GET_VIDEO_ELEMENT_INFO, MESSAGE_TO_INJECT_UPDATETRANSRESULT, MESSAGE_TO_INJECT_PLAY, MESSAGE_TO_INJECT_HIDE_TRANS, MESSAGE_TO_INJECT_REFRESH_VIDEO_INFO } from '@/consts/const' import InjectMessaging from '@/messaging/layer2/InjectMessaging' diff --git a/src/main.tsx b/src/main.tsx index 8a919f7..6205274 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -4,7 +4,8 @@ import './index.less' import store from './store' import {Provider} from 'react-redux' import Router from './Router' -import {APP_DOM_ID} from './consts/const' + +export const APP_DOM_ID = 'bilibili-subtitle' const body = document.querySelector('body') const app = document.createElement('div') diff --git a/src/utils/bizUtil.ts b/src/utils/bizUtil.ts index 3fda843..191174d 100644 --- a/src/utils/bizUtil.ts +++ b/src/utils/bizUtil.ts @@ -1,8 +1,8 @@ -import {APP_DOM_ID, CUSTOM_MODEL_TOKENS, MODEL_DEFAULT, MODEL_MAP, SUMMARIZE_TYPES} from '../consts/const' +import {CUSTOM_MODEL_TOKENS, MODEL_DEFAULT, MODEL_MAP, SUMMARIZE_TYPES} from '../consts/const' import {isDarkMode} from '@kky002/kky-util' import toast from 'react-hot-toast' import {findIndex} from 'lodash-es' - +import {APP_DOM_ID} from '../Main' export const debug = (...args: any[]) => { console.debug('[APP]', ...args) }