Skip to content

Commit

Permalink
remove formik from insert-cite (and deps)
Browse files Browse the repository at this point in the history
  • Loading branch information
jjallaire committed Jun 11, 2023
1 parent c38cdef commit 3a2255a
Show file tree
Hide file tree
Showing 23 changed files with 203 additions and 892 deletions.
2 changes: 1 addition & 1 deletion apps/writer-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@types/cors": "^2.8.10",
"@types/express": "^4.17.12",
"@types/morgan": "^1.9.2",
"@types/node": "^15.12.2",
"@types/node": "^16.11.20",
"@types/tmp": "^0.2.3",
"editor-server": "*",
"editor-types": "*",
Expand Down
2 changes: 1 addition & 1 deletion apps/writer-server/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"lib": ["ES2015"],
"lib": ["ES2020"],
"module": "CommonJS",
"outDir": "./dist",
"rootDir": "./src"
Expand Down
4 changes: 1 addition & 3 deletions apps/writer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
"editor-core": "*",
"editor-types": "*",
"editor-ui": "*",
"formik": "^2.2.9",
"i18next": "^22.0.4",
"jayson": "^4.0.0",
"lodash.debounce": "^4.0.8",
Expand All @@ -32,8 +31,7 @@
"react-transition-group": "^4.4.5",
"redux": "^4.2.0",
"ui-widgets": "*",
"uuid": "^9.0.0",
"yup": "^0.32.11"
"uuid": "^9.0.0"
},
"devDependencies": {
"@types/lodash.debounce": "^4.0.7",
Expand Down
40 changes: 22 additions & 18 deletions apps/writer/src/workbench/WorkbenchPrefsDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@

import React, { useContext, useEffect, useState } from 'react';

import { FormikDialog, FormikHTMLSelect } from 'ui-widgets';

import {
CommandManagerContext,
useGetPrefsQuery,
Expand All @@ -29,6 +27,8 @@ import {
import { defaultPrefs, Prefs } from 'editor-types';

import { WorkbenchCommandId } from './commands';
import { ModalDialog } from 'ui-widgets';
import { Field, Select } from '@fluentui/react-components';

export const WorkbenchPrefsDialog: React.FC = () => {
// command to show dialog
Expand All @@ -55,6 +55,8 @@ export const WorkbenchPrefsDialog: React.FC = () => {
const { data: prefs = defaultPrefs() } = useGetPrefsQuery();
const [ setPrefs ] = useSetPrefsMutation();
const { data: dictionaries } = useGetAvailableDictionariesQuery();

const [dictionaryLocale, setDictionaryLocale] = useState(prefs.dictionaryLocale);

const close = (prefs?: Prefs) => {
setIsOpen(false);
Expand All @@ -65,25 +67,27 @@ export const WorkbenchPrefsDialog: React.FC = () => {
}

return (
<FormikDialog
<ModalDialog
isOpen={isOpen}
title={t('prefs_dialog_caption') as string}
initialValues={prefs}
onSubmit={close}
onReset={() => close()}
onOK={() => close({ ...prefs, dictionaryLocale })}
onCancel={() => close()}
>
<FormikHTMLSelect
name={'dictionaryLocale'}
label={t('prefs_dialog_dictionary_locale')}
options={dictionaries
? dictionaries.map(dictionary => ({
value: dictionary.locale,
label: dictionary.name
}))
: [ { value: prefs.dictionaryLocale } ]
}
/>
</FormikDialog>
<Field label={t('prefs_dialog_dictionary_locale')} >
<Select
value={dictionaryLocale}
onChange={(_ev, data) => setDictionaryLocale(data.value)}
>
{dictionaries
? dictionaries.map(dictionary => {
return <option value={dictionary.locale} key={dictionary.locale}>{dictionary.name}</option>
})
: <option value={dictionaryLocale}>{dictionaryLocale}</option>

}
</Select>
</Field>
</ModalDialog>
);
};

Expand Down
6 changes: 1 addition & 5 deletions packages/editor-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,23 @@
"dependencies": {
"@fluentui/react-components": "^9.21.0",
"@fluentui/react-icons": "^2.0.203",
"@types/yup": "^0.32.0",
"core": "*",
"core-browser": "*",
"editor-core": "*",
"editor-types": "*",
"formik": "^2.2.9",
"i18next": "^22.4.6",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-transition-group": "^4.4.5",
"redux": "^4.2.0",
"typo-js": "^1.2.2",
"ui-widgets": "*",
"use-debounce": "^9.0.2",
"yup": "^0.32.11"
"use-debounce": "^9.0.2"
},
"devDependencies": {
"@types/react": "^18.2.6",
"@types/react-dom": "^18.2.4",
"@types/typo-js": "^1.2.0",
"@types/yup": "^0.32.0",
"tsconfig": "*",
"typescript": "^4.5.2"
}
Expand Down
Loading

0 comments on commit 3a2255a

Please sign in to comment.