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