@diplodoc/client 2.0.2 → 2.0.3

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.
@@ -22604,7 +22604,7 @@ bem-cn/lib/index.js:
22604
22604
 
22605
22605
  /***/ }),
22606
22606
 
22607
- /***/ 9703:
22607
+ /***/ 8648:
22608
22608
  /***/ (() => {
22609
22609
 
22610
22610
  "use strict";
@@ -22668,27 +22668,27 @@ bem-cn/lib/index.js:
22668
22668
 
22669
22669
  // node_modules/@diplodoc/tabs-extension/runtime/index.js
22670
22670
  (() => {
22671
- var E = "yfm-tabs", L = "yfm-tab-list", S = "yfm-tab", y = "yfm-tab-panel", m = "active", G = "data-diplodoc-group", h = "data-diplodoc-key", x = "data-diplodoc-id";
22672
- var O = "defaultTabsGroup-", I = Symbol.for("diplodocTabs");
22673
- var p = (c) => {
22674
- let t = c.composedPath();
22675
- return Array.isArray(t) && t.length > 0 ? t[0] : c.target;
22676
- }, _ = (c) => {
22677
- let t = p(c);
22671
+ var y = "yfm-tabs", E = "yfm-tab-list", S = "yfm-tab", L = "yfm-tab-panel", I = "active", G = "data-diplodoc-group", x = "data-diplodoc-key", h = "data-diplodoc-id";
22672
+ var H = "defaultTabsGroup-", m = Symbol.for("diplodocTabs");
22673
+ var T = (n) => {
22674
+ let t = n.composedPath();
22675
+ return Array.isArray(t) && t.length > 0 ? t[0] : n.target;
22676
+ }, _ = (n) => {
22677
+ let t = T(n);
22678
22678
  return !t || !t.matches;
22679
- }, T = (c) => Math.abs(c.scrollHeight - c.clientHeight) > 1 ? c : c.parentElement ? T(c.parentElement) : void 0, u = (c, t) => {
22680
- let e = c.getBoundingClientRect(), o = t.getBoundingClientRect();
22679
+ }, p = (n) => Math.abs(n.scrollHeight - n.clientHeight) > 1 ? n : n.parentElement ? p(n.parentElement) : void 0, u = (n, t) => {
22680
+ let e = n.getBoundingClientRect(), o = t.getBoundingClientRect();
22681
22681
  return { top: e.top - o.top, left: e.left - o.left };
22682
22682
  };
22683
- var l = { TABS: `.${E}`, TAB_LIST: `.${L}`, TAB: `.${S}`, TAB_PANEL: `.${y}` }, d = class {
22683
+ var c = { TABS: `.${y}`, TAB_LIST: `.${E}`, TAB: `.${S}`, TAB_PANEL: `.${L}` }, b = class {
22684
22684
  constructor(t) {
22685
22685
  this._onSelectTabHandlers = /* @__PURE__ */ new Set();
22686
22686
  this._document = t, this._document.addEventListener("click", (e) => {
22687
- let o = p(e);
22687
+ let o = T(e);
22688
22688
  if (_(e) || !this.isValidTabElement(o))
22689
22689
  return;
22690
- let n = this.getTabDataFromHTMLElement(o);
22691
- n && this._selectTab(n, o);
22690
+ let l = this.getTabDataFromHTMLElement(o);
22691
+ l && this._selectTab(l, o);
22692
22692
  });
22693
22693
  }
22694
22694
  onSelectTab(t) {
@@ -22697,57 +22697,57 @@ bem-cn/lib/index.js:
22697
22697
  };
22698
22698
  }
22699
22699
  selectTabById(t, e) {
22700
- let o = this._document.querySelector(`${l.TAB}[${x}="${t}"]`);
22700
+ let o = this._document.querySelector(`${c.TAB}[${h}="${t}"]`);
22701
22701
  if (!o || !this.isValidTabElement(o))
22702
22702
  return;
22703
- let n = this.getTabDataFromHTMLElement(o);
22704
- n && this._selectTab(n, o), e != null && e.scrollToElement && o.scrollIntoView();
22703
+ let l = this.getTabDataFromHTMLElement(o);
22704
+ l && this._selectTab(l, o), e != null && e.scrollToElement && o.scrollIntoView();
22705
22705
  }
22706
22706
  selectTab(t) {
22707
22707
  this._selectTab(t);
22708
22708
  }
22709
22709
  _selectTab(t, e) {
22710
- let { group: o, key: n } = t;
22710
+ let { group: o, key: l } = t;
22711
22711
  if (!o)
22712
22712
  return;
22713
- let a = e && T(e), s = a && u(e, a);
22714
- this.updateHTML({ group: o, key: n }) > 0 && (s && this.resetScroll(e, a, s), this.fireSelectTabEvent({ group: o, key: n }, e == null ? void 0 : e.dataset.diplodocId));
22713
+ let s = e && p(e), a = s && u(e, s);
22714
+ this.updateHTML({ group: o, key: l }) > 0 && (a && this.resetScroll(e, s, a), this.fireSelectTabEvent({ group: o, key: l }, e == null ? void 0 : e.dataset.diplodocId));
22715
22715
  }
22716
22716
  updateHTML(t) {
22717
- let { group: e, key: o } = t, n = this._document.querySelectorAll(`${l.TABS}[${G}="${e}"] ${l.TAB}[${h}="${o}"]`), a = 0;
22718
- return n.forEach((s) => {
22719
- let b = s;
22720
- if (!this.isValidTabElement(b) || b.dataset.diplodocIsActive === "true")
22717
+ let { group: e, key: o } = t, l = this._document.querySelectorAll(`${c.TABS}[${G}="${e}"] ${c.TAB}[${x}="${o}"]`), s = 0;
22718
+ return l.forEach((a) => {
22719
+ let g = a;
22720
+ if (!this.isValidTabElement(g) || g.dataset.diplodocIsActive === "true")
22721
22721
  return;
22722
- a++;
22723
- let C = s, g = C.parentNode, r = g == null ? void 0 : g.parentNode, B = Array.from((r == null ? void 0 : r.querySelectorAll(l.TAB)) || []), X = Array.from((r == null ? void 0 : r.querySelectorAll(l.TAB_PANEL)) || []), F = B.indexOf(C);
22724
- B.forEach((A, f) => {
22725
- let M = X[f], i = f === F, H = A;
22726
- H.dataset.diplodocIsActive = i ? "true" : "false", A.classList.toggle(m, i), A.setAttribute("aria-selected", i.toString()), A.setAttribute("tabindex", i ? "0" : "-1"), M.classList.toggle(m, i);
22722
+ s++;
22723
+ let C = a, d = C.parentNode, i = d == null ? void 0 : d.parentNode, f = Array.from((i == null ? void 0 : i.querySelectorAll(c.TAB)) || []), v = Array.from((i == null ? void 0 : i.querySelectorAll(c.TAB_PANEL)) || []), D = f.indexOf(C);
22724
+ f.forEach((A, B) => {
22725
+ let O = v[B], r = B === D, F = A;
22726
+ F.dataset.diplodocIsActive = r ? "true" : "false", A.classList.toggle(I, r), A.setAttribute("aria-selected", r.toString()), A.setAttribute("tabindex", r ? "-1" : "0"), O.classList.toggle(I, r);
22727
22727
  });
22728
- }), a;
22728
+ }), s;
22729
22729
  }
22730
22730
  resetScroll(t, e, o) {
22731
- let n = u(t, e);
22732
- e.scrollTo(n.left + e.scrollLeft - o.left, n.top + e.scrollTop - o.top);
22731
+ let l = u(t, e);
22732
+ e.scrollTo(l.left + e.scrollLeft - o.left, l.top + e.scrollTop - o.top);
22733
22733
  }
22734
22734
  fireSelectTabEvent(t, e) {
22735
- let { group: o, key: n } = t, a = o.startsWith(O) ? { key: n } : t;
22736
- this._onSelectTabHandlers.forEach((s) => {
22737
- s({ tab: a, currentTabId: e });
22735
+ let { group: o, key: l } = t, s = o.startsWith(H) ? { key: l } : t;
22736
+ this._onSelectTabHandlers.forEach((a) => {
22737
+ a({ tab: s, currentTabId: e });
22738
22738
  });
22739
22739
  }
22740
22740
  isValidTabElement(t) {
22741
- let e = t.matches(l.TAB) && t.dataset.diplodocId ? t.closest(l.TAB_LIST) : null;
22742
- return e == null ? void 0 : e.closest(l.TABS);
22741
+ let e = t.matches(c.TAB) && t.dataset.diplodocId ? t.closest(c.TAB_LIST) : null;
22742
+ return e == null ? void 0 : e.closest(c.TABS);
22743
22743
  }
22744
22744
  getTabDataFromHTMLElement(t) {
22745
- var n;
22746
- let e = t.dataset.diplodocKey, o = (n = t.closest(l.TABS)) == null ? void 0 : n.dataset.diplodocGroup;
22745
+ var l;
22746
+ let e = t.dataset.diplodocKey, o = (l = t.closest(c.TABS)) == null ? void 0 : l.dataset.diplodocGroup;
22747
22747
  return e && o ? { group: o, key: e } : null;
22748
22748
  }
22749
22749
  };
22750
- typeof window != "undefined" && typeof document != "undefined" && !window[I] && (window[I] = new d(document));
22750
+ typeof window != "undefined" && typeof document != "undefined" && !window[m] && (window[m] = new b(document));
22751
22751
  })();
22752
22752
 
22753
22753
  // src/js/polyfill.js
@@ -23332,8 +23332,8 @@ __webpack_require__.d(__webpack_exports__, {
23332
23332
  var tslib_es6 = __webpack_require__(7582);
23333
23333
  // EXTERNAL MODULE: ./node_modules/react/index.js
23334
23334
  var react = __webpack_require__(7294);
23335
- // EXTERNAL MODULE: ./node_modules/@doc-tools/transform/dist/js/yfm.js
23336
- var yfm = __webpack_require__(9703);
23335
+ // EXTERNAL MODULE: ./node_modules/@diplodoc/transform/dist/js/yfm.js
23336
+ var yfm = __webpack_require__(8648);
23337
23337
  // EXTERNAL MODULE: ./node_modules/@gravity-ui/page-constructor/build/esm/context/mobileContext/MobileContext.js
23338
23338
  var MobileContext = __webpack_require__(3903);
23339
23339
  // EXTERNAL MODULE: ./node_modules/@bem-react/classname/index.js