jamespot-react-core 1.1.121 → 1.1.122

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.
@@ -1,12 +1,19 @@
1
- "use strict";(self.webpackChunkReactCore=self.webpackChunkReactCore||[]).push([[562],{562:(e,t,n)=>{n.r(t),n.d(t,{DisplayForm:()=>m,EditorsPortal:()=>Ne,Empty:()=>g,TwoColLayout:()=>w,WidgetList:()=>de,WidgetWrapperCore:()=>ee});var i=n(363),l=n.n(i),o=n(230),a=n(185),r=n(754),c=n.n(r),s=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var l=0;for(i=Object.getOwnPropertySymbols(e);l<i.length;l++)t.indexOf(i[l])<0&&Object.prototype.propertyIsEnumerable.call(e,i[l])&&(n[i[l]]=e[i[l]])}return n};const d=c().form`
2
- ${e=>e.stretch&&"\n height: 100%;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n "}
1
+ "use strict";(self.webpackChunkReactCore=self.webpackChunkReactCore||[]).push([[562],{562:(e,t,n)=>{n.r(t),n.d(t,{DisplayForm:()=>E,EditorsPortal:()=>Ke,Empty:()=>f,TwoColLayout:()=>C,WidgetList:()=>pe,WidgetWrapperCore:()=>ie});var i=n(363),l=n.n(i),o=n(230),a=n(185),r=n(754),c=n.n(r),s=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var l=0;for(i=Object.getOwnPropertySymbols(e);l<i.length;l++)t.indexOf(i[l])<0&&Object.prototype.propertyIsEnumerable.call(e,i[l])&&(n[i[l]]=e[i[l]])}return n};const d=r.css`
2
+ height: 100%;
3
+ display: flex;
4
+ flex-direction: column;
5
+ justify-content: space-between;
3
6
  `,u=c().div`
7
+ ${({stretch:e})=>e&&d}
8
+ `,m=c().form`
9
+ ${({stretch:e})=>e&&d}
10
+ `,g=i.forwardRef(((e,t)=>e.onSubmit?i.createElement(m,{stretch:e.stretch,onSubmit:e.onSubmit,ref:t},e.children):i.createElement(u,{stretch:e.stretch,ref:t},e.children))),p=c().div`
4
11
  ${e=>e.stretch&&"\n flex: 1;\n"}
5
- `,m=i.forwardRef(((e,t)=>{const n=i.useRef(null),[l,r]=(0,a.GF)(e.fields,e.type),c=(0,o.useForm)({defaultValues:Object.assign(Object.assign({},r),e.defaultValues),criteriaMode:"all"}),{handleSubmit:m,control:g,reset:p}=c,E=s(c,["handleSubmit","control","reset"]);return i.useImperativeHandle(t,(()=>Object.assign(Object.assign({},E),{handleSubmit:m,control:g,reset:()=>{var e;null===(e=null==n?void 0:n.current)||void 0===e||e.scrollTo(0,0),p()}})),[]),i.createElement(d,{stretch:e.stretch,onSubmit:m(e.onSubmit),ref:n},i.createElement(u,{stretch:e.stretch},l.map((t=>{var{Input:n}=t,l=s(t,["Input"]);return i.createElement(n,Object.assign({key:l.name,control:g},l,{dataCy:`${e.dataCy}-${l.name}`,readOnly:e.readOnly}))})),e.extraInputs&&e.extraInputs(g)),e.buttons)})),g=()=>i.createElement(i.Fragment,null);var p=n(248),E=n(181),f=n(556);const y=f.default.registry.getLazyComponent("Container"),v=f.default.registry.getLazyComponent("AppColumn"),h=f.default.registry.getLazyComponent("MainColumn");function w({extensionRoute:e,routes:t,description:n,mode:l="center"}){var o;const a=(0,E.useIntl)(),{pathname:r}=(0,p.useLocation)(),c=Object.values(t),[s,d]=i.useState(null===(o=null==c?void 0:c[0])||void 0===o?void 0:o.key),u=c.map((t=>Object.assign(Object.assign({},t),{label:a.formatMessage({id:t.label}),href:t.absolutePath?t.path:`/ng/rr/${e}/${t.path}`,group:t.group?a.formatMessage({id:t.group}):void 0})));return i.useEffect((()=>{const t=c.find((t=>r===`/ng/rr/${e}/${t.path}`));t&&d(t.key)}),[r]),i.createElement(i.Suspense,{fallback:i.createElement(i.Fragment,null)},i.createElement(y,{mode:l},i.createElement(v,{mode:l,description:n,tabs:u,activeTab:s||""}),i.createElement(h,{mode:l},i.createElement(p.Outlet,null))))}var x=n(855),b=n(57);const C=f.default.registry.getLazyComponent("Loader"),L=({name:e,uniqid:t,inplace:n})=>{const i=(0,x.useSelector)((e=>b.$L.selectors.selectWidgetState(e,t))),o=b.$L.definition(e);return(null==i?void 0:i.loading)?l().createElement("div",{style:{position:"absolute",inset:0,backgroundColor:"rgba(255,255,255,.7)",display:"flex",flex:1,justifyContent:"center",alignItems:"center"}},l().createElement(C,null)):(null==i?void 0:i.hover)?l().createElement("div",{style:{position:"absolute",inset:0,backgroundColor:"rgba(255,255,255,.7)",display:"flex",flex:1,justifyContent:"center",alignItems:"center"}}):!(null==i?void 0:i.initialized)&&n||(null==i?void 0:i.initialized)||n?l().createElement(l().Fragment,null):l().createElement("div",{style:{position:"absolute",inset:0,backgroundColor:"rgba(255,255,255,1)",display:"flex",flex:1,justifyContent:"center",alignItems:"center"}},l().createElement("img",{src:o.img}))};var q=n(903);const $=c().div`
12
+ `,E=i.forwardRef(((e,t)=>{const n=i.useRef(null),[l,r]=(0,a.GF)(e.fields,e.type),c=(0,o.useForm)({defaultValues:Object.assign(Object.assign({},r),e.defaultValues),criteriaMode:"all"}),{handleSubmit:d,control:u,reset:m}=c,E=s(c,["handleSubmit","control","reset"]);return i.useImperativeHandle(t,(()=>Object.assign(Object.assign({},E),{handleSubmit:d,control:u,reset:()=>{var e;null===(e=null==n?void 0:n.current)||void 0===e||e.scrollTo(0,0),m()}})),[]),i.createElement(g,{stretch:e.stretch,onSubmit:e.onSubmit?d(e.onSubmit):void 0,ref:n},i.createElement(p,{stretch:e.stretch},l.map((t=>{var{Input:n}=t,l=s(t,["Input"]);return i.createElement(n,Object.assign({key:l.name,control:u},l,{dataCy:`${e.dataCy}-${l.name}`,readOnly:e.readOnly}))})),e.extraInputs&&e.extraInputs(u)),e.buttons)})),f=()=>i.createElement(i.Fragment,null);var y=n(248),v=n(181),h=n(556);const w=h.default.registry.getLazyComponent("Container"),x=h.default.registry.getLazyComponent("AppColumn"),b=h.default.registry.getLazyComponent("MainColumn");function C({extensionRoute:e,routes:t,description:n,mode:l="center"}){var o;const a=(0,v.useIntl)(),{pathname:r}=(0,y.useLocation)(),c=Object.values(t),[s,d]=i.useState(null===(o=null==c?void 0:c[0])||void 0===o?void 0:o.key),u=c.map((t=>Object.assign(Object.assign({},t),{label:a.formatMessage({id:t.label}),href:t.absolutePath?t.path:`/ng/rr/${e}/${t.path}`,group:t.group?a.formatMessage({id:t.group}):void 0})));return i.useEffect((()=>{const t=c.find((t=>r===`/ng/rr/${e}/${t.path}`));t&&d(t.key)}),[r]),i.createElement(i.Suspense,{fallback:i.createElement(i.Fragment,null)},i.createElement(w,{mode:l},i.createElement(x,{mode:l,description:n,tabs:u,activeTab:s||""}),i.createElement(b,{mode:l},i.createElement(y.Outlet,null))))}var L=n(855),q=n(57);const $=h.default.registry.getLazyComponent("Loader"),W=({name:e,uniqid:t,inplace:n})=>{const i=(0,L.useSelector)((e=>q.$L.selectors.selectWidgetState(e,t))),o=q.$L.definition(e);return(null==i?void 0:i.loading)?l().createElement("div",{style:{position:"absolute",inset:0,backgroundColor:"rgba(255,255,255,.7)",display:"flex",flex:1,justifyContent:"center",alignItems:"center"}},l().createElement($,null)):(null==i?void 0:i.hover)?l().createElement("div",{style:{position:"absolute",inset:0,backgroundColor:"rgba(255,255,255,.7)",display:"flex",flex:1,justifyContent:"center",alignItems:"center"}}):!(null==i?void 0:i.initialized)&&n||(null==i?void 0:i.initialized)||n?l().createElement(l().Fragment,null):l().createElement("div",{style:{position:"absolute",inset:0,backgroundColor:"rgba(255,255,255,1)",display:"flex",flex:1,justifyContent:"center",alignItems:"center"}},l().createElement("img",{src:o.img}))};var k=n(105);const S=c().div`
6
13
  width: 0;
7
14
  height: 0;
8
15
  overflow: hidden;
9
- `,W=f.default.registry.getLazyComponent("DEPRECATEDFormInputFile"),k=({children:e,initialFiles:t,initialClick:n,multiple:i,accept:o,onUploadStart:a,onUploadEnd:r,onUploadSuccess:c})=>{const s=l().useRef(null),d=(0,x.useSelector)(b.$L.selectors.selectToken),[u,m]=l().useState(0),[g,p]=l().useState(t);return l().useEffect((()=>{var e;n&&(null===(e=s.current)||void 0===e||e.click())}),[n]),l().useEffect((()=>{t.length!==g.length&&p(t)}),[t]),l().useEffect((()=>{c(g)}),[g]),l().useEffect((()=>{0===u&&r()}),[u]),l().createElement(l().Fragment,null,l().createElement("div",{onClick:()=>{var e;n&&(null===(e=s.current)||void 0===e||e.click())}},e),l().createElement($,null,l().createElement(W,{ref:s,id:"widget-upload-file",name:"editorFiles",content:"",accept:o,multiple:i,token:d,onUploadStart:e=>{void 0!==e&&m((t=>t+e)),"function"==typeof a&&0!==e&&a()},onUploadSuccess:e=>{void 0!==e&&(m((e=>void 0!==e?e-1:0)),p((t=>i?[...t,e]:[e])))}})))},S=f.default.registry.getLazyComponent("WidgetArticleGallery"),I=f.default.registry.getLazyComponent("FileViewer"),T=({widget:e,inplace:t,mode:n,onStateChange:i})=>{var o,a;const{uniqid:r}=e,{files:c}=e.content,s=(0,x.useDispatch)(),d=(0,x.useSelector)((e=>b.$L.selectors.selectWidget(e,r))),u=(0,x.useSelector)((e=>b.$L.selectors.isActive(e,r)),x.shallowEqual);return l().useEffect((()=>{i({mounted:!0})}),[]),void 0!==c?l().createElement(l().Fragment,null,"edit"===n?l().createElement(S,{files:c,maxWidth:800,gap:null!==(o=e.content.gap)&&void 0!==o?o:"10",column:null!==(a=e.content.column)&&void 0!==a?a:"3",onClick:()=>{}}):l().createElement(I,{files:c,openWithOptions:{}},(t=>{var n,i;return l().createElement(S,{files:c,maxWidth:600,gap:null!==(n=e.content.gap)&&void 0!==n?n:"10",column:null!==(i=e.content.column)&&void 0!==i?i:"3",onClick:e=>t(e)})})),t&&"edit"===n?l().createElement(k,{initialFiles:c,initialClick:u,accept:"image/png, image/jpeg, image/jpg",multiple:!0,onUploadSuccess:e=>{"widget-article-gallery"===(null==d?void 0:d.widget.name)&&s(b.$L.slice.actions.updateWidget({uniqid:r,content:{files:e}}))},onUploadStart:()=>{s(b.$L.slice.actions.setWidgetState({uniqid:r,loading:!0}))},onUploadEnd:()=>{s(b.$L.slice.actions.setWidgetState({uniqid:r,loading:!1}))}},l().createElement(q.JRCWidgetEmptyInplace,{label:"WIDGET_Article_Gallery_Empty_Label",description:"WIDGET_Article_Gallery_Empty_Description",url:"widget-article-image-placeholder.png",onClick:()=>{}})):l().createElement(l().Fragment,null)):l().createElement(l().Fragment,null)};var A=n(6),_=n.n(A);const D=f.default.registry.getLazyComponent("WidgetArticleAttachment"),F=f.default.registry.getLazyComponent("FileViewer"),j=({widget:e,inplace:t,mode:n,onStateChange:i})=>{const{uniqid:o}=e,{files:a}=e.content,r=(0,x.useDispatch)(),c=(0,x.useSelector)((e=>b.$L.selectors.selectWidget(e,o))),s=(0,x.useSelector)((e=>b.$L.selectors.isActive(e,o)),x.shallowEqual);l().useEffect((()=>{i({mounted:!0})}),[]);const d=[{label:"Wedoc",onClick:e=>{e&&_().object.getAccessHash(`fileArticle/${e.id}`).then((t=>{if(""===t.result)throw new Error("result empty");const n=t.result;((e,t,n)=>{window.open(function(e,t){return`/ng/rr/file/${e}/${t}`}(e,t),void 0)})(e.id,n)})).catch((()=>{r(b.FN.actions.error({label:"Unable to open this file"},6e3))}))}}],u=(0,x.useSelector)((e=>b.Mx.selectors.selectById(e,"OnlyOfficeHook")))?{"application/vnd.openxmlformats-officedocument.wordprocessingml.document":d,"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":d,"application/vnd.openxmlformats-officedocument.presentationml.presentation":d}:{};return void 0!==a?l().createElement(l().Fragment,null,"view"!==n?l().createElement(D,{files:a,onClick:()=>{}}):l().createElement(F,{files:a,openWithOptions:u},(e=>l().createElement(D,{files:a,onClick:t=>e(t)}))),t&&"view"!==n?l().createElement(k,{initialFiles:a,initialClick:s,multiple:!0,accept:"*",onUploadSuccess:e=>{"widget-article-attachment"===(null==c?void 0:c.widget.name)&&r(b.$L.slice.actions.updateWidget({uniqid:o,content:{files:e}}))},onUploadStart:()=>{r(b.$L.slice.actions.setWidgetState({uniqid:o,loading:!0}))},onUploadEnd:()=>{r(b.$L.slice.actions.setWidgetState({uniqid:o,loading:!1}))}},"edit"===n?l().createElement(q.JRCWidgetEmptyInplace,{label:"WIDGET_Article_Attachment_Empty_Label",description:"WIDGET_Article_Attachment_Empty_Description",url:"widget-article-image-placeholder.png",onClick:()=>{}}):l().createElement(l().Fragment,null)):l().createElement(l().Fragment,null)):l().createElement(l().Fragment,null)},R=f.default.registry.getLazyComponent("WidgetArticleImage"),O=c().div`
16
+ `,I=h.default.registry.getLazyComponent("DEPRECATEDFormInputFile"),T=({children:e,initialFiles:t,initialClick:n,multiple:i,accept:o,onUploadStart:a,onUploadEnd:r,onUploadSuccess:c})=>{const s=l().useRef(null),d=(0,L.useSelector)(q.$L.selectors.selectToken),[u,m]=l().useState(0),[g,p]=l().useState(t);return l().useEffect((()=>{var e;n&&(null===(e=s.current)||void 0===e||e.click())}),[n]),l().useEffect((()=>{t.length!==g.length&&p(t)}),[t]),l().useEffect((()=>{c(g)}),[g]),l().useEffect((()=>{0===u&&r()}),[u]),l().createElement(l().Fragment,null,l().createElement("div",{onClick:()=>{var e;n&&(null===(e=s.current)||void 0===e||e.click())}},e),l().createElement(S,null,l().createElement(I,{ref:s,id:"widget-upload-file",name:"editorFiles",content:"",accept:o,multiple:i,token:d,onUploadStart:e=>{void 0!==e&&m((t=>t+e)),"function"==typeof a&&0!==e&&a()},onUploadSuccess:e=>{void 0!==e&&(m((e=>void 0!==e?e-1:0)),p((t=>i?[...t,e]:[e])))}})))},A=h.default.registry.getLazyComponent("WidgetArticleGallery"),_=h.default.registry.getLazyComponent("FileViewer"),D=({widget:e,inplace:t,mode:n,onStateChange:i})=>{var o,a;const{uniqid:r}=e,{files:c}=e.content,s=(0,L.useDispatch)(),d=(0,L.useSelector)((e=>q.$L.selectors.selectWidget(e,r))),u=(0,L.useSelector)((e=>q.$L.selectors.isActive(e,r)),L.shallowEqual);return l().useEffect((()=>{i({mounted:!0})}),[]),void 0!==c?l().createElement(l().Fragment,null,"edit"===n?l().createElement(A,{files:c,maxWidth:800,gap:null!==(o=e.content.gap)&&void 0!==o?o:"10",column:null!==(a=e.content.column)&&void 0!==a?a:"3",onClick:()=>{}}):l().createElement(_,{files:c,openWithOptions:{}},(t=>{var n,i;return l().createElement(A,{files:c,maxWidth:600,gap:null!==(n=e.content.gap)&&void 0!==n?n:"10",column:null!==(i=e.content.column)&&void 0!==i?i:"3",onClick:e=>t(e)})})),t&&"edit"===n?l().createElement(T,{initialFiles:c,initialClick:u,accept:"image/png, image/jpeg, image/jpg",multiple:!0,onUploadSuccess:e=>{"widget-article-gallery"===(null==d?void 0:d.widget.name)&&s(q.$L.slice.actions.updateWidget({uniqid:r,content:{files:e}}))},onUploadStart:()=>{s(q.$L.slice.actions.setWidgetState({uniqid:r,loading:!0}))},onUploadEnd:()=>{s(q.$L.slice.actions.setWidgetState({uniqid:r,loading:!1}))}},l().createElement(k.JRCWidgetEmptyInplace,{label:"WIDGET_Article_Gallery_Empty_Label",description:"WIDGET_Article_Gallery_Empty_Description",url:"widget-article-image-placeholder.png",onClick:()=>{}})):l().createElement(l().Fragment,null)):l().createElement(l().Fragment,null)};var F=n(6),j=n.n(F);const R=h.default.registry.getLazyComponent("WidgetArticleAttachment"),O=h.default.registry.getLazyComponent("FileViewer"),G=({widget:e,inplace:t,mode:n,onStateChange:i})=>{const{uniqid:o}=e,{files:a}=e.content,r=(0,L.useDispatch)(),c=(0,L.useSelector)((e=>q.$L.selectors.selectWidget(e,o))),s=(0,L.useSelector)((e=>q.$L.selectors.isActive(e,o)),L.shallowEqual);l().useEffect((()=>{i({mounted:!0})}),[]);const d=[{label:"Wedoc",onClick:e=>{e&&j().object.getAccessHash(`fileArticle/${e.id}`).then((t=>{if(""===t.result)throw new Error("result empty");const n=t.result;((e,t,n)=>{window.open(function(e,t){return`/ng/rr/file/${e}/${t}`}(e,t),void 0)})(e.id,n)})).catch((()=>{r(q.FN.actions.error({label:"Unable to open this file"},6e3))}))}}],u=(0,L.useSelector)((e=>q.Mx.selectors.selectById(e,"OnlyOfficeHook")))?{"application/vnd.openxmlformats-officedocument.wordprocessingml.document":d,"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":d,"application/vnd.openxmlformats-officedocument.presentationml.presentation":d}:{};return void 0!==a?l().createElement(l().Fragment,null,"view"!==n?l().createElement(R,{files:a,onClick:()=>{}}):l().createElement(O,{files:a,openWithOptions:u},(e=>l().createElement(R,{files:a,onClick:t=>e(t)}))),t&&"view"!==n?l().createElement(T,{initialFiles:a,initialClick:s,multiple:!0,accept:"*",onUploadSuccess:e=>{"widget-article-attachment"===(null==c?void 0:c.widget.name)&&r(q.$L.slice.actions.updateWidget({uniqid:o,content:{files:e}}))},onUploadStart:()=>{r(q.$L.slice.actions.setWidgetState({uniqid:o,loading:!0}))},onUploadEnd:()=>{r(q.$L.slice.actions.setWidgetState({uniqid:o,loading:!1}))}},"edit"===n?l().createElement(k.JRCWidgetEmptyInplace,{label:"WIDGET_Article_Attachment_Empty_Label",description:"WIDGET_Article_Attachment_Empty_Description",url:"widget-article-image-placeholder.png",onClick:()=>{}}):l().createElement(l().Fragment,null)):l().createElement(l().Fragment,null)):l().createElement(l().Fragment,null)},z=h.default.registry.getLazyComponent("WidgetArticleImage"),M=c().div`
10
17
  position: absolute;
11
18
  inset: 0;
12
19
  background-color: rgba(0, 0, 0, 0.4);
@@ -19,20 +26,20 @@
19
26
  &:hover {
20
27
  opacity: 1;
21
28
  }
22
- `,G=({widget:e,inplace:t,mode:n,onStateChange:i})=>{const{uniqid:o}=e,{file:a,displayAs:r,useFilter:c,backgroundPosition:s,backgroundSize:d,borderRadius:u}=e.content,m=(0,x.useDispatch)(),g=(0,x.useSelector)((e=>b.$L.selectors.selectWidget(e,o))),p=(0,x.useSelector)((e=>b.$L.selectors.isActive(e,o)),x.shallowEqual),f=(0,E.useIntl)();return l().useEffect((()=>{i({mounted:!0})}),[]),l().createElement(l().Fragment,null,l().createElement(R,{maxWidth:"view"!==n?800:600,uri:void 0!==a?`/imagecache/fitx1200/fileArticle/${a.id}.png`:void 0,displayAs:null!=r?r:"image",borderRadius:null!=u?u:"8",useFilter:null!=c&&c,backgroundPosition:null!=s?s:"center",backgroundSize:null!=d?d:"auto"}),t&&"edit"===n?l().createElement(k,{initialFiles:[],initialClick:p,accept:"image/png, image/jpeg, image/jpg",multiple:!1,onUploadSuccess:e=>{"widget-article-image"===(null==g?void 0:g.widget.name)&&void 0!==e[0]&&m(b.$L.slice.actions.updateWidget({uniqid:o,content:{file:e[0]}}))},onUploadStart:()=>{m(b.$L.slice.actions.setWidgetState({uniqid:o,loading:!0}))},onUploadEnd:()=>{m(b.$L.slice.actions.setWidgetState({uniqid:o,loading:!1}))}},void 0!==a?l().createElement(O,null,f.formatMessage({id:"ARTICLE_Widget_Image_Change"})):l().createElement(q.JRCWidgetEmptyInplace,{label:"WIDGET_Article_Image_Empty_Label",description:"WIDGET_Article_Image_Empty_Description",url:"widget-article-image-placeholder.png",onClick:()=>{}})):l().createElement(l().Fragment,null))},z=c().div`
29
+ `,U=({widget:e,inplace:t,mode:n,onStateChange:i})=>{const{uniqid:o}=e,{file:a,displayAs:r,useFilter:c,backgroundPosition:s,backgroundSize:d,borderRadius:u}=e.content,m=(0,L.useDispatch)(),g=(0,L.useSelector)((e=>q.$L.selectors.selectWidget(e,o))),p=(0,L.useSelector)((e=>q.$L.selectors.isActive(e,o)),L.shallowEqual),E=(0,v.useIntl)();return l().useEffect((()=>{i({mounted:!0})}),[]),l().createElement(l().Fragment,null,l().createElement(z,{maxWidth:"view"!==n?800:600,uri:void 0!==a?`/imagecache/fitx1200/fileArticle/${a.id}.png`:void 0,displayAs:null!=r?r:"image",borderRadius:null!=u?u:"8",useFilter:null!=c&&c,backgroundPosition:null!=s?s:"center",backgroundSize:null!=d?d:"auto"}),t&&"edit"===n?l().createElement(T,{initialFiles:[],initialClick:p,accept:"image/png, image/jpeg, image/jpg",multiple:!1,onUploadSuccess:e=>{"widget-article-image"===(null==g?void 0:g.widget.name)&&void 0!==e[0]&&m(q.$L.slice.actions.updateWidget({uniqid:o,content:{file:e[0]}}))},onUploadStart:()=>{m(q.$L.slice.actions.setWidgetState({uniqid:o,loading:!0}))},onUploadEnd:()=>{m(q.$L.slice.actions.setWidgetState({uniqid:o,loading:!1}))}},void 0!==a?l().createElement(M,null,E.formatMessage({id:"ARTICLE_Widget_Image_Change"})):l().createElement(k.JRCWidgetEmptyInplace,{label:"WIDGET_Article_Image_Empty_Label",description:"WIDGET_Article_Image_Empty_Description",url:"widget-article-image-placeholder.png",onClick:()=>{}})):l().createElement(l().Fragment,null))},J=c().div`
23
30
  flex: 1;
24
31
  display: flex;
25
32
  flex-direction: row;
26
33
  min-height: 60px;
27
34
  align-items: center;
28
- `,M=c().div`
35
+ `,P=c().div`
29
36
  display: flex;
30
37
  flex-direction: row;
31
38
  border-radius: 8px;
32
39
  overflow: hidden;
33
40
  margin: 4px;
34
41
  border: 1px solid ${e=>e.theme.color.grey1};
35
- `,U=c().button`
42
+ `,V=c().button`
36
43
  display: flex;
37
44
  width: 40px;
38
45
  height: 40px;
@@ -44,19 +51,19 @@
44
51
  &:hover {
45
52
  background-color: ${e=>e.theme.color.grey1};
46
53
  }
47
- `,J=({widget:e,inplace:t,mode:n})=>{const{uniqid:i}=e,{text:o,color:a,heading:r}=e.content,c=(0,x.useDispatch)(),s=(0,x.useSelector)((e=>b.$L.selectors.selectWidget(e,i))),d=(0,x.useSelector)((e=>b.$L.selectors.isActive(e,i)),x.shallowEqual);return l().createElement(z,null,l().createElement(q.JRCWidgetArticleTitle,{text:o,color:a,heading:r,autoFocus:d,inplace:t,mode:n,onChange:e=>{"widget-article-title"===(null==s?void 0:s.widget.name)&&c(b.$L.slice.actions.updateWidget({uniqid:i,content:Object.assign(Object.assign({},s.widget.content),{text:e})}))}}),d&&"edit"===n?l().createElement(P,{heading:r,onClick:e=>{"widget-article-title"===(null==s?void 0:s.widget.name)&&c(b.$L.slice.actions.updateWidget({uniqid:i,content:Object.assign(Object.assign({},s.widget.content),{heading:e})}))}}):l().createElement(l().Fragment,null))},P=({heading:e="h1",onClick:t})=>l().createElement(M,null,["h1","h2","h3","h4"].map(((n,i)=>l().createElement(U,{key:i,isActive:e===n,onClick:()=>t(n)},n)))),V=f.default.registry.getLazyComponent("WidgetArticleButton"),B=f.default.registry.getLazyComponent("WidgetArticleText"),N=({widget:e,inplace:t=!1,isComponentVisible:n=!1,mode:i="view",onClick:o})=>{const a=(0,x.useDispatch)(),{name:r,uniqid:c}=e,s=(e,t)=>a(b.$L.slice.actions.updateWidget({uniqid:c,content:e,override:t})),d=e=>a(b.$L.slice.actions.setWidgetState(Object.assign({uniqid:c},e)));switch(r){default:return l().createElement(l().Fragment,null,"cannot display widget (",r,")");case"widget-article-button":return l().createElement(V,{isComponentVisible:n,content:e.content,inplace:t,mode:i,onChange:s,onClick:o,onStateChange:d});case"widget-article-gallery":return l().createElement(T,{widget:e,inplace:t,mode:i,onStateChange:d});case"widget-article-attachment":return l().createElement(j,{widget:e,inplace:t,mode:i,onStateChange:d});case"widget-article-image":return l().createElement(G,{widget:e,inplace:t,mode:i,onStateChange:d});case"widget-article-title":return l().createElement(J,{widget:e,inplace:t,mode:i});case"widget-article-text":return l().createElement(B,{content:e.content,isComponentVisible:n,inplace:t,mode:i,onChange:s,onStateChange:d})}};var H=n(349);const X=c().div`
54
+ `,B=({widget:e,inplace:t,mode:n})=>{const{uniqid:i}=e,{text:o,color:a,heading:r}=e.content,c=(0,L.useDispatch)(),s=(0,L.useSelector)((e=>q.$L.selectors.selectWidget(e,i))),d=(0,L.useSelector)((e=>q.$L.selectors.isActive(e,i)),L.shallowEqual);return l().createElement(J,null,l().createElement(k.JRCWidgetArticleTitle,{text:o,color:a,heading:r,autoFocus:d,inplace:t,mode:n,onChange:e=>{"widget-article-title"===(null==s?void 0:s.widget.name)&&c(q.$L.slice.actions.updateWidget({uniqid:i,content:Object.assign(Object.assign({},s.widget.content),{text:e})}))}}),d&&"edit"===n?l().createElement(N,{heading:r,onClick:e=>{"widget-article-title"===(null==s?void 0:s.widget.name)&&c(q.$L.slice.actions.updateWidget({uniqid:i,content:Object.assign(Object.assign({},s.widget.content),{heading:e})}))}}):l().createElement(l().Fragment,null))},N=({heading:e="h1",onClick:t})=>l().createElement(P,null,["h1","h2","h3","h4"].map(((n,i)=>l().createElement(V,{key:i,isActive:e===n,onClick:()=>t(n)},n)))),H=h.default.registry.getLazyComponent("WidgetArticleButton"),X=h.default.registry.getLazyComponent("WidgetArticleText"),Y=({widget:e,inplace:t=!1,isComponentVisible:n=!1,mode:i="view",onClick:o})=>{const a=(0,L.useDispatch)(),{name:r,uniqid:c}=e,s=(e,t)=>a(q.$L.slice.actions.updateWidget({uniqid:c,content:e,override:t})),d=e=>a(q.$L.slice.actions.setWidgetState(Object.assign({uniqid:c},e)));switch(r){default:return l().createElement(l().Fragment,null,"cannot display widget (",r,")");case"widget-article-button":return l().createElement(H,{isComponentVisible:n,content:e.content,inplace:t,mode:i,onChange:s,onClick:o,onStateChange:d});case"widget-article-gallery":return l().createElement(D,{widget:e,inplace:t,mode:i,onStateChange:d});case"widget-article-attachment":return l().createElement(G,{widget:e,inplace:t,mode:i,onStateChange:d});case"widget-article-image":return l().createElement(U,{widget:e,inplace:t,mode:i,onStateChange:d});case"widget-article-title":return l().createElement(B,{widget:e,inplace:t,mode:i});case"widget-article-text":return l().createElement(X,{content:e.content,isComponentVisible:n,inplace:t,mode:i,onChange:s,onStateChange:d})}};var K=n(349);const Q=c().div`
48
55
  position: absolute;
49
56
  inset: 0;
50
57
  opacity: ${e=>e.opacity};
51
58
  background-color: ${e=>e.backgroundColor};
52
59
  pointer-events: ${e=>e.pointerEvents};
53
- `,Y=({uniqid:e,mode:t})=>{const n=(0,x.useSelector)((t=>t.widgets.ids[e].widget.layers),x.shallowEqual);return l().createElement(l().Fragment,null,null==n?void 0:n.map(((e,t)=>l().createElement(K,{uniqid:e,key:t,mode:"edit"}))))},K=({uniqid:e,mode:t})=>{const n=(0,x.useSelector)((t=>t.widgets.layers[e]));return"view"===t?l().createElement(X,{opacity:1,backgroundColor:"transparent",pointerEvents:"none"},n.widgets.map(((e,t)=>l().createElement(Q,{key:t,layerId:n.uniqid,uniqid:e.widget.uniqid,mode:"view"})))):l().createElement(X,{opacity:n.visible?1:0,backgroundColor:n.visible?"rgba(255,255,255,.1)":"transparent",pointerEvents:n.locked?"none":"all"},n.widgets.map(((e,t)=>l().createElement(Q,{key:t,layerId:n.uniqid,uniqid:e.widget.uniqid,mode:"edit"}))))},Q=({uniqid:e,layerId:t,mode:n})=>{const i=(0,x.useDispatch)(),o=(0,x.useSelector)((t=>t.widgets.ids[e]),x.shallowEqual),a=(0,x.useSelector)((e=>e.widgets.layers[t]));return o&&a&&a.position?"view"===n?l().createElement("div",{style:{position:"absolute",top:a.position.y,left:a.position.x}},l().createElement(te,{uniqid:e,widget:o,mode:n,inplace:!0})):l().createElement(Z,{position:{x:a.position.x,y:a.position.y},onMouseUp:e=>{(a.position&&a.position.x!==e.x||a.position&&a.position.y!==e.y)&&(e=>{i(b.$L.slice.actions.updateLayer({uniqid:t,props:{position:e}}))})(e)}},l().createElement(q.BETA_JRCDoubleClick,{onDoubleTap:()=>((e,t)=>{i(b.Wq.slice.actions.registerEditor({uniqid:e,name:t}))})(o.widget.uniqid,o.widget.name)},l().createElement(te,{uniqid:e,widget:o,mode:n,inplace:!0}))):l().createElement(l().Fragment,null)},Z=({position:e,children:t,onMouseUp:n})=>{const[i,o]=l().useState(!1),[a,r]=l().useState({x:0,y:0}),[c,s]=l().useState({x:0,y:0}),[d,u]=l().useState({x:e.x,y:e.y}),m=l().useRef(null),g=l().useCallback((e=>{if(i&&m.current){const t=c.x+(e.clientX-a.x),n=c.y+(e.clientY-a.y);u({x:t,y:n})}}),[i]),p=()=>{o(!1),n({x:d.x,y:d.y})};return l().useEffect((()=>(document.addEventListener("mousemove",g),document.addEventListener("mouseup",p),()=>{document.removeEventListener("mousemove",g),document.removeEventListener("mouseup",p)})),[g]),l().createElement("div",{style:{position:"absolute",top:d.y,left:d.x},ref:m,onMouseDown:e=>{o(!0),m.current&&(r({x:e.nativeEvent.clientX,y:e.nativeEvent.clientY}),s({x:d.x,y:d.y}))}},t)},ee=({uniqid:e,widget:t,inplace:n=!0,mode:i,width:o})=>{const a=(0,x.useDispatch)(),r=(0,x.useSelector)((t=>b.$L.selectors.selectWidget(t,e))),c=(0,x.useSelector)((t=>{var n;return null===(n=b.$L.selectors.selectWidgetState(t,e))||void 0===n?void 0:n.busy}),x.shallowEqual),s=(0,x.useSelector)((t=>t.widgets.editableMap[e]),x.shallowEqual),d=(0,x.useSelector)((e=>e.widgets.currentEditableWidgetId),x.shallowEqual),u=(0,x.useSelector)((t=>t.widgets.currentEditableWidgetId===e),x.shallowEqual),{ref:m,isComponentVisible:g,setIsComponentVisible:p}=(0,H.I)(!1);if(l().useEffect((()=>{t&&a(b.$L.slice.actions.registerWidget({uniqid:e,widget:t}))}),[]),l().useEffect((()=>{g||e===d&&a(b.$L.slice.actions.setEditableWidgetId({uniqid:void 0}))}),[g]),l().useEffect((()=>{g!==u&&p(u)}),[u]),void 0===r)return l().createElement(l().Fragment,null,"This widget cannot be desplayed");const E=()=>{"edit"===i?f():"widget-article-button"===r.widget.name&&"link"===r.widget.content.openingType&&r.widget.content.openingTypeLink&&window.open(r.widget.content.openingTypeLink.url,r.widget.content.openingTypeLink.target)},f=()=>{if("view"===i)return;const{widget:e}=r;a(b.Wq.slice.actions.registerEditor({uniqid:e.uniqid,name:e.name}))};return n&&"view"!==i?l().createElement("div",{style:{minWidth:void 0!==o?o:"100%"},ref:m,onClick:()=>{p(!0),s&&(a(b.$L.slice.actions.setEditableIndex({index:s.index})),a(b.$L.slice.actions.setEditableWidgetId({uniqid:e})))}},l().createElement(N,{width:o,widget:r.widget,inplace:n,isComponentVisible:!!(g||c||u),mode:i,onClick:E}),l().createElement(Y,{uniqid:e,mode:i}),l().createElement(L,{name:r.widget.name,uniqid:r.widget.uniqid,inplace:n})):l().createElement("div",{style:{flex:1,display:"flex",minWidth:void 0!==o?o:"100%"},onClick:f},l().createElement(N,{widget:r.widget,isComponentVisible:!1,inplace:n,mode:i,width:o,onClick:E}),l().createElement(Y,{uniqid:e,mode:i}),l().createElement(L,{name:r.widget.name,uniqid:r.widget.uniqid,inplace:n}))},te=ee,ne=c().div`
60
+ `,Z=({uniqid:e,mode:t})=>{const n=(0,L.useSelector)((t=>t.widgets.ids[e].widget.layers),L.shallowEqual);return l().createElement(l().Fragment,null,null==n?void 0:n.map(((e,t)=>l().createElement(ee,{uniqid:e,key:t,mode:"edit"}))))},ee=({uniqid:e,mode:t})=>{const n=(0,L.useSelector)((t=>t.widgets.layers[e]));return"view"===t?l().createElement(Q,{opacity:1,backgroundColor:"transparent",pointerEvents:"none"},n.widgets.map(((e,t)=>l().createElement(te,{key:t,layerId:n.uniqid,uniqid:e.widget.uniqid,mode:"view"})))):l().createElement(Q,{opacity:n.visible?1:0,backgroundColor:n.visible?"rgba(255,255,255,.1)":"transparent",pointerEvents:n.locked?"none":"all"},n.widgets.map(((e,t)=>l().createElement(te,{key:t,layerId:n.uniqid,uniqid:e.widget.uniqid,mode:"edit"}))))},te=({uniqid:e,layerId:t,mode:n})=>{const i=(0,L.useDispatch)(),o=(0,L.useSelector)((t=>t.widgets.ids[e]),L.shallowEqual),a=(0,L.useSelector)((e=>e.widgets.layers[t]));return o&&a&&a.position?"view"===n?l().createElement("div",{style:{position:"absolute",top:a.position.y,left:a.position.x}},l().createElement(le,{uniqid:e,widget:o,mode:n,inplace:!0})):l().createElement(ne,{position:{x:a.position.x,y:a.position.y},onMouseUp:e=>{(a.position&&a.position.x!==e.x||a.position&&a.position.y!==e.y)&&(e=>{i(q.$L.slice.actions.updateLayer({uniqid:t,props:{position:e}}))})(e)}},l().createElement(k.BETA_JRCDoubleClick,{onDoubleTap:()=>((e,t)=>{i(q.Wq.slice.actions.registerEditor({uniqid:e,name:t}))})(o.widget.uniqid,o.widget.name)},l().createElement(le,{uniqid:e,widget:o,mode:n,inplace:!0}))):l().createElement(l().Fragment,null)},ne=({position:e,children:t,onMouseUp:n})=>{const[i,o]=l().useState(!1),[a,r]=l().useState({x:0,y:0}),[c,s]=l().useState({x:0,y:0}),[d,u]=l().useState({x:e.x,y:e.y}),m=l().useRef(null),g=l().useCallback((e=>{if(i&&m.current){const t=c.x+(e.clientX-a.x),n=c.y+(e.clientY-a.y);u({x:t,y:n})}}),[i]),p=()=>{o(!1),n({x:d.x,y:d.y})};return l().useEffect((()=>(document.addEventListener("mousemove",g),document.addEventListener("mouseup",p),()=>{document.removeEventListener("mousemove",g),document.removeEventListener("mouseup",p)})),[g]),l().createElement("div",{style:{position:"absolute",top:d.y,left:d.x},ref:m,onMouseDown:e=>{o(!0),m.current&&(r({x:e.nativeEvent.clientX,y:e.nativeEvent.clientY}),s({x:d.x,y:d.y}))}},t)},ie=({uniqid:e,widget:t,inplace:n=!0,mode:i,width:o})=>{const a=(0,L.useDispatch)(),r=(0,L.useSelector)((t=>q.$L.selectors.selectWidget(t,e))),c=(0,L.useSelector)((t=>{var n;return null===(n=q.$L.selectors.selectWidgetState(t,e))||void 0===n?void 0:n.busy}),L.shallowEqual),s=(0,L.useSelector)((t=>t.widgets.editableMap[e]),L.shallowEqual),d=(0,L.useSelector)((e=>e.widgets.currentEditableWidgetId),L.shallowEqual),u=(0,L.useSelector)((t=>t.widgets.currentEditableWidgetId===e),L.shallowEqual),{ref:m,isComponentVisible:g,setIsComponentVisible:p}=(0,K.I)(!1);if(l().useEffect((()=>{t&&a(q.$L.slice.actions.registerWidget({uniqid:e,widget:t}))}),[]),l().useEffect((()=>{g||e===d&&a(q.$L.slice.actions.setEditableWidgetId({uniqid:void 0}))}),[g]),l().useEffect((()=>{g!==u&&p(u)}),[u]),void 0===r)return l().createElement(l().Fragment,null,"This widget cannot be desplayed");const E=()=>{"edit"===i?f():"widget-article-button"===r.widget.name&&"link"===r.widget.content.openingType&&r.widget.content.openingTypeLink&&window.open(r.widget.content.openingTypeLink.url,r.widget.content.openingTypeLink.target)},f=()=>{if("view"===i)return;const{widget:e}=r;a(q.Wq.slice.actions.registerEditor({uniqid:e.uniqid,name:e.name}))};return n&&"view"!==i?l().createElement("div",{style:{minWidth:void 0!==o?o:"100%"},ref:m,onClick:()=>{p(!0),s&&(a(q.$L.slice.actions.setEditableIndex({index:s.index})),a(q.$L.slice.actions.setEditableWidgetId({uniqid:e})))}},l().createElement(Y,{width:o,widget:r.widget,inplace:n,isComponentVisible:!!(g||c||u),mode:i,onClick:E}),l().createElement(Z,{uniqid:e,mode:i}),l().createElement(W,{name:r.widget.name,uniqid:r.widget.uniqid,inplace:n})):l().createElement("div",{style:{flex:1,display:"flex",minWidth:void 0!==o?o:"100%"},onClick:f},l().createElement(Y,{widget:r.widget,isComponentVisible:!1,inplace:n,mode:i,width:o,onClick:E}),l().createElement(Z,{uniqid:e,mode:i}),l().createElement(W,{name:r.widget.name,uniqid:r.widget.uniqid,inplace:n}))},le=ie,oe=c().div`
54
61
  display: flex;
55
62
  flex-direction: row;
56
63
  flex-wrap: wrap;
57
64
  gap: 10px;
58
65
  justify-content: center;
59
- `,ie=c().div`
66
+ `,ae=c().div`
60
67
  border: 1px solid ${e=>e.theme.color.grey2};
61
68
  border-radius: 8px;
62
69
  cursor: pointer;
@@ -81,7 +88,7 @@
81
88
  opacity: 1;
82
89
  }
83
90
  }
