TagSpaces is an offline, open source, document manager with tagging support
chore: migration to mui6
Ilian Sapundshiev8a656c7f4620
diff --git a/src/renderer/components/SearchPopover.tsx b/src/renderer/components/SearchPopover.tsxindex 20e654283..52af4c89d 100644--- a/src/renderer/components/SearchPopover.tsx+++ b/src/renderer/components/SearchPopover.tsx@@ -542,51 +542,53 @@ function SearchPopover(props: Props) {onChange={handleSearchTermChange}size={desktopMode ? 'small' : 'medium'}onKeyDown={startSearch}- InputProps={{- endAdornment: (- <InputAdornment position="end">- <Tooltip- title={- <>- <Typography variant="subtitle1" color="inherit">- Tips for the extended search- </Typography>- <Typography variant="subtitle2" color="inherit">- π‘ <b>{'sun'}</b> - will match entries having the- word sun but also san or sum in the name- <br />- π‘ <b>{'=sun'}</b> - will match entries having- exactly the word sun in the name- <br />- π‘ <b>{'"sun and beach"'}</b> - will match entries- having `sun and beachΒ΄ in the name- <br />- π‘ <b>{"'sun 'beach"}</b> - will match entries- having sun or beach in the name- <br />- π‘ <b>{'!sun'}</b> - will match entries which do not- contain sun- <br />- π‘ <b>{'^sun'}</b> - will match entries beginning- with sun- <br />- π‘ <b>{'!^sun'}</b> - will match entries witch do- not begin with sun- <br />- π‘ <b>{'.pdf$'}</b> - will match entries ending with- <br />- π‘ <b>{'!.pdf$'}</b> - will match entries not ending- with .pdf- <br />- </Typography>- </>- }- >- <InfoTooltipIcon />- </Tooltip>- </InputAdornment>- ),+ slotProps={{+ input: {+ endAdornment: (+ <InputAdornment position="end">+ <Tooltip+ title={+ <>+ <Typography variant="subtitle1" color="inherit">+ Tips for the extended search+ </Typography>+ <Typography variant="subtitle2" color="inherit">+ π‘ <b>{'sun'}</b> - will match entries having the+ word sun but also san or sum in the name+ <br />+ π‘ <b>{'=sun'}</b> - will match entries having+ exactly the word sun in the name+ <br />+ π‘ <b>{'"sun and beach"'}</b> - will match entries+ having `sun and beachΒ΄ in the name+ <br />+ π‘ <b>{"'sun 'beach"}</b> - will match entries+ having sun or beach in the name+ <br />+ π‘ <b>{'!sun'}</b> - will match entries which do+ not contain sun+ <br />+ π‘ <b>{'^sun'}</b> - will match entries beginning+ with sun+ <br />+ π‘ <b>{'!^sun'}</b> - will match entries witch do+ not begin with sun+ <br />+ π‘ <b>{'.pdf$'}</b> - will match entries ending+ with .pdf+ <br />+ π‘ <b>{'!.pdf$'}</b> - will match entries not+ ending with .pdf+ <br />+ </Typography>+ </>+ }+ >+ <InfoTooltipIcon />+ </Tooltip>+ </InputAdornment>+ ),+ },}}/></Grid>diff --git a/src/renderer/components/TagsSelect.tsx b/src/renderer/components/TagsSelect.tsxindex 89c1133fc..1f8d2bce0 100644--- a/src/renderer/components/TagsSelect.tsx+++ b/src/renderer/components/TagsSelect.tsx@@ -16,23 +16,26 @@**/-import React, { useReducer, useRef, useState } from 'react';-import { useSelector } from 'react-redux';-import TextField from '@mui/material/TextField';-import Autocomplete from '@mui/material/Autocomplete';-import { getTagColor, getTagTextColor } from '-/reducers/settings';-import EntryTagMenu from '-/components/menus/EntryTagMenu';-import { TS } from '-/tagspaces.namespace';import TagContainer from '-/components/TagContainer';-import { getUuid } from '@tagspaces/tagspaces-common/utils-io';-import { getAllTags } from '-/services/taglibrary-utils';-import { Box, InputAdornment } from '@mui/material';+import AiGenTagsButton from '-/components/chat/AiGenTagsButton';+import EntryTagMenu from '-/components/menus/EntryTagMenu';import { useCurrentLocationContext } from '-/hooks/useCurrentLocationContext';-import { isDesktopMode } from '-/reducers/settings';+import {+ getTagColor,+ getTagTextColor,+ isDesktopMode,+} from '-/reducers/settings';+import { getAllTags } from '-/services/taglibrary-utils';import { tagsValidation } from '-/services/utils-io';+import { TS } from '-/tagspaces.namespace';+import { Box, InputAdornment } from '@mui/material';+import Autocomplete from '@mui/material/Autocomplete';import FormHelperText from '@mui/material/FormHelperText';+import TextField from '@mui/material/TextField';+import { getUuid } from '@tagspaces/tagspaces-common/utils-io';+import React, { useReducer, useRef, useState } from 'react';import { useTranslation } from 'react-i18next';-import AiGenTagsButton from '-/components/chat/AiGenTagsButton';+import { useSelector } from 'react-redux';interface Props {dataTid?: string;@@ -212,13 +215,15 @@ function TagsSelect(props: Props) {error={tagsError.current}style={{ marginTop: 0, marginBottom: 0, whiteSpace: 'nowrap' }}fullWidth- InputProps={{- ...params.InputProps,- endAdornment: generateButton && (- <InputAdornment position="end">- <AiGenTagsButton variant="text" />- </InputAdornment>- ),+ slotProps={{+ input: {+ ...params.InputProps,+ endAdornment: generateButton && (+ <InputAdornment position="end">+ <AiGenTagsButton variant="text" />+ </InputAdornment>+ ),+ },}}/>{tagsError.current && (diff --git a/src/renderer/components/chat/SelectChatModel.tsx b/src/renderer/components/chat/SelectChatModel.tsxindex 3b00e34c2..5b63a307f 100644--- a/src/renderer/components/chat/SelectChatModel.tsx+++ b/src/renderer/components/chat/SelectChatModel.tsx@@ -111,19 +111,21 @@ function SelectChatModel(props: Props) {onChange={changeModel}// label={label ? label : t('chooseModel')}id={id ? id : 'selectChatModelId'}- InputProps={{- endAdornment: chosenModel && (- <InputAdornment position="end" sx={{ ml: -12 }}>- <IconButton- aria-label={t('core:deleteModel')}- onClick={handleRemoveModel}- data-tid="deleteModelTID"- size="small"- >- <RemoveIcon />- </IconButton>- </InputAdornment>- ),+ slotProps={{+ input: {+ endAdornment: chosenModel && (+ <InputAdornment position="end" sx={{ ml: -12 }}>+ <IconButton+ aria-label={t('core:deleteModel')}+ onClick={handleRemoveModel}+ data-tid="deleteModelTID"+ size="small"+ >+ <RemoveIcon />+ </IconButton>+ </InputAdornment>+ ),+ },}}><MenuItem value="init" disabled>diff --git a/src/renderer/components/dialogs/CreateEditLocationDialog.tsx b/src/renderer/components/dialogs/CreateEditLocationDialog.tsxindex f7b9e9960..e0a682e88 100644--- a/src/renderer/components/dialogs/CreateEditLocationDialog.tsx+++ b/src/renderer/components/dialogs/CreateEditLocationDialog.tsx@@ -1071,24 +1071,26 @@ function CreateEditLocationDialog(props: Props) {updateValue={(value) => {setNewLocationID(value);}}- InputProps={{- endAdornment: (- <InputAdornment position="end" style={{ height: 32 }}>- <TsIconButton- tooltip={t('core:generateNewLocationId')}- onClick={() => {- const result = confirm(- 'Changing the identifier of a location, will invalidate all the internal sharing links (tslinks) leading to files and folders in this location. Do you want to continue?',- );- if (result) {- setNewLocationID(getUuid());- }- }}- >- <IDIcon />- </TsIconButton>- </InputAdornment>- ),+ slotProps={{+ input: {+ endAdornment: (+ <InputAdornment position="end" style={{ height: 32 }}>+ <TsIconButton+ tooltip={t('core:generateNewLocationId')}+ onClick={() => {+ const result = confirm(+ 'Changing the identifier of a location, will invalidate all the internal sharing links (tslinks) leading to files and folders in this location. Do you want to continue?',+ );+ if (result) {+ setNewLocationID(getUuid());+ }+ }}+ >+ <IDIcon />+ </TsIconButton>+ </InputAdornment>+ ),+ },}}/></FormControl>@@ -1126,37 +1128,39 @@ function CreateEditLocationDialog(props: Props) {}}retrieveValue={() => encryptionKey}label={t('core:encryptionKey')}- InputProps={{- endAdornment: (- <InputAdornment position="end">- <TsIconButton- tooltip={t('toggleKeyVisibility')}- aria-label="toggle key visibility"- onClick={() =>- setShowEncryptionKey(!showEncryptionKey)- }- >- {showEncryptionKey ? (- <Visibility />- ) : (- <VisibilityOff />- )}- </TsIconButton>- <TsIconButton- tooltip={t('generateEncryptionKey')}- aria-label="generate encryption key"- onClick={() =>- setEncryptionKey(- CryptoJS.lib.WordArray.random(32)- .toString(CryptoJS.enc.Hex)- .slice(0, 32),- )- }- >- <PasswordIcon />- </TsIconButton>- </InputAdornment>- ),+ slotProps={{+ input: {+ endAdornment: (+ <InputAdornment position="end">+ <TsIconButton+ tooltip={t('toggleKeyVisibility')}+ aria-label="toggle key visibility"+ onClick={() =>+ setShowEncryptionKey(!showEncryptionKey)+ }+ >+ {showEncryptionKey ? (+ <Visibility />+ ) : (+ <VisibilityOff />+ )}+ </TsIconButton>+ <TsIconButton+ tooltip={t('generateEncryptionKey')}+ aria-label="generate encryption key"+ onClick={() =>+ setEncryptionKey(+ CryptoJS.lib.WordArray.random(32)+ .toString(CryptoJS.enc.Hex)+ .slice(0, 32),+ )+ }+ >+ <PasswordIcon />+ </TsIconButton>+ </InputAdornment>+ ),+ },}}/></FormControl>diff --git a/src/renderer/components/dialogs/EditEntryTagDialog.tsx b/src/renderer/components/dialogs/EditEntryTagDialog.tsxindex a8dbebb36..a3385eead 100644--- a/src/renderer/components/dialogs/EditEntryTagDialog.tsx+++ b/src/renderer/components/dialogs/EditEntryTagDialog.tsx@@ -142,10 +142,12 @@ function EditEntryTagDialog(props: Props) {}}defaultValue={title}data-tid="editTagEntryDialog_input"- InputProps={{- endAdornment: (- <EditIcon onClick={() => setEditDisabled(!editDisabled)} />- ),+ slotProps={{+ input: {+ endAdornment: (+ <EditIcon onClick={() => setEditDisabled(!editDisabled)} />+ ),+ },}}/>{haveError('tag') && (diff --git a/src/renderer/components/dialogs/LinkGeneratorDialog.tsx b/src/renderer/components/dialogs/LinkGeneratorDialog.tsxindex 9bddeaad7..f196bcd78 100644--- a/src/renderer/components/dialogs/LinkGeneratorDialog.tsx+++ b/src/renderer/components/dialogs/LinkGeneratorDialog.tsx@@ -16,28 +16,28 @@**/-import React, { ChangeEvent, useRef, useReducer, useEffect } from 'react';+import InfoIcon from '-/components/InfoIcon';import TsButton from '-/components/TsButton';+import TsSelect from '-/components/TsSelect';+import TsTextField from '-/components/TsTextField';import TsDialogActions from '-/components/dialogs/components/TsDialogActions';import TsDialogTitle from '-/components/dialogs/components/TsDialogTitle';-import DialogContent from '@mui/material/DialogContent';+import { useCurrentLocationContext } from '-/hooks/useCurrentLocationContext';+import { useNotificationContext } from '-/hooks/useNotificationContext';+import { useOpenedEntryContext } from '-/hooks/useOpenedEntryContext';+import { openUrl } from '-/services/utils-io';+import { generateClipboardLink } from '-/utils/dom';import Dialog from '@mui/material/Dialog';-import { useTheme } from '@mui/material/styles';-import useMediaQuery from '@mui/material/useMediaQuery';-import { QRCode } from 'react-qrcode-logo';-import InfoIcon from '-/components/InfoIcon';+import DialogContent from '@mui/material/DialogContent';import InputAdornment from '@mui/material/InputAdornment';import MenuItem from '@mui/material/MenuItem';-import Links from 'assets/links';-import TsTextField from '-/components/TsTextField';-import TsSelect from '-/components/TsSelect';+import { useTheme } from '@mui/material/styles';+import useMediaQuery from '@mui/material/useMediaQuery';import { extractTitle } from '@tagspaces/tagspaces-common/paths';+import Links from 'assets/links';+import { ChangeEvent, useEffect, useReducer, useRef } from 'react';import { useTranslation } from 'react-i18next';-import { useCurrentLocationContext } from '-/hooks/useCurrentLocationContext';-import { useNotificationContext } from '-/hooks/useNotificationContext';-import { generateClipboardLink } from '-/utils/dom';-import { openUrl } from '-/services/utils-io';-import { useOpenedEntryContext } from '-/hooks/useOpenedEntryContext';+import { QRCode } from 'react-qrcode-logo';interface Props {open: boolean;@@ -112,32 +112,34 @@ function LinkGeneratorDialog(props: Props) {</TsSelect><TsTextFieldname="path"- InputProps={{- readOnly: true,- endAdornment: (- <InputAdornment position="start">- <TsButton- data-tid="copySharingLinkTID"- variant="contained"- onClick={() => {- const entryTitle = extractTitle(- gPath,- true,- location.getDirSeparator(),- );- const clipboardItem = generateClipboardLink(- signedLink.current,- entryTitle,- );- navigator.clipboard.write(clipboardItem).then(() => {- showNotification(t('core:linkCopied'));- });- }}- >- {t('core:copy')}- </TsButton>- </InputAdornment>- ),+ slotProps={{+ input: {+ readOnly: true,+ endAdornment: (+ <InputAdornment position="start">+ <TsButton+ data-tid="copySharingLinkTID"+ variant="contained"+ onClick={() => {+ const entryTitle = extractTitle(+ gPath,+ true,+ location.getDirSeparator(),+ );+ const clipboardItem = generateClipboardLink(+ signedLink.current,+ entryTitle,+ );+ navigator.clipboard.write(clipboardItem).then(() => {+ showNotification(t('core:linkCopied'));+ });+ }}+ >+ {t('core:copy')}+ </TsButton>+ </InputAdornment>+ ),+ },}}label={t('core:downloadLink')}value={signedLink.current}diff --git a/src/renderer/components/dialogs/components/LocalForm.tsx b/src/renderer/components/dialogs/components/LocalForm.tsxindex 858788290..f35cb635e 100644--- a/src/renderer/components/dialogs/components/LocalForm.tsx+++ b/src/renderer/components/dialogs/components/LocalForm.tsx@@ -16,20 +16,18 @@**/-import React from 'react';--import FormControl from '@mui/material/FormControl';-import InputAdornment from '@mui/material/InputAdornment';+import AppConfig from '-/AppConfig';import TsIconButton from '-/components/TsIconButton';+import TsTextField from '-/components/TsTextField';+import { useCurrentLocationContext } from '-/hooks/useCurrentLocationContext';+import { selectDirectoryDialog } from '-/services/utils-io';import FolderIcon from '@mui/icons-material/Folder';+import FormControl from '@mui/material/FormControl';import FormHelperText from '@mui/material/FormHelperText';import Grid from '@mui/material/Grid';+import InputAdornment from '@mui/material/InputAdornment';import { extractDirectoryName } from '@tagspaces/tagspaces-common/paths';-import TsTextField from '-/components/TsTextField';-import AppConfig from '-/AppConfig';import { useTranslation } from 'react-i18next';-import { useCurrentLocationContext } from '-/hooks/useCurrentLocationContext';-import { selectDirectoryDialog } from '-/services/utils-io';interface Props {errorTextPath: boolean;@@ -91,14 +89,16 @@ function LocalForm(props: Props) {onChange={(event) => setPath(event.target.value)}value={path}// placeholder="Enter a folder path or select it with the button on the right"- InputProps={{- endAdornment: (- <InputAdornment position="end" style={{ height: 32 }}>- <TsIconButton onClick={openDirectory}>- <FolderIcon />- </TsIconButton>- </InputAdornment>- ),+ slotProps={{+ input: {+ endAdornment: (+ <InputAdornment position="end" style={{ height: 32 }}>+ <TsIconButton onClick={openDirectory}>+ <FolderIcon />+ </TsIconButton>+ </InputAdornment>+ ),+ },}}label={t('core:createLocationPath') + ' *'}/>diff --git a/src/renderer/components/dialogs/components/ObjectStoreForm.tsx b/src/renderer/components/dialogs/components/ObjectStoreForm.tsxindex 9dd85b7b9..b69423cda 100644--- a/src/renderer/components/dialogs/components/ObjectStoreForm.tsx+++ b/src/renderer/components/dialogs/components/ObjectStoreForm.tsx@@ -16,16 +16,15 @@**/-import React from 'react';-import Autocomplete from '@mui/material/Autocomplete';-import Grid from '@mui/material/Grid';-import FormControl from '@mui/material/FormControl';-import FormHelperText from '@mui/material/FormHelperText';import TsIconButton from '-/components/TsIconButton';import TsTextField from '-/components/TsTextField';-import InputAdornment from '@mui/material/InputAdornment';import Visibility from '@mui/icons-material/Visibility';import VisibilityOff from '@mui/icons-material/VisibilityOff';+import Autocomplete from '@mui/material/Autocomplete';+import FormControl from '@mui/material/FormControl';+import FormHelperText from '@mui/material/FormHelperText';+import Grid from '@mui/material/Grid';+import InputAdornment from '@mui/material/InputAdornment';import { useTranslation } from 'react-i18next';/**@@ -218,18 +217,22 @@ function ObjectStoreForm(props: Props) {onChange={(event) => setSecretAccessKey(event.target.value)}value={secretAccessKey}label={t('core:secretAccessKey') + ' *'}- InputProps={{- endAdornment: (- <InputAdornment position="end">- <TsIconButton- tooltip={t('toggleKeyVisibility')}- aria-label="toggle password visibility"- onClick={() => setShowSecretAccessKey(!showSecretAccessKey)}- >- {showSecretAccessKey ? <Visibility /> : <VisibilityOff />}- </TsIconButton>- </InputAdornment>- ),+ slotProps={{+ input: {+ endAdornment: (+ <InputAdornment position="end">+ <TsIconButton+ tooltip={t('toggleKeyVisibility')}+ aria-label="toggle password visibility"+ onClick={() =>+ setShowSecretAccessKey(!showSecretAccessKey)+ }+ >+ {showSecretAccessKey ? <Visibility /> : <VisibilityOff />}+ </TsIconButton>+ </InputAdornment>+ ),+ },}}/></FormControl>diff --git a/src/renderer/components/dialogs/components/WebdavForm.tsx b/src/renderer/components/dialogs/components/WebdavForm.tsxindex ced4cdbae..8c793fd05 100644--- a/src/renderer/components/dialogs/components/WebdavForm.tsx+++ b/src/renderer/components/dialogs/components/WebdavForm.tsx@@ -16,14 +16,14 @@**/-import React, { ChangeEvent } from 'react';+import { ChangeEvent } from 'react';-import FormControl from '@mui/material/FormControl';-import TextField from '@mui/material/TextField';-import InputLabel from '@mui/material/InputLabel';import TsIconButton from '-/components/TsIconButton';-import { Grid, InputAdornment, MenuItem, Select } from '@mui/material';import { Visibility, VisibilityOff } from '@mui/icons-material';+import { Grid, InputAdornment, MenuItem, Select } from '@mui/material';+import FormControl from '@mui/material/FormControl';+import InputLabel from '@mui/material/InputLabel';+import TextField from '@mui/material/TextField';import { useTranslation } from 'react-i18next';interface Props {@@ -138,17 +138,19 @@ function WebdavForm(props: Props) {onChange={(event) => setPassword(event.target.value)}value={password}label={t('core:password')}- InputProps={{- endAdornment: (- <InputAdornment position="end">- <TsIconButton- aria-label="toggle password visibility"- onClick={() => setShowPassword(!showPassword)}- >- {showPassword ? <Visibility /> : <VisibilityOff />}- </TsIconButton>- </InputAdornment>- ),+ slotProps={{+ input: {+ endAdornment: (+ <InputAdornment position="end">+ <TsIconButton+ aria-label="toggle password visibility"+ onClick={() => setShowPassword(!showPassword)}+ >+ {showPassword ? <Visibility /> : <VisibilityOff />}+ </TsIconButton>+ </InputAdornment>+ ),+ },}}/></FormControl>@@ -168,17 +170,19 @@ function WebdavForm(props: Props) {onChange={(event) => setSecretAccessKey(event.target.value)}value={secretAccessKey}label={t('core:webDavToken')}- InputProps={{- endAdornment: (- <InputAdornment position="end">- <TsIconButton- aria-label="toggle password visibility"- onClick={() => setShowPassword(!showPassword)}- >- {showPassword ? <Visibility /> : <VisibilityOff />}- </TsIconButton>- </InputAdornment>- ),+ slotProps={{+ input: {+ endAdornment: (+ <InputAdornment position="end">+ <TsIconButton+ aria-label="toggle password visibility"+ onClick={() => setShowPassword(!showPassword)}+ >+ {showPassword ? <Visibility /> : <VisibilityOff />}+ </TsIconButton>+ </InputAdornment>+ ),+ },}}/></FormControl>