reactjs-tiptap-editor 0.0.26 → 0.0.28
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/lib/index.d.cts +41 -41
- package/lib/index.d.ts +41 -41
- package/lib/locales-BW5KWG4_.cjs +2 -0
- package/lib/locales-BW5KWG4_.cjs.map +1 -0
- package/lib/locales-CReRRAlY.js +711 -0
- package/lib/locales-CReRRAlY.js.map +1 -0
- package/lib/radix-BnsE5jjU.cjs +2 -0
- package/lib/radix-BnsE5jjU.cjs.map +1 -0
- package/lib/radix-DynsTgIE.js +3104 -0
- package/lib/radix-DynsTgIE.js.map +1 -0
- package/lib/reactjs-tiptap-editor.cjs +1 -135
- package/lib/reactjs-tiptap-editor.cjs.map +1 -1
- package/lib/reactjs-tiptap-editor.js +144 -11474
- package/lib/reactjs-tiptap-editor.js.map +1 -1
- package/lib/tiptap-CMeHtctt.cjs +117 -0
- package/lib/tiptap-CMeHtctt.cjs.map +1 -0
- package/lib/tiptap-oijPpdck.js +5884 -0
- package/lib/tiptap-oijPpdck.js.map +1 -0
- package/lib/utils-B4dNn5Nv.js +10776 -0
- package/lib/utils-B4dNn5Nv.js.map +1 -0
- package/lib/utils-Bvt21Jwu.cjs +136 -0
- package/lib/utils-Bvt21Jwu.cjs.map +1 -0
- package/lib/vendor-Btqs8WA3.cjs +453 -0
- package/lib/vendor-Btqs8WA3.cjs.map +1 -0
- package/lib/vendor-CCqRdwcC.js +27904 -0
- package/lib/vendor-CCqRdwcC.js.map +1 -0
- package/package.json +55 -54
- package/lib/vendor-BfS5bQGj.cjs +0 -596
- package/lib/vendor-BfS5bQGj.cjs.map +0 -1
- package/lib/vendor-DNe_eTW3.js +0 -49712
- package/lib/vendor-DNe_eTW3.js.map +0 -1
package/lib/index.d.cts
CHANGED
|
@@ -1709,6 +1709,16 @@ declare module '@tiptap/core' {
|
|
|
1709
1709
|
}
|
|
1710
1710
|
|
|
1711
1711
|
|
|
1712
|
+
declare module '@tiptap/core' {
|
|
1713
|
+
interface Commands<ReturnType> {
|
|
1714
|
+
lineHeight: {
|
|
1715
|
+
setLineHeight: (lineHeight: string) => ReturnType;
|
|
1716
|
+
unsetLineHeight: () => ReturnType;
|
|
1717
|
+
};
|
|
1718
|
+
}
|
|
1719
|
+
}
|
|
1720
|
+
|
|
1721
|
+
|
|
1712
1722
|
declare module '@tiptap/core' {
|
|
1713
1723
|
interface Commands<ReturnType> {
|
|
1714
1724
|
imageResize: {
|
|
@@ -1743,9 +1753,8 @@ declare module '@tiptap/core' {
|
|
|
1743
1753
|
|
|
1744
1754
|
declare module '@tiptap/core' {
|
|
1745
1755
|
interface Commands<ReturnType> {
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
unsetLineHeight: () => ReturnType;
|
|
1756
|
+
imageUpload: {
|
|
1757
|
+
setImageUpload: () => ReturnType;
|
|
1749
1758
|
};
|
|
1750
1759
|
}
|
|
1751
1760
|
}
|
|
@@ -1753,8 +1762,8 @@ declare module '@tiptap/core' {
|
|
|
1753
1762
|
|
|
1754
1763
|
declare module '@tiptap/core' {
|
|
1755
1764
|
interface Commands<ReturnType> {
|
|
1756
|
-
|
|
1757
|
-
|
|
1765
|
+
videoUpload: {
|
|
1766
|
+
setVideoUpload: () => ReturnType;
|
|
1758
1767
|
};
|
|
1759
1768
|
}
|
|
1760
1769
|
}
|
|
@@ -1772,8 +1781,14 @@ declare module '@tiptap/core' {
|
|
|
1772
1781
|
|
|
1773
1782
|
declare module '@tiptap/core' {
|
|
1774
1783
|
interface Commands<ReturnType> {
|
|
1775
|
-
|
|
1776
|
-
|
|
1784
|
+
iframe: {
|
|
1785
|
+
/**
|
|
1786
|
+
* Add an iframe
|
|
1787
|
+
*/
|
|
1788
|
+
setIframe: (options: {
|
|
1789
|
+
src: string;
|
|
1790
|
+
service: string;
|
|
1791
|
+
}) => ReturnType;
|
|
1777
1792
|
};
|
|
1778
1793
|
}
|
|
1779
1794
|
}
|
|
@@ -1795,28 +1810,8 @@ declare module '@tiptap/core' {
|
|
|
1795
1810
|
|
|
1796
1811
|
declare module '@tiptap/core' {
|
|
1797
1812
|
interface Commands<ReturnType> {
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
* Add an iframe
|
|
1801
|
-
*/
|
|
1802
|
-
setIframe: (options: {
|
|
1803
|
-
src: string;
|
|
1804
|
-
service: string;
|
|
1805
|
-
}) => ReturnType;
|
|
1806
|
-
};
|
|
1807
|
-
}
|
|
1808
|
-
}
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
declare module '@tiptap/core' {
|
|
1812
|
-
interface Commands<ReturnType> {
|
|
1813
|
-
search: {
|
|
1814
|
-
setSearchTerm: (searchTerm: string) => ReturnType;
|
|
1815
|
-
setReplaceTerm: (replaceTerm: string) => ReturnType;
|
|
1816
|
-
replace: () => ReturnType;
|
|
1817
|
-
replaceAll: () => ReturnType;
|
|
1818
|
-
goToPrevSearchResult: () => void;
|
|
1819
|
-
goToNextSearchResult: () => void;
|
|
1813
|
+
painter: {
|
|
1814
|
+
setPainter: (marks: Mark[]) => ReturnType;
|
|
1820
1815
|
};
|
|
1821
1816
|
}
|
|
1822
1817
|
}
|
|
@@ -1824,8 +1819,8 @@ declare module '@tiptap/core' {
|
|
|
1824
1819
|
|
|
1825
1820
|
declare module '@tiptap/core' {
|
|
1826
1821
|
interface Commands<ReturnType> {
|
|
1827
|
-
|
|
1828
|
-
|
|
1822
|
+
katex: {
|
|
1823
|
+
setKatex: (arg?: IKatexAttrs) => ReturnType;
|
|
1829
1824
|
};
|
|
1830
1825
|
}
|
|
1831
1826
|
}
|
|
@@ -1833,11 +1828,13 @@ declare module '@tiptap/core' {
|
|
|
1833
1828
|
|
|
1834
1829
|
declare module '@tiptap/core' {
|
|
1835
1830
|
interface Commands<ReturnType> {
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1831
|
+
search: {
|
|
1832
|
+
setSearchTerm: (searchTerm: string) => ReturnType;
|
|
1833
|
+
setReplaceTerm: (replaceTerm: string) => ReturnType;
|
|
1834
|
+
replace: () => ReturnType;
|
|
1835
|
+
replaceAll: () => ReturnType;
|
|
1836
|
+
goToPrevSearchResult: () => void;
|
|
1837
|
+
goToNextSearchResult: () => void;
|
|
1841
1838
|
};
|
|
1842
1839
|
}
|
|
1843
1840
|
}
|
|
@@ -1845,8 +1842,9 @@ declare module '@tiptap/core' {
|
|
|
1845
1842
|
|
|
1846
1843
|
declare module '@tiptap/core' {
|
|
1847
1844
|
interface Commands<ReturnType> {
|
|
1848
|
-
|
|
1849
|
-
|
|
1845
|
+
tableOfContents: {
|
|
1846
|
+
setTableOfContents: () => ReturnType;
|
|
1847
|
+
removeTableOfContents: () => ReturnType;
|
|
1850
1848
|
};
|
|
1851
1849
|
}
|
|
1852
1850
|
}
|
|
@@ -1863,9 +1861,11 @@ declare module '@tiptap/core' {
|
|
|
1863
1861
|
|
|
1864
1862
|
declare module '@tiptap/core' {
|
|
1865
1863
|
interface Commands<ReturnType> {
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1864
|
+
emoji: {
|
|
1865
|
+
setEmoji: (emoji: {
|
|
1866
|
+
name: string;
|
|
1867
|
+
emoji: string;
|
|
1868
|
+
}) => ReturnType;
|
|
1869
1869
|
};
|
|
1870
1870
|
}
|
|
1871
1871
|
}
|
package/lib/index.d.ts
CHANGED
|
@@ -1709,6 +1709,16 @@ declare module '@tiptap/core' {
|
|
|
1709
1709
|
}
|
|
1710
1710
|
|
|
1711
1711
|
|
|
1712
|
+
declare module '@tiptap/core' {
|
|
1713
|
+
interface Commands<ReturnType> {
|
|
1714
|
+
lineHeight: {
|
|
1715
|
+
setLineHeight: (lineHeight: string) => ReturnType;
|
|
1716
|
+
unsetLineHeight: () => ReturnType;
|
|
1717
|
+
};
|
|
1718
|
+
}
|
|
1719
|
+
}
|
|
1720
|
+
|
|
1721
|
+
|
|
1712
1722
|
declare module '@tiptap/core' {
|
|
1713
1723
|
interface Commands<ReturnType> {
|
|
1714
1724
|
imageResize: {
|
|
@@ -1743,9 +1753,8 @@ declare module '@tiptap/core' {
|
|
|
1743
1753
|
|
|
1744
1754
|
declare module '@tiptap/core' {
|
|
1745
1755
|
interface Commands<ReturnType> {
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
unsetLineHeight: () => ReturnType;
|
|
1756
|
+
imageUpload: {
|
|
1757
|
+
setImageUpload: () => ReturnType;
|
|
1749
1758
|
};
|
|
1750
1759
|
}
|
|
1751
1760
|
}
|
|
@@ -1753,8 +1762,8 @@ declare module '@tiptap/core' {
|
|
|
1753
1762
|
|
|
1754
1763
|
declare module '@tiptap/core' {
|
|
1755
1764
|
interface Commands<ReturnType> {
|
|
1756
|
-
|
|
1757
|
-
|
|
1765
|
+
videoUpload: {
|
|
1766
|
+
setVideoUpload: () => ReturnType;
|
|
1758
1767
|
};
|
|
1759
1768
|
}
|
|
1760
1769
|
}
|
|
@@ -1772,8 +1781,14 @@ declare module '@tiptap/core' {
|
|
|
1772
1781
|
|
|
1773
1782
|
declare module '@tiptap/core' {
|
|
1774
1783
|
interface Commands<ReturnType> {
|
|
1775
|
-
|
|
1776
|
-
|
|
1784
|
+
iframe: {
|
|
1785
|
+
/**
|
|
1786
|
+
* Add an iframe
|
|
1787
|
+
*/
|
|
1788
|
+
setIframe: (options: {
|
|
1789
|
+
src: string;
|
|
1790
|
+
service: string;
|
|
1791
|
+
}) => ReturnType;
|
|
1777
1792
|
};
|
|
1778
1793
|
}
|
|
1779
1794
|
}
|
|
@@ -1795,28 +1810,8 @@ declare module '@tiptap/core' {
|
|
|
1795
1810
|
|
|
1796
1811
|
declare module '@tiptap/core' {
|
|
1797
1812
|
interface Commands<ReturnType> {
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
* Add an iframe
|
|
1801
|
-
*/
|
|
1802
|
-
setIframe: (options: {
|
|
1803
|
-
src: string;
|
|
1804
|
-
service: string;
|
|
1805
|
-
}) => ReturnType;
|
|
1806
|
-
};
|
|
1807
|
-
}
|
|
1808
|
-
}
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
declare module '@tiptap/core' {
|
|
1812
|
-
interface Commands<ReturnType> {
|
|
1813
|
-
search: {
|
|
1814
|
-
setSearchTerm: (searchTerm: string) => ReturnType;
|
|
1815
|
-
setReplaceTerm: (replaceTerm: string) => ReturnType;
|
|
1816
|
-
replace: () => ReturnType;
|
|
1817
|
-
replaceAll: () => ReturnType;
|
|
1818
|
-
goToPrevSearchResult: () => void;
|
|
1819
|
-
goToNextSearchResult: () => void;
|
|
1813
|
+
painter: {
|
|
1814
|
+
setPainter: (marks: Mark[]) => ReturnType;
|
|
1820
1815
|
};
|
|
1821
1816
|
}
|
|
1822
1817
|
}
|
|
@@ -1824,8 +1819,8 @@ declare module '@tiptap/core' {
|
|
|
1824
1819
|
|
|
1825
1820
|
declare module '@tiptap/core' {
|
|
1826
1821
|
interface Commands<ReturnType> {
|
|
1827
|
-
|
|
1828
|
-
|
|
1822
|
+
katex: {
|
|
1823
|
+
setKatex: (arg?: IKatexAttrs) => ReturnType;
|
|
1829
1824
|
};
|
|
1830
1825
|
}
|
|
1831
1826
|
}
|
|
@@ -1833,11 +1828,13 @@ declare module '@tiptap/core' {
|
|
|
1833
1828
|
|
|
1834
1829
|
declare module '@tiptap/core' {
|
|
1835
1830
|
interface Commands<ReturnType> {
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1831
|
+
search: {
|
|
1832
|
+
setSearchTerm: (searchTerm: string) => ReturnType;
|
|
1833
|
+
setReplaceTerm: (replaceTerm: string) => ReturnType;
|
|
1834
|
+
replace: () => ReturnType;
|
|
1835
|
+
replaceAll: () => ReturnType;
|
|
1836
|
+
goToPrevSearchResult: () => void;
|
|
1837
|
+
goToNextSearchResult: () => void;
|
|
1841
1838
|
};
|
|
1842
1839
|
}
|
|
1843
1840
|
}
|
|
@@ -1845,8 +1842,9 @@ declare module '@tiptap/core' {
|
|
|
1845
1842
|
|
|
1846
1843
|
declare module '@tiptap/core' {
|
|
1847
1844
|
interface Commands<ReturnType> {
|
|
1848
|
-
|
|
1849
|
-
|
|
1845
|
+
tableOfContents: {
|
|
1846
|
+
setTableOfContents: () => ReturnType;
|
|
1847
|
+
removeTableOfContents: () => ReturnType;
|
|
1850
1848
|
};
|
|
1851
1849
|
}
|
|
1852
1850
|
}
|
|
@@ -1863,9 +1861,11 @@ declare module '@tiptap/core' {
|
|
|
1863
1861
|
|
|
1864
1862
|
declare module '@tiptap/core' {
|
|
1865
1863
|
interface Commands<ReturnType> {
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1864
|
+
emoji: {
|
|
1865
|
+
setEmoji: (emoji: {
|
|
1866
|
+
name: string;
|
|
1867
|
+
emoji: string;
|
|
1868
|
+
}) => ReturnType;
|
|
1869
1869
|
};
|
|
1870
1870
|
}
|
|
1871
1871
|
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var T=Object.defineProperty;var f=(e,t,o)=>t in e?T(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o;var n=(e,t,o)=>f(e,typeof t!="symbol"?t+"":t,o);const p=require("react"),F=require("./utils-Bvt21Jwu.cjs"),s=require("./vendor-Btqs8WA3.cjs"),g="en",m=200,E=m-80,A=20,C=1e5,L=16,k=10,D=10,I=2,x="#262626",v=["#000000","#262626","#595959","#8C8C8C","#BFBFBF","#D9D9D9","#E9E9E9","#F5F5F5","#FAFAFA","#FFFFFF","#F5222D","#FA541C","#FA8C16","#FADB14","#52C41A","#13C2C2","#1890FF","#2F54EB","#722ED1","#EB2F96","#FFE8E6","#FFECE0","#FFEFD1","#FCFCCA","#E4F7D2","#D3F5F0","#D4EEFC","#DEE8FC","#EFE1FA","#FAE1EB","#FFA39E","#FFBB96","#FFD591","#FFFB8F","#B7EB8F","#87E8DE","#91D5FF","#ADC6FF","#D3ADF7","#FFADD2","#FF4D4F","#FF7A45","#FFA940","#FFEC3D","#73D13D","#36CFC9","#40A9FF","#597EF7","#9254DE","#F759AB","#CF1322","#D4380D","#D46B08","#D4B106","#389E0D","#08979C","#096DD9","#1D39C4","#531DAB","#C41D7F","#820014","#871400","#873800","#614700","#135200","#00474F","#003A8C","#061178","#22075E","#780650"],S=["Inter","Comic Sans MS, Comic Sans","serif","monospace","cursive"],y=["html","css","js","ts"],B={html:"HTML",css:"CSS",js:"JavaScript",ts:"TypeScript"},R=["10px","11px","12px","14px","16px","18px","20px","22px","24px","26px","28px","36px","48px","72px"],U="default";var u=(e=>(e[e["size-small"]=200]="size-small",e[e["size-medium"]=500]="size-medium",e["size-large"]="100%",e))(u||{}),c=(e=>(e[e["size-small"]=480]="size-small",e[e["size-medium"]=640]="size-medium",e["size-large"]="100%",e))(c||{});const N=["100%","115%","150%","200%","250%","300%"],w=1.7,M="1",z={image:["divider","image-size-small","image-size-medium","image-size-large","divider","image-left","image-center","image-right","divider","image-aspect-ratio","remove"],text:["divider","text-bubble","divider","bold","italic","underline","strike","code","link","divider","color","highlight","textAlign"],video:["video-size-small","video-size-medium","video-size-large","divider","remove"],table:["removeTable"]},H=["bold","italic","underline","strike","code","link","divider","color","highlight","textAlign"],O={"editor.remove":"Remove","editor.copy":"Copy","editor.words":"WORDS","editor.characters":"CHARACTERS","editor.default":"Default","editor.recent":"Recently Used","editor.nofill":"No Fill","editor.format":"Format Painter","editor.table_of_content":"Table of Content","editor.draghandle.tooltip":"Modify","editor.copyToClipboard":"CopyToClipboard","editor.importWord.tooltip":"Import Word","editor.slash":"Press '/' for commands","editor.slash.empty":"No Result","editor.slash.format":"Format","editor.slash.insert":"Insert","editor.slash.embed":"Embed Services","editor.content":"Please input content","editor.fontFamily.tooltip":"Font Family","editor.fontFamily.default.tooltip":"Default","editor.moremark":"More Text Styles","editor.size.small.tooltip":"Small","editor.size.medium.tooltip":"Medium","editor.size.large.tooltip":"Cover","editor.bold.tooltip":"Bold","editor.italic.tooltip":"Italic","editor.underline.tooltip":"Underline","editor.strike.tooltip":"Strike","editor.color.tooltip":"Color","editor.color.more":"More Colors","editor.highlight.tooltip":"Highlight","editor.lineheight.tooltip":"Line Height","editor.heading.tooltip":"Headings","editor.heading.h1.tooltip":"Heading 1","editor.heading.h2.tooltip":"Heading 2","editor.heading.h3.tooltip":"Heading 3","editor.heading.h4.tooltip":"Heading 4","editor.heading.h5.tooltip":"Heading 5","editor.heading.h6.tooltip":"Heading 6","editor.paragraph.tooltip":"Paragraph","editor.textalign.tooltip":"Align","editor.textalign.left.tooltip":"Left","editor.textalign.center.tooltip":"Center","editor.textalign.right.tooltip":"Right","editor.textalign.justify.tooltip":"Justify","editor.indent":"Indent","editor.indent.indent":"Increase Indent","editor.indent.outdent":"Decrease Indent","editor.fontSize.tooltip":"Font size","editor.fontSize.default.tooltip":"Default","editor.superscript.tooltip":"Superscript","editor.subscript.tooltip":"Subscript","editor.bulletlist.tooltip":"Bullet List","editor.orderedlist.tooltip":"Ordered List","editor.tasklist.tooltip":"Task List","editor.indent.tooltip":"Indent","editor.outdent.tooltip":"Outdent","editor.columns.tooltip":"Columns","editor.link.tooltip":"Link","editor.link.unlink.tooltip":"UnLink","editor.link.open.tooltip":"Open Link","editor.link.edit.tooltip":"Edit Link","editor.link.dialog.title":"Insert Link","editor.link.dialog.link":"Link","editor.link.dialog.text":"Text","editor.link.dialog.openInNewTab":"Open In New Tab","editor.link.dialog.link.placeholder":"Link Address","editor.link.dialog.text.placeholder":"Add Description","editor.link.dialog.button.apply":"Apply","editor.image.tooltip":"Image","editor.image.dragger.tooltip":"Click or drag the image to the area to upload","editor.image.float.left.tooltip":"Float left","editor.image.float.none.tooltip":"Float none","editor.image.float.right.tooltip":"Float right","editor.image.dialog.title":"Add an image","editor.image.dialog.tab.url":"Url","editor.image.dialog.tab.upload":"Upload","editor.image.dialog.uploading":"Uploading","editor.image.dialog.form.link":"Link","editor.image.dialog.placeholder":"Link","editor.image.dialog.form.alt":"Alt","editor.image.dialog.form.aspectRatio":"Lock original aspect ratio","editor.image.dialog.form.file":"File","editor.image.dialog.button.apply":"apply","editor.video.tooltip":"Video","editor.video.dialog.tab.upload":"Upload","editor.video.dialog.uploading":"Uploading","editor.video.dialog.title":"Embed or upload a video","editor.video.dialog.link":"link","editor.video.dialog.placeholder":"Link","editor.video.dialog.button.apply":"apply","editor.table.tooltip":"Table","editor.table.menu.insert_table":"Insert Table","editor.table.menu.insert_table.with_header_row":"With header row","editor.table.menu.add_column_before":"Add Column Before","editor.table.menu.add_column_after":"Add Column After","editor.table.menu.delete_column":"Delete Column","editor.table.menu.add_row_before":"Add Row Before","editor.table.menu.add_row_after":"Add Row After","editor.table.menu.delete_row":"Delete Row","editor.table.menu.merge_or_split_cells":"Merge Or Split Cells","editor.table.menu.delete_table":"Delete Table","editor.blockquote.tooltip":"Blockquote","editor.horizontalrule.tooltip":"Horizontal Rule","editor.code.tooltip":"Code","editor.codeblock.tooltip":"Code Block","editor.clear.tooltip":"Clear Format","editor.undo.tooltip":"Undo","editor.redo.tooltip":"Redo","editor.fullscreen.tooltip.fullscreen":"Fullscreen","editor.fullscreen.tooltip.exit":"Fullscreen Exit","editor.imageUpload.fileTypeNotSupported":"File type not supported","editor.imageUpload.fileSizeTooBig":"File size too big, Maximum size is","editor.table.menu.insertColumnBefore":"Insert Column Before","editor.table.menu.insertColumnAfter":"Insert Column After","editor.table.menu.deleteColumn":"Delete Column","editor.table.menu.insertRowAbove":"Insert Row Above","editor.table.menu.insertRowBelow":"Insert Row Below","editor.table.menu.deleteRow":"Delete Row","editor.table.menu.mergeCells":"Merge Cells","editor.table.menu.splitCells":"Split Cells","editor.table.menu.deleteTable":"Delete Table","editor.table.menu.setCellsBgColor":"Cell Background Color","editor.emoji.tooltip":"Emoji","editor.iframe.tooltip":"Iframe","editor.searchAndReplace.tooltip":"Search and Replace","editor.search.dialog.text":"Search","editor.replace.dialog.text":"Replace","editor.replaceAll.dialog.text":"Replace All","editor.previous.dialog.text":"Previous","editor.next.dialog.text":"Next",no_result_found:"No results found","Smileys & People":"Smileys & People","Animals & Nature":"Animals & Nature","Food & Drink":"Food & Drink",Activity:"Activity","Travel & Places":"Travel & Places",Object:"Objects",Symbol:"Symbols",Flags:"Flags","Frequently used":"Frequently used","editor.formula.dialog.text":"Formula","editor.katex.tooltip":"Math Formula","editor.exportPdf.tooltip":"Export PDF","editor.exportWord.tooltip":"Export Word","editor.importWrod.tooltip":"Import Word"},h=O,G={"editor.remove":"Xóa","editor.copy":"Sao chép","editor.words":"TỪ","editor.characters":"KÝ TỰ","editor.default":"Mặc định","editor.recent":"Đã sử dụng gần đây","editor.nofill":"Không tô","editor.format":"Format Painter","editor.table_of_content":"Mục lục","editor.draghandle.tooltip":"Sửa đổi","editor.copyToClipboard":"CopyToClipboard","editor.importWord.tooltip":"Nhập Word","editor.slash":"Nhấn '/' để biết lệnh","editor.slash.empty":"Không có kết quả","editor.slash.format":"Định dạng","editor.slash.insert":"Chèn","editor.slash.embed":"Dịch vụ nhúng","editor.content":"Vui lòng nhập nội dung","editor.moremark":"Nhiều kiểu văn bản hơn","editor.size.small.tooltip":"Nhỏ","editor.fontFamily.tooltip":"Phông chữ","editor.fontFamily.default.tooltip":"Mặc định","editor.size.medium.tooltip":"Trung bình","editor.size.large.tooltip":"Lớn","editor.bold.tooltip":"Đậm","editor.italic.tooltip":"In nghiêng","editor.underline.tooltip":"Gạch chân","editor.strike.tooltip":"Gạch","editor.color.tooltip":"Màu","editor.color.more":"Nhiều màu hơn","editor.highlight.tooltip":"Đánh dấu","editor.lineheight.tooltip":"Chiều cao dòng","editor.heading.tooltip":"Tiêu đề","editor.heading.h1.tooltip":"Tiêu đề 1","editor.heading.h2.tooltip":"Tiêu đề 2","editor.heading.h3.tooltip":"Tiêu đề 3","editor.heading.h4.tooltip":"Tiêu đề 4","editor.heading.h5.tooltip":"Tiêu đề 5","editor.heading.h6.tooltip":"Tiêu đề 6","editor.paragraph.tooltip":"Đoạn văn","editor.textalign.tooltip":"Căn chỉnh","editor.textalign.left.tooltip":"Trái","editor.textalign.center.tooltip":"Giữa","editor.textalign.right.tooltip":"Phải","editor.textalign.justify.tooltip":"Căn đều","editor.indent":"Thụt lề","editor.indent.indent":"Tăng thụt lề","editor.indent.outdent":"Giảm thụt lề","editor.fontSize.tooltip":"Kích thước phông chữ","editor.fontSize.default.tooltip":"Mặc định","editor.superscript.tooltip":"Chỉ số trên","editor.subscript.tooltip":"Chỉ số dưới","editor.bulletlist.tooltip":"Danh sách dấu đầu dòng","editor.orderedlist.tooltip":"Danh sách có thứ tự","editor.tasklist.tooltip":"Danh sách tác vụ","editor.indent.tooltip":"Tăng thụt lề","editor.outdent.tooltip":"Giảm thụt lề","editor.columns.tooltip":"Cột","editor.link.tooltip":"Liên kết","editor.link.unlink.tooltip":"Hủy liên kết","editor.link.open.tooltip":"Mở liên kết","editor.link.edit.tooltip":"Chỉnh sửa liên kết","editor.link.dialog.title":"Chèn liên kết","editor.link.dialog.link":"Liên kết","editor.link.dialog.text":"Văn bản","editor.link.dialog.openInNewTab":"Mở trong tab mới","editor.link.dialog.link.placeholder":"Địa chỉ liên kết","editor.link.dialog.text.placeholder":"Thêm mô tả","editor.link.dialog.button.apply":"Áp dụng","editor.image.tooltip":"Hình ảnh","editor.image.dragger.tooltip":"Nhấp hoặc kéo hình ảnh đến khu vực để tải lên","editor.image.float.left.tooltip":"Trôi sang trái","editor.image.float.none.tooltip":"Trôi không","editor.image.float.right.tooltip":"Trôi sang phải","editor.image.dialog.title":"Thêm hình ảnh","editor.image.dialog.tab.url":"Url","editor.image.dialog.tab.upload":"Tải lên","editor.image.dialog.uploading":"Đang tải lên","editor.image.dialog.form.link":"Liên kết","editor.image.dialog.placeholder":"Liên kết","editor.image.dialog.form.alt":"Alt","editor.image.dialog.form.aspectRatio":"Khóa tỷ lệ khung hình gốc","editor.image.dialog.form.file":"Tệp","editor.image.dialog.button.apply":"áp dụng","editor.video.tooltip":"Video","editor.video.dialog.tab.upload":"Tải lên","editor.video.dialog.uploading":"Đang tải lên","editor.video.dialog.title":"Nhúng hoặc tải lên video","editor.video.dialog.link":"liên kết","editor.video.dialog.placeholder":"Liên kết","editor.video.dialog.button.apply":"áp dụng","editor.table.tooltip":"Bảng","editor.table.menu.insert_table":"Chèn Bảng","editor.table.menu.insert_table.with_header_row":"Có hàng tiêu đề","editor.table.menu.add_column_before":"Thêm Cột Trước","editor.table.menu.add_column_after":"Thêm Cột Sau","editor.table.menu.delete_column":"Xóa Cột","editor.table.menu.add_row_before":"Thêm Hàng Trước","editor.table.menu.add_row_after":"Thêm Hàng Sau","editor.table.menu.delete_row":"Xóa Hàng","editor.table.menu.merge_or_split_cells":"Gộp Hoặc Tách Ô","editor.table.menu.delete_table":"Xóa Bảng","editor.blockquote.tooltip":"Blockquote","editor.horizontalrule.tooltip":"Quy tắc ngang","editor.code.tooltip":"Mã","editor.codeblock.tooltip":"Khối mã","editor.clear.tooltip":"Xóa định dạng","editor.undo.tooltip":"Hoàn tác","editor.redo.tooltip":"Làm lại","editor.fullscreen.tooltip.fullscreen":"Toàn màn hình","editor.fullscreen.tooltip.exit":"Thoát toàn màn hình","editor.imageUpload.fileTypeNotSupported":"Loại tệp không được hỗ trợ","editor.imageUpload.fileSizeTooBig":"Kích thước tệp quá lớn, Kích thước tối đa là","editor.table.menu.insertColumnBefore":"Chèn cột trước","editor.table.menu.insertColumnAfter":"Chèn cột sau","editor.table.menu.deleteColumn":"Xóa cột","editor.table.menu.insertRowAbove":"Chèn hàng ở trên","editor.table.menu.insertRowBelow":"Chèn hàng ở dưới","editor.table.menu.deleteRow":"Xóa hàng","editor.table.menu.mergeCells":"Gộp các ô","editor.table.menu.splitCells":"Chia ô","editor.table.menu.deleteTable":"Xóa bảng","editor.table.menu.setCellsBgColor":"Màu nền ô","editor.emoji.tooltip":"Biểu tượng","editor.iframe.tooltip":"Iframe","editor.searchAndReplace.tooltip":"Tìm kiếm và thay thế","editor.search.dialog.text":"Tìm kiếm","editor.replace.dialog.text":"Thay thế","editor.replaceAll.dialog.text":"Thay thế tất cả","editor.previous.dialog.text":"Trước","editor.next.dialog.text":"Tiếp theo",no_result_found:"Không tìm thấy kết quả","Smileys & People":"Cười & Mọi người","Animals & Nature":"Động vật & Thiên nhiên","Food & Drink":"Thức ăn & Đồ uống",Activity:"Hoạt động","Travel & Places":"Du lịch & Địa điểm",Object:"Vật",Symbol:"Ký hiệu",Flags:"Cờ","Frequently used":"Thường xuyên sử dụng","editor.formula.dialog.text":"Công thức","editor.katex.tooltip":"Công thức toán học","editor.exportPdf.tooltip":"Xuất PDF","editor.exportWord.tooltip":"Xuất Word","editor.importWrod.tooltip":"Nhập Word"},_=G,P={"editor.remove":"移除","editor.copy":"复制","editor.words":"字数","editor.characters":"字符数","editor.default":"默认","editor.recent":"最近使用","editor.nofill":"无填充","editor.format":"格式刷","editor.table_of_content":"目录","editor.draghandle.tooltip":"修改","editor.copyToClipboard":"复制到剪贴板","editor.importWord.tooltip":"导入 Word","editor.slash":"按 '/' 使用命令","editor.slash.empty":"无结果","editor.slash.format":"格式","editor.slash.insert":"插入","editor.slash.embed":"嵌入服务","editor.content":"请输入内容","editor.fontFamily.tooltip":"字体","editor.fontFamily.default.tooltip":"默认","editor.moremark":"更多文本样式","editor.size.small.tooltip":"小","editor.size.medium.tooltip":"中","editor.size.large.tooltip":"封面","editor.bold.tooltip":"粗体","editor.italic.tooltip":"斜体","editor.underline.tooltip":"下划线","editor.strike.tooltip":"删除线","editor.color.tooltip":"颜色","editor.color.more":"更多颜色","editor.highlight.tooltip":"高亮","editor.lineheight.tooltip":"行高","editor.heading.tooltip":"标题","editor.heading.h1.tooltip":"标题 1","editor.heading.h2.tooltip":"标题 2","editor.heading.h3.tooltip":"标题 3","editor.heading.h4.tooltip":"标题 4","editor.heading.h5.tooltip":"标题 5","editor.heading.h6.tooltip":"标题 6","editor.paragraph.tooltip":"段落","editor.textalign.tooltip":"对齐","editor.textalign.left.tooltip":"左对齐","editor.textalign.center.tooltip":"居中","editor.textalign.right.tooltip":"右对齐","editor.textalign.justify.tooltip":"两端对齐","editor.indent":"缩进","editor.indent.indent":"增加缩进","editor.indent.outdent":"减少缩进","editor.fontSize.tooltip":"字号","editor.fontSize.default.tooltip":"默认","editor.superscript.tooltip":"上标","editor.subscript.tooltip":"下标","editor.bulletlist.tooltip":"无序列表","editor.orderedlist.tooltip":"有序列表","editor.tasklist.tooltip":"任务列表","editor.indent.tooltip":"缩进","editor.outdent.tooltip":"减少缩进","editor.columns.tooltip":"列","editor.link.tooltip":"链接","editor.link.unlink.tooltip":"取消链接","editor.link.open.tooltip":"打开链接","editor.link.edit.tooltip":"编辑链接","editor.link.dialog.title":"插入链接","editor.link.dialog.link":"链接","editor.link.dialog.text":"文本","editor.link.dialog.openInNewTab":"在新标签页中打开","editor.link.dialog.link.placeholder":"链接地址","editor.link.dialog.text.placeholder":"添加描述","editor.link.dialog.button.apply":"应用","editor.image.tooltip":"图片","editor.image.dragger.tooltip":"点击或拖拽图片到此区域上传","editor.image.float.left.tooltip":"左浮动","editor.image.float.none.tooltip":"无浮动","editor.image.float.right.tooltip":"右浮动","editor.image.dialog.title":"添加图片","editor.image.dialog.tab.url":"链接","editor.image.dialog.tab.upload":"上传","editor.image.dialog.uploading":"上传中","editor.image.dialog.form.link":"链接","editor.image.dialog.placeholder":"链接","editor.image.dialog.form.alt":"替代文本","editor.image.dialog.form.aspectRatio":"锁定原始宽高比","editor.image.dialog.form.file":"文件","editor.image.dialog.button.apply":"应用","editor.video.tooltip":"视频","editor.video.dialog.tab.upload":"上传","editor.video.dialog.uploading":"上传中","editor.video.dialog.title":"嵌入或上传视频","editor.video.dialog.link":"链接","editor.video.dialog.placeholder":"链接","editor.video.dialog.button.apply":"应用","editor.table.tooltip":"表格","editor.table.menu.insert_table":"插入表格","editor.table.menu.insert_table.with_header_row":"带标题行","editor.table.menu.add_column_before":"在前面插入列","editor.table.menu.add_column_after":"在后面插入列","editor.table.menu.delete_column":"删除列","editor.table.menu.add_row_before":"在上方插入行","editor.table.menu.add_row_after":"在下方插入行","editor.table.menu.delete_row":"删除行","editor.table.menu.merge_or_split_cells":"合并或拆分单元格","editor.table.menu.delete_table":"删除表格","editor.blockquote.tooltip":"引用","editor.horizontalrule.tooltip":"水平线","editor.code.tooltip":"代码","editor.codeblock.tooltip":"代码块","editor.clear.tooltip":"清除格式","editor.undo.tooltip":"撤销","editor.redo.tooltip":"重做","editor.fullscreen.tooltip.fullscreen":"全屏","editor.fullscreen.tooltip.exit":"退出全屏","editor.imageUpload.fileTypeNotSupported":"不支持的文件类型","editor.imageUpload.fileSizeTooBig":"文件大小超出限制,最大大小为","editor.table.menu.insertColumnBefore":"在前面插入列","editor.table.menu.insertColumnAfter":"在后面插入列","editor.table.menu.deleteColumn":"删除列","editor.table.menu.insertRowAbove":"在上方插入行","editor.table.menu.insertRowBelow":"在下方插入行","editor.table.menu.deleteRow":"删除行","editor.table.menu.mergeCells":"合并单元格","editor.table.menu.splitCells":"拆分单元格","editor.table.menu.deleteTable":"删除表格","editor.table.menu.setCellsBgColor":"设置单元格背景色","editor.emoji.tooltip":"表情","editor.iframe.tooltip":"内嵌框架","editor.searchAndReplace.tooltip":"搜索和替换","editor.search.dialog.text":"搜索","editor.replace.dialog.text":"替换","editor.replaceAll.dialog.text":"全部替换","editor.previous.dialog.text":"上一个","editor.next.dialog.text":"下一个",no_result_found:"未找到结果","Smileys & People":"笑脸和人","Animals & Nature":"动物和自然","Food & Drink":"食物和饮料",Activity:"活动","Travel & Places":"旅行和地点",Object:"物体",Symbol:"符号",Flags:"旗帜","Frequently used":"常用","editor.formula.dialog.text":"公式","editor.katex.tooltip":"数学公式","editor.exportPdf.tooltip":"导出 PDF","editor.exportWord.tooltip":"导出 Word","editor.importWrod.tooltip":"导入 Word"},b=P,i={lang:g,message:{en:h,vi:_,zh_CN:b}};class W{constructor(){n(this,"emitter");this.emitter=F.mitt()}get lang(){return i.lang}set lang(t){if(!this.isLangSupported(t)){console.warn(`Can't find the current language "${t}", Using language "${i.lang}" by default`);return}i.lang=t,this.emitter.emit("lang",t)}get message(){return i.message}set message(t){i.message=t}loadLangMessage(t){return this.message[t]}isLangSupported(t){return Object.keys(this.message).includes(t)}setLang(t){this.lang=t}registerWatchLang(t){return this.emitter.on("lang",t),{unsubscribe:()=>{this.emitter.off("lang",t)}}}setMessage(t,o){this.message[t]=o}buildLocalesHandler(t){t||(t=this.lang);const o=this.loadLangMessage(t);return function(a){return o[a]||a}}}const l=new W,r=s.proxy({lang:i.lang});function X(){const e=s.useSnapshot(r),t=p.useMemo(()=>l.buildLocalesHandler(e.lang),[e.lang]);return p.useEffect(()=>{const o=l.registerWatchLang(d=>{r.lang=d});return()=>{o.unsubscribe()}},[]),{lang:e.lang,t}}const q={t:e=>l.buildLocalesHandler(r.lang)(e)},j=l;exports.BUBBLE_TEXT_LIST=H;exports.COLORS_LIST=v;exports.DEFAULT_COLOR=x;exports.DEFAULT_FONT_FAMILY_LIST=S;exports.DEFAULT_FONT_SIZE_LIST=R;exports.DEFAULT_FONT_SIZE_VALUE=U;exports.DEFAULT_LANGUAGE_CODE_BLOCK=y;exports.DEFAULT_LANG_VALUE=g;exports.DEFAULT_LINE_HEIGHT=M;exports.DEFAULT_LINE_HEIGHT_LIST=N;exports.EDITOR_UPDATE_THROTTLE_WAIT_TIME=m;exports.EDITOR_UPDATE_WATCH_THROTTLE_WAIT_TIME=E;exports.IMAGE_MAX_SIZE=C;exports.IMAGE_MIN_SIZE=A;exports.IMAGE_SIZE=u;exports.IMAGE_THROTTLE_WAIT_TIME=L;exports.LINE_HEIGHT_100=w;exports.MAP_LANGUAGE_CODE_LABELS=B;exports.NODE_TYPE_MENU=z;exports.TABLE_DEFAULT_SELECTED_GRID_SIZE=I;exports.TABLE_INIT_GRID_SIZE=k;exports.TABLE_MAX_GRID_SIZE=D;exports.VIDEO_SIZE=c;exports.en=h;exports.locale=j;exports.localeActions=q;exports.useLocale=X;exports.vi=_;exports.zh_CN=b;
|
|
2
|
+
//# sourceMappingURL=locales-BW5KWG4_.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"locales-BW5KWG4_.cjs","sources":["../src/constants/index.ts","../src/locales/en.ts","../src/locales/vi.ts","../src/locales/zh-cn.ts","../src/locales/index.tsx"],"sourcesContent":["/** Default lang */\nexport const DEFAULT_LANG_VALUE = 'en' as const\n\n/** Throttle time for editor input (milliseconds) */\nexport const EDITOR_UPDATE_THROTTLE_WAIT_TIME = 200 as const\n\n/**\n * watch throttling time must be less than the update time\n * otherwise the cursor position will reach the end\n */\nexport const EDITOR_UPDATE_WATCH_THROTTLE_WAIT_TIME = EDITOR_UPDATE_THROTTLE_WAIT_TIME - 80\n\n/** Minimum size for image adjustments */\nexport const IMAGE_MIN_SIZE = 20 as const\n/** Maximum size for image adjustments */\nexport const IMAGE_MAX_SIZE = 100_000 as const\n/** Throttle time during adjustments for images (milliseconds) */\nexport const IMAGE_THROTTLE_WAIT_TIME = 16 as const\n\n/** Default number of rows and columns for grids when creating a table */\nexport const TABLE_INIT_GRID_SIZE = 10 as const\n/** Maximum number of rows and columns for grids when creating a table */\nexport const TABLE_MAX_GRID_SIZE = 10 as const\n/** Minimum number of rows and columns for grids when creating a table */\nexport const TABLE_DEFAULT_SELECTED_GRID_SIZE = 2 as const\n\nexport const DEFAULT_COLOR = '#262626'\n/** Default color list for text color and text highlight */\nexport const COLORS_LIST = [\n '#000000',\n '#262626',\n '#595959',\n '#8C8C8C',\n '#BFBFBF',\n '#D9D9D9',\n '#E9E9E9',\n '#F5F5F5',\n '#FAFAFA',\n '#FFFFFF',\n '#F5222D',\n '#FA541C',\n '#FA8C16',\n '#FADB14',\n '#52C41A',\n '#13C2C2',\n '#1890FF',\n '#2F54EB',\n '#722ED1',\n '#EB2F96',\n '#FFE8E6',\n '#FFECE0',\n '#FFEFD1',\n '#FCFCCA',\n '#E4F7D2',\n '#D3F5F0',\n '#D4EEFC',\n '#DEE8FC',\n '#EFE1FA',\n '#FAE1EB',\n '#FFA39E',\n '#FFBB96',\n '#FFD591',\n '#FFFB8F',\n '#B7EB8F',\n '#87E8DE',\n '#91D5FF',\n '#ADC6FF',\n '#D3ADF7',\n '#FFADD2',\n '#FF4D4F',\n '#FF7A45',\n '#FFA940',\n '#FFEC3D',\n '#73D13D',\n '#36CFC9',\n '#40A9FF',\n '#597EF7',\n '#9254DE',\n '#F759AB',\n '#CF1322',\n '#D4380D',\n '#D46B08',\n '#D4B106',\n '#389E0D',\n '#08979C',\n '#096DD9',\n '#1D39C4',\n '#531DAB',\n '#C41D7F',\n '#820014',\n '#871400',\n '#873800',\n '#614700',\n '#135200',\n '#00474F',\n '#003A8C',\n '#061178',\n '#22075E',\n '#780650',\n] as const\n\n/** Default font family list */\nexport const DEFAULT_FONT_FAMILY_LIST = [\n 'Inter',\n 'Comic Sans MS, Comic Sans',\n 'serif',\n 'monospace',\n 'cursive',\n]\n\nexport const DEFAULT_LANGUAGE_CODE_BLOCK = [\n 'html',\n 'css',\n 'js',\n 'ts',\n]\n\nexport const MAP_LANGUAGE_CODE_LABELS = {\n html: 'HTML',\n css: 'CSS',\n js: 'JavaScript',\n ts: 'TypeScript',\n} as any\n\n/** Default font size list */\nexport const DEFAULT_FONT_SIZE_LIST = [\n '10px',\n '11px',\n '12px',\n '14px',\n '16px',\n '18px',\n '20px',\n '22px',\n '24px',\n '26px',\n '28px',\n '36px',\n '48px',\n '72px',\n] as const\n\n/** Default font size value */\nexport const DEFAULT_FONT_SIZE_VALUE = 'default'\n\n/** Options for setting image size in the bubble menu */\nexport enum IMAGE_SIZE {\n 'size-small' = 200,\n 'size-medium' = 500,\n 'size-large' = '100%',\n}\n\n/** Options for setting video size in the bubble menu */\nexport enum VIDEO_SIZE {\n 'size-small' = 480,\n 'size-medium' = 640,\n 'size-large' = '100%',\n}\n\n/** Line Height List */\nexport const DEFAULT_LINE_HEIGHT_LIST = ['100%', '115%', '150%', '200%', '250%', '300%']\nexport const LINE_HEIGHT_100 = 1.7\nexport const DEFAULT_LINE_HEIGHT = '1'\n\n/** display in menus */\nexport const NODE_TYPE_MENU: any = {\n image: [\n 'divider',\n 'image-size-small',\n 'image-size-medium',\n 'image-size-large',\n 'divider',\n 'image-left',\n 'image-center',\n 'image-right',\n 'divider',\n 'image-aspect-ratio',\n 'remove',\n ],\n text: [\n 'divider',\n 'text-bubble',\n 'divider',\n 'bold',\n 'italic',\n 'underline',\n 'strike',\n 'code',\n 'link',\n 'divider',\n 'color',\n 'highlight',\n 'textAlign',\n ],\n video: ['video-size-small', 'video-size-medium', 'video-size-large', 'divider', 'remove'],\n table: ['removeTable'],\n}\n\n/** display in bubble text menu */\nexport const BUBBLE_TEXT_LIST = [\n 'bold',\n 'italic',\n 'underline',\n 'strike',\n 'code',\n 'link',\n 'divider',\n 'color',\n 'highlight',\n 'textAlign',\n]\n","const locale = {\n 'editor.remove': 'Remove',\n 'editor.copy': 'Copy',\n 'editor.words': 'WORDS',\n 'editor.characters': 'CHARACTERS',\n 'editor.default': 'Default',\n 'editor.recent': 'Recently Used',\n 'editor.nofill': 'No Fill',\n 'editor.format': 'Format Painter',\n 'editor.table_of_content': 'Table of Content',\n 'editor.draghandle.tooltip': 'Modify',\n 'editor.copyToClipboard': 'CopyToClipboard',\n 'editor.importWord.tooltip': 'Import Word',\n 'editor.slash': 'Press \\'/\\' for commands',\n 'editor.slash.empty': 'No Result',\n 'editor.slash.format': 'Format',\n 'editor.slash.insert': 'Insert',\n 'editor.slash.embed': 'Embed Services',\n 'editor.content': 'Please input content',\n 'editor.fontFamily.tooltip': 'Font Family',\n 'editor.fontFamily.default.tooltip': 'Default',\n 'editor.moremark': 'More Text Styles',\n 'editor.size.small.tooltip': 'Small',\n 'editor.size.medium.tooltip': 'Medium',\n 'editor.size.large.tooltip': 'Cover',\n 'editor.bold.tooltip': 'Bold',\n 'editor.italic.tooltip': 'Italic',\n 'editor.underline.tooltip': 'Underline',\n 'editor.strike.tooltip': 'Strike',\n 'editor.color.tooltip': 'Color',\n 'editor.color.more': 'More Colors',\n 'editor.highlight.tooltip': 'Highlight',\n 'editor.lineheight.tooltip': 'Line Height',\n 'editor.heading.tooltip': 'Headings',\n 'editor.heading.h1.tooltip': 'Heading 1',\n 'editor.heading.h2.tooltip': 'Heading 2',\n 'editor.heading.h3.tooltip': 'Heading 3',\n 'editor.heading.h4.tooltip': 'Heading 4',\n 'editor.heading.h5.tooltip': 'Heading 5',\n 'editor.heading.h6.tooltip': 'Heading 6',\n 'editor.paragraph.tooltip': 'Paragraph',\n 'editor.textalign.tooltip': 'Align',\n 'editor.textalign.left.tooltip': 'Left',\n 'editor.textalign.center.tooltip': 'Center',\n 'editor.textalign.right.tooltip': 'Right',\n 'editor.textalign.justify.tooltip': 'Justify',\n 'editor.indent': 'Indent',\n 'editor.indent.indent': 'Increase Indent',\n 'editor.indent.outdent': 'Decrease Indent',\n 'editor.fontSize.tooltip': 'Font size',\n 'editor.fontSize.default.tooltip': 'Default',\n 'editor.superscript.tooltip': 'Superscript',\n 'editor.subscript.tooltip': 'Subscript',\n 'editor.bulletlist.tooltip': 'Bullet List',\n 'editor.orderedlist.tooltip': 'Ordered List',\n 'editor.tasklist.tooltip': 'Task List',\n 'editor.indent.tooltip': 'Indent',\n 'editor.outdent.tooltip': 'Outdent',\n 'editor.columns.tooltip': 'Columns',\n 'editor.link.tooltip': 'Link',\n 'editor.link.unlink.tooltip': 'UnLink',\n 'editor.link.open.tooltip': 'Open Link',\n 'editor.link.edit.tooltip': 'Edit Link',\n 'editor.link.dialog.title': 'Insert Link',\n 'editor.link.dialog.link': 'Link',\n 'editor.link.dialog.text': 'Text',\n 'editor.link.dialog.openInNewTab': 'Open In New Tab',\n 'editor.link.dialog.link.placeholder': 'Link Address',\n 'editor.link.dialog.text.placeholder': 'Add Description',\n 'editor.link.dialog.button.apply': 'Apply',\n 'editor.image.tooltip': 'Image',\n 'editor.image.dragger.tooltip': 'Click or drag the image to the area to upload',\n 'editor.image.float.left.tooltip': 'Float left',\n 'editor.image.float.none.tooltip': 'Float none',\n 'editor.image.float.right.tooltip': 'Float right',\n 'editor.image.dialog.title': 'Add an image',\n 'editor.image.dialog.tab.url': 'Url',\n 'editor.image.dialog.tab.upload': 'Upload',\n 'editor.image.dialog.uploading': 'Uploading',\n 'editor.image.dialog.form.link': 'Link',\n 'editor.image.dialog.placeholder': 'Link',\n 'editor.image.dialog.form.alt': 'Alt',\n 'editor.image.dialog.form.aspectRatio': 'Lock original aspect ratio',\n 'editor.image.dialog.form.file': 'File',\n 'editor.image.dialog.button.apply': 'apply',\n 'editor.video.tooltip': 'Video',\n 'editor.video.dialog.tab.upload': 'Upload',\n 'editor.video.dialog.uploading': 'Uploading',\n 'editor.video.dialog.title': 'Embed or upload a video',\n 'editor.video.dialog.link': 'link',\n 'editor.video.dialog.placeholder': 'Link',\n 'editor.video.dialog.button.apply': 'apply',\n 'editor.table.tooltip': 'Table',\n 'editor.table.menu.insert_table': 'Insert Table',\n 'editor.table.menu.insert_table.with_header_row': 'With header row',\n 'editor.table.menu.add_column_before': 'Add Column Before',\n 'editor.table.menu.add_column_after': 'Add Column After',\n 'editor.table.menu.delete_column': 'Delete Column',\n 'editor.table.menu.add_row_before': 'Add Row Before',\n 'editor.table.menu.add_row_after': 'Add Row After',\n 'editor.table.menu.delete_row': 'Delete Row',\n 'editor.table.menu.merge_or_split_cells': 'Merge Or Split Cells',\n 'editor.table.menu.delete_table': 'Delete Table',\n 'editor.blockquote.tooltip': 'Blockquote',\n 'editor.horizontalrule.tooltip': 'Horizontal Rule',\n 'editor.code.tooltip': 'Code',\n 'editor.codeblock.tooltip': 'Code Block',\n 'editor.clear.tooltip': 'Clear Format',\n 'editor.undo.tooltip': 'Undo',\n 'editor.redo.tooltip': 'Redo',\n 'editor.fullscreen.tooltip.fullscreen': 'Fullscreen',\n 'editor.fullscreen.tooltip.exit': 'Fullscreen Exit',\n 'editor.imageUpload.fileTypeNotSupported': 'File type not supported',\n 'editor.imageUpload.fileSizeTooBig': 'File size too big, Maximum size is',\n 'editor.table.menu.insertColumnBefore': 'Insert Column Before',\n 'editor.table.menu.insertColumnAfter': 'Insert Column After',\n 'editor.table.menu.deleteColumn': 'Delete Column',\n 'editor.table.menu.insertRowAbove': 'Insert Row Above',\n 'editor.table.menu.insertRowBelow': 'Insert Row Below',\n 'editor.table.menu.deleteRow': 'Delete Row',\n 'editor.table.menu.mergeCells': 'Merge Cells',\n 'editor.table.menu.splitCells': 'Split Cells',\n 'editor.table.menu.deleteTable': 'Delete Table',\n 'editor.table.menu.setCellsBgColor': 'Cell Background Color',\n 'editor.emoji.tooltip': 'Emoji',\n 'editor.iframe.tooltip': 'Iframe',\n 'editor.searchAndReplace.tooltip': 'Search and Replace',\n 'editor.search.dialog.text': 'Search',\n 'editor.replace.dialog.text': 'Replace',\n 'editor.replaceAll.dialog.text': 'Replace All',\n 'editor.previous.dialog.text': 'Previous',\n 'editor.next.dialog.text': 'Next',\n 'no_result_found': 'No results found',\n 'Smileys & People': 'Smileys & People',\n 'Animals & Nature': 'Animals & Nature',\n 'Food & Drink': 'Food & Drink',\n 'Activity': 'Activity',\n 'Travel & Places': 'Travel & Places',\n 'Object': 'Objects',\n 'Symbol': 'Symbols',\n 'Flags': 'Flags',\n 'Frequently used': 'Frequently used',\n 'editor.formula.dialog.text': 'Formula',\n 'editor.katex.tooltip': 'Math Formula',\n 'editor.exportPdf.tooltip': 'Export PDF',\n 'editor.exportWord.tooltip': 'Export Word',\n 'editor.importWrod.tooltip': 'Import Word',\n}\n\nexport default locale\n","const locale = {\n 'editor.remove': 'Xóa',\n 'editor.copy': 'Sao chép',\n 'editor.words': 'TỪ',\n 'editor.characters': 'KÝ TỰ',\n 'editor.default': 'Mặc định',\n 'editor.recent': 'Đã sử dụng gần đây',\n 'editor.nofill': 'Không tô',\n 'editor.format': 'Format Painter',\n 'editor.table_of_content': 'Mục lục',\n 'editor.draghandle.tooltip': 'Sửa đổi',\n 'editor.copyToClipboard': 'CopyToClipboard',\n 'editor.importWord.tooltip': 'Nhập Word',\n 'editor.slash': 'Nhấn \\'/\\' để biết lệnh',\n 'editor.slash.empty': 'Không có kết quả',\n 'editor.slash.format': 'Định dạng',\n 'editor.slash.insert': 'Chèn',\n 'editor.slash.embed': 'Dịch vụ nhúng',\n 'editor.content': 'Vui lòng nhập nội dung',\n 'editor.moremark': 'Nhiều kiểu văn bản hơn',\n 'editor.size.small.tooltip': 'Nhỏ',\n 'editor.fontFamily.tooltip': 'Phông chữ',\n 'editor.fontFamily.default.tooltip': 'Mặc định',\n 'editor.size.medium.tooltip': 'Trung bình',\n 'editor.size.large.tooltip': 'Lớn',\n 'editor.bold.tooltip': 'Đậm',\n 'editor.italic.tooltip': 'In nghiêng',\n 'editor.underline.tooltip': 'Gạch chân',\n 'editor.strike.tooltip': 'Gạch',\n 'editor.color.tooltip': 'Màu',\n 'editor.color.more': 'Nhiều màu hơn',\n 'editor.highlight.tooltip': 'Đánh dấu',\n 'editor.lineheight.tooltip': 'Chiều cao dòng',\n 'editor.heading.tooltip': 'Tiêu đề',\n 'editor.heading.h1.tooltip': 'Tiêu đề 1',\n 'editor.heading.h2.tooltip': 'Tiêu đề 2',\n 'editor.heading.h3.tooltip': 'Tiêu đề 3',\n 'editor.heading.h4.tooltip': 'Tiêu đề 4',\n 'editor.heading.h5.tooltip': 'Tiêu đề 5',\n 'editor.heading.h6.tooltip': 'Tiêu đề 6',\n 'editor.paragraph.tooltip': 'Đoạn văn',\n 'editor.textalign.tooltip': 'Căn chỉnh',\n 'editor.textalign.left.tooltip': 'Trái',\n 'editor.textalign.center.tooltip': 'Giữa',\n 'editor.textalign.right.tooltip': 'Phải',\n 'editor.textalign.justify.tooltip': 'Căn đều',\n 'editor.indent': 'Thụt lề',\n 'editor.indent.indent': 'Tăng thụt lề',\n 'editor.indent.outdent': 'Giảm thụt lề',\n 'editor.fontSize.tooltip': 'Kích thước phông chữ',\n 'editor.fontSize.default.tooltip': 'Mặc định',\n 'editor.superscript.tooltip': 'Chỉ số trên',\n 'editor.subscript.tooltip': 'Chỉ số dưới',\n 'editor.bulletlist.tooltip': 'Danh sách dấu đầu dòng',\n 'editor.orderedlist.tooltip': 'Danh sách có thứ tự',\n 'editor.tasklist.tooltip': 'Danh sách tác vụ',\n 'editor.indent.tooltip': 'Tăng thụt lề',\n 'editor.outdent.tooltip': 'Giảm thụt lề',\n 'editor.columns.tooltip': 'Cột',\n 'editor.link.tooltip': 'Liên kết',\n 'editor.link.unlink.tooltip': 'Hủy liên kết',\n 'editor.link.open.tooltip': 'Mở liên kết',\n 'editor.link.edit.tooltip': 'Chỉnh sửa liên kết',\n 'editor.link.dialog.title': 'Chèn liên kết',\n 'editor.link.dialog.link': 'Liên kết',\n 'editor.link.dialog.text': 'Văn bản',\n 'editor.link.dialog.openInNewTab': 'Mở trong tab mới',\n 'editor.link.dialog.link.placeholder': 'Địa chỉ liên kết',\n 'editor.link.dialog.text.placeholder': 'Thêm mô tả',\n 'editor.link.dialog.button.apply': 'Áp dụng',\n 'editor.image.tooltip': 'Hình ảnh',\n 'editor.image.dragger.tooltip': 'Nhấp hoặc kéo hình ảnh đến khu vực để tải lên',\n 'editor.image.float.left.tooltip': 'Trôi sang trái',\n 'editor.image.float.none.tooltip': 'Trôi không',\n 'editor.image.float.right.tooltip': 'Trôi sang phải',\n 'editor.image.dialog.title': 'Thêm hình ảnh',\n 'editor.image.dialog.tab.url': 'Url',\n 'editor.image.dialog.tab.upload': 'Tải lên',\n 'editor.image.dialog.uploading': 'Đang tải lên',\n 'editor.image.dialog.form.link': 'Liên kết',\n 'editor.image.dialog.placeholder': 'Liên kết',\n 'editor.image.dialog.form.alt': 'Alt',\n 'editor.image.dialog.form.aspectRatio': 'Khóa tỷ lệ khung hình gốc',\n 'editor.image.dialog.form.file': 'Tệp',\n 'editor.image.dialog.button.apply': 'áp dụng',\n 'editor.video.tooltip': 'Video',\n 'editor.video.dialog.tab.upload': 'Tải lên',\n 'editor.video.dialog.uploading': 'Đang tải lên',\n 'editor.video.dialog.title': 'Nhúng hoặc tải lên video',\n 'editor.video.dialog.link': 'liên kết',\n 'editor.video.dialog.placeholder': 'Liên kết',\n 'editor.video.dialog.button.apply': 'áp dụng',\n 'editor.table.tooltip': 'Bảng',\n 'editor.table.menu.insert_table': 'Chèn Bảng',\n 'editor.table.menu.insert_table.with_header_row': 'Có hàng tiêu đề',\n 'editor.table.menu.add_column_before': 'Thêm Cột Trước',\n 'editor.table.menu.add_column_after': 'Thêm Cột Sau',\n 'editor.table.menu.delete_column': 'Xóa Cột',\n 'editor.table.menu.add_row_before': 'Thêm Hàng Trước',\n 'editor.table.menu.add_row_after': 'Thêm Hàng Sau',\n 'editor.table.menu.delete_row': 'Xóa Hàng',\n 'editor.table.menu.merge_or_split_cells': 'Gộp Hoặc Tách Ô',\n 'editor.table.menu.delete_table': 'Xóa Bảng',\n 'editor.blockquote.tooltip': 'Blockquote',\n 'editor.horizontalrule.tooltip': 'Quy tắc ngang',\n 'editor.code.tooltip': 'Mã',\n 'editor.codeblock.tooltip': 'Khối mã',\n 'editor.clear.tooltip': 'Xóa định dạng',\n 'editor.undo.tooltip': 'Hoàn tác',\n 'editor.redo.tooltip': 'Làm lại',\n 'editor.fullscreen.tooltip.fullscreen': 'Toàn màn hình',\n 'editor.fullscreen.tooltip.exit': 'Thoát toàn màn hình',\n 'editor.imageUpload.fileTypeNotSupported': 'Loại tệp không được hỗ trợ',\n 'editor.imageUpload.fileSizeTooBig': 'Kích thước tệp quá lớn, Kích thước tối đa là',\n 'editor.table.menu.insertColumnBefore': 'Chèn cột trước',\n 'editor.table.menu.insertColumnAfter': 'Chèn cột sau',\n 'editor.table.menu.deleteColumn': 'Xóa cột',\n 'editor.table.menu.insertRowAbove': 'Chèn hàng ở trên',\n 'editor.table.menu.insertRowBelow': 'Chèn hàng ở dưới',\n 'editor.table.menu.deleteRow': 'Xóa hàng',\n 'editor.table.menu.mergeCells': 'Gộp các ô',\n 'editor.table.menu.splitCells': 'Chia ô',\n 'editor.table.menu.deleteTable': 'Xóa bảng',\n 'editor.table.menu.setCellsBgColor': 'Màu nền ô',\n 'editor.emoji.tooltip': 'Biểu tượng',\n 'editor.iframe.tooltip': 'Iframe',\n 'editor.searchAndReplace.tooltip': 'Tìm kiếm và thay thế',\n 'editor.search.dialog.text': 'Tìm kiếm',\n 'editor.replace.dialog.text': 'Thay thế',\n 'editor.replaceAll.dialog.text': 'Thay thế tất cả',\n 'editor.previous.dialog.text': 'Trước',\n 'editor.next.dialog.text': 'Tiếp theo',\n 'no_result_found': 'Không tìm thấy kết quả',\n 'Smileys & People': 'Cười & Mọi người',\n 'Animals & Nature': 'Động vật & Thiên nhiên',\n 'Food & Drink': 'Thức ăn & Đồ uống',\n 'Activity': 'Hoạt động',\n 'Travel & Places': 'Du lịch & Địa điểm',\n 'Object': 'Vật',\n 'Symbol': 'Ký hiệu',\n 'Flags': 'Cờ',\n 'Frequently used': 'Thường xuyên sử dụng',\n 'editor.formula.dialog.text': 'Công thức',\n 'editor.katex.tooltip': 'Công thức toán học',\n 'editor.exportPdf.tooltip': 'Xuất PDF',\n 'editor.exportWord.tooltip': 'Xuất Word',\n 'editor.importWrod.tooltip': 'Nhập Word',\n}\n\nexport default locale\n","const locale = {\n 'editor.remove': '移除',\n 'editor.copy': '复制',\n 'editor.words': '字数',\n 'editor.characters': '字符数',\n 'editor.default': '默认',\n 'editor.recent': '最近使用',\n 'editor.nofill': '无填充',\n 'editor.format': '格式刷',\n 'editor.table_of_content': '目录',\n 'editor.draghandle.tooltip': '修改',\n 'editor.copyToClipboard': '复制到剪贴板',\n 'editor.importWord.tooltip': '导入 Word',\n 'editor.slash': '按 \\'/\\' 使用命令',\n 'editor.slash.empty': '无结果',\n 'editor.slash.format': '格式',\n 'editor.slash.insert': '插入',\n 'editor.slash.embed': '嵌入服务',\n 'editor.content': '请输入内容',\n 'editor.fontFamily.tooltip': '字体',\n 'editor.fontFamily.default.tooltip': '默认',\n 'editor.moremark': '更多文本样式',\n 'editor.size.small.tooltip': '小',\n 'editor.size.medium.tooltip': '中',\n 'editor.size.large.tooltip': '封面',\n 'editor.bold.tooltip': '粗体',\n 'editor.italic.tooltip': '斜体',\n 'editor.underline.tooltip': '下划线',\n 'editor.strike.tooltip': '删除线',\n 'editor.color.tooltip': '颜色',\n 'editor.color.more': '更多颜色',\n 'editor.highlight.tooltip': '高亮',\n 'editor.lineheight.tooltip': '行高',\n 'editor.heading.tooltip': '标题',\n 'editor.heading.h1.tooltip': '标题 1',\n 'editor.heading.h2.tooltip': '标题 2',\n 'editor.heading.h3.tooltip': '标题 3',\n 'editor.heading.h4.tooltip': '标题 4',\n 'editor.heading.h5.tooltip': '标题 5',\n 'editor.heading.h6.tooltip': '标题 6',\n 'editor.paragraph.tooltip': '段落',\n 'editor.textalign.tooltip': '对齐',\n 'editor.textalign.left.tooltip': '左对齐',\n 'editor.textalign.center.tooltip': '居中',\n 'editor.textalign.right.tooltip': '右对齐',\n 'editor.textalign.justify.tooltip': '两端对齐',\n 'editor.indent': '缩进',\n 'editor.indent.indent': '增加缩进',\n 'editor.indent.outdent': '减少缩进',\n 'editor.fontSize.tooltip': '字号',\n 'editor.fontSize.default.tooltip': '默认',\n 'editor.superscript.tooltip': '上标',\n 'editor.subscript.tooltip': '下标',\n 'editor.bulletlist.tooltip': '无序列表',\n 'editor.orderedlist.tooltip': '有序列表',\n 'editor.tasklist.tooltip': '任务列表',\n 'editor.indent.tooltip': '缩进',\n 'editor.outdent.tooltip': '减少缩进',\n 'editor.columns.tooltip': '列',\n 'editor.link.tooltip': '链接',\n 'editor.link.unlink.tooltip': '取消链接',\n 'editor.link.open.tooltip': '打开链接',\n 'editor.link.edit.tooltip': '编辑链接',\n 'editor.link.dialog.title': '插入链接',\n 'editor.link.dialog.link': '链接',\n 'editor.link.dialog.text': '文本',\n 'editor.link.dialog.openInNewTab': '在新标签页中打开',\n 'editor.link.dialog.link.placeholder': '链接地址',\n 'editor.link.dialog.text.placeholder': '添加描述',\n 'editor.link.dialog.button.apply': '应用',\n 'editor.image.tooltip': '图片',\n 'editor.image.dragger.tooltip': '点击或拖拽图片到此区域上传',\n 'editor.image.float.left.tooltip': '左浮动',\n 'editor.image.float.none.tooltip': '无浮动',\n 'editor.image.float.right.tooltip': '右浮动',\n 'editor.image.dialog.title': '添加图片',\n 'editor.image.dialog.tab.url': '链接',\n 'editor.image.dialog.tab.upload': '上传',\n 'editor.image.dialog.uploading': '上传中',\n 'editor.image.dialog.form.link': '链接',\n 'editor.image.dialog.placeholder': '链接',\n 'editor.image.dialog.form.alt': '替代文本',\n 'editor.image.dialog.form.aspectRatio': '锁定原始宽高比',\n 'editor.image.dialog.form.file': '文件',\n 'editor.image.dialog.button.apply': '应用',\n 'editor.video.tooltip': '视频',\n 'editor.video.dialog.tab.upload': '上传',\n 'editor.video.dialog.uploading': '上传中',\n 'editor.video.dialog.title': '嵌入或上传视频',\n 'editor.video.dialog.link': '链接',\n 'editor.video.dialog.placeholder': '链接',\n 'editor.video.dialog.button.apply': '应用',\n 'editor.table.tooltip': '表格',\n 'editor.table.menu.insert_table': '插入表格',\n 'editor.table.menu.insert_table.with_header_row': '带标题行',\n 'editor.table.menu.add_column_before': '在前面插入列',\n 'editor.table.menu.add_column_after': '在后面插入列',\n 'editor.table.menu.delete_column': '删除列',\n 'editor.table.menu.add_row_before': '在上方插入行',\n 'editor.table.menu.add_row_after': '在下方插入行',\n 'editor.table.menu.delete_row': '删除行',\n 'editor.table.menu.merge_or_split_cells': '合并或拆分单元格',\n 'editor.table.menu.delete_table': '删除表格',\n 'editor.blockquote.tooltip': '引用',\n 'editor.horizontalrule.tooltip': '水平线',\n 'editor.code.tooltip': '代码',\n 'editor.codeblock.tooltip': '代码块',\n 'editor.clear.tooltip': '清除格式',\n 'editor.undo.tooltip': '撤销',\n 'editor.redo.tooltip': '重做',\n 'editor.fullscreen.tooltip.fullscreen': '全屏',\n 'editor.fullscreen.tooltip.exit': '退出全屏',\n 'editor.imageUpload.fileTypeNotSupported': '不支持的文件类型',\n 'editor.imageUpload.fileSizeTooBig': '文件大小超出限制,最大大小为',\n 'editor.table.menu.insertColumnBefore': '在前面插入列',\n 'editor.table.menu.insertColumnAfter': '在后面插入列',\n 'editor.table.menu.deleteColumn': '删除列',\n 'editor.table.menu.insertRowAbove': '在上方插入行',\n 'editor.table.menu.insertRowBelow': '在下方插入行',\n 'editor.table.menu.deleteRow': '删除行',\n 'editor.table.menu.mergeCells': '合并单元格',\n 'editor.table.menu.splitCells': '拆分单元格',\n 'editor.table.menu.deleteTable': '删除表格',\n 'editor.table.menu.setCellsBgColor': '设置单元格背景色',\n 'editor.emoji.tooltip': '表情',\n 'editor.iframe.tooltip': '内嵌框架',\n 'editor.searchAndReplace.tooltip': '搜索和替换',\n 'editor.search.dialog.text': '搜索',\n 'editor.replace.dialog.text': '替换',\n 'editor.replaceAll.dialog.text': '全部替换',\n 'editor.previous.dialog.text': '上一个',\n 'editor.next.dialog.text': '下一个',\n 'no_result_found': '未找到结果',\n 'Smileys & People': '笑脸和人',\n 'Animals & Nature': '动物和自然',\n 'Food & Drink': '食物和饮料',\n 'Activity': '活动',\n 'Travel & Places': '旅行和地点',\n 'Object': '物体',\n 'Symbol': '符号',\n 'Flags': '旗帜',\n 'Frequently used': '常用',\n 'editor.formula.dialog.text': '公式',\n 'editor.katex.tooltip': '数学公式',\n 'editor.exportPdf.tooltip': '导出 PDF',\n 'editor.exportWord.tooltip': '导出 Word',\n 'editor.importWrod.tooltip': '导入 Word',\n}\n\nexport default locale\n","import { useEffect, useMemo } from 'react'\n\nimport { proxy, useSnapshot } from 'valtio'\n\nimport en from './en'\nimport vi from './vi'\nimport zh_CN from './zh-cn'\nimport mitt from '@/utils/mitt'\nimport type { EventType } from '@/utils/mitt'\nimport { DEFAULT_LANG_VALUE } from '@/constants'\n\n// Define supported language types\ntype LanguageType = 'en' | 'vi' | 'zh_CN' | string\n\n// Define message key types based on the 'en' locale\ntype MessageKeysType = keyof typeof en\n\n// Interface for locale configuration\ninterface LocaleInterface {\n lang: LanguageType\n message: Record<LanguageType, Record<MessageKeysType, string>>\n}\n\n// Interface for Mitt events\ninterface MittEvents extends Record<EventType, unknown> {\n lang: LanguageType\n}\n\n// Default locale configuration\nexport const DEFAULT_LOCALE: LocaleInterface = {\n lang: DEFAULT_LANG_VALUE,\n message: {\n en,\n vi,\n zh_CN,\n },\n}\n\nclass Locale {\n private emitter\n constructor() {\n this.emitter = mitt<MittEvents>()\n }\n\n // Getter and setter for current language\n get lang(): LanguageType {\n return DEFAULT_LOCALE.lang\n }\n\n set lang(lang: LanguageType) {\n if (!this.isLangSupported(lang)) {\n console.warn(\n `Can't find the current language \"${lang}\", Using language \"${DEFAULT_LOCALE.lang}\" by default`,\n )\n return\n }\n\n DEFAULT_LOCALE.lang = lang\n this.emitter.emit('lang', lang)\n }\n\n // Getter and setter for messages\n get message(): Record<LanguageType, Record<MessageKeysType, string>> {\n return DEFAULT_LOCALE.message\n }\n\n set message(message: Record<LanguageType, Record<MessageKeysType, string>>) {\n DEFAULT_LOCALE.message = message\n }\n\n // Load messages for a specific language\n loadLangMessage(lang: LanguageType): Record<MessageKeysType, string> {\n return this.message[lang]\n }\n\n // Check if a language is supported\n private isLangSupported(lang: LanguageType): boolean {\n const supportedLangs = Object.keys(this.message) as LanguageType[]\n return supportedLangs.includes(lang)\n }\n\n // Set the current language\n public setLang(lang: LanguageType) {\n this.lang = lang\n }\n\n // Register a language change watcher\n public registerWatchLang(hook: (lang: LanguageType) => void) {\n this.emitter.on('lang', hook)\n\n const unsubscribe = () => {\n this.emitter.off('lang', hook)\n }\n\n return {\n unsubscribe,\n }\n }\n\n // Set messages for a specific language\n public setMessage(lang: string, message: Record<MessageKeysType, string>) {\n this.message[lang] = message\n }\n\n // Build a translation function for a given language\n buildLocalesHandler(lang?: LanguageType) {\n if (!lang) {\n lang = this.lang\n }\n\n const message = this.loadLangMessage(lang)\n\n return function t(path: MessageKeysType) {\n return message[path] || path\n }\n }\n}\n\nconst locale = new Locale()\n\n// Proxy for reactive language state\nconst atomLang = proxy({\n lang: DEFAULT_LOCALE.lang,\n})\n\nfunction useLocale() {\n const atomLangSnap = useSnapshot(atomLang)\n\n const t = useMemo(() => {\n return locale.buildLocalesHandler(atomLangSnap.lang)\n }, [atomLangSnap.lang])\n\n useEffect(() => {\n const watchLang = locale.registerWatchLang((val) => {\n atomLang.lang = val\n })\n\n return () => {\n watchLang.unsubscribe()\n }\n }, [])\n\n return {\n lang: atomLangSnap.lang,\n t,\n }\n}\n\nconst localeActions = {\n t: (path: MessageKeysType) => {\n return locale.buildLocalesHandler(atomLang.lang)(path)\n },\n}\n\nexport default locale\nexport { Locale, useLocale, localeActions }\n\nexport { default as en } from './en'\nexport { default as vi } from './vi'\nexport { default as zh_CN } from './zh-cn'\n"],"names":["DEFAULT_LANG_VALUE","EDITOR_UPDATE_THROTTLE_WAIT_TIME","EDITOR_UPDATE_WATCH_THROTTLE_WAIT_TIME","IMAGE_MIN_SIZE","IMAGE_MAX_SIZE","IMAGE_THROTTLE_WAIT_TIME","TABLE_INIT_GRID_SIZE","TABLE_MAX_GRID_SIZE","TABLE_DEFAULT_SELECTED_GRID_SIZE","DEFAULT_COLOR","COLORS_LIST","DEFAULT_FONT_FAMILY_LIST","DEFAULT_LANGUAGE_CODE_BLOCK","MAP_LANGUAGE_CODE_LABELS","DEFAULT_FONT_SIZE_LIST","DEFAULT_FONT_SIZE_VALUE","IMAGE_SIZE","VIDEO_SIZE","DEFAULT_LINE_HEIGHT_LIST","LINE_HEIGHT_100","DEFAULT_LINE_HEIGHT","NODE_TYPE_MENU","BUBBLE_TEXT_LIST","locale","en","vi","zh_CN","DEFAULT_LOCALE","Locale","__publicField","mitt","lang","message","hook","path","atomLang","proxy","useLocale","atomLangSnap","useSnapshot","useMemo","useEffect","watchLang","val","localeActions","locale$1"],"mappings":"+QACaA,EAAqB,KAGrBC,EAAmC,IAMnCC,EAAyCD,EAAmC,GAG5EE,EAAiB,GAEjBC,EAAiB,IAEjBC,EAA2B,GAG3BC,EAAuB,GAEvBC,EAAsB,GAEtBC,EAAmC,EAEnCC,EAAgB,UAEhBC,EAAc,CACzB,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,SACF,EAGaC,EAA2B,CACtC,QACA,4BACA,QACA,YACA,SACF,EAEaC,EAA8B,CACzC,OACA,MACA,KACA,IACF,EAEaC,EAA2B,CACtC,KAAM,OACN,IAAK,MACL,GAAI,aACJ,GAAI,YACN,EAGaC,EAAyB,CACpC,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,MACF,EAGaC,EAA0B,UAG3B,IAAAC,GAAAA,IACVA,EAAAA,EAAA,cAAe,GAAf,EAAA,aACAA,EAAAA,EAAA,eAAgB,GAAhB,EAAA,cACAA,EAAA,YAAe,EAAA,OAHLA,IAAAA,GAAA,CAAA,CAAA,EAOAC,GAAAA,IACVA,EAAAA,EAAA,cAAe,GAAf,EAAA,aACAA,EAAAA,EAAA,eAAgB,GAAhB,EAAA,cACAA,EAAA,YAAe,EAAA,OAHLA,IAAAA,GAAA,CAAA,CAAA,EAOL,MAAMC,EAA2B,CAAC,OAAQ,OAAQ,OAAQ,OAAQ,OAAQ,MAAM,EAC1EC,EAAkB,IAClBC,EAAsB,IAGtBC,EAAsB,CACjC,MAAO,CACL,UACA,mBACA,oBACA,mBACA,UACA,aACA,eACA,cACA,UACA,qBACA,QACF,EACA,KAAM,CACJ,UACA,cACA,UACA,OACA,SACA,YACA,SACA,OACA,OACA,UACA,QACA,YACA,WACF,EACA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