84
- `,le=c().div`
91
+ `,re=c().div`
85
92
  border: 2px solid ${e=>e.theme.color.primary};
86
93
  height: ${e=>e.open?"320":"54"}px;
87
94
  border-radius: 8px;
@@ -91,20 +98,20 @@
91
98
  transition: height 0.4s;
92
99
  overflow: hidden;
93
100
  flex-direction: column;
94
- `,oe=c().div`
101
+ `,ce=c().div`
95
102
  display: flex;
96
103
  flex-direction: row;
97
104
  flex-wrap: wrap;
98
105
  justify-content: center;
99
106
  gap: 10px;
100
- `,ae=c().div`
107
+ `,se=c().div`
101
108
  min-height: 50px;
102
109
  display: flex;
103
110
  justify-content: center;
104
111
  align-items: center;
105
112
  cursor: pointer;
106
113
  color: ${e=>e.theme.color.primary};
107
- `,re=c().button`
114
+ `,de=c().button`
108
115
  height: 72px;
109
116
  display: flex;
110
117
  justify-content: center;
@@ -114,7 +121,7 @@
114
121
  border-radius: 8px;
115
122
  transition: opacity 0.4s ease ${e=>40*e.index}ms;
116
123
  opacity: ${e=>e.open?1:0};
117
- `,ce=f.default.registry.getLazyComponent("Button"),se=f.default.registry.getLazyComponent("Modal"),de=({mode:e,view:t,children:n,namespace:i="default",onChange:o})=>{const[a,r]=l().useState(!1),c=function(e){return"widget-article-image"===e?[b.$L.definition(b.$L.const.WIDGET_ARTICLE_TITLE),b.$L.definition(b.$L.const.WIDGET_ARTICLE_BUTTON)]:[b.$L.definition(b.$L.const.WIDGET_ARTICLE_TITLE),b.$L.definition(b.$L.const.WIDGET_ARTICLE_TEXT),b.$L.definition(b.$L.const.WIDGET_ARTICLE_IMAGE),b.$L.definition(b.$L.const.WIDGET_ARTICLE_BUTTON),b.$L.definition(b.$L.const.WIDGET_ARTICLE_GALLERY),b.$L.definition(b.$L.const.WIDGET_ARTICLE_ATTACHMENT)]}(i),s=(0,E.useIntl)(),d={open:a,title:"widget builder",showIconClose:!0,portalId:"react-modal",isFullHeight:!0,closeHandler:()=>r(!1)},u=e=>{o(b.$L.factory(e)),r(!1)};return l().createElement(l().Fragment,null,l().createElement(se,Object.assign({},d),l().createElement(ne,null,c.map(((e,t)=>l().createElement(ie,{key:t,onClick:()=>u(e.name),available:e.available},l().createElement("img",{src:e.img}),l().createElement("div",{className:"show-on-hover"},s.formatMessage({id:e.label}))))))),"custom"===e&&n?l().createElement("div",{onClick:()=>r(!0)},n):l().createElement(l().Fragment,null),"button"===e&&"edit"===t?l().createElement(ce,{onClick:()=>r(!0),variant:"outlined",minWidth:"100%"},s.formatMessage({id:"WIDGET_Add_Widget"})):l().createElement(l().Fragment,null),"gallery"===e&&"edit"===t?l().createElement(ne,null,c.map(((e,t)=>l().createElement(ie,{key:t,onClick:()=>u(e.name),available:e.available},l().createElement("img",{src:e.img}),l().createElement("div",{className:"show-on-hover"},s.formatMessage({id:e.label})))))):l().createElement(l().Fragment,null),"article"===e&&"edit"===t?l().createElement(ue,{widgets:c,onClick:u}):l().createElement(l().Fragment,null))},ue=({widgets:e,onClick:t})=>{const[n,i]=l().useState(!1),o=(0,E.useIntl)();return l().createElement(l().Fragment,null,l().createElement(le,{open:n},l().createElement(ae,{onClick:()=>i(!n)},o.formatMessage({id:"WIDGET_Add_Widget"})),l().createElement(oe,null,e.map(((e,i)=>l().createElement(re,{key:e.name,open:n,index:i,onClick:()=>t(e.name)},o.formatMessage({id:e.label})))))))},me=(c().div`
124
+ `,ue=h.default.registry.getLazyComponent("Button"),me=h.default.registry.getLazyComponent("ModalLayout"),ge=h.default.registry.getLazyComponent("ModalContent"),pe=({mode:e,view:t,children:n,namespace:i="default",onChange:o})=>{const[a,r]=l().useState(!1),c=function(e){return"widget-article-image"===e?[q.$L.definition(q.$L.const.WIDGET_ARTICLE_TITLE),q.$L.definition(q.$L.const.WIDGET_ARTICLE_BUTTON)]:[q.$L.definition(q.$L.const.WIDGET_ARTICLE_TITLE),q.$L.definition(q.$L.const.WIDGET_ARTICLE_TEXT),q.$L.definition(q.$L.const.WIDGET_ARTICLE_IMAGE),q.$L.definition(q.$L.const.WIDGET_ARTICLE_BUTTON),q.$L.definition(q.$L.const.WIDGET_ARTICLE_GALLERY),q.$L.definition(q.$L.const.WIDGET_ARTICLE_ATTACHMENT)]}(i),s=(0,v.useIntl)(),d={open:a,portalId:"react-modal",variant:"full-height",closeHandler:()=>r(!1)},u=e=>{o(q.$L.factory(e)),r(!1)};return l().createElement(l().Fragment,null,l().createElement(me,Object.assign({},d),l().createElement(ge,{onClickIconClose:d.closeHandler,title:"widget builder"},l().createElement(oe,null,c.map(((e,t)=>l().createElement(ae,{key:t,onClick:()=>u(e.name),available:e.available},l().createElement("img",{src:e.img}),l().createElement("div",{className:"show-on-hover"},s.formatMessage({id:e.label})))))))),"custom"===e&&n?l().createElement("div",{onClick:()=>r(!0)},n):l().createElement(l().Fragment,null),"button"===e&&"edit"===t?l().createElement(ue,{onClick:()=>r(!0),variant:"outlined",minWidth:"100%"},s.formatMessage({id:"WIDGET_Add_Widget"})):l().createElement(l().Fragment,null),"gallery"===e&&"edit"===t?l().createElement(oe,null,c.map(((e,t)=>l().createElement(ae,{key:t,onClick:()=>u(e.name),available:e.available},l().createElement("img",{src:e.img}),l().createElement("div",{className:"show-on-hover"},s.formatMessage({id:e.label})))))):l().createElement(l().Fragment,null),"article"===e&&"edit"===t?l().createElement(Ee,{widgets:c,onClick:u}):l().createElement(l().Fragment,null))},Ee=({widgets:e,onClick:t})=>{const[n,i]=l().useState(!1),o=(0,v.useIntl)();return l().createElement(l().Fragment,null,l().createElement(re,{open:n},l().createElement(se,{onClick:()=>i(!n)},o.formatMessage({id:"WIDGET_Add_Widget"})),l().createElement(ce,null,e.map(((e,i)=>l().createElement(de,{key:e.name,open:n,index:i,onClick:()=>t(e.name)},o.formatMessage({id:e.label})))))))},fe=(c().div`
118
125
  margin-bottom: 24px;
