diff --git a/package.json b/package.json index 3d59ef6..308d093 100644 --- a/package.json +++ b/package.json @@ -44,6 +44,9 @@ }, "dependencies": { "@better-scroll/core": "2.5.1", + "@codemirror/lang-javascript": "^6.2.2", + "@codemirror/lang-json": "^6.0.1", + "@codemirror/theme-one-dark": "^6.1.2", "@iconify/vue": "4.1.2", "@sa/axios": "workspace:*", "@sa/color-palette": "workspace:*", @@ -61,6 +64,7 @@ "pinia": "2.1.7", "ts-md5": "1.3.1", "vue": "3.4.25", + "vue-codemirror6": "^1.3.0", "vue-draggable-plus": "0.4.0", "vue-i18n": "9.13.1", "vue-router": "4.3.2" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index dbbc232..d9cb43a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -11,6 +11,15 @@ importers: '@better-scroll/core': specifier: 2.5.1 version: 2.5.1 + '@codemirror/lang-javascript': + specifier: ^6.2.2 + version: 6.2.2 + '@codemirror/lang-json': + specifier: ^6.0.1 + version: 6.0.1 + '@codemirror/theme-one-dark': + specifier: ^6.1.2 + version: 6.1.2 '@iconify/vue': specifier: 4.1.2 version: 4.1.2(vue@3.4.25(typescript@5.4.5)) @@ -62,6 +71,9 @@ importers: vue: specifier: 3.4.25 version: 3.4.25(typescript@5.4.5) + vue-codemirror6: + specifier: ^1.3.0 + version: 1.3.0(@lezer/common@1.2.1)(vue@3.4.25(typescript@5.4.5)) vue-draggable-plus: specifier: 0.4.0 version: 0.4.0(@types/sortablejs@1.15.8) @@ -469,6 +481,41 @@ packages: '@better-scroll/shared-utils@2.5.1': resolution: {integrity: sha512-AplkfSjXVYP9LZiD6JsKgmgQJ/mG4uuLmBuwLz8W5OsYc7AYTfN8kw6GqZ5OwCGoXkVhBGyd8NeC4xwYItp0aw==} + '@codemirror/autocomplete@6.16.0': + resolution: {integrity: sha512-P/LeCTtZHRTCU4xQsa89vSKWecYv1ZqwzOd5topheGRf+qtacFgBeIMQi3eL8Kt/BUNvxUWkx+5qP2jlGoARrg==} + peerDependencies: + '@codemirror/language': ^6.0.0 + '@codemirror/state': ^6.0.0 + '@codemirror/view': ^6.0.0 + '@lezer/common': ^1.0.0 + + '@codemirror/commands@6.5.0': + resolution: {integrity: sha512-rK+sj4fCAN/QfcY9BEzYMgp4wwL/q5aj/VfNSoH1RWPF9XS/dUwBkvlL3hpWgEjOqlpdN1uLC9UkjJ4tmyjJYg==} + + '@codemirror/lang-javascript@6.2.2': + resolution: {integrity: sha512-VGQfY+FCc285AhWuwjYxQyUQcYurWlxdKYT4bqwr3Twnd5wP5WSeu52t4tvvuWmljT4EmgEgZCqSieokhtY8hg==} + + '@codemirror/lang-json@6.0.1': + resolution: {integrity: sha512-+T1flHdgpqDDlJZ2Lkil/rLiRy684WMLc74xUnjJH48GQdfJo/pudlTRreZmKwzP8/tGdKf83wlbAdOCzlJOGQ==} + + '@codemirror/language@6.10.1': + resolution: {integrity: sha512-5GrXzrhq6k+gL5fjkAwt90nYDmjlzTIJV8THnxNFtNKWotMIlzzN+CpqxqwXOECnUdOndmSeWntVrVcv5axWRQ==} + + '@codemirror/lint@6.6.0': + resolution: {integrity: sha512-RDWLZqvnTlU2k7Xc2QbeySS7hdClfca76BFsdh9iE5OgszlHRenCLLufH8SCO+CCbod0XLaukxs5DesHrxQATQ==} + + '@codemirror/search@6.5.6': + resolution: {integrity: sha512-rpMgcsh7o0GuCDUXKPvww+muLA1pDJaFrpq/CCHtpQJYz8xopu4D1hPcKRoDD0YlF8gZaqTNIRa4VRBWyhyy7Q==} + + '@codemirror/state@6.4.1': + resolution: {integrity: sha512-QkEyUiLhsJoZkbumGZlswmAhA7CBU02Wrz7zvH4SrcifbsqwlXShVXg65f3v/ts57W3dqyamEriMhij1Z3Zz4A==} + + '@codemirror/theme-one-dark@6.1.2': + resolution: {integrity: sha512-F+sH0X16j/qFLMAfbciKTxVOwkdAS336b7AXTKOZhy8BR3eH/RelsnLgLFINrpST63mmN2OuwUt0W2ndUgYwUA==} + + '@codemirror/view@6.26.3': + resolution: {integrity: sha512-gmqxkPALZjkgSxIeeweY/wGQXBfwTUaLs8h7OKtSwfbj9Ct3L11lD+u1sS7XHppxFQoMDiMDp07P9f3I2jWOHw==} + '@colors/colors@1.5.0': resolution: {integrity: sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==} engines: {node: '>=0.1.90'} @@ -863,6 +910,21 @@ packages: '@juggle/resize-observer@3.4.0': resolution: {integrity: sha512-dfLbk+PwWvFzSxwk3n5ySL0hfBog779o8h68wK/7/APo/7cgyWp5jcXockbxdk5kFRkbeXWm4Fbi9FrdN381sA==} + '@lezer/common@1.2.1': + resolution: {integrity: sha512-yemX0ZD2xS/73llMZIK6KplkjIjf2EvAHcinDi/TfJ9hS25G0388+ClHt6/3but0oOxinTcQHJLDXh6w1crzFQ==} + + '@lezer/highlight@1.2.0': + resolution: {integrity: sha512-WrS5Mw51sGrpqjlh3d4/fOwpEV2Hd3YOkp9DBt4k8XZQcoTHZFB7sx030A6OcahF4J1nDQAa3jXlTVVYH50IFA==} + + '@lezer/javascript@1.4.15': + resolution: {integrity: sha512-B082ZdjI0vo2AgLqD834GlRTE9gwRX8NzHzKq5uDwEnQ9Dq+A/CEhd3nf68tiNA2f9O+8jS1NeSTUYT9IAqcTw==} + + '@lezer/json@1.0.2': + resolution: {integrity: sha512-xHT2P4S5eeCYECyKNPhr4cbEL9tc8w83SPwRC373o9uEdrvGKTZoJVAGxpOsZckMlEh9W23Pc72ew918RWQOBQ==} + + '@lezer/lr@1.4.0': + resolution: {integrity: sha512-Wst46p51km8gH0ZUmeNrtpRYmdlRHUpN1DQd3GFAyKANi8WVz8c2jHYTf1CVScFaCjQw1iO3ZZdqGDxQPRErTg==} + '@nodelib/fs.scandir@2.1.5': resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} engines: {node: '>= 8'} @@ -1739,6 +1801,9 @@ packages: resolution: {integrity: sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w==} engines: {node: '>=0.8'} + codemirror@6.0.1: + resolution: {integrity: sha512-J8j+nZ+CdWmIeFIGXEFbFPtpiYacFMDR8GlHK3IyHQJMCaVRfGx9NT+Hxivv1ckLWPvNdZqndbr/7lVhrf/Svg==} + collection-visit@1.0.0: resolution: {integrity: sha512-lNkKvzEeMBBjUGHZ+q6z9pSJla0KWAQPvtzhEV9+iGyQYG+pBpl7xKDhxoNSOZH2hhv0v5k0y2yAM4o4SjoSkw==} engines: {node: '>=0.10.0'} @@ -1829,6 +1894,9 @@ packages: resolution: {integrity: sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==} engines: {node: '>= 0.10'} + crelt@1.0.6: + resolution: {integrity: sha512-VQ2MBenTq1fWZUH9DJNGti7kKv6EeAuYr3cLwxUWhIu1baTaXh4Ib5W2CqHVqib4/MqbYGJqiL3Zb8GJZr3l4g==} + cron-parser@4.9.0: resolution: {integrity: sha512-p0SaNjrHOnQeR8/VnfGbmg9te2kfyYSQ7Sc/j/6DtPL3JQvKxmjO9TSjNFpujqV3vEYYBvNNvXSxzyksBWAx1Q==} engines: {node: '>=12.0.0'} @@ -4269,6 +4337,9 @@ packages: resolution: {integrity: sha512-0fk9zBqO67Nq5M/m45qHCJxylV/DhBlIOVExqgOMiCCrzrhU6tCibRXNqE3jwJLftzE9SNuZtYbpzcO+i9FiKw==} engines: {node: '>=14.16'} + style-mod@4.1.2: + resolution: {integrity: sha512-wnD1HyVqpJUI2+eKZ+eo1UwghftP6yuFheBqqe+bWCotBjC2K1YnteJILRMs3SM4V/0dLEW1SC27MWP5y+mwmw==} + supports-color@2.0.0: resolution: {integrity: sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==} engines: {node: '>=0.8.0'} @@ -4643,6 +4714,12 @@ packages: peerDependencies: vue: ^3.0.0 + vue-codemirror6@1.3.0: + resolution: {integrity: sha512-Wq+Ji0wNPF1JYT+ISrWePtJgm0QR0g3s/TwaViPbOHT9/hea1Ik7/bEZN3VCJxJsQksL8IR9T9Hm4tnHGYXiBw==} + engines: {yarn: '>=1.22.19'} + peerDependencies: + vue: ^2.7.14 || ^3.4 + vue-demi@0.13.11: resolution: {integrity: sha512-IR8HoEEGM65YY3ZJYAjMlKygDQn25D5ajNFNoKh9RSDMQtlzCxtfQjdQgv9jjK+m3377SsJXY8ysq8kLCZL25A==} engines: {node: '>=12'} @@ -4713,6 +4790,9 @@ packages: peerDependencies: vue: ^3.0.11 + w3c-keyname@2.2.8: + resolution: {integrity: sha512-dpojBhNsCNN7T82Tm7k26A6G9ML3NkhDsnw9n/eoxSRlVBB4CEtIQ/KTCLI2Fwf3ataSXRhYFkQi3SlnFwPvPQ==} + webpack-sources@3.2.3: resolution: {integrity: sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==} engines: {node: '>=10.13.0'} @@ -5041,6 +5121,71 @@ snapshots: '@better-scroll/shared-utils@2.5.1': {} + '@codemirror/autocomplete@6.16.0(@codemirror/language@6.10.1)(@codemirror/state@6.4.1)(@codemirror/view@6.26.3)(@lezer/common@1.2.1)': + dependencies: + '@codemirror/language': 6.10.1 + '@codemirror/state': 6.4.1 + '@codemirror/view': 6.26.3 + '@lezer/common': 1.2.1 + + '@codemirror/commands@6.5.0': + dependencies: + '@codemirror/language': 6.10.1 + '@codemirror/state': 6.4.1 + '@codemirror/view': 6.26.3 + '@lezer/common': 1.2.1 + + '@codemirror/lang-javascript@6.2.2': + dependencies: + '@codemirror/autocomplete': 6.16.0(@codemirror/language@6.10.1)(@codemirror/state@6.4.1)(@codemirror/view@6.26.3)(@lezer/common@1.2.1) + '@codemirror/language': 6.10.1 + '@codemirror/lint': 6.6.0 + '@codemirror/state': 6.4.1 + '@codemirror/view': 6.26.3 + '@lezer/common': 1.2.1 + '@lezer/javascript': 1.4.15 + + '@codemirror/lang-json@6.0.1': + dependencies: + '@codemirror/language': 6.10.1 + '@lezer/json': 1.0.2 + + '@codemirror/language@6.10.1': + dependencies: + '@codemirror/state': 6.4.1 + '@codemirror/view': 6.26.3 + '@lezer/common': 1.2.1 + '@lezer/highlight': 1.2.0 + '@lezer/lr': 1.4.0 + style-mod: 4.1.2 + + '@codemirror/lint@6.6.0': + dependencies: + '@codemirror/state': 6.4.1 + '@codemirror/view': 6.26.3 + crelt: 1.0.6 + + '@codemirror/search@6.5.6': + dependencies: + '@codemirror/state': 6.4.1 + '@codemirror/view': 6.26.3 + crelt: 1.0.6 + + '@codemirror/state@6.4.1': {} + + '@codemirror/theme-one-dark@6.1.2': + dependencies: + '@codemirror/language': 6.10.1 + '@codemirror/state': 6.4.1 + '@codemirror/view': 6.26.3 + '@lezer/highlight': 1.2.0 + + '@codemirror/view@6.26.3': + dependencies: + '@codemirror/state': 6.4.1 + style-mod: 4.1.2 + w3c-keyname: 2.2.8 + '@colors/colors@1.5.0': optional: true @@ -5335,6 +5480,28 @@ snapshots: '@juggle/resize-observer@3.4.0': {} + '@lezer/common@1.2.1': {} + + '@lezer/highlight@1.2.0': + dependencies: + '@lezer/common': 1.2.1 + + '@lezer/javascript@1.4.15': + dependencies: + '@lezer/common': 1.2.1 + '@lezer/highlight': 1.2.0 + '@lezer/lr': 1.4.0 + + '@lezer/json@1.0.2': + dependencies: + '@lezer/common': 1.2.1 + '@lezer/highlight': 1.2.0 + '@lezer/lr': 1.4.0 + + '@lezer/lr@1.4.0': + dependencies: + '@lezer/common': 1.2.1 + '@nodelib/fs.scandir@2.1.5': dependencies: '@nodelib/fs.stat': 2.0.5 @@ -6400,6 +6567,18 @@ snapshots: clone@2.1.2: {} + codemirror@6.0.1(@lezer/common@1.2.1): + dependencies: + '@codemirror/autocomplete': 6.16.0(@codemirror/language@6.10.1)(@codemirror/state@6.4.1)(@codemirror/view@6.26.3)(@lezer/common@1.2.1) + '@codemirror/commands': 6.5.0 + '@codemirror/language': 6.10.1 + '@codemirror/lint': 6.6.0 + '@codemirror/search': 6.5.6 + '@codemirror/state': 6.4.1 + '@codemirror/view': 6.26.3 + transitivePeerDependencies: + - '@lezer/common' + collection-visit@1.0.0: dependencies: map-visit: 1.0.0 @@ -6475,6 +6654,8 @@ snapshots: object-assign: 4.1.1 vary: 1.1.2 + crelt@1.0.6: {} + cron-parser@4.9.0: dependencies: luxon: 3.4.4 @@ -9261,6 +9442,8 @@ snapshots: strip-json-comments@5.0.1: {} + style-mod@4.1.2: {} + supports-color@2.0.0: {} supports-color@3.2.3: @@ -9717,6 +9900,15 @@ snapshots: evtd: 0.2.4 vue: 3.4.25(typescript@5.4.5) + vue-codemirror6@1.3.0(@lezer/common@1.2.1)(vue@3.4.25(typescript@5.4.5)): + dependencies: + codemirror: 6.0.1(@lezer/common@1.2.1) + vue: 3.4.25(typescript@5.4.5) + vue-demi: 0.14.7(vue@3.4.25(typescript@5.4.5)) + transitivePeerDependencies: + - '@lezer/common' + - '@vue/composition-api' + vue-demi@0.13.11(vue@3.4.25(typescript@5.4.5)): dependencies: vue: 3.4.25(typescript@5.4.5) @@ -9787,6 +9979,8 @@ snapshots: vooks: 0.2.12(vue@3.4.25(typescript@5.4.5)) vue: 3.4.25(typescript@5.4.5) + w3c-keyname@2.2.8: {} + webpack-sources@3.2.3: {} webpack-virtual-modules@0.6.1: {} diff --git a/src/components/common/code-mirror.vue b/src/components/common/code-mirror.vue new file mode 100644 index 0000000..c5be5ef --- /dev/null +++ b/src/components/common/code-mirror.vue @@ -0,0 +1,124 @@ + + + diff --git a/src/components/common/operate-drawer.vue b/src/components/common/operate-drawer.vue index 043d634..b9bddf6 100644 --- a/src/components/common/operate-drawer.vue +++ b/src/components/common/operate-drawer.vue @@ -69,7 +69,7 @@ const onUpdateShow = (value: boolean) => {