@cyberyozh/text-editor 0.3.1 → 0.4.0

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.
package/dist/editor.js CHANGED
@@ -36,10 +36,10 @@ __export(editor_exports, {
36
36
  module.exports = __toCommonJS(editor_exports);
37
37
 
38
38
  // src/editor/editor.tsx
39
- var import_react37 = require("react");
39
+ var import_react38 = require("react");
40
40
  var import_state7 = require("@tiptap/pm/state");
41
41
  var import_model3 = require("@tiptap/pm/model");
42
- var import_react38 = require("@tiptap/react");
42
+ var import_react39 = require("@tiptap/react");
43
43
  var import_menus = require("@tiptap/react/menus");
44
44
  var import_github_dark = require("highlight.js/styles/github-dark.css");
45
45
  var import_katex_min = require("katex/dist/katex.min.css");
@@ -1483,6 +1483,11 @@ function pluralize(count, forms) {
1483
1483
  return forms[2];
1484
1484
  }
1485
1485
 
1486
+ // src/utils/is-combined-error.ts
1487
+ function isCombinedError(error) {
1488
+ return error instanceof Error && Array.isArray(error?.cause) && error.cause.length > 0 && error.cause.every((e) => e instanceof Error);
1489
+ }
1490
+
1486
1491
  // src/editor/controls/character-count.tsx
1487
1492
  var import_jsx_runtime62 = require("react/jsx-runtime");
1488
1493
  var CharacterCount = ({ editor }) => {
@@ -1809,7 +1814,7 @@ var TableMenu = ({ editor }) => {
1809
1814
  };
1810
1815
 
1811
1816
  // src/editor/dialogs/image-dialog/image-dialog.tsx
1812
- var import_react13 = require("react");
1817
+ var import_react14 = require("react");
1813
1818
 
1814
1819
  // src/editor/components/button/button.tsx
1815
1820
  var import_jsx_runtime64 = require("react/jsx-runtime");
@@ -1898,6 +1903,43 @@ var CommonModal = ({ open, handleClose, children }) => {
1898
1903
  );
1899
1904
  };
1900
1905
 
1906
+ // src/editor/components/dialog-error/dialog-error.tsx
1907
+ var import_react13 = require("react");
1908
+ var import_jsx_runtime67 = require("react/jsx-runtime");
1909
+ var DialogError = ({ error, onClose, className }) => {
1910
+ const translations2 = useTiptapTranslations();
1911
+ const renderedMessage = (0, import_react13.useMemo)(() => {
1912
+ if (typeof error === "string") {
1913
+ return error || translations2.common.unknownError;
1914
+ }
1915
+ if (isCombinedError(error)) {
1916
+ const safeErrors = error.cause.filter((e) => Boolean(e.message));
1917
+ const errorsToDisplay = safeErrors.length === error.cause.length ? safeErrors : [new Error(translations2.common.unknownError), ...safeErrors];
1918
+ if (errorsToDisplay.length === 1) {
1919
+ return errorsToDisplay[0].message;
1920
+ }
1921
+ return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("ul", { className: "dialog-error-list", children: errorsToDisplay.map((cause, index) => /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("li", { children: cause.message }, `${index}_${cause.message}`)) });
1922
+ }
1923
+ if (error instanceof Error) {
1924
+ return error.message || translations2.common.unknownError;
1925
+ }
1926
+ return translations2.common.unknownError;
1927
+ }, [error, translations2]);
1928
+ return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: `dialog-error ${className || ""}`, children: [
1929
+ renderedMessage,
1930
+ onClose && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
1931
+ "button",
1932
+ {
1933
+ type: "button",
1934
+ className: "dialog-error-clear-button",
1935
+ onClick: onClose,
1936
+ "aria-label": translations2.common.clearError,
1937
+ children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(X_default, {})
1938
+ }
1939
+ )
1940
+ ] });
1941
+ };
1942
+
1901
1943
  // src/utils/image-src-resolver.ts
