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: 12 }}>
705
+ <div style={{ marginTop: 4 }}>
736
706
  <h4 style={{ margin: '0 0 6px', fontSize: 11, fontWeight: 600, color: '#9a9a9a' }}>{ui.savedAssets}</h4>
737
- {assets.length === 0 ? (
738
- <p style={{ margin: 0, fontSize: 11.5, color: '#b0b0b0' }}>{ui.noSavedAssets}</p>
739
- ) : (
740
- <div style={{ display: 'grid', gridTemplateColumns: 'repeat(4, 1fr)', gap: 6 }}>
741
- {assets.map((asset) => {
742
- const kind = asset.kind || assetKindFromName(asset.src || asset.name);
743
- const preview = assetTools.resolveAssetUrl?.(asset.src) || '';
744
- const payload = JSON.stringify({ src: asset.src, name: asset.name, kind });
745
- return (
746
- <div key={asset.src} style={{ display: 'flex', flexDirection: 'column', gap: 4, minWidth: 0 }}>
747
- <button
748
- type="button"
749
- title={`${asset.name} - ${ui.dragAssetHint}`}
750
- draggable
751
- onDragStart={(event) => {
752
- event.dataTransfer.effectAllowed = 'copy';
753
- event.dataTransfer.setData('application/x-edit-slide-asset', payload);
754
- event.dataTransfer.setData('text/plain', asset.src);
755
- }}
756
- onClick={() => applyAssetSrc(asset.src, kind)}
757
- style={{
758
- padding: 0,
759
- aspectRatio: '1 / 1',
760
- cursor: 'grab',
761
- borderRadius: 6,
762
- border: '1px solid #e6e6e6',
763
- background: '#fafafa',
764
- overflow: 'hidden',
765
- }}
766
- >
767
- {kind === 'video' ? (
768
- <video src={preview} muted playsInline style={{ width: '100%', height: '100%', objectFit: 'cover' }} />
769
- ) : (
770
- <img src={preview} alt={asset.name} style={{ width: '100%', height: '100%', objectFit: 'contain' }} />
771
- )}
772
- </button>
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
- disabled={kind !== 'image'}
777
- title={kind === 'image' ? ui.applyBackground : 'Video cannot be used as a CSS background'}
767
+ title={ui.applyBackground}
778
768
  style={{
779
- border: '1px solid #e6e6e6',
780
- borderRadius: 5,
781
- background: '#fff',
782
- color: kind === 'image' ? '#444' : '#aaa',
783
- cursor: kind === 'image' ? 'pointer' : 'not-allowed',
784
- fontSize: 9,
785
- padding: '3px 2px',
786
- lineHeight: 1.1,
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
- {ui.applyBackground}
783
+ BG
790
784
  </button>
791
- </div>
792
- );
793
- })}
794
- </div>
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
  )}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "html2pptx-local-mcp",
3
- "version": "1.1.36",
3
+ "version": "1.1.37",
4
4
  "type": "module",
5
5
  "description": "Local stdio MCP server for opening html2pptx slide HTML in the local edit-slide editor.",
6
6
  "bin": {