vome-core 0.1.28 → 0.1.30

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 _0x419692=_0x4599;(function(_0x17b5e6,_0x12dce0){const _0x26ad88=_0x4599,_0x1835db=_0x17b5e6();while(!![]){try{const _0x405c41=-parseInt(_0x26ad88(0x89))/0x1*(parseInt(_0x26ad88(0x8d))/0x2)+-parseInt(_0x26ad88(0x8f))/0x3+-parseInt(_0x26ad88(0x88))/0x4*(parseInt(_0x26ad88(0x7e))/0x5)+parseInt(_0x26ad88(0x83))/0x6+parseInt(_0x26ad88(0x91))/0x7+-parseInt(_0x26ad88(0x7b))/0x8*(parseInt(_0x26ad88(0x85))/0x9)+parseInt(_0x26ad88(0x8e))/0xa*(parseInt(_0x26ad88(0x87))/0xb);if(_0x405c41===_0x12dce0)break;else _0x1835db['push'](_0x1835db['shift']());}catch(_0x2eccc7){_0x1835db['push'](_0x1835db['shift']());}}}(_0x22a4,0x23762));const ORG=_0x419692(0x84);export function serviceUrlFromDocs(_0x3e80a7){const _0x35cdae=_0x419692,_0x36071b=new URL(_0x3e80a7),_0x334577=_0x36071b['hostname']['replace'](/^www\./,'')['replace'](/^service\./,'');return _0x36071b[_0x35cdae(0x7a)]+'//service.'+_0x334577;}export function seatApiBaseFromDocs(_0x460f0e){const _0x1e1a56=_0x419692;return serviceUrlFromDocs(_0x460f0e)+_0x1e1a56(0x77);}function _0x22a4(){const _0x34f6b5=['mti3mdG3mLnZtLbrsa','DM9TzwTQ','mJeXnuf1Cg1uyW','zNvSBa','odeYody3svfuvxfr','mtq5ntzoExjvB2i','mtG5mtnUsuDMvMO','Ahr0Chm6lY92B21LA2OUy29T','6zkP5A2qic8G5PYn5yQH56UV5O+s5lU26isA5OMl5P6277YilNzVBwxVVjRKU4uGC2vYDMvY77Yj77Ym6ycc5zci5lIk5lYG44cb55+T5l+H44cb5PsV5lUy562j6io95yQB5OMP5Bgv44cc','5A6m5Pw05lIA5yQH5QIH5z2x6isA5OMl5P6277YilNzVBwxVVjRLKkSGC2vYDMvYios4JIb3zwlVViNVViZMNkZLNldLVidLJ5hMIzpLJixLKi7LJ5hLUipJGii','mJrgCgrjDKC','odbWA1fQB2u','nte3nJeXEezPAMjt','Ahr0Chm6lY9NAxrLzs5JB20V','mtqZmJyWnKfJy3DcCq','l3jLCg9ZAxrVCNKVyxjJAgL2zs9Tyxn0zxiUEMLW','5yMn56UVicSG5zco56UV','l2fWCc9WBhvNAw5tDg9Yzs9Zzwf0','DM9Tzs1WBhvNAw4TC2vYDMLJzq','zNjVBNrLBMq','ChjVDg9JB2W','otC3nML2Efrgta','57QV5yMn56UV','57QV5zco56UV','mJm1tLnWDezK','z2L0zwu','DM9Tzs1WBhvNAw4TzNjVBNq','Ahr0Chm6lY9NAxrODwiUy29TlW','DM9Tzs1WBhvNAw4TzNvSBa'];_0x22a4=function(){return _0x34f6b5;};return _0x22a4();}export function licenseIssueUrlFromDocs(_0x39f110){return serviceUrlFromDocs(_0x39f110)+'/app/pluginStore/wallet/license/issue';}function giteeArchive(_0xa0f5a){const _0x282894=_0x419692;return _0x282894(0x90)+ORG+'/'+_0xa0f5a+_0x282894(0x75);}function _0x4599(_0x2b39c4,_0x336cbf){_0x2b39c4=_0x2b39c4-0x75;const _0x22a489=_0x22a4();let _0x459990=_0x22a489[_0x2b39c4];if(_0x4599['ZbSNFf']===undefined){var _0x57e9be=function(_0x16a800){const _0x515ed6='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x3e80a7='',_0x36071b='';for(let _0x334577=0x0,_0x460f0e,_0x39f110,_0xa0f5a=0x0;_0x39f110=_0x16a800['charAt'](_0xa0f5a++);~_0x39f110&&(_0x460f0e=_0x334577%0x4?_0x460f0e*0x40+_0x39f110:_0x39f110,_0x334577++%0x4)?_0x3e80a7+=String['fromCharCode'](0xff&_0x460f0e>>(-0x2*_0x334577&0x6)):0x0){_0x39f110=_0x515ed6['indexOf'](_0x39f110);}for(let _0x60f88d=0x0,_0x279804=_0x3e80a7['length'];_0x60f88d<_0x279804;_0x60f88d++){_0x36071b+='%'+('00'+_0x3e80a7['charCodeAt'](_0x60f88d)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x36071b);};_0x4599['CCsyqI']=_0x57e9be,_0x4599['JNmTJu']={},_0x4599['ZbSNFf']=!![];}const _0x5c3ce9=_0x22a489[0x0],_0x28b151=_0x2b39c4+_0x5c3ce9,_0x5ce568=_0x4599['JNmTJu'][_0x28b151];return!_0x5ce568?(_0x459990=_0x4599['CCsyqI'](_0x459990),_0x4599['JNmTJu'][_0x28b151]=_0x459990):_0x459990=_0x5ce568,_0x459990;}function githubArchive(_0x60f88d){return'https://github.com/'+ORG+'/'+_0x60f88d+'/archive/refs/heads/master.zip';}function giteeRepo(_0x279804){return'https://gitee.com/'+ORG+'/'+_0x279804;}function githubRepo(_0x369191){const _0x31f701=_0x419692;return _0x31f701(0x81)+ORG+'/'+_0x369191;}const docsUrl=_0x419692(0x8a);export const pluginDev={'docsUrl':docsUrl,'serviceUrl':serviceUrlFromDocs(docsUrl),'uploadUrl':docsUrl+'/plugins/upload','mirrors':{'prefer':_0x419692(0x7f),'giteeOrg':_0x419692(0x90)+ORG,'githubOrg':_0x419692(0x81)+ORG},'scaffolds':{'full':{'key':_0x419692(0x86),'title':_0x419692(0x76),'desc':_0x419692(0x8c),'repo':_0x419692(0x82),'repoUrl':giteeRepo(_0x419692(0x82)),'githubRepoUrl':githubRepo(_0x419692(0x82)),'downloadUrl':giteeArchive(_0x419692(0x82)),'githubDownloadUrl':githubArchive(_0x419692(0x82))},'backend':{'key':'backend','title':_0x419692(0x7d),'desc':_0x419692(0x8b),'repo':_0x419692(0x78),'repoUrl':giteeRepo(_0x419692(0x78)),'githubRepoUrl':githubRepo(_0x419692(0x78)),'downloadUrl':giteeArchive(_0x419692(0x78)),'githubDownloadUrl':githubArchive(_0x419692(0x78))},'frontend':{'key':_0x419692(0x79),'title':_0x419692(0x7c),'desc':'后台微应用脚手架(.vome:含\x20web/),以\x20wujie\x20挂载独立前端页面。','repo':'vome-plugin-front','repoUrl':giteeRepo('vome-plugin-front'),'githubRepoUrl':githubRepo('vome-plugin-front'),'downloadUrl':giteeArchive(_0x419692(0x80)),'githubDownloadUrl':githubArchive('vome-plugin-front')}}};
@@ -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,66 @@ 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 才能生效 */
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 {
258
491
  height: var(--vm-richtext-height, 320px) !important;
259
- min-height: var(--vm-richtext-height, 320px);
492
+ min-height: var(--vm-richtext-height, 320px) !important;
260
493
  flex-shrink: 0;
261
494
  overflow-y: auto;
495
+ background: var(--card);
262
496
  }
263
497
 
264
498
  .vm-richtext__html {
@@ -290,16 +524,11 @@ onBeforeUnmount(() => {
290
524
  border-radius: 8px;
291
525
  }
292
526
 
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;
527
+ :deep(blockquote) {
528
+ margin: 0.5em 0;
529
+ padding-left: 12px;
530
+ border-left: 3px solid var(--border);
531
+ color: var(--muted-foreground);
303
532
  }
304
533
 
305
534
  :deep(h1),
@@ -320,20 +549,78 @@ onBeforeUnmount(() => {
320
549
  </style>
321
550
 
322
551
  <style lang="scss">
323
- /* wangEditor 全局层:对齐后台 token(勿 scoped,编辑器 DOM 在组件外生成) */
324
- .vm-richtext__shell .w-e-text-container {
325
- background: var(--card);
552
+ .vm-richtext__content .tiptap.vm-richtext__prose {
553
+ min-height: 100%;
554
+ padding: 12px 14px;
555
+ outline: none;
326
556
  color: var(--foreground);
327
- height: var(--vm-richtext-height, 320px) !important;
328
- min-height: var(--vm-richtext-height, 320px);
329
- }
557
+ font-size: 14px;
558
+ line-height: 1.65;
330
559
 
331
- .vm-richtext__shell .w-e-scroll {
332
- background: var(--card);
333
- height: 100% !important;
334
- }
560
+ p {
561
+ margin: 0.45em 0;
562
+ }
335
563
 
336
- .vm-richtext__shell .w-e-bar {
337
- background: var(--muted);
564
+ p.is-editor-empty:first-child::before {
565
+ content: attr(data-placeholder);
566
+ float: left;
567
+ height: 0;
568
+ pointer-events: none;
569
+ color: var(--muted-foreground);
570
+ }
571
+
572
+ h2,
573
+ h3 {
574
+ margin: 0.75em 0 0.35em;
575
+ font-weight: 650;
576
+ line-height: 1.35;
577
+ }
578
+
579
+ ul,
580
+ ol {
581
+ margin: 0.45em 0;
582
+ padding-left: 1.25em;
583
+ }
584
+
585
+ blockquote {
586
+ margin: 0.45em 0;
587
+ padding-left: 12px;
588
+ border-left: 3px solid var(--border);
589
+ color: var(--muted-foreground);
590
+ }
591
+
592
+ a {
593
+ color: var(--brand);
594
+ text-decoration: underline;
595
+ cursor: pointer;
596
+ }
597
+
598
+ img {
599
+ display: block;
600
+ max-width: 100%;
601
+ height: auto;
602
+ margin: 8px 0;
603
+ border-radius: 8px;
604
+ }
605
+
606
+ code {
607
+ padding: 0.1em 0.35em;
608
+ border-radius: 4px;
609
+ background: var(--muted);
610
+ font-size: 0.92em;
611
+ }
612
+
613
+ pre {
614
+ margin: 0.5em 0;
615
+ padding: 10px 12px;
616
+ border-radius: 8px;
617
+ background: var(--muted);
618
+ overflow-x: auto;
619
+
620
+ code {
621
+ padding: 0;
622
+ background: transparent;
623
+ }
624
+ }
338
625
  }
339
626
  </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(_0x1932da,_0x312d6d){const _0x4fe08c=_0x4d96,_0x5dd157=_0x1932da();while(!![]){try{const _0x22921b=parseInt(_0x4fe08c(0x174))/0x1*(-parseInt(_0x4fe08c(0x16f))/0x2)+parseInt(_0x4fe08c(0x16d))/0x3+parseInt(_0x4fe08c(0x176))/0x4+parseInt(_0x4fe08c(0x16b))/0x5*(-parseInt(_0x4fe08c(0x177))/0x6)+-parseInt(_0x4fe08c(0x169))/0x7*(parseInt(_0x4fe08c(0x16c))/0x8)+-parseInt(_0x4fe08c(0x175))/0x9*(parseInt(_0x4fe08c(0x16a))/0xa)+parseInt(_0x4fe08c(0x172))/0xb*(parseInt(_0x4fe08c(0x171))/0xc);if(_0x22921b===_0x312d6d)break;else _0x5dd157['push'](_0x5dd157['shift']());}catch(_0x5290c2){_0x5dd157['push'](_0x5dd157['shift']());}}}(_0x1458,0x921a5));import{getCrudConfig}from'./style';function _0x1458(){const _0x380c82=['mtiXmZC5mKTKvMDovq','mtu3mJe0nfH0DxDdCq','CgfNAw5HDgLVBG','C2vHCMnO','mZmXmtDdB3jdvNC','mtK1ntm1mejvre9Rva','mtbXExfWvfC','mtu0ngnysw1yBG','nda1mZmZyxjLEKjo','BgfIzwW','mMTTswnyBW','yxbP','mZq2mti0ngHoq3PzzW','mtqZuwLtww9L','C29YDa','mte3ndK5n1bsAgfytq','ndv1s0HNvva'];_0x1458=function(){return _0x380c82;};return _0x1458();}function _0x4d96(_0x55d9a6,_0x42b403){_0x55d9a6=_0x55d9a6-0x169;const _0x1458d3=_0x1458();let _0x4d964d=_0x1458d3[_0x55d9a6];if(_0x4d96['BukVPb']===undefined){var _0x3bc27a=function(_0x29d4db){const _0x42232b='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0xb06cff='',_0x7da25a='';for(let _0x169a45=0x0,_0x17ff4c,_0x34d20d,_0xe18bf=0x0;_0x34d20d=_0x29d4db['charAt'](_0xe18bf++);~_0x34d20d&&(_0x17ff4c=_0x169a45%0x4?_0x17ff4c*0x40+_0x34d20d:_0x34d20d,_0x169a45++%0x4)?_0xb06cff+=String['fromCharCode'](0xff&_0x17ff4c>>(-0x2*_0x169a45&0x6)):0x0){_0x34d20d=_0x42232b['indexOf'](_0x34d20d);}for(let _0x35121e=0x0,_0x3bc6d5=_0xb06cff['length'];_0x35121e<_0x3bc6d5;_0x35121e++){_0x7da25a+='%'+('00'+_0xb06cff['charCodeAt'](_0x35121e)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x7da25a);};_0x4d96['VfNyco']=_0x3bc27a,_0x4d96['UeuVdz']={},_0x4d96['BukVPb']=!![];}const _0x219b7c=_0x1458d3[0x0],_0x1f4ccb=_0x55d9a6+_0x219b7c,_0x189f09=_0x4d96['UeuVdz'][_0x1f4ccb];return!_0x189f09?(_0x4d964d=_0x4d96['VfNyco'](_0x4d964d),_0x4d96['UeuVdz'][_0x1f4ccb]=_0x4d964d):_0x4d964d=_0x189f09,_0x4d964d;}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(_0xb06cff){const _0x252561=_0x4d96,_0x7da25a=getCrudConfig()['dict'];if(!_0xb06cff)return{..._0x7da25a,'label':{..._0x7da25a[_0x252561(0x16e)]}};return{..._0x7da25a,..._0xb06cff,'api':{..._0x7da25a[_0x252561(0x170)],..._0xb06cff['api']},'pagination':{..._0x7da25a[_0x252561(0x178)],..._0xb06cff[_0x252561(0x178)]},'search':{..._0x7da25a[_0x252561(0x179)],..._0xb06cff['search']},'sort':{..._0x7da25a[_0x252561(0x173)],..._0xb06cff['sort']},'label':{..._0x7da25a[_0x252561(0x16e)],..._0xb06cff[_0x252561(0x16e)]}};}export function mergePermission(_0x169a45,_0x17ff4c){return{...DEFAULT_CRUD_PERMISSION,..._0x17ff4c,..._0x169a45};}
@@ -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 _0x2c65c8=_0x445e;function _0x445e(_0x423c8d,_0x1f7063){_0x423c8d=_0x423c8d-0x1ee;const _0x24bd9c=_0x24bd();let _0x445eec=_0x24bd9c[_0x423c8d];if(_0x445e['awgLBy']===undefined){var _0x557fed=function(_0x2269e3){const _0x343883='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x4c2489='',_0x3a1dce='';for(let _0x49e353=0x0,_0x20014b,_0x4b2557,_0x558d25=0x0;_0x4b2557=_0x2269e3['charAt'](_0x558d25++);~_0x4b2557&&(_0x20014b=_0x49e353%0x4?_0x20014b*0x40+_0x4b2557:_0x4b2557,_0x49e353++%0x4)?_0x4c2489+=String['fromCharCode'](0xff&_0x20014b>>(-0x2*_0x49e353&0x6)):0x0){_0x4b2557=_0x343883['indexOf'](_0x4b2557);}for(let _0x3c6a56=0x0,_0x30f7e3=_0x4c2489['length'];_0x3c6a56<_0x30f7e3;_0x3c6a56++){_0x3a1dce+='%'+('00'+_0x4c2489['charCodeAt'](_0x3c6a56)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x3a1dce);};_0x445e['NStscl']=_0x557fed,_0x445e['VWiQUc']={},_0x445e['awgLBy']=!![];}const _0x56ee69=_0x24bd9c[0x0],_0x462f42=_0x423c8d+_0x56ee69,_0x403105=_0x445e['VWiQUc'][_0x462f42];return!_0x403105?(_0x445eec=_0x445e['NStscl'](_0x445eec),_0x445e['VWiQUc'][_0x462f42]=_0x445eec):_0x445eec=_0x403105,_0x445eec;}(function(_0xa399f2,_0x5582c6){const _0x2b5a5d=_0x445e,_0xf349e4=_0xa399f2();while(!![]){try{const _0xabce52=-parseInt(_0x2b5a5d(0x202))/0x1*(parseInt(_0x2b5a5d(0x1f4))/0x2)+-parseInt(_0x2b5a5d(0x1ff))/0x3*(-parseInt(_0x2b5a5d(0x1fb))/0x4)+parseInt(_0x2b5a5d(0x204))/0x5*(parseInt(_0x2b5a5d(0x1fd))/0x6)+-parseInt(_0x2b5a5d(0x20f))/0x7+-parseInt(_0x2b5a5d(0x1fe))/0x8*(parseInt(_0x2b5a5d(0x1f7))/0x9)+parseInt(_0x2b5a5d(0x210))/0xa*(parseInt(_0x2b5a5d(0x211))/0xb)+-parseInt(_0x2b5a5d(0x1f0))/0xc*(-parseInt(_0x2b5a5d(0x1f9))/0xd);if(_0xabce52===_0x5582c6)break;else _0xf349e4['push'](_0xf349e4['shift']());}catch(_0x459349){_0xf349e4['push'](_0xf349e4['shift']());}}}(_0x24bd,0x65200));import{createApp,h,ref}from'vue';function _0x24bd(){const _0x113a80=['mty1mdqWCwTHAu1l','nta2BwvlBfvh','DM0Ty29UzMLYBv9FzM9VDa','DM0Ty29UzMLYBv9FyNrUigLZlwDOB3n0','mtm4nJq5mLPUBLjNDW','Dw5TB3vUDa','DgL0Bgu','zgL2','mty0qMXWAuDj','z2v0rwXLBwvUDej5swq','Bw91BNq','mZi2nZiWn0LNEuryuW','C3r5Bgu','mte3zxnntKjs','yxbWzw5Kq2HPBgq','mti5odrAB1DIA0K','DM0Ty29UzMLYBv9FAgvHza','mtm1odK3nNzOtNfpwG','mtzQCxzdsgK','ndG2uwv5ru5u','yNv0Dg9U','cI52Bs1JB25MAxjTw2rHDgeTC2XVDd0NzgLHBg9NlwnVBNrLBNqNxsb7cIaGD2LKDgG6ig1PBIG0mdbWEcWGy2fSyYGXmdb2DYaTidmYChGPksaHAw1WB3j0yw50oWOGig1HEc13Awr0AdOGBwLUkdqWmhb4lcbJywXJkdeWmhz3ic0GmZjWEcKPicfPBxbVCNrHBNq7cIaGz2fWoIaWicfPBxbVCNrHBNq7cIaGCgfKzgLUzZOGmcaHAw1WB3j0yw50oWOGigjVCMrLCJOGBM9UzsaHAw1WB3j0yw50oWOGigjVCMrLCI1YywrPDxm6idi0ChGGiwLTCg9YDgfUDdSkicbIB3GTC2HHzg93oIb2yxiOls1ZAgfKB3CTC29MDcKGiwLTCg9YDgfUDdSkFqOUDM0Ty29UzMLYBv9FAgvHzcb7ihbHzgrPBMC6ide4ChGGmJjWEcaWoYbIB3jKzxiTyM90Dg9ToIbUB25LoYb9cI52Bs1JB25MAxjTx190AxrSzsb7igzVBNqTC2L6ztOGmtzWEdSGzM9UDc13zwLNAhq6idy1mdSGFqOUDM0Ty29UzMLYBv9FyM9KEsb7cIaGCgfKzgLUzZOGmtjWEcaYmNb4idHWEdSkicbJB2XVCJOGDMfYkc0TzM9YzwDYB3vUzcK7cIaGzM9UDc1ZAxPLoIaXnhb4oWOGigXPBMuTAgvPz2H0oIaXlJy7cN0klNzTlwnVBMzPCM1Fx2zVB3qGEWOGigrPC3bSyxK6igzSzxG7cIaGANvZDgLMEs1JB250zw50oIbMBgv4lwvUzdSkicbNyxa6idHWEdSkicbWywrKAw5NoIaXnhb4idiYChG7cN0klNzTlwnVBMzPCM1Fx2j0BIb7cIaGAgvPz2H0oIaZnNb4oWOGihbHzgrPBMC6idaGmtzWEdSkicbIB3jKzxi6ig5VBMu7cIaGyM9YzgvYlxjHzgL1CZOGmtjWEdSkicbMB250lxnPEMu6ideZChG7cIaGzM9UDc13zwLNAhq6idyWmdSkicbJDxjZB3i6ihbVAw50zxi7cN0klNzTlwnVBMzPCM1Fx2j0BI5PCY1WCMLTyxj5ihSGyMfJA2DYB3vUzdOGDMfYkc0TyNjHBMqPoYbJB2XVCJOGi2zMzJSGFqOUDM0Ty29UzMLYBv9FyNrUlMLZlxbYAw1HCNK6Ag92zxiGEYbIywnRz3jVDw5KoIb2yxiOls1ICMfUzc1KzwvWktSGFqOUDM0Ty29UzMLYBv9FyNrUlMLZlwDOB3n0ihSGyMfJA2DYB3vUzdOGDMfYkc0TBxv0zwqPoYbJB2XVCJOGDMfYkc0TzM9YzwDYB3vUzcK7ih0k','odKXnufgDNLZwq','DM0Ty29UzMLYBv9FDgL0Bgu','nuvPzw5kCG','Dgv4DenVBNrLBNq','DM0Ty29UzMLYBv9FyM9KEq','DM0Ty29UzMLYBv9FyNrUigLZlxbYAw1HCNK','y3jLyxrLrwXLBwvUDa','y2fUy2vSvgv4Da','CMvTB3zL','DM0Ty29UzMLYBq','AgvHza','DMfSDwu','Dw5KzwzPBMvK','ndC2mdGXoxjhvunUwa'];_0x24bd=function(){return _0x113a80;};return _0x24bd();}import{Dialog,DialogContent,DialogFooter,DialogHeader,DialogTitle}from'#vome-host/components/ui/dialog';export function vmConfirm(_0x4c2489){const _0x3a1dce=typeof _0x4c2489==='string'?{'message':_0x4c2489}:_0x4c2489;return new Promise(_0x49e353=>{const _0x56e2fc=_0x445e,_0x20014b=ref(!![]),_0x4b2557=document['createElement'](_0x56e2fc(0x1f3));document['body']['appendChild'](_0x4b2557);const _0x558d25=createApp({'setup'(){const _0x16d2d8=_0x56e2fc;function _0x3c6a56(_0x30f7e3){const _0x16bae0=_0x445e;_0x20014b[_0x16bae0(0x20d)]=![],_0x49e353(_0x30f7e3),setTimeout(()=>{const _0x1b0ecf=_0x16bae0;_0x558d25[_0x1b0ecf(0x1f1)](),_0x4b2557[_0x1b0ecf(0x20a)]();},0xc8);}return()=>h(Dialog,{'open':_0x20014b[_0x16d2d8(0x20d)],'onUpdate:open':_0x5d7707=>{if(!_0x5d7707)_0x3c6a56(![]);}},{'default':()=>h(DialogContent,{'class':_0x16d2d8(0x20b),'showCloseButton':![]},{'default':()=>[h(DialogHeader,{'class':_0x16d2d8(0x1fc)},()=>h(DialogTitle,{'class':_0x16d2d8(0x203)},()=>_0x3a1dce[_0x16d2d8(0x1f2)]||'提示')),h('div',{'class':_0x16d2d8(0x206)},_0x3a1dce['message']),h(DialogFooter,{'class':_0x16d2d8(0x1ee)},()=>[h(_0x16d2d8(0x200),{'type':_0x16d2d8(0x200),'class':_0x16d2d8(0x1ef),'onClick':()=>_0x3c6a56(![])},_0x3a1dce[_0x16d2d8(0x209)]||'取消'),h('button',{'type':_0x16d2d8(0x200),'class':_0x16d2d8(0x207),'onClick':()=>_0x3c6a56(!![])},_0x3a1dce['confirmText']||'确定')])]})});}});_0x558d25[_0x56e2fc(0x1f6)](_0x4b2557);});}if(typeof document!==_0x2c65c8(0x20e)&&!document[_0x2c65c8(0x1f5)]('vm-confirm-style')){const style=document[_0x2c65c8(0x208)](_0x2c65c8(0x1f8));style['id']='vm-confirm-style',style[_0x2c65c8(0x205)]=_0x2c65c8(0x201),document[_0x2c65c8(0x20c)][_0x2c65c8(0x1fa)](style);}