ct-rich-text-editor 1.3.13 → 1.3.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1479,7 +1479,7 @@ const AiTextTransform = async ({ content, apiKey }) => {
1479
1479
  const AI_ACTION_COMMAND = createCommand(
1480
1480
  "AI_ACTION_COMMAND"
1481
1481
  );
1482
- const ImageView = React__default.lazy(() => import("./index-26434d4e.js"));
1482
+ const ImageView = React__default.lazy(() => import("./index-5895ff07.js"));
1483
1483
  function isGoogleDocCheckboxImg(img) {
1484
1484
  return img.parentElement != null && img.parentElement.tagName === "LI" && img.previousSibling === null && img.getAttribute("aria-roledescription") === "checkbox";
1485
1485
  }
@@ -7105,6 +7105,16 @@ const Bold = createLucideIcon("Bold", [
7105
7105
  ["path", { d: "M14 12a4 4 0 0 0 0-8H6v8", key: "v2sylx" }],
7106
7106
  ["path", { d: "M15 20a4 4 0 0 0 0-8H6v8Z", key: "1ef5ya" }]
7107
7107
  ]);
7108
+ /**
7109
+ * @license lucide-react v0.344.0 - ISC
7110
+ *
7111
+ * This source code is licensed under the ISC license.
7112
+ * See the LICENSE file in the root directory of this source tree.
7113
+ */
7114
+ const BookOpen = createLucideIcon("BookOpen", [
7115
+ ["path", { d: "M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z", key: "vv98re" }],
7116
+ ["path", { d: "M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z", key: "1cyq3y" }]
7117
+ ]);
7108
7118
  /**
7109
7119
  * @license lucide-react v0.344.0 - ISC
7110
7120
  *
@@ -15272,7 +15282,7 @@ const EmbedComponent = ({ url, displayType, alignment, nodeKey }) => {
15272
15282
  }
15273
15283
  );
15274
15284
  };
15275
- const FileComponent = React$1.lazy(() => import("./index-fa2d3309.js"));
15285
+ const FileComponent = React$1.lazy(() => import("./index-6f30fb20.js"));
15276
15286
  function convertFileElement(domNode) {
15277
15287
  if (domNode instanceof HTMLDivElement) {
15278
15288
  const dataUrl = domNode.getAttribute("data-lexical-file-src");
@@ -19977,10 +19987,10 @@ const PDF_CONFIG = {
19977
19987
  };
19978
19988
  const loadHtml2Pdf = async () => {
19979
19989
  try {
19980
- const mod = await import("./html2pdf.bundle.min-277f1c42.js").then((n) => n.h);
19990
+ const mod = await import("./html2pdf.bundle.min-bb5427ee.js").then((n) => n.h);
19981
19991
  return (mod == null ? void 0 : mod.default) || mod;
19982
19992
  } catch {
19983
- const mod2 = await import("./html2pdf.bundle-f58b88f5.js").then((n) => n.h);
19993
+ const mod2 = await import("./html2pdf.bundle-9fb65d98.js").then((n) => n.h);
19984
19994
  return (mod2 == null ? void 0 : mod2.default) || mod2;
19985
19995
  }
19986
19996
  };
@@ -26932,6 +26942,7 @@ const GrammarCheckPlugin = "";
26932
26942
  createCommand(
26933
26943
  "AUTOCOMPLETE_COMMAND"
26934
26944
  );
26945
+ const DICTIONARY_STORAGE_KEY = "grammarDictionary";
26935
26946
  const STATIC_SUGGESTIONS = [
26936
26947
  "javascript",
26937
26948
  "typescript",
@@ -26956,6 +26967,29 @@ const TOOLTIP_CONFIG = {
26956
26967
  offsetY: 20
26957
26968
  };
26958
26969
  const TOOLTIP_CLOSE_DELAY = 400;
26970
+ const getDictionaryWords = () => {
26971
+ try {
26972
+ const stored = localStorage.getItem(DICTIONARY_STORAGE_KEY);
26973
+ return stored ? new Set(JSON.parse(stored)) : /* @__PURE__ */ new Set();
26974
+ } catch (e) {
26975
+ console.error("Error reading dictionary from localStorage", e);
26976
+ return /* @__PURE__ */ new Set();
26977
+ }
26978
+ };
26979
+ const addWordToDictionary = (word) => {
26980
+ try {
26981
+ const dictionary = getDictionaryWords();
26982
+ dictionary.add(word.toLowerCase());
26983
+ localStorage.setItem(
26984
+ DICTIONARY_STORAGE_KEY,
26985
+ JSON.stringify(Array.from(dictionary))
26986
+ );
26987
+ return dictionary;
26988
+ } catch (e) {
26989
+ console.error("Error saving to dictionary", e);
26990
+ return /* @__PURE__ */ new Set();
26991
+ }
26992
+ };
26959
26993
  const generateSentenceHash = (text) => {
26960
26994
  let hash = 0;
26961
26995
  const str = text.trim().toLowerCase();
@@ -27097,10 +27131,6 @@ class GrammarAIService {
27097
27131
  this.sentenceCache.delete(oldestKey);
27098
27132
  }
27099
27133
  }
