vome-core 0.1.27 → 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
- const _0x245ea6=_0x5738;(function(_0x217bd0,_0x3783bd){const _0x8ef90f=_0x5738,_0x24f6a2=_0x217bd0();while(!![]){try{const _0x19b1e6=parseInt(_0x8ef90f(0x178))/0x1+-parseInt(_0x8ef90f(0x193))/0x2+parseInt(_0x8ef90f(0x189))/0x3+-parseInt(_0x8ef90f(0x18f))/0x4+parseInt(_0x8ef90f(0x191))/0x5*(-parseInt(_0x8ef90f(0x183))/0x6)+-parseInt(_0x8ef90f(0x190))/0x7*(parseInt(_0x8ef90f(0x17d))/0x8)+parseInt(_0x8ef90f(0x186))/0x9*(parseInt(_0x8ef90f(0x181))/0xa);if(_0x19b1e6===_0x3783bd)break;else _0x24f6a2['push'](_0x24f6a2['shift']());}catch(_0x318829){_0x24f6a2['push'](_0x24f6a2['shift']());}}}(_0x1ba4,0xadcb7));const ORG=_0x245ea6(0x17e);export function serviceUrlFromDocs(_0x518aec){const _0x368b3f=_0x245ea6,_0x12bba5=new URL(_0x518aec),_0x515ef0=_0x12bba5['hostname'][_0x368b3f(0x18c)](/^www\./,'')['replace'](/^service\./,'');return _0x12bba5[_0x368b3f(0x182)]+'//service.'+_0x515ef0;}export function seatApiBaseFromDocs(_0x167144){const _0xd6b169=_0x245ea6;return serviceUrlFromDocs(_0x167144)+_0xd6b169(0x17a);}export function licenseIssueUrlFromDocs(_0x58196e){const _0x84dd57=_0x245ea6;return serviceUrlFromDocs(_0x58196e)+_0x84dd57(0x180);}function _0x1ba4(){const _0x4d745a=['mtGZmJK5mhHjEMPQDa','ChjVDg9JB2W','nte3og1TtwHdzG','5yMn56UVicSG5zco56UV','DM9Tzs1WBhvNAw4TC2vYDMLJzq','mta4z1fTwgn4','z2L0zwu','l2fYy2HPDMuVCMvMCY9OzwfKCY9Tyxn0zxiUEMLW','mZyYnJG3neros2Dctq','zNvSBa','DM9Tzs1WBhvNAw4TzNvSBa','CMvWBgfJzq','5zco5y+W5B6U5BQu55sO6isA5OMl5P6277YilNzVBwxVVjRLKkSGD2vIl++8IE+8Jos7Psb3DwPPzsdMJilOVB3NI6ZNQ4VLIy3NQ6/POBxPNAlJGii','57QV5yMn56UV','ndyXnJe2ohH4ywDSDG','n0XvsfjNwG','nJq3mgnMwNrvwG','Ahr0Chm6lY9NAxrODwiUy29TlW','mJuYota4mNzTs0rbrW','6zkP5A2qic8G5PYn5yQH56UV5O+s5lU26isA5OMl5P6277YilNzVBwxVVjRKU4uGC2vYDMvY77Yj77Ym6ycc5zci5lIk5lYG44cb55+T5l+H44cb5PsV5lUy562j6io95yQB5OMP5Bgv44cc','Ahr0Chm6lY9NAxrLzs5JB20V','DM9Tzs1WBhvNAw4TzNjVBNq','mteYnZC3m0zey2L4sG','yMfJA2vUza','l2fWCc9WBhvNAw5tDg9Yzs9Zzwf0','5A6m5Pw05lIA5yQH5QIH5z2x6isA5OMl5P6277YilNzVBwxVVjRLKkSGC2vYDMvYios4JIb3zwlVViNVViZMNkZLNldLVidLJ5hMIzpLJixLKi7LJ5hLUipJGii','zNjVBNrLBMq','mJmXmZiWohLmDhH6uq','DM9TzwTQ','l3bSDwDPBNmVDxbSB2fK','l2fWCc9WBhvNAw5tDg9Yzs93ywXSzxqVBgLJzw5Zzs9PC3n1zq'];_0x1ba4=function(){return _0x4d745a;};return _0x1ba4();}function giteeArchive(_0x31818e){const _0x3f07f3=_0x245ea6;return _0x3f07f3(0x176)+ORG+'/'+_0x31818e+'/repository/archive/master.zip';}function githubArchive(_0x37a8f5){const _0x51d5ee=_0x245ea6;return _0x51d5ee(0x192)+ORG+'/'+_0x37a8f5+_0x51d5ee(0x188);}function giteeRepo(_0x649b87){return'https://gitee.com/'+ORG+'/'+_0x649b87;}function githubRepo(_0x39d849){return'https://github.com/'+ORG+'/'+_0x39d849;}function _0x5738(_0x3d205a,_0x49a45f){_0x3d205a=_0x3d205a-0x175;const _0x1ba4c1=_0x1ba4();let _0x573808=_0x1ba4c1[_0x3d205a];if(_0x5738['BzNZAs']===undefined){var _0x32c628=function(_0x3248e0){const _0x9056ea='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x518aec='',_0x12bba5='';for(let _0x515ef0=0x0,_0x167144,_0x58196e,_0x31818e=0x0;_0x58196e=_0x3248e0['charAt'](_0x31818e++);~_0x58196e&&(_0x167144=_0x515ef0%0x4?_0x167144*0x40+_0x58196e:_0x58196e,_0x515ef0++%0x4)?_0x518aec+=String['fromCharCode'](0xff&_0x167144>>(-0x2*_0x515ef0&0x6)):0x0){_0x58196e=_0x9056ea['indexOf'](_0x58196e);}for(let _0x37a8f5=0x0,_0x649b87=_0x518aec['length'];_0x37a8f5<_0x649b87;_0x37a8f5++){_0x12bba5+='%'+('00'+_0x518aec['charCodeAt'](_0x37a8f5)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x12bba5);};_0x5738['UlgIzL']=_0x32c628,_0x5738['zMFEqs']={},_0x5738['BzNZAs']=!![];}const _0x956bbb=_0x1ba4c1[0x0],_0x506e04=_0x3d205a+_0x956bbb,_0x1be382=_0x5738['zMFEqs'][_0x506e04];return!_0x1be382?(_0x573808=_0x5738['UlgIzL'](_0x573808),_0x5738['zMFEqs'][_0x506e04]=_0x573808):_0x573808=_0x1be382,_0x573808;}const docsUrl='https://vomekj.com';export const pluginDev={'docsUrl':docsUrl,'serviceUrl':serviceUrlFromDocs(docsUrl),'uploadUrl':docsUrl+_0x245ea6(0x17f),'mirrors':{'prefer':_0x245ea6(0x187),'giteeOrg':_0x245ea6(0x176)+ORG,'githubOrg':_0x245ea6(0x192)+ORG},'scaffolds':{'full':{'key':_0x245ea6(0x18a),'title':_0x245ea6(0x184),'desc':_0x245ea6(0x17b),'repo':'vome-plugin-full','repoUrl':giteeRepo(_0x245ea6(0x18b)),'githubRepoUrl':githubRepo(_0x245ea6(0x18b)),'downloadUrl':giteeArchive('vome-plugin-full'),'githubDownloadUrl':githubArchive(_0x245ea6(0x18b))},'backend':{'key':_0x245ea6(0x179),'title':'纯后端','desc':_0x245ea6(0x175),'repo':_0x245ea6(0x185),'repoUrl':giteeRepo(_0x245ea6(0x185)),'githubRepoUrl':githubRepo('vome-plugin-service'),'downloadUrl':giteeArchive(_0x245ea6(0x185)),'githubDownloadUrl':githubArchive(_0x245ea6(0x185))},'frontend':{'key':_0x245ea6(0x17c),'title':_0x245ea6(0x18e),'desc':_0x245ea6(0x18d),'repo':'vome-plugin-front','repoUrl':giteeRepo(_0x245ea6(0x177)),'githubRepoUrl':githubRepo(_0x245ea6(0x177)),'downloadUrl':giteeArchive(_0x245ea6(0x177)),'githubDownloadUrl':githubArchive(_0x245ea6(0x177))}}};
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();}
@@ -5,6 +5,7 @@
5
5
  'is-readonly': readOnlyMode,
6
6
  'is-disabled': disabled,
7
7
  }"
8
+ :style="shellStyle"
8
9
  >
9
10
  <div
10
11
  v-if="readOnlyMode"
@@ -15,31 +16,160 @@
15
16
  <div
16
17
  v-else
17
18
  class="vm-richtext__shell"
18
- :style="shellStyle"
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,13 +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 {
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 {
257
491
  height: var(--vm-richtext-height, 320px);
492
+ min-height: var(--vm-richtext-height, 320px);
258
493
  overflow-y: auto;
494
+ background: var(--card);
259
495
  }
260
496
 
261
497
  .vm-richtext__html {
@@ -287,16 +523,11 @@ onBeforeUnmount(() => {
287
523
  border-radius: 8px;
288
524
  }
289
525
 
290
- :deep(table) {
291
- width: 100%;
292
- border-collapse: collapse;
293
- margin: 8px 0;
294
- }
295
-
296
- :deep(th),
297
- :deep(td) {
298
- border: 1px solid var(--border);
299
- 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);
300
531
  }
301
532
 
302
533
  :deep(h1),
@@ -317,17 +548,78 @@ onBeforeUnmount(() => {
317
548
  </style>
318
549
 
319
550
  <style lang="scss">
320
- /* wangEditor 全局层:对齐后台 token(勿 scoped,编辑器 DOM 在组件外生成) */
321
- .vm-richtext__shell .w-e-text-container {
322
- background: var(--card);
551
+ .vm-richtext__content .tiptap.vm-richtext__prose {
552
+ min-height: 100%;
553
+ padding: 12px 14px;
554
+ outline: none;
323
555
  color: var(--foreground);
324
- }
556
+ font-size: 14px;
557
+ line-height: 1.65;
325
558
 
326
- .vm-richtext__shell .w-e-scroll {
327
- background: var(--card);
328
- }
559
+ p {
560
+ margin: 0.45em 0;
561
+ }
329
562
 
330
- .vm-richtext__shell .w-e-bar {
331
- 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
+ }
332
624
  }
333
625
  </style>
@@ -1 +1 @@
1
- (function(_0x826569,_0xd5f065){const _0x5453f8=_0x456c,_0x4d599c=_0x826569();while(!![]){try{const _0x50d486=-parseInt(_0x5453f8(0x1be))/0x1*(parseInt(_0x5453f8(0x1bc))/0x2)+-parseInt(_0x5453f8(0x1b9))/0x3*(-parseInt(_0x5453f8(0x1bb))/0x4)+-parseInt(_0x5453f8(0x1c3))/0x5*(-parseInt(_0x5453f8(0x1c4))/0x6)+parseInt(_0x5453f8(0x1b5))/0x7*(-parseInt(_0x5453f8(0x1ba))/0x8)+parseInt(_0x5453f8(0x1b8))/0x9+parseInt(_0x5453f8(0x1c6))/0xa*(parseInt(_0x5453f8(0x1b7))/0xb)+parseInt(_0x5453f8(0x1c5))/0xc*(parseInt(_0x5453f8(0x1bf))/0xd);if(_0x50d486===_0xd5f065)break;else _0x4d599c['push'](_0x4d599c['shift']());}catch(_0x45080f){_0x4d599c['push'](_0x4d599c['shift']());}}}(_0x9673,0x4dd57));function _0x456c(_0x1d13bf,_0x23b9ef){_0x1d13bf=_0x1d13bf-0x1b5;const _0x967317=_0x9673();let _0x456ca2=_0x967317[_0x1d13bf];if(_0x456c['CgeZXM']===undefined){var _0x184268=function(_0x5db693){const _0x387aef='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x125789='',_0x564a6b='';for(let _0xd7c0e9=0x0,_0x2b5ef5,_0x17315d,_0x80a5f1=0x0;_0x17315d=_0x5db693['charAt'](_0x80a5f1++);~_0x17315d&&(_0x2b5ef5=_0xd7c0e9%0x4?_0x2b5ef5*0x40+_0x17315d:_0x17315d,_0xd7c0e9++%0x4)?_0x125789+=String['fromCharCode'](0xff&_0x2b5ef5>>(-0x2*_0xd7c0e9&0x6)):0x0){_0x17315d=_0x387aef['indexOf'](_0x17315d);}for(let _0x372956=0x0,_0x358475=_0x125789['length'];_0x372956<_0x358475;_0x372956++){_0x564a6b+='%'+('00'+_0x125789['charCodeAt'](_0x372956)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x564a6b);};_0x456c['ENOBkQ']=_0x184268,_0x456c['clwRDm']={},_0x456c['CgeZXM']=!![];}const _0x4d56cf=_0x967317[0x0],_0x439416=_0x1d13bf+_0x4d56cf,_0x39e880=_0x456c['clwRDm'][_0x439416];return!_0x39e880?(_0x456ca2=_0x456c['ENOBkQ'](_0x456ca2),_0x456c['clwRDm'][_0x439416]=_0x456ca2):_0x456ca2=_0x39e880,_0x456ca2;}import{getCrudConfig}from'./style';function _0x9673(){const _0x204aba=['nNLrrNbKsG','mtu2z2HZD01X','mZa4mJe1merWvfPPCG','mtC1mJfsDe5eBg0','yxbP','mtfPv0v5y1y','mtyWodu1mLzSsxLjuG','mteXCfLXA0LN','mtG0wKPlvhLy','mta4mdrbDwLjt2u','mZa1nMD3ELj3uW','CgfNAw5HDgLVBG','mZq3z2rhqxfK','mJqXnZyXr2z4Bxfx','C29YDa','BgfIzwW','C2vHCMnO','mZG5nZu1AvvPvKv5'];_0x9673=function(){return _0x204aba;};return _0x9673();}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(_0x125789){const _0x2cd363=_0x456c,_0x564a6b=getCrudConfig()['dict'];if(!_0x125789)return{..._0x564a6b,'label':{..._0x564a6b['label']}};return{..._0x564a6b,..._0x125789,'api':{..._0x564a6b[_0x2cd363(0x1b6)],..._0x125789[_0x2cd363(0x1b6)]},'pagination':{..._0x564a6b[_0x2cd363(0x1bd)],..._0x125789[_0x2cd363(0x1bd)]},'search':{..._0x564a6b[_0x2cd363(0x1c2)],..._0x125789['search']},'sort':{..._0x564a6b[_0x2cd363(0x1c0)],..._0x125789[_0x2cd363(0x1c0)]},'label':{..._0x564a6b[_0x2cd363(0x1c1)],..._0x125789[_0x2cd363(0x1c1)]}};}export function mergePermission(_0xd7c0e9,_0x2b5ef5){return{...DEFAULT_CRUD_PERMISSION,..._0x2b5ef5,..._0xd7c0e9};}
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 _0x4a3814=_0x5d9b;(function(_0x322690,_0x372369){const _0x5b9b91=_0x5d9b,_0x43314c=_0x322690();while(!![]){try{const _0x5a2873=-parseInt(_0x5b9b91(0xc8))/0x1*(-parseInt(_0x5b9b91(0xc9))/0x2)+parseInt(_0x5b9b91(0xb7))/0x3+parseInt(_0x5b9b91(0xc5))/0x4*(parseInt(_0x5b9b91(0xa9))/0x5)+parseInt(_0x5b9b91(0xcb))/0x6*(-parseInt(_0x5b9b91(0xb5))/0x7)+-parseInt(_0x5b9b91(0xc6))/0x8*(-parseInt(_0x5b9b91(0xac))/0x9)+-parseInt(_0x5b9b91(0xbf))/0xa*(-parseInt(_0x5b9b91(0xc2))/0xb)+parseInt(_0x5b9b91(0xb8))/0xc*(-parseInt(_0x5b9b91(0xba))/0xd);if(_0x5a2873===_0x372369)break;else _0x43314c['push'](_0x43314c['shift']());}catch(_0x30c665){_0x43314c['push'](_0x43314c['shift']());}}}(_0x1c85,0xcc64f));import{createApp,h,ref}from'vue';function _0x5d9b(_0x2d1013,_0x49a5d4){_0x2d1013=_0x2d1013-0xa9;const _0x1c8550=_0x1c85();let _0x5d9b07=_0x1c8550[_0x2d1013];if(_0x5d9b['LzklvQ']===undefined){var _0x55040c=function(_0x41e21a){const _0x5b67c9='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x569966='',_0x430a1d='';for(let _0x39c684=0x0,_0x314703,_0x5a9265,_0x3f1f2b=0x0;_0x5a9265=_0x41e21a['charAt'](_0x3f1f2b++);~_0x5a9265&&(_0x314703=_0x39c684%0x4?_0x314703*0x40+_0x5a9265:_0x5a9265,_0x39c684++%0x4)?_0x569966+=String['fromCharCode'](0xff&_0x314703>>(-0x2*_0x39c684&0x6)):0x0){_0x5a9265=_0x5b67c9['indexOf'](_0x5a9265);}for(let _0x36e910=0x0,_0x8f4874=_0x569966['length'];_0x36e910<_0x8f4874;_0x36e910++){_0x430a1d+='%'+('00'+_0x569966['charCodeAt'](_0x36e910)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x430a1d);};_0x5d9b['HSFYgZ']=_0x55040c,_0x5d9b['mRVMMd']={},_0x5d9b['LzklvQ']=!![];}const _0x414c37=_0x1c8550[0x0],_0x356218=_0x2d1013+_0x414c37,_0x3523ae=_0x5d9b['mRVMMd'][_0x356218];return!_0x3523ae?(_0x5d9b07=_0x5d9b['HSFYgZ'](_0x5d9b07),_0x5d9b['mRVMMd'][_0x356218]=_0x5d9b07):_0x5d9b07=_0x3523ae,_0x5d9b07;}import{Dialog,DialogContent,DialogFooter,DialogHeader,DialogTitle}from'#vome-host/components/ui/dialog';export function vmConfirm(_0x569966){const _0x56c574=_0x5d9b,_0x430a1d=typeof _0x569966===_0x56c574(0xbd)?{'message':_0x569966}:_0x569966;return new Promise(_0x39c684=>{const _0x5e6d40=_0x56c574,_0x314703=ref(!![]),_0x5a9265=document['createElement']('div');document['body'][_0x5e6d40(0xb9)](_0x5a9265);const _0x3f1f2b=createApp({'setup'(){const _0xaffb7b=_0x5e6d40;function _0x36e910(_0x8f4874){_0x314703['value']=![],_0x39c684(_0x8f4874),setTimeout(()=>{const _0x15e6a2=_0x5d9b;_0x3f1f2b[_0x15e6a2(0xc4)](),_0x5a9265['remove']();},0xc8);}return()=>h(Dialog,{'open':_0x314703[_0xaffb7b(0xb4)],'onUpdate:open':_0x21095a=>{if(!_0x21095a)_0x36e910(![]);}},{'default':()=>h(DialogContent,{'class':_0xaffb7b(0xb3),'showCloseButton':![]},{'default':()=>[h(DialogHeader,{'class':_0xaffb7b(0xbc)},()=>h(DialogTitle,{'class':'vm-confirm__title'},()=>_0x430a1d[_0xaffb7b(0xca)]||'提示')),h(_0xaffb7b(0xb2),{'class':_0xaffb7b(0xad)},_0x430a1d[_0xaffb7b(0xab)]),h(DialogFooter,{'class':'vm-confirm__foot'},()=>[h(_0xaffb7b(0xc3),{'type':'button','class':_0xaffb7b(0xb1),'onClick':()=>_0x36e910(![])},_0x430a1d['cancelText']||'取消'),h('button',{'type':'button','class':_0xaffb7b(0xc0),'onClick':()=>_0x36e910(!![])},_0x430a1d[_0xaffb7b(0xbe)]||'确定')])]})});}});_0x3f1f2b[_0x5e6d40(0xaf)](_0x5a9265);});}function _0x1c85(){const _0x18ce70=['DM0Ty29UzMLYBv9FyNrUigLZlwDOB3n0','zgL2','DM0Ty29UzMLYBq','DMfSDwu','n3bLu21Yzq','AgvHza','mtaYntaYofjAENDiuq','mJi1nJyWBhnvy1zw','yxbWzw5Kq2HPBgq','mtq0m0nVtg9rzq','cI52Bs1JB25MAxjTw2rHDgeTC2XVDd0NzgLHBg9NlwnVBNrLBNqNxsb7cIaGD2LKDgG6ig1PBIG0mdbWEcWGy2fSyYGXmdb2DYaTidmYChGPksaHAw1WB3j0yw50oWOGig1HEc13Awr0AdOGBwLUkdqWmhb4lcbJywXJkdeWmhz3ic0GmZjWEcKPicfPBxbVCNrHBNq7cIaGz2fWoIaWicfPBxbVCNrHBNq7cIaGCgfKzgLUzZOGmcaHAw1WB3j0yw50oWOGigjVCMrLCJOGBM9UzsaHAw1WB3j0yw50oWOGigjVCMrLCI1YywrPDxm6idi0ChGGiwLTCg9YDgfUDdSkicbIB3GTC2HHzg93oIb2yxiOls1ZAgfKB3CTC29MDcKGiwLTCg9YDgfUDdSkFqOUDM0Ty29UzMLYBv9FAgvHzcb7ihbHzgrPBMC6ide4ChGGmJjWEcaWoYbIB3jKzxiTyM90Dg9ToIbUB25LoYb9cI52Bs1JB25MAxjTx190AxrSzsb7igzVBNqTC2L6ztOGmtzWEdSGzM9UDc13zwLNAhq6idy1mdSGFqOUDM0Ty29UzMLYBv9FyM9KEsb7cIaGCgfKzgLUzZOGmtjWEcaYmNb4idHWEdSkicbJB2XVCJOGDMfYkc0TzM9YzwDYB3vUzcK7cIaGzM9UDc1ZAxPLoIaXnhb4oWOGigXPBMuTAgvPz2H0oIaXlJy7cN0klNzTlwnVBMzPCM1Fx2zVB3qGEWOGigrPC3bSyxK6igzSzxG7cIaGANvZDgLMEs1JB250zw50oIbMBgv4lwvUzdSkicbNyxa6idHWEdSkicbWywrKAw5NoIaXnhb4idiYChG7cN0klNzTlwnVBMzPCM1Fx2j0BIb7cIaGAgvPz2H0oIaZnNb4oWOGihbHzgrPBMC6idaGmtzWEdSkicbIB3jKzxi6ig5VBMu7cIaGyM9YzgvYlxjHzgL1CZOGmtjWEdSkicbMB250lxnPEMu6ideZChG7cIaGzM9UDc13zwLNAhq6idyWmdSkicbJDxjZB3i6ihbVAw50zxi7cN0klNzTlwnVBMzPCM1Fx2j0BI5PCY1WCMLTyxj5ihSGyMfJA2DYB3vUzdOGDMfYkc0TyNjHBMqPoYbJB2XVCJOGi2zMzJSGFqOUDM0Ty29UzMLYBv9FyNrUlMLZlxbYAw1HCNK6Ag92zxiGEYbIywnRz3jVDw5KoIb2yxiOls1ICMfUzc1KzwvWktSGFqOUDM0Ty29UzMLYBv9FyNrUlMLZlwDOB3n0ihSGyMfJA2DYB3vUzdOGDMfYkc0TBxv0zwqPoYbJB2XVCJOGDMfYkc0TzM9YzwDYB3vUzcK7ih0k','DM0Ty29UzMLYBv9FAgvHza','C3rYAw5N','y29UzMLYBvrLEhq','nZy4odG2men2AfDtAW','DM0Ty29UzMLYBv9FyNrUigLZlxbYAw1HCNK','y3jLyxrLrwXLBwvUDa','mtfsB3zvrNC','yNv0Dg9U','Dw5TB3vUDa','mta4DgXSuhHs','nJK1nJKXmNjsywruAW','z2v0rwXLBwvUDej5swq','mJeYnZGZt2jwzg5x','ngnvrwfewG','DgL0Bgu','mteXotCWmNbVDgfZvq','mtmWnJm1seHgB09p','DM0Ty29UzMLYBs1ZDhLSzq','BwvZC2fNzq','ovbur1L4Bq','DM0Ty29UzMLYBv9FyM9KEq','C3r5Bgu','Bw91BNq','Dw5KzwzPBMvK'];_0x1c85=function(){return _0x18ce70;};return _0x1c85();}if(typeof document!==_0x4a3814(0xb0)&&!document[_0x4a3814(0xc7)](_0x4a3814(0xaa))){const style=document[_0x4a3814(0xc1)](_0x4a3814(0xae));style['id']=_0x4a3814(0xaa),style['textContent']=_0x4a3814(0xbb),document[_0x4a3814(0xb6)][_0x4a3814(0xb9)](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);}