@mui/x-license 8.0.0-alpha.0 → 8.0.0-alpha.10

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.
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
4
  const MuiLicenseInfoContext = /*#__PURE__*/React.createContext({
3
5
  key: undefined
@@ -4,5 +4,6 @@ interface WatermarkProps {
4
4
  packageName: MuiCommercialPackageName;
5
5
  releaseInfo: string;
6
6
  }
7
- export declare function Watermark(props: WatermarkProps): React.JSX.Element | null;
8
- export {};
7
+ declare function Watermark(props: WatermarkProps): React.JSX.Element | null;
8
+ declare const MemoizedWatermark: typeof Watermark;
9
+ export { MemoizedWatermark as Watermark };
@@ -1,4 +1,5 @@
1
1
  import * as React from 'react';
2
+ import { fastMemo } from '@mui/x-internals/fastMemo';
2
3
  import { useLicenseVerifier } from "../useLicenseVerifier/index.js";
3
4
  import { LICENSE_STATUS } from "../utils/licenseStatus.js";
4
5
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -21,7 +22,7 @@ function getLicenseErrorMessage(licenseStatus) {
21
22
  throw new Error('Unhandled MUI X license status.');
22
23
  }
23
24
  }
24
- export function Watermark(props) {
25
+ function Watermark(props) {
25
26
  const {
26
27
  packageName,
27
28
  releaseInfo
@@ -45,4 +46,6 @@ export function Watermark(props) {
45
46
  },
46
47
  children: getLicenseErrorMessage(licenseStatus.status)
47
48
  });
48
- }
49
+ }
50
+ const MemoizedWatermark = fastMemo(Watermark);
51
+ export { MemoizedWatermark as Watermark };
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-license v8.0.0-alpha.0
2
+ * @mui/x-license v8.0.0-alpha.10
3
3
  *
4
4
  * @license MUI X Commercial
5
5
  * This source code is licensed under the commercial license found in the
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
4
  const MuiLicenseInfoContext = /*#__PURE__*/React.createContext({
3
5
  key: undefined
@@ -1,4 +1,5 @@
1
1
  import * as React from 'react';
2
+ import { fastMemo } from '@mui/x-internals/fastMemo';
2
3
  import { useLicenseVerifier } from "../useLicenseVerifier/index.js";
3
4
  import { LICENSE_STATUS } from "../utils/licenseStatus.js";
4
5
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -21,7 +22,7 @@ function getLicenseErrorMessage(licenseStatus) {
21
22
  throw new Error('Unhandled MUI X license status.');
22
23
  }
23
24
  }
24
- export function Watermark(props) {
25
+ function Watermark(props) {
25
26
  const {
26
27
  packageName,
27
28
  releaseInfo
@@ -45,4 +46,6 @@ export function Watermark(props) {
45
46
  },
46
47
  children: getLicenseErrorMessage(licenseStatus.status)
47
48
  });
48
- }
49
+ }
50
+ const MemoizedWatermark = fastMemo(Watermark);
51
+ export { MemoizedWatermark as Watermark };
package/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-license v8.0.0-alpha.0
2
+ * @mui/x-license v8.0.0-alpha.10
3
3
  *
4
4
  * @license MUI X Commercial
5
5
  * This source code is licensed under the commercial license found in the
@@ -1,5 +1,17 @@
1
+ /**
2
+ * Workaround for the codesadbox preview error.
3
+ *
4
+ * Once these issues are resolved
5
+ * https://github.com/mui/mui-x/issues/15765
6
+ * https://github.com/codesandbox/codesandbox-client/issues/8673
7
+ *
8
+ * `showError` can simply use `console.error` again.
9
+ */
10
+ const isCodeSandbox = typeof window !== 'undefined' && window.location.hostname.endsWith('.csb.app');
1
11
  function showError(message) {
2
- console.error(['*************************************************************', '', ...message, '', '*************************************************************'].join('\n'));
12
+ // eslint-disable-next-line no-console
13
+ const logger = isCodeSandbox ? console.log : console.error;
14
+ logger(['*************************************************************', '', ...message, '', '*************************************************************'].join('\n'));
3
15
  }
