1 line
12 KiB
JavaScript
1 line
12 KiB
JavaScript
|
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[392],{8278:function(e,t,a){var i=a(26372),o=a.n(i),s=a(2226),n=a(70079),r=a(8334),l=a(19382),c=a(57995),d=a(65317),m=a(46824),u=a(81433),p=a(56249),h=a(15063),b=e=>"web"in e?e.web:e.default,_=a(64645),g=a(97393),v=a(18883),x=a(7936),j=a(15312),S=a(89912),f=a(87895),N=(a(4114),a(35250)),y=a(48405),w=a(84638);function A(){const{isSidebarOpened:e,selectedStep:t,savedState:a}=(0,p.Z)((e=>({isSidebarOpened:e(w.storeName).isSidebarOpened,selectedStep:e(w.storeName).getSelectedStep,savedState:e(w.storeName).getSavedState()}))),{openSidebar:i,closeSidebar:o,save:s,toggleFeature:r}=(0,y.Z)(w.storeName),{registerShortcut:l}=(0,y.Z)(v.h);return(0,n.useEffect)((()=>{l({name:"mailpoet/automation-editor/toggle-fullscreen",category:"global",description:(0,x.__)("Toggle fullscreen mode.","mailpoet"),keyCombination:{modifier:"secondary",character:"f"}}),l({name:"mailpoet/automation-editor/toggle-sidebar",category:"global",description:(0,x.__)("Show or hide the settings sidebar.","mailpoet"),keyCombination:{modifier:"primaryShift",character:","}}),l({name:"mailpoet/automation-editor/save",category:"global",description:(0,x.__)("Save your changes.","mailpoet"),keyCombination:{modifier:"primary",character:"s"}})}),[l]),(0,v.bx)("mailpoet/automation-editor/toggle-fullscreen",(()=>{r("fullscreenMode")})),(0,v.bx)("mailpoet/automation-editor/toggle-sidebar",(a=>{if(a.preventDefault(),e())o();else{const e=t()?w.stepSidebarKey:w.automationSidebarKey;i(e)}})),(0,v.bx)("mailpoet/automation-editor/save",(e=>{e.preventDefault(),"unsaved"===a&&s()})),null}var Z=a(95858),k=a(51213);function D(e){let{sidebarKey:t}=e;const{openSidebar:a}=(0,y.Z)(w.storeName),[i,o]=t===w.automationSidebarKey?[(0,x.__)("Automation (selected)","mailpoet"),"is-active"]:[(0,x.__)("Automation","mailpoet"),""],[s,n]=t===w.stepSidebarKey?[(0,x.__)("Step (selected)","mailpoet"),"is-active"]:[(0,x.__)("Step","mailpoet"),""];return(0,N.jsxs)("ul",{children:[(0,N.jsx)("li",{children:(0,N.jsx)(l.ZP,{onClick:()=>a(w.automationSidebarKey),className:`edit-site-sidebar-edit-mode__panel-tab ${o}`,"aria-label":i,"data-label":(0,x.__)("Automation","mailpoet"),children:(0,x.__)("Automation","mailpoet")})}),(0,N.jsx)("li",{children:(0,N.jsx)(l.ZP,{onClick:()=>a(w.stepSidebarKey),className:`edit-site-sidebar-edit-mode__panel-tab ${n}`,"aria-label":s,"data-label":(0,x.__)("Step","mailpoet"),children:(0,x.__)("Step","mailpoet")})})]})}var C=a(68806),E=a(85606),L=a(47294),O=a(48927),I=a(66276);function K(e){let{title:t,description:a,icon:i}=e;return(0,N.jsxs)("div",{className:"block-editor-block-card",children:[(0,N.jsx)(I.Z,{icon:i}),(0,N.jsxs)("div",{className:"block-editor-block-card__content",children:[(0,N.jsx)("h2",{className:"block-editor-block-card__title",children:t}),(0,N.jsx)("span",{className:"block-editor-block-card__description",children:a})]})]})}function P(){const{errors:e}=(0,p.Z)((e=>({errors:e(w.storeName).getStepError(e(w.storeName).getSelectedStep().id)})),[]);if(!e||!e?.fields)return null;const t=e.fields?.general;return t?(0,N.jsx)(C.Z,{isDismissible:!1,status:"error",children:t}):null}function F(){const{selectedStep:e,selectedStepType:t}=(0,p.Z)((e=>({selectedStep:e(w.storeName).getSelectedStep(),selectedStepType:e(w.storeName).getSelectedStepType()})),[]);if(!e)return(0,N.jsx)(E.Z,{children:"No step selected."});if(!t)return(0,N.jsx)(E.Z,{children:"Unknown step type."});const a=t.edit;return(0,N.jsxs)("div",{className:"block-editor-block-inspector",children:[(0,N.jsx)(P,{}),(0,N.jsx)(K,{title:t.title(e,"sidebar"),description:t.description(e,"sidebar"),icon:t.icon}),(0,N.jsx)(a,{},e.id),"trigger"===e.type&&(0,N.jsx)(O.G9,{strings:L.E})]})}var T=a(86558),V=a(77309),M=a(34379),B=a(84209);function G(){const e=B.Hooks.applyFilters("mailpoet.automation.settings.render",{});return 0===Object.keys(e).length?null:(0,N.jsx)(E.Z,{title:(0,x.__)("Automation settings","mailpoet"),initialOpen:!0,children:Object.keys(e).map((t=>(0,N.jsx)(T.Z,{children:e[t]},t)))})}function q(){const{automationData:e}=(0,p.Z)((e=>({automatio
|