@mui/x-license 7.15.0 → 7.17.0

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 (46) hide show
  1. package/CHANGELOG.md +185 -1
  2. package/Unstable_LicenseInfoProvider/LicenseInfoProvider.js +1 -1
  3. package/Unstable_LicenseInfoProvider/index.js +1 -1
  4. package/Watermark/Watermark.js +2 -2
  5. package/Watermark/index.js +1 -1
  6. package/generateLicense/generateLicense.d.ts +12 -6
  7. package/generateLicense/generateLicense.js +6 -6
  8. package/generateLicense/index.js +1 -1
  9. package/index.js +7 -7
  10. package/modern/Unstable_LicenseInfoProvider/LicenseInfoProvider.js +1 -1
  11. package/modern/Unstable_LicenseInfoProvider/index.js +1 -1
  12. package/modern/Watermark/Watermark.js +2 -2
  13. package/modern/Watermark/index.js +1 -1
  14. package/modern/generateLicense/generateLicense.js +6 -6
  15. package/modern/generateLicense/index.js +1 -1
  16. package/modern/index.js +7 -7
  17. package/modern/useLicenseVerifier/index.js +1 -1
  18. package/modern/useLicenseVerifier/useLicenseVerifier.js +5 -5
  19. package/modern/utils/index.js +3 -3
  20. package/{utils/licensingModel.js → modern/utils/licenseModel.js} +2 -2
  21. package/modern/utils/plan.js +2 -0
  22. package/modern/verifyLicense/index.js +1 -1
  23. package/modern/verifyLicense/verifyLicense.js +21 -21
  24. package/node/Unstable_LicenseInfoProvider/LicenseInfoProvider.js +2 -3
  25. package/node/Unstable_LicenseInfoProvider/MuiLicenseInfoContext.js +1 -2
  26. package/node/Watermark/Watermark.js +1 -2
  27. package/node/generateLicense/generateLicense.js +4 -4
  28. package/node/index.js +1 -1
  29. package/node/useLicenseVerifier/useLicenseVerifier.js +2 -3
  30. package/node/utils/{licensingModel.js → licenseModel.js} +3 -3
  31. package/node/utils/{licenseScope.js → plan.js} +2 -2
  32. package/node/verifyLicense/verifyLicense.js +18 -18
  33. package/package.json +2 -2
  34. package/useLicenseVerifier/index.js +1 -1
  35. package/useLicenseVerifier/useLicenseVerifier.js +5 -5
  36. package/utils/index.d.ts +2 -2
  37. package/utils/index.js +3 -3
  38. package/utils/licenseModel.d.ts +2 -0
  39. package/{modern/utils/licensingModel.js → utils/licenseModel.js} +2 -2
  40. package/utils/{licenseScope.d.ts → plan.d.ts} +2 -2
  41. package/utils/plan.js +2 -0
  42. package/verifyLicense/index.js +1 -1
  43. package/verifyLicense/verifyLicense.js +21 -21
  44. package/modern/utils/licenseScope.js +0 -2
  45. package/utils/licenseScope.js +0 -2
  46. package/utils/licensingModel.d.ts +0 -2
