@mintlify/cli 4.0.1527 → 4.0.1529

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.
@@ -886,6 +886,36 @@ function normalizeBlockContent(nodes2, schema) {
886
886
  import { Node } from "prosemirror-model";
887
887
  import { visit as visit2 } from "unist-util-visit";
888
888
 
889
+ // ../editor/dist/converter/parse/mdx-to-mdast.js
890
+ import { preprocessCustomHeadingIds } from "@mintlify/common";
891
+ import { remark } from "remark";
892
+ import remarkFrontmatter from "remark-frontmatter";
893
+ import remarkGfm from "remark-gfm";
894
+ import remarkMath from "remark-math";
895
+ import remarkMdx from "remark-mdx";
896
+ var coreRemark = remark().use(remarkMdx).use(remarkGfm).use(remarkFrontmatter, ["yaml", "toml"]).freeze();
897
+ var mathRemark = coreRemark().use(remarkMath).freeze();
898
+ function convertHtmlCommentsToJsx(mdx) {
899
+ const parts = mdx.split(/(```[\s\S]*?```|~~~[\s\S]*?~~~)/);
900
+ return parts.map((part, i) => i % 2 === 0 ? part.replace(/<!--([\s\S]*?)-->/g, (_m, c) => `{/* ${c} */}`) : part).join("");
901
+ }
902
+ function preprocessMdxSource(mdx, options = {}) {
903
+ var _a;
904
+ const sanitized = ((_a = options.omitHtmlComments) !== null && _a !== void 0 ? _a : true) ? convertHtmlCommentsToJsx(mdx) : mdx;
905
+ return {
906
+ sanitized,
907
+ preprocessed: preprocessCustomHeadingIds(sanitized, { preserveOriginal: true })
908
+ };
909
+ }
910
+ function parsePreprocessedMdx(preprocessed, math = true) {
911
+ return (math ? mathRemark : coreRemark)().parse(preprocessed);
912
+ }
913
+ function mdxToMdast(mdx, options = {
914
+ omitHtmlComments: true
915
+ }) {
916
+ return parsePreprocessedMdx(preprocessMdxSource(mdx, options).preprocessed, options.math);
917
+ }
918
+
889
919
  // ../editor/dist/converter/utils/mdx-attributes.js
890
920
  var EXPRESSION_ATTRS_KEY = "__expressionAttributes";
891
921
  var NAMED_EXPRESSION_ATTRS_KEY = "__namedExpressionAttributes";
@@ -996,6 +1026,16 @@ function parseMdxAttributes(attributes = [], options = {}) {
996
1026
  }
997
1027
  return parsed;
998
1028
  }
1029
+ function parseExpressionAttribute(raw) {
1030
+ try {
1031
+ const [node] = parsePreprocessedMdx(`<X value={${raw}} />`, false).children;
1032
+ if ((node === null || node === void 0 ? void 0 : node.type) !== "mdxJsxFlowElement" || node.attributes.length !== 1)
1033
+ return raw;
1034
+ return parseMdxAttributes(node.attributes).value;
1035
+ } catch (_a) {
1036
+ return raw;
1037
+ }
1038
+ }
999
1039
  var REACT_RESERVED_ATTRS = /* @__PURE__ */ new Set(["ref", "key", "dangerouslySetInnerHTML"]);
