@flozy/editor 5.9.5 → 5.9.7
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.
@@ -75,10 +75,10 @@ const Leaf = /*#__PURE__*/React.memo(({
|
|
75
75
|
});
|
76
76
|
Leaf.displayName = "Leaf";
|
77
77
|
const updateTopBanner = (content = [], setTopBanner) => {
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
78
|
+
setTopBanner(() => {
|
79
|
+
const firstNode = content ? content[0] : {};
|
80
|
+
return firstNode?.type === "topbanner" ? firstNode : null;
|
81
|
+
});
|
82
82
|
};
|
83
83
|
const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
84
84
|
const {
|
@@ -1,3 +1,11 @@
|
|
1
1
|
const otherFonts = ["PoppinsRegular", "PoppinsBold", "Qwitcher Grypen", "Bulgarian Garamond", "Redacted Script", "Herr Von Muellerhoff", "Dawning of a New Day", "Coming Soon", "Engagement", "Ingrid Darling", "La Belle Aurore", "Mea Culpa", "The Girl Next Door"];
|
2
2
|
const mostUsedGoogleFonts = ["Roboto", "Poppins", "Lato", "Inter", "Nunito", "Ubuntu", "Oswald", "Rubik", "Roboto Slab", "PT Sans", "Work Sans", "Lora", "Mulish", "DM Sans", "Fira Sans", "Quicksand", "Barlow", "Manrope", "IBM Plex Sans", "PT Serif", "Libre Franklin", "Bebas Neue", "Cabin", "Titillium Web", "Heebo", "Noto Serif", "Jost", "Source Code Pro", "Josefin Sans", "Dosis", "Fira Sans Condensed", "Archivo", "Noto Serif JP", "Crimson Text", "Cairo", "Pacifico", "Red Hat Display", "Assistant", "Comfortaa", "Lexend", "Fjalla One", "Caveat", "Arvo", "Lobster", "Schibsted Grotesk", "EB Garamond", "Sora", "Kalam", "Onest", "Space Grotesk", "Outfit", "Plus Jakarta Sans"];
|
3
|
-
|
3
|
+
const systemFonts = ["Monaco", "Helvetica", "Georgia", "Times New Roman", "Courier New", "Impact"];
|
4
|
+
export const googleFontList = [...mostUsedGoogleFonts, ...otherFonts];
|
5
|
+
const fontList = [...mostUsedGoogleFonts, ...otherFonts, ...systemFonts];
|
6
|
+
export const defaultFontFamilies = {
|
7
|
+
id: 1,
|
8
|
+
format: "fontFamily",
|
9
|
+
type: "fontfamilydropdown",
|
10
|
+
options: fontList || []
|
11
|
+
};
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import { useEffect, useState, createContext, useContext, useMemo } from "react";
|
2
2
|
import { getSelectedText } from "../utils/helper";
|
3
3
|
import { debounce } from "../helper";
|
4
|
+
import { defaultFontFamilies } from "../common/FontLoader/FontList";
|
4
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
5
6
|
const EditorContext = /*#__PURE__*/createContext();
|
6
7
|
export const useEditorSelection = editor => {
|
@@ -34,7 +35,7 @@ export const EditorProvider = ({
|
|
34
35
|
const [contextMenu, setContextMenu] = useState({
|
35
36
|
path: null
|
36
37
|
});
|
37
|
-
const [fontFamilies, setFontFamilies] = useState(
|
38
|
+
const [fontFamilies, setFontFamilies] = useState(defaultFontFamilies);
|
38
39
|
useEffect(() => {
|
39
40
|
window.updateSelectedItem = d => {
|
40
41
|
setSelectedElement(d);
|