@mhamz.01/easyflow-texteditor 0.1.97 → 0.1.99
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 +478 -883
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +407 -812
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1335,7 +1335,6 @@ function EditorLayout({ children, onChange, initialTabs, onTabsChange }) {
|
|
|
1335
1335
|
var import_react98 = require("react");
|
|
1336
1336
|
var import_react99 = require("@tiptap/react");
|
|
1337
1337
|
var import_starter_kit = require("@tiptap/starter-kit");
|
|
1338
|
-
var import_tiptap_extension_resize_image = __toESM(require("tiptap-extension-resize-image"));
|
|
1339
1338
|
var import_extension_image = __toESM(require("@tiptap/extension-image"));
|
|
1340
1339
|
var import_extension_list = require("@tiptap/extension-list");
|
|
1341
1340
|
var import_extension_text_align = require("@tiptap/extension-text-align");
|
|
@@ -1412,396 +1411,9 @@ var Paragraph = import_core2.Node.create({
|
|
|
1412
1411
|
});
|
|
1413
1412
|
var index_default2 = Paragraph;
|
|
1414
1413
|
|
|
1415
|
-
// node_modules/@tiptap/extension-blockquote/dist/index.js
|
|
1416
|
-
var import_core3 = require("@tiptap/core");
|
|
1417
|
-
var import_jsx_runtime17 = require("@tiptap/core/jsx-runtime");
|
|
1418
|
-
var inputRegex = /^\s*>\s$/;
|
|
1419
|
-
var Blockquote = import_core3.Node.create({
|
|
1420
|
-
name: "blockquote",
|
|
1421
|
-
addOptions() {
|
|
1422
|
-
return {
|
|
1423
|
-
HTMLAttributes: {}
|
|
1424
|
-
};
|
|
1425
|
-
},
|
|
1426
|
-
content: "block+",
|
|
1427
|
-
group: "block",
|
|
1428
|
-
defining: true,
|
|
1429
|
-
parseHTML() {
|
|
1430
|
-
return [{ tag: "blockquote" }];
|
|
1431
|
-
},
|
|
1432
|
-
renderHTML({ HTMLAttributes }) {
|
|
1433
|
-
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("blockquote", { ...(0, import_core3.mergeAttributes)(this.options.HTMLAttributes, HTMLAttributes), children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("slot", {}) });
|
|
1434
|
-
},
|
|
1435
|
-
parseMarkdown: (token, helpers) => {
|
|
1436
|
-
return helpers.createNode("blockquote", void 0, helpers.parseChildren(token.tokens || []));
|
|
1437
|
-
},
|
|
1438
|
-
renderMarkdown: (node, h) => {
|
|
1439
|
-
if (!node.content) {
|
|
1440
|
-
return "";
|
|
1441
|
-
}
|
|
1442
|
-
const prefix = ">";
|
|
1443
|
-
const result = [];
|
|
1444
|
-
node.content.forEach((child) => {
|
|
1445
|
-
const childContent = h.renderChildren([child]);
|
|
1446
|
-
const lines = childContent.split("\n");
|
|
1447
|
-
const linesWithPrefix = lines.map((line) => {
|
|
1448
|
-
if (line.trim() === "") {
|
|
1449
|
-
return prefix;
|
|
1450
|
-
}
|
|
1451
|
-
return `${prefix} ${line}`;
|
|
1452
|
-
});
|
|
1453
|
-
result.push(linesWithPrefix.join("\n"));
|
|
1454
|
-
});
|
|
1455
|
-
return result.join(`
|
|
1456
|
-
${prefix}
|
|
1457
|
-
`);
|
|
1458
|
-
},
|
|
1459
|
-
addCommands() {
|
|
1460
|
-
return {
|
|
1461
|
-
setBlockquote: () => ({ commands }) => {
|
|
1462
|
-
return commands.wrapIn(this.name);
|
|
1463
|
-
},
|
|
1464
|
-
toggleBlockquote: () => ({ commands }) => {
|
|
1465
|
-
return commands.toggleWrap(this.name);
|
|
1466
|
-
},
|
|
1467
|
-
unsetBlockquote: () => ({ commands }) => {
|
|
1468
|
-
return commands.lift(this.name);
|
|
1469
|
-
}
|
|
1470
|
-
};
|
|
1471
|
-
},
|
|
1472
|
-
addKeyboardShortcuts() {
|
|
1473
|
-
return {
|
|
1474
|
-
"Mod-Shift-b": () => this.editor.commands.toggleBlockquote()
|
|
1475
|
-
};
|
|
1476
|
-
},
|
|
1477
|
-
addInputRules() {
|
|
1478
|
-
return [
|
|
1479
|
-
(0, import_core3.wrappingInputRule)({
|
|
1480
|
-
find: inputRegex,
|
|
1481
|
-
type: this.type
|
|
1482
|
-
})
|
|
1483
|
-
];
|
|
1484
|
-
}
|
|
1485
|
-
});
|
|
1486
|
-
var index_default3 = Blockquote;
|
|
1487
|
-
|
|
1488
|
-
// node_modules/@tiptap/extension-code-block/dist/index.js
|
|
1489
|
-
var import_core4 = require("@tiptap/core");
|
|
1490
|
-
var import_state = require("@tiptap/pm/state");
|
|
1491
|
-
var DEFAULT_TAB_SIZE = 4;
|
|
1492
|
-
var backtickInputRegex = /^```([a-z]+)?[\s\n]$/;
|
|
1493
|
-
var tildeInputRegex = /^~~~([a-z]+)?[\s\n]$/;
|
|
1494
|
-
var CodeBlock = import_core4.Node.create({
|
|
1495
|
-
name: "codeBlock",
|
|
1496
|
-
addOptions() {
|
|
1497
|
-
return {
|
|
1498
|
-
languageClassPrefix: "language-",
|
|
1499
|
-
exitOnTripleEnter: true,
|
|
1500
|
-
exitOnArrowDown: true,
|
|
1501
|
-
defaultLanguage: null,
|
|
1502
|
-
enableTabIndentation: false,
|
|
1503
|
-
tabSize: DEFAULT_TAB_SIZE,
|
|
1504
|
-
HTMLAttributes: {}
|
|
1505
|
-
};
|
|
1506
|
-
},
|
|
1507
|
-
content: "text*",
|
|
1508
|
-
marks: "",
|
|
1509
|
-
group: "block",
|
|
1510
|
-
code: true,
|
|
1511
|
-
defining: true,
|
|
1512
|
-
addAttributes() {
|
|
1513
|
-
return {
|
|
1514
|
-
language: {
|
|
1515
|
-
default: this.options.defaultLanguage,
|
|
1516
|
-
parseHTML: (element) => {
|
|
1517
|
-
var _a;
|
|
1518
|
-
const { languageClassPrefix } = this.options;
|
|
1519
|
-
if (!languageClassPrefix) {
|
|
1520
|
-
return null;
|
|
1521
|
-
}
|
|
1522
|
-
const classNames = [...((_a = element.firstElementChild) == null ? void 0 : _a.classList) || []];
|
|
1523
|
-
const languages = classNames.filter((className) => className.startsWith(languageClassPrefix)).map((className) => className.replace(languageClassPrefix, ""));
|
|
1524
|
-
const language = languages[0];
|
|
1525
|
-
if (!language) {
|
|
1526
|
-
return null;
|
|
1527
|
-
}
|
|
1528
|
-
return language;
|
|
1529
|
-
},
|
|
1530
|
-
rendered: false
|
|
1531
|
-
}
|
|
1532
|
-
};
|
|
1533
|
-
},
|
|
1534
|
-
parseHTML() {
|
|
1535
|
-
return [
|
|
1536
|
-
{
|
|
1537
|
-
tag: "pre",
|
|
1538
|
-
preserveWhitespace: "full"
|
|
1539
|
-
}
|
|
1540
|
-
];
|
|
1541
|
-
},
|
|
1542
|
-
renderHTML({ node, HTMLAttributes }) {
|
|
1543
|
-
return [
|
|
1544
|
-
"pre",
|
|
1545
|
-
(0, import_core4.mergeAttributes)(this.options.HTMLAttributes, HTMLAttributes),
|
|
1546
|
-
[
|
|
1547
|
-
"code",
|
|
1548
|
-
{
|
|
1549
|
-
class: node.attrs.language ? this.options.languageClassPrefix + node.attrs.language : null
|
|
1550
|
-
},
|
|
1551
|
-
0
|
|
1552
|
-
]
|
|
1553
|
-
];
|
|
1554
|
-
},
|
|
1555
|
-
markdownTokenName: "code",
|
|
1556
|
-
parseMarkdown: (token, helpers) => {
|
|
1557
|
-
var _a;
|
|
1558
|
-
if (((_a = token.raw) == null ? void 0 : _a.startsWith("```")) === false && token.codeBlockStyle !== "indented") {
|
|
1559
|
-
return [];
|
|
1560
|
-
}
|
|
1561
|
-
return helpers.createNode(
|
|
1562
|
-
"codeBlock",
|
|
1563
|
-
{ language: token.lang || null },
|
|
1564
|
-
token.text ? [helpers.createTextNode(token.text)] : []
|
|
1565
|
-
);
|
|
1566
|
-
},
|
|
1567
|
-
renderMarkdown: (node, h) => {
|
|
1568
|
-
var _a;
|
|
1569
|
-
let output = "";
|
|
1570
|
-
const language = ((_a = node.attrs) == null ? void 0 : _a.language) || "";
|
|
1571
|
-
if (!node.content) {
|
|
1572
|
-
output = `\`\`\`${language}
|
|
1573
|
-
|
|
1574
|
-
\`\`\``;
|
|
1575
|
-
} else {
|
|
1576
|
-
const lines = [`\`\`\`${language}`, h.renderChildren(node.content), "```"];
|
|
1577
|
-
output = lines.join("\n");
|
|
1578
|
-
}
|
|
1579
|
-
return output;
|
|
1580
|
-
},
|
|
1581
|
-
addCommands() {
|
|
1582
|
-
return {
|
|
1583
|
-
setCodeBlock: (attributes) => ({ commands }) => {
|
|
1584
|
-
return commands.setNode(this.name, attributes);
|
|
1585
|
-
},
|
|
1586
|
-
toggleCodeBlock: (attributes) => ({ commands }) => {
|
|
1587
|
-
return commands.toggleNode(this.name, "paragraph", attributes);
|
|
1588
|
-
}
|
|
1589
|
-
};
|
|
1590
|
-
},
|
|
1591
|
-
addKeyboardShortcuts() {
|
|
1592
|
-
return {
|
|
1593
|
-
"Mod-Alt-c": () => this.editor.commands.toggleCodeBlock(),
|
|
1594
|
-
// remove code block when at start of document or code block is empty
|
|
1595
|
-
Backspace: () => {
|
|
1596
|
-
const { empty, $anchor } = this.editor.state.selection;
|
|
1597
|
-
const isAtStart = $anchor.pos === 1;
|
|
1598
|
-
if (!empty || $anchor.parent.type.name !== this.name) {
|
|
1599
|
-
return false;
|
|
1600
|
-
}
|
|
1601
|
-
if (isAtStart || !$anchor.parent.textContent.length) {
|
|
1602
|
-
return this.editor.commands.clearNodes();
|
|
1603
|
-
}
|
|
1604
|
-
return false;
|
|
1605
|
-
},
|
|
1606
|
-
// handle tab indentation
|
|
1607
|
-
Tab: ({ editor }) => {
|
|
1608
|
-
var _a;
|
|
1609
|
-
if (!this.options.enableTabIndentation) {
|
|
1610
|
-
return false;
|
|
1611
|
-
}
|
|
1612
|
-
const tabSize = (_a = this.options.tabSize) != null ? _a : DEFAULT_TAB_SIZE;
|
|
1613
|
-
const { state } = editor;
|
|
1614
|
-
const { selection } = state;
|
|
1615
|
-
const { $from, empty } = selection;
|
|
1616
|
-
if ($from.parent.type !== this.type) {
|
|
1617
|
-
return false;
|
|
1618
|
-
}
|
|
1619
|
-
const indent = " ".repeat(tabSize);
|
|
1620
|
-
if (empty) {
|
|
1621
|
-
return editor.commands.insertContent(indent);
|
|
1622
|
-
}
|
|
1623
|
-
return editor.commands.command(({ tr }) => {
|
|
1624
|
-
const { from, to } = selection;
|
|
1625
|
-
const text = state.doc.textBetween(from, to, "\n", "\n");
|
|
1626
|
-
const lines = text.split("\n");
|
|
1627
|
-
const indentedText = lines.map((line) => indent + line).join("\n");
|
|
1628
|
-
tr.replaceWith(from, to, state.schema.text(indentedText));
|
|
1629
|
-
return true;
|
|
1630
|
-
});
|
|
1631
|
-
},
|
|
1632
|
-
// handle shift+tab reverse indentation
|
|
1633
|
-
"Shift-Tab": ({ editor }) => {
|
|
1634
|
-
var _a;
|
|
1635
|
-
if (!this.options.enableTabIndentation) {
|
|
1636
|
-
return false;
|
|
1637
|
-
}
|
|
1638
|
-
const tabSize = (_a = this.options.tabSize) != null ? _a : DEFAULT_TAB_SIZE;
|
|
1639
|
-
const { state } = editor;
|
|
1640
|
-
const { selection } = state;
|
|
1641
|
-
const { $from, empty } = selection;
|
|
1642
|
-
if ($from.parent.type !== this.type) {
|
|
1643
|
-
return false;
|
|
1644
|
-
}
|
|
1645
|
-
if (empty) {
|
|
1646
|
-
return editor.commands.command(({ tr }) => {
|
|
1647
|
-
var _a2;
|
|
1648
|
-
const { pos } = $from;
|
|
1649
|
-
const codeBlockStart = $from.start();
|
|
1650
|
-
const codeBlockEnd = $from.end();
|
|
1651
|
-
const allText = state.doc.textBetween(codeBlockStart, codeBlockEnd, "\n", "\n");
|
|
1652
|
-
const lines = allText.split("\n");
|
|
1653
|
-
let currentLineIndex = 0;
|
|
1654
|
-
let charCount = 0;
|
|
1655
|
-
const relativeCursorPos = pos - codeBlockStart;
|
|
1656
|
-
for (let i = 0; i < lines.length; i += 1) {
|
|
1657
|
-
if (charCount + lines[i].length >= relativeCursorPos) {
|
|
1658
|
-
currentLineIndex = i;
|
|
1659
|
-
break;
|
|
1660
|
-
}
|
|
1661
|
-
charCount += lines[i].length + 1;
|
|
1662
|
-
}
|
|
1663
|
-
const currentLine = lines[currentLineIndex];
|
|
1664
|
-
const leadingSpaces = ((_a2 = currentLine.match(/^ */)) == null ? void 0 : _a2[0]) || "";
|
|
1665
|
-
const spacesToRemove = Math.min(leadingSpaces.length, tabSize);
|
|
1666
|
-
if (spacesToRemove === 0) {
|
|
1667
|
-
return true;
|
|
1668
|
-
}
|
|
1669
|
-
let lineStartPos = codeBlockStart;
|
|
1670
|
-
for (let i = 0; i < currentLineIndex; i += 1) {
|
|
1671
|
-
lineStartPos += lines[i].length + 1;
|
|
1672
|
-
}
|
|
1673
|
-
tr.delete(lineStartPos, lineStartPos + spacesToRemove);
|
|
1674
|
-
const cursorPosInLine = pos - lineStartPos;
|
|
1675
|
-
if (cursorPosInLine <= spacesToRemove) {
|
|
1676
|
-
tr.setSelection(import_state.TextSelection.create(tr.doc, lineStartPos));
|
|
1677
|
-
}
|
|
1678
|
-
return true;
|
|
1679
|
-
});
|
|
1680
|
-
}
|
|
1681
|
-
return editor.commands.command(({ tr }) => {
|
|
1682
|
-
const { from, to } = selection;
|
|
1683
|
-
const text = state.doc.textBetween(from, to, "\n", "\n");
|
|
1684
|
-
const lines = text.split("\n");
|
|
1685
|
-
const reverseIndentText = lines.map((line) => {
|
|
1686
|
-
var _a2;
|
|
1687
|
-
const leadingSpaces = ((_a2 = line.match(/^ */)) == null ? void 0 : _a2[0]) || "";
|
|
1688
|
-
const spacesToRemove = Math.min(leadingSpaces.length, tabSize);
|
|
1689
|
-
return line.slice(spacesToRemove);
|
|
1690
|
-
}).join("\n");
|
|
1691
|
-
tr.replaceWith(from, to, state.schema.text(reverseIndentText));
|
|
1692
|
-
return true;
|
|
1693
|
-
});
|
|
1694
|
-
},
|
|
1695
|
-
// exit node on triple enter
|
|
1696
|
-
Enter: ({ editor }) => {
|
|
1697
|
-
if (!this.options.exitOnTripleEnter) {
|
|
1698
|
-
return false;
|
|
1699
|
-
}
|
|
1700
|
-
const { state } = editor;
|
|
1701
|
-
const { selection } = state;
|
|
1702
|
-
const { $from, empty } = selection;
|
|
1703
|
-
if (!empty || $from.parent.type !== this.type) {
|
|
1704
|
-
return false;
|
|
1705
|
-
}
|
|
1706
|
-
const isAtEnd = $from.parentOffset === $from.parent.nodeSize - 2;
|
|
1707
|
-
const endsWithDoubleNewline = $from.parent.textContent.endsWith("\n\n");
|
|
1708
|
-
if (!isAtEnd || !endsWithDoubleNewline) {
|
|
1709
|
-
return false;
|
|
1710
|
-
}
|
|
1711
|
-
return editor.chain().command(({ tr }) => {
|
|
1712
|
-
tr.delete($from.pos - 2, $from.pos);
|
|
1713
|
-
return true;
|
|
1714
|
-
}).exitCode().run();
|
|
1715
|
-
},
|
|
1716
|
-
// exit node on arrow down
|
|
1717
|
-
ArrowDown: ({ editor }) => {
|
|
1718
|
-
if (!this.options.exitOnArrowDown) {
|
|
1719
|
-
return false;
|
|
1720
|
-
}
|
|
1721
|
-
const { state } = editor;
|
|
1722
|
-
const { selection, doc } = state;
|
|
1723
|
-
const { $from, empty } = selection;
|
|
1724
|
-
if (!empty || $from.parent.type !== this.type) {
|
|
1725
|
-
return false;
|
|
1726
|
-
}
|
|
1727
|
-
const isAtEnd = $from.parentOffset === $from.parent.nodeSize - 2;
|
|
1728
|
-
if (!isAtEnd) {
|
|
1729
|
-
return false;
|
|
1730
|
-
}
|
|
1731
|
-
const after = $from.after();
|
|
1732
|
-
if (after === void 0) {
|
|
1733
|
-
return false;
|
|
1734
|
-
}
|
|
1735
|
-
const nodeAfter = doc.nodeAt(after);
|
|
1736
|
-
if (nodeAfter) {
|
|
1737
|
-
return editor.commands.command(({ tr }) => {
|
|
1738
|
-
tr.setSelection(import_state.Selection.near(doc.resolve(after)));
|
|
1739
|
-
return true;
|
|
1740
|
-
});
|
|
1741
|
-
}
|
|
1742
|
-
return editor.commands.exitCode();
|
|
1743
|
-
}
|
|
1744
|
-
};
|
|
1745
|
-
},
|
|
1746
|
-
addInputRules() {
|
|
1747
|
-
return [
|
|
1748
|
-
(0, import_core4.textblockTypeInputRule)({
|
|
1749
|
-
find: backtickInputRegex,
|
|
1750
|
-
type: this.type,
|
|
1751
|
-
getAttributes: (match) => ({
|
|
1752
|
-
language: match[1]
|
|
1753
|
-
})
|
|
1754
|
-
}),
|
|
1755
|
-
(0, import_core4.textblockTypeInputRule)({
|
|
1756
|
-
find: tildeInputRegex,
|
|
1757
|
-
type: this.type,
|
|
1758
|
-
getAttributes: (match) => ({
|
|
1759
|
-
language: match[1]
|
|
1760
|
-
})
|
|
1761
|
-
})
|
|
1762
|
-
];
|
|
1763
|
-
},
|
|
1764
|
-
addProseMirrorPlugins() {
|
|
1765
|
-
return [
|
|
1766
|
-
// this plugin creates a code block for pasted content from VS Code
|
|
1767
|
-
// we can also detect the copied code language
|
|
1768
|
-
new import_state.Plugin({
|
|
1769
|
-
key: new import_state.PluginKey("codeBlockVSCodeHandler"),
|
|
1770
|
-
props: {
|
|
1771
|
-
handlePaste: (view, event) => {
|
|
1772
|
-
if (!event.clipboardData) {
|
|
1773
|
-
return false;
|
|
1774
|
-
}
|
|
1775
|
-
if (this.editor.isActive(this.type.name)) {
|
|
1776
|
-
return false;
|
|
1777
|
-
}
|
|
1778
|
-
const text = event.clipboardData.getData("text/plain");
|
|
1779
|
-
const vscode = event.clipboardData.getData("vscode-editor-data");
|
|
1780
|
-
const vscodeData = vscode ? JSON.parse(vscode) : void 0;
|
|
1781
|
-
const language = vscodeData == null ? void 0 : vscodeData.mode;
|
|
1782
|
-
if (!text || !language) {
|
|
1783
|
-
return false;
|
|
1784
|
-
}
|
|
1785
|
-
const { tr, schema } = view.state;
|
|
1786
|
-
const textNode = schema.text(text.replace(/\r\n?/g, "\n"));
|
|
1787
|
-
tr.replaceSelectionWith(this.type.create({ language }, textNode));
|
|
1788
|
-
if (tr.selection.$from.parent.type !== this.type) {
|
|
1789
|
-
tr.setSelection(import_state.TextSelection.near(tr.doc.resolve(Math.max(0, tr.selection.from - 2))));
|
|
1790
|
-
}
|
|
1791
|
-
tr.setMeta("paste", true);
|
|
1792
|
-
view.dispatch(tr);
|
|
1793
|
-
return true;
|
|
1794
|
-
}
|
|
1795
|
-
}
|
|
1796
|
-
})
|
|
1797
|
-
];
|
|
1798
|
-
}
|
|
1799
|
-
});
|
|
1800
|
-
var index_default4 = CodeBlock;
|
|
1801
|
-
|
|
1802
1414
|
// node_modules/@tiptap/extension-text/dist/index.js
|
|
1803
|
-
var
|
|
1804
|
-
var Text =
|
|
1415
|
+
var import_core3 = require("@tiptap/core");
|
|
1416
|
+
var Text = import_core3.Node.create({
|
|
1805
1417
|
name: "text",
|
|
1806
1418
|
group: "inline",
|
|
1807
1419
|
parseMarkdown: (token) => {
|
|
@@ -1812,7 +1424,7 @@ var Text = import_core5.Node.create({
|
|
|
1812
1424
|
},
|
|
1813
1425
|
renderMarkdown: (node) => node.text || ""
|
|
1814
1426
|
});
|
|
1815
|
-
var
|
|
1427
|
+
var index_default3 = Text;
|
|
1816
1428
|
|
|
1817
1429
|
// src/components/tiptap-templates/simple/simple-editor.tsx
|
|
1818
1430
|
var import_extension_text_style2 = require("@tiptap/extension-text-style");
|
|
@@ -1821,7 +1433,7 @@ var import_extension_table = require("@tiptap/extension-table");
|
|
|
1821
1433
|
var import_extensions2 = require("@tiptap/extensions");
|
|
1822
1434
|
|
|
1823
1435
|
// src/components/extensions/font-size-stepper.ts
|
|
1824
|
-
var
|
|
1436
|
+
var import_core4 = require("@tiptap/core");
|
|
1825
1437
|
function parsePx(value) {
|
|
1826
1438
|
if (!value) return null;
|
|
1827
1439
|
const m = /(-?\d+\.?\d*)px/.exec(String(value));
|
|
@@ -1849,7 +1461,7 @@ function getFontSizeFromResolvedPos(editor) {
|
|
|
1849
1461
|
}
|
|
1850
1462
|
return null;
|
|
1851
1463
|
}
|
|
1852
|
-
var FontSizeStepper =
|
|
1464
|
+
var FontSizeStepper = import_core4.Extension.create({
|
|
1853
1465
|
name: "fontSizeStepper",
|
|
1854
1466
|
// configuration option to control step & min size
|
|
1855
1467
|
addOptions() {
|
|
@@ -1908,7 +1520,7 @@ var import_react12 = require("react");
|
|
|
1908
1520
|
// src/components/tiptap-ui-primitive/tooltip/tooltip.tsx
|
|
1909
1521
|
var import_react10 = require("react");
|
|
1910
1522
|
var import_react11 = require("@floating-ui/react");
|
|
1911
|
-
var
|
|
1523
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1912
1524
|
function useTooltip({
|
|
1913
1525
|
initialOpen = false,
|
|
1914
1526
|
placement = "top",
|
|
@@ -1972,14 +1584,14 @@ function useTooltipContext() {
|
|
|
1972
1584
|
function Tooltip2({ children, ...props }) {
|
|
1973
1585
|
const tooltip = useTooltip(props);
|
|
1974
1586
|
if (!props.useDelayGroup) {
|
|
1975
|
-
return /* @__PURE__ */ (0,
|
|
1587
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(TooltipContext.Provider, { value: tooltip, children });
|
|
1976
1588
|
}
|
|
1977
|
-
return /* @__PURE__ */ (0,
|
|
1589
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1978
1590
|
import_react11.FloatingDelayGroup,
|
|
1979
1591
|
{
|
|
1980
1592
|
delay: { open: props.delay ?? 0, close: props.closeDelay ?? 0 },
|
|
1981
1593
|
timeoutMs: props.timeout,
|
|
1982
|
-
children: /* @__PURE__ */ (0,
|
|
1594
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(TooltipContext.Provider, { value: tooltip, children })
|
|
1983
1595
|
}
|
|
1984
1596
|
);
|
|
1985
1597
|
}
|
|
@@ -2008,7 +1620,7 @@ var TooltipTrigger2 = (0, import_react10.forwardRef)(
|
|
|
2008
1620
|
})
|
|
2009
1621
|
);
|
|
2010
1622
|
}
|
|
2011
|
-
return /* @__PURE__ */ (0,
|
|
1623
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2012
1624
|
"button",
|
|
2013
1625
|
{
|
|
2014
1626
|
ref,
|
|
@@ -2024,7 +1636,7 @@ var TooltipContent2 = (0, import_react10.forwardRef)(
|
|
|
2024
1636
|
const context = useTooltipContext();
|
|
2025
1637
|
const ref = (0, import_react11.useMergeRefs)([context.refs.setFloating, propRef]);
|
|
2026
1638
|
if (!context.open) return null;
|
|
2027
|
-
const content = /* @__PURE__ */ (0,
|
|
1639
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2028
1640
|
"div",
|
|
2029
1641
|
{
|
|
2030
1642
|
ref,
|
|
@@ -2038,7 +1650,7 @@ var TooltipContent2 = (0, import_react10.forwardRef)(
|
|
|
2038
1650
|
}
|
|
2039
1651
|
);
|
|
2040
1652
|
if (portal) {
|
|
2041
|
-
return /* @__PURE__ */ (0,
|
|
1653
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react11.FloatingPortal, { ...portalProps, children: content });
|
|
2042
1654
|
}
|
|
2043
1655
|
return content;
|
|
2044
1656
|
}
|
|
@@ -2048,8 +1660,8 @@ TooltipTrigger2.displayName = "TooltipTrigger";
|
|
|
2048
1660
|
TooltipContent2.displayName = "TooltipContent";
|
|
2049
1661
|
|
|
2050
1662
|
// src/lib/tiptap-utils.ts
|
|
2051
|
-
var
|
|
2052
|
-
var
|
|
1663
|
+
var import_state = require("@tiptap/pm/state");
|
|
1664
|
+
var import_core5 = require("@tiptap/core");
|
|
2053
1665
|
var MAX_FILE_SIZE = 5 * 1024 * 1024;
|
|
2054
1666
|
var MAC_SYMBOLS = {
|
|
2055
1667
|
mod: "\u2318",
|
|
@@ -2095,7 +1707,7 @@ var isNodeInSchema = (nodeName, editor) => {
|
|
|
2095
1707
|
function focusNextNode(editor) {
|
|
2096
1708
|
const { state, view } = editor;
|
|
2097
1709
|
const { doc, selection } = state;
|
|
2098
|
-
const nextSel =
|
|
1710
|
+
const nextSel = import_state.Selection.findFrom(selection.$to, 1, true);
|
|
2099
1711
|
if (nextSel) {
|
|
2100
1712
|
view.dispatch(state.tr.setSelection(nextSel).scrollIntoView());
|
|
2101
1713
|
return true;
|
|
@@ -2109,7 +1721,7 @@ function focusNextNode(editor) {
|
|
|
2109
1721
|
const para = paragraphType.create();
|
|
2110
1722
|
let tr = state.tr.insert(end, para);
|
|
2111
1723
|
const $inside = tr.doc.resolve(end + 1);
|
|
2112
|
-
tr = tr.setSelection(
|
|
1724
|
+
tr = tr.setSelection(import_state.TextSelection.near($inside)).scrollIntoView();
|
|
2113
1725
|
view.dispatch(tr);
|
|
2114
1726
|
return true;
|
|
2115
1727
|
}
|
|
@@ -2177,7 +1789,7 @@ function isNodeTypeSelected(editor, nodeTypeNames = [], checkAncestorNodes = fal
|
|
|
2177
1789
|
if (!editor || !editor.state.selection) return false;
|
|
2178
1790
|
const { selection } = editor.state;
|
|
2179
1791
|
if (selection.empty) return false;
|
|
2180
|
-
if (selection instanceof
|
|
1792
|
+
if (selection instanceof import_state.NodeSelection) {
|
|
2181
1793
|
const selectedNode = selection.node;
|
|
2182
1794
|
return selectedNode ? nodeTypeNames.includes(selectedNode.type.name) : false;
|
|
2183
1795
|
}
|
|
@@ -2197,11 +1809,11 @@ function selectionWithinConvertibleTypes(editor, types = []) {
|
|
|
2197
1809
|
const { state } = editor;
|
|
2198
1810
|
const { selection } = state;
|
|
2199
1811
|
const allowed = new Set(types);
|
|
2200
|
-
if (selection instanceof
|
|
1812
|
+
if (selection instanceof import_state.NodeSelection) {
|
|
2201
1813
|
const nodeType = selection.node?.type?.name;
|
|
2202
1814
|
return !!nodeType && allowed.has(nodeType);
|
|
2203
1815
|
}
|
|
2204
|
-
if (selection instanceof
|
|
1816
|
+
if (selection instanceof import_state.TextSelection || selection instanceof import_state.AllSelection) {
|
|
2205
1817
|
let valid = true;
|
|
2206
1818
|
state.doc.nodesBetween(selection.from, selection.to, (node) => {
|
|
2207
1819
|
if (node.isTextblock && !allowed.has(node.type.name)) {
|
|
@@ -2292,7 +1904,7 @@ var FONT_SIZES = [
|
|
|
2292
1904
|
"56px",
|
|
2293
1905
|
"64px"
|
|
2294
1906
|
];
|
|
2295
|
-
var FontSizeExtension =
|
|
1907
|
+
var FontSizeExtension = import_core5.Extension.create({
|
|
2296
1908
|
name: "fontSize",
|
|
2297
1909
|
addOptions() {
|
|
2298
1910
|
return {
|
|
@@ -2350,14 +1962,14 @@ var FontSizeExtension = import_core7.Extension.create({
|
|
|
2350
1962
|
});
|
|
2351
1963
|
|
|
2352
1964
|
// src/components/tiptap-ui-primitive/button/button.tsx
|
|
2353
|
-
var
|
|
1965
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
2354
1966
|
var ShortcutDisplay = ({
|
|
2355
1967
|
shortcuts
|
|
2356
1968
|
}) => {
|
|
2357
1969
|
if (shortcuts.length === 0) return null;
|
|
2358
|
-
return /* @__PURE__ */ (0,
|
|
2359
|
-
index > 0 && /* @__PURE__ */ (0,
|
|
2360
|
-
/* @__PURE__ */ (0,
|
|
1970
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { children: shortcuts.map((key, index) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_react12.Fragment, { children: [
|
|
1971
|
+
index > 0 && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("kbd", { children: "+" }),
|
|
1972
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("kbd", { children: key })
|
|
2361
1973
|
] }, index)) });
|
|
2362
1974
|
};
|
|
2363
1975
|
var Button2 = (0, import_react12.forwardRef)(
|
|
@@ -2375,7 +1987,7 @@ var Button2 = (0, import_react12.forwardRef)(
|
|
|
2375
1987
|
[shortcutKeys]
|
|
2376
1988
|
);
|
|
2377
1989
|
if (!tooltip || !showTooltip) {
|
|
2378
|
-
return /* @__PURE__ */ (0,
|
|
1990
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2379
1991
|
"button",
|
|
2380
1992
|
{
|
|
2381
1993
|
className: cn2("tiptap-button", className),
|
|
@@ -2386,8 +1998,8 @@ var Button2 = (0, import_react12.forwardRef)(
|
|
|
2386
1998
|
}
|
|
2387
1999
|
);
|
|
2388
2000
|
}
|
|
2389
|
-
return /* @__PURE__ */ (0,
|
|
2390
|
-
/* @__PURE__ */ (0,
|
|
2001
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Tooltip2, { delay: 200, children: [
|
|
2002
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2391
2003
|
TooltipTrigger2,
|
|
2392
2004
|
{
|
|
2393
2005
|
className: cn2("tiptap-button", className),
|
|
@@ -2397,16 +2009,16 @@ var Button2 = (0, import_react12.forwardRef)(
|
|
|
2397
2009
|
children
|
|
2398
2010
|
}
|
|
2399
2011
|
),
|
|
2400
|
-
/* @__PURE__ */ (0,
|
|
2012
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(TooltipContent2, { children: [
|
|
2401
2013
|
tooltip,
|
|
2402
|
-
/* @__PURE__ */ (0,
|
|
2014
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ShortcutDisplay, { shortcuts })
|
|
2403
2015
|
] })
|
|
2404
2016
|
] });
|
|
2405
2017
|
}
|
|
2406
2018
|
);
|
|
2407
2019
|
Button2.displayName = "Button";
|
|
2408
2020
|
var ButtonGroup = (0, import_react12.forwardRef)(({ className, children, orientation = "vertical", ...props }, ref) => {
|
|
2409
|
-
return /* @__PURE__ */ (0,
|
|
2021
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2410
2022
|
"div",
|
|
2411
2023
|
{
|
|
2412
2024
|
ref,
|
|
@@ -2421,7 +2033,7 @@ var ButtonGroup = (0, import_react12.forwardRef)(({ className, children, orienta
|
|
|
2421
2033
|
ButtonGroup.displayName = "ButtonGroup";
|
|
2422
2034
|
|
|
2423
2035
|
// src/components/tiptap-ui-primitive/spacer/spacer.tsx
|
|
2424
|
-
var
|
|
2036
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
2425
2037
|
function Spacer({
|
|
2426
2038
|
orientation = "horizontal",
|
|
2427
2039
|
size,
|
|
@@ -2436,7 +2048,7 @@ function Spacer({
|
|
|
2436
2048
|
height: orientation === "horizontal" ? "1px" : size
|
|
2437
2049
|
}
|
|
2438
2050
|
};
|
|
2439
|
-
return /* @__PURE__ */ (0,
|
|
2051
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { ...props, style: computedStyle });
|
|
2440
2052
|
}
|
|
2441
2053
|
|
|
2442
2054
|
// src/components/tiptap-ui-primitive/toolbar/toolbar.tsx
|
|
@@ -2444,12 +2056,12 @@ var import_react16 = require("react");
|
|
|
2444
2056
|
|
|
2445
2057
|
// src/components/tiptap-ui-primitive/separator/separator.tsx
|
|
2446
2058
|
var import_react13 = require("react");
|
|
2447
|
-
var
|
|
2059
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
2448
2060
|
var Separator2 = (0, import_react13.forwardRef)(
|
|
2449
2061
|
({ decorative, orientation = "vertical", className, ...divProps }, ref) => {
|
|
2450
2062
|
const ariaOrientation = orientation === "vertical" ? orientation : void 0;
|
|
2451
2063
|
const semanticProps = decorative ? { role: "none" } : { "aria-orientation": ariaOrientation, role: "separator" };
|
|
2452
|
-
return /* @__PURE__ */ (0,
|
|
2064
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2453
2065
|
"div",
|
|
2454
2066
|
{
|
|
2455
2067
|
className: cn2("tiptap-separator", className),
|
|
@@ -2618,7 +2230,7 @@ var useComposedRef = (libRef, userRef) => {
|
|
|
2618
2230
|
};
|
|
2619
2231
|
|
|
2620
2232
|
// src/components/tiptap-ui-primitive/toolbar/toolbar.tsx
|
|
2621
|
-
var
|
|
2233
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
2622
2234
|
var useToolbarNavigation = (toolbarRef) => {
|
|
2623
2235
|
const [items, setItems] = (0, import_react16.useState)([]);
|
|
2624
2236
|
const collectItems = (0, import_react16.useCallback)(() => {
|
|
@@ -2675,7 +2287,7 @@ var Toolbar = (0, import_react16.forwardRef)(
|
|
|
2675
2287
|
const toolbarRef = (0, import_react16.useRef)(null);
|
|
2676
2288
|
const composedRef = useComposedRef(toolbarRef, ref);
|
|
2677
2289
|
useToolbarNavigation(toolbarRef);
|
|
2678
|
-
return /* @__PURE__ */ (0,
|
|
2290
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2679
2291
|
"div",
|
|
2680
2292
|
{
|
|
2681
2293
|
ref: composedRef,
|
|
@@ -2691,7 +2303,7 @@ var Toolbar = (0, import_react16.forwardRef)(
|
|
|
2691
2303
|
);
|
|
2692
2304
|
Toolbar.displayName = "Toolbar";
|
|
2693
2305
|
var ToolbarGroup = (0, import_react16.forwardRef)(
|
|
2694
|
-
({ children, className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
2306
|
+
({ children, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2695
2307
|
"div",
|
|
2696
2308
|
{
|
|
2697
2309
|
ref,
|
|
@@ -2704,7 +2316,7 @@ var ToolbarGroup = (0, import_react16.forwardRef)(
|
|
|
2704
2316
|
);
|
|
2705
2317
|
ToolbarGroup.displayName = "ToolbarGroup";
|
|
2706
2318
|
var ToolbarSeparator = (0, import_react16.forwardRef)(
|
|
2707
|
-
({ ...props }, ref) => /* @__PURE__ */ (0,
|
|
2319
|
+
({ ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Separator2, { ref, orientation: "vertical", decorative: true, ...props })
|
|
2708
2320
|
);
|
|
2709
2321
|
ToolbarSeparator.displayName = "ToolbarSeparator";
|
|
2710
2322
|
|
|
@@ -2712,11 +2324,11 @@ ToolbarSeparator.displayName = "ToolbarSeparator";
|
|
|
2712
2324
|
var import_menus = require("@tiptap/react/menus");
|
|
2713
2325
|
var import_react17 = require("@tiptap/react");
|
|
2714
2326
|
var import_lucide_react7 = require("lucide-react");
|
|
2715
|
-
var
|
|
2327
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
2716
2328
|
function BubbleMenuInline() {
|
|
2717
2329
|
const { editor } = (0, import_react17.useCurrentEditor)();
|
|
2718
2330
|
if (!editor) return null;
|
|
2719
|
-
return /* @__PURE__ */ (0,
|
|
2331
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2720
2332
|
import_menus.BubbleMenu,
|
|
2721
2333
|
{
|
|
2722
2334
|
editor,
|
|
@@ -2735,81 +2347,81 @@ function BubbleMenuInline() {
|
|
|
2735
2347
|
if (hasImage) return false;
|
|
2736
2348
|
return true;
|
|
2737
2349
|
},
|
|
2738
|
-
children: /* @__PURE__ */ (0,
|
|
2350
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
2739
2351
|
"div",
|
|
2740
2352
|
{
|
|
2741
2353
|
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",
|
|
2742
2354
|
children: [
|
|
2743
|
-
/* @__PURE__ */ (0,
|
|
2355
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2744
2356
|
Button,
|
|
2745
2357
|
{
|
|
2746
2358
|
variant: "ghost",
|
|
2747
2359
|
size: "sm",
|
|
2748
2360
|
onClick: () => editor.chain().focus().toggleHeading({ level: 1 }).run(),
|
|
2749
2361
|
className: editor.isActive("heading", { level: 1 }) ? "bg-accent" : "",
|
|
2750
|
-
children: /* @__PURE__ */ (0,
|
|
2362
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react7.Heading1, { size: 15 })
|
|
2751
2363
|
}
|
|
2752
2364
|
),
|
|
2753
|
-
/* @__PURE__ */ (0,
|
|
2365
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2754
2366
|
Button,
|
|
2755
2367
|
{
|
|
2756
2368
|
variant: "ghost",
|
|
2757
2369
|
size: "sm",
|
|
2758
2370
|
onClick: () => editor.chain().focus().toggleHeading({ level: 2 }).run(),
|
|
2759
2371
|
className: editor.isActive("heading", { level: 2 }) ? "bg-accent" : "",
|
|
2760
|
-
children: /* @__PURE__ */ (0,
|
|
2372
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react7.Heading2, { size: 15 })
|
|
2761
2373
|
}
|
|
2762
2374
|
),
|
|
2763
|
-
/* @__PURE__ */ (0,
|
|
2375
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2764
2376
|
Button,
|
|
2765
2377
|
{
|
|
2766
2378
|
variant: "ghost",
|
|
2767
2379
|
size: "sm",
|
|
2768
2380
|
onClick: () => editor.chain().focus().toggleHeading({ level: 3 }).run(),
|
|
2769
2381
|
className: editor.isActive("heading", { level: 3 }) ? "bg-accent" : "",
|
|
2770
|
-
children: /* @__PURE__ */ (0,
|
|
2382
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react7.Heading3, { size: 15 })
|
|
2771
2383
|
}
|
|
2772
2384
|
),
|
|
2773
|
-
/* @__PURE__ */ (0,
|
|
2774
|
-
/* @__PURE__ */ (0,
|
|
2385
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Separator, { orientation: "vertical", className: "mx-1" }),
|
|
2386
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2775
2387
|
Button,
|
|
2776
2388
|
{
|
|
2777
2389
|
variant: "ghost",
|
|
2778
2390
|
size: "sm",
|
|
2779
2391
|
onClick: () => editor.chain().focus().toggleBulletList().run(),
|
|
2780
2392
|
className: editor.isActive("bulletList") ? "bg-accent" : "",
|
|
2781
|
-
children: /* @__PURE__ */ (0,
|
|
2393
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react7.List, { size: 15 })
|
|
2782
2394
|
}
|
|
2783
2395
|
),
|
|
2784
|
-
/* @__PURE__ */ (0,
|
|
2396
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2785
2397
|
Button,
|
|
2786
2398
|
{
|
|
2787
2399
|
variant: "ghost",
|
|
2788
2400
|
size: "sm",
|
|
2789
2401
|
onClick: () => editor.chain().focus().toggleOrderedList().run(),
|
|
2790
2402
|
className: editor.isActive("orderedList") ? "bg-accent" : "",
|
|
2791
|
-
children: /* @__PURE__ */ (0,
|
|
2403
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react7.ListOrdered, { size: 15 })
|
|
2792
2404
|
}
|
|
2793
2405
|
),
|
|
2794
|
-
/* @__PURE__ */ (0,
|
|
2406
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2795
2407
|
Button,
|
|
2796
2408
|
{
|
|
2797
2409
|
variant: "ghost",
|
|
2798
2410
|
size: "sm",
|
|
2799
2411
|
onClick: () => editor.chain().focus().toggleTaskList().run(),
|
|
2800
2412
|
className: editor.isActive("taskList") ? "bg-accent" : "",
|
|
2801
|
-
children: /* @__PURE__ */ (0,
|
|
2413
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react7.CheckSquare, { size: 15 })
|
|
2802
2414
|
}
|
|
2803
2415
|
),
|
|
2804
|
-
/* @__PURE__ */ (0,
|
|
2805
|
-
/* @__PURE__ */ (0,
|
|
2416
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Separator, { orientation: "vertical", className: "mx-1" }),
|
|
2417
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2806
2418
|
Button,
|
|
2807
2419
|
{
|
|
2808
2420
|
variant: "ghost",
|
|
2809
2421
|
size: "sm",
|
|
2810
2422
|
onClick: () => editor.chain().focus().toggleCodeBlock().run(),
|
|
2811
2423
|
className: editor.isActive("codeBlock") ? "bg-accent" : "",
|
|
2812
|
-
children: /* @__PURE__ */ (0,
|
|
2424
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react7.Code, { size: 15 })
|
|
2813
2425
|
}
|
|
2814
2426
|
)
|
|
2815
2427
|
]
|
|
@@ -2829,9 +2441,9 @@ var import_react20 = require("@tiptap/react");
|
|
|
2829
2441
|
|
|
2830
2442
|
// src/components/tiptap-icons/close-icon.tsx
|
|
2831
2443
|
var import_react18 = require("react");
|
|
2832
|
-
var
|
|
2444
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
2833
2445
|
var CloseIcon = (0, import_react18.memo)(({ className, ...props }) => {
|
|
2834
|
-
return /* @__PURE__ */ (0,
|
|
2446
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2835
2447
|
"svg",
|
|
2836
2448
|
{
|
|
2837
2449
|
width: "24",
|
|
@@ -2841,7 +2453,7 @@ var CloseIcon = (0, import_react18.memo)(({ className, ...props }) => {
|
|
|
2841
2453
|
fill: "currentColor",
|
|
2842
2454
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2843
2455
|
...props,
|
|
2844
|
-
children: /* @__PURE__ */ (0,
|
|
2456
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2845
2457
|
"path",
|
|
2846
2458
|
{
|
|
2847
2459
|
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",
|
|
@@ -2854,7 +2466,7 @@ var CloseIcon = (0, import_react18.memo)(({ className, ...props }) => {
|
|
|
2854
2466
|
CloseIcon.displayName = "CloseIcon";
|
|
2855
2467
|
|
|
2856
2468
|
// src/components/tiptap-node/image-upload-node/image-upload-node.tsx
|
|
2857
|
-
var
|
|
2469
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
2858
2470
|
function useFileUpload(options) {
|
|
2859
2471
|
const [fileItems, setFileItems] = (0, import_react19.useState)([]);
|
|
2860
2472
|
const uploadFile = async (file) => {
|
|
@@ -2962,7 +2574,7 @@ function useFileUpload(options) {
|
|
|
2962
2574
|
clearAllFiles
|
|
2963
2575
|
};
|
|
2964
2576
|
}
|
|
2965
|
-
var CloudUploadIcon = () => /* @__PURE__ */ (0,
|
|
2577
|
+
var CloudUploadIcon = () => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
2966
2578
|
"svg",
|
|
2967
2579
|
{
|
|
2968
2580
|
width: "24",
|
|
@@ -2972,14 +2584,14 @@ var CloudUploadIcon = () => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
|
2972
2584
|
fill: "currentColor",
|
|
2973
2585
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2974
2586
|
children: [
|
|
2975
|
-
/* @__PURE__ */ (0,
|
|
2587
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2976
2588
|
"path",
|
|
2977
2589
|
{
|
|
2978
2590
|
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",
|
|
2979
2591
|
fill: "currentColor"
|
|
2980
2592
|
}
|
|
2981
2593
|
),
|
|
2982
|
-
/* @__PURE__ */ (0,
|
|
2594
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2983
2595
|
"path",
|
|
2984
2596
|
{
|
|
2985
2597
|
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",
|
|
@@ -2989,7 +2601,7 @@ var CloudUploadIcon = () => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
|
2989
2601
|
]
|
|
2990
2602
|
}
|
|
2991
2603
|
);
|
|
2992
|
-
var FileIcon = () => /* @__PURE__ */ (0,
|
|
2604
|
+
var FileIcon = () => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2993
2605
|
"svg",
|
|
2994
2606
|
{
|
|
2995
2607
|
width: "43",
|
|
@@ -2998,7 +2610,7 @@ var FileIcon = () => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
|
2998
2610
|
fill: "currentColor",
|
|
2999
2611
|
className: "tiptap-image-upload-dropzone-rect-primary",
|
|
3000
2612
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3001
|
-
children: /* @__PURE__ */ (0,
|
|
2613
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3002
2614
|
"path",
|
|
3003
2615
|
{
|
|
3004
2616
|
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",
|
|
@@ -3010,7 +2622,7 @@ var FileIcon = () => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
|
3010
2622
|
)
|
|
3011
2623
|
}
|
|
3012
2624
|
);
|
|
3013
|
-
var FileCornerIcon = () => /* @__PURE__ */ (0,
|
|
2625
|
+
var FileCornerIcon = () => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3014
2626
|
"svg",
|
|
3015
2627
|
{
|
|
3016
2628
|
width: "10",
|
|
@@ -3019,7 +2631,7 @@ var FileCornerIcon = () => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
|
3019
2631
|
viewBox: "0 0 10 10",
|
|
3020
2632
|
fill: "currentColor",
|
|
3021
2633
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3022
|
-
children: /* @__PURE__ */ (0,
|
|
2634
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3023
2635
|
"path",
|
|
3024
2636
|
{
|
|
3025
2637
|
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",
|
|
@@ -3062,7 +2674,7 @@ var ImageUploadDragArea = ({
|
|
|
3062
2674
|
onFile(files);
|
|
3063
2675
|
}
|
|
3064
2676
|
};
|
|
3065
|
-
return /* @__PURE__ */ (0,
|
|
2677
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3066
2678
|
"div",
|
|
3067
2679
|
{
|
|
3068
2680
|
className: `tiptap-image-upload-drag-area ${isDragActive ? "drag-active" : ""} ${isDragOver ? "drag-over" : ""}`,
|
|
@@ -3085,28 +2697,28 @@ var ImageUploadPreview = ({
|
|
|
3085
2697
|
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
3086
2698
|
return `${parseFloat((bytes / Math.pow(k, i)).toFixed(2))} ${sizes[i]}`;
|
|
3087
2699
|
};
|
|
3088
|
-
return /* @__PURE__ */ (0,
|
|
3089
|
-
fileItem.status === "uploading" && /* @__PURE__ */ (0,
|
|
2700
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "tiptap-image-upload-preview", children: [
|
|
2701
|
+
fileItem.status === "uploading" && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3090
2702
|
"div",
|
|
3091
2703
|
{
|
|
3092
2704
|
className: "tiptap-image-upload-progress",
|
|
3093
2705
|
style: { width: `${fileItem.progress}%` }
|
|
3094
2706
|
}
|
|
3095
2707
|
),
|
|
3096
|
-
/* @__PURE__ */ (0,
|
|
3097
|
-
/* @__PURE__ */ (0,
|
|
3098
|
-
/* @__PURE__ */ (0,
|
|
3099
|
-
/* @__PURE__ */ (0,
|
|
3100
|
-
/* @__PURE__ */ (0,
|
|
3101
|
-
/* @__PURE__ */ (0,
|
|
2708
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "tiptap-image-upload-preview-content", children: [
|
|
2709
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "tiptap-image-upload-file-info", children: [
|
|
2710
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "tiptap-image-upload-file-icon", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(CloudUploadIcon, {}) }),
|
|
2711
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "tiptap-image-upload-details", children: [
|
|
2712
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "tiptap-image-upload-text", children: fileItem.file.name }),
|
|
2713
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "tiptap-image-upload-subtext", children: formatFileSize(fileItem.file.size) })
|
|
3102
2714
|
] })
|
|
3103
2715
|
] }),
|
|
3104
|
-
/* @__PURE__ */ (0,
|
|
3105
|
-
fileItem.status === "uploading" && /* @__PURE__ */ (0,
|
|
2716
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "tiptap-image-upload-actions", children: [
|
|
2717
|
+
fileItem.status === "uploading" && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("span", { className: "tiptap-image-upload-progress-text", children: [
|
|
3106
2718
|
fileItem.progress,
|
|
3107
2719
|
"%"
|
|
3108
2720
|
] }),
|
|
3109
|
-
/* @__PURE__ */ (0,
|
|
2721
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3110
2722
|
Button2,
|
|
3111
2723
|
{
|
|
3112
2724
|
type: "button",
|
|
@@ -3115,7 +2727,7 @@ var ImageUploadPreview = ({
|
|
|
3115
2727
|
e.stopPropagation();
|
|
3116
2728
|
onRemove();
|
|
3117
2729
|
},
|
|
3118
|
-
children: /* @__PURE__ */ (0,
|
|
2730
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(CloseIcon, { className: "tiptap-button-icon" })
|
|
3119
2731
|
}
|
|
3120
2732
|
)
|
|
3121
2733
|
] })
|
|
@@ -3125,18 +2737,18 @@ var ImageUploadPreview = ({
|
|
|
3125
2737
|
var DropZoneContent = ({
|
|
3126
2738
|
maxSize,
|
|
3127
2739
|
limit
|
|
3128
|
-
}) => /* @__PURE__ */ (0,
|
|
3129
|
-
/* @__PURE__ */ (0,
|
|
3130
|
-
/* @__PURE__ */ (0,
|
|
3131
|
-
/* @__PURE__ */ (0,
|
|
3132
|
-
/* @__PURE__ */ (0,
|
|
2740
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
|
|
2741
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "tiptap-image-upload-dropzone", children: [
|
|
2742
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FileIcon, {}),
|
|
2743
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FileCornerIcon, {}),
|
|
2744
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "tiptap-image-upload-icon-container", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(CloudUploadIcon, {}) })
|
|
3133
2745
|
] }),
|
|
3134
|
-
/* @__PURE__ */ (0,
|
|
3135
|
-
/* @__PURE__ */ (0,
|
|
3136
|
-
/* @__PURE__ */ (0,
|
|
2746
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "tiptap-image-upload-content", children: [
|
|
2747
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("span", { className: "tiptap-image-upload-text", children: [
|
|
2748
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("em", { children: "Click to upload" }),
|
|
3137
2749
|
" or drag and drop"
|
|
3138
2750
|
] }),
|
|
3139
|
-
/* @__PURE__ */ (0,
|
|
2751
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("span", { className: "tiptap-image-upload-subtext", children: [
|
|
3140
2752
|
"Maximum ",
|
|
3141
2753
|
limit,
|
|
3142
2754
|
" file",
|
|
@@ -3197,22 +2809,22 @@ var ImageUploadNode = (props) => {
|
|
|
3197
2809
|
}
|
|
3198
2810
|
};
|
|
3199
2811
|
const hasFiles = fileItems.length > 0;
|
|
3200
|
-
return /* @__PURE__ */ (0,
|
|
2812
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
3201
2813
|
import_react20.NodeViewWrapper,
|
|
3202
2814
|
{
|
|
3203
2815
|
className: "tiptap-image-upload",
|
|
3204
2816
|
tabIndex: 0,
|
|
3205
2817
|
onClick: handleClick,
|
|
3206
2818
|
children: [
|
|
3207
|
-
!hasFiles && /* @__PURE__ */ (0,
|
|
3208
|
-
hasFiles && /* @__PURE__ */ (0,
|
|
3209
|
-
fileItems.length > 1 && /* @__PURE__ */ (0,
|
|
3210
|
-
/* @__PURE__ */ (0,
|
|
2819
|
+
!hasFiles && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ImageUploadDragArea, { onFile: handleUpload, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DropZoneContent, { maxSize, limit }) }),
|
|
2820
|
+
hasFiles && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "tiptap-image-upload-previews", children: [
|
|
2821
|
+
fileItems.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "tiptap-image-upload-header", children: [
|
|
2822
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("span", { children: [
|
|
3211
2823
|
"Uploading ",
|
|
3212
2824
|
fileItems.length,
|
|
3213
2825
|
" files"
|
|
3214
2826
|
] }),
|
|
3215
|
-
/* @__PURE__ */ (0,
|
|
2827
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3216
2828
|
Button2,
|
|
3217
2829
|
{
|
|
3218
2830
|
type: "button",
|
|
@@ -3225,7 +2837,7 @@ var ImageUploadNode = (props) => {
|
|
|
3225
2837
|
}
|
|
3226
2838
|
)
|
|
3227
2839
|
] }),
|
|
3228
|
-
fileItems.map((fileItem) => /* @__PURE__ */ (0,
|
|
2840
|
+
fileItems.map((fileItem) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3229
2841
|
ImageUploadPreview,
|
|
3230
2842
|
{
|
|
3231
2843
|
fileItem,
|
|
@@ -3234,7 +2846,7 @@ var ImageUploadNode = (props) => {
|
|
|
3234
2846
|
fileItem.id
|
|
3235
2847
|
))
|
|
3236
2848
|
] }),
|
|
3237
|
-
/* @__PURE__ */ (0,
|
|
2849
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3238
2850
|
"input",
|
|
3239
2851
|
{
|
|
3240
2852
|
ref: inputRef,
|
|
@@ -3347,9 +2959,9 @@ var import_react38 = require("react");
|
|
|
3347
2959
|
|
|
3348
2960
|
// src/components/tiptap-icons/chevron-down-icon.tsx
|
|
3349
2961
|
var import_react24 = require("react");
|
|
3350
|
-
var
|
|
2962
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
3351
2963
|
var ChevronDownIcon = (0, import_react24.memo)(({ className, ...props }) => {
|
|
3352
|
-
return /* @__PURE__ */ (0,
|
|
2964
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3353
2965
|
"svg",
|
|
3354
2966
|
{
|
|
3355
2967
|
width: "24",
|
|
@@ -3359,7 +2971,7 @@ var ChevronDownIcon = (0, import_react24.memo)(({ className, ...props }) => {
|
|
|
3359
2971
|
fill: "currentColor",
|
|
3360
2972
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3361
2973
|
...props,
|
|
3362
|
-
children: /* @__PURE__ */ (0,
|
|
2974
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3363
2975
|
"path",
|
|
3364
2976
|
{
|
|
3365
2977
|
fillRule: "evenodd",
|
|
@@ -3407,7 +3019,7 @@ var import_react28 = require("react");
|
|
|
3407
3019
|
|
|
3408
3020
|
// src/components/tiptap-ui-primitive/badge/badge.tsx
|
|
3409
3021
|
var import_react27 = require("react");
|
|
3410
|
-
var
|
|
3022
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
3411
3023
|
var Badge = (0, import_react27.forwardRef)(
|
|
3412
3024
|
({
|
|
3413
3025
|
variant,
|
|
@@ -3418,7 +3030,7 @@ var Badge = (0, import_react27.forwardRef)(
|
|
|
3418
3030
|
children,
|
|
3419
3031
|
...props
|
|
3420
3032
|
}, ref) => {
|
|
3421
|
-
return /* @__PURE__ */ (0,
|
|
3033
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
3422
3034
|
"div",
|
|
3423
3035
|
{
|
|
3424
3036
|
ref,
|
|
@@ -3436,12 +3048,12 @@ var Badge = (0, import_react27.forwardRef)(
|
|
|
3436
3048
|
Badge.displayName = "Badge";
|
|
3437
3049
|
|
|
3438
3050
|
// src/components/tiptap-ui/heading-button/heading-button.tsx
|
|
3439
|
-
var
|
|
3051
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
3440
3052
|
function HeadingShortcutBadge({
|
|
3441
3053
|
level,
|
|
3442
3054
|
shortcutKeys = HEADING_SHORTCUT_KEYS[level]
|
|
3443
3055
|
}) {
|
|
3444
|
-
return /* @__PURE__ */ (0,
|
|
3056
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Badge, { children: parseShortcutKeys({ shortcutKeys }) });
|
|
3445
3057
|
}
|
|
3446
3058
|
var HeadingButton = (0, import_react28.forwardRef)(
|
|
3447
3059
|
({
|
|
@@ -3481,7 +3093,7 @@ var HeadingButton = (0, import_react28.forwardRef)(
|
|
|
3481
3093
|
if (!isVisible) {
|
|
3482
3094
|
return null;
|
|
3483
3095
|
}
|
|
3484
|
-
return /* @__PURE__ */ (0,
|
|
3096
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
3485
3097
|
Button2,
|
|
3486
3098
|
{
|
|
3487
3099
|
type: "button",
|
|
@@ -3497,10 +3109,10 @@ var HeadingButton = (0, import_react28.forwardRef)(
|
|
|
3497
3109
|
onClick: handleClick,
|
|
3498
3110
|
...buttonProps,
|
|
3499
3111
|
ref,
|
|
3500
|
-
children: children ?? /* @__PURE__ */ (0,
|
|
3501
|
-
/* @__PURE__ */ (0,
|
|
3502
|
-
text && /* @__PURE__ */ (0,
|
|
3503
|
-
showShortcut && /* @__PURE__ */ (0,
|
|
3112
|
+
children: children ?? /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_jsx_runtime27.Fragment, { children: [
|
|
3113
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Icon, { className: "tiptap-button-icon" }),
|
|
3114
|
+
text && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "tiptap-button-text", children: text }),
|
|
3115
|
+
showShortcut && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(HeadingShortcutBadge, { level, shortcutKeys })
|
|
3504
3116
|
] })
|
|
3505
3117
|
}
|
|
3506
3118
|
);
|
|
@@ -3510,13 +3122,13 @@ HeadingButton.displayName = "HeadingButton";
|
|
|
3510
3122
|
|
|
3511
3123
|
// src/components/tiptap-ui/heading-button/use-heading.ts
|
|
3512
3124
|
var import_react35 = require("react");
|
|
3513
|
-
var
|
|
3125
|
+
var import_state2 = require("@tiptap/pm/state");
|
|
3514
3126
|
|
|
3515
3127
|
// src/components/tiptap-icons/heading-one-icon.tsx
|
|
3516
3128
|
var import_react29 = require("react");
|
|
3517
|
-
var
|
|
3129
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
3518
3130
|
var HeadingOneIcon = (0, import_react29.memo)(({ className, ...props }) => {
|
|
3519
|
-
return /* @__PURE__ */ (0,
|
|
3131
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
3520
3132
|
"svg",
|
|
3521
3133
|
{
|
|
3522
3134
|
width: "24",
|
|
@@ -3527,14 +3139,14 @@ var HeadingOneIcon = (0, import_react29.memo)(({ className, ...props }) => {
|
|
|
3527
3139
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3528
3140
|
...props,
|
|
3529
3141
|
children: [
|
|
3530
|
-
/* @__PURE__ */ (0,
|
|
3142
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
3531
3143
|
"path",
|
|
3532
3144
|
{
|
|
3533
3145
|
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",
|
|
3534
3146
|
fill: "currentColor"
|
|
3535
3147
|
}
|
|
3536
3148
|
),
|
|
3537
|
-
/* @__PURE__ */ (0,
|
|
3149
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
3538
3150
|
"path",
|
|
3539
3151
|
{
|
|
3540
3152
|
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",
|
|
@@ -3549,9 +3161,9 @@ HeadingOneIcon.displayName = "HeadingOneIcon";
|
|
|
3549
3161
|
|
|
3550
3162
|
// src/components/tiptap-icons/heading-two-icon.tsx
|
|
3551
3163
|
var import_react30 = require("react");
|
|
3552
|
-
var
|
|
3164
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
3553
3165
|
var HeadingTwoIcon = (0, import_react30.memo)(({ className, ...props }) => {
|
|
3554
|
-
return /* @__PURE__ */ (0,
|
|
3166
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
3555
3167
|
"svg",
|
|
3556
3168
|
{
|
|
3557
3169
|
width: "24",
|
|
@@ -3562,14 +3174,14 @@ var HeadingTwoIcon = (0, import_react30.memo)(({ className, ...props }) => {
|
|
|
3562
3174
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3563
3175
|
...props,
|
|
3564
3176
|
children: [
|
|
3565
|
-
/* @__PURE__ */ (0,
|
|
3177
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
3566
3178
|
"path",
|
|
3567
3179
|
{
|
|
3568
3180
|
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",
|
|
3569
3181
|
fill: "currentColor"
|
|
3570
3182
|
}
|
|
3571
3183
|
),
|
|
3572
|
-
/* @__PURE__ */ (0,
|
|
3184
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
3573
3185
|
"path",
|
|
3574
3186
|
{
|
|
3575
3187
|
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",
|
|
@@ -3584,9 +3196,9 @@ HeadingTwoIcon.displayName = "HeadingTwoIcon";
|
|
|
3584
3196
|
|
|
3585
3197
|
// src/components/tiptap-icons/heading-three-icon.tsx
|
|
3586
3198
|
var import_react31 = require("react");
|
|
3587
|
-
var
|
|
3199
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
3588
3200
|
var HeadingThreeIcon = (0, import_react31.memo)(({ className, ...props }) => {
|
|
3589
|
-
return /* @__PURE__ */ (0,
|
|
3201
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
3590
3202
|
"svg",
|
|
3591
3203
|
{
|
|
3592
3204
|
width: "24",
|
|
@@ -3597,14 +3209,14 @@ var HeadingThreeIcon = (0, import_react31.memo)(({ className, ...props }) => {
|
|
|
3597
3209
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3598
3210
|
...props,
|
|
3599
3211
|
children: [
|
|
3600
|
-
/* @__PURE__ */ (0,
|
|
3212
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
3601
3213
|
"path",
|
|
3602
3214
|
{
|
|
3603
3215
|
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",
|
|
3604
3216
|
fill: "currentColor"
|
|
3605
3217
|
}
|
|
3606
3218
|
),
|
|
3607
|
-
/* @__PURE__ */ (0,
|
|
3219
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
3608
3220
|
"path",
|
|
3609
3221
|
{
|
|
3610
3222
|
fillRule: "evenodd",
|
|
@@ -3613,7 +3225,7 @@ var HeadingThreeIcon = (0, import_react31.memo)(({ className, ...props }) => {
|
|
|
3613
3225
|
fill: "currentColor"
|
|
3614
3226
|
}
|
|
3615
3227
|
),
|
|
3616
|
-
/* @__PURE__ */ (0,
|
|
3228
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
3617
3229
|
"path",
|
|
3618
3230
|
{
|
|
3619
3231
|
fillRule: "evenodd",
|
|
@@ -3630,9 +3242,9 @@ HeadingThreeIcon.displayName = "HeadingThreeIcon";
|
|
|
3630
3242
|
|
|
3631
3243
|
// src/components/tiptap-icons/heading-four-icon.tsx
|
|
3632
3244
|
var import_react32 = require("react");
|
|
3633
|
-
var
|
|
3245
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
3634
3246
|
var HeadingFourIcon = (0, import_react32.memo)(({ className, ...props }) => {
|
|
3635
|
-
return /* @__PURE__ */ (0,
|
|
3247
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
3636
3248
|
"svg",
|
|
3637
3249
|
{
|
|
3638
3250
|
width: "24",
|
|
@@ -3643,14 +3255,14 @@ var HeadingFourIcon = (0, import_react32.memo)(({ className, ...props }) => {
|
|
|
3643
3255
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3644
3256
|
...props,
|
|
3645
3257
|
children: [
|
|
3646
|
-
/* @__PURE__ */ (0,
|
|
3258
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3647
3259
|
"path",
|
|
3648
3260
|
{
|
|
3649
3261
|
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",
|
|
3650
3262
|
fill: "currentColor"
|
|
3651
3263
|
}
|
|
3652
3264
|
),
|
|
3653
|
-
/* @__PURE__ */ (0,
|
|
3265
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3654
3266
|
"path",
|
|
3655
3267
|
{
|
|
3656
3268
|
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",
|
|
@@ -3665,9 +3277,9 @@ HeadingFourIcon.displayName = "HeadingFourIcon";
|
|
|
3665
3277
|
|
|
3666
3278
|
// src/components/tiptap-icons/heading-five-icon.tsx
|
|
3667
3279
|
var import_react33 = require("react");
|
|
3668
|
-
var
|
|
3280
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
3669
3281
|
var HeadingFiveIcon = (0, import_react33.memo)(({ className, ...props }) => {
|
|
3670
|
-
return /* @__PURE__ */ (0,
|
|
3282
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
3671
3283
|
"svg",
|
|
3672
3284
|
{
|
|
3673
3285
|
width: "24",
|
|
@@ -3678,14 +3290,14 @@ var HeadingFiveIcon = (0, import_react33.memo)(({ className, ...props }) => {
|
|
|
3678
3290
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3679
3291
|
...props,
|
|
3680
3292
|
children: [
|
|
3681
|
-
/* @__PURE__ */ (0,
|
|
3293
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
3682
3294
|
"path",
|
|
3683
3295
|
{
|
|
3684
3296
|
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",
|
|
3685
3297
|
fill: "currentColor"
|
|
3686
3298
|
}
|
|
3687
3299
|
),
|
|
3688
|
-
/* @__PURE__ */ (0,
|
|
3300
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
3689
3301
|
"path",
|
|
3690
3302
|
{
|
|
3691
3303
|
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",
|
|
@@ -3700,9 +3312,9 @@ HeadingFiveIcon.displayName = "HeadingFiveIcon";
|
|
|
3700
3312
|
|
|
3701
3313
|
// src/components/tiptap-icons/heading-six-icon.tsx
|
|
3702
3314
|
var import_react34 = require("react");
|
|
3703
|
-
var
|
|
3315
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
3704
3316
|
var HeadingSixIcon = (0, import_react34.memo)(({ className, ...props }) => {
|
|
3705
|
-
return /* @__PURE__ */ (0,
|
|
3317
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
3706
3318
|
"svg",
|
|
3707
3319
|
{
|
|
3708
3320
|
width: "24",
|
|
@@ -3713,14 +3325,14 @@ var HeadingSixIcon = (0, import_react34.memo)(({ className, ...props }) => {
|
|
|
3713
3325
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3714
3326
|
...props,
|
|
3715
3327
|
children: [
|
|
3716
|
-
/* @__PURE__ */ (0,
|
|
3328
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
3717
3329
|
"path",
|
|
3718
3330
|
{
|
|
3719
3331
|
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",
|
|
3720
3332
|
fill: "currentColor"
|
|
3721
3333
|
}
|
|
3722
3334
|
),
|
|
3723
|
-
/* @__PURE__ */ (0,
|
|
3335
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
3724
3336
|
"path",
|
|
3725
3337
|
{
|
|
3726
3338
|
fillRule: "evenodd",
|
|
@@ -3787,26 +3399,26 @@ function toggleHeading(editor, level) {
|
|
|
3787
3399
|
const view = editor.view;
|
|
3788
3400
|
let state = view.state;
|
|
3789
3401
|
let tr = state.tr;
|
|
3790
|
-
if (state.selection.empty || state.selection instanceof
|
|
3402
|
+
if (state.selection.empty || state.selection instanceof import_state2.TextSelection) {
|
|
3791
3403
|
const pos = findNodePosition({
|
|
3792
3404
|
editor,
|
|
3793
3405
|
node: state.selection.$anchor.node(1)
|
|
3794
3406
|
})?.pos;
|
|
3795
3407
|
if (!isValidPosition(pos)) return false;
|
|
3796
|
-
tr = tr.setSelection(
|
|
3408
|
+
tr = tr.setSelection(import_state2.NodeSelection.create(state.doc, pos));
|
|
3797
3409
|
view.dispatch(tr);
|
|
3798
3410
|
state = view.state;
|
|
3799
3411
|
}
|
|
3800
3412
|
const selection = state.selection;
|
|
3801
3413
|
let chain = editor.chain().focus();
|
|
3802
|
-
if (selection instanceof
|
|
3414
|
+
if (selection instanceof import_state2.NodeSelection) {
|
|
3803
3415
|
const firstChild = selection.node.firstChild?.firstChild;
|
|
3804
3416
|
const lastChild = selection.node.lastChild?.lastChild;
|
|
3805
3417
|
const from = firstChild ? selection.from + firstChild.nodeSize : selection.from + 1;
|
|
3806
3418
|
const to = lastChild ? selection.to - lastChild.nodeSize : selection.to - 1;
|
|
3807
3419
|
const resolvedFrom = state.doc.resolve(from);
|
|
3808
3420
|
const resolvedTo = state.doc.resolve(to);
|
|
3809
|
-
chain = chain.setTextSelection(
|
|
3421
|
+
chain = chain.setTextSelection(import_state2.TextSelection.between(resolvedFrom, resolvedTo)).clearNodes();
|
|
3810
3422
|
}
|
|
3811
3423
|
const isActive = levels.some(
|
|
3812
3424
|
(l) => editor.isActive("heading", { level: l })
|
|
@@ -3875,22 +3487,22 @@ function useHeading(config) {
|
|
|
3875
3487
|
// src/components/tiptap-ui-primitive/dropdown-menu/dropdown-menu.tsx
|
|
3876
3488
|
var import_react36 = require("react");
|
|
3877
3489
|
var DropdownMenuPrimitive = __toESM(require("@radix-ui/react-dropdown-menu"));
|
|
3878
|
-
var
|
|
3490
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
3879
3491
|
function DropdownMenu({
|
|
3880
3492
|
...props
|
|
3881
3493
|
}) {
|
|
3882
|
-
return /* @__PURE__ */ (0,
|
|
3494
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(DropdownMenuPrimitive.Root, { modal: false, ...props });
|
|
3883
3495
|
}
|
|
3884
3496
|
function DropdownMenuPortal({
|
|
3885
3497
|
...props
|
|
3886
3498
|
}) {
|
|
3887
|
-
return /* @__PURE__ */ (0,
|
|
3499
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(DropdownMenuPrimitive.Portal, { ...props });
|
|
3888
3500
|
}
|
|
3889
|
-
var DropdownMenuTrigger = (0, import_react36.forwardRef)(({ ...props }, ref) => /* @__PURE__ */ (0,
|
|
3501
|
+
var DropdownMenuTrigger = (0, import_react36.forwardRef)(({ ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(DropdownMenuPrimitive.Trigger, { ref, ...props }));
|
|
3890
3502
|
DropdownMenuTrigger.displayName = DropdownMenuPrimitive.Trigger.displayName;
|
|
3891
3503
|
var DropdownMenuItem = DropdownMenuPrimitive.Item;
|
|
3892
3504
|
var DropdownMenuSubContent = (0, import_react36.forwardRef)(({ className, portal = true, ...props }, ref) => {
|
|
3893
|
-
const content = /* @__PURE__ */ (0,
|
|
3505
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
3894
3506
|
DropdownMenuPrimitive.SubContent,
|
|
3895
3507
|
{
|
|
3896
3508
|
ref,
|
|
@@ -3898,11 +3510,11 @@ var DropdownMenuSubContent = (0, import_react36.forwardRef)(({ className, portal
|
|
|
3898
3510
|
...props
|
|
3899
3511
|
}
|
|
3900
3512
|
);
|
|
3901
|
-
return portal ? /* @__PURE__ */ (0,
|
|
3513
|
+
return portal ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(DropdownMenuPortal, { ...typeof portal === "object" ? portal : {}, children: content }) : content;
|
|
3902
3514
|
});
|
|
3903
3515
|
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
3904
3516
|
var DropdownMenuContent = (0, import_react36.forwardRef)(({ className, sideOffset = 4, portal = false, ...props }, ref) => {
|
|
3905
|
-
const content = /* @__PURE__ */ (0,
|
|
3517
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
3906
3518
|
DropdownMenuPrimitive.Content,
|
|
3907
3519
|
{
|
|
3908
3520
|
ref,
|
|
@@ -3912,22 +3524,22 @@ var DropdownMenuContent = (0, import_react36.forwardRef)(({ className, sideOffse
|
|
|
3912
3524
|
...props
|
|
3913
3525
|
}
|
|
3914
3526
|
);
|
|
3915
|
-
return portal ? /* @__PURE__ */ (0,
|
|
3527
|
+
return portal ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(DropdownMenuPortal, { ...typeof portal === "object" ? portal : {}, children: content }) : content;
|
|
3916
3528
|
});
|
|
3917
3529
|
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
3918
3530
|
|
|
3919
3531
|
// src/components/tiptap-ui-primitive/card/card.tsx
|
|
3920
3532
|
var import_react37 = require("react");
|
|
3921
|
-
var
|
|
3533
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
3922
3534
|
var Card = (0, import_react37.forwardRef)(
|
|
3923
3535
|
({ className, ...props }, ref) => {
|
|
3924
|
-
return /* @__PURE__ */ (0,
|
|
3536
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { ref, className: cn2("tiptap-card", className), ...props });
|
|
3925
3537
|
}
|
|
3926
3538
|
);
|
|
3927
3539
|
Card.displayName = "Card";
|
|
3928
3540
|
var CardHeader = (0, import_react37.forwardRef)(
|
|
3929
3541
|
({ className, ...props }, ref) => {
|
|
3930
|
-
return /* @__PURE__ */ (0,
|
|
3542
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3931
3543
|
"div",
|
|
3932
3544
|
{
|
|
3933
3545
|
ref,
|
|
@@ -3940,12 +3552,12 @@ var CardHeader = (0, import_react37.forwardRef)(
|
|
|
3940
3552
|
CardHeader.displayName = "CardHeader";
|
|
3941
3553
|
var CardBody = (0, import_react37.forwardRef)(
|
|
3942
3554
|
({ className, ...props }, ref) => {
|
|
3943
|
-
return /* @__PURE__ */ (0,
|
|
3555
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { ref, className: cn2("tiptap-card-body", className), ...props });
|
|
3944
3556
|
}
|
|
3945
3557
|
);
|
|
3946
3558
|
CardBody.displayName = "CardBody";
|
|
3947
3559
|
var CardItemGroup = (0, import_react37.forwardRef)(({ className, orientation = "vertical", ...props }, ref) => {
|
|
3948
|
-
return /* @__PURE__ */ (0,
|
|
3560
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3949
3561
|
"div",
|
|
3950
3562
|
{
|
|
3951
3563
|
ref,
|
|
@@ -3958,7 +3570,7 @@ var CardItemGroup = (0, import_react37.forwardRef)(({ className, orientation = "
|
|
|
3958
3570
|
CardItemGroup.displayName = "CardItemGroup";
|
|
3959
3571
|
var CardGroupLabel = (0, import_react37.forwardRef)(
|
|
3960
3572
|
({ className, ...props }, ref) => {
|
|
3961
|
-
return /* @__PURE__ */ (0,
|
|
3573
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3962
3574
|
"div",
|
|
3963
3575
|
{
|
|
3964
3576
|
ref,
|
|
@@ -3971,7 +3583,7 @@ var CardGroupLabel = (0, import_react37.forwardRef)(
|
|
|
3971
3583
|
CardGroupLabel.displayName = "CardGroupLabel";
|
|
3972
3584
|
var CardFooter = (0, import_react37.forwardRef)(
|
|
3973
3585
|
({ className, ...props }, ref) => {
|
|
3974
|
-
return /* @__PURE__ */ (0,
|
|
3586
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3975
3587
|
"div",
|
|
3976
3588
|
{
|
|
3977
3589
|
ref,
|
|
@@ -3984,7 +3596,7 @@ var CardFooter = (0, import_react37.forwardRef)(
|
|
|
3984
3596
|
CardFooter.displayName = "CardFooter";
|
|
3985
3597
|
|
|
3986
3598
|
// src/components/tiptap-ui/heading-dropdown-menu/heading-dropdown-menu.tsx
|
|
3987
|
-
var
|
|
3599
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
3988
3600
|
var HeadingDropdownMenu = (0, import_react38.forwardRef)(
|
|
3989
3601
|
({
|
|
3990
3602
|
editor: providedEditor,
|
|
@@ -4012,8 +3624,8 @@ var HeadingDropdownMenu = (0, import_react38.forwardRef)(
|
|
|
4012
3624
|
if (!isVisible) {
|
|
4013
3625
|
return null;
|
|
4014
3626
|
}
|
|
4015
|
-
return /* @__PURE__ */ (0,
|
|
4016
|
-
/* @__PURE__ */ (0,
|
|
3627
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(DropdownMenu, { modal: true, open: isOpen, onOpenChange: handleOpenChange, children: [
|
|
3628
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
4017
3629
|
Button2,
|
|
4018
3630
|
{
|
|
4019
3631
|
type: "button",
|
|
@@ -4029,12 +3641,12 @@ var HeadingDropdownMenu = (0, import_react38.forwardRef)(
|
|
|
4029
3641
|
...buttonProps,
|
|
4030
3642
|
ref,
|
|
4031
3643
|
children: [
|
|
4032
|
-
/* @__PURE__ */ (0,
|
|
4033
|
-
/* @__PURE__ */ (0,
|
|
3644
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Icon, { className: "tiptap-button-icon" }),
|
|
3645
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ChevronDownIcon, { className: "tiptap-button-dropdown-small" })
|
|
4034
3646
|
]
|
|
4035
3647
|
}
|
|
4036
3648
|
) }),
|
|
4037
|
-
/* @__PURE__ */ (0,
|
|
3649
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(DropdownMenuContent, { align: "start", portal, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Card, { children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ButtonGroup, { children: levels.map((level) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(DropdownMenuItem, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
4038
3650
|
HeadingButton,
|
|
4039
3651
|
{
|
|
4040
3652
|
editor,
|
|
@@ -4053,9 +3665,9 @@ var import_react40 = require("react");
|
|
|
4053
3665
|
|
|
4054
3666
|
// src/components/tiptap-icons/heading-icon.tsx
|
|
4055
3667
|
var import_react39 = require("react");
|
|
4056
|
-
var
|
|
3668
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
4057
3669
|
var HeadingIcon = (0, import_react39.memo)(({ className, ...props }) => {
|
|
4058
|
-
return /* @__PURE__ */ (0,
|
|
3670
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
4059
3671
|
"svg",
|
|
4060
3672
|
{
|
|
4061
3673
|
width: "24",
|
|
@@ -4065,7 +3677,7 @@ var HeadingIcon = (0, import_react39.memo)(({ className, ...props }) => {
|
|
|
4065
3677
|
fill: "currentColor",
|
|
4066
3678
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4067
3679
|
...props,
|
|
4068
|
-
children: /* @__PURE__ */ (0,
|
|
3680
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
4069
3681
|
"path",
|
|
4070
3682
|
{
|
|
4071
3683
|
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",
|
|
@@ -4119,11 +3731,11 @@ function useHeadingDropdownMenu(config) {
|
|
|
4119
3731
|
|
|
4120
3732
|
// src/components/tiptap-ui/image-upload-button/image-upload-button.tsx
|
|
4121
3733
|
var import_react41 = require("react");
|
|
4122
|
-
var
|
|
3734
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
4123
3735
|
function ImageShortcutBadge({
|
|
4124
3736
|
shortcutKeys = IMAGE_UPLOAD_SHORTCUT_KEY
|
|
4125
3737
|
}) {
|
|
4126
|
-
return /* @__PURE__ */ (0,
|
|
3738
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Badge, { children: parseShortcutKeys({ shortcutKeys }) });
|
|
4127
3739
|
}
|
|
4128
3740
|
var ImageUploadButton = (0, import_react41.forwardRef)(
|
|
4129
3741
|
({
|
|
@@ -4163,7 +3775,7 @@ var ImageUploadButton = (0, import_react41.forwardRef)(
|
|
|
4163
3775
|
return null;
|
|
4164
3776
|
}
|
|
4165
3777
|
const RenderIcon = CustomIcon ?? Icon;
|
|
4166
|
-
return /* @__PURE__ */ (0,
|
|
3778
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
4167
3779
|
Button2,
|
|
4168
3780
|
{
|
|
4169
3781
|
type: "button",
|
|
@@ -4179,10 +3791,10 @@ var ImageUploadButton = (0, import_react41.forwardRef)(
|
|
|
4179
3791
|
onClick: handleClick,
|
|
4180
3792
|
...buttonProps,
|
|
4181
3793
|
ref,
|
|
4182
|
-
children: children ?? /* @__PURE__ */ (0,
|
|
4183
|
-
/* @__PURE__ */ (0,
|
|
4184
|
-
text && /* @__PURE__ */ (0,
|
|
4185
|
-
showShortcut && /* @__PURE__ */ (0,
|
|
3794
|
+
children: children ?? /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
|
|
3795
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(RenderIcon, { className: "tiptap-button-icon" }),
|
|
3796
|
+
text && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "tiptap-button-text", children: text }),
|
|
3797
|
+
showShortcut && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ImageShortcutBadge, { shortcutKeys })
|
|
4186
3798
|
] })
|
|
4187
3799
|
}
|
|
4188
3800
|
);
|
|
@@ -4211,9 +3823,9 @@ function useIsBreakpoint(mode = "max", breakpoint = 768) {
|
|
|
4211
3823
|
|
|
4212
3824
|
// src/components/tiptap-icons/image-plus-icon.tsx
|
|
4213
3825
|
var import_react43 = require("react");
|
|
4214
|
-
var
|
|
3826
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
4215
3827
|
var ImagePlusIcon = (0, import_react43.memo)(({ className, ...props }) => {
|
|
4216
|
-
return /* @__PURE__ */ (0,
|
|
3828
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
4217
3829
|
"svg",
|
|
4218
3830
|
{
|
|
4219
3831
|
width: "24",
|
|
@@ -4223,7 +3835,7 @@ var ImagePlusIcon = (0, import_react43.memo)(({ className, ...props }) => {
|
|
|
4223
3835
|
fill: "currentColor",
|
|
4224
3836
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4225
3837
|
...props,
|
|
4226
|
-
children: /* @__PURE__ */ (0,
|
|
3838
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
4227
3839
|
"path",
|
|
4228
3840
|
{
|
|
4229
3841
|
fillRule: "evenodd",
|
|
@@ -4347,12 +3959,12 @@ var import_react51 = require("react");
|
|
|
4347
3959
|
|
|
4348
3960
|
// src/components/tiptap-ui/list-button/list-button.tsx
|
|
4349
3961
|
var import_react45 = require("react");
|
|
4350
|
-
var
|
|
3962
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
4351
3963
|
function ListShortcutBadge({
|
|
4352
3964
|
type,
|
|
4353
3965
|
shortcutKeys = LIST_SHORTCUT_KEYS[type]
|
|
4354
3966
|
}) {
|
|
4355
|
-
return /* @__PURE__ */ (0,
|
|
3967
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Badge, { children: parseShortcutKeys({ shortcutKeys }) });
|
|
4356
3968
|
}
|
|
4357
3969
|
var ListButton = (0, import_react45.forwardRef)(
|
|
4358
3970
|
({
|
|
@@ -4392,7 +4004,7 @@ var ListButton = (0, import_react45.forwardRef)(
|
|
|
4392
4004
|
if (!isVisible) {
|
|
4393
4005
|
return null;
|
|
4394
4006
|
}
|
|
4395
|
-
return /* @__PURE__ */ (0,
|
|
4007
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
4396
4008
|
Button2,
|
|
4397
4009
|
{
|
|
4398
4010
|
type: "button",
|
|
@@ -4408,10 +4020,10 @@ var ListButton = (0, import_react45.forwardRef)(
|
|
|
4408
4020
|
onClick: handleClick,
|
|
4409
4021
|
...buttonProps,
|
|
4410
4022
|
ref,
|
|
4411
|
-
children: children ?? /* @__PURE__ */ (0,
|
|
4412
|
-
/* @__PURE__ */ (0,
|
|
4413
|
-
text && /* @__PURE__ */ (0,
|
|
4414
|
-
showShortcut && /* @__PURE__ */ (0,
|
|
4023
|
+
children: children ?? /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
|
|
4024
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Icon, { className: "tiptap-button-icon" }),
|
|
4025
|
+
text && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "tiptap-button-text", children: text }),
|
|
4026
|
+
showShortcut && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(ListShortcutBadge, { type, shortcutKeys })
|
|
4415
4027
|
] })
|
|
4416
4028
|
}
|
|
4417
4029
|
);
|
|
@@ -4421,13 +4033,13 @@ ListButton.displayName = "ListButton";
|
|
|
4421
4033
|
|
|
4422
4034
|
// src/components/tiptap-ui/list-button/use-list.ts
|
|
4423
4035
|
var import_react49 = require("react");
|
|
4424
|
-
var
|
|
4036
|
+
var import_state3 = require("@tiptap/pm/state");
|
|
4425
4037
|
|
|
4426
4038
|
// src/components/tiptap-icons/list-icon.tsx
|
|
4427
4039
|
var import_react46 = require("react");
|
|
4428
|
-
var
|
|
4040
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
4429
4041
|
var ListIcon = (0, import_react46.memo)(({ className, ...props }) => {
|
|
4430
|
-
return /* @__PURE__ */ (0,
|
|
4042
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
4431
4043
|
"svg",
|
|
4432
4044
|
{
|
|
4433
4045
|
width: "24",
|
|
@@ -4438,7 +4050,7 @@ var ListIcon = (0, import_react46.memo)(({ className, ...props }) => {
|
|
|
4438
4050
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4439
4051
|
...props,
|
|
4440
4052
|
children: [
|
|
4441
|
-
/* @__PURE__ */ (0,
|
|
4053
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
4442
4054
|
"path",
|
|
4443
4055
|
{
|
|
4444
4056
|
fillRule: "evenodd",
|
|
@@ -4447,7 +4059,7 @@ var ListIcon = (0, import_react46.memo)(({ className, ...props }) => {
|
|
|
4447
4059
|
fill: "currentColor"
|
|
4448
4060
|
}
|
|
4449
4061
|
),
|
|
4450
|
-
/* @__PURE__ */ (0,
|
|
4062
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
4451
4063
|
"path",
|
|
4452
4064
|
{
|
|
4453
4065
|
fillRule: "evenodd",
|
|
@@ -4456,7 +4068,7 @@ var ListIcon = (0, import_react46.memo)(({ className, ...props }) => {
|
|
|
4456
4068
|
fill: "currentColor"
|
|
4457
4069
|
}
|
|
4458
4070
|
),
|
|
4459
|
-
/* @__PURE__ */ (0,
|
|
4071
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
4460
4072
|
"path",
|
|
4461
4073
|
{
|
|
4462
4074
|
fillRule: "evenodd",
|
|
@@ -4465,7 +4077,7 @@ var ListIcon = (0, import_react46.memo)(({ className, ...props }) => {
|
|
|
4465
4077
|
fill: "currentColor"
|
|
4466
4078
|
}
|
|
4467
4079
|
),
|
|
4468
|
-
/* @__PURE__ */ (0,
|
|
4080
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
4469
4081
|
"path",
|
|
4470
4082
|
{
|
|
4471
4083
|
fillRule: "evenodd",
|
|
@@ -4474,7 +4086,7 @@ var ListIcon = (0, import_react46.memo)(({ className, ...props }) => {
|
|
|
4474
4086
|
fill: "currentColor"
|
|
4475
4087
|
}
|
|
4476
4088
|
),
|
|
4477
|
-
/* @__PURE__ */ (0,
|
|
4089
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
4478
4090
|
"path",
|
|
4479
4091
|
{
|
|
4480
4092
|
fillRule: "evenodd",
|
|
@@ -4483,7 +4095,7 @@ var ListIcon = (0, import_react46.memo)(({ className, ...props }) => {
|
|
|
4483
4095
|
fill: "currentColor"
|
|
4484
4096
|
}
|
|
4485
4097
|
),
|
|
4486
|
-
/* @__PURE__ */ (0,
|
|
4098
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
4487
4099
|
"path",
|
|
4488
4100
|
{
|
|
4489
4101
|
fillRule: "evenodd",
|
|
@@ -4500,9 +4112,9 @@ ListIcon.displayName = "ListIcon";
|
|
|
4500
4112
|
|
|
4501
4113
|
// src/components/tiptap-icons/list-ordered-icon.tsx
|
|
4502
4114
|
var import_react47 = require("react");
|
|
4503
|
-
var
|
|
4115
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
4504
4116
|
var ListOrderedIcon = (0, import_react47.memo)(({ className, ...props }) => {
|
|
4505
|
-
return /* @__PURE__ */ (0,
|
|
4117
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
4506
4118
|
"svg",
|
|
4507
4119
|
{
|
|
4508
4120
|
width: "24",
|
|
@@ -4513,7 +4125,7 @@ var ListOrderedIcon = (0, import_react47.memo)(({ className, ...props }) => {
|
|
|
4513
4125
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4514
4126
|
...props,
|
|
4515
4127
|
children: [
|
|
4516
|
-
/* @__PURE__ */ (0,
|
|
4128
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
4517
4129
|
"path",
|
|
4518
4130
|
{
|
|
4519
4131
|
fillRule: "evenodd",
|
|
@@ -4522,7 +4134,7 @@ var ListOrderedIcon = (0, import_react47.memo)(({ className, ...props }) => {
|
|
|
4522
4134
|
fill: "currentColor"
|
|
4523
4135
|
}
|
|
4524
4136
|
),
|
|
4525
|
-
/* @__PURE__ */ (0,
|
|
4137
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
4526
4138
|
"path",
|
|
4527
4139
|
{
|
|
4528
4140
|
fillRule: "evenodd",
|
|
@@ -4531,7 +4143,7 @@ var ListOrderedIcon = (0, import_react47.memo)(({ className, ...props }) => {
|
|
|
4531
4143
|
fill: "currentColor"
|
|
4532
4144
|
}
|
|
4533
4145
|
),
|
|
4534
|
-
/* @__PURE__ */ (0,
|
|
4146
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
4535
4147
|
"path",
|
|
4536
4148
|
{
|
|
4537
4149
|
fillRule: "evenodd",
|
|
@@ -4540,7 +4152,7 @@ var ListOrderedIcon = (0, import_react47.memo)(({ className, ...props }) => {
|
|
|
4540
4152
|
fill: "currentColor"
|
|
4541
4153
|
}
|
|
4542
4154
|
),
|
|
4543
|
-
/* @__PURE__ */ (0,
|
|
4155
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
4544
4156
|
"path",
|
|
4545
4157
|
{
|
|
4546
4158
|
fillRule: "evenodd",
|
|
@@ -4549,7 +4161,7 @@ var ListOrderedIcon = (0, import_react47.memo)(({ className, ...props }) => {
|
|
|
4549
4161
|
fill: "currentColor"
|
|
4550
4162
|
}
|
|
4551
4163
|
),
|
|
4552
|
-
/* @__PURE__ */ (0,
|
|
4164
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
4553
4165
|
"path",
|
|
4554
4166
|
{
|
|
4555
4167
|
fillRule: "evenodd",
|
|
@@ -4558,7 +4170,7 @@ var ListOrderedIcon = (0, import_react47.memo)(({ className, ...props }) => {
|
|
|
4558
4170
|
fill: "currentColor"
|
|
4559
4171
|
}
|
|
4560
4172
|
),
|
|
4561
|
-
/* @__PURE__ */ (0,
|
|
4173
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
4562
4174
|
"path",
|
|
4563
4175
|
{
|
|
4564
4176
|
fillRule: "evenodd",
|
|
@@ -4575,9 +4187,9 @@ ListOrderedIcon.displayName = "ListOrderedIcon";
|
|
|
4575
4187
|
|
|
4576
4188
|
// src/components/tiptap-icons/list-todo-icon.tsx
|
|
4577
4189
|
var import_react48 = require("react");
|
|
4578
|
-
var
|
|
4190
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
4579
4191
|
var ListTodoIcon = (0, import_react48.memo)(({ className, ...props }) => {
|
|
4580
|
-
return /* @__PURE__ */ (0,
|
|
4192
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
4581
4193
|
"svg",
|
|
4582
4194
|
{
|
|
4583
4195
|
width: "24",
|
|
@@ -4588,7 +4200,7 @@ var ListTodoIcon = (0, import_react48.memo)(({ className, ...props }) => {
|
|
|
4588
4200
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4589
4201
|
...props,
|
|
4590
4202
|
children: [
|
|
4591
|
-
/* @__PURE__ */ (0,
|
|
4203
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
4592
4204
|
"path",
|
|
4593
4205
|
{
|
|
4594
4206
|
fillRule: "evenodd",
|
|
@@ -4597,7 +4209,7 @@ var ListTodoIcon = (0, import_react48.memo)(({ className, ...props }) => {
|
|
|
4597
4209
|
fill: "currentColor"
|
|
4598
4210
|
}
|
|
4599
4211
|
),
|
|
4600
|
-
/* @__PURE__ */ (0,
|
|
4212
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
4601
4213
|
"path",
|
|
4602
4214
|
{
|
|
4603
4215
|
fillRule: "evenodd",
|
|
@@ -4606,7 +4218,7 @@ var ListTodoIcon = (0, import_react48.memo)(({ className, ...props }) => {
|
|
|
4606
4218
|
fill: "currentColor"
|
|
4607
4219
|
}
|
|
4608
4220
|
),
|
|
4609
|
-
/* @__PURE__ */ (0,
|
|
4221
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
4610
4222
|
"path",
|
|
4611
4223
|
{
|
|
4612
4224
|
fillRule: "evenodd",
|
|
@@ -4615,7 +4227,7 @@ var ListTodoIcon = (0, import_react48.memo)(({ className, ...props }) => {
|
|
|
4615
4227
|
fill: "currentColor"
|
|
4616
4228
|
}
|
|
4617
4229
|
),
|
|
4618
|
-
/* @__PURE__ */ (0,
|
|
4230
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
4619
4231
|
"path",
|
|
4620
4232
|
{
|
|
4621
4233
|
fillRule: "evenodd",
|
|
@@ -4624,7 +4236,7 @@ var ListTodoIcon = (0, import_react48.memo)(({ className, ...props }) => {
|
|
|
4624
4236
|
fill: "currentColor"
|
|
4625
4237
|
}
|
|
4626
4238
|
),
|
|
4627
|
-
/* @__PURE__ */ (0,
|
|
4239
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
4628
4240
|
"path",
|
|
4629
4241
|
{
|
|
4630
4242
|
fillRule: "evenodd",
|
|
@@ -4712,26 +4324,26 @@ function toggleList(editor, type) {
|
|
|
4712
4324
|
const view = editor.view;
|
|
4713
4325
|
let state = view.state;
|
|
4714
4326
|
let tr = state.tr;
|
|
4715
|
-
if (state.selection.empty || state.selection instanceof
|
|
4327
|
+
if (state.selection.empty || state.selection instanceof import_state3.TextSelection) {
|
|
4716
4328
|
const pos = findNodePosition({
|
|
4717
4329
|
editor,
|
|
4718
4330
|
node: state.selection.$anchor.node(1)
|
|
4719
4331
|
})?.pos;
|
|
4720
4332
|
if (!isValidPosition(pos)) return false;
|
|
4721
|
-
tr = tr.setSelection(
|
|
4333
|
+
tr = tr.setSelection(import_state3.NodeSelection.create(state.doc, pos));
|
|
4722
4334
|
view.dispatch(tr);
|
|
4723
4335
|
state = view.state;
|
|
4724
4336
|
}
|
|
4725
4337
|
const selection = state.selection;
|
|
4726
4338
|
let chain = editor.chain().focus();
|
|
4727
|
-
if (selection instanceof
|
|
4339
|
+
if (selection instanceof import_state3.NodeSelection) {
|
|
4728
4340
|
const firstChild = selection.node.firstChild?.firstChild;
|
|
4729
4341
|
const lastChild = selection.node.lastChild?.lastChild;
|
|
4730
4342
|
const from = firstChild ? selection.from + firstChild.nodeSize : selection.from + 1;
|
|
4731
4343
|
const to = lastChild ? selection.to - lastChild.nodeSize : selection.to - 1;
|
|
4732
4344
|
const resolvedFrom = state.doc.resolve(from);
|
|
4733
4345
|
const resolvedTo = state.doc.resolve(to);
|
|
4734
|
-
chain = chain.setTextSelection(
|
|
4346
|
+
chain = chain.setTextSelection(import_state3.TextSelection.between(resolvedFrom, resolvedTo)).clearNodes();
|
|
4735
4347
|
}
|
|
4736
4348
|
if (editor.isActive(type)) {
|
|
4737
4349
|
chain.liftListItem("listItem").lift("bulletList").lift("orderedList").lift("taskList").run();
|
|
@@ -4893,7 +4505,7 @@ function useListDropdownMenu(config) {
|
|
|
4893
4505
|
}
|
|
4894
4506
|
|
|
4895
4507
|
// src/components/tiptap-ui/list-dropdown-menu/list-dropdown-menu.tsx
|
|
4896
|
-
var
|
|
4508
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
4897
4509
|
function ListDropdownMenu({
|
|
4898
4510
|
editor: providedEditor,
|
|
4899
4511
|
types = ["bulletList", "orderedList", "taskList"],
|
|
@@ -4919,8 +4531,8 @@ function ListDropdownMenu({
|
|
|
4919
4531
|
if (!isVisible) {
|
|
4920
4532
|
return null;
|
|
4921
4533
|
}
|
|
4922
|
-
return /* @__PURE__ */ (0,
|
|
4923
|
-
/* @__PURE__ */ (0,
|
|
4534
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(DropdownMenu, { open: isOpen, onOpenChange: handleOnOpenChange, children: [
|
|
4535
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
4924
4536
|
Button2,
|
|
4925
4537
|
{
|
|
4926
4538
|
type: "button",
|
|
@@ -4934,12 +4546,12 @@ function ListDropdownMenu({
|
|
|
4934
4546
|
tooltip: "List",
|
|
4935
4547
|
...props,
|
|
4936
4548
|
children: [
|
|
4937
|
-
/* @__PURE__ */ (0,
|
|
4938
|
-
/* @__PURE__ */ (0,
|
|
4549
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Icon, { className: "tiptap-button-icon" }),
|
|
4550
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(ChevronDownIcon, { className: "tiptap-button-dropdown-small" })
|
|
4939
4551
|
]
|
|
4940
4552
|
}
|
|
4941
4553
|
) }),
|
|
4942
|
-
/* @__PURE__ */ (0,
|
|
4554
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(DropdownMenuContent, { align: "start", portal, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Card, { children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(ButtonGroup, { children: filteredLists.map((option) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(DropdownMenuItem, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
4943
4555
|
ListButton,
|
|
4944
4556
|
{
|
|
4945
4557
|
editor,
|
|
@@ -4953,11 +4565,11 @@ function ListDropdownMenu({
|
|
|
4953
4565
|
|
|
4954
4566
|
// src/components/tiptap-ui/blockquote-button/blockquote-button.tsx
|
|
4955
4567
|
var import_react52 = require("react");
|
|
4956
|
-
var
|
|
4568
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
4957
4569
|
function BlockquoteShortcutBadge({
|
|
4958
4570
|
shortcutKeys = BLOCKQUOTE_SHORTCUT_KEY
|
|
4959
4571
|
}) {
|
|
4960
|
-
return /* @__PURE__ */ (0,
|
|
4572
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Badge, { children: parseShortcutKeys({ shortcutKeys }) });
|
|
4961
4573
|
}
|
|
4962
4574
|
var BlockquoteButton = (0, import_react52.forwardRef)(
|
|
4963
4575
|
({
|
|
@@ -4995,7 +4607,7 @@ var BlockquoteButton = (0, import_react52.forwardRef)(
|
|
|
4995
4607
|
if (!isVisible) {
|
|
4996
4608
|
return null;
|
|
4997
4609
|
}
|
|
4998
|
-
return /* @__PURE__ */ (0,
|
|
4610
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
4999
4611
|
Button2,
|
|
5000
4612
|
{
|
|
5001
4613
|
type: "button",
|
|
@@ -5011,10 +4623,10 @@ var BlockquoteButton = (0, import_react52.forwardRef)(
|
|
|
5011
4623
|
onClick: handleClick,
|
|
5012
4624
|
...buttonProps,
|
|
5013
4625
|
ref,
|
|
5014
|
-
children: children ?? /* @__PURE__ */ (0,
|
|
5015
|
-
/* @__PURE__ */ (0,
|
|
5016
|
-
text && /* @__PURE__ */ (0,
|
|
5017
|
-
showShortcut && /* @__PURE__ */ (0,
|
|
4626
|
+
children: children ?? /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_jsx_runtime45.Fragment, { children: [
|
|
4627
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Icon, { className: "tiptap-button-icon" }),
|
|
4628
|
+
text && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "tiptap-button-text", children: text }),
|
|
4629
|
+
showShortcut && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(BlockquoteShortcutBadge, { shortcutKeys })
|
|
5018
4630
|
] })
|
|
5019
4631
|
}
|
|
5020
4632
|
);
|
|
@@ -5024,13 +4636,13 @@ BlockquoteButton.displayName = "BlockquoteButton";
|
|
|
5024
4636
|
|
|
5025
4637
|
// src/components/tiptap-ui/blockquote-button/use-blockquote.ts
|
|
5026
4638
|
var import_react54 = require("react");
|
|
5027
|
-
var
|
|
4639
|
+
var import_state4 = require("@tiptap/pm/state");
|
|
5028
4640
|
|
|
5029
4641
|
// src/components/tiptap-icons/blockquote-icon.tsx
|
|
5030
4642
|
var import_react53 = require("react");
|
|
5031
|
-
var
|
|
4643
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
5032
4644
|
var BlockquoteIcon = (0, import_react53.memo)(({ className, ...props }) => {
|
|
5033
|
-
return /* @__PURE__ */ (0,
|
|
4645
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
5034
4646
|
"svg",
|
|
5035
4647
|
{
|
|
5036
4648
|
width: "24",
|
|
@@ -5041,7 +4653,7 @@ var BlockquoteIcon = (0, import_react53.memo)(({ className, ...props }) => {
|
|
|
5041
4653
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5042
4654
|
...props,
|
|
5043
4655
|
children: [
|
|
5044
|
-
/* @__PURE__ */ (0,
|
|
4656
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
5045
4657
|
"path",
|
|
5046
4658
|
{
|
|
5047
4659
|
fillRule: "evenodd",
|
|
@@ -5050,7 +4662,7 @@ var BlockquoteIcon = (0, import_react53.memo)(({ className, ...props }) => {
|
|
|
5050
4662
|
fill: "currentColor"
|
|
5051
4663
|
}
|
|
5052
4664
|
),
|
|
5053
|
-
/* @__PURE__ */ (0,
|
|
4665
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
5054
4666
|
"path",
|
|
5055
4667
|
{
|
|
5056
4668
|
fillRule: "evenodd",
|
|
@@ -5059,7 +4671,7 @@ var BlockquoteIcon = (0, import_react53.memo)(({ className, ...props }) => {
|
|
|
5059
4671
|
fill: "currentColor"
|
|
5060
4672
|
}
|
|
5061
4673
|
),
|
|
5062
|
-
/* @__PURE__ */ (0,
|
|
4674
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
5063
4675
|
"path",
|
|
5064
4676
|
{
|
|
5065
4677
|
fillRule: "evenodd",
|
|
@@ -5068,7 +4680,7 @@ var BlockquoteIcon = (0, import_react53.memo)(({ className, ...props }) => {
|
|
|
5068
4680
|
fill: "currentColor"
|
|
5069
4681
|
}
|
|
5070
4682
|
),
|
|
5071
|
-
/* @__PURE__ */ (0,
|
|
4683
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
5072
4684
|
"path",
|
|
5073
4685
|
{
|
|
5074
4686
|
fillRule: "evenodd",
|
|
@@ -5111,26 +4723,26 @@ function toggleBlockquote(editor) {
|
|
|
5111
4723
|
const view = editor.view;
|
|
5112
4724
|
let state = view.state;
|
|
5113
4725
|
let tr = state.tr;
|
|
5114
|
-
if (state.selection.empty || state.selection instanceof
|
|
4726
|
+
if (state.selection.empty || state.selection instanceof import_state4.TextSelection) {
|
|
5115
4727
|
const pos = findNodePosition({
|
|
5116
4728
|
editor,
|
|
5117
4729
|
node: state.selection.$anchor.node(1)
|
|
5118
4730
|
})?.pos;
|
|
5119
4731
|
if (!isValidPosition(pos)) return false;
|
|
5120
|
-
tr = tr.setSelection(
|
|
4732
|
+
tr = tr.setSelection(import_state4.NodeSelection.create(state.doc, pos));
|
|
5121
4733
|
view.dispatch(tr);
|
|
5122
4734
|
state = view.state;
|
|
5123
4735
|
}
|
|
5124
4736
|
const selection = state.selection;
|
|
5125
4737
|
let chain = editor.chain().focus();
|
|
5126
|
-
if (selection instanceof
|
|
4738
|
+
if (selection instanceof import_state4.NodeSelection) {
|
|
5127
4739
|
const firstChild = selection.node.firstChild?.firstChild;
|
|
5128
4740
|
const lastChild = selection.node.lastChild?.lastChild;
|
|
5129
4741
|
const from = firstChild ? selection.from + firstChild.nodeSize : selection.from + 1;
|
|
5130
4742
|
const to = lastChild ? selection.to - lastChild.nodeSize : selection.to - 1;
|
|
5131
4743
|
const resolvedFrom = state.doc.resolve(from);
|
|
5132
4744
|
const resolvedTo = state.doc.resolve(to);
|
|
5133
|
-
chain = chain.setTextSelection(
|
|
4745
|
+
chain = chain.setTextSelection(import_state4.TextSelection.between(resolvedFrom, resolvedTo)).clearNodes();
|
|
5134
4746
|
}
|
|
5135
4747
|
const toggle = editor.isActive("blockquote") ? chain.lift("blockquote") : chain.wrapIn("blockquote");
|
|
5136
4748
|
toggle.run();
|
|
@@ -5194,9 +4806,9 @@ var import_react59 = require("react");
|
|
|
5194
4806
|
|
|
5195
4807
|
// src/components/tiptap-icons/ban-icon.tsx
|
|
5196
4808
|
var import_react55 = require("react");
|
|
5197
|
-
var
|
|
4809
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
5198
4810
|
var BanIcon = (0, import_react55.memo)(({ className, ...props }) => {
|
|
5199
|
-
return /* @__PURE__ */ (0,
|
|
4811
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
5200
4812
|
"svg",
|
|
5201
4813
|
{
|
|
5202
4814
|
width: "24",
|
|
@@ -5206,7 +4818,7 @@ var BanIcon = (0, import_react55.memo)(({ className, ...props }) => {
|
|
|
5206
4818
|
fill: "currentColor",
|
|
5207
4819
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5208
4820
|
...props,
|
|
5209
|
-
children: /* @__PURE__ */ (0,
|
|
4821
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
5210
4822
|
"path",
|
|
5211
4823
|
{
|
|
5212
4824
|
fillRule: "evenodd",
|
|
@@ -5222,9 +4834,9 @@ BanIcon.displayName = "BanIcon";
|
|
|
5222
4834
|
|
|
5223
4835
|
// src/components/tiptap-icons/highlighter-icon.tsx
|
|
5224
4836
|
var import_react56 = require("react");
|
|
5225
|
-
var
|
|
4837
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
5226
4838
|
var HighlighterIcon = (0, import_react56.memo)(({ className, ...props }) => {
|
|
5227
|
-
return /* @__PURE__ */ (0,
|
|
4839
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
5228
4840
|
"svg",
|
|
5229
4841
|
{
|
|
5230
4842
|
width: "24",
|
|
@@ -5234,7 +4846,7 @@ var HighlighterIcon = (0, import_react56.memo)(({ className, ...props }) => {
|
|
|
5234
4846
|
fill: "currentColor",
|
|
5235
4847
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5236
4848
|
...props,
|
|
5237
|
-
children: /* @__PURE__ */ (0,
|
|
4849
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
5238
4850
|
"path",
|
|
5239
4851
|
{
|
|
5240
4852
|
fillRule: "evenodd",
|
|
@@ -5250,16 +4862,16 @@ HighlighterIcon.displayName = "HighlighterIcon";
|
|
|
5250
4862
|
|
|
5251
4863
|
// src/components/tiptap-ui-primitive/popover/popover.tsx
|
|
5252
4864
|
var PopoverPrimitive = __toESM(require("@radix-ui/react-popover"));
|
|
5253
|
-
var
|
|
4865
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
5254
4866
|
function Popover({
|
|
5255
4867
|
...props
|
|
5256
4868
|
}) {
|
|
5257
|
-
return /* @__PURE__ */ (0,
|
|
4869
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(PopoverPrimitive.Root, { ...props });
|
|
5258
4870
|
}
|
|
5259
4871
|
function PopoverTrigger({
|
|
5260
4872
|
...props
|
|
5261
4873
|
}) {
|
|
5262
|
-
return /* @__PURE__ */ (0,
|
|
4874
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(PopoverPrimitive.Trigger, { ...props });
|
|
5263
4875
|
}
|
|
5264
4876
|
function PopoverContent({
|
|
5265
4877
|
className,
|
|
@@ -5267,7 +4879,7 @@ function PopoverContent({
|
|
|
5267
4879
|
sideOffset = 4,
|
|
5268
4880
|
...props
|
|
5269
4881
|
}) {
|
|
5270
|
-
return /* @__PURE__ */ (0,
|
|
4882
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(PopoverPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
5271
4883
|
PopoverPrimitive.Content,
|
|
5272
4884
|
{
|
|
5273
4885
|
align,
|
|
@@ -5280,11 +4892,11 @@ function PopoverContent({
|
|
|
5280
4892
|
|
|
5281
4893
|
// src/components/tiptap-ui/color-highlight-button/color-highlight-button.tsx
|
|
5282
4894
|
var import_react57 = require("react");
|
|
5283
|
-
var
|
|
4895
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
5284
4896
|
function ColorHighlightShortcutBadge({
|
|
5285
4897
|
shortcutKeys = COLOR_HIGHLIGHT_SHORTCUT_KEY
|
|
5286
4898
|
}) {
|
|
5287
|
-
return /* @__PURE__ */ (0,
|
|
4899
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Badge, { children: parseShortcutKeys({ shortcutKeys }) });
|
|
5288
4900
|
}
|
|
5289
4901
|
var ColorHighlightButton = (0, import_react57.forwardRef)(
|
|
5290
4902
|
({
|
|
@@ -5334,7 +4946,7 @@ var ColorHighlightButton = (0, import_react57.forwardRef)(
|
|
|
5334
4946
|
if (!isVisible) {
|
|
5335
4947
|
return null;
|
|
5336
4948
|
}
|
|
5337
|
-
return /* @__PURE__ */ (0,
|
|
4949
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
5338
4950
|
Button2,
|
|
5339
4951
|
{
|
|
5340
4952
|
type: "button",
|
|
@@ -5351,16 +4963,16 @@ var ColorHighlightButton = (0, import_react57.forwardRef)(
|
|
|
5351
4963
|
style: buttonStyle,
|
|
5352
4964
|
...buttonProps,
|
|
5353
4965
|
ref,
|
|
5354
|
-
children: children ?? /* @__PURE__ */ (0,
|
|
5355
|
-
/* @__PURE__ */ (0,
|
|
4966
|
+
children: children ?? /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_jsx_runtime50.Fragment, { children: [
|
|
4967
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
5356
4968
|
"span",
|
|
5357
4969
|
{
|
|
5358
4970
|
className: "tiptap-button-highlight",
|
|
5359
4971
|
style: { "--highlight-color": highlightColor }
|
|
5360
4972
|
}
|
|
5361
4973
|
),
|
|
5362
|
-
text && /* @__PURE__ */ (0,
|
|
5363
|
-
showShortcut && /* @__PURE__ */ (0,
|
|
4974
|
+
text && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "tiptap-button-text", children: text }),
|
|
4975
|
+
showShortcut && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(ColorHighlightShortcutBadge, { shortcutKeys })
|
|
5364
4976
|
] })
|
|
5365
4977
|
}
|
|
5366
4978
|
);
|
|
@@ -5575,8 +5187,8 @@ function useColorHighlight(config) {
|
|
|
5575
5187
|
}
|
|
5576
5188
|
|
|
5577
5189
|
// src/components/tiptap-ui/color-highlight-popover/color-highlight-popover.tsx
|
|
5578
|
-
var
|
|
5579
|
-
var ColorHighlightPopoverButton = (0, import_react59.forwardRef)(({ className, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
5190
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
5191
|
+
var ColorHighlightPopoverButton = (0, import_react59.forwardRef)(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
5580
5192
|
Button2,
|
|
5581
5193
|
{
|
|
5582
5194
|
type: "button",
|
|
@@ -5589,7 +5201,7 @@ var ColorHighlightPopoverButton = (0, import_react59.forwardRef)(({ className, c
|
|
|
5589
5201
|
tooltip: "Highlight",
|
|
5590
5202
|
ref,
|
|
5591
5203
|
...props,
|
|
5592
|
-
children: children ?? /* @__PURE__ */ (0,
|
|
5204
|
+
children: children ?? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(HighlighterIcon, { className: "tiptap-button-icon" })
|
|
5593
5205
|
}
|
|
5594
5206
|
));
|
|
5595
5207
|
ColorHighlightPopoverButton.displayName = "ColorHighlightPopoverButton";
|
|
@@ -5625,14 +5237,14 @@ function ColorHighlightPopoverContent({
|
|
|
5625
5237
|
},
|
|
5626
5238
|
autoSelectFirstItem: false
|
|
5627
5239
|
});
|
|
5628
|
-
return /* @__PURE__ */ (0,
|
|
5240
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
5629
5241
|
Card,
|
|
5630
5242
|
{
|
|
5631
5243
|
ref: containerRef,
|
|
5632
5244
|
tabIndex: 0,
|
|
5633
5245
|
style: isMobile ? { boxShadow: "none", border: 0 } : {},
|
|
5634
|
-
children: /* @__PURE__ */ (0,
|
|
5635
|
-
/* @__PURE__ */ (0,
|
|
5246
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(CardBody, { style: isMobile ? { padding: 0 } : {}, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(CardItemGroup, { orientation: "horizontal", children: [
|
|
5247
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(ButtonGroup, { orientation: "horizontal", children: colors.map((color, index) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
5636
5248
|
ColorHighlightButton,
|
|
5637
5249
|
{
|
|
5638
5250
|
editor,
|
|
@@ -5644,8 +5256,8 @@ function ColorHighlightPopoverContent({
|
|
|
5644
5256
|
},
|
|
5645
5257
|
color.value
|
|
5646
5258
|
)) }),
|
|
5647
|
-
/* @__PURE__ */ (0,
|
|
5648
|
-
/* @__PURE__ */ (0,
|
|
5259
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Separator2, {}),
|
|
5260
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(ButtonGroup, { orientation: "horizontal", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
5649
5261
|
Button2,
|
|
5650
5262
|
{
|
|
5651
5263
|
onClick: handleRemoveHighlight,
|
|
@@ -5656,7 +5268,7 @@ function ColorHighlightPopoverContent({
|
|
|
5656
5268
|
role: "menuitem",
|
|
5657
5269
|
"data-style": "ghost",
|
|
5658
5270
|
"data-highlighted": selectedIndex === colors.length,
|
|
5659
|
-
children: /* @__PURE__ */ (0,
|
|
5271
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(BanIcon, { className: "tiptap-button-icon" })
|
|
5660
5272
|
}
|
|
5661
5273
|
) })
|
|
5662
5274
|
] }) })
|
|
@@ -5669,9 +5281,9 @@ var import_react64 = require("react");
|
|
|
5669
5281
|
|
|
5670
5282
|
// src/components/tiptap-icons/corner-down-left-icon.tsx
|
|
5671
5283
|
var import_react60 = require("react");
|
|
5672
|
-
var
|
|
5284
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
5673
5285
|
var CornerDownLeftIcon = (0, import_react60.memo)(({ className, ...props }) => {
|
|
5674
|
-
return /* @__PURE__ */ (0,
|
|
5286
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
5675
5287
|
"svg",
|
|
5676
5288
|
{
|
|
5677
5289
|
width: "24",
|
|
@@ -5681,7 +5293,7 @@ var CornerDownLeftIcon = (0, import_react60.memo)(({ className, ...props }) => {
|
|
|
5681
5293
|
fill: "currentColor",
|
|
5682
5294
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5683
5295
|
...props,
|
|
5684
|
-
children: /* @__PURE__ */ (0,
|
|
5296
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
5685
5297
|
"path",
|
|
5686
5298
|
{
|
|
5687
5299
|
fillRule: "evenodd",
|
|
@@ -5697,9 +5309,9 @@ CornerDownLeftIcon.displayName = "CornerDownLeftIcon";
|
|
|
5697
5309
|
|
|
5698
5310
|
// src/components/tiptap-icons/external-link-icon.tsx
|
|
5699
5311
|
var import_react61 = require("react");
|
|
5700
|
-
var
|
|
5312
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
5701
5313
|
var ExternalLinkIcon = (0, import_react61.memo)(({ className, ...props }) => {
|
|
5702
|
-
return /* @__PURE__ */ (0,
|
|
5314
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
5703
5315
|
"svg",
|
|
5704
5316
|
{
|
|
5705
5317
|
width: "24",
|
|
@@ -5710,14 +5322,14 @@ var ExternalLinkIcon = (0, import_react61.memo)(({ className, ...props }) => {
|
|
|
5710
5322
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5711
5323
|
...props,
|
|
5712
5324
|
children: [
|
|
5713
|
-
/* @__PURE__ */ (0,
|
|
5325
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
5714
5326
|
"path",
|
|
5715
5327
|
{
|
|
5716
5328
|
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",
|
|
5717
5329
|
fill: "currentColor"
|
|
5718
5330
|
}
|
|
5719
5331
|
),
|
|
5720
|
-
/* @__PURE__ */ (0,
|
|
5332
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
5721
5333
|
"path",
|
|
5722
5334
|
{
|
|
5723
5335
|
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",
|
|
@@ -5732,9 +5344,9 @@ ExternalLinkIcon.displayName = "ExternalLinkIcon";
|
|
|
5732
5344
|
|
|
5733
5345
|
// src/components/tiptap-icons/link-icon.tsx
|
|
5734
5346
|
var import_react62 = require("react");
|
|
5735
|
-
var
|
|
5347
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
5736
5348
|
var LinkIcon = (0, import_react62.memo)(({ className, ...props }) => {
|
|
5737
|
-
return /* @__PURE__ */ (0,
|
|
5349
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
5738
5350
|
"svg",
|
|
5739
5351
|
{
|
|
5740
5352
|
width: "24",
|
|
@@ -5745,14 +5357,14 @@ var LinkIcon = (0, import_react62.memo)(({ className, ...props }) => {
|
|
|
5745
5357
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5746
5358
|
...props,
|
|
5747
5359
|
children: [
|
|
5748
|
-
/* @__PURE__ */ (0,
|
|
5360
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
5749
5361
|
"path",
|
|
5750
5362
|
{
|
|
5751
5363
|
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",
|
|
5752
5364
|
fill: "currentColor"
|
|
5753
5365
|
}
|
|
5754
5366
|
),
|
|
5755
|
-
/* @__PURE__ */ (0,
|
|
5367
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
5756
5368
|
"path",
|
|
5757
5369
|
{
|
|
5758
5370
|
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",
|
|
@@ -5767,9 +5379,9 @@ LinkIcon.displayName = "LinkIcon";
|
|
|
5767
5379
|
|
|
5768
5380
|
// src/components/tiptap-icons/trash-icon.tsx
|
|
5769
5381
|
var import_react63 = require("react");
|
|
5770
|
-
var
|
|
5382
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
5771
5383
|
var TrashIcon = (0, import_react63.memo)(({ className, ...props }) => {
|
|
5772
|
-
return /* @__PURE__ */ (0,
|
|
5384
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
5773
5385
|
"svg",
|
|
5774
5386
|
{
|
|
5775
5387
|
width: "24",
|
|
@@ -5779,7 +5391,7 @@ var TrashIcon = (0, import_react63.memo)(({ className, ...props }) => {
|
|
|
5779
5391
|
fill: "currentColor",
|
|
5780
5392
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5781
5393
|
...props,
|
|
5782
|
-
children: /* @__PURE__ */ (0,
|
|
5394
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
5783
5395
|
"path",
|
|
5784
5396
|
{
|
|
5785
5397
|
fillRule: "evenodd",
|
|
@@ -5794,23 +5406,23 @@ var TrashIcon = (0, import_react63.memo)(({ className, ...props }) => {
|
|
|
5794
5406
|
TrashIcon.displayName = "TrashIcon";
|
|
5795
5407
|
|
|
5796
5408
|
// src/components/tiptap-ui-primitive/input/input.tsx
|
|
5797
|
-
var
|
|
5409
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
5798
5410
|
function Input({ className, type, ...props }) {
|
|
5799
|
-
return /* @__PURE__ */ (0,
|
|
5411
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("input", { type, className: cn2("tiptap-input", className), ...props });
|
|
5800
5412
|
}
|
|
5801
5413
|
function InputGroup({
|
|
5802
5414
|
className,
|
|
5803
5415
|
children,
|
|
5804
5416
|
...props
|
|
5805
5417
|
}) {
|
|
5806
|
-
return /* @__PURE__ */ (0,
|
|
5418
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: cn2("tiptap-input-group", className), ...props, children });
|
|
5807
5419
|
}
|
|
5808
5420
|
|
|
5809
5421
|
// src/components/tiptap-ui/link-popover/link-popover.tsx
|
|
5810
|
-
var
|
|
5422
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
5811
5423
|
var LinkButton = (0, import_react64.forwardRef)(
|
|
5812
5424
|
({ className, children, ...props }, ref) => {
|
|
5813
|
-
return /* @__PURE__ */ (0,
|
|
5425
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
5814
5426
|
Button2,
|
|
5815
5427
|
{
|
|
5816
5428
|
type: "button",
|
|
@@ -5822,7 +5434,7 @@ var LinkButton = (0, import_react64.forwardRef)(
|
|
|
5822
5434
|
tooltip: "Link",
|
|
5823
5435
|
ref,
|
|
5824
5436
|
...props,
|
|
5825
|
-
children: children || /* @__PURE__ */ (0,
|
|
5437
|
+
children: children || /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(LinkIcon, { className: "tiptap-button-icon" })
|
|
5826
5438
|
}
|
|
5827
5439
|
);
|
|
5828
5440
|
}
|
|
@@ -5843,20 +5455,20 @@ var LinkMain = ({
|
|
|
5843
5455
|
setLink();
|
|
5844
5456
|
}
|
|
5845
5457
|
};
|
|
5846
|
-
return /* @__PURE__ */ (0,
|
|
5458
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
5847
5459
|
Card,
|
|
5848
5460
|
{
|
|
5849
5461
|
style: {
|
|
5850
5462
|
...isMobile ? { boxShadow: "none", border: 0 } : {}
|
|
5851
5463
|
},
|
|
5852
|
-
children: /* @__PURE__ */ (0,
|
|
5464
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
5853
5465
|
CardBody,
|
|
5854
5466
|
{
|
|
5855
5467
|
style: {
|
|
5856
5468
|
...isMobile ? { padding: 0 } : {}
|
|
5857
5469
|
},
|
|
5858
|
-
children: /* @__PURE__ */ (0,
|
|
5859
|
-
/* @__PURE__ */ (0,
|
|
5470
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(CardItemGroup, { orientation: "horizontal", children: [
|
|
5471
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(InputGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
5860
5472
|
Input,
|
|
5861
5473
|
{
|
|
5862
5474
|
type: "url",
|
|
@@ -5870,7 +5482,7 @@ var LinkMain = ({
|
|
|
5870
5482
|
autoCapitalize: "off"
|
|
5871
5483
|
}
|
|
5872
5484
|
) }),
|
|
5873
|
-
/* @__PURE__ */ (0,
|
|
5485
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(ButtonGroup, { orientation: "horizontal", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
5874
5486
|
Button2,
|
|
5875
5487
|
{
|
|
5876
5488
|
type: "button",
|
|
@@ -5878,12 +5490,12 @@ var LinkMain = ({
|
|
|
5878
5490
|
title: "Apply link",
|
|
5879
5491
|
disabled: !url && !isActive,
|
|
5880
5492
|
"data-style": "ghost",
|
|
5881
|
-
children: /* @__PURE__ */ (0,
|
|
5493
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(CornerDownLeftIcon, { className: "tiptap-button-icon" })
|
|
5882
5494
|
}
|
|
5883
5495
|
) }),
|
|
5884
|
-
/* @__PURE__ */ (0,
|
|
5885
|
-
/* @__PURE__ */ (0,
|
|
5886
|
-
/* @__PURE__ */ (0,
|
|
5496
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Separator2, {}),
|
|
5497
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(ButtonGroup, { orientation: "horizontal", children: [
|
|
5498
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
5887
5499
|
Button2,
|
|
5888
5500
|
{
|
|
5889
5501
|
type: "button",
|
|
@@ -5891,10 +5503,10 @@ var LinkMain = ({
|
|
|
5891
5503
|
title: "Open in new window",
|
|
5892
5504
|
disabled: !url && !isActive,
|
|
5893
5505
|
"data-style": "ghost",
|
|
5894
|
-
children: /* @__PURE__ */ (0,
|
|
5506
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(ExternalLinkIcon, { className: "tiptap-button-icon" })
|
|
5895
5507
|
}
|
|
5896
5508
|
),
|
|
5897
|
-
/* @__PURE__ */ (0,
|
|
5509
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
5898
5510
|
Button2,
|
|
5899
5511
|
{
|
|
5900
5512
|
type: "button",
|
|
@@ -5902,7 +5514,7 @@ var LinkMain = ({
|
|
|
5902
5514
|
title: "Remove link",
|
|
5903
5515
|
disabled: !url && !isActive,
|
|
5904
5516
|
"data-style": "ghost",
|
|
5905
|
-
children: /* @__PURE__ */ (0,
|
|
5517
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(TrashIcon, { className: "tiptap-button-icon" })
|
|
5906
5518
|
}
|
|
5907
5519
|
)
|
|
5908
5520
|
] })
|
|
@@ -5916,7 +5528,7 @@ var LinkContent = ({ editor }) => {
|
|
|
5916
5528
|
const linkPopover = useLinkPopover({
|
|
5917
5529
|
editor
|
|
5918
5530
|
});
|
|
5919
|
-
return /* @__PURE__ */ (0,
|
|
5531
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(LinkMain, { ...linkPopover });
|
|
5920
5532
|
};
|
|
5921
5533
|
var LinkPopover = (0, import_react64.forwardRef)(
|
|
5922
5534
|
({
|
|
@@ -5974,8 +5586,8 @@ var LinkPopover = (0, import_react64.forwardRef)(
|
|
|
5974
5586
|
if (!isVisible) {
|
|
5975
5587
|
return null;
|
|
5976
5588
|
}
|
|
5977
|
-
return /* @__PURE__ */ (0,
|
|
5978
|
-
/* @__PURE__ */ (0,
|
|
5589
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(Popover, { open: isOpen, onOpenChange: handleOnOpenChange, children: [
|
|
5590
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
5979
5591
|
LinkButton,
|
|
5980
5592
|
{
|
|
5981
5593
|
disabled: !canSet,
|
|
@@ -5986,10 +5598,10 @@ var LinkPopover = (0, import_react64.forwardRef)(
|
|
|
5986
5598
|
onClick: handleClick,
|
|
5987
5599
|
...buttonProps,
|
|
5988
5600
|
ref,
|
|
5989
|
-
children: children ?? /* @__PURE__ */ (0,
|
|
5601
|
+
children: children ?? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Icon, { className: "tiptap-button-icon" })
|
|
5990
5602
|
}
|
|
5991
5603
|
) }),
|
|
5992
|
-
/* @__PURE__ */ (0,
|
|
5604
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(PopoverContent, { children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
5993
5605
|
LinkMain,
|
|
5994
5606
|
{
|
|
5995
5607
|
url,
|
|
@@ -6138,12 +5750,12 @@ function useLinkPopover(config) {
|
|
|
6138
5750
|
|
|
6139
5751
|
// src/components/tiptap-ui/mark-button/mark-button.tsx
|
|
6140
5752
|
var import_react66 = require("react");
|
|
6141
|
-
var
|
|
5753
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
6142
5754
|
function MarkShortcutBadge({
|
|
6143
5755
|
type,
|
|
6144
5756
|
shortcutKeys = MARK_SHORTCUT_KEYS[type]
|
|
6145
5757
|
}) {
|
|
6146
|
-
return /* @__PURE__ */ (0,
|
|
5758
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Badge, { children: parseShortcutKeys({ shortcutKeys }) });
|
|
6147
5759
|
}
|
|
6148
5760
|
var MarkButton = (0, import_react66.forwardRef)(
|
|
6149
5761
|
({
|
|
@@ -6183,7 +5795,7 @@ var MarkButton = (0, import_react66.forwardRef)(
|
|
|
6183
5795
|
if (!isVisible) {
|
|
6184
5796
|
return null;
|
|
6185
5797
|
}
|
|
6186
|
-
return /* @__PURE__ */ (0,
|
|
5798
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
6187
5799
|
Button2,
|
|
6188
5800
|
{
|
|
6189
5801
|
type: "button",
|
|
@@ -6199,10 +5811,10 @@ var MarkButton = (0, import_react66.forwardRef)(
|
|
|
6199
5811
|
onClick: handleClick,
|
|
6200
5812
|
...buttonProps,
|
|
6201
5813
|
ref,
|
|
6202
|
-
children: children ?? /* @__PURE__ */ (0,
|
|
6203
|
-
/* @__PURE__ */ (0,
|
|
6204
|
-
text && /* @__PURE__ */ (0,
|
|
6205
|
-
showShortcut && /* @__PURE__ */ (0,
|
|
5814
|
+
children: children ?? /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(import_jsx_runtime58.Fragment, { children: [
|
|
5815
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Icon, { className: "tiptap-button-icon" }),
|
|
5816
|
+
text && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: "tiptap-button-text", children: text }),
|
|
5817
|
+
showShortcut && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(MarkShortcutBadge, { type, shortcutKeys })
|
|
6206
5818
|
] })
|
|
6207
5819
|
}
|
|
6208
5820
|
);
|
|
@@ -6215,9 +5827,9 @@ var import_react74 = require("react");
|
|
|
6215
5827
|
|
|
6216
5828
|
// src/components/tiptap-icons/bold-icon.tsx
|
|
6217
5829
|
var import_react67 = require("react");
|
|
6218
|
-
var
|
|
5830
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
6219
5831
|
var BoldIcon = (0, import_react67.memo)(({ className, ...props }) => {
|
|
6220
|
-
return /* @__PURE__ */ (0,
|
|
5832
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
6221
5833
|
"svg",
|
|
6222
5834
|
{
|
|
6223
5835
|
width: "24",
|
|
@@ -6227,7 +5839,7 @@ var BoldIcon = (0, import_react67.memo)(({ className, ...props }) => {
|
|
|
6227
5839
|
fill: "currentColor",
|
|
6228
5840
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6229
5841
|
...props,
|
|
6230
|
-
children: /* @__PURE__ */ (0,
|
|
5842
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
6231
5843
|
"path",
|
|
6232
5844
|
{
|
|
6233
5845
|
fillRule: "evenodd",
|
|
@@ -6243,9 +5855,9 @@ BoldIcon.displayName = "BoldIcon";
|
|
|
6243
5855
|
|
|
6244
5856
|
// src/components/tiptap-icons/code2-icon.tsx
|
|
6245
5857
|
var import_react68 = require("react");
|
|
6246
|
-
var
|
|
5858
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
6247
5859
|
var Code2Icon = (0, import_react68.memo)(({ className, ...props }) => {
|
|
6248
|
-
return /* @__PURE__ */ (0,
|
|
5860
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
|
|
6249
5861
|
"svg",
|
|
6250
5862
|
{
|
|
6251
5863
|
width: "24",
|
|
@@ -6256,21 +5868,21 @@ var Code2Icon = (0, import_react68.memo)(({ className, ...props }) => {
|
|
|
6256
5868
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6257
5869
|
...props,
|
|
6258
5870
|
children: [
|
|
6259
|
-
/* @__PURE__ */ (0,
|
|
5871
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
6260
5872
|
"path",
|
|
6261
5873
|
{
|
|
6262
5874
|
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",
|
|
6263
5875
|
fill: "currentColor"
|
|
6264
5876
|
}
|
|
6265
5877
|
),
|
|
6266
|
-
/* @__PURE__ */ (0,
|
|
5878
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
6267
5879
|
"path",
|
|
6268
5880
|
{
|
|
6269
5881
|
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",
|
|
6270
5882
|
fill: "currentColor"
|
|
6271
5883
|
}
|
|
6272
5884
|
),
|
|
6273
|
-
/* @__PURE__ */ (0,
|
|
5885
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
6274
5886
|
"path",
|
|
6275
5887
|
{
|
|
6276
5888
|
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",
|
|
@@ -6285,9 +5897,9 @@ Code2Icon.displayName = "Code2Icon";
|
|
|
6285
5897
|
|
|
6286
5898
|
// src/components/tiptap-icons/italic-icon.tsx
|
|
6287
5899
|
var import_react69 = require("react");
|
|
6288
|
-
var
|
|
5900
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
6289
5901
|
var ItalicIcon = (0, import_react69.memo)(({ className, ...props }) => {
|
|
6290
|
-
return /* @__PURE__ */ (0,
|
|
5902
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
6291
5903
|
"svg",
|
|
6292
5904
|
{
|
|
6293
5905
|
width: "24",
|
|
@@ -6297,7 +5909,7 @@ var ItalicIcon = (0, import_react69.memo)(({ className, ...props }) => {
|
|
|
6297
5909
|
fill: "currentColor",
|
|
6298
5910
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6299
5911
|
...props,
|
|
6300
|
-
children: /* @__PURE__ */ (0,
|
|
5912
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
6301
5913
|
"path",
|
|
6302
5914
|
{
|
|
6303
5915
|
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",
|
|
@@ -6311,9 +5923,9 @@ ItalicIcon.displayName = "ItalicIcon";
|
|
|
6311
5923
|
|
|
6312
5924
|
// src/components/tiptap-icons/strike-icon.tsx
|
|
6313
5925
|
var import_react70 = require("react");
|
|
6314
|
-
var
|
|
5926
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
6315
5927
|
var StrikeIcon = (0, import_react70.memo)(({ className, ...props }) => {
|
|
6316
|
-
return /* @__PURE__ */ (0,
|
|
5928
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
|
|
6317
5929
|
"svg",
|
|
6318
5930
|
{
|
|
6319
5931
|
width: "24",
|
|
@@ -6324,14 +5936,14 @@ var StrikeIcon = (0, import_react70.memo)(({ className, ...props }) => {
|
|
|
6324
5936
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6325
5937
|
...props,
|
|
6326
5938
|
children: [
|
|
6327
|
-
/* @__PURE__ */ (0,
|
|
5939
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
6328
5940
|
"path",
|
|
6329
5941
|
{
|
|
6330
5942
|
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",
|
|
6331
5943
|
fill: "currentColor"
|
|
6332
5944
|
}
|
|
6333
5945
|
),
|
|
6334
|
-
/* @__PURE__ */ (0,
|
|
5946
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
6335
5947
|
"path",
|
|
6336
5948
|
{
|
|
6337
5949
|
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",
|
|
@@ -6346,9 +5958,9 @@ StrikeIcon.displayName = "StrikeIcon";
|
|
|
6346
5958
|
|
|
6347
5959
|
// src/components/tiptap-icons/subscript-icon.tsx
|
|
6348
5960
|
var import_react71 = require("react");
|
|
6349
|
-
var
|
|
5961
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
6350
5962
|
var SubscriptIcon = (0, import_react71.memo)(({ className, ...props }) => {
|
|
6351
|
-
return /* @__PURE__ */ (0,
|
|
5963
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
|
|
6352
5964
|
"svg",
|
|
6353
5965
|
{
|
|
6354
5966
|
width: "24",
|
|
@@ -6359,7 +5971,7 @@ var SubscriptIcon = (0, import_react71.memo)(({ className, ...props }) => {
|
|
|
6359
5971
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6360
5972
|
...props,
|
|
6361
5973
|
children: [
|
|
6362
|
-
/* @__PURE__ */ (0,
|
|
5974
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
6363
5975
|
"path",
|
|
6364
5976
|
{
|
|
6365
5977
|
fillRule: "evenodd",
|
|
@@ -6368,7 +5980,7 @@ var SubscriptIcon = (0, import_react71.memo)(({ className, ...props }) => {
|
|
|
6368
5980
|
fill: "currentColor"
|
|
6369
5981
|
}
|
|
6370
5982
|
),
|
|
6371
|
-
/* @__PURE__ */ (0,
|
|
5983
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
6372
5984
|
"path",
|
|
6373
5985
|
{
|
|
6374
5986
|
fillRule: "evenodd",
|
|
@@ -6377,7 +5989,7 @@ var SubscriptIcon = (0, import_react71.memo)(({ className, ...props }) => {
|
|
|
6377
5989
|
fill: "currentColor"
|
|
6378
5990
|
}
|
|
6379
5991
|
),
|
|
6380
|
-
/* @__PURE__ */ (0,
|
|
5992
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
6381
5993
|
"path",
|
|
6382
5994
|
{
|
|
6383
5995
|
fillRule: "evenodd",
|
|
@@ -6394,9 +6006,9 @@ SubscriptIcon.displayName = "SubscriptIcon";
|
|
|
6394
6006
|
|
|
6395
6007
|
// src/components/tiptap-icons/superscript-icon.tsx
|
|
6396
6008
|
var import_react72 = require("react");
|
|
6397
|
-
var
|
|
6009
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
6398
6010
|
var SuperscriptIcon = (0, import_react72.memo)(({ className, ...props }) => {
|
|
6399
|
-
return /* @__PURE__ */ (0,
|
|
6011
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
|
|
6400
6012
|
"svg",
|
|
6401
6013
|
{
|
|
6402
6014
|
width: "24",
|
|
@@ -6407,7 +6019,7 @@ var SuperscriptIcon = (0, import_react72.memo)(({ className, ...props }) => {
|
|
|
6407
6019
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6408
6020
|
...props,
|
|
6409
6021
|
children: [
|
|
6410
|
-
/* @__PURE__ */ (0,
|
|
6022
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
6411
6023
|
"path",
|
|
6412
6024
|
{
|
|
6413
6025
|
fillRule: "evenodd",
|
|
@@ -6416,7 +6028,7 @@ var SuperscriptIcon = (0, import_react72.memo)(({ className, ...props }) => {
|
|
|
6416
6028
|
fill: "currentColor"
|
|
6417
6029
|
}
|
|
6418
6030
|
),
|
|
6419
|
-
/* @__PURE__ */ (0,
|
|
6031
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
6420
6032
|
"path",
|
|
6421
6033
|
{
|
|
6422
6034
|
fillRule: "evenodd",
|
|
@@ -6425,7 +6037,7 @@ var SuperscriptIcon = (0, import_react72.memo)(({ className, ...props }) => {
|
|
|
6425
6037
|
fill: "currentColor"
|
|
6426
6038
|
}
|
|
6427
6039
|
),
|
|
6428
|
-
/* @__PURE__ */ (0,
|
|
6040
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
6429
6041
|
"path",
|
|
6430
6042
|
{
|
|
6431
6043
|
fillRule: "evenodd",
|
|
@@ -6442,9 +6054,9 @@ SuperscriptIcon.displayName = "SuperscriptIcon";
|
|
|
6442
6054
|
|
|
6443
6055
|
// src/components/tiptap-icons/underline-icon.tsx
|
|
6444
6056
|
var import_react73 = require("react");
|
|
6445
|
-
var
|
|
6057
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
6446
6058
|
var UnderlineIcon = (0, import_react73.memo)(({ className, ...props }) => {
|
|
6447
|
-
return /* @__PURE__ */ (0,
|
|
6059
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
6448
6060
|
"svg",
|
|
6449
6061
|
{
|
|
6450
6062
|
width: "24",
|
|
@@ -6454,7 +6066,7 @@ var UnderlineIcon = (0, import_react73.memo)(({ className, ...props }) => {
|
|
|
6454
6066
|
fill: "currentColor",
|
|
6455
6067
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6456
6068
|
...props,
|
|
6457
|
-
children: /* @__PURE__ */ (0,
|
|
6069
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
6458
6070
|
"path",
|
|
6459
6071
|
{
|
|
6460
6072
|
fillRule: "evenodd",
|
|
@@ -6557,12 +6169,12 @@ function useMark(config) {
|
|
|
6557
6169
|
|
|
6558
6170
|
// src/components/tiptap-ui/text-align-button/text-align-button.tsx
|
|
6559
6171
|
var import_react75 = require("react");
|
|
6560
|
-
var
|
|
6172
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
6561
6173
|
function TextAlignShortcutBadge({
|
|
6562
6174
|
align,
|
|
6563
6175
|
shortcutKeys = TEXT_ALIGN_SHORTCUT_KEYS[align]
|
|
6564
6176
|
}) {
|
|
6565
|
-
return /* @__PURE__ */ (0,
|
|
6177
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Badge, { children: parseShortcutKeys({ shortcutKeys }) });
|
|
6566
6178
|
}
|
|
6567
6179
|
var TextAlignButton = (0, import_react75.forwardRef)(
|
|
6568
6180
|
({
|
|
@@ -6604,7 +6216,7 @@ var TextAlignButton = (0, import_react75.forwardRef)(
|
|
|
6604
6216
|
return null;
|
|
6605
6217
|
}
|
|
6606
6218
|
const RenderIcon = CustomIcon ?? Icon;
|
|
6607
|
-
return /* @__PURE__ */ (0,
|
|
6219
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
6608
6220
|
Button2,
|
|
6609
6221
|
{
|
|
6610
6222
|
type: "button",
|
|
@@ -6620,10 +6232,10 @@ var TextAlignButton = (0, import_react75.forwardRef)(
|
|
|
6620
6232
|
onClick: handleClick,
|
|
6621
6233
|
...buttonProps,
|
|
6622
6234
|
ref,
|
|
6623
|
-
children: children ?? /* @__PURE__ */ (0,
|
|
6624
|
-
/* @__PURE__ */ (0,
|
|
6625
|
-
text && /* @__PURE__ */ (0,
|
|
6626
|
-
showShortcut && /* @__PURE__ */ (0,
|
|
6235
|
+
children: children ?? /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(import_jsx_runtime66.Fragment, { children: [
|
|
6236
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(RenderIcon, { className: "tiptap-button-icon" }),
|
|
6237
|
+
text && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { className: "tiptap-button-text", children: text }),
|
|
6238
|
+
showShortcut && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
6627
6239
|
TextAlignShortcutBadge,
|
|
6628
6240
|
{
|
|
6629
6241
|
align,
|
|
@@ -6642,9 +6254,9 @@ var import_react80 = require("react");
|
|
|
6642
6254
|
|
|
6643
6255
|
// src/components/tiptap-icons/align-center-icon.tsx
|
|
6644
6256
|
var import_react76 = require("react");
|
|
6645
|
-
var
|
|
6257
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
6646
6258
|
var AlignCenterIcon = (0, import_react76.memo)(({ className, ...props }) => {
|
|
6647
|
-
return /* @__PURE__ */ (0,
|
|
6259
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
|
|
6648
6260
|
"svg",
|
|
6649
6261
|
{
|
|
6650
6262
|
width: "24",
|
|
@@ -6655,7 +6267,7 @@ var AlignCenterIcon = (0, import_react76.memo)(({ className, ...props }) => {
|
|
|
6655
6267
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6656
6268
|
...props,
|
|
6657
6269
|
children: [
|
|
6658
|
-
/* @__PURE__ */ (0,
|
|
6270
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
6659
6271
|
"path",
|
|
6660
6272
|
{
|
|
6661
6273
|
fillRule: "evenodd",
|
|
@@ -6664,7 +6276,7 @@ var AlignCenterIcon = (0, import_react76.memo)(({ className, ...props }) => {
|
|
|
6664
6276
|
fill: "currentColor"
|
|
6665
6277
|
}
|
|
6666
6278
|
),
|
|
6667
|
-
/* @__PURE__ */ (0,
|
|
6279
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
6668
6280
|
"path",
|
|
6669
6281
|
{
|
|
6670
6282
|
fillRule: "evenodd",
|
|
@@ -6673,7 +6285,7 @@ var AlignCenterIcon = (0, import_react76.memo)(({ className, ...props }) => {
|
|
|
6673
6285
|
fill: "currentColor"
|
|
6674
6286
|
}
|
|
6675
6287
|
),
|
|
6676
|
-
/* @__PURE__ */ (0,
|
|
6288
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
6677
6289
|
"path",
|
|
6678
6290
|
{
|
|
6679
6291
|
fillRule: "evenodd",
|
|
@@ -6690,9 +6302,9 @@ AlignCenterIcon.displayName = "AlignCenterIcon";
|
|
|
6690
6302
|
|
|
6691
6303
|
// src/components/tiptap-icons/align-justify-icon.tsx
|
|
6692
6304
|
var import_react77 = require("react");
|
|
6693
|
-
var
|
|
6305
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
6694
6306
|
var AlignJustifyIcon = (0, import_react77.memo)(({ className, ...props }) => {
|
|
6695
|
-
return /* @__PURE__ */ (0,
|
|
6307
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(
|
|
6696
6308
|
"svg",
|
|
6697
6309
|
{
|
|
6698
6310
|
width: "24",
|
|
@@ -6703,7 +6315,7 @@ var AlignJustifyIcon = (0, import_react77.memo)(({ className, ...props }) => {
|
|
|
6703
6315
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6704
6316
|
...props,
|
|
6705
6317
|
children: [
|
|
6706
|
-
/* @__PURE__ */ (0,
|
|
6318
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
6707
6319
|
"path",
|
|
6708
6320
|
{
|
|
6709
6321
|
fillRule: "evenodd",
|
|
@@ -6712,7 +6324,7 @@ var AlignJustifyIcon = (0, import_react77.memo)(({ className, ...props }) => {
|
|
|
6712
6324
|
fill: "currentColor"
|
|
6713
6325
|
}
|
|
6714
6326
|
),
|
|
6715
|
-
/* @__PURE__ */ (0,
|
|
6327
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
6716
6328
|
"path",
|
|
6717
6329
|
{
|
|
6718
6330
|
fillRule: "evenodd",
|
|
@@ -6721,7 +6333,7 @@ var AlignJustifyIcon = (0, import_react77.memo)(({ className, ...props }) => {
|
|
|
6721
6333
|
fill: "currentColor"
|
|
6722
6334
|
}
|
|
6723
6335
|
),
|
|
6724
|
-
/* @__PURE__ */ (0,
|
|
6336
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
6725
6337
|
"path",
|
|
6726
6338
|
{
|
|
6727
6339
|
fillRule: "evenodd",
|
|
@@ -6738,9 +6350,9 @@ AlignJustifyIcon.displayName = "AlignJustifyIcon";
|
|
|
6738
6350
|
|
|
6739
6351
|
// src/components/tiptap-icons/align-left-icon.tsx
|
|
6740
6352
|
var import_react78 = require("react");
|
|
6741
|
-
var
|
|
6353
|
+
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
6742
6354
|
var AlignLeftIcon = (0, import_react78.memo)(({ className, ...props }) => {
|
|
6743
|
-
return /* @__PURE__ */ (0,
|
|
6355
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
6744
6356
|
"svg",
|
|
6745
6357
|
{
|
|
6746
6358
|
width: "24",
|
|
@@ -6751,7 +6363,7 @@ var AlignLeftIcon = (0, import_react78.memo)(({ className, ...props }) => {
|
|
|
6751
6363
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6752
6364
|
...props,
|
|
6753
6365
|
children: [
|
|
6754
|
-
/* @__PURE__ */ (0,
|
|
6366
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
6755
6367
|
"path",
|
|
6756
6368
|
{
|
|
6757
6369
|
fillRule: "evenodd",
|
|
@@ -6760,7 +6372,7 @@ var AlignLeftIcon = (0, import_react78.memo)(({ className, ...props }) => {
|
|
|
6760
6372
|
fill: "currentColor"
|
|
6761
6373
|
}
|
|
6762
6374
|
),
|
|
6763
|
-
/* @__PURE__ */ (0,
|
|
6375
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
6764
6376
|
"path",
|
|
6765
6377
|
{
|
|
6766
6378
|
fillRule: "evenodd",
|
|
@@ -6769,7 +6381,7 @@ var AlignLeftIcon = (0, import_react78.memo)(({ className, ...props }) => {
|
|
|
6769
6381
|
fill: "currentColor"
|
|
6770
6382
|
}
|
|
6771
6383
|
),
|
|
6772
|
-
/* @__PURE__ */ (0,
|
|
6384
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
6773
6385
|
"path",
|
|
6774
6386
|
{
|
|
6775
6387
|
fillRule: "evenodd",
|
|
@@ -6786,9 +6398,9 @@ AlignLeftIcon.displayName = "AlignLeftIcon";
|
|
|
6786
6398
|
|
|
6787
6399
|
// src/components/tiptap-icons/align-right-icon.tsx
|
|
6788
6400
|
var import_react79 = require("react");
|
|
6789
|
-
var
|
|
6401
|
+
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
6790
6402
|
var AlignRightIcon = (0, import_react79.memo)(({ className, ...props }) => {
|
|
6791
|
-
return /* @__PURE__ */ (0,
|
|
6403
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(
|
|
6792
6404
|
"svg",
|
|
6793
6405
|
{
|
|
6794
6406
|
width: "24",
|
|
@@ -6799,7 +6411,7 @@ var AlignRightIcon = (0, import_react79.memo)(({ className, ...props }) => {
|
|
|
6799
6411
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6800
6412
|
...props,
|
|
6801
6413
|
children: [
|
|
6802
|
-
/* @__PURE__ */ (0,
|
|
6414
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
6803
6415
|
"path",
|
|
6804
6416
|
{
|
|
6805
6417
|
fillRule: "evenodd",
|
|
@@ -6808,7 +6420,7 @@ var AlignRightIcon = (0, import_react79.memo)(({ className, ...props }) => {
|
|
|
6808
6420
|
fill: "currentColor"
|
|
6809
6421
|
}
|
|
6810
6422
|
),
|
|
6811
|
-
/* @__PURE__ */ (0,
|
|
6423
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
6812
6424
|
"path",
|
|
6813
6425
|
{
|
|
6814
6426
|
fillRule: "evenodd",
|
|
@@ -6817,7 +6429,7 @@ var AlignRightIcon = (0, import_react79.memo)(({ className, ...props }) => {
|
|
|
6817
6429
|
fill: "currentColor"
|
|
6818
6430
|
}
|
|
6819
6431
|
),
|
|
6820
|
-
/* @__PURE__ */ (0,
|
|
6432
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
6821
6433
|
"path",
|
|
6822
6434
|
{
|
|
6823
6435
|
fillRule: "evenodd",
|
|
@@ -6925,12 +6537,12 @@ function useTextAlign(config) {
|
|
|
6925
6537
|
|
|
6926
6538
|
// src/components/tiptap-ui/undo-redo-button/undo-redo-button.tsx
|
|
6927
6539
|
var import_react81 = require("react");
|
|
6928
|
-
var
|
|
6540
|
+
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
6929
6541
|
function HistoryShortcutBadge({
|
|
6930
6542
|
action,
|
|
6931
6543
|
shortcutKeys = UNDO_REDO_SHORTCUT_KEYS[action]
|
|
6932
6544
|
}) {
|
|
6933
|
-
return /* @__PURE__ */ (0,
|
|
6545
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(Badge, { children: parseShortcutKeys({ shortcutKeys }) });
|
|
6934
6546
|
}
|
|
6935
6547
|
var UndoRedoButton = (0, import_react81.forwardRef)(
|
|
6936
6548
|
({
|
|
@@ -6962,7 +6574,7 @@ var UndoRedoButton = (0, import_react81.forwardRef)(
|
|
|
6962
6574
|
if (!isVisible) {
|
|
6963
6575
|
return null;
|
|
6964
6576
|
}
|
|
6965
|
-
return /* @__PURE__ */ (0,
|
|
6577
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
6966
6578
|
Button2,
|
|
6967
6579
|
{
|
|
6968
6580
|
type: "button",
|
|
@@ -6976,10 +6588,10 @@ var UndoRedoButton = (0, import_react81.forwardRef)(
|
|
|
6976
6588
|
onClick: handleClick,
|
|
6977
6589
|
...buttonProps,
|
|
6978
6590
|
ref,
|
|
6979
|
-
children: children ?? /* @__PURE__ */ (0,
|
|
6980
|
-
/* @__PURE__ */ (0,
|
|
6981
|
-
text && /* @__PURE__ */ (0,
|
|
6982
|
-
showShortcut && /* @__PURE__ */ (0,
|
|
6591
|
+
children: children ?? /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(import_jsx_runtime71.Fragment, { children: [
|
|
6592
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(Icon, { className: "tiptap-button-icon" }),
|
|
6593
|
+
text && /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("span", { className: "tiptap-button-text", children: text }),
|
|
6594
|
+
showShortcut && /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
6983
6595
|
HistoryShortcutBadge,
|
|
6984
6596
|
{
|
|
6985
6597
|
action,
|
|
@@ -6998,9 +6610,9 @@ var import_react84 = require("react");
|
|
|
6998
6610
|
|
|
6999
6611
|
// src/components/tiptap-icons/redo2-icon.tsx
|
|
7000
6612
|
var import_react82 = require("react");
|
|
7001
|
-
var
|
|
6613
|
+
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
7002
6614
|
var Redo2Icon = (0, import_react82.memo)(({ className, ...props }) => {
|
|
7003
|
-
return /* @__PURE__ */ (0,
|
|
6615
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
7004
6616
|
"svg",
|
|
7005
6617
|
{
|
|
7006
6618
|
width: "24",
|
|
@@ -7010,7 +6622,7 @@ var Redo2Icon = (0, import_react82.memo)(({ className, ...props }) => {
|
|
|
7010
6622
|
fill: "currentColor",
|
|
7011
6623
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7012
6624
|
...props,
|
|
7013
|
-
children: /* @__PURE__ */ (0,
|
|
6625
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
7014
6626
|
"path",
|
|
7015
6627
|
{
|
|
7016
6628
|
fillRule: "evenodd",
|
|
@@ -7026,9 +6638,9 @@ Redo2Icon.displayName = "Redo2Icon";
|
|
|
7026
6638
|
|
|
7027
6639
|
// src/components/tiptap-icons/undo2-icon.tsx
|
|
7028
6640
|
var import_react83 = require("react");
|
|
7029
|
-
var
|
|
6641
|
+
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
7030
6642
|
var Undo2Icon = (0, import_react83.memo)(({ className, ...props }) => {
|
|
7031
|
-
return /* @__PURE__ */ (0,
|
|
6643
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
7032
6644
|
"svg",
|
|
7033
6645
|
{
|
|
7034
6646
|
width: "24",
|
|
@@ -7038,7 +6650,7 @@ var Undo2Icon = (0, import_react83.memo)(({ className, ...props }) => {
|
|
|
7038
6650
|
fill: "currentColor",
|
|
7039
6651
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7040
6652
|
...props,
|
|
7041
|
-
children: /* @__PURE__ */ (0,
|
|
6653
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
7042
6654
|
"path",
|
|
7043
6655
|
{
|
|
7044
6656
|
fillRule: "evenodd",
|
|
@@ -7314,12 +6926,12 @@ var import_lucide_react9 = require("lucide-react");
|
|
|
7314
6926
|
// src/components/ui/command.tsx
|
|
7315
6927
|
var import_cmdk = require("cmdk");
|
|
7316
6928
|
var import_lucide_react8 = require("lucide-react");
|
|
7317
|
-
var
|
|
6929
|
+
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
7318
6930
|
function Command({
|
|
7319
6931
|
className,
|
|
7320
6932
|
...props
|
|
7321
6933
|
}) {
|
|
7322
|
-
return /* @__PURE__ */ (0,
|
|
6934
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
7323
6935
|
import_cmdk.Command,
|
|
7324
6936
|
{
|
|
7325
6937
|
"data-slot": "command",
|
|
@@ -7335,14 +6947,14 @@ function CommandInput({
|
|
|
7335
6947
|
className,
|
|
7336
6948
|
...props
|
|
7337
6949
|
}) {
|
|
7338
|
-
return /* @__PURE__ */ (0,
|
|
6950
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(
|
|
7339
6951
|
"div",
|
|
7340
6952
|
{
|
|
7341
6953
|
"data-slot": "command-input-wrapper",
|
|
7342
6954
|
className: "flex h-9 items-center gap-2 border-b px-3",
|
|
7343
6955
|
children: [
|
|
7344
|
-
/* @__PURE__ */ (0,
|
|
7345
|
-
/* @__PURE__ */ (0,
|
|
6956
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_lucide_react8.SearchIcon, { className: "size-4 shrink-0 opacity-50" }),
|
|
6957
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
7346
6958
|
import_cmdk.Command.Input,
|
|
7347
6959
|
{
|
|
7348
6960
|
"data-slot": "command-input",
|
|
@@ -7361,7 +6973,7 @@ function CommandList({
|
|
|
7361
6973
|
className,
|
|
7362
6974
|
...props
|
|
7363
6975
|
}) {
|
|
7364
|
-
return /* @__PURE__ */ (0,
|
|
6976
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
7365
6977
|
import_cmdk.Command.List,
|
|
7366
6978
|
{
|
|
7367
6979
|
"data-slot": "command-list",
|
|
@@ -7376,7 +6988,7 @@ function CommandList({
|
|
|
7376
6988
|
function CommandEmpty({
|
|
7377
6989
|
...props
|
|
7378
6990
|
}) {
|
|
7379
|
-
return /* @__PURE__ */ (0,
|
|
6991
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
7380
6992
|
import_cmdk.Command.Empty,
|
|
7381
6993
|
{
|
|
7382
6994
|
"data-slot": "command-empty",
|
|
@@ -7389,7 +7001,7 @@ function CommandGroup({
|
|
|
7389
7001
|
className,
|
|
7390
7002
|
...props
|
|
7391
7003
|
}) {
|
|
7392
|
-
return /* @__PURE__ */ (0,
|
|
7004
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
7393
7005
|
import_cmdk.Command.Group,
|
|
7394
7006
|
{
|
|
7395
7007
|
"data-slot": "command-group",
|
|
@@ -7405,7 +7017,7 @@ function CommandItem({
|
|
|
7405
7017
|
className,
|
|
7406
7018
|
...props
|
|
7407
7019
|
}) {
|
|
7408
|
-
return /* @__PURE__ */ (0,
|
|
7020
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
7409
7021
|
import_cmdk.Command.Item,
|
|
7410
7022
|
{
|
|
7411
7023
|
"data-slot": "command-item",
|
|
@@ -7420,16 +7032,16 @@ function CommandItem({
|
|
|
7420
7032
|
|
|
7421
7033
|
// src/components/ui/popover.tsx
|
|
7422
7034
|
var PopoverPrimitive2 = __toESM(require("@radix-ui/react-popover"));
|
|
7423
|
-
var
|
|
7035
|
+
var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
7424
7036
|
function Popover2({
|
|
7425
7037
|
...props
|
|
7426
7038
|
}) {
|
|
7427
|
-
return /* @__PURE__ */ (0,
|
|
7039
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(PopoverPrimitive2.Root, { "data-slot": "popover", ...props });
|
|
7428
7040
|
}
|
|
7429
7041
|
function PopoverTrigger2({
|
|
7430
7042
|
...props
|
|
7431
7043
|
}) {
|
|
7432
|
-
return /* @__PURE__ */ (0,
|
|
7044
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(PopoverPrimitive2.Trigger, { "data-slot": "popover-trigger", ...props });
|
|
7433
7045
|
}
|
|
7434
7046
|
function PopoverContent2({
|
|
7435
7047
|
className,
|
|
@@ -7437,7 +7049,7 @@ function PopoverContent2({
|
|
|
7437
7049
|
sideOffset = 4,
|
|
7438
7050
|
...props
|
|
7439
7051
|
}) {
|
|
7440
|
-
return /* @__PURE__ */ (0,
|
|
7052
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(PopoverPrimitive2.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
7441
7053
|
PopoverPrimitive2.Content,
|
|
7442
7054
|
{
|
|
7443
7055
|
"data-slot": "popover-content",
|
|
@@ -7453,7 +7065,7 @@ function PopoverContent2({
|
|
|
7453
7065
|
}
|
|
7454
7066
|
|
|
7455
7067
|
// src/components/tiptap-ui/font-family-dropdown/font-family-dropdown.tsx
|
|
7456
|
-
var
|
|
7068
|
+
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
7457
7069
|
function FontFamilyDropdown() {
|
|
7458
7070
|
const { editor } = (0, import_react85.useCurrentEditor)();
|
|
7459
7071
|
const [open, setOpen] = (0, import_react86.useState)(false);
|
|
@@ -7479,19 +7091,19 @@ function FontFamilyDropdown() {
|
|
|
7479
7091
|
}
|
|
7480
7092
|
editor.chain().focus().setMark("textStyle", { fontFamily: family }).run();
|
|
7481
7093
|
};
|
|
7482
|
-
return /* @__PURE__ */ (0,
|
|
7483
|
-
/* @__PURE__ */ (0,
|
|
7094
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(Popover2, { open, onOpenChange: setOpen, children: [
|
|
7095
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(PopoverTrigger2, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(
|
|
7484
7096
|
Button,
|
|
7485
7097
|
{
|
|
7486
7098
|
variant: "outlineFontFamily",
|
|
7487
7099
|
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",
|
|
7488
7100
|
children: [
|
|
7489
7101
|
currentFont,
|
|
7490
|
-
/* @__PURE__ */ (0,
|
|
7102
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(import_lucide_react9.ChevronDown, { className: "w-4 h-4" })
|
|
7491
7103
|
]
|
|
7492
7104
|
}
|
|
7493
7105
|
) }),
|
|
7494
|
-
/* @__PURE__ */ (0,
|
|
7106
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
7495
7107
|
PopoverContent2,
|
|
7496
7108
|
{
|
|
7497
7109
|
className: "w-[300px] p-0",
|
|
@@ -7502,12 +7114,12 @@ function FontFamilyDropdown() {
|
|
|
7502
7114
|
e.preventDefault();
|
|
7503
7115
|
}
|
|
7504
7116
|
},
|
|
7505
|
-
children: /* @__PURE__ */ (0,
|
|
7506
|
-
/* @__PURE__ */ (0,
|
|
7507
|
-
/* @__PURE__ */ (0,
|
|
7508
|
-
/* @__PURE__ */ (0,
|
|
7509
|
-
/* @__PURE__ */ (0,
|
|
7510
|
-
/* @__PURE__ */ (0,
|
|
7117
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(Command, { children: [
|
|
7118
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)("div", { className: "cmd-input-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(CommandInput, { placeholder: "Search font..." }) }),
|
|
7119
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(CommandList, { className: "max-h-[220px]", children: [
|
|
7120
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(CommandEmpty, { children: "No font found." }),
|
|
7121
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(CommandGroup, { children: [
|
|
7122
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
7511
7123
|
CommandItem,
|
|
7512
7124
|
{
|
|
7513
7125
|
onSelect: () => {
|
|
@@ -7520,7 +7132,7 @@ function FontFamilyDropdown() {
|
|
|
7520
7132
|
},
|
|
7521
7133
|
"default"
|
|
7522
7134
|
),
|
|
7523
|
-
FONT_OPTIONS.map(({ label, cssFontFamily }) => /* @__PURE__ */ (0,
|
|
7135
|
+
FONT_OPTIONS.map(({ label, cssFontFamily }) => /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
7524
7136
|
CommandItem,
|
|
7525
7137
|
{
|
|
7526
7138
|
onSelect: () => {
|
|
@@ -7548,12 +7160,12 @@ var import_lodash = require("lodash");
|
|
|
7548
7160
|
|
|
7549
7161
|
// src/components/ui/label.tsx
|
|
7550
7162
|
var LabelPrimitive = __toESM(require("@radix-ui/react-label"));
|
|
7551
|
-
var
|
|
7163
|
+
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
7552
7164
|
function Label({
|
|
7553
7165
|
className,
|
|
7554
7166
|
...props
|
|
7555
7167
|
}) {
|
|
7556
|
-
return /* @__PURE__ */ (0,
|
|
7168
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
7557
7169
|
LabelPrimitive.Root,
|
|
7558
7170
|
{
|
|
7559
7171
|
"data-slot": "label",
|
|
@@ -7568,7 +7180,7 @@ function Label({
|
|
|
7568
7180
|
|
|
7569
7181
|
// src/components/tiptap-ui/color-picker/color-picker.tsx
|
|
7570
7182
|
var import_react89 = __toESM(require("react"));
|
|
7571
|
-
var
|
|
7183
|
+
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
7572
7184
|
function ColorPicker({ type = "text" }) {
|
|
7573
7185
|
const { editor } = (0, import_react88.useCurrentEditor)();
|
|
7574
7186
|
const [open, setOpen] = (0, import_react87.useState)(false);
|
|
@@ -7618,15 +7230,15 @@ function ColorPicker({ type = "text" }) {
|
|
|
7618
7230
|
[]
|
|
7619
7231
|
);
|
|
7620
7232
|
if (!editor) return null;
|
|
7621
|
-
return /* @__PURE__ */ (0,
|
|
7622
|
-
/* @__PURE__ */ (0,
|
|
7233
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(Popover2, { open, onOpenChange: (v) => setOpen(v), children: [
|
|
7234
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(PopoverTrigger2, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(
|
|
7623
7235
|
Button,
|
|
7624
7236
|
{
|
|
7625
7237
|
variant: "outlineFontFamily",
|
|
7626
7238
|
className: "flex items-center h-7 rounded-sm px-2 border-[#a3a3a8] text-[#a3a3a8] hover:text-white",
|
|
7627
7239
|
children: [
|
|
7628
7240
|
"Color",
|
|
7629
|
-
/* @__PURE__ */ (0,
|
|
7241
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
7630
7242
|
"span",
|
|
7631
7243
|
{
|
|
7632
7244
|
className: "w-3 h-3 ml-2 rounded-sm border border-black/20",
|
|
@@ -7636,16 +7248,16 @@ function ColorPicker({ type = "text" }) {
|
|
|
7636
7248
|
]
|
|
7637
7249
|
}
|
|
7638
7250
|
) }),
|
|
7639
|
-
/* @__PURE__ */ (0,
|
|
7251
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(
|
|
7640
7252
|
PopoverContent2,
|
|
7641
7253
|
{
|
|
7642
7254
|
className: "w-[260px] p-3",
|
|
7643
7255
|
align: "start",
|
|
7644
7256
|
onClick: (e) => e.stopPropagation(),
|
|
7645
7257
|
children: [
|
|
7646
|
-
/* @__PURE__ */ (0,
|
|
7647
|
-
!showCustom && /* @__PURE__ */ (0,
|
|
7648
|
-
/* @__PURE__ */ (0,
|
|
7258
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Label, { className: "text-xs mb-2", children: type === "text" ? "Text Color" : "Highlight Color" }),
|
|
7259
|
+
!showCustom && /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: "flex flex-col gap-3", children: [
|
|
7260
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "grid grid-cols-7 gap-1", children: GRADIENT_ROWS_70.map((c) => /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
7649
7261
|
"div",
|
|
7650
7262
|
{
|
|
7651
7263
|
onClick: () => {
|
|
@@ -7657,7 +7269,7 @@ function ColorPicker({ type = "text" }) {
|
|
|
7657
7269
|
},
|
|
7658
7270
|
c
|
|
7659
7271
|
)) }),
|
|
7660
|
-
/* @__PURE__ */ (0,
|
|
7272
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
7661
7273
|
Button,
|
|
7662
7274
|
{
|
|
7663
7275
|
size: "sm",
|
|
@@ -7671,7 +7283,7 @@ function ColorPicker({ type = "text" }) {
|
|
|
7671
7283
|
)
|
|
7672
7284
|
] }),
|
|
7673
7285
|
showCustom && // stop mouse/pointer events from bubbling so popover doesn't treat them as outside clicks
|
|
7674
|
-
/* @__PURE__ */ (0,
|
|
7286
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(
|
|
7675
7287
|
"div",
|
|
7676
7288
|
{
|
|
7677
7289
|
className: "flex flex-col gap-3",
|
|
@@ -7681,7 +7293,7 @@ function ColorPicker({ type = "text" }) {
|
|
|
7681
7293
|
onPointerUp: (e) => e.stopPropagation(),
|
|
7682
7294
|
onClick: (e) => e.stopPropagation(),
|
|
7683
7295
|
children: [
|
|
7684
|
-
/* @__PURE__ */ (0,
|
|
7296
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
7685
7297
|
import_react_colorful.HexColorPicker,
|
|
7686
7298
|
{
|
|
7687
7299
|
color: tempHex,
|
|
@@ -7692,8 +7304,8 @@ function ColorPicker({ type = "text" }) {
|
|
|
7692
7304
|
onMouseUp: (e) => e.stopPropagation()
|
|
7693
7305
|
}
|
|
7694
7306
|
),
|
|
7695
|
-
/* @__PURE__ */ (0,
|
|
7696
|
-
/* @__PURE__ */ (0,
|
|
7307
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: "flex gap-2 items-center", children: [
|
|
7308
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
7697
7309
|
"input",
|
|
7698
7310
|
{
|
|
7699
7311
|
value: tempHex,
|
|
@@ -7704,7 +7316,7 @@ function ColorPicker({ type = "text" }) {
|
|
|
7704
7316
|
className: "w-full px-2 py-1 border rounded text-sm"
|
|
7705
7317
|
}
|
|
7706
7318
|
),
|
|
7707
|
-
/* @__PURE__ */ (0,
|
|
7319
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
7708
7320
|
Button,
|
|
7709
7321
|
{
|
|
7710
7322
|
size: "sm",
|
|
@@ -7717,7 +7329,7 @@ function ColorPicker({ type = "text" }) {
|
|
|
7717
7329
|
}
|
|
7718
7330
|
)
|
|
7719
7331
|
] }),
|
|
7720
|
-
/* @__PURE__ */ (0,
|
|
7332
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "flex justify-end mt-2", children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
7721
7333
|
Button,
|
|
7722
7334
|
{
|
|
7723
7335
|
size: "sm",
|
|
@@ -7745,7 +7357,7 @@ function ColorPicker({ type = "text" }) {
|
|
|
7745
7357
|
var import_react90 = require("react");
|
|
7746
7358
|
var import_react91 = require("@tiptap/react");
|
|
7747
7359
|
var import_fi = require("react-icons/fi");
|
|
7748
|
-
var
|
|
7360
|
+
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
7749
7361
|
function TableDropdownMenu() {
|
|
7750
7362
|
const { editor } = (0, import_react91.useCurrentEditor)();
|
|
7751
7363
|
const [open, setOpen] = (0, import_react90.useState)(false);
|
|
@@ -7787,21 +7399,21 @@ function TableDropdownMenu() {
|
|
|
7787
7399
|
}
|
|
7788
7400
|
setOpen(false);
|
|
7789
7401
|
};
|
|
7790
|
-
return /* @__PURE__ */ (0,
|
|
7791
|
-
/* @__PURE__ */ (0,
|
|
7792
|
-
/* @__PURE__ */ (0,
|
|
7793
|
-
/* @__PURE__ */ (0,
|
|
7794
|
-
/* @__PURE__ */ (0,
|
|
7795
|
-
/* @__PURE__ */ (0,
|
|
7796
|
-
/* @__PURE__ */ (0,
|
|
7797
|
-
/* @__PURE__ */ (0,
|
|
7798
|
-
/* @__PURE__ */ (0,
|
|
7799
|
-
/* @__PURE__ */ (0,
|
|
7800
|
-
/* @__PURE__ */ (0,
|
|
7801
|
-
/* @__PURE__ */ (0,
|
|
7802
|
-
/* @__PURE__ */ (0,
|
|
7803
|
-
/* @__PURE__ */ (0,
|
|
7804
|
-
/* @__PURE__ */ (0,
|
|
7402
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(Popover2, { open, onOpenChange: setOpen, children: [
|
|
7403
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(PopoverTrigger2, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(Button, { variant: "tableButton", size: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_fi.FiTable, { size: 16, color: "#a3a3a8" }) }) }),
|
|
7404
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(PopoverContent2, { className: "w-[220px] p-0", align: "start", children: /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(Command, { children: [
|
|
7405
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(CommandInput, { placeholder: "Search table actions..." }),
|
|
7406
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(CommandList, { className: "max-h-[260px]", children: /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(CommandGroup, { children: [
|
|
7407
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(CommandItem, { onSelect: () => handleAction("insert"), children: "Insert Table" }),
|
|
7408
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(CommandItem, { onSelect: () => handleAction("addColBefore"), children: "Add Column Before" }),
|
|
7409
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(CommandItem, { onSelect: () => handleAction("addColAfter"), children: "Add Column After" }),
|
|
7410
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(CommandItem, { onSelect: () => handleAction("delCol"), children: "Delete Column" }),
|
|
7411
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(CommandItem, { onSelect: () => handleAction("addRowBefore"), children: "Add Row Before" }),
|
|
7412
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(CommandItem, { onSelect: () => handleAction("addRowAfter"), children: "Add Row After" }),
|
|
7413
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(CommandItem, { onSelect: () => handleAction("delRow"), children: "Delete Row" }),
|
|
7414
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(CommandItem, { onSelect: () => handleAction("merge"), children: "Merge Cells" }),
|
|
7415
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(CommandItem, { onSelect: () => handleAction("split"), children: "Split Cells" }),
|
|
7416
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(CommandItem, { onSelect: () => handleAction("deleteTable"), children: "Delete Table" })
|
|
7805
7417
|
] }) })
|
|
7806
7418
|
] }) })
|
|
7807
7419
|
] });
|
|
@@ -7809,9 +7421,9 @@ function TableDropdownMenu() {
|
|
|
7809
7421
|
|
|
7810
7422
|
// src/components/tiptap-icons/arrow-left-icon.tsx
|
|
7811
7423
|
var import_react92 = require("react");
|
|
7812
|
-
var
|
|
7424
|
+
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
7813
7425
|
var ArrowLeftIcon = (0, import_react92.memo)(({ className, ...props }) => {
|
|
7814
|
-
return /* @__PURE__ */ (0,
|
|
7426
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
7815
7427
|
"svg",
|
|
7816
7428
|
{
|
|
7817
7429
|
width: "24",
|
|
@@ -7821,7 +7433,7 @@ var ArrowLeftIcon = (0, import_react92.memo)(({ className, ...props }) => {
|
|
|
7821
7433
|
fill: "currentColor",
|
|
7822
7434
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7823
7435
|
...props,
|
|
7824
|
-
children: /* @__PURE__ */ (0,
|
|
7436
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
7825
7437
|
"path",
|
|
7826
7438
|
{
|
|
7827
7439
|
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",
|
|
@@ -8047,62 +7659,62 @@ function useCursorVisibility({
|
|
|
8047
7659
|
}
|
|
8048
7660
|
|
|
8049
7661
|
// src/components/tiptap-templates/simple/simple-editor.tsx
|
|
8050
|
-
var
|
|
7662
|
+
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
8051
7663
|
var MainToolbarContent = ({
|
|
8052
7664
|
onHighlighterClick,
|
|
8053
7665
|
onLinkClick,
|
|
8054
7666
|
isMobile
|
|
8055
7667
|
}) => {
|
|
8056
|
-
return /* @__PURE__ */ (0,
|
|
8057
|
-
/* @__PURE__ */ (0,
|
|
8058
|
-
/* @__PURE__ */ (0,
|
|
8059
|
-
/* @__PURE__ */ (0,
|
|
8060
|
-
/* @__PURE__ */ (0,
|
|
8061
|
-
/* @__PURE__ */ (0,
|
|
8062
|
-
/* @__PURE__ */ (0,
|
|
8063
|
-
/* @__PURE__ */ (0,
|
|
8064
|
-
/* @__PURE__ */ (0,
|
|
8065
|
-
/* @__PURE__ */ (0,
|
|
8066
|
-
/* @__PURE__ */ (0,
|
|
8067
|
-
/* @__PURE__ */ (0,
|
|
7668
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)(import_jsx_runtime81.Fragment, { children: [
|
|
7669
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(Spacer, {}),
|
|
7670
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(FontFamilyDropdown, {}),
|
|
7671
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(ColorPicker, { type: "text" }),
|
|
7672
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsxs)(ToolbarGroup, { children: [
|
|
7673
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(MarkButton, { type: "bold" }),
|
|
7674
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(MarkButton, { type: "italic" }),
|
|
7675
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(MarkButton, { type: "strike" }),
|
|
7676
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(MarkButton, { type: "code" }),
|
|
7677
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(MarkButton, { type: "underline" }),
|
|
7678
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(UndoRedoButton, { action: "undo" }),
|
|
7679
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(UndoRedoButton, { action: "redo" })
|
|
8068
7680
|
] }),
|
|
8069
|
-
/* @__PURE__ */ (0,
|
|
8070
|
-
/* @__PURE__ */ (0,
|
|
8071
|
-
/* @__PURE__ */ (0,
|
|
8072
|
-
/* @__PURE__ */ (0,
|
|
8073
|
-
/* @__PURE__ */ (0,
|
|
8074
|
-
/* @__PURE__ */ (0,
|
|
7681
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(ToolbarSeparator, {}),
|
|
7682
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsxs)(ToolbarGroup, { children: [
|
|
7683
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(TextAlignButton, { align: "left" }),
|
|
7684
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(TextAlignButton, { align: "center" }),
|
|
7685
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(TextAlignButton, { align: "right" }),
|
|
7686
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(TextAlignButton, { align: "justify" })
|
|
8075
7687
|
] }),
|
|
8076
|
-
/* @__PURE__ */ (0,
|
|
8077
|
-
/* @__PURE__ */ (0,
|
|
8078
|
-
/* @__PURE__ */ (0,
|
|
8079
|
-
/* @__PURE__ */ (0,
|
|
7688
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(ToolbarSeparator, {}),
|
|
7689
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsxs)(ToolbarGroup, { children: [
|
|
7690
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(HeadingDropdownMenu, { levels: [1, 2, 3, 4], portal: isMobile }),
|
|
7691
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
8080
7692
|
ListDropdownMenu,
|
|
8081
7693
|
{
|
|
8082
7694
|
types: ["bulletList", "orderedList", "taskList"],
|
|
8083
7695
|
portal: isMobile
|
|
8084
7696
|
}
|
|
8085
7697
|
),
|
|
8086
|
-
/* @__PURE__ */ (0,
|
|
7698
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(BlockquoteButton, {})
|
|
8087
7699
|
] }),
|
|
8088
|
-
/* @__PURE__ */ (0,
|
|
8089
|
-
/* @__PURE__ */ (0,
|
|
8090
|
-
/* @__PURE__ */ (0,
|
|
8091
|
-
/* @__PURE__ */ (0,
|
|
8092
|
-
/* @__PURE__ */ (0,
|
|
8093
|
-
isMobile && /* @__PURE__ */ (0,
|
|
7700
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(ToolbarGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(TableDropdownMenu, {}) }),
|
|
7701
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(ToolbarGroup, {}),
|
|
7702
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(ToolbarSeparator, {}),
|
|
7703
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(ToolbarGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(ImageUploadButton, { text: "Add" }) }),
|
|
7704
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(Spacer, {}),
|
|
7705
|
+
isMobile && /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(ToolbarSeparator, {})
|
|
8094
7706
|
] });
|
|
8095
7707
|
};
|
|
8096
7708
|
var MobileToolbarContent = ({
|
|
8097
7709
|
type,
|
|
8098
7710
|
onBack
|
|
8099
|
-
}) => /* @__PURE__ */ (0,
|
|
8100
|
-
/* @__PURE__ */ (0,
|
|
8101
|
-
/* @__PURE__ */ (0,
|
|
8102
|
-
type === "highlighter" ? /* @__PURE__ */ (0,
|
|
7711
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)(import_jsx_runtime81.Fragment, { children: [
|
|
7712
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(ToolbarGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)(Button2, { "data-style": "ghost", onClick: onBack, children: [
|
|
7713
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(ArrowLeftIcon, { className: "tiptap-button-icon" }),
|
|
7714
|
+
type === "highlighter" ? /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(HighlighterIcon, { className: "tiptap-button-icon" }) : /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(LinkIcon, { className: "tiptap-button-icon" })
|
|
8103
7715
|
] }) }),
|
|
8104
|
-
/* @__PURE__ */ (0,
|
|
8105
|
-
type === "highlighter" ? /* @__PURE__ */ (0,
|
|
7716
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(ToolbarSeparator, {}),
|
|
7717
|
+
type === "highlighter" ? /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(ColorHighlightPopoverContent, {}) : /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(LinkContent, {})
|
|
8106
7718
|
] });
|
|
8107
7719
|
function SimpleEditor() {
|
|
8108
7720
|
const { setEditorContent, debouncedSave } = useEditorBridge();
|
|
@@ -8133,25 +7745,8 @@ function SimpleEditor() {
|
|
|
8133
7745
|
}),
|
|
8134
7746
|
HorizontalRule,
|
|
8135
7747
|
index_default,
|
|
8136
|
-
index_default3.configure({
|
|
8137
|
-
HTMLAttributes: {
|
|
8138
|
-
class: "blockquote-node"
|
|
8139
|
-
}
|
|
8140
|
-
}),
|
|
8141
|
-
index_default4.configure({
|
|
8142
|
-
HTMLAttributes: {
|
|
8143
|
-
class: "code-block-node"
|
|
8144
|
-
}
|
|
8145
|
-
}),
|
|
8146
|
-
import_extension_list.ListItem.configure({
|
|
8147
|
-
HTMLAttributes: {
|
|
8148
|
-
class: "list-item-node"
|
|
8149
|
-
}
|
|
8150
|
-
}),
|
|
8151
|
-
import_tiptap_extension_resize_image.default,
|
|
8152
|
-
import_extension_image.default,
|
|
8153
7748
|
index_default2,
|
|
8154
|
-
|
|
7749
|
+
index_default3,
|
|
8155
7750
|
import_extensions.Gapcursor,
|
|
8156
7751
|
import_extension_text_style2.TextStyle,
|
|
8157
7752
|
FontSizeStepper.configure({ step: 2, min: 8, defaultSize: 16 }),
|
|
@@ -8229,8 +7824,8 @@ function SimpleEditor() {
|
|
|
8229
7824
|
window.visualViewport?.removeEventListener("scroll", updatePosition);
|
|
8230
7825
|
};
|
|
8231
7826
|
}, []);
|
|
8232
|
-
return /* @__PURE__ */ (0,
|
|
8233
|
-
/* @__PURE__ */ (0,
|
|
7827
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: "simple-editor-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)(import_react99.EditorContext.Provider, { value: { editor }, children: [
|
|
7828
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
8234
7829
|
Toolbar,
|
|
8235
7830
|
{
|
|
8236
7831
|
ref: toolbarRef,
|
|
@@ -8239,14 +7834,14 @@ function SimpleEditor() {
|
|
|
8239
7834
|
bottom: `calc(100% - ${height - rect.y}px)`
|
|
8240
7835
|
} : {}
|
|
8241
7836
|
},
|
|
8242
|
-
children: mobileView === "main" ? /* @__PURE__ */ (0,
|
|
7837
|
+
children: mobileView === "main" ? /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
8243
7838
|
MainToolbarContent,
|
|
8244
7839
|
{
|
|
8245
7840
|
onHighlighterClick: () => setMobileView("highlighter"),
|
|
8246
7841
|
onLinkClick: () => setMobileView("link"),
|
|
8247
7842
|
isMobile
|
|
8248
7843
|
}
|
|
8249
|
-
) : /* @__PURE__ */ (0,
|
|
7844
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
8250
7845
|
MobileToolbarContent,
|
|
8251
7846
|
{
|
|
8252
7847
|
type: mobileView === "highlighter" ? "highlighter" : "link",
|
|
@@ -8255,14 +7850,14 @@ function SimpleEditor() {
|
|
|
8255
7850
|
)
|
|
8256
7851
|
}
|
|
8257
7852
|
),
|
|
8258
|
-
/* @__PURE__ */ (0,
|
|
7853
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
8259
7854
|
import_react99.EditorContent,
|
|
8260
7855
|
{
|
|
8261
7856
|
editor,
|
|
8262
7857
|
role: "presentation",
|
|
8263
7858
|
autoFocus: true,
|
|
8264
7859
|
className: "simple-editor-content",
|
|
8265
|
-
children: editor && /* @__PURE__ */ (0,
|
|
7860
|
+
children: editor && /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(BubbleMenuInline, {})
|
|
8266
7861
|
}
|
|
8267
7862
|
)
|
|
8268
7863
|
] }) });
|
|
@@ -8270,9 +7865,9 @@ function SimpleEditor() {
|
|
|
8270
7865
|
|
|
8271
7866
|
// src/components/editor/editor.tsx
|
|
8272
7867
|
var import_clsx2 = __toESM(require("clsx"));
|
|
8273
|
-
var
|
|
7868
|
+
var import_jsx_runtime82 = require("react/jsx-runtime");
|
|
8274
7869
|
function Editor({ onChange, className, style, onTabsChange, initialTabs }) {
|
|
8275
|
-
return /* @__PURE__ */ (0,
|
|
7870
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
8276
7871
|
"div",
|
|
8277
7872
|
{
|
|
8278
7873
|
className: (0, import_clsx2.default)(
|
|
@@ -8280,7 +7875,7 @@ function Editor({ onChange, className, style, onTabsChange, initialTabs }) {
|
|
|
8280
7875
|
className
|
|
8281
7876
|
),
|
|
8282
7877
|
style,
|
|
8283
|
-
children: /* @__PURE__ */ (0,
|
|
7878
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(EditorShell, { children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(EditorLayout, { onChange, initialTabs, onTabsChange, children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(SimpleEditor, {}) }) })
|
|
8284
7879
|
}
|
|
8285
7880
|
);
|
|
8286
7881
|
}
|