@strapi/admin 4.5.0 → 4.5.2
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/admin/src/components/LeftMenu/index.js +22 -4
- package/admin/src/content-manager/components/DynamicTable/CellContent/RelationMultiple/index.js +4 -3
- package/admin/src/content-manager/components/DynamicZone/components/{AddComponentButton/index.js → AddComponentButton.js} +12 -6
- package/admin/src/content-manager/components/DynamicZone/components/{ComponentPicker/Category/ComponentCard/index.js → ComponentCard.js} +8 -19
- package/admin/src/content-manager/components/DynamicZone/components/{ComponentPicker/Category/index.js → ComponentCategory.js} +19 -18
- package/admin/src/content-manager/components/DynamicZone/components/{ComponentPicker/index.js → ComponentPicker.js} +36 -38
- package/admin/src/content-manager/components/DynamicZone/components/DynamicComponent.js +195 -0
- package/admin/src/content-manager/components/DynamicZone/components/{DzLabel/index.js → DynamicZoneLabel.js} +13 -5
- package/admin/src/content-manager/components/DynamicZone/index.js +33 -118
- package/admin/src/content-manager/pages/ListSettingsView/components/Settings.js +79 -76
- package/admin/src/pages/HomePage/index.js +1 -1
- package/admin/src/pages/MarketplacePage/components/NpmPackagesFilters/FilterSelect.js +2 -1
- package/admin/src/pages/MarketplacePage/components/NpmPackagesFilters/index.js +1 -0
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/components/FormApiTokenContainer/index.js +2 -2
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/components/FormBody/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/components/FormHead/index.js +1 -1
- package/admin/src/translations/nl.json +210 -23
- package/admin/src/translations/pt-BR.json +14 -14
- package/admin/src/translations/pt.json +33 -32
- package/admin/src/translations/sv.json +117 -85
- package/admin/src/translations/zh.json +280 -95
- package/build/{7692.a36fb2c2.chunk.js → 1233.bddaaa76.chunk.js} +144 -445
- package/build/1920.208c77f8.chunk.js +245 -0
- package/build/2438.afe24949.chunk.js +2525 -0
- package/build/2517.5cc235ba.chunk.js +117 -0
- package/build/4306.e62b841c.chunk.js +98 -0
- package/build/4318.7931eee7.chunk.js +30 -0
- package/build/4986.3820d11d.chunk.js +145 -0
- package/build/{8469.41c8d25f.chunk.js → 5015.f080b64e.chunk.js} +6 -1
- package/build/504.9aeff724.chunk.js +758 -0
- package/build/805.a1894307.chunk.js +138 -0
- package/build/8633.8da5488a.chunk.js +1 -0
- package/build/9707.932a3c12.chunk.js +70 -0
- package/build/Admin-authenticatedApp.7484bdf1.chunk.js +80 -0
- package/build/Admin_InternalErrorPage.e0317a5e.chunk.js +1 -0
- package/build/Admin_homePage.54e33c2d.chunk.js +77 -0
- package/build/Admin_marketplace.ff012eb2.chunk.js +26 -0
- package/build/Admin_pluginsPage.3c872de7.chunk.js +6 -0
- package/build/Admin_profilePage.e9fcce92.chunk.js +15 -0
- package/build/Admin_settingsPage.a1a5218b.chunk.js +178 -0
- package/build/admin-app.9cb0abc7.chunk.js +112 -0
- package/build/admin-edit-roles-page.23f15909.chunk.js +1 -0
- package/build/admin-edit-users.283b49ed.chunk.js +10 -0
- package/build/admin-users.a0748674.chunk.js +11 -0
- package/build/api-tokens-list-page.700e575f.chunk.js +16 -0
- package/build/content-manager.577fddcb.chunk.js +1200 -0
- package/build/content-type-builder-list-view.95012cf0.chunk.js +201 -0
- package/build/content-type-builder-translation-pt-BR-json.6fe3b8d1.chunk.js +1 -0
- package/build/content-type-builder-translation-pt-json.96a31576.chunk.js +1 -0
- package/build/content-type-builder-translation-zh-json.3b0afd31.chunk.js +1 -0
- package/build/content-type-builder.95b9d6a2.chunk.js +145 -0
- package/build/email-settings-page.4bb3606f.chunk.js +15 -0
- package/build/email-translation-en-json.ebad8943.chunk.js +1 -0
- package/build/email-translation-pt-json.159505ab.chunk.js +1 -0
- package/build/email-translation-zh-json.62b1c6fe.chunk.js +1 -0
- package/build/i18n-settings-page.195d42fe.chunk.js +1 -0
- package/build/i18n-translation-zh-json.eeebb849.chunk.js +1 -0
- package/build/index.html +1 -1
- package/build/main.23670c4c.js +2026 -0
- package/build/nl-json.26f39180.chunk.js +1 -0
- package/build/pt-BR-json.2b72b1d6.chunk.js +1 -0
- package/build/pt-json.cd67ba86.chunk.js +1 -0
- package/build/runtime~main.4dc8c7c6.js +2 -0
- package/build/sso-settings-page.9f091262.chunk.js +1 -0
- package/build/sv-json.fb1081ff.chunk.js +1 -0
- package/build/upload-settings.3010911f.chunk.js +18 -0
- package/build/upload-translation-pt-json.5c452b48.chunk.js +1 -0
- package/build/upload-translation-zh-json.ac5711de.chunk.js +1 -0
- package/build/upload.9f19f2e8.chunk.js +64 -0
- package/build/users-advanced-settings-page.9df41d67.chunk.js +13 -0
- package/build/users-email-settings-page.56d82eaf.chunk.js +28 -0
- package/build/users-permissions-translation-sv-json.d5d11648.chunk.js +1 -0
- package/build/users-permissions-translation-zh-json.92f406f9.chunk.js +1 -0
- package/build/users-providers-settings-page.96bb7da0.chunk.js +33 -0
- package/build/users-roles-settings-page.445e5e16.chunk.js +30 -0
- package/build/webhook-edit-page.3285abc4.chunk.js +75 -0
- package/build/webhook-list-page.b87821f2.chunk.js +42 -0
- package/build/zh-json.2ecc6b99.chunk.js +1 -0
- package/jest.config.front.js +0 -1
- package/package.json +17 -16
- package/server/content-types/api-token.js +1 -1
- package/webpack.alias.js +3 -2
- package/webpack.config.js +13 -1
- package/admin/src/content-manager/components/DynamicZone/components/Component/Rectangle.js +0 -19
- package/admin/src/content-manager/components/DynamicZone/components/Component/index.js +0 -191
- package/admin/src/content-manager/icons/Bold/index.js +0 -22
- package/admin/src/content-manager/icons/Code/index.js +0 -13
- package/admin/src/content-manager/icons/Cross/index.js +0 -28
- package/admin/src/content-manager/icons/Italic/index.js +0 -23
- package/admin/src/content-manager/icons/Link/index.js +0 -21
- package/admin/src/content-manager/icons/Media/index.js +0 -14
- package/admin/src/content-manager/icons/Na/index.js +0 -39
- package/admin/src/content-manager/icons/Ol/index.js +0 -13
- package/admin/src/content-manager/icons/Quote/index.js +0 -13
- package/admin/src/content-manager/icons/Striked/index.js +0 -24
- package/admin/src/content-manager/icons/Ul/index.js +0 -15
- package/admin/src/content-manager/icons/Underline/index.js +0 -22
- package/build/1856.172d5fa0.chunk.js +0 -174
- package/build/2077.058590f4.chunk.js +0 -206
- package/build/2912.2c42c07b.chunk.js +0 -259
- package/build/4318.5e670740.chunk.js +0 -30
- package/build/4715.22747b59.chunk.js +0 -387
- package/build/4800.a6935af6.chunk.js +0 -1
- package/build/4982.1b75ddb1.chunk.js +0 -325
- package/build/6925.f5c8b6fc.chunk.js +0 -761
- package/build/7379.d246dd38.chunk.js +0 -1
- package/build/7841.c50e9509.chunk.js +0 -259
- package/build/7866.ba215f99.chunk.js +0 -505
- package/build/8380.e53e7207.chunk.js +0 -299
- package/build/8549.832ed79d.chunk.js +0 -159
- package/build/8738.0fe8a61e.chunk.js +0 -463
- package/build/9066.eaf76ff3.chunk.js +0 -101
- package/build/9166.90876521.chunk.js +0 -342
- package/build/9420.5292d1d2.chunk.js +0 -505
- package/build/9649.468667d9.chunk.js +0 -199
- package/build/Admin-authenticatedApp.c4f68103.chunk.js +0 -80
- package/build/Admin_InternalErrorPage.12e24216.chunk.js +0 -1
- package/build/Admin_homePage.26d32e30.chunk.js +0 -72
- package/build/Admin_marketplace.32375885.chunk.js +0 -22
- package/build/Admin_pluginsPage.4d59785a.chunk.js +0 -1
- package/build/Admin_profilePage.da32abbc.chunk.js +0 -15
- package/build/Admin_settingsPage.bf2234e1.chunk.js +0 -178
- package/build/admin-app.9049056c.chunk.js +0 -112
- package/build/admin-edit-roles-page.69d9fcb2.chunk.js +0 -1
- package/build/admin-edit-users.c585212f.chunk.js +0 -10
- package/build/admin-users.d71f198a.chunk.js +0 -11
- package/build/api-tokens-list-page.bb36535f.chunk.js +0 -16
- package/build/content-manager.ff998bed.chunk.js +0 -1204
- package/build/content-type-builder-list-view.5b3cd768.chunk.js +0 -194
- package/build/content-type-builder-translation-pt-BR-json.d6c7fcc1.chunk.js +0 -1
- package/build/content-type-builder-translation-pt-json.766bd747.chunk.js +0 -1
- package/build/content-type-builder-translation-zh-json.2cc55621.chunk.js +0 -1
- package/build/content-type-builder.16af63a6.chunk.js +0 -145
- package/build/email-settings-page.c3469093.chunk.js +0 -103
- package/build/email-translation-en-json.3d74ff95.chunk.js +0 -1
- package/build/email-translation-pt-json.959ea070.chunk.js +0 -1
- package/build/email-translation-zh-json.3455468b.chunk.js +0 -1
- package/build/i18n-settings-page.46d894ff.chunk.js +0 -101
- package/build/main.91328e7a.js +0 -9381
- package/build/nl-json.2b8cc3a0.chunk.js +0 -1
- package/build/pt-BR-json.7852f808.chunk.js +0 -1
- package/build/pt-json.3161ca22.chunk.js +0 -1
- package/build/runtime~main.c9c319c0.js +0 -2
- package/build/sso-settings-page.9ceb0140.chunk.js +0 -1
- package/build/sv-json.8e5a7911.chunk.js +0 -1
- package/build/upload-settings.53b690f3.chunk.js +0 -101
- package/build/upload-translation-zh-json.ee8fba96.chunk.js +0 -1
- package/build/upload.7084cea6.chunk.js +0 -7
- package/build/users-advanced-settings-page.3f4ee86e.chunk.js +0 -101
- package/build/users-email-settings-page.73c41236.chunk.js +0 -1
- package/build/users-permissions-translation-sv-json.83c60841.chunk.js +0 -1
- package/build/users-permissions-translation-zh-json.e03ae2a4.chunk.js +0 -1
- package/build/users-providers-settings-page.f8e78537.chunk.js +0 -1
- package/build/users-roles-settings-page.b33ec5e5.chunk.js +0 -30
- package/build/webhook-edit-page.dc9442ce.chunk.js +0 -23
- package/build/webhook-list-page.02191138.chunk.js +0 -134
- package/build/zh-json.608aaf24.chunk.js +0 -1
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_strapi_admin=self.webpackChunk_strapi_admin||[]).push([[5516],{62030:function(S,w,i){(function(t,p){S.exports=p(i(32735))})(this,function(t){return function(p){var f={};function r(e){if(f[e])return f[e].exports;var a=f[e]={i:e,l:!1,exports:{}};return p[e].call(a.exports,a,a.exports,r),a.l=!0,a.exports}return r.m=p,r.c=f,r.d=function(e,a,c){r.o(e,a)||Object.defineProperty(e,a,{enumerable:!0,get:c})},r.r=function(e){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,a){if(1&a&&(e=r(e)),8&a||4&a&&typeof e=="object"&&e&&e.__esModule)return e;var c=Object.create(null);if(r.r(c),Object.defineProperty(c,"default",{enumerable:!0,value:e}),2&a&&typeof e!="string")for(var P in e)r.d(c,P,function(u){return e[u]}.bind(null,P));return c},r.n=function(e){var a=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(a,"a",a),a},r.o=function(e,a){return Object.prototype.hasOwnProperty.call(e,a)},r.p="",r(r.s=86)}({0:function(p,f){p.exports=t},86:function(p,f,r){"use strict";r.r(f);var e=r(0);function a(){return(a=Object.assign||function(c){for(var P=1;P<arguments.length;P++){var u=arguments[P];for(var b in u)Object.prototype.hasOwnProperty.call(u,b)&&(c[b]=u[b])}return c}).apply(this,arguments)}f.default=function(c){return e.createElement("svg",a({width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},c),e.createElement("path",{d:"M12 0C5.373 0 0 5.501 0 12.288c0 5.43 3.438 10.035 8.206 11.66.6.114.82-.266.82-.59 0-.294-.01-1.262-.016-2.289-3.338.744-4.043-1.45-4.043-1.45-.546-1.42-1.332-1.797-1.332-1.797-1.089-.763.082-.747.082-.747 1.205.086 1.84 1.266 1.84 1.266 1.07 1.878 2.807 1.335 3.491 1.021.108-.794.42-1.336.762-1.643-2.665-.31-5.467-1.364-5.467-6.073 0-1.341.469-2.437 1.236-3.298-.124-.31-.535-1.56.117-3.252 0 0 1.007-.33 3.3 1.26A11.25 11.25 0 0112 5.942c1.02.005 2.047.141 3.006.414 2.29-1.59 3.297-1.26 3.297-1.26.653 1.693.242 2.943.118 3.252.77.86 1.235 1.957 1.235 3.298 0 4.72-2.808 5.76-5.48 6.063.43.382.814 1.13.814 2.276 0 1.644-.014 2.967-.014 3.372 0 .327.216.71.825.59C20.566 22.32 24 17.715 24 12.288 24 5.501 18.627 0 12 0z",fill:"#161614"}))}}})})},28992:function(S,w,i){(function(t,p){S.exports=p(i(32735))})(this,function(t){return function(p){var f={};function r(e){if(f[e])return f[e].exports;var a=f[e]={i:e,l:!1,exports:{}};return p[e].call(a.exports,a,a.exports,r),a.l=!0,a.exports}return r.m=p,r.c=f,r.d=function(e,a,c){r.o(e,a)||Object.defineProperty(e,a,{enumerable:!0,get:c})},r.r=function(e){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,a){if(1&a&&(e=r(e)),8&a||4&a&&typeof e=="object"&&e&&e.__esModule)return e;var c=Object.create(null);if(r.r(c),Object.defineProperty(c,"default",{enumerable:!0,value:e}),2&a&&typeof e!="string")for(var P in e)r.d(c,P,function(u){return e[u]}.bind(null,P));return c},r.n=function(e){var a=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(a,"a",a),a},r.o=function(e,a){return Object.prototype.hasOwnProperty.call(e,a)},r.p="",r(r.s=87)}({0:function(p,f){p.exports=t},87:function(p,f,r){"use strict";r.r(f);var e=r(0);function a(){return(a=Object.assign||function(c){for(var P=1;P<arguments.length;P++){var u=arguments[P];for(var b in u)Object.prototype.hasOwnProperty.call(u,b)&&(c[b]=u[b])}return c}).apply(this,arguments)}f.default=function(c){return e.createElement("svg",a({width:"1em",height:"1em",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},c),e.createElement("path",{d:"M0 4a4 4 0 014-4h24a4 4 0 014 4v24a4 4 0 01-4 4H4a4 4 0 01-4-4V4z",fill:"#AC73E6"}),e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.027 13.839c-3.19-.836-6.305-1.064-10.18-.608-1.215.152-1.063 1.975.076 2.203.304.836.456 2.355.912 3.267.987 2.279 5.622 1.975 7.369.835 1.14-.683 1.443-2.279 1.9-3.494.227-.684 1.595-.684 1.822 0 .38 1.215.76 2.81 1.9 3.494 1.747 1.14 6.381 1.444 7.369-.835.456-.912.607-2.431.911-3.267 1.14-.228 1.216-2.051.076-2.203-3.874-.456-6.989-.228-10.18.608-.455.075-1.519.075-1.975 0z",fill:"#fff"}))}}})})},49833:function(S,w,i){(function(t,p){S.exports=p(i(32735))})(this,function(t){return function(p){var f={};function r(e){if(f[e])return f[e].exports;var a=f[e]={i:e,l:!1,exports:{}};return p[e].call(a.exports,a,a.exports,r),a.l=!0,a.exports}return r.m=p,r.c=f,r.d=function(e,a,c){r.o(e,a)||Object.defineProperty(e,a,{enumerable:!0,get:c})},r.r=function(e){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,a){if(1&a&&(e=r(e)),8&a||4&a&&typeof e=="object"&&e&&e.__esModule)return e;var c=Object.create(null);if(r.r(c),Object.defineProperty(c,"default",{enumerable:!0,value:e}),2&a&&typeof e!="string")for(var P in e)r.d(c,P,function(u){return e[u]}.bind(null,P));return c},r.n=function(e){var a=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(a,"a",a),a},r.o=function(e,a){return Object.prototype.hasOwnProperty.call(e,a)},r.p="",r(r.s=174)}({0:function(p,f){p.exports=t},174:function(p,f,r){"use strict";r.r(f);var e=r(0);function a(){return(a=Object.assign||function(c){for(var P=1;P<arguments.length;P++){var u=arguments[P];for(var b in u)Object.prototype.hasOwnProperty.call(u,b)&&(c[b]=u[b])}return c}).apply(this,arguments)}f.default=function(c){return e.createElement("svg",a({width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},c),e.createElement("path",{d:"M12 18.26l-7.053 3.948 1.575-7.928L.587 8.792l8.027-.952L12 .5l3.386 7.34 8.027.952-5.935 5.488 1.575 7.928L12 18.26z",fill:"#212134"}))}}})})},75152:function(S,w,i){(function(t,p){S.exports=p(i(32735))})(this,function(t){return function(p){var f={};function r(e){if(f[e])return f[e].exports;var a=f[e]={i:e,l:!1,exports:{}};return p[e].call(a.exports,a,a.exports,r),a.l=!0,a.exports}return r.m=p,r.c=f,r.d=function(e,a,c){r.o(e,a)||Object.defineProperty(e,a,{enumerable:!0,get:c})},r.r=function(e){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,a){if(1&a&&(e=r(e)),8&a||4&a&&typeof e=="object"&&e&&e.__esModule)return e;var c=Object.create(null);if(r.r(c),Object.defineProperty(c,"default",{enumerable:!0,value:e}),2&a&&typeof e!="string")for(var P in e)r.d(c,P,function(u){return e[u]}.bind(null,P));return c},r.n=function(e){var a=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(a,"a",a),a},r.o=function(e,a){return Object.prototype.hasOwnProperty.call(e,a)},r.p="",r(r.s=189)}({0:function(p,f){p.exports=t},189:function(p,f,r){"use strict";r.r(f);var e=r(0);function a(){return(a=Object.assign||function(c){for(var P=1;P<arguments.length;P++){var u=arguments[P];for(var b in u)Object.prototype.hasOwnProperty.call(u,b)&&(c[b]=u[b])}return c}).apply(this,arguments)}f.default=function(c){return e.createElement("svg",a({width:"1em",height:"1em",viewBox:"0 0 24 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},c),e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.571 18.272H10.43v-8.47H2.487a.2.2 0 01-.14-.343L11.858.058a.2.2 0 01.282 0l9.513 9.4a.2.2 0 01-.14.343H13.57v8.47zM2.2 21.095a.2.2 0 00-.2.2v2.424c0 .11.09.2.2.2h19.6a.2.2 0 00.2-.2v-2.424a.2.2 0 00-.2-.2H2.2z",fill:"#212134"}))}}})})},92698:(S,w,i)=>{"use strict";i.r(w),i.d(w,{MarketPlacePage:()=>ke,default:()=>Wt});var t=i(32735),p=i(5636),f=i(99357),r=i(58469),e=i(88425),a=i(11856),c=i(16540),P=i(89978),u=i(9808),b=i(29270),T=i(95602),R=i(19192),j=i(81700),Be=i(60216),l=i.n(Be),B=i(78752),Ie=i(97042),we=i.n(Ie),F=i(19615);const Ne=(0,F.default)(u.Box)`
|
|
2
|
-
background: ${({theme:n})=>`linear-gradient(180deg, rgba(234, 234, 239, 0) 0%, ${n.colors.neutral150} 100%)`};
|
|
3
|
-
opacity: 0.33;
|
|
4
|
-
`,Le=()=>t.createElement(a.GridLayout,null,Array(12).fill(null).map((n,o)=>t.createElement(Ne,{key:`empty-plugin-card-${o}`,height:"234px",hasRadius:!0}))),ae=({content:n})=>t.createElement(u.Box,{position:"relative"},t.createElement(Le,null),t.createElement(u.Box,{position:"absolute",top:11,width:"100%"},t.createElement(R.Flex,{alignItems:"center",justifyContent:"center",direction:"column"},t.createElement(B.Icon,{as:we(),color:"",width:"160px",height:"88px"}),t.createElement(u.Box,{paddingTop:6},t.createElement(T.Typography,{variant:"delta",as:"p",textColor:"neutral600"},n)))));ae.propTypes={content:l().string.isRequired};const ne=ae;var re=i(61541),Fe=i(75152),De=i.n(Fe);const $=({isOnline:n,npmPackageType:o})=>{const{formatMessage:s}=(0,p.useIntl)(),{trackUsage:g}=(0,e.useTracking)(),m=o==="provider"?"didSubmitProvider":"didSubmitPlugin";return t.createElement(a.HeaderLayout,{title:s({id:"global.marketplace",defaultMessage:"Marketplace"}),subtitle:s({id:"admin.pages.MarketPlacePage.subtitle",defaultMessage:"Get more out of Strapi"}),primaryAction:n&&t.createElement(re.LinkButton,{startIcon:t.createElement(De(),null),variant:"tertiary",href:`https://market.strapi.io/submit-${o}`,onClick:()=>g(m),isExternal:!0},s({id:`admin.pages.MarketPlacePage.submit.${o}.link`,defaultMessage:`Submit ${o}`}))})},oe=$;$.defaultProps={npmPackageType:"plugin"},$.propTypes={isOnline:l().bool.isRequired,npmPackageType:l().string};var se=i(84968),Ae=i(43653),le=i.n(Ae),ze=(n,o,s)=>new Promise((g,m)=>{var y=h=>{try{d(s.next(h))}catch(E){m(E)}},v=h=>{try{d(s.throw(h))}catch(E){m(E)}},d=h=>h.done?g(h.value):Promise.resolve(h.value).then(y,v);d((s=s.apply(n,o)).next())});const Ve="https://market-api.strapi.io",$e=(...n)=>ze(void 0,[...n],function*(o={}){const{data:s}=yield le().get(`${Ve}/providers`,{params:o});return s}),He=(n,o)=>{const s=(0,e.useNotification)();return(0,se.useQuery)(["list-marketplace-providers",o],()=>$e(o),{onSuccess(){n&&n()},onError(){s({type:"warning",message:{id:"notification.error",defaultMessage:"An error occured"}})}})};var Ge=Object.defineProperty,Ue=Object.defineProperties,Qe=Object.getOwnPropertyDescriptors,ie=Object.getOwnPropertySymbols,We=Object.prototype.hasOwnProperty,Ye=Object.prototype.propertyIsEnumerable,ce=(n,o,s)=>o in n?Ge(n,o,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[o]=s,Ze=(n,o)=>{for(var s in o||(o={}))We.call(o,s)&&ce(n,s,o[s]);if(ie)for(var s of ie(o))Ye.call(o,s)&&ce(n,s,o[s]);return n},Ke=(n,o)=>Ue(n,Qe(o)),Je=(n,o,s)=>new Promise((g,m)=>{var y=h=>{try{d(s.next(h))}catch(E){m(E)}},v=h=>{try{d(s.throw(h))}catch(E){m(E)}},d=h=>h.done?g(h.value):Promise.resolve(h.value).then(y,v);d((s=s.apply(n,o)).next())});const Xe="https://market-api.strapi.io",qe=(...n)=>Je(void 0,[...n],function*(o={}){const{data:s}=yield le().get(`${Xe}/plugins`,{params:o});return Ke(Ze({},s),{data:s.data.filter(m=>m.attributes.strapiCompatibility==="v4")})}),_e=(n,o)=>{const s=(0,e.useNotification)();return(0,se.useQuery)(["list-marketplace-plugins",o],()=>qe(o),{onSuccess(){n&&n()},onError(){s({type:"warning",message:{id:"notification.error",defaultMessage:"An error occured"}})}})};var et=i(83983);const tt=i.p+"9d5d788027e86620c234.svg",at=()=>{const n=typeof navigator!="undefined"&&typeof navigator.onLine=="boolean"?navigator.onLine:!0,[o,s]=(0,t.useState)(n),g=()=>s(!0),m=()=>s(!1);return(0,t.useEffect)(()=>(window.addEventListener("online",g),window.addEventListener("offline",m),()=>{window.removeEventListener("online",g),window.removeEventListener("offline",m)}),[]),o};var nt=i(28992),rt=i.n(nt),ot=i(82372),ue=i.n(ot);const st=()=>{const{formatMessage:n}=(0,p.useIntl)(),{trackUsage:o}=(0,e.useTracking)();return t.createElement("a",{href:"https://strapi.canny.io/plugin-requests",target:"_blank",rel:"noopener noreferrer nofollow",style:{textDecoration:"none"},onClick:()=>o("didMissMarketplacePlugin")},t.createElement(e.ContentBox,{title:n({id:"admin.pages.MarketPlacePage.missingPlugin.title",defaultMessage:"Documentation"}),subtitle:n({id:"admin.pages.MarketPlacePage.missingPlugin.description",defaultMessage:"Tell us what plugin you are looking for and we'll let our community plugin developers know in case they are in search for inspiration!"}),icon:t.createElement(rt(),null),iconBackground:"alternative100",endAction:t.createElement(B.Icon,{as:ue(),color:"neutral600",width:3,height:3,marginLeft:2})}))};var de=i(78330),lt=i(24443),it=i.n(lt),H=i(90662),G=i(44826),ct=i(14356),ut=i.n(ct),dt=i(47750),pt=i(88677),gt=i.n(pt),mt=i(54770),pe=i.n(mt),U=i(44526),ft=i(68192),ge=i.n(ft);const D=({description:n,installMessage:o,disabled:s,handleCopy:g,pluginName:m})=>t.createElement(G.Tooltip,{"data-testid":`tooltip-${m}`,description:n},t.createElement(u.Box,null,t.createElement(U.Button,{size:"S",startIcon:t.createElement(ge(),null),variant:"secondary",disabled:s,onClick:g},o))),Q=({strapiPeerDepVersion:n,strapiAppVersion:o,handleCopy:s,pluginName:g})=>{const{formatMessage:m}=(0,p.useIntl)(),y=pe().validRange(n),v=pe().satisfies(o,y),d=m({id:"admin.pages.MarketPlacePage.plugin.copy",defaultMessage:"Copy install command"});if(o){if(!y)return t.createElement(D,{installMessage:d,pluginName:g,description:m({id:"admin.pages.MarketPlacePage.plugin.version.null",defaultMessage:'Unable to verify compatibility with your Strapi version: "{strapiAppVersion}"'},{strapiAppVersion:o}),handleCopy:s});if(!v)return t.createElement(D,{installMessage:d,pluginName:g,description:m({id:"admin.pages.MarketPlacePage.plugin.version",defaultMessage:'Update your Strapi version: "{strapiAppVersion}" to: "{versionRange}"'},{strapiAppVersion:o,versionRange:y}),disabled:!0})}return t.createElement(U.Button,{size:"S",startIcon:t.createElement(ge(),null),variant:"secondary",onClick:s},d)};D.defaultProps={disabled:!1,handleCopy:null},D.propTypes={description:l().string.isRequired,installMessage:l().string.isRequired,disabled:l().bool,handleCopy:l().func,pluginName:l().string.isRequired},Q.defaultProps={strapiAppVersion:null,strapiPeerDepVersion:null},Q.propTypes={strapiAppVersion:l().string,strapiPeerDepVersion:l().string,handleCopy:l().func.isRequired,pluginName:l().string.isRequired};const vt=Q,W=({isInstalled:n,isInDevelopmentMode:o,commandToCopy:s,strapiAppVersion:g,strapiPeerDepVersion:m,pluginName:y})=>{const v=(0,e.useNotification)(),{formatMessage:d}=(0,p.useIntl)(),{trackUsage:h}=(0,e.useTracking)(),E=()=>{navigator.clipboard.writeText(s),h("willInstallPlugin"),v({type:"success",message:{id:"admin.pages.MarketPlacePage.plugin.copy.success"}})};return n?t.createElement(u.Box,{paddingLeft:4},t.createElement(B.Icon,{as:gt(),marginRight:2,width:12,height:12,color:"success600"}),t.createElement(T.Typography,{variant:"omega",textColor:"success600",fontWeight:"bold"},d({id:"admin.pages.MarketPlacePage.plugin.installed",defaultMessage:"Installed"}))):o?t.createElement(vt,{strapiAppVersion:g,strapiPeerDepVersion:m,handleCopy:E,pluginName:y}):null};W.defaultProps={strapiAppVersion:null,strapiPeerDepVersion:null},W.propTypes={isInstalled:l().bool.isRequired,isInDevelopmentMode:l().bool.isRequired,commandToCopy:l().string.isRequired,strapiAppVersion:l().string,strapiPeerDepVersion:l().string,pluginName:l().string.isRequired};const ht=W;var Pt=i(27635),yt=i(62030),Et=i.n(yt),Mt=i(7650),bt=i.n(Mt),kt=i(49833),xt=i.n(kt);const St=(0,F.default)(Pt.Divider)`
|
|
5
|
-
width: ${(0,e.pxToRem)(12)};
|
|
6
|
-
transform: rotate(90deg);
|
|
7
|
-
`,Y=({githubStars:n,npmDownloads:o,npmPackageType:s})=>{const{formatMessage:g}=(0,p.useIntl)();return t.createElement(H.Stack,{horizontal:!0,spacing:1},!!n&&t.createElement(t.Fragment,null,t.createElement(B.Icon,{as:Et(),height:(0,e.pxToRem)(12),width:(0,e.pxToRem)(12),"aria-hidden":!0}),t.createElement(B.Icon,{as:xt(),height:(0,e.pxToRem)(12),width:(0,e.pxToRem)(12),color:"warning500","aria-hidden":!0}),t.createElement("p",{"aria-label":g({id:`admin.pages.MarketPlacePage.${s}.githubStars`,defaultMessage:"This {package} was starred {starsCount} on GitHub"},{starsCount:n,package:s})},t.createElement(T.Typography,{variant:"pi",textColor:"neutral800",lineHeight:16},n)),t.createElement(St,{unsetMargin:!1,background:"neutral200"})),t.createElement(B.Icon,{as:bt(),height:(0,e.pxToRem)(12),width:(0,e.pxToRem)(12),"aria-hidden":!0}),t.createElement("p",{"aria-label":g({id:`admin.pages.MarketPlacePage.${s}.downloads`,defaultMessage:"This {package} has {downloadsCount} weekly downloads"},{downloadsCount:o,package:s})},t.createElement(T.Typography,{variant:"pi",textColor:"neutral800",lineHeight:16},o)))};Y.defaultProps={githubStars:0,npmDownloads:0},Y.propTypes={githubStars:l().number,npmDownloads:l().number,npmPackageType:l().string.isRequired};const Tt=Y,Rt=(0,F.default)(T.Typography)`
|
|
8
|
-
/* stylelint-disable value-no-vendor-prefix, property-no-vendor-prefix */
|
|
9
|
-
display: -webkit-box;
|
|
10
|
-
-webkit-box-orient: vertical;
|
|
11
|
-
-webkit-line-clamp: 2;
|
|
12
|
-
/* stylelint-enable value-no-vendor-prefix, property-no-vendor-prefix */
|
|
13
|
-
overflow: hidden;
|
|
14
|
-
`,Z=({npmPackage:n,isInstalled:o,useYarn:s,isInDevelopmentMode:g,npmPackageType:m,strapiAppVersion:y})=>{const{attributes:v}=n,{formatMessage:d}=(0,p.useIntl)(),{trackUsage:h}=(0,e.useTracking)(),E=s?`yarn add ${v.npmPackageName}`:`npm install ${v.npmPackageName}`,x=d({id:"admin.pages.MarketPlacePage.plugin.tooltip.madeByStrapi",defaultMessage:"Made by Strapi"}),N=`https://market.strapi.io/${it().plural(m)}/${v.slug}`;return t.createElement(R.Flex,{direction:"column",justifyContent:"space-between",paddingTop:4,paddingRight:4,paddingBottom:4,paddingLeft:4,hasRadius:!0,background:"neutral0",shadow:"tableShadow",height:"100%",alignItems:"normal","data-testid":"npm-package-card"},t.createElement(u.Box,null,t.createElement(R.Flex,{direction:"row",justifyContent:"space-between",alignItems:"flex-start"},t.createElement(u.Box,{as:"img",src:v.logo.url,alt:`${v.name} logo`,hasRadius:!0,width:11,height:11}),t.createElement(Tt,{githubStars:v.githubStars,npmDownloads:v.npmDownloads,npmPackageType:m})),t.createElement(u.Box,{paddingTop:4},t.createElement(T.Typography,{as:"h3",variant:"delta"},t.createElement(R.Flex,{alignItems:"center"},v.name,v.validated&&!v.madeByStrapi&&t.createElement(G.Tooltip,{description:d({id:"admin.pages.MarketPlacePage.plugin.tooltip.verified",defaultMessage:"Plugin verified by Strapi"})},t.createElement(R.Flex,null,t.createElement(B.Icon,{as:ut(),marginLeft:2,color:"success600"}))),v.madeByStrapi&&t.createElement(G.Tooltip,{description:x},t.createElement(R.Flex,null,t.createElement(u.Box,{as:"img",src:dt,alt:x,marginLeft:1,width:6,height:"auto"})))))),t.createElement(u.Box,{paddingTop:2},t.createElement(Rt,{as:"p",variant:"omega",textColor:"neutral600"},v.description))),t.createElement(H.Stack,{horizontal:!0,spacing:2,style:{alignSelf:"flex-end"},paddingTop:6},t.createElement(re.LinkButton,{size:"S",href:N,isExternal:!0,endIcon:t.createElement(ue(),null),"aria-label":d({id:"admin.pages.MarketPlacePage.plugin.info.label",defaultMessage:"Learn more about {pluginName}"},{pluginName:v.name}),variant:"tertiary",onClick:()=>h("didPluginLearnMore")},d({id:"admin.pages.MarketPlacePage.plugin.info.text",defaultMessage:"More"})),t.createElement(ht,{isInstalled:o,isInDevelopmentMode:g,commandToCopy:E,strapiAppVersion:y,strapiPeerDepVersion:v.strapiVersion,pluginName:v.name})))};Z.defaultProps={isInDevelopmentMode:!1,strapiAppVersion:null},Z.propTypes={npmPackage:l().shape({id:l().string.isRequired,attributes:l().shape({name:l().string.isRequired,description:l().string.isRequired,slug:l().string.isRequired,npmPackageName:l().string.isRequired,npmPackageUrl:l().string.isRequired,repositoryUrl:l().string.isRequired,logo:l().object.isRequired,developerName:l().string.isRequired,validated:l().bool.isRequired,madeByStrapi:l().bool.isRequired,strapiCompatibility:l().oneOf(["v3","v4"]),strapiVersion:l().string,githubStars:l().number,npmDownloads:l().number}).isRequired}).isRequired,isInstalled:l().bool.isRequired,useYarn:l().bool.isRequired,isInDevelopmentMode:l().bool,npmPackageType:l().string.isRequired,strapiAppVersion:l().string};const Ot=Z,K=({npmPackages:n,installedPackageNames:o,useYarn:s,isInDevelopmentMode:g,npmPackageType:m,strapiAppVersion:y})=>{const v=(0,t.useCallback)(d=>o.includes(d),[o]);return t.createElement(de.Grid,{gap:4},n.map(d=>t.createElement(de.GridItem,{col:4,s:6,xs:12,style:{height:"100%"},key:d.id},t.createElement(Ot,{npmPackage:d,isInstalled:v(d.attributes.npmPackageName),useYarn:s,isInDevelopmentMode:g,npmPackageType:m,strapiAppVersion:y}))))};K.defaultProps={installedPackageNames:[],strapiAppVersion:null},K.propTypes={npmPackages:l().array.isRequired,installedPackageNames:l().arrayOf(l().string),useYarn:l().bool.isRequired,isInDevelopmentMode:l().bool.isRequired,npmPackageType:l().string.isRequired,strapiAppVersion:l().string};const me=K;var A=i(25716);const Ct=(0,F.default)(u.Box)`
|
|
15
|
-
font-weight: ${({theme:n})=>n.fontWeights.semiBold};
|
|
16
|
-
|
|
17
|
-
span {
|
|
18
|
-
font-size: ${({theme:n})=>n.fontSizes[1]};
|
|
19
|
-
}
|
|
20
|
-
`,fe=({sortQuery:n,handleSelectChange:o})=>{const{formatMessage:s}=(0,p.useIntl)(),g={"name:asc":{selected:{id:"admin.pages.MarketPlacePage.sort.alphabetical.selected",defaultMessage:"Sort by alphabetical order"},option:{id:"admin.pages.MarketPlacePage.sort.alphabetical",defaultMessage:"Alphabetical order"}},"submissionDate:desc":{selected:{id:"admin.pages.MarketPlacePage.sort.newest.selected",defaultMessage:"Sort by newest"},option:{id:"admin.pages.MarketPlacePage.sort.newest",defaultMessage:"Newest"}}};return t.createElement(Ct,null,t.createElement(A.Select,{size:"S",id:"sort-by-select",value:n,customizeContent:()=>s(g[n].selected),onChange:m=>{o({sort:m})}},Object.entries(g).map(([m,y])=>t.createElement(A.Option,{key:m,value:m},s(y.option)))))};fe.propTypes={sortQuery:l().string.isRequired,handleSelectChange:l().func.isRequired};const jt=fe;var Bt=i(14982),It=i(94009),wt=i.n(It),Nt=i(23899),Lt=i.n(Nt),Ft=i(37853),Dt=i(54742);const ve=({message:n,value:o,onChange:s,possibleFilters:g,onClear:m,customizeContent:y})=>{const v=(d,h)=>`${d} (${h})`;return t.createElement(A.Select,{"aria-label":n,placeholder:n,size:"M",onChange:s,onClear:m,value:o,customizeContent:y,multi:!0},Object.entries(g).map(([d,h])=>t.createElement(A.Option,{key:d,value:d},v(d,h))))};ve.propTypes={message:l().string.isRequired,value:l().array.isRequired,onChange:l().func.isRequired,possibleFilters:l().object.isRequired,onClear:l().func.isRequired,customizeContent:l().func.isRequired};const he=ve,Pe=({source:n,onToggle:o,query:s,npmPackageType:g,possibleCategories:m,possibleCollections:y,handleSelectChange:v,handleSelectClear:d})=>{const{formatMessage:h}=(0,p.useIntl)();return t.createElement(Ft.Popover,{source:n,padding:3,spacing:4,onBlur:()=>{}},t.createElement(Dt.FocusTrap,{onEscape:o},t.createElement(H.Stack,{spacing:1},t.createElement(u.Box,null,t.createElement(he,{message:h({id:"admin.pages.MarketPlacePage.filters.collections",defaultMessage:"Collections"}),value:(s==null?void 0:s.collections)||[],onChange:E=>{v({collections:E})},onClear:()=>d("collections"),possibleFilters:y,customizeContent:E=>h({id:"admin.pages.MarketPlacePage.filters.collectionsSelected",defaultMessage:"{count, plural, =0 {No collections} one {# collection} other {# collections}} selected"},{count:E.length})})),g==="plugin"&&t.createElement(u.Box,null,t.createElement(he,{message:h({id:"admin.pages.MarketPlacePage.filters.categories",defaultMessage:"Categories"}),value:(s==null?void 0:s.categories)||[],onChange:E=>{v({categories:E})},onClear:()=>d("categories"),possibleFilters:m,customizeContent:E=>h({id:"admin.pages.MarketPlacePage.filters.categoriesSelected",defaultMessage:"{count, plural, =0 {No categories} one {# category} other {# categories}} selected"},{count:E.length}),name:"categories"})))))};Pe.propTypes={onToggle:l().func.isRequired,source:l().shape({current:l().instanceOf(Element)}).isRequired,query:l().object.isRequired,npmPackageType:l().oneOf(["plugin","provider"]).isRequired,possibleCollections:l().object.isRequired,possibleCategories:l().object.isRequired,handleSelectChange:l().func.isRequired,handleSelectClear:l().func.isRequired};const At=Pe,J=({name:n,handleRemove:o})=>t.createElement(u.Box,{padding:1},t.createElement(Bt.Tag,{icon:t.createElement(wt(),null),onClick:o},n)),zt=(0,F.default)(U.Button)`
|
|
21
|
-
height: ${({theme:n})=>n.sizes.input.S};
|
|
22
|
-
`,ye=({possibleCollections:n,possibleCategories:o,npmPackageType:s,query:g,handleSelectClear:m,handleSelectChange:y})=>{var v,d;const[h,E]=(0,t.useState)(!1),x=(0,t.useRef)(),{formatMessage:N}=(0,p.useIntl)(),z=()=>E(M=>!M),L=(M,O)=>{const V={[O]:g[O].filter(q=>q!==M)};y(V)};return t.createElement(t.Fragment,null,t.createElement(u.Box,{paddingTop:1,paddingBottom:1},t.createElement(zt,{variant:"tertiary",ref:x,startIcon:t.createElement(Lt(),null),onClick:z,size:"S"},N({id:"app.utils.filters",defaultMessage:"Filters"})),h&&t.createElement(At,{onToggle:z,source:x,query:g,handleSelectClear:m,handleSelectChange:y,possibleCollections:n,possibleCategories:o,npmPackageType:s})),(v=g.collections)==null?void 0:v.map(M=>t.createElement(J,{name:M,key:M,handleRemove:()=>L(M,"collections")})),s==="plugin"&&((d=g.categories)==null?void 0:d.map(M=>t.createElement(J,{name:M,key:M,handleRemove:()=>L(M,"categories")}))))};J.propTypes={name:l().string.isRequired,handleRemove:l().func.isRequired},ye.propTypes={npmPackageType:l().oneOf(["plugin","provider"]).isRequired,possibleCollections:l().object.isRequired,possibleCategories:l().object.isRequired,query:l().object.isRequired,handleSelectChange:l().func.isRequired,handleSelectClear:l().func.isRequired};const Vt=ye;var $t=Object.defineProperty,Ht=Object.defineProperties,Gt=Object.getOwnPropertyDescriptors,Ee=Object.getOwnPropertySymbols,Ut=Object.prototype.hasOwnProperty,Qt=Object.prototype.propertyIsEnumerable,Me=(n,o,s)=>o in n?$t(n,o,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[o]=s,I=(n,o)=>{for(var s in o||(o={}))Ut.call(o,s)&&Me(n,s,o[s]);if(Ee)for(var s of Ee(o))Qt.call(o,s)&&Me(n,s,o[s]);return n},X=(n,o)=>Ht(n,Gt(o));const be=(n,o)=>(0,r.ZP)(n,o,{keys:[{threshold:r.ZP.rankings.WORD_STARTS_WITH,key:"attributes.name"},{threshold:r.ZP.rankings.WORD_STARTS_WITH,key:"attributes.description"}],baseSort:(s,g)=>s.index<g.index?-1:1}),ke=()=>{const{formatMessage:n}=(0,p.useIntl)(),{trackUsage:o}=(0,e.useTracking)(),{notifyStatus:s}=(0,b.useNotifyAT)(),g=(0,t.useRef)(o),m=(0,e.useNotification)(),[y,v]=(0,t.useState)(""),[{query:d},h]=(0,e.useQueryParams)(),{autoReload:E,dependencies:x,useYarn:N,strapiVersion:z}=(0,e.useAppInfos)(),L=at(),M=(d==null?void 0:d.npmPackageType)||"plugin",[O,V]=(0,t.useState)({plugin:M==="plugin"?I({},d):{},provider:M==="provider"?I({},d):{}});(0,e.useFocusWhenNavigate)();const q=n({id:"global.marketplace",defaultMessage:"Marketplace"}),xe=()=>{s(n({id:"app.utils.notify.data-loaded",defaultMessage:"The {target} has loaded"},{target:q}))},{status:Se,data:Te}=He(xe,O.provider),{status:Re,data:_}=_e(xe,O.plugin),Yt=[Re,Se].includes("loading"),Zt=[Re,Se].includes("error");if((0,t.useEffect)(()=>{g.current("didGoToMarketplace")},[]),(0,t.useEffect)(()=>{E||m({type:"info",message:{id:"admin.pages.MarketPlacePage.production",defaultMessage:"Manage plugins from the development environment"},blockTransition:!0})},[m,E]),!L)return t.createElement(a.Layout,null,t.createElement(c.Main,null,t.createElement(oe,{isOnline:L}),t.createElement(R.Flex,{width:"100%",direction:"column",alignItems:"center",justifyContent:"center",style:{paddingTop:"120px"}},t.createElement(u.Box,{paddingBottom:2},t.createElement(T.Typography,{textColor:"neutral700",variant:"alpha"},n({id:"admin.pages.MarketPlacePage.offline.title",defaultMessage:"You are offline"}))),t.createElement(u.Box,{paddingBottom:6},t.createElement(T.Typography,{textColor:"neutral700",variant:"epsilon"},n({id:"admin.pages.MarketPlacePage.offline.subtitle",defaultMessage:"You need to be connected to the Internet to access Strapi Market."}))),t.createElement("img",{src:tt,alt:"offline",style:{width:"88px",height:"88px"}}))));if(Zt)return t.createElement(a.Layout,null,t.createElement(a.ContentLayout,null,t.createElement(u.Box,{paddingTop:8},t.createElement(e.AnErrorOccurred,null))));if(Yt)return t.createElement(a.Layout,null,t.createElement(c.Main,{"aria-busy":!0},t.createElement(e.LoadingIndicatorPage,null)));const ee=be(_.data,y),te=be(Te.data,y),Oe=n({id:"admin.pages.MarketPlacePage.search.empty",defaultMessage:'No result for "{target}"'},{target:y}),Kt=C=>{const k=C===0?"plugin":"provider",_t=O[k]&&Object.keys(O[k]).length;h(_t?X(I({},O[k]),{npmPackageType:k}):{npmPackageType:k,collections:[],categories:[],sort:"name:asc"})},Ce=C=>{h(C),V(k=>X(I({},k),{[M]:I(I({},k[M]),C)}))},Jt=C=>{h({[C]:[]},"remove"),V(k=>X(I({},k),{[M]:{}}))},je=Object.keys(x),Xt=M==="plugin"?_.meta.collections:Te.meta.collections,qt=_.meta.categories;return t.createElement(a.Layout,null,t.createElement(c.Main,null,t.createElement(f.Helmet,{title:n({id:"admin.pages.MarketPlacePage.helmet",defaultMessage:"Marketplace - Plugins"})}),t.createElement(oe,{isOnline:L,npmPackageType:M}),t.createElement(a.ContentLayout,null,t.createElement(u.Box,{width:"25%",paddingBottom:4},t.createElement(P.Searchbar,{name:"searchbar",onClear:()=>v(""),value:y,onChange:C=>v(C.target.value),clearLabel:n({id:"admin.pages.MarketPlacePage.search.clear",defaultMessage:"Clear the search"}),placeholder:n({id:"admin.pages.MarketPlacePage.search.placeholder",defaultMessage:"Search"})},n({id:"admin.pages.MarketPlacePage.search.placeholder",defaultMessage:"Search"}))),t.createElement(j.TabGroup,{label:n({id:"admin.pages.MarketPlacePage.tab-group.label",defaultMessage:"Plugins and Providers for Strapi"}),id:"tabs",variant:"simple",initialSelectedTabIndex:["plugin","provider"].indexOf(M),onTabChange:Kt},t.createElement(u.Box,{paddingBottom:4},t.createElement(j.Tabs,null,t.createElement(j.Tab,null,n({id:"admin.pages.MarketPlacePage.plugins",defaultMessage:"Plugins"})," ","(",ee.length,")"),t.createElement(j.Tab,null,n({id:"admin.pages.MarketPlacePage.providers",defaultMessage:"Providers"})," ","(",te.length,")"))),t.createElement(R.Flex,{paddingBottom:4,gap:2},t.createElement(jt,{sortQuery:(d==null?void 0:d.sort)||"name:asc",handleSelectChange:Ce}),t.createElement(Vt,{npmPackageType:M,possibleCollections:Xt,possibleCategories:qt,query:d||{},handleSelectChange:Ce,handleSelectClear:Jt})),t.createElement(j.TabPanels,null,t.createElement(j.TabPanel,null,y.length>0&&!ee.length?t.createElement(ne,{content:Oe}):t.createElement(me,{npmPackages:ee,installedPackageNames:je,useYarn:N,isInDevelopmentMode:E,npmPackageType:"plugin",strapiAppVersion:z})),t.createElement(j.TabPanel,null,y.length>0&&!te.length?t.createElement(ne,{content:Oe}):t.createElement(me,{npmPackages:te,installedPackageNames:je,useYarn:N,isInDevelopmentMode:E,npmPackageType:"provider"})))),t.createElement(u.Box,{paddingTop:7},t.createElement(st,null)))))},Wt=()=>t.createElement(e.CheckPagePermissions,{permissions:et.Z.marketplace.main},t.createElement(ke,null))}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_strapi_admin=self.webpackChunk_strapi_admin||[]).push([[3677],{15415:(A,h,t)=>{t.r(h),t.d(h,{default:()=>F});var e=t(32735),g=t(88425),E=t(99357),v=t(5636),P=t(83983),T=t(29270),d=t(11856),y=t(16540),c=t(95602),a=t(53214),M=t(84968),L=t(17247),b=(n,s,l)=>new Promise((p,r)=>{var f=i=>{try{o(l.next(i))}catch(u){r(u)}},m=i=>{try{o(l.throw(i))}catch(u){r(u)}},o=i=>i.done?p(i.value):Promise.resolve(i.value).then(f,m);o((l=l.apply(n,s)).next())});const C=()=>b(void 0,null,function*(){const{data:n}=yield L.be.get("/admin/plugins");return n}),I=n=>{const s=(0,g.useNotification)();return(0,M.useQuery)("list-enabled-plugins",()=>C(),{onSuccess(){n&&n()},onError(){s({type:"warning",message:{id:"notification.error",defaultMessage:"An error occured"}})}})},N=()=>{var n,s;const{formatMessage:l}=(0,v.useIntl)(),{notifyStatus:p}=(0,T.useNotifyAT)();(0,g.useFocusWhenNavigate)();const r=l({id:"global.plugins",defaultMessage:"Plugins"}),f=()=>{p(l({id:"app.utils.notify.data-loaded",defaultMessage:"The {target} has loaded"},{target:r}))},{status:m,data:o}=I(f);return m!=="success"&&m!=="error"?e.createElement(d.Layout,null,e.createElement(y.Main,{"aria-busy":!0},e.createElement(g.LoadingIndicatorPage,null))):e.createElement(d.Layout,null,e.createElement(y.Main,null,e.createElement(d.HeaderLayout,{title:r,subtitle:l({id:"app.components.ListPluginsPage.description",defaultMessage:"List of the installed plugins in the project."})}),e.createElement(d.ContentLayout,null,e.createElement(a.Table,{colCount:2,rowCount:(s=(n=o==null?void 0:o.plugins)==null?void 0:n.length)!=null?s:0+1},e.createElement(a.Thead,null,e.createElement(a.Tr,null,e.createElement(a.Th,null,e.createElement(c.Typography,{variant:"sigma",textColor:"neutral600"},l({id:"global.name",defaultMessage:"Name"}))),e.createElement(a.Th,null,e.createElement(c.Typography,{variant:"sigma",textColor:"neutral600"},l({id:"global.description",defaultMessage:"description"}))))),e.createElement(a.Tbody,null,o.plugins.map(({name:u,displayName:x,description:H})=>e.createElement(a.Tr,{key:u},e.createElement(a.Td,null,e.createElement(c.Typography,{textColor:"neutral800",variant:"omega",fontWeight:"bold"},l({id:`global.plugins.${u}`,defaultMessage:x}))),e.createElement(a.Td,null,e.createElement(c.Typography,{textColor:"neutral800"},l({id:`global.plugins.${u}.description`,defaultMessage:H}))))))))))},F=()=>{const{formatMessage:n}=(0,v.useIntl)(),s=n({id:"global.plugins",defaultMessage:"Plugins"});return e.createElement(g.CheckPagePermissions,{permissions:P.Z.marketplace.main},e.createElement(E.Helmet,{title:s}),e.createElement(N,null))}}}]);
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_strapi_admin=self.webpackChunk_strapi_admin||[]).push([[9497],{9972:(pe,j,t)=>{t.r(j),t.d(j,{default:()=>De});var e=t(32735),f=t(19615),p=t(88425),Z=t(5636),U=t(83281),G=t(23940),V=t.n(G),I=t(84968),D=t(88423),B=t.n(D),N=t(99357),L=t(16540),b=t(95602),O=t(9808),A=t(11856),z=t(44526),u=t(78330),E=t(90662),Q=t(29270),S=t(25716),W=t(20001),X=t(37178),R=t(33912),M=t.n(R),Y=t(37341),F=t.n(Y),$=t(88677),d=t.n($),s=t(20139),i=t(775),fe=t(9086),ge=t.n(fe),ee=t(17247),he=Object.defineProperty,ve=Object.defineProperties,Pe=Object.getOwnPropertyDescriptors,te=Object.getOwnPropertySymbols,ye=Object.prototype.hasOwnProperty,we=Object.prototype.propertyIsEnumerable,ae=(r,n,a)=>n in r?he(r,n,{enumerable:!0,configurable:!0,writable:!0,value:a}):r[n]=a,Ee=(r,n)=>{for(var a in n||(n={}))ye.call(n,a)&&ae(r,a,n[a]);if(te)for(var a of te(n))we.call(n,a)&&ae(r,a,n[a]);return r},Se=(r,n)=>ve(r,Pe(n)),re=(r,n,a)=>new Promise((T,y)=>{var C=m=>{try{v(a.next(m))}catch(w){y(w)}},x=m=>{try{v(a.throw(m))}catch(w){y(w)}},v=m=>m.done?T(m.value):Promise.resolve(m.value).then(C,x);v((a=a.apply(r,n)).next())});const Oe=()=>re(void 0,null,function*(){const{data:r}=yield ee.be.get("/admin/users/me");return r.data}),Me=r=>re(void 0,null,function*(){const n=ge()(r,["confirmPassword","currentTheme"]),{data:a}=yield ee.be.put("/admin/users/me",n);return Se(Ee({},a.data),{currentTheme:r.currentTheme})});var Ie=t(5173),Le=t(1057);const be=Ie.Ry().shape(Le.Rw);var ne=t(7602),Ae=Object.defineProperty,Te=Object.defineProperties,Ce=Object.getOwnPropertyDescriptors,se=Object.getOwnPropertySymbols,xe=Object.prototype.hasOwnProperty,je=Object.prototype.propertyIsEnumerable,oe=(r,n,a)=>n in r?Ae(r,n,{enumerable:!0,configurable:!0,writable:!0,value:a}):r[n]=a,le=(r,n)=>{for(var a in n||(n={}))xe.call(n,a)&&oe(r,a,n[a]);if(se)for(var a of se(n))je.call(n,a)&&oe(r,a,n[a]);return r},ie=(r,n)=>Te(r,Ce(n)),de=(r,n,a)=>new Promise((T,y)=>{var C=m=>{try{v(a.next(m))}catch(w){y(w)}},x=m=>{try{v(a.throw(m))}catch(w){y(w)}},v=m=>m.done?T(m.value):Promise.resolve(m.value).then(C,x);v((a=a.apply(r,n)).next())});const Ge=f.default.a`
|
|
2
|
-
color: ${({theme:r})=>r.colors.primary600};
|
|
3
|
-
`,J=(0,f.default)(X.TextInput)`
|
|
4
|
-
::-ms-reveal {
|
|
5
|
-
display: none;
|
|
6
|
-
}
|
|
7
|
-
`,K=(0,f.default)(W.FieldAction)`
|
|
8
|
-
svg {
|
|
9
|
-
height: 1rem;
|
|
10
|
-
width: 1rem;
|
|
11
|
-
path {
|
|
12
|
-
fill: ${({theme:r})=>r.colors.neutral600};
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
`,De=()=>{const[r,n]=(0,e.useState)(!1),[a,T]=(0,e.useState)(!1),[y,C]=(0,e.useState)(!1),{changeLocale:x,localeNames:v}=(0,s.Z)(),{setUserDisplayName:m}=(0,p.useAppInfos)(),w=(0,I.useQueryClient)(),{formatMessage:o}=(0,Z.useIntl)(),{trackUsage:Be}=(0,p.useTracking)(),k=(0,p.useNotification)(),{lockApp:Ne,unlockApp:Re}=(0,p.useOverlayBlocker)(),{notifyStatus:Fe}=(0,Q.useNotifyAT)(),{currentTheme:He,themes:ce,onChangeTheme:Ze}=(0,i.M1)();(0,p.useFocusWhenNavigate)();const{status:Ue,data:H}=(0,I.useQuery)("user",()=>Oe(),{onSuccess(){Fe(o({id:"Settings.profile.form.notify.data.loaded",defaultMessage:"Your profile data has been loaded"}))},onError(){k({type:"warning",message:{id:"notification.error",defaultMessage:"An error occured"}})}}),Ve=Ue!=="success",me=(0,I.useMutation)(l=>Me(l),{onSuccess(l){return de(this,null,function*(){yield w.invalidateQueries("user"),p.auth.setUserInfo(B()(l,["email","firstname","lastname","username","preferedLanguage"]));const g=l.username||(0,ne.Pp)(l.firstname,l.lastname);m(g),x(l.preferedLanguage),Ze(l.currentTheme),Be("didChangeMode",{newMode:l.currentTheme}),k({type:"success",message:{id:"notification.success.saved",defaultMessage:"Saved"}})})},onSettled(){Re()},refetchActive:!0}),{isLoading:ze}=me,Qe=(l,g)=>de(void 0,[l,g],function*(h,{setErrors:q}){Ne();const c=h.username||null;me.mutate(ie(le({},h),{username:c}),{onError(P){var ue;const _=(ue=P==null?void 0:P.response)==null?void 0:ue.data;return _!=null&&_.data?q(_.data):k({type:"warning",message:{id:"notification.error",defaultMessage:"An error occured"}})}})}),We=["currentTheme","email","firstname","lastname","username","preferedLanguage"],Xe=B()(ie(le({},H),{currentTheme:He}),We);if(Ve)return e.createElement(L.Main,{"aria-busy":"true"},e.createElement(N.Helmet,{title:o({id:"Settings.profile.form.section.helmet.title",defaultMessage:"User profile"})}),e.createElement(A.HeaderLayout,{title:o({id:"Settings.profile.form.section.profile.page.title",defaultMessage:"Profile page"})}),e.createElement(A.ContentLayout,null,e.createElement(p.LoadingIndicatorPage,null)));const Ye=Object.keys(ce).filter(l=>ce[l]);return e.createElement(L.Main,{"aria-busy":ze},e.createElement(N.Helmet,{title:o({id:"Settings.profile.form.section.helmet.title",defaultMessage:"User profile"})}),e.createElement(U.Formik,{onSubmit:Qe,initialValues:Xe,validateOnChange:!1,validationSchema:be,enableReinitialize:!0},({errors:l,values:g,handleChange:h,isSubmitting:q})=>e.createElement(p.Form,null,e.createElement(A.HeaderLayout,{title:H.username||(0,ne.Pp)(H.firstname,H.lastname),primaryAction:e.createElement(z.Button,{startIcon:e.createElement(d(),null),loading:q,type:"submit"},o({id:"global.save",defaultMessage:"Save"}))}),e.createElement(O.Box,{paddingBottom:10},e.createElement(A.ContentLayout,null,e.createElement(E.Stack,{spacing:6},e.createElement(O.Box,{background:"neutral0",hasRadius:!0,shadow:"filterShadow",paddingTop:6,paddingBottom:6,paddingLeft:7,paddingRight:7},e.createElement(E.Stack,{spacing:4},e.createElement(b.Typography,{variant:"delta",as:"h2"},o({id:"global.profile",defaultMessage:"Profile"})),e.createElement(u.Grid,{gap:5},e.createElement(u.GridItem,{s:12,col:6},e.createElement(p.GenericInput,{intlLabel:{id:"Auth.form.firstname.label",defaultMessage:"First name"},error:l.firstname,onChange:h,value:g.firstname||"",type:"text",name:"firstname",required:!0})),e.createElement(u.GridItem,{s:12,col:6},e.createElement(p.GenericInput,{intlLabel:{id:"Auth.form.lastname.label",defaultMessage:"Last name"},error:l.lastname,onChange:h,value:g.lastname||"",type:"text",name:"lastname"})),e.createElement(u.GridItem,{s:12,col:6},e.createElement(p.GenericInput,{intlLabel:{id:"Auth.form.email.label",defaultMessage:"Email"},error:l.email,onChange:h,value:g.email||"",type:"email",name:"email",required:!0})),e.createElement(u.GridItem,{s:12,col:6},e.createElement(p.GenericInput,{intlLabel:{id:"Auth.form.username.label",defaultMessage:"Username"},error:l.username,onChange:h,value:g.username||"",type:"text",name:"username"}))))),e.createElement(O.Box,{background:"neutral0",hasRadius:!0,shadow:"filterShadow",paddingTop:6,paddingBottom:6,paddingLeft:7,paddingRight:7},e.createElement(E.Stack,{spacing:4},e.createElement(b.Typography,{variant:"delta",as:"h2"},o({id:"global.change-password",defaultMessage:"Change password"})),e.createElement(u.Grid,{gap:5},e.createElement(u.GridItem,{s:12,col:6},e.createElement(J,{error:l.currentPassword?o({id:l.currentPassword,defaultMessage:l.currentPassword}):"",onChange:h,value:g.currentPassword||"",label:o({id:"Auth.form.currentPassword.label",defaultMessage:"Current Password"}),name:"currentPassword",type:y?"text":"password",endAction:e.createElement(K,{onClick:c=>{c.stopPropagation(),C(P=>!P)},label:o(y?{id:"Auth.form.password.show-password",defaultMessage:"Show password"}:{id:"Auth.form.password.hide-password",defaultMessage:"Hide password"})},y?e.createElement(M(),null):e.createElement(F(),null))}))),e.createElement(u.Grid,{gap:5},e.createElement(u.GridItem,{s:12,col:6},e.createElement(J,{error:l.password?o({id:l.password,defaultMessage:l.password}):"",onChange:h,value:g.password||"",label:o({id:"global.password",defaultMessage:"Password"}),name:"password",type:r?"text":"password",autoComplete:"new-password",endAction:e.createElement(K,{onClick:c=>{c.stopPropagation(),n(P=>!P)},label:o(r?{id:"Auth.form.password.show-password",defaultMessage:"Show password"}:{id:"Auth.form.password.hide-password",defaultMessage:"Hide password"})},r?e.createElement(M(),null):e.createElement(F(),null))})),e.createElement(u.GridItem,{s:12,col:6},e.createElement(J,{error:l.confirmPassword?o({id:l.confirmPassword,defaultMessage:l.confirmPassword}):"",onChange:h,value:g.confirmPassword||"",label:o({id:"Auth.form.confirmPassword.label",defaultMessage:"Password confirmation"}),name:"confirmPassword",type:a?"text":"password",autoComplete:"new-password",endAction:e.createElement(K,{onClick:c=>{c.stopPropagation(),T(P=>!P)},label:o(a?{id:"Auth.form.password.show-password",defaultMessage:"Show password"}:{id:"Auth.form.password.hide-password",defaultMessage:"Hide password"})},a?e.createElement(M(),null):e.createElement(F(),null))}))))),e.createElement(O.Box,{background:"neutral0",hasRadius:!0,shadow:"filterShadow",paddingTop:6,paddingBottom:6,paddingLeft:7,paddingRight:7},e.createElement(E.Stack,{spacing:4},e.createElement(E.Stack,{spacing:1},e.createElement(b.Typography,{variant:"delta",as:"h2"},o({id:"Settings.profile.form.section.experience.title",defaultMessage:"Experience"})),e.createElement(b.Typography,null,o({id:"Settings.profile.form.section.experience.interfaceLanguageHelp",defaultMessage:"Preference changes will apply only to you. More information is available {here}."},{here:e.createElement(Ge,{target:"_blank",rel:"noopener noreferrer",href:"https://docs.strapi.io/developer-docs/latest/development/admin-customization.html#locales"},o({id:"Settings.profile.form.section.experience.documentation",defaultMessage:"here"}))}))),e.createElement(u.Grid,{gap:5},e.createElement(u.GridItem,{s:12,col:6},e.createElement(S.Select,{label:o({id:"Settings.profile.form.section.experience.interfaceLanguage",defaultMessage:"Interface language"}),placeholder:o({id:"global.select",defaultMessage:"Select"}),hint:o({id:"Settings.profile.form.section.experience.interfaceLanguage.hint",defaultMessage:"This will only display your own interface in the chosen language."}),onClear:()=>{h({target:{name:"preferedLanguage",value:null}})},clearLabel:o({id:"Settings.profile.form.section.experience.clear.select",defaultMessage:"Clear the interface language selected"}),value:g.preferedLanguage,onChange:c=>{h({target:{name:"preferedLanguage",value:c}})}},Object.keys(v).map(c=>{const P=v[c];return e.createElement(S.Option,{value:c,key:c},P)}))),e.createElement(u.GridItem,{s:12,col:6},e.createElement(S.Select,{label:o({id:"Settings.profile.form.section.experience.mode.label",defaultMessage:"Interface mode"}),placeholder:o({id:"components.Select.placeholder",defaultMessage:"Select"}),hint:o({id:"Settings.profile.form.section.experience.mode.hint",defaultMessage:"Displays your interface in the chosen mode."}),value:g.currentTheme,onChange:c=>{h({target:{name:"currentTheme",value:c}})}},Ye.map(c=>e.createElement(S.Option,{value:c,key:c},o({id:"Settings.profile.form.section.experience.mode.option-label",defaultMessage:"{name} mode"},{name:o({id:c,defaultMessage:V()(c)})}))))))))))))))}},1057:(pe,j,t)=>{t.d(j,{YM:()=>$,Rw:()=>O});var e=t(5173),f=t(88425),p=Object.defineProperty,Z=Object.defineProperties,U=Object.getOwnPropertyDescriptors,G=Object.getOwnPropertySymbols,V=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable,D=(d,s,i)=>s in d?p(d,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):d[s]=i,B=(d,s)=>{for(var i in s||(s={}))V.call(s,i)&&D(d,i,s[i]);if(G)for(var i of G(s))I.call(s,i)&&D(d,i,s[i]);return d},N=(d,s)=>Z(d,U(s));const L={firstname:e.Z_().trim().required(f.translatedErrors.required),lastname:e.Z_(),email:e.Z_().email(f.translatedErrors.email).lowercase().required(f.translatedErrors.required),username:e.Z_().nullable(),password:e.Z_().min(8,f.translatedErrors.minLength).matches(/[a-z]/,"components.Input.error.contain.lowercase").matches(/[A-Z]/,"components.Input.error.contain.uppercase").matches(/\d/,"components.Input.error.contain.number"),confirmPassword:e.Z_().min(8,f.translatedErrors.minLength).oneOf([e.iH("password"),null],"components.Input.error.password.noMatch").when("password",(d,s)=>d?s.required(f.translatedErrors.required):s)},O=N(B({},L),{currentPassword:e.Z_().when(["password","confirmPassword"],(d,s,i)=>d||s?i.required(f.translatedErrors.required):i),preferedLanguage:e.Z_().nullable()}),z={roles:e.IX().min(1,f.translatedErrors.required).required(f.translatedErrors.required)};var u=Object.defineProperty,E=Object.defineProperties,Q=Object.getOwnPropertyDescriptors,S=Object.getOwnPropertySymbols,W=Object.prototype.hasOwnProperty,X=Object.prototype.propertyIsEnumerable,R=(d,s,i)=>s in d?u(d,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):d[s]=i,M=(d,s)=>{for(var i in s||(s={}))W.call(s,i)&&R(d,i,s[i]);if(S)for(var i of S(s))X.call(s,i)&&R(d,i,s[i]);return d},Y=(d,s)=>E(d,Q(s));const $=e.Ry().shape(M(Y(M({},L),{isActive:e.Xg()}),z))}}]);
|
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_strapi_admin=self.webpackChunk_strapi_admin||[]).push([[5895],{50020:(ue,O,a)=>{a.r(O),a.d(O,{SettingsPage:()=>en,default:()=>xn});var e=a(32735),C=a(88425),r=a(5141),ne=a(11856),$=a(5636),Me=a(99357),Ce=a(775),fe=a(7602),we=a(84968),K=a(16540),I=a(9808),P=a(78330),U=a(95602),le=a(90662),X=a(44526),ee=a(14983),Ve=a(82372),$e=a.n(Ve),ze=a(88677),Ee=a.n(ze),z=a(60216),y=a.n(z),ce=a(69898),Ge=a(20763),se=a(59290),q=a.n(se),ae=a(23101),lt=a.n(ae),Le=a(49415);const Xe={currentStep:void 0},je=(p=Xe,c)=>(0,Le.default)(p,l=>{switch(c.type){case"GO_TO":{l.currentStep=c.to;break}default:return l}});var pe=a(4122);const Ze={localImage:void 0},Qe=(p=Ze,c)=>(0,Le.default)(p,l=>{switch(c.type){case"SET_LOCAL_IMAGE":{l.localImage=c.value;break}default:return l}}),j=({onChangeLogo:p,customLogo:c,goTo:l,Component:h,modalTitle:u,next:T,prev:M,currentStep:A})=>{const[{localImage:v},R]=(0,e.useReducer)(Qe,Ze),{formatMessage:Se}=(0,$.useIntl)(),re=vt=>{R({type:"SET_LOCAL_IMAGE",value:vt})},et=()=>{l(null)};return A?e.createElement(pe.ModalLayout,{labelledBy:"modal",onClose:et},e.createElement(pe.ModalHeader,null,e.createElement(U.Typography,{fontWeight:"bold",as:"h2",id:"modal"},Se(u))),e.createElement(h,{setLocalImage:re,goTo:l,next:T,prev:M,onClose:et,asset:v||c,onChangeLogo:p})):null};j.defaultProps={Component:void 0,currentStep:void 0,customLogo:void 0,modalTitle:void 0,next:null,prev:null},j.propTypes={Component:y().elementType,currentStep:y().string,customLogo:y().shape({name:y().string,url:y().string,width:y().number,height:y().number,ext:y().string}),goTo:y().func.isRequired,modalTitle:y().shape({id:y().string,defaultMessage:y().string}),next:y().string,onChangeLogo:y().func.isRequired,prev:y().string};const W=j,F=750,Z=100,de=["image/jpeg","image/png","image/svg+xml"];var k=a(81700),Y=a(27635),me=a(19615),V=a(19192),be=a(78752),Ne=a(20001),at=a(22795),He=a.n(at),st=(p,c,l)=>new Promise((h,u)=>{var T=v=>{try{A(l.next(v))}catch(R){u(R)}},M=v=>{try{A(l.throw(v))}catch(R){u(R)}},A=v=>v.done?h(v.value):Promise.resolve(v.value).then(T,M);A((l=l.apply(p,c)).next())});const Je={id:"Settings.application.customization.modal.upload.error-format",defaultMessage:"Wrong format uploaded (accepted formats only: jpeg, jpg, png, svg)."},D={id:"Settings.application.customization.modal.upload.error-size",defaultMessage:"The file uploaded is too large (max dimension: {dimension}x{dimension}, max file size: {size}KB)"},H=p=>new Promise(c=>{const l=new FileReader;l.onload=()=>{const h=new Image;h.onload=function(){c({width:h.width,height:h.height})},h.src=l.result},l.readAsDataURL(p)}),f=(p,c)=>({ext:p.name.split(".").pop(),size:p.size/1e3,name:p.name,url:URL.createObjectURL(p),rawFile:p,width:c.width,height:c.height}),oe=p=>st(void 0,null,function*(){let c;if(!de.includes(p.type))throw c=new Error("File format"),c.displayMessage=Je,c;const h=yield H(p);if(!(h.width<=F&&h.height<=F))throw c=new Error("File sizing"),c.displayMessage=D,c;const T=f(p,h);if(!(T.size<=Z))throw c=new Error("File sizing"),c.displayMessage=D,c;return T});var Te=(p,c,l)=>new Promise((h,u)=>{var T=v=>{try{A(l.next(v))}catch(R){u(R)}},M=v=>{try{A(l.throw(v))}catch(R){u(R)}},A=v=>v.done?h(v.value):Promise.resolve(v.value).then(T,M);A((l=l.apply(p,c)).next())});const tt=(0,me.default)(Ne.FieldInput)`
|
|
2
|
-
opacity: 0;
|
|
3
|
-
position: absolute;
|
|
4
|
-
top: 0;
|
|
5
|
-
bottom: 0;
|
|
6
|
-
left: 0;
|
|
7
|
-
right: 0;
|
|
8
|
-
z-index: 1;
|
|
9
|
-
`,Ue=({setLocalImage:p,goTo:c,next:l,onClose:h})=>{const{formatMessage:u}=(0,$.useIntl)(),[T,M]=(0,e.useState)(!1),[A,v]=(0,e.useState)(void 0),R=(0,e.useRef)(null),Se=()=>M(!0),re=()=>M(!1),et=ot=>{ot.preventDefault(),R.current.click()},vt=()=>Te(void 0,null,function*(){re();const ot=R.current.files[0];if(!!ot)try{const ct=yield oe(ot);p(ct),c(l)}catch(ct){if(ct.displayMessage)v(u(ct.displayMessage,{size:Z,dimension:F})),R.current.focus();else throw ct}}),it=()=>T?"primary500":A?"danger600":"neutral300";return e.createElement(e.Fragment,null,e.createElement("form",null,e.createElement(I.Box,{paddingLeft:8,paddingRight:8,paddingTop:6,paddingBottom:6},e.createElement(Ne.Field,{name:"logo-upload",error:A},e.createElement("label",{htmlFor:"logo-upload"},e.createElement(le.Stack,{spacing:2},e.createElement(V.Flex,{paddingTop:9,paddingBottom:7,hasRadius:!0,justifyContent:"center",direction:"column",background:T?"primary100":"neutral100",borderColor:it(),borderStyle:"dashed",borderWidth:"1px",position:"relative",onDragEnter:Se,onDragLeave:re},e.createElement(be.Icon,{color:"primary600",width:`${60/16}rem`,height:`${60/16}rem`,as:He(),"aria-hidden":!0}),e.createElement(I.Box,{paddingTop:3,paddingBottom:5},e.createElement(U.Typography,{variant:"delta",as:"span"},u({id:"Settings.application.customization.modal.upload.drag-drop",defaultMessage:"Drag and Drop here or"}))),e.createElement(tt,{accept:de,cursor:"pointer",as:"input",type:"file",name:"files",tabIndex:-1,zIndex:1,onChange:vt,ref:R,id:"logo-upload"}),e.createElement(X.Button,{type:"button",onClick:et},u({id:"Settings.application.customization.modal.upload.cta.browse",defaultMessage:"Browse files"})),e.createElement(I.Box,{paddingTop:6},e.createElement(U.Typography,{variant:"pi",textColor:"neutral600"},u({id:"Settings.application.customization.modal.upload.file-validation",defaultMessage:"Max dimension: {dimension}x{dimension}, Max size: {size}KB"},{size:Z,dimension:F})))),e.createElement(Ne.FieldError,null)))))),e.createElement(pe.ModalFooter,{startActions:e.createElement(X.Button,{onClick:h,variant:"tertiary"},u({id:"Settings.application.customization.modal.cancel",defaultMessage:"Cancel"}))}))};Ue.defaultProps={next:null},Ue.propTypes={goTo:y().func.isRequired,next:y().string,onClose:y().func.isRequired,setLocalImage:y().func.isRequired};const _=Ue;var ge=a(37178),Ae=a(43653),Rt=a.n(Ae),wt=(p,c,l)=>new Promise((h,u)=>{var T=v=>{try{A(l.next(v))}catch(R){u(R)}},M=v=>{try{A(l.throw(v))}catch(R){u(R)}},A=v=>v.done?h(v.value):Promise.resolve(v.value).then(T,M);A((l=l.apply(p,c)).next())});const jt=p=>wt(void 0,null,function*(){try{const c=yield Rt().get(p,{responseType:"blob",timeout:8e3});return new File([c.data],c.config.url,{type:c.headers["content-type"]})}catch(c){throw c.displayMessage={id:"Settings.application.customization.modal.upload.error-network",defaultMessage:"Network error"},c}});var Nt=(p,c,l)=>new Promise((h,u)=>{var T=v=>{try{A(l.next(v))}catch(R){u(R)}},M=v=>{try{A(l.throw(v))}catch(R){u(R)}},A=v=>v.done?h(v.value):Promise.resolve(v.value).then(T,M);A((l=l.apply(p,c)).next())});const rt=({goTo:p,next:c,onClose:l,setLocalImage:h})=>{const{formatMessage:u}=(0,$.useIntl)(),[T,M]=(0,e.useState)(""),[A,v]=(0,e.useState)(null),R=re=>{M(re.target.value)},Se=()=>Nt(void 0,null,function*(){try{const re=yield jt(T),et=yield oe(re);h(et),p(c)}catch(re){if(re.displayMessage)v(u(re.displayMessage,{size:Z,dimension:F}));else throw re}});return e.createElement("form",{onSubmit:re=>{re.preventDefault(),Se()}},e.createElement(I.Box,{paddingLeft:8,paddingRight:8,paddingTop:6,paddingBottom:6},e.createElement(ge.TextInput,{label:u({id:"Settings.application.customization.modal.upload.from-url.input-label",defaultMessage:"URL"}),error:A,onChange:R,value:T,name:"logo-url"})),e.createElement(pe.ModalFooter,{startActions:e.createElement(X.Button,{onClick:l,variant:"tertiary"},u({id:"app.components.Button.cancel",defaultMessage:"Cancel"})),endActions:e.createElement(X.Button,{type:"submit"},u({id:"Settings.application.customization.modal.upload.next",defaultMessage:"Next"}))}))};rt.defaultProps={next:null},rt.propTypes={goTo:y().func.isRequired,next:y().string,onClose:y().func.isRequired,setLocalImage:y().func.isRequired};const Ot=rt,ut=({setLocalImage:p,goTo:c,next:l,onClose:h})=>{const{formatMessage:u}=(0,$.useIntl)();return e.createElement(k.TabGroup,{label:u({id:"Settings.application.customization.modal.tab.label",defaultMessage:"How do you want to upload your assets?"}),variant:"simple"},e.createElement(I.Box,{paddingLeft:8,paddingRight:8},e.createElement(k.Tabs,null,e.createElement(k.Tab,null,u({id:"Settings.application.customization.modal.upload.from-computer",defaultMessage:"From computer"})),e.createElement(k.Tab,null,u({id:"Settings.application.customization.modal.upload.from-url",defaultMessage:"From url"}))),e.createElement(Y.Divider,null)),e.createElement(k.TabPanels,null,e.createElement(k.TabPanel,null,e.createElement(_,{onClose:h,setLocalImage:p,goTo:c,next:l})),e.createElement(k.TabPanel,null,e.createElement(Ot,{onClose:h,setLocalImage:p,goTo:c,next:l}))))};ut.defaultProps={next:null},ut.propTypes={goTo:y().func.isRequired,next:y().string,onClose:y().func.isRequired,setLocalImage:y().func.isRequired};const Vn=ut;var qe=a(31998);const on=({asset:p})=>{const{formatMessage:c}=(0,$.useIntl)();return e.createElement(qe.Card,null,e.createElement(qe.CardHeader,null,e.createElement(qe.CardAsset,{size:"S",src:p.url})),e.createElement(qe.CardBody,null,e.createElement(qe.CardContent,null,e.createElement(qe.CardTitle,null,p.name),e.createElement(qe.CardSubtitle,null,`${p.ext.toUpperCase()} - ${p.width}\u2715${p.height}`)),e.createElement(qe.CardBadge,null,c({id:"Settings.application.customization.modal.pending.card-badge",defaultMessage:"image"}))))};on.propTypes={asset:y().shape({name:y().string,url:y().string,width:y().number,height:y().number,ext:y().string}).isRequired};const Wt=on,Dt=({onClose:p,asset:c,prev:l,next:h,goTo:u,setLocalImage:T,onChangeLogo:M})=>{const{formatMessage:A}=(0,$.useIntl)(),v=()=>{T(void 0),u(l)},R=()=>{M(c),u(h)};return e.createElement(e.Fragment,null,e.createElement(I.Box,{paddingLeft:8,paddingRight:8,paddingTop:6,paddingBottom:6},e.createElement(V.Flex,{justifyContent:"space-between",paddingBottom:6},e.createElement(V.Flex,{direction:"column",alignItems:"flex-start"},e.createElement(U.Typography,{variant:"pi",fontWeight:"bold"},A({id:"Settings.application.customization.modal.pending.title",defaultMessage:"Logo ready to upload"})),e.createElement(U.Typography,{variant:"pi",textColor:"neutral500"},A({id:"Settings.application.customization.modal.pending.subtitle",defaultMessage:"Manage the chosen logo before uploading it"}))),e.createElement(X.Button,{onClick:v,variant:"secondary"},A({id:"Settings.application.customization.modal.pending.choose-another",defaultMessage:"Choose another logo"}))),e.createElement(I.Box,{maxWidth:(0,C.pxToRem)(180)},e.createElement(Wt,{asset:c}))),e.createElement(pe.ModalFooter,{startActions:e.createElement(X.Button,{onClick:p,variant:"tertiary"},A({id:"Settings.application.customization.modal.cancel",defaultMessage:"Cancel"})),endActions:e.createElement(X.Button,{onClick:R},A({id:"Settings.application.customization.modal.pending.upload",defaultMessage:"Upload logo"}))}))};Dt.defaultProps={next:null,prev:null},Dt.propTypes={goTo:y().func.isRequired,asset:y().shape({name:y().string,url:y().string,width:y().number,height:y().number,ext:y().string}).isRequired,next:y().string,onClose:y().func.isRequired,onChangeLogo:y().func.isRequired,prev:y().string,setLocalImage:y().func.isRequired};const sn={upload:{Component:Vn,modalTitle:{id:"Settings.application.customization.modal.upload",defaultMessage:"Upload logo"},next:"pending",prev:null},pending:{Component:Dt,modalTitle:{id:"Settings.application.customization.modal.pending",defaultMessage:"Pending logo"},next:null,prev:"upload"}},bt=({customLogo:p,defaultLogo:c,onChangeLogo:l,onResetMenuLogo:h})=>{const[{currentStep:u},T]=(0,e.useReducer)(je,Xe),{Component:M,next:A,prev:v,modalTitle:R}=sn[u]||{},{formatMessage:Se}=(0,$.useIntl)(),re=et=>{T({type:"GO_TO",to:et})};return e.createElement(e.Fragment,null,e.createElement(ce.CarouselInput,{label:Se({id:"Settings.application.customization.carousel.title",defaultMessage:"Logo"}),selectedSlide:0,hint:Se({id:"Settings.application.customization.carousel-hint",defaultMessage:"Change the admin panel logo (Max dimension: {dimension}x{dimension}, Max file size: {size}KB)"},{size:Z,dimension:F}),previousLabel:"",nextLabel:"",onNext:()=>{},onPrevious:()=>{},secondaryLabel:(p==null?void 0:p.name)||"logo.png",actions:e.createElement(ce.CarouselActions,null,e.createElement(Ge.IconButton,{onClick:()=>re(p?"pending":"upload"),label:Se({id:"Settings.application.customization.carousel.change-action",defaultMessage:"Change logo"}),icon:e.createElement(q(),null)}),p&&e.createElement(Ge.IconButton,{onClick:h,label:Se({id:"Settings.application.customization.carousel.reset-action",defaultMessage:"Reset logo"}),icon:e.createElement(lt(),null)}))},e.createElement(ce.CarouselSlide,{label:Se({id:"Settings.application.customization.carousel-slide.label",defaultMessage:"Logo slide"})},e.createElement(I.Box,{maxHeight:"40%",maxWidth:"40%",as:"img",src:(p==null?void 0:p.url)||c,alt:Se({id:"Settings.application.customization.carousel.title",defaultMessage:"Logo"})}))),e.createElement(W,{Component:M,currentStep:u,onChangeLogo:l,customLogo:p,goTo:re,next:A,prev:v,modalTitle:R}))};bt.defaultProps={customLogo:null},bt.propTypes={customLogo:y().shape({url:y().string,name:y().string}),defaultLogo:y().string.isRequired,onChangeLogo:y().func.isRequired,onResetMenuLogo:y().func.isRequired};const rn=bt,ft={menuLogo:{display:null,submit:{rawFile:null,isReset:!1}}},$t=(p=ft,c)=>(0,Le.default)(p,l=>{switch(c.type){case"SET_CUSTOM_MENU_LOGO":{l.menuLogo.display=c.value,l.menuLogo.submit.rawFile=c.value.rawFile;break}case"RESET_CUSTOM_MENU_LOGO":{l.menuLogo.display=null,l.menuLogo.submit={rawFile:null,isReset:!0};break}default:return l}});var pt=a(86349),Gn=a.n(pt);const Zn=(p,c)=>Gn()(p,{menuLogo:{display:c.menuLogo}}),nt=(0,e.forwardRef)(({projectSettingsStored:p},c)=>{const{formatMessage:l}=(0,$.useIntl)(),{trackUsage:h}=(0,C.useTracking)(),{logos:{menu:u}}=(0,Ce.um)(),[{menuLogo:T},M]=(0,e.useReducer)($t,ft,()=>Zn(ft,p)),A=R=>{M({type:"SET_CUSTOM_MENU_LOGO",value:R})},v=()=>{h("didClickResetLogo"),M({type:"RESET_CUSTOM_MENU_LOGO"})};return(0,e.useImperativeHandle)(c,()=>({getValues:()=>({menuLogo:T.submit})})),e.createElement(I.Box,{hasRadius:!0,background:"neutral0",shadow:"tableShadow",paddingTop:6,paddingBottom:6,paddingRight:7,paddingLeft:7},e.createElement(U.Typography,{variant:"delta",as:"h3"},l({id:"Settings.application.customization",defaultMessage:"Customization"})),e.createElement(P.Grid,{paddingTop:4},e.createElement(P.GridItem,{col:6,s:12},e.createElement(rn,{onChangeLogo:A,customLogo:T.display,defaultLogo:u.default,onResetMenuLogo:v}))))});nt.defaultProps={projectSettingsStored:null},nt.propTypes={projectSettingsStored:y().shape({menuLogo:y().shape({url:y().string,name:y().string})})};const Hn=nt;var kt=a(17247),cn=a(48344),dn=a.n(cn),Kn=Object.defineProperty,ht=Object.defineProperties,Xn=Object.getOwnPropertyDescriptors,mt=Object.getOwnPropertySymbols,Vt=Object.prototype.hasOwnProperty,zt=Object.prototype.propertyIsEnumerable,xt=(p,c,l)=>c in p?Kn(p,c,{enumerable:!0,configurable:!0,writable:!0,value:l}):p[c]=l,un=(p,c)=>{for(var l in c||(c={}))Vt.call(c,l)&&xt(p,l,c[l]);if(mt)for(var l of mt(c))zt.call(c,l)&&xt(p,l,c[l]);return p},Gt=(p,c)=>ht(p,Xn(c));const Mt=p=>dn()(p,(c,l,h)=>{l&&l.url?c[h]=Gt(un({},l),{url:(0,C.prefixFileUrlWithBackendUrl)(l.url)}):c[h]=l},{});var Zt=(p,c,l)=>new Promise((h,u)=>{var T=v=>{try{A(l.next(v))}catch(R){u(R)}},M=v=>{try{A(l.throw(v))}catch(R){u(R)}},A=v=>v.done?h(v.value):Promise.resolve(v.value).then(T,M);A((l=l.apply(p,c)).next())});const Ht=()=>Zt(void 0,null,function*(){const{data:p}=yield kt.be.get("/admin/project-settings");return Mt(p)}),mn=p=>Zt(void 0,null,function*(){const{data:c}=yield kt.be.post("/admin/project-settings",p);return Mt(c)}),gn=p=>{const c=new FormData;return Object.entries(p).forEach(([l,h])=>{h&&h.rawFile instanceof File&&c.append(l,h.rawFile),h&&h.isReset&&c.append(l,null)}),c};var Kt=(p,c,l)=>new Promise((h,u)=>{var T=v=>{try{A(l.next(v))}catch(R){u(R)}},M=v=>{try{A(l.throw(v))}catch(R){u(R)}},A=v=>v.done?h(v.value):Promise.resolve(v.value).then(T,M);A((l=l.apply(p,c)).next())});const fn=[{action:"admin::project-settings.update",subject:null}],yn=()=>{const p=(0,e.useRef)(),c=(0,C.useNotification)(),{trackUsage:l}=(0,C.useTracking)(),{formatMessage:h}=(0,$.useIntl)(),u=(0,we.useQueryClient)();(0,C.useFocusWhenNavigate)();const T=(0,C.useAppInfos)(),{shouldUpdateStrapi:M,latestStrapiReleaseTag:A,strapiVersion:v}=T,{updateProjectSettings:R}=(0,Ce.um)(),{data:Se}=(0,we.useQuery)("project-settings",Ht),re=T.communityEdition?"app.components.UpgradePlanModal.text-ce":"app.components.UpgradePlanModal.text-ee",et=(0,we.useMutation)(it=>mn(it),{onSuccess(it){return Kt(this,arguments,function*({menuLogo:ot}){yield u.invalidateQueries("project-settings",{refetchActive:!0}),R({menuLogo:ot==null?void 0:ot.url})})}}),vt=()=>{const it=p.current.getValues(),ot=gn(it);et.mutate(ot,{onSuccess(){const{menuLogo:ct}=it;ct.rawFile&&l("didChangeLogo")},onError(){c({type:"warning",message:{id:"notification.error",defaultMessage:"An error occurred"}})}})};return e.createElement(ne.Layout,null,e.createElement(C.SettingsPageTitle,{name:"Application"}),e.createElement(K.Main,null,e.createElement(ne.HeaderLayout,{title:h({id:"Settings.application.title",defaultMessage:"Overview"}),subtitle:h({id:"Settings.application.description",defaultMessage:"Administration panel\u2019s global information"}),primaryAction:e.createElement(X.Button,{onClick:vt,startIcon:e.createElement(Ee(),null)},h({id:"global.save",defaultMessage:"Save"}))}),e.createElement(ne.ContentLayout,null,e.createElement(le.Stack,{spacing:6},e.createElement(I.Box,{hasRadius:!0,background:"neutral0",shadow:"tableShadow",paddingTop:6,paddingBottom:6,paddingRight:7,paddingLeft:7},e.createElement(le.Stack,{spacing:5},e.createElement(U.Typography,{variant:"delta",as:"h3"},h({id:"global.details",defaultMessage:"Details"})),e.createElement(P.Grid,{paddingTop:1},e.createElement(P.GridItem,{col:6,s:12},e.createElement(U.Typography,{variant:"sigma",textColor:"neutral600"},h({id:"Settings.application.strapiVersion",defaultMessage:"strapi version"})),e.createElement(U.Typography,{as:"p"},"v",v),e.createElement(ee.Link,{href:T.communityEdition?"https://discord.strapi.io":"https://support.strapi.io/support/home",isExternal:!0,endIcon:e.createElement($e(),null)},h({id:"Settings.application.get-help",defaultMessage:"Get help"}))),e.createElement(P.GridItem,{col:6,s:12},e.createElement(U.Typography,{variant:"sigma",textColor:"neutral600"},h({id:"Settings.application.edition-title",defaultMessage:"current plan"})),e.createElement(U.Typography,{as:"p"},h({id:re,defaultMessage:`${T.communityEdition?"Community Edition":"Enterprise Edition"}`})))),e.createElement(P.Grid,{paddingTop:1},e.createElement(P.GridItem,{col:6,s:12},M&&e.createElement(ee.Link,{href:`https://github.com/strapi/strapi/releases/tag/${A}`,isExternal:!0,endIcon:e.createElement($e(),null)},h({id:"Settings.application.link-upgrade",defaultMessage:"Upgrade your admin panel"}))),e.createElement(P.GridItem,{col:6,s:12},e.createElement(ee.Link,{href:"https://strapi.io/pricing-self-hosted",isExternal:!0,endIcon:e.createElement($e(),null)},h({id:"Settings.application.link-pricing",defaultMessage:"See all pricing plans"})))),e.createElement(I.Box,{paddingTop:1},e.createElement(U.Typography,{variant:"sigma",textColor:"neutral600"},h({id:"Settings.application.node-version",defaultMessage:"node version"})),e.createElement(U.Typography,{as:"p"},T.nodeVersion)))),Se&&e.createElement(C.CheckPermissions,{permissions:fn},e.createElement(Hn,{ref:p,projectSettingsStored:Se}))))))};var St=a(3704),vn=a.n(St);const Xt=p=>vn()(p,l=>l.links).map(l=>(0,fe.ot)(l.Component,l.to,l.exact||!1)),Cn=p=>p.filter(c=>!c.links.every(l=>l.isDisplayed===!1));var Yt=a(21930),_e=a(18950),En=a(72975),he=a.n(En),Lt=function(){return window&&window.strapi&&window.strapi.isEE?a(20178).Z:a(16329).Z}(),bn=function(){return window&&window.strapi&&window.strapi.isEE?a(51899).Z:a(45677).Z}(),Sn=[{Component:function(){return{default:bn}},to:"/settings/roles",exact:!0},{Component:function(){return{default:Lt}},to:"/settings/roles/duplicate/:id",exact:!0},{Component:function(){return{default:Lt}},to:"/settings/roles/new",exact:!0},{Component:function(){return(0,_e.Z)(he().mark(function c(){var l;return he().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,a.e(2544).then(a.bind(a,33778));case 2:return l=u.sent,u.abrupt("return",l);case 4:case"end":return u.stop()}},c)}))()},to:"/settings/roles/:id",exact:!0},{Component:function(){return(0,_e.Z)(he().mark(function c(){var l;return he().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,a.e(5199).then(a.bind(a,31904));case 2:return l=u.sent,u.abrupt("return",l);case 4:case"end":return u.stop()}},c)}))()},to:"/settings/users",exact:!0},{Component:function(){return(0,_e.Z)(he().mark(function c(){var l;return he().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,a.e(4263).then(a.bind(a,40874));case 2:return l=u.sent,u.abrupt("return",l);case 4:case"end":return u.stop()}},c)}))()},to:"/settings/users/:id",exact:!0},{Component:function(){return(0,_e.Z)(he().mark(function c(){var l;return he().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,Promise.all([a.e(4715),a.e(5162)]).then(a.bind(a,33238));case 2:return l=u.sent,u.abrupt("return",l);case 4:case"end":return u.stop()}},c)}))()},to:"/settings/webhooks/create",exact:!0},{Component:function(){return(0,_e.Z)(he().mark(function c(){var l;return he().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,Promise.all([a.e(4715),a.e(5162)]).then(a.bind(a,59021));case 2:return l=u.sent,u.abrupt("return",l);case 4:case"end":return u.stop()}},c)}))()},to:"/settings/webhooks/:id",exact:!0},{Component:function(){return(0,_e.Z)(he().mark(function c(){var l;return he().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,a.e(4121).then(a.bind(a,70791));case 2:return l=u.sent,u.abrupt("return",l);case 4:case"end":return u.stop()}},c)}))()},to:"/settings/webhooks",exact:!0},{Component:function(){return(0,_e.Z)(he().mark(function c(){var l;return he().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,a.e(8056).then(a.bind(a,83782));case 2:return l=u.sent,u.abrupt("return",l);case 4:case"end":return u.stop()}},c)}))()},to:"/settings/api-tokens",exact:!0},{Component:function(){return(0,_e.Z)(he().mark(function c(){var l;return he().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,Promise.all([a.e(7379),a.e(4318),a.e(4299)]).then(a.bind(a,3330));case 2:return l=u.sent,u.abrupt("return",l);case 4:case"end":return u.stop()}},c)}))()},to:"/settings/api-tokens/create",exact:!0},{Component:function(){return(0,_e.Z)(he().mark(function c(){var l;return he().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,Promise.all([a.e(7379),a.e(4318),a.e(92)]).then(a.bind(a,97841));case 2:return l=u.sent,u.abrupt("return",l);case 4:case"end":return u.stop()}},c)}))()},to:"/settings/api-tokens/:id",exact:!0}];const Qn=Sn;var Pn=function(){return window&&window.strapi&&window.strapi.isEE?a(63775).Z:a(75936).Z}();const Tn=[].concat((0,Yt.Z)(Pn),(0,Yt.Z)(Qn));var yt=a(89420),Qt=Object.defineProperty,An=Object.defineProperties,Rn=Object.getOwnPropertyDescriptors,It=Object.getOwnPropertySymbols,On=Object.prototype.hasOwnProperty,Dn=Object.prototype.propertyIsEnumerable,Jt=(p,c,l)=>c in p?Qt(p,c,{enumerable:!0,configurable:!0,writable:!0,value:l}):p[c]=l,Pt=(p,c)=>{for(var l in c||(c={}))On.call(c,l)&&Jt(p,l,c[l]);if(It)for(var l of It(c))Dn.call(c,l)&&Jt(p,l,c[l]);return p},qt=(p,c)=>An(p,Rn(c));const Ft=({menu:p})=>{const{formatMessage:c}=(0,$.useIntl)(),h=Cn(p).map(T=>qt(Pt({},T),{title:T.intlLabel,links:T.links.map(M=>qt(Pt({},M),{title:M.intlLabel,name:M.id}))})),u=c({id:"global.settings",defaultMessage:"Settings"});return e.createElement(yt.SubNav,{ariaLabel:u},e.createElement(yt.SubNavHeader,{label:u}),e.createElement(yt.SubNavSections,null,h.map(T=>e.createElement(yt.SubNavSection,{key:T.id,label:c(T.intlLabel)},T.links.map(M=>e.createElement(yt.SubNavLink,{as:r.NavLink,withBullet:M.hasNotification,to:M.to,key:M.id},c(M.intlLabel)))))))};Ft.propTypes={menu:y().array.isRequired};const _t=Ft;function en(){const{settingId:p}=(0,r.useParams)(),{settings:c}=(0,C.useStrapiApp)(),{formatMessage:l}=(0,$.useIntl)(),{isLoading:h,menu:u}=(0,Ce.Te)(),T=(0,e.useMemo)(()=>(0,fe.WW)(Tn.map(({to:v,Component:R,exact:Se})=>(0,fe.ot)(R,v,Se))),[]),M=Xt(c);if(h)return e.createElement(C.LoadingIndicatorPage,null);if(!p)return e.createElement(r.Redirect,{to:"/settings/application-infos"});const A=l({id:"global.settings",defaultMessage:"Settings"});return e.createElement(ne.Layout,{sideNav:e.createElement(_t,{menu:u})},e.createElement(Me.Helmet,{title:A}),e.createElement(r.Switch,null,e.createElement(r.Route,{path:"/settings/application-infos",component:yn,exact:!0}),T,M))}const xn=(0,e.memo)(en)},16329:(ue,O,a)=>{a.d(O,{Z:()=>ne});var e=a(32735),C=a(5141);const ne=()=>e.createElement(C.Redirect,{to:"/404"})},49466:(ue,O,a)=>{a.d(O,{Z:()=>C});const C=!0},35123:(ue,O,a)=>{a.d(O,{Z:()=>C});const C=!0},18318:(ue,O,a)=>{a.d(O,{Z:()=>C});const C=!0},52124:(ue,O,a)=>{a.d(O,{Z:()=>C});const C=!0},61526:(ue,O,a)=>{a.d(O,{Z:()=>C});const C=!0},37511:(ue,O,a)=>{a.d(O,{Z:()=>ts});var e=a(32735),C=a(60216),r=a.n(C),ne=a(88425),$=a(81700),Me=a(23973),Ce=a.n(Me),fe=a(86834),we=a.n(fe),K=a(5636),I=a(9808),P=a(19615),U=a(98978),le=a.n(U),X=a(92577),ee=a(67793),Ve=a.n(ee),$e=a(31476),ze=a.n($e),Ee=a(35980),z=a(19192),y=a(33795),ce=a.n(y),Ge=a(9086),se=a.n(Ge),q=a(775),ae=a(42258),lt=a.n(ae),Le=a(44526);const Xe=P.default.div`
|
|
10
|
-
position: relative;
|
|
11
|
-
|
|
12
|
-
${({hasConditions:o,disabled:t,theme:n})=>o&&`
|
|
13
|
-
&:before {
|
|
14
|
-
content: '';
|
|
15
|
-
position: absolute;
|
|
16
|
-
top: -3px;
|
|
17
|
-
left: -10px;
|
|
18
|
-
width: 6px;
|
|
19
|
-
height: 6px;
|
|
20
|
-
border-radius: ${20/16}rem;;
|
|
21
|
-
background: ${t?n.colors.neutral100:n.colors.primary600};
|
|
22
|
-
}
|
|
23
|
-
`}
|
|
24
|
-
`,Ye=({onClick:o,className:t,hasConditions:n,variant:s})=>{const{formatMessage:i}=(0,K.useIntl)();return e.createElement(Xe,{hasConditions:n,className:t},e.createElement(Le.Button,{variant:s,startIcon:e.createElement(lt(),null),onClick:o},i({id:"global.settings",defaultMessage:"Settings"})))};Ye.defaultProps={className:null,hasConditions:!1,variant:"tertiary"},Ye.propTypes={onClick:r().func.isRequired,className:r().string,hasConditions:r().bool,variant:r().string};const je=(0,P.default)(Ye)``;var pe=a(4122),Ze=a(71657),G=a(95602),Qe=a(49415),j=a(81346),W=a.n(j),F=a(23940),Z=a.n(F),de=a(25716),k=Object.defineProperty,Y=Object.getOwnPropertySymbols,me=Object.prototype.hasOwnProperty,V=Object.prototype.propertyIsEnumerable,be=(o,t,n)=>t in o?k(o,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[t]=n,Ne=(o,t)=>{for(var n in t||(t={}))me.call(t,n)&&be(o,n,t[n]);if(Y)for(var n of Y(t))V.call(t,n)&&be(o,n,t[n]);return o};const at=o=>Object.values(o).map(t=>Object.entries(t).filter(([,n])=>n).map(([n])=>n)).flat(),He=o=>o.reduce((t,[n,s])=>(t.push({label:Z()(n),children:s.map(i=>({label:i.displayName,value:i.id}))}),t),[]),st=(o,t)=>o.map(([,n])=>n).flat().reduce((n,s)=>Ne({[s.id]:t.includes(s.id)},n),{});var Je=function(){return window&&window.strapi&&window.strapi.isEE?a(56899).Z:a(49466).Z}(),D=function(t){var n=t.arrayOfOptionsGroupedByCategory,s=t.isFormDisabled,i=t.isGrey,d=t.label,m=t.name,g=t.onChange,E=t.value,b=(0,K.useIntl)(),S=b.formatMessage,x=function(Q){g(m,st(n,Q))};return e.createElement(z.Flex,{as:"li",background:i?"neutral100":"neutral0",paddingBottom:3,paddingTop:3},e.createElement(z.Flex,{paddingLeft:6,style:{width:180}},e.createElement(G.Typography,{variant:"sigma",textColor:"neutral600"},S({id:"Settings.permissions.conditions.can",defaultMessage:"Can"}),"\xA0"),e.createElement(G.Typography,{variant:"sigma",title:d,textColor:"primary600",ellipsis:!0},S({id:"Settings.roles.form.permissions.".concat(d.toLowerCase()),defaultMessage:d})),e.createElement(G.Typography,{variant:"sigma",textColor:"neutral600"},"\xA0",S({id:"Settings.permissions.conditions.when",defaultMessage:"When"}))),e.createElement(I.Box,{style:{maxWidth:430,width:"100%"}},e.createElement(de.MultiSelectNested,{id:m,customizeContent:function(Q){return"".concat(Q.length," currently selected")},onChange:x,value:at(E),options:He(n),disabled:s||Je})))};D.propTypes={arrayOfOptionsGroupedByCategory:r().array.isRequired,isFormDisabled:r().bool.isRequired,isGrey:r().bool.isRequired,label:r().string.isRequired,name:r().string.isRequired,value:r().object.isRequired,onChange:r().func.isRequired};const H=D;var f=a(92891);const oe=(o,t)=>o.reduce((n,s)=>(n[s.id]=(0,f.get)(t,s.id,!1),n),{}),Te=(o,t)=>o.reduce((n,s)=>{const[i,d]=s,m=oe(d,t);return n[i]=m,n},{}),Ue=(o,t,n)=>o.reduce((s,i)=>{const d=(0,f.get)(t,[...i.pathToConditionsObject,"conditions"],{}),m=Te(n,d);return s[i.pathToConditionsObject.join("..")]=m,s},{});var _=Object.defineProperty,ge=Object.getOwnPropertySymbols,Ae=Object.prototype.hasOwnProperty,Rt=Object.prototype.propertyIsEnumerable,wt=(o,t,n)=>t in o?_(o,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[t]=n,nn=(o,t)=>{for(var n in t||(t={}))Ae.call(t,n)&&wt(o,n,t[n]);if(ge)for(var n of ge(t))Rt.call(t,n)&&wt(o,n,t[n]);return o};const jt=({actions:o,headerBreadCrumbs:t,isFormDisabled:n,onClosed:s,onToggle:i})=>{const{formatMessage:d}=(0,K.useIntl)(),{availableConditions:m,modifiedData:g,onChangeConditions:E}=(0,q.$_)(),b=(0,e.useMemo)(()=>Object.entries(W()(m,"category")),[m]),S=o.filter(({isDisplayed:L,hasSomeActionsSelected:N,hasAllActionsSelected:te})=>L&&(N||te)),x=(0,e.useMemo)(()=>Ue(S,g,b),[S,g,b]),[B,Q]=(0,e.useState)(x),w=(L,N)=>{Q((0,Qe.default)(te=>{te[L]||(te[L]={}),te[L].default||(te[L].default={}),te[L].default=N}))},J=()=>{const L=Object.entries(B).reduce((N,te)=>{const[ye,Ke]=te,De=Object.values(Ke).reduce((Re,Ie)=>nn(nn({},Re),Ie),{});return N[ye]=De,N},{});E(L),i()};return e.createElement(pe.ModalLayout,{labelledBy:"condition-modal-breadcrumbs",onClose:s},e.createElement(pe.ModalHeader,null,e.createElement(Ze.Breadcrumbs,{id:"condition-modal-breadcrumbs",label:t.join(", ")},t.map(L=>e.createElement(Ze.Crumb,{key:L},Z()(d({id:L,defaultMessage:L})))))),e.createElement(pe.ModalBody,null,S.length===0&&e.createElement(G.Typography,null,d({id:"Settings.permissions.conditions.no-actions",defaultMessage:"You first need to select actions (create, read, update, ...) before defining conditions on them."})),e.createElement("ul",null,S.map(({actionId:L,label:N,pathToConditionsObject:te},ye)=>{const Ke=te.join("..");return e.createElement(H,{key:L,arrayOfOptionsGroupedByCategory:b,label:N,isFormDisabled:n,isGrey:ye%2===0,name:Ke,onChange:w,value:ce()(B,Ke,{})})}))),e.createElement(pe.ModalFooter,{startActions:e.createElement(Le.Button,{variant:"tertiary",onClick:i},d({id:"app.components.Button.cancel",defaultMessage:"Cancel"})),endActions:e.createElement(Le.Button,{onClick:J},d({id:"Settings.permissions.conditions.apply",defaultMessage:"Apply"}))}))};jt.propTypes={actions:r().arrayOf(r().shape({actionId:r().string.isRequired,checkboxName:r().string,hasSomeActionsSelected:r().bool.isRequired,hasAllActionsSelected:r().bool,isDisplayed:r().bool.isRequired,label:r().string})).isRequired,headerBreadCrumbs:r().arrayOf(r().string).isRequired,isFormDisabled:r().bool.isRequired,onClosed:r().func.isRequired,onToggle:r().func.isRequired};const Nt=jt,rt=`${120/16}rem`,Ot=`${200/16}rem`,ut=`${53/16}rem`,qe=P.default.div`
|
|
25
|
-
width: ${rt};
|
|
26
|
-
`,Wt=(0,P.default)(z.Flex)`
|
|
27
|
-
padding-right: ${({theme:o})=>o.spaces[2]};
|
|
28
|
-
overflow: hidden;
|
|
29
|
-
flex: 1;
|
|
30
|
-
${({isCollapsable:o})=>o&&"cursor: pointer;"}
|
|
31
|
-
`;var Dt=Object.defineProperty,an=Object.getOwnPropertySymbols,zn=Object.prototype.hasOwnProperty,sn=Object.prototype.propertyIsEnumerable,bt=(o,t,n)=>t in o?Dt(o,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[t]=n,rn=(o,t)=>{for(var n in t||(t={}))zn.call(t,n)&&bt(o,n,t[n]);if(an)for(var n of an(t))sn.call(t,n)&&bt(o,n,t[n]);return o};const ft=({children:o,isCollapsable:t,isActive:n,isFormDisabled:s,label:i,onChange:d,onClick:m,checkboxName:g,someChecked:E,value:b})=>{const{formatMessage:S}=(0,K.useIntl)();return e.createElement(z.Flex,{alignItems:"center",paddingLeft:6,style:{width:Ot,flexShrink:0}},e.createElement(I.Box,{paddingRight:2},e.createElement(Ee.BaseCheckbox,{name:g,"aria-label":S({id:"Settings.permissions.select-all-by-permission",defaultMessage:"Select all {label} permissions"},{label:i}),disabled:s,onValueChange:x=>d({target:{name:g,value:x}}),indeterminate:E,value:b})),e.createElement(Wt,rn({title:i,alignItems:"center",isCollapsable:t},t&&{onClick:m,"aria-expanded":n,onKeyDown:({key:x})=>(x==="Enter"||x===" ")&&m(),tabIndex:0,role:"button"}),e.createElement(G.Typography,{fontWeight:n?"bold":"",textColor:n?"primary600":"neutral800",ellipsis:!0},Z()(i)),o))};ft.defaultProps={children:null,checkboxName:"",onChange(){},value:!1,someChecked:!1,isCollapsable:!1},ft.propTypes={checkboxName:r().string,children:r().node,label:r().string.isRequired,isCollapsable:r().bool,isFormDisabled:r().bool.isRequired,onChange:r().func,onClick:r().func.isRequired,someChecked:r().bool,value:r().bool,isActive:r().bool.isRequired};const ln=(0,e.memo)(ft),$t=o=>(0,f.isObject)(o)?(0,f.flattenDeep)(Object.values(o).map(t=>(0,f.isObject)(t)?$t(t):t)):[],pt=$t,Ut=o=>o?Object.keys(o).reduce((t,n)=>(n!=="conditions"&&(t[n]=o[n]),t),{}):null,nt=o=>{const t=Ut(o),n=pt(t);if(!n.length)return{hasAllActionsSelected:!1,hasSomeActionsSelected:!1};const s=n.every(d=>d),i=n.some(d=>d)&&!s;return{hasAllActionsSelected:s,hasSomeActionsSelected:i}},kt=(o,t,n)=>o.map(({actionId:s,isDisplayed:i,applyToProperties:d,label:m})=>{if(!i)return{actionId:s,hasSomeActionsSelected:!1,isDisplayed:i};const g=[...n.split(".."),s],E=(0,f.isEmpty)(d)?[...g,"properties","enabled"]:g,b=E.join(".."),S=(0,f.get)(t,[...g,"conditions"],null),x=pt(S).some(J=>J);if((0,f.isEmpty)(d)){const J=(0,f.get)(t,E,!1);return{actionId:s,checkboxName:b,hasAllActionsSelected:J,hasConditions:x,hasSomeActionsSelected:J,isDisplayed:i,isParentCheckbox:!1,label:m,pathToConditionsObject:g}}const B=(0,f.get)(t,E,null),{hasAllActionsSelected:Q,hasSomeActionsSelected:w}=nt(B);return{actionId:s,checkboxName:b,hasAllActionsSelected:Q,hasConditions:x,hasSomeActionsSelected:w,isDisplayed:i,isParentCheckbox:!0,label:m,pathToConditionsObject:g}});var cn=a(60672),dn=a.n(cn);const ht=(0,P.default)(dn())`
|
|
32
|
-
display: none;
|
|
33
|
-
width: ${10/16}rem;
|
|
34
|
-
transform: rotate(${({$isActive:o})=>o?"180":"0"}deg);
|
|
35
|
-
margin-left: ${({theme:o})=>o.spaces[2]};
|
|
36
|
-
`,mt=o=>`
|
|
37
|
-
${G.Typography} {
|
|
38
|
-
color: ${o.colors.primary600};
|
|
39
|
-
font-weight: ${o.fontWeights.bold}
|
|
40
|
-
}
|
|
41
|
-
${ht} {
|
|
42
|
-
display: block;
|
|
43
|
-
path {
|
|
44
|
-
fill: ${o.colors.primary600}
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
`;var Vt=function(){return window&&window.strapi&&window.strapi.isEE?a(68464).Z:a(35123).Z}(),zt=function o(t,n){return`
|
|
48
|
-
`.concat(xt,` {
|
|
49
|
-
background-color: `).concat(t.colors.primary100,`;
|
|
50
|
-
color: `).concat(t.colors.primary600,`;
|
|
51
|
-
border-radius: `).concat(n?"2px 2px 0 0":"2px",`;
|
|
52
|
-
}
|
|
53
|
-
`).concat(pn,` {
|
|
54
|
-
display: flex;
|
|
55
|
-
}
|
|
56
|
-
`).concat(je,` {
|
|
57
|
-
display: block;
|
|
58
|
-
}
|
|
59
|
-
&:hover {
|
|
60
|
-
`).concat(mt(t),`
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
&:focus-within {
|
|
64
|
-
`).concat(function(s){var i=s.theme,d=s.isActive;return o(i,d)},`
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
`)},xt=P.default.div.withConfig({displayName:"Collapse__Wrapper",componentId:"sc-132fji1-0"})(["flex:1;display:flex;align-items:center;height:",";background-color:",";border:1px solid transparent;"],ut,function(o){var t=o.isGrey,n=o.theme;return t?n.colors.neutral100:n.colors.neutral0}),un=P.default.div.withConfig({displayName:"Collapse__BoxWrapper",componentId:"sc-132fji1-1"})(["display:inline-flex;min-width:100%;","{display:none;}"," &:hover{","}"],je,function(o){var t=o.isActive,n=o.theme;return t&&zt(n,t)},function(o){var t=o.theme,n=o.isActive;return zt(t,n)}),Gt=(0,P.default)(z.Flex).withConfig({displayName:"Collapse__Cell",componentId:"sc-132fji1-2"})(["width:",";position:relative;"],rt),pn=(0,P.default)(I.Box).withConfig({displayName:"Collapse__Chevron",componentId:"sc-132fji1-3"})(["display:none;svg{width:11px;}*{fill:",";}"],function(o){var t=o.theme;return t.colors.primary600}),Mt=P.default.span.withConfig({displayName:"Collapse__TinyDot",componentId:"sc-132fji1-4"})(["position:absolute;top:-6px;left:37px;width:6px;height:6px;border-radius:20px;background:",";"],function(o){var t=o.theme;return t.colors.primary600}),Zt=(0,P.default)(I.Box).withConfig({displayName:"Collapse__AbsoluteBox",componentId:"sc-132fji1-5"})(["position:absolute;right:9px;transform:translateY(10px);"]),Ht=function(t){var n=t.availableActions,s=t.isActive,i=t.isGrey,d=t.isFormDisabled,m=t.label,g=t.onClickToggle,E=t.pathToData,b=(0,e.useState)(!1),S=(0,X.Z)(b,2),x=S[0],B=S[1],Q=(0,K.useIntl)(),w=Q.formatMessage,J=(0,q.$_)(),L=J.modifiedData,N=J.onChangeParentCheckbox,te=J.onChangeSimpleCheckbox,ye=function(){B(function(Pe){return!Pe})},Ke=function(){B(!1)},De=ce()(L,E.split(".."),{}),Re=(0,e.useMemo)(function(){return Object.keys(De).reduce(function(ie,Pe){return ie[Pe]=se()(De[Pe],"conditions"),ie},{})},[De]),Ie=nt(Re),xe=Ie.hasAllActionsSelected,Ct=Ie.hasSomeActionsSelected,ve=(0,e.useMemo)(function(){return kt(n,L,E)},[n,L,E]),Fe=ve.some(function(ie){var Pe=ie.hasConditions;return Pe});return e.createElement(un,{isActive:s},e.createElement(xt,{isGrey:i},e.createElement(ln,{isCollapsable:!0,isFormDisabled:d,label:m,checkboxName:E,onChange:N,onClick:g,someChecked:Ct,value:xe,isActive:s},e.createElement(pn,{paddingLeft:2},s?e.createElement(ze(),null):e.createElement(Ve(),null))),e.createElement(z.Flex,{style:{flex:1}},ve.map(function(ie){var Pe=ie.actionId,Oe=ie.hasConditions,Be=ie.hasAllActionsSelected,We=ie.hasSomeActionsSelected,gt=ie.isDisplayed,ke=ie.isParentCheckbox,dt=ie.checkboxName,Tt=ie.label;return gt?ke?e.createElement(Gt,{key:Pe,justifyContent:"center",alignItems:"center"},Oe&&e.createElement(Mt,null),e.createElement(Ee.BaseCheckbox,{disabled:d||Vt,name:dt,"aria-label":w({id:"Settings.permissions.select-by-permission",defaultMessage:"Select {label} permission"},{label:"".concat(Tt," ").concat(m)}),onValueChange:function(Et){N({target:{name:dt,value:Et}})},indeterminate:We,value:Be})):e.createElement(Gt,{key:Pe,justifyContent:"center",alignItems:"center"},Oe&&e.createElement(Mt,null),e.createElement(Ee.BaseCheckbox,{disabled:d||Vt,indeterminate:Oe,name:dt,onValueChange:function(Et){te({target:{name:dt,value:Et}})},value:Be})):e.createElement(qe,{key:Pe})})),x&&e.createElement(Nt,{headerBreadCrumbs:[m,"Settings.permissions.conditions.conditions"],actions:ve,isFormDisabled:d,onClosed:Ke,onToggle:ye})),e.createElement(Zt,null,e.createElement(je,{onClick:ye,hasConditions:Fe})))};Ht.propTypes={availableActions:r().array.isRequired,isActive:r().bool.isRequired,isGrey:r().bool.isRequired,isFormDisabled:r().bool.isRequired,label:r().string.isRequired,onClickToggle:r().func.isRequired,pathToData:r().string.isRequired};const mn=Ht,gn=(o,t)=>o.map(n=>{const s=Array.isArray(n.applyToProperties)&&n.applyToProperties.indexOf(t)!==-1&&n.isDisplayed;return{label:n.label,actionId:n.actionId,isActionRelatedToCurrentProperty:s}}),Kt=(0,P.default)(z.Flex)`
|
|
68
|
-
width: ${rt};
|
|
69
|
-
flex-shrink: 0;
|
|
70
|
-
`,fn=(0,P.default)(z.Flex)`
|
|
71
|
-
width: ${Ot};
|
|
72
|
-
height: ${ut};
|
|
73
|
-
flex-shrink: 0;
|
|
74
|
-
`,hn=({headers:o,label:t})=>{const{formatMessage:n}=(0,K.useIntl)(),s=n({id:"Settings.roles.form.permission.property-label",defaultMessage:"{label} permissions"},{label:t});return e.createElement(z.Flex,null,e.createElement(fn,{alignItems:"center",paddingLeft:6},e.createElement(G.Typography,{variant:"sigma",textColor:"neutral500"},s)),o.map(i=>i.isActionRelatedToCurrentProperty?e.createElement(Kt,{justifyContent:"center",key:i.label},e.createElement(G.Typography,{variant:"sigma",textColor:"neutral500"},n({id:`Settings.roles.form.permissions.${i.label.toLowerCase()}`,defaultMessage:i.label}))):e.createElement(Kt,{key:i.label})))};hn.propTypes={headers:r().arrayOf(r().shape({label:r().string.isRequired,isActionRelatedToCurrentProperty:r().bool.isRequired})).isRequired,label:r().string.isRequired};const yn=hn;var St=a(21930);const vn=P.default.span`
|
|
75
|
-
color: ${({theme:o})=>o.colors.danger700};
|
|
76
|
-
padding-left: ${({theme:o})=>o.spaces[1]}px;
|
|
77
|
-
`,Xt=()=>e.createElement(vn,null,"*");var Yn=Object.defineProperty,Cn=Object.defineProperties,Yt=Object.getOwnPropertyDescriptors,_e=Object.getOwnPropertySymbols,En=Object.prototype.hasOwnProperty,he=Object.prototype.propertyIsEnumerable,Lt=(o,t,n)=>t in o?Yn(o,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[t]=n,bn=(o,t)=>{for(var n in t||(t={}))En.call(t,n)&&Lt(o,n,t[n]);if(_e)for(var n of _e(t))he.call(t,n)&&Lt(o,n,t[n]);return o},Sn=(o,t)=>Cn(o,Yt(t));const Pn=(o,t)=>o.map(n=>{const s=Array.isArray(n.subjects)&&n.subjects.indexOf(t)!==-1;return Sn(bn({},n),{isDisplayed:s})});var Tn=a(20011),yt=Object.defineProperty,Qt=Object.getOwnPropertySymbols,An=Object.prototype.hasOwnProperty,Rn=Object.prototype.propertyIsEnumerable,It=(o,t,n)=>t in o?yt(o,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[t]=n,On=(o,t)=>{for(var n in t||(t={}))An.call(t,n)&&It(o,n,t[n]);if(Qt)for(var n of Qt(t))Rn.call(t,n)&&It(o,n,t[n]);return o};const Dn=(0,P.default)(I.Box)`
|
|
78
|
-
transform: translate(-4px, -12px);
|
|
79
|
-
|
|
80
|
-
&:before {
|
|
81
|
-
content: '';
|
|
82
|
-
width: ${4/16}rem;
|
|
83
|
-
height: ${12/16}rem;
|
|
84
|
-
background: ${({theme:o})=>o.colors.primary200};
|
|
85
|
-
display: block;
|
|
86
|
-
}
|
|
87
|
-
`,Jt=P.default.svg`
|
|
88
|
-
position: relative;
|
|
89
|
-
flex-shrink: 0;
|
|
90
|
-
transform: translate(-0.5px, -1px);
|
|
91
|
-
|
|
92
|
-
* {
|
|
93
|
-
fill: ${({theme:o,color:t})=>o.colors[t]};
|
|
94
|
-
}
|
|
95
|
-
`,Pt=o=>e.createElement(Dn,null,e.createElement(Jt,On({width:"20",height:"23",viewBox:"0 0 20 23",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o),e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.02477 14.7513C8.65865 17.0594 11.6046 18.6059 17.5596 18.8856C18.6836 18.9384 19.5976 19.8435 19.5976 20.9688V20.9688C19.5976 22.0941 18.6841 23.0125 17.5599 22.9643C10.9409 22.6805 6.454 20.9387 3.75496 17.1258C0.937988 13.1464 0.486328 7.39309 0.486328 0.593262H4.50974C4.50974 7.54693 5.06394 11.9813 7.02477 14.7513Z",fill:"#D9D8FF"})));Pt.defaultProps={fill:"primary200"},Pt.propTypes={fill:r().string};const qt=(0,e.memo)(Pt);var Ft=function(){return window&&window.strapi&&window.strapi.isEE?a(19665).Z:a(52124).Z}(),_t=(0,P.default)(z.Flex).withConfig({displayName:"SubActionRow__Cell",componentId:"sc-7y8yzq-0"})(["width:",";position:relative;"],rt),en=(0,P.default)(z.Flex).withConfig({displayName:"SubActionRow__RowWrapper",componentId:"sc-7y8yzq-1"})(["height:",";"],ut),xn=(0,P.default)(I.Box).withConfig({displayName:"SubActionRow__Wrapper",componentId:"sc-7y8yzq-2"})(["padding-left:","rem;"],31/16),p=(0,P.default)(I.Box).withConfig({displayName:"SubActionRow__LeftBorderTimeline",componentId:"sc-7y8yzq-3"})(["border-left:",";"],function(o){var t=o.isVisible,n=o.theme;return t?"4px solid ".concat(n.colors.primary200):"4px solid transparent"}),c=(0,P.default)(z.Flex).withConfig({displayName:"SubActionRow__RowStyle",componentId:"sc-7y8yzq-4"})(["padding-left:",";width:","px;"," ",";"],function(o){var t=o.theme;return t.spaces[4]},function(o){var t=o.level;return 145-t*36},function(o){var t=o.isCollapsable,n=o.theme;return t&&`
|
|
96
|
-
`.concat(ht,` {
|
|
97
|
-
display: block;
|
|
98
|
-
color: `).concat(n.colors.neutral100,`;
|
|
99
|
-
}
|
|
100
|
-
&:hover {
|
|
101
|
-
`).concat(mt(n),`
|
|
102
|
-
}
|
|
103
|
-
`)},function(o){var t=o.isActive,n=o.theme;return t&&mt(n)}),l=P.default.div.withConfig({displayName:"SubActionRow__TopTimeline",componentId:"sc-7y8yzq-5"})(["padding-top:",";margin-top:",";width:","rem;background-color:",";border-top-left-radius:2px;border-top-right-radius:2px;"],function(o){var t=o.theme;return t.spaces[2]},function(o){var t=o.theme;return t.spaces[2]},4/16,function(o){var t=o.theme;return t.colors.primary200}),h=function o(t){var n=t.childrenForm,s=t.isFormDisabled,i=t.recursiveLevel,d=t.pathToDataFromActionRow,m=t.propertyActions,g=t.parentName,E=t.propertyName,b=(0,K.useIntl)(),S=b.formatMessage,x=(0,q.$_)(),B=x.modifiedData,Q=x.onChangeParentCheckbox,w=x.onChangeSimpleCheckbox,J=(0,e.useState)(null),L=(0,X.Z)(J,2),N=L[0],te=L[1],ye=function(Re){te(function(Ie){return Ie===Re?null:Re})},Ke=(0,e.useMemo)(function(){return N?n.find(function(De){var Re=De.value;return Re===N}):null},[N,n]);return e.createElement(xn,null,e.createElement(l,null),n.map(function(De,Re){var Ie=De.label,xe=De.value,Ct=De.required,ve=De.children,Fe=Re+1<n.length,ie=Array.isArray(ve),Pe=N===xe;return e.createElement(p,{key:xe,isVisible:Fe},e.createElement(en,null,e.createElement(qt,{color:"primary200"}),e.createElement(z.Flex,{style:{flex:1}},e.createElement(c,{level:i,isActive:Pe,isCollapsable:ie},e.createElement(Wt,(0,Tn.Z)({alignItems:"center",isCollapsable:ie},ie&&{onClick:function(){return ye(xe)},"aria-expanded":Pe,onKeyDown:function(Be){var We=Be.key;return(We==="Enter"||We===" ")&&ye(xe)},tabIndex:0,role:"button"},{title:Ie}),e.createElement(G.Typography,{ellipsis:!0},Z()(Ie)),Ct&&e.createElement(Xt,null),e.createElement(ht,{$isActive:Pe}))),e.createElement(z.Flex,{style:{flex:1}},m.map(function(Oe){var Be=Oe.actionId,We=Oe.label,gt=Oe.isActionRelatedToCurrentProperty;if(!gt)return e.createElement(qe,{key:Be});var ke=[].concat((0,St.Z)(d.split("..")),[Be,"properties",E],(0,St.Z)(g.split("..")),[xe]),dt=ce()(B,ke,!1);if(!ve)return e.createElement(_t,{key:We,justifyContent:"center",alignItems:"center"},e.createElement(Ee.BaseCheckbox,{disabled:s||Ft,name:ke.join(".."),"aria-label":S({id:"Settings.permissions.select-by-permission",defaultMessage:"Select {label} permission"},{label:"".concat(g," ").concat(Ie," ").concat(We)}),onValueChange:function(Bt){w({target:{name:ke.join(".."),value:Bt}})},value:dt}));var Tt=nt(dt),At=Tt.hasAllActionsSelected,Et=Tt.hasSomeActionsSelected;return e.createElement(_t,{key:We,justifyContent:"center",alignItems:"center"},e.createElement(Ee.BaseCheckbox,{key:We,disabled:s||Ft,name:ke.join(".."),"aria-label":S({id:"Settings.permissions.select-by-permission",defaultMessage:"Select {label} permission"},{label:"".concat(g," ").concat(Ie," ").concat(We)}),onValueChange:function(Bt){Q({target:{name:ke.join(".."),value:Bt}})},value:At,indeterminate:Et}))})))),Ke&&Pe&&e.createElement(I.Box,{paddingBottom:2},e.createElement(o,{isFormDisabled:s,parentName:"".concat(g,"..").concat(xe),pathToDataFromActionRow:d,propertyActions:m,propertyName:E,recursiveLevel:i+1,childrenForm:Ke.children})))}))};h.propTypes={childrenForm:r().array.isRequired,isFormDisabled:r().bool.isRequired,parentName:r().string.isRequired,pathToDataFromActionRow:r().string.isRequired,propertyActions:r().array.isRequired,propertyName:r().string.isRequired,recursiveLevel:r().number.isRequired};const u=(0,e.memo)(h),T=o=>o.reduce((n,s)=>(s.isActionRelatedToCurrentProperty&&n.push(s.actionId),n),[]),A=(o,t,n,s,i)=>{const m=T(o).reduce((g,E)=>{const b=[...n.split(".."),E,"properties",s,i],S=(0,f.get)(t,b,!1);return g[E]=S,g},{});return nt(m)};var v=function(){return window&&window.strapi&&window.strapi.isEE?a(32741).Z:a(18318).Z}(),R=(0,P.default)(z.Flex).withConfig({displayName:"ActionRow__Cell",componentId:"sc-4agenc-0"})(["width:",";position:relative;"],rt),Se=(0,P.default)(z.Flex).withConfig({displayName:"ActionRow__Wrapper",componentId:"sc-4agenc-1"})(["height:",";flex:1;"," ",";"],ut,function(o){var t=o.isCollapsable,n=o.theme;return t&&`
|
|
104
|
-
`.concat(ht,` {
|
|
105
|
-
display: block;
|
|
106
|
-
color: `).concat(n.colors.neutral100,`;
|
|
107
|
-
}
|
|
108
|
-
&:hover {
|
|
109
|
-
`).concat(mt(n),`
|
|
110
|
-
}
|
|
111
|
-
`)},function(o){var t=o.isActive,n=o.theme;return t&&mt(n)}),re=function(t){var n=t.childrenForm,s=t.label,i=t.isFormDisabled,d=t.name,m=t.required,g=t.pathToData,E=t.propertyActions,b=t.propertyName,S=t.isOdd,x=(0,K.useIntl)(),B=x.formatMessage,Q=(0,e.useState)(null),w=(0,X.Z)(Q,2),J=w[0],L=w[1],N=(0,q.$_)(),te=N.modifiedData,ye=N.onChangeCollectionTypeLeftActionRowCheckbox,Ke=N.onChangeParentCheckbox,De=N.onChangeSimpleCheckbox,Re=J===d,Ie=(0,e.useMemo)(function(){return Array.isArray(n)?n:[]},[n]),xe=Ie.length>0,Ct=(0,e.useCallback)(function(){xe&&L(function(Oe){return Oe===d?null:d})},[xe,d]),ve=function(Be){var We=Be.target.value;ye(g,b,d,We)},Fe=(0,e.useMemo)(function(){return A(E,te,g,b,d)},[E,te,g,b,d]),ie=Fe.hasAllActionsSelected,Pe=Fe.hasSomeActionsSelected;return e.createElement(e.Fragment,null,e.createElement(Se,{alignItems:"center",isCollapsable:xe,isActive:Re,background:S?"neutral100":"neutral0"},e.createElement(z.Flex,null,e.createElement(ln,{onChange:ve,onClick:Ct,isCollapsable:xe,isFormDisabled:i,label:s,someChecked:Pe,value:ie,isActive:Re},m&&e.createElement(Xt,null),e.createElement(ht,{$isActive:Re})),e.createElement(z.Flex,null,E.map(function(Oe){var Be=Oe.label,We=Oe.isActionRelatedToCurrentProperty,gt=Oe.actionId;if(!We)return e.createElement(qe,{key:Be});var ke=[].concat((0,St.Z)(g.split("..")),[gt,"properties",b,d]);if(!xe){var dt=ce()(te,ke,!1);return e.createElement(R,{key:gt,justifyContent:"center",alignItems:"center"},e.createElement(Ee.BaseCheckbox,{disabled:i||v,name:ke.join(".."),"aria-label":B({id:"Settings.permissions.select-by-permission",defaultMessage:"Select {label} permission"},{label:"".concat(d," ").concat(Be)}),onValueChange:function(kn){De({target:{name:ke.join(".."),value:kn}})},value:dt}))}var Tt=ce()(te,ke,{}),At=nt(Tt),Et=At.hasAllActionsSelected,Un=At.hasSomeActionsSelected;return e.createElement(R,{key:Be,justifyContent:"center",alignItems:"center"},e.createElement(Ee.BaseCheckbox,{disabled:i||v,name:ke.join(".."),onValueChange:function(kn){Ke({target:{name:ke.join(".."),value:kn}})},"aria-label":B({id:"Settings.permissions.select-by-permission",defaultMessage:"Select {label} permission"},{label:"".concat(d," ").concat(Be)}),value:Et,indeterminate:Un}))})))),Re&&e.createElement(u,{childrenForm:Ie,isFormDisabled:i,parentName:d,pathToDataFromActionRow:g,propertyName:b,propertyActions:E,recursiveLevel:0}))};re.defaultProps={childrenForm:[],required:!1},re.propTypes={childrenForm:r().array,label:r().string.isRequired,isFormDisabled:r().bool.isRequired,name:r().string.isRequired,pathToData:r().string.isRequired,propertyActions:r().array.isRequired,propertyName:r().string.isRequired,required:r().bool,isOdd:r().bool.isRequired};const et=(0,e.memo)(re),vt=P.default.div`
|
|
112
|
-
display: inline-flex;
|
|
113
|
-
flex-direction: column;
|
|
114
|
-
min-width: 0;
|
|
115
|
-
`,it=({availableActions:o,childrenForm:t,isFormDisabled:n,label:s,pathToData:i,propertyName:d})=>{const m=(0,e.useMemo)(()=>gn(o,d),[o,d]);return e.createElement(vt,null,e.createElement(yn,{label:s,headers:m}),e.createElement(I.Box,null,t.map(({children:g,label:E,value:b,required:S},x)=>e.createElement(et,{childrenForm:g,key:b,label:E,isFormDisabled:n,name:b,required:S,propertyActions:m,pathToData:i,propertyName:d,isOdd:x%2===0}))))};it.propTypes={childrenForm:r().array.isRequired,availableActions:r().array.isRequired,isFormDisabled:r().bool.isRequired,label:r().string.isRequired,pathToData:r().string.isRequired,propertyName:r().string.isRequired};const ot=it,ct=P.default.div`
|
|
116
|
-
flex-direction: column;
|
|
117
|
-
display: inline-flex;
|
|
118
|
-
min-width: 100%;
|
|
119
|
-
${({theme:o,isActive:t})=>t&&`border: 1px solid ${o.colors.primary600};`}
|
|
120
|
-
`,Jn=({allActions:o,contentTypeName:t,label:n,index:s,isActive:i,isFormDisabled:d,onClickToggleCollapse:m,pathToData:g,properties:E})=>{const b=(0,e.useCallback)(()=>{m(t)},[t,m]),S=(0,e.useMemo)(()=>Pn(o,t),[o,t]);return e.createElement(ct,{isActive:i},e.createElement(mn,{availableActions:S,isActive:i,isGrey:s%2===0,isFormDisabled:d,label:n,onClickToggle:b,pathToData:g}),i&&E.map(({label:x,value:B,children:Q})=>e.createElement(ot,{availableActions:S,childrenForm:Q,isFormDisabled:d,label:x,pathToData:g,propertyName:B,key:B})))};Jn.propTypes={allActions:r().array.isRequired,contentTypeName:r().string.isRequired,index:r().number.isRequired,isActive:r().bool.isRequired,isFormDisabled:r().bool.isRequired,label:r().string.isRequired,onClickToggleCollapse:r().func.isRequired,pathToData:r().string.isRequired,properties:r().array.isRequired};const Uo=Jn,Mn=({actions:o,isFormDisabled:t,pathToData:n,subjects:s})=>{const[i,d]=(0,e.useState)(null),m=g=>{d(i===g?null:g)};return s.map(({uid:g,label:E,properties:b},S)=>e.createElement(Uo,{allActions:o,key:g,contentTypeName:g,label:E,isActive:i===g,isFormDisabled:t,index:S,onClickToggleCollapse:m,pathToData:`${n}..${g}`,properties:b}))};Mn.defaultProps={actions:[],subjects:[]},Mn.propTypes={actions:r().array.isRequired,isFormDisabled:r().bool.isRequired,pathToData:r().string.isRequired,subjects:r().arrayOf(r().shape({uid:r().string.isRequired,label:r().string.isRequired,properties:r().array.isRequired}))};const ko=(0,e.memo)(Mn);var qn=a(90662);const Vo=o=>o.filter(({subjects:t})=>t&&t.length);var zo=Object.defineProperty,_n=Object.getOwnPropertySymbols,Go=Object.prototype.hasOwnProperty,Zo=Object.prototype.propertyIsEnumerable,eo=(o,t,n)=>t in o?zo(o,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[t]=n,to=(o,t)=>{for(var n in t||(t={}))Go.call(t,n)&&eo(o,n,t[n]);if(_n)for(var n of _n(t))Zo.call(t,n)&&eo(o,n,t[n]);return o};const Ho=o=>o.map(({actionId:t})=>t),Ko=(o,t)=>o.reduce((n,s)=>(Object.keys(t).forEach(i=>{const d=(0,f.get)(t,[i,s],{}),m={[i]:Ut(d)};n[s]?n[s]=to(to({},n[s]),m):n[s]=m}),n),{}),Xo=(o,t)=>{const n=Ho(o),s=Ko(n,t);return Object.keys(s).reduce((d,m)=>(d[m]=nt(s[m]),d),{})};var Yo=function(){return window&&window.strapi&&window.strapi.isEE?a(36950).Z:a(61526).Z}(),Qo=(0,P.default)(qn.Stack).withConfig({displayName:"GlobalActions__CenteredStack",componentId:"sc-1vxwsjr-0"})(["align-items:center;justify-content:center;width:",";flex-shrink:0;"],rt),Ln=function(t){var n=t.actions,s=t.isFormDisabled,i=t.kind,d=(0,K.useIntl)(),m=d.formatMessage,g=(0,q.$_)(),E=g.modifiedData,b=g.onChangeCollectionTypeGlobalActionCheckbox,S=(0,e.useMemo)(function(){return Vo(n)},[n]),x=(0,e.useMemo)(function(){return Xo(S,E[i])},[E,S,i]);return e.createElement(I.Box,{paddingBottom:4,paddingTop:6,style:{paddingLeft:Ot}},e.createElement(qn.Stack,{horizontal:!0,spacing:0},S.map(function(B){var Q=B.label,w=B.actionId;return e.createElement(Qo,{key:w,spacing:3},e.createElement(G.Typography,{variant:"sigma",textColor:"neutral500"},m({id:"Settings.roles.form.permissions.".concat(Q.toLowerCase()),defaultMessage:Q})),e.createElement(Ee.BaseCheckbox,{disabled:s||Yo,onValueChange:function(L){b(i,w,L)},name:w,"aria-label":m({id:"Settings.permissions.select-all-by-permission",defaultMessage:"Select all {label} permissions"},{label:m({id:"Settings.roles.form.permissions.".concat(Q.toLowerCase()),defaultMessage:Q})}),value:ce()(x,[w,"hasAllActionsSelected"],!1),indeterminate:ce()(x,[w,"hasSomeActionsSelected"],!1)}))})))};Ln.defaultProps={actions:[]},Ln.propTypes={actions:r().arrayOf(r().shape({label:r().string.isRequired,actionId:r().string.isRequired,subjects:r().array.isRequired})),isFormDisabled:r().bool.isRequired,kind:r().string.isRequired};const Jo=(0,e.memo)(Ln),qo=(0,P.default)(I.Box)`
|
|
121
|
-
overflow-x: auto;
|
|
122
|
-
`,no=({isFormDisabled:o,kind:t,layout:{actions:n,subjects:s}})=>{const i=le()([...s],"label");return e.createElement(qo,{background:"neutral0"},e.createElement(Jo,{actions:n,kind:t,isFormDisabled:o}),e.createElement(ko,{actions:n,isFormDisabled:o,pathToData:t,subjects:i}))};no.propTypes={isFormDisabled:r().bool.isRequired,kind:r().string.isRequired,layout:r().shape({actions:r().array,subjects:r().arrayOf(r().shape({uid:r().string.isRequired,label:r().string.isRequired,properties:r().array.isRequired}))}).isRequired};const oo=(0,e.memo)(no);var _o=a(66694);const ao=({children:o,value:t})=>e.createElement(_o.$l.Provider,{value:t},o);ao.propTypes={children:r().node.isRequired,value:r().exact({availableConditions:r().array.isRequired,modifiedData:r().object.isRequired,onChangeCollectionTypeLeftActionRowCheckbox:r().func.isRequired,onChangeConditions:r().func.isRequired,onChangeSimpleCheckbox:r().func.isRequired,onChangeParentCheckbox:r().func.isRequired,onChangeCollectionTypeGlobalActionCheckbox:r().func.isRequired}).isRequired};const ea=ao;var In=a(12001),so=a(78330),ro=a(52111),ta=Object.defineProperty,na=Object.defineProperties,oa=Object.getOwnPropertyDescriptors,io=Object.getOwnPropertySymbols,aa=Object.prototype.hasOwnProperty,sa=Object.prototype.propertyIsEnumerable,lo=(o,t,n)=>t in o?ta(o,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[t]=n,ra=(o,t)=>{for(var n in t||(t={}))aa.call(t,n)&&lo(o,n,t[n]);if(io)for(var n of io(t))sa.call(t,n)&&lo(o,n,t[n]);return o},ia=(o,t)=>na(o,oa(t));const la=(o,t,n)=>o.map(s=>{const i=[...n,s.action,"properties","enabled"],d=(0,f.get)(t,i,!1),m=(0,f.get)(t,[...n,s.action,"conditions"],{}),g=pt(m).some(E=>E);return ia(ra({},s),{isDisplayed:d,checkboxName:i.join(".."),hasSomeActionsSelected:d,value:d,hasConditions:g,label:s.displayName,actionId:s.action,pathToConditionsObject:[...n,s.action]})}),ca=o=>{const t=Object.entries(o).reduce((s,i)=>{const[d,{conditions:m}]=i;return s[d]=m,s},{});return pt(t).some(s=>s)};var Fn=function(){return window&&window.strapi&&window.strapi.isEE?a(96556).Z:a(16437).Z}(),da=P.default.div.withConfig({displayName:"SubCategory__Border",componentId:"sc-akgczm-0"})(["flex:1;align-self:center;border-top:1px solid ",";"],function(o){var t=o.theme;return t.colors.neutral150}),ua=P.default.div.withConfig({displayName:"SubCategory__CheckboxWrapper",componentId:"sc-akgczm-1"})(["position:relative;word-break:keep-all;",""],function(o){var t=o.hasConditions,n=o.disabled,s=o.theme;return t&&`
|
|
123
|
-
&:before {
|
|
124
|
-
content: '';
|
|
125
|
-
position: absolute;
|
|
126
|
-
top: `.concat(-4/16,`rem;
|
|
127
|
-
left: `).concat(-8/16,`rem;
|
|
128
|
-
width: `).concat(6/16,`rem;
|
|
129
|
-
height: `).concat(6/16,`rem;
|
|
130
|
-
border-radius: `).concat(20/16,`rem;
|
|
131
|
-
background: `).concat(n?s.colors.neutral100:s.colors.primary600,`;
|
|
132
|
-
}
|
|
133
|
-
`)}),co=function(t){var n=t.categoryName,s=t.isFormDisabled,i=t.subCategoryName,d=t.actions,m=t.pathToData,g=(0,e.useState)(!1),E=(0,X.Z)(g,2),b=E[0],S=E[1],x=(0,q.$_)(),B=x.modifiedData,Q=x.onChangeParentCheckbox,w=x.onChangeSimpleCheckbox,J=(0,K.useIntl)(),L=J.formatMessage,N=ce()(B,m,{}),te=(0,e.useMemo)(function(){return Object.keys(N).reduce(function(ve,Fe){return ve[Fe]=Ut(N[Fe]),ve},{})},[N]),ye=nt(te),Ke=ye.hasAllActionsSelected,De=ye.hasSomeActionsSelected,Re=function(){S(function(Fe){return!Fe})},Ie=function(){S(!1)},xe=la(d,B,m),Ct=ca(ce()(B,(0,St.Z)(m),{}));return e.createElement(e.Fragment,null,e.createElement(I.Box,null,e.createElement(z.Flex,{justifyContent:"space-between",alignItems:"center"},e.createElement(I.Box,{paddingRight:4},e.createElement(G.Typography,{variant:"sigma",textColor:"neutral600"},i)),e.createElement(da,null),e.createElement(I.Box,{paddingLeft:4},e.createElement(ro.Checkbox,{name:m.join(".."),disabled:s||Fn,onValueChange:function(Fe){Q({target:{name:m.join(".."),value:Fe}})},indeterminate:De,value:Ke},L({id:"app.utils.select-all",defaultMessage:"Select all"})))),e.createElement(z.Flex,{paddingTop:6,paddingBottom:6},e.createElement(so.Grid,{gap:2,style:{flex:1}},xe.map(function(ve){var Fe=ve.checkboxName,ie=ve.value,Pe=ve.action,Oe=ve.displayName,Be=ve.hasConditions;return e.createElement(so.GridItem,{col:3,key:Pe},e.createElement(ua,{disabled:s||Fn,hasConditions:Be},e.createElement(ro.Checkbox,{name:Fe,disabled:s||Fn,onValueChange:function(gt){w({target:{name:Fe,value:gt}})},value:ie},Oe)))})),e.createElement(je,{hasConditions:Ct,onClick:Re}))),b&&e.createElement(Nt,{headerBreadCrumbs:[n,i],actions:xe,isFormDisabled:s,onClosed:Ie,onToggle:Re}))};co.propTypes={actions:r().array.isRequired,categoryName:r().string.isRequired,isFormDisabled:r().bool.isRequired,subCategoryName:r().string.isRequired,pathToData:r().array.isRequired};const pa=co,Bn=({childrenForm:o,kind:t,name:n,isOpen:s,isFormDisabled:i,isWhite:d,onOpenCategory:m,pathToData:g})=>{const{formatMessage:E}=(0,K.useIntl)(),b=()=>{m(n)},S=(0,e.useMemo)(()=>n.split("::").pop(),[n]);return e.createElement(In.Accordion,{expanded:s,onToggle:b,id:`accordion-${n}`,variant:d?"primary":"secondary"},e.createElement(In.AccordionToggle,{title:Z()(S),description:`${E({id:"Settings.permissions.category"},{category:S})} ${t==="plugins"?"plugin":t}`}),e.createElement(In.AccordionContent,null,e.createElement(I.Box,{padding:6},o.map(({actions:x,subCategoryName:B,subCategoryId:Q})=>e.createElement(pa,{key:B,actions:x,categoryName:S,isFormDisabled:i,subCategoryName:B,pathToData:[...g,Q]})))))};Bn.defaultProps={},Bn.propTypes={childrenForm:r().array.isRequired,isOpen:r().bool.isRequired,isFormDisabled:r().bool.isRequired,isWhite:r().bool.isRequired,kind:r().string.isRequired,name:r().string.isRequired,onOpenCategory:r().func.isRequired,pathToData:r().array.isRequired};const ma=Bn,uo=({isFormDisabled:o,kind:t,layout:n})=>{const[s,i]=(0,e.useState)(null),d=m=>{i(m===s?null:m)};return e.createElement(I.Box,{padding:6,background:"neutral0"},n.map(({category:m,categoryId:g,childrenForm:E},b)=>e.createElement(ma,{key:m,childrenForm:E,kind:t,isFormDisabled:o,isOpen:s===m,isWhite:b%2===1,name:m,onOpenCategory:d,pathToData:[t,g]})))};uo.propTypes={isFormDisabled:r().bool.isRequired,kind:r().string.isRequired,layout:r().arrayOf(r().shape({category:r().string.isRequired,categoryId:r().string.isRequired,childrenForm:r().arrayOf(r().shape({actions:r().array.isRequired})).isRequired}).isRequired).isRequired};const po=uo,mo=(o,t,n)=>o.find(s=>s.action===t&&s.subject===n);var ga=Object.defineProperty,fa=Object.defineProperties,ha=Object.getOwnPropertyDescriptors,go=Object.getOwnPropertySymbols,ya=Object.prototype.hasOwnProperty,va=Object.prototype.propertyIsEnumerable,fo=(o,t,n)=>t in o?ga(o,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[t]=n,ho=(o,t)=>{for(var n in t||(t={}))ya.call(t,n)&&fo(o,n,t[n]);if(go)for(var n of go(t))va.call(t,n)&&fo(o,n,t[n]);return o},yo=(o,t)=>fa(o,ha(t));const vo=(o,t=[])=>o.reduce((n,s)=>(n[s.id]=t.indexOf(s.id)!==-1,n),{}),Co=({children:o},t,n="")=>o.reduce((s,i)=>{if(i.children)return yo(ho({},s),{[i.value]:Co(i,t,`${n}${i.value}.`)});const d=t.indexOf(`${n}${i.value}`)!==-1;return s[i.value]=d,s},{}),Ca=(o,t,n)=>o.reduce((s,i)=>{const d=t.properties.find(({value:m})=>m===i);if(d){const m=(0,f.get)(n,["properties",d.value],[]),g=Co(d,m);s.properties[i]=g}return s},{properties:{}}),Ea=(o,t)=>t.reduce((n,s)=>{const i=o.find(({uid:d})=>d===s)||null;return i&&(n[s]=i),n},{}),Eo=({subjects:o},t,n,s=[])=>t.reduce((i,d)=>{const m=d.subjects,g=Ea(o,m);if((0,f.isEmpty)(g))return i;const E=Object.keys(g).reduce((b,S)=>{const{actionId:x,applyToProperties:B}=d,J=g[S].properties.map(({value:ye})=>ye).every(ye=>(B||[]).indexOf(ye)===-1),L=mo(s,x,S),N=vo(n,(0,f.get)(L,"conditions",[]));if((0,f.isEmpty)(B)||J)return(0,f.set)(b,[S,x],{properties:{enabled:L!==void 0},conditions:N}),b;const te=Ca(B,g[S],L);return(0,f.set)(b,[S,x],yo(ho({},te),{conditions:N})),b},{});return(0,f.merge)(i,E)},{}),ba=(o,t,n)=>o.reduce((s,i)=>{const d=mo(n,i.action,null);return s[i.action]={properties:{enabled:d!==void 0},conditions:vo(t,(0,f.get)(d,"conditions",[]))},s},{}),Sa=(o,t,n)=>o.reduce((s,i)=>(s[i.subCategoryId]=ba(i.actions,t,n),s),{}),bo=(o,t,n=[])=>o.reduce((s,{categoryId:i,childrenForm:d})=>{const m=Sa(d,t,n);return s[i]=m,s},{}),So=o=>o.split(" ").join("-"),Po=(o,t)=>(0,f.chain)(o).groupBy(t).map((n,s)=>({category:s,categoryId:So(s),childrenForm:(0,f.chain)(n).groupBy("subCategory").map((i,d)=>({subCategoryName:d,subCategoryId:So(d),actions:i})).value()})).value(),Pa=(o,t)=>{const{conditions:n,sections:{collectionTypes:s,singleTypes:i,plugins:d,settings:m}}=o,g={collectionTypes:s,singleTypes:i,plugins:Po(d,"plugin"),settings:Po(m,"category")},E={collectionTypes:Eo(s,s.actions||[],n,t),singleTypes:Eo(i,i.actions||[],n,t),plugins:bo(g.plugins,n,t),settings:bo(g.settings,n,t)};return{initialData:E,modifiedData:E,layouts:g}};var Ta=Object.defineProperty,Aa=Object.defineProperties,Ra=Object.getOwnPropertyDescriptors,To=Object.getOwnPropertySymbols,Oa=Object.prototype.hasOwnProperty,Da=Object.prototype.propertyIsEnumerable,Ao=(o,t,n)=>t in o?Ta(o,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[t]=n,wn=(o,t)=>{for(var n in t||(t={}))Oa.call(t,n)&&Ao(o,n,t[n]);if(To)for(var n of To(t))Da.call(t,n)&&Ao(o,n,t[n]);return o},jn=(o,t)=>Aa(o,Ra(t));const Ro=o=>Object.keys(o).reduce((t,n)=>{const s=o[n];if((0,f.isObject)(s)&&!(0,f.has)(s,"conditions"))return jn(wn({},t),{[n]:Ro(s)});if((0,f.isObject)(s)&&(0,f.has)(s,"conditions")&&!pt((0,f.omit)(s,"conditions")).some(d=>d)){const d=Object.keys(s.conditions).reduce((m,g)=>(m[g]=!1,m),{});return jn(wn({},t),{[n]:jn(wn({},s),{conditions:d})})}return t[n]=s,t},{}),Nn=Ro;var xa=Object.defineProperty,Ma=Object.defineProperties,La=Object.getOwnPropertyDescriptors,Oo=Object.getOwnPropertySymbols,Ia=Object.prototype.hasOwnProperty,Fa=Object.prototype.propertyIsEnumerable,Do=(o,t,n)=>t in o?xa(o,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[t]=n,Ba=(o,t)=>{for(var n in t||(t={}))Ia.call(t,n)&&Do(o,n,t[n]);if(Oo)for(var n of Oo(t))Fa.call(t,n)&&Do(o,n,t[n]);return o},wa=(o,t)=>Ma(o,La(t));const xo=(o,t)=>Object.keys(o).reduce((n,s)=>{const i=o[s];return s==="conditions"?(n[s]=i,n):(0,f.isObject)(i)?wa(Ba({},n),{[s]:xo(i,t)}):(n[s]=t,n)},{}),tn=xo;var ja=Object.defineProperty,Na=Object.defineProperties,Wa=Object.getOwnPropertyDescriptors,Mo=Object.getOwnPropertySymbols,$a=Object.prototype.hasOwnProperty,Ua=Object.prototype.propertyIsEnumerable,Lo=(o,t,n)=>t in o?ja(o,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[t]=n,ka=(o,t)=>{for(var n in t||(t={}))$a.call(t,n)&&Lo(o,n,t[n]);if(Mo)for(var n of Mo(t))Ua.call(t,n)&&Lo(o,n,t[n]);return o},Va=(o,t)=>Na(o,Wa(t));const za={initialData:{},modifiedData:{},layouts:{}},Ga=(o,t)=>(0,Qe.default)(o,n=>{switch(t.type){case"ON_CHANGE_COLLECTION_TYPE_GLOBAL_ACTION_CHECKBOX":{const{collectionTypeKind:s,actionId:i,value:d}=t,m=["modifiedData",s];Object.keys((0,f.get)(o,m)).forEach(g=>{const E=(0,f.get)(o,[...m,g,i],void 0);if(E){let b=tn(E,d);if(!d&&b.conditions){const S=tn(b.conditions,!1);b=Va(ka({},b),{conditions:S})}(0,f.set)(n,[...m,g,i],b)}});break}case"ON_CHANGE_COLLECTION_TYPE_ROW_LEFT_CHECKBOX":{const{pathToCollectionType:s,propertyName:i,rowName:d,value:m}=t;let g=(0,f.cloneDeep)(o.modifiedData);const E=s.split(".."),b=(0,f.get)(g,E,{});Object.keys(b).forEach(S=>{if((0,f.has)(b[S],`properties.${i}`)){const x=(0,f.get)(b,[S,"properties",i,d]),B=[...E,S,"properties",i,d];if(!(0,f.isObject)(x))(0,f.set)(g,B,m);else{const Q=tn(x,m);(0,f.set)(g,B,Q)}}}),m||(g=Nn(g)),(0,f.set)(n,"modifiedData",g);break}case"ON_CHANGE_CONDITIONS":{Object.entries(t.conditions).forEach(s=>{const[i,d]=s;(0,f.set)(n,["modifiedData",...i.split(".."),"conditions"],d)});break}case"ON_CHANGE_SIMPLE_CHECKBOX":{let s=(0,f.cloneDeep)(o.modifiedData);(0,f.set)(s,[...t.keys.split("..")],t.value),t.value||(s=Nn(s)),(0,f.set)(n,"modifiedData",s);break}case"ON_CHANGE_TOGGLE_PARENT_CHECKBOX":{const{keys:s,value:i}=t,d=[...s.split("..")];let m=(0,f.cloneDeep)(o.modifiedData);const g=(0,f.get)(m,d,{}),E=tn(g,i);(0,f.set)(m,d,E),i||(m=Nn(m)),(0,f.set)(n,["modifiedData"],m);break}case"RESET_FORM":{n.modifiedData=o.initialData;break}case"SET_FORM_AFTER_SUBMIT":{n.initialData=o.modifiedData;break}default:return n}}),Wn=o=>Object.entries(o).filter(([,t])=>t).map(([t])=>t),Za=o=>{const[t,{conditions:n}]=o;return{action:t,subject:null,conditions:Wn(n),properties:{}}},Ha=o=>Object.values(o).reduce((t,n)=>{const s=Object.entries(n).reduce((i,d)=>{const[,{properties:{enabled:m}}]=d;if(!m)return i;const g=Za(d);return i.push(g),i},[]);return[...t,...s]},[]),Io=o=>Object.values(o).reduce((t,n)=>{const s=Ha(n);return[...t,...s]},[]),Fo=(o,t="")=>Object.entries(o).reduce((n,s)=>{const[i,d]=s;return(0,f.isObject)(d)?[...n,...Fo(d,`${t}${i}.`)]:(d&&!(0,f.isObject)(d)&&n.push(`${t}${i}`),n)},[]),Ka=(o,t,{conditions:n,properties:s})=>Object.entries(s).reduce((i,d)=>{const[m,g]=d;return i.properties[m]=Fo(g),i},{action:o,subject:t,conditions:Wn(n),properties:{}}),Xa=(o,t,{conditions:n})=>({action:o,subject:t,properties:{},conditions:Wn(n)}),Ya=(o,t)=>Object.entries(t).reduce((s,i)=>{const[d,m]=i;if(!pt(m).some(b=>b))return s;if(!(0,f.has)(m,"properties.enabled")){const b=Ka(d,o,m);return[...s,b]}if(!m.properties.enabled)return s;const E=Xa(d,o,m);return s.push(E),s},[]),Bo=o=>Object.entries(o).reduce((n,s)=>{const[i,d]=s,m=Ya(i,d);return[...n,...m]},[]),Qa=o=>{const t=Io(o.plugins),n=Io(o.settings),s=Bo(o.collectionTypes),i=Bo(o.singleTypes);return[...t,...n,...s,...i]},Ja=[{labelId:"app.components.LeftMenuLinkContainer.collectionTypes",defaultMessage:"Collection Types",id:"collectionTypes"},{labelId:"app.components.LeftMenuLinkContainer.singleTypes",id:"singleTypes",defaultMessage:"Single Types"},{labelId:"app.components.LeftMenuLinkContainer.plugins",defaultMessage:"Plugins",id:"plugins"},{labelId:"app.components.LeftMenuLinkContainer.settings",defaultMessage:"Settings",id:"settings"}];var qa=Object.defineProperty,wo=Object.getOwnPropertySymbols,_a=Object.prototype.hasOwnProperty,es=Object.prototype.propertyIsEnumerable,jo=(o,t,n)=>t in o?qa(o,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[t]=n,No=(o,t)=>{for(var n in t||(t={}))_a.call(t,n)&&jo(o,n,t[n]);if(wo)for(var n of wo(t))es.call(t,n)&&jo(o,n,t[n]);return o};const $n=(0,e.forwardRef)(({layout:o,isFormDisabled:t,permissions:n},s)=>{const[{initialData:i,layouts:d,modifiedData:m},g]=(0,e.useReducer)(Ga,za,()=>Pa(o,n)),{formatMessage:E}=(0,K.useIntl)();(0,e.useImperativeHandle)(s,()=>({getPermissions(){const w=(0,ne.difference)(i.collectionTypes,m.collectionTypes),J=(0,ne.difference)(i.singleTypes,m.singleTypes),L=No(No({},w),J);let N;return we()(L)?N=!1:N=Object.values(L).some(te=>Object.values(te).some(ye=>Ce()(ye,"conditions"))),{permissionsToSend:Qa(m),didUpdateConditions:N}},resetForm(){g({type:"RESET_FORM"})},setFormAfterSubmit(){g({type:"SET_FORM_AFTER_SUBMIT"})}}));const b=(w,J,L,N)=>{g({type:"ON_CHANGE_COLLECTION_TYPE_ROW_LEFT_CHECKBOX",pathToCollectionType:w,propertyName:J,rowName:L,value:N})},S=(w,J,L)=>{g({type:"ON_CHANGE_COLLECTION_TYPE_GLOBAL_ACTION_CHECKBOX",collectionTypeKind:w,actionId:J,value:L})},x=w=>{g({type:"ON_CHANGE_CONDITIONS",conditions:w})},B=(0,e.useCallback)(({target:{name:w,value:J}})=>{g({type:"ON_CHANGE_SIMPLE_CHECKBOX",keys:w,value:J})},[]),Q=(0,e.useCallback)(({target:{name:w,value:J}})=>{g({type:"ON_CHANGE_TOGGLE_PARENT_CHECKBOX",keys:w,value:J})},[]);return e.createElement(ea,{value:{availableConditions:o.conditions,modifiedData:m,onChangeConditions:x,onChangeSimpleCheckbox:B,onChangeParentCheckbox:Q,onChangeCollectionTypeLeftActionRowCheckbox:b,onChangeCollectionTypeGlobalActionCheckbox:S}},e.createElement($.TabGroup,{id:"tabs",label:E({id:"Settings.permissions.users.tabs.label",defaultMessage:"Tabs Permissions"})},e.createElement($.Tabs,null,Ja.map(w=>e.createElement($.Tab,{key:w.id},E({id:w.labelId,defaultMessage:w.defaultMessage})))),e.createElement($.TabPanels,{style:{position:"relative"}},e.createElement($.TabPanel,null,e.createElement(oo,{layout:d.collectionTypes,kind:"collectionTypes",isFormDisabled:t})),e.createElement($.TabPanel,null,e.createElement(oo,{layout:d.singleTypes,kind:"singleTypes",isFormDisabled:t})),e.createElement($.TabPanel,null,e.createElement(po,{layout:d.plugins,kind:"plugins",isFormDisabled:t})),e.createElement($.TabPanel,null,e.createElement(po,{layout:d.settings,kind:"settings",isFormDisabled:t})))))});$n.defaultProps={permissions:[],layout:{conditions:[],sections:{collectionTypes:{},singleTypes:{actions:[]},settings:[],plugins:[]}}},$n.propTypes={layout:r().object,isFormDisabled:r().bool.isRequired,permissions:r().array};const ts=(0,e.memo)($n)},16437:(ue,O,a)=>{a.d(O,{Z:()=>C});const C=!0},78522:(ue,O,a)=>{a.d(O,{Z:()=>e});const e=()=>"todo empty role"},80779:(ue,O,a)=>{a.d(O,{Z:()=>Ge});var e=a(32735),C=a(60216),r=a.n(C),ne=a(9808),$=a.n(ne),Me=a(19192),Ce=a.n(Me),fe=a(53214),we=a.n(fe),K=a(95602),I=a.n(K),P=a(20763),U=a.n(P),le=a(88425),X=a.n(le),ee=a(5636),Ve=Object.defineProperty,$e=Object.getOwnPropertySymbols,ze=Object.prototype.hasOwnProperty,Ee=Object.prototype.propertyIsEnumerable,z=(se,q,ae)=>q in se?Ve(se,q,{enumerable:!0,configurable:!0,writable:!0,value:ae}):se[q]=ae,y=(se,q)=>{for(var ae in q||(q={}))ze.call(q,ae)&&z(se,ae,q[ae]);if($e)for(var ae of $e(q))Ee.call(q,ae)&&z(se,ae,q[ae]);return se};const ce=({id:se,name:q,description:ae,usersCount:lt,icons:Le,rowIndex:Xe})=>{const{formatMessage:Ye}=(0,ee.useIntl)(),je=Ye({id:"Roles.RoleRow.user-count",defaultMessage:"{number, plural, =0 {# user} one {# user} other {# users}}"},{number:lt});return e.createElement(fe.Tr,y({"aria-rowindex":Xe,key:se},(0,le.onRowClick)({fn:Le[1].onClick})),e.createElement(fe.Td,{maxWidth:(0,le.pxToRem)(130)},e.createElement(K.Typography,{ellipsis:!0,textColor:"neutral800"},q)),e.createElement(fe.Td,{maxWidth:(0,le.pxToRem)(250)},e.createElement(K.Typography,{ellipsis:!0,textColor:"neutral800"},ae)),e.createElement(fe.Td,null,e.createElement(K.Typography,{textColor:"neutral800"},je)),e.createElement(fe.Td,null,e.createElement(Me.Flex,y({justifyContent:"flex-end"},le.stopPropagation),Le.map((pe,Ze)=>pe?e.createElement(ne.Box,{key:pe.label,paddingLeft:Ze===0?0:1},e.createElement(P.IconButton,{onClick:pe.onClick,label:pe.label,noBorder:!0,icon:pe.icon})):null))))};ce.propTypes={id:r().number.isRequired,name:r().string.isRequired,description:r().string.isRequired,usersCount:r().number.isRequired,icons:r().array.isRequired,rowIndex:r().number.isRequired};const Ge=ce},45677:(ue,O,a)=>{a.d(O,{Z:()=>Je});var e=a(32735),C=a(88425),r=a(83983),ne=a(58469),$=a(59290),Me=a.n($),Ce=a(76470),fe=a.n(Ce),we=a(95717),K=a.n(we),I=a(68192),P=a.n(I),U=a(44526),le=a(11856),X=a(53214),ee=a(95602),Ve=a(16540),$e=a(28004),ze=a(5636),Ee=a(5141),z=a(80779),y=a(78522),ce=a(60216),Ge=a.n(ce),se=a(19615),q=a(64410),ae=a(54742),lt=a(20763),Le=a(61541),Xe=a(9808),Ye=a(19192),je=a(90662),pe=a(82372),Ze=a.n(pe),G=a(94009),Qe=a.n(G);const j=a.p+"6d21938306785f176538.png",W=a.p+"617f9c948fa79e6d73bd.png",F=se.default.div`
|
|
134
|
-
position: absolute;
|
|
135
|
-
z-index: 3;
|
|
136
|
-
inset: 0;
|
|
137
|
-
background: ${({theme:D})=>(0,C.setHexOpacity)(D.colors.neutral800,.2)};
|
|
138
|
-
padding: 0 ${({theme:D})=>D.spaces[8]};
|
|
139
|
-
`,Z=(0,se.default)(Ye.Flex)`
|
|
140
|
-
position: relative;
|
|
141
|
-
max-width: ${830/16}rem;
|
|
142
|
-
height: ${415/16}rem;
|
|
143
|
-
margin: 0 auto;
|
|
144
|
-
overflow: hidden;
|
|
145
|
-
margin-top: 10%;
|
|
146
|
-
padding-left: ${64/16}rem;
|
|
147
|
-
|
|
148
|
-
img:first-of-type {
|
|
149
|
-
position: absolute;
|
|
150
|
-
right: 0;
|
|
151
|
-
top: 0;
|
|
152
|
-
max-width: ${360/16}rem;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
img:not(:first-of-type) {
|
|
156
|
-
width: ${130/16}rem;
|
|
157
|
-
margin-left: 12%;
|
|
158
|
-
margin-right: ${20/16}rem;
|
|
159
|
-
z-index: 0;
|
|
160
|
-
}
|
|
161
|
-
`,de=(0,se.default)(je.Stack)`
|
|
162
|
-
align-items: flex-start;
|
|
163
|
-
max-width: ${400/16}rem;
|
|
164
|
-
z-index: 0;
|
|
165
|
-
`,k=(0,se.default)(Xe.Box)`
|
|
166
|
-
position: absolute;
|
|
167
|
-
right: ${({theme:D})=>D.spaces[4]};
|
|
168
|
-
top: ${({theme:D})=>D.spaces[4]};
|
|
169
|
-
`,Y=({onClose:D,isOpen:H})=>{(0,C.useLockScroll)(H);const{formatMessage:f}=(0,ze.useIntl)();return H?e.createElement(q.Portal,null,e.createElement(F,{onClick:D},e.createElement(ae.FocusTrap,{onEscape:D},e.createElement(Z,{onClick:oe=>oe.stopPropagation(),"aria-labelledby":"upgrade-plan",background:"neutral0",hasRadius:!0},e.createElement("img",{src:j,alt:"air-balloon"}),e.createElement(k,null,e.createElement(lt.IconButton,{onClick:D,"aria-label":"Close",icon:e.createElement(Qe(),null)})),e.createElement(de,{spacing:6},e.createElement(ee.Typography,{fontWeight:"bold",textColor:"primary600"},f({id:"app.components.UpgradePlanModal.text-ce",defaultMessage:"COMMUNITY EDITION"})),e.createElement(je.Stack,{spacing:2},e.createElement(ee.Typography,{variant:"alpha",as:"h2",id:"upgrade-plan"},f({id:"app.components.UpgradePlanModal.limit-reached",defaultMessage:"You have reached the limit"})),e.createElement(ee.Typography,null,f({id:"app.components.UpgradePlanModal.text-power",defaultMessage:"Unlock the full power of Strapi by upgrading your plan to the Enterprise Edition"}))),e.createElement(Le.LinkButton,{href:"https://strapi.io/pricing-self-hosted",isExternal:!0,endIcon:e.createElement(Ze(),null)},f({id:"app.components.UpgradePlanModal.button",defaultMessage:"Learn more"}))),e.createElement("img",{src:W,alt:"upgrade-arrow"}))))):null};Y.propTypes={onClose:Ge().func.isRequired,isOpen:Ge().bool.isRequired};const me=Y;var V=a(775);const be=()=>{const{roles:D,isLoading:H}=(0,V.bF)(),f=(0,C.useQuery)(),oe=decodeURIComponent(f.get("_q")||""),Te=(0,ne.ZP)(D,oe,{keys:["name","description"]});return{isLoading:H,sortedRoles:Te}},Ne=()=>{const{formatMessage:D}=(0,ze.useIntl)(),[H,f]=(0,e.useState)(!1),{trackUsage:oe}=(0,C.useTracking)(),{push:Te}=(0,Ee.useHistory)(),tt=(0,e.useCallback)(Ae=>{Te(`/settings/roles/${Ae}`)},[Te]),Ue=(0,e.useCallback)(()=>{f(Ae=>!Ae)},[]),_=(0,e.useCallback)(()=>{oe("didShowRBACUpgradeModal"),f(!0)},[oe]),ge=(0,e.useCallback)(Ae=>[{onClick:Ue,label:D({id:"app.utils.duplicate",defaultMessage:"Duplicate"}),icon:e.createElement(P(),null)},{onClick:()=>tt(Ae.id),label:D({id:"app.utils.edit",defaultMessage:"Edit"}),icon:e.createElement(K(),null)},{onClick:Ue,label:D({id:"global.delete",defaultMessage:"Delete"}),icon:e.createElement(fe(),null)}],[D,Ue,tt]);return{isModalOpen:H,handleToggleModalForCreatingRole:_,handleToggle:Ue,getIcons:ge}},He=()=>{const{formatMessage:D}=(0,ze.useIntl)();(0,C.useFocusWhenNavigate)();const{sortedRoles:H,isLoading:f}=be(),{isModalOpen:oe,handleToggle:Te,handleToggleModalForCreatingRole:tt,getIcons:Ue}=Ne(),_=H.length+1,ge=5;return e.createElement(Ve.Main,null,e.createElement(C.SettingsPageTitle,{name:"Roles"}),e.createElement(le.HeaderLayout,{primaryAction:e.createElement(U.Button,{onClick:tt,startIcon:e.createElement(Me(),null),size:"S"},D({id:"Settings.roles.list.button.add",defaultMessage:"Add new role"})),title:D({id:"global.roles",defaultMessage:"roles"}),subtitle:D({id:"Settings.roles.list.description",defaultMessage:"List of roles"})}),e.createElement(le.ContentLayout,null,e.createElement(X.Table,{colCount:ge,rowCount:_,footer:e.createElement(X.TFooter,{onClick:tt,icon:e.createElement(Me(),null)},D({id:"Settings.roles.list.button.add",defaultMessage:"Add new role"}))},e.createElement(X.Thead,null,e.createElement(X.Tr,null,e.createElement(X.Th,null,e.createElement(ee.Typography,{variant:"sigma",textColor:"neutral600"},D({id:"global.name",defaultMessage:"Name"}))),e.createElement(X.Th,null,e.createElement(ee.Typography,{variant:"sigma",textColor:"neutral600"},D({id:"global.description",defaultMessage:"Description"}))),e.createElement(X.Th,null,e.createElement(ee.Typography,{variant:"sigma",textColor:"neutral600"},D({id:"global.users",defaultMessage:"Users"}))),e.createElement(X.Th,null,e.createElement($e.VisuallyHidden,null,D({id:"global.actions",defaultMessage:"Actions"}))))),e.createElement(X.Tbody,null,H==null?void 0:H.map((Ae,Rt)=>e.createElement(z.Z,{key:Ae.id,id:Ae.id,name:Ae.name,description:Ae.description,usersCount:Ae.usersCount,icons:Ue(Ae),rowIndex:Rt+2})))),!_&&!f&&e.createElement(y.Z,null)),e.createElement(me,{isOpen:oe,onClose:Te}))},Je=()=>e.createElement(C.CheckPagePermissions,{permissions:r.Z.settings.roles.main},e.createElement(He,null))},75936:(ue,O,a)=>{a.d(O,{Z:()=>C});const C=[]},20178:(ue,O,a)=>{a.d(O,{Z:()=>Ze});var e=a(32735),C=a(64213),r=a(88425),ne=a(9808),$=a(44526),Me=a(11856),Ce=a(78330),fe=a(16540),we=a(19192),K=a(90662),I=a(95602),P=a(37178),U=a(90353),le=a(98599),X=a.n(le),ee=a(83281),Ve=a(33795),$e=a.n(Ve),ze=a(86834),Ee=a.n(ze),z=a(5636),y=a(5141),ce=a(19615),Ge=a(37511),se=a(775),q=a(83983),ae=a(5173);const Le=ae.Ry().shape({name:ae.Z_().required(r.translatedErrors.required),description:ae.Z_().required(r.translatedErrors.required)});var Xe=a(98399),Ye=(G,Qe,j)=>new Promise((W,F)=>{var Z=Y=>{try{k(j.next(Y))}catch(me){F(me)}},de=Y=>{try{k(j.throw(Y))}catch(me){F(me)}},k=Y=>Y.done?W(Y.value):Promise.resolve(Y.value).then(Z,de);k((j=j.apply(G,Qe)).next())});const je=ce.default.div`
|
|
170
|
-
border: 1px solid ${({theme:G})=>G.colors.primary200};
|
|
171
|
-
background: ${({theme:G})=>G.colors.primary100};
|
|
172
|
-
padding: ${({theme:G})=>`${G.spaces[2]} ${G.spaces[4]}`};
|
|
173
|
-
color: ${({theme:G})=>G.colors.primary600};
|
|
174
|
-
border-radius: ${({theme:G})=>G.borderRadius};
|
|
175
|
-
font-size: ${12/16}rem;
|
|
176
|
-
font-weight: bold;
|
|
177
|
-
`,pe=()=>{const G=(0,r.useNotification)(),{lockApp:Qe,unlockApp:j}=(0,r.useOverlayBlocker)(),{formatMessage:W}=(0,z.useIntl)(),[F,Z]=(0,e.useState)(!1),{replace:de}=(0,y.useHistory)(),k=(0,e.useRef)(),{trackUsage:Y}=(0,r.useTracking)(),me=(0,y.useRouteMatch)("/settings/roles/duplicate/:id"),V=$e()(me,"params.id",null),{isLoading:be,data:Ne}=(0,se.U_)(),{permissions:at,isLoading:He}=(0,se.Dq)(V),st=D=>{Qe(),Z(!0),Y(V?"willDuplicateRole":"willCreateNewRole"),Promise.resolve((0,r.request)("/admin/roles",{method:"POST",body:D})).then(H=>Ye(void 0,null,function*(){const{permissionsToSend:f}=k.current.getPermissions();return Y(V?"didDuplicateRole":"didCreateNewRole"),H.data.id&&!Ee()(f)&&(yield(0,r.request)(`/admin/roles/${H.data.id}/permissions`,{method:"PUT",body:{permissions:f}})),H})).then(H=>{Z(!1),G({type:"success",message:{id:"Settings.roles.created",defaultMessage:"created"}}),de(`/settings/roles/${H.data.id}`)}).catch(H=>{Xe.error(H),Z(!1),G({type:"warning",message:{id:"notification.error"}})}).finally(()=>{j()})},Je=`${W({id:"Settings.roles.form.created",defaultMessage:"Created"})} ${(0,C.format)(new Date,"PPP")}`;return e.createElement(fe.Main,null,e.createElement(r.SettingsPageTitle,{name:"Roles"}),e.createElement(ee.Formik,{initialValues:{name:"",description:Je},onSubmit:st,validationSchema:Le,validateOnChange:!1},({handleSubmit:D,values:H,errors:f,handleReset:oe,handleChange:Te})=>e.createElement(r.Form,{noValidate:!0},e.createElement(e.Fragment,null,e.createElement(Me.HeaderLayout,{primaryAction:e.createElement(K.Stack,{horizontal:!0,spacing:2},e.createElement($.Button,{variant:"secondary",onClick:()=>{oe(),k.current.resetForm()},size:"L"},W({id:"app.components.Button.reset",defaultMessage:"Reset"})),e.createElement($.Button,{onClick:D,loading:F,size:"L"},W({id:"global.save",defaultMessage:"Save"}))),title:W({id:"Settings.roles.create.title",defaultMessage:"Create a role"}),subtitle:W({id:"Settings.roles.create.description",defaultMessage:"Define the rights given to the role"}),navigationAction:e.createElement(r.Link,{startIcon:e.createElement(X(),null),to:"/settings/roles"},W({id:"global.back",defaultMessage:"Back"}))}),e.createElement(Me.ContentLayout,null,e.createElement(K.Stack,{spacing:6},e.createElement(ne.Box,{background:"neutral0",padding:6,shadow:"filterShadow",hasRadius:!0},e.createElement(K.Stack,{spacing:4},e.createElement(we.Flex,{justifyContent:"space-between"},e.createElement(ne.Box,null,e.createElement(ne.Box,null,e.createElement(I.Typography,{fontWeight:"bold"},W({id:"global.details",defaultMessage:"Details"}))),e.createElement(ne.Box,null,e.createElement(I.Typography,{variant:"pi",textColor:"neutral600"},W({id:"Settings.roles.form.description",defaultMessage:"Name and description of the role"})))),e.createElement(je,null,W({id:"Settings.roles.form.button.users-with-role",defaultMessage:"{number, plural, =0 {# users} one {# user} other {# users}} with this role"},{number:0}))),e.createElement(Ce.Grid,{gap:4},e.createElement(Ce.GridItem,{col:6},e.createElement(P.TextInput,{name:"name",error:f.name&&W({id:f.name}),label:W({id:"global.name",defaultMessage:"Name"}),onChange:Te,value:H.name})),e.createElement(Ce.GridItem,{col:6},e.createElement(U.Textarea,{label:W({id:"global.description",defaultMessage:"Description"}),name:"description",error:f.description&&W({id:f.description}),onChange:Te},H.description))))),!be&&!He?e.createElement(ne.Box,{shadow:"filterShadow",hasRadius:!0},e.createElement(Ge.Z,{isFormDisabled:!1,ref:k,permissions:at,layout:Ne})):e.createElement(ne.Box,{background:"neutral0",padding:6,shadow:"filterShadow",hasRadius:!0},e.createElement(r.LoadingIndicatorPage,null))))))))};function Ze(){return e.createElement(r.CheckPagePermissions,{permissions:q.Z.settings.roles.create},e.createElement(pe,null))}},56899:(ue,O,a)=>{a.d(O,{Z:()=>C});const C=!1},68464:(ue,O,a)=>{a.d(O,{Z:()=>C});const C=!1},32741:(ue,O,a)=>{a.d(O,{Z:()=>C});const C=!1},19665:(ue,O,a)=>{a.d(O,{Z:()=>C});const C=!1},36950:(ue,O,a)=>{a.d(O,{Z:()=>C});const C=!1},96556:(ue,O,a)=>{a.d(O,{Z:()=>C});const C=!1},51899:(ue,O,a)=>{a.d(O,{Z:()=>Qe});var e=a(32735),C=a(88425),r=a(83983),ne=a(59290),$=a.n(ne),Me=a(76470),Ce=a.n(Me),fe=a(68192),we=a.n(fe),K=a(95717),I=a.n(K),P=a(44526),U=a(11856),le=a(28004),X=a(16540),ee=a(53214),Ve=a(95602),$e=a(92891),ze=a(58469),Ee=a(5636),z=a(5141),y=a(17247),ce=a(775),Ge=a(78522),se=a(80779),q=a(49415);const ae={roleToDelete:null,showModalConfirmButtonLoading:!1,shouldRefetchData:!1},Le=(j,W)=>(0,q.default)(j,F=>{switch(W.type){case"ON_REMOVE_ROLES":{F.showModalConfirmButtonLoading=!0;break}case"ON_REMOVE_ROLES_SUCCEEDED":{F.shouldRefetchData=!0,F.roleToDelete=null;break}case"RESET_DATA_TO_DELETE":{F.shouldRefetchData=!1,F.roleToDelete=null,F.showModalConfirmButtonLoading=!1;break}case"SET_ROLE_TO_DELETE":{F.roleToDelete=W.id;break}default:return F}});var Xe=(j,W,F)=>new Promise((Z,de)=>{var k=V=>{try{me(F.next(V))}catch(be){de(be)}},Y=V=>{try{me(F.throw(V))}catch(be){de(be)}},me=V=>V.done?Z(V.value):Promise.resolve(V.value).then(k,Y);me((F=F.apply(j,W)).next())});const Ye=()=>{(0,C.useFocusWhenNavigate)();const{isLoading:j,allowedActions:{canCreate:W,canDelete:F,canRead:Z,canUpdate:de}}=(0,C.useRBAC)(r.Z.settings.roles),{getData:k,roles:Y,isLoading:me}=(0,ce.bF)(!1),[{query:V}]=(0,C.useQueryParams)(),be=(V==null?void 0:V._q)||"",Ne=(0,ze.ZP)(Y,be,{keys:["name","description"]});return(0,e.useEffect)(()=>{!j&&Z&&k()},[j,Z,k]),{isLoadingForPermissions:j,canCreate:W,canDelete:F,canRead:Z,canUpdate:de,isLoading:me,getData:k,sortedRoles:Ne,roles:Y}},je=({getData:j,canCreate:W,canDelete:F,canUpdate:Z})=>{const{formatMessage:de}=(0,Ee.useIntl)(),k=(0,C.useNotification)(),[Y,me]=(0,e.useState)(!1),{push:V}=(0,z.useHistory)(),[{selectedRoles:be,showModalConfirmButtonLoading:Ne,roleToDelete:at},He]=(0,e.useReducer)(Le,ae),st=()=>Xe(void 0,null,function*(){try{He({type:"ON_REMOVE_ROLES"}),yield y.be.post("/admin/roles/batch-delete",{ids:[at]}),yield j(),He({type:"RESET_DATA_TO_DELETE"})}catch(_){const ge=(0,$e.get)(_,["response","payload","data","ids"],null);if(ge&&Array.isArray(ge)){const Ae=ge.join(`
|
|
178
|
-
`);k({type:"warning",message:Ae})}else k({type:"warning",message:{id:"notification.error"}})}f()}),Je=(0,e.useCallback)(_=>{V(`/settings/roles/duplicate/${_}`)},[V]),D=()=>V("/settings/roles/new"),H=(0,e.useCallback)(_=>{He({type:"SET_ROLE_TO_DELETE",id:_}),f()},[]),f=()=>me(_=>!_),oe=(0,e.useCallback)(_=>{V(`/settings/roles/${_}`)},[V]),Te=(0,e.useCallback)((_,ge)=>{_.preventDefault(),_.stopPropagation(),ge.usersCount?k({type:"info",message:{id:"Roles.ListPage.notification.delete-not-allowed"}}):H(ge.id)},[k,H]),tt=(0,e.useCallback)((_,ge)=>{_.preventDefault(),_.stopPropagation(),Je(ge.id)},[Je]),Ue=(0,e.useCallback)(_=>[...W?[{onClick:ge=>tt(ge,_),label:de({id:"app.utils.duplicate",defaultMessage:"Duplicate"}),icon:e.createElement(we(),null)}]:[],...Z?[{onClick:()=>oe(_.id),label:de({id:"app.utils.edit",defaultMessage:"Edit"}),icon:e.createElement(I(),null)}]:[],...F?[{onClick:ge=>Te(ge,_),label:de({id:"global.delete",defaultMessage:"Delete"}),icon:e.createElement(Ce(),null)}]:[]],[de,Te,tt,oe,W,Z,F]);return{handleNewRoleClick:D,getIcons:Ue,selectedRoles:be,isWarningDeleteAllOpened:Y,showModalConfirmButtonLoading:Ne,handleToggleModal:f,handleDeleteData:st}},Ze=()=>{const{formatMessage:j}=(0,Ee.useIntl)(),{isLoadingForPermissions:W,canCreate:F,canRead:Z,canDelete:de,canUpdate:k,isLoading:Y,getData:me,sortedRoles:V}=Ye(),{handleNewRoleClick:be,getIcons:Ne,isWarningDeleteAllOpened:at,showModalConfirmButtonLoading:He,handleToggleModal:st,handleDeleteData:Je}=je({getData:me,canCreate:F,canDelete:de,canUpdate:k}),D=V.length+1,H=6;if(W)return e.createElement(X.Main,null,e.createElement(C.LoadingIndicatorPage,null));const f=j({id:"global.roles",defaultMessage:"roles"});return e.createElement(X.Main,null,e.createElement(C.SettingsPageTitle,{name:"Roles"}),e.createElement(U.HeaderLayout,{primaryAction:F?e.createElement(P.Button,{onClick:be,startIcon:e.createElement($(),null),size:"S"},j({id:"Settings.roles.list.button.add",defaultMessage:"Add new role"})):null,title:f,subtitle:j({id:"Settings.roles.list.description",defaultMessage:"List of roles"}),as:"h2"}),Z&&e.createElement(U.ActionLayout,{startActions:e.createElement(C.SearchURLQuery,{label:j({id:"app.component.search.label",defaultMessage:"Search for {target}"},{target:f})})}),Z&&e.createElement(U.ContentLayout,null,e.createElement(ee.Table,{colCount:H,rowCount:D,footer:F?e.createElement(ee.TFooter,{onClick:be,icon:e.createElement($(),null)},j({id:"Settings.roles.list.button.add",defaultMessage:"Add new role"})):null},e.createElement(ee.Thead,null,e.createElement(ee.Tr,{"aria-rowindex":1},e.createElement(ee.Th,null,e.createElement(Ve.Typography,{variant:"sigma",textColor:"neutral600"},j({id:"global.name",defaultMessage:"Name"}))),e.createElement(ee.Th,null,e.createElement(Ve.Typography,{variant:"sigma",textColor:"neutral600"},j({id:"global.description",defaultMessage:"Description"}))),e.createElement(ee.Th,null,e.createElement(Ve.Typography,{variant:"sigma",textColor:"neutral600"},j({id:"global.users",defaultMessage:"Users"}))),e.createElement(ee.Th,null,e.createElement(le.VisuallyHidden,null,j({id:"global.actions",defaultMessage:"Actions"}))))),e.createElement(ee.Tbody,null,V==null?void 0:V.map((oe,Te)=>e.createElement(se.Z,{key:oe.id,id:oe.id,name:oe.name,description:oe.description,usersCount:oe.usersCount,icons:Ne(oe),rowIndex:Te+2})))),!D&&!Y&&e.createElement(Ge.Z,null)),e.createElement(C.ConfirmDialog,{isOpen:at,onConfirm:Je,isConfirmButtonLoading:He,onToggleDialog:st}))},Qe=()=>e.createElement(C.CheckPagePermissions,{permissions:r.Z.settings.roles.main},e.createElement(Ze,null))},63775:(ue,O,a)=>{a.d(O,{Z:()=>ne});var e=($,Me,Ce)=>new Promise((fe,we)=>{var K=U=>{try{P(Ce.next(U))}catch(le){we(le)}},I=U=>{try{P(Ce.throw(U))}catch(le){we(le)}},P=U=>U.done?fe(U.value):Promise.resolve(U.value).then(K,I);P((Ce=Ce.apply($,Me)).next())});const ne=[...strapi.features.isEnabled(strapi.features.SSO)?[{Component(){return e(this,null,function*(){return yield a.e(302).then(a.bind(a,49851))})},to:"/settings/single-sign-on",exact:!0}]:[]]}}]);
|