27100
- invalidateSentence(text) {
27101
- const hash = generateSentenceHash(text);
27102
- this.sentenceCache.delete(hash);
27103
- }
27104
27134
  async processInChunks(sentences, maxSuggestions, onSentenceComplete, onChunkComplete) {
27105
27135
  const allResults = [];
27106
27136
  let totalCached = 0;
@@ -27222,6 +27252,7 @@ function CombinedAutocompleteGrammarPlugin({
27222
27252
  const updateHighlightsRef = useRef(() => {
27223
27253
  });
27224
27254
  const currentCheckId = useRef(0);
27255
+ const dictionaryRef = useRef(/* @__PURE__ */ new Set());
27225
27256
  const [queryString, setQueryString] = useState$1(null);
27226
27257
  const [suggestions, setSuggestions] = useState$1([]);
27227
27258
  const [selectedIndex, setSelectedIndex] = useState$1(0);
@@ -27238,6 +27269,9 @@ function CombinedAutocompleteGrammarPlugin({
27238
27269
  /* @__PURE__ */ new Set()
27239
27270
  );
27240
27271
  const [tooltipState, setTooltipState] = useState$1(null);
27272
+ useEffect$1(() => {
27273
+ dictionaryRef.current = getDictionaryWords();
27274
+ }, []);
27241
27275
  const extractWordsFromEditor = useCallback(() => {
27242
27276
  const words = new Set(STATIC_SUGGESTIONS);
27243
27277
  editor.getEditorState().read(() => {
@@ -27319,7 +27353,11 @@ function CombinedAutocompleteGrammarPlugin({
27319
27353
  });
27320
27354
  const filteredErrors = result.errors.filter((error) => {
27321
27355
  const errorKey = `${error.sentenceId}-${error.original.toLowerCase()}`;
27322
- return !ignoredErrors.has(errorKey);
27356
+ const isIgnored = ignoredErrors.has(errorKey);
27357
+ const isDictionaryWord = dictionaryRef.current.has(
27358
+ error.original.toLowerCase()
27359
+ );
27360
+ return !isIgnored && !isDictionaryWord;
27323
27361
  });
27324
27362
  setErrorMap((prev) => {
27325
27363
  const updated = new Map(prev);
@@ -27491,7 +27529,9 @@ function CombinedAutocompleteGrammarPlugin({
27491
27529
  setErrorMap((prev) => {
27492
27530
  const updated = new Map(prev);
27493
27531
  const sentenceErrors = updated.get(sentenceId) || [];
27494
- const remaining = sentenceErrors.filter((err) => err !== error);
27532
+ const remaining = sentenceErrors.filter(
27533
+ (err) => err.original !== error.original
27534
+ );
27495
27535
  if (remaining.length > 0) {
27496
27536
  updated.set(sentenceId, remaining);
27497
27537
  } else {
@@ -27499,9 +27539,34 @@ function CombinedAutocompleteGrammarPlugin({
27499
27539
  }
27500
27540
  return updated;
27501
27541
  });
27502
- setErrors((prev) => prev.filter((err) => err !== error));
27542
+ setErrors((prev) => prev.filter((err) => err.original !== error.original));
27503
27543
  setTooltipState(null);
27504
27544
  }, []);
27545
+ const handleAddToDictionary = useCallback((error) => {
27546
+ const updatedDictionary = addWordToDictionary(error.original);
27547
+ dictionaryRef.current = updatedDictionary;
27548
+ const sentenceId = error.sentenceId || "";
27549
+ setErrorMap((prev) => {
27550
+ const updated = new Map(prev);
27551
+ const sentenceErrors = updated.get(sentenceId) || [];
27552
+ const remaining = sentenceErrors.filter(
27553
+ (err) => err.original.toLowerCase() !== error.original.toLowerCase()
27554
+ );
27555
+ if (remaining.length > 0) {
27556
+ updated.set(sentenceId, remaining);
27557
+ } else {
27558
+ updated.delete(sentenceId);
27559
+ }
27560
+ return updated;
27561
+ });
27562
+ setErrors(
27563
+ (prev) => prev.filter(
27564
+ (err) => err.original.toLowerCase() !== error.original.toLowerCase()
27565
+ )
27566
+ );
27567
+ setTooltipState(null);
27568
+ window.dispatchEvent(new Event("customUpdateHighlights"));
27569
+ }, []);
27505
27570
  const calculateMenuPosition = useCallback(() => {
27506
27571
  if (!anchorElementRef.current)
27507
27572
  return;
@@ -27658,6 +27723,9 @@ function CombinedAutocompleteGrammarPlugin({
27658
27723
  const nodeMap = lastTextMap.current;
27659
27724
  const fullText = lastCheckedText.current;
27660
27725
  errors.forEach((error) => {
27726
+ if (dictionaryRef.current.has(error.original.toLowerCase())) {
27727
+ return;
27728
+ }
27661
27729
  let startIdx = fullText.indexOf(error.originalSentence || "");
27662
27730
  if (startIdx === -1)
27663
27731
  startIdx = fullText.indexOf(error.original);
@@ -27668,6 +27736,11 @@ function CombinedAutocompleteGrammarPlugin({
27668
27736
  /[.*+?^${}()|[\]\\]/g,
27669
27737
  "\\$&"
27670
27738
  );
27739
+ const wordBoundaryRegex = new RegExp(`\\b${escapedOriginal}\\b`, "g");
27740
+ if (!wordBoundaryRegex.test(fullText)) {
27741
+ return;
27742
+ }
27743
+ wordBoundaryRegex.lastIndex = 0;
27671
27744
  const regex = new RegExp(`\\b${escapedOriginal}\\b`);
27672
27745
  const match = sentenceSub.match(regex);
27673
27746
  const wordRelPos = match ? match.index : -1;
@@ -27730,7 +27803,7 @@ function CombinedAutocompleteGrammarPlugin({
27730
27803
  setTooltipState({
27731
27804
  error,
27732
27805
  x: rect.left + rect.width / 2,
27733
- y: rect.bottom + window.scrollY + 5,
27806
+ y: rect.bottom + 5,
27734
27807
  isVisible: true,
27735
27808
  isLocked: false
27736
27809
  });
@@ -27817,13 +27890,13 @@ function CombinedAutocompleteGrammarPlugin({
27817
27890
  setTooltipState(null);
27818
27891
  }, TOOLTIP_CLOSE_DELAY);
27819
27892
  },
27820
- children: /* @__PURE__ */ jsx(Card, { className: "cteditor-w-[340px] cteditor-shadow-2xl cteditor-border-2 cteditor-bg-white dark:cteditor-bg-gray-900 grammar-tooltip-card", children: /* @__PURE__ */ jsxs(CardContent, { className: "cteditor-p-5 cteditor-space-y-4", children: [
27821
- /* @__PURE__ */ jsxs("div", { className: "cteditor-flex cteditor-items-start cteditor-justify-between cteditor-gap-3", children: [
27822
- /* @__PURE__ */ jsxs("div", { className: "cteditor-flex cteditor-items-center cteditor-gap-2", children: [
27893
+ children: /* @__PURE__ */ jsx(Card, { className: "cteditor-w-[340px] cteditor-max-w-[calc(100vw-32px)] cteditor-shadow-2xl cteditor-border-2 cteditor-bg-white dark:cteditor-bg-gray-900 grammar-tooltip-card cteditor-overflow-hidden", children: /* @__PURE__ */ jsxs(CardContent, { className: "cteditor-p-4 sm:cteditor-p-5 cteditor-space-y-3 cteditor-max-h-[70vh] cteditor-overflow-y-auto", children: [
27894
+ /* @__PURE__ */ jsxs("div", { className: "cteditor-flex cteditor-items-start cteditor-justify-between cteditor-gap-2", children: [
27895
+ /* @__PURE__ */ jsxs("div", { className: "cteditor-flex cteditor-items-center cteditor-gap-2 cteditor-min-w-0 cteditor-flex-1", children: [
27823
27896
  /* @__PURE__ */ jsx(
27824
27897
  "div",
27825
27898
  {
27826
- className: `cteditor-w-6 cteditor-h-6 cteditor-rounded-full cteditor-flex cteditor-items-center cteditor-justify-center ${error.type === "spelling" ? "cteditor-bg-red-100 dark:cteditor-bg-red-900/30" : "cteditor-bg-blue-100 dark:cteditor-bg-blue-900/30"}`,
27899
+ className: `cteditor-w-6 cteditor-h-6 cteditor-rounded-full cteditor-flex cteditor-items-center cteditor-justify-center cteditor-flex-shrink-0 ${error.type === "spelling" ? "cteditor-bg-red-100 dark:cteditor-bg-red-900/30" : "cteditor-bg-blue-100 dark:cteditor-bg-blue-900/30"}`,
27827
27900
  children: /* @__PURE__ */ jsx(
27828
27901
  AlertCircle,
27829
27902
  {
@@ -27832,7 +27905,7 @@ function CombinedAutocompleteGrammarPlugin({
27832
27905
  )
27833
27906
  }
27834
27907
  ),
27835
- /* @__PURE__ */ jsxs("div", { children: [
27908
+ /* @__PURE__ */ jsxs("div", { className: "cteditor-min-w-0 cteditor-flex-1", children: [
27836
27909
  /* @__PURE__ */ jsx(
27837
27910
  Badge,
27838
27911
  {
@@ -27841,50 +27914,37 @@ function CombinedAutocompleteGrammarPlugin({
27841
27914
  children: error.type === "spelling" ? "Spelling" : "Grammar"
27842
27915
  }
27843
27916
  ),
27844
- error.issue && /* @__PURE__ */ jsx("p", { className: "cteditor-text-xs cteditor-text-gray-600 dark:cteditor-text-gray-400 cteditor-mt-1", children: error.issue })
27917
+ error.issue && /* @__PURE__ */ jsx("p", { className: "cteditor-text-xs cteditor-text-gray-600 dark:cteditor-text-gray-400 cteditor-mt-1 cteditor-break-words", children: error.issue })
27845
27918
  ] })
27846
27919
  ] }),
27847
27920
  /* @__PURE__ */ jsx(
27848
27921
  "button",
27849
27922
  {
27850
27923
  onClick: () => setTooltipState(null),
27851
- className: "cteditor-text-gray-400 hover:cteditor-text-gray-600",
27924
+ className: "cteditor-text-gray-400 hover:cteditor-text-gray-600 cteditor-flex-shrink-0 cteditor-p-1",
27852
27925
  children: /* @__PURE__ */ jsx(X$1, { className: "cteditor-w-4 cteditor-h-4" })
27853
27926
  }
27854
27927
  )
27855
27928
  ] }),
27856
- /* @__PURE__ */ jsx("div", { className: "cteditor-p-3 cteditor-bg-red-50 dark:cteditor-bg-red-900/10 cteditor-rounded-lg cteditor-border-2 cteditor-border-red-200 dark:cteditor-border-red-800", children: /* @__PURE__ */ jsx("p", { className: "cteditor-text-sm cteditor-line-through cteditor-text-red-700 dark:cteditor-text-red-400 cteditor-font-semibold", children: error.original }) }),
27857
- error.suggestions.length > 0 ? /* @__PURE__ */ jsxs("div", { className: "cteditor-space-y-2 overflow-y-auto cteditor-max-h-48", children: [
27929
+ /* @__PURE__ */ jsx("div", { className: "cteditor-p-3 cteditor-bg-red-50 dark:cteditor-bg-red-900/10 cteditor-rounded-lg cteditor-border-2 cteditor-border-red-200 dark:cteditor-border-red-800 cteditor-overflow-hidden", children: /* @__PURE__ */ jsx("p", { className: "cteditor-text-sm cteditor-line-through cteditor-text-red-700 dark:cteditor-text-red-400 cteditor-font-semibold cteditor-break-all", children: error.original }) }),
27930
+ error.suggestions.length > 0 ? /* @__PURE__ */ jsxs("div", { className: "cteditor-space-y-2", children: [
27858
27931
  /* @__PURE__ */ jsx("p", { className: "cteditor-text-xs cteditor-font-bold cteditor-text-gray-700 dark:cteditor-text-gray-300 cteditor-uppercase cteditor-tracking-wider", children: "Suggestions:" }),
27859
- /* @__PURE__ */ jsx(
27860
- "div",
27932
+ /* @__PURE__ */ jsx("div", { className: "cteditor-space-y-2 cteditor-max-h-[120px] cteditor-overflow-y-auto cteditor-pr-1", children: error.suggestions.map((suggestion, idx) => /* @__PURE__ */ jsxs(
27933
+ "button",
27861
27934
  {
27862
- style: {
27863
- //add overflow y logic
27864
- overflowY: "auto",
27865
- maxHeight: "130px",
27866
- display: "grid",
27867
- gridTemplateColumns: "1fr",
27868
- gap: "8px"
27935
+ onClick: (e) => {
27936
+ e.preventDefault();
27937
+ e.stopPropagation();
27938
+ applyCorrection(suggestion, error);
27869
27939
  },
27870
- children: error.suggestions.map((suggestion, idx) => /* @__PURE__ */ jsxs(
27871
- "button",
27872
- {
27873
- onClick: (e) => {
27874
- e.preventDefault();
27875
- e.stopPropagation();
27876
- applyCorrection(suggestion, error);
27877
- },
27878
- className: "cteditor-w-full cteditor-flex cteditor-items-center cteditor-gap-3 cteditor-px-4 cteditor-py-3 cteditor-bg-green-50 dark:cteditor-bg-green-900/10 hover:cteditor-bg-green-100 cteditor-border-2 cteditor-border-green-200 cteditor-rounded-lg cteditor-transition-all",
27879
- children: [
27880
- /* @__PURE__ */ jsx(CheckCircle, { className: "cteditor-w-5 cteditor-h-5 cteditor-text-green-600" }),
27881
- /* @__PURE__ */ jsx("span", { className: "cteditor-text-sm cteditor-font-semibold cteditor-text-green-700", children: suggestion })
27882
- ]
27883
- },
27884
- idx
27885
- ))
27886
- }
27887
- ),
27940
+ className: "cteditor-w-full cteditor-flex cteditor-items-center cteditor-gap-2 cteditor-px-3 cteditor-py-2 cteditor-bg-green-50 dark:cteditor-bg-green-900/10 hover:cteditor-bg-green-100 cteditor-border-2 cteditor-border-green-200 cteditor-rounded-lg cteditor-transition-all",
27941
+ children: [
27942
+ /* @__PURE__ */ jsx(CheckCircle, { className: "cteditor-w-4 cteditor-h-4 cteditor-text-green-600 cteditor-flex-shrink-0" }),
27943
+ /* @__PURE__ */ jsx("span", { className: "cteditor-text-sm cteditor-font-semibold cteditor-text-green-700 cteditor-break-all cteditor-text-left", children: suggestion })
27944
+ ]
27945
+ },
27946
+ idx
27947
+ )) }),
27888
27948
  error.type === "grammar" && error.correctedSentence && /* @__PURE__ */ jsx(
27889
27949
  "button",
27890
27950
  {
@@ -27896,60 +27956,93 @@ function CombinedAutocompleteGrammarPlugin({
27896
27956
  error.sentenceId
27897
27957
  );
27898
27958
  },
27899
- className: "cteditor-w-full cteditor-px-4 cteditor-py-3 cteditor-bg-blue-50 cteditor-border-2 cteditor-border-blue-300 cteditor-rounded-lg",
27900
- children: /* @__PURE__ */ jsxs("div", { className: "cteditor-flex cteditor-items-start cteditor-gap-2 cteditor-text-left", children: [
27901
- /* @__PURE__ */ jsx(CheckCircle, { className: "cteditor-w-5 cteditor-h-5 cteditor-text-blue-600 cteditor-mt-0.5" }),
27902
- /* @__PURE__ */ jsxs("div", { children: [
27959
+ className: "cteditor-w-full cteditor-px-3 cteditor-py-2 cteditor-bg-blue-50 cteditor-border-2 cteditor-border-blue-300 cteditor-rounded-lg cteditor-text-left",
27960
+ children: /* @__PURE__ */ jsxs("div", { className: "cteditor-flex cteditor-items-start cteditor-gap-2", children: [
27961
+ /* @__PURE__ */ jsx(CheckCircle, { className: "cteditor-w-4 cteditor-h-4 cteditor-text-blue-600 cteditor-mt-0.5 cteditor-flex-shrink-0" }),
27962
+ /* @__PURE__ */ jsxs("div", { className: "cteditor-min-w-0 cteditor-flex-1", children: [
27903
27963
  /* @__PURE__ */ jsx("p", { className: "cteditor-text-xs cteditor-font-semibold cteditor-text-blue-700", children: "Fix entire sentence" }),
27904
- /* @__PURE__ */ jsx("p", { className: "cteditor-text-xs cteditor-text-blue-600 cteditor-line-clamp-2", children: error.correctedSentence })
27964
+ /* @__PURE__ */ jsx("p", { className: "cteditor-text-xs cteditor-text-blue-600 cteditor-break-words cteditor-line-clamp-2", children: error.correctedSentence })
27905
27965
  ] })
27906
27966
  ] })
27907
27967
  }
27908
27968
  ),
27909
- /* @__PURE__ */ jsxs("div", { className: "cteditor-flex cteditor-gap-2", children: [
27969
+ /* @__PURE__ */ jsxs("div", { className: "cteditor-flex cteditor-flex-col cteditor-gap-2 cteditor-mt-3 cteditor-pt-3 cteditor-border-t cteditor-border-gray-100", children: [
27910
27970
  /* @__PURE__ */ jsx(
27911
27971
  "button",
27912
27972
  {
27913
27973
  onClick: () => dismissError(error),
27914
- className: "cteditor-flex-1 cteditor-px-4 cteditor-py-2 cteditor-text-sm cteditor-text-gray-600 hover:cteditor-bg-gray-100 cteditor-rounded-lg cteditor-border cteditor-border-gray-300",
27974
+ className: "cteditor-w-full cteditor-px-4 cteditor-py-2.5 cteditor-text-sm cteditor-font-medium cteditor-text-gray-700 hover:cteditor-bg-gray-100 cteditor-rounded-lg cteditor-border cteditor-border-gray-300 cteditor-transition-colors",
27975
+ title: "Ignore this suggestion",
27915
27976
  children: "Dismiss"
27916
27977
  }
27917
27978
  ),
27979
+ /* @__PURE__ */ jsxs("div", { className: "cteditor-flex cteditor-gap-2", children: [
27980
+ /* @__PURE__ */ jsxs(
27981
+ "button",
27982
+ {
27983
+ onClick: () => handleAddToDictionary(error),
27984
+ className: "cteditor-flex-1 cteditor-px-3 cteditor-py-2 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-gap-1.5 cteditor-text-xs cteditor-text-gray-500 hover:cteditor-text-gray-700 hover:cteditor-bg-gray-50 cteditor-rounded-md cteditor-border cteditor-border-gray-200 cteditor-transition-colors",
27985
+ title: "Add word to your personal dictionary",
27986
+ children: [
27987
+ /* @__PURE__ */ jsx(BookOpen, { className: "cteditor-w-3.5 cteditor-h-3.5" }),
27988
+ "Add to Dictionary"
27989
+ ]
27990
+ }
27991
+ ),
27992
+ /* @__PURE__ */ jsx(
27993
+ "button",
27994
+ {
27995
+ onClick: () => {
27996
+ updateToolbarState("isAutocompleteEnabled", false);
27997
+ setTooltipState(null);
27998
+ },
27999
+ className: "cteditor-px-3 cteditor-py-2 cteditor-text-xs cteditor-text-gray-400 hover:cteditor-text-gray-600 hover:cteditor-bg-gray-50 cteditor-rounded-md cteditor-transition-colors",
28000
+ title: "Turn off grammar checking",
28001
+ children: "Disable"
28002
+ }
28003
+ )
28004
+ ] })
28005
+ ] })
28006
+ ] }) : (
28007
+ /* No suggestions - action buttons only */
28008
+ /* @__PURE__ */ jsxs("div", { className: "cteditor-flex cteditor-flex-col cteditor-gap-2 cteditor-mt-3 cteditor-pt-3 cteditor-border-t cteditor-border-gray-100", children: [
27918
28009
  /* @__PURE__ */ jsx(
27919
28010
  "button",
27920
28011
  {
27921
- onClick: () => {
27922
- updateToolbarState("isAutocompleteEnabled", false);
27923
- setTooltipState(null);
27924
- },
27925
- className: "cteditor-px-3 cteditor-py-2 cteditor-text-xs cteditor-text-gray-500 hover:cteditor-text-gray-700 hover:cteditor-bg-gray-50 cteditor-rounded-lg cteditor-border cteditor-border-gray-200",
27926
- title: "Turn off grammar checking",
27927
- children: "Disable"
28012
+ onClick: () => dismissError(error),
28013
+ className: "cteditor-w-full cteditor-px-4 cteditor-py-2.5 cteditor-text-sm cteditor-font-medium cteditor-text-gray-700 hover:cteditor-bg-gray-100 cteditor-rounded-lg cteditor-border cteditor-border-gray-300 cteditor-transition-colors",
28014
+ title: "Ignore this suggestion",
28015
+ children: "Dismiss"
27928
28016
  }
27929
- )
28017
+ ),
28018
+ /* @__PURE__ */ jsxs("div", { className: "cteditor-flex cteditor-gap-2", children: [
28019
+ /* @__PURE__ */ jsxs(
28020
+ "button",
28021
+ {
28022
+ onClick: () => handleAddToDictionary(error),
28023
+ className: "cteditor-flex-1 cteditor-px-3 cteditor-py-2 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-gap-1.5 cteditor-text-xs cteditor-text-gray-500 hover:cteditor-text-gray-700 hover:cteditor-bg-gray-50 cteditor-rounded-md cteditor-border cteditor-border-gray-200 cteditor-transition-colors",
28024
+ title: "Add word to your personal dictionary",
28025
+ children: [
28026
+ /* @__PURE__ */ jsx(BookOpen, { className: "cteditor-w-3.5 cteditor-h-3.5" }),
28027
+ "Add to Dictionary"
28028
+ ]
28029
+ }
28030
+ ),
28031
+ /* @__PURE__ */ jsx(
28032
+ "button",
28033
+ {
28034
+ onClick: () => {
28035
+ updateToolbarState("isAutocompleteEnabled", false);
28036
+ setTooltipState(null);
28037
+ },
28038
+ className: "cteditor-px-3 cteditor-py-2 cteditor-text-xs cteditor-text-gray-400 hover:cteditor-text-gray-600 hover:cteditor-bg-gray-50 cteditor-rounded-md cteditor-transition-colors",
28039
+ title: "Turn off grammar checking",
28040
+ children: "Disable"
28041
+ }
28042
+ )
28043
+ ] })
27930
28044
  ] })
27931
- ] }) : /* @__PURE__ */ jsxs("div", { className: "cteditor-flex cteditor-gap-2", children: [
27932
- /* @__PURE__ */ jsx(
27933
- "button",
27934
- {
27935
- onClick: () => dismissError(error),
27936
- className: "cteditor-flex-1 cteditor-px-4 cteditor-py-2 cteditor-text-sm cteditor-text-gray-600 hover:cteditor-bg-gray-100 cteditor-rounded-lg cteditor-border cteditor-border-gray-300",
27937
- children: "Dismiss"
27938
- }
27939
- ),
27940
- /* @__PURE__ */ jsx(
27941
- "button",
27942
- {
27943
- onClick: () => {
27944
- updateToolbarState("isAutocompleteEnabled", false);
27945
- setTooltipState(null);
27946
- },
27947
- className: "cteditor-px-3 cteditor-py-2 cteditor-text-xs cteditor-text-gray-500 hover:cteditor-text-gray-700 hover:cteditor-bg-gray-50 cteditor-rounded-lg cteditor-border cteditor-border-gray-200",
27948
- title: "Turn off grammar checking",
27949
- children: "Disable"
27950
- }
27951
- )
27952
- ] })
28045
+ )
27953
28046
  ] }) })
27954
28047
  }
27955
28048
  ),
@@ -35861,4 +35954,4 @@ export {
35861
35954
  useHtmlView as u,
35862
35955
  verifyApiKey as v
35863
35956
  };
35864
- //# sourceMappingURL=index-38cb7602.js.map
35957
+ //# sourceMappingURL=index-4eb6f1f6.js.map