jamespot-react-core 1.1.100 → 1.1.102

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.
Files changed (35) hide show
  1. package/build/706.bundle.js +194 -0
  2. package/build/706.bundle.js.map +1 -0
  3. package/build/app.bundle.js +1056 -438
  4. package/build/app.bundle.js.map +1 -1
  5. package/build/src/components/editors/Editor.d.ts +3 -0
  6. package/build/src/components/editors/EditorPopup.d.ts +3 -0
  7. package/build/src/components/editors/EditorTabWidgets.d.ts +4 -0
  8. package/build/src/components/editors/EditorTabWrapper.d.ts +3 -0
  9. package/build/src/components/editors/EditorWrapper.d.ts +3 -0
  10. package/build/src/components/editors/EditorsPortal.d.ts +7 -0
  11. package/build/src/components/editors/const.d.ts +3 -0
  12. package/build/src/components/editors/style.d.ts +22 -0
  13. package/build/src/components/index.d.ts +2 -1
  14. package/build/src/components/widgets/Widget.d.ts +9 -0
  15. package/build/src/components/widgets/Widget.style.d.ts +6 -0
  16. package/build/src/components/widgets/WidgetInplace/WidgetInplace.style.d.ts +1 -0
  17. package/build/src/components/widgets/WidgetInplace/WidgetInplaceUpload.d.ts +14 -0
  18. package/build/src/components/widgets/WidgetInplace/WidgetInplaceWrapper.d.ts +6 -0
  19. package/build/src/components/widgets/WidgetLayer/WidgetLayer.d.ts +15 -0
  20. package/build/src/components/widgets/WidgetLayer/WidgetLayer.style.d.ts +5 -0
  21. package/build/src/components/widgets/WidgetList/WidgetList.d.ts +9 -0
  22. package/build/src/components/widgets/WidgetList/WidgetList.style.d.ts +13 -0
  23. package/build/src/components/widgets/WidgetState.d.ts +6 -0
  24. package/build/src/components/widgets/WidgetWrapperCore.d.ts +9 -0
  25. package/build/src/components/widgets/const.d.ts +6 -0
  26. package/build/src/components/widgets/hooks.d.ts +5 -0
  27. package/build/src/components/widgets/namespace.d.ts +2 -0
  28. package/build/src/components/widgets/utils.d.ts +16 -0
  29. package/build/src/components/widgets/utils.test.d.ts +1 -0
  30. package/build/src/registry/core-component-list.d.ts +3 -0
  31. package/build/src/registry/coreComponents.d.ts +3 -0
  32. package/build/src/registry/ext-component-list.d.ts +36 -19
  33. package/package.json +4 -4
  34. package/build/898.bundle.js +0 -2
  35. package/build/898.bundle.js.map +0 -1
