@8btc/wujie-ppt 0.0.2 → 0.0.3

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/README.md CHANGED
@@ -18,7 +18,15 @@ import "@8btc/wujie-ppt/dist/style.css"; // Import styles
18
18
  const App = () => {
19
19
  const [slidesData, setSlidesData] = useState<SlideJsonData>({
20
20
  slides: [],
21
- title: "My Presentation",
21
+ themeColors: [
22
+ "#000000",
23
+ "#FFFFFF",
24
+ "#EE3333",
25
+ "#00AA00",
26
+ "#3333EE",
27
+ "#FFFF00",
28
+ ],
29
+ size: { width: 960, height: 540 },
22
30
  });
23
31
 
24
32
  const handleUpdate = (newData: SlideJsonData) => {
@@ -38,10 +46,10 @@ export default App;
38
46
 
39
47
  ## Props
40
48
 
41
- | Prop | Type | Description |
42
- | ------------------- | ------------------------------- | ---------------------------- |
43
- | `initialSlidesData` | `SlideJsonData` | Initial data for the editor. |
44
- | `onDataUpdate` | `(data: SlideJsonData) => void` | Callback when data changes. |
49
+ | Prop | Type | Description |
50
+ | ------------------- | --------------------- | ------------------------------------------------------------------------------------- |
51
+ | `initialSlidesData` | `SlideJsonData` | Initial data for the editor. |
52
+ | `onDataUpdate` | `(data: any) => void` | Callback when data changes. Note: Returns internal state format, not `SlideJsonData`. |
45
53
 
46
54
  ## Development
47
55
 
@@ -1,24 +1,19 @@
1
1
  import { default as React } from 'react';
2
- import { Slide, SlideTheme } from './types/slides';
2
+ import { RawSlideJson } from './utils/import-parser';
3
3
 
4
4
  /**
5
5
  * Interface for the slides data structure used in the PPTCanvas component.
6
+ * Matches the structure of slides2.json (pptx export format).
6
7
  */
7
- export interface SlideJsonData {
8
- /** Title of the presentation */
9
- title?: string;
10
- /** Array of slides */
11
- slides: Slide[];
12
- /** Theme configuration for the slides */
13
- theme?: SlideTheme;
14
- /** Viewport ratio (e.g., 16/9) */
15
- viewportRatio?: number;
16
- }
8
+ export type SlideJsonData = RawSlideJson;
17
9
  interface PPTCanvasProps {
18
- /** Initial data to populate the editor */
10
+ /** Initial data to populate the editor (supports slides2.json format) */
19
11
  initialSlidesData: SlideJsonData;
20
- /** Callback function triggered when data changes */
21
- onDataUpdate: (updatedData: SlideJsonData) => void;
12
+ /**
13
+ * Callback function triggered when data changes.
14
+ * Returns the internal store state (Note: currently returns internal format, not SlideJsonData format)
15
+ */
16
+ onDataUpdate: (updatedData: any) => void;
22
17
  }
23
18
  /**
24
19
  * PPTCanvas Component
@@ -0,0 +1 @@
1
+ export {};