mirror of
https://github.com/magnum-opus-nn-cp/word-plugin.git
synced 2024-11-22 00:26:35 +03:00
fix: clean up
This commit is contained in:
parent
e3cca280be
commit
069f8770a5
|
@ -28,17 +28,8 @@ const processFunction = async (
|
||||||
if (!range.isNullObject) {
|
if (!range.isNullObject) {
|
||||||
range.insertComment(comment_text + "\n" + "Точность: " + score.toFixed(2));
|
range.insertComment(comment_text + "\n" + "Точность: " + score.toFixed(2));
|
||||||
}
|
}
|
||||||
} catch (e) {
|
// eslint-disable-next-line no-empty
|
||||||
//
|
} catch (e) {}
|
||||||
}
|
|
||||||
|
|
||||||
// return context.document.body
|
|
||||||
// .search(search_text.slice(0, 255).split("\\").join(""), {
|
|
||||||
// ignorePunct: true,
|
|
||||||
// ignoreSpace: true,
|
|
||||||
// })
|
|
||||||
// .getFirst()
|
|
||||||
// .insertComment(comment_text + "\n" + "Точность: " + score.toFixed(2));
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const typeKey: ScoreType = "bert";
|
const typeKey: ScoreType = "bert";
|
||||||
|
@ -107,13 +98,13 @@ export const App: FC<PropsWithChildren<AppProps>> = () => {
|
||||||
}
|
}
|
||||||
}, [processId, refetchProcess, timeout]);
|
}, [processId, refetchProcess, timeout]);
|
||||||
|
|
||||||
// const textId = process?.current === process?.total ? process?.texts[0].id : undefined;
|
const textId = process?.current === process?.total ? process?.texts[0].id : undefined;
|
||||||
const textId = 3184;
|
// const textId = 3184;
|
||||||
|
|
||||||
const {
|
const {
|
||||||
data: textEntity,
|
data: textEntity,
|
||||||
isFetching: textFetching,
|
isFetching: textFetching,
|
||||||
refetch: refetchText,
|
// refetch: refetchText,
|
||||||
} = useText({
|
} = useText({
|
||||||
textId: textId || 0,
|
textId: textId || 0,
|
||||||
type: typeKey,
|
type: typeKey,
|
||||||
|
@ -156,12 +147,12 @@ export const App: FC<PropsWithChildren<AppProps>> = () => {
|
||||||
const documentBody = context.document.body;
|
const documentBody = context.document.body;
|
||||||
context.load(documentBody);
|
context.load(documentBody);
|
||||||
return context.sync().then(async () => {
|
return context.sync().then(async () => {
|
||||||
await refetchText();
|
// await refetchText();
|
||||||
|
|
||||||
// const text = documentBody.text;
|
const text = documentBody.text;
|
||||||
// await createProcess({
|
await createProcess({
|
||||||
// text,
|
text,
|
||||||
// });
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}, []);
|
}, []);
|
||||||
|
|
|
@ -1,32 +0,0 @@
|
||||||
import * as React from "react";
|
|
||||||
|
|
||||||
export interface HeroListItem {
|
|
||||||
icon: string;
|
|
||||||
primaryText: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface HeroListProps {
|
|
||||||
message: string;
|
|
||||||
items: HeroListItem[];
|
|
||||||
children: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
export default class HeroList extends React.Component<HeroListProps> {
|
|
||||||
render() {
|
|
||||||
const { children, items, message } = this.props;
|
|
||||||
|
|
||||||
const listItems = items.map((item, index) => (
|
|
||||||
<li className="ms-ListItem" key={index}>
|
|
||||||
<i className={`ms-Icon ms-Icon--${item.icon}`}></i>
|
|
||||||
<span className="ms-font-m ms-fontColor-neutralPrimary">{item.primaryText}</span>
|
|
||||||
</li>
|
|
||||||
));
|
|
||||||
return (
|
|
||||||
<main className="ms-welcome__main">
|
|
||||||
<h2 className="ms-font-xl ms-fontWeight-semilight ms-fontColor-neutralPrimary ms-u-slideUpIn20">{message}</h2>
|
|
||||||
<ul className="ms-List ms-welcome__features ms-u-slideUpIn10">{listItems}</ul>
|
|
||||||
{children}
|
|
||||||
</main>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,22 +0,0 @@
|
||||||
import * as React from "react";
|
|
||||||
import { Spinner, SpinnerSize } from "@fluentui/react";
|
|
||||||
|
|
||||||
export interface ProgressProps {
|
|
||||||
logo: string;
|
|
||||||
message: string;
|
|
||||||
title: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export default class Progress extends React.Component<ProgressProps> {
|
|
||||||
render() {
|
|
||||||
const { logo, message, title } = this.props;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<section className="ms-welcome__progress ms-u-fadeIn500">
|
|
||||||
<img width="90" height="90" src={logo} alt={title} title={title} />
|
|
||||||
<h1 className="ms-fontSize-su ms-fontWeight-light ms-fontColor-neutralPrimary">{title}</h1>
|
|
||||||
<Spinner size={SpinnerSize.large} label={message} />
|
|
||||||
</section>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user