jamespot-react-core 1.1.131 → 1.1.133

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,4 +1,4 @@
1
- "use strict";(self.webpackChunkReactCore=self.webpackChunkReactCore||[]).push([[98],{98:(e,t,i)=>{i.r(t),i.d(t,{DisplayForm:()=>E,EditorsPortal:()=>le,Empty:()=>oe,JRCInputTinyMCEWithExt:()=>se,TwoColLayout:()=>ge,WidgetList:()=>Et,WidgetWrapperCore:()=>lt});var n=i(363),l=i.n(n),o=i(230),r=i(603),a=i(754),c=i.n(a),s=function(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var l=0;for(n=Object.getOwnPropertySymbols(e);l<n.length;l++)t.indexOf(n[l])<0&&Object.prototype.propertyIsEnumerable.call(e,n[l])&&(i[n[l]]=e[n[l]])}return i};const d=a.css`
1
+ "use strict";(self.webpackChunkReactCore=self.webpackChunkReactCore||[]).push([[880],{880:(e,t,i)=>{i.r(t),i.d(t,{AIModal:()=>de,DisplayForm:()=>E,EditorsPortal:()=>le,Empty:()=>oe,JRCInputTinyMCEWithExt:()=>me,JRCInputTinyMCEWithExtRaw:()=>ue,TwoColLayout:()=>ye,WidgetList:()=>ft,WidgetWrapperCore:()=>ot});var n=i(363),l=i.n(n),o=i(230),r=i(603),a=i(754),c=i.n(a),s=function(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var l=0;for(n=Object.getOwnPropertySymbols(e);l<n.length;l++)t.indexOf(n[l])<0&&Object.prototype.propertyIsEnumerable.call(e,n[l])&&(i[n[l]]=e[n[l]])}return i};const d=a.css`
2
2
  height: 100%;
3
3
  display: flex;
4
4
  flex-direction: column;
@@ -9,7 +9,7 @@
9
9
  ${({stretch:e})=>e&&d}
10
10
  `,p=n.forwardRef(((e,t)=>e.onSubmit?n.createElement(m,{stretch:e.stretch,onSubmit:e.onSubmit,ref:t},e.children):n.createElement(u,{stretch:e.stretch,ref:t},e.children))),g=c().div`
11
11
  ${e=>e.stretch&&"\n flex: 1;\n"}
12
- `,E=n.forwardRef(((e,t)=>{const i=n.useRef(null),[l,a]=(0,r.GF)(e.fields,e.type),c=(0,o.useForm)({defaultValues:Object.assign(Object.assign({},a),e.defaultValues),criteriaMode:"all"}),{handleSubmit:d,control:u,reset:m}=c,E=s(c,["handleSubmit","control","reset"]);return n.useImperativeHandle(t,(()=>Object.assign(Object.assign({},E),{handleSubmit:d,control:u,reset:()=>{var e;null===(e=null==i?void 0:i.current)||void 0===e||e.scrollTo(0,0),m()}})),[]),n.createElement(p,{stretch:e.stretch,onSubmit:e.onSubmit?d(e.onSubmit):void 0,ref:i},n.createElement(g,{stretch:e.stretch},l.map((t=>{var{Input:i}=t,l=s(t,["Input"]);return n.createElement(i,Object.assign({key:l.name,control:u},l,{dataCy:`${e.dataCy}-${l.name}`,readOnly:e.readOnly}))})),e.extraInputs&&e.extraInputs(u)),e.buttons)}));var f=i(855),y=i(720);c().div`
12
+ `,E=n.forwardRef(((e,t)=>{const i=n.useRef(null),[l,a]=(0,r.GF)(e.fields,e.type),c=(0,o.useForm)({defaultValues:Object.assign(Object.assign({},a),e.defaultValues),criteriaMode:"all"}),{handleSubmit:d,control:u,reset:m}=c,E=s(c,["handleSubmit","control","reset"]);return n.useImperativeHandle(t,(()=>Object.assign(Object.assign({},E),{handleSubmit:d,control:u,reset:()=>{var e;null===(e=null==i?void 0:i.current)||void 0===e||e.scrollTo(0,0),m()}})),[]),n.createElement(p,{stretch:e.stretch,onSubmit:e.onSubmit?d(e.onSubmit):void 0,ref:i},n.createElement(g,{stretch:e.stretch},l.map((t=>{var{Input:i}=t,l=s(t,["Input"]);return n.createElement(i,Object.assign({key:l.name,control:u},l,{dataCy:`${e.dataCy}-${l.name}`,readOnly:e.readOnly}))})),e.extraInputs&&e.extraInputs(u)),e.buttons)}));var f=i(855),y=i(265);c().div`
13
13
  margin-bottom: 24px;
14
14
  `,c().div`
15
15
  margin-bottom: 4px;
@@ -73,7 +73,7 @@
73
73
  &:hover {
74
74
  background-color: ${e=>e.theme.color.grey1};
75
75
  }
76
- `,$=(c().div`
76
+ `,L=(c().div`
77
77
  display: flex;
78
78
  border: 1px solid ${e=>e.theme.color.grey1};
79
79
  border-radius: ${8}px;
@@ -91,7 +91,7 @@
91
91
  background-color: ${e=>e.theme.color.grey0};
92
92
  border-radius: 8px;
93
93
  margin-bottom: 4px;
94
- `),L=c().div`
94
+ `),$=c().div`
95
95
  display: flex;
96
96
  flex: 1;
97
97
  align-items: center;
@@ -108,7 +108,7 @@
108
108
  flex: 1;
109
109
  display: flex;
110
110
  align-items: center;
111
- `;var W=i(535);const A=({uniqid:e})=>{const t=(0,f.useDispatch)(),i=(0,f.useSelector)((t=>W.Wq.selectors.selectEditor(t,e)));return i&&i.popup&&i.view?l().createElement("div",{style:{flex:1,display:"flex",flexDirection:"column",backgroundColor:"white",marginTop:90}},l().createElement(h,null,l().createElement(w,null),l().createElement(x,null,"Popup"),l().createElement(w,null,l().createElement(k,{onClick:()=>{t(W.Wq.slice.actions.flushEditorPopup({uniqid:e}))}},l().createElement(y.JRCIcon,{name:"icon-times",color:"grey2"})))),l().createElement("div",{style:{flex:1,display:"flex"}},i.view),l().createElement(h,null,l().createElement(y.JRCButton,{onClick:()=>{t(W.Wq.slice.actions.flushEditorPopup({uniqid:e}))}},"Save"))):l().createElement(l().Fragment,null)};var I=i(888);const O=I.default.registry.getLazyComponent("WidgetArticleTitleEditor"),F=I.default.registry.getLazyComponent("WidgetArticleImageEditor"),_=I.default.registry.getLazyComponent("WidgetArticleTextEditor"),D=I.default.registry.getLazyComponent("WidgetArticleGalleryEditor"),j=I.default.registry.getLazyComponent("WidgetArticleButtonEditor"),T=I.default.registry.getLazyComponent("WidgetArticleAttachmentEditor"),M=I.default.registry.getLazyComponent("WidgetArticleSliderEditor"),z=({uniqid:e})=>{var t,i,n;const o=(0,f.useDispatch)(),r=(0,f.useSelector)(W.$L.selectors.selectToken),a=(0,f.useSelector)((t=>W.$L.selectors.selectWidget(t,e))),c=t=>{a&&o(W.$L.slice.actions.updateWidget({uniqid:e,content:t})),o(W.Wq.slice.actions.flushEditor({uniqid:e}))},s=(t,i)=>{o(void 0!==i?W.$L.slice.actions.setWidgetState(Object.assign({uniqid:i},t)):W.$L.slice.actions.setWidgetState(Object.assign({uniqid:e},t)))},d=t=>{o(W.Wq.slice.actions.registerEditorPopup({uniqid:e,view:t}))};switch(null==a?void 0:a.widget.name){default:return l().createElement(l().Fragment,null,"cannot display editor");case"widget-article-button":return l().createElement(j,{content:a.widget.content,onChange:t=>{o((0,W.O5)(e,t,!1))},onSave:c,onStateChange:s});case"widget-article-attachment":return l().createElement(T,{token:r,content:a.widget.content,onChange:t=>o((0,W.O5)(e,t,!1)),onSave:c,onStateChange:s,onOpen:d});case"widget-article-gallery":return l().createElement(D,{token:r,content:a.widget.content,onChange:t=>o((0,W.O5)(e,t,!1)),onSave:c,onStateChange:s});case"widget-article-text":return l().createElement(_,{onChange:t=>o((0,W.O5)(e,t,!1)),onSave:c,content:a.widget.content});case"widget-article-image":return l().createElement(F,{content:a.widget.content,token:r,onChange:t=>o((0,W.O5)(e,t,!1)),onSave:c,onStateChange:s});case"widget-article-title":return l().createElement(O,{onChange:t=>{o((0,W.O5)(e,t,!1))},onSave:c,content:a.widget.content,onOpen:d});case"widget-article-slider":return void 0!==r?l().createElement(M,{slides:null!==(t=a.widget.content.slides)&&void 0!==t?t:[],loop:null!==(i=a.widget.content.loop)&&void 0!==i&&i,useDots:null===(n=a.widget.content.useDots)||void 0===n||n,onChange:t=>{o((0,W.O5)(e,t,!1))},token:r,onSave:c}):l().createElement(l().Fragment,null,"Token is mandatory")}};var R=i(181);const G=({uniqid:e})=>{const t=(0,f.useDispatch)(),i=(0,R.useIntl)(),n=(0,f.useSelector)((t=>W.$L.selectors.selectWidgetContent(t,e)));return l().createElement("div",{style:{flex:1}},l().createElement(B,{uniqid:e}),n&&n.widgets?n.widgets.map(((o,r)=>{const a=W.$L.definition(o.widget.name);return l().createElement("div",{key:r},l().createElement($,null,l().createElement(L,{onClick:()=>((e,i)=>{t(W.Wq.slice.actions.registerEditor({uniqid:e,name:i}))})(o.widget.uniqid,o.widget.name)},i.formatMessage({id:a.label})),l().createElement(S,{onClick:()=>{n.widgets&&t(W.$L.slice.actions.updateWidget({uniqid:e,content:Object.assign(Object.assign({},n),{widgets:[...n.widgets.filter(((e,t)=>t!==r))]})}))}},l().createElement(y.JRCIcon,{name:"icon-trash"}))))})):l().createElement(l().Fragment,null))},B=({uniqid:e})=>{const t=(0,f.useDispatch)(),i=(0,f.useSelector)((t=>t.widgets.ids[e].widget.layers),f.shallowEqual);return l().createElement(l().Fragment,null,l().createElement(y.BETA_JRCDragAndDrop,{onDrag:()=>{},renderEl:(e,t)=>l().createElement(V,{uniqid:e,key:t}),elms:i||[]}),l().createElement(Et,{namespace:"default",onChange:i=>{t(W.$L.slice.actions.registerLayer({uniqid:e,widget:i}))},mode:"button"}))},U=({uniqid:e})=>{const t=(0,f.useDispatch)(),i=(0,f.useSelector)((t=>t.widgets.layers[e]));return l().createElement("div",{onClick:()=>{t(W.$L.slice.actions.updateLayer({uniqid:e,props:{locked:!i.locked}}))}},l().createElement(y.JRCIcon,{name:i.locked?"icon-lock":"icon-unlock"}))},P=({uniqid:e})=>{const t=(0,f.useDispatch)(),i=(0,f.useSelector)((t=>t.widgets.layers[e]));return l().createElement("div",{onClick:()=>{t(W.$L.slice.actions.updateLayer({uniqid:e,props:{visible:!i.visible}}))}},l().createElement(y.JRCIcon,{name:i.visible?"icon-eye":"icon-eye-slash"}))},H=({uniqid:e,layerId:t})=>{const i=(0,f.useDispatch)();return l().createElement("div",{onClick:()=>{i(W.$L.slice.actions.flushLayer({uniqid:e,layerId:t}))}},l().createElement(y.JRCIcon,{name:"icon-trash"}))},V=({uniqid:e})=>{const t=(0,f.useSelector)((t=>t.widgets.layers[e]));return l().createElement(l().Fragment,null,t.title,t.widgets.map(((i,n)=>{const o=W.$L.definition(i.widget.name);return l().createElement("div",{style:{flexDirection:"row",display:"flex"},key:n},l().createElement("div",{style:{flex:1,alignItems:"center"}},o.label),l().createElement(U,{uniqid:e}),l().createElement(P,{uniqid:e}),l().createElement(H,{uniqid:i.widget.uniqid,layerId:t.uniqid}))})))},N=I.default.registry.getLazyComponent("Button"),Q=({uniqid:e})=>{const t=(0,R.useIntl)(),i=(0,f.useDispatch)(),n=(0,f.useSelector)((t=>W.$L.selectors.selectWidget(t,e))),[r,a]=l().useState(null==n?void 0:n.title),{control:c,watch:s}=(0,o.useForm)({defaultValues:{text:null!=r?r:""},criteriaMode:"all"});return l().useEffect((()=>{const e=s((e=>{a(e.text)}));return()=>e.unsubscribe()}),[s]),n?l().createElement("div",{style:{flex:1,display:"flex",flexDirection:"column"}},l().createElement(y.JRCInputText,{name:"text",control:c,placeholder:t.formatMessage({id:"EDITOR_Widget_Wrapper_Title"})}),l().createElement(N,{onClick:()=>{void 0!==r&&(i(W.$L.slice.actions.updateWidgetWrapper({uniqid:e,title:r})),i(W.Wq.slice.actions.flushEditor({uniqid:e})))},variant:"outlined",minWidth:"100%"},t.formatMessage({id:"EDITOR_Save_Widget"}))):l().createElement(l().Fragment,null,"No wrapper")},X=I.default.registry.getLazyComponent("Icon"),Y=({uniqid:e})=>{const t=(0,R.useIntl)(),i=(0,f.useDispatch)(),n=(0,f.useSelector)((t=>W.Wq.selectors.selectEditor(t,e))),o=W.$L.definition(null==n?void 0:n.name),[r,a]=l().useState(!1),[c,s]=l().useState("default");return l().useEffect((()=>{setTimeout((()=>{a(!0)}),0)})),n?l().createElement("div",{style:{width:440,position:"relative"}},l().createElement(b,{visible:r},l().createElement(q,null,o.panel.useWrapper?l().createElement(k,{isActive:"wrapper"===c,onClick:()=>s("wrapper")},l().createElement(X,{name:"icon-font",color:"grey2"})):l().createElement(l().Fragment,null),o.panel.useEditor?l().createElement(k,{isActive:"default"===c,onClick:()=>s("default")},l().createElement(X,{name:"icon-pen",color:"grey2"})):l().createElement(l().Fragment,null),o.panel.useWidgets?l().createElement(Z,{uniqid:e},l().createElement(k,{isActive:"widgets"===c,onClick:()=>s("widgets")},l().createElement(X,{name:"icon-sliders",color:"grey2"}))):l().createElement(l().Fragment,null)),l().createElement("div",{style:{flex:1,display:"flex",flexDirection:"column"}},l().createElement(h,null,l().createElement(K,{uniqid:e,position:n.position}),l().createElement(x,null,t.formatMessage({id:o.label})),l().createElement(w,null,l().createElement(k,{onClick:()=>{i(W.Wq.slice.actions.flushEditor({uniqid:e}))}},l().createElement(X,{name:"icon-times",color:"grey2"})))),l().createElement(C,null,"default"===c&&o.panel.useEditor?l().createElement(z,{uniqid:n.uniqid}):l().createElement(l().Fragment,null),"wrapper"===c&&o.panel.useWrapper?l().createElement(Q,{uniqid:n.uniqid}):l().createElement(l().Fragment,null),"widgets"===c&&o.panel.useWidgets?l().createElement(G,{uniqid:e,namespace:o.name}):l().createElement(l().Fragment,null)))),(null==n?void 0:n.popup)?l().createElement("div",{style:{position:"absolute",inset:0,backgroundColor:"#000",opacity:".7"}}):l().createElement(l().Fragment,null)):l().createElement(l().Fragment,null)},K=({uniqid:e,position:t})=>{const i=(0,f.useDispatch)();return l().createElement(w,null,l().createElement(k,{onClick:()=>{i(W.Wq.slice.actions.setEditorPosition({uniqid:e,position:"left"===t?"right":"left"}))}},l().createElement(X,{name:"left"===t?"icon-angle-right":"icon-angle-left",color:"grey2"})))},Z=({uniqid:e,children:t})=>{const i=(0,f.useSelector)((t=>W.$L.selectors.selectWidgetState(t,e)));return(null==i?void 0:i.initialized)?t:l().createElement(l().Fragment,null)},ee=c().div`
111
+ `;var W=i(710);const A=({uniqid:e})=>{const t=(0,f.useDispatch)(),i=(0,f.useSelector)((t=>W.Wq.selectors.selectEditor(t,e)));return i&&i.popup&&i.view?l().createElement("div",{style:{flex:1,display:"flex",flexDirection:"column",backgroundColor:"white",marginTop:90}},l().createElement(h,null,l().createElement(w,null),l().createElement(x,null,"Popup"),l().createElement(w,null,l().createElement(k,{onClick:()=>{t(W.Wq.slice.actions.flushEditorPopup({uniqid:e}))}},l().createElement(y.JRCIcon,{name:"icon-times",color:"grey2"})))),l().createElement("div",{style:{flex:1,display:"flex"}},i.view),l().createElement(h,null,l().createElement(y.JRCButton,{onClick:()=>{t(W.Wq.slice.actions.flushEditorPopup({uniqid:e}))}},"Save"))):l().createElement(l().Fragment,null)};var I=i(888);const O=I.default.registry.getLazyComponent("WidgetArticleTitleEditor"),_=I.default.registry.getLazyComponent("WidgetArticleImageEditor"),F=I.default.registry.getLazyComponent("WidgetArticleTextEditor"),M=I.default.registry.getLazyComponent("WidgetArticleGalleryEditor"),D=I.default.registry.getLazyComponent("WidgetArticleButtonEditor"),T=I.default.registry.getLazyComponent("WidgetArticleAttachmentEditor"),j=I.default.registry.getLazyComponent("WidgetArticleSliderEditor"),R=({uniqid:e})=>{var t,i,n;const o=(0,f.useDispatch)(),r=(0,f.useSelector)(W.$L.selectors.selectToken),a=(0,f.useSelector)((t=>W.$L.selectors.selectWidget(t,e))),c=t=>{a&&o(W.$L.slice.actions.updateWidget({uniqid:e,content:t})),o(W.Wq.slice.actions.flushEditor({uniqid:e}))},s=(t,i)=>{o(void 0!==i?W.$L.slice.actions.setWidgetState(Object.assign({uniqid:i},t)):W.$L.slice.actions.setWidgetState(Object.assign({uniqid:e},t)))},d=t=>{o(W.Wq.slice.actions.registerEditorPopup({uniqid:e,view:t}))};switch(null==a?void 0:a.widget.name){default:return l().createElement(l().Fragment,null,"cannot display editor");case"widget-article-button":return l().createElement(D,{content:a.widget.content,onChange:t=>{o((0,W.O5)(e,t,!1))},onSave:c,onStateChange:s});case"widget-article-attachment":return l().createElement(T,{token:r,content:a.widget.content,onChange:t=>o((0,W.O5)(e,t,!1)),onSave:c,onStateChange:s,onOpen:d});case"widget-article-gallery":return l().createElement(M,{token:r,content:a.widget.content,onChange:t=>o((0,W.O5)(e,t,!1)),onSave:c,onStateChange:s});case"widget-article-text":return l().createElement(F,{onChange:t=>o((0,W.O5)(e,t,!1)),onSave:c,content:a.widget.content});case"widget-article-image":return l().createElement(_,{content:a.widget.content,token:r,onChange:t=>o((0,W.O5)(e,t,!1)),onSave:c,onStateChange:s});case"widget-article-title":return l().createElement(O,{onChange:t=>{o((0,W.O5)(e,t,!1))},onSave:c,content:a.widget.content,onOpen:d});case"widget-article-slider":return void 0!==r?l().createElement(j,{slides:null!==(t=a.widget.content.slides)&&void 0!==t?t:[],loop:null!==(i=a.widget.content.loop)&&void 0!==i&&i,useDots:null===(n=a.widget.content.useDots)||void 0===n||n,onChange:t=>{o((0,W.O5)(e,t,!1))},token:r,onSave:c}):l().createElement(l().Fragment,null,"Token is mandatory")}};var z=i(181);const G=({uniqid:e})=>{const t=(0,f.useDispatch)(),i=(0,z.useIntl)(),n=(0,f.useSelector)((t=>W.$L.selectors.selectWidgetContent(t,e)));return l().createElement("div",{style:{flex:1}},l().createElement(B,{uniqid:e}),n&&n.widgets?n.widgets.map(((o,r)=>{const a=W.$L.definition(o.widget.name);return l().createElement("div",{key:r},l().createElement(L,null,l().createElement($,{onClick:()=>((e,i)=>{t(W.Wq.slice.actions.registerEditor({uniqid:e,name:i}))})(o.widget.uniqid,o.widget.name)},i.formatMessage({id:a.label})),l().createElement(S,{onClick:()=>{n.widgets&&t(W.$L.slice.actions.updateWidget({uniqid:e,content:Object.assign(Object.assign({},n),{widgets:[...n.widgets.filter(((e,t)=>t!==r))]})}))}},l().createElement(y.JRCIcon,{name:"icon-trash"}))))})):l().createElement(l().Fragment,null))},B=({uniqid:e})=>{const t=(0,f.useDispatch)(),i=(0,f.useSelector)((t=>t.widgets.ids[e].widget.layers),f.shallowEqual);return l().createElement(l().Fragment,null,l().createElement(y.BETA_JRCDragAndDrop,{onDrag:()=>{},renderEl:(e,t)=>l().createElement(N,{uniqid:e,key:t}),elms:i||[]}),l().createElement(ft,{namespace:"default",onChange:i=>{t(W.$L.slice.actions.registerLayer({uniqid:e,widget:i}))},mode:"button"}))},U=({uniqid:e})=>{const t=(0,f.useDispatch)(),i=(0,f.useSelector)((t=>t.widgets.layers[e]));return l().createElement("div",{onClick:()=>{t(W.$L.slice.actions.updateLayer({uniqid:e,props:{locked:!i.locked}}))}},l().createElement(y.JRCIcon,{name:i.locked?"icon-lock":"icon-unlock"}))},H=({uniqid:e})=>{const t=(0,f.useDispatch)(),i=(0,f.useSelector)((t=>t.widgets.layers[e]));return l().createElement("div",{onClick:()=>{t(W.$L.slice.actions.updateLayer({uniqid:e,props:{visible:!i.visible}}))}},l().createElement(y.JRCIcon,{name:i.visible?"icon-eye":"icon-eye-slash"}))},P=({uniqid:e,layerId:t})=>{const i=(0,f.useDispatch)();return l().createElement("div",{onClick:()=>{i(W.$L.slice.actions.flushLayer({uniqid:e,layerId:t}))}},l().createElement(y.JRCIcon,{name:"icon-trash"}))},N=({uniqid:e})=>{const t=(0,f.useSelector)((t=>t.widgets.layers[e]));return l().createElement(l().Fragment,null,t.title,t.widgets.map(((i,n)=>{const o=W.$L.definition(i.widget.name);return l().createElement("div",{style:{flexDirection:"row",display:"flex"},key:n},l().createElement("div",{style:{flex:1,alignItems:"center"}},o.label),l().createElement(U,{uniqid:e}),l().createElement(H,{uniqid:e}),l().createElement(P,{uniqid:i.widget.uniqid,layerId:t.uniqid}))})))},V=I.default.registry.getLazyComponent("Button"),Q=({uniqid:e})=>{const t=(0,z.useIntl)(),i=(0,f.useDispatch)(),n=(0,f.useSelector)((t=>W.$L.selectors.selectWidget(t,e))),[r,a]=l().useState(null==n?void 0:n.title),{control:c,watch:s}=(0,o.useForm)({defaultValues:{text:null!=r?r:""},criteriaMode:"all"});return l().useEffect((()=>{const e=s((e=>{a(e.text)}));return()=>e.unsubscribe()}),[s]),n?l().createElement("div",{style:{flex:1,display:"flex",flexDirection:"column"}},l().createElement(y.JRCInputText,{name:"text",control:c,placeholder:t.formatMessage({id:"EDITOR_Widget_Wrapper_Title"})}),l().createElement(V,{onClick:()=>{void 0!==r&&(i(W.$L.slice.actions.updateWidgetWrapper({uniqid:e,title:r})),i(W.Wq.slice.actions.flushEditor({uniqid:e})))},variant:"outlined",minWidth:"100%"},t.formatMessage({id:"EDITOR_Save_Widget"}))):l().createElement(l().Fragment,null,"No wrapper")},X=I.default.registry.getLazyComponent("Icon"),Y=({uniqid:e})=>{const t=(0,z.useIntl)(),i=(0,f.useDispatch)(),n=(0,f.useSelector)((t=>W.Wq.selectors.selectEditor(t,e))),o=W.$L.definition(null==n?void 0:n.name),[r,a]=l().useState(!1),[c,s]=l().useState("default");return l().useEffect((()=>{setTimeout((()=>{a(!0)}),0)})),n?l().createElement("div",{style:{width:440,position:"relative"}},l().createElement(b,{visible:r},l().createElement(q,null,o.panel.useWrapper?l().createElement(k,{isActive:"wrapper"===c,onClick:()=>s("wrapper")},l().createElement(X,{name:"icon-font",color:"grey2"})):l().createElement(l().Fragment,null),o.panel.useEditor?l().createElement(k,{isActive:"default"===c,onClick:()=>s("default")},l().createElement(X,{name:"icon-pen",color:"grey2"})):l().createElement(l().Fragment,null),o.panel.useWidgets?l().createElement(Z,{uniqid:e},l().createElement(k,{isActive:"widgets"===c,onClick:()=>s("widgets")},l().createElement(X,{name:"icon-sliders",color:"grey2"}))):l().createElement(l().Fragment,null)),l().createElement("div",{style:{flex:1,display:"flex",flexDirection:"column"}},l().createElement(h,null,l().createElement(K,{uniqid:e,position:n.position}),l().createElement(x,null,t.formatMessage({id:o.label})),l().createElement(w,null,l().createElement(k,{onClick:()=>{i(W.Wq.slice.actions.flushEditor({uniqid:e}))}},l().createElement(X,{name:"icon-times",color:"grey2"})))),l().createElement(C,null,"default"===c&&o.panel.useEditor?l().createElement(R,{uniqid:n.uniqid}):l().createElement(l().Fragment,null),"wrapper"===c&&o.panel.useWrapper?l().createElement(Q,{uniqid:n.uniqid}):l().createElement(l().Fragment,null),"widgets"===c&&o.panel.useWidgets?l().createElement(G,{uniqid:e,namespace:o.name}):l().createElement(l().Fragment,null)))),(null==n?void 0:n.popup)?l().createElement("div",{style:{position:"absolute",inset:0,backgroundColor:"#000",opacity:".7"}}):l().createElement(l().Fragment,null)):l().createElement(l().Fragment,null)},K=({uniqid:e,position:t})=>{const i=(0,f.useDispatch)();return l().createElement(w,null,l().createElement(k,{onClick:()=>{i(W.Wq.slice.actions.setEditorPosition({uniqid:e,position:"left"===t?"right":"left"}))}},l().createElement(X,{name:"left"===t?"icon-angle-right":"icon-angle-left",color:"grey2"})))},Z=({uniqid:e,children:t})=>{const i=(0,f.useSelector)((t=>W.$L.selectors.selectWidgetState(t,e)));return(null==i?void 0:i.initialized)?t:l().createElement(l().Fragment,null)},ee=c().div`
112
112
  position: absolute;
113
113
  inset: 0;
114
114
  pointer-events: none;
@@ -126,15 +126,15 @@
126
126
  `,ne=c().div`
127
127
  width: ${440}px;
128
128
  pointer-events: none;
129
- `,le=()=>{const e=(0,f.useSelector)(W.Wq.selectors.selectEditors);return l().createElement(ee,null,e.map(((e,t)=>"left"===e.position?l().createElement(v,{isActive:!1,key:t},l().createElement(ie,null,l().createElement(Y,{uniqid:e.uniqid}),l().createElement(te,{isActive:void 0!==e.popup},l().createElement(A,{uniqid:e.uniqid})),l().createElement(ne,null))):l().createElement(v,{isActive:!1,key:t},l().createElement(ie,null,l().createElement(ne,null),l().createElement(te,{isActive:void 0!==e.popup},l().createElement(A,{uniqid:e.uniqid})),l().createElement(Y,{uniqid:e.uniqid}))))))},oe=()=>n.createElement(n.Fragment,null),re={response:void 0,loading:!0,error:void 0};let ae;const ce=({query:e})=>{const t=(0,R.useIntl)(),[i,o]=(0,n.useState)(re),r=(0,n.useCallback)((e=>{var t,i;o(re),(t=e.text,i=e.capability,ae&&clearTimeout(ae),new Promise(((e,n)=>{ae=window.setTimeout((()=>{e(`${i} ${t}`)}),3e3)}))).then((e=>{o({error:void 0,loading:!1,response:e})})).catch((e=>{o({error:"error calling AI",loading:!1,response:void 0})}))}),[]);return(0,n.useEffect)((()=>{e&&e.text.trim().length>0&&r(e)}),[e]),l().createElement(y.JRCModal,{open:!!e,closeHandler:()=>{null==e||e.reject()},buttons:[{children:t.formatMessage({id:"GLOBAL_Try_Again"}),clickHandler:()=>{e&&r(e)}},{children:t.formatMessage({id:"GLOBAL_Validation"}),clickHandler:()=>i.response&&(null==e?void 0:e.resolve(i.response))},{children:t.formatMessage({id:"GLOBAL_Cancel"}),clickHandler:()=>null==e?void 0:e.reject()}]},i.loading&&l().createElement(y.JRCLoader,null),!i.loading&&i.error&&l().createElement("p",null,t.formatMessage({id:"GLOBAL_Error"})),!i.loading&&i.response&&l().createElement("p",null,i.response))},se=e=>{const t=(0,R.useIntl)(),i=(0,f.useDispatch)(),o=(0,a.useTheme)(),r=(0,f.useSelector)(W.Hn.selectors.selectAll),[c,s]=(()=>{const[e,t]=(0,n.useState)(),i=(0,n.useCallback)((e=>{t(Object.assign(Object.assign({},e),{reject:i=>{e.reject(i),t(void 0)},resolve:i=>{e.resolve(i),t(void 0)}}))}),[]),l=(0,n.useMemo)((()=>({develop:e=>new Promise(((t,n)=>{i({reject:n,resolve:t,text:e,capability:"develop"})})),summarize:e=>new Promise(((t,n)=>{i({reject:n,resolve:t,text:e,capability:"summarize"})})),tldr:e=>new Promise(((t,n)=>{i({reject:n,resolve:t,text:e,capability:"tldr"})}))})),[]);return[e,(0,n.useMemo)((()=>y.JTinyMCEExtensionsBuilders.jia(l)),[])]})(),d=(0,n.useMemo)((()=>{var e,t;return(null===(t=null===(e=J.hooks)||void 0===e?void 0:e.JIAHook)||void 0===t?void 0:t.isActive)&&J.debug.JIABETA}),[]),u=(0,n.useMemo)((()=>d?[s]:[]),[s,d]),m=(0,n.useCallback)((e=>{i(W.FN.actions.error({label:null!=e?e:t.formatMessage({id:"GLOBAL_Error"})}))}),[]),p=(0,n.useMemo)((()=>(0,I.getTinyMCEMentionsQueries)(r,o,m)),[]),g=(0,n.useMemo)((()=>I.default.tinymceCommonOptions),[I.default.tinymceCommonOptions]);return l().createElement(l().Fragment,null,g&&l().createElement(y.JRCInputTinyMCE,Object.assign({commonOptions:g,additionalExtensions:u,mentionsQueries:p},e)),l().createElement(ce,{query:c}))};var de=i(248);const ue=I.default.registry.getLazyComponent("Container"),me=I.default.registry.getLazyComponent("AppColumn"),pe=I.default.registry.getLazyComponent("MainColumn");function ge({extensionRoute:e,routes:t,description:i,mode:l="center"}){var o;const r=(0,R.useIntl)(),{pathname:a}=(0,de.useLocation)(),c=Object.values(t),[s,d]=n.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:r.formatMessage({id:t.label}),href:t.absolutePath?t.path:`/ng/rr/${e}/${t.path}`,group:t.group?r.formatMessage({id:t.group}):void 0})));return n.useEffect((()=>{const t=c.find((t=>a===`/ng/rr/${e}/${t.path}`));t&&d(t.key)}),[a]),n.createElement(n.Suspense,{fallback:n.createElement(n.Fragment,null)},n.createElement(ue,{mode:l},n.createElement(me,{mode:l,description:i,tabs:u,activeTab:s||""}),n.createElement(pe,{mode:l},n.createElement(de.Outlet,null))))}const Ee=I.default.registry.getLazyComponent("Loader"),fe=({name:e,uniqid:t,inplace:i})=>{const n=(0,f.useSelector)((e=>W.$L.selectors.selectWidgetState(e,t))),o=W.$L.definition(e);return(null==n?void 0:n.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(Ee,null)):(null==n?void 0:n.hover)?l().createElement("div",{style:{position:"absolute",inset:0,backgroundColor:"rgba(255,255,255,.7)",display:"flex",flex:1,justifyContent:"center",alignItems:"center"}}):!(null==n?void 0:n.initialized)&&i||(null==n?void 0:n.initialized)||i?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}))},ye=c().div`
129
+ `,le=()=>{const e=(0,f.useSelector)(W.Wq.selectors.selectEditors);return l().createElement(ee,null,e.map(((e,t)=>"left"===e.position?l().createElement(v,{isActive:!1,key:t},l().createElement(ie,null,l().createElement(Y,{uniqid:e.uniqid}),l().createElement(te,{isActive:void 0!==e.popup},l().createElement(A,{uniqid:e.uniqid})),l().createElement(ne,null))):l().createElement(v,{isActive:!1,key:t},l().createElement(ie,null,l().createElement(ne,null),l().createElement(te,{isActive:void 0!==e.popup},l().createElement(A,{uniqid:e.uniqid})),l().createElement(Y,{uniqid:e.uniqid}))))))},oe=()=>n.createElement(n.Fragment,null),re=()=>{const[e,t]=(0,n.useState)(),i=(0,z.useIntl)(),l=(0,n.useCallback)((e=>{t(Object.assign(Object.assign({},e),{reject:i=>{e.reject(i),t(void 0)},resolve:i=>{e.resolve(i),t(void 0)}}))}),[]),o=(0,n.useMemo)((()=>({develop:e=>new Promise(((t,i)=>{l({reject:i,resolve:t,text:e,capability:"develop"})})),summarize:e=>new Promise(((t,i)=>{l({reject:i,resolve:t,text:e,capability:"summarize"})})),tldr:e=>new Promise(((t,i)=>{l({reject:i,resolve:t,text:e,capability:"tldr"})}))})),[]);return[e,(0,n.useMemo)((()=>y.JTinyMCEExtensionsBuilders.jia(o,i)),[])]};var ae=i(6),ce=i.n(ae);const se={response:void 0,loading:!0,error:void 0},de=({query:e})=>{const t=(0,z.useIntl)(),[i,o]=(0,n.useState)(se),r=(0,n.useCallback)((e=>{o(se),ce().jia.textEnhancement({text:e.text,capacity:e.capability}).then((e=>{if(e.error)return void o({error:`${t.formatMessage({id:"JIA_ERROR_AI_CALL"})}${e.errorMsg&&": "+e.errorMsg}`,loading:!1,response:void 0});const i=e.result.text;o({error:void 0,loading:!1,response:i})})).catch((e=>{o({error:t.formatMessage({id:"JIA_ERROR_AI_CALL"}),loading:!1,response:void 0})}))}),[]);return(0,n.useEffect)((()=>{e&&e.text.trim().length>0&&r(e)}),[e]),l().createElement(y.JRCModal,{zIndex:50010,open:!!e,closeHandler:()=>{null==e||e.reject()},buttons:[{children:t.formatMessage({id:"GLOBAL_Try_Again"}),clickHandler:()=>{e&&r(e)}},{children:t.formatMessage({id:"GLOBAL_Validation"}),clickHandler:()=>i.response&&(null==e?void 0:e.resolve(i.response))},{children:t.formatMessage({id:"GLOBAL_Cancel"}),clickHandler:()=>null==e?void 0:e.reject()}]},i.loading&&l().createElement(l().Fragment,null,l().createElement(y.JRCLoader,null),l().createElement(y.JRCTypography,{align:"center"},t.formatMessage({id:"JIA_WAITING_WARNIG"}))),!i.loading&&i.error&&l().createElement("p",null,i.error),!i.loading&&i.response&&l().createElement("p",null,i.response))},ue=e=>{const t=(0,z.useIntl)(),i=(0,f.useDispatch)(),o=(0,a.useTheme)(),r=(0,f.useSelector)(W.Hn.selectors.selectAll),[c,s]=re(),d=(0,n.useMemo)((()=>{var e,t;return(null===(t=null===(e=J.hooks)||void 0===e?void 0:e.JIAHook)||void 0===t?void 0:t.isActive)&&J.debug.JIABETA}),[]),u=(0,n.useMemo)((()=>d?[s]:[]),[s,d]),m=(0,n.useCallback)((e=>{i(W.FN.actions.error({label:null!=e?e:t.formatMessage({id:"GLOBAL_Error"})}))}),[]),p=(0,n.useMemo)((()=>(0,I.getTinyMCEMentionsQueries)(r,o,m)),[]),g=(0,n.useMemo)((()=>I.default.tinymceCommonOptions),[I.default.tinymceCommonOptions]);return l().createElement(l().Fragment,null,g&&l().createElement(y.JRCInputTinyMCERaw,Object.assign({commonOptions:g,additionalExtensions:u,mentionsQueries:p},e)),l().createElement(de,{query:c}))},me=e=>{const t=(0,z.useIntl)(),i=(0,f.useDispatch)(),o=(0,a.useTheme)(),r=(0,f.useSelector)(W.Hn.selectors.selectAll),[c,s]=re(),d=(0,n.useMemo)((()=>{var e,t;return(null===(t=null===(e=J.hooks)||void 0===e?void 0:e.JIAHook)||void 0===t?void 0:t.isActive)&&J.debug.JIABETA}),[]),u=(0,n.useMemo)((()=>d?[s]:[]),[s,d]),m=(0,n.useCallback)((e=>{i(W.FN.actions.error({label:null!=e?e:t.formatMessage({id:"GLOBAL_Error"})}))}),[]),p=(0,n.useMemo)((()=>(0,I.getTinyMCEMentionsQueries)(r,o,m)),[]),g=(0,n.useMemo)((()=>I.default.tinymceCommonOptions),[I.default.tinymceCommonOptions]);return l().createElement(l().Fragment,null,g&&l().createElement(y.JRCInputTinyMCE,Object.assign({commonOptions:g,additionalExtensions:u,mentionsQueries:p},e)),l().createElement(de,{query:c}))};var pe=i(248);const ge=I.default.registry.getLazyComponent("Container"),Ee=I.default.registry.getLazyComponent("AppColumn"),fe=I.default.registry.getLazyComponent("MainColumn");function ye({extensionRoute:e,routes:t,description:i,mode:l="center"}){var o;const r=(0,z.useIntl)(),{pathname:a}=(0,pe.useLocation)(),c=Object.values(t),[s,d]=n.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:r.formatMessage({id:t.label}),href:t.absolutePath?t.path:`/ng/rr/${e}/${t.path}`,group:t.group?r.formatMessage({id:t.group}):void 0})));return n.useEffect((()=>{const t=c.find((t=>a===`/ng/rr/${e}/${t.path}`));t&&d(t.key)}),[a]),n.createElement(n.Suspense,{fallback:n.createElement(n.Fragment,null)},n.createElement(ge,{mode:l},n.createElement(Ee,{mode:l,description:i,tabs:u,activeTab:s||""}),n.createElement(fe,{mode:l},n.createElement(pe.Outlet,null))))}const ve=I.default.registry.getLazyComponent("Loader"),he=({name:e,uniqid:t,inplace:i})=>{const n=(0,f.useSelector)((e=>W.$L.selectors.selectWidgetState(e,t))),o=W.$L.definition(e);return(null==n?void 0:n.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(ve,null)):(null==n?void 0:n.hover)?l().createElement("div",{style:{position:"absolute",inset:0,backgroundColor:"rgba(255,255,255,.7)",display:"flex",flex:1,justifyContent:"center",alignItems:"center"}}):!(null==n?void 0:n.initialized)&&i||(null==n?void 0:n.initialized)||i?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}))},we=c().div`
130
130
  width: 0;
131
131
  height: 0;
132
132
  overflow: hidden;
133
- `,ve=I.default.registry.getLazyComponent("DEPRECATEDFormInputFile"),he=({children:e,initialFiles:t,initialClick:i,multiple:n,accept:o,onUploadStart:r,onUploadEnd:a,onUploadSuccess:c})=>{const s=l().useRef(null),d=(0,f.useSelector)(W.$L.selectors.selectToken),[u,m]=l().useState(0),[p,g]=l().useState(t);return l().useEffect((()=>{var e;i&&(null===(e=s.current)||void 0===e||e.click())}),[i]),l().useEffect((()=>{t.length!==p.length&&g(t)}),[t]),l().useEffect((()=>{c(p)}),[p]),l().useEffect((()=>{0===u&&a()}),[u]),l().createElement(l().Fragment,null,l().createElement("div",{onClick:()=>{var e;i&&(null===(e=s.current)||void 0===e||e.click())}},e),l().createElement(ye,null,l().createElement(ve,{ref:s,id:"widget-upload-file",name:"editorFiles",content:"",accept:o,multiple:n,token:d,onUploadStart:e=>{void 0!==e&&m((t=>t+e)),"function"==typeof r&&0!==e&&r()},onUploadSuccess:e=>{void 0!==e&&(m((e=>void 0!==e?e-1:0)),g((t=>n?[...t,e]:[e])))}})))},we=I.default.registry.getLazyComponent("WidgetArticleGallery"),xe=I.default.registry.getLazyComponent("FileViewer"),be=c().button`
133
+ `,xe=I.default.registry.getLazyComponent("DEPRECATEDFormInputFile"),be=({children:e,initialFiles:t,initialClick:i,multiple:n,accept:o,onUploadStart:r,onUploadEnd:a,onUploadSuccess:c})=>{const s=l().useRef(null),d=(0,f.useSelector)(W.$L.selectors.selectToken),[u,m]=l().useState(0),[p,g]=l().useState(t);return l().useEffect((()=>{var e;i&&(null===(e=s.current)||void 0===e||e.click())}),[i]),l().useEffect((()=>{t.length!==p.length&&g(t)}),[t]),l().useEffect((()=>{c(p)}),[p]),l().useEffect((()=>{0===u&&a()}),[u]),l().createElement(l().Fragment,null,l().createElement("div",{onClick:()=>{var e;i&&(null===(e=s.current)||void 0===e||e.click())}},e),l().createElement(we,null,l().createElement(xe,{ref:s,id:"widget-upload-file",name:"editorFiles",content:"",accept:o,multiple:n,token:d,onUploadStart:e=>{void 0!==e&&m((t=>t+e)),"function"==typeof r&&0!==e&&r()},onUploadSuccess:e=>{void 0!==e&&(m((e=>void 0!==e?e-1:0)),g((t=>n?[...t,e]:[e])))}})))},Ce=I.default.registry.getLazyComponent("WidgetArticleGallery"),qe=I.default.registry.getLazyComponent("FileViewer"),ke=c().button`
134
134
  cursor: pointer;
135
- `,Ce=({widget:e,inplace:t,mode:i})=>{var n,o;const{uniqid:r}=e,{files:a}=e.content,c=(0,f.useDispatch)(),s=(0,f.useSelector)((e=>W.$L.selectors.isActive(e,r)),f.shallowEqual);return l().useEffect((()=>{c(W.$L.slice.actions.setWidgetState({uniqid:r,mounted:!0}))}),[]),void 0!==a?l().createElement(l().Fragment,null,"edit"===i?l().createElement(we,{files:a,maxWidth:800,gap:null!==(n=e.content.gap)&&void 0!==n?n:"10",column:null!==(o=e.content.column)&&void 0!==o?o:"3",onClick:()=>{}}):l().createElement(xe,{files:a,openWithOptions:{}},(t=>{var i,n;return l().createElement(be,null,l().createElement(we,{files:a,maxWidth:600,gap:null!==(i=e.content.gap)&&void 0!==i?i:"10",column:null!==(n=e.content.column)&&void 0!==n?n:"3",onClick:e=>t(e)}))})),t&&"edit"===i?l().createElement(he,{initialFiles:a,initialClick:s,accept:"image/png, image/jpeg, image/jpg",multiple:!0,onUploadSuccess:e=>{Array.isArray(e)&&c((0,W.O5)(r,{files:e}))},onUploadStart:()=>{c(W.$L.slice.actions.setWidgetState({uniqid:r,loading:!0}))},onUploadEnd:()=>{c(W.$L.slice.actions.setWidgetState({uniqid:r,loading:!1}))}},l().createElement(y.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 qe=i(6),ke=i.n(qe);const $e=I.default.registry.getLazyComponent("WidgetArticleAttachment"),Le=I.default.registry.getLazyComponent("FileViewer"),Se=c().div`
135
+ `,Le=({widget:e,inplace:t,mode:i})=>{var n,o;const{uniqid:r}=e,{files:a}=e.content,c=(0,f.useDispatch)(),s=(0,f.useSelector)((e=>W.$L.selectors.isActive(e,r)),f.shallowEqual);return l().useEffect((()=>{c(W.$L.slice.actions.setWidgetState({uniqid:r,mounted:!0}))}),[]),void 0!==a?l().createElement(l().Fragment,null,"edit"===i?l().createElement(Ce,{files:a,maxWidth:800,gap:null!==(n=e.content.gap)&&void 0!==n?n:"10",column:null!==(o=e.content.column)&&void 0!==o?o:"3",onClick:()=>{}}):l().createElement(qe,{files:a,openWithOptions:{}},(t=>{var i,n;return l().createElement(ke,null,l().createElement(Ce,{files:a,maxWidth:600,gap:null!==(i=e.content.gap)&&void 0!==i?i:"10",column:null!==(n=e.content.column)&&void 0!==n?n:"3",onClick:e=>t(e)}))})),t&&"edit"===i?l().createElement(be,{initialFiles:a,initialClick:s,accept:"image/png, image/jpeg, image/jpg",multiple:!0,onUploadSuccess:e=>{Array.isArray(e)&&c((0,W.O5)(r,{files:e}))},onUploadStart:()=>{c(W.$L.slice.actions.setWidgetState({uniqid:r,loading:!0}))},onUploadEnd:()=>{c(W.$L.slice.actions.setWidgetState({uniqid:r,loading:!1}))}},l().createElement(y.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)},$e=I.default.registry.getLazyComponent("WidgetArticleAttachment"),Se=I.default.registry.getLazyComponent("FileViewer"),We=c().div`
136
136
  flex: 1;
137
- `,We=({widget:e,inplace:t,mode:i})=>{const n=(0,R.useIntl)(),{uniqid:o}=e,{files:r}=e.content,a=(0,f.useDispatch)(),c=(0,f.useSelector)((e=>W.$L.selectors.isActive(e,o)),f.shallowEqual);l().useEffect((()=>{a(W.$L.slice.actions.setWidgetState({uniqid:o,mounted:!0}))}),[]);const s=(0,f.useSelector)((e=>W.Mx.selectors.selectById(e,"OnlyOfficeHook"))),d=[{label:n.formatMessage({id:"WIDGET_Open_With_Wedoc"}),onClick:e=>{e&&ke().object.getAccessHash(`fileArticle/${e.id}`).then((t=>{if(""===t.result)throw new Error("result empty");const i=t.result;((e,t,i)=>{window.open(function(e,t){return`/ng/rr/file/${e}/${t}`}(e,t),void 0)})(e.id,i)})).catch((()=>{a(W.FN.actions.error({label:"WIDGET_Open_Failed"},6e3))}))}}],u=s?{"application/vnd.openxmlformats-officedocument.wordprocessingml.document":d,"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":d,"application/vnd.openxmlformats-officedocument.presentationml.presentation":d}:{};return void 0!==r?l().createElement(Se,null,"view"!==i?l().createElement($e,{files:r,onClick:()=>{}}):l().createElement(Le,{files:r,openWithOptions:u},(e=>l().createElement($e,{files:r,onClick:t=>e(t)}))),t&&"view"!==i&&l().createElement(he,{initialFiles:r,initialClick:c,multiple:!0,accept:"*",onUploadSuccess:e=>{Array.isArray(e)&&a((0,W.O5)(o,{files:e}))},onUploadStart:()=>{a(W.$L.slice.actions.setWidgetState({uniqid:o,loading:!0}))},onUploadEnd:()=>{a(W.$L.slice.actions.setWidgetState({uniqid:o,loading:!1}))}},"edit"===i?l().createElement(y.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)},Ae=I.default.registry.getLazyComponent("WidgetArticleImage"),Ie=I.default.registry.getLazyComponent("FileViewer"),Oe=c().div`
137
+ `,Ae=({widget:e,inplace:t,mode:i})=>{const n=(0,z.useIntl)(),{uniqid:o}=e,{files:r}=e.content,a=(0,f.useDispatch)(),c=(0,f.useSelector)((e=>W.$L.selectors.isActive(e,o)),f.shallowEqual);l().useEffect((()=>{a(W.$L.slice.actions.setWidgetState({uniqid:o,mounted:!0}))}),[]);const s=(0,f.useSelector)((e=>W.Mx.selectors.selectById(e,"OnlyOfficeHook"))),d=[{label:n.formatMessage({id:"WIDGET_Open_With_Wedoc"}),onClick:e=>{e&&ce().object.getAccessHash(`fileArticle/${e.id}`).then((t=>{if(""===t.result)throw new Error("result empty");const i=t.result;((e,t,i)=>{window.open(function(e,t){return`/ng/rr/file/${e}/${t}`}(e,t),void 0)})(e.id,i)})).catch((()=>{a(W.FN.actions.error({label:"WIDGET_Open_Failed"},6e3))}))}}],u=s?{"application/vnd.openxmlformats-officedocument.wordprocessingml.document":d,"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":d,"application/vnd.openxmlformats-officedocument.presentationml.presentation":d}:{};return void 0!==r?l().createElement(We,null,"view"!==i?l().createElement($e,{files:r,onClick:()=>{}}):l().createElement(Se,{files:r,openWithOptions:u},(e=>l().createElement($e,{files:r,onClick:t=>e(t)}))),t&&"view"!==i&&l().createElement(be,{initialFiles:r,initialClick:c,multiple:!0,accept:"*",onUploadSuccess:e=>{Array.isArray(e)&&a((0,W.O5)(o,{files:e}))},onUploadStart:()=>{a(W.$L.slice.actions.setWidgetState({uniqid:o,loading:!0}))},onUploadEnd:()=>{a(W.$L.slice.actions.setWidgetState({uniqid:o,loading:!1}))}},"edit"===i?l().createElement(y.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)},Ie=I.default.registry.getLazyComponent("WidgetArticleImage"),Oe=I.default.registry.getLazyComponent("FileViewer"),_e=c().div`
138
138
  position: absolute;
139
139
  inset: 0;
140
140
  background-color: rgba(0, 0, 0, 0.4);
@@ -149,20 +149,20 @@
149
149
  }
150
150
  `,Fe=c().button`
151
151
  cursor: pointer;
152
- `,_e={id:0,type:"",title:"",uri:"",mimetype:"application/octet-stream",mainType:"",dateCreation:"",dateModified:"",_url:""},De=({widget:e,width:t,inplace:i,mode:n})=>{const{uniqid:o}=e,{file:r,useFilter:a}=e.content,c=(0,f.useDispatch)(),s=(0,f.useSelector)((e=>W.$L.selectors.isActive(e,o)),f.shallowEqual),[d,u]=l().useState(void 0),m=(0,R.useIntl)();return l().useEffect((()=>{c(W.$L.slice.actions.setWidgetState({uniqid:o,mounted:!0}))}),[]),l().useEffect((()=>{r&&u(`/imagecache/fitx1200/${r.type}/${r.id}.png?_=${r.dateModified?(e=>{if(e){const t=Date.parse(e);if(!isNaN(t))return new Date(t).getTime()/1e3}})(r.dateModified):Date.now()}`)}),[r]),l().createElement(l().Fragment,null,"edit"===n?l().createElement(Ae,{maxWidth:null!=t?t:600,uri:d,useFilter:null!=a&&a}):l().createElement(Ie,{files:[Object.assign(Object.assign({},_e),{path:d,mimetype:"image/png"})],openWithOptions:{}},(e=>l().createElement(Fe,{onClick:()=>e(0)},l().createElement(Ae,{maxWidth:null!=t?t:600,uri:d,useFilter:null!=a&&a})))),i&&"edit"===n?l().createElement(he,{initialFiles:[],initialClick:s,accept:"image/png, image/jpeg, image/jpg",multiple:!1,onUploadSuccess:e=>{Array.isArray(e)&&void 0!==e[0]&&c((0,W.O5)(o,{file:e[0]}))},onUploadStart:()=>{c(W.$L.slice.actions.setWidgetState({uniqid:o,loading:!0}))},onUploadEnd:()=>{c(W.$L.slice.actions.setWidgetState({uniqid:o,loading:!1}))}},void 0!==r?l().createElement(Oe,null,m.formatMessage({id:"ARTICLE_Widget_Image_Change"})):l().createElement(y.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))},je=c().div`
152
+ `,Me={id:0,type:"",title:"",uri:"",mimetype:"application/octet-stream",mainType:"",dateCreation:"",dateModified:"",_url:""},De=({widget:e,width:t,inplace:i,mode:n})=>{const{uniqid:o}=e,{file:r,useFilter:a}=e.content,c=(0,f.useDispatch)(),s=(0,f.useSelector)((e=>W.$L.selectors.isActive(e,o)),f.shallowEqual),[d,u]=l().useState(void 0),m=(0,z.useIntl)();return l().useEffect((()=>{c(W.$L.slice.actions.setWidgetState({uniqid:o,mounted:!0}))}),[]),l().useEffect((()=>{r&&u(`/imagecache/fitx1200/${r.type}/${r.id}.png?_=${r.dateModified?(e=>{if(e){const t=Date.parse(e);if(!isNaN(t))return new Date(t).getTime()/1e3}})(r.dateModified):Date.now()}`)}),[r]),l().createElement(l().Fragment,null,"edit"===n?l().createElement(Ie,{maxWidth:null!=t?t:600,uri:d,useFilter:null!=a&&a}):l().createElement(Oe,{files:[Object.assign(Object.assign({},Me),{path:d,mimetype:"image/png"})],openWithOptions:{}},(e=>l().createElement(Fe,{onClick:()=>e(0)},l().createElement(Ie,{maxWidth:null!=t?t:600,uri:d,useFilter:null!=a&&a})))),i&&"edit"===n?l().createElement(be,{initialFiles:[],initialClick:s,accept:"image/png, image/jpeg, image/jpg",multiple:!1,onUploadSuccess:e=>{Array.isArray(e)&&void 0!==e[0]&&c((0,W.O5)(o,{file:e[0]}))},onUploadStart:()=>{c(W.$L.slice.actions.setWidgetState({uniqid:o,loading:!0}))},onUploadEnd:()=>{c(W.$L.slice.actions.setWidgetState({uniqid:o,loading:!1}))}},void 0!==r?l().createElement(_e,null,m.formatMessage({id:"ARTICLE_Widget_Image_Change"})):l().createElement(y.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))},Te=c().div`
153
153
  flex: 1;
154
154
  display: flex;
155
155
  flex-direction: row;
156
156
  min-height: 60px;
157
157
  align-items: center;
158
- `,Te=c().div`
158
+ `,je=c().div`
159
159
  display: flex;
160
160
  flex-direction: row;
161
161
  border-radius: 8px;
162
162
  overflow: hidden;
163
163
  margin: 4px;
164
164
  border: 1px solid ${e=>e.theme.color.grey1};
165
- `,Me=c().button`
165
+ `,Re=c().button`
166
166
  display: flex;
167
167
  width: 40px;
168
168
  height: 40px;
@@ -174,31 +174,31 @@
174
174
  &:hover {
175
175
  background-color: ${e=>e.theme.color.grey1};
176
176
  }
177
- `,ze=({widget:e,inplace:t,mode:i})=>{const{uniqid:n}=e,{text:o,color:r,heading:a}=e.content,c=(0,f.useDispatch)(),s=(0,f.useSelector)((e=>W.$L.selectors.isActive(e,n)),f.shallowEqual);return l().createElement(je,null,l().createElement(y.JRCWidgetArticleTitle,{text:o,color:r,heading:a,autoFocus:s,inplace:t,mode:i,onChange:e=>{c((0,W.O5)(n,{text:e}))}}),s&&"edit"===i?l().createElement(Re,{heading:a,onClick:e=>{c((0,W.O5)(n,{heading:e}))}}):l().createElement(l().Fragment,null))},Re=({heading:e="h1",onClick:t})=>l().createElement(Te,null,["h1","h2","h3","h4"].map(((i,n)=>l().createElement(Me,{key:n,isActive:e===i,onClick:()=>t(i)},i)))),Je=c().div`
177
+ `,Je=({widget:e,inplace:t,mode:i})=>{const{uniqid:n}=e,{text:o,color:r,heading:a}=e.content,c=(0,f.useDispatch)(),s=(0,f.useSelector)((e=>W.$L.selectors.isActive(e,n)),f.shallowEqual);return l().createElement(Te,null,l().createElement(y.JRCWidgetArticleTitle,{text:o,color:r,heading:a,autoFocus:s,inplace:t,mode:i,onChange:e=>{c((0,W.O5)(n,{text:e}))}}),s&&"edit"===i?l().createElement(ze,{heading:a,onClick:e=>{c((0,W.O5)(n,{heading:e}))}}):l().createElement(l().Fragment,null))},ze=({heading:e="h1",onClick:t})=>l().createElement(je,null,["h1","h2","h3","h4"].map(((i,n)=>l().createElement(Re,{key:n,isActive:e===i,onClick:()=>t(i)},i)))),Ge=c().div`
178
178
  min-height: 60px;
179
179
  cursor: text;
180
- `,Ge=({widget:e,mode:t})=>{const{uniqid:i}=e,n=(0,a.useTheme)(),{text:o,color:r,lineHeight:c,linkColor:s,fontSize:d}=e.content,u=(0,f.useDispatch)(),m=(0,f.useSelector)((e=>W.$L.selectors.isActive(e,i)),f.shallowEqual),p=(0,f.useSelector)(W.$L.selectors.selectToken),g=(0,f.useSelector)(W.zh.selectors.selectTinyMCECommonOptions);return l().createElement(Je,null,l().createElement(y.JRCWidgetArticleText,{autoFocus:m,text:null!=o?o:"",color:null!=r?r:n.color.black,lineHeight:null!=c?c:"20",linkColor:null!=s?s:n.color.primary,fontSize:null!=d?d:"20",token:"edit"===t&&void 0!==p?p:"",tinyMCECommonOptions:"edit"===t?g:void 0,mode:t,onChange:e=>{u((0,W.O5)(i,{text:e}))}}))},Be=c().div`
180
+ `,Be=({widget:e,mode:t})=>{const{uniqid:i}=e,n=(0,a.useTheme)(),{text:o,color:r,lineHeight:c,linkColor:s,fontSize:d}=e.content,u=(0,f.useDispatch)(),m=(0,f.useSelector)((e=>W.$L.selectors.isActive(e,i)),f.shallowEqual),p=(0,f.useSelector)(W.$L.selectors.selectToken),g=(0,f.useSelector)(W.zh.selectors.selectTinyMCECommonOptions);return l().createElement(Ge,null,l().createElement(y.JRCWidgetArticleText,{autoFocus:m,text:null!=o?o:"",color:null!=r?r:n.color.black,lineHeight:null!=c?c:"20",linkColor:null!=s?s:n.color.primary,fontSize:null!=d?d:"20",token:"edit"===t&&void 0!==p?p:"",tinyMCECommonOptions:"edit"===t?g:void 0,mode:t,onChange:e=>{u((0,W.O5)(i,{text:e}))}}))},Ue=c().div`
181
181
  pointer-events: ${e=>e.clickable?"all":"none"};
182
182
  cursor: pointer;
183
- `,Ue=({widget:e,mode:t})=>{const i=(0,f.useDispatch)(),{uniqid:n}=e,{text:o,color:r,backgroundColor:a,buttonSize:c,borderRadius:s,variant:d}=e.content;return l().createElement("div",{onClick:()=>{"edit"===t&&i(W.Wq.slice.actions.registerEditor({uniqid:n,name:e.name}))}},l().createElement(Be,{clickable:"edit"!==t},l().createElement(y.JRCWidgetArticleButton,{text:o,color:r,backgroundColor:a,buttonSize:c,borderRadius:s,variant:d})))};var Pe=i(5);const He=I.default.registry.getLazyComponent("FileViewer"),Ve=c().div`
183
+ `,He=({widget:e,mode:t})=>{const i=(0,f.useDispatch)(),{uniqid:n}=e,{text:o,color:r,backgroundColor:a,buttonSize:c,borderRadius:s,variant:d}=e.content;return l().createElement("div",{onClick:()=>{"edit"===t&&i(W.Wq.slice.actions.registerEditor({uniqid:n,name:e.name}))}},l().createElement(Ue,{clickable:"edit"!==t},l().createElement(y.JRCWidgetArticleButton,{text:o,color:r,backgroundColor:a,buttonSize:c,borderRadius:s,variant:d})))};var Pe=i(5);const Ne=I.default.registry.getLazyComponent("FileViewer"),Ve=c().div`
184
184
  flex: 1;
185
185
  display: flex;
186
186
  flex-direction: row;
187
187
  min-height: 60px;
188
188
  align-items: center;
189
- `,Ne={id:0,type:"",title:"",uri:"",mimetype:"application/octet-stream",mainType:"",dateCreation:"",dateModified:"",_url:""},Qe=e=>{if(e){const t=Date.parse(e);if(!isNaN(t))return new Date(t).getTime()/1e3}},Xe=({widget:e,mode:t,width:i})=>{const{uniqid:n}=e,o=(0,Pe.TL)(),r=(0,f.useSelector)((e=>W.$L.selectors.isActive(e,n)),f.shallowEqual),a=e.content.slides?[...e.content.slides.map(((e,t)=>Object.assign(Object.assign({},Ne),{id:e.file?e.file.id:t,mimetype:e.file?e.file.mimetype:Ne.mimetype,path:e.file?`/imagecache/fitx1200/${e.file.type}/${e.file.id}.png?_=${e.file.dateModified?Qe(e.file.dateModified):Date.now()}`:void 0})))]:[];return l().useEffect((()=>{r&&"edit"===t&&o(W.Wq.slice.actions.registerEditor({uniqid:n,name:e.name}))}),[r]),l().createElement(Ve,null,l().createElement(He,{files:a,openWithOptions:{}},(r=>{var a,c;return l().createElement(y.JRCWidgetSlider,{slides:void 0!==e.content.slides?[...e.content.slides.map((e=>e.file?Object.assign(Object.assign({},e),{uri:`${J.urlBase}imagecache/fitx1200/${e.file.type}/${e.file.id}.png?_=${e.file.dateModified?Qe(e.file.dateModified):Date.now()}`}):Object.assign(Object.assign({},e),{uri:""})))]:[],maxWidth:null!=i?i:600,useDots:null===(a=e.content.useDots)||void 0===a||a,loop:null!==(c=e.content.loop)&&void 0!==c&&c,startAt:0,onClickSlide:i=>{if("edit"!==t){if(e.content.slides){const t=e.content.slides[i];t&&t.file&&r(t.file.id)}}else o(W.Wq.slice.actions.registerEditor({uniqid:n,name:e.name}))}})})),"edit"===t&&Array.isArray(e.content.slides)&&0===e.content.slides.length?l().createElement(y.JRCWidgetEmptyInplace,{label:"WIDGET_Article_Slider_Empty_Label",description:"WIDGET_Article_Slider_Empty_Description",url:"widget-article-image-placeholder.png",onClick:()=>{o(W.Wq.slice.actions.registerEditor({uniqid:e.uniqid,name:e.name}))}}):l().createElement(l().Fragment,null))},Ye=({widget:e,width:t,inplace:i=!1,mode:n="view"})=>{const{name:o}=e;switch(o){default:return l().createElement(l().Fragment,null,"cannot display widget (",o,")");case"widget-article-button":return l().createElement(Ue,{widget:e,inplace:i,mode:n});case"widget-article-gallery":return l().createElement(Ce,{widget:e,inplace:i,mode:n});case"widget-article-attachment":return l().createElement(We,{widget:e,inplace:i,mode:n});case"widget-article-image":return l().createElement(De,{widget:e,inplace:i,mode:n,width:null!=t?t:800});case"widget-article-slider":return l().createElement(Xe,{widget:e,inplace:i,mode:n,width:null!=t?t:800});case"widget-article-title":return l().createElement(ze,{widget:e,inplace:i,mode:n});case"widget-article-text":return l().createElement(Ge,{widget:e,inplace:i,mode:n})}};var Ke=i(769);const Ze=c().div`
189
+ `,Qe={id:0,type:"",title:"",uri:"",mimetype:"application/octet-stream",mainType:"",dateCreation:"",dateModified:"",_url:""},Xe=e=>{if(e){const t=Date.parse(e);if(!isNaN(t))return new Date(t).getTime()/1e3}},Ye=({widget:e,mode:t,width:i})=>{const{uniqid:n}=e,o=(0,Pe.TL)(),r=(0,f.useSelector)((e=>W.$L.selectors.isActive(e,n)),f.shallowEqual),a=e.content.slides?[...e.content.slides.map(((e,t)=>Object.assign(Object.assign({},Qe),{id:e.file?e.file.id:t,mimetype:e.file?e.file.mimetype:Qe.mimetype,path:e.file?`/imagecache/fitx1200/${e.file.type}/${e.file.id}.png?_=${e.file.dateModified?Xe(e.file.dateModified):Date.now()}`:void 0})))]:[];return l().useEffect((()=>{r&&"edit"===t&&o(W.Wq.slice.actions.registerEditor({uniqid:n,name:e.name}))}),[r]),l().createElement(Ve,null,l().createElement(Ne,{files:a,openWithOptions:{}},(r=>{var a,c;return l().createElement(y.JRCWidgetSlider,{slides:void 0!==e.content.slides?[...e.content.slides.map((e=>e.file?Object.assign(Object.assign({},e),{uri:`${J.urlBase}imagecache/fitx1200/${e.file.type}/${e.file.id}.png?_=${e.file.dateModified?Xe(e.file.dateModified):Date.now()}`}):Object.assign(Object.assign({},e),{uri:""})))]:[],maxWidth:null!=i?i:600,useDots:null===(a=e.content.useDots)||void 0===a||a,loop:null!==(c=e.content.loop)&&void 0!==c&&c,startAt:0,onClickSlide:i=>{if("edit"!==t){if(e.content.slides){const t=e.content.slides[i];t&&t.file&&r(t.file.id)}}else o(W.Wq.slice.actions.registerEditor({uniqid:n,name:e.name}))}})})),"edit"===t&&Array.isArray(e.content.slides)&&0===e.content.slides.length?l().createElement(y.JRCWidgetEmptyInplace,{label:"WIDGET_Article_Slider_Empty_Label",description:"WIDGET_Article_Slider_Empty_Description",url:"widget-article-image-placeholder.png",onClick:()=>{o(W.Wq.slice.actions.registerEditor({uniqid:e.uniqid,name:e.name}))}}):l().createElement(l().Fragment,null))},Ke=({widget:e,width:t,inplace:i=!1,mode:n="view"})=>{const{name:o}=e;switch(o){default:return l().createElement(l().Fragment,null,"cannot display widget (",o,")");case"widget-article-button":return l().createElement(He,{widget:e,inplace:i,mode:n});case"widget-article-gallery":return l().createElement(Le,{widget:e,inplace:i,mode:n});case"widget-article-attachment":return l().createElement(Ae,{widget:e,inplace:i,mode:n});case"widget-article-image":return l().createElement(De,{widget:e,inplace:i,mode:n,width:null!=t?t:800});case"widget-article-slider":return l().createElement(Ye,{widget:e,inplace:i,mode:n,width:null!=t?t:800});case"widget-article-title":return l().createElement(Je,{widget:e,inplace:i,mode:n});case"widget-article-text":return l().createElement(Be,{widget:e,inplace:i,mode:n})}};var Ze=i(769);const et=c().div`
190
190
  position: absolute;
191
191
  inset: 0;
192
192
  opacity: ${e=>e.opacity};
193
193
  background-color: ${e=>e.backgroundColor};
194
194
  pointer-events: ${e=>e.pointerEvents};
195
- `,et=({uniqid:e,mode:t})=>{const i=(0,f.useSelector)((t=>t.widgets.ids[e].widget.layers),f.shallowEqual);return l().createElement(l().Fragment,null,null==i?void 0:i.map(((e,t)=>l().createElement(tt,{uniqid:e,key:t,mode:"edit"}))))},tt=({uniqid:e,mode:t})=>{const i=(0,f.useSelector)((t=>t.widgets.layers[e]));return"view"===t?l().createElement(Ze,{opacity:1,backgroundColor:"transparent",pointerEvents:"none"},i.widgets.map(((e,t)=>l().createElement(it,{key:t,layerId:i.uniqid,uniqid:e.widget.uniqid,mode:"view"})))):l().createElement(Ze,{opacity:i.visible?1:0,backgroundColor:i.visible?"rgba(255,255,255,.1)":"transparent",pointerEvents:i.locked?"none":"all"},i.widgets.map(((e,t)=>l().createElement(it,{key:t,layerId:i.uniqid,uniqid:e.widget.uniqid,mode:"edit"}))))},it=({uniqid:e,layerId:t,mode:i})=>{const n=(0,f.useDispatch)(),o=(0,f.useSelector)((t=>t.widgets.ids[e]),f.shallowEqual),r=(0,f.useSelector)((e=>e.widgets.layers[t]));return o&&r&&r.position?"view"===i?l().createElement("div",{style:{position:"absolute",top:r.position.y,left:r.position.x}},l().createElement(ot,{uniqid:e,widget:o,mode:i,inplace:!0})):l().createElement(nt,{position:{x:r.position.x,y:r.position.y},onMouseUp:e=>{(r.position&&r.position.x!==e.x||r.position&&r.position.y!==e.y)&&(e=>{n(W.$L.slice.actions.updateLayer({uniqid:t,props:{position:e}}))})(e)}},l().createElement(y.BETA_JRCDoubleClick,{onDoubleTap:()=>((e,t)=>{n(W.Wq.slice.actions.registerEditor({uniqid:e,name:t}))})(o.widget.uniqid,o.widget.name)},l().createElement(ot,{uniqid:e,widget:o,mode:i,inplace:!0}))):l().createElement(l().Fragment,null)},nt=({position:e,children:t,onMouseUp:i})=>{const[n,o]=l().useState(!1),[r,a]=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),p=l().useCallback((e=>{if(n&&m.current){const t=c.x+(e.clientX-r.x),i=c.y+(e.clientY-r.y);u({x:t,y:i})}}),[n]),g=()=>{o(!1),i({x:d.x,y:d.y})};return l().useEffect((()=>(document.addEventListener("mousemove",p),document.addEventListener("mouseup",g),()=>{document.removeEventListener("mousemove",p),document.removeEventListener("mouseup",g)})),[p]),l().createElement("div",{style:{position:"absolute",top:d.y,left:d.x},ref:m,onMouseDown:e=>{o(!0),m.current&&(a({x:e.nativeEvent.clientX,y:e.nativeEvent.clientY}),s({x:d.x,y:d.y}))}},t)},lt=({uniqid:e,widget:t,inplace:i=!0,mode:n,width:o})=>{const r=(0,f.useDispatch)(),a=(0,f.useSelector)((t=>W.$L.selectors.selectWidget(t,e))),c=(0,f.useSelector)((t=>t.widgets.editableMap[e]),f.shallowEqual),s=(0,f.useSelector)((e=>e.widgets.currentEditableWidgetId),f.shallowEqual),d=(0,f.useSelector)((t=>t.widgets.currentEditableWidgetId===e),f.shallowEqual),{ref:u,isComponentVisible:m,setIsComponentVisible:p}=(0,Ke.I)(!1);if(l().useEffect((()=>{t&&r(W.$L.slice.actions.registerWidget({uniqid:e,widget:t}))}),[]),l().useEffect((()=>{m||e===s&&r(W.$L.slice.actions.setEditableWidgetId({uniqid:void 0}))}),[m]),l().useEffect((()=>{m!==d&&p(d)}),[d]),void 0===a)return l().createElement(l().Fragment,null,"This widget cannot be desplayed");const g=()=>{"edit"===n?E():"widget-article-button"===a.widget.name&&"link"===a.widget.content.openingType&&a.widget.content.openingTypeLink&&window.open(a.widget.content.openingTypeLink.url,a.widget.content.openingTypeLink.target)},E=()=>{if("view"===n)return;const{widget:e}=a;r(W.Wq.slice.actions.registerEditor({uniqid:e.uniqid,name:e.name}))};return i&&"view"!==n?l().createElement("div",{style:{minWidth:void 0!==o?o:"100%"},ref:u,onClick:()=>{p(!0),c&&(r(W.$L.slice.actions.setEditableIndex({index:c.index})),r(W.$L.slice.actions.setEditableWidgetId({uniqid:e})))}},l().createElement(Ye,{width:o,widget:a.widget,inplace:i,mode:n,onClick:g}),l().createElement(et,{uniqid:e,mode:n}),l().createElement(fe,{name:a.widget.name,uniqid:a.widget.uniqid,inplace:i})):l().createElement("div",{style:{flex:1,display:"flex",minWidth:void 0!==o?o:"100%"},onClick:E},l().createElement(Ye,{widget:a.widget,inplace:i,mode:n,width:o,onClick:g}),l().createElement(et,{uniqid:e,mode:n}),l().createElement(fe,{name:a.widget.name,uniqid:a.widget.uniqid,inplace:i}))},ot=lt,rt=c().div`
195
+ `,tt=({uniqid:e,mode:t})=>{const i=(0,f.useSelector)((t=>t.widgets.ids[e].widget.layers),f.shallowEqual);return l().createElement(l().Fragment,null,null==i?void 0:i.map(((e,t)=>l().createElement(it,{uniqid:e,key:t,mode:"edit"}))))},it=({uniqid:e,mode:t})=>{const i=(0,f.useSelector)((t=>t.widgets.layers[e]));return"view"===t?l().createElement(et,{opacity:1,backgroundColor:"transparent",pointerEvents:"none"},i.widgets.map(((e,t)=>l().createElement(nt,{key:t,layerId:i.uniqid,uniqid:e.widget.uniqid,mode:"view"})))):l().createElement(et,{opacity:i.visible?1:0,backgroundColor:i.visible?"rgba(255,255,255,.1)":"transparent",pointerEvents:i.locked?"none":"all"},i.widgets.map(((e,t)=>l().createElement(nt,{key:t,layerId:i.uniqid,uniqid:e.widget.uniqid,mode:"edit"}))))},nt=({uniqid:e,layerId:t,mode:i})=>{const n=(0,f.useDispatch)(),o=(0,f.useSelector)((t=>t.widgets.ids[e]),f.shallowEqual),r=(0,f.useSelector)((e=>e.widgets.layers[t]));return o&&r&&r.position?"view"===i?l().createElement("div",{style:{position:"absolute",top:r.position.y,left:r.position.x}},l().createElement(rt,{uniqid:e,widget:o,mode:i,inplace:!0})):l().createElement(lt,{position:{x:r.position.x,y:r.position.y},onMouseUp:e=>{(r.position&&r.position.x!==e.x||r.position&&r.position.y!==e.y)&&(e=>{n(W.$L.slice.actions.updateLayer({uniqid:t,props:{position:e}}))})(e)}},l().createElement(y.BETA_JRCDoubleClick,{onDoubleTap:()=>((e,t)=>{n(W.Wq.slice.actions.registerEditor({uniqid:e,name:t}))})(o.widget.uniqid,o.widget.name)},l().createElement(rt,{uniqid:e,widget:o,mode:i,inplace:!0}))):l().createElement(l().Fragment,null)},lt=({position:e,children:t,onMouseUp:i})=>{const[n,o]=l().useState(!1),[r,a]=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),p=l().useCallback((e=>{if(n&&m.current){const t=c.x+(e.clientX-r.x),i=c.y+(e.clientY-r.y);u({x:t,y:i})}}),[n]),g=()=>{o(!1),i({x:d.x,y:d.y})};return l().useEffect((()=>(document.addEventListener("mousemove",p),document.addEventListener("mouseup",g),()=>{document.removeEventListener("mousemove",p),document.removeEventListener("mouseup",g)})),[p]),l().createElement("div",{style:{position:"absolute",top:d.y,left:d.x},ref:m,onMouseDown:e=>{o(!0),m.current&&(a({x:e.nativeEvent.clientX,y:e.nativeEvent.clientY}),s({x:d.x,y:d.y}))}},t)},ot=({uniqid:e,widget:t,inplace:i=!0,mode:n,width:o})=>{const r=(0,f.useDispatch)(),a=(0,f.useSelector)((t=>W.$L.selectors.selectWidget(t,e))),c=(0,f.useSelector)((t=>t.widgets.editableMap[e]),f.shallowEqual),s=(0,f.useSelector)((e=>e.widgets.currentEditableWidgetId),f.shallowEqual),d=(0,f.useSelector)((t=>t.widgets.currentEditableWidgetId===e),f.shallowEqual),{ref:u,isComponentVisible:m,setIsComponentVisible:p}=(0,Ze.I)(!1);if(l().useEffect((()=>{t&&r(W.$L.slice.actions.registerWidget({uniqid:e,widget:t}))}),[]),l().useEffect((()=>{m||e===s&&r(W.$L.slice.actions.setEditableWidgetId({uniqid:void 0}))}),[m]),l().useEffect((()=>{m!==d&&p(d)}),[d]),void 0===a)return l().createElement(l().Fragment,null,"This widget cannot be desplayed");const g=()=>{"edit"===n?E():"widget-article-button"===a.widget.name&&"link"===a.widget.content.openingType&&a.widget.content.openingTypeLink&&window.open(a.widget.content.openingTypeLink.url,a.widget.content.openingTypeLink.target)},E=()=>{if("view"===n)return;const{widget:e}=a;r(W.Wq.slice.actions.registerEditor({uniqid:e.uniqid,name:e.name}))};return i&&"view"!==n?l().createElement("div",{style:{minWidth:void 0!==o?o:"100%"},ref:u,onClick:()=>{p(!0),c&&(r(W.$L.slice.actions.setEditableIndex({index:c.index})),r(W.$L.slice.actions.setEditableWidgetId({uniqid:e})))}},l().createElement(Ke,{width:o,widget:a.widget,inplace:i,mode:n,onClick:g}),l().createElement(tt,{uniqid:e,mode:n}),l().createElement(he,{name:a.widget.name,uniqid:a.widget.uniqid,inplace:i})):l().createElement("div",{style:{flex:1,display:"flex",minWidth:void 0!==o?o:"100%"},onClick:E},l().createElement(Ke,{widget:a.widget,inplace:i,mode:n,width:o,onClick:g}),l().createElement(tt,{uniqid:e,mode:n}),l().createElement(he,{name:a.widget.name,uniqid:a.widget.uniqid,inplace:i}))},rt=ot,at=c().div`
196
196
  display: flex;
197
197
  flex-direction: row;
198
198
  flex-wrap: wrap;
199
199
  gap: 10px;
200
200
  justify-content: center;
201
- `,at=c().div`
201
+ `,ct=c().div`
202
202
  border: 1px solid ${e=>e.theme.color.grey2};
203
203
  border-radius: 8px;
204
204
  cursor: pointer;
@@ -223,7 +223,7 @@
223
223
  opacity: 1;
224
224
  }
225
225
  }
