@elementor/editor-app-bar 4.2.0-844 → 4.2.0-846

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
@@ -450,7 +450,7 @@ function SendFeedbackPopupLocation() {
450
450
  const [feedbackContent, setFeedbackContent] = (0, import_react3.useState)("");
451
451
  const [feedbackResult, setFeedbackResult] = (0, import_react3.useState)(null);
452
452
  const [submitDisabled, setSubmitDisabled] = (0, import_react3.useState)(true);
453
- const { dispatchEvent: trackEvent = (...args) => void args } = (0, import_events.useMixpanel)();
453
+ const { dispatchEvent: trackEvent2 = (...args) => void args } = (0, import_events.useMixpanel)();
454
454
  const popupState = (0, import_ui10.usePopupState)({
455
455
  variant: "dialog",
456
456
  popupId: FEEDBACK_TOGGLE_EVENT
@@ -461,7 +461,7 @@ function SendFeedbackPopupLocation() {
461
461
  popupState.toggle();
462
462
  setIsUserConnected(checkIfUserIsConnected());
463
463
  setFeedbackResult(null);
464
- trackEvent("feedback_modal_opened", {
464
+ trackEvent2("feedback_modal_opened", {
465
465
  source: "top_bar",
466
466
  context: "v4_beta"
467
467
  });
@@ -470,13 +470,13 @@ function SendFeedbackPopupLocation() {
470
470
  return () => {
471
471
  window.removeEventListener(FEEDBACK_TOGGLE_EVENT, handler);
472
472
  };
473
- }, [popupState, trackEvent]);
473
+ }, [popupState, trackEvent2]);
474
474
  (0, import_react3.useEffect)(() => {
475
475
  setSubmitDisabled(feedbackContent.trim().length < 10 || !isUserConnected || isFetching);
476
476
  }, [feedbackContent, feedbackResult, isUserConnected, isFetching]);
477
477
  const handleClose = () => {
478
478
  popupState.close();
479
- trackEvent("feedback_modal_closed", {
479
+ trackEvent2("feedback_modal_closed", {
480
480
  feedback_text: feedbackContent
481
481
  });
482
482
  };
@@ -496,7 +496,7 @@ function SendFeedbackPopupLocation() {
496
496
  if (!response.data.success && response.data.code.toString() === "401" || response.data.code.toString() === "403") {
497
497
  setIsUserConnected(false);
498
498
  }
499
- trackEvent(response.data.success ? "feedback_submitted" : "feedback_error", {
499
+ trackEvent2(response.data.success ? "feedback_submitted" : "feedback_error", {
500
500
  feedback_length: feedbackContent.length,
501
501
  error_type: response.data.success ? void 0 : "server",
502
502
  error_message: response.data.success ? void 0 : response.data.message
@@ -590,15 +590,30 @@ function AppBar() {
590
590
  }
591
591
 
592
592
  // src/extensions/angie/hooks/use-action-props.ts
593
+ var import_react5 = require("react");
593
594
  var import_editor_mcp = require("@elementor/editor-mcp");
595
+ var import_events2 = require("@elementor/events");
594
596
  var import_icons5 = require("@elementor/icons");
595
597
  var import_i18n5 = require("@wordpress/i18n");
596
598
  var CREATE_WIDGET_EVENT = "elementor/editor/create-widget";
599
+ var AI_WIDGET_CTA_VIEWED_EVENT = "ai_widget_cta_viewed";
597
600
  var CREATE_WIDGET_PROMPT = `Create a widget for me.
598
601
  Goal: [What should this widget help me accomplish?]
599
602
  Placement: [Where will I see it in the editor/UI?]
600
603
  How it should work: `;
601
604
  function useActionProps() {
605
+ const hasAngieInstalled = (0, import_editor_mcp.isAngieAvailable)();
606
+ const visible = !hasAngieInstalled;
607
+ (0, import_react5.useEffect)(() => {
608
+ if (!visible) {
609
+ return;
610
+ }
611
+ (0, import_events2.trackEvent)({
612
+ eventName: AI_WIDGET_CTA_VIEWED_EVENT,
613
+ entry_point: "top_bar_icon",
614
+ has_angie_installed: false
615
+ });
616
+ }, [visible]);
602
617
  return {
603
618
  title: (0, import_i18n5.__)("Angie", "elementor"),
604
619
  icon: import_icons5.AngieIcon,
@@ -607,13 +622,13 @@ function useActionProps() {
607
622
  new CustomEvent(CREATE_WIDGET_EVENT, {
608
623
  detail: {
609
624
  prompt: CREATE_WIDGET_PROMPT,
610
- entry_point: "top_bar"
625
+ entry_point: "top_bar_icon"
611
626
  }
612
627
  })
613
628
  );
614
629
  },
615
630
  selected: false,
616
- visible: !(0, import_editor_mcp.isAngieAvailable)()
631
+ visible
617
632
  };
618
633
  }
619
634
 
@@ -627,7 +642,7 @@ function init() {
627
642
  }
628
643
 
629
644
  // src/extensions/connect/hooks/use-connect-link-config.tsx
630
- var import_react5 = require("react");
645
+ var import_react6 = require("react");
631
646
  var import_icons6 = require("@elementor/icons");
632
647
  var import_i18n6 = require("@wordpress/i18n");
633
648
  var dispatchConnectClickEvent = (eventName) => {
@@ -657,7 +672,7 @@ function useConnectLinkConfig() {
657
672
  isUserConnected = extendedWindow?.elementorCommon?.config.library_connect.is_connected ?? false;
658
673
  target = "_self";
659
674
  }
660
- const handleConnectClick = (0, import_react5.useCallback)(
675
+ const handleConnectClick = (0, import_react6.useCallback)(
661
676
  (event) => {
662
677
  event.preventDefault();
663
678
  if (extendedWindow.jQuery && extendedWindow.jQuery.fn?.elementorConnect) {
@@ -885,13 +900,13 @@ function isPublishEnabled(document2) {
885
900
 
886
901
  // src/extensions/documents-save/hooks/use-document-copy-and-share-props.ts
887
902
  var import_editor_documents4 = require("@elementor/editor-documents");
888
- var import_events2 = require("@elementor/events");
903
+ var import_events3 = require("@elementor/events");
889
904
  var import_icons9 = require("@elementor/icons");
890
905
  var import_i18n9 = require("@wordpress/i18n");
891
906
  function useDocumentCopyAndShareProps() {
892
907
  const document2 = (0, import_editor_documents4.__useActiveDocument)();
893
908
  const { copyAndShare } = (0, import_editor_documents4.__useActiveDocumentActions)();
894
- const { dispatchEvent: dispatchEvent2, config } = (0, import_events2.useMixpanel)();
909
+ const { dispatchEvent: dispatchEvent2, config } = (0, import_events3.useMixpanel)();
895
910
  return {
896
911
  icon: import_icons9.LinkIcon,
897
912
  title: (0, import_i18n9.__)("Copy and Share", "elementor"),
@@ -919,13 +934,13 @@ function useDocumentCopyAndShareProps() {
919
934
 
920
935
  // src/extensions/documents-save/hooks/use-document-save-draft-props.ts
921
936
  var import_editor_documents5 = require("@elementor/editor-documents");
922
- var import_events3 = require("@elementor/events");
937
+ var import_events4 = require("@elementor/events");
923
938
  var import_icons10 = require("@elementor/icons");
924
939
  var import_i18n10 = require("@wordpress/i18n");
925
940
  function useDocumentSaveDraftProps() {
926
941
  const document2 = (0, import_editor_documents5.__useActiveDocument)();
927
942
  const { saveDraft } = (0, import_editor_documents5.__useActiveDocumentActions)();
928
- const { dispatchEvent: dispatchEvent2, config } = (0, import_events3.useMixpanel)();
943
+ const { dispatchEvent: dispatchEvent2, config } = (0, import_events4.useMixpanel)();
929
944
  return {
930
945
  icon: import_icons10.FileReportIcon,
931
946
  title: (0, import_i18n10.__)("Save Draft", "elementor"),
@@ -952,12 +967,12 @@ function useDocumentSaveDraftProps() {
952
967
 
953
968
  // src/extensions/documents-save/hooks/use-document-save-template-props.ts
954
969
  var import_editor_documents6 = require("@elementor/editor-documents");
955
- var import_events4 = require("@elementor/events");
970
+ var import_events5 = require("@elementor/events");
956
971
  var import_icons11 = require("@elementor/icons");
957
972
  var import_i18n11 = require("@wordpress/i18n");
958
973
  function useDocumentSaveTemplateProps() {
959
974
  const { saveTemplate } = (0, import_editor_documents6.__useActiveDocumentActions)();
960
- const { dispatchEvent: dispatchEvent2, config } = (0, import_events4.useMixpanel)();
975
+ const { dispatchEvent: dispatchEvent2, config } = (0, import_events5.useMixpanel)();
961
976
  return {
962
977
  icon: import_icons11.FolderIcon,
963
978
  title: (0, import_i18n11.__)("Save as Template", "elementor"),
@@ -1009,12 +1024,12 @@ function useDocumentViewAsMarkdownProps() {
1009
1024
  // src/extensions/documents-save/hooks/use-document-view-page-props.ts
1010
1025
  var import_editor_documents8 = require("@elementor/editor-documents");
1011
1026
  var import_editor_v1_adapters5 = require("@elementor/editor-v1-adapters");
1012
- var import_events5 = require("@elementor/events");
1027
+ var import_events6 = require("@elementor/events");
1013
1028
  var import_icons13 = require("@elementor/icons");
1014
1029
  var import_i18n13 = require("@wordpress/i18n");
1015
1030
  function useDocumentViewPageProps() {
1016
1031
  const document2 = (0, import_editor_documents8.__useActiveDocument)();
1017
- const { dispatchEvent: dispatchEvent2, config } = (0, import_events5.useMixpanel)();
1032
+ const { dispatchEvent: dispatchEvent2, config } = (0, import_events6.useMixpanel)();
1018
1033
  return {
1019
1034
  icon: import_icons13.EyeIcon,
1020
1035
  title: (0, import_i18n13.__)("View Page", "elementor"),