@mintlify/cli 4.0.1445 → 4.0.1446

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.
@@ -622,6 +622,7 @@ var nodes = {
622
622
  },
623
623
  [BLOCK_TYPES.accordionTitle]: {
624
624
  content: "text*",
625
+ marks: "bold italic strike code link",
625
626
  isolating: true
626
627
  },
627
628
  [BLOCK_TYPES.accordionBody]: {
@@ -635,6 +636,7 @@ var nodes = {
635
636
  },
636
637
  [BLOCK_TYPES.cardTitle]: {
637
638
  content: "text*",
639
+ marks: "bold italic strike code link",
638
640
  isolating: true
639
641
  },
640
642
  [BLOCK_TYPES.cardBody]: {
@@ -672,6 +674,7 @@ var nodes = {
672
674
  },
673
675
  [BLOCK_TYPES.stepTitle]: {
674
676
  content: "text*",
677
+ marks: "bold italic strike code link",
675
678
  isolating: true
676
679
  },
677
680
  [BLOCK_TYPES.stepBody]: {
@@ -844,6 +847,9 @@ function createSchema(extra) {
844
847
  import { Node } from "prosemirror-model";
845
848
  import { visit as visit2 } from "unist-util-visit";
846
849
 
850
+ // ../editor/dist/converter/parse/handlers/flow-jsx.js
851
+ import { parseTitleMarkdown } from "@mintlify/common/title-markdown";
852
+
847
853
  // ../editor/dist/converter/utils/mdx-attributes.js
848
854
  var EXPRESSION_ATTRS_KEY = "__expressionAttributes";
849
855
  var NAMED_EXPRESSION_ATTRS_KEY = "__namedExpressionAttributes";
@@ -1530,10 +1536,10 @@ function handleFlowJsxInner(node, ctx, transformNode2, mapJsxChildren2) {
1530
1536
  }
1531
1537
  const isCallout = CALLOUT_TYPES.includes(node.name);
1532
1538
  if (node.name === BLOCK_TYPES.steps) {
1533
- return handleSteps(node, ctx, mapJsxChildren2);
1539
+ return handleSteps(node, ctx, transformNode2, mapJsxChildren2);
1534
1540
  }
1535
1541
  if (node.name === BLOCK_TYPES.accordion) {
1536
- return handleAccordion(node, ctx, mapJsxChildren2);
1542
+ return handleAccordion(node, ctx, transformNode2, mapJsxChildren2);
1537
1543
  }
1538
1544
  if (node.name === BLOCK_TYPES.accordionGroup) {
1539
1545
  return {
@@ -1543,7 +1549,7 @@ function handleFlowJsxInner(node, ctx, transformNode2, mapJsxChildren2) {
1543
1549
  };
1544
1550
  }
1545
1551
  if (node.name === BLOCK_TYPES.card) {
1546
- return handleCard(node, ctx, mapJsxChildren2);
1552
+ return handleCard(node, ctx, transformNode2, mapJsxChildren2);
1547
1553
  }
1548
1554
  const toggleContentComponents = [
1549
1555
  BLOCK_TYPES.tabs,
@@ -1621,12 +1627,16 @@ function isJsxOnly(children) {
1621
1627
  function isBlockName(name) {
1622
1628
  return !!name && !HTML_ELEMENTS.has(name) && !INLINE_COMPONENTS.has(name);
1623
1629
  }
1624
- function handleSteps(node, ctx, mapJsxChildren2) {
1630
+ function createTitleNode(type2, title, ctx, transformNode2) {
1631
+ const content = typeof title === "string" && title ? parseTitleMarkdown(title).flatMap((node) => transformNode2(node, ctx)) : [];
1632
+ return Object.assign({ type: type2 }, content.length > 0 ? { content } : {});
1633
+ }
1634
+ function handleSteps(node, ctx, transformNode2, mapJsxChildren2) {
1625
1635
  const stepChildren = componentChildren(node, BLOCK_TYPES.step);
1626
1636
  const pmStepChildren = stepChildren.map((stepChild, index) => {
1627
1637
  const stepAttrs = parseMdxAttributes(stepChild.attributes);
1628
1638
  const titleText = stepAttrs.title;
1629
- const titleNode = Object.assign({ type: BLOCK_TYPES.stepTitle }, typeof titleText === "string" && titleText ? { content: [{ type: "text", text: titleText }] } : {});
1639
+ const titleNode = createTitleNode(BLOCK_TYPES.stepTitle, titleText, ctx, transformNode2);
1630
1640
  const bodyContent = mapJsxChildren2(stepChild, ctx);
1631
1641
  const bodyNode = {
1632
1642
  type: BLOCK_TYPES.stepBody,
@@ -1644,11 +1654,11 @@ function handleSteps(node, ctx, mapJsxChildren2) {
1644
1654
  content: pmStepChildren
1645
1655
  };
1646
1656
  }
1647
- function handleAccordion(node, ctx, mapJsxChildren2) {
1657
+ function handleAccordion(node, ctx, transformNode2, mapJsxChildren2) {
1648
1658
  const attrs2 = parseMdxAttributes(node.attributes);
1649
1659
  const titleText = attrs2.title;
1650
1660
  const bodyContent = mapJsxChildren2(node, ctx);
1651
- const titleNode = Object.assign({ type: BLOCK_TYPES.accordionTitle }, typeof titleText === "string" && titleText ? { content: [{ type: "text", text: titleText }] } : {});
1661
+ const titleNode = createTitleNode(BLOCK_TYPES.accordionTitle, titleText, ctx, transformNode2);
1652
1662
  const bodyNode = {
1653
1663
  type: BLOCK_TYPES.accordionBody,
1654
1664
  content: bodyContent.length > 0 ? bodyContent : [{ type: "paragraph" }]
@@ -1659,11 +1669,11 @@ function handleAccordion(node, ctx, mapJsxChildren2) {
1659
1669
  content: [titleNode, bodyNode]
1660
1670
  };
1661
1671
  }
1662
- function handleCard(node, ctx, mapJsxChildren2) {
1672
+ function handleCard(node, ctx, transformNode2, mapJsxChildren2) {
1663
1673
  const attrs2 = parseMdxAttributes(node.attributes);
1664
1674
  const titleText = attrs2.title;
1665
1675
  const bodyContent = mapJsxChildren2(node, ctx);
1666
- const titleNode = Object.assign({ type: BLOCK_TYPES.cardTitle }, typeof titleText === "string" && titleText ? { content: [{ type: "text", text: titleText }] } : {});
1676
+ const titleNode = createTitleNode(BLOCK_TYPES.cardTitle, titleText, ctx, transformNode2);
1667
1677
  const bodyNode = {
1668
1678
  type: BLOCK_TYPES.cardBody,
1669
1679
  content: bodyContent.length > 0 ? bodyContent : [{ type: "paragraph" }]
@@ -9854,6 +9864,7 @@ function formatFrontmatterValue(key, value) {
9854
9864
  }
9855
9865
 
9856
9866
  // ../editor/dist/converter/serialize/handlers/components.js
9867
+ import { titleMarkdownToText } from "@mintlify/common/title-markdown";
9857
9868
  import remarkGfm2 from "remark-gfm";
9858
9869
  import remarkMdx2 from "remark-mdx";
9859
9870
  import remarkStringify from "remark-stringify";
@@ -10442,6 +10453,14 @@ var __rest = function(s, e) {
10442
10453
  }
10443
10454
  return t;
10444
10455
  };
10456
+ var titleMarkdownSpecialCharacters = /[\\`*_[\]~]/g;
10457
+ function hasInlineMarks(node) {
10458
+ for (let index = 0; index < node.childCount; index += 1) {
10459
+ if (node.child(index).marks.length > 0)
10460
+ return true;
10461
+ }
10462
+ return false;
10463
+ }
10445
10464
  var BADGE_DEFAULTS = toDefaults(BADGE_ATTRS);
10446
10465
  var TOOLTIP_DEFAULTS = toDefaults(TOOLTIP_ATTRS);
10447
10466
  function renderCallout(state, node, renderContent2) {
@@ -10450,10 +10469,21 @@ function renderCallout(state, node, renderContent2) {
10450
10469
  const name = (_a = CALLOUT_TYPES.find((t) => t === type2)) !== null && _a !== void 0 ? _a : "Callout";
10451
10470
  renderComponentWithAttrs(state, node, name, attrs2, renderContent2);
10452
10471
  }
10453
- function renderTitledComponent(state, node, name, renderContent2, excludeAttrs = []) {
10472
+ function renderTitledComponent(state, node, name, renderContent2, renderInline2, excludeAttrs = []) {
10454
10473
  const titleChild = node.childCount > 0 ? node.child(0) : null;
10455
- const title = titleChild ? getTextContent(titleChild) : "";
10456
- const extractedAttrs = title ? Object.assign({ title }, node.attrs) : Object.assign({}, node.attrs);
10474
+ let title = "";
10475
+ if (titleChild) {
10476
+ if (hasInlineMarks(titleChild)) {
10477
+ const titleState = new SerializerState(state.options);
10478
+ renderInline2(titleState, titleChild);
10479
+ title = titleState.out;
10480
+ } else {
10481
+ const plainTitle = getTextContent(titleChild);
10482
+ title = titleMarkdownToText(plainTitle) === plainTitle ? plainTitle : plainTitle.replace(titleMarkdownSpecialCharacters, "\\$&");
10483
+ }
10484
+ }
10485
+ const titleAttribute = isJSXContent(title) ? title.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;") : title;
10486
+ const extractedAttrs = titleAttribute ? Object.assign({ title: titleAttribute }, node.attrs) : Object.assign({}, node.attrs);
10457
10487
  renderComponentWithAttrs(state, node, name, extractedAttrs, renderContent2, excludeAttrs);
10458
10488
  }
10459
10489
  function renderGenericComponent(state, node, name, renderContent2, excludeAttrs = []) {
@@ -11214,7 +11244,7 @@ function renderNode(state, node, _parent, _index) {
11214
11244
  state.closeBlock();
11215
11245
  break;
11216
11246
  case BLOCK_TYPES.card:
11217
- renderTitledComponent(state, node, "Card", renderContent);
11247
+ renderTitledComponent(state, node, "Card", renderContent, boundRenderInline);
11218
11248
  state.closeBlock();
11219
11249
  break;
11220
11250
  case BLOCK_TYPES.cardTitle:
@@ -11223,7 +11253,7 @@ function renderNode(state, node, _parent, _index) {
11223
11253
  renderContent(state, node);
11224
11254
  break;
11225
11255
  case BLOCK_TYPES.accordion:
11226
- renderTitledComponent(state, node, "Accordion", renderContent);
11256
+ renderTitledComponent(state, node, "Accordion", renderContent, boundRenderInline);
11227
11257
  state.closeBlock();
11228
11258
  break;
11229
11259
  case BLOCK_TYPES.accordionTitle:
@@ -11232,7 +11262,7 @@ function renderNode(state, node, _parent, _index) {
11232
11262
  renderContent(state, node);
11233
11263
  break;
11234
11264
  case BLOCK_TYPES.step:
11235
- renderTitledComponent(state, node, "Step", renderContent, ["isLast"]);
11265
+ renderTitledComponent(state, node, "Step", renderContent, boundRenderInline, ["isLast"]);
11236
11266
  break;
11237
11267
  case BLOCK_TYPES.stepTitle:
11238
11268
  break;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mintlify/cli",
3
- "version": "4.0.1445",
3
+ "version": "4.0.1446",
4
4
  "description": "The Mintlify CLI",
5
5
  "engines": {
6
6
  "node": ">=18.0.0"
@@ -45,11 +45,11 @@
45
45
  },
46
46
  "dependencies": {
47
47
  "@inquirer/prompts": "7.9.0",
48
- "@mintlify/common": "1.0.1115",
49
- "@mintlify/link-rot": "3.0.1317",
48
+ "@mintlify/common": "1.0.1116",
49
+ "@mintlify/link-rot": "3.0.1318",
50
50
  "@mintlify/models": "0.0.351",
51
- "@mintlify/prebuild": "1.0.1269",
52
- "@mintlify/previewing": "4.0.1341",
51
+ "@mintlify/prebuild": "1.0.1270",
52
+ "@mintlify/previewing": "4.0.1342",
53
53
  "@mintlify/validation": "0.1.842",
54
54
  "adm-zip": "0.6.0",
55
55
  "chalk": "5.2.0",
@@ -86,7 +86,7 @@
86
86
  "keytar": "7.9.0"
87
87
  },
88
88
  "devDependencies": {
89
- "@mintlify/editor": "0.0.335",
89
+ "@mintlify/editor": "0.0.336",
90
90
  "@mintlify/ts-config": "2.0.2",
91
91
  "@tsconfig/recommended": "1.0.2",
92
92
  "@types/detect-port": "1.3.2",
@@ -105,5 +105,5 @@
105
105
  "vitest": "2.1.9",
106
106
  "vitest-mock-process": "1.0.4"
107
107
  },
108
- "gitHead": "3dd1bd5b04dace1b8cbdfe03030c315929d05ce7"
108
+ "gitHead": "9f35069b62360ee001a328098f695571f2799d93"
109
109
  }