package/CHANGELOG.md CHANGED
@@ -1,8 +1,192 @@
1
- # Change Log
1
+ # Changelog
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## 7.17.0
7
+
8
+ _Sep 13, 2024_
9
+
10
+ We'd like to offer a big thanks to the 12 contributors who made this release possible. Here are some highlights ✨:
11
+
12
+ - 📊 Charts performance improvement
13
+ - 🧑‍💻 New Data Grid [custom columns demo](https://mui.com/x/react-data-grid/custom-columns/#full-example)
14
+ - 🐞 Bugfixes
15
+ - 📚 Documentation improvements
16
+ - 🌍 Improve Hungarian (hu-HU) locale on the Data Grid
17
+
18
+ <!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
19
+
20
+ ### Data Grid
21
+
22
+ #### `@mui/x-data-grid@7.17.0`
23
+
24
+ - [DataGrid] Add "does not equal" and "does not contain" filter operators (#14489) @KenanYusuf
25
+ - [DataGrid] Add demo to the "Custom columns" page that does not use generator (#13695) @arminmeh
26
+ - [DataGrid] Fix Voice Over reading the column name twice (#14482) @arminmeh
27
+ - [DataGrid] Fix bug in CRUD example (#14513) @michelengelen
28
+ - [DataGrid] Fix failing jsdom tests caused by `:has()` selectors (#14559) @KenanYusuf
29
+ - [DataGrid] Refactor string operator filter functions (#14564) @KenanYusuf
30
+ - [l10n] Improve Hungarian (hu-HU) locale (#14506) @ntamas
31
+
32
+ #### `@mui/x-data-grid-pro@7.17.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
33
+
34
+ Same changes as in `@mui/x-data-grid@7.17.0`.
35
+
36
+ #### `@mui/x-data-grid-premium@7.17.0` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
37
+
38
+ Same changes as in `@mui/x-data-grid-pro@7.17.0`.
39
+
40
+ ### Date and Time Pickers
41
+
42
+ #### `@mui/x-date-pickers@7.17.0`
43
+
44
+ - [fields] Improve `useSplitFieldProps` and make it public (#14514) @flaviendelangle
45
+ - [pickers] Improve clear action label (#14243) @oliviertassinari
46
+ - [pickers] Add `"use client"` directive to every public component and hook (#14562) @flaviendelangle
47
+ - [pickers] Allow custom fields to validate the value (#14486) @flaviendelangle
48
+ - [pickers] Stop using utils in locales (#14505) @flaviendelangle
49
+
50
+ #### `@mui/x-date-pickers-pro@7.17.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
51
+
52
+ Same changes as in `@mui/x-date-pickers@7.17.0`, plus:
53
+
54
+ - [DateRangePicker] Fix `currentMonthCalendarPosition` not scrolling to future sibling (#14442) @GMchris
55
+
56
+ ### Charts
57
+
58
+ #### `@mui/x-charts@7.17.0`
59
+
60
+ - [charts] Add `"use client"` directive to every public component and hook (#14578) @flaviendelangle
61
+ - [charts] Allow `onItemClick` on the `Legend` component (#14231) @JCQuintas
62
+ - [charts] Fix `onAxisClick` with `layout='horizontal'` (#14547) @alexfauquette
63
+ - [charts] Replace `path` with `circle` for performance improvement (#14518) @alexfauquette
64
+
65
+ #### `@mui/x-charts-pro@7.0.0-beta.1` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
66
+
67
+ Same changes as in `@mui/x-charts@7.17.0`.
68
+
69
+ ### Tree View
70
+
71
+ #### `@mui/x-tree-view@7.17.0`
72
+
73
+ - [TreeView] Make `useTreeItem2` stable (#14498) @flaviendelangle
74
+
75
+ ### Docs
76
+
77
+ - [docs] Add missing callout on "Imperative API" tree view sections (#14503) @flaviendelangle
78
+ - [docs] Fix broken redirection to MUI X v5 @oliviertassinari
79
+ - [docs] Fix multiple `console.error` messages on `charts` docs (#14554) @JCQuintas
80
+ - [docs] Fixed typo in Row Grouping recipes (#14549) @Miodini
81
+ - [docs] Match title with blog posts @oliviertassinari
82
+
83
+ ### Core
84
+
85
+ - [core] Move warning methods to `@mui/x-internals` (#14528) @k-rajat19
86
+ - [core] Sync with core release flow @oliviertassinari
87
+ - [code-infra] Fix charts benchmark workflow (#14573) @JCQuintas
88
+ - [docs-infra] Type interface API pages (#14138) @alexfauquette
89
+ - [infra] Create `ESLint plugins` renovate group (#14574) @LukasTy
90
+ - [license] Clean-up terminology to match codebase (#14531) @oliviertassinari
91
+ - [test] Remove dead `act()` logic (#14529) @oliviertassinari
92
+
93
+ ## 7.16.0
94
+
95
+ _Sep 5, 2024_
96
+
97
+ We'd like to offer a big thanks to the 13 contributors who made this release possible. Here are some highlights ✨:
98
+
99
+ - 🎨 Update the design of Data Grid column headers (#14293)
100
+ - 🧠 Add the `slots` concept introduction documentation page (#13881)
101
+ - 🌍 Improve Chinese (zh-CN) and Dutch (nl-NL) locales on the Data Grid
102
+ - 🐞 Bugfixes
103
+ - 📚 Documentation improvements
104
+
105
+ <!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
106
+
107
+ ### Data Grid
108
+
109
+ #### `@mui/x-data-grid@7.16.0`
110
+
111
+ - [DataGrid] Add key prop to `GridFilterInputMultipleValue` (#14302) @sai6855
112
+ - [DataGrid] Allow to control the indeterminate checkbox behavior (#14247) @MBilalShafi
113
+ - [DataGrid] Column header design updates (#14293) @KenanYusuf
114
+ - [DataGrid] Fix error on simultaneous `columns` and `columnGroupingModel` update (#14368) @cherniavskii
115
+ - [DataGrid] Fix first row flickering with `autoHeight` prop enabled (#14235) @KenanYusuf
116
+ - [DataGrid] Remove cell min-width / max-width styles (#14448) @oliviertassinari
117
+ - [DataGrid] Restore reselect behavior (#14410) @romgrk
118
+ - [l10n] Improve Chinese (zh-CN) locale (#14394) @lawvs
119
+ - [l10n] Improve Dutch (nl-NL) locale (#14398) @Janpot
120
+
121
+ #### `@mui/x-data-grid-pro@7.16.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
122
+
123
+ Same changes as in `@mui/x-data-grid@7.16.0`, plus:
124
+
125
+ - [DataGridPro] Fix duplicate top border in header filters (#14375) @MBilalShafi
126
+
127
+ #### `@mui/x-data-grid-premium@7.16.0` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
128
+
129
+ Same changes as in `@mui/x-data-grid-pro@7.16.0`.
130
+
131
+ ### Date and Time Pickers
132
+
133
+ #### `@mui/x-date-pickers@7.16.0`
134
+
135
+ - [pickers] Improve `onError` JSDoc (#14492) @flaviendelangle
136
+ - [pickers] Keep the calendar header and content in sync when switching locale (#14125) @flaviendelangle
137
+ - [pickers] Move multi input range field validation tests to the describe test file (#14501) @flaviendelangle
138
+
139
+ #### `@mui/x-date-pickers-pro@7.16.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
140
+
141
+ Same changes as in `@mui/x-date-pickers@7.16.0`.
142
+
143
+ ### Charts
144
+
145
+ #### `@mui/x-charts@7.16.0`
146
+
147
+ - [charts] Fix JSDoc typos (#14497) @alexfauquette
148
+ - [charts] Fix `LineChart` not properly animating when hydrating (#14355) @JCQuintas
149
+ - [charts] Fix theme augmentation (#14372) @alexfauquette
150
+ - [charts] Pass all props to legend (#14392) @JCQuintas
151
+ - [charts] Use `.mjs` extension for ESM build (#14387) @alexfauquette
152
+ - [charts] Update `package.json` for vendor package (#14465) @alexfauquette
153
+
154
+ #### `@mui/x-charts-pro@7.0.0-beta.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
155
+
156
+ Same changes as in `@mui/x-charts@7.16.0`, plus:
157
+
158
+ - [charts-pro] Fix props and automated documentation on `BarChartPro` and `LineChartPro` (#14391) @JCQuintas
159
+
160
+ ### Tree View
161
+
162
+ #### `@mui/x-tree-view@7.16.0`
163
+
164
+ - [TreeView] Clean label editing code (#14264) @flaviendelangle
165
+
166
+ ### `@mui/x-codemod@7.16.0`
167
+
168
+ - [codemod] Fix `experimentalFeatures` codemod for typescript parser (#14150) @MBilalShafi
169
+
170
+ ### Docs
171
+
172
+ - [docs] Add RTL documentation for the pickers (#13855) @flaviendelangle
173
+ - [docs] Add the `slots` concept introduction page (#13881) @flaviendelangle
174
+ - [docs] Remove TypeScript v3 outdated version mentions (#14443) @k-rajat19
175
+ - [docs] Remove notion of seats (#14351) @oliviertassinari
176
+ - [docs] Use real world data for `PieChart` examples (#14297) @JCQuintas
177
+
178
+ ### Core
179
+
180
+ - [core] Fix changelog spelling @oliviertassinari
181
+ - [core] Fix failing tests on the pickers (#14457) @flaviendelangle
182
+ - [core] Reset permissions for codspeed GitHub Action (#14420) @oliviertassinari
183
+ - [code-infra] Add babel runtime version check (#14483) @Janpot
184
+ - [code-infra] Fully resolve imports in ESM target (#14234) @Janpot
185
+ - [code-infra] Update runners from node 18 to 20 (#14466) @JCQuintas
186
+ - [infra] Added `secrets: inherit` to workflow call (#14454) @michelengelen
187
+ - [infra] Switch "add closing message" to reusable workflow (#14499) @michelengelen
188
+ - [infra] Switch "issue triage workflow" to reusable workflows (#14390) @michelengelen
189
+
6
190
  ## 7.15.0
7
191
 
8
192
  _Aug 29, 2024_
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import MuiLicenseInfoContext from './MuiLicenseInfoContext';
2
+ import MuiLicenseInfoContext from "./MuiLicenseInfoContext.js";
3
3
 
4
4
  /**
5
5
  * @ignore - do not document.
@@ -1 +1 @@
1
- export { LicenseInfoProvider as Unstable_LicenseInfoProvider } from './LicenseInfoProvider';
1
+ export { LicenseInfoProvider as Unstable_LicenseInfoProvider } from "./LicenseInfoProvider.js";
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
- import { useLicenseVerifier } from '../useLicenseVerifier';
3
- import { LICENSE_STATUS } from '../utils/licenseStatus';
2
+ import { useLicenseVerifier } from "../useLicenseVerifier/index.js";
3
+ import { LICENSE_STATUS } from "../utils/licenseStatus.js";
4
4
  import { jsx as _jsx } from "react/jsx-runtime";
5
5
  function getLicenseErrorMessage(licenseStatus) {
6
6
  switch (licenseStatus) {
@@ -1 +1 @@
1
- export * from './Watermark';
1
+ export * from "./Watermark.js";
@@ -1,12 +1,18 @@
1
- import { LicenseScope, PlanVersion } from '../utils/licenseScope';
2
- import { LicensingModel } from '../utils/licensingModel';
1
+ import { PlanScope, PlanVersion } from '../utils/plan';
2
+ import { LicenseModel } from '../utils/licenseModel';
3
3
  export interface LicenseDetails {
4
4
  orderNumber: string;
5
5
  expiryDate: Date;
6
- scope?: LicenseScope;
7
- planScope?: LicenseScope;
8
- licenseModel?: LicensingModel;
9
- licensingModel?: LicensingModel;
6
+ /**
7
+ * @deprecated Use planScope instead.
8
+ */
9
+ scope?: PlanScope;
10
+ planScope?: PlanScope;
11
+ /**
12
+ * @deprecated Use licenseModel instead.
13
+ */
14
+ licensingModel?: LicenseModel;
15
+ licenseModel?: LicenseModel;
10
16
  planVersion: PlanVersion;
11
17
  }
12
18
  export declare function generateLicense(details: LicenseDetails): string;
@@ -1,7 +1,7 @@
1
- import { md5 } from '../encoding/md5';
2
- import { base64Encode } from '../encoding/base64';
3
- import { LICENSE_SCOPES } from '../utils/licenseScope';
4
- import { LICENSING_MODELS } from '../utils/licensingModel';
1
+ import { md5 } from "../encoding/md5.js";
2
+ import { base64Encode } from "../encoding/base64.js";
3
+ import { PLAN_SCOPES } from "../utils/plan.js";
4
+ import { LICENSE_MODELS } from "../utils/licenseModel.js";
5
5
  const licenseVersion = '2';
6
6
  function getClearLicenseString(details) {
7
7
  // TODO remove
@@ -12,10 +12,10 @@ function getClearLicenseString(details) {
12
12
  if (details.scope) {
13
13
  details.planScope = details.scope;
14
14
  }
15
- if (details.planScope && !LICENSE_SCOPES.includes(details.planScope)) {
15
+ if (details.planScope && !PLAN_SCOPES.includes(details.planScope)) {
16
16
  throw new Error('MUI X: Invalid scope');
17
17
  }
18
- if (details.licenseModel && !LICENSING_MODELS.includes(details.licenseModel)) {
18
+ if (details.licenseModel && !LICENSE_MODELS.includes(details.licenseModel)) {
19
19
  throw new Error('MUI X: Invalid licensing model');
20
20
  }
21
21
  const keyParts = [`O=${details.orderNumber}`, `E=${details.expiryDate.getTime()}`, `S=${details.planScope}`, `LM=${details.licenseModel}`, `PV=${details.planVersion}`, `KV=${licenseVersion}`];
@@ -1 +1 @@
1
- export * from './generateLicense';
1
+ export * from "./generateLicense.js";
package/index.js CHANGED
@@ -1,13 +1,13 @@
1
1
  /**
2
- * @mui/x-license v7.15.0
2
+ * @mui/x-license v7.17.0
3
3
  *
4
4
  * @license MUI X Commercial
5
5
  * This source code is licensed under the commercial license found in the
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  */
8
- export * from './generateLicense';
9
- export * from './utils';
10
- export * from './verifyLicense';
11
- export * from './useLicenseVerifier';
12
- export * from './Watermark';
13
- export * from './Unstable_LicenseInfoProvider';
8
+ export * from "./generateLicense/index.js";
9
+ export * from "./utils/index.js";
10
+ export * from "./verifyLicense/index.js";
11
+ export * from "./useLicenseVerifier/index.js";
12
+ export * from "./Watermark/index.js";
13
+ export * from "./Unstable_LicenseInfoProvider/index.js";
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import MuiLicenseInfoContext from './MuiLicenseInfoContext';
2
+ import MuiLicenseInfoContext from "./MuiLicenseInfoContext.js";
3
3
 
4
4
  /**
5
5
  * @ignore - do not document.
@@ -1 +1 @@
1
- export { LicenseInfoProvider as Unstable_LicenseInfoProvider } from './LicenseInfoProvider';
1
+ export { LicenseInfoProvider as Unstable_LicenseInfoProvider } from "./LicenseInfoProvider.js";
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
- import { useLicenseVerifier } from '../useLicenseVerifier';
3
- import { LICENSE_STATUS } from '../utils/licenseStatus';
2
+ import { useLicenseVerifier } from "../useLicenseVerifier/index.js";
3
+ import { LICENSE_STATUS } from "../utils/licenseStatus.js";
4
4
  import { jsx as _jsx } from "react/jsx-runtime";
5
5
  function getLicenseErrorMessage(licenseStatus) {
6
6
  switch (licenseStatus) {
@@ -1 +1 @@
1
- export * from './Watermark';
1
+ export * from "./Watermark.js";
@@ -1,7 +1,7 @@
1
- import { md5 } from '../encoding/md5';
2
- import { base64Encode } from '../encoding/base64';
3
- import { LICENSE_SCOPES } from '../utils/licenseScope';
4
- import { LICENSING_MODELS } from '../utils/licensingModel';
1
+ import { md5 } from "../encoding/md5.js";
2
+ import { base64Encode } from "../encoding/base64.js";
3
+ import { PLAN_SCOPES } from "../utils/plan.js";
4
+ import { LICENSE_MODELS } from "../utils/licenseModel.js";
5
5
  const licenseVersion = '2';
6
6
  function getClearLicenseString(details) {
7
7
  // TODO remove
@@ -12,10 +12,10 @@ function getClearLicenseString(details) {
12
12
  if (details.scope) {
13
13
  details.planScope = details.scope;
14
14
  }
15
- if (details.planScope && !LICENSE_SCOPES.includes(details.planScope)) {
15
+ if (details.planScope && !PLAN_SCOPES.includes(details.planScope)) {
16
16
  throw new Error('MUI X: Invalid scope');
17
17
  }
18
- if (details.licenseModel && !LICENSING_MODELS.includes(details.licenseModel)) {
18
+ if (details.licenseModel && !LICENSE_MODELS.includes(details.licenseModel)) {
19
19
  throw new Error('MUI X: Invalid licensing model');
20
20
  }
21
21
  const keyParts = [`O=${details.orderNumber}`, `E=${details.expiryDate.getTime()}`, `S=${details.planScope}`, `LM=${details.licenseModel}`, `PV=${details.planVersion}`, `KV=${licenseVersion}`];
@@ -1 +1 @@
1
- export * from './generateLicense';
1
+ export * from "./generateLicense.js";
package/modern/index.js CHANGED
@@ -1,13 +1,13 @@
1
1
  /**
2
- * @mui/x-license v7.15.0
2
+ * @mui/x-license v7.17.0
3
3
  *
4
4
  * @license MUI X Commercial
5
5
  * This source code is licensed under the commercial license found in the
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  */
8
- export * from './generateLicense';
9
- export * from './utils';
10
- export * from './verifyLicense';
11
- export * from './useLicenseVerifier';
12
- export * from './Watermark';
13
- export * from './Unstable_LicenseInfoProvider';
8
+ export * from "./generateLicense/index.js";
9
+ export * from "./utils/index.js";
10
+ export * from "./verifyLicense/index.js";
11
+ export * from "./useLicenseVerifier/index.js";
12
+ export * from "./Watermark/index.js";
13
+ export * from "./Unstable_LicenseInfoProvider/index.js";
@@ -1 +1 @@
1
- export { useLicenseVerifier } from './useLicenseVerifier';
1
+ export { useLicenseVerifier } from "./useLicenseVerifier.js";
@@ -1,10 +1,10 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import * as React from 'react';
3
- import { verifyLicense } from '../verifyLicense/verifyLicense';
4
- import { LicenseInfo } from '../utils/licenseInfo';
5
- import { showExpiredAnnualGraceLicenseKeyError, showExpiredAnnualLicenseKeyError, showInvalidLicenseKeyError, showMissingLicenseKeyError, showLicenseKeyPlanMismatchError, showExpiredPackageVersionError, showNotAvailableInInitialProPlanError } from '../utils/licenseErrorMessageUtils';
6
- import { LICENSE_STATUS } from '../utils/licenseStatus';
7
- import MuiLicenseInfoContext from '../Unstable_LicenseInfoProvider/MuiLicenseInfoContext';
3
+ import { verifyLicense } from "../verifyLicense/verifyLicense.js";
4
+ import { LicenseInfo } from "../utils/licenseInfo.js";
5
+ import { showExpiredAnnualGraceLicenseKeyError, showExpiredAnnualLicenseKeyError, showInvalidLicenseKeyError, showMissingLicenseKeyError, showLicenseKeyPlanMismatchError, showExpiredPackageVersionError, showNotAvailableInInitialProPlanError } from "../utils/licenseErrorMessageUtils.js";
6
+ import { LICENSE_STATUS } from "../utils/licenseStatus.js";
7
+ import MuiLicenseInfoContext from "../Unstable_LicenseInfoProvider/MuiLicenseInfoContext.js";
8
8
  export const sharedLicenseStatuses = {};
9
9
  export function useLicenseVerifier(packageName, releaseInfo) {
10
10
  const {
@@ -1,4 +1,4 @@
1
- export * from './licenseErrorMessageUtils';
2
- export * from './licenseInfo';
3
- export * from './licenseStatus';
1
+ export * from "./licenseErrorMessageUtils.js";
2
+ export * from "./licenseInfo.js";
3
+ export * from "./licenseStatus.js";
4
4
  export {};
@@ -1,4 +1,4 @@
1
- export const LICENSING_MODELS = [
1
+ export const LICENSE_MODELS = [
2
2
  /**
3
3
  * A license is outdated if the current version of the software was released after the expiry date of the license.
4
4
  * But the license can be used indefinitely with an older version of the software.
@@ -10,6 +10,6 @@ export const LICENSING_MODELS = [
10
10
  */
11
11
  'annual',
12
12
  /**
13
- * TODO 2025 remove, legacy name of annual.
13
+ * TODO 2026 remove, legacy name of annual.
14
14
  */
15
15
  'subscription'];
@@ -0,0 +1,2 @@
1
+ export const PLAN_SCOPES = ['pro', 'premium'];
2
+ export const PLAN_VERSIONS = ['initial', 'Q3-2024'];
@@ -1 +1 @@
1
- export * from './verifyLicense';
1
+ export * from "./verifyLicense.js";
@@ -1,8 +1,8 @@
1
- import { base64Decode, base64Encode } from '../encoding/base64';
2
- import { md5 } from '../encoding/md5';
3
- import { LICENSE_STATUS } from '../utils/licenseStatus';
4
- import { LICENSE_SCOPES } from '../utils/licenseScope';
5
- import { LICENSING_MODELS } from '../utils/licensingModel';
1
+ import { base64Decode, base64Encode } from "../encoding/base64.js";
2
+ import { md5 } from "../encoding/md5.js";
3
+ import { LICENSE_STATUS } from "../utils/licenseStatus.js";
4
+ import { PLAN_SCOPES } from "../utils/plan.js";
5
+ import { LICENSE_MODELS } from "../utils/licenseModel.js";
6
6
  const getDefaultReleaseDate = () => {
7
7
  const today = new Date();
8
8
  today.setHours(0, 0, 0, 0);
@@ -11,7 +11,7 @@ const getDefaultReleaseDate = () => {
11
11
  export function generateReleaseInfo(releaseDate = getDefaultReleaseDate()) {
12
12
  return base64Encode(releaseDate.getTime().toString());
13
13
  }
14
- function isLicenseScopeSufficient(packageName, licenseScope) {
14
+ function isPlanScopeSufficient(packageName, planScope) {
15
15
  let acceptedScopes;
16
16
  if (packageName.includes('-pro')) {
17
17
  acceptedScopes = ['pro', 'premium'];
@@ -20,7 +20,7 @@ function isLicenseScopeSufficient(packageName, licenseScope) {
20
20
  } else {
21
21
  acceptedScopes = [];
22
22
  }
23
- return acceptedScopes.includes(licenseScope);
23
+ return acceptedScopes.includes(planScope);
24
24
  }
25
25
  const expiryReg = /^.*EXPIRY=([0-9]+),.*$/;
26
26
  const PRO_PACKAGES_AVAILABLE_IN_INITIAL_PRO_PLAN = ['x-data-grid-pro', 'x-date-pickers-pro'];
@@ -39,29 +39,29 @@ const decodeLicenseVersion1 = license => {
39
39
  expiryTimestamp = null;
40
40
  }
41
41
  return {
42
- scope: 'pro',
43
- licensingModel: 'perpetual',
42
+ planScope: 'pro',
43
+ licenseModel: 'perpetual',
44
44
  expiryTimestamp,
45
45
  planVersion: 'initial'
46
46
  };
47
47
  };
48
48
 
49
49
  /**
50
- * Format: O=${orderNumber},E=${expiryTimestamp},S=${scope},LM=${licensingModel},PV=${planVersion},KV=2`;
50
+ * Format: O=${orderNumber},E=${expiryTimestamp},S=${planScope},LM=${licenseModel},PV=${planVersion},KV=2`;
51
51
  */
52
52
  const decodeLicenseVersion2 = license => {
53
53
  const licenseInfo = {
54
- scope: null,
55
- licensingModel: null,
54
+ planScope: null,
55
+ licenseModel: null,
56
56
  expiryTimestamp: null,
57
57
  planVersion: 'initial'
58
58
  };
59
59
  license.split(',').map(token => token.split('=')).filter(el => el.length === 2).forEach(([key, value]) => {
60
60
  if (key === 'S') {
61
- licenseInfo.scope = value;
61
+ licenseInfo.planScope = value;
62
62
  }
63
63
  if (key === 'LM') {
64
- licenseInfo.licensingModel = value;
64
+ licenseInfo.licenseModel = value;
65
65
  }
66
66
  if (key === 'E') {
67
67
  const expiryTimestamp = parseInt(value, 10);
@@ -116,7 +116,7 @@ export function verifyLicense({
116
116
  status: LICENSE_STATUS.Invalid
117
117
  };
118
118
  }
119
- if (license.licensingModel == null || !LICENSING_MODELS.includes(license.licensingModel)) {
119
+ if (license.licenseModel == null || !LICENSE_MODELS.includes(license.licenseModel)) {
120
120
  console.error('MUI X: Error checking license. Licensing model not found or invalid!');
121
121
  return {
122
122
  status: LICENSE_STATUS.Invalid
@@ -128,7 +128,7 @@ export function verifyLicense({
128
128
  status: LICENSE_STATUS.Invalid
129
129
  };
130
130
  }
131
- if (license.licensingModel === 'perpetual' || process.env.NODE_ENV === 'production') {
131
+ if (license.licenseModel === 'perpetual' || process.env.NODE_ENV === 'production') {
132
132
  const pkgTimestamp = parseInt(base64Decode(releaseInfo), 10);
133
133
  if (Number.isNaN(pkgTimestamp)) {
134
134
  throw new Error('MUI X: The release information is invalid. Not able to validate license.');
@@ -138,7 +138,7 @@ export function verifyLicense({
138
138
  status: LICENSE_STATUS.ExpiredVersion
139
139
  };
140
140
  }
141
- } else if (license.licensingModel === 'subscription' || license.licensingModel === 'annual') {
141
+ } else if (license.licenseModel === 'subscription' || license.licenseModel === 'annual') {
142
142
  if (new Date().getTime() > license.expiryTimestamp) {
143
143
  if (
144
144
  // 30 days grace
@@ -160,20 +160,20 @@ export function verifyLicense({
160
160
  };
161
161
  }
162
162
  }
163
- if (license.scope == null || !LICENSE_SCOPES.includes(license.scope)) {
164
- console.error('MUI X: Error checking license. scope not found or invalid!');
163
+ if (license.planScope == null || !PLAN_SCOPES.includes(license.planScope)) {
164
+ console.error('MUI X: Error checking license. planScope not found or invalid!');
165
165
  return {
166
166
  status: LICENSE_STATUS.Invalid
167
167
  };
168
168
  }
169
- if (!isLicenseScopeSufficient(packageName, license.scope)) {
169
+ if (!isPlanScopeSufficient(packageName, license.planScope)) {
170
170
  return {
171
171
  status: LICENSE_STATUS.OutOfScope
172
172
  };
173
173
  }
174
174
 
175
175
  // 'charts-pro' or 'tree-view-pro' can only be used with a newer Pro license
176
- if (license.planVersion === 'initial' && license.scope === 'pro' && !PRO_PACKAGES_AVAILABLE_IN_INITIAL_PRO_PLAN.includes(packageName)) {
176
+ if (license.planVersion === 'initial' && license.planScope === 'pro' && !PRO_PACKAGES_AVAILABLE_IN_INITIAL_PRO_PLAN.includes(packageName)) {
177
177
  return {
178
178
  status: LICENSE_STATUS.NotAvailableInInitialProPlan
179
179
  };
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
5
  Object.defineProperty(exports, "__esModule", {
5
6
  value: true
6
7
  });
@@ -8,8 +9,6 @@ exports.LicenseInfoProvider = LicenseInfoProvider;
8
9
  var React = _interopRequireWildcard(require("react"));
9
10
  var _MuiLicenseInfoContext = _interopRequireDefault(require("./MuiLicenseInfoContext"));
10
11
  var _jsxRuntime = require("react/jsx-runtime");
11
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
12
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
13
12
  /**
14
13
  * @ignore - do not document.
15
14
  */
@@ -1,12 +1,11 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
6
7
  exports.default = void 0;
7
8
  var React = _interopRequireWildcard(require("react"));
8
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
9
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
10
9
  const MuiLicenseInfoContext = /*#__PURE__*/React.createContext({
11
10
  key: undefined
12
11
  });
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
@@ -8,8 +9,6 @@ var React = _interopRequireWildcard(require("react"));
8
9
  var _useLicenseVerifier = require("../useLicenseVerifier");
9
10
  var _licenseStatus = require("../utils/licenseStatus");
10
11
  var _jsxRuntime = require("react/jsx-runtime");
11
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
12
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
13
12
  function getLicenseErrorMessage(licenseStatus) {
14
13
  switch (licenseStatus) {
15
14
  case _licenseStatus.LICENSE_STATUS.ExpiredAnnualGrace:
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.generateLicense = generateLicense;
7
7
  var _md = require("../encoding/md5");
8
8
  var _base = require("../encoding/base64");
9
- var _licenseScope = require("../utils/licenseScope");
10
- var _licensingModel = require("../utils/licensingModel");
9
+ var _plan = require("../utils/plan");
10
+ var _licenseModel = require("../utils/licenseModel");
11
11
  const licenseVersion = '2';
12
12
  function getClearLicenseString(details) {
13
13
  // TODO remove
@@ -18,10 +18,10 @@ function getClearLicenseString(details) {
18
18
  if (details.scope) {
19
19
  details.planScope = details.scope;
20
20
  }
21
- if (details.planScope && !_licenseScope.LICENSE_SCOPES.includes(details.planScope)) {
21
+ if (details.planScope && !_plan.PLAN_SCOPES.includes(details.planScope)) {
22
22
  throw new Error('MUI X: Invalid scope');
23
23
  }
24
- if (details.licenseModel && !_licensingModel.LICENSING_MODELS.includes(details.licenseModel)) {
24
+ if (details.licenseModel && !_licenseModel.LICENSE_MODELS.includes(details.licenseModel)) {
25
25
  throw new Error('MUI X: Invalid licensing model');
26
26
  }
27
27
  const keyParts = [`O=${details.orderNumber}`, `E=${details.expiryDate.getTime()}`, `S=${details.planScope}`, `LM=${details.licenseModel}`, `PV=${details.planVersion}`, `KV=${licenseVersion}`];
package/node/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-license v7.15.0
2
+ * @mui/x-license v7.17.0
3
3
  *
4
4
  * @license MUI X Commercial
5
5
  * This source code is licensed under the commercial license found in the
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
5
  Object.defineProperty(exports, "__esModule", {
5
6
  value: true
6
7
  });
@@ -13,8 +14,6 @@ var _licenseInfo = require("../utils/licenseInfo");
13
14
  var _licenseErrorMessageUtils = require("../utils/licenseErrorMessageUtils");
14
15
  var _licenseStatus = require("../utils/licenseStatus");
15
16
  var _MuiLicenseInfoContext = _interopRequireDefault(require("../Unstable_LicenseInfoProvider/MuiLicenseInfoContext"));
16
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
17
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
18
17
  const sharedLicenseStatuses = exports.sharedLicenseStatuses = {};
19
18
  function useLicenseVerifier(packageName, releaseInfo) {
20
19
  const {
@@ -3,8 +3,8 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.LICENSING_MODELS = void 0;
7
- const LICENSING_MODELS = exports.LICENSING_MODELS = [
6
+ exports.LICENSE_MODELS = void 0;
7
+ const LICENSE_MODELS = exports.LICENSE_MODELS = [
8
8
  /**
9
9
  * A license is outdated if the current version of the software was released after the expiry date of the license.
10
10
  * But the license can be used indefinitely with an older version of the software.
@@ -16,6 +16,6 @@ const LICENSING_MODELS = exports.LICENSING_MODELS = [
16
16
  */
17
17
  'annual',
18
18
  /**
19
- * TODO 2025 remove, legacy name of annual.
19
+ * TODO 2026 remove, legacy name of annual.
20
20
  */
21
21
  'subscription'];
@@ -3,6 +3,6 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.PLAN_VERSIONS = exports.LICENSE_SCOPES = void 0;
7
- const LICENSE_SCOPES = exports.LICENSE_SCOPES = ['pro', 'premium'];
6
+ exports.PLAN_VERSIONS = exports.PLAN_SCOPES = void 0;
7
+ const PLAN_SCOPES = exports.PLAN_SCOPES = ['pro', 'premium'];
8
8
  const PLAN_VERSIONS = exports.PLAN_VERSIONS = ['initial', 'Q3-2024'];
@@ -8,8 +8,8 @@ exports.verifyLicense = verifyLicense;
8
8
  var _base = require("../encoding/base64");
9
9
  var _md = require("../encoding/md5");
10
10
  var _licenseStatus = require("../utils/licenseStatus");
11
- var _licenseScope = require("../utils/licenseScope");
12
- var _licensingModel = require("../utils/licensingModel");
11
+ var _plan = require("../utils/plan");
12
+ var _licenseModel = require("../utils/licenseModel");
13
13
  const getDefaultReleaseDate = () => {
14
14
  const today = new Date();
15
15
  today.setHours(0, 0, 0, 0);
@@ -18,7 +18,7 @@ const getDefaultReleaseDate = () => {
18
18
  function generateReleaseInfo(releaseDate = getDefaultReleaseDate()) {
19
19
  return (0, _base.base64Encode)(releaseDate.getTime().toString());
20
20
  }
21
- function isLicenseScopeSufficient(packageName, licenseScope) {
21
+ function isPlanScopeSufficient(packageName, planScope) {
22
22
  let acceptedScopes;
23
23
  if (packageName.includes('-pro')) {
24
24
  acceptedScopes = ['pro', 'premium'];
@@ -27,7 +27,7 @@ function isLicenseScopeSufficient(packageName, licenseScope) {
27
27
  } else {
28
28
  acceptedScopes = [];
29
29
  }
30
- return acceptedScopes.includes(licenseScope);
30
+ return acceptedScopes.includes(planScope);
31
31
  }
32
32
  const expiryReg = /^.*EXPIRY=([0-9]+),.*$/;
33
33
  const PRO_PACKAGES_AVAILABLE_IN_INITIAL_PRO_PLAN = ['x-data-grid-pro', 'x-date-pickers-pro'];
@@ -46,29 +46,29 @@ const decodeLicenseVersion1 = license => {
46
46
  expiryTimestamp = null;
47
47
  }
48
48
  return {
49
- scope: 'pro',
50
- licensingModel: 'perpetual',
49
+ planScope: 'pro',
50
+ licenseModel: 'perpetual',
51
51
  expiryTimestamp,
52
52
  planVersion: 'initial'
53
53
  };
54
54
  };
55
55
 
56
56
  /**
57
- * Format: O=${orderNumber},E=${expiryTimestamp},S=${scope},LM=${licensingModel},PV=${planVersion},KV=2`;
57
+ * Format: O=${orderNumber},E=${expiryTimestamp},S=${planScope},LM=${licenseModel},PV=${planVersion},KV=2`;
58
58
  */
59
59
  const decodeLicenseVersion2 = license => {
60
60
  const licenseInfo = {
61
- scope: null,
62
- licensingModel: null,
61
+ planScope: null,
62
+ licenseModel: null,
63
63
  expiryTimestamp: null,
64
64
  planVersion: 'initial'
65
65
  };
66
66
  license.split(',').map(token => token.split('=')).filter(el => el.length === 2).forEach(([key, value]) => {
67
67
  if (key === 'S') {
68
- licenseInfo.scope = value;
68
+ licenseInfo.planScope = value;
69
69
  }
70
70
  if (key === 'LM') {
71
- licenseInfo.licensingModel = value;
71
+ licenseInfo.licenseModel = value;
72
72
  }
73
73
  if (key === 'E') {
74
74
  const expiryTimestamp = parseInt(value, 10);
@@ -123,7 +123,7 @@ function verifyLicense({
123
123
  status: _licenseStatus.LICENSE_STATUS.Invalid
124
124
  };
125
125
  }
126
- if (license.licensingModel == null || !_licensingModel.LICENSING_MODELS.includes(license.licensingModel)) {
126
+ if (license.licenseModel == null || !_licenseModel.LICENSE_MODELS.includes(license.licenseModel)) {
127
127
  console.error('MUI X: Error checking license. Licensing model not found or invalid!');
128
128
  return {
129
129
  status: _licenseStatus.LICENSE_STATUS.Invalid
@@ -135,7 +135,7 @@ function verifyLicense({
135
135
  status: _licenseStatus.LICENSE_STATUS.Invalid
136
136
  };
137
137
  }
138
- if (license.licensingModel === 'perpetual' || process.env.NODE_ENV === 'production') {
138
+ if (license.licenseModel === 'perpetual' || process.env.NODE_ENV === 'production') {
139
139
  const pkgTimestamp = parseInt((0, _base.base64Decode)(releaseInfo), 10);
140
140
  if (Number.isNaN(pkgTimestamp)) {
141
141
  throw new Error('MUI X: The release information is invalid. Not able to validate license.');
@@ -145,7 +145,7 @@ function verifyLicense({
145
145
  status: _licenseStatus.LICENSE_STATUS.ExpiredVersion
146
146
  };
147
147
  }
148
- } else if (license.licensingModel === 'subscription' || license.licensingModel === 'annual') {
148
+ } else if (license.licenseModel === 'subscription' || license.licenseModel === 'annual') {
149
149
  if (new Date().getTime() > license.expiryTimestamp) {
150
150
  if (
151
151
  // 30 days grace
@@ -167,20 +167,20 @@ function verifyLicense({
167
167
  };
168
168
  }
169
169
  }
170
- if (license.scope == null || !_licenseScope.LICENSE_SCOPES.includes(license.scope)) {
171
- console.error('MUI X: Error checking license. scope not found or invalid!');
170
+ if (license.planScope == null || !_plan.PLAN_SCOPES.includes(license.planScope)) {
171
+ console.error('MUI X: Error checking license. planScope not found or invalid!');
172
172
  return {
173
173
  status: _licenseStatus.LICENSE_STATUS.Invalid
174
174
  };
175
175
  }
176
- if (!isLicenseScopeSufficient(packageName, license.scope)) {
176
+ if (!isPlanScopeSufficient(packageName, license.planScope)) {
177
177
  return {
178
178
  status: _licenseStatus.LICENSE_STATUS.OutOfScope
179
179
  };
180
180
  }
181
181
 
182
182
  // 'charts-pro' or 'tree-view-pro' can only be used with a newer Pro license
183
- if (license.planVersion === 'initial' && license.scope === 'pro' && !PRO_PACKAGES_AVAILABLE_IN_INITIAL_PRO_PLAN.includes(packageName)) {
183
+ if (license.planVersion === 'initial' && license.planScope === 'pro' && !PRO_PACKAGES_AVAILABLE_IN_INITIAL_PRO_PLAN.includes(packageName)) {
184
184
  return {
185
185
  status: _licenseStatus.LICENSE_STATUS.NotAvailableInInitialProPlan
186
186
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-license",
3
- "version": "7.15.0",
3
+ "version": "7.17.0",
4
4
  "description": "MUI X License verification",
5
5
  "author": "MUI Team",
6
6
  "main": "./node/index.js",
@@ -24,7 +24,7 @@
24
24
  "directory": "packages/x-license"
25
25
  },
26
26
  "dependencies": {
27
- "@babel/runtime": "^7.25.4",
27
+ "@babel/runtime": "^7.25.6",
28
28
  "@mui/utils": "^5.16.6"
29
29
  },
30
30
  "peerDependencies": {
@@ -1 +1 @@
1
- export { useLicenseVerifier } from './useLicenseVerifier';
1
+ export { useLicenseVerifier } from "./useLicenseVerifier.js";
@@ -1,10 +1,10 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import * as React from 'react';
3
- import { verifyLicense } from '../verifyLicense/verifyLicense';
4
- import { LicenseInfo } from '../utils/licenseInfo';
5
- import { showExpiredAnnualGraceLicenseKeyError, showExpiredAnnualLicenseKeyError, showInvalidLicenseKeyError, showMissingLicenseKeyError, showLicenseKeyPlanMismatchError, showExpiredPackageVersionError, showNotAvailableInInitialProPlanError } from '../utils/licenseErrorMessageUtils';
6
- import { LICENSE_STATUS } from '../utils/licenseStatus';
7
- import MuiLicenseInfoContext from '../Unstable_LicenseInfoProvider/MuiLicenseInfoContext';
3
+ import { verifyLicense } from "../verifyLicense/verifyLicense.js";
4
+ import { LicenseInfo } from "../utils/licenseInfo.js";
5
+ import { showExpiredAnnualGraceLicenseKeyError, showExpiredAnnualLicenseKeyError, showInvalidLicenseKeyError, showMissingLicenseKeyError, showLicenseKeyPlanMismatchError, showExpiredPackageVersionError, showNotAvailableInInitialProPlanError } from "../utils/licenseErrorMessageUtils.js";
6
+ import { LICENSE_STATUS } from "../utils/licenseStatus.js";
7
+ import MuiLicenseInfoContext from "../Unstable_LicenseInfoProvider/MuiLicenseInfoContext.js";
8
8
  export const sharedLicenseStatuses = {};
9
9
  export function useLicenseVerifier(packageName, releaseInfo) {
10
10
  const {
package/utils/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export * from './licenseErrorMessageUtils';
2
2
  export * from './licenseInfo';
3
3
  export * from './licenseStatus';
4
- export type { LicenseScope } from './licenseScope';
5
- export type { LicensingModel } from './licensingModel';
4
+ export type { PlanScope } from './plan';
5
+ export type { LicenseModel } from './licenseModel';
6
6
  export type { MuiCommercialPackageName } from './commercialPackages';
package/utils/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export * from './licenseErrorMessageUtils';
2
- export * from './licenseInfo';
3
- export * from './licenseStatus';
1
+ export * from "./licenseErrorMessageUtils.js";
2
+ export * from "./licenseInfo.js";
3
+ export * from "./licenseStatus.js";
4
4
  export {};
@@ -0,0 +1,2 @@
1
+ export declare const LICENSE_MODELS: readonly ["perpetual", "annual", "subscription"];
2
+ export type LicenseModel = (typeof LICENSE_MODELS)[number];
@@ -1,4 +1,4 @@
1
- export const LICENSING_MODELS = [
1
+ export const LICENSE_MODELS = [
2
2
  /**
3
3
  * A license is outdated if the current version of the software was released after the expiry date of the license.
4
4
  * But the license can be used indefinitely with an older version of the software.
@@ -10,6 +10,6 @@ export const LICENSING_MODELS = [
10
10
  */
11
11
  'annual',
12
12
  /**
13
- * TODO 2025 remove, legacy name of annual.
13
+ * TODO 2026 remove, legacy name of annual.
14
14
  */
15
15
  'subscription'];
@@ -1,4 +1,4 @@
1
- export declare const LICENSE_SCOPES: readonly ["pro", "premium"];
1
+ export declare const PLAN_SCOPES: readonly ["pro", "premium"];
2
2
  export declare const PLAN_VERSIONS: readonly ["initial", "Q3-2024"];
3
- export type LicenseScope = (typeof LICENSE_SCOPES)[number];
3
+ export type PlanScope = (typeof PLAN_SCOPES)[number];
4
4
  export type PlanVersion = (typeof PLAN_VERSIONS)[number];
package/utils/plan.js ADDED
@@ -0,0 +1,2 @@
1
+ export const PLAN_SCOPES = ['pro', 'premium'];
2
+ export const PLAN_VERSIONS = ['initial', 'Q3-2024'];
@@ -1 +1 @@
1
- export * from './verifyLicense';
1
+ export * from "./verifyLicense.js";
@@ -1,8 +1,8 @@
1
- import { base64Decode, base64Encode } from '../encoding/base64';
2
- import { md5 } from '../encoding/md5';
3
- import { LICENSE_STATUS } from '../utils/licenseStatus';
4
- import { LICENSE_SCOPES } from '../utils/licenseScope';
5
- import { LICENSING_MODELS } from '../utils/licensingModel';
1
+ import { base64Decode, base64Encode } from "../encoding/base64.js";
2
+ import { md5 } from "../encoding/md5.js";
3
+ import { LICENSE_STATUS } from "../utils/licenseStatus.js";
4
+ import { PLAN_SCOPES } from "../utils/plan.js";
5
+ import { LICENSE_MODELS } from "../utils/licenseModel.js";
6
6
  const getDefaultReleaseDate = () => {
7
7
  const today = new Date();
8
8
  today.setHours(0, 0, 0, 0);
@@ -11,7 +11,7 @@ const getDefaultReleaseDate = () => {
11
11
  export function generateReleaseInfo(releaseDate = getDefaultReleaseDate()) {
12
12
  return base64Encode(releaseDate.getTime().toString());
13
13
  }
14
- function isLicenseScopeSufficient(packageName, licenseScope) {
14
+ function isPlanScopeSufficient(packageName, planScope) {
15
15
  let acceptedScopes;
16
16
  if (packageName.includes('-pro')) {
17
17
  acceptedScopes = ['pro', 'premium'];
@@ -20,7 +20,7 @@ function isLicenseScopeSufficient(packageName, licenseScope) {
20
20
  } else {
21
21
  acceptedScopes = [];
22
22
  }
23
- return acceptedScopes.includes(licenseScope);
23
+ return acceptedScopes.includes(planScope);
24
24
  }
25
25
  const expiryReg = /^.*EXPIRY=([0-9]+),.*$/;
26
26
  const PRO_PACKAGES_AVAILABLE_IN_INITIAL_PRO_PLAN = ['x-data-grid-pro', 'x-date-pickers-pro'];
@@ -39,29 +39,29 @@ const decodeLicenseVersion1 = license => {
39
39
  expiryTimestamp = null;
40
40
  }
41
41
  return {
42
- scope: 'pro',
43
- licensingModel: 'perpetual',
42
+ planScope: 'pro',
43
+ licenseModel: 'perpetual',
44
44
  expiryTimestamp,
45
45
  planVersion: 'initial'
46
46
  };
47
47
  };
48
48
 
49
49
  /**
50
- * Format: O=${orderNumber},E=${expiryTimestamp},S=${scope},LM=${licensingModel},PV=${planVersion},KV=2`;
50
+ * Format: O=${orderNumber},E=${expiryTimestamp},S=${planScope},LM=${licenseModel},PV=${planVersion},KV=2`;
51
51
  */
52
52
  const decodeLicenseVersion2 = license => {
53
53
  const licenseInfo = {
54
- scope: null,
55
- licensingModel: null,
54
+ planScope: null,
55
+ licenseModel: null,
56
56
  expiryTimestamp: null,
57
57
  planVersion: 'initial'
58
58
  };
59
59
  license.split(',').map(token => token.split('=')).filter(el => el.length === 2).forEach(([key, value]) => {
60
60
  if (key === 'S') {
61
- licenseInfo.scope = value;
61
+ licenseInfo.planScope = value;
62
62
  }
63
63
  if (key === 'LM') {
64
- licenseInfo.licensingModel = value;
64
+ licenseInfo.licenseModel = value;
65
65
  }
66
66
  if (key === 'E') {
67
67
  const expiryTimestamp = parseInt(value, 10);
@@ -116,7 +116,7 @@ export function verifyLicense({
116
116
  status: LICENSE_STATUS.Invalid
117
117
  };
118
118
  }
119
- if (license.licensingModel == null || !LICENSING_MODELS.includes(license.licensingModel)) {
119
+ if (license.licenseModel == null || !LICENSE_MODELS.includes(license.licenseModel)) {
120
120
  console.error('MUI X: Error checking license. Licensing model not found or invalid!');
121
121
  return {
122
122
  status: LICENSE_STATUS.Invalid
@@ -128,7 +128,7 @@ export function verifyLicense({
128
128
  status: LICENSE_STATUS.Invalid
129
129
  };
130
130
  }
131
- if (license.licensingModel === 'perpetual' || process.env.NODE_ENV === 'production') {
131
+ if (license.licenseModel === 'perpetual' || process.env.NODE_ENV === 'production') {
132
132
  const pkgTimestamp = parseInt(base64Decode(releaseInfo), 10);
133
133
  if (Number.isNaN(pkgTimestamp)) {
134
134
  throw new Error('MUI X: The release information is invalid. Not able to validate license.');
@@ -138,7 +138,7 @@ export function verifyLicense({
138
138
  status: LICENSE_STATUS.ExpiredVersion
139
139
  };
140
140
  }
141
- } else if (license.licensingModel === 'subscription' || license.licensingModel === 'annual') {
141
+ } else if (license.licenseModel === 'subscription' || license.licenseModel === 'annual') {
142
142
  if (new Date().getTime() > license.expiryTimestamp) {
143
143
  if (
144
144
  // 30 days grace
@@ -160,20 +160,20 @@ export function verifyLicense({
160
160
  };
161
161
  }
162
162
  }
163
- if (license.scope == null || !LICENSE_SCOPES.includes(license.scope)) {
164
- console.error('MUI X: Error checking license. scope not found or invalid!');
163
+ if (license.planScope == null || !PLAN_SCOPES.includes(license.planScope)) {
164
+ console.error('MUI X: Error checking license. planScope not found or invalid!');
165
165
  return {
166
166
  status: LICENSE_STATUS.Invalid
167
167
  };
168
168
  }
169
- if (!isLicenseScopeSufficient(packageName, license.scope)) {
169
+ if (!isPlanScopeSufficient(packageName, license.planScope)) {
170
170
  return {
171
171
  status: LICENSE_STATUS.OutOfScope
172
172
  };
173
173
  }
174
174
 
175
175
  // 'charts-pro' or 'tree-view-pro' can only be used with a newer Pro license
176
- if (license.planVersion === 'initial' && license.scope === 'pro' && !PRO_PACKAGES_AVAILABLE_IN_INITIAL_PRO_PLAN.includes(packageName)) {
176
+ if (license.planVersion === 'initial' && license.planScope === 'pro' && !PRO_PACKAGES_AVAILABLE_IN_INITIAL_PRO_PLAN.includes(packageName)) {
177
177
  return {
178
178
  status: LICENSE_STATUS.NotAvailableInInitialProPlan
179
179
  };
@@ -1,2 +0,0 @@
1
- export const LICENSE_SCOPES = ['pro', 'premium'];
2
- export const PLAN_VERSIONS = ['initial', 'Q3-2024'];
@@ -1,2 +0,0 @@
1
- export const LICENSE_SCOPES = ['pro', 'premium'];
2
- export const PLAN_VERSIONS = ['initial', 'Q3-2024'];
@@ -1,2 +0,0 @@
1
- export declare const LICENSING_MODELS: readonly ["perpetual", "annual", "subscription"];
2
- export type LicensingModel = (typeof LICENSING_MODELS)[number];