119
126
  `,c().div`
120
127
  margin-bottom: 4px;
@@ -126,22 +133,22 @@
126
133
  flex: 1;
127
134
  display: flex;
128
135
  overflow: hidden;
129
- `),ge=c().div`
136
+ `),ye=c().div`
130
137
  flex-direction: row;
131
138
  display: flex;
132
139
  min-height: 60px;
133
140
  border-bottom: 1px solid ${e=>e.theme.color.grey2};
134
- `,pe=c().div`
141
+ `,ve=c().div`
135
142
  width: 60px;
136
143
  display: flex;
137
144
  align-items: center;
138
145
  justify-content: center;
139
- `,Ee=c().div`
146
+ `,he=c().div`
140
147
  flex: 1;
141
148
  display: flex;
142
149
  align-items: center;
143
150
  justify-content: center;
144
- `,fe=c().div`
151
+ `,we=c().div`
145
152
  position: absolute;
146
153
  top: 90px;
147
154
  right: ${e=>e.visible?"0":"-1000"}px;
@@ -152,20 +159,20 @@
152
159
  flex-direction: row;
153
160
  transition: all 0.4s;
154
161
  box-shadow: -1px 1px 10px 0px rgb(0 0 0 / 20%);
155
- `,ye=c().div`
162
+ `,xe=c().div`
156
163
  flex: 1;
