Preserve QPowerPoint subtitle lists in PPTX
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { useRef, useState } from "react";
|
||||
import type { CSSProperties } from "react";
|
||||
import { Copy, Download, EyeOff, FileText, FileUp, Image as ImageIcon, Palette, Plus, Save, Trash2 } from "lucide-react";
|
||||
import type { Slide, SlideDeck, SlideImage, SlideTransition } from "../../types";
|
||||
import { Copy, Download, EyeOff, FileText, FileUp, Image as ImageIcon, List, ListOrdered, ListX, Palette, Plus, Save, Trash2 } from "lucide-react";
|
||||
import type { Slide, SlideDeck, SlideImage, SlideListStyle, SlideTransition } from "../../types";
|
||||
import { downloadBlobFile, downloadTextFile } from "../../utils/download";
|
||||
import { exportPptxBlob, importPptxFile } from "../../io/powerPointOffice";
|
||||
import { replaceFileExtension } from "../../io/fileHelpers";
|
||||
@@ -183,6 +183,10 @@ export function QPowerPoint({ deck, onChange }: QPowerPointProps) {
|
||||
setSelectedImageId("");
|
||||
}
|
||||
|
||||
function updateSubtitleListStyle(listStyle: SlideListStyle | "") {
|
||||
updateSlide({ ...activeSlide, subtitleListStyle: listStyle || undefined });
|
||||
}
|
||||
|
||||
function addSlide() {
|
||||
const id = `slide-${Date.now()}`;
|
||||
onChange({
|
||||
@@ -537,6 +541,35 @@ export function QPowerPoint({ deck, onChange }: QPowerPointProps) {
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
<div className="segmented-tools slide-list-tools" aria-label="Список подзаголовка">
|
||||
<button
|
||||
type="button"
|
||||
className={!activeSlide.subtitleListStyle ? "is-active" : ""}
|
||||
onClick={() => updateSubtitleListStyle("")}
|
||||
title="Без списка"
|
||||
aria-label="Без списка"
|
||||
>
|
||||
<ListX size={16} />
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className={activeSlide.subtitleListStyle === "bullet" ? "is-active" : ""}
|
||||
onClick={() => updateSubtitleListStyle("bullet")}
|
||||
title="Маркированный список"
|
||||
aria-label="Маркированный список"
|
||||
>
|
||||
<List size={16} />
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className={activeSlide.subtitleListStyle === "number" ? "is-active" : ""}
|
||||
onClick={() => updateSubtitleListStyle("number")}
|
||||
title="Нумерованный список"
|
||||
aria-label="Нумерованный список"
|
||||
>
|
||||
<ListOrdered size={16} />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="office-tool-section">
|
||||
@@ -642,7 +675,7 @@ export function QPowerPoint({ deck, onChange }: QPowerPointProps) {
|
||||
onChange={(event) => updateSlide({ ...activeSlide, title: event.target.value })}
|
||||
/>
|
||||
<textarea
|
||||
className="slide-subtitle-input"
|
||||
className={`slide-subtitle-input ${activeSlide.subtitleListStyle ? `is-${activeSlide.subtitleListStyle}-list` : ""}`.trim()}
|
||||
value={activeSlide.subtitle}
|
||||
aria-label="Подзаголовок слайда"
|
||||
style={slideTextStyle(activeSlide.subtitleColor, activeSlide.subtitleFontSize, activeSlide.subtitleFontFamily)}
|
||||
|
||||
Reference in New Issue
Block a user