@mui/internal-docs-infra 0.4.1-canary.6 → 0.4.1-canary.8

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.
@@ -38,10 +38,10 @@ export declare function abstractCreateDemo<T extends {}>(options: AbstractCreate
38
38
  }, meta: CreateDemoMeta | undefined): React.ComponentType<T> & {
39
39
  Title: React.ComponentType;
40
40
  };
41
- export declare function createDemoFactory<T extends {}>(options: AbstractCreateDemoOptions<T>): (url: string, component: React.ComponentType, meta?: CreateDemoMeta) => React.ComponentType<T> & {
42
- Title: React.ComponentType;
41
+ export declare function createDemoFactory<T extends {}>(options: AbstractCreateDemoOptions<T>): (url: string, component: React.ComponentType<{}>, meta?: CreateDemoMeta | undefined) => React.ComponentType<T> & {
42
+ Title: React.ComponentType<{}>;
43
43
  };
44
- export declare function createDemoWithVariantsFactory<T extends {}>(options: AbstractCreateDemoOptions<T>): (url: string, variants: Record<string, React.ComponentType>, meta?: CreateDemoMeta) => React.ComponentType<T> & {
45
- Title: React.ComponentType;
44
+ export declare function createDemoWithVariantsFactory<T extends {}>(options: AbstractCreateDemoOptions<T>): (url: string, variants: Record<string, React.ComponentType<{}>>, meta?: CreateDemoMeta | undefined) => React.ComponentType<T> & {
45
+ Title: React.ComponentType<{}>;
46
46
  };
47
47
  export {};
@@ -26,7 +26,7 @@ type AbstractCreateDemoClientOptions = {
26
26
  export declare function abstractCreateDemoClient(options: AbstractCreateDemoClientOptions, url: string, meta?: CreateDemoClientMeta): React.ComponentType<{
27
27
  children: React.ReactNode;
28
28
  }>;
29
- export declare function createDemoClientFactory(options: AbstractCreateDemoClientOptions): (url: string, meta?: CreateDemoClientMeta) => React.ComponentType<{
29
+ export declare function createDemoClientFactory(options: AbstractCreateDemoClientOptions): (url: string, meta?: CreateDemoClientMeta | undefined) => React.ComponentType<{
30
30
  children: React.ReactNode;
31
31
  }>;
32
32
  export {};
@@ -406,7 +406,8 @@ export function metadataToMarkdownAst(data, options = {}) {
406
406
 
407
407
  // Add non-editable section marker
408
408
  // Trim common prefixes and suffixes from path, quote if contains parentheses for shell safety
409
- const trimmedPath = path?.replace(/^(src\/app\/|app\/)/, '').replace(/\/page\.mdx$/, '');
409
+ const normalizedPath = typeof path === 'string' ? path.replace(/\\/g, '/') : undefined;
410
+ const trimmedPath = normalizedPath?.replace(/^(src\/app\/|app\/)/, '').replace(/\/page\.mdx$/, '');
410
411
  const quotedPath = trimmedPath && /[()]/.test(trimmedPath) ? `"${trimmedPath}"` : trimmedPath;
411
412
  const doNotEditComment = quotedPath ? `This file is autogenerated, DO NOT EDIT AFTER THIS LINE, run: pnpm docs:validate ${quotedPath}` : 'This file is autogenerated, DO NOT EDIT AFTER THIS LINE';
412
413
  children.push(comment(doNotEditComment));
@@ -728,7 +729,8 @@ export function metadataToMarkdown(data, options = {}) {
728
729
 
729
730
  // Add non-editable section marker
730
731
  // Trim common prefixes and suffixes from path, quote if contains parentheses for shell safety
731
- const trimmedPath = path?.replace(/^(src\/app\/|app\/)/, '').replace(/\/page\.mdx$/, '');
732
+ const normalizedPath = typeof path === 'string' ? path.replace(/\\/g, '/') : undefined;
733
+ const trimmedPath = normalizedPath?.replace(/^(src\/app\/|app\/)/, '').replace(/\/page\.mdx$/, '');
732
734
  const quotedPath = trimmedPath && /[()]/.test(trimmedPath) ? `"${trimmedPath}"` : trimmedPath;
733
735
  const doNotEditMarker = quotedPath ? `[//]: # 'This file is autogenerated, DO NOT EDIT AFTER THIS LINE, run: pnpm docs:validate ${quotedPath}'` : "[//]: # 'This file is autogenerated, DO NOT EDIT AFTER THIS LINE'";
734
736
  lines.push(doNotEditMarker);
@@ -9,7 +9,7 @@ export type UseCopierOpts = {
9
9
  timeout?: number;
10
10
  };
11
11
  export declare function useCopier(contents: (() => string | undefined) | string, opts?: UseCopierOpts): {
12
- copy: (event: React.MouseEvent<HTMLButtonElement>) => Promise<void>;
12
+ copy: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => Promise<void>;
13
13
  recentlySuccessful: boolean;
14
14
  };
15
15
  export {};
@@ -46,41 +46,41 @@ export declare function openWithForm({
46
46
  target?: string;
47
47
  }): void;
48
48
  export declare function useDemo<T extends {} = {}>(contentProps: ContentProps<T>, opts?: UseDemoOpts): {
49
- component: string | number | bigint | true | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null;
50
- ref: React.RefObject<HTMLDivElement | null>;
51
- resetFocus: () => void;
52
- openStackBlitz: () => void;
53
- openCodeSandbox: () => void;
54
- name: string | undefined;
55
- slug: string | undefined;
56
49
  variants: string[];
57
50
  selectedVariant: string;
58
51
  selectVariant: (variant: string | null) => void;
59
- files: Array<{
52
+ files: {
60
53
  name: string;
61
- slug?: string;
54
+ slug?: string | undefined;
62
55
  component: React.ReactNode;
63
- }>;
56
+ }[];
64
57
  selectedFile: React.ReactNode;
65
58
  selectedFileLines: number;
66
59
  selectedFileName: string | undefined;
67
60
  selectFileName: (fileName: string) => void;
68
- allFilesSlugs: Array<{
61
+ allFilesSlugs: {
69
62
  fileName: string;
70
63
  slug: string;
71
64
  variantName: string;
72
- }>;
65
+ }[];
73
66
  expanded: boolean;
74
67
  expand: () => void;
75
68
  setExpanded: (expanded: boolean) => void;
76
- copy: (event: React.MouseEvent<HTMLButtonElement>) => Promise<void>;
69
+ copy: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => Promise<void>;
77
70
  availableTransforms: string[];
78
71
  selectedTransform: string | null | undefined;
79
72
  selectTransform: (transformName: string | null) => void;
80
- setSource?: (source: string) => void;
73
+ setSource?: ((source: string) => void) | undefined;
81
74
  userProps: T & {
82
- name?: string;
83
- slug?: string;
75
+ name?: string | undefined;
76
+ slug?: string | undefined;
84
77
  };
78
+ component: string | number | bigint | true | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | Iterable<React.ReactNode> | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | React.ReactPortal | null | undefined> | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | null;
79
+ ref: React.RefObject<HTMLDivElement | null>;
80
+ resetFocus: () => void;
81
+ openStackBlitz: () => void;
82
+ openCodeSandbox: () => void;
83
+ name: string | undefined;
84
+ slug: string | undefined;
85
85
  };
86
86
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/internal-docs-infra",
3
- "version": "0.4.1-canary.6",
3
+ "version": "0.4.1-canary.8",
4
4
  "author": "MUI Team",
5
5
  "description": "MUI Infra - internal documentation creation tools.",
6
6
  "bin": {
@@ -335,5 +335,5 @@
335
335
  },
336
336
  "./esm": null
337
337
  },
338
- "gitSha": "40d4002b4e9f3ff0b2bfd6c1cf253dcd6990db22"
338
+ "gitSha": "9e1c4e0467156c00cf964caeff1af4ca7f6d2412"
339
339
  }