@elementor/editor-site-navigation 0.21.12 → 0.22.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 +18 -1
- package/dist/index.mjs +18 -1
- package/package.json +3 -3
- package/src/components/top-bar/recently-edited.tsx +23 -1
- package/src/types.ts +17 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [0.22.0](https://github.com/elementor/elementor-packages/compare/@elementor/editor-site-navigation@0.21.13...@elementor/editor-site-navigation@0.22.0) (2024-06-04)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* internal create a top bar data events collection working with mixpanel [ED-14684] ([#184](https://github.com/elementor/elementor-packages/issues/184)) ([9d25189](https://github.com/elementor/elementor-packages/commit/9d25189173a65d535347f9b2f32d377bcffb6c52))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [0.21.13](https://github.com/elementor/elementor-packages/compare/@elementor/editor-site-navigation@0.21.12...@elementor/editor-site-navigation@0.21.13) (2024-06-02)
|
|
18
|
+
|
|
19
|
+
**Note:** Version bump only for package @elementor/editor-site-navigation
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
## [0.21.12](https://github.com/elementor/elementor-packages/compare/@elementor/editor-site-navigation@0.21.11...@elementor/editor-site-navigation@0.21.12) (2024-05-09)
|
|
7
26
|
|
|
8
27
|
**Note:** Version bump only for package @elementor/editor-site-navigation
|
package/dist/index.js
CHANGED
|
@@ -283,13 +283,30 @@ function RecentlyEdited() {
|
|
|
283
283
|
if (!document2) {
|
|
284
284
|
return null;
|
|
285
285
|
}
|
|
286
|
+
const buttonProps = (0, import_ui5.bindTrigger)(popupState);
|
|
286
287
|
return /* @__PURE__ */ React5.createElement(React5.Fragment, null, /* @__PURE__ */ React5.createElement(
|
|
287
288
|
import_ui5.Button,
|
|
288
289
|
{
|
|
289
290
|
color: "inherit",
|
|
290
291
|
size: "small",
|
|
291
292
|
endIcon: /* @__PURE__ */ React5.createElement(import_icons4.ChevronDownIcon, { fontSize: "small" }),
|
|
292
|
-
...
|
|
293
|
+
...buttonProps,
|
|
294
|
+
onClick: (e) => {
|
|
295
|
+
const extendedWindow = window;
|
|
296
|
+
const config = extendedWindow?.elementor?.editorEvents?.config;
|
|
297
|
+
if (config) {
|
|
298
|
+
extendedWindow.elementor.editorEvents.dispatchEvent(
|
|
299
|
+
config.names.topBar.documentNameDropdown,
|
|
300
|
+
{
|
|
301
|
+
location: config.locations.topBar,
|
|
302
|
+
secondaryLocation: config.secondaryLocations.documentNameDropdown,
|
|
303
|
+
trigger: config.triggers.dropdownClick,
|
|
304
|
+
element: config.elements.dropdown
|
|
305
|
+
}
|
|
306
|
+
);
|
|
307
|
+
}
|
|
308
|
+
buttonProps.onClick(e);
|
|
309
|
+
}
|
|
293
310
|
},
|
|
294
311
|
/* @__PURE__ */ React5.createElement(
|
|
295
312
|
Indicator,
|
package/dist/index.mjs
CHANGED
|
@@ -265,13 +265,30 @@ function RecentlyEdited() {
|
|
|
265
265
|
if (!document2) {
|
|
266
266
|
return null;
|
|
267
267
|
}
|
|
268
|
+
const buttonProps = bindTrigger(popupState);
|
|
268
269
|
return /* @__PURE__ */ React5.createElement(React5.Fragment, null, /* @__PURE__ */ React5.createElement(
|
|
269
270
|
Button,
|
|
270
271
|
{
|
|
271
272
|
color: "inherit",
|
|
272
273
|
size: "small",
|
|
273
274
|
endIcon: /* @__PURE__ */ React5.createElement(ChevronDownIcon, { fontSize: "small" }),
|
|
274
|
-
...
|
|
275
|
+
...buttonProps,
|
|
276
|
+
onClick: (e) => {
|
|
277
|
+
const extendedWindow = window;
|
|
278
|
+
const config = extendedWindow?.elementor?.editorEvents?.config;
|
|
279
|
+
if (config) {
|
|
280
|
+
extendedWindow.elementor.editorEvents.dispatchEvent(
|
|
281
|
+
config.names.topBar.documentNameDropdown,
|
|
282
|
+
{
|
|
283
|
+
location: config.locations.topBar,
|
|
284
|
+
secondaryLocation: config.secondaryLocations.documentNameDropdown,
|
|
285
|
+
trigger: config.triggers.dropdownClick,
|
|
286
|
+
element: config.elements.dropdown
|
|
287
|
+
}
|
|
288
|
+
);
|
|
289
|
+
}
|
|
290
|
+
buttonProps.onClick(e);
|
|
291
|
+
}
|
|
275
292
|
},
|
|
276
293
|
/* @__PURE__ */ React5.createElement(
|
|
277
294
|
Indicator,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elementor/editor-site-navigation",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "Elementor Team",
|
|
6
6
|
"homepage": "https://elementor.com/",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"dev": "tsup --config=../../tsup.dev.ts"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@elementor/editor-app-bar": "^0.
|
|
35
|
+
"@elementor/editor-app-bar": "^0.14.0",
|
|
36
36
|
"@elementor/editor-documents": "^0.11.0",
|
|
37
37
|
"@elementor/editor-panels": "^0.4.12",
|
|
38
38
|
"@elementor/editor-v1-adapters": "^0.6.0",
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"elementor": {
|
|
51
51
|
"type": "extension"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "d1675ce63120e7854ff74f8611e41011f97a96a0"
|
|
54
54
|
}
|
|
@@ -19,6 +19,7 @@ import { PostListItem } from './post-list-item';
|
|
|
19
19
|
import { CreatePostListItem } from './create-post-list-item';
|
|
20
20
|
import { useReverseHtmlEntities } from '../../hooks/use-reverse-html-entities';
|
|
21
21
|
import { NUMBER_OF_RECENT_POSTS } from '../../api/recent-posts';
|
|
22
|
+
import { ExtendedWindow } from '../../types';
|
|
22
23
|
|
|
23
24
|
export default function RecentlyEdited() {
|
|
24
25
|
const activeDocument = useActiveDocument();
|
|
@@ -49,13 +50,34 @@ export default function RecentlyEdited() {
|
|
|
49
50
|
return null;
|
|
50
51
|
}
|
|
51
52
|
|
|
53
|
+
const buttonProps = bindTrigger( popupState );
|
|
54
|
+
|
|
52
55
|
return (
|
|
53
56
|
<>
|
|
54
57
|
<Button
|
|
55
58
|
color="inherit"
|
|
56
59
|
size="small"
|
|
57
60
|
endIcon={ <ChevronDownIcon fontSize="small" /> }
|
|
58
|
-
{ ...
|
|
61
|
+
{ ...buttonProps }
|
|
62
|
+
onClick={ ( e: React.MouseEvent ) => {
|
|
63
|
+
const extendedWindow = window as unknown as ExtendedWindow;
|
|
64
|
+
const config = extendedWindow?.elementor?.editorEvents?.config;
|
|
65
|
+
|
|
66
|
+
if ( config ) {
|
|
67
|
+
extendedWindow.elementor.editorEvents.dispatchEvent(
|
|
68
|
+
config.names.topBar.documentNameDropdown,
|
|
69
|
+
{
|
|
70
|
+
location: config.locations.topBar,
|
|
71
|
+
secondaryLocation: config.secondaryLocations.documentNameDropdown,
|
|
72
|
+
trigger: config.triggers.dropdownClick,
|
|
73
|
+
element: config.elements.dropdown,
|
|
74
|
+
},
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
buttonProps.onClick( e );
|
|
79
|
+
} }
|
|
80
|
+
|
|
59
81
|
>
|
|
60
82
|
<Indicator
|
|
61
83
|
title={ documentTitle }
|
package/src/types.ts
CHANGED
|
@@ -27,3 +27,20 @@ export type RecentPost = {
|
|
|
27
27
|
edit: boolean,
|
|
28
28
|
},
|
|
29
29
|
}
|
|
30
|
+
|
|
31
|
+
export type ExtendedWindow = Window & {
|
|
32
|
+
elementor: {
|
|
33
|
+
editorEvents: {
|
|
34
|
+
dispatchEvent: ( name: string, data: Record<string, string> ) => void
|
|
35
|
+
config: {
|
|
36
|
+
locations: Record<string, string>,
|
|
37
|
+
secondaryLocations: Record<string, string>,
|
|
38
|
+
triggers: Record<string, string>,
|
|
39
|
+
elements: Record<string, string>
|
|
40
|
+
names: {
|
|
41
|
+
topBar: Record<string, string>
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|