@cyberyozh/text-editor 0.3.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/editor.css +37 -16
- package/dist/editor.css.map +1 -1
- package/dist/editor.d.mts +5 -1
- package/dist/editor.d.ts +5 -1
- package/dist/editor.js +367 -297
- package/dist/editor.js.map +1 -1
- package/dist/editor.mjs +286 -216
- package/dist/editor.mjs.map +1 -1
- package/dist/styles/index.css +37 -16
- package/package.json +1 -1
- package/src/editor/components/dialog-error/dialog-error.css +35 -0
- package/src/editor/components/dialog-error/dialog-error.tsx +65 -0
- package/src/editor/components/dialog-error/index.ts +1 -0
- package/src/editor/components/index.ts +1 -0
- package/src/editor/dialogs/add-link-dialog/add-link-dialog.css +0 -9
- package/src/editor/dialogs/add-link-dialog/add-link-dialog.tsx +2 -2
- package/src/editor/dialogs/add-video-dialog/add-video-dialog.css +0 -9
- package/src/editor/dialogs/add-video-dialog/add-video-dialog.tsx +2 -2
- package/src/editor/dialogs/image-dialog/image-dialog.css +4 -0
- package/src/editor/dialogs/image-dialog/image-dialog.tsx +28 -2
- package/src/editor/handlers/insertion-handlers.ts +1 -2
- package/src/editor/index.ts +1 -0
- package/src/styles/components.css +1 -0
- package/src/translations/en.json +5 -2
- package/src/translations/ru.json +5 -2
- package/src/types/common.ts +3 -0
- package/src/types/index.ts +1 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/is-combined-error.ts +9 -0
package/dist/editor.mjs
CHANGED
|
@@ -1446,6 +1446,11 @@ function pluralize(count, forms) {
|
|
|
1446
1446
|
return forms[2];
|
|
1447
1447
|
}
|
|
1448
1448
|
|
|
1449
|
+
// src/utils/is-combined-error.ts
|
|
1450
|
+
function isCombinedError(error) {
|
|
1451
|
+
return error instanceof Error && Array.isArray(error?.cause) && error.cause.length > 0 && error.cause.every((e) => e instanceof Error);
|
|
1452
|
+
}
|
|
1453
|
+
|
|
1449
1454
|
// src/editor/controls/character-count.tsx
|
|
1450
1455
|
import { jsx as jsx62, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1451
1456
|
var CharacterCount = ({ editor }) => {
|
|
@@ -1861,6 +1866,43 @@ var CommonModal = ({ open, handleClose, children }) => {
|
|
|
1861
1866
|
);
|
|
1862
1867
|
};
|
|
1863
1868
|
|
|
1869
|
+
// src/editor/components/dialog-error/dialog-error.tsx
|
|
1870
|
+
import { useMemo } from "react";
|
|
1871
|
+
import { jsx as jsx67, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
1872
|
+
var DialogError = ({ error, onClose, className }) => {
|
|
1873
|
+
const translations2 = useTiptapTranslations();
|
|
1874
|
+
const renderedMessage = useMemo(() => {
|
|
1875
|
+
if (typeof error === "string") {
|
|
1876
|
+
return error || translations2.common.unknownError;
|
|
1877
|
+
}
|
|
1878
|
+
if (isCombinedError(error)) {
|
|
1879
|
+
const safeErrors = error.cause.filter((e) => Boolean(e.message));
|
|
1880
|
+
const errorsToDisplay = safeErrors.length === error.cause.length ? safeErrors : [new Error(translations2.common.unknownError), ...safeErrors];
|
|
1881
|
+
if (errorsToDisplay.length === 1) {
|
|
1882
|
+
return errorsToDisplay[0].message;
|
|
1883
|
+
}
|
|
1884
|
+
return /* @__PURE__ */ jsx67("ul", { className: "dialog-error-list", children: errorsToDisplay.map((cause, index) => /* @__PURE__ */ jsx67("li", { children: cause.message }, `${index}_${cause.message}`)) });
|
|
1885
|
+
}
|
|
1886
|
+
if (error instanceof Error) {
|
|
1887
|
+
return error.message || translations2.common.unknownError;
|
|
1888
|
+
}
|
|
1889
|
+
return translations2.common.unknownError;
|
|
1890
|
+
}, [error, translations2]);
|
|
1891
|
+
return /* @__PURE__ */ jsxs18("div", { className: `dialog-error ${className || ""}`, children: [
|
|
1892
|
+
renderedMessage,
|
|
1893
|
+
onClose && /* @__PURE__ */ jsx67(
|
|
1894
|
+
"button",
|
|
1895
|
+
{
|
|
1896
|
+
type: "button",
|
|
1897
|
+
className: "dialog-error-clear-button",
|
|
1898
|
+
onClick: onClose,
|
|
1899
|
+
"aria-label": translations2.common.clearError,
|
|
1900
|
+
children: /* @__PURE__ */ jsx67(X_default, {})
|
|
1901
|
+
}
|
|
1902
|
+
)
|
|
1903
|
+
] });
|
|
1904
|
+
};
|
|
1905
|
+
|
|
1864
1906
|
// src/utils/image-src-resolver.ts
|
|
1865
1907
|
function resolveImageSrc(attrs, options) {
|
|
1866
1908
|
const { fileId, src } = attrs;
|
|
@@ -1884,7 +1926,7 @@ function resolveImageSrc(attrs, options) {
|
|
|
1884
1926
|
}
|
|
1885
1927
|
|
|
1886
1928
|
// src/editor/dialogs/image-dialog/image-dialog.tsx
|
|
1887
|
-
import { Fragment as Fragment2, jsx as
|
|
1929
|
+
import { Fragment as Fragment2, jsx as jsx68, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
1888
1930
|
var ImageDialog = ({
|
|
1889
1931
|
open,
|
|
1890
1932
|
onClose,
|
|
@@ -1935,11 +1977,20 @@ var ImageDialog = ({
|
|
|
1935
1977
|
width: constrainedDimensions.width,
|
|
1936
1978
|
height: constrainedDimensions.height
|
|
1937
1979
|
});
|
|
1980
|
+
const [fileUploadError, setFileUploadError] = useState6(null);
|
|
1938
1981
|
const handleSelectFile = (file) => {
|
|
1982
|
+
setFileUploadError(null);
|
|
1939
1983
|
if (!file) return;
|
|
1984
|
+
if (!file.type.startsWith("image/")) {
|
|
1985
|
+
setFileUploadError(new Error(translations2.imageDialog.invalidFileType));
|
|
1986
|
+
return;
|
|
1987
|
+
}
|
|
1940
1988
|
const imageUrl = URL.createObjectURL(file);
|
|
1941
1989
|
const img = new Image();
|
|
1942
1990
|
img.src = imageUrl;
|
|
1991
|
+
img.onerror = () => {
|
|
1992
|
+
setFileUploadError(new Error(translations2.imageDialog.invalidFileType));
|
|
1993
|
+
};
|
|
1943
1994
|
img.onload = () => {
|
|
1944
1995
|
const naturalWidth = img.width;
|
|
1945
1996
|
const naturalHeight = img.height;
|
|
@@ -2032,6 +2083,8 @@ var ImageDialog = ({
|
|
|
2032
2083
|
storageKey: result.storageKey
|
|
2033
2084
|
});
|
|
2034
2085
|
handleClose();
|
|
2086
|
+
} catch (error) {
|
|
2087
|
+
setFileUploadError(error instanceof Error ? error : new Error(translations2.common.unknownError));
|
|
2035
2088
|
} finally {
|
|
2036
2089
|
setIsUploading(false);
|
|
2037
2090
|
}
|
|
@@ -2047,7 +2100,9 @@ var ImageDialog = ({
|
|
|
2047
2100
|
});
|
|
2048
2101
|
handleClose();
|
|
2049
2102
|
};
|
|
2050
|
-
const
|
|
2103
|
+
const isEditMode = mode === "edit";
|
|
2104
|
+
const canSave = isEditMode || Boolean(formState.file);
|
|
2105
|
+
const handleSave = isEditMode ? handleEditImage : handleAddImage;
|
|
2051
2106
|
const handleClose = () => {
|
|
2052
2107
|
clearImageFormFields();
|
|
2053
2108
|
onClose();
|
|
@@ -2057,27 +2112,27 @@ var ImageDialog = ({
|
|
|
2057
2112
|
const dialogTitle = isAddMode ? translations2.imageDialog.addTitle : translations2.imageDialog.editTitle;
|
|
2058
2113
|
const saveButtonText = isAddMode ? translations2.imageDialog.add : translations2.imageDialog.save;
|
|
2059
2114
|
const dragPlaceholder = dragActive ? translations2.imageUpload.dragActive : translations2.imageUpload.dragInactive;
|
|
2060
|
-
return /* @__PURE__ */
|
|
2115
|
+
return /* @__PURE__ */ jsxs19(
|
|
2061
2116
|
CommonModal,
|
|
2062
2117
|
{
|
|
2063
2118
|
open,
|
|
2064
2119
|
handleClose,
|
|
2065
2120
|
children: [
|
|
2066
|
-
/* @__PURE__ */
|
|
2067
|
-
/* @__PURE__ */
|
|
2068
|
-
/* @__PURE__ */
|
|
2069
|
-
hasImage ? /* @__PURE__ */
|
|
2070
|
-
isAddMode && /* @__PURE__ */
|
|
2121
|
+
/* @__PURE__ */ jsx68("p", { className: "image-dialog-title", children: dialogTitle }),
|
|
2122
|
+
/* @__PURE__ */ jsx68("hr", { className: "image-dialog-divider" }),
|
|
2123
|
+
/* @__PURE__ */ jsx68("div", { className: "image-dialog-form-container", children: /* @__PURE__ */ jsxs19("div", { className: "image-dialog-form", children: [
|
|
2124
|
+
hasImage ? /* @__PURE__ */ jsxs19("div", { className: "image-dialog-preview-wrapper", children: [
|
|
2125
|
+
isAddMode && /* @__PURE__ */ jsx68(
|
|
2071
2126
|
"button",
|
|
2072
2127
|
{
|
|
2073
2128
|
type: "button",
|
|
2074
2129
|
className: "image-dialog-delete-button",
|
|
2075
2130
|
onClick: clearImageFormFields,
|
|
2076
2131
|
"aria-label": translations2.media.deleteImage,
|
|
2077
|
-
children: /* @__PURE__ */
|
|
2132
|
+
children: /* @__PURE__ */ jsx68(X_default, {})
|
|
2078
2133
|
}
|
|
2079
2134
|
),
|
|
2080
|
-
/* @__PURE__ */
|
|
2135
|
+
/* @__PURE__ */ jsx68(
|
|
2081
2136
|
"img",
|
|
2082
2137
|
{
|
|
2083
2138
|
src: formState.fileUrl,
|
|
@@ -2087,7 +2142,7 @@ var ImageDialog = ({
|
|
|
2087
2142
|
className: "image-dialog-preview"
|
|
2088
2143
|
}
|
|
2089
2144
|
)
|
|
2090
|
-
] }) : isAddMode && /* @__PURE__ */
|
|
2145
|
+
] }) : isAddMode && /* @__PURE__ */ jsxs19(
|
|
2091
2146
|
"div",
|
|
2092
2147
|
{
|
|
2093
2148
|
className: `image-dialog-drag-area ${dragActive ? "image-dialog-drag-area-active" : ""}`,
|
|
@@ -2097,7 +2152,7 @@ var ImageDialog = ({
|
|
|
2097
2152
|
onDragLeave: handleDragLeave,
|
|
2098
2153
|
onDrop: handleDrop,
|
|
2099
2154
|
children: [
|
|
2100
|
-
/* @__PURE__ */
|
|
2155
|
+
/* @__PURE__ */ jsx68(
|
|
2101
2156
|
"input",
|
|
2102
2157
|
{
|
|
2103
2158
|
type: "file",
|
|
@@ -2108,12 +2163,12 @@ var ImageDialog = ({
|
|
|
2108
2163
|
accept: "image/*"
|
|
2109
2164
|
}
|
|
2110
2165
|
),
|
|
2111
|
-
/* @__PURE__ */
|
|
2166
|
+
/* @__PURE__ */ jsx68("p", { style: { textAlign: "center" }, children: dragPlaceholder })
|
|
2112
2167
|
]
|
|
2113
2168
|
}
|
|
2114
2169
|
),
|
|
2115
|
-
hasImage && /* @__PURE__ */
|
|
2116
|
-
/* @__PURE__ */
|
|
2170
|
+
hasImage && /* @__PURE__ */ jsxs19(Fragment2, { children: [
|
|
2171
|
+
/* @__PURE__ */ jsx68(
|
|
2117
2172
|
Input,
|
|
2118
2173
|
{
|
|
2119
2174
|
label: translations2.media.imageTitle,
|
|
@@ -2121,7 +2176,7 @@ var ImageDialog = ({
|
|
|
2121
2176
|
onChange: (e) => setFormState((prev) => ({ ...prev, title: e.target.value }))
|
|
2122
2177
|
}
|
|
2123
2178
|
),
|
|
2124
|
-
/* @__PURE__ */
|
|
2179
|
+
/* @__PURE__ */ jsx68(
|
|
2125
2180
|
Input,
|
|
2126
2181
|
{
|
|
2127
2182
|
label: translations2.media.imageAlt,
|
|
@@ -2129,7 +2184,7 @@ var ImageDialog = ({
|
|
|
2129
2184
|
onChange: (e) => setFormState((prev) => ({ ...prev, alt: e.target.value }))
|
|
2130
2185
|
}
|
|
2131
2186
|
),
|
|
2132
|
-
/* @__PURE__ */
|
|
2187
|
+
/* @__PURE__ */ jsx68(
|
|
2133
2188
|
Input,
|
|
2134
2189
|
{
|
|
2135
2190
|
label: translations2.imageDialog.captionLabel,
|
|
@@ -2140,8 +2195,16 @@ var ImageDialog = ({
|
|
|
2140
2195
|
)
|
|
2141
2196
|
] })
|
|
2142
2197
|
] }) }),
|
|
2143
|
-
/* @__PURE__ */
|
|
2144
|
-
|
|
2198
|
+
fileUploadError && /* @__PURE__ */ jsx68(
|
|
2199
|
+
DialogError,
|
|
2200
|
+
{
|
|
2201
|
+
error: fileUploadError,
|
|
2202
|
+
onClose: () => setFileUploadError(null),
|
|
2203
|
+
className: "image-dialog-error-spacing"
|
|
2204
|
+
}
|
|
2205
|
+
),
|
|
2206
|
+
/* @__PURE__ */ jsxs19("div", { className: "image-dialog-actions", children: [
|
|
2207
|
+
/* @__PURE__ */ jsx68(
|
|
2145
2208
|
Button,
|
|
2146
2209
|
{
|
|
2147
2210
|
type: "button",
|
|
@@ -2151,12 +2214,13 @@ var ImageDialog = ({
|
|
|
2151
2214
|
children: translations2.common.cancel
|
|
2152
2215
|
}
|
|
2153
2216
|
),
|
|
2154
|
-
/* @__PURE__ */
|
|
2217
|
+
/* @__PURE__ */ jsx68(
|
|
2155
2218
|
Button,
|
|
2156
2219
|
{
|
|
2157
2220
|
isLoading: isUploading,
|
|
2158
2221
|
type: "button",
|
|
2159
2222
|
onClick: handleSave,
|
|
2223
|
+
disabled: !canSave,
|
|
2160
2224
|
children: saveButtonText
|
|
2161
2225
|
}
|
|
2162
2226
|
)
|
|
@@ -2168,7 +2232,7 @@ var ImageDialog = ({
|
|
|
2168
2232
|
|
|
2169
2233
|
// src/editor/dialogs/add-katex-dialog/add-katex-dialog.tsx
|
|
2170
2234
|
import { useEffect as useEffect6, useRef as useRef7, useState as useState7 } from "react";
|
|
2171
|
-
import { jsx as
|
|
2235
|
+
import { jsx as jsx69, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
2172
2236
|
var AddKatexDialog = ({
|
|
2173
2237
|
open,
|
|
2174
2238
|
onClose,
|
|
@@ -2203,19 +2267,19 @@ var AddKatexDialog = ({
|
|
|
2203
2267
|
handleSubmit();
|
|
2204
2268
|
}
|
|
2205
2269
|
};
|
|
2206
|
-
return /* @__PURE__ */
|
|
2270
|
+
return /* @__PURE__ */ jsxs20(
|
|
2207
2271
|
CommonModal,
|
|
2208
2272
|
{
|
|
2209
2273
|
open,
|
|
2210
2274
|
handleClose,
|
|
2211
2275
|
children: [
|
|
2212
|
-
/* @__PURE__ */
|
|
2213
|
-
/* @__PURE__ */
|
|
2214
|
-
/* @__PURE__ */
|
|
2215
|
-
/* @__PURE__ */
|
|
2276
|
+
/* @__PURE__ */ jsx69("p", { className: "katex-dialog-title", children: initialContent ? translations2.katex.editTitle : translations2.katex.addTitle }),
|
|
2277
|
+
/* @__PURE__ */ jsx69("hr", { className: "katex-dialog-divider" }),
|
|
2278
|
+
/* @__PURE__ */ jsxs20("div", { className: "katex-dialog-content", children: [
|
|
2279
|
+
/* @__PURE__ */ jsxs20("p", { className: "katex-dialog-description", children: [
|
|
2216
2280
|
translations2.katex.description,
|
|
2217
2281
|
" ",
|
|
2218
|
-
/* @__PURE__ */
|
|
2282
|
+
/* @__PURE__ */ jsx69(
|
|
2219
2283
|
"a",
|
|
2220
2284
|
{
|
|
2221
2285
|
href: "https://katex.org/docs/supported.html",
|
|
@@ -2227,8 +2291,8 @@ var AddKatexDialog = ({
|
|
|
2227
2291
|
" ",
|
|
2228
2292
|
translations2.katex.documentationLinkSuffix
|
|
2229
2293
|
] }),
|
|
2230
|
-
/* @__PURE__ */
|
|
2231
|
-
/* @__PURE__ */
|
|
2294
|
+
/* @__PURE__ */ jsxs20("div", { className: "katex-dialog-form-group", children: [
|
|
2295
|
+
/* @__PURE__ */ jsx69(
|
|
2232
2296
|
"label",
|
|
2233
2297
|
{
|
|
2234
2298
|
htmlFor: "katex-content",
|
|
@@ -2236,7 +2300,7 @@ var AddKatexDialog = ({
|
|
|
2236
2300
|
children: translations2.katex.label
|
|
2237
2301
|
}
|
|
2238
2302
|
),
|
|
2239
|
-
/* @__PURE__ */
|
|
2303
|
+
/* @__PURE__ */ jsx69(
|
|
2240
2304
|
"textarea",
|
|
2241
2305
|
{
|
|
2242
2306
|
ref: contentInputRef,
|
|
@@ -2251,8 +2315,8 @@ var AddKatexDialog = ({
|
|
|
2251
2315
|
)
|
|
2252
2316
|
] })
|
|
2253
2317
|
] }),
|
|
2254
|
-
/* @__PURE__ */
|
|
2255
|
-
/* @__PURE__ */
|
|
2318
|
+
/* @__PURE__ */ jsxs20("div", { className: "katex-dialog-actions", children: [
|
|
2319
|
+
/* @__PURE__ */ jsx69(
|
|
2256
2320
|
"button",
|
|
2257
2321
|
{
|
|
2258
2322
|
className: "katex-dialog-button-cancel",
|
|
@@ -2261,7 +2325,7 @@ var AddKatexDialog = ({
|
|
|
2261
2325
|
children: translations2.common.cancel
|
|
2262
2326
|
}
|
|
2263
2327
|
),
|
|
2264
|
-
/* @__PURE__ */
|
|
2328
|
+
/* @__PURE__ */ jsx69(
|
|
2265
2329
|
"button",
|
|
2266
2330
|
{
|
|
2267
2331
|
className: "katex-dialog-button-submit",
|
|
@@ -2278,7 +2342,7 @@ var AddKatexDialog = ({
|
|
|
2278
2342
|
|
|
2279
2343
|
// src/editor/dialogs/add-link-dialog/add-link-dialog.tsx
|
|
2280
2344
|
import { useEffect as useEffect7, useRef as useRef8, useState as useState8 } from "react";
|
|
2281
|
-
import { jsx as
|
|
2345
|
+
import { jsx as jsx70, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
2282
2346
|
var AddLinkDialog = ({
|
|
2283
2347
|
open,
|
|
2284
2348
|
onClose,
|
|
@@ -2358,17 +2422,17 @@ var AddLinkDialog = ({
|
|
|
2358
2422
|
handleSubmit();
|
|
2359
2423
|
}
|
|
2360
2424
|
};
|
|
2361
|
-
return /* @__PURE__ */
|
|
2425
|
+
return /* @__PURE__ */ jsxs21(
|
|
2362
2426
|
CommonModal,
|
|
2363
2427
|
{
|
|
2364
2428
|
open,
|
|
2365
2429
|
handleClose,
|
|
2366
2430
|
children: [
|
|
2367
|
-
/* @__PURE__ */
|
|
2368
|
-
/* @__PURE__ */
|
|
2369
|
-
/* @__PURE__ */
|
|
2370
|
-
/* @__PURE__ */
|
|
2371
|
-
/* @__PURE__ */
|
|
2431
|
+
/* @__PURE__ */ jsx70("p", { className: "link-dialog-title", children: linkDialogContext?.href ? translations2.link.editLink : translations2.link.addLink }),
|
|
2432
|
+
/* @__PURE__ */ jsx70("hr", { className: "link-dialog-divider" }),
|
|
2433
|
+
/* @__PURE__ */ jsxs21("div", { className: "link-dialog-content", children: [
|
|
2434
|
+
/* @__PURE__ */ jsxs21("div", { className: "link-dialog-form-group", children: [
|
|
2435
|
+
/* @__PURE__ */ jsx70(
|
|
2372
2436
|
"label",
|
|
2373
2437
|
{
|
|
2374
2438
|
htmlFor: "link-title",
|
|
@@ -2376,7 +2440,7 @@ var AddLinkDialog = ({
|
|
|
2376
2440
|
children: translations2.link.title
|
|
2377
2441
|
}
|
|
2378
2442
|
),
|
|
2379
|
-
/* @__PURE__ */
|
|
2443
|
+
/* @__PURE__ */ jsx70(
|
|
2380
2444
|
"input",
|
|
2381
2445
|
{
|
|
2382
2446
|
ref: titleInputRef,
|
|
@@ -2390,8 +2454,8 @@ var AddLinkDialog = ({
|
|
|
2390
2454
|
}
|
|
2391
2455
|
)
|
|
2392
2456
|
] }),
|
|
2393
|
-
/* @__PURE__ */
|
|
2394
|
-
/* @__PURE__ */
|
|
2457
|
+
/* @__PURE__ */ jsxs21("div", { className: "link-dialog-form-group", children: [
|
|
2458
|
+
/* @__PURE__ */ jsx70(
|
|
2395
2459
|
"label",
|
|
2396
2460
|
{
|
|
2397
2461
|
htmlFor: "link-url",
|
|
@@ -2399,7 +2463,7 @@ var AddLinkDialog = ({
|
|
|
2399
2463
|
children: translations2.link.url
|
|
2400
2464
|
}
|
|
2401
2465
|
),
|
|
2402
|
-
/* @__PURE__ */
|
|
2466
|
+
/* @__PURE__ */ jsx70(
|
|
2403
2467
|
"input",
|
|
2404
2468
|
{
|
|
2405
2469
|
id: "link-url",
|
|
@@ -2412,9 +2476,9 @@ var AddLinkDialog = ({
|
|
|
2412
2476
|
}
|
|
2413
2477
|
)
|
|
2414
2478
|
] }),
|
|
2415
|
-
/* @__PURE__ */
|
|
2416
|
-
/* @__PURE__ */
|
|
2417
|
-
/* @__PURE__ */
|
|
2479
|
+
/* @__PURE__ */ jsxs21("div", { className: "link-dialog-form-group", children: [
|
|
2480
|
+
/* @__PURE__ */ jsxs21("label", { className: "link-dialog-checkbox-label", children: [
|
|
2481
|
+
/* @__PURE__ */ jsx70(
|
|
2418
2482
|
"input",
|
|
2419
2483
|
{
|
|
2420
2484
|
type: "checkbox",
|
|
@@ -2422,13 +2486,13 @@ var AddLinkDialog = ({
|
|
|
2422
2486
|
onChange: (e) => setOpenInNewTab(e.target.checked)
|
|
2423
2487
|
}
|
|
2424
2488
|
),
|
|
2425
|
-
/* @__PURE__ */
|
|
2489
|
+
/* @__PURE__ */ jsx70("span", { children: translations2.link.openInNewTab })
|
|
2426
2490
|
] }),
|
|
2427
|
-
/* @__PURE__ */
|
|
2491
|
+
/* @__PURE__ */ jsx70("p", { className: "link-dialog-help-text", children: translations2.link.openInNewTabHelp })
|
|
2428
2492
|
] }),
|
|
2429
|
-
/* @__PURE__ */
|
|
2430
|
-
/* @__PURE__ */
|
|
2431
|
-
/* @__PURE__ */
|
|
2493
|
+
/* @__PURE__ */ jsxs21("div", { className: "link-dialog-form-group", children: [
|
|
2494
|
+
/* @__PURE__ */ jsxs21("label", { className: "link-dialog-checkbox-label", children: [
|
|
2495
|
+
/* @__PURE__ */ jsx70(
|
|
2432
2496
|
"input",
|
|
2433
2497
|
{
|
|
2434
2498
|
type: "checkbox",
|
|
@@ -2436,14 +2500,14 @@ var AddLinkDialog = ({
|
|
|
2436
2500
|
onChange: (e) => setAddNoopener(e.target.checked)
|
|
2437
2501
|
}
|
|
2438
2502
|
),
|
|
2439
|
-
/* @__PURE__ */
|
|
2503
|
+
/* @__PURE__ */ jsx70("span", { children: translations2.link.addNofollow })
|
|
2440
2504
|
] }),
|
|
2441
|
-
/* @__PURE__ */
|
|
2505
|
+
/* @__PURE__ */ jsx70("p", { className: "link-dialog-help-text", children: translations2.link.addNofollowHelp })
|
|
2442
2506
|
] }),
|
|
2443
|
-
error && /* @__PURE__ */
|
|
2507
|
+
error && /* @__PURE__ */ jsx70(DialogError, { error })
|
|
2444
2508
|
] }),
|
|
2445
|
-
/* @__PURE__ */
|
|
2446
|
-
/* @__PURE__ */
|
|
2509
|
+
/* @__PURE__ */ jsxs21("div", { className: "link-dialog-actions", children: [
|
|
2510
|
+
/* @__PURE__ */ jsx70(
|
|
2447
2511
|
"button",
|
|
2448
2512
|
{
|
|
2449
2513
|
className: "link-dialog-button-cancel",
|
|
@@ -2452,7 +2516,7 @@ var AddLinkDialog = ({
|
|
|
2452
2516
|
children: translations2.common.cancel
|
|
2453
2517
|
}
|
|
2454
2518
|
),
|
|
2455
|
-
/* @__PURE__ */
|
|
2519
|
+
/* @__PURE__ */ jsx70(
|
|
2456
2520
|
"button",
|
|
2457
2521
|
{
|
|
2458
2522
|
className: "link-dialog-button-submit",
|
|
@@ -2542,7 +2606,7 @@ var detectVideoHosting = (src) => {
|
|
|
2542
2606
|
};
|
|
2543
2607
|
|
|
2544
2608
|
// src/editor/dialogs/add-video-dialog/add-video-dialog.tsx
|
|
2545
|
-
import { jsx as
|
|
2609
|
+
import { jsx as jsx71, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
2546
2610
|
var SUPPORTED_PLATFORMS = {
|
|
2547
2611
|
["youtube" /* Youtube */]: "YouTube",
|
|
2548
2612
|
["vimeo" /* Vimeo */]: "Vimeo",
|
|
@@ -2609,17 +2673,17 @@ var AddVideoDialog = ({ open, onClose, onVideoAdd }) => {
|
|
|
2609
2673
|
handleSubmit();
|
|
2610
2674
|
}
|
|
2611
2675
|
};
|
|
2612
|
-
return /* @__PURE__ */
|
|
2676
|
+
return /* @__PURE__ */ jsxs22(
|
|
2613
2677
|
CommonModal,
|
|
2614
2678
|
{
|
|
2615
2679
|
open,
|
|
2616
2680
|
handleClose,
|
|
2617
2681
|
children: [
|
|
2618
|
-
/* @__PURE__ */
|
|
2619
|
-
/* @__PURE__ */
|
|
2620
|
-
/* @__PURE__ */
|
|
2621
|
-
/* @__PURE__ */
|
|
2622
|
-
/* @__PURE__ */
|
|
2682
|
+
/* @__PURE__ */ jsx71("p", { className: "video-dialog-title", children: translations2.videoUpload.title }),
|
|
2683
|
+
/* @__PURE__ */ jsx71("hr", { className: "video-dialog-divider" }),
|
|
2684
|
+
/* @__PURE__ */ jsxs22("div", { className: "video-dialog-content", children: [
|
|
2685
|
+
/* @__PURE__ */ jsxs22("div", { className: "video-dialog-form-group", children: [
|
|
2686
|
+
/* @__PURE__ */ jsx71(
|
|
2623
2687
|
"label",
|
|
2624
2688
|
{
|
|
2625
2689
|
htmlFor: "video-url",
|
|
@@ -2627,7 +2691,7 @@ var AddVideoDialog = ({ open, onClose, onVideoAdd }) => {
|
|
|
2627
2691
|
children: translations2.videoUpload.urlLabel
|
|
2628
2692
|
}
|
|
2629
2693
|
),
|
|
2630
|
-
/* @__PURE__ */
|
|
2694
|
+
/* @__PURE__ */ jsx71(
|
|
2631
2695
|
"input",
|
|
2632
2696
|
{
|
|
2633
2697
|
ref: urlInputRef,
|
|
@@ -2643,14 +2707,14 @@ var AddVideoDialog = ({ open, onClose, onVideoAdd }) => {
|
|
|
2643
2707
|
}
|
|
2644
2708
|
)
|
|
2645
2709
|
] }),
|
|
2646
|
-
/* @__PURE__ */
|
|
2647
|
-
/* @__PURE__ */
|
|
2648
|
-
/* @__PURE__ */
|
|
2710
|
+
/* @__PURE__ */ jsxs22("div", { className: "video-dialog-help-text", children: [
|
|
2711
|
+
/* @__PURE__ */ jsx71("p", { className: "video-dialog-help-title", children: translations2.videoUpload.supportedPlatforms }),
|
|
2712
|
+
/* @__PURE__ */ jsx71("ul", { className: "video-dialog-platform-list", children: Object.entries(SUPPORTED_PLATFORMS).map(([key, name]) => /* @__PURE__ */ jsx71("li", { children: name }, key)) })
|
|
2649
2713
|
] }),
|
|
2650
|
-
error && /* @__PURE__ */
|
|
2714
|
+
error && /* @__PURE__ */ jsx71(DialogError, { error })
|
|
2651
2715
|
] }),
|
|
2652
|
-
/* @__PURE__ */
|
|
2653
|
-
/* @__PURE__ */
|
|
2716
|
+
/* @__PURE__ */ jsxs22("div", { className: "video-dialog-actions", children: [
|
|
2717
|
+
/* @__PURE__ */ jsx71(
|
|
2654
2718
|
"button",
|
|
2655
2719
|
{
|
|
2656
2720
|
className: "video-dialog-button-cancel",
|
|
@@ -2660,7 +2724,7 @@ var AddVideoDialog = ({ open, onClose, onVideoAdd }) => {
|
|
|
2660
2724
|
children: translations2.videoUpload.cancel
|
|
2661
2725
|
}
|
|
2662
2726
|
),
|
|
2663
|
-
/* @__PURE__ */
|
|
2727
|
+
/* @__PURE__ */ jsx71(
|
|
2664
2728
|
"button",
|
|
2665
2729
|
{
|
|
2666
2730
|
className: "video-dialog-button-submit",
|
|
@@ -5046,24 +5110,24 @@ import { NodeViewContent, NodeViewWrapper } from "@tiptap/react";
|
|
|
5046
5110
|
import { useState as useState10 } from "react";
|
|
5047
5111
|
|
|
5048
5112
|
// src/icons/color/TiptapCalloutError.tsx
|
|
5049
|
-
import { jsx as
|
|
5050
|
-
var SvgTiptapCalloutError = (props) => /* @__PURE__ */
|
|
5051
|
-
/* @__PURE__ */
|
|
5052
|
-
/* @__PURE__ */
|
|
5113
|
+
import { jsx as jsx72, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
5114
|
+
var SvgTiptapCalloutError = (props) => /* @__PURE__ */ jsxs23("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 20 20", ...props, children: [
|
|
5115
|
+
/* @__PURE__ */ jsxs23("g", { clipPath: "url(#tiptap-callout-error_svg__a)", children: [
|
|
5116
|
+
/* @__PURE__ */ jsx72(
|
|
5053
5117
|
"path",
|
|
5054
5118
|
{
|
|
5055
5119
|
fill: "#E03757",
|
|
5056
5120
|
d: "M10 0C4.477 0 0 4.477 0 10s4.477 10 10 10 10-4.477 10-10S15.523 0 10 0"
|
|
5057
5121
|
}
|
|
5058
5122
|
),
|
|
5059
|
-
/* @__PURE__ */
|
|
5123
|
+
/* @__PURE__ */ jsx72(
|
|
5060
5124
|
"path",
|
|
5061
5125
|
{
|
|
5062
5126
|
fill: "#F04760",
|
|
5063
5127
|
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"
|
|
5064
5128
|
}
|
|
5065
5129
|
),
|
|
5066
|
-
/* @__PURE__ */
|
|
5130
|
+
/* @__PURE__ */ jsx72(
|
|
5067
5131
|
"path",
|
|
5068
5132
|
{
|
|
5069
5133
|
fill: "#fff",
|
|
@@ -5071,28 +5135,28 @@ var SvgTiptapCalloutError = (props) => /* @__PURE__ */ jsxs22("svg", { xmlns: "h
|
|
|
5071
5135
|
}
|
|
5072
5136
|
)
|
|
5073
5137
|
] }),
|
|
5074
|
-
/* @__PURE__ */
|
|
5138
|
+
/* @__PURE__ */ jsx72("defs", { children: /* @__PURE__ */ jsx72("clipPath", { id: "tiptap-callout-error_svg__a", children: /* @__PURE__ */ jsx72("path", { fill: "#fff", d: "M0 0h20v20H0z" }) }) })
|
|
5075
5139
|
] });
|
|
5076
5140
|
var TiptapCalloutError_default = SvgTiptapCalloutError;
|
|
5077
5141
|
|
|
5078
5142
|
// src/icons/color/TiptapCalloutInfo.tsx
|
|
5079
|
-
import { jsx as
|
|
5080
|
-
var SvgTiptapCalloutInfo = (props) => /* @__PURE__ */
|
|
5081
|
-
/* @__PURE__ */
|
|
5143
|
+
import { jsx as jsx73, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
5144
|
+
var SvgTiptapCalloutInfo = (props) => /* @__PURE__ */ jsxs24("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 20 20", ...props, children: [
|
|
5145
|
+
/* @__PURE__ */ jsx73(
|
|
5082
5146
|
"path",
|
|
5083
5147
|
{
|
|
5084
5148
|
fill: "#FE9738",
|
|
5085
5149
|
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"
|
|
5086
5150
|
}
|
|
5087
5151
|
),
|
|
5088
|
-
/* @__PURE__ */
|
|
5152
|
+
/* @__PURE__ */ jsx73(
|
|
5089
5153
|
"path",
|
|
5090
5154
|
{
|
|
5091
5155
|
fill: "#FFD15B",
|
|
5092
5156
|
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"
|
|
5093
5157
|
}
|
|
5094
5158
|
),
|
|
5095
|
-
/* @__PURE__ */
|
|
5159
|
+
/* @__PURE__ */ jsx73(
|
|
5096
5160
|
"path",
|
|
5097
5161
|
{
|
|
5098
5162
|
fill: "#FFC344",
|
|
@@ -5103,66 +5167,66 @@ var SvgTiptapCalloutInfo = (props) => /* @__PURE__ */ jsxs23("svg", { xmlns: "ht
|
|
|
5103
5167
|
var TiptapCalloutInfo_default = SvgTiptapCalloutInfo;
|
|
5104
5168
|
|
|
5105
5169
|
// src/icons/color/TiptapCalloutSuccess.tsx
|
|
5106
|
-
import { jsx as
|
|
5107
|
-
var SvgTiptapCalloutSuccess = (props) => /* @__PURE__ */
|
|
5108
|
-
/* @__PURE__ */
|
|
5109
|
-
/* @__PURE__ */
|
|
5170
|
+
import { jsx as jsx74, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
5171
|
+
var SvgTiptapCalloutSuccess = (props) => /* @__PURE__ */ jsxs25("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 20 20", ...props, children: [
|
|
5172
|
+
/* @__PURE__ */ jsxs25("g", { clipPath: "url(#tiptap-callout-success_svg__a)", children: [
|
|
5173
|
+
/* @__PURE__ */ jsx74(
|
|
5110
5174
|
"path",
|
|
5111
5175
|
{
|
|
5112
5176
|
fill: "#35495E",
|
|
5113
5177
|
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"
|
|
5114
5178
|
}
|
|
5115
5179
|
),
|
|
5116
|
-
/* @__PURE__ */
|
|
5180
|
+
/* @__PURE__ */ jsx74(
|
|
5117
5181
|
"path",
|
|
5118
5182
|
{
|
|
5119
5183
|
fill: "#2C3E50",
|
|
5120
5184
|
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"
|
|
5121
5185
|
}
|
|
5122
5186
|
),
|
|
5123
|
-
/* @__PURE__ */
|
|
5187
|
+
/* @__PURE__ */ jsx74(
|
|
5124
5188
|
"path",
|
|
5125
5189
|
{
|
|
5126
5190
|
fill: "#F9EAB0",
|
|
5127
5191
|
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"
|
|
5128
5192
|
}
|
|
5129
5193
|
),
|
|
5130
|
-
/* @__PURE__ */
|
|
5194
|
+
/* @__PURE__ */ jsx74(
|
|
5131
5195
|
"path",
|
|
5132
5196
|
{
|
|
5133
5197
|
fill: "#E64C3C",
|
|
5134
5198
|
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"
|
|
5135
5199
|
}
|
|
5136
5200
|
),
|
|
5137
|
-
/* @__PURE__ */
|
|
5201
|
+
/* @__PURE__ */ jsx74(
|
|
5138
5202
|
"path",
|
|
5139
5203
|
{
|
|
5140
5204
|
fill: "#3F5C6C",
|
|
5141
5205
|
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"
|
|
5142
5206
|
}
|
|
5143
5207
|
),
|
|
5144
|
-
/* @__PURE__ */
|
|
5208
|
+
/* @__PURE__ */ jsx74(
|
|
5145
5209
|
"path",
|
|
5146
5210
|
{
|
|
5147
5211
|
fill: "#ECF0F1",
|
|
5148
5212
|
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"
|
|
5149
5213
|
}
|
|
5150
5214
|
),
|
|
5151
|
-
/* @__PURE__ */
|
|
5215
|
+
/* @__PURE__ */ jsx74(
|
|
5152
5216
|
"path",
|
|
5153
5217
|
{
|
|
5154
5218
|
fill: "#C03A2B",
|
|
5155
5219
|
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"
|
|
5156
5220
|
}
|
|
5157
5221
|
),
|
|
5158
|
-
/* @__PURE__ */
|
|
5222
|
+
/* @__PURE__ */ jsx74(
|
|
5159
5223
|
"path",
|
|
5160
5224
|
{
|
|
5161
5225
|
fill: "#802F34",
|
|
5162
5226
|
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"
|
|
5163
5227
|
}
|
|
5164
5228
|
),
|
|
5165
|
-
/* @__PURE__ */
|
|
5229
|
+
/* @__PURE__ */ jsx74(
|
|
5166
5230
|
"path",
|
|
5167
5231
|
{
|
|
5168
5232
|
fill: "#F9EAB0",
|
|
@@ -5170,14 +5234,14 @@ var SvgTiptapCalloutSuccess = (props) => /* @__PURE__ */ jsxs24("svg", { xmlns:
|
|
|
5170
5234
|
}
|
|
5171
5235
|
)
|
|
5172
5236
|
] }),
|
|
5173
|
-
/* @__PURE__ */
|
|
5237
|
+
/* @__PURE__ */ jsx74("defs", { children: /* @__PURE__ */ jsx74("clipPath", { id: "tiptap-callout-success_svg__a", children: /* @__PURE__ */ jsx74("path", { fill: "#fff", d: "M0 0h20v20H0z" }) }) })
|
|
5174
5238
|
] });
|
|
5175
5239
|
var TiptapCalloutSuccess_default = SvgTiptapCalloutSuccess;
|
|
5176
5240
|
|
|
5177
5241
|
// src/icons/color/TiptapCalloutWarning.tsx
|
|
5178
|
-
import { jsx as
|
|
5179
|
-
var SvgTiptapCalloutWarning = (props) => /* @__PURE__ */
|
|
5180
|
-
/* @__PURE__ */
|
|
5242
|
+
import { jsx as jsx75, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
5243
|
+
var SvgTiptapCalloutWarning = (props) => /* @__PURE__ */ jsxs26("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 20 20", ...props, children: [
|
|
5244
|
+
/* @__PURE__ */ jsx75(
|
|
5181
5245
|
"path",
|
|
5182
5246
|
{
|
|
5183
5247
|
fill: "#FFF59D",
|
|
@@ -5185,29 +5249,29 @@ var SvgTiptapCalloutWarning = (props) => /* @__PURE__ */ jsxs25("svg", { xmlns:
|
|
|
5185
5249
|
d: "M1.667 9.167a8.333 8.333 0 1 0 16.666 0 8.333 8.333 0 0 0-16.666 0"
|
|
5186
5250
|
}
|
|
5187
5251
|
),
|
|
5188
|
-
/* @__PURE__ */
|
|
5252
|
+
/* @__PURE__ */ jsx75(
|
|
5189
5253
|
"path",
|
|
5190
5254
|
{
|
|
5191
5255
|
fill: "#FBC02D",
|
|
5192
5256
|
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"
|
|
5193
5257
|
}
|
|
5194
5258
|
),
|
|
5195
|
-
/* @__PURE__ */
|
|
5259
|
+
/* @__PURE__ */ jsx75(
|
|
5196
5260
|
"path",
|
|
5197
5261
|
{
|
|
5198
5262
|
fill: "#FFF59D",
|
|
5199
5263
|
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"
|
|
5200
5264
|
}
|
|
5201
5265
|
),
|
|
5202
|
-
/* @__PURE__ */
|
|
5203
|
-
/* @__PURE__ */
|
|
5266
|
+
/* @__PURE__ */ jsx75("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__ */ jsx75(
|
|
5204
5268
|
"path",
|
|
5205
5269
|
{
|
|
5206
5270
|
fill: "#9FA8DA",
|
|
5207
5271
|
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"
|
|
5208
5272
|
}
|
|
5209
5273
|
),
|
|
5210
|
-
/* @__PURE__ */
|
|
5274
|
+
/* @__PURE__ */ jsx75(
|
|
5211
5275
|
"path",
|
|
5212
5276
|
{
|
|
5213
5277
|
fill: "#5C6BC0",
|
|
@@ -5360,12 +5424,12 @@ var calloutCustomEmojis = [
|
|
|
5360
5424
|
];
|
|
5361
5425
|
|
|
5362
5426
|
// src/extensions/views/components/callout.tsx
|
|
5363
|
-
import { jsx as
|
|
5427
|
+
import { jsx as jsx76, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
5364
5428
|
var calloutIcons = {
|
|
5365
|
-
info: /* @__PURE__ */
|
|
5366
|
-
warning: /* @__PURE__ */
|
|
5367
|
-
success: /* @__PURE__ */
|
|
5368
|
-
error: /* @__PURE__ */
|
|
5429
|
+
info: /* @__PURE__ */ jsx76(TiptapCalloutInfo_default, {}),
|
|
5430
|
+
warning: /* @__PURE__ */ jsx76(TiptapCalloutWarning_default, {}),
|
|
5431
|
+
success: /* @__PURE__ */ jsx76(TiptapCalloutSuccess_default, {}),
|
|
5432
|
+
error: /* @__PURE__ */ jsx76(TiptapCalloutError_default, {})
|
|
5369
5433
|
};
|
|
5370
5434
|
var legacyTypeMap3 = {
|
|
5371
5435
|
question: "info",
|
|
@@ -5383,15 +5447,15 @@ var Callout = ({ type, bgColor, emoji: emoji2, children, iconWrapper, calloutTyp
|
|
|
5383
5447
|
if (emoji2) {
|
|
5384
5448
|
if (emoji2 in calloutIconComponents) {
|
|
5385
5449
|
const IconComponent = calloutIconComponents[emoji2];
|
|
5386
|
-
icon = /* @__PURE__ */
|
|
5450
|
+
icon = /* @__PURE__ */ jsx76(IconComponent, {});
|
|
5387
5451
|
} else {
|
|
5388
5452
|
icon = emoji2;
|
|
5389
5453
|
}
|
|
5390
5454
|
} else {
|
|
5391
5455
|
icon = calloutIcons[finalType];
|
|
5392
5456
|
}
|
|
5393
|
-
const iconContent = iconWrapper ? iconWrapper(icon) : /* @__PURE__ */
|
|
5394
|
-
return /* @__PURE__ */
|
|
5457
|
+
const iconContent = iconWrapper ? iconWrapper(icon) : /* @__PURE__ */ jsx76("div", { className: "callout-icon", children: icon });
|
|
5458
|
+
return /* @__PURE__ */ jsxs27(
|
|
5395
5459
|
"div",
|
|
5396
5460
|
{
|
|
5397
5461
|
className,
|
|
@@ -5401,33 +5465,33 @@ var Callout = ({ type, bgColor, emoji: emoji2, children, iconWrapper, calloutTyp
|
|
|
5401
5465
|
style,
|
|
5402
5466
|
children: [
|
|
5403
5467
|
iconContent,
|
|
5404
|
-
/* @__PURE__ */
|
|
5468
|
+
/* @__PURE__ */ jsx76("div", { className: "callout-content-wrapper", children: /* @__PURE__ */ jsx76("div", { className: "callout-content", children }) })
|
|
5405
5469
|
]
|
|
5406
5470
|
}
|
|
5407
5471
|
);
|
|
5408
5472
|
};
|
|
5409
5473
|
|
|
5410
5474
|
// src/extensions/views/components/code-block.tsx
|
|
5411
|
-
import { useMemo } from "react";
|
|
5475
|
+
import { useMemo as useMemo2 } from "react";
|
|
5412
5476
|
import html2 from "highlight.js/lib/languages/xml";
|
|
5413
5477
|
import { common as common2, createLowlight as createLowlight2 } from "lowlight";
|
|
5414
5478
|
|
|
5415
5479
|
// src/extensions/views/components/copy-button.tsx
|
|
5416
|
-
import { jsx as
|
|
5480
|
+
import { jsx as jsx77, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
5417
5481
|
var CopyButton = ({ iconSize = 16, color = "black" }) => {
|
|
5418
|
-
return /* @__PURE__ */
|
|
5482
|
+
return /* @__PURE__ */ jsxs28(
|
|
5419
5483
|
"button",
|
|
5420
5484
|
{
|
|
5421
5485
|
className: `copy-button copy-icon-${color}`,
|
|
5422
5486
|
"data-copy-action": "copy",
|
|
5423
5487
|
type: "button",
|
|
5424
5488
|
children: [
|
|
5425
|
-
/* @__PURE__ */
|
|
5489
|
+
/* @__PURE__ */ jsx77(
|
|
5426
5490
|
"span",
|
|
5427
5491
|
{
|
|
5428
5492
|
className: "copy-icon",
|
|
5429
5493
|
"data-copy-icon": "default",
|
|
5430
|
-
children: /* @__PURE__ */
|
|
5494
|
+
children: /* @__PURE__ */ jsx77(
|
|
5431
5495
|
Copy_default,
|
|
5432
5496
|
{
|
|
5433
5497
|
width: iconSize,
|
|
@@ -5436,13 +5500,13 @@ var CopyButton = ({ iconSize = 16, color = "black" }) => {
|
|
|
5436
5500
|
)
|
|
5437
5501
|
}
|
|
5438
5502
|
),
|
|
5439
|
-
/* @__PURE__ */
|
|
5503
|
+
/* @__PURE__ */ jsx77(
|
|
5440
5504
|
"span",
|
|
5441
5505
|
{
|
|
5442
5506
|
className: "copy-icon-success",
|
|
5443
5507
|
"data-copy-icon": "success",
|
|
5444
5508
|
style: { display: "none" },
|
|
5445
|
-
children: /* @__PURE__ */
|
|
5509
|
+
children: /* @__PURE__ */ jsx77(
|
|
5446
5510
|
Check_default,
|
|
5447
5511
|
{
|
|
5448
5512
|
width: iconSize,
|
|
@@ -5457,7 +5521,7 @@ var CopyButton = ({ iconSize = 16, color = "black" }) => {
|
|
|
5457
5521
|
};
|
|
5458
5522
|
|
|
5459
5523
|
// src/extensions/views/components/code-block.tsx
|
|
5460
|
-
import { jsx as
|
|
5524
|
+
import { jsx as jsx78, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
5461
5525
|
var CodeBlock = ({
|
|
5462
5526
|
language,
|
|
5463
5527
|
isEditable,
|
|
@@ -5465,7 +5529,7 @@ var CodeBlock = ({
|
|
|
5465
5529
|
children,
|
|
5466
5530
|
translations: translations2
|
|
5467
5531
|
}) => {
|
|
5468
|
-
const languagesList =
|
|
5532
|
+
const languagesList = useMemo2(() => {
|
|
5469
5533
|
const lowlight2 = createLowlight2(common2);
|
|
5470
5534
|
lowlight2.register("html", html2);
|
|
5471
5535
|
const list = lowlight2.listLanguages();
|
|
@@ -5474,17 +5538,17 @@ var CodeBlock = ({
|
|
|
5474
5538
|
const handleChange = (e) => {
|
|
5475
5539
|
onLanguageChange?.(e.target.value);
|
|
5476
5540
|
};
|
|
5477
|
-
return /* @__PURE__ */
|
|
5478
|
-
/* @__PURE__ */
|
|
5479
|
-
isEditable ? /* @__PURE__ */
|
|
5541
|
+
return /* @__PURE__ */ jsxs29("div", { className: "tiptap-code-block-wrapper", children: [
|
|
5542
|
+
/* @__PURE__ */ jsxs29("div", { className: "tiptap-code-block-header", children: [
|
|
5543
|
+
isEditable ? /* @__PURE__ */ jsxs29(
|
|
5480
5544
|
"select",
|
|
5481
5545
|
{
|
|
5482
5546
|
className: "tiptap-code-block-language-select",
|
|
5483
5547
|
value: language,
|
|
5484
5548
|
onChange: handleChange,
|
|
5485
5549
|
children: [
|
|
5486
|
-
/* @__PURE__ */
|
|
5487
|
-
languagesList.map((lang) => /* @__PURE__ */
|
|
5550
|
+
/* @__PURE__ */ jsx78("option", { value: "", children: translations2?.codeBlock.selectLanguage }),
|
|
5551
|
+
languagesList.map((lang) => /* @__PURE__ */ jsx78(
|
|
5488
5552
|
"option",
|
|
5489
5553
|
{
|
|
5490
5554
|
value: lang,
|
|
@@ -5494,8 +5558,8 @@ var CodeBlock = ({
|
|
|
5494
5558
|
))
|
|
5495
5559
|
]
|
|
5496
5560
|
}
|
|
5497
|
-
) : /* @__PURE__ */
|
|
5498
|
-
/* @__PURE__ */
|
|
5561
|
+
) : /* @__PURE__ */ jsx78("span", { className: "tiptap-code-block-language-text", children: language || translations2?.codeBlock.selectLanguage }),
|
|
5562
|
+
/* @__PURE__ */ jsx78(
|
|
5499
5563
|
CopyButton,
|
|
5500
5564
|
{
|
|
5501
5565
|
iconSize: 20,
|
|
@@ -5503,7 +5567,7 @@ var CodeBlock = ({
|
|
|
5503
5567
|
}
|
|
5504
5568
|
)
|
|
5505
5569
|
] }),
|
|
5506
|
-
/* @__PURE__ */
|
|
5570
|
+
/* @__PURE__ */ jsx78("pre", { className: "tiptap-code-block", children: /* @__PURE__ */ jsx78(
|
|
5507
5571
|
"code",
|
|
5508
5572
|
{
|
|
5509
5573
|
className: "tiptap-code-block-content",
|
|
@@ -5515,22 +5579,22 @@ var CodeBlock = ({
|
|
|
5515
5579
|
};
|
|
5516
5580
|
|
|
5517
5581
|
// src/extensions/views/components/copyable-text.tsx
|
|
5518
|
-
import { jsx as
|
|
5582
|
+
import { jsx as jsx79, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
5519
5583
|
var CopyableText2 = ({ children }) => {
|
|
5520
|
-
return /* @__PURE__ */
|
|
5521
|
-
/* @__PURE__ */
|
|
5522
|
-
/* @__PURE__ */
|
|
5584
|
+
return /* @__PURE__ */ jsxs30("span", { className: "copyable", children: [
|
|
5585
|
+
/* @__PURE__ */ jsx79("span", { "data-copy-content": true, children }),
|
|
5586
|
+
/* @__PURE__ */ jsx79(CopyButton, { iconSize: 16 })
|
|
5523
5587
|
] });
|
|
5524
5588
|
};
|
|
5525
5589
|
|
|
5526
5590
|
// src/extensions/views/components/custom-quote.tsx
|
|
5527
|
-
import { jsx as
|
|
5528
|
-
var CustomQuote = ({ children }) => /* @__PURE__ */
|
|
5529
|
-
/* @__PURE__ */
|
|
5530
|
-
/* @__PURE__ */
|
|
5591
|
+
import { jsx as jsx80, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
5592
|
+
var CustomQuote = ({ children }) => /* @__PURE__ */ jsxs31("div", { "data-custom-quote": "", children: [
|
|
5593
|
+
/* @__PURE__ */ jsx80("div", { className: "custom-quote-divider" }),
|
|
5594
|
+
/* @__PURE__ */ jsx80("div", { className: "custom-quote-svg-wrapper", children: /* @__PURE__ */ jsx80(Quote_default, {}) }),
|
|
5531
5595
|
children
|
|
5532
5596
|
] });
|
|
5533
|
-
var CustomQuoteText = ({ children, isEmpty, placeholder }) => /* @__PURE__ */
|
|
5597
|
+
var CustomQuoteText = ({ children, isEmpty, placeholder }) => /* @__PURE__ */ jsx80(
|
|
5534
5598
|
"div",
|
|
5535
5599
|
{
|
|
5536
5600
|
"data-custom-quote-text": true,
|
|
@@ -5539,7 +5603,7 @@ var CustomQuoteText = ({ children, isEmpty, placeholder }) => /* @__PURE__ */ js
|
|
|
5539
5603
|
children
|
|
5540
5604
|
}
|
|
5541
5605
|
);
|
|
5542
|
-
var CustomQuoteAuthor = ({ children, isEmpty, placeholder }) => /* @__PURE__ */
|
|
5606
|
+
var CustomQuoteAuthor = ({ children, isEmpty, placeholder }) => /* @__PURE__ */ jsx80(
|
|
5543
5607
|
"div",
|
|
5544
5608
|
{
|
|
5545
5609
|
"data-custom-quote-author": "",
|
|
@@ -5548,7 +5612,7 @@ var CustomQuoteAuthor = ({ children, isEmpty, placeholder }) => /* @__PURE__ */
|
|
|
5548
5612
|
children
|
|
5549
5613
|
}
|
|
5550
5614
|
);
|
|
5551
|
-
var CustomQuoteSign = ({ children, isEmpty, placeholder }) => /* @__PURE__ */
|
|
5615
|
+
var CustomQuoteSign = ({ children, isEmpty, placeholder }) => /* @__PURE__ */ jsx80(
|
|
5552
5616
|
"div",
|
|
5553
5617
|
{
|
|
5554
5618
|
"data-custom-quote-sign": "",
|
|
@@ -5559,7 +5623,7 @@ var CustomQuoteSign = ({ children, isEmpty, placeholder }) => /* @__PURE__ */ js
|
|
|
5559
5623
|
);
|
|
5560
5624
|
|
|
5561
5625
|
// src/extensions/views/components/figure.tsx
|
|
5562
|
-
import { jsx as
|
|
5626
|
+
import { jsx as jsx81, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
5563
5627
|
var Figure = ({
|
|
5564
5628
|
src,
|
|
5565
5629
|
alt,
|
|
@@ -5574,9 +5638,9 @@ var Figure = ({
|
|
|
5574
5638
|
getImageById
|
|
5575
5639
|
}) => {
|
|
5576
5640
|
const resolvedSrc = resolveImageSrc({ fileId, src }, { getImageById });
|
|
5577
|
-
return /* @__PURE__ */
|
|
5578
|
-
resolvedSrc && /* @__PURE__ */
|
|
5579
|
-
/* @__PURE__ */
|
|
5641
|
+
return /* @__PURE__ */ jsxs32("figure", { children: [
|
|
5642
|
+
resolvedSrc && /* @__PURE__ */ jsxs32("div", { className: "figure-image-container", children: [
|
|
5643
|
+
/* @__PURE__ */ jsx81(
|
|
5580
5644
|
"img",
|
|
5581
5645
|
{
|
|
5582
5646
|
src: resolvedSrc,
|
|
@@ -5586,7 +5650,7 @@ var Figure = ({
|
|
|
5586
5650
|
height: height || void 0
|
|
5587
5651
|
}
|
|
5588
5652
|
),
|
|
5589
|
-
isEditable && onEditClick && /* @__PURE__ */
|
|
5653
|
+
isEditable && onEditClick && /* @__PURE__ */ jsx81(
|
|
5590
5654
|
"button",
|
|
5591
5655
|
{
|
|
5592
5656
|
type: "button",
|
|
@@ -5594,19 +5658,19 @@ var Figure = ({
|
|
|
5594
5658
|
onClick: onEditClick,
|
|
5595
5659
|
contentEditable: false,
|
|
5596
5660
|
"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",
|
|
5597
|
-
children: /* @__PURE__ */
|
|
5661
|
+
children: /* @__PURE__ */ jsx81(Edit_default, {})
|
|
5598
5662
|
}
|
|
5599
5663
|
)
|
|
5600
5664
|
] }),
|
|
5601
|
-
caption && /* @__PURE__ */
|
|
5665
|
+
caption && /* @__PURE__ */ jsx81("figcaption", { children: caption }),
|
|
5602
5666
|
children
|
|
5603
5667
|
] });
|
|
5604
5668
|
};
|
|
5605
5669
|
|
|
5606
5670
|
// src/extensions/views/components/prompt.tsx
|
|
5607
|
-
import { jsx as
|
|
5608
|
-
var PromptHeader = ({ children, isEmpty, placeholder }) => /* @__PURE__ */
|
|
5609
|
-
/* @__PURE__ */
|
|
5671
|
+
import { jsx as jsx82, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
5672
|
+
var PromptHeader = ({ children, isEmpty, placeholder }) => /* @__PURE__ */ jsxs33("div", { className: "prompt-header-wrapper", children: [
|
|
5673
|
+
/* @__PURE__ */ jsx82(
|
|
5610
5674
|
"div",
|
|
5611
5675
|
{
|
|
5612
5676
|
className: isEmpty ? "is-empty" : "",
|
|
@@ -5614,7 +5678,7 @@ var PromptHeader = ({ children, isEmpty, placeholder }) => /* @__PURE__ */ jsxs3
|
|
|
5614
5678
|
children
|
|
5615
5679
|
}
|
|
5616
5680
|
),
|
|
5617
|
-
/* @__PURE__ */
|
|
5681
|
+
/* @__PURE__ */ jsx82("span", { className: "prompt-copy-icon-wrapper", children: /* @__PURE__ */ jsx82(
|
|
5618
5682
|
CopyButton,
|
|
5619
5683
|
{
|
|
5620
5684
|
iconSize: 16,
|
|
@@ -5622,7 +5686,7 @@ var PromptHeader = ({ children, isEmpty, placeholder }) => /* @__PURE__ */ jsxs3
|
|
|
5622
5686
|
}
|
|
5623
5687
|
) })
|
|
5624
5688
|
] });
|
|
5625
|
-
var PromptContent = ({ children, isEmpty, placeholder }) => /* @__PURE__ */
|
|
5689
|
+
var PromptContent = ({ children, isEmpty, placeholder }) => /* @__PURE__ */ jsx82("div", { className: "prompt-content-wrapper", children: /* @__PURE__ */ jsx82(
|
|
5626
5690
|
"div",
|
|
5627
5691
|
{
|
|
5628
5692
|
className: isEmpty ? "is-empty" : "",
|
|
@@ -5633,22 +5697,22 @@ var PromptContent = ({ children, isEmpty, placeholder }) => /* @__PURE__ */ jsx8
|
|
|
5633
5697
|
) });
|
|
5634
5698
|
|
|
5635
5699
|
// src/extensions/views/components/video.tsx
|
|
5636
|
-
import { jsx as
|
|
5700
|
+
import { jsx as jsx83, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
5637
5701
|
var Video = ({ src, children }) => {
|
|
5638
5702
|
const videoInfo = detectVideoHosting(src);
|
|
5639
5703
|
if (!videoInfo?.embedUrl) {
|
|
5640
|
-
return /* @__PURE__ */
|
|
5641
|
-
/* @__PURE__ */
|
|
5704
|
+
return /* @__PURE__ */ jsxs34("div", { className: "video-node", children: [
|
|
5705
|
+
/* @__PURE__ */ jsx83("div", { className: "video-error", children: /* @__PURE__ */ jsx83("span", { children: "Unsupported or invalid video URL" }) }),
|
|
5642
5706
|
children
|
|
5643
5707
|
] });
|
|
5644
5708
|
}
|
|
5645
|
-
return /* @__PURE__ */
|
|
5709
|
+
return /* @__PURE__ */ jsxs34(
|
|
5646
5710
|
"div",
|
|
5647
5711
|
{
|
|
5648
5712
|
className: "video-node",
|
|
5649
5713
|
"data-video": "",
|
|
5650
5714
|
children: [
|
|
5651
|
-
/* @__PURE__ */
|
|
5715
|
+
/* @__PURE__ */ jsx83("div", { className: "video-player-wrapper", children: /* @__PURE__ */ jsx83(
|
|
5652
5716
|
"iframe",
|
|
5653
5717
|
{
|
|
5654
5718
|
className: "video-iframe",
|
|
@@ -5667,7 +5731,7 @@ var Video = ({ src, children }) => {
|
|
|
5667
5731
|
// src/editor/controls/emoji-picker.tsx
|
|
5668
5732
|
import { useEffect as useEffect9, useRef as useRef10 } from "react";
|
|
5669
5733
|
import EmojiPicker from "emoji-picker-react";
|
|
5670
|
-
import { jsx as
|
|
5734
|
+
import { jsx as jsx84 } from "react/jsx-runtime";
|
|
5671
5735
|
var EmojiPickerComponent = ({ isOpen, onClose, onEmojiSelect }) => {
|
|
5672
5736
|
const pickerRef = useRef10(null);
|
|
5673
5737
|
const translations2 = useTiptapTranslations();
|
|
@@ -5685,12 +5749,12 @@ var EmojiPickerComponent = ({ isOpen, onClose, onEmojiSelect }) => {
|
|
|
5685
5749
|
};
|
|
5686
5750
|
}, [isOpen, onClose]);
|
|
5687
5751
|
if (!isOpen) return null;
|
|
5688
|
-
return /* @__PURE__ */
|
|
5752
|
+
return /* @__PURE__ */ jsx84(
|
|
5689
5753
|
"div",
|
|
5690
5754
|
{
|
|
5691
5755
|
ref: pickerRef,
|
|
5692
5756
|
className: "tiptap__emoji-picker-wrapper",
|
|
5693
|
-
children: /* @__PURE__ */
|
|
5757
|
+
children: /* @__PURE__ */ jsx84(
|
|
5694
5758
|
EmojiPicker,
|
|
5695
5759
|
{
|
|
5696
5760
|
skinTonesDisabled: true,
|
|
@@ -5715,7 +5779,7 @@ var EmojiPickerComponent = ({ isOpen, onClose, onEmojiSelect }) => {
|
|
|
5715
5779
|
};
|
|
5716
5780
|
|
|
5717
5781
|
// src/extensions/views/node-views/callout.tsx
|
|
5718
|
-
import { jsx as
|
|
5782
|
+
import { jsx as jsx85, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
5719
5783
|
var CalloutView = (props) => {
|
|
5720
5784
|
const type = props.node.attrs.type || "info";
|
|
5721
5785
|
const bgColor = props.node.attrs.bgColor;
|
|
@@ -5730,23 +5794,23 @@ var CalloutView = (props) => {
|
|
|
5730
5794
|
props.updateAttributes({ emoji: newEmoji });
|
|
5731
5795
|
setShowEmojiPicker(false);
|
|
5732
5796
|
};
|
|
5733
|
-
return /* @__PURE__ */
|
|
5797
|
+
return /* @__PURE__ */ jsx85(NodeViewWrapper, { children: /* @__PURE__ */ jsx85(
|
|
5734
5798
|
Callout,
|
|
5735
5799
|
{
|
|
5736
5800
|
type,
|
|
5737
5801
|
bgColor,
|
|
5738
5802
|
emoji: emoji2,
|
|
5739
|
-
iconWrapper: (icon) => /* @__PURE__ */
|
|
5740
|
-
/* @__PURE__ */
|
|
5803
|
+
iconWrapper: (icon) => /* @__PURE__ */ jsxs35("div", { className: "callout-icon-wrapper", children: [
|
|
5804
|
+
/* @__PURE__ */ jsx85(
|
|
5741
5805
|
"button",
|
|
5742
5806
|
{
|
|
5743
5807
|
className: "callout-icon-button",
|
|
5744
5808
|
onClick: handleIconClick,
|
|
5745
5809
|
type: "button",
|
|
5746
|
-
children: /* @__PURE__ */
|
|
5810
|
+
children: /* @__PURE__ */ jsx85("div", { className: "callout-icon", children: icon })
|
|
5747
5811
|
}
|
|
5748
5812
|
),
|
|
5749
|
-
/* @__PURE__ */
|
|
5813
|
+
/* @__PURE__ */ jsx85(
|
|
5750
5814
|
EmojiPickerComponent,
|
|
5751
5815
|
{
|
|
5752
5816
|
isOpen: showEmojiPicker,
|
|
@@ -5755,7 +5819,7 @@ var CalloutView = (props) => {
|
|
|
5755
5819
|
}
|
|
5756
5820
|
)
|
|
5757
5821
|
] }),
|
|
5758
|
-
children: /* @__PURE__ */
|
|
5822
|
+
children: /* @__PURE__ */ jsx85(NodeViewContent, { as: "div" })
|
|
5759
5823
|
}
|
|
5760
5824
|
) });
|
|
5761
5825
|
};
|
|
@@ -5763,7 +5827,7 @@ var CalloutView = (props) => {
|
|
|
5763
5827
|
// src/extensions/views/node-views/code-block.tsx
|
|
5764
5828
|
import { useState as useState11 } from "react";
|
|
5765
5829
|
import { NodeViewContent as NodeViewContent2, NodeViewWrapper as NodeViewWrapper2 } from "@tiptap/react";
|
|
5766
|
-
import { jsx as
|
|
5830
|
+
import { jsx as jsx86 } from "react/jsx-runtime";
|
|
5767
5831
|
var CodeBlockView = (props) => {
|
|
5768
5832
|
const [selectedLanguage, setSelectedLanguage] = useState11(props.node.attrs.language ?? "");
|
|
5769
5833
|
const translations2 = useTiptapTranslations();
|
|
@@ -5771,71 +5835,71 @@ var CodeBlockView = (props) => {
|
|
|
5771
5835
|
props.updateAttributes({ language });
|
|
5772
5836
|
setSelectedLanguage(language);
|
|
5773
5837
|
};
|
|
5774
|
-
return /* @__PURE__ */
|
|
5838
|
+
return /* @__PURE__ */ jsx86(NodeViewWrapper2, { children: /* @__PURE__ */ jsx86(
|
|
5775
5839
|
CodeBlock,
|
|
5776
5840
|
{
|
|
5777
5841
|
language: selectedLanguage,
|
|
5778
5842
|
isEditable: props.editor.isEditable,
|
|
5779
5843
|
onLanguageChange: handleLanguageChange,
|
|
5780
5844
|
translations: translations2,
|
|
5781
|
-
children: /* @__PURE__ */
|
|
5845
|
+
children: /* @__PURE__ */ jsx86(NodeViewContent2, {})
|
|
5782
5846
|
}
|
|
5783
5847
|
) });
|
|
5784
5848
|
};
|
|
5785
5849
|
|
|
5786
5850
|
// src/extensions/views/node-views/copyable-text.tsx
|
|
5787
5851
|
import { MarkViewContent } from "@tiptap/react";
|
|
5788
|
-
import { jsx as
|
|
5852
|
+
import { jsx as jsx87 } from "react/jsx-runtime";
|
|
5789
5853
|
var CopyableTextView = () => {
|
|
5790
|
-
return /* @__PURE__ */
|
|
5854
|
+
return /* @__PURE__ */ jsx87(CopyableText2, { children: /* @__PURE__ */ jsx87(MarkViewContent, {}) });
|
|
5791
5855
|
};
|
|
5792
5856
|
|
|
5793
5857
|
// src/extensions/views/node-views/custom-quote.tsx
|
|
5794
5858
|
import { NodeViewContent as NodeViewContent3, NodeViewWrapper as NodeViewWrapper3 } from "@tiptap/react";
|
|
5795
|
-
import { jsx as
|
|
5859
|
+
import { jsx as jsx88 } from "react/jsx-runtime";
|
|
5796
5860
|
var CustomQuoteView = () => {
|
|
5797
|
-
return /* @__PURE__ */
|
|
5861
|
+
return /* @__PURE__ */ jsx88(NodeViewWrapper3, { children: /* @__PURE__ */ jsx88(CustomQuote, { children: /* @__PURE__ */ jsx88(NodeViewContent3, {}) }) });
|
|
5798
5862
|
};
|
|
5799
5863
|
var CustomQuoteTextView = (props) => {
|
|
5800
5864
|
const isEmpty = !props.node.content.size;
|
|
5801
5865
|
const translations2 = useTiptapTranslations();
|
|
5802
|
-
return /* @__PURE__ */
|
|
5866
|
+
return /* @__PURE__ */ jsx88(NodeViewWrapper3, { children: /* @__PURE__ */ jsx88(
|
|
5803
5867
|
CustomQuoteText,
|
|
5804
5868
|
{
|
|
5805
5869
|
isEmpty,
|
|
5806
5870
|
placeholder: translations2.customQuote.textPlaceholder,
|
|
5807
|
-
children: /* @__PURE__ */
|
|
5871
|
+
children: /* @__PURE__ */ jsx88(NodeViewContent3, { className: isEmpty ? "is-empty" : "" })
|
|
5808
5872
|
}
|
|
5809
5873
|
) });
|
|
5810
5874
|
};
|
|
5811
5875
|
var CustomQuoteAuthorView = (props) => {
|
|
5812
5876
|
const isEmpty = !props.node.content.size;
|
|
5813
5877
|
const translations2 = useTiptapTranslations();
|
|
5814
|
-
return /* @__PURE__ */
|
|
5878
|
+
return /* @__PURE__ */ jsx88(NodeViewWrapper3, { children: /* @__PURE__ */ jsx88(
|
|
5815
5879
|
CustomQuoteAuthor,
|
|
5816
5880
|
{
|
|
5817
5881
|
isEmpty,
|
|
5818
5882
|
placeholder: translations2.customQuote.authorPlaceholder,
|
|
5819
|
-
children: /* @__PURE__ */
|
|
5883
|
+
children: /* @__PURE__ */ jsx88(NodeViewContent3, { className: isEmpty ? "is-empty" : "" })
|
|
5820
5884
|
}
|
|
5821
5885
|
) });
|
|
5822
5886
|
};
|
|
5823
5887
|
var CustomQuoteSignView = (props) => {
|
|
5824
5888
|
const isEmpty = !props.node.content.size;
|
|
5825
5889
|
const translations2 = useTiptapTranslations();
|
|
5826
|
-
return /* @__PURE__ */
|
|
5890
|
+
return /* @__PURE__ */ jsx88(NodeViewWrapper3, { children: /* @__PURE__ */ jsx88(
|
|
5827
5891
|
CustomQuoteSign,
|
|
5828
5892
|
{
|
|
5829
5893
|
isEmpty,
|
|
5830
5894
|
placeholder: translations2.customQuote.signPlaceholder,
|
|
5831
|
-
children: /* @__PURE__ */
|
|
5895
|
+
children: /* @__PURE__ */ jsx88(NodeViewContent3, { className: isEmpty ? "is-empty" : "" })
|
|
5832
5896
|
}
|
|
5833
5897
|
) });
|
|
5834
5898
|
};
|
|
5835
5899
|
|
|
5836
5900
|
// src/extensions/views/node-views/figure.tsx
|
|
5837
5901
|
import { NodeViewWrapper as NodeViewWrapper4 } from "@tiptap/react";
|
|
5838
|
-
import { jsx as
|
|
5902
|
+
import { jsx as jsx89 } from "react/jsx-runtime";
|
|
5839
5903
|
var FigureView = ({ node, getPos, editor }) => {
|
|
5840
5904
|
const { fileId, src, alt, title, caption, width, height } = node.attrs;
|
|
5841
5905
|
const imageExtension = editor.extensionManager.extensions.find((ext) => ext.name === "image");
|
|
@@ -5844,12 +5908,12 @@ var FigureView = ({ node, getPos, editor }) => {
|
|
|
5844
5908
|
const handleEditClick = () => {
|
|
5845
5909
|
onFigureClick?.(node.attrs, getPos());
|
|
5846
5910
|
};
|
|
5847
|
-
return /* @__PURE__ */
|
|
5911
|
+
return /* @__PURE__ */ jsx89(
|
|
5848
5912
|
NodeViewWrapper4,
|
|
5849
5913
|
{
|
|
5850
5914
|
className: "figure-node-view",
|
|
5851
5915
|
"data-drag-handle": true,
|
|
5852
|
-
children: /* @__PURE__ */
|
|
5916
|
+
children: /* @__PURE__ */ jsx89(
|
|
5853
5917
|
Figure,
|
|
5854
5918
|
{
|
|
5855
5919
|
fileId,
|
|
@@ -5870,38 +5934,38 @@ var FigureView = ({ node, getPos, editor }) => {
|
|
|
5870
5934
|
|
|
5871
5935
|
// src/extensions/views/node-views/prompt.tsx
|
|
5872
5936
|
import { NodeViewContent as NodeViewContent4, NodeViewWrapper as NodeViewWrapper5 } from "@tiptap/react";
|
|
5873
|
-
import { jsx as
|
|
5937
|
+
import { jsx as jsx90 } from "react/jsx-runtime";
|
|
5874
5938
|
var PromptHeaderView = (props) => {
|
|
5875
5939
|
const isEmpty = !props.node.content.size;
|
|
5876
5940
|
const translations2 = useTiptapTranslations();
|
|
5877
|
-
return /* @__PURE__ */
|
|
5941
|
+
return /* @__PURE__ */ jsx90(NodeViewWrapper5, { children: /* @__PURE__ */ jsx90(
|
|
5878
5942
|
PromptHeader,
|
|
5879
5943
|
{
|
|
5880
5944
|
isEmpty,
|
|
5881
5945
|
placeholder: translations2.prompt.headerPlaceholder,
|
|
5882
|
-
children: /* @__PURE__ */
|
|
5946
|
+
children: /* @__PURE__ */ jsx90(NodeViewContent4, { className: isEmpty ? "is-empty" : "" })
|
|
5883
5947
|
}
|
|
5884
5948
|
) });
|
|
5885
5949
|
};
|
|
5886
5950
|
var PromptContentView = (props) => {
|
|
5887
5951
|
const isEmpty = !props.node.content.size;
|
|
5888
5952
|
const translations2 = useTiptapTranslations();
|
|
5889
|
-
return /* @__PURE__ */
|
|
5953
|
+
return /* @__PURE__ */ jsx90(NodeViewWrapper5, { children: /* @__PURE__ */ jsx90(
|
|
5890
5954
|
PromptContent,
|
|
5891
5955
|
{
|
|
5892
5956
|
isEmpty,
|
|
5893
5957
|
placeholder: translations2.prompt.contentPlaceholder,
|
|
5894
|
-
children: /* @__PURE__ */
|
|
5958
|
+
children: /* @__PURE__ */ jsx90(NodeViewContent4, { className: isEmpty ? "is-empty" : "" })
|
|
5895
5959
|
}
|
|
5896
5960
|
) });
|
|
5897
5961
|
};
|
|
5898
5962
|
|
|
5899
5963
|
// src/extensions/views/node-views/video.tsx
|
|
5900
5964
|
import { NodeViewContent as NodeViewContent5, NodeViewWrapper as NodeViewWrapper6 } from "@tiptap/react";
|
|
5901
|
-
import { jsx as
|
|
5965
|
+
import { jsx as jsx91 } from "react/jsx-runtime";
|
|
5902
5966
|
var VideoView = (props) => {
|
|
5903
5967
|
const { src } = props.node.attrs;
|
|
5904
|
-
return /* @__PURE__ */
|
|
5968
|
+
return /* @__PURE__ */ jsx91(NodeViewWrapper6, { children: /* @__PURE__ */ jsx91(Video, { src, children: /* @__PURE__ */ jsx91(
|
|
5905
5969
|
NodeViewContent5,
|
|
5906
5970
|
{
|
|
5907
5971
|
as: "div",
|
|
@@ -6843,9 +6907,9 @@ function useInsertionHandlers(imageHandlers) {
|
|
|
6843
6907
|
}
|
|
6844
6908
|
}, [insertedImage, activeDialog]);
|
|
6845
6909
|
function genericInsertionHandler(file, event) {
|
|
6846
|
-
if (!file || !file.type.startsWith("image/")) return;
|
|
6847
6910
|
event.preventDefault();
|
|
6848
6911
|
event.stopPropagation();
|
|
6912
|
+
if (!file || !file.type.startsWith("image/")) return;
|
|
6849
6913
|
if (!imageHandlers?.upload) return;
|
|
6850
6914
|
setInsertedImage(file);
|
|
6851
6915
|
openDialogCommand("image");
|
|
@@ -7198,7 +7262,7 @@ var filterCommandItems = (items, query) => {
|
|
|
7198
7262
|
};
|
|
7199
7263
|
|
|
7200
7264
|
// src/editor/commands/suggestion.tsx
|
|
7201
|
-
import { jsx as
|
|
7265
|
+
import { jsx as jsx92 } from "react/jsx-runtime";
|
|
7202
7266
|
var component = null;
|
|
7203
7267
|
var closeMenu = () => {
|
|
7204
7268
|
if (component) {
|
|
@@ -7212,7 +7276,7 @@ var mapCommandMenuItemToCommandItem = (item) => {
|
|
|
7212
7276
|
const IconComponent = item.icon;
|
|
7213
7277
|
return {
|
|
7214
7278
|
title: item.title,
|
|
7215
|
-
icon: /* @__PURE__ */
|
|
7279
|
+
icon: /* @__PURE__ */ jsx92(IconComponent, {}),
|
|
7216
7280
|
command: ({ editor, range }) => {
|
|
7217
7281
|
editor.chain().focus().deleteRange(range).run();
|
|
7218
7282
|
item.onClick(editor);
|
|
@@ -7420,7 +7484,8 @@ var ru_default = {
|
|
|
7420
7484
|
captionLabel: "\u041F\u043E\u0434\u043F\u0438\u0441\u044C \u043A \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044E",
|
|
7421
7485
|
captionPlaceholder: "\u041E\u043F\u0438\u0441\u0430\u043D\u0438\u0435 \u043F\u043E\u0434 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435\u043C...",
|
|
7422
7486
|
save: "\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C",
|
|
7423
|
-
add: "\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C"
|
|
7487
|
+
add: "\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C",
|
|
7488
|
+
invalidFileType: "\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0444\u043E\u0440\u043C\u0430\u0442 \u0444\u0430\u0439\u043B\u0430."
|
|
7424
7489
|
},
|
|
7425
7490
|
videoUpload: {
|
|
7426
7491
|
title: "\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0432\u0438\u0434\u0435\u043E",
|
|
@@ -7465,7 +7530,9 @@ var ru_default = {
|
|
|
7465
7530
|
words: ["\u0441\u043B\u043E\u0432\u043E", "\u0441\u043B\u043E\u0432\u0430", "\u0441\u043B\u043E\u0432"]
|
|
7466
7531
|
},
|
|
7467
7532
|
common: {
|
|
7468
|
-
cancel: "\u041E\u0442\u043C\u0435\u043D\u0438\u0442\u044C"
|
|
7533
|
+
cancel: "\u041E\u0442\u043C\u0435\u043D\u0438\u0442\u044C",
|
|
7534
|
+
unknownError: "\u041D\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043D\u0430\u044F \u043E\u0448\u0438\u0431\u043A\u0430",
|
|
7535
|
+
clearError: "\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u043E\u0448\u0438\u0431\u043A\u0443"
|
|
7469
7536
|
}
|
|
7470
7537
|
};
|
|
7471
7538
|
|
|
@@ -7584,7 +7651,8 @@ var en_default = {
|
|
|
7584
7651
|
captionLabel: "Image caption",
|
|
7585
7652
|
captionPlaceholder: "Description under image...",
|
|
7586
7653
|
save: "Save",
|
|
7587
|
-
add: "Add"
|
|
7654
|
+
add: "Add",
|
|
7655
|
+
invalidFileType: "Invalid file format."
|
|
7588
7656
|
},
|
|
7589
7657
|
videoUpload: {
|
|
7590
7658
|
title: "Add video",
|
|
@@ -7629,7 +7697,9 @@ var en_default = {
|
|
|
7629
7697
|
words: ["word", "words", "words"]
|
|
7630
7698
|
},
|
|
7631
7699
|
common: {
|
|
7632
|
-
cancel: "Cancel"
|
|
7700
|
+
cancel: "Cancel",
|
|
7701
|
+
unknownError: "Unknown error",
|
|
7702
|
+
clearError: "Clear error"
|
|
7633
7703
|
}
|
|
7634
7704
|
};
|
|
7635
7705
|
|
|
@@ -7643,7 +7713,7 @@ function getTranslations(lang) {
|
|
|
7643
7713
|
}
|
|
7644
7714
|
|
|
7645
7715
|
// src/editor/editor.tsx
|
|
7646
|
-
import { Fragment as Fragment5, jsx as
|
|
7716
|
+
import { Fragment as Fragment5, jsx as jsx93, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
7647
7717
|
function TiptapContent({
|
|
7648
7718
|
content,
|
|
7649
7719
|
handleChange,
|
|
@@ -7790,16 +7860,16 @@ function TiptapContent({
|
|
|
7790
7860
|
return true;
|
|
7791
7861
|
};
|
|
7792
7862
|
if (!editor) return null;
|
|
7793
|
-
return /* @__PURE__ */
|
|
7794
|
-
/* @__PURE__ */
|
|
7795
|
-
isEditable && !disabled && /* @__PURE__ */
|
|
7796
|
-
isEditable && !disabled && /* @__PURE__ */
|
|
7863
|
+
return /* @__PURE__ */ jsxs36(Fragment5, { children: [
|
|
7864
|
+
/* @__PURE__ */ jsx93(DragHandle, { editor }),
|
|
7865
|
+
isEditable && !disabled && /* @__PURE__ */ jsx93(TableMenu, { editor }),
|
|
7866
|
+
isEditable && !disabled && /* @__PURE__ */ jsx93(
|
|
7797
7867
|
BubbleMenu,
|
|
7798
7868
|
{
|
|
7799
7869
|
shouldShow: shouldBubbleMenuShow,
|
|
7800
7870
|
editor,
|
|
7801
7871
|
options: { placement: "bottom", offset: 8, flip: true },
|
|
7802
|
-
children: /* @__PURE__ */
|
|
7872
|
+
children: /* @__PURE__ */ jsx93(
|
|
7803
7873
|
BubbleMenuContent,
|
|
7804
7874
|
{
|
|
7805
7875
|
editor,
|
|
@@ -7808,19 +7878,19 @@ function TiptapContent({
|
|
|
7808
7878
|
)
|
|
7809
7879
|
}
|
|
7810
7880
|
),
|
|
7811
|
-
/* @__PURE__ */
|
|
7881
|
+
/* @__PURE__ */ jsxs36(
|
|
7812
7882
|
"div",
|
|
7813
7883
|
{
|
|
7814
7884
|
className: `tiptap-content-wrapper ${!!error ? "has-error" : ""} ${disabled ? "is-disabled" : ""}`,
|
|
7815
7885
|
children: [
|
|
7816
|
-
/* @__PURE__ */
|
|
7817
|
-
isEditable && !disabled && /* @__PURE__ */
|
|
7886
|
+
/* @__PURE__ */ jsx93(EditorContent, { editor }),
|
|
7887
|
+
isEditable && !disabled && /* @__PURE__ */ jsx93(CharacterCount, { editor })
|
|
7818
7888
|
]
|
|
7819
7889
|
}
|
|
7820
7890
|
),
|
|
7821
|
-
!!error && /* @__PURE__ */
|
|
7822
|
-
isEditable && /* @__PURE__ */
|
|
7823
|
-
activeDialog === "image" && /* @__PURE__ */
|
|
7891
|
+
!!error && /* @__PURE__ */ jsx93("p", { className: "tiptap-error-message", children: error }),
|
|
7892
|
+
isEditable && /* @__PURE__ */ jsxs36(Fragment5, { children: [
|
|
7893
|
+
activeDialog === "image" && /* @__PURE__ */ jsx93(
|
|
7824
7894
|
ImageDialog,
|
|
7825
7895
|
{
|
|
7826
7896
|
open: true,
|
|
@@ -7834,7 +7904,7 @@ function TiptapContent({
|
|
|
7834
7904
|
mode: editFigureContext ? "edit" : "add"
|
|
7835
7905
|
}
|
|
7836
7906
|
),
|
|
7837
|
-
activeDialog === "link" && /* @__PURE__ */
|
|
7907
|
+
activeDialog === "link" && /* @__PURE__ */ jsx93(
|
|
7838
7908
|
AddLinkDialog,
|
|
7839
7909
|
{
|
|
7840
7910
|
open: true,
|
|
@@ -7843,7 +7913,7 @@ function TiptapContent({
|
|
|
7843
7913
|
linkDialogContext
|
|
7844
7914
|
}
|
|
7845
7915
|
),
|
|
7846
|
-
activeDialog === "video" && /* @__PURE__ */
|
|
7916
|
+
activeDialog === "video" && /* @__PURE__ */ jsx93(
|
|
7847
7917
|
AddVideoDialog,
|
|
7848
7918
|
{
|
|
7849
7919
|
open: true,
|
|
@@ -7851,7 +7921,7 @@ function TiptapContent({
|
|
|
7851
7921
|
onVideoAdd: handleVideoAdd
|
|
7852
7922
|
}
|
|
7853
7923
|
),
|
|
7854
|
-
activeDialog === "katex" && /* @__PURE__ */
|
|
7924
|
+
activeDialog === "katex" && /* @__PURE__ */ jsx93(
|
|
7855
7925
|
AddKatexDialog,
|
|
7856
7926
|
{
|
|
7857
7927
|
open: true,
|
|
@@ -7866,7 +7936,7 @@ function TiptapContent({
|
|
|
7866
7936
|
var Tiptap = (props) => {
|
|
7867
7937
|
const { lang = "ru" } = props;
|
|
7868
7938
|
const translations2 = getTranslations(lang);
|
|
7869
|
-
return /* @__PURE__ */
|
|
7939
|
+
return /* @__PURE__ */ jsx93(TiptapTranslationsProvider, { translations: translations2, children: /* @__PURE__ */ jsx93(DialogCommandProvider, { children: /* @__PURE__ */ jsx93(TiptapContent, { ...props }) }) });
|
|
7870
7940
|
};
|
|
7871
7941
|
|
|
7872
7942
|
// src/utils/html-to-tiptap-content.ts
|