@json-to-office/core-pptx 6.0.0 → 6.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.
@@ -1 +1 @@
1
- {"version":3,"file":"expandHighcharts.d.ts","sourceRoot":"","sources":["../../src/core/expandHighcharts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAeL,KAAK,uBAAuB,EAC5B,KAAK,iBAAiB,EACvB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EACV,eAAe,EAGf,qBAAqB,EACtB,MAAM,UAAU,CAAC;AAUlB,MAAM,WAAW,yBAAyB;IACxC,YAAY,EAAE,qBAAqB,CAAC;CACrC;AAED;;;;;GAKG;AACH,wBAAsB,0BAA0B,CAC9C,YAAY,EAAE,qBAAqB,EACnC,QAAQ,EAAE,uBAAuB,GAAG,SAAS,EAC7C,QAAQ,EAAE,eAAe,EAAE,EAC3B,UAAU,CAAC,EAAE,SAAS,iBAAiB,EAAE,GACxC,OAAO,CAAC,yBAAyB,CAAC,CAwBpC"}
1
+ {"version":3,"file":"expandHighcharts.d.ts","sourceRoot":"","sources":["../../src/core/expandHighcharts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAcL,KAAK,uBAAuB,EAC5B,KAAK,iBAAiB,EACvB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EACV,eAAe,EAGf,qBAAqB,EACtB,MAAM,UAAU,CAAC;AAUlB,MAAM,WAAW,yBAAyB;IACxC,YAAY,EAAE,qBAAqB,CAAC;CACrC;AAED;;;;;GAKG;AACH,wBAAsB,0BAA0B,CAC9C,YAAY,EAAE,qBAAqB,EACnC,QAAQ,EAAE,uBAAuB,GAAG,SAAS,EAC7C,QAAQ,EAAE,eAAe,EAAE,EAC3B,UAAU,CAAC,EAAE,SAAS,iBAAiB,EAAE,GACxC,OAAO,CAAC,yBAAyB,CAAC,CAwBpC"}
package/dist/index.js CHANGED
@@ -3937,12 +3937,11 @@ import {
3937
3937
  REMOTE_EXPORT_WARNING,
3938
3938
  chartFamilyResolver,
3939
3939
  chartPointsPerPixel,
3940
- chartRequestKey,
3941
- dedupeChartRequest,
3942
- limitChartRequest,
3943
3940
  postJsonToService,
3941
+ recordChartCollected,
3944
3942
  recordChartRetry,
3945
3943
  resolveServiceUrl,
3944
+ sendChartRequest,
3946
3945
  withChartFontFaceCss,
3947
3946
  withChartTypography
3948
3947
  } from "@json-to-office/shared";
@@ -4001,24 +4000,21 @@ async function expandList(components, path4, scope) {
4001
4000
  }
4002
4001
  async function expandOne(component, path4, scope) {
4003
4002
  const props = component.props;
4004
- const chart = await limitChartRequest(
4005
- exportServerUrl(props.serverUrl, scope.services?.serverUrl),
4006
- scope.services?.concurrency,
4007
- () => renderChart(
4008
- withChartFontFaces(
4009
- withThemeTypography(
4010
- withThemeColors(props, scope.theme, scope.warnings),
4011
- scope.theme,
4012
- scope.slideWidth,
4013
- scope.warnings
4014
- ),
4003
+ recordChartCollected();
4004
+ const chart = await renderChart(
4005
+ withChartFontFaces(
4006
+ withThemeTypography(
4007
+ withThemeColors(props, scope.theme, scope.warnings),
4015
4008
  scope.theme,
4016
- scope.chartFonts
4009
+ scope.slideWidth,
4010
+ scope.warnings
4017
4011
  ),
4018
- scope.services,
4019
- scope.warnings,
4020
- scope.chartCache
4021
- )
4012
+ scope.theme,
4013
+ scope.chartFonts
4014
+ ),
4015
+ scope.services,
4016
+ scope.warnings,
4017
+ scope.chartCache
4022
4018
  );
4023
4019
  void path4;
4024
4020
  return {
@@ -4063,14 +4059,16 @@ async function renderChart(config, services, warnings, cache) {
4063
4059
  // for callers that omit it.
4064
4060
  ...config.resources ? { resources: config.resources } : {}
4065
4061
  };
4066
- return dedupeChartRequest(
4062
+ return sendChartRequest({
4067
4063
  cache,
4068
- chartRequestKey(serverUrl, requestBody),
4069
- () => postChart(serverUrl, requestBody, config, services)
4070
- );
4064
+ serverUrl,
4065
+ concurrency: services?.concurrency,
4066
+ requestBody,
4067
+ send: () => postChart(serverUrl, requestBody, config, services)
4068
+ });
4071
4069
  }
4072
4070
  async function postChart(serverUrl, requestBody, config, services) {
4073
- const response = await postJsonToService({
4071
+ const base64Data = await postJsonToService({
4074
4072
  url: serverUrl,
4075
4073
  path: "/export",
4076
4074
  body: requestBody,
@@ -4082,10 +4080,11 @@ async function postChart(serverUrl, requestBody, config, services) {
4082
4080
  // The code lets a server route report a missing export server as a
4083
4081
  // dependency outage with this message, not as an internal error.
4084
4082
  onUnreachable: (url, cause) => `Highcharts Export Server is not running at ${url}. Start it with: npx highcharts-export-server --enableServer true
4085
- Cause: ${cause}`
4083
+ Cause: ${cause}`,
4084
+ decode: (response) => response.text()
4086
4085
  });
4087
4086
  return {
4088
- dataUri: `data:image/png;base64,${await response.text()}`,
4087
+ dataUri: `data:image/png;base64,${base64Data}`,
4089
4088
  widthPx: config.options.chart?.width ?? DEFAULT_CHART_WIDTH_PX,
4090
4089
  heightPx: config.options.chart?.height ?? 720
4091
4090
  };