@elementor/editor-components 3.35.0-461 → 3.35.0-462
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.js +131 -108
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +111 -88
- package/dist/index.mjs.map +1 -1
- package/package.json +22 -22
- package/src/components/components-tab/components-pro-notification.tsx +22 -0
- package/src/components/components-tab/components.tsx +3 -0
- package/src/utils/is-pro-user.ts +26 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elementor/editor-components",
|
|
3
3
|
"description": "Elementor editor components",
|
|
4
|
-
"version": "3.35.0-
|
|
4
|
+
"version": "3.35.0-462",
|
|
5
5
|
"private": false,
|
|
6
6
|
"author": "Elementor Team",
|
|
7
7
|
"homepage": "https://elementor.com/",
|
|
@@ -40,30 +40,30 @@
|
|
|
40
40
|
"dev": "tsup --config=../../tsup.dev.ts"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@elementor/editor": "3.35.0-
|
|
44
|
-
"@elementor/editor-canvas": "3.35.0-
|
|
45
|
-
"@elementor/editor-controls": "3.35.0-
|
|
46
|
-
"@elementor/editor-documents": "3.35.0-
|
|
47
|
-
"@elementor/editor-editing-panel": "3.35.0-
|
|
48
|
-
"@elementor/editor-elements": "3.35.0-
|
|
49
|
-
"@elementor/editor-elements-panel": "3.35.0-
|
|
50
|
-
"@elementor/editor-mcp": "3.35.0-
|
|
51
|
-
"@elementor/editor-panels": "3.35.0-
|
|
52
|
-
"@elementor/editor-props": "3.35.0-
|
|
53
|
-
"@elementor/editor-styles-repository": "3.35.0-
|
|
54
|
-
"@elementor/editor-ui": "3.35.0-
|
|
55
|
-
"@elementor/editor-v1-adapters": "3.35.0-
|
|
56
|
-
"@elementor/http-client": "3.35.0-
|
|
43
|
+
"@elementor/editor": "3.35.0-462",
|
|
44
|
+
"@elementor/editor-canvas": "3.35.0-462",
|
|
45
|
+
"@elementor/editor-controls": "3.35.0-462",
|
|
46
|
+
"@elementor/editor-documents": "3.35.0-462",
|
|
47
|
+
"@elementor/editor-editing-panel": "3.35.0-462",
|
|
48
|
+
"@elementor/editor-elements": "3.35.0-462",
|
|
49
|
+
"@elementor/editor-elements-panel": "3.35.0-462",
|
|
50
|
+
"@elementor/editor-mcp": "3.35.0-462",
|
|
51
|
+
"@elementor/editor-panels": "3.35.0-462",
|
|
52
|
+
"@elementor/editor-props": "3.35.0-462",
|
|
53
|
+
"@elementor/editor-styles-repository": "3.35.0-462",
|
|
54
|
+
"@elementor/editor-ui": "3.35.0-462",
|
|
55
|
+
"@elementor/editor-v1-adapters": "3.35.0-462",
|
|
56
|
+
"@elementor/http-client": "3.35.0-462",
|
|
57
57
|
"@elementor/icons": "^1.63.0",
|
|
58
|
-
"@elementor/mixpanel": "3.35.0-
|
|
59
|
-
"@elementor/query": "3.35.0-
|
|
60
|
-
"@elementor/schema": "3.35.0-
|
|
61
|
-
"@elementor/store": "3.35.0-
|
|
58
|
+
"@elementor/mixpanel": "3.35.0-462",
|
|
59
|
+
"@elementor/query": "3.35.0-462",
|
|
60
|
+
"@elementor/schema": "3.35.0-462",
|
|
61
|
+
"@elementor/store": "3.35.0-462",
|
|
62
62
|
"@elementor/ui": "1.36.17",
|
|
63
|
-
"@elementor/utils": "3.35.0-
|
|
63
|
+
"@elementor/utils": "3.35.0-462",
|
|
64
64
|
"@wordpress/i18n": "^5.13.0",
|
|
65
|
-
"@elementor/editor-notifications": "3.35.0-
|
|
66
|
-
"@elementor/editor-current-user": "3.35.0-
|
|
65
|
+
"@elementor/editor-notifications": "3.35.0-462",
|
|
66
|
+
"@elementor/editor-current-user": "3.35.0-462"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
69
|
"react": "^18.3.1",
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { InfoAlert } from '@elementor/editor-ui';
|
|
3
|
+
import { Box, Typography } from '@elementor/ui';
|
|
4
|
+
import { __ } from '@wordpress/i18n';
|
|
5
|
+
|
|
6
|
+
export function ComponentsProNotification() {
|
|
7
|
+
return (
|
|
8
|
+
<Box sx={ { px: 2 } }>
|
|
9
|
+
<InfoAlert>
|
|
10
|
+
<Typography variant="caption" component="span">
|
|
11
|
+
<Typography variant="caption" component="span" fontWeight="bold">
|
|
12
|
+
{ __( 'Try Components for free:', 'elementor' ) }
|
|
13
|
+
</Typography>{ ' ' }
|
|
14
|
+
{ __(
|
|
15
|
+
'Soon Components will be part of the Pro subscription, but what you create now will remain on your site.',
|
|
16
|
+
'elementor'
|
|
17
|
+
) }
|
|
18
|
+
</Typography>
|
|
19
|
+
</InfoAlert>
|
|
20
|
+
</Box>
|
|
21
|
+
);
|
|
22
|
+
}
|
|
@@ -2,8 +2,10 @@ import * as React from 'react';
|
|
|
2
2
|
import { ThemeProvider } from '@elementor/editor-ui';
|
|
3
3
|
|
|
4
4
|
import { useComponents } from '../../hooks/use-components';
|
|
5
|
+
import { isProUser } from '../../utils/is-pro-user';
|
|
5
6
|
import { ComponentSearch } from './component-search';
|
|
6
7
|
import { ComponentsList } from './components-list';
|
|
8
|
+
import { ComponentsProNotification } from './components-pro-notification';
|
|
7
9
|
import { SearchProvider } from './search-provider';
|
|
8
10
|
|
|
9
11
|
const ComponentsContent = () => {
|
|
@@ -13,6 +15,7 @@ const ComponentsContent = () => {
|
|
|
13
15
|
return (
|
|
14
16
|
<>
|
|
15
17
|
{ hasComponents && <ComponentSearch /> }
|
|
18
|
+
{ hasComponents && ! isProUser() && <ComponentsProNotification /> }
|
|
16
19
|
<ComponentsList />
|
|
17
20
|
</>
|
|
18
21
|
);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
type ExtendedWindow = Window & {
|
|
2
|
+
elementor?: {
|
|
3
|
+
helpers?: {
|
|
4
|
+
hasPro?: () => boolean;
|
|
5
|
+
};
|
|
6
|
+
};
|
|
7
|
+
elementorPro?: {
|
|
8
|
+
config?: {
|
|
9
|
+
isActive?: boolean;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export function isProUser(): boolean {
|
|
15
|
+
const extendedWindow = window as unknown as ExtendedWindow;
|
|
16
|
+
|
|
17
|
+
const hasPro = extendedWindow.elementor?.helpers?.hasPro?.() ?? false;
|
|
18
|
+
|
|
19
|
+
if ( ! hasPro ) {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const isProActive = extendedWindow.elementorPro?.config?.isActive ?? false;
|
|
24
|
+
|
|
25
|
+
return isProActive;
|
|
26
|
+
}
|