From 11a27eec33abe33d7bbd2e5e5d14d220f48c260b Mon Sep 17 00:00:00 2001 From: joefalmko Date: Thu, 7 Nov 2024 18:29:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BE=A7=E8=BE=B9=E6=A0=8F=E5=A1=AB=E5=86=99st?= =?UTF-8?q?yle=E8=A1=A8=E5=8D=95=E5=B9=B6=E5=AE=9E=E6=97=B6=E9=A2=84?= =?UTF-8?q?=E8=A7=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ckeditor5/babel.config.js | 5 - ckeditor5/package-lock.json | 566 +++++++++++++++++++++++- ckeditor5/package.json | 9 +- ckeditor5/prompt_generate_style.md | 29 ++ ckeditor5/public/style.css | 63 ++- ckeditor5/src/App.vue | 646 +++++++++++++--------------- ckeditor5/src/components/plugins.js | 212 +++++++++ ckeditor5/src/components/utils.js | 149 +++++++ ckeditor5/src/main.js | 14 +- ckeditor5/vue.config.js | 19 +- 10 files changed, 1345 insertions(+), 367 deletions(-) delete mode 100644 ckeditor5/babel.config.js create mode 100644 ckeditor5/prompt_generate_style.md create mode 100644 ckeditor5/src/components/plugins.js create mode 100644 ckeditor5/src/components/utils.js diff --git a/ckeditor5/babel.config.js b/ckeditor5/babel.config.js deleted file mode 100644 index e955840..0000000 --- a/ckeditor5/babel.config.js +++ /dev/null @@ -1,5 +0,0 @@ -module.exports = { - presets: [ - '@vue/cli-plugin-babel/preset' - ] -} diff --git a/ckeditor5/package-lock.json b/ckeditor5/package-lock.json index b64cb0b..6a9bbf5 100644 --- a/ckeditor5/package-lock.json +++ b/ckeditor5/package-lock.json @@ -11,8 +11,10 @@ "@ckeditor/ckeditor5-vue": "^7.2.0", "ckeditor5": "^43.2.0", "core-js": "^3.8.3", + "element-plus": "^2.8.7", "file-saver": "^2.0.5", "html-docx-js-typescript": "^0.1.5", + "mitt": "^3.0.1", "vue": "^3.2.13" }, "devDependencies": { @@ -21,8 +23,11 @@ "@vue/cli-plugin-babel": "~5.0.0", "@vue/cli-plugin-eslint": "~5.0.0", "@vue/cli-service": "~5.0.0", + "babel-plugin-import": "^1.13.8", "eslint": "^7.32.0", - "eslint-plugin-vue": "^8.0.3" + "eslint-plugin-vue": "^8.0.3", + "unplugin-auto-import": "^0.16.1", + "unplugin-vue-components": "^0.25.0" } }, "node_modules/@achrinza/node-ipc": { @@ -52,6 +57,15 @@ "node": ">=6.0.0" } }, + "node_modules/@antfu/utils": { + "version": "0.7.10", + "resolved": "https://registry.npmmirror.com/@antfu/utils/-/utils-0.7.10.tgz", + "integrity": "sha512-+562v9k4aI80m1+VuMHehNJWLOFjBnXn3tdOitzD0il5b7smkSBal4+a3oKiQTbrwMmN/TBUMDvbdoWDehgOww==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, "node_modules/@babel/code-frame": { "version": "7.26.0", "resolved": "https://registry.npmmirror.com/@babel/code-frame/-/code-frame-7.26.0.tgz", @@ -2387,6 +2401,14 @@ "lodash-es": "4.17.21" } }, + "node_modules/@ctrl/tinycolor": { + "version": "3.6.1", + "resolved": "https://registry.npmmirror.com/@ctrl/tinycolor/-/tinycolor-3.6.1.tgz", + "integrity": "sha512-SITSV6aIXsuVNV3f3O0f2n/cgyEDWoSqtZMYiAmcsYHydcKrOz3gUxB/iXd/Qf08+IZX4KpgNbvUdMBmWz+kcA==", + "engines": { + "node": ">=10" + } + }, "node_modules/@discoveryjs/json-ext": { "version": "0.5.7", "resolved": "https://registry.npmmirror.com/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz", @@ -2396,6 +2418,14 @@ "node": ">=10.0.0" } }, + "node_modules/@element-plus/icons-vue": { + "version": "2.3.1", + "resolved": "https://registry.npmmirror.com/@element-plus/icons-vue/-/icons-vue-2.3.1.tgz", + "integrity": "sha512-XxVUZv48RZAd87ucGS48jPf6pKu0yV5UCg9f4FFwtrYxXOwWuVJo6wOvSLKEoMQKjv8GsX/mhP6UsC1lRwbUWg==", + "peerDependencies": { + "vue": "^3.2.0" + } + }, "node_modules/@eslint/eslintrc": { "version": "0.4.3", "resolved": "https://registry.npmmirror.com/@eslint/eslintrc/-/eslintrc-0.4.3.tgz", @@ -2452,6 +2482,28 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/@floating-ui/core": { + "version": "1.6.8", + "resolved": "https://registry.npmmirror.com/@floating-ui/core/-/core-1.6.8.tgz", + "integrity": "sha512-7XJ9cPU+yI2QeLS+FCSlqNFZJq8arvswefkZrYI1yQBbftw6FyrZOxYSh+9S7z7TpeWlRt9zJ5IhM1WIL334jA==", + "dependencies": { + "@floating-ui/utils": "^0.2.8" + } + }, + "node_modules/@floating-ui/dom": { + "version": "1.6.12", + "resolved": "https://registry.npmmirror.com/@floating-ui/dom/-/dom-1.6.12.tgz", + "integrity": "sha512-NP83c0HjokcGVEMeoStg317VD9W7eDlGK7457dMBANbKA6GJZdc7rjujdgqzTaz93jkGgc5P/jeWbaCHnMNc+w==", + "dependencies": { + "@floating-ui/core": "^1.6.0", + "@floating-ui/utils": "^0.2.8" + } + }, + "node_modules/@floating-ui/utils": { + "version": "0.2.8", + "resolved": "https://registry.npmmirror.com/@floating-ui/utils/-/utils-0.2.8.tgz", + "integrity": "sha512-kym7SodPp8/wloecOpcmSnWJsK7M0E5Wg8UcFA+uO4B9s5d0ywXOEro/8HM9x0rW+TljRzul/14UYz3TleT3ig==" + }, "node_modules/@hapi/hoek": { "version": "9.3.0", "resolved": "https://registry.npmmirror.com/@hapi/hoek/-/hoek-9.3.0.tgz", @@ -2619,6 +2671,50 @@ "integrity": "sha512-8LduaNlMZGwdZ6qWrKlfa+2M4gahzFkprZiAt2TF8uS0qQgBizKXpXURqvTJ4WtmupWxaLqjRb2UCTe72mu+Aw==", "dev": true }, + "node_modules/@popperjs/core": { + "name": "@sxzz/popperjs-es", + "version": "2.11.7", + "resolved": "https://registry.npmmirror.com/@sxzz/popperjs-es/-/popperjs-es-2.11.7.tgz", + "integrity": "sha512-Ccy0NlLkzr0Ex2FKvh2X+OyERHXJ88XJ1MXtsI9y9fGexlaXaVTPzBCRBwIxFkORuOb+uBqeu+RqnpgYTEZRUQ==", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/popperjs" + } + }, + "node_modules/@rollup/pluginutils": { + "version": "5.1.3", + "resolved": "https://registry.npmmirror.com/@rollup/pluginutils/-/pluginutils-5.1.3.tgz", + "integrity": "sha512-Pnsb6f32CD2W3uCaLZIzDmeFyQ2b8UWMFI7xtwUezpcGBDVDW6y9XgAWIlARiGAo6eNF5FK5aQTr0LFyNyqq5A==", + "dev": true, + "dependencies": { + "@types/estree": "^1.0.0", + "estree-walker": "^2.0.2", + "picomatch": "^4.0.2" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/@rollup/pluginutils/node_modules/picomatch": { + "version": "4.0.2", + "resolved": "https://registry.npmmirror.com/picomatch/-/picomatch-4.0.2.tgz", + "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/@sideway/address": { "version": "4.1.5", "resolved": "https://registry.npmmirror.com/@sideway/address/-/address-4.1.5.tgz", @@ -2790,6 +2886,19 @@ "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", "dev": true }, + "node_modules/@types/lodash": { + "version": "4.17.13", + "resolved": "https://registry.npmmirror.com/@types/lodash/-/lodash-4.17.13.tgz", + "integrity": "sha512-lfx+dftrEZcdBPczf9d0Qv0x+j/rfNCMuC6OcfXmO8gkfeNAY88PgKUbvG56whcN23gc27yenwF6oJZXGFpYxg==" + }, + "node_modules/@types/lodash-es": { + "version": "4.17.12", + "resolved": "https://registry.npmmirror.com/@types/lodash-es/-/lodash-es-4.17.12.tgz", + "integrity": "sha512-0NgftHUcV4v34VhXm8QBSftKVXtbkBG3ViCjs6+eJ5a6y6Mi/jiFGPc1sC7QK+9BFhWrURE3EOggmWaSxL9OzQ==", + "dependencies": { + "@types/lodash": "*" + } + }, "node_modules/@types/mime": { "version": "1.3.5", "resolved": "https://registry.npmmirror.com/@types/mime/-/mime-1.3.5.tgz", @@ -2889,6 +2998,11 @@ "@types/node": "*" } }, + "node_modules/@types/web-bluetooth": { + "version": "0.0.16", + "resolved": "https://registry.npmmirror.com/@types/web-bluetooth/-/web-bluetooth-0.0.16.tgz", + "integrity": "sha512-oh8q2Zc32S6gd/j50GowEjKLoOVOwHP/bWVjKJInBwQqdOYMdPrf1oVlelTlyfFK3CKxL1uahMDAr+vy8T7yMQ==" + }, "node_modules/@types/ws": { "version": "8.5.12", "resolved": "https://registry.npmmirror.com/@types/ws/-/ws-8.5.12.tgz", @@ -3562,6 +3676,89 @@ "integrity": "sha512-Iu8Tbg3f+emIIMmI2ycSI8QcEuAUgPTgHwesDU1eKMLE4YC/c/sFbGc70QgMq31ijRftV0R7vCm9co6rldCeOA==", "dev": true }, + "node_modules/@vueuse/core": { + "version": "9.13.0", + "resolved": "https://registry.npmmirror.com/@vueuse/core/-/core-9.13.0.tgz", + "integrity": "sha512-pujnclbeHWxxPRqXWmdkKV5OX4Wk4YeK7wusHqRwU0Q7EFusHoqNA/aPhB6KCh9hEqJkLAJo7bb0Lh9b+OIVzw==", + "dependencies": { + "@types/web-bluetooth": "^0.0.16", + "@vueuse/metadata": "9.13.0", + "@vueuse/shared": "9.13.0", + "vue-demi": "*" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/@vueuse/core/node_modules/vue-demi": { + "version": "0.14.10", + "resolved": "https://registry.npmmirror.com/vue-demi/-/vue-demi-0.14.10.tgz", + "integrity": "sha512-nMZBOwuzabUO0nLgIcc6rycZEebF6eeUfaiQx9+WSk8e29IbLvPU9feI6tqW4kTo3hvoYAJkMh8n8D0fuISphg==", + "hasInstallScript": true, + "bin": { + "vue-demi-fix": "bin/vue-demi-fix.js", + "vue-demi-switch": "bin/vue-demi-switch.js" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + }, + "peerDependencies": { + "@vue/composition-api": "^1.0.0-rc.1", + "vue": "^3.0.0-0 || ^2.6.0" + }, + "peerDependenciesMeta": { + "@vue/composition-api": { + "optional": true + } + } + }, + "node_modules/@vueuse/metadata": { + "version": "9.13.0", + "resolved": "https://registry.npmmirror.com/@vueuse/metadata/-/metadata-9.13.0.tgz", + "integrity": "sha512-gdU7TKNAUVlXXLbaF+ZCfte8BjRJQWPCa2J55+7/h+yDtzw3vOoGQDRXzI6pyKyo6bXFT5/QoPE4hAknExjRLQ==", + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/@vueuse/shared": { + "version": "9.13.0", + "resolved": "https://registry.npmmirror.com/@vueuse/shared/-/shared-9.13.0.tgz", + "integrity": "sha512-UrnhU+Cnufu4S6JLCPZnkWh0WwZGUp72ktOF2DFptMlOs3TOdVv8xJN53zhHGARmVOsz5KqOls09+J1NR6sBKw==", + "dependencies": { + "vue-demi": "*" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/@vueuse/shared/node_modules/vue-demi": { + "version": "0.14.10", + "resolved": "https://registry.npmmirror.com/vue-demi/-/vue-demi-0.14.10.tgz", + "integrity": "sha512-nMZBOwuzabUO0nLgIcc6rycZEebF6eeUfaiQx9+WSk8e29IbLvPU9feI6tqW4kTo3hvoYAJkMh8n8D0fuISphg==", + "hasInstallScript": true, + "bin": { + "vue-demi-fix": "bin/vue-demi-fix.js", + "vue-demi-switch": "bin/vue-demi-switch.js" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + }, + "peerDependencies": { + "@vue/composition-api": "^1.0.0-rc.1", + "vue": "^3.0.0-0 || ^2.6.0" + }, + "peerDependenciesMeta": { + "@vue/composition-api": { + "optional": true + } + } + }, "node_modules/@webassemblyjs/ast": { "version": "1.12.1", "resolved": "https://registry.npmmirror.com/@webassemblyjs/ast/-/ast-1.12.1.tgz", @@ -3983,6 +4180,11 @@ "lodash": "^4.17.14" } }, + "node_modules/async-validator": { + "version": "4.2.5", + "resolved": "https://registry.npmmirror.com/async-validator/-/async-validator-4.2.5.tgz", + "integrity": "sha512-7HhHjtERjqlNbZtqNqy2rckN/SpOOlmDliet+lP7k+eKZEjPk3DgyeU9lIXLdeLz0uBbbVp+9Qdow9wJWgwwfg==" + }, "node_modules/at-least-node": { "version": "1.0.0", "resolved": "https://registry.npmmirror.com/at-least-node/-/at-least-node-1.0.0.tgz", @@ -4071,6 +4273,15 @@ "object.assign": "^4.1.0" } }, + "node_modules/babel-plugin-import": { + "version": "1.13.8", + "resolved": "https://registry.npmmirror.com/babel-plugin-import/-/babel-plugin-import-1.13.8.tgz", + "integrity": "sha512-36babpjra5m3gca44V6tSTomeBlPA7cHUynrE2WiQIm3rEGD9xy28MKsx5IdO45EbnpJY7Jrgd00C6Dwt/l/2Q==", + "dev": true, + "dependencies": { + "@babel/helper-module-imports": "^7.0.0" + } + }, "node_modules/babel-plugin-polyfill-corejs2": { "version": "0.4.11", "resolved": "https://registry.npmmirror.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.11.tgz", @@ -4792,6 +5003,12 @@ "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "dev": true }, + "node_modules/confbox": { + "version": "0.1.8", + "resolved": "https://registry.npmmirror.com/confbox/-/confbox-0.1.8.tgz", + "integrity": "sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==", + "dev": true + }, "node_modules/connect-history-api-fallback": { "version": "2.0.0", "resolved": "https://registry.npmmirror.com/connect-history-api-fallback/-/connect-history-api-fallback-2.0.0.tgz", @@ -5263,6 +5480,11 @@ "resolved": "https://registry.npmmirror.com/csstype/-/csstype-3.1.3.tgz", "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==" }, + "node_modules/dayjs": { + "version": "1.11.13", + "resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.13.tgz", + "integrity": "sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg==" + }, "node_modules/debounce": { "version": "1.2.1", "resolved": "https://registry.npmmirror.com/debounce/-/debounce-1.2.1.tgz", @@ -5672,6 +5894,31 @@ "integrity": "sha512-ZXfs1Of8fDb6z7WEYZjXpgIRF6MEu8JdeGA0A40aZq6OQbS+eJpnnV49epZRna2DU/YsEjSQuGtQPPtvt6J65A==", "dev": true }, + "node_modules/element-plus": { + "version": "2.8.7", + "resolved": "https://registry.npmmirror.com/element-plus/-/element-plus-2.8.7.tgz", + "integrity": "sha512-oGQyFRufFOgjd872tZc+T4xQAYLlX4hj6d3ixeY13L4fFNUuc1N49JHAqJGPda0tdx3qCnjceZoh1kqqj2+tXQ==", + "dependencies": { + "@ctrl/tinycolor": "^3.4.1", + "@element-plus/icons-vue": "^2.3.1", + "@floating-ui/dom": "^1.0.1", + "@popperjs/core": "npm:@sxzz/popperjs-es@^2.11.7", + "@types/lodash": "^4.14.182", + "@types/lodash-es": "^4.17.6", + "@vueuse/core": "^9.1.0", + "async-validator": "^4.2.5", + "dayjs": "^1.11.3", + "escape-html": "^1.0.3", + "lodash": "^4.17.21", + "lodash-es": "^4.17.21", + "lodash-unified": "^1.0.2", + "memoize-one": "^6.0.0", + "normalize-wheel-es": "^1.2.0" + }, + "peerDependencies": { + "vue": "^3.2.0" + } + }, "node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmmirror.com/emoji-regex/-/emoji-regex-8.0.0.tgz", @@ -5799,8 +6046,7 @@ "node_modules/escape-html": { "version": "1.0.3", "resolved": "https://registry.npmmirror.com/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", - "dev": true + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" }, "node_modules/escape-string-regexp": { "version": "1.0.5", @@ -7850,6 +8096,22 @@ "json5": "lib/cli.js" } }, + "node_modules/local-pkg": { + "version": "0.5.0", + "resolved": "https://registry.npmmirror.com/local-pkg/-/local-pkg-0.5.0.tgz", + "integrity": "sha512-ok6z3qlYyCDS4ZEU27HaU6x/xZa9Whf8jD4ptH5UZTQYZVYeb9bnZ3ojVhiJNLiXK1Hfc0GNbLXcmZ5plLDDBg==", + "dev": true, + "dependencies": { + "mlly": "^1.4.2", + "pkg-types": "^1.0.3" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, "node_modules/locate-path": { "version": "5.0.0", "resolved": "https://registry.npmmirror.com/locate-path/-/locate-path-5.0.0.tgz", @@ -7865,14 +8127,23 @@ "node_modules/lodash": { "version": "4.17.21", "resolved": "https://registry.npmmirror.com/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, "node_modules/lodash-es": { "version": "4.17.21", "resolved": "https://registry.npmmirror.com/lodash-es/-/lodash-es-4.17.21.tgz", "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==" }, + "node_modules/lodash-unified": { + "version": "1.0.3", + "resolved": "https://registry.npmmirror.com/lodash-unified/-/lodash-unified-1.0.3.tgz", + "integrity": "sha512-WK9qSozxXOD7ZJQlpSqOT+om2ZfcT4yO+03FuzAHD0wF6S0l0090LRPDx3vhTTLZ8cFKpBn+IOcVXK6qOcIlfQ==", + "peerDependencies": { + "@types/lodash-es": "*", + "lodash": "*", + "lodash-es": "*" + } + }, "node_modules/lodash.debounce": { "version": "4.0.8", "resolved": "https://registry.npmmirror.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz", @@ -8148,6 +8419,11 @@ "node": ">= 4.0.0" } }, + "node_modules/memoize-one": { + "version": "6.0.0", + "resolved": "https://registry.npmmirror.com/memoize-one/-/memoize-one-6.0.0.tgz", + "integrity": "sha512-rkpe71W0N0c0Xz6QD0eJETuWAJGnJ9afsl1srmwPrI+yBCkge5EycXXbYRyvL29zZVUWQCY7InPRCv3GDXuZNw==" + }, "node_modules/merge-descriptors": { "version": "1.0.3", "resolved": "https://registry.npmmirror.com/merge-descriptors/-/merge-descriptors-1.0.3.tgz", @@ -8363,6 +8639,11 @@ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "dev": true }, + "node_modules/mitt": { + "version": "3.0.1", + "resolved": "https://registry.npmmirror.com/mitt/-/mitt-3.0.1.tgz", + "integrity": "sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw==" + }, "node_modules/mkdirp": { "version": "0.5.6", "resolved": "https://registry.npmmirror.com/mkdirp/-/mkdirp-0.5.6.tgz", @@ -8375,6 +8656,18 @@ "mkdirp": "bin/cmd.js" } }, + "node_modules/mlly": { + "version": "1.7.2", + "resolved": "https://registry.npmmirror.com/mlly/-/mlly-1.7.2.tgz", + "integrity": "sha512-tN3dvVHYVz4DhSXinXIk7u9syPYaJvio118uomkovAtWBT+RdbP6Lfh/5Lvo519YMmwBafwlh20IPTXIStscpA==", + "dev": true, + "dependencies": { + "acorn": "^8.12.1", + "pathe": "^1.1.2", + "pkg-types": "^1.2.0", + "ufo": "^1.5.4" + } + }, "node_modules/module-alias": { "version": "2.2.3", "resolved": "https://registry.npmmirror.com/module-alias/-/module-alias-2.2.3.tgz", @@ -8560,6 +8853,11 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/normalize-wheel-es": { + "version": "1.2.0", + "resolved": "https://registry.npmmirror.com/normalize-wheel-es/-/normalize-wheel-es-1.2.0.tgz", + "integrity": "sha512-Wj7+EJQ8mSuXr2iWfnujrimU35R2W4FAErEyTmJoJ7ucwTn2hOUSsRehMb5RSYkxXGTM7Y9QpvPmp++w5ftoJw==" + }, "node_modules/npm-run-path": { "version": "2.0.2", "resolved": "https://registry.npmmirror.com/npm-run-path/-/npm-run-path-2.0.2.tgz", @@ -8956,6 +9254,12 @@ "node": ">=8" } }, + "node_modules/pathe": { + "version": "1.1.2", + "resolved": "https://registry.npmmirror.com/pathe/-/pathe-1.1.2.tgz", + "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==", + "dev": true + }, "node_modules/picocolors": { "version": "1.1.1", "resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-1.1.1.tgz", @@ -8985,6 +9289,17 @@ "node": ">=8" } }, + "node_modules/pkg-types": { + "version": "1.2.1", + "resolved": "https://registry.npmmirror.com/pkg-types/-/pkg-types-1.2.1.tgz", + "integrity": "sha512-sQoqa8alT3nHjGuTjuKgOnvjo4cljkufdtLMnO2LBP/wRwuDlo1tkaEdMxCRhyGRPacv/ztlZgDPm2b7FAmEvw==", + "dev": true, + "dependencies": { + "confbox": "^0.1.8", + "mlly": "^1.7.2", + "pathe": "^1.1.2" + } + }, "node_modules/portfinder": { "version": "1.0.32", "resolved": "https://registry.npmmirror.com/portfinder/-/portfinder-1.0.32.tgz", @@ -10138,6 +10453,12 @@ "url": "https://opencollective.com/webpack" } }, + "node_modules/scule": { + "version": "1.3.0", + "resolved": "https://registry.npmmirror.com/scule/-/scule-1.3.0.tgz", + "integrity": "sha512-6FtHJEvt+pVMIB9IBY+IcCJ6Z5f1iQnytgyfKMhDKgmzYG+TeH/wx1y3l27rshSbLiSanrR9ffZDrEsmjlQF2g==", + "dev": true + }, "node_modules/select-hose": { "version": "2.0.0", "resolved": "https://registry.npmmirror.com/select-hose/-/select-hose-2.0.0.tgz", @@ -10664,6 +10985,24 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/strip-literal": { + "version": "2.1.0", + "resolved": "https://registry.npmmirror.com/strip-literal/-/strip-literal-2.1.0.tgz", + "integrity": "sha512-Op+UycaUt/8FbN/Z2TWPBLge3jWrP3xj10f3fnYxf052bKuS3EKs1ZQcVGjnEMdsNVAM+plXRdmjrZ/KgG3Skw==", + "dev": true, + "dependencies": { + "js-tokens": "^9.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/strip-literal/node_modules/js-tokens": { + "version": "9.0.0", + "resolved": "https://registry.npmmirror.com/js-tokens/-/js-tokens-9.0.0.tgz", + "integrity": "sha512-WriZw1luRMlmV3LGJaR6QOJjWwgLUTf89OwT2lUOyjX2dJGBwgmIkbcz+7WFZjrZM635JOIR517++e/67CP9dQ==", + "dev": true + }, "node_modules/stylehacks": { "version": "5.1.1", "resolved": "https://registry.npmmirror.com/stylehacks/-/stylehacks-5.1.1.tgz", @@ -11040,6 +11379,12 @@ "node": ">= 0.6" } }, + "node_modules/ufo": { + "version": "1.5.4", + "resolved": "https://registry.npmmirror.com/ufo/-/ufo-1.5.4.tgz", + "integrity": "sha512-UsUk3byDzKd04EyoZ7U4DOlxQaD14JUKQl6/P7wiX4FNvUfm3XL246n9W5AmqwW5RSFJ27NAuM0iLscAOYUiGQ==", + "dev": true + }, "node_modules/undici-types": { "version": "6.19.8", "resolved": "https://registry.npmmirror.com/undici-types/-/undici-types-6.19.8.tgz", @@ -11086,6 +11431,48 @@ "node": ">=4" } }, + "node_modules/unimport": { + "version": "3.13.1", + "resolved": "https://registry.npmmirror.com/unimport/-/unimport-3.13.1.tgz", + "integrity": "sha512-nNrVzcs93yrZQOW77qnyOVHtb68LegvhYFwxFMfuuWScmwQmyVCG/NBuN8tYsaGzgQUVYv34E/af+Cc9u4og4A==", + "dev": true, + "dependencies": { + "@rollup/pluginutils": "^5.1.2", + "acorn": "^8.12.1", + "escape-string-regexp": "^5.0.0", + "estree-walker": "^3.0.3", + "fast-glob": "^3.3.2", + "local-pkg": "^0.5.0", + "magic-string": "^0.30.11", + "mlly": "^1.7.1", + "pathe": "^1.1.2", + "pkg-types": "^1.2.0", + "scule": "^1.3.0", + "strip-literal": "^2.1.0", + "unplugin": "^1.14.1" + } + }, + "node_modules/unimport/node_modules/escape-string-regexp": { + "version": "5.0.0", + "resolved": "https://registry.npmmirror.com/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/unimport/node_modules/estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmmirror.com/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "dev": true, + "dependencies": { + "@types/estree": "^1.0.0" + } + }, "node_modules/universalify": { "version": "2.0.1", "resolved": "https://registry.npmmirror.com/universalify/-/universalify-2.0.1.tgz", @@ -11104,6 +11491,175 @@ "node": ">= 0.8" } }, + "node_modules/unplugin": { + "version": "1.15.0", + "resolved": "https://registry.npmmirror.com/unplugin/-/unplugin-1.15.0.tgz", + "integrity": "sha512-jTPIs63W+DUEDW207ztbaoO7cQ4p5aVaB823LSlxpsFEU3Mykwxf3ZGC/wzxFJeZlASZYgVrWeo7LgOrqJZ8RA==", + "dev": true, + "dependencies": { + "acorn": "^8.14.0", + "webpack-virtual-modules": "^0.6.2" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "webpack-sources": "^3" + }, + "peerDependenciesMeta": { + "webpack-sources": { + "optional": true + } + } + }, + "node_modules/unplugin-auto-import": { + "version": "0.16.1", + "resolved": "https://registry.npmmirror.com/unplugin-auto-import/-/unplugin-auto-import-0.16.1.tgz", + "integrity": "sha512-H3Ky56cGEEHTssxUIFuGXTowGVlT/Bp3MBx1yyCzUHzAtdrO+2r9zpid32f2AkTpQxo2lch6yaTK61Im+rEyPQ==", + "dev": true, + "dependencies": { + "@antfu/utils": "^0.7.2", + "@rollup/pluginutils": "^5.0.2", + "local-pkg": "^0.4.3", + "magic-string": "^0.30.0", + "minimatch": "^9.0.1", + "unimport": "^3.0.7", + "unplugin": "^1.3.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + }, + "peerDependencies": { + "@nuxt/kit": "^3.2.2", + "@vueuse/core": "*" + }, + "peerDependenciesMeta": { + "@nuxt/kit": { + "optional": true + }, + "@vueuse/core": { + "optional": true + } + } + }, + "node_modules/unplugin-auto-import/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/unplugin-auto-import/node_modules/local-pkg": { + "version": "0.4.3", + "resolved": "https://registry.npmmirror.com/local-pkg/-/local-pkg-0.4.3.tgz", + "integrity": "sha512-SFppqq5p42fe2qcZQqqEOiVRXl+WCP1MdT6k7BDEW1j++sp5fIY+/fdRQitvKgB5BrBcmrs5m/L0v2FrU5MY1g==", + "dev": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/unplugin-auto-import/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmmirror.com/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/unplugin-vue-components": { + "version": "0.25.0", + "resolved": "https://registry.npmmirror.com/unplugin-vue-components/-/unplugin-vue-components-0.25.0.tgz", + "integrity": "sha512-HxrQ4GMSS1RwVww2av3a42cABo/v5AmTRN9iARv6e/xwkrfTyHhLh84kFwXxKkXK61vxDHxaryn694mQmkiVBg==", + "dev": true, + "dependencies": { + "@antfu/utils": "^0.7.3", + "@rollup/pluginutils": "^5.0.2", + "chokidar": "^3.5.3", + "debug": "^4.3.4", + "fast-glob": "^3.2.12", + "local-pkg": "^0.4.3", + "magic-string": "^0.30.0", + "minimatch": "^9.0.1", + "resolve": "^1.22.2", + "unplugin": "^1.3.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + }, + "peerDependencies": { + "@babel/parser": "^7.15.8", + "@nuxt/kit": "^3.2.2", + "vue": "2 || 3" + }, + "peerDependenciesMeta": { + "@babel/parser": { + "optional": true + }, + "@nuxt/kit": { + "optional": true + } + } + }, + "node_modules/unplugin-vue-components/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/unplugin-vue-components/node_modules/local-pkg": { + "version": "0.4.3", + "resolved": "https://registry.npmmirror.com/local-pkg/-/local-pkg-0.4.3.tgz", + "integrity": "sha512-SFppqq5p42fe2qcZQqqEOiVRXl+WCP1MdT6k7BDEW1j++sp5fIY+/fdRQitvKgB5BrBcmrs5m/L0v2FrU5MY1g==", + "dev": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/unplugin-vue-components/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmmirror.com/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/unplugin/node_modules/webpack-virtual-modules": { + "version": "0.6.2", + "resolved": "https://registry.npmmirror.com/webpack-virtual-modules/-/webpack-virtual-modules-0.6.2.tgz", + "integrity": "sha512-66/V2i5hQanC51vBQKPH4aI8NMAcBW59FVBs+rC7eGHupMyfn34q7rZIE+ETlJ+XTevqfUhVVBgSUNSW2flEUQ==", + "dev": true + }, "node_modules/update-browserslist-db": { "version": "1.1.1", "resolved": "https://registry.npmmirror.com/update-browserslist-db/-/update-browserslist-db-1.1.1.tgz", diff --git a/ckeditor5/package.json b/ckeditor5/package.json index 0bc8436..e7ffa2b 100644 --- a/ckeditor5/package.json +++ b/ckeditor5/package.json @@ -11,6 +11,7 @@ "@ckeditor/ckeditor5-vue": "^7.2.0", "ckeditor5": "^43.2.0", "core-js": "^3.8.3", + "element-plus": "^2.8.7", "file-saver": "^2.0.5", "html-docx-js-typescript": "^0.1.5", "vue": "^3.2.13" @@ -21,8 +22,11 @@ "@vue/cli-plugin-babel": "~5.0.0", "@vue/cli-plugin-eslint": "~5.0.0", "@vue/cli-service": "~5.0.0", + "babel-plugin-import": "^1.13.8", "eslint": "^7.32.0", - "eslint-plugin-vue": "^8.0.3" + "eslint-plugin-vue": "^8.0.3", + "unplugin-auto-import": "^0.16.1", + "unplugin-vue-components": "^0.25.0" }, "eslintConfig": { "root": true, @@ -33,9 +37,6 @@ "plugin:vue/vue3-essential", "eslint:recommended" ], - "parserOptions": { - "parser": "@babel/eslint-parser" - }, "rules": {} }, "browserslist": [ diff --git a/ckeditor5/prompt_generate_style.md b/ckeditor5/prompt_generate_style.md new file mode 100644 index 0000000..7db368b --- /dev/null +++ b/ckeditor5/prompt_generate_style.md @@ -0,0 +1,29 @@ +### 角色 +你是一个设计和 CSS 专家,能够根据用户需求生成精确的 CSS 样式。 +### 任务 +为以下元素生成 CSS 样式类: +标题:(i为标题级别,如 h1, h2 等) +文本块:

+块引用:

+行文本: +代码块:
+所有样式都需在 .ck-content 中定义,格式为:
+``` css
+.ck-content element.class { ... }
+```
+### 示例
+生成一个文本块样式,生成的样式如下所示。 
+``` css
+.ck-content p.info-box { 
+    --background-size: 30px; 
+    --background-color: #e91e63; 
+    padding: 1.2em 2em; 
+    border: 1px solid var(--background-color); 
+    background: linear-gradient(135deg, var(--background-color) 0%, var(--background-color) var(--background-size), transparent var(--background-size)), linear-gradient(135deg, transparent calc(100% - var(--background-size)), var(--background-color) calc(100% - var(--background-size)), var(--background-color)); 
+    border-radius: 10px; 
+    margin: 1.5em 2em; 
+    box-shadow: 5px 5px 0 #ffe6ef; 
+}
+```
+### 输出
+仅输出你编写的 CSS 内容,不要对其进行解释和输出其他内容。
\ No newline at end of file
diff --git a/ckeditor5/public/style.css b/ckeditor5/public/style.css
index 71a1451..f43b293 100644
--- a/ckeditor5/public/style.css
+++ b/ckeditor5/public/style.css
@@ -9,6 +9,7 @@
 
 .main-container {
 	/* --ckeditor5-preview-height: 700px; */
+	position:relative;
 	font-family: '宋体';
 	width: fit-content;
 	height: 100%;
@@ -82,7 +83,67 @@
 	margin-left: 72px;
 	margin-right: 72px;
 }
-
+/*侧边栏样式*/
+.sidebar {
+	position: fixed;
+	top: 0;
+	left: 0;
+	width: 350px;
+	height: 100%;
+	overflow-y: hidden;
+	transition: transform 0.3s ease;
+	transform: translateX(-100%);
+	background-color: #f9f9f9;
+	padding-left: 8px; /* 调整内边距,使文字右移 */
+	padding-right: 8px; /* 调整内边距,使文字右移 */
+	z-index: 9;
+  }
+  .sidebar.active {
+	transform: translateX(0);
+  }
+  .sidebar-menu {
+	  display: flex;
+	  justify-content: space-between;
+  }
+  
+  .sidebar-menu .el-menu-item {
+	  flex: 1;
+	  text-align: center;
+  }
+  
+  .sidebar-menu .el-menu-item span {
+	  display: block;
+	  padding: 10px;
+	  background-color: #f5f5f5;
+	  border-radius: 4px;
+	  margin: 5px;
+	  transition: background-color 0.3s;
+  }
+  
+  .sidebar-menu .el-menu-item span:hover {
+	  background-color: #e0e0e0;
+  }
+  .chat-box {
+	max-height: 350px;
+	overflow-y: auto;
+  }
+  .preview {
+	margin-top: 20px; /* 调整预览区与表单之间的距离 */
+	border: 1px solid #ccc; /* 添加边框 */
+	padding: 10px; /* 添加内边距 */
+	border-radius: 4px; /* 添加圆角 */
+  }
+  .form-item {
+	margin-bottom: 1px; /* 减小表单项之间的距离 */
+  }
+/*侧边栏出现时其他右移*/
+.main-container.sidebar-open .editor-container__menu-bar,
+.main-container.sidebar-open .editor-container__toolbar,
+.main-container.sidebar-open .editor-container__editor-wrapper {
+  transition: margin-left 0.3s ease;
+  margin-left: 350px;
+}
+/*用户定义的style插件样式*/
 .ck-content h3.category {
 	font-family: 'Oswald';
 	font-size: 20px;
diff --git a/ckeditor5/src/App.vue b/ckeditor5/src/App.vue
index d2e0b9a..ff19a8b 100644
--- a/ckeditor5/src/App.vue
+++ b/ckeditor5/src/App.vue
@@ -1,22 +1,225 @@
 
+
 
diff --git a/ckeditor5/src/components/plugins.js b/ckeditor5/src/components/plugins.js
new file mode 100644
index 0000000..5980994
--- /dev/null
+++ b/ckeditor5/src/components/plugins.js
@@ -0,0 +1,212 @@
+import {
+    Plugin,
+    ButtonView,
+	createDropdown,
+	Collection,
+	addListToDropdown,
+} from 'ckeditor5';
+import { asBlob } from 'html-docx-js-typescript'
+import { saveAs } from 'file-saver';
+import {
+    getStyle,
+    getPageContent
+} from './utils';
+
+// 导出为docx插件
+class Export2Word extends Plugin {
+	init() {
+		const editor = this.editor;
+
+		editor.ui.componentFactory.add('ExportToWord', () => {
+			// The button will be an instance of ButtonView.
+			const button = new ButtonView();
+
+			button.set({
+				label: '导出为docx',
+				// withText: true
+				tooltip: true,
+
+				// 图标 直接插入svg文件
+				icon: ''
+
+			});
+
+			// Execute a callback function when the button is clicked
+			button.on('execute', () => {
+				const pageContent = getPageContent();
+				const style = getStyle();
+				const page = '' + style + '' + pageContent + ''
+
+				// console.log(page);
+				asBlob(page).then(data => {
+					saveAs(data, 'file.docx') // save as docx file
+				}); // asBlob() return Promise
+			});
+
+			return button;
+		});
+
+		// 增加菜单栏? 不显示按钮
+		// editor.ui.extendMenuBar({
+		// 	menu: {
+		// 		menuId: 'export',
+		// 		label: '导出',
+		// 		groups: [
+		// 			{
+		// 				groupId: 'export',
+		// 				items: [
+		// 					'ExportToWord'
+		// 				]
+		// 			}
+		// 		]
+		// 	},
+		// 	position: 'after:help'
+		// }
+		// );
+
+	}
+}
+// 导出为PDF插件
+class Export2PDF extends Plugin {
+	init() {
+		const editor = this.editor;
+
+		editor.ui.componentFactory.add('ExportToPDF', () => {
+			// The button will be an instance of ButtonView.
+			const button = new ButtonView();
+
+			button.set({
+				label: '导出为PDF',
+				// withText: true
+				tooltip: true,
+
+				// 图标 直接插入svg文件
+				icon: ''
+
+			});
+
+			// Execute a callback function when the button is clicked
+			button.on('execute', () => {
+				const pageContent = getPageContent();
+				console.log(pageContent);
+				const style = getStyle();
+				// 去掉element中的 ck-focused ck-weight_selected消除页面和图片的蓝边
+				const page = '' + style + '' + pageContent.replaceAll('ck-focused', 'ck-blurred').replaceAll('ck-weight_selected', '') + ''
+				const newWindow = window.open('', 'PrintDocument', 'height=600,width=700,top=50,left=50');
+				newWindow.document.write(page);
+				newWindow.document.close();
+				newWindow.print();
+				newWindow.onafterprint = function () {
+					newWindow.close();
+				}
+			});
+
+			return button;
+		});
+	}
+}
+// 智能润色插件
+class Translation extends Plugin {
+	init() {
+		// console.log('Translation initialized!');
+
+		this.editor.ui.componentFactory.add('translate', (locale) => {
+			const dropdownView = createDropdown(locale);
+			dropdownView.buttonView.set({
+				label: '智能助手',
+				withText: true,
+			});
+
+			const items = new Collection();
+			items.add({
+				type: 'button',
+				model: {
+					id: 'summary',
+					withText: true,
+					label: '摘要',
+				}
+			});
+			items.add({
+				type: 'button',
+				model: {
+					id: 'decoration',
+					withText: true,
+					label: '润色'
+				}
+			});
+			items.add({
+				type: 'button',
+				model: {
+					id: 'extension',
+					withText: true,
+					label: '续写'
+				}
+			});
+			items.add({
+				type: 'button',
+				model: {
+					id: 'correction',
+					withText: true,
+					label: '修改'
+				}
+			});
+			items.add({
+				type: 'button',
+				model: {
+					id: 'translation',
+					withText: true,
+					label: '翻译'
+				}
+			});
+			addListToDropdown(dropdownView, items);
+
+			dropdownView.on('execute', (eventInfo) => {
+				const { id, label } = eventInfo.source;
+				// 获取选中的文本,用来进行后续操作
+				const selectionText = window.getSelection().toString();
+				if (id === 'summary') {
+					// this.editor.execute('ExportToWord');
+					console.log('Object (en):', label, selectionText);
+				}
+			});
+
+			return dropdownView;
+		});
+	}
+}
+// 侧边栏
+class ToggleSideBar extends Plugin{
+	// constructor(toggleSidebar) {
+	// 	super();
+	// 	this.toggleSidebar = toggleSidebar;
+	// }
+	init() {
+		const editor = this.editor;
+
+		editor.ui.componentFactory.add('SideBar', () => {
+			// The button will be an instance of ButtonView.
+			const button = new ButtonView();
+
+			button.set({
+				label: '侧边栏',
+				// withText: true
+				tooltip: true,
+				// 图标 直接插入svg文件
+				icon: ''
+
+			});
+
+			// Execute a callback function when the button is clicked
+			button.on('execute', () => {
+				// 打开sidebar
+				const bt = document.getElementById("toggleSidebarButton");
+				console.log(bt);
+				bt.click();
+			});
+
+			return button;
+		});
+	}
+}
+
+export { Export2Word, Export2PDF, Translation, ToggleSideBar };
\ No newline at end of file
diff --git a/ckeditor5/src/components/utils.js b/ckeditor5/src/components/utils.js
new file mode 100644
index 0000000..46f4833
--- /dev/null
+++ b/ckeditor5/src/components/utils.js
@@ -0,0 +1,149 @@
+// utils.js
+
+// 获取用户配置
+export async function getUserConfigFromBackend() {
+    // TODO 请求用户配置
+    const options = {};
+    // 字体、字号、样式
+    // TODO
+    const {
+        fontFamilyOptions = [
+            'default',
+            '宋体',
+            '新宋体',
+            '仿宋',
+            '楷体',
+            '微软雅黑',
+            '黑体',
+            '华文仿宋',
+            '华文楷体',
+            '华文隶书',
+            '华文宋体',
+            '华文细黑',
+            '华文新魏',
+            '华文行楷',
+            '华文中宋',
+            '隶书',
+            '苹方 常规',
+            '幼圆',
+            'Times New Roman'
+        ],
+        // 五号,小四,四号,小三,三号,小二,二号
+        fontSizeOptions = [10.5, 12, 14, 15, 'default', 18, 22],
+        styleDefinitions = [
+            {
+                name: 'Article category',
+                element: 'h3',
+                classes: ['category']
+            },
+            {
+                name: 'Title',
+                element: 'h2',
+                classes: ['document-title']
+            },
+            {
+                name: 'Subtitle',
+                element: 'h3',
+                classes: ['document-subtitle']
+            },
+            {
+                name: 'Info box',
+                element: 'p',
+                classes: ['info-box']
+            },
+            {
+                name: 'Side quote',
+                element: 'blockquote',
+                classes: ['side-quote']
+            },
+            {
+                name: 'Marker',
+                element: 'span',
+                classes: ['marker']
+            },
+            {
+                name: 'Spoiler',
+                element: 'span',
+                classes: ['spoiler']
+            },
+            {
+                name: 'Code (dark)',
+                element: 'pre',
+                classes: ['fancy-code', 'fancy-code-dark']
+            },
+            {
+                name: 'Code (bright)',
+                element: 'pre',
+                classes: ['fancy-code', 'fancy-code-bright']
+            },
+            {
+                name: 'GradientBorder',
+                element: 'p',
+                classes: ['gradientborder']
+            }
+        ]
+    } = options;
+    // 如果传入的options没有对应项,使用默认值
+    return {
+        fontFamily: {
+            options: fontFamilyOptions
+        },
+        fontSize: {
+            options: fontSizeOptions
+        },
+        style: {
+            definitions: styleDefinitions
+        }
+    };
+}
+
+// 实现自动保存saveData方法,将编辑内容发送至后端
+export function saveData(data) {
+    // return new Promise( resolve => {
+    //     setTimeout( () => {
+    //         console.log( 'Saved', data );
+
+    //         resolve();
+    //     }, HTTP_SERVER_LAG );
+    // } );
+    console.log(data);
+}
+
+// TODO 手动保存
+// function saveByHand(){
+	
+// 	this.editor.plugins.get('Autosave').save().then(() => {
+// 		console.log('Data saved successfully');
+// 	});
+// }
+
+// 将当前页面的样式转为内联
+export function getStyle() {
+    let str = '';
+    const styles = document.querySelectorAll('style');
+    for (let i = 0; i < styles.length; i++) {
+        str += styles[i].outerHTML;
+    }
+    str += "";
+    str += ""
+    // str += ""
+    str += ""
+    return str;
+}
+
+// 获取用户编辑的内容 
+export function getPageContent() {
+    const pageContent = document.querySelector("#app > div > div > div > div.editor-container__editor-wrapper > div > div > div.ck.ck-reset.ck-editor.ck-rounded-corners > div.ck.ck-editor__main > div");
+    return pageContent.innerHTML;
+}
+
+// 获取并应用用户定义的样式
+export async function getAndApplyUserStyles() {
+    // 模拟从后端获取用户定义的样式
+    const response = await fetch('/api/user-styles');
+    const styles = await response.json();
+    const styleElement = document.createElement('style');
+    styleElement.innerHTML = styles;
+    document.head.appendChild(styleElement);
+    return styles;
+}
\ No newline at end of file
diff --git a/ckeditor5/src/main.js b/ckeditor5/src/main.js
index 1be3c02..1a3af3e 100644
--- a/ckeditor5/src/main.js
+++ b/ckeditor5/src/main.js
@@ -1,12 +1,12 @@
-// import { createApp } from 'vue'
-// import App from './App.vue'
-
-// createApp(App).mount('#app')
-
-
 import { createApp } from 'vue';
 import '../public/style.css';
 import App from './App.vue';
 import { CkeditorPlugin } from '@ckeditor/ckeditor5-vue';
+import mitt from 'mitt';
+
+const app = createApp(App);
+const emitter = mitt();
 
-createApp(App).use(CkeditorPlugin).mount('#app');
+app.config.globalProperties.emitter = emitter;
+app.use(CkeditorPlugin);
+app.mount('#app');
\ No newline at end of file
diff --git a/ckeditor5/vue.config.js b/ckeditor5/vue.config.js
index 910e297..ffdb44b 100644
--- a/ckeditor5/vue.config.js
+++ b/ckeditor5/vue.config.js
@@ -1,4 +1,21 @@
 const { defineConfig } = require('@vue/cli-service')
+
+const AutoImport = require('unplugin-auto-import/webpack')
+const Components = require('unplugin-vue-components/webpack')
+const { ElementPlusResolver } = require('unplugin-vue-components/resolvers')
+
 module.exports = defineConfig({
-  transpileDependencies: true
+  transpileDependencies: true,
+  configureWebpack: {
+    plugins: [
+      AutoImport({
+        resolvers: [ElementPlusResolver()]
+      }),
+      Components({
+        resolvers: [ElementPlusResolver()]
+      }),
+    ]
+  }
+
+  
 })