1902
1944
  function resolveImageSrc(attrs, options) {
1903
1945
  const { fileId, src } = attrs;
@@ -1921,7 +1963,7 @@ function resolveImageSrc(attrs, options) {
1921
1963
  }
1922
1964
 
1923
1965
  // src/editor/dialogs/image-dialog/image-dialog.tsx
1924
- var import_jsx_runtime67 = require("react/jsx-runtime");
1966
+ var import_jsx_runtime68 = require("react/jsx-runtime");
1925
1967
  var ImageDialog = ({
1926
1968
  open,
1927
1969
  onClose,
@@ -1934,9 +1976,9 @@ var ImageDialog = ({
1934
1976
  mode = "add"
1935
1977
  }) => {
1936
1978
  const translations2 = useTiptapTranslations();
1937
- const [isUploading, setIsUploading] = (0, import_react13.useState)(false);
1938
- const [dragActive, setDragActive] = (0, import_react13.useState)(false);
1939
- const inputRef = (0, import_react13.useRef)(null);
1979
+ const [isUploading, setIsUploading] = (0, import_react14.useState)(false);
1980
+ const [dragActive, setDragActive] = (0, import_react14.useState)(false);
1981
+ const inputRef = (0, import_react14.useRef)(null);
1940
1982
  const resolvedInitialUrl = initialAttrs ? resolveImageSrc({ fileId: initialAttrs.fileId, src: initialAttrs.src }, { getImageById }) : "";
1941
1983
  const getConstrainedDimensions = () => {
1942
1984
  if (!initialAttrs?.width || !initialAttrs?.height) {
@@ -1963,7 +2005,7 @@ var ImageDialog = ({
1963
2005
  };
1964
2006
  };
1965
2007
  const constrainedDimensions = getConstrainedDimensions();
1966
- const [formState, setFormState] = (0, import_react13.useState)({
2008
+ const [formState, setFormState] = (0, import_react14.useState)({
1967
2009
  file: null,
1968
2010
  title: initialAttrs?.title || "",
1969
2011
  alt: initialAttrs?.alt || "",
@@ -1972,11 +2014,20 @@ var ImageDialog = ({
1972
2014
  width: constrainedDimensions.width,
1973
2015
  height: constrainedDimensions.height
1974
2016
  });
2017
+ const [fileUploadError, setFileUploadError] = (0, import_react14.useState)(null);
1975
2018
  const handleSelectFile = (file) => {
2019
+ setFileUploadError(null);
1976
2020
  if (!file) return;
2021
+ if (!file.type.startsWith("image/")) {
2022
+ setFileUploadError(new Error(translations2.imageDialog.invalidFileType));
2023
+ return;
2024
+ }
1977
2025
  const imageUrl = URL.createObjectURL(file);
1978
2026
  const img = new Image();
1979
2027
  img.src = imageUrl;
2028
+ img.onerror = () => {
2029
+ setFileUploadError(new Error(translations2.imageDialog.invalidFileType));
2030
+ };
1980
2031
  img.onload = () => {
1981
2032
  const naturalWidth = img.width;
1982
2033
  const naturalHeight = img.height;
@@ -2009,7 +2060,7 @@ var ImageDialog = ({
2009
2060
  }));
2010
2061
  };
2011
2062
  };
2012
- (0, import_react13.useEffect)(() => {
2063
+ (0, import_react14.useEffect)(() => {
2013
2064
  if (defaultFile) {
2014
2065
  handleSelectFile(defaultFile);
2015
2066
  }
@@ -2069,6 +2120,8 @@ var ImageDialog = ({
2069
2120
  storageKey: result.storageKey
2070
2121
  });
2071
2122
  handleClose();
2123
+ } catch (error) {
2124
+ setFileUploadError(error instanceof Error ? error : new Error(translations2.common.unknownError));
2072
2125
  } finally {
2073
2126
  setIsUploading(false);
2074
2127
  }
@@ -2084,7 +2137,9 @@ var ImageDialog = ({
2084
2137
  });
2085
2138
  handleClose();
2086
2139
  };
2087
- const handleSave = mode === "edit" ? handleEditImage : handleAddImage;
2140
+ const isEditMode = mode === "edit";
2141
+ const canSave = isEditMode || Boolean(formState.file);
2142
+ const handleSave = isEditMode ? handleEditImage : handleAddImage;
2088
2143
  const handleClose = () => {
2089
2144
  clearImageFormFields();
2090
2145
  onClose();
@@ -2094,27 +2149,27 @@ var ImageDialog = ({
2094
2149
  const dialogTitle = isAddMode ? translations2.imageDialog.addTitle : translations2.imageDialog.editTitle;
2095
2150
  const saveButtonText = isAddMode ? translations2.imageDialog.add : translations2.imageDialog.save;
2096
2151
  const dragPlaceholder = dragActive ? translations2.imageUpload.dragActive : translations2.imageUpload.dragInactive;
2097
- return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
2152
+ return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(
2098
2153
  CommonModal,
2099
2154
  {
2100
2155
  open,
2101
2156
  handleClose,
2102
2157
  children: [
2103
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("p", { className: "image-dialog-title", children: dialogTitle }),
2104
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("hr", { className: "image-dialog-divider" }),
2105
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "image-dialog-form-container", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "image-dialog-form", children: [
2106
- hasImage ? /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "image-dialog-preview-wrapper", children: [
2107
- isAddMode && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
2158
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("p", { className: "image-dialog-title", children: dialogTitle }),
2159
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("hr", { className: "image-dialog-divider" }),
2160
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "image-dialog-form-container", children: /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "image-dialog-form", children: [
2161
+ hasImage ? /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "image-dialog-preview-wrapper", children: [
2162
+ isAddMode && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
2108
2163
  "button",
2109
2164
  {
2110
2165
  type: "button",
2111
2166
  className: "image-dialog-delete-button",
2112
2167
  onClick: clearImageFormFields,
2113
2168
  "aria-label": translations2.media.deleteImage,
2114
- children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(X_default, {})
2169
+ children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(X_default, {})
2115
2170
  }
2116
2171
  ),
2117
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
2172
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
2118
2173
  "img",
2119
2174
  {
2120
2175
  src: formState.fileUrl,
@@ -2124,7 +2179,7 @@ var ImageDialog = ({
2124
2179
  className: "image-dialog-preview"
2125
2180
  }
2126
2181
  )
2127
- ] }) : isAddMode && /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
2182
+ ] }) : isAddMode && /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(
2128
2183
  "div",
2129
2184
  {
2130
2185
  className: `image-dialog-drag-area ${dragActive ? "image-dialog-drag-area-active" : ""}`,
@@ -2134,7 +2189,7 @@ var ImageDialog = ({
2134
2189
  onDragLeave: handleDragLeave,
2135
2190
  onDrop: handleDrop,
2136
2191
  children: [
2137
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
2192
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
2138
2193
  "input",
2139
2194
  {
2140
2195
  type: "file",
@@ -2145,12 +2200,12 @@ var ImageDialog = ({
2145
2200
  accept: "image/*"
2146
2201
  }
2147
2202
  ),
2148
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("p", { style: { textAlign: "center" }, children: dragPlaceholder })
2203
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("p", { style: { textAlign: "center" }, children: dragPlaceholder })
2149
2204
  ]
2150
2205
  }
2151
2206
  ),
2152
- hasImage && /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(import_jsx_runtime67.Fragment, { children: [
2153
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
2207
+ hasImage && /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(import_jsx_runtime68.Fragment, { children: [
2208
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
2154
2209
  Input,
2155
2210
  {
2156
2211
  label: translations2.media.imageTitle,
@@ -2158,7 +2213,7 @@ var ImageDialog = ({
2158
2213
  onChange: (e) => setFormState((prev) => ({ ...prev, title: e.target.value }))
2159
2214
  }
2160
2215
  ),
2161
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
2216
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
2162
2217
  Input,
2163
2218
  {
2164
2219
  label: translations2.media.imageAlt,
@@ -2166,7 +2221,7 @@ var ImageDialog = ({
2166
2221
  onChange: (e) => setFormState((prev) => ({ ...prev, alt: e.target.value }))
2167
2222
  }
2168
2223
  ),
2169
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
2224
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
2170
2225
  Input,
2171
2226
  {
2172
2227
  label: translations2.imageDialog.captionLabel,
@@ -2177,8 +2232,16 @@ var ImageDialog = ({
2177
2232
  )
2178
2233
  ] })
2179
2234
  ] }) }),
2180
- /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "image-dialog-actions", children: [
2181
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
2235
+ fileUploadError && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
2236
+ DialogError,
2237
+ {
2238
+ error: fileUploadError,
2239
+ onClose: () => setFileUploadError(null),
2240
+ className: "image-dialog-error-spacing"
2241
+ }
2242
+ ),
2243
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "image-dialog-actions", children: [
2244
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
2182
2245
  Button,
2183
2246
  {
2184
2247
  type: "button",
@@ -2188,12 +2251,13 @@ var ImageDialog = ({
2188
2251
  children: translations2.common.cancel
2189
2252
  }
2190
2253
  ),
2191
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
2254
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
2192
2255
  Button,
2193
2256
  {
2194
2257
  isLoading: isUploading,
2195
2258
  type: "button",
2196
2259
  onClick: handleSave,
2260
+ disabled: !canSave,
2197
2261
  children: saveButtonText
2198
2262
  }
2199
2263
  )
@@ -2204,8 +2268,8 @@ var ImageDialog = ({
2204
2268
  };
2205
2269
 
2206
2270
  // src/editor/dialogs/add-katex-dialog/add-katex-dialog.tsx
2207
- var import_react14 = require("react");
2208
- var import_jsx_runtime68 = require("react/jsx-runtime");
2271
+ var import_react15 = require("react");
2272
+ var import_jsx_runtime69 = require("react/jsx-runtime");
2209
2273
  var AddKatexDialog = ({
2210
2274
  open,
2211
2275
  onClose,
@@ -2213,9 +2277,9 @@ var AddKatexDialog = ({
2213
2277
  initialContent = ""
2214
2278
  }) => {
2215
2279
  const translations2 = useTiptapTranslations();
2216
- const [content, setContent] = (0, import_react14.useState)(initialContent);
2217
- const contentInputRef = (0, import_react14.useRef)(null);
2218
- (0, import_react14.useEffect)(() => {
2280
+ const [content, setContent] = (0, import_react15.useState)(initialContent);
2281
+ const contentInputRef = (0, import_react15.useRef)(null);
2282
+ (0, import_react15.useEffect)(() => {
2219
2283
  if (open) {
2220
2284
  setContent(initialContent);
2221
2285
  setTimeout(() => {
@@ -2240,19 +2304,19 @@ var AddKatexDialog = ({
2240
2304
  handleSubmit();
2241
2305
  }
2242
2306
  };
2243
- return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(
2307
+ return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
2244
2308
  CommonModal,
2245
2309
  {
2246
2310
  open,
2247
2311
  handleClose,
2248
2312
  children: [
2249
- /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("p", { className: "katex-dialog-title", children: initialContent ? translations2.katex.editTitle : translations2.katex.addTitle }),
2250
- /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("hr", { className: "katex-dialog-divider" }),
2251
- /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "katex-dialog-content", children: [
2252
- /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("p", { className: "katex-dialog-description", children: [
2313
+ /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("p", { className: "katex-dialog-title", children: initialContent ? translations2.katex.editTitle : translations2.katex.addTitle }),
2314
+ /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("hr", { className: "katex-dialog-divider" }),
2315
+ /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "katex-dialog-content", children: [
2316
+ /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("p", { className: "katex-dialog-description", children: [
2253
2317
  translations2.katex.description,
2254
2318
  " ",
2255
- /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
2319
+ /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
2256
2320
  "a",
2257
2321
  {
2258
2322
  href: "https://katex.org/docs/supported.html",
@@ -2264,8 +2328,8 @@ var AddKatexDialog = ({
2264
2328
  " ",
2265
2329
  translations2.katex.documentationLinkSuffix
2266
2330
  ] }),
2267
- /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "katex-dialog-form-group", children: [
2268
- /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
2331
+ /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "katex-dialog-form-group", children: [
2332
+ /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
2269
2333
  "label",
2270
2334
  {
2271
2335
  htmlFor: "katex-content",
@@ -2273,7 +2337,7 @@ var AddKatexDialog = ({
2273
2337
  children: translations2.katex.label
2274
2338
  }
2275
2339
  ),
2276
- /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
2340
+ /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
2277
2341
  "textarea",
2278
2342
  {
2279
2343
  ref: contentInputRef,
@@ -2288,8 +2352,8 @@ var AddKatexDialog = ({
2288
2352
  )
2289
2353
  ] })
2290
2354
  ] }),
2291
- /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "katex-dialog-actions", children: [
2292
- /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
2355
+ /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "katex-dialog-actions", children: [
2356
+ /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
2293
2357
  "button",
2294
2358
  {
2295
2359
  className: "katex-dialog-button-cancel",
@@ -2298,7 +2362,7 @@ var AddKatexDialog = ({
2298
2362
  children: translations2.common.cancel
2299
2363
  }
2300
2364
  ),
2301
- /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
2365
+ /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
2302
2366
  "button",
2303
2367
  {
2304
2368
  className: "katex-dialog-button-submit",
@@ -2314,8 +2378,8 @@ var AddKatexDialog = ({
2314
2378
  };
2315
2379
 
2316
2380
  // src/editor/dialogs/add-link-dialog/add-link-dialog.tsx
2317
- var import_react15 = require("react");
2318
- var import_jsx_runtime69 = require("react/jsx-runtime");
2381
+ var import_react16 = require("react");
2382
+ var import_jsx_runtime70 = require("react/jsx-runtime");
2319
2383
  var AddLinkDialog = ({
2320
2384
  open,
2321
2385
  onClose,
@@ -2325,12 +2389,12 @@ var AddLinkDialog = ({
2325
2389
  const translations2 = useTiptapTranslations();
2326
2390
  const initialLinkTarget = linkDialogContext ? linkDialogContext.target === "_blank" : true;
2327
2391
  const initialLinkRel = linkDialogContext ? !!linkDialogContext.rel?.includes("noopener") : true;
2328
- const [title, setTitle] = (0, import_react15.useState)(linkDialogContext?.title);
2329
- const [url, setUrl] = (0, import_react15.useState)(linkDialogContext?.href);
2330
- const [openInNewTab, setOpenInNewTab] = (0, import_react15.useState)(initialLinkTarget);
2331
- const [addNoopener, setAddNoopener] = (0, import_react15.useState)(initialLinkRel);
2332
- const [error, setError] = (0, import_react15.useState)("");
2333
- const titleInputRef = (0, import_react15.useRef)(null);
2392
+ const [title, setTitle] = (0, import_react16.useState)(linkDialogContext?.title);
2393
+ const [url, setUrl] = (0, import_react16.useState)(linkDialogContext?.href);
2394
+ const [openInNewTab, setOpenInNewTab] = (0, import_react16.useState)(initialLinkTarget);
2395
+ const [addNoopener, setAddNoopener] = (0, import_react16.useState)(initialLinkRel);
2396
+ const [error, setError] = (0, import_react16.useState)("");
2397
+ const titleInputRef = (0, import_react16.useRef)(null);
2334
2398
  const clearDialogState = () => {
2335
2399
  setTitle(linkDialogContext?.title);
2336
2400
  setUrl(linkDialogContext?.href);
@@ -2338,7 +2402,7 @@ var AddLinkDialog = ({
2338
2402
  setAddNoopener(initialLinkRel);
2339
2403
  setError("");
2340
2404
  };
2341
- (0, import_react15.useEffect)(() => {
2405
+ (0, import_react16.useEffect)(() => {
2342
2406
  if (open) {
2343
2407
  clearDialogState();
2344
2408
  setTimeout(() => {
@@ -2395,17 +2459,17 @@ var AddLinkDialog = ({
2395
2459
  handleSubmit();
2396
2460
  }
2397
2461
  };
2398
- return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
2462
+ return /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(
2399
2463
  CommonModal,
2400
2464
  {
2401
2465
  open,
2402
2466
  handleClose,
2403
2467
  children: [
2404
- /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("p", { className: "link-dialog-title", children: linkDialogContext?.href ? translations2.link.editLink : translations2.link.addLink }),
2405
- /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("hr", { className: "link-dialog-divider" }),
2406
- /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "link-dialog-content", children: [
2407
- /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "link-dialog-form-group", children: [
2408
- /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
2468
+ /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("p", { className: "link-dialog-title", children: linkDialogContext?.href ? translations2.link.editLink : translations2.link.addLink }),
2469
+ /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("hr", { className: "link-dialog-divider" }),
2470
+ /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: "link-dialog-content", children: [
2471
+ /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: "link-dialog-form-group", children: [
2472
+ /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
2409
2473
  "label",
2410
2474
  {
2411
2475
  htmlFor: "link-title",
@@ -2413,7 +2477,7 @@ var AddLinkDialog = ({
2413
2477
  children: translations2.link.title
2414
2478
  }
2415
2479
  ),
2416
- /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
2480
+ /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
2417
2481
  "input",
2418
2482
  {
2419
2483
  ref: titleInputRef,
@@ -2427,8 +2491,8 @@ var AddLinkDialog = ({
2427
2491
  }
2428
2492
  )
2429
2493
  ] }),
2430
- /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "link-dialog-form-group", children: [
2431
- /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
2494
+ /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: "link-dialog-form-group", children: [
2495
+ /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
2432
2496
  "label",
2433
2497
  {
2434
2498
  htmlFor: "link-url",
@@ -2436,7 +2500,7 @@ var AddLinkDialog = ({
2436
2500
  children: translations2.link.url
2437
2501
  }
2438
2502
  ),
2439
- /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
2503
+ /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
2440
2504
  "input",
2441
2505
  {
2442
2506
  id: "link-url",
@@ -2449,9 +2513,9 @@ var AddLinkDialog = ({
2449
2513
  }
2450
2514
  )
2451
2515
  ] }),
2452
- /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "link-dialog-form-group", children: [
2453
- /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("label", { className: "link-dialog-checkbox-label", children: [
2454
- /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
2516
+ /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: "link-dialog-form-group", children: [
2517
+ /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("label", { className: "link-dialog-checkbox-label", children: [
2518
+ /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
2455
2519
  "input",
2456
2520
  {
2457
2521
  type: "checkbox",
@@ -2459,13 +2523,13 @@ var AddLinkDialog = ({
2459
2523
  onChange: (e) => setOpenInNewTab(e.target.checked)
2460
2524
  }
2461
2525
  ),
2462
- /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { children: translations2.link.openInNewTab })
2526
+ /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("span", { children: translations2.link.openInNewTab })
2463
2527
  ] }),
2464
- /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("p", { className: "link-dialog-help-text", children: translations2.link.openInNewTabHelp })
2528
+ /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("p", { className: "link-dialog-help-text", children: translations2.link.openInNewTabHelp })
2465
2529
  ] }),
2466
- /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "link-dialog-form-group", children: [
2467
- /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("label", { className: "link-dialog-checkbox-label", children: [
2468
- /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
2530
+ /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: "link-dialog-form-group", children: [
2531
+ /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("label", { className: "link-dialog-checkbox-label", children: [
2532
+ /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
2469
2533
  "input",
2470
2534
  {
2471
2535
  type: "checkbox",
@@ -2473,14 +2537,14 @@ var AddLinkDialog = ({
2473
2537
  onChange: (e) => setAddNoopener(e.target.checked)
2474
2538
  }
2475
2539
  ),
2476
- /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { children: translations2.link.addNofollow })
2540
+ /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("span", { children: translations2.link.addNofollow })
2477
2541
  ] }),
2478
- /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("p", { className: "link-dialog-help-text", children: translations2.link.addNofollowHelp })
2542
+ /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("p", { className: "link-dialog-help-text", children: translations2.link.addNofollowHelp })
2479
2543
  ] }),
2480
- error && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "link-dialog-error", children: error })
2544
+ error && /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(DialogError, { error })
2481
2545
  ] }),
2482
- /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "link-dialog-actions", children: [
2483
- /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
2546
+ /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: "link-dialog-actions", children: [
2547
+ /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
2484
2548
  "button",
2485
2549
  {
2486
2550
  className: "link-dialog-button-cancel",
@@ -2489,7 +2553,7 @@ var AddLinkDialog = ({
2489
2553
  children: translations2.common.cancel
2490
2554
  }
2491
2555
  ),
2492
- /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
2556
+ /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
2493
2557
  "button",
2494
2558
  {
2495
2559
  className: "link-dialog-button-submit",
@@ -2505,7 +2569,7 @@ var AddLinkDialog = ({
2505
2569
  };
2506
2570
 
2507
2571
  // src/editor/dialogs/add-video-dialog/add-video-dialog.tsx
2508
- var import_react16 = require("react");
2572
+ var import_react17 = require("react");
2509
2573
 
2510
2574
  // src/utils/detect-video-hosting.ts
2511
2575
  var VIDEO_PATTERNS = {
@@ -2579,7 +2643,7 @@ var detectVideoHosting = (src) => {
2579
2643
  };
2580
2644
 
2581
2645
  // src/editor/dialogs/add-video-dialog/add-video-dialog.tsx
2582
- var import_jsx_runtime70 = require("react/jsx-runtime");
2646
+ var import_jsx_runtime71 = require("react/jsx-runtime");
2583
2647
  var SUPPORTED_PLATFORMS = {
2584
2648
  ["youtube" /* Youtube */]: "YouTube",
2585
2649
  ["vimeo" /* Vimeo */]: "Vimeo",
@@ -2588,11 +2652,11 @@ var SUPPORTED_PLATFORMS = {
2588
2652
  };
2589
2653
  var AddVideoDialog = ({ open, onClose, onVideoAdd }) => {
2590
2654
  const translations2 = useTiptapTranslations();
2591
- const [url, setUrl] = (0, import_react16.useState)("");
2592
- const [error, setError] = (0, import_react16.useState)("");
2593
- const [isValidating, setIsValidating] = (0, import_react16.useState)(false);
2594
- const urlInputRef = (0, import_react16.useRef)(null);
2595
- (0, import_react16.useEffect)(() => {
2655
+ const [url, setUrl] = (0, import_react17.useState)("");
2656
+ const [error, setError] = (0, import_react17.useState)("");
2657
+ const [isValidating, setIsValidating] = (0, import_react17.useState)(false);
2658
+ const urlInputRef = (0, import_react17.useRef)(null);
2659
+ (0, import_react17.useEffect)(() => {
2596
2660
  if (open) {
2597
2661
  setUrl("");
2598
2662
  setError("");
@@ -2646,17 +2710,17 @@ var AddVideoDialog = ({ open, onClose, onVideoAdd }) => {
2646
2710
  handleSubmit();
2647
2711
  }
2648
2712
  };
2649
- return /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(
2713
+ return /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(
2650
2714
  CommonModal,
2651
2715
  {
2652
2716
  open,
2653
2717
  handleClose,
2654
2718
  children: [
2655
- /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("p", { className: "video-dialog-title", children: translations2.videoUpload.title }),
2656
- /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("hr", { className: "video-dialog-divider" }),
2657
- /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: "video-dialog-content", children: [
2658
- /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: "video-dialog-form-group", children: [
2659
- /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
2719
+ /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("p", { className: "video-dialog-title", children: translations2.videoUpload.title }),
2720
+ /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("hr", { className: "video-dialog-divider" }),
2721
+ /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)("div", { className: "video-dialog-content", children: [
2722
+ /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)("div", { className: "video-dialog-form-group", children: [
2723
+ /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
2660
2724
  "label",
2661
2725
  {
2662
2726
  htmlFor: "video-url",
@@ -2664,7 +2728,7 @@ var AddVideoDialog = ({ open, onClose, onVideoAdd }) => {
2664
2728
  children: translations2.videoUpload.urlLabel
2665
2729
  }
2666
2730
  ),
2667
- /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
2731
+ /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
2668
2732
  "input",
2669
2733
  {
2670
2734
  ref: urlInputRef,
@@ -2680,14 +2744,14 @@ var AddVideoDialog = ({ open, onClose, onVideoAdd }) => {
2680
2744
  }
2681
2745
  )
2682
2746
  ] }),
2683
- /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: "video-dialog-help-text", children: [
2684
- /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("p", { className: "video-dialog-help-title", children: translations2.videoUpload.supportedPlatforms }),
2685
- /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("ul", { className: "video-dialog-platform-list", children: Object.entries(SUPPORTED_PLATFORMS).map(([key, name]) => /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("li", { children: name }, key)) })
2747
+ /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)("div", { className: "video-dialog-help-text", children: [
2748
+ /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("p", { className: "video-dialog-help-title", children: translations2.videoUpload.supportedPlatforms }),
2749
+ /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("ul", { className: "video-dialog-platform-list", children: Object.entries(SUPPORTED_PLATFORMS).map(([key, name]) => /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("li", { children: name }, key)) })
2686
2750
  ] }),
2687
- error && /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { className: "video-dialog-error", children: error })
2751
+ error && /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(DialogError, { error })
2688
2752
  ] }),
2689
- /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: "video-dialog-actions", children: [
2690
- /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
2753
+ /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)("div", { className: "video-dialog-actions", children: [
2754
+ /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
2691
2755
  "button",
2692
2756
  {
2693
2757
  className: "video-dialog-button-cancel",
@@ -2697,7 +2761,7 @@ var AddVideoDialog = ({ open, onClose, onVideoAdd }) => {
2697
2761
  children: translations2.videoUpload.cancel
2698
2762
  }
2699
2763
  ),
2700
- /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
2764
+ /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
2701
2765
  "button",
2702
2766
  {
2703
2767
  className: "video-dialog-button-submit",
@@ -2718,7 +2782,7 @@ var import_extension_mathematics = require("@tiptap/extension-mathematics");
2718
2782
  var import_extension_table = require("@tiptap/extension-table");
2719
2783
 
2720
2784
  // src/extensions/editor/callout.ts
2721
- var import_react28 = require("@tiptap/react");
2785
+ var import_react29 = require("@tiptap/react");
2722
2786
 
2723
2787
  // src/utils/handle-exit-node.ts
2724
2788
  var import_state = require("@tiptap/pm/state");
@@ -5079,28 +5143,28 @@ var BaseLegacyFigure = import_extension_image2.default.extend({
5079
5143
  });
5080
5144
 
5081
5145
  // src/extensions/views/node-views/callout.tsx
5082
- var import_react19 = require("@tiptap/react");
5083
- var import_react20 = require("react");
5146
+ var import_react20 = require("@tiptap/react");
5147
+ var import_react21 = require("react");
5084
5148
 
5085
5149
  // src/icons/color/TiptapCalloutError.tsx
5086
- var import_jsx_runtime71 = require("react/jsx-runtime");
5087
- var SvgTiptapCalloutError = (props) => /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 20 20", ...props, children: [
5088
- /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)("g", { clipPath: "url(#tiptap-callout-error_svg__a)", children: [
5089
- /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
5150
+ var import_jsx_runtime72 = require("react/jsx-runtime");
5151
+ var SvgTiptapCalloutError = (props) => /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 20 20", ...props, children: [
5152
+ /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("g", { clipPath: "url(#tiptap-callout-error_svg__a)", children: [
5153
+ /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
5090
5154
  "path",
5091
5155
  {
5092
5156
  fill: "#E03757",
5093
5157
  d: "M10 0C4.477 0 0 4.477 0 10s4.477 10 10 10 10-4.477 10-10S15.523 0 10 0"
5094
5158
  }
5095
5159
  ),
5096
- /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
5160
+ /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
5097
5161
  "path",
5098
5162
  {
5099
5163
  fill: "#F04760",
5100
5164
  d: "M4.692 15.603c6.011 0 10.885-4.874 10.885-10.885a10.9 10.9 0 0 0-.525-3.35A9.95 9.95 0 0 0 10 0C4.477 0 0 4.477 0 10a9.95 9.95 0 0 0 1.394 5.094c1.066.338 2.179.51 3.298.509"
5101
5165
  }
5102
5166
  ),
5103
- /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
5167
+ /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
5104
5168
  "path",
5105
5169
  {
5106
5170
  fill: "#fff",
@@ -5108,28 +5172,28 @@ var SvgTiptapCalloutError = (props) => /* @__PURE__ */ (0, import_jsx_runtime71.
5108
5172
  }
5109
5173
  )
5110
5174
  ] }),
5111
- /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("clipPath", { id: "tiptap-callout-error_svg__a", children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("path", { fill: "#fff", d: "M0 0h20v20H0z" }) }) })
5175
+ /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("clipPath", { id: "tiptap-callout-error_svg__a", children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("path", { fill: "#fff", d: "M0 0h20v20H0z" }) }) })
5112
5176
  ] });
5113
5177
  var TiptapCalloutError_default = SvgTiptapCalloutError;
5114
5178
 
5115
5179
  // src/icons/color/TiptapCalloutInfo.tsx
5116
- var import_jsx_runtime72 = require("react/jsx-runtime");
5117
- var SvgTiptapCalloutInfo = (props) => /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 20 20", ...props, children: [
5118
- /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
5180
+ var import_jsx_runtime73 = require("react/jsx-runtime");
5181
+ var SvgTiptapCalloutInfo = (props) => /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 20 20", ...props, children: [
5182
+ /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
5119
5183
  "path",
5120
5184
  {
5121
5185
  fill: "#FE9738",
5122
5186
  d: "m11.654 11.196 3.51-2.75.549-4.789-4.06-2.234-1.647 2.264a2.79 2.79 0 0 1 1.531 2.28 2.8 2.8 0 0 1-1.85 2.84 3.96 3.96 0 0 0-2.624 3.728v.72c0 .937.76 1.697 1.696 1.697h2.482zm-4.895-3.32H4.277c-.937 0-1.697-.76-1.697-1.697q0-.432.06-.86C3.084 2.135 5.954-.196 9.172.015h2.482L9.888 1.797m1.353 14.796H8.759c-.937 0-1.696.76-1.696 1.696v.014c0 .938.76 1.697 1.696 1.697h2.18"
5123
5187
  }
5124
5188
  ),
5125
- /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
5189
+ /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
5126
5190
  "path",
5127
5191
  {
5128
5192
  fill: "#FFD15B",
5129
5193
  d: "M11.241 14.951c-.937 0-1.697-.76-1.697-1.697v-.72a3.955 3.955 0 0 1 2.625-3.727 2.8 2.8 0 0 0 1.85-2.84A2.79 2.79 0 0 0 11.432 3.4a2.8 2.8 0 0 0-2.976 2.78 1.697 1.697 0 0 1-3.394 0q0-.434.06-.86C5.566 2.133 8.435-.198 11.654.014c3.055.2 5.527 2.653 5.75 5.706a6.2 6.2 0 0 1-4.104 6.286.56.56 0 0 0-.362.529v.72c0 .936-.76 1.696-1.697 1.696m0 5.05c-.937 0-1.697-.76-1.697-1.698v-.014a1.697 1.697 0 0 1 3.394 0v.014c0 .937-.76 1.697-1.697 1.697"
5130
5194
  }
5131
5195
  ),
5132
- /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
5196
+ /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
5133
5197
  "path",
5134
5198
  {
5135
5199
  fill: "#FFC344",
@@ -5140,66 +5204,66 @@ var SvgTiptapCalloutInfo = (props) => /* @__PURE__ */ (0, import_jsx_runtime72.j
5140
5204
  var TiptapCalloutInfo_default = SvgTiptapCalloutInfo;
5141
5205
 
5142
5206
  // src/icons/color/TiptapCalloutSuccess.tsx
5143
- var import_jsx_runtime73 = require("react/jsx-runtime");
5144
- var SvgTiptapCalloutSuccess = (props) => /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 20 20", ...props, children: [
5145
- /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("g", { clipPath: "url(#tiptap-callout-success_svg__a)", children: [
5146
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
5207
+ var import_jsx_runtime74 = require("react/jsx-runtime");
5208
+ var SvgTiptapCalloutSuccess = (props) => /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 20 20", ...props, children: [
5209
+ /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("g", { clipPath: "url(#tiptap-callout-success_svg__a)", children: [
5210
+ /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
5147
5211
  "path",
5148
5212
  {
5149
5213
  fill: "#35495E",
5150
5214
  d: "M1.972 18.004.06 7.138a2.4 2.4 0 0 1-.035-.317 2.47 2.47 0 0 1 2.073-2.493l3.693-.652-.1 14.328z"
5151
5215
  }
5152
5216
  ),
5153
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
5217
+ /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
5154
5218
  "path",
5155
5219
  {
5156
5220
  fill: "#2C3E50",
5157
5221
  d: "M16.186 17.528a.69.69 0 0 1-.548.517l-10.87 1.917a2.42 2.42 0 0 1-2.83-2.276 2.46 2.46 0 0 1 1.934-2.462l3.045.855h-.003l-2.742.487a1.037 1.037 0 0 0-.786 1.396 1.066 1.066 0 0 0 1.186.635l8.307-1.466z"
5158
5222
  }
5159
5223
  ),
5160
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
5224
+ /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
5161
5225
  "path",
5162
5226
  {
5163
5227
  fill: "#F9EAB0",
5164
5228
  d: "m6.914 16.08-2.742.486a1.035 1.035 0 0 0-.786 1.396 1.066 1.066 0 0 0 1.186.635l8.307-1.466z"
5165
5229
  }
5166
5230
  ),
5167
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
5231
+ /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
5168
5232
  "path",
5169
5233
  {
5170
5234
  fill: "#E64C3C",
5171
5235
  d: "M4.423 11.438 6.339.571a.695.695 0 0 1 .799-.559l10.785 1.902a2.47 2.47 0 0 1 2.074 2.495 3 3 0 0 1-.034.316l-1.917 10.867z"
5172
5236
  }
5173
5237
  ),
5174
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
5238
+ /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
5175
5239
  "path",
5176
5240
  {
5177
5241
  fill: "#3F5C6C",
5178
5242
  d: "M15.668 3.612a.4.4 0 0 1-.06-.005l-7.81-1.378a.345.345 0 0 1 .12-.677l7.81 1.375a.345.345 0 0 1-.06.685M14.01 5.069a.3.3 0 0 1-.06-.005l-5.094-.897a.345.345 0 0 1 .12-.68l5.094.897a.345.345 0 0 1-.06.685"
5179
5243
  }
5180
5244
  ),
5181
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
5245
+ /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
5182
5246
  "path",
5183
5247
  {
5184
5248
  fill: "#ECF0F1",
5185
5249
  d: "m14.727 6.608-7.131-1.26a.345.345 0 0 0-.4.28l-.6 3.395a.345.345 0 0 0 .28.4l7.13 1.26a.345.345 0 0 0 .4-.28l.6-3.396a.345.345 0 0 0-.28-.4"
5186
5250
  }
5187
5251
  ),
5188
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
5252
+ /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
5189
5253
  "path",
5190
5254
  {
5191
5255
  fill: "#C03A2B",
5192
5256
  d: "M19.997 4.407a2 2 0 0 1-.035.317L18.045 15.59l-2.659-.81 1.542-8.738.365-2.063.373-2.11.258.045a2.47 2.47 0 0 1 2.073 2.493"
5193
5257
  }
5194
5258
  ),
5195
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
5259
+ /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
5196
5260
  "path",
5197
5261
  {
5198
5262
  fill: "#802F34",
5199
5263
  d: "M16.007 12.78 5.22 10.88a.69.69 0 0 0-.238 1.358l10.865 1.914a1.038 1.038 0 0 1 .783 1.4 1.06 1.06 0 0 1-1.183.63L4.624 14.277a.69.69 0 0 0-.241 1.359l10.869 1.913a2.416 2.416 0 0 0 2.83-2.272 2.474 2.474 0 0 0-2.075-2.496"
5200
5264
  }
5201
5265
  ),
5202
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
5266
+ /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
5203
5267
  "path",
5204
5268
  {
5205
5269
  fill: "#F9EAB0",
@@ -5207,14 +5271,14 @@ var SvgTiptapCalloutSuccess = (props) => /* @__PURE__ */ (0, import_jsx_runtime7
5207
5271
  }
5208
5272
  )
5209
5273
  ] }),
5210
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("clipPath", { id: "tiptap-callout-success_svg__a", children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("path", { fill: "#fff", d: "M0 0h20v20H0z" }) }) })
5274
+ /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("clipPath", { id: "tiptap-callout-success_svg__a", children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("path", { fill: "#fff", d: "M0 0h20v20H0z" }) }) })
5211
5275
  ] });
5212
5276
  var TiptapCalloutSuccess_default = SvgTiptapCalloutSuccess;
5213
5277
 
5214
5278
  // src/icons/color/TiptapCalloutWarning.tsx
5215
- var import_jsx_runtime74 = require("react/jsx-runtime");
5216
- var SvgTiptapCalloutWarning = (props) => /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 20 20", ...props, children: [
5217
- /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
5279
+ var import_jsx_runtime75 = require("react/jsx-runtime");
5280
+ var SvgTiptapCalloutWarning = (props) => /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 20 20", ...props, children: [
5281
+ /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
5218
5282
  "path",
5219
5283
  {
5220
5284
  fill: "#FFF59D",
@@ -5222,29 +5286,29 @@ var SvgTiptapCalloutWarning = (props) => /* @__PURE__ */ (0, import_jsx_runtime7
5222
5286
  d: "M1.667 9.167a8.333 8.333 0 1 0 16.666 0 8.333 8.333 0 0 0-16.666 0"
5223
5287
  }
5224
5288
  ),
5225
- /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
5289
+ /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
5226
5290
  "path",
5227
5291
  {
5228
5292
  fill: "#FBC02D",
5229
5293
  d: "M15.417 9.167c0-3.209-2.75-5.75-6.042-5.375-2.5.291-4.5 2.291-4.75 4.791a5.27 5.27 0 0 0 1.917 4.709c.583.5.958 1.208.958 2v.125h5v-.042c0-.75.333-1.5.917-2 1.208-1 2-2.5 2-4.208"
5230
5294
  }
5231
5295
  ),
5232
- /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
5296
+ /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
5233
5297
  "path",
5234
5298
  {
5235
5299
  fill: "#FFF59D",
5236
5300
  d: "m12.75 8.417-1.25-.834a.45.45 0 0 0-.458 0L10 8.25l-1-.667a.45.45 0 0 0-.458 0l-1.25.834c-.084.083-.167.166-.167.291s0 .25.083.334L8.792 11v4.417h.833v-4.584c0-.083-.042-.166-.083-.25L8.167 8.875l.625-.417 1 .667a.45.45 0 0 0 .458 0l1-.667.625.417-1.375 1.708a.6.6 0 0 0-.083.25v4.584h.833V11l1.583-1.958a.32.32 0 0 0 .084-.334c-.042-.125-.084-.25-.167-.291"
5237
5301
  }
5238
5302
  ),
5239
- /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("path", { fill: "#5C6BC0", d: "M8.75 18.334a1.25 1.25 0 1 0 2.5 0 1.25 1.25 0 0 0-2.5 0" }),
5240
- /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
5303
+ /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("path", { fill: "#5C6BC0", d: "M8.75 18.334a1.25 1.25 0 1 0 2.5 0 1.25 1.25 0 0 0-2.5 0" }),
5304
+ /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
5241
5305
  "path",
5242
5306
  {
5243
5307
  fill: "#9FA8DA",
5244
5308
  d: "M10.833 18.75H9.167C8.25 18.75 7.5 18 7.5 17.083V15h5v2.083c0 .917-.75 1.667-1.667 1.667"
5245
5309
  }
5246
5310
  ),
5247
- /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
5311
+ /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
5248
5312
  "path",
5249
5313
  {
5250
5314
  fill: "#5C6BC0",
@@ -5397,12 +5461,12 @@ var calloutCustomEmojis = [
5397
5461
  ];
5398
5462
 
5399
5463
  // src/extensions/views/components/callout.tsx
5400
- var import_jsx_runtime75 = require("react/jsx-runtime");
5464
+ var import_jsx_runtime76 = require("react/jsx-runtime");
5401
5465
  var calloutIcons = {
5402
- info: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(TiptapCalloutInfo_default, {}),
5403
- warning: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(TiptapCalloutWarning_default, {}),
5404
- success: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(TiptapCalloutSuccess_default, {}),
5405
- error: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(TiptapCalloutError_default, {})
5466
+ info: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(TiptapCalloutInfo_default, {}),
5467
+ warning: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(TiptapCalloutWarning_default, {}),
5468
+ success: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(TiptapCalloutSuccess_default, {}),
5469
+ error: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(TiptapCalloutError_default, {})
5406
5470
  };
5407
5471
  var legacyTypeMap3 = {
5408
5472
  question: "info",
@@ -5420,15 +5484,15 @@ var Callout = ({ type, bgColor, emoji: emoji2, children, iconWrapper, calloutTyp
5420
5484
  if (emoji2) {
5421
5485
  if (emoji2 in calloutIconComponents) {
5422
5486
  const IconComponent = calloutIconComponents[emoji2];
5423
- icon = /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(IconComponent, {});
5487
+ icon = /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(IconComponent, {});
5424
5488
  } else {
5425
5489
  icon = emoji2;
5426
5490
  }
5427
5491
  } else {
5428
5492
  icon = calloutIcons[finalType];
5429
5493
  }
5430
- const iconContent = iconWrapper ? iconWrapper(icon) : /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { className: "callout-icon", children: icon });
5431
- return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(
5494
+ const iconContent = iconWrapper ? iconWrapper(icon) : /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("div", { className: "callout-icon", children: icon });
5495
+ return /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(
5432
5496
  "div",
5433
5497
  {
5434
5498
  className,
@@ -5438,33 +5502,33 @@ var Callout = ({ type, bgColor, emoji: emoji2, children, iconWrapper, calloutTyp
5438
5502
  style,
5439
5503
  children: [
5440
5504
  iconContent,
5441
- /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { className: "callout-content-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { className: "callout-content", children }) })
5505
+ /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("div", { className: "callout-content-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("div", { className: "callout-content", children }) })
5442
5506
  ]
5443
5507
  }
5444
5508
  );
5445
5509
  };
5446
5510
 
5447
5511
  // src/extensions/views/components/code-block.tsx
5448
- var import_react17 = require("react");
5512
+ var import_react18 = require("react");
5449
5513
  var import_xml2 = __toESM(require("highlight.js/lib/languages/xml"));
5450
5514
  var import_lowlight2 = require("lowlight");
5451
5515
 
5452
5516
  // src/extensions/views/components/copy-button.tsx
5453
- var import_jsx_runtime76 = require("react/jsx-runtime");
5517
+ var import_jsx_runtime77 = require("react/jsx-runtime");
5454
5518
  var CopyButton = ({ iconSize = 16, color = "black" }) => {
5455
- return /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(
5519
+ return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(
5456
5520
  "button",
5457
5521
  {
5458
5522
  className: `copy-button copy-icon-${color}`,
5459
5523
  "data-copy-action": "copy",
5460
5524
  type: "button",
5461
5525
  children: [
5462
- /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
5526
+ /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
5463
5527
  "span",
5464
5528
  {
5465
5529
  className: "copy-icon",
5466
5530
  "data-copy-icon": "default",
5467
- children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
5531
+ children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
5468
5532
  Copy_default,
5469
5533
  {
5470
5534
  width: iconSize,
@@ -5473,13 +5537,13 @@ var CopyButton = ({ iconSize = 16, color = "black" }) => {
5473
5537
  )
5474
5538
  }
5475
5539
  ),
5476
- /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
5540
+ /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
5477
5541
  "span",
5478
5542
  {
5479
5543
  className: "copy-icon-success",
5480
5544
  "data-copy-icon": "success",
5481
5545
  style: { display: "none" },
5482
- children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
5546
+ children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
5483
5547
  Check_default,
5484
5548
  {
5485
5549
  width: iconSize,
@@ -5494,7 +5558,7 @@ var CopyButton = ({ iconSize = 16, color = "black" }) => {
5494
5558
  };
5495
5559
 
5496
5560
  // src/extensions/views/components/code-block.tsx
5497
- var import_jsx_runtime77 = require("react/jsx-runtime");
5561
+ var import_jsx_runtime78 = require("react/jsx-runtime");
5498
5562
  var CodeBlock = ({
5499
5563
  language,
5500
5564
  isEditable,
@@ -5502,7 +5566,7 @@ var CodeBlock = ({
5502
5566
  children,
5503
5567
  translations: translations2
5504
5568
  }) => {
5505
- const languagesList = (0, import_react17.useMemo)(() => {
5569
+ const languagesList = (0, import_react18.useMemo)(() => {
5506
5570
  const lowlight2 = (0, import_lowlight2.createLowlight)(import_lowlight2.common);
5507
5571
  lowlight2.register("html", import_xml2.default);
5508
5572
  const list = lowlight2.listLanguages();
@@ -5511,17 +5575,17 @@ var CodeBlock = ({
5511
5575
  const handleChange = (e) => {
5512
5576
  onLanguageChange?.(e.target.value);
5513
5577
  };
5514
- return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: "tiptap-code-block-wrapper", children: [
5515
- /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: "tiptap-code-block-header", children: [
5516
- isEditable ? /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(
5578
+ return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: "tiptap-code-block-wrapper", children: [
5579
+ /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: "tiptap-code-block-header", children: [
5580
+ isEditable ? /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(
5517
5581
  "select",
5518
5582
  {
5519
5583
  className: "tiptap-code-block-language-select",
5520
5584
  value: language,
5521
5585
  onChange: handleChange,
5522
5586
  children: [
5523
- /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("option", { value: "", children: translations2?.codeBlock.selectLanguage }),
5524
- languagesList.map((lang) => /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
5587
+ /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("option", { value: "", children: translations2?.codeBlock.selectLanguage }),
5588
+ languagesList.map((lang) => /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
5525
5589
  "option",
5526
5590
  {
5527
5591
  value: lang,
@@ -5531,8 +5595,8 @@ var CodeBlock = ({
5531
5595
  ))
5532
5596
  ]
5533
5597
  }
5534
- ) : /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("span", { className: "tiptap-code-block-language-text", children: language || translations2?.codeBlock.selectLanguage }),
5535
- /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
5598
+ ) : /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("span", { className: "tiptap-code-block-language-text", children: language || translations2?.codeBlock.selectLanguage }),
5599
+ /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
5536
5600
  CopyButton,
5537
5601
  {
5538
5602
  iconSize: 20,
@@ -5540,7 +5604,7 @@ var CodeBlock = ({
5540
5604
  }
5541
5605
  )
5542
5606
  ] }),
5543
- /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("pre", { className: "tiptap-code-block", children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
5607
+ /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("pre", { className: "tiptap-code-block", children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
5544
5608
  "code",
5545
5609
  {
5546
5610
  className: "tiptap-code-block-content",
@@ -5552,22 +5616,22 @@ var CodeBlock = ({
5552
5616
  };
5553
5617
 
5554
5618
  // src/extensions/views/components/copyable-text.tsx
5555
- var import_jsx_runtime78 = require("react/jsx-runtime");
5619
+ var import_jsx_runtime79 = require("react/jsx-runtime");
5556
5620
  var CopyableText2 = ({ children }) => {
5557
- return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("span", { className: "copyable", children: [
5558
- /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("span", { "data-copy-content": true, children }),
5559
- /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(CopyButton, { iconSize: 16 })
5621
+ return /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("span", { className: "copyable", children: [
5622
+ /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("span", { "data-copy-content": true, children }),
5623
+ /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(CopyButton, { iconSize: 16 })
5560
5624
  ] });
5561
5625
  };
5562
5626
 
5563
5627
  // src/extensions/views/components/custom-quote.tsx
5564
- var import_jsx_runtime79 = require("react/jsx-runtime");
5565
- var CustomQuote = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { "data-custom-quote": "", children: [
5566
- /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: "custom-quote-divider" }),
5567
- /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: "custom-quote-svg-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(Quote_default, {}) }),
5628
+ var import_jsx_runtime80 = require("react/jsx-runtime");
5629
+ var CustomQuote = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { "data-custom-quote": "", children: [
5630
+ /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: "custom-quote-divider" }),
5631
+ /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: "custom-quote-svg-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Quote_default, {}) }),
5568
5632
  children
5569
5633
  ] });
5570
- var CustomQuoteText = ({ children, isEmpty, placeholder }) => /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
5634
+ var CustomQuoteText = ({ children, isEmpty, placeholder }) => /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
5571
5635
  "div",
5572
5636
  {
5573
5637
  "data-custom-quote-text": true,
@@ -5576,7 +5640,7 @@ var CustomQuoteText = ({ children, isEmpty, placeholder }) => /* @__PURE__ */ (0
5576
5640
  children
5577
5641
  }
5578
5642
  );
5579
- var CustomQuoteAuthor = ({ children, isEmpty, placeholder }) => /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
5643
+ var CustomQuoteAuthor = ({ children, isEmpty, placeholder }) => /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
5580
5644
  "div",
5581
5645
  {
5582
5646
  "data-custom-quote-author": "",
@@ -5585,7 +5649,7 @@ var CustomQuoteAuthor = ({ children, isEmpty, placeholder }) => /* @__PURE__ */
5585
5649
  children
5586
5650
  }
5587
5651
  );
5588
- var CustomQuoteSign = ({ children, isEmpty, placeholder }) => /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
5652
+ var CustomQuoteSign = ({ children, isEmpty, placeholder }) => /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
5589
5653
  "div",
5590
5654
  {
5591
5655
  "data-custom-quote-sign": "",
@@ -5596,7 +5660,7 @@ var CustomQuoteSign = ({ children, isEmpty, placeholder }) => /* @__PURE__ */ (0
5596
5660
  );
5597
5661
 
5598
5662
  // src/extensions/views/components/figure.tsx
5599
- var import_jsx_runtime80 = require("react/jsx-runtime");
5663
+ var import_jsx_runtime81 = require("react/jsx-runtime");
5600
5664
  var Figure = ({
5601
5665
  src,
5602
5666
  alt,
@@ -5611,9 +5675,9 @@ var Figure = ({
5611
5675
  getImageById
5612
5676
  }) => {
5613
5677
  const resolvedSrc = resolveImageSrc({ fileId, src }, { getImageById });
5614
- return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("figure", { children: [
5615
- resolvedSrc && /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: "figure-image-container", children: [
5616
- /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
5678
+ return /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("figure", { children: [
5679
+ resolvedSrc && /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: "figure-image-container", children: [
5680
+ /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
5617
5681
  "img",
5618
5682
  {
5619
5683
  src: resolvedSrc,
@@ -5623,7 +5687,7 @@ var Figure = ({
5623
5687
  height: height || void 0
5624
5688
  }
5625
5689
  ),
5626
- isEditable && onEditClick && /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
5690
+ isEditable && onEditClick && /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
5627
5691
  "button",
5628
5692
  {
5629
5693
  type: "button",
@@ -5631,19 +5695,19 @@ var Figure = ({
5631
5695
  onClick: onEditClick,
5632
5696
  contentEditable: false,
5633
5697
  "aria-label": "\u0420\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435",
5634
- children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Edit_default, {})
5698
+ children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(Edit_default, {})
5635
5699
  }
5636
5700
  )
5637
5701
  ] }),
5638
- caption && /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("figcaption", { children: caption }),
5702
+ caption && /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("figcaption", { children: caption }),
5639
5703
  children
5640
5704
  ] });
5641
5705
  };
5642
5706
 
5643
5707
  // src/extensions/views/components/prompt.tsx
5644
- var import_jsx_runtime81 = require("react/jsx-runtime");
5645
- var PromptHeader = ({ children, isEmpty, placeholder }) => /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: "prompt-header-wrapper", children: [
5646
- /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
5708
+ var import_jsx_runtime82 = require("react/jsx-runtime");
5709
+ var PromptHeader = ({ children, isEmpty, placeholder }) => /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: "prompt-header-wrapper", children: [
5710
+ /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
5647
5711
  "div",
5648
5712
  {
5649
5713
  className: isEmpty ? "is-empty" : "",
@@ -5651,7 +5715,7 @@ var PromptHeader = ({ children, isEmpty, placeholder }) => /* @__PURE__ */ (0, i
5651
5715
  children
5652
5716
  }
5653
5717
  ),
5654
- /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("span", { className: "prompt-copy-icon-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
5718
+ /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("span", { className: "prompt-copy-icon-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
5655
5719
  CopyButton,
5656
5720
  {
5657
5721
  iconSize: 16,
@@ -5659,7 +5723,7 @@ var PromptHeader = ({ children, isEmpty, placeholder }) => /* @__PURE__ */ (0, i
5659
5723
  }
5660
5724
  ) })
5661
5725
  ] });
5662
- var PromptContent = ({ children, isEmpty, placeholder }) => /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: "prompt-content-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
5726
+ var PromptContent = ({ children, isEmpty, placeholder }) => /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { className: "prompt-content-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
5663
5727
  "div",
5664
5728
  {
5665
5729
  className: isEmpty ? "is-empty" : "",
@@ -5670,22 +5734,22 @@ var PromptContent = ({ children, isEmpty, placeholder }) => /* @__PURE__ */ (0,
5670
5734
  ) });
5671
5735
 
5672
5736
  // src/extensions/views/components/video.tsx
5673
- var import_jsx_runtime82 = require("react/jsx-runtime");
5737
+ var import_jsx_runtime83 = require("react/jsx-runtime");
5674
5738
  var Video = ({ src, children }) => {
5675
5739
  const videoInfo = detectVideoHosting(src);
5676
5740
  if (!videoInfo?.embedUrl) {
5677
- return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: "video-node", children: [
5678
- /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { className: "video-error", children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("span", { children: "Unsupported or invalid video URL" }) }),
5741
+ return /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)("div", { className: "video-node", children: [
5742
+ /* @__PURE__ */ (0, import_jsx_runtime83.jsx)("div", { className: "video-error", children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)("span", { children: "Unsupported or invalid video URL" }) }),
5679
5743
  children
5680
5744
  ] });
5681
5745
  }
5682
- return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(
5746
+ return /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(
5683
5747
  "div",
5684
5748
  {
5685
5749
  className: "video-node",
5686
5750
  "data-video": "",
5687
5751
  children: [
5688
- /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { className: "video-player-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
5752
+ /* @__PURE__ */ (0, import_jsx_runtime83.jsx)("div", { className: "video-player-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
5689
5753
  "iframe",
5690
5754
  {
5691
5755
  className: "video-iframe",
@@ -5702,13 +5766,13 @@ var Video = ({ src, children }) => {
5702
5766
  };
5703
5767
 
5704
5768
  // src/editor/controls/emoji-picker.tsx
5705
- var import_react18 = require("react");
5769
+ var import_react19 = require("react");
5706
5770
  var import_emoji_picker_react = __toESM(require("emoji-picker-react"));
5707
- var import_jsx_runtime83 = require("react/jsx-runtime");
5771
+ var import_jsx_runtime84 = require("react/jsx-runtime");
5708
5772
  var EmojiPickerComponent = ({ isOpen, onClose, onEmojiSelect }) => {
5709
- const pickerRef = (0, import_react18.useRef)(null);
5773
+ const pickerRef = (0, import_react19.useRef)(null);
5710
5774
  const translations2 = useTiptapTranslations();
5711
- (0, import_react18.useEffect)(() => {
5775
+ (0, import_react19.useEffect)(() => {
5712
5776
  const handleClickOutside = (event) => {
5713
5777
  if (pickerRef.current && !pickerRef.current.contains(event.target)) {
5714
5778
  onClose();
@@ -5722,12 +5786,12 @@ var EmojiPickerComponent = ({ isOpen, onClose, onEmojiSelect }) => {
5722
5786
  };
5723
5787
  }, [isOpen, onClose]);
5724
5788
  if (!isOpen) return null;
5725
- return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
5789
+ return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
5726
5790
  "div",
5727
5791
  {
5728
5792
  ref: pickerRef,
5729
5793
  className: "tiptap__emoji-picker-wrapper",
5730
- children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
5794
+ children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
5731
5795
  import_emoji_picker_react.default,
5732
5796
  {
5733
5797
  skinTonesDisabled: true,
@@ -5752,12 +5816,12 @@ var EmojiPickerComponent = ({ isOpen, onClose, onEmojiSelect }) => {
5752
5816
  };
5753
5817
 
5754
5818
  // src/extensions/views/node-views/callout.tsx
5755
- var import_jsx_runtime84 = require("react/jsx-runtime");
5819
+ var import_jsx_runtime85 = require("react/jsx-runtime");
5756
5820
  var CalloutView = (props) => {
5757
5821
  const type = props.node.attrs.type || "info";
5758
5822
  const bgColor = props.node.attrs.bgColor;
5759
5823
  const emoji2 = props.node.attrs.emoji;
5760
- const [showEmojiPicker, setShowEmojiPicker] = (0, import_react20.useState)(false);
5824
+ const [showEmojiPicker, setShowEmojiPicker] = (0, import_react21.useState)(false);
5761
5825
  const handleIconClick = (e) => {
5762
5826
  e.preventDefault();
5763
5827
  e.stopPropagation();
@@ -5767,23 +5831,23 @@ var CalloutView = (props) => {
5767
5831
  props.updateAttributes({ emoji: newEmoji });
5768
5832
  setShowEmojiPicker(false);
5769
5833
  };
5770
- return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_react19.NodeViewWrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
5834
+ return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_react20.NodeViewWrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
5771
5835
  Callout,
5772
5836
  {
5773
5837
  type,
5774
5838
  bgColor,
5775
5839
  emoji: emoji2,
5776
- iconWrapper: (icon) => /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { className: "callout-icon-wrapper", children: [
5777
- /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
5840
+ iconWrapper: (icon) => /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "callout-icon-wrapper", children: [
5841
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
5778
5842
  "button",
5779
5843
  {
5780
5844
  className: "callout-icon-button",
5781
5845
  onClick: handleIconClick,
5782
5846
  type: "button",
5783
- children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: "callout-icon", children: icon })
5847
+ children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: "callout-icon", children: icon })
5784
5848
  }
5785
5849
  ),
5786
- /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
5850
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
5787
5851
  EmojiPickerComponent,
5788
5852
  {
5789
5853
  isOpen: showEmojiPicker,
@@ -5792,87 +5856,87 @@ var CalloutView = (props) => {
5792
5856
  }
5793
5857
  )
5794
5858
  ] }),
5795
- children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_react19.NodeViewContent, { as: "div" })
5859
+ children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_react20.NodeViewContent, { as: "div" })
5796
5860
  }
5797
5861
  ) });
5798
5862
  };
5799
5863
 
5800
5864
  // src/extensions/views/node-views/code-block.tsx
5801
- var import_react21 = require("react");
5802
- var import_react22 = require("@tiptap/react");
5803
- var import_jsx_runtime85 = require("react/jsx-runtime");
5865
+ var import_react22 = require("react");
5866
+ var import_react23 = require("@tiptap/react");
5867
+ var import_jsx_runtime86 = require("react/jsx-runtime");
5804
5868
  var CodeBlockView = (props) => {
5805
- const [selectedLanguage, setSelectedLanguage] = (0, import_react21.useState)(props.node.attrs.language ?? "");
5869
+ const [selectedLanguage, setSelectedLanguage] = (0, import_react22.useState)(props.node.attrs.language ?? "");
5806
5870
  const translations2 = useTiptapTranslations();
5807
5871
  const handleLanguageChange = (language) => {
5808
5872
  props.updateAttributes({ language });
5809
5873
  setSelectedLanguage(language);
5810
5874
  };
5811
- return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_react22.NodeViewWrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
5875
+ return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_react23.NodeViewWrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
5812
5876
  CodeBlock,
5813
5877
  {
5814
5878
  language: selectedLanguage,
5815
5879
  isEditable: props.editor.isEditable,
5816
5880
  onLanguageChange: handleLanguageChange,
5817
5881
  translations: translations2,
5818
- children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_react22.NodeViewContent, {})
5882
+ children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_react23.NodeViewContent, {})
5819
5883
  }
5820
5884
  ) });
5821
5885
  };
5822
5886
 
5823
5887
  // src/extensions/views/node-views/copyable-text.tsx
5824
- var import_react23 = require("@tiptap/react");
5825
- var import_jsx_runtime86 = require("react/jsx-runtime");
5888
+ var import_react24 = require("@tiptap/react");
5889
+ var import_jsx_runtime87 = require("react/jsx-runtime");
5826
5890
  var CopyableTextView = () => {
5827
- return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(CopyableText2, { children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_react23.MarkViewContent, {}) });
5891
+ return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(CopyableText2, { children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_react24.MarkViewContent, {}) });
5828
5892
  };
5829
5893
 
5830
5894
  // src/extensions/views/node-views/custom-quote.tsx
5831
- var import_react24 = require("@tiptap/react");
5832
- var import_jsx_runtime87 = require("react/jsx-runtime");
5895
+ var import_react25 = require("@tiptap/react");
5896
+ var import_jsx_runtime88 = require("react/jsx-runtime");
5833
5897
  var CustomQuoteView = () => {
5834
- return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_react24.NodeViewWrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(CustomQuote, { children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_react24.NodeViewContent, {}) }) });
5898
+ return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_react25.NodeViewWrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(CustomQuote, { children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_react25.NodeViewContent, {}) }) });
5835
5899
  };
5836
5900
  var CustomQuoteTextView = (props) => {
5837
5901
  const isEmpty = !props.node.content.size;
5838
5902
  const translations2 = useTiptapTranslations();
5839
- return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_react24.NodeViewWrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
5903
+ return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_react25.NodeViewWrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
5840
5904
  CustomQuoteText,
5841
5905
  {
5842
5906
  isEmpty,
5843
5907
  placeholder: translations2.customQuote.textPlaceholder,
5844
- children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_react24.NodeViewContent, { className: isEmpty ? "is-empty" : "" })
5908
+ children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_react25.NodeViewContent, { className: isEmpty ? "is-empty" : "" })
5845
5909
  }
5846
5910
  ) });
5847
5911
  };
5848
5912
  var CustomQuoteAuthorView = (props) => {
5849
5913
  const isEmpty = !props.node.content.size;
5850
5914
  const translations2 = useTiptapTranslations();
5851
- return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_react24.NodeViewWrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
5915
+ return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_react25.NodeViewWrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
5852
5916
  CustomQuoteAuthor,
5853
5917
  {
5854
5918
  isEmpty,
5855
5919
  placeholder: translations2.customQuote.authorPlaceholder,
5856
- children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_react24.NodeViewContent, { className: isEmpty ? "is-empty" : "" })
5920
+ children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_react25.NodeViewContent, { className: isEmpty ? "is-empty" : "" })
5857
5921
  }
5858
5922
  ) });
5859
5923
  };
5860
5924
  var CustomQuoteSignView = (props) => {
5861
5925
  const isEmpty = !props.node.content.size;
5862
5926
  const translations2 = useTiptapTranslations();
5863
- return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_react24.NodeViewWrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
5927
+ return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_react25.NodeViewWrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
5864
5928
  CustomQuoteSign,
5865
5929
  {
5866
5930
  isEmpty,
5867
5931
  placeholder: translations2.customQuote.signPlaceholder,
5868
- children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_react24.NodeViewContent, { className: isEmpty ? "is-empty" : "" })
5932
+ children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_react25.NodeViewContent, { className: isEmpty ? "is-empty" : "" })
5869
5933
  }
5870
5934
  ) });
5871
5935
  };
5872
5936
 
5873
5937
  // src/extensions/views/node-views/figure.tsx
5874
- var import_react25 = require("@tiptap/react");
5875
- var import_jsx_runtime88 = require("react/jsx-runtime");
5938
+ var import_react26 = require("@tiptap/react");
5939
+ var import_jsx_runtime89 = require("react/jsx-runtime");
5876
5940
  var FigureView = ({ node, getPos, editor }) => {
5877
5941
  const { fileId, src, alt, title, caption, width, height } = node.attrs;
5878
5942
  const imageExtension = editor.extensionManager.extensions.find((ext) => ext.name === "image");
@@ -5881,12 +5945,12 @@ var FigureView = ({ node, getPos, editor }) => {
5881
5945
  const handleEditClick = () => {
5882
5946
  onFigureClick?.(node.attrs, getPos());
5883
5947
  };
5884
- return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
5885
- import_react25.NodeViewWrapper,
5948
+ return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
5949
+ import_react26.NodeViewWrapper,
5886
5950
  {
5887
5951
  className: "figure-node-view",
5888
5952
  "data-drag-handle": true,
5889
- children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
5953
+ children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
5890
5954
  Figure,
5891
5955
  {
5892
5956
  fileId,
@@ -5906,40 +5970,40 @@ var FigureView = ({ node, getPos, editor }) => {
5906
5970
  };
5907
5971
 
5908
5972
  // src/extensions/views/node-views/prompt.tsx
5909
- var import_react26 = require("@tiptap/react");
5910
- var import_jsx_runtime89 = require("react/jsx-runtime");
5973
+ var import_react27 = require("@tiptap/react");
5974
+ var import_jsx_runtime90 = require("react/jsx-runtime");
5911
5975
  var PromptHeaderView = (props) => {
5912
5976
  const isEmpty = !props.node.content.size;
5913
5977
  const translations2 = useTiptapTranslations();
5914
- return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_react26.NodeViewWrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
5978
+ return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(import_react27.NodeViewWrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
5915
5979
  PromptHeader,
5916
5980
  {
5917
5981
  isEmpty,
5918
5982
  placeholder: translations2.prompt.headerPlaceholder,
5919
- children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_react26.NodeViewContent, { className: isEmpty ? "is-empty" : "" })
5983
+ children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(import_react27.NodeViewContent, { className: isEmpty ? "is-empty" : "" })
5920
5984
  }
5921
5985
  ) });
5922
5986
  };
5923
5987
  var PromptContentView = (props) => {
5924
5988
  const isEmpty = !props.node.content.size;
5925
5989
  const translations2 = useTiptapTranslations();
5926
- return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_react26.NodeViewWrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
5990
+ return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(import_react27.NodeViewWrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
5927
5991
  PromptContent,
5928
5992
  {
5929
5993
  isEmpty,
5930
5994
  placeholder: translations2.prompt.contentPlaceholder,
5931
- children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_react26.NodeViewContent, { className: isEmpty ? "is-empty" : "" })
5995
+ children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(import_react27.NodeViewContent, { className: isEmpty ? "is-empty" : "" })
5932
5996
  }
5933
5997
  ) });
5934
5998
  };
5935
5999
 
5936
6000
  // src/extensions/views/node-views/video.tsx
5937
- var import_react27 = require("@tiptap/react");
5938
- var import_jsx_runtime90 = require("react/jsx-runtime");
6001
+ var import_react28 = require("@tiptap/react");
6002
+ var import_jsx_runtime91 = require("react/jsx-runtime");
5939
6003
  var VideoView = (props) => {
5940
6004
  const { src } = props.node.attrs;
5941
- return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(import_react27.NodeViewWrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(Video, { src, children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
5942
- import_react27.NodeViewContent,
6005
+ return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_react28.NodeViewWrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Video, { src, children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
6006
+ import_react28.NodeViewContent,
5943
6007
  {
5944
6008
  as: "div",
5945
6009
  className: "video-content"
@@ -5950,66 +6014,66 @@ var VideoView = (props) => {
5950
6014
  // src/extensions/editor/callout.ts
5951
6015
  var Callout2 = BaseCallout.extend({
5952
6016
  addNodeView() {
5953
- return (0, import_react28.ReactNodeViewRenderer)(CalloutView);
6017
+ return (0, import_react29.ReactNodeViewRenderer)(CalloutView);
5954
6018
  }
5955
6019
  });
5956
6020
  var LegacyBookAlert = BaseLegacyBookAlert.extend({
5957
6021
  addNodeView() {
5958
- return (0, import_react28.ReactNodeViewRenderer)(CalloutView);
6022
+ return (0, import_react29.ReactNodeViewRenderer)(CalloutView);
5959
6023
  }
5960
6024
  });
5961
6025
  var LegacyBookTip = BaseLegacyBookTip.extend({
5962
6026
  addNodeView() {
5963
- return (0, import_react28.ReactNodeViewRenderer)(CalloutView);
6027
+ return (0, import_react29.ReactNodeViewRenderer)(CalloutView);
5964
6028
  }
5965
6029
  });
5966
6030
 
5967
6031
  // src/extensions/editor/code-block.ts
5968
- var import_react29 = require("@tiptap/react");
6032
+ var import_react30 = require("@tiptap/react");
5969
6033
  var CodeBlock2 = BaseCodeBlock.extend({
5970
6034
  addNodeView() {
5971
- return (0, import_react29.ReactNodeViewRenderer)(CodeBlockView);
6035
+ return (0, import_react30.ReactNodeViewRenderer)(CodeBlockView);
5972
6036
  }
5973
6037
  });
5974
6038
 
5975
6039
  // src/extensions/editor/custom-quote.ts
5976
- var import_react30 = require("@tiptap/react");
6040
+ var import_react31 = require("@tiptap/react");
5977
6041
  var CustomQuote2 = BaseCustomQuote.extend({
5978
6042
  addNodeView() {
5979
- return (0, import_react30.ReactNodeViewRenderer)(CustomQuoteView);
6043
+ return (0, import_react31.ReactNodeViewRenderer)(CustomQuoteView);
5980
6044
  }
5981
6045
  });
5982
6046
  var CustomQuoteText2 = BaseCustomQuoteText.extend({
5983
6047
  addNodeView() {
5984
- return (0, import_react30.ReactNodeViewRenderer)(CustomQuoteTextView);
6048
+ return (0, import_react31.ReactNodeViewRenderer)(CustomQuoteTextView);
5985
6049
  }
5986
6050
  });
5987
6051
  var CustomQuoteAuthor2 = BaseCustomQuoteAuthor.extend({
5988
6052
  addNodeView() {
5989
- return (0, import_react30.ReactNodeViewRenderer)(CustomQuoteAuthorView);
6053
+ return (0, import_react31.ReactNodeViewRenderer)(CustomQuoteAuthorView);
5990
6054
  }
5991
6055
  });
5992
6056
  var CustomQuoteSign2 = BaseCustomQuoteSign.extend({
5993
6057
  addNodeView() {
5994
- return (0, import_react30.ReactNodeViewRenderer)(CustomQuoteSignView);
6058
+ return (0, import_react31.ReactNodeViewRenderer)(CustomQuoteSignView);
5995
6059
  }
5996
6060
  });
5997
6061
  var LegacySEQuote = BaseLegacySEQuote.extend({
5998
6062
  addNodeView() {
5999
- return (0, import_react30.ReactNodeViewRenderer)(CustomQuoteView);
6063
+ return (0, import_react31.ReactNodeViewRenderer)(CustomQuoteView);
6000
6064
  }
6001
6065
  });
6002
6066
 
6003
6067
  // src/extensions/editor/video.ts
6004
- var import_react31 = require("@tiptap/react");
6068
+ var import_react32 = require("@tiptap/react");
6005
6069
  var Video2 = BaseVideo.extend({
6006
6070
  addNodeView() {
6007
- return (0, import_react31.ReactNodeViewRenderer)(VideoView);
6071
+ return (0, import_react32.ReactNodeViewRenderer)(VideoView);
6008
6072
  }
6009
6073
  });
6010
6074
  var LegacyYouTube = BaseLegacyYouTube.extend({
6011
6075
  addNodeView() {
6012
- return (0, import_react31.ReactNodeViewRenderer)(VideoView);
6076
+ return (0, import_react32.ReactNodeViewRenderer)(VideoView);
6013
6077
  }
6014
6078
  });
6015
6079
 
@@ -6418,44 +6482,44 @@ function getSharedExtensions() {
6418
6482
  }
6419
6483
 
6420
6484
  // src/extensions/editor/copyable-text.ts
6421
- var import_react32 = require("@tiptap/react");
6485
+ var import_react33 = require("@tiptap/react");
6422
6486
  var CopyableText3 = CopyableText.extend({
6423
6487
  addMarkView() {
6424
- return (0, import_react32.ReactMarkViewRenderer)(CopyableTextView);
6488
+ return (0, import_react33.ReactMarkViewRenderer)(CopyableTextView);
6425
6489
  }
6426
6490
  });
6427
6491
 
6428
6492
  // src/extensions/editor/prompt.ts
6429
- var import_react33 = require("@tiptap/react");
6493
+ var import_react34 = require("@tiptap/react");
6430
6494
  var PromptHeader2 = BasePromptHeader.extend({
6431
6495
  addNodeView() {
6432
- return (0, import_react33.ReactNodeViewRenderer)(PromptHeaderView);
6496
+ return (0, import_react34.ReactNodeViewRenderer)(PromptHeaderView);
6433
6497
  }
6434
6498
  });
6435
6499
  var PromptContent2 = BasePromptContent.extend({
6436
6500
  addNodeView() {
6437
- return (0, import_react33.ReactNodeViewRenderer)(PromptContentView);
6501
+ return (0, import_react34.ReactNodeViewRenderer)(PromptContentView);
6438
6502
  }
6439
6503
  });
6440
6504
  var LegacyPromptSEHeader = BaseLegacyPromptSEHeader.extend({
6441
6505
  addNodeView() {
6442
- return (0, import_react33.ReactNodeViewRenderer)(PromptHeaderView);
6506
+ return (0, import_react34.ReactNodeViewRenderer)(PromptHeaderView);
6443
6507
  }
6444
6508
  });
6445
6509
  var LegacyPromptSEContent = BaseLegacyPromptSEContent.extend({
6446
6510
  addNodeView() {
6447
- return (0, import_react33.ReactNodeViewRenderer)(PromptContentView);
6511
+ return (0, import_react34.ReactNodeViewRenderer)(PromptContentView);
6448
6512
  }
6449
6513
  });
6450
6514
 
6451
6515
  // src/extensions/editor/figure.ts
6452
- var import_react34 = require("@tiptap/react");
6516
+ var import_react35 = require("@tiptap/react");
6453
6517
  var import_core18 = require("@tiptap/core");
6454
6518
  var Figure2 = BaseFigure.extend({
6455
6519
  addNodeView() {
6456
6520
  const resizeOptions = this.options.resize;
6457
6521
  if (!resizeOptions) {
6458
- return (0, import_react34.ReactNodeViewRenderer)(FigureView);
6522
+ return (0, import_react35.ReactNodeViewRenderer)(FigureView);
6459
6523
  }
6460
6524
  return (props) => {
6461
6525
  const { node, getPos, editor } = props;
@@ -6620,7 +6684,7 @@ var Figure2 = BaseFigure.extend({
6620
6684
  });
6621
6685
  var LegacyFigure = BaseLegacyFigure.extend({
6622
6686
  addNodeView() {
6623
- return (0, import_react34.ReactNodeViewRenderer)(FigureView);
6687
+ return (0, import_react35.ReactNodeViewRenderer)(FigureView);
6624
6688
  }
6625
6689
  });
6626
6690
 
@@ -6786,7 +6850,7 @@ var createHandleKatexAdd = (editor, closeDialogCommand, savedPos) => {
6786
6850
  };
6787
6851
 
6788
6852
  // src/editor/handlers/insertion-handlers.ts
6789
- var import_react35 = require("react");
6853
+ var import_react36 = require("react");
6790
6854
 
6791
6855
  // src/editor/handlers/markup-insertion.ts
6792
6856
  var import_model2 = require("@tiptap/pm/model");
@@ -6872,17 +6936,17 @@ function applyUploadResultsToNodes(imagesToNodes, results) {
6872
6936
 
6873
6937
  // src/editor/handlers/insertion-handlers.ts
6874
6938
  function useInsertionHandlers(imageHandlers) {
6875
- const [insertedImage, setInsertedImage] = (0, import_react35.useState)(null);
6939
+ const [insertedImage, setInsertedImage] = (0, import_react36.useState)(null);
6876
6940
  const { activeDialog, openDialogCommand } = useDialogCommand();
6877
- (0, import_react35.useEffect)(() => {
6941
+ (0, import_react36.useEffect)(() => {
6878
6942
  if (insertedImage && !activeDialog) {
6879
6943
  setInsertedImage(null);
6880
6944
  }
6881
6945
  }, [insertedImage, activeDialog]);
6882
6946
  function genericInsertionHandler(file, event) {
6883
- if (!file || !file.type.startsWith("image/")) return;
6884
6947
  event.preventDefault();
6885
6948
  event.stopPropagation();
6949
+ if (!file || !file.type.startsWith("image/")) return;
6886
6950
  if (!imageHandlers?.upload) return;
6887
6951
  setInsertedImage(file);
6888
6952
  openDialogCommand("image");
@@ -6934,7 +6998,7 @@ function useInsertionHandlers(imageHandlers) {
6934
6998
  // src/editor/commands/suggestion.tsx
6935
6999
  var import_dom = require("@floating-ui/dom");
6936
7000
  var import_core19 = require("@tiptap/core");
6937
- var import_react36 = require("@tiptap/react");
7001
+ var import_react37 = require("@tiptap/react");
6938
7002
 
6939
7003
  // src/editor/commands/items.ts
6940
7004
  var getCommandItems = (translations2, hasImageHandlers) => [
@@ -7235,7 +7299,7 @@ var filterCommandItems = (items, query) => {
7235
7299
  };
7236
7300
 
7237
7301
  // src/editor/commands/suggestion.tsx
7238
- var import_jsx_runtime91 = require("react/jsx-runtime");
7302
+ var import_jsx_runtime92 = require("react/jsx-runtime");
7239
7303
  var component = null;
7240
7304
  var closeMenu = () => {
7241
7305
  if (component) {
@@ -7249,7 +7313,7 @@ var mapCommandMenuItemToCommandItem = (item) => {
7249
7313
  const IconComponent = item.icon;
7250
7314
  return {
7251
7315
  title: item.title,
7252
- icon: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(IconComponent, {}),
7316
+ icon: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(IconComponent, {}),
7253
7317
  command: ({ editor, range }) => {
7254
7318
  editor.chain().focus().deleteRange(range).run();
7255
7319
  item.onClick(editor);
@@ -7267,7 +7331,7 @@ var createSuggestions = (translations2, hasImageHandlers) => ({
7267
7331
  render: () => {
7268
7332
  return {
7269
7333
  onStart: async (props) => {
7270
- component = new import_react36.ReactRenderer(CommandsList, {
7334
+ component = new import_react37.ReactRenderer(CommandsList, {
7271
7335
  props,
7272
7336
  editor: props.editor
7273
7337
  });
@@ -7457,7 +7521,8 @@ var ru_default = {
7457
7521
  captionLabel: "\u041F\u043E\u0434\u043F\u0438\u0441\u044C \u043A \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044E",
7458
7522
  captionPlaceholder: "\u041E\u043F\u0438\u0441\u0430\u043D\u0438\u0435 \u043F\u043E\u0434 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435\u043C...",
7459
7523
  save: "\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C",
7460
- add: "\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C"
7524
+ add: "\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C",
7525
+ invalidFileType: "\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0444\u043E\u0440\u043C\u0430\u0442 \u0444\u0430\u0439\u043B\u0430."
7461
7526
  },
7462
7527
  videoUpload: {
7463
7528
  title: "\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0432\u0438\u0434\u0435\u043E",
@@ -7502,7 +7567,9 @@ var ru_default = {
7502
7567
  words: ["\u0441\u043B\u043E\u0432\u043E", "\u0441\u043B\u043E\u0432\u0430", "\u0441\u043B\u043E\u0432"]
7503
7568
  },
7504
7569
  common: {
7505
- cancel: "\u041E\u0442\u043C\u0435\u043D\u0438\u0442\u044C"
7570
+ cancel: "\u041E\u0442\u043C\u0435\u043D\u0438\u0442\u044C",
7571
+ unknownError: "\u041D\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043D\u0430\u044F \u043E\u0448\u0438\u0431\u043A\u0430",
7572
+ clearError: "\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u043E\u0448\u0438\u0431\u043A\u0443"
7506
7573
  }
7507
7574
  };
7508
7575
 
@@ -7621,7 +7688,8 @@ var en_default = {
7621
7688
  captionLabel: "Image caption",
7622
7689
  captionPlaceholder: "Description under image...",
7623
7690
  save: "Save",
7624
- add: "Add"
7691
+ add: "Add",
7692
+ invalidFileType: "Invalid file format."
7625
7693
  },
7626
7694
  videoUpload: {
7627
7695
  title: "Add video",
@@ -7666,7 +7734,9 @@ var en_default = {
7666
7734
  words: ["word", "words", "words"]
7667
7735
  },
7668
7736
  common: {
7669
- cancel: "Cancel"
7737
+ cancel: "Cancel",
7738
+ unknownError: "Unknown error",
7739
+ clearError: "Clear error"
7670
7740
  }
7671
7741
  };
7672
7742
 
@@ -7680,7 +7750,7 @@ function getTranslations(lang) {
7680
7750
  }
7681
7751
 
7682
7752
  // src/editor/editor.tsx
7683
- var import_jsx_runtime92 = require("react/jsx-runtime");
7753
+ var import_jsx_runtime93 = require("react/jsx-runtime");
7684
7754
  function TiptapContent({
7685
7755
  content,
7686
7756
  handleChange,
@@ -7690,18 +7760,18 @@ function TiptapContent({
7690
7760
  lang,
7691
7761
  error
7692
7762
  }) {
7693
- const [linkDialogContext, setLinkDialogContext] = (0, import_react37.useState)(null);
7694
- const [katexDialogContext, setKatexDialogContext] = (0, import_react37.useState)(
7763
+ const [linkDialogContext, setLinkDialogContext] = (0, import_react38.useState)(null);
7764
+ const [katexDialogContext, setKatexDialogContext] = (0, import_react38.useState)(
7695
7765
  null
7696
7766
  );
7697
- const [editFigureContext, setEditFigureContext] = (0, import_react37.useState)(null);
7698
- const [savedDialogCursorPos, setSavedDialogCursorPos] = (0, import_react37.useState)(void 0);
7699
- const [savedDialogRange, setSavedDialogRange] = (0, import_react37.useState)(
7767
+ const [editFigureContext, setEditFigureContext] = (0, import_react38.useState)(null);
7768
+ const [savedDialogCursorPos, setSavedDialogCursorPos] = (0, import_react38.useState)(void 0);
7769
+ const [savedDialogRange, setSavedDialogRange] = (0, import_react38.useState)(
7700
7770
  void 0
7701
7771
  );
7702
7772
  const { activeDialog, closeDialogCommand, openDialogCommand } = useDialogCommand();
7703
7773
  const translations2 = useTiptapTranslations();
7704
- const [isDisabledInternal, setIsDisabledInternal] = (0, import_react37.useState)(isDisabled);
7774
+ const [isDisabledInternal, setIsDisabledInternal] = (0, import_react38.useState)(isDisabled);
7705
7775
  const disabled = isDisabled || isDisabledInternal;
7706
7776
  let safeContent;
7707
7777
  try {
@@ -7715,7 +7785,7 @@ function TiptapContent({
7715
7785
  onDrop,
7716
7786
  onMarkupInsertion
7717
7787
  } = useInsertionHandlers(imageHandlers);
7718
- const editor = (0, import_react38.useEditor)(
7788
+ const editor = (0, import_react39.useEditor)(
7719
7789
  {
7720
7790
  editable: isEditable && !disabled,
7721
7791
  extensions: getEditorExtensions({
@@ -7779,7 +7849,7 @@ function TiptapContent({
7779
7849
  },
7780
7850
  [lang]
7781
7851
  );
7782
- (0, import_react37.useEffect)(() => {
7852
+ (0, import_react38.useEffect)(() => {
7783
7853
  if (activeDialog && editor && !editor.isDestroyed) {
7784
7854
  const { from, to } = editor.state.selection;
7785
7855
  setSavedDialogCursorPos(from);
@@ -7808,7 +7878,7 @@ function TiptapContent({
7808
7878
  const katexHandler = createHandleKatexAdd(editor, handleCloseDialog, savedDialogCursorPos);
7809
7879
  katexHandler(latex, katexDialogContext?.pos);
7810
7880
  };
7811
- (0, import_react37.useEffect)(() => {
7881
+ (0, import_react38.useEffect)(() => {
7812
7882
  if (!editor || editor.isDestroyed) return;
7813
7883
  editor.commands.setContent(safeContent, {
7814
7884
  emitUpdate: false
@@ -7827,16 +7897,16 @@ function TiptapContent({
7827
7897
  return true;
7828
7898
  };
7829
7899
  if (!editor) return null;
7830
- return /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(import_jsx_runtime92.Fragment, { children: [
7831
- /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(DragHandle, { editor }),
7832
- isEditable && !disabled && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(TableMenu, { editor }),
7833
- isEditable && !disabled && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
7900
+ return /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(import_jsx_runtime93.Fragment, { children: [
7901
+ /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(DragHandle, { editor }),
7902
+ isEditable && !disabled && /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(TableMenu, { editor }),
7903
+ isEditable && !disabled && /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
7834
7904
  import_menus.BubbleMenu,
7835
7905
  {
7836
7906
  shouldShow: shouldBubbleMenuShow,
7837
7907
  editor,
7838
7908
  options: { placement: "bottom", offset: 8, flip: true },
7839
- children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
7909
+ children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
7840
7910
  BubbleMenuContent,
7841
7911
  {
7842
7912
  editor,
@@ -7845,19 +7915,19 @@ function TiptapContent({
7845
7915
  )
7846
7916
  }
7847
7917
  ),
7848
- /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(
7918
+ /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(
7849
7919
  "div",
7850
7920
  {
7851
7921
  className: `tiptap-content-wrapper ${!!error ? "has-error" : ""} ${disabled ? "is-disabled" : ""}`,
7852
7922
  children: [
7853
- /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(import_react38.EditorContent, { editor }),
7854
- isEditable && !disabled && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(CharacterCount, { editor })
7923
+ /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_react39.EditorContent, { editor }),
7924
+ isEditable && !disabled && /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(CharacterCount, { editor })
7855
7925
  ]
7856
7926
  }
7857
7927
  ),
7858
- !!error && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("p", { className: "tiptap-error-message", children: error }),
7859
- isEditable && /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(import_jsx_runtime92.Fragment, { children: [
7860
- activeDialog === "image" && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
7928
+ !!error && /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("p", { className: "tiptap-error-message", children: error }),
7929
+ isEditable && /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(import_jsx_runtime93.Fragment, { children: [
7930
+ activeDialog === "image" && /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
7861
7931
  ImageDialog,
7862
7932
  {
7863
7933
  open: true,
@@ -7871,7 +7941,7 @@ function TiptapContent({
7871
7941
  mode: editFigureContext ? "edit" : "add"
7872
7942
  }
7873
7943
  ),
7874
- activeDialog === "link" && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
7944
+ activeDialog === "link" && /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
7875
7945
  AddLinkDialog,
7876
7946
  {
7877
7947
  open: true,
@@ -7880,7 +7950,7 @@ function TiptapContent({
7880
7950
  linkDialogContext
7881
7951
  }
7882
7952
  ),
7883
- activeDialog === "video" && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
7953
+ activeDialog === "video" && /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
7884
7954
  AddVideoDialog,
7885
7955
  {
7886
7956
  open: true,
@@ -7888,7 +7958,7 @@ function TiptapContent({
7888
7958
  onVideoAdd: handleVideoAdd
7889
7959
  }
7890
7960
  ),
7891
- activeDialog === "katex" && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
7961
+ activeDialog === "katex" && /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
7892
7962
  AddKatexDialog,
7893
7963
  {
7894
7964
  open: true,
@@ -7903,7 +7973,7 @@ function TiptapContent({
7903
7973
  var Tiptap = (props) => {
7904
7974
  const { lang = "ru" } = props;
7905
7975
  const translations2 = getTranslations(lang);
7906
- return /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(TiptapTranslationsProvider, { translations: translations2, children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(DialogCommandProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(TiptapContent, { ...props }) }) });
7976
+ return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(TiptapTranslationsProvider, { translations: translations2, children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(DialogCommandProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(TiptapContent, { ...props }) }) });
7907
7977
  };
7908
7978
 
7909
7979
  // src/utils/html-to-tiptap-content.ts