diff --git a/.vscode/extensions.json b/.vscode/extensions.json index c34d70f..153a2ef 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -4,6 +4,10 @@ "esbenp.prettier-vscode", "mrmlnc.vscode-less", "MisterJ.vue-volar-extention-pack", - "Vue.volar" - ] + "Vue.volar", + ], + "unwantedRecommendations": [ + "octref.vetur" + ], + // "unwantedRecommendations": ["octref.vetur"] } diff --git a/.vscode/settings.json b/.vscode/settings.json index 2489cbf..5809fa7 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -76,5 +76,6 @@ }, "editor.maxTokenizationLineLength": 100000, "vue.features.codeActions.enable": false, - "vue.codeActions.enabled": false + "vue.codeActions.enabled": false, + "vetur.format.enable": false, } diff --git a/mock/apis/system/index.ts b/mock/apis/system/index.ts index 6367374..4934170 100644 --- a/mock/apis/system/index.ts +++ b/mock/apis/system/index.ts @@ -3,7 +3,7 @@ * @Author: Xiongjie.Xue(xxj95719@gmail.com) * @Date: 2022-01-19 11:49:19 * @LastEditors: Xiongjie.Xue(xxj95719@gmail.com) - * @LastEditTime: 2024-12-02 11:25:25 + * @LastEditTime: 2025-01-13 16:17:14 */ export default [ // 看板数据 @@ -124,11 +124,11 @@ export default [ } }, { - name: 'EditorRich', + name: 'WangEditor', path: 'wangEditor', component: 'views/editor/wang-editor/index', meta: { - title: '富文本编辑器 演示', + title: 'WangEditor编辑器 演示', keepAlive: true } } diff --git a/package.json b/package.json index ebdb478..5355701 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,8 @@ "@element-plus/icons-vue": "^2.3.1", "@vueup/vue-quill": "1.2.0", "@vueuse/core": "^10.7.1", + "@wangeditor/editor": "^5.1.23", + "@wangeditor/editor-for-vue": "^5.1.12", "axios": "^1.6.3", "crypto-js": "^4.2.0", "dayjs": "^1.11.10", @@ -33,7 +35,6 @@ "pinia-plugin-persistedstate": "^3.2.1", "qs": "^6.11.2", "resize-observer-polyfill": "^1.5.1", - "snabbdom": "^3.6.2", "three": "^0.160.0", "vditor": "^3.9.8", "vue": "^3.4.3", @@ -52,7 +53,6 @@ "@typescript-eslint/parser": "^6.17.0", "@vitejs/plugin-vue": "^5.0.2", "@vitejs/plugin-vue-jsx": "^3.1.0", - "@wangeditor/editor-for-vue": "^5.1.12", "autoprefixer": "^10.4.16", "eslint": "^8.56.0", "eslint-config-prettier": "^9.1.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f086fbd..8c472cb 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -17,6 +17,12 @@ dependencies: '@vueuse/core': specifier: ^10.7.1 version: 10.11.1(vue@3.5.13) + '@wangeditor/editor': + specifier: ^5.1.23 + version: 5.1.23 + '@wangeditor/editor-for-vue': + specifier: ^5.1.12 + version: 5.1.12(@wangeditor/editor@5.1.23)(vue@3.5.13) axios: specifier: ^1.6.3 version: 1.7.8 @@ -50,9 +56,6 @@ dependencies: resize-observer-polyfill: specifier: ^1.5.1 version: 1.5.1 - snabbdom: - specifier: ^3.6.2 - version: 3.6.2 three: specifier: ^0.160.0 version: 0.160.1 @@ -103,9 +106,6 @@ devDependencies: '@vitejs/plugin-vue-jsx': specifier: ^3.1.0 version: 3.1.0(vite@5.0.10)(vue@3.5.13) - '@wangeditor/editor-for-vue': - specifier: ^5.1.12 - version: 5.1.12(@wangeditor/editor@5.1.23)(vue@3.5.13) autoprefixer: specifier: ^10.4.16 version: 10.4.20(postcss@8.4.49) @@ -439,7 +439,7 @@ packages: engines: {node: '>=6.9.0'} dependencies: regenerator-runtime: 0.14.1 - dev: true + dev: false /@babel/template@7.25.9: resolution: {integrity: sha512-9DGttpmPvIxBb/2uwpVo3dqJ+O6RooAFOS+lB+xDqoE2PVCE8nfoHMdZLpfCQRLwvohzXISPZcgxt80xLfsuwg==} @@ -1063,7 +1063,7 @@ packages: /@transloadit/prettier-bytes@0.0.7: resolution: {integrity: sha512-VeJbUb0wEKbcwaSlj5n+LscBl9IPgLPkHVGBkh00cztv6X4L/TJXK58LzFuBKX7/GAfiGhIwH67YTLTlzvIzBA==} - dev: true + dev: false /@tsconfig/node10@1.0.11: resolution: {integrity: sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw==} @@ -1091,7 +1091,7 @@ packages: /@types/event-emitter@0.3.5: resolution: {integrity: sha512-zx2/Gg0Eg7gwEiOIIh5w9TrhKKTeQh7CPCOPNc0el4pLSwzebA8SmnHwZs2dWlLONvyulykSwGSQxQHLhjGLvQ==} - dev: true + dev: false /@types/json-schema@7.0.15: resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} @@ -1298,7 +1298,7 @@ packages: dependencies: '@uppy/utils': 4.1.3 namespace-emitter: 2.0.1 - dev: true + dev: false /@uppy/core@2.3.4: resolution: {integrity: sha512-iWAqppC8FD8mMVqewavCz+TNaet6HPXitmGXpGGREGrakZ4FeuWytVdrelydzTdXx6vVKkOmI2FLztGg73sENQ==} @@ -1311,17 +1311,17 @@ packages: namespace-emitter: 2.0.1 nanoid: 3.3.8 preact: 10.25.0 - dev: true + dev: false /@uppy/store-default@2.1.1: resolution: {integrity: sha512-xnpTxvot2SeAwGwbvmJ899ASk5tYXhmZzD/aCFsXePh/v8rNvR2pKlcQUH7cF/y4baUGq3FHO/daKCok/mpKqQ==} - dev: true + dev: false /@uppy/utils@4.1.3: resolution: {integrity: sha512-nTuMvwWYobnJcytDO3t+D6IkVq/Qs4Xv3vyoEZ+Iaf8gegZP+rEyoaFT2CK5XLRMienPyqRqNbIfRuFaOWSIFw==} dependencies: lodash.throttle: 4.1.1 - dev: true + dev: false /@uppy/xhr-upload@2.1.3(@uppy/core@2.3.4): resolution: {integrity: sha512-YWOQ6myBVPs+mhNjfdWsQyMRWUlrDLMoaG7nvf/G6Y3GKZf8AyjFDjvvJ49XWQ+DaZOftGkHmF1uh/DBeGivJQ==} @@ -1332,7 +1332,7 @@ packages: '@uppy/core': 2.3.4 '@uppy/utils': 4.1.3 nanoid: 3.3.8 - dev: true + dev: false /@vitejs/plugin-vue-jsx@3.1.0(vite@5.0.10)(vue@3.5.13): resolution: {integrity: sha512-w9M6F3LSEU5kszVb9An2/MmXNxocAnUb3WhRr8bHlimhDrXNt6n6D2nJQR3UXpGlZHh/EsgouOHCsM8V3Ln+WA==} @@ -1590,7 +1590,7 @@ packages: nanoid: 3.3.8 slate: 0.72.8 snabbdom: 3.6.2 - dev: true + dev: false /@wangeditor/code-highlight@1.0.3(@wangeditor/core@1.1.19)(dom7@3.0.0)(slate@0.72.8)(snabbdom@3.6.2): resolution: {integrity: sha512-iazHwO14XpCuIWJNTQTikqUhGKyqj+dUNWJ9288Oym9M2xMVHvnsOmDU2sgUDWVy+pOLojReMPgXCsvvNlOOhw==} @@ -1605,7 +1605,7 @@ packages: prismjs: 1.29.0 slate: 0.72.8 snabbdom: 3.6.2 - dev: true + dev: false /@wangeditor/core@1.1.19(@uppy/core@2.3.4)(@uppy/xhr-upload@2.1.3)(dom7@3.0.0)(is-hotkey@0.2.0)(lodash.camelcase@4.3.0)(lodash.clonedeep@4.5.0)(lodash.debounce@4.0.8)(lodash.foreach@4.5.0)(lodash.isequal@4.5.0)(lodash.throttle@4.1.1)(lodash.toarray@4.4.0)(nanoid@3.3.8)(slate@0.72.8)(snabbdom@3.6.2): resolution: {integrity: sha512-KevkB47+7GhVszyYF2pKGKtCSj/YzmClsD03C3zTt+9SR2XWT5T0e3yQqg8baZpcMvkjs1D8Dv4fk8ok/UaS2Q==} @@ -1645,7 +1645,7 @@ packages: slate: 0.72.8 slate-history: 0.66.0(slate@0.72.8) snabbdom: 3.6.2 - dev: true + dev: false /@wangeditor/editor-for-vue@5.1.12(@wangeditor/editor@5.1.23)(vue@3.5.13): resolution: {integrity: sha512-0Ds3D8I+xnpNWezAeO7HmPRgTfUxHLMd9JKcIw+QzvSmhC5xUHbpCcLU+KLmeBKTR/zffnS5GQo6qi3GhTMJWQ==} @@ -1655,7 +1655,7 @@ packages: dependencies: '@wangeditor/editor': 5.1.23 vue: 3.5.13(typescript@5.7.2) - dev: true + dev: false /@wangeditor/editor@5.1.23: resolution: {integrity: sha512-0RxfeVTuK1tktUaPROnCoFfaHVJpRAIE2zdS0mpP+vq1axVQpLjM8+fCvKzqYIkH0Pg+C+44hJpe3VVroSkEuQ==} @@ -1681,7 +1681,7 @@ packages: nanoid: 3.3.8 slate: 0.72.8 snabbdom: 3.6.2 - dev: true + dev: false /@wangeditor/list-module@1.0.5(@wangeditor/core@1.1.19)(dom7@3.0.0)(slate@0.72.8)(snabbdom@3.6.2): resolution: {integrity: sha512-uDuYTP6DVhcYf7mF1pTlmNn5jOb4QtcVhYwSSAkyg09zqxI1qBqsfUnveeDeDqIuptSJhkh81cyxi+MF8sEPOQ==} @@ -1695,7 +1695,7 @@ packages: dom7: 3.0.0 slate: 0.72.8 snabbdom: 3.6.2 - dev: true + dev: false /@wangeditor/table-module@1.1.4(@wangeditor/core@1.1.19)(dom7@3.0.0)(lodash.isequal@4.5.0)(lodash.throttle@4.1.1)(nanoid@3.3.8)(slate@0.72.8)(snabbdom@3.6.2): resolution: {integrity: sha512-5saanU9xuEocxaemGdNi9t8MCDSucnykEC6jtuiT72kt+/Hhh4nERYx1J20OPsTCCdVr7hIyQenFD1iSRkIQ6w==} @@ -1715,7 +1715,7 @@ packages: nanoid: 3.3.8 slate: 0.72.8 snabbdom: 3.6.2 - dev: true + dev: false /@wangeditor/upload-image-module@1.0.2(@uppy/core@2.3.4)(@uppy/xhr-upload@2.1.3)(@wangeditor/basic-modules@1.1.7)(@wangeditor/core@1.1.19)(dom7@3.0.0)(lodash.foreach@4.5.0)(slate@0.72.8)(snabbdom@3.6.2): resolution: {integrity: sha512-z81lk/v71OwPDYeQDxj6cVr81aDP90aFuywb8nPD6eQeECtOymrqRODjpO6VGvCVxVck8nUxBHtbxKtjgcwyiA==} @@ -1737,7 +1737,7 @@ packages: lodash.foreach: 4.5.0 slate: 0.72.8 snabbdom: 3.6.2 - dev: true + dev: false /@wangeditor/video-module@1.1.4(@uppy/core@2.3.4)(@uppy/xhr-upload@2.1.3)(@wangeditor/core@1.1.19)(dom7@3.0.0)(nanoid@3.3.8)(slate@0.72.8)(snabbdom@3.6.2): resolution: {integrity: sha512-ZdodDPqKQrgx3IwWu4ZiQmXI8EXZ3hm2/fM6E3t5dB8tCaIGWQZhmqd6P5knfkRAd3z2+YRSRbxOGfoRSp/rLg==} @@ -1757,7 +1757,7 @@ packages: nanoid: 3.3.8 slate: 0.72.8 snabbdom: 3.6.2 - dev: true + dev: false /JSONStream@1.3.5: resolution: {integrity: sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==} @@ -2159,7 +2159,7 @@ packages: /compute-scroll-into-view@1.0.20: resolution: {integrity: sha512-UCB0ioiyj8CRjtrvaceBLqqhZCVP+1B8+NWQhmdsm0VXOJtobBCf1dBQmebCCo34qZmUwZfIH2MZLqNHazrfjg==} - dev: true + dev: false /concat-map@0.0.1: resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} @@ -2404,7 +2404,7 @@ packages: dependencies: es5-ext: 0.10.64 type: 2.7.3 - dev: true + dev: false /dargs@7.0.0: resolution: {integrity: sha512-2iy1EkLdlBzQGvbweYRFxmFath8+K7+AKB0TlhHWkNuH+TmovaMH/Wp7V7R4u7f4SnX3OgLsU9t1NI9ioDnUpg==} @@ -2533,7 +2533,7 @@ packages: resolution: {integrity: sha512-oNlcUdHsC4zb7Msx7JN3K0Nro1dzJ48knvBOnDPKJ2GV9wl1i5vydJZUSyOfrkKFDZEud/jBsTk92S/VGSAe/g==} dependencies: ssr-window: 3.0.0 - dev: true + dev: false /dot-prop@5.3.0: resolution: {integrity: sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==} @@ -2643,7 +2643,7 @@ packages: es6-symbol: 3.1.4 esniff: 2.0.1 next-tick: 1.1.0 - dev: true + dev: false /es6-iterator@2.0.3: resolution: {integrity: sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g==} @@ -2651,7 +2651,7 @@ packages: d: 1.0.2 es5-ext: 0.10.64 es6-symbol: 3.1.4 - dev: true + dev: false /es6-symbol@3.1.4: resolution: {integrity: sha512-U9bFFjX8tFiATgtkJ1zg25+KviIXpgRvRHS8sau3GfhVzThRQrOeksPeT0BWW2MNZs1OEWJ1DPXOQMn0KKRkvg==} @@ -2659,7 +2659,7 @@ packages: dependencies: d: 1.0.2 ext: 1.7.0 - dev: true + dev: false /esbuild@0.19.12: resolution: {integrity: sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg==} @@ -2834,7 +2834,7 @@ packages: es5-ext: 0.10.64 event-emitter: 0.3.5 type: 2.7.3 - dev: true + dev: false /espree@9.6.1: resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==} @@ -2883,7 +2883,7 @@ packages: dependencies: d: 1.0.2 es5-ext: 0.10.64 - dev: true + dev: false /event-target-shim@5.0.1: resolution: {integrity: sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==} @@ -2922,7 +2922,7 @@ packages: resolution: {integrity: sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw==} dependencies: type: 2.7.3 - dev: true + dev: false /extend@3.0.2: resolution: {integrity: sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==} @@ -3340,7 +3340,7 @@ packages: /html-void-elements@2.0.1: resolution: {integrity: sha512-0quDb7s97CfemeJAnW9wC0hw78MtW7NU3hqtCD75g2vFlDLt36llsYD7uB7SUzojLMP24N5IatXf7ylGXiGG9A==} - dev: true + dev: false /human-signals@5.0.0: resolution: {integrity: sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==} @@ -3357,7 +3357,7 @@ packages: resolution: {integrity: sha512-yCMYTMEJ9ihCwEQQ3phLo7I/Pwycf8uAx+sRHwwk5U9Aui/IZYgQRyMqXafQOw5QQ7DM1Z+WyEXWIqSuJHhG2A==} dependencies: '@babel/runtime': 7.26.0 - dev: true + dev: false /iconv-lite@0.6.3: resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==} @@ -3387,7 +3387,7 @@ packages: /immer@9.0.21: resolution: {integrity: sha512-bc4NBHqOqSfRW7POMkHd51LvClaeMXpm8dx0e8oE2GORbq5aRK7Bxl4FyzVLdGtLmvLKL7BTDBG5ACQm4HWjTA==} - dev: true + dev: false /import-fresh@3.3.0: resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==} @@ -3497,7 +3497,7 @@ packages: /is-hotkey@0.2.0: resolution: {integrity: sha512-UknnZK4RakDmTgz4PI1wIph5yxSs/mvChWs9ifnlXsKuXgWmOkY/hAE0H/k2MIqH0RlRye0i1oC07MCRSD28Mw==} - dev: true + dev: false /is-number@7.0.0: resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} @@ -3522,7 +3522,7 @@ packages: /is-plain-object@5.0.0: resolution: {integrity: sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==} engines: {node: '>=0.10.0'} - dev: true + dev: false /is-regex@1.2.0: resolution: {integrity: sha512-B6ohK4ZmoftlUe+uvenXSbPJFo6U37BH7oO1B3nQH8f/7h27N56s85MhUtbFJAziz5dcmuR3i8ovUl35zp8pFA==} @@ -3548,7 +3548,6 @@ packages: /is-url@1.2.4: resolution: {integrity: sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww==} - dev: true /is-what@3.14.1: resolution: {integrity: sha512-sNxgpk9793nzSs7bA6JQJGeIuRBQhAaNGG77kzYQgMkrID+lS6SlK07K5LaptscDlSaIgH+GPFzf+d75FVxozA==} @@ -3789,21 +3788,23 @@ packages: /lodash.camelcase@4.3.0: resolution: {integrity: sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==} - dev: true + dev: false /lodash.clonedeep@4.5.0: resolution: {integrity: sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==} + dev: false /lodash.debounce@4.0.8: resolution: {integrity: sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==} - dev: true + dev: false /lodash.foreach@4.5.0: resolution: {integrity: sha512-aEXTF4d+m05rVOAUG3z4vZZ4xVexLKZGF0lIxuHZ1Hplpk/3B6Z1+/ICICYRLm7c41Z2xiejbkCkJoTlypoXhQ==} - dev: true + dev: false /lodash.isequal@4.5.0: resolution: {integrity: sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==} + dev: false /lodash.ismatch@4.4.0: resolution: {integrity: sha512-fPMfXjGQEV9Xsq/8MTSgUf255gawYRbjwMyDbcvDhXgV7enSZA0hynz6vMPnpAb5iONEzBHBPsT+0zes5Z301g==} @@ -3815,11 +3816,11 @@ packages: /lodash.throttle@4.1.1: resolution: {integrity: sha512-wIkUCfVKpVsWo3JSZlc+8MB5it+2AN5W8J7YVMST30UrvcQNZ1Okbj+rbVniijTWE6FGYy4XJq/rHkas8qJMLQ==} - dev: true + dev: false /lodash.toarray@4.4.0: resolution: {integrity: sha512-QyffEA3i5dma5q2490+SgCvDN0pXLmRGSyAANuVi0HQ01Pkfr9fuoKQW8wm1wGBnJITs/mS7wQvS6VshUEBFCw==} - dev: true + dev: false /lodash@4.17.21: resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} @@ -3934,7 +3935,7 @@ packages: resolution: {integrity: sha512-VXp/ugGDVh3eCLOBCiHZMYWQaTNUHv2IJrut+yXA6+JbLPXHglHwfS/5A5L0ll+jkCY7fIzRJcH6OIunF+c6Cg==} dependencies: wildcard: 1.1.2 - dev: true + dev: false /mime-types@2.1.35: resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} @@ -4037,7 +4038,7 @@ packages: /namespace-emitter@2.0.1: resolution: {integrity: sha512-N/sMKHniSDJBjfrkbS/tpkPj4RAbvW3mr8UAzvlMHyun93XEm83IAvhWtJVHo+RHn/oO8Job5YN4b+wRjSVp5g==} - dev: true + dev: false /nanoid@3.3.8: resolution: {integrity: sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==} @@ -4065,7 +4066,7 @@ packages: /next-tick@1.1.0: resolution: {integrity: sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==} - dev: true + dev: false /node-fetch@2.7.0: resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} @@ -4443,7 +4444,7 @@ packages: /preact@10.25.0: resolution: {integrity: sha512-6bYnzlLxXV3OSpUxLdaxBmE7PMOu0aR3pG6lryK/0jmvcDFPlcXGQAt5DpK3RITWiDrfYZRI0druyaK/S9kYLg==} - dev: true + dev: false /prelude-ls@1.2.1: resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} @@ -4466,7 +4467,7 @@ packages: /prismjs@1.29.0: resolution: {integrity: sha512-Kx/1w86q/epKcmte75LNrEoT+lX8pBpavuAbvJWRXar7Hz8jrtF+e3vY751p0R8H9HdArwaCTNDDzHg/ScJK1Q==} engines: {node: '>=6'} - dev: true + dev: false /process-nextick-args@2.0.1: resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==} @@ -4661,7 +4662,7 @@ packages: /regenerator-runtime@0.14.1: resolution: {integrity: sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==} - dev: true + dev: false /regexp.prototype.flags@1.5.3: resolution: {integrity: sha512-vqlC04+RQoFalODCbCumG2xIOvapzVMHwsyIGM/SIE8fRhFFsXeH8/QQ+s0T0kDAhKc4k30s73/0ydkHQz6HlQ==} @@ -4796,7 +4797,7 @@ packages: resolution: {integrity: sha512-dGCXy99wZQivjmjIqihaBQNjryrz5rueJY7eHfTdyWEiR4ttYpsajb14rn9s5d4DY4EcY6+4+U/maARBXJedkA==} dependencies: compute-scroll-into-view: 1.0.20 - dev: true + dev: false /scule@1.3.0: resolution: {integrity: sha512-6FtHJEvt+pVMIB9IBY+IcCJ6Z5f1iQnytgyfKMhDKgmzYG+TeH/wx1y3l27rshSbLiSanrR9ffZDrEsmjlQF2g==} @@ -4879,7 +4880,7 @@ packages: dependencies: is-plain-object: 5.0.0 slate: 0.72.8 - dev: true + dev: false /slate@0.72.8: resolution: {integrity: sha512-/nJwTswQgnRurpK+bGJFH1oM7naD5qDmHd89JyiKNT2oOKD8marW0QSBtuFnwEbL5aGCS8AmrhXQgNOsn4osAw==} @@ -4887,7 +4888,7 @@ packages: immer: 9.0.21 is-plain-object: 5.0.0 tiny-warning: 1.0.3 - dev: true + dev: false /slice-ansi@5.0.0: resolution: {integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==} @@ -4908,6 +4909,7 @@ packages: /snabbdom@3.6.2: resolution: {integrity: sha512-ig5qOnCDbugFntKi6c7Xlib8bA6xiJVk8O+WdFrV3wxbMqeHO0hXFQC4nAhPVWfZfi8255lcZkNhtIBINCc4+Q==} engines: {node: '>=12.17.0'} + dev: false /source-map-js@1.2.1: resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} @@ -4971,7 +4973,7 @@ packages: /ssr-window@3.0.0: resolution: {integrity: sha512-q+8UfWDg9Itrg0yWK7oe5p/XRCJpJF9OBtXfOPgSJl+u3Xd5KI328RUEvUqSMVM9CiQUEf1QdBzJMkYGErj9QA==} - dev: true + dev: false /standard-version@9.5.0: resolution: {integrity: sha512-3zWJ/mmZQsOaO+fOlsa0+QK90pwhNd042qEcw6hKFNoLFs7peGyvPffpEBbK/DSGPbyOvli0mUIFv5A4qTjh2Q==} @@ -5143,7 +5145,7 @@ packages: /tiny-warning@1.0.3: resolution: {integrity: sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==} - dev: true + dev: false /tinyexec@0.3.1: resolution: {integrity: sha512-WiCJLEECkO18gwqIp6+hJg0//p23HXp4S+gGtAKu3mI2F2/sXC4FvHvXvB0zJVVaTPhx1/tOwdbRsa1sOBIKqQ==} @@ -5255,7 +5257,7 @@ packages: /type@2.7.3: resolution: {integrity: sha512-8j+1QmAbPvLZow5Qpi6NCaN8FB60p/6x8/vfNqOk/hC+HuvFZhL4+WfekuhQLiqFZXOgQdrs3B+XxEmCc6b3FQ==} - dev: true + dev: false /typedarray@0.0.6: resolution: {integrity: sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==} @@ -5633,7 +5635,7 @@ packages: /wildcard@1.1.2: resolution: {integrity: sha512-DXukZJxpHA8LuotRwL0pP1+rS6CS7FF2qStDDE1C7DDg2rLud2PXRMuEDYIPhgEezwnlHNL4c+N6MfMTjCGTng==} - dev: true + dev: false /wmf@1.0.2: resolution: {integrity: sha512-/p9K7bEh0Dj6WbXg4JG0xvLQmIadrner1bi45VMJTfnbVHsc7yIajZyoSoK60/dtVBs12Fm6WkUI5/3WAVsNMw==} diff --git a/src/components/wang-editor/src/custom-types.ts b/src/components/wang-editor/src/custom-types.ts deleted file mode 100644 index a9eba04..0000000 --- a/src/components/wang-editor/src/custom-types.ts +++ /dev/null @@ -1,9 +0,0 @@ -type EmptyText = { - text: ''; -}; - -export type SelectMenuElement = { - type: 'insertSelectMenu'; - value: string; - children: EmptyText[]; -}; diff --git a/src/components/wang-editor/src/module/selectMenu/InsertSelectMenu.ts b/src/components/wang-editor/src/module/selectMenu/InsertSelectMenu.ts deleted file mode 100644 index 0934431..0000000 --- a/src/components/wang-editor/src/module/selectMenu/InsertSelectMenu.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { ISelectMenu } from '@wangeditor/core'; -import { getType, setInsertNode } from './helper'; -export default class InsertSelectMenu implements ISelectMenu { - readonly title = 'Select Menu'; - readonly tag = 'select'; - // 下拉框的选项 - getOptions() { - const options = [ - { - value: 'Add Component', - text: 'Add Component', - styleForRenderMenuList: { 'font-size': '13px', 'font-weight': 'bold' } - }, - { - value: 'Add Page', - text: 'Add Page', - styleForRenderMenuList: { 'font-size': '13px', 'font-weight': 'bold' } - } - ]; - return options; - } - - // 菜单是否需要激活(如选中加粗文本,“加粗”菜单会激活),用不到则返回 false - isActive(): boolean { - return false; - } - // 获取菜单执行时的 value ,用不到则返回空 字符串或 false - getValue(): string | boolean { - return getType(); - } - // 菜单是否需要禁用(如选中 H1 ,“引用”菜单被禁用),用不到则返回 false - isDisabled(): boolean { - return false; - } - - // 禁用输入事件 - handleInput() { - return false; // 这里可以返回false以禁止输入 - } - // 点击菜单时触发的函数 - exec(editor, value) { - setInsertNode(editor, value.toString()); - } -} diff --git a/src/components/wang-editor/src/module/selectMenu/helper.ts b/src/components/wang-editor/src/module/selectMenu/helper.ts deleted file mode 100644 index b9ca37b..0000000 --- a/src/components/wang-editor/src/module/selectMenu/helper.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { IDomEditor } from '@wangeditor/core'; - -/** - * 获取 node type('Add Components' 'Add Page' 等),未匹配则返回 'insertSelectMenu' - */ -export function getType(): string { - return 'Add Component'; // 默认选中第一项 -} - -export function setInsertNode(editor: IDomEditor, value: string) { - if (!value) return; - - // 还原选区 - // editor.restoreSelection(); - const selectMenuElem = { - type: 'insertSelectMenu', - value, - children: [{ text: '这是自定义节点' }] - }; - console.log( - '%c [ selectMenuElem ]-21', - 'font-size:13px; background:pink; color:#bf2c9f;', - selectMenuElem - ); - editor.insertNode(selectMenuElem); - // 在当前光标位置插入内容 - editor.focus(); // 自动聚焦当前插入的节点 - // editor.move(1); -} diff --git a/src/components/wang-editor/src/module/selectMenu/index.ts b/src/components/wang-editor/src/module/selectMenu/index.ts deleted file mode 100644 index 6fcd868..0000000 --- a/src/components/wang-editor/src/module/selectMenu/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -import InsertSelectMenu from './InsertSelectMenu'; - -export const insertSelectMenuConf = { - key: 'insertSelectMenu', // menu key ,唯一。注册之后,可配置到工具栏 - factory() { - return new InsertSelectMenu(); - } -}; diff --git a/src/components/wang-editor/src/render-select.ts b/src/components/wang-editor/src/render-select.ts deleted file mode 100644 index 7acfdee..0000000 --- a/src/components/wang-editor/src/render-select.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { h, VNode } from 'snabbdom'; -import type { SlateElement } from '@wangeditor/editor'; -import type { SelectMenuElement } from './custom-types'; - -function renderSelect(elem: SlateElement): VNode { - // TS 语法 - const { value = '' } = elem as SelectMenuElement; - - return h( - 'div', - { - style: { - borderRadius: '12px', - backgroundColor: 'rgba(102, 128, 158, 0.1)', - color: '#66809e', - padding: '5px', - margin: '0 5px', - display: 'inline-block' - } - }, - value - ); -} - -const conf = { - type: 'insertSelectMenu', // 节点 type ,重要!!! - renderElem: renderSelect -}; - -export default conf; diff --git a/src/components/wang-editor/src/utils/dom.ts b/src/components/wang-editor/src/utils/dom.ts deleted file mode 100644 index 9d50381..0000000 --- a/src/components/wang-editor/src/utils/dom.ts +++ /dev/null @@ -1,80 +0,0 @@ -/** - * @description DOM 操作 - */ - -import $, { - append, - on, - focus, - attr, - val, - html, - dataset, - addClass, - removeClass, - children, - each, - find, - Dom7Array -} from 'dom7'; -export type { Dom7Array } from 'dom7'; - -if (append) $.fn.append = append; -if (on) $.fn.on = on; -if (focus) $.fn.focus = focus; -if (attr) $.fn.attr = attr; -if (val) $.fn.val = val; -if (html) $.fn.html = html; -if (dataset) $.fn.dataset = dataset; -if (addClass) $.fn.addClass = addClass; -if (removeClass) $.fn.removeClass = removeClass; -if (children) $.fn.children = children; -if (each) $.fn.each = each; -if (find) $.fn.find = find; - -export default $; - -/** - * 获取 tagName lower-case - * @param $elem $elem - */ -export function getTagName($elem: Dom7Array): string { - if ($elem.length) return $elem[0].tagName.toLowerCase(); - return ''; -} - -/** - * 获取 $elem 某一个 style 值 - * @param $elem $elem - * @param styleKey style key - */ -export function getStyleValue($elem: Dom7Array, styleKey: string): string { - let res = ''; - - const styleStr = $elem.attr('style') || ''; // 如 'line-height: 2.5; color: red;' - const styleArr = styleStr.split(';'); // 如 ['line-height: 2.5', ' color: red', ''] - const length = styleArr.length; - for (let i = 0; i < length; i++) { - const styleItemStr = styleArr[i]; // 如 'line-height: 2.5' - if (styleItemStr) { - const arr = styleItemStr.split(':'); // ['line-height', ' 2.5'] - if (arr[0].trim() === styleKey) { - res = arr[1].trim(); - } - } - } - - return res; -} - -// COMPAT: This is required to prevent TypeScript aliases from doing some very -// weird things for Slate's types with the same name as globals. (2019/11/27) -// https://github.com/microsoft/TypeScript/issues/35002 -import DOMNode = globalThis.Node; -import DOMComment = globalThis.Comment; -import DOMElement = globalThis.Element; -import DOMText = globalThis.Text; -import DOMRange = globalThis.Range; -import DOMSelection = globalThis.Selection; -import DOMStaticRange = globalThis.StaticRange; -export { DOMNode, DOMComment, DOMElement, DOMText, DOMRange, DOMSelection, DOMStaticRange }; diff --git a/src/components/wang-editor/src/wang-editor.vue b/src/components/wang-editor/src/wang-editor.vue index e922c68..2e81db6 100644 --- a/src/components/wang-editor/src/wang-editor.vue +++ b/src/components/wang-editor/src/wang-editor.vue @@ -3,7 +3,7 @@ * @Author: Xiongjie.Xue(xxj95719@gmail.com) * @Date: 2024-12-02 14:25:15 * @LastEditors: Xiongjie.Xue(xxj95719@gmail.com) - * @LastEditTime: 2024-12-09 18:27:37 + * @LastEditTime: 2025-01-13 16:45:25 -->