@diplodoc/client 5.10.0 → 5.10.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.
@@ -26,7 +26,7 @@
26
26
  "572-e43658c1c6d9f673.css"
27
27
  ],
28
28
  "js": [
29
- "app-faa955b9788700db.js",
29
+ "app-3235acdfaf832d3c.js",
30
30
  "vendor-6439bc8e6fd71188.js",
31
31
  "react-27c1123f79611859.js"
32
32
  ],
@@ -1,6 +1,8 @@
1
- import 'react';
1
+ import type React from 'react';
2
2
  declare global {
3
3
  namespace JSX {
4
+ interface Element extends React.ReactElement<any, any> {
5
+ }
4
6
  interface IntrinsicElements {
5
7
  }
6
8
  }
@@ -17560,6 +17560,22 @@ var registerTransform = (md, {
17560
17560
  if (directiveSyntax === "enabled" || directiveSyntax === "only") {
17561
17561
  fileDirective(md, { fileExtraAttrs: extraAttrs });
17562
17562
  }
17563
+ const yfmFileGuard = (state) => {
17564
+ const tokens = state.tokens;
17565
+ for (let i = 0; i < tokens.length - 3; i++) {
17566
+ const listClose = tokens[i];
17567
+ const inlineToken = tokens[i + 2];
17568
+ const { children } = inlineToken;
17569
+ if ((listClose.type === "bullet_list_close" || listClose.type === "ordered_list_close" || listClose.type === "table_close") && tokens[i + 1].type === "paragraph_open" && inlineToken.type === "inline" && children !== null && children.length === 1 && children[0].type === FILE_TOKEN) {
17570
+ inlineToken.content = "";
17571
+ }
17572
+ }
17573
+ };
17574
+ try {
17575
+ md.core.ruler.before("curly_attributes", "yfm_file_guard", yfmFileGuard);
17576
+ } catch {
17577
+ md.core.ruler.push("yfm_file_guard", yfmFileGuard);
17578
+ }
17563
17579
  md.core.ruler.push("yfm_file_after", ({ env }) => {
17564
17580
  if (env?.[ENV_FLAG_NAME]) {
17565
17581
  env.meta ||= {};
@@ -19044,11 +19060,10 @@ function findTabs(tokens, idx, closeTokenIdx) {
19044
19060
  break;
19045
19061
  case "ordered_list_close":
19046
19062
  case "bullet_list_close":
19047
- if (!nestedLevel) {
19048
- return tabs;
19063
+ if (nestedLevel) {
19064
+ pending.tokens.push(token);
19049
19065
  }
19050
19066
  nestedLevel--;
19051
- pending.tokens.push(token);
19052
19067
  break;
19053
19068
  case "paragraph_open":
19054
19069
  if (i === closeTokenIdx && tokens[i + 1].content && tokens[i + 1].content.trim() === "{% endlist %}") {
@@ -22697,9 +22712,20 @@ module.exports = blockAnchor;
22697
22712
  const utils_1 = __webpack_require__(49963);
22698
22713
  const utils_2 = __webpack_require__(29108);
22699
22714
  const wrapInFloatingContainer = (element, id, lineWrapping, hasWrap) => {
22700
- const wrapButtonClass = hasWrap ? 'g-button_selected' : '';
22715
+ const buttonClassNames = [
22716
+ 'g-button',
22717
+ 'g-button_view_flat',
22718
+ 'g-button_size_m',
22719
+ 'g-button_pin_round-round',
22720
+ 'g-md-viewer-code-button',
22721
+ 'yfm-code-button',
22722
+ 'yfm-wrapping-button',
22723
+ ];
22724
+ if (hasWrap) {
22725
+ buttonClassNames.push('g-button_selected');
22726
+ }
22701
22727
  const wrappingButton = lineWrapping
22702
- ? `<button role="button" class="${wrapButtonClass} g-button g-button_view_flat g-button_size_m g-button_pin_round-round g-md-viewer-code-button yfm-code-button yfm-wrapping-button" tabindex="-1" type="button" aria-label="Toggle line wrapping" aria-pressed="${hasWrap}" data-tabindex="0">
22728
+ ? `<button role="button" class="${buttonClassNames.join(' ')}" tabindex="-1" type="button" aria-label="Toggle line wrapping" aria-pressed="${hasWrap}" data-tabindex="0">
22703
22729
  <span class="g-button__icon">
22704
22730
  <span class="g-button__icon-inner"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" class="g-icon" fill="currentColor" stroke="none" aria-hidden="true">
22705
22731
  <svg class="yfm-code-icon yfm-wrapping-icon" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16">