@elementor/editor-app-bar 3.35.5 → 3.35.6

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
@@ -831,15 +831,33 @@ import {
831
831
  __useActiveDocument as useActiveDocument4,
832
832
  __useActiveDocumentActions as useActiveDocumentActions2
833
833
  } from "@elementor/editor-documents";
834
+ import { useMixpanel as useMixpanel2 } from "@elementor/events";
834
835
  import { LinkIcon } from "@elementor/icons";
835
836
  import { __ as __8 } from "@wordpress/i18n";
836
837
  function useDocumentCopyAndShareProps() {
837
838
  const document2 = useActiveDocument4();
838
839
  const { copyAndShare } = useActiveDocumentActions2();
840
+ const { dispatchEvent: dispatchEvent2, config } = useMixpanel2();
839
841
  return {
840
842
  icon: LinkIcon,
841
843
  title: __8("Copy and Share", "elementor"),
842
- onClick: copyAndShare,
844
+ onClick: () => {
845
+ const eventName = config?.names?.editorOne?.topBarPublishDropdown;
846
+ if (eventName) {
847
+ dispatchEvent2?.(eventName, {
848
+ app_type: config?.appTypes?.editor,
849
+ window_name: config?.appTypes?.editor,
850
+ interaction_type: config?.triggers?.click?.toLowerCase(),
851
+ target_type: config?.targetTypes?.dropdownItem,
852
+ target_name: config?.targetNames?.publishDropdown?.copyAndShare,
853
+ interaction_result: config?.interactionResults?.actionSelected,
854
+ target_location: config?.locations?.topBar?.replace(/\s+/g, "_").toLowerCase(),
855
+ location_l1: config?.secondaryLocations?.publishDropdown?.replace(/\s+/g, "_").toLowerCase(),
856
+ location_l2: config?.targetTypes?.dropdownItem
857
+ });
858
+ }
859
+ copyAndShare();
860
+ },
843
861
  disabled: !document2 || document2.isSaving || document2.isSavingDraft || !("publish" === document2.status.value),
844
862
  visible: document2?.permissions?.showCopyAndShare
845
863
  };
@@ -850,45 +868,101 @@ import {
850
868
  __useActiveDocument as useActiveDocument5,
851
869
  __useActiveDocumentActions as useActiveDocumentActions3
852
870
  } from "@elementor/editor-documents";
871
+ import { useMixpanel as useMixpanel3 } from "@elementor/events";
853
872
  import { FileReportIcon } from "@elementor/icons";
854
873
  import { __ as __9 } from "@wordpress/i18n";
855
874
  function useDocumentSaveDraftProps() {
856
875
  const document2 = useActiveDocument5();
857
876
  const { saveDraft } = useActiveDocumentActions3();
877
+ const { dispatchEvent: dispatchEvent2, config } = useMixpanel3();
858
878
  return {
859
879
  icon: FileReportIcon,
860
880
  title: __9("Save Draft", "elementor"),
861
- onClick: saveDraft,
881
+ onClick: () => {
882
+ const eventName = config?.names?.editorOne?.topBarPublishDropdown;
883
+ if (eventName) {
884
+ dispatchEvent2?.(eventName, {
885
+ app_type: config?.appTypes?.editor,
886
+ window_name: config?.appTypes?.editor,
887
+ interaction_type: config?.triggers?.click?.toLowerCase(),
888
+ target_type: config?.targetTypes?.dropdownItem,
889
+ target_name: config?.targetNames?.publishDropdown?.saveDraft,
890
+ interaction_result: config?.interactionResults?.actionSelected,
891
+ target_location: config?.locations?.topBar?.replace(/\s+/g, "_").toLowerCase(),
892
+ location_l1: config?.secondaryLocations?.publishDropdown?.replace(/\s+/g, "_").toLowerCase(),
893
+ location_l2: config?.targetTypes?.dropdownItem
894
+ });
895
+ }
896
+ saveDraft();
897
+ },
862
898
  disabled: !document2 || document2.isSaving || document2.isSavingDraft || !document2.isDirty
863
899
  };
864
900
  }
865
901
 
866
902
  // src/extensions/documents-save/hooks/use-document-save-template-props.ts
867
903
  import { __useActiveDocumentActions as useActiveDocumentActions4 } from "@elementor/editor-documents";
904
+ import { useMixpanel as useMixpanel4 } from "@elementor/events";
868
905
  import { FolderIcon } from "@elementor/icons";
869
906
  import { __ as __10 } from "@wordpress/i18n";
870
907
  function useDocumentSaveTemplateProps() {
871
908
  const { saveTemplate } = useActiveDocumentActions4();
909
+ const { dispatchEvent: dispatchEvent2, config } = useMixpanel4();
872
910
  return {
873
911
  icon: FolderIcon,
874
912
  title: __10("Save as Template", "elementor"),
875
- onClick: saveTemplate
913
+ onClick: () => {
914
+ const eventName = config?.names?.editorOne?.topBarPublishDropdown;
915
+ if (eventName) {
916
+ dispatchEvent2?.(eventName, {
917
+ app_type: config?.appTypes?.editor,
918
+ window_name: config?.appTypes?.editor,
919
+ interaction_type: config?.triggers?.click?.toLowerCase(),
920
+ target_type: config?.targetTypes?.dropdownItem,
921
+ target_name: config?.targetNames?.publishDropdown?.saveAsTemplate,
922
+ interaction_result: config?.interactionResults?.actionSelected,
923
+ target_location: config?.locations?.topBar?.replace(/\s+/g, "_").toLowerCase(),
924
+ location_l1: config?.secondaryLocations?.publishDropdown?.replace(/\s+/g, "_").toLowerCase(),
925
+ location_l2: config?.targetTypes?.dropdownItem
926
+ });
927
+ }
928
+ saveTemplate();
929
+ }
876
930
  };
877
931
  }
878
932
 
879
933
  // src/extensions/documents-save/hooks/use-document-view-page-props.ts
880
934
  import { __useActiveDocument as useActiveDocument6 } from "@elementor/editor-documents";
881
935
  import { __privateRunCommand as runCommand2 } from "@elementor/editor-v1-adapters";
936
+ import { useMixpanel as useMixpanel5 } from "@elementor/events";
882
937
  import { EyeIcon as EyeIcon2 } from "@elementor/icons";
883
938
  import { __ as __11 } from "@wordpress/i18n";
884
939
  function useDocumentViewPageProps() {
885
940
  const document2 = useActiveDocument6();
941
+ const { dispatchEvent: dispatchEvent2, config } = useMixpanel5();
886
942
  return {
887
943
  icon: EyeIcon2,
888
944
  title: __11("View Page", "elementor"),
889
- onClick: () => document2?.id && runCommand2("editor/documents/view", {
890
- id: document2.id
891
- })
945
+ onClick: () => {
946
+ const eventName = config?.names?.editorOne?.topBarPublishDropdown;
947
+ if (eventName) {
948
+ dispatchEvent2?.(eventName, {
949
+ app_type: config?.appTypes?.editor,
950
+ window_name: config?.appTypes?.editor,
951
+ interaction_type: config?.triggers?.click?.toLowerCase(),
952
+ target_type: config?.targetTypes?.dropdownItem,
953
+ target_name: config?.targetNames?.publishDropdown?.viewPage,
954
+ interaction_result: config?.interactionResults?.actionSelected,
955
+ target_location: config?.locations?.topBar?.replace(/\s+/g, "_").toLowerCase(),
956
+ location_l1: config?.secondaryLocations?.publishDropdown?.replace(/\s+/g, "_").toLowerCase(),
957
+ location_l2: config?.targetTypes?.dropdownItem
958
+ });
959
+ }
960
+ if (document2?.id) {
961
+ runCommand2("editor/documents/view", {
962
+ id: document2.id
963
+ });
964
+ }
965
+ }
892
966
  };
893
967
  }
894
968