@elementor/editor-editing-panel 4.0.0-509 → 4.0.0-511
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +3 -5
- package/dist/index.d.ts +3 -5
- package/dist/index.js +158 -200
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +125 -166
- package/dist/index.mjs.map +1 -1
- package/package.json +20 -20
- package/src/components/style-sections/typography-section/font-family-field.tsx +1 -2
- package/src/index.ts +0 -1
- package/src/components/style-sections/typography-section/hooks/use-font-families.ts +0 -51
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elementor/editor-editing-panel",
|
|
3
|
-
"version": "4.0.0-
|
|
3
|
+
"version": "4.0.0-511",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "Elementor Team",
|
|
6
6
|
"homepage": "https://elementor.com/",
|
|
@@ -39,27 +39,27 @@
|
|
|
39
39
|
"dev": "tsup --config=../../tsup.dev.ts"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@elementor/editor": "4.0.0-
|
|
43
|
-
"@elementor/editor-canvas": "4.0.0-
|
|
44
|
-
"@elementor/editor-controls": "4.0.0-
|
|
45
|
-
"@elementor/editor-documents": "4.0.0-
|
|
46
|
-
"@elementor/editor-elements": "4.0.0-
|
|
47
|
-
"@elementor/editor-interactions": "4.0.0-
|
|
48
|
-
"@elementor/editor-panels": "4.0.0-
|
|
49
|
-
"@elementor/editor-props": "4.0.0-
|
|
50
|
-
"@elementor/editor-responsive": "4.0.0-
|
|
51
|
-
"@elementor/editor-styles": "4.0.0-
|
|
52
|
-
"@elementor/editor-styles-repository": "4.0.0-
|
|
53
|
-
"@elementor/editor-ui": "4.0.0-
|
|
54
|
-
"@elementor/editor-v1-adapters": "4.0.0-
|
|
42
|
+
"@elementor/editor": "4.0.0-511",
|
|
43
|
+
"@elementor/editor-canvas": "4.0.0-511",
|
|
44
|
+
"@elementor/editor-controls": "4.0.0-511",
|
|
45
|
+
"@elementor/editor-documents": "4.0.0-511",
|
|
46
|
+
"@elementor/editor-elements": "4.0.0-511",
|
|
47
|
+
"@elementor/editor-interactions": "4.0.0-511",
|
|
48
|
+
"@elementor/editor-panels": "4.0.0-511",
|
|
49
|
+
"@elementor/editor-props": "4.0.0-511",
|
|
50
|
+
"@elementor/editor-responsive": "4.0.0-511",
|
|
51
|
+
"@elementor/editor-styles": "4.0.0-511",
|
|
52
|
+
"@elementor/editor-styles-repository": "4.0.0-511",
|
|
53
|
+
"@elementor/editor-ui": "4.0.0-511",
|
|
54
|
+
"@elementor/editor-v1-adapters": "4.0.0-511",
|
|
55
55
|
"@elementor/icons": "^1.63.0",
|
|
56
|
-
"@elementor/locations": "4.0.0-
|
|
57
|
-
"@elementor/menus": "4.0.0-
|
|
58
|
-
"@elementor/schema": "4.0.0-
|
|
59
|
-
"@elementor/session": "4.0.0-
|
|
56
|
+
"@elementor/locations": "4.0.0-511",
|
|
57
|
+
"@elementor/menus": "4.0.0-511",
|
|
58
|
+
"@elementor/schema": "4.0.0-511",
|
|
59
|
+
"@elementor/session": "4.0.0-511",
|
|
60
60
|
"@elementor/ui": "1.36.17",
|
|
61
|
-
"@elementor/utils": "4.0.0-
|
|
62
|
-
"@elementor/wp-media": "4.0.0-
|
|
61
|
+
"@elementor/utils": "4.0.0-511",
|
|
62
|
+
"@elementor/wp-media": "4.0.0-511",
|
|
63
63
|
"@wordpress/i18n": "^5.13.0"
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { FontFamilyControl } from '@elementor/editor-controls';
|
|
2
|
+
import { FontFamilyControl, useFontFamilies } from '@elementor/editor-controls';
|
|
3
3
|
import { useSectionWidth } from '@elementor/editor-ui';
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
5
|
|
|
6
6
|
import { StylesField } from '../../../controls-registry/styles-field';
|
|
7
7
|
import { StylesFieldLayout } from '../../styles-field-layout';
|
|
8
|
-
import { useFontFamilies } from './hooks/use-font-families';
|
|
9
8
|
|
|
10
9
|
const FONT_FAMILY_LABEL = __( 'Font family', 'elementor' );
|
|
11
10
|
|
package/src/index.ts
CHANGED
|
@@ -7,7 +7,6 @@ export { SectionContent } from './components/section-content';
|
|
|
7
7
|
export { SettingsControl } from './components/settings-control';
|
|
8
8
|
export { SettingsField } from './controls-registry/settings-field';
|
|
9
9
|
export { StyleIndicator } from './components/style-indicator';
|
|
10
|
-
export { useFontFamilies } from './components/style-sections/typography-section/hooks/use-font-families';
|
|
11
10
|
export { injectIntoStyleTab } from './components/style-tab';
|
|
12
11
|
export { StyleTabSection } from './components/style-tab-section';
|
|
13
12
|
export { useClassesProp } from './contexts/classes-prop-context';
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { useMemo } from 'react';
|
|
2
|
-
import { type FontCategory } from '@elementor/editor-controls';
|
|
3
|
-
import { getElementorConfig, type SupportedFonts } from '@elementor/editor-v1-adapters';
|
|
4
|
-
import { __ } from '@wordpress/i18n';
|
|
5
|
-
|
|
6
|
-
const supportedCategories: Record< SupportedFonts, string > = {
|
|
7
|
-
system: __( 'System', 'elementor' ),
|
|
8
|
-
custom: __( 'Custom Fonts', 'elementor' ),
|
|
9
|
-
googlefonts: __( 'Google Fonts', 'elementor' ),
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
const getFontFamilies = () => {
|
|
13
|
-
const { controls } = getElementorConfig();
|
|
14
|
-
|
|
15
|
-
const options = controls?.font?.options;
|
|
16
|
-
|
|
17
|
-
if ( ! options ) {
|
|
18
|
-
return null;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
return options;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export const useFontFamilies = () => {
|
|
25
|
-
const fontFamilies = getFontFamilies();
|
|
26
|
-
|
|
27
|
-
return useMemo( () => {
|
|
28
|
-
const categoriesOrder: SupportedFonts[] = [ 'system', 'custom', 'googlefonts' ];
|
|
29
|
-
|
|
30
|
-
return Object.entries( fontFamilies || {} )
|
|
31
|
-
.reduce< FontCategory[] >( ( acc, [ font, category ] ) => {
|
|
32
|
-
if ( ! supportedCategories[ category as SupportedFonts ] ) {
|
|
33
|
-
return acc;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
const categoryIndex = categoriesOrder.indexOf( category );
|
|
37
|
-
|
|
38
|
-
if ( ! acc[ categoryIndex ] ) {
|
|
39
|
-
acc[ categoryIndex ] = {
|
|
40
|
-
label: supportedCategories[ category as SupportedFonts ],
|
|
41
|
-
fonts: [],
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
acc[ categoryIndex ].fonts.push( font );
|
|
46
|
-
|
|
47
|
-
return acc;
|
|
48
|
-
}, [] )
|
|
49
|
-
.filter( Boolean );
|
|
50
|
-
}, [ fontFamilies ] );
|
|
51
|
-
};
|