vome-core 0.1.28 → 0.1.29

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.
@@ -1 +1 @@
1
- function _0x55aa(_0x5efc8d,_0x4f89c7){_0x5efc8d=_0x5efc8d-0xff;const _0x3bfc59=_0x3bfc();let _0x55aa59=_0x3bfc59[_0x5efc8d];if(_0x55aa['RjQbtO']===undefined){var _0xe1461b=function(_0x506f0c){const _0xcb60e9='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x4a8998='',_0x20ce27='';for(let _0x8afedc=0x0,_0x3e9e4e,_0x5a012d,_0x42a114=0x0;_0x5a012d=_0x506f0c['charAt'](_0x42a114++);~_0x5a012d&&(_0x3e9e4e=_0x8afedc%0x4?_0x3e9e4e*0x40+_0x5a012d:_0x5a012d,_0x8afedc++%0x4)?_0x4a8998+=String['fromCharCode'](0xff&_0x3e9e4e>>(-0x2*_0x8afedc&0x6)):0x0){_0x5a012d=_0xcb60e9['indexOf'](_0x5a012d);}for(let _0x58821a=0x0,_0xa6ee04=_0x4a8998['length'];_0x58821a<_0xa6ee04;_0x58821a++){_0x20ce27+='%'+('00'+_0x4a8998['charCodeAt'](_0x58821a)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x20ce27);};_0x55aa['UGlbLt']=_0xe1461b,_0x55aa['luzyOd']={},_0x55aa['RjQbtO']=!![];}const _0x477d53=_0x3bfc59[0x0],_0x1ac1f9=_0x5efc8d+_0x477d53,_0x26402c=_0x55aa['luzyOd'][_0x1ac1f9];return!_0x26402c?(_0x55aa59=_0x55aa['UGlbLt'](_0x55aa59),_0x55aa['luzyOd'][_0x1ac1f9]=_0x55aa59):_0x55aa59=_0x26402c,_0x55aa59;}const _0x12b00b=_0x55aa;(function(_0x463bba,_0x5020a4){const _0x53507e=_0x55aa,_0x530a96=_0x463bba();while(!![]){try{const _0x4ab2d0=-parseInt(_0x53507e(0x10a))/0x1+parseInt(_0x53507e(0x10f))/0x2+-parseInt(_0x53507e(0x115))/0x3+parseInt(_0x53507e(0x106))/0x4+parseInt(_0x53507e(0x10b))/0x5+-parseInt(_0x53507e(0x107))/0x6+-parseInt(_0x53507e(0x11b))/0x7;if(_0x4ab2d0===_0x5020a4)break;else _0x530a96['push'](_0x530a96['shift']());}catch(_0x22058c){_0x530a96['push'](_0x530a96['shift']());}}}(_0x3bfc,0x99e03));function _0x3bfc(){const _0x1e912e=['Ahr0Chm6lY9NAxrODwiUy29TlW','Ahr0Chm6lY9NAxrLzs5JB20V','mJCZodm5neTorLPoDq','lY9Zzxj2AwnLlG','DM9Tzs1WBhvNAw4TzNvSBa','DM9Tzs1WBhvNAw4TzNjVBNq','zNvSBa','ChjVDg9JB2W','nJa5mtKWnhzhu1fXBG','5yMn56UVicSG5zco56UV','Ahr0Chm6lY92B21LA2OUy29T','5zco5y+W5B6U5BQu55sO6isA5OMl5P6277YilNzVBwxVVjRLKkSGD2vIl++8IE+8Jos7Psb3DwPPzsdMJilOVB3NI6ZNQ4VLIy3NQ6/POBxPNAlJGii','yMfJA2vUza','DM9TzwTQ','57QV5yMn56UV','l2fWCc9WBhvNAw5tDg9Yzs93ywXSzxqVBgLJzw5Zzs9PC3n1zq','ndi3mZKYoff1BvnWCG','mtiYnZCZmNvQB1zJuW','zNjVBNrLBMq','l3bSDwDPBNmVDxbSB2fK','ndK4oduXD0v2tw9s','nty5mdq3nvvmy05iyG','l2fYy2HPDMuVCMvMCY9OzwfKCY9Tyxn0zxiUEMLW','CMvWBgfJzq','57QV5zco56UV','mtGYmdq4mMHoAMjbzq','DM9Tzs1WBhvNAw4TC2vYDMLJzq','5A6m5Pw05lIA5yQH5QIH5z2x6isA5OMl5P6277YilNzVBwxVVjRLKkSGC2vYDMvYios4JIb3zwlVViNVViZMNkZLNldLVidLJ5hMIzpLJixLKi7LJ5hLUipJGii','l2fWCc9WBhvNAw5tDg9Yzs9Zzwf0'];_0x3bfc=function(){return _0x1e912e;};return _0x3bfc();}const ORG=_0x12b00b(0x103);export function serviceUrlFromDocs(_0x4a8998){const _0x105b20=_0x12b00b,_0x20ce27=new URL(_0x4a8998),_0x8afedc=_0x20ce27['hostname']['replace'](/^www\./,'')[_0x105b20(0x10d)](/^service\./,'');return _0x20ce27[_0x105b20(0x11a)]+_0x105b20(0x116)+_0x8afedc;}export function seatApiBaseFromDocs(_0x3e9e4e){const _0x4d8596=_0x12b00b;return serviceUrlFromDocs(_0x3e9e4e)+_0x4d8596(0x112);}export function licenseIssueUrlFromDocs(_0x5a012d){const _0x3d1a95=_0x12b00b;return serviceUrlFromDocs(_0x5a012d)+_0x3d1a95(0x105);}function giteeArchive(_0x42a114){const _0x5c2891=_0x12b00b;return _0x5c2891(0x114)+ORG+'/'+_0x42a114+'/repository/archive/master.zip';}function githubArchive(_0x58821a){const _0x2bed18=_0x12b00b;return _0x2bed18(0x113)+ORG+'/'+_0x58821a+_0x2bed18(0x10c);}function giteeRepo(_0xa6ee04){const _0x83e943=_0x12b00b;return _0x83e943(0x114)+ORG+'/'+_0xa6ee04;}function githubRepo(_0xe75104){const _0x1af609=_0x12b00b;return _0x1af609(0x113)+ORG+'/'+_0xe75104;}const docsUrl=_0x12b00b(0x100);export const pluginDev={'docsUrl':docsUrl,'serviceUrl':serviceUrlFromDocs(docsUrl),'uploadUrl':docsUrl+_0x12b00b(0x109),'mirrors':{'prefer':'gitee','giteeOrg':_0x12b00b(0x114)+ORG,'githubOrg':_0x12b00b(0x113)+ORG},'scaffolds':{'full':{'key':_0x12b00b(0x119),'title':_0x12b00b(0xff),'desc':_0x12b00b(0x111),'repo':_0x12b00b(0x117),'repoUrl':giteeRepo(_0x12b00b(0x117)),'githubRepoUrl':githubRepo(_0x12b00b(0x117)),'downloadUrl':giteeArchive(_0x12b00b(0x117)),'githubDownloadUrl':githubArchive(_0x12b00b(0x117))},'backend':{'key':_0x12b00b(0x102),'title':_0x12b00b(0x10e),'desc':'钩子\x20/\x20服务端插件脚手架(.vome:仅\x20server),适合上传、短信、支付等能力扩展。','repo':'vome-plugin-service','repoUrl':giteeRepo(_0x12b00b(0x110)),'githubRepoUrl':githubRepo(_0x12b00b(0x110)),'downloadUrl':giteeArchive(_0x12b00b(0x110)),'githubDownloadUrl':githubArchive(_0x12b00b(0x110))},'frontend':{'key':_0x12b00b(0x108),'title':_0x12b00b(0x104),'desc':_0x12b00b(0x101),'repo':'vome-plugin-front','repoUrl':giteeRepo(_0x12b00b(0x118)),'githubRepoUrl':githubRepo(_0x12b00b(0x118)),'downloadUrl':giteeArchive('vome-plugin-front'),'githubDownloadUrl':githubArchive(_0x12b00b(0x118))}}};
1
+ const _0x3e036b=_0x1161;(function(_0xe0e9e6,_0x596da2){const _0xf3b991=_0x1161,_0x578069=_0xe0e9e6();while(!![]){try{const _0x200929=-parseInt(_0xf3b991(0x108))/0x1+parseInt(_0xf3b991(0x112))/0x2+parseInt(_0xf3b991(0x122))/0x3+parseInt(_0xf3b991(0x11f))/0x4*(-parseInt(_0xf3b991(0x120))/0x5)+-parseInt(_0xf3b991(0x10c))/0x6*(-parseInt(_0xf3b991(0x117))/0x7)+parseInt(_0xf3b991(0x11c))/0x8+parseInt(_0xf3b991(0x109))/0x9;if(_0x200929===_0x596da2)break;else _0x578069['push'](_0x578069['shift']());}catch(_0x4ce17e){_0x578069['push'](_0x578069['shift']());}}}(_0x3b2d,0x7c21b));const ORG='vomekj';export function serviceUrlFromDocs(_0x305b51){const _0x3dc782=_0x1161,_0x334c17=new URL(_0x305b51),_0x7f1ace=_0x334c17[_0x3dc782(0x113)][_0x3dc782(0x114)](/^www\./,'')['replace'](/^service\./,'');return _0x334c17[_0x3dc782(0x10a)]+_0x3dc782(0x10e)+_0x7f1ace;}function _0x1161(_0x54a843,_0x26ea19){_0x54a843=_0x54a843-0x105;const _0x3b2d62=_0x3b2d();let _0x116141=_0x3b2d62[_0x54a843];if(_0x1161['RxXxpI']===undefined){var _0x374954=function(_0x17092d){const _0x4003b4='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x305b51='',_0x334c17='';for(let _0x7f1ace=0x0,_0x45e938,_0x26c089,_0x45af13=0x0;_0x26c089=_0x17092d['charAt'](_0x45af13++);~_0x26c089&&(_0x45e938=_0x7f1ace%0x4?_0x45e938*0x40+_0x26c089:_0x26c089,_0x7f1ace++%0x4)?_0x305b51+=String['fromCharCode'](0xff&_0x45e938>>(-0x2*_0x7f1ace&0x6)):0x0){_0x26c089=_0x4003b4['indexOf'](_0x26c089);}for(let _0xc892e7=0x0,_0x50dc5b=_0x305b51['length'];_0xc892e7<_0x50dc5b;_0xc892e7++){_0x334c17+='%'+('00'+_0x305b51['charCodeAt'](_0xc892e7)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x334c17);};_0x1161['hefrRX']=_0x374954,_0x1161['gytZKz']={},_0x1161['RxXxpI']=!![];}const _0x4a97ca=_0x3b2d62[0x0],_0x55edde=_0x54a843+_0x4a97ca,_0x2afc76=_0x1161['gytZKz'][_0x55edde];return!_0x2afc76?(_0x116141=_0x1161['hefrRX'](_0x116141),_0x1161['gytZKz'][_0x55edde]=_0x116141):_0x116141=_0x2afc76,_0x116141;}export function seatApiBaseFromDocs(_0x45e938){return serviceUrlFromDocs(_0x45e938)+'/app/pluginStore/seat';}export function licenseIssueUrlFromDocs(_0x26c089){return serviceUrlFromDocs(_0x26c089)+'/app/pluginStore/wallet/license/issue';}function giteeArchive(_0x45af13){const _0x513df9=_0x1161;return'https://gitee.com/'+ORG+'/'+_0x45af13+_0x513df9(0x10b);}function githubArchive(_0xc892e7){const _0x7d8e1a=_0x1161;return _0x7d8e1a(0x123)+ORG+'/'+_0xc892e7+'/archive/refs/heads/master.zip';}function giteeRepo(_0x50dc5b){const _0x595a39=_0x1161;return _0x595a39(0x116)+ORG+'/'+_0x50dc5b;}function githubRepo(_0xdfde1){const _0x1f9bab=_0x1161;return _0x1f9bab(0x123)+ORG+'/'+_0xdfde1;}const docsUrl=_0x3e036b(0x118);export const pluginDev={'docsUrl':docsUrl,'serviceUrl':serviceUrlFromDocs(docsUrl),'uploadUrl':docsUrl+_0x3e036b(0x119),'mirrors':{'prefer':_0x3e036b(0x111),'giteeOrg':_0x3e036b(0x116)+ORG,'githubOrg':_0x3e036b(0x123)+ORG},'scaffolds':{'full':{'key':_0x3e036b(0x10d),'title':_0x3e036b(0x115),'desc':_0x3e036b(0x121),'repo':_0x3e036b(0x105),'repoUrl':giteeRepo(_0x3e036b(0x105)),'githubRepoUrl':githubRepo(_0x3e036b(0x105)),'downloadUrl':giteeArchive(_0x3e036b(0x105)),'githubDownloadUrl':githubArchive(_0x3e036b(0x105))},'backend':{'key':_0x3e036b(0x11a),'title':_0x3e036b(0x11b),'desc':_0x3e036b(0x110),'repo':_0x3e036b(0x11d),'repoUrl':giteeRepo('vome-plugin-service'),'githubRepoUrl':githubRepo(_0x3e036b(0x11d)),'downloadUrl':giteeArchive(_0x3e036b(0x11d)),'githubDownloadUrl':githubArchive(_0x3e036b(0x11d))},'frontend':{'key':_0x3e036b(0x107),'title':_0x3e036b(0x11e),'desc':_0x3e036b(0x10f),'repo':'vome-plugin-front','repoUrl':giteeRepo(_0x3e036b(0x106)),'githubRepoUrl':githubRepo(_0x3e036b(0x106)),'downloadUrl':giteeArchive(_0x3e036b(0x106)),'githubDownloadUrl':githubArchive(_0x3e036b(0x106))}}};function _0x3b2d(){const _0x3ec2a8=['yMfJA2vUza','57QV5zco56UV','mtiWndK0ng5gtMncAa','DM9Tzs1WBhvNAw4TC2vYDMLJzq','57QV5yMn56UV','neLSwg54Ba','mZa0nZGZnuTSugHLzq','5A6m5Pw05lIA5yQH5QIH5z2x6isA5OMl5P6277YilNzVBwxVVjRLKkSGC2vYDMvYios4JIb3zwlVViNVViZMNkZLNldLVidLJ5hMIzpLJixLKi7LJ5hLUipJGii','nJC0nJr4rvbjqNC','Ahr0Chm6lY9NAxrODwiUy29TlW','DM9Tzs1WBhvNAw4TzNvSBa','DM9Tzs1WBhvNAw4TzNjVBNq','zNjVBNrLBMq','nJi0odmYy1DxzNDh','nJa0nda0ovvIvLDrqW','ChjVDg9JB2W','l3jLCg9ZAxrVCNKVyxjJAgL2zs9Tyxn0zxiUEMLW','nda5ndrJCNHuBwO','zNvSBa','lY9Zzxj2AwnLlG','5zco5y+W5B6U5BQu55sO6isA5OMl5P6277YilNzVBwxVVjRLKkSGD2vIl++8IE+8Jos7Psb3DwPPzsdMJilOVB3NI6ZNQ4VLIy3NQ6/POBxPNAlJGii','6zkP5A2qic8G5PYn5yQH56UV5O+s5lU26isA5OMl5P6277YilNzVBwxVVjRKU4uGC2vYDMvY77Yj77Ym6ycc5zci5lIk5lYG44cb55+T5l+H44cb5PsV5lUy562j6io95yQB5OMP5Bgv44cc','z2L0zwu','mtCYmJm4yNfduenv','Ag9ZDg5HBwu','CMvWBgfJzq','5yMn56UVicSG5zco56UV','Ahr0Chm6lY9NAxrLzs5JB20V','odmZwg1mCxv1','Ahr0Chm6lY92B21LA2OUy29T','l3bSDwDPBNmVDxbSB2fK'];_0x3b2d=function(){return _0x3ec2a8;};return _0x3b2d();}
@@ -17,29 +17,159 @@
17
17
  v-else
18
18
  class="vm-richtext__shell"
19
19
  >
20
- <Toolbar
20
+ <div
21
+ v-if="editor"
21
22
  class="vm-richtext__toolbar"
22
- :editor="editorRef"
23
- :default-config="toolbarConfig"
24
- mode="default"
25
- />
26
- <Editor
27
- class="vm-richtext__editor"
28
- :default-config="editorConfig"
29
- mode="default"
30
- @on-created="onEditorCreated"
31
- @on-change="onEditorChange"
23
+ >
24
+ <button
25
+ type="button"
26
+ class="vm-richtext__btn"
27
+ :class="{ 'is-active': editor.isActive('bold') }"
28
+ title="加粗"
29
+ @click="editor.chain().focus().toggleBold().run()"
30
+ >
31
+ <i class="ri-bold" />
32
+ </button>
33
+ <button
34
+ type="button"
35
+ class="vm-richtext__btn"
36
+ :class="{ 'is-active': editor.isActive('italic') }"
37
+ title="斜体"
38
+ @click="editor.chain().focus().toggleItalic().run()"
39
+ >
40
+ <i class="ri-italic" />
41
+ </button>
42
+ <button
43
+ type="button"
44
+ class="vm-richtext__btn"
45
+ :class="{ 'is-active': editor.isActive('underline') }"
46
+ title="下划线"
47
+ @click="editor.chain().focus().toggleUnderline().run()"
48
+ >
49
+ <i class="ri-underline" />
50
+ </button>
51
+ <button
52
+ type="button"
53
+ class="vm-richtext__btn"
54
+ :class="{ 'is-active': editor.isActive('strike') }"
55
+ title="删除线"
56
+ @click="editor.chain().focus().toggleStrike().run()"
57
+ >
58
+ <i class="ri-strikethrough" />
59
+ </button>
60
+ <span class="vm-richtext__sep" />
61
+ <button
62
+ type="button"
63
+ class="vm-richtext__btn"
64
+ :class="{ 'is-active': editor.isActive('heading', { level: 2 }) }"
65
+ title="标题 2"
66
+ @click="editor.chain().focus().toggleHeading({ level: 2 }).run()"
67
+ >
68
+ H2
69
+ </button>
70
+ <button
71
+ type="button"
72
+ class="vm-richtext__btn"
73
+ :class="{ 'is-active': editor.isActive('heading', { level: 3 }) }"
74
+ title="标题 3"
75
+ @click="editor.chain().focus().toggleHeading({ level: 3 }).run()"
76
+ >
77
+ H3
78
+ </button>
79
+ <button
80
+ type="button"
81
+ class="vm-richtext__btn"
82
+ :class="{ 'is-active': editor.isActive('paragraph') }"
83
+ title="正文"
84
+ @click="editor.chain().focus().setParagraph().run()"
85
+ >
86
+ P
87
+ </button>
88
+ <span class="vm-richtext__sep" />
89
+ <button
90
+ type="button"
91
+ class="vm-richtext__btn"
92
+ :class="{ 'is-active': editor.isActive('bulletList') }"
93
+ title="无序列表"
94
+ @click="editor.chain().focus().toggleBulletList().run()"
95
+ >
96
+ <i class="ri-list-unordered" />
97
+ </button>
98
+ <button
99
+ type="button"
100
+ class="vm-richtext__btn"
101
+ :class="{ 'is-active': editor.isActive('orderedList') }"
102
+ title="有序列表"
103
+ @click="editor.chain().focus().toggleOrderedList().run()"
104
+ >
105
+ <i class="ri-list-ordered" />
106
+ </button>
107
+ <button
108
+ type="button"
109
+ class="vm-richtext__btn"
110
+ :class="{ 'is-active': editor.isActive('blockquote') }"
111
+ title="引用"
112
+ @click="editor.chain().focus().toggleBlockquote().run()"
113
+ >
114
+ <i class="ri-double-quotes-l" />
115
+ </button>
116
+ <span class="vm-richtext__sep" />
117
+ <button
118
+ type="button"
119
+ class="vm-richtext__btn"
120
+ :class="{ 'is-active': editor.isActive('link') }"
121
+ title="链接"
122
+ @click="toggleLink"
123
+ >
124
+ <i class="ri-link" />
125
+ </button>
126
+ <button
127
+ v-if="uploadEnabled"
128
+ type="button"
129
+ class="vm-richtext__btn"
130
+ title="图片"
131
+ @click="pickImage"
132
+ >
133
+ <i class="ri-image-line" />
134
+ </button>
135
+ <span class="vm-richtext__sep" />
136
+ <button
137
+ type="button"
138
+ class="vm-richtext__btn"
139
+ title="撤销"
140
+ :disabled="!editor.can().undo()"
141
+ @click="editor.chain().focus().undo().run()"
142
+ >
143
+ <i class="ri-arrow-go-back-line" />
144
+ </button>
145
+ <button
146
+ type="button"
147
+ class="vm-richtext__btn"
148
+ title="重做"
149
+ :disabled="!editor.can().redo()"
150
+ @click="editor.chain().focus().redo().run()"
151
+ >
152
+ <i class="ri-arrow-go-forward-line" />
153
+ </button>
154
+ </div>
155
+
156
+ <EditorContent
157
+ class="vm-richtext__content"
158
+ :editor="editor"
32
159
  />
33
160
  </div>
34
161
  </div>
35
162
  </template>
36
163
 
37
164
  <script setup lang="ts">
38
- import '@wangeditor/editor/dist/css/style.css'
39
165
  import { computed, onBeforeUnmount, shallowRef, watch } from 'vue'
40
166
  import DOMPurify from 'dompurify'
41
- import { Editor, Toolbar } from '@wangeditor/editor-for-vue'
42
- import type { IDomEditor, IEditorConfig, IToolbarConfig } from '@wangeditor/editor'
167
+ import { EditorContent, useEditor } from '@tiptap/vue-3'
168
+ import StarterKit from '@tiptap/starter-kit'
169
+ import Image from '@tiptap/extension-image'
170
+ import Link from '@tiptap/extension-link'
171
+ import Placeholder from '@tiptap/extension-placeholder'
172
+ import Underline from '@tiptap/extension-underline'
43
173
  import { useUpload } from '../../hooks/useUpload'
44
174
 
45
175
  defineOptions({ name: 'vm-richtext' })
@@ -110,10 +240,13 @@ const emit = defineEmits<{
110
240
  }>()
111
241
 
112
242
  const { toUpload } = useUpload()
113
- const editorRef = shallowRef<IDomEditor>()
114
243
  const syncing = shallowRef(false)
244
+ const uploading = shallowRef(false)
115
245
 
116
246
  const readOnlyMode = computed(() => props.readonly)
247
+ const uploadEnabled = computed(
248
+ () => Boolean(props.uploadImage) || props.autoUpload !== false,
249
+ )
117
250
 
118
251
  const shellStyle = computed(() => {
119
252
  const h =
@@ -143,9 +276,13 @@ function sanitize(html: string) {
143
276
  })
144
277
  }
145
278
 
146
- const safeHtml = computed(() => sanitize(String(props.modelValue || '')))
279
+ function normalizeHtml(html: string) {
280
+ const safe = sanitize(html)
281
+ const text = safe.replace(/<[^>]+>/g, '').replace(/&nbsp;/g, ' ').trim()
282
+ return text ? safe : ''
283
+ }
147
284
 
148
- const toolbarConfig: Partial<IToolbarConfig> = {}
285
+ const safeHtml = computed(() => sanitize(String(props.modelValue || '')))
149
286
 
150
287
  async function resolveUpload(file: File): Promise<string> {
151
288
  if (props.uploadImage) return props.uploadImage(file)
@@ -154,58 +291,108 @@ async function resolveUpload(file: File): Promise<string> {
154
291
  return res.url
155
292
  }
156
293
 
157
- const editorConfig = computed<Partial<IEditorConfig>>(() => {
158
- const uploadEnabled = Boolean(props.uploadImage) || props.autoUpload !== false
159
- return {
160
- placeholder: props.placeholder,
161
- readOnly: props.disabled,
162
- autoFocus: false,
163
- MENU_CONF: uploadEnabled
164
- ? {
165
- uploadImage: {
166
- maxFileSize: 10 * 1024 * 1024,
167
- allowedFileTypes: ['image/*'],
168
- async customUpload(file: File, insertFn: (url: string, alt: string, href: string) => void) {
169
- const url = await resolveUpload(file)
170
- const alt =
171
- (file.name || 'image').replace(/\.[^.]+$/, '').trim() || 'image'
172
- insertFn(url, alt, url)
173
- },
174
- },
175
- }
176
- : {},
294
+ async function insertImage(file: File) {
295
+ if (!editor.value || uploading.value) return
296
+ uploading.value = true
297
+ try {
298
+ const url = await resolveUpload(file)
299
+ editor.value.chain().focus().setImage({ src: url, alt: file.name || 'image' }).run()
300
+ } finally {
301
+ uploading.value = false
177
302
  }
178
- })
179
-
180
- function emitHtml(html: string) {
181
- emit('update:modelValue', sanitize(html))
182
303
  }
183
304
 
184
- function onEditorCreated(editor: IDomEditor) {
185
- editorRef.value = editor
186
- if (props.disabled) editor.disable()
187
- syncing.value = true
188
- const html = safeHtml.value
189
- if (html) editor.setHtml(html)
190
- else editor.clear()
191
- syncing.value = false
305
+ function pickImage() {
306
+ const input = document.createElement('input')
307
+ input.type = 'file'
308
+ input.accept = 'image/*'
309
+ input.onchange = () => {
310
+ const file = input.files?.[0]
311
+ if (file) void insertImage(file)
312
+ }
313
+ input.click()
192
314
  }
193
315
 
194
- function onEditorChange(editor: IDomEditor) {
195
- if (syncing.value) return
196
- emitHtml(editor.getHtml())
316
+ function toggleLink() {
317
+ const ed = editor.value
318
+ if (!ed) return
319
+ const prev = ed.getAttributes('link').href as string | undefined
320
+ if (ed.isActive('link')) {
321
+ ed.chain().focus().unsetLink().run()
322
+ return
323
+ }
324
+ const url = window.prompt('链接地址', prev || 'https://')
325
+ if (url == null) return
326
+ const href = url.trim()
327
+ if (!href) {
328
+ ed.chain().focus().unsetLink().run()
329
+ return
330
+ }
331
+ ed.chain().focus().extendMarkRange('link').setLink({ href, target: '_blank', rel: 'noopener noreferrer' }).run()
197
332
  }
198
333
 
334
+ const editor = useEditor({
335
+ content: normalizeHtml(String(props.modelValue || '')),
336
+ editable: !props.disabled,
337
+ extensions: [
338
+ StarterKit.configure({
339
+ heading: { levels: [2, 3] },
340
+ }),
341
+ Underline,
342
+ Link.configure({
343
+ openOnClick: false,
344
+ HTMLAttributes: {
345
+ rel: 'noopener noreferrer',
346
+ target: '_blank',
347
+ },
348
+ }),
349
+ Image.configure({ allowBase64: false }),
350
+ Placeholder.configure({
351
+ placeholder: props.placeholder,
352
+ }),
353
+ ],
354
+ editorProps: {
355
+ attributes: {
356
+ class: 'vm-richtext__prose',
357
+ },
358
+ handlePaste: (_view, event) => {
359
+ if (!uploadEnabled.value) return false
360
+ const items = Array.from(event.clipboardData?.items || [])
361
+ const imageItem = items.find((item) => item.type.startsWith('image/'))
362
+ if (!imageItem) return false
363
+ const file = imageItem.getAsFile()
364
+ if (!file) return false
365
+ event.preventDefault()
366
+ void insertImage(file)
367
+ return true
368
+ },
369
+ handleDrop: (_view, event, _slice, moved) => {
370
+ if (moved || !uploadEnabled.value) return false
371
+ const file = Array.from(event.dataTransfer?.files || []).find((f) =>
372
+ f.type.startsWith('image/'),
373
+ )
374
+ if (!file) return false
375
+ event.preventDefault()
376
+ void insertImage(file)
377
+ return true
378
+ },
379
+ },
380
+ onUpdate: ({ editor: ed }) => {
381
+ if (syncing.value) return
382
+ emit('update:modelValue', normalizeHtml(ed.getHTML()))
383
+ },
384
+ })
385
+
199
386
  watch(
200
387
  () => props.modelValue,
201
388
  (next) => {
202
- const editor = editorRef.value
203
- if (!editor || readOnlyMode.value) return
204
- const html = sanitize(String(next || ''))
205
- if (editor.getHtml() === html) return
389
+ const ed = editor.value
390
+ if (!ed || readOnlyMode.value) return
391
+ const html = normalizeHtml(String(next || ''))
392
+ const current = normalizeHtml(ed.getHTML())
393
+ if (current === html) return
206
394
  syncing.value = true
207
- if (html) editor.setHtml(html)
208
- else editor.clear()
395
+ ed.commands.setContent(html || '<p></p>', false)
209
396
  syncing.value = false
210
397
  },
211
398
  )
@@ -213,15 +400,12 @@ watch(
213
400
  watch(
214
401
  () => props.disabled,
215
402
  (v) => {
216
- const editor = editorRef.value
217
- if (!editor) return
218
- if (v) editor.disable()
219
- else editor.enable()
403
+ editor.value?.setEditable(!v)
220
404
  },
221
405
  )
222
406
 
223
407
  onBeforeUnmount(() => {
224
- editorRef.value?.destroy()
408
+ editor.value?.destroy()
225
409
  })
226
410
  </script>
227
411
 
@@ -249,16 +433,65 @@ onBeforeUnmount(() => {
249
433
  }
250
434
 
251
435
  .vm-richtext__toolbar {
436
+ display: flex;
437
+ flex-wrap: wrap;
438
+ align-items: center;
439
+ gap: 2px;
440
+ padding: 6px 8px;
252
441
  border-bottom: 1px solid var(--border);
253
442
  background: var(--muted);
254
443
  }
255
444
 
256
- .vm-richtext__editor {
257
- /* editor-for-vue 根节点内联 height:100%,须 !important 才能生效 */
258
- height: var(--vm-richtext-height, 320px) !important;
445
+ .vm-richtext__btn {
446
+ display: inline-flex;
447
+ align-items: center;
448
+ justify-content: center;
449
+ min-width: 28px;
450
+ height: 28px;
451
+ padding: 0 6px;
452
+ border: none;
453
+ border-radius: 6px;
454
+ background: transparent;
455
+ color: var(--foreground);
456
+ font-size: 12px;
457
+ font-weight: 600;
458
+ line-height: 1;
459
+ cursor: pointer;
460
+ transition: background 0.15s ease, color 0.15s ease;
461
+
462
+ i {
463
+ font-size: 15px;
464
+ line-height: 1;
465
+ }
466
+
467
+ &:hover:not(:disabled) {
468
+ background: color-mix(in srgb, var(--brand) 10%, transparent);
469
+ color: var(--brand);
470
+ }
471
+
472
+ &.is-active {
473
+ background: color-mix(in srgb, var(--brand) 16%, transparent);
474
+ color: var(--brand);
475
+ }
476
+
477
+ &:disabled {
478
+ opacity: 0.35;
479
+ cursor: not-allowed;
480
+ }
481
+ }
482
+
483
+ .vm-richtext__sep {
484
+ width: 1px;
485
+ height: 18px;
486
+ margin: 0 4px;
487
+ background: var(--border);
488
+ }
489
+
490
+ .vm-richtext__content {
491
+ height: var(--vm-richtext-height, 320px);
259
492
  min-height: var(--vm-richtext-height, 320px);
260
- flex-shrink: 0;
261
493
  overflow-y: auto;
494
+ background: var(--card);
262
495
  }
263
496
 
264
497
  .vm-richtext__html {
@@ -290,16 +523,11 @@ onBeforeUnmount(() => {
290
523
  border-radius: 8px;
291
524
  }
292
525
 
293
- :deep(table) {
294
- width: 100%;
295
- border-collapse: collapse;
296
- margin: 8px 0;
297
- }
298
-
299
- :deep(th),
300
- :deep(td) {
301
- border: 1px solid var(--border);
302
- padding: 6px 8px;
526
+ :deep(blockquote) {
527
+ margin: 0.5em 0;
528
+ padding-left: 12px;
529
+ border-left: 3px solid var(--border);
530
+ color: var(--muted-foreground);
303
531
  }
304
532
 
305
533
  :deep(h1),
@@ -320,20 +548,78 @@ onBeforeUnmount(() => {
320
548
  </style>
321
549
 
322
550
  <style lang="scss">
323
- /* wangEditor 全局层:对齐后台 token(勿 scoped,编辑器 DOM 在组件外生成) */
324
- .vm-richtext__shell .w-e-text-container {
325
- background: var(--card);
551
+ .vm-richtext__content .tiptap.vm-richtext__prose {
552
+ min-height: 100%;
553
+ padding: 12px 14px;
554
+ outline: none;
326
555
  color: var(--foreground);
327
- height: var(--vm-richtext-height, 320px) !important;
328
- min-height: var(--vm-richtext-height, 320px);
329
- }
556
+ font-size: 14px;
557
+ line-height: 1.65;
330
558
 
331
- .vm-richtext__shell .w-e-scroll {
332
- background: var(--card);
333
- height: 100% !important;
334
- }
559
+ p {
560
+ margin: 0.45em 0;
561
+ }
335
562
 
336
- .vm-richtext__shell .w-e-bar {
337
- background: var(--muted);
563
+ p.is-editor-empty:first-child::before {
564
+ content: attr(data-placeholder);
565
+ float: left;
566
+ height: 0;
567
+ pointer-events: none;
568
+ color: var(--muted-foreground);
569
+ }
570
+
571
+ h2,
572
+ h3 {
573
+ margin: 0.75em 0 0.35em;
574
+ font-weight: 650;
575
+ line-height: 1.35;
576
+ }
577
+
578
+ ul,
579
+ ol {
580
+ margin: 0.45em 0;
581
+ padding-left: 1.25em;
582
+ }
583
+
584
+ blockquote {
585
+ margin: 0.45em 0;
586
+ padding-left: 12px;
587
+ border-left: 3px solid var(--border);
588
+ color: var(--muted-foreground);
589
+ }
590
+
591
+ a {
592
+ color: var(--brand);
593
+ text-decoration: underline;
594
+ cursor: pointer;
595
+ }
596
+
597
+ img {
598
+ display: block;
599
+ max-width: 100%;
600
+ height: auto;
601
+ margin: 8px 0;
602
+ border-radius: 8px;
603
+ }
604
+
605
+ code {
606
+ padding: 0.1em 0.35em;
607
+ border-radius: 4px;
608
+ background: var(--muted);
609
+ font-size: 0.92em;
610
+ }
611
+
612
+ pre {
613
+ margin: 0.5em 0;
614
+ padding: 10px 12px;
615
+ border-radius: 8px;
616
+ background: var(--muted);
617
+ overflow-x: auto;
618
+
619
+ code {
620
+ padding: 0;
621
+ background: transparent;
622
+ }
623
+ }
338
624
  }
339
625
  </style>
@@ -1 +1 @@
1
- (function(_0x32815c,_0x4bf117){const _0x228c58=_0x43c1,_0x3aeb47=_0x32815c();while(!![]){try{const _0x1bc4af=-parseInt(_0x228c58(0x17d))/0x1+-parseInt(_0x228c58(0x17f))/0x2+parseInt(_0x228c58(0x177))/0x3+-parseInt(_0x228c58(0x175))/0x4*(parseInt(_0x228c58(0x182))/0x5)+-parseInt(_0x228c58(0x178))/0x6*(-parseInt(_0x228c58(0x17a))/0x7)+parseInt(_0x228c58(0x179))/0x8+parseInt(_0x228c58(0x17b))/0x9*(-parseInt(_0x228c58(0x180))/0xa);if(_0x1bc4af===_0x4bf117)break;else _0x3aeb47['push'](_0x3aeb47['shift']());}catch(_0x419f8e){_0x3aeb47['push'](_0x3aeb47['shift']());}}}(_0x5890,0x6aaad));function _0x43c1(_0xa290fb,_0x5ac0be){_0xa290fb=_0xa290fb-0x173;const _0x58907c=_0x5890();let _0x43c192=_0x58907c[_0xa290fb];if(_0x43c1['vXskjS']===undefined){var _0x3bacd1=function(_0xc0b1e3){const _0x298add='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x206ddc='',_0x179b28='';for(let _0x3476dc=0x0,_0xeaaf95,_0x23b4c8,_0x1df953=0x0;_0x23b4c8=_0xc0b1e3['charAt'](_0x1df953++);~_0x23b4c8&&(_0xeaaf95=_0x3476dc%0x4?_0xeaaf95*0x40+_0x23b4c8:_0x23b4c8,_0x3476dc++%0x4)?_0x206ddc+=String['fromCharCode'](0xff&_0xeaaf95>>(-0x2*_0x3476dc&0x6)):0x0){_0x23b4c8=_0x298add['indexOf'](_0x23b4c8);}for(let _0xade880=0x0,_0x57d602=_0x206ddc['length'];_0xade880<_0x57d602;_0xade880++){_0x179b28+='%'+('00'+_0x206ddc['charCodeAt'](_0xade880)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x179b28);};_0x43c1['NKUERq']=_0x3bacd1,_0x43c1['MzvxMT']={},_0x43c1['vXskjS']=!![];}const _0x24dcae=_0x58907c[0x0],_0x167c8b=_0xa290fb+_0x24dcae,_0x23998a=_0x43c1['MzvxMT'][_0x167c8b];return!_0x23998a?(_0x43c192=_0x43c1['NKUERq'](_0x43c192),_0x43c1['MzvxMT'][_0x167c8b]=_0x43c192):_0x43c192=_0x23998a,_0x43c192;}import{getCrudConfig}from'./style';import{CRUD_LABELS,DEFAULT_CRUD_DICT}from'./dict';export{CRUD_LABELS,DEFAULT_CRUD_DICT};function _0x5890(){const _0x272164=['mJiWnZm2n3f4rfPWBq','mZK5oda5nfvcALvkqG','ndG4mtiWogPnEgvqAW','n1bztvvizq','mJK4og9bz0DIta','C29YDa','mZi0nJu3BxzQt0Pg','zgLJDa','mtm0otu4mKL6verlAG','mteYntbmB3vvBgq','yxbP','nw5IB25pEa','CgfNAw5HDgLVBG','BgfIzwW','oda5nZi4C21UufHI','C2vHCMnO'];_0x5890=function(){return _0x272164;};return _0x5890();}export const DEFAULT_CRUD_PERMISSION={'page':!![],'list':!![],'info':!![],'add':!![],'delete':!![],'update':!![]};export function mergeDict(_0x206ddc){const _0x4c3637=_0x43c1,_0x179b28=getCrudConfig()[_0x4c3637(0x17e)];if(!_0x206ddc)return{..._0x179b28,'label':{..._0x179b28[_0x4c3637(0x174)]}};return{..._0x179b28,..._0x206ddc,'api':{..._0x179b28['api'],..._0x206ddc[_0x4c3637(0x181)]},'pagination':{..._0x179b28[_0x4c3637(0x173)],..._0x206ddc[_0x4c3637(0x173)]},'search':{..._0x179b28[_0x4c3637(0x176)],..._0x206ddc[_0x4c3637(0x176)]},'sort':{..._0x179b28[_0x4c3637(0x17c)],..._0x206ddc['sort']},'label':{..._0x179b28[_0x4c3637(0x174)],..._0x206ddc[_0x4c3637(0x174)]}};}export function mergePermission(_0x3476dc,_0xeaaf95){return{...DEFAULT_CRUD_PERMISSION,..._0xeaaf95,..._0x3476dc};}
1
+ function _0x142a(_0x47e2da,_0xc1ca29){_0x47e2da=_0x47e2da-0x91;const _0x13ded1=_0x13de();let _0x142a9d=_0x13ded1[_0x47e2da];if(_0x142a['DlPxMy']===undefined){var _0x48ea21=function(_0x126060){const _0x14b1b0='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x3f8522='',_0x17d552='';for(let _0x49b67b=0x0,_0x25a051,_0x300e98,_0x5f48e8=0x0;_0x300e98=_0x126060['charAt'](_0x5f48e8++);~_0x300e98&&(_0x25a051=_0x49b67b%0x4?_0x25a051*0x40+_0x300e98:_0x300e98,_0x49b67b++%0x4)?_0x3f8522+=String['fromCharCode'](0xff&_0x25a051>>(-0x2*_0x49b67b&0x6)):0x0){_0x300e98=_0x14b1b0['indexOf'](_0x300e98);}for(let _0x990bd3=0x0,_0x4dac4f=_0x3f8522['length'];_0x990bd3<_0x4dac4f;_0x990bd3++){_0x17d552+='%'+('00'+_0x3f8522['charCodeAt'](_0x990bd3)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x17d552);};_0x142a['FUixCL']=_0x48ea21,_0x142a['JTPMre']={},_0x142a['DlPxMy']=!![];}const _0x88fad5=_0x13ded1[0x0],_0x3fdf61=_0x47e2da+_0x88fad5,_0x2154be=_0x142a['JTPMre'][_0x3fdf61];return!_0x2154be?(_0x142a9d=_0x142a['FUixCL'](_0x142a9d),_0x142a['JTPMre'][_0x3fdf61]=_0x142a9d):_0x142a9d=_0x2154be,_0x142a9d;}(function(_0x114e60,_0x18f70c){const _0x180d31=_0x142a,_0x480b60=_0x114e60();while(!![]){try{const _0x2f48fa=parseInt(_0x180d31(0x9e))/0x1*(-parseInt(_0x180d31(0x9a))/0x2)+-parseInt(_0x180d31(0x92))/0x3+parseInt(_0x180d31(0x96))/0x4+parseInt(_0x180d31(0xa0))/0x5*(parseInt(_0x180d31(0x9d))/0x6)+parseInt(_0x180d31(0x9b))/0x7*(parseInt(_0x180d31(0xa1))/0x8)+parseInt(_0x180d31(0x94))/0x9*(parseInt(_0x180d31(0x93))/0xa)+-parseInt(_0x180d31(0x97))/0xb*(parseInt(_0x180d31(0x9c))/0xc);if(_0x2f48fa===_0x18f70c)break;else _0x480b60['push'](_0x480b60['shift']());}catch(_0x2363c8){_0x480b60['push'](_0x480b60['shift']());}}}(_0x13de,0x87206));import{getCrudConfig}from'./style';import{CRUD_LABELS,DEFAULT_CRUD_DICT}from'./dict';export{CRUD_LABELS,DEFAULT_CRUD_DICT};export const DEFAULT_CRUD_PERMISSION={'page':!![],'list':!![],'info':!![],'add':!![],'delete':!![],'update':!![]};export function mergeDict(_0x3f8522){const _0x52213f=_0x142a,_0x17d552=getCrudConfig()[_0x52213f(0x95)];if(!_0x3f8522)return{..._0x17d552,'label':{..._0x17d552[_0x52213f(0x9f)]}};return{..._0x17d552,..._0x3f8522,'api':{..._0x17d552[_0x52213f(0x91)],..._0x3f8522[_0x52213f(0x91)]},'pagination':{..._0x17d552['pagination'],..._0x3f8522['pagination']},'search':{..._0x17d552[_0x52213f(0x99)],..._0x3f8522['search']},'sort':{..._0x17d552[_0x52213f(0x98)],..._0x3f8522[_0x52213f(0x98)]},'label':{..._0x17d552[_0x52213f(0x9f)],..._0x3f8522['label']}};}export function mergePermission(_0x49b67b,_0x25a051){return{...DEFAULT_CRUD_PERMISSION,..._0x25a051,..._0x49b67b};}function _0x13de(){const _0x7e8571=['mZGZmJCWAgX1uejh','mte3EezoqLn1','zgLJDa','mJC4ndu5nMDxC29VtW','mteZm1PxwMfrDG','C29YDa','C2vHCMnO','nhPMuu5yBG','mtrZvfzVA3q','ntm3mZz6Cw9yz2e','mZyYmZy4mNj2sKHVBW','ndG0ndu3t2rqALDN','BgfIzwW','nvriyLzlvG','ndi4mtuXmNvfDxPsCa','yxbP','mJy1nti5n1Lwr0neta'];_0x13de=function(){return _0x7e8571;};return _0x13de();}
@@ -1 +1 @@
1
- const _0x54b88f=_0xcfef;(function(_0x4d84aa,_0x62e922){const _0x3ed185=_0xcfef,_0x5a4ae3=_0x4d84aa();while(!![]){try{const _0x59c23f=-parseInt(_0x3ed185(0x174))/0x1+parseInt(_0x3ed185(0x179))/0x2+-parseInt(_0x3ed185(0x15f))/0x3+parseInt(_0x3ed185(0x167))/0x4+parseInt(_0x3ed185(0x17a))/0x5*(parseInt(_0x3ed185(0x162))/0x6)+-parseInt(_0x3ed185(0x177))/0x7+parseInt(_0x3ed185(0x17b))/0x8;if(_0x59c23f===_0x62e922)break;else _0x5a4ae3['push'](_0x5a4ae3['shift']());}catch(_0x2ef8f9){_0x5a4ae3['push'](_0x5a4ae3['shift']());}}}(_0x2fc9,0x9a45c));function _0xcfef(_0x70b731,_0x45b006){_0x70b731=_0x70b731-0x15f;const _0x2fc997=_0x2fc9();let _0xcfefec=_0x2fc997[_0x70b731];if(_0xcfef['sTkIzw']===undefined){var _0x4cff2e=function(_0x57457d){const _0x290576='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x311f31='',_0x414057='';for(let _0x465c36=0x0,_0x58e946,_0x3055ca,_0x4f4746=0x0;_0x3055ca=_0x57457d['charAt'](_0x4f4746++);~_0x3055ca&&(_0x58e946=_0x465c36%0x4?_0x58e946*0x40+_0x3055ca:_0x3055ca,_0x465c36++%0x4)?_0x311f31+=String['fromCharCode'](0xff&_0x58e946>>(-0x2*_0x465c36&0x6)):0x0){_0x3055ca=_0x290576['indexOf'](_0x3055ca);}for(let _0x97a0bb=0x0,_0xc0c044=_0x311f31['length'];_0x97a0bb<_0xc0c044;_0x97a0bb++){_0x414057+='%'+('00'+_0x311f31['charCodeAt'](_0x97a0bb)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x414057);};_0xcfef['IOlKeE']=_0x4cff2e,_0xcfef['cVcTRZ']={},_0xcfef['sTkIzw']=!![];}const _0x108b81=_0x2fc997[0x0],_0x3158ee=_0x70b731+_0x108b81,_0x1ecd78=_0xcfef['cVcTRZ'][_0x3158ee];return!_0x1ecd78?(_0xcfefec=_0xcfef['IOlKeE'](_0xcfefec),_0xcfef['cVcTRZ'][_0x3158ee]=_0xcfefec):_0xcfefec=_0x1ecd78,_0xcfefec;}import{createApp,h,ref}from'vue';import{Dialog,DialogContent,DialogFooter,DialogHeader,DialogTitle}from'#vome-host/components/ui/dialog';function _0x2fc9(){const _0x1a1f0d=['mZGYmdu5mNvoBuzYzW','DMfSDwu','y29UzMLYBvrLEhq','cI52Bs1JB25MAxjTw2rHDgeTC2XVDd0NzgLHBg9NlwnVBNrLBNqNxsb7cIaGD2LKDgG6ig1PBIG0mdbWEcWGy2fSyYGXmdb2DYaTidmYChGPksaHAw1WB3j0yw50oWOGig1HEc13Awr0AdOGBwLUkdqWmhb4lcbJywXJkdeWmhz3ic0GmZjWEcKPicfPBxbVCNrHBNq7cIaGz2fWoIaWicfPBxbVCNrHBNq7cIaGCgfKzgLUzZOGmcaHAw1WB3j0yw50oWOGigjVCMrLCJOGBM9UzsaHAw1WB3j0yw50oWOGigjVCMrLCI1YywrPDxm6idi0ChGGiwLTCg9YDgfUDdSkicbIB3GTC2HHzg93oIb2yxiOls1ZAgfKB3CTC29MDcKGiwLTCg9YDgfUDdSkFqOUDM0Ty29UzMLYBv9FAgvHzcb7ihbHzgrPBMC6ide4ChGGmJjWEcaWoYbIB3jKzxiTyM90Dg9ToIbUB25LoYb9cI52Bs1JB25MAxjTx190AxrSzsb7igzVBNqTC2L6ztOGmtzWEdSGzM9UDc13zwLNAhq6idy1mdSGFqOUDM0Ty29UzMLYBv9FyM9KEsb7cIaGCgfKzgLUzZOGmtjWEcaYmNb4idHWEdSkicbJB2XVCJOGDMfYkc0TzM9YzwDYB3vUzcK7cIaGzM9UDc1ZAxPLoIaXnhb4oWOGigXPBMuTAgvPz2H0oIaXlJy7cN0klNzTlwnVBMzPCM1Fx2zVB3qGEWOGigrPC3bSyxK6igzSzxG7cIaGANvZDgLMEs1JB250zw50oIbMBgv4lwvUzdSkicbNyxa6idHWEdSkicbWywrKAw5NoIaXnhb4idiYChG7cN0klNzTlwnVBMzPCM1Fx2j0BIb7cIaGAgvPz2H0oIaZnNb4oWOGihbHzgrPBMC6idaGmtzWEdSkicbIB3jKzxi6ig5VBMu7cIaGyM9YzgvYlxjHzgL1CZOGmtjWEdSkicbMB250lxnPEMu6ideZChG7cIaGzM9UDc13zwLNAhq6idyWmdSkicbJDxjZB3i6ihbVAw50zxi7cN0klNzTlwnVBMzPCM1Fx2j0BI5PCY1WCMLTyxj5ihSGyMfJA2DYB3vUzdOGDMfYkc0TyNjHBMqPoYbJB2XVCJOGi2zMzJSGFqOUDM0Ty29UzMLYBv9FyNrUlMLZlxbYAw1HCNK6Ag92zxiGEYbIywnRz3jVDw5KoIb2yxiOls1ICMfUzc1KzwvWktSGFqOUDM0Ty29UzMLYBv9FyNrUlMLZlwDOB3n0ihSGyMfJA2DYB3vUzdOGDMfYkc0TBxv0zwqPoYbJB2XVCJOGDMfYkc0TzM9YzwDYB3vUzcK7ih0k','Bw91BNq','C3rYAw5N','DM0Ty29UzMLYBv9FzM9VDa','Dw5KzwzPBMvK','z2v0rwXLBwvUDej5swq','zgL2','yNv0Dg9U','C3r5Bgu','DM0Ty29UzMLYBv9FyNrUigLZlwDOB3n0','nJe1mdy0CKvpwNrb','DM0Ty29UzMLYBv9FAgvHza','yxbWzw5Kq2HPBgq','ndm3otq5nhzstLbywG','y2fUy2vSvgv4Da','ndaXmZm0ANPJt0PP','nde4mZmWmfP0DxrkrG','ndq2mZq4mgvVwLDhva','mJaZmZqXmKHrrxjXyW','y3jLyxrLrwXLBwvUDa','yM9KEq','nNrqrK94CG','DM0Ty29UzMLYBv9FyNrUigLZlxbYAw1HCNK','CMvTB3zL','Dw5TB3vUDa','DM0Ty29UzMLYBs1ZDhLSzq'];_0x2fc9=function(){return _0x1a1f0d;};return _0x2fc9();}export function vmConfirm(_0x311f31){const _0x4e2c0f=_0xcfef,_0x414057=typeof _0x311f31===_0x4e2c0f(0x16c)?{'message':_0x311f31}:_0x311f31;return new Promise(_0x465c36=>{const _0x3fb1ac=_0x4e2c0f,_0x58e946=ref(!![]),_0x3055ca=document['createElement'](_0x3fb1ac(0x170));document[_0x3fb1ac(0x161)][_0x3fb1ac(0x176)](_0x3055ca);const _0x4f4746=createApp({'setup'(){const _0x590810=_0x3fb1ac;function _0x97a0bb(_0xc0c044){_0x58e946['value']=![],_0x465c36(_0xc0c044),setTimeout(()=>{const _0x2921ba=_0xcfef;_0x4f4746[_0x2921ba(0x165)](),_0x3055ca[_0x2921ba(0x164)]();},0xc8);}return()=>h(Dialog,{'open':_0x58e946[_0x590810(0x168)],'onUpdate:open':_0x277168=>{if(!_0x277168)_0x97a0bb(![]);}},{'default':()=>h(DialogContent,{'class':'vm-confirm','showCloseButton':![]},{'default':()=>[h(DialogHeader,{'class':_0x590810(0x175)},()=>h(DialogTitle,{'class':'vm-confirm__title'},()=>_0x414057['title']||'提示')),h(_0x590810(0x170),{'class':'vm-confirm__body'},_0x414057['message']),h(DialogFooter,{'class':_0x590810(0x16d)},()=>[h(_0x590810(0x171),{'type':_0x590810(0x171),'class':_0x590810(0x173),'onClick':()=>_0x97a0bb(![])},_0x414057[_0x590810(0x178)]||'取消'),h(_0x590810(0x171),{'type':_0x590810(0x171),'class':_0x590810(0x163),'onClick':()=>_0x97a0bb(!![])},_0x414057[_0x590810(0x169)]||'确定')])]})});}});_0x4f4746[_0x3fb1ac(0x16b)](_0x3055ca);});}if(typeof document!==_0x54b88f(0x16e)&&!document[_0x54b88f(0x16f)](_0x54b88f(0x166))){const style=document[_0x54b88f(0x160)](_0x54b88f(0x172));style['id']=_0x54b88f(0x166),style['textContent']=_0x54b88f(0x16a),document['head'][_0x54b88f(0x176)](style);}
1
+ const _0x5cd49a=_0x5175;(function(_0x17a70c,_0x6c5f20){const _0x5696da=_0x5175,_0x3233e0=_0x17a70c();while(!![]){try{const _0x269b88=parseInt(_0x5696da(0x186))/0x1*(parseInt(_0x5696da(0x18a))/0x2)+-parseInt(_0x5696da(0x17a))/0x3*(parseInt(_0x5696da(0x182))/0x4)+-parseInt(_0x5696da(0x185))/0x5*(parseInt(_0x5696da(0x177))/0x6)+-parseInt(_0x5696da(0x181))/0x7*(parseInt(_0x5696da(0x16b))/0x8)+parseInt(_0x5696da(0x175))/0x9+-parseInt(_0x5696da(0x17d))/0xa*(-parseInt(_0x5696da(0x16e))/0xb)+parseInt(_0x5696da(0x16d))/0xc*(parseInt(_0x5696da(0x171))/0xd);if(_0x269b88===_0x6c5f20)break;else _0x3233e0['push'](_0x3233e0['shift']());}catch(_0x59a5d7){_0x3233e0['push'](_0x3233e0['shift']());}}}(_0x4405,0x2d772));function _0x5175(_0x4af89c,_0x396d5a){_0x4af89c=_0x4af89c-0x16b;const _0x4405f8=_0x4405();let _0x5175e4=_0x4405f8[_0x4af89c];if(_0x5175['QrsJAy']===undefined){var _0x17abe0=function(_0x34c3d8){const _0x47cfbb='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x3971b7='',_0x4d1d8c='';for(let _0x5c3dfc=0x0,_0x19b4ae,_0x3fe8ea,_0x49907b=0x0;_0x3fe8ea=_0x34c3d8['charAt'](_0x49907b++);~_0x3fe8ea&&(_0x19b4ae=_0x5c3dfc%0x4?_0x19b4ae*0x40+_0x3fe8ea:_0x3fe8ea,_0x5c3dfc++%0x4)?_0x3971b7+=String['fromCharCode'](0xff&_0x19b4ae>>(-0x2*_0x5c3dfc&0x6)):0x0){_0x3fe8ea=_0x47cfbb['indexOf'](_0x3fe8ea);}for(let _0x2eea79=0x0,_0x4fef82=_0x3971b7['length'];_0x2eea79<_0x4fef82;_0x2eea79++){_0x4d1d8c+='%'+('00'+_0x3971b7['charCodeAt'](_0x2eea79)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x4d1d8c);};_0x5175['XhbUux']=_0x17abe0,_0x5175['CVDEOz']={},_0x5175['QrsJAy']=!![];}const _0x48bd75=_0x4405f8[0x0],_0x4231ac=_0x4af89c+_0x48bd75,_0x59a697=_0x5175['CVDEOz'][_0x4231ac];return!_0x59a697?(_0x5175e4=_0x5175['XhbUux'](_0x5175e4),_0x5175['CVDEOz'][_0x4231ac]=_0x5175e4):_0x5175e4=_0x59a697,_0x5175e4;}import{createApp,h,ref}from'vue';import{Dialog,DialogContent,DialogFooter,DialogHeader,DialogTitle}from'#vome-host/components/ui/dialog';export function vmConfirm(_0x3971b7){const _0x36a5c1=_0x5175,_0x4d1d8c=typeof _0x3971b7===_0x36a5c1(0x174)?{'message':_0x3971b7}:_0x3971b7;return new Promise(_0x5c3dfc=>{const _0x187c40=_0x36a5c1,_0x19b4ae=ref(!![]),_0x3fe8ea=document[_0x187c40(0x18c)](_0x187c40(0x17b));document[_0x187c40(0x176)][_0x187c40(0x184)](_0x3fe8ea);const _0x49907b=createApp({'setup'(){const _0xf42796=_0x187c40;function _0x2eea79(_0x4fef82){const _0x643703=_0x5175;_0x19b4ae[_0x643703(0x180)]=![],_0x5c3dfc(_0x4fef82),setTimeout(()=>{const _0x5b3d93=_0x643703;_0x49907b[_0x5b3d93(0x173)](),_0x3fe8ea[_0x5b3d93(0x17e)]();},0xc8);}return()=>h(Dialog,{'open':_0x19b4ae[_0xf42796(0x180)],'onUpdate:open':_0x38ccdf=>{if(!_0x38ccdf)_0x2eea79(![]);}},{'default':()=>h(DialogContent,{'class':_0xf42796(0x16f),'showCloseButton':![]},{'default':()=>[h(DialogHeader,{'class':'vm-confirm__head'},()=>h(DialogTitle,{'class':'vm-confirm__title'},()=>_0x4d1d8c['title']||'提示')),h(_0xf42796(0x17b),{'class':'vm-confirm__body'},_0x4d1d8c[_0xf42796(0x17c)]),h(DialogFooter,{'class':_0xf42796(0x16c)},()=>[h(_0xf42796(0x18d),{'type':_0xf42796(0x18d),'class':_0xf42796(0x179),'onClick':()=>_0x2eea79(![])},_0x4d1d8c[_0xf42796(0x172)]||'取消'),h('button',{'type':_0xf42796(0x18d),'class':_0xf42796(0x18b),'onClick':()=>_0x2eea79(!![])},_0x4d1d8c[_0xf42796(0x189)]||'确定')])]})});}});_0x49907b[_0x187c40(0x183)](_0x3fe8ea);});}function _0x4405(){const _0x35be0b=['Dw5KzwzPBMvK','ntq2ntjRv2PntKy','y2fUy2vSvgv4Da','Dw5TB3vUDa','C3rYAw5N','mtq1mJiZmu53t3DuyG','yM9KEq','nLD6ENL6DG','cI52Bs1JB25MAxjTw2rHDgeTC2XVDd0NzgLHBg9NlwnVBNrLBNqNxsb7cIaGD2LKDgG6ig1PBIG0mdbWEcWGy2fSyYGXmdb2DYaTidmYChGPksaHAw1WB3j0yw50oWOGig1HEc13Awr0AdOGBwLUkdqWmhb4lcbJywXJkdeWmhz3ic0GmZjWEcKPicfPBxbVCNrHBNq7cIaGz2fWoIaWicfPBxbVCNrHBNq7cIaGCgfKzgLUzZOGmcaHAw1WB3j0yw50oWOGigjVCMrLCJOGBM9UzsaHAw1WB3j0yw50oWOGigjVCMrLCI1YywrPDxm6idi0ChGGiwLTCg9YDgfUDdSkicbIB3GTC2HHzg93oIb2yxiOls1ZAgfKB3CTC29MDcKGiwLTCg9YDgfUDdSkFqOUDM0Ty29UzMLYBv9FAgvHzcb7ihbHzgrPBMC6ide4ChGGmJjWEcaWoYbIB3jKzxiTyM90Dg9ToIbUB25LoYb9cI52Bs1JB25MAxjTx190AxrSzsb7igzVBNqTC2L6ztOGmtzWEdSGzM9UDc13zwLNAhq6idy1mdSGFqOUDM0Ty29UzMLYBv9FyM9KEsb7cIaGCgfKzgLUzZOGmtjWEcaYmNb4idHWEdSkicbJB2XVCJOGDMfYkc0TzM9YzwDYB3vUzcK7cIaGzM9UDc1ZAxPLoIaXnhb4oWOGigXPBMuTAgvPz2H0oIaXlJy7cN0klNzTlwnVBMzPCM1Fx2zVB3qGEWOGigrPC3bSyxK6igzSzxG7cIaGANvZDgLMEs1JB250zw50oIbMBgv4lwvUzdSkicbNyxa6idHWEdSkicbWywrKAw5NoIaXnhb4idiYChG7cN0klNzTlwnVBMzPCM1Fx2j0BIb7cIaGAgvPz2H0oIaZnNb4oWOGihbHzgrPBMC6idaGmtzWEdSkicbIB3jKzxi6ig5VBMu7cIaGyM9YzgvYlxjHzgL1CZOGmtjWEdSkicbMB250lxnPEMu6ideZChG7cIaGzM9UDc13zwLNAhq6idyWmdSkicbJDxjZB3i6ihbVAw50zxi7cN0klNzTlwnVBMzPCM1Fx2j0BI5PCY1WCMLTyxj5ihSGyMfJA2DYB3vUzdOGDMfYkc0TyNjHBMqPoYbJB2XVCJOGi2zMzJSGFqOUDM0Ty29UzMLYBv9FyNrUlMLZlxbYAw1HCNK6Ag92zxiGEYbIywnRz3jVDw5KoIb2yxiOls1ICMfUzc1KzwvWktSGFqOUDM0Ty29UzMLYBv9FyNrUlMLZlwDOB3n0ihSGyMfJA2DYB3vUzdOGDMfYkc0TBxv0zwqPoYbJB2XVCJOGDMfYkc0TzM9YzwDYB3vUzcK7ih0k','DM0Ty29UzMLYBv9FyNrUigLZlwDOB3n0','mtvUswjwwfG','zgL2','BwvZC2fNzq','nJiYnJiWD2n3qMvj','CMvTB3zL','DM0Ty29UzMLYBs1ZDhLSzq','DMfSDwu','mJHLAhfev0u','mJC5mtaWwvLnEhfg','Bw91BNq','yxbWzw5Kq2HPBgq','mtGWmZC3nxvXqLDQvW','mtvYAMHwtNG','AgvHza','C3r5Bgu','y29UzMLYBvrLEhq','ndu1mZH1tK9mBM4','DM0Ty29UzMLYBv9FyNrUigLZlxbYAw1HCNK','y3jLyxrLrwXLBwvUDa','yNv0Dg9U','z2v0rwXLBwvUDej5swq','mJyZndGWsNPktxDR','DM0Ty29UzMLYBv9FzM9VDa','mtmYmevPzhLZsG','mtfKueDgDuS','DM0Ty29UzMLYBq'];_0x4405=function(){return _0x35be0b;};return _0x4405();}if(typeof document!==_0x5cd49a(0x170)&&!document[_0x5cd49a(0x18e)](_0x5cd49a(0x17f))){const style=document['createElement'](_0x5cd49a(0x188));style['id']=_0x5cd49a(0x17f),style['textContent']=_0x5cd49a(0x178),document[_0x5cd49a(0x187)][_0x5cd49a(0x184)](style);}