@mintlify/cli 4.0.1553 → 4.0.1555
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.
package/bin/vendor/converter.js
CHANGED
|
@@ -2533,7 +2533,7 @@ function mdastToPm(mdast, source = "", options) {
|
|
|
2533
2533
|
return { doc, frontmatter };
|
|
2534
2534
|
}
|
|
2535
2535
|
function transformNode(node, ctx) {
|
|
2536
|
-
var _a, _b, _c, _d, _e;
|
|
2536
|
+
var _a, _b, _c, _d, _e, _f;
|
|
2537
2537
|
if (!node)
|
|
2538
2538
|
return [];
|
|
2539
2539
|
switch (node.type) {
|
|
@@ -2580,7 +2580,7 @@ function transformNode(node, ctx) {
|
|
|
2580
2580
|
return {
|
|
2581
2581
|
type: "listItem",
|
|
2582
2582
|
attrs: { checked: (_b = node.checked) !== null && _b !== void 0 ? _b : null },
|
|
2583
|
-
content: content
|
|
2583
|
+
content: ((_c = content[0]) === null || _c === void 0 ? void 0 : _c.type) === "paragraph" ? content : [{ type: "paragraph", content: [] }, ...content]
|
|
2584
2584
|
};
|
|
2585
2585
|
}
|
|
2586
2586
|
case "table":
|
|
@@ -2598,8 +2598,8 @@ function transformNode(node, ctx) {
|
|
|
2598
2598
|
attrs: {
|
|
2599
2599
|
imgAttributes: {
|
|
2600
2600
|
src: node.url,
|
|
2601
|
-
alt: (
|
|
2602
|
-
title: (
|
|
2601
|
+
alt: (_d = node.alt) !== null && _d !== void 0 ? _d : void 0,
|
|
2602
|
+
title: (_e = node.title) !== null && _e !== void 0 ? _e : void 0
|
|
2603
2603
|
}
|
|
2604
2604
|
}
|
|
2605
2605
|
};
|
|
@@ -2644,7 +2644,7 @@ function transformNode(node, ctx) {
|
|
|
2644
2644
|
const linkContent = convertLinkComponent(node, [], ctx);
|
|
2645
2645
|
if (linkContent)
|
|
2646
2646
|
return linkContent;
|
|
2647
|
-
if (!node.name || !STRUCTURED_FLOW_COMPONENTS.has(node.name) || isContainerOnlyComponent(node.name, (
|
|
2647
|
+
if (!node.name || !STRUCTURED_FLOW_COMPONENTS.has(node.name) || isContainerOnlyComponent(node.name, (_f = ctx.schema) !== null && _f !== void 0 ? _f : mintlifySchema)) {
|
|
2648
2648
|
return handleInlineJsx(node, ctx, mapChildren);
|
|
2649
2649
|
}
|
|
2650
2650
|
const flowResult = handleFlowJsx(Object.assign(Object.assign({}, node), { type: "mdxJsxFlowElement", children: node.children.length > 0 ? [{ type: "paragraph", children: node.children }] : [] }), ctx, transformNode, mapJsxChildren);
|
|
@@ -4666,13 +4666,13 @@ function* serializeDoc(doc, options, sourceMap) {
|
|
|
4666
4666
|
}
|
|
4667
4667
|
return { mdx: result, sourceMap: sourceMap !== null && sourceMap !== void 0 ? sourceMap : [] };
|
|
4668
4668
|
}
|
|
4669
|
-
function renderContent(state, node) {
|
|
4670
|
-
for (let i =
|
|
4671
|
-
renderChild(state, node, i);
|
|
4669
|
+
function renderContent(state, node, first = 0) {
|
|
4670
|
+
for (let i = first; i < node.childCount; i++)
|
|
4671
|
+
renderChild(state, node, i, first);
|
|
4672
4672
|
}
|
|
4673
|
-
function renderChild(state, node, index) {
|
|
4673
|
+
function renderChild(state, node, index, first = 0) {
|
|
4674
4674
|
const child = node.child(index);
|
|
4675
|
-
if (index >
|
|
4675
|
+
if (index > first) {
|
|
4676
4676
|
state.ensureNewLine();
|
|
4677
4677
|
const previous = node.child(index - 1);
|
|
4678
4678
|
if (needsBlankLine(previous, child))
|
|
@@ -4698,6 +4698,19 @@ function continuesLazily(previous, current) {
|
|
|
4698
4698
|
function isNonEmptyParagraph(node) {
|
|
4699
4699
|
return node.type.name === "paragraph" && node.content.size > 0;
|
|
4700
4700
|
}
|
|
4701
|
+
function renderListItem(state, item) {
|
|
4702
|
+
renderContent(state, item, startsWithPlaceholderParagraph(item) ? 1 : 0);
|
|
4703
|
+
}
|
|
4704
|
+
function hasPlaceholderParagraph(item) {
|
|
4705
|
+
const lead = item.firstChild;
|
|
4706
|
+
const next = item.maybeChild(1);
|
|
4707
|
+
return item.type.name === "listItem" && (lead === null || lead === void 0 ? void 0 : lead.type.name) === "paragraph" && lead.childCount === 0 && next !== null && next.type.name !== "paragraph";
|
|
4708
|
+
}
|
|
4709
|
+
function startsWithPlaceholderParagraph(item) {
|
|
4710
|
+
const next = item.maybeChild(1);
|
|
4711
|
+
return hasPlaceholderParagraph(item) && next !== null && fitsOnMarkerLine(item, next);
|
|
4712
|
+
}
|
|
4713
|
+
var fitsOnMarkerLine = (item, block) => item.attrs.checked == null || block.type.name === BLOCK_TYPES.image;
|
|
4701
4714
|
function needsBlankLine(prev, current) {
|
|
4702
4715
|
return BLOCK_LINE_TYPES.has(prev.type.name) || BLOCK_LINE_TYPES.has(current.type.name);
|
|
4703
4716
|
}
|
|
@@ -4743,10 +4756,10 @@ function renderNode(state, node, _parent, _index) {
|
|
|
4743
4756
|
renderBlockquote(state, node, renderNode);
|
|
4744
4757
|
break;
|
|
4745
4758
|
case "bulletList":
|
|
4746
|
-
renderList(state, node, false,
|
|
4759
|
+
renderList(state, node, false, renderListItem);
|
|
4747
4760
|
break;
|
|
4748
4761
|
case "orderedList":
|
|
4749
|
-
renderList(state, node, true,
|
|
4762
|
+
renderList(state, node, true, renderListItem);
|
|
4750
4763
|
break;
|
|
4751
4764
|
case "horizontalRule":
|
|
4752
4765
|
state.write("---");
|
|
@@ -4880,7 +4893,7 @@ function renderNode(state, node, _parent, _index) {
|
|
|
4880
4893
|
case BLOCK_TYPES.promptDescription:
|
|
4881
4894
|
break;
|
|
4882
4895
|
case "listItem":
|
|
4883
|
-
|
|
4896
|
+
renderListItem(state, node);
|
|
4884
4897
|
break;
|
|
4885
4898
|
default:
|
|
4886
4899
|
renderContent(state, node);
|
|
@@ -5776,7 +5789,8 @@ function contentChildren(node) {
|
|
|
5776
5789
|
if (TITLED_TYPES.has(node.type.name)) {
|
|
5777
5790
|
return node.childCount >= 2 ? docChildren(node.child(1)) : [];
|
|
5778
5791
|
}
|
|
5779
|
-
|
|
5792
|
+
const children = docChildren(node);
|
|
5793
|
+
return hasPlaceholderParagraph(node) ? children.slice(1) : children;
|
|
5780
5794
|
}
|
|
5781
5795
|
function sameKeys(a, b) {
|
|
5782
5796
|
return a.length === b.length && a.every((key, i) => key === b[i]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mintlify/cli",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.1555",
|
|
4
4
|
"description": "The Mintlify CLI",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=18.0.0"
|
|
@@ -46,10 +46,10 @@
|
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@inquirer/prompts": "7.9.0",
|
|
48
48
|
"@mintlify/common": "1.0.1183",
|
|
49
|
-
"@mintlify/link-rot": "3.0.
|
|
49
|
+
"@mintlify/link-rot": "3.0.1389",
|
|
50
50
|
"@mintlify/models": "0.0.362",
|
|
51
|
-
"@mintlify/prebuild": "1.0.
|
|
52
|
-
"@mintlify/previewing": "4.0.
|
|
51
|
+
"@mintlify/prebuild": "1.0.1341",
|
|
52
|
+
"@mintlify/previewing": "4.0.1413",
|
|
53
53
|
"@mintlify/validation": "0.1.878",
|
|
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.
|
|
89
|
+
"@mintlify/editor": "0.0.435",
|
|
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": "
|
|
108
|
+
"gitHead": "4c77e3b1582bafb7df9ff5796b69e1ba79cd9810"
|
|
109
109
|
}
|