@elementor/editor-site-navigation 0.34.0 → 0.36.0
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/CHANGELOG.md +19 -0
- package/dist/index.js +15 -3
- package/dist/index.mjs +15 -3
- package/package.json +7 -6
- package/src/hooks/use-toggle-button-props.ts +20 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 0.36.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 17b73ab: Update `@elementor/ui` version.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [17b73ab]
|
|
12
|
+
- @elementor/editor-app-bar@0.31.0
|
|
13
|
+
- @elementor/editor-panels@0.16.0
|
|
14
|
+
- @elementor/editor-documents@0.13.7
|
|
15
|
+
|
|
16
|
+
## 0.35.0
|
|
17
|
+
|
|
18
|
+
### Minor Changes
|
|
19
|
+
|
|
20
|
+
- 2fc3298: Add event for Pages button in Top-bar in Elementor hosting sites
|
|
21
|
+
|
|
3
22
|
## 0.34.0
|
|
4
23
|
|
|
5
24
|
### Minor Changes
|
package/dist/index.js
CHANGED
|
@@ -1307,13 +1307,25 @@ var { env } = (0, import_env.parseEnv)("@elementor/editor-site-navigation", (env
|
|
|
1307
1307
|
var import_icons16 = require("@elementor/icons");
|
|
1308
1308
|
var import_i18n16 = require("@wordpress/i18n");
|
|
1309
1309
|
function useToggleButtonProps() {
|
|
1310
|
-
const { isOpen, isBlocked } = usePanelStatus();
|
|
1310
|
+
const { isOpen: selectedState, isBlocked } = usePanelStatus();
|
|
1311
1311
|
const { open, close } = usePanelActions();
|
|
1312
1312
|
return {
|
|
1313
1313
|
title: (0, import_i18n16.__)("Pages", "elementor"),
|
|
1314
1314
|
icon: import_icons16.PagesIcon,
|
|
1315
|
-
onClick: () =>
|
|
1316
|
-
|
|
1315
|
+
onClick: () => {
|
|
1316
|
+
const extendedWindow = window;
|
|
1317
|
+
const config = extendedWindow?.elementor?.editorEvents?.config;
|
|
1318
|
+
if (config) {
|
|
1319
|
+
extendedWindow.elementor.editorEvents.dispatchEvent("top_bar_pages", {
|
|
1320
|
+
location: config.locations.topBar,
|
|
1321
|
+
secondaryLocation: config.secondaryLocations.elementorLogo,
|
|
1322
|
+
trigger: config.triggers.click,
|
|
1323
|
+
element: config.elements.buttonIcon
|
|
1324
|
+
});
|
|
1325
|
+
}
|
|
1326
|
+
return selectedState ? close() : open();
|
|
1327
|
+
},
|
|
1328
|
+
selected: selectedState,
|
|
1317
1329
|
disabled: isBlocked
|
|
1318
1330
|
};
|
|
1319
1331
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -1322,13 +1322,25 @@ var { env } = parseEnv("@elementor/editor-site-navigation", (envData) => {
|
|
|
1322
1322
|
import { PagesIcon } from "@elementor/icons";
|
|
1323
1323
|
import { __ as __16 } from "@wordpress/i18n";
|
|
1324
1324
|
function useToggleButtonProps() {
|
|
1325
|
-
const { isOpen, isBlocked } = usePanelStatus();
|
|
1325
|
+
const { isOpen: selectedState, isBlocked } = usePanelStatus();
|
|
1326
1326
|
const { open, close } = usePanelActions();
|
|
1327
1327
|
return {
|
|
1328
1328
|
title: __16("Pages", "elementor"),
|
|
1329
1329
|
icon: PagesIcon,
|
|
1330
|
-
onClick: () =>
|
|
1331
|
-
|
|
1330
|
+
onClick: () => {
|
|
1331
|
+
const extendedWindow = window;
|
|
1332
|
+
const config = extendedWindow?.elementor?.editorEvents?.config;
|
|
1333
|
+
if (config) {
|
|
1334
|
+
extendedWindow.elementor.editorEvents.dispatchEvent("top_bar_pages", {
|
|
1335
|
+
location: config.locations.topBar,
|
|
1336
|
+
secondaryLocation: config.secondaryLocations.elementorLogo,
|
|
1337
|
+
trigger: config.triggers.click,
|
|
1338
|
+
element: config.elements.buttonIcon
|
|
1339
|
+
});
|
|
1340
|
+
}
|
|
1341
|
+
return selectedState ? close() : open();
|
|
1342
|
+
},
|
|
1343
|
+
selected: selectedState,
|
|
1332
1344
|
disabled: isBlocked
|
|
1333
1345
|
};
|
|
1334
1346
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elementor/editor-site-navigation",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.36.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "Elementor Team",
|
|
6
6
|
"homepage": "https://elementor.com/",
|
|
@@ -39,19 +39,20 @@
|
|
|
39
39
|
"dev": "tsup --config=../../tsup.dev.ts"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@elementor/editor-app-bar": "0.
|
|
43
|
-
"@elementor/editor-documents": "0.13.
|
|
44
|
-
"@elementor/editor-panels": "0.
|
|
42
|
+
"@elementor/editor-app-bar": "0.31.0",
|
|
43
|
+
"@elementor/editor-documents": "0.13.7",
|
|
44
|
+
"@elementor/editor-panels": "0.16.0",
|
|
45
45
|
"@elementor/editor-v1-adapters": "0.12.0",
|
|
46
46
|
"@elementor/env": "0.3.5",
|
|
47
47
|
"@elementor/icons": "1.44.0",
|
|
48
48
|
"@elementor/query": "0.2.4",
|
|
49
|
-
"@elementor/ui": "1.
|
|
49
|
+
"@elementor/ui": "1.35.5",
|
|
50
50
|
"@wordpress/api-fetch": "^6.42.0",
|
|
51
51
|
"@wordpress/i18n": "^5.13.0"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
|
-
"react": "^18.3.1"
|
|
54
|
+
"react": "^18.3.1",
|
|
55
|
+
"react-dom": "^18.3.1"
|
|
55
56
|
},
|
|
56
57
|
"devDependencies": {
|
|
57
58
|
"tsup": "^8.3.5"
|
|
@@ -1,17 +1,33 @@
|
|
|
1
|
+
import { type ToggleActionProps } from '@elementor/editor-app-bar';
|
|
1
2
|
import { PagesIcon } from '@elementor/icons';
|
|
2
3
|
import { __ } from '@wordpress/i18n';
|
|
3
4
|
|
|
4
5
|
import { usePanelActions, usePanelStatus } from '../components/panel/panel';
|
|
6
|
+
import { type ExtendedWindow } from '../types';
|
|
5
7
|
|
|
6
|
-
export function useToggleButtonProps() {
|
|
7
|
-
const { isOpen, isBlocked } = usePanelStatus();
|
|
8
|
+
export function useToggleButtonProps(): ToggleActionProps {
|
|
9
|
+
const { isOpen: selectedState, isBlocked } = usePanelStatus();
|
|
8
10
|
const { open, close } = usePanelActions();
|
|
9
11
|
|
|
10
12
|
return {
|
|
11
13
|
title: __( 'Pages', 'elementor' ),
|
|
12
14
|
icon: PagesIcon,
|
|
13
|
-
onClick: () =>
|
|
14
|
-
|
|
15
|
+
onClick: () => {
|
|
16
|
+
const extendedWindow = window as unknown as ExtendedWindow;
|
|
17
|
+
const config = extendedWindow?.elementor?.editorEvents?.config;
|
|
18
|
+
|
|
19
|
+
if ( config ) {
|
|
20
|
+
extendedWindow.elementor.editorEvents.dispatchEvent( 'top_bar_pages', {
|
|
21
|
+
location: config.locations.topBar,
|
|
22
|
+
secondaryLocation: config.secondaryLocations.elementorLogo,
|
|
23
|
+
trigger: config.triggers.click,
|
|
24
|
+
element: config.elements.buttonIcon,
|
|
25
|
+
} );
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return selectedState ? close() : open();
|
|
29
|
+
},
|
|
30
|
+
selected: selectedState,
|
|
15
31
|
disabled: isBlocked,
|
|
16
32
|
};
|
|
17
33
|
}
|