From fde65b088edadaa1e1b399f23bd5a80bc458d186 Mon Sep 17 00:00:00 2001 From: KUN1007 Date: Thu, 7 Sep 2023 02:15:02 +0800 Subject: [PATCH] mod: remove prismjs, remove feat: code highlight --- .vscode/settings.json | 1 + package.json | 3 - pnpm-lock.yaml | 36 ----- .../quill-editor/EditorSettingsMenu.vue | 29 +++- src/components/quill-editor/QuillEditor.vue | 43 +++++- src/styles/editor/editor.snow.scss | 10 +- .../topic/content/components/Content.vue | 129 +++--------------- .../topic/content/components/ReplyPanel.vue | 1 + vite.config.ts | 34 +---- 9 files changed, 92 insertions(+), 194 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 672061e5..1c53ddce 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -6,6 +6,7 @@ "azkhx", "bangumi", "Bilibili", + "cout", "dompurify", "fontawesome", "galgame", diff --git a/package.json b/package.json index c44ee6ce..8203446a 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,6 @@ "dompurify": "^3.0.5", "pinia": "^2.1.6", "pinia-plugin-persistedstate": "^3.2.0", - "prismjs": "^1.29.0", "vue": "^3.3.4", "vue-i18n": "^9.2.2", "vue-router": "^4.2.4" @@ -33,7 +32,6 @@ "@iconify/vue": "^4.1.1", "@types/dompurify": "^3.0.2", "@types/node": "^20.4.8", - "@types/prismjs": "^1.26.0", "@vitejs/plugin-vue": "^4.2.3", "@vitejs/plugin-vue-jsx": "^3.0.2", "cross-env": "^7.0.3", @@ -42,7 +40,6 @@ "typescript": "^5.1.6", "vite": "^4.4.8", "vite-plugin-mock": "^3.0.0", - "vite-plugin-prismjs": "^0.0.8", "vue-tsc": "^1.8.8" }, "keywords": [ diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index df091dd8..30786362 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -23,9 +23,6 @@ dependencies: pinia-plugin-persistedstate: specifier: ^3.2.0 version: 3.2.0(pinia@2.1.6) - prismjs: - specifier: ^1.29.0 - version: 1.29.0 vue: specifier: ^3.3.4 version: 3.3.4 @@ -46,9 +43,6 @@ devDependencies: '@types/node': specifier: ^20.4.8 version: 20.4.8 - '@types/prismjs': - specifier: ^1.26.0 - version: 1.26.0 '@vitejs/plugin-vue': specifier: ^4.2.3 version: 4.2.3(vite@4.4.8)(vue@3.3.4) @@ -73,9 +67,6 @@ devDependencies: vite-plugin-mock: specifier: ^3.0.0 version: 3.0.0(esbuild@0.18.19)(mockjs@1.1.0)(vite@4.4.8) - vite-plugin-prismjs: - specifier: ^0.0.8 - version: 0.0.8(prismjs@1.29.0) vue-tsc: specifier: ^1.8.8 version: 1.8.8(typescript@5.1.6) @@ -708,10 +699,6 @@ packages: resolution: {integrity: sha512-0mHckf6D2DiIAzh8fM8f3HQCvMKDpK94YQ0DSVkfWTG9BZleYIWudw9cJxX8oCk9bM+vAkDyujDV6dmKHbvQpg==} dev: true - /@types/prismjs@1.26.0: - resolution: {integrity: sha512-ZTaqn/qSqUuAq1YwvOFQfVW1AR/oQJlLSZVustdjwI+GZ8kr0MSHBj0tsXPW1EqHubx50gtBEjbPGsdZwQwCjQ==} - dev: true - /@types/trusted-types@2.0.3: resolution: {integrity: sha512-NfQ4gyz38SL8sDNrSixxU2Os1a5xcdFxipAFxYEuLUlvU2uDwS4NUpsImcf1//SlWItCVMMLiylsxbmNMToV/g==} dev: true @@ -930,14 +917,6 @@ packages: picomatch: 2.3.1 dev: true - /babel-plugin-prismjs@2.1.0(prismjs@1.29.0): - resolution: {integrity: sha512-ehzSKYfeAz4U78zi/sfwsjDPlq0LvDKxNefcZTJ/iKBu+plsHsLqZhUeGf1+82LAcA35UZGbU6ksEx2Utphc/g==} - peerDependencies: - prismjs: ^1.18.0 - dependencies: - prismjs: 1.29.0 - dev: true - /balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} dev: true @@ -1630,10 +1609,6 @@ packages: picocolors: 1.0.0 source-map-js: 1.0.2 - /prismjs@1.29.0: - resolution: {integrity: sha512-Kx/1w86q/epKcmte75LNrEoT+lX8pBpavuAbvJWRXar7Hz8jrtF+e3vY751p0R8H9HdArwaCTNDDzHg/ScJK1Q==} - engines: {node: '>=6'} - /queue-microtask@1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} dev: true @@ -1862,17 +1837,6 @@ packages: - supports-color dev: true - /vite-plugin-prismjs@0.0.8(prismjs@1.29.0): - resolution: {integrity: sha512-mBPPMS/hwVUArdqCtp/oajZT7iq1qwJDDCciNZ3R5+Q5tQUuUHXtDKuZHYnklPLElNbENf2FyuOtC4FrgxQRAA==} - engines: {node: '>=12.0.0'} - dependencies: - '@babel/core': 7.22.15 - babel-plugin-prismjs: 2.1.0(prismjs@1.29.0) - transitivePeerDependencies: - - prismjs - - supports-color - dev: true - /vite@4.4.8(@types/node@20.4.8)(sass@1.64.2): resolution: {integrity: sha512-LONawOUUjxQridNWGQlNizfKH89qPigK36XhMI7COMGztz8KNY0JHim7/xDd71CZwGT4HtSRgI7Hy+RlhG0Gvg==} engines: {node: ^14.18.0 || >=16.0.0} diff --git a/src/components/quill-editor/EditorSettingsMenu.vue b/src/components/quill-editor/EditorSettingsMenu.vue index 631d4f7d..23e65ee2 100644 --- a/src/components/quill-editor/EditorSettingsMenu.vue +++ b/src/components/quill-editor/EditorSettingsMenu.vue @@ -26,6 +26,9 @@ defineProps<{ const isRefreshPage = ref(false) // 点击高级选项时提醒用户刷新页面 +watch(mode, () => { + isRefreshPage.value = !isRefreshPage.value +}) const handleRefreshPage = () => location.reload() @@ -69,8 +72,14 @@ const handleRefreshPage = () => location.reload() + - + @@ -78,10 +87,11 @@ const handleRefreshPage = () => location.reload()