@shbernal/ts-pptx 4.0.1 → 4.2.0
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 +147 -114
- package/dist/anim-presets-Qbgh8uut.js +55 -0
- package/dist/anim-presets-Qbgh8uut.js.map +1 -0
- package/dist/{autopage-odPz7zZO.js → autopage-DqZ37VpL.js} +11 -12
- package/dist/autopage-DqZ37VpL.js.map +1 -0
- package/dist/{binary-string-CKVAYI3M.js → binary-string-Ba8VM3b9.js} +3 -4
- package/dist/binary-string-Ba8VM3b9.js.map +1 -0
- package/dist/{body-insets-Dw_BeWD_.js → body-insets-BDHymJvz.js} +7 -9
- package/dist/body-insets-BDHymJvz.js.map +1 -0
- package/dist/browser.d.ts +24 -16
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.js +19 -19
- package/dist/browser.js.map +1 -1
- package/dist/{image-size-CvN2iCA4.js → chart-metadata-CwiTTcJq.js} +634 -537
- package/dist/chart-metadata-CwiTTcJq.js.map +1 -0
- package/dist/{clip-Bl01BPcN.d.ts → clip-ISfCMtWA.d.ts} +6 -10
- package/dist/clip-ISfCMtWA.d.ts.map +1 -0
- package/dist/{notes-Dh12JAbn.js → comments-CKIZYRbZ.js} +530 -401
- package/dist/comments-CKIZYRbZ.js.map +1 -0
- package/dist/{diagnostics-D8ot4Ei7.d.ts → diagnostics-MoA4MBq5.d.ts} +55 -53
- package/dist/diagnostics-MoA4MBq5.d.ts.map +1 -0
- package/dist/{embedded-fonts-DarT9aoa.d.ts → embedded-fonts-U7HIIhPO.d.ts} +4 -6
- package/dist/embedded-fonts-U7HIIhPO.d.ts.map +1 -0
- package/dist/{entry-compose-DCnvBZz2.d.ts → entry-compose-CiakSt-f.d.ts} +62 -81
- package/dist/entry-compose-CiakSt-f.d.ts.map +1 -0
- package/dist/{errors-C4oENPcu.js → entry-errors-JMthgJ2g.js} +45 -29
- package/dist/entry-errors-JMthgJ2g.js.map +1 -0
- package/dist/{table-cell-margins-EVg0EwxT.js → enums-BP9wsb9Q.js} +44 -47
- package/dist/enums-BP9wsb9Q.js.map +1 -0
- package/dist/{enums-BUKTUB6V.d.ts → enums-PcXr3o3J.d.ts} +13 -14
- package/dist/{enums-BUKTUB6V.d.ts.map → enums-PcXr3o3J.d.ts.map} +1 -1
- package/dist/families.d.ts +24 -26
- package/dist/families.d.ts.map +1 -1
- package/dist/families.js +3 -4
- package/dist/{fit-Cb7naFj6.js → fit-Bpmzep6O.js} +64 -56
- package/dist/fit-Bpmzep6O.js.map +1 -0
- package/dist/{font-metrics-v5fn7s7e.d.ts → font-metrics-DTppw4t3.d.ts} +62 -38
- package/dist/font-metrics-DTppw4t3.d.ts.map +1 -0
- package/dist/{grid-DikTjFey.js → grid-DUIMxjfl.js} +23 -26
- package/dist/grid-DUIMxjfl.js.map +1 -0
- package/dist/{html-dom-Iuog2wdK.js → html-dom-LZCgntnJ.js} +46 -47
- package/dist/html-dom-LZCgntnJ.js.map +1 -0
- package/dist/html.d.ts +53 -9
- package/dist/html.d.ts.map +1 -1
- package/dist/html.js +12 -13
- package/dist/html.js.map +1 -1
- package/dist/index.d.ts +21 -13
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -15
- package/dist/index.js.map +1 -1
- package/dist/inspect.d.ts +16 -18
- package/dist/inspect.d.ts.map +1 -1
- package/dist/inspect.js +18 -19
- package/dist/inspect.js.map +1 -1
- package/dist/{text-anchor-CrYXAfUu.js → lock-attrs-CSQnFDHP.js} +62 -12
- package/dist/lock-attrs-CSQnFDHP.js.map +1 -0
- package/dist/math.d.ts +2 -4
- package/dist/math.d.ts.map +1 -1
- package/dist/math.js +12 -13
- package/dist/math.js.map +1 -1
- package/dist/measure.d.ts +23 -12
- package/dist/measure.d.ts.map +1 -1
- package/dist/measure.js +3 -3
- package/dist/node.d.ts +21 -13
- package/dist/node.d.ts.map +1 -1
- package/dist/node.js +12 -12
- package/dist/node.js.map +1 -1
- package/dist/{options-internal-WqgMf720.js → options-internal-BWgmLPdx.js} +4 -5
- package/dist/options-internal-BWgmLPdx.js.map +1 -0
- package/dist/{package-J49Ck6S2.d.ts → package-CANBWuSm.d.ts} +9 -13
- package/dist/package-CANBWuSm.d.ts.map +1 -0
- package/dist/{playbtn-CUqQdoDf.js → playbtn-BQZFJir9.js} +4 -5
- package/dist/playbtn-BQZFJir9.js.map +1 -0
- package/dist/{pres-C6qgOFAa.d.ts → pres-BkEkUAEM.d.ts} +410 -237
- package/dist/pres-BkEkUAEM.d.ts.map +1 -0
- package/dist/{presentation-DGYlAWhl.js → presentation-4Ggq0_Xa.js} +470 -315
- package/dist/presentation-4Ggq0_Xa.js.map +1 -0
- package/dist/{presentation-types-8jLQHI4M.d.ts → presentation-types-BgnZR-0a.d.ts} +1119 -468
- package/dist/presentation-types-BgnZR-0a.d.ts.map +1 -0
- package/dist/read.d.ts +18 -13
- package/dist/read.d.ts.map +1 -1
- package/dist/read.js +4 -4
- package/dist/script.d.ts +116 -65
- package/dist/script.d.ts.map +1 -1
- package/dist/script.js +2700 -780
- package/dist/script.js.map +1 -1
- package/dist/{shapes-re0KyQk_.js → shapes-CAPOjU0Q.js} +1564 -491
- package/dist/shapes-CAPOjU0Q.js.map +1 -0
- package/dist/{slide-Dx2ZeVZ6.d.ts → slide-BmT4kMoO.d.ts} +102 -89
- package/dist/slide-BmT4kMoO.d.ts.map +1 -0
- package/dist/{slide-size-BalTjFuv.js → slide-size-SkScz1ig.js} +2 -3
- package/dist/{slide-size-BalTjFuv.js.map → slide-size-SkScz1ig.js.map} +1 -1
- package/dist/{table-dom-BTDP3lEP.js → table-dom-BYga4FYY.js} +4 -5
- package/dist/{table-dom-BTDP3lEP.js.map → table-dom-BYga4FYY.js.map} +1 -1
- package/dist/{text-sN64Otf_.js → text-CU08xJGs.js} +393 -344
- package/dist/text-CU08xJGs.js.map +1 -0
- package/dist/{transition-speed-kUEWDWTx.js → transition-speed-CNJ0fSpQ.js} +2 -3
- package/dist/{transition-speed-kUEWDWTx.js.map → transition-speed-CNJ0fSpQ.js.map} +1 -1
- package/dist/{units-internal-XJlf-hOl.js → units-internal-BR3a4cIi.js} +34 -32
- package/dist/units-internal-BR3a4cIi.js.map +1 -0
- package/dist/{zip-CKd8ihcf.js → zip-7JTh61LX.js} +8 -10
- package/dist/zip-7JTh61LX.js.map +1 -0
- package/dist/{zip-C0leZZMj.d.ts → zip-uUjs9Cqx.d.ts} +4 -6
- package/dist/zip-uUjs9Cqx.d.ts.map +1 -0
- package/dist/zip.d.ts +3 -3
- package/dist/zip.js +3 -3
- package/dist/{zoom-DPUHh85d.js → zoom-CSSeOwM8.js} +1204 -620
- package/dist/zoom-CSSeOwM8.js.map +1 -0
- package/package.json +27 -28
- package/skills/{ts-pptx-upstream → pptx-ts-upstream}/SKILL.md +37 -84
- package/dist/autopage-odPz7zZO.js.map +0 -1
- package/dist/binary-string-CKVAYI3M.js.map +0 -1
- package/dist/body-insets-Dw_BeWD_.js.map +0 -1
- package/dist/clip-Bl01BPcN.d.ts.map +0 -1
- package/dist/diagnostics-D8ot4Ei7.d.ts.map +0 -1
- package/dist/embedded-fonts-DarT9aoa.d.ts.map +0 -1
- package/dist/entry-compose-DCnvBZz2.d.ts.map +0 -1
- package/dist/errors-C4oENPcu.js.map +0 -1
- package/dist/fit-Cb7naFj6.js.map +0 -1
- package/dist/font-metrics-v5fn7s7e.d.ts.map +0 -1
- package/dist/grid-DikTjFey.js.map +0 -1
- package/dist/html-dom-Iuog2wdK.js.map +0 -1
- package/dist/image-size-CvN2iCA4.js.map +0 -1
- package/dist/notes-Dh12JAbn.js.map +0 -1
- package/dist/options-internal-WqgMf720.js.map +0 -1
- package/dist/package-J49Ck6S2.d.ts.map +0 -1
- package/dist/playbtn-CUqQdoDf.js.map +0 -1
- package/dist/pres-C6qgOFAa.d.ts.map +0 -1
- package/dist/presentation-DGYlAWhl.js.map +0 -1
- package/dist/presentation-types-8jLQHI4M.d.ts.map +0 -1
- package/dist/shapes-re0KyQk_.js.map +0 -1
- package/dist/slide-Dx2ZeVZ6.d.ts.map +0 -1
- package/dist/table-cell-margins-EVg0EwxT.js.map +0 -1
- package/dist/text-anchor-CrYXAfUu.js.map +0 -1
- package/dist/text-sN64Otf_.js.map +0 -1
- package/dist/units-internal-XJlf-hOl.js.map +0 -1
- package/dist/zip-C0leZZMj.d.ts.map +0 -1
- package/dist/zip-CKd8ihcf.js.map +0 -1
- package/dist/zoom-DPUHh85d.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { I as EMU_PER_POINT } from "./
|
|
2
|
-
|
|
1
|
+
import { I as EMU_PER_POINT } from "./enums-BP9wsb9Q.js";
|
|
2
|
+
// src/ooxml/body-insets.ts
|
|
3
3
|
/**
|
|
4
4
|
* PowerPoint's default `a:bodyPr` text insets.
|
|
5
5
|
*
|
|
@@ -8,15 +8,14 @@ import { I as EMU_PER_POINT } from "./table-cell-margins-EVg0EwxT.js";
|
|
|
8
8
|
* inset by has to carry the numbers itself. Four places did, in three units and two orders:
|
|
9
9
|
* the script mapper as a points record, the round-trip canonicaliser as an inches tuple in
|
|
10
10
|
* `[top, right, bottom, left]`, `inspect.ts` as two inch scalars, and the measured-fit
|
|
11
|
-
* solver as two EMU scalars
|
|
12
|
-
*
|
|
13
|
-
* numbers.
|
|
11
|
+
* solver as two EMU scalars. That last one decides the inner box every `autoFit` is computed
|
|
12
|
+
* against, so a correction here would have left every fit decision on the old numbers.
|
|
14
13
|
*
|
|
15
14
|
* The canonicaliser's tuple in particular has to be exactly `pointsToInches` of the mapper's
|
|
16
15
|
* record, or `isDefaultMargin` stops matching and every text frame that spells its insets
|
|
17
16
|
* reports four spurious differences. Nothing linked them; this module is the link.
|
|
18
17
|
*
|
|
19
|
-
* It is a fact about the schema, so
|
|
18
|
+
* It is a fact about the schema, so, like `st-enums.ts`, it belongs to neither `gen/` nor
|
|
20
19
|
* `read/` nor `script/`.
|
|
21
20
|
*/
|
|
22
21
|
/** The four default insets in points: 7.2pt (0.1in) left and right, 3.6pt (0.05in) top and bottom. */
|
|
@@ -27,7 +26,7 @@ const BODY_INSET_DEFAULTS_PT = {
|
|
|
27
26
|
bottom: 3.6
|
|
28
27
|
};
|
|
29
28
|
/**
|
|
30
|
-
* The same four in inches, in the write API's `margin` order
|
|
29
|
+
* The same four in inches, in the write API's `margin` order: `[top, right, bottom, left]`.
|
|
31
30
|
*
|
|
32
31
|
* Derived rather than transcribed, so it cannot drift from {@link BODY_INSET_DEFAULTS_PT}.
|
|
33
32
|
*/
|
|
@@ -48,7 +47,6 @@ const BODY_INSET_DEFAULTS_EMU = {
|
|
|
48
47
|
top: BODY_INSET_DEFAULTS_PT.top * EMU_PER_POINT,
|
|
49
48
|
bottom: BODY_INSET_DEFAULTS_PT.bottom * EMU_PER_POINT
|
|
50
49
|
};
|
|
51
|
-
//#endregion
|
|
52
50
|
export { BODY_INSET_DEFAULTS_IN as n, BODY_INSET_DEFAULTS_PT as r, BODY_INSET_DEFAULTS_EMU as t };
|
|
53
51
|
|
|
54
|
-
//# sourceMappingURL=body-insets-
|
|
52
|
+
//# sourceMappingURL=body-insets-BDHymJvz.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"body-insets-BDHymJvz.js","names":[],"sources":["../src/ooxml/body-insets.ts"],"sourcesContent":["/**\n * PowerPoint's default `a:bodyPr` text insets.\n *\n * ECMA-376 §21.1.2.1.1 states them in prose; the XSD leaves `lIns`/`tIns`/`rIns`/`bIns`\n * optional with no schema default, so a reader that wants to know what an omitted side is\n * inset by has to carry the numbers itself. Four places did, in three units and two orders:\n * the script mapper as a points record, the round-trip canonicaliser as an inches tuple in\n * `[top, right, bottom, left]`, `inspect.ts` as two inch scalars, and the measured-fit\n * solver as two EMU scalars. That last one decides the inner box every `autoFit` is computed\n * against, so a correction here would have left every fit decision on the old numbers.\n *\n * The canonicaliser's tuple in particular has to be exactly `pointsToInches` of the mapper's\n * record, or `isDefaultMargin` stops matching and every text frame that spells its insets\n * reports four spurious differences. Nothing linked them; this module is the link.\n *\n * It is a fact about the schema, so, like `st-enums.ts`, it belongs to neither `gen/` nor\n * `read/` nor `script/`.\n */\n\nimport { EMU_PER_POINT, POINTS_PER_INCH } from './emu.js'\n\n/** The four default insets in points: 7.2pt (0.1in) left and right, 3.6pt (0.05in) top and bottom. */\nexport const BODY_INSET_DEFAULTS_PT = { left: 7.2, right: 7.2, top: 3.6, bottom: 3.6 } as const\n\n/**\n * The same four in inches, in the write API's `margin` order: `[top, right, bottom, left]`.\n *\n * Derived rather than transcribed, so it cannot drift from {@link BODY_INSET_DEFAULTS_PT}.\n */\nexport const BODY_INSET_DEFAULTS_IN: readonly number[] = [\n\tBODY_INSET_DEFAULTS_PT.top / POINTS_PER_INCH,\n\tBODY_INSET_DEFAULTS_PT.right / POINTS_PER_INCH,\n\tBODY_INSET_DEFAULTS_PT.bottom / POINTS_PER_INCH,\n\tBODY_INSET_DEFAULTS_PT.left / POINTS_PER_INCH,\n]\n\n/**\n * The same four in EMU, which is the unit the measured-fit solver works in.\n *\n * Derived rather than transcribed, for the same reason {@link BODY_INSET_DEFAULTS_IN} is.\n */\nexport const BODY_INSET_DEFAULTS_EMU = {\n\tleft: BODY_INSET_DEFAULTS_PT.left * EMU_PER_POINT,\n\tright: BODY_INSET_DEFAULTS_PT.right * EMU_PER_POINT,\n\ttop: BODY_INSET_DEFAULTS_PT.top * EMU_PER_POINT,\n\tbottom: BODY_INSET_DEFAULTS_PT.bottom * EMU_PER_POINT,\n} as const\n\n/**\n * A table cell's default text insets in EMU. They happen to equal {@link BODY_INSET_DEFAULTS_EMU}.\n * Declared in `table-cell-margins.ts`, which imports nothing, so the write path's inch defaults can\n * derive from it without bringing this module along.\n */\nexport { TABLE_CELL_MARGIN_DEFAULTS_EMU } from './table-cell-margins.js'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAsBA,MAAa,yBAAyB;CAAE,MAAM;CAAK,OAAO;CAAK,KAAK;CAAK,QAAQ;AAAI;;;;;;AAOrF,MAAa,yBAA4C;CACxD,uBAAuB,MAAA;CACvB,uBAAuB,QAAA;CACvB,uBAAuB,SAAA;CACvB,uBAAuB,OAAA;AACxB;;;;;;AAOA,MAAa,0BAA0B;CACtC,MAAM,uBAAuB,OAAO;CACpC,OAAO,uBAAuB,QAAQ;CACtC,KAAK,uBAAuB,MAAM;CAClC,QAAQ,uBAAuB,SAAS;AACzC"}
|
package/dist/browser.d.ts
CHANGED
|
@@ -1,23 +1,28 @@
|
|
|
1
|
-
import { C as isChartType, S as isChartExType, _ as VALID_SHAPE_PRESETS, a as CONNECTOR_PRESET_NAME, b as asChartType, c as PLACEHOLDER_TYPE, d as SHAPE_NAME, f as SchemeColor, g as TextAnchor, h as TableStyle, i as CHART_NAME, l as PlaceholderType, m as SlideObjectType, n as AlignV, o as ChartType, p as ShapeType, r as BulletType, s as OutputType, t as AlignH, u as SCHEME_COLORS, v as WRITE_OUTPUT_TYPE, x as connectorPresetFor, y as ZIP_OUTPUT_TYPE } from "./enums-BUKTUB6V.js";
|
|
2
|
-
import { $ as ChartPropsAxisCat, $t as ShapeAdjustValue, A as TextVertType, At as NotesTextOptions, B as ShapeFillProps, Bt as TextMeasurement, C as ImageFillProps, Cn as TimeUnit, Ct as CommonObjectDescriptor, D as PatternPreset, Dt as CommentProps, E as PatternFillProps, Et as PlaceholderProps, F as ConnectorType, Ft as TableLayoutResult, G as ChartDataPointStyle, Gt as ImageBaseProps, H as StrokeProps, Ht as TextPropsOptions, I as FillOption, It as TextBaseProps, J as ChartExGeography, Jt as MediaType, K as ChartErrorBarOptions, Kt as ImageProps, L as HyperlinkActionJump, Lt as TextBulletProps, M as VAlign, Mt as ResolvedCommentAuthor, N as BorderProps, Nt as SlideComment, O as PositionProps, Ot as MeasureTextOptions, P as ConnectorProps, Pt as TableCellLayout, Q as ChartOpts, Qt as ShapeAdjustHandleXY, R as HyperlinkProps, Rt as TextFitShrinkProps, S as HexColor, St as OptsChartGridLine, T as Margin, Tt as ObjectNameProps, U as ChartAreaProps, Ut as textRun, V as ShapeLineProps, Vt as TextProps, W as ChartAxisTickMark, Wt as textRuns, X as ChartLineDash, Xt as ShapeAdjustHandle, Y as ChartExStatistics, Yt as OleObjectProps, Z as ChartMulti, Zt as ShapeAdjustHandlePolar, _ as DataOrPathRequiredProps, _n as RadarStyleAlias, _t as ChartPropsLegend, a as PresentationProps, an as BarGrouping, at as ChartPropsChartDoughnut, b as GradientStopProps, bt as LineCap, c as WriteFileProps, cn as DataLabelPosition, ct as ChartPropsChartPie, d as ThemeProps, dn as LegendPosition, dt as ChartPropsChartStock, en as ShapeConnectionSite, et as ChartPropsAxisSer, f as BackgroundOption, fn as LightRigDirection, ft as ChartPropsChartSurface, g as DataOrPathProps, gn as RadarStyle, gt as ChartPropsFillLine, h as Coord, hn as PresetMaterialType, ht as ChartPropsDataTable, i as PresLayout, in as BarDirection, it as ChartPropsChartBoxWhisker, j as ThemeColor, jt as OverflowBoxOptions, k as RadialGradientFillProps, kt as NotesProps, l as WriteProps, ln as DisplayBlanksAs, lt as ChartPropsChartRadar, m as Color, mn as LineDataSymbol, mt as ChartPropsDataLabel, n as PackagePart, nn as ShapeProps, nt as ChartPropsBase, o as SectionProps, on as BevelPresetType, ot as ChartPropsChartHistogram, p as BackgroundProps, pn as LightRigType, pt as ChartPropsChartWaterfall, q as ChartExBinning, qt as MediaProps, r as PartsProps, rn as Bar3DShape, rt as ChartPropsChartBar, s as WriteBaseProps, st as ChartPropsChartLine, t as CustomPropertyValue, tn as ShapeGuide, tt as ChartPropsAxisVal, u as ThemeColorScheme, ut as ChartPropsChartRegionMap, v as GeometryPoint, vt as ChartPropsTitle, w as LinearGradientFillProps, wt as ObjectLockProps, x as HAlign, xt as OptsChartData, y as GradientFillProps, yt as ChartSeriesOpts, z as ShadowProps, zt as TextGlowProps } from "./pres-C6qgOFAa.js";
|
|
3
|
-
import { A as TableCellDiagonals, C as AnimationTrigger, D as TransitionType, E as TransitionSoundProps, F as TableToSlidesDocument, I as TableToSlidesElement, L as TableToSlidesProps, M as TableProps, N as TableRow, O as TableCell, P as TableRowSlide, S as AnimationProps, T as TransitionProps, _ as MasterTextStyleProps, a as Slide, b as SlideMasterProps, c as SectionZoomProps, d as ZoomBaseProps, f as Model3dCameraProps, g as MasterTextStyleLevel, h as MasterBulletProps, i as ObjectOptions, j as TableCellProps, k as TableCell3DProps, l as SlideZoomProps, m as Model3dProps, n as GroupChildProps, o as SlideLayout, p as Model3dPoint, r as GroupProps, s as SlideObjectInfo, t as AddSlideProps, u as SummaryZoomProps, v as SlideMasterChartProps, w as PresetEffect, x as SlideNumberProps, y as SlideMasterObject } from "./slide-Dx2ZeVZ6.js";
|
|
4
|
-
import { _ as PackageReadErrorCode, a as InternalError, c as PackageReadError, d as UnsupportedFeatureError, f as DiagnosticCode, g as MediaErrorCode, h as InvalidOptionErrorCode, i as setDiagnosticHandler, l as TsPptxError, m as InternalErrorCode, n as DiagnosticHandler, o as InvalidOptionError, p as ErrorCode, r as resetDiagnosticState, s as MediaError, t as Diagnostic, u as TsPptxErrorOptions, v as TsPptxCode, y as UnsupportedFeatureErrorCode } from "./diagnostics-D8ot4Ei7.js";
|
|
5
|
-
import { A as pixelsToEmu, C as StandardLayoutName, D as emuToPoints, E as emuToPixels, M as ptToHundredths, O as inchesToEmu, S as StandardLayout, T as emuToInches, _ as HUNDREDTHS_PER_POINT, b as PERCENT_SCALE, c as ConstructFamily, g as FIXED_PCT_PER_PERCENT, h as Emu, i as ComposedSlide, j as pointsToEmu, k as percentToEmu, m as DEFAULT_PX_PER_INCH, n as Composed, p as ANGLE_UNITS_PER_DEGREE, r as ComposedPresentation, s as PresentationCore, t as ComposeOptions, v as MAX_COORDINATE_EMU, w as coordToEmu, x as STANDARD_LAYOUTS, y as MIN_COORDINATE_EMU } from "./entry-compose-DCnvBZz2.js";
|
|
6
|
-
import { a as EMU_PER_INCH, i as clipPath, n as FlatSide, o as EMU_PER_POINT, r as HalfDiscPreset, s as POINTS_PER_INCH, t as ClipShape } from "./clip-Bl01BPcN.js";
|
|
7
|
-
//#region src/browser.d.ts
|
|
8
1
|
/**
|
|
9
|
-
* The browser entry,
|
|
2
|
+
* The browser authoring entry, which the bare `pptx-ts` specifier resolves to under the
|
|
3
|
+
* `browser` export condition.
|
|
4
|
+
*
|
|
5
|
+
* @module
|
|
6
|
+
*/
|
|
7
|
+
import { C as isChartType, S as isChartExType, _ as VALID_SHAPE_PRESETS, a as CONNECTOR_PRESET_NAME, b as asChartType, c as PLACEHOLDER_TYPE, d as SHAPE_NAME, f as SchemeColor, g as TextAnchor, h as TableStyle, i as CHART_NAME, l as PlaceholderType, m as SlideObjectType, n as AlignV, o as ChartType, p as ShapeType, r as BulletType, s as OutputType, t as AlignH, u as SCHEME_COLORS, v as WRITE_OUTPUT_TYPE, x as connectorPresetFor, y as ZIP_OUTPUT_TYPE } from "./enums-PcXr3o3J.js";
|
|
8
|
+
import { $ as ChartExBinning, $t as ImageBaseProps, A as PositionProps, At as ObjectLockProps, B as HyperlinkActionJump, Bt as ResolvedCommentAuthor, C as HexColor, Ct as ChartPropsLegend, D as PatternFillProps, Dt as OptsChartData, E as Margin, En as RadarStyleAlias, Et as LineCap, F as ActionHyperlinkProps, Ft as CommentProps, G as ShapeLineProps, Gt as TextBulletProps, H as HyperlinkProps, Ht as TableCellLayout, I as BorderProps, It as MeasureTextOptions, J as UrlHyperlinkProps, Jt as TextMeasurement, K as SlideHyperlinkProps, Kt as TextFitShrinkProps, L as ConnectorProps, Lt as NotesProps, M as TextVertType, Mn as TimeUnit, Mt as PlaceholderBinding, N as ThemeColor, Nt as PlaceholderOption, O as PatternPreset, Ot as OptsChartGridLine, P as VAlign, Pt as PlaceholderProps, Q as ChartErrorBarOptions, Qt as textRuns, R as ConnectorType, Rt as NotesTextOptions, S as HAlign, Sn as LineDataSymbol, St as ChartPropsFillLine, T as LinearGradientFillProps, Tn as RadarStyle, Tt as ChartSeriesOpts, U as ShadowProps, Ut as TableLayoutResult, V as HyperlinkBaseProps, Vt as SlideComment, W as ShapeFillProps, Wt as TextBaseProps, X as ChartAxisTickMark, Xt as TextPropsOptions, Y as ChartAreaProps, Yt as TextProps, Z as ChartDataPointStyle, Zt as textRun, _ as DataOrPathProps, _n as DisplayBlanksAs, _t as ChartPropsChartStock, a as PresentationProps, an as ShapeAdjustHandlePolar, at as ChartPropsAxisCat, b as GradientFillProps, bn as LightRigDirection, bt as ChartPropsDataLabel, c as WriteFileProps, cn as ShapeConnectionSite, ct as ChartPropsBase, d as ThemeColorScheme, dn as Bar3DShape, dt as ChartPropsChartDoughnut, en as ImageProps, et as ChartExGeography, f as ThemeProps, fn as BarDirection, ft as ChartPropsChartHistogram, g as Coord, gn as DataLabelPosition, gt as ChartPropsChartRegionMap, h as Color, ht as ChartPropsChartRadar, i as PresLayout, in as ShapeAdjustHandle, it as ChartOpts, j as RadialGradientFillProps, jt as ObjectNameProps, k as PlaceholderPositionProps, kt as CommonObjectDescriptor, l as WriteOutputMap, ln as ShapeGuide, lt as ChartPropsChartBar, m as BackgroundProps, mn as BevelPresetType, mt as ChartPropsChartPie, n as PackagePart, nn as MediaType, nt as ChartLineDash, o as SectionProps, on as ShapeAdjustHandleXY, ot as ChartPropsAxisSer, p as BackgroundOption, pn as BarGrouping, pt as ChartPropsChartLine, q as StrokeProps, qt as TextGlowProps, r as PartsProps, rn as OleObjectProps, rt as ChartMulti, s as WriteBaseProps, sn as ShapeAdjustValue, st as ChartPropsAxisVal, t as CustomPropertyValue, tn as MediaProps, tt as ChartExStatistics, u as WriteProps, un as ShapeProps, ut as ChartPropsChartBoxWhisker, v as DataOrPathRequiredProps, vt as ChartPropsChartSurface, w as ImageFillProps, wn as PresetMaterialType, wt as ChartPropsTitle, x as GradientStopProps, xn as LightRigType, xt as ChartPropsDataTable, y as GeometryPoint, yn as LegendPosition, yt as ChartPropsChartWaterfall, z as FillOption, zt as OverflowBoxOptions } from "./pres-BkEkUAEM.js";
|
|
9
|
+
import { A as pixelsToEmu, C as StandardLayoutName, D as emuToPoints, E as emuToPixels, M as ptToHundredths, O as inchesToEmu, S as StandardLayout, T as emuToInches, _ as HUNDREDTHS_PER_POINT, b as PERCENT_SCALE, c as ConstructFamily, g as FIXED_PCT_PER_PERCENT, h as Emu, i as ComposedSlide, j as pointsToEmu, k as percentToEmu, m as DEFAULT_PX_PER_INCH, n as Composed, p as ANGLE_UNITS_PER_DEGREE, r as ComposedPresentation, s as PresentationCore, t as ComposeOptions, v as MAX_COORDINATE_EMU, w as coordToEmu, x as STANDARD_LAYOUTS, y as MIN_COORDINATE_EMU } from "./entry-compose-CiakSt-f.js";
|
|
10
|
+
import { S as UnsupportedFeatureErrorCode, _ as InternalErrorCode, a as TsPptxCode, b as PackageReadErrorCode, c as InternalError, d as PackageReadError, f as PptxTsError, g as ErrorCode, h as DiagnosticCode, i as setDiagnosticHandler, l as InvalidOptionError, m as UnsupportedFeatureError, n as DiagnosticHandler, o as TsPptxError, p as PptxTsErrorOptions, r as resetDiagnosticState, s as TsPptxErrorOptions, t as Diagnostic, u as MediaError, v as InvalidOptionErrorCode, x as PptxTsCode, y as MediaErrorCode } from "./diagnostics-MoA4MBq5.js";
|
|
11
|
+
import { A as TableCellDiagonals, C as AnimationTrigger, D as TransitionType, E as TransitionSoundProps, F as TableToSlidesDocument, I as TableToSlidesElement, L as TableToSlidesProps, M as TableProps, N as TableRow, O as TableCell, P as TableRowSlide, S as AnimationProps, T as TransitionProps, _ as MasterTextStyleProps, a as Slide, b as SlideMasterProps, c as SectionZoomProps, d as ZoomBaseProps, f as Model3dCameraProps, g as MasterTextStyleLevel, h as MasterBulletProps, i as ObjectOptions, j as TableCellProps, k as TableCell3DProps, l as SlideZoomProps, m as Model3dProps, n as GroupChildProps, o as SlideLayout, p as Model3dPoint, r as GroupProps, s as SlideObjectInfo, t as AddSlideProps, u as SummaryZoomProps, v as SlideMasterChartProps, w as PresetEffect, x as SlideNumberProps, y as SlideMasterObject } from "./slide-BmT4kMoO.js";
|
|
12
|
+
import { a as EMU_PER_INCH, i as clipPath, n as FlatSide, o as EMU_PER_POINT, r as HalfDiscPreset, s as POINTS_PER_INCH, t as ClipShape } from "./clip-ISfCMtWA.js";
|
|
13
|
+
/**
|
|
14
|
+
* The browser entry, reached through the `browser` export condition. A bundler resolving the
|
|
10
15
|
* bare `pptx-ts` specifier for the web lands here without naming this subpath.
|
|
11
16
|
*
|
|
12
17
|
* Same authoring API as every other entry (see `entry-surface.ts`), plus one method that only
|
|
13
|
-
* makes sense with a live DOM: {@link
|
|
18
|
+
* makes sense with a live DOM: {@link PptxTs.tableToSlides}. `writeFile` triggers a download
|
|
14
19
|
* rather than touching a filesystem.
|
|
15
20
|
*/
|
|
16
|
-
export declare class
|
|
21
|
+
export declare class PptxTs extends PresentationCore {
|
|
17
22
|
constructor();
|
|
18
23
|
/**
|
|
19
|
-
* Reproduces a rendered HTML `<table>` as a PowerPoint table
|
|
20
|
-
* style, etc.
|
|
24
|
+
* Reproduces a rendered HTML `<table>` as a PowerPoint table (including column widths,
|
|
25
|
+
* style, etc.), creating one or more slides as needed. Resolves `eleId` against the global
|
|
21
26
|
* `document`, so it exists only on the browser/standalone build; the same conversion is
|
|
22
27
|
* available anywhere there is a DOM as the free `tableToSlides` on `pptx-ts/html`, which
|
|
23
28
|
* also takes the element directly. The in-memory `slide.addTable(rows, opts)` path remains
|
|
@@ -26,7 +31,7 @@ export declare class TsPptx extends PresentationCore {
|
|
|
26
31
|
* That global lookup is why this stays rather than folding into the free function: reaching
|
|
27
32
|
* `document` without being handed one is the affordance the browser entry exists to give, and
|
|
28
33
|
* it is the one thing the platform-agnostic form deliberately will not do. The conversion
|
|
29
|
-
* itself lives in one place either way
|
|
34
|
+
* itself lives in one place either way: both spellings call `genTableToSlides`.
|
|
30
35
|
* @param {string} eleId - table HTML element ID
|
|
31
36
|
* @param {TableToSlidesProps} options - generation options
|
|
32
37
|
*/
|
|
@@ -35,7 +40,7 @@ export declare class TsPptx extends PresentationCore {
|
|
|
35
40
|
/**
|
|
36
41
|
* Compose a presentation from the construct families it needs, on the browser adapter.
|
|
37
42
|
*
|
|
38
|
-
* The counterpart to {@link
|
|
43
|
+
* The counterpart to {@link PptxTs}, which is composed with every family there is. This one costs
|
|
39
44
|
* what it carries: the core tier (text, shapes, images, groups, speaker notes) plus whatever
|
|
40
45
|
* `use` names, and nothing else reaches the bundle. `tableToSlides` is one of those families
|
|
41
46
|
* (`domTables`), so a deck that wants it composes it.
|
|
@@ -46,6 +51,9 @@ export declare class TsPptx extends PresentationCore {
|
|
|
46
51
|
* const pres = createPresentation({ use: [charts, domTables] })
|
|
47
52
|
*/
|
|
48
53
|
export declare function createPresentation<const Fs extends readonly ConstructFamily[] = []>(opts?: ComposeOptions<Fs>): Composed<Fs>;
|
|
49
|
-
|
|
50
|
-
export
|
|
54
|
+
/** @deprecated Renamed to {@link PptxTs}. This alias is removed in v5. */
|
|
55
|
+
export declare const TsPptx: typeof PptxTs;
|
|
56
|
+
/** @deprecated Renamed to {@link PptxTs}. This alias is removed in v5. */
|
|
57
|
+
export type TsPptx = PptxTs;
|
|
58
|
+
export { ANGLE_UNITS_PER_DEGREE, ActionHyperlinkProps, AddSlideProps, AlignH, AlignV, AnimationProps, AnimationTrigger, BackgroundOption, BackgroundProps, type Bar3DShape, type BarDirection, type BarGrouping, type BevelPresetType, BorderProps, BulletType, CHART_NAME, CONNECTOR_PRESET_NAME, ChartAreaProps, ChartAxisTickMark, ChartDataPointStyle, ChartErrorBarOptions, ChartExBinning, ChartExGeography, ChartExStatistics, ChartLineDash, ChartMulti, ChartOpts, ChartPropsAxisCat, ChartPropsAxisSer, ChartPropsAxisVal, ChartPropsBase, ChartPropsChartBar, ChartPropsChartBoxWhisker, ChartPropsChartDoughnut, ChartPropsChartHistogram, ChartPropsChartLine, ChartPropsChartPie, ChartPropsChartRadar, ChartPropsChartRegionMap, ChartPropsChartStock, ChartPropsChartSurface, ChartPropsChartWaterfall, ChartPropsDataLabel, ChartPropsDataTable, ChartPropsFillLine, ChartPropsLegend, ChartPropsTitle, ChartSeriesOpts, ChartType, ClipShape, Color, CommentProps, CommonObjectDescriptor, type ComposeOptions, type Composed, type ComposedPresentation, type ComposedSlide, ConnectorProps, ConnectorType, type ConstructFamily, Coord, CustomPropertyValue, DEFAULT_PX_PER_INCH, type DataLabelPosition, DataOrPathProps, DataOrPathRequiredProps, type Diagnostic, type DiagnosticCode, type DiagnosticHandler, type DisplayBlanksAs, EMU_PER_INCH, EMU_PER_POINT, Emu, type ErrorCode, FIXED_PCT_PER_PERCENT, FillOption, FlatSide, GeometryPoint, GradientFillProps, GradientStopProps, GroupChildProps, GroupProps, HAlign, HUNDREDTHS_PER_POINT, HalfDiscPreset, HexColor, HyperlinkActionJump, HyperlinkBaseProps, HyperlinkProps, ImageBaseProps, ImageFillProps, ImageProps, InternalError, type InternalErrorCode, InvalidOptionError, type InvalidOptionErrorCode, type LegendPosition, type LightRigDirection, type LightRigType, LineCap, type LineDataSymbol, LinearGradientFillProps, MAX_COORDINATE_EMU, MIN_COORDINATE_EMU, Margin, MasterBulletProps, MasterTextStyleLevel, MasterTextStyleProps, MeasureTextOptions, MediaError, type MediaErrorCode, MediaProps, MediaType, Model3dCameraProps, Model3dPoint, Model3dProps, NotesProps, NotesTextOptions, ObjectLockProps, ObjectNameProps, ObjectOptions, OleObjectProps, OptsChartData, OptsChartGridLine, OutputType, OverflowBoxOptions, PERCENT_SCALE, PLACEHOLDER_TYPE, POINTS_PER_INCH, PackagePart, PackageReadError, type PackageReadErrorCode, PartsProps, PatternFillProps, PatternPreset, PlaceholderBinding, PlaceholderOption, PlaceholderPositionProps, PlaceholderProps, PlaceholderType, PositionProps, PptxTs as default, type PptxTsCode, PptxTsError, type PptxTsErrorOptions, PresLayout, PresentationProps, PresetEffect, type PresetMaterialType, type RadarStyle, type RadarStyleAlias, RadialGradientFillProps, ResolvedCommentAuthor, SCHEME_COLORS, SHAPE_NAME, STANDARD_LAYOUTS, SchemeColor, SectionProps, SectionZoomProps, ShadowProps, ShapeAdjustHandle, ShapeAdjustHandlePolar, ShapeAdjustHandleXY, ShapeAdjustValue, ShapeConnectionSite, ShapeFillProps, ShapeGuide, ShapeLineProps, ShapeProps, ShapeType, Slide, SlideComment, SlideHyperlinkProps, SlideLayout, SlideMasterChartProps, SlideMasterObject, SlideMasterProps, SlideNumberProps, SlideObjectInfo, SlideObjectType, SlideZoomProps, StandardLayout, StandardLayoutName, StrokeProps, SummaryZoomProps, TableCell, TableCell3DProps, TableCellDiagonals, TableCellLayout, TableCellProps, TableLayoutResult, TableProps, TableRow, TableRowSlide, TableStyle, TableToSlidesDocument, TableToSlidesElement, TableToSlidesProps, TextAnchor, TextBaseProps, TextBulletProps, TextFitShrinkProps, TextGlowProps, TextMeasurement, TextProps, TextPropsOptions, TextVertType, ThemeColor, ThemeColorScheme, ThemeProps, type TimeUnit, TransitionProps, TransitionSoundProps, TransitionType, TsPptxCode, TsPptxError, TsPptxErrorOptions, UnsupportedFeatureError, type UnsupportedFeatureErrorCode, UrlHyperlinkProps, VALID_SHAPE_PRESETS, VAlign, WRITE_OUTPUT_TYPE, WriteBaseProps, WriteFileProps, WriteOutputMap, WriteProps, ZIP_OUTPUT_TYPE, ZoomBaseProps, asChartType, clipPath, connectorPresetFor, coordToEmu, emuToInches, emuToPixels, emuToPoints, inchesToEmu, isChartExType, isChartType, percentToEmu, pixelsToEmu, pointsToEmu, ptToHundredths, resetDiagnosticState, setDiagnosticHandler, textRun, textRuns };
|
|
51
59
|
//# sourceMappingURL=browser.d.ts.map
|
package/dist/browser.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser.d.ts","names":[],"sources":["../src/browser.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"browser.d.ts","names":[],"sources":["../src/browser.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;qBAsBa,eAAe;EAC3B;;;;;;;;;;;;;;;;EAqBA,cAAc,eAAe,UAAS;;;;;;;;;;;;;;;wBAkBvB,yBAAyB,oBAAoB,wBAC5D,OAAO,eAAe,MACpB,SAAS;;qBAOC,eAAM;;YAEP,SAAS"}
|
package/dist/browser.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { A as inchesToEmu, C as MIN_COORDINATE_EMU, D as emuToInches, E as coordToEmu, F as EMU_PER_INCH, I as EMU_PER_POINT, L as POINTS_PER_INCH, M as pixelsToEmu, N as pointsToEmu, O as emuToPixels, P as ptToHundredths, S as MAX_COORDINATE_EMU, T as STANDARD_LAYOUTS,
|
|
3
|
-
import {
|
|
4
|
-
import { r as PPTX_CONTENT_TYPE } from "./zip-
|
|
5
|
-
import { t as tableDomFamily } from "./table-dom-
|
|
6
|
-
|
|
1
|
+
import { c as ALL_CONSTRUCT_FAMILIES, d as IMG_SVG_PLACEHOLDER, i as fetchFontBytes, l as composePresentation, n as textRuns, r as clipPath, t as textRun, u as PresentationCore } from "./text-CU08xJGs.js";
|
|
2
|
+
import { A as inchesToEmu, C as MIN_COORDINATE_EMU, D as emuToInches, E as coordToEmu, F as EMU_PER_INCH, I as EMU_PER_POINT, L as POINTS_PER_INCH, M as pixelsToEmu, N as pointsToEmu, O as emuToPixels, P as ptToHundredths, S as MAX_COORDINATE_EMU, T as STANDARD_LAYOUTS, a as OutputType, b as FIXED_PCT_PER_PERCENT, c as ShapeType, d as TextAnchor, f as VALID_SHAPE_PRESETS, g as isChartType, h as isChartExType, i as ChartType, j as percentToEmu, k as emuToPoints, l as SlideObjectType, m as connectorPresetFor, n as AlignV, o as PlaceholderType, p as asChartType, r as BulletType, s as SchemeColor, t as AlignH, u as TableStyle, v as ANGLE_UNITS_PER_DEGREE, w as PERCENT_SCALE, x as HUNDREDTHS_PER_POINT, y as DEFAULT_PX_PER_INCH } from "./enums-BP9wsb9Q.js";
|
|
3
|
+
import { a as PackageReadError, c as resetDiagnosticState, i as MediaError, l as setDiagnosticHandler, n as InternalError, o as PptxTsError, r as InvalidOptionError, s as UnsupportedFeatureError, t as TsPptxError } from "./entry-errors-JMthgJ2g.js";
|
|
4
|
+
import { r as PPTX_CONTENT_TYPE } from "./zip-7JTh61LX.js";
|
|
5
|
+
import { t as tableDomFamily } from "./table-dom-BYga4FYY.js";
|
|
6
|
+
// src/runtime/browser.ts
|
|
7
7
|
function createBrowserRuntime() {
|
|
8
8
|
return {
|
|
9
9
|
writeFileOutputType: null,
|
|
@@ -14,7 +14,7 @@ function createBrowserRuntime() {
|
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
|
-
* Returns a `data:` URI, not raw base64
|
|
17
|
+
* Returns a `data:` URI, not raw base64; see {@link RuntimeAdapter.loadMedia}. The `FileReader`
|
|
18
18
|
* is what makes this adapter's own implementation worth keeping: it decodes the blob off the main
|
|
19
19
|
* thread, where the shared `fetchMediaBase64` would encode the whole payload synchronously.
|
|
20
20
|
*/
|
|
@@ -58,7 +58,7 @@ async function createSvgPngPreview(rel) {
|
|
|
58
58
|
}
|
|
59
59
|
};
|
|
60
60
|
image.onerror = () => fail();
|
|
61
|
-
image.src =
|
|
61
|
+
image.src = rel.data;
|
|
62
62
|
});
|
|
63
63
|
}
|
|
64
64
|
async function writeFile(fileName, data) {
|
|
@@ -76,8 +76,7 @@ async function writeFile(fileName, data) {
|
|
|
76
76
|
}, 100);
|
|
77
77
|
return fileName;
|
|
78
78
|
}
|
|
79
|
-
|
|
80
|
-
//#region src/browser.ts
|
|
79
|
+
// src/browser.ts
|
|
81
80
|
/**
|
|
82
81
|
* The browser authoring entry, which the bare `pptx-ts` specifier resolves to under the
|
|
83
82
|
* `browser` export condition.
|
|
@@ -85,20 +84,20 @@ async function writeFile(fileName, data) {
|
|
|
85
84
|
* @module
|
|
86
85
|
*/
|
|
87
86
|
/**
|
|
88
|
-
* The browser entry, reached through the `browser` export condition
|
|
87
|
+
* The browser entry, reached through the `browser` export condition. A bundler resolving the
|
|
89
88
|
* bare `pptx-ts` specifier for the web lands here without naming this subpath.
|
|
90
89
|
*
|
|
91
90
|
* Same authoring API as every other entry (see `entry-surface.ts`), plus one method that only
|
|
92
|
-
* makes sense with a live DOM: {@link
|
|
91
|
+
* makes sense with a live DOM: {@link PptxTs.tableToSlides}. `writeFile` triggers a download
|
|
93
92
|
* rather than touching a filesystem.
|
|
94
93
|
*/
|
|
95
|
-
var
|
|
94
|
+
var PptxTs = class extends PresentationCore {
|
|
96
95
|
constructor() {
|
|
97
96
|
super(createBrowserRuntime(), [...ALL_CONSTRUCT_FAMILIES, tableDomFamily]);
|
|
98
97
|
}
|
|
99
98
|
/**
|
|
100
|
-
* Reproduces a rendered HTML `<table>` as a PowerPoint table
|
|
101
|
-
* style, etc.
|
|
99
|
+
* Reproduces a rendered HTML `<table>` as a PowerPoint table (including column widths,
|
|
100
|
+
* style, etc.), creating one or more slides as needed. Resolves `eleId` against the global
|
|
102
101
|
* `document`, so it exists only on the browser/standalone build; the same conversion is
|
|
103
102
|
* available anywhere there is a DOM as the free `tableToSlides` on `pptx-ts/html`, which
|
|
104
103
|
* also takes the element directly. The in-memory `slide.addTable(rows, opts)` path remains
|
|
@@ -107,7 +106,7 @@ var TsPptx = class extends PresentationCore {
|
|
|
107
106
|
* That global lookup is why this stays rather than folding into the free function: reaching
|
|
108
107
|
* `document` without being handed one is the affordance the browser entry exists to give, and
|
|
109
108
|
* it is the one thing the platform-agnostic form deliberately will not do. The conversion
|
|
110
|
-
* itself lives in one place either way
|
|
109
|
+
* itself lives in one place either way: both spellings call `genTableToSlides`.
|
|
111
110
|
* @param {string} eleId - table HTML element ID
|
|
112
111
|
* @param {TableToSlidesProps} options - generation options
|
|
113
112
|
*/
|
|
@@ -118,7 +117,7 @@ var TsPptx = class extends PresentationCore {
|
|
|
118
117
|
/**
|
|
119
118
|
* Compose a presentation from the construct families it needs, on the browser adapter.
|
|
120
119
|
*
|
|
121
|
-
* The counterpart to {@link
|
|
120
|
+
* The counterpart to {@link PptxTs}, which is composed with every family there is. This one costs
|
|
122
121
|
* what it carries: the core tier (text, shapes, images, groups, speaker notes) plus whatever
|
|
123
122
|
* `use` names, and nothing else reaches the bundle. `tableToSlides` is one of those families
|
|
124
123
|
* (`domTables`), so a deck that wants it composes it.
|
|
@@ -131,7 +130,8 @@ var TsPptx = class extends PresentationCore {
|
|
|
131
130
|
function createPresentation(opts) {
|
|
132
131
|
return composePresentation(createBrowserRuntime(), opts);
|
|
133
132
|
}
|
|
134
|
-
|
|
135
|
-
|
|
133
|
+
/** @deprecated Renamed to {@link PptxTs}. This alias is removed in v5. */
|
|
134
|
+
const TsPptx = PptxTs;
|
|
135
|
+
export { ANGLE_UNITS_PER_DEGREE, AlignH, AlignV, BulletType, ChartType, DEFAULT_PX_PER_INCH, EMU_PER_INCH, EMU_PER_POINT, FIXED_PCT_PER_PERCENT, HUNDREDTHS_PER_POINT, InternalError, InvalidOptionError, MAX_COORDINATE_EMU, MIN_COORDINATE_EMU, MediaError, OutputType, PERCENT_SCALE, POINTS_PER_INCH, PackageReadError, PlaceholderType, PptxTs, PptxTs as default, PptxTsError, STANDARD_LAYOUTS, SchemeColor, ShapeType, SlideObjectType, TableStyle, TextAnchor, TsPptx, TsPptxError, UnsupportedFeatureError, VALID_SHAPE_PRESETS, asChartType, clipPath, connectorPresetFor, coordToEmu, createPresentation, emuToInches, emuToPixels, emuToPoints, inchesToEmu, isChartExType, isChartType, percentToEmu, pixelsToEmu, pointsToEmu, ptToHundredths, resetDiagnosticState, setDiagnosticHandler, textRun, textRuns };
|
|
136
136
|
|
|
137
137
|
//# sourceMappingURL=browser.js.map
|
package/dist/browser.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser.js","names":[],"sources":["../src/runtime/browser.ts","../src/browser.ts"],"sourcesContent":["import { IMG_SVG_PLACEHOLDER } from '../media/placeholders.js'\nimport { MediaError } from '../errors.js'\nimport type { SlideRelMedia } from '../types/internal.js'\nimport type { RuntimeAdapter } from './types.js'\nimport { fetchFontBytes } from './fetch-media.js'\nimport { PPTX_CONTENT_TYPE } from '../ooxml/pptx-content-type.js'\n\nexport function createBrowserRuntime(): RuntimeAdapter {\n\treturn {\n\t\twriteFileOutputType: null,\n\t\tloadMedia,\n\t\tcreateSvgPngPreview,\n\t\twriteFile,\n\t\tloadFontData: fetchFontBytes,\n\t}\n}\n\n/**\n * Returns a `data:` URI, not raw base64
|
|
1
|
+
{"version":3,"file":"browser.js","names":[],"sources":["../src/runtime/browser.ts","../src/browser.ts"],"sourcesContent":["import { IMG_SVG_PLACEHOLDER } from '../media/placeholders.js'\nimport { MediaError } from '../errors.js'\nimport type { SlideRelMedia } from '../types/internal.js'\nimport type { RuntimeAdapter } from './types.js'\nimport { fetchFontBytes } from './fetch-media.js'\nimport { PPTX_CONTENT_TYPE } from '../ooxml/pptx-content-type.js'\n\nexport function createBrowserRuntime(): RuntimeAdapter {\n\treturn {\n\t\twriteFileOutputType: null,\n\t\tloadMedia,\n\t\tcreateSvgPngPreview,\n\t\twriteFile,\n\t\tloadFontData: fetchFontBytes,\n\t}\n}\n\n/**\n * Returns a `data:` URI, not raw base64; see {@link RuntimeAdapter.loadMedia}. The `FileReader`\n * is what makes this adapter's own implementation worth keeping: it decodes the blob off the main\n * thread, where the shared `fetchMediaBase64` would encode the whole payload synchronously.\n */\nasync function loadMedia(rel: SlideRelMedia & { path: string }): Promise<string> {\n\tconst response = await fetch(rel.path)\n\tif (!response.ok) throw new MediaError('media/fetch-failed', `Unable to load image (fetch): ${rel.path}`)\n\tconst blob = await response.blob()\n\n\treturn await new Promise<string>((resolve, reject) => {\n\t\tconst reader = new FileReader()\n\t\treader.onloadend = () => resolve(reader.result as string)\n\t\treader.onerror = () =>\n\t\t\treject(new MediaError('media/decode-failed', `Unable to load image (FileReader): ${rel.path}`))\n\t\treader.readAsDataURL(blob)\n\t})\n}\n\nasync function createSvgPngPreview(rel: SlideRelMedia): Promise<MediaError | null> {\n\treturn await new Promise((resolve) => {\n\t\tconst image = new Image()\n\t\t// Resolves, as the Node and neutral adapters do. It used to reject, so the same failure\n\t\t// reached the caller three ways depending on runtime and on how the SVG arrived.\n\t\tconst fail = (reason?: unknown) => {\n\t\t\trel.data = IMG_SVG_PLACEHOLDER\n\t\t\tresolve(\n\t\t\t\tnew MediaError(\n\t\t\t\t\t'media/svg-preview-failed',\n\t\t\t\t\t`Unable to load image (image.onerror): ${rel.path}${reason ? ` - ${String(reason)}` : ''}`\n\t\t\t\t)\n\t\t\t)\n\t\t}\n\n\t\timage.onload = () => {\n\t\t\tif (image.width + image.height === 0) {\n\t\t\t\tfail('h/w=0')\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst canvas = document.createElement('CANVAS') as HTMLCanvasElement\n\t\t\tconst ctx = canvas.getContext('2d')\n\t\t\tif (!ctx) {\n\t\t\t\tfail('canvas 2d context unavailable')\n\t\t\t\treturn\n\t\t\t}\n\t\t\tcanvas.width = image.width\n\t\t\tcanvas.height = image.height\n\t\t\tctx.drawImage(image, 0, 0)\n\t\t\ttry {\n\t\t\t\t// `rel.type` is `image/png`, not the SVG's type, so this is a valid canvas output\n\t\t\t\t// type and not an `image/svg+xml` that silently falls back to PNG.\n\t\t\t\t// `createSvgPngPreview` is only called on a rel flagged `isSvgPng` (all three\n\t\t\t\t// call sites in `gen/media.ts` filter on it), and the only two places that\n\t\t\t\t// create such a rel (`gen/define/image.ts`, `gen/define/text.ts`) set the\n\t\t\t\t// *fallback's* type, since that is the part this writes. The SVG keeps its own\n\t\t\t\t// rel beside it.\n\t\t\t\trel.data = canvas.toDataURL(rel.type)\n\t\t\t\tresolve(null)\n\t\t\t} catch (ex) {\n\t\t\t\tfail(ex)\n\t\t\t}\n\t\t}\n\t\timage.onerror = () => fail()\n\t\timage.src = rel.data\n\t})\n}\n\nasync function writeFile(fileName: string, data: string | ArrayBuffer | Blob | Uint8Array): Promise<string> {\n\tconst eleLink = document.createElement('a')\n\teleLink.setAttribute('style', 'display:none;')\n\teleLink.dataset['interception'] = 'off'\n\tdocument.body.appendChild(eleLink)\n\n\tconst url = window.URL.createObjectURL(new Blob([data as Blob], { type: PPTX_CONTENT_TYPE }))\n\teleLink.href = url\n\teleLink.download = fileName\n\teleLink.click()\n\n\tsetTimeout(() => {\n\t\twindow.URL.revokeObjectURL(url)\n\t\tdocument.body.removeChild(eleLink)\n\t}, 100)\n\n\treturn fileName\n}\n","/**\n * The browser authoring entry, which the bare `pptx-ts` specifier resolves to under the\n * `browser` export condition.\n *\n * @module\n */\nimport PresentationCore from './presentation.js'\nimport { composePresentation, type ComposeOptions, type Composed } from './entry-compose.js'\nimport type { ConstructFamily } from './families/shared.js'\nimport { ALL_CONSTRUCT_FAMILIES } from './entry-families.js'\nimport { createBrowserRuntime } from './runtime/browser.js'\nimport { tableDomFamily } from './families/table-dom.js'\nimport type { TableToSlidesProps } from './types/index.js'\n\n/**\n * The browser entry, reached through the `browser` export condition. A bundler resolving the\n * bare `pptx-ts` specifier for the web lands here without naming this subpath.\n *\n * Same authoring API as every other entry (see `entry-surface.ts`), plus one method that only\n * makes sense with a live DOM: {@link PptxTs.tableToSlides}. `writeFile` triggers a download\n * rather than touching a filesystem.\n */\nexport class PptxTs extends PresentationCore {\n\tconstructor() {\n\t\t// The table family's live-DOM half is composed here and nowhere else: it is the one part of\n\t\t// the authoring surface that needs a `document`.\n\t\tsuper(createBrowserRuntime(), [...ALL_CONSTRUCT_FAMILIES, tableDomFamily])\n\t}\n\n\t/**\n\t * Reproduces a rendered HTML `<table>` as a PowerPoint table (including column widths,\n\t * style, etc.), creating one or more slides as needed. Resolves `eleId` against the global\n\t * `document`, so it exists only on the browser/standalone build; the same conversion is\n\t * available anywhere there is a DOM as the free `tableToSlides` on `pptx-ts/html`, which\n\t * also takes the element directly. The in-memory `slide.addTable(rows, opts)` path remains\n\t * the platform-agnostic way to build a table from data you already hold.\n\t *\n\t * That global lookup is why this stays rather than folding into the free function: reaching\n\t * `document` without being handed one is the affordance the browser entry exists to give, and\n\t * it is the one thing the platform-agnostic form deliberately will not do. The conversion\n\t * itself lives in one place either way: both spellings call `genTableToSlides`.\n\t * @param {string} eleId - table HTML element ID\n\t * @param {TableToSlidesProps} options - generation options\n\t */\n\ttableToSlides(eleId: string, options: TableToSlidesProps = {}): void {\n\t\tthis.familyAuthor('tableToSlides')(eleId, options)\n\t}\n}\n\n/**\n * Compose a presentation from the construct families it needs, on the browser adapter.\n *\n * The counterpart to {@link PptxTs}, which is composed with every family there is. This one costs\n * what it carries: the core tier (text, shapes, images, groups, speaker notes) plus whatever\n * `use` names, and nothing else reaches the bundle. `tableToSlides` is one of those families\n * (`domTables`), so a deck that wants it composes it.\n * @param {ComposeOptions} opts - the families to compose in, from `pptx-ts/families`\n * @example\n * import { createPresentation } from 'pptx-ts/browser'\n * import { charts, domTables } from 'pptx-ts/families'\n * const pres = createPresentation({ use: [charts, domTables] })\n */\nexport function createPresentation<const Fs extends readonly ConstructFamily[] = []>(\n\topts?: ComposeOptions<Fs>\n): Composed<Fs> {\n\treturn composePresentation(createBrowserRuntime(), opts)\n}\n\nexport { PptxTs as default }\n\n/** @deprecated Renamed to {@link PptxTs}. This alias is removed in v5. */\nexport const TsPptx = PptxTs\n/** @deprecated Renamed to {@link PptxTs}. This alias is removed in v5. */\nexport type TsPptx = PptxTs\n\nexport * from './entry-surface.js'\n"],"mappings":";;;;;;AAOA,SAAgB,uBAAuC;CACtD,OAAO;EACN,qBAAqB;EACrB;EACA;EACA;EACA,cAAc;CACf;AACD;;;;;;AAOA,eAAe,UAAU,KAAwD;CAChF,MAAM,WAAW,MAAM,MAAM,IAAI,IAAI;CACrC,IAAI,CAAC,SAAS,IAAI,MAAM,IAAI,WAAW,sBAAsB,iCAAiC,IAAI,MAAM;CACxG,MAAM,OAAO,MAAM,SAAS,KAAK;CAEjC,OAAO,MAAM,IAAI,SAAiB,SAAS,WAAW;EACrD,MAAM,SAAS,IAAI,WAAW;EAC9B,OAAO,kBAAkB,QAAQ,OAAO,MAAgB;EACxD,OAAO,gBACN,OAAO,IAAI,WAAW,uBAAuB,sCAAsC,IAAI,MAAM,CAAC;EAC/F,OAAO,cAAc,IAAI;CAC1B,CAAC;AACF;AAEA,eAAe,oBAAoB,KAAgD;CAClF,OAAO,MAAM,IAAI,SAAS,YAAY;EACrC,MAAM,QAAQ,IAAI,MAAM;EAGxB,MAAM,QAAQ,WAAqB;GAClC,IAAI,OAAO;GACX,QACC,IAAI,WACH,4BACA,yCAAyC,IAAI,OAAO,SAAS,MAAM,OAAO,MAAM,MAAM,IACvF,CACD;EACD;EAEA,MAAM,eAAe;GACpB,IAAI,MAAM,QAAQ,MAAM,WAAW,GAAG;IACrC,KAAK,OAAO;IACZ;GACD;GACA,MAAM,SAAS,SAAS,cAAc,QAAQ;GAC9C,MAAM,MAAM,OAAO,WAAW,IAAI;GAClC,IAAI,CAAC,KAAK;IACT,KAAK,+BAA+B;IACpC;GACD;GACA,OAAO,QAAQ,MAAM;GACrB,OAAO,SAAS,MAAM;GACtB,IAAI,UAAU,OAAO,GAAG,CAAC;GACzB,IAAI;IAQH,IAAI,OAAO,OAAO,UAAU,IAAI,IAAI;IACpC,QAAQ,IAAI;GACb,SAAS,IAAI;IACZ,KAAK,EAAE;GACR;EACD;EACA,MAAM,gBAAgB,KAAK;EAC3B,MAAM,MAAM,IAAI;CACjB,CAAC;AACF;AAEA,eAAe,UAAU,UAAkB,MAAiE;CAC3G,MAAM,UAAU,SAAS,cAAc,GAAG;CAC1C,QAAQ,aAAa,SAAS,eAAe;CAC7C,QAAQ,QAAQ,kBAAkB;CAClC,SAAS,KAAK,YAAY,OAAO;CAEjC,MAAM,MAAM,OAAO,IAAI,gBAAgB,IAAI,KAAK,CAAC,IAAY,GAAG,EAAE,MAAM,kBAAkB,CAAC,CAAC;CAC5F,QAAQ,OAAO;CACf,QAAQ,WAAW;CACnB,QAAQ,MAAM;CAEd,iBAAiB;EAChB,OAAO,IAAI,gBAAgB,GAAG;EAC9B,SAAS,KAAK,YAAY,OAAO;CAClC,GAAG,GAAG;CAEN,OAAO;AACR;;;;;;;;;;;;;;;;AC/EA,IAAa,SAAb,cAA4B,iBAAiB;CAC5C,cAAc;EAGb,MAAM,qBAAqB,GAAG,CAAC,GAAG,wBAAwB,cAAc,CAAC;CAC1E;;;;;;;;;;;;;;;;CAiBA,cAAc,OAAe,UAA8B,CAAC,GAAS;EACpE,KAAK,aAAa,eAAe,CAAC,CAAC,OAAO,OAAO;CAClD;AACD;;;;;;;;;;;;;;AAeA,SAAgB,mBACf,MACe;CACf,OAAO,oBAAoB,qBAAqB,GAAG,IAAI;AACxD;;AAKA,MAAa,SAAS"}
|