157
164
  display: flex;
158
165
  flex-direction: row;
159
166
  padding: 12px;
160
167
  overflow: auto;
161
168
  margin-bottom: 40px;
162
- `,ve=c().div`
169
+ `,be=c().div`
163
170
  width: ${50}px;
164
171
  padding-top: 60px;
165
172
  display: flex;
166
173
  flex-direction: column;
167
174
  border-right: 1px solid ${e=>e.theme.color.grey2};
168
- `,he=c().button`
175
+ `,Ce=c().button`
169
176
  border-radius: 4px;
170
177
  cursor: pointer;
171
178
  height: 42px;
@@ -178,7 +185,7 @@
178
185
  &:hover {
179
186
  background-color: ${e=>e.theme.color.grey1};
180
187
  }
181
- `,we=(c().div`
188
+ `,Le=(c().div`
182
189
  display: flex;
183
190
  border: 1px solid ${e=>e.theme.color.grey1};
184
191
  border-radius: ${8}px;
@@ -196,16 +203,16 @@
196
203
  background-color: ${e=>e.theme.color.grey0};
197
204
  border-radius: 8px;
198
205
  margin-bottom: 4px;
199
- `),xe=c().div`
206
+ `),qe=c().div`
200
207
  display: flex;
201
208
  flex: 1;
