@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.mjs CHANGED
@@ -418,7 +418,7 @@ function SendFeedbackPopupLocation() {
418
418
  const [feedbackContent, setFeedbackContent] = useState2("");
419
419
  const [feedbackResult, setFeedbackResult] = useState2(null);
420
420
  const [submitDisabled, setSubmitDisabled] = useState2(true);
421
- const { dispatchEvent: trackEvent = (...args) => void args } = useMixpanel();
421
+ const { dispatchEvent: trackEvent2 = (...args) => void args } = useMixpanel();
422
422
  const popupState = usePopupState4({
423
423
  variant: "dialog",
424
424
  popupId: FEEDBACK_TOGGLE_EVENT
@@ -429,7 +429,7 @@ function SendFeedbackPopupLocation() {
429
429
  popupState.toggle();
430
430
  setIsUserConnected(checkIfUserIsConnected());
431
431
  setFeedbackResult(null);
432
- trackEvent("feedback_modal_opened", {
432
+ trackEvent2("feedback_modal_opened", {
433
433
  source: "top_bar",
434
434
  context: "v4_beta"
435
435
  });
@@ -438,13 +438,13 @@ function SendFeedbackPopupLocation() {
438
438
  return () => {
439
439
  window.removeEventListener(FEEDBACK_TOGGLE_EVENT, handler);
440
440
  };
441
- }, [popupState, trackEvent]);
441
+ }, [popupState, trackEvent2]);
442
442
  useEffect(() => {
443
443
  setSubmitDisabled(feedbackContent.trim().length < 10 || !isUserConnected || isFetching);
444
444
  }, [feedbackContent, feedbackResult, isUserConnected, isFetching]);
445
445
  const handleClose = () => {
446
446
  popupState.close();
447
- trackEvent("feedback_modal_closed", {
447
+ trackEvent2("feedback_modal_closed", {
448
448
  feedback_text: feedbackContent
449
449
  });
450
450
  };
@@ -464,7 +464,7 @@ function SendFeedbackPopupLocation() {
464
464
  if (!response.data.success && response.data.code.toString() === "401" || response.data.code.toString() === "403") {
465
465
  setIsUserConnected(false);
466
466
  }
467
- trackEvent(response.data.success ? "feedback_submitted" : "feedback_error", {
467
+ trackEvent2(response.data.success ? "feedback_submitted" : "feedback_error", {
468
468
  feedback_length: feedbackContent.length,
469
469
  error_type: response.data.success ? void 0 : "server",
470
470
  error_message: response.data.success ? void 0 : response.data.message
@@ -558,15 +558,30 @@ function AppBar() {
558
558
  }
559
559
 
560
560
  // src/extensions/angie/hooks/use-action-props.ts
561
+ import { useEffect as useEffect2 } from "react";
561
562
  import { isAngieAvailable } from "@elementor/editor-mcp";
563
+ import { trackEvent } from "@elementor/events";
562
564
  import { AngieIcon } from "@elementor/icons";
563
565
  import { __ as __5 } from "@wordpress/i18n";
564
566
  var CREATE_WIDGET_EVENT = "elementor/editor/create-widget";
567
+ var AI_WIDGET_CTA_VIEWED_EVENT = "ai_widget_cta_viewed";
565
568
  var CREATE_WIDGET_PROMPT = `Create a widget for me.
566
569
  Goal: [What should this widget help me accomplish?]
567
570
  Placement: [Where will I see it in the editor/UI?]
568
571
  How it should work: `;
569
572
  function useActionProps() {
573
+ const hasAngieInstalled = isAngieAvailable();
574
+ const visible = !hasAngieInstalled;
575
+ useEffect2(() => {
576
+ if (!visible) {
577
+ return;
578
+ }
579
+ trackEvent({
580
+ eventName: AI_WIDGET_CTA_VIEWED_EVENT,
581
+ entry_point: "top_bar_icon",
582
+ has_angie_installed: false
583
+ });
584
+ }, [visible]);
570
585
  return {
571
586
  title: __5("Angie", "elementor"),
572
587
  icon: AngieIcon,
@@ -575,13 +590,13 @@ function useActionProps() {
575
590
  new CustomEvent(CREATE_WIDGET_EVENT, {
576
591
  detail: {
577
592
  prompt: CREATE_WIDGET_PROMPT,
578
- entry_point: "top_bar"
593
+ entry_point: "top_bar_icon"
579
594
  }
580
595
  })
581
596
  );
582
597
  },
583
598
  selected: false,
584
- visible: !isAngieAvailable()
599
+ visible
585
600
  };
586
601
  }
587
602