@mintlify/common 1.0.1306 → 1.0.1307

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 (62) hide show
  1. package/dist/apiStaticExportBasePaths.d.ts +1 -1
  2. package/dist/asyncapi/parser/getExamplesData.js +4 -3
  3. package/dist/asyncapi/parser/getMessagesData.js +6 -5
  4. package/dist/asyncapi/parser/getOperationsData.js +4 -3
  5. package/dist/colors.js +9 -8
  6. package/dist/css/tailwind.d.ts +1 -1
  7. package/dist/css/tailwindInternals.d.ts +1 -1
  8. package/dist/entitlements/index.d.ts +1 -1
  9. package/dist/getDisplayDomain.js +2 -1
  10. package/dist/getFileCategory.d.ts +2 -2
  11. package/dist/graphql/resolveGraphqlOperation.d.ts +1 -1
  12. package/dist/isAbsoluteUrl.d.ts +1 -1
  13. package/dist/mdx/currencyMath.js +2 -1
  14. package/dist/mdx/getCodeStyling.d.ts +1 -1
  15. package/dist/mdx/getMDXOptions.d.ts +2 -2
  16. package/dist/mdx/islands/extractPackageIslands.js +6 -5
  17. package/dist/mdx/islands/island-bindings.js +4 -3
  18. package/dist/mdx/islands/island-module-builder.js +12 -13
  19. package/dist/mdx/islands/package-page-url.js +4 -2
  20. package/dist/mdx/islands/package-sources.js +5 -3
  21. package/dist/mdx/islands/packageImports.js +4 -3
  22. package/dist/mdx/islands/remarkPackageIslands.js +10 -8
  23. package/dist/mdx/lib/mdx-utils.d.ts +1 -1
  24. package/dist/mdx/page-style.js +2 -1
  25. package/dist/mdx/plugins/rehype/rehypeCodeBlocks/index.js +4 -3
  26. package/dist/mdx/plugins/rehype/rehypeCodeBlocks/metaOptions.d.ts +4 -4
  27. package/dist/mdx/plugins/rehype/rehypeCodeBlocks/metaOptions.js +8 -6
  28. package/dist/mdx/plugins/rehype/rehypeDynamicTailwindCss.js +4 -3
  29. package/dist/mdx/plugins/remark/pureTemplateComponents.js +6 -8
  30. package/dist/mdx/plugins/remark/remarkComponentIds.js +6 -8
  31. package/dist/mdx/plugins/remark/remarkExtractTableOfContents.js +11 -9
  32. package/dist/mdx/plugins/remark/remarkMdxExpandExpressions.js +10 -7
  33. package/dist/mdx/plugins/remark/remarkMdxRemoveJs.js +7 -8
  34. package/dist/mdx/plugins/remark/remarkMdxRemoveUnknownJsx/index.d.ts +1 -1
  35. package/dist/mdx/plugins/remark/remarkPrompt.js +1 -1
  36. package/dist/mdx/plugins/remark/remarkVisibilityForMarkdown.d.ts +1 -1
  37. package/dist/mdx/plugins/remark/remarkVisibilityForMarkdown.js +10 -8
  38. package/dist/mdx/plugins/remark/staticEvaluator.js +4 -2
  39. package/dist/mdx/plugins/remark/unfoldComponentsForMarkdown.js +2 -1
  40. package/dist/mdx/preprocessCustomHeadingIds.js +5 -4
  41. package/dist/mdx/server-only/getMdx.d.ts +1 -1
  42. package/dist/mdx/server-only/getMdx.js +2 -1
  43. package/dist/mdx/snippets/constants.d.ts +1 -1
  44. package/dist/mdx/snippets/isBareSpecifier.d.ts +1 -1
  45. package/dist/mdx/snippets/resolveAllImports.js +21 -29
  46. package/dist/mdx/snippets/resolveImport/snippetDeclarations.js +4 -7
  47. package/dist/mdx/utils.d.ts +1 -1
  48. package/dist/navigation/filterDivisions.js +1 -2
  49. package/dist/navigation/scopeNavToPath.d.ts +1 -1
  50. package/dist/navigation/scopeNavToPath.js +4 -4
  51. package/dist/navigation/updateFirstHrefInDivision.d.ts +1 -1
  52. package/dist/openapi/additionalOperations.js +6 -5
  53. package/dist/openapi/encodings.js +2 -1
  54. package/dist/openapi/generateOpenApiPages.js +17 -16
  55. package/dist/openapi/getTagDisplayName.d.ts +1 -1
  56. package/dist/openapi/overlay/errors.d.ts +1 -1
  57. package/dist/openapi/overlay/overlayRegistry.d.ts +1 -1
  58. package/dist/openapi/tagHierarchy.js +1 -1
  59. package/dist/seo/resolveSeoMetatags.js +4 -3
  60. package/dist/tsconfig.build.tsbuildinfo +1 -1
  61. package/dist/types/AnalyticsEvent.d.ts +2 -2
  62. package/package.json +3 -3
@@ -1,3 +1,3 @@
1
- export declare const API_STATIC_EXPORT_BASE_PATHS: readonly ["", "/docs", "/documentation"];
1
+ export declare const API_STATIC_EXPORT_BASE_PATHS: readonly ['', '/docs', '/documentation'];
2
2
  export type ApiStaticExportBasePath = (typeof API_STATIC_EXPORT_BASE_PATHS)[number];
3
3
  export declare function isApiStaticExportBasePath(basePath: string): basePath is ApiStaticExportBasePath;
@@ -1,6 +1,7 @@
1
1
  import { generateExampleFromSchema } from '@mintlify/validation';
