@mintlify/common 1.0.1269 → 1.0.1270

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.
Files changed (26) hide show
  1. package/dist/mdx/estreeReferences.d.ts +39 -0
  2. package/dist/mdx/estreeReferences.js +963 -0
  3. package/dist/mdx/plugins/remark/firstPartyMarkdownComponents.d.ts +3 -0
  4. package/dist/mdx/plugins/remark/firstPartyMarkdownComponents.js +29 -0
  5. package/dist/mdx/plugins/remark/remarkMdxRemoveUnknownJsx/index.d.ts +1 -1
  6. package/dist/mdx/plugins/remark/remarkVisibilityForMarkdown.d.ts +7 -1
  7. package/dist/mdx/plugins/remark/remarkVisibilityForMarkdown.js +581 -177
  8. package/dist/mdx/plugins/remark/staticEvaluator.d.ts +55 -0
  9. package/dist/mdx/plugins/remark/staticEvaluator.js +639 -0
  10. package/dist/mdx/plugins/remark/unfoldComponentsForMarkdown.d.ts +71 -0
  11. package/dist/mdx/plugins/remark/unfoldComponentsForMarkdown.js +1414 -0
  12. package/dist/mdx/remark-core.d.ts +7 -0
  13. package/dist/mdx/remark-core.js +32 -0
  14. package/dist/mdx/remark.d.ts +1 -7
  15. package/dist/mdx/remark.js +2 -32
  16. package/dist/mdx/snippets/getExportMap.js +33 -5
  17. package/dist/mdx/snippets/resolveAllImports.js +3 -2
  18. package/dist/mdx/snippets/resolveImport/exportCollision.d.ts +1 -0
  19. package/dist/mdx/snippets/resolveImport/exportCollision.js +2 -1
  20. package/dist/mdx/snippets/resolveImport/index.d.ts +11 -1
  21. package/dist/mdx/snippets/resolveImport/index.js +129 -16
  22. package/dist/mdx/snippets/resolveImport/resolveComponentWithContent.js +38 -5
  23. package/dist/mdx/snippets/resolveImport/snippetDeclarations.d.ts +56 -0
  24. package/dist/mdx/snippets/resolveImport/snippetDeclarations.js +655 -0
  25. package/dist/tsconfig.build.tsbuildinfo +1 -1
  26. package/package.json +2 -2
