@matrix-widget-toolkit/mui 1.2.0 → 2.0.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.
- package/build/cjs/index.js +6 -6
- package/build/esm/index.js +8 -8
- package/build/index.d.ts +1 -1
- package/package.json +21 -21
package/build/cjs/index.js
CHANGED
|
@@ -658,7 +658,7 @@ function ElementMuiThemeProvider(_a) {
|
|
|
658
658
|
* limitations under the License.
|
|
659
659
|
*/
|
|
660
660
|
function createAvatarUrl(url, _a) {
|
|
661
|
-
var _b =
|
|
661
|
+
var _b = {} , _c = _b.size, size = _c === void 0 ? 60 : _c;
|
|
662
662
|
var mxcPrefix = 'mxc://';
|
|
663
663
|
if (url.indexOf(mxcPrefix) !== 0) {
|
|
664
664
|
return url;
|
|
@@ -782,7 +782,7 @@ var ElementAvatar = react$2.forwardRef(function ElementAvatar(_a, ref) {
|
|
|
782
782
|
});
|
|
783
783
|
|
|
784
784
|
function LoadingView() {
|
|
785
|
-
var id =
|
|
785
|
+
var id = react$2.useId();
|
|
786
786
|
var isLongLoad = reactUse.useTimeout(100)[0];
|
|
787
787
|
var t = reactI18next.useTranslation('widget-toolkit').t;
|
|
788
788
|
return isLongLoad() ? (jsxRuntime.jsxs(material.Box, { display: "flex", flexDirection: "column", alignItems: "center", p: 2, children: [jsxRuntime.jsx(material.CircularProgress, { "aria-labelledby": id }), jsxRuntime.jsx(material.Typography, { py: 2, variant: "h6", id: id, children: t('loading.message', 'Loading…') })] })) : (jsxRuntime.jsx(jsxRuntime.Fragment, {}));
|
|
@@ -890,10 +890,10 @@ function MissingParametersError(_a) {
|
|
|
890
890
|
}
|
|
891
891
|
});
|
|
892
892
|
}); }, [widgetApi, widgetRegistration]);
|
|
893
|
-
var errorDialogTitleId =
|
|
894
|
-
var errorDialogTextId =
|
|
895
|
-
var successDialogTitleId =
|
|
896
|
-
var successDialogTextId =
|
|
893
|
+
var errorDialogTitleId = react$2.useId();
|
|
894
|
+
var errorDialogTextId = react$2.useId();
|
|
895
|
+
var successDialogTitleId = react$2.useId();
|
|
896
|
+
var successDialogTextId = react$2.useId();
|
|
897
897
|
return (jsxRuntime.jsxs(material.Box, { my: 2, children: [jsxRuntime.jsxs(material.Alert, { severity: "error", icon: jsxRuntime.jsx(ErrorIcon__default.default, {}), children: [jsxRuntime.jsx(material.AlertTitle, { children: t('missing-parameters.title', 'Wrong widget registration') }), jsxRuntime.jsx(material.Typography, { variant: "body2", children: t('missing-parameters.instructions', 'The widget is not registered correctly. Make sure to include the correct parameters in the widget URL:') }), jsxRuntime.jsx(material.Box, { my: 1, children: jsxRuntime.jsx(CopyableCode, { code: api.generateWidgetRegistrationUrl() }) }), jsxRuntime.jsx(material.Typography, { variant: "body2", children: t('missing-parameters.repair-instructions', 'You can either modify the widget registration manually or fix it automatically:') }), jsxRuntime.jsx(material.Box, { mt: 1, children: jsxRuntime.jsx(material.Button, { variant: "contained", onClick: handleRepairWidget, children: t('missing-parameters.repair', 'Repair registration') }) })] }), jsxRuntime.jsxs(material.Dialog, { open: isErrorDialogOpen, onClose: function () { return setErrorDialogOpen(false); }, "aria-labelledby": errorDialogTitleId, "aria-describedby": errorDialogTextId, children: [jsxRuntime.jsx(material.DialogTitle, { id: errorDialogTitleId, children: t('missing-parameters.permissions-error.title', 'Error') }), jsxRuntime.jsx(material.DialogContent, { children: jsxRuntime.jsx(material.DialogContentText, { id: errorDialogTextId, children: t('missing-parameters.permissions-error.instructions', 'Insufficient permissions, could not configure widget. Only room admins can configure the widget.') }) }), jsxRuntime.jsx(material.DialogActions, { children: jsxRuntime.jsx(material.Button, { onClick: function () { return setErrorDialogOpen(false); }, autoFocus: true, children: t('missing-parameters.permissions-error.close', 'Close') }) })] }), jsxRuntime.jsxs(material.Dialog, { open: isCompleted, "aria-labelledby": successDialogTitleId, "aria-describedby": successDialogTextId, children: [jsxRuntime.jsx(material.DialogTitle, { id: successDialogTitleId, children: t('missing-parameters.completed.title', 'Widget configuration complete') }), jsxRuntime.jsx(material.DialogContent, { children: jsxRuntime.jsx(material.DialogContentText, { id: successDialogTextId, children: t('missing-parameters.completed.instructions', 'Configuration completed, reopen the widget to start using it.') }) })] })] }));
|
|
898
898
|
}
|
|
899
899
|
|
package/build/esm/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { createTheme, ThemeProvider, CssBaseline, styled, Avatar, Box, CircularProgress, Typography, Alert, AlertTitle, Button, Paper, IconButton, Dialog, DialogTitle, DialogContent, DialogContentText, DialogActions } from '@mui/material';
|
|
3
|
-
import { useState, useEffect, useMemo, forwardRef, useCallback } from 'react';
|
|
3
|
+
import { useState, useEffect, useMemo, forwardRef, useId, useCallback } from 'react';
|
|
4
4
|
import '@fontsource/inter/400.css';
|
|
5
5
|
import '@fontsource/inter/600.css';
|
|
6
6
|
import { ThemeSelectionProvider, useThemeSelection, CapabilitiesGuard, useWidgetApi, WidgetApiProvider } from '@matrix-widget-toolkit/react';
|
|
7
7
|
import { deDE, enUS } from '@mui/material/locale';
|
|
8
|
-
import { deepmerge
|
|
8
|
+
import { deepmerge } from '@mui/utils';
|
|
9
9
|
import i18n from 'i18next';
|
|
10
10
|
import createCache from '@emotion/cache';
|
|
11
11
|
import { CacheProvider } from '@emotion/react';
|
|
@@ -646,7 +646,7 @@ function ElementMuiThemeProvider(_a) {
|
|
|
646
646
|
* limitations under the License.
|
|
647
647
|
*/
|
|
648
648
|
function createAvatarUrl(url, _a) {
|
|
649
|
-
var _b =
|
|
649
|
+
var _b = {} , _c = _b.size, size = _c === void 0 ? 60 : _c;
|
|
650
650
|
var mxcPrefix = 'mxc://';
|
|
651
651
|
if (url.indexOf(mxcPrefix) !== 0) {
|
|
652
652
|
return url;
|
|
@@ -770,7 +770,7 @@ var ElementAvatar = forwardRef(function ElementAvatar(_a, ref) {
|
|
|
770
770
|
});
|
|
771
771
|
|
|
772
772
|
function LoadingView() {
|
|
773
|
-
var id =
|
|
773
|
+
var id = useId();
|
|
774
774
|
var isLongLoad = useTimeout(100)[0];
|
|
775
775
|
var t = useTranslation('widget-toolkit').t;
|
|
776
776
|
return isLongLoad() ? (jsxs(Box, { display: "flex", flexDirection: "column", alignItems: "center", p: 2, children: [jsx(CircularProgress, { "aria-labelledby": id }), jsx(Typography, { py: 2, variant: "h6", id: id, children: t('loading.message', 'Loading…') })] })) : (jsx(Fragment, {}));
|
|
@@ -878,10 +878,10 @@ function MissingParametersError(_a) {
|
|
|
878
878
|
}
|
|
879
879
|
});
|
|
880
880
|
}); }, [widgetApi, widgetRegistration]);
|
|
881
|
-
var errorDialogTitleId =
|
|
882
|
-
var errorDialogTextId =
|
|
883
|
-
var successDialogTitleId =
|
|
884
|
-
var successDialogTextId =
|
|
881
|
+
var errorDialogTitleId = useId();
|
|
882
|
+
var errorDialogTextId = useId();
|
|
883
|
+
var successDialogTitleId = useId();
|
|
884
|
+
var successDialogTextId = useId();
|
|
885
885
|
return (jsxs(Box, { my: 2, children: [jsxs(Alert, { severity: "error", icon: jsx(ErrorIcon, {}), children: [jsx(AlertTitle, { children: t('missing-parameters.title', 'Wrong widget registration') }), jsx(Typography, { variant: "body2", children: t('missing-parameters.instructions', 'The widget is not registered correctly. Make sure to include the correct parameters in the widget URL:') }), jsx(Box, { my: 1, children: jsx(CopyableCode, { code: generateWidgetRegistrationUrl() }) }), jsx(Typography, { variant: "body2", children: t('missing-parameters.repair-instructions', 'You can either modify the widget registration manually or fix it automatically:') }), jsx(Box, { mt: 1, children: jsx(Button, { variant: "contained", onClick: handleRepairWidget, children: t('missing-parameters.repair', 'Repair registration') }) })] }), jsxs(Dialog, { open: isErrorDialogOpen, onClose: function () { return setErrorDialogOpen(false); }, "aria-labelledby": errorDialogTitleId, "aria-describedby": errorDialogTextId, children: [jsx(DialogTitle, { id: errorDialogTitleId, children: t('missing-parameters.permissions-error.title', 'Error') }), jsx(DialogContent, { children: jsx(DialogContentText, { id: errorDialogTextId, children: t('missing-parameters.permissions-error.instructions', 'Insufficient permissions, could not configure widget. Only room admins can configure the widget.') }) }), jsx(DialogActions, { children: jsx(Button, { onClick: function () { return setErrorDialogOpen(false); }, autoFocus: true, children: t('missing-parameters.permissions-error.close', 'Close') }) })] }), jsxs(Dialog, { open: isCompleted, "aria-labelledby": successDialogTitleId, "aria-describedby": successDialogTextId, children: [jsx(DialogTitle, { id: successDialogTitleId, children: t('missing-parameters.completed.title', 'Widget configuration complete') }), jsx(DialogContent, { children: jsx(DialogContentText, { id: successDialogTextId, children: t('missing-parameters.completed.instructions', 'Configuration completed, reopen the widget to start using it.') }) })] })] }));
|
|
886
886
|
}
|
|
887
887
|
|
package/build/index.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ import { WidgetRegistration } from '@matrix-widget-toolkit/api';
|
|
|
21
21
|
* A component to display user and room avatars in the style of Element.
|
|
22
22
|
* @param param0 - {@link ElementAvatarProps}
|
|
23
23
|
*/
|
|
24
|
-
export declare const ElementAvatar: ForwardRefExoticComponent<
|
|
24
|
+
export declare const ElementAvatar: ForwardRefExoticComponent<Omit<ElementAvatarProps, "ref"> & RefAttributes<HTMLDivElement>>;
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
27
|
* Props for the {@link ElementAvatar} component.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@matrix-widget-toolkit/mui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "A customized material-ui theme that matches the style of the Element Matrix client",
|
|
5
5
|
"author": "Nordeck IT + Consulting GmbH",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -9,20 +9,20 @@
|
|
|
9
9
|
"types": "./build/index.d.ts",
|
|
10
10
|
"devDependencies": {
|
|
11
11
|
"@craco/craco": "^7.1.0",
|
|
12
|
-
"@testing-library/jest-dom": "^6.
|
|
13
|
-
"@testing-library/react": "^
|
|
14
|
-
"@testing-library/user-event": "^14.5.
|
|
12
|
+
"@testing-library/jest-dom": "^6.4.2",
|
|
13
|
+
"@testing-library/react": "^14.2.2",
|
|
14
|
+
"@testing-library/user-event": "^14.5.2",
|
|
15
15
|
"@types/jest": "^27.5.2",
|
|
16
|
-
"@types/jest-axe": "^3.5.
|
|
17
|
-
"@types/lodash": "^4.
|
|
16
|
+
"@types/jest-axe": "^3.5.9",
|
|
17
|
+
"@types/lodash": "^4.17.0",
|
|
18
18
|
"@types/node": "^20.8.6",
|
|
19
|
-
"@types/react": "^
|
|
19
|
+
"@types/react": "^18.2.74",
|
|
20
20
|
"copyfiles": "^2.4.1",
|
|
21
|
-
"i18next-parser": "^8.
|
|
21
|
+
"i18next-parser": "^8.13.0",
|
|
22
22
|
"jest-axe": "^8.0.0",
|
|
23
|
-
"react": "^
|
|
23
|
+
"react": "^18.2.0",
|
|
24
24
|
"react-scripts": "5.0.1",
|
|
25
|
-
"typescript": "^5.
|
|
25
|
+
"typescript": "^5.4.5"
|
|
26
26
|
},
|
|
27
27
|
"scripts": {
|
|
28
28
|
"build": "tsc && rollup --config ../../rollup.config.mjs",
|
|
@@ -39,21 +39,21 @@
|
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@emotion/cache": "^11.11.0",
|
|
42
|
-
"@emotion/react": "^11.11.
|
|
43
|
-
"@emotion/styled": "^11.11.
|
|
44
|
-
"@fontsource/inter": "^5.0.
|
|
45
|
-
"@mui/icons-material": "^5.15.
|
|
46
|
-
"@mui/material": "^5.15.
|
|
42
|
+
"@emotion/react": "^11.11.4",
|
|
43
|
+
"@emotion/styled": "^11.11.5",
|
|
44
|
+
"@fontsource/inter": "^5.0.18",
|
|
45
|
+
"@mui/icons-material": "^5.15.15",
|
|
46
|
+
"@mui/material": "^5.15.15",
|
|
47
47
|
"@mui/utils": "^5.14.13",
|
|
48
48
|
"@matrix-widget-toolkit/api": "^3.2.2",
|
|
49
|
-
"@matrix-widget-toolkit/react": "^
|
|
50
|
-
"i18next": "^23.
|
|
51
|
-
"i18next-browser-languagedetector": "^7.2.
|
|
52
|
-
"i18next-resources-to-backend": "^1.2.
|
|
49
|
+
"@matrix-widget-toolkit/react": "^2.0.0",
|
|
50
|
+
"i18next": "^23.11.2",
|
|
51
|
+
"i18next-browser-languagedetector": "^7.2.1",
|
|
52
|
+
"i18next-resources-to-backend": "^1.2.1",
|
|
53
53
|
"lodash": "^4.17.21",
|
|
54
54
|
"matrix-widget-api": "^1.6.0",
|
|
55
|
-
"react": "^
|
|
56
|
-
"react-i18next": "^14.
|
|
55
|
+
"react": "^18.2.0",
|
|
56
|
+
"react-i18next": "^14.1.1",
|
|
57
57
|
"react-use": "^17.5.0"
|
|
58
58
|
},
|
|
59
59
|
"repository": {
|