pptx-viewer-core 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.
- package/dist/cli/index.js +0 -0
- package/dist/cli/index.mjs +0 -0
- package/dist/index.d.mts +68 -0
- package/dist/index.d.ts +68 -0
- package/dist/index.js +64 -0
- package/dist/index.mjs +64 -0
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
Binary file
|
package/dist/cli/index.mjs
CHANGED
|
Binary file
|
package/dist/index.d.mts
CHANGED
|
@@ -997,6 +997,14 @@ interface IPptxHandlerRuntime {
|
|
|
997
997
|
* @returns Array of layout options belonging to the same slide master.
|
|
998
998
|
*/
|
|
999
999
|
getAvailableLayoutsForSlide(slideIndex: number, slides: PptxSlide[]): Promise<PptxLayoutOption[]>;
|
|
1000
|
+
/**
|
|
1001
|
+
* Resolve the editable template (master + layout) elements a slide
|
|
1002
|
+
* inherits, each carrying a `master-` / `layout-` prefixed id. Excludes
|
|
1003
|
+
* placeholders; returns only decorative shapes/pictures/graphic frames.
|
|
1004
|
+
*
|
|
1005
|
+
* @param slideId - The slide's archive path (`PptxSlide.id`).
|
|
1006
|
+
*/
|
|
1007
|
+
getTemplateElementsForSlide(slideId: string): Promise<PptxElement[]>;
|
|
1000
1008
|
/**
|
|
1001
1009
|
* Scan the loaded PPTX archive for all theme parts.
|
|
1002
1010
|
*/
|
|
@@ -8564,6 +8572,35 @@ declare class PptxHandlerRuntime$2 extends PptxHandlerRuntime$3 {
|
|
|
8564
8572
|
* Find the master path for a slide by walking: slide -> layout -> master.
|
|
8565
8573
|
*/
|
|
8566
8574
|
protected findMasterPathForSlide(slidePath: string): string | undefined;
|
|
8575
|
+
/**
|
|
8576
|
+
* Resolve the editable template (master + layout) elements a slide
|
|
8577
|
+
* inherits, each carrying a `master-` / `layout-` prefixed id.
|
|
8578
|
+
*
|
|
8579
|
+
* This is the canonical entry point for an "edit template/master"
|
|
8580
|
+
* feature: it returns the same decorative master/layout shapes that the
|
|
8581
|
+
* loader already merges in front of slide-authored content (master shapes
|
|
8582
|
+
* behind, layout shapes on top), reusing the cached
|
|
8583
|
+
* {@link getLayoutElements} parse. Resolving a slide that has not been
|
|
8584
|
+
* loaded yet (no relationships cached) yields an empty array.
|
|
8585
|
+
*
|
|
8586
|
+
* Important scope notes for callers:
|
|
8587
|
+
* - Placeholder shapes (`<p:ph>`) are intentionally excluded; those are
|
|
8588
|
+
* resolved separately into each slide's own placeholders. Only
|
|
8589
|
+
* non-placeholder decorations (shapes, pictures, graphic frames) are
|
|
8590
|
+
* returned, which is exactly what the save writeback path supports.
|
|
8591
|
+
* - The returned elements are shared by every slide that inherits the
|
|
8592
|
+
* same layout/master. Editing one element and saving updates the shared
|
|
8593
|
+
* layout/master part, so the change is visible on all sibling slides.
|
|
8594
|
+
* - To persist an edit the binding must keep the mutated template element
|
|
8595
|
+
* inside the `slide.elements` array it passes to {@link save}; the save
|
|
8596
|
+
* writer reads template elements from `ctx.slide.elements` and writes
|
|
8597
|
+
* their shape XML back into the owning `p:spTree`.
|
|
8598
|
+
*
|
|
8599
|
+
* @param slideId - The slide's archive path (the `PptxSlide.id`, e.g.
|
|
8600
|
+
* `ppt/slides/slide1.xml`).
|
|
8601
|
+
* @returns Master + layout elements with prefixed ids (may be empty).
|
|
8602
|
+
*/
|
|
8603
|
+
getTemplateElementsForSlide(slideId: string): Promise<PptxElement[]>;
|
|
8567
8604
|
/**
|
|
8568
8605
|
* Get layouts available for a specific slide, scoped to that slide's
|
|
8569
8606
|
* master. If the slide's master cannot be determined, returns all
|
|
@@ -9032,6 +9069,37 @@ declare class PptxHandlerCore {
|
|
|
9032
9069
|
* ```
|
|
9033
9070
|
*/
|
|
9034
9071
|
getAvailableLayoutsForSlide(slideIndex: number, slides: PptxSlide[]): Promise<PptxLayoutOption[]>;
|
|
9072
|
+
/**
|
|
9073
|
+
* Resolve the editable template (master + layout) elements a slide
|
|
9074
|
+
* inherits, each carrying a `master-` / `layout-` prefixed id.
|
|
9075
|
+
*
|
|
9076
|
+
* This is the foundation for an "edit template/master" feature. The
|
|
9077
|
+
* returned elements are the decorative master/layout shapes the loader
|
|
9078
|
+
* already merges behind slide-authored content (master shapes behind,
|
|
9079
|
+
* layout shapes on top); placeholders are excluded. The same elements are
|
|
9080
|
+
* shared by every slide inheriting the layout/master, so editing one and
|
|
9081
|
+
* saving updates the shared part.
|
|
9082
|
+
*
|
|
9083
|
+
* To persist an edit, keep the mutated template element inside the
|
|
9084
|
+
* `slide.elements` array passed to {@link save}; the save writer reads
|
|
9085
|
+
* template elements from there and writes their shape XML back into the
|
|
9086
|
+
* owning layout/master `p:spTree`.
|
|
9087
|
+
*
|
|
9088
|
+
* @param slideId - The slide's archive path (the `PptxSlide.id`).
|
|
9089
|
+
* @returns Master + layout elements with prefixed ids (may be empty).
|
|
9090
|
+
*
|
|
9091
|
+
* @example
|
|
9092
|
+
* ```ts
|
|
9093
|
+
* const templateEls = await handler.getTemplateElementsForSlide(slide.id);
|
|
9094
|
+
* const logo = templateEls.find((e) => e.id.startsWith("master-"));
|
|
9095
|
+
* if (logo) {
|
|
9096
|
+
* logo.x += 10;
|
|
9097
|
+
* slide.elements = [...slide.elements, logo];
|
|
9098
|
+
* await handler.save(data.slides);
|
|
9099
|
+
* }
|
|
9100
|
+
* ```
|
|
9101
|
+
*/
|
|
9102
|
+
getTemplateElementsForSlide(slideId: string): Promise<PptxElement[]>;
|
|
9035
9103
|
/**
|
|
9036
9104
|
* Apply a different layout to an existing slide.
|
|
9037
9105
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -997,6 +997,14 @@ interface IPptxHandlerRuntime {
|
|
|
997
997
|
* @returns Array of layout options belonging to the same slide master.
|
|
998
998
|
*/
|
|
999
999
|
getAvailableLayoutsForSlide(slideIndex: number, slides: PptxSlide[]): Promise<PptxLayoutOption[]>;
|
|
1000
|
+
/**
|
|
1001
|
+
* Resolve the editable template (master + layout) elements a slide
|
|
1002
|
+
* inherits, each carrying a `master-` / `layout-` prefixed id. Excludes
|
|
1003
|
+
* placeholders; returns only decorative shapes/pictures/graphic frames.
|
|
1004
|
+
*
|
|
1005
|
+
* @param slideId - The slide's archive path (`PptxSlide.id`).
|
|
1006
|
+
*/
|
|
1007
|
+
getTemplateElementsForSlide(slideId: string): Promise<PptxElement[]>;
|
|
1000
1008
|
/**
|
|
1001
1009
|
* Scan the loaded PPTX archive for all theme parts.
|
|
1002
1010
|
*/
|
|
@@ -8564,6 +8572,35 @@ declare class PptxHandlerRuntime$2 extends PptxHandlerRuntime$3 {
|
|
|
8564
8572
|
* Find the master path for a slide by walking: slide -> layout -> master.
|
|
8565
8573
|
*/
|
|
8566
8574
|
protected findMasterPathForSlide(slidePath: string): string | undefined;
|
|
8575
|
+
/**
|
|
8576
|
+
* Resolve the editable template (master + layout) elements a slide
|
|
8577
|
+
* inherits, each carrying a `master-` / `layout-` prefixed id.
|
|
8578
|
+
*
|
|
8579
|
+
* This is the canonical entry point for an "edit template/master"
|
|
8580
|
+
* feature: it returns the same decorative master/layout shapes that the
|
|
8581
|
+
* loader already merges in front of slide-authored content (master shapes
|
|
8582
|
+
* behind, layout shapes on top), reusing the cached
|
|
8583
|
+
* {@link getLayoutElements} parse. Resolving a slide that has not been
|
|
8584
|
+
* loaded yet (no relationships cached) yields an empty array.
|
|
8585
|
+
*
|
|
8586
|
+
* Important scope notes for callers:
|
|
8587
|
+
* - Placeholder shapes (`<p:ph>`) are intentionally excluded; those are
|
|
8588
|
+
* resolved separately into each slide's own placeholders. Only
|
|
8589
|
+
* non-placeholder decorations (shapes, pictures, graphic frames) are
|
|
8590
|
+
* returned, which is exactly what the save writeback path supports.
|
|
8591
|
+
* - The returned elements are shared by every slide that inherits the
|
|
8592
|
+
* same layout/master. Editing one element and saving updates the shared
|
|
8593
|
+
* layout/master part, so the change is visible on all sibling slides.
|
|
8594
|
+
* - To persist an edit the binding must keep the mutated template element
|
|
8595
|
+
* inside the `slide.elements` array it passes to {@link save}; the save
|
|
8596
|
+
* writer reads template elements from `ctx.slide.elements` and writes
|
|
8597
|
+
* their shape XML back into the owning `p:spTree`.
|
|
8598
|
+
*
|
|
8599
|
+
* @param slideId - The slide's archive path (the `PptxSlide.id`, e.g.
|
|
8600
|
+
* `ppt/slides/slide1.xml`).
|
|
8601
|
+
* @returns Master + layout elements with prefixed ids (may be empty).
|
|
8602
|
+
*/
|
|
8603
|
+
getTemplateElementsForSlide(slideId: string): Promise<PptxElement[]>;
|
|
8567
8604
|
/**
|
|
8568
8605
|
* Get layouts available for a specific slide, scoped to that slide's
|
|
8569
8606
|
* master. If the slide's master cannot be determined, returns all
|
|
@@ -9032,6 +9069,37 @@ declare class PptxHandlerCore {
|
|
|
9032
9069
|
* ```
|
|
9033
9070
|
*/
|
|
9034
9071
|
getAvailableLayoutsForSlide(slideIndex: number, slides: PptxSlide[]): Promise<PptxLayoutOption[]>;
|
|
9072
|
+
/**
|
|
9073
|
+
* Resolve the editable template (master + layout) elements a slide
|
|
9074
|
+
* inherits, each carrying a `master-` / `layout-` prefixed id.
|
|
9075
|
+
*
|
|
9076
|
+
* This is the foundation for an "edit template/master" feature. The
|
|
9077
|
+
* returned elements are the decorative master/layout shapes the loader
|
|
9078
|
+
* already merges behind slide-authored content (master shapes behind,
|
|
9079
|
+
* layout shapes on top); placeholders are excluded. The same elements are
|
|
9080
|
+
* shared by every slide inheriting the layout/master, so editing one and
|
|
9081
|
+
* saving updates the shared part.
|
|
9082
|
+
*
|
|
9083
|
+
* To persist an edit, keep the mutated template element inside the
|
|
9084
|
+
* `slide.elements` array passed to {@link save}; the save writer reads
|
|
9085
|
+
* template elements from there and writes their shape XML back into the
|
|
9086
|
+
* owning layout/master `p:spTree`.
|
|
9087
|
+
*
|
|
9088
|
+
* @param slideId - The slide's archive path (the `PptxSlide.id`).
|
|
9089
|
+
* @returns Master + layout elements with prefixed ids (may be empty).
|
|
9090
|
+
*
|
|
9091
|
+
* @example
|
|
9092
|
+
* ```ts
|
|
9093
|
+
* const templateEls = await handler.getTemplateElementsForSlide(slide.id);
|
|
9094
|
+
* const logo = templateEls.find((e) => e.id.startsWith("master-"));
|
|
9095
|
+
* if (logo) {
|
|
9096
|
+
* logo.x += 10;
|
|
9097
|
+
* slide.elements = [...slide.elements, logo];
|
|
9098
|
+
* await handler.save(data.slides);
|
|
9099
|
+
* }
|
|
9100
|
+
* ```
|
|
9101
|
+
*/
|
|
9102
|
+
getTemplateElementsForSlide(slideId: string): Promise<PptxElement[]>;
|
|
9035
9103
|
/**
|
|
9036
9104
|
* Apply a different layout to an existing slide.
|
|
9037
9105
|
*
|
package/dist/index.js
CHANGED
|
@@ -46123,6 +46123,37 @@ var PptxHandlerRuntime79 = class extends PptxHandlerRuntime78 {
|
|
|
46123
46123
|
}
|
|
46124
46124
|
return this.findMasterPathForLayout(layoutPath);
|
|
46125
46125
|
}
|
|
46126
|
+
/**
|
|
46127
|
+
* Resolve the editable template (master + layout) elements a slide
|
|
46128
|
+
* inherits, each carrying a `master-` / `layout-` prefixed id.
|
|
46129
|
+
*
|
|
46130
|
+
* This is the canonical entry point for an "edit template/master"
|
|
46131
|
+
* feature: it returns the same decorative master/layout shapes that the
|
|
46132
|
+
* loader already merges in front of slide-authored content (master shapes
|
|
46133
|
+
* behind, layout shapes on top), reusing the cached
|
|
46134
|
+
* {@link getLayoutElements} parse. Resolving a slide that has not been
|
|
46135
|
+
* loaded yet (no relationships cached) yields an empty array.
|
|
46136
|
+
*
|
|
46137
|
+
* Important scope notes for callers:
|
|
46138
|
+
* - Placeholder shapes (`<p:ph>`) are intentionally excluded; those are
|
|
46139
|
+
* resolved separately into each slide's own placeholders. Only
|
|
46140
|
+
* non-placeholder decorations (shapes, pictures, graphic frames) are
|
|
46141
|
+
* returned, which is exactly what the save writeback path supports.
|
|
46142
|
+
* - The returned elements are shared by every slide that inherits the
|
|
46143
|
+
* same layout/master. Editing one element and saving updates the shared
|
|
46144
|
+
* layout/master part, so the change is visible on all sibling slides.
|
|
46145
|
+
* - To persist an edit the binding must keep the mutated template element
|
|
46146
|
+
* inside the `slide.elements` array it passes to {@link save}; the save
|
|
46147
|
+
* writer reads template elements from `ctx.slide.elements` and writes
|
|
46148
|
+
* their shape XML back into the owning `p:spTree`.
|
|
46149
|
+
*
|
|
46150
|
+
* @param slideId - The slide's archive path (the `PptxSlide.id`, e.g.
|
|
46151
|
+
* `ppt/slides/slide1.xml`).
|
|
46152
|
+
* @returns Master + layout elements with prefixed ids (may be empty).
|
|
46153
|
+
*/
|
|
46154
|
+
async getTemplateElementsForSlide(slideId) {
|
|
46155
|
+
return this.getLayoutElements(slideId);
|
|
46156
|
+
}
|
|
46126
46157
|
/**
|
|
46127
46158
|
* Get layouts available for a specific slide, scoped to that slide's
|
|
46128
46159
|
* master. If the slide's master cannot be determined, returns all
|
|
@@ -46795,6 +46826,39 @@ var PptxHandlerCore = class {
|
|
|
46795
46826
|
async getAvailableLayoutsForSlide(slideIndex, slides) {
|
|
46796
46827
|
return this.runtime.getAvailableLayoutsForSlide(slideIndex, slides);
|
|
46797
46828
|
}
|
|
46829
|
+
/**
|
|
46830
|
+
* Resolve the editable template (master + layout) elements a slide
|
|
46831
|
+
* inherits, each carrying a `master-` / `layout-` prefixed id.
|
|
46832
|
+
*
|
|
46833
|
+
* This is the foundation for an "edit template/master" feature. The
|
|
46834
|
+
* returned elements are the decorative master/layout shapes the loader
|
|
46835
|
+
* already merges behind slide-authored content (master shapes behind,
|
|
46836
|
+
* layout shapes on top); placeholders are excluded. The same elements are
|
|
46837
|
+
* shared by every slide inheriting the layout/master, so editing one and
|
|
46838
|
+
* saving updates the shared part.
|
|
46839
|
+
*
|
|
46840
|
+
* To persist an edit, keep the mutated template element inside the
|
|
46841
|
+
* `slide.elements` array passed to {@link save}; the save writer reads
|
|
46842
|
+
* template elements from there and writes their shape XML back into the
|
|
46843
|
+
* owning layout/master `p:spTree`.
|
|
46844
|
+
*
|
|
46845
|
+
* @param slideId - The slide's archive path (the `PptxSlide.id`).
|
|
46846
|
+
* @returns Master + layout elements with prefixed ids (may be empty).
|
|
46847
|
+
*
|
|
46848
|
+
* @example
|
|
46849
|
+
* ```ts
|
|
46850
|
+
* const templateEls = await handler.getTemplateElementsForSlide(slide.id);
|
|
46851
|
+
* const logo = templateEls.find((e) => e.id.startsWith("master-"));
|
|
46852
|
+
* if (logo) {
|
|
46853
|
+
* logo.x += 10;
|
|
46854
|
+
* slide.elements = [...slide.elements, logo];
|
|
46855
|
+
* await handler.save(data.slides);
|
|
46856
|
+
* }
|
|
46857
|
+
* ```
|
|
46858
|
+
*/
|
|
46859
|
+
async getTemplateElementsForSlide(slideId) {
|
|
46860
|
+
return this.runtime.getTemplateElementsForSlide(slideId);
|
|
46861
|
+
}
|
|
46798
46862
|
/**
|
|
46799
46863
|
* Apply a different layout to an existing slide.
|
|
46800
46864
|
*
|
package/dist/index.mjs
CHANGED
|
@@ -46118,6 +46118,37 @@ var PptxHandlerRuntime79 = class extends PptxHandlerRuntime78 {
|
|
|
46118
46118
|
}
|
|
46119
46119
|
return this.findMasterPathForLayout(layoutPath);
|
|
46120
46120
|
}
|
|
46121
|
+
/**
|
|
46122
|
+
* Resolve the editable template (master + layout) elements a slide
|
|
46123
|
+
* inherits, each carrying a `master-` / `layout-` prefixed id.
|
|
46124
|
+
*
|
|
46125
|
+
* This is the canonical entry point for an "edit template/master"
|
|
46126
|
+
* feature: it returns the same decorative master/layout shapes that the
|
|
46127
|
+
* loader already merges in front of slide-authored content (master shapes
|
|
46128
|
+
* behind, layout shapes on top), reusing the cached
|
|
46129
|
+
* {@link getLayoutElements} parse. Resolving a slide that has not been
|
|
46130
|
+
* loaded yet (no relationships cached) yields an empty array.
|
|
46131
|
+
*
|
|
46132
|
+
* Important scope notes for callers:
|
|
46133
|
+
* - Placeholder shapes (`<p:ph>`) are intentionally excluded; those are
|
|
46134
|
+
* resolved separately into each slide's own placeholders. Only
|
|
46135
|
+
* non-placeholder decorations (shapes, pictures, graphic frames) are
|
|
46136
|
+
* returned, which is exactly what the save writeback path supports.
|
|
46137
|
+
* - The returned elements are shared by every slide that inherits the
|
|
46138
|
+
* same layout/master. Editing one element and saving updates the shared
|
|
46139
|
+
* layout/master part, so the change is visible on all sibling slides.
|
|
46140
|
+
* - To persist an edit the binding must keep the mutated template element
|
|
46141
|
+
* inside the `slide.elements` array it passes to {@link save}; the save
|
|
46142
|
+
* writer reads template elements from `ctx.slide.elements` and writes
|
|
46143
|
+
* their shape XML back into the owning `p:spTree`.
|
|
46144
|
+
*
|
|
46145
|
+
* @param slideId - The slide's archive path (the `PptxSlide.id`, e.g.
|
|
46146
|
+
* `ppt/slides/slide1.xml`).
|
|
46147
|
+
* @returns Master + layout elements with prefixed ids (may be empty).
|
|
46148
|
+
*/
|
|
46149
|
+
async getTemplateElementsForSlide(slideId) {
|
|
46150
|
+
return this.getLayoutElements(slideId);
|
|
46151
|
+
}
|
|
46121
46152
|
/**
|
|
46122
46153
|
* Get layouts available for a specific slide, scoped to that slide's
|
|
46123
46154
|
* master. If the slide's master cannot be determined, returns all
|
|
@@ -46790,6 +46821,39 @@ var PptxHandlerCore = class {
|
|
|
46790
46821
|
async getAvailableLayoutsForSlide(slideIndex, slides) {
|
|
46791
46822
|
return this.runtime.getAvailableLayoutsForSlide(slideIndex, slides);
|
|
46792
46823
|
}
|
|
46824
|
+
/**
|
|
46825
|
+
* Resolve the editable template (master + layout) elements a slide
|
|
46826
|
+
* inherits, each carrying a `master-` / `layout-` prefixed id.
|
|
46827
|
+
*
|
|
46828
|
+
* This is the foundation for an "edit template/master" feature. The
|
|
46829
|
+
* returned elements are the decorative master/layout shapes the loader
|
|
46830
|
+
* already merges behind slide-authored content (master shapes behind,
|
|
46831
|
+
* layout shapes on top); placeholders are excluded. The same elements are
|
|
46832
|
+
* shared by every slide inheriting the layout/master, so editing one and
|
|
46833
|
+
* saving updates the shared part.
|
|
46834
|
+
*
|
|
46835
|
+
* To persist an edit, keep the mutated template element inside the
|
|
46836
|
+
* `slide.elements` array passed to {@link save}; the save writer reads
|
|
46837
|
+
* template elements from there and writes their shape XML back into the
|
|
46838
|
+
* owning layout/master `p:spTree`.
|
|
46839
|
+
*
|
|
46840
|
+
* @param slideId - The slide's archive path (the `PptxSlide.id`).
|
|
46841
|
+
* @returns Master + layout elements with prefixed ids (may be empty).
|
|
46842
|
+
*
|
|
46843
|
+
* @example
|
|
46844
|
+
* ```ts
|
|
46845
|
+
* const templateEls = await handler.getTemplateElementsForSlide(slide.id);
|
|
46846
|
+
* const logo = templateEls.find((e) => e.id.startsWith("master-"));
|
|
46847
|
+
* if (logo) {
|
|
46848
|
+
* logo.x += 10;
|
|
46849
|
+
* slide.elements = [...slide.elements, logo];
|
|
46850
|
+
* await handler.save(data.slides);
|
|
46851
|
+
* }
|
|
46852
|
+
* ```
|
|
46853
|
+
*/
|
|
46854
|
+
async getTemplateElementsForSlide(slideId) {
|
|
46855
|
+
return this.runtime.getTemplateElementsForSlide(slideId);
|
|
46856
|
+
}
|
|
46793
46857
|
/**
|
|
46794
46858
|
* Apply a different layout to an existing slide.
|
|
46795
46859
|
*
|