4
16
  export function showInvalidLicenseKeyError() {
5
17
  showError(['MUI X: Invalid license key.', '', "Your MUI X license key format isn't valid. It could be because the license key is missing a character or has a typo.", '', 'To solve the issue, you need to double check that `setLicenseKey()` is called with the right argument', 'Please check the license key installation https://mui.com/r/x-license-key-installation.']);
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ 'use client';
2
3
 
3
4
  var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
5
  Object.defineProperty(exports, "__esModule", {
@@ -4,8 +4,9 @@ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWild
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.Watermark = Watermark;
7
+ exports.Watermark = void 0;
8
8
  var React = _interopRequireWildcard(require("react"));
9
+ var _fastMemo = require("@mui/x-internals/fastMemo");
9
10
  var _useLicenseVerifier = require("../useLicenseVerifier");
10
11
  var _licenseStatus = require("../utils/licenseStatus");
11
12
  var _jsxRuntime = require("react/jsx-runtime");
@@ -52,4 +53,5 @@ function Watermark(props) {
52
53
  },
53
54
  children: getLicenseErrorMessage(licenseStatus.status)
54
55
  });
55
- }
56
+ }
57
+ const MemoizedWatermark = exports.Watermark = (0, _fastMemo.fastMemo)(Watermark);
package/node/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-license v8.0.0-alpha.0
2
+ * @mui/x-license v8.0.0-alpha.10
3
3
  *
4
4
  * @license MUI X Commercial
5
5
  * This source code is licensed under the commercial license found in the
@@ -10,8 +10,20 @@ exports.showInvalidLicenseKeyError = showInvalidLicenseKeyError;
10
10
  exports.showLicenseKeyPlanMismatchError = showLicenseKeyPlanMismatchError;
11
11
  exports.showMissingLicenseKeyError = showMissingLicenseKeyError;
12
12
  exports.showNotAvailableInInitialProPlanError = showNotAvailableInInitialProPlanError;
13
+ /**
14
+ * Workaround for the codesadbox preview error.
15
+ *
16
+ * Once these issues are resolved
17
+ * https://github.com/mui/mui-x/issues/15765
18
+ * https://github.com/codesandbox/codesandbox-client/issues/8673
19
+ *
20
+ * `showError` can simply use `console.error` again.
21
+ */
22
+ const isCodeSandbox = typeof window !== 'undefined' && window.location.hostname.endsWith('.csb.app');
13
23
  function showError(message) {
14
- console.error(['*************************************************************', '', ...message, '', '*************************************************************'].join('\n'));
24
+ // eslint-disable-next-line no-console
25
+ const logger = isCodeSandbox ? console.log : console.error;
26
+ logger(['*************************************************************', '', ...message, '', '*************************************************************'].join('\n'));
15
27
  }
16
28
  function showInvalidLicenseKeyError() {
17
29
  showError(['MUI X: Invalid license key.', '', "Your MUI X license key format isn't valid. It could be because the license key is missing a character or has a typo.", '', 'To solve the issue, you need to double check that `setLicenseKey()` is called with the right argument', 'Please check the license key installation https://mui.com/r/x-license-key-installation.']);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-license",
3
- "version": "8.0.0-alpha.0",
3
+ "version": "8.0.0-alpha.10",
4
4
  "description": "MUI X License verification",
5
5
  "author": "MUI Team",
6
6
  "main": "./node/index.js",
@@ -24,11 +24,12 @@
24
24
  "directory": "packages/x-license"
25
25
  },
26
26
  "dependencies": {
27
- "@babel/runtime": "^7.26.0",
28
- "@mui/utils": "^5.16.6 || ^6.0.0"
27
+ "@babel/runtime": "^7.26.7",
28
+ "@mui/utils": "^5.16.6 || ^6.0.0",
29
+ "@mui/x-internals": "8.0.0-alpha.10"
29
30
  },
30
31
  "peerDependencies": {
31
- "react": "^17.0.0 || ^18.0.0"
32
+ "react": "^17.0.0 || ^18.0.0 || ^19.0.0"
32
33
  },
33
34
  "engines": {
34
35
  "node": ">=14.0.0"
@@ -1,5 +1,17 @@
1
+ /**
2
+ * Workaround for the codesadbox preview error.
3
+ *
4
+ * Once these issues are resolved
5
+ * https://github.com/mui/mui-x/issues/15765
6
+ * https://github.com/codesandbox/codesandbox-client/issues/8673
7
+ *
8
+ * `showError` can simply use `console.error` again.
9
+ */
10
+ const isCodeSandbox = typeof window !== 'undefined' && window.location.hostname.endsWith('.csb.app');
1
11
  function showError(message) {
2
- console.error(['*************************************************************', '', ...message, '', '*************************************************************'].join('\n'));
12
+ // eslint-disable-next-line no-console
13
+ const logger = isCodeSandbox ? console.log : console.error;
14
+ logger(['*************************************************************', '', ...message, '', '*************************************************************'].join('\n'));
3
15
  }
4
16
  export function showInvalidLicenseKeyError() {
5
17
  showError(['MUI X: Invalid license key.', '', "Your MUI X license key format isn't valid. It could be because the license key is missing a character or has a typo.", '', 'To solve the issue, you need to double check that `setLicenseKey()` is called with the right argument', 'Please check the license key installation https://mui.com/r/x-license-key-installation.']);