@silurus/ooxml 0.27.0 → 0.29.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 +22 -10
- package/dist/docx-BJ2QX1sj.js +1050 -0
- package/dist/docx-RfvFutZ6.cjs +1 -0
- package/dist/docx.cjs +1 -1
- package/dist/docx.mjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +3 -3
- package/dist/pptx-BoBbwUHR.js +23250 -0
- package/dist/pptx-DJgmrjy5.cjs +1 -0
- package/dist/pptx.cjs +1 -1
- package/dist/pptx.mjs +1 -1
- package/dist/preset-Be9mzXzm.js +1284 -0
- package/dist/preset-DxpCn57X.cjs +1 -0
- package/dist/types/docx.d.ts +86 -2
- package/dist/types/index.d.ts +219 -5
- package/dist/types/pptx.d.ts +112 -2
- package/dist/types/xlsx.d.ts +21 -1
- package/dist/xlsx-DFPurGhu.js +3107 -0
- package/dist/xlsx-DzHnBF0u.cjs +11 -0
- package/dist/xlsx.cjs +1 -1
- package/dist/xlsx.mjs +1 -1
- package/package.json +1 -1
- package/dist/docx-DVe_bky9.cjs +0 -1
- package/dist/docx-x2SoqFCP.js +0 -871
- package/dist/paint-C7gG2pjf.cjs +0 -1
- package/dist/paint-CIAXt08M.js +0 -98
- package/dist/pptx-DMP47DvZ.cjs +0 -1
- package/dist/pptx-Dr6cMPL2.js +0 -23837
- package/dist/xlsx-B6wdX3-M.cjs +0 -11
- package/dist/xlsx-R5CcrPHg.js +0 -2919
package/dist/types/pptx.d.ts
CHANGED
|
@@ -222,7 +222,15 @@ declare interface ChartSeriesDataLabels {
|
|
|
222
222
|
fontSizeHpt?: number;
|
|
223
223
|
}
|
|
224
224
|
|
|
225
|
-
export declare type Fill = SolidFill | NoFill | GradientFill;
|
|
225
|
+
export declare type Fill = SolidFill | NoFill | GradientFill | PatternFill;
|
|
226
|
+
|
|
227
|
+
/** ECMA-376 §20.1.8.17 (CT_GlowEffect) — coloured halo with blur radius. */
|
|
228
|
+
declare interface Glow {
|
|
229
|
+
color: string;
|
|
230
|
+
alpha: number;
|
|
231
|
+
/** Blur radius in EMU. */
|
|
232
|
+
radius: number;
|
|
233
|
+
}
|
|
226
234
|
|
|
227
235
|
declare interface GradientFill {
|
|
228
236
|
fillType: 'gradient';
|
|
@@ -341,6 +349,20 @@ declare type PathCmd = {
|
|
|
341
349
|
cmd: 'close';
|
|
342
350
|
};
|
|
343
351
|
|
|
352
|
+
/**
|
|
353
|
+
* Preset pattern fill — ECMA-376 §20.1.8.40 (CT_PatternFillProperties)
|
|
354
|
+
* with `preset` drawn from §20.1.10.59 (ST_PresetPatternVal).
|
|
355
|
+
*/
|
|
356
|
+
declare interface PatternFill {
|
|
357
|
+
fillType: 'pattern';
|
|
358
|
+
/** Foreground hex colour — used for the "1" pixels of the preset bitmap. */
|
|
359
|
+
fg: string;
|
|
360
|
+
/** Background hex colour — used for the "0" pixels. */
|
|
361
|
+
bg: string;
|
|
362
|
+
/** Preset name, e.g. "pct25", "horz", "diagCross", "lgGrid". */
|
|
363
|
+
preset: string;
|
|
364
|
+
}
|
|
365
|
+
|
|
344
366
|
export declare interface PictureElement {
|
|
345
367
|
type: 'picture';
|
|
346
368
|
x: number;
|
|
@@ -492,6 +514,10 @@ export declare interface Presentation {
|
|
|
492
514
|
majorFont: string | null;
|
|
493
515
|
/** Theme minor (body) font family name (e.g. "Aptos", "Nunito Sans"). Null if not set. */
|
|
494
516
|
minorFont: string | null;
|
|
517
|
+
/** Theme hyperlink colour (hex 6 chars). Used to colour hyperlink runs that have no explicit colour. */
|
|
518
|
+
hlinkColor?: string;
|
|
519
|
+
/** Theme followed-hyperlink colour. Reserved for future visited-link styling. */
|
|
520
|
+
folHlinkColor?: string;
|
|
495
521
|
}
|
|
496
522
|
|
|
497
523
|
declare interface PresentationHandle {
|
|
@@ -500,12 +526,36 @@ declare interface PresentationHandle {
|
|
|
500
526
|
dispose(): void;
|
|
501
527
|
}
|
|
502
528
|
|
|
529
|
+
/** ECMA-376 §20.1.8.27 (CT_ReflectionEffect) — mirrored copy below the
|
|
530
|
+
* shape with a linear alpha gradient. Carries the spec attributes whose
|
|
531
|
+
* defaults the renderer needs to interpret correctly. */
|
|
532
|
+
declare interface Reflection {
|
|
533
|
+
blur: number;
|
|
534
|
+
dist: number;
|
|
535
|
+
/** Direction in degrees, clockwise from East. */
|
|
536
|
+
dir: number;
|
|
537
|
+
/** Start alpha (0–1). Default 1.0. */
|
|
538
|
+
stA: number;
|
|
539
|
+
/** Start position along the gradient (0–1). Default 0. */
|
|
540
|
+
stPos: number;
|
|
541
|
+
/** End alpha. Default 0. */
|
|
542
|
+
endA: number;
|
|
543
|
+
/** End position. Default 1.0. */
|
|
544
|
+
endPos: number;
|
|
545
|
+
/** Horizontal scale (1.0 = same width). */
|
|
546
|
+
sx: number;
|
|
547
|
+
/** Vertical scale (-1.0 = full mirror). */
|
|
548
|
+
sy: number;
|
|
549
|
+
}
|
|
550
|
+
|
|
503
551
|
export declare interface RenderOptions {
|
|
504
552
|
width?: number;
|
|
505
553
|
defaultTextColor?: string | null;
|
|
506
554
|
dpr?: number;
|
|
507
555
|
majorFont?: string | null;
|
|
508
556
|
minorFont?: string | null;
|
|
557
|
+
/** Theme hyperlink colour (hex 6 chars). Used to colour hyperlink runs without an explicit colour. */
|
|
558
|
+
hlinkColor?: string | null;
|
|
509
559
|
/**
|
|
510
560
|
* Lazily resolve an archive-internal asset (by zip path) to a Blob. The
|
|
511
561
|
* renderer uses this to fetch posters and other large embedded assets on
|
|
@@ -589,6 +639,14 @@ export declare interface ShapeElement {
|
|
|
589
639
|
adj8: number | null;
|
|
590
640
|
/** Drop shadow from effectLst > outerShdw (null if not present). */
|
|
591
641
|
shadow: Shadow | null;
|
|
642
|
+
/** Inner (inset) shadow from effectLst > innerShdw. ECMA-376 §20.1.8.21. */
|
|
643
|
+
innerShadow?: Shadow;
|
|
644
|
+
/** Coloured glow halo from effectLst > glow. ECMA-376 §20.1.8.17. */
|
|
645
|
+
glow?: Glow;
|
|
646
|
+
/** Soft (feathered) edge — ECMA-376 §20.1.8.31. */
|
|
647
|
+
softEdge?: SoftEdge;
|
|
648
|
+
/** Mirrored reflection — ECMA-376 §20.1.8.27. */
|
|
649
|
+
reflection?: Reflection;
|
|
592
650
|
}
|
|
593
651
|
|
|
594
652
|
export declare interface Slide {
|
|
@@ -601,6 +659,11 @@ export declare interface Slide {
|
|
|
601
659
|
|
|
602
660
|
export declare type SlideElement = ShapeElement | PictureElement | TableElement | ChartElement | MediaElement;
|
|
603
661
|
|
|
662
|
+
/** ECMA-376 §20.1.8.31 (CT_SoftEdgesEffect) — feather radius in EMU. */
|
|
663
|
+
declare interface SoftEdge {
|
|
664
|
+
radius: number;
|
|
665
|
+
}
|
|
666
|
+
|
|
604
667
|
export declare interface SolidFill {
|
|
605
668
|
fillType: 'solid';
|
|
606
669
|
color: string;
|
|
@@ -624,6 +687,11 @@ export declare interface Stroke {
|
|
|
624
687
|
headEnd?: ArrowEnd;
|
|
625
688
|
/** Arrow head at the end of the line */
|
|
626
689
|
tailEnd?: ArrowEnd;
|
|
690
|
+
/**
|
|
691
|
+
* ECMA-376 §20.1.8.42 ST_CompoundLine. "sng" (default) | "dbl" |
|
|
692
|
+
* "thinThick" | "thickThin" | "tri". Absent means single line.
|
|
693
|
+
*/
|
|
694
|
+
cmpd?: string;
|
|
627
695
|
}
|
|
628
696
|
|
|
629
697
|
declare interface TableCell {
|
|
@@ -706,16 +774,58 @@ export declare interface TextRunData {
|
|
|
706
774
|
/** null = not set, inherit from paragraph/body defaults */
|
|
707
775
|
italic: boolean | null;
|
|
708
776
|
underline: boolean;
|
|
709
|
-
/**
|
|
777
|
+
/**
|
|
778
|
+
* Specific underline style when not the default single line. Values come
|
|
779
|
+
* from ECMA-376 §21.1.2.3.16 (ST_TextUnderlineType): "dbl", "heavy",
|
|
780
|
+
* "dotted", "dottedHeavy", "dash", "dashHeavy", "dashLong",
|
|
781
|
+
* "dashLongHeavy", "dotDash", "dotDashHeavy", "dotDotDash",
|
|
782
|
+
* "dotDotDashHeavy", "wavy", "wavyHeavy", "wavyDbl". Absent means either
|
|
783
|
+
* no underline (when `underline` is false) or the default single line.
|
|
784
|
+
*/
|
|
785
|
+
underlineStyle?: string;
|
|
786
|
+
/**
|
|
787
|
+
* Underline-only colour from rPr > uFill (ECMA-376 §21.1.2.3.20). Absent
|
|
788
|
+
* means the underline follows the text colour (uFillTx default).
|
|
789
|
+
*/
|
|
790
|
+
underlineColor?: string;
|
|
791
|
+
/** True when rPr strike is sngStrike or dblStrike. */
|
|
710
792
|
strikethrough: boolean;
|
|
793
|
+
/**
|
|
794
|
+
* True only when rPr strike = "dblStrike". Lets the renderer draw two parallel
|
|
795
|
+
* lines instead of one. ECMA-376 §21.1.2.3.10 (ST_TextStrikeType).
|
|
796
|
+
*/
|
|
797
|
+
strikeDouble?: boolean;
|
|
711
798
|
/** Font size in points */
|
|
712
799
|
fontSize: number | null;
|
|
713
800
|
color: string | null;
|
|
714
801
|
fontFamily: string | null;
|
|
802
|
+
/**
|
|
803
|
+
* East Asian font family from rPr > a:ea (ECMA-376 §21.1.2.3.7),
|
|
804
|
+
* resolved through the theme. Renderer uses this for CJK glyphs when
|
|
805
|
+
* present; absent means CJK falls back to fontFamily.
|
|
806
|
+
*/
|
|
807
|
+
fontFamilyEa?: string;
|
|
715
808
|
/** Baseline shift in thousandths of a point. Positive = superscript, negative = subscript. */
|
|
716
809
|
baseline?: number;
|
|
810
|
+
/**
|
|
811
|
+
* Capitalisation transform — ECMA-376 §21.1.2.3.13 (ST_TextCapsType).
|
|
812
|
+
* 'all' renders text in upper case; 'small' uses small caps (rendered as
|
|
813
|
+
* upper case at ~80% size when no smcp font feature is available).
|
|
814
|
+
* 'none' or omitted leaves the text unchanged.
|
|
815
|
+
*/
|
|
816
|
+
caps?: 'none' | 'small' | 'all';
|
|
817
|
+
/**
|
|
818
|
+
* Inter-character spacing in 100ths of a point — ECMA-376 §21.1.2.3.5
|
|
819
|
+
* (rPr @spc). Positive values add space, negative values tighten.
|
|
820
|
+
*/
|
|
821
|
+
letterSpacing?: number;
|
|
717
822
|
/** Set for OOXML field runs (e.g. "slidenum"). When set, renderer replaces text with field value. */
|
|
718
823
|
fieldType?: string;
|
|
824
|
+
/**
|
|
825
|
+
* Hyperlink target URL resolved from rPr > a:hlinkClick @r:id via the slide's _rels.
|
|
826
|
+
* Undefined for runs without a hyperlink. ECMA-376 §21.1.2.3.5 (CT_Hyperlink).
|
|
827
|
+
*/
|
|
828
|
+
hyperlink?: string;
|
|
719
829
|
}
|
|
720
830
|
|
|
721
831
|
/** Information about a rendered text segment for building a transparent selection overlay. */
|
package/dist/types/xlsx.d.ts
CHANGED
|
@@ -360,6 +360,10 @@ export declare interface Font {
|
|
|
360
360
|
size: number;
|
|
361
361
|
color: string | null;
|
|
362
362
|
name: string | null;
|
|
363
|
+
/** ECMA-376 §18.4.13 ST_UnderlineValues — see RunFont.underlineStyle. */
|
|
364
|
+
underlineStyle?: string;
|
|
365
|
+
/** ECMA-376 §18.4.6 ST_VerticalAlignRun on a cell-level <font>. */
|
|
366
|
+
vertAlign?: 'superscript' | 'subscript';
|
|
363
367
|
}
|
|
364
368
|
|
|
365
369
|
declare interface GradientFillSpec {
|
|
@@ -542,6 +546,17 @@ declare interface RunFont {
|
|
|
542
546
|
size?: number;
|
|
543
547
|
color?: string | null;
|
|
544
548
|
name?: string | null;
|
|
549
|
+
/**
|
|
550
|
+
* Underline style when not the default single line. ECMA-376 §18.4.13
|
|
551
|
+
* (`ST_UnderlineValues`): "double" | "singleAccounting" | "doubleAccounting".
|
|
552
|
+
* Absent means single (when `underline` is true) or no underline.
|
|
553
|
+
*/
|
|
554
|
+
underlineStyle?: string;
|
|
555
|
+
/**
|
|
556
|
+
* ECMA-376 §18.4.6 (`ST_VerticalAlignRun`): "superscript" | "subscript".
|
|
557
|
+
* Absent leaves the run on the baseline.
|
|
558
|
+
*/
|
|
559
|
+
vertAlign?: 'superscript' | 'subscript';
|
|
545
560
|
}
|
|
546
561
|
|
|
547
562
|
declare type SelectionMode_2 = 'cells' | 'rows' | 'cols' | 'all';
|
|
@@ -898,7 +913,12 @@ export declare class XlsxViewer {
|
|
|
898
913
|
showSheet(index: number): Promise<void>;
|
|
899
914
|
/** Returns the cell at canvas-client coordinates, or null if outside the cell grid. */
|
|
900
915
|
getCellAt(clientX: number, clientY: number): CellAddress | null;
|
|
901
|
-
/** Returns the CSS-pixel rect of a cell within canvasArea, or null if not
|
|
916
|
+
/** Returns the CSS-pixel rect of a cell within canvasArea, or null if not
|
|
917
|
+
* computable. Mirrors the renderer's per-cell rounding (Math.round(px * cs))
|
|
918
|
+
* so the selection overlay sits exactly on the canvas's drawn cell borders;
|
|
919
|
+
* multiplying logical accumulators by `cs` once at the end (the previous
|
|
920
|
+
* approach) drifted by up to 1 px per cell at non-integer scales.
|
|
921
|
+
*/
|
|
902
922
|
private getCellRect;
|
|
903
923
|
/** Returns the current selection, including mode. */
|
|
904
924
|
get selection(): CellRange | null;
|