tocco-widget-showcase 3.8.4 → 3.8.6

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/changelog.md CHANGED
@@ -1,3 +1,10 @@
1
+ 3.8.6
2
+ - remove obsolete padding around styled entity browser
3
+ - fix disabled textarea on safari
4
+
5
+ 3.8.5
6
+ - allow access without widgetmanager role local
7
+
1
8
  3.8.4
2
9
  - fix menu menu links not opening in new tab when icon is clicked
3
10
 
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunktocco_widget_showcase=self.webpackChunktocco_widget_showcase||[]).push([[675],{94675:(e,n,t)=>{t.r(n),t.d(n,{default:()=>Me});var i=t(74806),s=t(50558),o=t(16973),a=t(1024),c=t(44012),r=t(30604),d=t(35728),l=t(34206);const g=t.p+"imgs/tocco-circle.7ab925bf473f813493f00f069ed9746e.svg";var u=t(47874),h=t(15861),p=t(93433),f=t(29439),w=t(64687),Z=t.n(w),x=t(30006),m=t(42846),y=t(65035),j=t(4942),b=t(28002),v=t(15019),C="widget-container",S="widget";function k(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function P(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?k(Object(t),!0).forEach((function(n){(0,j.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):k(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var W,N=function(){return document.getElementById(C)},O=function(){var e=(0,h.Z)(Z().mark((function e(n,t,i,s,o){var a,c,r,d,l,g,u,h;return Z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=i.packageName,c=i.appName,r=i.locale,d=i.config,l=b.Z.getBackendUrl(),e.next=4,v.Z.loadScriptAsync("".concat(l).concat(v.Z.getEntryFilePath(a,c)));case 4:return g=P(P(P({backendUrl:l,locale:r},s?{customTheme:s}:{}),d),{},{appContext:{embedType:"widget",widgetConfigKey:t}},o),u="".concat(l,"/js/tocco-").concat(a,"/dist/"),h=window.reactRegistry.render(c,n,S,g,{},u),e.abrupt("return",{methods:h,input:g});case 8:case"end":return e.stop()}}),e)})));return function(n,t,i,s,o){return e.apply(this,arguments)}}(),E=t(85893);const F=function(e){var n,t=e.label,i=e.onClick,s=e.intl,o=(0,a.useState)("[]"),r=(0,f.Z)(o,2),d=r[0],g=r[1];return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(l.ZP.H3,{children:t}),(0,E.jsx)(x.Z,{label:(n="client.widget-showcase.methodArguments",s.formatMessage({id:n})),children:(0,E.jsx)(m.Z,{type:"code",value:d,events:{onChange:g},options:{autoFocusOnMount:!1,mode:"json"}})}),(0,E.jsx)(y.Z,{type:"button",onClick:function(){return i.apply(void 0,(0,p.Z)(JSON.parse(d)))},look:"raised",children:W||(W=(0,E.jsx)(c.Z,{id:"client.widget-showcase.execute"}))})]})};var I,M,D,R,A,H,T,q,z,B,L,V,_,J,U,K,G,X,Q=t(30168),Y=t(67165),$=t(30759),ee=t(24875),ne=t(7281),te=Y.ZP.div.withConfig({displayName:"Container"})(I||(I=(0,Q.Z)(["\n max-width: 1600px;\n margin: 0 auto;\n"]))),ie=Y.ZP.div.withConfig({displayName:"StyledWidgetContainer"})(M||(M=(0,Q.Z)(["\n & * {\n ","\n }\n"])),(0,$.Z)({color:"inherit"})),se=Y.ZP.span.withConfig({displayName:"StyledEmptyInput"})(D||(D=(0,Q.Z)(["\n ","\n min-height: 2.6rem;\n display: flex;\n align-items: center;\n"])),(0,$.Z)()),oe=Y.ZP.div.withConfig({displayName:"StyledSection"})(R||(R=(0,Q.Z)(["\n margin: 40px 0;\n"]))),ae=((0,Y.ZP)(y.Z).withConfig({displayName:"StyledRefreshButton"})(A||(A=(0,Q.Z)(["\n margin: 15px 0 0;\n"]))),(0,Y.ZP)(y.Z).withConfig({displayName:"StyledInputViewButton"})(H||(H=(0,Q.Z)(["\n margin-left: 15px;\n"])))),ce=Y.ZP.span.withConfig({displayName:"StyledVisibilityStatus"})(T||(T=(0,Q.Z)(["\n ","\n border: 1px solid #e6e6e6;\n background-color: #e6e6e6;\n border-radius: ",";\n padding: "," ",";\n"])),(0,$.Z)(),ee.FS.radii("button"),ne.Z.space(-2.1),ne.Z.space(0));const re=function(e){var n=e.selectedWidget,t=e.setSelectedWidget,i=e.selectedWidgetConfig,s=e.setSelectedWidgetConfig,o=e.loadWidgets,r=e.widgets,d=e.widgetConfigs,g=e.widgetConfig,u=e.editWidgetConfig,w=e.theme,j=e.editTheme,b=e.viewWidgetInput,v=e.isWidgetManager,k=e.intl,P=function(e){return k.formatMessage({id:e})};(0,a.useEffect)((function(){o()}),[o]);var W=r.map((function(e){return{key:e.key,display:e.label}})),I=d.map((function(e){return{key:e.key,uniqueId:e.uniqueId,display:"".concat(e.uniqueId," - ").concat(e.label)}})),M=(0,a.useState)([]),D=(0,f.Z)(M,2),R=D[0],A=D[1],H=(0,a.useState)([]),T=(0,f.Z)(H,2),Q=T[0],Y=T[1],$=(0,a.useState)(null),ee=(0,f.Z)($,2),ne=ee[0],re=ee[1],de=(0,a.useState)(null),le=(0,f.Z)(de,2),ge=le[0],ue=le[1],he=function(e,n){return Y((function(t){return[].concat((0,p.Z)(t),[{name:e,args:n}])}))},pe=null==i?void 0:i.uniqueId,fe=(0,a.useCallback)((0,h.Z)(Z().mark((function e(){var n,t,i,s,o,a;return Z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=N(),t=w,i={onVisibilityStatusChange:function(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];var i=n[0].status;A(i),he("onVisibilityStatusChange",n)}},e.next=5,O(n,pe,g,t,i);case 5:s=e.sent,o=s.input,a=s.methods,re(a),ue(o);case 9:case"end":return e.stop()}}),e)}))),[w,pe,g]),we=(0,a.useCallback)((0,h.Z)(Z().mark((function e(){return Z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return history.pushState("",document.title,window.location.pathname+window.location.search),A([]),Y([]),re(null),ue(null),e.next=7,new Promise((function(e){0!==N().children.length?setTimeout((function(){window.reactRegistry.unmount(S),e()}),0):e()}));case 7:case"end":return e.stop()}}),e)}))),[]),Ze=(0,a.useCallback)((0,h.Z)(Z().mark((function e(){return Z().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,we();case 2:fe();case 3:case"end":return e.stop()}}),e)}))),[fe,we]);return(0,a.useEffect)((function(){g?Ze():we()}),[g,we,Ze]),(0,E.jsxs)(te,{children:[q||(q=(0,E.jsx)(l.ZP.H1,{children:(0,E.jsx)(c.Z,{id:"client.widget-showcase.showcase"})})),(0,E.jsx)(x.Z,{label:P("client.widget-showcase.widget"),children:(0,E.jsx)(m.Z,{type:"single-select",value:n,options:{options:W},events:{onChange:t}})}),(0,E.jsx)(x.Z,{label:P("client.widget-showcase.widgetConfiguration"),children:n?(0,E.jsx)(m.Z,{type:"single-select",value:i,options:{options:I},events:{onChange:s}}):z||(z=(0,E.jsx)(se,{children:(0,E.jsx)(c.Z,{id:"client.widget-showcase.selectWidget"})}))}),v?(0,E.jsx)(y.Z,{type:"button",onClick:u,ink:"primary",look:"raised",disabled:!i,children:B||(B=(0,E.jsx)(c.Z,{id:"client.widget-showcase.widgetConfiguration.edit"}))}):null,(0,E.jsx)(y.Z,{type:"button",onClick:j,ink:"primary",look:"raised",disabled:!i,children:L||(L=(0,E.jsx)(c.Z,{id:"client.widget-showcase.theme.edit"}))}),(0,E.jsxs)(oe,{children:[(0,E.jsxs)(l.ZP.H2,{children:[V||(V=(0,E.jsx)(c.Z,{id:"client.widget-showcase.widget"})),i&&(0,E.jsx)(ae,{type:"button",icon:"info",look:"raised",onClick:function(){return b(ge)},children:_||(_=(0,E.jsx)(c.Z,{id:"client.widget-showcase.widgetInput.view"}))}),R&&R.length>0&&(0,E.jsxs)(ce,{children:[J||(J=(0,E.jsx)(c.Z,{id:"client.widget-showcase.visibilityStatus"})),": ",R.join(",")]})]}),U||(U=(0,E.jsx)(ie,{id:C}))]}),(0,E.jsxs)(oe,{children:[K||(K=(0,E.jsx)(l.ZP.H2,{children:(0,E.jsx)(c.Z,{id:"client.widget-showcase.events"})})),Q.length>0?(0,E.jsx)("pre",{children:Q.map((function(e,n){var t=e.name,i=e.args;return(0,E.jsxs)(a.Fragment,{children:[t," - ",JSON.stringify(i),G||(G=(0,E.jsx)("br",{}))]},n)}))}):"-"]}),(0,E.jsxs)(oe,{children:[X||(X=(0,E.jsx)(l.ZP.H2,{children:(0,E.jsx)(c.Z,{id:"client.widget-showcase.methods"})})),ne?(0,E.jsx)(E.Fragment,{children:Object.keys(ne).map((function(e){return(0,E.jsx)(F,{label:e,onClick:ne[e],intl:k},e)}))}):"-"]})]})};var de={setSelectedWidget:o.yA,setSelectedWidgetConfig:o.sR,loadWidgets:o.G1,setWidgetConfig:o.EK,editWidgetConfig:u.gk,editTheme:u.dD,viewWidgetInput:u.R2};const le=(0,s.connect)((function(e){return{selectedWidget:e.showcase.selectedWidget,selectedWidgetConfig:e.showcase.selectedWidgetConfig,widgets:e.showcase.widgets,widgetConfigs:e.showcase.widgetConfigs,widgetConfig:e.showcase.widgetConfig,theme:e.showcase.theme,isWidgetManager:e.showcase.access.isWidgetManager}}),de)((0,i.ZP)(re));var ge,ue,he,pe,fe,we,Ze,xe,me,ye,je,be,ve=(0,Y.vJ)(ge||(ge=(0,Q.Z)(["\n html,\n body {\n ","\n font-size: 14px !important;\n }\n"])),(0,$.Z)()),Ce=t(54608),Se=Y.ZP.div.withConfig({displayName:"StyledWidgetShowcaseWrapper"})(ue||(ue=(0,Q.Z)(["\n background-color: ",";\n display: flex;\n flex-direction: column;\n height: 100%;\n ","\n"])),ee.FS.color("paper"),(0,$.Z)()),ke=Y.ZP.img.withConfig({displayName:"StyledLogo"})(he||(he=(0,Q.Z)(["\n width: 40px;\n height: auto;\n"]))),Pe=Y.ZP.div.withConfig({displayName:"StyledBrand"})(pe||(pe=(0,Q.Z)(["\n display: flex;\n gap: ",";\n align-items: center;\n\n "," {\n margin-top: 0;\n ","\n }\n"])),ne.Z.space(0),Ce.XU,(0,$.Z)({fontSize:ne.Z.font(9),fontWeight:ee.FS.fontWeight("bold")})),We=Y.ZP.span.withConfig({displayName:"StyledLightText"})(fe||(fe=(0,Q.Z)(["\n ","\n"])),(0,$.Z)({color:ee.FS.color("textLight"),fontSize:ne.Z.font(9)})),Ne=Y.ZP.header.withConfig({displayName:"StyledHeader"})(we||(we=(0,Q.Z)(["\n position: sticky;\n top: 0;\n z-index: 9999;\n background-color: ",";\n box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);\n border-bottom: 1px solid ",";\n"])),ee.FS.color("paper"),ee.FS.color("borderLight")),Oe=Y.ZP.nav.withConfig({displayName:"StyledNavigationWrapper"})(Ze||(Ze=(0,Q.Z)(["\n min-height: 50px;\n max-width: 1600px;\n width: 100%;\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: "," ",";\n box-sizing: border-box;\n margin: 0 auto;\n"])),ne.Z.space(-.5),ne.Z.space(.5)),Ee=(Y.ZP.ul.withConfig({displayName:"StyledNavigationList"})(xe||(xe=(0,Q.Z)(["\n list-style: none;\n display: flex;\n"]))),Y.ZP.main.withConfig({displayName:"StyledMain"})(me||(me=(0,Q.Z)(["\n flex: 1;\n padding: "," ",";\n overflow: auto;\n"])),ne.Z.space(1),ne.Z.space(.5)));const Fe=function(e){var n=e.checkAccess,t=e.isDevelopmentRunEnv,i=e.isWidgetManager;return(0,a.useEffect)((function(){n()}),[n]),(0,E.jsxs)(d.Z,{required:[void 0!==i&&"undefined"!==t],children:[ye||(ye=(0,E.jsx)(ve,{})),i||t?je||(je=(0,E.jsxs)(Se,{children:[(0,E.jsx)(Ne,{children:(0,E.jsx)(Oe,{children:(0,E.jsxs)(Pe,{children:[(0,E.jsx)(ke,{src:g,alt:"tocco-logo"}),(0,E.jsxs)(l.ZP.H1,{children:["Tocco ",(0,E.jsx)(We,{children:"Widget Showcase"})]})]})})}),(0,E.jsx)(r.Z.Notifications,{}),(0,E.jsx)(Ee,{children:(0,E.jsx)(le,{})})]})):be||(be=(0,E.jsx)(l.ZP.P,{children:(0,E.jsx)(c.Z,{id:"client.widget-showcase.noAccess"})}))]})};var Ie={checkAccess:o.WD};const Me=(0,s.connect)((function(e){return{isDevelopmentRunEnv:e.showcase.access.isDevelopmentRunEnv,isWidgetManager:e.showcase.access.isWidgetManager}}),Ie)((0,i.ZP)(Fe))}}]);