jvs-ppt-ui 0.0.6 → 0.0.8

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.
@@ -165,7 +165,7 @@ function getElementPattern(el: any): string | undefined {
165
165
  if (typeof val === 'string') {
166
166
  pattern = val
167
167
  } else if (val && typeof val === 'object') {
168
- pattern = val.base64 || val.ref || val.src || val.url || ''
168
+ pattern = val.blob || val.base64 || val.src || val.url || ''
169
169
  }
170
170
  }
171
171
  }
@@ -378,7 +378,9 @@ onMounted(() => {
378
378
  updateScale()
379
379
  window.addEventListener('resize', updateScale)
380
380
  }
381
- updateFullscreenState()
381
+ // 注意:不能在挂载时同步跑 updateFullscreenState——进入放映时 requestFullscreen 是异步授权,
382
+ // 挂载瞬间 fullscreenElement 尚为 null,会被误判为"已退出全屏"而立即 stopPresentation;
383
+ // 全屏状态同步只交给 fullscreenchange 事件
382
384
  document.addEventListener('fullscreenchange', updateFullscreenState)
383
385
  })
384
386
 
@@ -553,7 +555,7 @@ function getElementPattern(el: any): string | undefined {
553
555
  if (typeof val === 'string') {
554
556
  pattern = val
555
557
  } else if (val && typeof val === 'object') {
556
- pattern = val.base64 || val.ref || val.src || val.url || ''
558
+ pattern = val.blob || val.base64 || val.src || val.url || ''
557
559
  }
558
560
  }
559
561
  }
@@ -850,12 +850,9 @@ const measure = () => {
850
850
  const el = getSlideListEl()
851
851
  if (!el) return
852
852
  const thumbEl = el.querySelector('.slide-thumb')
853
- if (thumbEl) {
854
- thumbWidth.value = thumbEl.clientWidth
855
- } else {
856
- const listWidth = el.clientWidth
857
- thumbWidth.value = Math.max(100, listWidth - 24 - 8 - 24)
858
- }
853
+ const next = thumbEl ? thumbEl.clientWidth : Math.max(100, el.clientWidth - 24 - 8 - 24)
854
+ // 同值守卫:thumbWidth 变化会触发全列表缩略图重算,RO 回调里值未变时不要写
855
+ if (next > 0 && next !== thumbWidth.value) thumbWidth.value = next
859
856
  }
860
857
 
861
858
  function isPerspectivePreset(presetName?: string): boolean {
@@ -1499,7 +1496,7 @@ function getElementPattern(el: any): string | undefined {
1499
1496
  if (el.pattern || el.style?.pattern) return el.pattern || el.style?.pattern
1500
1497
  const rawFill = (el.style && el.style.fill !== undefined) ? el.style.fill : el.fill
1501
1498
  if (rawFill && typeof rawFill === 'object' && (rawFill.type === 'image' || rawFill.type === 'pattern')) {
1502
- return rawFill.value?.src || rawFill.value?.url || rawFill.value
1499
+ return rawFill.value?.blob || rawFill.value?.src || rawFill.value?.base64 || rawFill.value?.url || (typeof rawFill.value === 'string' ? rawFill.value : undefined)
1503
1500
  }
1504
1501
  return undefined
1505
1502
  }
@@ -2095,7 +2092,7 @@ const masterGroupedLayouts = computed(() => {
2095
2092
 
2096
2093
  <!-- Regular Sidebar Layouts -->
2097
2094
  <template v-else>
2098
- <div class="sidebar-add-slide-container" style="padding: 12px 16px; display: flex;">
2095
+ <div class="sidebar-add-slide-container" style="padding: 12px 16px; display: flex; flex-shrink: 0;">
2099
2096
  <div class="custom-split-button">
2100
2097
  <!-- Main Add Slide Button -->
2101
2098
  <button @click="addSlide" class="split-btn-left">
@@ -2832,6 +2829,9 @@ const masterGroupedLayouts = computed(() => {
2832
2829
  border-radius: 6px;
2833
2830
  height: 36px;
2834
2831
  width: 100%;
2832
+ box-sizing: border-box;
2833
+ white-space: nowrap;
2834
+ flex-shrink: 0;
2835
2835
  transition: background-color 0.2s;
2836
2836
  }
2837
2837
 
@@ -2855,6 +2855,10 @@ const masterGroupedLayouts = computed(() => {
2855
2855
  cursor: pointer;
2856
2856
  padding-left: 12px;
2857
2857
  padding-right: 8px;
2858
+ box-sizing: border-box;
2859
+ white-space: nowrap;
2860
+ flex-shrink: 0;
2861
+ line-height: 1;
2858
2862
  transition: background-color 0.2s;
2859
2863
  }
2860
2864
 
@@ -2873,6 +2877,9 @@ const masterGroupedLayouts = computed(() => {
2873
2877
  align-items: center;
2874
2878
  justify-content: center;
2875
2879
  cursor: pointer;
2880
+ box-sizing: border-box;
2881
+ flex-shrink: 0;
2882
+ line-height: 1;
2876
2883
  transition: background-color 0.2s;
2877
2884
  }
2878
2885
 
@@ -346,8 +346,9 @@ async function handleVideoFileChange(e: Event) {
346
346
  })
347
347
  })
348
348
  if (url) {
349
- mediaUrl.value = url
350
- notify('已选择本地视频文件')
349
+ addElement('video', url)
350
+ mediaPopoverVisible.value = false
351
+ notify('已成功添加视频')
351
352
  }
352
353
  } catch (err: any) {
353
354
  console.error(err)
@@ -370,8 +371,9 @@ async function handleAudioFileChange(e: Event) {
370
371
  })
371
372
  })
372
373
  if (url) {
373
- mediaUrl.value = url
374
- notify('已选择本地音频文件')
374
+ addElement('audio', url)
375
+ mediaPopoverVisible.value = false
376
+ notify('已成功添加音频')
375
377
  }
376
378
  } catch (err: any) {
377
379
  console.error(err)