@elementor/editor-app-bar 3.33.0-196 → 3.33.0-198

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 CHANGED
@@ -339,10 +339,10 @@ function MainMenuLocation() {
339
339
  });
340
340
  const toolbarLogoProps = (0, import_ui6.bindTrigger)(popupState);
341
341
  const onToolbarClick = (e) => {
342
- const extendedWindow = window;
343
- const config = extendedWindow?.elementorCommon?.eventsManager?.config;
342
+ const extendedWindow2 = window;
343
+ const config = extendedWindow2?.elementorCommon?.eventsManager?.config;
344
344
  if (config) {
345
- extendedWindow.elementorCommon.eventsManager.dispatchEvent(config.names.topBar.elementorLogoDropdown, {
345
+ extendedWindow2.elementorCommon.eventsManager.dispatchEvent(config.names.topBar.elementorLogoDropdown, {
346
346
  location: config.locations.topBar,
347
347
  secondaryLocation: config.secondaryLocations.eLogoMenu,
348
348
  trigger: config.triggers.dropdownClick,
@@ -457,10 +457,10 @@ var import_icons4 = require("@elementor/icons");
457
457
  var import_i18n4 = require("@wordpress/i18n");
458
458
  var dispatchConnectClickEvent = (eventName) => {
459
459
  try {
460
- const extendedWindow = window;
461
- const config = extendedWindow?.elementorCommon?.eventsManager?.config;
460
+ const extendedWindow2 = window;
461
+ const config = extendedWindow2?.elementorCommon?.eventsManager?.config;
462
462
  if (config) {
463
- extendedWindow.elementorCommon.eventsManager.dispatchEvent(config.names.topBar[eventName], {
463
+ extendedWindow2.elementorCommon.eventsManager.dispatchEvent(config.names.topBar[eventName], {
464
464
  location: config.locations.topBar,
465
465
  secondaryLocation: config.secondaryLocations.eLogoMenu,
466
466
  trigger: config.triggers.dropdownClick,
@@ -472,28 +472,28 @@ var dispatchConnectClickEvent = (eventName) => {
472
472
  }
473
473
  };
474
474
  function useConnectLinkConfig() {
475
- const extendedWindow = window;
475
+ const extendedWindow2 = window;
476
476
  let isUserConnected = false;
477
- const isPro = extendedWindow?.elementor?.helpers.hasPro();
477
+ const isPro = extendedWindow2?.elementor?.helpers.hasPro();
478
478
  let target = "_blank";
479
479
  if (isPro) {
480
- isUserConnected = extendedWindow?.elementorPro?.config.isActive ?? false;
480
+ isUserConnected = extendedWindow2?.elementorPro?.config.isActive ?? false;
481
481
  } else {
482
- isUserConnected = extendedWindow?.elementorCommon?.config.library_connect.is_connected ?? false;
482
+ isUserConnected = extendedWindow2?.elementorCommon?.config.library_connect.is_connected ?? false;
483
483
  target = "_self";
484
484
  }
485
485
  const handleConnectClick = (0, import_react4.useCallback)(
486
486
  (event) => {
487
487
  event.preventDefault();
488
- if (extendedWindow.jQuery && extendedWindow.jQuery.fn?.elementorConnect) {
489
- const connectUrl = extendedWindow?.elementor?.config.user.top_bar.connect_url;
490
- const $tempButton = extendedWindow.jQuery("<a>");
488
+ if (extendedWindow2.jQuery && extendedWindow2.jQuery.fn?.elementorConnect) {
489
+ const connectUrl = extendedWindow2?.elementor?.config.user.top_bar.connect_url;
490
+ const $tempButton = extendedWindow2.jQuery("<a>");
491
491
  $tempButton?.attr("href", connectUrl)?.attr("target", "_blank")?.attr("rel", "opener")?.css("display", "none")?.appendTo("body");
492
492
  $tempButton.elementorConnect({
493
493
  success: () => {
494
494
  dispatchConnectClickEvent("accountConnected");
495
495
  setTimeout(() => {
496
- extendedWindow.location.reload();
496
+ extendedWindow2.location.reload();
497
497
  }, 200);
498
498
  }
499
499
  });
@@ -504,16 +504,16 @@ function useConnectLinkConfig() {
504
504
  }, 1e3);
505
505
  }
506
506
  },
507
- [extendedWindow]
507
+ [extendedWindow2]
508
508
  );
509
509
  return isUserConnected ? {
510
510
  title: (0, import_i18n4.__)("My Elementor", "elementor"),
511
- href: extendedWindow?.elementor?.config.user.top_bar.my_elementor_url,
511
+ href: extendedWindow2?.elementor?.config.user.top_bar.my_elementor_url,
512
512
  icon: import_icons4.UserIcon,
513
513
  target: "_blank"
514
514
  } : {
515
515
  title: (0, import_i18n4.__)("Connect my account", "elementor"),
516
- href: extendedWindow?.elementor?.config.user.top_bar.connect_url,
516
+ href: extendedWindow2?.elementor?.config.user.top_bar.connect_url,
517
517
  icon: import_icons4.UserIcon,
518
518
  target,
519
519
  onClick: handleConnectClick
@@ -541,10 +541,10 @@ function useActionProps() {
541
541
  icon: import_icons5.EyeIcon,
542
542
  title: (0, import_i18n5.__)("Preview Changes", "elementor"),
543
543
  onClick: () => {
544
- const extendedWindow = window;
545
- const config = extendedWindow?.elementorCommon?.eventsManager?.config;
544
+ const extendedWindow2 = window;
545
+ const config = extendedWindow2?.elementorCommon?.eventsManager?.config;
546
546
  if (config) {
547
- extendedWindow.elementorCommon.eventsManager.dispatchEvent(config.names.topBar.previewPage, {
547
+ extendedWindow2.elementorCommon.eventsManager.dispatchEvent(config.names.topBar.previewPage, {
548
548
  location: config.locations.topBar,
549
549
  secondaryLocation: config.secondaryLocations["preview-page"],
550
550
  trigger: config.triggers.click,
@@ -644,10 +644,10 @@ function PrimaryAction() {
644
644
  import_ui12.Button,
645
645
  {
646
646
  onClick: () => {
647
- const extendedWindow = window;
648
- const config = extendedWindow?.elementorCommon?.eventsManager?.config;
647
+ const extendedWindow2 = window;
648
+ const config = extendedWindow2?.elementorCommon?.eventsManager?.config;
649
649
  if (config) {
650
- extendedWindow.elementorCommon.eventsManager.dispatchEvent(
650
+ extendedWindow2.elementorCommon.eventsManager.dispatchEvent(
651
651
  config.names.topBar.publishButton,
652
652
  {
653
653
  location: config.locations.topBar,
@@ -819,10 +819,10 @@ function useActionProps2() {
819
819
  if (!document2) {
820
820
  return;
821
821
  }
822
- const extendedWindow = window;
823
- const config = extendedWindow?.elementorCommon?.eventsManager?.config;
822
+ const extendedWindow2 = window;
823
+ const config = extendedWindow2?.elementorCommon?.eventsManager?.config;
824
824
  if (config) {
825
- extendedWindow.elementorCommon.eventsManager.dispatchEvent(config.names.topBar.documentSettings, {
825
+ extendedWindow2.elementorCommon.eventsManager.dispatchEvent(config.names.topBar.documentSettings, {
826
826
  location: config.locations.topBar,
827
827
  secondaryLocation: config.secondaryLocations["document-settings"],
828
828
  trigger: config.triggers.click,
@@ -855,10 +855,10 @@ function useActionProps3() {
855
855
  title: (0, import_i18n12.__)("Add Element", "elementor"),
856
856
  icon: import_icons12.PlusIcon,
857
857
  onClick: () => {
858
- const extendedWindow = window;
859
- const config = extendedWindow?.elementorCommon?.eventsManager?.config;
858
+ const extendedWindow2 = window;
859
+ const config = extendedWindow2?.elementorCommon?.eventsManager?.config;
860
860
  if (config) {
861
- extendedWindow.elementorCommon.eventsManager.dispatchEvent(config.names.topBar.widgetPanel, {
861
+ extendedWindow2.elementorCommon.eventsManager.dispatchEvent(config.names.topBar.widgetPanel, {
862
862
  location: config.locations.topBar,
863
863
  secondaryLocation: config.secondaryLocations["widget-panel"],
864
864
  trigger: config.triggers.toggleClick,
@@ -918,10 +918,10 @@ function useActionProps4() {
918
918
  title: (0, import_i18n14.__)("Finder", "elementor"),
919
919
  icon: import_icons13.SearchIcon,
920
920
  onClick: () => {
921
- const extendedWindow = window;
922
- const config = extendedWindow?.elementorCommon?.eventsManager?.config;
921
+ const extendedWindow2 = window;
922
+ const config = extendedWindow2?.elementorCommon?.eventsManager?.config;
923
923
  if (config) {
924
- extendedWindow.elementorCommon.eventsManager.dispatchEvent(config.names.topBar.finder, {
924
+ extendedWindow2.elementorCommon.eventsManager.dispatchEvent(config.names.topBar.finder, {
925
925
  location: config.locations.topBar,
926
926
  secondaryLocation: config.secondaryLocations.finder,
927
927
  trigger: config.triggers.toggleClick,
@@ -952,10 +952,10 @@ function useActionProps5() {
952
952
  icon: import_icons14.HelpIcon,
953
953
  target: "_blank",
954
954
  onClick: () => {
955
- const extendedWindow = window;
956
- const config = extendedWindow?.elementorCommon?.eventsManager?.config;
955
+ const extendedWindow2 = window;
956
+ const config = extendedWindow2?.elementorCommon?.eventsManager?.config;
957
957
  if (config) {
958
- extendedWindow.elementorCommon.eventsManager.dispatchEvent(config.names.topBar.help, {
958
+ extendedWindow2.elementorCommon.eventsManager.dispatchEvent(config.names.topBar.help, {
959
959
  location: config.locations.topBar,
960
960
  secondaryLocation: config.secondaryLocations.help,
961
961
  trigger: config.triggers.click,
@@ -986,10 +986,10 @@ function useActionProps6() {
986
986
  title: (0, import_i18n16.__)("History", "elementor"),
987
987
  icon: import_icons15.HistoryIcon,
988
988
  onClick: () => {
989
- const extendedWindow = window;
990
- const config = extendedWindow?.elementorCommon?.eventsManager?.config;
989
+ const extendedWindow2 = window;
990
+ const config = extendedWindow2?.elementorCommon?.eventsManager?.config;
991
991
  if (config) {
992
- extendedWindow.elementorCommon.eventsManager.dispatchEvent(config.names.topBar.history, {
992
+ extendedWindow2.elementorCommon.eventsManager.dispatchEvent(config.names.topBar.history, {
993
993
  location: config.locations.topBar,
994
994
  secondaryLocation: config.secondaryLocations.elementorLogo,
995
995
  trigger: config.triggers.click,
@@ -1021,10 +1021,10 @@ function useActionProps7() {
1021
1021
  icon: import_icons16.KeyboardIcon,
1022
1022
  title: (0, import_i18n17.__)("Keyboard Shortcuts", "elementor"),
1023
1023
  onClick: () => {
1024
- const extendedWindow = window;
1025
- const config = extendedWindow?.elementorCommon?.eventsManager?.config;
1024
+ const extendedWindow2 = window;
1025
+ const config = extendedWindow2?.elementorCommon?.eventsManager?.config;
1026
1026
  if (config) {
1027
- extendedWindow.elementorCommon.eventsManager.dispatchEvent(config.names.topBar.keyboardShortcuts, {
1027
+ extendedWindow2.elementorCommon.eventsManager.dispatchEvent(config.names.topBar.keyboardShortcuts, {
1028
1028
  location: config.locations.topBar,
1029
1029
  secondaryLocation: config.secondaryLocations.elementorLogo,
1030
1030
  trigger: config.triggers.click,
@@ -1060,10 +1060,10 @@ function BreakpointsSwitcher() {
1060
1060
  return null;
1061
1061
  }
1062
1062
  const onChange = (_, value) => {
1063
- const extendedWindow = window;
1064
- const config = extendedWindow?.elementorCommon?.eventsManager?.config;
1063
+ const extendedWindow2 = window;
1064
+ const config = extendedWindow2?.elementorCommon?.eventsManager?.config;
1065
1065
  if (config) {
1066
- extendedWindow.elementorCommon.eventsManager.dispatchEvent(config.names.topBar.responsiveControls, {
1066
+ extendedWindow2.elementorCommon.eventsManager.dispatchEvent(config.names.topBar.responsiveControls, {
1067
1067
  location: config.locations.topBar,
1068
1068
  secondaryLocation: config.secondaryLocations.responsiveControls,
1069
1069
  trigger: config.triggers.click,
@@ -1221,10 +1221,10 @@ function useActionProps8() {
1221
1221
  title: (0, import_i18n20.__)("Site Settings", "elementor"),
1222
1222
  icon: import_icons18.SettingsIcon,
1223
1223
  onClick: () => {
1224
- const extendedWindow = window;
1225
- const config = extendedWindow?.elementorCommon?.eventsManager?.config;
1224
+ const extendedWindow2 = window;
1225
+ const config = extendedWindow2?.elementorCommon?.eventsManager?.config;
1226
1226
  if (config) {
1227
- extendedWindow.elementorCommon.eventsManager.dispatchEvent(config.names.topBar.siteSettings, {
1227
+ extendedWindow2.elementorCommon.eventsManager.dispatchEvent(config.names.topBar.siteSettings, {
1228
1228
  location: config.locations.topBar,
1229
1229
  secondaryLocation: config.secondaryLocations.siteSettings,
1230
1230
  trigger: config.triggers.toggleClick,
@@ -1258,18 +1258,76 @@ function init11() {
1258
1258
 
1259
1259
  // src/extensions/structure/hooks/use-action-props.ts
1260
1260
  var import_editor_v1_adapters12 = require("@elementor/editor-v1-adapters");
1261
+ var import_i18n22 = require("@wordpress/i18n");
1262
+
1263
+ // src/extensions/structure/hooks/structure-icon-with-popup.tsx
1264
+ var React26 = __toESM(require("react"));
1265
+ var import_react5 = require("react");
1261
1266
  var import_icons19 = require("@elementor/icons");
1267
+ var import_ui16 = require("@elementor/ui");
1262
1268
  var import_i18n21 = require("@wordpress/i18n");
1269
+ var extendedWindow = window;
1270
+ var StructurePopupContent = ({ onClose }) => {
1271
+ const handleDismiss = async () => {
1272
+ onClose();
1273
+ extendedWindow.elementorCommon?.ajax?.addRequest?.("structure_popup_dismiss").catch(() => {
1274
+ });
1275
+ };
1276
+ return /* @__PURE__ */ React26.createElement(import_ui16.Card, { elevation: 0, sx: { maxWidth: 300 } }, /* @__PURE__ */ React26.createElement(import_ui16.CardContent, null, /* @__PURE__ */ React26.createElement(import_ui16.Typography, { variant: "subtitle2", sx: { mb: 2 } }, (0, import_i18n21.__)("Refreshed Top Bar layout!", "elementor")), /* @__PURE__ */ React26.createElement(import_ui16.Typography, { variant: "body2" }, (0, import_i18n21.__)("We\u2019ve fine-tuned the Top Bar to make navigation faster and smoother.", "elementor"))), /* @__PURE__ */ React26.createElement(import_ui16.CardActions, { sx: { pt: 0 } }, /* @__PURE__ */ React26.createElement(
1277
+ import_ui16.Button,
1278
+ {
1279
+ size: "small",
1280
+ color: "secondary",
1281
+ href: "https://go.elementor.com/editor-top-bar-learn/",
1282
+ target: "_blank"
1283
+ },
1284
+ (0, import_i18n21.__)("Learn More", "elementor")
1285
+ ), /* @__PURE__ */ React26.createElement(import_ui16.Button, { size: "small", variant: "contained", onClick: handleDismiss }, (0, import_i18n21.__)("Got it", "elementor"))));
1286
+ };
1287
+ var StructureIconWithPopup = () => {
1288
+ const [showPopup, setShowPopup] = (0, import_react5.useState)(false);
1289
+ (0, import_react5.useEffect)(() => {
1290
+ if (extendedWindow.elementorShowInfotip?.shouldShow === "1") {
1291
+ setShowPopup(true);
1292
+ }
1293
+ }, []);
1294
+ const handleClosePopup = () => {
1295
+ setShowPopup(false);
1296
+ };
1297
+ if (extendedWindow.elementorShowInfotip?.shouldShow !== "1") {
1298
+ return /* @__PURE__ */ React26.createElement(import_icons19.StructureIcon, null);
1299
+ }
1300
+ return /* @__PURE__ */ React26.createElement(
1301
+ import_ui16.Infotip,
1302
+ {
1303
+ placement: "bottom",
1304
+ arrow: false,
1305
+ content: /* @__PURE__ */ React26.createElement(StructurePopupContent, { onClose: handleClosePopup }),
1306
+ open: showPopup,
1307
+ PopperProps: {
1308
+ modifiers: [
1309
+ {
1310
+ name: "offset",
1311
+ options: { offset: [-16, 12] }
1312
+ }
1313
+ ]
1314
+ }
1315
+ },
1316
+ /* @__PURE__ */ React26.createElement(import_icons19.StructureIcon, null)
1317
+ );
1318
+ };
1319
+
1320
+ // src/extensions/structure/hooks/use-action-props.ts
1263
1321
  function useActionProps9() {
1264
1322
  const { isActive, isBlocked } = (0, import_editor_v1_adapters12.__privateUseRouteStatus)("navigator");
1265
1323
  return {
1266
- title: (0, import_i18n21.__)("Structure", "elementor"),
1267
- icon: import_icons19.StructureIcon,
1324
+ title: (0, import_i18n22.__)("Structure", "elementor"),
1325
+ icon: StructureIconWithPopup,
1268
1326
  onClick: () => {
1269
- const extendedWindow = window;
1270
- const config = extendedWindow?.elementorCommon?.eventsManager?.config;
1327
+ const extendedWindow2 = window;
1328
+ const config = extendedWindow2?.elementorCommon?.eventsManager?.config;
1271
1329
  if (config) {
1272
- extendedWindow.elementorCommon.eventsManager.dispatchEvent(config.names.topBar.structure, {
1330
+ extendedWindow2.elementorCommon.eventsManager.dispatchEvent(config.names.topBar.structure, {
1273
1331
  location: config.locations.topBar,
1274
1332
  secondaryLocation: config.secondaryLocations.structure,
1275
1333
  trigger: config.triggers.toggleClick,
@@ -1295,16 +1353,16 @@ function init12() {
1295
1353
  // src/extensions/theme-builder/hooks/use-action-props.ts
1296
1354
  var import_editor_v1_adapters13 = require("@elementor/editor-v1-adapters");
1297
1355
  var import_icons20 = require("@elementor/icons");
1298
- var import_i18n22 = require("@wordpress/i18n");
1356
+ var import_i18n23 = require("@wordpress/i18n");
1299
1357
  function useActionProps10() {
1300
1358
  return {
1301
1359
  icon: import_icons20.ThemeBuilderIcon,
1302
- title: (0, import_i18n22.__)("Theme Builder", "elementor"),
1360
+ title: (0, import_i18n23.__)("Theme Builder", "elementor"),
1303
1361
  onClick: () => {
1304
- const extendedWindow = window;
1305
- const config = extendedWindow?.elementorCommon?.eventsManager?.config;
1362
+ const extendedWindow2 = window;
1363
+ const config = extendedWindow2?.elementorCommon?.eventsManager?.config;
1306
1364
  if (config) {
1307
- extendedWindow.elementorCommon.eventsManager.dispatchEvent(config.names.topBar.themeBuilder, {
1365
+ extendedWindow2.elementorCommon.eventsManager.dispatchEvent(config.names.topBar.themeBuilder, {
1308
1366
  location: config.locations.topBar,
1309
1367
  secondaryLocation: config.secondaryLocations.elementorLogo,
1310
1368
  trigger: config.triggers.click,
@@ -1329,17 +1387,17 @@ function init13() {
1329
1387
  // src/extensions/user-preferences/hooks/use-action-props.ts
1330
1388
  var import_editor_v1_adapters14 = require("@elementor/editor-v1-adapters");
1331
1389
  var import_icons21 = require("@elementor/icons");
1332
- var import_i18n23 = require("@wordpress/i18n");
1390
+ var import_i18n24 = require("@wordpress/i18n");
1333
1391
  function useActionProps11() {
1334
1392
  const { isActive, isBlocked } = (0, import_editor_v1_adapters14.__privateUseRouteStatus)("panel/editor-preferences");
1335
1393
  return {
1336
1394
  icon: import_icons21.ToggleRightIcon,
1337
- title: (0, import_i18n23.__)("User Preferences", "elementor"),
1395
+ title: (0, import_i18n24.__)("User Preferences", "elementor"),
1338
1396
  onClick: () => {
1339
- const extendedWindow = window;
1340
- const config = extendedWindow?.elementorCommon?.eventsManager?.config;
1397
+ const extendedWindow2 = window;
1398
+ const config = extendedWindow2?.elementorCommon?.eventsManager?.config;
1341
1399
  if (config) {
1342
- extendedWindow.elementorCommon.eventsManager.dispatchEvent(config.names.topBar.userPreferences, {
1400
+ extendedWindow2.elementorCommon.eventsManager.dispatchEvent(config.names.topBar.userPreferences, {
1343
1401
  location: config.locations.topBar,
1344
1402
  secondaryLocation: config.secondaryLocations.elementorLogo,
1345
1403
  trigger: config.triggers.click,
@@ -1366,7 +1424,7 @@ function init14() {
1366
1424
  // src/extensions/wordpress/index.ts
1367
1425
  var import_editor_documents10 = require("@elementor/editor-documents");
1368
1426
  var import_icons22 = require("@elementor/icons");
1369
- var import_i18n24 = require("@wordpress/i18n");
1427
+ var import_i18n25 = require("@wordpress/i18n");
1370
1428
  function init15() {
1371
1429
  mainMenu.registerLink({
1372
1430
  id: "exit-to-wordpress",
@@ -1375,14 +1433,14 @@ function init15() {
1375
1433
  useProps: () => {
1376
1434
  const document2 = (0, import_editor_documents10.__useActiveDocument)();
1377
1435
  return {
1378
- title: (0, import_i18n24.__)("Exit to WordPress", "elementor"),
1436
+ title: (0, import_i18n25.__)("Exit to WordPress", "elementor"),
1379
1437
  href: document2?.links?.platformEdit,
1380
1438
  icon: import_icons22.WordpressIcon,
1381
1439
  onClick: () => {
1382
- const extendedWindow = window;
1383
- const config = extendedWindow?.elementorCommon?.eventsManager?.config;
1440
+ const extendedWindow2 = window;
1441
+ const config = extendedWindow2?.elementorCommon?.eventsManager?.config;
1384
1442
  if (config) {
1385
- extendedWindow.elementorCommon.eventsManager.dispatchEvent(
1443
+ extendedWindow2.elementorCommon.eventsManager.dispatchEvent(
1386
1444
  config.names.topBar.exitToWordpress,
1387
1445
  {
1388
1446
  location: config.locations.topBar,