@elementor/editor-app-bar 4.2.0-866 → 4.2.0-868
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 +32 -17
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +22 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +11 -11
- package/src/components/locations/tools-menu-location.tsx +1 -1
- package/src/extensions/angie/components/angie-guide-card.tsx +1 -1
- package/src/extensions/angie/components/angie-guide-location.tsx +4 -2
- package/src/extensions/angie/hooks/use-action-props.ts +1 -1
- package/src/extensions/angie/hooks/use-auto-show.ts +17 -0
- package/src/extensions/angie/index.ts +1 -1
package/dist/index.js
CHANGED
|
@@ -377,7 +377,7 @@ var React20 = __toESM(require("react"));
|
|
|
377
377
|
|
|
378
378
|
// src/extensions/angie/components/angie-guide-location.tsx
|
|
379
379
|
var React15 = __toESM(require("react"));
|
|
380
|
-
var
|
|
380
|
+
var import_react4 = require("react");
|
|
381
381
|
var import_editor_ui = require("@elementor/editor-ui");
|
|
382
382
|
var import_events = require("@elementor/events");
|
|
383
383
|
var import_ui8 = require("@elementor/ui");
|
|
@@ -424,12 +424,27 @@ function AngieGuideCard({ imageUrl, description, learnMoreUrl, onInstall, onClos
|
|
|
424
424
|
), /* @__PURE__ */ React14.createElement(import_ui7.Button, { variant: "contained", size: "small", color: "accent", onClick: onInstall }, (0, import_i18n3.__)("Try for free", "elementor")))));
|
|
425
425
|
}
|
|
426
426
|
|
|
427
|
+
// src/extensions/angie/hooks/use-auto-show.ts
|
|
428
|
+
var import_react3 = require("react");
|
|
429
|
+
function useAutoShow() {
|
|
430
|
+
(0, import_react3.useEffect)(() => {
|
|
431
|
+
if (!window.elementor?.config?.angie?.autoShow) {
|
|
432
|
+
return;
|
|
433
|
+
}
|
|
434
|
+
const id = setTimeout(() => {
|
|
435
|
+
window.dispatchEvent(new CustomEvent(ANGIE_GUIDE_TOGGLE_EVENT));
|
|
436
|
+
}, 0);
|
|
437
|
+
return () => clearTimeout(id);
|
|
438
|
+
}, []);
|
|
439
|
+
}
|
|
440
|
+
|
|
427
441
|
// src/extensions/angie/components/angie-guide-location.tsx
|
|
428
442
|
function AngieGuideLocation() {
|
|
429
|
-
|
|
443
|
+
useAutoShow();
|
|
444
|
+
const [anchorEl, setAnchorEl] = (0, import_react4.useState)(null);
|
|
430
445
|
const { dispatchEvent: dispatchEvent2 } = (0, import_events.useMixpanel)();
|
|
431
446
|
const isOpen = Boolean(anchorEl);
|
|
432
|
-
(0,
|
|
447
|
+
(0, import_react4.useEffect)(() => {
|
|
433
448
|
const handleToggle = () => {
|
|
434
449
|
setAnchorEl((prev) => {
|
|
435
450
|
if (prev) {
|
|
@@ -536,7 +551,7 @@ function IntegrationsMenuLocation() {
|
|
|
536
551
|
|
|
537
552
|
// src/components/locations/send-feedback-popup-location.tsx
|
|
538
553
|
var React19 = __toESM(require("react"));
|
|
539
|
-
var
|
|
554
|
+
var import_react5 = require("react");
|
|
540
555
|
var import_editor_ui2 = require("@elementor/editor-ui");
|
|
541
556
|
var import_editor_v1_adapters = require("@elementor/editor-v1-adapters");
|
|
542
557
|
var import_events2 = require("@elementor/events");
|
|
@@ -557,18 +572,18 @@ var checkIfUserIsConnected = () => {
|
|
|
557
572
|
function SendFeedbackPopupLocation() {
|
|
558
573
|
const isActive = (0, import_editor_v1_adapters.isExperimentActive)(EXPERIMENT_NAME);
|
|
559
574
|
const extendedWindow = window;
|
|
560
|
-
const [isUserConnected, setIsUserConnected] = (0,
|
|
575
|
+
const [isUserConnected, setIsUserConnected] = (0, import_react5.useState)(checkIfUserIsConnected());
|
|
561
576
|
const connectUrl = extendedWindow?.elementor?.config.user.top_bar.connect_url;
|
|
562
|
-
const [feedbackContent, setFeedbackContent] = (0,
|
|
563
|
-
const [feedbackResult, setFeedbackResult] = (0,
|
|
564
|
-
const [submitDisabled, setSubmitDisabled] = (0,
|
|
577
|
+
const [feedbackContent, setFeedbackContent] = (0, import_react5.useState)("");
|
|
578
|
+
const [feedbackResult, setFeedbackResult] = (0, import_react5.useState)(null);
|
|
579
|
+
const [submitDisabled, setSubmitDisabled] = (0, import_react5.useState)(true);
|
|
565
580
|
const { dispatchEvent: trackEvent2 = (...args) => void args } = (0, import_events2.useMixpanel)();
|
|
566
581
|
const popupState = (0, import_ui12.usePopupState)({
|
|
567
582
|
variant: "dialog",
|
|
568
583
|
popupId: FEEDBACK_TOGGLE_EVENT
|
|
569
584
|
});
|
|
570
|
-
const [isFetching, setIsFetching] = (0,
|
|
571
|
-
(0,
|
|
585
|
+
const [isFetching, setIsFetching] = (0, import_react5.useState)(false);
|
|
586
|
+
(0, import_react5.useEffect)(() => {
|
|
572
587
|
const handler = () => {
|
|
573
588
|
popupState.toggle();
|
|
574
589
|
setIsUserConnected(checkIfUserIsConnected());
|
|
@@ -583,7 +598,7 @@ function SendFeedbackPopupLocation() {
|
|
|
583
598
|
window.removeEventListener(FEEDBACK_TOGGLE_EVENT, handler);
|
|
584
599
|
};
|
|
585
600
|
}, [popupState, trackEvent2]);
|
|
586
|
-
(0,
|
|
601
|
+
(0, import_react5.useEffect)(() => {
|
|
587
602
|
setSubmitDisabled(feedbackContent.trim().length < 10 || !isUserConnected || isFetching);
|
|
588
603
|
}, [feedbackContent, feedbackResult, isUserConnected, isFetching]);
|
|
589
604
|
const handleClose = () => {
|
|
@@ -684,7 +699,7 @@ function ToolsMenuLocation() {
|
|
|
684
699
|
|
|
685
700
|
// src/components/locations/utilities-menu-location.tsx
|
|
686
701
|
var React21 = __toESM(require("react"));
|
|
687
|
-
var
|
|
702
|
+
var import_react6 = require("react");
|
|
688
703
|
var MAX_TOOLBAR_ACTIONS2 = 4;
|
|
689
704
|
var { useMenuItems: useMenuItems4 } = utilitiesMenu;
|
|
690
705
|
function UtilitiesMenuLocation() {
|
|
@@ -692,7 +707,7 @@ function UtilitiesMenuLocation() {
|
|
|
692
707
|
const shouldUsePopover = menuItems.default.length > MAX_TOOLBAR_ACTIONS2 + 1;
|
|
693
708
|
const toolbarMenuItems = shouldUsePopover ? menuItems.default.slice(0, MAX_TOOLBAR_ACTIONS2) : menuItems.default;
|
|
694
709
|
const popoverMenuItems = shouldUsePopover ? menuItems.default.slice(MAX_TOOLBAR_ACTIONS2) : [];
|
|
695
|
-
return /* @__PURE__ */ React21.createElement(ToolbarMenu, null, toolbarMenuItems.map(({ MenuItem: MenuItem2, id }) => /* @__PURE__ */ React21.createElement(
|
|
710
|
+
return /* @__PURE__ */ React21.createElement(ToolbarMenu, null, toolbarMenuItems.map(({ MenuItem: MenuItem2, id }) => /* @__PURE__ */ React21.createElement(import_react6.Fragment, { key: id }, /* @__PURE__ */ React21.createElement(MenuItem2, null))), popoverMenuItems.length > 0 && /* @__PURE__ */ React21.createElement(ToolbarMenuMore, { id: "elementor-editor-app-bar-utilities-more" }, popoverMenuItems.map(({ MenuItem: MenuItem2, id }) => /* @__PURE__ */ React21.createElement(MenuItem2, { key: id }))));
|
|
696
711
|
}
|
|
697
712
|
|
|
698
713
|
// src/components/app-bar.tsx
|
|
@@ -702,7 +717,7 @@ function AppBar() {
|
|
|
702
717
|
}
|
|
703
718
|
|
|
704
719
|
// src/extensions/angie/hooks/use-action-props.ts
|
|
705
|
-
var
|
|
720
|
+
var import_react7 = require("react");
|
|
706
721
|
var import_editor_mcp = require("@elementor/editor-mcp");
|
|
707
722
|
var import_events3 = require("@elementor/events");
|
|
708
723
|
var import_icons5 = require("@elementor/icons");
|
|
@@ -710,7 +725,7 @@ var import_i18n7 = require("@wordpress/i18n");
|
|
|
710
725
|
function useActionProps() {
|
|
711
726
|
const hasAngieInstalled = (0, import_editor_mcp.isAngieAvailable)();
|
|
712
727
|
const visible = !hasAngieInstalled;
|
|
713
|
-
(0,
|
|
728
|
+
(0, import_react7.useEffect)(() => {
|
|
714
729
|
if (!visible) {
|
|
715
730
|
return;
|
|
716
731
|
}
|
|
@@ -741,7 +756,7 @@ function init() {
|
|
|
741
756
|
}
|
|
742
757
|
|
|
743
758
|
// src/extensions/connect/hooks/use-connect-link-config.tsx
|
|
744
|
-
var
|
|
759
|
+
var import_react8 = require("react");
|
|
745
760
|
var import_icons6 = require("@elementor/icons");
|
|
746
761
|
var import_i18n8 = require("@wordpress/i18n");
|
|
747
762
|
var dispatchConnectClickEvent = (eventName) => {
|
|
@@ -771,7 +786,7 @@ function useConnectLinkConfig() {
|
|
|
771
786
|
isUserConnected = extendedWindow?.elementorCommon?.config.library_connect.is_connected ?? false;
|
|
772
787
|
target = "_self";
|
|
773
788
|
}
|
|
774
|
-
const handleConnectClick = (0,
|
|
789
|
+
const handleConnectClick = (0, import_react8.useCallback)(
|
|
775
790
|
(event) => {
|
|
776
791
|
event.preventDefault();
|
|
777
792
|
if (extendedWindow.jQuery && extendedWindow.jQuery.fn?.elementorConnect) {
|