docx-plus 0.0.14 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -1
- package/dist/index.cjs +519 -107
- package/dist/index.d.cts +120 -8
- package/dist/index.d.mts +120 -8
- package/dist/index.iife.js +519 -107
- package/dist/index.mjs +519 -107
- package/dist/index.umd.js +519 -107
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -8927,7 +8927,7 @@
|
|
|
8927
8927
|
children: [(() => {
|
|
8928
8928
|
if (align) return createAlign(align);
|
|
8929
8929
|
if (offset !== void 0) return createPositionOffset(offset);
|
|
8930
|
-
return createAlign(
|
|
8930
|
+
return createAlign(HorizontalPositionAlign.LEFT);
|
|
8931
8931
|
})()],
|
|
8932
8932
|
name: "wp:positionH"
|
|
8933
8933
|
});
|
|
@@ -8988,7 +8988,7 @@
|
|
|
8988
8988
|
children: [(() => {
|
|
8989
8989
|
if (align) return createAlign(align);
|
|
8990
8990
|
if (offset !== void 0) return createPositionOffset(offset);
|
|
8991
|
-
return createAlign(
|
|
8991
|
+
return createAlign(VerticalPositionAlign.TOP);
|
|
8992
8992
|
})()],
|
|
8993
8993
|
name: "wp:positionV"
|
|
8994
8994
|
});
|
|
@@ -9702,6 +9702,44 @@
|
|
|
9702
9702
|
name: "a:solidFill"
|
|
9703
9703
|
});
|
|
9704
9704
|
//#endregion
|
|
9705
|
+
//#region src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/effects/fill-overlay.ts
|
|
9706
|
+
/**
|
|
9707
|
+
* Fill overlay effect for DrawingML shapes.
|
|
9708
|
+
*
|
|
9709
|
+
* Reference: ISO/IEC 29500-4, dml-main.xsd, CT_FillOverlayEffect
|
|
9710
|
+
*
|
|
9711
|
+
* @module
|
|
9712
|
+
*/
|
|
9713
|
+
/**
|
|
9714
|
+
* Creates a fill overlay effect element.
|
|
9715
|
+
*
|
|
9716
|
+
* ## XSD Schema
|
|
9717
|
+
* ```xml
|
|
9718
|
+
* <xsd:complexType name="CT_FillOverlayEffect">
|
|
9719
|
+
* <xsd:sequence>
|
|
9720
|
+
* <xsd:group ref="EG_FillProperties" minOccurs="1" maxOccurs="1"/>
|
|
9721
|
+
* </xsd:sequence>
|
|
9722
|
+
* <xsd:attribute name="blend" type="ST_BlendMode" use="required"/>
|
|
9723
|
+
* </xsd:complexType>
|
|
9724
|
+
* ```
|
|
9725
|
+
*
|
|
9726
|
+
* @example
|
|
9727
|
+
* ```typescript
|
|
9728
|
+
* const fillOverlay = createFillOverlayEffect({
|
|
9729
|
+
* blend: BlendMode.MULTIPLY,
|
|
9730
|
+
* color: { value: "FF0000" },
|
|
9731
|
+
* });
|
|
9732
|
+
* ```
|
|
9733
|
+
*/
|
|
9734
|
+
const createFillOverlayEffect = (options) => new BuilderElement({
|
|
9735
|
+
attributes: { blend: {
|
|
9736
|
+
key: "blend",
|
|
9737
|
+
value: options.blend
|
|
9738
|
+
} },
|
|
9739
|
+
children: [createSolidFill(options.color)],
|
|
9740
|
+
name: "a:fillOverlay"
|
|
9741
|
+
});
|
|
9742
|
+
//#endregion
|
|
9705
9743
|
//#region src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/effects/glow.ts
|
|
9706
9744
|
/**
|
|
9707
9745
|
* Glow effect for DrawingML shapes.
|
|
@@ -9738,7 +9776,7 @@
|
|
|
9738
9776
|
});
|
|
9739
9777
|
};
|
|
9740
9778
|
//#endregion
|
|
9741
|
-
//#region src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/effects/inner-
|
|
9779
|
+
//#region src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/effects/inner-shadow.ts
|
|
9742
9780
|
/**
|
|
9743
9781
|
* Inner shadow effect for DrawingML shapes.
|
|
9744
9782
|
*
|
|
@@ -9786,7 +9824,7 @@
|
|
|
9786
9824
|
});
|
|
9787
9825
|
};
|
|
9788
9826
|
//#endregion
|
|
9789
|
-
//#region src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/effects/outer-
|
|
9827
|
+
//#region src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/effects/outer-shadow.ts
|
|
9790
9828
|
/**
|
|
9791
9829
|
* Outer shadow effect for DrawingML shapes.
|
|
9792
9830
|
*
|
|
@@ -9874,7 +9912,7 @@
|
|
|
9874
9912
|
});
|
|
9875
9913
|
};
|
|
9876
9914
|
//#endregion
|
|
9877
|
-
//#region src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/effects/
|
|
9915
|
+
//#region src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/effects/preset-shadow.ts
|
|
9878
9916
|
/**
|
|
9879
9917
|
* Preset shadow effect for DrawingML shapes.
|
|
9880
9918
|
*
|
|
@@ -10128,10 +10166,11 @@
|
|
|
10128
10166
|
const createEffectList = (options) => {
|
|
10129
10167
|
const children = [];
|
|
10130
10168
|
if (options.blur) children.push(createBlurEffect(options.blur));
|
|
10169
|
+
if (options.fillOverlay) children.push(createFillOverlayEffect(options.fillOverlay));
|
|
10131
10170
|
if (options.glow) children.push(createGlowEffect(options.glow));
|
|
10132
|
-
if (options.
|
|
10133
|
-
if (options.
|
|
10134
|
-
if (options.
|
|
10171
|
+
if (options.innerShadow) children.push(createInnerShadowEffect(options.innerShadow));
|
|
10172
|
+
if (options.outerShadow) children.push(createOuterShadowEffect(options.outerShadow));
|
|
10173
|
+
if (options.presetShadow) children.push(createPresetShadowEffect(options.presetShadow));
|
|
10135
10174
|
if (options.reflection) children.push(createReflectionEffect(options.reflection === true ? void 0 : options.reflection));
|
|
10136
10175
|
if (options.softEdge !== void 0) children.push(createSoftEdgeEffect(options.softEdge));
|
|
10137
10176
|
return new BuilderElement({
|
|
@@ -10922,12 +10961,12 @@
|
|
|
10922
10961
|
const children = [];
|
|
10923
10962
|
if (options.bevelT) children.push(createBevel(options.bevelT));
|
|
10924
10963
|
if (options.bevelB) children.push(createBottomBevel(options.bevelB));
|
|
10925
|
-
if (options.
|
|
10926
|
-
children: [createColorElement(options.
|
|
10964
|
+
if (options.extrusionColor) children.push(new BuilderElement({
|
|
10965
|
+
children: [createColorElement(options.extrusionColor)],
|
|
10927
10966
|
name: "a:extrusionClr"
|
|
10928
10967
|
}));
|
|
10929
|
-
if (options.
|
|
10930
|
-
children: [createColorElement(options.
|
|
10968
|
+
if (options.contourColor) children.push(new BuilderElement({
|
|
10969
|
+
children: [createColorElement(options.contourColor)],
|
|
10931
10970
|
name: "a:contourClr"
|
|
10932
10971
|
}));
|
|
10933
10972
|
return new BuilderElement({
|
|
@@ -11113,6 +11152,158 @@
|
|
|
11113
11152
|
}
|
|
11114
11153
|
};
|
|
11115
11154
|
//#endregion
|
|
11155
|
+
//#region src/file/drawing/inline/graphic/graphic-data/pic/blip/blip-effects.ts
|
|
11156
|
+
/**
|
|
11157
|
+
* Blip image adjustment effects for DrawingML.
|
|
11158
|
+
*
|
|
11159
|
+
* These effects are applied directly to the image data within the `<a:blip>` element,
|
|
11160
|
+
* corresponding to Word's "Picture Format > Adjust" features (brightness, contrast,
|
|
11161
|
+
* grayscale, tint, duotone, etc.).
|
|
11162
|
+
*
|
|
11163
|
+
* Reference: ISO/IEC 29500-4, dml-main.xsd, CT_Blip children
|
|
11164
|
+
*
|
|
11165
|
+
* @module
|
|
11166
|
+
*/
|
|
11167
|
+
/**
|
|
11168
|
+
* Creates blip effect elements from BlipEffectsOptions.
|
|
11169
|
+
*
|
|
11170
|
+
* @returns Array of XML components representing blip effects
|
|
11171
|
+
*/
|
|
11172
|
+
const createBlipEffects = (options) => {
|
|
11173
|
+
const children = [];
|
|
11174
|
+
if (options.grayscale) children.push(new BuilderElement({ name: "a:grayscl" }));
|
|
11175
|
+
if (options.luminance) {
|
|
11176
|
+
const attrs = {};
|
|
11177
|
+
if (options.luminance.bright !== void 0) attrs.bright = {
|
|
11178
|
+
key: "bright",
|
|
11179
|
+
value: `${options.luminance.bright}%`
|
|
11180
|
+
};
|
|
11181
|
+
if (options.luminance.contrast !== void 0) attrs.contrast = {
|
|
11182
|
+
key: "contrast",
|
|
11183
|
+
value: `${options.luminance.contrast}%`
|
|
11184
|
+
};
|
|
11185
|
+
children.push(new BuilderElement({
|
|
11186
|
+
attributes: attrs,
|
|
11187
|
+
name: "a:lum"
|
|
11188
|
+
}));
|
|
11189
|
+
}
|
|
11190
|
+
if (options.hsl) {
|
|
11191
|
+
const attrs = {};
|
|
11192
|
+
if (options.hsl.hue !== void 0) attrs.hue = {
|
|
11193
|
+
key: "hue",
|
|
11194
|
+
value: String(options.hsl.hue)
|
|
11195
|
+
};
|
|
11196
|
+
if (options.hsl.sat !== void 0) attrs.sat = {
|
|
11197
|
+
key: "sat",
|
|
11198
|
+
value: `${options.hsl.sat}%`
|
|
11199
|
+
};
|
|
11200
|
+
if (options.hsl.lum !== void 0) attrs.lum = {
|
|
11201
|
+
key: "lum",
|
|
11202
|
+
value: `${options.hsl.lum}%`
|
|
11203
|
+
};
|
|
11204
|
+
children.push(new BuilderElement({
|
|
11205
|
+
attributes: attrs,
|
|
11206
|
+
name: "a:hsl"
|
|
11207
|
+
}));
|
|
11208
|
+
}
|
|
11209
|
+
if (options.tint) {
|
|
11210
|
+
const attrs = {};
|
|
11211
|
+
if (options.tint.hue !== void 0) attrs.hue = {
|
|
11212
|
+
key: "hue",
|
|
11213
|
+
value: String(options.tint.hue)
|
|
11214
|
+
};
|
|
11215
|
+
if (options.tint.amt !== void 0) attrs.amt = {
|
|
11216
|
+
key: "amt",
|
|
11217
|
+
value: `${options.tint.amt}%`
|
|
11218
|
+
};
|
|
11219
|
+
children.push(new BuilderElement({
|
|
11220
|
+
attributes: attrs,
|
|
11221
|
+
name: "a:tint"
|
|
11222
|
+
}));
|
|
11223
|
+
}
|
|
11224
|
+
if (options.duotone) children.push(new BuilderElement({
|
|
11225
|
+
children: [createColorElement(options.duotone.color1), createColorElement(options.duotone.color2)],
|
|
11226
|
+
name: "a:duotone"
|
|
11227
|
+
}));
|
|
11228
|
+
if (options.biLevel) children.push(new BuilderElement({
|
|
11229
|
+
attributes: { thresh: {
|
|
11230
|
+
key: "thresh",
|
|
11231
|
+
value: `${options.biLevel.thresh}%`
|
|
11232
|
+
} },
|
|
11233
|
+
name: "a:biLevel"
|
|
11234
|
+
}));
|
|
11235
|
+
if (options.alphaCeiling) children.push(new BuilderElement({ name: "a:alphaCeiling" }));
|
|
11236
|
+
if (options.alphaFloor) children.push(new BuilderElement({ name: "a:alphaFloor" }));
|
|
11237
|
+
if (options.alphaInverse !== void 0) if (typeof options.alphaInverse === "boolean") children.push(new BuilderElement({ name: "a:alphaInv" }));
|
|
11238
|
+
else children.push(new BuilderElement({
|
|
11239
|
+
children: [createColorElement(options.alphaInverse)],
|
|
11240
|
+
name: "a:alphaInv"
|
|
11241
|
+
}));
|
|
11242
|
+
if (options.alphaModFix) {
|
|
11243
|
+
var _options$alphaModFix$;
|
|
11244
|
+
const amt = (_options$alphaModFix$ = options.alphaModFix.amount) !== null && _options$alphaModFix$ !== void 0 ? _options$alphaModFix$ : 100;
|
|
11245
|
+
children.push(new BuilderElement({
|
|
11246
|
+
attributes: { amt: {
|
|
11247
|
+
key: "amt",
|
|
11248
|
+
value: `${amt}%`
|
|
11249
|
+
} },
|
|
11250
|
+
name: "a:alphaModFix"
|
|
11251
|
+
}));
|
|
11252
|
+
}
|
|
11253
|
+
if (options.alphaRepl) children.push(new BuilderElement({
|
|
11254
|
+
attributes: { a: {
|
|
11255
|
+
key: "a",
|
|
11256
|
+
value: `${options.alphaRepl.amount}%`
|
|
11257
|
+
} },
|
|
11258
|
+
name: "a:alphaRepl"
|
|
11259
|
+
}));
|
|
11260
|
+
if (options.alphaBiLevel) children.push(new BuilderElement({
|
|
11261
|
+
attributes: { thresh: {
|
|
11262
|
+
key: "thresh",
|
|
11263
|
+
value: `${options.alphaBiLevel.thresh}%`
|
|
11264
|
+
} },
|
|
11265
|
+
name: "a:alphaBiLevel"
|
|
11266
|
+
}));
|
|
11267
|
+
if (options.colorChange) {
|
|
11268
|
+
const attrs = {};
|
|
11269
|
+
if (options.colorChange.useAlpha === false) attrs.useA = {
|
|
11270
|
+
key: "useA",
|
|
11271
|
+
value: "0"
|
|
11272
|
+
};
|
|
11273
|
+
children.push(new BuilderElement({
|
|
11274
|
+
attributes: attrs,
|
|
11275
|
+
children: [new BuilderElement({
|
|
11276
|
+
children: [createColorElement(options.colorChange.from)],
|
|
11277
|
+
name: "a:clrFrom"
|
|
11278
|
+
}), new BuilderElement({
|
|
11279
|
+
children: [createColorElement(options.colorChange.to)],
|
|
11280
|
+
name: "a:clrTo"
|
|
11281
|
+
})],
|
|
11282
|
+
name: "a:clrChange"
|
|
11283
|
+
}));
|
|
11284
|
+
}
|
|
11285
|
+
if (options.colorRepl) children.push(new BuilderElement({
|
|
11286
|
+
children: [createColorElement(options.colorRepl.color)],
|
|
11287
|
+
name: "a:clrRepl"
|
|
11288
|
+
}));
|
|
11289
|
+
if (options.blur) {
|
|
11290
|
+
const attrs = {};
|
|
11291
|
+
if (options.blur.rad !== void 0) attrs.rad = {
|
|
11292
|
+
key: "rad",
|
|
11293
|
+
value: options.blur.rad
|
|
11294
|
+
};
|
|
11295
|
+
if (options.blur.grow === false) attrs.grow = {
|
|
11296
|
+
key: "grow",
|
|
11297
|
+
value: 0
|
|
11298
|
+
};
|
|
11299
|
+
children.push(new BuilderElement({
|
|
11300
|
+
attributes: attrs,
|
|
11301
|
+
name: "a:blur"
|
|
11302
|
+
}));
|
|
11303
|
+
}
|
|
11304
|
+
return children;
|
|
11305
|
+
};
|
|
11306
|
+
//#endregion
|
|
11116
11307
|
//#region src/file/drawing/inline/graphic/graphic-data/pic/blip/blip-extentions.ts
|
|
11117
11308
|
/**
|
|
11118
11309
|
* Creates an SVG blip element for embedding SVG images.
|
|
@@ -11222,20 +11413,25 @@
|
|
|
11222
11413
|
* @param mediaData - The media data containing the image information
|
|
11223
11414
|
* @returns An XML component representing the blip element
|
|
11224
11415
|
*/
|
|
11225
|
-
const createBlip = (mediaData) =>
|
|
11226
|
-
|
|
11227
|
-
|
|
11228
|
-
|
|
11229
|
-
|
|
11416
|
+
const createBlip = (mediaData, blipEffects) => {
|
|
11417
|
+
const children = [];
|
|
11418
|
+
if (blipEffects) children.push(...createBlipEffects(blipEffects));
|
|
11419
|
+
if (mediaData.type === "svg") children.push(createExtentionList(mediaData));
|
|
11420
|
+
return new BuilderElement({
|
|
11421
|
+
attributes: {
|
|
11422
|
+
cstate: {
|
|
11423
|
+
key: "cstate",
|
|
11424
|
+
value: "none"
|
|
11425
|
+
},
|
|
11426
|
+
embed: {
|
|
11427
|
+
key: "r:embed",
|
|
11428
|
+
value: `rId{${mediaData.type === "svg" ? mediaData.fallback.fileName : mediaData.fileName}}`
|
|
11429
|
+
}
|
|
11230
11430
|
},
|
|
11231
|
-
|
|
11232
|
-
|
|
11233
|
-
|
|
11234
|
-
|
|
11235
|
-
},
|
|
11236
|
-
children: mediaData.type === "svg" ? [createExtentionList(mediaData)] : [],
|
|
11237
|
-
name: "a:blip"
|
|
11238
|
-
});
|
|
11431
|
+
children,
|
|
11432
|
+
name: "a:blip"
|
|
11433
|
+
});
|
|
11434
|
+
};
|
|
11239
11435
|
//#endregion
|
|
11240
11436
|
//#region src/file/drawing/inline/graphic/graphic-data/pic/blip/source-rectangle.ts
|
|
11241
11437
|
/**
|
|
@@ -11359,6 +11555,106 @@
|
|
|
11359
11555
|
}
|
|
11360
11556
|
};
|
|
11361
11557
|
//#endregion
|
|
11558
|
+
//#region src/file/drawing/inline/graphic/graphic-data/pic/blip/tile.ts
|
|
11559
|
+
/**
|
|
11560
|
+
* Tile fill module for blip fills.
|
|
11561
|
+
*
|
|
11562
|
+
* This module defines how images are tiled (repeated) to fill shapes.
|
|
11563
|
+
*
|
|
11564
|
+
* Reference: ISO/IEC 29500-4, dml-main.xsd, CT_TileInfoProperties
|
|
11565
|
+
*
|
|
11566
|
+
* @module
|
|
11567
|
+
*/
|
|
11568
|
+
/**
|
|
11569
|
+
* Tile flip mode for tiling images.
|
|
11570
|
+
*
|
|
11571
|
+
* Specifies whether the image is flipped along the x-axis, y-axis,
|
|
11572
|
+
* both axes, or not at all when tiling.
|
|
11573
|
+
*/
|
|
11574
|
+
const TileFlipMode = {
|
|
11575
|
+
NONE: "none",
|
|
11576
|
+
X: "x",
|
|
11577
|
+
Y: "y",
|
|
11578
|
+
XY: "xy"
|
|
11579
|
+
};
|
|
11580
|
+
/**
|
|
11581
|
+
* Tile alignment within the shape.
|
|
11582
|
+
*
|
|
11583
|
+
* Specifies the anchor position of the first tile relative to the shape.
|
|
11584
|
+
*/
|
|
11585
|
+
const TileAlignment = {
|
|
11586
|
+
TOP_LEFT: "tl",
|
|
11587
|
+
TOP: "t",
|
|
11588
|
+
TOP_RIGHT: "tr",
|
|
11589
|
+
LEFT: "l",
|
|
11590
|
+
CENTER: "ctr",
|
|
11591
|
+
RIGHT: "r",
|
|
11592
|
+
BOTTOM_LEFT: "bl",
|
|
11593
|
+
BOTTOM: "b",
|
|
11594
|
+
BOTTOM_RIGHT: "br"
|
|
11595
|
+
};
|
|
11596
|
+
/**
|
|
11597
|
+
* Creates a tile fill mode element for blip fills.
|
|
11598
|
+
*
|
|
11599
|
+
* When a blip fill uses tile mode, the image is repeated (tiled) to fill
|
|
11600
|
+
* the shape instead of being stretched. This element controls the tiling
|
|
11601
|
+
* parameters such as offset, scale, flip, and alignment.
|
|
11602
|
+
*
|
|
11603
|
+
* Reference: ISO/IEC 29500-4, dml-main.xsd, CT_TileInfoProperties
|
|
11604
|
+
*
|
|
11605
|
+
* ## XSD Schema
|
|
11606
|
+
* ```xml
|
|
11607
|
+
* <xsd:complexType name="CT_TileInfoProperties">
|
|
11608
|
+
* <xsd:attribute name="tx" type="ST_Coordinate" use="optional"/>
|
|
11609
|
+
* <xsd:attribute name="ty" type="ST_Coordinate" use="optional"/>
|
|
11610
|
+
* <xsd:attribute name="sx" type="ST_Percentage" use="optional"/>
|
|
11611
|
+
* <xsd:attribute name="sy" type="ST_Percentage" use="optional"/>
|
|
11612
|
+
* <xsd:attribute name="flip" type="ST_TileFlipMode" default="none"/>
|
|
11613
|
+
* <xsd:attribute name="algn" type="ST_RectAlignment" use="optional"/>
|
|
11614
|
+
* </xsd:complexType>
|
|
11615
|
+
* ```
|
|
11616
|
+
*
|
|
11617
|
+
* @example
|
|
11618
|
+
* ```typescript
|
|
11619
|
+
* // Tile with 50% scale
|
|
11620
|
+
* createTileInfo({ sx: 50, sy: 50 });
|
|
11621
|
+
* // Tile with flip and alignment
|
|
11622
|
+
* createTileInfo({ flip: "XY", align: "CENTER" });
|
|
11623
|
+
* ```
|
|
11624
|
+
*/
|
|
11625
|
+
const createTileInfo = (options) => {
|
|
11626
|
+
if (!options) return new BuilderElement({ name: "a:tile" });
|
|
11627
|
+
const attributes = {};
|
|
11628
|
+
if (options.tx !== void 0) attributes.tx = {
|
|
11629
|
+
key: "tx",
|
|
11630
|
+
value: options.tx
|
|
11631
|
+
};
|
|
11632
|
+
if (options.ty !== void 0) attributes.ty = {
|
|
11633
|
+
key: "ty",
|
|
11634
|
+
value: options.ty
|
|
11635
|
+
};
|
|
11636
|
+
if (options.sx !== void 0) attributes.sx = {
|
|
11637
|
+
key: "sx",
|
|
11638
|
+
value: options.sx
|
|
11639
|
+
};
|
|
11640
|
+
if (options.sy !== void 0) attributes.sy = {
|
|
11641
|
+
key: "sy",
|
|
11642
|
+
value: options.sy
|
|
11643
|
+
};
|
|
11644
|
+
if (options.flip !== void 0) attributes.flip = {
|
|
11645
|
+
key: "flip",
|
|
11646
|
+
value: TileFlipMode[options.flip]
|
|
11647
|
+
};
|
|
11648
|
+
if (options.align !== void 0) attributes.algn = {
|
|
11649
|
+
key: "algn",
|
|
11650
|
+
value: TileAlignment[options.align]
|
|
11651
|
+
};
|
|
11652
|
+
return new BuilderElement({
|
|
11653
|
+
attributes: Object.keys(attributes).length > 0 ? attributes : void 0,
|
|
11654
|
+
name: "a:tile"
|
|
11655
|
+
});
|
|
11656
|
+
};
|
|
11657
|
+
//#endregion
|
|
11362
11658
|
//#region src/file/drawing/inline/graphic/graphic-data/pic/blip/blip-fill.ts
|
|
11363
11659
|
/**
|
|
11364
11660
|
* Represents a blip fill for pictures in DrawingML.
|
|
@@ -11387,12 +11683,48 @@
|
|
|
11387
11683
|
* // If mediaData.srcRect is set, cropping is applied
|
|
11388
11684
|
* ```
|
|
11389
11685
|
*/
|
|
11390
|
-
|
|
11391
|
-
|
|
11392
|
-
|
|
11393
|
-
|
|
11394
|
-
|
|
11395
|
-
|
|
11686
|
+
const createBlipFill = (mediaData, options) => {
|
|
11687
|
+
const children = [];
|
|
11688
|
+
children.push(createBlip(mediaData, options === null || options === void 0 ? void 0 : options.blipEffects));
|
|
11689
|
+
children.push(createSourceRectangle(mediaData.srcRect));
|
|
11690
|
+
if (options === null || options === void 0 ? void 0 : options.tile) children.push(createTileInfo(options.tile));
|
|
11691
|
+
else children.push(new Stretch());
|
|
11692
|
+
const attributes = {};
|
|
11693
|
+
if ((options === null || options === void 0 ? void 0 : options.dpi) !== void 0) attributes.dpi = {
|
|
11694
|
+
key: "dpi",
|
|
11695
|
+
value: options.dpi
|
|
11696
|
+
};
|
|
11697
|
+
if ((options === null || options === void 0 ? void 0 : options.rotWithShape) !== void 0) attributes.rotWithShape = {
|
|
11698
|
+
key: "rotWithShape",
|
|
11699
|
+
value: options.rotWithShape ? 1 : 0
|
|
11700
|
+
};
|
|
11701
|
+
return new BuilderElement({
|
|
11702
|
+
attributes: Object.keys(attributes).length > 0 ? attributes : void 0,
|
|
11703
|
+
children,
|
|
11704
|
+
name: "pic:blipFill"
|
|
11705
|
+
});
|
|
11706
|
+
};
|
|
11707
|
+
//#endregion
|
|
11708
|
+
//#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
|
|
11709
|
+
/**
|
|
11710
|
+
* Attributes for non-visual picture properties.
|
|
11711
|
+
*
|
|
11712
|
+
* @module
|
|
11713
|
+
*/
|
|
11714
|
+
/**
|
|
11715
|
+
* Attributes for CT_NonVisualPictureProperties.
|
|
11716
|
+
*
|
|
11717
|
+
* ## XSD Schema
|
|
11718
|
+
* ```xml
|
|
11719
|
+
* <xsd:attribute name="preferRelativeResize" type="xsd:boolean" use="optional" default="true"/>
|
|
11720
|
+
* ```
|
|
11721
|
+
*
|
|
11722
|
+
* @internal
|
|
11723
|
+
*/
|
|
11724
|
+
var ChildNonVisualPropertiesAttributes = class extends XmlAttributeComponent {
|
|
11725
|
+
constructor(..._args) {
|
|
11726
|
+
super(..._args);
|
|
11727
|
+
_defineProperty(this, "xmlKeys", { preferRelativeResize: "preferRelativeResize" });
|
|
11396
11728
|
}
|
|
11397
11729
|
};
|
|
11398
11730
|
//#endregion
|
|
@@ -11517,6 +11849,7 @@
|
|
|
11517
11849
|
var ChildNonVisualProperties = class extends XmlComponent {
|
|
11518
11850
|
constructor() {
|
|
11519
11851
|
super("pic:cNvPicPr");
|
|
11852
|
+
this.root.push(new ChildNonVisualPropertiesAttributes({ preferRelativeResize: true }));
|
|
11520
11853
|
this.root.push(new PicLocks());
|
|
11521
11854
|
}
|
|
11522
11855
|
};
|
|
@@ -11565,6 +11898,85 @@
|
|
|
11565
11898
|
},
|
|
11566
11899
|
name: "a:hlinkClick"
|
|
11567
11900
|
});
|
|
11901
|
+
/**
|
|
11902
|
+
* Creates a hover hyperlink element for a drawing.
|
|
11903
|
+
*
|
|
11904
|
+
* This element defines what happens when a user hovers over a drawing element.
|
|
11905
|
+
*
|
|
11906
|
+
* ## XSD Schema
|
|
11907
|
+
* ```xml
|
|
11908
|
+
* <xsd:complexType name="CT_Hyperlink">
|
|
11909
|
+
* <xsd:group ref="EG_PContent" minOccurs="0" maxOccurs="unbounded"/>
|
|
11910
|
+
* <xsd:attribute name="tgtFrame" type="s:ST_String"/>
|
|
11911
|
+
* <xsd:attribute name="tooltip" type="s:ST_String"/>
|
|
11912
|
+
* <xsd:attribute name="docLocation" type="s:ST_String"/>
|
|
11913
|
+
* <xsd:attribute name="history" type="s:ST_OnOff"/>
|
|
11914
|
+
* <xsd:attribute name="anchor" type="s:ST_String"/>
|
|
11915
|
+
* <xsd:attribute ref="r:id"/>
|
|
11916
|
+
* </xsd:complexType>
|
|
11917
|
+
* ```
|
|
11918
|
+
*
|
|
11919
|
+
* @param linkId - The relationship ID for the hyperlink target
|
|
11920
|
+
* @param hasXmlNs - Whether to include the XML namespace declaration
|
|
11921
|
+
* @returns An XML component representing the hover hyperlink
|
|
11922
|
+
*/
|
|
11923
|
+
const createHyperlinkHover = (linkId, hasXmlNs) => new BuilderElement({
|
|
11924
|
+
attributes: {
|
|
11925
|
+
...hasXmlNs ? { xmlns: {
|
|
11926
|
+
key: "xmlns:a",
|
|
11927
|
+
value: "http://schemas.openxmlformats.org/drawingml/2006/main"
|
|
11928
|
+
} } : {},
|
|
11929
|
+
id: {
|
|
11930
|
+
key: "r:id",
|
|
11931
|
+
value: `rId${linkId}`
|
|
11932
|
+
}
|
|
11933
|
+
},
|
|
11934
|
+
name: "a:hlinkHover"
|
|
11935
|
+
});
|
|
11936
|
+
//#endregion
|
|
11937
|
+
//#region src/file/relationships/relationship/relationship.ts
|
|
11938
|
+
/**
|
|
11939
|
+
* Target mode types for relationships.
|
|
11940
|
+
*
|
|
11941
|
+
* Indicates whether a relationship target is external to the package.
|
|
11942
|
+
*/
|
|
11943
|
+
const TargetModeType = { EXTERNAL: "External" };
|
|
11944
|
+
/**
|
|
11945
|
+
* Creates a single relationship between parts in an OPC package.
|
|
11946
|
+
*
|
|
11947
|
+
* A relationship defines a typed connection from a source part to a target part,
|
|
11948
|
+
* identified by a unique ID within the relationships collection.
|
|
11949
|
+
*
|
|
11950
|
+
* @example
|
|
11951
|
+
* ```typescript
|
|
11952
|
+
* // Internal relationship to an image
|
|
11953
|
+
* createRelationship("rId1", "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image", "media/image1.png");
|
|
11954
|
+
*
|
|
11955
|
+
* // External relationship to a hyperlink
|
|
11956
|
+
* createRelationship("rId2", "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink", "https://example.com", TargetModeType.EXTERNAL);
|
|
11957
|
+
* ```
|
|
11958
|
+
*/
|
|
11959
|
+
const createRelationship = (id, type, target, targetMode) => new BuilderElement({
|
|
11960
|
+
attributes: {
|
|
11961
|
+
id: {
|
|
11962
|
+
key: "Id",
|
|
11963
|
+
value: id
|
|
11964
|
+
},
|
|
11965
|
+
target: {
|
|
11966
|
+
key: "Target",
|
|
11967
|
+
value: target
|
|
11968
|
+
},
|
|
11969
|
+
targetMode: {
|
|
11970
|
+
key: "TargetMode",
|
|
11971
|
+
value: targetMode
|
|
11972
|
+
},
|
|
11973
|
+
type: {
|
|
11974
|
+
key: "Type",
|
|
11975
|
+
value: type
|
|
11976
|
+
}
|
|
11977
|
+
},
|
|
11978
|
+
name: "Relationship"
|
|
11979
|
+
});
|
|
11568
11980
|
//#endregion
|
|
11569
11981
|
//#region src/file/drawing/inline/graphic/graphic-data/pic/non-visual-pic-properties/non-visual-properties/non-visual-properties-attributes.ts
|
|
11570
11982
|
/**
|
|
@@ -11594,16 +12006,7 @@
|
|
|
11594
12006
|
};
|
|
11595
12007
|
//#endregion
|
|
11596
12008
|
//#region src/file/drawing/inline/graphic/graphic-data/pic/non-visual-pic-properties/non-visual-properties/non-visual-properties.ts
|
|
11597
|
-
|
|
11598
|
-
* Non-visual drawing properties module.
|
|
11599
|
-
*
|
|
11600
|
-
* This module provides basic metadata for drawing elements including
|
|
11601
|
-
* ID, name, description, and hyperlink support.
|
|
11602
|
-
*
|
|
11603
|
-
* Reference: http://officeopenxml.com/drwPic.php
|
|
11604
|
-
*
|
|
11605
|
-
* @module
|
|
11606
|
-
*/
|
|
12009
|
+
const HYPERLINK_RELATIONSHIP_TYPE$1 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink";
|
|
11607
12010
|
/**
|
|
11608
12011
|
* Represents non-visual drawing properties for pictures.
|
|
11609
12012
|
*
|
|
@@ -11634,8 +12037,10 @@
|
|
|
11634
12037
|
* ```
|
|
11635
12038
|
*/
|
|
11636
12039
|
var NonVisualProperties = class extends XmlComponent {
|
|
11637
|
-
constructor() {
|
|
12040
|
+
constructor(hyperlink) {
|
|
11638
12041
|
super("pic:cNvPr");
|
|
12042
|
+
_defineProperty(this, "hyperlink", void 0);
|
|
12043
|
+
this.hyperlink = hyperlink;
|
|
11639
12044
|
this.root.push(new NonVisualPropertiesAttributes({
|
|
11640
12045
|
descr: "",
|
|
11641
12046
|
id: 0,
|
|
@@ -11643,28 +12048,32 @@
|
|
|
11643
12048
|
}));
|
|
11644
12049
|
}
|
|
11645
12050
|
prepForXml(context) {
|
|
12051
|
+
let hasStackClick = false;
|
|
11646
12052
|
for (let i = context.stack.length - 1; i >= 0; i--) {
|
|
11647
12053
|
const element = context.stack[i];
|
|
11648
12054
|
if (!(element instanceof ConcreteHyperlink)) continue;
|
|
11649
12055
|
this.root.push(createHyperlinkClick(element.linkId, false));
|
|
12056
|
+
hasStackClick = true;
|
|
11650
12057
|
break;
|
|
11651
12058
|
}
|
|
12059
|
+
if (this.hyperlink) {
|
|
12060
|
+
if (this.hyperlink.click && !hasStackClick) {
|
|
12061
|
+
const linkId = uniqueId();
|
|
12062
|
+
context.viewWrapper.Relationships.addRelationship(linkId, HYPERLINK_RELATIONSHIP_TYPE$1, this.hyperlink.click, TargetModeType.EXTERNAL);
|
|
12063
|
+
this.root.push(createHyperlinkClick(linkId, false));
|
|
12064
|
+
}
|
|
12065
|
+
if (this.hyperlink.hover) {
|
|
12066
|
+
const linkId = uniqueId();
|
|
12067
|
+
context.viewWrapper.Relationships.addRelationship(linkId, HYPERLINK_RELATIONSHIP_TYPE$1, this.hyperlink.hover, TargetModeType.EXTERNAL);
|
|
12068
|
+
this.root.push(createHyperlinkHover(linkId, false));
|
|
12069
|
+
}
|
|
12070
|
+
}
|
|
11652
12071
|
return super.prepForXml(context);
|
|
11653
12072
|
}
|
|
11654
12073
|
};
|
|
11655
12074
|
//#endregion
|
|
11656
12075
|
//#region src/file/drawing/inline/graphic/graphic-data/pic/non-visual-pic-properties/non-visual-pic-properties.ts
|
|
11657
12076
|
/**
|
|
11658
|
-
* Non-visual picture properties module.
|
|
11659
|
-
*
|
|
11660
|
-
* This module provides metadata and locking settings for pictures
|
|
11661
|
-
* that don't affect their visual appearance.
|
|
11662
|
-
*
|
|
11663
|
-
* Reference: http://officeopenxml.com/drwPic.php
|
|
11664
|
-
*
|
|
11665
|
-
* @module
|
|
11666
|
-
*/
|
|
11667
|
-
/**
|
|
11668
12077
|
* Represents non-visual picture properties.
|
|
11669
12078
|
*
|
|
11670
12079
|
* This element specifies non-visual properties for a picture. These properties
|
|
@@ -11689,9 +12098,9 @@
|
|
|
11689
12098
|
* ```
|
|
11690
12099
|
*/
|
|
11691
12100
|
var NonVisualPicProperties = class extends XmlComponent {
|
|
11692
|
-
constructor() {
|
|
12101
|
+
constructor(hyperlink) {
|
|
11693
12102
|
super("pic:nvPicPr");
|
|
11694
|
-
this.root.push(new NonVisualProperties());
|
|
12103
|
+
this.root.push(new NonVisualProperties(hyperlink));
|
|
11695
12104
|
this.root.push(new ChildNonVisualProperties());
|
|
11696
12105
|
}
|
|
11697
12106
|
};
|
|
@@ -11748,14 +12157,19 @@
|
|
|
11748
12157
|
* ```
|
|
11749
12158
|
*/
|
|
11750
12159
|
var Pic = class extends XmlComponent {
|
|
11751
|
-
constructor({ mediaData, transform, outline }) {
|
|
12160
|
+
constructor({ mediaData, transform, outline, solidFill, effects, blipEffects, tile, hyperlink }) {
|
|
11752
12161
|
super("pic:pic");
|
|
11753
12162
|
this.root.push(new PicAttributes({ xmlns: "http://schemas.openxmlformats.org/drawingml/2006/picture" }));
|
|
11754
|
-
this.root.push(new NonVisualPicProperties());
|
|
11755
|
-
this.root.push(
|
|
12163
|
+
this.root.push(new NonVisualPicProperties(hyperlink));
|
|
12164
|
+
this.root.push(createBlipFill(mediaData, {
|
|
12165
|
+
blipEffects,
|
|
12166
|
+
tile
|
|
12167
|
+
}));
|
|
11756
12168
|
this.root.push(new ShapeProperties({
|
|
11757
12169
|
element: "pic",
|
|
12170
|
+
effects,
|
|
11758
12171
|
outline,
|
|
12172
|
+
solidFill,
|
|
11759
12173
|
transform
|
|
11760
12174
|
}));
|
|
11761
12175
|
}
|
|
@@ -11881,7 +12295,7 @@
|
|
|
11881
12295
|
* ```
|
|
11882
12296
|
*/
|
|
11883
12297
|
var GraphicData = class extends XmlComponent {
|
|
11884
|
-
constructor({ mediaData, transform, outline, solidFill }) {
|
|
12298
|
+
constructor({ mediaData, transform, outline, solidFill, effects, blipEffects, tile, hyperlink }) {
|
|
11885
12299
|
super("a:graphicData");
|
|
11886
12300
|
if (mediaData.type === "wps") {
|
|
11887
12301
|
this.root.push(new GraphicDataAttributes({ uri: "http://schemas.microsoft.com/office/word/2010/wordprocessingShape" }));
|
|
@@ -11919,8 +12333,13 @@
|
|
|
11919
12333
|
} else {
|
|
11920
12334
|
this.root.push(new GraphicDataAttributes({ uri: "http://schemas.openxmlformats.org/drawingml/2006/picture" }));
|
|
11921
12335
|
const pic = new Pic({
|
|
12336
|
+
blipEffects,
|
|
12337
|
+
effects,
|
|
12338
|
+
hyperlink,
|
|
11922
12339
|
mediaData,
|
|
11923
12340
|
outline,
|
|
12341
|
+
solidFill,
|
|
12342
|
+
tile,
|
|
11924
12343
|
transform
|
|
11925
12344
|
});
|
|
11926
12345
|
this.root.push(pic);
|
|
@@ -11966,14 +12385,18 @@
|
|
|
11966
12385
|
* ```
|
|
11967
12386
|
*/
|
|
11968
12387
|
var Graphic = class extends XmlComponent {
|
|
11969
|
-
constructor({ mediaData, transform, outline, solidFill }) {
|
|
12388
|
+
constructor({ mediaData, transform, outline, solidFill, effects, blipEffects, tile, hyperlink }) {
|
|
11970
12389
|
super("a:graphic");
|
|
11971
12390
|
_defineProperty(this, "data", void 0);
|
|
11972
12391
|
this.root.push(new GraphicAttributes({ a: "http://schemas.openxmlformats.org/drawingml/2006/main" }));
|
|
11973
12392
|
this.data = new GraphicData({
|
|
12393
|
+
blipEffects,
|
|
12394
|
+
effects,
|
|
12395
|
+
hyperlink,
|
|
11974
12396
|
mediaData,
|
|
11975
12397
|
outline,
|
|
11976
12398
|
solidFill,
|
|
12399
|
+
tile,
|
|
11977
12400
|
transform
|
|
11978
12401
|
});
|
|
11979
12402
|
this.root.push(this.data);
|
|
@@ -12195,12 +12618,13 @@
|
|
|
12195
12618
|
* Document Properties module for DrawingML elements.
|
|
12196
12619
|
*
|
|
12197
12620
|
* This module provides non-visual properties for drawing elements,
|
|
12198
|
-
* including name, description,
|
|
12621
|
+
* including name, description, accessibility information, and hyperlinks.
|
|
12199
12622
|
*
|
|
12200
12623
|
* Reference: https://c-rex.net/projects/samples/ooxml/e1/Part4/OOXML_P4_DOCX_docPr_topic_ID0ES32OB.html
|
|
12201
12624
|
*
|
|
12202
12625
|
* @module
|
|
12203
12626
|
*/
|
|
12627
|
+
const HYPERLINK_RELATIONSHIP_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink";
|
|
12204
12628
|
/**
|
|
12205
12629
|
* Represents non-visual drawing properties in a WordprocessingML document.
|
|
12206
12630
|
*
|
|
@@ -12225,13 +12649,15 @@
|
|
|
12225
12649
|
* ```
|
|
12226
12650
|
*/
|
|
12227
12651
|
var DocProperties = class extends XmlComponent {
|
|
12228
|
-
constructor({ name, description, title, id } = {
|
|
12652
|
+
constructor({ name, description, title, id, hyperlink } = {
|
|
12229
12653
|
description: "",
|
|
12230
12654
|
name: "",
|
|
12231
12655
|
title: ""
|
|
12232
12656
|
}) {
|
|
12233
12657
|
super("wp:docPr");
|
|
12234
12658
|
_defineProperty(this, "docPropertiesUniqueNumericId", docPropertiesUniqueNumericIdGen());
|
|
12659
|
+
_defineProperty(this, "hyperlink", void 0);
|
|
12660
|
+
this.hyperlink = hyperlink;
|
|
12235
12661
|
const attributes = {
|
|
12236
12662
|
id: {
|
|
12237
12663
|
key: "id",
|
|
@@ -12253,12 +12679,26 @@
|
|
|
12253
12679
|
this.root.push(new NextAttributeComponent(attributes));
|
|
12254
12680
|
}
|
|
12255
12681
|
prepForXml(context) {
|
|
12682
|
+
let hasStackClick = false;
|
|
12256
12683
|
for (let i = context.stack.length - 1; i >= 0; i--) {
|
|
12257
12684
|
const element = context.stack[i];
|
|
12258
12685
|
if (!(element instanceof ConcreteHyperlink)) continue;
|
|
12259
12686
|
this.root.push(createHyperlinkClick(element.linkId, true));
|
|
12687
|
+
hasStackClick = true;
|
|
12260
12688
|
break;
|
|
12261
12689
|
}
|
|
12690
|
+
if (this.hyperlink) {
|
|
12691
|
+
if (this.hyperlink.click && !hasStackClick) {
|
|
12692
|
+
const linkId = uniqueId();
|
|
12693
|
+
context.viewWrapper.Relationships.addRelationship(linkId, HYPERLINK_RELATIONSHIP_TYPE, this.hyperlink.click, TargetModeType.EXTERNAL);
|
|
12694
|
+
this.root.push(createHyperlinkClick(linkId, true));
|
|
12695
|
+
}
|
|
12696
|
+
if (this.hyperlink.hover) {
|
|
12697
|
+
const linkId = uniqueId();
|
|
12698
|
+
context.viewWrapper.Relationships.addRelationship(linkId, HYPERLINK_RELATIONSHIP_TYPE, this.hyperlink.hover, TargetModeType.EXTERNAL);
|
|
12699
|
+
this.root.push(createHyperlinkHover(linkId, true));
|
|
12700
|
+
}
|
|
12701
|
+
}
|
|
12262
12702
|
return super.prepForXml(context);
|
|
12263
12703
|
}
|
|
12264
12704
|
};
|
|
@@ -12534,6 +12974,7 @@
|
|
|
12534
12974
|
*/
|
|
12535
12975
|
var Anchor = class extends XmlComponent {
|
|
12536
12976
|
constructor({ mediaData, transform, drawingOptions }) {
|
|
12977
|
+
var _drawingOptions$docPr;
|
|
12537
12978
|
super("wp:anchor");
|
|
12538
12979
|
const floating = {
|
|
12539
12980
|
allowOverlap: true,
|
|
@@ -12586,16 +13027,20 @@
|
|
|
12586
13027
|
this.root.push(new DocProperties(drawingOptions.docProperties));
|
|
12587
13028
|
this.root.push(createGraphicFrameProperties());
|
|
12588
13029
|
this.root.push(new Graphic({
|
|
13030
|
+
blipEffects: drawingOptions.blipEffects,
|
|
13031
|
+
effects: drawingOptions.effects,
|
|
13032
|
+
hyperlink: (_drawingOptions$docPr = drawingOptions.docProperties) === null || _drawingOptions$docPr === void 0 ? void 0 : _drawingOptions$docPr.hyperlink,
|
|
12589
13033
|
mediaData,
|
|
12590
13034
|
outline: drawingOptions.outline,
|
|
12591
13035
|
solidFill: drawingOptions.solidFill,
|
|
13036
|
+
tile: drawingOptions.tile,
|
|
12592
13037
|
transform
|
|
12593
13038
|
}));
|
|
12594
13039
|
}
|
|
12595
13040
|
};
|
|
12596
13041
|
//#endregion
|
|
12597
13042
|
//#region src/file/drawing/inline/inline.ts
|
|
12598
|
-
const createInline = ({ mediaData, transform, docProperties, outline, solidFill }) => {
|
|
13043
|
+
const createInline = ({ mediaData, transform, docProperties, outline, solidFill, effects, blipEffects, tile }) => {
|
|
12599
13044
|
var _outline$width, _outline$width2, _outline$width3, _outline$width4;
|
|
12600
13045
|
return new BuilderElement({
|
|
12601
13046
|
attributes: {
|
|
@@ -12635,9 +13080,13 @@
|
|
|
12635
13080
|
new DocProperties(docProperties),
|
|
12636
13081
|
createGraphicFrameProperties(),
|
|
12637
13082
|
new Graphic({
|
|
13083
|
+
blipEffects,
|
|
13084
|
+
effects,
|
|
13085
|
+
hyperlink: docProperties === null || docProperties === void 0 ? void 0 : docProperties.hyperlink,
|
|
12638
13086
|
mediaData,
|
|
12639
13087
|
outline,
|
|
12640
13088
|
solidFill,
|
|
13089
|
+
tile,
|
|
12641
13090
|
transform
|
|
12642
13091
|
})
|
|
12643
13092
|
],
|
|
@@ -12668,10 +13117,13 @@
|
|
|
12668
13117
|
constructor(imageData, drawingOptions = {}) {
|
|
12669
13118
|
super("w:drawing");
|
|
12670
13119
|
if (!drawingOptions.floating) this.root.push(createInline({
|
|
13120
|
+
blipEffects: drawingOptions.blipEffects,
|
|
12671
13121
|
docProperties: drawingOptions.docProperties,
|
|
13122
|
+
effects: drawingOptions.effects,
|
|
12672
13123
|
mediaData: imageData,
|
|
12673
13124
|
outline: drawingOptions.outline,
|
|
12674
13125
|
solidFill: drawingOptions.solidFill,
|
|
13126
|
+
tile: drawingOptions.tile,
|
|
12675
13127
|
transform: imageData.transformation
|
|
12676
13128
|
}));
|
|
12677
13129
|
else this.root.push(new Anchor({
|
|
@@ -12817,9 +13269,13 @@
|
|
|
12817
13269
|
...createImageData(rawData, options.transformation, key, options.srcRect)
|
|
12818
13270
|
};
|
|
12819
13271
|
const drawing = new Drawing(this.imageData, {
|
|
13272
|
+
blipEffects: options.blipEffects,
|
|
12820
13273
|
docProperties: options.altText,
|
|
12821
13274
|
floating: options.floating,
|
|
12822
|
-
outline: options.outline
|
|
13275
|
+
outline: options.outline,
|
|
13276
|
+
solidFill: options.solidFill,
|
|
13277
|
+
effects: options.effects,
|
|
13278
|
+
tile: options.tile
|
|
12823
13279
|
});
|
|
12824
13280
|
this.root.push(drawing);
|
|
12825
13281
|
}
|
|
@@ -13073,50 +13529,6 @@
|
|
|
13073
13529
|
}
|
|
13074
13530
|
};
|
|
13075
13531
|
//#endregion
|
|
13076
|
-
//#region src/file/relationships/relationship/relationship.ts
|
|
13077
|
-
/**
|
|
13078
|
-
* Target mode types for relationships.
|
|
13079
|
-
*
|
|
13080
|
-
* Indicates whether a relationship target is external to the package.
|
|
13081
|
-
*/
|
|
13082
|
-
const TargetModeType = { EXTERNAL: "External" };
|
|
13083
|
-
/**
|
|
13084
|
-
* Creates a single relationship between parts in an OPC package.
|
|
13085
|
-
*
|
|
13086
|
-
* A relationship defines a typed connection from a source part to a target part,
|
|
13087
|
-
* identified by a unique ID within the relationships collection.
|
|
13088
|
-
*
|
|
13089
|
-
* @example
|
|
13090
|
-
* ```typescript
|
|
13091
|
-
* // Internal relationship to an image
|
|
13092
|
-
* createRelationship("rId1", "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image", "media/image1.png");
|
|
13093
|
-
*
|
|
13094
|
-
* // External relationship to a hyperlink
|
|
13095
|
-
* createRelationship("rId2", "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink", "https://example.com", TargetModeType.EXTERNAL);
|
|
13096
|
-
* ```
|
|
13097
|
-
*/
|
|
13098
|
-
const createRelationship = (id, type, target, targetMode) => new BuilderElement({
|
|
13099
|
-
attributes: {
|
|
13100
|
-
id: {
|
|
13101
|
-
key: "Id",
|
|
13102
|
-
value: id
|
|
13103
|
-
},
|
|
13104
|
-
target: {
|
|
13105
|
-
key: "Target",
|
|
13106
|
-
value: target
|
|
13107
|
-
},
|
|
13108
|
-
targetMode: {
|
|
13109
|
-
key: "TargetMode",
|
|
13110
|
-
value: targetMode
|
|
13111
|
-
},
|
|
13112
|
-
type: {
|
|
13113
|
-
key: "Type",
|
|
13114
|
-
value: type
|
|
13115
|
-
}
|
|
13116
|
-
},
|
|
13117
|
-
name: "Relationship"
|
|
13118
|
-
});
|
|
13119
|
-
//#endregion
|
|
13120
13532
|
//#region src/file/relationships/relationships.ts
|
|
13121
13533
|
/**
|
|
13122
13534
|
* Relationships module for Open Packaging Conventions.
|