@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.
- package/dist/mdx/estreeReferences.d.ts +39 -0
- package/dist/mdx/estreeReferences.js +963 -0
- package/dist/mdx/plugins/remark/firstPartyMarkdownComponents.d.ts +3 -0
- package/dist/mdx/plugins/remark/firstPartyMarkdownComponents.js +29 -0
- package/dist/mdx/plugins/remark/remarkMdxRemoveUnknownJsx/index.d.ts +1 -1
- package/dist/mdx/plugins/remark/remarkVisibilityForMarkdown.d.ts +7 -1
- package/dist/mdx/plugins/remark/remarkVisibilityForMarkdown.js +581 -177
- package/dist/mdx/plugins/remark/staticEvaluator.d.ts +55 -0
- package/dist/mdx/plugins/remark/staticEvaluator.js +639 -0
- package/dist/mdx/plugins/remark/unfoldComponentsForMarkdown.d.ts +71 -0
- package/dist/mdx/plugins/remark/unfoldComponentsForMarkdown.js +1414 -0
- package/dist/mdx/remark-core.d.ts +7 -0
- package/dist/mdx/remark-core.js +32 -0
- package/dist/mdx/remark.d.ts +1 -7
- package/dist/mdx/remark.js +2 -32
- package/dist/mdx/snippets/getExportMap.js +33 -5
- package/dist/mdx/snippets/resolveAllImports.js +3 -2
- package/dist/mdx/snippets/resolveImport/exportCollision.d.ts +1 -0
- package/dist/mdx/snippets/resolveImport/exportCollision.js +2 -1
- package/dist/mdx/snippets/resolveImport/index.d.ts +11 -1
- package/dist/mdx/snippets/resolveImport/index.js +129 -16
- package/dist/mdx/snippets/resolveImport/resolveComponentWithContent.js +38 -5
- package/dist/mdx/snippets/resolveImport/snippetDeclarations.d.ts +56 -0
- package/dist/mdx/snippets/resolveImport/snippetDeclarations.js +655 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { Heading, Root } from 'mdast';
|
|
2
|
+
import type { MdxJsxFlowElement, MdxJsxTextElement } from 'mdast-util-mdx-jsx';
|
|
3
|
+
import { type ComponentDef, type EvalEnv, type MarkdownComponentContext, type StaticScope, type StaticValue } from './staticEvaluator.js';
|
|
4
|
+
export type UnfoldBudget = {
|
|
5
|
+
remainingBytes: number;
|
|
6
|
+
remainingCalls: number;
|
|
7
|
+
};
|
|
8
|
+
export declare const MAX_UNFOLD_OUTPUT_BYTES = 2000000;
|
|
9
|
+
export declare const MAX_UNFOLD_CALLS = 20000;
|
|
10
|
+
export declare const MAX_UNFOLD_DEPTH = 24;
|
|
11
|
+
export declare function createUnfoldBudget(): UnfoldBudget;
|
|
12
|
+
export declare function chargeUnfoldBudget(ctx: UnfoldContext, cost: number): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Whether a definition, or any component it renders, may hide content from agents. Degrading such
|
|
15
|
+
* a usage to its raw children when an unfold limit is hit could expose what its `Visibility`
|
|
16
|
+
* gates, so it is dropped instead.
|
|
17
|
+
*/
|
|
18
|
+
export declare function definitionGatesContent(def: ComponentDef, defs: ReadonlyMap<string, ComponentDef>, seen?: Set<ComponentDef>): boolean;
|
|
19
|
+
export declare function chargeUnfoldCall(ctx: UnfoldContext): boolean;
|
|
20
|
+
export type UnfoldContext = MarkdownComponentContext & {
|
|
21
|
+
stack: readonly ComponentDef[];
|
|
22
|
+
budget: UnfoldBudget;
|
|
23
|
+
/**
|
|
24
|
+
* Inside a definition, its scope built only from literal values and props supplied from them.
|
|
25
|
+
* At the page level this is the literal scope.
|
|
26
|
+
*/
|
|
27
|
+
trusted?: EvalEnv;
|
|
28
|
+
};
|
|
29
|
+
/** The environment holding only values that no write the evaluator cannot see can make stale. */
|
|
30
|
+
export declare function trustedEnv(ctx: UnfoldContext): EvalEnv;
|
|
31
|
+
/** Props as evaluated from trusted values, and the names that could not be. */
|
|
32
|
+
export type TrustedProps = {
|
|
33
|
+
props: StaticScope;
|
|
34
|
+
failedProps: ReadonlySet<string>;
|
|
35
|
+
};
|
|
36
|
+
export declare const FAILED_SPREAD = "*";
|
|
37
|
+
export declare function collectMarkdownComponentContext(tree: Root): MarkdownComponentContext;
|
|
38
|
+
export declare function getFirstPartyComponentDefs(): Map<string, ComponentDef>;
|
|
39
|
+
export declare const DROP_ELEMENTS: Set<string>;
|
|
40
|
+
export declare const UNWRAP_BLOCK_ELEMENTS: Set<string>;
|
|
41
|
+
export declare const UNWRAP_INLINE_ELEMENTS: Set<string>;
|
|
42
|
+
export declare const HEADING_ELEMENTS: Record<string, Heading['depth']>;
|
|
43
|
+
/** Styling and internal hooks that mean nothing once the page is plain markdown. */
|
|
44
|
+
export declare function isPresentationalAttribute(name: string): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Drops a dark-mode-only copy when its light-mode-only twin sits right next to it, since both
|
|
47
|
+
* carry the same content once their classes are gone. Each light copy pairs with one dark copy,
|
|
48
|
+
* and a dark-only element without an adjacent twin stays.
|
|
49
|
+
*/
|
|
50
|
+
export declare function dropPairedDarkOnly<T>(children: readonly T[], classOf: (child: T) => unknown): T[];
|
|
51
|
+
export declare const KEEP_TAG_COMPONENTS: Set<string>;
|
|
52
|
+
export declare const HEADLINE_ATTRIBUTES: string[];
|
|
53
|
+
export declare const GFM_ALERT_PATTERN: RegExp;
|
|
54
|
+
export declare function prefixBlockquoteLines(text: string): string;
|
|
55
|
+
export declare function escapeInterpolatedText(value: string): string;
|
|
56
|
+
export declare function markdownLinkDestination(url: string): string;
|
|
57
|
+
/** Escapes brackets outside code spans and images, so a label cannot end its link early. */
|
|
58
|
+
export declare function escapeLinkLabel(text: string): string;
|
|
59
|
+
export declare function materializeComponent(def: ComponentDef, name: string, props: StaticScope, childrenMarkdown: string, ctx: UnfoldContext, failedProps?: ReadonlySet<string>, bodyValue?: {
|
|
60
|
+
value: StaticValue;
|
|
61
|
+
}, trusted?: TrustedProps): string | undefined;
|
|
62
|
+
export type MdxUsageElement = MdxJsxFlowElement | MdxJsxTextElement;
|
|
63
|
+
export declare function collectUsageProps(node: MdxUsageElement, ctx: UnfoldContext, failed?: Set<string>): StaticScope;
|
|
64
|
+
export declare function extractProgramExpression(estree: unknown): unknown;
|
|
65
|
+
/** Whether `node` contains a JSX element or fragment, or only one named `name` when given. */
|
|
66
|
+
export declare function containsJsx(node: unknown, name?: string): boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Serializes an expression that renders JSX: an element or fragment, or a conditional or logical
|
|
69
|
+
* expression with JSX in a branch. A branch whose condition cannot be resolved is dropped.
|
|
70
|
+
*/
|
|
71
|
+
export declare function serializeExpressionJsx(expression: unknown, ctx: UnfoldContext): string | undefined;
|