@mintlify/cli 4.0.1717 → 4.0.1719

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.
@@ -15453,12 +15453,33 @@ function renderStaticHTML(state, node, renderContent2) {
15453
15453
  if (!inline)
15454
15454
  state.closeBlock();
15455
15455
  }
15456
+ var EXPRESSION_CONTINUATION_INDENT = 2;
15457
+ var JSX_CHILD_INDENT = 2;
15458
+ var shiftContinuationLines = (value, columns) => value.split("\n").map((line, index) => {
15459
+ var _a, _b;
15460
+ if (index === 0 || line === "")
15461
+ return line;
15462
+ if (columns >= 0)
15463
+ return `${" ".repeat(columns)}${line}`;
15464
+ const removable = Math.min(-columns, (_b = (_a = line.match(/^ */)) === null || _a === void 0 ? void 0 : _a[0].length) !== null && _b !== void 0 ? _b : 0);
15465
+ return line.slice(removable);
15466
+ }).join("\n");
15467
+ var alignFlowExpressions = (node, jsxDepth) => {
15468
+ if (node.type === "mdxFlowExpression") {
15469
+ node.value = shiftContinuationLines(node.value, EXPRESSION_CONTINUATION_INDENT - JSX_CHILD_INDENT * jsxDepth);
15470
+ return;
15471
+ }
15472
+ if (!("children" in node))
15473
+ return;
15474
+ const childDepth = node.type === "mdxJsxFlowElement" ? jsxDepth + 1 : jsxDepth;
15475
+ for (const child of node.children)
15476
+ alignFlowExpressions(child, childDepth);
15477
+ };
15456
15478
  var isMdxExpressionNode = (value) => typeof value === "object" && value !== null && (value.type === "mdxFlowExpression" || value.type === "mdxTextExpression") && typeof value.value === "string";
15457
15479
  function renderUnknownTag(state, node) {
15458
15480
  const mdxJsxNode = node.attrs.mdxJsxNode;
15459
15481
  if (isMdxExpressionNode(mdxJsxNode)) {
15460
- const value = mdxJsxNode.value.split("\n").map((line, index) => index === 0 || line === "" ? line : ` ${line}`).join("\n");
15461
- state.write(`{${value}}`);
15482
+ state.write(`{${shiftContinuationLines(mdxJsxNode.value, EXPRESSION_CONTINUATION_INDENT)}}`);
15462
15483
  if (node.type.name === BLOCK_TYPES.unknownTag) {
15463
15484
  state.closeBlock();
15464
15485
  }
@@ -15502,7 +15523,9 @@ var stringifyHandlers = {
15502
15523
  inlineMath: (node) => `$$${node.value}$$`
15503
15524
  };
15504
15525
  function stringifyMdxNode(children) {
15505
- const wrapped = children.map((child) => (child === null || child === void 0 ? void 0 : child.type) === "mdxJsxTextElement" ? { type: "paragraph", children: [child] } : child);
15526
+ const wrapped = structuredClone(children).map((child) => (child === null || child === void 0 ? void 0 : child.type) === "mdxJsxTextElement" ? { type: "paragraph", children: [child] } : child);
15527
+ for (const child of wrapped)
15528
+ alignFlowExpressions(child, 0);
15506
15529
  const result = unified().use(remarkMdx2).use(remarkGfm3).use(remarkMath3).use(remarkStringify, { handlers: stringifyHandlers }).stringify({ type: "root", children: wrapped });
15507
15530
  return typeof result === "string" ? result : String(result);
15508
15531
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mintlify/cli",
3
- "version": "4.0.1717",
3
+ "version": "4.0.1719",
4
4
  "description": "The Mintlify CLI",
5
5
  "engines": {
6
6
  "node": ">=18.0.0"
@@ -45,13 +45,13 @@
45
45
  },
46
46
  "dependencies": {
47
47
  "@inquirer/prompts": "7.9.0",
48
- "@mintlify/common": "1.0.1296",
49
- "@mintlify/link-rot": "3.0.1523",
48
+ "@mintlify/common": "1.0.1297",
49
+ "@mintlify/link-rot": "3.0.1524",
50
50
  "@mintlify/models": "0.0.378",
51
- "@mintlify/og": "0.0.95",
52
- "@mintlify/prebuild": "1.0.1462",
53
- "@mintlify/previewing": "4.0.1541",
54
- "@mintlify/validation": "0.1.940",
51
+ "@mintlify/og": "0.0.96",
52
+ "@mintlify/prebuild": "1.0.1463",
53
+ "@mintlify/previewing": "4.0.1542",
54
+ "@mintlify/validation": "0.1.941",
55
55
  "adm-zip": "0.6.0",
56
56
  "chalk": "5.2.0",
57
57
  "color": "4.2.3",
@@ -82,7 +82,7 @@
82
82
  "keytar": "7.9.0"
83
83
  },
84
84
  "devDependencies": {
85
- "@mintlify/editor": "0.0.563",
85
+ "@mintlify/editor": "0.0.565",
86
86
  "@mintlify/ts-config": "2.0.2",
87
87
  "@tsconfig/recommended": "1.0.2",
88
88
  "@types/detect-port": "1.3.2",
@@ -101,5 +101,5 @@
101
101
  "vitest": "2.1.9",
102
102
  "vitest-mock-process": "1.0.4"
103
103
  },
104
- "gitHead": "b944ab8e3687c4c59ea290b2fa0c8d00001ed04e"
104
+ "gitHead": "a36191dc81944ed39f6092a8d1424985e41af30a"
105
105
  }