@editorcn/editor 0.5.0 → 0.5.1
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/CHANGELOG.md +16 -0
- package/dist/index.cjs +702 -356
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -3
- package/dist/index.d.ts +6 -3
- package/dist/index.js +576 -230
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -533,6 +533,7 @@ RteDropdownIcon.displayName = "RteDropdownIcon";
|
|
|
533
533
|
// src/ui/toggle.tsx
|
|
534
534
|
import { Toggle as TogglePrimitive } from "@base-ui/react/toggle";
|
|
535
535
|
import { cva as cva2 } from "class-variance-authority";
|
|
536
|
+
import { forwardRef as forwardRef11 } from "react";
|
|
536
537
|
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
537
538
|
var toggleVariants = cva2(
|
|
538
539
|
"group/toggle inline-flex items-center justify-center gap-1 rounded-md text-xs font-medium whitespace-nowrap transition-all outline-none hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-pressed:bg-muted data-[state=on]:bg-muted dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
@@ -554,19 +555,16 @@ var toggleVariants = cva2(
|
|
|
554
555
|
}
|
|
555
556
|
}
|
|
556
557
|
);
|
|
557
|
-
var Toggle = ({
|
|
558
|
-
className,
|
|
559
|
-
variant = "default",
|
|
560
|
-
size = "default",
|
|
561
|
-
...props
|
|
562
|
-
}) => /* @__PURE__ */ jsx15(
|
|
558
|
+
var Toggle = forwardRef11(({ className, variant = "default", size = "default", ...props }, ref) => /* @__PURE__ */ jsx15(
|
|
563
559
|
TogglePrimitive,
|
|
564
560
|
{
|
|
561
|
+
ref,
|
|
565
562
|
"data-slot": "toggle",
|
|
566
563
|
className: cn(toggleVariants({ className, size, variant })),
|
|
567
564
|
...props
|
|
568
565
|
}
|
|
569
|
-
);
|
|
566
|
+
));
|
|
567
|
+
Toggle.displayName = "Toggle";
|
|
570
568
|
|
|
571
569
|
// src/ui/tooltip.tsx
|
|
572
570
|
import { Tooltip as TooltipPrimitive } from "@base-ui/react/tooltip";
|
|
@@ -1022,7 +1020,7 @@ var BubbleMenu = ({ editor }) => {
|
|
|
1022
1020
|
|
|
1023
1021
|
// src/controls/rte-control.tsx
|
|
1024
1022
|
import { useEditorState as useEditorState2 } from "@tiptap/react";
|
|
1025
|
-
import { useContext as useContext2 } from "react";
|
|
1023
|
+
import { cloneElement, forwardRef as forwardRef12, useContext as useContext2 } from "react";
|
|
1026
1024
|
|
|
1027
1025
|
// src/rte-context.ts
|
|
1028
1026
|
import { createContext, useContext } from "react";
|
|
@@ -1041,45 +1039,69 @@ var useRichTextEditorContext = () => {
|
|
|
1041
1039
|
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
1042
1040
|
var RichTextEditorTooltip = ({
|
|
1043
1041
|
children,
|
|
1042
|
+
id,
|
|
1044
1043
|
label
|
|
1045
1044
|
}) => {
|
|
1046
1045
|
const tooltip = useContext2(RichTextEditorContext)?.tooltip;
|
|
1047
1046
|
if (!tooltip) {
|
|
1048
|
-
return children;
|
|
1047
|
+
return id ? cloneElement(children, { id }) : children;
|
|
1049
1048
|
}
|
|
1050
|
-
return /* @__PURE__ */ jsx20(
|
|
1051
|
-
|
|
1052
|
-
var RichTextEditorControl = ({
|
|
1053
|
-
active = false,
|
|
1054
|
-
interactive: _interactive = true,
|
|
1055
|
-
className,
|
|
1056
|
-
children,
|
|
1057
|
-
onMouseDown,
|
|
1058
|
-
onClick,
|
|
1059
|
-
disabled,
|
|
1060
|
-
...props
|
|
1061
|
-
}) => {
|
|
1062
|
-
const toggle = /* @__PURE__ */ jsx20(
|
|
1063
|
-
Toggle,
|
|
1049
|
+
return /* @__PURE__ */ jsx20(
|
|
1050
|
+
TooltipTrigger,
|
|
1064
1051
|
{
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
className: cn(
|
|
1070
|
-
"rte-control-button inline-flex h-8 min-w-8 items-center justify-center rounded-md p-0 transition-[background-color,color,scale] duration-[150ms,150ms,100ms] ease-[ease-out] active:scale-96",
|
|
1071
|
-
className
|
|
1072
|
-
),
|
|
1073
|
-
onMouseDown: (e) => {
|
|
1074
|
-
e.preventDefault();
|
|
1075
|
-
onMouseDown?.(e);
|
|
1076
|
-
},
|
|
1077
|
-
onPressedChange: () => onClick?.({}),
|
|
1078
|
-
children
|
|
1052
|
+
handle: tooltip,
|
|
1053
|
+
payload: label,
|
|
1054
|
+
render: children,
|
|
1055
|
+
...id && { id }
|
|
1079
1056
|
}
|
|
1080
1057
|
);
|
|
1081
|
-
return props.title ? /* @__PURE__ */ jsx20(RichTextEditorTooltip, { label: props.title, children: toggle }) : toggle;
|
|
1082
1058
|
};
|
|
1059
|
+
var triggerKeys = [
|
|
1060
|
+
"aria-controls",
|
|
1061
|
+
"aria-expanded",
|
|
1062
|
+
"aria-haspopup"
|
|
1063
|
+
];
|
|
1064
|
+
var triggerProps = (props) => Object.fromEntries(
|
|
1065
|
+
triggerKeys.flatMap(
|
|
1066
|
+
(key) => props[key] === void 0 ? [] : [[key, props[key]]]
|
|
1067
|
+
)
|
|
1068
|
+
);
|
|
1069
|
+
var RichTextEditorControl = forwardRef12(
|
|
1070
|
+
({
|
|
1071
|
+
active = false,
|
|
1072
|
+
interactive: _interactive = true,
|
|
1073
|
+
className,
|
|
1074
|
+
children,
|
|
1075
|
+
onMouseDown,
|
|
1076
|
+
onClick,
|
|
1077
|
+
disabled,
|
|
1078
|
+
...props
|
|
1079
|
+
}, ref) => {
|
|
1080
|
+
const toggle = /* @__PURE__ */ jsx20(
|
|
1081
|
+
Toggle,
|
|
1082
|
+
{
|
|
1083
|
+
ref,
|
|
1084
|
+
...triggerProps(props),
|
|
1085
|
+
...!props.title && props.id && { id: props.id },
|
|
1086
|
+
size: "sm",
|
|
1087
|
+
pressed: active,
|
|
1088
|
+
disabled,
|
|
1089
|
+
"aria-label": props["aria-label"],
|
|
1090
|
+
className: cn(
|
|
1091
|
+
"rte-control-button inline-flex h-8 min-w-8 items-center justify-center rounded-md p-0 transition-[background-color,color,scale] duration-[150ms,150ms,100ms] ease-[ease-out] active:scale-96",
|
|
1092
|
+
className
|
|
1093
|
+
),
|
|
1094
|
+
onMouseDown: (e) => {
|
|
1095
|
+
e.preventDefault();
|
|
1096
|
+
onMouseDown?.(e);
|
|
1097
|
+
},
|
|
1098
|
+
onClick,
|
|
1099
|
+
children
|
|
1100
|
+
}
|
|
1101
|
+
);
|
|
1102
|
+
return props.title ? /* @__PURE__ */ jsx20(RichTextEditorTooltip, { id: props.id, label: props.title, children: toggle }) : toggle;
|
|
1103
|
+
}
|
|
1104
|
+
);
|
|
1083
1105
|
var resolveIsActive = (editor, config) => {
|
|
1084
1106
|
if (!editor || !config) {
|
|
1085
1107
|
return false;
|
|
@@ -1407,7 +1429,14 @@ import { NodeViewWrapper } from "@tiptap/react";
|
|
|
1407
1429
|
import { useCallback as useCallback5, useEffect as useEffect3, useRef as useRef3, useState as useState4 } from "react";
|
|
1408
1430
|
|
|
1409
1431
|
// src/icons.tsx
|
|
1432
|
+
import "react";
|
|
1433
|
+
|
|
1434
|
+
// src/icon-placeholder.tsx
|
|
1410
1435
|
import {
|
|
1436
|
+
AlignCenter,
|
|
1437
|
+
AlignJustify,
|
|
1438
|
+
AlignLeft,
|
|
1439
|
+
AlignRight,
|
|
1411
1440
|
Bold,
|
|
1412
1441
|
Code,
|
|
1413
1442
|
Heading1,
|
|
@@ -1429,23 +1458,60 @@ import {
|
|
|
1429
1458
|
Strikethrough,
|
|
1430
1459
|
Subscript,
|
|
1431
1460
|
Superscript,
|
|
1432
|
-
TextAlignCenter,
|
|
1433
|
-
TextAlignEnd,
|
|
1434
|
-
TextAlignJustify,
|
|
1435
|
-
TextAlignStart,
|
|
1436
1461
|
TextQuote,
|
|
1437
1462
|
Underline,
|
|
1438
1463
|
Undo2
|
|
1439
1464
|
} from "lucide-react";
|
|
1440
|
-
import "react";
|
|
1465
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
1466
|
+
var ICONS = {
|
|
1467
|
+
AlignCenter,
|
|
1468
|
+
AlignJustify,
|
|
1469
|
+
AlignLeft,
|
|
1470
|
+
AlignRight,
|
|
1471
|
+
Bold,
|
|
1472
|
+
Code,
|
|
1473
|
+
Heading1,
|
|
1474
|
+
Heading2,
|
|
1475
|
+
Heading3,
|
|
1476
|
+
Heading4,
|
|
1477
|
+
Heading5,
|
|
1478
|
+
Heading6,
|
|
1479
|
+
Highlighter,
|
|
1480
|
+
Italic,
|
|
1481
|
+
Link,
|
|
1482
|
+
Link2Off,
|
|
1483
|
+
List,
|
|
1484
|
+
ListOrdered,
|
|
1485
|
+
Minus,
|
|
1486
|
+
Redo2,
|
|
1487
|
+
RemoveFormatting,
|
|
1488
|
+
SquareCode,
|
|
1489
|
+
Strikethrough,
|
|
1490
|
+
Subscript,
|
|
1491
|
+
Superscript,
|
|
1492
|
+
TextQuote,
|
|
1493
|
+
Underline,
|
|
1494
|
+
Undo2
|
|
1495
|
+
};
|
|
1496
|
+
var IconPlaceholder = ({
|
|
1497
|
+
lucide,
|
|
1498
|
+
tabler: _tabler,
|
|
1499
|
+
hugeicons: _hugeicons,
|
|
1500
|
+
phosphor: _phosphor,
|
|
1501
|
+
remixicon: _remixicon,
|
|
1502
|
+
...props
|
|
1503
|
+
}) => {
|
|
1504
|
+
const Icon2 = ICONS[lucide];
|
|
1505
|
+
return /* @__PURE__ */ jsx22(Icon2, { ...props });
|
|
1506
|
+
};
|
|
1441
1507
|
|
|
1442
1508
|
// src/language-icons.tsx
|
|
1443
1509
|
import "react";
|
|
1444
|
-
import { jsx as
|
|
1510
|
+
import { jsx as jsx23, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1445
1511
|
var LangIcon = ({
|
|
1446
1512
|
children,
|
|
1447
1513
|
className
|
|
1448
|
-
}) => /* @__PURE__ */
|
|
1514
|
+
}) => /* @__PURE__ */ jsx23(
|
|
1449
1515
|
"svg",
|
|
1450
1516
|
{
|
|
1451
1517
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1461,139 +1527,139 @@ var LangIcon = ({
|
|
|
1461
1527
|
);
|
|
1462
1528
|
var DEFAULT_LANGUAGE_ICONS = {
|
|
1463
1529
|
bash: /* @__PURE__ */ jsxs9(LangIcon, { children: [
|
|
1464
|
-
/* @__PURE__ */
|
|
1465
|
-
/* @__PURE__ */
|
|
1466
|
-
/* @__PURE__ */
|
|
1530
|
+
/* @__PURE__ */ jsx23("rect", { x: "2.5", y: "4", width: "19", height: "16", rx: "2" }),
|
|
1531
|
+
/* @__PURE__ */ jsx23("path", { d: "M6.5 9.5l3.5 3-3.5 3" }),
|
|
1532
|
+
/* @__PURE__ */ jsx23("path", { d: "M12 15.5h5.5" })
|
|
1467
1533
|
] }),
|
|
1468
1534
|
c: /* @__PURE__ */ jsxs9(LangIcon, { children: [
|
|
1469
|
-
/* @__PURE__ */
|
|
1470
|
-
/* @__PURE__ */
|
|
1535
|
+
/* @__PURE__ */ jsx23("circle", { cx: "12", cy: "12", r: "8.5" }),
|
|
1536
|
+
/* @__PURE__ */ jsx23("path", { d: "M15.6 9.3a4.5 4.5 0 1 0 0 5.4" })
|
|
1471
1537
|
] }),
|
|
1472
1538
|
cpp: /* @__PURE__ */ jsxs9(LangIcon, { children: [
|
|
1473
|
-
/* @__PURE__ */
|
|
1474
|
-
/* @__PURE__ */
|
|
1475
|
-
/* @__PURE__ */
|
|
1476
|
-
/* @__PURE__ */
|
|
1539
|
+
/* @__PURE__ */ jsx23("circle", { cx: "9.5", cy: "12", r: "6.5" }),
|
|
1540
|
+
/* @__PURE__ */ jsx23("path", { d: "M12.3 9.7a3.3 3.3 0 1 0 0 4.6" }),
|
|
1541
|
+
/* @__PURE__ */ jsx23("path", { d: "M15.7 10.5v3M14.2 12h3" }),
|
|
1542
|
+
/* @__PURE__ */ jsx23("path", { d: "M19.3 10.5v3M17.8 12h3" })
|
|
1477
1543
|
] }),
|
|
1478
1544
|
css: /* @__PURE__ */ jsxs9(LangIcon, { children: [
|
|
1479
|
-
/* @__PURE__ */
|
|
1480
|
-
/* @__PURE__ */
|
|
1481
|
-
/* @__PURE__ */
|
|
1482
|
-
/* @__PURE__ */
|
|
1483
|
-
/* @__PURE__ */
|
|
1545
|
+
/* @__PURE__ */ jsx23("rect", { x: "3", y: "3", width: "18", height: "18", rx: "4" }),
|
|
1546
|
+
/* @__PURE__ */ jsx23("path", { d: "M9.7 7.5l-1 9" }),
|
|
1547
|
+
/* @__PURE__ */ jsx23("path", { d: "M15.3 7.5l-1 9" }),
|
|
1548
|
+
/* @__PURE__ */ jsx23("path", { d: "M7 10.3h11" }),
|
|
1549
|
+
/* @__PURE__ */ jsx23("path", { d: "M6.5 14.3h11" })
|
|
1484
1550
|
] }),
|
|
1485
1551
|
go: /* @__PURE__ */ jsxs9(LangIcon, { children: [
|
|
1486
|
-
/* @__PURE__ */
|
|
1487
|
-
/* @__PURE__ */
|
|
1488
|
-
/* @__PURE__ */
|
|
1489
|
-
/* @__PURE__ */
|
|
1552
|
+
/* @__PURE__ */ jsx23("rect", { x: "3", y: "3", width: "18", height: "18", rx: "4" }),
|
|
1553
|
+
/* @__PURE__ */ jsx23("path", { d: "M12.6 9.7A3.3 3.3 0 1 0 12.6 14.3" }),
|
|
1554
|
+
/* @__PURE__ */ jsx23("path", { d: "M12.6 12h-1.9" }),
|
|
1555
|
+
/* @__PURE__ */ jsx23("circle", { cx: "17", cy: "12", r: "2.9" })
|
|
1490
1556
|
] }),
|
|
1491
1557
|
html: /* @__PURE__ */ jsxs9(LangIcon, { children: [
|
|
1492
|
-
/* @__PURE__ */
|
|
1493
|
-
/* @__PURE__ */
|
|
1494
|
-
/* @__PURE__ */
|
|
1495
|
-
/* @__PURE__ */
|
|
1558
|
+
/* @__PURE__ */ jsx23("rect", { x: "3", y: "3", width: "18", height: "18", rx: "4" }),
|
|
1559
|
+
/* @__PURE__ */ jsx23("path", { d: "M9.5 8.5L6.5 12l3 3.5" }),
|
|
1560
|
+
/* @__PURE__ */ jsx23("path", { d: "M14.5 8.5L17.5 12l-3 3.5" }),
|
|
1561
|
+
/* @__PURE__ */ jsx23("path", { d: "M13 7.3l-2 9.4" })
|
|
1496
1562
|
] }),
|
|
1497
1563
|
java: /* @__PURE__ */ jsxs9(LangIcon, { children: [
|
|
1498
|
-
/* @__PURE__ */
|
|
1499
|
-
/* @__PURE__ */
|
|
1500
|
-
/* @__PURE__ */
|
|
1501
|
-
/* @__PURE__ */
|
|
1564
|
+
/* @__PURE__ */ jsx23("path", { d: "M6 10h10v5a3 3 0 0 1-3 3H9a3 3 0 0 1-3-3v-5z" }),
|
|
1565
|
+
/* @__PURE__ */ jsx23("path", { d: "M16 12h1.3a1.8 1.8 0 0 1 0 3.6H16" }),
|
|
1566
|
+
/* @__PURE__ */ jsx23("path", { d: "M9.3 3.8c-.9.8-.9 1.6 0 2.4M13.3 3.8c-.9.8-.9 1.6 0 2.4" }),
|
|
1567
|
+
/* @__PURE__ */ jsx23("path", { d: "M6 19.3h10" })
|
|
1502
1568
|
] }),
|
|
1503
1569
|
javascript: /* @__PURE__ */ jsxs9(LangIcon, { children: [
|
|
1504
|
-
/* @__PURE__ */
|
|
1505
|
-
/* @__PURE__ */
|
|
1506
|
-
/* @__PURE__ */
|
|
1570
|
+
/* @__PURE__ */ jsx23("rect", { x: "3", y: "3", width: "18", height: "18", rx: "4" }),
|
|
1571
|
+
/* @__PURE__ */ jsx23("path", { d: "M10.5 8v6.5a2 2 0 0 1-3.5 1.3" }),
|
|
1572
|
+
/* @__PURE__ */ jsx23("path", { d: "M17 8.8a2 2 0 0 0-2-.8c-1.1 0-2.2.6-2.2 1.7 0 1 .9 1.4 2.2 1.7 1.3.3 2.3.7 2.3 1.9 0 1.1-1 1.8-2.3 1.8a2.4 2.4 0 0 1-2.3-1.4" })
|
|
1507
1573
|
] }),
|
|
1508
1574
|
json: /* @__PURE__ */ jsxs9(LangIcon, { children: [
|
|
1509
|
-
/* @__PURE__ */
|
|
1510
|
-
/* @__PURE__ */
|
|
1575
|
+
/* @__PURE__ */ jsx23("path", { d: "M8 3H7a2 2 0 0 0-2 2v4a2 2 0 0 1-2 2 2 2 0 0 1 2 2v4a2 2 0 0 0 2 2" }),
|
|
1576
|
+
/* @__PURE__ */ jsx23("path", { d: "M16 3h1a2 2 0 0 1 2 2v4a2 2 0 0 0 2 2 2 2 0 0 0-2 2v4a2 2 0 0 1-2 2" })
|
|
1511
1577
|
] }),
|
|
1512
1578
|
kotlin: /* @__PURE__ */ jsxs9(LangIcon, { children: [
|
|
1513
|
-
/* @__PURE__ */
|
|
1514
|
-
/* @__PURE__ */
|
|
1515
|
-
/* @__PURE__ */
|
|
1516
|
-
/* @__PURE__ */
|
|
1579
|
+
/* @__PURE__ */ jsx23("rect", { x: "3", y: "3", width: "18", height: "18", rx: "4" }),
|
|
1580
|
+
/* @__PURE__ */ jsx23("path", { d: "M9 7.5v9" }),
|
|
1581
|
+
/* @__PURE__ */ jsx23("path", { d: "M9 12l6-4.5" }),
|
|
1582
|
+
/* @__PURE__ */ jsx23("path", { d: "M9 12l6 4.5" })
|
|
1517
1583
|
] }),
|
|
1518
1584
|
markdown: /* @__PURE__ */ jsxs9(LangIcon, { children: [
|
|
1519
|
-
/* @__PURE__ */
|
|
1520
|
-
/* @__PURE__ */
|
|
1521
|
-
/* @__PURE__ */
|
|
1522
|
-
/* @__PURE__ */
|
|
1585
|
+
/* @__PURE__ */ jsx23("rect", { x: "2", y: "5", width: "20", height: "14", rx: "2" }),
|
|
1586
|
+
/* @__PURE__ */ jsx23("path", { d: "M6 15V9l3 4 3-4v6" }),
|
|
1587
|
+
/* @__PURE__ */ jsx23("path", { d: "M16.5 9v6" }),
|
|
1588
|
+
/* @__PURE__ */ jsx23("path", { d: "M14.5 13l2 2 2-2" })
|
|
1523
1589
|
] }),
|
|
1524
1590
|
php: /* @__PURE__ */ jsxs9(LangIcon, { children: [
|
|
1525
|
-
/* @__PURE__ */
|
|
1526
|
-
/* @__PURE__ */
|
|
1527
|
-
/* @__PURE__ */
|
|
1528
|
-
/* @__PURE__ */
|
|
1591
|
+
/* @__PURE__ */ jsx23("rect", { x: "3", y: "3", width: "18", height: "18", rx: "4" }),
|
|
1592
|
+
/* @__PURE__ */ jsx23("path", { d: "M11.5 8.5L7.5 12l4 3.5" }),
|
|
1593
|
+
/* @__PURE__ */ jsx23("path", { d: "M15.2 8.2c1.1 0 1.9.6 1.9 1.6 0 1.1-.9 1.5-1.8 1.8-.6.2-1 .5-1 1.1" }),
|
|
1594
|
+
/* @__PURE__ */ jsx23("circle", { cx: "14.3", cy: "16.2", r: ".5", fill: "currentColor", stroke: "none" })
|
|
1529
1595
|
] }),
|
|
1530
1596
|
plaintext: /* @__PURE__ */ jsxs9(LangIcon, { children: [
|
|
1531
|
-
/* @__PURE__ */
|
|
1532
|
-
/* @__PURE__ */
|
|
1533
|
-
/* @__PURE__ */
|
|
1534
|
-
/* @__PURE__ */
|
|
1597
|
+
/* @__PURE__ */ jsx23("rect", { x: "4", y: "2.5", width: "16", height: "19", rx: "2" }),
|
|
1598
|
+
/* @__PURE__ */ jsx23("line", { x1: "7.5", y1: "7.5", x2: "16.5", y2: "7.5" }),
|
|
1599
|
+
/* @__PURE__ */ jsx23("line", { x1: "7.5", y1: "11.5", x2: "16.5", y2: "11.5" }),
|
|
1600
|
+
/* @__PURE__ */ jsx23("line", { x1: "7.5", y1: "15.5", x2: "13.5", y2: "15.5" })
|
|
1535
1601
|
] }),
|
|
1536
1602
|
python: /* @__PURE__ */ jsxs9(LangIcon, { children: [
|
|
1537
|
-
/* @__PURE__ */
|
|
1538
|
-
/* @__PURE__ */
|
|
1539
|
-
/* @__PURE__ */
|
|
1540
|
-
/* @__PURE__ */
|
|
1603
|
+
/* @__PURE__ */ jsx23("path", { d: "M4.5 15c0-3 2.5-4.7 5.7-4.7h1.6c2.8 0 5-2 5-4.5" }),
|
|
1604
|
+
/* @__PURE__ */ jsx23("path", { d: "M9.5 3.3c1.3-.3 2.6 0 3.3 1-.7 1-2 1.3-3.3 1" }),
|
|
1605
|
+
/* @__PURE__ */ jsx23("circle", { cx: "15.5", cy: "4.3", r: ".55", fill: "currentColor", stroke: "none" }),
|
|
1606
|
+
/* @__PURE__ */ jsx23("path", { d: "M17.8 4.5l1.4-.6M17.8 4.9l1.4.6" })
|
|
1541
1607
|
] }),
|
|
1542
1608
|
ruby: /* @__PURE__ */ jsxs9(LangIcon, { children: [
|
|
1543
|
-
/* @__PURE__ */
|
|
1544
|
-
/* @__PURE__ */
|
|
1545
|
-
/* @__PURE__ */
|
|
1609
|
+
/* @__PURE__ */ jsx23("polygon", { points: "12 2.5 19.5 8 12 21.5 4.5 8" }),
|
|
1610
|
+
/* @__PURE__ */ jsx23("path", { d: "M4.5 8h15" }),
|
|
1611
|
+
/* @__PURE__ */ jsx23("path", { d: "M12 2.5v19" })
|
|
1546
1612
|
] }),
|
|
1547
1613
|
rust: /* @__PURE__ */ jsxs9(LangIcon, { children: [
|
|
1548
|
-
/* @__PURE__ */
|
|
1549
|
-
/* @__PURE__ */
|
|
1550
|
-
/* @__PURE__ */
|
|
1551
|
-
/* @__PURE__ */
|
|
1614
|
+
/* @__PURE__ */ jsx23("circle", { cx: "12", cy: "12", r: "7" }),
|
|
1615
|
+
/* @__PURE__ */ jsx23("circle", { cx: "12", cy: "12", r: "2.3" }),
|
|
1616
|
+
/* @__PURE__ */ jsx23("path", { d: "M12 2.5v3M12 18.5v3M2.5 12h3M18.5 12h3" }),
|
|
1617
|
+
/* @__PURE__ */ jsx23("path", { d: "M5.6 5.6l2.1 2.1M16.3 16.3l2.1 2.1M5.6 18.4l2.1-2.1M16.3 7.7l2.1-2.1" })
|
|
1552
1618
|
] }),
|
|
1553
1619
|
sql: /* @__PURE__ */ jsxs9(LangIcon, { children: [
|
|
1554
|
-
/* @__PURE__ */
|
|
1555
|
-
/* @__PURE__ */
|
|
1556
|
-
/* @__PURE__ */
|
|
1620
|
+
/* @__PURE__ */ jsx23("ellipse", { cx: "12", cy: "6", rx: "8", ry: "3" }),
|
|
1621
|
+
/* @__PURE__ */ jsx23("path", { d: "M4 6v6c0 1.7 3.6 3 8 3s8-1.3 8-3V6" }),
|
|
1622
|
+
/* @__PURE__ */ jsx23("path", { d: "M4 12v6c0 1.7 3.6 3 8 3s8-1.3 8-3v-6" })
|
|
1557
1623
|
] }),
|
|
1558
|
-
swift: /* @__PURE__ */
|
|
1624
|
+
swift: /* @__PURE__ */ jsx23(LangIcon, { children: /* @__PURE__ */ jsx23("path", { d: "M19 4.5c-2.6 4-5.5 7-8.3 9 2-.2 3.7-1 4.8-2.6-.7 2.8-2.8 5-5.3 6.1 3 .5 5.6-.5 7.2-2.4.4 2-.4 3.9-1.9 4.9 3.7-1.3 6-4.2 6.6-7.6-1 2.6-2.8 4.6-4.6 5.8" }) }),
|
|
1559
1625
|
typescript: /* @__PURE__ */ jsxs9(LangIcon, { children: [
|
|
1560
|
-
/* @__PURE__ */
|
|
1561
|
-
/* @__PURE__ */
|
|
1562
|
-
/* @__PURE__ */
|
|
1626
|
+
/* @__PURE__ */ jsx23("rect", { x: "3", y: "3", width: "18", height: "18", rx: "4" }),
|
|
1627
|
+
/* @__PURE__ */ jsx23("path", { d: "M7.3 8.2h5M9.8 8.2v7.6" }),
|
|
1628
|
+
/* @__PURE__ */ jsx23("path", { d: "M17 8.8a2 2 0 0 0-2-.8c-1.1 0-2.2.6-2.2 1.7 0 1 .9 1.4 2.2 1.7 1.3.3 2.3.7 2.3 1.9 0 1.1-1 1.8-2.3 1.8a2.4 2.4 0 0 1-2.3-1.4" })
|
|
1563
1629
|
] }),
|
|
1564
1630
|
xml: /* @__PURE__ */ jsxs9(LangIcon, { children: [
|
|
1565
|
-
/* @__PURE__ */
|
|
1566
|
-
/* @__PURE__ */
|
|
1567
|
-
/* @__PURE__ */
|
|
1631
|
+
/* @__PURE__ */ jsx23("path", { d: "M8 7l-4.5 5 4.5 5" }),
|
|
1632
|
+
/* @__PURE__ */ jsx23("path", { d: "M16 7l4.5 5-4.5 5" }),
|
|
1633
|
+
/* @__PURE__ */ jsx23("path", { d: "M12 8v8" })
|
|
1568
1634
|
] }),
|
|
1569
1635
|
yaml: /* @__PURE__ */ jsxs9(LangIcon, { children: [
|
|
1570
|
-
/* @__PURE__ */
|
|
1571
|
-
/* @__PURE__ */
|
|
1572
|
-
/* @__PURE__ */
|
|
1573
|
-
/* @__PURE__ */
|
|
1636
|
+
/* @__PURE__ */ jsx23("rect", { x: "2.5", y: "3", width: "19", height: "18", rx: "2" }),
|
|
1637
|
+
/* @__PURE__ */ jsx23("path", { d: "M6.5 8h2M9.5 8h8" }),
|
|
1638
|
+
/* @__PURE__ */ jsx23("path", { d: "M6.5 12h2M9.5 12h6" }),
|
|
1639
|
+
/* @__PURE__ */ jsx23("path", { d: "M6.5 16h2M9.5 16h7" })
|
|
1574
1640
|
] })
|
|
1575
1641
|
};
|
|
1576
1642
|
|
|
1577
1643
|
// src/icons.tsx
|
|
1578
|
-
import { Fragment as Fragment3, jsx as
|
|
1644
|
+
import { Fragment as Fragment3, jsx as jsx24, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1579
1645
|
var ALIGN_PATHS = {
|
|
1580
1646
|
center: /* @__PURE__ */ jsxs10(Fragment3, { children: [
|
|
1581
|
-
/* @__PURE__ */
|
|
1582
|
-
/* @__PURE__ */
|
|
1583
|
-
/* @__PURE__ */
|
|
1647
|
+
/* @__PURE__ */ jsx24("line", { x1: "21", y1: "6", x2: "3", y2: "6" }),
|
|
1648
|
+
/* @__PURE__ */ jsx24("line", { x1: "17", y1: "12", x2: "7", y2: "12" }),
|
|
1649
|
+
/* @__PURE__ */ jsx24("line", { x1: "19", y1: "18", x2: "5", y2: "18" })
|
|
1584
1650
|
] }),
|
|
1585
1651
|
left: /* @__PURE__ */ jsxs10(Fragment3, { children: [
|
|
1586
|
-
/* @__PURE__ */
|
|
1587
|
-
/* @__PURE__ */
|
|
1588
|
-
/* @__PURE__ */
|
|
1652
|
+
/* @__PURE__ */ jsx24("line", { x1: "21", y1: "6", x2: "3", y2: "6" }),
|
|
1653
|
+
/* @__PURE__ */ jsx24("line", { x1: "15", y1: "12", x2: "3", y2: "12" }),
|
|
1654
|
+
/* @__PURE__ */ jsx24("line", { x1: "17", y1: "18", x2: "3", y2: "18" })
|
|
1589
1655
|
] }),
|
|
1590
1656
|
right: /* @__PURE__ */ jsxs10(Fragment3, { children: [
|
|
1591
|
-
/* @__PURE__ */
|
|
1592
|
-
/* @__PURE__ */
|
|
1593
|
-
/* @__PURE__ */
|
|
1657
|
+
/* @__PURE__ */ jsx24("line", { x1: "21", y1: "6", x2: "3", y2: "6" }),
|
|
1658
|
+
/* @__PURE__ */ jsx24("line", { x1: "21", y1: "12", x2: "9", y2: "12" }),
|
|
1659
|
+
/* @__PURE__ */ jsx24("line", { x1: "21", y1: "18", x2: "7", y2: "18" })
|
|
1594
1660
|
] })
|
|
1595
1661
|
};
|
|
1596
|
-
var AlignIcon = ({ dir }) => /* @__PURE__ */
|
|
1662
|
+
var AlignIcon = ({ dir }) => /* @__PURE__ */ jsx24(
|
|
1597
1663
|
"svg",
|
|
1598
1664
|
{
|
|
1599
1665
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1619,8 +1685,8 @@ var EditUrlIcon = () => /* @__PURE__ */ jsxs10(
|
|
|
1619
1685
|
strokeLinejoin: "round",
|
|
1620
1686
|
className: "rte-editor-icon",
|
|
1621
1687
|
children: [
|
|
1622
|
-
/* @__PURE__ */
|
|
1623
|
-
/* @__PURE__ */
|
|
1688
|
+
/* @__PURE__ */ jsx24("path", { d: "M12 20h9" }),
|
|
1689
|
+
/* @__PURE__ */ jsx24("path", { d: "M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z" })
|
|
1624
1690
|
]
|
|
1625
1691
|
}
|
|
1626
1692
|
);
|
|
@@ -1636,9 +1702,9 @@ var OpenInYouTubeIcon = () => /* @__PURE__ */ jsxs10(
|
|
|
1636
1702
|
strokeLinejoin: "round",
|
|
1637
1703
|
className: "rte-editor-icon",
|
|
1638
1704
|
children: [
|
|
1639
|
-
/* @__PURE__ */
|
|
1640
|
-
/* @__PURE__ */
|
|
1641
|
-
/* @__PURE__ */
|
|
1705
|
+
/* @__PURE__ */ jsx24("path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" }),
|
|
1706
|
+
/* @__PURE__ */ jsx24("polyline", { points: "15 3 21 3 21 9" }),
|
|
1707
|
+
/* @__PURE__ */ jsx24("line", { x1: "10", y1: "14", x2: "21", y2: "3" })
|
|
1642
1708
|
]
|
|
1643
1709
|
}
|
|
1644
1710
|
);
|
|
@@ -1654,46 +1720,326 @@ var DeleteEmbedIcon = () => /* @__PURE__ */ jsxs10(
|
|
|
1654
1720
|
strokeLinejoin: "round",
|
|
1655
1721
|
className: "rte-editor-icon",
|
|
1656
1722
|
children: [
|
|
1657
|
-
/* @__PURE__ */
|
|
1658
|
-
/* @__PURE__ */
|
|
1723
|
+
/* @__PURE__ */ jsx24("polyline", { points: "3 6 5 6 21 6" }),
|
|
1724
|
+
/* @__PURE__ */ jsx24("path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" })
|
|
1659
1725
|
]
|
|
1660
1726
|
}
|
|
1661
1727
|
);
|
|
1662
1728
|
var iconProps = { className: "rte-editor-icon" };
|
|
1663
1729
|
var DEFAULT_ICONS = {
|
|
1664
|
-
alignCenterControlIcon: /* @__PURE__ */
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1730
|
+
alignCenterControlIcon: /* @__PURE__ */ jsx24(
|
|
1731
|
+
IconPlaceholder,
|
|
1732
|
+
{
|
|
1733
|
+
lucide: "AlignCenter",
|
|
1734
|
+
tabler: "IconAlignCenter",
|
|
1735
|
+
hugeicons: "TextAlignCenterIcon",
|
|
1736
|
+
phosphor: "TextAlignCenterIcon",
|
|
1737
|
+
remixicon: "RiAlignCenter",
|
|
1738
|
+
...iconProps
|
|
1739
|
+
}
|
|
1740
|
+
),
|
|
1741
|
+
alignJustifyControlIcon: /* @__PURE__ */ jsx24(
|
|
1742
|
+
IconPlaceholder,
|
|
1743
|
+
{
|
|
1744
|
+
lucide: "AlignJustify",
|
|
1745
|
+
tabler: "IconAlignJustified",
|
|
1746
|
+
hugeicons: "TextAlignJustifyCenterIcon",
|
|
1747
|
+
phosphor: "TextAlignJustifyIcon",
|
|
1748
|
+
remixicon: "RiAlignJustify",
|
|
1749
|
+
...iconProps
|
|
1750
|
+
}
|
|
1751
|
+
),
|
|
1752
|
+
alignLeftControlIcon: /* @__PURE__ */ jsx24(
|
|
1753
|
+
IconPlaceholder,
|
|
1754
|
+
{
|
|
1755
|
+
lucide: "AlignLeft",
|
|
1756
|
+
tabler: "IconAlignLeft",
|
|
1757
|
+
hugeicons: "TextAlignLeftIcon",
|
|
1758
|
+
phosphor: "TextAlignLeftIcon",
|
|
1759
|
+
remixicon: "RiAlignLeft",
|
|
1760
|
+
...iconProps
|
|
1761
|
+
}
|
|
1762
|
+
),
|
|
1763
|
+
alignRightControlIcon: /* @__PURE__ */ jsx24(
|
|
1764
|
+
IconPlaceholder,
|
|
1765
|
+
{
|
|
1766
|
+
lucide: "AlignRight",
|
|
1767
|
+
tabler: "IconAlignRight",
|
|
1768
|
+
hugeicons: "TextAlignRightIcon",
|
|
1769
|
+
phosphor: "TextAlignRightIcon",
|
|
1770
|
+
remixicon: "RiAlignRight",
|
|
1771
|
+
...iconProps
|
|
1772
|
+
}
|
|
1773
|
+
),
|
|
1774
|
+
blockquoteControlIcon: /* @__PURE__ */ jsx24(
|
|
1775
|
+
IconPlaceholder,
|
|
1776
|
+
{
|
|
1777
|
+
lucide: "TextQuote",
|
|
1778
|
+
tabler: "IconQuote",
|
|
1779
|
+
hugeicons: "LeftToRightBlockQuoteIcon",
|
|
1780
|
+
phosphor: "QuotesIcon",
|
|
1781
|
+
remixicon: "RiQuoteText",
|
|
1782
|
+
...iconProps
|
|
1783
|
+
}
|
|
1784
|
+
),
|
|
1785
|
+
boldControlIcon: /* @__PURE__ */ jsx24(
|
|
1786
|
+
IconPlaceholder,
|
|
1787
|
+
{
|
|
1788
|
+
lucide: "Bold",
|
|
1789
|
+
tabler: "IconBold",
|
|
1790
|
+
hugeicons: "BoldIcon",
|
|
1791
|
+
phosphor: "TextBIcon",
|
|
1792
|
+
remixicon: "RiBold",
|
|
1793
|
+
...iconProps
|
|
1794
|
+
}
|
|
1795
|
+
),
|
|
1796
|
+
bulletListControlIcon: /* @__PURE__ */ jsx24(
|
|
1797
|
+
IconPlaceholder,
|
|
1798
|
+
{
|
|
1799
|
+
lucide: "List",
|
|
1800
|
+
tabler: "IconList",
|
|
1801
|
+
hugeicons: "LeftToRightListBulletIcon",
|
|
1802
|
+
phosphor: "ListBulletsIcon",
|
|
1803
|
+
remixicon: "RiListUnordered",
|
|
1804
|
+
...iconProps
|
|
1805
|
+
}
|
|
1806
|
+
),
|
|
1807
|
+
clearFormattingControlIcon: /* @__PURE__ */ jsx24(
|
|
1808
|
+
IconPlaceholder,
|
|
1809
|
+
{
|
|
1810
|
+
lucide: "RemoveFormatting",
|
|
1811
|
+
tabler: "IconEraser",
|
|
1812
|
+
hugeicons: "TextClearIcon",
|
|
1813
|
+
phosphor: "EraserIcon",
|
|
1814
|
+
remixicon: "RiFormatClear",
|
|
1815
|
+
...iconProps
|
|
1816
|
+
}
|
|
1817
|
+
),
|
|
1818
|
+
codeBlockControlIcon: /* @__PURE__ */ jsx24(
|
|
1819
|
+
IconPlaceholder,
|
|
1820
|
+
{
|
|
1821
|
+
lucide: "SquareCode",
|
|
1822
|
+
tabler: "IconSourceCode",
|
|
1823
|
+
hugeicons: "SourceCodeSquareIcon",
|
|
1824
|
+
phosphor: "CodeBlockIcon",
|
|
1825
|
+
remixicon: "RiCodeBoxLine",
|
|
1826
|
+
...iconProps
|
|
1827
|
+
}
|
|
1828
|
+
),
|
|
1829
|
+
codeControlIcon: /* @__PURE__ */ jsx24(
|
|
1830
|
+
IconPlaceholder,
|
|
1831
|
+
{
|
|
1832
|
+
lucide: "Code",
|
|
1833
|
+
tabler: "IconCode",
|
|
1834
|
+
hugeicons: "SourceCodeIcon",
|
|
1835
|
+
phosphor: "CodeIcon",
|
|
1836
|
+
remixicon: "RiCodeLine",
|
|
1837
|
+
...iconProps
|
|
1838
|
+
}
|
|
1839
|
+
),
|
|
1840
|
+
h1ControlIcon: /* @__PURE__ */ jsx24(
|
|
1841
|
+
IconPlaceholder,
|
|
1842
|
+
{
|
|
1843
|
+
lucide: "Heading1",
|
|
1844
|
+
tabler: "IconH1",
|
|
1845
|
+
hugeicons: "Heading01Icon",
|
|
1846
|
+
phosphor: "TextHOneIcon",
|
|
1847
|
+
remixicon: "RiH1",
|
|
1848
|
+
...iconProps
|
|
1849
|
+
}
|
|
1850
|
+
),
|
|
1851
|
+
h2ControlIcon: /* @__PURE__ */ jsx24(
|
|
1852
|
+
IconPlaceholder,
|
|
1853
|
+
{
|
|
1854
|
+
lucide: "Heading2",
|
|
1855
|
+
tabler: "IconH2",
|
|
1856
|
+
hugeicons: "Heading02Icon",
|
|
1857
|
+
phosphor: "TextHTwoIcon",
|
|
1858
|
+
remixicon: "RiH2",
|
|
1859
|
+
...iconProps
|
|
1860
|
+
}
|
|
1861
|
+
),
|
|
1862
|
+
h3ControlIcon: /* @__PURE__ */ jsx24(
|
|
1863
|
+
IconPlaceholder,
|
|
1864
|
+
{
|
|
1865
|
+
lucide: "Heading3",
|
|
1866
|
+
tabler: "IconH3",
|
|
1867
|
+
hugeicons: "Heading03Icon",
|
|
1868
|
+
phosphor: "TextHThreeIcon",
|
|
1869
|
+
remixicon: "RiH3",
|
|
1870
|
+
...iconProps
|
|
1871
|
+
}
|
|
1872
|
+
),
|
|
1873
|
+
h4ControlIcon: /* @__PURE__ */ jsx24(
|
|
1874
|
+
IconPlaceholder,
|
|
1875
|
+
{
|
|
1876
|
+
lucide: "Heading4",
|
|
1877
|
+
tabler: "IconH4",
|
|
1878
|
+
hugeicons: "Heading04Icon",
|
|
1879
|
+
phosphor: "TextHFourIcon",
|
|
1880
|
+
remixicon: "RiH4",
|
|
1881
|
+
...iconProps
|
|
1882
|
+
}
|
|
1883
|
+
),
|
|
1884
|
+
h5ControlIcon: /* @__PURE__ */ jsx24(
|
|
1885
|
+
IconPlaceholder,
|
|
1886
|
+
{
|
|
1887
|
+
lucide: "Heading5",
|
|
1888
|
+
tabler: "IconH5",
|
|
1889
|
+
hugeicons: "Heading05Icon",
|
|
1890
|
+
phosphor: "TextHFiveIcon",
|
|
1891
|
+
remixicon: "RiH5",
|
|
1892
|
+
...iconProps
|
|
1893
|
+
}
|
|
1894
|
+
),
|
|
1895
|
+
h6ControlIcon: /* @__PURE__ */ jsx24(
|
|
1896
|
+
IconPlaceholder,
|
|
1897
|
+
{
|
|
1898
|
+
lucide: "Heading6",
|
|
1899
|
+
tabler: "IconH6",
|
|
1900
|
+
hugeicons: "Heading06Icon",
|
|
1901
|
+
phosphor: "TextHSixIcon",
|
|
1902
|
+
remixicon: "RiH6",
|
|
1903
|
+
...iconProps
|
|
1904
|
+
}
|
|
1905
|
+
),
|
|
1906
|
+
highlightControlIcon: /* @__PURE__ */ jsx24(
|
|
1907
|
+
IconPlaceholder,
|
|
1908
|
+
{
|
|
1909
|
+
lucide: "Highlighter",
|
|
1910
|
+
tabler: "IconHighlight",
|
|
1911
|
+
hugeicons: "HighlighterIcon",
|
|
1912
|
+
phosphor: "HighlighterIcon",
|
|
1913
|
+
remixicon: "RiMarkPenLine",
|
|
1914
|
+
...iconProps
|
|
1915
|
+
}
|
|
1916
|
+
),
|
|
1917
|
+
hrControlIcon: /* @__PURE__ */ jsx24(
|
|
1918
|
+
IconPlaceholder,
|
|
1919
|
+
{
|
|
1920
|
+
lucide: "Minus",
|
|
1921
|
+
tabler: "IconMinus",
|
|
1922
|
+
hugeicons: "MinusSignIcon",
|
|
1923
|
+
phosphor: "MinusIcon",
|
|
1924
|
+
remixicon: "RiSeparator",
|
|
1925
|
+
...iconProps
|
|
1926
|
+
}
|
|
1927
|
+
),
|
|
1928
|
+
italicControlIcon: /* @__PURE__ */ jsx24(
|
|
1929
|
+
IconPlaceholder,
|
|
1930
|
+
{
|
|
1931
|
+
lucide: "Italic",
|
|
1932
|
+
tabler: "IconItalic",
|
|
1933
|
+
hugeicons: "ItalicIcon",
|
|
1934
|
+
phosphor: "TextItalicIcon",
|
|
1935
|
+
remixicon: "RiItalic",
|
|
1936
|
+
...iconProps
|
|
1937
|
+
}
|
|
1938
|
+
),
|
|
1683
1939
|
languageIcons: DEFAULT_LANGUAGE_ICONS,
|
|
1684
|
-
linkControlIcon: /* @__PURE__ */
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1940
|
+
linkControlIcon: /* @__PURE__ */ jsx24(
|
|
1941
|
+
IconPlaceholder,
|
|
1942
|
+
{
|
|
1943
|
+
lucide: "Link",
|
|
1944
|
+
tabler: "IconLink",
|
|
1945
|
+
hugeicons: "Link01Icon",
|
|
1946
|
+
phosphor: "LinkIcon",
|
|
1947
|
+
remixicon: "RiLink",
|
|
1948
|
+
...iconProps
|
|
1949
|
+
}
|
|
1950
|
+
),
|
|
1951
|
+
orderedListControlIcon: /* @__PURE__ */ jsx24(
|
|
1952
|
+
IconPlaceholder,
|
|
1953
|
+
{
|
|
1954
|
+
lucide: "ListOrdered",
|
|
1955
|
+
tabler: "IconListNumbers",
|
|
1956
|
+
hugeicons: "LeftToRightListNumberIcon",
|
|
1957
|
+
phosphor: "ListNumbersIcon",
|
|
1958
|
+
remixicon: "RiListOrdered",
|
|
1959
|
+
...iconProps
|
|
1960
|
+
}
|
|
1961
|
+
),
|
|
1962
|
+
redoControlIcon: /* @__PURE__ */ jsx24(
|
|
1963
|
+
IconPlaceholder,
|
|
1964
|
+
{
|
|
1965
|
+
lucide: "Redo2",
|
|
1966
|
+
tabler: "IconArrowForwardUp",
|
|
1967
|
+
hugeicons: "RedoIcon",
|
|
1968
|
+
phosphor: "ArrowClockwiseIcon",
|
|
1969
|
+
remixicon: "RiArrowGoForwardLine",
|
|
1970
|
+
...iconProps
|
|
1971
|
+
}
|
|
1972
|
+
),
|
|
1973
|
+
strikeControlIcon: /* @__PURE__ */ jsx24(
|
|
1974
|
+
IconPlaceholder,
|
|
1975
|
+
{
|
|
1976
|
+
lucide: "Strikethrough",
|
|
1977
|
+
tabler: "IconStrikethrough",
|
|
1978
|
+
hugeicons: "StrikethroughIcon",
|
|
1979
|
+
phosphor: "TextStrikethroughIcon",
|
|
1980
|
+
remixicon: "RiStrikethrough",
|
|
1981
|
+
...iconProps
|
|
1982
|
+
}
|
|
1983
|
+
),
|
|
1984
|
+
subscriptControlIcon: /* @__PURE__ */ jsx24(
|
|
1985
|
+
IconPlaceholder,
|
|
1986
|
+
{
|
|
1987
|
+
lucide: "Subscript",
|
|
1988
|
+
tabler: "IconSubscript",
|
|
1989
|
+
hugeicons: "SubscriptIcon",
|
|
1990
|
+
phosphor: "TextSubscriptIcon",
|
|
1991
|
+
remixicon: "RiSubscript",
|
|
1992
|
+
...iconProps
|
|
1993
|
+
}
|
|
1994
|
+
),
|
|
1995
|
+
superscriptControlIcon: /* @__PURE__ */ jsx24(
|
|
1996
|
+
IconPlaceholder,
|
|
1997
|
+
{
|
|
1998
|
+
lucide: "Superscript",
|
|
1999
|
+
tabler: "IconSuperscript",
|
|
2000
|
+
hugeicons: "SuperscriptIcon",
|
|
2001
|
+
phosphor: "TextSuperscriptIcon",
|
|
2002
|
+
remixicon: "RiSuperscript",
|
|
2003
|
+
...iconProps
|
|
2004
|
+
}
|
|
2005
|
+
),
|
|
2006
|
+
underlineControlIcon: /* @__PURE__ */ jsx24(
|
|
2007
|
+
IconPlaceholder,
|
|
2008
|
+
{
|
|
2009
|
+
lucide: "Underline",
|
|
2010
|
+
tabler: "IconUnderline",
|
|
2011
|
+
hugeicons: "UnderlineIcon",
|
|
2012
|
+
phosphor: "TextUnderlineIcon",
|
|
2013
|
+
remixicon: "RiUnderline",
|
|
2014
|
+
...iconProps
|
|
2015
|
+
}
|
|
2016
|
+
),
|
|
2017
|
+
undoControlIcon: /* @__PURE__ */ jsx24(
|
|
2018
|
+
IconPlaceholder,
|
|
2019
|
+
{
|
|
2020
|
+
lucide: "Undo2",
|
|
2021
|
+
tabler: "IconArrowBackUp",
|
|
2022
|
+
hugeicons: "UndoIcon",
|
|
2023
|
+
phosphor: "ArrowCounterClockwiseIcon",
|
|
2024
|
+
remixicon: "RiArrowGoBackLine",
|
|
2025
|
+
...iconProps
|
|
2026
|
+
}
|
|
2027
|
+
),
|
|
2028
|
+
unlinkControlIcon: /* @__PURE__ */ jsx24(
|
|
2029
|
+
IconPlaceholder,
|
|
2030
|
+
{
|
|
2031
|
+
lucide: "Link2Off",
|
|
2032
|
+
tabler: "IconUnlink",
|
|
2033
|
+
hugeicons: "UnlinkIcon",
|
|
2034
|
+
phosphor: "LinkBreakIcon",
|
|
2035
|
+
remixicon: "RiLinkUnlink",
|
|
2036
|
+
...iconProps
|
|
2037
|
+
}
|
|
2038
|
+
)
|
|
1693
2039
|
};
|
|
1694
2040
|
|
|
1695
2041
|
// src/extensions/resizable-node-view.tsx
|
|
1696
|
-
import { Fragment as Fragment4, jsx as
|
|
2042
|
+
import { Fragment as Fragment4, jsx as jsx25, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1697
2043
|
var SELECTOR_BUTTON = "rte-embed-selector-btn inline-flex h-8 min-w-8 cursor-pointer items-center justify-center rounded-sm border-none bg-transparent px-2 text-[0.75rem] font-medium text-popover-foreground [transition:background-color_150ms_ease-out,color_150ms_ease-out,scale_100ms_ease-out] hover:bg-muted hover:text-foreground focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-ring/50 focus-visible:-outline-offset-2 active:scale-96";
|
|
1698
2044
|
var SELECTOR_GROUP = "rte-embed-selector-group flex items-center gap-0.5";
|
|
1699
2045
|
var SELECTOR_DIVIDER = "rte-embed-selector-divider mx-0.5 h-4 w-px shrink-0 bg-border";
|
|
@@ -1718,7 +2064,7 @@ var EmbedToolbar = ({
|
|
|
1718
2064
|
}) => {
|
|
1719
2065
|
if (isEditingUrl) {
|
|
1720
2066
|
return /* @__PURE__ */ jsxs11("div", { className: "rte-embed-selector-edit-form flex items-center gap-1.5", children: [
|
|
1721
|
-
/* @__PURE__ */
|
|
2067
|
+
/* @__PURE__ */ jsx25(
|
|
1722
2068
|
"input",
|
|
1723
2069
|
{
|
|
1724
2070
|
ref: inputRef,
|
|
@@ -1736,7 +2082,7 @@ var EmbedToolbar = ({
|
|
|
1736
2082
|
}
|
|
1737
2083
|
}
|
|
1738
2084
|
),
|
|
1739
|
-
/* @__PURE__ */
|
|
2085
|
+
/* @__PURE__ */ jsx25(
|
|
1740
2086
|
"button",
|
|
1741
2087
|
{
|
|
1742
2088
|
type: "button",
|
|
@@ -1748,7 +2094,7 @@ var EmbedToolbar = ({
|
|
|
1748
2094
|
children: "Save"
|
|
1749
2095
|
}
|
|
1750
2096
|
),
|
|
1751
|
-
/* @__PURE__ */
|
|
2097
|
+
/* @__PURE__ */ jsx25(
|
|
1752
2098
|
"button",
|
|
1753
2099
|
{
|
|
1754
2100
|
type: "button",
|
|
@@ -1760,7 +2106,7 @@ var EmbedToolbar = ({
|
|
|
1760
2106
|
] });
|
|
1761
2107
|
}
|
|
1762
2108
|
return /* @__PURE__ */ jsxs11(Fragment4, { children: [
|
|
1763
|
-
/* @__PURE__ */
|
|
2109
|
+
/* @__PURE__ */ jsx25("div", { className: SELECTOR_GROUP, children: ["left", "center", "right"].map((dir) => /* @__PURE__ */ jsx25(
|
|
1764
2110
|
"button",
|
|
1765
2111
|
{
|
|
1766
2112
|
type: "button",
|
|
@@ -1771,12 +2117,12 @@ var EmbedToolbar = ({
|
|
|
1771
2117
|
align === dir && "rte-embed-selector-btn--active bg-muted text-foreground"
|
|
1772
2118
|
),
|
|
1773
2119
|
onClick: () => updateAttributes({ align: dir }),
|
|
1774
|
-
children: /* @__PURE__ */
|
|
2120
|
+
children: /* @__PURE__ */ jsx25(AlignIcon, { dir })
|
|
1775
2121
|
},
|
|
1776
2122
|
dir
|
|
1777
2123
|
)) }),
|
|
1778
|
-
/* @__PURE__ */
|
|
1779
|
-
/* @__PURE__ */
|
|
2124
|
+
/* @__PURE__ */ jsx25("div", { className: SELECTOR_DIVIDER }),
|
|
2125
|
+
/* @__PURE__ */ jsx25("div", { className: SELECTOR_GROUP, children: [25, 50, 75, 100].map((pct) => /* @__PURE__ */ jsxs11(
|
|
1780
2126
|
"button",
|
|
1781
2127
|
{
|
|
1782
2128
|
type: "button",
|
|
@@ -1793,9 +2139,9 @@ var EmbedToolbar = ({
|
|
|
1793
2139
|
},
|
|
1794
2140
|
pct
|
|
1795
2141
|
)) }),
|
|
1796
|
-
/* @__PURE__ */
|
|
2142
|
+
/* @__PURE__ */ jsx25("div", { className: SELECTOR_DIVIDER }),
|
|
1797
2143
|
/* @__PURE__ */ jsxs11("div", { className: SELECTOR_GROUP, children: [
|
|
1798
|
-
(videoSrc || nodeSrc) && /* @__PURE__ */
|
|
2144
|
+
(videoSrc || nodeSrc) && /* @__PURE__ */ jsx25(
|
|
1799
2145
|
"button",
|
|
1800
2146
|
{
|
|
1801
2147
|
type: "button",
|
|
@@ -1806,10 +2152,10 @@ var EmbedToolbar = ({
|
|
|
1806
2152
|
setUrlInput(videoSrc || nodeSrc || "");
|
|
1807
2153
|
setIsEditingUrl(true);
|
|
1808
2154
|
},
|
|
1809
|
-
children: /* @__PURE__ */
|
|
2155
|
+
children: /* @__PURE__ */ jsx25(EditUrlIcon, {})
|
|
1810
2156
|
}
|
|
1811
2157
|
),
|
|
1812
|
-
watchUrl && /* @__PURE__ */
|
|
2158
|
+
watchUrl && /* @__PURE__ */ jsx25(
|
|
1813
2159
|
"button",
|
|
1814
2160
|
{
|
|
1815
2161
|
type: "button",
|
|
@@ -1817,10 +2163,10 @@ var EmbedToolbar = ({
|
|
|
1817
2163
|
"aria-label": "Open video in YouTube",
|
|
1818
2164
|
className: SELECTOR_BUTTON,
|
|
1819
2165
|
onClick: () => window.open(watchUrl, "_blank"),
|
|
1820
|
-
children: /* @__PURE__ */
|
|
2166
|
+
children: /* @__PURE__ */ jsx25(OpenInYouTubeIcon, {})
|
|
1821
2167
|
}
|
|
1822
2168
|
),
|
|
1823
|
-
deleteNode && /* @__PURE__ */
|
|
2169
|
+
deleteNode && /* @__PURE__ */ jsx25(
|
|
1824
2170
|
"button",
|
|
1825
2171
|
{
|
|
1826
2172
|
type: "button",
|
|
@@ -1831,7 +2177,7 @@ var EmbedToolbar = ({
|
|
|
1831
2177
|
"rte-embed-selector-btn--danger hover:bg-destructive/15 hover:text-destructive"
|
|
1832
2178
|
),
|
|
1833
2179
|
onClick: () => deleteNode(),
|
|
1834
|
-
children: /* @__PURE__ */
|
|
2180
|
+
children: /* @__PURE__ */ jsx25(DeleteEmbedIcon, {})
|
|
1835
2181
|
}
|
|
1836
2182
|
)
|
|
1837
2183
|
] })
|
|
@@ -2002,7 +2348,7 @@ var ResizableNodeView = ({
|
|
|
2002
2348
|
setIsEditingUrl(false);
|
|
2003
2349
|
};
|
|
2004
2350
|
const isEditable = editor ? editor.isEditable : true;
|
|
2005
|
-
return /* @__PURE__ */
|
|
2351
|
+
return /* @__PURE__ */ jsx25(
|
|
2006
2352
|
NodeViewWrapper,
|
|
2007
2353
|
{
|
|
2008
2354
|
className: "rte-embed-wrapper group/embed",
|
|
@@ -2021,12 +2367,12 @@ var ResizableNodeView = ({
|
|
|
2021
2367
|
},
|
|
2022
2368
|
children: [
|
|
2023
2369
|
children,
|
|
2024
|
-
selected && isEditable && /* @__PURE__ */
|
|
2370
|
+
selected && isEditable && /* @__PURE__ */ jsx25(
|
|
2025
2371
|
"div",
|
|
2026
2372
|
{
|
|
2027
2373
|
className: "rte-embed-selector pointer-events-auto absolute top-[-46px] left-1/2 z-50 flex h-10 animate-rte-bubble-pop-in items-center gap-1 rounded-lg border border-[color-mix(in_srgb,var(--border)_60%,transparent)] bg-popover px-1 whitespace-nowrap shadow-[0_8px_30px_-12px_rgb(0_0_0/0.15)] [transform:translateX(-50%)]",
|
|
2028
2374
|
contentEditable: false,
|
|
2029
|
-
children: /* @__PURE__ */
|
|
2375
|
+
children: /* @__PURE__ */ jsx25(
|
|
2030
2376
|
EmbedToolbar,
|
|
2031
2377
|
{
|
|
2032
2378
|
align,
|
|
@@ -2053,7 +2399,7 @@ var ResizableNodeView = ({
|
|
|
2053
2399
|
" px"
|
|
2054
2400
|
] }),
|
|
2055
2401
|
selected && isEditable && /* @__PURE__ */ jsxs11(Fragment4, { children: [
|
|
2056
|
-
/* @__PURE__ */
|
|
2402
|
+
/* @__PURE__ */ jsx25(
|
|
2057
2403
|
"div",
|
|
2058
2404
|
{
|
|
2059
2405
|
className: `${SIDE_HANDLE} rte-resize-handle--left -left-[3px]`,
|
|
@@ -2061,7 +2407,7 @@ var ResizableNodeView = ({
|
|
|
2061
2407
|
role: "presentation"
|
|
2062
2408
|
}
|
|
2063
2409
|
),
|
|
2064
|
-
/* @__PURE__ */
|
|
2410
|
+
/* @__PURE__ */ jsx25(
|
|
2065
2411
|
"div",
|
|
2066
2412
|
{
|
|
2067
2413
|
className: `${SIDE_HANDLE} rte-resize-handle--right -right-[3px]`,
|
|
@@ -2069,7 +2415,7 @@ var ResizableNodeView = ({
|
|
|
2069
2415
|
role: "presentation"
|
|
2070
2416
|
}
|
|
2071
2417
|
),
|
|
2072
|
-
/* @__PURE__ */
|
|
2418
|
+
/* @__PURE__ */ jsx25(
|
|
2073
2419
|
"div",
|
|
2074
2420
|
{
|
|
2075
2421
|
className: `${EDGE_HANDLE} rte-resize-handle--bottom inset-x-0 -bottom-[3px] h-1.5 cursor-ns-resize after:inset-x-1 after:bottom-px after:h-0.5 after:[transition:height_150ms_ease-out,bottom_150ms_ease-out] hover:after:bottom-0 hover:after:h-1`,
|
|
@@ -2077,7 +2423,7 @@ var ResizableNodeView = ({
|
|
|
2077
2423
|
role: "presentation"
|
|
2078
2424
|
}
|
|
2079
2425
|
),
|
|
2080
|
-
/* @__PURE__ */
|
|
2426
|
+
/* @__PURE__ */ jsx25(
|
|
2081
2427
|
"div",
|
|
2082
2428
|
{
|
|
2083
2429
|
className: `${CORNER_HANDLE} rte-resize-handle--corner-bl -bottom-[5px] -left-[5px] cursor-nesw-resize`,
|
|
@@ -2085,7 +2431,7 @@ var ResizableNodeView = ({
|
|
|
2085
2431
|
role: "presentation"
|
|
2086
2432
|
}
|
|
2087
2433
|
),
|
|
2088
|
-
/* @__PURE__ */
|
|
2434
|
+
/* @__PURE__ */ jsx25(
|
|
2089
2435
|
"div",
|
|
2090
2436
|
{
|
|
2091
2437
|
className: `${CORNER_HANDLE} rte-resize-handle--corner-br -right-[5px] -bottom-[5px] cursor-nwse-resize`,
|
|
@@ -2102,7 +2448,7 @@ var ResizableNodeView = ({
|
|
|
2102
2448
|
};
|
|
2103
2449
|
|
|
2104
2450
|
// src/controls/rte-twitter-control.tsx
|
|
2105
|
-
import { jsx as
|
|
2451
|
+
import { jsx as jsx26, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2106
2452
|
var WIDGET_SCRIPT_URL = "https://platform.twitter.com/widgets.js";
|
|
2107
2453
|
var SCRIPT_LOAD_TIMEOUT_MS = 8e3;
|
|
2108
2454
|
var READY_POLL_INTERVAL_MS = 50;
|
|
@@ -2257,12 +2603,12 @@ var TwitterNodeView = (props) => {
|
|
|
2257
2603
|
minWidth: 300,
|
|
2258
2604
|
maxWidth: 1200,
|
|
2259
2605
|
children: [
|
|
2260
|
-
loading && /* @__PURE__ */
|
|
2606
|
+
loading && /* @__PURE__ */ jsx26("div", { className: "rte-embed-loading animate-pulse", children: "Loading tweet..." }),
|
|
2261
2607
|
!loading && failed && /* @__PURE__ */ jsxs12("div", { className: "rte-embed-error", children: [
|
|
2262
|
-
/* @__PURE__ */
|
|
2263
|
-
/* @__PURE__ */
|
|
2608
|
+
/* @__PURE__ */ jsx26("p", { children: "Couldn't load this tweet." }),
|
|
2609
|
+
/* @__PURE__ */ jsx26("button", { type: "button", onClick: handleRetry, children: "Retry" })
|
|
2264
2610
|
] }),
|
|
2265
|
-
/* @__PURE__ */
|
|
2611
|
+
/* @__PURE__ */ jsx26("div", { ref: containerRef })
|
|
2266
2612
|
]
|
|
2267
2613
|
}
|
|
2268
2614
|
);
|
|
@@ -2401,24 +2747,24 @@ var TwitterEmbedControl = ({ className }) => {
|
|
|
2401
2747
|
}
|
|
2402
2748
|
},
|
|
2403
2749
|
children: [
|
|
2404
|
-
/* @__PURE__ */
|
|
2750
|
+
/* @__PURE__ */ jsx26(
|
|
2405
2751
|
DialogTrigger,
|
|
2406
2752
|
{
|
|
2407
|
-
render: /* @__PURE__ */
|
|
2753
|
+
render: /* @__PURE__ */ jsx26(
|
|
2408
2754
|
RichTextEditorControl,
|
|
2409
2755
|
{
|
|
2410
2756
|
active,
|
|
2411
2757
|
className,
|
|
2412
2758
|
title: "Embed Tweet",
|
|
2413
2759
|
"aria-label": "Embed Tweet",
|
|
2414
|
-
children: /* @__PURE__ */
|
|
2760
|
+
children: /* @__PURE__ */ jsx26(
|
|
2415
2761
|
"svg",
|
|
2416
2762
|
{
|
|
2417
2763
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2418
2764
|
viewBox: "0 0 24 24",
|
|
2419
2765
|
fill: "currentColor",
|
|
2420
2766
|
className: "rte-editor-icon",
|
|
2421
|
-
children: /* @__PURE__ */
|
|
2767
|
+
children: /* @__PURE__ */ jsx26("path", { d: "M18.2 3.2h3.3l-7.2 8.2 8.5 11.2h-6.6l-5.2-6.8-6 6.8H2.7l7.7-8.8L2.3 3.2h6.8l4.7 6.2 5.4-6.2zm-1.2 17.3h1.8L7 4.8H5.1l11.9 15.7z" })
|
|
2422
2768
|
}
|
|
2423
2769
|
)
|
|
2424
2770
|
}
|
|
@@ -2427,10 +2773,10 @@ var TwitterEmbedControl = ({ className }) => {
|
|
|
2427
2773
|
),
|
|
2428
2774
|
/* @__PURE__ */ jsxs12(DialogContent, { children: [
|
|
2429
2775
|
/* @__PURE__ */ jsxs12(DialogHeader, { children: [
|
|
2430
|
-
/* @__PURE__ */
|
|
2431
|
-
/* @__PURE__ */
|
|
2776
|
+
/* @__PURE__ */ jsx26(DialogTitle, { children: "Embed Tweet" }),
|
|
2777
|
+
/* @__PURE__ */ jsx26(DialogDescription, { children: "Paste a tweet URL or ID." })
|
|
2432
2778
|
] }),
|
|
2433
|
-
/* @__PURE__ */
|
|
2779
|
+
/* @__PURE__ */ jsx26(
|
|
2434
2780
|
Input,
|
|
2435
2781
|
{
|
|
2436
2782
|
value: url,
|
|
@@ -2450,10 +2796,10 @@ var TwitterEmbedControl = ({ className }) => {
|
|
|
2450
2796
|
}
|
|
2451
2797
|
}
|
|
2452
2798
|
),
|
|
2453
|
-
showError && /* @__PURE__ */
|
|
2799
|
+
showError && /* @__PURE__ */ jsx26("p", { className: "rte-input-error", role: "alert", children: "That doesn't look like a valid tweet URL or ID." }),
|
|
2454
2800
|
/* @__PURE__ */ jsxs12(DialogFooter, { children: [
|
|
2455
|
-
/* @__PURE__ */
|
|
2456
|
-
/* @__PURE__ */
|
|
2801
|
+
/* @__PURE__ */ jsx26(DialogClose, { children: "Cancel" }),
|
|
2802
|
+
/* @__PURE__ */ jsx26(
|
|
2457
2803
|
"button",
|
|
2458
2804
|
{
|
|
2459
2805
|
type: "button",
|
|
@@ -2483,7 +2829,7 @@ import {
|
|
|
2483
2829
|
} from "@tiptap/core";
|
|
2484
2830
|
import { ReactNodeViewRenderer as ReactNodeViewRenderer2, useEditorState as useEditorState5 } from "@tiptap/react";
|
|
2485
2831
|
import { useState as useState6, useCallback as useCallback7 } from "react";
|
|
2486
|
-
import { jsx as
|
|
2832
|
+
import { jsx as jsx27, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2487
2833
|
var getYouTubeId = (url) => {
|
|
2488
2834
|
const clean = url.trim();
|
|
2489
2835
|
const patterns = [
|
|
@@ -2511,7 +2857,7 @@ var YouTubeNodeView = (props) => {
|
|
|
2511
2857
|
if (videoId) {
|
|
2512
2858
|
watchUrl = videoId.startsWith("http") ? videoId : `https://www.youtube.com/watch?v=${videoId}`;
|
|
2513
2859
|
}
|
|
2514
|
-
return /* @__PURE__ */
|
|
2860
|
+
return /* @__PURE__ */ jsx27(
|
|
2515
2861
|
ResizableNodeView,
|
|
2516
2862
|
{
|
|
2517
2863
|
...props,
|
|
@@ -2522,7 +2868,7 @@ var YouTubeNodeView = (props) => {
|
|
|
2522
2868
|
videoSrc: rawSrc,
|
|
2523
2869
|
watchUrl,
|
|
2524
2870
|
onSrcChange: (newSrc) => updateAttributes({ src: newSrc }),
|
|
2525
|
-
children: /* @__PURE__ */
|
|
2871
|
+
children: /* @__PURE__ */ jsx27(
|
|
2526
2872
|
"iframe",
|
|
2527
2873
|
{
|
|
2528
2874
|
src: `https://www.youtube-nocookie.com/embed/${videoId}`,
|
|
@@ -2639,10 +2985,10 @@ var YouTubeEmbedControl = ({ className }) => {
|
|
|
2639
2985
|
}
|
|
2640
2986
|
}, [url, editor]);
|
|
2641
2987
|
return /* @__PURE__ */ jsxs13(Dialog, { open, onOpenChange: setOpen, children: [
|
|
2642
|
-
/* @__PURE__ */
|
|
2988
|
+
/* @__PURE__ */ jsx27(
|
|
2643
2989
|
DialogTrigger,
|
|
2644
2990
|
{
|
|
2645
|
-
render: /* @__PURE__ */
|
|
2991
|
+
render: /* @__PURE__ */ jsx27(
|
|
2646
2992
|
RichTextEditorControl,
|
|
2647
2993
|
{
|
|
2648
2994
|
active,
|
|
@@ -2661,8 +3007,8 @@ var YouTubeEmbedControl = ({ className }) => {
|
|
|
2661
3007
|
strokeLinejoin: "round",
|
|
2662
3008
|
className: "rte-editor-icon",
|
|
2663
3009
|
children: [
|
|
2664
|
-
/* @__PURE__ */
|
|
2665
|
-
/* @__PURE__ */
|
|
3010
|
+
/* @__PURE__ */ jsx27("path", { d: "M23.5 6.2a3 3 0 0 0-2.1-2.1C19.5 3.5 12 3.5 12 3.5s-7.5 0-9.4.6a3 3 0 0 0-2.1 2.1C0 8.1 0 12 0 12s0 3.9.5 5.8a3 3 0 0 0 2.1 2.1c1.9.6 9.4.6 9.4.6s7.5 0 9.4-.6a3 3 0 0 0 2.1-2.1c.5-1.9.5-5.8.5-5.8s0-3.9-.5-5.8z" }),
|
|
3011
|
+
/* @__PURE__ */ jsx27("path", { d: "M9.5 15.5V8.5l6.2 3.5z" })
|
|
2666
3012
|
]
|
|
2667
3013
|
}
|
|
2668
3014
|
)
|
|
@@ -2672,10 +3018,10 @@ var YouTubeEmbedControl = ({ className }) => {
|
|
|
2672
3018
|
),
|
|
2673
3019
|
/* @__PURE__ */ jsxs13(DialogContent, { showCloseButton: false, children: [
|
|
2674
3020
|
/* @__PURE__ */ jsxs13(DialogHeader, { children: [
|
|
2675
|
-
/* @__PURE__ */
|
|
2676
|
-
/* @__PURE__ */
|
|
3021
|
+
/* @__PURE__ */ jsx27(DialogTitle, { children: "Embed YouTube video" }),
|
|
3022
|
+
/* @__PURE__ */ jsx27(DialogDescription, { children: "Paste a YouTube video URL or ID." })
|
|
2677
3023
|
] }),
|
|
2678
|
-
/* @__PURE__ */
|
|
3024
|
+
/* @__PURE__ */ jsx27(
|
|
2679
3025
|
Input,
|
|
2680
3026
|
{
|
|
2681
3027
|
value: url,
|
|
@@ -2690,8 +3036,8 @@ var YouTubeEmbedControl = ({ className }) => {
|
|
|
2690
3036
|
}
|
|
2691
3037
|
),
|
|
2692
3038
|
/* @__PURE__ */ jsxs13(DialogFooter, { children: [
|
|
2693
|
-
/* @__PURE__ */
|
|
2694
|
-
/* @__PURE__ */
|
|
3039
|
+
/* @__PURE__ */ jsx27(DialogClose, { children: "Cancel" }),
|
|
3040
|
+
/* @__PURE__ */ jsx27(
|
|
2695
3041
|
DialogClose,
|
|
2696
3042
|
{
|
|
2697
3043
|
disabled: !url,
|
|
@@ -2748,14 +3094,14 @@ var DEFAULT_LABELS = {
|
|
|
2748
3094
|
|
|
2749
3095
|
// src/rte-content.tsx
|
|
2750
3096
|
import { EditorContent } from "@tiptap/react";
|
|
2751
|
-
import { jsx as
|
|
3097
|
+
import { jsx as jsx28, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2752
3098
|
var Content = ({
|
|
2753
3099
|
children,
|
|
2754
3100
|
className
|
|
2755
3101
|
}) => {
|
|
2756
3102
|
const { editor, preset, variant } = useRichTextEditorContext();
|
|
2757
3103
|
return /* @__PURE__ */ jsxs14("div", { className: "relative", children: [
|
|
2758
|
-
/* @__PURE__ */
|
|
3104
|
+
/* @__PURE__ */ jsx28(
|
|
2759
3105
|
EditorContent,
|
|
2760
3106
|
{
|
|
2761
3107
|
editor,
|
|
@@ -2774,7 +3120,7 @@ var Content = ({
|
|
|
2774
3120
|
|
|
2775
3121
|
// src/rte-controls-group.tsx
|
|
2776
3122
|
import { useContext as useContext3 } from "react";
|
|
2777
|
-
import { jsx as
|
|
3123
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
2778
3124
|
var SEPARATOR = "[.rte-controls-group+&]:before:w-px [.rte-controls-group+&]:before:shrink-0 [.rte-controls-group+&]:before:bg-border [.rte-controls-group+&]:before:content-['']";
|
|
2779
3125
|
var BUTTON = "[&>button]:border-none [&>button]:bg-transparent [&>button]:transition-[background-color,color] [&>button]:duration-150 [&>button]:ease-[ease-out] [&>button:focus-visible]:outline-2 [&>button:focus-visible]:outline-offset-1 [&>button:focus-visible]:outline-ring/50 [&>button:focus-visible]:outline-solid";
|
|
2780
3126
|
var variantClasses = {
|
|
@@ -2787,7 +3133,7 @@ var ControlsGroup = ({
|
|
|
2787
3133
|
className
|
|
2788
3134
|
}) => {
|
|
2789
3135
|
const variant = useContext3(RichTextEditorContext)?.variant;
|
|
2790
|
-
return /* @__PURE__ */
|
|
3136
|
+
return /* @__PURE__ */ jsx29(
|
|
2791
3137
|
"div",
|
|
2792
3138
|
{
|
|
2793
3139
|
className: cn(
|
|
@@ -2802,7 +3148,7 @@ var ControlsGroup = ({
|
|
|
2802
3148
|
|
|
2803
3149
|
// src/rte-footer.tsx
|
|
2804
3150
|
import { useEffect as useEffect5, useMemo, useRef as useRef5, useState as useState7 } from "react";
|
|
2805
|
-
import { Fragment as Fragment5, jsx as
|
|
3151
|
+
import { Fragment as Fragment5, jsx as jsx30, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2806
3152
|
var Footer = ({
|
|
2807
3153
|
children,
|
|
2808
3154
|
className,
|
|
@@ -2875,7 +3221,7 @@ var Footer = ({
|
|
|
2875
3221
|
"data-sticky": sticky ? "" : void 0,
|
|
2876
3222
|
style: sticky ? { bottom: stickyOffset } : void 0,
|
|
2877
3223
|
children: [
|
|
2878
|
-
showWordCount && wordCount && /* @__PURE__ */
|
|
3224
|
+
showWordCount && wordCount && /* @__PURE__ */ jsx30(
|
|
2879
3225
|
"span",
|
|
2880
3226
|
{
|
|
2881
3227
|
className: cn(
|
|
@@ -2884,10 +3230,10 @@ var Footer = ({
|
|
|
2884
3230
|
),
|
|
2885
3231
|
children: wordCountFormatter ? wordCountFormatter(wordCount) : /* @__PURE__ */ jsxs15(Fragment5, { children: [
|
|
2886
3232
|
/* @__PURE__ */ jsxs15("span", { className: "rte-footer-word-count-stat inline-flex items-baseline gap-1", children: [
|
|
2887
|
-
/* @__PURE__ */
|
|
2888
|
-
/* @__PURE__ */
|
|
3233
|
+
/* @__PURE__ */ jsx30("span", { className: "rte-footer-word-count-number font-medium text-foreground tabular-nums", children: wordCount.words }),
|
|
3234
|
+
/* @__PURE__ */ jsx30("span", { className: "rte-footer-word-count-unit text-muted-foreground", children: "words" })
|
|
2889
3235
|
] }),
|
|
2890
|
-
/* @__PURE__ */
|
|
3236
|
+
/* @__PURE__ */ jsx30(
|
|
2891
3237
|
"span",
|
|
2892
3238
|
{
|
|
2893
3239
|
className: "rte-footer-word-count-separator size-[3px] shrink-0 rounded-full bg-[color-mix(in_srgb,var(--muted-foreground)_45%,transparent)]",
|
|
@@ -2895,8 +3241,8 @@ var Footer = ({
|
|
|
2895
3241
|
}
|
|
2896
3242
|
),
|
|
2897
3243
|
/* @__PURE__ */ jsxs15("span", { className: "rte-footer-word-count-stat inline-flex items-baseline gap-1", children: [
|
|
2898
|
-
/* @__PURE__ */
|
|
2899
|
-
/* @__PURE__ */
|
|
3244
|
+
/* @__PURE__ */ jsx30("span", { className: "rte-footer-word-count-number font-medium text-foreground tabular-nums", children: wordCount.characters }),
|
|
3245
|
+
/* @__PURE__ */ jsx30("span", { className: "rte-footer-word-count-unit text-muted-foreground", children: "characters" })
|
|
2900
3246
|
] })
|
|
2901
3247
|
] })
|
|
2902
3248
|
}
|
|
@@ -2908,7 +3254,7 @@ var Footer = ({
|
|
|
2908
3254
|
};
|
|
2909
3255
|
|
|
2910
3256
|
// src/rte-toolbar.tsx
|
|
2911
|
-
import { jsx as
|
|
3257
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
2912
3258
|
var Toolbar = ({
|
|
2913
3259
|
children,
|
|
2914
3260
|
className,
|
|
@@ -2919,7 +3265,7 @@ var Toolbar = ({
|
|
|
2919
3265
|
if (!editable) {
|
|
2920
3266
|
return null;
|
|
2921
3267
|
}
|
|
2922
|
-
return /* @__PURE__ */
|
|
3268
|
+
return /* @__PURE__ */ jsx31(
|
|
2923
3269
|
"div",
|
|
2924
3270
|
{
|
|
2925
3271
|
className: cn(
|
|
@@ -2941,7 +3287,7 @@ var Toolbar = ({
|
|
|
2941
3287
|
};
|
|
2942
3288
|
|
|
2943
3289
|
// src/rte-text-editor.tsx
|
|
2944
|
-
import { jsx as
|
|
3290
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
2945
3291
|
var RichTextEditorRoot = ({
|
|
2946
3292
|
editor,
|
|
2947
3293
|
children,
|
|
@@ -2963,7 +3309,7 @@ var RichTextEditorRoot = ({
|
|
|
2963
3309
|
editor.setEditable(editable);
|
|
2964
3310
|
}
|
|
2965
3311
|
}, [editor, editable]);
|
|
2966
|
-
return /* @__PURE__ */
|
|
3312
|
+
return /* @__PURE__ */ jsx32(
|
|
2967
3313
|
RichTextEditorContext.Provider,
|
|
2968
3314
|
{
|
|
2969
3315
|
value: {
|
|
@@ -2975,7 +3321,7 @@ var RichTextEditorRoot = ({
|
|
|
2975
3321
|
tooltip,
|
|
2976
3322
|
variant
|
|
2977
3323
|
},
|
|
2978
|
-
children: /* @__PURE__ */
|
|
3324
|
+
children: /* @__PURE__ */ jsx32(
|
|
2979
3325
|
"div",
|
|
2980
3326
|
{
|
|
2981
3327
|
className: cn(
|
|
@@ -2986,7 +3332,7 @@ var RichTextEditorRoot = ({
|
|
|
2986
3332
|
className
|
|
2987
3333
|
),
|
|
2988
3334
|
"data-variant": variant,
|
|
2989
|
-
children: /* @__PURE__ */
|
|
3335
|
+
children: /* @__PURE__ */ jsx32(TooltipProvider, { children: /* @__PURE__ */ jsx32(TooltipHost, { handle: tooltip, side: "bottom", children }) })
|
|
2990
3336
|
}
|
|
2991
3337
|
)
|
|
2992
3338
|
}
|