Skip to content

Commit

Permalink
Merge branch 'master' into loading-button
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeeshanTamboli authored Nov 14, 2024
2 parents b472bb9 + a7d441d commit 579e331
Show file tree
Hide file tree
Showing 28 changed files with 144 additions and 78 deletions.
58 changes: 56 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,60 @@
# [Versions](https://mui.com/versions/)

## 6.1.6
## v6.1.7

<!-- generated comparing v6.1.6..master -->

_Nov 13, 2024_

A big thanks to the 13 contributors who made this release possible.
This release includes fixes as well as documentation improvements.

### `@mui/[email protected]`

- Fix default props theme scoping (#44340) @siriwatknp
- Support theme scoping in `useMediaQuery` (#44339) @siriwatknp
- [Grid] Fix regression spacing prop with string value (#44376) @siriwatknp

### `@mui/[email protected]`

- Fix missing `@types/hoist-non-react-statics` causing `styled` returns any (#44397) @megos

### Docs

- Replace 'Experimental APIs - Toolpad' with 'Toolpad (Beta)' (#44388) @prakhargupta1
- Fix Pigment CSS install (#44353) @oliviertassinari
- Fix dashboard menu warning (#44317) @siriwatknp
- Add runtime theme section for Material Pigment CSS (#44137) @siriwatknp
- Add hash to `key` to remove noise from console (#44289) @sai6855
- Revise Example Projects and Related Projects pages (#44191) @samuelsycamore
- [material-ui] Fix typo in typography theme set up for templates (#44338) @navedqb
- [material-ui] Add StackBlitz/CodeSandbox buttons to template cards (#44253) @zanivan
- [material-ui] Fix Sign-in/Sign-up templates layout (#44281) @zanivan
- [material-ui] Remove noise in template (#44260) @oliviertassinari
- [material-ui][Rating] Add uncontrolled example to Basic Rating demo (#44386) @sai6855
- [material-ui][TextField] Replace InputProps with slotProps.input in demo (#44288) @sai6855

### Core

- [blog] Follow media asset guidelines (#44374) @oliviertassinari
- [code-infra] Changes for test util to work in `vitest` (#43625) @JCQuintas
- Remove old marked JS options (#44375) @ZeeshanTamboli
- Fix webpack capitalization (#44352) @oliviertassinari
- Fix Next.js link 404 (710cd95) @oliviertassinari
- Update Gold sponsoring backlinks (#44316) @oliviertassinari
- Fix tools-public.mui.com redirection (9196fa5) @oliviertassinari
- Remove blank AlertTitle test file (#44282) @ZeeshanTamboli
- [docs-infra] Fix ad in RTL (#44345) @oliviertassinari
- [docs-infra] Enforce punctuation on descriptions (#44292) @oliviertassinari
- [docs-infra] Add CodeSandbox and StackBlitz to vale vocab (6db477a) @oliviertassinari
- [docs-infra] Fix correct spelling of VS Code (#44277) @oliviertassinari
- [docs-infra] Add a `rawDescriptions` option (#44390) @vladmoroz
- [examples] Add missing `clsx` dependency (#43526) @Janpot
- [infra] Fix @renovate[bot] appearing in changelog (#44275) @mnajdova

All contributors of this release in alphabetical order: @Janpot, @JCQuintas, @megos, @mnajdova, @navedqb, @oliviertassinari, @prakhargupta1, @sai6855, @samuelsycamore, @siriwatknp, @vladmoroz, @zanivan, @ZeeshanTamboli

## v6.1.6

<!-- generated comparing v6.1.5..master -->

Expand Down Expand Up @@ -52,7 +106,7 @@ A big thanks to the 13 contributors who made this release possible.

All contributors of this release in alphabetical order: @aarongarciah, @blackcow1987, @DiegoAndai, @jimmycallin, @joshkel, @mnajdova, @navedqb, @nphmuller, @o-alexandrov, @oliviertassinari, @prakhargupta1, @sai6855, @siriwatknp

## 6.1.5
## v6.1.5

<!-- generated comparing v6.1.4..master -->

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mui/monorepo",
"version": "6.1.6",
"version": "6.1.7",
"private": true,
"scripts": {
"preinstall": "npx only-allow pnpm",
Expand Down
2 changes: 1 addition & 1 deletion packages-internal/scripts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mui/internal-scripts",
"version": "1.0.26",
"version": "1.0.27",
"author": "MUI Team",
"description": "Utilities supporting MUI libraries build and docs generation. This is an internal package not meant for general use.",
"main": "build/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages-internal/test-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mui/internal-test-utils",
"version": "1.0.19",
"version": "1.0.20",
"author": "MUI Team",
"description": "Utilities for MUI tests. This is an internal package not meant for general use.",
"main": "./build/index.js",
Expand Down
4 changes: 2 additions & 2 deletions packages/api-docs-builder/ApiBuilders/ComponentApiBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import { remark } from 'remark';
import { visit as remarkVisit } from 'unist-util-visit';
import type { Link } from 'mdast';
import { defaultHandlers, parse as docgenParse } from 'react-docgen';
import { renderMarkdown } from '@mui/internal-markdown';
import { parse as parseDoctrine, Annotation } from 'doctrine';
import { renderCodeTags, renderMarkdown } from '../buildApi';
import { ProjectSettings, SortingStrategiesType } from '../ProjectSettings';
import { toGitHubPath, writePrettifiedFile } from '../buildApiUtils';
import muiDefaultPropsHandler from '../utils/defaultPropsHandler';
Expand Down Expand Up @@ -279,7 +279,7 @@ function extractClassCondition(description: string) {
description.replace(stylesRegex, '$1{{nodeName}}$5{{conditions}}.'),
),
nodeName: renderMarkdown(conditions[3]),
conditions: renderMarkdown(conditions[6].replace(/`(.*?)`/g, '<code>$1</code>')),
conditions: renderMarkdown(renderCodeTags(conditions[6])),
};
}

Expand Down
9 changes: 2 additions & 7 deletions packages/api-docs-builder/ApiBuilders/HookApiBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { defaultHandlers, parse as docgenParse } from 'react-docgen';
import kebabCase from 'lodash/kebabCase';
import upperFirst from 'lodash/upperFirst';
import { parse as parseDoctrine, Annotation } from 'doctrine';
import { renderMarkdown } from '@mui/internal-markdown';
import { escapeEntities, renderMarkdown } from '../buildApi';
import { ProjectSettings } from '../ProjectSettings';
import { computeApiDescription } from './ComponentApiBuilder';
import {
Expand Down Expand Up @@ -268,12 +268,7 @@ const attachTable = (
const requiredProp = prop.required;

const deprecation = (propDescriptor.description || '').match(/@deprecated(\s+(?<info>.*))?/);
const typeDescription = (propDescriptor.typeStr ?? '')
.replace(/&/g, '&amp;')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;')
.replace(/"/g, '&quot;')
.replace(/'/g, '&#39;');
const typeDescription = escapeEntities(propDescriptor.typeStr ?? '');
return {
[propName]: {
type: {
Expand Down
30 changes: 28 additions & 2 deletions packages/api-docs-builder/buildApi.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { mkdirSync } from 'fs';
import path from 'path';
import * as fse from 'fs-extra';
import { renderMarkdown as _renderMarkdown } from '@mui/internal-markdown';
import findComponents from './utils/findComponents';
import findHooks from './utils/findHooks';
import { writePrettifiedFile } from './buildApiUtils';
Expand All @@ -13,6 +14,8 @@ import {
} from './utils/createTypeScriptProject';
import { ProjectSettings } from './ProjectSettings';
import { ComponentReactApi } from './types/ApiBuilder.types';
import _escapeCell from './utils/escapeCell';
import _escapeEntities from './utils/escapeEntities';

async function removeOutdatedApiDocsTranslations(
components: readonly ComponentReactApi[],
Expand Down Expand Up @@ -64,7 +67,14 @@ async function removeOutdatedApiDocsTranslations(
);
}

export async function buildApi(projectsSettings: ProjectSettings[], grep: RegExp | null = null) {
let rawDescriptionsCurrent = false;

export async function buildApi(
projectsSettings: ProjectSettings[],
grep: RegExp | null = null,
rawDescriptions = false,
) {
rawDescriptionsCurrent = rawDescriptions;
const allTypeScriptProjects = projectsSettings
.flatMap((setting) => setting.typeScriptProjects)
.reduce(
Expand Down Expand Up @@ -118,7 +128,6 @@ async function buildSingleProject(
if (manifestDir) {
mkdirSync(manifestDir, { recursive: true });
}

const apiBuilds = tsProjects.flatMap((project) => {
const projectComponents = findComponents(path.join(project.rootPath, 'src')).filter(
(component) => {
Expand Down Expand Up @@ -202,3 +211,20 @@ async function buildSingleProject(
await projectSettings.onCompleted?.();
return builds;
}

export function renderMarkdown(markdown: string) {
return rawDescriptionsCurrent ? markdown : _renderMarkdown(markdown);
}
export function renderCodeTags(value: string) {
return rawDescriptionsCurrent ? value : value.replace(/`(.*?)`/g, '<code>$1</code>');
}
export function escapeEntities(value: string) {
return rawDescriptionsCurrent ? value : _escapeEntities(value);
}
export function escapeCell(value: string) {
return rawDescriptionsCurrent ? value : _escapeCell(value);
}
export function joinUnionTypes(value: string[]) {
// Use unopinionated formatting for raw descriptions
return rawDescriptionsCurrent ? value.join(' | ') : value.join('<br>&#124;&nbsp;');
}
8 changes: 8 additions & 0 deletions packages/api-docs-builder/utils/escapeEntities.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export default function escapeEntities(value: string): string {
return value
.replace(/&/g, '&amp;')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;')
.replace(/"/g, '&quot;')
.replace(/'/g, '&#39;');
}
2 changes: 1 addition & 1 deletion packages/api-docs-builder/utils/generatePropDescription.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import * as doctrine from 'doctrine';
import * as recast from 'recast';
import { PropTypeDescriptor } from 'react-docgen';
import { escapeCell } from '../buildApi';
import {
isElementTypeAcceptingRefProp,
isElementAcceptingRefProp,
} from './generatePropTypeDescription';
import { DescribeablePropDescriptor } from './createDescribeableProp';
import escapeCell from './escapeCell';
import { SeeMore } from '../types/utils.types';

function resolveType(type: NonNullable<doctrine.Tag['type']>): string {
Expand Down
26 changes: 10 additions & 16 deletions packages/api-docs-builder/utils/generatePropTypeDescription.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as recast from 'recast';
import { parse as docgenParse, PropTypeDescriptor } from 'react-docgen';
import escapeCell from './escapeCell';
import { escapeCell, escapeEntities, joinUnionTypes } from '../buildApi';

function getDeprecatedInfo(type: PropTypeDescriptor) {
const marker = /deprecatedPropType\((\r*\n)*\s*PropTypes\./g;
Expand Down Expand Up @@ -113,26 +113,20 @@ export default function generatePropTypeDescription(type: PropTypeDescriptor): s
.join(', ')} }`;

case 'union':
return (
type.value
.map((type2) => {
return generatePropTypeDescription(type2);
})
// Display one value per line as it's better for visibility.
.join('<br>&#124;&nbsp;')
return joinUnionTypes(
type.value.map((type2) => {
return generatePropTypeDescription(type2) ?? '';
}),
);
case 'enum':
return (
type.value
.map((type2) => {
return escapeCell(type2.value);
})
// Display one value per line as it's better for visibility.
.join('<br>&#124;&nbsp;')
return joinUnionTypes(
type.value.map((type2) => {
return escapeCell(type2.value);
}),
);

case 'arrayOf': {
return `Array&lt;${generatePropTypeDescription(type.value)}&gt;`;
return `Array${escapeEntities('<')}${generatePropTypeDescription(type.value)}${escapeEntities('>')}`;
}

case 'instanceOf': {
Expand Down
2 changes: 1 addition & 1 deletion packages/api-docs-builder/utils/parseSlotsAndClasses.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as ts from 'typescript';
import { ComponentClassDefinition } from '@mui-internal/api-docs-builder';
import { renderMarkdown } from '@mui/internal-markdown';
import { renderMarkdown } from '../buildApi';
import { getSymbolDescription, getSymbolJSDocTags } from '../buildApiUtils';
import { TypeScriptProject } from './createTypeScriptProject';
import { getPropsFromComponentNode } from './getPropsFromComponentNode';
Expand Down
2 changes: 1 addition & 1 deletion packages/markdown/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mui/internal-markdown",
"version": "1.0.19",
"version": "1.0.20",
"author": "MUI Team",
"description": "MUI markdown parser. This is an internal package not meant for general use.",
"main": "./index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-codemod/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mui/codemod",
"version": "6.1.6",
"version": "6.1.7",
"bin": "./codemod.js",
"private": false,
"author": "MUI Team",
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-core-downloads-tracker/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mui/core-downloads-tracker",
"version": "6.1.6",
"version": "6.1.7",
"private": false,
"author": "MUI Team",
"description": "Internal package to track number of downloads of our design system libraries",
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-docs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mui/docs",
"version": "6.1.6",
"version": "6.1.7",
"private": false,
"author": "MUI Team",
"description": "MUI Docs - Documentation building blocks.",
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-icons-material/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mui/icons-material",
"version": "6.1.6",
"version": "6.1.7",
"private": false,
"author": "MUI Team",
"description": "Material Design icons distributed as SVG React components.",
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-lab/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mui/lab",
"version": "6.0.0-beta.14",
"version": "6.0.0-beta.15",
"private": false,
"author": "MUI Team",
"description": "Laboratory for new MUI modules.",
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-material-nextjs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mui/material-nextjs",
"version": "6.1.6",
"version": "6.1.7",
"private": false,
"author": "MUI Team",
"description": "Collection of utilities for integration between Material UI and Next.js.",
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-material-pigment-css/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mui/material-pigment-css",
"version": "6.1.6",
"version": "6.1.7",
"author": "MUI Team",
"description": "A wrapper over Pigment CSS that provides the same styled and theming APIs as Material UI.",
"main": "./src/index.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-material/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mui/material",
"version": "6.1.6",
"version": "6.1.7",
"private": false,
"author": "MUI Team",
"description": "Material UI is an open-source React component library that implements Google's Material Design. It's comprehensive and can be used in production out of the box.",
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-private-theming/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mui/private-theming",
"version": "6.1.6",
"version": "6.1.7",
"private": false,
"author": "MUI Team",
"description": "Private - The React theme context to be shared between `@mui/styles` and `@mui/material`.",
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-styled-engine-sc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mui/styled-engine-sc",
"version": "6.1.6",
"version": "6.1.7",
"private": false,
"author": "MUI Team",
"description": "styled() API wrapper package for styled-components.",
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-styled-engine/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mui/styled-engine",
"version": "6.1.6",
"version": "6.1.7",
"private": false,
"author": "MUI Team",
"description": "styled() API wrapper package for emotion.",
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-styles/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mui/styles",
"version": "6.1.6",
"version": "6.1.7",
"private": false,
"author": "MUI Team",
"description": "MUI Styles - The legacy JSS-based styling solution of Material UI.",
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-system/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mui/system",
"version": "6.1.6",
"version": "6.1.7",
"private": false,
"author": "MUI Team",
"description": "MUI System is a set of CSS utilities to help you build custom designs more efficiently. It makes it possible to rapidly lay out custom designs.",
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mui/utils",
"version": "6.1.6",
"version": "6.1.7",
"private": false,
"author": "MUI Team",
"description": "Utility functions for React components.",
Expand Down
Loading

0 comments on commit 579e331

Please sign in to comment.