@@ -0,0 +1,3 @@
1
+ /** Label for a link that follows block content when nothing names its target. */
2
+ export declare const BLOCK_LINK_LABEL = "Open";
3
+ export declare const FIRST_PARTY_MARKDOWN_COMPONENT_SOURCE = "\nexport const Note = ({ children }) => <blockquote>{\"[!NOTE]\\n\\n\"}{children}</blockquote>;\n\nexport const Info = ({ children }) => <blockquote>{\"[!NOTE]\\n\\n\"}{children}</blockquote>;\n\nexport const Tip = ({ children }) => <blockquote>{\"[!TIP]\\n\\n\"}{children}</blockquote>;\n\nexport const Check = ({ children }) => <blockquote>{\"[!TIP]\\n\\n\"}{children}</blockquote>;\n\nexport const Warning = ({ children }) => <blockquote>{\"[!WARNING]\\n\\n\"}{children}</blockquote>;\n\nexport const Danger = ({ children }) => <blockquote>{\"[!CAUTION]\\n\\n\"}{children}</blockquote>;\n\nexport const Card = ({ title = \"\", href = \"\", description = \"\", children }) => title === \"\" ? <blockquote>{(children ?? \"\") === \"\" ? description : children}{href === \"\" ? \"\" : <>{\"\\n\\n\"}<a href={href}>Open</a></>}</blockquote> : <blockquote><strong><a href={href}>{title}</a></strong>{\"\\n\\n\"}{(children ?? \"\") === \"\" ? description : children}</blockquote>;\n\nexport const Accordion = ({ title = \"\", description = \"\", children }) => <blockquote>{title === \"\" ? \"\" : <><strong>{title}</strong>{\"\\n\\n\"}</>}{description === \"\" ? \"\" : <>{description}{\"\\n\\n\"}</>}{children}</blockquote>;\n\nexport const ParamField = ({ path = \"\", body = \"\", query = \"\", header = \"\", type = \"\", required = false, deprecated = false, default: defaultValue = \"\", children }) => (path || body || query || header) === \"\" ? <>{children}</> : <>{\"**\" + (path || body || query || header) + \"**\"}{type === \"\" ? \"\" : \" \\`\" + type + \"\\`\"}{required ? \" *required*\" : \"\"}{deprecated ? \" *deprecated*\" : \"\"}{defaultValue === \"\" ? \"\" : \" (default: \" + defaultValue + \")\"}{\"\\n\\n\"}{children}</>;\n\nexport const ResponseField = ({ name = \"\", type = \"\", required = false, deprecated = false, default: defaultValue = \"\", children }) => name === \"\" ? <>{children}</> : <>{\"**\" + name + \"**\"}{type === \"\" ? \"\" : \" \\`\" + type + \"\\`\"}{required ? \" *required*\" : \"\"}{deprecated ? \" *deprecated*\" : \"\"}{defaultValue === \"\" ? \"\" : \" (default: \" + defaultValue + \")\"}{\"\\n\\n\"}{children}</>;\n\nexport const Steps = ({ children }) => <>{children}</>;\n\nexport const Step = ({ title = \"\", stepNumber = 1, titleSize = \"p\", children }) => <>{\"\\n\\n\"}{titleSize === \"h2\" ? \"## \" : titleSize === \"h3\" ? \"### \" : titleSize === \"h4\" ? \"#### \" : \"**\"}{title === \"\" ? \"Step \" + stepNumber : stepNumber + \". \" + title}{titleSize === \"h2\" || titleSize === \"h3\" || titleSize === \"h4\" ? \"\" : \"**\"}{\"\\n\\n\"}{children}{\"\\n\\n\"}</>;\n\nexport const Tooltip = ({ tip = \"\", children }) => tip === \"\" ? <>{children}</> : <>{children}{\" (\" + tip + \")\"}</>;\n";
@@ -0,0 +1,29 @@
1
+ /** Label for a link that follows block content when nothing names its target. */
2
+ export const BLOCK_LINK_LABEL = 'Open';
3
+ export const FIRST_PARTY_MARKDOWN_COMPONENT_SOURCE = `
4
+ export const Note = ({ children }) => <blockquote>{"[!NOTE]\\n\\n"}{children}</blockquote>;
5
+
6
+ export const Info = ({ children }) => <blockquote>{"[!NOTE]\\n\\n"}{children}</blockquote>;
7
+
8
+ export const Tip = ({ children }) => <blockquote>{"[!TIP]\\n\\n"}{children}</blockquote>;
9
+
10
+ export const Check = ({ children }) => <blockquote>{"[!TIP]\\n\\n"}{children}</blockquote>;
11
+
12
+ export const Warning = ({ children }) => <blockquote>{"[!WARNING]\\n\\n"}{children}</blockquote>;
13
+
14
+ export const Danger = ({ children }) => <blockquote>{"[!CAUTION]\\n\\n"}{children}</blockquote>;
15
+
16
+ export const Card = ({ title = "", href = "", description = "", children }) => title === "" ? <blockquote>{(children ?? "") === "" ? description : children}{href === "" ? "" : <>{"\\n\\n"}<a href={href}>${BLOCK_LINK_LABEL}</a></>}</blockquote> : <blockquote><strong><a href={href}>{title}</a></strong>{"\\n\\n"}{(children ?? "") === "" ? description : children}</blockquote>;
17
+
18
+ export const Accordion = ({ title = "", description = "", children }) => <blockquote>{title === "" ? "" : <><strong>{title}</strong>{"\\n\\n"}</>}{description === "" ? "" : <>{description}{"\\n\\n"}</>}{children}</blockquote>;
19
+
20
+ export const ParamField = ({ path = "", body = "", query = "", header = "", type = "", required = false, deprecated = false, default: defaultValue = "", children }) => (path || body || query || header) === "" ? <>{children}</> : <>{"**" + (path || body || query || header) + "**"}{type === "" ? "" : " \\\`" + type + "\\\`"}{required ? " *required*" : ""}{deprecated ? " *deprecated*" : ""}{defaultValue === "" ? "" : " (default: " + defaultValue + ")"}{"\\n\\n"}{children}</>;
21
+
22
+ export const ResponseField = ({ name = "", type = "", required = false, deprecated = false, default: defaultValue = "", children }) => name === "" ? <>{children}</> : <>{"**" + name + "**"}{type === "" ? "" : " \\\`" + type + "\\\`"}{required ? " *required*" : ""}{deprecated ? " *deprecated*" : ""}{defaultValue === "" ? "" : " (default: " + defaultValue + ")"}{"\\n\\n"}{children}</>;
23
+
24
+ export const Steps = ({ children }) => <>{children}</>;
25
+
26
+ export const Step = ({ title = "", stepNumber = 1, titleSize = "p", children }) => <>{"\\n\\n"}{titleSize === "h2" ? "## " : titleSize === "h3" ? "### " : titleSize === "h4" ? "#### " : "**"}{title === "" ? "Step " + stepNumber : stepNumber + ". " + title}{titleSize === "h2" || titleSize === "h3" || titleSize === "h4" ? "" : "**"}{"\\n\\n"}{children}{"\\n\\n"}</>;
27
+
28
+ export const Tooltip = ({ tip = "", children }) => tip === "" ? <>{children}</> : <>{children}{" (" + tip + ")"}</>;
29
+ `;
@@ -1,4 +1,4 @@
1
1
  import type { Root } from 'mdast';
