@8btc/wujie-ppt 0.0.8 → 0.0.10-beta
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/PPTCanvas.d.ts +22 -2
- package/dist/configs/theme.d.ts +12 -0
- package/dist/hooks/useClickOutside.d.ts +1 -1
- package/dist/hooks/useContextMenu.d.ts +1 -1
- package/dist/hooks/useExport.d.ts +14 -0
- package/dist/hooks/useExport.util.d.ts +0 -0
- package/dist/hooks/useSlideTheme.d.ts +15 -0
- package/dist/index.d.ts +1 -0
- package/dist/views/Editor/Canvas/hooks/useDrop.d.ts +1 -1
- package/dist/views/Editor/Canvas/hooks/useRotateElement.d.ts +1 -1
- package/dist/views/Editor/Canvas/hooks/useViewportSize.d.ts +1 -1
- package/dist/views/Editor/Canvas/index.d.ts +8 -1
- package/dist/wujie-ppt.es.js +46010 -19701
- package/dist/wujie-ppt.umd.js +272 -21
- package/package.json +5 -9
package/dist/PPTCanvas.d.ts
CHANGED
|
@@ -1,10 +1,30 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { RawSlideJson } from './utils/import-parser';
|
|
3
|
+
import { Slide, SlideTheme } from './types/slides';
|
|
4
|
+
import { PresetTheme } from './configs/theme';
|
|
3
5
|
|
|
4
6
|
export type SlideJsonData = RawSlideJson;
|
|
5
7
|
interface PPTCanvasProps {
|
|
6
8
|
initialSlidesData: SlideJsonData;
|
|
7
9
|
onDataUpdate: (updatedData: any) => void;
|
|
10
|
+
renderPageExtra?: ({ slideIndex, currentSlide, }: {
|
|
11
|
+
slideIndex: number;
|
|
12
|
+
currentSlide: Slide | null;
|
|
13
|
+
}) => React.ReactNode;
|
|
8
14
|
}
|
|
9
|
-
|
|
10
|
-
|
|
15
|
+
interface IRef {
|
|
16
|
+
applyThemeToAllSlides: (all?: boolean) => void;
|
|
17
|
+
applyPresetTheme: (theme: PresetTheme, applyToAllSlides: boolean) => void;
|
|
18
|
+
applyFontToAllSlides: (fontname: string) => void;
|
|
19
|
+
exportPPTX: (data: {
|
|
20
|
+
slides: Slide[];
|
|
21
|
+
theme: SlideTheme;
|
|
22
|
+
masterOverwrite?: boolean;
|
|
23
|
+
ignoreMedia?: boolean;
|
|
24
|
+
writeFile?: boolean;
|
|
25
|
+
onError?: (e: any) => void;
|
|
26
|
+
onSuccess?: (data: any) => void;
|
|
27
|
+
}) => void;
|
|
28
|
+
}
|
|
29
|
+
declare const _default: React.ForwardRefExoticComponent<PPTCanvasProps & React.RefAttributes<IRef>>;
|
|
30
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { PPTElementOutline, PPTElementShadow } from '../types/slides';
|
|
2
|
+
|
|
3
|
+
export interface PresetTheme {
|
|
4
|
+
background: string;
|
|
5
|
+
fontColor: string;
|
|
6
|
+
fontname: string;
|
|
7
|
+
colors: string[];
|
|
8
|
+
borderColor?: string;
|
|
9
|
+
outline?: PPTElementOutline;
|
|
10
|
+
shadow?: PPTElementShadow;
|
|
11
|
+
}
|
|
12
|
+
export declare const PRESET_THEMES: PresetTheme[];
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { RefObject } from 'react';
|
|
2
2
|
|
|
3
|
-
export default function useClickOutside(ref: RefObject<HTMLElement>, handler: (event: MouseEvent | TouchEvent) => void): void;
|
|
3
|
+
export default function useClickOutside(ref: RefObject<HTMLElement | null>, handler: (event: MouseEvent | TouchEvent) => void): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { RefObject } from 'react';
|
|
2
2
|
import { ContextmenuItem } from '../components/Contextmenu/types';
|
|
3
3
|
|
|
4
|
-
export default function useContextMenu(ref: RefObject<HTMLElement | SVGPathElement>, menusOrGenerator: ContextmenuItem[] | ((el: HTMLElement | SVGPathElement) => ContextmenuItem[] | null), enabled?: boolean): void;
|
|
4
|
+
export default function useContextMenu(ref: RefObject<HTMLElement | SVGPathElement | null>, menusOrGenerator: ContextmenuItem[] | ((el: HTMLElement | SVGPathElement) => ContextmenuItem[] | null), enabled?: boolean): void;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Slide, SlideTheme } from '../types/slides';
|
|
2
|
+
|
|
3
|
+
declare const useExport: () => {
|
|
4
|
+
exportPPTX: ({ slides, theme, masterOverwrite, ignoreMedia, writeFile, onError, onSuccess, }: {
|
|
5
|
+
slides: Slide[];
|
|
6
|
+
theme: SlideTheme;
|
|
7
|
+
masterOverwrite?: boolean | undefined;
|
|
8
|
+
ignoreMedia?: boolean | undefined;
|
|
9
|
+
writeFile?: boolean | undefined;
|
|
10
|
+
onError?: ((e: any) => void) | undefined;
|
|
11
|
+
onSuccess?: ((data: any) => void) | undefined;
|
|
12
|
+
}) => void;
|
|
13
|
+
};
|
|
14
|
+
export default useExport;
|
|
File without changes
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Slide } from '../types/slides';
|
|
2
|
+
import { PresetTheme } from '../configs/theme';
|
|
3
|
+
|
|
4
|
+
declare const _default: () => {
|
|
5
|
+
getSlidesThemeStyles: (slide: Slide | Slide[]) => {
|
|
6
|
+
backgroundColors: string[];
|
|
7
|
+
themeColors: string[];
|
|
8
|
+
fontColors: string[];
|
|
9
|
+
fontNames: string[];
|
|
10
|
+
};
|
|
11
|
+
applyPresetTheme: (theme: PresetTheme, resetSlides?: boolean) => void;
|
|
12
|
+
applyThemeToAllSlides: (applyAll?: boolean) => void;
|
|
13
|
+
applyFontToAllSlides: (fontname: string) => void;
|
|
14
|
+
};
|
|
15
|
+
export default _default;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { RefObject } from 'react';
|
|
2
2
|
import { PPTElement, PPTLineElement, PPTVideoElement, PPTAudioElement, PPTChartElement } from '../../../../types/slides';
|
|
3
3
|
|
|
4
|
-
declare const _default: (elementList: PPTElement[], setElementList: (list: PPTElement[] | ((prev: PPTElement[]) => PPTElement[])) => void, viewportRef: RefObject<HTMLElement>) => {
|
|
4
|
+
declare const _default: (elementList: PPTElement[], setElementList: (list: PPTElement[] | ((prev: PPTElement[]) => PPTElement[])) => void, viewportRef: RefObject<HTMLElement | null>) => {
|
|
5
5
|
rotateElement: (e: MouseEvent | TouchEvent, element: Exclude<PPTElement, PPTChartElement | PPTLineElement | PPTVideoElement | PPTAudioElement>) => void;
|
|
6
6
|
};
|
|
7
7
|
export default _default;
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
+
import { Slide } from '../../../types/slides';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Canvas 组件:承载编辑区域渲染、元素选择与操作、视口缩放与拖拽等核心交互
|
|
5
6
|
*/
|
|
6
|
-
|
|
7
|
+
interface IProps {
|
|
8
|
+
renderPageExtra?: ({ slideIndex, currentSlide, }: {
|
|
9
|
+
slideIndex: number;
|
|
10
|
+
currentSlide: Slide | null;
|
|
11
|
+
}) => React.ReactNode;
|
|
12
|
+
}
|
|
13
|
+
declare const Canvas: React.FC<IProps>;
|
|
7
14
|
export default Canvas;
|