@office-open/docx 0.6.10 → 0.7.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/dist/index.mjs CHANGED
@@ -1,7 +1,6 @@
1
1
  import { i as __toCommonJS, n as __exportAll, r as __reExport, t as __esmMin } from "./chunk-DHfcOUro.mjs";
2
- import { AppProperties, BaseXmlComponent, BuilderElement, BuilderElement as BuilderElement$1, DOCX_NS, EMPTY_OBJECT, EmptyElement, Formatter, Formatter as Formatter$1, IgnoreIfEmptyXmlComponent, ImportedRootElementAttributes, ImportedXmlComponent, InitializableXmlComponent, OoxmlMimeType, RawPassthrough, Relationships, TargetModeType, XmlComponent, addSmartArtRelationships, appendContentType, appendRelationship, attrObj, chartAttr, convertEmuToPixels, convertInchesToTwip, convertMillimetersToTwip, convertPixelsToEmu, convertToXmlComponent, createDefault, createOverride, createPacker, createReplacer, createTraverser, getNextRelationshipIndex, getReferencedMedia, hasPlaceholders, hashedId, hpsMeasureObj, hpsMeasureObj as hpsMeasureObj$1, numberValObj, numberValObj as numberValObj$1, onOffObj, onOffObj as onOffObj$1, parseArchive, parseCorePropsElement, replaceChartPlaceholders, replaceImagePlaceholders, replaceSmartArtPlaceholders, strFromU8, stringContainerObj, stringEnumValObj, stringEnumValObj as stringEnumValObj$1, stringValObj, stringValObj as stringValObj$1, toJson, uniqueId, uniqueNumericIdCreator, uniqueNumericIdCreator as uniqueNumericIdCreator$1, uniqueUuid, unzipSync, wrapEl, xsdVerticalMergeRev, zipAndConvert } from "@office-open/core";
2
+ import { AppProperties, BaseXmlComponent, BuilderElement, BuilderElement as BuilderElement$1, DOCX_NS, EMPTY_OBJECT, EmptyElement, Formatter, Formatter as Formatter$1, IgnoreIfEmptyXmlComponent, ImportedRootElementAttributes, ImportedXmlComponent, InitializableXmlComponent, OoxmlMimeType, RawPassthrough, Relationships, TargetModeType, XmlComponent, addSmartArtRelationships, appendContentType, appendRelationship, attrObj, chartAttr, convertEmuToPixels, convertInchesToTwip, convertMillimetersToTwip, convertPixelsToEmu, convertToXmlComponent, createDefault, createOverride, createPacker, createReplacer, createTraverser, getNextRelationshipIndex, getReferencedMedia, hasPlaceholders, hashedId, hpsMeasureObj, hpsMeasureObj as hpsMeasureObj$1, numberValObj, numberValObj as numberValObj$1, onOffObj, onOffObj as onOffObj$1, parseArchive, parseCorePropsElement, replaceChartPlaceholders, replaceImagePlaceholders, replaceSmartArtPlaceholders, strFromU8, stringContainerObj, stringEnumValObj, stringEnumValObj as stringEnumValObj$1, stringValObj, stringValObj as stringValObj$1, toJson, toUint8Array, uniqueId, uniqueNumericIdCreator, uniqueNumericIdCreator as uniqueNumericIdCreator$1, uniqueUuid, unzipSync, wrapEl, xsdVerticalMergeRev, zipAndConvert } from "@office-open/core";
3
3
  import { attr, attrBool, attrNum, children, colorAttr, findChild, findDeep, js2xml, textOf, xml, xml2js } from "@office-open/xml";
4
- import { toUint8Array } from "undio";
5
4
  import { PresetGeometry, buildFill, createBlipFill, createCustomGeometry, createEffectDag, createEffectList, createOutline, createScene3D, createShape3D, createTransform2D, extractBlipFillMedia } from "@office-open/core/drawingml";
6
5
  import { ChartCollection, ChartSpace } from "@office-open/core/chart";
7
6
  import { COLOR_CATEGORIES, DEFAULT_DRAWING_XML, LAYOUT_CATEGORIES, STYLE_CATEGORIES, SmartArtCollection, createDataModel, getColorXml, getLayoutXml, getStyleXml } from "@office-open/core/smartart";
@@ -3056,20 +3055,20 @@ var init_image_run = __esmMin((() => {
3056
3055
  var init_chart_space = __esmMin((() => {}));
3057
3056
  //#endregion
3058
3057
  //#region src/file/paragraph/run/chart-run.ts
3059
- var ChartRun;
3058
+ var nextChartId, ChartRun;
3060
3059
  var init_chart_run = __esmMin((() => {
3061
3060
  init_chart_space();
3062
3061
  init_drawing();
3063
3062
  init_media();
3064
3063
  init_run();
3064
+ nextChartId = 1;
3065
3065
  ChartRun = class extends Run {
3066
3066
  chartOptions;
3067
3067
  chartKey;
3068
3068
  constructor(options) {
3069
3069
  super({});
3070
3070
  this.chartOptions = options;
3071
- const hash = this.hashChartData(options);
3072
- this.chartKey = `chart_${hash}`;
3071
+ this.chartKey = `chart_${nextChartId++}`;
3073
3072
  const drawing = new Drawing({
3074
3073
  chartKey: this.chartKey,
3075
3074
  transformation: createTransformation(options.transformation),
@@ -3087,7 +3086,8 @@ var init_chart_run = __esmMin((() => {
3087
3086
  showLegend: this.chartOptions.showLegend,
3088
3087
  style: this.chartOptions.style,
3089
3088
  title: this.chartOptions.title,
3090
- type: this.chartOptions.type
3089
+ type: this.chartOptions.type,
3090
+ threeD: this.chartOptions.threeD
3091
3091
  });
3092
3092
  context.file.charts.addChart(this.chartKey, {
3093
3093
  chartSpace,
@@ -3095,15 +3095,6 @@ var init_chart_run = __esmMin((() => {
3095
3095
  });
3096
3096
  return super.prepForXml(context);
3097
3097
  }
3098
- hashChartData(options) {
3099
- const data = `${options.type}:${JSON.stringify(options.data)}`;
3100
- let hash = 0;
3101
- for (let i = 0; i < data.length; i++) {
3102
- const char = data.charCodeAt(i);
3103
- hash = (hash << 5) - hash + char | 0;
3104
- }
3105
- return Math.abs(hash);
3106
- }
3107
3098
  };
3108
3099
  }));
3109
3100
  //#endregion