docx-plus 0.0.5 → 0.0.7

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/index.umd.js CHANGED
@@ -2289,6 +2289,57 @@
2289
2289
  }
2290
2290
  };
2291
2291
  //#endregion
2292
+ //#region src/file/paragraph/run/east-asian-layout.ts
2293
+ /**
2294
+ * East Asian layout module for WordprocessingML run properties.
2295
+ *
2296
+ * Specifies East Asian typography settings for a run, including
2297
+ * character combination, vertical text, and compression.
2298
+ *
2299
+ * Reference: ISO/IEC 29500-4, CT_EastAsianLayout
2300
+ *
2301
+ * @module
2302
+ */
2303
+ /**
2304
+ * Creates an East Asian layout element (w:eastAsianLayout) for a run.
2305
+ *
2306
+ * ## XSD Schema
2307
+ * ```xml
2308
+ * <xsd:complexType name="CT_EastAsianLayout">
2309
+ * <xsd:attribute name="id" type="ST_DecimalNumber" use="optional"/>
2310
+ * <xsd:attribute name="combine" type="s:ST_OnOff" use="optional"/>
2311
+ * <xsd:attribute name="combineBrackets" type="ST_CombineBrackets" use="optional"/>
2312
+ * <xsd:attribute name="vert" type="s:ST_OnOff" use="optional"/>
2313
+ * <xsd:attribute name="vertCompress" type="s:ST_OnOff" use="optional"/>
2314
+ * </xsd:complexType>
2315
+ * ```
2316
+ */
2317
+ const createEastAsianLayout = ({ id, combine, combineBrackets, vert, vertCompress }) => new BuilderElement({
2318
+ attributes: {
2319
+ combine: {
2320
+ key: "w:combine",
2321
+ value: combine
2322
+ },
2323
+ combineBrackets: {
2324
+ key: "w:combineBrackets",
2325
+ value: combineBrackets
2326
+ },
2327
+ id: {
2328
+ key: "w:id",
2329
+ value: id === void 0 ? void 0 : decimalNumber(id)
2330
+ },
2331
+ vert: {
2332
+ key: "w:vert",
2333
+ value: vert
2334
+ },
2335
+ vertCompress: {
2336
+ key: "w:vertCompress",
2337
+ value: vertCompress
2338
+ }
2339
+ },
2340
+ name: "w:eastAsianLayout"
2341
+ });
2342
+ //#endregion
2292
2343
  //#region src/file/paragraph/run/emphasis-mark.ts
2293
2344
  /**
2294
2345
  * Emphasis mark module for WordprocessingML run properties.
@@ -3020,6 +3071,7 @@
3020
3071
  if (options.math) this.push(new OnOffElement("w:oMath", options.math));
3021
3072
  if (options.fitText !== void 0) this.push(new NumberValueElement("w:fitText", options.fitText));
3022
3073
  if (options.complexScript !== void 0) this.push(new OnOffElement("w:cs", options.complexScript));
3074
+ if (options.eastAsianLayout) this.push(createEastAsianLayout(options.eastAsianLayout));
3023
3075
  if (options.revision) this.push(new RunPropertiesChange(options.revision));
3024
3076
  }
3025
3077
  push(item) {
@@ -3714,379 +3766,1590 @@
3714
3766
  name: "wp:positionV"
3715
3767
  });
3716
3768
  //#endregion
3717
- //#region src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/form/extents/extents-attributes.ts
3769
+ //#region src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/outline/color-transform.ts
3718
3770
  /**
3719
- * Extents attributes for DrawingML shapes.
3771
+ * Color transform elements for DrawingML colors.
3720
3772
  *
3721
- * This module defines the width and height attributes for shape extents.
3773
+ * This module provides color transformation elements defined in EG_ColorTransform,
3774
+ * which can be applied as child elements to any color type (srgbClr, schemeClr, etc.).
3775
+ *
3776
+ * Reference: ISO/IEC 29500-4, dml-main.xsd, EG_ColorTransform
3722
3777
  *
3723
3778
  * @module
3724
3779
  */
3725
3780
  /**
3726
- * Attributes for shape extents (size).
3781
+ * Creates color transform child elements.
3782
+ *
3783
+ * These elements modify the parent color according to OOXML color transform rules.
3784
+ * Multiple transforms can be applied in sequence.
3785
+ *
3786
+ * @example
3787
+ * ```typescript
3788
+ * // Lighten accent1 by 40%
3789
+ * createColorTransforms({ tint: 40000 });
3790
+ * // Semi-transparent red with 50% alpha
3791
+ * createColorTransforms({ alpha: 50000 });
3792
+ * ```
3793
+ */
3794
+ const createColorTransforms = (options) => {
3795
+ const transforms = [];
3796
+ if (options.tint !== void 0) transforms.push(new BuilderElement({
3797
+ attributes: { val: {
3798
+ key: "val",
3799
+ value: options.tint
3800
+ } },
3801
+ name: "a:tint"
3802
+ }));
3803
+ if (options.shade !== void 0) transforms.push(new BuilderElement({
3804
+ attributes: { val: {
3805
+ key: "val",
3806
+ value: options.shade
3807
+ } },
3808
+ name: "a:shade"
3809
+ }));
3810
+ if (options.comp) transforms.push(new BuilderElement({ name: "a:comp" }));
3811
+ if (options.inv) transforms.push(new BuilderElement({ name: "a:inv" }));
3812
+ if (options.gray) transforms.push(new BuilderElement({ name: "a:gray" }));
3813
+ if (options.alpha !== void 0) transforms.push(new BuilderElement({
3814
+ attributes: { val: {
3815
+ key: "val",
3816
+ value: options.alpha
3817
+ } },
3818
+ name: "a:alpha"
3819
+ }));
3820
+ if (options.alphaOff !== void 0) transforms.push(new BuilderElement({
3821
+ attributes: { val: {
3822
+ key: "val",
3823
+ value: options.alphaOff
3824
+ } },
3825
+ name: "a:alphaOff"
3826
+ }));
3827
+ if (options.alphaMod !== void 0) transforms.push(new BuilderElement({
3828
+ attributes: { val: {
3829
+ key: "val",
3830
+ value: options.alphaMod
3831
+ } },
3832
+ name: "a:alphaMod"
3833
+ }));
3834
+ if (options.hue !== void 0) transforms.push(new BuilderElement({
3835
+ attributes: { val: {
3836
+ key: "val",
3837
+ value: options.hue
3838
+ } },
3839
+ name: "a:hue"
3840
+ }));
3841
+ if (options.hueOff !== void 0) transforms.push(new BuilderElement({
3842
+ attributes: { val: {
3843
+ key: "val",
3844
+ value: options.hueOff
3845
+ } },
3846
+ name: "a:hueOff"
3847
+ }));
3848
+ if (options.hueMod !== void 0) transforms.push(new BuilderElement({
3849
+ attributes: { val: {
3850
+ key: "val",
3851
+ value: options.hueMod
3852
+ } },
3853
+ name: "a:hueMod"
3854
+ }));
3855
+ if (options.sat !== void 0) transforms.push(new BuilderElement({
3856
+ attributes: { val: {
3857
+ key: "val",
3858
+ value: options.sat
3859
+ } },
3860
+ name: "a:sat"
3861
+ }));
3862
+ if (options.satOff !== void 0) transforms.push(new BuilderElement({
3863
+ attributes: { val: {
3864
+ key: "val",
3865
+ value: options.satOff
3866
+ } },
3867
+ name: "a:satOff"
3868
+ }));
3869
+ if (options.satMod !== void 0) transforms.push(new BuilderElement({
3870
+ attributes: { val: {
3871
+ key: "val",
3872
+ value: options.satMod
3873
+ } },
3874
+ name: "a:satMod"
3875
+ }));
3876
+ if (options.lum !== void 0) transforms.push(new BuilderElement({
3877
+ attributes: { val: {
3878
+ key: "val",
3879
+ value: options.lum
3880
+ } },
3881
+ name: "a:lum"
3882
+ }));
3883
+ if (options.lumOff !== void 0) transforms.push(new BuilderElement({
3884
+ attributes: { val: {
3885
+ key: "val",
3886
+ value: options.lumOff
3887
+ } },
3888
+ name: "a:lumOff"
3889
+ }));
3890
+ if (options.lumMod !== void 0) transforms.push(new BuilderElement({
3891
+ attributes: { val: {
3892
+ key: "val",
3893
+ value: options.lumMod
3894
+ } },
3895
+ name: "a:lumMod"
3896
+ }));
3897
+ if (options.red !== void 0) transforms.push(new BuilderElement({
3898
+ attributes: { val: {
3899
+ key: "val",
3900
+ value: options.red
3901
+ } },
3902
+ name: "a:red"
3903
+ }));
3904
+ if (options.redOff !== void 0) transforms.push(new BuilderElement({
3905
+ attributes: { val: {
3906
+ key: "val",
3907
+ value: options.redOff
3908
+ } },
3909
+ name: "a:redOff"
3910
+ }));
3911
+ if (options.redMod !== void 0) transforms.push(new BuilderElement({
3912
+ attributes: { val: {
3913
+ key: "val",
3914
+ value: options.redMod
3915
+ } },
3916
+ name: "a:redMod"
3917
+ }));
3918
+ if (options.green !== void 0) transforms.push(new BuilderElement({
3919
+ attributes: { val: {
3920
+ key: "val",
3921
+ value: options.green
3922
+ } },
3923
+ name: "a:green"
3924
+ }));
3925
+ if (options.greenOff !== void 0) transforms.push(new BuilderElement({
3926
+ attributes: { val: {
3927
+ key: "val",
3928
+ value: options.greenOff
3929
+ } },
3930
+ name: "a:greenOff"
3931
+ }));
3932
+ if (options.greenMod !== void 0) transforms.push(new BuilderElement({
3933
+ attributes: { val: {
3934
+ key: "val",
3935
+ value: options.greenMod
3936
+ } },
3937
+ name: "a:greenMod"
3938
+ }));
3939
+ if (options.blue !== void 0) transforms.push(new BuilderElement({
3940
+ attributes: { val: {
3941
+ key: "val",
3942
+ value: options.blue
3943
+ } },
3944
+ name: "a:blue"
3945
+ }));
3946
+ if (options.blueOff !== void 0) transforms.push(new BuilderElement({
3947
+ attributes: { val: {
3948
+ key: "val",
3949
+ value: options.blueOff
3950
+ } },
3951
+ name: "a:blueOff"
3952
+ }));
3953
+ if (options.blueMod !== void 0) transforms.push(new BuilderElement({
3954
+ attributes: { val: {
3955
+ key: "val",
3956
+ value: options.blueMod
3957
+ } },
3958
+ name: "a:blueMod"
3959
+ }));
3960
+ if (options.gamma) transforms.push(new BuilderElement({ name: "a:gamma" }));
3961
+ if (options.invGamma) transforms.push(new BuilderElement({ name: "a:invGamma" }));
3962
+ return transforms;
3963
+ };
3964
+ //#endregion
3965
+ //#region src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/outline/hsl-color.ts
3966
+ /**
3967
+ * HSL color element for DrawingML.
3968
+ *
3969
+ * This module provides HSL (Hue, Saturation, Luminance) color support.
3970
+ *
3971
+ * Reference: ISO/IEC 29500-4, dml-main.xsd, CT_HslColor
3727
3972
  *
3728
- * Defines the width (cx) and height (cy) in EMUs.
3973
+ * @module
3974
+ */
3975
+ /**
3976
+ * Creates an HSL color element.
3977
+ *
3978
+ * Specifies a color using Hue, Saturation, and Luminance values.
3729
3979
  *
3730
3980
  * ## XSD Schema
3731
3981
  * ```xml
3732
- * <xsd:attribute name="cx" type="ST_PositiveCoordinate" use="required"/>
3733
- * <xsd:attribute name="cy" type="ST_PositiveCoordinate" use="required"/>
3982
+ * <xsd:complexType name="CT_HslColor">
3983
+ * <xsd:sequence>
3984
+ * <xsd:group ref="EG_ColorTransform" minOccurs="0" maxOccurs="unbounded"/>
3985
+ * </xsd:sequence>
3986
+ * <xsd:attribute name="hue" type="ST_PositiveFixedAngle" use="required"/>
3987
+ * <xsd:attribute name="sat" type="ST_Percentage" use="required"/>
3988
+ * <xsd:attribute name="lum" type="ST_Percentage" use="required"/>
3989
+ * </xsd:complexType>
3734
3990
  * ```
3735
- *
3736
- * @internal
3737
3991
  */