2
2
  export declare const remarkMdxRemoveUnknownJsx: ({ allowlist }?: {
3
3
  allowlist?: string[];
4
- }) => (tree: Root) => Root | import("mdast-util-mdx-jsx").MdxJsxFlowElement | import("mdast-util-mdx-jsx").MdxJsxTextElement | import("mdast").Link | import("mdast").Delete | import("mdast").Code | import("mdast").Blockquote | import("mdast").Break | import("mdast").Definition | import("mdast").Emphasis | import("mdast").FootnoteDefinition | import("mdast").FootnoteReference | import("mdast").Heading | import("mdast").Html | import("mdast").Image | import("mdast").ImageReference | import("mdast").InlineCode | import("mdast").LinkReference | import("mdast").List | import("mdast").ListItem | import("mdast").Paragraph | import("mdast").Strong | import("mdast").Table | import("mdast").TableCell | import("mdast").TableRow | import("mdast").Text | import("mdast").ThematicBreak | import("mdast").Yaml | import("mdast-util-math").InlineMath | import("mdast-util-math").Math | import("mdast-util-mdx-expression").MdxTextExpression | import("mdast-util-mdx-expression").MdxFlowExpression | import("mdast-util-mdxjs-esm").MdxjsEsm;
4
+ }) => (tree: Root) => Root | import("mdast-util-mdx-jsx").MdxJsxFlowElement | import("mdast").Link | import("mdast").Delete | import("mdast").Code | import("mdast").Blockquote | import("mdast").Break | import("mdast").Definition | import("mdast").Emphasis | import("mdast").FootnoteDefinition | import("mdast").FootnoteReference | import("mdast").Heading | import("mdast").Html | import("mdast").Image | import("mdast").ImageReference | import("mdast").InlineCode | import("mdast").LinkReference | import("mdast").List | import("mdast").ListItem | import("mdast").Paragraph | import("mdast").Strong | import("mdast").Table | import("mdast").TableCell | import("mdast").TableRow | import("mdast").Text | import("mdast").ThematicBreak | import("mdast").Yaml | import("mdast-util-mdx-jsx").MdxJsxTextElement | import("mdast-util-math").InlineMath | import("mdast-util-math").Math | import("mdast-util-mdx-expression").MdxTextExpression | import("mdast-util-mdx-expression").MdxFlowExpression | import("mdast-util-mdxjs-esm").MdxjsEsm;
@@ -1,6 +1,7 @@
1
1
  import type { PageGroupRule, PageGroups } from '@mintlify/models';
2
2
  import type { Root } from 'mdast';
3
3
  import type { MdxJsxFlowElement, MdxJsxTextElement } from 'mdast-util-mdx-jsx';
4
+ import { type StaticScope } from './staticEvaluator.js';
4
5
  export type MdxJsxElement = MdxJsxFlowElement | MdxJsxTextElement;
5
6
  export declare function isVisibilityElement(node: {
6
7
  type: string;
@@ -35,7 +36,12 @@ export type VisibilityResolution = {
35
36
  export declare function isVisibilityAudience(value: unknown): value is VisibilityAudience;
36
37
  export declare const toPageGroups: (groups: VisibilityGroups) => PageGroups;
37
38
  export declare function toVisibilityGroupsRule(value: unknown): VisibilityGroupsRule | undefined;
38
- export declare function resolveVisibilityFor(node: MdxJsxElement): VisibilityResolution;
39
+ /**
40
+ * Resolves a `Visibility` audience. With `literalScope`, an evaluated audience that shows content
41
+ * to agents must resolve the same from literal values alone; otherwise it is dynamic, since an
42
+ * object it was read from may have been changed by a write the evaluator cannot see.
43
+ */
44
+ export declare function resolveVisibilityFor(node: MdxJsxElement, scope?: StaticScope, literalScope?: StaticScope): VisibilityResolution;
39
45
  export declare function isHiddenFromHumans(resolution: VisibilityResolution): boolean;
40
46
  export declare function isHiddenFromAgents(resolution: VisibilityResolution): boolean;
41
47
  export declare function toVisibilityAuthRule(resolution: VisibilityResolution): VisibilityAuthRule | undefined;