2
2
  export const getExamplesData = ({ message, jsonSchema, payloadSchema, extensions, }) => {
3
- var _a, _b, _c, _d, _e;
3
+ var _a, _b, _c;
4
+ var _d, _e;
4
5
  const id = message.id().toLowerCase();
5
6
  const examples = message.examples();
6
7
  const hasInlineExamples = examples.length > 0;
@@ -9,8 +10,8 @@ export const getExamplesData = ({ message, jsonSchema, payloadSchema, extensions
9
10
  return JSON.stringify(example, null, 2);
10
11
  }
11
12
  const jsonExamples = [
12
- ...((_c = jsonSchema['examples']) !== null && _c !== void 0 ? _c : []),
13
- ...((_e = (_d = jsonSchema['schema']) === null || _d === void 0 ? void 0 : _d['examples']) !== null && _e !== void 0 ? _e : []),
13
+ ...((_d = jsonSchema['examples']) !== null && _d !== void 0 ? _d : []),
14
+ ...((_e = (_c = jsonSchema['schema']) === null || _c === void 0 ? void 0 : _c['examples']) !== null && _e !== void 0 ? _e : []),
14
15
  ];
15
16
  const hasJsonExamples = jsonExamples.length > 0;
16
17
  if (hasJsonExamples) {
@@ -5,13 +5,14 @@ import { getExamplesData } from './getExamplesData.js';
5
5
  import { getExtensionsData } from './getExtensionsData.js';
6
6
  export const getMessagesData = (messages, extensions) => {
7
7
  return messages.map((message) => {
8
- var _a, _b, _c, _d, _e;
8
+ var _a, _b;
9
+ var _c, _d, _e;
9
10
  const id = message.id();
10
- const title = (_b = (_a = message.title()) !== null && _a !== void 0 ? _a : message.name()) !== null && _b !== void 0 ? _b : message.id();
11
+ const title = (_d = (_c = message.title()) !== null && _c !== void 0 ? _c : message.name()) !== null && _d !== void 0 ? _d : message.id();
11
12
  const niceTitle = title === id ? camelToSentenceCase(id) : title;
12
- const description = (_c = message.summary()) !== null && _c !== void 0 ? _c : message.description();
13
- const payload = (_d = message.payload()) === null || _d === void 0 ? void 0 : _d['_json'];
14
- const headers = (_e = message.headers()) === null || _e === void 0 ? void 0 : _e['_json'];
13
+ const description = (_e = message.summary()) !== null && _e !== void 0 ? _e : message.description();
14
+ const payload = (_a = message.payload()) === null || _a === void 0 ? void 0 : _a['_json'];
15
+ const headers = (_b = message.headers()) === null || _b === void 0 ? void 0 : _b['_json'];
15
16
  const payloadSchema = getMessagePayloadSchema(title, description, payload);
16
17
  const example = getExamplesData({ message, jsonSchema: payload, payloadSchema, extensions });
17
18
  return {
@@ -3,9 +3,10 @@ import { getBindingsData } from './getBindingsData.js';
3
3
  import { getMessagesData } from './getMessagesData.js';
4
4
  export const getOperationsData = (operations, extensions) => {
5
5
  return operations.map((operation) => {
6
- var _a, _b, _c, _d;
7
- const id = (_a = operation.operationId()) !== null && _a !== void 0 ? _a : operation.id();
8
- const title = (_c = (_b = operation['_json']) === null || _b === void 0 ? void 0 : _b.title) !== null && _c !== void 0 ? _c : id;
6
+ var _a;
7
+ var _b, _c, _d;
8
+ const id = (_b = operation.operationId()) !== null && _b !== void 0 ? _b : operation.id();
9
+ const title = (_c = (_a = operation['_json']) === null || _a === void 0 ? void 0 : _a.title) !== null && _c !== void 0 ? _c : id;
9
10
  const type = operation.action();
10
11
  const niceTitle = id && title === id ? camelToSentenceCase(id) : title;
11
12
  const description = (_d = operation.summary()) !== null && _d !== void 0 ? _d : operation.description();
package/dist/colors.js CHANGED
@@ -104,22 +104,23 @@ export const getDefaultBackgroundColors = (primaryLight = DEFAULT_PRIMARY_LIGHT)
104
104
  dark: generateDynamicBackgroundDarkColor(primaryLight, undefined, true),
105
105
  });
106
106
  export function getBackgroundColors(docsConfig) {
107
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
107
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
108
+ var _m, _o;
108
109
  const primaryColor = (docsConfig === null || docsConfig === void 0 ? void 0 : docsConfig.colors.primary) || '#16A34A';
109
- const primaryLight = (_a = docsConfig === null || docsConfig === void 0 ? void 0 : docsConfig.colors.light) !== null && _a !== void 0 ? _a : DEFAULT_PRIMARY_LIGHT;
110
+ const primaryLight = (_m = docsConfig === null || docsConfig === void 0 ? void 0 : docsConfig.colors.light) !== null && _m !== void 0 ? _m : DEFAULT_PRIMARY_LIGHT;
110
111
  if ((docsConfig === null || docsConfig === void 0 ? void 0 : docsConfig.theme) === 'linden') {
111
112
  docsConfig.background = Object.assign(Object.assign({}, docsConfig.background), { color: {
112
- light: ((_c = (_b = docsConfig.background) === null || _b === void 0 ? void 0 : _b.color) === null || _c === void 0 ? void 0 : _c.light) ||
113
+ light: ((_b = (_a = docsConfig.background) === null || _a === void 0 ? void 0 : _a.color) === null || _b === void 0 ? void 0 : _b.light) ||
113
114
  rgbToHex(combineColors('#FFFFFF', 1, primaryColor, 0.03)),
114
- dark: ((_e = (_d = docsConfig.background) === null || _d === void 0 ? void 0 : _d.color) === null || _e === void 0 ? void 0 : _e.dark) ||
115
+ dark: ((_d = (_c = docsConfig.background) === null || _c === void 0 ? void 0 : _c.color) === null || _d === void 0 ? void 0 : _d.dark) ||
115
116
  rgbToHex(combineColors('#09090B', 1, primaryLight, 0.03)),
116
117
  } });
117
118
  }
118
- const lightHex = (_h = (_g = (_f = docsConfig === null || docsConfig === void 0 ? void 0 : docsConfig.background) === null || _f === void 0 ? void 0 : _f.color) === null || _g === void 0 ? void 0 : _g.light) !== null && _h !== void 0 ? _h : '#ffffff';
119
+ const lightHex = (_o = (_f = (_e = docsConfig === null || docsConfig === void 0 ? void 0 : docsConfig.background) === null || _e === void 0 ? void 0 : _e.color) === null || _f === void 0 ? void 0 : _f.light) !== null && _o !== void 0 ? _o : '#ffffff';
119
120
  const light = hexToRgbString(lightHex);
120
- const dark = generateDynamicBackgroundDarkColor(primaryLight, (_k = (_j = docsConfig === null || docsConfig === void 0 ? void 0 : docsConfig.background) === null || _j === void 0 ? void 0 : _j.color) === null || _k === void 0 ? void 0 : _k.dark);
121
- const darkHex = generateDynamicBackgroundDarkColor(primaryLight, (_m = (_l = docsConfig === null || docsConfig === void 0 ? void 0 : docsConfig.background) === null || _l === void 0 ? void 0 : _l.color) === null || _m === void 0 ? void 0 : _m.dark, true);
122
- const background = (_o = docsConfig === null || docsConfig === void 0 ? void 0 : docsConfig.thumbnails) === null || _o === void 0 ? void 0 : _o.background;
121
+ const dark = generateDynamicBackgroundDarkColor(primaryLight, (_h = (_g = docsConfig === null || docsConfig === void 0 ? void 0 : docsConfig.background) === null || _g === void 0 ? void 0 : _g.color) === null || _h === void 0 ? void 0 : _h.dark);
122
+ const darkHex = generateDynamicBackgroundDarkColor(primaryLight, (_k = (_j = docsConfig === null || docsConfig === void 0 ? void 0 : docsConfig.background) === null || _j === void 0 ? void 0 : _j.color) === null || _k === void 0 ? void 0 : _k.dark, true);
123
+ const background = (_l = docsConfig === null || docsConfig === void 0 ? void 0 : docsConfig.thumbnails) === null || _l === void 0 ? void 0 : _l.background;
123
124
  return {
124
125
  light,
125
126
  dark,
@@ -1,5 +1,5 @@
1
1
  /** Get generated TailwindCSS from the content with prefix added to each class */
2
- export declare function getDynamicTailwindCss({ content, prefix, }: {
2
+ export declare function getDynamicTailwindCss({ content, prefix }: {
3
3
  content: string;
4
4
  prefix?: string;
5
5
  }): Promise<string>;
@@ -1,6 +1,6 @@
1
1
  export type { TailwindContext } from 'tailwindcss-v3/lib/lib/setupContextUtils.js';
2
2
  export { default as resolveConfig } from 'tailwindcss-v3/resolveConfig.js';
3
- export declare const createContext: (config: ReturnType<typeof import("tailwindcss-v3/resolveConfig.js")>) => import("tailwindcss-v3/lib/lib/setupContextUtils.js").TailwindContext;
3
+ export declare const createContext: (config: ReturnType<typeof import('tailwindcss-v3/resolveConfig.js')>) => import("tailwindcss-v3/lib/lib/setupContextUtils.js").TailwindContext;
4
4
  export declare const generateRules: (candidates: Set<string>, context: import("tailwindcss-v3/lib/lib/setupContextUtils.js").TailwindContext) => import("tailwindcss-v3/lib/lib/setupContextUtils.js").RuleEntry[];
5
5
  export declare const defaultExtractor: (context: import("tailwindcss-v3/lib/lib/setupContextUtils.js").TailwindContext) => (content: string) => string[];
6
6
  export declare const NOT_ON_DEMAND: string;
@@ -1,7 +1,7 @@
1
1
  import { OrgType, StaticPropsOrgType } from '@mintlify/models';
2
2
  import { DeploymentEntitlement, DeploymentEntitlements } from '@mintlify/validation';
3
3
  export declare const TRIAL_ENTITLEMENTS: DeploymentEntitlement[];
4
- export declare function checkAccess({ entitlements, org, entitlementToCheck, allowTrialAccess, }: {
4
+ export declare function checkAccess({ entitlements, org, entitlementToCheck, allowTrialAccess }: {
5
5
  entitlements: DeploymentEntitlements | undefined;
6
6
  org?: OrgType | StaticPropsOrgType;
7
7
  entitlementToCheck: DeploymentEntitlement;
@@ -25,7 +25,8 @@ function getSubdomain(deployment) {
25
25
  return 'mintlify.site';
26
26
  }
27
27
  export function getDisplayDomain(deployment, isDev = false, appendBasePath = true) {
28
- var _a, _b, _c, _d;
28
+ var _a, _b, _c;
29
+ var _d;
29
30
  const { subdomain } = deployment;
30
31
  if ((_a = deployment.atlas) === null || _a === void 0 ? void 0 : _a.repoUrl) {
31
32
  const parsed = parseOwnerRepo(deployment.atlas.repoUrl);
@@ -3,9 +3,9 @@ export type FileCategoryOptions = {
3
3
  };
4
4
  export type PotentialFileCategory = 'page' | 'snippet' | 'mintConfig' | 'potentialYamlOpenApiSpec' | 'potentialJsonOpenApiSpec' | 'staticFile' | 'snippet-v2' | 'css' | 'js' | 'docsConfig' | 'generatedStaticFile' | 'skillFile' | 'mintIgnore' | null;
5
5
  export type FileCategory = Omit<PotentialFileCategory, 'potentialYamlOpenApiSpec' | 'potentialJsonOpenApiSpec'> | 'openApi' | null;
6
- export declare const generatedStaticFiles: readonly ["llms.txt", "robots.txt", "sitemap.xml", "llms-full.txt"];
6
+ export declare const generatedStaticFiles: readonly ['llms.txt', 'robots.txt', 'sitemap.xml', 'llms-full.txt'];
7
7
  export type GeneratedStaticFile = (typeof generatedStaticFiles)[number];
8
- export declare const packageManifestFiles: readonly ["package.json", "package-lock.json", "pnpm-lock.yaml"];
8
+ export declare const packageManifestFiles: readonly ['package.json', 'package-lock.json', 'pnpm-lock.yaml'];
9
9
  export type PackageManifestFile = (typeof packageManifestFiles)[number];
10
10
  export declare const isPackageManifestPath: (filePath: string) => boolean;
11
11
  export declare const IMAGE_FORMATS: string[];
@@ -4,4 +4,4 @@ export type ResolvedGraphqlOperation = {
4
4
  field: GraphqlField;
5
5
  parents: GraphqlField[];
6
6
  };
7
- export declare const resolveGraphqlOperation: (reference: GraphqlReference, target: Pick<GraphqlTarget, "kind" | "name">) => ResolvedGraphqlOperation | undefined;
7
+ export declare const resolveGraphqlOperation: (reference: GraphqlReference, target: Pick<GraphqlTarget, 'kind' | 'name'>) => ResolvedGraphqlOperation | undefined;
@@ -1,4 +1,4 @@
1
- declare const protocols: readonly ["http", "https", "ftp", "ftps", "file", "data", "mailto", "tel", "sms", "ws", "wss"];
1
+ declare const protocols: readonly ['http', 'https', 'ftp', 'ftps', 'file', 'data', 'mailto', 'tel', 'sms', 'ws', 'wss'];
2
2
  type Protocol = (typeof protocols)[number];
3
3
  export type AbsoluteUrl = `${Protocol}://${string}` | `${Protocol}:${string}`;
4
4
  /**
@@ -1,6 +1,7 @@
1
1
  import { SKIP, visit } from 'unist-util-visit';
2
2
  export const isCurrencyMath = (node, text) => {
3
- var _a, _b, _c;
3
+ var _a, _b;
4
+ var _c;
4
5
  const start = (_a = node.position) === null || _a === void 0 ? void 0 : _a.start.offset;
5
6
  const end = (_b = node.position) === null || _b === void 0 ? void 0 : _b.end.offset;
6
7
  if (start === undefined || end === undefined)
@@ -9,4 +9,4 @@ export declare const codeStylingToThemeOrThemes: (codeStylingFromConfig: CodeSty
9
9
  dark: ShikiThemeType;
10
10
  };
11
11
  };
12
- export declare const getCodeStylingEnum: (codeStylingFromConfig: CodeStyling) => "system" | "dark";
12
+ export declare const getCodeStylingEnum: (codeStylingFromConfig: CodeStyling) => 'system' | 'dark';
@@ -26,7 +26,7 @@ export declare const getMDXOptions: ({ data, remarkPlugins, earlyRemarkPlugins,
26
26
  remarkPlugins: PluggableList;
27
27
  rehypePlugins: PluggableList;
28
28
  };
29
- packageIslands?: Omit<RemarkPackageIslandsOptions, "mdxExtracts">;
29
+ packageIslands?: Omit<RemarkPackageIslandsOptions, 'mdxExtracts'>;
30
30
  detectJs?: MdxJsDetection;
31
- }) => SerializeOptions["mdxOptions"];
31
+ }) => SerializeOptions['mdxOptions'];
32
32
  export {};
@@ -54,7 +54,8 @@ export const extractPackageIslands = (tree, options) => {
54
54
  const tightItems = new WeakSet();
55
55
  const placements = new Map();
56
56
  const visitChildren = (parent, blocker, outside = blocker, via) => {
57
- var _a, _b, _c, _d, _e;
57
+ var _a, _b, _c, _d;
58
+ var _e;
58
59
  for (const child of parent.children) {
59
60
  if (child.type === 'mdxJsxFlowElement' || child.type === 'mdxJsxTextElement') {
60
61
  const head = child.name ? bindingHead(child.name) : undefined;
@@ -83,7 +84,7 @@ export const extractPackageIslands = (tree, options) => {
83
84
  }
84
85
  const base = builder.module(element);
85
86
  const baseId = islandIdFor(base);
86
- const placement = ((_a = placements.get(baseId)) !== null && _a !== void 0 ? _a : 0) + 1;
87
+ const placement = ((_e = placements.get(baseId)) !== null && _e !== void 0 ? _e : 0) + 1;
87
88
  placements.set(baseId, placement);
88
89
  const module = placement === 1 ? base : withPlacement(base, placement);
89
90
  const id = placement === 1 ? baseId : islandIdFor(module);
@@ -115,10 +116,10 @@ export const extractPackageIslands = (tree, options) => {
115
116
  for (const attribute of child.attributes) {
116
117
  let estree;
117
118
  if (attribute.type === 'mdxJsxExpressionAttribute') {
118
- estree = (_b = attribute.data) === null || _b === void 0 ? void 0 : _b.estree;
119
+ estree = (_a = attribute.data) === null || _a === void 0 ? void 0 : _a.estree;
119
120
  }
120
121
  else if (typeof attribute.value === 'object') {
121
- estree = (_d = (_c = attribute.value) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d.estree;
122
+ estree = (_c = (_b = attribute.value) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.estree;
122
123
  }
123
124
  if (estree)
124
125
  reportReferences(estree, lineOf(child));
@@ -135,7 +136,7 @@ export const extractPackageIslands = (tree, options) => {
135
136
  continue;
136
137
  }
137
138
  if (child.type === 'mdxFlowExpression' || child.type === 'mdxTextExpression') {
138
- if ((_e = child.data) === null || _e === void 0 ? void 0 : _e.estree)
139
+ if ((_d = child.data) === null || _d === void 0 ? void 0 : _d.estree)
139
140
  reportReferences(child.data.estree, lineOf(child));
140
141
  continue;
141
142
  }
@@ -16,11 +16,12 @@ const importedName = (specifier) => {
16
16
  export const esmStatements = (tree, pagePath) => {
17
17
  const statements = [];
18
18
  const visitNode = (node) => {
19
- var _a, _b, _c, _d, _e;
19
+ var _a, _b, _c;
20
+ var _d, _e;
20
21
  if (isMdxJsEsm(node)) {
21
22
  const importer = importingFile(node, pagePath);
22
- for (const statement of (_c = (_b = (_a = node.data) === null || _a === void 0 ? void 0 : _a.estree) === null || _b === void 0 ? void 0 : _b.body) !== null && _c !== void 0 ? _c : []) {
23
- statements.push({ statement, line: (_e = (_d = statement.loc) === null || _d === void 0 ? void 0 : _d.start.line) !== null && _e !== void 0 ? _e : lineOf(node), importer });
23
+ for (const statement of (_d = (_b = (_a = node.data) === null || _a === void 0 ? void 0 : _a.estree) === null || _b === void 0 ? void 0 : _b.body) !== null && _d !== void 0 ? _d : []) {
24
+ statements.push({ statement, line: (_e = (_c = statement.loc) === null || _c === void 0 ? void 0 : _c.start.line) !== null && _e !== void 0 ? _e : lineOf(node), importer });
24
25
  }
25
26
  return;
26
27
  }
@@ -312,7 +312,8 @@ export class IslandModuleBuilder {
312
312
  return result;
313
313
  }
314
314
  child(node) {
315
- var _a, _b;
315
+ var _a;
316
+ var _b;
316
317
  switch (node.type) {
317
318
  case 'mdxJsxFlowElement':
318
319
  case 'mdxJsxTextElement': {
@@ -356,7 +357,7 @@ export class IslandModuleBuilder {
356
357
  case 'image': {
357
358
  const attributes = [
358
359
  jsxAttribute('src', this.url(node.url, false)),
359
- jsxAttribute('alt', literal((_a = node.alt) !== null && _a !== void 0 ? _a : '')),
360
+ jsxAttribute('alt', literal((_b = node.alt) !== null && _b !== void 0 ? _b : '')),
360
361
  ];
361
362
  if (node.title)
362
363
  attributes.push(jsxAttribute('title', literal(node.title)));
@@ -395,7 +396,7 @@ export class IslandModuleBuilder {
395
396
  }
396
397
  case 'mdxFlowExpression':
397
398
  case 'mdxTextExpression': {
398
- const program = (_b = node.data) === null || _b === void 0 ? void 0 : _b.estree;
399
+ const program = (_a = node.data) === null || _a === void 0 ? void 0 : _a.estree;
399
400
  if (program && program.body.length === 0)
400
401
  return [];
401
402
  const statement = program === null || program === void 0 ? void 0 : program.body[0];
@@ -414,12 +415,9 @@ export class IslandModuleBuilder {
414
415
  }
415
416
  }
416
417
  listItem(item, loose) {
417
- const results = unravel(item.children).map((child) => {
418
- var _a;
419
- return child.type === 'paragraph'
420
- ? { p: true, empty: child.children.length === 0, children: this.children(child.children) }
421
- : { p: false, empty: false, children: (_a = this.child(child)) !== null && _a !== void 0 ? _a : [] };
422
- });
418
+ const results = unravel(item.children).map((child) => { var _a; return child.type === 'paragraph'
419
+ ? { p: true, empty: child.children.length === 0, children: this.children(child.children) }
420
+ : { p: false, empty: false, children: (_a = this.child(child)) !== null && _a !== void 0 ? _a : [] }; });
423
421
  const attributes = [];
424
422
  if (typeof item.checked === 'boolean') {
425
423
  const checkbox = jsxElement('input', [
@@ -456,17 +454,18 @@ export class IslandModuleBuilder {
456
454
  return value !== undefined && this.isRenderableText(value) && value.type !== 'Identifier';
457
455
  }
458
456
  module(root) {
459
- var _a, _b, _c;
457
+ var _a;
458
+ var _b, _c;
460
459
  const body = [];
461
460
  const bySource = new Map();
462
461
  for (const binding of [...this.usedBindings.values()].sort((a, b) => compare(a.local, b.local))) {
463
- bySource.set(binding.source, [...((_a = bySource.get(binding.source)) !== null && _a !== void 0 ? _a : []), binding]);
462
+ bySource.set(binding.source, [...((_b = bySource.get(binding.source)) !== null && _b !== void 0 ? _b : []), binding]);
464
463
  }
465
464
  const sources = this.sideEffects.size === 0
466
465
  ? [...bySource.keys()].sort(compare)
467
466
  : this.order.filter((source) => bySource.has(source) || this.sideEffects.has(source));
468
467
  for (const source of sources) {
469
- const bindings = (_b = bySource.get(source)) !== null && _b !== void 0 ? _b : [];
468
+ const bindings = (_c = bySource.get(source)) !== null && _c !== void 0 ? _c : [];
470
469
  const declaration = (specifiers) => ({
471
470
  type: 'ImportDeclaration',
472
471
  specifiers,
@@ -499,7 +498,7 @@ export class IslandModuleBuilder {
499
498
  }
500
499
  }
501
500
  for (const name of [...this.usedConsts].sort(compare)) {
502
- const expression = (_c = this.consts.get(name)) === null || _c === void 0 ? void 0 : _c.expression;
501
+ const expression = (_a = this.consts.get(name)) === null || _a === void 0 ? void 0 : _a.expression;
503
502
  if (!expression)
504
503
  continue;
505
504
  body.push({
@@ -38,7 +38,8 @@ export function packagePageBaseUrl(baseUrl, pagePath) {
38
38
  return `${baseUrl}/pages/${token}`;
39
39
  }
40
40
  export function packagePageStylesheets(baseUrl, pagePath, islandIds, manifest) {
41
- var _a, _b;
41
+ var _a;
42
+ var _b;
42
43
  const pageBaseUrl = packagePageBaseUrl(baseUrl, pagePath);
43
44
  const paths = new Set(manifest.css.map((css) => css.path));
44
45
  for (const id of [...islandIds].sort()) {
@@ -52,7 +53,8 @@ export function compilePackageBuild(packageBuild) {
52
53
  return packageBuild && hasIslands(packageBuild) ? packageBuild : undefined;
53
54
  }
54
55
  export function withPackageGlobalStylesheets(mdxExtracts, packageBuild, pagePath) {
55
- var _a, _b;
56
+ var _a;
57
+ var _b;
56
58
  if (!((_a = packageBuild === null || packageBuild === void 0 ? void 0 : packageBuild.css) === null || _a === void 0 ? void 0 : _a.length))
57
59
  return mdxExtracts;
58
60
  let globalFiles;
@@ -32,11 +32,13 @@ const MODULE_SOURCE_STATEMENTS = new Set([
32
32
  'ExportAllDeclaration',
33
33
  ]);
34
34
  const topLevelSources = (tree, statementTypes = IMPORT_STATEMENTS) => tree.children.flatMap((node) => {
35
- var _a, _b, _c;
35
+ var _a, _b;
36
+ var _c;
36
37
  if (!isMdxJsEsm(node))
37
38
  return [];
38
39
  return ((_c = (_b = (_a = node.data) === null || _a === void 0 ? void 0 : _a.estree) === null || _b === void 0 ? void 0 : _b.body) !== null && _c !== void 0 ? _c : []).flatMap((statement) => {
39
- var _a, _b, _c, _d;
40
+ var _a, _b, _c;
41
+ var _d;
40
42
  if (!statementTypes.has(statement.type) ||
41
43
  !('source' in statement) ||
42
44
  typeof ((_a = statement.source) === null || _a === void 0 ? void 0 : _a.value) !== 'string') {
@@ -45,7 +47,7 @@ const topLevelSources = (tree, statementTypes = IMPORT_STATEMENTS) => tree.child
45
47
  return [
46
48
  {
47
49
  source: statement.source.value,
48
- line: (_c = (_b = statement.loc) === null || _b === void 0 ? void 0 : _b.start.line) !== null && _c !== void 0 ? _c : (_d = node.position) === null || _d === void 0 ? void 0 : _d.start.line,
50
+ line: (_d = (_b = statement.loc) === null || _b === void 0 ? void 0 : _b.start.line) !== null && _d !== void 0 ? _d : (_c = node.position) === null || _c === void 0 ? void 0 : _c.start.line,
49
51
  },
50
52
  ];
51
53
  });
@@ -30,18 +30,19 @@ export const isPackageSnippetPath = (path) => {
30
30
  };
31
31
  export const isPackageSnippet = (filename, importSources) => isPackageSnippetPath(filename) && importSources.some(isNonHostBareImport);
32
32
  const moduleSources = (tree) => {
33
- var _a, _b, _c, _d;
33
+ var _a, _b, _c;
34
+ var _d;
34
35
  const sources = [];
35
36
  for (const node of tree.children) {
36
37
  if (!isMdxJsEsm(node))
37
38
  continue;
38
- for (const statement of (_c = (_b = (_a = node.data) === null || _a === void 0 ? void 0 : _a.estree) === null || _b === void 0 ? void 0 : _b.body) !== null && _c !== void 0 ? _c : []) {
39
+ for (const statement of (_d = (_b = (_a = node.data) === null || _a === void 0 ? void 0 : _a.estree) === null || _b === void 0 ? void 0 : _b.body) !== null && _d !== void 0 ? _d : []) {
39
40
  if (statement.type !== 'ImportDeclaration' &&
40
41
  statement.type !== 'ExportNamedDeclaration' &&
41
42
  statement.type !== 'ExportAllDeclaration') {
42
43
  continue;
43
44
  }
44
- const source = (_d = statement.source) === null || _d === void 0 ? void 0 : _d.value;
45
+ const source = (_c = statement.source) === null || _c === void 0 ? void 0 : _c.value;
45
46
  if (typeof source === 'string')
46
47
  sources.push(source);
47
48
  }
@@ -83,9 +83,10 @@ const removeIslandImports = (tree, options) => {
83
83
  });
84
84
  };
85
85
  export const remarkPackageIslands = (options) => (tree) => {
86
- var _a, _b, _c;
86
+ var _a;
87
+ var _b, _c;
87
88
  const own = extractPackageIslands(tree, options);
88
- const plan = (_a = options.plan) !== null && _a !== void 0 ? _a : own;
89
+ const plan = (_b = options.plan) !== null && _b !== void 0 ? _b : own;
89
90
  if (plan.errors.length > 0)
90
91
  throw new PackageIslandsError(options.pagePath, plan.errors);
91
92
  if (own.errors.length > 0)
@@ -102,8 +103,9 @@ export const remarkPackageIslands = (options) => (tree) => {
102
103
  const headings = new Map();
103
104
  const buildErrors = [];
104
105
  own.roots.forEach((root, index) => {
105
- var _a, _b, _c, _d, _e;
106
- const id = (_b = (_a = plan.roots[index]) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : root.id;
106
+ var _a, _b, _c, _d;
107
+ var _e;
108
+ const id = (_e = (_a = plan.roots[index]) === null || _a === void 0 ? void 0 : _a.id) !== null && _e !== void 0 ? _e : root.id;
107
109
  ids.set(root.node, id);
108
110
  headings.set(root.node, root.headings);
109
111
  if (!options.islandHtml)
@@ -111,20 +113,20 @@ export const remarkPackageIslands = (options) => (tree) => {
111
113
  const entry = options.islandHtml[id];
112
114
  if (entry === undefined) {
113
115
  buildErrors.push({
114
- line: (_c = root.node.position) === null || _c === void 0 ? void 0 : _c.start.line,
116
+ line: (_b = root.node.position) === null || _b === void 0 ? void 0 : _b.start.line,
115
117
  message: `<${root.name}> compiles to island ${id}, which isn't in the package build.`,
116
118
  });
117
119
  return;
118
120
  }
119
121
  if (entry.prefix !== islandPrefixFor(id)) {
120
122
  buildErrors.push({
121
- line: (_d = root.node.position) === null || _d === void 0 ? void 0 : _d.start.line,
123
+ line: (_c = root.node.position) === null || _c === void 0 ? void 0 : _c.start.line,
122
124
  message: `Island ${id} must use the prefix ${islandPrefixFor(id)}.`,
123
125
  });
124
126
  }
125
127
  if (entry.html !== undefined && typeof entry.html !== 'string') {
126
128
  buildErrors.push({
127
- line: (_e = root.node.position) === null || _e === void 0 ? void 0 : _e.start.line,
129
+ line: (_d = root.node.position) === null || _d === void 0 ? void 0 : _d.start.line,
128
130
  message: `Island ${id} HTML must be a string.`,
129
131
  });
130
132
  }
@@ -158,7 +160,7 @@ export const remarkPackageIslands = (options) => (tree) => {
158
160
  for (const id of ids.values()) {
159
161
  if (id in islands)
160
162
  continue;
161
- const entry = (_b = options.islandHtml) === null || _b === void 0 ? void 0 : _b[id];
163
+ const entry = (_a = options.islandHtml) === null || _a === void 0 ? void 0 : _a[id];
162
164
  islands[id] = Object.assign(Object.assign({}, ((entry === null || entry === void 0 ? void 0 : entry.html) !== undefined && { html: entry.html })), { prefix: (_c = entry === null || entry === void 0 ? void 0 : entry.prefix) !== null && _c !== void 0 ? _c : islandPrefixFor(id) });
163
165
  }
164
166
  options.mdxExtracts.islands = islands;
@@ -2,7 +2,7 @@ import { MdxJsxAttribute, MdxJsxExpressionAttribute, MdxJsxFlowElementHast } fro
2
2
  import { Node } from 'unist';
3
3
  export declare const isMdxJsxFlowElementHast: (node: Node) => node is MdxJsxFlowElementHast;
4
4
  export declare const isMdxJsxAttribute: (attribute: MdxJsxAttribute | MdxJsxExpressionAttribute) => attribute is MdxJsxAttribute;
5
- export declare const paramFieldLocations: readonly ["body", "query", "auth", "cookie", "path", "header"];
5
+ export declare const paramFieldLocations: readonly ['body', 'query', 'auth', 'cookie', 'path', 'header'];
6
6
  export type ParamFieldLocation = (typeof paramFieldLocations)[number];
7
7
  export type FieldLocation = ParamFieldLocation | 'response';
8
8
  export declare const isParamFieldLocation: (str: string | undefined) => str is ParamFieldLocation;
@@ -124,7 +124,8 @@ function styleChildren(element) {
124
124
  : children;
125
125
  }
126
126
  function staticString(source) {
127
- var _a, _b;
127
+ var _a;
128
+ var _b;
128
129
  try {
129
130
  const expression = parseExpressionAt(source, 0, { ecmaVersion: 'latest' });
130
131
  if (source.slice(expression.end).trim() !== '')
@@ -10,7 +10,8 @@ function isElement(node, key = 'type', element = 'element') {
10
10
  }
11
11
  function addCodeBlocks(tree) {
12
12
  visit(tree, (node, i, parent) => {
13
- var _a, _b, _c;
13
+ var _a, _b;
14
+ var _c;
14
15
  if (parent == null || i == null || !isElement(node) || !isElement(node, 'tagName', 'pre')) {
15
16
  return;
16
17
  }
@@ -25,12 +26,12 @@ function addCodeBlocks(tree) {
25
26
  const parentType = parentName.slice(0, -7);
26
27
  meta = parseMetaString(parentType);
27
28
  if (!((_a = code.data) === null || _a === void 0 ? void 0 : _a.meta)) {
28
- const data = (_b = code.data) !== null && _b !== void 0 ? _b : {};
29
+ const data = (_c = code.data) !== null && _c !== void 0 ? _c : {};
29
30
  data.meta = i === 0 ? parentType : `${parentType} ${i + 1}`;
30
31
  code.data = data;
31
32
  }
32
33
  }
33
- if (((_c = code.data) === null || _c === void 0 ? void 0 : _c.meta) && typeof code.data.meta === 'string') {
34
+ if (((_b = code.data) === null || _b === void 0 ? void 0 : _b.meta) && typeof code.data.meta === 'string') {
34
35
  meta = parseMetaString(code.data.meta);
35
36
  }
36
37
  const attributes = buildMetaAttributes(meta !== null && meta !== void 0 ? meta : {});
@@ -51,22 +51,22 @@ export declare class MetaOptions {
51
51
  * Allows to filter the options by {@link MetaOptionKind}.
52
52
  * If omitted, no kind-based filtering will be applied.
53
53
  */
54
- list<K extends MetaOptionKind | undefined = undefined>(keyOrKeys?: string | string[], kind?: K): K extends "string" | "boolean" | "range" | "regexp" ? (Extract<MetaOptionString, {
54
+ list<K extends MetaOptionKind | undefined = undefined>(keyOrKeys?: string | string[], kind?: K): K extends "boolean" | "range" | "regexp" | "string" ? (Extract<MetaOptionBoolean, {
55
55
  kind: K;
56
56
  }> | Extract<MetaOptionRange, {
57
57
  kind: K;
58
58
  }> | Extract<MetaOptionRegExp, {
59
59
  kind: K;
60
- }> | Extract<MetaOptionBoolean, {
60
+ }> | Extract<MetaOptionString, {
61
61
  kind: K;
62
62
  }>)[] : MetaOption[];
63
- value<K extends MetaOptionKind | undefined = undefined>(key: string, kind?: K): (K extends "string" | "boolean" | "range" | "regexp" ? Extract<MetaOptionString, {
63
+ value<K extends MetaOptionKind | undefined = undefined>(key: string, kind?: K): (K extends "boolean" | "range" | "regexp" | "string" ? Extract<MetaOptionBoolean, {
64
64
  kind: K;
65
65
  }> | Extract<MetaOptionRange, {
66
66
  kind: K;
67
67
  }> | Extract<MetaOptionRegExp, {
68
68
  kind: K;
69
- }> | Extract<MetaOptionBoolean, {
69
+ }> | Extract<MetaOptionString, {
70
70
  kind: K;
71
71
  }> : MetaOption)["value"] | undefined;
72
72
  /**
@@ -103,7 +103,8 @@ export class MetaOptions {
103
103
  .filter((value) => !isNaN(value));
104
104
  }
105
105
  getStringsWithInteger(keyOrKeys) {
106
- var _a, _b, _c, _d;
106
+ var _a, _b;
107
+ var _c, _d;
107
108
  const strings = this.getStrings(keyOrKeys);
108
109
  const integers = [];
109
110
  for (const string of strings) {
@@ -113,8 +114,8 @@ export class MetaOptions {
113
114
  if (trimmed.includes('-')) {
114
115
  const rangeParts = trimmed.split('-');
115
116
  if (rangeParts.length === 2) {
116
- const start = parseInt((_b = (_a = rangeParts[0]) === null || _a === void 0 ? void 0 : _a.trim()) !== null && _b !== void 0 ? _b : '', 10);
117
- const end = parseInt((_d = (_c = rangeParts[1]) === null || _c === void 0 ? void 0 : _c.trim()) !== null && _d !== void 0 ? _d : '', 10);
117
+ const start = parseInt((_c = (_a = rangeParts[0]) === null || _a === void 0 ? void 0 : _a.trim()) !== null && _c !== void 0 ? _c : '', 10);
118
+ const end = parseInt((_d = (_b = rangeParts[1]) === null || _b === void 0 ? void 0 : _b.trim()) !== null && _d !== void 0 ? _d : '', 10);
118
119
  if (!isNaN(start) && !isNaN(end)) {
119
120
  for (let i = start; i <= end; i++) {
120
121
  integers.push(i);
@@ -139,7 +140,8 @@ export class MetaOptions {
139
140
  * Works with range values (`{value}`) that contain comma-separated integers and ranges.
140
141
  */
141
142
  getRangesWithInteger(keyOrKeys) {
142
- var _a, _b, _c, _d;
143
+ var _a, _b;
144
+ var _c, _d;
143
145
  const ranges = this.getRanges(keyOrKeys);
144
146
  const integers = [];
145
147
  for (const range of ranges) {
@@ -149,8 +151,8 @@ export class MetaOptions {
149
151
  if (trimmed.includes('-')) {
150
152
  const rangeParts = trimmed.split('-');
151
153
  if (rangeParts.length === 2) {
152
- const start = parseInt((_b = (_a = rangeParts[0]) === null || _a === void 0 ? void 0 : _a.trim()) !== null && _b !== void 0 ? _b : '', 10);
153
- const end = parseInt((_d = (_c = rangeParts[1]) === null || _c === void 0 ? void 0 : _c.trim()) !== null && _d !== void 0 ? _d : '', 10);
154
+ const start = parseInt((_c = (_a = rangeParts[0]) === null || _a === void 0 ? void 0 : _a.trim()) !== null && _c !== void 0 ? _c : '', 10);
155
+ const end = parseInt((_d = (_b = rangeParts[1]) === null || _b === void 0 ? void 0 : _b.trim()) !== null && _d !== void 0 ? _d : '', 10);
154
156
  if (!isNaN(start) && !isNaN(end)) {
155
157
  for (let i = start; i <= end; i++) {
156
158
  integers.push(i);
@@ -903,11 +903,12 @@ const toLiteral = (value) => ({
903
903
  raw: JSON.stringify(value),
904
904
  });
905
905
  const transformClassNames = (value, tailwindSelectors) => {
906
- var _a, _b, _c, _d;
906
+ var _a, _b;
907
+ var _c, _d;
907
908
  if (!tailwindSelectors || !tailwindSelectors.length)
908
909
  return value;
909
- const leadingSpace = (_b = (_a = value.match(/^\s+/)) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : '';
910
- const trailingSpace = (_d = (_c = value.slice(leadingSpace.length).match(/\s+$/)) === null || _c === void 0 ? void 0 : _c[0]) !== null && _d !== void 0 ? _d : '';
910
+ const leadingSpace = (_c = (_a = value.match(/^\s+/)) === null || _a === void 0 ? void 0 : _a[0]) !== null && _c !== void 0 ? _c : '';
911
+ const trailingSpace = (_d = (_b = value.slice(leadingSpace.length).match(/\s+$/)) === null || _b === void 0 ? void 0 : _b[0]) !== null && _d !== void 0 ? _d : '';
911
912
  return (leadingSpace +
912
913
  splitClassNames(value)
913
914
  .map((className) => transformClassName(className, tailwindSelectors))