|
@@ -507,8 +507,6 @@ type HandsonTableModalSaveHandler = (table: MarkdownTable) => void;
|
|
|
type HandsontableModalStatus = {
|
|
type HandsontableModalStatus = {
|
|
|
isOpened: boolean,
|
|
isOpened: boolean,
|
|
|
table: MarkdownTable,
|
|
table: MarkdownTable,
|
|
|
- // TODO: Define editor type
|
|
|
|
|
- editor?: any,
|
|
|
|
|
autoFormatMarkdownTable?: boolean,
|
|
autoFormatMarkdownTable?: boolean,
|
|
|
// onSave is passed only when editing table directly from the page.
|
|
// onSave is passed only when editing table directly from the page.
|
|
|
onSave?: HandsonTableModalSaveHandler
|
|
onSave?: HandsonTableModalSaveHandler
|
|
@@ -517,7 +515,6 @@ type HandsontableModalStatus = {
|
|
|
type HandsontableModalStatusUtils = {
|
|
type HandsontableModalStatusUtils = {
|
|
|
open(
|
|
open(
|
|
|
table: MarkdownTable,
|
|
table: MarkdownTable,
|
|
|
- editor?: any,
|
|
|
|
|
autoFormatMarkdownTable?: boolean,
|
|
autoFormatMarkdownTable?: boolean,
|
|
|
onSave?: HandsonTableModalSaveHandler
|
|
onSave?: HandsonTableModalSaveHandler
|
|
|
): void
|
|
): void
|
|
@@ -541,7 +538,6 @@ export const useHandsontableModal = (status?: HandsontableModalStatus): SWRRespo
|
|
|
const initialData: HandsontableModalStatus = {
|
|
const initialData: HandsontableModalStatus = {
|
|
|
isOpened: false,
|
|
isOpened: false,
|
|
|
table: defaultMarkdownTable(),
|
|
table: defaultMarkdownTable(),
|
|
|
- editor: undefined,
|
|
|
|
|
autoFormatMarkdownTable: false,
|
|
autoFormatMarkdownTable: false,
|
|
|
};
|
|
};
|
|
|
|
|
|
|
@@ -549,14 +545,14 @@ export const useHandsontableModal = (status?: HandsontableModalStatus): SWRRespo
|
|
|
|
|
|
|
|
const { mutate } = swrResponse;
|
|
const { mutate } = swrResponse;
|
|
|
|
|
|
|
|
- const open = useCallback((table: MarkdownTable, editor?: any, autoFormatMarkdownTable?: boolean, onSave?: HandsonTableModalSaveHandler): void => {
|
|
|
|
|
|
|
+ const open = useCallback((table: MarkdownTable, autoFormatMarkdownTable?: boolean, onSave?: HandsonTableModalSaveHandler): void => {
|
|
|
mutate({
|
|
mutate({
|
|
|
- isOpened: true, table, editor, autoFormatMarkdownTable, onSave,
|
|
|
|
|
|
|
+ isOpened: true, table, autoFormatMarkdownTable, onSave,
|
|
|
});
|
|
});
|
|
|
}, [mutate]);
|
|
}, [mutate]);
|
|
|
const close = useCallback((): void => {
|
|
const close = useCallback((): void => {
|
|
|
mutate({
|
|
mutate({
|
|
|
- isOpened: false, table: defaultMarkdownTable(), editor: undefined, autoFormatMarkdownTable: false, onSave: undefined,
|
|
|
|
|
|
|
+ isOpened: false, table: defaultMarkdownTable(), autoFormatMarkdownTable: false, onSave: undefined,
|
|
|
});
|
|
});
|
|
|
}, [mutate]);
|
|
}, [mutate]);
|
|
|
|
|
|