docx-plus 0.0.14 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -1
- package/dist/index.cjs +524 -107
- package/dist/index.d.cts +122 -10
- package/dist/index.d.mts +122 -10
- package/dist/index.iife.js +524 -107
- package/dist/index.mjs +524 -107
- package/dist/index.umd.js +524 -107
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -8922,7 +8922,7 @@ const createHorizontalPosition = ({ relative, align, offset }) => new BuilderEle
|
|
|
8922
8922
|
children: [(() => {
|
|
8923
8923
|
if (align) return createAlign(align);
|
|
8924
8924
|
if (offset !== void 0) return createPositionOffset(offset);
|
|
8925
|
-
return createAlign(
|
|
8925
|
+
return createAlign(HorizontalPositionAlign.LEFT);
|
|
8926
8926
|
})()],
|
|
8927
8927
|
name: "wp:positionH"
|
|
8928
8928
|
});
|
|
@@ -8983,7 +8983,7 @@ const createVerticalPosition = ({ relative, align, offset }) => new BuilderEleme
|
|
|
8983
8983
|
children: [(() => {
|
|
8984
8984
|
if (align) return createAlign(align);
|
|
8985
8985
|
if (offset !== void 0) return createPositionOffset(offset);
|
|
8986
|
-
return createAlign(
|
|
8986
|
+
return createAlign(VerticalPositionAlign.TOP);
|
|
8987
8987
|
})()],
|
|
8988
8988
|
name: "wp:positionV"
|
|
8989
8989
|
});
|
|
@@ -9697,6 +9697,44 @@ const createSolidFill = (options) => new BuilderElement({
|
|
|
9697
9697
|
name: "a:solidFill"
|
|
9698
9698
|
});
|
|
9699
9699
|
//#endregion
|
|
9700
|
+
//#region src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/effects/fill-overlay.ts
|
|
9701
|
+
/**
|
|
9702
|
+
* Fill overlay effect for DrawingML shapes.
|
|
9703
|
+
*
|
|
9704
|
+
* Reference: ISO/IEC 29500-4, dml-main.xsd, CT_FillOverlayEffect
|
|
9705
|
+
*
|
|
9706
|
+
* @module
|
|
9707
|
+
*/
|
|
9708
|
+
/**
|
|
9709
|
+
* Creates a fill overlay effect element.
|
|
9710
|
+
*
|
|
9711
|
+
* ## XSD Schema
|
|
9712
|
+
* ```xml
|
|
9713
|
+
* <xsd:complexType name="CT_FillOverlayEffect">
|
|
9714
|
+
* <xsd:sequence>
|
|
9715
|
+
* <xsd:group ref="EG_FillProperties" minOccurs="1" maxOccurs="1"/>
|
|
9716
|
+
* </xsd:sequence>
|
|
9717
|
+
* <xsd:attribute name="blend" type="ST_BlendMode" use="required"/>
|
|
9718
|
+
* </xsd:complexType>
|
|
9719
|
+
* ```
|
|
9720
|
+
*
|
|
9721
|
+
* @example
|
|
9722
|
+
* ```typescript
|
|
9723
|
+
* const fillOverlay = createFillOverlayEffect({
|
|
9724
|
+
* blend: BlendMode.MULTIPLY,
|
|
9725
|
+
* color: { value: "FF0000" },
|
|
9726
|
+
* });
|
|
9727
|
+
* ```
|
|
9728
|
+
*/
|
|
9729
|
+
const createFillOverlayEffect = (options) => new BuilderElement({
|
|
9730
|
+
attributes: { blend: {
|
|
9731
|
+
key: "blend",
|
|
9732
|
+
value: options.blend
|
|
9733
|
+
} },
|
|
9734
|
+
children: [createSolidFill(options.color)],
|
|
9735
|
+
name: "a:fillOverlay"
|
|
9736
|
+
});
|
|
9737
|
+
//#endregion
|
|
9700
9738
|
//#region src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/effects/glow.ts
|
|
9701
9739
|
/**
|
|
9702
9740
|
* Glow effect for DrawingML shapes.
|
|
@@ -9733,7 +9771,7 @@ const createGlowEffect = (options) => {
|
|
|
9733
9771
|
});
|
|
9734
9772
|
};
|
|
9735
9773
|
//#endregion
|
|
9736
|
-
//#region src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/effects/inner-
|
|
9774
|
+
//#region src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/effects/inner-shadow.ts
|
|
9737
9775
|
/**
|
|
9738
9776
|
* Inner shadow effect for DrawingML shapes.
|
|
9739
9777
|
*
|
|
@@ -9781,7 +9819,7 @@ const createInnerShadowEffect = (options) => {
|
|
|
9781
9819
|
});
|
|
9782
9820
|
};
|
|
9783
9821
|
//#endregion
|
|
9784
|
-
//#region src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/effects/outer-
|
|
9822
|
+
//#region src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/effects/outer-shadow.ts
|
|
9785
9823
|
/**
|
|
9786
9824
|
* Outer shadow effect for DrawingML shapes.
|
|
9787
9825
|
*
|
|
@@ -9869,7 +9907,7 @@ const createOuterShadowEffect = (options) => {
|
|
|
9869
9907
|
});
|
|
9870
9908
|
};
|
|
9871
9909
|
//#endregion
|
|
9872
|
-
//#region src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/effects/
|
|
9910
|
+
//#region src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/effects/preset-shadow.ts
|
|
9873
9911
|
/**
|
|
9874
9912
|
* Preset shadow effect for DrawingML shapes.
|
|
9875
9913
|
*
|
|
@@ -10123,10 +10161,11 @@ const createBlurEffect = (options) => {
|
|
|
10123
10161
|
const createEffectList = (options) => {
|
|
10124
10162
|
const children = [];
|
|
10125
10163
|
if (options.blur) children.push(createBlurEffect(options.blur));
|
|
10164
|
+
if (options.fillOverlay) children.push(createFillOverlayEffect(options.fillOverlay));
|
|
10126
10165
|
if (options.glow) children.push(createGlowEffect(options.glow));
|
|
10127
|
-
if (options.
|
|
10128
|
-
if (options.
|
|
10129
|
-
if (options.
|
|
10166
|
+
if (options.innerShadow) children.push(createInnerShadowEffect(options.innerShadow));
|
|
10167
|
+
if (options.outerShadow) children.push(createOuterShadowEffect(options.outerShadow));
|
|
10168
|
+
if (options.presetShadow) children.push(createPresetShadowEffect(options.presetShadow));
|
|
10130
10169
|
if (options.reflection) children.push(createReflectionEffect(options.reflection === true ? void 0 : options.reflection));
|
|
10131
10170
|
if (options.softEdge !== void 0) children.push(createSoftEdgeEffect(options.softEdge));
|
|
10132
10171
|
return new BuilderElement({
|
|
@@ -10917,12 +10956,12 @@ const createShape3D = (options) => {
|
|
|
10917
10956
|
const children = [];
|
|
10918
10957
|
if (options.bevelT) children.push(createBevel(options.bevelT));
|
|
10919
10958
|
if (options.bevelB) children.push(createBottomBevel(options.bevelB));
|
|
10920
|
-
if (options.
|
|
10921
|
-
children: [createColorElement(options.
|
|
10959
|
+
if (options.extrusionColor) children.push(new BuilderElement({
|
|
10960
|
+
children: [createColorElement(options.extrusionColor)],
|
|
10922
10961
|
name: "a:extrusionClr"
|
|
10923
10962
|
}));
|
|
10924
|
-
if (options.
|
|
10925
|
-
children: [createColorElement(options.
|
|
10963
|
+
if (options.contourColor) children.push(new BuilderElement({
|
|
10964
|
+
children: [createColorElement(options.contourColor)],
|
|
10926
10965
|
name: "a:contourClr"
|
|
10927
10966
|
}));
|
|
10928
10967
|
return new BuilderElement({
|
|
@@ -11108,6 +11147,158 @@ var GraphicDataAttributes = class extends XmlAttributeComponent {
|
|
|
11108
11147
|
}
|
|
11109
11148
|
};
|
|
11110
11149
|
//#endregion
|
|
11150
|
+
//#region src/file/drawing/inline/graphic/graphic-data/pic/blip/blip-effects.ts
|
|
11151
|
+
/**
|
|
11152
|
+
* Blip image adjustment effects for DrawingML.
|
|
11153
|
+
*
|
|
11154
|
+
* These effects are applied directly to the image data within the `<a:blip>` element,
|
|
11155
|
+
* corresponding to Word's "Picture Format > Adjust" features (brightness, contrast,
|
|
11156
|
+
* grayscale, tint, duotone, etc.).
|
|
11157
|
+
*
|
|
11158
|
+
* Reference: ISO/IEC 29500-4, dml-main.xsd, CT_Blip children
|
|
11159
|
+
*
|
|
11160
|
+
* @module
|
|
11161
|
+
*/
|
|
11162
|
+
/**
|
|
11163
|
+
* Creates blip effect elements from BlipEffectsOptions.
|
|
11164
|
+
*
|
|
11165
|
+
* @returns Array of XML components representing blip effects
|
|
11166
|
+
*/
|
|
11167
|
+
const createBlipEffects = (options) => {
|
|
11168
|
+
const children = [];
|
|
11169
|
+
if (options.grayscale) children.push(new BuilderElement({ name: "a:grayscl" }));
|
|
11170
|
+
if (options.luminance) {
|
|
11171
|
+
const attrs = {};
|
|
11172
|
+
if (options.luminance.bright !== void 0) attrs.bright = {
|
|
11173
|
+
key: "bright",
|
|
11174
|
+
value: `${options.luminance.bright}%`
|
|
11175
|
+
};
|
|
11176
|
+
if (options.luminance.contrast !== void 0) attrs.contrast = {
|
|
11177
|
+
key: "contrast",
|
|
11178
|
+
value: `${options.luminance.contrast}%`
|
|
11179
|
+
};
|
|
11180
|
+
children.push(new BuilderElement({
|
|
11181
|
+
attributes: attrs,
|
|
11182
|
+
name: "a:lum"
|
|
11183
|
+
}));
|
|
11184
|
+
}
|
|
11185
|
+
if (options.hsl) {
|
|
11186
|
+
const attrs = {};
|
|
11187
|
+
if (options.hsl.hue !== void 0) attrs.hue = {
|
|
11188
|
+
key: "hue",
|
|
11189
|
+
value: String(options.hsl.hue)
|
|
11190
|
+
};
|
|
11191
|
+
if (options.hsl.sat !== void 0) attrs.sat = {
|
|
11192
|
+
key: "sat",
|
|
11193
|
+
value: `${options.hsl.sat}%`
|
|
11194
|
+
};
|
|
11195
|
+
if (options.hsl.lum !== void 0) attrs.lum = {
|
|
11196
|
+
key: "lum",
|
|
11197
|
+
value: `${options.hsl.lum}%`
|
|
11198
|
+
};
|
|
11199
|
+
children.push(new BuilderElement({
|
|
11200
|
+
attributes: attrs,
|
|
11201
|
+
name: "a:hsl"
|
|
11202
|
+
}));
|
|
11203
|
+
}
|
|
11204
|
+
if (options.tint) {
|
|
11205
|
+
const attrs = {};
|
|
11206
|
+
if (options.tint.hue !== void 0) attrs.hue = {
|
|
11207
|
+
key: "hue",
|
|
11208
|
+
value: String(options.tint.hue)
|
|
11209
|
+
};
|
|
11210
|
+
if (options.tint.amt !== void 0) attrs.amt = {
|
|
11211
|
+
key: "amt",
|
|
11212
|
+
value: `${options.tint.amt}%`
|
|
11213
|
+
};
|
|
11214
|
+
children.push(new BuilderElement({
|
|
11215
|
+
attributes: attrs,
|
|
11216
|
+
name: "a:tint"
|
|
11217
|
+
}));
|
|
11218
|
+
}
|
|
11219
|
+
if (options.duotone) children.push(new BuilderElement({
|
|
11220
|
+
children: [createColorElement(options.duotone.color1), createColorElement(options.duotone.color2)],
|
|
11221
|
+
name: "a:duotone"
|
|
11222
|
+
}));
|
|
11223
|
+
if (options.biLevel) children.push(new BuilderElement({
|
|
11224
|
+
attributes: { thresh: {
|
|
11225
|
+
key: "thresh",
|
|
11226
|
+
value: `${options.biLevel.thresh}%`
|
|
11227
|
+
} },
|
|
11228
|
+
name: "a:biLevel"
|
|
11229
|
+
}));
|
|
11230
|
+
if (options.alphaCeiling) children.push(new BuilderElement({ name: "a:alphaCeiling" }));
|
|
11231
|
+
if (options.alphaFloor) children.push(new BuilderElement({ name: "a:alphaFloor" }));
|
|
11232
|
+
if (options.alphaInverse !== void 0) if (typeof options.alphaInverse === "boolean") children.push(new BuilderElement({ name: "a:alphaInv" }));
|
|
11233
|
+
else children.push(new BuilderElement({
|
|
11234
|
+
children: [createColorElement(options.alphaInverse)],
|
|
11235
|
+
name: "a:alphaInv"
|
|
11236
|
+
}));
|
|
11237
|
+
if (options.alphaModFix) {
|
|
11238
|
+
var _options$alphaModFix$;
|
|
11239
|
+
const amt = (_options$alphaModFix$ = options.alphaModFix.amount) !== null && _options$alphaModFix$ !== void 0 ? _options$alphaModFix$ : 100;
|
|
11240
|
+
children.push(new BuilderElement({
|
|
11241
|
+
attributes: { amt: {
|
|
11242
|
+
key: "amt",
|
|
11243
|
+
value: `${amt}%`
|
|
11244
|
+
} },
|
|
11245
|
+
name: "a:alphaModFix"
|
|
11246
|
+
}));
|
|
11247
|
+
}
|
|
11248
|
+
if (options.alphaRepl) children.push(new BuilderElement({
|
|
11249
|
+
attributes: { a: {
|
|
11250
|
+
key: "a",
|
|
11251
|
+
value: `${options.alphaRepl.amount}%`
|
|
11252
|
+
} },
|
|
11253
|
+
name: "a:alphaRepl"
|
|
11254
|
+
}));
|
|
11255
|
+
if (options.alphaBiLevel) children.push(new BuilderElement({
|
|
11256
|
+
attributes: { thresh: {
|
|
11257
|
+
key: "thresh",
|
|
11258
|
+
value: `${options.alphaBiLevel.thresh}%`
|
|
11259
|
+
} },
|
|
11260
|
+
name: "a:alphaBiLevel"
|
|
11261
|
+
}));
|
|
11262
|
+
if (options.colorChange) {
|
|
11263
|
+
const attrs = {};
|
|
11264
|
+
if (options.colorChange.useAlpha === false) attrs.useA = {
|
|
11265
|
+
key: "useA",
|
|
11266
|
+
value: "0"
|
|
11267
|
+
};
|
|
11268
|
+
children.push(new BuilderElement({
|
|
11269
|
+
attributes: attrs,
|
|
11270
|
+
children: [new BuilderElement({
|
|
11271
|
+
children: [createColorElement(options.colorChange.from)],
|
|
11272
|
+
name: "a:clrFrom"
|
|
11273
|
+
}), new BuilderElement({
|
|
11274
|
+
children: [createColorElement(options.colorChange.to)],
|
|
11275
|
+
name: "a:clrTo"
|
|
11276
|
+
})],
|
|
11277
|
+
name: "a:clrChange"
|
|
11278
|
+
}));
|
|
11279
|
+
}
|
|
11280
|
+
if (options.colorRepl) children.push(new BuilderElement({
|
|
11281
|
+
children: [createColorElement(options.colorRepl.color)],
|
|
11282
|
+
name: "a:clrRepl"
|
|
11283
|
+
}));
|
|
11284
|
+
if (options.blur) {
|
|
11285
|
+
const attrs = {};
|
|
11286
|
+
if (options.blur.rad !== void 0) attrs.rad = {
|
|
11287
|
+
key: "rad",
|
|
11288
|
+
value: options.blur.rad
|
|
11289
|
+
};
|
|
11290
|
+
if (options.blur.grow === false) attrs.grow = {
|
|
11291
|
+
key: "grow",
|
|
11292
|
+
value: 0
|
|
11293
|
+
};
|
|
11294
|
+
children.push(new BuilderElement({
|
|
11295
|
+
attributes: attrs,
|
|
11296
|
+
name: "a:blur"
|
|
11297
|
+
}));
|
|
11298
|
+
}
|
|
11299
|
+
return children;
|
|
11300
|
+
};
|
|
11301
|
+
//#endregion
|
|
11111
11302
|
//#region src/file/drawing/inline/graphic/graphic-data/pic/blip/blip-extentions.ts
|
|
11112
11303
|
/**
|
|
11113
11304
|
* Creates an SVG blip element for embedding SVG images.
|
|
@@ -11217,20 +11408,25 @@ const createExtentionList = (mediaData) => new BuilderElement({
|
|
|
11217
11408
|
* @param mediaData - The media data containing the image information
|
|
11218
11409
|
* @returns An XML component representing the blip element
|
|
11219
11410
|
*/
|
|
11220
|
-
const createBlip = (mediaData) =>
|
|
11221
|
-
|
|
11222
|
-
|
|
11223
|
-
|
|
11224
|
-
|
|
11411
|
+
const createBlip = (mediaData, blipEffects) => {
|
|
11412
|
+
const children = [];
|
|
11413
|
+
if (blipEffects) children.push(...createBlipEffects(blipEffects));
|
|
11414
|
+
if (mediaData.type === "svg") children.push(createExtentionList(mediaData));
|
|
11415
|
+
return new BuilderElement({
|
|
11416
|
+
attributes: {
|
|
11417
|
+
cstate: {
|
|
11418
|
+
key: "cstate",
|
|
11419
|
+
value: "none"
|
|
11420
|
+
},
|
|
11421
|
+
embed: {
|
|
11422
|
+
key: "r:embed",
|
|
11423
|
+
value: `rId{${mediaData.type === "svg" ? mediaData.fallback.fileName : mediaData.fileName}}`
|
|
11424
|
+
}
|
|
11225
11425
|
},
|
|
11226
|
-
|
|
11227
|
-
|
|
11228
|
-
|
|
11229
|
-
|
|
11230
|
-
},
|
|
11231
|
-
children: mediaData.type === "svg" ? [createExtentionList(mediaData)] : [],
|
|
11232
|
-
name: "a:blip"
|
|
11233
|
-
});
|
|
11426
|
+
children,
|
|
11427
|
+
name: "a:blip"
|
|
11428
|
+
});
|
|
11429
|
+
};
|
|
11234
11430
|
//#endregion
|
|
11235
11431
|
//#region src/file/drawing/inline/graphic/graphic-data/pic/blip/source-rectangle.ts
|
|
11236
11432
|
/**
|
|
@@ -11354,6 +11550,106 @@ var Stretch = class extends XmlComponent {
|
|
|
11354
11550
|
}
|
|
11355
11551
|
};
|
|
11356
11552
|
//#endregion
|
|
11553
|
+
//#region src/file/drawing/inline/graphic/graphic-data/pic/blip/tile.ts
|
|
11554
|
+
/**
|
|
11555
|
+
* Tile fill module for blip fills.
|
|
11556
|
+
*
|
|
11557
|
+
* This module defines how images are tiled (repeated) to fill shapes.
|
|
11558
|
+
*
|
|
11559
|
+
* Reference: ISO/IEC 29500-4, dml-main.xsd, CT_TileInfoProperties
|
|
11560
|
+
*
|
|
11561
|
+
* @module
|
|
11562
|
+
*/
|
|
11563
|
+
/**
|
|
11564
|
+
* Tile flip mode for tiling images.
|
|
11565
|
+
*
|
|
11566
|
+
* Specifies whether the image is flipped along the x-axis, y-axis,
|
|
11567
|
+
* both axes, or not at all when tiling.
|
|
11568
|
+
*/
|
|
11569
|
+
const TileFlipMode = {
|
|
11570
|
+
NONE: "none",
|
|
11571
|
+
X: "x",
|
|
11572
|
+
Y: "y",
|
|
11573
|
+
XY: "xy"
|
|
11574
|
+
};
|
|
11575
|
+
/**
|
|
11576
|
+
* Tile alignment within the shape.
|
|
11577
|
+
*
|
|
11578
|
+
* Specifies the anchor position of the first tile relative to the shape.
|
|
11579
|
+
*/
|
|
11580
|
+
const TileAlignment = {
|
|
11581
|
+
TOP_LEFT: "tl",
|
|
11582
|
+
TOP: "t",
|
|
11583
|
+
TOP_RIGHT: "tr",
|
|
11584
|
+
LEFT: "l",
|
|
11585
|
+
CENTER: "ctr",
|
|
11586
|
+
RIGHT: "r",
|
|
11587
|
+
BOTTOM_LEFT: "bl",
|
|
11588
|
+
BOTTOM: "b",
|
|
11589
|
+
BOTTOM_RIGHT: "br"
|
|
11590
|
+
};
|
|
11591
|
+
/**
|
|
11592
|
+
* Creates a tile fill mode element for blip fills.
|
|
11593
|
+
*
|
|
11594
|
+
* When a blip fill uses tile mode, the image is repeated (tiled) to fill
|
|
11595
|
+
* the shape instead of being stretched. This element controls the tiling
|
|
11596
|
+
* parameters such as offset, scale, flip, and alignment.
|
|
11597
|
+
*
|
|
11598
|
+
* Reference: ISO/IEC 29500-4, dml-main.xsd, CT_TileInfoProperties
|
|
11599
|
+
*
|
|
11600
|
+
* ## XSD Schema
|
|
11601
|
+
* ```xml
|
|
11602
|
+
* <xsd:complexType name="CT_TileInfoProperties">
|
|
11603
|
+
* <xsd:attribute name="tx" type="ST_Coordinate" use="optional"/>
|
|
11604
|
+
* <xsd:attribute name="ty" type="ST_Coordinate" use="optional"/>
|
|
11605
|
+
* <xsd:attribute name="sx" type="ST_Percentage" use="optional"/>
|
|
11606
|
+
* <xsd:attribute name="sy" type="ST_Percentage" use="optional"/>
|
|
11607
|
+
* <xsd:attribute name="flip" type="ST_TileFlipMode" default="none"/>
|
|
11608
|
+
* <xsd:attribute name="algn" type="ST_RectAlignment" use="optional"/>
|
|
11609
|
+
* </xsd:complexType>
|
|
11610
|
+
* ```
|
|
11611
|
+
*
|
|
11612
|
+
* @example
|
|
11613
|
+
* ```typescript
|
|
11614
|
+
* // Tile with 50% scale
|
|
11615
|
+
* createTileInfo({ sx: 50, sy: 50 });
|
|
11616
|
+
* // Tile with flip and alignment
|
|
11617
|
+
* createTileInfo({ flip: "XY", align: "CENTER" });
|
|
11618
|
+
* ```
|
|
11619
|
+
*/
|
|
11620
|
+
const createTileInfo = (options) => {
|
|
11621
|
+
if (!options) return new BuilderElement({ name: "a:tile" });
|
|
11622
|
+
const attributes = {};
|
|
11623
|
+
if (options.tx !== void 0) attributes.tx = {
|
|
11624
|
+
key: "tx",
|
|
11625
|
+
value: options.tx
|
|
11626
|
+
};
|
|
11627
|
+
if (options.ty !== void 0) attributes.ty = {
|
|
11628
|
+
key: "ty",
|
|
11629
|
+
value: options.ty
|
|
11630
|
+
};
|
|
11631
|
+
if (options.sx !== void 0) attributes.sx = {
|
|
11632
|
+
key: "sx",
|
|
11633
|
+
value: options.sx
|
|
11634
|
+
};
|
|
11635
|
+
if (options.sy !== void 0) attributes.sy = {
|
|
11636
|
+
key: "sy",
|
|
11637
|
+
value: options.sy
|
|
11638
|
+
};
|
|
11639
|
+
if (options.flip !== void 0) attributes.flip = {
|
|
11640
|
+
key: "flip",
|
|
11641
|
+
value: TileFlipMode[options.flip]
|
|
11642
|
+
};
|
|
11643
|
+
if (options.align !== void 0) attributes.algn = {
|
|
11644
|
+
key: "algn",
|
|
11645
|
+
value: TileAlignment[options.align]
|
|
11646
|
+
};
|
|
11647
|
+
return new BuilderElement({
|
|
11648
|
+
attributes: Object.keys(attributes).length > 0 ? attributes : void 0,
|
|
11649
|
+
name: "a:tile"
|
|
11650
|
+
});
|
|
11651
|
+
};
|
|
11652
|
+
//#endregion
|
|
11357
11653
|
//#region src/file/drawing/inline/graphic/graphic-data/pic/blip/blip-fill.ts
|
|
11358
11654
|
/**
|
|
11359
11655
|
* Represents a blip fill for pictures in DrawingML.
|
|
@@ -11382,12 +11678,48 @@ var Stretch = class extends XmlComponent {
|
|
|
11382
11678
|
* // If mediaData.srcRect is set, cropping is applied
|
|
11383
11679
|
* ```
|
|
11384
11680
|
*/
|
|
11385
|
-
|
|
11386
|
-
|
|
11387
|
-
|
|
11388
|
-
|
|
11389
|
-
|
|
11390
|
-
|
|
11681
|
+
const createBlipFill = (mediaData, options) => {
|
|
11682
|
+
const children = [];
|
|
11683
|
+
children.push(createBlip(mediaData, options === null || options === void 0 ? void 0 : options.blipEffects));
|
|
11684
|
+
children.push(createSourceRectangle(mediaData.srcRect));
|
|
11685
|
+
if (options === null || options === void 0 ? void 0 : options.tile) children.push(createTileInfo(options.tile));
|
|
11686
|
+
else children.push(new Stretch());
|
|
11687
|
+
const attributes = {};
|
|
11688
|
+
if ((options === null || options === void 0 ? void 0 : options.dpi) !== void 0) attributes.dpi = {
|
|
11689
|
+
key: "dpi",
|
|
11690
|
+
value: options.dpi
|
|
11691
|
+
};
|
|
11692
|
+
if ((options === null || options === void 0 ? void 0 : options.rotWithShape) !== void 0) attributes.rotWithShape = {
|
|
11693
|
+
key: "rotWithShape",
|
|
11694
|
+
value: options.rotWithShape ? 1 : 0
|
|
11695
|
+
};
|
|
11696
|
+
return new BuilderElement({
|
|
11697
|
+
attributes: Object.keys(attributes).length > 0 ? attributes : void 0,
|
|
11698
|
+
children,
|
|
11699
|
+
name: "pic:blipFill"
|
|
11700
|
+
});
|
|
11701
|
+
};
|
|
11702
|
+
//#endregion
|
|
11703
|
+
//#region src/file/drawing/inline/graphic/graphic-data/pic/non-visual-pic-properties/child-non-visual-pic-properties/child-non-visual-pic-properties-attributes.ts
|
|
11704
|
+
/**
|
|
11705
|
+
* Attributes for non-visual picture properties.
|
|
11706
|
+
*
|
|
11707
|
+
* @module
|
|
11708
|
+
*/
|
|
11709
|
+
/**
|
|
11710
|
+
* Attributes for CT_NonVisualPictureProperties.
|
|
11711
|
+
*
|
|
11712
|
+
* ## XSD Schema
|
|
11713
|
+
* ```xml
|
|
11714
|
+
* <xsd:attribute name="preferRelativeResize" type="xsd:boolean" use="optional" default="true"/>
|
|
11715
|
+
* ```
|
|
11716
|
+
*
|
|
11717
|
+
* @internal
|
|
11718
|
+
*/
|
|
11719
|
+
var ChildNonVisualPropertiesAttributes = class extends XmlAttributeComponent {
|
|
11720
|
+
constructor(..._args) {
|
|
11721
|
+
super(..._args);
|
|
11722
|
+
_defineProperty(this, "xmlKeys", { preferRelativeResize: "preferRelativeResize" });
|
|
11391
11723
|
}
|
|
11392
11724
|
};
|
|
11393
11725
|
//#endregion
|
|
@@ -11512,6 +11844,7 @@ var PicLocks = class extends XmlComponent {
|
|
|
11512
11844
|
var ChildNonVisualProperties = class extends XmlComponent {
|
|
11513
11845
|
constructor() {
|
|
11514
11846
|
super("pic:cNvPicPr");
|
|
11847
|
+
this.root.push(new ChildNonVisualPropertiesAttributes({ preferRelativeResize: true }));
|
|
11515
11848
|
this.root.push(new PicLocks());
|
|
11516
11849
|
}
|
|
11517
11850
|
};
|
|
@@ -11560,6 +11893,85 @@ const createHyperlinkClick = (linkId, hasXmlNs) => new BuilderElement({
|
|
|
11560
11893
|
},
|
|
11561
11894
|
name: "a:hlinkClick"
|
|
11562
11895
|
});
|
|
11896
|
+
/**
|
|
11897
|
+
* Creates a hover hyperlink element for a drawing.
|
|
11898
|
+
*
|
|
11899
|
+
* This element defines what happens when a user hovers over a drawing element.
|
|
11900
|
+
*
|
|
11901
|
+
* ## XSD Schema
|
|
11902
|
+
* ```xml
|
|
11903
|
+
* <xsd:complexType name="CT_Hyperlink">
|
|
11904
|
+
* <xsd:group ref="EG_PContent" minOccurs="0" maxOccurs="unbounded"/>
|
|
11905
|
+
* <xsd:attribute name="tgtFrame" type="s:ST_String"/>
|
|
11906
|
+
* <xsd:attribute name="tooltip" type="s:ST_String"/>
|
|
11907
|
+
* <xsd:attribute name="docLocation" type="s:ST_String"/>
|
|
11908
|
+
* <xsd:attribute name="history" type="s:ST_OnOff"/>
|
|
11909
|
+
* <xsd:attribute name="anchor" type="s:ST_String"/>
|
|
11910
|
+
* <xsd:attribute ref="r:id"/>
|
|
11911
|
+
* </xsd:complexType>
|
|
11912
|
+
* ```
|
|
11913
|
+
*
|
|
11914
|
+
* @param linkId - The relationship ID for the hyperlink target
|
|
11915
|
+
* @param hasXmlNs - Whether to include the XML namespace declaration
|
|
11916
|
+
* @returns An XML component representing the hover hyperlink
|
|
11917
|
+
*/
|
|
11918
|
+
const createHyperlinkHover = (linkId, hasXmlNs) => new BuilderElement({
|
|
11919
|
+
attributes: {
|
|
11920
|
+
...hasXmlNs ? { xmlns: {
|
|
11921
|
+
key: "xmlns:a",
|
|
11922
|
+
value: "http://schemas.openxmlformats.org/drawingml/2006/main"
|
|
11923
|
+
} } : {},
|
|
11924
|
+
id: {
|
|
11925
|
+
key: "r:id",
|
|
11926
|
+
value: `rId${linkId}`
|
|
11927
|
+
}
|
|
11928
|
+
},
|
|
11929
|
+
name: "a:hlinkHover"
|
|
11930
|
+
});
|
|
11931
|
+
//#endregion
|
|
11932
|
+
//#region src/file/relationships/relationship/relationship.ts
|
|
11933
|
+
/**
|
|
11934
|
+
* Target mode types for relationships.
|
|
11935
|
+
*
|
|
11936
|
+
* Indicates whether a relationship target is external to the package.
|
|
11937
|
+
*/
|
|
11938
|
+
const TargetModeType = { EXTERNAL: "External" };
|
|
11939
|
+
/**
|
|
11940
|
+
* Creates a single relationship between parts in an OPC package.
|
|
11941
|
+
*
|
|
11942
|
+
* A relationship defines a typed connection from a source part to a target part,
|
|
11943
|
+
* identified by a unique ID within the relationships collection.
|
|
11944
|
+
*
|
|
11945
|
+
* @example
|
|
11946
|
+
* ```typescript
|
|
11947
|
+
* // Internal relationship to an image
|
|
11948
|
+
* createRelationship("rId1", "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image", "media/image1.png");
|
|
11949
|
+
*
|
|
11950
|
+
* // External relationship to a hyperlink
|
|
11951
|
+
* createRelationship("rId2", "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink", "https://example.com", TargetModeType.EXTERNAL);
|
|
11952
|
+
* ```
|
|
11953
|
+
*/
|
|
11954
|
+
const createRelationship = (id, type, target, targetMode) => new BuilderElement({
|
|
11955
|
+
attributes: {
|
|
11956
|
+
id: {
|
|
11957
|
+
key: "Id",
|
|
11958
|
+
value: id
|
|
11959
|
+
},
|
|
11960
|
+
target: {
|
|
11961
|
+
key: "Target",
|
|
11962
|
+
value: target
|
|
11963
|
+
},
|
|
11964
|
+
targetMode: {
|
|
11965
|
+
key: "TargetMode",
|
|
11966
|
+
value: targetMode
|
|
11967
|
+
},
|
|
11968
|
+
type: {
|
|
11969
|
+
key: "Type",
|
|
11970
|
+
value: type
|
|
11971
|
+
}
|
|
11972
|
+
},
|
|
11973
|
+
name: "Relationship"
|
|
11974
|
+
});
|
|
11563
11975
|
//#endregion
|
|
11564
11976
|
//#region src/file/drawing/inline/graphic/graphic-data/pic/non-visual-pic-properties/non-visual-properties/non-visual-properties-attributes.ts
|
|
11565
11977
|
/**
|
|
@@ -11589,16 +12001,7 @@ var NonVisualPropertiesAttributes = class extends XmlAttributeComponent {
|
|
|
11589
12001
|
};
|
|
11590
12002
|
//#endregion
|
|
11591
12003
|
//#region src/file/drawing/inline/graphic/graphic-data/pic/non-visual-pic-properties/non-visual-properties/non-visual-properties.ts
|
|
11592
|
-
|
|
11593
|
-
* Non-visual drawing properties module.
|
|
11594
|
-
*
|
|
11595
|
-
* This module provides basic metadata for drawing elements including
|
|
11596
|
-
* ID, name, description, and hyperlink support.
|
|
11597
|
-
*
|
|
11598
|
-
* Reference: http://officeopenxml.com/drwPic.php
|
|
11599
|
-
*
|
|
11600
|
-
* @module
|
|
11601
|
-
*/
|
|
12004
|
+
const HYPERLINK_RELATIONSHIP_TYPE$1 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink";
|
|
11602
12005
|
/**
|
|
11603
12006
|
* Represents non-visual drawing properties for pictures.
|
|
11604
12007
|
*
|
|
@@ -11629,8 +12032,10 @@ var NonVisualPropertiesAttributes = class extends XmlAttributeComponent {
|
|
|
11629
12032
|
* ```
|
|
11630
12033
|
*/
|
|
11631
12034
|
var NonVisualProperties = class extends XmlComponent {
|
|
11632
|
-
constructor() {
|
|
12035
|
+
constructor(hyperlink) {
|
|
11633
12036
|
super("pic:cNvPr");
|
|
12037
|
+
_defineProperty(this, "hyperlink", void 0);
|
|
12038
|
+
this.hyperlink = hyperlink;
|
|
11634
12039
|
this.root.push(new NonVisualPropertiesAttributes({
|
|
11635
12040
|
descr: "",
|
|
11636
12041
|
id: 0,
|
|
@@ -11638,28 +12043,32 @@ var NonVisualProperties = class extends XmlComponent {
|
|
|
11638
12043
|
}));
|
|
11639
12044
|
}
|
|
11640
12045
|
prepForXml(context) {
|
|
12046
|
+
let hasStackClick = false;
|
|
11641
12047
|
for (let i = context.stack.length - 1; i >= 0; i--) {
|
|
11642
12048
|
const element = context.stack[i];
|
|
11643
12049
|
if (!(element instanceof ConcreteHyperlink)) continue;
|
|
11644
12050
|
this.root.push(createHyperlinkClick(element.linkId, false));
|
|
12051
|
+
hasStackClick = true;
|
|
11645
12052
|
break;
|
|
11646
12053
|
}
|
|
12054
|
+
if (this.hyperlink) {
|
|
12055
|
+
if (this.hyperlink.click && !hasStackClick) {
|
|
12056
|
+
const linkId = uniqueId();
|
|
12057
|
+
context.viewWrapper.Relationships.addRelationship(linkId, HYPERLINK_RELATIONSHIP_TYPE$1, this.hyperlink.click, TargetModeType.EXTERNAL);
|
|
12058
|
+
this.root.push(createHyperlinkClick(linkId, false));
|
|
12059
|
+
}
|
|
12060
|
+
if (this.hyperlink.hover) {
|
|
12061
|
+
const linkId = uniqueId();
|
|
12062
|
+
context.viewWrapper.Relationships.addRelationship(linkId, HYPERLINK_RELATIONSHIP_TYPE$1, this.hyperlink.hover, TargetModeType.EXTERNAL);
|
|
12063
|
+
this.root.push(createHyperlinkHover(linkId, false));
|
|
12064
|
+
}
|
|
12065
|
+
}
|
|
11647
12066
|
return super.prepForXml(context);
|
|
11648
12067
|
}
|
|
11649
12068
|
};
|
|
11650
12069
|
//#endregion
|
|
11651
12070
|
//#region src/file/drawing/inline/graphic/graphic-data/pic/non-visual-pic-properties/non-visual-pic-properties.ts
|
|
11652
12071
|
/**
|
|
11653
|
-
* Non-visual picture properties module.
|
|
11654
|
-
*
|
|
11655
|
-
* This module provides metadata and locking settings for pictures
|
|
11656
|
-
* that don't affect their visual appearance.
|
|
11657
|
-
*
|
|
11658
|
-
* Reference: http://officeopenxml.com/drwPic.php
|
|
11659
|
-
*
|
|
11660
|
-
* @module
|
|
11661
|
-
*/
|
|
11662
|
-
/**
|
|
11663
12072
|
* Represents non-visual picture properties.
|
|
11664
12073
|
*
|
|
11665
12074
|
* This element specifies non-visual properties for a picture. These properties
|
|
@@ -11684,9 +12093,9 @@ var NonVisualProperties = class extends XmlComponent {
|
|
|
11684
12093
|
* ```
|
|
11685
12094
|
*/
|
|
11686
12095
|
var NonVisualPicProperties = class extends XmlComponent {
|
|
11687
|
-
constructor() {
|
|
12096
|
+
constructor(hyperlink) {
|
|
11688
12097
|
super("pic:nvPicPr");
|
|
11689
|
-
this.root.push(new NonVisualProperties());
|
|
12098
|
+
this.root.push(new NonVisualProperties(hyperlink));
|
|
11690
12099
|
this.root.push(new ChildNonVisualProperties());
|
|
11691
12100
|
}
|
|
11692
12101
|
};
|
|
@@ -11743,14 +12152,19 @@ var PicAttributes = class extends XmlAttributeComponent {
|
|
|
11743
12152
|
* ```
|
|
11744
12153
|
*/
|
|
11745
12154
|
var Pic = class extends XmlComponent {
|
|
11746
|
-
constructor({ mediaData, transform, outline }) {
|
|
12155
|
+
constructor({ mediaData, transform, outline, solidFill, effects, blipEffects, tile, hyperlink }) {
|
|
11747
12156
|
super("pic:pic");
|
|
11748
12157
|
this.root.push(new PicAttributes({ xmlns: "http://schemas.openxmlformats.org/drawingml/2006/picture" }));
|
|
11749
|
-
this.root.push(new NonVisualPicProperties());
|
|
11750
|
-
this.root.push(
|
|
12158
|
+
this.root.push(new NonVisualPicProperties(hyperlink));
|
|
12159
|
+
this.root.push(createBlipFill(mediaData, {
|
|
12160
|
+
blipEffects,
|
|
12161
|
+
tile
|
|
12162
|
+
}));
|
|
11751
12163
|
this.root.push(new ShapeProperties({
|
|
11752
12164
|
element: "pic",
|
|
12165
|
+
effects,
|
|
11753
12166
|
outline,
|
|
12167
|
+
solidFill,
|
|
11754
12168
|
transform
|
|
11755
12169
|
}));
|
|
11756
12170
|
}
|
|
@@ -11876,7 +12290,7 @@ const createWpgGroup = (options) => new BuilderElement({
|
|
|
11876
12290
|
* ```
|
|
11877
12291
|
*/
|
|
11878
12292
|
var GraphicData = class extends XmlComponent {
|
|
11879
|
-
constructor({ mediaData, transform, outline, solidFill }) {
|
|
12293
|
+
constructor({ mediaData, transform, outline, solidFill, effects, blipEffects, tile, hyperlink }) {
|
|
11880
12294
|
super("a:graphicData");
|
|
11881
12295
|
if (mediaData.type === "wps") {
|
|
11882
12296
|
this.root.push(new GraphicDataAttributes({ uri: "http://schemas.microsoft.com/office/word/2010/wordprocessingShape" }));
|
|
@@ -11914,8 +12328,13 @@ var GraphicData = class extends XmlComponent {
|
|
|
11914
12328
|
} else {
|
|
11915
12329
|
this.root.push(new GraphicDataAttributes({ uri: "http://schemas.openxmlformats.org/drawingml/2006/picture" }));
|
|
11916
12330
|
const pic = new Pic({
|
|
12331
|
+
blipEffects,
|
|
12332
|
+
effects,
|
|
12333
|
+
hyperlink,
|
|
11917
12334
|
mediaData,
|
|
11918
12335
|
outline,
|
|
12336
|
+
solidFill,
|
|
12337
|
+
tile,
|
|
11919
12338
|
transform
|
|
11920
12339
|
});
|
|
11921
12340
|
this.root.push(pic);
|
|
@@ -11961,14 +12380,18 @@ var GraphicAttributes = class extends XmlAttributeComponent {
|
|
|
11961
12380
|
* ```
|
|
11962
12381
|
*/
|
|
11963
12382
|
var Graphic = class extends XmlComponent {
|
|
11964
|
-
constructor({ mediaData, transform, outline, solidFill }) {
|
|
12383
|
+
constructor({ mediaData, transform, outline, solidFill, effects, blipEffects, tile, hyperlink }) {
|
|
11965
12384
|
super("a:graphic");
|
|
11966
12385
|
_defineProperty(this, "data", void 0);
|
|
11967
12386
|
this.root.push(new GraphicAttributes({ a: "http://schemas.openxmlformats.org/drawingml/2006/main" }));
|
|
11968
12387
|
this.data = new GraphicData({
|
|
12388
|
+
blipEffects,
|
|
12389
|
+
effects,
|
|
12390
|
+
hyperlink,
|
|
11969
12391
|
mediaData,
|
|
11970
12392
|
outline,
|
|
11971
12393
|
solidFill,
|
|
12394
|
+
tile,
|
|
11972
12395
|
transform
|
|
11973
12396
|
});
|
|
11974
12397
|
this.root.push(this.data);
|
|
@@ -12190,12 +12613,13 @@ const createWrapTopAndBottom = (margins = {
|
|
|
12190
12613
|
* Document Properties module for DrawingML elements.
|
|
12191
12614
|
*
|
|
12192
12615
|
* This module provides non-visual properties for drawing elements,
|
|
12193
|
-
* including name, description,
|
|
12616
|
+
* including name, description, accessibility information, and hyperlinks.
|
|
12194
12617
|
*
|
|
12195
12618
|
* Reference: https://c-rex.net/projects/samples/ooxml/e1/Part4/OOXML_P4_DOCX_docPr_topic_ID0ES32OB.html
|
|
12196
12619
|
*
|
|
12197
12620
|
* @module
|
|
12198
12621
|
*/
|
|
12622
|
+
const HYPERLINK_RELATIONSHIP_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink";
|
|
12199
12623
|
/**
|
|
12200
12624
|
* Represents non-visual drawing properties in a WordprocessingML document.
|
|
12201
12625
|
*
|
|
@@ -12220,13 +12644,15 @@ const createWrapTopAndBottom = (margins = {
|
|
|
12220
12644
|
* ```
|
|
12221
12645
|
*/
|
|
12222
12646
|
var DocProperties = class extends XmlComponent {
|
|
12223
|
-
constructor({ name, description, title, id } = {
|
|
12647
|
+
constructor({ name, description, title, id, hyperlink } = {
|
|
12224
12648
|
description: "",
|
|
12225
12649
|
name: "",
|
|
12226
12650
|
title: ""
|
|
12227
12651
|
}) {
|
|
12228
12652
|
super("wp:docPr");
|
|
12229
12653
|
_defineProperty(this, "docPropertiesUniqueNumericId", docPropertiesUniqueNumericIdGen());
|
|
12654
|
+
_defineProperty(this, "hyperlink", void 0);
|
|
12655
|
+
this.hyperlink = hyperlink;
|
|
12230
12656
|
const attributes = {
|
|
12231
12657
|
id: {
|
|
12232
12658
|
key: "id",
|
|
@@ -12248,12 +12674,26 @@ var DocProperties = class extends XmlComponent {
|
|
|
12248
12674
|
this.root.push(new NextAttributeComponent(attributes));
|
|
12249
12675
|
}
|
|
12250
12676
|
prepForXml(context) {
|
|
12677
|
+
let hasStackClick = false;
|
|
12251
12678
|
for (let i = context.stack.length - 1; i >= 0; i--) {
|
|
12252
12679
|
const element = context.stack[i];
|
|
12253
12680
|
if (!(element instanceof ConcreteHyperlink)) continue;
|
|
12254
12681
|
this.root.push(createHyperlinkClick(element.linkId, true));
|
|
12682
|
+
hasStackClick = true;
|
|
12255
12683
|
break;
|
|
12256
12684
|
}
|
|
12685
|
+
if (this.hyperlink) {
|
|
12686
|
+
if (this.hyperlink.click && !hasStackClick) {
|
|
12687
|
+
const linkId = uniqueId();
|
|
12688
|
+
context.viewWrapper.Relationships.addRelationship(linkId, HYPERLINK_RELATIONSHIP_TYPE, this.hyperlink.click, TargetModeType.EXTERNAL);
|
|
12689
|
+
this.root.push(createHyperlinkClick(linkId, true));
|
|
12690
|
+
}
|
|
12691
|
+
if (this.hyperlink.hover) {
|
|
12692
|
+
const linkId = uniqueId();
|
|
12693
|
+
context.viewWrapper.Relationships.addRelationship(linkId, HYPERLINK_RELATIONSHIP_TYPE, this.hyperlink.hover, TargetModeType.EXTERNAL);
|
|
12694
|
+
this.root.push(createHyperlinkHover(linkId, true));
|
|
12695
|
+
}
|
|
12696
|
+
}
|
|
12257
12697
|
return super.prepForXml(context);
|
|
12258
12698
|
}
|
|
12259
12699
|
};
|
|
@@ -12529,6 +12969,7 @@ var AnchorAttributes = class extends XmlAttributeComponent {
|
|
|
12529
12969
|
*/
|
|
12530
12970
|
var Anchor = class extends XmlComponent {
|
|
12531
12971
|
constructor({ mediaData, transform, drawingOptions }) {
|
|
12972
|
+
var _drawingOptions$docPr;
|
|
12532
12973
|
super("wp:anchor");
|
|
12533
12974
|
const floating = {
|
|
12534
12975
|
allowOverlap: true,
|
|
@@ -12581,16 +13022,20 @@ var Anchor = class extends XmlComponent {
|
|
|
12581
13022
|
this.root.push(new DocProperties(drawingOptions.docProperties));
|
|
12582
13023
|
this.root.push(createGraphicFrameProperties());
|
|
12583
13024
|
this.root.push(new Graphic({
|
|
13025
|
+
blipEffects: drawingOptions.blipEffects,
|
|
13026
|
+
effects: drawingOptions.effects,
|
|
13027
|
+
hyperlink: (_drawingOptions$docPr = drawingOptions.docProperties) === null || _drawingOptions$docPr === void 0 ? void 0 : _drawingOptions$docPr.hyperlink,
|
|
12584
13028
|
mediaData,
|
|
12585
13029
|
outline: drawingOptions.outline,
|
|
12586
13030
|
solidFill: drawingOptions.solidFill,
|
|
13031
|
+
tile: drawingOptions.tile,
|
|
12587
13032
|
transform
|
|
12588
13033
|
}));
|
|
12589
13034
|
}
|
|
12590
13035
|
};
|
|
12591
13036
|
//#endregion
|
|
12592
13037
|
//#region src/file/drawing/inline/inline.ts
|
|
12593
|
-
const createInline = ({ mediaData, transform, docProperties, outline, solidFill }) => {
|
|
13038
|
+
const createInline = ({ mediaData, transform, docProperties, outline, solidFill, effects, blipEffects, tile }) => {
|
|
12594
13039
|
var _outline$width, _outline$width2, _outline$width3, _outline$width4;
|
|
12595
13040
|
return new BuilderElement({
|
|
12596
13041
|
attributes: {
|
|
@@ -12630,9 +13075,13 @@ const createInline = ({ mediaData, transform, docProperties, outline, solidFill
|
|
|
12630
13075
|
new DocProperties(docProperties),
|
|
12631
13076
|
createGraphicFrameProperties(),
|
|
12632
13077
|
new Graphic({
|
|
13078
|
+
blipEffects,
|
|
13079
|
+
effects,
|
|
13080
|
+
hyperlink: docProperties === null || docProperties === void 0 ? void 0 : docProperties.hyperlink,
|
|
12633
13081
|
mediaData,
|
|
12634
13082
|
outline,
|
|
12635
13083
|
solidFill,
|
|
13084
|
+
tile,
|
|
12636
13085
|
transform
|
|
12637
13086
|
})
|
|
12638
13087
|
],
|
|
@@ -12663,10 +13112,13 @@ var Drawing = class extends XmlComponent {
|
|
|
12663
13112
|
constructor(imageData, drawingOptions = {}) {
|
|
12664
13113
|
super("w:drawing");
|
|
12665
13114
|
if (!drawingOptions.floating) this.root.push(createInline({
|
|
13115
|
+
blipEffects: drawingOptions.blipEffects,
|
|
12666
13116
|
docProperties: drawingOptions.docProperties,
|
|
13117
|
+
effects: drawingOptions.effects,
|
|
12667
13118
|
mediaData: imageData,
|
|
12668
13119
|
outline: drawingOptions.outline,
|
|
12669
13120
|
solidFill: drawingOptions.solidFill,
|
|
13121
|
+
tile: drawingOptions.tile,
|
|
12670
13122
|
transform: imageData.transformation
|
|
12671
13123
|
}));
|
|
12672
13124
|
else this.root.push(new Anchor({
|
|
@@ -12812,9 +13264,13 @@ var ImageRun = class extends Run {
|
|
|
12812
13264
|
...createImageData(rawData, options.transformation, key, options.srcRect)
|
|
12813
13265
|
};
|
|
12814
13266
|
const drawing = new Drawing(this.imageData, {
|
|
13267
|
+
blipEffects: options.blipEffects,
|
|
12815
13268
|
docProperties: options.altText,
|
|
12816
13269
|
floating: options.floating,
|
|
12817
|
-
outline: options.outline
|
|
13270
|
+
outline: options.outline,
|
|
13271
|
+
solidFill: options.solidFill,
|
|
13272
|
+
effects: options.effects,
|
|
13273
|
+
tile: options.tile
|
|
12818
13274
|
});
|
|
12819
13275
|
this.root.push(drawing);
|
|
12820
13276
|
}
|
|
@@ -13068,50 +13524,6 @@ var RelationshipsAttributes = class extends XmlAttributeComponent {
|
|
|
13068
13524
|
}
|
|
13069
13525
|
};
|
|
13070
13526
|
//#endregion
|
|
13071
|
-
//#region src/file/relationships/relationship/relationship.ts
|
|
13072
|
-
/**
|
|
13073
|
-
* Target mode types for relationships.
|
|
13074
|
-
*
|
|
13075
|
-
* Indicates whether a relationship target is external to the package.
|
|
13076
|
-
*/
|
|
13077
|
-
const TargetModeType = { EXTERNAL: "External" };
|
|
13078
|
-
/**
|
|
13079
|
-
* Creates a single relationship between parts in an OPC package.
|
|
13080
|
-
*
|
|
13081
|
-
* A relationship defines a typed connection from a source part to a target part,
|
|
13082
|
-
* identified by a unique ID within the relationships collection.
|
|
13083
|
-
*
|
|
13084
|
-
* @example
|
|
13085
|
-
* ```typescript
|
|
13086
|
-
* // Internal relationship to an image
|
|
13087
|
-
* createRelationship("rId1", "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image", "media/image1.png");
|
|
13088
|
-
*
|
|
13089
|
-
* // External relationship to a hyperlink
|
|
13090
|
-
* createRelationship("rId2", "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink", "https://example.com", TargetModeType.EXTERNAL);
|
|
13091
|
-
* ```
|
|
13092
|
-
*/
|
|
13093
|
-
const createRelationship = (id, type, target, targetMode) => new BuilderElement({
|
|
13094
|
-
attributes: {
|
|
13095
|
-
id: {
|
|
13096
|
-
key: "Id",
|
|
13097
|
-
value: id
|
|
13098
|
-
},
|
|
13099
|
-
target: {
|
|
13100
|
-
key: "Target",
|
|
13101
|
-
value: target
|
|
13102
|
-
},
|
|
13103
|
-
targetMode: {
|
|
13104
|
-
key: "TargetMode",
|
|
13105
|
-
value: targetMode
|
|
13106
|
-
},
|
|
13107
|
-
type: {
|
|
13108
|
-
key: "Type",
|
|
13109
|
-
value: type
|
|
13110
|
-
}
|
|
13111
|
-
},
|
|
13112
|
-
name: "Relationship"
|
|
13113
|
-
});
|
|
13114
|
-
//#endregion
|
|
13115
13527
|
//#region src/file/relationships/relationships.ts
|
|
13116
13528
|
/**
|
|
13117
13529
|
* Relationships module for Open Packaging Conventions.
|
|
@@ -19415,6 +19827,11 @@ var ContentTypes = class extends XmlComponent {
|
|
|
19415
19827
|
this.root.push(createDefault("image/jpeg", "jpg"));
|
|
19416
19828
|
this.root.push(createDefault("image/bmp", "bmp"));
|
|
19417
19829
|
this.root.push(createDefault("image/gif", "gif"));
|
|
19830
|
+
this.root.push(createDefault("image/tiff", "tif"));
|
|
19831
|
+
this.root.push(createDefault("image/tiff", "tiff"));
|
|
19832
|
+
this.root.push(createDefault("image/x-emf", "emf"));
|
|
19833
|
+
this.root.push(createDefault("image/x-wmf", "wmf"));
|
|
19834
|
+
this.root.push(createDefault("image/x-icon", "ico"));
|
|
19418
19835
|
this.root.push(createDefault("image/svg+xml", "svg"));
|
|
19419
19836
|
this.root.push(createDefault("application/vnd.openxmlformats-package.relationships+xml", "rels"));
|
|
19420
19837
|
this.root.push(createDefault("application/xml", "xml"));
|