@mnykj/alleditor-vue 0.0.0-stage → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +51 -2
- package/nuxt.ts +67 -0
- package/package.json +62 -4
- package/scripts/sync-ueditor.mjs +28 -0
- package/src/AllEditor.vue +653 -0
- package/src/DualEditor.vue +7 -0
- package/src/UeHtmlEngine.vue +438 -0
- package/src/assets/iconfont/iconfont.css +27 -0
- package/src/assets/iconfont/iconfont.ttf +0 -0
- package/src/assets/iconfont/iconfont.woff +0 -0
- package/src/assets/iconfont/iconfont.woff2 +0 -0
- package/src/defaultToolbar.ts +115 -0
- package/src/importMenus.ts +158 -0
- package/src/index.ts +58 -0
- package/src/markdown.ts +46 -0
- package/src/stripJavascriptFromHtml.ts +28 -0
- package/src/ueToolbar.ts +257 -0
- package/src/ueditorBase.ts +2 -0
- package/src/ueditorPaths.ts +11 -0
- package/ueditor/dialogs/anchor/anchor.html +40 -0
- package/ueditor/dialogs/attachment/attachment.css +681 -0
- package/ueditor/dialogs/attachment/attachment.html +60 -0
- package/ueditor/dialogs/attachment/attachment.js +760 -0
- package/ueditor/dialogs/attachment/fileTypeImages/icon_chm.gif +0 -0
- package/ueditor/dialogs/attachment/fileTypeImages/icon_default.png +0 -0
- package/ueditor/dialogs/attachment/fileTypeImages/icon_doc.gif +0 -0
- package/ueditor/dialogs/attachment/fileTypeImages/icon_exe.gif +0 -0
- package/ueditor/dialogs/attachment/fileTypeImages/icon_jpg.gif +0 -0
- package/ueditor/dialogs/attachment/fileTypeImages/icon_mp3.gif +0 -0
- package/ueditor/dialogs/attachment/fileTypeImages/icon_mv.gif +0 -0
- package/ueditor/dialogs/attachment/fileTypeImages/icon_pdf.gif +0 -0
- package/ueditor/dialogs/attachment/fileTypeImages/icon_ppt.gif +0 -0
- package/ueditor/dialogs/attachment/fileTypeImages/icon_psd.gif +0 -0
- package/ueditor/dialogs/attachment/fileTypeImages/icon_rar.gif +0 -0
- package/ueditor/dialogs/attachment/fileTypeImages/icon_txt.gif +0 -0
- package/ueditor/dialogs/attachment/fileTypeImages/icon_xls.gif +0 -0
- package/ueditor/dialogs/attachment/images/alignicon.gif +0 -0
- package/ueditor/dialogs/attachment/images/alignicon.png +0 -0
- package/ueditor/dialogs/attachment/images/bg.png +0 -0
- package/ueditor/dialogs/attachment/images/file-icons.gif +0 -0
- package/ueditor/dialogs/attachment/images/file-icons.png +0 -0
- package/ueditor/dialogs/attachment/images/icons.gif +0 -0
- package/ueditor/dialogs/attachment/images/icons.png +0 -0
- package/ueditor/dialogs/attachment/images/image.png +0 -0
- package/ueditor/dialogs/attachment/images/progress.png +0 -0
- package/ueditor/dialogs/attachment/images/success.gif +0 -0
- package/ueditor/dialogs/attachment/images/success.png +0 -0
- package/ueditor/dialogs/background/background.css +94 -0
- package/ueditor/dialogs/background/background.html +56 -0
- package/ueditor/dialogs/background/background.js +376 -0
- package/ueditor/dialogs/background/images/bg.png +0 -0
- package/ueditor/dialogs/background/images/success.png +0 -0
- package/ueditor/dialogs/charts/chart.config.js +65 -0
- package/ueditor/dialogs/charts/charts.css +165 -0
- package/ueditor/dialogs/charts/charts.html +89 -0
- package/ueditor/dialogs/charts/charts.js +519 -0
- package/ueditor/dialogs/charts/images/charts0.png +0 -0
- package/ueditor/dialogs/charts/images/charts1.png +0 -0
- package/ueditor/dialogs/charts/images/charts2.png +0 -0
- package/ueditor/dialogs/charts/images/charts3.png +0 -0
- package/ueditor/dialogs/charts/images/charts4.png +0 -0
- package/ueditor/dialogs/charts/images/charts5.png +0 -0
- package/ueditor/dialogs/emotion/emotion.css +43 -0
- package/ueditor/dialogs/emotion/emotion.html +54 -0
- package/ueditor/dialogs/emotion/emotion.js +186 -0
- package/ueditor/dialogs/emotion/images/0.gif +0 -0
- package/ueditor/dialogs/emotion/images/bface.gif +0 -0
- package/ueditor/dialogs/emotion/images/cface.gif +0 -0
- package/ueditor/dialogs/emotion/images/fface.gif +0 -0
- package/ueditor/dialogs/emotion/images/jxface2.gif +0 -0
- package/ueditor/dialogs/emotion/images/neweditor-tab-bg.png +0 -0
- package/ueditor/dialogs/emotion/images/tface.gif +0 -0
- package/ueditor/dialogs/emotion/images/wface.gif +0 -0
- package/ueditor/dialogs/emotion/images/yface.gif +0 -0
- package/ueditor/dialogs/gmap/gmap.html +89 -0
- package/ueditor/dialogs/help/help.css +7 -0
- package/ueditor/dialogs/help/help.html +82 -0
- package/ueditor/dialogs/help/help.js +56 -0
- package/ueditor/dialogs/image/image.css +894 -0
- package/ueditor/dialogs/image/image.html +120 -0
- package/ueditor/dialogs/image/image.js +1123 -0
- package/ueditor/dialogs/image/images/alignicon.jpg +0 -0
- package/ueditor/dialogs/image/images/bg.png +0 -0
- package/ueditor/dialogs/image/images/icons.gif +0 -0
- package/ueditor/dialogs/image/images/icons.png +0 -0
- package/ueditor/dialogs/image/images/image.png +0 -0
- package/ueditor/dialogs/image/images/progress.png +0 -0
- package/ueditor/dialogs/image/images/success.gif +0 -0
- package/ueditor/dialogs/image/images/success.png +0 -0
- package/ueditor/dialogs/insertframe/insertframe.html +98 -0
- package/ueditor/dialogs/internal.js +81 -0
- package/ueditor/dialogs/link/link.html +132 -0
- package/ueditor/dialogs/map/map.html +135 -0
- package/ueditor/dialogs/map/show.html +118 -0
- package/ueditor/dialogs/music/music.css +30 -0
- package/ueditor/dialogs/music/music.html +32 -0
- package/ueditor/dialogs/music/music.js +192 -0
- package/ueditor/dialogs/preview/preview.html +40 -0
- package/ueditor/dialogs/scrawl/images/addimg.png +0 -0
- package/ueditor/dialogs/scrawl/images/brush.png +0 -0
- package/ueditor/dialogs/scrawl/images/delimg.png +0 -0
- package/ueditor/dialogs/scrawl/images/delimgH.png +0 -0
- package/ueditor/dialogs/scrawl/images/empty.png +0 -0
- package/ueditor/dialogs/scrawl/images/emptyH.png +0 -0
- package/ueditor/dialogs/scrawl/images/eraser.png +0 -0
- package/ueditor/dialogs/scrawl/images/redo.png +0 -0
- package/ueditor/dialogs/scrawl/images/redoH.png +0 -0
- package/ueditor/dialogs/scrawl/images/scale.png +0 -0
- package/ueditor/dialogs/scrawl/images/scaleH.png +0 -0
- package/ueditor/dialogs/scrawl/images/size.png +0 -0
- package/ueditor/dialogs/scrawl/images/undo.png +0 -0
- package/ueditor/dialogs/scrawl/images/undoH.png +0 -0
- package/ueditor/dialogs/scrawl/scrawl.css +72 -0
- package/ueditor/dialogs/scrawl/scrawl.html +95 -0
- package/ueditor/dialogs/scrawl/scrawl.js +670 -0
- package/ueditor/dialogs/searchreplace/searchreplace.html +102 -0
- package/ueditor/dialogs/searchreplace/searchreplace.js +170 -0
- package/ueditor/dialogs/snapscreen/snapscreen.html +58 -0
- package/ueditor/dialogs/spechars/spechars.html +21 -0
- package/ueditor/dialogs/spechars/spechars.js +57 -0
- package/ueditor/dialogs/table/dragicon.png +0 -0
- package/ueditor/dialogs/table/edittable.css +84 -0
- package/ueditor/dialogs/table/edittable.html +64 -0
- package/ueditor/dialogs/table/edittable.js +237 -0
- package/ueditor/dialogs/table/edittd.html +61 -0
- package/ueditor/dialogs/table/edittip.html +33 -0
- package/ueditor/dialogs/template/config.js +42 -0
- package/ueditor/dialogs/template/images/bg.gif +0 -0
- package/ueditor/dialogs/template/images/pre0.png +0 -0
- package/ueditor/dialogs/template/images/pre1.png +0 -0
- package/ueditor/dialogs/template/images/pre2.png +0 -0
- package/ueditor/dialogs/template/images/pre3.png +0 -0
- package/ueditor/dialogs/template/images/pre4.png +0 -0
- package/ueditor/dialogs/template/template.css +18 -0
- package/ueditor/dialogs/template/template.html +26 -0
- package/ueditor/dialogs/template/template.js +53 -0
- package/ueditor/dialogs/video/images/bg.png +0 -0
- package/ueditor/dialogs/video/images/center_focus.jpg +0 -0
- package/ueditor/dialogs/video/images/file-icons.gif +0 -0
- package/ueditor/dialogs/video/images/file-icons.png +0 -0
- package/ueditor/dialogs/video/images/icons.gif +0 -0
- package/ueditor/dialogs/video/images/icons.png +0 -0
- package/ueditor/dialogs/video/images/image.png +0 -0
- package/ueditor/dialogs/video/images/left_focus.jpg +0 -0
- package/ueditor/dialogs/video/images/none_focus.jpg +0 -0
- package/ueditor/dialogs/video/images/progress.png +0 -0
- package/ueditor/dialogs/video/images/right_focus.jpg +0 -0
- package/ueditor/dialogs/video/images/success.gif +0 -0
- package/ueditor/dialogs/video/images/success.png +0 -0
- package/ueditor/dialogs/video/video.css +635 -0
- package/ueditor/dialogs/video/video.html +86 -0
- package/ueditor/dialogs/video/video.js +791 -0
- package/ueditor/dialogs/webapp/webapp.html +53 -0
- package/ueditor/dialogs/wordimage/fClipboard_ueditor.swf +0 -0
- package/ueditor/dialogs/wordimage/imageUploader.swf +0 -0
- package/ueditor/dialogs/wordimage/tangram.js +1495 -0
- package/ueditor/dialogs/wordimage/wordimage.html +111 -0
- package/ueditor/dialogs/wordimage/wordimage.js +157 -0
- package/ueditor/lang/en/en.js +684 -0
- package/ueditor/lang/en/images/addimage.png +0 -0
- package/ueditor/lang/en/images/alldeletebtnhoverskin.png +0 -0
- package/ueditor/lang/en/images/alldeletebtnupskin.png +0 -0
- package/ueditor/lang/en/images/background.png +0 -0
- package/ueditor/lang/en/images/button.png +0 -0
- package/ueditor/lang/en/images/copy.png +0 -0
- package/ueditor/lang/en/images/deletedisable.png +0 -0
- package/ueditor/lang/en/images/deleteenable.png +0 -0
- package/ueditor/lang/en/images/listbackground.png +0 -0
- package/ueditor/lang/en/images/localimage.png +0 -0
- package/ueditor/lang/en/images/music.png +0 -0
- package/ueditor/lang/en/images/rotateleftdisable.png +0 -0
- package/ueditor/lang/en/images/rotateleftenable.png +0 -0
- package/ueditor/lang/en/images/rotaterightdisable.png +0 -0
- package/ueditor/lang/en/images/rotaterightenable.png +0 -0
- package/ueditor/lang/en/images/upload.png +0 -0
- package/ueditor/lang/zh-cn/images/copy.png +0 -0
- package/ueditor/lang/zh-cn/images/localimage.png +0 -0
- package/ueditor/lang/zh-cn/images/music.png +0 -0
- package/ueditor/lang/zh-cn/images/upload.png +0 -0
- package/ueditor/lang/zh-cn/zh-cn.js +669 -0
- package/ueditor/official-demo.html +175 -0
- package/ueditor/themes/default/css/ueditor.css +1906 -0
- package/ueditor/themes/default/css/ueditor.min.css +8 -0
- package/ueditor/themes/default/dialogbase.css +100 -0
- package/ueditor/themes/default/images/anchor.gif +0 -0
- package/ueditor/themes/default/images/arrow.png +0 -0
- package/ueditor/themes/default/images/arrow_down.png +0 -0
- package/ueditor/themes/default/images/arrow_up.png +0 -0
- package/ueditor/themes/default/images/button-bg.gif +0 -0
- package/ueditor/themes/default/images/cancelbutton.gif +0 -0
- package/ueditor/themes/default/images/charts.png +0 -0
- package/ueditor/themes/default/images/cursor_h.gif +0 -0
- package/ueditor/themes/default/images/cursor_h.png +0 -0
- package/ueditor/themes/default/images/cursor_v.gif +0 -0
- package/ueditor/themes/default/images/cursor_v.png +0 -0
- package/ueditor/themes/default/images/dialog-title-bg.png +0 -0
- package/ueditor/themes/default/images/filescan.png +0 -0
- package/ueditor/themes/default/images/highlighted.gif +0 -0
- package/ueditor/themes/default/images/icons-all.gif +0 -0
- package/ueditor/themes/default/images/icons.gif +0 -0
- package/ueditor/themes/default/images/icons.png +0 -0
- package/ueditor/themes/default/images/img-cracked.png +0 -0
- package/ueditor/themes/default/images/loaderror.png +0 -0
- package/ueditor/themes/default/images/loading.gif +0 -0
- package/ueditor/themes/default/images/lock.gif +0 -0
- package/ueditor/themes/default/images/neweditor-tab-bg.png +0 -0
- package/ueditor/themes/default/images/pagebreak.gif +0 -0
- package/ueditor/themes/default/images/scale.png +0 -0
- package/ueditor/themes/default/images/sortable.png +0 -0
- package/ueditor/themes/default/images/spacer.gif +0 -0
- package/ueditor/themes/default/images/sparator_v.png +0 -0
- package/ueditor/themes/default/images/table-cell-align.png +0 -0
- package/ueditor/themes/default/images/tangram-colorpicker.png +0 -0
- package/ueditor/themes/default/images/toolbar_bg.png +0 -0
- package/ueditor/themes/default/images/unhighlighted.gif +0 -0
- package/ueditor/themes/default/images/upload.png +0 -0
- package/ueditor/themes/default/images/videologo.gif +0 -0
- package/ueditor/themes/default/images/word.gif +0 -0
- package/ueditor/themes/default/images/wordpaste.png +0 -0
- package/ueditor/themes/iframe.css +1 -0
- package/ueditor/third-party/SyntaxHighlighter/shCore.js +3655 -0
- package/ueditor/third-party/SyntaxHighlighter/shCoreDefault.css +1 -0
- package/ueditor/third-party/codemirror/codemirror.css +104 -0
- package/ueditor/third-party/codemirror/codemirror.js +3581 -0
- package/ueditor/third-party/highcharts/adapters/mootools-adapter.js +13 -0
- package/ueditor/third-party/highcharts/adapters/mootools-adapter.src.js +313 -0
- package/ueditor/third-party/highcharts/adapters/prototype-adapter.js +15 -0
- package/ueditor/third-party/highcharts/adapters/prototype-adapter.src.js +316 -0
- package/ueditor/third-party/highcharts/adapters/standalone-framework.js +17 -0
- package/ueditor/third-party/highcharts/adapters/standalone-framework.src.js +583 -0
- package/ueditor/third-party/highcharts/highcharts-more.js +50 -0
- package/ueditor/third-party/highcharts/highcharts-more.src.js +2430 -0
- package/ueditor/third-party/highcharts/highcharts.js +283 -0
- package/ueditor/third-party/highcharts/highcharts.src.js +16974 -0
- package/ueditor/third-party/highcharts/modules/annotations.js +7 -0
- package/ueditor/third-party/highcharts/modules/annotations.src.js +401 -0
- package/ueditor/third-party/highcharts/modules/canvas-tools.js +133 -0
- package/ueditor/third-party/highcharts/modules/canvas-tools.src.js +3113 -0
- package/ueditor/third-party/highcharts/modules/data.js +17 -0
- package/ueditor/third-party/highcharts/modules/data.src.js +582 -0
- package/ueditor/third-party/highcharts/modules/drilldown.js +11 -0
- package/ueditor/third-party/highcharts/modules/drilldown.src.js +447 -0
- package/ueditor/third-party/highcharts/modules/exporting.js +22 -0
- package/ueditor/third-party/highcharts/modules/exporting.src.js +709 -0
- package/ueditor/third-party/highcharts/modules/funnel.js +12 -0
- package/ueditor/third-party/highcharts/modules/funnel.src.js +289 -0
- package/ueditor/third-party/highcharts/modules/heatmap.js +1 -0
- package/ueditor/third-party/highcharts/modules/heatmap.src.js +53 -0
- package/ueditor/third-party/highcharts/modules/map.js +27 -0
- package/ueditor/third-party/highcharts/modules/map.src.js +1002 -0
- package/ueditor/third-party/highcharts/modules/no-data-to-display.js +12 -0
- package/ueditor/third-party/highcharts/modules/no-data-to-display.src.js +128 -0
- package/ueditor/third-party/highcharts/themes/dark-blue.js +254 -0
- package/ueditor/third-party/highcharts/themes/dark-green.js +255 -0
- package/ueditor/third-party/highcharts/themes/gray.js +257 -0
- package/ueditor/third-party/highcharts/themes/grid.js +103 -0
- package/ueditor/third-party/highcharts/themes/skies.js +89 -0
- package/ueditor/third-party/jquery-1.10.2.js +9789 -0
- package/ueditor/third-party/jquery-1.10.2.min.js +6 -0
- package/ueditor/third-party/jquery-1.10.2.min.map +1 -0
- package/ueditor/third-party/snapscreen/UEditorSnapscreen.exe +0 -0
- package/ueditor/third-party/video-js/font/vjs.eot +0 -0
- package/ueditor/third-party/video-js/font/vjs.svg +65 -0
- package/ueditor/third-party/video-js/font/vjs.ttf +0 -0
- package/ueditor/third-party/video-js/font/vjs.woff +0 -0
- package/ueditor/third-party/video-js/video-js.css +766 -0
- package/ueditor/third-party/video-js/video-js.min.css +5 -0
- package/ueditor/third-party/video-js/video-js.swf +0 -0
- package/ueditor/third-party/video-js/video.dev.js +7108 -0
- package/ueditor/third-party/video-js/video.js +129 -0
- package/ueditor/third-party/webuploader/Uploader.swf +0 -0
- package/ueditor/third-party/webuploader/webuploader.css +28 -0
- package/ueditor/third-party/webuploader/webuploader.custom.js +5670 -0
- package/ueditor/third-party/webuploader/webuploader.custom.min.js +2 -0
- package/ueditor/third-party/webuploader/webuploader.flashonly.js +4176 -0
- package/ueditor/third-party/webuploader/webuploader.flashonly.min.js +2 -0
- package/ueditor/third-party/webuploader/webuploader.html5only.js +5559 -0
- package/ueditor/third-party/webuploader/webuploader.html5only.min.js +2 -0
- package/ueditor/third-party/webuploader/webuploader.js +6733 -0
- package/ueditor/third-party/webuploader/webuploader.min.js +2 -0
- package/ueditor/third-party/webuploader/webuploader.withoutimage.js +4593 -0
- package/ueditor/third-party/webuploader/webuploader.withoutimage.min.js +2 -0
- package/ueditor/third-party/zeroclipboard/ZeroClipboard.js +1256 -0
- package/ueditor/third-party/zeroclipboard/ZeroClipboard.min.js +9 -0
- package/ueditor/third-party/zeroclipboard/ZeroClipboard.swf +0 -0
- package/ueditor/ueditor.all.js +32931 -0
- package/ueditor/ueditor.all.min.js +17 -0
- package/ueditor/ueditor.config.js +507 -0
- package/ueditor/ueditor.parse.js +1230 -0
- package/ueditor/ueditor.parse.min.js +5 -0
- package/vite.ts +87 -0
package/README.md
CHANGED
|
@@ -1,3 +1,52 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @mnykj/alleditor-vue
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
AllEditor 桌面 Web 壳(wang + UE)。与 `@mnykj/alleditor@1.3.0` **同版本锁步**(本包 `dependencies` 为精确版本,不是 `^`)。
|
|
4
|
+
|
|
5
|
+
## 安装
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm i @mnykj/alleditor-vue
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
会自动装上匹配的 `@mnykj/alleditor` 与 `@mnykj/alleditor-for-vue`。
|
|
12
|
+
|
|
13
|
+
> 说明:npm 上历史包名 `@mnykj/alleditor-core` 是旧 slate 内核,已在本仓库改名为 `@mnykj/alleditor-core`。消费侧「引擎」请用 `@mnykj/alleditor`。
|
|
14
|
+
|
|
15
|
+
## Nuxt
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
export default defineNuxtConfig({
|
|
19
|
+
modules: ['@mnykj/alleditor-vue/nuxt'],
|
|
20
|
+
})
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
若应用已有精确路由 `/ueditor`(演示页),不要挂本模块;改用 Nitro server 路由托管包内 `ueditor/`,避免 `publicAssets` 抢路由。
|
|
24
|
+
|
|
25
|
+
## Vite
|
|
26
|
+
|
|
27
|
+
```ts
|
|
28
|
+
import { alleditorUeditor } from '@mnykj/alleditor-vue/vite'
|
|
29
|
+
plugins: [alleditorUeditor()]
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## 用法
|
|
33
|
+
|
|
34
|
+
```vue
|
|
35
|
+
<script setup>
|
|
36
|
+
import { AllEditor } from '@mnykj/alleditor-vue'
|
|
37
|
+
import '@mnykj/alleditor/dist/css/style.css'
|
|
38
|
+
</script>
|
|
39
|
+
|
|
40
|
+
<template>
|
|
41
|
+
<AllEditor v-model="html" style="height: 500px" />
|
|
42
|
+
</template>
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
`DualEditor` 仍可作为别名导入,但请迁移到 `AllEditor`。
|
|
46
|
+
|
|
47
|
+
插槽(工作台等场景):
|
|
48
|
+
|
|
49
|
+
- `#aside`:侧栏大纲
|
|
50
|
+
- `#main-before` / `#main-after`:主栏前后(打开目录按钮、右键菜单等)
|
|
51
|
+
|
|
52
|
+
属性:`showToolbar`、`showWorkarea`、`mainClass`。
|
package/nuxt.ts
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Nuxt 模块:自动把包内 ueditor 挂到 /ueditor/(开发 + 生产 publicAssets)。
|
|
3
|
+
*
|
|
4
|
+
* // nuxt.config.ts
|
|
5
|
+
* export default defineNuxtConfig({
|
|
6
|
+
* modules: ['@mnykj/alleditor-vue/nuxt'],
|
|
7
|
+
* })
|
|
8
|
+
*
|
|
9
|
+
* 注意:若应用已有精确路由 `/ueditor`(如演示页),请勿用本模块,
|
|
10
|
+
* 改用 server 路由托管包内静态资源,避免 publicAssets 抢路由。
|
|
11
|
+
*
|
|
12
|
+
* `@nuxt/kit` 从消费方项目解析(file: 联接时本包目录下没有该依赖)。
|
|
13
|
+
*/
|
|
14
|
+
import { createRequire } from 'node:module'
|
|
15
|
+
import { existsSync } from 'node:fs'
|
|
16
|
+
import { join } from 'node:path'
|
|
17
|
+
import { DEFAULT_UEDITOR_PUBLIC_BASE, getUeditorPackageDir } from './src/ueditorPaths'
|
|
18
|
+
|
|
19
|
+
const requireFromApp = createRequire(join(process.cwd(), 'package.json'))
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
21
|
+
const { defineNuxtModule } = requireFromApp('@nuxt/kit') as typeof import('@nuxt/kit')
|
|
22
|
+
|
|
23
|
+
export interface ModuleOptions {
|
|
24
|
+
/** 浏览器访问前缀,默认 /ueditor */
|
|
25
|
+
baseURL?: string
|
|
26
|
+
/** 是否启用,默认 true */
|
|
27
|
+
enabled?: boolean
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export default defineNuxtModule<ModuleOptions>({
|
|
31
|
+
meta: {
|
|
32
|
+
name: '@mnykj/alleditor-vue',
|
|
33
|
+
configKey: 'alleditorVue',
|
|
34
|
+
},
|
|
35
|
+
defaults: {
|
|
36
|
+
baseURL: 'ueditor',
|
|
37
|
+
enabled: true,
|
|
38
|
+
},
|
|
39
|
+
setup(options, nuxt) {
|
|
40
|
+
if (options.enabled === false) return
|
|
41
|
+
const dir = getUeditorPackageDir()
|
|
42
|
+
if (!existsSync(join(dir, 'ueditor.all.min.js'))) {
|
|
43
|
+
console.warn('[alleditor-vue] 包内缺少 ueditor 资源:', dir)
|
|
44
|
+
return
|
|
45
|
+
}
|
|
46
|
+
const baseURL = String(options.baseURL || 'ueditor').replace(/^\/+|\/+$/g, '')
|
|
47
|
+
nuxt.options.nitro = nuxt.options.nitro || {}
|
|
48
|
+
nuxt.options.nitro.publicAssets = nuxt.options.nitro.publicAssets || []
|
|
49
|
+
nuxt.options.nitro.publicAssets.push({
|
|
50
|
+
baseURL,
|
|
51
|
+
dir,
|
|
52
|
+
maxAge: 60 * 60 * 24 * 7,
|
|
53
|
+
})
|
|
54
|
+
nuxt.options.vite = nuxt.options.vite || {}
|
|
55
|
+
nuxt.options.vite.server = nuxt.options.vite.server || {}
|
|
56
|
+
nuxt.options.vite.server.fs = nuxt.options.vite.server.fs || {}
|
|
57
|
+
const allow = new Set([
|
|
58
|
+
...((nuxt.options.vite.server.fs.allow as string[]) || []),
|
|
59
|
+
dir,
|
|
60
|
+
])
|
|
61
|
+
nuxt.options.vite.server.fs.allow = [...allow]
|
|
62
|
+
|
|
63
|
+
nuxt.options.runtimeConfig.public = nuxt.options.runtimeConfig.public || {}
|
|
64
|
+
;(nuxt.options.runtimeConfig.public as any).alleditorUeditorBase =
|
|
65
|
+
`/${baseURL}/` || DEFAULT_UEDITOR_PUBLIC_BASE
|
|
66
|
+
},
|
|
67
|
+
})
|
package/package.json
CHANGED
|
@@ -1,6 +1,64 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mnykj/alleditor-vue",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.3.1",
|
|
4
|
+
"description": "AllEditor Vue3 desktop shell (wang + UE). Lockstep with @mnykj/alleditor.",
|
|
5
|
+
"author": "mnykj",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"main": "./src/index.ts",
|
|
9
|
+
"module": "./src/index.ts",
|
|
10
|
+
"types": "./src/index.ts",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": "./src/index.ts",
|
|
13
|
+
"./UeHtmlEngine.vue": "./src/UeHtmlEngine.vue",
|
|
14
|
+
"./AllEditor.vue": "./src/AllEditor.vue",
|
|
15
|
+
"./DualEditor.vue": "./src/AllEditor.vue",
|
|
16
|
+
"./vite": "./vite.ts",
|
|
17
|
+
"./nuxt": "./nuxt.ts",
|
|
18
|
+
"./ueditor/*": "./ueditor/*",
|
|
19
|
+
"./iconfont.css": "./src/assets/iconfont/iconfont.css"
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"src",
|
|
23
|
+
"ueditor",
|
|
24
|
+
"vite.ts",
|
|
25
|
+
"nuxt.ts",
|
|
26
|
+
"README.md",
|
|
27
|
+
"scripts"
|
|
28
|
+
],
|
|
29
|
+
"keywords": [
|
|
30
|
+
"AllEditor",
|
|
31
|
+
"alleditor",
|
|
32
|
+
"alleditor-vue",
|
|
33
|
+
"ueditor",
|
|
34
|
+
"vue3",
|
|
35
|
+
"mnykj"
|
|
36
|
+
],
|
|
37
|
+
"publishConfig": {
|
|
38
|
+
"access": "public",
|
|
39
|
+
"registry": "https://registry.npmjs.org/"
|
|
40
|
+
},
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"@mnykj/alleditor": "1.3.1",
|
|
43
|
+
"@mnykj/alleditor-for-vue": "1.3.1",
|
|
44
|
+
"markdown-it": "^14.3.3"
|
|
45
|
+
},
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"@nuxt/kit": ">=3",
|
|
48
|
+
"vite": ">=4",
|
|
49
|
+
"vue": "^3.0.5"
|
|
50
|
+
},
|
|
51
|
+
"peerDependenciesMeta": {
|
|
52
|
+
"vite": {
|
|
53
|
+
"optional": true
|
|
54
|
+
},
|
|
55
|
+
"@nuxt/kit": {
|
|
56
|
+
"optional": true
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"scripts": {
|
|
60
|
+
"sync:ueditor": "node ./scripts/sync-ueditor.mjs",
|
|
61
|
+
"prepack": "node ./scripts/sync-ueditor.mjs",
|
|
62
|
+
"build": "node -e \"console.log('@mnykj/alleditor-vue ships Vue/TS source + ueditor assets; no bundle step')\""
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 从 monorepo 的 other_editor/ueditor 构建产物同步到本包 ueditor/,便于发 npm。
|
|
3
|
+
* 若源不存在但包内已有资源,则跳过(方便纯发包场景)。
|
|
4
|
+
*/
|
|
5
|
+
import { cpSync, existsSync, mkdirSync, rmSync } from 'node:fs'
|
|
6
|
+
import { dirname, join, resolve } from 'node:path'
|
|
7
|
+
import { fileURLToPath } from 'node:url'
|
|
8
|
+
|
|
9
|
+
const dualRoot = resolve(dirname(fileURLToPath(import.meta.url)), '..')
|
|
10
|
+
const dest = join(dualRoot, 'ueditor')
|
|
11
|
+
const src = resolve(dualRoot, '../../../other_editor/ueditor/dist/utf8-php')
|
|
12
|
+
const destOk = existsSync(join(dest, 'ueditor.all.min.js'))
|
|
13
|
+
const srcOk = existsSync(join(src, 'ueditor.all.min.js'))
|
|
14
|
+
|
|
15
|
+
if (!srcOk) {
|
|
16
|
+
if (destOk) {
|
|
17
|
+
console.log('[sync-ueditor] 源不存在,保留包内已有 ueditor/', dest)
|
|
18
|
+
process.exit(0)
|
|
19
|
+
}
|
|
20
|
+
console.error('[sync-ueditor] 未找到源产物且包内无资源')
|
|
21
|
+
console.error(' 源:', join(src, 'ueditor.all.min.js'))
|
|
22
|
+
process.exit(1)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
rmSync(dest, { recursive: true, force: true })
|
|
26
|
+
mkdirSync(dest, { recursive: true })
|
|
27
|
+
cpSync(src, dest, { recursive: true })
|
|
28
|
+
console.log('[sync-ueditor] synced ->', dest)
|