@@ -0,0 +1,194 @@
1
+ "use strict";(self.webpackChunkReactCore=self.webpackChunkReactCore||[]).push([[706],{9706:(e,t,n)=>{n.r(t),n.d(t,{DisplayForm:()=>r,EditorsPortal:()=>Fe,Empty:()=>c,TwoColLayout:()=>E,WidgetList:()=>Q,WidgetWrapperCore:()=>V});var i=n(7363),l=n.n(i),o=n(3230),a=n(7375);const r=i.forwardRef(((e,t)=>{const n=i.useRef(null),[l,r]=(0,a.GF)(e.fields,e.type),{handleSubmit:c,control:s,reset:d}=(0,o.useForm)({defaultValues:Object.assign(Object.assign({},r),e.defaultValues),criteriaMode:"all"});return i.useImperativeHandle(t,(()=>({reset:()=>{var e;null===(e=null==n?void 0:n.current)||void 0===e||e.scrollTo(0,0),d()}})),[]),i.createElement("form",{onSubmit:c(e.onSubmit),ref:n},l.map((t=>{var{Input:n}=t,l=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}(t,["Input"]);return i.createElement(n,Object.assign({key:l.name,control:s},l,{dataCy:`${e.dataCy}-${l.name}`}))})),e.extraInputs&&e.extraInputs(s),e.buttons)})),c=()=>i.createElement(i.Fragment,null);var s=n(2248),d=n(5181),u=n(5550);const m=u.default.registry.getLazyComponent("Container"),g=u.default.registry.getLazyComponent("AppColumn"),p=u.default.registry.getLazyComponent("MainColumn");function E({extensionRoute:e,routes:t,description:n,mode:l="center"}){var o;const a=(0,d.useIntl)(),{pathname:r}=(0,s.useLocation)(),c=Object.values(t),[u,E]=i.useState(null===(o=null==c?void 0:c[0])||void 0===o?void 0:o.key),f=c.map((t=>Object.assign(Object.assign({},t),{label:a.formatMessage({id:t.label}),href:`/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&&E(t.key)}),[r]),i.createElement(i.Suspense,{fallback:i.createElement(i.Fragment,null)},i.createElement(m,{mode:l},i.createElement(g,{mode:l,description:n,tabs:f,activeTab:u||""}),i.createElement(p,{mode:l},i.createElement(s.Outlet,null))))}var f=n(855),y=n(1773);const v=u.default.registry.getLazyComponent("Loader"),w=({name:e,uniqid:t,inplace:n})=>{const i=(0,f.useSelector)((e=>y.$L.selectors.selectWidgetState(e,t))),o=y.$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(v,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}))},h=u.default.registry.getLazyComponent("WidgetArticleButton"),C=u.default.registry.getLazyComponent("WidgetArticleGallery"),b=u.default.registry.getLazyComponent("WidgetArticleAttachment"),x=u.default.registry.getLazyComponent("WidgetArticleImage"),L=u.default.registry.getLazyComponent("WidgetArticleTitle"),q=u.default.registry.getLazyComponent("WidgetArticleText"),T=({widget:e,width:t,inplace:n=!1,isComponentVisible:i=!1,mode:o="view",onClick:a})=>{const r=(0,f.useDispatch)(),{name:c,uniqid:s}=e,d=(0,f.useSelector)(y.$L.selectors.selectToken),u=(e,t)=>r(y.$L.slice.actions.updateWidget({uniqid:s,content:e,override:t})),m=e=>r(y.$L.slice.actions.setWidgetState(Object.assign({uniqid:s},e)));switch(c){default:return l().createElement(l().Fragment,null,"cannot display widget (",c,")");case y.$L.const.WIDGET_ARTICLE_BUTTON:return l().createElement(h,{isComponentVisible:i,content:e.content,inplace:n,mode:o,onChange:u,onClick:a,onStateChange:m});case y.$L.const.WIDGET_ARTICLE_GALLERY:return l().createElement(C,{width:t,token:d,isComponentVisible:i,content:e.content,inplace:n,mode:o,onChange:u,onStateChange:m});case y.$L.const.WIDGET_ARTICLE_ATTACHMENT:return l().createElement(b,{token:d,content:e.content,isComponentVisible:i,inplace:n,mode:o,onChange:u,onStateChange:m});case y.$L.const.WIDGET_ARTICLE_IMAGE:return l().createElement(x,{width:null!=t?t:800,token:d,content:e.content,isComponentVisible:i,inplace:n,mode:o,onChange:u,onClick:a,onStateChange:m});case y.$L.const.WIDGET_ARTICLE_TITLE:return l().createElement(L,{isComponentVisible:i,content:e.content,inplace:n,mode:o,onChange:u,onStateChange:m});case y.$L.const.WIDGET_ARTICLE_TEXT:return l().createElement(q,{content:e.content,isComponentVisible:i,inplace:n,mode:o,onChange:u,onStateChange:m})}};var W=n(3904),I=n(6754),$=n.n(I);const k={"widget-article-image":{accept:"image/png, image/jpeg, image/jpg",multiple:!1,label:"WIDGET_Article_Image_Empty_Label",description:"WIDGET_Article_Image_Empty_Description"},"widget-article-gallery":{accept:"image/png, image/jpeg, image/jpg",multiple:!0,label:"WIDGET_Article_Gallery_Empty_Label",description:"WIDGET_Article_Attachment_Empty_Description"},"widget-article-attachment":{accept:"*",multiple:!0,label:"WIDGET_Article_Attachment_Empty_Label",description:"WIDGET_Article_Attachment_Empty_Description"}};var S=n(6),_=n(997);const A=u.default.registry.getLazyComponent("DEPRECATEDFormInputFile"),D=({uniqid:e,initialFiles:t,accept:n,label:i,description:o,multiple:a,token:r,allowAutoOpening:c,onChange:s})=>{const d=(0,f.useDispatch)(),u=(0,f.useSelector)((t=>t.widgets.currentEditableWidgetId===e),f.shallowEqual),m=l().useRef(null),[g,p]=l().useState(0),[E,v]=l().useState(0),[w,h]=l().useState(null!=t?t:[]);return l().useEffect((()=>{g===E&&d(y.$L.slice.actions.setWidgetState({uniqid:e,loading:!1}))}),[g]),l().useEffect((()=>{s(w.map((e=>e)))}),[w]),l().useEffect((()=>{var t;u&&c&&(null===(t=m.current)||void 0===t||t.click(),d(y.$L.slice.actions.setWidgetState({uniqid:e,mounted:!0})))}),[u]),l().createElement(l().Fragment,null,l().createElement(_.JRCWidgetEmptyInplace,{url:"widget-article-image-placeholder.png",label:i,description:o,onClick:()=>{var e;u&&(null===(e=m.current)||void 0===e||e.click())}}),l().createElement("div",{style:{height:0,width:0,overflow:"hidden"}},l().createElement(A,{ref:m,id:"widget-upload-file",name:"editorFiles",content:"",accept:n,multiple:a,token:r,onUploadStart:t=>{void 0!==t&&v((e=>e+t)),d(y.$L.slice.actions.setWidgetState({uniqid:e,loading:!0}))},onUploadSuccess:t=>{p((e=>e+1)),void 0!==t&&h((e=>[...e,(0,S.apiFileToWidgetFile)(t)])),a||d(y.$L.slice.actions.setWidgetState({uniqid:e,loading:!1}))}})))},F=$().div`
2
+ position: relative;
3
+ inset: 0;
4
+ display: flex;
5
+ flex: 1;
6
+ min-height: 180px;
7
+ `,R=({uniqid:e,mode:t})=>{var n;const i=(0,f.useDispatch)(),o=(0,f.useSelector)((t=>y.$L.selectors.selectWidget(t,e))),a=(0,f.useSelector)((t=>t.widgets.currentEditableWidgetId===e),f.shallowEqual),r=(0,f.useSelector)(y.$L.selectors.selectToken);if(l().useEffect((()=>{a&&(null==o?void 0:o.widget.name)&&(i(y.Wq.slice.actions.flushAllEditor()),i(y.Wq.slice.actions.registerEditor({uniqid:e,name:null==o?void 0:o.widget.name})))}),[a]),void 0===o)return l().createElement(l().Fragment,null);const c=k&&k[null==o?void 0:o.widget.name]?k[null==o?void 0:o.widget.name].label:"",s=k&&k[null==o?void 0:o.widget.name]?k[null==o?void 0:o.widget.name].description:"",d=k&&k[null==o?void 0:o.widget.name]?k[null==o?void 0:o.widget.name].accept:"",u=!(!k||!k[null==o?void 0:o.widget.name])&&k[null==o?void 0:o.widget.name].multiple;switch(null==o?void 0:o.widget.name){case"widget-article-gallery":const a=o.widget.content.files;return void 0!==r&&"edit"===t?l().createElement("div",{style:{marginTop:(null==a?void 0:a.length)?24:0}},l().createElement(F,null,l().createElement(D,{label:c,description:s,initialFiles:[],accept:d,multiple:u,uniqid:e,token:r,allowAutoOpening:!(null==a?void 0:a.length),onChange:t=>{Array.isArray(t)&&t.forEach((t=>{i(y.$L.slice.actions.updateWidget({uniqid:e,content:{files:a?[...a,t]:[t]}}))}))}}))):l().createElement(l().Fragment,null);case"widget-article-attachment":const m=o.widget.content.files;return void 0!==r&&"edit"===t?l().createElement("div",{style:{marginTop:(null==m?void 0:m.length)?24:0}},l().createElement(F,null,l().createElement(D,{label:c,description:s,initialFiles:null!=m?m:[],accept:d,multiple:u,uniqid:e,token:r,allowAutoOpening:!(null==m?void 0:m.length),onChange:t=>{Array.isArray(t)&&t.forEach((t=>{i(y.$L.slice.actions.updateWidget({uniqid:e,content:{files:m?[...m,t]:[t]}}))}))}}))):l().createElement(l().Fragment,null);case"widget-article-image":return void 0===r||"edit"!==t||o.widget.content.file?l().createElement("div",{style:{position:"absolute",inset:0},onClick:()=>{i(y.Wq.slice.actions.flushAllEditor()),i(y.Wq.slice.actions.registerEditor({uniqid:e,name:null==o?void 0:o.widget.name}))}}):l().createElement(l().Fragment,null,l().createElement(F,null,l().createElement(D,{label:c,description:s,initialFiles:null!==(n=o.widget.content.file)&&void 0!==n?n:[],accept:d,multiple:!1,uniqid:e,token:r,allowAutoOpening:!o.widget.content.file,onChange:t=>{t&&t[0]&&i(y.$L.slice.actions.updateWidget({uniqid:e,content:{file:t[0]}}))}})))}return l().createElement(l().Fragment,null)},G=$().div`
8
+ position: absolute;
9
+ inset: 0;
10
+ opacity: ${e=>e.opacity};
11
+ background-color: ${e=>e.backgroundColor};
12
+ pointer-events: ${e=>e.pointerEvents};
13
+ `,O=({uniqid:e,mode:t})=>{const n=(0,f.useSelector)((t=>t.widgets.ids[e].widget.layers),f.shallowEqual);return l().createElement(l().Fragment,null,null==n?void 0:n.map(((e,t)=>l().createElement(j,{uniqid:e,key:t,mode:"edit"}))))},j=({uniqid:e,mode:t})=>{const n=(0,f.useSelector)((t=>t.widgets.layers[e]));return"view"===t?l().createElement(G,{opacity:1,backgroundColor:"transparent",pointerEvents:"none"},n.widgets.map(((e,t)=>l().createElement(z,{key:t,layerId:n.uniqid,uniqid:e.widget.uniqid,mode:"view"})))):l().createElement(G,{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(z,{key:t,layerId:n.uniqid,uniqid:e.widget.uniqid,mode:"edit"}))))},z=({uniqid:e,layerId:t,mode:n})=>{const i=(0,f.useDispatch)(),o=(0,f.useSelector)((t=>t.widgets.ids[e]),f.shallowEqual),a=(0,f.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(B,{uniqid:e,widget:o,mode:n,inplace:!0})):l().createElement(M,{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(y.$L.slice.actions.updateLayer({uniqid:t,props:{position:e}}))})(e)}},l().createElement(_.BETA_JRCDoubleClick,{onDoubleTap:()=>((e,t)=>{i(y.Wq.slice.actions.registerEditor({uniqid:e,name:t}))})(o.widget.uniqid,o.widget.name)},l().createElement(B,{uniqid:e,widget:o,mode:n,inplace:!0}))):l().createElement(l().Fragment,null)},M=({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)},V=({uniqid:e,widget:t,inplace:n=!0,mode:i,width:o})=>{const a=(0,f.useDispatch)(),r=(0,f.useSelector)((t=>y.$L.selectors.selectWidget(t,e))),c=(0,f.useSelector)((t=>{var n;return null===(n=y.$L.selectors.selectWidgetState(t,e))||void 0===n?void 0:n.busy}),f.shallowEqual),s=(0,f.useSelector)((t=>t.widgets.editableMap[e]),f.shallowEqual),d=(0,f.useSelector)((e=>e.widgets.currentEditableWidgetId),f.shallowEqual),u=(0,f.useSelector)((t=>t.widgets.currentEditableWidgetId===e),f.shallowEqual),{ref:m,isComponentVisible:g,setIsComponentVisible:p}=(0,W.I)(!1);if(l().useEffect((()=>{t&&a(y.$L.slice.actions.registerWidget({uniqid:e,widget:t}))}),[]),l().useEffect((()=>{g||e===d&&a(y.$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?v():"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)},v=()=>{if("view"===i)return;const{widget:e}=r;a(y.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(y.$L.slice.actions.setEditableIndex({index:s.index})),a(y.$L.slice.actions.setEditableWidgetId({uniqid:e})))}},l().createElement(T,{width:o,widget:r.widget,inplace:n,isComponentVisible:!!(g||c||u),mode:i,onClick:E}),l().createElement(R,{uniqid:e,mode:i}),l().createElement(O,{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:v},l().createElement(T,{widget:r.widget,isComponentVisible:!1,inplace:n,mode:i,width:o,onClick:E}),l().createElement(O,{uniqid:e,mode:i}),l().createElement(w,{name:r.widget.name,uniqid:r.widget.uniqid,inplace:n}))},B=V,J=$().div`
14
+ display: flex;
15
+ flex-direction: row;
16
+ flex-wrap: wrap;
17
+ gap: 10px;
18
+ justify-content: center;
19
+ `,N=$().div`
20
+ border: 1px solid ${e=>e.theme.color.grey2};
21
+ border-radius: 8px;
22
+ cursor: pointer;
23
+ padding: 12px;
24
+ position: relative;
25
+ opacity: ${e=>e.available?"1":".4"};
26
+ pointer-events: ${e=>e.available?"all":"none"};
27
+
28
+ .show-on-hover {
29
+ position: absolute;
30
+ inset: 0;
31
+ border-radius: 8px;
32
+ justify-content: center;
33
+ align-items: center;
34
+ display: flex;
35
+ opacity: 0;
36
+ background-color: #ffffffe6;
37
+ }
38
+
39
+ &:hover {
40
+ .show-on-hover {
41
+ opacity: 1;
42
+ }
43
+ }
44
+ `,P=$().div`
45
+ border: 2px solid ${e=>e.theme.color.primary};
46
+ height: ${e=>e.open?"320":"54"}px;
47
+ border-radius: 8px;
48
+ display: flex;
49
+ justify-content: top;
50
+ flex-direction: column;
51
+ transition: height 0.4s;
52
+ overflow: hidden;
53
+ flex-direction: column;
54
+ `,U=$().div`
55
+ display: flex;
56
+ flex-direction: row;
57
+ flex-wrap: wrap;
58
+ justify-content: center;
59
+ gap: 10px;
60
+ `,H=$().div`
61
+ min-height: 50px;
62
+ display: flex;
63
+ justify-content: center;
64
+ align-items: center;
65
+ cursor: pointer;
66
+ color: ${e=>e.theme.color.primary};
67
+ `,X=$().button`
68
+ height: 72px;
69
+ display: flex;
70
+ justify-content: center;
71
+ align-items: center;
72
+ width: 40%;
73
+ border: 1px solid ${e=>e.theme.color.grey2};
74
+ border-radius: 8px;
75
+ transition: opacity 0.4s ease ${e=>40*e.index}ms;
76
+ opacity: ${e=>e.open?1:0};
77
+ `,Y=u.default.registry.getLazyComponent("Button"),K=u.default.registry.getLazyComponent("Modal"),Q=({mode:e,children:t,namespace:n="default",onChange:i})=>{const[o,a]=l().useState(!1),r=function(e){return"widget-article-image"===e?[y.$L.definition(y.$L.const.WIDGET_ARTICLE_TITLE),y.$L.definition(y.$L.const.WIDGET_ARTICLE_BUTTON)]:[y.$L.definition(y.$L.const.WIDGET_ARTICLE_TITLE),y.$L.definition(y.$L.const.WIDGET_ARTICLE_TEXT),y.$L.definition(y.$L.const.WIDGET_ARTICLE_IMAGE),y.$L.definition(y.$L.const.WIDGET_ARTICLE_BUTTON),y.$L.definition(y.$L.const.WIDGET_ARTICLE_GALLERY),y.$L.definition(y.$L.const.WIDGET_ARTICLE_ATTACHMENT)]}(n),c=(0,d.useIntl)(),s={open:o,title:"widget builder",showIconClose:!0,portalId:"react-modal",isFullHeight:!0,closeHandler:()=>a(!1)},u=e=>{i(y.$L.factory(e)),a(!1)};return l().createElement(l().Fragment,null,l().createElement(K,Object.assign({},s),l().createElement(J,null,r.map(((e,t)=>l().createElement(N,{key:t,onClick:()=>u(e.name),available:e.available},l().createElement("img",{src:e.img}),l().createElement("div",{className:"show-on-hover"},c.formatMessage({id:e.label}))))))),"custom"===e&&t?l().createElement("div",{onClick:()=>a(!0)},t):l().createElement(l().Fragment,null),"button"===e?l().createElement(Y,{onClick:()=>a(!0),variant:"outlined",minWidth:"100%"},c.formatMessage({id:"WIDGET_Add_Widget"})):l().createElement(l().Fragment,null),"gallery"===e?l().createElement(J,null,r.map(((e,t)=>l().createElement(N,{key:t,onClick:()=>u(e.name),available:e.available},l().createElement("img",{src:e.img}),l().createElement("div",{className:"show-on-hover"},c.formatMessage({id:e.label})))))):l().createElement(l().Fragment,null),"article"===e?l().createElement(Z,{widgets:r,onClick:u}):l().createElement(l().Fragment,null))},Z=({widgets:e,onClick:t})=>{const[n,i]=l().useState(!1),o=(0,d.useIntl)();return l().createElement(l().Fragment,null,l().createElement(P,{open:n},l().createElement(H,{onClick:()=>i(!n)},o.formatMessage({id:"WIDGET_Add_Widget"})),l().createElement(U,null,e.map(((e,i)=>l().createElement(X,{key:e.name,open:n,index:i,onClick:()=>t(e.name)},o.formatMessage({id:e.label})))))))},ee=($().div`
78
+ margin-bottom: 24px;
79
+ `,$().div`
80
+ margin-bottom: 4px;
81
+ `,$().div`
82
+ position: absolute;
83
+ background-color: ${e=>e.on?"rgba(0,0,0,.1)":"transparent"};
84
+ inset: 0;
85
+ pointer-events: ${e=>e.on?"all":"none"};
86
+ flex: 1;
87
+ display: flex;
88
+ overflow: hidden;
89
+ `),te=$().div`
90
+ flex-direction: row;
91
+ display: flex;
92
+ min-height: 60px;
93
+ border-bottom: 1px solid ${e=>e.theme.color.grey2};
94
+ `,ne=$().div`
95
+ width: 60px;
96
+ display: flex;
97
+ align-items: center;
98
+ justify-content: center;
99
+ `,ie=$().div`
100
+ flex: 1;
101
+ display: flex;
102
+ align-items: center;
103
+ justify-content: center;
104
+ `,le=$().div`
105
+ position: absolute;
106
+ top: 90px;
107
+ right: ${e=>e.visible?"0":"-1000"}px;
108
+ width: ${440}px;
109
+ bottom: 0;
110
+ display: flex;
111
+ background-color: ${e=>e.theme.color.white};
112
+ flex-direction: row;
113
+ transition: all 0.4s;
114
+ box-shadow: -1px 1px 10px 0px rgb(0 0 0 / 20%);
115
+ `,oe=$().div`
116
+ flex: 1;
117
+ display: flex;
118
+ flex-direction: row;
119
+ padding: 12px;
120
+ overflow: auto;
121
+ `,ae=$().div`
122
+ width: ${50}px;
123
+ padding-top: 60px;
124
+ display: flex;
125
+ flex-direction: column;
126
+ border-right: 1px solid ${e=>e.theme.color.grey2};
127
+ `,re=$().button`
128
+ border-radius: 4px;
129
+ cursor: pointer;
130
+ height: 42px;
131
+ margin: 4px;
132
+ width: 42px;
133
+ display: flex;
134
+ align-items: center;
135
+ justify-content: center;
136
+ background-color: ${e=>e.on?e.theme.color.grey1:e.theme.color.white};
137
+ &:hover {
138
+ background-color: ${e=>e.theme.color.grey1};
139
+ }
140
+ `,ce=($().div`
141
+ display: flex;
142
+ border: 1px solid ${e=>e.theme.color.grey1};
143
+ border-radius: ${8}px;
144
+ margin-bottom: 24px;
145
+ input {
146
+ width: 100%;
147
+ border: 0;
148
+ height: ${50}px;
149
+ margin: 0;
150
+ }
151
+ `,$().div`
152
+ display: flex;
153
+ flex-direction: row;
154
+ padding: 12px;
155
+ background-color: ${e=>e.theme.color.grey0};
156
+ border-radius: 8px;
157
+ margin-bottom: 4px;
158
+ `),se=$().div`
159
+ display: flex;
160
+ flex: 1;
161
+ align-items: center;
162
+ `,de=$().div`
163
+ width: 40px;
164
+ display: flex;
165
+ justify-content: center;
166
+ align-items: center;
167
+ `,ue=($().div`
168
+ flex-direction: row;
169
+ display: flex;
170
+ align-items: center;
171
+ `,$().div`
172
+ flex: 1;
173
+ display: flex;
174
+ align-items: center;
175
+ `,({uniqid:e})=>{const t=(0,f.useDispatch)(),n=(0,f.useSelector)((t=>y.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(te,null,l().createElement(ne,null),l().createElement(ie,null,"Popup"),l().createElement(ne,null,l().createElement(re,{onClick:()=>{t(y.Wq.slice.actions.flushEditorPopup({uniqid:e}))}},l().createElement(_.JRCIcon,{name:"icon-times",color:"grey2"})))),l().createElement("div",{style:{flex:1,display:"flex"}},n.view),l().createElement(te,null,l().createElement(_.JRCButton,{onClick:()=>{t(y.Wq.slice.actions.flushEditorPopup({uniqid:e}))}},"Save"))):l().createElement(l().Fragment,null)}),me=u.default.registry.getLazyComponent("WidgetArticleTitleEditor"),ge=u.default.registry.getLazyComponent("WidgetArticleImageEditor"),pe=u.default.registry.getLazyComponent("WidgetArticleTextEditor"),Ee=u.default.registry.getLazyComponent("WidgetArticleGalleryEditor"),fe=u.default.registry.getLazyComponent("WidgetArticleButtonEditor"),ye=u.default.registry.getLazyComponent("WidgetArticleAttachmentEditor"),ve=({uniqid:e})=>{const t=(0,f.useDispatch)(),n=(0,f.useSelector)(y.$L.selectors.selectToken),i=(0,f.useSelector)((t=>y.$L.selectors.selectWidget(t,e))),o=n=>{i&&t(y.$L.slice.actions.updateWidget({uniqid:e,content:n})),t(y.Wq.slice.actions.flushEditor({uniqid:e}))},a=(n,i)=>t(y.$L.slice.actions.updateWidget({uniqid:e,content:n,override:i})),r=(n,i)=>{t(void 0!==i?y.$L.slice.actions.setWidgetState(Object.assign({uniqid:i},n)):y.$L.slice.actions.setWidgetState(Object.assign({uniqid:e},n)))},c=n=>{t(y.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 y.$L.const.WIDGET_ARTICLE_BUTTON:return l().createElement(fe,{content:i.widget.content,onChange:a,onSave:o,onStateChange:r});case y.$L.const.WIDGET_ARTICLE_ATTACHMENT:return l().createElement(ye,{token:n,content:i.widget.content,onChange:a,onSave:o,onStateChange:r,onOpen:c});case y.$L.const.WIDGET_ARTICLE_GALLERY:return l().createElement(Ee,{token:n,content:i.widget.content,onChange:a,onSave:o,onStateChange:r});case y.$L.const.WIDGET_ARTICLE_TEXT:return l().createElement(pe,{onChange:a,onSave:o,content:i.widget.content});case y.$L.const.WIDGET_ARTICLE_IMAGE:return l().createElement(ge,{content:i.widget.content,token:n,onChange:a,onSave:o,onStateChange:r});case y.$L.const.WIDGET_ARTICLE_TITLE:return l().createElement(me,{onChange:a,onSave:o,content:i.widget.content,onOpen:c})}},we=({uniqid:e})=>{const t=(0,f.useDispatch)(),n=(0,d.useIntl)(),i=(0,f.useSelector)((t=>y.$L.selectors.selectWidgetContent(t,e)));return l().createElement("div",{style:{flex:1}},l().createElement(he,{uniqid:e}),i&&i.widgets?i.widgets.map(((o,a)=>{const r=y.$L.definition(o.widget.name);return l().createElement("div",{key:a},l().createElement(ce,null,l().createElement(se,{onClick:()=>((e,n)=>{t(y.Wq.slice.actions.registerEditor({uniqid:e,name:n}))})(o.widget.uniqid,o.widget.name)},n.formatMessage({id:r.label})),l().createElement(de,{onClick:()=>{i.widgets&&t(y.$L.slice.actions.updateWidget({uniqid:e,content:Object.assign(Object.assign({},i),{widgets:[...i.widgets.filter(((e,t)=>t!==a))]})}))}},l().createElement(_.JRCIcon,{name:"icon-trash"}))))})):l().createElement(l().Fragment,null))},he=({uniqid:e})=>{const t=(0,f.useDispatch)(),n=(0,f.useSelector)((t=>t.widgets.ids[e].widget.layers),f.shallowEqual);return l().createElement(l().Fragment,null,l().createElement(_.BETA_JRCDragAndDrop,{onDrag:()=>{},renderEl:(e,t)=>l().createElement(Le,{uniqid:e,key:t}),elms:n||[]}),l().createElement(Q,{namespace:"default",onChange:n=>{t(y.$L.slice.actions.registerLayer({uniqid:e,widget:n}))},mode:"button"}))},Ce=({uniqid:e})=>{const t=(0,f.useDispatch)(),n=(0,f.useSelector)((t=>t.widgets.layers[e]));return l().createElement("div",{onClick:()=>{t(y.$L.slice.actions.updateLayer({uniqid:e,props:{locked:!n.locked}}))}},l().createElement(_.JRCIcon,{name:n.locked?"icon-lock":"icon-unlock"}))},be=({uniqid:e})=>{const t=(0,f.useDispatch)(),n=(0,f.useSelector)((t=>t.widgets.layers[e]));return l().createElement("div",{onClick:()=>{t(y.$L.slice.actions.updateLayer({uniqid:e,props:{visible:!n.visible}}))}},l().createElement(_.JRCIcon,{name:n.visible?"icon-eye":"icon-eye-slash"}))},xe=({uniqid:e,layerId:t})=>{const n=(0,f.useDispatch)();return l().createElement("div",{onClick:()=>{n(y.$L.slice.actions.flushLayer({uniqid:e,layerId:t}))}},l().createElement(_.JRCIcon,{name:"icon-trash"}))},Le=({uniqid:e})=>{const t=(0,f.useSelector)((t=>t.widgets.layers[e]));return l().createElement(l().Fragment,null,t.title,t.widgets.map(((n,i)=>{const o=y.$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(Ce,{uniqid:e}),l().createElement(be,{uniqid:e}),l().createElement(xe,{uniqid:n.widget.uniqid,layerId:t.uniqid}))})))},qe=u.default.registry.getLazyComponent("Button"),Te=({uniqid:e})=>{const t=(0,d.useIntl)(),n=(0,f.useDispatch)(),i=(0,f.useSelector)((t=>y.$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(_.JRCInputText,{name:"text",control:c,placeholder:t.formatMessage({id:"EDITOR_Widget_Wrapper_Title"})}),l().createElement(qe,{onClick:()=>{void 0!==a&&(n(y.$L.slice.actions.updateWidgetWrapper({uniqid:e,title:a})),n(y.Wq.slice.actions.flushEditor({uniqid:e})))},variant:"outlined",minWidth:"100%"},t.formatMessage({id:"EDITOR_Save_Widget"}))):l().createElement(l().Fragment,null,"No wrapper")},We=u.default.registry.getLazyComponent("Icon"),Ie=({uniqid:e})=>{const t=(0,d.useIntl)(),n=(0,f.useDispatch)(),i=(0,f.useSelector)((t=>y.Wq.selectors.selectEditor(t,e))),o=y.$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(le,{visible:a},l().createElement(ae,null,o.panel.useWrapper?l().createElement(re,{on:"wrapper"===c,onClick:()=>s("wrapper")},l().createElement(We,{name:"icon-font",color:"grey2"})):l().createElement(l().Fragment,null),o.panel.useEditor?l().createElement(re,{on:"default"===c,onClick:()=>s("default")},l().createElement(We,{name:"icon-pen",color:"grey2"})):l().createElement(l().Fragment,null),o.panel.useWidgets?l().createElement(ke,{uniqid:e},l().createElement(re,{on:"widgets"===c,onClick:()=>s("widgets")},l().createElement(We,{name:"icon-sliders",color:"grey2"}))):l().createElement(l().Fragment,null)),l().createElement("div",{style:{flex:1,display:"flex",flexDirection:"column"}},l().createElement(te,null,l().createElement($e,{uniqid:e,position:i.position}),l().createElement(ie,null,t.formatMessage({id:o.label})),l().createElement(ne,null,l().createElement(re,{onClick:()=>{n(y.Wq.slice.actions.flushEditor({uniqid:e}))}},l().createElement(We,{name:"icon-times",color:"grey2"})))),l().createElement(oe,null,"default"===c&&o.panel.useEditor?l().createElement(ve,{uniqid:i.uniqid}):l().createElement(l().Fragment,null),"wrapper"===c&&o.panel.useWrapper?l().createElement(Te,{uniqid:i.uniqid}):l().createElement(l().Fragment,null),"widgets"===c&&o.panel.useWidgets?l().createElement(we,{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)},$e=({uniqid:e,position:t})=>{const n=(0,f.useDispatch)();return l().createElement(ne,null,l().createElement(re,{onClick:()=>{n(y.Wq.slice.actions.setEditorPosition({uniqid:e,position:"left"===t?"right":"left"}))}},l().createElement(We,{name:"left"===t?"icon-angle-right":"icon-angle-left",color:"grey2"})))},ke=({uniqid:e,children:t})=>{const n=(0,f.useSelector)((t=>y.$L.selectors.selectWidgetState(t,e)));return(null==n?void 0:n.initialized)?t:l().createElement(l().Fragment,null)},Se=$().div`
176
+ position: absolute;
177
+ inset: 0;
178
+ pointer-events: none;
179
+ z-index: 100;
180
+ `,_e=$().div`
181
+ flex: 1;
182
+ display: flex;
183
+ margintop: ${90}px;
184
+ pointer-events: ${e=>e.on?"all":"none"};
185
+ `,Ae=$().div`
186
+ flex: 1;
187
+ display: flex;
188
+ flex-direction: row;
189
+ pointer-events: none;
190
+ `,De=$().div`
191
+ width: ${440}px;
192
+ pointer-events: n;
193
+ `,Fe=()=>{const e=(0,f.useSelector)(y.Wq.selectors.selectEditors);return l().createElement(Se,null,e.map(((e,t)=>"left"===e.position?l().createElement(ee,{on:!1,key:t},l().createElement(Ae,null,l().createElement(Ie,{uniqid:e.uniqid}),l().createElement(_e,{on:void 0!==e.popup},l().createElement(ue,{uniqid:e.uniqid})),l().createElement(De,null))):l().createElement(ee,{on:!1,key:t},l().createElement(Ae,null,l().createElement(De,null),l().createElement(_e,{on:void 0!==e.popup},l().createElement(ue,{uniqid:e.uniqid})),l().createElement(Ie,{uniqid:e.uniqid}))))))}}}]);
194
+ //# sourceMappingURL=706.bundle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"706.bundle.js","mappings":"+QAmBO,MAAMA,EAAc,cAWzB,CAACC,EAAOC,KACN,MAAMC,EAAU,SAA8B,OAEvCC,EAAeC,IAAiB,EAAAC,EAAA,IAAeL,EAAMM,OAAQN,EAAMO,OAEpE,aAAEC,EAAY,QAAEC,EAAO,MAAEC,IAAU,IAAAC,SAAQ,CAC7CP,cAAe,OAAF,wBACNA,GACAJ,EAAMI,eAEbQ,aAAc,QAgBlB,OAbA,sBACIX,GACA,KAAM,CACFS,MAAO,K,MAEa,QAAhB,EAAAR,MAAAA,OAAO,EAAPA,EAASW,eAAO,SAAEC,SAAS,EAAG,GAE9BJ,QAGR,IAIA,wBAAMK,SAAUP,EAAaR,EAAMe,UAAWd,IAAKC,GAC9CC,EAAca,KAAK,I,IAAA,MAAEC,GAAK,EAAKC,E,yUAAI,GAAhB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Ae,CAACC,IAAI,EAAO3M,IAAK+H,GAC7B,kBAAC6I,GAAkB,KACf,kBAACC,GAAwB,MACzB,kBAACF,GAA2B,CAAChE,QAAqB5K,IAAjB2L,EAAOC,OACpC,kBAACF,GAAW,CAAClL,OAAQmL,EAAOnL,UAEhC,kBAACwN,GAAa,CAACxN,OAAQmL,EAAOnL","sources":["webpack://ReactCore/./src/displayer/DisplayForm.component.tsx","webpack://ReactCore/./src/displayer/Empty.tsx","webpack://ReactCore/./src/components/TwoColLayout.tsx","webpack://ReactCore/./src/components/widgets/WidgetState.tsx","webpack://ReactCore/./src/components/widgets/Widget.tsx","webpack://ReactCore/./src/components/widgets/const.ts","webpack://ReactCore/./src/components/widgets/WidgetInplace/WidgetInplaceUpload.tsx","webpack://ReactCore/./src/components/widgets/WidgetInplace/WidgetInplaceWrapper.tsx","webpack://ReactCore/./src/components/widgets/WidgetLayer/WidgetLayer.style.tsx","webpack://ReactCore/./src/components/widgets/WidgetLayer/WidgetLayer.tsx","webpack://ReactCore/./src/components/widgets/WidgetWrapperCore.tsx","webpack://ReactCore/./src/components/widgets/WidgetList/WidgetList.style.tsx","webpack://ReactCore/./src/components/widgets/WidgetList/WidgetList.tsx","webpack://ReactCore/./src/components/widgets/namespace.ts","webpack://ReactCore/./src/components/editors/style.tsx","webpack://ReactCore/./src/components/editors/const.ts","webpack://ReactCore/./src/components/editors/EditorPopup.tsx","webpack://ReactCore/./src/components/editors/Editor.tsx","webpack://ReactCore/./src/components/editors/EditorTabWidgets.tsx","webpack://ReactCore/./src/components/editors/EditorTabWrapper.tsx","webpack://ReactCore/./src/components/editors/EditorWrapper.tsx","webpack://ReactCore/./src/components/editors/EditorsPortal.tsx"],"sourcesContent":["import * as React from 'react';\nimport { DisplayFormRef, FieldsWithOptionalRender } from './types';\nimport { useForm, Control } from 'react-hook-form';\nimport { useDisplayForm } from './useDisplay';\n\n/****\n * The jamespot model depend on the platform\n * For example a user can have the size attribute only for a given platform\n * The model specifics of a platform are stored in J.model\n *\n * This component display an array of attributes only if this attribute is activated on the platform\n *\n * @param type form model type (sport, mpArticle, etc.)\n * @param fields an array of string : the list of attributes we want to display\n * @param defaultValues react hook form default values\n * @param onSubmit callback provided to react hook, called after successful validation\n * @param buttons the buttons, should always include a <button type=\"submit\">\n * Note :If we override the \"render\" you can't override \"wrapper\" and \"element\" because the render rewrite everything\n */\nexport const DisplayForm = React.forwardRef<\n DisplayFormRef,\n {\n type: string;\n fields: FieldsWithOptionalRender<any, any>;\n extraInputs?: (control: Control<any>) => React.ReactNode;\n defaultValues?: any;\n onSubmit: any;\n buttons: React.ReactNode;\n dataCy?: string;\n }\n>((props, ref) => {\n const formRef = React.useRef<HTMLFormElement>(null);\n\n const [configuration, defaultValues] = useDisplayForm(props.fields, props.type);\n\n const { handleSubmit, control, reset } = useForm({\n defaultValues: {\n ...defaultValues,\n ...props.defaultValues,\n },\n criteriaMode: 'all',\n });\n\n React.useImperativeHandle(\n ref,\n () => ({\n reset: () => {\n // in case the form is scrollable\n formRef?.current?.scrollTo(0, 0);\n // reset react-hook-form form\n reset();\n },\n }),\n [],\n );\n\n return (\n <form onSubmit={handleSubmit(props.onSubmit)} ref={formRef}>\n {configuration.map(({ Input, ...conf }) => (\n <Input key={conf.name} control={control} {...conf} dataCy={`${props.dataCy}-${conf.name}`} />\n ))}\n {props.extraInputs && props.extraInputs(control)}\n {props.buttons}\n </form>\n );\n});\n","import * as React from 'react';\n\n// FIXME move to j-react-components + display error if dev mode\nexport const Empty = () => <></>;\n","import * as React from 'react';\nimport { Outlet } from 'react-router-dom';\nimport { useIntl } from 'react-intl';\nimport type { JRCAppColumnProps } from 'jamespot-react-components';\nimport JRCore from 'App';\nimport { useLocation } from 'react-router-dom';\nimport { LayoutMode } from 'jamespot-react-components';\n\nconst Container = JRCore.registry.getLazyComponent('Container');\nconst AppColumn = JRCore.registry.getLazyComponent('AppColumn');\nconst MainColumn = JRCore.registry.getLazyComponent('MainColumn');\n\nexport type TwoColLayoutRoute = {\n path: string;\n key: string;\n icon: string;\n label: string;\n group?: string;\n};\n\nexport type TwoColLayoutRoutes = Record<string, TwoColLayoutRoute>;\n\nexport type TwoColLayoutProps = {\n extensionRoute: string;\n routes: TwoColLayoutRoutes;\n mode?: LayoutMode;\n description: JRCAppColumnProps['description'];\n};\n\nexport function TwoColLayout({ extensionRoute, routes, description, mode = 'center' }: TwoColLayoutProps) {\n const intl = useIntl();\n const { pathname } = useLocation();\n\n const ROUTES_ARRAY = Object.values(routes);\n const [activeTab, setActiveTab] = React.useState(ROUTES_ARRAY?.[0]?.key);\n\n const tabs = ROUTES_ARRAY.map((tab) => ({\n ...tab,\n label: intl.formatMessage({ id: tab.label }),\n href: `/ng/rr/${extensionRoute}/${tab.path}`,\n group: tab.group ? intl.formatMessage({ id: tab.group }) : undefined,\n }));\n\n React.useEffect(() => {\n const activeRoute = ROUTES_ARRAY.find((route) => pathname === `/ng/rr/${extensionRoute}/${route.path}`);\n if (activeRoute) setActiveTab(activeRoute.key);\n }, [pathname]);\n\n return (\n <React.Suspense fallback={<></>}>\n <Container mode={mode}>\n <AppColumn mode={mode} description={description} tabs={tabs} activeTab={activeTab || ''} />\n <MainColumn mode={mode}>\n <Outlet />\n </MainColumn>\n </Container>\n </React.Suspense>\n );\n}\n","import React from 'react';\nimport { useSelector } from 'react-redux';\n\nimport JRCore from 'App';\n\nconst JRCLoader = JRCore.registry.getLazyComponent('Loader');\n\nimport { WidgetKeys, WidgetsRootState } from 'jamespot-user-api';\nimport { Widget } from 'jamespot-front-business';\n\n/*\n Widget state\n*/\n\nexport const WidgetState = ({ name, uniqid, inplace }: { name: WidgetKeys; uniqid: string; inplace: boolean }) => {\n const state = useSelector((state: WidgetsRootState) => Widget.selectors.selectWidgetState(state, uniqid));\n const def = Widget.definition(name);\n\n if (state?.loading) {\n return (\n <div\n style={{\n position: 'absolute',\n inset: 0,\n backgroundColor: 'rgba(255,255,255,.7)',\n display: 'flex',\n flex: 1,\n justifyContent: 'center',\n alignItems: 'center',\n }}>\n <JRCLoader />\n </div>\n );\n }\n\n if (state?.hover) {\n return (\n <div\n style={{\n position: 'absolute',\n inset: 0,\n backgroundColor: 'rgba(255,255,255,.7)',\n display: 'flex',\n flex: 1,\n justifyContent: 'center',\n alignItems: 'center',\n }}></div>\n );\n }\n\n if (!state?.initialized && inplace) {\n return <></>;\n }\n\n if (!state?.initialized && !inplace) {\n return (\n <div\n style={{\n position: 'absolute',\n inset: 0,\n backgroundColor: 'rgba(255,255,255,1)',\n display: 'flex',\n flex: 1,\n justifyContent: 'center',\n alignItems: 'center',\n }}>\n <img src={def.img} />\n </div>\n );\n }\n\n return <></>;\n};\n","import React from 'react';\n\nimport { useDispatch, useSelector } from 'react-redux';\n\nimport { CombinedWidgetContent, CombinedWidgetType, WidgetDisplayMode, WidgetStateProps } from 'jamespot-user-api';\n\nimport JRCore from 'App';\nimport { Widget } from 'jamespot-front-business';\n\nconst JRCWidgetArticleButton = JRCore.registry.getLazyComponent('WidgetArticleButton');\nconst JRCWidgetArticleGallery = JRCore.registry.getLazyComponent('WidgetArticleGallery');\nconst JRCWidgetArticleAttachment = JRCore.registry.getLazyComponent('WidgetArticleAttachment');\nconst JRCWidgetArticleImage = JRCore.registry.getLazyComponent('WidgetArticleImage');\nconst JRCWidgetArticleTitle = JRCore.registry.getLazyComponent('WidgetArticleTitle');\nconst JRCWidgetArticleText = JRCore.registry.getLazyComponent('WidgetArticleText');\n/*\n Widget Factory (jamespot-react-core)\n*/\nexport const DisplayWidget = ({\n widget,\n width,\n inplace = false,\n isComponentVisible = false,\n mode = 'view',\n onClick,\n}: {\n widget: CombinedWidgetType;\n width?: number | undefined;\n inplace: boolean;\n isComponentVisible: boolean | undefined;\n mode: WidgetDisplayMode;\n onClick: () => void;\n}) => {\n const dispatch = useDispatch();\n const { name, uniqid } = widget;\n const token = useSelector(Widget.selectors.selectToken);\n\n const onChange = (content: CombinedWidgetContent, override?: boolean) =>\n dispatch(Widget.slice.actions.updateWidget({ uniqid, content, override }));\n\n const onStateChange = (states: WidgetStateProps) =>\n dispatch(Widget.slice.actions.setWidgetState({ uniqid, ...states }));\n\n switch (name) {\n default:\n return <>cannot display widget ({name})</>;\n case Widget.const.WIDGET_ARTICLE_BUTTON:\n return (\n <JRCWidgetArticleButton\n isComponentVisible={isComponentVisible}\n content={widget.content}\n inplace={inplace}\n mode={mode}\n onChange={onChange}\n onClick={onClick}\n onStateChange={onStateChange}\n />\n );\n case Widget.const.WIDGET_ARTICLE_GALLERY:\n return (\n <JRCWidgetArticleGallery\n width={width}\n token={token}\n isComponentVisible={isComponentVisible}\n content={widget.content}\n inplace={inplace}\n mode={mode}\n onChange={onChange}\n onStateChange={onStateChange}\n />\n );\n case Widget.const.WIDGET_ARTICLE_ATTACHMENT:\n return (\n <JRCWidgetArticleAttachment\n token={token}\n content={widget.content}\n isComponentVisible={isComponentVisible}\n inplace={inplace}\n mode={mode}\n onChange={onChange}\n onStateChange={onStateChange}\n />\n );\n case Widget.const.WIDGET_ARTICLE_IMAGE:\n return (\n <JRCWidgetArticleImage\n width={width ?? 800}\n token={token}\n content={widget.content}\n isComponentVisible={isComponentVisible}\n inplace={inplace}\n mode={mode}\n onChange={onChange}\n onClick={onClick}\n onStateChange={onStateChange}\n />\n );\n case Widget.const.WIDGET_ARTICLE_TITLE:\n return (\n <JRCWidgetArticleTitle\n isComponentVisible={isComponentVisible}\n content={widget.content}\n inplace={inplace}\n mode={mode}\n onChange={onChange}\n onStateChange={onStateChange}\n />\n );\n case Widget.const.WIDGET_ARTICLE_TEXT:\n return (\n <JRCWidgetArticleText\n content={widget.content}\n isComponentVisible={isComponentVisible}\n inplace={inplace}\n mode={mode}\n onChange={onChange}\n onStateChange={onStateChange}\n />\n );\n }\n};\n","export const Uploader: Record<string, { accept: string; label: string; description: string; multiple: boolean }> = {\n 'widget-article-image': {\n accept: 'image/png, image/jpeg, image/jpg',\n multiple: false,\n label: 'WIDGET_Article_Image_Empty_Label',\n description: 'WIDGET_Article_Image_Empty_Description',\n },\n 'widget-article-gallery': {\n accept: 'image/png, image/jpeg, image/jpg',\n multiple: true,\n label: 'WIDGET_Article_Gallery_Empty_Label',\n description: 'WIDGET_Article_Attachment_Empty_Description',\n },\n 'widget-article-attachment': {\n accept: '*',\n multiple: true,\n label: 'WIDGET_Article_Attachment_Empty_Label',\n description: 'WIDGET_Article_Attachment_Empty_Description',\n },\n};\n","import React from 'react';\nimport { shallowEqual, useDispatch, useSelector } from 'react-redux';\n\nimport JRCore from 'App';\nconst JRCFormFile = JRCore.registry.getLazyComponent('DEPRECATEDFormInputFile');\n\nimport { apiFileToWidgetFile, FileResponse, WidgetFileType, WidgetsRootState } from 'jamespot-user-api';\nimport { Widget } from 'jamespot-front-business';\n\nimport { JRCWidgetEmptyInplace } from 'jamespot-react-components';\n\ntype WidgetInplaceUploadProps = {\n uniqid: string;\n initialFiles: WidgetFileType[];\n accept: string;\n label: string;\n description: string;\n multiple: boolean;\n token: string;\n allowAutoOpening: boolean;\n onChange: (files: WidgetFileType[]) => void;\n};\n\nexport const WidgetInplaceUpload = ({\n uniqid,\n initialFiles,\n accept,\n label,\n description,\n multiple,\n token,\n allowAutoOpening,\n onChange,\n}: WidgetInplaceUploadProps) => {\n const dispatch = useDispatch();\n const isActive = useSelector(\n (state: WidgetsRootState) => state.widgets.currentEditableWidgetId === uniqid,\n shallowEqual,\n );\n const uploadRef = React.useRef<HTMLInputElement>(null);\n const [fileUploadStep, setFileUploadStep] = React.useState<number>(0);\n const [fileCount, setFileCount] = React.useState<number>(0);\n const [fileResponses, setFileResponses] = React.useState<WidgetFileType[]>(initialFiles ?? []);\n\n const onUploadStart = () => {\n dispatch(Widget.slice.actions.setWidgetState({ uniqid, loading: true }));\n };\n\n React.useEffect(() => {\n if (fileUploadStep === fileCount) {\n dispatch(Widget.slice.actions.setWidgetState({ uniqid, loading: false }));\n }\n }, [fileUploadStep]);\n\n React.useEffect(() => {\n onChange(fileResponses.map((fileResponse) => fileResponse));\n }, [fileResponses]);\n\n React.useEffect(() => {\n if (isActive && allowAutoOpening) {\n uploadRef.current?.click();\n dispatch(Widget.slice.actions.setWidgetState({ uniqid, mounted: true }));\n }\n }, [isActive]);\n\n return (\n <>\n <JRCWidgetEmptyInplace\n url={'widget-article-image-placeholder.png'}\n label={label}\n description={description}\n onClick={() => {\n if (isActive) {\n uploadRef.current?.click();\n }\n }}\n />\n <div style={{ height: 0, width: 0, overflow: 'hidden' }}>\n <JRCFormFile\n ref={uploadRef}\n id=\"widget-upload-file\"\n name=\"editorFiles\"\n content={''}\n accept={accept as any}\n multiple={multiple}\n token={token}\n onUploadStart={(count) => {\n if (count !== undefined) {\n setFileCount((prevCount) => prevCount + count);\n }\n onUploadStart();\n }}\n onUploadSuccess={(fileResponse: FileResponse | undefined) => {\n setFileUploadStep((prevStep) => prevStep + 1);\n if (fileResponse !== undefined) {\n setFileResponses((prevFileResponses) => [\n ...prevFileResponses,\n apiFileToWidgetFile(fileResponse),\n ]);\n }\n if (!multiple) {\n dispatch(Widget.slice.actions.setWidgetState({ uniqid, loading: false }));\n }\n }}\n />\n </div>\n </>\n );\n};\n","import React from 'react';\nimport { shallowEqual, useDispatch, useSelector } from 'react-redux';\n\nimport styled from 'styled-components';\n\nimport { WidgetDisplayMode, WidgetsRootState } from 'jamespot-user-api';\nimport { Widget, WidgetEditor } from 'jamespot-front-business';\n\nimport { Uploader } from '../const';\nimport { WidgetInplaceUpload } from './WidgetInplaceUpload';\n\nexport const CSSUploadFileWrapper = styled.div`\n position: relative;\n inset: 0;\n display: flex;\n flex: 1;\n min-height: 180px;\n`;\n\nexport const WidgetInplaceWrapper = ({ uniqid, mode }: { uniqid: string; mode: WidgetDisplayMode }) => {\n const dispatch = useDispatch();\n const widgetWrapper = useSelector((state: WidgetsRootState) => Widget.selectors.selectWidget(state, uniqid));\n const isActive = useSelector(\n (state: WidgetsRootState) => state.widgets.currentEditableWidgetId === uniqid,\n shallowEqual,\n );\n const token = useSelector(Widget.selectors.selectToken);\n\n React.useEffect(() => {\n if (isActive && widgetWrapper?.widget.name) {\n dispatch(WidgetEditor.slice.actions.flushAllEditor());\n dispatch(WidgetEditor.slice.actions.registerEditor({ uniqid, name: widgetWrapper?.widget.name }));\n }\n }, [isActive]);\n\n if (widgetWrapper === undefined) {\n return <></>;\n }\n\n const label = Uploader && Uploader[widgetWrapper?.widget.name] ? Uploader[widgetWrapper?.widget.name].label : '';\n const description =\n Uploader && Uploader[widgetWrapper?.widget.name] ? Uploader[widgetWrapper?.widget.name].description : '';\n const accept = Uploader && Uploader[widgetWrapper?.widget.name] ? Uploader[widgetWrapper?.widget.name].accept : '';\n const multiple =\n Uploader && Uploader[widgetWrapper?.widget.name] ? Uploader[widgetWrapper?.widget.name].multiple : false;\n\n switch (widgetWrapper?.widget.name) {\n case 'widget-article-gallery':\n const galleryFiles = widgetWrapper.widget.content.files;\n return token !== undefined && mode === 'edit' ? (\n <div style={{ marginTop: galleryFiles?.length ? 24 : 0 }}>\n <CSSUploadFileWrapper>\n <WidgetInplaceUpload\n label={label}\n description={description}\n initialFiles={[]}\n accept={accept}\n multiple={multiple}\n uniqid={uniqid}\n token={token}\n allowAutoOpening={!galleryFiles?.length}\n onChange={(fs) => {\n if (Array.isArray(fs)) {\n fs.forEach((file) => {\n dispatch(\n Widget.slice.actions.updateWidget({\n uniqid,\n content: { files: galleryFiles ? [...galleryFiles, file] : [file] },\n }),\n );\n });\n }\n }}\n />\n </CSSUploadFileWrapper>\n </div>\n ) : (\n <></>\n );\n case 'widget-article-attachment':\n const files = widgetWrapper.widget.content.files;\n return token !== undefined && mode === 'edit' ? (\n <div style={{ marginTop: files?.length ? 24 : 0 }}>\n <CSSUploadFileWrapper>\n <WidgetInplaceUpload\n label={label}\n description={description}\n initialFiles={files ?? []}\n accept={accept}\n multiple={multiple}\n uniqid={uniqid}\n token={token}\n allowAutoOpening={!files?.length}\n onChange={(fs) => {\n if (Array.isArray(fs)) {\n fs.forEach((file) => {\n dispatch(\n Widget.slice.actions.updateWidget({\n uniqid,\n content: { files: files ? [...files, file] : [file] },\n }),\n );\n });\n }\n }}\n />\n </CSSUploadFileWrapper>\n </div>\n ) : (\n <></>\n );\n case 'widget-article-image':\n return token !== undefined && mode === 'edit' && !widgetWrapper.widget.content.file ? (\n <>\n <CSSUploadFileWrapper>\n <WidgetInplaceUpload\n label={label}\n description={description}\n initialFiles={widgetWrapper.widget.content.file ?? []}\n accept={accept}\n multiple={false}\n uniqid={uniqid}\n token={token}\n allowAutoOpening={!widgetWrapper.widget.content.file}\n onChange={(fs) => {\n if (fs && fs[0]) {\n dispatch(Widget.slice.actions.updateWidget({ uniqid, content: { file: fs[0] } }));\n }\n }}\n />\n </CSSUploadFileWrapper>\n </>\n ) : (\n <div\n style={{ position: 'absolute', inset: 0 }}\n onClick={() => {\n dispatch(WidgetEditor.slice.actions.flushAllEditor());\n dispatch(\n WidgetEditor.slice.actions.registerEditor({ uniqid, name: widgetWrapper?.widget.name }),\n );\n }}></div>\n );\n }\n\n return <></>;\n};\n","import styled from 'styled-components';\n\nexport const CSSWidgetLayer = styled.div<{ opacity: number; backgroundColor: string; pointerEvents: string }>`\n position: absolute;\n inset: 0;\n opacity: ${(props) => props.opacity};\n background-color: ${(props) => props.backgroundColor};\n pointer-events: ${(props) => props.pointerEvents};\n`;\n","import React from 'react';\n\nimport { shallowEqual, useDispatch, useSelector } from 'react-redux';\n\nimport { WidgetVector, WidgetsRootState, WidgetDisplayMode, WidgetKeys } from 'jamespot-user-api';\n\nimport { WidgetEditor, Widget } from 'jamespot-front-business';\nimport WidgetWrapperCore from '../WidgetWrapperCore';\nimport { CSSWidgetLayer } from './WidgetLayer.style';\nimport { BETA_JRCDoubleClick } from 'jamespot-react-components';\n\n/*\n Widget layering\n*/\n\nexport const WidgetLayer = ({ uniqid, mode }: { uniqid: string; mode: WidgetDisplayMode }) => {\n const layers = useSelector((state: WidgetsRootState) => state.widgets.ids[uniqid].widget.layers, shallowEqual);\n return (\n <>\n {layers?.map((layer, index) => {\n if (mode === 'edit') {\n return <Layer uniqid={layer} key={index} mode={'edit'} />;\n }\n\n return <Layer uniqid={layer} key={index} mode={'edit'} />;\n })}\n </>\n );\n};\n\nconst Layer = ({ uniqid, mode }: { uniqid: string; mode: WidgetDisplayMode }) => {\n const layer = useSelector((state: WidgetsRootState) => state.widgets.layers[uniqid]);\n if (mode === 'view') {\n return (\n <CSSWidgetLayer opacity={1} backgroundColor={'transparent'} pointerEvents={'none'}>\n {layer.widgets.map((widgetWrapper, index) => {\n return (\n <LayerWidget\n key={index}\n layerId={layer.uniqid}\n uniqid={widgetWrapper.widget.uniqid}\n mode={'view'}\n />\n );\n })}\n </CSSWidgetLayer>\n );\n }\n\n return (\n <CSSWidgetLayer\n opacity={layer.visible ? 1 : 0}\n backgroundColor={layer.visible ? 'rgba(255,255,255,.1)' : 'transparent'}\n pointerEvents={layer.locked ? 'none' : 'all'}>\n {layer.widgets.map((widgetWrapper, index) => {\n return (\n <LayerWidget\n key={index}\n layerId={layer.uniqid}\n uniqid={widgetWrapper.widget.uniqid}\n mode={'edit'}\n />\n );\n })}\n </CSSWidgetLayer>\n );\n};\n\n/*\n Widget from the layer\n*/\nconst LayerWidget = ({ uniqid, layerId, mode }: { uniqid: string; layerId: string; mode: WidgetDisplayMode }) => {\n const dispatch = useDispatch();\n const widgetWrapper = useSelector((state: WidgetsRootState) => state.widgets.ids[uniqid], shallowEqual);\n const layer = useSelector((state: WidgetsRootState) => state.widgets.layers[layerId]);\n\n if (!widgetWrapper) {\n return <></>;\n }\n\n if (!layer) {\n return <></>;\n }\n\n if (!layer.position) {\n return <></>;\n }\n\n const onDoubleTap = (uniqid: string, name: WidgetKeys) => {\n /*\n Open editor\n */\n dispatch(WidgetEditor.slice.actions.registerEditor({ uniqid, name }));\n };\n\n const onMouseUp = (position: WidgetVector) => {\n dispatch(Widget.slice.actions.updateLayer({ uniqid: layerId, props: { position } }));\n };\n\n if (mode === 'view') {\n return (\n <div style={{ position: 'absolute', top: layer.position.y, left: layer.position.x }}>\n <WidgetWrapperCore uniqid={uniqid} widget={widgetWrapper} mode={mode} inplace={true} />\n </div>\n );\n }\n\n return (\n <DraggableHandler\n position={{ x: layer.position.x, y: layer.position.y }}\n onMouseUp={(position: WidgetVector) => {\n if (\n (layer.position && layer.position.x !== position.x) ||\n (layer.position && layer.position.y !== position.y)\n ) {\n onMouseUp(position);\n }\n }}>\n <BETA_JRCDoubleClick\n onDoubleTap={() => onDoubleTap(widgetWrapper.widget.uniqid, widgetWrapper.widget.name)}>\n <WidgetWrapperCore uniqid={uniqid} widget={widgetWrapper} mode={mode} inplace={true} />\n </BETA_JRCDoubleClick>\n </DraggableHandler>\n );\n};\n\nexport type Vector = {\n x: number;\n y: number;\n};\n\n// TODO: COMBINE WITH THE ONE USED ON COLOR PICKER\n// TODO: COMBINE WITH THE ONE USED ON COLOR PICKER\n// TODO: COMBINE WITH THE ONE USED ON COLOR PICKER\nexport const DraggableHandler = ({\n position,\n children,\n onMouseUp,\n}: {\n position: Vector;\n children: React.ReactElement;\n onMouseUp: (position: Vector) => void;\n}) => {\n const [mouseIsDown, setMouseDown] = React.useState<boolean>(false);\n const [mouse, setMouse] = React.useState<Vector>({ x: 0, y: 0 });\n const [start, setStart] = React.useState<Vector>({ x: 0, y: 0 });\n const [child, setChild] = React.useState<Vector>({ x: position.x, y: position.y });\n\n const ref = React.useRef<HTMLDivElement>(null);\n\n const handleMouseDown = (event: any) => {\n setMouseDown(true);\n if (ref.current) {\n setMouse({ x: event.nativeEvent.clientX, y: event.nativeEvent.clientY });\n setStart({ x: child.x, y: child.y });\n }\n };\n\n const handleMouseMove = React.useCallback(\n (event: any) => {\n if (mouseIsDown && ref.current) {\n const dx = start.x + (event.clientX - mouse.x);\n const dy = start.y + (event.clientY - mouse.y);\n\n setChild({ x: dx, y: dy });\n }\n },\n [mouseIsDown],\n );\n\n const handleMouseUp = () => {\n setMouseDown(false);\n onMouseUp({ x: child.x, y: child.y });\n };\n\n React.useEffect(() => {\n document.addEventListener('mousemove', handleMouseMove);\n document.addEventListener('mouseup', handleMouseUp);\n return () => {\n document.removeEventListener('mousemove', handleMouseMove);\n document.removeEventListener('mouseup', handleMouseUp);\n };\n }, [handleMouseMove]);\n\n return (\n <div style={{ position: 'absolute', top: child.y, left: child.x }} ref={ref} onMouseDown={handleMouseDown}>\n {children}\n </div>\n );\n};\n","import React from 'react';\nimport { useSelector, useDispatch, shallowEqual } from 'react-redux';\n\nimport { WidgetDisplayMode, WidgetsRootState, WidgetWrapperProps } from 'jamespot-user-api';\nimport { WidgetState } from './WidgetState';\nimport { DisplayWidget } from './Widget';\nimport { Widget, WidgetEditor } from 'jamespot-front-business';\nimport { useComponentVisible } from './hooks';\nimport { WidgetInplaceWrapper } from './WidgetInplace/WidgetInplaceWrapper';\nimport { WidgetLayer } from './WidgetLayer/WidgetLayer';\n\n/*\n This is a widget wrapper\n*/\nexport const WidgetWrapperCore = ({\n uniqid,\n widget,\n inplace = true,\n mode,\n width,\n}: {\n uniqid: string;\n widget: WidgetWrapperProps;\n inplace?: boolean;\n mode: WidgetDisplayMode;\n width?: number | undefined;\n}) => {\n const dispatch = useDispatch();\n const widgetWrapper = useSelector((state: WidgetsRootState) => Widget.selectors.selectWidget(state, uniqid));\n const isBusy = useSelector(\n (state: WidgetsRootState) => Widget.selectors.selectWidgetState(state, uniqid)?.busy,\n shallowEqual,\n );\n const indexOrder = useSelector((state: WidgetsRootState) => state.widgets.editableMap[uniqid], shallowEqual);\n const currentEditableWidgetId = useSelector(\n (state: WidgetsRootState) => state.widgets.currentEditableWidgetId,\n shallowEqual,\n );\n const isActive = useSelector(\n (state: WidgetsRootState) => state.widgets.currentEditableWidgetId === uniqid,\n shallowEqual,\n );\n const { ref, isComponentVisible, setIsComponentVisible } = useComponentVisible(false);\n\n React.useEffect(() => {\n if (widget) {\n /*\n Register widget\n */\n dispatch(Widget.slice.actions.registerWidget({ uniqid, widget }));\n }\n }, []);\n\n React.useEffect(() => {\n if (!isComponentVisible) {\n if (uniqid === currentEditableWidgetId) {\n dispatch(Widget.slice.actions.setEditableWidgetId({ uniqid: undefined }));\n }\n }\n }, [isComponentVisible]);\n\n React.useEffect(() => {\n if (isComponentVisible !== isActive) {\n setIsComponentVisible(isActive);\n }\n }, [isActive]);\n\n if (widgetWrapper === undefined) {\n return <>This widget cannot be desplayed</>;\n }\n\n const onClick = () => {\n if (mode === 'edit') {\n registerEditor();\n } else {\n if (widgetWrapper.widget.name === 'widget-article-button') {\n switch (widgetWrapper.widget.content.openingType) {\n case 'link':\n if (widgetWrapper.widget.content.openingTypeLink) {\n window.open(\n widgetWrapper.widget.content.openingTypeLink.url,\n widgetWrapper.widget.content.openingTypeLink.target,\n );\n }\n break;\n }\n }\n }\n };\n\n const registerEditor = () => {\n if (mode === 'view') {\n return;\n }\n /*\n Register editor\n */\n const { widget } = widgetWrapper;\n dispatch(\n WidgetEditor.slice.actions.registerEditor({\n uniqid: widget.uniqid,\n name: widget.name,\n }),\n );\n };\n\n if (inplace && mode !== 'view') {\n return (\n <div\n style={{ minWidth: width !== undefined ? width : '100%' }}\n ref={ref}\n onClick={() => {\n setIsComponentVisible(true);\n if (indexOrder) {\n dispatch(Widget.slice.actions.setEditableIndex({ index: indexOrder.index }));\n dispatch(Widget.slice.actions.setEditableWidgetId({ uniqid }));\n }\n }}>\n <DisplayWidget\n width={width}\n widget={widgetWrapper.widget}\n inplace={inplace}\n isComponentVisible={isComponentVisible || isBusy || isActive ? true : false}\n mode={mode}\n onClick={onClick}\n />\n <WidgetInplaceWrapper uniqid={uniqid} mode={mode} />\n <WidgetLayer uniqid={uniqid} mode={mode} />\n <WidgetState name={widgetWrapper.widget.name} uniqid={widgetWrapper.widget.uniqid} inplace={inplace} />\n </div>\n );\n }\n\n return (\n <div\n style={{ flex: 1, display: 'flex', minWidth: width !== undefined ? width : '100%' }}\n onClick={registerEditor}>\n <DisplayWidget\n widget={widgetWrapper.widget}\n isComponentVisible={false}\n inplace={inplace}\n mode={mode}\n width={width}\n onClick={onClick}\n />\n <WidgetLayer uniqid={uniqid} mode={mode} />\n <WidgetState name={widgetWrapper.widget.name} uniqid={widgetWrapper.widget.uniqid} inplace={inplace} />\n </div>\n );\n};\n\nexport default WidgetWrapperCore;\n","import styled from 'styled-components';\n\nexport const CSSSquareWidgetWrapper = styled.div`\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n gap: 10px;\n justify-content: center;\n`;\n\nexport const CSSSquareWidget = styled.div<{ available: boolean }>`\n border: 1px solid ${(props) => props.theme.color.grey2};\n border-radius: 8px;\n cursor: pointer;\n padding: 12px;\n position: relative;\n opacity: ${(props) => (props.available ? '1' : '.4')};\n pointer-events: ${(props) => (props.available ? 'all' : 'none')};\n\n .show-on-hover {\n position: absolute;\n inset: 0;\n border-radius: 8px;\n justify-content: center;\n align-items: center;\n display: flex;\n opacity: 0;\n background-color: #ffffffe6;\n }\n\n &:hover {\n .show-on-hover {\n opacity: 1;\n }\n }\n`;\n\nexport const CSSWidgetButton = styled.div<{ open: boolean }>`\n border: 2px solid ${(props) => props.theme.color.primary};\n height: ${(props) => (props.open ? '320' : '54')}px;\n border-radius: 8px;\n display: flex;\n justify-content: top;\n flex-direction: column;\n transition: height 0.4s;\n overflow: hidden;\n flex-direction: column;\n`;\n\nexport const CSSWrapWidgetWrapper = styled.div`\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n justify-content: center;\n gap: 10px;\n`;\n\nexport const CSSWrapTitle = styled.div`\n min-height: 50px;\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n color: ${(props) => props.theme.color.primary};\n`;\n\nexport const CSSWrapWidget = styled.button<{ open: boolean; index: number }>`\n height: 72px;\n display: flex;\n justify-content: center;\n align-items: center;\n width: 40%;\n border: 1px solid ${(props) => props.theme.color.grey2};\n border-radius: 8px;\n transition: opacity 0.4s ease ${(props) => props.index * 40}ms;\n opacity: ${(props) => (props.open ? 1 : 0)};\n`;\n","import React from 'react';\nimport { useIntl } from 'react-intl';\n\nimport { WidgetDefinitionProps, WidgetKeys, WidgetWrapperProps } from 'jamespot-user-api';\n\nimport JRCore from 'App';\nimport { JRCModalProps } from 'jamespot-react-components';\nimport { Widget } from 'jamespot-front-business';\nimport { getBuilderWidgets } from '../namespace';\nimport {\n CSSSquareWidget,\n CSSSquareWidgetWrapper,\n CSSWidgetButton,\n CSSWrapTitle,\n CSSWrapWidget,\n CSSWrapWidgetWrapper,\n} from './WidgetList.style';\n\nconst JRCButton = JRCore.registry.getLazyComponent('Button');\nconst JRCModal = JRCore.registry.getLazyComponent('Modal');\n\ntype WidgetListMode = 'button' | 'list' | 'gallery' | 'custom' | 'article';\n\n/*\n Widget Builder\n*/\nexport const WidgetList = ({\n mode,\n children,\n namespace = 'default',\n onChange,\n}: {\n mode?: WidgetListMode;\n children?: any;\n namespace?: string;\n onChange: (widget: WidgetWrapperProps) => void;\n}) => {\n const [isOpen, setOpen] = React.useState<boolean>(false);\n const widgets = getBuilderWidgets(namespace);\n const intl = useIntl();\n\n const args: JRCModalProps = {\n open: isOpen,\n title: 'widget builder',\n showIconClose: true,\n portalId: 'react-modal',\n isFullHeight: true,\n closeHandler: () => setOpen(false),\n };\n\n const onClick = (name: WidgetKeys) => {\n onChange(Widget.factory(name));\n setOpen(false);\n };\n\n return (\n <>\n <JRCModal {...args}>\n <CSSSquareWidgetWrapper>\n {widgets.map((widget, index: number) => {\n return (\n <CSSSquareWidget\n key={index}\n onClick={() => onClick(widget.name)}\n available={widget.available}>\n <img src={widget.img} />\n <div className=\"show-on-hover\">{intl.formatMessage({ id: widget.label })}</div>\n </CSSSquareWidget>\n );\n })}\n </CSSSquareWidgetWrapper>\n </JRCModal>\n {mode === 'custom' && children ? <div onClick={() => setOpen(true)}>{children}</div> : <></>}\n {mode === 'button' ? (\n <JRCButton onClick={() => setOpen(true)} variant={'outlined'} minWidth={'100%'}>\n {intl.formatMessage({ id: 'WIDGET_Add_Widget' })}\n </JRCButton>\n ) : (\n <></>\n )}\n {mode === 'gallery' ? (\n <CSSSquareWidgetWrapper>\n {widgets.map((widget, index: number) => {\n return (\n <CSSSquareWidget\n key={index}\n onClick={() => onClick(widget.name)}\n available={widget.available}>\n <img src={widget.img} />\n <div className=\"show-on-hover\">{intl.formatMessage({ id: widget.label })}</div>\n </CSSSquareWidget>\n );\n })}\n </CSSSquareWidgetWrapper>\n ) : (\n <></>\n )}\n {mode === 'article' ? <WidgetModeArticle widgets={widgets} onClick={onClick} /> : <></>}\n </>\n );\n};\n\nconst WidgetModeArticle = ({\n widgets,\n onClick,\n}: {\n widgets: WidgetDefinitionProps[];\n onClick: (name: WidgetKeys) => void;\n}) => {\n const [open, isOpen] = React.useState(false);\n const intl = useIntl();\n return (\n <>\n <CSSWidgetButton open={open}>\n <CSSWrapTitle onClick={() => isOpen(!open)}>\n {intl.formatMessage({ id: 'WIDGET_Add_Widget' })}\n </CSSWrapTitle>\n <CSSWrapWidgetWrapper>\n {widgets.map((widget, index) => {\n return (\n <CSSWrapWidget\n key={widget.name}\n open={open}\n index={index}\n onClick={() => onClick(widget.name)}>\n {intl.formatMessage({ id: widget.label })}\n </CSSWrapWidget>\n );\n })}\n </CSSWrapWidgetWrapper>\n </CSSWidgetButton>\n </>\n );\n};\n","import { Widget } from 'jamespot-front-business';\nimport { WidgetDefinitionProps } from 'jamespot-user-api';\n\nexport function getBuilderWidgets(namespace: string): WidgetDefinitionProps[] {\n switch (namespace) {\n case 'widget-article-image':\n return [\n Widget.definition(Widget.const.WIDGET_ARTICLE_TITLE),\n Widget.definition(Widget.const.WIDGET_ARTICLE_BUTTON),\n ];\n default:\n return [\n Widget.definition(Widget.const.WIDGET_ARTICLE_TITLE),\n Widget.definition(Widget.const.WIDGET_ARTICLE_TEXT),\n Widget.definition(Widget.const.WIDGET_ARTICLE_IMAGE),\n Widget.definition(Widget.const.WIDGET_ARTICLE_BUTTON),\n Widget.definition(Widget.const.WIDGET_ARTICLE_GALLERY),\n Widget.definition(Widget.const.WIDGET_ARTICLE_ATTACHMENT),\n ];\n }\n}\n","import styled from 'styled-components';\nimport { EDITOR_MENU_WIDTH, EDITOR_WIDTH } from './const';\n\nconst INPUT_HEIGHT = 50;\nconst RADIUS = 8;\n\nexport const CSSEditorComponentWrapper = styled.div`\n margin-bottom: 24px;\n`;\n\nexport const CSSEditorComponentLabel = styled.div`\n margin-bottom: 4px;\n`;\n\nexport const CSSEditorPortal = styled.div<{ on: boolean }>`\n position: absolute;\n background-color: ${(props) => (props.on ? 'rgba(0,0,0,.1)' : 'transparent')};\n inset: 0;\n pointer-events: ${(props) => (props.on ? 'all' : 'none')};\n flex: 1;\n display: flex;\n overflow: hidden;\n`;\n\nexport const CSSEditorHeader = styled.div`\n flex-direction: row;\n display: flex;\n min-height: 60px;\n border-bottom: 1px solid ${(props) => props.theme.color.grey2};\n`;\n\nexport const CSSEditorAction = styled.div`\n width: 60px;\n display: flex;\n align-items: center;\n justify-content: center;\n`;\n\nexport const CSSEditorLabel = styled.div`\n flex: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n`;\n\nexport const CSSEditor = styled.div<{ visible: boolean }>`\n position: absolute;\n top: 90px;\n right: ${(props) => (props.visible ? '0' : '-1000')}px;\n width: ${EDITOR_WIDTH}px;\n bottom: 0;\n display: flex;\n background-color: ${(props) => props.theme.color.white};\n flex-direction: row;\n transition: all 0.4s;\n box-shadow: -1px 1px 10px 0px rgb(0 0 0 / 20%);\n`;\n\nexport const CSSEditorContent = styled.div`\n flex: 1;\n display: flex;\n flex-direction: row;\n padding: 12px;\n overflow: auto;\n`;\n\nexport const CSSEditorMenu = styled.div`\n width: ${EDITOR_MENU_WIDTH}px;\n padding-top: 60px;\n display: flex;\n flex-direction: column;\n border-right: 1px solid ${(props) => props.theme.color.grey2};\n`;\n\nexport const CSSEditorMenuButton = styled.button<{ on?: boolean }>`\n border-radius: 4px;\n cursor: pointer;\n height: 42px;\n margin: 4px;\n width: 42px;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ${(props) => (props.on ? props.theme.color.grey1 : props.theme.color.white)};\n &:hover {\n background-color: ${(props) => props.theme.color.grey1};\n }\n`;\n\nexport const CSSInputWrapper = styled.div`\n display: flex;\n border: 1px solid ${(props) => props.theme.color.grey1};\n border-radius: ${RADIUS}px;\n margin-bottom: 24px;\n input {\n width: 100%;\n border: 0;\n height: ${INPUT_HEIGHT}px;\n margin: 0;\n }\n`;\n\nexport const CSSEditorWidget = styled.div`\n display: flex;\n flex-direction: row;\n padding: 12px;\n background-color: ${(props) => props.theme.color.grey0};\n border-radius: 8px;\n margin-bottom: 4px;\n`;\n\nexport const CSSEditorWidgetLabel = styled.div`\n display: flex;\n flex: 1;\n align-items: center;\n`;\n\nexport const CSSEditorWidgetOption = styled.div`\n width: 40px;\n display: flex;\n justify-content: center;\n align-items: center;\n`;\n\nexport const CSSEditorLayer = styled.div`\n flex-direction: row;\n display: flex;\n align-items: center;\n`;\n\nexport const CSSEditorLayerTitle = styled.div`\n flex: 1;\n display: flex;\n align-items: center;\n`;\n","export const EDITOR_TOP = 90;\nexport const EDITOR_WIDTH = 440;\nexport const EDITOR_MENU_WIDTH = 50;\n","import React from 'react';\n\nimport { useDispatch, useSelector } from 'react-redux';\n\nimport { JRCButton, JRCIcon } from 'jamespot-react-components';\n\nimport { CSSEditorAction, CSSEditorHeader, CSSEditorLabel, CSSEditorMenuButton } from './style';\nimport { WidgetEditor, EditorsRootState } from 'jamespot-front-business';\n\n/*\n Editor popup (center part)\n*/\nexport const EditorPopup = ({ uniqid }: { uniqid: string }) => {\n const dispatch = useDispatch();\n const editor = useSelector((state: EditorsRootState) => WidgetEditor.selectors.selectEditor(state, uniqid));\n\n const onClick = () => {\n dispatch(WidgetEditor.slice.actions.flushEditorPopup({ uniqid }));\n };\n\n const onSave = () => {\n dispatch(WidgetEditor.slice.actions.flushEditorPopup({ uniqid }));\n };\n\n if (editor && editor.popup && editor.view) {\n return (\n <div style={{ flex: 1, display: 'flex', flexDirection: 'column', backgroundColor: 'white', marginTop: 90 }}>\n <CSSEditorHeader>\n <CSSEditorAction />\n <CSSEditorLabel>Popup</CSSEditorLabel>\n <CSSEditorAction>\n <CSSEditorMenuButton onClick={onClick}>\n <JRCIcon name=\"icon-times\" color=\"grey2\" />\n </CSSEditorMenuButton>\n </CSSEditorAction>\n </CSSEditorHeader>\n <div style={{ flex: 1, display: 'flex' }}>{editor.view}</div>\n <CSSEditorHeader>\n <JRCButton onClick={onSave}>Save</JRCButton>\n </CSSEditorHeader>\n </div>\n );\n }\n\n return <></>;\n};\n","import React from 'react';\n\nimport { useDispatch, useSelector } from 'react-redux';\n\nimport { WidgetEditor, Widget } from 'jamespot-front-business';\n\nimport JRCore from 'App';\n\nimport { CombinedWidgetContent, WidgetsRootState, WidgetStateProps } from 'jamespot-user-api';\n\nconst JRCWidgetArticleTitleEditor = JRCore.registry.getLazyComponent('WidgetArticleTitleEditor');\nconst JRCWidgetArticleImageEditor = JRCore.registry.getLazyComponent('WidgetArticleImageEditor');\nconst JRCWidgetArticleTextEditor = JRCore.registry.getLazyComponent('WidgetArticleTextEditor');\nconst JRCWidgetArticleGalleryEditor = JRCore.registry.getLazyComponent('WidgetArticleGalleryEditor');\nconst JRCWidgetArticleButtonEditor = JRCore.registry.getLazyComponent('WidgetArticleButtonEditor');\nconst JRCWidgetArticleAttachmentEditor = JRCore.registry.getLazyComponent('WidgetArticleAttachmentEditor');\n\n/*\n Editor Factory\n*/\nexport const Editor = ({ uniqid }: { uniqid: string }) => {\n const dispatch = useDispatch();\n const token = useSelector(Widget.selectors.selectToken);\n const widgetWrapper = useSelector((state: WidgetsRootState) => Widget.selectors.selectWidget(state, uniqid));\n\n const onSave = (content: CombinedWidgetContent) => {\n /*\n Update widget & Flush editor\n */\n if (widgetWrapper) {\n dispatch(Widget.slice.actions.updateWidget({ uniqid, content }));\n }\n\n dispatch(WidgetEditor.slice.actions.flushEditor({ uniqid }));\n };\n\n const onChange = (content: CombinedWidgetContent, override?: boolean) =>\n dispatch(Widget.slice.actions.updateWidget({ uniqid, content, override }));\n\n const onStateChange = (states: WidgetStateProps, id?: string) => {\n /*\n Set widget state (busy, loading, initialized)\n */\n if (id !== undefined) {\n dispatch(Widget.slice.actions.setWidgetState({ uniqid: id, ...states }));\n } else {\n dispatch(Widget.slice.actions.setWidgetState({ uniqid, ...states }));\n }\n };\n\n const onOpen = (view: React.ReactElement) => {\n /*\n Register popup (central)\n */\n dispatch(WidgetEditor.slice.actions.registerEditorPopup({ uniqid, view }));\n };\n\n switch (widgetWrapper?.widget.name) {\n default:\n return <>cannot display editor</>;\n case Widget.const.WIDGET_ARTICLE_BUTTON:\n return (\n <JRCWidgetArticleButtonEditor\n content={widgetWrapper.widget.content}\n onChange={onChange}\n onSave={onSave}\n onStateChange={onStateChange}\n />\n );\n case Widget.const.WIDGET_ARTICLE_ATTACHMENT:\n return (\n <JRCWidgetArticleAttachmentEditor\n token={token}\n content={widgetWrapper.widget.content}\n onChange={onChange}\n onSave={onSave}\n onStateChange={onStateChange}\n onOpen={onOpen}\n />\n );\n case Widget.const.WIDGET_ARTICLE_GALLERY:\n return (\n <JRCWidgetArticleGalleryEditor\n token={token}\n content={widgetWrapper.widget.content}\n onChange={onChange}\n onSave={onSave}\n onStateChange={onStateChange}\n />\n );\n case Widget.const.WIDGET_ARTICLE_TEXT:\n return (\n <JRCWidgetArticleTextEditor\n onChange={onChange}\n onSave={onSave}\n content={widgetWrapper.widget.content}\n />\n );\n case Widget.const.WIDGET_ARTICLE_IMAGE:\n return (\n <JRCWidgetArticleImageEditor\n content={widgetWrapper.widget.content}\n token={token}\n onChange={onChange}\n onSave={onSave}\n onStateChange={onStateChange}\n />\n );\n case Widget.const.WIDGET_ARTICLE_TITLE:\n return (\n <JRCWidgetArticleTitleEditor\n onChange={onChange}\n onSave={onSave}\n content={widgetWrapper.widget.content}\n onOpen={onOpen}\n />\n );\n }\n};\n","import React from 'react';\n\nimport { shallowEqual, useDispatch, useSelector } from 'react-redux';\n\nimport { WidgetEditor, Widget } from 'jamespot-front-business';\n\nimport { WidgetKeys, WidgetsRootState } from 'jamespot-user-api';\nimport { useIntl } from 'react-intl';\nimport { CSSEditorWidget, CSSEditorWidgetLabel, CSSEditorWidgetOption } from './style';\nimport { BETA_JRCDragAndDrop, JRCIcon } from 'jamespot-react-components';\nimport { WidgetList } from 'registry/coreComponents';\n\n/*\n Editor widgets (widgets)\n*/\nexport const EditorTabWidgets = ({ uniqid }: { uniqid: string; namespace: string }) => {\n const dispatch = useDispatch();\n const intl = useIntl();\n const content = useSelector((state: WidgetsRootState) => Widget.selectors.selectWidgetContent(state, uniqid));\n\n const onClick = (uniqid: string, name: WidgetKeys) => {\n /*\n Register Editor\n */\n dispatch(WidgetEditor.slice.actions.registerEditor({ uniqid, name }));\n };\n\n return (\n <div style={{ flex: 1 }}>\n <Layers uniqid={uniqid} />\n {content && content.widgets ? (\n content.widgets.map((widgetWrapper, index: number) => {\n const def = Widget.definition(widgetWrapper.widget.name);\n return (\n <div key={index}>\n <CSSEditorWidget>\n <CSSEditorWidgetLabel\n onClick={() => onClick(widgetWrapper.widget.uniqid, widgetWrapper.widget.name)}>\n {intl.formatMessage({ id: def.label })}\n </CSSEditorWidgetLabel>\n <CSSEditorWidgetOption\n onClick={() => {\n if (content.widgets) {\n dispatch(\n Widget.slice.actions.updateWidget({\n uniqid,\n content: {\n ...content,\n widgets: [\n ...content.widgets.filter((_, n: number) => n !== index),\n ],\n },\n }),\n );\n }\n }}>\n <JRCIcon name={'icon-trash'} />\n </CSSEditorWidgetOption>\n </CSSEditorWidget>\n </div>\n );\n })\n ) : (\n <></>\n )}\n </div>\n );\n};\n\nconst Layers = ({ uniqid }: { uniqid: string }) => {\n const dispatch = useDispatch();\n const layers = useSelector((state: WidgetsRootState) => state.widgets.ids[uniqid].widget.layers, shallowEqual);\n\n //const flushEditor = () => dispatch(WidgetEditor.slice.actions.flushEditor({ uniqid }));\n\n return (\n <>\n <BETA_JRCDragAndDrop\n onDrag={() => {\n //console.log(dragIndex, hoverIndex)\n }}\n renderEl={(layer, index) => {\n return <EditorWidgetLayer uniqid={layer} key={index} />;\n }}\n elms={layers ? layers : []}\n />\n <WidgetList\n namespace={'default'}\n onChange={(widget) => {\n dispatch(Widget.slice.actions.registerLayer({ uniqid, widget }));\n }}\n mode={'button'}\n />\n </>\n );\n};\n\nconst EditorWidgetLayerLock = ({ uniqid }: { uniqid: string }) => {\n const dispatch = useDispatch();\n const layer = useSelector((state: WidgetsRootState) => state.widgets.layers[uniqid]);\n return (\n <div\n onClick={() => {\n dispatch(Widget.slice.actions.updateLayer({ uniqid, props: { locked: !layer.locked } }));\n }}>\n <JRCIcon name={layer.locked ? 'icon-lock' : 'icon-unlock'} />\n </div>\n );\n};\n\nconst EditorWidgetLayerVisibility = ({ uniqid }: { uniqid: string }) => {\n const dispatch = useDispatch();\n const layer = useSelector((state: WidgetsRootState) => state.widgets.layers[uniqid]);\n return (\n <div\n onClick={() => {\n dispatch(Widget.slice.actions.updateLayer({ uniqid, props: { visible: !layer.visible } }));\n }}>\n <JRCIcon name={layer.visible ? 'icon-eye' : 'icon-eye-slash'} />\n </div>\n );\n};\n\nconst EditorWidgetLayerFlush = ({ uniqid, layerId }: { uniqid: string; layerId: string }) => {\n const dispatch = useDispatch();\n return (\n <div\n onClick={() => {\n dispatch(Widget.slice.actions.flushLayer({ uniqid, layerId }));\n }}>\n <JRCIcon name={'icon-trash'} />\n </div>\n );\n};\n\nconst EditorWidgetLayer = ({ uniqid }: { uniqid: string }) => {\n const layer = useSelector((state: WidgetsRootState) => state.widgets.layers[uniqid]);\n return (\n <>\n {layer.title}\n {layer.widgets.map((widget, index) => {\n const def = Widget.definition(widget.widget.name);\n\n return (\n <div style={{ flexDirection: 'row', display: 'flex' }} key={index}>\n <div style={{ flex: 1, alignItems: 'center' }}>{def.label}</div>\n <EditorWidgetLayerLock uniqid={uniqid} />\n <EditorWidgetLayerVisibility uniqid={uniqid} />\n <EditorWidgetLayerFlush uniqid={widget.widget.uniqid} layerId={layer.uniqid} />\n </div>\n );\n })}\n </>\n );\n};\n","import React from 'react';\n\nimport { useDispatch, useSelector } from 'react-redux';\n\nimport JRCore from 'App';\n\nconst JRCButton = JRCore.registry.getLazyComponent('Button');\n\nimport { useIntl } from 'react-intl';\nimport { WidgetEditor, Widget } from 'jamespot-front-business';\nimport { useForm } from 'react-hook-form';\nimport { JRCInputText } from 'jamespot-react-components';\nimport { WidgetsRootState } from 'jamespot-user-api';\n\n/*\n Editor tab wrapper (this is all the properties available on a widget wrapper)\n*/\nexport const EditorTabWrapper = ({ uniqid }: { uniqid: string }) => {\n const intl = useIntl();\n const dispatch = useDispatch();\n const wrapper = useSelector((state: WidgetsRootState) => Widget.selectors.selectWidget(state, uniqid));\n const [title, setTitle] = React.useState<string | undefined>(wrapper?.title);\n\n const onClick = () => {\n if (title !== undefined) {\n /*\n Update editor\n */\n dispatch(Widget.slice.actions.updateWidgetWrapper({ uniqid, title }));\n /*\n Flush editor\n */\n dispatch(WidgetEditor.slice.actions.flushEditor({ uniqid }));\n }\n };\n\n const { control, watch } = useForm({\n defaultValues: { text: title ?? '' },\n criteriaMode: 'all',\n });\n\n React.useEffect(() => {\n const subscription = watch((data: any) => {\n setTitle(data.text);\n });\n return () => subscription.unsubscribe();\n }, [watch]);\n\n return wrapper ? (\n <div style={{ flex: 1, display: 'flex', flexDirection: 'column' }}>\n <JRCInputText\n name={'text'}\n control={control}\n placeholder={intl.formatMessage({ id: 'EDITOR_Widget_Wrapper_Title' })}></JRCInputText>\n <JRCButton onClick={onClick} variant={'outlined'} minWidth={'100%'}>\n {intl.formatMessage({ id: 'EDITOR_Save_Widget' })}\n </JRCButton>\n </div>\n ) : (\n <>No wrapper</>\n );\n};\n","import React from 'react';\n\nimport { useDispatch, useSelector } from 'react-redux';\n\nimport { Editor } from './Editor';\n\nimport JRCore from 'App';\n\nconst JRCIcon = JRCore.registry.getLazyComponent('Icon');\n\nimport {\n CSSEditor,\n CSSEditorAction,\n CSSEditorContent,\n CSSEditorHeader,\n CSSEditorLabel,\n CSSEditorMenu,\n CSSEditorMenuButton,\n} from './style';\nimport { EDITOR_WIDTH } from './const';\n\nimport { useIntl } from 'react-intl';\nimport { WidgetEditor, EditorsRootState, Widget } from 'jamespot-front-business';\nimport { EditorTabWidgets } from './EditorTabWidgets';\nimport { EditorTabWrapper } from './EditorTabWrapper';\nimport { WidgetsRootState } from 'jamespot-user-api';\n\n/*\n Editor wrapper (right part)\n*/\nexport const EditorWrapper = ({ uniqid }: { uniqid: string }) => {\n const intl = useIntl();\n const dispatch = useDispatch();\n const editor = useSelector((state: EditorsRootState) => WidgetEditor.selectors.selectEditor(state, uniqid));\n\n const def = Widget.definition(editor?.name);\n\n const [visible, isVisibile] = React.useState<boolean>(false);\n const [tab, setTab] = React.useState<string>('default');\n\n const onClose = () => {\n dispatch(WidgetEditor.slice.actions.flushEditor({ uniqid }));\n };\n\n React.useEffect(() => {\n setTimeout(() => {\n isVisibile(true);\n }, 0);\n });\n\n return editor ? (\n <div style={{ width: EDITOR_WIDTH, position: 'relative' }}>\n <CSSEditor visible={visible}>\n <CSSEditorMenu>\n {def.panel.useWrapper ? (\n <CSSEditorMenuButton on={tab === 'wrapper'} onClick={() => setTab('wrapper')}>\n <JRCIcon name=\"icon-font\" color=\"grey2\" />\n </CSSEditorMenuButton>\n ) : (\n <></>\n )}\n {def.panel.useEditor ? (\n <CSSEditorMenuButton on={tab === 'default'} onClick={() => setTab('default')}>\n <JRCIcon name=\"icon-pen\" color=\"grey2\" />\n </CSSEditorMenuButton>\n ) : (\n <></>\n )}\n {def.panel.useWidgets ? (\n <EditorConditonalTab uniqid={uniqid}>\n <CSSEditorMenuButton on={tab === 'widgets'} onClick={() => setTab('widgets')}>\n <JRCIcon name=\"icon-sliders\" color=\"grey2\" />\n </CSSEditorMenuButton>\n </EditorConditonalTab>\n ) : (\n <></>\n )}\n </CSSEditorMenu>\n <div style={{ flex: 1, display: 'flex', flexDirection: 'column' }}>\n <CSSEditorHeader>\n <EditorPositionOption uniqid={uniqid} position={editor.position}></EditorPositionOption>\n <CSSEditorLabel>{intl.formatMessage({ id: def.label })}</CSSEditorLabel>\n <CSSEditorAction>\n <CSSEditorMenuButton onClick={onClose}>\n <JRCIcon name=\"icon-times\" color=\"grey2\" />\n </CSSEditorMenuButton>\n </CSSEditorAction>\n </CSSEditorHeader>\n <CSSEditorContent>\n {tab === 'default' && def.panel.useEditor ? <Editor uniqid={editor.uniqid} /> : <></>}\n {tab === 'wrapper' && def.panel.useWrapper ? (\n <EditorTabWrapper uniqid={editor.uniqid} />\n ) : (\n <></>\n )}\n {tab === 'widgets' && def.panel.useWidgets ? (\n <EditorTabWidgets uniqid={uniqid} namespace={def.name} />\n ) : (\n <></>\n )}\n </CSSEditorContent>\n </div>\n </CSSEditor>\n {editor?.popup ? (\n <div style={{ position: 'absolute', inset: 0, backgroundColor: '#000', opacity: '.7' }}></div>\n ) : (\n <></>\n )}\n </div>\n ) : (\n <></>\n );\n};\n\nconst EditorPositionOption = ({ uniqid, position }: { uniqid: string; position: 'left' | 'right' }) => {\n const dispatch = useDispatch();\n\n const onClick = () => {\n dispatch(\n WidgetEditor.slice.actions.setEditorPosition({ uniqid, position: position === 'left' ? 'right' : 'left' }),\n );\n };\n\n return (\n <CSSEditorAction>\n <CSSEditorMenuButton onClick={onClick}>\n <JRCIcon name={position === 'left' ? 'icon-angle-right' : 'icon-angle-left'} color=\"grey2\" />\n </CSSEditorMenuButton>\n </CSSEditorAction>\n );\n};\n\nconst EditorConditonalTab = ({ uniqid, children }: { uniqid: string; children: React.ReactElement }) => {\n const widgetState = useSelector((state: WidgetsRootState) => Widget.selectors.selectWidgetState(state, uniqid));\n\n if (widgetState?.initialized) {\n return children;\n }\n\n return <></>;\n};\n","import React from 'react';\n\nimport { useSelector } from 'react-redux';\n\nimport { EDITOR_TOP, EDITOR_WIDTH } from './const';\nimport { EditorPopup } from './EditorPopup';\nimport { EditorWrapper } from './EditorWrapper';\nimport { CSSEditorPortal } from './style';\nimport { WidgetEditor } from 'jamespot-front-business';\n\nimport styled from 'styled-components';\n\nexport const CSSEditorPortalWrapper = styled.div`\n position: absolute;\n inset: 0;\n pointer-events: none;\n z-index: 100;\n`;\n\nexport const CSSEditorPortalPopupWrapper = styled.div<{ on: boolean }>`\n flex: 1;\n display: flex;\n margintop: ${EDITOR_TOP}px;\n pointer-events: ${(props) => (props.on ? 'all' : 'none')};\n`;\n\nexport const CSSEditorPortalRow = styled.div`\n flex: 1;\n display: flex;\n flex-direction: row;\n pointer-events: none;\n`;\n\nexport const CSSEditorPortalFreeSpace = styled.div`\n width: ${EDITOR_WIDTH}px;\n pointer-events: n;\n`;\n\n/*\n Editors wrapper (tamplate)\n*/\nexport const EditorsPortal = () => {\n const editors = useSelector(WidgetEditor.selectors.selectEditors);\n return (\n <CSSEditorPortalWrapper>\n {editors.map((editor, index: number) => {\n if (editor.position === 'left') {\n return (\n <CSSEditorPortal on={false} key={index}>\n <CSSEditorPortalRow>\n <EditorWrapper uniqid={editor.uniqid}></EditorWrapper>\n <CSSEditorPortalPopupWrapper on={editor.popup !== undefined}>\n <EditorPopup uniqid={editor.uniqid} />\n </CSSEditorPortalPopupWrapper>\n <CSSEditorPortalFreeSpace />\n </CSSEditorPortalRow>\n </CSSEditorPortal>\n );\n }\n\n return (\n <CSSEditorPortal on={false} key={index}>\n <CSSEditorPortalRow>\n <CSSEditorPortalFreeSpace />\n <CSSEditorPortalPopupWrapper on={editor.popup !== undefined}>\n <EditorPopup uniqid={editor.uniqid} />\n </CSSEditorPortalPopupWrapper>\n <EditorWrapper uniqid={editor.uniqid}></EditorWrapper>\n </CSSEditorPortalRow>\n </CSSEditorPortal>\n );\n })}\n </CSSEditorPortalWrapper>\n );\n};\n"],"names":["DisplayForm","props","ref","formRef","configuration","defaultValues","useDisplay","fields","type","handleSubmit","control","reset","useForm","criteriaMode","current","scrollTo","onSubmit","map","Input","conf","key","name","dataCy","extraInputs","buttons","Empty","Container","AppColumn","MainColumn","TwoColLayout","extensionRoute","routes","description","mode","intl","useIntl","pathname","useLocation","ROUTES_ARRAY","Object","values","activeTab","setActiveTab","tabs","tab","label","formatMessage","id","href","path","group","undefined","activeRoute","find","route","fallback","Outlet","JRCLoader","WidgetState","uniqid","inplace","state","useSelector","def","loading","style","position","inset","backgroundColor","display","flex","justifyContent","alignItems","hover","initialized","src","img","JRCWidgetArticleButton","JRCWidgetArticleGallery","JRCWidgetArticleAttachment","JRCWidgetArticleImage","JRCWidgetArticleTitle","JRCWidgetArticleText","DisplayWidget","widget","width","isComponentVisible","onClick","dispatch","useDispatch","token","onChange","content","override","onStateChange","states","Uploader","accept","multiple","JRCFormFile","WidgetInplaceUpload","initialFiles","allowAutoOpening","isActive","widgets","currentEditableWidgetId","shallowEqual","uploadRef","fileUploadStep","setFileUploadStep","fileCount","setFileCount","fileResponses","setFileResponses","fileResponse","click","mounted","JRCWidgetEmptyInplace","url","height","overflow","onUploadStart","count","prevCount","onUploadSuccess","prevStep","prevFileResponses","apiFileToWidgetFile","CSSUploadFileWrapper","WidgetInplaceWrapper","widgetWrapper","galleryFiles","files","marginTop","length","fs","Array","isArray","forEach","file","CSSWidgetLayer","opacity","pointerEvents","WidgetLayer","layers","ids","layer","index","Layer","LayerWidget","layerId","visible","locked","top","y","left","x","DraggableHandler","onMouseUp","BETA_JRCDoubleClick","onDoubleTap","children","mouseIsDown","setMouseDown","mouse","setMouse","start","setStart","child","setChild","handleMouseMove","event","dx","clientX","dy","clientY","handleMouseUp","document","addEventListener","removeEventListener","onMouseDown","nativeEvent","WidgetWrapperCore","isBusy","busy","indexOrder","editableMap","setIsComponentVisible","registerEditor","openingType","openingTypeLink","window","open","target","minWidth","CSSSquareWidgetWrapper","CSSSquareWidget","theme","color","grey2","available","CSSWidgetButton","primary","CSSWrapWidgetWrapper","CSSWrapTitle","CSSWrapWidget","JRCButton","JRCModal","WidgetList","namespace","isOpen","setOpen","getBuilderWidgets","args","title","showIconClose","portalId","isFullHeight","closeHandler","className","variant","WidgetModeArticle","CSSEditorPortal","on","CSSEditorHeader","CSSEditorAction","CSSEditorLabel","CSSEditor","white","CSSEditorContent","CSSEditorMenu","CSSEditorMenuButton","grey1","CSSEditorWidget","grey0","CSSEditorWidgetLabel","CSSEditorWidgetOption","EditorPopup","editor","popup","view","flexDirection","JRCIcon","JRCWidgetArticleTitleEditor","JRCWidgetArticleImageEditor","JRCWidgetArticleTextEditor","JRCWidgetArticleGalleryEditor","JRCWidgetArticleButtonEditor","JRCWidgetArticleAttachmentEditor","Editor","onSave","onOpen","EditorTabWidgets","Layers","filter","_","n","BETA_JRCDragAndDrop","onDrag","renderEl","EditorWidgetLayer","elms","EditorWidgetLayerLock","EditorWidgetLayerVisibility","EditorWidgetLayerFlush","EditorTabWrapper","wrapper","setTitle","watch","text","subscription","data","unsubscribe","JRCInputText","placeholder","EditorWrapper","isVisibile","setTab","setTimeout","panel","useWrapper","useEditor","useWidgets","EditorConditonalTab","EditorPositionOption","widgetState","CSSEditorPortalWrapper","CSSEditorPortalPopupWrapper","CSSEditorPortalRow","CSSEditorPortalFreeSpace","EditorsPortal","editors"],"sourceRoot":""}