1000
1040
  function sanitizeDomAttrs(attrs2) {
1001
1041
  const named = attrs2[NAMED_EXPRESSION_ATTRS_KEY];
@@ -1255,38 +1295,6 @@ function convertToInlineImage(node) {
1255
1295
 
1256
1296
  // ../editor/dist/converter/parse/handlers/prompt.js
1257
1297
  import { SKIP, visit } from "unist-util-visit";
1258
-
1259
- // ../editor/dist/converter/parse/mdx-to-mdast.js
1260
- import { preprocessCustomHeadingIds } from "@mintlify/common";
1261
- import { remark } from "remark";
1262
- import remarkFrontmatter from "remark-frontmatter";
1263
- import remarkGfm from "remark-gfm";
1264
- import remarkMath from "remark-math";
1265
- import remarkMdx from "remark-mdx";
1266
- var coreRemark = remark().use(remarkMdx).use(remarkGfm).use(remarkFrontmatter, ["yaml", "toml"]).freeze();
1267
- var mathRemark = coreRemark().use(remarkMath).freeze();
1268
- function convertHtmlCommentsToJsx(mdx) {
1269
- const parts = mdx.split(/(```[\s\S]*?```|~~~[\s\S]*?~~~)/);
1270
- return parts.map((part, i) => i % 2 === 0 ? part.replace(/<!--([\s\S]*?)-->/g, (_m, c) => `{/* ${c} */}`) : part).join("");
1271
- }
1272
- function preprocessMdxSource(mdx, options = {}) {
1273
- var _a;
1274
- const sanitized = ((_a = options.omitHtmlComments) !== null && _a !== void 0 ? _a : true) ? convertHtmlCommentsToJsx(mdx) : mdx;
1275
- return {
1276
- sanitized,
1277
- preprocessed: preprocessCustomHeadingIds(sanitized, { preserveOriginal: true })
1278
- };
1279
- }
1280
- function parsePreprocessedMdx(preprocessed, math = true) {
1281
- return (math ? mathRemark : coreRemark)().parse(preprocessed);
1282
- }
1283
- function mdxToMdast(mdx, options = {
1284
- omitHtmlComments: true
1285
- }) {
1286
- return parsePreprocessedMdx(preprocessMdxSource(mdx, options).preprocessed, options.math);
1287
- }
1288
-
1289
- // ../editor/dist/converter/parse/handlers/prompt.js
1290
1298
  function handlePrompt(node, ctx, transformNode2) {
1291
1299
  var _a;
1292
1300
  const icon = readPromptAttr(node, "icon");
@@ -2984,7 +2992,7 @@ function isWordChar(ch) {
2984
2992
  }
2985
2993
  var SerializerState = class {
2986
2994
  constructor(options = {}) {
2987
- var _a, _b, _c, _d;
2995
+ var _a, _b, _c, _d, _e;
2988
2996
  this.chunks = [];
2989
2997
  this.chunkStarts = [];
2990
2998
  this.outLength = 0;
@@ -3003,8 +3011,9 @@ var SerializerState = class {
3003
3011
  this.options = {
3004
3012
  tightLists: (_a = options.tightLists) !== null && _a !== void 0 ? _a : false,
3005
3013
  indentSize: (_b = options.indentSize) !== null && _b !== void 0 ? _b : 2,
3006
- removeTrailingNewline: (_c = options.removeTrailingNewline) !== null && _c !== void 0 ? _c : true,
3007
- hasReferenceDefinitions: (_d = options.hasReferenceDefinitions) !== null && _d !== void 0 ? _d : false
3014
+ listIndentSize: (_c = options.listIndentSize) !== null && _c !== void 0 ? _c : 0,
3015
+ removeTrailingNewline: (_d = options.removeTrailingNewline) !== null && _d !== void 0 ? _d : true,
3016
+ hasReferenceDefinitions: (_e = options.hasReferenceDefinitions) !== null && _e !== void 0 ? _e : false
3008
3017
  };
3009
3018
  this.indentSize = this.options.indentSize;
3010
3019
  this.hasReferenceDefinitions = this.options.hasReferenceDefinitions;
@@ -3484,7 +3493,7 @@ function renderList(state, node, ordered, renderContent2) {
3484
3493
  const checked = child.attrs.checked;
3485
3494
  const taskMarker = checked == null ? "" : checked ? "[x] " : "[ ] ";
3486
3495
  const prefix = (ordered ? `${start + i}. ` : "- ") + taskMarker;
3487
- const indent = " ".repeat(prefix.length);
3496
+ const indent = " ".repeat(Math.max(prefix.length, state.options.listIndentSize));
3488
3497
  const itemState = new SerializerState(state.options);
3489
3498
  itemState.sourceMap = state.sourceMap ? [] : null;
3490
3499
  renderContent2(itemState, child);
@@ -6467,6 +6476,7 @@ export {
6467
6476
  mintlifySchema,
6468
6477
  nodeSize,
6469
6478
  nodesMatch,
6479
+ parseExpressionAttribute,
6470
6480
  parseFrontmatterYaml,
6471
6481
  parseLineRanges,
6472
6482
  parseMdxAttributes,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mintlify/cli",
3
- "version": "4.0.1527",
3
+ "version": "4.0.1529",
4
4
  "description": "The Mintlify CLI",
5
5
  "engines": {
6
6
  "node": ">=18.0.0"
@@ -86,7 +86,7 @@
86
86
  "keytar": "7.9.0"
87
87
  },
88
88
  "devDependencies": {
89
- "@mintlify/editor": "0.0.410",
89
+ "@mintlify/editor": "0.0.412",
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": "258d8ffc81ca93d98057c7ebd82bfcdfefafbe1b"
108
+ "gitHead": "6b00c625734d23c42776f2d5c7129ce0e2e3db50"
109
109
  }