@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.css +35 -43
- 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 +351 -314
- package/dist/editor.js.map +1 -1
- package/dist/editor.mjs +269 -232
- package/dist/editor.mjs.map +1 -1
- package/dist/styles/index.css +35 -43
- 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 +1 -29
- package/src/editor/dialogs/image-dialog/image-dialog.tsx +7 -13
- package/src/editor/index.ts +1 -0
- package/src/styles/components.css +1 -0
- package/src/translations/en.json +4 -4
- package/src/translations/ru.json +4 -4
- 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,
|
|
@@ -2042,7 +2084,7 @@ var ImageDialog = ({
|
|
|
2042
2084
|
});
|
|
2043
2085
|
handleClose();
|
|
2044
2086
|
} catch (error) {
|
|
2045
|
-
setFileUploadError(error instanceof Error ? error : new Error(translations2.
|
|
2087
|
+
setFileUploadError(error instanceof Error ? error : new Error(translations2.common.unknownError));
|
|
2046
2088
|
} finally {
|
|
2047
2089
|
setIsUploading(false);
|
|
2048
2090
|
}
|
|
@@ -2070,27 +2112,27 @@ var ImageDialog = ({
|
|
|
2070
2112
|
const dialogTitle = isAddMode ? translations2.imageDialog.addTitle : translations2.imageDialog.editTitle;
|
|
2071
2113
|
const saveButtonText = isAddMode ? translations2.imageDialog.add : translations2.imageDialog.save;
|
|
2072
2114
|
const dragPlaceholder = dragActive ? translations2.imageUpload.dragActive : translations2.imageUpload.dragInactive;
|
|
2073
|
-
return /* @__PURE__ */
|
|
2115
|
+
return /* @__PURE__ */ jsxs19(
|
|
2074
2116
|
CommonModal,
|
|
2075
2117
|
{
|
|
2076
2118
|
open,
|
|
2077
2119
|
handleClose,
|
|
2078
2120
|
children: [
|
|
2079
|
-
/* @__PURE__ */
|
|
2080
|
-
/* @__PURE__ */
|
|
2081
|
-
/* @__PURE__ */
|
|
2082
|
-
hasImage ? /* @__PURE__ */
|
|
2083
|
-
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(
|
|
2084
2126
|
"button",
|
|
2085
2127
|
{
|
|
2086
2128
|
type: "button",
|
|
2087
2129
|
className: "image-dialog-delete-button",
|
|
2088
2130
|
onClick: clearImageFormFields,
|
|
2089
2131
|
"aria-label": translations2.media.deleteImage,
|
|
2090
|
-
children: /* @__PURE__ */
|
|
2132
|
+
children: /* @__PURE__ */ jsx68(X_default, {})
|
|
2091
2133
|
}
|
|
2092
2134
|
),
|
|
2093
|
-
/* @__PURE__ */
|
|
2135
|
+
/* @__PURE__ */ jsx68(
|
|
2094
2136
|
"img",
|
|
2095
2137
|
{
|
|
2096
2138
|
src: formState.fileUrl,
|
|
@@ -2100,7 +2142,7 @@ var ImageDialog = ({
|
|
|
2100
2142
|
className: "image-dialog-preview"
|
|
2101
2143
|
}
|
|
2102
2144
|
)
|
|
2103
|
-
] }) : isAddMode && /* @__PURE__ */
|
|
2145
|
+
] }) : isAddMode && /* @__PURE__ */ jsxs19(
|
|
2104
2146
|
"div",
|
|
2105
2147
|
{
|
|
2106
2148
|
className: `image-dialog-drag-area ${dragActive ? "image-dialog-drag-area-active" : ""}`,
|
|
@@ -2110,7 +2152,7 @@ var ImageDialog = ({
|
|
|
2110
2152
|
onDragLeave: handleDragLeave,
|
|
2111
2153
|
onDrop: handleDrop,
|
|
2112
2154
|
children: [
|
|
2113
|
-
/* @__PURE__ */
|
|
2155
|
+
/* @__PURE__ */ jsx68(
|
|
2114
2156
|
"input",
|
|
2115
2157
|
{
|
|
2116
2158
|
type: "file",
|
|
@@ -2121,12 +2163,12 @@ var ImageDialog = ({
|
|
|
2121
2163
|
accept: "image/*"
|
|
2122
2164
|
}
|
|
2123
2165
|
),
|
|
2124
|
-
/* @__PURE__ */
|
|
2166
|
+
/* @__PURE__ */ jsx68("p", { style: { textAlign: "center" }, children: dragPlaceholder })
|
|
2125
2167
|
]
|
|
2126
2168
|
}
|
|
2127
2169
|
),
|
|
2128
|
-
hasImage && /* @__PURE__ */
|
|
2129
|
-
/* @__PURE__ */
|
|
2170
|
+
hasImage && /* @__PURE__ */ jsxs19(Fragment2, { children: [
|
|
2171
|
+
/* @__PURE__ */ jsx68(
|
|
2130
2172
|
Input,
|
|
2131
2173
|
{
|
|
2132
2174
|
label: translations2.media.imageTitle,
|
|
@@ -2134,7 +2176,7 @@ var ImageDialog = ({
|
|
|
2134
2176
|
onChange: (e) => setFormState((prev) => ({ ...prev, title: e.target.value }))
|
|
2135
2177
|
}
|
|
2136
2178
|
),
|
|
2137
|
-
/* @__PURE__ */
|
|
2179
|
+
/* @__PURE__ */ jsx68(
|
|
2138
2180
|
Input,
|
|
2139
2181
|
{
|
|
2140
2182
|
label: translations2.media.imageAlt,
|
|
@@ -2142,7 +2184,7 @@ var ImageDialog = ({
|
|
|
2142
2184
|
onChange: (e) => setFormState((prev) => ({ ...prev, alt: e.target.value }))
|
|
2143
2185
|
}
|
|
2144
2186
|
),
|
|
2145
|
-
/* @__PURE__ */
|
|
2187
|
+
/* @__PURE__ */ jsx68(
|
|
2146
2188
|
Input,
|
|
2147
2189
|
{
|
|
2148
2190
|
label: translations2.imageDialog.captionLabel,
|
|
@@ -2153,21 +2195,16 @@ var ImageDialog = ({
|
|
|
2153
2195
|
)
|
|
2154
2196
|
] })
|
|
2155
2197
|
] }) }),
|
|
2156
|
-
fileUploadError && /* @__PURE__ */
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
}
|
|
2167
|
-
)
|
|
2168
|
-
] }),
|
|
2169
|
-
/* @__PURE__ */ jsxs18("div", { className: "image-dialog-actions", children: [
|
|
2170
|
-
/* @__PURE__ */ jsx67(
|
|
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(
|
|
2171
2208
|
Button,
|
|
2172
2209
|
{
|
|
2173
2210
|
type: "button",
|
|
@@ -2177,7 +2214,7 @@ var ImageDialog = ({
|
|
|
2177
2214
|
children: translations2.common.cancel
|
|
2178
2215
|
}
|
|
2179
2216
|
),
|
|
2180
|
-
/* @__PURE__ */
|
|
2217
|
+
/* @__PURE__ */ jsx68(
|
|
2181
2218
|
Button,
|
|
2182
2219
|
{
|
|
2183
2220
|
isLoading: isUploading,
|
|
@@ -2195,7 +2232,7 @@ var ImageDialog = ({
|
|
|
2195
2232
|
|
|
2196
2233
|
// src/editor/dialogs/add-katex-dialog/add-katex-dialog.tsx
|
|
2197
2234
|
import { useEffect as useEffect6, useRef as useRef7, useState as useState7 } from "react";
|
|
2198
|
-
import { jsx as
|
|
2235
|
+
import { jsx as jsx69, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
2199
2236
|
var AddKatexDialog = ({
|
|
2200
2237
|
open,
|
|
2201
2238
|
onClose,
|
|
@@ -2230,19 +2267,19 @@ var AddKatexDialog = ({
|
|
|
2230
2267
|
handleSubmit();
|
|
2231
2268
|
}
|
|
2232
2269
|
};
|
|
2233
|
-
return /* @__PURE__ */
|
|
2270
|
+
return /* @__PURE__ */ jsxs20(
|
|
2234
2271
|
CommonModal,
|
|
2235
2272
|
{
|
|
2236
2273
|
open,
|
|
2237
2274
|
handleClose,
|
|
2238
2275
|
children: [
|
|
2239
|
-
/* @__PURE__ */
|
|
2240
|
-
/* @__PURE__ */
|
|
2241
|
-
/* @__PURE__ */
|
|
2242
|
-
/* @__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: [
|
|
2243
2280
|
translations2.katex.description,
|
|
2244
2281
|
" ",
|
|
2245
|
-
/* @__PURE__ */
|
|
2282
|
+
/* @__PURE__ */ jsx69(
|
|
2246
2283
|
"a",
|
|
2247
2284
|
{
|
|
2248
2285
|
href: "https://katex.org/docs/supported.html",
|
|
@@ -2254,8 +2291,8 @@ var AddKatexDialog = ({
|
|
|
2254
2291
|
" ",
|
|
2255
2292
|
translations2.katex.documentationLinkSuffix
|
|
2256
2293
|
] }),
|
|
2257
|
-
/* @__PURE__ */
|
|
2258
|
-
/* @__PURE__ */
|
|
2294
|
+
/* @__PURE__ */ jsxs20("div", { className: "katex-dialog-form-group", children: [
|
|
2295
|
+
/* @__PURE__ */ jsx69(
|
|
2259
2296
|
"label",
|
|
2260
2297
|
{
|
|
2261
2298
|
htmlFor: "katex-content",
|
|
@@ -2263,7 +2300,7 @@ var AddKatexDialog = ({
|
|
|
2263
2300
|
children: translations2.katex.label
|
|
2264
2301
|
}
|
|
2265
2302
|
),
|
|
2266
|
-
/* @__PURE__ */
|
|
2303
|
+
/* @__PURE__ */ jsx69(
|
|
2267
2304
|
"textarea",
|
|
2268
2305
|
{
|
|
2269
2306
|
ref: contentInputRef,
|
|
@@ -2278,8 +2315,8 @@ var AddKatexDialog = ({
|
|
|
2278
2315
|
)
|
|
2279
2316
|
] })
|
|
2280
2317
|
] }),
|
|
2281
|
-
/* @__PURE__ */
|
|
2282
|
-
/* @__PURE__ */
|
|
2318
|
+
/* @__PURE__ */ jsxs20("div", { className: "katex-dialog-actions", children: [
|
|
2319
|
+
/* @__PURE__ */ jsx69(
|
|
2283
2320
|
"button",
|
|
2284
2321
|
{
|
|
2285
2322
|
className: "katex-dialog-button-cancel",
|
|
@@ -2288,7 +2325,7 @@ var AddKatexDialog = ({
|
|
|
2288
2325
|
children: translations2.common.cancel
|
|
2289
2326
|
}
|
|
2290
2327
|
),
|
|
2291
|
-
/* @__PURE__ */
|
|
2328
|
+
/* @__PURE__ */ jsx69(
|
|
2292
2329
|
"button",
|
|
2293
2330
|
{
|
|
2294
2331
|
className: "katex-dialog-button-submit",
|
|
@@ -2305,7 +2342,7 @@ var AddKatexDialog = ({
|
|
|
2305
2342
|
|
|
2306
2343
|
// src/editor/dialogs/add-link-dialog/add-link-dialog.tsx
|
|
2307
2344
|
import { useEffect as useEffect7, useRef as useRef8, useState as useState8 } from "react";
|
|
2308
|
-
import { jsx as
|
|
2345
|
+
import { jsx as jsx70, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
2309
2346
|
var AddLinkDialog = ({
|
|
2310
2347
|
open,
|
|
2311
2348
|
onClose,
|
|
@@ -2385,17 +2422,17 @@ var AddLinkDialog = ({
|
|
|
2385
2422
|
handleSubmit();
|
|
2386
2423
|
}
|
|
2387
2424
|
};
|
|
2388
|
-
return /* @__PURE__ */
|
|
2425
|
+
return /* @__PURE__ */ jsxs21(
|
|
2389
2426
|
CommonModal,
|
|
2390
2427
|
{
|
|
2391
2428
|
open,
|
|
2392
2429
|
handleClose,
|
|
2393
2430
|
children: [
|
|
2394
|
-
/* @__PURE__ */
|
|
2395
|
-
/* @__PURE__ */
|
|
2396
|
-
/* @__PURE__ */
|
|
2397
|
-
/* @__PURE__ */
|
|
2398
|
-
/* @__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(
|
|
2399
2436
|
"label",
|
|
2400
2437
|
{
|
|
2401
2438
|
htmlFor: "link-title",
|
|
@@ -2403,7 +2440,7 @@ var AddLinkDialog = ({
|
|
|
2403
2440
|
children: translations2.link.title
|
|
2404
2441
|
}
|
|
2405
2442
|
),
|
|
2406
|
-
/* @__PURE__ */
|
|
2443
|
+
/* @__PURE__ */ jsx70(
|
|
2407
2444
|
"input",
|
|
2408
2445
|
{
|
|
2409
2446
|
ref: titleInputRef,
|
|
@@ -2417,8 +2454,8 @@ var AddLinkDialog = ({
|
|
|
2417
2454
|
}
|
|
2418
2455
|
)
|
|
2419
2456
|
] }),
|
|
2420
|
-
/* @__PURE__ */
|
|
2421
|
-
/* @__PURE__ */
|
|
2457
|
+
/* @__PURE__ */ jsxs21("div", { className: "link-dialog-form-group", children: [
|
|
2458
|
+
/* @__PURE__ */ jsx70(
|
|
2422
2459
|
"label",
|
|
2423
2460
|
{
|
|
2424
2461
|
htmlFor: "link-url",
|
|
@@ -2426,7 +2463,7 @@ var AddLinkDialog = ({
|
|
|
2426
2463
|
children: translations2.link.url
|
|
2427
2464
|
}
|
|
2428
2465
|
),
|
|
2429
|
-
/* @__PURE__ */
|
|
2466
|
+
/* @__PURE__ */ jsx70(
|
|
2430
2467
|
"input",
|
|
2431
2468
|
{
|
|
2432
2469
|
id: "link-url",
|
|
@@ -2439,9 +2476,9 @@ var AddLinkDialog = ({
|
|
|
2439
2476
|
}
|
|
2440
2477
|
)
|
|
2441
2478
|
] }),
|
|
2442
|
-
/* @__PURE__ */
|
|
2443
|
-
/* @__PURE__ */
|
|
2444
|
-
/* @__PURE__ */
|
|
2479
|
+
/* @__PURE__ */ jsxs21("div", { className: "link-dialog-form-group", children: [
|
|
2480
|
+
/* @__PURE__ */ jsxs21("label", { className: "link-dialog-checkbox-label", children: [
|
|
2481
|
+
/* @__PURE__ */ jsx70(
|
|
2445
2482
|
"input",
|
|
2446
2483
|
{
|
|
2447
2484
|
type: "checkbox",
|
|
@@ -2449,13 +2486,13 @@ var AddLinkDialog = ({
|
|
|
2449
2486
|
onChange: (e) => setOpenInNewTab(e.target.checked)
|
|
2450
2487
|
}
|
|
2451
2488
|
),
|
|
2452
|
-
/* @__PURE__ */
|
|
2489
|
+
/* @__PURE__ */ jsx70("span", { children: translations2.link.openInNewTab })
|
|
2453
2490
|
] }),
|
|
2454
|
-
/* @__PURE__ */
|
|
2491
|
+
/* @__PURE__ */ jsx70("p", { className: "link-dialog-help-text", children: translations2.link.openInNewTabHelp })
|
|
2455
2492
|
] }),
|
|
2456
|
-
/* @__PURE__ */
|
|
2457
|
-
/* @__PURE__ */
|
|
2458
|
-
/* @__PURE__ */
|
|
2493
|
+
/* @__PURE__ */ jsxs21("div", { className: "link-dialog-form-group", children: [
|
|
2494
|
+
/* @__PURE__ */ jsxs21("label", { className: "link-dialog-checkbox-label", children: [
|
|
2495
|
+
/* @__PURE__ */ jsx70(
|
|
2459
2496
|
"input",
|
|
2460
2497
|
{
|
|
2461
2498
|
type: "checkbox",
|
|
@@ -2463,14 +2500,14 @@ var AddLinkDialog = ({
|
|
|
2463
2500
|
onChange: (e) => setAddNoopener(e.target.checked)
|
|
2464
2501
|
}
|
|
2465
2502
|
),
|
|
2466
|
-
/* @__PURE__ */
|
|
2503
|
+
/* @__PURE__ */ jsx70("span", { children: translations2.link.addNofollow })
|
|
2467
2504
|
] }),
|
|
2468
|
-
/* @__PURE__ */
|
|
2505
|
+
/* @__PURE__ */ jsx70("p", { className: "link-dialog-help-text", children: translations2.link.addNofollowHelp })
|
|
2469
2506
|
] }),
|
|
2470
|
-
error && /* @__PURE__ */
|
|
2507
|
+
error && /* @__PURE__ */ jsx70(DialogError, { error })
|
|
2471
2508
|
] }),
|
|
2472
|
-
/* @__PURE__ */
|
|
2473
|
-
/* @__PURE__ */
|
|
2509
|
+
/* @__PURE__ */ jsxs21("div", { className: "link-dialog-actions", children: [
|
|
2510
|
+
/* @__PURE__ */ jsx70(
|
|
2474
2511
|
"button",
|
|
2475
2512
|
{
|
|
2476
2513
|
className: "link-dialog-button-cancel",
|
|
@@ -2479,7 +2516,7 @@ var AddLinkDialog = ({
|
|
|
2479
2516
|
children: translations2.common.cancel
|
|
2480
2517
|
}
|
|
2481
2518
|
),
|
|
2482
|
-
/* @__PURE__ */
|
|
2519
|
+
/* @__PURE__ */ jsx70(
|
|
2483
2520
|
"button",
|
|
2484
2521
|
{
|
|
2485
2522
|
className: "link-dialog-button-submit",
|
|
@@ -2569,7 +2606,7 @@ var detectVideoHosting = (src) => {
|
|
|
2569
2606
|
};
|
|
2570
2607
|
|
|
2571
2608
|
// src/editor/dialogs/add-video-dialog/add-video-dialog.tsx
|
|
2572
|
-
import { jsx as
|
|
2609
|
+
import { jsx as jsx71, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
2573
2610
|
var SUPPORTED_PLATFORMS = {
|
|
2574
2611
|
["youtube" /* Youtube */]: "YouTube",
|
|
2575
2612
|
["vimeo" /* Vimeo */]: "Vimeo",
|
|
@@ -2636,17 +2673,17 @@ var AddVideoDialog = ({ open, onClose, onVideoAdd }) => {
|
|
|
2636
2673
|
handleSubmit();
|
|
2637
2674
|
}
|
|
2638
2675
|
};
|
|
2639
|
-
return /* @__PURE__ */
|
|
2676
|
+
return /* @__PURE__ */ jsxs22(
|
|
2640
2677
|
CommonModal,
|
|
2641
2678
|
{
|
|
2642
2679
|
open,
|
|
2643
2680
|
handleClose,
|
|
2644
2681
|
children: [
|
|
2645
|
-
/* @__PURE__ */
|
|
2646
|
-
/* @__PURE__ */
|
|
2647
|
-
/* @__PURE__ */
|
|
2648
|
-
/* @__PURE__ */
|
|
2649
|
-
/* @__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(
|
|
2650
2687
|
"label",
|
|
2651
2688
|
{
|
|
2652
2689
|
htmlFor: "video-url",
|
|
@@ -2654,7 +2691,7 @@ var AddVideoDialog = ({ open, onClose, onVideoAdd }) => {
|
|
|
2654
2691
|
children: translations2.videoUpload.urlLabel
|
|
2655
2692
|
}
|
|
2656
2693
|
),
|
|
2657
|
-
/* @__PURE__ */
|
|
2694
|
+
/* @__PURE__ */ jsx71(
|
|
2658
2695
|
"input",
|
|
2659
2696
|
{
|
|
2660
2697
|
ref: urlInputRef,
|
|
@@ -2670,14 +2707,14 @@ var AddVideoDialog = ({ open, onClose, onVideoAdd }) => {
|
|
|
2670
2707
|
}
|
|
2671
2708
|
)
|
|
2672
2709
|
] }),
|
|
2673
|
-
/* @__PURE__ */
|
|
2674
|
-
/* @__PURE__ */
|
|
2675
|
-
/* @__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)) })
|
|
2676
2713
|
] }),
|
|
2677
|
-
error && /* @__PURE__ */
|
|
2714
|
+
error && /* @__PURE__ */ jsx71(DialogError, { error })
|
|
2678
2715
|
] }),
|
|
2679
|
-
/* @__PURE__ */
|
|
2680
|
-
/* @__PURE__ */
|
|
2716
|
+
/* @__PURE__ */ jsxs22("div", { className: "video-dialog-actions", children: [
|
|
2717
|
+
/* @__PURE__ */ jsx71(
|
|
2681
2718
|
"button",
|
|
2682
2719
|
{
|
|
2683
2720
|
className: "video-dialog-button-cancel",
|
|
@@ -2687,7 +2724,7 @@ var AddVideoDialog = ({ open, onClose, onVideoAdd }) => {
|
|
|
2687
2724
|
children: translations2.videoUpload.cancel
|
|
2688
2725
|
}
|
|
2689
2726
|
),
|
|
2690
|
-
/* @__PURE__ */
|
|
2727
|
+
/* @__PURE__ */ jsx71(
|
|
2691
2728
|
"button",
|
|
2692
2729
|
{
|
|
2693
2730
|
className: "video-dialog-button-submit",
|
|
@@ -5073,24 +5110,24 @@ import { NodeViewContent, NodeViewWrapper } from "@tiptap/react";
|
|
|
5073
5110
|
import { useState as useState10 } from "react";
|
|
5074
5111
|
|
|
5075
5112
|
// src/icons/color/TiptapCalloutError.tsx
|
|
5076
|
-
import { jsx as
|
|
5077
|
-
var SvgTiptapCalloutError = (props) => /* @__PURE__ */
|
|
5078
|
-
/* @__PURE__ */
|
|
5079
|
-
/* @__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(
|
|
5080
5117
|
"path",
|
|
5081
5118
|
{
|
|
5082
5119
|
fill: "#E03757",
|
|
5083
5120
|
d: "M10 0C4.477 0 0 4.477 0 10s4.477 10 10 10 10-4.477 10-10S15.523 0 10 0"
|
|
5084
5121
|
}
|
|
5085
5122
|
),
|
|
5086
|
-
/* @__PURE__ */
|
|
5123
|
+
/* @__PURE__ */ jsx72(
|
|
5087
5124
|
"path",
|
|
5088
5125
|
{
|
|
5089
5126
|
fill: "#F04760",
|
|
5090
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"
|
|
5091
5128
|
}
|
|
5092
5129
|
),
|
|
5093
|
-
/* @__PURE__ */
|
|
5130
|
+
/* @__PURE__ */ jsx72(
|
|
5094
5131
|
"path",
|
|
5095
5132
|
{
|
|
5096
5133
|
fill: "#fff",
|
|
@@ -5098,28 +5135,28 @@ var SvgTiptapCalloutError = (props) => /* @__PURE__ */ jsxs22("svg", { xmlns: "h
|
|
|
5098
5135
|
}
|
|
5099
5136
|
)
|
|
5100
5137
|
] }),
|
|
5101
|
-
/* @__PURE__ */
|
|
5138
|
+
/* @__PURE__ */ jsx72("defs", { children: /* @__PURE__ */ jsx72("clipPath", { id: "tiptap-callout-error_svg__a", children: /* @__PURE__ */ jsx72("path", { fill: "#fff", d: "M0 0h20v20H0z" }) }) })
|
|
5102
5139
|
] });
|
|
5103
5140
|
var TiptapCalloutError_default = SvgTiptapCalloutError;
|
|
5104
5141
|
|
|
5105
5142
|
// src/icons/color/TiptapCalloutInfo.tsx
|
|
5106
|
-
import { jsx as
|
|
5107
|
-
var SvgTiptapCalloutInfo = (props) => /* @__PURE__ */
|
|
5108
|
-
/* @__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(
|
|
5109
5146
|
"path",
|
|
5110
5147
|
{
|
|
5111
5148
|
fill: "#FE9738",
|
|
5112
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"
|
|
5113
5150
|
}
|
|
5114
5151
|
),
|
|
5115
|
-
/* @__PURE__ */
|
|
5152
|
+
/* @__PURE__ */ jsx73(
|
|
5116
5153
|
"path",
|
|
5117
5154
|
{
|
|
5118
5155
|
fill: "#FFD15B",
|
|
5119
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"
|
|
5120
5157
|
}
|
|
5121
5158
|
),
|
|
5122
|
-
/* @__PURE__ */
|
|
5159
|
+
/* @__PURE__ */ jsx73(
|
|
5123
5160
|
"path",
|
|
5124
5161
|
{
|
|
5125
5162
|
fill: "#FFC344",
|
|
@@ -5130,66 +5167,66 @@ var SvgTiptapCalloutInfo = (props) => /* @__PURE__ */ jsxs23("svg", { xmlns: "ht
|
|
|
5130
5167
|
var TiptapCalloutInfo_default = SvgTiptapCalloutInfo;
|
|
5131
5168
|
|
|
5132
5169
|
// src/icons/color/TiptapCalloutSuccess.tsx
|
|
5133
|
-
import { jsx as
|
|
5134
|
-
var SvgTiptapCalloutSuccess = (props) => /* @__PURE__ */
|
|
5135
|
-
/* @__PURE__ */
|
|
5136
|
-
/* @__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(
|
|
5137
5174
|
"path",
|
|
5138
5175
|
{
|
|
5139
5176
|
fill: "#35495E",
|
|
5140
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"
|
|
5141
5178
|
}
|
|
5142
5179
|
),
|
|
5143
|
-
/* @__PURE__ */
|
|
5180
|
+
/* @__PURE__ */ jsx74(
|
|
5144
5181
|
"path",
|
|
5145
5182
|
{
|
|
5146
5183
|
fill: "#2C3E50",
|
|
5147
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"
|
|
5148
5185
|
}
|
|
5149
5186
|
),
|
|
5150
|
-
/* @__PURE__ */
|
|
5187
|
+
/* @__PURE__ */ jsx74(
|
|
5151
5188
|
"path",
|
|
5152
5189
|
{
|
|
5153
5190
|
fill: "#F9EAB0",
|
|
5154
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"
|
|
5155
5192
|
}
|
|
5156
5193
|
),
|
|
5157
|
-
/* @__PURE__ */
|
|
5194
|
+
/* @__PURE__ */ jsx74(
|
|
5158
5195
|
"path",
|
|
5159
5196
|
{
|
|
5160
5197
|
fill: "#E64C3C",
|
|
5161
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"
|
|
5162
5199
|
}
|
|
5163
5200
|
),
|
|
5164
|
-
/* @__PURE__ */
|
|
5201
|
+
/* @__PURE__ */ jsx74(
|
|
5165
5202
|
"path",
|
|
5166
5203
|
{
|
|
5167
5204
|
fill: "#3F5C6C",
|
|
5168
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"
|
|
5169
5206
|
}
|
|
5170
5207
|
),
|
|
5171
|
-
/* @__PURE__ */
|
|
5208
|
+
/* @__PURE__ */ jsx74(
|
|
5172
5209
|
"path",
|
|
5173
5210
|
{
|
|
5174
5211
|
fill: "#ECF0F1",
|
|
5175
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"
|
|
5176
5213
|
}
|
|
5177
5214
|
),
|
|
5178
|
-
/* @__PURE__ */
|
|
5215
|
+
/* @__PURE__ */ jsx74(
|
|
5179
5216
|
"path",
|
|
5180
5217
|
{
|
|
5181
5218
|
fill: "#C03A2B",
|
|
5182
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"
|
|
5183
5220
|
}
|
|
5184
5221
|
),
|
|
5185
|
-
/* @__PURE__ */
|
|
5222
|
+
/* @__PURE__ */ jsx74(
|
|
5186
5223
|
"path",
|
|
5187
5224
|
{
|
|
5188
5225
|
fill: "#802F34",
|
|
5189
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"
|
|
5190
5227
|
}
|
|
5191
5228
|
),
|
|
5192
|
-
/* @__PURE__ */
|
|
5229
|
+
/* @__PURE__ */ jsx74(
|
|
5193
5230
|
"path",
|
|
5194
5231
|
{
|
|
5195
5232
|
fill: "#F9EAB0",
|
|
@@ -5197,14 +5234,14 @@ var SvgTiptapCalloutSuccess = (props) => /* @__PURE__ */ jsxs24("svg", { xmlns:
|
|
|
5197
5234
|
}
|
|
5198
5235
|
)
|
|
5199
5236
|
] }),
|
|
5200
|
-
/* @__PURE__ */
|
|
5237
|
+
/* @__PURE__ */ jsx74("defs", { children: /* @__PURE__ */ jsx74("clipPath", { id: "tiptap-callout-success_svg__a", children: /* @__PURE__ */ jsx74("path", { fill: "#fff", d: "M0 0h20v20H0z" }) }) })
|
|
5201
5238
|
] });
|
|
5202
5239
|
var TiptapCalloutSuccess_default = SvgTiptapCalloutSuccess;
|
|
5203
5240
|
|
|
5204
5241
|
// src/icons/color/TiptapCalloutWarning.tsx
|
|
5205
|
-
import { jsx as
|
|
5206
|
-
var SvgTiptapCalloutWarning = (props) => /* @__PURE__ */
|
|
5207
|
-
/* @__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(
|
|
5208
5245
|
"path",
|
|
5209
5246
|
{
|
|
5210
5247
|
fill: "#FFF59D",
|
|
@@ -5212,29 +5249,29 @@ var SvgTiptapCalloutWarning = (props) => /* @__PURE__ */ jsxs25("svg", { xmlns:
|
|
|
5212
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"
|
|
5213
5250
|
}
|
|
5214
5251
|
),
|
|
5215
|
-
/* @__PURE__ */
|
|
5252
|
+
/* @__PURE__ */ jsx75(
|
|
5216
5253
|
"path",
|
|
5217
5254
|
{
|
|
5218
5255
|
fill: "#FBC02D",
|
|
5219
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"
|
|
5220
5257
|
}
|
|
5221
5258
|
),
|
|
5222
|
-
/* @__PURE__ */
|
|
5259
|
+
/* @__PURE__ */ jsx75(
|
|
5223
5260
|
"path",
|
|
5224
5261
|
{
|
|
5225
5262
|
fill: "#FFF59D",
|
|
5226
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"
|
|
5227
5264
|
}
|
|
5228
5265
|
),
|
|
5229
|
-
/* @__PURE__ */
|
|
5230
|
-
/* @__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(
|
|
5231
5268
|
"path",
|
|
5232
5269
|
{
|
|
5233
5270
|
fill: "#9FA8DA",
|
|
5234
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"
|
|
5235
5272
|
}
|
|
5236
5273
|
),
|
|
5237
|
-
/* @__PURE__ */
|
|
5274
|
+
/* @__PURE__ */ jsx75(
|
|
5238
5275
|
"path",
|
|
5239
5276
|
{
|
|
5240
5277
|
fill: "#5C6BC0",
|
|
@@ -5387,12 +5424,12 @@ var calloutCustomEmojis = [
|
|
|
5387
5424
|
];
|
|
5388
5425
|
|
|
5389
5426
|
// src/extensions/views/components/callout.tsx
|
|
5390
|
-
import { jsx as
|
|
5427
|
+
import { jsx as jsx76, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
5391
5428
|
var calloutIcons = {
|
|
5392
|
-
info: /* @__PURE__ */
|
|
5393
|
-
warning: /* @__PURE__ */
|
|
5394
|
-
success: /* @__PURE__ */
|
|
5395
|
-
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, {})
|
|
5396
5433
|
};
|
|
5397
5434
|
var legacyTypeMap3 = {
|
|
5398
5435
|
question: "info",
|
|
@@ -5410,15 +5447,15 @@ var Callout = ({ type, bgColor, emoji: emoji2, children, iconWrapper, calloutTyp
|
|
|
5410
5447
|
if (emoji2) {
|
|
5411
5448
|
if (emoji2 in calloutIconComponents) {
|
|
5412
5449
|
const IconComponent = calloutIconComponents[emoji2];
|
|
5413
|
-
icon = /* @__PURE__ */
|
|
5450
|
+
icon = /* @__PURE__ */ jsx76(IconComponent, {});
|
|
5414
5451
|
} else {
|
|
5415
5452
|
icon = emoji2;
|
|
5416
5453
|
}
|
|
5417
5454
|
} else {
|
|
5418
5455
|
icon = calloutIcons[finalType];
|
|
5419
5456
|
}
|
|
5420
|
-
const iconContent = iconWrapper ? iconWrapper(icon) : /* @__PURE__ */
|
|
5421
|
-
return /* @__PURE__ */
|
|
5457
|
+
const iconContent = iconWrapper ? iconWrapper(icon) : /* @__PURE__ */ jsx76("div", { className: "callout-icon", children: icon });
|
|
5458
|
+
return /* @__PURE__ */ jsxs27(
|
|
5422
5459
|
"div",
|
|
5423
5460
|
{
|
|
5424
5461
|
className,
|
|
@@ -5428,33 +5465,33 @@ var Callout = ({ type, bgColor, emoji: emoji2, children, iconWrapper, calloutTyp
|
|
|
5428
5465
|
style,
|
|
5429
5466
|
children: [
|
|
5430
5467
|
iconContent,
|
|
5431
|
-
/* @__PURE__ */
|
|
5468
|
+
/* @__PURE__ */ jsx76("div", { className: "callout-content-wrapper", children: /* @__PURE__ */ jsx76("div", { className: "callout-content", children }) })
|
|
5432
5469
|
]
|
|
5433
5470
|
}
|
|
5434
5471
|
);
|
|
5435
5472
|
};
|
|
5436
5473
|
|
|
5437
5474
|
// src/extensions/views/components/code-block.tsx
|
|
5438
|
-
import { useMemo } from "react";
|
|
5475
|
+
import { useMemo as useMemo2 } from "react";
|
|
5439
5476
|
import html2 from "highlight.js/lib/languages/xml";
|
|
5440
5477
|
import { common as common2, createLowlight as createLowlight2 } from "lowlight";
|
|
5441
5478
|
|
|
5442
5479
|
// src/extensions/views/components/copy-button.tsx
|
|
5443
|
-
import { jsx as
|
|
5480
|
+
import { jsx as jsx77, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
5444
5481
|
var CopyButton = ({ iconSize = 16, color = "black" }) => {
|
|
5445
|
-
return /* @__PURE__ */
|
|
5482
|
+
return /* @__PURE__ */ jsxs28(
|
|
5446
5483
|
"button",
|
|
5447
5484
|
{
|
|
5448
5485
|
className: `copy-button copy-icon-${color}`,
|
|
5449
5486
|
"data-copy-action": "copy",
|
|
5450
5487
|
type: "button",
|
|
5451
5488
|
children: [
|
|
5452
|
-
/* @__PURE__ */
|
|
5489
|
+
/* @__PURE__ */ jsx77(
|
|
5453
5490
|
"span",
|
|
5454
5491
|
{
|
|
5455
5492
|
className: "copy-icon",
|
|
5456
5493
|
"data-copy-icon": "default",
|
|
5457
|
-
children: /* @__PURE__ */
|
|
5494
|
+
children: /* @__PURE__ */ jsx77(
|
|
5458
5495
|
Copy_default,
|
|
5459
5496
|
{
|
|
5460
5497
|
width: iconSize,
|
|
@@ -5463,13 +5500,13 @@ var CopyButton = ({ iconSize = 16, color = "black" }) => {
|
|
|
5463
5500
|
)
|
|
5464
5501
|
}
|
|
5465
5502
|
),
|
|
5466
|
-
/* @__PURE__ */
|
|
5503
|
+
/* @__PURE__ */ jsx77(
|
|
5467
5504
|
"span",
|
|
5468
5505
|
{
|
|
5469
5506
|
className: "copy-icon-success",
|
|
5470
5507
|
"data-copy-icon": "success",
|
|
5471
5508
|
style: { display: "none" },
|
|
5472
|
-
children: /* @__PURE__ */
|
|
5509
|
+
children: /* @__PURE__ */ jsx77(
|
|
5473
5510
|
Check_default,
|
|
5474
5511
|
{
|
|
5475
5512
|
width: iconSize,
|
|
@@ -5484,7 +5521,7 @@ var CopyButton = ({ iconSize = 16, color = "black" }) => {
|
|
|
5484
5521
|
};
|
|
5485
5522
|
|
|
5486
5523
|
// src/extensions/views/components/code-block.tsx
|
|
5487
|
-
import { jsx as
|
|
5524
|
+
import { jsx as jsx78, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
5488
5525
|
var CodeBlock = ({
|
|
5489
5526
|
language,
|
|
5490
5527
|
isEditable,
|
|
@@ -5492,7 +5529,7 @@ var CodeBlock = ({
|
|
|
5492
5529
|
children,
|
|
5493
5530
|
translations: translations2
|
|
5494
5531
|
}) => {
|
|
5495
|
-
const languagesList =
|
|
5532
|
+
const languagesList = useMemo2(() => {
|
|
5496
5533
|
const lowlight2 = createLowlight2(common2);
|
|
5497
5534
|
lowlight2.register("html", html2);
|
|
5498
5535
|
const list = lowlight2.listLanguages();
|
|
@@ -5501,17 +5538,17 @@ var CodeBlock = ({
|
|
|
5501
5538
|
const handleChange = (e) => {
|
|
5502
5539
|
onLanguageChange?.(e.target.value);
|
|
5503
5540
|
};
|
|
5504
|
-
return /* @__PURE__ */
|
|
5505
|
-
/* @__PURE__ */
|
|
5506
|
-
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(
|
|
5507
5544
|
"select",
|
|
5508
5545
|
{
|
|
5509
5546
|
className: "tiptap-code-block-language-select",
|
|
5510
5547
|
value: language,
|
|
5511
5548
|
onChange: handleChange,
|
|
5512
5549
|
children: [
|
|
5513
|
-
/* @__PURE__ */
|
|
5514
|
-
languagesList.map((lang) => /* @__PURE__ */
|
|
5550
|
+
/* @__PURE__ */ jsx78("option", { value: "", children: translations2?.codeBlock.selectLanguage }),
|
|
5551
|
+
languagesList.map((lang) => /* @__PURE__ */ jsx78(
|
|
5515
5552
|
"option",
|
|
5516
5553
|
{
|
|
5517
5554
|
value: lang,
|
|
@@ -5521,8 +5558,8 @@ var CodeBlock = ({
|
|
|
5521
5558
|
))
|
|
5522
5559
|
]
|
|
5523
5560
|
}
|
|
5524
|
-
) : /* @__PURE__ */
|
|
5525
|
-
/* @__PURE__ */
|
|
5561
|
+
) : /* @__PURE__ */ jsx78("span", { className: "tiptap-code-block-language-text", children: language || translations2?.codeBlock.selectLanguage }),
|
|
5562
|
+
/* @__PURE__ */ jsx78(
|
|
5526
5563
|
CopyButton,
|
|
5527
5564
|
{
|
|
5528
5565
|
iconSize: 20,
|
|
@@ -5530,7 +5567,7 @@ var CodeBlock = ({
|
|
|
5530
5567
|
}
|
|
5531
5568
|
)
|
|
5532
5569
|
] }),
|
|
5533
|
-
/* @__PURE__ */
|
|
5570
|
+
/* @__PURE__ */ jsx78("pre", { className: "tiptap-code-block", children: /* @__PURE__ */ jsx78(
|
|
5534
5571
|
"code",
|
|
5535
5572
|
{
|
|
5536
5573
|
className: "tiptap-code-block-content",
|
|
@@ -5542,22 +5579,22 @@ var CodeBlock = ({
|
|
|
5542
5579
|
};
|
|
5543
5580
|
|
|
5544
5581
|
// src/extensions/views/components/copyable-text.tsx
|
|
5545
|
-
import { jsx as
|
|
5582
|
+
import { jsx as jsx79, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
5546
5583
|
var CopyableText2 = ({ children }) => {
|
|
5547
|
-
return /* @__PURE__ */
|
|
5548
|
-
/* @__PURE__ */
|
|
5549
|
-
/* @__PURE__ */
|
|
5584
|
+
return /* @__PURE__ */ jsxs30("span", { className: "copyable", children: [
|
|
5585
|
+
/* @__PURE__ */ jsx79("span", { "data-copy-content": true, children }),
|
|
5586
|
+
/* @__PURE__ */ jsx79(CopyButton, { iconSize: 16 })
|
|
5550
5587
|
] });
|
|
5551
5588
|
};
|
|
5552
5589
|
|
|
5553
5590
|
// src/extensions/views/components/custom-quote.tsx
|
|
5554
|
-
import { jsx as
|
|
5555
|
-
var CustomQuote = ({ children }) => /* @__PURE__ */
|
|
5556
|
-
/* @__PURE__ */
|
|
5557
|
-
/* @__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, {}) }),
|
|
5558
5595
|
children
|
|
5559
5596
|
] });
|
|
5560
|
-
var CustomQuoteText = ({ children, isEmpty, placeholder }) => /* @__PURE__ */
|
|
5597
|
+
var CustomQuoteText = ({ children, isEmpty, placeholder }) => /* @__PURE__ */ jsx80(
|
|
5561
5598
|
"div",
|
|
5562
5599
|
{
|
|
5563
5600
|
"data-custom-quote-text": true,
|
|
@@ -5566,7 +5603,7 @@ var CustomQuoteText = ({ children, isEmpty, placeholder }) => /* @__PURE__ */ js
|
|
|
5566
5603
|
children
|
|
5567
5604
|
}
|
|
5568
5605
|
);
|
|
5569
|
-
var CustomQuoteAuthor = ({ children, isEmpty, placeholder }) => /* @__PURE__ */
|
|
5606
|
+
var CustomQuoteAuthor = ({ children, isEmpty, placeholder }) => /* @__PURE__ */ jsx80(
|
|
5570
5607
|
"div",
|
|
5571
5608
|
{
|
|
5572
5609
|
"data-custom-quote-author": "",
|
|
@@ -5575,7 +5612,7 @@ var CustomQuoteAuthor = ({ children, isEmpty, placeholder }) => /* @__PURE__ */
|
|
|
5575
5612
|
children
|
|
5576
5613
|
}
|
|
5577
5614
|
);
|
|
5578
|
-
var CustomQuoteSign = ({ children, isEmpty, placeholder }) => /* @__PURE__ */
|
|
5615
|
+
var CustomQuoteSign = ({ children, isEmpty, placeholder }) => /* @__PURE__ */ jsx80(
|
|
5579
5616
|
"div",
|
|
5580
5617
|
{
|
|
5581
5618
|
"data-custom-quote-sign": "",
|
|
@@ -5586,7 +5623,7 @@ var CustomQuoteSign = ({ children, isEmpty, placeholder }) => /* @__PURE__ */ js
|
|
|
5586
5623
|
);
|
|
5587
5624
|
|
|
5588
5625
|
// src/extensions/views/components/figure.tsx
|
|
5589
|
-
import { jsx as
|
|
5626
|
+
import { jsx as jsx81, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
5590
5627
|
var Figure = ({
|
|
5591
5628
|
src,
|
|
5592
5629
|
alt,
|
|
@@ -5601,9 +5638,9 @@ var Figure = ({
|
|
|
5601
5638
|
getImageById
|
|
5602
5639
|
}) => {
|
|
5603
5640
|
const resolvedSrc = resolveImageSrc({ fileId, src }, { getImageById });
|
|
5604
|
-
return /* @__PURE__ */
|
|
5605
|
-
resolvedSrc && /* @__PURE__ */
|
|
5606
|
-
/* @__PURE__ */
|
|
5641
|
+
return /* @__PURE__ */ jsxs32("figure", { children: [
|
|
5642
|
+
resolvedSrc && /* @__PURE__ */ jsxs32("div", { className: "figure-image-container", children: [
|
|
5643
|
+
/* @__PURE__ */ jsx81(
|
|
5607
5644
|
"img",
|
|
5608
5645
|
{
|
|
5609
5646
|
src: resolvedSrc,
|
|
@@ -5613,7 +5650,7 @@ var Figure = ({
|
|
|
5613
5650
|
height: height || void 0
|
|
5614
5651
|
}
|
|
5615
5652
|
),
|
|
5616
|
-
isEditable && onEditClick && /* @__PURE__ */
|
|
5653
|
+
isEditable && onEditClick && /* @__PURE__ */ jsx81(
|
|
5617
5654
|
"button",
|
|
5618
5655
|
{
|
|
5619
5656
|
type: "button",
|
|
@@ -5621,19 +5658,19 @@ var Figure = ({
|
|
|
5621
5658
|
onClick: onEditClick,
|
|
5622
5659
|
contentEditable: false,
|
|
5623
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",
|
|
5624
|
-
children: /* @__PURE__ */
|
|
5661
|
+
children: /* @__PURE__ */ jsx81(Edit_default, {})
|
|
5625
5662
|
}
|
|
5626
5663
|
)
|
|
5627
5664
|
] }),
|
|
5628
|
-
caption && /* @__PURE__ */
|
|
5665
|
+
caption && /* @__PURE__ */ jsx81("figcaption", { children: caption }),
|
|
5629
5666
|
children
|
|
5630
5667
|
] });
|
|
5631
5668
|
};
|
|
5632
5669
|
|
|
5633
5670
|
// src/extensions/views/components/prompt.tsx
|
|
5634
|
-
import { jsx as
|
|
5635
|
-
var PromptHeader = ({ children, isEmpty, placeholder }) => /* @__PURE__ */
|
|
5636
|
-
/* @__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(
|
|
5637
5674
|
"div",
|
|
5638
5675
|
{
|
|
5639
5676
|
className: isEmpty ? "is-empty" : "",
|
|
@@ -5641,7 +5678,7 @@ var PromptHeader = ({ children, isEmpty, placeholder }) => /* @__PURE__ */ jsxs3
|
|
|
5641
5678
|
children
|
|
5642
5679
|
}
|
|
5643
5680
|
),
|
|
5644
|
-
/* @__PURE__ */
|
|
5681
|
+
/* @__PURE__ */ jsx82("span", { className: "prompt-copy-icon-wrapper", children: /* @__PURE__ */ jsx82(
|
|
5645
5682
|
CopyButton,
|
|
5646
5683
|
{
|
|
5647
5684
|
iconSize: 16,
|
|
@@ -5649,7 +5686,7 @@ var PromptHeader = ({ children, isEmpty, placeholder }) => /* @__PURE__ */ jsxs3
|
|
|
5649
5686
|
}
|
|
5650
5687
|
) })
|
|
5651
5688
|
] });
|
|
5652
|
-
var PromptContent = ({ children, isEmpty, placeholder }) => /* @__PURE__ */
|
|
5689
|
+
var PromptContent = ({ children, isEmpty, placeholder }) => /* @__PURE__ */ jsx82("div", { className: "prompt-content-wrapper", children: /* @__PURE__ */ jsx82(
|
|
5653
5690
|
"div",
|
|
5654
5691
|
{
|
|
5655
5692
|
className: isEmpty ? "is-empty" : "",
|
|
@@ -5660,22 +5697,22 @@ var PromptContent = ({ children, isEmpty, placeholder }) => /* @__PURE__ */ jsx8
|
|
|
5660
5697
|
) });
|
|
5661
5698
|
|
|
5662
5699
|
// src/extensions/views/components/video.tsx
|
|
5663
|
-
import { jsx as
|
|
5700
|
+
import { jsx as jsx83, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
5664
5701
|
var Video = ({ src, children }) => {
|
|
5665
5702
|
const videoInfo = detectVideoHosting(src);
|
|
5666
5703
|
if (!videoInfo?.embedUrl) {
|
|
5667
|
-
return /* @__PURE__ */
|
|
5668
|
-
/* @__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" }) }),
|
|
5669
5706
|
children
|
|
5670
5707
|
] });
|
|
5671
5708
|
}
|
|
5672
|
-
return /* @__PURE__ */
|
|
5709
|
+
return /* @__PURE__ */ jsxs34(
|
|
5673
5710
|
"div",
|
|
5674
5711
|
{
|
|
5675
5712
|
className: "video-node",
|
|
5676
5713
|
"data-video": "",
|
|
5677
5714
|
children: [
|
|
5678
|
-
/* @__PURE__ */
|
|
5715
|
+
/* @__PURE__ */ jsx83("div", { className: "video-player-wrapper", children: /* @__PURE__ */ jsx83(
|
|
5679
5716
|
"iframe",
|
|
5680
5717
|
{
|
|
5681
5718
|
className: "video-iframe",
|
|
@@ -5694,7 +5731,7 @@ var Video = ({ src, children }) => {
|
|
|
5694
5731
|
// src/editor/controls/emoji-picker.tsx
|
|
5695
5732
|
import { useEffect as useEffect9, useRef as useRef10 } from "react";
|
|
5696
5733
|
import EmojiPicker from "emoji-picker-react";
|
|
5697
|
-
import { jsx as
|
|
5734
|
+
import { jsx as jsx84 } from "react/jsx-runtime";
|
|
5698
5735
|
var EmojiPickerComponent = ({ isOpen, onClose, onEmojiSelect }) => {
|
|
5699
5736
|
const pickerRef = useRef10(null);
|
|
5700
5737
|
const translations2 = useTiptapTranslations();
|
|
@@ -5712,12 +5749,12 @@ var EmojiPickerComponent = ({ isOpen, onClose, onEmojiSelect }) => {
|
|
|
5712
5749
|
};
|
|
5713
5750
|
}, [isOpen, onClose]);
|
|
5714
5751
|
if (!isOpen) return null;
|
|
5715
|
-
return /* @__PURE__ */
|
|
5752
|
+
return /* @__PURE__ */ jsx84(
|
|
5716
5753
|
"div",
|
|
5717
5754
|
{
|
|
5718
5755
|
ref: pickerRef,
|
|
5719
5756
|
className: "tiptap__emoji-picker-wrapper",
|
|
5720
|
-
children: /* @__PURE__ */
|
|
5757
|
+
children: /* @__PURE__ */ jsx84(
|
|
5721
5758
|
EmojiPicker,
|
|
5722
5759
|
{
|
|
5723
5760
|
skinTonesDisabled: true,
|
|
@@ -5742,7 +5779,7 @@ var EmojiPickerComponent = ({ isOpen, onClose, onEmojiSelect }) => {
|
|
|
5742
5779
|
};
|
|
5743
5780
|
|
|
5744
5781
|
// src/extensions/views/node-views/callout.tsx
|
|
5745
|
-
import { jsx as
|
|
5782
|
+
import { jsx as jsx85, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
5746
5783
|
var CalloutView = (props) => {
|
|
5747
5784
|
const type = props.node.attrs.type || "info";
|
|
5748
5785
|
const bgColor = props.node.attrs.bgColor;
|
|
@@ -5757,23 +5794,23 @@ var CalloutView = (props) => {
|
|
|
5757
5794
|
props.updateAttributes({ emoji: newEmoji });
|
|
5758
5795
|
setShowEmojiPicker(false);
|
|
5759
5796
|
};
|
|
5760
|
-
return /* @__PURE__ */
|
|
5797
|
+
return /* @__PURE__ */ jsx85(NodeViewWrapper, { children: /* @__PURE__ */ jsx85(
|
|
5761
5798
|
Callout,
|
|
5762
5799
|
{
|
|
5763
5800
|
type,
|
|
5764
5801
|
bgColor,
|
|
5765
5802
|
emoji: emoji2,
|
|
5766
|
-
iconWrapper: (icon) => /* @__PURE__ */
|
|
5767
|
-
/* @__PURE__ */
|
|
5803
|
+
iconWrapper: (icon) => /* @__PURE__ */ jsxs35("div", { className: "callout-icon-wrapper", children: [
|
|
5804
|
+
/* @__PURE__ */ jsx85(
|
|
5768
5805
|
"button",
|
|
5769
5806
|
{
|
|
5770
5807
|
className: "callout-icon-button",
|
|
5771
5808
|
onClick: handleIconClick,
|
|
5772
5809
|
type: "button",
|
|
5773
|
-
children: /* @__PURE__ */
|
|
5810
|
+
children: /* @__PURE__ */ jsx85("div", { className: "callout-icon", children: icon })
|
|
5774
5811
|
}
|
|
5775
5812
|
),
|
|
5776
|
-
/* @__PURE__ */
|
|
5813
|
+
/* @__PURE__ */ jsx85(
|
|
5777
5814
|
EmojiPickerComponent,
|
|
5778
5815
|
{
|
|
5779
5816
|
isOpen: showEmojiPicker,
|
|
@@ -5782,7 +5819,7 @@ var CalloutView = (props) => {
|
|
|
5782
5819
|
}
|
|
5783
5820
|
)
|
|
5784
5821
|
] }),
|
|
5785
|
-
children: /* @__PURE__ */
|
|
5822
|
+
children: /* @__PURE__ */ jsx85(NodeViewContent, { as: "div" })
|
|
5786
5823
|
}
|
|
5787
5824
|
) });
|
|
5788
5825
|
};
|
|
@@ -5790,7 +5827,7 @@ var CalloutView = (props) => {
|
|
|
5790
5827
|
// src/extensions/views/node-views/code-block.tsx
|
|
5791
5828
|
import { useState as useState11 } from "react";
|
|
5792
5829
|
import { NodeViewContent as NodeViewContent2, NodeViewWrapper as NodeViewWrapper2 } from "@tiptap/react";
|
|
5793
|
-
import { jsx as
|
|
5830
|
+
import { jsx as jsx86 } from "react/jsx-runtime";
|
|
5794
5831
|
var CodeBlockView = (props) => {
|
|
5795
5832
|
const [selectedLanguage, setSelectedLanguage] = useState11(props.node.attrs.language ?? "");
|
|
5796
5833
|
const translations2 = useTiptapTranslations();
|
|
@@ -5798,71 +5835,71 @@ var CodeBlockView = (props) => {
|
|
|
5798
5835
|
props.updateAttributes({ language });
|
|
5799
5836
|
setSelectedLanguage(language);
|
|
5800
5837
|
};
|
|
5801
|
-
return /* @__PURE__ */
|
|
5838
|
+
return /* @__PURE__ */ jsx86(NodeViewWrapper2, { children: /* @__PURE__ */ jsx86(
|
|
5802
5839
|
CodeBlock,
|
|
5803
5840
|
{
|
|
5804
5841
|
language: selectedLanguage,
|
|
5805
5842
|
isEditable: props.editor.isEditable,
|
|
5806
5843
|
onLanguageChange: handleLanguageChange,
|
|
5807
5844
|
translations: translations2,
|
|
5808
|
-
children: /* @__PURE__ */
|
|
5845
|
+
children: /* @__PURE__ */ jsx86(NodeViewContent2, {})
|
|
5809
5846
|
}
|
|
5810
5847
|
) });
|
|
5811
5848
|
};
|
|
5812
5849
|
|
|
5813
5850
|
// src/extensions/views/node-views/copyable-text.tsx
|
|
5814
5851
|
import { MarkViewContent } from "@tiptap/react";
|
|
5815
|
-
import { jsx as
|
|
5852
|
+
import { jsx as jsx87 } from "react/jsx-runtime";
|
|
5816
5853
|
var CopyableTextView = () => {
|
|
5817
|
-
return /* @__PURE__ */
|
|
5854
|
+
return /* @__PURE__ */ jsx87(CopyableText2, { children: /* @__PURE__ */ jsx87(MarkViewContent, {}) });
|
|
5818
5855
|
};
|
|
5819
5856
|
|
|
5820
5857
|
// src/extensions/views/node-views/custom-quote.tsx
|
|
5821
5858
|
import { NodeViewContent as NodeViewContent3, NodeViewWrapper as NodeViewWrapper3 } from "@tiptap/react";
|
|
5822
|
-
import { jsx as
|
|
5859
|
+
import { jsx as jsx88 } from "react/jsx-runtime";
|
|
5823
5860
|
var CustomQuoteView = () => {
|
|
5824
|
-
return /* @__PURE__ */
|
|
5861
|
+
return /* @__PURE__ */ jsx88(NodeViewWrapper3, { children: /* @__PURE__ */ jsx88(CustomQuote, { children: /* @__PURE__ */ jsx88(NodeViewContent3, {}) }) });
|
|
5825
5862
|
};
|
|
5826
5863
|
var CustomQuoteTextView = (props) => {
|
|
5827
5864
|
const isEmpty = !props.node.content.size;
|
|
5828
5865
|
const translations2 = useTiptapTranslations();
|
|
5829
|
-
return /* @__PURE__ */
|
|
5866
|
+
return /* @__PURE__ */ jsx88(NodeViewWrapper3, { children: /* @__PURE__ */ jsx88(
|
|
5830
5867
|
CustomQuoteText,
|
|
5831
5868
|
{
|
|
5832
5869
|
isEmpty,
|
|
5833
5870
|
placeholder: translations2.customQuote.textPlaceholder,
|
|
5834
|
-
children: /* @__PURE__ */
|
|
5871
|
+
children: /* @__PURE__ */ jsx88(NodeViewContent3, { className: isEmpty ? "is-empty" : "" })
|
|
5835
5872
|
}
|
|
5836
5873
|
) });
|
|
5837
5874
|
};
|
|
5838
5875
|
var CustomQuoteAuthorView = (props) => {
|
|
5839
5876
|
const isEmpty = !props.node.content.size;
|
|
5840
5877
|
const translations2 = useTiptapTranslations();
|
|
5841
|
-
return /* @__PURE__ */
|
|
5878
|
+
return /* @__PURE__ */ jsx88(NodeViewWrapper3, { children: /* @__PURE__ */ jsx88(
|
|
5842
5879
|
CustomQuoteAuthor,
|
|
5843
5880
|
{
|
|
5844
5881
|
isEmpty,
|
|
5845
5882
|
placeholder: translations2.customQuote.authorPlaceholder,
|
|
5846
|
-
children: /* @__PURE__ */
|
|
5883
|
+
children: /* @__PURE__ */ jsx88(NodeViewContent3, { className: isEmpty ? "is-empty" : "" })
|
|
5847
5884
|
}
|
|
5848
5885
|
) });
|
|
5849
5886
|
};
|
|
5850
5887
|
var CustomQuoteSignView = (props) => {
|
|
5851
5888
|
const isEmpty = !props.node.content.size;
|
|
5852
5889
|
const translations2 = useTiptapTranslations();
|
|
5853
|
-
return /* @__PURE__ */
|
|
5890
|
+
return /* @__PURE__ */ jsx88(NodeViewWrapper3, { children: /* @__PURE__ */ jsx88(
|
|
5854
5891
|
CustomQuoteSign,
|
|
5855
5892
|
{
|
|
5856
5893
|
isEmpty,
|
|
5857
5894
|
placeholder: translations2.customQuote.signPlaceholder,
|
|
5858
|
-
children: /* @__PURE__ */
|
|
5895
|
+
children: /* @__PURE__ */ jsx88(NodeViewContent3, { className: isEmpty ? "is-empty" : "" })
|
|
5859
5896
|
}
|
|
5860
5897
|
) });
|
|
5861
5898
|
};
|
|
5862
5899
|
|
|
5863
5900
|
// src/extensions/views/node-views/figure.tsx
|
|
5864
5901
|
import { NodeViewWrapper as NodeViewWrapper4 } from "@tiptap/react";
|
|
5865
|
-
import { jsx as
|
|
5902
|
+
import { jsx as jsx89 } from "react/jsx-runtime";
|
|
5866
5903
|
var FigureView = ({ node, getPos, editor }) => {
|
|
5867
5904
|
const { fileId, src, alt, title, caption, width, height } = node.attrs;
|
|
5868
5905
|
const imageExtension = editor.extensionManager.extensions.find((ext) => ext.name === "image");
|
|
@@ -5871,12 +5908,12 @@ var FigureView = ({ node, getPos, editor }) => {
|
|
|
5871
5908
|
const handleEditClick = () => {
|
|
5872
5909
|
onFigureClick?.(node.attrs, getPos());
|
|
5873
5910
|
};
|
|
5874
|
-
return /* @__PURE__ */
|
|
5911
|
+
return /* @__PURE__ */ jsx89(
|
|
5875
5912
|
NodeViewWrapper4,
|
|
5876
5913
|
{
|
|
5877
5914
|
className: "figure-node-view",
|
|
5878
5915
|
"data-drag-handle": true,
|
|
5879
|
-
children: /* @__PURE__ */
|
|
5916
|
+
children: /* @__PURE__ */ jsx89(
|
|
5880
5917
|
Figure,
|
|
5881
5918
|
{
|
|
5882
5919
|
fileId,
|
|
@@ -5897,38 +5934,38 @@ var FigureView = ({ node, getPos, editor }) => {
|
|
|
5897
5934
|
|
|
5898
5935
|
// src/extensions/views/node-views/prompt.tsx
|
|
5899
5936
|
import { NodeViewContent as NodeViewContent4, NodeViewWrapper as NodeViewWrapper5 } from "@tiptap/react";
|
|
5900
|
-
import { jsx as
|
|
5937
|
+
import { jsx as jsx90 } from "react/jsx-runtime";
|
|
5901
5938
|
var PromptHeaderView = (props) => {
|
|
5902
5939
|
const isEmpty = !props.node.content.size;
|
|
5903
5940
|
const translations2 = useTiptapTranslations();
|
|
5904
|
-
return /* @__PURE__ */
|
|
5941
|
+
return /* @__PURE__ */ jsx90(NodeViewWrapper5, { children: /* @__PURE__ */ jsx90(
|
|
5905
5942
|
PromptHeader,
|
|
5906
5943
|
{
|
|
5907
5944
|
isEmpty,
|
|
5908
5945
|
placeholder: translations2.prompt.headerPlaceholder,
|
|
5909
|
-
children: /* @__PURE__ */
|
|
5946
|
+
children: /* @__PURE__ */ jsx90(NodeViewContent4, { className: isEmpty ? "is-empty" : "" })
|
|
5910
5947
|
}
|
|
5911
5948
|
) });
|
|
5912
5949
|
};
|
|
5913
5950
|
var PromptContentView = (props) => {
|
|
5914
5951
|
const isEmpty = !props.node.content.size;
|
|
5915
5952
|
const translations2 = useTiptapTranslations();
|
|
5916
|
-
return /* @__PURE__ */
|
|
5953
|
+
return /* @__PURE__ */ jsx90(NodeViewWrapper5, { children: /* @__PURE__ */ jsx90(
|
|
5917
5954
|
PromptContent,
|
|
5918
5955
|
{
|
|
5919
5956
|
isEmpty,
|
|
5920
5957
|
placeholder: translations2.prompt.contentPlaceholder,
|
|
5921
|
-
children: /* @__PURE__ */
|
|
5958
|
+
children: /* @__PURE__ */ jsx90(NodeViewContent4, { className: isEmpty ? "is-empty" : "" })
|
|
5922
5959
|
}
|
|
5923
5960
|
) });
|
|
5924
5961
|
};
|
|
5925
5962
|
|
|
5926
5963
|
// src/extensions/views/node-views/video.tsx
|
|
5927
5964
|
import { NodeViewContent as NodeViewContent5, NodeViewWrapper as NodeViewWrapper6 } from "@tiptap/react";
|
|
5928
|
-
import { jsx as
|
|
5965
|
+
import { jsx as jsx91 } from "react/jsx-runtime";
|
|
5929
5966
|
var VideoView = (props) => {
|
|
5930
5967
|
const { src } = props.node.attrs;
|
|
5931
|
-
return /* @__PURE__ */
|
|
5968
|
+
return /* @__PURE__ */ jsx91(NodeViewWrapper6, { children: /* @__PURE__ */ jsx91(Video, { src, children: /* @__PURE__ */ jsx91(
|
|
5932
5969
|
NodeViewContent5,
|
|
5933
5970
|
{
|
|
5934
5971
|
as: "div",
|
|
@@ -7225,7 +7262,7 @@ var filterCommandItems = (items, query) => {
|
|
|
7225
7262
|
};
|
|
7226
7263
|
|
|
7227
7264
|
// src/editor/commands/suggestion.tsx
|
|
7228
|
-
import { jsx as
|
|
7265
|
+
import { jsx as jsx92 } from "react/jsx-runtime";
|
|
7229
7266
|
var component = null;
|
|
7230
7267
|
var closeMenu = () => {
|
|
7231
7268
|
if (component) {
|
|
@@ -7239,7 +7276,7 @@ var mapCommandMenuItemToCommandItem = (item) => {
|
|
|
7239
7276
|
const IconComponent = item.icon;
|
|
7240
7277
|
return {
|
|
7241
7278
|
title: item.title,
|
|
7242
|
-
icon: /* @__PURE__ */
|
|
7279
|
+
icon: /* @__PURE__ */ jsx92(IconComponent, {}),
|
|
7243
7280
|
command: ({ editor, range }) => {
|
|
7244
7281
|
editor.chain().focus().deleteRange(range).run();
|
|
7245
7282
|
item.onClick(editor);
|
|
@@ -7448,9 +7485,7 @@ var ru_default = {
|
|
|
7448
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...",
|
|
7449
7486
|
save: "\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C",
|
|
7450
7487
|
add: "\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C",
|
|
7451
|
-
invalidFileType: "\
|
|
7452
|
-
unknownError: "\u041D\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043D\u0430\u044F \u043E\u0448\u0438\u0431\u043A\u0430",
|
|
7453
|
-
clearError: "\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u043E\u0448\u0438\u0431\u043A\u0443"
|
|
7488
|
+
invalidFileType: "\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0444\u043E\u0440\u043C\u0430\u0442 \u0444\u0430\u0439\u043B\u0430."
|
|
7454
7489
|
},
|
|
7455
7490
|
videoUpload: {
|
|
7456
7491
|
title: "\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0432\u0438\u0434\u0435\u043E",
|
|
@@ -7495,7 +7530,9 @@ var ru_default = {
|
|
|
7495
7530
|
words: ["\u0441\u043B\u043E\u0432\u043E", "\u0441\u043B\u043E\u0432\u0430", "\u0441\u043B\u043E\u0432"]
|
|
7496
7531
|
},
|
|
7497
7532
|
common: {
|
|
7498
|
-
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"
|
|
7499
7536
|
}
|
|
7500
7537
|
};
|
|
7501
7538
|
|
|
@@ -7615,9 +7652,7 @@ var en_default = {
|
|
|
7615
7652
|
captionPlaceholder: "Description under image...",
|
|
7616
7653
|
save: "Save",
|
|
7617
7654
|
add: "Add",
|
|
7618
|
-
invalidFileType: "
|
|
7619
|
-
unknownError: "Unknown error",
|
|
7620
|
-
clearError: "Clear error"
|
|
7655
|
+
invalidFileType: "Invalid file format."
|
|
7621
7656
|
},
|
|
7622
7657
|
videoUpload: {
|
|
7623
7658
|
title: "Add video",
|
|
@@ -7662,7 +7697,9 @@ var en_default = {
|
|
|
7662
7697
|
words: ["word", "words", "words"]
|
|
7663
7698
|
},
|
|
7664
7699
|
common: {
|
|
7665
|
-
cancel: "Cancel"
|
|
7700
|
+
cancel: "Cancel",
|
|
7701
|
+
unknownError: "Unknown error",
|
|
7702
|
+
clearError: "Clear error"
|
|
7666
7703
|
}
|
|
7667
7704
|
};
|
|
7668
7705
|
|
|
@@ -7676,7 +7713,7 @@ function getTranslations(lang) {
|
|
|
7676
7713
|
}
|
|
7677
7714
|
|
|
7678
7715
|
// src/editor/editor.tsx
|
|
7679
|
-
import { Fragment as Fragment5, jsx as
|
|
7716
|
+
import { Fragment as Fragment5, jsx as jsx93, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
7680
7717
|
function TiptapContent({
|
|
7681
7718
|
content,
|
|
7682
7719
|
handleChange,
|
|
@@ -7823,16 +7860,16 @@ function TiptapContent({
|
|
|
7823
7860
|
return true;
|
|
7824
7861
|
};
|
|
7825
7862
|
if (!editor) return null;
|
|
7826
|
-
return /* @__PURE__ */
|
|
7827
|
-
/* @__PURE__ */
|
|
7828
|
-
isEditable && !disabled && /* @__PURE__ */
|
|
7829
|
-
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(
|
|
7830
7867
|
BubbleMenu,
|
|
7831
7868
|
{
|
|
7832
7869
|
shouldShow: shouldBubbleMenuShow,
|
|
7833
7870
|
editor,
|
|
7834
7871
|
options: { placement: "bottom", offset: 8, flip: true },
|
|
7835
|
-
children: /* @__PURE__ */
|
|
7872
|
+
children: /* @__PURE__ */ jsx93(
|
|
7836
7873
|
BubbleMenuContent,
|
|
7837
7874
|
{
|
|
7838
7875
|
editor,
|
|
@@ -7841,19 +7878,19 @@ function TiptapContent({
|
|
|
7841
7878
|
)
|
|
7842
7879
|
}
|
|
7843
7880
|
),
|
|
7844
|
-
/* @__PURE__ */
|
|
7881
|
+
/* @__PURE__ */ jsxs36(
|
|
7845
7882
|
"div",
|
|
7846
7883
|
{
|
|
7847
7884
|
className: `tiptap-content-wrapper ${!!error ? "has-error" : ""} ${disabled ? "is-disabled" : ""}`,
|
|
7848
7885
|
children: [
|
|
7849
|
-
/* @__PURE__ */
|
|
7850
|
-
isEditable && !disabled && /* @__PURE__ */
|
|
7886
|
+
/* @__PURE__ */ jsx93(EditorContent, { editor }),
|
|
7887
|
+
isEditable && !disabled && /* @__PURE__ */ jsx93(CharacterCount, { editor })
|
|
7851
7888
|
]
|
|
7852
7889
|
}
|
|
7853
7890
|
),
|
|
7854
|
-
!!error && /* @__PURE__ */
|
|
7855
|
-
isEditable && /* @__PURE__ */
|
|
7856
|
-
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(
|
|
7857
7894
|
ImageDialog,
|
|
7858
7895
|
{
|
|
7859
7896
|
open: true,
|
|
@@ -7867,7 +7904,7 @@ function TiptapContent({
|
|
|
7867
7904
|
mode: editFigureContext ? "edit" : "add"
|
|
7868
7905
|
}
|
|
7869
7906
|
),
|
|
7870
|
-
activeDialog === "link" && /* @__PURE__ */
|
|
7907
|
+
activeDialog === "link" && /* @__PURE__ */ jsx93(
|
|
7871
7908
|
AddLinkDialog,
|
|
7872
7909
|
{
|
|
7873
7910
|
open: true,
|
|
@@ -7876,7 +7913,7 @@ function TiptapContent({
|
|
|
7876
7913
|
linkDialogContext
|
|
7877
7914
|
}
|
|
7878
7915
|
),
|
|
7879
|
-
activeDialog === "video" && /* @__PURE__ */
|
|
7916
|
+
activeDialog === "video" && /* @__PURE__ */ jsx93(
|
|
7880
7917
|
AddVideoDialog,
|
|
7881
7918
|
{
|
|
7882
7919
|
open: true,
|
|
@@ -7884,7 +7921,7 @@ function TiptapContent({
|
|
|
7884
7921
|
onVideoAdd: handleVideoAdd
|
|
7885
7922
|
}
|
|
7886
7923
|
),
|
|
7887
|
-
activeDialog === "katex" && /* @__PURE__ */
|
|
7924
|
+
activeDialog === "katex" && /* @__PURE__ */ jsx93(
|
|
7888
7925
|
AddKatexDialog,
|
|
7889
7926
|
{
|
|
7890
7927
|
open: true,
|
|
@@ -7899,7 +7936,7 @@ function TiptapContent({
|
|
|
7899
7936
|
var Tiptap = (props) => {
|
|
7900
7937
|
const { lang = "ru" } = props;
|
|
7901
7938
|
const translations2 = getTranslations(lang);
|
|
7902
|
-
return /* @__PURE__ */
|
|
7939
|
+
return /* @__PURE__ */ jsx93(TiptapTranslationsProvider, { translations: translations2, children: /* @__PURE__ */ jsx93(DialogCommandProvider, { children: /* @__PURE__ */ jsx93(TiptapContent, { ...props }) }) });
|
|
7903
7940
|
};
|
|
7904
7941
|
|
|
7905
7942
|
// src/utils/html-to-tiptap-content.ts
|