@cyberyozh/text-editor 0.3.2 → 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,7 +2014,7 @@ var ImageDialog = ({
1972
2014
  width: constrainedDimensions.width,
1973
2015
  height: constrainedDimensions.height
1974
2016
  });
1975
- const [fileUploadError, setFileUploadError] = (0, import_react13.useState)(null);
2017
+ const [fileUploadError, setFileUploadError] = (0, import_react14.useState)(null);
1976
2018
  const handleSelectFile = (file) => {
1977
2019
  setFileUploadError(null);
1978
2020
  if (!file) return;
@@ -2018,7 +2060,7 @@ var ImageDialog = ({
2018
2060
  }));
2019
2061
  };
2020
2062
  };
2021
- (0, import_react13.useEffect)(() => {
2063
+ (0, import_react14.useEffect)(() => {
2022
2064
  if (defaultFile) {
2023
2065
  handleSelectFile(defaultFile);
2024
2066
  }
@@ -2079,7 +2121,7 @@ var ImageDialog = ({
2079
2121
  });
2080
2122
  handleClose();
2081
2123
  } catch (error) {
2082
- setFileUploadError(error instanceof Error ? error : new Error(translations2.imageDialog.unknownError));
2124
+ setFileUploadError(error instanceof Error ? error : new Error(translations2.common.unknownError));
2083
2125
  } finally {
2084
2126
  setIsUploading(false);
2085
2127
  }
@@ -2107,27 +2149,27 @@ var ImageDialog = ({
2107
2149
  const dialogTitle = isAddMode ? translations2.imageDialog.addTitle : translations2.imageDialog.editTitle;
2108
2150
  const saveButtonText = isAddMode ? translations2.imageDialog.add : translations2.imageDialog.save;
2109
2151
  const dragPlaceholder = dragActive ? translations2.imageUpload.dragActive : translations2.imageUpload.dragInactive;
2110
- return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
2152
+ return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(
2111
2153
  CommonModal,
2112
2154
  {
2113
2155
  open,
2114
2156
  handleClose,
2115
2157
  children: [
2116
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("p", { className: "image-dialog-title", children: dialogTitle }),
2117
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("hr", { className: "image-dialog-divider" }),
2118
- /* @__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: [
2119
- hasImage ? /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "image-dialog-preview-wrapper", children: [
2120
- 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)(
2121
2163
  "button",
2122
2164
  {
2123
2165
  type: "button",
2124
2166
  className: "image-dialog-delete-button",
2125
2167
  onClick: clearImageFormFields,
2126
2168
  "aria-label": translations2.media.deleteImage,
2127
- children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(X_default, {})
2169
+ children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(X_default, {})
2128
2170
  }
2129
2171
  ),
2130
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
2172
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
2131
2173
  "img",
2132
2174
  {
2133
2175
  src: formState.fileUrl,
@@ -2137,7 +2179,7 @@ var ImageDialog = ({
2137
2179
  className: "image-dialog-preview"
2138
2180
  }
2139
2181
  )
2140
- ] }) : isAddMode && /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
2182
+ ] }) : isAddMode && /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(
2141
2183
  "div",
2142
2184
  {
2143
2185
  className: `image-dialog-drag-area ${dragActive ? "image-dialog-drag-area-active" : ""}`,
@@ -2147,7 +2189,7 @@ var ImageDialog = ({
2147
2189
  onDragLeave: handleDragLeave,
2148
2190
  onDrop: handleDrop,
2149
2191
  children: [
2150
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
2192
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
2151
2193
  "input",
2152
2194
  {
2153
2195
  type: "file",
@@ -2158,12 +2200,12 @@ var ImageDialog = ({
2158
2200
  accept: "image/*"
2159
2201
  }
2160
2202
  ),
2161
- /* @__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 })
2162
2204
  ]
2163
2205
  }
2164
2206
  ),
2165
- hasImage && /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(import_jsx_runtime67.Fragment, { children: [
2166
- /* @__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)(
2167
2209
  Input,
2168
2210
  {
2169
2211
  label: translations2.media.imageTitle,
@@ -2171,7 +2213,7 @@ var ImageDialog = ({
2171
2213
  onChange: (e) => setFormState((prev) => ({ ...prev, title: e.target.value }))
2172
2214
  }
2173
2215
  ),
2174
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
2216
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
2175
2217
  Input,
2176
2218
  {
2177
2219
  label: translations2.media.imageAlt,
@@ -2179,7 +2221,7 @@ var ImageDialog = ({
2179
2221
  onChange: (e) => setFormState((prev) => ({ ...prev, alt: e.target.value }))
2180
2222
  }
2181
2223
  ),
2182
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
2224
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
2183
2225
  Input,
2184
2226
  {
2185
2227
  label: translations2.imageDialog.captionLabel,
@@ -2190,21 +2232,16 @@ var ImageDialog = ({
2190
2232
  )
2191
2233
  ] })
2192
2234
  ] }) }),
2193
- fileUploadError && /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "image-dialog-error", children: [
2194
- fileUploadError.message || translations2.imageDialog.unknownError,
2195
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
2196
- "button",
2197
- {
2198
- type: "button",
2199
- className: "image-dialog-error-clear-button",
2200
- onClick: () => setFileUploadError(null),
2201
- "aria-label": translations2.imageDialog.clearError,
2202
- children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(X_default, {})
2203
- }
2204
- )
2205
- ] }),
2206
- /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "image-dialog-actions", children: [
2207
- /* @__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)(
2208
2245
  Button,
2209
2246
  {
2210
2247
  type: "button",
@@ -2214,7 +2251,7 @@ var ImageDialog = ({
2214
2251
  children: translations2.common.cancel
2215
2252
  }
2216
2253
  ),
2217
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
2254
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
2218
2255
  Button,
2219
2256
  {
2220
2257
  isLoading: isUploading,
@@ -2231,8 +2268,8 @@ var ImageDialog = ({
2231
2268
  };
2232
2269
 
2233
2270
  // src/editor/dialogs/add-katex-dialog/add-katex-dialog.tsx
2234
- var import_react14 = require("react");
2235
- var import_jsx_runtime68 = require("react/jsx-runtime");
2271
+ var import_react15 = require("react");
2272
+ var import_jsx_runtime69 = require("react/jsx-runtime");
2236
2273
  var AddKatexDialog = ({
2237
2274
  open,
2238
2275
  onClose,
@@ -2240,9 +2277,9 @@ var AddKatexDialog = ({
2240
2277
  initialContent = ""
2241
2278
  }) => {
2242
2279
  const translations2 = useTiptapTranslations();
2243
- const [content, setContent] = (0, import_react14.useState)(initialContent);
2244
- const contentInputRef = (0, import_react14.useRef)(null);
2245
- (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)(() => {
2246
2283
  if (open) {
2247
2284
  setContent(initialContent);
2248
2285
  setTimeout(() => {
@@ -2267,19 +2304,19 @@ var AddKatexDialog = ({
2267
2304
  handleSubmit();
2268
2305
  }
2269
2306
  };
2270
- return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(
2307
+ return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
2271
2308
  CommonModal,
2272
2309
  {
2273
2310
  open,
2274
2311
  handleClose,
2275
2312
  children: [
2276
- /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("p", { className: "katex-dialog-title", children: initialContent ? translations2.katex.editTitle : translations2.katex.addTitle }),
2277
- /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("hr", { className: "katex-dialog-divider" }),
2278
- /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "katex-dialog-content", children: [
2279
- /* @__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: [
2280
2317
  translations2.katex.description,
2281
2318
  " ",
2282
- /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
2319
+ /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
2283
2320
  "a",
2284
2321
  {
2285
2322
  href: "https://katex.org/docs/supported.html",
@@ -2291,8 +2328,8 @@ var AddKatexDialog = ({
2291
2328
  " ",
2292
2329
  translations2.katex.documentationLinkSuffix
2293
2330
  ] }),
2294
- /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "katex-dialog-form-group", children: [
2295
- /* @__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)(
2296
2333
  "label",
2297
2334
  {
2298
2335
  htmlFor: "katex-content",
@@ -2300,7 +2337,7 @@ var AddKatexDialog = ({
2300
2337
  children: translations2.katex.label
2301
2338
  }
2302
2339
  ),
2303
- /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
2340
+ /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
2304
2341
  "textarea",
2305
2342
  {
2306
2343
  ref: contentInputRef,
@@ -2315,8 +2352,8 @@ var AddKatexDialog = ({
2315
2352
  )
2316
2353
  ] })
2317
2354
  ] }),
2318
- /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "katex-dialog-actions", children: [
2319
- /* @__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)(
2320
2357
  "button",
2321
2358
  {
2322
2359
  className: "katex-dialog-button-cancel",
@@ -2325,7 +2362,7 @@ var AddKatexDialog = ({
2325
2362
  children: translations2.common.cancel
2326
2363
  }
2327
2364
  ),
2328
- /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
2365
+ /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
2329
2366
  "button",
2330
2367
  {
2331
2368
  className: "katex-dialog-button-submit",
@@ -2341,8 +2378,8 @@ var AddKatexDialog = ({
2341
2378
  };
2342
2379
 
2343
2380
  // src/editor/dialogs/add-link-dialog/add-link-dialog.tsx
2344
- var import_react15 = require("react");
2345
- var import_jsx_runtime69 = require("react/jsx-runtime");
2381
+ var import_react16 = require("react");
2382
+ var import_jsx_runtime70 = require("react/jsx-runtime");
2346
2383
  var AddLinkDialog = ({
2347
2384
  open,
2348
2385
  onClose,
@@ -2352,12 +2389,12 @@ var AddLinkDialog = ({
2352
2389
  const translations2 = useTiptapTranslations();
2353
2390
  const initialLinkTarget = linkDialogContext ? linkDialogContext.target === "_blank" : true;
2354
2391
  const initialLinkRel = linkDialogContext ? !!linkDialogContext.rel?.includes("noopener") : true;
2355
- const [title, setTitle] = (0, import_react15.useState)(linkDialogContext?.title);
2356
- const [url, setUrl] = (0, import_react15.useState)(linkDialogContext?.href);
2357
- const [openInNewTab, setOpenInNewTab] = (0, import_react15.useState)(initialLinkTarget);
2358
- const [addNoopener, setAddNoopener] = (0, import_react15.useState)(initialLinkRel);
2359
- const [error, setError] = (0, import_react15.useState)("");
2360
- 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);
2361
2398
  const clearDialogState = () => {
2362
2399
  setTitle(linkDialogContext?.title);
2363
2400
  setUrl(linkDialogContext?.href);
@@ -2365,7 +2402,7 @@ var AddLinkDialog = ({
2365
2402
  setAddNoopener(initialLinkRel);
2366
2403
  setError("");
2367
2404
  };
2368
- (0, import_react15.useEffect)(() => {
2405
+ (0, import_react16.useEffect)(() => {
2369
2406
  if (open) {
2370
2407
  clearDialogState();
2371
2408
  setTimeout(() => {
@@ -2422,17 +2459,17 @@ var AddLinkDialog = ({
2422
2459
  handleSubmit();
2423
2460
  }
2424
2461
  };
2425
- return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
2462
+ return /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(
2426
2463
  CommonModal,
2427
2464
  {
2428
2465
  open,
2429
2466
  handleClose,
2430
2467
  children: [
2431
- /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("p", { className: "link-dialog-title", children: linkDialogContext?.href ? translations2.link.editLink : translations2.link.addLink }),
2432
- /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("hr", { className: "link-dialog-divider" }),
2433
- /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "link-dialog-content", children: [
2434
- /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "link-dialog-form-group", children: [
2435
- /* @__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)(
2436
2473
  "label",
2437
2474
  {
2438
2475
  htmlFor: "link-title",
@@ -2440,7 +2477,7 @@ var AddLinkDialog = ({
2440
2477
  children: translations2.link.title
2441
2478
  }
2442
2479
  ),
2443
- /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
2480
+ /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
2444
2481
  "input",
2445
2482
  {
2446
2483
  ref: titleInputRef,
@@ -2454,8 +2491,8 @@ var AddLinkDialog = ({
2454
2491
  }
2455
2492
  )
2456
2493
  ] }),
2457
- /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "link-dialog-form-group", children: [
2458
- /* @__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)(
2459
2496
  "label",
2460
2497
  {
2461
2498
  htmlFor: "link-url",
@@ -2463,7 +2500,7 @@ var AddLinkDialog = ({
2463
2500
  children: translations2.link.url
2464
2501
  }
2465
2502
  ),
2466
- /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
2503
+ /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
2467
2504
  "input",
2468
2505
  {
2469
2506
  id: "link-url",
@@ -2476,9 +2513,9 @@ var AddLinkDialog = ({
2476
2513
  }
2477
2514
  )
2478
2515
  ] }),
2479
- /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "link-dialog-form-group", children: [
2480
- /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("label", { className: "link-dialog-checkbox-label", children: [
2481
- /* @__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)(
2482
2519
  "input",
2483
2520
  {
2484
2521
  type: "checkbox",
@@ -2486,13 +2523,13 @@ var AddLinkDialog = ({
2486
2523
  onChange: (e) => setOpenInNewTab(e.target.checked)
2487
2524
  }
2488
2525
  ),
2489
- /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { children: translations2.link.openInNewTab })
2526
+ /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("span", { children: translations2.link.openInNewTab })
2490
2527
  ] }),
2491
- /* @__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 })
2492
2529
  ] }),
2493
- /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "link-dialog-form-group", children: [
2494
- /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("label", { className: "link-dialog-checkbox-label", children: [
2495
- /* @__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)(
2496
2533
  "input",
2497
2534
  {
2498
2535
  type: "checkbox",
@@ -2500,14 +2537,14 @@ var AddLinkDialog = ({
2500
2537
  onChange: (e) => setAddNoopener(e.target.checked)
2501
2538
  }
2502
2539
  ),
2503
- /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { children: translations2.link.addNofollow })
2540
+ /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("span", { children: translations2.link.addNofollow })
2504
2541
  ] }),
2505
- /* @__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 })
2506
2543
  ] }),
2507
- error && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "link-dialog-error", children: error })
2544
+ error && /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(DialogError, { error })
2508
2545
  ] }),
2509
- /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "link-dialog-actions", children: [
2510
- /* @__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)(
2511
2548
  "button",
2512
2549
  {
2513
2550
  className: "link-dialog-button-cancel",
@@ -2516,7 +2553,7 @@ var AddLinkDialog = ({
2516
2553
  children: translations2.common.cancel
2517
2554
  }
2518
2555
  ),
2519
- /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
2556
+ /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
2520
2557
  "button",
2521
2558
  {
2522
2559
  className: "link-dialog-button-submit",
@@ -2532,7 +2569,7 @@ var AddLinkDialog = ({
2532
2569
  };
2533
2570
 
2534
2571
  // src/editor/dialogs/add-video-dialog/add-video-dialog.tsx
2535
- var import_react16 = require("react");
2572
+ var import_react17 = require("react");
2536
2573
 
2537
2574
  // src/utils/detect-video-hosting.ts
2538
2575
  var VIDEO_PATTERNS = {
@@ -2606,7 +2643,7 @@ var detectVideoHosting = (src) => {
2606
2643
  };
2607
2644
 
2608
2645
  // src/editor/dialogs/add-video-dialog/add-video-dialog.tsx
2609
- var import_jsx_runtime70 = require("react/jsx-runtime");
2646
+ var import_jsx_runtime71 = require("react/jsx-runtime");
2610
2647
  var SUPPORTED_PLATFORMS = {
2611
2648
  ["youtube" /* Youtube */]: "YouTube",
2612
2649
  ["vimeo" /* Vimeo */]: "Vimeo",
@@ -2615,11 +2652,11 @@ var SUPPORTED_PLATFORMS = {
2615
2652
  };
2616
2653
  var AddVideoDialog = ({ open, onClose, onVideoAdd }) => {
2617
2654
  const translations2 = useTiptapTranslations();
2618
- const [url, setUrl] = (0, import_react16.useState)("");
2619
- const [error, setError] = (0, import_react16.useState)("");
2620
- const [isValidating, setIsValidating] = (0, import_react16.useState)(false);
2621
- const urlInputRef = (0, import_react16.useRef)(null);
2622
- (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)(() => {
2623
2660
  if (open) {
2624
2661
  setUrl("");
2625
2662
  setError("");
@@ -2673,17 +2710,17 @@ var AddVideoDialog = ({ open, onClose, onVideoAdd }) => {
2673
2710
  handleSubmit();
2674
2711
  }
2675
2712
  };
2676
- return /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(
2713
+ return /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(
2677
2714
  CommonModal,
2678
2715
  {
2679
2716
  open,
2680
2717
  handleClose,
2681
2718
  children: [
2682
- /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("p", { className: "video-dialog-title", children: translations2.videoUpload.title }),
2683
- /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("hr", { className: "video-dialog-divider" }),
2684
- /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: "video-dialog-content", children: [
2685
- /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: "video-dialog-form-group", children: [
2686
- /* @__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)(
2687
2724
  "label",
2688
2725
  {
2689
2726
  htmlFor: "video-url",
@@ -2691,7 +2728,7 @@ var AddVideoDialog = ({ open, onClose, onVideoAdd }) => {
2691
2728
  children: translations2.videoUpload.urlLabel
2692
2729
  }
2693
2730
  ),
2694
- /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
2731
+ /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
2695
2732
  "input",
2696
2733
  {
2697
2734
  ref: urlInputRef,
@@ -2707,14 +2744,14 @@ var AddVideoDialog = ({ open, onClose, onVideoAdd }) => {
2707
2744
  }
2708
2745
  )
2709
2746
  ] }),
2710
- /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: "video-dialog-help-text", children: [
2711
- /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("p", { className: "video-dialog-help-title", children: translations2.videoUpload.supportedPlatforms }),
2712
- /* @__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)) })
2713
2750
  ] }),
2714
- error && /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { className: "video-dialog-error", children: error })
2751
+ error && /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(DialogError, { error })
2715
2752
  ] }),
2716
- /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: "video-dialog-actions", children: [
2717
- /* @__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)(
2718
2755
  "button",
2719
2756
  {
2720
2757
  className: "video-dialog-button-cancel",
@@ -2724,7 +2761,7 @@ var AddVideoDialog = ({ open, onClose, onVideoAdd }) => {
2724
2761
  children: translations2.videoUpload.cancel
2725
2762
  }
2726
2763
  ),
2727
- /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
2764
+ /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
2728
2765
  "button",
2729
2766
  {
2730
2767
  className: "video-dialog-button-submit",
@@ -2745,7 +2782,7 @@ var import_extension_mathematics = require("@tiptap/extension-mathematics");
2745
2782
  var import_extension_table = require("@tiptap/extension-table");
2746
2783
 
2747
2784
  // src/extensions/editor/callout.ts
2748
- var import_react28 = require("@tiptap/react");
2785
+ var import_react29 = require("@tiptap/react");
2749
2786
 
2750
2787
  // src/utils/handle-exit-node.ts
2751
2788
  var import_state = require("@tiptap/pm/state");
@@ -5106,28 +5143,28 @@ var BaseLegacyFigure = import_extension_image2.default.extend({
5106
5143
  });
5107
5144
 
5108
5145
  // src/extensions/views/node-views/callout.tsx
5109
- var import_react19 = require("@tiptap/react");
5110
- var import_react20 = require("react");
5146
+ var import_react20 = require("@tiptap/react");
5147
+ var import_react21 = require("react");
5111
5148
 
5112
5149
  // src/icons/color/TiptapCalloutError.tsx
5113
- var import_jsx_runtime71 = require("react/jsx-runtime");
5114
- 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: [
5115
- /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)("g", { clipPath: "url(#tiptap-callout-error_svg__a)", children: [
5116
- /* @__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)(
5117
5154
  "path",
5118
5155
  {
5119
5156
  fill: "#E03757",
5120
5157
  d: "M10 0C4.477 0 0 4.477 0 10s4.477 10 10 10 10-4.477 10-10S15.523 0 10 0"
5121
5158
  }
5122
5159
  ),
5123
- /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
5160
+ /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
5124
5161
  "path",
5125
5162
  {
5126
5163
  fill: "#F04760",
5127
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"
5128
5165
  }
5129
5166
  ),
5130
- /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
5167
+ /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
5131
5168
  "path",
5132
5169
  {
5133
5170
  fill: "#fff",
@@ -5135,28 +5172,28 @@ var SvgTiptapCalloutError = (props) => /* @__PURE__ */ (0, import_jsx_runtime71.
5135
5172
  }
5136
5173
  )
5137
5174
  ] }),
5138
- /* @__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" }) }) })
5139
5176
  ] });
5140
5177
  var TiptapCalloutError_default = SvgTiptapCalloutError;
5141
5178
 
5142
5179
  // src/icons/color/TiptapCalloutInfo.tsx
5143
- var import_jsx_runtime72 = require("react/jsx-runtime");
5144
- 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: [
5145
- /* @__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)(
5146
5183
  "path",
5147
5184
  {
5148
5185
  fill: "#FE9738",
5149
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"
5150
5187
  }
5151
5188
  ),
5152
- /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
5189
+ /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
5153
5190
  "path",
5154
5191
  {
5155
5192
  fill: "#FFD15B",
5156
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"
5157
5194
  }
5158
5195
  ),
5159
- /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
5196
+ /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
5160
5197
  "path",
5161
5198
  {
5162
5199
  fill: "#FFC344",
@@ -5167,66 +5204,66 @@ var SvgTiptapCalloutInfo = (props) => /* @__PURE__ */ (0, import_jsx_runtime72.j
5167
5204
  var TiptapCalloutInfo_default = SvgTiptapCalloutInfo;
5168
5205
 
5169
5206
  // src/icons/color/TiptapCalloutSuccess.tsx
5170
- var import_jsx_runtime73 = require("react/jsx-runtime");
5171
- 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: [
5172
- /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("g", { clipPath: "url(#tiptap-callout-success_svg__a)", children: [
5173
- /* @__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)(
5174
5211
  "path",
5175
5212
  {
5176
5213
  fill: "#35495E",
5177
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"
5178
5215
  }
5179
5216
  ),
5180
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
5217
+ /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
5181
5218
  "path",
5182
5219
  {
5183
5220
  fill: "#2C3E50",
5184
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"
5185
5222
  }
5186
5223
  ),
5187
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
5224
+ /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
5188
5225
  "path",
5189
5226
  {
5190
5227
  fill: "#F9EAB0",
5191
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"
5192
5229
  }
5193
5230
  ),
5194
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
5231
+ /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
5195
5232
  "path",
5196
5233
  {
5197
5234
  fill: "#E64C3C",
5198
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"
5199
5236
  }
5200
5237
  ),
5201
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
5238
+ /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
5202
5239
  "path",
5203
5240
  {
5204
5241
  fill: "#3F5C6C",
5205
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"
5206
5243
  }
5207
5244
  ),
5208
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
5245
+ /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
5209
5246
  "path",
5210
5247
  {
5211
5248
  fill: "#ECF0F1",
5212
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"
5213
5250
  }
5214
5251
  ),
5215
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
5252
+ /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
5216
5253
  "path",
5217
5254
  {
5218
5255
  fill: "#C03A2B",
5219
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"
5220
5257
  }
5221
5258
  ),
5222
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
5259
+ /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
5223
5260
  "path",
5224
5261
  {
5225
5262
  fill: "#802F34",
5226
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"
5227
5264
  }
5228
5265
  ),
5229
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
5266
+ /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
5230
5267
  "path",
5231
5268
  {
5232
5269
  fill: "#F9EAB0",
@@ -5234,14 +5271,14 @@ var SvgTiptapCalloutSuccess = (props) => /* @__PURE__ */ (0, import_jsx_runtime7
5234
5271
  }
5235
5272
  )
5236
5273
  ] }),
5237
- /* @__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" }) }) })
5238
5275
  ] });
5239
5276
  var TiptapCalloutSuccess_default = SvgTiptapCalloutSuccess;
5240
5277
 
5241
5278
  // src/icons/color/TiptapCalloutWarning.tsx
5242
- var import_jsx_runtime74 = require("react/jsx-runtime");
5243
- 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: [
5244
- /* @__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)(
5245
5282
  "path",
5246
5283
  {
5247
5284
  fill: "#FFF59D",
@@ -5249,29 +5286,29 @@ var SvgTiptapCalloutWarning = (props) => /* @__PURE__ */ (0, import_jsx_runtime7
5249
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"
5250
5287
  }
5251
5288
  ),
5252
- /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
5289
+ /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
5253
5290
  "path",
5254
5291
  {
5255
5292
  fill: "#FBC02D",
5256
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"
5257
5294
  }
5258
5295
  ),
5259
- /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
5296
+ /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
5260
5297
  "path",
5261
5298
  {
5262
5299
  fill: "#FFF59D",
5263
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"
5264
5301
  }
5265
5302
  ),
5266
- /* @__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" }),
5267
- /* @__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)(
5268
5305
  "path",
5269
5306
  {
5270
5307
  fill: "#9FA8DA",
5271
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"
5272
5309
  }
5273
5310
  ),
5274
- /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
5311
+ /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
5275
5312
  "path",
5276
5313
  {
5277
5314
  fill: "#5C6BC0",
@@ -5424,12 +5461,12 @@ var calloutCustomEmojis = [
5424
5461
  ];
5425
5462
 
5426
5463
  // src/extensions/views/components/callout.tsx
5427
- var import_jsx_runtime75 = require("react/jsx-runtime");
5464
+ var import_jsx_runtime76 = require("react/jsx-runtime");
5428
5465
  var calloutIcons = {
5429
- info: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(TiptapCalloutInfo_default, {}),
5430
- warning: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(TiptapCalloutWarning_default, {}),
5431
- success: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(TiptapCalloutSuccess_default, {}),
5432
- 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, {})
5433
5470
  };
5434
5471
  var legacyTypeMap3 = {
5435
5472
  question: "info",
@@ -5447,15 +5484,15 @@ var Callout = ({ type, bgColor, emoji: emoji2, children, iconWrapper, calloutTyp
5447
5484
  if (emoji2) {
5448
5485
  if (emoji2 in calloutIconComponents) {
5449
5486
  const IconComponent = calloutIconComponents[emoji2];
5450
- icon = /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(IconComponent, {});
5487
+ icon = /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(IconComponent, {});
5451
5488
  } else {
5452
5489
  icon = emoji2;
5453
5490
  }
5454
5491
  } else {
5455
5492
  icon = calloutIcons[finalType];
5456
5493
  }
5457
- const iconContent = iconWrapper ? iconWrapper(icon) : /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { className: "callout-icon", children: icon });
5458
- 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)(
5459
5496
  "div",
5460
5497
  {
5461
5498
  className,
@@ -5465,33 +5502,33 @@ var Callout = ({ type, bgColor, emoji: emoji2, children, iconWrapper, calloutTyp
5465
5502
  style,
5466
5503
  children: [
5467
5504
  iconContent,
5468
- /* @__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 }) })
5469
5506
  ]
5470
5507
  }
5471
5508
  );
5472
5509
  };
5473
5510
 
5474
5511
  // src/extensions/views/components/code-block.tsx
5475
- var import_react17 = require("react");
5512
+ var import_react18 = require("react");
5476
5513
  var import_xml2 = __toESM(require("highlight.js/lib/languages/xml"));
5477
5514
  var import_lowlight2 = require("lowlight");
5478
5515
 
5479
5516
  // src/extensions/views/components/copy-button.tsx
5480
- var import_jsx_runtime76 = require("react/jsx-runtime");
5517
+ var import_jsx_runtime77 = require("react/jsx-runtime");
5481
5518
  var CopyButton = ({ iconSize = 16, color = "black" }) => {
5482
- return /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(
5519
+ return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(
5483
5520
  "button",
5484
5521
  {
5485
5522
  className: `copy-button copy-icon-${color}`,
5486
5523
  "data-copy-action": "copy",
5487
5524
  type: "button",
5488
5525
  children: [
5489
- /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
5526
+ /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
5490
5527
  "span",
5491
5528
  {
5492
5529
  className: "copy-icon",
5493
5530
  "data-copy-icon": "default",
5494
- children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
5531
+ children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
5495
5532
  Copy_default,
5496
5533
  {
5497
5534
  width: iconSize,
@@ -5500,13 +5537,13 @@ var CopyButton = ({ iconSize = 16, color = "black" }) => {
5500
5537
  )
5501
5538
  }
5502
5539
  ),
5503
- /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
5540
+ /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
5504
5541
  "span",
5505
5542
  {
5506
5543
  className: "copy-icon-success",
5507
5544
  "data-copy-icon": "success",
5508
5545
  style: { display: "none" },
5509
- children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
5546
+ children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
5510
5547
  Check_default,
5511
5548
  {
5512
5549
  width: iconSize,
@@ -5521,7 +5558,7 @@ var CopyButton = ({ iconSize = 16, color = "black" }) => {
5521
5558
  };
5522
5559
 
5523
5560
  // src/extensions/views/components/code-block.tsx
5524
- var import_jsx_runtime77 = require("react/jsx-runtime");
5561
+ var import_jsx_runtime78 = require("react/jsx-runtime");
5525
5562
  var CodeBlock = ({
5526
5563
  language,
5527
5564
  isEditable,
@@ -5529,7 +5566,7 @@ var CodeBlock = ({
5529
5566
  children,
5530
5567
  translations: translations2
5531
5568
  }) => {
5532
- const languagesList = (0, import_react17.useMemo)(() => {
5569
+ const languagesList = (0, import_react18.useMemo)(() => {
5533
5570
  const lowlight2 = (0, import_lowlight2.createLowlight)(import_lowlight2.common);
5534
5571
  lowlight2.register("html", import_xml2.default);
5535
5572
  const list = lowlight2.listLanguages();
@@ -5538,17 +5575,17 @@ var CodeBlock = ({
5538
5575
  const handleChange = (e) => {
5539
5576
  onLanguageChange?.(e.target.value);
5540
5577
  };
5541
- return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: "tiptap-code-block-wrapper", children: [
5542
- /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: "tiptap-code-block-header", children: [
5543
- 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)(
5544
5581
  "select",
5545
5582
  {
5546
5583
  className: "tiptap-code-block-language-select",
5547
5584
  value: language,
5548
5585
  onChange: handleChange,
5549
5586
  children: [
5550
- /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("option", { value: "", children: translations2?.codeBlock.selectLanguage }),
5551
- 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)(
5552
5589
  "option",
5553
5590
  {
5554
5591
  value: lang,
@@ -5558,8 +5595,8 @@ var CodeBlock = ({
5558
5595
  ))
5559
5596
  ]
5560
5597
  }
5561
- ) : /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("span", { className: "tiptap-code-block-language-text", children: language || translations2?.codeBlock.selectLanguage }),
5562
- /* @__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)(
5563
5600
  CopyButton,
5564
5601
  {
5565
5602
  iconSize: 20,
@@ -5567,7 +5604,7 @@ var CodeBlock = ({
5567
5604
  }
5568
5605
  )
5569
5606
  ] }),
5570
- /* @__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)(
5571
5608
  "code",
5572
5609
  {
5573
5610
  className: "tiptap-code-block-content",
@@ -5579,22 +5616,22 @@ var CodeBlock = ({
5579
5616
  };
5580
5617
 
5581
5618
  // src/extensions/views/components/copyable-text.tsx
5582
- var import_jsx_runtime78 = require("react/jsx-runtime");
5619
+ var import_jsx_runtime79 = require("react/jsx-runtime");
5583
5620
  var CopyableText2 = ({ children }) => {
5584
- return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("span", { className: "copyable", children: [
5585
- /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("span", { "data-copy-content": true, children }),
5586
- /* @__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 })
5587
5624
  ] });
5588
5625
  };
5589
5626
 
5590
5627
  // src/extensions/views/components/custom-quote.tsx
5591
- var import_jsx_runtime79 = require("react/jsx-runtime");
5592
- var CustomQuote = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { "data-custom-quote": "", children: [
5593
- /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: "custom-quote-divider" }),
5594
- /* @__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, {}) }),
5595
5632
  children
5596
5633
  ] });
5597
- var CustomQuoteText = ({ children, isEmpty, placeholder }) => /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
5634
+ var CustomQuoteText = ({ children, isEmpty, placeholder }) => /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
5598
5635
  "div",
5599
5636
  {
5600
5637
  "data-custom-quote-text": true,
@@ -5603,7 +5640,7 @@ var CustomQuoteText = ({ children, isEmpty, placeholder }) => /* @__PURE__ */ (0
5603
5640
  children
5604
5641
  }
5605
5642
  );
5606
- var CustomQuoteAuthor = ({ children, isEmpty, placeholder }) => /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
5643
+ var CustomQuoteAuthor = ({ children, isEmpty, placeholder }) => /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
5607
5644
  "div",
5608
5645
  {
5609
5646
  "data-custom-quote-author": "",
@@ -5612,7 +5649,7 @@ var CustomQuoteAuthor = ({ children, isEmpty, placeholder }) => /* @__PURE__ */
5612
5649
  children
5613
5650
  }
5614
5651
  );
5615
- var CustomQuoteSign = ({ children, isEmpty, placeholder }) => /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
5652
+ var CustomQuoteSign = ({ children, isEmpty, placeholder }) => /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
5616
5653
  "div",
5617
5654
  {
5618
5655
  "data-custom-quote-sign": "",
@@ -5623,7 +5660,7 @@ var CustomQuoteSign = ({ children, isEmpty, placeholder }) => /* @__PURE__ */ (0
5623
5660
  );
5624
5661
 
5625
5662
  // src/extensions/views/components/figure.tsx
5626
- var import_jsx_runtime80 = require("react/jsx-runtime");
5663
+ var import_jsx_runtime81 = require("react/jsx-runtime");
5627
5664
  var Figure = ({
5628
5665
  src,
5629
5666
  alt,
@@ -5638,9 +5675,9 @@ var Figure = ({
5638
5675
  getImageById
5639
5676
  }) => {
5640
5677
  const resolvedSrc = resolveImageSrc({ fileId, src }, { getImageById });
5641
- return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("figure", { children: [
5642
- resolvedSrc && /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: "figure-image-container", children: [
5643
- /* @__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)(
5644
5681
  "img",
5645
5682
  {
5646
5683
  src: resolvedSrc,
@@ -5650,7 +5687,7 @@ var Figure = ({
5650
5687
  height: height || void 0
5651
5688
  }
5652
5689
  ),
5653
- isEditable && onEditClick && /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
5690
+ isEditable && onEditClick && /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
5654
5691
  "button",
5655
5692
  {
5656
5693
  type: "button",
@@ -5658,19 +5695,19 @@ var Figure = ({
5658
5695
  onClick: onEditClick,
5659
5696
  contentEditable: false,
5660
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",
5661
- children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Edit_default, {})
5698
+ children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(Edit_default, {})
5662
5699
  }
5663
5700
  )
5664
5701
  ] }),
5665
- caption && /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("figcaption", { children: caption }),
5702
+ caption && /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("figcaption", { children: caption }),
5666
5703
  children
5667
5704
  ] });
5668
5705
  };
5669
5706
 
5670
5707
  // src/extensions/views/components/prompt.tsx
5671
- var import_jsx_runtime81 = require("react/jsx-runtime");
5672
- var PromptHeader = ({ children, isEmpty, placeholder }) => /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: "prompt-header-wrapper", children: [
5673
- /* @__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)(
5674
5711
  "div",
5675
5712
  {
5676
5713
  className: isEmpty ? "is-empty" : "",
@@ -5678,7 +5715,7 @@ var PromptHeader = ({ children, isEmpty, placeholder }) => /* @__PURE__ */ (0, i
5678
5715
  children
5679
5716
  }
5680
5717
  ),
5681
- /* @__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)(
5682
5719
  CopyButton,
5683
5720
  {
5684
5721
  iconSize: 16,
@@ -5686,7 +5723,7 @@ var PromptHeader = ({ children, isEmpty, placeholder }) => /* @__PURE__ */ (0, i
5686
5723
  }
5687
5724
  ) })
5688
5725
  ] });
5689
- 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)(
5690
5727
  "div",
5691
5728
  {
5692
5729
  className: isEmpty ? "is-empty" : "",
@@ -5697,22 +5734,22 @@ var PromptContent = ({ children, isEmpty, placeholder }) => /* @__PURE__ */ (0,
5697
5734
  ) });
5698
5735
 
5699
5736
  // src/extensions/views/components/video.tsx
5700
- var import_jsx_runtime82 = require("react/jsx-runtime");
5737
+ var import_jsx_runtime83 = require("react/jsx-runtime");
5701
5738
  var Video = ({ src, children }) => {
5702
5739
  const videoInfo = detectVideoHosting(src);
5703
5740
  if (!videoInfo?.embedUrl) {
5704
- return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: "video-node", children: [
5705
- /* @__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" }) }),
5706
5743
  children
5707
5744
  ] });
5708
5745
  }
5709
- return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(
5746
+ return /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(
5710
5747
  "div",
5711
5748
  {
5712
5749
  className: "video-node",
5713
5750
  "data-video": "",
5714
5751
  children: [
5715
- /* @__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)(
5716
5753
  "iframe",
5717
5754
  {
5718
5755
  className: "video-iframe",
@@ -5729,13 +5766,13 @@ var Video = ({ src, children }) => {
5729
5766
  };
5730
5767
 
5731
5768
  // src/editor/controls/emoji-picker.tsx
5732
- var import_react18 = require("react");
5769
+ var import_react19 = require("react");
5733
5770
  var import_emoji_picker_react = __toESM(require("emoji-picker-react"));
5734
- var import_jsx_runtime83 = require("react/jsx-runtime");
5771
+ var import_jsx_runtime84 = require("react/jsx-runtime");
5735
5772
  var EmojiPickerComponent = ({ isOpen, onClose, onEmojiSelect }) => {
5736
- const pickerRef = (0, import_react18.useRef)(null);
5773
+ const pickerRef = (0, import_react19.useRef)(null);
5737
5774
  const translations2 = useTiptapTranslations();
5738
- (0, import_react18.useEffect)(() => {
5775
+ (0, import_react19.useEffect)(() => {
5739
5776
  const handleClickOutside = (event) => {
5740
5777
  if (pickerRef.current && !pickerRef.current.contains(event.target)) {
5741
5778
  onClose();
@@ -5749,12 +5786,12 @@ var EmojiPickerComponent = ({ isOpen, onClose, onEmojiSelect }) => {
5749
5786
  };
5750
5787
  }, [isOpen, onClose]);
5751
5788
  if (!isOpen) return null;
5752
- return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
5789
+ return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
5753
5790
  "div",
5754
5791
  {
5755
5792
  ref: pickerRef,
5756
5793
  className: "tiptap__emoji-picker-wrapper",
5757
- children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
5794
+ children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
5758
5795
  import_emoji_picker_react.default,
5759
5796
  {
5760
5797
  skinTonesDisabled: true,
@@ -5779,12 +5816,12 @@ var EmojiPickerComponent = ({ isOpen, onClose, onEmojiSelect }) => {
5779
5816
  };
5780
5817
 
5781
5818
  // src/extensions/views/node-views/callout.tsx
5782
- var import_jsx_runtime84 = require("react/jsx-runtime");
5819
+ var import_jsx_runtime85 = require("react/jsx-runtime");
5783
5820
  var CalloutView = (props) => {
5784
5821
  const type = props.node.attrs.type || "info";
5785
5822
  const bgColor = props.node.attrs.bgColor;
5786
5823
  const emoji2 = props.node.attrs.emoji;
5787
- const [showEmojiPicker, setShowEmojiPicker] = (0, import_react20.useState)(false);
5824
+ const [showEmojiPicker, setShowEmojiPicker] = (0, import_react21.useState)(false);
5788
5825
  const handleIconClick = (e) => {
5789
5826
  e.preventDefault();
5790
5827
  e.stopPropagation();
@@ -5794,23 +5831,23 @@ var CalloutView = (props) => {
5794
5831
  props.updateAttributes({ emoji: newEmoji });
5795
5832
  setShowEmojiPicker(false);
5796
5833
  };
5797
- 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)(
5798
5835
  Callout,
5799
5836
  {
5800
5837
  type,
5801
5838
  bgColor,
5802
5839
  emoji: emoji2,
5803
- iconWrapper: (icon) => /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { className: "callout-icon-wrapper", children: [
5804
- /* @__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)(
5805
5842
  "button",
5806
5843
  {
5807
5844
  className: "callout-icon-button",
5808
5845
  onClick: handleIconClick,
5809
5846
  type: "button",
5810
- 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 })
5811
5848
  }
5812
5849
  ),
5813
- /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
5850
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
5814
5851
  EmojiPickerComponent,
5815
5852
  {
5816
5853
  isOpen: showEmojiPicker,
@@ -5819,87 +5856,87 @@ var CalloutView = (props) => {
5819
5856
  }
5820
5857
  )
5821
5858
  ] }),
5822
- 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" })
5823
5860
  }
5824
5861
  ) });
5825
5862
  };
5826
5863
 
5827
5864
  // src/extensions/views/node-views/code-block.tsx
5828
- var import_react21 = require("react");
5829
- var import_react22 = require("@tiptap/react");
5830
- 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");
5831
5868
  var CodeBlockView = (props) => {
5832
- const [selectedLanguage, setSelectedLanguage] = (0, import_react21.useState)(props.node.attrs.language ?? "");
5869
+ const [selectedLanguage, setSelectedLanguage] = (0, import_react22.useState)(props.node.attrs.language ?? "");
5833
5870
  const translations2 = useTiptapTranslations();
5834
5871
  const handleLanguageChange = (language) => {
5835
5872
  props.updateAttributes({ language });
5836
5873
  setSelectedLanguage(language);
5837
5874
  };
5838
- 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)(
5839
5876
  CodeBlock,
5840
5877
  {
5841
5878
  language: selectedLanguage,
5842
5879
  isEditable: props.editor.isEditable,
5843
5880
  onLanguageChange: handleLanguageChange,
5844
5881
  translations: translations2,
5845
- children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_react22.NodeViewContent, {})
5882
+ children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_react23.NodeViewContent, {})
5846
5883
  }
5847
5884
  ) });
5848
5885
  };
5849
5886
 
5850
5887
  // src/extensions/views/node-views/copyable-text.tsx
5851
- var import_react23 = require("@tiptap/react");
5852
- var import_jsx_runtime86 = require("react/jsx-runtime");
5888
+ var import_react24 = require("@tiptap/react");
5889
+ var import_jsx_runtime87 = require("react/jsx-runtime");
5853
5890
  var CopyableTextView = () => {
5854
- 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, {}) });
5855
5892
  };
5856
5893
 
5857
5894
  // src/extensions/views/node-views/custom-quote.tsx
5858
- var import_react24 = require("@tiptap/react");
5859
- var import_jsx_runtime87 = require("react/jsx-runtime");
5895
+ var import_react25 = require("@tiptap/react");
5896
+ var import_jsx_runtime88 = require("react/jsx-runtime");
5860
5897
  var CustomQuoteView = () => {
5861
- 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, {}) }) });
5862
5899
  };
5863
5900
  var CustomQuoteTextView = (props) => {
5864
5901
  const isEmpty = !props.node.content.size;
5865
5902
  const translations2 = useTiptapTranslations();
5866
- 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)(
5867
5904
  CustomQuoteText,
5868
5905
  {
5869
5906
  isEmpty,
5870
5907
  placeholder: translations2.customQuote.textPlaceholder,
5871
- 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" : "" })
5872
5909
  }
5873
5910
  ) });
5874
5911
  };
5875
5912
  var CustomQuoteAuthorView = (props) => {
5876
5913
  const isEmpty = !props.node.content.size;
5877
5914
  const translations2 = useTiptapTranslations();
5878
- 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)(
5879
5916
  CustomQuoteAuthor,
5880
5917
  {
5881
5918
  isEmpty,
5882
5919
  placeholder: translations2.customQuote.authorPlaceholder,
5883
- 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" : "" })
5884
5921
  }
5885
5922
  ) });
5886
5923
  };
5887
5924
  var CustomQuoteSignView = (props) => {
5888
5925
  const isEmpty = !props.node.content.size;
5889
5926
  const translations2 = useTiptapTranslations();
5890
- 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)(
5891
5928
  CustomQuoteSign,
5892
5929
  {
5893
5930
  isEmpty,
5894
5931
  placeholder: translations2.customQuote.signPlaceholder,
5895
- 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" : "" })
5896
5933
  }
5897
5934
  ) });
5898
5935
  };
5899
5936
 
5900
5937
  // src/extensions/views/node-views/figure.tsx
5901
- var import_react25 = require("@tiptap/react");
5902
- var import_jsx_runtime88 = require("react/jsx-runtime");
5938
+ var import_react26 = require("@tiptap/react");
5939
+ var import_jsx_runtime89 = require("react/jsx-runtime");
5903
5940
  var FigureView = ({ node, getPos, editor }) => {
5904
5941
  const { fileId, src, alt, title, caption, width, height } = node.attrs;
5905
5942
  const imageExtension = editor.extensionManager.extensions.find((ext) => ext.name === "image");
@@ -5908,12 +5945,12 @@ var FigureView = ({ node, getPos, editor }) => {
5908
5945
  const handleEditClick = () => {
5909
5946
  onFigureClick?.(node.attrs, getPos());
5910
5947
  };
5911
- return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
5912
- import_react25.NodeViewWrapper,
5948
+ return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
5949
+ import_react26.NodeViewWrapper,
5913
5950
  {
5914
5951
  className: "figure-node-view",
5915
5952
  "data-drag-handle": true,
5916
- children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
5953
+ children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
5917
5954
  Figure,
5918
5955
  {
5919
5956
  fileId,
@@ -5933,40 +5970,40 @@ var FigureView = ({ node, getPos, editor }) => {
5933
5970
  };
5934
5971
 
5935
5972
  // src/extensions/views/node-views/prompt.tsx
5936
- var import_react26 = require("@tiptap/react");
5937
- var import_jsx_runtime89 = require("react/jsx-runtime");
5973
+ var import_react27 = require("@tiptap/react");
5974
+ var import_jsx_runtime90 = require("react/jsx-runtime");
5938
5975
  var PromptHeaderView = (props) => {
5939
5976
  const isEmpty = !props.node.content.size;
5940
5977
  const translations2 = useTiptapTranslations();
5941
- 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)(
5942
5979
  PromptHeader,
5943
5980
  {
5944
5981
  isEmpty,
5945
5982
  placeholder: translations2.prompt.headerPlaceholder,
5946
- 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" : "" })
5947
5984
  }
5948
5985
  ) });
5949
5986
  };
5950
5987
  var PromptContentView = (props) => {
5951
5988
  const isEmpty = !props.node.content.size;
5952
5989
  const translations2 = useTiptapTranslations();
5953
- 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)(
5954
5991
  PromptContent,
5955
5992
  {
5956
5993
  isEmpty,
5957
5994
  placeholder: translations2.prompt.contentPlaceholder,
5958
- 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" : "" })
5959
5996
  }
5960
5997
  ) });
5961
5998
  };
5962
5999
 
5963
6000
  // src/extensions/views/node-views/video.tsx
5964
- var import_react27 = require("@tiptap/react");
5965
- var import_jsx_runtime90 = require("react/jsx-runtime");
6001
+ var import_react28 = require("@tiptap/react");
6002
+ var import_jsx_runtime91 = require("react/jsx-runtime");
5966
6003
  var VideoView = (props) => {
5967
6004
  const { src } = props.node.attrs;
5968
- 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)(
5969
- 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,
5970
6007
  {
5971
6008
  as: "div",
5972
6009
  className: "video-content"
@@ -5977,66 +6014,66 @@ var VideoView = (props) => {
5977
6014
  // src/extensions/editor/callout.ts
5978
6015
  var Callout2 = BaseCallout.extend({
5979
6016
  addNodeView() {
5980
- return (0, import_react28.ReactNodeViewRenderer)(CalloutView);
6017
+ return (0, import_react29.ReactNodeViewRenderer)(CalloutView);
5981
6018
  }
5982
6019
  });
5983
6020
  var LegacyBookAlert = BaseLegacyBookAlert.extend({
5984
6021
  addNodeView() {
5985
- return (0, import_react28.ReactNodeViewRenderer)(CalloutView);
6022
+ return (0, import_react29.ReactNodeViewRenderer)(CalloutView);
5986
6023
  }
5987
6024
  });
5988
6025
  var LegacyBookTip = BaseLegacyBookTip.extend({
5989
6026
  addNodeView() {
5990
- return (0, import_react28.ReactNodeViewRenderer)(CalloutView);
6027
+ return (0, import_react29.ReactNodeViewRenderer)(CalloutView);
5991
6028
  }
5992
6029
  });
5993
6030
 
5994
6031
  // src/extensions/editor/code-block.ts
5995
- var import_react29 = require("@tiptap/react");
6032
+ var import_react30 = require("@tiptap/react");
5996
6033
  var CodeBlock2 = BaseCodeBlock.extend({
5997
6034
  addNodeView() {
5998
- return (0, import_react29.ReactNodeViewRenderer)(CodeBlockView);
6035
+ return (0, import_react30.ReactNodeViewRenderer)(CodeBlockView);
5999
6036
  }
6000
6037
  });
6001
6038
 
6002
6039
  // src/extensions/editor/custom-quote.ts
6003
- var import_react30 = require("@tiptap/react");
6040
+ var import_react31 = require("@tiptap/react");
6004
6041
  var CustomQuote2 = BaseCustomQuote.extend({
6005
6042
  addNodeView() {
6006
- return (0, import_react30.ReactNodeViewRenderer)(CustomQuoteView);
6043
+ return (0, import_react31.ReactNodeViewRenderer)(CustomQuoteView);
6007
6044
  }
6008
6045
  });
6009
6046
  var CustomQuoteText2 = BaseCustomQuoteText.extend({
6010
6047
  addNodeView() {
6011
- return (0, import_react30.ReactNodeViewRenderer)(CustomQuoteTextView);
6048
+ return (0, import_react31.ReactNodeViewRenderer)(CustomQuoteTextView);
6012
6049
  }
6013
6050
  });
6014
6051
  var CustomQuoteAuthor2 = BaseCustomQuoteAuthor.extend({
6015
6052
  addNodeView() {
6016
- return (0, import_react30.ReactNodeViewRenderer)(CustomQuoteAuthorView);
6053
+ return (0, import_react31.ReactNodeViewRenderer)(CustomQuoteAuthorView);
6017
6054
  }
6018
6055
  });
6019
6056
  var CustomQuoteSign2 = BaseCustomQuoteSign.extend({
6020
6057
  addNodeView() {
6021
- return (0, import_react30.ReactNodeViewRenderer)(CustomQuoteSignView);
6058
+ return (0, import_react31.ReactNodeViewRenderer)(CustomQuoteSignView);
6022
6059
  }
6023
6060
  });
6024
6061
  var LegacySEQuote = BaseLegacySEQuote.extend({
6025
6062
  addNodeView() {
6026
- return (0, import_react30.ReactNodeViewRenderer)(CustomQuoteView);
6063
+ return (0, import_react31.ReactNodeViewRenderer)(CustomQuoteView);
6027
6064
  }
6028
6065
  });
6029
6066
 
6030
6067
  // src/extensions/editor/video.ts
6031
- var import_react31 = require("@tiptap/react");
6068
+ var import_react32 = require("@tiptap/react");
6032
6069
  var Video2 = BaseVideo.extend({
6033
6070
  addNodeView() {
6034
- return (0, import_react31.ReactNodeViewRenderer)(VideoView);
6071
+ return (0, import_react32.ReactNodeViewRenderer)(VideoView);
6035
6072
  }
6036
6073
  });
6037
6074
  var LegacyYouTube = BaseLegacyYouTube.extend({
6038
6075
  addNodeView() {
6039
- return (0, import_react31.ReactNodeViewRenderer)(VideoView);
6076
+ return (0, import_react32.ReactNodeViewRenderer)(VideoView);
6040
6077
  }
6041
6078
  });
6042
6079
 
@@ -6445,44 +6482,44 @@ function getSharedExtensions() {
6445
6482
  }
6446
6483
 
6447
6484
  // src/extensions/editor/copyable-text.ts
6448
- var import_react32 = require("@tiptap/react");
6485
+ var import_react33 = require("@tiptap/react");
6449
6486
  var CopyableText3 = CopyableText.extend({
6450
6487
  addMarkView() {
6451
- return (0, import_react32.ReactMarkViewRenderer)(CopyableTextView);
6488
+ return (0, import_react33.ReactMarkViewRenderer)(CopyableTextView);
6452
6489
  }
6453
6490
  });
6454
6491
 
6455
6492
  // src/extensions/editor/prompt.ts
6456
- var import_react33 = require("@tiptap/react");
6493
+ var import_react34 = require("@tiptap/react");
6457
6494
  var PromptHeader2 = BasePromptHeader.extend({
6458
6495
  addNodeView() {
6459
- return (0, import_react33.ReactNodeViewRenderer)(PromptHeaderView);
6496
+ return (0, import_react34.ReactNodeViewRenderer)(PromptHeaderView);
6460
6497
  }
6461
6498
  });
6462
6499
  var PromptContent2 = BasePromptContent.extend({
6463
6500
  addNodeView() {
6464
- return (0, import_react33.ReactNodeViewRenderer)(PromptContentView);
6501
+ return (0, import_react34.ReactNodeViewRenderer)(PromptContentView);
6465
6502
  }
6466
6503
  });
6467
6504
  var LegacyPromptSEHeader = BaseLegacyPromptSEHeader.extend({
6468
6505
  addNodeView() {
6469
- return (0, import_react33.ReactNodeViewRenderer)(PromptHeaderView);
6506
+ return (0, import_react34.ReactNodeViewRenderer)(PromptHeaderView);
6470
6507
  }
6471
6508
  });
6472
6509
  var LegacyPromptSEContent = BaseLegacyPromptSEContent.extend({
6473
6510
  addNodeView() {
6474
- return (0, import_react33.ReactNodeViewRenderer)(PromptContentView);
6511
+ return (0, import_react34.ReactNodeViewRenderer)(PromptContentView);
6475
6512
  }
6476
6513
  });
6477
6514
 
6478
6515
  // src/extensions/editor/figure.ts
6479
- var import_react34 = require("@tiptap/react");
6516
+ var import_react35 = require("@tiptap/react");
6480
6517
  var import_core18 = require("@tiptap/core");
6481
6518
  var Figure2 = BaseFigure.extend({
6482
6519
  addNodeView() {
6483
6520
  const resizeOptions = this.options.resize;
6484
6521
  if (!resizeOptions) {
6485
- return (0, import_react34.ReactNodeViewRenderer)(FigureView);
6522
+ return (0, import_react35.ReactNodeViewRenderer)(FigureView);
6486
6523
  }
6487
6524
  return (props) => {
6488
6525
  const { node, getPos, editor } = props;
@@ -6647,7 +6684,7 @@ var Figure2 = BaseFigure.extend({
6647
6684
  });
6648
6685
  var LegacyFigure = BaseLegacyFigure.extend({
6649
6686
  addNodeView() {
6650
- return (0, import_react34.ReactNodeViewRenderer)(FigureView);
6687
+ return (0, import_react35.ReactNodeViewRenderer)(FigureView);
6651
6688
  }
6652
6689
  });
6653
6690
 
@@ -6813,7 +6850,7 @@ var createHandleKatexAdd = (editor, closeDialogCommand, savedPos) => {
6813
6850
  };
6814
6851
 
6815
6852
  // src/editor/handlers/insertion-handlers.ts
6816
- var import_react35 = require("react");
6853
+ var import_react36 = require("react");
6817
6854
 
6818
6855
  // src/editor/handlers/markup-insertion.ts
6819
6856
  var import_model2 = require("@tiptap/pm/model");
@@ -6899,9 +6936,9 @@ function applyUploadResultsToNodes(imagesToNodes, results) {
6899
6936
 
6900
6937
  // src/editor/handlers/insertion-handlers.ts
6901
6938
  function useInsertionHandlers(imageHandlers) {
6902
- const [insertedImage, setInsertedImage] = (0, import_react35.useState)(null);
6939
+ const [insertedImage, setInsertedImage] = (0, import_react36.useState)(null);
6903
6940
  const { activeDialog, openDialogCommand } = useDialogCommand();
6904
- (0, import_react35.useEffect)(() => {
6941
+ (0, import_react36.useEffect)(() => {
6905
6942
  if (insertedImage && !activeDialog) {
6906
6943
  setInsertedImage(null);
6907
6944
  }
@@ -6961,7 +6998,7 @@ function useInsertionHandlers(imageHandlers) {
6961
6998
  // src/editor/commands/suggestion.tsx
6962
6999
  var import_dom = require("@floating-ui/dom");
6963
7000
  var import_core19 = require("@tiptap/core");
6964
- var import_react36 = require("@tiptap/react");
7001
+ var import_react37 = require("@tiptap/react");
6965
7002
 
6966
7003
  // src/editor/commands/items.ts
6967
7004
  var getCommandItems = (translations2, hasImageHandlers) => [
@@ -7262,7 +7299,7 @@ var filterCommandItems = (items, query) => {
7262
7299
  };
7263
7300
 
7264
7301
  // src/editor/commands/suggestion.tsx
7265
- var import_jsx_runtime91 = require("react/jsx-runtime");
7302
+ var import_jsx_runtime92 = require("react/jsx-runtime");
7266
7303
  var component = null;
7267
7304
  var closeMenu = () => {
7268
7305
  if (component) {
@@ -7276,7 +7313,7 @@ var mapCommandMenuItemToCommandItem = (item) => {
7276
7313
  const IconComponent = item.icon;
7277
7314
  return {
7278
7315
  title: item.title,
7279
- icon: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(IconComponent, {}),
7316
+ icon: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(IconComponent, {}),
7280
7317
  command: ({ editor, range }) => {
7281
7318
  editor.chain().focus().deleteRange(range).run();
7282
7319
  item.onClick(editor);
@@ -7294,7 +7331,7 @@ var createSuggestions = (translations2, hasImageHandlers) => ({
7294
7331
  render: () => {
7295
7332
  return {
7296
7333
  onStart: async (props) => {
7297
- component = new import_react36.ReactRenderer(CommandsList, {
7334
+ component = new import_react37.ReactRenderer(CommandsList, {
7298
7335
  props,
7299
7336
  editor: props.editor
7300
7337
  });
@@ -7485,9 +7522,7 @@ var ru_default = {
7485
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...",
7486
7523
  save: "\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C",
7487
7524
  add: "\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C",
7488
- invalidFileType: "\u0424\u0430\u0439\u043B \u043D\u0435 \u044F\u0432\u043B\u044F\u0435\u0442\u0441\u044F \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435\u043C",
7489
- unknownError: "\u041D\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043D\u0430\u044F \u043E\u0448\u0438\u0431\u043A\u0430",
7490
- clearError: "\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u043E\u0448\u0438\u0431\u043A\u0443"
7525
+ invalidFileType: "\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0444\u043E\u0440\u043C\u0430\u0442 \u0444\u0430\u0439\u043B\u0430."
7491
7526
  },
7492
7527
  videoUpload: {
7493
7528
  title: "\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0432\u0438\u0434\u0435\u043E",
@@ -7532,7 +7567,9 @@ var ru_default = {
7532
7567
  words: ["\u0441\u043B\u043E\u0432\u043E", "\u0441\u043B\u043E\u0432\u0430", "\u0441\u043B\u043E\u0432"]
7533
7568
  },
7534
7569
  common: {
7535
- 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"
7536
7573
  }
7537
7574
  };
7538
7575
 
@@ -7652,9 +7689,7 @@ var en_default = {
7652
7689
  captionPlaceholder: "Description under image...",
7653
7690
  save: "Save",
7654
7691
  add: "Add",
7655
- invalidFileType: "File is not an image",
7656
- unknownError: "Unknown error",
7657
- clearError: "Clear error"
7692
+ invalidFileType: "Invalid file format."
7658
7693
  },
7659
7694
  videoUpload: {
7660
7695
  title: "Add video",
@@ -7699,7 +7734,9 @@ var en_default = {
7699
7734
  words: ["word", "words", "words"]
7700
7735
  },
7701
7736
  common: {
7702
- cancel: "Cancel"
7737
+ cancel: "Cancel",
7738
+ unknownError: "Unknown error",
7739
+ clearError: "Clear error"
7703
7740
  }
7704
7741
  };
7705
7742
 
@@ -7713,7 +7750,7 @@ function getTranslations(lang) {
7713
7750
  }
7714
7751
 
7715
7752
  // src/editor/editor.tsx
7716
- var import_jsx_runtime92 = require("react/jsx-runtime");
7753
+ var import_jsx_runtime93 = require("react/jsx-runtime");
7717
7754
  function TiptapContent({
7718
7755
  content,
7719
7756
  handleChange,
@@ -7723,18 +7760,18 @@ function TiptapContent({
7723
7760
  lang,
7724
7761
  error
7725
7762
  }) {
7726
- const [linkDialogContext, setLinkDialogContext] = (0, import_react37.useState)(null);
7727
- const [katexDialogContext, setKatexDialogContext] = (0, import_react37.useState)(
7763
+ const [linkDialogContext, setLinkDialogContext] = (0, import_react38.useState)(null);
7764
+ const [katexDialogContext, setKatexDialogContext] = (0, import_react38.useState)(
7728
7765
  null
7729
7766
  );
7730
- const [editFigureContext, setEditFigureContext] = (0, import_react37.useState)(null);
7731
- const [savedDialogCursorPos, setSavedDialogCursorPos] = (0, import_react37.useState)(void 0);
7732
- 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)(
7733
7770
  void 0
7734
7771
  );
7735
7772
  const { activeDialog, closeDialogCommand, openDialogCommand } = useDialogCommand();
7736
7773
  const translations2 = useTiptapTranslations();
7737
- const [isDisabledInternal, setIsDisabledInternal] = (0, import_react37.useState)(isDisabled);
7774
+ const [isDisabledInternal, setIsDisabledInternal] = (0, import_react38.useState)(isDisabled);
7738
7775
  const disabled = isDisabled || isDisabledInternal;
7739
7776
  let safeContent;
7740
7777
  try {
@@ -7748,7 +7785,7 @@ function TiptapContent({
7748
7785
  onDrop,
7749
7786
  onMarkupInsertion
7750
7787
  } = useInsertionHandlers(imageHandlers);
7751
- const editor = (0, import_react38.useEditor)(
7788
+ const editor = (0, import_react39.useEditor)(
7752
7789
  {
7753
7790
  editable: isEditable && !disabled,
7754
7791
  extensions: getEditorExtensions({
@@ -7812,7 +7849,7 @@ function TiptapContent({
7812
7849
  },
7813
7850
  [lang]
7814
7851
  );
7815
- (0, import_react37.useEffect)(() => {
7852
+ (0, import_react38.useEffect)(() => {
7816
7853
  if (activeDialog && editor && !editor.isDestroyed) {
7817
7854
  const { from, to } = editor.state.selection;
7818
7855
  setSavedDialogCursorPos(from);
@@ -7841,7 +7878,7 @@ function TiptapContent({
7841
7878
  const katexHandler = createHandleKatexAdd(editor, handleCloseDialog, savedDialogCursorPos);
7842
7879
  katexHandler(latex, katexDialogContext?.pos);
7843
7880
  };
7844
- (0, import_react37.useEffect)(() => {
7881
+ (0, import_react38.useEffect)(() => {
7845
7882
  if (!editor || editor.isDestroyed) return;
7846
7883
  editor.commands.setContent(safeContent, {
7847
7884
  emitUpdate: false
@@ -7860,16 +7897,16 @@ function TiptapContent({
7860
7897
  return true;
7861
7898
  };
7862
7899
  if (!editor) return null;
7863
- return /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(import_jsx_runtime92.Fragment, { children: [
7864
- /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(DragHandle, { editor }),
7865
- isEditable && !disabled && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(TableMenu, { editor }),
7866
- 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)(
7867
7904
  import_menus.BubbleMenu,
7868
7905
  {
7869
7906
  shouldShow: shouldBubbleMenuShow,
7870
7907
  editor,
7871
7908
  options: { placement: "bottom", offset: 8, flip: true },
7872
- children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
7909
+ children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
7873
7910
  BubbleMenuContent,
7874
7911
  {
7875
7912
  editor,
@@ -7878,19 +7915,19 @@ function TiptapContent({
7878
7915
  )
7879
7916
  }
7880
7917
  ),
7881
- /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(
7918
+ /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(
7882
7919
  "div",
7883
7920
  {
7884
7921
  className: `tiptap-content-wrapper ${!!error ? "has-error" : ""} ${disabled ? "is-disabled" : ""}`,
7885
7922
  children: [
7886
- /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(import_react38.EditorContent, { editor }),
7887
- 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 })
7888
7925
  ]
7889
7926
  }
7890
7927
  ),
7891
- !!error && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("p", { className: "tiptap-error-message", children: error }),
7892
- isEditable && /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(import_jsx_runtime92.Fragment, { children: [
7893
- 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)(
7894
7931
  ImageDialog,
7895
7932
  {
7896
7933
  open: true,
@@ -7904,7 +7941,7 @@ function TiptapContent({
7904
7941
  mode: editFigureContext ? "edit" : "add"
7905
7942
  }
7906
7943
  ),
7907
- activeDialog === "link" && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
7944
+ activeDialog === "link" && /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
7908
7945
  AddLinkDialog,
7909
7946
  {
7910
7947
  open: true,
@@ -7913,7 +7950,7 @@ function TiptapContent({
7913
7950
  linkDialogContext
7914
7951
  }
7915
7952
  ),
7916
- activeDialog === "video" && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
7953
+ activeDialog === "video" && /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
7917
7954
  AddVideoDialog,
7918
7955
  {
7919
7956
  open: true,
@@ -7921,7 +7958,7 @@ function TiptapContent({
7921
7958
  onVideoAdd: handleVideoAdd
7922
7959
  }
7923
7960
  ),
7924
- activeDialog === "katex" && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
7961
+ activeDialog === "katex" && /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
7925
7962
  AddKatexDialog,
7926
7963
  {
7927
7964
  open: true,
@@ -7936,7 +7973,7 @@ function TiptapContent({
7936
7973
  var Tiptap = (props) => {
7937
7974
  const { lang = "ru" } = props;
7938
7975
  const translations2 = getTranslations(lang);
7939
- 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 }) }) });
7940
7977
  };
7941
7978
 
7942
7979
  // src/utils/html-to-tiptap-content.ts