@mhamz.01/easyflow-texteditor 0.1.91 → 0.1.94
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/index.css +24 -24
- package/dist/index.css.map +1 -1
- package/dist/index.js +923 -561
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +852 -490
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1273,14 +1273,15 @@ function EditorLayout({ children, onChange, initialTabs, onTabsChange }) {
|
|
|
1273
1273
|
import { useEffect as useEffect24, useRef as useRef7, useState as useState33 } from "react";
|
|
1274
1274
|
import { EditorContent, EditorContext, useEditor } from "@tiptap/react";
|
|
1275
1275
|
import { StarterKit } from "@tiptap/starter-kit";
|
|
1276
|
+
import ImageResize from "tiptap-extension-resize-image";
|
|
1276
1277
|
import Image from "@tiptap/extension-image";
|
|
1277
|
-
import { TaskItem, TaskList } from "@tiptap/extension-list";
|
|
1278
|
+
import { ListItem, TaskItem, TaskList } from "@tiptap/extension-list";
|
|
1278
1279
|
import { TextAlign } from "@tiptap/extension-text-align";
|
|
1279
1280
|
import { Typography } from "@tiptap/extension-typography";
|
|
1280
1281
|
import { Highlight } from "@tiptap/extension-highlight";
|
|
1281
1282
|
import { Subscript } from "@tiptap/extension-subscript";
|
|
1282
1283
|
import { Superscript } from "@tiptap/extension-superscript";
|
|
1283
|
-
import { Gapcursor, Selection as
|
|
1284
|
+
import { Gapcursor, Selection as Selection3 } from "@tiptap/extensions";
|
|
1284
1285
|
import { TextStyleKit } from "@tiptap/extension-text-style";
|
|
1285
1286
|
|
|
1286
1287
|
// node_modules/@tiptap/extension-document/dist/index.js
|
|
@@ -1349,9 +1350,396 @@ var Paragraph = Node2.create({
|
|
|
1349
1350
|
});
|
|
1350
1351
|
var index_default2 = Paragraph;
|
|
1351
1352
|
|
|
1353
|
+
// node_modules/@tiptap/extension-blockquote/dist/index.js
|
|
1354
|
+
import { mergeAttributes as mergeAttributes2, Node as Node3, wrappingInputRule } from "@tiptap/core";
|
|
1355
|
+
import { jsx as jsx17 } from "@tiptap/core/jsx-runtime";
|
|
1356
|
+
var inputRegex = /^\s*>\s$/;
|
|
1357
|
+
var Blockquote = Node3.create({
|
|
1358
|
+
name: "blockquote",
|
|
1359
|
+
addOptions() {
|
|
1360
|
+
return {
|
|
1361
|
+
HTMLAttributes: {}
|
|
1362
|
+
};
|
|
1363
|
+
},
|
|
1364
|
+
content: "block+",
|
|
1365
|
+
group: "block",
|
|
1366
|
+
defining: true,
|
|
1367
|
+
parseHTML() {
|
|
1368
|
+
return [{ tag: "blockquote" }];
|
|
1369
|
+
},
|
|
1370
|
+
renderHTML({ HTMLAttributes }) {
|
|
1371
|
+
return /* @__PURE__ */ jsx17("blockquote", { ...mergeAttributes2(this.options.HTMLAttributes, HTMLAttributes), children: /* @__PURE__ */ jsx17("slot", {}) });
|
|
1372
|
+
},
|
|
1373
|
+
parseMarkdown: (token, helpers) => {
|
|
1374
|
+
return helpers.createNode("blockquote", void 0, helpers.parseChildren(token.tokens || []));
|
|
1375
|
+
},
|
|
1376
|
+
renderMarkdown: (node, h) => {
|
|
1377
|
+
if (!node.content) {
|
|
1378
|
+
return "";
|
|
1379
|
+
}
|
|
1380
|
+
const prefix = ">";
|
|
1381
|
+
const result = [];
|
|
1382
|
+
node.content.forEach((child) => {
|
|
1383
|
+
const childContent = h.renderChildren([child]);
|
|
1384
|
+
const lines = childContent.split("\n");
|
|
1385
|
+
const linesWithPrefix = lines.map((line) => {
|
|
1386
|
+
if (line.trim() === "") {
|
|
1387
|
+
return prefix;
|
|
1388
|
+
}
|
|
1389
|
+
return `${prefix} ${line}`;
|
|
1390
|
+
});
|
|
1391
|
+
result.push(linesWithPrefix.join("\n"));
|
|
1392
|
+
});
|
|
1393
|
+
return result.join(`
|
|
1394
|
+
${prefix}
|
|
1395
|
+
`);
|
|
1396
|
+
},
|
|
1397
|
+
addCommands() {
|
|
1398
|
+
return {
|
|
1399
|
+
setBlockquote: () => ({ commands }) => {
|
|
1400
|
+
return commands.wrapIn(this.name);
|
|
1401
|
+
},
|
|
1402
|
+
toggleBlockquote: () => ({ commands }) => {
|
|
1403
|
+
return commands.toggleWrap(this.name);
|
|
1404
|
+
},
|
|
1405
|
+
unsetBlockquote: () => ({ commands }) => {
|
|
1406
|
+
return commands.lift(this.name);
|
|
1407
|
+
}
|
|
1408
|
+
};
|
|
1409
|
+
},
|
|
1410
|
+
addKeyboardShortcuts() {
|
|
1411
|
+
return {
|
|
1412
|
+
"Mod-Shift-b": () => this.editor.commands.toggleBlockquote()
|
|
1413
|
+
};
|
|
1414
|
+
},
|
|
1415
|
+
addInputRules() {
|
|
1416
|
+
return [
|
|
1417
|
+
wrappingInputRule({
|
|
1418
|
+
find: inputRegex,
|
|
1419
|
+
type: this.type
|
|
1420
|
+
})
|
|
1421
|
+
];
|
|
1422
|
+
}
|
|
1423
|
+
});
|
|
1424
|
+
var index_default3 = Blockquote;
|
|
1425
|
+
|
|
1426
|
+
// node_modules/@tiptap/extension-code-block/dist/index.js
|
|
1427
|
+
import { mergeAttributes as mergeAttributes3, Node as Node4, textblockTypeInputRule } from "@tiptap/core";
|
|
1428
|
+
import { Plugin, PluginKey, Selection, TextSelection } from "@tiptap/pm/state";
|
|
1429
|
+
var DEFAULT_TAB_SIZE = 4;
|
|
1430
|
+
var backtickInputRegex = /^```([a-z]+)?[\s\n]$/;
|
|
1431
|
+
var tildeInputRegex = /^~~~([a-z]+)?[\s\n]$/;
|
|
1432
|
+
var CodeBlock = Node4.create({
|
|
1433
|
+
name: "codeBlock",
|
|
1434
|
+
addOptions() {
|
|
1435
|
+
return {
|
|
1436
|
+
languageClassPrefix: "language-",
|
|
1437
|
+
exitOnTripleEnter: true,
|
|
1438
|
+
exitOnArrowDown: true,
|
|
1439
|
+
defaultLanguage: null,
|
|
1440
|
+
enableTabIndentation: false,
|
|
1441
|
+
tabSize: DEFAULT_TAB_SIZE,
|
|
1442
|
+
HTMLAttributes: {}
|
|
1443
|
+
};
|
|
1444
|
+
},
|
|
1445
|
+
content: "text*",
|
|
1446
|
+
marks: "",
|
|
1447
|
+
group: "block",
|
|
1448
|
+
code: true,
|
|
1449
|
+
defining: true,
|
|
1450
|
+
addAttributes() {
|
|
1451
|
+
return {
|
|
1452
|
+
language: {
|
|
1453
|
+
default: this.options.defaultLanguage,
|
|
1454
|
+
parseHTML: (element) => {
|
|
1455
|
+
var _a;
|
|
1456
|
+
const { languageClassPrefix } = this.options;
|
|
1457
|
+
if (!languageClassPrefix) {
|
|
1458
|
+
return null;
|
|
1459
|
+
}
|
|
1460
|
+
const classNames = [...((_a = element.firstElementChild) == null ? void 0 : _a.classList) || []];
|
|
1461
|
+
const languages = classNames.filter((className) => className.startsWith(languageClassPrefix)).map((className) => className.replace(languageClassPrefix, ""));
|
|
1462
|
+
const language = languages[0];
|
|
1463
|
+
if (!language) {
|
|
1464
|
+
return null;
|
|
1465
|
+
}
|
|
1466
|
+
return language;
|
|
1467
|
+
},
|
|
1468
|
+
rendered: false
|
|
1469
|
+
}
|
|
1470
|
+
};
|
|
1471
|
+
},
|
|
1472
|
+
parseHTML() {
|
|
1473
|
+
return [
|
|
1474
|
+
{
|
|
1475
|
+
tag: "pre",
|
|
1476
|
+
preserveWhitespace: "full"
|
|
1477
|
+
}
|
|
1478
|
+
];
|
|
1479
|
+
},
|
|
1480
|
+
renderHTML({ node, HTMLAttributes }) {
|
|
1481
|
+
return [
|
|
1482
|
+
"pre",
|
|
1483
|
+
mergeAttributes3(this.options.HTMLAttributes, HTMLAttributes),
|
|
1484
|
+
[
|
|
1485
|
+
"code",
|
|
1486
|
+
{
|
|
1487
|
+
class: node.attrs.language ? this.options.languageClassPrefix + node.attrs.language : null
|
|
1488
|
+
},
|
|
1489
|
+
0
|
|
1490
|
+
]
|
|
1491
|
+
];
|
|
1492
|
+
},
|
|
1493
|
+
markdownTokenName: "code",
|
|
1494
|
+
parseMarkdown: (token, helpers) => {
|
|
1495
|
+
var _a;
|
|
1496
|
+
if (((_a = token.raw) == null ? void 0 : _a.startsWith("```")) === false && token.codeBlockStyle !== "indented") {
|
|
1497
|
+
return [];
|
|
1498
|
+
}
|
|
1499
|
+
return helpers.createNode(
|
|
1500
|
+
"codeBlock",
|
|
1501
|
+
{ language: token.lang || null },
|
|
1502
|
+
token.text ? [helpers.createTextNode(token.text)] : []
|
|
1503
|
+
);
|
|
1504
|
+
},
|
|
1505
|
+
renderMarkdown: (node, h) => {
|
|
1506
|
+
var _a;
|
|
1507
|
+
let output = "";
|
|
1508
|
+
const language = ((_a = node.attrs) == null ? void 0 : _a.language) || "";
|
|
1509
|
+
if (!node.content) {
|
|
1510
|
+
output = `\`\`\`${language}
|
|
1511
|
+
|
|
1512
|
+
\`\`\``;
|
|
1513
|
+
} else {
|
|
1514
|
+
const lines = [`\`\`\`${language}`, h.renderChildren(node.content), "```"];
|
|
1515
|
+
output = lines.join("\n");
|
|
1516
|
+
}
|
|
1517
|
+
return output;
|
|
1518
|
+
},
|
|
1519
|
+
addCommands() {
|
|
1520
|
+
return {
|
|
1521
|
+
setCodeBlock: (attributes) => ({ commands }) => {
|
|
1522
|
+
return commands.setNode(this.name, attributes);
|
|
1523
|
+
},
|
|
1524
|
+
toggleCodeBlock: (attributes) => ({ commands }) => {
|
|
1525
|
+
return commands.toggleNode(this.name, "paragraph", attributes);
|
|
1526
|
+
}
|
|
1527
|
+
};
|
|
1528
|
+
},
|
|
1529
|
+
addKeyboardShortcuts() {
|
|
1530
|
+
return {
|
|
1531
|
+
"Mod-Alt-c": () => this.editor.commands.toggleCodeBlock(),
|
|
1532
|
+
// remove code block when at start of document or code block is empty
|
|
1533
|
+
Backspace: () => {
|
|
1534
|
+
const { empty, $anchor } = this.editor.state.selection;
|
|
1535
|
+
const isAtStart = $anchor.pos === 1;
|
|
1536
|
+
if (!empty || $anchor.parent.type.name !== this.name) {
|
|
1537
|
+
return false;
|
|
1538
|
+
}
|
|
1539
|
+
if (isAtStart || !$anchor.parent.textContent.length) {
|
|
1540
|
+
return this.editor.commands.clearNodes();
|
|
1541
|
+
}
|
|
1542
|
+
return false;
|
|
1543
|
+
},
|
|
1544
|
+
// handle tab indentation
|
|
1545
|
+
Tab: ({ editor }) => {
|
|
1546
|
+
var _a;
|
|
1547
|
+
if (!this.options.enableTabIndentation) {
|
|
1548
|
+
return false;
|
|
1549
|
+
}
|
|
1550
|
+
const tabSize = (_a = this.options.tabSize) != null ? _a : DEFAULT_TAB_SIZE;
|
|
1551
|
+
const { state } = editor;
|
|
1552
|
+
const { selection } = state;
|
|
1553
|
+
const { $from, empty } = selection;
|
|
1554
|
+
if ($from.parent.type !== this.type) {
|
|
1555
|
+
return false;
|
|
1556
|
+
}
|
|
1557
|
+
const indent = " ".repeat(tabSize);
|
|
1558
|
+
if (empty) {
|
|
1559
|
+
return editor.commands.insertContent(indent);
|
|
1560
|
+
}
|
|
1561
|
+
return editor.commands.command(({ tr }) => {
|
|
1562
|
+
const { from, to } = selection;
|
|
1563
|
+
const text = state.doc.textBetween(from, to, "\n", "\n");
|
|
1564
|
+
const lines = text.split("\n");
|
|
1565
|
+
const indentedText = lines.map((line) => indent + line).join("\n");
|
|
1566
|
+
tr.replaceWith(from, to, state.schema.text(indentedText));
|
|
1567
|
+
return true;
|
|
1568
|
+
});
|
|
1569
|
+
},
|
|
1570
|
+
// handle shift+tab reverse indentation
|
|
1571
|
+
"Shift-Tab": ({ editor }) => {
|
|
1572
|
+
var _a;
|
|
1573
|
+
if (!this.options.enableTabIndentation) {
|
|
1574
|
+
return false;
|
|
1575
|
+
}
|
|
1576
|
+
const tabSize = (_a = this.options.tabSize) != null ? _a : DEFAULT_TAB_SIZE;
|
|
1577
|
+
const { state } = editor;
|
|
1578
|
+
const { selection } = state;
|
|
1579
|
+
const { $from, empty } = selection;
|
|
1580
|
+
if ($from.parent.type !== this.type) {
|
|
1581
|
+
return false;
|
|
1582
|
+
}
|
|
1583
|
+
if (empty) {
|
|
1584
|
+
return editor.commands.command(({ tr }) => {
|
|
1585
|
+
var _a2;
|
|
1586
|
+
const { pos } = $from;
|
|
1587
|
+
const codeBlockStart = $from.start();
|
|
1588
|
+
const codeBlockEnd = $from.end();
|
|
1589
|
+
const allText = state.doc.textBetween(codeBlockStart, codeBlockEnd, "\n", "\n");
|
|
1590
|
+
const lines = allText.split("\n");
|
|
1591
|
+
let currentLineIndex = 0;
|
|
1592
|
+
let charCount = 0;
|
|
1593
|
+
const relativeCursorPos = pos - codeBlockStart;
|
|
1594
|
+
for (let i = 0; i < lines.length; i += 1) {
|
|
1595
|
+
if (charCount + lines[i].length >= relativeCursorPos) {
|
|
1596
|
+
currentLineIndex = i;
|
|
1597
|
+
break;
|
|
1598
|
+
}
|
|
1599
|
+
charCount += lines[i].length + 1;
|
|
1600
|
+
}
|
|
1601
|
+
const currentLine = lines[currentLineIndex];
|
|
1602
|
+
const leadingSpaces = ((_a2 = currentLine.match(/^ */)) == null ? void 0 : _a2[0]) || "";
|
|
1603
|
+
const spacesToRemove = Math.min(leadingSpaces.length, tabSize);
|
|
1604
|
+
if (spacesToRemove === 0) {
|
|
1605
|
+
return true;
|
|
1606
|
+
}
|
|
1607
|
+
let lineStartPos = codeBlockStart;
|
|
1608
|
+
for (let i = 0; i < currentLineIndex; i += 1) {
|
|
1609
|
+
lineStartPos += lines[i].length + 1;
|
|
1610
|
+
}
|
|
1611
|
+
tr.delete(lineStartPos, lineStartPos + spacesToRemove);
|
|
1612
|
+
const cursorPosInLine = pos - lineStartPos;
|
|
1613
|
+
if (cursorPosInLine <= spacesToRemove) {
|
|
1614
|
+
tr.setSelection(TextSelection.create(tr.doc, lineStartPos));
|
|
1615
|
+
}
|
|
1616
|
+
return true;
|
|
1617
|
+
});
|
|
1618
|
+
}
|
|
1619
|
+
return editor.commands.command(({ tr }) => {
|
|
1620
|
+
const { from, to } = selection;
|
|
1621
|
+
const text = state.doc.textBetween(from, to, "\n", "\n");
|
|
1622
|
+
const lines = text.split("\n");
|
|
1623
|
+
const reverseIndentText = lines.map((line) => {
|
|
1624
|
+
var _a2;
|
|
1625
|
+
const leadingSpaces = ((_a2 = line.match(/^ */)) == null ? void 0 : _a2[0]) || "";
|
|
1626
|
+
const spacesToRemove = Math.min(leadingSpaces.length, tabSize);
|
|
1627
|
+
return line.slice(spacesToRemove);
|
|
1628
|
+
}).join("\n");
|
|
1629
|
+
tr.replaceWith(from, to, state.schema.text(reverseIndentText));
|
|
1630
|
+
return true;
|
|
1631
|
+
});
|
|
1632
|
+
},
|
|
1633
|
+
// exit node on triple enter
|
|
1634
|
+
Enter: ({ editor }) => {
|
|
1635
|
+
if (!this.options.exitOnTripleEnter) {
|
|
1636
|
+
return false;
|
|
1637
|
+
}
|
|
1638
|
+
const { state } = editor;
|
|
1639
|
+
const { selection } = state;
|
|
1640
|
+
const { $from, empty } = selection;
|
|
1641
|
+
if (!empty || $from.parent.type !== this.type) {
|
|
1642
|
+
return false;
|
|
1643
|
+
}
|
|
1644
|
+
const isAtEnd = $from.parentOffset === $from.parent.nodeSize - 2;
|
|
1645
|
+
const endsWithDoubleNewline = $from.parent.textContent.endsWith("\n\n");
|
|
1646
|
+
if (!isAtEnd || !endsWithDoubleNewline) {
|
|
1647
|
+
return false;
|
|
1648
|
+
}
|
|
1649
|
+
return editor.chain().command(({ tr }) => {
|
|
1650
|
+
tr.delete($from.pos - 2, $from.pos);
|
|
1651
|
+
return true;
|
|
1652
|
+
}).exitCode().run();
|
|
1653
|
+
},
|
|
1654
|
+
// exit node on arrow down
|
|
1655
|
+
ArrowDown: ({ editor }) => {
|
|
1656
|
+
if (!this.options.exitOnArrowDown) {
|
|
1657
|
+
return false;
|
|
1658
|
+
}
|
|
1659
|
+
const { state } = editor;
|
|
1660
|
+
const { selection, doc } = state;
|
|
1661
|
+
const { $from, empty } = selection;
|
|
1662
|
+
if (!empty || $from.parent.type !== this.type) {
|
|
1663
|
+
return false;
|
|
1664
|
+
}
|
|
1665
|
+
const isAtEnd = $from.parentOffset === $from.parent.nodeSize - 2;
|
|
1666
|
+
if (!isAtEnd) {
|
|
1667
|
+
return false;
|
|
1668
|
+
}
|
|
1669
|
+
const after = $from.after();
|
|
1670
|
+
if (after === void 0) {
|
|
1671
|
+
return false;
|
|
1672
|
+
}
|
|
1673
|
+
const nodeAfter = doc.nodeAt(after);
|
|
1674
|
+
if (nodeAfter) {
|
|
1675
|
+
return editor.commands.command(({ tr }) => {
|
|
1676
|
+
tr.setSelection(Selection.near(doc.resolve(after)));
|
|
1677
|
+
return true;
|
|
1678
|
+
});
|
|
1679
|
+
}
|
|
1680
|
+
return editor.commands.exitCode();
|
|
1681
|
+
}
|
|
1682
|
+
};
|
|
1683
|
+
},
|
|
1684
|
+
addInputRules() {
|
|
1685
|
+
return [
|
|
1686
|
+
textblockTypeInputRule({
|
|
1687
|
+
find: backtickInputRegex,
|
|
1688
|
+
type: this.type,
|
|
1689
|
+
getAttributes: (match) => ({
|
|
1690
|
+
language: match[1]
|
|
1691
|
+
})
|
|
1692
|
+
}),
|
|
1693
|
+
textblockTypeInputRule({
|
|
1694
|
+
find: tildeInputRegex,
|
|
1695
|
+
type: this.type,
|
|
1696
|
+
getAttributes: (match) => ({
|
|
1697
|
+
language: match[1]
|
|
1698
|
+
})
|
|
1699
|
+
})
|
|
1700
|
+
];
|
|
1701
|
+
},
|
|
1702
|
+
addProseMirrorPlugins() {
|
|
1703
|
+
return [
|
|
1704
|
+
// this plugin creates a code block for pasted content from VS Code
|
|
1705
|
+
// we can also detect the copied code language
|
|
1706
|
+
new Plugin({
|
|
1707
|
+
key: new PluginKey("codeBlockVSCodeHandler"),
|
|
1708
|
+
props: {
|
|
1709
|
+
handlePaste: (view, event) => {
|
|
1710
|
+
if (!event.clipboardData) {
|
|
1711
|
+
return false;
|
|
1712
|
+
}
|
|
1713
|
+
if (this.editor.isActive(this.type.name)) {
|
|
1714
|
+
return false;
|
|
1715
|
+
}
|
|
1716
|
+
const text = event.clipboardData.getData("text/plain");
|
|
1717
|
+
const vscode = event.clipboardData.getData("vscode-editor-data");
|
|
1718
|
+
const vscodeData = vscode ? JSON.parse(vscode) : void 0;
|
|
1719
|
+
const language = vscodeData == null ? void 0 : vscodeData.mode;
|
|
1720
|
+
if (!text || !language) {
|
|
1721
|
+
return false;
|
|
1722
|
+
}
|
|
1723
|
+
const { tr, schema } = view.state;
|
|
1724
|
+
const textNode = schema.text(text.replace(/\r\n?/g, "\n"));
|
|
1725
|
+
tr.replaceSelectionWith(this.type.create({ language }, textNode));
|
|
1726
|
+
if (tr.selection.$from.parent.type !== this.type) {
|
|
1727
|
+
tr.setSelection(TextSelection.near(tr.doc.resolve(Math.max(0, tr.selection.from - 2))));
|
|
1728
|
+
}
|
|
1729
|
+
tr.setMeta("paste", true);
|
|
1730
|
+
view.dispatch(tr);
|
|
1731
|
+
return true;
|
|
1732
|
+
}
|
|
1733
|
+
}
|
|
1734
|
+
})
|
|
1735
|
+
];
|
|
1736
|
+
}
|
|
1737
|
+
});
|
|
1738
|
+
var index_default4 = CodeBlock;
|
|
1739
|
+
|
|
1352
1740
|
// node_modules/@tiptap/extension-text/dist/index.js
|
|
1353
|
-
import { Node as
|
|
1354
|
-
var Text =
|
|
1741
|
+
import { Node as Node5 } from "@tiptap/core";
|
|
1742
|
+
var Text = Node5.create({
|
|
1355
1743
|
name: "text",
|
|
1356
1744
|
group: "inline",
|
|
1357
1745
|
parseMarkdown: (token) => {
|
|
@@ -1362,7 +1750,7 @@ var Text = Node3.create({
|
|
|
1362
1750
|
},
|
|
1363
1751
|
renderMarkdown: (node) => node.text || ""
|
|
1364
1752
|
});
|
|
1365
|
-
var
|
|
1753
|
+
var index_default5 = Text;
|
|
1366
1754
|
|
|
1367
1755
|
// src/components/tiptap-templates/simple/simple-editor.tsx
|
|
1368
1756
|
import { FontFamily, TextStyle } from "@tiptap/extension-text-style";
|
|
@@ -1481,7 +1869,7 @@ import {
|
|
|
1481
1869
|
FloatingPortal,
|
|
1482
1870
|
FloatingDelayGroup
|
|
1483
1871
|
} from "@floating-ui/react";
|
|
1484
|
-
import { jsx as
|
|
1872
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
1485
1873
|
function useTooltip({
|
|
1486
1874
|
initialOpen = false,
|
|
1487
1875
|
placement = "top",
|
|
@@ -1545,14 +1933,14 @@ function useTooltipContext() {
|
|
|
1545
1933
|
function Tooltip2({ children, ...props }) {
|
|
1546
1934
|
const tooltip = useTooltip(props);
|
|
1547
1935
|
if (!props.useDelayGroup) {
|
|
1548
|
-
return /* @__PURE__ */
|
|
1936
|
+
return /* @__PURE__ */ jsx18(TooltipContext.Provider, { value: tooltip, children });
|
|
1549
1937
|
}
|
|
1550
|
-
return /* @__PURE__ */
|
|
1938
|
+
return /* @__PURE__ */ jsx18(
|
|
1551
1939
|
FloatingDelayGroup,
|
|
1552
1940
|
{
|
|
1553
1941
|
delay: { open: props.delay ?? 0, close: props.closeDelay ?? 0 },
|
|
1554
1942
|
timeoutMs: props.timeout,
|
|
1555
|
-
children: /* @__PURE__ */
|
|
1943
|
+
children: /* @__PURE__ */ jsx18(TooltipContext.Provider, { value: tooltip, children })
|
|
1556
1944
|
}
|
|
1557
1945
|
);
|
|
1558
1946
|
}
|
|
@@ -1581,7 +1969,7 @@ var TooltipTrigger2 = forwardRef(
|
|
|
1581
1969
|
})
|
|
1582
1970
|
);
|
|
1583
1971
|
}
|
|
1584
|
-
return /* @__PURE__ */
|
|
1972
|
+
return /* @__PURE__ */ jsx18(
|
|
1585
1973
|
"button",
|
|
1586
1974
|
{
|
|
1587
1975
|
ref,
|
|
@@ -1597,7 +1985,7 @@ var TooltipContent2 = forwardRef(
|
|
|
1597
1985
|
const context = useTooltipContext();
|
|
1598
1986
|
const ref = useMergeRefs([context.refs.setFloating, propRef]);
|
|
1599
1987
|
if (!context.open) return null;
|
|
1600
|
-
const content = /* @__PURE__ */
|
|
1988
|
+
const content = /* @__PURE__ */ jsx18(
|
|
1601
1989
|
"div",
|
|
1602
1990
|
{
|
|
1603
1991
|
ref,
|
|
@@ -1611,7 +1999,7 @@ var TooltipContent2 = forwardRef(
|
|
|
1611
1999
|
}
|
|
1612
2000
|
);
|
|
1613
2001
|
if (portal) {
|
|
1614
|
-
return /* @__PURE__ */
|
|
2002
|
+
return /* @__PURE__ */ jsx18(FloatingPortal, { ...portalProps, children: content });
|
|
1615
2003
|
}
|
|
1616
2004
|
return content;
|
|
1617
2005
|
}
|
|
@@ -1624,8 +2012,8 @@ TooltipContent2.displayName = "TooltipContent";
|
|
|
1624
2012
|
import {
|
|
1625
2013
|
AllSelection,
|
|
1626
2014
|
NodeSelection,
|
|
1627
|
-
Selection,
|
|
1628
|
-
TextSelection
|
|
2015
|
+
Selection as Selection2,
|
|
2016
|
+
TextSelection as TextSelection2
|
|
1629
2017
|
} from "@tiptap/pm/state";
|
|
1630
2018
|
import { Extension as Extension2 } from "@tiptap/core";
|
|
1631
2019
|
var MAX_FILE_SIZE = 5 * 1024 * 1024;
|
|
@@ -1673,7 +2061,7 @@ var isNodeInSchema = (nodeName, editor) => {
|
|
|
1673
2061
|
function focusNextNode(editor) {
|
|
1674
2062
|
const { state, view } = editor;
|
|
1675
2063
|
const { doc, selection } = state;
|
|
1676
|
-
const nextSel =
|
|
2064
|
+
const nextSel = Selection2.findFrom(selection.$to, 1, true);
|
|
1677
2065
|
if (nextSel) {
|
|
1678
2066
|
view.dispatch(state.tr.setSelection(nextSel).scrollIntoView());
|
|
1679
2067
|
return true;
|
|
@@ -1687,7 +2075,7 @@ function focusNextNode(editor) {
|
|
|
1687
2075
|
const para = paragraphType.create();
|
|
1688
2076
|
let tr = state.tr.insert(end, para);
|
|
1689
2077
|
const $inside = tr.doc.resolve(end + 1);
|
|
1690
|
-
tr = tr.setSelection(
|
|
2078
|
+
tr = tr.setSelection(TextSelection2.near($inside)).scrollIntoView();
|
|
1691
2079
|
view.dispatch(tr);
|
|
1692
2080
|
return true;
|
|
1693
2081
|
}
|
|
@@ -1779,7 +2167,7 @@ function selectionWithinConvertibleTypes(editor, types = []) {
|
|
|
1779
2167
|
const nodeType = selection.node?.type?.name;
|
|
1780
2168
|
return !!nodeType && allowed.has(nodeType);
|
|
1781
2169
|
}
|
|
1782
|
-
if (selection instanceof
|
|
2170
|
+
if (selection instanceof TextSelection2 || selection instanceof AllSelection) {
|
|
1783
2171
|
let valid = true;
|
|
1784
2172
|
state.doc.nodesBetween(selection.from, selection.to, (node) => {
|
|
1785
2173
|
if (node.isTextblock && !allowed.has(node.type.name)) {
|
|
@@ -1928,14 +2316,14 @@ var FontSizeExtension = Extension2.create({
|
|
|
1928
2316
|
});
|
|
1929
2317
|
|
|
1930
2318
|
// src/components/tiptap-ui-primitive/button/button.tsx
|
|
1931
|
-
import { jsx as
|
|
2319
|
+
import { jsx as jsx19, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1932
2320
|
var ShortcutDisplay = ({
|
|
1933
2321
|
shortcuts
|
|
1934
2322
|
}) => {
|
|
1935
2323
|
if (shortcuts.length === 0) return null;
|
|
1936
|
-
return /* @__PURE__ */
|
|
1937
|
-
index > 0 && /* @__PURE__ */
|
|
1938
|
-
/* @__PURE__ */
|
|
2324
|
+
return /* @__PURE__ */ jsx19("div", { children: shortcuts.map((key, index) => /* @__PURE__ */ jsxs9(Fragment2, { children: [
|
|
2325
|
+
index > 0 && /* @__PURE__ */ jsx19("kbd", { children: "+" }),
|
|
2326
|
+
/* @__PURE__ */ jsx19("kbd", { children: key })
|
|
1939
2327
|
] }, index)) });
|
|
1940
2328
|
};
|
|
1941
2329
|
var Button2 = forwardRef2(
|
|
@@ -1953,7 +2341,7 @@ var Button2 = forwardRef2(
|
|
|
1953
2341
|
[shortcutKeys]
|
|
1954
2342
|
);
|
|
1955
2343
|
if (!tooltip || !showTooltip) {
|
|
1956
|
-
return /* @__PURE__ */
|
|
2344
|
+
return /* @__PURE__ */ jsx19(
|
|
1957
2345
|
"button",
|
|
1958
2346
|
{
|
|
1959
2347
|
className: cn2("tiptap-button", className),
|
|
@@ -1965,7 +2353,7 @@ var Button2 = forwardRef2(
|
|
|
1965
2353
|
);
|
|
1966
2354
|
}
|
|
1967
2355
|
return /* @__PURE__ */ jsxs9(Tooltip2, { delay: 200, children: [
|
|
1968
|
-
/* @__PURE__ */
|
|
2356
|
+
/* @__PURE__ */ jsx19(
|
|
1969
2357
|
TooltipTrigger2,
|
|
1970
2358
|
{
|
|
1971
2359
|
className: cn2("tiptap-button", className),
|
|
@@ -1977,14 +2365,14 @@ var Button2 = forwardRef2(
|
|
|
1977
2365
|
),
|
|
1978
2366
|
/* @__PURE__ */ jsxs9(TooltipContent2, { children: [
|
|
1979
2367
|
tooltip,
|
|
1980
|
-
/* @__PURE__ */
|
|
2368
|
+
/* @__PURE__ */ jsx19(ShortcutDisplay, { shortcuts })
|
|
1981
2369
|
] })
|
|
1982
2370
|
] });
|
|
1983
2371
|
}
|
|
1984
2372
|
);
|
|
1985
2373
|
Button2.displayName = "Button";
|
|
1986
2374
|
var ButtonGroup = forwardRef2(({ className, children, orientation = "vertical", ...props }, ref) => {
|
|
1987
|
-
return /* @__PURE__ */
|
|
2375
|
+
return /* @__PURE__ */ jsx19(
|
|
1988
2376
|
"div",
|
|
1989
2377
|
{
|
|
1990
2378
|
ref,
|
|
@@ -1999,7 +2387,7 @@ var ButtonGroup = forwardRef2(({ className, children, orientation = "vertical",
|
|
|
1999
2387
|
ButtonGroup.displayName = "ButtonGroup";
|
|
2000
2388
|
|
|
2001
2389
|
// src/components/tiptap-ui-primitive/spacer/spacer.tsx
|
|
2002
|
-
import { jsx as
|
|
2390
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
2003
2391
|
function Spacer({
|
|
2004
2392
|
orientation = "horizontal",
|
|
2005
2393
|
size,
|
|
@@ -2014,7 +2402,7 @@ function Spacer({
|
|
|
2014
2402
|
height: orientation === "horizontal" ? "1px" : size
|
|
2015
2403
|
}
|
|
2016
2404
|
};
|
|
2017
|
-
return /* @__PURE__ */
|
|
2405
|
+
return /* @__PURE__ */ jsx20("div", { ...props, style: computedStyle });
|
|
2018
2406
|
}
|
|
2019
2407
|
|
|
2020
2408
|
// src/components/tiptap-ui-primitive/toolbar/toolbar.tsx
|
|
@@ -2022,12 +2410,12 @@ import { forwardRef as forwardRef4, useCallback as useCallback7, useEffect as us
|
|
|
2022
2410
|
|
|
2023
2411
|
// src/components/tiptap-ui-primitive/separator/separator.tsx
|
|
2024
2412
|
import { forwardRef as forwardRef3 } from "react";
|
|
2025
|
-
import { jsx as
|
|
2413
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
2026
2414
|
var Separator2 = forwardRef3(
|
|
2027
2415
|
({ decorative, orientation = "vertical", className, ...divProps }, ref) => {
|
|
2028
2416
|
const ariaOrientation = orientation === "vertical" ? orientation : void 0;
|
|
2029
2417
|
const semanticProps = decorative ? { role: "none" } : { "aria-orientation": ariaOrientation, role: "separator" };
|
|
2030
|
-
return /* @__PURE__ */
|
|
2418
|
+
return /* @__PURE__ */ jsx21(
|
|
2031
2419
|
"div",
|
|
2032
2420
|
{
|
|
2033
2421
|
className: cn2("tiptap-separator", className),
|
|
@@ -2196,7 +2584,7 @@ var useComposedRef = (libRef, userRef) => {
|
|
|
2196
2584
|
};
|
|
2197
2585
|
|
|
2198
2586
|
// src/components/tiptap-ui-primitive/toolbar/toolbar.tsx
|
|
2199
|
-
import { jsx as
|
|
2587
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
2200
2588
|
var useToolbarNavigation = (toolbarRef) => {
|
|
2201
2589
|
const [items, setItems] = useState10([]);
|
|
2202
2590
|
const collectItems = useCallback7(() => {
|
|
@@ -2253,7 +2641,7 @@ var Toolbar = forwardRef4(
|
|
|
2253
2641
|
const toolbarRef = useRef3(null);
|
|
2254
2642
|
const composedRef = useComposedRef(toolbarRef, ref);
|
|
2255
2643
|
useToolbarNavigation(toolbarRef);
|
|
2256
|
-
return /* @__PURE__ */
|
|
2644
|
+
return /* @__PURE__ */ jsx22(
|
|
2257
2645
|
"div",
|
|
2258
2646
|
{
|
|
2259
2647
|
ref: composedRef,
|
|
@@ -2269,7 +2657,7 @@ var Toolbar = forwardRef4(
|
|
|
2269
2657
|
);
|
|
2270
2658
|
Toolbar.displayName = "Toolbar";
|
|
2271
2659
|
var ToolbarGroup = forwardRef4(
|
|
2272
|
-
({ children, className, ...props }, ref) => /* @__PURE__ */
|
|
2660
|
+
({ children, className, ...props }, ref) => /* @__PURE__ */ jsx22(
|
|
2273
2661
|
"div",
|
|
2274
2662
|
{
|
|
2275
2663
|
ref,
|
|
@@ -2282,7 +2670,7 @@ var ToolbarGroup = forwardRef4(
|
|
|
2282
2670
|
);
|
|
2283
2671
|
ToolbarGroup.displayName = "ToolbarGroup";
|
|
2284
2672
|
var ToolbarSeparator = forwardRef4(
|
|
2285
|
-
({ ...props }, ref) => /* @__PURE__ */
|
|
2673
|
+
({ ...props }, ref) => /* @__PURE__ */ jsx22(Separator2, { ref, orientation: "vertical", decorative: true, ...props })
|
|
2286
2674
|
);
|
|
2287
2675
|
ToolbarSeparator.displayName = "ToolbarSeparator";
|
|
2288
2676
|
|
|
@@ -2298,11 +2686,11 @@ import {
|
|
|
2298
2686
|
Heading3,
|
|
2299
2687
|
Code
|
|
2300
2688
|
} from "lucide-react";
|
|
2301
|
-
import { jsx as
|
|
2689
|
+
import { jsx as jsx23, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
2302
2690
|
function BubbleMenuInline() {
|
|
2303
2691
|
const { editor } = useCurrentEditor();
|
|
2304
2692
|
if (!editor) return null;
|
|
2305
|
-
return /* @__PURE__ */
|
|
2693
|
+
return /* @__PURE__ */ jsx23(
|
|
2306
2694
|
BubbleMenu,
|
|
2307
2695
|
{
|
|
2308
2696
|
editor,
|
|
@@ -2326,76 +2714,76 @@ function BubbleMenuInline() {
|
|
|
2326
2714
|
{
|
|
2327
2715
|
className: "relative flex items-center gap-1 rounded-md border bg-[#171717] text-[#a1a1a6] p-1 shadow-md z-[15]\r\n animate-in fade-in slide-in-from-top-2 duration-200",
|
|
2328
2716
|
children: [
|
|
2329
|
-
/* @__PURE__ */
|
|
2717
|
+
/* @__PURE__ */ jsx23(
|
|
2330
2718
|
Button,
|
|
2331
2719
|
{
|
|
2332
2720
|
variant: "ghost",
|
|
2333
2721
|
size: "sm",
|
|
2334
2722
|
onClick: () => editor.chain().focus().toggleHeading({ level: 1 }).run(),
|
|
2335
2723
|
className: editor.isActive("heading", { level: 1 }) ? "bg-accent" : "",
|
|
2336
|
-
children: /* @__PURE__ */
|
|
2724
|
+
children: /* @__PURE__ */ jsx23(Heading1, { size: 15 })
|
|
2337
2725
|
}
|
|
2338
2726
|
),
|
|
2339
|
-
/* @__PURE__ */
|
|
2727
|
+
/* @__PURE__ */ jsx23(
|
|
2340
2728
|
Button,
|
|
2341
2729
|
{
|
|
2342
2730
|
variant: "ghost",
|
|
2343
2731
|
size: "sm",
|
|
2344
2732
|
onClick: () => editor.chain().focus().toggleHeading({ level: 2 }).run(),
|
|
2345
2733
|
className: editor.isActive("heading", { level: 2 }) ? "bg-accent" : "",
|
|
2346
|
-
children: /* @__PURE__ */
|
|
2734
|
+
children: /* @__PURE__ */ jsx23(Heading2, { size: 15 })
|
|
2347
2735
|
}
|
|
2348
2736
|
),
|
|
2349
|
-
/* @__PURE__ */
|
|
2737
|
+
/* @__PURE__ */ jsx23(
|
|
2350
2738
|
Button,
|
|
2351
2739
|
{
|
|
2352
2740
|
variant: "ghost",
|
|
2353
2741
|
size: "sm",
|
|
2354
2742
|
onClick: () => editor.chain().focus().toggleHeading({ level: 3 }).run(),
|
|
2355
2743
|
className: editor.isActive("heading", { level: 3 }) ? "bg-accent" : "",
|
|
2356
|
-
children: /* @__PURE__ */
|
|
2744
|
+
children: /* @__PURE__ */ jsx23(Heading3, { size: 15 })
|
|
2357
2745
|
}
|
|
2358
2746
|
),
|
|
2359
|
-
/* @__PURE__ */
|
|
2360
|
-
/* @__PURE__ */
|
|
2747
|
+
/* @__PURE__ */ jsx23(Separator, { orientation: "vertical", className: "mx-1" }),
|
|
2748
|
+
/* @__PURE__ */ jsx23(
|
|
2361
2749
|
Button,
|
|
2362
2750
|
{
|
|
2363
2751
|
variant: "ghost",
|
|
2364
2752
|
size: "sm",
|
|
2365
2753
|
onClick: () => editor.chain().focus().toggleBulletList().run(),
|
|
2366
2754
|
className: editor.isActive("bulletList") ? "bg-accent" : "",
|
|
2367
|
-
children: /* @__PURE__ */
|
|
2755
|
+
children: /* @__PURE__ */ jsx23(List, { size: 15 })
|
|
2368
2756
|
}
|
|
2369
2757
|
),
|
|
2370
|
-
/* @__PURE__ */
|
|
2758
|
+
/* @__PURE__ */ jsx23(
|
|
2371
2759
|
Button,
|
|
2372
2760
|
{
|
|
2373
2761
|
variant: "ghost",
|
|
2374
2762
|
size: "sm",
|
|
2375
2763
|
onClick: () => editor.chain().focus().toggleOrderedList().run(),
|
|
2376
2764
|
className: editor.isActive("orderedList") ? "bg-accent" : "",
|
|
2377
|
-
children: /* @__PURE__ */
|
|
2765
|
+
children: /* @__PURE__ */ jsx23(ListOrdered, { size: 15 })
|
|
2378
2766
|
}
|
|
2379
2767
|
),
|
|
2380
|
-
/* @__PURE__ */
|
|
2768
|
+
/* @__PURE__ */ jsx23(
|
|
2381
2769
|
Button,
|
|
2382
2770
|
{
|
|
2383
2771
|
variant: "ghost",
|
|
2384
2772
|
size: "sm",
|
|
2385
2773
|
onClick: () => editor.chain().focus().toggleTaskList().run(),
|
|
2386
2774
|
className: editor.isActive("taskList") ? "bg-accent" : "",
|
|
2387
|
-
children: /* @__PURE__ */
|
|
2775
|
+
children: /* @__PURE__ */ jsx23(CheckSquare, { size: 15 })
|
|
2388
2776
|
}
|
|
2389
2777
|
),
|
|
2390
|
-
/* @__PURE__ */
|
|
2391
|
-
/* @__PURE__ */
|
|
2778
|
+
/* @__PURE__ */ jsx23(Separator, { orientation: "vertical", className: "mx-1" }),
|
|
2779
|
+
/* @__PURE__ */ jsx23(
|
|
2392
2780
|
Button,
|
|
2393
2781
|
{
|
|
2394
2782
|
variant: "ghost",
|
|
2395
2783
|
size: "sm",
|
|
2396
2784
|
onClick: () => editor.chain().focus().toggleCodeBlock().run(),
|
|
2397
2785
|
className: editor.isActive("codeBlock") ? "bg-accent" : "",
|
|
2398
|
-
children: /* @__PURE__ */
|
|
2786
|
+
children: /* @__PURE__ */ jsx23(Code, { size: 15 })
|
|
2399
2787
|
}
|
|
2400
2788
|
)
|
|
2401
2789
|
]
|
|
@@ -2406,7 +2794,7 @@ function BubbleMenuInline() {
|
|
|
2406
2794
|
}
|
|
2407
2795
|
|
|
2408
2796
|
// src/components/tiptap-node/image-upload-node/image-upload-node-extension.ts
|
|
2409
|
-
import { mergeAttributes as
|
|
2797
|
+
import { mergeAttributes as mergeAttributes4, Node as Node6 } from "@tiptap/react";
|
|
2410
2798
|
import { ReactNodeViewRenderer } from "@tiptap/react";
|
|
2411
2799
|
|
|
2412
2800
|
// src/components/tiptap-node/image-upload-node/image-upload-node.tsx
|
|
@@ -2415,9 +2803,9 @@ import { NodeViewWrapper } from "@tiptap/react";
|
|
|
2415
2803
|
|
|
2416
2804
|
// src/components/tiptap-icons/close-icon.tsx
|
|
2417
2805
|
import { memo as memo6 } from "react";
|
|
2418
|
-
import { jsx as
|
|
2806
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
2419
2807
|
var CloseIcon = memo6(({ className, ...props }) => {
|
|
2420
|
-
return /* @__PURE__ */
|
|
2808
|
+
return /* @__PURE__ */ jsx24(
|
|
2421
2809
|
"svg",
|
|
2422
2810
|
{
|
|
2423
2811
|
width: "24",
|
|
@@ -2427,7 +2815,7 @@ var CloseIcon = memo6(({ className, ...props }) => {
|
|
|
2427
2815
|
fill: "currentColor",
|
|
2428
2816
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2429
2817
|
...props,
|
|
2430
|
-
children: /* @__PURE__ */
|
|
2818
|
+
children: /* @__PURE__ */ jsx24(
|
|
2431
2819
|
"path",
|
|
2432
2820
|
{
|
|
2433
2821
|
d: "M18.7071 6.70711C19.0976 6.31658 19.0976 5.68342 18.7071 5.29289C18.3166 4.90237 17.6834 4.90237 17.2929 5.29289L12 10.5858L6.70711 5.29289C6.31658 4.90237 5.68342 4.90237 5.29289 5.29289C4.90237 5.68342 4.90237 6.31658 5.29289 6.70711L10.5858 12L5.29289 17.2929C4.90237 17.6834 4.90237 18.3166 5.29289 18.7071C5.68342 19.0976 6.31658 19.0976 6.70711 18.7071L12 13.4142L17.2929 18.7071C17.6834 19.0976 18.3166 19.0976 18.7071 18.7071C19.0976 18.3166 19.0976 17.6834 18.7071 17.2929L13.4142 12L18.7071 6.70711Z",
|
|
@@ -2440,7 +2828,7 @@ var CloseIcon = memo6(({ className, ...props }) => {
|
|
|
2440
2828
|
CloseIcon.displayName = "CloseIcon";
|
|
2441
2829
|
|
|
2442
2830
|
// src/components/tiptap-node/image-upload-node/image-upload-node.tsx
|
|
2443
|
-
import { Fragment as Fragment3, jsx as
|
|
2831
|
+
import { Fragment as Fragment3, jsx as jsx25, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2444
2832
|
function useFileUpload(options) {
|
|
2445
2833
|
const [fileItems, setFileItems] = useState11([]);
|
|
2446
2834
|
const uploadFile = async (file) => {
|
|
@@ -2558,14 +2946,14 @@ var CloudUploadIcon = () => /* @__PURE__ */ jsxs11(
|
|
|
2558
2946
|
fill: "currentColor",
|
|
2559
2947
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2560
2948
|
children: [
|
|
2561
|
-
/* @__PURE__ */
|
|
2949
|
+
/* @__PURE__ */ jsx25(
|
|
2562
2950
|
"path",
|
|
2563
2951
|
{
|
|
2564
2952
|
d: "M11.1953 4.41771C10.3478 4.08499 9.43578 3.94949 8.5282 4.02147C7.62062 4.09345 6.74133 4.37102 5.95691 4.83316C5.1725 5.2953 4.50354 5.92989 4.00071 6.68886C3.49788 7.44783 3.17436 8.31128 3.05465 9.2138C2.93495 10.1163 3.0222 11.0343 3.3098 11.8981C3.5974 12.7619 4.07781 13.5489 4.71463 14.1995C5.10094 14.5942 5.09414 15.2274 4.69945 15.6137C4.30476 16 3.67163 15.9932 3.28532 15.5985C2.43622 14.731 1.79568 13.6816 1.41221 12.5299C1.02875 11.3781 0.91241 10.1542 1.07201 8.95084C1.23162 7.74748 1.66298 6.59621 2.33343 5.58425C3.00387 4.57229 3.89581 3.72617 4.9417 3.10998C5.98758 2.4938 7.15998 2.1237 8.37008 2.02773C9.58018 1.93176 10.7963 2.11243 11.9262 2.55605C13.0561 2.99968 14.0703 3.69462 14.8919 4.58825C15.5423 5.29573 16.0585 6.11304 16.4177 7.00002H17.4999C18.6799 6.99991 19.8288 7.37933 20.7766 8.08222C21.7245 8.78515 22.4212 9.7743 22.7637 10.9036C23.1062 12.0328 23.0765 13.2423 22.6788 14.3534C22.2812 15.4644 21.5367 16.4181 20.5554 17.0736C20.0962 17.3803 19.4752 17.2567 19.1684 16.7975C18.8617 16.3382 18.9853 15.7172 19.4445 15.4105C20.069 14.9934 20.5427 14.3865 20.7958 13.6794C21.0488 12.9724 21.0678 12.2027 20.8498 11.4841C20.6318 10.7655 20.1885 10.136 19.5853 9.6887C18.9821 9.24138 18.251 8.99993 17.5001 9.00002H15.71C15.2679 9.00002 14.8783 8.70973 14.7518 8.28611C14.4913 7.41374 14.0357 6.61208 13.4195 5.94186C12.8034 5.27164 12.0427 4.75043 11.1953 4.41771Z",
|
|
2565
2953
|
fill: "currentColor"
|
|
2566
2954
|
}
|
|
2567
2955
|
),
|
|
2568
|
-
/* @__PURE__ */
|
|
2956
|
+
/* @__PURE__ */ jsx25(
|
|
2569
2957
|
"path",
|
|
2570
2958
|
{
|
|
2571
2959
|
d: "M11 14.4142V21C11 21.5523 11.4477 22 12 22C12.5523 22 13 21.5523 13 21V14.4142L15.2929 16.7071C15.6834 17.0976 16.3166 17.0976 16.7071 16.7071C17.0976 16.3166 17.0976 15.6834 16.7071 15.2929L12.7078 11.2936C12.7054 11.2912 12.703 11.2888 12.7005 11.2864C12.5208 11.1099 12.2746 11.0008 12.003 11L12 11L11.997 11C11.8625 11.0004 11.7343 11.0273 11.6172 11.0759C11.502 11.1236 11.3938 11.1937 11.2995 11.2864C11.297 11.2888 11.2946 11.2912 11.2922 11.2936L7.29289 15.2929C6.90237 15.6834 6.90237 16.3166 7.29289 16.7071C7.68342 17.0976 8.31658 17.0976 8.70711 16.7071L11 14.4142Z",
|
|
@@ -2575,7 +2963,7 @@ var CloudUploadIcon = () => /* @__PURE__ */ jsxs11(
|
|
|
2575
2963
|
]
|
|
2576
2964
|
}
|
|
2577
2965
|
);
|
|
2578
|
-
var FileIcon = () => /* @__PURE__ */
|
|
2966
|
+
var FileIcon = () => /* @__PURE__ */ jsx25(
|
|
2579
2967
|
"svg",
|
|
2580
2968
|
{
|
|
2581
2969
|
width: "43",
|
|
@@ -2584,7 +2972,7 @@ var FileIcon = () => /* @__PURE__ */ jsx24(
|
|
|
2584
2972
|
fill: "currentColor",
|
|
2585
2973
|
className: "tiptap-image-upload-dropzone-rect-primary",
|
|
2586
2974
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2587
|
-
children: /* @__PURE__ */
|
|
2975
|
+
children: /* @__PURE__ */ jsx25(
|
|
2588
2976
|
"path",
|
|
2589
2977
|
{
|
|
2590
2978
|
d: "M0.75 10.75C0.75 5.64137 4.89137 1.5 10 1.5H32.3431C33.2051 1.5 34.0317 1.84241 34.6412 2.4519L40.2981 8.10876C40.9076 8.71825 41.25 9.5449 41.25 10.4069V46.75C41.25 51.8586 37.1086 56 32 56H10C4.89137 56 0.75 51.8586 0.75 46.75V10.75Z",
|
|
@@ -2596,7 +2984,7 @@ var FileIcon = () => /* @__PURE__ */ jsx24(
|
|
|
2596
2984
|
)
|
|
2597
2985
|
}
|
|
2598
2986
|
);
|
|
2599
|
-
var FileCornerIcon = () => /* @__PURE__ */
|
|
2987
|
+
var FileCornerIcon = () => /* @__PURE__ */ jsx25(
|
|
2600
2988
|
"svg",
|
|
2601
2989
|
{
|
|
2602
2990
|
width: "10",
|
|
@@ -2605,7 +2993,7 @@ var FileCornerIcon = () => /* @__PURE__ */ jsx24(
|
|
|
2605
2993
|
viewBox: "0 0 10 10",
|
|
2606
2994
|
fill: "currentColor",
|
|
2607
2995
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2608
|
-
children: /* @__PURE__ */
|
|
2996
|
+
children: /* @__PURE__ */ jsx25(
|
|
2609
2997
|
"path",
|
|
2610
2998
|
{
|
|
2611
2999
|
d: "M0 0.75H0.343146C1.40401 0.75 2.42143 1.17143 3.17157 1.92157L8.82843 7.57843C9.57857 8.32857 10 9.34599 10 10.4069V10.75H4C1.79086 10.75 0 8.95914 0 6.75V0.75Z",
|
|
@@ -2648,7 +3036,7 @@ var ImageUploadDragArea = ({
|
|
|
2648
3036
|
onFile(files);
|
|
2649
3037
|
}
|
|
2650
3038
|
};
|
|
2651
|
-
return /* @__PURE__ */
|
|
3039
|
+
return /* @__PURE__ */ jsx25(
|
|
2652
3040
|
"div",
|
|
2653
3041
|
{
|
|
2654
3042
|
className: `tiptap-image-upload-drag-area ${isDragActive ? "drag-active" : ""} ${isDragOver ? "drag-over" : ""}`,
|
|
@@ -2672,7 +3060,7 @@ var ImageUploadPreview = ({
|
|
|
2672
3060
|
return `${parseFloat((bytes / Math.pow(k, i)).toFixed(2))} ${sizes[i]}`;
|
|
2673
3061
|
};
|
|
2674
3062
|
return /* @__PURE__ */ jsxs11("div", { className: "tiptap-image-upload-preview", children: [
|
|
2675
|
-
fileItem.status === "uploading" && /* @__PURE__ */
|
|
3063
|
+
fileItem.status === "uploading" && /* @__PURE__ */ jsx25(
|
|
2676
3064
|
"div",
|
|
2677
3065
|
{
|
|
2678
3066
|
className: "tiptap-image-upload-progress",
|
|
@@ -2681,10 +3069,10 @@ var ImageUploadPreview = ({
|
|
|
2681
3069
|
),
|
|
2682
3070
|
/* @__PURE__ */ jsxs11("div", { className: "tiptap-image-upload-preview-content", children: [
|
|
2683
3071
|
/* @__PURE__ */ jsxs11("div", { className: "tiptap-image-upload-file-info", children: [
|
|
2684
|
-
/* @__PURE__ */
|
|
3072
|
+
/* @__PURE__ */ jsx25("div", { className: "tiptap-image-upload-file-icon", children: /* @__PURE__ */ jsx25(CloudUploadIcon, {}) }),
|
|
2685
3073
|
/* @__PURE__ */ jsxs11("div", { className: "tiptap-image-upload-details", children: [
|
|
2686
|
-
/* @__PURE__ */
|
|
2687
|
-
/* @__PURE__ */
|
|
3074
|
+
/* @__PURE__ */ jsx25("span", { className: "tiptap-image-upload-text", children: fileItem.file.name }),
|
|
3075
|
+
/* @__PURE__ */ jsx25("span", { className: "tiptap-image-upload-subtext", children: formatFileSize(fileItem.file.size) })
|
|
2688
3076
|
] })
|
|
2689
3077
|
] }),
|
|
2690
3078
|
/* @__PURE__ */ jsxs11("div", { className: "tiptap-image-upload-actions", children: [
|
|
@@ -2692,7 +3080,7 @@ var ImageUploadPreview = ({
|
|
|
2692
3080
|
fileItem.progress,
|
|
2693
3081
|
"%"
|
|
2694
3082
|
] }),
|
|
2695
|
-
/* @__PURE__ */
|
|
3083
|
+
/* @__PURE__ */ jsx25(
|
|
2696
3084
|
Button2,
|
|
2697
3085
|
{
|
|
2698
3086
|
type: "button",
|
|
@@ -2701,7 +3089,7 @@ var ImageUploadPreview = ({
|
|
|
2701
3089
|
e.stopPropagation();
|
|
2702
3090
|
onRemove();
|
|
2703
3091
|
},
|
|
2704
|
-
children: /* @__PURE__ */
|
|
3092
|
+
children: /* @__PURE__ */ jsx25(CloseIcon, { className: "tiptap-button-icon" })
|
|
2705
3093
|
}
|
|
2706
3094
|
)
|
|
2707
3095
|
] })
|
|
@@ -2713,13 +3101,13 @@ var DropZoneContent = ({
|
|
|
2713
3101
|
limit
|
|
2714
3102
|
}) => /* @__PURE__ */ jsxs11(Fragment3, { children: [
|
|
2715
3103
|
/* @__PURE__ */ jsxs11("div", { className: "tiptap-image-upload-dropzone", children: [
|
|
2716
|
-
/* @__PURE__ */
|
|
2717
|
-
/* @__PURE__ */
|
|
2718
|
-
/* @__PURE__ */
|
|
3104
|
+
/* @__PURE__ */ jsx25(FileIcon, {}),
|
|
3105
|
+
/* @__PURE__ */ jsx25(FileCornerIcon, {}),
|
|
3106
|
+
/* @__PURE__ */ jsx25("div", { className: "tiptap-image-upload-icon-container", children: /* @__PURE__ */ jsx25(CloudUploadIcon, {}) })
|
|
2719
3107
|
] }),
|
|
2720
3108
|
/* @__PURE__ */ jsxs11("div", { className: "tiptap-image-upload-content", children: [
|
|
2721
3109
|
/* @__PURE__ */ jsxs11("span", { className: "tiptap-image-upload-text", children: [
|
|
2722
|
-
/* @__PURE__ */
|
|
3110
|
+
/* @__PURE__ */ jsx25("em", { children: "Click to upload" }),
|
|
2723
3111
|
" or drag and drop"
|
|
2724
3112
|
] }),
|
|
2725
3113
|
/* @__PURE__ */ jsxs11("span", { className: "tiptap-image-upload-subtext", children: [
|
|
@@ -2790,7 +3178,7 @@ var ImageUploadNode = (props) => {
|
|
|
2790
3178
|
tabIndex: 0,
|
|
2791
3179
|
onClick: handleClick,
|
|
2792
3180
|
children: [
|
|
2793
|
-
!hasFiles && /* @__PURE__ */
|
|
3181
|
+
!hasFiles && /* @__PURE__ */ jsx25(ImageUploadDragArea, { onFile: handleUpload, children: /* @__PURE__ */ jsx25(DropZoneContent, { maxSize, limit }) }),
|
|
2794
3182
|
hasFiles && /* @__PURE__ */ jsxs11("div", { className: "tiptap-image-upload-previews", children: [
|
|
2795
3183
|
fileItems.length > 1 && /* @__PURE__ */ jsxs11("div", { className: "tiptap-image-upload-header", children: [
|
|
2796
3184
|
/* @__PURE__ */ jsxs11("span", { children: [
|
|
@@ -2798,7 +3186,7 @@ var ImageUploadNode = (props) => {
|
|
|
2798
3186
|
fileItems.length,
|
|
2799
3187
|
" files"
|
|
2800
3188
|
] }),
|
|
2801
|
-
/* @__PURE__ */
|
|
3189
|
+
/* @__PURE__ */ jsx25(
|
|
2802
3190
|
Button2,
|
|
2803
3191
|
{
|
|
2804
3192
|
type: "button",
|
|
@@ -2811,7 +3199,7 @@ var ImageUploadNode = (props) => {
|
|
|
2811
3199
|
}
|
|
2812
3200
|
)
|
|
2813
3201
|
] }),
|
|
2814
|
-
fileItems.map((fileItem) => /* @__PURE__ */
|
|
3202
|
+
fileItems.map((fileItem) => /* @__PURE__ */ jsx25(
|
|
2815
3203
|
ImageUploadPreview,
|
|
2816
3204
|
{
|
|
2817
3205
|
fileItem,
|
|
@@ -2820,7 +3208,7 @@ var ImageUploadNode = (props) => {
|
|
|
2820
3208
|
fileItem.id
|
|
2821
3209
|
))
|
|
2822
3210
|
] }),
|
|
2823
|
-
/* @__PURE__ */
|
|
3211
|
+
/* @__PURE__ */ jsx25(
|
|
2824
3212
|
"input",
|
|
2825
3213
|
{
|
|
2826
3214
|
ref: inputRef,
|
|
@@ -2838,7 +3226,7 @@ var ImageUploadNode = (props) => {
|
|
|
2838
3226
|
};
|
|
2839
3227
|
|
|
2840
3228
|
// src/components/tiptap-node/image-upload-node/image-upload-node-extension.ts
|
|
2841
|
-
var ImageUploadNode2 =
|
|
3229
|
+
var ImageUploadNode2 = Node6.create({
|
|
2842
3230
|
name: "imageUpload",
|
|
2843
3231
|
group: "block",
|
|
2844
3232
|
draggable: true,
|
|
@@ -2875,7 +3263,7 @@ var ImageUploadNode2 = Node4.create({
|
|
|
2875
3263
|
renderHTML({ HTMLAttributes }) {
|
|
2876
3264
|
return [
|
|
2877
3265
|
"div",
|
|
2878
|
-
|
|
3266
|
+
mergeAttributes4({ "data-type": "image-upload" }, HTMLAttributes)
|
|
2879
3267
|
];
|
|
2880
3268
|
},
|
|
2881
3269
|
addNodeView() {
|
|
@@ -2916,13 +3304,13 @@ var ImageUploadNode2 = Node4.create({
|
|
|
2916
3304
|
});
|
|
2917
3305
|
|
|
2918
3306
|
// src/components/tiptap-node/horizontal-rule-node/horizontal-rule-node-extension.ts
|
|
2919
|
-
import { mergeAttributes as
|
|
3307
|
+
import { mergeAttributes as mergeAttributes5 } from "@tiptap/react";
|
|
2920
3308
|
import TiptapHorizontalRule from "@tiptap/extension-horizontal-rule";
|
|
2921
3309
|
var HorizontalRule = TiptapHorizontalRule.extend({
|
|
2922
3310
|
renderHTML() {
|
|
2923
3311
|
return [
|
|
2924
3312
|
"div",
|
|
2925
|
-
|
|
3313
|
+
mergeAttributes5(this.options.HTMLAttributes, { "data-type": this.name }),
|
|
2926
3314
|
["hr"]
|
|
2927
3315
|
];
|
|
2928
3316
|
}
|
|
@@ -2933,9 +3321,9 @@ import { forwardRef as forwardRef9, useCallback as useCallback10, useState as us
|
|
|
2933
3321
|
|
|
2934
3322
|
// src/components/tiptap-icons/chevron-down-icon.tsx
|
|
2935
3323
|
import { memo as memo7 } from "react";
|
|
2936
|
-
import { jsx as
|
|
3324
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
2937
3325
|
var ChevronDownIcon = memo7(({ className, ...props }) => {
|
|
2938
|
-
return /* @__PURE__ */
|
|
3326
|
+
return /* @__PURE__ */ jsx26(
|
|
2939
3327
|
"svg",
|
|
2940
3328
|
{
|
|
2941
3329
|
width: "24",
|
|
@@ -2945,7 +3333,7 @@ var ChevronDownIcon = memo7(({ className, ...props }) => {
|
|
|
2945
3333
|
fill: "currentColor",
|
|
2946
3334
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2947
3335
|
...props,
|
|
2948
|
-
children: /* @__PURE__ */
|
|
3336
|
+
children: /* @__PURE__ */ jsx26(
|
|
2949
3337
|
"path",
|
|
2950
3338
|
{
|
|
2951
3339
|
fillRule: "evenodd",
|
|
@@ -2993,7 +3381,7 @@ import { forwardRef as forwardRef6, useCallback as useCallback8 } from "react";
|
|
|
2993
3381
|
|
|
2994
3382
|
// src/components/tiptap-ui-primitive/badge/badge.tsx
|
|
2995
3383
|
import { forwardRef as forwardRef5 } from "react";
|
|
2996
|
-
import { jsx as
|
|
3384
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
2997
3385
|
var Badge = forwardRef5(
|
|
2998
3386
|
({
|
|
2999
3387
|
variant,
|
|
@@ -3004,7 +3392,7 @@ var Badge = forwardRef5(
|
|
|
3004
3392
|
children,
|
|
3005
3393
|
...props
|
|
3006
3394
|
}, ref) => {
|
|
3007
|
-
return /* @__PURE__ */
|
|
3395
|
+
return /* @__PURE__ */ jsx27(
|
|
3008
3396
|
"div",
|
|
3009
3397
|
{
|
|
3010
3398
|
ref,
|
|
@@ -3022,12 +3410,12 @@ var Badge = forwardRef5(
|
|
|
3022
3410
|
Badge.displayName = "Badge";
|
|
3023
3411
|
|
|
3024
3412
|
// src/components/tiptap-ui/heading-button/heading-button.tsx
|
|
3025
|
-
import { Fragment as Fragment4, jsx as
|
|
3413
|
+
import { Fragment as Fragment4, jsx as jsx28, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
3026
3414
|
function HeadingShortcutBadge({
|
|
3027
3415
|
level,
|
|
3028
3416
|
shortcutKeys = HEADING_SHORTCUT_KEYS[level]
|
|
3029
3417
|
}) {
|
|
3030
|
-
return /* @__PURE__ */
|
|
3418
|
+
return /* @__PURE__ */ jsx28(Badge, { children: parseShortcutKeys({ shortcutKeys }) });
|
|
3031
3419
|
}
|
|
3032
3420
|
var HeadingButton = forwardRef6(
|
|
3033
3421
|
({
|
|
@@ -3067,7 +3455,7 @@ var HeadingButton = forwardRef6(
|
|
|
3067
3455
|
if (!isVisible) {
|
|
3068
3456
|
return null;
|
|
3069
3457
|
}
|
|
3070
|
-
return /* @__PURE__ */
|
|
3458
|
+
return /* @__PURE__ */ jsx28(
|
|
3071
3459
|
Button2,
|
|
3072
3460
|
{
|
|
3073
3461
|
type: "button",
|
|
@@ -3084,9 +3472,9 @@ var HeadingButton = forwardRef6(
|
|
|
3084
3472
|
...buttonProps,
|
|
3085
3473
|
ref,
|
|
3086
3474
|
children: children ?? /* @__PURE__ */ jsxs12(Fragment4, { children: [
|
|
3087
|
-
/* @__PURE__ */
|
|
3088
|
-
text && /* @__PURE__ */
|
|
3089
|
-
showShortcut && /* @__PURE__ */
|
|
3475
|
+
/* @__PURE__ */ jsx28(Icon, { className: "tiptap-button-icon" }),
|
|
3476
|
+
text && /* @__PURE__ */ jsx28("span", { className: "tiptap-button-text", children: text }),
|
|
3477
|
+
showShortcut && /* @__PURE__ */ jsx28(HeadingShortcutBadge, { level, shortcutKeys })
|
|
3090
3478
|
] })
|
|
3091
3479
|
}
|
|
3092
3480
|
);
|
|
@@ -3096,11 +3484,11 @@ HeadingButton.displayName = "HeadingButton";
|
|
|
3096
3484
|
|
|
3097
3485
|
// src/components/tiptap-ui/heading-button/use-heading.ts
|
|
3098
3486
|
import { useCallback as useCallback9, useEffect as useEffect5, useState as useState12 } from "react";
|
|
3099
|
-
import { NodeSelection as NodeSelection2, TextSelection as
|
|
3487
|
+
import { NodeSelection as NodeSelection2, TextSelection as TextSelection3 } from "@tiptap/pm/state";
|
|
3100
3488
|
|
|
3101
3489
|
// src/components/tiptap-icons/heading-one-icon.tsx
|
|
3102
3490
|
import { memo as memo8 } from "react";
|
|
3103
|
-
import { jsx as
|
|
3491
|
+
import { jsx as jsx29, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
3104
3492
|
var HeadingOneIcon = memo8(({ className, ...props }) => {
|
|
3105
3493
|
return /* @__PURE__ */ jsxs13(
|
|
3106
3494
|
"svg",
|
|
@@ -3113,14 +3501,14 @@ var HeadingOneIcon = memo8(({ className, ...props }) => {
|
|
|
3113
3501
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3114
3502
|
...props,
|
|
3115
3503
|
children: [
|
|
3116
|
-
/* @__PURE__ */
|
|
3504
|
+
/* @__PURE__ */ jsx29(
|
|
3117
3505
|
"path",
|
|
3118
3506
|
{
|
|
3119
3507
|
d: "M5 6C5 5.44772 4.55228 5 4 5C3.44772 5 3 5.44772 3 6V18C3 18.5523 3.44772 19 4 19C4.55228 19 5 18.5523 5 18V13H11V18C11 18.5523 11.4477 19 12 19C12.5523 19 13 18.5523 13 18V6C13 5.44772 12.5523 5 12 5C11.4477 5 11 5.44772 11 6V11H5V6Z",
|
|
3120
3508
|
fill: "currentColor"
|
|
3121
3509
|
}
|
|
3122
3510
|
),
|
|
3123
|
-
/* @__PURE__ */
|
|
3511
|
+
/* @__PURE__ */ jsx29(
|
|
3124
3512
|
"path",
|
|
3125
3513
|
{
|
|
3126
3514
|
d: "M21.0001 10C21.0001 9.63121 20.7971 9.29235 20.472 9.11833C20.1468 8.94431 19.7523 8.96338 19.4454 9.16795L16.4454 11.168C15.9859 11.4743 15.8617 12.0952 16.1681 12.5547C16.4744 13.0142 17.0953 13.1384 17.5548 12.8321L19.0001 11.8685V18C19.0001 18.5523 19.4478 19 20.0001 19C20.5524 19 21.0001 18.5523 21.0001 18V10Z",
|
|
@@ -3135,7 +3523,7 @@ HeadingOneIcon.displayName = "HeadingOneIcon";
|
|
|
3135
3523
|
|
|
3136
3524
|
// src/components/tiptap-icons/heading-two-icon.tsx
|
|
3137
3525
|
import { memo as memo9 } from "react";
|
|
3138
|
-
import { jsx as
|
|
3526
|
+
import { jsx as jsx30, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
3139
3527
|
var HeadingTwoIcon = memo9(({ className, ...props }) => {
|
|
3140
3528
|
return /* @__PURE__ */ jsxs14(
|
|
3141
3529
|
"svg",
|
|
@@ -3148,14 +3536,14 @@ var HeadingTwoIcon = memo9(({ className, ...props }) => {
|
|
|
3148
3536
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3149
3537
|
...props,
|
|
3150
3538
|
children: [
|
|
3151
|
-
/* @__PURE__ */
|
|
3539
|
+
/* @__PURE__ */ jsx30(
|
|
3152
3540
|
"path",
|
|
3153
3541
|
{
|
|
3154
3542
|
d: "M5 6C5 5.44772 4.55228 5 4 5C3.44772 5 3 5.44772 3 6V18C3 18.5523 3.44772 19 4 19C4.55228 19 5 18.5523 5 18V13H11V18C11 18.5523 11.4477 19 12 19C12.5523 19 13 18.5523 13 18V6C13 5.44772 12.5523 5 12 5C11.4477 5 11 5.44772 11 6V11H5V6Z",
|
|
3155
3543
|
fill: "currentColor"
|
|
3156
3544
|
}
|
|
3157
3545
|
),
|
|
3158
|
-
/* @__PURE__ */
|
|
3546
|
+
/* @__PURE__ */ jsx30(
|
|
3159
3547
|
"path",
|
|
3160
3548
|
{
|
|
3161
3549
|
d: "M22.0001 12C22.0001 10.7611 21.1663 9.79297 20.0663 9.42632C18.9547 9.05578 17.6171 9.28724 16.4001 10.2C15.9582 10.5314 15.8687 11.1582 16.2001 11.6C16.5314 12.0418 17.1582 12.1314 17.6001 11.8C18.383 11.2128 19.0455 11.1942 19.4338 11.3237C19.8339 11.457 20.0001 11.7389 20.0001 12C20.0001 12.4839 19.8554 12.7379 19.6537 12.9481C19.4275 13.1837 19.1378 13.363 18.7055 13.6307C18.6313 13.6767 18.553 13.7252 18.4701 13.777C17.9572 14.0975 17.3128 14.5261 16.8163 15.2087C16.3007 15.9177 16.0001 16.8183 16.0001 18C16.0001 18.5523 16.4478 19 17.0001 19H21.0001C21.5523 19 22.0001 18.5523 22.0001 18C22.0001 17.4477 21.5523 17 21.0001 17H18.131C18.21 16.742 18.3176 16.5448 18.4338 16.385C18.6873 16.0364 19.0429 15.7775 19.5301 15.473C19.5898 15.4357 19.6536 15.3966 19.7205 15.3556C20.139 15.0992 20.6783 14.7687 21.0964 14.3332C21.6447 13.7621 22.0001 13.0161 22.0001 12Z",
|
|
@@ -3170,7 +3558,7 @@ HeadingTwoIcon.displayName = "HeadingTwoIcon";
|
|
|
3170
3558
|
|
|
3171
3559
|
// src/components/tiptap-icons/heading-three-icon.tsx
|
|
3172
3560
|
import { memo as memo10 } from "react";
|
|
3173
|
-
import { jsx as
|
|
3561
|
+
import { jsx as jsx31, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
3174
3562
|
var HeadingThreeIcon = memo10(({ className, ...props }) => {
|
|
3175
3563
|
return /* @__PURE__ */ jsxs15(
|
|
3176
3564
|
"svg",
|
|
@@ -3183,14 +3571,14 @@ var HeadingThreeIcon = memo10(({ className, ...props }) => {
|
|
|
3183
3571
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3184
3572
|
...props,
|
|
3185
3573
|
children: [
|
|
3186
|
-
/* @__PURE__ */
|
|
3574
|
+
/* @__PURE__ */ jsx31(
|
|
3187
3575
|
"path",
|
|
3188
3576
|
{
|
|
3189
3577
|
d: "M4 5C4.55228 5 5 5.44772 5 6V11H11V6C11 5.44772 11.4477 5 12 5C12.5523 5 13 5.44772 13 6V18C13 18.5523 12.5523 19 12 19C11.4477 19 11 18.5523 11 18V13H5V18C5 18.5523 4.55228 19 4 19C3.44772 19 3 18.5523 3 18V6C3 5.44772 3.44772 5 4 5Z",
|
|
3190
3578
|
fill: "currentColor"
|
|
3191
3579
|
}
|
|
3192
3580
|
),
|
|
3193
|
-
/* @__PURE__ */
|
|
3581
|
+
/* @__PURE__ */ jsx31(
|
|
3194
3582
|
"path",
|
|
3195
3583
|
{
|
|
3196
3584
|
fillRule: "evenodd",
|
|
@@ -3199,7 +3587,7 @@ var HeadingThreeIcon = memo10(({ className, ...props }) => {
|
|
|
3199
3587
|
fill: "currentColor"
|
|
3200
3588
|
}
|
|
3201
3589
|
),
|
|
3202
|
-
/* @__PURE__ */
|
|
3590
|
+
/* @__PURE__ */ jsx31(
|
|
3203
3591
|
"path",
|
|
3204
3592
|
{
|
|
3205
3593
|
fillRule: "evenodd",
|
|
@@ -3216,7 +3604,7 @@ HeadingThreeIcon.displayName = "HeadingThreeIcon";
|
|
|
3216
3604
|
|
|
3217
3605
|
// src/components/tiptap-icons/heading-four-icon.tsx
|
|
3218
3606
|
import { memo as memo11 } from "react";
|
|
3219
|
-
import { jsx as
|
|
3607
|
+
import { jsx as jsx32, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
3220
3608
|
var HeadingFourIcon = memo11(({ className, ...props }) => {
|
|
3221
3609
|
return /* @__PURE__ */ jsxs16(
|
|
3222
3610
|
"svg",
|
|
@@ -3229,14 +3617,14 @@ var HeadingFourIcon = memo11(({ className, ...props }) => {
|
|
|
3229
3617
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3230
3618
|
...props,
|
|
3231
3619
|
children: [
|
|
3232
|
-
/* @__PURE__ */
|
|
3620
|
+
/* @__PURE__ */ jsx32(
|
|
3233
3621
|
"path",
|
|
3234
3622
|
{
|
|
3235
3623
|
d: "M4 5C4.55228 5 5 5.44772 5 6V11H11V6C11 5.44772 11.4477 5 12 5C12.5523 5 13 5.44772 13 6V18C13 18.5523 12.5523 19 12 19C11.4477 19 11 18.5523 11 18V13H5V18C5 18.5523 4.55228 19 4 19C3.44772 19 3 18.5523 3 18V6C3 5.44772 3.44772 5 4 5Z",
|
|
3236
3624
|
fill: "currentColor"
|
|
3237
3625
|
}
|
|
3238
3626
|
),
|
|
3239
|
-
/* @__PURE__ */
|
|
3627
|
+
/* @__PURE__ */ jsx32(
|
|
3240
3628
|
"path",
|
|
3241
3629
|
{
|
|
3242
3630
|
d: "M17 9C17.5523 9 18 9.44772 18 10V13H20V10C20 9.44772 20.4477 9 21 9C21.5523 9 22 9.44772 22 10V18C22 18.5523 21.5523 19 21 19C20.4477 19 20 18.5523 20 18V15H17C16.4477 15 16 14.5523 16 14V10C16 9.44772 16.4477 9 17 9Z",
|
|
@@ -3251,7 +3639,7 @@ HeadingFourIcon.displayName = "HeadingFourIcon";
|
|
|
3251
3639
|
|
|
3252
3640
|
// src/components/tiptap-icons/heading-five-icon.tsx
|
|
3253
3641
|
import { memo as memo12 } from "react";
|
|
3254
|
-
import { jsx as
|
|
3642
|
+
import { jsx as jsx33, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
3255
3643
|
var HeadingFiveIcon = memo12(({ className, ...props }) => {
|
|
3256
3644
|
return /* @__PURE__ */ jsxs17(
|
|
3257
3645
|
"svg",
|
|
@@ -3264,14 +3652,14 @@ var HeadingFiveIcon = memo12(({ className, ...props }) => {
|
|
|
3264
3652
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3265
3653
|
...props,
|
|
3266
3654
|
children: [
|
|
3267
|
-
/* @__PURE__ */
|
|
3655
|
+
/* @__PURE__ */ jsx33(
|
|
3268
3656
|
"path",
|
|
3269
3657
|
{
|
|
3270
3658
|
d: "M5 6C5 5.44772 4.55228 5 4 5C3.44772 5 3 5.44772 3 6V18C3 18.5523 3.44772 19 4 19C4.55228 19 5 18.5523 5 18V13H11V18C11 18.5523 11.4477 19 12 19C12.5523 19 13 18.5523 13 18V6C13 5.44772 12.5523 5 12 5C11.4477 5 11 5.44772 11 6V11H5V6Z",
|
|
3271
3659
|
fill: "currentColor"
|
|
3272
3660
|
}
|
|
3273
3661
|
),
|
|
3274
|
-
/* @__PURE__ */
|
|
3662
|
+
/* @__PURE__ */ jsx33(
|
|
3275
3663
|
"path",
|
|
3276
3664
|
{
|
|
3277
3665
|
d: "M16 10C16 9.44772 16.4477 9 17 9H21C21.5523 9 22 9.44772 22 10C22 10.5523 21.5523 11 21 11H18V12H18.3C20.2754 12 22 13.4739 22 15.5C22 17.5261 20.2754 19 18.3 19C17.6457 19 17.0925 18.8643 16.5528 18.5944C16.0588 18.3474 15.8586 17.7468 16.1055 17.2528C16.3525 16.7588 16.9532 16.5586 17.4472 16.8056C17.7074 16.9357 17.9542 17 18.3 17C19.3246 17 20 16.2739 20 15.5C20 14.7261 19.3246 14 18.3 14H17C16.4477 14 16 13.5523 16 13L16 12.9928V10Z",
|
|
@@ -3286,7 +3674,7 @@ HeadingFiveIcon.displayName = "HeadingFiveIcon";
|
|
|
3286
3674
|
|
|
3287
3675
|
// src/components/tiptap-icons/heading-six-icon.tsx
|
|
3288
3676
|
import { memo as memo13 } from "react";
|
|
3289
|
-
import { jsx as
|
|
3677
|
+
import { jsx as jsx34, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
3290
3678
|
var HeadingSixIcon = memo13(({ className, ...props }) => {
|
|
3291
3679
|
return /* @__PURE__ */ jsxs18(
|
|
3292
3680
|
"svg",
|
|
@@ -3299,14 +3687,14 @@ var HeadingSixIcon = memo13(({ className, ...props }) => {
|
|
|
3299
3687
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3300
3688
|
...props,
|
|
3301
3689
|
children: [
|
|
3302
|
-
/* @__PURE__ */
|
|
3690
|
+
/* @__PURE__ */ jsx34(
|
|
3303
3691
|
"path",
|
|
3304
3692
|
{
|
|
3305
3693
|
d: "M5 6C5 5.44772 4.55228 5 4 5C3.44772 5 3 5.44772 3 6V18C3 18.5523 3.44772 19 4 19C4.55228 19 5 18.5523 5 18V13H11V18C11 18.5523 11.4477 19 12 19C12.5523 19 13 18.5523 13 18V6C13 5.44772 12.5523 5 12 5C11.4477 5 11 5.44772 11 6V11H5V6Z",
|
|
3306
3694
|
fill: "currentColor"
|
|
3307
3695
|
}
|
|
3308
3696
|
),
|
|
3309
|
-
/* @__PURE__ */
|
|
3697
|
+
/* @__PURE__ */ jsx34(
|
|
3310
3698
|
"path",
|
|
3311
3699
|
{
|
|
3312
3700
|
fillRule: "evenodd",
|
|
@@ -3373,7 +3761,7 @@ function toggleHeading(editor, level) {
|
|
|
3373
3761
|
const view = editor.view;
|
|
3374
3762
|
let state = view.state;
|
|
3375
3763
|
let tr = state.tr;
|
|
3376
|
-
if (state.selection.empty || state.selection instanceof
|
|
3764
|
+
if (state.selection.empty || state.selection instanceof TextSelection3) {
|
|
3377
3765
|
const pos = findNodePosition({
|
|
3378
3766
|
editor,
|
|
3379
3767
|
node: state.selection.$anchor.node(1)
|
|
@@ -3392,7 +3780,7 @@ function toggleHeading(editor, level) {
|
|
|
3392
3780
|
const to = lastChild ? selection.to - lastChild.nodeSize : selection.to - 1;
|
|
3393
3781
|
const resolvedFrom = state.doc.resolve(from);
|
|
3394
3782
|
const resolvedTo = state.doc.resolve(to);
|
|
3395
|
-
chain = chain.setTextSelection(
|
|
3783
|
+
chain = chain.setTextSelection(TextSelection3.between(resolvedFrom, resolvedTo)).clearNodes();
|
|
3396
3784
|
}
|
|
3397
3785
|
const isActive = levels.some(
|
|
3398
3786
|
(l) => editor.isActive("heading", { level: l })
|
|
@@ -3461,22 +3849,22 @@ function useHeading(config) {
|
|
|
3461
3849
|
// src/components/tiptap-ui-primitive/dropdown-menu/dropdown-menu.tsx
|
|
3462
3850
|
import { forwardRef as forwardRef7 } from "react";
|
|
3463
3851
|
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
3464
|
-
import { jsx as
|
|
3852
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
3465
3853
|
function DropdownMenu({
|
|
3466
3854
|
...props
|
|
3467
3855
|
}) {
|
|
3468
|
-
return /* @__PURE__ */
|
|
3856
|
+
return /* @__PURE__ */ jsx35(DropdownMenuPrimitive.Root, { modal: false, ...props });
|
|
3469
3857
|
}
|
|
3470
3858
|
function DropdownMenuPortal({
|
|
3471
3859
|
...props
|
|
3472
3860
|
}) {
|
|
3473
|
-
return /* @__PURE__ */
|
|
3861
|
+
return /* @__PURE__ */ jsx35(DropdownMenuPrimitive.Portal, { ...props });
|
|
3474
3862
|
}
|
|
3475
|
-
var DropdownMenuTrigger = forwardRef7(({ ...props }, ref) => /* @__PURE__ */
|
|
3863
|
+
var DropdownMenuTrigger = forwardRef7(({ ...props }, ref) => /* @__PURE__ */ jsx35(DropdownMenuPrimitive.Trigger, { ref, ...props }));
|
|
3476
3864
|
DropdownMenuTrigger.displayName = DropdownMenuPrimitive.Trigger.displayName;
|
|
3477
3865
|
var DropdownMenuItem = DropdownMenuPrimitive.Item;
|
|
3478
3866
|
var DropdownMenuSubContent = forwardRef7(({ className, portal = true, ...props }, ref) => {
|
|
3479
|
-
const content = /* @__PURE__ */
|
|
3867
|
+
const content = /* @__PURE__ */ jsx35(
|
|
3480
3868
|
DropdownMenuPrimitive.SubContent,
|
|
3481
3869
|
{
|
|
3482
3870
|
ref,
|
|
@@ -3484,11 +3872,11 @@ var DropdownMenuSubContent = forwardRef7(({ className, portal = true, ...props }
|
|
|
3484
3872
|
...props
|
|
3485
3873
|
}
|
|
3486
3874
|
);
|
|
3487
|
-
return portal ? /* @__PURE__ */
|
|
3875
|
+
return portal ? /* @__PURE__ */ jsx35(DropdownMenuPortal, { ...typeof portal === "object" ? portal : {}, children: content }) : content;
|
|
3488
3876
|
});
|
|
3489
3877
|
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
3490
3878
|
var DropdownMenuContent = forwardRef7(({ className, sideOffset = 4, portal = false, ...props }, ref) => {
|
|
3491
|
-
const content = /* @__PURE__ */
|
|
3879
|
+
const content = /* @__PURE__ */ jsx35(
|
|
3492
3880
|
DropdownMenuPrimitive.Content,
|
|
3493
3881
|
{
|
|
3494
3882
|
ref,
|
|
@@ -3498,22 +3886,22 @@ var DropdownMenuContent = forwardRef7(({ className, sideOffset = 4, portal = fal
|
|
|
3498
3886
|
...props
|
|
3499
3887
|
}
|
|
3500
3888
|
);
|
|
3501
|
-
return portal ? /* @__PURE__ */
|
|
3889
|
+
return portal ? /* @__PURE__ */ jsx35(DropdownMenuPortal, { ...typeof portal === "object" ? portal : {}, children: content }) : content;
|
|
3502
3890
|
});
|
|
3503
3891
|
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
3504
3892
|
|
|
3505
3893
|
// src/components/tiptap-ui-primitive/card/card.tsx
|
|
3506
3894
|
import { forwardRef as forwardRef8 } from "react";
|
|
3507
|
-
import { jsx as
|
|
3895
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
3508
3896
|
var Card = forwardRef8(
|
|
3509
3897
|
({ className, ...props }, ref) => {
|
|
3510
|
-
return /* @__PURE__ */
|
|
3898
|
+
return /* @__PURE__ */ jsx36("div", { ref, className: cn2("tiptap-card", className), ...props });
|
|
3511
3899
|
}
|
|
3512
3900
|
);
|
|
3513
3901
|
Card.displayName = "Card";
|
|
3514
3902
|
var CardHeader = forwardRef8(
|
|
3515
3903
|
({ className, ...props }, ref) => {
|
|
3516
|
-
return /* @__PURE__ */
|
|
3904
|
+
return /* @__PURE__ */ jsx36(
|
|
3517
3905
|
"div",
|
|
3518
3906
|
{
|
|
3519
3907
|
ref,
|
|
@@ -3526,12 +3914,12 @@ var CardHeader = forwardRef8(
|
|
|
3526
3914
|
CardHeader.displayName = "CardHeader";
|
|
3527
3915
|
var CardBody = forwardRef8(
|
|
3528
3916
|
({ className, ...props }, ref) => {
|
|
3529
|
-
return /* @__PURE__ */
|
|
3917
|
+
return /* @__PURE__ */ jsx36("div", { ref, className: cn2("tiptap-card-body", className), ...props });
|
|
3530
3918
|
}
|
|
3531
3919
|
);
|
|
3532
3920
|
CardBody.displayName = "CardBody";
|
|
3533
3921
|
var CardItemGroup = forwardRef8(({ className, orientation = "vertical", ...props }, ref) => {
|
|
3534
|
-
return /* @__PURE__ */
|
|
3922
|
+
return /* @__PURE__ */ jsx36(
|
|
3535
3923
|
"div",
|
|
3536
3924
|
{
|
|
3537
3925
|
ref,
|
|
@@ -3544,7 +3932,7 @@ var CardItemGroup = forwardRef8(({ className, orientation = "vertical", ...props
|
|
|
3544
3932
|
CardItemGroup.displayName = "CardItemGroup";
|
|
3545
3933
|
var CardGroupLabel = forwardRef8(
|
|
3546
3934
|
({ className, ...props }, ref) => {
|
|
3547
|
-
return /* @__PURE__ */
|
|
3935
|
+
return /* @__PURE__ */ jsx36(
|
|
3548
3936
|
"div",
|
|
3549
3937
|
{
|
|
3550
3938
|
ref,
|
|
@@ -3557,7 +3945,7 @@ var CardGroupLabel = forwardRef8(
|
|
|
3557
3945
|
CardGroupLabel.displayName = "CardGroupLabel";
|
|
3558
3946
|
var CardFooter = forwardRef8(
|
|
3559
3947
|
({ className, ...props }, ref) => {
|
|
3560
|
-
return /* @__PURE__ */
|
|
3948
|
+
return /* @__PURE__ */ jsx36(
|
|
3561
3949
|
"div",
|
|
3562
3950
|
{
|
|
3563
3951
|
ref,
|
|
@@ -3570,7 +3958,7 @@ var CardFooter = forwardRef8(
|
|
|
3570
3958
|
CardFooter.displayName = "CardFooter";
|
|
3571
3959
|
|
|
3572
3960
|
// src/components/tiptap-ui/heading-dropdown-menu/heading-dropdown-menu.tsx
|
|
3573
|
-
import { jsx as
|
|
3961
|
+
import { jsx as jsx37, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
3574
3962
|
var HeadingDropdownMenu = forwardRef9(
|
|
3575
3963
|
({
|
|
3576
3964
|
editor: providedEditor,
|
|
@@ -3599,7 +3987,7 @@ var HeadingDropdownMenu = forwardRef9(
|
|
|
3599
3987
|
return null;
|
|
3600
3988
|
}
|
|
3601
3989
|
return /* @__PURE__ */ jsxs19(DropdownMenu, { modal: true, open: isOpen, onOpenChange: handleOpenChange, children: [
|
|
3602
|
-
/* @__PURE__ */
|
|
3990
|
+
/* @__PURE__ */ jsx37(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs19(
|
|
3603
3991
|
Button2,
|
|
3604
3992
|
{
|
|
3605
3993
|
type: "button",
|
|
@@ -3615,12 +4003,12 @@ var HeadingDropdownMenu = forwardRef9(
|
|
|
3615
4003
|
...buttonProps,
|
|
3616
4004
|
ref,
|
|
3617
4005
|
children: [
|
|
3618
|
-
/* @__PURE__ */
|
|
3619
|
-
/* @__PURE__ */
|
|
4006
|
+
/* @__PURE__ */ jsx37(Icon, { className: "tiptap-button-icon" }),
|
|
4007
|
+
/* @__PURE__ */ jsx37(ChevronDownIcon, { className: "tiptap-button-dropdown-small" })
|
|
3620
4008
|
]
|
|
3621
4009
|
}
|
|
3622
4010
|
) }),
|
|
3623
|
-
/* @__PURE__ */
|
|
4011
|
+
/* @__PURE__ */ jsx37(DropdownMenuContent, { align: "start", portal, children: /* @__PURE__ */ jsx37(Card, { children: /* @__PURE__ */ jsx37(CardBody, { children: /* @__PURE__ */ jsx37(ButtonGroup, { children: levels.map((level) => /* @__PURE__ */ jsx37(DropdownMenuItem, { asChild: true, children: /* @__PURE__ */ jsx37(
|
|
3624
4012
|
HeadingButton,
|
|
3625
4013
|
{
|
|
3626
4014
|
editor,
|
|
@@ -3639,9 +4027,9 @@ import { useEffect as useEffect6, useState as useState14 } from "react";
|
|
|
3639
4027
|
|
|
3640
4028
|
// src/components/tiptap-icons/heading-icon.tsx
|
|
3641
4029
|
import { memo as memo14 } from "react";
|
|
3642
|
-
import { jsx as
|
|
4030
|
+
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
3643
4031
|
var HeadingIcon = memo14(({ className, ...props }) => {
|
|
3644
|
-
return /* @__PURE__ */
|
|
4032
|
+
return /* @__PURE__ */ jsx38(
|
|
3645
4033
|
"svg",
|
|
3646
4034
|
{
|
|
3647
4035
|
width: "24",
|
|
@@ -3651,7 +4039,7 @@ var HeadingIcon = memo14(({ className, ...props }) => {
|
|
|
3651
4039
|
fill: "currentColor",
|
|
3652
4040
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3653
4041
|
...props,
|
|
3654
|
-
children: /* @__PURE__ */
|
|
4042
|
+
children: /* @__PURE__ */ jsx38(
|
|
3655
4043
|
"path",
|
|
3656
4044
|
{
|
|
3657
4045
|
d: "M6 3C6.55228 3 7 3.44772 7 4V11H17V4C17 3.44772 17.4477 3 18 3C18.5523 3 19 3.44772 19 4V20C19 20.5523 18.5523 21 18 21C17.4477 21 17 20.5523 17 20V13H7V20C7 20.5523 6.55228 21 6 21C5.44772 21 5 20.5523 5 20V4C5 3.44772 5.44772 3 6 3Z",
|
|
@@ -3705,11 +4093,11 @@ function useHeadingDropdownMenu(config) {
|
|
|
3705
4093
|
|
|
3706
4094
|
// src/components/tiptap-ui/image-upload-button/image-upload-button.tsx
|
|
3707
4095
|
import { forwardRef as forwardRef10, useCallback as useCallback11 } from "react";
|
|
3708
|
-
import { Fragment as Fragment5, jsx as
|
|
4096
|
+
import { Fragment as Fragment5, jsx as jsx39, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
3709
4097
|
function ImageShortcutBadge({
|
|
3710
4098
|
shortcutKeys = IMAGE_UPLOAD_SHORTCUT_KEY
|
|
3711
4099
|
}) {
|
|
3712
|
-
return /* @__PURE__ */
|
|
4100
|
+
return /* @__PURE__ */ jsx39(Badge, { children: parseShortcutKeys({ shortcutKeys }) });
|
|
3713
4101
|
}
|
|
3714
4102
|
var ImageUploadButton = forwardRef10(
|
|
3715
4103
|
({
|
|
@@ -3749,7 +4137,7 @@ var ImageUploadButton = forwardRef10(
|
|
|
3749
4137
|
return null;
|
|
3750
4138
|
}
|
|
3751
4139
|
const RenderIcon = CustomIcon ?? Icon;
|
|
3752
|
-
return /* @__PURE__ */
|
|
4140
|
+
return /* @__PURE__ */ jsx39(
|
|
3753
4141
|
Button2,
|
|
3754
4142
|
{
|
|
3755
4143
|
type: "button",
|
|
@@ -3766,9 +4154,9 @@ var ImageUploadButton = forwardRef10(
|
|
|
3766
4154
|
...buttonProps,
|
|
3767
4155
|
ref,
|
|
3768
4156
|
children: children ?? /* @__PURE__ */ jsxs20(Fragment5, { children: [
|
|
3769
|
-
/* @__PURE__ */
|
|
3770
|
-
text && /* @__PURE__ */
|
|
3771
|
-
showShortcut && /* @__PURE__ */
|
|
4157
|
+
/* @__PURE__ */ jsx39(RenderIcon, { className: "tiptap-button-icon" }),
|
|
4158
|
+
text && /* @__PURE__ */ jsx39("span", { className: "tiptap-button-text", children: text }),
|
|
4159
|
+
showShortcut && /* @__PURE__ */ jsx39(ImageShortcutBadge, { shortcutKeys })
|
|
3772
4160
|
] })
|
|
3773
4161
|
}
|
|
3774
4162
|
);
|
|
@@ -3797,9 +4185,9 @@ function useIsBreakpoint(mode = "max", breakpoint = 768) {
|
|
|
3797
4185
|
|
|
3798
4186
|
// src/components/tiptap-icons/image-plus-icon.tsx
|
|
3799
4187
|
import { memo as memo15 } from "react";
|
|
3800
|
-
import { jsx as
|
|
4188
|
+
import { jsx as jsx40 } from "react/jsx-runtime";
|
|
3801
4189
|
var ImagePlusIcon = memo15(({ className, ...props }) => {
|
|
3802
|
-
return /* @__PURE__ */
|
|
4190
|
+
return /* @__PURE__ */ jsx40(
|
|
3803
4191
|
"svg",
|
|
3804
4192
|
{
|
|
3805
4193
|
width: "24",
|
|
@@ -3809,7 +4197,7 @@ var ImagePlusIcon = memo15(({ className, ...props }) => {
|
|
|
3809
4197
|
fill: "currentColor",
|
|
3810
4198
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3811
4199
|
...props,
|
|
3812
|
-
children: /* @__PURE__ */
|
|
4200
|
+
children: /* @__PURE__ */ jsx40(
|
|
3813
4201
|
"path",
|
|
3814
4202
|
{
|
|
3815
4203
|
fillRule: "evenodd",
|
|
@@ -3933,12 +4321,12 @@ import { useCallback as useCallback15, useState as useState19 } from "react";
|
|
|
3933
4321
|
|
|
3934
4322
|
// src/components/tiptap-ui/list-button/list-button.tsx
|
|
3935
4323
|
import { forwardRef as forwardRef11, useCallback as useCallback13 } from "react";
|
|
3936
|
-
import { Fragment as Fragment6, jsx as
|
|
4324
|
+
import { Fragment as Fragment6, jsx as jsx41, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
3937
4325
|
function ListShortcutBadge({
|
|
3938
4326
|
type,
|
|
3939
4327
|
shortcutKeys = LIST_SHORTCUT_KEYS[type]
|
|
3940
4328
|
}) {
|
|
3941
|
-
return /* @__PURE__ */
|
|
4329
|
+
return /* @__PURE__ */ jsx41(Badge, { children: parseShortcutKeys({ shortcutKeys }) });
|
|
3942
4330
|
}
|
|
3943
4331
|
var ListButton = forwardRef11(
|
|
3944
4332
|
({
|
|
@@ -3978,7 +4366,7 @@ var ListButton = forwardRef11(
|
|
|
3978
4366
|
if (!isVisible) {
|
|
3979
4367
|
return null;
|
|
3980
4368
|
}
|
|
3981
|
-
return /* @__PURE__ */
|
|
4369
|
+
return /* @__PURE__ */ jsx41(
|
|
3982
4370
|
Button2,
|
|
3983
4371
|
{
|
|
3984
4372
|
type: "button",
|
|
@@ -3995,9 +4383,9 @@ var ListButton = forwardRef11(
|
|
|
3995
4383
|
...buttonProps,
|
|
3996
4384
|
ref,
|
|
3997
4385
|
children: children ?? /* @__PURE__ */ jsxs21(Fragment6, { children: [
|
|
3998
|
-
/* @__PURE__ */
|
|
3999
|
-
text && /* @__PURE__ */
|
|
4000
|
-
showShortcut && /* @__PURE__ */
|
|
4386
|
+
/* @__PURE__ */ jsx41(Icon, { className: "tiptap-button-icon" }),
|
|
4387
|
+
text && /* @__PURE__ */ jsx41("span", { className: "tiptap-button-text", children: text }),
|
|
4388
|
+
showShortcut && /* @__PURE__ */ jsx41(ListShortcutBadge, { type, shortcutKeys })
|
|
4001
4389
|
] })
|
|
4002
4390
|
}
|
|
4003
4391
|
);
|
|
@@ -4007,11 +4395,11 @@ ListButton.displayName = "ListButton";
|
|
|
4007
4395
|
|
|
4008
4396
|
// src/components/tiptap-ui/list-button/use-list.ts
|
|
4009
4397
|
import { useCallback as useCallback14, useEffect as useEffect9, useState as useState17 } from "react";
|
|
4010
|
-
import { NodeSelection as NodeSelection3, TextSelection as
|
|
4398
|
+
import { NodeSelection as NodeSelection3, TextSelection as TextSelection4 } from "@tiptap/pm/state";
|
|
4011
4399
|
|
|
4012
4400
|
// src/components/tiptap-icons/list-icon.tsx
|
|
4013
4401
|
import { memo as memo16 } from "react";
|
|
4014
|
-
import { jsx as
|
|
4402
|
+
import { jsx as jsx42, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
4015
4403
|
var ListIcon = memo16(({ className, ...props }) => {
|
|
4016
4404
|
return /* @__PURE__ */ jsxs22(
|
|
4017
4405
|
"svg",
|
|
@@ -4024,7 +4412,7 @@ var ListIcon = memo16(({ className, ...props }) => {
|
|
|
4024
4412
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4025
4413
|
...props,
|
|
4026
4414
|
children: [
|
|
4027
|
-
/* @__PURE__ */
|
|
4415
|
+
/* @__PURE__ */ jsx42(
|
|
4028
4416
|
"path",
|
|
4029
4417
|
{
|
|
4030
4418
|
fillRule: "evenodd",
|
|
@@ -4033,7 +4421,7 @@ var ListIcon = memo16(({ className, ...props }) => {
|
|
|
4033
4421
|
fill: "currentColor"
|
|
4034
4422
|
}
|
|
4035
4423
|
),
|
|
4036
|
-
/* @__PURE__ */
|
|
4424
|
+
/* @__PURE__ */ jsx42(
|
|
4037
4425
|
"path",
|
|
4038
4426
|
{
|
|
4039
4427
|
fillRule: "evenodd",
|
|
@@ -4042,7 +4430,7 @@ var ListIcon = memo16(({ className, ...props }) => {
|
|
|
4042
4430
|
fill: "currentColor"
|
|
4043
4431
|
}
|
|
4044
4432
|
),
|
|
4045
|
-
/* @__PURE__ */
|
|
4433
|
+
/* @__PURE__ */ jsx42(
|
|
4046
4434
|
"path",
|
|
4047
4435
|
{
|
|
4048
4436
|
fillRule: "evenodd",
|
|
@@ -4051,7 +4439,7 @@ var ListIcon = memo16(({ className, ...props }) => {
|
|
|
4051
4439
|
fill: "currentColor"
|
|
4052
4440
|
}
|
|
4053
4441
|
),
|
|
4054
|
-
/* @__PURE__ */
|
|
4442
|
+
/* @__PURE__ */ jsx42(
|
|
4055
4443
|
"path",
|
|
4056
4444
|
{
|
|
4057
4445
|
fillRule: "evenodd",
|
|
@@ -4060,7 +4448,7 @@ var ListIcon = memo16(({ className, ...props }) => {
|
|
|
4060
4448
|
fill: "currentColor"
|
|
4061
4449
|
}
|
|
4062
4450
|
),
|
|
4063
|
-
/* @__PURE__ */
|
|
4451
|
+
/* @__PURE__ */ jsx42(
|
|
4064
4452
|
"path",
|
|
4065
4453
|
{
|
|
4066
4454
|
fillRule: "evenodd",
|
|
@@ -4069,7 +4457,7 @@ var ListIcon = memo16(({ className, ...props }) => {
|
|
|
4069
4457
|
fill: "currentColor"
|
|
4070
4458
|
}
|
|
4071
4459
|
),
|
|
4072
|
-
/* @__PURE__ */
|
|
4460
|
+
/* @__PURE__ */ jsx42(
|
|
4073
4461
|
"path",
|
|
4074
4462
|
{
|
|
4075
4463
|
fillRule: "evenodd",
|
|
@@ -4086,7 +4474,7 @@ ListIcon.displayName = "ListIcon";
|
|
|
4086
4474
|
|
|
4087
4475
|
// src/components/tiptap-icons/list-ordered-icon.tsx
|
|
4088
4476
|
import { memo as memo17 } from "react";
|
|
4089
|
-
import { jsx as
|
|
4477
|
+
import { jsx as jsx43, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
4090
4478
|
var ListOrderedIcon = memo17(({ className, ...props }) => {
|
|
4091
4479
|
return /* @__PURE__ */ jsxs23(
|
|
4092
4480
|
"svg",
|
|
@@ -4099,7 +4487,7 @@ var ListOrderedIcon = memo17(({ className, ...props }) => {
|
|
|
4099
4487
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4100
4488
|
...props,
|
|
4101
4489
|
children: [
|
|
4102
|
-
/* @__PURE__ */
|
|
4490
|
+
/* @__PURE__ */ jsx43(
|
|
4103
4491
|
"path",
|
|
4104
4492
|
{
|
|
4105
4493
|
fillRule: "evenodd",
|
|
@@ -4108,7 +4496,7 @@ var ListOrderedIcon = memo17(({ className, ...props }) => {
|
|
|
4108
4496
|
fill: "currentColor"
|
|
4109
4497
|
}
|
|
4110
4498
|
),
|
|
4111
|
-
/* @__PURE__ */
|
|
4499
|
+
/* @__PURE__ */ jsx43(
|
|
4112
4500
|
"path",
|
|
4113
4501
|
{
|
|
4114
4502
|
fillRule: "evenodd",
|
|
@@ -4117,7 +4505,7 @@ var ListOrderedIcon = memo17(({ className, ...props }) => {
|
|
|
4117
4505
|
fill: "currentColor"
|
|
4118
4506
|
}
|
|
4119
4507
|
),
|
|
4120
|
-
/* @__PURE__ */
|
|
4508
|
+
/* @__PURE__ */ jsx43(
|
|
4121
4509
|
"path",
|
|
4122
4510
|
{
|
|
4123
4511
|
fillRule: "evenodd",
|
|
@@ -4126,7 +4514,7 @@ var ListOrderedIcon = memo17(({ className, ...props }) => {
|
|
|
4126
4514
|
fill: "currentColor"
|
|
4127
4515
|
}
|
|
4128
4516
|
),
|
|
4129
|
-
/* @__PURE__ */
|
|
4517
|
+
/* @__PURE__ */ jsx43(
|
|
4130
4518
|
"path",
|
|
4131
4519
|
{
|
|
4132
4520
|
fillRule: "evenodd",
|
|
@@ -4135,7 +4523,7 @@ var ListOrderedIcon = memo17(({ className, ...props }) => {
|
|
|
4135
4523
|
fill: "currentColor"
|
|
4136
4524
|
}
|
|
4137
4525
|
),
|
|
4138
|
-
/* @__PURE__ */
|
|
4526
|
+
/* @__PURE__ */ jsx43(
|
|
4139
4527
|
"path",
|
|
4140
4528
|
{
|
|
4141
4529
|
fillRule: "evenodd",
|
|
@@ -4144,7 +4532,7 @@ var ListOrderedIcon = memo17(({ className, ...props }) => {
|
|
|
4144
4532
|
fill: "currentColor"
|
|
4145
4533
|
}
|
|
4146
4534
|
),
|
|
4147
|
-
/* @__PURE__ */
|
|
4535
|
+
/* @__PURE__ */ jsx43(
|
|
4148
4536
|
"path",
|
|
4149
4537
|
{
|
|
4150
4538
|
fillRule: "evenodd",
|
|
@@ -4161,7 +4549,7 @@ ListOrderedIcon.displayName = "ListOrderedIcon";
|
|
|
4161
4549
|
|
|
4162
4550
|
// src/components/tiptap-icons/list-todo-icon.tsx
|
|
4163
4551
|
import { memo as memo18 } from "react";
|
|
4164
|
-
import { jsx as
|
|
4552
|
+
import { jsx as jsx44, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
4165
4553
|
var ListTodoIcon = memo18(({ className, ...props }) => {
|
|
4166
4554
|
return /* @__PURE__ */ jsxs24(
|
|
4167
4555
|
"svg",
|
|
@@ -4174,7 +4562,7 @@ var ListTodoIcon = memo18(({ className, ...props }) => {
|
|
|
4174
4562
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4175
4563
|
...props,
|
|
4176
4564
|
children: [
|
|
4177
|
-
/* @__PURE__ */
|
|
4565
|
+
/* @__PURE__ */ jsx44(
|
|
4178
4566
|
"path",
|
|
4179
4567
|
{
|
|
4180
4568
|
fillRule: "evenodd",
|
|
@@ -4183,7 +4571,7 @@ var ListTodoIcon = memo18(({ className, ...props }) => {
|
|
|
4183
4571
|
fill: "currentColor"
|
|
4184
4572
|
}
|
|
4185
4573
|
),
|
|
4186
|
-
/* @__PURE__ */
|
|
4574
|
+
/* @__PURE__ */ jsx44(
|
|
4187
4575
|
"path",
|
|
4188
4576
|
{
|
|
4189
4577
|
fillRule: "evenodd",
|
|
@@ -4192,7 +4580,7 @@ var ListTodoIcon = memo18(({ className, ...props }) => {
|
|
|
4192
4580
|
fill: "currentColor"
|
|
4193
4581
|
}
|
|
4194
4582
|
),
|
|
4195
|
-
/* @__PURE__ */
|
|
4583
|
+
/* @__PURE__ */ jsx44(
|
|
4196
4584
|
"path",
|
|
4197
4585
|
{
|
|
4198
4586
|
fillRule: "evenodd",
|
|
@@ -4201,7 +4589,7 @@ var ListTodoIcon = memo18(({ className, ...props }) => {
|
|
|
4201
4589
|
fill: "currentColor"
|
|
4202
4590
|
}
|
|
4203
4591
|
),
|
|
4204
|
-
/* @__PURE__ */
|
|
4592
|
+
/* @__PURE__ */ jsx44(
|
|
4205
4593
|
"path",
|
|
4206
4594
|
{
|
|
4207
4595
|
fillRule: "evenodd",
|
|
@@ -4210,7 +4598,7 @@ var ListTodoIcon = memo18(({ className, ...props }) => {
|
|
|
4210
4598
|
fill: "currentColor"
|
|
4211
4599
|
}
|
|
4212
4600
|
),
|
|
4213
|
-
/* @__PURE__ */
|
|
4601
|
+
/* @__PURE__ */ jsx44(
|
|
4214
4602
|
"path",
|
|
4215
4603
|
{
|
|
4216
4604
|
fillRule: "evenodd",
|
|
@@ -4298,7 +4686,7 @@ function toggleList(editor, type) {
|
|
|
4298
4686
|
const view = editor.view;
|
|
4299
4687
|
let state = view.state;
|
|
4300
4688
|
let tr = state.tr;
|
|
4301
|
-
if (state.selection.empty || state.selection instanceof
|
|
4689
|
+
if (state.selection.empty || state.selection instanceof TextSelection4) {
|
|
4302
4690
|
const pos = findNodePosition({
|
|
4303
4691
|
editor,
|
|
4304
4692
|
node: state.selection.$anchor.node(1)
|
|
@@ -4317,7 +4705,7 @@ function toggleList(editor, type) {
|
|
|
4317
4705
|
const to = lastChild ? selection.to - lastChild.nodeSize : selection.to - 1;
|
|
4318
4706
|
const resolvedFrom = state.doc.resolve(from);
|
|
4319
4707
|
const resolvedTo = state.doc.resolve(to);
|
|
4320
|
-
chain = chain.setTextSelection(
|
|
4708
|
+
chain = chain.setTextSelection(TextSelection4.between(resolvedFrom, resolvedTo)).clearNodes();
|
|
4321
4709
|
}
|
|
4322
4710
|
if (editor.isActive(type)) {
|
|
4323
4711
|
chain.liftListItem("listItem").lift("bulletList").lift("orderedList").lift("taskList").run();
|
|
@@ -4479,7 +4867,7 @@ function useListDropdownMenu(config) {
|
|
|
4479
4867
|
}
|
|
4480
4868
|
|
|
4481
4869
|
// src/components/tiptap-ui/list-dropdown-menu/list-dropdown-menu.tsx
|
|
4482
|
-
import { jsx as
|
|
4870
|
+
import { jsx as jsx45, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
4483
4871
|
function ListDropdownMenu({
|
|
4484
4872
|
editor: providedEditor,
|
|
4485
4873
|
types = ["bulletList", "orderedList", "taskList"],
|
|
@@ -4506,7 +4894,7 @@ function ListDropdownMenu({
|
|
|
4506
4894
|
return null;
|
|
4507
4895
|
}
|
|
4508
4896
|
return /* @__PURE__ */ jsxs25(DropdownMenu, { open: isOpen, onOpenChange: handleOnOpenChange, children: [
|
|
4509
|
-
/* @__PURE__ */
|
|
4897
|
+
/* @__PURE__ */ jsx45(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs25(
|
|
4510
4898
|
Button2,
|
|
4511
4899
|
{
|
|
4512
4900
|
type: "button",
|
|
@@ -4520,12 +4908,12 @@ function ListDropdownMenu({
|
|
|
4520
4908
|
tooltip: "List",
|
|
4521
4909
|
...props,
|
|
4522
4910
|
children: [
|
|
4523
|
-
/* @__PURE__ */
|
|
4524
|
-
/* @__PURE__ */
|
|
4911
|
+
/* @__PURE__ */ jsx45(Icon, { className: "tiptap-button-icon" }),
|
|
4912
|
+
/* @__PURE__ */ jsx45(ChevronDownIcon, { className: "tiptap-button-dropdown-small" })
|
|
4525
4913
|
]
|
|
4526
4914
|
}
|
|
4527
4915
|
) }),
|
|
4528
|
-
/* @__PURE__ */
|
|
4916
|
+
/* @__PURE__ */ jsx45(DropdownMenuContent, { align: "start", portal, children: /* @__PURE__ */ jsx45(Card, { children: /* @__PURE__ */ jsx45(CardBody, { children: /* @__PURE__ */ jsx45(ButtonGroup, { children: filteredLists.map((option) => /* @__PURE__ */ jsx45(DropdownMenuItem, { asChild: true, children: /* @__PURE__ */ jsx45(
|
|
4529
4917
|
ListButton,
|
|
4530
4918
|
{
|
|
4531
4919
|
editor,
|
|
@@ -4539,11 +4927,11 @@ function ListDropdownMenu({
|
|
|
4539
4927
|
|
|
4540
4928
|
// src/components/tiptap-ui/blockquote-button/blockquote-button.tsx
|
|
4541
4929
|
import { forwardRef as forwardRef12, useCallback as useCallback16 } from "react";
|
|
4542
|
-
import { Fragment as Fragment7, jsx as
|
|
4930
|
+
import { Fragment as Fragment7, jsx as jsx46, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
4543
4931
|
function BlockquoteShortcutBadge({
|
|
4544
4932
|
shortcutKeys = BLOCKQUOTE_SHORTCUT_KEY
|
|
4545
4933
|
}) {
|
|
4546
|
-
return /* @__PURE__ */
|
|
4934
|
+
return /* @__PURE__ */ jsx46(Badge, { children: parseShortcutKeys({ shortcutKeys }) });
|
|
4547
4935
|
}
|
|
4548
4936
|
var BlockquoteButton = forwardRef12(
|
|
4549
4937
|
({
|
|
@@ -4581,7 +4969,7 @@ var BlockquoteButton = forwardRef12(
|
|
|
4581
4969
|
if (!isVisible) {
|
|
4582
4970
|
return null;
|
|
4583
4971
|
}
|
|
4584
|
-
return /* @__PURE__ */
|
|
4972
|
+
return /* @__PURE__ */ jsx46(
|
|
4585
4973
|
Button2,
|
|
4586
4974
|
{
|
|
4587
4975
|
type: "button",
|
|
@@ -4598,9 +4986,9 @@ var BlockquoteButton = forwardRef12(
|
|
|
4598
4986
|
...buttonProps,
|
|
4599
4987
|
ref,
|
|
4600
4988
|
children: children ?? /* @__PURE__ */ jsxs26(Fragment7, { children: [
|
|
4601
|
-
/* @__PURE__ */
|
|
4602
|
-
text && /* @__PURE__ */
|
|
4603
|
-
showShortcut && /* @__PURE__ */
|
|
4989
|
+
/* @__PURE__ */ jsx46(Icon, { className: "tiptap-button-icon" }),
|
|
4990
|
+
text && /* @__PURE__ */ jsx46("span", { className: "tiptap-button-text", children: text }),
|
|
4991
|
+
showShortcut && /* @__PURE__ */ jsx46(BlockquoteShortcutBadge, { shortcutKeys })
|
|
4604
4992
|
] })
|
|
4605
4993
|
}
|
|
4606
4994
|
);
|
|
@@ -4610,11 +4998,11 @@ BlockquoteButton.displayName = "BlockquoteButton";
|
|
|
4610
4998
|
|
|
4611
4999
|
// src/components/tiptap-ui/blockquote-button/use-blockquote.ts
|
|
4612
5000
|
import { useCallback as useCallback17, useEffect as useEffect11, useState as useState20 } from "react";
|
|
4613
|
-
import { NodeSelection as NodeSelection4, TextSelection as
|
|
5001
|
+
import { NodeSelection as NodeSelection4, TextSelection as TextSelection5 } from "@tiptap/pm/state";
|
|
4614
5002
|
|
|
4615
5003
|
// src/components/tiptap-icons/blockquote-icon.tsx
|
|
4616
5004
|
import { memo as memo19 } from "react";
|
|
4617
|
-
import { jsx as
|
|
5005
|
+
import { jsx as jsx47, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
4618
5006
|
var BlockquoteIcon = memo19(({ className, ...props }) => {
|
|
4619
5007
|
return /* @__PURE__ */ jsxs27(
|
|
4620
5008
|
"svg",
|
|
@@ -4627,7 +5015,7 @@ var BlockquoteIcon = memo19(({ className, ...props }) => {
|
|
|
4627
5015
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4628
5016
|
...props,
|
|
4629
5017
|
children: [
|
|
4630
|
-
/* @__PURE__ */
|
|
5018
|
+
/* @__PURE__ */ jsx47(
|
|
4631
5019
|
"path",
|
|
4632
5020
|
{
|
|
4633
5021
|
fillRule: "evenodd",
|
|
@@ -4636,7 +5024,7 @@ var BlockquoteIcon = memo19(({ className, ...props }) => {
|
|
|
4636
5024
|
fill: "currentColor"
|
|
4637
5025
|
}
|
|
4638
5026
|
),
|
|
4639
|
-
/* @__PURE__ */
|
|
5027
|
+
/* @__PURE__ */ jsx47(
|
|
4640
5028
|
"path",
|
|
4641
5029
|
{
|
|
4642
5030
|
fillRule: "evenodd",
|
|
@@ -4645,7 +5033,7 @@ var BlockquoteIcon = memo19(({ className, ...props }) => {
|
|
|
4645
5033
|
fill: "currentColor"
|
|
4646
5034
|
}
|
|
4647
5035
|
),
|
|
4648
|
-
/* @__PURE__ */
|
|
5036
|
+
/* @__PURE__ */ jsx47(
|
|
4649
5037
|
"path",
|
|
4650
5038
|
{
|
|
4651
5039
|
fillRule: "evenodd",
|
|
@@ -4654,7 +5042,7 @@ var BlockquoteIcon = memo19(({ className, ...props }) => {
|
|
|
4654
5042
|
fill: "currentColor"
|
|
4655
5043
|
}
|
|
4656
5044
|
),
|
|
4657
|
-
/* @__PURE__ */
|
|
5045
|
+
/* @__PURE__ */ jsx47(
|
|
4658
5046
|
"path",
|
|
4659
5047
|
{
|
|
4660
5048
|
fillRule: "evenodd",
|
|
@@ -4697,7 +5085,7 @@ function toggleBlockquote(editor) {
|
|
|
4697
5085
|
const view = editor.view;
|
|
4698
5086
|
let state = view.state;
|
|
4699
5087
|
let tr = state.tr;
|
|
4700
|
-
if (state.selection.empty || state.selection instanceof
|
|
5088
|
+
if (state.selection.empty || state.selection instanceof TextSelection5) {
|
|
4701
5089
|
const pos = findNodePosition({
|
|
4702
5090
|
editor,
|
|
4703
5091
|
node: state.selection.$anchor.node(1)
|
|
@@ -4716,7 +5104,7 @@ function toggleBlockquote(editor) {
|
|
|
4716
5104
|
const to = lastChild ? selection.to - lastChild.nodeSize : selection.to - 1;
|
|
4717
5105
|
const resolvedFrom = state.doc.resolve(from);
|
|
4718
5106
|
const resolvedTo = state.doc.resolve(to);
|
|
4719
|
-
chain = chain.setTextSelection(
|
|
5107
|
+
chain = chain.setTextSelection(TextSelection5.between(resolvedFrom, resolvedTo)).clearNodes();
|
|
4720
5108
|
}
|
|
4721
5109
|
const toggle = editor.isActive("blockquote") ? chain.lift("blockquote") : chain.wrapIn("blockquote");
|
|
4722
5110
|
toggle.run();
|
|
@@ -4780,9 +5168,9 @@ import { forwardRef as forwardRef14, useMemo as useMemo8, useRef as useRef5, use
|
|
|
4780
5168
|
|
|
4781
5169
|
// src/components/tiptap-icons/ban-icon.tsx
|
|
4782
5170
|
import { memo as memo20 } from "react";
|
|
4783
|
-
import { jsx as
|
|
5171
|
+
import { jsx as jsx48 } from "react/jsx-runtime";
|
|
4784
5172
|
var BanIcon = memo20(({ className, ...props }) => {
|
|
4785
|
-
return /* @__PURE__ */
|
|
5173
|
+
return /* @__PURE__ */ jsx48(
|
|
4786
5174
|
"svg",
|
|
4787
5175
|
{
|
|
4788
5176
|
width: "24",
|
|
@@ -4792,7 +5180,7 @@ var BanIcon = memo20(({ className, ...props }) => {
|
|
|
4792
5180
|
fill: "currentColor",
|
|
4793
5181
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4794
5182
|
...props,
|
|
4795
|
-
children: /* @__PURE__ */
|
|
5183
|
+
children: /* @__PURE__ */ jsx48(
|
|
4796
5184
|
"path",
|
|
4797
5185
|
{
|
|
4798
5186
|
fillRule: "evenodd",
|
|
@@ -4808,9 +5196,9 @@ BanIcon.displayName = "BanIcon";
|
|
|
4808
5196
|
|
|
4809
5197
|
// src/components/tiptap-icons/highlighter-icon.tsx
|
|
4810
5198
|
import { memo as memo21 } from "react";
|
|
4811
|
-
import { jsx as
|
|
5199
|
+
import { jsx as jsx49 } from "react/jsx-runtime";
|
|
4812
5200
|
var HighlighterIcon = memo21(({ className, ...props }) => {
|
|
4813
|
-
return /* @__PURE__ */
|
|
5201
|
+
return /* @__PURE__ */ jsx49(
|
|
4814
5202
|
"svg",
|
|
4815
5203
|
{
|
|
4816
5204
|
width: "24",
|
|
@@ -4820,7 +5208,7 @@ var HighlighterIcon = memo21(({ className, ...props }) => {
|
|
|
4820
5208
|
fill: "currentColor",
|
|
4821
5209
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4822
5210
|
...props,
|
|
4823
|
-
children: /* @__PURE__ */
|
|
5211
|
+
children: /* @__PURE__ */ jsx49(
|
|
4824
5212
|
"path",
|
|
4825
5213
|
{
|
|
4826
5214
|
fillRule: "evenodd",
|
|
@@ -4836,16 +5224,16 @@ HighlighterIcon.displayName = "HighlighterIcon";
|
|
|
4836
5224
|
|
|
4837
5225
|
// src/components/tiptap-ui-primitive/popover/popover.tsx
|
|
4838
5226
|
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
4839
|
-
import { jsx as
|
|
5227
|
+
import { jsx as jsx50 } from "react/jsx-runtime";
|
|
4840
5228
|
function Popover({
|
|
4841
5229
|
...props
|
|
4842
5230
|
}) {
|
|
4843
|
-
return /* @__PURE__ */
|
|
5231
|
+
return /* @__PURE__ */ jsx50(PopoverPrimitive.Root, { ...props });
|
|
4844
5232
|
}
|
|
4845
5233
|
function PopoverTrigger({
|
|
4846
5234
|
...props
|
|
4847
5235
|
}) {
|
|
4848
|
-
return /* @__PURE__ */
|
|
5236
|
+
return /* @__PURE__ */ jsx50(PopoverPrimitive.Trigger, { ...props });
|
|
4849
5237
|
}
|
|
4850
5238
|
function PopoverContent({
|
|
4851
5239
|
className,
|
|
@@ -4853,7 +5241,7 @@ function PopoverContent({
|
|
|
4853
5241
|
sideOffset = 4,
|
|
4854
5242
|
...props
|
|
4855
5243
|
}) {
|
|
4856
|
-
return /* @__PURE__ */
|
|
5244
|
+
return /* @__PURE__ */ jsx50(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx50(
|
|
4857
5245
|
PopoverPrimitive.Content,
|
|
4858
5246
|
{
|
|
4859
5247
|
align,
|
|
@@ -4866,11 +5254,11 @@ function PopoverContent({
|
|
|
4866
5254
|
|
|
4867
5255
|
// src/components/tiptap-ui/color-highlight-button/color-highlight-button.tsx
|
|
4868
5256
|
import { forwardRef as forwardRef13, useCallback as useCallback18, useMemo as useMemo7 } from "react";
|
|
4869
|
-
import { Fragment as Fragment8, jsx as
|
|
5257
|
+
import { Fragment as Fragment8, jsx as jsx51, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
4870
5258
|
function ColorHighlightShortcutBadge({
|
|
4871
5259
|
shortcutKeys = COLOR_HIGHLIGHT_SHORTCUT_KEY
|
|
4872
5260
|
}) {
|
|
4873
|
-
return /* @__PURE__ */
|
|
5261
|
+
return /* @__PURE__ */ jsx51(Badge, { children: parseShortcutKeys({ shortcutKeys }) });
|
|
4874
5262
|
}
|
|
4875
5263
|
var ColorHighlightButton = forwardRef13(
|
|
4876
5264
|
({
|
|
@@ -4920,7 +5308,7 @@ var ColorHighlightButton = forwardRef13(
|
|
|
4920
5308
|
if (!isVisible) {
|
|
4921
5309
|
return null;
|
|
4922
5310
|
}
|
|
4923
|
-
return /* @__PURE__ */
|
|
5311
|
+
return /* @__PURE__ */ jsx51(
|
|
4924
5312
|
Button2,
|
|
4925
5313
|
{
|
|
4926
5314
|
type: "button",
|
|
@@ -4938,15 +5326,15 @@ var ColorHighlightButton = forwardRef13(
|
|
|
4938
5326
|
...buttonProps,
|
|
4939
5327
|
ref,
|
|
4940
5328
|
children: children ?? /* @__PURE__ */ jsxs28(Fragment8, { children: [
|
|
4941
|
-
/* @__PURE__ */
|
|
5329
|
+
/* @__PURE__ */ jsx51(
|
|
4942
5330
|
"span",
|
|
4943
5331
|
{
|
|
4944
5332
|
className: "tiptap-button-highlight",
|
|
4945
5333
|
style: { "--highlight-color": highlightColor }
|
|
4946
5334
|
}
|
|
4947
5335
|
),
|
|
4948
|
-
text && /* @__PURE__ */
|
|
4949
|
-
showShortcut && /* @__PURE__ */
|
|
5336
|
+
text && /* @__PURE__ */ jsx51("span", { className: "tiptap-button-text", children: text }),
|
|
5337
|
+
showShortcut && /* @__PURE__ */ jsx51(ColorHighlightShortcutBadge, { shortcutKeys })
|
|
4950
5338
|
] })
|
|
4951
5339
|
}
|
|
4952
5340
|
);
|
|
@@ -5161,8 +5549,8 @@ function useColorHighlight(config) {
|
|
|
5161
5549
|
}
|
|
5162
5550
|
|
|
5163
5551
|
// src/components/tiptap-ui/color-highlight-popover/color-highlight-popover.tsx
|
|
5164
|
-
import { jsx as
|
|
5165
|
-
var ColorHighlightPopoverButton = forwardRef14(({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
5552
|
+
import { jsx as jsx52, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
5553
|
+
var ColorHighlightPopoverButton = forwardRef14(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx52(
|
|
5166
5554
|
Button2,
|
|
5167
5555
|
{
|
|
5168
5556
|
type: "button",
|
|
@@ -5175,7 +5563,7 @@ var ColorHighlightPopoverButton = forwardRef14(({ className, children, ...props
|
|
|
5175
5563
|
tooltip: "Highlight",
|
|
5176
5564
|
ref,
|
|
5177
5565
|
...props,
|
|
5178
|
-
children: children ?? /* @__PURE__ */
|
|
5566
|
+
children: children ?? /* @__PURE__ */ jsx52(HighlighterIcon, { className: "tiptap-button-icon" })
|
|
5179
5567
|
}
|
|
5180
5568
|
));
|
|
5181
5569
|
ColorHighlightPopoverButton.displayName = "ColorHighlightPopoverButton";
|
|
@@ -5211,14 +5599,14 @@ function ColorHighlightPopoverContent({
|
|
|
5211
5599
|
},
|
|
5212
5600
|
autoSelectFirstItem: false
|
|
5213
5601
|
});
|
|
5214
|
-
return /* @__PURE__ */
|
|
5602
|
+
return /* @__PURE__ */ jsx52(
|
|
5215
5603
|
Card,
|
|
5216
5604
|
{
|
|
5217
5605
|
ref: containerRef,
|
|
5218
5606
|
tabIndex: 0,
|
|
5219
5607
|
style: isMobile ? { boxShadow: "none", border: 0 } : {},
|
|
5220
|
-
children: /* @__PURE__ */
|
|
5221
|
-
/* @__PURE__ */
|
|
5608
|
+
children: /* @__PURE__ */ jsx52(CardBody, { style: isMobile ? { padding: 0 } : {}, children: /* @__PURE__ */ jsxs29(CardItemGroup, { orientation: "horizontal", children: [
|
|
5609
|
+
/* @__PURE__ */ jsx52(ButtonGroup, { orientation: "horizontal", children: colors.map((color, index) => /* @__PURE__ */ jsx52(
|
|
5222
5610
|
ColorHighlightButton,
|
|
5223
5611
|
{
|
|
5224
5612
|
editor,
|
|
@@ -5230,8 +5618,8 @@ function ColorHighlightPopoverContent({
|
|
|
5230
5618
|
},
|
|
5231
5619
|
color.value
|
|
5232
5620
|
)) }),
|
|
5233
|
-
/* @__PURE__ */
|
|
5234
|
-
/* @__PURE__ */
|
|
5621
|
+
/* @__PURE__ */ jsx52(Separator2, {}),
|
|
5622
|
+
/* @__PURE__ */ jsx52(ButtonGroup, { orientation: "horizontal", children: /* @__PURE__ */ jsx52(
|
|
5235
5623
|
Button2,
|
|
5236
5624
|
{
|
|
5237
5625
|
onClick: handleRemoveHighlight,
|
|
@@ -5242,7 +5630,7 @@ function ColorHighlightPopoverContent({
|
|
|
5242
5630
|
role: "menuitem",
|
|
5243
5631
|
"data-style": "ghost",
|
|
5244
5632
|
"data-highlighted": selectedIndex === colors.length,
|
|
5245
|
-
children: /* @__PURE__ */
|
|
5633
|
+
children: /* @__PURE__ */ jsx52(BanIcon, { className: "tiptap-button-icon" })
|
|
5246
5634
|
}
|
|
5247
5635
|
) })
|
|
5248
5636
|
] }) })
|
|
@@ -5255,9 +5643,9 @@ import { forwardRef as forwardRef15, useCallback as useCallback20, useEffect as
|
|
|
5255
5643
|
|
|
5256
5644
|
// src/components/tiptap-icons/corner-down-left-icon.tsx
|
|
5257
5645
|
import { memo as memo22 } from "react";
|
|
5258
|
-
import { jsx as
|
|
5646
|
+
import { jsx as jsx53 } from "react/jsx-runtime";
|
|
5259
5647
|
var CornerDownLeftIcon = memo22(({ className, ...props }) => {
|
|
5260
|
-
return /* @__PURE__ */
|
|
5648
|
+
return /* @__PURE__ */ jsx53(
|
|
5261
5649
|
"svg",
|
|
5262
5650
|
{
|
|
5263
5651
|
width: "24",
|
|
@@ -5267,7 +5655,7 @@ var CornerDownLeftIcon = memo22(({ className, ...props }) => {
|
|
|
5267
5655
|
fill: "currentColor",
|
|
5268
5656
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5269
5657
|
...props,
|
|
5270
|
-
children: /* @__PURE__ */
|
|
5658
|
+
children: /* @__PURE__ */ jsx53(
|
|
5271
5659
|
"path",
|
|
5272
5660
|
{
|
|
5273
5661
|
fillRule: "evenodd",
|
|
@@ -5283,7 +5671,7 @@ CornerDownLeftIcon.displayName = "CornerDownLeftIcon";
|
|
|
5283
5671
|
|
|
5284
5672
|
// src/components/tiptap-icons/external-link-icon.tsx
|
|
5285
5673
|
import { memo as memo23 } from "react";
|
|
5286
|
-
import { jsx as
|
|
5674
|
+
import { jsx as jsx54, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
5287
5675
|
var ExternalLinkIcon = memo23(({ className, ...props }) => {
|
|
5288
5676
|
return /* @__PURE__ */ jsxs30(
|
|
5289
5677
|
"svg",
|
|
@@ -5296,14 +5684,14 @@ var ExternalLinkIcon = memo23(({ className, ...props }) => {
|
|
|
5296
5684
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5297
5685
|
...props,
|
|
5298
5686
|
children: [
|
|
5299
|
-
/* @__PURE__ */
|
|
5687
|
+
/* @__PURE__ */ jsx54(
|
|
5300
5688
|
"path",
|
|
5301
5689
|
{
|
|
5302
5690
|
d: "M14 3C14 2.44772 14.4477 2 15 2H21C21.5523 2 22 2.44772 22 3V9C22 9.55228 21.5523 10 21 10C20.4477 10 20 9.55228 20 9V5.41421L10.7071 14.7071C10.3166 15.0976 9.68342 15.0976 9.29289 14.7071C8.90237 14.3166 8.90237 13.6834 9.29289 13.2929L18.5858 4H15C14.4477 4 14 3.55228 14 3Z",
|
|
5303
5691
|
fill: "currentColor"
|
|
5304
5692
|
}
|
|
5305
5693
|
),
|
|
5306
|
-
/* @__PURE__ */
|
|
5694
|
+
/* @__PURE__ */ jsx54(
|
|
5307
5695
|
"path",
|
|
5308
5696
|
{
|
|
5309
5697
|
d: "M4.29289 7.29289C4.48043 7.10536 4.73478 7 5 7H11C11.5523 7 12 6.55228 12 6C12 5.44772 11.5523 5 11 5H5C4.20435 5 3.44129 5.31607 2.87868 5.87868C2.31607 6.44129 2 7.20435 2 8V19C2 19.7957 2.31607 20.5587 2.87868 21.1213C3.44129 21.6839 4.20435 22 5 22H16C16.7957 22 17.5587 21.6839 18.1213 21.1213C18.6839 20.5587 19 19.7957 19 19V13C19 12.4477 18.5523 12 18 12C17.4477 12 17 12.4477 17 13V19C17 19.2652 16.8946 19.5196 16.7071 19.7071C16.5196 19.8946 16.2652 20 16 20H5C4.73478 20 4.48043 19.8946 4.29289 19.7071C4.10536 19.5196 4 19.2652 4 19V8C4 7.73478 4.10536 7.48043 4.29289 7.29289Z",
|
|
@@ -5318,7 +5706,7 @@ ExternalLinkIcon.displayName = "ExternalLinkIcon";
|
|
|
5318
5706
|
|
|
5319
5707
|
// src/components/tiptap-icons/link-icon.tsx
|
|
5320
5708
|
import { memo as memo24 } from "react";
|
|
5321
|
-
import { jsx as
|
|
5709
|
+
import { jsx as jsx55, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
5322
5710
|
var LinkIcon = memo24(({ className, ...props }) => {
|
|
5323
5711
|
return /* @__PURE__ */ jsxs31(
|
|
5324
5712
|
"svg",
|
|
@@ -5331,14 +5719,14 @@ var LinkIcon = memo24(({ className, ...props }) => {
|
|
|
5331
5719
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5332
5720
|
...props,
|
|
5333
5721
|
children: [
|
|
5334
|
-
/* @__PURE__ */
|
|
5722
|
+
/* @__PURE__ */ jsx55(
|
|
5335
5723
|
"path",
|
|
5336
5724
|
{
|
|
5337
5725
|
d: "M16.9958 1.06669C15.4226 1.05302 13.907 1.65779 12.7753 2.75074L12.765 2.76086L11.045 4.47086C10.6534 4.86024 10.6515 5.49341 11.0409 5.88507C11.4303 6.27673 12.0634 6.27858 12.4551 5.88919L14.1697 4.18456C14.9236 3.45893 15.9319 3.05752 16.9784 3.06662C18.0272 3.07573 19.0304 3.49641 19.772 4.23804C20.5137 4.97967 20.9344 5.98292 20.9435 7.03171C20.9526 8.07776 20.5515 9.08563 19.8265 9.83941L16.833 12.8329C16.4274 13.2386 15.9393 13.5524 15.4019 13.7529C14.8645 13.9533 14.2903 14.0359 13.7181 13.9949C13.146 13.9539 12.5894 13.7904 12.0861 13.5154C11.5827 13.2404 11.1444 12.8604 10.8008 12.401C10.47 11.9588 9.84333 11.8685 9.40108 12.1993C8.95883 12.5301 8.86849 13.1568 9.1993 13.599C9.71464 14.288 10.3721 14.858 11.1272 15.2705C11.8822 15.683 12.7171 15.9283 13.5753 15.9898C14.4334 16.0513 15.2948 15.9274 16.1009 15.6267C16.907 15.326 17.639 14.8555 18.2473 14.247L21.2472 11.2471L21.2593 11.2347C22.3523 10.1031 22.9571 8.58751 22.9434 7.01433C22.9297 5.44115 22.2987 3.93628 21.1863 2.82383C20.0738 1.71138 18.5689 1.08036 16.9958 1.06669Z",
|
|
5338
5726
|
fill: "currentColor"
|
|
5339
5727
|
}
|
|
5340
5728
|
),
|
|
5341
|
-
/* @__PURE__ */
|
|
5729
|
+
/* @__PURE__ */ jsx55(
|
|
5342
5730
|
"path",
|
|
5343
5731
|
{
|
|
5344
5732
|
d: "M10.4247 8.0102C9.56657 7.94874 8.70522 8.07256 7.89911 8.37326C7.09305 8.67395 6.36096 9.14458 5.75272 9.753L2.75285 12.7529L2.74067 12.7653C1.64772 13.8969 1.04295 15.4125 1.05662 16.9857C1.07029 18.5589 1.70131 20.0637 2.81376 21.1762C3.9262 22.2886 5.43108 22.9196 7.00426 22.9333C8.57744 22.947 10.0931 22.3422 11.2247 21.2493L11.2371 21.2371L12.9471 19.5271C13.3376 19.1366 13.3376 18.5034 12.9471 18.1129C12.5565 17.7223 11.9234 17.7223 11.5328 18.1129L9.82932 19.8164C9.07555 20.5414 8.06768 20.9425 7.02164 20.9334C5.97285 20.9243 4.9696 20.5036 4.22797 19.762C3.48634 19.0203 3.06566 18.0171 3.05655 16.9683C3.04746 15.9222 3.44851 14.9144 4.17355 14.1606L7.16719 11.167C7.5727 10.7613 8.06071 10.4476 8.59811 10.2471C9.13552 10.0467 9.70976 9.96412 10.2819 10.0051C10.854 10.0461 11.4106 10.2096 11.9139 10.4846C12.4173 10.7596 12.8556 11.1397 13.1992 11.599C13.53 12.0412 14.1567 12.1316 14.5989 11.8007C15.0412 11.4699 15.1315 10.8433 14.8007 10.401C14.2854 9.71205 13.6279 9.14198 12.8729 8.72948C12.1178 8.31697 11.2829 8.07166 10.4247 8.0102Z",
|
|
@@ -5353,9 +5741,9 @@ LinkIcon.displayName = "LinkIcon";
|
|
|
5353
5741
|
|
|
5354
5742
|
// src/components/tiptap-icons/trash-icon.tsx
|
|
5355
5743
|
import { memo as memo25 } from "react";
|
|
5356
|
-
import { jsx as
|
|
5744
|
+
import { jsx as jsx56 } from "react/jsx-runtime";
|
|
5357
5745
|
var TrashIcon = memo25(({ className, ...props }) => {
|
|
5358
|
-
return /* @__PURE__ */
|
|
5746
|
+
return /* @__PURE__ */ jsx56(
|
|
5359
5747
|
"svg",
|
|
5360
5748
|
{
|
|
5361
5749
|
width: "24",
|
|
@@ -5365,7 +5753,7 @@ var TrashIcon = memo25(({ className, ...props }) => {
|
|
|
5365
5753
|
fill: "currentColor",
|
|
5366
5754
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5367
5755
|
...props,
|
|
5368
|
-
children: /* @__PURE__ */
|
|
5756
|
+
children: /* @__PURE__ */ jsx56(
|
|
5369
5757
|
"path",
|
|
5370
5758
|
{
|
|
5371
5759
|
fillRule: "evenodd",
|
|
@@ -5380,23 +5768,23 @@ var TrashIcon = memo25(({ className, ...props }) => {
|
|
|
5380
5768
|
TrashIcon.displayName = "TrashIcon";
|
|
5381
5769
|
|
|
5382
5770
|
// src/components/tiptap-ui-primitive/input/input.tsx
|
|
5383
|
-
import { jsx as
|
|
5771
|
+
import { jsx as jsx57 } from "react/jsx-runtime";
|
|
5384
5772
|
function Input({ className, type, ...props }) {
|
|
5385
|
-
return /* @__PURE__ */
|
|
5773
|
+
return /* @__PURE__ */ jsx57("input", { type, className: cn2("tiptap-input", className), ...props });
|
|
5386
5774
|
}
|
|
5387
5775
|
function InputGroup({
|
|
5388
5776
|
className,
|
|
5389
5777
|
children,
|
|
5390
5778
|
...props
|
|
5391
5779
|
}) {
|
|
5392
|
-
return /* @__PURE__ */
|
|
5780
|
+
return /* @__PURE__ */ jsx57("div", { className: cn2("tiptap-input-group", className), ...props, children });
|
|
5393
5781
|
}
|
|
5394
5782
|
|
|
5395
5783
|
// src/components/tiptap-ui/link-popover/link-popover.tsx
|
|
5396
|
-
import { jsx as
|
|
5784
|
+
import { jsx as jsx58, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
5397
5785
|
var LinkButton = forwardRef15(
|
|
5398
5786
|
({ className, children, ...props }, ref) => {
|
|
5399
|
-
return /* @__PURE__ */
|
|
5787
|
+
return /* @__PURE__ */ jsx58(
|
|
5400
5788
|
Button2,
|
|
5401
5789
|
{
|
|
5402
5790
|
type: "button",
|
|
@@ -5408,7 +5796,7 @@ var LinkButton = forwardRef15(
|
|
|
5408
5796
|
tooltip: "Link",
|
|
5409
5797
|
ref,
|
|
5410
5798
|
...props,
|
|
5411
|
-
children: children || /* @__PURE__ */
|
|
5799
|
+
children: children || /* @__PURE__ */ jsx58(LinkIcon, { className: "tiptap-button-icon" })
|
|
5412
5800
|
}
|
|
5413
5801
|
);
|
|
5414
5802
|
}
|
|
@@ -5429,20 +5817,20 @@ var LinkMain = ({
|
|
|
5429
5817
|
setLink();
|
|
5430
5818
|
}
|
|
5431
5819
|
};
|
|
5432
|
-
return /* @__PURE__ */
|
|
5820
|
+
return /* @__PURE__ */ jsx58(
|
|
5433
5821
|
Card,
|
|
5434
5822
|
{
|
|
5435
5823
|
style: {
|
|
5436
5824
|
...isMobile ? { boxShadow: "none", border: 0 } : {}
|
|
5437
5825
|
},
|
|
5438
|
-
children: /* @__PURE__ */
|
|
5826
|
+
children: /* @__PURE__ */ jsx58(
|
|
5439
5827
|
CardBody,
|
|
5440
5828
|
{
|
|
5441
5829
|
style: {
|
|
5442
5830
|
...isMobile ? { padding: 0 } : {}
|
|
5443
5831
|
},
|
|
5444
5832
|
children: /* @__PURE__ */ jsxs32(CardItemGroup, { orientation: "horizontal", children: [
|
|
5445
|
-
/* @__PURE__ */
|
|
5833
|
+
/* @__PURE__ */ jsx58(InputGroup, { children: /* @__PURE__ */ jsx58(
|
|
5446
5834
|
Input,
|
|
5447
5835
|
{
|
|
5448
5836
|
type: "url",
|
|
@@ -5456,7 +5844,7 @@ var LinkMain = ({
|
|
|
5456
5844
|
autoCapitalize: "off"
|
|
5457
5845
|
}
|
|
5458
5846
|
) }),
|
|
5459
|
-
/* @__PURE__ */
|
|
5847
|
+
/* @__PURE__ */ jsx58(ButtonGroup, { orientation: "horizontal", children: /* @__PURE__ */ jsx58(
|
|
5460
5848
|
Button2,
|
|
5461
5849
|
{
|
|
5462
5850
|
type: "button",
|
|
@@ -5464,12 +5852,12 @@ var LinkMain = ({
|
|
|
5464
5852
|
title: "Apply link",
|
|
5465
5853
|
disabled: !url && !isActive,
|
|
5466
5854
|
"data-style": "ghost",
|
|
5467
|
-
children: /* @__PURE__ */
|
|
5855
|
+
children: /* @__PURE__ */ jsx58(CornerDownLeftIcon, { className: "tiptap-button-icon" })
|
|
5468
5856
|
}
|
|
5469
5857
|
) }),
|
|
5470
|
-
/* @__PURE__ */
|
|
5858
|
+
/* @__PURE__ */ jsx58(Separator2, {}),
|
|
5471
5859
|
/* @__PURE__ */ jsxs32(ButtonGroup, { orientation: "horizontal", children: [
|
|
5472
|
-
/* @__PURE__ */
|
|
5860
|
+
/* @__PURE__ */ jsx58(
|
|
5473
5861
|
Button2,
|
|
5474
5862
|
{
|
|
5475
5863
|
type: "button",
|
|
@@ -5477,10 +5865,10 @@ var LinkMain = ({
|
|
|
5477
5865
|
title: "Open in new window",
|
|
5478
5866
|
disabled: !url && !isActive,
|
|
5479
5867
|
"data-style": "ghost",
|
|
5480
|
-
children: /* @__PURE__ */
|
|
5868
|
+
children: /* @__PURE__ */ jsx58(ExternalLinkIcon, { className: "tiptap-button-icon" })
|
|
5481
5869
|
}
|
|
5482
5870
|
),
|
|
5483
|
-
/* @__PURE__ */
|
|
5871
|
+
/* @__PURE__ */ jsx58(
|
|
5484
5872
|
Button2,
|
|
5485
5873
|
{
|
|
5486
5874
|
type: "button",
|
|
@@ -5488,7 +5876,7 @@ var LinkMain = ({
|
|
|
5488
5876
|
title: "Remove link",
|
|
5489
5877
|
disabled: !url && !isActive,
|
|
5490
5878
|
"data-style": "ghost",
|
|
5491
|
-
children: /* @__PURE__ */
|
|
5879
|
+
children: /* @__PURE__ */ jsx58(TrashIcon, { className: "tiptap-button-icon" })
|
|
5492
5880
|
}
|
|
5493
5881
|
)
|
|
5494
5882
|
] })
|
|
@@ -5502,7 +5890,7 @@ var LinkContent = ({ editor }) => {
|
|
|
5502
5890
|
const linkPopover = useLinkPopover({
|
|
5503
5891
|
editor
|
|
5504
5892
|
});
|
|
5505
|
-
return /* @__PURE__ */
|
|
5893
|
+
return /* @__PURE__ */ jsx58(LinkMain, { ...linkPopover });
|
|
5506
5894
|
};
|
|
5507
5895
|
var LinkPopover = forwardRef15(
|
|
5508
5896
|
({
|
|
@@ -5561,7 +5949,7 @@ var LinkPopover = forwardRef15(
|
|
|
5561
5949
|
return null;
|
|
5562
5950
|
}
|
|
5563
5951
|
return /* @__PURE__ */ jsxs32(Popover, { open: isOpen, onOpenChange: handleOnOpenChange, children: [
|
|
5564
|
-
/* @__PURE__ */
|
|
5952
|
+
/* @__PURE__ */ jsx58(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx58(
|
|
5565
5953
|
LinkButton,
|
|
5566
5954
|
{
|
|
5567
5955
|
disabled: !canSet,
|
|
@@ -5572,10 +5960,10 @@ var LinkPopover = forwardRef15(
|
|
|
5572
5960
|
onClick: handleClick,
|
|
5573
5961
|
...buttonProps,
|
|
5574
5962
|
ref,
|
|
5575
|
-
children: children ?? /* @__PURE__ */
|
|
5963
|
+
children: children ?? /* @__PURE__ */ jsx58(Icon, { className: "tiptap-button-icon" })
|
|
5576
5964
|
}
|
|
5577
5965
|
) }),
|
|
5578
|
-
/* @__PURE__ */
|
|
5966
|
+
/* @__PURE__ */ jsx58(PopoverContent, { children: /* @__PURE__ */ jsx58(
|
|
5579
5967
|
LinkMain,
|
|
5580
5968
|
{
|
|
5581
5969
|
url,
|
|
@@ -5724,12 +6112,12 @@ function useLinkPopover(config) {
|
|
|
5724
6112
|
|
|
5725
6113
|
// src/components/tiptap-ui/mark-button/mark-button.tsx
|
|
5726
6114
|
import { forwardRef as forwardRef16, useCallback as useCallback22 } from "react";
|
|
5727
|
-
import { Fragment as Fragment9, jsx as
|
|
6115
|
+
import { Fragment as Fragment9, jsx as jsx59, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
5728
6116
|
function MarkShortcutBadge({
|
|
5729
6117
|
type,
|
|
5730
6118
|
shortcutKeys = MARK_SHORTCUT_KEYS[type]
|
|
5731
6119
|
}) {
|
|
5732
|
-
return /* @__PURE__ */
|
|
6120
|
+
return /* @__PURE__ */ jsx59(Badge, { children: parseShortcutKeys({ shortcutKeys }) });
|
|
5733
6121
|
}
|
|
5734
6122
|
var MarkButton = forwardRef16(
|
|
5735
6123
|
({
|
|
@@ -5769,7 +6157,7 @@ var MarkButton = forwardRef16(
|
|
|
5769
6157
|
if (!isVisible) {
|
|
5770
6158
|
return null;
|
|
5771
6159
|
}
|
|
5772
|
-
return /* @__PURE__ */
|
|
6160
|
+
return /* @__PURE__ */ jsx59(
|
|
5773
6161
|
Button2,
|
|
5774
6162
|
{
|
|
5775
6163
|
type: "button",
|
|
@@ -5786,9 +6174,9 @@ var MarkButton = forwardRef16(
|
|
|
5786
6174
|
...buttonProps,
|
|
5787
6175
|
ref,
|
|
5788
6176
|
children: children ?? /* @__PURE__ */ jsxs33(Fragment9, { children: [
|
|
5789
|
-
/* @__PURE__ */
|
|
5790
|
-
text && /* @__PURE__ */
|
|
5791
|
-
showShortcut && /* @__PURE__ */
|
|
6177
|
+
/* @__PURE__ */ jsx59(Icon, { className: "tiptap-button-icon" }),
|
|
6178
|
+
text && /* @__PURE__ */ jsx59("span", { className: "tiptap-button-text", children: text }),
|
|
6179
|
+
showShortcut && /* @__PURE__ */ jsx59(MarkShortcutBadge, { type, shortcutKeys })
|
|
5792
6180
|
] })
|
|
5793
6181
|
}
|
|
5794
6182
|
);
|
|
@@ -5801,9 +6189,9 @@ import { useCallback as useCallback23, useEffect as useEffect15, useState as use
|
|
|
5801
6189
|
|
|
5802
6190
|
// src/components/tiptap-icons/bold-icon.tsx
|
|
5803
6191
|
import { memo as memo26 } from "react";
|
|
5804
|
-
import { jsx as
|
|
6192
|
+
import { jsx as jsx60 } from "react/jsx-runtime";
|
|
5805
6193
|
var BoldIcon = memo26(({ className, ...props }) => {
|
|
5806
|
-
return /* @__PURE__ */
|
|
6194
|
+
return /* @__PURE__ */ jsx60(
|
|
5807
6195
|
"svg",
|
|
5808
6196
|
{
|
|
5809
6197
|
width: "24",
|
|
@@ -5813,7 +6201,7 @@ var BoldIcon = memo26(({ className, ...props }) => {
|
|
|
5813
6201
|
fill: "currentColor",
|
|
5814
6202
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5815
6203
|
...props,
|
|
5816
|
-
children: /* @__PURE__ */
|
|
6204
|
+
children: /* @__PURE__ */ jsx60(
|
|
5817
6205
|
"path",
|
|
5818
6206
|
{
|
|
5819
6207
|
fillRule: "evenodd",
|
|
@@ -5829,7 +6217,7 @@ BoldIcon.displayName = "BoldIcon";
|
|
|
5829
6217
|
|
|
5830
6218
|
// src/components/tiptap-icons/code2-icon.tsx
|
|
5831
6219
|
import { memo as memo27 } from "react";
|
|
5832
|
-
import { jsx as
|
|
6220
|
+
import { jsx as jsx61, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
5833
6221
|
var Code2Icon = memo27(({ className, ...props }) => {
|
|
5834
6222
|
return /* @__PURE__ */ jsxs34(
|
|
5835
6223
|
"svg",
|
|
@@ -5842,21 +6230,21 @@ var Code2Icon = memo27(({ className, ...props }) => {
|
|
|
5842
6230
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5843
6231
|
...props,
|
|
5844
6232
|
children: [
|
|
5845
|
-
/* @__PURE__ */
|
|
6233
|
+
/* @__PURE__ */ jsx61(
|
|
5846
6234
|
"path",
|
|
5847
6235
|
{
|
|
5848
6236
|
d: "M15.4545 4.2983C15.6192 3.77115 15.3254 3.21028 14.7983 3.04554C14.2712 2.88081 13.7103 3.1746 13.5455 3.70175L8.54554 19.7017C8.38081 20.2289 8.6746 20.7898 9.20175 20.9545C9.72889 21.1192 10.2898 20.8254 10.4545 20.2983L15.4545 4.2983Z",
|
|
5849
6237
|
fill: "currentColor"
|
|
5850
6238
|
}
|
|
5851
6239
|
),
|
|
5852
|
-
/* @__PURE__ */
|
|
6240
|
+
/* @__PURE__ */ jsx61(
|
|
5853
6241
|
"path",
|
|
5854
6242
|
{
|
|
5855
6243
|
d: "M6.70711 7.29289C7.09763 7.68342 7.09763 8.31658 6.70711 8.70711L3.41421 12L6.70711 15.2929C7.09763 15.6834 7.09763 16.3166 6.70711 16.7071C6.31658 17.0976 5.68342 17.0976 5.29289 16.7071L1.29289 12.7071C0.902369 12.3166 0.902369 11.6834 1.29289 11.2929L5.29289 7.29289C5.68342 6.90237 6.31658 6.90237 6.70711 7.29289Z",
|
|
5856
6244
|
fill: "currentColor"
|
|
5857
6245
|
}
|
|
5858
6246
|
),
|
|
5859
|
-
/* @__PURE__ */
|
|
6247
|
+
/* @__PURE__ */ jsx61(
|
|
5860
6248
|
"path",
|
|
5861
6249
|
{
|
|
5862
6250
|
d: "M17.2929 7.29289C17.6834 6.90237 18.3166 6.90237 18.7071 7.29289L22.7071 11.2929C23.0976 11.6834 23.0976 12.3166 22.7071 12.7071L18.7071 16.7071C18.3166 17.0976 17.6834 17.0976 17.2929 16.7071C16.9024 16.3166 16.9024 15.6834 17.2929 15.2929L20.5858 12L17.2929 8.70711C16.9024 8.31658 16.9024 7.68342 17.2929 7.29289Z",
|
|
@@ -5871,9 +6259,9 @@ Code2Icon.displayName = "Code2Icon";
|
|
|
5871
6259
|
|
|
5872
6260
|
// src/components/tiptap-icons/italic-icon.tsx
|
|
5873
6261
|
import { memo as memo28 } from "react";
|
|
5874
|
-
import { jsx as
|
|
6262
|
+
import { jsx as jsx62 } from "react/jsx-runtime";
|
|
5875
6263
|
var ItalicIcon = memo28(({ className, ...props }) => {
|
|
5876
|
-
return /* @__PURE__ */
|
|
6264
|
+
return /* @__PURE__ */ jsx62(
|
|
5877
6265
|
"svg",
|
|
5878
6266
|
{
|
|
5879
6267
|
width: "24",
|
|
@@ -5883,7 +6271,7 @@ var ItalicIcon = memo28(({ className, ...props }) => {
|
|
|
5883
6271
|
fill: "currentColor",
|
|
5884
6272
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5885
6273
|
...props,
|
|
5886
|
-
children: /* @__PURE__ */
|
|
6274
|
+
children: /* @__PURE__ */ jsx62(
|
|
5887
6275
|
"path",
|
|
5888
6276
|
{
|
|
5889
6277
|
d: "M15.0222 3H19C19.5523 3 20 3.44772 20 4C20 4.55228 19.5523 5 19 5H15.693L10.443 19H14C14.5523 19 15 19.4477 15 20C15 20.5523 14.5523 21 14 21H9.02418C9.00802 21.0004 8.99181 21.0004 8.97557 21H5C4.44772 21 4 20.5523 4 20C4 19.4477 4.44772 19 5 19H8.30704L13.557 5H10C9.44772 5 9 4.55228 9 4C9 3.44772 9.44772 3 10 3H14.9782C14.9928 2.99968 15.0075 2.99967 15.0222 3Z",
|
|
@@ -5897,7 +6285,7 @@ ItalicIcon.displayName = "ItalicIcon";
|
|
|
5897
6285
|
|
|
5898
6286
|
// src/components/tiptap-icons/strike-icon.tsx
|
|
5899
6287
|
import { memo as memo29 } from "react";
|
|
5900
|
-
import { jsx as
|
|
6288
|
+
import { jsx as jsx63, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
5901
6289
|
var StrikeIcon = memo29(({ className, ...props }) => {
|
|
5902
6290
|
return /* @__PURE__ */ jsxs35(
|
|
5903
6291
|
"svg",
|
|
@@ -5910,14 +6298,14 @@ var StrikeIcon = memo29(({ className, ...props }) => {
|
|
|
5910
6298
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5911
6299
|
...props,
|
|
5912
6300
|
children: [
|
|
5913
|
-
/* @__PURE__ */
|
|
6301
|
+
/* @__PURE__ */ jsx63(
|
|
5914
6302
|
"path",
|
|
5915
6303
|
{
|
|
5916
6304
|
d: "M9.00039 3H16.0001C16.5524 3 17.0001 3.44772 17.0001 4C17.0001 4.55229 16.5524 5 16.0001 5H9.00011C8.68006 4.99983 8.36412 5.07648 8.07983 5.22349C7.79555 5.37051 7.55069 5.5836 7.36585 5.84487C7.181 6.10614 7.06155 6.40796 7.01754 6.72497C6.97352 7.04198 7.00623 7.36492 7.11292 7.66667C7.29701 8.18737 7.02414 8.75872 6.50344 8.94281C5.98274 9.1269 5.4114 8.85403 5.2273 8.33333C5.01393 7.72984 4.94851 7.08396 5.03654 6.44994C5.12456 5.81592 5.36346 5.21229 5.73316 4.68974C6.10285 4.1672 6.59256 3.74101 7.16113 3.44698C7.72955 3.15303 8.36047 2.99975 9.00039 3Z",
|
|
5917
6305
|
fill: "currentColor"
|
|
5918
6306
|
}
|
|
5919
6307
|
),
|
|
5920
|
-
/* @__PURE__ */
|
|
6308
|
+
/* @__PURE__ */ jsx63(
|
|
5921
6309
|
"path",
|
|
5922
6310
|
{
|
|
5923
6311
|
d: "M18 13H20C20.5523 13 21 12.5523 21 12C21 11.4477 20.5523 11 20 11H4C3.44772 11 3 11.4477 3 12C3 12.5523 3.44772 13 4 13H14C14.7956 13 15.5587 13.3161 16.1213 13.8787C16.6839 14.4413 17 15.2044 17 16C17 16.7956 16.6839 17.5587 16.1213 18.1213C15.5587 18.6839 14.7956 19 14 19H6C5.44772 19 5 19.4477 5 20C5 20.5523 5.44772 21 6 21H14C15.3261 21 16.5979 20.4732 17.5355 19.5355C18.4732 18.5979 19 17.3261 19 16C19 14.9119 18.6453 13.8604 18 13Z",
|
|
@@ -5932,7 +6320,7 @@ StrikeIcon.displayName = "StrikeIcon";
|
|
|
5932
6320
|
|
|
5933
6321
|
// src/components/tiptap-icons/subscript-icon.tsx
|
|
5934
6322
|
import { memo as memo30 } from "react";
|
|
5935
|
-
import { jsx as
|
|
6323
|
+
import { jsx as jsx64, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
5936
6324
|
var SubscriptIcon = memo30(({ className, ...props }) => {
|
|
5937
6325
|
return /* @__PURE__ */ jsxs36(
|
|
5938
6326
|
"svg",
|
|
@@ -5945,7 +6333,7 @@ var SubscriptIcon = memo30(({ className, ...props }) => {
|
|
|
5945
6333
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5946
6334
|
...props,
|
|
5947
6335
|
children: [
|
|
5948
|
-
/* @__PURE__ */
|
|
6336
|
+
/* @__PURE__ */ jsx64(
|
|
5949
6337
|
"path",
|
|
5950
6338
|
{
|
|
5951
6339
|
fillRule: "evenodd",
|
|
@@ -5954,7 +6342,7 @@ var SubscriptIcon = memo30(({ className, ...props }) => {
|
|
|
5954
6342
|
fill: "currentColor"
|
|
5955
6343
|
}
|
|
5956
6344
|
),
|
|
5957
|
-
/* @__PURE__ */
|
|
6345
|
+
/* @__PURE__ */ jsx64(
|
|
5958
6346
|
"path",
|
|
5959
6347
|
{
|
|
5960
6348
|
fillRule: "evenodd",
|
|
@@ -5963,7 +6351,7 @@ var SubscriptIcon = memo30(({ className, ...props }) => {
|
|
|
5963
6351
|
fill: "currentColor"
|
|
5964
6352
|
}
|
|
5965
6353
|
),
|
|
5966
|
-
/* @__PURE__ */
|
|
6354
|
+
/* @__PURE__ */ jsx64(
|
|
5967
6355
|
"path",
|
|
5968
6356
|
{
|
|
5969
6357
|
fillRule: "evenodd",
|
|
@@ -5980,7 +6368,7 @@ SubscriptIcon.displayName = "SubscriptIcon";
|
|
|
5980
6368
|
|
|
5981
6369
|
// src/components/tiptap-icons/superscript-icon.tsx
|
|
5982
6370
|
import { memo as memo31 } from "react";
|
|
5983
|
-
import { jsx as
|
|
6371
|
+
import { jsx as jsx65, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
5984
6372
|
var SuperscriptIcon = memo31(({ className, ...props }) => {
|
|
5985
6373
|
return /* @__PURE__ */ jsxs37(
|
|
5986
6374
|
"svg",
|
|
@@ -5993,7 +6381,7 @@ var SuperscriptIcon = memo31(({ className, ...props }) => {
|
|
|
5993
6381
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5994
6382
|
...props,
|
|
5995
6383
|
children: [
|
|
5996
|
-
/* @__PURE__ */
|
|
6384
|
+
/* @__PURE__ */ jsx65(
|
|
5997
6385
|
"path",
|
|
5998
6386
|
{
|
|
5999
6387
|
fillRule: "evenodd",
|
|
@@ -6002,7 +6390,7 @@ var SuperscriptIcon = memo31(({ className, ...props }) => {
|
|
|
6002
6390
|
fill: "currentColor"
|
|
6003
6391
|
}
|
|
6004
6392
|
),
|
|
6005
|
-
/* @__PURE__ */
|
|
6393
|
+
/* @__PURE__ */ jsx65(
|
|
6006
6394
|
"path",
|
|
6007
6395
|
{
|
|
6008
6396
|
fillRule: "evenodd",
|
|
@@ -6011,7 +6399,7 @@ var SuperscriptIcon = memo31(({ className, ...props }) => {
|
|
|
6011
6399
|
fill: "currentColor"
|
|
6012
6400
|
}
|
|
6013
6401
|
),
|
|
6014
|
-
/* @__PURE__ */
|
|
6402
|
+
/* @__PURE__ */ jsx65(
|
|
6015
6403
|
"path",
|
|
6016
6404
|
{
|
|
6017
6405
|
fillRule: "evenodd",
|
|
@@ -6028,9 +6416,9 @@ SuperscriptIcon.displayName = "SuperscriptIcon";
|
|
|
6028
6416
|
|
|
6029
6417
|
// src/components/tiptap-icons/underline-icon.tsx
|
|
6030
6418
|
import { memo as memo32 } from "react";
|
|
6031
|
-
import { jsx as
|
|
6419
|
+
import { jsx as jsx66 } from "react/jsx-runtime";
|
|
6032
6420
|
var UnderlineIcon = memo32(({ className, ...props }) => {
|
|
6033
|
-
return /* @__PURE__ */
|
|
6421
|
+
return /* @__PURE__ */ jsx66(
|
|
6034
6422
|
"svg",
|
|
6035
6423
|
{
|
|
6036
6424
|
width: "24",
|
|
@@ -6040,7 +6428,7 @@ var UnderlineIcon = memo32(({ className, ...props }) => {
|
|
|
6040
6428
|
fill: "currentColor",
|
|
6041
6429
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6042
6430
|
...props,
|
|
6043
|
-
children: /* @__PURE__ */
|
|
6431
|
+
children: /* @__PURE__ */ jsx66(
|
|
6044
6432
|
"path",
|
|
6045
6433
|
{
|
|
6046
6434
|
fillRule: "evenodd",
|
|
@@ -6143,12 +6531,12 @@ function useMark(config) {
|
|
|
6143
6531
|
|
|
6144
6532
|
// src/components/tiptap-ui/text-align-button/text-align-button.tsx
|
|
6145
6533
|
import { forwardRef as forwardRef17, useCallback as useCallback24 } from "react";
|
|
6146
|
-
import { Fragment as Fragment10, jsx as
|
|
6534
|
+
import { Fragment as Fragment10, jsx as jsx67, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
6147
6535
|
function TextAlignShortcutBadge({
|
|
6148
6536
|
align,
|
|
6149
6537
|
shortcutKeys = TEXT_ALIGN_SHORTCUT_KEYS[align]
|
|
6150
6538
|
}) {
|
|
6151
|
-
return /* @__PURE__ */
|
|
6539
|
+
return /* @__PURE__ */ jsx67(Badge, { children: parseShortcutKeys({ shortcutKeys }) });
|
|
6152
6540
|
}
|
|
6153
6541
|
var TextAlignButton = forwardRef17(
|
|
6154
6542
|
({
|
|
@@ -6190,7 +6578,7 @@ var TextAlignButton = forwardRef17(
|
|
|
6190
6578
|
return null;
|
|
6191
6579
|
}
|
|
6192
6580
|
const RenderIcon = CustomIcon ?? Icon;
|
|
6193
|
-
return /* @__PURE__ */
|
|
6581
|
+
return /* @__PURE__ */ jsx67(
|
|
6194
6582
|
Button2,
|
|
6195
6583
|
{
|
|
6196
6584
|
type: "button",
|
|
@@ -6207,9 +6595,9 @@ var TextAlignButton = forwardRef17(
|
|
|
6207
6595
|
...buttonProps,
|
|
6208
6596
|
ref,
|
|
6209
6597
|
children: children ?? /* @__PURE__ */ jsxs38(Fragment10, { children: [
|
|
6210
|
-
/* @__PURE__ */
|
|
6211
|
-
text && /* @__PURE__ */
|
|
6212
|
-
showShortcut && /* @__PURE__ */
|
|
6598
|
+
/* @__PURE__ */ jsx67(RenderIcon, { className: "tiptap-button-icon" }),
|
|
6599
|
+
text && /* @__PURE__ */ jsx67("span", { className: "tiptap-button-text", children: text }),
|
|
6600
|
+
showShortcut && /* @__PURE__ */ jsx67(
|
|
6213
6601
|
TextAlignShortcutBadge,
|
|
6214
6602
|
{
|
|
6215
6603
|
align,
|
|
@@ -6228,7 +6616,7 @@ import { useCallback as useCallback25, useEffect as useEffect16, useState as use
|
|
|
6228
6616
|
|
|
6229
6617
|
// src/components/tiptap-icons/align-center-icon.tsx
|
|
6230
6618
|
import { memo as memo33 } from "react";
|
|
6231
|
-
import { jsx as
|
|
6619
|
+
import { jsx as jsx68, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
6232
6620
|
var AlignCenterIcon = memo33(({ className, ...props }) => {
|
|
6233
6621
|
return /* @__PURE__ */ jsxs39(
|
|
6234
6622
|
"svg",
|
|
@@ -6241,7 +6629,7 @@ var AlignCenterIcon = memo33(({ className, ...props }) => {
|
|
|
6241
6629
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6242
6630
|
...props,
|
|
6243
6631
|
children: [
|
|
6244
|
-
/* @__PURE__ */
|
|
6632
|
+
/* @__PURE__ */ jsx68(
|
|
6245
6633
|
"path",
|
|
6246
6634
|
{
|
|
6247
6635
|
fillRule: "evenodd",
|
|
@@ -6250,7 +6638,7 @@ var AlignCenterIcon = memo33(({ className, ...props }) => {
|
|
|
6250
6638
|
fill: "currentColor"
|
|
6251
6639
|
}
|
|
6252
6640
|
),
|
|
6253
|
-
/* @__PURE__ */
|
|
6641
|
+
/* @__PURE__ */ jsx68(
|
|
6254
6642
|
"path",
|
|
6255
6643
|
{
|
|
6256
6644
|
fillRule: "evenodd",
|
|
@@ -6259,7 +6647,7 @@ var AlignCenterIcon = memo33(({ className, ...props }) => {
|
|
|
6259
6647
|
fill: "currentColor"
|
|
6260
6648
|
}
|
|
6261
6649
|
),
|
|
6262
|
-
/* @__PURE__ */
|
|
6650
|
+
/* @__PURE__ */ jsx68(
|
|
6263
6651
|
"path",
|
|
6264
6652
|
{
|
|
6265
6653
|
fillRule: "evenodd",
|
|
@@ -6276,7 +6664,7 @@ AlignCenterIcon.displayName = "AlignCenterIcon";
|
|
|
6276
6664
|
|
|
6277
6665
|
// src/components/tiptap-icons/align-justify-icon.tsx
|
|
6278
6666
|
import { memo as memo34 } from "react";
|
|
6279
|
-
import { jsx as
|
|
6667
|
+
import { jsx as jsx69, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
6280
6668
|
var AlignJustifyIcon = memo34(({ className, ...props }) => {
|
|
6281
6669
|
return /* @__PURE__ */ jsxs40(
|
|
6282
6670
|
"svg",
|
|
@@ -6289,7 +6677,7 @@ var AlignJustifyIcon = memo34(({ className, ...props }) => {
|
|
|
6289
6677
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6290
6678
|
...props,
|
|
6291
6679
|
children: [
|
|
6292
|
-
/* @__PURE__ */
|
|
6680
|
+
/* @__PURE__ */ jsx69(
|
|
6293
6681
|
"path",
|
|
6294
6682
|
{
|
|
6295
6683
|
fillRule: "evenodd",
|
|
@@ -6298,7 +6686,7 @@ var AlignJustifyIcon = memo34(({ className, ...props }) => {
|
|
|
6298
6686
|
fill: "currentColor"
|
|
6299
6687
|
}
|
|
6300
6688
|
),
|
|
6301
|
-
/* @__PURE__ */
|
|
6689
|
+
/* @__PURE__ */ jsx69(
|
|
6302
6690
|
"path",
|
|
6303
6691
|
{
|
|
6304
6692
|
fillRule: "evenodd",
|
|
@@ -6307,7 +6695,7 @@ var AlignJustifyIcon = memo34(({ className, ...props }) => {
|
|
|
6307
6695
|
fill: "currentColor"
|
|
6308
6696
|
}
|
|
6309
6697
|
),
|
|
6310
|
-
/* @__PURE__ */
|
|
6698
|
+
/* @__PURE__ */ jsx69(
|
|
6311
6699
|
"path",
|
|
6312
6700
|
{
|
|
6313
6701
|
fillRule: "evenodd",
|
|
@@ -6324,7 +6712,7 @@ AlignJustifyIcon.displayName = "AlignJustifyIcon";
|
|
|
6324
6712
|
|
|
6325
6713
|
// src/components/tiptap-icons/align-left-icon.tsx
|
|
6326
6714
|
import { memo as memo35 } from "react";
|
|
6327
|
-
import { jsx as
|
|
6715
|
+
import { jsx as jsx70, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
6328
6716
|
var AlignLeftIcon = memo35(({ className, ...props }) => {
|
|
6329
6717
|
return /* @__PURE__ */ jsxs41(
|
|
6330
6718
|
"svg",
|
|
@@ -6337,7 +6725,7 @@ var AlignLeftIcon = memo35(({ className, ...props }) => {
|
|
|
6337
6725
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6338
6726
|
...props,
|
|
6339
6727
|
children: [
|
|
6340
|
-
/* @__PURE__ */
|
|
6728
|
+
/* @__PURE__ */ jsx70(
|
|
6341
6729
|
"path",
|
|
6342
6730
|
{
|
|
6343
6731
|
fillRule: "evenodd",
|
|
@@ -6346,7 +6734,7 @@ var AlignLeftIcon = memo35(({ className, ...props }) => {
|
|
|
6346
6734
|
fill: "currentColor"
|
|
6347
6735
|
}
|
|
6348
6736
|
),
|
|
6349
|
-
/* @__PURE__ */
|
|
6737
|
+
/* @__PURE__ */ jsx70(
|
|
6350
6738
|
"path",
|
|
6351
6739
|
{
|
|
6352
6740
|
fillRule: "evenodd",
|
|
@@ -6355,7 +6743,7 @@ var AlignLeftIcon = memo35(({ className, ...props }) => {
|
|
|
6355
6743
|
fill: "currentColor"
|
|
6356
6744
|
}
|
|
6357
6745
|
),
|
|
6358
|
-
/* @__PURE__ */
|
|
6746
|
+
/* @__PURE__ */ jsx70(
|
|
6359
6747
|
"path",
|
|
6360
6748
|
{
|
|
6361
6749
|
fillRule: "evenodd",
|
|
@@ -6372,7 +6760,7 @@ AlignLeftIcon.displayName = "AlignLeftIcon";
|
|
|
6372
6760
|
|
|
6373
6761
|
// src/components/tiptap-icons/align-right-icon.tsx
|
|
6374
6762
|
import { memo as memo36 } from "react";
|
|
6375
|
-
import { jsx as
|
|
6763
|
+
import { jsx as jsx71, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
6376
6764
|
var AlignRightIcon = memo36(({ className, ...props }) => {
|
|
6377
6765
|
return /* @__PURE__ */ jsxs42(
|
|
6378
6766
|
"svg",
|
|
@@ -6385,7 +6773,7 @@ var AlignRightIcon = memo36(({ className, ...props }) => {
|
|
|
6385
6773
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6386
6774
|
...props,
|
|
6387
6775
|
children: [
|
|
6388
|
-
/* @__PURE__ */
|
|
6776
|
+
/* @__PURE__ */ jsx71(
|
|
6389
6777
|
"path",
|
|
6390
6778
|
{
|
|
6391
6779
|
fillRule: "evenodd",
|
|
@@ -6394,7 +6782,7 @@ var AlignRightIcon = memo36(({ className, ...props }) => {
|
|
|
6394
6782
|
fill: "currentColor"
|
|
6395
6783
|
}
|
|
6396
6784
|
),
|
|
6397
|
-
/* @__PURE__ */
|
|
6785
|
+
/* @__PURE__ */ jsx71(
|
|
6398
6786
|
"path",
|
|
6399
6787
|
{
|
|
6400
6788
|
fillRule: "evenodd",
|
|
@@ -6403,7 +6791,7 @@ var AlignRightIcon = memo36(({ className, ...props }) => {
|
|
|
6403
6791
|
fill: "currentColor"
|
|
6404
6792
|
}
|
|
6405
6793
|
),
|
|
6406
|
-
/* @__PURE__ */
|
|
6794
|
+
/* @__PURE__ */ jsx71(
|
|
6407
6795
|
"path",
|
|
6408
6796
|
{
|
|
6409
6797
|
fillRule: "evenodd",
|
|
@@ -6511,12 +6899,12 @@ function useTextAlign(config) {
|
|
|
6511
6899
|
|
|
6512
6900
|
// src/components/tiptap-ui/undo-redo-button/undo-redo-button.tsx
|
|
6513
6901
|
import { forwardRef as forwardRef18, useCallback as useCallback26 } from "react";
|
|
6514
|
-
import { Fragment as Fragment11, jsx as
|
|
6902
|
+
import { Fragment as Fragment11, jsx as jsx72, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
6515
6903
|
function HistoryShortcutBadge({
|
|
6516
6904
|
action,
|
|
6517
6905
|
shortcutKeys = UNDO_REDO_SHORTCUT_KEYS[action]
|
|
6518
6906
|
}) {
|
|
6519
|
-
return /* @__PURE__ */
|
|
6907
|
+
return /* @__PURE__ */ jsx72(Badge, { children: parseShortcutKeys({ shortcutKeys }) });
|
|
6520
6908
|
}
|
|
6521
6909
|
var UndoRedoButton = forwardRef18(
|
|
6522
6910
|
({
|
|
@@ -6548,7 +6936,7 @@ var UndoRedoButton = forwardRef18(
|
|
|
6548
6936
|
if (!isVisible) {
|
|
6549
6937
|
return null;
|
|
6550
6938
|
}
|
|
6551
|
-
return /* @__PURE__ */
|
|
6939
|
+
return /* @__PURE__ */ jsx72(
|
|
6552
6940
|
Button2,
|
|
6553
6941
|
{
|
|
6554
6942
|
type: "button",
|
|
@@ -6563,9 +6951,9 @@ var UndoRedoButton = forwardRef18(
|
|
|
6563
6951
|
...buttonProps,
|
|
6564
6952
|
ref,
|
|
6565
6953
|
children: children ?? /* @__PURE__ */ jsxs43(Fragment11, { children: [
|
|
6566
|
-
/* @__PURE__ */
|
|
6567
|
-
text && /* @__PURE__ */
|
|
6568
|
-
showShortcut && /* @__PURE__ */
|
|
6954
|
+
/* @__PURE__ */ jsx72(Icon, { className: "tiptap-button-icon" }),
|
|
6955
|
+
text && /* @__PURE__ */ jsx72("span", { className: "tiptap-button-text", children: text }),
|
|
6956
|
+
showShortcut && /* @__PURE__ */ jsx72(
|
|
6569
6957
|
HistoryShortcutBadge,
|
|
6570
6958
|
{
|
|
6571
6959
|
action,
|
|
@@ -6584,9 +6972,9 @@ import { useCallback as useCallback27, useEffect as useEffect17, useState as use
|
|
|
6584
6972
|
|
|
6585
6973
|
// src/components/tiptap-icons/redo2-icon.tsx
|
|
6586
6974
|
import { memo as memo37 } from "react";
|
|
6587
|
-
import { jsx as
|
|
6975
|
+
import { jsx as jsx73 } from "react/jsx-runtime";
|
|
6588
6976
|
var Redo2Icon = memo37(({ className, ...props }) => {
|
|
6589
|
-
return /* @__PURE__ */
|
|
6977
|
+
return /* @__PURE__ */ jsx73(
|
|
6590
6978
|
"svg",
|
|
6591
6979
|
{
|
|
6592
6980
|
width: "24",
|
|
@@ -6596,7 +6984,7 @@ var Redo2Icon = memo37(({ className, ...props }) => {
|
|
|
6596
6984
|
fill: "currentColor",
|
|
6597
6985
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6598
6986
|
...props,
|
|
6599
|
-
children: /* @__PURE__ */
|
|
6987
|
+
children: /* @__PURE__ */ jsx73(
|
|
6600
6988
|
"path",
|
|
6601
6989
|
{
|
|
6602
6990
|
fillRule: "evenodd",
|
|
@@ -6612,9 +7000,9 @@ Redo2Icon.displayName = "Redo2Icon";
|
|
|
6612
7000
|
|
|
6613
7001
|
// src/components/tiptap-icons/undo2-icon.tsx
|
|
6614
7002
|
import { memo as memo38 } from "react";
|
|
6615
|
-
import { jsx as
|
|
7003
|
+
import { jsx as jsx74 } from "react/jsx-runtime";
|
|
6616
7004
|
var Undo2Icon = memo38(({ className, ...props }) => {
|
|
6617
|
-
return /* @__PURE__ */
|
|
7005
|
+
return /* @__PURE__ */ jsx74(
|
|
6618
7006
|
"svg",
|
|
6619
7007
|
{
|
|
6620
7008
|
width: "24",
|
|
@@ -6624,7 +7012,7 @@ var Undo2Icon = memo38(({ className, ...props }) => {
|
|
|
6624
7012
|
fill: "currentColor",
|
|
6625
7013
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6626
7014
|
...props,
|
|
6627
|
-
children: /* @__PURE__ */
|
|
7015
|
+
children: /* @__PURE__ */ jsx74(
|
|
6628
7016
|
"path",
|
|
6629
7017
|
{
|
|
6630
7018
|
fillRule: "evenodd",
|
|
@@ -6900,12 +7288,12 @@ import { ChevronDown } from "lucide-react";
|
|
|
6900
7288
|
// src/components/ui/command.tsx
|
|
6901
7289
|
import { Command as CommandPrimitive } from "cmdk";
|
|
6902
7290
|
import { SearchIcon } from "lucide-react";
|
|
6903
|
-
import { jsx as
|
|
7291
|
+
import { jsx as jsx75, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
6904
7292
|
function Command({
|
|
6905
7293
|
className,
|
|
6906
7294
|
...props
|
|
6907
7295
|
}) {
|
|
6908
|
-
return /* @__PURE__ */
|
|
7296
|
+
return /* @__PURE__ */ jsx75(
|
|
6909
7297
|
CommandPrimitive,
|
|
6910
7298
|
{
|
|
6911
7299
|
"data-slot": "command",
|
|
@@ -6927,8 +7315,8 @@ function CommandInput({
|
|
|
6927
7315
|
"data-slot": "command-input-wrapper",
|
|
6928
7316
|
className: "flex h-9 items-center gap-2 border-b px-3",
|
|
6929
7317
|
children: [
|
|
6930
|
-
/* @__PURE__ */
|
|
6931
|
-
/* @__PURE__ */
|
|
7318
|
+
/* @__PURE__ */ jsx75(SearchIcon, { className: "size-4 shrink-0 opacity-50" }),
|
|
7319
|
+
/* @__PURE__ */ jsx75(
|
|
6932
7320
|
CommandPrimitive.Input,
|
|
6933
7321
|
{
|
|
6934
7322
|
"data-slot": "command-input",
|
|
@@ -6947,7 +7335,7 @@ function CommandList({
|
|
|
6947
7335
|
className,
|
|
6948
7336
|
...props
|
|
6949
7337
|
}) {
|
|
6950
|
-
return /* @__PURE__ */
|
|
7338
|
+
return /* @__PURE__ */ jsx75(
|
|
6951
7339
|
CommandPrimitive.List,
|
|
6952
7340
|
{
|
|
6953
7341
|
"data-slot": "command-list",
|
|
@@ -6962,7 +7350,7 @@ function CommandList({
|
|
|
6962
7350
|
function CommandEmpty({
|
|
6963
7351
|
...props
|
|
6964
7352
|
}) {
|
|
6965
|
-
return /* @__PURE__ */
|
|
7353
|
+
return /* @__PURE__ */ jsx75(
|
|
6966
7354
|
CommandPrimitive.Empty,
|
|
6967
7355
|
{
|
|
6968
7356
|
"data-slot": "command-empty",
|
|
@@ -6975,7 +7363,7 @@ function CommandGroup({
|
|
|
6975
7363
|
className,
|
|
6976
7364
|
...props
|
|
6977
7365
|
}) {
|
|
6978
|
-
return /* @__PURE__ */
|
|
7366
|
+
return /* @__PURE__ */ jsx75(
|
|
6979
7367
|
CommandPrimitive.Group,
|
|
6980
7368
|
{
|
|
6981
7369
|
"data-slot": "command-group",
|
|
@@ -6991,7 +7379,7 @@ function CommandItem({
|
|
|
6991
7379
|
className,
|
|
6992
7380
|
...props
|
|
6993
7381
|
}) {
|
|
6994
|
-
return /* @__PURE__ */
|
|
7382
|
+
return /* @__PURE__ */ jsx75(
|
|
6995
7383
|
CommandPrimitive.Item,
|
|
6996
7384
|
{
|
|
6997
7385
|
"data-slot": "command-item",
|
|
@@ -7006,16 +7394,16 @@ function CommandItem({
|
|
|
7006
7394
|
|
|
7007
7395
|
// src/components/ui/popover.tsx
|
|
7008
7396
|
import * as PopoverPrimitive2 from "@radix-ui/react-popover";
|
|
7009
|
-
import { jsx as
|
|
7397
|
+
import { jsx as jsx76 } from "react/jsx-runtime";
|
|
7010
7398
|
function Popover2({
|
|
7011
7399
|
...props
|
|
7012
7400
|
}) {
|
|
7013
|
-
return /* @__PURE__ */
|
|
7401
|
+
return /* @__PURE__ */ jsx76(PopoverPrimitive2.Root, { "data-slot": "popover", ...props });
|
|
7014
7402
|
}
|
|
7015
7403
|
function PopoverTrigger2({
|
|
7016
7404
|
...props
|
|
7017
7405
|
}) {
|
|
7018
|
-
return /* @__PURE__ */
|
|
7406
|
+
return /* @__PURE__ */ jsx76(PopoverPrimitive2.Trigger, { "data-slot": "popover-trigger", ...props });
|
|
7019
7407
|
}
|
|
7020
7408
|
function PopoverContent2({
|
|
7021
7409
|
className,
|
|
@@ -7023,7 +7411,7 @@ function PopoverContent2({
|
|
|
7023
7411
|
sideOffset = 4,
|
|
7024
7412
|
...props
|
|
7025
7413
|
}) {
|
|
7026
|
-
return /* @__PURE__ */
|
|
7414
|
+
return /* @__PURE__ */ jsx76(PopoverPrimitive2.Portal, { children: /* @__PURE__ */ jsx76(
|
|
7027
7415
|
PopoverPrimitive2.Content,
|
|
7028
7416
|
{
|
|
7029
7417
|
"data-slot": "popover-content",
|
|
@@ -7039,66 +7427,15 @@ function PopoverContent2({
|
|
|
7039
7427
|
}
|
|
7040
7428
|
|
|
7041
7429
|
// src/components/tiptap-ui/font-family-dropdown/font-family-dropdown.tsx
|
|
7042
|
-
import { jsx as
|
|
7430
|
+
import { jsx as jsx77, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
7043
7431
|
function FontFamilyDropdown() {
|
|
7044
7432
|
const { editor } = useCurrentEditor3();
|
|
7045
7433
|
const [open, setOpen] = useState28(false);
|
|
7046
|
-
const [selectedFont, setSelectedFont] = useState28(null);
|
|
7047
7434
|
useEffect18(() => {
|
|
7048
7435
|
loadGoogleFonts();
|
|
7049
7436
|
}, []);
|
|
7050
|
-
useEffect18(() => {
|
|
7051
|
-
if (!editor || !selectedFont) return;
|
|
7052
|
-
const handleUpdate = () => {
|
|
7053
|
-
const currentFontFamily2 = editor.getAttributes("textStyle").fontFamily;
|
|
7054
|
-
if (!currentFontFamily2) {
|
|
7055
|
-
requestAnimationFrame(() => {
|
|
7056
|
-
editor.commands.setFontFamily(selectedFont);
|
|
7057
|
-
});
|
|
7058
|
-
}
|
|
7059
|
-
};
|
|
7060
|
-
const handleSelectionUpdate = () => {
|
|
7061
|
-
const currentFontFamily2 = editor.getAttributes("textStyle").fontFamily;
|
|
7062
|
-
if (!currentFontFamily2 && selectedFont) {
|
|
7063
|
-
requestAnimationFrame(() => {
|
|
7064
|
-
editor.commands.setFontFamily(selectedFont);
|
|
7065
|
-
});
|
|
7066
|
-
}
|
|
7067
|
-
};
|
|
7068
|
-
const handleTransaction = ({ transaction }) => {
|
|
7069
|
-
const isBlockChange = transaction.steps.some((step) => {
|
|
7070
|
-
return step.slice?.content?.content?.some(
|
|
7071
|
-
(node) => ["heading", "bulletList", "orderedList", "blockquote", "codeBlock"].includes(node.type?.name)
|
|
7072
|
-
);
|
|
7073
|
-
});
|
|
7074
|
-
if (isBlockChange && selectedFont) {
|
|
7075
|
-
requestAnimationFrame(() => {
|
|
7076
|
-
editor.commands.setFontFamily(selectedFont);
|
|
7077
|
-
});
|
|
7078
|
-
}
|
|
7079
|
-
};
|
|
7080
|
-
editor.on("update", handleUpdate);
|
|
7081
|
-
editor.on("selectionUpdate", handleSelectionUpdate);
|
|
7082
|
-
editor.on("transaction", handleTransaction);
|
|
7083
|
-
return () => {
|
|
7084
|
-
editor.off("update", handleUpdate);
|
|
7085
|
-
editor.off("selectionUpdate", handleSelectionUpdate);
|
|
7086
|
-
editor.off("transaction", handleTransaction);
|
|
7087
|
-
};
|
|
7088
|
-
}, [editor, selectedFont]);
|
|
7089
|
-
useEffect18(() => {
|
|
7090
|
-
if (!editor || !selectedFont) return;
|
|
7091
|
-
const { state } = editor;
|
|
7092
|
-
const { schema } = state;
|
|
7093
|
-
const textStyleMark = schema.marks.textStyle;
|
|
7094
|
-
if (textStyleMark) {
|
|
7095
|
-
const mark = textStyleMark.create({ fontFamily: selectedFont });
|
|
7096
|
-
const tr = state.tr.addStoredMark(mark);
|
|
7097
|
-
editor.view.dispatch(tr);
|
|
7098
|
-
}
|
|
7099
|
-
}, [editor, selectedFont]);
|
|
7100
7437
|
if (!editor) return null;
|
|
7101
|
-
const currentFontFamily = editor.getAttributes("textStyle").fontFamily
|
|
7438
|
+
const currentFontFamily = editor.getAttributes("textStyle").fontFamily;
|
|
7102
7439
|
const getCurrentFontLabel = () => {
|
|
7103
7440
|
if (!currentFontFamily) return "Font Family";
|
|
7104
7441
|
const matchedFont = FONT_OPTIONS.find(
|
|
@@ -7109,50 +7446,26 @@ function FontFamilyDropdown() {
|
|
|
7109
7446
|
const currentFont = getCurrentFontLabel();
|
|
7110
7447
|
const applyFont = (family) => {
|
|
7111
7448
|
if (!editor) return;
|
|
7112
|
-
|
|
7113
|
-
if (
|
|
7114
|
-
|
|
7115
|
-
|
|
7116
|
-
editor.view.dispatch(editor.state.tr.removeStoredMark(textStyleMark2));
|
|
7117
|
-
}
|
|
7118
|
-
}
|
|
7119
|
-
editor.chain().focus().setFontFamily(family).run();
|
|
7120
|
-
const { state } = editor;
|
|
7121
|
-
const { schema } = state;
|
|
7122
|
-
const textStyleMark = schema.marks.textStyle;
|
|
7123
|
-
if (textStyleMark) {
|
|
7124
|
-
const mark = textStyleMark.create({ fontFamily: family });
|
|
7125
|
-
const tr = state.tr.addStoredMark(mark);
|
|
7126
|
-
editor.view.dispatch(tr);
|
|
7127
|
-
}
|
|
7128
|
-
};
|
|
7129
|
-
const resetFont = () => {
|
|
7130
|
-
if (!editor) return;
|
|
7131
|
-
setSelectedFont(null);
|
|
7132
|
-
if (editor.state.storedMarks) {
|
|
7133
|
-
const textStyleMark = editor.schema.marks.textStyle;
|
|
7134
|
-
if (textStyleMark) {
|
|
7135
|
-
editor.view.dispatch(
|
|
7136
|
-
editor.state.tr.removeStoredMark(textStyleMark)
|
|
7137
|
-
);
|
|
7138
|
-
}
|
|
7449
|
+
const { from, to } = editor.state.selection;
|
|
7450
|
+
if (from === to) {
|
|
7451
|
+
editor.chain().focus().setFontFamily(family).run();
|
|
7452
|
+
return;
|
|
7139
7453
|
}
|
|
7140
|
-
editor.chain().focus().
|
|
7141
|
-
setOpen(false);
|
|
7454
|
+
editor.chain().focus().setMark("textStyle", { fontFamily: family }).run();
|
|
7142
7455
|
};
|
|
7143
7456
|
return /* @__PURE__ */ jsxs45(Popover2, { open, onOpenChange: setOpen, children: [
|
|
7144
|
-
/* @__PURE__ */
|
|
7457
|
+
/* @__PURE__ */ jsx77(PopoverTrigger2, { asChild: true, children: /* @__PURE__ */ jsxs45(
|
|
7145
7458
|
Button,
|
|
7146
7459
|
{
|
|
7147
7460
|
variant: "outlineFontFamily",
|
|
7148
7461
|
className: "min-w-[90px] h-7 px-2 flex items-center justify-between rounded-sm border-[#a3a3a8] text-[#a3a3a8] hover:border-[#000] hover:text-[#fff] transition-colors",
|
|
7149
7462
|
children: [
|
|
7150
7463
|
currentFont,
|
|
7151
|
-
/* @__PURE__ */
|
|
7464
|
+
/* @__PURE__ */ jsx77(ChevronDown, { className: "w-4 h-4" })
|
|
7152
7465
|
]
|
|
7153
7466
|
}
|
|
7154
7467
|
) }),
|
|
7155
|
-
/* @__PURE__ */
|
|
7468
|
+
/* @__PURE__ */ jsx77(
|
|
7156
7469
|
PopoverContent2,
|
|
7157
7470
|
{
|
|
7158
7471
|
className: "w-[300px] p-0",
|
|
@@ -7164,20 +7477,29 @@ function FontFamilyDropdown() {
|
|
|
7164
7477
|
}
|
|
7165
7478
|
},
|
|
7166
7479
|
children: /* @__PURE__ */ jsxs45(Command, { children: [
|
|
7167
|
-
/* @__PURE__ */
|
|
7480
|
+
/* @__PURE__ */ jsx77("div", { className: "cmd-input-wrapper", children: /* @__PURE__ */ jsx77(CommandInput, { placeholder: "Search font..." }) }),
|
|
7168
7481
|
/* @__PURE__ */ jsxs45(CommandList, { className: "max-h-[220px]", children: [
|
|
7169
|
-
/* @__PURE__ */
|
|
7482
|
+
/* @__PURE__ */ jsx77(CommandEmpty, { children: "No font found." }),
|
|
7170
7483
|
/* @__PURE__ */ jsxs45(CommandGroup, { children: [
|
|
7171
|
-
/* @__PURE__ */
|
|
7484
|
+
/* @__PURE__ */ jsx77(
|
|
7172
7485
|
CommandItem,
|
|
7173
7486
|
{
|
|
7174
|
-
onSelect:
|
|
7487
|
+
onSelect: () => {
|
|
7488
|
+
if (!editor) return;
|
|
7489
|
+
const { from, to } = editor.state.selection;
|
|
7490
|
+
if (from === to) {
|
|
7491
|
+
editor.chain().focus().unsetFontFamily().run();
|
|
7492
|
+
} else {
|
|
7493
|
+
editor.chain().focus().unsetMark("textStyle", { extendEmptyMarkRange: true }).run();
|
|
7494
|
+
}
|
|
7495
|
+
setOpen(false);
|
|
7496
|
+
},
|
|
7175
7497
|
className: "font-sans",
|
|
7176
7498
|
children: "Default"
|
|
7177
7499
|
},
|
|
7178
7500
|
"default"
|
|
7179
7501
|
),
|
|
7180
|
-
FONT_OPTIONS.map(({ label, cssFontFamily }) => /* @__PURE__ */
|
|
7502
|
+
FONT_OPTIONS.map(({ label, cssFontFamily }) => /* @__PURE__ */ jsx77(
|
|
7181
7503
|
CommandItem,
|
|
7182
7504
|
{
|
|
7183
7505
|
onSelect: () => {
|
|
@@ -7205,12 +7527,12 @@ import { debounce } from "lodash";
|
|
|
7205
7527
|
|
|
7206
7528
|
// src/components/ui/label.tsx
|
|
7207
7529
|
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
7208
|
-
import { jsx as
|
|
7530
|
+
import { jsx as jsx78 } from "react/jsx-runtime";
|
|
7209
7531
|
function Label({
|
|
7210
7532
|
className,
|
|
7211
7533
|
...props
|
|
7212
7534
|
}) {
|
|
7213
|
-
return /* @__PURE__ */
|
|
7535
|
+
return /* @__PURE__ */ jsx78(
|
|
7214
7536
|
LabelPrimitive.Root,
|
|
7215
7537
|
{
|
|
7216
7538
|
"data-slot": "label",
|
|
@@ -7225,7 +7547,7 @@ function Label({
|
|
|
7225
7547
|
|
|
7226
7548
|
// src/components/tiptap-ui/color-picker/color-picker.tsx
|
|
7227
7549
|
import React4 from "react";
|
|
7228
|
-
import { jsx as
|
|
7550
|
+
import { jsx as jsx79, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
7229
7551
|
function ColorPicker({ type = "text" }) {
|
|
7230
7552
|
const { editor } = useCurrentEditor4();
|
|
7231
7553
|
const [open, setOpen] = useState29(false);
|
|
@@ -7276,14 +7598,14 @@ function ColorPicker({ type = "text" }) {
|
|
|
7276
7598
|
);
|
|
7277
7599
|
if (!editor) return null;
|
|
7278
7600
|
return /* @__PURE__ */ jsxs46(Popover2, { open, onOpenChange: (v) => setOpen(v), children: [
|
|
7279
|
-
/* @__PURE__ */
|
|
7601
|
+
/* @__PURE__ */ jsx79(PopoverTrigger2, { asChild: true, children: /* @__PURE__ */ jsxs46(
|
|
7280
7602
|
Button,
|
|
7281
7603
|
{
|
|
7282
7604
|
variant: "outlineFontFamily",
|
|
7283
7605
|
className: "flex items-center h-7 rounded-sm px-2 border-[#a3a3a8] text-[#a3a3a8] hover:text-white",
|
|
7284
7606
|
children: [
|
|
7285
7607
|
"Color",
|
|
7286
|
-
/* @__PURE__ */
|
|
7608
|
+
/* @__PURE__ */ jsx79(
|
|
7287
7609
|
"span",
|
|
7288
7610
|
{
|
|
7289
7611
|
className: "w-3 h-3 ml-2 rounded-sm border border-black/20",
|
|
@@ -7300,9 +7622,9 @@ function ColorPicker({ type = "text" }) {
|
|
|
7300
7622
|
align: "start",
|
|
7301
7623
|
onClick: (e) => e.stopPropagation(),
|
|
7302
7624
|
children: [
|
|
7303
|
-
/* @__PURE__ */
|
|
7625
|
+
/* @__PURE__ */ jsx79(Label, { className: "text-xs mb-2", children: type === "text" ? "Text Color" : "Highlight Color" }),
|
|
7304
7626
|
!showCustom && /* @__PURE__ */ jsxs46("div", { className: "flex flex-col gap-3", children: [
|
|
7305
|
-
/* @__PURE__ */
|
|
7627
|
+
/* @__PURE__ */ jsx79("div", { className: "grid grid-cols-7 gap-1", children: GRADIENT_ROWS_70.map((c) => /* @__PURE__ */ jsx79(
|
|
7306
7628
|
"div",
|
|
7307
7629
|
{
|
|
7308
7630
|
onClick: () => {
|
|
@@ -7314,7 +7636,7 @@ function ColorPicker({ type = "text" }) {
|
|
|
7314
7636
|
},
|
|
7315
7637
|
c
|
|
7316
7638
|
)) }),
|
|
7317
|
-
/* @__PURE__ */
|
|
7639
|
+
/* @__PURE__ */ jsx79(
|
|
7318
7640
|
Button,
|
|
7319
7641
|
{
|
|
7320
7642
|
size: "sm",
|
|
@@ -7338,7 +7660,7 @@ function ColorPicker({ type = "text" }) {
|
|
|
7338
7660
|
onPointerUp: (e) => e.stopPropagation(),
|
|
7339
7661
|
onClick: (e) => e.stopPropagation(),
|
|
7340
7662
|
children: [
|
|
7341
|
-
/* @__PURE__ */
|
|
7663
|
+
/* @__PURE__ */ jsx79(
|
|
7342
7664
|
HexColorPicker,
|
|
7343
7665
|
{
|
|
7344
7666
|
color: tempHex,
|
|
@@ -7350,7 +7672,7 @@ function ColorPicker({ type = "text" }) {
|
|
|
7350
7672
|
}
|
|
7351
7673
|
),
|
|
7352
7674
|
/* @__PURE__ */ jsxs46("div", { className: "flex gap-2 items-center", children: [
|
|
7353
|
-
/* @__PURE__ */
|
|
7675
|
+
/* @__PURE__ */ jsx79(
|
|
7354
7676
|
"input",
|
|
7355
7677
|
{
|
|
7356
7678
|
value: tempHex,
|
|
@@ -7361,7 +7683,7 @@ function ColorPicker({ type = "text" }) {
|
|
|
7361
7683
|
className: "w-full px-2 py-1 border rounded text-sm"
|
|
7362
7684
|
}
|
|
7363
7685
|
),
|
|
7364
|
-
/* @__PURE__ */
|
|
7686
|
+
/* @__PURE__ */ jsx79(
|
|
7365
7687
|
Button,
|
|
7366
7688
|
{
|
|
7367
7689
|
size: "sm",
|
|
@@ -7374,7 +7696,7 @@ function ColorPicker({ type = "text" }) {
|
|
|
7374
7696
|
}
|
|
7375
7697
|
)
|
|
7376
7698
|
] }),
|
|
7377
|
-
/* @__PURE__ */
|
|
7699
|
+
/* @__PURE__ */ jsx79("div", { className: "flex justify-end mt-2", children: /* @__PURE__ */ jsx79(
|
|
7378
7700
|
Button,
|
|
7379
7701
|
{
|
|
7380
7702
|
size: "sm",
|
|
@@ -7402,7 +7724,7 @@ function ColorPicker({ type = "text" }) {
|
|
|
7402
7724
|
import { useState as useState30 } from "react";
|
|
7403
7725
|
import { useCurrentEditor as useCurrentEditor5 } from "@tiptap/react";
|
|
7404
7726
|
import { FiTable } from "react-icons/fi";
|
|
7405
|
-
import { jsx as
|
|
7727
|
+
import { jsx as jsx80, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
7406
7728
|
function TableDropdownMenu() {
|
|
7407
7729
|
const { editor } = useCurrentEditor5();
|
|
7408
7730
|
const [open, setOpen] = useState30(false);
|
|
@@ -7445,20 +7767,20 @@ function TableDropdownMenu() {
|
|
|
7445
7767
|
setOpen(false);
|
|
7446
7768
|
};
|
|
7447
7769
|
return /* @__PURE__ */ jsxs47(Popover2, { open, onOpenChange: setOpen, children: [
|
|
7448
|
-
/* @__PURE__ */
|
|
7449
|
-
/* @__PURE__ */
|
|
7450
|
-
/* @__PURE__ */
|
|
7451
|
-
/* @__PURE__ */
|
|
7452
|
-
/* @__PURE__ */
|
|
7453
|
-
/* @__PURE__ */
|
|
7454
|
-
/* @__PURE__ */
|
|
7455
|
-
/* @__PURE__ */
|
|
7456
|
-
/* @__PURE__ */
|
|
7457
|
-
/* @__PURE__ */
|
|
7458
|
-
/* @__PURE__ */
|
|
7459
|
-
/* @__PURE__ */
|
|
7460
|
-
/* @__PURE__ */
|
|
7461
|
-
/* @__PURE__ */
|
|
7770
|
+
/* @__PURE__ */ jsx80(PopoverTrigger2, { asChild: true, children: /* @__PURE__ */ jsx80(Button, { variant: "tableButton", size: "sm", children: /* @__PURE__ */ jsx80(FiTable, { size: 16, color: "#a3a3a8" }) }) }),
|
|
7771
|
+
/* @__PURE__ */ jsx80(PopoverContent2, { className: "w-[220px] p-0", align: "start", children: /* @__PURE__ */ jsxs47(Command, { children: [
|
|
7772
|
+
/* @__PURE__ */ jsx80(CommandInput, { placeholder: "Search table actions..." }),
|
|
7773
|
+
/* @__PURE__ */ jsx80(CommandList, { className: "max-h-[260px]", children: /* @__PURE__ */ jsxs47(CommandGroup, { children: [
|
|
7774
|
+
/* @__PURE__ */ jsx80(CommandItem, { onSelect: () => handleAction("insert"), children: "Insert Table" }),
|
|
7775
|
+
/* @__PURE__ */ jsx80(CommandItem, { onSelect: () => handleAction("addColBefore"), children: "Add Column Before" }),
|
|
7776
|
+
/* @__PURE__ */ jsx80(CommandItem, { onSelect: () => handleAction("addColAfter"), children: "Add Column After" }),
|
|
7777
|
+
/* @__PURE__ */ jsx80(CommandItem, { onSelect: () => handleAction("delCol"), children: "Delete Column" }),
|
|
7778
|
+
/* @__PURE__ */ jsx80(CommandItem, { onSelect: () => handleAction("addRowBefore"), children: "Add Row Before" }),
|
|
7779
|
+
/* @__PURE__ */ jsx80(CommandItem, { onSelect: () => handleAction("addRowAfter"), children: "Add Row After" }),
|
|
7780
|
+
/* @__PURE__ */ jsx80(CommandItem, { onSelect: () => handleAction("delRow"), children: "Delete Row" }),
|
|
7781
|
+
/* @__PURE__ */ jsx80(CommandItem, { onSelect: () => handleAction("merge"), children: "Merge Cells" }),
|
|
7782
|
+
/* @__PURE__ */ jsx80(CommandItem, { onSelect: () => handleAction("split"), children: "Split Cells" }),
|
|
7783
|
+
/* @__PURE__ */ jsx80(CommandItem, { onSelect: () => handleAction("deleteTable"), children: "Delete Table" })
|
|
7462
7784
|
] }) })
|
|
7463
7785
|
] }) })
|
|
7464
7786
|
] });
|
|
@@ -7466,9 +7788,9 @@ function TableDropdownMenu() {
|
|
|
7466
7788
|
|
|
7467
7789
|
// src/components/tiptap-icons/arrow-left-icon.tsx
|
|
7468
7790
|
import { memo as memo39 } from "react";
|
|
7469
|
-
import { jsx as
|
|
7791
|
+
import { jsx as jsx81 } from "react/jsx-runtime";
|
|
7470
7792
|
var ArrowLeftIcon = memo39(({ className, ...props }) => {
|
|
7471
|
-
return /* @__PURE__ */
|
|
7793
|
+
return /* @__PURE__ */ jsx81(
|
|
7472
7794
|
"svg",
|
|
7473
7795
|
{
|
|
7474
7796
|
width: "24",
|
|
@@ -7478,7 +7800,7 @@ var ArrowLeftIcon = memo39(({ className, ...props }) => {
|
|
|
7478
7800
|
fill: "currentColor",
|
|
7479
7801
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7480
7802
|
...props,
|
|
7481
|
-
children: /* @__PURE__ */
|
|
7803
|
+
children: /* @__PURE__ */ jsx81(
|
|
7482
7804
|
"path",
|
|
7483
7805
|
{
|
|
7484
7806
|
d: "M12.7071 5.70711C13.0976 5.31658 13.0976 4.68342 12.7071 4.29289C12.3166 3.90237 11.6834 3.90237 11.2929 4.29289L4.29289 11.2929C3.90237 11.6834 3.90237 12.3166 4.29289 12.7071L11.2929 19.7071C11.6834 20.0976 12.3166 20.0976 12.7071 19.7071C13.0976 19.3166 13.0976 18.6834 12.7071 18.2929L7.41421 13L19 13C19.5523 13 20 12.5523 20 12C20 11.4477 19.5523 11 19 11L7.41421 11L12.7071 5.70711Z",
|
|
@@ -7704,62 +8026,62 @@ function useCursorVisibility({
|
|
|
7704
8026
|
}
|
|
7705
8027
|
|
|
7706
8028
|
// src/components/tiptap-templates/simple/simple-editor.tsx
|
|
7707
|
-
import { Fragment as Fragment12, jsx as
|
|
8029
|
+
import { Fragment as Fragment12, jsx as jsx82, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
7708
8030
|
var MainToolbarContent = ({
|
|
7709
8031
|
onHighlighterClick,
|
|
7710
8032
|
onLinkClick,
|
|
7711
8033
|
isMobile
|
|
7712
8034
|
}) => {
|
|
7713
8035
|
return /* @__PURE__ */ jsxs48(Fragment12, { children: [
|
|
7714
|
-
/* @__PURE__ */
|
|
7715
|
-
/* @__PURE__ */
|
|
7716
|
-
/* @__PURE__ */
|
|
8036
|
+
/* @__PURE__ */ jsx82(Spacer, {}),
|
|
8037
|
+
/* @__PURE__ */ jsx82(FontFamilyDropdown, {}),
|
|
8038
|
+
/* @__PURE__ */ jsx82(ColorPicker, { type: "text" }),
|
|
7717
8039
|
/* @__PURE__ */ jsxs48(ToolbarGroup, { children: [
|
|
7718
|
-
/* @__PURE__ */
|
|
7719
|
-
/* @__PURE__ */
|
|
7720
|
-
/* @__PURE__ */
|
|
7721
|
-
/* @__PURE__ */
|
|
7722
|
-
/* @__PURE__ */
|
|
7723
|
-
/* @__PURE__ */
|
|
7724
|
-
/* @__PURE__ */
|
|
8040
|
+
/* @__PURE__ */ jsx82(MarkButton, { type: "bold" }),
|
|
8041
|
+
/* @__PURE__ */ jsx82(MarkButton, { type: "italic" }),
|
|
8042
|
+
/* @__PURE__ */ jsx82(MarkButton, { type: "strike" }),
|
|
8043
|
+
/* @__PURE__ */ jsx82(MarkButton, { type: "code" }),
|
|
8044
|
+
/* @__PURE__ */ jsx82(MarkButton, { type: "underline" }),
|
|
8045
|
+
/* @__PURE__ */ jsx82(UndoRedoButton, { action: "undo" }),
|
|
8046
|
+
/* @__PURE__ */ jsx82(UndoRedoButton, { action: "redo" })
|
|
7725
8047
|
] }),
|
|
7726
|
-
/* @__PURE__ */
|
|
8048
|
+
/* @__PURE__ */ jsx82(ToolbarSeparator, {}),
|
|
7727
8049
|
/* @__PURE__ */ jsxs48(ToolbarGroup, { children: [
|
|
7728
|
-
/* @__PURE__ */
|
|
7729
|
-
/* @__PURE__ */
|
|
7730
|
-
/* @__PURE__ */
|
|
7731
|
-
/* @__PURE__ */
|
|
8050
|
+
/* @__PURE__ */ jsx82(TextAlignButton, { align: "left" }),
|
|
8051
|
+
/* @__PURE__ */ jsx82(TextAlignButton, { align: "center" }),
|
|
8052
|
+
/* @__PURE__ */ jsx82(TextAlignButton, { align: "right" }),
|
|
8053
|
+
/* @__PURE__ */ jsx82(TextAlignButton, { align: "justify" })
|
|
7732
8054
|
] }),
|
|
7733
|
-
/* @__PURE__ */
|
|
8055
|
+
/* @__PURE__ */ jsx82(ToolbarSeparator, {}),
|
|
7734
8056
|
/* @__PURE__ */ jsxs48(ToolbarGroup, { children: [
|
|
7735
|
-
/* @__PURE__ */
|
|
7736
|
-
/* @__PURE__ */
|
|
8057
|
+
/* @__PURE__ */ jsx82(HeadingDropdownMenu, { levels: [1, 2, 3, 4], portal: isMobile }),
|
|
8058
|
+
/* @__PURE__ */ jsx82(
|
|
7737
8059
|
ListDropdownMenu,
|
|
7738
8060
|
{
|
|
7739
8061
|
types: ["bulletList", "orderedList", "taskList"],
|
|
7740
8062
|
portal: isMobile
|
|
7741
8063
|
}
|
|
7742
8064
|
),
|
|
7743
|
-
/* @__PURE__ */
|
|
8065
|
+
/* @__PURE__ */ jsx82(BlockquoteButton, {})
|
|
7744
8066
|
] }),
|
|
7745
|
-
/* @__PURE__ */
|
|
7746
|
-
/* @__PURE__ */
|
|
7747
|
-
/* @__PURE__ */
|
|
7748
|
-
/* @__PURE__ */
|
|
7749
|
-
/* @__PURE__ */
|
|
7750
|
-
isMobile && /* @__PURE__ */
|
|
8067
|
+
/* @__PURE__ */ jsx82(ToolbarGroup, { children: /* @__PURE__ */ jsx82(TableDropdownMenu, {}) }),
|
|
8068
|
+
/* @__PURE__ */ jsx82(ToolbarGroup, {}),
|
|
8069
|
+
/* @__PURE__ */ jsx82(ToolbarSeparator, {}),
|
|
8070
|
+
/* @__PURE__ */ jsx82(ToolbarGroup, { children: /* @__PURE__ */ jsx82(ImageUploadButton, { text: "Add" }) }),
|
|
8071
|
+
/* @__PURE__ */ jsx82(Spacer, {}),
|
|
8072
|
+
isMobile && /* @__PURE__ */ jsx82(ToolbarSeparator, {})
|
|
7751
8073
|
] });
|
|
7752
8074
|
};
|
|
7753
8075
|
var MobileToolbarContent = ({
|
|
7754
8076
|
type,
|
|
7755
8077
|
onBack
|
|
7756
8078
|
}) => /* @__PURE__ */ jsxs48(Fragment12, { children: [
|
|
7757
|
-
/* @__PURE__ */
|
|
7758
|
-
/* @__PURE__ */
|
|
7759
|
-
type === "highlighter" ? /* @__PURE__ */
|
|
8079
|
+
/* @__PURE__ */ jsx82(ToolbarGroup, { children: /* @__PURE__ */ jsxs48(Button2, { "data-style": "ghost", onClick: onBack, children: [
|
|
8080
|
+
/* @__PURE__ */ jsx82(ArrowLeftIcon, { className: "tiptap-button-icon" }),
|
|
8081
|
+
type === "highlighter" ? /* @__PURE__ */ jsx82(HighlighterIcon, { className: "tiptap-button-icon" }) : /* @__PURE__ */ jsx82(LinkIcon, { className: "tiptap-button-icon" })
|
|
7760
8082
|
] }) }),
|
|
7761
|
-
/* @__PURE__ */
|
|
7762
|
-
type === "highlighter" ? /* @__PURE__ */
|
|
8083
|
+
/* @__PURE__ */ jsx82(ToolbarSeparator, {}),
|
|
8084
|
+
type === "highlighter" ? /* @__PURE__ */ jsx82(ColorHighlightPopoverContent, {}) : /* @__PURE__ */ jsx82(LinkContent, {})
|
|
7763
8085
|
] });
|
|
7764
8086
|
function SimpleEditor() {
|
|
7765
8087
|
const { setEditorContent, debouncedSave } = useEditorBridge();
|
|
@@ -7790,12 +8112,52 @@ function SimpleEditor() {
|
|
|
7790
8112
|
}),
|
|
7791
8113
|
HorizontalRule,
|
|
7792
8114
|
index_default,
|
|
8115
|
+
index_default3.configure({
|
|
8116
|
+
HTMLAttributes: {
|
|
8117
|
+
class: "blockquote-node"
|
|
8118
|
+
}
|
|
8119
|
+
}),
|
|
8120
|
+
index_default4.configure({
|
|
8121
|
+
HTMLAttributes: {
|
|
8122
|
+
class: "code-block-node"
|
|
8123
|
+
}
|
|
8124
|
+
}),
|
|
8125
|
+
ListItem.configure({
|
|
8126
|
+
HTMLAttributes: {
|
|
8127
|
+
class: "list-item-node"
|
|
8128
|
+
}
|
|
8129
|
+
}),
|
|
8130
|
+
ImageResize,
|
|
7793
8131
|
index_default2,
|
|
7794
|
-
|
|
8132
|
+
index_default5,
|
|
7795
8133
|
Gapcursor,
|
|
7796
8134
|
TextStyle,
|
|
7797
8135
|
FontSizeStepper.configure({ step: 2, min: 8, defaultSize: 16 }),
|
|
7798
|
-
FontFamily.
|
|
8136
|
+
FontFamily.extend({
|
|
8137
|
+
addGlobalAttributes() {
|
|
8138
|
+
return [
|
|
8139
|
+
{
|
|
8140
|
+
types: [
|
|
8141
|
+
"textStyle"
|
|
8142
|
+
],
|
|
8143
|
+
attributes: {
|
|
8144
|
+
fontFamily: {
|
|
8145
|
+
default: null,
|
|
8146
|
+
parseHTML: (element) => element.style.fontFamily?.replace(/['"]+/g, ""),
|
|
8147
|
+
renderHTML: (attributes) => {
|
|
8148
|
+
if (!attributes.fontFamily) {
|
|
8149
|
+
return {};
|
|
8150
|
+
}
|
|
8151
|
+
return {
|
|
8152
|
+
style: `font-family: ${attributes.fontFamily}`
|
|
8153
|
+
};
|
|
8154
|
+
}
|
|
8155
|
+
}
|
|
8156
|
+
}
|
|
8157
|
+
}
|
|
8158
|
+
];
|
|
8159
|
+
}
|
|
8160
|
+
}).configure({
|
|
7799
8161
|
types: ["textStyle"]
|
|
7800
8162
|
}),
|
|
7801
8163
|
Color.configure({ types: ["textStyle"] }),
|
|
@@ -7813,7 +8175,7 @@ function SimpleEditor() {
|
|
|
7813
8175
|
Typography,
|
|
7814
8176
|
Superscript,
|
|
7815
8177
|
Subscript,
|
|
7816
|
-
|
|
8178
|
+
Selection3,
|
|
7817
8179
|
ImageUploadNode2.configure({
|
|
7818
8180
|
accept: "image/*",
|
|
7819
8181
|
maxSize: MAX_FILE_SIZE,
|
|
@@ -7869,8 +8231,8 @@ function SimpleEditor() {
|
|
|
7869
8231
|
window.visualViewport?.removeEventListener("scroll", updatePosition);
|
|
7870
8232
|
};
|
|
7871
8233
|
}, []);
|
|
7872
|
-
return /* @__PURE__ */
|
|
7873
|
-
/* @__PURE__ */
|
|
8234
|
+
return /* @__PURE__ */ jsx82("div", { className: "simple-editor-wrapper", children: /* @__PURE__ */ jsxs48(EditorContext.Provider, { value: { editor }, children: [
|
|
8235
|
+
/* @__PURE__ */ jsx82(
|
|
7874
8236
|
Toolbar,
|
|
7875
8237
|
{
|
|
7876
8238
|
ref: toolbarRef,
|
|
@@ -7879,14 +8241,14 @@ function SimpleEditor() {
|
|
|
7879
8241
|
bottom: `calc(100% - ${height - rect.y}px)`
|
|
7880
8242
|
} : {}
|
|
7881
8243
|
},
|
|
7882
|
-
children: mobileView === "main" ? /* @__PURE__ */
|
|
8244
|
+
children: mobileView === "main" ? /* @__PURE__ */ jsx82(
|
|
7883
8245
|
MainToolbarContent,
|
|
7884
8246
|
{
|
|
7885
8247
|
onHighlighterClick: () => setMobileView("highlighter"),
|
|
7886
8248
|
onLinkClick: () => setMobileView("link"),
|
|
7887
8249
|
isMobile
|
|
7888
8250
|
}
|
|
7889
|
-
) : /* @__PURE__ */
|
|
8251
|
+
) : /* @__PURE__ */ jsx82(
|
|
7890
8252
|
MobileToolbarContent,
|
|
7891
8253
|
{
|
|
7892
8254
|
type: mobileView === "highlighter" ? "highlighter" : "link",
|
|
@@ -7895,14 +8257,14 @@ function SimpleEditor() {
|
|
|
7895
8257
|
)
|
|
7896
8258
|
}
|
|
7897
8259
|
),
|
|
7898
|
-
/* @__PURE__ */
|
|
8260
|
+
/* @__PURE__ */ jsx82(
|
|
7899
8261
|
EditorContent,
|
|
7900
8262
|
{
|
|
7901
8263
|
editor,
|
|
7902
8264
|
role: "presentation",
|
|
7903
8265
|
autoFocus: true,
|
|
7904
8266
|
className: "simple-editor-content",
|
|
7905
|
-
children: editor && /* @__PURE__ */
|
|
8267
|
+
children: editor && /* @__PURE__ */ jsx82(BubbleMenuInline, {})
|
|
7906
8268
|
}
|
|
7907
8269
|
)
|
|
7908
8270
|
] }) });
|
|
@@ -7910,9 +8272,9 @@ function SimpleEditor() {
|
|
|
7910
8272
|
|
|
7911
8273
|
// src/components/editor/editor.tsx
|
|
7912
8274
|
import clsx2 from "clsx";
|
|
7913
|
-
import { jsx as
|
|
8275
|
+
import { jsx as jsx83 } from "react/jsx-runtime";
|
|
7914
8276
|
function Editor({ onChange, className, style, onTabsChange, initialTabs }) {
|
|
7915
|
-
return /* @__PURE__ */
|
|
8277
|
+
return /* @__PURE__ */ jsx83(
|
|
7916
8278
|
"div",
|
|
7917
8279
|
{
|
|
7918
8280
|
className: clsx2(
|
|
@@ -7920,7 +8282,7 @@ function Editor({ onChange, className, style, onTabsChange, initialTabs }) {
|
|
|
7920
8282
|
className
|
|
7921
8283
|
),
|
|
7922
8284
|
style,
|
|
7923
|
-
children: /* @__PURE__ */
|
|
8285
|
+
children: /* @__PURE__ */ jsx83(EditorShell, { children: /* @__PURE__ */ jsx83(EditorLayout, { onChange, initialTabs, onTabsChange, children: /* @__PURE__ */ jsx83(SimpleEditor, {}) }) })
|
|
7924
8286
|
}
|
|
7925
8287
|
);
|
|
7926
8288
|
}
|