3738
- var ExtentsAttributes = class extends XmlAttributeComponent {
3739
- constructor(..._args) {
3740
- super(..._args);
3741
- _defineProperty(this, "xmlKeys", {
3742
- cx: "cx",
3743
- cy: "cy"
3744
- });
3745
- }
3992
+ const createHslColor = (options) => {
3993
+ const transforms = options.transforms ? createColorTransforms(options.transforms) : [];
3994
+ return new BuilderElement({
3995
+ attributes: {
3996
+ hue: {
3997
+ key: "hue",
3998
+ value: options.hue
3999
+ },
4000
+ lum: {
4001
+ key: "lum",
4002
+ value: options.lum
4003
+ },
4004
+ sat: {
4005
+ key: "sat",
4006
+ value: options.sat
4007
+ }
4008
+ },
4009
+ children: [...transforms],
4010
+ name: "a:hslClr"
4011
+ });
3746
4012
  };
3747
4013
  //#endregion
3748
- //#region src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/form/extents/extents.ts
4014
+ //#region src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/outline/preset-color.ts
3749
4015
  /**
3750
- * Extents (size) element for DrawingML shapes.
4016
+ * Preset color element for DrawingML.
3751
4017
  *
3752
- * This module defines the size of a shape or picture in EMUs.
4018
+ * This module provides named preset colors (CSS named colors).
3753
4019
  *
3754
- * Reference: http://officeopenxml.com/drwSp-size.php
4020
+ * Reference: ISO/IEC 29500-4, dml-main.xsd, CT_PresetColor / ST_PresetColorVal
3755
4021
  *
3756
4022
  * @module
3757
4023
  */
3758
4024
  /**
3759
- * Represents the extents (size) of a DrawingML shape.
3760
- *
3761
- * Defines the width and height of the shape in English Metric Units (EMUs).
3762
- * One EMU equals 1/914,400 of an inch.
3763
- *
3764
- * Reference: http://officeopenxml.com/drwSp-size.php
4025
+ * Preset color values (CSS named colors).
3765
4026
  *
3766
4027
  * ## XSD Schema
3767
4028
  * ```xml
3768
- * <xsd:complexType name="CT_PositiveSize2D">
3769
- * <xsd:attribute name="cx" type="ST_PositiveCoordinate" use="required"/>
3770
- * <xsd:attribute name="cy" type="ST_PositiveCoordinate" use="required"/>
3771
- * </xsd:complexType>
3772
- * ```
3773
- *
3774
- * @example
3775
- * ```typescript
3776
- * // Create a 1-inch by 1-inch shape
3777
- * const extents = new Extents(914400, 914400);
4029
+ * <xsd:simpleType name="ST_PresetColorVal">
4030
+ * <xsd:restriction base="xsd:token">
4031
+ * <xsd:enumeration value="aliceBlue"/>
4032
+ * ...
4033
+ * <xsd:enumeration value="yellowGreen"/>
4034
+ * </xsd:restriction>
4035
+ * </xsd:simpleType>
3778
4036
  * ```
3779
4037
  */
3780
- var Extents = class extends XmlComponent {
3781
- constructor(x, y) {
3782
- super("a:ext");
3783
- _defineProperty(this, "attributes", void 0);
3784
- this.attributes = new ExtentsAttributes({
3785
- cx: x,
3786
- cy: y
3787
- });
3788
- this.root.push(this.attributes);
3789
- }
4038
+ const PresetColor = {
4039
+ ALICE_BLUE: "aliceBlue",
4040
+ ANTIQUE_WHITE: "antiqueWhite",
4041
+ AQUA: "aqua",
4042
+ AQUAMARINE: "aquamarine",
4043
+ AZURE: "azure",
4044
+ BEIGE: "beige",
4045
+ BISQUE: "bisque",
4046
+ BLACK: "black",
4047
+ BLANCHED_ALMOND: "blanchedAlmond",
4048
+ BLUE: "blue",
4049
+ BLUE_VIOLET: "blueViolet",
4050
+ BROWN: "brown",
4051
+ BURLY_WOOD: "burlyWood",
4052
+ CADET_BLUE: "cadetBlue",
4053
+ CHARTREUSE: "chartreuse",
4054
+ CHOCOLATE: "chocolate",
4055
+ CORAL: "coral",
4056
+ CORNFLOWER_BLUE: "cornflowerBlue",
4057
+ CORNSILK: "cornsilk",
4058
+ CRIMSON: "crimson",
4059
+ CYAN: "cyan",
4060
+ DARK_BLUE: "darkBlue",
4061
+ DARK_CYAN: "darkCyan",
4062
+ DARK_GOLDENROD: "darkGoldenrod",
4063
+ DARK_GRAY: "darkGray",
4064
+ DARK_GREY: "darkGrey",
4065
+ DARK_GREEN: "darkGreen",
4066
+ DARK_KHAKI: "darkKhaki",
4067
+ DARK_MAGENTA: "darkMagenta",
4068
+ DARK_OLIVE_GREEN: "darkOliveGreen",
4069
+ DARK_ORANGE: "darkOrange",
4070
+ DARK_ORCHID: "darkOrchid",
4071
+ DARK_RED: "darkRed",
4072
+ DARK_SALMON: "darkSalmon",
4073
+ DARK_SEA_GREEN: "darkSeaGreen",
4074
+ DARK_SLATE_BLUE: "darkSlateBlue",
4075
+ DARK_SLATE_GRAY: "darkSlateGray",
4076
+ DARK_SLATE_GREY: "darkSlateGrey",
4077
+ DARK_TURQUOISE: "darkTurquoise",
4078
+ DARK_VIOLET: "darkViolet",
4079
+ DEEP_PINK: "deepPink",
4080
+ DEEP_SKY_BLUE: "deepSkyBlue",
4081
+ DIM_GRAY: "dimGray",
4082
+ DIM_GREY: "dimGrey",
4083
+ DODGER_BLUE: "dodgerBlue",
4084
+ FIREBRICK: "firebrick",
4085
+ FLORAL_WHITE: "floralWhite",
4086
+ FOREST_GREEN: "forestGreen",
4087
+ FUCHSIA: "fuchsia",
4088
+ GAINSBORO: "gainsboro",
4089
+ GHOST_WHITE: "ghostWhite",
4090
+ GOLD: "gold",
4091
+ GOLDENROD: "goldenrod",
4092
+ GRAY: "gray",
4093
+ GREY: "grey",
4094
+ GREEN: "green",
4095
+ GREEN_YELLOW: "greenYellow",
4096
+ HONEYDEW: "honeydew",
4097
+ HOT_PINK: "hotPink",
4098
+ INDIAN_RED: "indianRed",
4099
+ INDIGO: "indigo",
4100
+ IVORY: "ivory",
4101
+ KHAKI: "khaki",
4102
+ LAVENDER: "lavender",
4103
+ LAVENDER_BLUSH: "lavenderBlush",
4104
+ LAWN_GREEN: "lawnGreen",
4105
+ LEMON_CHIFFON: "lemonChiffon",
4106
+ LIGHT_BLUE: "lightBlue",
4107
+ LIGHT_CORAL: "lightCoral",
4108
+ LIGHT_CYAN: "lightCyan",
4109
+ LIGHT_GOLDENROD_YELLOW: "lightGoldenrodYellow",
4110
+ LIGHT_GRAY: "lightGray",
4111
+ LIGHT_GREY: "lightGrey",
4112
+ LIGHT_GREEN: "lightGreen",
4113
+ LIGHT_PINK: "lightPink",
4114
+ LIGHT_SALMON: "lightSalmon",
4115
+ LIGHT_SEA_GREEN: "lightSeaGreen",
4116
+ LIGHT_SKY_BLUE: "lightSkyBlue",
4117
+ LIGHT_SLATE_GRAY: "lightSlateGray",
4118
+ LIGHT_SLATE_GREY: "lightSlateGrey",
4119
+ LIGHT_STEEL_BLUE: "lightSteelBlue",
4120
+ LIGHT_YELLOW: "lightYellow",
4121
+ LIME: "lime",
4122
+ LIME_GREEN: "limeGreen",
4123
+ LINEN: "linen",
4124
+ MAGENTA: "magenta",
4125
+ MAROON: "maroon",
4126
+ MEDIUM_AQUAMARINE: "mediumAquamarine",
4127
+ MEDIUM_BLUE: "mediumBlue",
4128
+ MEDIUM_ORCHID: "mediumOrchid",
4129
+ MEDIUM_PURPLE: "mediumPurple",
4130
+ MEDIUM_SEA_GREEN: "mediumSeaGreen",
4131
+ MEDIUM_SLATE_BLUE: "mediumSlateBlue",
4132
+ MEDIUM_SPRING_GREEN: "mediumSpringGreen",
4133
+ MEDIUM_TURQUOISE: "mediumTurquoise",
4134
+ MEDIUM_VIOLET_RED: "mediumVioletRed",
4135
+ MIDNIGHT_BLUE: "midnightBlue",
4136
+ MINT_CREAM: "mintCream",
4137
+ MISTY_ROSE: "mistyRose",
4138
+ MOCCASIN: "moccasin",
4139
+ NAVAJO_WHITE: "navajoWhite",
4140
+ NAVY: "navy",
4141
+ OLD_LACE: "oldLace",
4142
+ OLIVE: "olive",
4143
+ OLIVE_DRAB: "oliveDrab",
4144
+ ORANGE: "orange",
4145
+ ORANGE_RED: "orangeRed",
4146
+ ORCHID: "orchid",
4147
+ PALE_GOLDENROD: "paleGoldenrod",
4148
+ PALE_GREEN: "paleGreen",
4149
+ PALE_TURQUOISE: "paleTurquoise",
4150
+ PALE_VIOLET_RED: "paleVioletRed",
4151
+ PAPAYA_WHIP: "papayaWhip",
4152
+ PEACH_PUFF: "peachPuff",
4153
+ PERU: "peru",
4154
+ PINK: "pink",
4155
+ PLUM: "plum",
4156
+ POWDER_BLUE: "powderBlue",
4157
+ PURPLE: "purple",
4158
+ RED: "red",
4159
+ ROSY_BROWN: "rosyBrown",
4160
+ ROYAL_BLUE: "royalBlue",
4161
+ SADDLE_BROWN: "saddleBrown",
4162
+ SALMON: "salmon",
4163
+ SANDY_BROWN: "sandyBrown",
4164
+ SEA_GREEN: "seaGreen",
4165
+ SEA_SHELL: "seaShell",
4166
+ SIENNA: "sienna",
4167
+ SILVER: "silver",
4168
+ SKY_BLUE: "skyBlue",
4169
+ SLATE_BLUE: "slateBlue",
4170
+ SLATE_GRAY: "slateGray",
4171
+ SLATE_GREY: "slateGrey",
4172
+ SNOW: "snow",
4173
+ SPRING_GREEN: "springGreen",
4174
+ STEEL_BLUE: "steelBlue",
4175
+ TAN: "tan",
4176
+ TEAL: "teal",
4177
+ THISTLE: "thistle",
4178
+ TOMATO: "tomato",
4179
+ TURQUOISE: "turquoise",
4180
+ VIOLET: "violet",
4181
+ WHEAT: "wheat",
4182
+ WHITE: "white",
4183
+ WHITE_SMOKE: "whiteSmoke",
4184
+ YELLOW: "yellow",
4185
+ YELLOW_GREEN: "yellowGreen"
3790
4186
  };
3791
- //#endregion
3792
- //#region src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/form/offset/off-attributes.ts
3793
- /**
3794
- * Offset attributes for DrawingML shapes.
3795
- *
3796
- * This module defines the x and y coordinate attributes for shape offset.
3797
- *
3798
- * @module
3799
- */
3800
4187
  /**
3801
- * Attributes for shape offset (position).
4188
+ * Creates a preset color element.
3802
4189
  *
3803
- * Defines the x and y coordinates in EMUs.
4190
+ * Specifies a color using a named preset (CSS named color).
3804
4191
  *
3805
4192
  * ## XSD Schema
3806
4193
  * ```xml
3807
- * <xsd:attribute name="x" type="ST_Coordinate" use="required"/>
3808
- * <xsd:attribute name="y" type="ST_Coordinate" use="required"/>
4194
+ * <xsd:complexType name="CT_PresetColor">
4195
+ * <xsd:sequence>
4196
+ * <xsd:group ref="EG_ColorTransform" minOccurs="0" maxOccurs="unbounded"/>
4197
+ * </xsd:sequence>
4198
+ * <xsd:attribute name="val" type="ST_PresetColorVal" use="required"/>
4199
+ * </xsd:complexType>
3809
4200
  * ```
3810
- *
3811
- * @internal
3812
4201
  */
3813
- var OffsetAttributes = class extends XmlAttributeComponent {
3814
- constructor(..._args) {
3815
- super(..._args);
3816
- _defineProperty(this, "xmlKeys", {
3817
- x: "x",
3818
- y: "y"
3819
- });
3820
- }
4202
+ const createPresetColor = (options) => {
4203
+ const transforms = options.transforms ? createColorTransforms(options.transforms) : [];
4204
+ return new BuilderElement({
4205
+ attributes: { value: {
4206
+ key: "val",
4207
+ value: options.value
4208
+ } },
4209
+ children: [...transforms],
4210
+ name: "a:prstClr"
4211
+ });
3821
4212
  };
3822
4213
  //#endregion
3823
- //#region src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/form/offset/off.ts
4214
+ //#region src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/outline/rgb-color.ts
3824
4215
  /**
3825
- * Offset (position) element for DrawingML shapes.
4216
+ * RGB color element for DrawingML shapes.
3826
4217
  *
3827
- * This module defines the position of a shape or picture in EMUs.
4218
+ * This module provides RGB color support for solid fills.
3828
4219
  *
3829
- * Reference: http://officeopenxml.com/drwSp-size.php
4220
+ * Reference: ISO/IEC 29500-4, dml-main.xsd, CT_SRgbColor
3830
4221
  *
3831
4222
  * @module
3832
4223
  */
3833
4224
  /**
3834
- * Represents the offset (position) of a DrawingML shape.
3835
- *
3836
- * Defines the x and y coordinates of the shape's position in
3837
- * English Metric Units (EMUs). One EMU equals 1/914,400 of an inch.
4225
+ * Creates an sRGB color element.
3838
4226
  *
3839
- * Reference: http://officeopenxml.com/drwSp-size.php
4227
+ * Specifies a color using RGB hex values.
3840
4228
  *
3841
4229
  * ## XSD Schema
3842
4230
  * ```xml
3843
- * <xsd:complexType name="CT_Point2D">
3844
- * <xsd:attribute name="x" type="ST_Coordinate" use="required"/>
3845
- * <xsd:attribute name="y" type="ST_Coordinate" use="required"/>
4231
+ * <xsd:complexType name="CT_SRgbColor">
4232
+ * <xsd:sequence>
4233
+ * <xsd:group ref="EG_ColorTransform" minOccurs="0" maxOccurs="unbounded"/>
4234
+ * </xsd:sequence>
4235
+ * <xsd:attribute name="val" type="s:ST_HexColorRGB" use="required"/>
3846
4236
  * </xsd:complexType>
3847
4237
  * ```
3848
4238
  *
3849
4239
  * @example
3850
4240
  * ```typescript
3851
- * const offset = new Offset();
4241
+ * const redColor = createRgbColor({ value: "FF0000" });
4242
+ * // With alpha transform
4243
+ * const semiRed = createRgbColor({ value: "FF0000", transforms: { alpha: 50000 } });
3852
4244
  * ```
3853
4245
  */
3854
- var Offset = class extends XmlComponent {
3855
- constructor(x, y) {
3856
- super("a:off");
3857
- this.root.push(new OffsetAttributes({
3858
- x: x !== null && x !== void 0 ? x : 0,
3859
- y: y !== null && y !== void 0 ? y : 0
3860
- }));
3861
- }
4246
+ const createRgbColor = (options) => {
4247
+ const transforms = options.transforms ? createColorTransforms(options.transforms) : [];
4248
+ return new BuilderElement({
4249
+ attributes: { value: {
4250
+ key: "val",
4251
+ value: options.value
4252
+ } },
4253
+ children: [...transforms],
4254
+ name: "a:srgbClr"
4255
+ });
3862
4256
  };
3863
4257
  //#endregion
3864
- //#region src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/form/form.ts
4258
+ //#region src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/outline/scheme-color.ts
3865
4259
  /**
3866
- * Attributes for 2D transformation.
4260
+ * Scheme color element for DrawingML shapes.
3867
4261
  *
3868
- * Defines flip and rotation properties.
4262
+ * This module provides scheme-based color support for solid fills,
4263
+ * allowing colors to be defined using theme color schemes.
4264
+ *
4265
+ * Reference: ISO/IEC 29500-4, dml-main.xsd, CT_SchemeColor / ST_SchemeColorVal
4266
+ *
4267
+ * @module
3869
4268
  */
3870
- var FormAttributes = class extends XmlAttributeComponent {
3871
- constructor(..._args) {
3872
- super(..._args);
3873
- _defineProperty(this, "xmlKeys", {
3874
- flipHorizontal: "flipH",
3875
- flipVertical: "flipV",
3876
- rotation: "rot"
3877
- });
3878
- }
3879
- };
3880
4269
  /**
3881
- * Represents a 2D transformation for DrawingML objects.
4270
+ * Scheme color values for theme-based colors.
3882
4271
  *
3883
- * This element defines how a shape or picture is positioned, sized,
3884
- * rotated, and flipped within the document.
4272
+ * These values reference colors defined in the document's color scheme/theme.
4273
+ */
4274
+ const SchemeColor = {
4275
+ BG1: "bg1",
4276
+ TX1: "tx1",
4277
+ BG2: "bg2",
4278
+ TX2: "tx2",
4279
+ ACCENT1: "accent1",
4280
+ ACCENT2: "accent2",
4281
+ ACCENT3: "accent3",
4282
+ ACCENT4: "accent4",
4283
+ ACCENT5: "accent5",
4284
+ ACCENT6: "accent6",
4285
+ HLINK: "hlink",
4286
+ FOLHLINK: "folHlink",
4287
+ DK1: "dk1",
4288
+ LT1: "lt1",
4289
+ DK2: "dk2",
4290
+ LT2: "lt2",
4291
+ PHCLR: "phClr"
4292
+ };
4293
+ /**
4294
+ * Creates a scheme color element.
3885
4295
  *
3886
- * Reference: http://officeopenxml.com/drwSp-size.php
4296
+ * Specifies a color using a theme color scheme reference.
3887
4297
  *
3888
4298
  * ## XSD Schema
3889
4299
  * ```xml
3890
- * <xsd:complexType name="CT_Transform2D">
4300
+ * <xsd:complexType name="CT_SchemeColor">
3891
4301
  * <xsd:sequence>
3892
- * <xsd:element name="off" type="CT_Point2D" minOccurs="0"/>
3893
- * <xsd:element name="ext" type="CT_PositiveSize2D" minOccurs="0"/>
4302
+ * <xsd:group ref="EG_ColorTransform" minOccurs="0" maxOccurs="unbounded"/>
3894
4303
  * </xsd:sequence>
3895
- * <xsd:attribute name="rot" type="ST_Angle" use="optional"/>
3896
- * <xsd:attribute name="flipH" type="xsd:boolean" use="optional"/>
3897
- * <xsd:attribute name="flipV" type="xsd:boolean" use="optional"/>
4304
+ * <xsd:attribute name="val" type="ST_SchemeColorVal" use="required"/>
3898
4305
  * </xsd:complexType>
3899
4306
  * ```
3900
4307
  *
3901
4308
  * @example
3902
4309
  * ```typescript
3903
- * const form = new Form({
3904
- * emus: { x: 914400, y: 914400 },
3905
- * flip: { horizontal: true, vertical: false },
3906
- * rotation: 450000 // 7.5 degrees
4310
+ * const accentColor = createSchemeColor({ value: SchemeColor.ACCENT1 });
4311
+ * // With tint transform
4312
+ * const lightAccent = createSchemeColor({
4313
+ * value: SchemeColor.ACCENT1,
4314
+ * transforms: { tint: 40000 },
3907
4315
  * });
3908
4316
  * ```
3909
4317
  */
3910
- var Form = class extends XmlComponent {
3911
- constructor(options) {
3912
- var _options$flip, _options$flip2, _options$offset, _options$offset2;
3913
- super("a:xfrm");
3914
- _defineProperty(this, "extents", void 0);
3915
- _defineProperty(this, "offset", void 0);
3916
- this.root.push(new FormAttributes({
3917
- flipHorizontal: (_options$flip = options.flip) === null || _options$flip === void 0 ? void 0 : _options$flip.horizontal,
3918
- flipVertical: (_options$flip2 = options.flip) === null || _options$flip2 === void 0 ? void 0 : _options$flip2.vertical,
3919
- rotation: options.rotation
3920
- }));
3921
- this.offset = new Offset((_options$offset = options.offset) === null || _options$offset === void 0 || (_options$offset = _options$offset.emus) === null || _options$offset === void 0 ? void 0 : _options$offset.x, (_options$offset2 = options.offset) === null || _options$offset2 === void 0 || (_options$offset2 = _options$offset2.emus) === null || _options$offset2 === void 0 ? void 0 : _options$offset2.y);
3922
- this.extents = new Extents(options.emus.x, options.emus.y);
3923
- this.root.push(this.offset);
3924
- this.root.push(this.extents);
3925
- }
4318
+ const createSchemeColor = (options) => {
4319
+ const transforms = options.transforms ? createColorTransforms(options.transforms) : [];
4320
+ return new BuilderElement({
4321
+ attributes: { value: {
4322
+ key: "val",
4323
+ value: options.value
4324
+ } },
4325
+ children: [...transforms],
4326
+ name: "a:schemeClr"
4327
+ });
3926
4328
  };
3927
4329
  //#endregion
3928
- //#region src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/outline/no-fill.ts
4330
+ //#region src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/outline/system-color.ts
3929
4331
  /**
3930
- * No fill element for DrawingML shapes.
4332
+ * System color element for DrawingML.
3931
4333
  *
3932
- * This module provides the no-fill option for outline and shape fills.
4334
+ * This module provides system color support, referencing OS-level UI colors.
4335
+ *
4336
+ * Reference: ISO/IEC 29500-4, dml-main.xsd, CT_SystemColor / ST_SystemColorVal
3933
4337
  *
3934
4338
  * @module
3935
4339
  */
3936
4340
  /**
3937
- * Creates a no-fill element.
3938
- *
3939
- * Specifies that the outline or shape should have no fill applied.
4341
+ * System color values referencing OS UI colors.
3940
4342
  *
3941
4343
  * ## XSD Schema
3942
4344
  * ```xml
3943
- * <xsd:element name="noFill" type="CT_Empty"/>
4345
+ * <xsd:simpleType name="ST_SystemColorVal">
4346
+ * <xsd:restriction base="xsd:token">
4347
+ * <xsd:enumeration value="scrollBar"/>
4348
+ * <xsd:enumeration value="background"/>
4349
+ * ...
4350
+ * <xsd:enumeration value="menuBar"/>
4351
+ * </xsd:restriction>
4352
+ * </xsd:simpleType>
3944
4353
  * ```
4354
+ */
4355
+ const SystemColor = {
4356
+ SCROLL_BAR: "scrollBar",
4357
+ BACKGROUND: "background",
4358
+ ACTIVE_CAPTION: "activeCaption",
4359
+ INACTIVE_CAPTION: "inactiveCaption",
4360
+ MENU: "menu",
4361
+ WINDOW: "window",
4362
+ WINDOW_FRAME: "windowFrame",
4363
+ MENU_TEXT: "menuText",
4364
+ WINDOW_TEXT: "windowText",
4365
+ CAPTION_TEXT: "captionText",
4366
+ ACTIVE_BORDER: "activeBorder",
4367
+ INACTIVE_BORDER: "inactiveBorder",
4368
+ APP_WORKSPACE: "appWorkspace",
4369
+ HIGHLIGHT: "highlight",
4370
+ HIGHLIGHT_TEXT: "highlightText",
4371
+ BTN_FACE: "btnFace",
4372
+ BTN_SHADOW: "btnShadow",
4373
+ GRAY_TEXT: "grayText",
4374
+ BTN_TEXT: "btnText",
4375
+ INACTIVE_CAPTION_TEXT: "inactiveCaptionText",
4376
+ BTN_HIGHLIGHT: "btnHighlight",
4377
+ THREE_D_DK_SHADOW: "3dDkShadow",
4378
+ THREE_D_LIGHT: "3dLight",
4379
+ INFO_TEXT: "infoText",
4380
+ INFO_BK: "infoBk",
4381
+ HOT_LIGHT: "hotLight",
4382
+ GRADIENT_ACTIVE_CAPTION: "gradientActiveCaption",
4383
+ GRADIENT_INACTIVE_CAPTION: "gradientInactiveCaption",
4384
+ MENU_HIGHLIGHT: "menuHighlight",
4385
+ MENU_BAR: "menuBar"
4386
+ };
4387
+ /**
4388
+ * Creates a system color element.
4389
+ *
4390
+ * References a system-defined UI color (e.g., window background, button face).
3945
4391
  *
3946
- * @example
3947
- * ```typescript
3948
- * const noFill = createNoFill();
4392
+ * ## XSD Schema
4393
+ * ```xml
4394
+ * <xsd:complexType name="CT_SystemColor">
4395
+ * <xsd:sequence>
4396
+ * <xsd:group ref="EG_ColorTransform" minOccurs="0" maxOccurs="unbounded"/>
4397
+ * </xsd:sequence>
4398
+ * <xsd:attribute name="val" type="ST_SystemColorVal" use="required"/>
4399
+ * <xsd:attribute name="lastClr" type="s:ST_HexColorRGB" use="optional"/>
4400
+ * </xsd:complexType>
3949
4401
  * ```
3950
4402
  */
3951
- const createNoFill = () => new BuilderElement({ name: "a:noFill" });
4403
+ const createSystemColor = (options) => {
4404
+ const transforms = options.transforms ? createColorTransforms(options.transforms) : [];
4405
+ return new BuilderElement({
4406
+ attributes: {
4407
+ lastClr: {
4408
+ key: "lastClr",
4409
+ value: options.lastClr
4410
+ },
4411
+ value: {
4412
+ key: "val",
4413
+ value: options.value
4414
+ }
4415
+ },
4416
+ children: [...transforms],
4417
+ name: "a:sysClr"
4418
+ });
4419
+ };
3952
4420
  //#endregion
3953
- //#region src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/outline/rgb-color.ts
4421
+ //#region src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/outline/solid-fill.ts
3954
4422
  /**
3955
- * RGB color element for DrawingML shapes.
4423
+ * Solid fill element for DrawingML shapes.
3956
4424
  *
3957
- * This module provides RGB color support for solid fills.
4425
+ * This module provides solid fill support for outlines and shapes,
4426
+ * supporting RGB, scheme, HSL, system, and preset colors.
4427
+ *
4428
+ * Reference: ISO/IEC 29500-4, dml-main.xsd, CT_SolidColorFillProperties
3958
4429
  *
3959
4430
  * @module
3960
4431
  */
3961
4432
  /**
3962
- * Creates an sRGB color element.
4433
+ * Creates the color child element for a solid fill based on the color type.
4434
+ */
4435
+ const SYSTEM_COLOR_VALUES = new Set(Object.values(SystemColor));
4436
+ const PRESET_COLOR_VALUES = new Set(Object.values(PresetColor));
4437
+ const SCHEME_COLOR_VALUES = new Set(Object.values(SchemeColor));
4438
+ const createColorElement = (color) => {
4439
+ if ("hue" in color && "sat" in color && "lum" in color) return createHslColor(color);
4440
+ const colorValue = color.value;
4441
+ if (SYSTEM_COLOR_VALUES.has(colorValue)) return createSystemColor(color);
4442
+ if (PRESET_COLOR_VALUES.has(colorValue)) return createPresetColor(color);
4443
+ if (SCHEME_COLOR_VALUES.has(colorValue)) return createSchemeColor(color);
4444
+ return createRgbColor(color);
4445
+ };
4446
+ /**
4447
+ * Creates a solid fill element.
3963
4448
  *
3964
- * Specifies a color using RGB hex values.
4449
+ * Specifies a solid color fill using any supported color type.
3965
4450
  *
3966
4451
  * ## XSD Schema
3967
4452
  * ```xml
3968
- * <xsd:complexType name="CT_SRgbColor">
4453
+ * <xsd:complexType name="CT_SolidColorFillProperties">
3969
4454
  * <xsd:sequence>
3970
- * <xsd:group ref="EG_ColorTransform" minOccurs="0" maxOccurs="unbounded"/>
4455
+ * <xsd:group ref="EG_ColorChoice" minOccurs="0"/>
4456
+ * <xsd:group ref="EG_EffectProperties" minOccurs="0"/>
3971
4457
  * </xsd:sequence>
3972
- * <xsd:attribute name="val" type="s:ST_HexColorRGB" use="required"/>
3973
4458
  * </xsd:complexType>
3974
4459
  * ```
3975
4460
  *
3976
4461
  * @example
3977
4462
  * ```typescript
3978
- * const redColor = createSolidRgbColor({ value: "FF0000" });
3979
- * const blueColor = createSolidRgbColor({ value: "0000FF" });
4463
+ * // RGB solid fill
4464
+ * const fill = createSolidFill({ value: "FF0000" });
4465
+ * // Scheme solid fill with tint
4466
+ * const schemeFill = createSolidFill({
4467
+ * value: SchemeColor.ACCENT1, transforms: { tint: 40000 },
4468
+ * });
4469
+ * // HSL solid fill
4470
+ * const hslFill = createSolidFill({ hue: 120000, sat: 100000, lum: 50000 });
3980
4471
  * ```
3981
4472
  */
3982
- const createSolidRgbColor = (options) => new BuilderElement({
3983
- attributes: { value: {
3984
- key: "val",
3985
- value: options.value
4473
+ const createSolidFill = (options) => new BuilderElement({
4474
+ children: [createColorElement(options)],
4475
+ name: "a:solidFill"
4476
+ });
4477
+ //#endregion
4478
+ //#region src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/effects/glow.ts
4479
+ /**
4480
+ * Glow effect for DrawingML shapes.
4481
+ *
4482
+ * Reference: ISO/IEC 29500-4, dml-main.xsd, CT_GlowEffect
4483
+ *
4484
+ * @module
4485
+ */
4486
+ /**
4487
+ * Creates a glow effect element.
4488
+ *
4489
+ * ## XSD Schema
4490
+ * ```xml
4491
+ * <xsd:complexType name="CT_GlowEffect">
4492
+ * <xsd:sequence>
4493
+ * <xsd:group ref="EG_ColorChoice" minOccurs="1" maxOccurs="1"/>
4494
+ * </xsd:sequence>
4495
+ * <xsd:attribute name="rad" type="ST_PositiveCoordinate" use="optional" default="0"/>
4496
+ * </xsd:complexType>
4497
+ * ```
4498
+ */
4499
+ const createGlowEffect = (options) => {
4500
+ if (options.rad === void 0) return new BuilderElement({
4501
+ children: [createColorElement(options.color)],
4502
+ name: "a:glow"
4503
+ });
4504
+ return new BuilderElement({
4505
+ attributes: { rad: {
4506
+ key: "rad",
4507
+ value: options.rad
4508
+ } },
4509
+ children: [createColorElement(options.color)],
4510
+ name: "a:glow"
4511
+ });
4512
+ };
4513
+ //#endregion
4514
+ //#region src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/effects/inner-shdw.ts
4515
+ /**
4516
+ * Inner shadow effect for DrawingML shapes.
4517
+ *
4518
+ * Reference: ISO/IEC 29500-4, dml-main.xsd, CT_InnerShadowEffect
4519
+ *
4520
+ * @module
4521
+ */
4522
+ /**
4523
+ * Creates an inner shadow effect element.
4524
+ *
4525
+ * ## XSD Schema
4526
+ * ```xml
4527
+ * <xsd:complexType name="CT_InnerShadowEffect">
4528
+ * <xsd:sequence>
4529
+ * <xsd:group ref="EG_ColorChoice" minOccurs="1" maxOccurs="1"/>
4530
+ * </xsd:sequence>
4531
+ * <xsd:attribute name="blurRad" type="ST_PositiveCoordinate" default="0"/>
4532
+ * <xsd:attribute name="dist" type="ST_PositiveCoordinate" default="0"/>
4533
+ * <xsd:attribute name="dir" type="ST_PositiveFixedAngle" default="0"/>
4534
+ * </xsd:complexType>
4535
+ * ```
4536
+ */
4537
+ const createInnerShadowEffect = (options) => {
4538
+ if (!(options.blurRad !== void 0 || options.dist !== void 0 || options.dir !== void 0)) return new BuilderElement({
4539
+ children: [createColorElement(options.color)],
4540
+ name: "a:innerShdw"
4541
+ });
4542
+ return new BuilderElement({
4543
+ attributes: {
4544
+ ...options.blurRad !== void 0 && { blurRad: {
4545
+ key: "blurRad",
4546
+ value: options.blurRad
4547
+ } },
4548
+ ...options.dist !== void 0 && { dist: {
4549
+ key: "dist",
4550
+ value: options.dist
4551
+ } },
4552
+ ...options.dir !== void 0 && { dir: {
4553
+ key: "dir",
4554
+ value: options.dir
4555
+ } }
4556
+ },
4557
+ children: [createColorElement(options.color)],
4558
+ name: "a:innerShdw"
4559
+ });
4560
+ };
4561
+ //#endregion
4562
+ //#region src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/effects/outer-shdw.ts
4563
+ /**
4564
+ * Outer shadow effect for DrawingML shapes.
4565
+ *
4566
+ * Reference: ISO/IEC 29500-4, dml-main.xsd, CT_OuterShadowEffect
4567
+ *
4568
+ * @module
4569
+ */
4570
+ /**
4571
+ * Rectangle alignment for shadow positioning.
4572
+ */
4573
+ const RectAlignment = {
4574
+ TOP_LEFT: "tl",
4575
+ TOP: "t",
4576
+ TOP_RIGHT: "tr",
4577
+ LEFT: "l",
4578
+ CENTER: "ctr",
4579
+ RIGHT: "r",
4580
+ BOTTOM_LEFT: "bl",
4581
+ BOTTOM: "b",
4582
+ BOTTOM_RIGHT: "br"
4583
+ };
4584
+ /**
4585
+ * Creates an outer shadow effect element.
4586
+ *
4587
+ * ## XSD Schema
4588
+ * ```xml
4589
+ * <xsd:complexType name="CT_OuterShadowEffect">
4590
+ * <xsd:sequence>
4591
+ * <xsd:group ref="EG_ColorChoice" minOccurs="1" maxOccurs="1"/>
4592
+ * </xsd:sequence>
4593
+ * <xsd:attribute name="blurRad" type="ST_PositiveCoordinate" default="0"/>
4594
+ * <xsd:attribute name="dist" type="ST_PositiveCoordinate" default="0"/>
4595
+ * <xsd:attribute name="dir" type="ST_PositiveFixedAngle" default="0"/>
4596
+ * <xsd:attribute name="sx" type="ST_Percentage" default="100%"/>
4597
+ * <xsd:attribute name="sy" type="ST_Percentage" default="100%"/>
4598
+ * <xsd:attribute name="kx" type="ST_FixedAngle" default="0"/>
4599
+ * <xsd:attribute name="ky" type="ST_FixedAngle" default="0"/>
4600
+ * <xsd:attribute name="algn" type="ST_RectAlignment" default="b"/>
4601
+ * <xsd:attribute name="rotWithShape" type="xsd:boolean" default="true"/>
4602
+ * </xsd:complexType>
4603
+ * ```
4604
+ */
4605
+ const createOuterShadowEffect = (options) => {
4606
+ const attributes = {};
4607
+ if (options.blurRad !== void 0) attributes.blurRad = {
4608
+ key: "blurRad",
4609
+ value: options.blurRad
4610
+ };
4611
+ if (options.dist !== void 0) attributes.dist = {
4612
+ key: "dist",
4613
+ value: options.dist
4614
+ };
4615
+ if (options.dir !== void 0) attributes.dir = {
4616
+ key: "dir",
4617
+ value: options.dir
4618
+ };
4619
+ if (options.sx !== void 0) attributes.sx = {
4620
+ key: "sx",
4621
+ value: options.sx
4622
+ };
4623
+ if (options.sy !== void 0) attributes.sy = {
4624
+ key: "sy",
4625
+ value: options.sy
4626
+ };
4627
+ if (options.kx !== void 0) attributes.kx = {
4628
+ key: "kx",
4629
+ value: options.kx
4630
+ };
4631
+ if (options.ky !== void 0) attributes.ky = {
4632
+ key: "ky",
4633
+ value: options.ky
4634
+ };
4635
+ if (options.algn !== void 0) attributes.algn = {
4636
+ key: "algn",
4637
+ value: RectAlignment[options.algn]
4638
+ };
4639
+ if (options.rotWithShape === false) attributes.rotWithShape = {
4640
+ key: "rotWithShape",
4641
+ value: 0
4642
+ };
4643
+ return new BuilderElement({
4644
+ attributes,
4645
+ children: [createColorElement(options.color)],
4646
+ name: "a:outerShdw"
4647
+ });
4648
+ };
4649
+ //#endregion
4650
+ //#region src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/effects/prst-shdw.ts
4651
+ /**
4652
+ * Preset shadow effect for DrawingML shapes.
4653
+ *
4654
+ * Reference: ISO/IEC 29500-4, dml-main.xsd, CT_PresetShadowEffect
4655
+ *
4656
+ * @module
4657
+ */
4658
+ /**
4659
+ * Preset shadow types (20 variations).
4660
+ *
4661
+ * Reference: ISO/IEC 29500-4, dml-main.xsd, ST_PresetShadowVal
4662
+ */
4663
+ const PresetShadowVal = {
4664
+ SHDW1: "shdw1",
4665
+ SHDW2: "shdw2",
4666
+ SHDW3: "shdw3",
4667
+ SHDW4: "shdw4",
4668
+ SHDW5: "shdw5",
4669
+ SHDW6: "shdw6",
4670
+ SHDW7: "shdw7",
4671
+ SHDW8: "shdw8",
4672
+ SHDW9: "shdw9",
4673
+ SHDW10: "shdw10",
4674
+ SHDW11: "shdw11",
4675
+ SHDW12: "shdw12",
4676
+ SHDW13: "shdw13",
4677
+ SHDW14: "shdw14",
4678
+ SHDW15: "shdw15",
4679
+ SHDW16: "shdw16",
4680
+ SHDW17: "shdw17",
4681
+ SHDW18: "shdw18",
4682
+ SHDW19: "shdw19",
4683
+ SHDW20: "shdw20"
4684
+ };
4685
+ /**
4686
+ * Creates a preset shadow effect element.
4687
+ *
4688
+ * ## XSD Schema
4689
+ * ```xml
4690
+ * <xsd:complexType name="CT_PresetShadowEffect">
4691
+ * <xsd:sequence>
4692
+ * <xsd:group ref="EG_ColorChoice" minOccurs="1" maxOccurs="1"/>
4693
+ * </xsd:sequence>
4694
+ * <xsd:attribute name="prst" type="ST_PresetShadowVal" use="required"/>
4695
+ * <xsd:attribute name="dist" type="ST_PositiveCoordinate" default="0"/>
4696
+ * <xsd:attribute name="dir" type="ST_PositiveFixedAngle" default="0"/>
4697
+ * </xsd:complexType>
4698
+ * ```
4699
+ */
4700
+ const createPresetShadowEffect = (options) => {
4701
+ const attributes = { prst: {
4702
+ key: "prst",
4703
+ value: PresetShadowVal[options.prst]
4704
+ } };
4705
+ if (options.dist !== void 0) attributes.dist = {
4706
+ key: "dist",
4707
+ value: options.dist
4708
+ };
4709
+ if (options.dir !== void 0) attributes.dir = {
4710
+ key: "dir",
4711
+ value: options.dir
4712
+ };
4713
+ return new BuilderElement({
4714
+ attributes,
4715
+ children: [createColorElement(options.color)],
4716
+ name: "a:prstShdw"
4717
+ });
4718
+ };
4719
+ //#endregion
4720
+ //#region src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/effects/reflection.ts
4721
+ /**
4722
+ * Reflection effect for DrawingML shapes.
4723
+ *
4724
+ * Reference: ISO/IEC 29500-4, dml-main.xsd, CT_ReflectionEffect
4725
+ *
4726
+ * @module
4727
+ */
4728
+ /**
4729
+ * Creates a reflection effect element.
4730
+ *
4731
+ * ## XSD Schema
4732
+ * ```xml
4733
+ * <xsd:complexType name="CT_ReflectionEffect">
4734
+ * <xsd:attribute name="blurRad" type="ST_PositiveCoordinate" default="0"/>
4735
+ * <xsd:attribute name="stA" type="ST_PositiveFixedPercentage" default="100%"/>
4736
+ * <xsd:attribute name="stPos" type="ST_PositiveFixedPercentage" default="0%"/>
4737
+ * <xsd:attribute name="endA" type="ST_PositiveFixedPercentage" default="0%"/>
4738
+ * <xsd:attribute name="endPos" type="ST_PositiveFixedPercentage" default="100%"/>
4739
+ * <xsd:attribute name="dist" type="ST_PositiveCoordinate" default="0"/>
4740
+ * <xsd:attribute name="dir" type="ST_PositiveFixedAngle" default="0"/>
4741
+ * <xsd:attribute name="fadeDir" type="ST_PositiveFixedAngle" default="5400000"/>
4742
+ * <xsd:attribute name="sx" type="ST_Percentage" default="100%"/>
4743
+ * <xsd:attribute name="sy" type="ST_Percentage" default="100%"/>
4744
+ * <xsd:attribute name="kx" type="ST_FixedAngle" default="0"/>
4745
+ * <xsd:attribute name="ky" type="ST_FixedAngle" default="0"/>
4746
+ * <xsd:attribute name="algn" type="ST_RectAlignment" default="b"/>
4747
+ * <xsd:attribute name="rotWithShape" type="xsd:boolean" default="true"/>
4748
+ * </xsd:complexType>
4749
+ * ```
4750
+ */
4751
+ const createReflectionEffect = (options) => {
4752
+ if (!options) return new BuilderElement({ name: "a:reflection" });
4753
+ const attributes = {};
4754
+ if (options.blurRad !== void 0) attributes.blurRad = {
4755
+ key: "blurRad",
4756
+ value: options.blurRad
4757
+ };
4758
+ if (options.stA !== void 0) attributes.stA = {
4759
+ key: "stA",
4760
+ value: options.stA
4761
+ };
4762
+ if (options.stPos !== void 0) attributes.stPos = {
4763
+ key: "stPos",
4764
+ value: options.stPos
4765
+ };
4766
+ if (options.endA !== void 0) attributes.endA = {
4767
+ key: "endA",
4768
+ value: options.endA
4769
+ };
4770
+ if (options.endPos !== void 0) attributes.endPos = {
4771
+ key: "endPos",
4772
+ value: options.endPos
4773
+ };
4774
+ if (options.dist !== void 0) attributes.dist = {
4775
+ key: "dist",
4776
+ value: options.dist
4777
+ };
4778
+ if (options.dir !== void 0) attributes.dir = {
4779
+ key: "dir",
4780
+ value: options.dir
4781
+ };
4782
+ if (options.fadeDir !== void 0) attributes.fadeDir = {
4783
+ key: "fadeDir",
4784
+ value: options.fadeDir
4785
+ };
4786
+ if (options.sx !== void 0) attributes.sx = {
4787
+ key: "sx",
4788
+ value: options.sx
4789
+ };
4790
+ if (options.sy !== void 0) attributes.sy = {
4791
+ key: "sy",
4792
+ value: options.sy
4793
+ };
4794
+ if (options.kx !== void 0) attributes.kx = {
4795
+ key: "kx",
4796
+ value: options.kx
4797
+ };
4798
+ if (options.ky !== void 0) attributes.ky = {
4799
+ key: "ky",
4800
+ value: options.ky
4801
+ };
4802
+ if (options.algn !== void 0) attributes.algn = {
4803
+ key: "algn",
4804
+ value: options.algn
4805
+ };
4806
+ if (options.rotWithShape === false) attributes.rotWithShape = {
4807
+ key: "rotWithShape",
4808
+ value: 0
4809
+ };
4810
+ return new BuilderElement({
4811
+ attributes,
4812
+ name: "a:reflection"
4813
+ });
4814
+ };
4815
+ //#endregion
4816
+ //#region src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/effects/soft-edge.ts
4817
+ /**
4818
+ * Soft edge effect for DrawingML shapes.
4819
+ *
4820
+ * Reference: ISO/IEC 29500-4, dml-main.xsd, CT_SoftEdgesEffect
4821
+ *
4822
+ * @module
4823
+ */
4824
+ /**
4825
+ * Creates a soft edge effect element.
4826
+ *
4827
+ * ## XSD Schema
4828
+ * ```xml
4829
+ * <xsd:complexType name="CT_SoftEdgesEffect">
4830
+ * <xsd:attribute name="rad" type="ST_PositiveCoordinate" use="required"/>
4831
+ * </xsd:complexType>
4832
+ * ```
4833
+ *
4834
+ * @param rad - Soft edge radius in EMUs (required)
4835
+ */
4836
+ const createSoftEdgeEffect = (rad) => new BuilderElement({
4837
+ attributes: { rad: {
4838
+ key: "rad",
4839
+ value: rad
3986
4840
  } },
3987
- name: "a:srgbClr"
4841
+ name: "a:softEdge"
3988
4842
  });
3989
4843
  //#endregion
3990
- //#region src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/outline/scheme-color.ts
4844
+ //#region src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/effects/effect-list.ts
3991
4845
  /**
3992
- * Scheme color element for DrawingML shapes.
4846
+ * Effect list container for DrawingML shapes.
3993
4847
  *
3994
- * This module provides scheme-based color support for solid fills,
3995
- * allowing colors to be defined using theme color schemes.
4848
+ * Reference: ISO/IEC 29500-4, dml-main.xsd, CT_EffectList, EG_EffectProperties
3996
4849
  *
3997
4850
  * @module
3998
4851
  */
3999
4852
  /**
4000
- * Creates a scheme color element.
4853
+ * Creates a blur effect element.
4001
4854
  *
4002
- * Specifies a color using a theme color scheme reference.
4855
+ * ## XSD Schema
4856
+ * ```xml
4857
+ * <xsd:complexType name="CT_BlurEffect">
4858
+ * <xsd:attribute name="rad" type="ST_PositiveCoordinate" default="0"/>
4859
+ * <xsd:attribute name="grow" type="xsd:boolean" default="true"/>
4860
+ * </xsd:complexType>
4861
+ * ```
4862
+ */
4863
+ const createBlurEffect = (options) => {
4864
+ if (!(options.rad !== void 0 || options.grow === false)) return new BuilderElement({ name: "a:blur" });
4865
+ return new BuilderElement({
4866
+ attributes: {
4867
+ ...options.rad !== void 0 && { rad: {
4868
+ key: "rad",
4869
+ value: options.rad
4870
+ } },
4871
+ ...options.grow === false && { grow: {
4872
+ key: "grow",
4873
+ value: 0
4874
+ } }
4875
+ },
4876
+ name: "a:blur"
4877
+ });
4878
+ };
4879
+ /**
4880
+ * Creates an effect list element (a:effectLst).
4881
+ *
4882
+ * This is the EG_EffectProperties choice for a flat list of effects.
4883
+ * Effects are emitted in XSD order: blur, glow, innerShdw, outerShdw, prstShdw, reflection, softEdge.
4003
4884
  *
4004
4885
  * ## XSD Schema
4005
4886
  * ```xml
4006
- * <xsd:complexType name="CT_SchemeColor">
4887
+ * <xsd:complexType name="CT_EffectList">
4007
4888
  * <xsd:sequence>
4008
- * <xsd:group ref="EG_ColorTransform" minOccurs="0" maxOccurs="unbounded"/>
4889
+ * <xsd:element name="blur" type="CT_BlurEffect" minOccurs="0"/>
4890
+ * <xsd:element name="fillOverlay" type="CT_FillOverlayEffect" minOccurs="0"/>
4891
+ * <xsd:element name="glow" type="CT_GlowEffect" minOccurs="0"/>
4892
+ * <xsd:element name="innerShdw" type="CT_InnerShadowEffect" minOccurs="0"/>
4893
+ * <xsd:element name="outerShdw" type="CT_OuterShadowEffect" minOccurs="0"/>
4894
+ * <xsd:element name="prstShdw" type="CT_PresetShadowEffect" minOccurs="0"/>
4895
+ * <xsd:element name="reflection" type="CT_ReflectionEffect" minOccurs="0"/>
4896
+ * <xsd:element name="softEdge" type="CT_SoftEdgesEffect" minOccurs="0"/>
4009
4897
  * </xsd:sequence>
4010
- * <xsd:attribute name="val" type="ST_SchemeColorVal" use="required"/>
4011
4898
  * </xsd:complexType>
4012
4899
  * ```
4900
+ */
4901
+ const createEffectList = (options) => {
4902
+ const children = [];
4903
+ if (options.blur) children.push(createBlurEffect(options.blur));
4904
+ if (options.glow) children.push(createGlowEffect(options.glow));
4905
+ if (options.innerShdw) children.push(createInnerShadowEffect(options.innerShdw));
4906
+ if (options.outerShdw) children.push(createOuterShadowEffect(options.outerShdw));
4907
+ if (options.prstShdw) children.push(createPresetShadowEffect(options.prstShdw));
4908
+ if (options.reflection) children.push(createReflectionEffect(options.reflection === true ? void 0 : options.reflection));
4909
+ if (options.softEdge !== void 0) children.push(createSoftEdgeEffect(options.softEdge));
4910
+ return new BuilderElement({
4911
+ children,
4912
+ name: "a:effectLst"
4913
+ });
4914
+ };
4915
+ //#endregion
4916
+ //#region src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/fill/gradient-fill.ts
4917
+ /**
4918
+ * Gradient fill element for DrawingML shapes.
4919
+ *
4920
+ * This module provides gradient fill support with linear and path shading.
4921
+ *
4922
+ * Reference: ISO/IEC 29500-4, dml-main.xsd, CT_GradientFillProperties
4923
+ *
4924
+ * @module
4925
+ */
4926
+ /**
4927
+ * Path shade type for radial gradients.
4928
+ */
4929
+ const PathShadeType = {
4930
+ SHAPE: "shape",
4931
+ CIRCLE: "circle",
4932
+ RECT: "rect"
4933
+ };
4934
+ /**
4935
+ * Creates a gradient stop element (a:gs).
4013
4936
  *
4014
4937
  * @example
4015
4938
  * ```typescript
4016
- * const accentColor = createSchemeColor({ value: SchemeColor.ACCENT1 });
4017
- * const bgColor = createSchemeColor({ value: SchemeColor.BG1 });
4939
+ * createGradientStop({ position: 0, color: { value: "FF0000" } });
4940
+ * createGradientStop({ position: 100000, color: { value: "0000FF" } });
4018
4941
  * ```
4019
4942
  */
4020
- const createSchemeColor = (options) => new BuilderElement({
4021
- attributes: { value: {
4022
- key: "val",
4023
- value: options.value
4943
+ const createGradientStop = (stop) => new BuilderElement({
4944
+ attributes: { pos: {
4945
+ key: "pos",
4946
+ value: stop.position
4024
4947
  } },
4025
- name: "a:schemeClr"
4948
+ children: [createColorElement(stop.color)],
4949
+ name: "a:gs"
4026
4950
  });
4951
+ /**
4952
+ * Creates the shade element (a:lin or a:path).
4953
+ */
4954
+ const createShadeElement = (shade) => {
4955
+ if ("angle" in shade) return new BuilderElement({
4956
+ attributes: {
4957
+ ang: {
4958
+ key: "ang",
4959
+ value: shade.angle
4960
+ },
4961
+ scaled: {
4962
+ key: "scaled",
4963
+ value: shade.scaled
4964
+ }
4965
+ },
4966
+ name: "a:lin"
4967
+ });
4968
+ const pathShade = shade;
4969
+ return new BuilderElement({
4970
+ attributes: { path: {
4971
+ key: "path",
4972
+ value: pathShade.path ? PathShadeType[pathShade.path] : void 0
4973
+ } },
4974
+ name: "a:path"
4975
+ });
4976
+ };
4977
+ /**
4978
+ * Creates a gradient fill element.
4979
+ *
4980
+ * ## XSD Schema
4981
+ * ```xml
4982
+ * <xsd:complexType name="CT_GradientFillProperties">
4983
+ * <xsd:sequence>
4984
+ * <xsd:element name="gsLst" type="CT_GradientStopList" minOccurs="0"/>
4985
+ * <xsd:group ref="EG_ShadeProperties" minOccurs="0"/>
4986
+ * </xsd:sequence>
4987
+ * <xsd:attribute name="rotWithShape" type="xsd:boolean" use="optional"/>
4988
+ * </xsd:complexType>
4989
+ * ```
4990
+ *
4991
+ * @example
4992
+ * ```typescript
4993
+ * // Linear gradient from red to blue
4994
+ * createGradientFill({
4995
+ * stops: [
4996
+ * { position: 0, color: { value: "FF0000" } },
4997
+ * { position: 100000, color: { value: "0000FF" } },
4998
+ * ],
4999
+ * shade: { angle: 5400000 },
5000
+ * });
5001
+ * ```
5002
+ */
5003
+ const createGradientFill = (options) => {
5004
+ const children = [];
5005
+ children.push(new BuilderElement({
5006
+ children: options.stops.map(createGradientStop),
5007
+ name: "a:gsLst"
5008
+ }));
5009
+ if (options.shade) children.push(createShadeElement(options.shade));
5010
+ return new BuilderElement({
5011
+ attributes: { rotWithShape: {
5012
+ key: "rotWithShape",
5013
+ value: options.rotateWithShape
5014
+ } },
5015
+ children,
5016
+ name: "a:gradFill"
5017
+ });
5018
+ };
4027
5019
  //#endregion
4028
- //#region src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/outline/solid-fill.ts
5020
+ //#region src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/form/extents/extents-attributes.ts
4029
5021
  /**
4030
- * Solid fill element for DrawingML shapes.
5022
+ * Extents attributes for DrawingML shapes.
4031
5023
  *
4032
- * This module provides solid fill support for outlines and shapes,
4033
- * supporting both RGB and scheme-based colors.
5024
+ * This module defines the width and height attributes for shape extents.
4034
5025
  *
4035
5026
  * @module
4036
5027
  */
4037
5028
  /**
4038
- * Creates a solid fill element.
5029
+ * Attributes for shape extents (size).
4039
5030
  *
4040
- * Specifies a solid color fill using either RGB or scheme colors.
5031
+ * Defines the width (cx) and height (cy) in EMUs.
4041
5032
  *
4042
5033
  * ## XSD Schema
4043
5034
  * ```xml
4044
- * <xsd:complexType name="CT_SolidColorFillProperties">
5035
+ * <xsd:attribute name="cx" type="ST_PositiveCoordinate" use="required"/>
5036
+ * <xsd:attribute name="cy" type="ST_PositiveCoordinate" use="required"/>
5037
+ * ```
5038
+ *
5039
+ * @internal
5040
+ */
5041
+ var ExtentsAttributes = class extends XmlAttributeComponent {
5042
+ constructor(..._args) {
5043
+ super(..._args);
5044
+ _defineProperty(this, "xmlKeys", {
5045
+ cx: "cx",
5046
+ cy: "cy"
5047
+ });
5048
+ }
5049
+ };
5050
+ //#endregion
5051
+ //#region src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/form/extents/extents.ts
5052
+ /**
5053
+ * Extents (size) element for DrawingML shapes.
5054
+ *
5055
+ * This module defines the size of a shape or picture in EMUs.
5056
+ *
5057
+ * Reference: http://officeopenxml.com/drwSp-size.php
5058
+ *
5059
+ * @module
5060
+ */
5061
+ /**
5062
+ * Represents the extents (size) of a DrawingML shape.
5063
+ *
5064
+ * Defines the width and height of the shape in English Metric Units (EMUs).
5065
+ * One EMU equals 1/914,400 of an inch.
5066
+ *
5067
+ * Reference: http://officeopenxml.com/drwSp-size.php
5068
+ *
5069
+ * ## XSD Schema
5070
+ * ```xml
5071
+ * <xsd:complexType name="CT_PositiveSize2D">
5072
+ * <xsd:attribute name="cx" type="ST_PositiveCoordinate" use="required"/>
5073
+ * <xsd:attribute name="cy" type="ST_PositiveCoordinate" use="required"/>
5074
+ * </xsd:complexType>
5075
+ * ```
5076
+ *
5077
+ * @example
5078
+ * ```typescript
5079
+ * // Create a 1-inch by 1-inch shape
5080
+ * const extents = new Extents(914400, 914400);
5081
+ * ```
5082
+ */
5083
+ var Extents = class extends XmlComponent {
5084
+ constructor(x, y) {
5085
+ super("a:ext");
5086
+ _defineProperty(this, "attributes", void 0);
5087
+ this.attributes = new ExtentsAttributes({
5088
+ cx: x,
5089
+ cy: y
5090
+ });
5091
+ this.root.push(this.attributes);
5092
+ }
5093
+ };
5094
+ //#endregion
5095
+ //#region src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/form/offset/off-attributes.ts
5096
+ /**
5097
+ * Offset attributes for DrawingML shapes.
5098
+ *
5099
+ * This module defines the x and y coordinate attributes for shape offset.
5100
+ *
5101
+ * @module
5102
+ */
5103
+ /**
5104
+ * Attributes for shape offset (position).
5105
+ *
5106
+ * Defines the x and y coordinates in EMUs.
5107
+ *
5108
+ * ## XSD Schema
5109
+ * ```xml
5110
+ * <xsd:attribute name="x" type="ST_Coordinate" use="required"/>
5111
+ * <xsd:attribute name="y" type="ST_Coordinate" use="required"/>
5112
+ * ```
5113
+ *
5114
+ * @internal
5115
+ */
5116
+ var OffsetAttributes = class extends XmlAttributeComponent {
5117
+ constructor(..._args) {
5118
+ super(..._args);
5119
+ _defineProperty(this, "xmlKeys", {
5120
+ x: "x",
5121
+ y: "y"
5122
+ });
5123
+ }
5124
+ };
5125
+ //#endregion
5126
+ //#region src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/form/offset/off.ts
5127
+ /**
5128
+ * Offset (position) element for DrawingML shapes.
5129
+ *
5130
+ * This module defines the position of a shape or picture in EMUs.
5131
+ *
5132
+ * Reference: http://officeopenxml.com/drwSp-size.php
5133
+ *
5134
+ * @module
5135
+ */
5136
+ /**
5137
+ * Represents the offset (position) of a DrawingML shape.
5138
+ *
5139
+ * Defines the x and y coordinates of the shape's position in
5140
+ * English Metric Units (EMUs). One EMU equals 1/914,400 of an inch.
5141
+ *
5142
+ * Reference: http://officeopenxml.com/drwSp-size.php
5143
+ *
5144
+ * ## XSD Schema
5145
+ * ```xml
5146
+ * <xsd:complexType name="CT_Point2D">
5147
+ * <xsd:attribute name="x" type="ST_Coordinate" use="required"/>
5148
+ * <xsd:attribute name="y" type="ST_Coordinate" use="required"/>
5149
+ * </xsd:complexType>
5150
+ * ```
5151
+ *
5152
+ * @example
5153
+ * ```typescript
5154
+ * const offset = new Offset();
5155
+ * ```
5156
+ */
5157
+ var Offset = class extends XmlComponent {
5158
+ constructor(x, y) {
5159
+ super("a:off");
5160
+ this.root.push(new OffsetAttributes({
5161
+ x: x !== null && x !== void 0 ? x : 0,
5162
+ y: y !== null && y !== void 0 ? y : 0
5163
+ }));
5164
+ }
5165
+ };
5166
+ //#endregion
5167
+ //#region src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/form/form.ts
5168
+ /**
5169
+ * Attributes for 2D transformation.
5170
+ *
5171
+ * Defines flip and rotation properties.
5172
+ */
5173
+ var FormAttributes = class extends XmlAttributeComponent {
5174
+ constructor(..._args) {
5175
+ super(..._args);
5176
+ _defineProperty(this, "xmlKeys", {
5177
+ flipHorizontal: "flipH",
5178
+ flipVertical: "flipV",
5179
+ rotation: "rot"
5180
+ });
5181
+ }
5182
+ };
5183
+ /**
5184
+ * Represents a 2D transformation for DrawingML objects.
5185
+ *
5186
+ * This element defines how a shape or picture is positioned, sized,
5187
+ * rotated, and flipped within the document.
5188
+ *
5189
+ * Reference: http://officeopenxml.com/drwSp-size.php
5190
+ *
5191
+ * ## XSD Schema
5192
+ * ```xml
5193
+ * <xsd:complexType name="CT_Transform2D">
4045
5194
  * <xsd:sequence>
4046
- * <xsd:group ref="EG_ColorChoice" minOccurs="0"/>
4047
- * <xsd:group ref="EG_EffectProperties" minOccurs="0"/>
5195
+ * <xsd:element name="off" type="CT_Point2D" minOccurs="0"/>
5196
+ * <xsd:element name="ext" type="CT_PositiveSize2D" minOccurs="0"/>
4048
5197
  * </xsd:sequence>
5198
+ * <xsd:attribute name="rot" type="ST_Angle" use="optional"/>
5199
+ * <xsd:attribute name="flipH" type="xsd:boolean" use="optional"/>
5200
+ * <xsd:attribute name="flipV" type="xsd:boolean" use="optional"/>
4049
5201
  * </xsd:complexType>
4050
5202
  * ```
4051
5203
  *
4052
5204
  * @example
4053
5205
  * ```typescript
4054
- * // RGB solid fill
4055
- * const fill = createSolidFill({
4056
- * type: "rgb",
4057
- * value: "FF0000"
4058
- * });
4059
- *
4060
- * // Scheme solid fill
4061
- * const schemeFill = createSolidFill({
4062
- * type: "scheme",
4063
- * value: SchemeColor.ACCENT1
4064
- * });
5206
+ * const form = new Form({
5207
+ * emus: { x: 914400, y: 914400 },
5208
+ * flip: { horizontal: true, vertical: false },
5209
+ * rotation: 450000 // 7.5 degrees
5210
+ * });
5211
+ * ```
5212
+ */
5213
+ var Form = class extends XmlComponent {
5214
+ constructor(options) {
5215
+ var _options$flip, _options$flip2, _options$offset, _options$offset2;
5216
+ super("a:xfrm");
5217
+ _defineProperty(this, "extents", void 0);
5218
+ _defineProperty(this, "offset", void 0);
5219
+ this.root.push(new FormAttributes({
5220
+ flipHorizontal: (_options$flip = options.flip) === null || _options$flip === void 0 ? void 0 : _options$flip.horizontal,
5221
+ flipVertical: (_options$flip2 = options.flip) === null || _options$flip2 === void 0 ? void 0 : _options$flip2.vertical,
5222
+ rotation: options.rotation
5223
+ }));
5224
+ this.offset = new Offset((_options$offset = options.offset) === null || _options$offset === void 0 || (_options$offset = _options$offset.emus) === null || _options$offset === void 0 ? void 0 : _options$offset.x, (_options$offset2 = options.offset) === null || _options$offset2 === void 0 || (_options$offset2 = _options$offset2.emus) === null || _options$offset2 === void 0 ? void 0 : _options$offset2.y);
5225
+ this.extents = new Extents(options.emus.x, options.emus.y);
5226
+ this.root.push(this.offset);
5227
+ this.root.push(this.extents);
5228
+ }
5229
+ };
5230
+ //#endregion
5231
+ //#region src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/outline/no-fill.ts
5232
+ /**
5233
+ * No fill element for DrawingML shapes.
5234
+ *
5235
+ * This module provides the no-fill option for outline and shape fills.
5236
+ *
5237
+ * @module
5238
+ */
5239
+ /**
5240
+ * Creates a no-fill element.
5241
+ *
5242
+ * Specifies that the outline or shape should have no fill applied.
5243
+ *
5244
+ * ## XSD Schema
5245
+ * ```xml
5246
+ * <xsd:element name="noFill" type="CT_Empty"/>
5247
+ * ```
5248
+ *
5249
+ * @example
5250
+ * ```typescript
5251
+ * const noFill = createNoFill();
4065
5252
  * ```
4066
5253
  */
4067
- const createSolidFill = (options) => new BuilderElement({
4068
- children: [options.type === "rgb" ? createSolidRgbColor(options) : createSchemeColor(options)],
4069
- name: "a:solidFill"
4070
- });
5254
+ const createNoFill = () => new BuilderElement({ name: "a:noFill" });
4071
5255
  //#endregion
4072
5256
  //#region src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/outline/outline.ts
4073
5257
  /**
4074
5258
  * Outline (line) properties for DrawingML shapes.
4075
5259
  *
4076
5260
  * This module provides support for configuring outline properties including
4077
- * width, cap style, compound line types, and fill properties.
5261
+ * width, cap style, compound line types, fill properties, dash, and join.
4078
5262
  *
4079
- * Reference: http://officeopenxml.com/drwSp-outline.php
5263
+ * Reference: ISO/IEC 29500-4, dml-main.xsd, CT_LineProperties
4080
5264
  *
4081
5265
  * @module
4082
5266
  */
4083
5267
  /**
5268
+ * Line cap styles for outline endpoints.
5269
+ *
5270
+ * Defines how the ends of a line are rendered.
5271
+ */
5272
+ const LineCap = {
5273
+ ROUND: "rnd",
5274
+ SQUARE: "sq",
5275
+ FLAT: "flat"
5276
+ };
5277
+ /**
5278
+ * Compound line types for outlines.
5279
+ *
5280
+ * Defines the structure of compound lines (single, double, etc.).
5281
+ */
5282
+ const CompoundLine = {
5283
+ SINGLE: "sng",
5284
+ DOUBLE: "dbl",
5285
+ THICK_THIN: "thickThin",
5286
+ THIN_THICK: "thinThick",
5287
+ TRI: "tri"
5288
+ };
5289
+ /**
5290
+ * Pen alignment options for outline positioning.
5291
+ *
5292
+ * Defines how the outline is aligned relative to the shape edge.
5293
+ */
5294
+ const PenAlignment = {
5295
+ CENTER: "ctr",
5296
+ INSET: "in"
5297
+ };
5298
+ /**
5299
+ * Preset dash styles for outlines.
5300
+ *
5301
+ * ## XSD Schema
5302
+ * ```xml
5303
+ * <xsd:simpleType name="ST_PresetLineDashVal">
5304
+ * <xsd:restriction base="xsd:token">
5305
+ * <xsd:enumeration value="solid"/>
5306
+ * <xsd:enumeration value="dot"/>
5307
+ * <xsd:enumeration value="dash"/>
5308
+ * <xsd:enumeration value="lgDash"/>
5309
+ * <xsd:enumeration value="dashDot"/>
5310
+ * <xsd:enumeration value="lgDashDot"/>
5311
+ * <xsd:enumeration value="lgDashDotDot"/>
5312
+ * <xsd:enumeration value="sysDash"/>
5313
+ * <xsd:enumeration value="sysDot"/>
5314
+ * <xsd:enumeration value="sysDashDot"/>
5315
+ * <xsd:enumeration value="sysDashDotDot"/>
5316
+ * </xsd:restriction>
5317
+ * </xsd:simpleType>
5318
+ * ```
5319
+ */
5320
+ const PresetDash = {
5321
+ SOLID: "solid",
5322
+ DOT: "dot",
5323
+ DASH: "dash",
5324
+ LG_DASH: "lgDash",
5325
+ DASH_DOT: "dashDot",
5326
+ LG_DASH_DOT: "lgDashDot",
5327
+ LG_DASH_DOT_DOT: "lgDashDotDot",
5328
+ SYS_DASH: "sysDash",
5329
+ SYS_DOT: "sysDot",
5330
+ SYS_DASH_DOT: "sysDashDot",
5331
+ SYS_DASH_DOT_DOT: "sysDashDotDot"
5332
+ };
5333
+ /**
5334
+ * Line join styles.
5335
+ */
5336
+ const LineJoin = {
5337
+ ROUND: "round",
5338
+ BEVEL: "bevel",
5339
+ MITER: "miter"
5340
+ };
5341
+ /**
5342
+ * Creates the fill child element for an outline.
5343
+ */
5344
+ const createOutlineFill = (options) => {
5345
+ if (options.type === "noFill") return createNoFill();
5346
+ return createSolidFill(options.color);
5347
+ };
5348
+ /**
4084
5349
  * Creates an outline element for DrawingML shapes.
4085
5350
  *
4086
5351
  * The outline element specifies the line properties for the shape border,
4087
- * including width, cap style, compound line type, alignment, and fill.
4088
- *
4089
- * Reference: http://officeopenxml.com/drwSp-outline.php
5352
+ * including width, cap style, compound line type, alignment, dash, join, and fill.
4090
5353
  *
4091
5354
  * ## XSD Schema
4092
5355
  * ```xml
@@ -4105,44 +5368,56 @@
4105
5368
  *
4106
5369
  * @example
4107
5370
  * ```typescript
4108
- * // Create outline with RGB color
5371
+ * // Outline with RGB color and dash
4109
5372
  * const outline = createOutline({
4110
5373
  * width: 9525,
4111
- * cap: "ROUND",
4112
5374
  * type: "solidFill",
4113
- * solidFillType: "rgb",
4114
- * value: "FF0000"
5375
+ * color: { value: "FF0000" },
5376
+ * dash: "DASH",
4115
5377
  * });
4116
5378
  * ```
4117
5379
  */
4118
- const createOutline = (options) => new BuilderElement({
4119
- attributes: {
4120
- align: {
4121
- key: "algn",
4122
- value: options.align
4123
- },
4124
- cap: {
4125
- key: "cap",
4126
- value: options.cap
4127
- },
4128
- compoundLine: {
4129
- key: "cmpd",
4130
- value: options.compoundLine
5380
+ const createOutline = (options) => {
5381
+ const children = [];
5382
+ children.push(createOutlineFill(options));
5383
+ if (options.dash !== void 0) children.push(new BuilderElement({
5384
+ attributes: { val: {
5385
+ key: "val",
5386
+ value: PresetDash[options.dash]
5387
+ } },
5388
+ name: "a:prstDash"
5389
+ }));
5390
+ if (options.join !== void 0) if (options.join === "MITER" && options.miterLimit !== void 0) children.push(new BuilderElement({
5391
+ attributes: { lim: {
5392
+ key: "lim",
5393
+ value: options.miterLimit
5394
+ } },
5395
+ name: "a:miter"
5396
+ }));
5397
+ else children.push(new BuilderElement({ name: `a:${LineJoin[options.join]}` }));
5398
+ return new BuilderElement({
5399
+ attributes: {
5400
+ align: {
5401
+ key: "algn",
5402
+ value: options.align ? PenAlignment[options.align] : void 0
5403
+ },
5404
+ cap: {
5405
+ key: "cap",
5406
+ value: options.cap ? LineCap[options.cap] : void 0
5407
+ },
5408
+ compoundLine: {
5409
+ key: "cmpd",
5410
+ value: options.compoundLine ? CompoundLine[options.compoundLine] : void 0
5411
+ },
5412
+ width: {
5413
+ key: "w",
5414
+ value: options.width
5415
+ }
4131
5416
  },
4132
- width: {
4133
- key: "w",
4134
- value: options.width
4135
- }
4136
- },
4137
- children: [options.type === "noFill" ? createNoFill() : options.solidFillType === "rgb" ? createSolidFill({
4138
- type: "rgb",
4139
- value: options.value
4140
- }) : createSolidFill({
4141
- type: "scheme",
4142
- value: options.value
4143
- })],
4144
- name: "a:ln"
4145
- });
5417
+ children,
5418
+ name: "a:ln"
5419
+ });
5420
+ };
4146
5421
  //#endregion
4147
5422
  //#region src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/preset-geometry/adjustment-values/adjustment-values.ts
4148
5423
  /**
@@ -4280,15 +5555,181 @@
4280
5555
  }
4281
5556
  };
4282
5557
  //#endregion
5558
+ //#region src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/three-d/bevel.ts
5559
+ /**
5560
+ * Bevel element for DrawingML 3D shapes.
5561
+ *
5562
+ * Reference: ISO/IEC 29500-4, dml-main.xsd, CT_Bevel
5563
+ *
5564
+ * @module
5565
+ */
5566
+ /**
5567
+ * Bevel preset types (12 variations).
5568
+ *
5569
+ * Reference: ISO/IEC 29500-4, dml-main.xsd, ST_BevelPresetType
5570
+ */
5571
+ const BevelPresetType = {
5572
+ RELAXED_INSET: "relaxedInset",
5573
+ CIRCLE: "circle",
5574
+ SLOPE: "slope",
5575
+ CROSS: "cross",
5576
+ ANGLE: "angle",
5577
+ SOFT_ROUND: "softRound",
5578
+ CONVEX: "convex",
5579
+ COOL_SLANT: "coolSlant",
5580
+ DIVOT: "divot",
5581
+ RIBLET: "riblet",
5582
+ HARD_EDGE: "hardEdge",
5583
+ ART_DECO: "artDeco"
5584
+ };
5585
+ /**
5586
+ * Creates a bevel element.
5587
+ *
5588
+ * ## XSD Schema
5589
+ * ```xml
5590
+ * <xsd:complexType name="CT_Bevel">
5591
+ * <xsd:attribute name="w" type="ST_PositiveCoordinate" default="76200"/>
5592
+ * <xsd:attribute name="h" type="ST_PositiveCoordinate" default="76200"/>
5593
+ * <xsd:attribute name="prst" type="ST_BevelPresetType" default="circle"/>
5594
+ * </xsd:complexType>
5595
+ * ```
5596
+ */
5597
+ const createBevel = (options) => {
5598
+ if (!options) return new BuilderElement({ name: "a:bevelT" });
5599
+ const attributes = {};
5600
+ if (options.w !== void 0) attributes.w = {
5601
+ key: "w",
5602
+ value: options.w
5603
+ };
5604
+ if (options.h !== void 0) attributes.h = {
5605
+ key: "h",
5606
+ value: options.h
5607
+ };
5608
+ if (options.prst !== void 0) attributes.prst = {
5609
+ key: "prst",
5610
+ value: BevelPresetType[options.prst]
5611
+ };
5612
+ return new BuilderElement({
5613
+ attributes,
5614
+ name: "a:bevelT"
5615
+ });
5616
+ };
5617
+ /**
5618
+ * Creates a bottom bevel element (a:bevelB).
5619
+ */
5620
+ const createBottomBevel = (options) => {
5621
+ if (!options) return new BuilderElement({ name: "a:bevelB" });
5622
+ const attributes = {};
5623
+ if (options.w !== void 0) attributes.w = {
5624
+ key: "w",
5625
+ value: options.w
5626
+ };
5627
+ if (options.h !== void 0) attributes.h = {
5628
+ key: "h",
5629
+ value: options.h
5630
+ };
5631
+ if (options.prst !== void 0) attributes.prst = {
5632
+ key: "prst",
5633
+ value: BevelPresetType[options.prst]
5634
+ };
5635
+ return new BuilderElement({
5636
+ attributes,
5637
+ name: "a:bevelB"
5638
+ });
5639
+ };
5640
+ //#endregion
5641
+ //#region src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/three-d/shape-3d.ts
5642
+ /**
5643
+ * 3D shape properties for DrawingML.
5644
+ *
5645
+ * Reference: ISO/IEC 29500-4, dml-main.xsd, CT_Shape3D
5646
+ *
5647
+ * @module
5648
+ */
5649
+ /**
5650
+ * Preset material types for 3D shapes (15 variations).
5651
+ *
5652
+ * Reference: ISO/IEC 29500-4, dml-main.xsd, ST_PresetMaterialType
5653
+ */
5654
+ const PresetMaterialType = {
5655
+ LEGACY_MATTE: "legacyMatte",
5656
+ LEGACY_PLASTIC: "legacyPlastic",
5657
+ LEGACY_METAL: "legacyMetal",
5658
+ LEGACY_WIREFRAME: "legacyWireframe",
5659
+ MATTE: "matte",
5660
+ PLASTIC: "plastic",
5661
+ METAL: "metal",
5662
+ WARM_MATTE: "warmMatte",
5663
+ TRANSLUCENT_POWDER: "translucentPowder",
5664
+ POWDER: "powder",
5665
+ DK_EDGE: "dkEdge",
5666
+ SOFT_EDGE: "softEdge",
5667
+ CLEAR: "clear",
5668
+ FLAT: "flat",
5669
+ SOFT_METAL: "softmetal"
5670
+ };
5671
+ /**
5672
+ * Creates a 3D shape properties element (a:sp3d).
5673
+ *
5674
+ * ## XSD Schema
5675
+ * ```xml
5676
+ * <xsd:complexType name="CT_Shape3D">
5677
+ * <xsd:sequence>
5678
+ * <xsd:element name="bevelT" type="CT_Bevel" minOccurs="0"/>
5679
+ * <xsd:element name="bevelB" type="CT_Bevel" minOccurs="0"/>
5680
+ * <xsd:element name="extrusionClr" type="CT_Color" minOccurs="0"/>
5681
+ * <xsd:element name="contourClr" type="CT_Color" minOccurs="0"/>
5682
+ * </xsd:sequence>
5683
+ * <xsd:attribute name="z" type="ST_Coordinate" default="0"/>
5684
+ * <xsd:attribute name="extrusionH" type="ST_PositiveCoordinate" default="0"/>
5685
+ * <xsd:attribute name="contourW" type="ST_PositiveCoordinate" default="0"/>
5686
+ * <xsd:attribute name="prstMaterial" type="ST_PresetMaterialType" default="warmMatte"/>
5687
+ * </xsd:complexType>
5688
+ * ```
5689
+ */
5690
+ const createShape3D = (options) => {
5691
+ const children = [];
5692
+ if (options.bevelT) children.push(createBevel(options.bevelT));
5693
+ if (options.bevelB) children.push(createBottomBevel(options.bevelB));
5694
+ if (options.extrusionClr) children.push(new BuilderElement({
5695
+ children: [createColorElement(options.extrusionClr)],
5696
+ name: "a:extrusionClr"
5697
+ }));
5698
+ if (options.contourClr) children.push(new BuilderElement({
5699
+ children: [createColorElement(options.contourClr)],
5700
+ name: "a:contourClr"
5701
+ }));
5702
+ return new BuilderElement({
5703
+ attributes: options.z !== void 0 || options.extrusionH !== void 0 || options.contourW !== void 0 || options.prstMaterial !== void 0 ? {
5704
+ ...options.z !== void 0 && { z: {
5705
+ key: "z",
5706
+ value: options.z
5707
+ } },
5708
+ ...options.extrusionH !== void 0 && { extrusionH: {
5709
+ key: "extrusionH",
5710
+ value: options.extrusionH
5711
+ } },
5712
+ ...options.contourW !== void 0 && { contourW: {
5713
+ key: "contourW",
5714
+ value: options.contourW
5715
+ } },
5716
+ ...options.prstMaterial !== void 0 && { prstMaterial: {
5717
+ key: "prstMaterial",
5718
+ value: PresetMaterialType[options.prstMaterial]
5719
+ } }
5720
+ } : void 0,
5721
+ children,
5722
+ name: "a:sp3d"
5723
+ });
5724
+ };
5725
+ //#endregion
4283
5726
  //#region src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/shape-properties.ts
4284
5727
  /**
4285
5728
  * Represents shape properties for a DrawingML picture.
4286
5729
  *
4287
5730
  * This element defines the visual formatting of a picture, including
4288
5731
  * its transform (size, position, rotation, flip), geometry preset,
4289
- * and outline properties.
4290
- *
4291
- * Reference: http://officeopenxml.com/drwSp-SpPr.php
5732
+ * fill, outline, effects, and 3D properties.
4292
5733
  *
4293
5734
  * ## XSD Schema
4294
5735
  * ```xml
@@ -4310,33 +5751,29 @@
4310
5751
  * @example
4311
5752
  * ```typescript
4312
5753
  * const shapeProps = new ShapeProperties({
4313
- * transform: {
4314
- * emus: { x: 914400, y: 914400 },
4315
- * flip: { horizontal: false, vertical: false },
4316
- * rotation: 0
5754
+ * element: "pic",
5755
+ * transform: { emus: { x: 914400, y: 914400 } },
5756
+ * effects: {
5757
+ * glow: { rad: 50800, color: { value: "FF0000" } },
4317
5758
  * },
4318
- * outline: {
4319
- * width: 9525,
4320
- * type: "solidFill",
4321
- * solidFillType: "rgb",
4322
- * value: "FF0000"
4323
- * }
4324
5759
  * });
4325
5760
  * ```
4326
5761
  */
4327
5762
  var ShapeProperties = class extends XmlComponent {
4328
- constructor({ element, outline, solidFill, transform }) {
5763
+ constructor({ element, effects, gradientFill, noFill, outline, shape3d, solidFill, transform }) {
4329
5764
  super(`${element}:spPr`);
4330
5765
  _defineProperty(this, "form", void 0);
4331
5766
  this.root.push(new ShapePropertiesAttributes({ bwMode: "auto" }));
4332
5767
  this.form = new Form(transform);
4333
5768
  this.root.push(this.form);
4334
5769
  this.root.push(new PresetGeometry());
4335
- if (outline) {
4336
- this.root.push(createNoFill());
4337
- this.root.push(createOutline(outline));
4338
- }
4339
- if (solidFill) this.root.push(createSolidFill(solidFill));
5770
+ if (noFill) this.root.push(createNoFill());
5771
+ else if (solidFill) this.root.push(createSolidFill(solidFill));
5772
+ else if (gradientFill) this.root.push(createGradientFill(gradientFill));
5773
+ else if (outline) this.root.push(createNoFill());
5774
+ if (outline) this.root.push(createOutline(outline));
5775
+ if (effects) this.root.push(createEffectList(effects));
5776
+ if (shape3d) this.root.push(createShape3D(shape3d));
4340
5777
  }
4341
5778
  };
4342
5779
  //#endregion
@@ -4572,17 +6009,17 @@
4572
6009
  *
4573
6010
  * This module defines the portion of an image to use when filling a shape.
4574
6011
  *
4575
- * Reference: http://officeopenxml.com/drwPic.php
6012
+ * Reference: ISO/IEC 29500-4, dml-main.xsd, CT_RelativeRect
4576
6013
  *
4577
6014
  * @module
4578
6015
  */
4579
6016
  /**
4580
- * Represents a source rectangle for blip fills.
6017
+ * Creates a source rectangle element for blip fill cropping.
4581
6018
  *
4582
6019
  * This element specifies a portion of the blip (image) to use as the fill.
4583
- * When not specified with attributes, it indicates the entire blip should be used.
6020
+ * When no options are provided, the entire blip is used.
4584
6021
  *
4585
- * Reference: http://officeopenxml.com/drwPic.php
6022
+ * Reference: ISO/IEC 29500-4, dml-main.xsd, CT_RelativeRect
4586
6023
  *
4587
6024
  * ## XSD Schema
4588
6025
  * ```xml
@@ -4596,13 +6033,33 @@
4596
6033
  *
4597
6034
  * @example
4598
6035
  * ```typescript
4599
- * const srcRect = new SourceRectangle();
6036
+ * // Crop 10% from left and right
6037
+ * createSourceRectangle({ l: 10000, r: 10000 });
4600
6038
  * ```
4601
6039
  */
4602
- var SourceRectangle = class extends XmlComponent {
4603
- constructor() {
4604
- super("a:srcRect");
4605
- }
6040
+ const createSourceRectangle = (options) => {
6041
+ if (!options) return new BuilderElement({ name: "a:srcRect" });
6042
+ const attributes = {};
6043
+ if (options.l !== void 0) attributes.l = {
6044
+ key: "l",
6045
+ value: options.l
6046
+ };
6047
+ if (options.t !== void 0) attributes.t = {
6048
+ key: "t",
6049
+ value: options.t
6050
+ };
6051
+ if (options.r !== void 0) attributes.r = {
6052
+ key: "r",
6053
+ value: options.r
6054
+ };
6055
+ if (options.b !== void 0) attributes.b = {
6056
+ key: "b",
6057
+ value: options.b
6058
+ };
6059
+ return new BuilderElement({
6060
+ attributes,
6061
+ name: "a:srcRect"
6062
+ });
4606
6063
  };
4607
6064
  //#endregion
4608
6065
  //#region src/file/drawing/inline/graphic/graphic-data/pic/blip/stretch.ts
@@ -4673,9 +6130,9 @@
4673
6130
  * Represents a blip fill for pictures in DrawingML.
4674
6131
  *
4675
6132
  * This element specifies the type of fill used for a picture. It contains the blip (image)
4676
- * reference, an optional source rectangle, and the fill mode (typically stretch).
6133
+ * reference, an optional source rectangle for cropping, and the fill mode (typically stretch).
4677
6134
  *
4678
- * Reference: http://officeopenxml.com/drwPic.php
6135
+ * Reference: ISO/IEC 29500-4, dml-main.xsd, CT_BlipFillProperties
4679
6136
  *
4680
6137
  * ## XSD Schema
4681
6138
  * ```xml
@@ -4693,13 +6150,14 @@
4693
6150
  * @example
4694
6151
  * ```typescript
4695
6152
  * const blipFill = new BlipFill(mediaData);
6153
+ * // If mediaData.srcRect is set, cropping is applied
4696
6154
  * ```
4697
6155
  */
4698
6156
  var BlipFill = class extends XmlComponent {
4699
6157
  constructor(mediaData) {
4700
6158
  super("pic:blipFill");
4701
6159
  this.root.push(createBlip(mediaData));
4702
- this.root.push(new SourceRectangle());
6160
+ this.root.push(createSourceRectangle(mediaData.srcRect));
4703
6161
  this.root.push(new Stretch());
4704
6162
  }
4705
6163
  };
@@ -5070,15 +6528,90 @@
5070
6528
  };
5071
6529
  //#endregion
5072
6530
  //#region src/file/drawing/inline/graphic/graphic-data/wpg/wpg-group.ts
5073
- const createGroupProperties = (transform) => new BuilderElement({
5074
- children: [new Form(transform)],
5075
- name: "wpg:grpSpPr"
5076
- });
6531
+ /**
6532
+ * Creates a group transform element (a:xfrm) with optional chOff/chExt.
6533
+ *
6534
+ * This uses CT_GroupTransform2D which extends CT_Transform2D with
6535
+ * child offset and extent elements.
6536
+ *
6537
+ * ## XSD Schema
6538
+ * ```xml
6539
+ * <xsd:complexType name="CT_GroupTransform2D">
6540
+ * <xsd:sequence>
6541
+ * <xsd:element name="off" type="CT_Point2D" minOccurs="0"/>
6542
+ * <xsd:element name="ext" type="CT_PositiveSize2D" minOccurs="0"/>
6543
+ * <xsd:element name="chOff" type="CT_Point2D" minOccurs="0"/>
6544
+ * <xsd:element name="chExt" type="CT_PositiveSize2D" minOccurs="0"/>
6545
+ * </xsd:sequence>
6546
+ * <xsd:attribute name="rot" type="ST_Angle" default="0"/>
6547
+ * <xsd:attribute name="flipH" type="xsd:boolean" default="false"/>
6548
+ * <xsd:attribute name="flipV" type="xsd:boolean" default="false"/>
6549
+ * </xsd:complexType>
6550
+ * ```
6551
+ */
6552
+ const createGroupForm = (transform, chOff, chExt) => {
6553
+ var _transform$offset, _transform$offset2, _transform$flip, _transform$flip2, _transform$flip3, _transform$flip4;
6554
+ const children = [new Offset((_transform$offset = transform.offset) === null || _transform$offset === void 0 || (_transform$offset = _transform$offset.emus) === null || _transform$offset === void 0 ? void 0 : _transform$offset.x, (_transform$offset2 = transform.offset) === null || _transform$offset2 === void 0 || (_transform$offset2 = _transform$offset2.emus) === null || _transform$offset2 === void 0 ? void 0 : _transform$offset2.y), new Extents(transform.emus.x, transform.emus.y)];
6555
+ if (chOff) children.push(new BuilderElement({
6556
+ attributes: {
6557
+ x: {
6558
+ key: "x",
6559
+ value: chOff.x
6560
+ },
6561
+ y: {
6562
+ key: "y",
6563
+ value: chOff.y
6564
+ }
6565
+ },
6566
+ name: "a:chOff"
6567
+ }));
6568
+ if (chExt) children.push(new BuilderElement({
6569
+ attributes: {
6570
+ cx: {
6571
+ key: "cx",
6572
+ value: chExt.cx
6573
+ },
6574
+ cy: {
6575
+ key: "cy",
6576
+ value: chExt.cy
6577
+ }
6578
+ },
6579
+ name: "a:chExt"
6580
+ }));
6581
+ return new BuilderElement({
6582
+ attributes: ((_transform$flip = transform.flip) === null || _transform$flip === void 0 ? void 0 : _transform$flip.horizontal) !== void 0 || ((_transform$flip2 = transform.flip) === null || _transform$flip2 === void 0 ? void 0 : _transform$flip2.vertical) !== void 0 || transform.rotation !== void 0 ? {
6583
+ ...((_transform$flip3 = transform.flip) === null || _transform$flip3 === void 0 ? void 0 : _transform$flip3.horizontal) !== void 0 && { flipH: {
6584
+ key: "flipH",
6585
+ value: transform.flip.horizontal
6586
+ } },
6587
+ ...((_transform$flip4 = transform.flip) === null || _transform$flip4 === void 0 ? void 0 : _transform$flip4.vertical) !== void 0 && { flipV: {
6588
+ key: "flipV",
6589
+ value: transform.flip.vertical
6590
+ } },
6591
+ ...transform.rotation !== void 0 && { rot: {
6592
+ key: "rot",
6593
+ value: transform.rotation
6594
+ } }
6595
+ } : void 0,
6596
+ children,
6597
+ name: "a:xfrm"
6598
+ });
6599
+ };
6600
+ const createGroupProperties = (options) => {
6601
+ const children = [createGroupForm(options.transformation, options.chOff, options.chExt)];
6602
+ if (options.noFill) children.push(createNoFill());
6603
+ else if (options.solidFill) children.push(createSolidFill(options.solidFill));
6604
+ if (options.effects) children.push(createEffectList(options.effects));
6605
+ return new BuilderElement({
6606
+ children,
6607
+ name: "wpg:grpSpPr"
6608
+ });
6609
+ };
5077
6610
  const createNonVisualGroupProperties = () => new BuilderElement({ name: "wpg:cNvGrpSpPr" });
5078
6611
  const createWpgGroup = (options) => new BuilderElement({
5079
6612
  children: [
5080
6613
  createNonVisualGroupProperties(),
5081
- createGroupProperties(options.transformation),
6614
+ createGroupProperties(options),
5082
6615
  ...options.children
5083
6616
  ],
5084
6617
  name: "wpg:wgp"
@@ -5127,8 +6660,9 @@
5127
6660
  this.root.push(wps);
5128
6661
  } else if (mediaData.type === "wpg") {
5129
6662
  this.root.push(new GraphicDataAttributes({ uri: "http://schemas.microsoft.com/office/word/2010/wordprocessingGroup" }));
6663
+ const md = mediaData;
5130
6664
  const wpg = createWpgGroup({
5131
- children: mediaData.children.map((child) => {
6665
+ children: md.children.map((child) => {
5132
6666
  if (child.type === "wps") return createWpsShape({
5133
6667
  ...child.data,
5134
6668
  outline: child.outline,
@@ -5141,7 +6675,11 @@
5141
6675
  transform: child.transformation
5142
6676
  });
5143
6677
  }),
5144
- transformation: transform
6678
+ transformation: transform,
6679
+ chOff: md.chOff,
6680
+ chExt: md.chExt,
6681
+ solidFill: md.solidFill,
6682
+ effects: md.effects
5145
6683
  });
5146
6684
  this.root.push(wpg);
5147
6685
  } else {
@@ -5911,9 +7449,10 @@
5911
7449
  };
5912
7450
  //#endregion
5913
7451
  //#region src/file/paragraph/run/image-run.ts
5914
- const createImageData = (data, transformation, key) => ({
7452
+ const createImageData = (data, transformation, key, srcRect) => ({
5915
7453
  data,
5916
7454
  fileName: key,
7455
+ srcRect,
5917
7456
  transformation: {
5918
7457
  emus: {
5919
7458
  x: Math.round(transformation.width * 9525),
@@ -5959,7 +7498,7 @@
5959
7498
  const fallbackData = (0, undio.toUint8Array)(options.fallback.data);
5960
7499
  this.imageData = {
5961
7500
  type: options.type,
5962
- ...createImageData(rawData, options.transformation, key),
7501
+ ...createImageData(rawData, options.transformation, key, options.srcRect),
5963
7502
  fallback: {
5964
7503
  type: options.fallback.type,
5965
7504
  ...createImageData(fallbackData, options.transformation, `${hashedId(fallbackData)}.${options.fallback.type}`)
@@ -5967,7 +7506,7 @@
5967
7506
  };
5968
7507
  } else this.imageData = {
5969
7508
  type: options.type,
5970
- ...createImageData(rawData, options.transformation, key)
7509
+ ...createImageData(rawData, options.transformation, key, options.srcRect)
5971
7510
  };
5972
7511
  const drawing = new Drawing(this.imageData, {
5973
7512
  docProperties: options.altText,
@@ -8526,6 +10065,34 @@
8526
10065
  * @module
8527
10066
  */
8528
10067
  /**
10068
+ * Vertical text alignment types for paragraphs.
10069
+ *
10070
+ * Specifies the vertical alignment of text within the paragraph.
10071
+ *
10072
+ * @publicApi
10073
+ */
10074
+ const TextAlignmentType = {
10075
+ TOP: "top",
10076
+ CENTER: "center",
10077
+ BASELINE: "baseline",
10078
+ BOTTOM: "bottom",
10079
+ AUTO: "auto"
10080
+ };
10081
+ /**
10082
+ * Textbox tight wrap types for paragraphs.
10083
+ *
10084
+ * Specifies how tightly text wraps around a textbox.
10085
+ *
10086
+ * @publicApi
10087
+ */
10088
+ const TextboxTightWrapType = {
10089
+ NONE: "none",
10090
+ ALL_LINES: "allLines",
10091
+ FIRST_AND_LAST_LINE: "firstAndLastLine",
10092
+ FIRST_LINE_ONLY: "firstLineOnly",
10093
+ LAST_LINE_ONLY: "lastLineOnly"
10094
+ };
10095
+ /**
8529
10096
  * Represents paragraph properties (pPr) in a WordprocessingML document.
8530
10097
  *
8531
10098
  * The paragraph properties element specifies all formatting applied to a paragraph,
@@ -8688,6 +10255,27 @@
8688
10255
  if (options.outlineLevel !== void 0) this.push(createOutlineLevel(options.outlineLevel));
8689
10256
  if (options.suppressLineNumbers !== void 0) this.push(new OnOffElement("w:suppressLineNumbers", options.suppressLineNumbers));
8690
10257
  if (options.autoSpaceEastAsianText !== void 0) this.push(new OnOffElement("w:autoSpaceDN", options.autoSpaceEastAsianText));
10258
+ if (options.suppressAutoHyphens !== void 0) this.push(new OnOffElement("w:suppressAutoHyphens", options.suppressAutoHyphens));
10259
+ if (options.adjustRightInd !== void 0) this.push(new OnOffElement("w:adjustRightInd", options.adjustRightInd));
10260
+ if (options.snapToGrid !== void 0) this.push(new OnOffElement("w:snapToGrid", options.snapToGrid));
10261
+ if (options.mirrorIndents !== void 0) this.push(new OnOffElement("w:mirrorIndents", options.mirrorIndents));
10262
+ if (options.kinsoku !== void 0) this.push(new OnOffElement("w:kinsoku", options.kinsoku));
10263
+ if (options.topLinePunct !== void 0) this.push(new OnOffElement("w:topLinePunct", options.topLinePunct));
10264
+ if (options.autoSpaceDE !== void 0) this.push(new OnOffElement("w:autoSpaceDE", options.autoSpaceDE));
10265
+ if (options.textAlignment !== void 0) this.push(new BuilderElement({
10266
+ attributes: { val: {
10267
+ key: "w:val",
10268
+ value: options.textAlignment
10269
+ } },
10270
+ name: "w:textAlignment"
10271
+ }));
10272
+ if (options.textboxTightWrap !== void 0) this.push(new BuilderElement({
10273
+ attributes: { val: {
10274
+ key: "w:val",
10275
+ value: options.textboxTightWrap
10276
+ } },
10277
+ name: "w:textboxTightWrap"
10278
+ }));
8691
10279
  if (options.run) this.push(new ParagraphRunProperties(options.run));
8692
10280
  if (options.revision) this.push(new ParagraphPropertiesChange(options.revision));
8693
10281
  }
@@ -13057,6 +14645,137 @@
13057
14645
  name: "w:docGrid"
13058
14646
  });
13059
14647
  //#endregion
14648
+ //#region src/file/document/body/section-properties/properties/footnote-endnote-properties.ts
14649
+ /**
14650
+ * Footnote and endnote properties module for WordprocessingML section properties.
14651
+ *
14652
+ * Specifies footnote/endnote placement and numbering format within a section.
14653
+ *
14654
+ * Reference: ISO/IEC 29500-4, CT_FtnProps / CT_EdnProps
14655
+ *
14656
+ * @module
14657
+ */
14658
+ /**
14659
+ * Creates footnote properties element (w:footnotePr) for a section.
14660
+ *
14661
+ * ## XSD Schema
14662
+ * ```xml
14663
+ * <xsd:complexType name="CT_FtnProps">
14664
+ * <xsd:sequence>
14665
+ * <xsd:element name="pos" type="CT_FtnPos" minOccurs="0"/>
14666
+ * <xsd:element name="numFmt" type="CT_NumFmt" minOccurs="0"/>
14667
+ * <xsd:group ref="EG_FtnEdnNumProps" minOccurs="0"/>
14668
+ * </xsd:sequence>
14669
+ * </xsd:complexType>
14670
+ * ```
14671
+ */
14672
+ const createFootnoteProperties = ({ pos, formatType, format, numStart, numRestart }) => {
14673
+ const container = new FootnoteProperties();
14674
+ if (pos !== void 0) container.addChildElement(new BuilderElement({
14675
+ attributes: { val: {
14676
+ key: "w:val",
14677
+ value: pos
14678
+ } },
14679
+ name: "w:pos"
14680
+ }));
14681
+ if (formatType !== void 0 || format !== void 0) container.addChildElement(new BuilderElement({
14682
+ attributes: {
14683
+ format: {
14684
+ key: "w:format",
14685
+ value: format
14686
+ },
14687
+ val: {
14688
+ key: "w:fmt",
14689
+ value: formatType
14690
+ }
14691
+ },
14692
+ name: "w:numFmt"
14693
+ }));
14694
+ if (numStart !== void 0) container.addChildElement(new BuilderElement({
14695
+ attributes: { val: {
14696
+ key: "w:val",
14697
+ value: decimalNumber(numStart)
14698
+ } },
14699
+ name: "w:numStart"
14700
+ }));
14701
+ if (numRestart !== void 0) container.addChildElement(new BuilderElement({
14702
+ attributes: { val: {
14703
+ key: "w:val",
14704
+ value: numRestart
14705
+ } },
14706
+ name: "w:numRestart"
14707
+ }));
14708
+ return container;
14709
+ };
14710
+ /**
14711
+ * Footnote properties container element.
14712
+ */
14713
+ var FootnoteProperties = class extends IgnoreIfEmptyXmlComponent {
14714
+ constructor() {
14715
+ super("w:footnotePr", true);
14716
+ }
14717
+ };
14718
+ /**
14719
+ * Creates endnote properties element (w:endnotePr) for a section.
14720
+ *
14721
+ * ## XSD Schema
14722
+ * ```xml
14723
+ * <xsd:complexType name="CT_EdnProps">
14724
+ * <xsd:sequence>
14725
+ * <xsd:element name="pos" type="CT_EdnPos" minOccurs="0"/>
14726
+ * <xsd:element name="numFmt" type="CT_NumFmt" minOccurs="0"/>
14727
+ * <xsd:group ref="EG_FtnEdnNumProps" minOccurs="0"/>
14728
+ * </xsd:sequence>
14729
+ * </xsd:complexType>
14730
+ * ```
14731
+ */
14732
+ const createEndnoteProperties = ({ pos, formatType, format, numStart, numRestart }) => {
14733
+ const container = new EndnoteProperties();
14734
+ if (pos !== void 0) container.addChildElement(new BuilderElement({
14735
+ attributes: { val: {
14736
+ key: "w:val",
14737
+ value: pos
14738
+ } },
14739
+ name: "w:pos"
14740
+ }));
14741
+ if (formatType !== void 0 || format !== void 0) container.addChildElement(new BuilderElement({
14742
+ attributes: {
14743
+ format: {
14744
+ key: "w:format",
14745
+ value: format
14746
+ },
14747
+ val: {
14748
+ key: "w:fmt",
14749
+ value: formatType
14750
+ }
14751
+ },
14752
+ name: "w:numFmt"
14753
+ }));
14754
+ if (numStart !== void 0) container.addChildElement(new BuilderElement({
14755
+ attributes: { val: {
14756
+ key: "w:val",
14757
+ value: decimalNumber(numStart)
14758
+ } },
14759
+ name: "w:numStart"
14760
+ }));
14761
+ if (numRestart !== void 0) container.addChildElement(new BuilderElement({
14762
+ attributes: { val: {
14763
+ key: "w:val",
14764
+ value: numRestart
14765
+ } },
14766
+ name: "w:numRestart"
14767
+ }));
14768
+ return container;
14769
+ };
14770
+ /**
14771
+ * Endnote properties container element.
14772
+ */
14773
+ var EndnoteProperties = class extends IgnoreIfEmptyXmlComponent {
14774
+ constructor() {
14775
+ super("w:endnotePr", true);
14776
+ }
14777
+ };
14778
+ //#endregion
13060
14779
  //#region src/file/document/body/section-properties/properties/header-footer-reference.ts
13061
14780
  /**
13062
14781
  * This simple type specifies the possible types of headers and footers which may be specified for a given header or footer reference in a document. This value determines the page(s) on which the current header or footer shall be displayed.
@@ -13419,8 +15138,12 @@
13419
15138
  * });
13420
15139
  * ```
13421
15140
  */
13422
- const createPageNumberType = ({ start, formatType, separator }) => new BuilderElement({
15141
+ const createPageNumberType = ({ start, formatType, separator, chapStyle }) => new BuilderElement({
13423
15142
  attributes: {
15143
+ chapStyle: {
15144
+ key: "w:chapStyle",
15145
+ value: chapStyle === void 0 ? void 0 : decimalNumber(chapStyle)
15146
+ },
13424
15147
  formatType: {
13425
15148
  key: "w:fmt",
13426
15149
  value: formatType
@@ -13709,7 +15432,7 @@
13709
15432
  * ```
13710
15433
  */
13711
15434
  var SectionProperties = class extends XmlComponent {
13712
- constructor({ page: { size: { width = sectionPageSizeDefaults.WIDTH, height = sectionPageSizeDefaults.HEIGHT, orientation = sectionPageSizeDefaults.ORIENTATION } = {}, margin: { top = sectionMarginDefaults.TOP, right = sectionMarginDefaults.RIGHT, bottom = sectionMarginDefaults.BOTTOM, left = sectionMarginDefaults.LEFT, header = sectionMarginDefaults.HEADER, footer = sectionMarginDefaults.FOOTER, gutter = sectionMarginDefaults.GUTTER } = {}, pageNumbers = {}, borders, textDirection } = {}, grid: { linePitch = 360, charSpace, type: gridType } = {}, headerWrapperGroup = {}, footerWrapperGroup = {}, lineNumbers, titlePage, verticalAlign, column, type, revision } = {}) {
15435
+ constructor({ page: { size: { width = sectionPageSizeDefaults.WIDTH, height = sectionPageSizeDefaults.HEIGHT, orientation = sectionPageSizeDefaults.ORIENTATION } = {}, margin: { top = sectionMarginDefaults.TOP, right = sectionMarginDefaults.RIGHT, bottom = sectionMarginDefaults.BOTTOM, left = sectionMarginDefaults.LEFT, header = sectionMarginDefaults.HEADER, footer = sectionMarginDefaults.FOOTER, gutter = sectionMarginDefaults.GUTTER } = {}, pageNumbers = {}, borders, textDirection } = {}, grid: { linePitch = 360, charSpace, type: gridType } = {}, headerWrapperGroup = {}, footerWrapperGroup = {}, lineNumbers, titlePage, verticalAlign, column, type, revision, noEndnote, bidi, rtlGutter, paperSrc, footnotePr, endnotePr } = {}) {
13713
15436
  super("w:sectPr");
13714
15437
  this.addHeaderFooterGroup(HeaderFooterType.HEADER, headerWrapperGroup);
13715
15438
  this.addHeaderFooterGroup(HeaderFooterType.FOOTER, footerWrapperGroup);
@@ -13728,6 +15451,24 @@
13728
15451
  if (titlePage !== void 0) this.root.push(new OnOffElement("w:titlePg", titlePage));
13729
15452
  if (textDirection) this.root.push(new PageTextDirection(textDirection));
13730
15453
  if (revision) this.root.push(new SectionPropertiesChange(revision));
15454
+ if (noEndnote !== void 0) this.root.push(new OnOffElement("w:noEndnote", noEndnote));
15455
+ if (bidi !== void 0) this.root.push(new OnOffElement("w:bidi", bidi));
15456
+ if (rtlGutter !== void 0) this.root.push(new OnOffElement("w:rtlGutter", rtlGutter));
15457
+ if (paperSrc) this.root.push(new BuilderElement({
15458
+ attributes: {
15459
+ first: {
15460
+ key: "w:first",
15461
+ value: paperSrc.first === void 0 ? void 0 : decimalNumber(paperSrc.first)
15462
+ },
15463
+ other: {
15464
+ key: "w:other",
15465
+ value: paperSrc.other === void 0 ? void 0 : decimalNumber(paperSrc.other)
15466
+ }
15467
+ },
15468
+ name: "w:paperSrc"
15469
+ }));
15470
+ if (footnotePr) this.root.push(createFootnoteProperties(footnotePr));
15471
+ if (endnotePr) this.root.push(createEndnoteProperties(endnotePr));
13731
15472
  this.root.push(createDocumentGrid({
13732
15473
  charSpace,
13733
15474
  linePitch,
@@ -23405,12 +25146,14 @@
23405
25146
  exports.TableRow = TableRow;
23406
25147
  exports.TableRowProperties = TableRowProperties;
23407
25148
  exports.TableRowPropertiesChange = TableRowPropertiesChange;
25149
+ exports.TextAlignmentType = TextAlignmentType;
23408
25150
  exports.TextDirection = TextDirection;
23409
25151
  exports.TextEffect = TextEffect;
23410
25152
  exports.TextRun = TextRun;
23411
25153
  exports.TextWrappingSide = TextWrappingSide;
23412
25154
  exports.TextWrappingType = TextWrappingType;
23413
25155
  exports.Textbox = Textbox;
25156
+ exports.TextboxTightWrapType = TextboxTightWrapType;
23414
25157
  exports.ThematicBreak = ThematicBreak;
23415
25158
  exports.ThemeColor = ThemeColor;
23416
25159
  exports.ThemeFont = ThemeFont;