226
- `,ct=c().div`
226
+ `,st=c().div`
227
227
  border: 2px solid ${e=>e.theme.color.primary};
228
228
  height: ${e=>e.open?"320":"54"}px;
229
229
  border-radius: 8px;
@@ -233,13 +233,13 @@
233
233
  transition: height 0.4s;
234
234
  overflow: hidden;
235
235
  flex-direction: column;
236
- `,st=c().div`
236
+ `,dt=c().div`
237
237
  display: flex;
238
238
  flex-direction: row;
239
239
  flex-wrap: wrap;
240
240
  justify-content: center;
241
241
  gap: 10px;
242
- `,dt=c().div`
242
+ `,ut=c().div`
243
243
  min-height: 50px;
244
244
  display: flex;
245
245
  justify-content: center;
@@ -249,7 +249,7 @@
249
249
  &:hover {
250
250
  background-color: ${e=>e.theme.color.grey0};
251
251
  }
252
- `,ut=c().button`
252
+ `,mt=c().button`
253
253
  height: 72px;
254
254
  display: flex;
255
255
  align-items: center;
@@ -263,5 +263,5 @@
263
263
  img {
264
264
  width: 40px;
265
265
  }
266
- `,mt=I.default.registry.getLazyComponent("Button"),pt=I.default.registry.getLazyComponent("ModalLayout"),gt=I.default.registry.getLazyComponent("ModalContent"),Et=({mode:e,view:t,children:i,namespace:n="default",onChange:o})=>{const[r,a]=l().useState(!1),c=function(e){return"widget-article-image"===e?[W.$L.definition("widget-article-title"),W.$L.definition("widget-article-button")]:[W.$L.definition("widget-article-title"),W.$L.definition("widget-article-text"),W.$L.definition("widget-article-image"),W.$L.definition("widget-article-button"),W.$L.definition("widget-article-slider"),W.$L.definition("widget-article-attachment")]}(n),s=(0,R.useIntl)(),d={open:r,portalId:"react-modal",variant:"full-height",closeHandler:()=>a(!1)},u=e=>{o(W.$L.factory(e)),a(!1)};return l().createElement(l().Fragment,null,l().createElement(pt,Object.assign({},d),l().createElement(gt,{onClickIconClose:d.closeHandler,title:"widget builder"},l().createElement(rt,null,c.map(((e,t)=>l().createElement(at,{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&&i?l().createElement("div",{onClick:()=>a(!0)},i):l().createElement(l().Fragment,null),"button"===e&&"edit"===t?l().createElement(mt,{onClick:()=>a(!0),variant:"outlined",minWidth:"100%"},s.formatMessage({id:"WIDGET_Add_Widget"})):l().createElement(l().Fragment,null),"gallery"===e&&"edit"===t?l().createElement(rt,null,c.map(((e,t)=>l().createElement(at,{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(ft,{widgets:c,onClick:u}):l().createElement(l().Fragment,null))},ft=({widgets:e,onClick:t})=>{const[i,n]=l().useState(!1),o=(0,R.useIntl)();return l().createElement(l().Fragment,null,l().createElement(ct,{open:i},l().createElement(dt,{onClick:()=>n(!i)},o.formatMessage({id:"WIDGET_Add_Widget"})),l().createElement(st,null,e.map(((e,n)=>l().createElement(ut,{key:e.name,open:i,index:n,onClick:()=>t(e.name)},l().createElement("img",{src:e.img}),o.formatMessage({id:e.label})))))))}}}]);
267
- //# sourceMappingURL=98.bundle.js.map
266
+ `,pt=I.default.registry.getLazyComponent("Button"),gt=I.default.registry.getLazyComponent("ModalLayout"),Et=I.default.registry.getLazyComponent("ModalContent"),ft=({mode:e,view:t,children:i,namespace:n="default",onChange:o})=>{const[r,a]=l().useState(!1),c=function(e){return"widget-article-image"===e?[W.$L.definition("widget-article-title"),W.$L.definition("widget-article-button")]:[W.$L.definition("widget-article-title"),W.$L.definition("widget-article-text"),W.$L.definition("widget-article-image"),W.$L.definition("widget-article-button"),W.$L.definition("widget-article-slider"),W.$L.definition("widget-article-attachment")]}(n),s=(0,z.useIntl)(),d={open:r,portalId:"react-modal",variant:"full-height",closeHandler:()=>a(!1)},u=e=>{o(W.$L.factory(e)),a(!1)};return l().createElement(l().Fragment,null,l().createElement(gt,Object.assign({},d),l().createElement(Et,{onClickIconClose:d.closeHandler,title:"widget builder"},l().createElement(at,null,c.map(((e,t)=>l().createElement(ct,{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&&i?l().createElement("div",{onClick:()=>a(!0)},i):l().createElement(l().Fragment,null),"button"===e&&"edit"===t?l().createElement(pt,{onClick:()=>a(!0),variant:"outlined",minWidth:"100%"},s.formatMessage({id:"WIDGET_Add_Widget"})):l().createElement(l().Fragment,null),"gallery"===e&&"edit"===t?l().createElement(at,null,c.map(((e,t)=>l().createElement(ct,{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(yt,{widgets:c,onClick:u}):l().createElement(l().Fragment,null))},yt=({widgets:e,onClick:t})=>{const[i,n]=l().useState(!1),o=(0,z.useIntl)();return l().createElement(l().Fragment,null,l().createElement(st,{open:i},l().createElement(ut,{onClick:()=>n(!i)},o.formatMessage({id:"WIDGET_Add_Widget"})),l().createElement(dt,null,e.map(((e,n)=>l().createElement(mt,{key:e.name,open:i,index:n,onClick:()=>t(e.name)},l().createElement("img",{src:e.img}),o.formatMessage({id:e.label})))))))}}}]);
267
+ //# sourceMappingURL=880.bundle.js.map