@json-to-office/core-docx 0.26.1 → 0.27.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":"createDocumentGenerator.d.ts","sourceRoot":"","sources":["../../src/plugin/createDocumentGenerator.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AAI7C,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAE9E,OAAO,KAAK,EAEV,wBAAwB,EAOxB,2BAA2B,EAC5B,MAAM,SAAS,CAAC;AAmBjB;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,kEAAkE;IAClE,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,kFAAkF;IAClF,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IAC3C,4CAA4C;IAC5C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,2BAA2B;IAC3B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,qEAAqE;IACrE,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,oFAAoF;IACpF,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB;;;;OAIG;IACH,UAAU,CAAC,EAAE,2BAA2B,CAAC;IACzC,gFAAgF;IAChF,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,sDAAsD;IACtD,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAqnBD;;GAEG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,wBAAwB,GAChC,wBAAwB,CAAC,SAAS,EAAE,CAAC,CAgBvC"}
1
+ {"version":3,"file":"createDocumentGenerator.d.ts","sourceRoot":"","sources":["../../src/plugin/createDocumentGenerator.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AAK7C,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAE9E,OAAO,KAAK,EAEV,wBAAwB,EAOxB,2BAA2B,EAC5B,MAAM,SAAS,CAAC;AAmBjB;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,kEAAkE;IAClE,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,kFAAkF;IAClF,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IAC3C,4CAA4C;IAC5C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,2BAA2B;IAC3B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,qEAAqE;IACrE,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,oFAAoF;IACpF,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB;;;;OAIG;IACH,UAAU,CAAC,EAAE,2BAA2B,CAAC;IACzC,gFAAgF;IAChF,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,sDAAsD;IACtD,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAsoBD;;GAEG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,wBAAwB,GAChC,wBAAwB,CAAC,SAAS,EAAE,CAAC,CAgBvC"}
@@ -1915,6 +1915,9 @@ function resolveBuiltInTheme(themeName, options = {}) {
1915
1915
  return getThemeWithFallback(themeName);
1916
1916
  }
1917
1917
 
1918
+ // src/plugin/createDocumentGenerator.ts
1919
+ init_themes();
1920
+
1918
1921
  // src/core/generationContext.ts
1919
1922
  import { applyExportMode, scopedThemeName } from "@json-to-office/shared";
1920
1923
 
@@ -1963,8 +1966,13 @@ function resolveThemeContext(documentIn, options = {}) {
1963
1966
  );
1964
1967
  }
1965
1968
  const document = documentIn.props === void 0 ? { ...documentIn, props: {} } : documentIn;
1966
- const baseThemeName = document.props.theme || "minimal";
1967
- let theme = resolveNamedTheme ? resolveNamedTheme(baseThemeName, warnings) : defaultNamedThemeLookup(baseThemeName, customThemes, warnings);
1969
+ const authoredThemeName = document.props.theme || void 0;
1970
+ const baseThemeName = authoredThemeName ?? "minimal";
1971
+ let theme = resolveNamedTheme ? resolveNamedTheme(
1972
+ baseThemeName,
1973
+ warnings,
1974
+ authoredThemeName !== void 0
1975
+ ) : defaultNamedThemeLookup(baseThemeName, customThemes, warnings);
1968
1976
  const themeOverrides = document.props.themeOverrides;
1969
1977
  let themeName = baseThemeName;
1970
1978
  if (themeOverrides) {
@@ -7837,7 +7845,7 @@ async function packageDocument(document, options) {
7837
7845
  // src/plugin/createDocumentGenerator.ts
7838
7846
  function createBuilderImpl(state) {
7839
7847
  const componentMap = new Map(state.components.map((c) => [c.name, c]));
7840
- function resolveDocumentTheme(themeName, warnings) {
7848
+ function resolveDocumentTheme(themeName, warnings, authored) {
7841
7849
  if (state.customThemes) {
7842
7850
  if (state.customThemes[themeName]) {
7843
7851
  return state.customThemes[themeName];
@@ -7849,6 +7857,12 @@ function createBuilderImpl(state) {
7849
7857
  return state.customThemes[key];
7850
7858
  }
7851
7859
  }
7860
+ if (authored && hasTheme(themeName)) {
7861
+ return resolveBuiltInTheme(themeName, {
7862
+ customThemes: state.customThemes,
7863
+ warnings
7864
+ });
7865
+ }
7852
7866
  if (state.theme) {
7853
7867
  return state.theme;
7854
7868
  }