@diplodoc/client 5.5.1 → 5.5.2

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.
@@ -12689,7 +12689,6 @@ var DocPage = class extends react.Component {
12689
12689
  hideToc,
12690
12690
  footer,
12691
12691
  onChangeSinglePage,
12692
- pdfLink,
12693
12692
  pdfIconConfig,
12694
12693
  useMainTag,
12695
12694
  onChangeLang,
@@ -12702,6 +12701,7 @@ var DocPage = class extends react.Component {
12702
12701
  beforeSubNavigationContent
12703
12702
  } = this.props;
12704
12703
  const hideBurger = typeof headerHeight !== "undefined" && headerHeight > 0;
12704
+ const { tocPdfLink } = this.resolvePdfPlacement();
12705
12705
  const modes = {
12706
12706
  "regular-page-width": !wideFormat,
12707
12707
  "full-screen": fullScreen,
@@ -12734,7 +12734,7 @@ var DocPage = class extends react.Component {
12734
12734
  footer,
12735
12735
  singlePage,
12736
12736
  onChangeSinglePage,
12737
- pdfLink,
12737
+ pdfLink: tocPdfLink,
12738
12738
  pdfIconConfig,
12739
12739
  legacyToc
12740
12740
  },
@@ -12971,6 +12971,15 @@ var DocPage = class extends react.Component {
12971
12971
  const editable = toc.stage !== "preview" && meta.stage !== "preview" && meta.editable !== false && toc.editable !== false;
12972
12972
  return Boolean(editable && vcsUrl && vcsType);
12973
12973
  }
12974
+ resolvePdfPlacement() {
12975
+ const { pdfLink, pdfIconConfig } = this.props;
12976
+ const inHeader = (pdfIconConfig == null ? void 0 : pdfIconConfig.position) === "header";
12977
+ return {
12978
+ tocPdfLink: inHeader ? void 0 : pdfLink,
12979
+ headerPdfLink: inHeader ? pdfLink : void 0,
12980
+ headerPdfIconConfig: inHeader ? pdfIconConfig : void 0
12981
+ };
12982
+ }
12974
12983
  renderControls() {
12975
12984
  const {
12976
12985
  lang,
@@ -13001,6 +13010,7 @@ var DocPage = class extends react.Component {
13001
13010
  return null;
13002
13011
  }
13003
13012
  const isVerticalView = this.getIsVerticalView();
13013
+ const { headerPdfLink, headerPdfIconConfig } = this.resolvePdfPlacement();
13004
13014
  return /* @__PURE__ */ react.createElement("div", { className: DocPage_b("controls", { vertical: isVerticalView }) }, /* @__PURE__ */ react.createElement(ControlsLayout/* .ControlsLayout */.n, { isVerticalView }, /* @__PURE__ */ react.createElement(
13005
13015
  Controls/* ["default"] */.A,
13006
13016
  {
@@ -13026,7 +13036,9 @@ var DocPage = class extends react.Component {
13026
13036
  onSubscribe,
13027
13037
  hideEditControl: hideEditControl || fullScreen || !this.isEditable(),
13028
13038
  hideFeedbackControls,
13029
- availableLangs
13039
+ availableLangs,
13040
+ pdfLink: headerPdfLink,
13041
+ pdfIconConfig: headerPdfIconConfig
13030
13042
  }
13031
13043
  )));
13032
13044
  }