@lumir-company/editor 0.4.21 → 0.4.22
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/README.md +9 -0
- package/dist/index.d.mts +21 -15
- package/dist/index.d.ts +21 -15
- package/dist/index.js +852 -661
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +530 -346
- package/dist/index.mjs.map +1 -1
- package/dist/style.css +59 -0
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
// src/components/LumirEditor.tsx
|
|
4
|
-
import { useEffect as
|
|
4
|
+
import { useEffect as useEffect12, useMemo as useMemo8, useCallback as useCallback21, useState as useState12, useRef as useRef12 } from "react";
|
|
5
5
|
import {
|
|
6
6
|
useCreateBlockNote,
|
|
7
7
|
SideMenu as BlockSideMenu,
|
|
@@ -1537,15 +1537,22 @@ var Column = createStronglyTypedTiptapNode2({
|
|
|
1537
1537
|
});
|
|
1538
1538
|
|
|
1539
1539
|
// src/styles/FontSizeStyle.tsx
|
|
1540
|
-
import {
|
|
1541
|
-
|
|
1542
|
-
var FontSize = createReactStyleSpec(
|
|
1540
|
+
import { createStyleSpec } from "@blocknote/core";
|
|
1541
|
+
var FontSize = createStyleSpec(
|
|
1543
1542
|
{
|
|
1544
1543
|
type: "fontSize",
|
|
1545
1544
|
propSchema: "string"
|
|
1546
1545
|
},
|
|
1547
1546
|
{
|
|
1548
|
-
|
|
1547
|
+
// 바닐라(동기) 스타일 스펙: DOM을 직접 반환한다.
|
|
1548
|
+
// createReactStyleSpec는 span 내용이 비동기 렌더되어, 적용 직후 동기 시점에
|
|
1549
|
+
// 선택 영역의 DOM 좌표가 (0,0)으로 잡혀 BlockNote 포매팅 툴바가 좌상단으로
|
|
1550
|
+
// 튀는 문제가 있었다(굵게/기울임 등 네이티브 마크는 동기 렌더라 정상).
|
|
1551
|
+
render: (value) => {
|
|
1552
|
+
const span = document.createElement("span");
|
|
1553
|
+
span.style.fontSize = value;
|
|
1554
|
+
return { dom: span, contentDOM: span };
|
|
1555
|
+
}
|
|
1549
1556
|
}
|
|
1550
1557
|
);
|
|
1551
1558
|
var FONT_SIZE_PRESETS = [
|
|
@@ -1558,10 +1565,24 @@ var FONT_SIZE_PRESETS = [
|
|
|
1558
1565
|
"24px",
|
|
1559
1566
|
"28px"
|
|
1560
1567
|
];
|
|
1568
|
+
var FONT_SIZE_MIN = 8;
|
|
1569
|
+
var FONT_SIZE_MAX = 96;
|
|
1570
|
+
var FONT_SIZE_DEFAULT_PX = 14;
|
|
1571
|
+
var FONT_SIZE_STEP = 1;
|
|
1572
|
+
function parseFontSizePx(size) {
|
|
1573
|
+
const n = parseInt(size, 10);
|
|
1574
|
+
return Number.isFinite(n) ? n : FONT_SIZE_DEFAULT_PX;
|
|
1575
|
+
}
|
|
1576
|
+
function clampFontSizePx(px) {
|
|
1577
|
+
return Math.min(FONT_SIZE_MAX, Math.max(FONT_SIZE_MIN, Math.round(px)));
|
|
1578
|
+
}
|
|
1579
|
+
function toFontSizeValue(px) {
|
|
1580
|
+
return `${clampFontSizePx(px)}px`;
|
|
1581
|
+
}
|
|
1561
1582
|
|
|
1562
1583
|
// src/blocks/HtmlPreview.tsx
|
|
1563
1584
|
import { useState as useState3, useRef as useRef3, useCallback as useCallback3, useEffect as useEffect3 } from "react";
|
|
1564
|
-
import { jsx as
|
|
1585
|
+
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
1565
1586
|
var MIN_HEIGHT = 100;
|
|
1566
1587
|
var MAX_HEIGHT = 1200;
|
|
1567
1588
|
var ensureCharset = (html) => {
|
|
@@ -1736,7 +1757,7 @@ var HtmlPreviewBlock = createReactBlockSpec3(
|
|
|
1736
1757
|
},
|
|
1737
1758
|
onClick: () => setIsExpanded(!isExpanded),
|
|
1738
1759
|
children: [
|
|
1739
|
-
/* @__PURE__ */
|
|
1760
|
+
/* @__PURE__ */ jsx3(
|
|
1740
1761
|
"svg",
|
|
1741
1762
|
{
|
|
1742
1763
|
width: "16",
|
|
@@ -1751,15 +1772,15 @@ var HtmlPreviewBlock = createReactBlockSpec3(
|
|
|
1751
1772
|
transform: isExpanded ? "rotate(180deg)" : "rotate(0deg)",
|
|
1752
1773
|
transition: "transform 0.2s"
|
|
1753
1774
|
},
|
|
1754
|
-
children: /* @__PURE__ */
|
|
1775
|
+
children: /* @__PURE__ */ jsx3("polyline", { points: "6 9 12 15 18 9" })
|
|
1755
1776
|
}
|
|
1756
1777
|
),
|
|
1757
|
-
/* @__PURE__ */
|
|
1778
|
+
/* @__PURE__ */ jsx3("span", { style: { fontWeight: 500, fontSize: "14px" }, children: fileName })
|
|
1758
1779
|
]
|
|
1759
1780
|
}
|
|
1760
1781
|
),
|
|
1761
1782
|
/* @__PURE__ */ jsxs3("div", { style: { display: "flex", alignItems: "center", gap: "4px" }, children: [
|
|
1762
|
-
/* @__PURE__ */
|
|
1783
|
+
/* @__PURE__ */ jsx3(
|
|
1763
1784
|
"button",
|
|
1764
1785
|
{
|
|
1765
1786
|
onClick: handleOpenNewWindow,
|
|
@@ -1794,15 +1815,15 @@ var HtmlPreviewBlock = createReactBlockSpec3(
|
|
|
1794
1815
|
strokeLinecap: "round",
|
|
1795
1816
|
strokeLinejoin: "round",
|
|
1796
1817
|
children: [
|
|
1797
|
-
/* @__PURE__ */
|
|
1798
|
-
/* @__PURE__ */
|
|
1799
|
-
/* @__PURE__ */
|
|
1818
|
+
/* @__PURE__ */ jsx3("path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" }),
|
|
1819
|
+
/* @__PURE__ */ jsx3("polyline", { points: "15 3 21 3 21 9" }),
|
|
1820
|
+
/* @__PURE__ */ jsx3("line", { x1: "10", y1: "14", x2: "21", y2: "3" })
|
|
1800
1821
|
]
|
|
1801
1822
|
}
|
|
1802
1823
|
)
|
|
1803
1824
|
}
|
|
1804
1825
|
),
|
|
1805
|
-
/* @__PURE__ */
|
|
1826
|
+
/* @__PURE__ */ jsx3(
|
|
1806
1827
|
"button",
|
|
1807
1828
|
{
|
|
1808
1829
|
onClick: handleExport,
|
|
@@ -1837,9 +1858,9 @@ var HtmlPreviewBlock = createReactBlockSpec3(
|
|
|
1837
1858
|
strokeLinecap: "round",
|
|
1838
1859
|
strokeLinejoin: "round",
|
|
1839
1860
|
children: [
|
|
1840
|
-
/* @__PURE__ */
|
|
1841
|
-
/* @__PURE__ */
|
|
1842
|
-
/* @__PURE__ */
|
|
1861
|
+
/* @__PURE__ */ jsx3("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
|
|
1862
|
+
/* @__PURE__ */ jsx3("polyline", { points: "7 10 12 15 17 10" }),
|
|
1863
|
+
/* @__PURE__ */ jsx3("line", { x1: "12", y1: "15", x2: "12", y2: "3" })
|
|
1843
1864
|
]
|
|
1844
1865
|
}
|
|
1845
1866
|
)
|
|
@@ -1858,7 +1879,7 @@ var HtmlPreviewBlock = createReactBlockSpec3(
|
|
|
1858
1879
|
position: "relative"
|
|
1859
1880
|
},
|
|
1860
1881
|
children: [
|
|
1861
|
-
/* @__PURE__ */
|
|
1882
|
+
/* @__PURE__ */ jsx3(
|
|
1862
1883
|
"iframe",
|
|
1863
1884
|
{
|
|
1864
1885
|
src: blobUrl || "about:blank",
|
|
@@ -1875,7 +1896,7 @@ var HtmlPreviewBlock = createReactBlockSpec3(
|
|
|
1875
1896
|
loading: "lazy"
|
|
1876
1897
|
}
|
|
1877
1898
|
),
|
|
1878
|
-
/* @__PURE__ */
|
|
1899
|
+
/* @__PURE__ */ jsx3(
|
|
1879
1900
|
"div",
|
|
1880
1901
|
{
|
|
1881
1902
|
onMouseDown: handleResizeStart,
|
|
@@ -1900,7 +1921,7 @@ var HtmlPreviewBlock = createReactBlockSpec3(
|
|
|
1900
1921
|
e.currentTarget.style.backgroundColor = "transparent";
|
|
1901
1922
|
}
|
|
1902
1923
|
},
|
|
1903
|
-
children: /* @__PURE__ */
|
|
1924
|
+
children: /* @__PURE__ */ jsx3(
|
|
1904
1925
|
"div",
|
|
1905
1926
|
{
|
|
1906
1927
|
style: {
|
|
@@ -1949,57 +1970,57 @@ var schema = BlockNoteSchema.create({
|
|
|
1949
1970
|
import { useState as useState8, useEffect as useEffect8, useRef as useRef9 } from "react";
|
|
1950
1971
|
|
|
1951
1972
|
// src/components/FloatingMenu/Icons.tsx
|
|
1952
|
-
import { jsx as
|
|
1973
|
+
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1953
1974
|
var Icons = {
|
|
1954
|
-
undo: /* @__PURE__ */
|
|
1955
|
-
redo: /* @__PURE__ */
|
|
1956
|
-
bold: /* @__PURE__ */
|
|
1957
|
-
italic: /* @__PURE__ */
|
|
1958
|
-
underline: /* @__PURE__ */
|
|
1959
|
-
strikethrough: /* @__PURE__ */
|
|
1960
|
-
alignLeft: /* @__PURE__ */
|
|
1961
|
-
alignCenter: /* @__PURE__ */
|
|
1962
|
-
alignRight: /* @__PURE__ */
|
|
1963
|
-
bulletList: /* @__PURE__ */
|
|
1964
|
-
numberedList: /* @__PURE__ */
|
|
1965
|
-
image: /* @__PURE__ */
|
|
1966
|
-
expandMore: /* @__PURE__ */
|
|
1967
|
-
textColor: /* @__PURE__ */
|
|
1975
|
+
undo: /* @__PURE__ */ jsx4("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "20", height: "20", children: /* @__PURE__ */ jsx4("path", { d: "M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z" }) }),
|
|
1976
|
+
redo: /* @__PURE__ */ jsx4("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "20", height: "20", children: /* @__PURE__ */ jsx4("path", { d: "M18.4 10.6C16.55 8.99 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16c1.05-3.19 4.05-5.5 7.6-5.5 1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z" }) }),
|
|
1977
|
+
bold: /* @__PURE__ */ jsx4("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "20", height: "20", children: /* @__PURE__ */ jsx4("path", { d: "M15.6 10.79c.97-.67 1.65-1.77 1.65-2.79 0-2.26-1.75-4-4-4H7v14h7.04c2.09 0 3.71-1.7 3.71-3.79 0-1.52-.86-2.82-2.15-3.42zM10 6.5h3c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5h-3v-3zm3.5 9H10v-3h3.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5z" }) }),
|
|
1978
|
+
italic: /* @__PURE__ */ jsx4("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "20", height: "20", children: /* @__PURE__ */ jsx4("path", { d: "M10 4v3h2.21l-3.42 8H6v3h8v-3h-2.21l3.42-8H18V4z" }) }),
|
|
1979
|
+
underline: /* @__PURE__ */ jsx4("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "20", height: "20", children: /* @__PURE__ */ jsx4("path", { d: "M12 17c3.31 0 6-2.69 6-6V3h-2.5v8c0 1.93-1.57 3.5-3.5 3.5S8.5 12.93 8.5 11V3H6v8c0 3.31 2.69 6 6 6zm-7 2v2h14v-2H5z" }) }),
|
|
1980
|
+
strikethrough: /* @__PURE__ */ jsx4("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "20", height: "20", children: /* @__PURE__ */ jsx4("path", { d: "M10 19h4v-3h-4v3zM5 4v3h5v3h4V7h5V4H5zM3 14h18v-2H3v2z" }) }),
|
|
1981
|
+
alignLeft: /* @__PURE__ */ jsx4("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "20", height: "20", children: /* @__PURE__ */ jsx4("path", { d: "M15 15H3v2h12v-2zm0-8H3v2h12V7zM3 13h18v-2H3v2zm0 8h18v-2H3v2zM3 3v2h18V3H3z" }) }),
|
|
1982
|
+
alignCenter: /* @__PURE__ */ jsx4("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "20", height: "20", children: /* @__PURE__ */ jsx4("path", { d: "M7 15v2h10v-2H7zm-4 6h18v-2H3v2zm0-8h18v-2H3v2zm4-6v2h10V7H7zM3 3v2h18V3H3z" }) }),
|
|
1983
|
+
alignRight: /* @__PURE__ */ jsx4("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "20", height: "20", children: /* @__PURE__ */ jsx4("path", { d: "M3 21h18v-2H3v2zm6-4h12v-2H9v2zm-6-4h18v-2H3v2zm6-4h12V7H9v2zM3 3v2h18V3H3z" }) }),
|
|
1984
|
+
bulletList: /* @__PURE__ */ jsx4("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "20", height: "20", children: /* @__PURE__ */ jsx4("path", { d: "M4 10.5c-.83 0-1.5.67-1.5 1.5s.67 1.5 1.5 1.5 1.5-.67 1.5-1.5-.67-1.5-1.5-1.5zm0-6c-.83 0-1.5.67-1.5 1.5S3.17 7.5 4 7.5 5.5 6.83 5.5 6 4.83 4.5 4 4.5zm0 12c-.83 0-1.5.68-1.5 1.5s.68 1.5 1.5 1.5 1.5-.68 1.5-1.5-.67-1.5-1.5-1.5zM7 19h14v-2H7v2zm0-6h14v-2H7v2zm0-8v2h14V5H7z" }) }),
|
|
1985
|
+
numberedList: /* @__PURE__ */ jsx4("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "20", height: "20", children: /* @__PURE__ */ jsx4("path", { d: "M2 17h2v.5H3v1h1v.5H2v1h3v-4H2v1zm1-9h1V4H2v1h1v3zm-1 3h1.8L2 13.1v.9h3v-1H3.2L5 10.9V10H2v1zm5-6v2h14V5H7zm0 14h14v-2H7v2zm0-6h14v-2H7v2z" }) }),
|
|
1986
|
+
image: /* @__PURE__ */ jsx4("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "20", height: "20", children: /* @__PURE__ */ jsx4("path", { d: "M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z" }) }),
|
|
1987
|
+
expandMore: /* @__PURE__ */ jsx4("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "18", height: "18", children: /* @__PURE__ */ jsx4("path", { d: "M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z" }) }),
|
|
1988
|
+
textColor: /* @__PURE__ */ jsx4("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "20", height: "20", children: /* @__PURE__ */ jsx4("path", { d: "M11 3L5.5 17h2.25l1.12-3h6.25l1.12 3h2.25L13 3h-2zm-1.38 9L12 5.67 14.38 12H9.62z" }) }),
|
|
1968
1989
|
bgColor: /* @__PURE__ */ jsxs4("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "20", height: "20", children: [
|
|
1969
|
-
/* @__PURE__ */
|
|
1970
|
-
/* @__PURE__ */
|
|
1990
|
+
/* @__PURE__ */ jsx4("path", { d: "M16.56 8.94L7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.59-.59 1.54 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.58.59-1.53 0-2.12zM5.21 10L10 5.21 14.79 10H5.21zM19 11.5s-2 2.17-2 3.5c0 1.1.9 2 2 2s2-.9 2-2c0-1.33-2-3.5-2-3.5z" }),
|
|
1991
|
+
/* @__PURE__ */ jsx4("path", { fillOpacity: ".36", d: "M0 20h24v4H0z" })
|
|
1971
1992
|
] }),
|
|
1972
|
-
link: /* @__PURE__ */
|
|
1973
|
-
chevronRight: /* @__PURE__ */
|
|
1974
|
-
chevronLeft: /* @__PURE__ */
|
|
1975
|
-
table: /* @__PURE__ */
|
|
1976
|
-
htmlFile: /* @__PURE__ */
|
|
1993
|
+
link: /* @__PURE__ */ jsx4("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "20", height: "20", children: /* @__PURE__ */ jsx4("path", { d: "M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z" }) }),
|
|
1994
|
+
chevronRight: /* @__PURE__ */ jsx4("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "20", height: "20", children: /* @__PURE__ */ jsx4("path", { d: "M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z" }) }),
|
|
1995
|
+
chevronLeft: /* @__PURE__ */ jsx4("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "20", height: "20", children: /* @__PURE__ */ jsx4("path", { d: "M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z" }) }),
|
|
1996
|
+
table: /* @__PURE__ */ jsx4("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "20", height: "20", children: /* @__PURE__ */ jsx4("path", { d: "M20 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h15c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM10 17H5v-2h5v2zm0-4H5v-2h5v2zm0-4H5V7h5v2zm9 8h-7v-2h7v2zm0-4h-7v-2h7v2zm0-4h-7V7h7v2z" }) }),
|
|
1997
|
+
htmlFile: /* @__PURE__ */ jsx4("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "20", height: "20", children: /* @__PURE__ */ jsx4("path", { d: "M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zm-1 2v5h5l-5-5zm-4 14H7v-1h2v1zm0-2H7v-1h2v1zm-2-2h2v1H7v-1zm4 4h-2v-1h2v1zm0-2h-2v-1h2v1zm0-2h-2v-1h2v1zm6 4h-4v-1h4v1zm0-2h-4v-1h4v1zm0-2h-4v-1h4v1z" }) })
|
|
1977
1998
|
};
|
|
1978
1999
|
var BlockTypeIcons = {
|
|
1979
|
-
paragraph: /* @__PURE__ */
|
|
1980
|
-
h1: /* @__PURE__ */
|
|
1981
|
-
h2: /* @__PURE__ */
|
|
1982
|
-
h3: /* @__PURE__ */
|
|
1983
|
-
h4: /* @__PURE__ */
|
|
1984
|
-
h5: /* @__PURE__ */
|
|
1985
|
-
h6: /* @__PURE__ */
|
|
2000
|
+
paragraph: /* @__PURE__ */ jsx4("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "20", height: "20", children: /* @__PURE__ */ jsx4("path", { d: "M5 5h14v2H5zM5 11h14v2H5zM5 17h10v2H5z" }) }),
|
|
2001
|
+
h1: /* @__PURE__ */ jsx4("span", { className: "lumir-block-icon-text", children: "H1" }),
|
|
2002
|
+
h2: /* @__PURE__ */ jsx4("span", { className: "lumir-block-icon-text", children: "H2" }),
|
|
2003
|
+
h3: /* @__PURE__ */ jsx4("span", { className: "lumir-block-icon-text", children: "H3" }),
|
|
2004
|
+
h4: /* @__PURE__ */ jsx4("span", { className: "lumir-block-icon-text", children: "H4" }),
|
|
2005
|
+
h5: /* @__PURE__ */ jsx4("span", { className: "lumir-block-icon-text", children: "H5" }),
|
|
2006
|
+
h6: /* @__PURE__ */ jsx4("span", { className: "lumir-block-icon-text", children: "H6" }),
|
|
1986
2007
|
toggleH1: /* @__PURE__ */ jsxs4("span", { className: "lumir-block-icon-toggle", children: [
|
|
1987
|
-
/* @__PURE__ */
|
|
1988
|
-
/* @__PURE__ */
|
|
2008
|
+
/* @__PURE__ */ jsx4("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "8", height: "8", children: /* @__PURE__ */ jsx4("path", { d: "M8 5v14l11-7z" }) }),
|
|
2009
|
+
/* @__PURE__ */ jsx4("span", { children: "H1" })
|
|
1989
2010
|
] }),
|
|
1990
2011
|
toggleH2: /* @__PURE__ */ jsxs4("span", { className: "lumir-block-icon-toggle", children: [
|
|
1991
|
-
/* @__PURE__ */
|
|
1992
|
-
/* @__PURE__ */
|
|
2012
|
+
/* @__PURE__ */ jsx4("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "8", height: "8", children: /* @__PURE__ */ jsx4("path", { d: "M8 5v14l11-7z" }) }),
|
|
2013
|
+
/* @__PURE__ */ jsx4("span", { children: "H2" })
|
|
1993
2014
|
] }),
|
|
1994
2015
|
toggleH3: /* @__PURE__ */ jsxs4("span", { className: "lumir-block-icon-toggle", children: [
|
|
1995
|
-
/* @__PURE__ */
|
|
1996
|
-
/* @__PURE__ */
|
|
2016
|
+
/* @__PURE__ */ jsx4("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "8", height: "8", children: /* @__PURE__ */ jsx4("path", { d: "M8 5v14l11-7z" }) }),
|
|
2017
|
+
/* @__PURE__ */ jsx4("span", { children: "H3" })
|
|
1997
2018
|
] }),
|
|
1998
|
-
quote: /* @__PURE__ */
|
|
1999
|
-
codeBlock: /* @__PURE__ */
|
|
2019
|
+
quote: /* @__PURE__ */ jsx4("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "20", height: "20", children: /* @__PURE__ */ jsx4("path", { d: "M6 17h3l2-4V7H5v6h3zm8 0h3l2-4V7h-6v6h3z" }) }),
|
|
2020
|
+
codeBlock: /* @__PURE__ */ jsx4("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "20", height: "20", children: /* @__PURE__ */ jsx4("path", { d: "M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0l4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z" }) }),
|
|
2000
2021
|
toggleList: /* @__PURE__ */ jsxs4("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "20", height: "20", children: [
|
|
2001
|
-
/* @__PURE__ */
|
|
2002
|
-
/* @__PURE__ */
|
|
2022
|
+
/* @__PURE__ */ jsx4("path", { d: "M10 6h10v2H10zM10 11h10v2H10zM10 16h10v2H10z" }),
|
|
2023
|
+
/* @__PURE__ */ jsx4(
|
|
2003
2024
|
"path",
|
|
2004
2025
|
{
|
|
2005
2026
|
d: "M4 8l4 4-4 4",
|
|
@@ -2012,14 +2033,14 @@ var BlockTypeIcons = {
|
|
|
2012
2033
|
)
|
|
2013
2034
|
] }),
|
|
2014
2035
|
bulletList: /* @__PURE__ */ jsxs4("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "20", height: "20", children: [
|
|
2015
|
-
/* @__PURE__ */
|
|
2016
|
-
/* @__PURE__ */
|
|
2017
|
-
/* @__PURE__ */
|
|
2018
|
-
/* @__PURE__ */
|
|
2036
|
+
/* @__PURE__ */ jsx4("circle", { cx: "4", cy: "6", r: "1.5" }),
|
|
2037
|
+
/* @__PURE__ */ jsx4("circle", { cx: "4", cy: "12", r: "1.5" }),
|
|
2038
|
+
/* @__PURE__ */ jsx4("circle", { cx: "4", cy: "18", r: "1.5" }),
|
|
2039
|
+
/* @__PURE__ */ jsx4("path", { d: "M8 5h12v2H8zM8 11h12v2H8zM8 17h12v2H8z" })
|
|
2019
2040
|
] }),
|
|
2020
|
-
numberedList: /* @__PURE__ */
|
|
2041
|
+
numberedList: /* @__PURE__ */ jsx4("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "20", height: "20", children: /* @__PURE__ */ jsx4("path", { d: "M2 17h2v.5H3v1h1v.5H2v1h3v-4H2v1zm1-9h1V4H2v1h1v3zm-1 3h1.8L2 13.1v.9h3v-1H3.2L5 10.9V10H2v1zm5-6v2h14V5H7zm0 14h14v-2H7v2zm0-6h14v-2H7v2z" }) }),
|
|
2021
2042
|
checkList: /* @__PURE__ */ jsxs4("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "20", height: "20", children: [
|
|
2022
|
-
/* @__PURE__ */
|
|
2043
|
+
/* @__PURE__ */ jsx4(
|
|
2023
2044
|
"rect",
|
|
2024
2045
|
{
|
|
2025
2046
|
x: "3",
|
|
@@ -2032,7 +2053,7 @@ var BlockTypeIcons = {
|
|
|
2032
2053
|
strokeWidth: "1.5"
|
|
2033
2054
|
}
|
|
2034
2055
|
),
|
|
2035
|
-
/* @__PURE__ */
|
|
2056
|
+
/* @__PURE__ */ jsx4(
|
|
2036
2057
|
"path",
|
|
2037
2058
|
{
|
|
2038
2059
|
d: "M4.5 7l1.5 1.5 3-3",
|
|
@@ -2043,8 +2064,8 @@ var BlockTypeIcons = {
|
|
|
2043
2064
|
strokeLinejoin: "round"
|
|
2044
2065
|
}
|
|
2045
2066
|
),
|
|
2046
|
-
/* @__PURE__ */
|
|
2047
|
-
/* @__PURE__ */
|
|
2067
|
+
/* @__PURE__ */ jsx4("path", { d: "M12 6h8v2h-8z" }),
|
|
2068
|
+
/* @__PURE__ */ jsx4(
|
|
2048
2069
|
"rect",
|
|
2049
2070
|
{
|
|
2050
2071
|
x: "3",
|
|
@@ -2057,17 +2078,17 @@ var BlockTypeIcons = {
|
|
|
2057
2078
|
strokeWidth: "1.5"
|
|
2058
2079
|
}
|
|
2059
2080
|
),
|
|
2060
|
-
/* @__PURE__ */
|
|
2081
|
+
/* @__PURE__ */ jsx4("path", { d: "M12 16h8v2h-8z" })
|
|
2061
2082
|
] })
|
|
2062
2083
|
};
|
|
2063
2084
|
|
|
2064
2085
|
// src/components/FloatingMenu/components/ToolbarDivider.tsx
|
|
2065
|
-
import { jsx as
|
|
2066
|
-
var ToolbarDivider = () => /* @__PURE__ */
|
|
2086
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
2087
|
+
var ToolbarDivider = () => /* @__PURE__ */ jsx5("div", { className: "lumir-toolbar-divider" });
|
|
2067
2088
|
|
|
2068
2089
|
// src/components/FloatingMenu/components/UndoRedoButtons.tsx
|
|
2069
2090
|
import { useCallback as useCallback4 } from "react";
|
|
2070
|
-
import { jsx as
|
|
2091
|
+
import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
2071
2092
|
var UndoRedoButtons = ({ editor }) => {
|
|
2072
2093
|
const handleUndo = useCallback4(() => {
|
|
2073
2094
|
try {
|
|
@@ -2087,7 +2108,7 @@ var UndoRedoButtons = ({ editor }) => {
|
|
|
2087
2108
|
e.preventDefault();
|
|
2088
2109
|
}, []);
|
|
2089
2110
|
return /* @__PURE__ */ jsxs5("div", { className: "lumir-toolbar-group", children: [
|
|
2090
|
-
/* @__PURE__ */
|
|
2111
|
+
/* @__PURE__ */ jsx6(
|
|
2091
2112
|
"button",
|
|
2092
2113
|
{
|
|
2093
2114
|
className: "lumir-toolbar-btn",
|
|
@@ -2098,7 +2119,7 @@ var UndoRedoButtons = ({ editor }) => {
|
|
|
2098
2119
|
children: Icons.undo
|
|
2099
2120
|
}
|
|
2100
2121
|
),
|
|
2101
|
-
/* @__PURE__ */
|
|
2122
|
+
/* @__PURE__ */ jsx6(
|
|
2102
2123
|
"button",
|
|
2103
2124
|
{
|
|
2104
2125
|
className: "lumir-toolbar-btn",
|
|
@@ -2114,7 +2135,7 @@ var UndoRedoButtons = ({ editor }) => {
|
|
|
2114
2135
|
|
|
2115
2136
|
// src/components/FloatingMenu/components/TextStyleButton.tsx
|
|
2116
2137
|
import { useCallback as useCallback5 } from "react";
|
|
2117
|
-
import { jsx as
|
|
2138
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
2118
2139
|
var iconMap = {
|
|
2119
2140
|
bold: Icons.bold,
|
|
2120
2141
|
italic: Icons.italic,
|
|
@@ -2150,7 +2171,7 @@ var TextStyleButton = ({
|
|
|
2150
2171
|
const handleMouseDown2 = useCallback5((e) => {
|
|
2151
2172
|
e.preventDefault();
|
|
2152
2173
|
}, []);
|
|
2153
|
-
return /* @__PURE__ */
|
|
2174
|
+
return /* @__PURE__ */ jsx7(
|
|
2154
2175
|
"button",
|
|
2155
2176
|
{
|
|
2156
2177
|
className: cn("lumir-toolbar-btn", isActive && "is-active"),
|
|
@@ -2260,7 +2281,7 @@ function getTableAlignment(editor, blockId) {
|
|
|
2260
2281
|
}
|
|
2261
2282
|
|
|
2262
2283
|
// src/components/FloatingMenu/components/AlignButton.tsx
|
|
2263
|
-
import { jsx as
|
|
2284
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
2264
2285
|
var iconMap2 = {
|
|
2265
2286
|
left: Icons.alignLeft,
|
|
2266
2287
|
center: Icons.alignCenter,
|
|
@@ -2303,7 +2324,7 @@ var AlignButton = ({
|
|
|
2303
2324
|
const handleMouseDown2 = useCallback6((e) => {
|
|
2304
2325
|
e.preventDefault();
|
|
2305
2326
|
}, []);
|
|
2306
|
-
return /* @__PURE__ */
|
|
2327
|
+
return /* @__PURE__ */ jsx8(
|
|
2307
2328
|
"button",
|
|
2308
2329
|
{
|
|
2309
2330
|
className: cn("lumir-toolbar-btn", isActive && "is-active"),
|
|
@@ -2318,7 +2339,7 @@ var AlignButton = ({
|
|
|
2318
2339
|
|
|
2319
2340
|
// src/components/FloatingMenu/components/ListButton.tsx
|
|
2320
2341
|
import { useCallback as useCallback7 } from "react";
|
|
2321
|
-
import { jsx as
|
|
2342
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
2322
2343
|
var iconMap3 = {
|
|
2323
2344
|
bullet: Icons.bulletList,
|
|
2324
2345
|
numbered: Icons.numberedList
|
|
@@ -2353,7 +2374,7 @@ var ListButton = ({ editor, type }) => {
|
|
|
2353
2374
|
const handleMouseDown2 = useCallback7((e) => {
|
|
2354
2375
|
e.preventDefault();
|
|
2355
2376
|
}, []);
|
|
2356
|
-
return /* @__PURE__ */
|
|
2377
|
+
return /* @__PURE__ */ jsx9(
|
|
2357
2378
|
"button",
|
|
2358
2379
|
{
|
|
2359
2380
|
className: cn("lumir-toolbar-btn", isActive && "is-active"),
|
|
@@ -2368,7 +2389,7 @@ var ListButton = ({ editor, type }) => {
|
|
|
2368
2389
|
|
|
2369
2390
|
// src/components/FloatingMenu/components/ImageButton.tsx
|
|
2370
2391
|
import { useCallback as useCallback8 } from "react";
|
|
2371
|
-
import { jsx as
|
|
2392
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
2372
2393
|
var ImageButton = ({
|
|
2373
2394
|
editor,
|
|
2374
2395
|
onImageUpload
|
|
@@ -2401,7 +2422,7 @@ var ImageButton = ({
|
|
|
2401
2422
|
const handleMouseDown2 = useCallback8((e) => {
|
|
2402
2423
|
e.preventDefault();
|
|
2403
2424
|
}, []);
|
|
2404
|
-
return /* @__PURE__ */
|
|
2425
|
+
return /* @__PURE__ */ jsx10(
|
|
2405
2426
|
"button",
|
|
2406
2427
|
{
|
|
2407
2428
|
className: "lumir-toolbar-btn",
|
|
@@ -2449,7 +2470,7 @@ var getHexFromColorValue = (value, type) => {
|
|
|
2449
2470
|
};
|
|
2450
2471
|
|
|
2451
2472
|
// src/components/FloatingMenu/components/ColorButton.tsx
|
|
2452
|
-
import { jsx as
|
|
2473
|
+
import { jsx as jsx11, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
2453
2474
|
var ColorButton = ({ editor, type }) => {
|
|
2454
2475
|
const [isOpen, setIsOpen] = useState4(false);
|
|
2455
2476
|
const [currentColor, setCurrentColor] = useState4("default");
|
|
@@ -2519,7 +2540,7 @@ var ColorButton = ({ editor, type }) => {
|
|
|
2519
2540
|
type: "button",
|
|
2520
2541
|
children: [
|
|
2521
2542
|
type === "text" ? Icons.textColor : Icons.bgColor,
|
|
2522
|
-
/* @__PURE__ */
|
|
2543
|
+
/* @__PURE__ */ jsx11(
|
|
2523
2544
|
"span",
|
|
2524
2545
|
{
|
|
2525
2546
|
className: "lumir-color-indicator",
|
|
@@ -2531,7 +2552,7 @@ var ColorButton = ({ editor, type }) => {
|
|
|
2531
2552
|
]
|
|
2532
2553
|
}
|
|
2533
2554
|
),
|
|
2534
|
-
isOpen && /* @__PURE__ */
|
|
2555
|
+
isOpen && /* @__PURE__ */ jsx11("div", { className: "lumir-dropdown-menu lumir-color-menu", children: /* @__PURE__ */ jsx11("div", { className: "lumir-color-grid", children: colors.map((color) => /* @__PURE__ */ jsx11(
|
|
2535
2556
|
"button",
|
|
2536
2557
|
{
|
|
2537
2558
|
className: cn(
|
|
@@ -2551,7 +2572,7 @@ var ColorButton = ({ editor, type }) => {
|
|
|
2551
2572
|
|
|
2552
2573
|
// src/components/FloatingMenu/components/FontSizeButton.tsx
|
|
2553
2574
|
import { useState as useState5, useEffect as useEffect5, useRef as useRef5, useCallback as useCallback10 } from "react";
|
|
2554
|
-
import { jsx as
|
|
2575
|
+
import { jsx as jsx12, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
2555
2576
|
var DEFAULT_LABEL = "\uAE30\uBCF8";
|
|
2556
2577
|
var toLabel = (size) => size.replace(/px$/, "");
|
|
2557
2578
|
var FontSizeButton = ({ editor }) => {
|
|
@@ -2565,6 +2586,11 @@ var FontSizeButton = ({ editor }) => {
|
|
|
2565
2586
|
}
|
|
2566
2587
|
};
|
|
2567
2588
|
const currentSize = getCurrentSize();
|
|
2589
|
+
const currentPx = parseFontSizePx(currentSize);
|
|
2590
|
+
const [inputValue, setInputValue] = useState5(String(currentPx));
|
|
2591
|
+
useEffect5(() => {
|
|
2592
|
+
setInputValue(String(currentPx));
|
|
2593
|
+
}, [currentPx]);
|
|
2568
2594
|
useEffect5(() => {
|
|
2569
2595
|
const handleClickOutside = (e) => {
|
|
2570
2596
|
if (dropdownRef.current && !dropdownRef.current.contains(e.target)) {
|
|
@@ -2591,6 +2617,30 @@ var FontSizeButton = ({ editor }) => {
|
|
|
2591
2617
|
},
|
|
2592
2618
|
[editor]
|
|
2593
2619
|
);
|
|
2620
|
+
const stepBy = useCallback10(
|
|
2621
|
+
(delta) => {
|
|
2622
|
+
try {
|
|
2623
|
+
editor?.addStyles?.({
|
|
2624
|
+
fontSize: toFontSizeValue(currentPx + delta)
|
|
2625
|
+
});
|
|
2626
|
+
} catch (err) {
|
|
2627
|
+
console.error("Font size step failed:", err);
|
|
2628
|
+
}
|
|
2629
|
+
},
|
|
2630
|
+
[editor, currentPx]
|
|
2631
|
+
);
|
|
2632
|
+
const applyInput = useCallback10(() => {
|
|
2633
|
+
const n = parseInt(inputValue, 10);
|
|
2634
|
+
if (Number.isFinite(n)) {
|
|
2635
|
+
try {
|
|
2636
|
+
editor?.addStyles?.({ fontSize: toFontSizeValue(n) });
|
|
2637
|
+
} catch (err) {
|
|
2638
|
+
console.error("Font size apply failed:", err);
|
|
2639
|
+
}
|
|
2640
|
+
} else {
|
|
2641
|
+
setInputValue(String(currentPx));
|
|
2642
|
+
}
|
|
2643
|
+
}, [editor, inputValue, currentPx]);
|
|
2594
2644
|
const handleMouseDown2 = useCallback10((e) => {
|
|
2595
2645
|
e.preventDefault();
|
|
2596
2646
|
}, []);
|
|
@@ -2604,13 +2654,64 @@ var FontSizeButton = ({ editor }) => {
|
|
|
2604
2654
|
title: "\uAE00\uC790 \uD06C\uAE30",
|
|
2605
2655
|
type: "button",
|
|
2606
2656
|
children: [
|
|
2607
|
-
/* @__PURE__ */
|
|
2657
|
+
/* @__PURE__ */ jsx12("span", { className: "lumir-font-size-label", children: currentSize ? toLabel(currentSize) : DEFAULT_LABEL }),
|
|
2608
2658
|
Icons.expandMore
|
|
2609
2659
|
]
|
|
2610
2660
|
}
|
|
2611
2661
|
),
|
|
2612
2662
|
isOpen && /* @__PURE__ */ jsxs7("div", { className: "lumir-dropdown-menu lumir-font-size-menu", children: [
|
|
2613
|
-
/* @__PURE__ */
|
|
2663
|
+
/* @__PURE__ */ jsxs7("div", { className: "lumir-fs-stepper", children: [
|
|
2664
|
+
/* @__PURE__ */ jsx12(
|
|
2665
|
+
"button",
|
|
2666
|
+
{
|
|
2667
|
+
type: "button",
|
|
2668
|
+
className: "lumir-fs-stepper-btn",
|
|
2669
|
+
"aria-label": "\uAE00\uC790 \uD06C\uAE30 1px \uC904\uC774\uAE30",
|
|
2670
|
+
disabled: currentPx <= FONT_SIZE_MIN,
|
|
2671
|
+
onMouseDown: handleMouseDown2,
|
|
2672
|
+
onClick: () => stepBy(-1),
|
|
2673
|
+
children: "\u2212"
|
|
2674
|
+
}
|
|
2675
|
+
),
|
|
2676
|
+
/* @__PURE__ */ jsx12(
|
|
2677
|
+
"input",
|
|
2678
|
+
{
|
|
2679
|
+
className: "lumir-fs-stepper-input",
|
|
2680
|
+
type: "text",
|
|
2681
|
+
inputMode: "numeric",
|
|
2682
|
+
"aria-label": "\uAE00\uC790 \uD06C\uAE30 \uC785\uB825",
|
|
2683
|
+
value: inputValue,
|
|
2684
|
+
onChange: (e) => setInputValue(e.target.value.replace(/[^0-9]/g, "")),
|
|
2685
|
+
onKeyDown: (e) => {
|
|
2686
|
+
e.stopPropagation();
|
|
2687
|
+
if (e.key === "Enter") {
|
|
2688
|
+
e.preventDefault();
|
|
2689
|
+
applyInput();
|
|
2690
|
+
} else if (e.key === "ArrowUp") {
|
|
2691
|
+
e.preventDefault();
|
|
2692
|
+
stepBy(1);
|
|
2693
|
+
} else if (e.key === "ArrowDown") {
|
|
2694
|
+
e.preventDefault();
|
|
2695
|
+
stepBy(-1);
|
|
2696
|
+
}
|
|
2697
|
+
},
|
|
2698
|
+
onBlur: applyInput
|
|
2699
|
+
}
|
|
2700
|
+
),
|
|
2701
|
+
/* @__PURE__ */ jsx12(
|
|
2702
|
+
"button",
|
|
2703
|
+
{
|
|
2704
|
+
type: "button",
|
|
2705
|
+
className: "lumir-fs-stepper-btn",
|
|
2706
|
+
"aria-label": "\uAE00\uC790 \uD06C\uAE30 1px \uB298\uB9AC\uAE30",
|
|
2707
|
+
disabled: currentPx >= FONT_SIZE_MAX,
|
|
2708
|
+
onMouseDown: handleMouseDown2,
|
|
2709
|
+
onClick: () => stepBy(1),
|
|
2710
|
+
children: "+"
|
|
2711
|
+
}
|
|
2712
|
+
)
|
|
2713
|
+
] }),
|
|
2714
|
+
/* @__PURE__ */ jsx12(
|
|
2614
2715
|
"button",
|
|
2615
2716
|
{
|
|
2616
2717
|
className: cn(
|
|
@@ -2623,7 +2724,7 @@ var FontSizeButton = ({ editor }) => {
|
|
|
2623
2724
|
children: DEFAULT_LABEL
|
|
2624
2725
|
}
|
|
2625
2726
|
),
|
|
2626
|
-
FONT_SIZE_PRESETS.map((size) => /* @__PURE__ */
|
|
2727
|
+
FONT_SIZE_PRESETS.map((size) => /* @__PURE__ */ jsx12(
|
|
2627
2728
|
"button",
|
|
2628
2729
|
{
|
|
2629
2730
|
className: cn(
|
|
@@ -2643,7 +2744,7 @@ var FontSizeButton = ({ editor }) => {
|
|
|
2643
2744
|
|
|
2644
2745
|
// src/components/FloatingMenu/components/LinkButton.tsx
|
|
2645
2746
|
import { useState as useState6, useEffect as useEffect6, useRef as useRef6, useCallback as useCallback11 } from "react";
|
|
2646
|
-
import { jsx as
|
|
2747
|
+
import { jsx as jsx13, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
2647
2748
|
var isDangerousProtocol = (url) => {
|
|
2648
2749
|
const trimmedUrl = url.trim().toLowerCase();
|
|
2649
2750
|
const dangerousPatterns = [
|
|
@@ -2743,7 +2844,7 @@ var LinkButton = ({ editor }) => {
|
|
|
2743
2844
|
[handleSubmit, handleCancel]
|
|
2744
2845
|
);
|
|
2745
2846
|
return /* @__PURE__ */ jsxs8("div", { className: "lumir-dropdown-wrapper", ref: dropdownRef, children: [
|
|
2746
|
-
/* @__PURE__ */
|
|
2847
|
+
/* @__PURE__ */ jsx13(
|
|
2747
2848
|
"button",
|
|
2748
2849
|
{
|
|
2749
2850
|
className: "lumir-toolbar-btn",
|
|
@@ -2754,8 +2855,8 @@ var LinkButton = ({ editor }) => {
|
|
|
2754
2855
|
children: Icons.link
|
|
2755
2856
|
}
|
|
2756
2857
|
),
|
|
2757
|
-
isOpen && /* @__PURE__ */
|
|
2758
|
-
/* @__PURE__ */
|
|
2858
|
+
isOpen && /* @__PURE__ */ jsx13("div", { className: "lumir-dropdown-menu lumir-link-menu", children: /* @__PURE__ */ jsxs8("form", { onSubmit: handleSubmit, className: "lumir-link-form", children: [
|
|
2859
|
+
/* @__PURE__ */ jsx13(
|
|
2759
2860
|
"input",
|
|
2760
2861
|
{
|
|
2761
2862
|
ref: inputRef,
|
|
@@ -2771,7 +2872,7 @@ var LinkButton = ({ editor }) => {
|
|
|
2771
2872
|
onMouseDown: handleMouseDown2
|
|
2772
2873
|
}
|
|
2773
2874
|
),
|
|
2774
|
-
errorMsg && /* @__PURE__ */
|
|
2875
|
+
errorMsg && /* @__PURE__ */ jsx13(
|
|
2775
2876
|
"div",
|
|
2776
2877
|
{
|
|
2777
2878
|
style: {
|
|
@@ -2784,7 +2885,7 @@ var LinkButton = ({ editor }) => {
|
|
|
2784
2885
|
}
|
|
2785
2886
|
),
|
|
2786
2887
|
/* @__PURE__ */ jsxs8("div", { className: "lumir-link-actions", children: [
|
|
2787
|
-
/* @__PURE__ */
|
|
2888
|
+
/* @__PURE__ */ jsx13(
|
|
2788
2889
|
"button",
|
|
2789
2890
|
{
|
|
2790
2891
|
type: "button",
|
|
@@ -2794,7 +2895,7 @@ var LinkButton = ({ editor }) => {
|
|
|
2794
2895
|
children: "\uCDE8\uC18C"
|
|
2795
2896
|
}
|
|
2796
2897
|
),
|
|
2797
|
-
/* @__PURE__ */
|
|
2898
|
+
/* @__PURE__ */ jsx13(
|
|
2798
2899
|
"button",
|
|
2799
2900
|
{
|
|
2800
2901
|
type: "submit",
|
|
@@ -2811,7 +2912,7 @@ var LinkButton = ({ editor }) => {
|
|
|
2811
2912
|
|
|
2812
2913
|
// src/components/FloatingMenu/components/TableButton.tsx
|
|
2813
2914
|
import { useCallback as useCallback12 } from "react";
|
|
2814
|
-
import { jsx as
|
|
2915
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
2815
2916
|
var TableButton = ({ editor }) => {
|
|
2816
2917
|
const handleClick = useCallback12(() => {
|
|
2817
2918
|
try {
|
|
@@ -2838,7 +2939,7 @@ var TableButton = ({ editor }) => {
|
|
|
2838
2939
|
const handleMouseDown2 = useCallback12((e) => {
|
|
2839
2940
|
e.preventDefault();
|
|
2840
2941
|
}, []);
|
|
2841
|
-
return /* @__PURE__ */
|
|
2942
|
+
return /* @__PURE__ */ jsx14(
|
|
2842
2943
|
"button",
|
|
2843
2944
|
{
|
|
2844
2945
|
className: "lumir-toolbar-btn",
|
|
@@ -2853,7 +2954,7 @@ var TableButton = ({ editor }) => {
|
|
|
2853
2954
|
|
|
2854
2955
|
// src/components/FloatingMenu/components/HTMLImportButton.tsx
|
|
2855
2956
|
import { useCallback as useCallback13, useRef as useRef7 } from "react";
|
|
2856
|
-
import { Fragment as Fragment3, jsx as
|
|
2957
|
+
import { Fragment as Fragment3, jsx as jsx15, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
2857
2958
|
var HTMLImportButton = ({
|
|
2858
2959
|
editor
|
|
2859
2960
|
}) => {
|
|
@@ -2901,7 +3002,7 @@ var HTMLImportButton = ({
|
|
|
2901
3002
|
e.preventDefault();
|
|
2902
3003
|
}, []);
|
|
2903
3004
|
return /* @__PURE__ */ jsxs9(Fragment3, { children: [
|
|
2904
|
-
/* @__PURE__ */
|
|
3005
|
+
/* @__PURE__ */ jsx15(
|
|
2905
3006
|
"input",
|
|
2906
3007
|
{
|
|
2907
3008
|
ref: fileInputRef,
|
|
@@ -2911,7 +3012,7 @@ var HTMLImportButton = ({
|
|
|
2911
3012
|
style: { display: "none" }
|
|
2912
3013
|
}
|
|
2913
3014
|
),
|
|
2914
|
-
/* @__PURE__ */
|
|
3015
|
+
/* @__PURE__ */ jsx15(
|
|
2915
3016
|
"button",
|
|
2916
3017
|
{
|
|
2917
3018
|
className: "lumir-toolbar-btn",
|
|
@@ -2927,7 +3028,7 @@ var HTMLImportButton = ({
|
|
|
2927
3028
|
|
|
2928
3029
|
// src/components/FloatingMenu/components/BlockTypeSelect.tsx
|
|
2929
3030
|
import { useState as useState7, useEffect as useEffect7, useRef as useRef8, useCallback as useCallback14 } from "react";
|
|
2930
|
-
import { jsx as
|
|
3031
|
+
import { jsx as jsx16, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
2931
3032
|
var blockTypeCategories = [
|
|
2932
3033
|
{
|
|
2933
3034
|
category: "Headings",
|
|
@@ -3039,14 +3140,14 @@ var BlockTypeSelect = ({ editor }) => {
|
|
|
3039
3140
|
onMouseDown: handleMouseDown2,
|
|
3040
3141
|
type: "button",
|
|
3041
3142
|
children: [
|
|
3042
|
-
/* @__PURE__ */
|
|
3043
|
-
/* @__PURE__ */
|
|
3143
|
+
/* @__PURE__ */ jsx16("span", { className: "lumir-block-icon", children: BlockTypeIcons[getCurrentIcon()] }),
|
|
3144
|
+
/* @__PURE__ */ jsx16("span", { className: "lumir-block-label", children: getCurrentLabel() }),
|
|
3044
3145
|
Icons.expandMore
|
|
3045
3146
|
]
|
|
3046
3147
|
}
|
|
3047
3148
|
),
|
|
3048
|
-
isOpen && /* @__PURE__ */
|
|
3049
|
-
/* @__PURE__ */
|
|
3149
|
+
isOpen && /* @__PURE__ */ jsx16("div", { className: "lumir-dropdown-menu lumir-block-menu", children: blockTypeCategories.map((category) => /* @__PURE__ */ jsxs10("div", { className: "lumir-block-category", children: [
|
|
3150
|
+
/* @__PURE__ */ jsx16("div", { className: "lumir-block-category-title", children: category.category }),
|
|
3050
3151
|
category.items.map((bt) => /* @__PURE__ */ jsxs10(
|
|
3051
3152
|
"button",
|
|
3052
3153
|
{
|
|
@@ -3057,8 +3158,8 @@ var BlockTypeSelect = ({ editor }) => {
|
|
|
3057
3158
|
onClick: () => handleTypeChange(bt.type, bt.level, bt.isToggle),
|
|
3058
3159
|
onMouseDown: handleMouseDown2,
|
|
3059
3160
|
children: [
|
|
3060
|
-
/* @__PURE__ */
|
|
3061
|
-
/* @__PURE__ */
|
|
3161
|
+
/* @__PURE__ */ jsx16("span", { className: "lumir-block-icon", children: BlockTypeIcons[bt.icon] }),
|
|
3162
|
+
/* @__PURE__ */ jsx16("span", { className: "lumir-block-item-title", children: bt.label })
|
|
3062
3163
|
]
|
|
3063
3164
|
},
|
|
3064
3165
|
bt.icon
|
|
@@ -3068,7 +3169,7 @@ var BlockTypeSelect = ({ editor }) => {
|
|
|
3068
3169
|
};
|
|
3069
3170
|
|
|
3070
3171
|
// src/components/FloatingMenu/index.tsx
|
|
3071
|
-
import { Fragment as Fragment4, jsx as
|
|
3172
|
+
import { Fragment as Fragment4, jsx as jsx17, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
3072
3173
|
var COMPACT_BREAKPOINT = 700;
|
|
3073
3174
|
var MINIMIZED_BREAKPOINT = 400;
|
|
3074
3175
|
var FloatingMenu = ({
|
|
@@ -3122,7 +3223,7 @@ var FloatingMenu = ({
|
|
|
3122
3223
|
return () => resizeObserver.disconnect();
|
|
3123
3224
|
}, []);
|
|
3124
3225
|
const MinimizedLayout = () => /* @__PURE__ */ jsxs11(Fragment4, { children: [
|
|
3125
|
-
/* @__PURE__ */
|
|
3226
|
+
/* @__PURE__ */ jsx17(
|
|
3126
3227
|
"button",
|
|
3127
3228
|
{
|
|
3128
3229
|
className: "lumir-toolbar-button lumir-toggle-button",
|
|
@@ -3134,119 +3235,119 @@ var FloatingMenu = ({
|
|
|
3134
3235
|
}
|
|
3135
3236
|
),
|
|
3136
3237
|
!isMinimized && /* @__PURE__ */ jsxs11(Fragment4, { children: [
|
|
3137
|
-
/* @__PURE__ */
|
|
3138
|
-
/* @__PURE__ */
|
|
3139
|
-
/* @__PURE__ */
|
|
3140
|
-
/* @__PURE__ */
|
|
3141
|
-
/* @__PURE__ */
|
|
3238
|
+
/* @__PURE__ */ jsx17(ToolbarDivider, {}),
|
|
3239
|
+
/* @__PURE__ */ jsx17(UndoRedoButtons, { editor }),
|
|
3240
|
+
/* @__PURE__ */ jsx17(ToolbarDivider, {}),
|
|
3241
|
+
/* @__PURE__ */ jsx17("div", { className: "lumir-toolbar-group", children: /* @__PURE__ */ jsx17(BlockTypeSelect, { editor }) }),
|
|
3242
|
+
/* @__PURE__ */ jsx17(ToolbarDivider, {}),
|
|
3142
3243
|
/* @__PURE__ */ jsxs11("div", { className: "lumir-toolbar-group", children: [
|
|
3143
|
-
/* @__PURE__ */
|
|
3144
|
-
/* @__PURE__ */
|
|
3145
|
-
/* @__PURE__ */
|
|
3146
|
-
/* @__PURE__ */
|
|
3244
|
+
/* @__PURE__ */ jsx17(TextStyleButton, { editor, style: "bold" }),
|
|
3245
|
+
/* @__PURE__ */ jsx17(TextStyleButton, { editor, style: "italic" }),
|
|
3246
|
+
/* @__PURE__ */ jsx17(TextStyleButton, { editor, style: "underline" }),
|
|
3247
|
+
/* @__PURE__ */ jsx17(TextStyleButton, { editor, style: "strike" })
|
|
3147
3248
|
] }),
|
|
3148
|
-
/* @__PURE__ */
|
|
3249
|
+
/* @__PURE__ */ jsx17(ToolbarDivider, {}),
|
|
3149
3250
|
/* @__PURE__ */ jsxs11("div", { className: "lumir-toolbar-group", children: [
|
|
3150
|
-
/* @__PURE__ */
|
|
3151
|
-
/* @__PURE__ */
|
|
3152
|
-
/* @__PURE__ */
|
|
3251
|
+
/* @__PURE__ */ jsx17(AlignButton, { editor, alignment: "left" }),
|
|
3252
|
+
/* @__PURE__ */ jsx17(AlignButton, { editor, alignment: "center" }),
|
|
3253
|
+
/* @__PURE__ */ jsx17(AlignButton, { editor, alignment: "right" })
|
|
3153
3254
|
] }),
|
|
3154
|
-
/* @__PURE__ */
|
|
3255
|
+
/* @__PURE__ */ jsx17(ToolbarDivider, {}),
|
|
3155
3256
|
/* @__PURE__ */ jsxs11("div", { className: "lumir-toolbar-group", children: [
|
|
3156
|
-
/* @__PURE__ */
|
|
3157
|
-
/* @__PURE__ */
|
|
3257
|
+
/* @__PURE__ */ jsx17(ListButton, { editor, type: "bullet" }),
|
|
3258
|
+
/* @__PURE__ */ jsx17(ListButton, { editor, type: "numbered" })
|
|
3158
3259
|
] }),
|
|
3159
|
-
/* @__PURE__ */
|
|
3260
|
+
/* @__PURE__ */ jsx17(ToolbarDivider, {}),
|
|
3160
3261
|
/* @__PURE__ */ jsxs11("div", { className: "lumir-toolbar-group", children: [
|
|
3161
|
-
/* @__PURE__ */
|
|
3162
|
-
/* @__PURE__ */
|
|
3163
|
-
/* @__PURE__ */
|
|
3262
|
+
/* @__PURE__ */ jsx17(FontSizeButton, { editor }),
|
|
3263
|
+
/* @__PURE__ */ jsx17(ColorButton, { editor, type: "text" }),
|
|
3264
|
+
/* @__PURE__ */ jsx17(ColorButton, { editor, type: "background" })
|
|
3164
3265
|
] }),
|
|
3165
|
-
/* @__PURE__ */
|
|
3266
|
+
/* @__PURE__ */ jsx17(ToolbarDivider, {}),
|
|
3166
3267
|
/* @__PURE__ */ jsxs11("div", { className: "lumir-toolbar-group", children: [
|
|
3167
|
-
/* @__PURE__ */
|
|
3168
|
-
/* @__PURE__ */
|
|
3169
|
-
/* @__PURE__ */
|
|
3170
|
-
/* @__PURE__ */
|
|
3268
|
+
/* @__PURE__ */ jsx17(ImageButton, { editor, onImageUpload }),
|
|
3269
|
+
/* @__PURE__ */ jsx17(LinkButton, { editor }),
|
|
3270
|
+
/* @__PURE__ */ jsx17(TableButton, { editor }),
|
|
3271
|
+
/* @__PURE__ */ jsx17(HTMLImportButton, { editor })
|
|
3171
3272
|
] })
|
|
3172
3273
|
] })
|
|
3173
3274
|
] });
|
|
3174
3275
|
const SingleRowLayout = () => /* @__PURE__ */ jsxs11(Fragment4, { children: [
|
|
3175
|
-
/* @__PURE__ */
|
|
3176
|
-
/* @__PURE__ */
|
|
3177
|
-
/* @__PURE__ */
|
|
3178
|
-
/* @__PURE__ */
|
|
3276
|
+
/* @__PURE__ */ jsx17(UndoRedoButtons, { editor }),
|
|
3277
|
+
/* @__PURE__ */ jsx17(ToolbarDivider, {}),
|
|
3278
|
+
/* @__PURE__ */ jsx17("div", { className: "lumir-toolbar-group", children: /* @__PURE__ */ jsx17(BlockTypeSelect, { editor }) }),
|
|
3279
|
+
/* @__PURE__ */ jsx17(ToolbarDivider, {}),
|
|
3179
3280
|
/* @__PURE__ */ jsxs11("div", { className: "lumir-toolbar-group", children: [
|
|
3180
|
-
/* @__PURE__ */
|
|
3181
|
-
/* @__PURE__ */
|
|
3182
|
-
/* @__PURE__ */
|
|
3183
|
-
/* @__PURE__ */
|
|
3281
|
+
/* @__PURE__ */ jsx17(TextStyleButton, { editor, style: "bold" }),
|
|
3282
|
+
/* @__PURE__ */ jsx17(TextStyleButton, { editor, style: "italic" }),
|
|
3283
|
+
/* @__PURE__ */ jsx17(TextStyleButton, { editor, style: "underline" }),
|
|
3284
|
+
/* @__PURE__ */ jsx17(TextStyleButton, { editor, style: "strike" })
|
|
3184
3285
|
] }),
|
|
3185
|
-
/* @__PURE__ */
|
|
3286
|
+
/* @__PURE__ */ jsx17(ToolbarDivider, {}),
|
|
3186
3287
|
/* @__PURE__ */ jsxs11("div", { className: "lumir-toolbar-group", children: [
|
|
3187
|
-
/* @__PURE__ */
|
|
3188
|
-
/* @__PURE__ */
|
|
3189
|
-
/* @__PURE__ */
|
|
3288
|
+
/* @__PURE__ */ jsx17(AlignButton, { editor, alignment: "left" }),
|
|
3289
|
+
/* @__PURE__ */ jsx17(AlignButton, { editor, alignment: "center" }),
|
|
3290
|
+
/* @__PURE__ */ jsx17(AlignButton, { editor, alignment: "right" })
|
|
3190
3291
|
] }),
|
|
3191
|
-
/* @__PURE__ */
|
|
3292
|
+
/* @__PURE__ */ jsx17(ToolbarDivider, {}),
|
|
3192
3293
|
/* @__PURE__ */ jsxs11("div", { className: "lumir-toolbar-group", children: [
|
|
3193
|
-
/* @__PURE__ */
|
|
3194
|
-
/* @__PURE__ */
|
|
3294
|
+
/* @__PURE__ */ jsx17(ListButton, { editor, type: "bullet" }),
|
|
3295
|
+
/* @__PURE__ */ jsx17(ListButton, { editor, type: "numbered" })
|
|
3195
3296
|
] }),
|
|
3196
|
-
/* @__PURE__ */
|
|
3297
|
+
/* @__PURE__ */ jsx17(ToolbarDivider, {}),
|
|
3197
3298
|
/* @__PURE__ */ jsxs11("div", { className: "lumir-toolbar-group", children: [
|
|
3198
|
-
/* @__PURE__ */
|
|
3199
|
-
/* @__PURE__ */
|
|
3200
|
-
/* @__PURE__ */
|
|
3299
|
+
/* @__PURE__ */ jsx17(FontSizeButton, { editor }),
|
|
3300
|
+
/* @__PURE__ */ jsx17(ColorButton, { editor, type: "text" }),
|
|
3301
|
+
/* @__PURE__ */ jsx17(ColorButton, { editor, type: "background" })
|
|
3201
3302
|
] }),
|
|
3202
|
-
/* @__PURE__ */
|
|
3303
|
+
/* @__PURE__ */ jsx17(ToolbarDivider, {}),
|
|
3203
3304
|
/* @__PURE__ */ jsxs11("div", { className: "lumir-toolbar-group", children: [
|
|
3204
|
-
/* @__PURE__ */
|
|
3205
|
-
/* @__PURE__ */
|
|
3206
|
-
/* @__PURE__ */
|
|
3207
|
-
/* @__PURE__ */
|
|
3305
|
+
/* @__PURE__ */ jsx17(ImageButton, { editor, onImageUpload }),
|
|
3306
|
+
/* @__PURE__ */ jsx17(LinkButton, { editor }),
|
|
3307
|
+
/* @__PURE__ */ jsx17(TableButton, { editor }),
|
|
3308
|
+
/* @__PURE__ */ jsx17(HTMLImportButton, { editor })
|
|
3208
3309
|
] })
|
|
3209
3310
|
] });
|
|
3210
3311
|
const TwoRowLayout = () => /* @__PURE__ */ jsxs11(Fragment4, { children: [
|
|
3211
3312
|
/* @__PURE__ */ jsxs11("div", { className: "lumir-toolbar-row", children: [
|
|
3212
|
-
/* @__PURE__ */
|
|
3213
|
-
/* @__PURE__ */
|
|
3313
|
+
/* @__PURE__ */ jsx17(UndoRedoButtons, { editor }),
|
|
3314
|
+
/* @__PURE__ */ jsx17(ToolbarDivider, {}),
|
|
3214
3315
|
/* @__PURE__ */ jsxs11("div", { className: "lumir-toolbar-group", children: [
|
|
3215
|
-
/* @__PURE__ */
|
|
3216
|
-
/* @__PURE__ */
|
|
3217
|
-
/* @__PURE__ */
|
|
3218
|
-
/* @__PURE__ */
|
|
3316
|
+
/* @__PURE__ */ jsx17(TextStyleButton, { editor, style: "bold" }),
|
|
3317
|
+
/* @__PURE__ */ jsx17(TextStyleButton, { editor, style: "italic" }),
|
|
3318
|
+
/* @__PURE__ */ jsx17(TextStyleButton, { editor, style: "underline" }),
|
|
3319
|
+
/* @__PURE__ */ jsx17(TextStyleButton, { editor, style: "strike" })
|
|
3219
3320
|
] }),
|
|
3220
|
-
/* @__PURE__ */
|
|
3321
|
+
/* @__PURE__ */ jsx17(ToolbarDivider, {}),
|
|
3221
3322
|
/* @__PURE__ */ jsxs11("div", { className: "lumir-toolbar-group", children: [
|
|
3222
|
-
/* @__PURE__ */
|
|
3223
|
-
/* @__PURE__ */
|
|
3224
|
-
/* @__PURE__ */
|
|
3323
|
+
/* @__PURE__ */ jsx17(AlignButton, { editor, alignment: "left" }),
|
|
3324
|
+
/* @__PURE__ */ jsx17(AlignButton, { editor, alignment: "center" }),
|
|
3325
|
+
/* @__PURE__ */ jsx17(AlignButton, { editor, alignment: "right" })
|
|
3225
3326
|
] }),
|
|
3226
|
-
/* @__PURE__ */
|
|
3327
|
+
/* @__PURE__ */ jsx17(ToolbarDivider, {}),
|
|
3227
3328
|
/* @__PURE__ */ jsxs11("div", { className: "lumir-toolbar-group", children: [
|
|
3228
|
-
/* @__PURE__ */
|
|
3229
|
-
/* @__PURE__ */
|
|
3329
|
+
/* @__PURE__ */ jsx17(ListButton, { editor, type: "bullet" }),
|
|
3330
|
+
/* @__PURE__ */ jsx17(ListButton, { editor, type: "numbered" })
|
|
3230
3331
|
] })
|
|
3231
3332
|
] }),
|
|
3232
3333
|
/* @__PURE__ */ jsxs11("div", { className: "lumir-toolbar-row", children: [
|
|
3233
|
-
/* @__PURE__ */
|
|
3234
|
-
/* @__PURE__ */
|
|
3334
|
+
/* @__PURE__ */ jsx17("div", { className: "lumir-toolbar-group", children: /* @__PURE__ */ jsx17(BlockTypeSelect, { editor }) }),
|
|
3335
|
+
/* @__PURE__ */ jsx17(ToolbarDivider, {}),
|
|
3235
3336
|
/* @__PURE__ */ jsxs11("div", { className: "lumir-toolbar-group", children: [
|
|
3236
|
-
/* @__PURE__ */
|
|
3237
|
-
/* @__PURE__ */
|
|
3238
|
-
/* @__PURE__ */
|
|
3337
|
+
/* @__PURE__ */ jsx17(FontSizeButton, { editor }),
|
|
3338
|
+
/* @__PURE__ */ jsx17(ColorButton, { editor, type: "text" }),
|
|
3339
|
+
/* @__PURE__ */ jsx17(ColorButton, { editor, type: "background" })
|
|
3239
3340
|
] }),
|
|
3240
|
-
/* @__PURE__ */
|
|
3341
|
+
/* @__PURE__ */ jsx17(ToolbarDivider, {}),
|
|
3241
3342
|
/* @__PURE__ */ jsxs11("div", { className: "lumir-toolbar-group", children: [
|
|
3242
|
-
/* @__PURE__ */
|
|
3243
|
-
/* @__PURE__ */
|
|
3244
|
-
/* @__PURE__ */
|
|
3245
|
-
/* @__PURE__ */
|
|
3343
|
+
/* @__PURE__ */ jsx17(ImageButton, { editor, onImageUpload }),
|
|
3344
|
+
/* @__PURE__ */ jsx17(LinkButton, { editor }),
|
|
3345
|
+
/* @__PURE__ */ jsx17(TableButton, { editor }),
|
|
3346
|
+
/* @__PURE__ */ jsx17(HTMLImportButton, { editor })
|
|
3246
3347
|
] })
|
|
3247
3348
|
] })
|
|
3248
3349
|
] });
|
|
3249
|
-
return /* @__PURE__ */
|
|
3350
|
+
return /* @__PURE__ */ jsx17(
|
|
3250
3351
|
"div",
|
|
3251
3352
|
{
|
|
3252
3353
|
ref: wrapperRef,
|
|
@@ -3256,7 +3357,7 @@ var FloatingMenu = ({
|
|
|
3256
3357
|
className
|
|
3257
3358
|
),
|
|
3258
3359
|
"data-position": position,
|
|
3259
|
-
children: /* @__PURE__ */
|
|
3360
|
+
children: /* @__PURE__ */ jsx17(
|
|
3260
3361
|
"div",
|
|
3261
3362
|
{
|
|
3262
3363
|
className: cn(
|
|
@@ -3265,7 +3366,7 @@ var FloatingMenu = ({
|
|
|
3265
3366
|
isMinimizable && "is-minimizable",
|
|
3266
3367
|
isMinimized && "is-minimized"
|
|
3267
3368
|
),
|
|
3268
|
-
children: isMinimizable ? /* @__PURE__ */
|
|
3369
|
+
children: isMinimizable ? /* @__PURE__ */ jsx17(MinimizedLayout, {}) : isCompact ? /* @__PURE__ */ jsx17(TwoRowLayout, {}) : /* @__PURE__ */ jsx17(SingleRowLayout, {})
|
|
3269
3370
|
}
|
|
3270
3371
|
)
|
|
3271
3372
|
}
|
|
@@ -4205,12 +4306,12 @@ import {
|
|
|
4205
4306
|
useBlockNoteEditor,
|
|
4206
4307
|
useSelectedBlocks
|
|
4207
4308
|
} from "@blocknote/react";
|
|
4208
|
-
import { jsx as
|
|
4309
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
4209
4310
|
var icons = {
|
|
4210
|
-
left: /* @__PURE__ */
|
|
4211
|
-
center: /* @__PURE__ */
|
|
4212
|
-
right: /* @__PURE__ */
|
|
4213
|
-
justify: /* @__PURE__ */
|
|
4311
|
+
left: /* @__PURE__ */ jsx18("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", width: "18", height: "18", children: /* @__PURE__ */ jsx18("path", { d: "M15 15H3v2h12v-2zm0-8H3v2h12V7zM3 13h18v-2H3v2zm0 8h18v-2H3v2zM3 3v2h18V3H3z" }) }),
|
|
4312
|
+
center: /* @__PURE__ */ jsx18("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", width: "18", height: "18", children: /* @__PURE__ */ jsx18("path", { d: "M7 15v2h10v-2H7zm-4 6h18v-2H3v2zm0-8h18v-2H3v2zm4-6v2h10V7H7zM3 3v2h18V3H3z" }) }),
|
|
4313
|
+
right: /* @__PURE__ */ jsx18("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", width: "18", height: "18", children: /* @__PURE__ */ jsx18("path", { d: "M3 21h18v-2H3v2zm6-4h12v-2H9v2zm-6-4h18v-2H3v2zm6-4h12V7H9v2zM3 3v2h18V3H3z" }) }),
|
|
4314
|
+
justify: /* @__PURE__ */ jsx18("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", width: "18", height: "18", children: /* @__PURE__ */ jsx18("path", { d: "M3 21h18v-2H3v2zm0-4h18v-2H3v2zm0-4h18v-2H3v2zm0-4h18V7H3v2zM3 3v2h18V3H3z" }) })
|
|
4214
4315
|
};
|
|
4215
4316
|
var tooltipMap = {
|
|
4216
4317
|
left: "\uC67C\uCABD \uC815\uB82C",
|
|
@@ -4282,7 +4383,7 @@ var TextAlignButtonWithVA = (props) => {
|
|
|
4282
4383
|
if (!show || !editor.isEditable) {
|
|
4283
4384
|
return null;
|
|
4284
4385
|
}
|
|
4285
|
-
return /* @__PURE__ */
|
|
4386
|
+
return /* @__PURE__ */ jsx18(
|
|
4286
4387
|
Components.FormattingToolbar.Button,
|
|
4287
4388
|
{
|
|
4288
4389
|
className: "bn-button",
|
|
@@ -4303,19 +4404,19 @@ import {
|
|
|
4303
4404
|
useComponentsContext as useComponentsContext2,
|
|
4304
4405
|
useSelectedBlocks as useSelectedBlocks2
|
|
4305
4406
|
} from "@blocknote/react";
|
|
4306
|
-
import { jsx as
|
|
4407
|
+
import { jsx as jsx19, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
4307
4408
|
var icons2 = {
|
|
4308
4409
|
top: /* @__PURE__ */ jsxs12("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: [
|
|
4309
|
-
/* @__PURE__ */
|
|
4310
|
-
/* @__PURE__ */
|
|
4410
|
+
/* @__PURE__ */ jsx19("rect", { x: "2", y: "2", width: "12", height: "12", rx: "1" }),
|
|
4411
|
+
/* @__PURE__ */ jsx19("line", { x1: "5", y1: "5", x2: "11", y2: "5" })
|
|
4311
4412
|
] }),
|
|
4312
4413
|
middle: /* @__PURE__ */ jsxs12("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: [
|
|
4313
|
-
/* @__PURE__ */
|
|
4314
|
-
/* @__PURE__ */
|
|
4414
|
+
/* @__PURE__ */ jsx19("rect", { x: "2", y: "2", width: "12", height: "12", rx: "1" }),
|
|
4415
|
+
/* @__PURE__ */ jsx19("line", { x1: "5", y1: "8", x2: "11", y2: "8" })
|
|
4315
4416
|
] }),
|
|
4316
4417
|
bottom: /* @__PURE__ */ jsxs12("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: [
|
|
4317
|
-
/* @__PURE__ */
|
|
4318
|
-
/* @__PURE__ */
|
|
4418
|
+
/* @__PURE__ */ jsx19("rect", { x: "2", y: "2", width: "12", height: "12", rx: "1" }),
|
|
4419
|
+
/* @__PURE__ */ jsx19("line", { x1: "5", y1: "11", x2: "11", y2: "11" })
|
|
4319
4420
|
] })
|
|
4320
4421
|
};
|
|
4321
4422
|
var tooltips = {
|
|
@@ -4371,7 +4472,7 @@ var VerticalAlignButton = (props) => {
|
|
|
4371
4472
|
if (!isInTable || !editor.isEditable) {
|
|
4372
4473
|
return null;
|
|
4373
4474
|
}
|
|
4374
|
-
return /* @__PURE__ */
|
|
4475
|
+
return /* @__PURE__ */ jsx19(
|
|
4375
4476
|
Components.FormattingToolbar.Button,
|
|
4376
4477
|
{
|
|
4377
4478
|
className: "bn-button",
|
|
@@ -4392,22 +4493,22 @@ import {
|
|
|
4392
4493
|
useComponentsContext as useComponentsContext3,
|
|
4393
4494
|
useSelectedBlocks as useSelectedBlocks3
|
|
4394
4495
|
} from "@blocknote/react";
|
|
4395
|
-
import { jsx as
|
|
4496
|
+
import { jsx as jsx20, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
4396
4497
|
var icons3 = {
|
|
4397
4498
|
left: /* @__PURE__ */ jsxs13("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.4", children: [
|
|
4398
|
-
/* @__PURE__ */
|
|
4399
|
-
/* @__PURE__ */
|
|
4400
|
-
/* @__PURE__ */
|
|
4499
|
+
/* @__PURE__ */ jsx20("rect", { x: "1.5", y: "4", width: "7", height: "8", rx: "1", fill: "currentColor", stroke: "none" }),
|
|
4500
|
+
/* @__PURE__ */ jsx20("line", { x1: "1.5", y1: "1.5", x2: "14.5", y2: "1.5" }),
|
|
4501
|
+
/* @__PURE__ */ jsx20("line", { x1: "1.5", y1: "14.5", x2: "14.5", y2: "14.5" })
|
|
4401
4502
|
] }),
|
|
4402
4503
|
center: /* @__PURE__ */ jsxs13("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.4", children: [
|
|
4403
|
-
/* @__PURE__ */
|
|
4404
|
-
/* @__PURE__ */
|
|
4405
|
-
/* @__PURE__ */
|
|
4504
|
+
/* @__PURE__ */ jsx20("rect", { x: "4.5", y: "4", width: "7", height: "8", rx: "1", fill: "currentColor", stroke: "none" }),
|
|
4505
|
+
/* @__PURE__ */ jsx20("line", { x1: "1.5", y1: "1.5", x2: "14.5", y2: "1.5" }),
|
|
4506
|
+
/* @__PURE__ */ jsx20("line", { x1: "1.5", y1: "14.5", x2: "14.5", y2: "14.5" })
|
|
4406
4507
|
] }),
|
|
4407
4508
|
right: /* @__PURE__ */ jsxs13("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.4", children: [
|
|
4408
|
-
/* @__PURE__ */
|
|
4409
|
-
/* @__PURE__ */
|
|
4410
|
-
/* @__PURE__ */
|
|
4509
|
+
/* @__PURE__ */ jsx20("rect", { x: "7.5", y: "4", width: "7", height: "8", rx: "1", fill: "currentColor", stroke: "none" }),
|
|
4510
|
+
/* @__PURE__ */ jsx20("line", { x1: "1.5", y1: "1.5", x2: "14.5", y2: "1.5" }),
|
|
4511
|
+
/* @__PURE__ */ jsx20("line", { x1: "1.5", y1: "14.5", x2: "14.5", y2: "14.5" })
|
|
4411
4512
|
] })
|
|
4412
4513
|
};
|
|
4413
4514
|
var tooltips2 = {
|
|
@@ -4435,7 +4536,7 @@ var TableAlignButton = (props) => {
|
|
|
4435
4536
|
if (!tableBlock || !editor.isEditable) {
|
|
4436
4537
|
return null;
|
|
4437
4538
|
}
|
|
4438
|
-
return /* @__PURE__ */
|
|
4539
|
+
return /* @__PURE__ */ jsx20(
|
|
4439
4540
|
Components.FormattingToolbar.Button,
|
|
4440
4541
|
{
|
|
4441
4542
|
className: "bn-button",
|
|
@@ -4456,12 +4557,12 @@ import {
|
|
|
4456
4557
|
useEditorContentOrSelectionChange,
|
|
4457
4558
|
useSelectedBlocks as useSelectedBlocks4
|
|
4458
4559
|
} from "@blocknote/react";
|
|
4459
|
-
import { useCallback as useCallback18, useMemo as useMemo4, useState as useState9 } from "react";
|
|
4460
|
-
import { jsx as
|
|
4560
|
+
import { useCallback as useCallback18, useEffect as useEffect9, useMemo as useMemo4, useState as useState9 } from "react";
|
|
4561
|
+
import { jsx as jsx21, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
4461
4562
|
var DEFAULT_LABEL2 = "\uAE30\uBCF8";
|
|
4462
4563
|
var toLabel2 = (size) => size.replace(/px$/, "");
|
|
4463
4564
|
function FontSizeIcon({ size }) {
|
|
4464
|
-
return /* @__PURE__ */
|
|
4565
|
+
return /* @__PURE__ */ jsx21(
|
|
4465
4566
|
"span",
|
|
4466
4567
|
{
|
|
4467
4568
|
style: {
|
|
@@ -4490,6 +4591,11 @@ function FontSizeButton2() {
|
|
|
4490
4591
|
setCurrentSize(ed.getActiveStyles().fontSize || "");
|
|
4491
4592
|
}
|
|
4492
4593
|
}, editor);
|
|
4594
|
+
const currentPx = parseFontSizePx(currentSize);
|
|
4595
|
+
const [inputValue, setInputValue] = useState9(String(currentPx));
|
|
4596
|
+
useEffect9(() => {
|
|
4597
|
+
setInputValue(String(currentPx));
|
|
4598
|
+
}, [currentPx]);
|
|
4493
4599
|
const setFontSize = useCallback18(
|
|
4494
4600
|
(size) => {
|
|
4495
4601
|
size === "" ? ed.removeStyles({ fontSize: "" }) : ed.addStyles({ fontSize: size });
|
|
@@ -4498,6 +4604,21 @@ function FontSizeButton2() {
|
|
|
4498
4604
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
4499
4605
|
[editor]
|
|
4500
4606
|
);
|
|
4607
|
+
const stepBy = useCallback18(
|
|
4608
|
+
(delta) => {
|
|
4609
|
+
ed.addStyles({ fontSize: toFontSizeValue(currentPx + delta) });
|
|
4610
|
+
},
|
|
4611
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
4612
|
+
[currentPx]
|
|
4613
|
+
);
|
|
4614
|
+
const applyInput = useCallback18(() => {
|
|
4615
|
+
const n = parseInt(inputValue, 10);
|
|
4616
|
+
if (Number.isFinite(n)) {
|
|
4617
|
+
ed.addStyles({ fontSize: toFontSizeValue(n) });
|
|
4618
|
+
} else {
|
|
4619
|
+
setInputValue(String(currentPx));
|
|
4620
|
+
}
|
|
4621
|
+
}, [inputValue, currentPx]);
|
|
4501
4622
|
const show = useMemo4(() => {
|
|
4502
4623
|
if (!fontSizeInSchema) {
|
|
4503
4624
|
return false;
|
|
@@ -4513,20 +4634,76 @@ function FontSizeButton2() {
|
|
|
4513
4634
|
return null;
|
|
4514
4635
|
}
|
|
4515
4636
|
const tooltip = "\uAE00\uC790 \uD06C\uAE30";
|
|
4637
|
+
const preventBlur = (e) => e.preventDefault();
|
|
4516
4638
|
return /* @__PURE__ */ jsxs14(Components.Generic.Menu.Root, { children: [
|
|
4517
|
-
/* @__PURE__ */
|
|
4639
|
+
/* @__PURE__ */ jsx21(Components.Generic.Menu.Trigger, { children: /* @__PURE__ */ jsx21(
|
|
4518
4640
|
Components.FormattingToolbar.Button,
|
|
4519
4641
|
{
|
|
4520
4642
|
className: "bn-button",
|
|
4521
4643
|
"data-test": "font-size",
|
|
4522
4644
|
label: tooltip,
|
|
4523
4645
|
mainTooltip: tooltip,
|
|
4524
|
-
icon: /* @__PURE__ */
|
|
4646
|
+
icon: /* @__PURE__ */ jsx21(FontSizeIcon, { size: currentSize })
|
|
4525
4647
|
}
|
|
4526
4648
|
) }),
|
|
4527
4649
|
/* @__PURE__ */ jsxs14(Components.Generic.Menu.Dropdown, { className: "bn-menu-dropdown", children: [
|
|
4528
|
-
/* @__PURE__ */
|
|
4529
|
-
/* @__PURE__ */
|
|
4650
|
+
/* @__PURE__ */ jsx21(Components.Generic.Menu.Label, { children: "\uAE00\uC790 \uD06C\uAE30" }),
|
|
4651
|
+
/* @__PURE__ */ jsxs14("div", { className: "lumir-fs-stepper", children: [
|
|
4652
|
+
/* @__PURE__ */ jsx21(
|
|
4653
|
+
"button",
|
|
4654
|
+
{
|
|
4655
|
+
type: "button",
|
|
4656
|
+
className: "lumir-fs-stepper-btn",
|
|
4657
|
+
"aria-label": "\uAE00\uC790 \uD06C\uAE30 1px \uC904\uC774\uAE30",
|
|
4658
|
+
"data-test": "font-size-decrease",
|
|
4659
|
+
disabled: currentPx <= FONT_SIZE_MIN,
|
|
4660
|
+
onMouseDown: preventBlur,
|
|
4661
|
+
onClick: () => stepBy(-1),
|
|
4662
|
+
children: "\u2212"
|
|
4663
|
+
}
|
|
4664
|
+
),
|
|
4665
|
+
/* @__PURE__ */ jsx21(
|
|
4666
|
+
"input",
|
|
4667
|
+
{
|
|
4668
|
+
className: "lumir-fs-stepper-input",
|
|
4669
|
+
type: "text",
|
|
4670
|
+
inputMode: "numeric",
|
|
4671
|
+
"aria-label": "\uAE00\uC790 \uD06C\uAE30 \uC785\uB825",
|
|
4672
|
+
"data-test": "font-size-input",
|
|
4673
|
+
value: inputValue,
|
|
4674
|
+
onChange: (e) => setInputValue(e.target.value.replace(/[^0-9]/g, "")),
|
|
4675
|
+
onClick: (e) => e.stopPropagation(),
|
|
4676
|
+
onKeyDown: (e) => {
|
|
4677
|
+
e.stopPropagation();
|
|
4678
|
+
if (e.key === "Enter") {
|
|
4679
|
+
e.preventDefault();
|
|
4680
|
+
applyInput();
|
|
4681
|
+
} else if (e.key === "ArrowUp") {
|
|
4682
|
+
e.preventDefault();
|
|
4683
|
+
stepBy(1);
|
|
4684
|
+
} else if (e.key === "ArrowDown") {
|
|
4685
|
+
e.preventDefault();
|
|
4686
|
+
stepBy(-1);
|
|
4687
|
+
}
|
|
4688
|
+
},
|
|
4689
|
+
onBlur: applyInput
|
|
4690
|
+
}
|
|
4691
|
+
),
|
|
4692
|
+
/* @__PURE__ */ jsx21(
|
|
4693
|
+
"button",
|
|
4694
|
+
{
|
|
4695
|
+
type: "button",
|
|
4696
|
+
className: "lumir-fs-stepper-btn",
|
|
4697
|
+
"aria-label": "\uAE00\uC790 \uD06C\uAE30 1px \uB298\uB9AC\uAE30",
|
|
4698
|
+
"data-test": "font-size-increase",
|
|
4699
|
+
disabled: currentPx >= FONT_SIZE_MAX,
|
|
4700
|
+
onMouseDown: preventBlur,
|
|
4701
|
+
onClick: () => stepBy(1),
|
|
4702
|
+
children: "+"
|
|
4703
|
+
}
|
|
4704
|
+
)
|
|
4705
|
+
] }),
|
|
4706
|
+
/* @__PURE__ */ jsx21(
|
|
4530
4707
|
Components.Generic.Menu.Item,
|
|
4531
4708
|
{
|
|
4532
4709
|
onClick: () => setFontSize(""),
|
|
@@ -4536,7 +4713,7 @@ function FontSizeButton2() {
|
|
|
4536
4713
|
},
|
|
4537
4714
|
"font-size-default"
|
|
4538
4715
|
),
|
|
4539
|
-
FONT_SIZE_PRESETS.map((size) => /* @__PURE__ */
|
|
4716
|
+
FONT_SIZE_PRESETS.map((size) => /* @__PURE__ */ jsx21(
|
|
4540
4717
|
Components.Generic.Menu.Item,
|
|
4541
4718
|
{
|
|
4542
4719
|
onClick: () => setFontSize(size),
|
|
@@ -4564,7 +4741,7 @@ import {
|
|
|
4564
4741
|
useSelectedBlocks as useSelectedBlocks5
|
|
4565
4742
|
} from "@blocknote/react";
|
|
4566
4743
|
import { useCallback as useCallback19, useMemo as useMemo5, useRef as useRef10, useState as useState10 } from "react";
|
|
4567
|
-
import { Fragment as Fragment5, jsx as
|
|
4744
|
+
import { Fragment as Fragment5, jsx as jsx22, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
4568
4745
|
var COLORS = [
|
|
4569
4746
|
"default",
|
|
4570
4747
|
"gray",
|
|
@@ -4581,7 +4758,7 @@ function ColorIcon(props) {
|
|
|
4581
4758
|
const textColor = props.textColor || "default";
|
|
4582
4759
|
const backgroundColor = props.backgroundColor || "default";
|
|
4583
4760
|
const size = props.size || 16;
|
|
4584
|
-
return /* @__PURE__ */
|
|
4761
|
+
return /* @__PURE__ */ jsx22(
|
|
4585
4762
|
"div",
|
|
4586
4763
|
{
|
|
4587
4764
|
className: "bn-color-icon",
|
|
@@ -4600,7 +4777,7 @@ function ColorIcon(props) {
|
|
|
4600
4777
|
);
|
|
4601
4778
|
}
|
|
4602
4779
|
function CellFillIcon({ size = 18 }) {
|
|
4603
|
-
return /* @__PURE__ */
|
|
4780
|
+
return /* @__PURE__ */ jsx22(
|
|
4604
4781
|
"svg",
|
|
4605
4782
|
{
|
|
4606
4783
|
width: size,
|
|
@@ -4609,7 +4786,7 @@ function CellFillIcon({ size = 18 }) {
|
|
|
4609
4786
|
fill: "currentColor",
|
|
4610
4787
|
style: { pointerEvents: "none" },
|
|
4611
4788
|
"aria-hidden": "true",
|
|
4612
|
-
children: /* @__PURE__ */
|
|
4789
|
+
children: /* @__PURE__ */ jsx22("path", { d: "M16.56 8.94 7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.59-.59 1.54 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.58.59-1.53 0-2.12zM5.21 10 10 5.21 14.79 10H5.21zM19 11.5s-2 2.17-2 3.5c0 1.1.9 2 2 2s2-.9 2-2c0-1.33-2-3.5-2-3.5z" })
|
|
4613
4790
|
}
|
|
4614
4791
|
);
|
|
4615
4792
|
}
|
|
@@ -4618,8 +4795,8 @@ function LumirColorPicker(props) {
|
|
|
4618
4795
|
const dict = useDictionary();
|
|
4619
4796
|
return /* @__PURE__ */ jsxs15(Fragment5, { children: [
|
|
4620
4797
|
props.text ? /* @__PURE__ */ jsxs15(Fragment5, { children: [
|
|
4621
|
-
/* @__PURE__ */
|
|
4622
|
-
COLORS.map((color) => /* @__PURE__ */
|
|
4798
|
+
/* @__PURE__ */ jsx22(Components.Generic.Menu.Label, { children: props.textTitle ?? dict.color_picker.text_title }),
|
|
4799
|
+
COLORS.map((color) => /* @__PURE__ */ jsx22(
|
|
4623
4800
|
Components.Generic.Menu.Item,
|
|
4624
4801
|
{
|
|
4625
4802
|
onClick: () => {
|
|
@@ -4627,7 +4804,7 @@ function LumirColorPicker(props) {
|
|
|
4627
4804
|
props.text.setColor(color);
|
|
4628
4805
|
},
|
|
4629
4806
|
"data-test": "text-color-" + color,
|
|
4630
|
-
icon: /* @__PURE__ */
|
|
4807
|
+
icon: /* @__PURE__ */ jsx22(ColorIcon, { textColor: color, size: props.iconSize }),
|
|
4631
4808
|
checked: props.text.color === color,
|
|
4632
4809
|
children: dict.color_picker.colors[color]
|
|
4633
4810
|
},
|
|
@@ -4635,8 +4812,8 @@ function LumirColorPicker(props) {
|
|
|
4635
4812
|
))
|
|
4636
4813
|
] }) : null,
|
|
4637
4814
|
props.background ? /* @__PURE__ */ jsxs15(Fragment5, { children: [
|
|
4638
|
-
/* @__PURE__ */
|
|
4639
|
-
COLORS.map((color) => /* @__PURE__ */
|
|
4815
|
+
/* @__PURE__ */ jsx22(Components.Generic.Menu.Label, { children: props.backgroundTitle ?? dict.color_picker.background_title }),
|
|
4816
|
+
COLORS.map((color) => /* @__PURE__ */ jsx22(
|
|
4640
4817
|
Components.Generic.Menu.Item,
|
|
4641
4818
|
{
|
|
4642
4819
|
onClick: () => {
|
|
@@ -4644,7 +4821,7 @@ function LumirColorPicker(props) {
|
|
|
4644
4821
|
props.background.setColor(color);
|
|
4645
4822
|
},
|
|
4646
4823
|
"data-test": "background-color-" + color,
|
|
4647
|
-
icon: /* @__PURE__ */
|
|
4824
|
+
icon: /* @__PURE__ */ jsx22(ColorIcon, { backgroundColor: color, size: props.iconSize }),
|
|
4648
4825
|
checked: props.background.color === color,
|
|
4649
4826
|
children: dict.color_picker.colors[color]
|
|
4650
4827
|
},
|
|
@@ -4708,14 +4885,14 @@ function LumirColorStyleButton() {
|
|
|
4708
4885
|
}
|
|
4709
4886
|
const tooltip = "\uD14D\uC2A4\uD2B8 \uC0C9\xB7\uBC30\uACBD";
|
|
4710
4887
|
return /* @__PURE__ */ jsxs15(Components.Generic.Menu.Root, { children: [
|
|
4711
|
-
/* @__PURE__ */
|
|
4888
|
+
/* @__PURE__ */ jsx22(Components.Generic.Menu.Trigger, { children: /* @__PURE__ */ jsx22(
|
|
4712
4889
|
Components.FormattingToolbar.Button,
|
|
4713
4890
|
{
|
|
4714
4891
|
className: "bn-button",
|
|
4715
4892
|
"data-test": "colors",
|
|
4716
4893
|
label: tooltip,
|
|
4717
4894
|
mainTooltip: tooltip,
|
|
4718
|
-
icon: /* @__PURE__ */
|
|
4895
|
+
icon: /* @__PURE__ */ jsx22(
|
|
4719
4896
|
ColorIcon,
|
|
4720
4897
|
{
|
|
4721
4898
|
textColor: currentTextColor,
|
|
@@ -4725,11 +4902,11 @@ function LumirColorStyleButton() {
|
|
|
4725
4902
|
)
|
|
4726
4903
|
}
|
|
4727
4904
|
) }),
|
|
4728
|
-
/* @__PURE__ */
|
|
4905
|
+
/* @__PURE__ */ jsx22(
|
|
4729
4906
|
Components.Generic.Menu.Dropdown,
|
|
4730
4907
|
{
|
|
4731
4908
|
className: "bn-menu-dropdown bn-color-picker-dropdown",
|
|
4732
|
-
children: /* @__PURE__ */
|
|
4909
|
+
children: /* @__PURE__ */ jsx22(
|
|
4733
4910
|
LumirColorPicker,
|
|
4734
4911
|
{
|
|
4735
4912
|
textTitle: "\uD14D\uC2A4\uD2B8 \uC0C9",
|
|
@@ -4776,21 +4953,21 @@ function LumirCellColorToolbarButton() {
|
|
|
4776
4953
|
}
|
|
4777
4954
|
},
|
|
4778
4955
|
children: [
|
|
4779
|
-
/* @__PURE__ */
|
|
4956
|
+
/* @__PURE__ */ jsx22(Components.Generic.Menu.Trigger, { children: /* @__PURE__ */ jsx22(
|
|
4780
4957
|
Components.FormattingToolbar.Button,
|
|
4781
4958
|
{
|
|
4782
4959
|
className: "bn-button",
|
|
4783
4960
|
"data-test": "cell-colors",
|
|
4784
4961
|
label: tooltip,
|
|
4785
4962
|
mainTooltip: tooltip,
|
|
4786
|
-
icon: /* @__PURE__ */
|
|
4963
|
+
icon: /* @__PURE__ */ jsx22(CellFillIcon, { size: 18 })
|
|
4787
4964
|
}
|
|
4788
4965
|
) }),
|
|
4789
|
-
/* @__PURE__ */
|
|
4966
|
+
/* @__PURE__ */ jsx22(
|
|
4790
4967
|
Components.Generic.Menu.Dropdown,
|
|
4791
4968
|
{
|
|
4792
4969
|
className: "bn-menu-dropdown bn-color-picker-dropdown",
|
|
4793
|
-
children: /* @__PURE__ */
|
|
4970
|
+
children: /* @__PURE__ */ jsx22(
|
|
4794
4971
|
LumirColorPicker,
|
|
4795
4972
|
{
|
|
4796
4973
|
backgroundTitle: "\uC140 \uBC30\uACBD",
|
|
@@ -4827,13 +5004,13 @@ function LumirCellColorPickerButton(props) {
|
|
|
4827
5004
|
return null;
|
|
4828
5005
|
}
|
|
4829
5006
|
return /* @__PURE__ */ jsxs15(Components.Generic.Menu.Root, { position: "right", sub: true, children: [
|
|
4830
|
-
/* @__PURE__ */
|
|
4831
|
-
/* @__PURE__ */
|
|
5007
|
+
/* @__PURE__ */ jsx22(Components.Generic.Menu.Trigger, { sub: true, children: /* @__PURE__ */ jsx22(Components.Generic.Menu.Item, { className: "bn-menu-item", subTrigger: true, children: "\uC140 \uC0C9\xB7\uBC30\uACBD" }) }),
|
|
5008
|
+
/* @__PURE__ */ jsx22(
|
|
4832
5009
|
Components.Generic.Menu.Dropdown,
|
|
4833
5010
|
{
|
|
4834
5011
|
sub: true,
|
|
4835
5012
|
className: "bn-menu-dropdown bn-color-picker-dropdown",
|
|
4836
|
-
children: /* @__PURE__ */
|
|
5013
|
+
children: /* @__PURE__ */ jsx22(
|
|
4837
5014
|
LumirColorPicker,
|
|
4838
5015
|
{
|
|
4839
5016
|
iconSize: 18,
|
|
@@ -4855,12 +5032,12 @@ function LumirCellColorPickerButton(props) {
|
|
|
4855
5032
|
}
|
|
4856
5033
|
function LumirTableCellMenu(props) {
|
|
4857
5034
|
const Components = useComponentsContext5();
|
|
4858
|
-
return /* @__PURE__ */
|
|
5035
|
+
return /* @__PURE__ */ jsx22(
|
|
4859
5036
|
Components.Generic.Menu.Dropdown,
|
|
4860
5037
|
{
|
|
4861
5038
|
className: "bn-menu-dropdown bn-drag-handle-menu",
|
|
4862
5039
|
children: props.children || /* @__PURE__ */ jsxs15(Fragment5, { children: [
|
|
4863
|
-
/* @__PURE__ */
|
|
5040
|
+
/* @__PURE__ */ jsx22(
|
|
4864
5041
|
SplitButton,
|
|
4865
5042
|
{
|
|
4866
5043
|
block: props.block,
|
|
@@ -4868,7 +5045,7 @@ function LumirTableCellMenu(props) {
|
|
|
4868
5045
|
colIndex: props.colIndex
|
|
4869
5046
|
}
|
|
4870
5047
|
),
|
|
4871
|
-
/* @__PURE__ */
|
|
5048
|
+
/* @__PURE__ */ jsx22(
|
|
4872
5049
|
LumirCellColorPickerButton,
|
|
4873
5050
|
{
|
|
4874
5051
|
block: props.block,
|
|
@@ -4882,78 +5059,78 @@ function LumirTableCellMenu(props) {
|
|
|
4882
5059
|
}
|
|
4883
5060
|
|
|
4884
5061
|
// src/components/CustomFormattingToolbar.tsx
|
|
4885
|
-
import { jsx as
|
|
5062
|
+
import { jsx as jsx23, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
4886
5063
|
var CustomFormattingToolbar = () => {
|
|
4887
5064
|
return /* @__PURE__ */ jsxs16(FormattingToolbar, { children: [
|
|
4888
|
-
/* @__PURE__ */
|
|
4889
|
-
/* @__PURE__ */
|
|
4890
|
-
/* @__PURE__ */
|
|
4891
|
-
/* @__PURE__ */
|
|
4892
|
-
/* @__PURE__ */
|
|
4893
|
-
/* @__PURE__ */
|
|
4894
|
-
/* @__PURE__ */
|
|
4895
|
-
/* @__PURE__ */
|
|
4896
|
-
/* @__PURE__ */
|
|
4897
|
-
/* @__PURE__ */
|
|
5065
|
+
/* @__PURE__ */ jsx23(BlockTypeSelect2, {}, "blockTypeSelect"),
|
|
5066
|
+
/* @__PURE__ */ jsx23(TableCellMergeButton, {}, "tableCellMergeButton"),
|
|
5067
|
+
/* @__PURE__ */ jsx23(FileCaptionButton, {}, "fileCaptionButton"),
|
|
5068
|
+
/* @__PURE__ */ jsx23(FileReplaceButton, {}, "replaceFileButton"),
|
|
5069
|
+
/* @__PURE__ */ jsx23(FileRenameButton, {}, "fileRenameButton"),
|
|
5070
|
+
/* @__PURE__ */ jsx23(FileDeleteButton, {}, "fileDeleteButton"),
|
|
5071
|
+
/* @__PURE__ */ jsx23(FileDownloadButton, {}, "fileDownloadButton"),
|
|
5072
|
+
/* @__PURE__ */ jsx23(FilePreviewButton, {}, "filePreviewButton"),
|
|
5073
|
+
/* @__PURE__ */ jsx23(BasicTextStyleButton, { basicTextStyle: "bold" }, "boldStyleButton"),
|
|
5074
|
+
/* @__PURE__ */ jsx23(
|
|
4898
5075
|
BasicTextStyleButton,
|
|
4899
5076
|
{
|
|
4900
5077
|
basicTextStyle: "italic"
|
|
4901
5078
|
},
|
|
4902
5079
|
"italicStyleButton"
|
|
4903
5080
|
),
|
|
4904
|
-
/* @__PURE__ */
|
|
5081
|
+
/* @__PURE__ */ jsx23(
|
|
4905
5082
|
BasicTextStyleButton,
|
|
4906
5083
|
{
|
|
4907
5084
|
basicTextStyle: "underline"
|
|
4908
5085
|
},
|
|
4909
5086
|
"underlineStyleButton"
|
|
4910
5087
|
),
|
|
4911
|
-
/* @__PURE__ */
|
|
5088
|
+
/* @__PURE__ */ jsx23(
|
|
4912
5089
|
BasicTextStyleButton,
|
|
4913
5090
|
{
|
|
4914
5091
|
basicTextStyle: "strike"
|
|
4915
5092
|
},
|
|
4916
5093
|
"strikeStyleButton"
|
|
4917
5094
|
),
|
|
4918
|
-
/* @__PURE__ */
|
|
4919
|
-
/* @__PURE__ */
|
|
5095
|
+
/* @__PURE__ */ jsx23(TextAlignButtonWithVA, { textAlignment: "left" }, "textAlignLeftButton"),
|
|
5096
|
+
/* @__PURE__ */ jsx23(
|
|
4920
5097
|
TextAlignButtonWithVA,
|
|
4921
5098
|
{
|
|
4922
5099
|
textAlignment: "center"
|
|
4923
5100
|
},
|
|
4924
5101
|
"textAlignCenterButton"
|
|
4925
5102
|
),
|
|
4926
|
-
/* @__PURE__ */
|
|
4927
|
-
/* @__PURE__ */
|
|
5103
|
+
/* @__PURE__ */ jsx23(TextAlignButtonWithVA, { textAlignment: "right" }, "textAlignRightButton"),
|
|
5104
|
+
/* @__PURE__ */ jsx23(
|
|
4928
5105
|
VerticalAlignButton,
|
|
4929
5106
|
{
|
|
4930
5107
|
verticalAlignment: "top"
|
|
4931
5108
|
},
|
|
4932
5109
|
"verticalAlignTop"
|
|
4933
5110
|
),
|
|
4934
|
-
/* @__PURE__ */
|
|
5111
|
+
/* @__PURE__ */ jsx23(
|
|
4935
5112
|
VerticalAlignButton,
|
|
4936
5113
|
{
|
|
4937
5114
|
verticalAlignment: "middle"
|
|
4938
5115
|
},
|
|
4939
5116
|
"verticalAlignMiddle"
|
|
4940
5117
|
),
|
|
4941
|
-
/* @__PURE__ */
|
|
5118
|
+
/* @__PURE__ */ jsx23(
|
|
4942
5119
|
VerticalAlignButton,
|
|
4943
5120
|
{
|
|
4944
5121
|
verticalAlignment: "bottom"
|
|
4945
5122
|
},
|
|
4946
5123
|
"verticalAlignBottom"
|
|
4947
5124
|
),
|
|
4948
|
-
/* @__PURE__ */
|
|
4949
|
-
/* @__PURE__ */
|
|
4950
|
-
/* @__PURE__ */
|
|
4951
|
-
/* @__PURE__ */
|
|
4952
|
-
/* @__PURE__ */
|
|
4953
|
-
/* @__PURE__ */
|
|
4954
|
-
/* @__PURE__ */
|
|
4955
|
-
/* @__PURE__ */
|
|
4956
|
-
/* @__PURE__ */
|
|
5125
|
+
/* @__PURE__ */ jsx23(TableAlignButton, { alignment: "left" }, "tableAlignLeft"),
|
|
5126
|
+
/* @__PURE__ */ jsx23(TableAlignButton, { alignment: "center" }, "tableAlignCenter"),
|
|
5127
|
+
/* @__PURE__ */ jsx23(TableAlignButton, { alignment: "right" }, "tableAlignRight"),
|
|
5128
|
+
/* @__PURE__ */ jsx23(FontSizeButton2, {}, "fontSizeButton"),
|
|
5129
|
+
/* @__PURE__ */ jsx23(LumirColorStyleButton, {}, "colorStyleButton"),
|
|
5130
|
+
/* @__PURE__ */ jsx23(LumirCellColorToolbarButton, {}, "cellColorButton"),
|
|
5131
|
+
/* @__PURE__ */ jsx23(NestBlockButton, {}, "nestBlockButton"),
|
|
5132
|
+
/* @__PURE__ */ jsx23(UnnestBlockButton, {}, "unnestBlockButton"),
|
|
5133
|
+
/* @__PURE__ */ jsx23(CreateLinkButton, {}, "createLinkButton")
|
|
4957
5134
|
] });
|
|
4958
5135
|
};
|
|
4959
5136
|
|
|
@@ -4968,22 +5145,22 @@ import {
|
|
|
4968
5145
|
useBlockNoteEditor as useBlockNoteEditor6,
|
|
4969
5146
|
useDictionary as useDictionary2
|
|
4970
5147
|
} from "@blocknote/react";
|
|
4971
|
-
import { Fragment as Fragment6, jsx as
|
|
5148
|
+
import { Fragment as Fragment6, jsx as jsx24, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
4972
5149
|
var TABLE_ALIGN_ICONS = {
|
|
4973
5150
|
left: /* @__PURE__ */ jsxs17("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.4", children: [
|
|
4974
|
-
/* @__PURE__ */
|
|
4975
|
-
/* @__PURE__ */
|
|
4976
|
-
/* @__PURE__ */
|
|
5151
|
+
/* @__PURE__ */ jsx24("rect", { x: "1.5", y: "4", width: "7", height: "8", rx: "1", fill: "currentColor", stroke: "none" }),
|
|
5152
|
+
/* @__PURE__ */ jsx24("line", { x1: "1.5", y1: "1.5", x2: "14.5", y2: "1.5" }),
|
|
5153
|
+
/* @__PURE__ */ jsx24("line", { x1: "1.5", y1: "14.5", x2: "14.5", y2: "14.5" })
|
|
4977
5154
|
] }),
|
|
4978
5155
|
center: /* @__PURE__ */ jsxs17("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.4", children: [
|
|
4979
|
-
/* @__PURE__ */
|
|
4980
|
-
/* @__PURE__ */
|
|
4981
|
-
/* @__PURE__ */
|
|
5156
|
+
/* @__PURE__ */ jsx24("rect", { x: "4.5", y: "4", width: "7", height: "8", rx: "1", fill: "currentColor", stroke: "none" }),
|
|
5157
|
+
/* @__PURE__ */ jsx24("line", { x1: "1.5", y1: "1.5", x2: "14.5", y2: "1.5" }),
|
|
5158
|
+
/* @__PURE__ */ jsx24("line", { x1: "1.5", y1: "14.5", x2: "14.5", y2: "14.5" })
|
|
4982
5159
|
] }),
|
|
4983
5160
|
right: /* @__PURE__ */ jsxs17("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.4", children: [
|
|
4984
|
-
/* @__PURE__ */
|
|
4985
|
-
/* @__PURE__ */
|
|
4986
|
-
/* @__PURE__ */
|
|
5161
|
+
/* @__PURE__ */ jsx24("rect", { x: "7.5", y: "4", width: "7", height: "8", rx: "1", fill: "currentColor", stroke: "none" }),
|
|
5162
|
+
/* @__PURE__ */ jsx24("line", { x1: "1.5", y1: "1.5", x2: "14.5", y2: "1.5" }),
|
|
5163
|
+
/* @__PURE__ */ jsx24("line", { x1: "1.5", y1: "14.5", x2: "14.5", y2: "14.5" })
|
|
4987
5164
|
] })
|
|
4988
5165
|
};
|
|
4989
5166
|
var TABLE_ALIGN_LABELS = {
|
|
@@ -4998,7 +5175,7 @@ function TableAlignmentItems(props) {
|
|
|
4998
5175
|
return null;
|
|
4999
5176
|
}
|
|
5000
5177
|
const current = getTableAlignment(editor, props.block.id);
|
|
5001
|
-
return /* @__PURE__ */
|
|
5178
|
+
return /* @__PURE__ */ jsx24(Fragment6, { children: ["left", "center", "right"].map((align) => /* @__PURE__ */ jsx24(
|
|
5002
5179
|
Components.Generic.Menu.Item,
|
|
5003
5180
|
{
|
|
5004
5181
|
icon: TABLE_ALIGN_ICONS[align],
|
|
@@ -5015,11 +5192,11 @@ function TableAlignmentItems(props) {
|
|
|
5015
5192
|
var LumirDragHandleMenu = (props) => {
|
|
5016
5193
|
const dict = useDictionary2();
|
|
5017
5194
|
return /* @__PURE__ */ jsxs17(DragHandleMenu, { ...props, children: [
|
|
5018
|
-
/* @__PURE__ */
|
|
5019
|
-
/* @__PURE__ */
|
|
5020
|
-
/* @__PURE__ */
|
|
5021
|
-
/* @__PURE__ */
|
|
5022
|
-
/* @__PURE__ */
|
|
5195
|
+
/* @__PURE__ */ jsx24(RemoveBlockItem, { ...props, children: dict.drag_handle.delete_menuitem }),
|
|
5196
|
+
/* @__PURE__ */ jsx24(BlockColorsItem, { ...props, children: dict.drag_handle.colors_menuitem }),
|
|
5197
|
+
/* @__PURE__ */ jsx24(TableRowHeaderItem, { ...props, children: dict.drag_handle.header_row_menuitem }),
|
|
5198
|
+
/* @__PURE__ */ jsx24(TableColumnHeaderItem, { ...props, children: dict.drag_handle.header_column_menuitem }),
|
|
5199
|
+
/* @__PURE__ */ jsx24(TableAlignmentItems, { block: props.block })
|
|
5023
5200
|
] });
|
|
5024
5201
|
};
|
|
5025
5202
|
|
|
@@ -5034,7 +5211,7 @@ import {
|
|
|
5034
5211
|
useUIPluginState
|
|
5035
5212
|
} from "@blocknote/react";
|
|
5036
5213
|
import { autoUpdate as autoUpdate2, FloatingPortal } from "@floating-ui/react";
|
|
5037
|
-
import { useCallback as useCallback20, useEffect as
|
|
5214
|
+
import { useCallback as useCallback20, useEffect as useEffect11, useMemo as useMemo7, useRef as useRef11, useState as useState11 } from "react";
|
|
5038
5215
|
|
|
5039
5216
|
// src/components/hooks/useFocusedCellHandlePositioning.ts
|
|
5040
5217
|
import {
|
|
@@ -5043,7 +5220,7 @@ import {
|
|
|
5043
5220
|
useFloating,
|
|
5044
5221
|
useTransitionStyles
|
|
5045
5222
|
} from "@floating-ui/react";
|
|
5046
|
-
import { useEffect as
|
|
5223
|
+
import { useEffect as useEffect10, useMemo as useMemo6 } from "react";
|
|
5047
5224
|
function useFocusedCellHandlePositioning(cellEl, tbodyEl, orientation, show) {
|
|
5048
5225
|
const { refs, floatingStyles, context, update } = useFloating({
|
|
5049
5226
|
open: show,
|
|
@@ -5058,7 +5235,7 @@ function useFocusedCellHandlePositioning(cellEl, tbodyEl, orientation, show) {
|
|
|
5058
5235
|
whileElementsMounted: autoUpdate
|
|
5059
5236
|
});
|
|
5060
5237
|
const { isMounted, styles } = useTransitionStyles(context);
|
|
5061
|
-
|
|
5238
|
+
useEffect10(() => {
|
|
5062
5239
|
if (!show || !tbodyEl) {
|
|
5063
5240
|
return;
|
|
5064
5241
|
}
|
|
@@ -5066,7 +5243,7 @@ function useFocusedCellHandlePositioning(cellEl, tbodyEl, orientation, show) {
|
|
|
5066
5243
|
ro.observe(tbodyEl);
|
|
5067
5244
|
return () => ro.disconnect();
|
|
5068
5245
|
}, [show, tbodyEl, update]);
|
|
5069
|
-
|
|
5246
|
+
useEffect10(() => {
|
|
5070
5247
|
if (!cellEl) {
|
|
5071
5248
|
refs.setReference(null);
|
|
5072
5249
|
return;
|
|
@@ -5111,7 +5288,7 @@ function useTableCornerPositioning(referencePosTable, show) {
|
|
|
5111
5288
|
whileElementsMounted: autoUpdate
|
|
5112
5289
|
});
|
|
5113
5290
|
const { isMounted, styles } = useTransitionStyles(context);
|
|
5114
|
-
|
|
5291
|
+
useEffect10(() => {
|
|
5115
5292
|
if (!referencePosTable) {
|
|
5116
5293
|
refs.setReference(null);
|
|
5117
5294
|
return;
|
|
@@ -5131,7 +5308,7 @@ function useTableCornerPositioning(referencePosTable, show) {
|
|
|
5131
5308
|
}
|
|
5132
5309
|
|
|
5133
5310
|
// src/components/LumirTableHandlesController.tsx
|
|
5134
|
-
import { Fragment as Fragment7, jsx as
|
|
5311
|
+
import { Fragment as Fragment7, jsx as jsx25, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
5135
5312
|
function syncCoreHoverToFocusedCell(cellEl) {
|
|
5136
5313
|
const r = cellEl.getBoundingClientRect();
|
|
5137
5314
|
cellEl.dispatchEvent(
|
|
@@ -5153,7 +5330,7 @@ function LumirTableHandlesController() {
|
|
|
5153
5330
|
const frozenRef = useRef11(false);
|
|
5154
5331
|
const menuOpenRef = useRef11(false);
|
|
5155
5332
|
const draggingRef = useRef11(false);
|
|
5156
|
-
|
|
5333
|
+
useEffect11(() => {
|
|
5157
5334
|
editor.__lumirActiveTableId = focused?.block?.id ?? null;
|
|
5158
5335
|
}, [editor, focused]);
|
|
5159
5336
|
const recompute = useCallback20(() => {
|
|
@@ -5205,10 +5382,10 @@ function LumirTableHandlesController() {
|
|
|
5205
5382
|
});
|
|
5206
5383
|
}, [editor]);
|
|
5207
5384
|
useEditorContentOrSelectionChange3(recompute, editor);
|
|
5208
|
-
|
|
5385
|
+
useEffect11(() => {
|
|
5209
5386
|
recompute();
|
|
5210
5387
|
}, [recompute]);
|
|
5211
|
-
|
|
5388
|
+
useEffect11(() => {
|
|
5212
5389
|
const onUp = () => {
|
|
5213
5390
|
requestAnimationFrame(() => {
|
|
5214
5391
|
if (!menuOpenRef.current && !draggingRef.current && frozenRef.current) {
|
|
@@ -5220,7 +5397,7 @@ function LumirTableHandlesController() {
|
|
|
5220
5397
|
window.addEventListener("pointerup", onUp);
|
|
5221
5398
|
return () => window.removeEventListener("pointerup", onUp);
|
|
5222
5399
|
}, [recompute]);
|
|
5223
|
-
|
|
5400
|
+
useEffect11(() => {
|
|
5224
5401
|
const f = focused;
|
|
5225
5402
|
if (!f || !overlayEl) {
|
|
5226
5403
|
return;
|
|
@@ -5375,9 +5552,9 @@ function LumirTableHandlesController() {
|
|
|
5375
5552
|
[editor, coreState]
|
|
5376
5553
|
);
|
|
5377
5554
|
return /* @__PURE__ */ jsxs18(Fragment7, { children: [
|
|
5378
|
-
/* @__PURE__ */
|
|
5555
|
+
/* @__PURE__ */ jsx25("div", { ref: setMenuContainerRef }),
|
|
5379
5556
|
th && focused && menuContainerRef && /* @__PURE__ */ jsxs18(FloatingPortal, { root: focused.widgetContainer, children: [
|
|
5380
|
-
/* @__PURE__ */
|
|
5557
|
+
/* @__PURE__ */ jsx25("div", { ref: setOverlayEl, className: "lumir-tbl-cell-focus" }),
|
|
5381
5558
|
colHandle.isMounted && /* @__PURE__ */ jsxs18(
|
|
5382
5559
|
"div",
|
|
5383
5560
|
{
|
|
@@ -5387,8 +5564,8 @@ function LumirTableHandlesController() {
|
|
|
5387
5564
|
onPointerEnter: onGutterPointerEnter,
|
|
5388
5565
|
onPointerDown: onGutterPointerDown,
|
|
5389
5566
|
children: [
|
|
5390
|
-
/* @__PURE__ */
|
|
5391
|
-
/* @__PURE__ */
|
|
5567
|
+
/* @__PURE__ */ jsx25("span", { className: "lumir-tbl-gutter" }),
|
|
5568
|
+
/* @__PURE__ */ jsx25("div", { className: "lumir-tbl-grip", children: /* @__PURE__ */ jsx25(
|
|
5392
5569
|
TableHandle,
|
|
5393
5570
|
{
|
|
5394
5571
|
editor,
|
|
@@ -5416,8 +5593,8 @@ function LumirTableHandlesController() {
|
|
|
5416
5593
|
onPointerEnter: onGutterPointerEnter,
|
|
5417
5594
|
onPointerDown: onGutterPointerDown,
|
|
5418
5595
|
children: [
|
|
5419
|
-
/* @__PURE__ */
|
|
5420
|
-
/* @__PURE__ */
|
|
5596
|
+
/* @__PURE__ */ jsx25("span", { className: "lumir-tbl-gutter" }),
|
|
5597
|
+
/* @__PURE__ */ jsx25("div", { className: "lumir-tbl-grip", children: /* @__PURE__ */ jsx25(
|
|
5421
5598
|
TableHandle,
|
|
5422
5599
|
{
|
|
5423
5600
|
editor,
|
|
@@ -5444,8 +5621,8 @@ function LumirTableHandlesController() {
|
|
|
5444
5621
|
className: "lumir-tbl-gutter-wrap lumir-tbl-gutter-wrap--cell" + (openMenu === "cell" ? " lumir-tbl-gutter-wrap--active" : ""),
|
|
5445
5622
|
onPointerDown: onGutterPointerDown,
|
|
5446
5623
|
children: [
|
|
5447
|
-
/* @__PURE__ */
|
|
5448
|
-
/* @__PURE__ */
|
|
5624
|
+
/* @__PURE__ */ jsx25("span", { className: "lumir-tbl-gutter" }),
|
|
5625
|
+
/* @__PURE__ */ jsx25("div", { className: "lumir-tbl-grip", children: /* @__PURE__ */ jsx25(
|
|
5449
5626
|
TableCellButton,
|
|
5450
5627
|
{
|
|
5451
5628
|
editor,
|
|
@@ -5463,7 +5640,7 @@ function LumirTableHandlesController() {
|
|
|
5463
5640
|
)
|
|
5464
5641
|
] }),
|
|
5465
5642
|
th && coreState?.widgetContainer && /* @__PURE__ */ jsxs18(FloatingPortal, { root: coreState.widgetContainer, children: [
|
|
5466
|
-
/* @__PURE__ */
|
|
5643
|
+
/* @__PURE__ */ jsx25("div", { ref: addOrRemoveRowsButton.ref, style: addOrRemoveRowsButton.style, children: /* @__PURE__ */ jsx25(
|
|
5467
5644
|
ExtendButton,
|
|
5468
5645
|
{
|
|
5469
5646
|
editor,
|
|
@@ -5473,12 +5650,12 @@ function LumirTableHandlesController() {
|
|
|
5473
5650
|
onMouseUp: onEndExtend
|
|
5474
5651
|
}
|
|
5475
5652
|
) }),
|
|
5476
|
-
/* @__PURE__ */
|
|
5653
|
+
/* @__PURE__ */ jsx25(
|
|
5477
5654
|
"div",
|
|
5478
5655
|
{
|
|
5479
5656
|
ref: addOrRemoveColumnsButton.ref,
|
|
5480
5657
|
style: addOrRemoveColumnsButton.style,
|
|
5481
|
-
children: /* @__PURE__ */
|
|
5658
|
+
children: /* @__PURE__ */ jsx25(
|
|
5482
5659
|
ExtendButton,
|
|
5483
5660
|
{
|
|
5484
5661
|
editor,
|
|
@@ -5490,7 +5667,7 @@ function LumirTableHandlesController() {
|
|
|
5490
5667
|
)
|
|
5491
5668
|
}
|
|
5492
5669
|
),
|
|
5493
|
-
tableCorner.isMounted && /* @__PURE__ */
|
|
5670
|
+
tableCorner.isMounted && /* @__PURE__ */ jsx25(
|
|
5494
5671
|
"div",
|
|
5495
5672
|
{
|
|
5496
5673
|
ref: tableCorner.ref,
|
|
@@ -6243,7 +6420,7 @@ function applyFittedWidthsToNewTables(editor, beforeIds, perTable) {
|
|
|
6243
6420
|
}
|
|
6244
6421
|
|
|
6245
6422
|
// src/components/LumirEditor.tsx
|
|
6246
|
-
import { Fragment as Fragment8, jsx as
|
|
6423
|
+
import { Fragment as Fragment8, jsx as jsx26, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
6247
6424
|
var DEBUG_LOG = (loc, msg, data) => {
|
|
6248
6425
|
const p = fetch("http://127.0.0.1:7686/ingest/1f8ee1c5-0cf0-4ae7-91ed-5ea7ed17130a", {
|
|
6249
6426
|
method: "POST",
|
|
@@ -6476,7 +6653,7 @@ var findBlockWithLink = (blocks, targetUrl) => {
|
|
|
6476
6653
|
var ConvertToPreviewButton = ({ url }) => {
|
|
6477
6654
|
const editor = useBlockNoteEditor8();
|
|
6478
6655
|
const Components = useComponentsContext7();
|
|
6479
|
-
return /* @__PURE__ */
|
|
6656
|
+
return /* @__PURE__ */ jsx26(
|
|
6480
6657
|
Components.LinkToolbar.Button,
|
|
6481
6658
|
{
|
|
6482
6659
|
className: "bn-button",
|
|
@@ -6496,9 +6673,9 @@ var ConvertToPreviewButton = ({ url }) => {
|
|
|
6496
6673
|
}
|
|
6497
6674
|
},
|
|
6498
6675
|
icon: /* @__PURE__ */ jsxs19("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
6499
|
-
/* @__PURE__ */
|
|
6500
|
-
/* @__PURE__ */
|
|
6501
|
-
/* @__PURE__ */
|
|
6676
|
+
/* @__PURE__ */ jsx26("rect", { x: "1", y: "3", width: "14", height: "10", rx: "2", stroke: "currentColor", strokeWidth: "1.5", fill: "none" }),
|
|
6677
|
+
/* @__PURE__ */ jsx26("line", { x1: "1", y1: "9", x2: "15", y2: "9", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
6678
|
+
/* @__PURE__ */ jsx26("circle", { cx: "5", cy: "6.5", r: "1.5", stroke: "currentColor", strokeWidth: "1", fill: "none" })
|
|
6502
6679
|
] })
|
|
6503
6680
|
}
|
|
6504
6681
|
);
|
|
@@ -6514,10 +6691,10 @@ var CustomLinkToolbar = (props) => {
|
|
|
6514
6691
|
onMouseEnter: props.stopHideTimer,
|
|
6515
6692
|
onMouseLeave: props.startHideTimer,
|
|
6516
6693
|
children: [
|
|
6517
|
-
/* @__PURE__ */
|
|
6518
|
-
/* @__PURE__ */
|
|
6519
|
-
/* @__PURE__ */
|
|
6520
|
-
hasLinkPreview && /* @__PURE__ */
|
|
6694
|
+
/* @__PURE__ */ jsx26(EditLinkButton, { url: props.url, text: props.text, editLink: props.editLink }),
|
|
6695
|
+
/* @__PURE__ */ jsx26(OpenLinkButton, { url: props.url }),
|
|
6696
|
+
/* @__PURE__ */ jsx26(DeleteLinkButton, { deleteLink: props.deleteLink }),
|
|
6697
|
+
hasLinkPreview && /* @__PURE__ */ jsx26(ConvertToPreviewButton, { url: props.url })
|
|
6521
6698
|
]
|
|
6522
6699
|
}
|
|
6523
6700
|
);
|
|
@@ -6600,7 +6777,7 @@ function LumirEditor({
|
|
|
6600
6777
|
allowFileUpload
|
|
6601
6778
|
);
|
|
6602
6779
|
}, [disableExtensions, allowVideoUpload, allowAudioUpload, allowFileUpload]);
|
|
6603
|
-
|
|
6780
|
+
useEffect12(() => {
|
|
6604
6781
|
DEBUG_LOG("LumirEditor:init:disabledExtensions", "snapshot", {
|
|
6605
6782
|
allowVideoUpload,
|
|
6606
6783
|
hasVideoInDisabled: disabledExtensions.includes("video"),
|
|
@@ -6608,7 +6785,7 @@ function LumirEditor({
|
|
|
6608
6785
|
});
|
|
6609
6786
|
}, [allowVideoUpload, disabledExtensions]);
|
|
6610
6787
|
const fileNameTransformRef = useRef12(s3Upload?.fileNameTransform);
|
|
6611
|
-
|
|
6788
|
+
useEffect12(() => {
|
|
6612
6789
|
fileNameTransformRef.current = s3Upload?.fileNameTransform;
|
|
6613
6790
|
}, [s3Upload?.fileNameTransform]);
|
|
6614
6791
|
const memoizedS3Upload = useMemo8(() => {
|
|
@@ -6871,12 +7048,12 @@ function LumirEditor({
|
|
|
6871
7048
|
} catch {
|
|
6872
7049
|
}
|
|
6873
7050
|
}
|
|
6874
|
-
|
|
7051
|
+
useEffect12(() => {
|
|
6875
7052
|
if (editor) {
|
|
6876
7053
|
editor.isEditable = editable;
|
|
6877
7054
|
}
|
|
6878
7055
|
}, [editor, editable]);
|
|
6879
|
-
|
|
7056
|
+
useEffect12(() => {
|
|
6880
7057
|
if (!editor) return;
|
|
6881
7058
|
const th = editor.tableHandles;
|
|
6882
7059
|
if (!th || th.__lumirColDelPatched || typeof th.removeRowOrColumn !== "function")
|
|
@@ -6888,7 +7065,7 @@ function LumirEditor({
|
|
|
6888
7065
|
};
|
|
6889
7066
|
th.__lumirColDelPatched = true;
|
|
6890
7067
|
}, [editor]);
|
|
6891
|
-
|
|
7068
|
+
useEffect12(() => {
|
|
6892
7069
|
if (!editor || !floatingMenu) return;
|
|
6893
7070
|
const ft = editor.formattingToolbar;
|
|
6894
7071
|
if (!ft?.onUpdate) return;
|
|
@@ -6901,7 +7078,7 @@ function LumirEditor({
|
|
|
6901
7078
|
});
|
|
6902
7079
|
return unsubscribe;
|
|
6903
7080
|
}, [editor, floatingMenu]);
|
|
6904
|
-
|
|
7081
|
+
useEffect12(() => {
|
|
6905
7082
|
if (!editor || !onContentChange) return;
|
|
6906
7083
|
const handleContentChange = () => {
|
|
6907
7084
|
const blocks = editor.topLevelBlocks;
|
|
@@ -6919,12 +7096,12 @@ function LumirEditor({
|
|
|
6919
7096
|
return editor.onEditorContentChange(handleContentChange);
|
|
6920
7097
|
}, [editor, onContentChange]);
|
|
6921
7098
|
const previousMediaUrlsRef = useRef12(/* @__PURE__ */ new Set());
|
|
6922
|
-
|
|
7099
|
+
useEffect12(() => {
|
|
6923
7100
|
if (!editor) return;
|
|
6924
7101
|
const initialBlocks = editor.topLevelBlocks;
|
|
6925
7102
|
previousMediaUrlsRef.current = extractMediaUrls(initialBlocks);
|
|
6926
7103
|
}, [editor]);
|
|
6927
|
-
|
|
7104
|
+
useEffect12(() => {
|
|
6928
7105
|
if (!editor || !onImageDelete) return;
|
|
6929
7106
|
const handleMediaDeleteCheck = () => {
|
|
6930
7107
|
const currentBlocks = editor.topLevelBlocks;
|
|
@@ -6938,7 +7115,7 @@ function LumirEditor({
|
|
|
6938
7115
|
};
|
|
6939
7116
|
return editor.onEditorContentChange(handleMediaDeleteCheck);
|
|
6940
7117
|
}, [editor, onImageDelete]);
|
|
6941
|
-
|
|
7118
|
+
useEffect12(() => {
|
|
6942
7119
|
const el = editor?.domElement;
|
|
6943
7120
|
if (!el) return;
|
|
6944
7121
|
const handleDragOver = (e) => {
|
|
@@ -7073,7 +7250,7 @@ function LumirEditor({
|
|
|
7073
7250
|
return sideMenuAddButton ? sideMenu : false;
|
|
7074
7251
|
}, [sideMenuAddButton, sideMenu]);
|
|
7075
7252
|
const DragHandleOnlySideMenu = useMemo8(() => {
|
|
7076
|
-
return (props) => /* @__PURE__ */
|
|
7253
|
+
return (props) => /* @__PURE__ */ jsx26(BlockSideMenu, { ...props, children: /* @__PURE__ */ jsx26(DragHandleButton, { ...props, dragHandleMenu: LumirDragHandleMenu }) });
|
|
7077
7254
|
}, []);
|
|
7078
7255
|
return /* @__PURE__ */ jsxs19(
|
|
7079
7256
|
"div",
|
|
@@ -7086,7 +7263,7 @@ function LumirEditor({
|
|
|
7086
7263
|
style: { position: "relative", display: "flex", flexDirection: "column" },
|
|
7087
7264
|
children: [
|
|
7088
7265
|
floatingMenu && editor && /* @__PURE__ */ jsxs19(Fragment8, { children: [
|
|
7089
|
-
/* @__PURE__ */
|
|
7266
|
+
/* @__PURE__ */ jsx26(
|
|
7090
7267
|
"input",
|
|
7091
7268
|
{
|
|
7092
7269
|
ref: floatingMenuFileInputRef,
|
|
@@ -7157,7 +7334,7 @@ function LumirEditor({
|
|
|
7157
7334
|
}
|
|
7158
7335
|
}
|
|
7159
7336
|
),
|
|
7160
|
-
/* @__PURE__ */
|
|
7337
|
+
/* @__PURE__ */ jsx26(
|
|
7161
7338
|
FloatingMenu,
|
|
7162
7339
|
{
|
|
7163
7340
|
editor,
|
|
@@ -7204,15 +7381,15 @@ function LumirEditor({
|
|
|
7204
7381
|
tableHandles: false,
|
|
7205
7382
|
onSelectionChange,
|
|
7206
7383
|
children: [
|
|
7207
|
-
tableHandles && /* @__PURE__ */
|
|
7208
|
-
formattingToolbar && /* @__PURE__ */
|
|
7384
|
+
tableHandles && /* @__PURE__ */ jsx26(LumirTableHandlesController, {}),
|
|
7385
|
+
formattingToolbar && /* @__PURE__ */ jsx26(
|
|
7209
7386
|
FormattingToolbarController,
|
|
7210
7387
|
{
|
|
7211
7388
|
formattingToolbar: CustomFormattingToolbar
|
|
7212
7389
|
}
|
|
7213
7390
|
),
|
|
7214
|
-
linkToolbar && (linkPreview?.apiEndpoint ? /* @__PURE__ */
|
|
7215
|
-
/* @__PURE__ */
|
|
7391
|
+
linkToolbar && (linkPreview?.apiEndpoint ? /* @__PURE__ */ jsx26(LinkToolbarController, { linkToolbar: CustomLinkToolbar }) : /* @__PURE__ */ jsx26(LinkToolbarController, {})),
|
|
7392
|
+
/* @__PURE__ */ jsx26(
|
|
7216
7393
|
SuggestionMenuController,
|
|
7217
7394
|
{
|
|
7218
7395
|
triggerCharacter: "/",
|
|
@@ -7272,8 +7449,8 @@ function LumirEditor({
|
|
|
7272
7449
|
strokeLinecap: "round",
|
|
7273
7450
|
strokeLinejoin: "round",
|
|
7274
7451
|
children: [
|
|
7275
|
-
/* @__PURE__ */
|
|
7276
|
-
/* @__PURE__ */
|
|
7452
|
+
/* @__PURE__ */ jsx26("polyline", { points: "16 18 22 12 16 6" }),
|
|
7453
|
+
/* @__PURE__ */ jsx26("polyline", { points: "8 6 2 12 8 18" })
|
|
7277
7454
|
]
|
|
7278
7455
|
}
|
|
7279
7456
|
),
|
|
@@ -7291,9 +7468,9 @@ function LumirEditor({
|
|
|
7291
7468
|
strokeLinecap: "round",
|
|
7292
7469
|
strokeLinejoin: "round",
|
|
7293
7470
|
children: [
|
|
7294
|
-
/* @__PURE__ */
|
|
7295
|
-
/* @__PURE__ */
|
|
7296
|
-
withDivider && /* @__PURE__ */
|
|
7471
|
+
/* @__PURE__ */ jsx26("rect", { x: "3", y: "4", width: "7", height: "16", rx: "1" }),
|
|
7472
|
+
/* @__PURE__ */ jsx26("rect", { x: "14", y: "4", width: "7", height: "16", rx: "1" }),
|
|
7473
|
+
withDivider && /* @__PURE__ */ jsx26("line", { x1: "12", y1: "3", x2: "12", y2: "21", strokeDasharray: "2 2" })
|
|
7297
7474
|
]
|
|
7298
7475
|
}
|
|
7299
7476
|
);
|
|
@@ -7355,8 +7532,8 @@ function LumirEditor({
|
|
|
7355
7532
|
strokeLinecap: "round",
|
|
7356
7533
|
strokeLinejoin: "round",
|
|
7357
7534
|
children: [
|
|
7358
|
-
/* @__PURE__ */
|
|
7359
|
-
/* @__PURE__ */
|
|
7535
|
+
/* @__PURE__ */ jsx26("path", { d: "M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71" }),
|
|
7536
|
+
/* @__PURE__ */ jsx26("path", { d: "M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71" })
|
|
7360
7537
|
]
|
|
7361
7538
|
}
|
|
7362
7539
|
),
|
|
@@ -7392,21 +7569,21 @@ function LumirEditor({
|
|
|
7392
7569
|
)
|
|
7393
7570
|
}
|
|
7394
7571
|
),
|
|
7395
|
-
!sideMenuAddButton && /* @__PURE__ */
|
|
7572
|
+
!sideMenuAddButton && /* @__PURE__ */ jsx26(SideMenuController, { sideMenu: DragHandleOnlySideMenu })
|
|
7396
7573
|
]
|
|
7397
7574
|
}
|
|
7398
7575
|
),
|
|
7399
7576
|
isUploading && /* @__PURE__ */ jsxs19("div", { className: "lumirEditor-upload-overlay", children: [
|
|
7400
|
-
/* @__PURE__ */
|
|
7577
|
+
/* @__PURE__ */ jsx26("div", { className: "lumirEditor-spinner" }),
|
|
7401
7578
|
uploadProgress !== null && /* @__PURE__ */ jsxs19("span", { className: "lumirEditor-upload-progress", children: [
|
|
7402
7579
|
uploadProgress,
|
|
7403
7580
|
"%"
|
|
7404
7581
|
] })
|
|
7405
7582
|
] }),
|
|
7406
7583
|
errorMessage && /* @__PURE__ */ jsxs19("div", { className: "lumirEditor-error-toast", children: [
|
|
7407
|
-
/* @__PURE__ */
|
|
7408
|
-
/* @__PURE__ */
|
|
7409
|
-
/* @__PURE__ */
|
|
7584
|
+
/* @__PURE__ */ jsx26("span", { className: "lumirEditor-error-icon", children: "\u26A0\uFE0F" }),
|
|
7585
|
+
/* @__PURE__ */ jsx26("span", { className: "lumirEditor-error-message", children: errorMessage }),
|
|
7586
|
+
/* @__PURE__ */ jsx26(
|
|
7410
7587
|
"button",
|
|
7411
7588
|
{
|
|
7412
7589
|
className: "lumirEditor-error-close",
|
|
@@ -7424,7 +7601,11 @@ export {
|
|
|
7424
7601
|
BACKGROUND_COLORS,
|
|
7425
7602
|
ContentUtils,
|
|
7426
7603
|
EditorConfig,
|
|
7604
|
+
FONT_SIZE_DEFAULT_PX,
|
|
7605
|
+
FONT_SIZE_MAX,
|
|
7606
|
+
FONT_SIZE_MIN,
|
|
7427
7607
|
FONT_SIZE_PRESETS,
|
|
7608
|
+
FONT_SIZE_STEP,
|
|
7428
7609
|
FloatingMenu,
|
|
7429
7610
|
FontSize,
|
|
7430
7611
|
FontSizeButton2 as FontSizeButton,
|
|
@@ -7434,12 +7615,15 @@ export {
|
|
|
7434
7615
|
LumirEditor,
|
|
7435
7616
|
LumirEditorError,
|
|
7436
7617
|
TEXT_COLORS,
|
|
7618
|
+
clampFontSizePx,
|
|
7437
7619
|
clearMetadataCache,
|
|
7438
7620
|
cn,
|
|
7439
7621
|
createS3Uploader,
|
|
7440
7622
|
fetchLinkMetadata,
|
|
7441
7623
|
getHexFromColorValue,
|
|
7442
7624
|
liftFontSize,
|
|
7443
|
-
lowerFontSize
|
|
7625
|
+
lowerFontSize,
|
|
7626
|
+
parseFontSizePx,
|
|
7627
|
+
toFontSizeValue
|
|
7444
7628
|
};
|
|
7445
7629
|
//# sourceMappingURL=index.mjs.map
|