![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
prosemirror-suggestcat-plugin
Advanced tools
[![made by Emergence Engineering](https://emergence-engineering.com/ee-logo.svg)](https://emergence-engineering.com)
grammarSuggestPlugin
defaultOptions
which you can overrideimport {
grammarSuggestPlugin,
defaultOptions,
} from "prosemirror-suggestcat-plugin";
const view = new EditorView(document.querySelector("#editor"), {
state: EditorState.create({
doc: schema.nodeFromJSON(initialDoc),
plugins: [
...exampleSetup({ schema }),
grammarSuggestPlugin(PROSEMIRROR_SUGGESTCAT_PLUGIN_API_KEY, {
...defaultOptions,
}),
],
}),
});
GrammarSuggestPluginOptions
export type GrammarSuggestPluginOptions = {
debounceMs: number;
createUpdatePopup: (
view: EditorView,
decoration: Decoration,
pos: number,
applySuggestion: (view: EditorView, decoration: Decoration) => void,
discardSuggestion: (view: EditorView, decoration: Decoration) => void,
) => HTMLElement;
};
defaultOptions
which you can import from our libraryexport const defaultOptions: GrammarSuggestPluginOptions = {
debounceMs: 2000,
createUpdatePopup,
};
createUpdatePopup
optionimport "prosemirror-suggestcat-plugin/dist/styles/styles.css";
<div classname="grammar-suggest-tooltip ProseMirror-widget">
<div classname="grammar-suggest-tooltip-apply">
suggestion
</div
<div classname="grammar-suggest-tooltip-discard">
<svg/>
</div
</div
.grammarSuggestion {
background-color: green;
}
.grammarSuggestion .removalSuggestion {
background-color: red;
}
completePlugin
completePlugin
and provide your API key, and optional optionsimport {
completePluginKey,
completePlugin,
defaultCompleteOptions,
completePluginKey,
} from "prosemirror-suggestcat-plugin";
const v = new EditorView(document.querySelector("#editor"), {
state: EditorState.create({
doc: schema.nodeFromJSON(initialDoc),
plugins: [
...exampleSetup({ schema }),
completePlugin(<YOUR_API_KEY>, defaultCompleteOptions),
],
}),
});
DefaultCompleteOptions
:maxSelection
defaults to 1000 - can controll how long text will be sent to AI to transform itexport interface DefaultCompleteOptions {
maxSelection: number;
}
{status: "idle"}
setMeta
using the completePluginKey
plugin keyview.dispatch(
view.state.tr.setMeta(completePluginKey, {
type: "Complete",
status: "new",
}),
);
pluginState will change to {type: "Complete", status: "streaming", result: "some string being streamed...", }
when the AI finishes the pluginState's status changes to {status: "finished"}
at this point you can either accept or reject the completion
view.dispatch(
view.state.tr.setMeta(completePluginKey, {
type: "Complete",
status: "accpeted",
}),
);
{status: "idle"}
waiting for a new task{status: "idle"}
can handle a new task{status: "error", error: "selection is too big"}
you can clear the error dispatching an accepted
meta like aboveMakeLonger/MakeShorter
- requires a selection, which content to make shorter or longerexport enum TaskType {
Complete = "Complete",
Improve = "Improve",
MakeLonger = "MakeLonger",
MakeShorter = "MakeShorter",
Simplify = "Simplify",
Explain = "Explain",
ActionItems = "ActionItems",
}
export enum OpenAiPromptsWithParam {
ChangeTone = "ChangeTone",
Translate = "Translate",
}
export enum Status {
idle = "idle",
new = "new",
streaming = "streaming",
finished = "finished",
accepted = "accepted",
rejected = "rejected",
done = "done",
error = "error",
}
export interface CompletePluginState {
type?: TaskType;
status?: Status;
result?: string;
selection?: TextSelection;
error?: string;
}
export interface TaskMeta {
type: TaskType;
status: Status.new | Status.accepted | Status.rejected;
}
const getStuff = useCallback(() => {
if (!view) {
return;
}
view.dispatch(
view.state.tr.setMeta(completePluginKey, {
type: "Complete",
status: "new",
}),
);
}, [view]);
const completeStuff = useCallback(() => {
if (!view) {
return;
}
const state = completePluginKey.getState(view.state);
if (state?.status === "finished")
view.dispatch(
view.state.tr.setMeta(completePluginKey, {
type: "Complete",
status: "accepted",
}),
);
}, [view]);
1.1.1
FAQs
[![made by Emergence Engineering](https://emergence-engineering.com/ee-logo.svg)](https://emergence-engineering.com)
The npm package prosemirror-suggestcat-plugin receives a total of 15 weekly downloads. As such, prosemirror-suggestcat-plugin popularity was classified as not popular.
We found that prosemirror-suggestcat-plugin demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.