202
209
  align-items: center;
203
- `,be=c().div`
210
+ `,$e=c().div`
204
211
  width: 40px;
205
212
  display: flex;
206
213
  justify-content: center;
207
214
  align-items: center;
208
- `,Ce=(c().div`
215
+ `,We=(c().div`
209
216
  flex-direction: row;
210
217
  display: flex;
211
218
  align-items: center;
@@ -213,23 +220,23 @@
213
220
  flex: 1;
214
221
  display: flex;
215
222
  align-items: center;
216
- `,({uniqid:e})=>{const t=(0,x.useDispatch)(),n=(0,x.useSelector)((t=>b.Wq.selectors.selectEditor(t,e)));return n&&n.popup&&n.view?l().createElement("div",{style:{flex:1,display:"flex",flexDirection:"column",backgroundColor:"white",marginTop:90}},l().createElement(ge,null,l().createElement(pe,null),l().createElement(Ee,null,"Popup"),l().createElement(pe,null,l().createElement(he,{onClick:()=>{t(b.Wq.slice.actions.flushEditorPopup({uniqid:e}))}},l().createElement(q.JRCIcon,{name:"icon-times",color:"grey2"})))),l().createElement("div",{style:{flex:1,display:"flex"}},n.view),l().createElement(ge,null,l().createElement(q.JRCButton,{onClick:()=>{t(b.Wq.slice.actions.flushEditorPopup({uniqid:e}))}},"Save"))):l().createElement(l().Fragment,null)}),Le=f.default.registry.getLazyComponent("WidgetArticleTitleEditor"),qe=f.default.registry.getLazyComponent("WidgetArticleImageEditor"),$e=f.default.registry.getLazyComponent("WidgetArticleTextEditor"),We=f.default.registry.getLazyComponent("WidgetArticleGalleryEditor"),ke=f.default.registry.getLazyComponent("WidgetArticleButtonEditor"),Se=f.default.registry.getLazyComponent("WidgetArticleAttachmentEditor"),Ie=({uniqid:e})=>{const t=(0,x.useDispatch)(),n=(0,x.useSelector)(b.$L.selectors.selectToken),i=(0,x.useSelector)((t=>b.$L.selectors.selectWidget(t,e))),o=n=>{i&&t(b.$L.slice.actions.updateWidget({uniqid:e,content:n})),t(b.Wq.slice.actions.flushEditor({uniqid:e}))},a=(n,i)=>t(b.$L.slice.actions.updateWidget({uniqid:e,content:n,override:i})),r=(n,i)=>{t(void 0!==i?b.$L.slice.actions.setWidgetState(Object.assign({uniqid:i},n)):b.$L.slice.actions.setWidgetState(Object.assign({uniqid:e},n)))},c=n=>{t(b.Wq.slice.actions.registerEditorPopup({uniqid:e,view:n}))};switch(null==i?void 0:i.widget.name){default:return l().createElement(l().Fragment,null,"cannot display editor");case b.$L.const.WIDGET_ARTICLE_BUTTON:return l().createElement(ke,{content:i.widget.content,onChange:a,onSave:o,onStateChange:r});case b.$L.const.WIDGET_ARTICLE_ATTACHMENT:return l().createElement(Se,{token:n,content:i.widget.content,onChange:a,onSave:o,onStateChange:r,onOpen:c});case b.$L.const.WIDGET_ARTICLE_GALLERY:return l().createElement(We,{token:n,content:i.widget.content,onChange:a,onSave:o,onStateChange:r});case b.$L.const.WIDGET_ARTICLE_TEXT:return l().createElement($e,{onChange:a,onSave:o,content:i.widget.content});case b.$L.const.WIDGET_ARTICLE_IMAGE:return l().createElement(qe,{content:i.widget.content,token:n,onChange:a,onSave:o,onStateChange:r});case b.$L.const.WIDGET_ARTICLE_TITLE:return l().createElement(Le,{onChange:a,onSave:o,content:i.widget.content,onOpen:c})}},Te=({uniqid:e})=>{const t=(0,x.useDispatch)(),n=(0,E.useIntl)(),i=(0,x.useSelector)((t=>b.$L.selectors.selectWidgetContent(t,e)));return l().createElement("div",{style:{flex:1}},l().createElement(Ae,{uniqid:e}),i&&i.widgets?i.widgets.map(((o,a)=>{const r=b.$L.definition(o.widget.name);return l().createElement("div",{key:a},l().createElement(we,null,l().createElement(xe,{onClick:()=>((e,n)=>{t(b.Wq.slice.actions.registerEditor({uniqid:e,name:n}))})(o.widget.uniqid,o.widget.name)},n.formatMessage({id:r.label})),l().createElement(be,{onClick:()=>{i.widgets&&t(b.$L.slice.actions.updateWidget({uniqid:e,content:Object.assign(Object.assign({},i),{widgets:[...i.widgets.filter(((e,t)=>t!==a))]})}))}},l().createElement(q.JRCIcon,{name:"icon-trash"}))))})):l().createElement(l().Fragment,null))},Ae=({uniqid:e})=>{const t=(0,x.useDispatch)(),n=(0,x.useSelector)((t=>t.widgets.ids[e].widget.layers),x.shallowEqual);return l().createElement(l().Fragment,null,l().createElement(q.BETA_JRCDragAndDrop,{onDrag:()=>{},renderEl:(e,t)=>l().createElement(je,{uniqid:e,key:t}),elms:n||[]}),l().createElement(de,{namespace:"default",onChange:n=>{t(b.$L.slice.actions.registerLayer({uniqid:e,widget:n}))},mode:"button"}))},_e=({uniqid:e})=>{const t=(0,x.useDispatch)(),n=(0,x.useSelector)((t=>t.widgets.layers[e]));return l().createElement("div",{onClick:()=>{t(b.$L.slice.actions.updateLayer({uniqid:e,props:{locked:!n.locked}}))}},l().createElement(q.JRCIcon,{name:n.locked?"icon-lock":"icon-unlock"}))},De=({uniqid:e})=>{const t=(0,x.useDispatch)(),n=(0,x.useSelector)((t=>t.widgets.layers[e]));return l().createElement("div",{onClick:()=>{t(b.$L.slice.actions.updateLayer({uniqid:e,props:{visible:!n.visible}}))}},l().createElement(q.JRCIcon,{name:n.visible?"icon-eye":"icon-eye-slash"}))},Fe=({uniqid:e,layerId:t})=>{const n=(0,x.useDispatch)();return l().createElement("div",{onClick:()=>{n(b.$L.slice.actions.flushLayer({uniqid:e,layerId:t}))}},l().createElement(q.JRCIcon,{name:"icon-trash"}))},je=({uniqid:e})=>{const t=(0,x.useSelector)((t=>t.widgets.layers[e]));return l().createElement(l().Fragment,null,t.title,t.widgets.map(((n,i)=>{const o=b.$L.definition(n.widget.name);return l().createElement("div",{style:{flexDirection:"row",display:"flex"},key:i},l().createElement("div",{style:{flex:1,alignItems:"center"}},o.label),l().createElement(_e,{uniqid:e}),l().createElement(De,{uniqid:e}),l().createElement(Fe,{uniqid:n.widget.uniqid,layerId:t.uniqid}))})))},Re=f.default.registry.getLazyComponent("Button"),Oe=({uniqid:e})=>{const t=(0,E.useIntl)(),n=(0,x.useDispatch)(),i=(0,x.useSelector)((t=>b.$L.selectors.selectWidget(t,e))),[a,r]=l().useState(null==i?void 0:i.title),{control:c,watch:s}=(0,o.useForm)({defaultValues:{text:null!=a?a:""},criteriaMode:"all"});return l().useEffect((()=>{const e=s((e=>{r(e.text)}));return()=>e.unsubscribe()}),[s]),i?l().createElement("div",{style:{flex:1,display:"flex",flexDirection:"column"}},l().createElement(q.JRCInputText,{name:"text",control:c,placeholder:t.formatMessage({id:"EDITOR_Widget_Wrapper_Title"})}),l().createElement(Re,{onClick:()=>{void 0!==a&&(n(b.$L.slice.actions.updateWidgetWrapper({uniqid:e,title:a})),n(b.Wq.slice.actions.flushEditor({uniqid:e})))},variant:"outlined",minWidth:"100%"},t.formatMessage({id:"EDITOR_Save_Widget"}))):l().createElement(l().Fragment,null,"No wrapper")},Ge=f.default.registry.getLazyComponent("Icon"),ze=({uniqid:e})=>{const t=(0,E.useIntl)(),n=(0,x.useDispatch)(),i=(0,x.useSelector)((t=>b.Wq.selectors.selectEditor(t,e))),o=b.$L.definition(null==i?void 0:i.name),[a,r]=l().useState(!1),[c,s]=l().useState("default");return l().useEffect((()=>{setTimeout((()=>{r(!0)}),0)})),i?l().createElement("div",{style:{width:440,position:"relative"}},l().createElement(fe,{visible:a},l().createElement(ve,null,o.panel.useWrapper?l().createElement(he,{isActive:"wrapper"===c,onClick:()=>s("wrapper")},l().createElement(Ge,{name:"icon-font",color:"grey2"})):l().createElement(l().Fragment,null),o.panel.useEditor?l().createElement(he,{isActive:"default"===c,onClick:()=>s("default")},l().createElement(Ge,{name:"icon-pen",color:"grey2"})):l().createElement(l().Fragment,null),o.panel.useWidgets?l().createElement(Ue,{uniqid:e},l().createElement(he,{isActive:"widgets"===c,onClick:()=>s("widgets")},l().createElement(Ge,{name:"icon-sliders",color:"grey2"}))):l().createElement(l().Fragment,null)),l().createElement("div",{style:{flex:1,display:"flex",flexDirection:"column"}},l().createElement(ge,null,l().createElement(Me,{uniqid:e,position:i.position}),l().createElement(Ee,null,t.formatMessage({id:o.label})),l().createElement(pe,null,l().createElement(he,{onClick:()=>{n(b.Wq.slice.actions.flushEditor({uniqid:e}))}},l().createElement(Ge,{name:"icon-times",color:"grey2"})))),l().createElement(ye,null,"default"===c&&o.panel.useEditor?l().createElement(Ie,{uniqid:i.uniqid}):l().createElement(l().Fragment,null),"wrapper"===c&&o.panel.useWrapper?l().createElement(Oe,{uniqid:i.uniqid}):l().createElement(l().Fragment,null),"widgets"===c&&o.panel.useWidgets?l().createElement(Te,{uniqid:e,namespace:o.name}):l().createElement(l().Fragment,null)))),(null==i?void 0:i.popup)?l().createElement("div",{style:{position:"absolute",inset:0,backgroundColor:"#000",opacity:".7"}}):l().createElement(l().Fragment,null)):l().createElement(l().Fragment,null)},Me=({uniqid:e,position:t})=>{const n=(0,x.useDispatch)();return l().createElement(pe,null,l().createElement(he,{onClick:()=>{n(b.Wq.slice.actions.setEditorPosition({uniqid:e,position:"left"===t?"right":"left"}))}},l().createElement(Ge,{name:"left"===t?"icon-angle-right":"icon-angle-left",color:"grey2"})))},Ue=({uniqid:e,children:t})=>{const n=(0,x.useSelector)((t=>b.$L.selectors.selectWidgetState(t,e)));return(null==n?void 0:n.initialized)?t:l().createElement(l().Fragment,null)},Je=c().div`
223
+ `,({uniqid:e})=>{const t=(0,L.useDispatch)(),n=(0,L.useSelector)((t=>q.Wq.selectors.selectEditor(t,e)));return n&&n.popup&&n.view?l().createElement("div",{style:{flex:1,display:"flex",flexDirection:"column",backgroundColor:"white",marginTop:90}},l().createElement(ye,null,l().createElement(ve,null),l().createElement(he,null,"Popup"),l().createElement(ve,null,l().createElement(Ce,{onClick:()=>{t(q.Wq.slice.actions.flushEditorPopup({uniqid:e}))}},l().createElement(k.JRCIcon,{name:"icon-times",color:"grey2"})))),l().createElement("div",{style:{flex:1,display:"flex"}},n.view),l().createElement(ye,null,l().createElement(k.JRCButton,{onClick:()=>{t(q.Wq.slice.actions.flushEditorPopup({uniqid:e}))}},"Save"))):l().createElement(l().Fragment,null)}),ke=h.default.registry.getLazyComponent("WidgetArticleTitleEditor"),Se=h.default.registry.getLazyComponent("WidgetArticleImageEditor"),Ie=h.default.registry.getLazyComponent("WidgetArticleTextEditor"),Te=h.default.registry.getLazyComponent("WidgetArticleGalleryEditor"),Ae=h.default.registry.getLazyComponent("WidgetArticleButtonEditor"),_e=h.default.registry.getLazyComponent("WidgetArticleAttachmentEditor"),De=({uniqid:e})=>{const t=(0,L.useDispatch)(),n=(0,L.useSelector)(q.$L.selectors.selectToken),i=(0,L.useSelector)((t=>q.$L.selectors.selectWidget(t,e))),o=n=>{i&&t(q.$L.slice.actions.updateWidget({uniqid:e,content:n})),t(q.Wq.slice.actions.flushEditor({uniqid:e}))},a=(n,i)=>t(q.$L.slice.actions.updateWidget({uniqid:e,content:n,override:i})),r=(n,i)=>{t(void 0!==i?q.$L.slice.actions.setWidgetState(Object.assign({uniqid:i},n)):q.$L.slice.actions.setWidgetState(Object.assign({uniqid:e},n)))},c=n=>{t(q.Wq.slice.actions.registerEditorPopup({uniqid:e,view:n}))};switch(null==i?void 0:i.widget.name){default:return l().createElement(l().Fragment,null,"cannot display editor");case q.$L.const.WIDGET_ARTICLE_BUTTON:return l().createElement(Ae,{content:i.widget.content,onChange:a,onSave:o,onStateChange:r});case q.$L.const.WIDGET_ARTICLE_ATTACHMENT:return l().createElement(_e,{token:n,content:i.widget.content,onChange:a,onSave:o,onStateChange:r,onOpen:c});case q.$L.const.WIDGET_ARTICLE_GALLERY:return l().createElement(Te,{token:n,content:i.widget.content,onChange:a,onSave:o,onStateChange:r});case q.$L.const.WIDGET_ARTICLE_TEXT:return l().createElement(Ie,{onChange:a,onSave:o,content:i.widget.content});case q.$L.const.WIDGET_ARTICLE_IMAGE:return l().createElement(Se,{content:i.widget.content,token:n,onChange:a,onSave:o,onStateChange:r});case q.$L.const.WIDGET_ARTICLE_TITLE:return l().createElement(ke,{onChange:a,onSave:o,content:i.widget.content,onOpen:c})}},Fe=({uniqid:e})=>{const t=(0,L.useDispatch)(),n=(0,v.useIntl)(),i=(0,L.useSelector)((t=>q.$L.selectors.selectWidgetContent(t,e)));return l().createElement("div",{style:{flex:1}},l().createElement(je,{uniqid:e}),i&&i.widgets?i.widgets.map(((o,a)=>{const r=q.$L.definition(o.widget.name);return l().createElement("div",{key:a},l().createElement(Le,null,l().createElement(qe,{onClick:()=>((e,n)=>{t(q.Wq.slice.actions.registerEditor({uniqid:e,name:n}))})(o.widget.uniqid,o.widget.name)},n.formatMessage({id:r.label})),l().createElement($e,{onClick:()=>{i.widgets&&t(q.$L.slice.actions.updateWidget({uniqid:e,content:Object.assign(Object.assign({},i),{widgets:[...i.widgets.filter(((e,t)=>t!==a))]})}))}},l().createElement(k.JRCIcon,{name:"icon-trash"}))))})):l().createElement(l().Fragment,null))},je=({uniqid:e})=>{const t=(0,L.useDispatch)(),n=(0,L.useSelector)((t=>t.widgets.ids[e].widget.layers),L.shallowEqual);return l().createElement(l().Fragment,null,l().createElement(k.BETA_JRCDragAndDrop,{onDrag:()=>{},renderEl:(e,t)=>l().createElement(ze,{uniqid:e,key:t}),elms:n||[]}),l().createElement(pe,{namespace:"default",onChange:n=>{t(q.$L.slice.actions.registerLayer({uniqid:e,widget:n}))},mode:"button"}))},Re=({uniqid:e})=>{const t=(0,L.useDispatch)(),n=(0,L.useSelector)((t=>t.widgets.layers[e]));return l().createElement("div",{onClick:()=>{t(q.$L.slice.actions.updateLayer({uniqid:e,props:{locked:!n.locked}}))}},l().createElement(k.JRCIcon,{name:n.locked?"icon-lock":"icon-unlock"}))},Oe=({uniqid:e})=>{const t=(0,L.useDispatch)(),n=(0,L.useSelector)((t=>t.widgets.layers[e]));return l().createElement("div",{onClick:()=>{t(q.$L.slice.actions.updateLayer({uniqid:e,props:{visible:!n.visible}}))}},l().createElement(k.JRCIcon,{name:n.visible?"icon-eye":"icon-eye-slash"}))},Ge=({uniqid:e,layerId:t})=>{const n=(0,L.useDispatch)();return l().createElement("div",{onClick:()=>{n(q.$L.slice.actions.flushLayer({uniqid:e,layerId:t}))}},l().createElement(k.JRCIcon,{name:"icon-trash"}))},ze=({uniqid:e})=>{const t=(0,L.useSelector)((t=>t.widgets.layers[e]));return l().createElement(l().Fragment,null,t.title,t.widgets.map(((n,i)=>{const o=q.$L.definition(n.widget.name);return l().createElement("div",{style:{flexDirection:"row",display:"flex"},key:i},l().createElement("div",{style:{flex:1,alignItems:"center"}},o.label),l().createElement(Re,{uniqid:e}),l().createElement(Oe,{uniqid:e}),l().createElement(Ge,{uniqid:n.widget.uniqid,layerId:t.uniqid}))})))},Me=h.default.registry.getLazyComponent("Button"),Ue=({uniqid:e})=>{const t=(0,v.useIntl)(),n=(0,L.useDispatch)(),i=(0,L.useSelector)((t=>q.$L.selectors.selectWidget(t,e))),[a,r]=l().useState(null==i?void 0:i.title),{control:c,watch:s}=(0,o.useForm)({defaultValues:{text:null!=a?a:""},criteriaMode:"all"});return l().useEffect((()=>{const e=s((e=>{r(e.text)}));return()=>e.unsubscribe()}),[s]),i?l().createElement("div",{style:{flex:1,display:"flex",flexDirection:"column"}},l().createElement(k.JRCInputText,{name:"text",control:c,placeholder:t.formatMessage({id:"EDITOR_Widget_Wrapper_Title"})}),l().createElement(Me,{onClick:()=>{void 0!==a&&(n(q.$L.slice.actions.updateWidgetWrapper({uniqid:e,title:a})),n(q.Wq.slice.actions.flushEditor({uniqid:e})))},variant:"outlined",minWidth:"100%"},t.formatMessage({id:"EDITOR_Save_Widget"}))):l().createElement(l().Fragment,null,"No wrapper")},Je=h.default.registry.getLazyComponent("Icon"),Pe=({uniqid:e})=>{const t=(0,v.useIntl)(),n=(0,L.useDispatch)(),i=(0,L.useSelector)((t=>q.Wq.selectors.selectEditor(t,e))),o=q.$L.definition(null==i?void 0:i.name),[a,r]=l().useState(!1),[c,s]=l().useState("default");return l().useEffect((()=>{setTimeout((()=>{r(!0)}),0)})),i?l().createElement("div",{style:{width:440,position:"relative"}},l().createElement(we,{visible:a},l().createElement(be,null,o.panel.useWrapper?l().createElement(Ce,{isActive:"wrapper"===c,onClick:()=>s("wrapper")},l().createElement(Je,{name:"icon-font",color:"grey2"})):l().createElement(l().Fragment,null),o.panel.useEditor?l().createElement(Ce,{isActive:"default"===c,onClick:()=>s("default")},l().createElement(Je,{name:"icon-pen",color:"grey2"})):l().createElement(l().Fragment,null),o.panel.useWidgets?l().createElement(Be,{uniqid:e},l().createElement(Ce,{isActive:"widgets"===c,onClick:()=>s("widgets")},l().createElement(Je,{name:"icon-sliders",color:"grey2"}))):l().createElement(l().Fragment,null)),l().createElement("div",{style:{flex:1,display:"flex",flexDirection:"column"}},l().createElement(ye,null,l().createElement(Ve,{uniqid:e,position:i.position}),l().createElement(he,null,t.formatMessage({id:o.label})),l().createElement(ve,null,l().createElement(Ce,{onClick:()=>{n(q.Wq.slice.actions.flushEditor({uniqid:e}))}},l().createElement(Je,{name:"icon-times",color:"grey2"})))),l().createElement(xe,null,"default"===c&&o.panel.useEditor?l().createElement(De,{uniqid:i.uniqid}):l().createElement(l().Fragment,null),"wrapper"===c&&o.panel.useWrapper?l().createElement(Ue,{uniqid:i.uniqid}):l().createElement(l().Fragment,null),"widgets"===c&&o.panel.useWidgets?l().createElement(Fe,{uniqid:e,namespace:o.name}):l().createElement(l().Fragment,null)))),(null==i?void 0:i.popup)?l().createElement("div",{style:{position:"absolute",inset:0,backgroundColor:"#000",opacity:".7"}}):l().createElement(l().Fragment,null)):l().createElement(l().Fragment,null)},Ve=({uniqid:e,position:t})=>{const n=(0,L.useDispatch)();return l().createElement(ve,null,l().createElement(Ce,{onClick:()=>{n(q.Wq.slice.actions.setEditorPosition({uniqid:e,position:"left"===t?"right":"left"}))}},l().createElement(Je,{name:"left"===t?"icon-angle-right":"icon-angle-left",color:"grey2"})))},Be=({uniqid:e,children:t})=>{const n=(0,L.useSelector)((t=>q.$L.selectors.selectWidgetState(t,e)));return(null==n?void 0:n.initialized)?t:l().createElement(l().Fragment,null)},Ne=c().div`
217
224
  position: absolute;
