jvs-ppt-ui 0.0.21 → 0.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/jvs-ppt-ui.es.js +14723 -14499
- package/dist/lib/jvs-ppt-ui.umd.js +98 -98
- package/dist/lib/style.css +1 -1
- package/package.json +2 -2
- package/src/components/CanvasArea.vue +24 -1
- package/src/components/PptEditor.vue +1 -1
- package/src/components/SidebarRight.vue +63 -11
- package/src/components/TemplateGallery.vue +13 -18
- package/src/components/material/CreateMaterialPanel.vue +6 -7
- package/src/components/material/MyAssetsPanel.vue +63 -23
- package/src/components/material/VideoCoverThumb.vue +411 -0
- package/src/composables/sidebar/useSidebarMultiSelect.ts +15 -1
- package/src/composables/useSlides.ts +19 -3
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jvs-ppt-ui",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.22",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/lib/jvs-ppt-ui.umd.js",
|
|
7
7
|
"module": "./dist/lib/jvs-ppt-ui.es.js",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
],
|
|
23
23
|
"scripts": {
|
|
24
24
|
"dev": "vite",
|
|
25
|
-
"build": "node scripts/patch-pptxtojson.cjs && vue-tsc -b && vite build",
|
|
25
|
+
"build": "node scripts/patch-pptxtojson.cjs && vue-tsc -b && vite build && vite build --config vite.config.lib.ts",
|
|
26
26
|
"build:web": "node scripts/patch-pptxtojson.cjs && vite build --config vite.config.web.ts",
|
|
27
27
|
"build:lib": "node scripts/patch-pptxtojson.cjs && vite build --config vite.config.lib.ts",
|
|
28
28
|
"preview": "vite preview",
|
|
@@ -5960,12 +5960,35 @@ function changeQuickTextAlign(el: any, align: string) {
|
|
|
5960
5960
|
}
|
|
5961
5961
|
if (targetEl.text && targetEl.text.content) {
|
|
5962
5962
|
targetEl.text.content = updateTextAlignInHtml(targetEl.text.content, align)
|
|
5963
|
+
} else if (typeof targetEl.text === 'string' && targetEl.text) {
|
|
5964
|
+
targetEl.text = updateTextAlignInHtml(targetEl.text, align)
|
|
5965
|
+
}
|
|
5966
|
+
const container = document.getElementById(`editable-${targetEl.id}`)
|
|
5967
|
+
if (container && (!targetEl.content || !targetEl.content.includes('<table')) && !targetEl.latex) {
|
|
5968
|
+
container.style.textAlign = align
|
|
5969
|
+
container.innerHTML = updateTextAlignInHtml(container.innerHTML, align)
|
|
5970
|
+
if (targetEl.type === 'shape') {
|
|
5971
|
+
if (targetEl.text && typeof targetEl.text === 'object') {
|
|
5972
|
+
targetEl.text.content = container.innerHTML
|
|
5973
|
+
} else {
|
|
5974
|
+
targetEl.text = container.innerHTML
|
|
5975
|
+
}
|
|
5976
|
+
} else if (targetEl.type === 'text') {
|
|
5977
|
+
targetEl.content = container.innerHTML
|
|
5978
|
+
}
|
|
5979
|
+
}
|
|
5980
|
+
if (targetEl.type === 'group' && Array.isArray(targetEl.elements)) {
|
|
5981
|
+
targetEl.elements.forEach((child: any) => {
|
|
5982
|
+
if (!child.style) child.style = {}
|
|
5983
|
+
child.style.textAlign = align
|
|
5984
|
+
syncHtmlAlign(child)
|
|
5985
|
+
})
|
|
5963
5986
|
}
|
|
5964
5987
|
}
|
|
5965
5988
|
|
|
5966
5989
|
if (selectedElementIds.value.length > 1 && activeSlide.value) {
|
|
5967
5990
|
// 嵌套感知解析:组合内子元素也要能命中(findElementInSlide 走 elementMaps,含组内子元素)
|
|
5968
|
-
|
|
5991
|
+
const els = selectedElementIds.value.map((id: string) => findElementInSlide(id)).filter((e: any) => Boolean(e))
|
|
5969
5992
|
els.forEach((item: any) => {
|
|
5970
5993
|
if (item.style) item.style.textAlign = align
|
|
5971
5994
|
syncHtmlAlign(item)
|
|
@@ -736,7 +736,7 @@ watch(
|
|
|
736
736
|
(val) => {
|
|
737
737
|
if (isInternalUpdating) return
|
|
738
738
|
if (!val) return
|
|
739
|
-
if (val === lastEmittedModelValue) return
|
|
739
|
+
if (val === lastEmittedModelValue || toRaw(val) === toRaw(lastEmittedModelValue)) return
|
|
740
740
|
loadDeck(val as any)
|
|
741
741
|
},
|
|
742
742
|
{ immediate: true, deep: true }
|
|
@@ -574,14 +574,25 @@ function setStyleVal(prop: string, val: any) {
|
|
|
574
574
|
}
|
|
575
575
|
}
|
|
576
576
|
|
|
577
|
-
if (prop === 'fontFamily' || prop === 'fontSize') {
|
|
577
|
+
if (prop === 'fontFamily' || prop === 'fontSize' || prop === 'textAlign') {
|
|
578
578
|
const container = document.getElementById(`editable-${el.id}`)
|
|
579
|
-
if (container) {
|
|
580
|
-
if (prop === 'fontFamily')
|
|
581
|
-
|
|
582
|
-
|
|
579
|
+
if (container && (!el.content || !el.content.includes('<table')) && !el.latex) {
|
|
580
|
+
if (prop === 'fontFamily') {
|
|
581
|
+
container.style.fontFamily = val
|
|
582
|
+
container.innerHTML = applyTextStyleToHtml(container.innerHTML, { fontFamily: val })
|
|
583
|
+
} else if (prop === 'fontSize') {
|
|
584
|
+
container.style.fontSize = val
|
|
585
|
+
container.innerHTML = applyTextStyleToHtml(container.innerHTML, { fontSize: val })
|
|
586
|
+
} else if (prop === 'textAlign') {
|
|
587
|
+
container.style.textAlign = val
|
|
588
|
+
container.innerHTML = updateTextAlignInHtml(container.innerHTML, val)
|
|
589
|
+
}
|
|
583
590
|
if (el.type === 'shape') {
|
|
584
|
-
el.text
|
|
591
|
+
if (el.text && typeof el.text === 'object') {
|
|
592
|
+
el.text.content = container.innerHTML
|
|
593
|
+
} else {
|
|
594
|
+
el.text = container.innerHTML
|
|
595
|
+
}
|
|
585
596
|
} else {
|
|
586
597
|
el.content = container.innerHTML
|
|
587
598
|
}
|
|
@@ -667,13 +678,25 @@ function setStyleVal(prop: string, val: any) {
|
|
|
667
678
|
}
|
|
668
679
|
}
|
|
669
680
|
|
|
670
|
-
if (prop === 'fontFamily') {
|
|
681
|
+
if (prop === 'fontFamily' || prop === 'fontSize' || prop === 'textAlign') {
|
|
671
682
|
const container = document.getElementById(`editable-${el.id}`)
|
|
672
|
-
if (container) {
|
|
673
|
-
|
|
674
|
-
|
|
683
|
+
if (container && (!el.content || !el.content.includes('<table')) && !el.latex) {
|
|
684
|
+
if (prop === 'fontFamily') {
|
|
685
|
+
container.style.fontFamily = val
|
|
686
|
+
container.innerHTML = applyTextStyleToHtml(container.innerHTML, { fontFamily: val })
|
|
687
|
+
} else if (prop === 'fontSize') {
|
|
688
|
+
container.style.fontSize = val
|
|
689
|
+
container.innerHTML = applyTextStyleToHtml(container.innerHTML, { fontSize: val })
|
|
690
|
+
} else if (prop === 'textAlign') {
|
|
691
|
+
container.style.textAlign = val
|
|
692
|
+
container.innerHTML = updateTextAlignInHtml(container.innerHTML, val)
|
|
693
|
+
}
|
|
675
694
|
if (el.type === 'shape') {
|
|
676
|
-
el.text
|
|
695
|
+
if (el.text && typeof el.text === 'object') {
|
|
696
|
+
el.text.content = container.innerHTML
|
|
697
|
+
} else {
|
|
698
|
+
el.text = container.innerHTML
|
|
699
|
+
}
|
|
677
700
|
} else {
|
|
678
701
|
el.content = container.innerHTML
|
|
679
702
|
}
|
|
@@ -735,6 +758,35 @@ function setStyleVal(prop: string, val: any) {
|
|
|
735
758
|
} else if (prop === 'textAlign') {
|
|
736
759
|
child.text.content = updateTextAlignInHtml(child.text.content, val)
|
|
737
760
|
}
|
|
761
|
+
} else if (typeof child.text === 'string' && child.text) {
|
|
762
|
+
if (prop === 'fontFamily') {
|
|
763
|
+
child.text = applyTextStyleToHtml(child.text, { fontFamily: val })
|
|
764
|
+
} else if (prop === 'fontSize') {
|
|
765
|
+
child.text = applyTextStyleToHtml(child.text, { fontSize: val })
|
|
766
|
+
} else if (prop === 'color' || prop === 'textColor') {
|
|
767
|
+
child.text = applyTextStyleToHtml(child.text, { color: val })
|
|
768
|
+
} else if (prop === 'textBackground') {
|
|
769
|
+
child.text = applyTextStyleToHtml(child.text, { textBackground: val })
|
|
770
|
+
} else if (prop === 'textShadow') {
|
|
771
|
+
child.text = applyTextStyleToHtml(child.text, { textShadow: val })
|
|
772
|
+
} else if (prop === 'textAlign') {
|
|
773
|
+
child.text = updateTextAlignInHtml(child.text, val)
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
if (prop === 'fontFamily' || prop === 'fontSize' || prop === 'textAlign') {
|
|
777
|
+
const childContainer = document.getElementById(`editable-${child.id}`)
|
|
778
|
+
if (childContainer && (!child.content || !child.content.includes('<table')) && !child.latex) {
|
|
779
|
+
if (prop === 'fontFamily') {
|
|
780
|
+
childContainer.style.fontFamily = val
|
|
781
|
+
childContainer.innerHTML = applyTextStyleToHtml(childContainer.innerHTML, { fontFamily: val })
|
|
782
|
+
} else if (prop === 'fontSize') {
|
|
783
|
+
childContainer.style.fontSize = val
|
|
784
|
+
childContainer.innerHTML = applyTextStyleToHtml(childContainer.innerHTML, { fontSize: val })
|
|
785
|
+
} else if (prop === 'textAlign') {
|
|
786
|
+
childContainer.style.textAlign = val
|
|
787
|
+
childContainer.innerHTML = updateTextAlignInHtml(childContainer.innerHTML, val)
|
|
788
|
+
}
|
|
789
|
+
}
|
|
738
790
|
}
|
|
739
791
|
if (child.type === 'group' && Array.isArray(child.elements)) {
|
|
740
792
|
child.elements.forEach(applyToGroupChild)
|
|
@@ -15,6 +15,7 @@ import { isImagePlaceholder } from '../utils/canvas/elementStyles'
|
|
|
15
15
|
import { useDamAuth } from './material/useDamAuth'
|
|
16
16
|
import MyAssetsPanel from './material/MyAssetsPanel.vue'
|
|
17
17
|
import CreateMaterialPanel from './material/CreateMaterialPanel.vue'
|
|
18
|
+
import VideoCoverThumb from './material/VideoCoverThumb.vue'
|
|
18
19
|
|
|
19
20
|
const {
|
|
20
21
|
addElement,
|
|
@@ -855,7 +856,7 @@ function handleSelectMaterial(meta: MaterialItem) {
|
|
|
855
856
|
(resolveActivePlaceholderTargetId ? resolveActivePlaceholderTargetId() : null) ||
|
|
856
857
|
(explicitTargetId && (!currentSelectedEl || currentSelectedEl.id === explicitTargetId)
|
|
857
858
|
? explicitTargetId
|
|
858
|
-
: (currentSelectedEl && isImagePlaceholder(currentSelectedEl) ? currentSelectedEl.id : null))
|
|
859
|
+
: (currentSelectedEl && (isImagePlaceholder(currentSelectedEl) || (currentSelectedEl as any).isPlaceholderReplaced || (currentSelectedEl as any).replaced || (currentSelectedEl as any).fromImagePlaceholder) ? currentSelectedEl.id : null))
|
|
859
860
|
|
|
860
861
|
if (targetPlaceholderId && replacePlaceholderElement) {
|
|
861
862
|
const replaced = replacePlaceholderElement(targetPlaceholderId, targetUrl, {
|
|
@@ -1074,16 +1075,13 @@ watch([() => materialApiUrl?.value, () => materialPageApiUrl?.value, () => mater
|
|
|
1074
1075
|
class="overview-thumb-card"
|
|
1075
1076
|
@click="handleSelectMaterial(item)"
|
|
1076
1077
|
>
|
|
1077
|
-
<
|
|
1078
|
-
v-if="isVideoUrl(getMaterialThumb(item))"
|
|
1079
|
-
:
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
playsinline
|
|
1078
|
+
<VideoCoverThumb
|
|
1079
|
+
v-if="cat.subType === 'Videos' || isVideoMaterial(item) || isVideoUrl(getMaterialThumb(item))"
|
|
1080
|
+
:video-url="item.sourceUrl || item.url || getMaterialThumb(item)"
|
|
1081
|
+
:cover-url="item.coverUrl || item.image || item.thumbnail || (!isVideoUrl(item.previewUrl) ? item.previewUrl : '')"
|
|
1082
|
+
:alt="item.title || cat.label"
|
|
1083
1083
|
class="overview-thumb-img"
|
|
1084
|
-
@
|
|
1085
|
-
@mouseenter="($event.target as HTMLVideoElement)?.play?.()"
|
|
1086
|
-
@mouseleave="($event.target as HTMLVideoElement)?.pause?.()"
|
|
1084
|
+
@loaded="updateRowScrollState(cat.key)"
|
|
1087
1085
|
/>
|
|
1088
1086
|
<img
|
|
1089
1087
|
v-else-if="getMaterialThumb(item)"
|
|
@@ -1217,15 +1215,12 @@ watch([() => materialApiUrl?.value, () => materialPageApiUrl?.value, () => mater
|
|
|
1217
1215
|
class="detail-masonry-card"
|
|
1218
1216
|
@click="handleSelectMaterial(item)"
|
|
1219
1217
|
>
|
|
1220
|
-
<
|
|
1221
|
-
v-if="isVideoUrl(getMaterialThumb(item))"
|
|
1222
|
-
:
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
playsinline
|
|
1218
|
+
<VideoCoverThumb
|
|
1219
|
+
v-if="filterParams.activeSubType === 'Videos' || isVideoMaterial(item) || isVideoUrl(getMaterialThumb(item))"
|
|
1220
|
+
:video-url="item.sourceUrl || item.url || getMaterialThumb(item)"
|
|
1221
|
+
:cover-url="item.coverUrl || item.image || item.thumbnail || (!isVideoUrl(item.previewUrl) ? item.previewUrl : '')"
|
|
1222
|
+
:alt="item.title || '素材'"
|
|
1226
1223
|
class="detail-card-img"
|
|
1227
|
-
@mouseenter="($event.target as HTMLVideoElement)?.play?.()"
|
|
1228
|
-
@mouseleave="($event.target as HTMLVideoElement)?.pause?.()"
|
|
1229
1224
|
/>
|
|
1230
1225
|
<img
|
|
1231
1226
|
v-else-if="getMaterialThumb(item)"
|
|
@@ -3,6 +3,7 @@ import { ref, computed, onMounted, onUnmounted } from 'vue'
|
|
|
3
3
|
import { View, Plus, VideoPlay } from '@element-plus/icons-vue'
|
|
4
4
|
import { useSlides } from '../../composables/useSlides'
|
|
5
5
|
import { useDamAuth } from './useDamAuth'
|
|
6
|
+
import VideoCoverThumb from './VideoCoverThumb.vue'
|
|
6
7
|
import type { MaterialItem } from '../TemplateGallery.vue'
|
|
7
8
|
|
|
8
9
|
export interface ImageModelMetaVO {
|
|
@@ -1165,7 +1166,7 @@ defineExpose({
|
|
|
1165
1166
|
<div v-if="generatedResults.length > 0" class="generated-results-section">
|
|
1166
1167
|
<div class="results-header">
|
|
1167
1168
|
<span class="results-title">本次生成结果 ({{ generatedResults.length }})</span>
|
|
1168
|
-
<span class="results-sub"
|
|
1169
|
+
<span class="results-sub">已同步至「我的空间」</span>
|
|
1169
1170
|
</div>
|
|
1170
1171
|
|
|
1171
1172
|
<div class="results-grid">
|
|
@@ -1175,14 +1176,12 @@ defineExpose({
|
|
|
1175
1176
|
class="result-card"
|
|
1176
1177
|
@click="emit('select', resItem)"
|
|
1177
1178
|
>
|
|
1178
|
-
<
|
|
1179
|
+
<VideoCoverThumb
|
|
1179
1180
|
v-if="resItem.type === 'video'"
|
|
1180
|
-
:
|
|
1181
|
-
|
|
1182
|
-
|
|
1181
|
+
:video-url="resItem.sourceUrl || resItem.url"
|
|
1182
|
+
:cover-url="resItem.coverUrl || resItem.previewUrl"
|
|
1183
|
+
:alt="resItem.title"
|
|
1183
1184
|
class="result-media"
|
|
1184
|
-
@mouseenter="($event.target as HTMLVideoElement)?.play?.()"
|
|
1185
|
-
@mouseleave="($event.target as HTMLVideoElement)?.pause?.()"
|
|
1186
1185
|
/>
|
|
1187
1186
|
<img
|
|
1188
1187
|
v-else
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
} from '@element-plus/icons-vue'
|
|
9
9
|
import { useSlides } from '../../composables/useSlides'
|
|
10
10
|
import { useDamAuth } from './useDamAuth'
|
|
11
|
+
import VideoCoverThumb from './VideoCoverThumb.vue'
|
|
11
12
|
import type { MaterialItem } from '../TemplateGallery.vue'
|
|
12
13
|
|
|
13
14
|
export interface DamProjectItem {
|
|
@@ -204,11 +205,28 @@ function selectFolderNode(proj: DamProjectItem, folder: DamFolderNode) {
|
|
|
204
205
|
reloadAssets()
|
|
205
206
|
}
|
|
206
207
|
|
|
207
|
-
function
|
|
208
|
-
|
|
208
|
+
function isVideoUrlString(url?: string): boolean {
|
|
209
|
+
if (!url) return false
|
|
210
|
+
const u = String(url).split('?')[0].split('#')[0].toLowerCase()
|
|
211
|
+
return (
|
|
212
|
+
u.endsWith('.mp4') ||
|
|
213
|
+
u.endsWith('.webm') ||
|
|
214
|
+
u.endsWith('.mov') ||
|
|
215
|
+
u.endsWith('.m4v') ||
|
|
216
|
+
u.endsWith('.avi') ||
|
|
217
|
+
u.endsWith('.mkv')
|
|
218
|
+
)
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
function isVideoAsset(raw: any, meta?: any): boolean {
|
|
222
|
+
const assetType = String(raw.assetType || raw.mediaType || raw.type || meta?.assetType || '').toUpperCase()
|
|
209
223
|
if (assetType === 'VIDEO') return true
|
|
210
|
-
const
|
|
211
|
-
|
|
224
|
+
const subType = String(raw.assetSubType || meta?.assetSubType || meta?.category || '').toLowerCase()
|
|
225
|
+
if (['videos', 'video', 'footage', 'motion-graphics', 'video-templates'].includes(subType)) return true
|
|
226
|
+
const ext = String(raw.fileExtension || '').toLowerCase()
|
|
227
|
+
if (['mp4', 'webm', 'mov', 'm4v', 'avi', 'mkv'].includes(ext)) return true
|
|
228
|
+
const u = String(raw.fileUrl || raw.url || raw.ossUrl || raw.imageUrl || meta?.sourceUrl || '')
|
|
229
|
+
return isVideoUrlString(u)
|
|
212
230
|
}
|
|
213
231
|
|
|
214
232
|
/**
|
|
@@ -219,7 +237,16 @@ function normalizeDamAsset(raw: any): MaterialItem | null {
|
|
|
219
237
|
// semantic/search 接口返回的条目可能包裹在 asset 属性中
|
|
220
238
|
const entity = raw.asset && typeof raw.asset === 'object' ? { ...raw.asset, score: raw.score } : raw
|
|
221
239
|
|
|
222
|
-
|
|
240
|
+
let meta: any = {}
|
|
241
|
+
if (entity.metaDataJson) {
|
|
242
|
+
try {
|
|
243
|
+
meta = typeof entity.metaDataJson === 'string' ? JSON.parse(entity.metaDataJson) : entity.metaDataJson
|
|
244
|
+
} catch {
|
|
245
|
+
meta = {}
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
const primaryFileUrl =
|
|
223
250
|
entity.fileUrl ||
|
|
224
251
|
entity.imageUrl ||
|
|
225
252
|
entity.ossUrl ||
|
|
@@ -228,17 +255,32 @@ function normalizeDamAsset(raw: any): MaterialItem | null {
|
|
|
228
255
|
entity.previewUrl ||
|
|
229
256
|
entity.sourceUrl ||
|
|
230
257
|
''
|
|
231
|
-
|
|
258
|
+
const metaSourceUrl = meta.sourceUrl || meta.videoUrl || meta.downloadUrl || ''
|
|
259
|
+
if (!primaryFileUrl && !metaSourceUrl) return null
|
|
260
|
+
|
|
261
|
+
const isVid = isVideoAsset(entity, meta)
|
|
262
|
+
|
|
263
|
+
// 针对视频资产,区分真实视频播放源地址 (sourceUrl) 与静态封面图 (coverUrl / previewUrl)
|
|
264
|
+
const videoPlayUrl = isVid
|
|
265
|
+
? (meta._fileIsCoverFallback
|
|
266
|
+
? (metaSourceUrl || primaryFileUrl)
|
|
267
|
+
: (isVideoUrlString(primaryFileUrl) ? primaryFileUrl : (metaSourceUrl || primaryFileUrl)))
|
|
268
|
+
: (primaryFileUrl || metaSourceUrl)
|
|
269
|
+
|
|
270
|
+
const staticCoverCandidate =
|
|
271
|
+
entity.coverUrl ||
|
|
272
|
+
entity.thumbnailUrl ||
|
|
273
|
+
(entity.previewUrl && !isVideoUrlString(entity.previewUrl) ? entity.previewUrl : '') ||
|
|
274
|
+
meta.coverUrl ||
|
|
275
|
+
meta.thumbnail ||
|
|
276
|
+
meta.poster ||
|
|
277
|
+
(meta.previewUrl && !isVideoUrlString(meta.previewUrl) ? meta.previewUrl : '') ||
|
|
278
|
+
(meta.image && !isVideoUrlString(meta.image) ? meta.image : '') ||
|
|
279
|
+
(isVid && primaryFileUrl && !isVideoUrlString(primaryFileUrl) ? primaryFileUrl : '') ||
|
|
280
|
+
''
|
|
232
281
|
|
|
233
|
-
const
|
|
234
|
-
|
|
235
|
-
if (entity.metaDataJson) {
|
|
236
|
-
try {
|
|
237
|
-
meta = typeof entity.metaDataJson === 'string' ? JSON.parse(entity.metaDataJson) : entity.metaDataJson
|
|
238
|
-
} catch {
|
|
239
|
-
meta = {}
|
|
240
|
-
}
|
|
241
|
-
}
|
|
282
|
+
const url = videoPlayUrl || primaryFileUrl
|
|
283
|
+
const previewUrl = isVid ? (staticCoverCandidate || videoPlayUrl) : (entity.previewUrl || staticCoverCandidate || url)
|
|
242
284
|
|
|
243
285
|
const rawTitle =
|
|
244
286
|
entity.name ||
|
|
@@ -270,7 +312,8 @@ function normalizeDamAsset(raw: any): MaterialItem | null {
|
|
|
270
312
|
sourceType: sourceType || (activeSourceSubTab.value === 'ai' ? 'GENERATE' : 'UPLOAD'),
|
|
271
313
|
badgeLabel,
|
|
272
314
|
url,
|
|
273
|
-
previewUrl
|
|
315
|
+
previewUrl,
|
|
316
|
+
coverUrl: staticCoverCandidate || undefined,
|
|
274
317
|
sourceUrl: url,
|
|
275
318
|
originalWidth: w > 0 ? w : undefined,
|
|
276
319
|
originalHeight: h > 0 ? h : undefined,
|
|
@@ -814,15 +857,12 @@ defineExpose({
|
|
|
814
857
|
class="mine-asset-card"
|
|
815
858
|
@click="emit('select', item)"
|
|
816
859
|
>
|
|
817
|
-
<
|
|
860
|
+
<VideoCoverThumb
|
|
818
861
|
v-if="item.type === 'video'"
|
|
819
|
-
:
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
playsinline
|
|
862
|
+
:video-url="item.sourceUrl || item.url"
|
|
863
|
+
:cover-url="item.coverUrl || item.previewUrl"
|
|
864
|
+
:alt="item.title"
|
|
823
865
|
class="mine-card-media"
|
|
824
|
-
@mouseenter="($event.target as HTMLVideoElement)?.play?.()"
|
|
825
|
-
@mouseleave="($event.target as HTMLVideoElement)?.pause?.()"
|
|
826
866
|
/>
|
|
827
867
|
<img
|
|
828
868
|
v-else
|