html2pptx-local-mcp 1.1.36 → 1.1.37
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.
|
@@ -687,36 +687,6 @@ function ImageAssetSection({ element, ui, assetTools, onChange }) {
|
|
|
687
687
|
</div>
|
|
688
688
|
) : null}
|
|
689
689
|
|
|
690
|
-
<div style={{ display: 'flex', alignItems: 'center', gap: 6, marginBottom: 8 }}>
|
|
691
|
-
<span style={{ fontSize: 11, color: '#9a9a9a' }}>{ui.saveTo}</span>
|
|
692
|
-
{[
|
|
693
|
-
['project', ui.assetScopeProject],
|
|
694
|
-
['global', ui.assetScopeGlobal],
|
|
695
|
-
].map(([value, label]) => (
|
|
696
|
-
<button
|
|
697
|
-
key={value}
|
|
698
|
-
type="button"
|
|
699
|
-
onClick={() => assetTools.setScope?.(value)}
|
|
700
|
-
style={{
|
|
701
|
-
flex: 1,
|
|
702
|
-
height: 26,
|
|
703
|
-
fontSize: 11.5,
|
|
704
|
-
fontWeight: 600,
|
|
705
|
-
cursor: 'pointer',
|
|
706
|
-
borderRadius: 6,
|
|
707
|
-
border: '1px solid ' + (scope === value ? '#0D99FF' : '#e0e0e0'),
|
|
708
|
-
background: scope === value ? 'rgba(13,153,255,0.12)' : '#fff',
|
|
709
|
-
color: scope === value ? '#0D78CC' : '#666',
|
|
710
|
-
}}
|
|
711
|
-
>
|
|
712
|
-
{label}
|
|
713
|
-
</button>
|
|
714
|
-
))}
|
|
715
|
-
</div>
|
|
716
|
-
|
|
717
|
-
<button type="button" className="ppt-lumina-add" disabled={busy} onClick={() => fileInputRef.current?.click()}>
|
|
718
|
-
{busy ? ui.uploading : isImg ? ui.replaceImage : isVideo ? ui.replaceVideo : ui.insertImage}
|
|
719
|
-
</button>
|
|
720
690
|
<input
|
|
721
691
|
ref={fileInputRef}
|
|
722
692
|
type="file"
|
|
@@ -732,67 +702,94 @@ function ImageAssetSection({ element, ui, assetTools, onChange }) {
|
|
|
732
702
|
<p style={{ margin: '6px 0 0', fontSize: 11, color: '#d23' }}>{error}</p>
|
|
733
703
|
) : null}
|
|
734
704
|
|
|
735
|
-
<div style={{ marginTop:
|
|
705
|
+
<div style={{ marginTop: 4 }}>
|
|
736
706
|
<h4 style={{ margin: '0 0 6px', fontSize: 11, fontWeight: 600, color: '#9a9a9a' }}>{ui.savedAssets}</h4>
|
|
737
|
-
{
|
|
738
|
-
<
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
{
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
)
|
|
772
|
-
|
|
707
|
+
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(4, 1fr)', gap: 6 }}>
|
|
708
|
+
<button
|
|
709
|
+
type="button"
|
|
710
|
+
disabled={busy}
|
|
711
|
+
onClick={() => fileInputRef.current?.click()}
|
|
712
|
+
title={ui.insertImage}
|
|
713
|
+
style={{
|
|
714
|
+
aspectRatio: '1 / 1',
|
|
715
|
+
display: 'flex',
|
|
716
|
+
alignItems: 'center',
|
|
717
|
+
justifyContent: 'center',
|
|
718
|
+
cursor: busy ? 'wait' : 'pointer',
|
|
719
|
+
borderRadius: 6,
|
|
720
|
+
border: '1px dashed #c8c8c8',
|
|
721
|
+
background: '#fafafa',
|
|
722
|
+
color: '#9a9a9a',
|
|
723
|
+
fontSize: 22,
|
|
724
|
+
lineHeight: 1,
|
|
725
|
+
}}
|
|
726
|
+
>
|
|
727
|
+
{busy ? '…' : '+'}
|
|
728
|
+
</button>
|
|
729
|
+
{assets.map((asset) => {
|
|
730
|
+
const kind = asset.kind || assetKindFromName(asset.src || asset.name);
|
|
731
|
+
const preview = assetTools.resolveAssetUrl?.(asset.src) || '';
|
|
732
|
+
const payload = JSON.stringify({ src: asset.src, name: asset.name, kind });
|
|
733
|
+
return (
|
|
734
|
+
<div key={asset.src} style={{ position: 'relative', minWidth: 0 }}>
|
|
735
|
+
<button
|
|
736
|
+
type="button"
|
|
737
|
+
title={`${asset.name} - ${ui.dragAssetHint}`}
|
|
738
|
+
draggable
|
|
739
|
+
onDragStart={(event) => {
|
|
740
|
+
event.dataTransfer.effectAllowed = 'copy';
|
|
741
|
+
event.dataTransfer.setData('application/x-edit-slide-asset', payload);
|
|
742
|
+
event.dataTransfer.setData('text/plain', asset.src);
|
|
743
|
+
}}
|
|
744
|
+
onClick={() => applyAssetSrc(asset.src, kind)}
|
|
745
|
+
style={{
|
|
746
|
+
padding: 0,
|
|
747
|
+
width: '100%',
|
|
748
|
+
aspectRatio: '1 / 1',
|
|
749
|
+
cursor: 'grab',
|
|
750
|
+
borderRadius: 6,
|
|
751
|
+
border: '1px solid #e6e6e6',
|
|
752
|
+
background: '#fafafa',
|
|
753
|
+
overflow: 'hidden',
|
|
754
|
+
display: 'block',
|
|
755
|
+
}}
|
|
756
|
+
>
|
|
757
|
+
{kind === 'video' ? (
|
|
758
|
+
<video src={preview} muted playsInline style={{ width: '100%', height: '100%', objectFit: 'cover' }} />
|
|
759
|
+
) : (
|
|
760
|
+
<img src={preview} alt={asset.name} style={{ width: '100%', height: '100%', objectFit: 'contain' }} />
|
|
761
|
+
)}
|
|
762
|
+
</button>
|
|
763
|
+
{kind === 'image' ? (
|
|
773
764
|
<button
|
|
774
765
|
type="button"
|
|
775
766
|
onClick={() => applyAssetBackground(asset.src, kind)}
|
|
776
|
-
|
|
777
|
-
title={kind === 'image' ? ui.applyBackground : 'Video cannot be used as a CSS background'}
|
|
767
|
+
title={ui.applyBackground}
|
|
778
768
|
style={{
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
769
|
+
position: 'absolute',
|
|
770
|
+
right: 3,
|
|
771
|
+
bottom: 3,
|
|
772
|
+
padding: '1px 4px',
|
|
773
|
+
fontSize: 8,
|
|
774
|
+
fontWeight: 700,
|
|
775
|
+
lineHeight: 1.2,
|
|
776
|
+
color: '#fff',
|
|
777
|
+
background: 'rgba(0,0,0,0.55)',
|
|
778
|
+
border: 'none',
|
|
779
|
+
borderRadius: 4,
|
|
780
|
+
cursor: 'pointer',
|
|
787
781
|
}}
|
|
788
782
|
>
|
|
789
|
-
|
|
783
|
+
BG
|
|
790
784
|
</button>
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
785
|
+
) : null}
|
|
786
|
+
</div>
|
|
787
|
+
);
|
|
788
|
+
})}
|
|
789
|
+
</div>
|
|
790
|
+
{assets.length === 0 ? (
|
|
791
|
+
<p style={{ margin: '6px 0 0', fontSize: 11, color: '#b0b0b0' }}>{ui.noSavedAssets}</p>
|
|
792
|
+
) : null}
|
|
796
793
|
</div>
|
|
797
794
|
</>
|
|
798
795
|
)}
|