218
225
  inset: 0;
219
226
  pointer-events: none;
220
227
  z-index: 100;
221
- `,Pe=c().div`
228
+ `,He=c().div`
222
229
  flex: 1;
223
230
  display: flex;
224
231
  margintop: ${90}px;
225
232
  pointer-events: ${e=>e.isActive?"all":"none"};
226
- `,Ve=c().div`
233
+ `,Xe=c().div`
227
234
  flex: 1;
228
235
  display: flex;
229
236
  flex-direction: row;
230
237
  pointer-events: none;
231
- `,Be=c().div`
238
+ `,Ye=c().div`
232
239
  width: ${440}px;
233
240
  pointer-events: none;
234
- `,Ne=()=>{const e=(0,x.useSelector)(b.Wq.selectors.selectEditors);return l().createElement(Je,null,e.map(((e,t)=>"left"===e.position?l().createElement(me,{isActive:!1,key:t},l().createElement(Ve,null,l().createElement(ze,{uniqid:e.uniqid}),l().createElement(Pe,{isActive:void 0!==e.popup},l().createElement(Ce,{uniqid:e.uniqid})),l().createElement(Be,null))):l().createElement(me,{isActive:!1,key:t},l().createElement(Ve,null,l().createElement(Be,null),l().createElement(Pe,{isActive:void 0!==e.popup},l().createElement(Ce,{uniqid:e.uniqid})),l().createElement(ze,{uniqid:e.uniqid}))))))}}}]);
241
+ `,Ke=()=>{const e=(0,L.useSelector)(q.Wq.selectors.selectEditors);return l().createElement(Ne,null,e.map(((e,t)=>"left"===e.position?l().createElement(fe,{isActive:!1,key:t},l().createElement(Xe,null,l().createElement(Pe,{uniqid:e.uniqid}),l().createElement(He,{isActive:void 0!==e.popup},l().createElement(We,{uniqid:e.uniqid})),l().createElement(Ye,null))):l().createElement(fe,{isActive:!1,key:t},l().createElement(Xe,null,l().createElement(Ye,null),l().createElement(He,{isActive:void 0!==e.popup},l().createElement(We,{uniqid:e.uniqid})),l().createElement(Pe,{uniqid:e.uniqid}))))))}}}]);
235
242
  //# sourceMappingURL=562.bundle.js.map