node_modules ignore

This commit is contained in:
oier committed 2025-05-08 23:43:47 +02:00
1 parent e19d52f172
commit 4574544c9f
65041 files changed
+10593536

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
Copyright (c) 2015-present Strapi Solutions SAS
* All software that resides within this directory and its subdirectories, is licensed under the license defined below.
Enterprise License
If you or the company you represent has entered into a written agreement referencing the Enterprise Edition of the Strapi source code available at
https://github.com/strapi/strapi, then such agreement applies to your use of the Enterprise Edition of the Strapi Software. If you or the company you
represent is using the Enterprise Edition of the Strapi Software in connection with a subscription to our cloud offering, then the agreement you have
agreed to with respect to our cloud offering and the licenses included in such agreement apply to your use of the Enterprise Edition of the Strapi Software.
Otherwise, the Strapi Enterprise Software License Agreement (found here https://strapi.io/enterprise-terms) applies to your use of the Enterprise Edition of the Strapi Software.
BY ACCESSING OR USING THE ENTERPRISE EDITION OF THE STRAPI SOFTWARE, YOU ARE AGREEING TO BE BOUND BY THE RELEVANT REFERENCED AGREEMENT.
IF YOU ARE NOT AUTHORIZED TO ACCEPT THESE TERMS ON BEHALF OF THE COMPANY YOU REPRESENT OR IF YOU DO NOT AGREE TO ALL OF THE RELEVANT TERMS AND CONDITIONS REFERENCED AND YOU
HAVE NOT OTHERWISE EXECUTED A WRITTEN AGREEMENT WITH STRAPI, YOU ARE NOT AUTHORIZED TO ACCESS OR USE OR ALLOW ANY USER TO ACCESS OR USE ANY PART OF
THE ENTERPRISE EDITION OF THE STRAPI SOFTWARE. YOUR ACCESS RIGHTS ARE CONDITIONAL ON YOUR CONSENT TO THE RELEVANT REFERENCED TERMS TO THE EXCLUSION OF ALL OTHER TERMS;
IF THE RELEVANT REFERENCED TERMS ARE CONSIDERED AN OFFER BY YOU, ACCEPTANCE IS EXPRESSLY LIMITED TO THE RELEVANT REFERENCED TERMS.
@@ -0,0 +1,6 @@
'use strict';
var img = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAtAAAAMJCAMAAAAdz/H9AAADAFBMVEUAAABMSf+GvPCEvPFL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xX9EFdkPoq1aCq24LGX4CoScM2FuMCOpzmSdIINwUNzk3CRBzlUkhBlnIrjSzo6vhKmuzSkDdOIH8Oi3nUzWuy3oRT1uIfiW1S9GXztaz4A5aY9GCzdhaXVT031cuMSK00xPAlK5Cckeihtoce9NaWp7wgW7JME4bmY5ju13tCQ8eGov28xSaFmOlyqg9766tacwGi5aPI9XhTLRkui//gqWiTVQLnDaMXbR+2brr1QeuvDMmgt/ApWHVmws6+8N1Pmhhwxl5/h6xo467DOg3rAXqT4A7g+Ie6BvI4e1A9gjEY4lRCrRHANt88wQ0AF1aPpQn3EiBLOIbuQwsMFtcTVHAY3p0Gf4XfWlOdu2801BYGsc0q/QXIBOfJK7AMqY1USChE4ko9GLo5izy9HL4EqQZYvnpkEpCznThdjITmEWmh3StOdH4Y+uHKdy6U4jK+teIvZznvnbyryMhWiR8+4CgT6ybT0MSnTxHBXQn9x/05aMMRT6l1BohnjGWUw0koU/cCbQOCsfLdT+yQzMnnvlTiEdvwE5jn/ZxXbHETskpW9nBUT57rvvA5q3Im7jqL Line truncated
module.exports = img;
//# sourceMappingURL=balloon.png.js.map
@@ -0,0 +1 @@
{"version":3,"file":"balloon.png.js","sources":["../../../admin/src/assets/balloon.png"],"sourcesContent":["var img = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAtAAAAMJCAMAAAAdz/H9AAADAFBMVEUAAABMSf+GvPCEvPFLR/98t++EvPFJRP9JRv+OwPJ8uO+Nv/KEu/CGvfJ+uPCPwfL/k5p5tu99uO9/ufF2tfB6t/F1s+2Lv/GIvfCFvPKCu/Jzs/CRwvODuvCOwPGNwPNwse4xNUqIvvMuM0dVWP9cY/9cTVFgR1dHOkxYQ1OVxPQxVnhWSU741ql+VmE9NUo7P1z4058vUnJPP1BrTFp2UV3t3t342bP5z5Ts2NH0wn/3yYmhcVgyN0/ZrH9RSFn/QWTxunhFRGCZ2+r/kIBlcf//R2zTpnresYVr0OZGQVb/mIbs08czXYGsgGWrdlq1h2laU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A2Zq8g8iJjfg5wC/LkJBUsm11BDBshsDG6es6415Y4oOHOhjJjUfilLcs5LntO6eoEHfy3kqQyiKpbJJoJtxHdo7DgDMB3+LJTJr25Bu2Jr/wRw309qPsyhXH4UAXnl+tjfEcafJcEw0T7cmW/ZfhfGfdgeM5UOgam+XZG+E4NDIEdF0h81B6DwCGWG7sqwRaRSq4775HHnnY4gBiEzHbnO3csRMx2zljkO3V+S9MLAefIpBI1yGeSbQaHCiokBb2xX9EFdkPoq1aCq24LGX4CoScM2FuMCOpzmSdIINwUNzk3CRBzlUkhBlnIrjSzo6vhKmuzSkDdOIH8Oi3nUzWuy3oRT1uIfiW1S9GXztaz4A5aY9GCzdhaXVT031cuMSK00xPAlK5Cckeihtoce9NaWp7wgW7JME4bmY5ju13tCQ8eGov28xSaFmOlyqg9766tacwGi5aPI9XhTLRkui//gqWiTVQLnDaMXbR+2brr1QeuvDMmgt/ApWHVmws6+8N1Pmhhwxl5/h6xo467DOg3rAXqT4A7g+Ie6BvI4e1A9gjEY4lRCrRHANt88wQ0AF1aPpQn3EiBLOIbuQwsMFtcTVHAY3p0Gf4XfWlOdu2801BYGsc0q/QXIBOfJK7AMqY1USChE4ko9GLo5izy9HL4EqQZYvnpkEpCznThdjITmEWmh3StOdH4Y+uHKdy6U4jK+teIvZznvnbyryMhWiR8+4CgT6ybT0MSnTxHBXQn9x/05aMMRT6l1BohnjGWUw0koU/cCbQOCsfLdT+yQzMnnvlTiEdvwE5jn/ZxXbHETskpW9nBUT57rvvA5q3Im7jqL Line truncated
export { img as default };
//# sourceMappingURL=balloon.png.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"balloon.png.mjs","sources":["../../../admin/src/assets/balloon.png"],"sourcesContent":["var img = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAtAAAAMJCAMAAAAdz/H9AAADAFBMVEUAAABMSf+GvPCEvPFLR/98t++EvPFJRP9JRv+OwPJ8uO+Nv/KEu/CGvfJ+uPCPwfL/k5p5t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rjSzo6vhKmuzSkDdOIH8Oi3nUzWuy3oRT1uIfiW1S9GXztaz4A5aY9GCzdhaXVT031cuMSK00xPAlK5Cckeihtoce9NaWp7wgW7JME4bmY5ju13tCQ8eGov28xSaFmOlyqg9766tacwGi5aPI9XhTLRkui//gqWiTVQLnDaMXbR+2brr1QeuvDMmgt/ApWHVmws6+8N1Pmhhwxl5/h6xo467DOg3rAXqT4A7g+Ie6BvI4e1A9gjEY4lRCrRHANt88wQ0AF1aPpQn3EiBLOIbuQwsMFtcTVHAY3p0Gf4XfWlOdu2801BYGsc0q/QXIBOfJK7AMqY1USChE4ko9GLo5izy9HL4EqQZYvnpkEpCznThdjITmEWmh3StOdH4Y+uHKdy6U4jK+teIvZznvnbyryMhWiRLine truncated
@@ -0,0 +1,6 @@
'use strict';
var img = "data:image/svg+xml,%3csvg width='1440' height='810' viewBox='0 0 1440 810' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cg clip-path='url(%23clip0_347_22402)'%3e%3crect width='1440' height='810' fill='%23181826'/%3e%3cg filter='url(%23filter0_d_347_22402)'%3e%3cg clip-path='url(%23clip1_347_22402)'%3e%3cpath d='M80 -166C80 -168.209 81.7909 -170 84 -170H1516C1518.21 -170 1520 -168.209 1520 -166V726C1520 728.209 1518.21 730 1516 730H84C81.7908 730 80 728.209 80 726V-166Z' fill='white'/%3e%3cg clip-path='url(%23clip2_347_22402)'%3e%3cmask id='path-3-inside-1_347_22402' fill='white'%3e%3cpath d='M80 -170H136V730H80V-170Z'/%3e%3c/mask%3e%3cpath d='M80 -170H136V730H80V-170Z' fill='%23212134'/%3e%3cpath d='M135 -170V730H137V-170H135Z' fill='%2332324D' mask='url(%23path-3-inside-1_347_22402)'/%3e%3cpath d='M116.078 -4.53593C116.078 -4.53593 116.078 -4.52811 116.078 -4.52421L111.531 10.4711C111.462 10.7147 111.321 10.9313 111.125 11.0921C110.93 11.2528 110.69 11.3499 110.438 11.3703C110.402 11.3734 110.366 11.375 110.33 11.375C110.093 11.3757 109.862 11.3088 109.662 11.1822C109.462 11.0555 109.303 10.8744 109.203 10.6602L106.413 4.77032C106.386 4.71205 106.377 4.64669 106.388 4.5832C106.399 4.5197 106.429 4.46117 106.475 4.41563L110.948 -0.0585837C111.061 -0.176748 111.122 -0.334092 111.12 -0.497068C111.118 -0.660044 111.053 -0.815757 110.937 -0.931008C110.822 -1.04626 110.666 -1.11193 110.503 -1.11402C110.34 -1.1161 110.183 -1.05444 110.065 -0.942178L105.584 3.53126C105.539 3.57687 105.48 3.60728 105.417 3.61833C105.353 3.62938 105.288 3.62052 105.23 3.59298L99.3704 0.817197C99.1402 0.711768 98.9466 0.540421 98.8139 0.324856C98.6812 0.109291 98.6155 -0.140797 98.6251 -0.39374C98.6378 -0.653713 98.7319 -0.903111 98.8941 -1.10667C99.0563 -1.31023 99.2784 -1.45766 99.529 -1.52812L114.524 -6.07499H114.536C114.749 -6.13497 114.975 -6.13708 115.19 -6.08108C115.404 -6.02509 115.6 -5.91302 115.757 -5.75636C115.914 -5.59971 116.027 -5.40411 116.083 -5.18964C116.139 -4.97517 116.138 -4.74955 116.078 -4.53593Z' fill='%238E8EA9'/%3e%3cpath d='M114.875 39.125H103.625C103.293 39.125 102.976 39.2567 102.741 39.4911C102.507 39.7255 102.375 40.0435 102.375 40.375V41.625H101.125C100.793 41.625 100.476 41.7567 100.241 41.9911C100.007 42.2255 99.875 42.5435 99.875 42.875V51.625C99.875 51.9565 100.007 52.2745 100.241 52.5089C100.476 52.7433 100.793 52.875 101.125 52.875H112.375C112.707 52.875 113.024 52.7433 113.259 52.5089C113.493 52.2745 113.625 51.9565 113.625 51.625V50.375H114.875C115.207 50.375 115.524 50.2433 115.759 50.0089C115.993 49.7745 116.125 49.4565 116.125 49.125V40.375C116.125 40.0435 115.993 39.7255 115.759 39.4911C115.524 39.2567 115.207 39.125 114.875 39.125ZM111.438 41.625C111.623 41.625 111.804 41.68 111.958 41.783C112.113 41.886 112.233 42.0324 112.304 42.2037C112.375 42.375 112.393 42.5635 112.357 42.7454C112.321 42.9273 112.232 43.0943 112.1 43.2254C111.969 43.3565 111.802 43.4458 111.62 43.482C111.439 43.5182 111.25 43.4996 111.079 43.4286C110.907 43.3577 110.761 43.2375 110.658 43.0833C110.555 42.9292 110.5 42.7479 110.5 42.5625C110.5 42.3139 110.599 42.0754 110.775 41.8996C110.95 41.7238 111.189 41.625 111.438 41.625ZM112.375 51.625H101.125V42.875H102.375V49.125C102.375 49.4565 102.507 49.7745 102.741 50.0089C102.976 50.2433 103.293 50.375 103.625 50.375H112.375V51.625ZM114.875 49.125H103.625V46.3125L106.438 43.5L110.317 47.3797C110.434 47.4968 110.593 47.5626 110.759 47.5626C110.925 47.5626 111.084 47.4968 111.201 47.3797L113.205 45.375L114.875 47.0453V49.125Z' fill='%238E8EA9'/%3e%3cpath d='M114.875 83.125H101.125C100.793 83.125 100.476 83.2567 100.241 83.4911C100.007 83.7255 99.875 84.0435 99.875 84.375V95.625C99.875 95.9565 100.007 96.2745 100.241 96.5089C100.476 96.7433 100.793 96.875 101.125 96.875H114.875C115.207 96.875 115.524 96.7433 115.759 96.5089C115.993 96.2745 116.125 95.9565 116.125 95.625V84.375C116.125 84.0435 115.993 83.7255 115.759 83.4911C115.524 83.2567 115.207 83.125 114.875 83.125ZM101.125 84.375H114.875V87.5H101.125V84.375ZM114.875 95.625H106.75V88.75H114.875V95.625Z' fill='%238E8EA9'/%3e%3cg clip-path='url(%23clip3_347_22402)'%3e%3cpath d='M105.5 140.875C105.5 141.122 105.427 141.364 105.289 141.569C105.152 141.775 104.957 141.935 104.728 142.03C104.5 142.124 104.249 142.149 104.006 142.101C103.764 142.053 103.541 141.934 103.366 141.759C103.191 141.584 103.072 141.361 103.024 141.119C102.976 140.876 103.001 140.625 103.095 140.397C103.19 140.168 103.35 139.973 103.556 139.836C103.761 139.698 104.003 139.625 104.25 139.625C104.582 139.625 104.899 139.757 105.134 139.991C105.368 140.226 105.5 140.543 105.5 140.875ZM112.375 139.625C112.128 139.625 111.886 139.698 111.681 139.836C111.475 139.973 111.315 140.168 111.22 140.397C111.126 140.625 111.101 140.876 111.149 141.119C111.197 141.361 111.316 141.584 111.491 141.759C111.666 141.934 111.889 142.053 112.131 142.101C112.374 142.149 112.625 142.124 112.853 142.03C113.082 141.935 113.277 141.775 113.414 141.569C113.552 14Line truncated
module.exports = img;
//# sourceMappingURL=purchase-page-illustration-dark.svg.js.map
@@ -0,0 +1 @@
{"version":3,"file":"purchase-page-illustration-dark.svg.js","sources":["../../../admin/src/assets/purchase-page-illustration-dark.svg"],"sourcesContent":["var img = \"data:image/svg+xml,%3csvg width='1440' height='810' viewBox='0 0 1440 810' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cg clip-path='url(%23clip0_347_22402)'%3e%3crect width='1440' height='810' fill='%23181826'/%3e%3cg filter='url(%23filter0_d_347_22402)'%3e%3cg clip-path='url(%23clip1_347_22402)'%3e%3cpath d='M80 -166C80 -168.209 81.7909 -170 84 -170H1516C1518.21 -170 1520 -168.209 1520 -166V726C1520 728.209 1518.21 730 1516 730H84C81.7908 730 80 728.209 80 726V-166Z' fill='white'/%3e%3cg clip-path='url(%23clip2_347_22402)'%3e%3cmask id='path-3-inside-1_347_22402' fill='white'%3e%3cpath d='M80 -170H136V730H80V-170Z'/%3e%3c/mask%3e%3cpath d='M80 -170H136V730H80V-170Z' fill='%23212134'/%3e%3cpath d='M135 -170V730H137V-170H135Z' fill='%2332324D' mask='url(%23path-3-inside-1_347_22402)'/%3e%3cpath d='M116.078 -4.53593C116.078 -4.53593 116.078 -4.52811 116.078 -4.52421L111.531 10.4711C111.462 10.7147 111.321 10.9313 111.125 11.0921C110.93 11.2528 110.69 11.3499 110.438 11.3703C110.402 11.3734 110.366 11.375 110.33 11.375C110.093 11.3757 109.862 11.3088 109.662 11.1822C109.462 11.0555 109.303 10.8744 109.203 10.6602L106.413 4.77032C106.386 4.71205 106.377 4.64669 106.388 4.5832C106.399 4.5197 106.429 4.46117 106.475 4.41563L110.948 -0.0585837C111.061 -0.176748 111.122 -0.334092 111.12 -0.497068C111.118 -0.660044 111.053 -0.815757 110.937 -0.931008C110.822 -1.04626 110.666 -1.11193 110.503 -1.11402C110.34 -1.1161 110.183 -1.05444 110.065 -0.942178L105.584 3.53126C105.539 3.57687 105.48 3.60728 105.417 3.61833C105.353 3.62938 105.288 3.62052 105.23 3.59298L99.3704 0.817197C99.1402 0.711768 98.9466 0.540421 98.8139 0.324856C98.6812 0.109291 98.6155 -0.140797 98.6251 -0.39374C98.6378 -0.653713 98.7319 -0.903111 98.8941 -1.10667C99.0563 -1.31023 99.2784 -1.45766 99.529 -1.52812L114.524 -6.07499H114.536C114.749 -6.13497 114.975 -6.13708 115.19 -6.08108C115.404 -6.02509 115.6 -5.91302 115.757 -5.75636C115.914 -5.59971 116.027 -5.40411 116.083 -5.18964C116.139 -4.97517 116.138 -4.74955 116.078 -4.53593Z' fill='%238E8EA9'/%3e%3cpath d='M114.875 39.125H103.625C103.293 39.125 102.976 39.2567 102.741 39.4911C102.507 39.7255 102.375 40.0435 102.375 40.375V41.625H101.125C100.793 41.625 100.476 41.7567 100.241 41.9911C100.007 42.2255 99.875 42.5435 99.875 42.875V51.625C99.875 51.9565 100.007 52.2745 100.241 52.5089C100.476 52.7433 100.793 52.875 101.125 52.875H112.375C112.707 52.875 113.024 52.7433 113.259 52.5089C113.493 52.2745 113.625 51.9565 113.625 51.625V50.375H114.875C115.207 50.375 115.524 50.2433 115.759 50.0089C115.993 49.7745 116.125 49.4565 116.125 49.125V40.375C116.125 40.0435 115.993 39.7255 115.759 39.4911C115.524 39.2567 115.207 39.125 114.875 39.125ZM111.438 41.625C111.623 41.625 111.804 41.68 111.958 41.783C112.113 41.886 112.233 42.0324 112.304 42.2037C112.375 42.375 112.393 42.5635 112.357 42.7454C112.321 42.9273 112.232 43.0943 112.1 43.2254C111.969 43.3565 111.802 43.4458 111.62 43.482C111.439 43.5182 111.25 43.4996 111.079 43.4286C110.907 43.3577 110.761 43.2375 110.658 43.0833C110.555 42.9292 110.5 42.7479 110.5 42.5625C110.5 42.3139 110.599 42.0754 110.775 41.8996C110.95 41.7238 111.189 41.625 111.438 41.625ZM112.375 51.625H101.125V42.875H102.375V49.125C102.375 49.4565 102.507 49.7745 102.741 50.0089C102.976 50.2433 103.293 50.375 103.625 50.375H112.375V51.625ZM114.875 49.125H103.625V46.3125L106.438 43.5L110.317 47.3797C110.434 47.4968 110.593 47.5626 110.759 47.5626C110.925 47.5626 111.084 47.4968 111.201 47.3797L113.205 45.375L114.875 47.0453V49.125Z' fill='%238E8EA9'/%3e%3cpath d='M114.875 83.125H101.125C100.793 83.125 100.476 83.2567 100.241 83.4911C100.007 83.7255 99.875 84.0435 99.875 84.375V95.625C99.875 95.9565 100.007 96.2745 100.241 96.5089C100.476 96.7433 100.793 96.875 101.125 96.875H114.875C115.207 96.875 115.524 96.7433 115.759 96.5089C115.993 96.2745 116.125 95.9565 116.125 95.625V84.375C116.125 84.0435 115.993 83.7255 115.759 83.4911C115.524 83.2567 115.207 83.125 114.875 83.125ZM101.125 84.375H114.875V87.5H101.125V84.375ZM114.875 95.625H106.75V88.75H114.875V95.625Z' fill='%238E8EA9'/%3e%3cg clip-path='url(%23clip3_347_22402)'%3e%3cpath d='M105.5 140.875C105.5 141.122 105.427 141.364 105.289 141.569C105.152 141.775 104.957 141.935 104.728 142.03C104.5 142.124 104.249 142.149 104.006 142.101C103.764 142.053 103.541 141.934 103.366 141.759C103.191 141.584 103.072 141.361 103.024 141.119C102.976 140.876 103.001 140.625 103.095 140.397C103.19 140.168 103.35 139.973 103.556 139.836C103.761 139.698 104.003 139.625 104.25 139.625C104.582 139.625 104.899 139.757 105.134 139.991C105.368 140.226 105.5 140.543 105.5 140.875ZM112.375 139.625C112.128 139.625 111.886 139.698 111.681 139.836C111.475 139.973 111.315 140.168 111.22 140.397C111.126 140.625 111.101 140.876 111.149 141.119C111.197 141.361 111.316 141.584 111.491 141.Line truncated
@@ -0,0 +1,4 @@
var img = "data:image/svg+xml,%3csvg width='1440' height='810' viewBox='0 0 1440 810' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cg clip-path='url(%23clip0_347_22402)'%3e%3crect width='1440' height='810' fill='%23181826'/%3e%3cg filter='url(%23filter0_d_347_22402)'%3e%3cg clip-path='url(%23clip1_347_22402)'%3e%3cpath d='M80 -166C80 -168.209 81.7909 -170 84 -170H1516C1518.21 -170 1520 -168.209 1520 -166V726C1520 728.209 1518.21 730 1516 730H84C81.7908 730 80 728.209 80 726V-166Z' fill='white'/%3e%3cg clip-path='url(%23clip2_347_22402)'%3e%3cmask id='path-3-inside-1_347_22402' fill='white'%3e%3cpath d='M80 -170H136V730H80V-170Z'/%3e%3c/mask%3e%3cpath d='M80 -170H136V730H80V-170Z' fill='%23212134'/%3e%3cpath d='M135 -170V730H137V-170H135Z' fill='%2332324D' mask='url(%23path-3-inside-1_347_22402)'/%3e%3cpath d='M116.078 -4.53593C116.078 -4.53593 116.078 -4.52811 116.078 -4.52421L111.531 10.4711C111.462 10.7147 111.321 10.9313 111.125 11.0921C110.93 11.2528 110.69 11.3499 110.438 11.3703C110.402 11.3734 110.366 11.375 110.33 11.375C110.093 11.3757 109.862 11.3088 109.662 11.1822C109.462 11.0555 109.303 10.8744 109.203 10.6602L106.413 4.77032C106.386 4.71205 106.377 4.64669 106.388 4.5832C106.399 4.5197 106.429 4.46117 106.475 4.41563L110.948 -0.0585837C111.061 -0.176748 111.122 -0.334092 111.12 -0.497068C111.118 -0.660044 111.053 -0.815757 110.937 -0.931008C110.822 -1.04626 110.666 -1.11193 110.503 -1.11402C110.34 -1.1161 110.183 -1.05444 110.065 -0.942178L105.584 3.53126C105.539 3.57687 105.48 3.60728 105.417 3.61833C105.353 3.62938 105.288 3.62052 105.23 3.59298L99.3704 0.817197C99.1402 0.711768 98.9466 0.540421 98.8139 0.324856C98.6812 0.109291 98.6155 -0.140797 98.6251 -0.39374C98.6378 -0.653713 98.7319 -0.903111 98.8941 -1.10667C99.0563 -1.31023 99.2784 -1.45766 99.529 -1.52812L114.524 -6.07499H114.536C114.749 -6.13497 114.975 -6.13708 115.19 -6.08108C115.404 -6.02509 115.6 -5.91302 115.757 -5.75636C115.914 -5.59971 116.027 -5.40411 116.083 -5.18964C116.139 -4.97517 116.138 -4.74955 116.078 -4.53593Z' fill='%238E8EA9'/%3e%3cpath d='M114.875 39.125H103.625C103.293 39.125 102.976 39.2567 102.741 39.4911C102.507 39.7255 102.375 40.0435 102.375 40.375V41.625H101.125C100.793 41.625 100.476 41.7567 100.241 41.9911C100.007 42.2255 99.875 42.5435 99.875 42.875V51.625C99.875 51.9565 100.007 52.2745 100.241 52.5089C100.476 52.7433 100.793 52.875 101.125 52.875H112.375C112.707 52.875 113.024 52.7433 113.259 52.5089C113.493 52.2745 113.625 51.9565 113.625 51.625V50.375H114.875C115.207 50.375 115.524 50.2433 115.759 50.0089C115.993 49.7745 116.125 49.4565 116.125 49.125V40.375C116.125 40.0435 115.993 39.7255 115.759 39.4911C115.524 39.2567 115.207 39.125 114.875 39.125ZM111.438 41.625C111.623 41.625 111.804 41.68 111.958 41.783C112.113 41.886 112.233 42.0324 112.304 42.2037C112.375 42.375 112.393 42.5635 112.357 42.7454C112.321 42.9273 112.232 43.0943 112.1 43.2254C111.969 43.3565 111.802 43.4458 111.62 43.482C111.439 43.5182 111.25 43.4996 111.079 43.4286C110.907 43.3577 110.761 43.2375 110.658 43.0833C110.555 42.9292 110.5 42.7479 110.5 42.5625C110.5 42.3139 110.599 42.0754 110.775 41.8996C110.95 41.7238 111.189 41.625 111.438 41.625ZM112.375 51.625H101.125V42.875H102.375V49.125C102.375 49.4565 102.507 49.7745 102.741 50.0089C102.976 50.2433 103.293 50.375 103.625 50.375H112.375V51.625ZM114.875 49.125H103.625V46.3125L106.438 43.5L110.317 47.3797C110.434 47.4968 110.593 47.5626 110.759 47.5626C110.925 47.5626 111.084 47.4968 111.201 47.3797L113.205 45.375L114.875 47.0453V49.125Z' fill='%238E8EA9'/%3e%3cpath d='M114.875 83.125H101.125C100.793 83.125 100.476 83.2567 100.241 83.4911C100.007 83.7255 99.875 84.0435 99.875 84.375V95.625C99.875 95.9565 100.007 96.2745 100.241 96.5089C100.476 96.7433 100.793 96.875 101.125 96.875H114.875C115.207 96.875 115.524 96.7433 115.759 96.5089C115.993 96.2745 116.125 95.9565 116.125 95.625V84.375C116.125 84.0435 115.993 83.7255 115.759 83.4911C115.524 83.2567 115.207 83.125 114.875 83.125ZM101.125 84.375H114.875V87.5H101.125V84.375ZM114.875 95.625H106.75V88.75H114.875V95.625Z' fill='%238E8EA9'/%3e%3cg clip-path='url(%23clip3_347_22402)'%3e%3cpath d='M105.5 140.875C105.5 141.122 105.427 141.364 105.289 141.569C105.152 141.775 104.957 141.935 104.728 142.03C104.5 142.124 104.249 142.149 104.006 142.101C103.764 142.053 103.541 141.934 103.366 141.759C103.191 141.584 103.072 141.361 103.024 141.119C102.976 140.876 103.001 140.625 103.095 140.397C103.19 140.168 103.35 139.973 103.556 139.836C103.761 139.698 104.003 139.625 104.25 139.625C104.582 139.625 104.899 139.757 105.134 139.991C105.368 140.226 105.5 140.543 105.5 140.875ZM112.375 139.625C112.128 139.625 111.886 139.698 111.681 139.836C111.475 139.973 111.315 140.168 111.22 140.397C111.126 140.625 111.101 140.876 111.149 141.119C111.197 141.361 111.316 141.584 111.491 141.759C111.666 141.934 111.889 142.053 112.131 142.101C112.374 142.149 112.625 142.124 112.853 142.03C113.082 141.935 113.277 141.775 113.414 141.569C113.552 14Line truncated
export { img as default };
//# sourceMappingURL=purchase-page-illustration-dark.svg.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"purchase-page-illustration-dark.svg.mjs","sources":["../../../admin/src/assets/purchase-page-illustration-dark.svg"],"sourcesContent":["var img = \"data:image/svg+xml,%3csvg width='1440' height='810' viewBox='0 0 1440 810' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cg clip-path='url(%23clip0_347_22402)'%3e%3crect width='1440' height='810' fill='%23181826'/%3e%3cg filter='url(%23filter0_d_347_22402)'%3e%3cg clip-path='url(%23clip1_347_22402)'%3e%3cpath d='M80 -166C80 -168.209 81.7909 -170 84 -170H1516C1518.21 -170 1520 -168.209 1520 -166V726C1520 728.209 1518.21 730 1516 730H84C81.7908 730 80 728.209 80 726V-166Z' fill='white'/%3e%3cg clip-path='url(%23clip2_347_22402)'%3e%3cmask id='path-3-inside-1_347_22402' fill='white'%3e%3cpath d='M80 -170H136V730H80V-170Z'/%3e%3c/mask%3e%3cpath d='M80 -170H136V730H80V-170Z' fill='%23212134'/%3e%3cpath d='M135 -170V730H137V-170H135Z' fill='%2332324D' mask='url(%23path-3-inside-1_347_22402)'/%3e%3cpath d='M116.078 -4.53593C116.078 -4.53593 116.078 -4.52811 116.078 -4.52421L111.531 10.4711C111.462 10.7147 111.321 10.9313 111.125 11.0921C110.93 11.2528 110.69 11.3499 110.438 11.3703C110.402 11.3734 110.366 11.375 110.33 11.375C110.093 11.3757 109.862 11.3088 109.662 11.1822C109.462 11.0555 109.303 10.8744 109.203 10.6602L106.413 4.77032C106.386 4.71205 106.377 4.64669 106.388 4.5832C106.399 4.5197 106.429 4.46117 106.475 4.41563L110.948 -0.0585837C111.061 -0.176748 111.122 -0.334092 111.12 -0.497068C111.118 -0.660044 111.053 -0.815757 110.937 -0.931008C110.822 -1.04626 110.666 -1.11193 110.503 -1.11402C110.34 -1.1161 110.183 -1.05444 110.065 -0.942178L105.584 3.53126C105.539 3.57687 105.48 3.60728 105.417 3.61833C105.353 3.62938 105.288 3.62052 105.23 3.59298L99.3704 0.817197C99.1402 0.711768 98.9466 0.540421 98.8139 0.324856C98.6812 0.109291 98.6155 -0.140797 98.6251 -0.39374C98.6378 -0.653713 98.7319 -0.903111 98.8941 -1.10667C99.0563 -1.31023 99.2784 -1.45766 99.529 -1.52812L114.524 -6.07499H114.536C114.749 -6.13497 114.975 -6.13708 115.19 -6.08108C115.404 -6.02509 115.6 -5.91302 115.757 -5.75636C115.914 -5.59971 116.027 -5.40411 116.083 -5.18964C116.139 -4.97517 116.138 -4.74955 116.078 -4.53593Z' fill='%238E8EA9'/%3e%3cpath d='M114.875 39.125H103.625C103.293 39.125 102.976 39.2567 102.741 39.4911C102.507 39.7255 102.375 40.0435 102.375 40.375V41.625H101.125C100.793 41.625 100.476 41.7567 100.241 41.9911C100.007 42.2255 99.875 42.5435 99.875 42.875V51.625C99.875 51.9565 100.007 52.2745 100.241 52.5089C100.476 52.7433 100.793 52.875 101.125 52.875H112.375C112.707 52.875 113.024 52.7433 113.259 52.5089C113.493 52.2745 113.625 51.9565 113.625 51.625V50.375H114.875C115.207 50.375 115.524 50.2433 115.759 50.0089C115.993 49.7745 116.125 49.4565 116.125 49.125V40.375C116.125 40.0435 115.993 39.7255 115.759 39.4911C115.524 39.2567 115.207 39.125 114.875 39.125ZM111.438 41.625C111.623 41.625 111.804 41.68 111.958 41.783C112.113 41.886 112.233 42.0324 112.304 42.2037C112.375 42.375 112.393 42.5635 112.357 42.7454C112.321 42.9273 112.232 43.0943 112.1 43.2254C111.969 43.3565 111.802 43.4458 111.62 43.482C111.439 43.5182 111.25 43.4996 111.079 43.4286C110.907 43.3577 110.761 43.2375 110.658 43.0833C110.555 42.9292 110.5 42.7479 110.5 42.5625C110.5 42.3139 110.599 42.0754 110.775 41.8996C110.95 41.7238 111.189 41.625 111.438 41.625ZM112.375 51.625H101.125V42.875H102.375V49.125C102.375 49.4565 102.507 49.7745 102.741 50.0089C102.976 50.2433 103.293 50.375 103.625 50.375H112.375V51.625ZM114.875 49.125H103.625V46.3125L106.438 43.5L110.317 47.3797C110.434 47.4968 110.593 47.5626 110.759 47.5626C110.925 47.5626 111.084 47.4968 111.201 47.3797L113.205 45.375L114.875 47.0453V49.125Z' fill='%238E8EA9'/%3e%3cpath d='M114.875 83.125H101.125C100.793 83.125 100.476 83.2567 100.241 83.4911C100.007 83.7255 99.875 84.0435 99.875 84.375V95.625C99.875 95.9565 100.007 96.2745 100.241 96.5089C100.476 96.7433 100.793 96.875 101.125 96.875H114.875C115.207 96.875 115.524 96.7433 115.759 96.5089C115.993 96.2745 116.125 95.9565 116.125 95.625V84.375C116.125 84.0435 115.993 83.7255 115.759 83.4911C115.524 83.2567 115.207 83.125 114.875 83.125ZM101.125 84.375H114.875V87.5H101.125V84.375ZM114.875 95.625H106.75V88.75H114.875V95.625Z' fill='%238E8EA9'/%3e%3cg clip-path='url(%23clip3_347_22402)'%3e%3cpath d='M105.5 140.875C105.5 141.122 105.427 141.364 105.289 141.569C105.152 141.775 104.957 141.935 104.728 142.03C104.5 142.124 104.249 142.149 104.006 142.101C103.764 142.053 103.541 141.934 103.366 141.759C103.191 141.584 103.072 141.361 103.024 141.119C102.976 140.876 103.001 140.625 103.095 140.397C103.19 140.168 103.35 139.973 103.556 139.836C103.761 139.698 104.003 139.625 104.25 139.625C104.582 139.625 104.899 139.757 105.134 139.991C105.368 140.226 105.5 140.543 105.5 140.875ZM112.375 139.625C112.128 139.625 111.886 139.698 111.681 139.836C111.475 139.973 111.315 140.168 111.22 140.397C111.126 140.625 111.101 140.876 111.149 141.119C111.197 141.361 111.316 141.584 111.491 141Line truncated
@@ -0,0 +1,6 @@
'use strict';
var img = "data:image/svg+xml,%3csvg width='520' height='284' viewBox='0 0 520 284' fill='none' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3crect width='519.5' height='284' transform='translate(0.5)' fill='url(%23pattern0_347_12437)'/%3e%3cdefs%3e%3cpattern id='pattern0_347_12437' patternContentUnits='objectBoundingBox' width='1' height='1'%3e%3cuse xlink:href='%23image0_347_12437' transform='matrix(0.000347222 0 0 0.000635148 0 -0.0144696)'/%3e%3c/pattern%3e%3cimage id='image0_347_12437' width='2880' height='1620' xlink:href='data:image/png%3bbase64%2ciVBORw0KGgoAAAANSUhEUgAAC0AAAAZUCAYAAABy34MtAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAsIO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dVYH%2btHvzzXd98Pmyy2Y6AAAA5N9gnRsDAAAAAAAAAAAAAIDqEYCG15VIdRQLelQbAKn38MjFF0/zAwAAAPKvwf9KsIvwMwAAAAAAAAAAAAAAOTTKoe5ZqCOqBF34WTEN4QIAAADACBL9QLCBADQAAAAAAAAAAAAAADlEABqewsxp4Y5iGeeujDSILZO2LJlpAAAA1Iou0s8AAAAAAACD4tSp027Hjmfc4cPHHAAAAAAA1RjtgB4KJyvjEeY8qsl82DJpy5IhAQAAQC2xc2SMHKtW3RePt7evd5XQzdktW550e/a86Do6TvvP1q69zS1ceI0fb2l5JL5x29Jyl5s6dZIDAAAAAAB9NTV9s/sa%2bgM/ruvzyy%2bf42rZ228fcm1tT/jxWbOmu3XrbncAAAAAgMFFABo9VZm7fLDDAh7Fgh5WxZkgCAAAAEaq6AkpnPCmUYD4yBEL%2ba5JvUG5ceNWt3PnM348DAiHduzY3X2D84d%2b/PLLL%2ble1zfdUHj11Tdctdaube2zvELRveveF9%2b8Re365TP/4A7/1z/z4//%2bH/Y6AAAAABgoe/b8xLW1fS9%2bv2rVH7qlS29w9Si8flZ4uNYD0Pr3gf78m8NQ4HoXAAAAwEgzyqHuWa6j3Op2ySrRlW4HAAAAQO1SFSPdpNTwyiv7UuexILAG3dwtNc%2bsWZ93ead9tRuZquyswHZ7e2tquBu1qePl6Lv6ycmT7teH3/ODf3/qZDwOAAAAAP2hJwrZtbCGHTuecfVq9eoV/lXX2AN1ba0fZF9%2b%2bc1%2b0Hgt0HfA2tzS8h03GLjeBQAAADBSEYBGavC5WFhZ81sV6Eq3AwAAANQCqj9nu%2bKKS%2bNxhZiTkhWPdHM3zf7978TjtVDlyapey/XXX%2bOWLv1Sd7svdePHj3Oofbrh%2b9OVK9z/%2bsqC%2bLNPjZ/gfv7/bvKf/ey%2b Line truncated
module.exports = img;
//# sourceMappingURL=purchase-page-illustration-light.svg.js.map
@@ -0,0 +1 @@
{"version":3,"file":"purchase-page-illustration-light.svg.js","sources":["../../../admin/src/assets/purchase-page-illustration-light.svg"],"sourcesContent":["var img = \"data:image/svg+xml,%3csvg width='520' height='284' viewBox='0 0 520 284' fill='none' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3crect width='519.5' height='284' transform='translate(0.5)' fill='url(%23pattern0_347_12437)'/%3e%3cdefs%3e%3cpattern id='pattern0_347_12437' patternContentUnits='objectBoundingBox' width='1' height='1'%3e%3cuse xlink:href='%23image0_347_12437' transform='matrix(0.000347222 0 0 0.000635148 0 -0.0144696)'/%3e%3c/pattern%3e%3cimage id='image0_347_12437' width='2880' height='1620' xlink:href='data:image/png%3bbase64%2ciVBORw0KGgoAAAANSUhEUgAAC0AAAAZUCAYAAABy34MtAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAsIOSURBVHgB7N0PkBX1ne/93xAMKwxo3ICAegMJf56rchf8Tx5RiKnNiuA%2bee7Cs0xt6oq6UGUi5i7olmNuOdYu493oVEU0bjFrIKl9CrKw96auIO5uXZSItcZ/q1ui9xGIuBsFhNwsgUFDjDPPfH49357f6ek%2b/%2bZfnznvV1V7%2bpz%2b9%2btfH7Cb/pxvN5w40dXlULd09Bsa9Nr3axB93nf%2b4F3m/L3zdRVdvrOzw49NnHiuy4vXXtvv9ux53Q2Uiy%2be5r7ylavi93//9y%2b5t956N3P%2bZcsWugsvnOTy7PjxE/61sXGsQ7Zf/OKke%2bihv3YffXSm4POzzx7j7r77a%2b688ya4obJ370vu3nu/7cdnzpyeeuyOHj3ujhw55sc3b364e75pfeZpbX3M7dq1x2UZP36cmzFjmrvuuqvc7/3eQv8%2bzbJld/ht3XjjQnfffd9w/fX003vc%2bvWP%2bfHt2x93U6b0/TO0adM2P8jzz/9t1eu79to/SF0mq8%2bS6ytXsm%2bs7%2bfNu8Q9%2bugDmctZ%2b7Ss1hFSn2/evC31GGofNf%2btty53AAbH4cPH/evUqRMd8k/nxxo6O/X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4uNYD0Pr3gf78m8NQ4HoXAAAAwEgzyqHuWa6j3Op2ySrRlW4HAAAAQO1SFSPdpNTwyiv7UuexILAG3dwtNc%2bsWZ93ead9tRuZquyswHZ7e2tquBu1qePl6Lv6ycmT7teH3/ODf3/qZDwOAAAAAP2hJwrZtbCGHTuecfVq9eoV/lXX2AN1ba0fZF9%2b%2bc1%2b0Hgt0HfA2tzLine truncated
@@ -0,0 +1,4 @@
var img = "data:image/svg+xml,%3csvg width='520' height='284' viewBox='0 0 520 284' fill='none' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3crect width='519.5' height='284' transform='translate(0.5)' fill='url(%23pattern0_347_12437)'/%3e%3cdefs%3e%3cpattern id='pattern0_347_12437' patternContentUnits='objectBoundingBox' width='1' height='1'%3e%3cuse xlink:href='%23image0_347_12437' transform='matrix(0.000347222 0 0 0.000635148 0 -0.0144696)'/%3e%3c/pattern%3e%3cimage id='image0_347_12437' width='2880' height='1620' xlink:href='data:image/png%3bbase64%2ciVBORw0KGgoAAAANSUhEUgAAC0AAAAZUCAYAAABy34MtAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAsIOSURBVHgB7N0PkBX1ne/93xAMKwxo3ICAegMJf56rchf8Tx5RiKnNiuA%2bee7Cs0xt6oq6UGUi5i7olmNuOdYu493oVEU0bjFrIKl9CrKw96auIO5uXZSItcZ/q1ui9xGIuBsFhNwsgUFDjDPPfH49357f6ek%2b/%2bZfnznvV1V7%2bpz%2b9%2btfH7Cb/pxvN5w40dXlULd09Bsa9Nr3axB93nf%2b4F3m/L3zdRVdvrOzw49NnHiuy4vXXtvv9ux53Q2Uiy%2be5r7ylavi93//9y%2b5t956N3P%2bZcsWugsvnOTy7PjxE/61sXGsQ7Zf/OKke%2bihv3YffXSm4POzzx7j7r77a%2b688ya4obJ370vu3nu/7cdnzpyeeuyOHj3ujhw55sc3b364e75pfeZpbX3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AAAAgMFFABo9VZm7fLDDAh7Fgh5WxZkgCAAAAEaq6AkpnPCmUYD4yBEL%2ba5JvUG5ceNWt3PnM348DAiHduzY3X2D84d%2b/PLLL%2ble1zfdUHj11Tdctdaube2zvELRveveF9%2b8Re365TP/4A7/1z/z4//%2bH/Y6AAAAABgoe/b8xLW1fS9%2bv2rVH7qlS29w9Si8flZ4uNYD0Pr3gf78m8NQ4HoXAAAAwEgzyqHuWa6j3Op2ySrRlW4HAAAAQO1SFSPdpNTwyiv7UuexILAG3dwtNc%2bsWZ93ead9tRuZquyswHZ7e2tquBu1qePl6Lv6ycmT7teH3/ODf3/qZDwOAAAAAP2hJwrZtbCGHTuecfVq9eoV/lXX2AN1ba0fZF9%2b%2bc1%2b0Hgt0HfA2tzS8h03GLjeBQAAADBSEYBGavC5WFhZ81sV6Eq3AwAAANQCqj9nu%2bKKS%2bNxhZiTkhWPdHM3zf7978TjtVDlyapey/XXX%2bOWLv1Sd7svdePHj3Oofbrh%2b9OVK9z/%2bsqC%2bLNPjZ/gfv7/bvKf/ey%2b Line truncated
export { img as default };
//# sourceMappingURL=purchase-page-illustration-light.svg.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"purchase-page-illustration-light.svg.mjs","sources":["../../../admin/src/assets/purchase-page-illustration-light.svg"],"sourcesContent":["var img = \"data:image/svg+xml,%3csvg width='520' height='284' viewBox='0 0 520 284' fill='none' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3crect width='519.5' height='284' transform='translate(0.5)' fill='url(%23pattern0_347_12437)'/%3e%3cdefs%3e%3cpattern id='pattern0_347_12437' patternContentUnits='objectBoundingBox' width='1' height='1'%3e%3cuse xlink:href='%23image0_347_12437' transform='matrix(0.000347222 0 0 0.000635148 0 -0.0144696)'/%3e%3c/pattern%3e%3cimage id='image0_347_12437' width='2880' height='1620' xlink:href='data:image/png%3bbase64%2ciVBORw0KGgoAAAANSUhEUgAAC0AAAAZUCAYAAABy34Mt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kUfp4//5KCzyZMGOcmTjzXAQAAAAAAAAAAAAAAAAAAoDKjHepeFGhu8JWf7f1ghJvrOTAdVYH%2btHvzzXd98Pmyy2Y6AAAA5N9gnRsDAAAAAAAAAAAAAIDqEYCG15VIdRQLelQbAKn38MjFF0/zAwAAAPKvwf9KsIvwMwAAAAAAAAAAAAAAOTTKoe5ZqCOqBF34WTEN4QIAAADACBL9QLCBADQAAAAAAAAAAAAAADlEABqewsxp4Y5iGeeujDSILZO2LJlpAAAA1Iou0s8AAAAAAACD4tSp027Hjmfc4cPHHAAAAAAA1RjtgB4KJyvjEeY8qsl82DJpy5IhAQAAQC2xc2SMHKtW3RePt7evd5XQzdktW550e/a86Do6TvvP1q69zS1ceI0fb2l5JL5x29Jyl5s6dZIDAAAAAAB9NTV9s/sa%2bgM/ruvzyy%2bf42rZ228fcm1tT/jxWbOmu3XrbncAAAAAgMFFABo9VZm7fLDDAh7Fgh5WxZkgCAAAAEaq6AkpnPCmUYD4yBEL%2ba5JvUG5ceNWt3PnM348DAiHduzY3X2D84d%2b/PLLL%2ble1zfdUHj11Tdctdaube2zvELRveveF9%2b8Re365TP/4A7/1z/z4//%2bH/Y6AAAAABgoe/b8xLW1fS9%2bv2rVH7qlS29w9Si8flZ4uNYD0Pr3gf78m8NQ4HoXAAAAwEgzyqHuWa6j3Op2ySrRlW4HAAAAQO1SFSPdpNTwyiv7UuexILAG3dwtNc%2bsWZ93ead9tRuZquyswHZ7e2tquBu1qePl6Lv6ycmT7teH3/ODf3/qZDwOAAAAAP2hJwrZtbCGHTuecfVq9eoV/lXX2AN1ba0fZF9%2b%2bc1%2b0Hgt0HfA2tLine truncated
@@ -0,0 +1,122 @@
'use strict';
var jsxRuntime = require('react/jsx-runtime');
require('react');
var designSystem = require('@strapi/design-system');
var icons = require('@strapi/icons');
var reactIntl = require('react-intl');
var styledComponents = require('styled-components');
var balloon = require('../assets/balloon.png.js');
const CTA_LEARN_MORE_HREF = 'https://strapi.io/pricing-cloud';
const CTA_SALES_HREF = 'https://strapi.io/contact-sales';
const Title = ({ children })=>{
return /*#__PURE__*/ jsxRuntime.jsx(designSystem.Modal.Title, {
variant: "alpha",
children: children
});
};
const Body = ({ children })=>{
return /*#__PURE__*/ jsxRuntime.jsx(designSystem.Typography, {
variant: "omega",
children: children
});
};
const CallToActions = ()=>{
const { formatMessage } = reactIntl.useIntl();
return /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Flex, {
gap: 2,
paddingTop: 4,
children: [
/*#__PURE__*/ jsxRuntime.jsx(designSystem.LinkButton, {
variant: "default",
isExternal: true,
href: CTA_LEARN_MORE_HREF,
children: formatMessage({
id: 'Settings.review-workflows.limit.cta.learn',
defaultMessage: 'Learn more'
})
}),
/*#__PURE__*/ jsxRuntime.jsx(designSystem.LinkButton, {
variant: "tertiary",
isExternal: true,
href: CTA_SALES_HREF,
children: formatMessage({
id: 'Settings.review-workflows.limit.cta.sales',
defaultMessage: 'Contact Sales'
})
})
]
});
};
const BalloonImage = styledComponents.styled.img`
// Margin top|right reverse the padding of ModalBody
margin-right: ${({ theme })=>`-${theme.spaces[7]}`};
margin-top: ${({ theme })=>`-${theme.spaces[7]}`};
width: 360px;
`;
const Root = ({ children, open = false, onOpenChange })=>{
const { formatMessage } = reactIntl.useIntl();
return /*#__PURE__*/ jsxRuntime.jsx(designSystem.Modal.Root, {
open: open,
onOpenChange: onOpenChange,
children: /*#__PURE__*/ jsxRuntime.jsx(designSystem.Modal.Content, {
children: /*#__PURE__*/ jsxRuntime.jsx(designSystem.Modal.Body, {
children: /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Flex, {
gap: 2,
paddingLeft: 7,
position: "relative",
children: [
/*#__PURE__*/ jsxRuntime.jsxs(designSystem.Flex, {
alignItems: "start",
direction: "column",
gap: 2,
width: "60%",
children: [
children,
/*#__PURE__*/ jsxRuntime.jsx(CallToActions, {})
]
}),
/*#__PURE__*/ jsxRuntime.jsxs(designSystem.Flex, {
justifyContent: "end",
height: "100%",
width: "40%",
children: [
/*#__PURE__*/ jsxRuntime.jsx(BalloonImage, {
src: balloon,
"aria-hidden": true,
alt: "",
loading: "lazy"
}),
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Box, {
display: "flex",
position: "absolute",
right: 0,
top: 0,
children: /*#__PURE__*/ jsxRuntime.jsx(designSystem.Modal.Close, {
children: /*#__PURE__*/ jsxRuntime.jsx(designSystem.IconButton, {
withTooltip: false,
label: formatMessage({
id: 'global.close',
defaultMessage: 'Close'
}),
children: /*#__PURE__*/ jsxRuntime.jsx(icons.Cross, {})
})
})
})
]
})
]
})
})
})
});
};
const LimitsModal = {
Title,
Body,
Root
};
exports.LimitsModal = LimitsModal;
//# sourceMappingURL=LimitsModal.js.map
@@ -0,0 +1 @@
{"version":3,"file":"LimitsModal.js","sources":["../../../admin/src/components/LimitsModal.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { Box, Flex, IconButton, Modal, Typography, LinkButton } from '@strapi/design-system';\nimport { Cross } from '@strapi/icons';\nimport { useIntl } from 'react-intl';\nimport { styled } from 'styled-components';\n\nimport balloonImageSrc from '../assets/balloon.png';\n\nconst CTA_LEARN_MORE_HREF = 'https://strapi.io/pricing-cloud';\nconst CTA_SALES_HREF = 'https://strapi.io/contact-sales';\n\nconst Title: React.FC<React.PropsWithChildren> = ({ children }) => {\n return <Modal.Title variant=\"alpha\">{children}</Modal.Title>;\n};\n\nconst Body: React.FC<React.PropsWithChildren> = ({ children }) => {\n return <Typography variant=\"omega\">{children}</Typography>;\n};\n\nconst CallToActions = () => {\n const { formatMessage } = useIntl();\n\n return (\n <Flex gap={2} paddingTop={4}>\n <LinkButton variant=\"default\" isExternal href={CTA_LEARN_MORE_HREF}>\n {formatMessage({\n id: 'Settings.review-workflows.limit.cta.learn',\n defaultMessage: 'Learn more',\n })}\n </LinkButton>\n\n <LinkButton variant=\"tertiary\" isExternal href={CTA_SALES_HREF}>\n {formatMessage({\n id: 'Settings.review-workflows.limit.cta.sales',\n defaultMessage: 'Contact Sales',\n })}\n </LinkButton>\n </Flex>\n );\n};\n\nconst BalloonImage = styled.img`\n // Margin top|right reverse the padding of ModalBody\n margin-right: ${({ theme }) => `-${theme.spaces[7]}`};\n margin-top: ${({ theme }) => `-${theme.spaces[7]}`};\n width: 360px;\n`;\n\nexport type LimitsModalProps = Pick<Modal.Props, 'open' | 'onOpenChange'>;\n\nconst Root: React.FC<React.PropsWithChildren<LimitsModalProps>> = ({\n children,\n open = false,\n onOpenChange,\n}) => {\n const { formatMessage } = useIntl();\n\n return (\n <Modal.Root open={open} onOpenChange={onOpenChange}>\n <Modal.Content>\n <Modal.Body>\n <Flex gap={2} paddingLeft={7} position=\"relative\">\n <Flex alignItems=\"start\" direction=\"column\" gap={2} width=\"60%\">\n {children}\n\n <CallToActions />\n </Flex>\n\n <Flex justifyContent=\"end\" height=\"100%\" width=\"40%\">\n <BalloonImage src={balloonImageSrc} aria-hidden alt=\"\" loading=\"lazy\" />\n\n <Box display=\"flex\" position=\"absolute\" right={0} top={0}>\n <Modal.Close>\n <IconButton\n withTooltip={false}\n label={formatMessage({\n id: 'global.close',\n defaultMessage: 'Close',\n })}\n >\n <Cross />\n </IconButton>\n </Modal.Close>\n </Box>\n </Flex>\n </Flex>\n </Modal.Body>\n </Modal.Content>\n </Modal.Root>\n );\n};\n\nconst LimitsModal = {\n Title,\n Body,\n Root,\n};\n\nexport { LimitsModal };\n"],"names":["CTA_LEARN_MORE_HREF","CTA_SALES_HREF","Title","children","_jsx","Modal","variant","Body","Typography","CallToActions","formatMessage","useIntl","_jsxs","Flex","gap","paddingTop","LinkButton","isExternal","href","id","defaultMessage","BalloonImage","styled","img","theme","spaces","Root","open","onOpenChange","Content","paddingLeft","position","alignItems","direction","width","justifyContent","height","src","balloonImageSrc","aria-hidden","alt","loading","Box","display","right","top","Close","IconButton","withTooltip","label","Cross","LimitsModal"],"mappings":";;;;;;;;;;AASA,MAAMA,mBAAsB,GAAA,iCAAA;AAC5B,MAAMC,cAAiB,GAAA,i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AAM,CAAC,CAAE,CAAA,CAAC,CAAC,CAAC;;AAErD,CAAC;AAID,MAAMC,IAAAA,GAA4D,CAAC,EACjEvB,QAAQ,EACRwB,IAAO,GAAA,KAAK,EACZC,YAAY,EACb,GAAA;IACC,MAAM,EAAElB,aAAa,EAAE,GAAGC,iBAAAA,EAAAA;IAE1B,qBACEP,cALine truncated
@@ -0,0 +1,120 @@
import { jsx, jsxs } from 'react/jsx-runtime';
import 'react';
import { Modal, Typography, Flex, Box, IconButton, LinkButton } from '@strapi/design-system';
import { Cross } from '@strapi/icons';
import { useIntl } from 'react-intl';
import { styled } from 'styled-components';
import img from '../assets/balloon.png.mjs';
const CTA_LEARN_MORE_HREF = 'https://strapi.io/pricing-cloud';
const CTA_SALES_HREF = 'https://strapi.io/contact-sales';
const Title = ({ children })=>{
return /*#__PURE__*/ jsx(Modal.Title, {
variant: "alpha",
children: children
});
};
const Body = ({ children })=>{
return /*#__PURE__*/ jsx(Typography, {
variant: "omega",
children: children
});
};
const CallToActions = ()=>{
const { formatMessage } = useIntl();
return /*#__PURE__*/ jsxs(Flex, {
gap: 2,
paddingTop: 4,
children: [
/*#__PURE__*/ jsx(LinkButton, {
variant: "default",
isExternal: true,
href: CTA_LEARN_MORE_HREF,
children: formatMessage({
id: 'Settings.review-workflows.limit.cta.learn',
defaultMessage: 'Learn more'
})
}),
/*#__PURE__*/ jsx(LinkButton, {
variant: "tertiary",
isExternal: true,
href: CTA_SALES_HREF,
children: formatMessage({
id: 'Settings.review-workflows.limit.cta.sales',
defaultMessage: 'Contact Sales'
})
})
]
});
};
const BalloonImage = styled.img`
// Margin top|right reverse the padding of ModalBody
margin-right: ${({ theme })=>`-${theme.spaces[7]}`};
margin-top: ${({ theme })=>`-${theme.spaces[7]}`};
width: 360px;
`;
const Root = ({ children, open = false, onOpenChange })=>{
const { formatMessage } = useIntl();
return /*#__PURE__*/ jsx(Modal.Root, {
open: open,
onOpenChange: onOpenChange,
children: /*#__PURE__*/ jsx(Modal.Content, {
children: /*#__PURE__*/ jsx(Modal.Body, {
children: /*#__PURE__*/ jsxs(Flex, {
gap: 2,
paddingLeft: 7,
position: "relative",
children: [
/*#__PURE__*/ jsxs(Flex, {
alignItems: "start",
direction: "column",
gap: 2,
width: "60%",
children: [
children,
/*#__PURE__*/ jsx(CallToActions, {})
]
}),
/*#__PURE__*/ jsxs(Flex, {
justifyContent: "end",
height: "100%",
width: "40%",
children: [
/*#__PURE__*/ jsx(BalloonImage, {
src: img,
"aria-hidden": true,
alt: "",
loading: "lazy"
}),
/*#__PURE__*/ jsx(Box, {
display: "flex",
position: "absolute",
right: 0,
top: 0,
children: /*#__PURE__*/ jsx(Modal.Close, {
children: /*#__PURE__*/ jsx(IconButton, {
withTooltip: false,
label: formatMessage({
id: 'global.close',
defaultMessage: 'Close'
}),
children: /*#__PURE__*/ jsx(Cross, {})
})
})
})
]
})
]
})
})
})
});
};
const LimitsModal = {
Title,
Body,
Root
};
export { LimitsModal };
//# sourceMappingURL=LimitsModal.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"LimitsModal.mjs","sources":["../../../admin/src/components/LimitsModal.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { Box, Flex, IconButton, Modal, Typography, LinkButton } from '@strapi/design-system';\nimport { Cross } from '@strapi/icons';\nimport { useIntl } from 'react-intl';\nimport { styled } from 'styled-components';\n\nimport balloonImageSrc from '../assets/balloon.png';\n\nconst CTA_LEARN_MORE_HREF = 'https://strapi.io/pricing-cloud';\nconst CTA_SALES_HREF = 'https://strapi.io/contact-sales';\n\nconst Title: React.FC<React.PropsWithChildren> = ({ children }) => {\n return <Modal.Title variant=\"alpha\">{children}</Modal.Title>;\n};\n\nconst Body: React.FC<React.PropsWithChildren> = ({ children }) => {\n return <Typography variant=\"omega\">{children}</Typography>;\n};\n\nconst CallToActions = () => {\n const { formatMessage } = useIntl();\n\n return (\n <Flex gap={2} paddingTop={4}>\n <LinkButton variant=\"default\" isExternal href={CTA_LEARN_MORE_HREF}>\n {formatMessage({\n id: 'Settings.review-workflows.limit.cta.learn',\n defaultMessage: 'Learn more',\n })}\n </LinkButton>\n\n <LinkButton variant=\"tertiary\" isExternal href={CTA_SALES_HREF}>\n {formatMessage({\n id: 'Settings.review-workflows.limit.cta.sales',\n defaultMessage: 'Contact Sales',\n })}\n </LinkButton>\n </Flex>\n );\n};\n\nconst BalloonImage = styled.img`\n // Margin top|right reverse the padding of ModalBody\n margin-right: ${({ theme }) => `-${theme.spaces[7]}`};\n margin-top: ${({ theme }) => `-${theme.spaces[7]}`};\n width: 360px;\n`;\n\nexport type LimitsModalProps = Pick<Modal.Props, 'open' | 'onOpenChange'>;\n\nconst Root: React.FC<React.PropsWithChildren<LimitsModalProps>> = ({\n children,\n open = false,\n onOpenChange,\n}) => {\n const { formatMessage } = useIntl();\n\n return (\n <Modal.Root open={open} onOpenChange={onOpenChange}>\n <Modal.Content>\n <Modal.Body>\n <Flex gap={2} paddingLeft={7} position=\"relative\">\n <Flex alignItems=\"start\" direction=\"column\" gap={2} width=\"60%\">\n {children}\n\n <CallToActions />\n </Flex>\n\n <Flex justifyContent=\"end\" height=\"100%\" width=\"40%\">\n <BalloonImage src={balloonImageSrc} aria-hidden alt=\"\" loading=\"lazy\" />\n\n <Box display=\"flex\" position=\"absolute\" right={0} top={0}>\n <Modal.Close>\n <IconButton\n withTooltip={false}\n label={formatMessage({\n id: 'global.close',\n defaultMessage: 'Close',\n })}\n >\n <Cross />\n </IconButton>\n </Modal.Close>\n </Box>\n </Flex>\n </Flex>\n </Modal.Body>\n </Modal.Content>\n </Modal.Root>\n );\n};\n\nconst LimitsModal = {\n Title,\n Body,\n Root,\n};\n\nexport { LimitsModal };\n"],"names":["CTA_LEARN_MORE_HREF","CTA_SALES_HREF","Title","children","_jsx","Modal","variant","Body","Typography","CallToActions","formatMessage","useIntl","_jsxs","Flex","gap","paddingTop","LinkButton","isExternal","href","id","defaultMessage","BalloonImage","styled","img","theme","spaces","Root","open","onOpenChange","Content","paddingLeft","position","alignItems","direction","width","justifyContent","height","src","balloonImageSrc","aria-hidden","alt","loading","Box","display","right","top","Close","IconButton","withTooltip","label","Cross","LimitsModal"],"mappings":";;;;;;;;AASA,MAAMA,mBAAsB,GAAA,iCAAA;AAC5B,MAAMC,cAAiB,GAAA,iCAAA;AAEvB,MAAMC,KAA2C,GAAA,CAAC,EAAEC,QAAQ,EAAE,GAAA;IAC5D,qBAAOC,GAAA,CAACC,MAAMH,KAAK,EAAA;QAACI,OAAQ,EAAA,OAAA;AAASH,QAAAA,QAAAA,EAAAA;;AACvC,CAAA;AAEA,MAAMI,IAA0C,GAAA,CAAC,EAAEJ,QAAQ,EAAE,GAAA;AAC3D,IAAA,qBAAOC,GAACI,CAAAA,UAAAA,EAAAA;QAAWF,OAAQ,EAAA,OAAA;AAASH,QAAAA,QAAAA,EAAAA;;AACtC,CAAA;AAEA,MAAMM,aAAgB,GAAA,IAAA;IACpB,MAAM,EAAEC,aAAa,EAAE,GAAGC,OAAAA,EAAAA;AAE1B,IAAA,qBACEC,IAACC,CAAAA,IAAAA,EAAAA;QAAKC,GAAK,EAAA,CAAA;QAAGC,UAAY,EAAA,CAAA;;0BACxBX,GAACY,CAAAA,UAAAA,EAAAA;gBAAWV,OAAQ,EAAA,SAAA;gBAAUW,UAAU,EAAA,IAAA;gBAACC,IAAMlB,EAAAA,mBAAAA;0BAC5CU,aAAc,CAAA;oBACbS,EAAI,EAAA,2CAAA;oBACJC,cAAgB,EAAA;AAClB,iBAAA;;0BAGFhB,GAACY,CAAAA,UAAAA,EAAAA;gBAAWV,OAAQ,EAAA,UAAA;gBAAWW,UAAU,EAAA,IAAA;gBAACC,IAAMjB,EAAAA,cAAAA;0BAC7CS,aAAc,CAAA;oBACbS,EAAI,EAAA,2CAAA;oBACJC,cAAgB,EAAA;AAClB,iBAAA;;;;AAIR,CAAA;AAEA,MAAMC,YAAAA,GAAeC,MAAOC,CAAAA,GAAG;;AAEf,gBAAA,EAAE,CAAC,EAAEC,KAAK,EAAE,GAAK,CAAC,CAAC,EAAEA,KAAAA,CAAMC,MAAM,CAAC,CAAE,CAAA,CAAC,CAAC,CAAC;AACzC,cAAA,EAAE,CAAC,EAAED,KAAK,EAAE,GAAK,CAAC,CAAC,EAAEA,KAAAA,CAAMC,MAAM,CAAC,CAAE,CAAA,CAAC,CAAC,CAAC;;AAErD,CAAC;AAID,MAAMC,IAAAA,GAA4D,CAAC,EACjEvB,QAAQ,EACRwB,IAAO,GAAA,KAAK,EACZC,YAAY,EACb,GAAA;IACC,MAAM,EAAElB,aAAa,EAAE,GAAGC,OAAAA,EAAAA;IAE1B,qBACEP,GAAA,CAACC,Line truncated
+18
View File
@@ -0,0 +1,18 @@
'use strict';
var designSystem = require('@strapi/design-system');
const PLUGIN_ID = 'review-workflows';
/**
* The name of the feature in the license.
*/ const FEATURE_ID = 'review-workflows';
const CHARGEBEE_WORKFLOW_ENTITLEMENT_NAME = 'numberOfWorkflows';
const CHARGEBEE_STAGES_PER_WORKFLOW_ENTITLEMENT_NAME = 'stagesPerWorkflow';
const STAGE_COLOR_DEFAULT = designSystem.lightTheme.colors.primary600;
exports.CHARGEBEE_STAGES_PER_WORKFLOW_ENTITLEMENT_NAME = CHARGEBEE_STAGES_PER_WORKFLOW_ENTITLEMENT_NAME;
exports.CHARGEBEE_WORKFLOW_ENTITLEMENT_NAME = CHARGEBEE_WORKFLOW_ENTITLEMENT_NAME;
exports.FEATURE_ID = FEATURE_ID;
exports.PLUGIN_ID = PLUGIN_ID;
exports.STAGE_COLOR_DEFAULT = STAGE_COLOR_DEFAULT;
//# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
{"version":3,"file":"constants.js","sources":["../../admin/src/constants.ts"],"sourcesContent":["import { lightTheme } from '@strapi/design-system';\n\nconst PLUGIN_ID = 'review-workflows';\n/**\n * The name of the feature in the license.\n */\nconst FEATURE_ID = 'review-workflows';\n\nexport const CHARGEBEE_WORKFLOW_ENTITLEMENT_NAME = 'numberOfWorkflows';\nexport const CHARGEBEE_STAGES_PER_WORKFLOW_ENTITLEMENT_NAME = 'stagesPerWorkflow';\n\nexport const STAGE_COLOR_DEFAULT = lightTheme.colors.primary600;\n\nexport { FEATURE_ID, PLUGIN_ID };\n"],"names":["PLUGIN_ID","FEATURE_ID","CHARGEBEE_WORKFLOW_ENTITLEMENT_NAME","CHARGEBEE_STAGES_PER_WORKFLOW_ENTITLEMENT_NAME","STAGE_COLOR_DEFAULT","lightTheme","colors","primary600"],"mappings":";;;;AAEA,MAAMA,SAAY,GAAA;AAClB;;AAEC,UACKC,UAAa,GAAA;AAEZ,MAAMC,sCAAsC;AAC5C,MAAMC,iDAAiD;MAEjDC,mBAAsBC,GAAAA,uBAAAA,CAAWC,MAAM,CAACC;;;;;;;;"}
+12
View File
@@ -0,0 +1,12 @@
import { lightTheme } from '@strapi/design-system';
const PLUGIN_ID = 'review-workflows';
/**
* The name of the feature in the license.
*/ const FEATURE_ID = 'review-workflows';
const CHARGEBEE_WORKFLOW_ENTITLEMENT_NAME = 'numberOfWorkflows';
const CHARGEBEE_STAGES_PER_WORKFLOW_ENTITLEMENT_NAME = 'stagesPerWorkflow';
const STAGE_COLOR_DEFAULT = lightTheme.colors.primary600;
export { CHARGEBEE_STAGES_PER_WORKFLOW_ENTITLEMENT_NAME, CHARGEBEE_WORKFLOW_ENTITLEMENT_NAME, FEATURE_ID, PLUGIN_ID, STAGE_COLOR_DEFAULT };
//# sourceMappingURL=constants.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"constants.mjs","sources":["../../admin/src/constants.ts"],"sourcesContent":["import { lightTheme } from '@strapi/design-system';\n\nconst PLUGIN_ID = 'review-workflows';\n/**\n * The name of the feature in the license.\n */\nconst FEATURE_ID = 'review-workflows';\n\nexport const CHARGEBEE_WORKFLOW_ENTITLEMENT_NAME = 'numberOfWorkflows';\nexport const CHARGEBEE_STAGES_PER_WORKFLOW_ENTITLEMENT_NAME = 'stagesPerWorkflow';\n\nexport const STAGE_COLOR_DEFAULT = lightTheme.colors.primary600;\n\nexport { FEATURE_ID, PLUGIN_ID };\n"],"names":["PLUGIN_ID","FEATURE_ID","CHARGEBEE_WORKFLOW_ENTITLEMENT_NAME","CHARGEBEE_STAGES_PER_WORKFLOW_ENTITLEMENT_NAME","STAGE_COLOR_DEFAULT","lightTheme","colors","primary600"],"mappings":";;AAEA,MAAMA,SAAY,GAAA;AAClB;;AAEC,UACKC,UAAa,GAAA;AAEZ,MAAMC,sCAAsC;AAC5C,MAAMC,iDAAiD;MAEjDC,mBAAsBC,GAAAA,UAAAA,CAAWC,MAAM,CAACC;;;;"}
+93
View File
@@ -0,0 +1,93 @@
'use strict';
var constants = require('./constants.js');
var Header = require('./routes/content-manager/model/id/components/Header.js');
var Panel = require('./routes/content-manager/model/id/components/Panel.js');
var cmHooks = require('./utils/cm-hooks.js');
var translations = require('./utils/translations.js');
function _interopNamespaceDefaultOnly (e) { return Object.freeze({ __proto__: null, default: e }); }
function __variableDynamicImportRuntime2__(path) {
switch (path) {
case './translations/en.json': return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespaceDefaultOnly(require('./translations/en.json.js')); });
case './translations/uk.json': return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespaceDefaultOnly(require('./translations/uk.json.js')); });
default: return new Promise(function(resolve, reject) {
(typeof queueMicrotask === 'function' ? queueMicrotask : setTimeout)(
reject.bind(null, new Error("Unknown variable dynamic import: " + path))
);
})
}
}
const admin = {
register (app) {
if (window.strapi.features.isEnabled(constants.FEATURE_ID)) {
app.registerHook('Admin/CM/pages/ListView/inject-column-in-table', cmHooks.addColumnToTableHook);
const contentManagerPluginApis = app.getPlugin('content-manager').apis;
if ('addEditViewSidePanel' in contentManagerPluginApis && typeof contentManagerPluginApis.addEditViewSidePanel === 'function') {
contentManagerPluginApis.addEditViewSidePanel([
Panel.Panel
]);
}
app.addSettingsLink('global', {
id: constants.PLUGIN_ID,
to: `review-workflows`,
intlLabel: {
id: `${constants.PLUGIN_ID}.plugin.name`,
defaultMessage: 'Review Workflows'
},
permissions: [],
async Component () {
const { Router } = await Promise.resolve().then(function () { return require('./router.js'); });
return {
default: Router
};
}
});
} else if (!window.strapi.features.isEnabled(constants.FEATURE_ID) && window.strapi?.flags?.promoteEE) {
app.addSettingsLink('global', {
id: constants.PLUGIN_ID,
to: `purchase-review-workflows`,
intlLabel: {
id: `${constants.PLUGIN_ID}.plugin.name`,
defaultMessage: 'Review Workflows'
},
licenseOnly: true,
permissions: [],
async Component () {
const { PurchaseReviewWorkflows } = await Promise.resolve().then(function () { return require('./routes/purchase-review-workflows.js'); });
return {
default: PurchaseReviewWorkflows
};
}
});
}
},
bootstrap (app) {
if (window.strapi.features.isEnabled(constants.FEATURE_ID)) {
app.getPlugin('content-manager').injectComponent('preview', 'actions', {
name: 'review-workflows-assignee',
Component: Header.Header
});
}
},
async registerTrads ({ locales }) {
const importedTrads = await Promise.all(locales.map((locale)=>{
return __variableDynamicImportRuntime2__(`./translations/${locale}.json`).then(({ default: data })=>{
return {
data: translations.prefixPluginTranslations(data, constants.PLUGIN_ID),
locale
};
}).catch(()=>{
return {
data: {},
locale
};
});
}));
return Promise.resolve(importedTrads);
}
};
module.exports = admin;
//# sourceMappingURL=index.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sources":["../../admin/src/index.ts"],"sourcesContent":["import { PLUGIN_ID, FEATURE_ID } from './constants';\nimport { Header } from './routes/content-manager/model/id/components/Header';\nimport { Panel } from './routes/content-manager/model/id/components/Panel';\nimport { StageSelect } from './routes/content-manager/model/id/components/StageSelect';\nimport { addColumnToTableHook } from './utils/cm-hooks';\nimport { prefixPluginTranslations } from './utils/translations';\n\nimport type { StrapiApp } from '@strapi/admin/strapi-admin';\nimport type { Plugin } from '@strapi/types';\n\nconst admin: Plugin.Config.AdminInput = {\n register(app: StrapiApp) {\n if (window.strapi.features.isEnabled(FEATURE_ID)) {\n app.registerHook('Admin/CM/pages/ListView/inject-column-in-table', addColumnToTableHook);\n\n const contentManagerPluginApis = app.getPlugin('content-manager').apis;\n\n if (\n 'addEditViewSidePanel' in contentManagerPluginApis &&\n typeof contentManagerPluginApis.addEditViewSidePanel === 'function'\n ) {\n contentManagerPluginApis.addEditViewSidePanel([Panel]);\n }\n\n app.addSettingsLink('global', {\n id: PLUGIN_ID,\n to: `review-workflows`,\n intlLabel: {\n id: `${PLUGIN_ID}.plugin.name`,\n defaultMessage: 'Review Workflows',\n },\n permissions: [],\n async Component() {\n const { Router } = await import('./router');\n return { default: Router };\n },\n });\n } else if (!window.strapi.features.isEnabled(FEATURE_ID) && window.strapi?.flags?.promoteEE) {\n app.addSettingsLink('global', {\n id: PLUGIN_ID,\n to: `purchase-review-workflows`,\n intlLabel: {\n id: `${PLUGIN_ID}.plugin.name`,\n defaultMessage: 'Review Workflows',\n },\n licenseOnly: true,\n permissions: [],\n async Component() {\n const { PurchaseReviewWorkflows } = await import('./routes/purchase-review-workflows');\n return { default: PurchaseReviewWorkflows };\n },\n });\n }\n },\n bootstrap(app: StrapiApp) {\n if (window.strapi.features.isEnabled(FEATURE_ID)) {\n app.getPlugin('content-manager').injectComponent('preview', 'actions', {\n name: 'review-workflows-assignee',\n Component: Header,\n });\n }\n },\n async registerTrads({ locales }: { locales: string[] }) {\n const importedTrads = await Promise.all(\n locales.map((locale) => {\n return import(`./translations/${locale}.json`)\n .then(({ default: data }) => {\n return {\n data: prefixPluginTranslations(data, PLUGIN_ID),\n locale,\n };\n })\n .catch(() => {\n return {\n data: {},\n locale,\n };\n });\n })\n );\n\n return Promise.resolve(importedTrads);\n },\n};\n\n// eslint-disable-next-line import/no-default-export\nexport default admin;\n"],"names":["admin","register","app","window","strapi","features","isEnabled","FEATURE_ID","registerHook","addColumnToTableHook","contentManagerPluginApis","getPlugin","apis","addEditViewSidePanel","Panel","addSettingsLink","id","PLUGIN_ID","to","intlLabel","defaultMessage","permissions","Component","Router","default","flags","promoteEE","licenseOnly","PurchaseReviewWorkflows","bootstrap","injectComponent","name","Header","registerTrads","locales","importedT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A,mBAAAA;gBACJC,EAAI,EAAA,CAAC,yBAAyB,CAAC;gBAC/BC,SAAW,EAAA;AACTH,oBAAAA,EAAAA,EAAI,CAAC,EAAEC,mBAAU,CAAA,YAAY,CAAC;oBAC9BG,cAAgB,EAAA;AAClB,iBAAA;gBACAO,WAAa,EAAA,IAAA;AACbN,gBAAAA,WAAAA,EAAa,EAAE;gBACf,MAAMC,SAAAA,CAAAA,GAAAA;AACJ,oBAAA,MAAM,EAAEM,uBAAuB,EAAE,GAAG,MAAM,oDAAO,uCAAA,KAAA;oBACjD,OAAO;wBAAEJ,OAASI,EAAAA;AAAwB,qBAAA;ALine truncated
+89
View File
@@ -0,0 +1,89 @@
import { FEATURE_ID, PLUGIN_ID } from './constants.mjs';
import { Header } from './routes/content-manager/model/id/components/Header.mjs';
import { Panel } from './routes/content-manager/model/id/components/Panel.mjs';
import { addColumnToTableHook } from './utils/cm-hooks.mjs';
import { prefixPluginTranslations } from './utils/translations.mjs';
function __variableDynamicImportRuntime2__(path) {
switch (path) {
case './translations/en.json': return import('./translations/en.json.mjs');
case './translations/uk.json': return import('./translations/uk.json.mjs');
default: return new Promise(function(resolve, reject) {
(typeof queueMicrotask === 'function' ? queueMicrotask : setTimeout)(
reject.bind(null, new Error("Unknown variable dynamic import: " + path))
);
})
}
}
const admin = {
register (app) {
if (window.strapi.features.isEnabled(FEATURE_ID)) {
app.registerHook('Admin/CM/pages/ListView/inject-column-in-table', addColumnToTableHook);
const contentManagerPluginApis = app.getPlugin('content-manager').apis;
if ('addEditViewSidePanel' in contentManagerPluginApis && typeof contentManagerPluginApis.addEditViewSidePanel === 'function') {
contentManagerPluginApis.addEditViewSidePanel([
Panel
]);
}
app.addSettingsLink('global', {
id: PLUGIN_ID,
to: `review-workflows`,
intlLabel: {
id: `${PLUGIN_ID}.plugin.name`,
defaultMessage: 'Review Workflows'
},
permissions: [],
async Component () {
const { Router } = await import('./router.mjs');
return {
default: Router
};
}
});
} else if (!window.strapi.features.isEnabled(FEATURE_ID) && window.strapi?.flags?.promoteEE) {
app.addSettingsLink('global', {
id: PLUGIN_ID,
to: `purchase-review-workflows`,
intlLabel: {
id: `${PLUGIN_ID}.plugin.name`,
defaultMessage: 'Review Workflows'
},
licenseOnly: true,
permissions: [],
async Component () {
const { PurchaseReviewWorkflows } = await import('./routes/purchase-review-workflows.mjs');
return {
default: PurchaseReviewWorkflows
};
}
});
}
},
bootstrap (app) {
if (window.strapi.features.isEnabled(FEATURE_ID)) {
app.getPlugin('content-manager').injectComponent('preview', 'actions', {
name: 'review-workflows-assignee',
Component: Header
});
}
},
async registerTrads ({ locales }) {
const importedTrads = await Promise.all(locales.map((locale)=>{
return __variableDynamicImportRuntime2__(`./translations/${locale}.json`).then(({ default: data })=>{
return {
data: prefixPluginTranslations(data, PLUGIN_ID),
locale
};
}).catch(()=>{
return {
data: {},
locale
};
});
}));
return Promise.resolve(importedTrads);
}
};
export { admin as default };
//# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"index.mjs","sources":["../../admin/src/index.ts"],"sourcesContent":["import { PLUGIN_ID, FEATURE_ID } from './constants';\nimport { Header } from './routes/content-manager/model/id/components/Header';\nimport { Panel } from './routes/content-manager/model/id/components/Panel';\nimport { StageSelect } from './routes/content-manager/model/id/components/StageSelect';\nimport { addColumnToTableHook } from './utils/cm-hooks';\nimport { prefixPluginTranslations } from './utils/translations';\n\nimport type { StrapiApp } from '@strapi/admin/strapi-admin';\nimport type { Plugin } from '@strapi/types';\n\nconst admin: Plugin.Config.AdminInput = {\n register(app: StrapiApp) {\n if (window.strapi.features.isEnabled(FEATURE_ID)) {\n app.registerHook('Admin/CM/pages/ListView/inject-column-in-table', addColumnToTableHook);\n\n const contentManagerPluginApis = app.getPlugin('content-manager').apis;\n\n if (\n 'addEditViewSidePanel' in contentManagerPluginApis &&\n typeof contentManagerPluginApis.addEditViewSidePanel === 'function'\n ) {\n contentManagerPluginApis.addEditViewSidePanel([Panel]);\n }\n\n app.addSettingsLink('global', {\n id: PLUGIN_ID,\n to: `review-workflows`,\n intlLabel: {\n id: `${PLUGIN_ID}.plugin.name`,\n defaultMessage: 'Review Workflows',\n },\n permissions: [],\n async Component() {\n const { Router } = await import('./router');\n return { default: Router };\n },\n });\n } else if (!window.strapi.features.isEnabled(FEATURE_ID) && window.strapi?.flags?.promoteEE) {\n app.addSettingsLink('global', {\n id: PLUGIN_ID,\n to: `purchase-review-workflows`,\n intlLabel: {\n id: `${PLUGIN_ID}.plugin.name`,\n defaultMessage: 'Review Workflows',\n },\n licenseOnly: true,\n permissions: [],\n async Component() {\n const { PurchaseReviewWorkflows } = await import('./routes/purchase-review-workflows');\n return { default: PurchaseReviewWorkflows };\n },\n });\n }\n },\n bootstrap(app: StrapiApp) {\n if (window.strapi.features.isEnabled(FEATURE_ID)) {\n app.getPlugin('content-manager').injectComponent('preview', 'actions', {\n name: 'review-workflows-assignee',\n Component: Header,\n });\n }\n },\n async registerTrads({ locales }: { locales: string[] }) {\n const importedTrads = await Promise.all(\n locales.map((locale) => {\n return import(`./translations/${locale}.json`)\n .then(({ default: data }) => {\n return {\n data: prefixPluginTranslations(data, PLUGIN_ID),\n locale,\n };\n })\n .catch(() => {\n return {\n data: {},\n locale,\n };\n });\n })\n );\n\n return Promise.resolve(importedTrads);\n },\n};\n\n// eslint-disable-next-line import/no-default-export\nexport default admin;\n"],"names":["admin","register","app","window","strapi","features","isEnabled","FEATURE_ID","registerHook","addColumnToTableHook","contentManagerPluginApis","getPlugin","apis","addEditViewSidePanel","Panel","addSettingsLink","id","PLUGIN_ID","to","intlLabel","defaultMessage","permissions","Component","Router","default","flags","promoteEE","licenseOnly","PurchaseReviewWorkflows","bootstrap","injectComponent","name","Header","registerTrads","locales","importedTrads","Promise","all","map","locale","then","data","prefixPluginTranslations","catch","resolve"],"mappings":";;;;;;;;;;;;;;;;;AAUA,MAAMA,KAAkC,GAAA;AACtCC,IAAAA,QAAAA,CAAAA,CAASC,GAAc,EAAA;AACrB,QAAA,IA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A;gBACAO,WAAa,EAAA,IAAA;AACbN,gBAAAA,WAAAA,EAAa,EAAE;gBACf,MAAMC,SAAAA,CAAAA,GAAAA;AACJ,oBAAA,MAAM,EAAEM,uBAAuB,EAAE,GAAG,MAAM,OAAO,wCAAA,CAAA;oBACjD,OAAO;wBAAEJ,OAASI,EAAAA;AAAwB,qBAAA;AAC5C;AACF,aLine truncated
@@ -0,0 +1,8 @@
'use strict';
var reactRedux = require('react-redux');
const useTypedSelector = reactRedux.useSelector;
exports.useTypedSelector = useTypedSelector;
//# sourceMappingURL=hooks.js.map
@@ -0,0 +1 @@
{"version":3,"file":"hooks.js","sources":["../../../admin/src/modules/hooks.ts"],"sourcesContent":["import { Dispatch } from '@reduxjs/toolkit';\nimport { TypedUseSelectorHook, useDispatch, useSelector } from 'react-redux';\n\nimport type { Store } from '@strapi/admin/strapi-admin';\n\ntype RootState = ReturnType<Store['getState']>;\n\nconst useTypedDispatch: () => Dispatch = useDispatch;\nconst useTypedSelector: TypedUseSelectorHook<RootState> = useSelector;\n\nexport { useTypedSelector, useTypedDispatch };\n"],"names":["useTypedSelector","useSelector"],"mappings":";;;;AAQA,MAAMA,gBAAoDC,GAAAA;;;;"}
@@ -0,0 +1,6 @@
import { useSelector } from 'react-redux';
const useTypedSelector = useSelector;
export { useTypedSelector };
//# sourceMappingURL=hooks.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"hooks.mjs","sources":["../../../admin/src/modules/hooks.ts"],"sourcesContent":["import { Dispatch } from '@reduxjs/toolkit';\nimport { TypedUseSelectorHook, useDispatch, useSelector } from 'react-redux';\n\nimport type { Store } from '@strapi/admin/strapi-admin';\n\ntype RootState = ReturnType<Store['getState']>;\n\nconst useTypedDispatch: () => Dispatch = useDispatch;\nconst useTypedSelector: TypedUseSelectorHook<RootState> = useSelector;\n\nexport { useTypedSelector, useTypedDispatch };\n"],"names":["useTypedSelector","useSelector"],"mappings":";;AAQA,MAAMA,gBAAoDC,GAAAA;;;;"}
+30
View File
@@ -0,0 +1,30 @@
'use strict';
var jsxRuntime = require('react/jsx-runtime');
var React = require('react');
var reactRouterDom = require('react-router-dom');
const ProtectedListPage = /*#__PURE__*/ React.lazy(()=>Promise.resolve().then(function () { return require('./routes/settings/index.js'); }).then((mod)=>({
default: mod.ProtectedListPage
})));
const ProtectedEditPage = /*#__PURE__*/ React.lazy(()=>Promise.resolve().then(function () { return require('./routes/settings/id.js'); }).then((mod)=>({
default: mod.ProtectedEditPage
})));
const routes = [
{
path: '/',
Component: ProtectedListPage
},
{
path: ':id',
Component: ProtectedEditPage
}
];
const Router = ()=>/*#__PURE__*/ jsxRuntime.jsx(reactRouterDom.Routes, {
children: routes.map((route)=>/*#__PURE__*/ jsxRuntime.jsx(reactRouterDom.Route, {
...route
}, route.path))
});
exports.Router = Router;
//# sourceMappingURL=router.js.map
@@ -0,0 +1 @@
{"version":3,"file":"router.js","sources":["../../admin/src/router.tsx"],"sourcesContent":["/* eslint-disable check-file/filename-naming-convention */\nimport { lazy } from 'react';\n\nimport { Routes, Route, PathRouteProps } from 'react-router-dom';\n\nconst ProtectedListPage = lazy(() =>\n import('./routes/settings').then((mod) => ({ default: mod.ProtectedListPage }))\n);\nconst ProtectedEditPage = lazy(() =>\n import('./routes/settings/id').then((mod) => ({ default: mod.ProtectedEditPage }))\n);\n\nconst routes: PathRouteProps[] = [\n {\n path: '/',\n Component: ProtectedListPage,\n },\n {\n path: ':id',\n Component: ProtectedEditPage,\n },\n];\n\nconst Router = () => (\n <Routes>\n {routes.map((route) => (\n <Route key={route.path} {...route} />\n ))}\n </Routes>\n);\n\nexport { Router };\n"],"names":["ProtectedListPage","lazy","then","mod","default","ProtectedEditPage","routes","path","Component","Router","_jsx","Routes","map","route","Route"],"mappings":";;;;;;AAKA,MAAMA,iBAAAA,iBAAoBC,UAAK,CAAA,IAC7B,oDAAO,kCAAqBC,IAAI,CAAC,CAACC,GAAAA,IAAS;AAAEC,YAAAA,OAAAA,EAASD,IAAIH;SAAkB,CAAA,CAAA,CAAA;AAE9E,MAAMK,iBAAAA,iBAAoBJ,UAAK,CAAA,IAC7B,oDAAO,+BAAwBC,IAAI,CAAC,CAACC,GAAAA,IAAS;AAAEC,YAAAA,OAAAA,EAASD,IAAIE;SAAkB,CAAA,CAAA,CAAA;AAGjF,MAAMC,MAA2B,GAAA;AAC/B,IAAA;QACEC,IAAM,EAAA,GAAA;QACNC,SAAWR,EAAAA;AACb,KAAA;AACA,IAAA;QACEO,IAAM,EAAA,KAAA;QACNC,SAAWH,EAAAA;AACb;AACD,CAAA;AAEKI,MAAAA,MAAAA,GAAS,kBACbC,cAACC,CAAAA,qBAAAA,EAAAA;AACEL,QAAAA,QAAAA,EAAAA,MAAAA,CAAOM,GAAG,CAAC,CAACC,KAAAA,iBACXH,cAACI,CAAAA,oBAAAA,EAAAA;AAAwB,gBAAA,GAAGD;AAAhBA,aAAAA,EAAAA,KAAAA,CAAMN,IAAI,CAAA;;;;;"}
+28
View File
@@ -0,0 +1,28 @@
import { jsx } from 'react/jsx-runtime';
import { lazy } from 'react';
import { Routes, Route } from 'react-router-dom';
const ProtectedListPage = /*#__PURE__*/ lazy(()=>import('./routes/settings/index.mjs').then((mod)=>({
default: mod.ProtectedListPage
})));
const ProtectedEditPage = /*#__PURE__*/ lazy(()=>import('./routes/settings/id.mjs').then((mod)=>({
default: mod.ProtectedEditPage
})));
const routes = [
{
path: '/',
Component: ProtectedListPage
},
{
path: ':id',
Component: ProtectedEditPage
}
];
const Router = ()=>/*#__PURE__*/ jsx(Routes, {
children: routes.map((route)=>/*#__PURE__*/ jsx(Route, {
...route
}, route.path))
});
export { Router };
//# sourceMappingURL=router.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"router.mjs","sources":["../../admin/src/router.tsx"],"sourcesContent":["/* eslint-disable check-file/filename-naming-convention */\nimport { lazy } from 'react';\n\nimport { Routes, Route, PathRouteProps } from 'react-router-dom';\n\nconst ProtectedListPage = lazy(() =>\n import('./routes/settings').then((mod) => ({ default: mod.ProtectedListPage }))\n);\nconst ProtectedEditPage = lazy(() =>\n import('./routes/settings/id').then((mod) => ({ default: mod.ProtectedEditPage }))\n);\n\nconst routes: PathRouteProps[] = [\n {\n path: '/',\n Component: ProtectedListPage,\n },\n {\n path: ':id',\n Component: ProtectedEditPage,\n },\n];\n\nconst Router = () => (\n <Routes>\n {routes.map((route) => (\n <Route key={route.path} {...route} />\n ))}\n </Routes>\n);\n\nexport { Router };\n"],"names":["ProtectedListPage","lazy","then","mod","default","ProtectedEditPage","routes","path","Component","Router","_jsx","Routes","map","route","Route"],"mappings":";;;;AAKA,MAAMA,iBAAAA,iBAAoBC,IAAK,CAAA,IAC7B,OAAO,+BAAqBC,IAAI,CAAC,CAACC,GAAAA,IAAS;AAAEC,YAAAA,OAAAA,EAASD,IAAIH;SAAkB,CAAA,CAAA,CAAA;AAE9E,MAAMK,iBAAAA,iBAAoBJ,IAAK,CAAA,IAC7B,OAAO,4BAAwBC,IAAI,CAAC,CAACC,GAAAA,IAAS;AAAEC,YAAAA,OAAAA,EAASD,IAAIE;SAAkB,CAAA,CAAA,CAAA;AAGjF,MAAMC,MAA2B,GAAA;AAC/B,IAAA;QACEC,IAAM,EAAA,GAAA;QACNC,SAAWR,EAAAA;AACb,KAAA;AACA,IAAA;QACEO,IAAM,EAAA,KAAA;QACNC,SAAWH,EAAAA;AACb;AACD,CAAA;AAEKI,MAAAA,MAAAA,GAAS,kBACbC,GAACC,CAAAA,MAAAA,EAAAA;AACEL,QAAAA,QAAAA,EAAAA,MAAAA,CAAOM,GAAG,CAAC,CAACC,KAAAA,iBACXH,GAACI,CAAAA,KAAAA,EAAAA;AAAwB,gBAAA,GAAGD;AAAhBA,aAAAA,EAAAA,KAAAA,CAAMN,IAAI,CAAA;;;;;"}
@@ -0,0 +1,44 @@
'use strict';
var jsxRuntime = require('react/jsx-runtime');
var designSystem = require('@strapi/design-system');
var constants = require('../../../../constants.js');
var colors = require('../../../../utils/colors.js');
var users = require('../../../../utils/users.js');
const StageColumn = (props)=>{
const { color = constants.STAGE_COLOR_DEFAULT, name } = props.strapi_stage ?? {};
const { themeColorName } = colors.getStageColorByHex(color) ?? {};
return /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Flex, {
alignItems: "center",
gap: 2,
maxWidth: "30rem",
children: [
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Box, {
height: 2,
background: color,
borderColor: themeColorName === 'neutral0' ? 'neutral150' : undefined,
hasRadius: true,
shrink: 0,
width: 2
}),
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Typography, {
fontWeight: "regular",
textColor: "neutral700",
ellipsis: true,
children: name
})
]
});
};
const AssigneeColumn = (props)=>{
const { strapi_assignee: user } = props;
return /*#__PURE__*/ jsxRuntime.jsx(designSystem.Typography, {
textColor: "neutral800",
children: user ? users.getDisplayName(user) : '-'
});
};
exports.AssigneeColumn = AssigneeColumn;
exports.StageColumn = StageColumn;
//# sourceMappingURL=TableColumns.js.map
@@ -0,0 +1 @@
{"version":3,"file":"TableColumns.js","sources":["../../../../../../admin/src/routes/content-manager/model/components/TableColumns.tsx"],"sourcesContent":["import { SanitizedAdminUser } from '@strapi/admin/strapi-admin';\nimport { Box, Flex, Typography } from '@strapi/design-system';\n\nimport { STAGE_COLOR_DEFAULT } from '../../../../constants';\nimport { getStageColorByHex } from '../../../../utils/colors';\nimport { getDisplayName } from '../../../../utils/users';\n\ninterface StageColumnProps {\n documentId?: string;\n id?: number;\n strapi_stage?: {\n color?: string;\n name: string;\n };\n}\n\nconst StageColumn = (props: StageColumnProps) => {\n const { color = STAGE_COLOR_DEFAULT, name } = props.strapi_stage ?? {};\n const { themeColorName } = getStageColorByHex(color) ?? {};\n\n return (\n <Flex alignItems=\"center\" gap={2} maxWidth=\"30rem\">\n <Box\n height={2}\n background={color}\n borderColor={themeColorName === 'neutral0' ? 'neutral150' : undefined}\n hasRadius\n shrink={0}\n width={2}\n />\n\n <Typography fontWeight=\"regular\" textColor=\"neutral700\" ellipsis>\n {name}\n </Typography>\n </Flex>\n );\n};\n\ninterface AssigneeColumnProps {\n documentId?: string;\n id?: number;\n strapi_assignee?: Pick<\n SanitizedAdminUser,\n 'firstname' | 'lastname' | 'username' | 'email'\n > | null;\n}\n\nconst AssigneeColumn = (props: AssigneeColumnProps) => {\n const { strapi_assignee: user } = props;\n return <Typography textColor=\"neutral800\">{user ? getDisplayName(user) : '-'}</Typography>;\n};\n\nexport { StageColumn, AssigneeColumn };\nexport type { StageColumnProps, AssigneeColumnProps };\n"],"names":["StageColumn","props","color","STAGE_COLOR_DEFAULT","name","strapi_stage","themeColorName","getStageColorByHex","_jsxs","Flex","alignItems","gap","maxWidth","_jsx","Box","height","background","borderColor","undefined","hasRadius","shrink","width","Typography","fontWeight","textColor","ellipsis","AssigneeColumn","strapi_assignee","user","getDisplayName"],"mappings":";;;;;;;;AAgBA,MAAMA,cAAc,CAACC,KAAAA,GAAAA;IACnB,MAAM,EAAEC,KAAQC,GAAAA,6BAAmB,EAAEC,IAAI,EAAE,GAAGH,KAAAA,CAAMI,YAAY,IAAI,EAAC;AACrE,IAAA,MAAM,EAAEC,cAAc,EAAE,GAAGC,yBAAAA,CAAmBL,UAAU,EAAC;AAEzD,IAAA,qBACEM,eAACC,CAAAA,iBAAAA,EAAAA;QAAKC,UAAW,EAAA,QAAA;QAASC,GAAK,EAAA,CAAA;QAAGC,QAAS,EAAA,OAAA;;0BACzCC,cAACC,CAAAA,gBAAAA,EAAAA;gBACCC,MAAQ,EAAA,CAAA;gBACRC,UAAYd,EAAAA,KAAAA;gBACZe,WAAaX,EAAAA,cAAAA,KAAmB,aAAa,YAAeY,GAAAA,SAAAA;gBAC5DC,SAAS,EAAA,IAAA;gBACTC,MAAQ,EAAA,CAAA;gBACRC,KAAO,EAAA;;0BAGTR,cAACS,CAAAA,uBAAAA,EAAAA;gBAAWC,UAAW,EAAA,SAAA;gBAAUC,SAAU,EAAA,YAAA;gBAAaC,QAAQ,EAAA,IAAA;AAC7DrB,gBAAAA,QAAAA,EAAAA;;;;AAIT;AAWA,MAAMsB,iBAAiB,CAACzB,KAAAA,GAAAA;AACtB,IAAA,MAAM,EAAE0B,eAAAA,EAAiBC,IAAI,EAAE,GAAG3B,KAAAA;AAClC,IAAA,qBAAOY,cAACS,CAAAA,uBAAAA,EAAAA;QAAWE,SAAU,EAAA,YAAA;AAAcI,QAAAA,QAAAA,EAAAA,IAAAA,GAAOC,qBAAeD,IAAQ,CAAA,GAAA;;AAC3E;;;;;"}
@@ -0,0 +1,41 @@
import { jsxs, jsx } from 'react/jsx-runtime';
import { Flex, Box, Typography } from '@strapi/design-system';
import { STAGE_COLOR_DEFAULT } from '../../../../constants.mjs';
import { getStageColorByHex } from '../../../../utils/colors.mjs';
import { getDisplayName } from '../../../../utils/users.mjs';
const StageColumn = (props)=>{
const { color = STAGE_COLOR_DEFAULT, name } = props.strapi_stage ?? {};
const { themeColorName } = getStageColorByHex(color) ?? {};
return /*#__PURE__*/ jsxs(Flex, {
alignItems: "center",
gap: 2,
maxWidth: "30rem",
children: [
/*#__PURE__*/ jsx(Box, {
height: 2,
background: color,
borderColor: themeColorName === 'neutral0' ? 'neutral150' : undefined,
hasRadius: true,
shrink: 0,
width: 2
}),
/*#__PURE__*/ jsx(Typography, {
fontWeight: "regular",
textColor: "neutral700",
ellipsis: true,
children: name
})
]
});
};
const AssigneeColumn = (props)=>{
const { strapi_assignee: user } = props;
return /*#__PURE__*/ jsx(Typography, {
textColor: "neutral800",
children: user ? getDisplayName(user) : '-'
});
};
export { AssigneeColumn, StageColumn };
//# sourceMappingURL=TableColumns.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"TableColumns.mjs","sources":["../../../../../../admin/src/routes/content-manager/model/components/TableColumns.tsx"],"sourcesContent":["import { SanitizedAdminUser } from '@strapi/admin/strapi-admin';\nimport { Box, Flex, Typography } from '@strapi/design-system';\n\nimport { STAGE_COLOR_DEFAULT } from '../../../../constants';\nimport { getStageColorByHex } from '../../../../utils/colors';\nimport { getDisplayName } from '../../../../utils/users';\n\ninterface StageColumnProps {\n documentId?: string;\n id?: number;\n strapi_stage?: {\n color?: string;\n name: string;\n };\n}\n\nconst StageColumn = (props: StageColumnProps) => {\n const { color = STAGE_COLOR_DEFAULT, name } = props.strapi_stage ?? {};\n const { themeColorName } = getStageColorByHex(color) ?? {};\n\n return (\n <Flex alignItems=\"center\" gap={2} maxWidth=\"30rem\">\n <Box\n height={2}\n background={color}\n borderColor={themeColorName === 'neutral0' ? 'neutral150' : undefined}\n hasRadius\n shrink={0}\n width={2}\n />\n\n <Typography fontWeight=\"regular\" textColor=\"neutral700\" ellipsis>\n {name}\n </Typography>\n </Flex>\n );\n};\n\ninterface AssigneeColumnProps {\n documentId?: string;\n id?: number;\n strapi_assignee?: Pick<\n SanitizedAdminUser,\n 'firstname' | 'lastname' | 'username' | 'email'\n > | null;\n}\n\nconst AssigneeColumn = (props: AssigneeColumnProps) => {\n const { strapi_assignee: user } = props;\n return <Typography textColor=\"neutral800\">{user ? getDisplayName(user) : '-'}</Typography>;\n};\n\nexport { StageColumn, AssigneeColumn };\nexport type { StageColumnProps, AssigneeColumnProps };\n"],"names":["StageColumn","props","color","STAGE_COLOR_DEFAULT","name","strapi_stage","themeColorName","getStageColorByHex","_jsxs","Flex","alignItems","gap","maxWidth","_jsx","Box","height","background","borderColor","undefined","hasRadius","shrink","width","Typography","fontWeight","textColor","ellipsis","AssigneeColumn","strapi_assignee","user","getDisplayName"],"mappings":";;;;;;AAgBA,MAAMA,cAAc,CAACC,KAAAA,GAAAA;IACnB,MAAM,EAAEC,KAAQC,GAAAA,mBAAmB,EAAEC,IAAI,EAAE,GAAGH,KAAAA,CAAMI,YAAY,IAAI,EAAC;AACrE,IAAA,MAAM,EAAEC,cAAc,EAAE,GAAGC,kBAAAA,CAAmBL,UAAU,EAAC;AAEzD,IAAA,qBACEM,IAACC,CAAAA,IAAAA,EAAAA;QAAKC,UAAW,EAAA,QAAA;QAASC,GAAK,EAAA,CAAA;QAAGC,QAAS,EAAA,OAAA;;0BACzCC,GAACC,CAAAA,GAAAA,EAAAA;gBACCC,MAAQ,EAAA,CAAA;gBACRC,UAAYd,EAAAA,KAAAA;gBACZe,WAAaX,EAAAA,cAAAA,KAAmB,aAAa,YAAeY,GAAAA,SAAAA;gBAC5DC,SAAS,EAAA,IAAA;gBACTC,MAAQ,EAAA,CAAA;gBACRC,KAAO,EAAA;;0BAGTR,GAACS,CAAAA,UAAAA,EAAAA;gBAAWC,UAAW,EAAA,SAAA;gBAAUC,SAAU,EAAA,YAAA;gBAAaC,QAAQ,EAAA,IAAA;AAC7DrB,gBAAAA,QAAAA,EAAAA;;;;AAIT;AAWA,MAAMsB,iBAAiB,CAACzB,KAAAA,GAAAA;AACtB,IAAA,MAAM,EAAE0B,eAAAA,EAAiBC,IAAI,EAAE,GAAG3B,KAAAA;AAClC,IAAA,qBAAOY,GAACS,CAAAA,UAAAA,EAAAA;QAAWE,SAAU,EAAA,YAAA;AAAcI,QAAAA,QAAAA,EAAAA,IAAAA,GAAOC,eAAeD,IAAQ,CAAA,GAAA;;AAC3E;;;;"}
@@ -0,0 +1,60 @@
'use strict';
var jsxRuntime = require('react/jsx-runtime');
require('react');
require('@strapi/admin/strapi-admin');
require('@strapi/design-system');
require('react-intl');
require('react-router-dom');
require('../../../utils/colors.js');
require('../../../services/settings.js');
var TableColumns = require('./components/TableColumns.js');
var constants = require('./id/components/constants.js');
const REVIEW_WORKFLOW_COLUMNS = [
{
name: constants.STAGE_ATTRIBUTE_NAME,
attribute: {
type: 'relation',
relation: 'oneToMany',
target: 'admin::review-workflow-stage'
},
label: {
id: 'review-workflows.containers.list.table-headers.reviewWorkflows.stage',
defaultMessage: 'Review stage'
},
searchable: false,
sortable: true,
mainField: {
name: 'name',
type: 'string'
},
cellFormatter: (props)=>/*#__PURE__*/ jsxRuntime.jsx(TableColumns.StageColumn, {
...props
})
},
{
name: constants.ASSIGNEE_ATTRIBUTE_NAME,
attribute: {
type: 'relation',
target: 'admin::user',
relation: 'oneToMany'
},
label: {
id: 'review-workflows.containers.list.table-headers.reviewWorkflows.assignee',
defaultMessage: 'Assignee'
},
searchable: false,
sortable: true,
mainField: {
name: 'firstname',
type: 'string'
},
cellFormatter: (props)=>/*#__PURE__*/ jsxRuntime.jsx(TableColumns.AssigneeColumn, {
...props
})
}
];
exports.REVIEW_WORKFLOW_COLUMNS = REVIEW_WORKFLOW_COLUMNS;
//# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
{"version":3,"file":"constants.js","sources":["../../../../../admin/src/routes/content-manager/model/constants.tsx"],"sourcesContent":["import { AssigneeFilter } from './components/AssigneeFilter';\nimport { StageFilter } from './components/StageFilter';\nimport { AssigneeColumn, StageColumn } from './components/TableColumns';\nimport { ASSIGNEE_ATTRIBUTE_NAME, STAGE_ATTRIBUTE_NAME } from './id/components/constants';\n\nimport type { Filters } from '@strapi/admin/strapi-admin';\nimport type { ListFieldLayout } from '@strapi/content-manager/strapi-admin';\nimport type { MessageDescriptor } from 'react-intl';\n\nexport const REVIEW_WORKFLOW_COLUMNS = [\n {\n name: STAGE_ATTRIBUTE_NAME,\n attribute: {\n type: 'relation',\n relation: 'oneToMany',\n target: 'admin::review-workflow-stage',\n },\n label: {\n id: 'review-workflows.containers.list.table-headers.reviewWorkflows.stage',\n defaultMessage: 'Review stage',\n },\n searchable: false,\n sortable: true,\n mainField: {\n name: 'name',\n type: 'string',\n },\n cellFormatter: (props) => <StageColumn {...props} />,\n },\n {\n name: ASSIGNEE_ATTRIBUTE_NAME,\n attribute: {\n type: 'relation',\n target: 'admin::user',\n relation: 'oneToMany',\n },\n label: {\n id: 'review-workflows.containers.list.table-headers.reviewWorkflows.assignee',\n defaultMessage: 'Assignee',\n },\n searchable: false,\n sortable: true,\n mainField: {\n name: 'firstname',\n type: 'string',\n },\n cellFormatter: (props) => <AssigneeColumn {...props} />,\n },\n] satisfies Array<Omit<ListFieldLayout, 'label'> & { label: MessageDescriptor }>;\n\nexport const REVIEW_WORKFLOW_FILTERS = [\n {\n mainField: {\n name: 'name',\n type: 'string',\n },\n input: StageFilter,\n label: {\n id: 'review-workflows.containers.list.table-headers.reviewWorkflows.stage',\n defaultMessage: 'Review stage',\n },\n name: 'strapi_stage',\n type: 'relation',\n },\n\n {\n type: 'relation',\n mainField: {\n name: 'id',\n type: 'integer',\n },\n input: AssigneeFilter,\n operators: [\n {\n label: {\n id: 'components.FilterOptions.FILTER_TYPES.$eq',\n defaultMessage: 'is',\n },\n value: '$eq',\n },\n {\n label: {\n id: 'components.FilterOptions.FILTER_TYPES.$ne',\n defaultMessage: 'is not',\n },\n value: '$ne',\n },\n ],\n label: {\n id: 'review-workflows.containers.list.table-headers.reviewWorkflows.assignee.label',\n defaultMessage: 'Assignee',\n },\n name: 'strapi_assignee',\n },\n] satisfies Array<\n Omit<Filters.Filter, 'label' | 'operators'> & {\n label: MessageDescriptor;\n operators?: Array<{ value: string; label: MessageDescriptor }>;\n }\n>;\n"],"names":["REVIEW_WORKFLOW_COLUMNS","name","STAGE_ATTRIBUTE_NAME","attribute","type","relation","target","label","id","defaultMessage","searchable","sortable","mainField","cellFormatter","props","_jsx","StageColumn","ASSIGNEE_ATTRIBUTE_NAME","AssigneeColumn"],"mappings":";;;;;;;;;;;;;MASaA,uBAA0B,GAAA;AACrC,IAAA;QACEC,IAAMC,EAAAA,8BAAAA;QACNC,SAAW,EAAA;YACTC,IAAM,EAAA,UAAA;YACNC,QAAU,EAAA,WAAA;YACVC,MAAQ,EAAA;AACV,SAAA;QACAC,KAAO,EAAA;YACLC,EAAI,EAAA,sEAAA;YACJC,cAAgB,EAAA;AAClB,SAAA;QACAC,UAAY,EAAA,KAAA;QACZC,QAAU,EAAA,IAAA;QACVC,SAAW,EAAA;YACTX,IAAM,EAAA,MAAA;YACNG,IAAM,EAAA;AACR,SAAA;QACAS,aAAe,EAAA,CAACC,sBAAUC,cAACC,CAAAA,wBAAAA,EAAAA;AAAa,gBAAA,GAAGF;;AAC7C,KAAA;AACA,IAAA;QACEb,IAAMgB,EAAAA,iCAAAA;QACNd,SAAW,EAAA;YACTC,IAAM,EAAA,UAAA;YACNE,MAAQ,EAAA,aAAA;YACRD,QAAU,EAAA;AACZ,SAAA;QACAE,KAAO,EAAA;YACLC,EAAI,EAAA,yEAAA;YACJC,cAAgB,EAAA;AAClB,SAAA;QACAC,UAAY,EAAA,KAAA;QACZC,QAAU,EAAA,IAAA;QACVC,SAAW,EAAA;YACTX,IAAM,EAAA,WAAA;YACNG,IAAM,EAAA;AACR,SAAA;QACAS,aAAe,EAAA,CAACC,sBAAUC,cAACG,CAAAA,2BAAAA,EAAAA;AAAgB,gBAAA,GAAGJ;;AAChD;;;;;"}
@@ -0,0 +1,58 @@
import { jsx } from 'react/jsx-runtime';
import 'react';
import '@strapi/admin/strapi-admin';
import '@strapi/design-system';
import 'react-intl';
import 'react-router-dom';
import '../../../utils/colors.mjs';
import '../../../services/settings.mjs';
import { StageColumn, AssigneeColumn } from './components/TableColumns.mjs';
import { STAGE_ATTRIBUTE_NAME, ASSIGNEE_ATTRIBUTE_NAME } from './id/components/constants.mjs';
const REVIEW_WORKFLOW_COLUMNS = [
{
name: STAGE_ATTRIBUTE_NAME,
attribute: {
type: 'relation',
relation: 'oneToMany',
target: 'admin::review-workflow-stage'
},
label: {
id: 'review-workflows.containers.list.table-headers.reviewWorkflows.stage',
defaultMessage: 'Review stage'
},
searchable: false,
sortable: true,
mainField: {
name: 'name',
type: 'string'
},
cellFormatter: (props)=>/*#__PURE__*/ jsx(StageColumn, {
...props
})
},
{
name: ASSIGNEE_ATTRIBUTE_NAME,
attribute: {
type: 'relation',
target: 'admin::user',
relation: 'oneToMany'
},
label: {
id: 'review-workflows.containers.list.table-headers.reviewWorkflows.assignee',
defaultMessage: 'Assignee'
},
searchable: false,
sortable: true,
mainField: {
name: 'firstname',
type: 'string'
},
cellFormatter: (props)=>/*#__PURE__*/ jsx(AssigneeColumn, {
...props
})
}
];
export { REVIEW_WORKFLOW_COLUMNS };
//# sourceMappingURL=constants.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"constants.mjs","sources":["../../../../../admin/src/routes/content-manager/model/constants.tsx"],"sourcesContent":["import { AssigneeFilter } from './components/AssigneeFilter';\nimport { StageFilter } from './components/StageFilter';\nimport { AssigneeColumn, StageColumn } from './components/TableColumns';\nimport { ASSIGNEE_ATTRIBUTE_NAME, STAGE_ATTRIBUTE_NAME } from './id/components/constants';\n\nimport type { Filters } from '@strapi/admin/strapi-admin';\nimport type { ListFieldLayout } from '@strapi/content-manager/strapi-admin';\nimport type { MessageDescriptor } from 'react-intl';\n\nexport const REVIEW_WORKFLOW_COLUMNS = [\n {\n name: STAGE_ATTRIBUTE_NAME,\n attribute: {\n type: 'relation',\n relation: 'oneToMany',\n target: 'admin::review-workflow-stage',\n },\n label: {\n id: 'review-workflows.containers.list.table-headers.reviewWorkflows.stage',\n defaultMessage: 'Review stage',\n },\n searchable: false,\n sortable: true,\n mainField: {\n name: 'name',\n type: 'string',\n },\n cellFormatter: (props) => <StageColumn {...props} />,\n },\n {\n name: ASSIGNEE_ATTRIBUTE_NAME,\n attribute: {\n type: 'relation',\n target: 'admin::user',\n relation: 'oneToMany',\n },\n label: {\n id: 'review-workflows.containers.list.table-headers.reviewWorkflows.assignee',\n defaultMessage: 'Assignee',\n },\n searchable: false,\n sortable: true,\n mainField: {\n name: 'firstname',\n type: 'string',\n },\n cellFormatter: (props) => <AssigneeColumn {...props} />,\n },\n] satisfies Array<Omit<ListFieldLayout, 'label'> & { label: MessageDescriptor }>;\n\nexport const REVIEW_WORKFLOW_FILTERS = [\n {\n mainField: {\n name: 'name',\n type: 'string',\n },\n input: StageFilter,\n label: {\n id: 'review-workflows.containers.list.table-headers.reviewWorkflows.stage',\n defaultMessage: 'Review stage',\n },\n name: 'strapi_stage',\n type: 'relation',\n },\n\n {\n type: 'relation',\n mainField: {\n name: 'id',\n type: 'integer',\n },\n input: AssigneeFilter,\n operators: [\n {\n label: {\n id: 'components.FilterOptions.FILTER_TYPES.$eq',\n defaultMessage: 'is',\n },\n value: '$eq',\n },\n {\n label: {\n id: 'components.FilterOptions.FILTER_TYPES.$ne',\n defaultMessage: 'is not',\n },\n value: '$ne',\n },\n ],\n label: {\n id: 'review-workflows.containers.list.table-headers.reviewWorkflows.assignee.label',\n defaultMessage: 'Assignee',\n },\n name: 'strapi_assignee',\n },\n] satisfies Array<\n Omit<Filters.Filter, 'label' | 'operators'> & {\n label: MessageDescriptor;\n operators?: Array<{ value: string; label: MessageDescriptor }>;\n }\n>;\n"],"names":["REVIEW_WORKFLOW_COLUMNS","name","STAGE_ATTRIBUTE_NAME","attribute","type","relation","target","label","id","defaultMessage","searchable","sortable","mainField","cellFormatter","props","_jsx","StageColumn","ASSIGNEE_ATTRIBUTE_NAME","AssigneeColumn"],"mappings":";;;;;;;;;;;MASaA,uBAA0B,GAAA;AACrC,IAAA;QACEC,IAAMC,EAAAA,oBAAAA;QACNC,SAAW,EAAA;YACTC,IAAM,EAAA,UAAA;YACNC,QAAU,EAAA,WAAA;YACVC,MAAQ,EAAA;AACV,SAAA;QACAC,KAAO,EAAA;YACLC,EAAI,EAAA,sEAAA;YACJC,cAAgB,EAAA;AAClB,SAAA;QACAC,UAAY,EAAA,KAAA;QACZC,QAAU,EAAA,IAAA;QACVC,SAAW,EAAA;YACTX,IAAM,EAAA,MAAA;YACNG,IAAM,EAAA;AACR,SAAA;QACAS,aAAe,EAAA,CAACC,sBAAUC,GAACC,CAAAA,WAAAA,EAAAA;AAAa,gBAAA,GAAGF;;AAC7C,KAAA;AACA,IAAA;QACEb,IAAMgB,EAAAA,uBAAAA;QACNd,SAAW,EAAA;YACTC,IAAM,EAAA,UAAA;YACNE,MAAQ,EAAA,aAAA;YACRD,QAAU,EAAA;AACZ,SAAA;QACAE,KAAO,EAAA;YACLC,EAAI,EAAA,yEAAA;YACJC,cAAgB,EAAA;AAClB,SAAA;QACAC,UAAY,EAAA,KAAA;QACZC,QAAU,EAAA,IAAA;QACVC,SAAW,EAAA;YACTX,IAAM,EAAA,WAAA;YACNG,IAAM,EAAA;AACR,SAAA;QACAS,aAAe,EAAA,CAACC,sBAAUC,GAACG,CAAAA,cAAAA,EAAAA;AAAgB,gBAAA,GAAGJ;;AAChD;;;;;"}
@@ -0,0 +1,169 @@
'use strict';
var jsxRuntime = require('react/jsx-runtime');
var React = require('react');
var strapiAdmin = require('@strapi/admin/strapi-admin');
var strapiAdmin$1 = require('@strapi/content-manager/strapi-admin');
var designSystem = require('@strapi/design-system');
var reactIntl = require('react-intl');
var reactRouterDom = require('react-router-dom');
var hooks = require('../../../../../modules/hooks.js');
var contentManager = require('../../../../../services/content-manager.js');
var api = require('../../../../../utils/api.js');
var users = require('../../../../../utils/users.js');
var constants = require('./constants.js');
function _interopNamespaceDefault(e) {
var n = Object.create(null);
if (e) {
Object.keys(e).forEach(function (k) {
if (k !== 'default') {
var d = Object.getOwnPropertyDescriptor(e, k);
Object.defineProperty(n, k, d.get ? d : {
enumerable: true,
get: function () { return e[k]; }
});
}
});
}
n.default = e;
return Object.freeze(n);
}
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
const AssigneeSelect = ({ isCompact })=>{
const { collectionType = '', id, slug: model = '' } = reactRouterDom.useParams();
const permissions = hooks.useTypedSelector((state)=>state.admin_app.permissions);
const { formatMessage } = reactIntl.useIntl();
const { _unstableFormatAPIError: formatAPIError } = strapiAdmin.useAPIErrorHandler();
const { toggleNotification } = strapiAdmin.useNotification();
const { allowedActions: { canRead }, isLoading: isLoadingPermissions } = strapiAdmin.useRBAC(permissions.settings?.users);
const [{ query }] = strapiAdmin.useQueryParams();
const params = React__namespace.useMemo(()=>api.buildValidParams(query), [
query
]);
const { data, isLoading: isLoadingUsers, isError } = strapiAdmin.useAdminUsers(undefined, {
skip: isLoadingPermissions || !canRead
});
const { document } = strapiAdmin$1.unstable_useDocument({
collectionType,
model,
documentId: id
}, {
skip: !id && collectionType !== 'single-types'
});
const users$1 = data?.users || [];
const currentAssignee = document ? document[constants.ASSIGNEE_ATTRIBUTE_NAME] : null;
const [updateAssignee, { error, isLoading: isMutating }] = contentManager.useUpdateAssigneeMutation();
if (!collectionType || !model || !document?.documentId) {
return null;
}
const handleChange = async (assigneeId)=>{
// a simple way to avoid erroneous updates
if (currentAssignee?.id === assigneeId) {
return;
}
const res = await updateAssignee({
slug: collectionType,
model,
id: document.documentId,
params,
data: {
id: assigneeId ? parseInt(assigneeId, 10) : null
}
});
if ('data' in res) {
toggleNotification({
type: 'success',
message: formatMessage({
id: 'content-manager.reviewWorkflows.assignee.notification.saved',
defaultMessage: 'Assignee updated'
})
});
}
if (isCompact && 'error' in res) {
toggleNotification({
type: 'danger',
message: formatAPIError(res.error)
});
}
};
const isDisabled = !isLoadingPermissions && !isLoadingUsers && users$1.length === 0 || !document.documentId;
const isLoading = isLoadingUsers || isLoadingPermissions || isMutating;
const assigneeLabel = formatMessage({
id: 'content-manager.reviewWorkflows.assignee.label',
defaultMessage: 'Assignee'
});
const assigneeClearLabel = formatMessage({
id: 'content-manager.reviewWorkflows.assignee.clear',
defaultMessage: 'Clear assignee'
});
const assigneePlaceholder = formatMessage({
id: 'content-manager.reviewWorkflows.assignee.placeholder',
defaultMessage: 'Select…'
});
if (isCompact) {
return /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Field.Root, {
name: constants.ASSIGNEE_ATTRIBUTE_NAME,
id: constants.ASSIGNEE_ATTRIBUTE_NAME,
children: [
/*#__PURE__*/ jsxRuntime.jsx(designSystem.VisuallyHidden, {
children: /*#__PURE__*/ jsxRuntime.jsx(designSystem.Field.Label, {
children: assigneeLabel
})
}),
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Combobox, {
clearLabel: assigneeClearLabel,
disabled: isDisabled,
value: currentAssignee ? currentAssignee.id.toString() : null,
onChange: handleChange,
onClear: ()=>handleChange(null),
placeholder: assigneePlaceholder,
loading: isLoading || isLoadingPermissions || isMutating,
size: "S",
children: users$1.map((user)=>{
return /*#__PURE__*/ jsxRuntime.jsx(designSystem.ComboboxOption, {
value: user.id.toString(),
textValue: users.getDisplayName(user),
children: users.getDisplayName(user)
}, user.id);
})
})
]
});
}
return /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Field.Root, {
name: constants.ASSIGNEE_ATTRIBUTE_NAME,
id: constants.ASSIGNEE_ATTRIBUTE_NAME,
error: (isError && canRead && formatMessage({
id: 'content-manager.reviewWorkflows.assignee.error',
defaultMessage: 'An error occurred while fetching users'
}) || error && formatAPIError(error)) ?? undefined,
children: [
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Field.Label, {
children: assigneeLabel
}),
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Combobox, {
clearLabel: assigneeClearLabel,
disabled: !isLoadingPermissions && !isLoading && users$1.length === 0 || !document.documentId,
value: currentAssignee ? currentAssignee.id.toString() : null,
onChange: handleChange,
onClear: ()=>handleChange(null),
placeholder: assigneePlaceholder,
loading: isLoading || isLoadingPermissions || isMutating,
children: users$1.map((user)=>{
return /*#__PURE__*/ jsxRuntime.jsx(designSystem.ComboboxOption, {
value: user.id.toString(),
textValue: users.getDisplayName(user),
children: users.getDisplayName(user)
}, user.id);
})
}),
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Field.Error, {})
]
});
};
exports.AssigneeSelect = AssigneeSelect;
//# sourceMappingURL=AssigneeSelect.js.map
@@ -0,0 +1 @@
{"version":3,"file":"AssigneeSelect.js","sources":["../../../../../../../admin/src/routes/content-manager/model/id/components/AssigneeSelect.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport {\n useNotification,\n useAPIErrorHandler,\n useRBAC,\n useAdminUsers,\n useQueryParams,\n} from '@strapi/admin/strapi-admin';\nimport { unstable_useDocument } from '@strapi/content-manager/strapi-admin';\nimport { Combobox, ComboboxOption, Field, VisuallyHidden } from '@strapi/design-system';\nimport { useIntl } from 'react-intl';\nimport { useParams } from 'react-router-dom';\n\nimport { useTypedSelector } from '../../../../../modules/hooks';\nimport { useUpdateAssigneeMutation } from '../../../../../services/content-manager';\nimport { buildValidParams } from '../../../../../utils/api';\nimport { getDisplayName } from '../../../../../utils/users';\n\nimport { ASSIGNEE_ATTRIBUTE_NAME } from './constants';\n\nconst AssigneeSelect = ({ isCompact }: { isCompact?: boolean }) => {\n const {\n collectionType = '',\n id,\n slug: model = '',\n } = useParams<{ collectionType: string; slug: string; id: string }>();\n const permissions = useTypedSelector((state) => state.admin_app.permissions);\n const { formatMessage } = useIntl();\n const { _unstableFormatAPIError: formatAPIError } = useAPIErrorHandler();\n const { toggleNotification } = useNotification();\n const {\n allowedActions: { canRead },\n isLoading: isLoadingPermissions,\n } = useRBAC(permissions.settings?.users);\n const [{ query }] = useQueryParams();\n const params = React.useMemo(() => buildValidParams(query), [query]);\n const {\n data,\n isLoading: isLoadingUsers,\n isError,\n } = useAdminUsers(undefined, {\n skip: isLoadingPermissions || !canRead,\n });\n const { document } = unstable_useDocument(\n {\n collectionType,\n model,\n documentId: id,\n },\n {\n skip: !id && collectionType !== 'single-types',\n }\n );\n\n const users = data?.users || [];\n\n const currentAssignee = document ? document[ASSIGNEE_ATTRIBUTE_NAME] : null;\n\n const [updateAssignee, { error, isLoading: isMutating }] = useUpdateAssigneeMutation();\n\n if (!collectionType || !model || !document?.documentId) {\n return null;\n }\n\n const handleChange = async (assigneeId: string | null) => {\n // a simple way to avoid erroneous updates\n if (currentAssignee?.id === assigneeId) {\n return;\n }\n\n const res = await updateAssignee({\n slug: collectionType,\n model,\n id: document.documentId,\n params,\n data: {\n id: assigneeId ? parseInt(assigneeId, 10) : null,\n },\n });\n\n if ('data' in res) {\n toggleNotification({\n type: 'success',\n message: formatMessage({\n id: 'content-manager.reviewWorkflows.assignee.notification.saved',\n defaultMessage: 'Assignee updated',\n }),\n });\n }\n\n if (isCompact && 'error' in res) {\n toggleNotification({\n type: 'danger',\n message: formatAPIError(res.error),\n });\n }\n };\n\n const isDisabled =\n (!isLoadingPermissions && !isLoadingUsers && users.length === 0) || !document.documentId;\n const isLoading = isLoadingUsers || isLoadingPermissions || isMutating;\n\n const assigneeLabel = formatMessage({\n id: 'content-manager.reviewWorkflows.assignee.label',\n defaultMessage: 'Assignee',\n });\n const assigneeClearLabel = formatMessage({\n id: 'content-manager.reviewWorkflows.assignee.clear',\n defaultMessage: 'Clear assignee',\n });\n const assigneePlaceholder = formatMessage({\n id: 'content-manager.reviewWorkflows.assignee.placeholder',\n defaultMessage: 'Select…',\n });\n\n if (isCompact) {\n return (\n <Field.Root name={ASSIGNEE_ATTRIBUTE_NAME} id={ASSIGNEE_ATTRIBUTE_NAME}>\n <VisuallyHidden>\n <Field.Label>{assigneeLabel}</Field.Label>\n </VisuallyHidden>\n <Combobox\n clearLabel={assigneeClearLabel}\n disabled={isDisabled}\n value={currentAssignee ? currentAssignee.id.toString() : null}\n onChange={handleChange}\n onClear={() => handleChange(null)}\n placeholder={assigneePlaceholder}\n loading={isLoading || isLoadingPermissions || isMutating}\n size=\"S\"\n >\n {users.map((user) => {\n return (\n <ComboboxOption\n key={user.id}\n value={user.id.toString()}\n textValue={getDisplayName(user)}\n >\n {getDisplayName(user)}\n </ComboboxOption>\n );\n })}\n </Combobox>\n </Field.Root>\n );\n }\n\n return (\n <Field.Root\n name={ASSIGNEE_ATTRIBUTE_NAME}\n id={ASSIGNEE_ATTRIBUTE_NAME}\n error={\n ((isError &&\n canRead &&\n formatMessage({\n id: 'content-manaLine truncated
@@ -0,0 +1,148 @@
import { jsxs, jsx } from 'react/jsx-runtime';
import * as React from 'react';
import { useAPIErrorHandler, useNotification, useRBAC, useQueryParams, useAdminUsers } from '@strapi/admin/strapi-admin';
import { unstable_useDocument } from '@strapi/content-manager/strapi-admin';
import { Field, VisuallyHidden, Combobox, ComboboxOption } from '@strapi/design-system';
import { useIntl } from 'react-intl';
import { useParams } from 'react-router-dom';
import { useTypedSelector } from '../../../../../modules/hooks.mjs';
import { useUpdateAssigneeMutation } from '../../../../../services/content-manager.mjs';
import { buildValidParams } from '../../../../../utils/api.mjs';
import { getDisplayName } from '../../../../../utils/users.mjs';
import { ASSIGNEE_ATTRIBUTE_NAME } from './constants.mjs';
const AssigneeSelect = ({ isCompact })=>{
const { collectionType = '', id, slug: model = '' } = useParams();
const permissions = useTypedSelector((state)=>state.admin_app.permissions);
const { formatMessage } = useIntl();
const { _unstableFormatAPIError: formatAPIError } = useAPIErrorHandler();
const { toggleNotification } = useNotification();
const { allowedActions: { canRead }, isLoading: isLoadingPermissions } = useRBAC(permissions.settings?.users);
const [{ query }] = useQueryParams();
const params = React.useMemo(()=>buildValidParams(query), [
query
]);
const { data, isLoading: isLoadingUsers, isError } = useAdminUsers(undefined, {
skip: isLoadingPermissions || !canRead
});
const { document } = unstable_useDocument({
collectionType,
model,
documentId: id
}, {
skip: !id && collectionType !== 'single-types'
});
const users = data?.users || [];
const currentAssignee = document ? document[ASSIGNEE_ATTRIBUTE_NAME] : null;
const [updateAssignee, { error, isLoading: isMutating }] = useUpdateAssigneeMutation();
if (!collectionType || !model || !document?.documentId) {
return null;
}
const handleChange = async (assigneeId)=>{
// a simple way to avoid erroneous updates
if (currentAssignee?.id === assigneeId) {
return;
}
const res = await updateAssignee({
slug: collectionType,
model,
id: document.documentId,
params,
data: {
id: assigneeId ? parseInt(assigneeId, 10) : null
}
});
if ('data' in res) {
toggleNotification({
type: 'success',
message: formatMessage({
id: 'content-manager.reviewWorkflows.assignee.notification.saved',
defaultMessage: 'Assignee updated'
})
});
}
if (isCompact && 'error' in res) {
toggleNotification({
type: 'danger',
message: formatAPIError(res.error)
});
}
};
const isDisabled = !isLoadingPermissions && !isLoadingUsers && users.length === 0 || !document.documentId;
const isLoading = isLoadingUsers || isLoadingPermissions || isMutating;
const assigneeLabel = formatMessage({
id: 'content-manager.reviewWorkflows.assignee.label',
defaultMessage: 'Assignee'
});
const assigneeClearLabel = formatMessage({
id: 'content-manager.reviewWorkflows.assignee.clear',
defaultMessage: 'Clear assignee'
});
const assigneePlaceholder = formatMessage({
id: 'content-manager.reviewWorkflows.assignee.placeholder',
defaultMessage: 'Select…'
});
if (isCompact) {
return /*#__PURE__*/ jsxs(Field.Root, {
name: ASSIGNEE_ATTRIBUTE_NAME,
id: ASSIGNEE_ATTRIBUTE_NAME,
children: [
/*#__PURE__*/ jsx(VisuallyHidden, {
children: /*#__PURE__*/ jsx(Field.Label, {
children: assigneeLabel
})
}),
/*#__PURE__*/ jsx(Combobox, {
clearLabel: assigneeClearLabel,
disabled: isDisabled,
value: currentAssignee ? currentAssignee.id.toString() : null,
onChange: handleChange,
onClear: ()=>handleChange(null),
placeholder: assigneePlaceholder,
loading: isLoading || isLoadingPermissions || isMutating,
size: "S",
children: users.map((user)=>{
return /*#__PURE__*/ jsx(ComboboxOption, {
value: user.id.toString(),
textValue: getDisplayName(user),
children: getDisplayName(user)
}, user.id);
})
})
]
});
}
return /*#__PURE__*/ jsxs(Field.Root, {
name: ASSIGNEE_ATTRIBUTE_NAME,
id: ASSIGNEE_ATTRIBUTE_NAME,
error: (isError && canRead && formatMessage({
id: 'content-manager.reviewWorkflows.assignee.error',
defaultMessage: 'An error occurred while fetching users'
}) || error && formatAPIError(error)) ?? undefined,
children: [
/*#__PURE__*/ jsx(Field.Label, {
children: assigneeLabel
}),
/*#__PURE__*/ jsx(Combobox, {
clearLabel: assigneeClearLabel,
disabled: !isLoadingPermissions && !isLoading && users.length === 0 || !document.documentId,
value: currentAssignee ? currentAssignee.id.toString() : null,
onChange: handleChange,
onClear: ()=>handleChange(null),
placeholder: assigneePlaceholder,
loading: isLoading || isLoadingPermissions || isMutating,
children: users.map((user)=>{
return /*#__PURE__*/ jsx(ComboboxOption, {
value: user.id.toString(),
textValue: getDisplayName(user),
children: getDisplayName(user)
}, user.id);
})
}),
/*#__PURE__*/ jsx(Field.Error, {})
]
});
};
export { AssigneeSelect };
//# sourceMappingURL=AssigneeSelect.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"AssigneeSelect.mjs","sources":["../../../../../../../admin/src/routes/content-manager/model/id/components/AssigneeSelect.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport {\n useNotification,\n useAPIErrorHandler,\n useRBAC,\n useAdminUsers,\n useQueryParams,\n} from '@strapi/admin/strapi-admin';\nimport { unstable_useDocument } from '@strapi/content-manager/strapi-admin';\nimport { Combobox, ComboboxOption, Field, VisuallyHidden } from '@strapi/design-system';\nimport { useIntl } from 'react-intl';\nimport { useParams } from 'react-router-dom';\n\nimport { useTypedSelector } from '../../../../../modules/hooks';\nimport { useUpdateAssigneeMutation } from '../../../../../services/content-manager';\nimport { buildValidParams } from '../../../../../utils/api';\nimport { getDisplayName } from '../../../../../utils/users';\n\nimport { ASSIGNEE_ATTRIBUTE_NAME } from './constants';\n\nconst AssigneeSelect = ({ isCompact }: { isCompact?: boolean }) => {\n const {\n collectionType = '',\n id,\n slug: model = '',\n } = useParams<{ collectionType: string; slug: string; id: string }>();\n const permissions = useTypedSelector((state) => state.admin_app.permissions);\n const { formatMessage } = useIntl();\n const { _unstableFormatAPIError: formatAPIError } = useAPIErrorHandler();\n const { toggleNotification } = useNotification();\n const {\n allowedActions: { canRead },\n isLoading: isLoadingPermissions,\n } = useRBAC(permissions.settings?.users);\n const [{ query }] = useQueryParams();\n const params = React.useMemo(() => buildValidParams(query), [query]);\n const {\n data,\n isLoading: isLoadingUsers,\n isError,\n } = useAdminUsers(undefined, {\n skip: isLoadingPermissions || !canRead,\n });\n const { document } = unstable_useDocument(\n {\n collectionType,\n model,\n documentId: id,\n },\n {\n skip: !id && collectionType !== 'single-types',\n }\n );\n\n const users = data?.users || [];\n\n const currentAssignee = document ? document[ASSIGNEE_ATTRIBUTE_NAME] : null;\n\n const [updateAssignee, { error, isLoading: isMutating }] = useUpdateAssigneeMutation();\n\n if (!collectionType || !model || !document?.documentId) {\n return null;\n }\n\n const handleChange = async (assigneeId: string | null) => {\n // a simple way to avoid erroneous updates\n if (currentAssignee?.id === assigneeId) {\n return;\n }\n\n const res = await updateAssignee({\n slug: collectionType,\n model,\n id: document.documentId,\n params,\n data: {\n id: assigneeId ? parseInt(assigneeId, 10) : null,\n },\n });\n\n if ('data' in res) {\n toggleNotification({\n type: 'success',\n message: formatMessage({\n id: 'content-manager.reviewWorkflows.assignee.notification.saved',\n defaultMessage: 'Assignee updated',\n }),\n });\n }\n\n if (isCompact && 'error' in res) {\n toggleNotification({\n type: 'danger',\n message: formatAPIError(res.error),\n });\n }\n };\n\n const isDisabled =\n (!isLoadingPermissions && !isLoadingUsers && users.length === 0) || !document.documentId;\n const isLoading = isLoadingUsers || isLoadingPermissions || isMutating;\n\n const assigneeLabel = formatMessage({\n id: 'content-manager.reviewWorkflows.assignee.label',\n defaultMessage: 'Assignee',\n });\n const assigneeClearLabel = formatMessage({\n id: 'content-manager.reviewWorkflows.assignee.clear',\n defaultMessage: 'Clear assignee',\n });\n const assigneePlaceholder = formatMessage({\n id: 'content-manager.reviewWorkflows.assignee.placeholder',\n defaultMessage: 'Select…',\n });\n\n if (isCompact) {\n return (\n <Field.Root name={ASSIGNEE_ATTRIBUTE_NAME} id={ASSIGNEE_ATTRIBUTE_NAME}>\n <VisuallyHidden>\n <Field.Label>{assigneeLabel}</Field.Label>\n </VisuallyHidden>\n <Combobox\n clearLabel={assigneeClearLabel}\n disabled={isDisabled}\n value={currentAssignee ? currentAssignee.id.toString() : null}\n onChange={handleChange}\n onClear={() => handleChange(null)}\n placeholder={assigneePlaceholder}\n loading={isLoading || isLoadingPermissions || isMutating}\n size=\"S\"\n >\n {users.map((user) => {\n return (\n <ComboboxOption\n key={user.id}\n value={user.id.toString()}\n textValue={getDisplayName(user)}\n >\n {getDisplayName(user)}\n </ComboboxOption>\n );\n })}\n </Combobox>\n </Field.Root>\n );\n }\n\n return (\n <Field.Root\n name={ASSIGNEE_ATTRIBUTE_NAME}\n id={ASSIGNEE_ATTRIBUTE_NAME}\n error={\n ((isError &&\n canRead &&\n formatMessage({\n id: 'content-manLine truncated
@@ -0,0 +1,31 @@
'use strict';
var jsxRuntime = require('react/jsx-runtime');
var strapiAdmin = require('@strapi/content-manager/strapi-admin');
var designSystem = require('@strapi/design-system');
var reactRouterDom = require('react-router-dom');
var AssigneeSelect = require('./AssigneeSelect.js');
var StageSelect = require('./StageSelect.js');
const Header = ()=>{
const { slug = '', id, collectionType } = reactRouterDom.useParams();
const { edit: { options } } = strapiAdmin.unstable_useDocumentLayout(slug);
if (!window.strapi.isEE || !options?.reviewWorkflows || collectionType !== 'single-types' && !id || id === 'create') {
return null;
}
return /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Flex, {
gap: 2,
children: [
/*#__PURE__*/ jsxRuntime.jsx(AssigneeSelect.AssigneeSelect, {
isCompact: true
}),
/*#__PURE__*/ jsxRuntime.jsx(StageSelect.StageSelect, {
isCompact: true
})
]
});
};
Header.type = 'preview';
exports.Header = Header;
//# sourceMappingURL=Header.js.map
@@ -0,0 +1 @@
{"version":3,"file":"Header.js","sources":["../../../../../../../admin/src/routes/content-manager/model/id/components/Header.tsx"],"sourcesContent":["import { unstable_useDocumentLayout as useDocumentLayout } from '@strapi/content-manager/strapi-admin';\nimport { Flex } from '@strapi/design-system';\nimport { useParams } from 'react-router-dom';\n\nimport { AssigneeSelect } from './AssigneeSelect';\nimport { StageSelect } from './StageSelect';\n\nconst Header = () => {\n const {\n slug = '',\n id,\n collectionType,\n } = useParams<{\n collectionType: string;\n slug: string;\n id: string;\n }>();\n\n const {\n edit: { options },\n } = useDocumentLayout(slug);\n\n if (\n !window.strapi.isEE ||\n !options?.reviewWorkflows ||\n (collectionType !== 'single-types' && !id) ||\n id === 'create'\n ) {\n return null;\n }\n\n return (\n <Flex gap={2}>\n <AssigneeSelect isCompact />\n <StageSelect isCompact />\n </Flex>\n );\n};\n\nHeader.type = 'preview';\n\nexport { Header };\n"],"names":["Header","slug","id","collectionType","useParams","edit","options","useDocumentLayout","window","strapi","isEE","reviewWorkflows","_jsxs","Flex","gap","_jsx","AssigneeSelect","isCompact","StageSelect","type"],"mappings":";;;;;;;;;AAOA,MAAMA,MAAS,GAAA,IAAA;IACb,MAAM,EACJC,OAAO,EAAE,EACTC,EAAE,EACFC,cAAc,EACf,GAAGC,wBAAAA,EAAAA;AAMJ,IAAA,MAAM,EACJC,IAAM,EAAA,EAAEC,OAAO,EAAE,EAClB,GAAGC,sCAAkBN,CAAAA,IAAAA,CAAAA;AAEtB,IAAA,IACE,CAACO,MAAAA,CAAOC,MAAM,CAACC,IAAI,IACnB,CAACJ,OAASK,EAAAA,eAAAA,IACTR,cAAmB,KAAA,cAAA,IAAkB,CAACD,EAAAA,IACvCA,OAAO,QACP,EAAA;QACA,OAAO,IAAA;AACT;AAEA,IAAA,qBACEU,eAACC,CAAAA,iBAAAA,EAAAA;QAAKC,GAAK,EAAA,CAAA;;0BACTC,cAACC,CAAAA,6BAAAA,EAAAA;gBAAeC,SAAS,EAAA;;0BACzBF,cAACG,CAAAA,uBAAAA,EAAAA;gBAAYD,SAAS,EAAA;;;;AAG5B;AAEAjB,MAAAA,CAAOmB,IAAI,GAAG,SAAA;;;;"}
@@ -0,0 +1,29 @@
import { jsxs, jsx } from 'react/jsx-runtime';
import { unstable_useDocumentLayout } from '@strapi/content-manager/strapi-admin';
import { Flex } from '@strapi/design-system';
import { useParams } from 'react-router-dom';
import { AssigneeSelect } from './AssigneeSelect.mjs';
import { StageSelect } from './StageSelect.mjs';
const Header = ()=>{
const { slug = '', id, collectionType } = useParams();
const { edit: { options } } = unstable_useDocumentLayout(slug);
if (!window.strapi.isEE || !options?.reviewWorkflows || collectionType !== 'single-types' && !id || id === 'create') {
return null;
}
return /*#__PURE__*/ jsxs(Flex, {
gap: 2,
children: [
/*#__PURE__*/ jsx(AssigneeSelect, {
isCompact: true
}),
/*#__PURE__*/ jsx(StageSelect, {
isCompact: true
})
]
});
};
Header.type = 'preview';
export { Header };
//# sourceMappingURL=Header.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"Header.mjs","sources":["../../../../../../../admin/src/routes/content-manager/model/id/components/Header.tsx"],"sourcesContent":["import { unstable_useDocumentLayout as useDocumentLayout } from '@strapi/content-manager/strapi-admin';\nimport { Flex } from '@strapi/design-system';\nimport { useParams } from 'react-router-dom';\n\nimport { AssigneeSelect } from './AssigneeSelect';\nimport { StageSelect } from './StageSelect';\n\nconst Header = () => {\n const {\n slug = '',\n id,\n collectionType,\n } = useParams<{\n collectionType: string;\n slug: string;\n id: string;\n }>();\n\n const {\n edit: { options },\n } = useDocumentLayout(slug);\n\n if (\n !window.strapi.isEE ||\n !options?.reviewWorkflows ||\n (collectionType !== 'single-types' && !id) ||\n id === 'create'\n ) {\n return null;\n }\n\n return (\n <Flex gap={2}>\n <AssigneeSelect isCompact />\n <StageSelect isCompact />\n </Flex>\n );\n};\n\nHeader.type = 'preview';\n\nexport { Header };\n"],"names":["Header","slug","id","collectionType","useParams","edit","options","useDocumentLayout","window","strapi","isEE","reviewWorkflows","_jsxs","Flex","gap","_jsx","AssigneeSelect","isCompact","StageSelect","type"],"mappings":";;;;;;;AAOA,MAAMA,MAAS,GAAA,IAAA;IACb,MAAM,EACJC,OAAO,EAAE,EACTC,EAAE,EACFC,cAAc,EACf,GAAGC,SAAAA,EAAAA;AAMJ,IAAA,MAAM,EACJC,IAAM,EAAA,EAAEC,OAAO,EAAE,EAClB,GAAGC,0BAAkBN,CAAAA,IAAAA,CAAAA;AAEtB,IAAA,IACE,CAACO,MAAAA,CAAOC,MAAM,CAACC,IAAI,IACnB,CAACJ,OAASK,EAAAA,eAAAA,IACTR,cAAmB,KAAA,cAAA,IAAkB,CAACD,EAAAA,IACvCA,OAAO,QACP,EAAA;QACA,OAAO,IAAA;AACT;AAEA,IAAA,qBACEU,IAACC,CAAAA,IAAAA,EAAAA;QAAKC,GAAK,EAAA,CAAA;;0BACTC,GAACC,CAAAA,cAAAA,EAAAA;gBAAeC,SAAS,EAAA;;0BACzBF,GAACG,CAAAA,WAAAA,EAAAA;gBAAYD,SAAS,EAAA;;;;AAG5B;AAEAjB,MAAAA,CAAOmB,IAAI,GAAG,SAAA;;;;"}
@@ -0,0 +1,39 @@
'use strict';
var jsxRuntime = require('react/jsx-runtime');
var strapiAdmin = require('@strapi/content-manager/strapi-admin');
var designSystem = require('@strapi/design-system');
var reactIntl = require('react-intl');
var reactRouterDom = require('react-router-dom');
var AssigneeSelect = require('./AssigneeSelect.js');
var StageSelect = require('./StageSelect.js');
const Panel = ()=>{
const { slug = '', id, collectionType } = reactRouterDom.useParams();
const { edit: { options } } = strapiAdmin.unstable_useDocumentLayout(slug);
const { formatMessage } = reactIntl.useIntl();
if (!window.strapi.isEE || !options?.reviewWorkflows || collectionType !== 'single-types' && !id || id === 'create') {
return null;
}
return {
title: formatMessage({
id: 'content-manager.containers.edit.panels.review-workflows.title',
defaultMessage: 'Review Workflows'
}),
content: /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Flex, {
direction: "column",
gap: 2,
alignItems: "stretch",
width: "100%",
children: [
/*#__PURE__*/ jsxRuntime.jsx(AssigneeSelect.AssigneeSelect, {}),
/*#__PURE__*/ jsxRuntime.jsx(StageSelect.StageSelect, {})
]
})
};
};
// @ts-expect-error – this is fine, we like to label the core panels / actions.
Panel.type = 'review-workflows';
exports.Panel = Panel;
//# sourceMappingURL=Panel.js.map
@@ -0,0 +1 @@
{"version":3,"file":"Panel.js","sources":["../../../../../../../admin/src/routes/content-manager/model/id/components/Panel.tsx"],"sourcesContent":["import { unstable_useDocumentLayout as useDocumentLayout } from '@strapi/content-manager/strapi-admin';\nimport { Flex } from '@strapi/design-system';\nimport { useIntl } from 'react-intl';\nimport { useParams } from 'react-router-dom';\n\nimport { AssigneeSelect } from './AssigneeSelect';\nimport { StageSelect } from './StageSelect';\n\nimport type { PanelComponent } from '@strapi/content-manager/strapi-admin';\n\nconst Panel: PanelComponent = () => {\n const {\n slug = '',\n id,\n collectionType,\n } = useParams<{\n collectionType: string;\n slug: string;\n id: string;\n }>();\n\n const {\n edit: { options },\n } = useDocumentLayout(slug);\n const { formatMessage } = useIntl();\n\n if (\n !window.strapi.isEE ||\n !options?.reviewWorkflows ||\n (collectionType !== 'single-types' && !id) ||\n id === 'create'\n ) {\n return null;\n }\n\n return {\n title: formatMessage({\n id: 'content-manager.containers.edit.panels.review-workflows.title',\n defaultMessage: 'Review Workflows',\n }),\n content: (\n <Flex direction=\"column\" gap={2} alignItems=\"stretch\" width=\"100%\">\n <AssigneeSelect />\n <StageSelect />\n </Flex>\n ),\n };\n};\n\n// @ts-expect-error – this is fine, we like to label the core panels / actions.\nPanel.type = 'review-workflows';\n\nexport { Panel };\n"],"names":["Panel","slug","id","collectionType","useParams","edit","options","useDocumentLayout","formatMessage","useIntl","window","strapi","isEE","reviewWorkflows","title","defaultMessage","content","_jsxs","Flex","direction","gap","alignItems","width","_jsx","AssigneeSelect","StageSelect","type"],"mappings":";;;;;;;;;;AAUA,MAAMA,KAAwB,GAAA,IAAA;IAC5B,MAAM,EACJC,OAAO,EAAE,EACTC,EAAE,EACFC,cAAc,EACf,GAAGC,wBAAAA,EAAAA;AAMJ,IAAA,MAAM,EACJC,IAAM,EAAA,EAAEC,OAAO,EAAE,EAClB,GAAGC,sCAAkBN,CAAAA,IAAAA,CAAAA;IACtB,MAAM,EAAEO,aAAa,EAAE,GAAGC,iBAAAA,EAAAA;AAE1B,IAAA,IACE,CAACC,MAAAA,CAAOC,MAAM,CAACC,IAAI,IACnB,CAACN,OAASO,EAAAA,eAAAA,IACTV,cAAmB,KAAA,cAAA,IAAkB,CAACD,EAAAA,IACvCA,OAAO,QACP,EAAA;QACA,OAAO,IAAA;AACT;IAEA,OAAO;AACLY,QAAAA,KAAAA,EAAON,aAAc,CAAA;YACnBN,EAAI,EAAA,+DAAA;YACJa,cAAgB,EAAA;AAClB,SAAA,CAAA;AACAC,QAAAA,OAAAA,gBACEC,eAACC,CAAAA,iBAAAA,EAAAA;YAAKC,SAAU,EAAA,QAAA;YAASC,GAAK,EAAA,CAAA;YAAGC,UAAW,EAAA,SAAA;YAAUC,KAAM,EAAA,MAAA;;8BAC1DC,cAACC,CAAAA,6BAAAA,EAAAA,EAAAA,CAAAA;8BACDD,cAACE,CAAAA,uBAAAA,EAAAA,EAAAA;;;AAGP,KAAA;AACF;AAEA;AACAzB,KAAAA,CAAM0B,IAAI,GAAG,kBAAA;;;;"}
@@ -0,0 +1,37 @@
import { jsxs, jsx } from 'react/jsx-runtime';
import { unstable_useDocumentLayout } from '@strapi/content-manager/strapi-admin';
import { Flex } from '@strapi/design-system';
import { useIntl } from 'react-intl';
import { useParams } from 'react-router-dom';
import { AssigneeSelect } from './AssigneeSelect.mjs';
import { StageSelect } from './StageSelect.mjs';
const Panel = ()=>{
const { slug = '', id, collectionType } = useParams();
const { edit: { options } } = unstable_useDocumentLayout(slug);
const { formatMessage } = useIntl();
if (!window.strapi.isEE || !options?.reviewWorkflows || collectionType !== 'single-types' && !id || id === 'create') {
return null;
}
return {
title: formatMessage({
id: 'content-manager.containers.edit.panels.review-workflows.title',
defaultMessage: 'Review Workflows'
}),
content: /*#__PURE__*/ jsxs(Flex, {
direction: "column",
gap: 2,
alignItems: "stretch",
width: "100%",
children: [
/*#__PURE__*/ jsx(AssigneeSelect, {}),
/*#__PURE__*/ jsx(StageSelect, {})
]
})
};
};
// @ts-expect-error – this is fine, we like to label the core panels / actions.
Panel.type = 'review-workflows';
export { Panel };
//# sourceMappingURL=Panel.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"Panel.mjs","sources":["../../../../../../../admin/src/routes/content-manager/model/id/components/Panel.tsx"],"sourcesContent":["import { unstable_useDocumentLayout as useDocumentLayout } from '@strapi/content-manager/strapi-admin';\nimport { Flex } from '@strapi/design-system';\nimport { useIntl } from 'react-intl';\nimport { useParams } from 'react-router-dom';\n\nimport { AssigneeSelect } from './AssigneeSelect';\nimport { StageSelect } from './StageSelect';\n\nimport type { PanelComponent } from '@strapi/content-manager/strapi-admin';\n\nconst Panel: PanelComponent = () => {\n const {\n slug = '',\n id,\n collectionType,\n } = useParams<{\n collectionType: string;\n slug: string;\n id: string;\n }>();\n\n const {\n edit: { options },\n } = useDocumentLayout(slug);\n const { formatMessage } = useIntl();\n\n if (\n !window.strapi.isEE ||\n !options?.reviewWorkflows ||\n (collectionType !== 'single-types' && !id) ||\n id === 'create'\n ) {\n return null;\n }\n\n return {\n title: formatMessage({\n id: 'content-manager.containers.edit.panels.review-workflows.title',\n defaultMessage: 'Review Workflows',\n }),\n content: (\n <Flex direction=\"column\" gap={2} alignItems=\"stretch\" width=\"100%\">\n <AssigneeSelect />\n <StageSelect />\n </Flex>\n ),\n };\n};\n\n// @ts-expect-error – this is fine, we like to label the core panels / actions.\nPanel.type = 'review-workflows';\n\nexport { Panel };\n"],"names":["Panel","slug","id","collectionType","useParams","edit","options","useDocumentLayout","formatMessage","useIntl","window","strapi","isEE","reviewWorkflows","title","defaultMessage","content","_jsxs","Flex","direction","gap","alignItems","width","_jsx","AssigneeSelect","StageSelect","type"],"mappings":";;;;;;;;AAUA,MAAMA,KAAwB,GAAA,IAAA;IAC5B,MAAM,EACJC,OAAO,EAAE,EACTC,EAAE,EACFC,cAAc,EACf,GAAGC,SAAAA,EAAAA;AAMJ,IAAA,MAAM,EACJC,IAAM,EAAA,EAAEC,OAAO,EAAE,EAClB,GAAGC,0BAAkBN,CAAAA,IAAAA,CAAAA;IACtB,MAAM,EAAEO,aAAa,EAAE,GAAGC,OAAAA,EAAAA;AAE1B,IAAA,IACE,CAACC,MAAAA,CAAOC,MAAM,CAACC,IAAI,IACnB,CAACN,OAASO,EAAAA,eAAAA,IACTV,cAAmB,KAAA,cAAA,IAAkB,CAACD,EAAAA,IACvCA,OAAO,QACP,EAAA;QACA,OAAO,IAAA;AACT;IAEA,OAAO;AACLY,QAAAA,KAAAA,EAAON,aAAc,CAAA;YACnBN,EAAI,EAAA,+DAAA;YACJa,cAAgB,EAAA;AAClB,SAAA,CAAA;AACAC,QAAAA,OAAAA,gBACEC,IAACC,CAAAA,IAAAA,EAAAA;YAAKC,SAAU,EAAA,QAAA;YAASC,GAAK,EAAA,CAAA;YAAGC,UAAW,EAAA,SAAA;YAAUC,KAAM,EAAA,MAAA;;8BAC1DC,GAACC,CAAAA,cAAAA,EAAAA,EAAAA,CAAAA;8BACDD,GAACE,CAAAA,WAAAA,EAAAA,EAAAA;;;AAGP,KAAA;AACF;AAEA;AACAzB,KAAAA,CAAM0B,IAAI,GAAG,kBAAA;;;;"}
@@ -0,0 +1,329 @@
'use strict';
var jsxRuntime = require('react/jsx-runtime');
var React = require('react');
var strapiAdmin = require('@strapi/admin/strapi-admin');
var ee = require('@strapi/admin/strapi-admin/ee');
var strapiAdmin$1 = require('@strapi/content-manager/strapi-admin');
var designSystem = require('@strapi/design-system');
var reactIntl = require('react-intl');
var reactRouterDom = require('react-router-dom');
var LimitsModal = require('../../../../../components/LimitsModal.js');
var constants$1 = require('../../../../../constants.js');
var contentManager = require('../../../../../services/content-manager.js');
var api = require('../../../../../utils/api.js');
var colors = require('../../../../../utils/colors.js');
var constants = require('./constants.js');
function _interopNamespaceDefault(e) {
var n = Object.create(null);
if (e) {
Object.keys(e).forEach(function (k) {
if (k !== 'default') {
var d = Object.getOwnPropertyDescriptor(e, k);
Object.defineProperty(n, k, d.get ? d : {
enumerable: true,
get: function () { return e[k]; }
});
}
});
}
n.default = e;
return Object.freeze(n);
}
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
/* -------------------------------------------------------------------------------------------------
* LimitModals
* -----------------------------------------------------------------------------------------------*/ const WorkflowLimitModal = ({ open, onOpenChange })=>{
const { formatMessage } = reactIntl.useIntl();
return /*#__PURE__*/ jsxRuntime.jsxs(LimitsModal.LimitsModal.Root, {
open: open,
onOpenChange: onOpenChange,
children: [
/*#__PURE__*/ jsxRuntime.jsx(LimitsModal.LimitsModal.Title, {
children: formatMessage({
id: 'content-manager.reviewWorkflows.workflows.limit.title',
defaultMessage: 'You’ve reached the limit of workflows in your plan'
})
}),
/*#__PURE__*/ jsxRuntime.jsx(LimitsModal.LimitsModal.Body, {
children: formatMessage({
id: 'content-manager.reviewWorkflows.workflows.limit.body',
defaultMessage: 'Delete a workflow or contact Sales to enable more workflows.'
})
})
]
});
};
const StageLimitModal = ({ open, onOpenChange })=>{
const { formatMessage } = reactIntl.useIntl();
return /*#__PURE__*/ jsxRuntime.jsxs(LimitsModal.LimitsModal.Root, {
open: open,
onOpenChange: onOpenChange,
children: [
/*#__PURE__*/ jsxRuntime.jsx(LimitsModal.LimitsModal.Title, {
children: formatMessage({
id: 'content-manager.reviewWorkflows.stages.limit.title',
defaultMessage: 'You have reached the limit of stages for this workflow in your plan'
})
}),
/*#__PURE__*/ jsxRuntime.jsx(LimitsModal.LimitsModal.Body, {
children: formatMessage({
id: 'content-manager.reviewWorkflows.stages.limit.body',
defaultMessage: 'Try deleting some stages or contact Sales to enable more stages.'
})
})
]
});
};
/* -------------------------------------------------------------------------------------------------
* StageSelect
* -----------------------------------------------------------------------------------------------*/ const Select = ({ stages, activeWorkflowStage, isLoading, ...props })=>{
const { formatMessage } = reactIntl.useIntl();
const { themeColorName } = colors.getStageColorByHex(activeWorkflowStage?.color) ?? {};
return /*#__PURE__*/ jsxRuntime.jsx(designSystem.SingleSelect, {
disabled: stages.length === 0,
placeholder: formatMessage({
id: 'content-manager.reviewWorkflows.assignee.placeholder',
defaultMessage: 'Select…'
}),
startIcon: activeWorkflowStage && /*#__PURE__*/ jsxRuntime.jsx(designSystem.Flex, {
tag: "span",
height: 2,
background: activeWorkflowStage?.color,
borderColor: themeColorName === 'neutral0' ? 'neutral150' : undefined,
hasRadius: true,
shrink: 0,
width: 2,
marginRight: "-3px"
}),
// @ts-expect-error – `customizeContent` is not correctly typed in the DS.
customizeContent: ()=>{
return /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Flex, {
tag: "span",
justifyContent: "space-between",
alignItems: "center",
width: "100%",
children: [
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Typography, {
textColor: "neutral800",
ellipsis: true,
lineHeight: "inherit",
children: activeWorkflowStage?.name ?? ''
}),
isLoading ? /*#__PURE__*/ jsxRuntime.jsx(designSystem.Loader, {
small: true,
style: {
display: 'flex'
},
"data-testid": "loader"
}) : null
]
});
},
...props,
children: stages.map(({ id, color, name })=>{
const { themeColorName } = colors.getStageColorByHex(color) ?? {};
return /*#__PURE__*/ jsxRuntime.jsx(designSystem.SingleSelectOption, {
startIcon: /*#__PURE__*/ jsxRuntime.jsx(designSystem.Flex, {
height: 2,
background: color,
borderColor: themeColorName === 'neutral0' ? 'neutral150' : undefined,
hasRadius: true,
shrink: 0,
width: 2
}),
value: id,
textValue: name,
children: name
}, id);
})
});
};
const StageSelect = ({ isCompact })=>{
const { collectionType = '', slug: model = '', id = '' } = reactRouterDom.useParams();
const { formatMessage } = reactIntl.useIntl();
const { _unstableFormatAPIError: formatAPIError } = strapiAdmin.useAPIErrorHandler();
const { toggleNotification } = strapiAdmin.useNotification();
const [{ query }] = strapiAdmin.useQueryParams();
const params = React__namespace.useMemo(()=>api.buildValidParams(query), [
query
]);
const { document, isLoading: isLoadingDocument } = strapiAdmin$1.unstable_useDocument({
collectionType,
model,
documentId: id
}, {
skip: !id && collectionType !== 'single-types'
});
const { data, isLoading: isLoadingStages } = contentManager.useGetStagesQuery({
slug: collectionType,
model: model,
// @ts-expect-error – `id` is not correctly typed in the DS.
id: document?.documentId,
params
}, {
skip: !document?.documentId
});
const { meta, stages = [] } = data ?? {};
const { getFeature } = ee.useLicenseLimits();
const [showLimitModal, setShowLimitModal] = React__namespace.useState(null);
const limits = getFeature('review-workflows') ?? {};
const activeWorkflowStage = document ? document[constants.STAGE_ATTRIBUTE_NAME] : null;
const [updateStage, { error }] = contentManager.useUpdateStageMutation();
const handleChange = async (stageId)=>{
try {
/**
* If the current license has a limit:
* check if the total count of workflows exceeds that limit and display
* the limits modal.
*
* If the current license does not have a limit (e.g. offline license):
* do nothing (for now).
*
*/ if (limits?.[constants$1.CHARGEBEE_WORKFLOW_ENTITLEMENT_NAME] && parseInt(limits[constants$1.CHARGEBEE_WORKFLOW_ENTITLEMENT_NAME], 10) < (meta?.workflowCount ?? 0)) {
setShowLimitModal('workflow');
/**
* If the current license has a limit:
* check if the total count of stages exceeds that limit and display
* the limits modal.
*
* If the current license does not have a limit (e.g. offline license):
* do nothing (for now).
*
*/ } else if (limits?.[constants$1.CHARGEBEE_STAGES_PER_WORKFLOW_ENTITLEMENT_NAME] && parseInt(limits[constants$1.CHARGEBEE_STAGES_PER_WORKFLOW_ENTITLEMENT_NAME], 10) < stages.length) {
setShowLimitModal('stage');
} else {
if (document?.documentId) {
const res = await updateStage({
model,
id: document.documentId,
slug: collectionType,
params,
data: {
id: stageId
}
});
if ('data' in res) {
toggleNotification({
type: 'success',
message: formatMessage({
id: 'content-manager.reviewWorkflows.stage.notification.saved',
defaultMessage: 'Review stage updated'
})
});
}
if (isCompact && 'error' in res) {
toggleNotification({
type: 'danger',
message: formatAPIError(res.error)
});
}
}
}
} catch (error) {
toggleNotification({
type: 'danger',
message: formatMessage({
id: 'content-manager.reviewWorkflows.stage.notification.error',
defaultMessage: 'An error occurred while updating the review stage'
})
});
}
};
const isLoading = isLoadingStages || isLoadingDocument;
const reviewStageLabel = formatMessage({
id: 'content-manager.reviewWorkflows.stage.label',
defaultMessage: 'Review stage'
});
const reviewStageHint = !isLoading && stages.length === 0 && // TODO: Handle errors and hints
formatMessage({
id: 'content-manager.reviewWorkflows.stages.no-transition',
defaultMessage: 'You don’t have the permission to update this stage.'
});
if (isCompact) {
return /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
children: [
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Tooltip, {
label: reviewStageHint,
children: /*#__PURE__*/ jsxRuntime.jsx(designSystem.Field.Root, {
name: constants.STAGE_ATTRIBUTE_NAME,
id: constants.STAGE_ATTRIBUTE_NAME,
children: /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
children: [
/*#__PURE__*/ jsxRuntime.jsx(designSystem.VisuallyHidden, {
children: /*#__PURE__*/ jsxRuntime.jsx(designSystem.Field.Label, {
children: reviewStageLabel
})
}),
/*#__PURE__*/ jsxRuntime.jsx(Select, {
stages: stages,
activeWorkflowStage: activeWorkflowStage,
isLoading: isLoading,
size: "S",
disabled: stages.length === 0,
value: activeWorkflowStage?.id,
onChange: handleChange,
placeholder: formatMessage({
id: 'content-manager.reviewWorkflows.assignee.placeholder',
defaultMessage: 'Select…'
})
})
]
})
})
}),
/*#__PURE__*/ jsxRuntime.jsx(WorkflowLimitModal, {
open: showLimitModal === 'workflow',
onOpenChange: ()=>setShowLimitModal(null)
}),
/*#__PURE__*/ jsxRuntime.jsx(StageLimitModal, {
open: showLimitModal === 'stage',
onOpenChange: ()=>setShowLimitModal(null)
})
]
});
}
return /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
children: [
/*#__PURE__*/ jsxRuntime.jsxs(designSystem.Field.Root, {
hint: reviewStageHint,
error: error && formatAPIError(error) || undefined,
name: constants.STAGE_ATTRIBUTE_NAME,
id: constants.STAGE_ATTRIBUTE_NAME,
children: [
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Field.Label, {
children: reviewStageLabel
}),
/*#__PURE__*/ jsxRuntime.jsx(Select, {
stages: stages,
activeWorkflowStage: activeWorkflowStage,
isLoading: isLoading,
disabled: stages.length === 0,
value: activeWorkflowStage?.id,
onChange: handleChange,
placeholder: formatMessage({
id: 'content-manager.reviewWorkflows.assignee.placeholder',
defaultMessage: 'Select…'
})
}),
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Field.Hint, {}),
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Field.Error, {})
]
}),
/*#__PURE__*/ jsxRuntime.jsx(WorkflowLimitModal, {
open: showLimitModal === 'workflow',
onOpenChange: ()=>setShowLimitModal(null)
}),
/*#__PURE__*/ jsxRuntime.jsx(StageLimitModal, {
open: showLimitModal === 'stage',
onOpenChange: ()=>setShowLimitModal(null)
})
]
});
};
exports.StageSelect = StageSelect;
//# sourceMappingURL=StageSelect.js.map
@@ -0,0 +1 @@
{"version":3,"file":"StageSelect.js","sources":["../../../../../../../admin/src/routes/content-manager/model/id/components/StageSelect.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { useNotification, useAPIErrorHandler, useQueryParams } from '@strapi/admin/strapi-admin';\nimport { useLicenseLimits } from '@strapi/admin/strapi-admin/ee';\nimport { unstable_useDocument } from '@strapi/content-manager/strapi-admin';\nimport {\n SingleSelect,\n type SingleSelectProps,\n SingleSelectOption,\n Field,\n Flex,\n Loader,\n Typography,\n VisuallyHidden,\n Tooltip,\n} from '@strapi/design-system';\nimport { useIntl } from 'react-intl';\nimport { useParams } from 'react-router-dom';\n\nimport { Stage } from '../../../../../../../shared/contracts/review-workflows';\nimport { LimitsModal, LimitsModalProps } from '../../../../../components/LimitsModal';\nimport {\n CHARGEBEE_STAGES_PER_WORKFLOW_ENTITLEMENT_NAME,\n CHARGEBEE_WORKFLOW_ENTITLEMENT_NAME,\n} from '../../../../../constants';\nimport { useGetStagesQuery, useUpdateStageMutation } from '../../../../../services/content-manager';\nimport { buildValidParams } from '../../../../../utils/api';\nimport { getStageColorByHex } from '../../../../../utils/colors';\n\nimport { STAGE_ATTRIBUTE_NAME } from './constants';\n\nimport type { Data } from '@strapi/types';\n\n/* -------------------------------------------------------------------------------------------------\n * LimitModals\n * -----------------------------------------------------------------------------------------------*/\n\nconst WorkflowLimitModal = ({ open, onOpenChange }: LimitsModalProps) => {\n const { formatMessage } = useIntl();\n\n return (\n <LimitsModal.Root open={open} onOpenChange={onOpenChange}>\n <LimitsModal.Title>\n {formatMessage({\n id: 'content-manager.reviewWorkflows.workflows.limit.title',\n defaultMessage: 'You’ve reached the limit of workflows in your plan',\n })}\n </LimitsModal.Title>\n\n <LimitsModal.Body>\n {formatMessage({\n id: 'content-manager.reviewWorkflows.workflows.limit.body',\n defaultMessage: 'Delete a workflow or contact Sales to enable more workflows.',\n })}\n </LimitsModal.Body>\n </LimitsModal.Root>\n );\n};\n\nconst StageLimitModal = ({ open, onOpenChange }: LimitsModalProps) => {\n const { formatMessage } = useIntl();\n\n return (\n <LimitsModal.Root open={open} onOpenChange={onOpenChange}>\n <LimitsModal.Title>\n {formatMessage({\n id: 'content-manager.reviewWorkflows.stages.limit.title',\n defaultMessage: 'You have reached the limit of stages for this workflow in your plan',\n })}\n </LimitsModal.Title>\n\n <LimitsModal.Body>\n {formatMessage({\n id: 'content-manager.reviewWorkflows.stages.limit.body',\n defaultMessage: 'Try deleting some stages or contact Sales to enable more stages.',\n })}\n </LimitsModal.Body>\n </LimitsModal.Root>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * StageSelect\n * -----------------------------------------------------------------------------------------------*/\n\nconst Select = ({\n stages,\n activeWorkflowStage,\n isLoading,\n ...props\n}: SingleSelectProps & { stages: Stage[]; activeWorkflowStage: Stage; isLoading: boolean }) => {\n const { formatMessage } = useIntl();\n const { themeColorName } = getStageColorByHex(activeWorkflowStage?.color) ?? {};\n\n return (\n <SingleSelect\n disabled={stages.length === 0}\n placeholder={formatMessage({\n id: 'content-manager.reviewWorkflows.assignee.placeholder',\n defaultMessage: 'Select…',\n })}\n startIcon={\n activeWorkflowStage && (\n <Flex\n tag=\"span\"\n height={2}\n background={activeWorkflowStage?.color}\n borderColor={themeColorName === 'neutral0' ? 'neutral150' : undefined}\n hasRadius\n shrink={0}\n width={2}\n marginRight=\"-3px\"\n />\n )\n }\n // @ts-expect-error – `customizeContent` is not correctly typed in the DS.\n customizeContent={() => {\n return (\n <Flex tag=\"span\" justifyContent=\"space-between\" alignItems=\"center\" width=\"100%\">\n <Typography textColor=\"neutral800\" ellipsis lineHeight=\"inherit\">\n {activeWorkflowStage?.name ?? ''}\n </Typography>\n {isLoading ? <Loader small style={{ display: 'flex' }} data-testid=\"loader\" /> : null}\n </Flex>\n );\n }}\n {...props}\n >\n {stages.map(({ id, color, name }) => {\n const { themeColorName } = getStageColorByHex(color) ?? {};\n\n return (\n <SingleSelectOption\n key={id}\n startIcon={\n <Flex\n Line truncated
@@ -0,0 +1,308 @@
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
import * as React from 'react';
import { useAPIErrorHandler, useNotification, useQueryParams } from '@strapi/admin/strapi-admin';
import { useLicenseLimits } from '@strapi/admin/strapi-admin/ee';
import { unstable_useDocument } from '@strapi/content-manager/strapi-admin';
import { Tooltip, Field, VisuallyHidden, SingleSelect, Flex, Typography, Loader, SingleSelectOption } from '@strapi/design-system';
import { useIntl } from 'react-intl';
import { useParams } from 'react-router-dom';
import { LimitsModal } from '../../../../../components/LimitsModal.mjs';
import { CHARGEBEE_WORKFLOW_ENTITLEMENT_NAME, CHARGEBEE_STAGES_PER_WORKFLOW_ENTITLEMENT_NAME } from '../../../../../constants.mjs';
import { useGetStagesQuery, useUpdateStageMutation } from '../../../../../services/content-manager.mjs';
import { buildValidParams } from '../../../../../utils/api.mjs';
import { getStageColorByHex } from '../../../../../utils/colors.mjs';
import { STAGE_ATTRIBUTE_NAME } from './constants.mjs';
/* -------------------------------------------------------------------------------------------------
* LimitModals
* -----------------------------------------------------------------------------------------------*/ const WorkflowLimitModal = ({ open, onOpenChange })=>{
const { formatMessage } = useIntl();
return /*#__PURE__*/ jsxs(LimitsModal.Root, {
open: open,
onOpenChange: onOpenChange,
children: [
/*#__PURE__*/ jsx(LimitsModal.Title, {
children: formatMessage({
id: 'content-manager.reviewWorkflows.workflows.limit.title',
defaultMessage: 'You’ve reached the limit of workflows in your plan'
})
}),
/*#__PURE__*/ jsx(LimitsModal.Body, {
children: formatMessage({
id: 'content-manager.reviewWorkflows.workflows.limit.body',
defaultMessage: 'Delete a workflow or contact Sales to enable more workflows.'
})
})
]
});
};
const StageLimitModal = ({ open, onOpenChange })=>{
const { formatMessage } = useIntl();
return /*#__PURE__*/ jsxs(LimitsModal.Root, {
open: open,
onOpenChange: onOpenChange,
children: [
/*#__PURE__*/ jsx(LimitsModal.Title, {
children: formatMessage({
id: 'content-manager.reviewWorkflows.stages.limit.title',
defaultMessage: 'You have reached the limit of stages for this workflow in your plan'
})
}),
/*#__PURE__*/ jsx(LimitsModal.Body, {
children: formatMessage({
id: 'content-manager.reviewWorkflows.stages.limit.body',
defaultMessage: 'Try deleting some stages or contact Sales to enable more stages.'
})
})
]
});
};
/* -------------------------------------------------------------------------------------------------
* StageSelect
* -----------------------------------------------------------------------------------------------*/ const Select = ({ stages, activeWorkflowStage, isLoading, ...props })=>{
const { formatMessage } = useIntl();
const { themeColorName } = getStageColorByHex(activeWorkflowStage?.color) ?? {};
return /*#__PURE__*/ jsx(SingleSelect, {
disabled: stages.length === 0,
placeholder: formatMessage({
id: 'content-manager.reviewWorkflows.assignee.placeholder',
defaultMessage: 'Select…'
}),
startIcon: activeWorkflowStage && /*#__PURE__*/ jsx(Flex, {
tag: "span",
height: 2,
background: activeWorkflowStage?.color,
borderColor: themeColorName === 'neutral0' ? 'neutral150' : undefined,
hasRadius: true,
shrink: 0,
width: 2,
marginRight: "-3px"
}),
// @ts-expect-error – `customizeContent` is not correctly typed in the DS.
customizeContent: ()=>{
return /*#__PURE__*/ jsxs(Flex, {
tag: "span",
justifyContent: "space-between",
alignItems: "center",
width: "100%",
children: [
/*#__PURE__*/ jsx(Typography, {
textColor: "neutral800",
ellipsis: true,
lineHeight: "inherit",
children: activeWorkflowStage?.name ?? ''
}),
isLoading ? /*#__PURE__*/ jsx(Loader, {
small: true,
style: {
display: 'flex'
},
"data-testid": "loader"
}) : null
]
});
},
...props,
children: stages.map(({ id, color, name })=>{
const { themeColorName } = getStageColorByHex(color) ?? {};
return /*#__PURE__*/ jsx(SingleSelectOption, {
startIcon: /*#__PURE__*/ jsx(Flex, {
height: 2,
background: color,
borderColor: themeColorName === 'neutral0' ? 'neutral150' : undefined,
hasRadius: true,
shrink: 0,
width: 2
}),
value: id,
textValue: name,
children: name
}, id);
})
});
};
const StageSelect = ({ isCompact })=>{
const { collectionType = '', slug: model = '', id = '' } = useParams();
const { formatMessage } = useIntl();
const { _unstableFormatAPIError: formatAPIError } = useAPIErrorHandler();
const { toggleNotification } = useNotification();
const [{ query }] = useQueryParams();
const params = React.useMemo(()=>buildValidParams(query), [
query
]);
const { document, isLoading: isLoadingDocument } = unstable_useDocument({
collectionType,
model,
documentId: id
}, {
skip: !id && collectionType !== 'single-types'
});
const { data, isLoading: isLoadingStages } = useGetStagesQuery({
slug: collectionType,
model: model,
// @ts-expect-error – `id` is not correctly typed in the DS.
id: document?.documentId,
params
}, {
skip: !document?.documentId
});
const { meta, stages = [] } = data ?? {};
const { getFeature } = useLicenseLimits();
const [showLimitModal, setShowLimitModal] = React.useState(null);
const limits = getFeature('review-workflows') ?? {};
const activeWorkflowStage = document ? document[STAGE_ATTRIBUTE_NAME] : null;
const [updateStage, { error }] = useUpdateStageMutation();
const handleChange = async (stageId)=>{
try {
/**
* If the current license has a limit:
* check if the total count of workflows exceeds that limit and display
* the limits modal.
*
* If the current license does not have a limit (e.g. offline license):
* do nothing (for now).
*
*/ if (limits?.[CHARGEBEE_WORKFLOW_ENTITLEMENT_NAME] && parseInt(limits[CHARGEBEE_WORKFLOW_ENTITLEMENT_NAME], 10) < (meta?.workflowCount ?? 0)) {
setShowLimitModal('workflow');
/**
* If the current license has a limit:
* check if the total count of stages exceeds that limit and display
* the limits modal.
*
* If the current license does not have a limit (e.g. offline license):
* do nothing (for now).
*
*/ } else if (limits?.[CHARGEBEE_STAGES_PER_WORKFLOW_ENTITLEMENT_NAME] && parseInt(limits[CHARGEBEE_STAGES_PER_WORKFLOW_ENTITLEMENT_NAME], 10) < stages.length) {
setShowLimitModal('stage');
} else {
if (document?.documentId) {
const res = await updateStage({
model,
id: document.documentId,
slug: collectionType,
params,
data: {
id: stageId
}
});
if ('data' in res) {
toggleNotification({
type: 'success',
message: formatMessage({
id: 'content-manager.reviewWorkflows.stage.notification.saved',
defaultMessage: 'Review stage updated'
})
});
}
if (isCompact && 'error' in res) {
toggleNotification({
type: 'danger',
message: formatAPIError(res.error)
});
}
}
}
} catch (error) {
toggleNotification({
type: 'danger',
message: formatMessage({
id: 'content-manager.reviewWorkflows.stage.notification.error',
defaultMessage: 'An error occurred while updating the review stage'
})
});
}
};
const isLoading = isLoadingStages || isLoadingDocument;
const reviewStageLabel = formatMessage({
id: 'content-manager.reviewWorkflows.stage.label',
defaultMessage: 'Review stage'
});
const reviewStageHint = !isLoading && stages.length === 0 && // TODO: Handle errors and hints
formatMessage({
id: 'content-manager.reviewWorkflows.stages.no-transition',
defaultMessage: 'You don’t have the permission to update this stage.'
});
if (isCompact) {
return /*#__PURE__*/ jsxs(Fragment, {
children: [
/*#__PURE__*/ jsx(Tooltip, {
label: reviewStageHint,
children: /*#__PURE__*/ jsx(Field.Root, {
name: STAGE_ATTRIBUTE_NAME,
id: STAGE_ATTRIBUTE_NAME,
children: /*#__PURE__*/ jsxs(Fragment, {
children: [
/*#__PURE__*/ jsx(VisuallyHidden, {
children: /*#__PURE__*/ jsx(Field.Label, {
children: reviewStageLabel
})
}),
/*#__PURE__*/ jsx(Select, {
stages: stages,
activeWorkflowStage: activeWorkflowStage,
isLoading: isLoading,
size: "S",
disabled: stages.length === 0,
value: activeWorkflowStage?.id,
onChange: handleChange,
placeholder: formatMessage({
id: 'content-manager.reviewWorkflows.assignee.placeholder',
defaultMessage: 'Select…'
})
})
]
})
})
}),
/*#__PURE__*/ jsx(WorkflowLimitModal, {
open: showLimitModal === 'workflow',
onOpenChange: ()=>setShowLimitModal(null)
}),
/*#__PURE__*/ jsx(StageLimitModal, {
open: showLimitModal === 'stage',
onOpenChange: ()=>setShowLimitModal(null)
})
]
});
}
return /*#__PURE__*/ jsxs(Fragment, {
children: [
/*#__PURE__*/ jsxs(Field.Root, {
hint: reviewStageHint,
error: error && formatAPIError(error) || undefined,
name: STAGE_ATTRIBUTE_NAME,
id: STAGE_ATTRIBUTE_NAME,
children: [
/*#__PURE__*/ jsx(Field.Label, {
children: reviewStageLabel
}),
/*#__PURE__*/ jsx(Select, {
stages: stages,
activeWorkflowStage: activeWorkflowStage,
isLoading: isLoading,
disabled: stages.length === 0,
value: activeWorkflowStage?.id,
onChange: handleChange,
placeholder: formatMessage({
id: 'content-manager.reviewWorkflows.assignee.placeholder',
defaultMessage: 'Select…'
})
}),
/*#__PURE__*/ jsx(Field.Hint, {}),
/*#__PURE__*/ jsx(Field.Error, {})
]
}),
/*#__PURE__*/ jsx(WorkflowLimitModal, {
open: showLimitModal === 'workflow',
onOpenChange: ()=>setShowLimitModal(null)
}),
/*#__PURE__*/ jsx(StageLimitModal, {
open: showLimitModal === 'stage',
onOpenChange: ()=>setShowLimitModal(null)
})
]
});
};
export { StageSelect };
//# sourceMappingURL=StageSelect.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"StageSelect.mjs","sources":["../../../../../../../admin/src/routes/content-manager/model/id/components/StageSelect.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { useNotification, useAPIErrorHandler, useQueryParams } from '@strapi/admin/strapi-admin';\nimport { useLicenseLimits } from '@strapi/admin/strapi-admin/ee';\nimport { unstable_useDocument } from '@strapi/content-manager/strapi-admin';\nimport {\n SingleSelect,\n type SingleSelectProps,\n SingleSelectOption,\n Field,\n Flex,\n Loader,\n Typography,\n VisuallyHidden,\n Tooltip,\n} from '@strapi/design-system';\nimport { useIntl } from 'react-intl';\nimport { useParams } from 'react-router-dom';\n\nimport { Stage } from '../../../../../../../shared/contracts/review-workflows';\nimport { LimitsModal, LimitsModalProps } from '../../../../../components/LimitsModal';\nimport {\n CHARGEBEE_STAGES_PER_WORKFLOW_ENTITLEMENT_NAME,\n CHARGEBEE_WORKFLOW_ENTITLEMENT_NAME,\n} from '../../../../../constants';\nimport { useGetStagesQuery, useUpdateStageMutation } from '../../../../../services/content-manager';\nimport { buildValidParams } from '../../../../../utils/api';\nimport { getStageColorByHex } from '../../../../../utils/colors';\n\nimport { STAGE_ATTRIBUTE_NAME } from './constants';\n\nimport type { Data } from '@strapi/types';\n\n/* -------------------------------------------------------------------------------------------------\n * LimitModals\n * -----------------------------------------------------------------------------------------------*/\n\nconst WorkflowLimitModal = ({ open, onOpenChange }: LimitsModalProps) => {\n const { formatMessage } = useIntl();\n\n return (\n <LimitsModal.Root open={open} onOpenChange={onOpenChange}>\n <LimitsModal.Title>\n {formatMessage({\n id: 'content-manager.reviewWorkflows.workflows.limit.title',\n defaultMessage: 'You’ve reached the limit of workflows in your plan',\n })}\n </LimitsModal.Title>\n\n <LimitsModal.Body>\n {formatMessage({\n id: 'content-manager.reviewWorkflows.workflows.limit.body',\n defaultMessage: 'Delete a workflow or contact Sales to enable more workflows.',\n })}\n </LimitsModal.Body>\n </LimitsModal.Root>\n );\n};\n\nconst StageLimitModal = ({ open, onOpenChange }: LimitsModalProps) => {\n const { formatMessage } = useIntl();\n\n return (\n <LimitsModal.Root open={open} onOpenChange={onOpenChange}>\n <LimitsModal.Title>\n {formatMessage({\n id: 'content-manager.reviewWorkflows.stages.limit.title',\n defaultMessage: 'You have reached the limit of stages for this workflow in your plan',\n })}\n </LimitsModal.Title>\n\n <LimitsModal.Body>\n {formatMessage({\n id: 'content-manager.reviewWorkflows.stages.limit.body',\n defaultMessage: 'Try deleting some stages or contact Sales to enable more stages.',\n })}\n </LimitsModal.Body>\n </LimitsModal.Root>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * StageSelect\n * -----------------------------------------------------------------------------------------------*/\n\nconst Select = ({\n stages,\n activeWorkflowStage,\n isLoading,\n ...props\n}: SingleSelectProps & { stages: Stage[]; activeWorkflowStage: Stage; isLoading: boolean }) => {\n const { formatMessage } = useIntl();\n const { themeColorName } = getStageColorByHex(activeWorkflowStage?.color) ?? {};\n\n return (\n <SingleSelect\n disabled={stages.length === 0}\n placeholder={formatMessage({\n id: 'content-manager.reviewWorkflows.assignee.placeholder',\n defaultMessage: 'Select…',\n })}\n startIcon={\n activeWorkflowStage && (\n <Flex\n tag=\"span\"\n height={2}\n background={activeWorkflowStage?.color}\n borderColor={themeColorName === 'neutral0' ? 'neutral150' : undefined}\n hasRadius\n shrink={0}\n width={2}\n marginRight=\"-3px\"\n />\n )\n }\n // @ts-expect-error – `customizeContent` is not correctly typed in the DS.\n customizeContent={() => {\n return (\n <Flex tag=\"span\" justifyContent=\"space-between\" alignItems=\"center\" width=\"100%\">\n <Typography textColor=\"neutral800\" ellipsis lineHeight=\"inherit\">\n {activeWorkflowStage?.name ?? ''}\n </Typography>\n {isLoading ? <Loader small style={{ display: 'flex' }} data-testid=\"loader\" /> : null}\n </Flex>\n );\n }}\n {...props}\n >\n {stages.map(({ id, color, name }) => {\n const { themeColorName } = getStageColorByHex(color) ?? {};\n\n return (\n <SingleSelectOption\n key={id}\n startIcon={\n <Flex\nLine truncated
@@ -0,0 +1,8 @@
'use strict';
const STAGE_ATTRIBUTE_NAME = 'strapi_stage';
const ASSIGNEE_ATTRIBUTE_NAME = 'strapi_assignee';
exports.ASSIGNEE_ATTRIBUTE_NAME = ASSIGNEE_ATTRIBUTE_NAME;
exports.STAGE_ATTRIBUTE_NAME = STAGE_ATTRIBUTE_NAME;
//# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
{"version":3,"file":"constants.js","sources":["../../../../../../../admin/src/routes/content-manager/model/id/components/constants.ts"],"sourcesContent":["export const STAGE_ATTRIBUTE_NAME = 'strapi_stage';\nexport const ASSIGNEE_ATTRIBUTE_NAME = 'strapi_assignee';\n"],"names":["STAGE_ATTRIBUTE_NAME","ASSIGNEE_ATTRIBUTE_NAME"],"mappings":";;AAAO,MAAMA,uBAAuB;AAC7B,MAAMC,0BAA0B;;;;;"}
@@ -0,0 +1,5 @@
const STAGE_ATTRIBUTE_NAME = 'strapi_stage';
const ASSIGNEE_ATTRIBUTE_NAME = 'strapi_assignee';
export { ASSIGNEE_ATTRIBUTE_NAME, STAGE_ATTRIBUTE_NAME };
//# sourceMappingURL=constants.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"constants.mjs","sources":["../../../../../../../admin/src/routes/content-manager/model/id/components/constants.ts"],"sourcesContent":["export const STAGE_ATTRIBUTE_NAME = 'strapi_stage';\nexport const ASSIGNEE_ATTRIBUTE_NAME = 'strapi_assignee';\n"],"names":["STAGE_ATTRIBUTE_NAME","ASSIGNEE_ATTRIBUTE_NAME"],"mappings":"AAAO,MAAMA,uBAAuB;AAC7B,MAAMC,0BAA0B;;;;"}
@@ -0,0 +1,194 @@
'use strict';
var jsxRuntime = require('react/jsx-runtime');
var strapiAdmin = require('@strapi/admin/strapi-admin');
var designSystem = require('@strapi/design-system');
var icons = require('@strapi/icons');
var reactIntl = require('react-intl');
var purchasePageIllustrationDark = require('../assets/purchase-page-illustration-dark.svg.js');
var purchasePageIllustrationLight = require('../assets/purchase-page-illustration-light.svg.js');
var hooks = require('../modules/hooks.js');
const PurchaseReviewWorkflows = ()=>{
const { formatMessage } = reactIntl.useIntl();
const currentTheme = hooks.useTypedSelector((state)=>state.admin_app.theme.currentTheme);
const illustration = currentTheme === 'light' ? purchasePageIllustrationLight : purchasePageIllustrationDark;
return /*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.Layouts.Root, {
children: /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Main, {
children: [
/*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.Layouts.Header, {
title: formatMessage({
id: 'Settings.review-workflows.list.page.title',
defaultMessage: 'Review Workflows'
})
}),
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Box, {
marginLeft: 10,
marginRight: 10,
shadow: "filterShadow",
hasRadius: true,
background: "neutral0",
borderColor: 'neutral150',
overflow: 'hidden',
children: /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Grid.Root, {
children: [
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Grid.Item, {
col: 6,
s: 12,
alignItems: 'flex-start',
children: /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Flex, {
direction: "column",
alignItems: "flex-start",
padding: 7,
width: '100%',
children: [
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Flex, {
children: /*#__PURE__*/ jsxRuntime.jsx(icons.SealCheck, {
fill: "primary600",
width: `24px`,
height: `24px`
})
}),
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Flex, {
paddingTop: 3,
paddingBottom: 4,
children: /*#__PURE__*/ jsxRuntime.jsx(designSystem.Typography, {
variant: "beta",
fontWeight: "bold",
children: formatMessage({
id: 'settings.page.purchase.description',
defaultMessage: 'Manage your content review process'
})
})
}),
/*#__PURE__*/ jsxRuntime.jsxs(designSystem.Flex, {
direction: "column",
alignItems: 'flex-start',
gap: 2,
children: [
/*#__PURE__*/ jsxRuntime.jsxs(designSystem.Flex, {
gap: 2,
children: [
/*#__PURE__*/ jsxRuntime.jsx(icons.Check, {
fill: "success500",
width: `16px`,
height: `16px`,
style: {
flexShrink: 0
}
}),
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Typography, {
textColor: "neutral700",
children: formatMessage({
id: 'settings.page.purchase.perks1',
defaultMessage: 'Customizable review stages'
})
})
]
}),
/*#__PURE__*/ jsxRuntime.jsxs(designSystem.Flex, {
gap: 2,
children: [
/*#__PURE__*/ jsxRuntime.jsx(icons.Check, {
fill: "success500",
width: `16px`,
height: `16px`,
style: {
flexShrink: 0
}
}),
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Typography, {
textColor: "neutral700",
children: formatMessage({
id: 'settings.page.purchase.perks2',
defaultMessage: 'Manage user permissions'
})
})
]
}),
/*#__PURE__*/ jsxRuntime.jsxs(designSystem.Flex, {
gap: 2,
children: [
/*#__PURE__*/ jsxRuntime.jsx(icons.Check, {
fill: "success500",
width: `16px`,
height: `16px`,
style: {
flexShrink: 0
}
}),
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Typography, {
textColor: "neutral700",
children: formatMessage({
id: 'settings.page.purchase.perks3',
defaultMessage: 'Support for webhooks'
})
})
]
})
]
}),
/*#__PURE__*/ jsxRuntime.jsxs(designSystem.Flex, {
gap: 2,
marginTop: 7,
children: [
/*#__PURE__*/ jsxRuntime.jsx(designSystem.LinkButton, {
variant: "default",
href: "https://strapi.io/pricing-self-hosted?utm_campaign=In-Product-CTA&utm_source=Review%20Workflows",
children: formatMessage({
id: 'Settings.page.purchase.upgrade.cta',
defaultMessage: 'Upgrade'
})
}),
/*#__PURE__*/ jsxRuntime.jsx(designSystem.LinkButton, {
variant: "tertiary",
endIcon: /*#__PURE__*/ jsxRuntime.jsx(icons.ExternalLink, {}),
href: "https://strapi.io/features/review-workflow?utm_campaign=In-Product-CTA&utm_source=Review%20Workflows",
children: formatMessage({
id: 'Settings.page.purchase.learn-more.cta',
defaultMessage: 'Learn more'
})
})
]
})
]
})
}),
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Grid.Item, {
col: 6,
s: 12,
background: "primary100",
minHeight: '280px',
children: /*#__PURE__*/ jsxRuntime.jsx("div", {
style: {
position: 'relative',
width: '100%',
height: '100%'
},
children: /*#__PURE__*/ jsxRuntime.jsx("img", {
src: illustration,
alt: "purchase-page-review-workflows-illustration",
width: "100%",
height: "100%",
style: {
position: 'absolute',
top: 0,
left: 0,
width: '100%',
height: '100%',
objectFit: 'cover',
objectPosition: 'bottom left'
}
})
})
})
]
})
})
]
})
});
};
exports.PurchaseReviewWorkflows = PurchaseReviewWorkflows;
//# sourceMappingURL=purchase-review-workflows.js.map
@@ -0,0 +1 @@
{"version":3,"file":"purchase-review-workflows.js","sources":["../../../admin/src/routes/purchase-review-workflows.tsx"],"sourcesContent":["import { Layouts } from '@strapi/admin/strapi-admin';\nimport { Box, Main, Flex, Typography, Grid, LinkButton } from '@strapi/design-system';\nimport { ExternalLink, Check, SealCheck } from '@strapi/icons';\nimport { useIntl } from 'react-intl';\n\nimport darkIllustration from '../assets/purchase-page-illustration-dark.svg';\nimport lightIllustration from '../assets/purchase-page-illustration-light.svg';\nimport { useTypedSelector } from '../modules/hooks';\n\nconst PurchaseReviewWorkflows = () => {\n const { formatMessage } = useIntl();\n const currentTheme = useTypedSelector((state) => state.admin_app.theme.currentTheme);\n\n const illustration = currentTheme === 'light' ? lightIllustration : darkIllustration;\n return (\n <Layouts.Root>\n <Main>\n <Layouts.Header\n title={formatMessage({\n id: 'Settings.review-workflows.list.page.title',\n defaultMessage: 'Review Workflows',\n })}\n />\n <Box\n marginLeft={10}\n marginRight={10}\n shadow=\"filterShadow\"\n hasRadius\n background=\"neutral0\"\n borderColor={'neutral150'}\n overflow={'hidden'}\n >\n <Grid.Root>\n <Grid.Item col={6} s={12} alignItems={'flex-start'}>\n <Flex direction=\"column\" alignItems=\"flex-start\" padding={7} width={'100%'}>\n <Flex>\n <SealCheck fill=\"primary600\" width={`24px`} height={`24px`} />\n </Flex>\n <Flex paddingTop={3} paddingBottom={4}>\n <Typography variant=\"beta\" fontWeight=\"bold\">\n {formatMessage({\n id: 'settings.page.purchase.description',\n defaultMessage: 'Manage your content review process',\n })}\n </Typography>\n </Flex>\n\n <Flex direction=\"column\" alignItems={'flex-start'} gap={2}>\n <Flex gap={2}>\n <Check\n fill=\"success500\"\n width={`16px`}\n height={`16px`}\n style={{ flexShrink: 0 }}\n />\n <Typography textColor=\"neutral700\">\n {formatMessage({\n id: 'settings.page.purchase.perks1',\n defaultMessage: 'Customizable review stages',\n })}\n </Typography>\n </Flex>\n\n <Flex gap={2}>\n <Check\n fill=\"success500\"\n width={`16px`}\n height={`16px`}\n style={{ flexShrink: 0 }}\n />\n <Typography textColor=\"neutral700\">\n {formatMessage({\n id: 'settings.page.purchase.perks2',\n defaultMessage: 'Manage user permissions',\n })}\n </Typography>\n </Flex>\n\n <Flex gap={2}>\n <Check\n fill=\"success500\"\n width={`16px`}\n height={`16px`}\n style={{ flexShrink: 0 }}\n />\n <Typography textColor=\"neutral700\">\n {formatMessage({\n id: 'settings.page.purchase.perks3',\n defaultMessage: 'Support for webhooks',\n })}\n </Typography>\n </Flex>\n </Flex>\n\n <Flex gap={2} marginTop={7}>\n <LinkButton\n variant=\"default\"\n href=\"https://strapi.io/pricing-self-hosted?utm_campaign=In-Product-CTA&utm_source=Review%20Workflows\"\n >\n {formatMessage({\n id: 'Settings.page.purchase.upgrade.cta',\n defaultMessage: 'Upgrade',\n })}\n </LinkButton>\n <LinkButton\n variant=\"tertiary\"\n endIcon={<ExternalLink />}\n href=\"https://strapi.io/features/review-workflow?utm_campaign=In-Product-CTA&utm_source=Review%20Workflows\"\n >\n {formatMessage({\n id: 'Settings.page.purchase.learn-more.cta',\n defaultMessage: 'Learn more',\n })}\n </LinkButton>\n </Flex>\n </Flex>\n </Grid.Item>\n <Grid.Item col={6} s={12} background=\"primary100\" minHeighLine truncated
@@ -0,0 +1,192 @@
import { jsx, jsxs } from 'react/jsx-runtime';
import { Layouts } from '@strapi/admin/strapi-admin';
import { Main, Box, Grid, Flex, Typography, LinkButton } from '@strapi/design-system';
import { SealCheck, Check, ExternalLink } from '@strapi/icons';
import { useIntl } from 'react-intl';
import img$1 from '../assets/purchase-page-illustration-dark.svg.mjs';
import img from '../assets/purchase-page-illustration-light.svg.mjs';
import { useTypedSelector } from '../modules/hooks.mjs';
const PurchaseReviewWorkflows = ()=>{
const { formatMessage } = useIntl();
const currentTheme = useTypedSelector((state)=>state.admin_app.theme.currentTheme);
const illustration = currentTheme === 'light' ? img : img$1;
return /*#__PURE__*/ jsx(Layouts.Root, {
children: /*#__PURE__*/ jsxs(Main, {
children: [
/*#__PURE__*/ jsx(Layouts.Header, {
title: formatMessage({
id: 'Settings.review-workflows.list.page.title',
defaultMessage: 'Review Workflows'
})
}),
/*#__PURE__*/ jsx(Box, {
marginLeft: 10,
marginRight: 10,
shadow: "filterShadow",
hasRadius: true,
background: "neutral0",
borderColor: 'neutral150',
overflow: 'hidden',
children: /*#__PURE__*/ jsxs(Grid.Root, {
children: [
/*#__PURE__*/ jsx(Grid.Item, {
col: 6,
s: 12,
alignItems: 'flex-start',
children: /*#__PURE__*/ jsxs(Flex, {
direction: "column",
alignItems: "flex-start",
padding: 7,
width: '100%',
children: [
/*#__PURE__*/ jsx(Flex, {
children: /*#__PURE__*/ jsx(SealCheck, {
fill: "primary600",
width: `24px`,
height: `24px`
})
}),
/*#__PURE__*/ jsx(Flex, {
paddingTop: 3,
paddingBottom: 4,
children: /*#__PURE__*/ jsx(Typography, {
variant: "beta",
fontWeight: "bold",
children: formatMessage({
id: 'settings.page.purchase.description',
defaultMessage: 'Manage your content review process'
})
})
}),
/*#__PURE__*/ jsxs(Flex, {
direction: "column",
alignItems: 'flex-start',
gap: 2,
children: [
/*#__PURE__*/ jsxs(Flex, {
gap: 2,
children: [
/*#__PURE__*/ jsx(Check, {
fill: "success500",
width: `16px`,
height: `16px`,
style: {
flexShrink: 0
}
}),
/*#__PURE__*/ jsx(Typography, {
textColor: "neutral700",
children: formatMessage({
id: 'settings.page.purchase.perks1',
defaultMessage: 'Customizable review stages'
})
})
]
}),
/*#__PURE__*/ jsxs(Flex, {
gap: 2,
children: [
/*#__PURE__*/ jsx(Check, {
fill: "success500",
width: `16px`,
height: `16px`,
style: {
flexShrink: 0
}
}),
/*#__PURE__*/ jsx(Typography, {
textColor: "neutral700",
children: formatMessage({
id: 'settings.page.purchase.perks2',
defaultMessage: 'Manage user permissions'
})
})
]
}),
/*#__PURE__*/ jsxs(Flex, {
gap: 2,
children: [
/*#__PURE__*/ jsx(Check, {
fill: "success500",
width: `16px`,
height: `16px`,
style: {
flexShrink: 0
}
}),
/*#__PURE__*/ jsx(Typography, {
textColor: "neutral700",
children: formatMessage({
id: 'settings.page.purchase.perks3',
defaultMessage: 'Support for webhooks'
})
})
]
})
]
}),
/*#__PURE__*/ jsxs(Flex, {
gap: 2,
marginTop: 7,
children: [
/*#__PURE__*/ jsx(LinkButton, {
variant: "default",
href: "https://strapi.io/pricing-self-hosted?utm_campaign=In-Product-CTA&utm_source=Review%20Workflows",
children: formatMessage({
id: 'Settings.page.purchase.upgrade.cta',
defaultMessage: 'Upgrade'
})
}),
/*#__PURE__*/ jsx(LinkButton, {
variant: "tertiary",
endIcon: /*#__PURE__*/ jsx(ExternalLink, {}),
href: "https://strapi.io/features/review-workflow?utm_campaign=In-Product-CTA&utm_source=Review%20Workflows",
children: formatMessage({
id: 'Settings.page.purchase.learn-more.cta',
defaultMessage: 'Learn more'
})
})
]
})
]
})
}),
/*#__PURE__*/ jsx(Grid.Item, {
col: 6,
s: 12,
background: "primary100",
minHeight: '280px',
children: /*#__PURE__*/ jsx("div", {
style: {
position: 'relative',
width: '100%',
height: '100%'
},
children: /*#__PURE__*/ jsx("img", {
src: illustration,
alt: "purchase-page-review-workflows-illustration",
width: "100%",
height: "100%",
style: {
position: 'absolute',
top: 0,
left: 0,
width: '100%',
height: '100%',
objectFit: 'cover',
objectPosition: 'bottom left'
}
})
})
})
]
})
})
]
})
});
};
export { PurchaseReviewWorkflows };
//# sourceMappingURL=purchase-review-workflows.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"purchase-review-workflows.mjs","sources":["../../../admin/src/routes/purchase-review-workflows.tsx"],"sourcesContent":["import { Layouts } from '@strapi/admin/strapi-admin';\nimport { Box, Main, Flex, Typography, Grid, LinkButton } from '@strapi/design-system';\nimport { ExternalLink, Check, SealCheck } from '@strapi/icons';\nimport { useIntl } from 'react-intl';\n\nimport darkIllustration from '../assets/purchase-page-illustration-dark.svg';\nimport lightIllustration from '../assets/purchase-page-illustration-light.svg';\nimport { useTypedSelector } from '../modules/hooks';\n\nconst PurchaseReviewWorkflows = () => {\n const { formatMessage } = useIntl();\n const currentTheme = useTypedSelector((state) => state.admin_app.theme.currentTheme);\n\n const illustration = currentTheme === 'light' ? lightIllustration : darkIllustration;\n return (\n <Layouts.Root>\n <Main>\n <Layouts.Header\n title={formatMessage({\n id: 'Settings.review-workflows.list.page.title',\n defaultMessage: 'Review Workflows',\n })}\n />\n <Box\n marginLeft={10}\n marginRight={10}\n shadow=\"filterShadow\"\n hasRadius\n background=\"neutral0\"\n borderColor={'neutral150'}\n overflow={'hidden'}\n >\n <Grid.Root>\n <Grid.Item col={6} s={12} alignItems={'flex-start'}>\n <Flex direction=\"column\" alignItems=\"flex-start\" padding={7} width={'100%'}>\n <Flex>\n <SealCheck fill=\"primary600\" width={`24px`} height={`24px`} />\n </Flex>\n <Flex paddingTop={3} paddingBottom={4}>\n <Typography variant=\"beta\" fontWeight=\"bold\">\n {formatMessage({\n id: 'settings.page.purchase.description',\n defaultMessage: 'Manage your content review process',\n })}\n </Typography>\n </Flex>\n\n <Flex direction=\"column\" alignItems={'flex-start'} gap={2}>\n <Flex gap={2}>\n <Check\n fill=\"success500\"\n width={`16px`}\n height={`16px`}\n style={{ flexShrink: 0 }}\n />\n <Typography textColor=\"neutral700\">\n {formatMessage({\n id: 'settings.page.purchase.perks1',\n defaultMessage: 'Customizable review stages',\n })}\n </Typography>\n </Flex>\n\n <Flex gap={2}>\n <Check\n fill=\"success500\"\n width={`16px`}\n height={`16px`}\n style={{ flexShrink: 0 }}\n />\n <Typography textColor=\"neutral700\">\n {formatMessage({\n id: 'settings.page.purchase.perks2',\n defaultMessage: 'Manage user permissions',\n })}\n </Typography>\n </Flex>\n\n <Flex gap={2}>\n <Check\n fill=\"success500\"\n width={`16px`}\n height={`16px`}\n style={{ flexShrink: 0 }}\n />\n <Typography textColor=\"neutral700\">\n {formatMessage({\n id: 'settings.page.purchase.perks3',\n defaultMessage: 'Support for webhooks',\n })}\n </Typography>\n </Flex>\n </Flex>\n\n <Flex gap={2} marginTop={7}>\n <LinkButton\n variant=\"default\"\n href=\"https://strapi.io/pricing-self-hosted?utm_campaign=In-Product-CTA&utm_source=Review%20Workflows\"\n >\n {formatMessage({\n id: 'Settings.page.purchase.upgrade.cta',\n defaultMessage: 'Upgrade',\n })}\n </LinkButton>\n <LinkButton\n variant=\"tertiary\"\n endIcon={<ExternalLink />}\n href=\"https://strapi.io/features/review-workflow?utm_campaign=In-Product-CTA&utm_source=Review%20Workflows\"\n >\n {formatMessage({\n id: 'Settings.page.purchase.learn-more.cta',\n defaultMessage: 'Learn more',\n })}\n </LinkButton>\n </Flex>\n </Flex>\n </Grid.Item>\n <Grid.Item col={6} s={12} background=\"primary100\" minHeigLine truncated
@@ -0,0 +1,51 @@
'use strict';
var jsxRuntime = require('react/jsx-runtime');
var designSystem = require('@strapi/design-system');
var icons = require('@strapi/icons');
var styledComponents = require('styled-components');
const AddStage = ({ children, ...props })=>{
return /*#__PURE__*/ jsxRuntime.jsx(StyledButton, {
tag: "button",
background: "neutral0",
borderColor: "neutral150",
paddingBottom: 3,
paddingLeft: 4,
paddingRight: 4,
paddingTop: 3,
shadow: "filterShadow",
...props,
children: /*#__PURE__*/ jsxRuntime.jsx(designSystem.Typography, {
variant: "pi",
fontWeight: "bold",
children: /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Flex, {
tag: "span",
gap: 2,
children: [
/*#__PURE__*/ jsxRuntime.jsx(icons.PlusCircle, {
width: "2.4rem",
height: "2.4rem",
"aria-hidden": true
}),
children
]
})
})
});
};
const StyledButton = styledComponents.styled(designSystem.Box)`
border-radius: 26px;
color: ${({ theme })=>theme.colors.neutral500};
&:hover {
color: ${({ theme })=>theme.colors.primary600};
}
&:active {
color: ${({ theme })=>theme.colors.primary600};
}
`;
exports.AddStage = AddStage;
//# sourceMappingURL=AddStage.js.map
@@ -0,0 +1 @@
{"version":3,"file":"AddStage.js","sources":["../../../../../admin/src/routes/settings/components/AddStage.tsx"],"sourcesContent":["import { Box, BoxComponent, ButtonProps, Flex, Typography } from '@strapi/design-system';\nimport { PlusCircle } from '@strapi/icons';\nimport { styled } from 'styled-components';\n\nexport const AddStage = ({ children, ...props }: ButtonProps) => {\n return (\n <StyledButton\n tag=\"button\"\n background=\"neutral0\"\n borderColor=\"neutral150\"\n paddingBottom={3}\n paddingLeft={4}\n paddingRight={4}\n paddingTop={3}\n shadow=\"filterShadow\"\n {...props}\n >\n <Typography variant=\"pi\" fontWeight=\"bold\">\n <Flex tag=\"span\" gap={2}>\n <PlusCircle width=\"2.4rem\" height=\"2.4rem\" aria-hidden />\n {children}\n </Flex>\n </Typography>\n </StyledButton>\n );\n};\n\nconst StyledButton = styled<BoxComponent<'button'>>(Box)`\n border-radius: 26px;\n color: ${({ theme }) => theme.colors.neutral500};\n\n &:hover {\n color: ${({ theme }) => theme.colors.primary600};\n }\n\n &:active {\n color: ${({ theme }) => theme.colors.primary600};\n }\n`;\n"],"names":["AddStage","children","props","_jsx","StyledButton","tag","background","borderColor","paddingBottom","paddingLeft","paddingRight","paddingTop","shadow","Typography","variant","fontWeight","_jsxs","Flex","gap","PlusCircle","width","height","aria-hidden","styled","Box","theme","colors","neutral500","primary600"],"mappings":";;;;;;;MAIaA,QAAW,GAAA,CAAC,EAAEC,QAAQ,EAAE,GAAGC,KAAoB,EAAA,GAAA;AAC1D,IAAA,qBACEC,cAACC,CAAAA,YAAAA,EAAAA;QACCC,GAAI,EAAA,QAAA;QACJC,UAAW,EAAA,UAAA;QACXC,WAAY,EAAA,YAAA;QACZC,aAAe,EAAA,CAAA;QACfC,WAAa,EAAA,CAAA;QACbC,YAAc,EAAA,CAAA;QACdC,UAAY,EAAA,CAAA;QACZC,MAAO,EAAA,cAAA;AACN,QAAA,GAAGV,KAAK;AAET,QAAA,QAAA,gBAAAC,cAACU,CAAAA,uBAAAA,EAAAA;YAAWC,OAAQ,EAAA,IAAA;YAAKC,UAAW,EAAA,MAAA;AAClC,YAAA,QAAA,gBAAAC,eAACC,CAAAA,iBAAAA,EAAAA;gBAAKZ,GAAI,EAAA,MAAA;gBAAOa,GAAK,EAAA,CAAA;;kCACpBf,cAACgB,CAAAA,gBAAAA,EAAAA;wBAAWC,KAAM,EAAA,QAAA;wBAASC,MAAO,EAAA,QAAA;wBAASC,aAAW,EAAA;;AACrDrB,oBAAAA;;;;;AAKX;AAEA,MAAMG,YAAAA,GAAemB,uBAA+BC,CAAAA,gBAAAA,CAAI;;SAE/C,EAAE,CAAC,EAAEC,KAAK,EAAE,GAAKA,KAAMC,CAAAA,MAAM,CAACC,UAAU,CAAC;;;WAGvC,EAAE,CAAC,EAAEF,KAAK,EAAE,GAAKA,KAAMC,CAAAA,MAAM,CAACE,UAAU,CAAC;;;;WAIzC,EAAE,CAAC,EAAEH,KAAK,EAAE,GAAKA,KAAMC,CAAAA,MAAM,CAACE,UAAU,CAAC;;AAEpD,CAAC;;;;"}
@@ -0,0 +1,49 @@
import { jsx, jsxs } from 'react/jsx-runtime';
import { Box, Typography, Flex } from '@strapi/design-system';
import { PlusCircle } from '@strapi/icons';
import { styled } from 'styled-components';
const AddStage = ({ children, ...props })=>{
return /*#__PURE__*/ jsx(StyledButton, {
tag: "button",
background: "neutral0",
borderColor: "neutral150",
paddingBottom: 3,
paddingLeft: 4,
paddingRight: 4,
paddingTop: 3,
shadow: "filterShadow",
...props,
children: /*#__PURE__*/ jsx(Typography, {
variant: "pi",
fontWeight: "bold",
children: /*#__PURE__*/ jsxs(Flex, {
tag: "span",
gap: 2,
children: [
/*#__PURE__*/ jsx(PlusCircle, {
width: "2.4rem",
height: "2.4rem",
"aria-hidden": true
}),
children
]
})
})
});
};
const StyledButton = styled(Box)`
border-radius: 26px;
color: ${({ theme })=>theme.colors.neutral500};
&:hover {
color: ${({ theme })=>theme.colors.primary600};
}
&:active {
color: ${({ theme })=>theme.colors.primary600};
}
`;
export { AddStage };
//# sourceMappingURL=AddStage.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"AddStage.mjs","sources":["../../../../../admin/src/routes/settings/components/AddStage.tsx"],"sourcesContent":["import { Box, BoxComponent, ButtonProps, Flex, Typography } from '@strapi/design-system';\nimport { PlusCircle } from '@strapi/icons';\nimport { styled } from 'styled-components';\n\nexport const AddStage = ({ children, ...props }: ButtonProps) => {\n return (\n <StyledButton\n tag=\"button\"\n background=\"neutral0\"\n borderColor=\"neutral150\"\n paddingBottom={3}\n paddingLeft={4}\n paddingRight={4}\n paddingTop={3}\n shadow=\"filterShadow\"\n {...props}\n >\n <Typography variant=\"pi\" fontWeight=\"bold\">\n <Flex tag=\"span\" gap={2}>\n <PlusCircle width=\"2.4rem\" height=\"2.4rem\" aria-hidden />\n {children}\n </Flex>\n </Typography>\n </StyledButton>\n );\n};\n\nconst StyledButton = styled<BoxComponent<'button'>>(Box)`\n border-radius: 26px;\n color: ${({ theme }) => theme.colors.neutral500};\n\n &:hover {\n color: ${({ theme }) => theme.colors.primary600};\n }\n\n &:active {\n color: ${({ theme }) => theme.colors.primary600};\n }\n`;\n"],"names":["AddStage","children","props","_jsx","StyledButton","tag","background","borderColor","paddingBottom","paddingLeft","paddingRight","paddingTop","shadow","Typography","variant","fontWeight","_jsxs","Flex","gap","PlusCircle","width","height","aria-hidden","styled","Box","theme","colors","neutral500","primary600"],"mappings":";;;;;MAIaA,QAAW,GAAA,CAAC,EAAEC,QAAQ,EAAE,GAAGC,KAAoB,EAAA,GAAA;AAC1D,IAAA,qBACEC,GAACC,CAAAA,YAAAA,EAAAA;QACCC,GAAI,EAAA,QAAA;QACJC,UAAW,EAAA,UAAA;QACXC,WAAY,EAAA,YAAA;QACZC,aAAe,EAAA,CAAA;QACfC,WAAa,EAAA,CAAA;QACbC,YAAc,EAAA,CAAA;QACdC,UAAY,EAAA,CAAA;QACZC,MAAO,EAAA,cAAA;AACN,QAAA,GAAGV,KAAK;AAET,QAAA,QAAA,gBAAAC,GAACU,CAAAA,UAAAA,EAAAA;YAAWC,OAAQ,EAAA,IAAA;YAAKC,UAAW,EAAA,MAAA;AAClC,YAAA,QAAA,gBAAAC,IAACC,CAAAA,IAAAA,EAAAA;gBAAKZ,GAAI,EAAA,MAAA;gBAAOa,GAAK,EAAA,CAAA;;kCACpBf,GAACgB,CAAAA,UAAAA,EAAAA;wBAAWC,KAAM,EAAA,QAAA;wBAASC,MAAO,EAAA,QAAA;wBAASC,aAAW,EAAA;;AACrDrB,oBAAAA;;;;;AAKX;AAEA,MAAMG,YAAAA,GAAemB,MAA+BC,CAAAA,GAAAA,CAAI;;SAE/C,EAAE,CAAC,EAAEC,KAAK,EAAE,GAAKA,KAAMC,CAAAA,MAAM,CAACC,UAAU,CAAC;;;WAGvC,EAAE,CAAC,EAAEF,KAAK,EAAE,GAAKA,KAAMC,CAAAA,MAAM,CAACE,UAAU,CAAC;;;;WAIzC,EAAE,CAAC,EAAEH,KAAK,EAAE,GAAKA,KAAMC,CAAAA,MAAM,CAACE,UAAU,CAAC;;AAEpD,CAAC;;;;"}
@@ -0,0 +1,86 @@
'use strict';
var jsxRuntime = require('react/jsx-runtime');
require('react');
var strapiAdmin = require('@strapi/admin/strapi-admin');
var designSystem = require('@strapi/design-system');
var reactDnd = require('react-dnd');
var reactIntl = require('react-intl');
var constants = require('../constants.js');
var StageDragPreview = require('./StageDragPreview.js');
function getStyle(initialOffset, currentOffset, mouseOffset) {
if (!initialOffset || !currentOffset || !mouseOffset) {
return {
display: 'none'
};
}
const { x, y } = mouseOffset;
return {
transform: `translate(${x}px, ${y}px)`
};
}
const DragLayerRendered = ()=>{
const { itemType, isDragging, item, initialOffset, currentOffset, mouseOffset } = reactDnd.useDragLayer((monitor)=>({
item: monitor.getItem(),
itemType: monitor.getItemType(),
initialOffset: monitor.getInitialSourceClientOffset(),
currentOffset: monitor.getSourceClientOffset(),
isDragging: monitor.isDragging(),
mouseOffset: monitor.getClientOffset()
}));
if (!isDragging || itemType !== constants.DRAG_DROP_TYPES.STAGE) {
return null;
}
return /*#__PURE__*/ jsxRuntime.jsx(designSystem.Box, {
height: "100%",
left: 0,
position: "fixed",
pointerEvents: "none",
top: 0,
zIndex: 100,
width: "100%",
children: /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Box, {
style: getStyle(initialOffset, currentOffset, mouseOffset),
children: [
/*#__PURE__*/ jsxRuntime.jsx(StageDragPreview.StageDragPreview, {
name: typeof item.item === 'string' ? item.item : null
}),
";"
]
})
});
};
const Root = ({ children })=>{
return /*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.Page.Main, {
children: /*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.Layouts.Content, {
children: children
})
});
};
const Header = ({ title, subtitle, navigationAction, primaryAction })=>{
const { formatMessage } = reactIntl.useIntl();
return /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
children: [
/*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.Page.Title, {
children: formatMessage({
id: 'Settings.PageTitle',
defaultMessage: 'Settings - {name}'
}, {
name: title
})
}),
/*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.Layouts.BaseHeader, {
navigationAction: navigationAction,
primaryAction: primaryAction,
title: title,
subtitle: subtitle
})
]
});
};
exports.DragLayerRendered = DragLayerRendered;
exports.Header = Header;
exports.Root = Root;
//# sourceMappingURL=Layout.js.map
@@ -0,0 +1 @@
{"version":3,"file":"Layout.js","sources":["../../../../../admin/src/routes/settings/components/Layout.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { Page, Layouts } from '@strapi/admin/strapi-admin';\nimport { Box } from '@strapi/design-system';\nimport { XYCoord, useDragLayer } from 'react-dnd';\nimport { useIntl } from 'react-intl';\n\nimport { DRAG_DROP_TYPES } from '../constants';\n\nimport { StageDragPreview } from './StageDragPreview';\n\nfunction getStyle(\n initialOffset: XYCoord | null,\n currentOffset: XYCoord | null,\n mouseOffset: XYCoord | null\n) {\n if (!initialOffset || !currentOffset || !mouseOffset) {\n return { display: 'none' };\n }\n\n const { x, y } = mouseOffset;\n\n return {\n transform: `translate(${x}px, ${y}px)`,\n };\n}\n\nconst DragLayerRendered = () => {\n const { itemType, isDragging, item, initialOffset, currentOffset, mouseOffset } = useDragLayer(\n (monitor) => ({\n item: monitor.getItem(),\n itemType: monitor.getItemType(),\n initialOffset: monitor.getInitialSourceClientOffset(),\n currentOffset: monitor.getSourceClientOffset(),\n isDragging: monitor.isDragging(),\n mouseOffset: monitor.getClientOffset(),\n })\n );\n\n if (!isDragging || itemType !== DRAG_DROP_TYPES.STAGE) {\n return null;\n }\n\n return (\n <Box\n height=\"100%\"\n left={0}\n position=\"fixed\"\n pointerEvents=\"none\"\n top={0}\n zIndex={100}\n width=\"100%\"\n >\n <Box style={getStyle(initialOffset, currentOffset, mouseOffset)}>\n <StageDragPreview name={typeof item.item === 'string' ? item.item : null} />;\n </Box>\n </Box>\n );\n};\n\nconst Root: React.FC<React.PropsWithChildren> = ({ children }) => {\n return (\n <Page.Main>\n <Layouts.Content>{children}</Layouts.Content>\n </Page.Main>\n );\n};\n\ninterface HeaderProps {\n title: string;\n navigationAction?: React.ReactNode;\n primaryAction?: React.ReactNode;\n secondaryAction?: React.ReactNode;\n subtitle?: React.ReactNode;\n}\n\nconst Header: React.FC<HeaderProps> = ({ title, subtitle, navigationAction, primaryAction }) => {\n const { formatMessage } = useIntl();\n return (\n <>\n <Page.Title>\n {formatMessage(\n { id: 'Settings.PageTitle', defaultMessage: 'Settings - {name}' },\n {\n name: title,\n }\n )}\n </Page.Title>\n <Layouts.BaseHeader\n navigationAction={navigationAction}\n primaryAction={primaryAction}\n title={title}\n subtitle={subtitle}\n />\n </>\n );\n};\n\nexport { DragLayerRendered, Header, Root };\n"],"names":["getStyle","initialOffset","currentOffset","mouseOffset","display","x","y","transform","DragLayerRendered","itemType","isDragging","item","useDragLayer","monitor","getItem","getItemType","getInitialSourceClientOffset","getSourceClientOffset","getClientOffset","DRAG_DROP_TYPES","STAGE","_jsx","Box","height","left","position","pointerEvents","top","zIndex","width","_jsxs","style","StageDragPreview","name","Root","children","Page","Main","Layouts","Content","Header","title","subtitle","navigationAction","primaryAction","formatMessage","useIntl","_Fragment","Title","id","defaultMessage","BaseHeader"],"mappings":";;;;;;;;;;;AAWA,SAASA,QACPC,CAAAA,aAA6B,EAC7BC,aAA6B,EAC7BC,WAA2B,EAAA;AAE3B,IAAA,IAAI,CAACF,aAAAA,IAAiB,CAACC,aAAAA,IAAiB,CAACC,WAAa,EAAA;QACpD,OAAO;YAAEC,OAAS,EAAA;AAAO,SAAA;AAC3B;AAEA,IAAA,MAAM,EAAEC,CAAC,EAAEC,CAAC,EAAE,GAAGH,WAAAA;IAEjB,OAAO;QACLI,SAAW,EAAA,CAAC,UAAU,EAAEF,CAAAA,CAAE,IAAI,EAAEC,CAAAA,CAAE,GAAG;AACvC,KAAA;AACF;AAEA,MAAME,iBAAoB,GAAA,IAAA;AACxB,IAAA,MAAM,EAAEC,QAAQ,EAAEC,UAAU,EAAEC,IAAI,EAAEV,aAAa,EAAEC,aAAa,E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EAAEC,gBAAgB,EAAEC,aAAa,EAAE,GAAA;IACzF,MAAM,EAAEC,aAAa,EAAE,GAAGC,iBAAAA,EAAAA;IAC1B,qBACEhB,eAAA,CAAAiB,mBAAA,EAAA;;AACE,0BAAA1B,cAAA,CAACe,iBAAKY,KAAK,EAAA;0BACRH,aACC,CAAA;oBAAEI,EAAI,EAAA,oBAAA;oBAAsLine truncated
@@ -0,0 +1,82 @@
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
import 'react';
import { Page, Layouts } from '@strapi/admin/strapi-admin';
import { Box } from '@strapi/design-system';
import { useDragLayer } from 'react-dnd';
import { useIntl } from 'react-intl';
import { DRAG_DROP_TYPES } from '../constants.mjs';
import { StageDragPreview } from './StageDragPreview.mjs';
function getStyle(initialOffset, currentOffset, mouseOffset) {
if (!initialOffset || !currentOffset || !mouseOffset) {
return {
display: 'none'
};
}
const { x, y } = mouseOffset;
return {
transform: `translate(${x}px, ${y}px)`
};
}
const DragLayerRendered = ()=>{
const { itemType, isDragging, item, initialOffset, currentOffset, mouseOffset } = useDragLayer((monitor)=>({
item: monitor.getItem(),
itemType: monitor.getItemType(),
initialOffset: monitor.getInitialSourceClientOffset(),
currentOffset: monitor.getSourceClientOffset(),
isDragging: monitor.isDragging(),
mouseOffset: monitor.getClientOffset()
}));
if (!isDragging || itemType !== DRAG_DROP_TYPES.STAGE) {
return null;
}
return /*#__PURE__*/ jsx(Box, {
height: "100%",
left: 0,
position: "fixed",
pointerEvents: "none",
top: 0,
zIndex: 100,
width: "100%",
children: /*#__PURE__*/ jsxs(Box, {
style: getStyle(initialOffset, currentOffset, mouseOffset),
children: [
/*#__PURE__*/ jsx(StageDragPreview, {
name: typeof item.item === 'string' ? item.item : null
}),
";"
]
})
});
};
const Root = ({ children })=>{
return /*#__PURE__*/ jsx(Page.Main, {
children: /*#__PURE__*/ jsx(Layouts.Content, {
children: children
})
});
};
const Header = ({ title, subtitle, navigationAction, primaryAction })=>{
const { formatMessage } = useIntl();
return /*#__PURE__*/ jsxs(Fragment, {
children: [
/*#__PURE__*/ jsx(Page.Title, {
children: formatMessage({
id: 'Settings.PageTitle',
defaultMessage: 'Settings - {name}'
}, {
name: title
})
}),
/*#__PURE__*/ jsx(Layouts.BaseHeader, {
navigationAction: navigationAction,
primaryAction: primaryAction,
title: title,
subtitle: subtitle
})
]
});
};
export { DragLayerRendered, Header, Root };
//# sourceMappingURL=Layout.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"Layout.mjs","sources":["../../../../../admin/src/routes/settings/components/Layout.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { Page, Layouts } from '@strapi/admin/strapi-admin';\nimport { Box } from '@strapi/design-system';\nimport { XYCoord, useDragLayer } from 'react-dnd';\nimport { useIntl } from 'react-intl';\n\nimport { DRAG_DROP_TYPES } from '../constants';\n\nimport { StageDragPreview } from './StageDragPreview';\n\nfunction getStyle(\n initialOffset: XYCoord | null,\n currentOffset: XYCoord | null,\n mouseOffset: XYCoord | null\n) {\n if (!initialOffset || !currentOffset || !mouseOffset) {\n return { display: 'none' };\n }\n\n const { x, y } = mouseOffset;\n\n return {\n transform: `translate(${x}px, ${y}px)`,\n };\n}\n\nconst DragLayerRendered = () => {\n const { itemType, isDragging, item, initialOffset, currentOffset, mouseOffset } = useDragLayer(\n (monitor) => ({\n item: monitor.getItem(),\n itemType: monitor.getItemType(),\n initialOffset: monitor.getInitialSourceClientOffset(),\n currentOffset: monitor.getSourceClientOffset(),\n isDragging: monitor.isDragging(),\n mouseOffset: monitor.getClientOffset(),\n })\n );\n\n if (!isDragging || itemType !== DRAG_DROP_TYPES.STAGE) {\n return null;\n }\n\n return (\n <Box\n height=\"100%\"\n left={0}\n position=\"fixed\"\n pointerEvents=\"none\"\n top={0}\n zIndex={100}\n width=\"100%\"\n >\n <Box style={getStyle(initialOffset, currentOffset, mouseOffset)}>\n <StageDragPreview name={typeof item.item === 'string' ? item.item : null} />;\n </Box>\n </Box>\n );\n};\n\nconst Root: React.FC<React.PropsWithChildren> = ({ children }) => {\n return (\n <Page.Main>\n <Layouts.Content>{children}</Layouts.Content>\n </Page.Main>\n );\n};\n\ninterface HeaderProps {\n title: string;\n navigationAction?: React.ReactNode;\n primaryAction?: React.ReactNode;\n secondaryAction?: React.ReactNode;\n subtitle?: React.ReactNode;\n}\n\nconst Header: React.FC<HeaderProps> = ({ title, subtitle, navigationAction, primaryAction }) => {\n const { formatMessage } = useIntl();\n return (\n <>\n <Page.Title>\n {formatMessage(\n { id: 'Settings.PageTitle', defaultMessage: 'Settings - {name}' },\n {\n name: title,\n }\n )}\n </Page.Title>\n <Layouts.BaseHeader\n navigationAction={navigationAction}\n primaryAction={primaryAction}\n title={title}\n subtitle={subtitle}\n />\n </>\n );\n};\n\nexport { DragLayerRendered, Header, Root };\n"],"names":["getStyle","initialOffset","currentOffset","mouseOffset","display","x","y","transform","DragLayerRendered","itemType","isDragging","item","useDragLayer","monitor","getItem","getItemType","getInitialSourceClientOffset","getSourceClientOffset","getClientOffset","DRAG_DROP_TYPES","STAGE","_jsx","Box","height","left","position","pointerEvents","top","zIndex","width","_jsxs","style","StageDragPreview","name","Root","children","Page","Main","Layouts","Content","Header","title","subtitle","navigationAction","primaryAction","formatMessage","useIntl","_Fragment","Title","id","defaultMessage","BaseHeader"],"mappings":";;;;;;;;;AAWA,SAASA,QACPC,CAAAA,aAA6B,EAC7BC,aAA6B,EAC7BC,WAA2B,EAAA;AAE3B,IAAA,IAAI,CAACF,aAAAA,IAAiB,CAACC,aAAAA,IAAiB,CAACC,WAAa,EAAA;QACpD,OAAO;YAAEC,OAAS,EAAA;AAAO,SAAA;AAC3B;AAEA,IAAA,MAAM,EAAEC,CAAC,EAAEC,CAAC,EAAE,GAAGH,WAAAA;IAEjB,OAAO;QACLI,SAAW,EAAA,CAAC,UAAU,EAAEF,CAAAA,CAAE,IAAI,EAAEC,CAAAA,CAAE,GAAG;AACvC,KAAA;AACF;AAEA,MAAME,iBAAoB,GAAA,IAAA;AACxB,IAAA,M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xB;AAUMK,MAAAA,MAAAA,GAAgC,CAAC,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,gBAAgB,EAAEC,aAAa,EAAE,GAAA;IACzF,MAAM,EAAEC,aAAa,EAAE,GAAGC,OAAAA,EAAAA;IAC1B,qBACEhB,IAAA,CAAAiB,QAAA,EAAA;;AACE,0BAAA1B,GAAA,CAACe,KAAKY,KAAK,EAAA;0BACRH,aACC,CAAA;oBAAEI,EAAI,EAAA,oBAAA;oBAAsBC,cAAgB,ELine truncated
@@ -0,0 +1,40 @@
'use strict';
var jsxRuntime = require('react/jsx-runtime');
var designSystem = require('@strapi/design-system');
var icons = require('@strapi/icons');
const StageDragPreview = ({ name })=>{
return /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Flex, {
background: "primary100",
borderStyle: "dashed",
borderColor: "primary600",
borderWidth: "1px",
gap: 3,
hasRadius: true,
padding: 3,
shadow: "tableShadow",
width: "30rem",
children: [
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Flex, {
alignItems: "center",
background: "neutral200",
borderRadius: "50%",
height: 6,
justifyContent: "center",
width: 6,
children: /*#__PURE__*/ jsxRuntime.jsx(icons.CaretDown, {
width: "0.8rem",
fill: "neutral600"
})
}),
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Typography, {
fontWeight: "bold",
children: name
})
]
});
};
exports.StageDragPreview = StageDragPreview;
//# sourceMappingURL=StageDragPreview.js.map
@@ -0,0 +1 @@
{"version":3,"file":"StageDragPreview.js","sources":["../../../../../admin/src/routes/settings/components/StageDragPreview.tsx"],"sourcesContent":["import { Flex, Typography } from '@strapi/design-system';\nimport { CaretDown } from '@strapi/icons';\n\ninterface StageDragPreviewType {\n name: string | null;\n}\n\nconst StageDragPreview = ({ name }: StageDragPreviewType) => {\n return (\n <Flex\n background=\"primary100\"\n borderStyle=\"dashed\"\n borderColor=\"primary600\"\n borderWidth=\"1px\"\n gap={3}\n hasRadius\n padding={3}\n shadow=\"tableShadow\"\n width=\"30rem\"\n >\n <Flex\n alignItems=\"center\"\n background=\"neutral200\"\n borderRadius=\"50%\"\n height={6}\n justifyContent=\"center\"\n width={6}\n >\n <CaretDown width=\"0.8rem\" fill=\"neutral600\" />\n </Flex>\n\n <Typography fontWeight=\"bold\">{name}</Typography>\n </Flex>\n );\n};\n\nexport { StageDragPreview };\nexport type { StageDragPreviewType };\n"],"names":["StageDragPreview","name","_jsxs","Flex","background","borderStyle","borderColor","borderWidth","gap","hasRadius","padding","shadow","width","_jsx","alignItems","borderRadius","height","justifyContent","CaretDown","fill","Typography","fontWeight"],"mappings":";;;;;;AAOA,MAAMA,gBAAmB,GAAA,CAAC,EAAEC,IAAI,EAAwB,GAAA;AACtD,IAAA,qBACEC,eAACC,CAAAA,iBAAAA,EAAAA;QACCC,UAAW,EAAA,YAAA;QACXC,WAAY,EAAA,QAAA;QACZC,WAAY,EAAA,YAAA;QACZC,WAAY,EAAA,KAAA;QACZC,GAAK,EAAA,CAAA;QACLC,SAAS,EAAA,IAAA;QACTC,OAAS,EAAA,CAAA;QACTC,MAAO,EAAA,aAAA;QACPC,KAAM,EAAA,OAAA;;0BAENC,cAACV,CAAAA,iBAAAA,EAAAA;gBACCW,UAAW,EAAA,QAAA;gBACXV,UAAW,EAAA,YAAA;gBACXW,YAAa,EAAA,KAAA;gBACbC,MAAQ,EAAA,CAAA;gBACRC,cAAe,EAAA,QAAA;gBACfL,KAAO,EAAA,CAAA;AAEP,gBAAA,QAAA,gBAAAC,cAACK,CAAAA,eAAAA,EAAAA;oBAAUN,KAAM,EAAA,QAAA;oBAASO,IAAK,EAAA;;;0BAGjCN,cAACO,CAAAA,uBAAAA,EAAAA;gBAAWC,UAAW,EAAA,MAAA;AAAQpB,gBAAAA,QAAAA,EAAAA;;;;AAGrC;;;;"}
@@ -0,0 +1,38 @@
import { jsxs, jsx } from 'react/jsx-runtime';
import { Flex, Typography } from '@strapi/design-system';
import { CaretDown } from '@strapi/icons';
const StageDragPreview = ({ name })=>{
return /*#__PURE__*/ jsxs(Flex, {
background: "primary100",
borderStyle: "dashed",
borderColor: "primary600",
borderWidth: "1px",
gap: 3,
hasRadius: true,
padding: 3,
shadow: "tableShadow",
width: "30rem",
children: [
/*#__PURE__*/ jsx(Flex, {
alignItems: "center",
background: "neutral200",
borderRadius: "50%",
height: 6,
justifyContent: "center",
width: 6,
children: /*#__PURE__*/ jsx(CaretDown, {
width: "0.8rem",
fill: "neutral600"
})
}),
/*#__PURE__*/ jsx(Typography, {
fontWeight: "bold",
children: name
})
]
});
};
export { StageDragPreview };
//# sourceMappingURL=StageDragPreview.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"StageDragPreview.mjs","sources":["../../../../../admin/src/routes/settings/components/StageDragPreview.tsx"],"sourcesContent":["import { Flex, Typography } from '@strapi/design-system';\nimport { CaretDown } from '@strapi/icons';\n\ninterface StageDragPreviewType {\n name: string | null;\n}\n\nconst StageDragPreview = ({ name }: StageDragPreviewType) => {\n return (\n <Flex\n background=\"primary100\"\n borderStyle=\"dashed\"\n borderColor=\"primary600\"\n borderWidth=\"1px\"\n gap={3}\n hasRadius\n padding={3}\n shadow=\"tableShadow\"\n width=\"30rem\"\n >\n <Flex\n alignItems=\"center\"\n background=\"neutral200\"\n borderRadius=\"50%\"\n height={6}\n justifyContent=\"center\"\n width={6}\n >\n <CaretDown width=\"0.8rem\" fill=\"neutral600\" />\n </Flex>\n\n <Typography fontWeight=\"bold\">{name}</Typography>\n </Flex>\n );\n};\n\nexport { StageDragPreview };\nexport type { StageDragPreviewType };\n"],"names":["StageDragPreview","name","_jsxs","Flex","background","borderStyle","borderColor","borderWidth","gap","hasRadius","padding","shadow","width","_jsx","alignItems","borderRadius","height","justifyContent","CaretDown","fill","Typography","fontWeight"],"mappings":";;;;AAOA,MAAMA,gBAAmB,GAAA,CAAC,EAAEC,IAAI,EAAwB,GAAA;AACtD,IAAA,qBACEC,IAACC,CAAAA,IAAAA,EAAAA;QACCC,UAAW,EAAA,YAAA;QACXC,WAAY,EAAA,QAAA;QACZC,WAAY,EAAA,YAAA;QACZC,WAAY,EAAA,KAAA;QACZC,GAAK,EAAA,CAAA;QACLC,SAAS,EAAA,IAAA;QACTC,OAAS,EAAA,CAAA;QACTC,MAAO,EAAA,aAAA;QACPC,KAAM,EAAA,OAAA;;0BAENC,GAACV,CAAAA,IAAAA,EAAAA;gBACCW,UAAW,EAAA,QAAA;gBACXV,UAAW,EAAA,YAAA;gBACXW,YAAa,EAAA,KAAA;gBACbC,MAAQ,EAAA,CAAA;gBACRC,cAAe,EAAA,QAAA;gBACfL,KAAO,EAAA,CAAA;AAEP,gBAAA,QAAA,gBAAAC,GAACK,CAAAA,SAAAA,EAAAA;oBAAUN,KAAM,EAAA,QAAA;oBAASO,IAAK,EAAA;;;0BAGjCN,GAACO,CAAAA,UAAAA,EAAAA;gBAAWC,UAAW,EAAA,MAAA;AAAQpB,gBAAAA,QAAAA,EAAAA;;;;AAGrC;;;;"}
@@ -0,0 +1,593 @@
'use strict';
var jsxRuntime = require('react/jsx-runtime');
var React = require('react');
var strapiAdmin = require('@strapi/admin/strapi-admin');
var designSystem = require('@strapi/design-system');
var icons = require('@strapi/icons');
var reactDndHtml5Backend = require('react-dnd-html5-backend');
var reactIntl = require('react-intl');
var styledComponents = require('styled-components');
var admin = require('../../../services/admin.js');
var colors = require('../../../utils/colors.js');
var constants = require('../constants.js');
var useDragAndDrop = require('../hooks/useDragAndDrop.js');
var AddStage = require('./AddStage.js');
function _interopNamespaceDefault(e) {
var n = Object.create(null);
if (e) {
Object.keys(e).forEach(function (k) {
if (k !== 'default') {
var d = Object.getOwnPropertyDescriptor(e, k);
Object.defineProperty(n, k, d.get ? d : {
enumerable: true,
get: function () { return e[k]; }
});
}
});
}
n.default = e;
return Object.freeze(n);
}
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
const Stages = ({ canDelete = true, canUpdate = true, isCreating })=>{
const { formatMessage } = reactIntl.useIntl();
const { trackUsage } = strapiAdmin.useTracking();
const addFieldRow = strapiAdmin.useForm('Stages', (state)=>state.addFieldRow);
const { value: stages = [] } = strapiAdmin.useField('stages');
return /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Flex, {
direction: "column",
gap: 6,
width: "100%",
children: [
/*#__PURE__*/ jsxRuntime.jsxs(designSystem.Box, {
position: "relative",
width: "100%",
children: [
/*#__PURE__*/ jsxRuntime.jsx(Background, {
background: "neutral200",
height: "100%",
left: "50%",
position: "absolute",
top: "0",
width: 2
}),
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Flex, {
direction: "column",
alignItems: "stretch",
gap: 6,
position: "relative",
tag: "ol",
children: stages.map((stage, index)=>{
return /*#__PURE__*/ jsxRuntime.jsx(designSystem.Box, {
tag: "li",
children: /*#__PURE__*/ jsxRuntime.jsx(Stage, {
index: index,
canDelete: stages.length > 1 && canDelete,
canReorder: stages.length > 1,
canUpdate: canUpdate,
stagesCount: stages.length,
defaultOpen: !stage.id,
...stage
})
}, stage.__temp_key__);
})
})
]
}),
canUpdate && /*#__PURE__*/ jsxRuntime.jsx(AddStage.AddStage, {
type: "button",
onClick: ()=>{
addFieldRow('stages', {
name: ''
});
trackUsage('willCreateStage');
},
children: formatMessage({
id: 'Settings.review-workflows.stage.add',
defaultMessage: 'Add new stage'
})
})
]
});
};
const Background = styledComponents.styled(designSystem.Box)`
transform: translateX(-50%);
`;
const Stage = ({ index, canDelete = false, canReorder = false, canUpdate = false, stagesCount, name, permissions, color, defaultOpen })=>{
const [liveText, setLiveText] = React__namespace.useState();
const { formatMessage } = reactIntl.useIntl();
const { trackUsage } = strapiAdmin.useTracking();
const stageErrors = strapiAdmin.useForm('Stages', (state)=>state.errors.stages);
const error = stageErrors?.[index];
const addFieldRow = strapiAdmin.useForm('Stage', (state)=>state.addFieldRow);
const moveFieldRow = strapiAdmin.useForm('Stage', (state)=>state.moveFieldRow);
const removeFieldRow = strapiAdmin.useForm('Stage', (state)=>state.removeFieldRow);
const getItemPos = (index)=>`${index + 1} of ${stagesCount}`;
const handleGrabStage = (index)=>{
setLiveText(formatMessage({
id: 'dnd.grab-item',
defaultMessage: `{item}, grabbed. Current position in list: {position}. Press up and down arrow to change position, Spacebar to drop, Escape to cancel.`
}, {
item: name,
position: getItemPos(index)
}));
};
const handleDropStage = (index)=>{
setLiveText(formatMessage({
id: 'dnd.drop-item',
defaultMessage: `{item}, dropped. Final position in list: {position}.`
}, {
item: name,
position: getItemPos(index)
}));
};
const handleCancelDragStage = ()=>{
setLiveText(formatMessage({
id: 'dnd.cancel-item',
defaultMessage: '{item}, dropped. Re-order cancelled.'
}, {
item: name
}));
};
const handleMoveStage = (newIndex, oldIndex)=>{
setLiveText(formatMessage({
id: 'dnd.reorder',
defaultMessage: '{item}, moved. New position in list: {position}.'
}, {
item: name,
position: getItemPos(newIndex)
}));
moveFieldRow('stages', oldIndex, newIndex);
};
const [{ handlerId, isDragging, handleKeyDown }, stageRef, dropRef, dragRef, dragPreviewRef] = useDragAndDrop.useDragAndDrop(canReorder, {
index,
item: {
index,
name
},
onGrabItem: handleGrabStage,
onDropItem: handleDropStage,
onMoveItem: handleMoveStage,
onCancel: handleCancelDragStage,
type: constants.DRAG_DROP_TYPES.STAGE
});
// @ts-expect-error – the stageRef is incorrectly typed.
const composedRef = designSystem.useComposedRefs(stageRef, dropRef);
React__namespace.useEffect(()=>{
dragPreviewRef(reactDndHtml5Backend.getEmptyImage(), {
captureDraggingState: false
});
}, [
dragPreviewRef,
index
]);
const handleCloneClick = ()=>{
addFieldRow('stages', {
name,
color,
permissions
});
};
const id = React__namespace.useId();
return /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Box, {
ref: composedRef,
shadow: "tableShadow",
children: [
liveText && /*#__PURE__*/ jsxRuntime.jsx(designSystem.VisuallyHidden, {
"aria-live": "assertive",
children: liveText
}),
isDragging ? /*#__PURE__*/ jsxRuntime.jsx(designSystem.Box, {
background: "primary100",
borderStyle: "dashed",
borderColor: "primary600",
borderWidth: "1px",
display: "block",
hasRadius: true,
padding: 6
}) : /*#__PURE__*/ jsxRuntime.jsx(AccordionRoot, {
onValueChange: (value)=>{
if (value) {
trackUsage('willEditStage');
}
},
defaultValue: defaultOpen ? id : undefined,
$error: Object.values(error ?? {}).length > 0,
children: /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Accordion.Item, {
value: id,
children: [
/*#__PURE__*/ jsxRuntime.jsxs(designSystem.Accordion.Header, {
children: [
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Accordion.Trigger, {
children: name
}),
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Accordion.Actions, {
children: canDelete || canUpdate ? /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
children: [
/*#__PURE__*/ jsxRuntime.jsxs(designSystem.Menu.Root, {
children: [
/*#__PURE__*/ jsxRuntime.jsxs(ContextMenuTrigger, {
size: "S",
endIcon: null,
paddingLeft: 2,
paddingRight: 2,
children: [
/*#__PURE__*/ jsxRuntime.jsx(icons.More, {
"aria-hidden": true,
focusable: false
}),
/*#__PURE__*/ jsxRuntime.jsx(designSystem.VisuallyHidden, {
tag: "span",
children: formatMessage({
id: '[tbdb].components.DynamicZone.more-actions',
defaultMessage: 'More actions'
})
})
]
}),
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Menu.Content, {
popoverPlacement: "bottom-end",
zIndex: 2,
children: /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Menu.SubRoot, {
children: [
canUpdate && /*#__PURE__*/ jsxRuntime.jsx(designSystem.MenuItem, {
onClick: handleCloneClick,
children: formatMessage({
id: 'Settings.review-workflows.stage.delete',
defaultMessage: 'Duplicate stage'
})
}),
canDelete && /*#__PURE__*/ jsxRuntime.jsx(DeleteMenuItem, {
onClick: ()=>removeFieldRow('stages', index),
children: formatMessage({
id: 'Settings.review-workflows.stage.delete',
defaultMessage: 'Delete'
})
})
]
})
})
]
}),
canUpdate && /*#__PURE__*/ jsxRuntime.jsx(designSystem.IconButton, {
background: "transparent",
hasRadius: true,
variant: "ghost",
"data-handler-id": handlerId,
ref: dragRef,
label: formatMessage({
id: 'Settings.review-workflows.stage.drag',
defaultMessage: 'Drag'
}),
onClick: (e)=>e.stopPropagation(),
onKeyDown: handleKeyDown,
children: /*#__PURE__*/ jsxRuntime.jsx(icons.Drag, {})
})
]
}) : null
})
]
}),
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Accordion.Content, {
children: /*#__PURE__*/ jsxRuntime.jsx(designSystem.Grid.Root, {
gap: 4,
padding: 6,
children: [
{
disabled: !canUpdate,
label: formatMessage({
id: 'Settings.review-workflows.stage.name.label',
defaultMessage: 'Stage name'
}),
name: `stages.${index}.name`,
required: true,
size: 6,
type: 'string'
},
{
disabled: !canUpdate,
label: formatMessage({
id: 'content-manager.reviewWorkflows.stage.color',
defaultMessage: 'Color'
}),
name: `stages.${index}.color`,
required: true,
size: 6,
type: 'color'
},
{
disabled: !canUpdate,
label: formatMessage({
id: 'Settings.review-workflows.stage.permissions.label',
defaultMessage: 'Roles that can change this stage'
}),
name: `stages.${index}.permissions`,
placeholder: formatMessage({
id: 'Settings.review-workflows.stage.permissions.placeholder',
defaultMessage: 'Select a role'
}),
required: true,
size: 6,
type: 'permissions'
}
].map(({ size, ...field })=>/*#__PURE__*/ jsxRuntime.jsx(designSystem.Grid.Item, {
col: size,
direction: "column",
alignItems: "stretch",
children: /*#__PURE__*/ jsxRuntime.jsx(InputRenderer, {
...field
})
}, field.name))
})
})
]
})
})
]
});
};
const AccordionRoot = styledComponents.styled(designSystem.Accordion.Root)`
border: 1px solid
${({ theme, $error })=>$error ? theme.colors.danger600 : theme.colors.neutral200};
`;
const DeleteMenuItem = styledComponents.styled(designSystem.MenuItem)`
color: ${({ theme })=>theme.colors.danger600};
`;
// Removing the font-size from the child-span aligns the
// more icon vertically
const ContextMenuTrigger = styledComponents.styled(designSystem.Menu.Trigger)`
:hover,
:focus {
background-color: ${({ theme })=>theme.colors.neutral100};
}
> span {
font-size: 0;
}
`;
const InputRenderer = (props)=>{
switch(props.type){
case 'color':
return /*#__PURE__*/ jsxRuntime.jsx(ColorSelector, {
...props
});
case 'permissions':
return /*#__PURE__*/ jsxRuntime.jsx(PermissionsField, {
...props
});
default:
return /*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.InputRenderer, {
...props
});
}
};
const ColorSelector = ({ disabled, label, name, required })=>{
const { formatMessage } = reactIntl.useIntl();
const { value, error, onChange } = strapiAdmin.useField(name);
const colorOptions = colors.AVAILABLE_COLORS.map(({ hex, name })=>({
value: hex,
label: formatMessage({
id: 'Settings.review-workflows.stage.color.name',
defaultMessage: '{name}'
}, {
name
}),
color: hex
}));
const { themeColorName } = colors.getStageColorByHex(value) ?? {};
return /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Field.Root, {
error: error,
name: name,
required: required,
children: [
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Field.Label, {
children: label
}),
/*#__PURE__*/ jsxRuntime.jsx(designSystem.SingleSelect, {
disabled: disabled,
onChange: (v)=>{
onChange(name, v.toString());
},
value: value?.toUpperCase(),
startIcon: /*#__PURE__*/ jsxRuntime.jsx(designSystem.Flex, {
tag: "span",
height: 2,
background: value,
borderColor: themeColorName === 'neutral0' ? 'neutral150' : 'transparent',
hasRadius: true,
shrink: 0,
width: 2
}),
children: colorOptions.map(({ value, label, color })=>{
const { themeColorName } = colors.getStageColorByHex(color) || {};
return /*#__PURE__*/ jsxRuntime.jsx(designSystem.SingleSelectOption, {
value: value,
startIcon: /*#__PURE__*/ jsxRuntime.jsx(designSystem.Flex, {
tag: "span",
height: 2,
background: color,
borderColor: themeColorName === 'neutral0' ? 'neutral150' : 'transparent',
hasRadius: true,
shrink: 0,
width: 2
}),
children: label
}, value);
})
}),
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Field.Error, {})
]
});
};
const PermissionsField = ({ disabled, name, placeholder, required })=>{
const { formatMessage } = reactIntl.useIntl();
const { toggleNotification } = strapiAdmin.useNotification();
const [isApplyAllConfirmationOpen, setIsApplyAllConfirmationOpen] = React__namespace.useState(false);
const { value = [], error, onChange } = strapiAdmin.useField(name);
const allStages = strapiAdmin.useForm('PermissionsField', (state)=>state.values.stages);
const onFormValueChange = strapiAdmin.useForm('PermissionsField', (state)=>state.onChange);
const rolesErrorCount = React__namespace.useRef(0);
const { data: roles = [], isLoading, error: getRolesError } = admin.useGetAdminRolesQuery();
// Super admins always have permissions to do everything and therefore
// there is no point for this role to show up in the role combobox
const filteredRoles = roles?.filter((role)=>role.code !== 'strapi-super-admin') ?? [];
React__namespace.useEffect(()=>{
if (!isLoading && getRolesError && 'status' in getRolesError && getRolesError.status == 403 && rolesErrorCount.current === 0) {
rolesErrorCount.current = 1;
toggleNotification({
blockTransition: true,
type: 'danger',
message: formatMessage({
id: 'review-workflows.stage.permissions.noPermissions.description',
defaultMessage: 'You don’t have the permission to see roles. Contact your administrator.'
})
});
}
}, [
formatMessage,
isLoading,
roles,
toggleNotification,
getRolesError
]);
if (!isLoading && filteredRoles.length === 0) {
return /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Field.Root, {
name: name,
hint: formatMessage({
id: 'Settings.review-workflows.stage.permissions.noPermissions.description',
defaultMessage: 'You don’t have the permission to see roles'
}),
required: required,
children: [
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Field.Label, {
children: formatMessage({
id: 'Settings.review-workflows.stage.permissions.label',
defaultMessage: 'Roles that can change this stage'
})
}),
/*#__PURE__*/ jsxRuntime.jsx(designSystem.TextInput, {
disabled: true,
placeholder: formatMessage({
id: 'components.NotAllowedInput.text',
defaultMessage: 'No permissions to see this field'
}),
startAction: /*#__PURE__*/ jsxRuntime.jsx(icons.EyeStriked, {
fill: "neutral600"
}),
type: "text",
value: ""
}),
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Field.Hint, {})
]
});
}
return /*#__PURE__*/ jsxRuntime.jsx(jsxRuntime.Fragment, {
children: /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Flex, {
alignItems: "flex-end",
gap: 3,
children: [
/*#__PURE__*/ jsxRuntime.jsx(PermissionWrapper, {
grow: 1,
children: /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Field.Root, {
error: error,
name: name,
required: true,
children: [
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Field.Label, {
children: formatMessage({
id: 'Settings.review-workflows.stage.permissions.label',
defaultMessage: 'Roles that can change this stage'
})
}),
/*#__PURE__*/ jsxRuntime.jsx(designSystem.MultiSelect, {
disabled: disabled,
onChange: (values)=>{
// Because the select components expects strings for values, but
// the yup schema validates we are sending full permission objects to the API,
// we must coerce the string value back to an object
const permissions = values.map((value)=>({
role: parseInt(value, 10),
action: 'admin::review-workflows.stage.transition'
}));
onChange(name, permissions);
},
placeholder: placeholder,
// The Select component expects strings for values
value: value.map((permission)=>`${permission.role}`),
withTags: true,
children: /*#__PURE__*/ jsxRuntime.jsx(designSystem.MultiSelectGroup, {
label: formatMessage({
id: 'Settings.review-workflows.stage.permissions.allRoles.label',
defaultMessage: 'All roles'
}),
values: filteredRoles.map((r)=>`${r.id}`),
children: filteredRoles.map((role)=>{
return /*#__PURE__*/ jsxRuntime.jsx(NestedOption, {
value: `${role.id}`,
children: role.name
}, role.id);
})
})
}),
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Field.Error, {})
]
})
}),
/*#__PURE__*/ jsxRuntime.jsxs(designSystem.Dialog.Root, {
open: isApplyAllConfirmationOpen,
onOpenChange: setIsApplyAllConfirmationOpen,
children: [
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Dialog.Trigger, {
children: /*#__PURE__*/ jsxRuntime.jsx(designSystem.IconButton, {
disabled: disabled,
label: formatMessage({
id: 'Settings.review-workflows.stage.permissions.apply.label',
defaultMessage: 'Apply to all stages'
}),
size: "L",
children: /*#__PURE__*/ jsxRuntime.jsx(icons.Duplicate, {})
})
}),
/*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.ConfirmDialog, {
onConfirm: ()=>{
onFormValueChange('stages', allStages.map((stage)=>({
...stage,
permissions: value
})));
setIsApplyAllConfirmationOpen(false);
toggleNotification({
type: 'success',
message: formatMessage({
id: 'Settings.review-workflows.page.edit.confirm.stages.permissions.copy.success',
defaultMessage: 'Applied roles to all other stages of the workflow'
})
});
},
variant: "default",
children: formatMessage({
id: 'Settings.review-workflows.page.edit.confirm.stages.permissions.copy',
defaultMessage: 'Roles that can change that stage will be applied to all the other stages.'
})
})
]
})
]
})
});
};
const NestedOption = styledComponents.styled(designSystem.MultiSelectOption)`
padding-left: ${({ theme })=>theme.spaces[7]};
`;
// Grow the size of the permission Select
const PermissionWrapper = styledComponents.styled(designSystem.Flex)`
> * {
flex-grow: 1;
}
`;
exports.Stages = Stages;
//# sourceMappingURL=Stages.js.map
@@ -0,0 +1 @@
{"version":3,"file":"Stages.js","sources":["../../../../../admin/src/routes/settings/components/Stages.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport {\n useField,\n useForm,\n useTracking,\n ConfirmDialog,\n useNotification,\n InputRenderer as AdminInputRenderer,\n InputProps,\n} from '@strapi/admin/strapi-admin';\nimport {\n Box,\n Flex,\n MultiSelectOption,\n Accordion,\n Grid,\n IconButton,\n MultiSelect,\n MultiSelectGroup,\n SingleSelect,\n SingleSelectOption,\n TextInput,\n VisuallyHidden,\n useComposedRefs,\n Menu,\n MenuItem,\n Field,\n Dialog,\n} from '@strapi/design-system';\nimport { Duplicate, Drag, More, EyeStriked } from '@strapi/icons';\nimport { getEmptyImage } from 'react-dnd-html5-backend';\nimport { useIntl } from 'react-intl';\nimport { styled } from 'styled-components';\n\nimport { Stage as IStage, StagePermission } from '../../../../../shared/contracts/review-workflows';\nimport { useGetAdminRolesQuery } from '../../../services/admin';\nimport { AVAILABLE_COLORS, getStageColorByHex } from '../../../utils/colors';\nimport { DRAG_DROP_TYPES } from '../constants';\nimport { useDragAndDrop } from '../hooks/useDragAndDrop';\n\nimport { AddStage } from './AddStage';\n\ninterface WorkflowStage extends Pick<IStage, 'id' | 'name' | 'permissions' | 'color'> {\n __temp_key__: string;\n}\n\n/* -------------------------------------------------------------------------------------------------\n * Stages\n * -----------------------------------------------------------------------------------------------*/\ninterface StagesProps {\n canDelete?: boolean;\n canUpdate?: boolean;\n isCreating?: boolean;\n}\n\nconst Stages = ({ canDelete = true, canUpdate = true, isCreating }: StagesProps) => {\n const { formatMessage } = useIntl();\n const { trackUsage } = useTracking();\n const addFieldRow = useForm('Stages', (state) => state.addFieldRow);\n const { value: stages = [] } = useField<WorkflowStage[]>('stages');\n\n return (\n <Flex direction=\"column\" gap={6} width=\"100%\">\n <Box position=\"relative\" width=\"100%\">\n <Background\n background=\"neutral200\"\n height=\"100%\"\n left=\"50%\"\n position=\"absolute\"\n top=\"0\"\n width={2}\n />\n\n <Flex direction=\"column\" alignItems=\"stretch\" gap={6} position=\"relative\" tag=\"ol\">\n {stages.map((stage, index) => {\n return (\n <Box key={stage.__temp_key__} tag=\"li\">\n <Stage\n index={index}\n canDelete={stages.length > 1 && canDelete}\n canReorder={stages.length > 1}\n canUpdate={canUpdate}\n stagesCount={stages.length}\n defaultOpen={!stage.id}\n {...stage}\n />\n </Box>\n );\n })}\n </Flex>\n </Box>\n\n {canUpdate && (\n <AddStage\n type=\"button\"\n onClick={() => {\n addFieldRow('stages', { name: '' });\n trackUsage('willCreateStage');\n }}\n >\n {formatMessage({\n id: 'Settings.review-workflows.stage.add',\n defaultMessage: 'Add new stage',\n })}\n </AddStage>\n )}\n </Flex>\n );\n};\n\nconst Background = styled(Box)`\n transform: translateX(-50%);\n`;\n\n/* -------------------------------------------------------------------------------------------------\n * Stage\n * -----------------------------------------------------------------------------------------------*/\ninterface StageProps extends WorkflowStage {\n canDelete?: boolean;\n canReorder?: boolean;\n canUpdate?: boolean;\n index: number;\n stagesCount: number;\n defaultOpen?: boolean;\n}\n\nconst Stage = ({\n index,\n canDelete = false,\n canReorder = false,\n canUpdate = false,\n stagesCount,\n name,\n permissions,\n color,\n defaultOpen,\n}: StageProps) => {\n const [liveText, setLiveText] = React.useState<string>();\n const { formatMessage } = useIntl();\n const { trackUsage } = useTracking();\n const stageErrors = useForm('Stages', (state) => state.errors.stages as object[]);\n const error = stageErrors?.[index];\n const addFieldRow = useForm('Stage', (state) => state.addFieldRow);\n const moveFieldRow = useForm('Stage', (state) => state.moveFieldRow);\n const removeFieldRow = useForm('Stage', (state) => state.removeFieldRow);\n\n const getItemPos = (index: number) => `${index + 1} of ${stagesCount}`;\n\n const handleGrabStage = (index: number) => {\n setLiveText(\n formatMessage(\n {\n id: 'dnd.grab-item',\n defaultMessage: `{item}, grabbed. Current position in list: {position}. Press up and down arrow to change position, Spacebar to drop, Escape to cancel.`,\n },\n {\n item: name,\n position: getItemPos(index),\Line truncated
@@ -0,0 +1,572 @@
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
import * as React from 'react';
import { useTracking, useForm, useField, InputRenderer as InputRenderer$1, useNotification, ConfirmDialog } from '@strapi/admin/strapi-admin';
import { Box, Accordion, MenuItem, Menu, MultiSelectOption, Flex, useComposedRefs, VisuallyHidden, IconButton, Grid, Field, SingleSelect, SingleSelectOption, TextInput, MultiSelect, MultiSelectGroup, Dialog } from '@strapi/design-system';
import { More, Drag, EyeStriked, Duplicate } from '@strapi/icons';
import { getEmptyImage } from 'react-dnd-html5-backend';
import { useIntl } from 'react-intl';
import { styled } from 'styled-components';
import { useGetAdminRolesQuery } from '../../../services/admin.mjs';
import { AVAILABLE_COLORS, getStageColorByHex } from '../../../utils/colors.mjs';
import { DRAG_DROP_TYPES } from '../constants.mjs';
import { useDragAndDrop } from '../hooks/useDragAndDrop.mjs';
import { AddStage } from './AddStage.mjs';
const Stages = ({ canDelete = true, canUpdate = true, isCreating })=>{
const { formatMessage } = useIntl();
const { trackUsage } = useTracking();
const addFieldRow = useForm('Stages', (state)=>state.addFieldRow);
const { value: stages = [] } = useField('stages');
return /*#__PURE__*/ jsxs(Flex, {
direction: "column",
gap: 6,
width: "100%",
children: [
/*#__PURE__*/ jsxs(Box, {
position: "relative",
width: "100%",
children: [
/*#__PURE__*/ jsx(Background, {
background: "neutral200",
height: "100%",
left: "50%",
position: "absolute",
top: "0",
width: 2
}),
/*#__PURE__*/ jsx(Flex, {
direction: "column",
alignItems: "stretch",
gap: 6,
position: "relative",
tag: "ol",
children: stages.map((stage, index)=>{
return /*#__PURE__*/ jsx(Box, {
tag: "li",
children: /*#__PURE__*/ jsx(Stage, {
index: index,
canDelete: stages.length > 1 && canDelete,
canReorder: stages.length > 1,
canUpdate: canUpdate,
stagesCount: stages.length,
defaultOpen: !stage.id,
...stage
})
}, stage.__temp_key__);
})
})
]
}),
canUpdate && /*#__PURE__*/ jsx(AddStage, {
type: "button",
onClick: ()=>{
addFieldRow('stages', {
name: ''
});
trackUsage('willCreateStage');
},
children: formatMessage({
id: 'Settings.review-workflows.stage.add',
defaultMessage: 'Add new stage'
})
})
]
});
};
const Background = styled(Box)`
transform: translateX(-50%);
`;
const Stage = ({ index, canDelete = false, canReorder = false, canUpdate = false, stagesCount, name, permissions, color, defaultOpen })=>{
const [liveText, setLiveText] = React.useState();
const { formatMessage } = useIntl();
const { trackUsage } = useTracking();
const stageErrors = useForm('Stages', (state)=>state.errors.stages);
const error = stageErrors?.[index];
const addFieldRow = useForm('Stage', (state)=>state.addFieldRow);
const moveFieldRow = useForm('Stage', (state)=>state.moveFieldRow);
const removeFieldRow = useForm('Stage', (state)=>state.removeFieldRow);
const getItemPos = (index)=>`${index + 1} of ${stagesCount}`;
const handleGrabStage = (index)=>{
setLiveText(formatMessage({
id: 'dnd.grab-item',
defaultMessage: `{item}, grabbed. Current position in list: {position}. Press up and down arrow to change position, Spacebar to drop, Escape to cancel.`
}, {
item: name,
position: getItemPos(index)
}));
};
const handleDropStage = (index)=>{
setLiveText(formatMessage({
id: 'dnd.drop-item',
defaultMessage: `{item}, dropped. Final position in list: {position}.`
}, {
item: name,
position: getItemPos(index)
}));
};
const handleCancelDragStage = ()=>{
setLiveText(formatMessage({
id: 'dnd.cancel-item',
defaultMessage: '{item}, dropped. Re-order cancelled.'
}, {
item: name
}));
};
const handleMoveStage = (newIndex, oldIndex)=>{
setLiveText(formatMessage({
id: 'dnd.reorder',
defaultMessage: '{item}, moved. New position in list: {position}.'
}, {
item: name,
position: getItemPos(newIndex)
}));
moveFieldRow('stages', oldIndex, newIndex);
};
const [{ handlerId, isDragging, handleKeyDown }, stageRef, dropRef, dragRef, dragPreviewRef] = useDragAndDrop(canReorder, {
index,
item: {
index,
name
},
onGrabItem: handleGrabStage,
onDropItem: handleDropStage,
onMoveItem: handleMoveStage,
onCancel: handleCancelDragStage,
type: DRAG_DROP_TYPES.STAGE
});
// @ts-expect-error – the stageRef is incorrectly typed.
const composedRef = useComposedRefs(stageRef, dropRef);
React.useEffect(()=>{
dragPreviewRef(getEmptyImage(), {
captureDraggingState: false
});
}, [
dragPreviewRef,
index
]);
const handleCloneClick = ()=>{
addFieldRow('stages', {
name,
color,
permissions
});
};
const id = React.useId();
return /*#__PURE__*/ jsxs(Box, {
ref: composedRef,
shadow: "tableShadow",
children: [
liveText && /*#__PURE__*/ jsx(VisuallyHidden, {
"aria-live": "assertive",
children: liveText
}),
isDragging ? /*#__PURE__*/ jsx(Box, {
background: "primary100",
borderStyle: "dashed",
borderColor: "primary600",
borderWidth: "1px",
display: "block",
hasRadius: true,
padding: 6
}) : /*#__PURE__*/ jsx(AccordionRoot, {
onValueChange: (value)=>{
if (value) {
trackUsage('willEditStage');
}
},
defaultValue: defaultOpen ? id : undefined,
$error: Object.values(error ?? {}).length > 0,
children: /*#__PURE__*/ jsxs(Accordion.Item, {
value: id,
children: [
/*#__PURE__*/ jsxs(Accordion.Header, {
children: [
/*#__PURE__*/ jsx(Accordion.Trigger, {
children: name
}),
/*#__PURE__*/ jsx(Accordion.Actions, {
children: canDelete || canUpdate ? /*#__PURE__*/ jsxs(Fragment, {
children: [
/*#__PURE__*/ jsxs(Menu.Root, {
children: [
/*#__PURE__*/ jsxs(ContextMenuTrigger, {
size: "S",
endIcon: null,
paddingLeft: 2,
paddingRight: 2,
children: [
/*#__PURE__*/ jsx(More, {
"aria-hidden": true,
focusable: false
}),
/*#__PURE__*/ jsx(VisuallyHidden, {
tag: "span",
children: formatMessage({
id: '[tbdb].components.DynamicZone.more-actions',
defaultMessage: 'More actions'
})
})
]
}),
/*#__PURE__*/ jsx(Menu.Content, {
popoverPlacement: "bottom-end",
zIndex: 2,
children: /*#__PURE__*/ jsxs(Menu.SubRoot, {
children: [
canUpdate && /*#__PURE__*/ jsx(MenuItem, {
onClick: handleCloneClick,
children: formatMessage({
id: 'Settings.review-workflows.stage.delete',
defaultMessage: 'Duplicate stage'
})
}),
canDelete && /*#__PURE__*/ jsx(DeleteMenuItem, {
onClick: ()=>removeFieldRow('stages', index),
children: formatMessage({
id: 'Settings.review-workflows.stage.delete',
defaultMessage: 'Delete'
})
})
]
})
})
]
}),
canUpdate && /*#__PURE__*/ jsx(IconButton, {
background: "transparent",
hasRadius: true,
variant: "ghost",
"data-handler-id": handlerId,
ref: dragRef,
label: formatMessage({
id: 'Settings.review-workflows.stage.drag',
defaultMessage: 'Drag'
}),
onClick: (e)=>e.stopPropagation(),
onKeyDown: handleKeyDown,
children: /*#__PURE__*/ jsx(Drag, {})
})
]
}) : null
})
]
}),
/*#__PURE__*/ jsx(Accordion.Content, {
children: /*#__PURE__*/ jsx(Grid.Root, {
gap: 4,
padding: 6,
children: [
{
disabled: !canUpdate,
label: formatMessage({
id: 'Settings.review-workflows.stage.name.label',
defaultMessage: 'Stage name'
}),
name: `stages.${index}.name`,
required: true,
size: 6,
type: 'string'
},
{
disabled: !canUpdate,
label: formatMessage({
id: 'content-manager.reviewWorkflows.stage.color',
defaultMessage: 'Color'
}),
name: `stages.${index}.color`,
required: true,
size: 6,
type: 'color'
},
{
disabled: !canUpdate,
label: formatMessage({
id: 'Settings.review-workflows.stage.permissions.label',
defaultMessage: 'Roles that can change this stage'
}),
name: `stages.${index}.permissions`,
placeholder: formatMessage({
id: 'Settings.review-workflows.stage.permissions.placeholder',
defaultMessage: 'Select a role'
}),
required: true,
size: 6,
type: 'permissions'
}
].map(({ size, ...field })=>/*#__PURE__*/ jsx(Grid.Item, {
col: size,
direction: "column",
alignItems: "stretch",
children: /*#__PURE__*/ jsx(InputRenderer, {
...field
})
}, field.name))
})
})
]
})
})
]
});
};
const AccordionRoot = styled(Accordion.Root)`
border: 1px solid
${({ theme, $error })=>$error ? theme.colors.danger600 : theme.colors.neutral200};
`;
const DeleteMenuItem = styled(MenuItem)`
color: ${({ theme })=>theme.colors.danger600};
`;
// Removing the font-size from the child-span aligns the
// more icon vertically
const ContextMenuTrigger = styled(Menu.Trigger)`
:hover,
:focus {
background-color: ${({ theme })=>theme.colors.neutral100};
}
> span {
font-size: 0;
}
`;
const InputRenderer = (props)=>{
switch(props.type){
case 'color':
return /*#__PURE__*/ jsx(ColorSelector, {
...props
});
case 'permissions':
return /*#__PURE__*/ jsx(PermissionsField, {
...props
});
default:
return /*#__PURE__*/ jsx(InputRenderer$1, {
...props
});
}
};
const ColorSelector = ({ disabled, label, name, required })=>{
const { formatMessage } = useIntl();
const { value, error, onChange } = useField(name);
const colorOptions = AVAILABLE_COLORS.map(({ hex, name })=>({
value: hex,
label: formatMessage({
id: 'Settings.review-workflows.stage.color.name',
defaultMessage: '{name}'
}, {
name
}),
color: hex
}));
const { themeColorName } = getStageColorByHex(value) ?? {};
return /*#__PURE__*/ jsxs(Field.Root, {
error: error,
name: name,
required: required,
children: [
/*#__PURE__*/ jsx(Field.Label, {
children: label
}),
/*#__PURE__*/ jsx(SingleSelect, {
disabled: disabled,
onChange: (v)=>{
onChange(name, v.toString());
},
value: value?.toUpperCase(),
startIcon: /*#__PURE__*/ jsx(Flex, {
tag: "span",
height: 2,
background: value,
borderColor: themeColorName === 'neutral0' ? 'neutral150' : 'transparent',
hasRadius: true,
shrink: 0,
width: 2
}),
children: colorOptions.map(({ value, label, color })=>{
const { themeColorName } = getStageColorByHex(color) || {};
return /*#__PURE__*/ jsx(SingleSelectOption, {
value: value,
startIcon: /*#__PURE__*/ jsx(Flex, {
tag: "span",
height: 2,
background: color,
borderColor: themeColorName === 'neutral0' ? 'neutral150' : 'transparent',
hasRadius: true,
shrink: 0,
width: 2
}),
children: label
}, value);
})
}),
/*#__PURE__*/ jsx(Field.Error, {})
]
});
};
const PermissionsField = ({ disabled, name, placeholder, required })=>{
const { formatMessage } = useIntl();
const { toggleNotification } = useNotification();
const [isApplyAllConfirmationOpen, setIsApplyAllConfirmationOpen] = React.useState(false);
const { value = [], error, onChange } = useField(name);
const allStages = useForm('PermissionsField', (state)=>state.values.stages);
const onFormValueChange = useForm('PermissionsField', (state)=>state.onChange);
const rolesErrorCount = React.useRef(0);
const { data: roles = [], isLoading, error: getRolesError } = useGetAdminRolesQuery();
// Super admins always have permissions to do everything and therefore
// there is no point for this role to show up in the role combobox
const filteredRoles = roles?.filter((role)=>role.code !== 'strapi-super-admin') ?? [];
React.useEffect(()=>{
if (!isLoading && getRolesError && 'status' in getRolesError && getRolesError.status == 403 && rolesErrorCount.current === 0) {
rolesErrorCount.current = 1;
toggleNotification({
blockTransition: true,
type: 'danger',
message: formatMessage({
id: 'review-workflows.stage.permissions.noPermissions.description',
defaultMessage: 'You don’t have the permission to see roles. Contact your administrator.'
})
});
}
}, [
formatMessage,
isLoading,
roles,
toggleNotification,
getRolesError
]);
if (!isLoading && filteredRoles.length === 0) {
return /*#__PURE__*/ jsxs(Field.Root, {
name: name,
hint: formatMessage({
id: 'Settings.review-workflows.stage.permissions.noPermissions.description',
defaultMessage: 'You don’t have the permission to see roles'
}),
required: required,
children: [
/*#__PURE__*/ jsx(Field.Label, {
children: formatMessage({
id: 'Settings.review-workflows.stage.permissions.label',
defaultMessage: 'Roles that can change this stage'
})
}),
/*#__PURE__*/ jsx(TextInput, {
disabled: true,
placeholder: formatMessage({
id: 'components.NotAllowedInput.text',
defaultMessage: 'No permissions to see this field'
}),
startAction: /*#__PURE__*/ jsx(EyeStriked, {
fill: "neutral600"
}),
type: "text",
value: ""
}),
/*#__PURE__*/ jsx(Field.Hint, {})
]
});
}
return /*#__PURE__*/ jsx(Fragment, {
children: /*#__PURE__*/ jsxs(Flex, {
alignItems: "flex-end",
gap: 3,
children: [
/*#__PURE__*/ jsx(PermissionWrapper, {
grow: 1,
children: /*#__PURE__*/ jsxs(Field.Root, {
error: error,
name: name,
required: true,
children: [
/*#__PURE__*/ jsx(Field.Label, {
children: formatMessage({
id: 'Settings.review-workflows.stage.permissions.label',
defaultMessage: 'Roles that can change this stage'
})
}),
/*#__PURE__*/ jsx(MultiSelect, {
disabled: disabled,
onChange: (values)=>{
// Because the select components expects strings for values, but
// the yup schema validates we are sending full permission objects to the API,
// we must coerce the string value back to an object
const permissions = values.map((value)=>({
role: parseInt(value, 10),
action: 'admin::review-workflows.stage.transition'
}));
onChange(name, permissions);
},
placeholder: placeholder,
// The Select component expects strings for values
value: value.map((permission)=>`${permission.role}`),
withTags: true,
children: /*#__PURE__*/ jsx(MultiSelectGroup, {
label: formatMessage({
id: 'Settings.review-workflows.stage.permissions.allRoles.label',
defaultMessage: 'All roles'
}),
values: filteredRoles.map((r)=>`${r.id}`),
children: filteredRoles.map((role)=>{
return /*#__PURE__*/ jsx(NestedOption, {
value: `${role.id}`,
children: role.name
}, role.id);
})
})
}),
/*#__PURE__*/ jsx(Field.Error, {})
]
})
}),
/*#__PURE__*/ jsxs(Dialog.Root, {
open: isApplyAllConfirmationOpen,
onOpenChange: setIsApplyAllConfirmationOpen,
children: [
/*#__PURE__*/ jsx(Dialog.Trigger, {
children: /*#__PURE__*/ jsx(IconButton, {
disabled: disabled,
label: formatMessage({
id: 'Settings.review-workflows.stage.permissions.apply.label',
defaultMessage: 'Apply to all stages'
}),
size: "L",
children: /*#__PURE__*/ jsx(Duplicate, {})
})
}),
/*#__PURE__*/ jsx(ConfirmDialog, {
onConfirm: ()=>{
onFormValueChange('stages', allStages.map((stage)=>({
...stage,
permissions: value
})));
setIsApplyAllConfirmationOpen(false);
toggleNotification({
type: 'success',
message: formatMessage({
id: 'Settings.review-workflows.page.edit.confirm.stages.permissions.copy.success',
defaultMessage: 'Applied roles to all other stages of the workflow'
})
});
},
variant: "default",
children: formatMessage({
id: 'Settings.review-workflows.page.edit.confirm.stages.permissions.copy',
defaultMessage: 'Roles that can change that stage will be applied to all the other stages.'
})
})
]
})
]
})
});
};
const NestedOption = styled(MultiSelectOption)`
padding-left: ${({ theme })=>theme.spaces[7]};
`;
// Grow the size of the permission Select
const PermissionWrapper = styled(Flex)`
> * {
flex-grow: 1;
}
`;
export { Stages };
//# sourceMappingURL=Stages.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"Stages.mjs","sources":["../../../../../admin/src/routes/settings/components/Stages.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport {\n useField,\n useForm,\n useTracking,\n ConfirmDialog,\n useNotification,\n InputRenderer as AdminInputRenderer,\n InputProps,\n} from '@strapi/admin/strapi-admin';\nimport {\n Box,\n Flex,\n MultiSelectOption,\n Accordion,\n Grid,\n IconButton,\n MultiSelect,\n MultiSelectGroup,\n SingleSelect,\n SingleSelectOption,\n TextInput,\n VisuallyHidden,\n useComposedRefs,\n Menu,\n MenuItem,\n Field,\n Dialog,\n} from '@strapi/design-system';\nimport { Duplicate, Drag, More, EyeStriked } from '@strapi/icons';\nimport { getEmptyImage } from 'react-dnd-html5-backend';\nimport { useIntl } from 'react-intl';\nimport { styled } from 'styled-components';\n\nimport { Stage as IStage, StagePermission } from '../../../../../shared/contracts/review-workflows';\nimport { useGetAdminRolesQuery } from '../../../services/admin';\nimport { AVAILABLE_COLORS, getStageColorByHex } from '../../../utils/colors';\nimport { DRAG_DROP_TYPES } from '../constants';\nimport { useDragAndDrop } from '../hooks/useDragAndDrop';\n\nimport { AddStage } from './AddStage';\n\ninterface WorkflowStage extends Pick<IStage, 'id' | 'name' | 'permissions' | 'color'> {\n __temp_key__: string;\n}\n\n/* -------------------------------------------------------------------------------------------------\n * Stages\n * -----------------------------------------------------------------------------------------------*/\ninterface StagesProps {\n canDelete?: boolean;\n canUpdate?: boolean;\n isCreating?: boolean;\n}\n\nconst Stages = ({ canDelete = true, canUpdate = true, isCreating }: StagesProps) => {\n const { formatMessage } = useIntl();\n const { trackUsage } = useTracking();\n const addFieldRow = useForm('Stages', (state) => state.addFieldRow);\n const { value: stages = [] } = useField<WorkflowStage[]>('stages');\n\n return (\n <Flex direction=\"column\" gap={6} width=\"100%\">\n <Box position=\"relative\" width=\"100%\">\n <Background\n background=\"neutral200\"\n height=\"100%\"\n left=\"50%\"\n position=\"absolute\"\n top=\"0\"\n width={2}\n />\n\n <Flex direction=\"column\" alignItems=\"stretch\" gap={6} position=\"relative\" tag=\"ol\">\n {stages.map((stage, index) => {\n return (\n <Box key={stage.__temp_key__} tag=\"li\">\n <Stage\n index={index}\n canDelete={stages.length > 1 && canDelete}\n canReorder={stages.length > 1}\n canUpdate={canUpdate}\n stagesCount={stages.length}\n defaultOpen={!stage.id}\n {...stage}\n />\n </Box>\n );\n })}\n </Flex>\n </Box>\n\n {canUpdate && (\n <AddStage\n type=\"button\"\n onClick={() => {\n addFieldRow('stages', { name: '' });\n trackUsage('willCreateStage');\n }}\n >\n {formatMessage({\n id: 'Settings.review-workflows.stage.add',\n defaultMessage: 'Add new stage',\n })}\n </AddStage>\n )}\n </Flex>\n );\n};\n\nconst Background = styled(Box)`\n transform: translateX(-50%);\n`;\n\n/* -------------------------------------------------------------------------------------------------\n * Stage\n * -----------------------------------------------------------------------------------------------*/\ninterface StageProps extends WorkflowStage {\n canDelete?: boolean;\n canReorder?: boolean;\n canUpdate?: boolean;\n index: number;\n stagesCount: number;\n defaultOpen?: boolean;\n}\n\nconst Stage = ({\n index,\n canDelete = false,\n canReorder = false,\n canUpdate = false,\n stagesCount,\n name,\n permissions,\n color,\n defaultOpen,\n}: StageProps) => {\n const [liveText, setLiveText] = React.useState<string>();\n const { formatMessage } = useIntl();\n const { trackUsage } = useTracking();\n const stageErrors = useForm('Stages', (state) => state.errors.stages as object[]);\n const error = stageErrors?.[index];\n const addFieldRow = useForm('Stage', (state) => state.addFieldRow);\n const moveFieldRow = useForm('Stage', (state) => state.moveFieldRow);\n const removeFieldRow = useForm('Stage', (state) => state.removeFieldRow);\n\n const getItemPos = (index: number) => `${index + 1} of ${stagesCount}`;\n\n const handleGrabStage = (index: number) => {\n setLiveText(\n formatMessage(\n {\n id: 'dnd.grab-item',\n defaultMessage: `{item}, grabbed. Current position in list: {position}. Press up and down arrow to change position, Spacebar to drop, Escape to cancel.`,\n },\n {\n item: name,\n position: getItemPos(index),Line truncated
@@ -0,0 +1,203 @@
'use strict';
var jsxRuntime = require('react/jsx-runtime');
var strapiAdmin = require('@strapi/admin/strapi-admin');
var designSystem = require('@strapi/design-system');
var reactIntl = require('react-intl');
var styledComponents = require('styled-components');
var contentManager = require('../../../services/content-manager.js');
var useReviewWorkflows = require('../hooks/useReviewWorkflows.js');
const WorkflowAttributes = ({ canUpdate = true })=>{
const { formatMessage } = reactIntl.useIntl();
return /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Grid.Root, {
background: "neutral0",
hasRadius: true,
gap: 4,
padding: 6,
shadow: "tableShadow",
children: [
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Grid.Item, {
col: 6,
direction: "column",
alignItems: "stretch",
children: /*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.InputRenderer, {
disabled: !canUpdate,
label: formatMessage({
id: 'Settings.review-workflows.workflow.name.label',
defaultMessage: 'Workflow Name'
}),
name: "name",
required: true,
type: "string"
})
}),
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Grid.Item, {
col: 6,
direction: "column",
alignItems: "stretch",
children: /*#__PURE__*/ jsxRuntime.jsx(ContentTypesSelector, {
disabled: !canUpdate
})
}),
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Grid.Item, {
col: 6,
direction: "column",
alignItems: "stretch",
children: /*#__PURE__*/ jsxRuntime.jsx(StageSelector, {
disabled: !canUpdate
})
})
]
});
};
const ContentTypesSelector = ({ disabled })=>{
const { formatMessage, locale } = reactIntl.useIntl();
const { data: contentTypes, isLoading } = contentManager.useGetContentTypesQuery();
const { workflows } = useReviewWorkflows.useReviewWorkflows();
const currentWorkflow = strapiAdmin.useForm('ContentTypesSelector', (state)=>state.values);
const { error, value, onChange } = strapiAdmin.useField('contentTypes');
const formatter = designSystem.useCollator(locale, {
sensitivity: 'base'
});
const isDisabled = disabled || isLoading || !contentTypes || contentTypes.collectionType.length === 0 && contentTypes.singleType.length === 0;
const collectionTypes = (contentTypes?.collectionType ?? []).toSorted((a, b)=>formatter.compare(a.info.displayName, b.info.displayName)).map((contentType)=>({
label: contentType.info.displayName,
value: contentType.uid
}));
const singleTypes = (contentTypes?.singleType ?? []).map((contentType)=>({
label: contentType.info.displayName,
value: contentType.uid
}));
return /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Field.Root, {
error: error,
name: 'contentTypes',
children: [
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Field.Label, {
children: formatMessage({
id: 'Settings.review-workflows.workflow.contentTypes.label',
defaultMessage: 'Associated to'
})
}),
/*#__PURE__*/ jsxRuntime.jsx(designSystem.MultiSelect, {
customizeContent: (value)=>formatMessage({
id: 'Settings.review-workflows.workflow.contentTypes.displayValue',
defaultMessage: '{count} {count, plural, one {content type} other {content types}} selected'
}, {
count: value?.length
}),
disabled: isDisabled,
onChange: (values)=>{
onChange('contentTypes', values);
},
value: value,
placeholder: formatMessage({
id: 'Settings.review-workflows.workflow.contentTypes.placeholder',
defaultMessage: 'Select'
}),
children: [
...collectionTypes.length > 0 ? [
{
label: formatMessage({
id: 'Settings.review-workflows.workflow.contentTypes.collectionTypes.label',
defaultMessage: 'Collection Types'
}),
children: collectionTypes
}
] : [],
...singleTypes.length > 0 ? [
{
label: formatMessage({
id: 'Settings.review-workflows.workflow.contentTypes.singleTypes.label',
defaultMessage: 'Single Types'
}),
children: singleTypes
}
] : []
].map((opt)=>{
return /*#__PURE__*/ jsxRuntime.jsx(designSystem.MultiSelectGroup, {
label: opt.label,
values: opt.children.map((child)=>child.value.toString()),
children: opt.children.map((child)=>{
const { name: assignedWorkflowName } = workflows?.find((workflow)=>(currentWorkflow && workflow.id !== currentWorkflow.id || !currentWorkflow) && workflow.contentTypes.includes(child.value)) ?? {};
return /*#__PURE__*/ jsxRuntime.jsx(NestedOption, {
value: child.value,
children: /*#__PURE__*/ jsxRuntime.jsx(designSystem.Typography, {
children: // @ts-expect-error - formatMessage options doesn't expect to be a React component but that's what we need actually for the <i> and <em> components
formatMessage({
id: 'Settings.review-workflows.workflow.contentTypes.assigned.notice',
defaultMessage: '{label} {name, select, undefined {} other {<i>(assigned to <em>{name}</em> workflow)</i>}}'
}, {
label: child.label,
name: assignedWorkflowName,
em: (...children)=>/*#__PURE__*/ jsxRuntime.jsx(designSystem.Typography, {
tag: "em",
fontWeight: "bold",
children: children
}),
i: (...children)=>/*#__PURE__*/ jsxRuntime.jsx(ContentTypeTakeNotice, {
children: children
})
})
})
}, child.value);
})
}, opt.label);
})
})
]
});
};
const NestedOption = styledComponents.styled(designSystem.MultiSelectOption)`
padding-left: ${({ theme })=>theme.spaces[7]};
`;
const ContentTypeTakeNotice = styledComponents.styled(designSystem.Typography)`
font-style: italic;
`;
const StageSelector = ({ disabled })=>{
const { value: stages = [] } = strapiAdmin.useField('stages');
const { formatMessage } = reactIntl.useIntl();
const { error, value, onChange } = strapiAdmin.useField('stageRequiredToPublish');
// stages with empty names are not valid, so we avoid them from being used to avoid errors
const validStages = stages.filter((stage)=>stage.name);
return /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Field.Root, {
error: error,
name: "stageRequiredToPublish",
hint: formatMessage({
id: 'settings.review-workflows.workflow.stageRequiredToPublish.hint',
defaultMessage: 'Prevents entries from being published if they are not at the required stage.'
}),
children: [
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Field.Label, {
children: formatMessage({
id: 'settings.review-workflows.workflow.stageRequiredToPublish.label',
defaultMessage: 'Required stage for publishing'
})
}),
/*#__PURE__*/ jsxRuntime.jsxs(designSystem.SingleSelect, {
disabled: disabled,
onChange: (value)=>{
onChange('stageRequiredToPublish', value);
},
value: value,
children: [
/*#__PURE__*/ jsxRuntime.jsx(designSystem.SingleSelectOption, {
value: '',
children: formatMessage({
id: 'settings.review-workflows.workflow.stageRequiredToPublish.any',
defaultMessage: 'Any stage'
})
}),
validStages.map((stage, i)=>/*#__PURE__*/ jsxRuntime.jsx(designSystem.SingleSelectOption, {
value: stage.id?.toString() || stage.__temp_key__,
children: stage.name
}, `requiredToPublishStage-${stage.id || stage.__temp_key__}`))
]
}),
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Field.Hint, {})
]
});
};
exports.WorkflowAttributes = WorkflowAttributes;
//# sourceMappingURL=WorkflowAttributes.js.map
@@ -0,0 +1 @@
{"version":3,"file":"WorkflowAttributes.js","sources":["../../../../../admin/src/routes/settings/components/WorkflowAttributes.tsx"],"sourcesContent":["import { InputRenderer, useField, useForm } from '@strapi/admin/strapi-admin';\nimport {\n Field,\n Grid,\n MultiSelect,\n MultiSelectGroup,\n MultiSelectOption,\n Typography,\n useCollator,\n SingleSelect,\n SingleSelectOption,\n} from '@strapi/design-system';\nimport { useIntl } from 'react-intl';\nimport { styled } from 'styled-components';\n\nimport { useGetContentTypesQuery } from '../../../services/content-manager';\nimport { useReviewWorkflows } from '../hooks/useReviewWorkflows';\n\nimport type { WorkflowStage } from './Stages';\n\n/* -------------------------------------------------------------------------------------------------\n * WorkflowAttributes\n * -----------------------------------------------------------------------------------------------*/\ninterface WorkflowAttributesProps {\n canUpdate?: boolean;\n}\n\nconst WorkflowAttributes = ({ canUpdate = true }: WorkflowAttributesProps) => {\n const { formatMessage } = useIntl();\n\n return (\n <Grid.Root background=\"neutral0\" hasRadius gap={4} padding={6} shadow=\"tableShadow\">\n <Grid.Item col={6} direction=\"column\" alignItems=\"stretch\">\n <InputRenderer\n disabled={!canUpdate}\n label={formatMessage({\n id: 'Settings.review-workflows.workflow.name.label',\n defaultMessage: 'Workflow Name',\n })}\n name=\"name\"\n required\n type=\"string\"\n />\n </Grid.Item>\n <Grid.Item col={6} direction=\"column\" alignItems=\"stretch\">\n <ContentTypesSelector disabled={!canUpdate} />\n </Grid.Item>\n <Grid.Item col={6} direction=\"column\" alignItems=\"stretch\">\n <StageSelector disabled={!canUpdate} />\n </Grid.Item>\n </Grid.Root>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * ContentTypesSelector\n * -----------------------------------------------------------------------------------------------*/\ninterface ContentTypesSelectorProps {\n disabled?: boolean;\n}\n\nconst ContentTypesSelector = ({ disabled }: ContentTypesSelectorProps) => {\n const { formatMessage, locale } = useIntl();\n const { data: contentTypes, isLoading } = useGetContentTypesQuery();\n const { workflows } = useReviewWorkflows();\n const currentWorkflow = useForm('ContentTypesSelector', (state) => state.values);\n\n const { error, value, onChange } = useField('contentTypes');\n\n const formatter = useCollator(locale, {\n sensitivity: 'base',\n });\n\n const isDisabled =\n disabled ||\n isLoading ||\n !contentTypes ||\n (contentTypes.collectionType.length === 0 && contentTypes.singleType.length === 0);\n\n const collectionTypes = (contentTypes?.collectionType ?? [])\n .toSorted((a, b) => formatter.compare(a.info.displayName, b.info.displayName))\n .map((contentType) => ({\n label: contentType.info.displayName,\n value: contentType.uid,\n }));\n\n const singleTypes = (contentTypes?.singleType ?? []).map((contentType) => ({\n label: contentType.info.displayName,\n value: contentType.uid,\n }));\n\n return (\n <Field.Root error={error} name={'contentTypes'}>\n <Field.Label>\n {formatMessage({\n id: 'Settings.review-workflows.workflow.contentTypes.label',\n defaultMessage: 'Associated to',\n })}\n </Field.Label>\n <MultiSelect\n customizeContent={(value) =>\n formatMessage(\n {\n id: 'Settings.review-workflows.workflow.contentTypes.displayValue',\n defaultMessage:\n '{count} {count, plural, one {content type} other {content types}} selected',\n },\n { count: value?.length }\n )\n }\n disabled={isDisabled}\n onChange={(values) => {\n onChange('contentTypes', values);\n }}\n value={value}\n placeholder={formatMessage({\n id: 'Settings.review-workflows.workflow.contentTypes.placeholder',\n defaultMessage: 'Select',\n })}\n >\n {[\n ...(collectionTypes.length > 0\n ? [\n {\n label: formatMessage({\n id: 'Settings.review-workflows.workflow.contentTypes.collectionTypes.label',\n defaultMessage: 'Collection Types',\n }),\n children: collectionTypes,\n },\n ]\n : []),\n\n ...(singleTypes.length > 0\n ? [\n {\n label: formatMessage({\n id: 'Settings.review-workflows.workflow.contentTypes.singleTypes.label',\n defaultMessage: 'Single Types',\n }),\n childLine truncated
@@ -0,0 +1,201 @@
import { jsxs, jsx } from 'react/jsx-runtime';
import { InputRenderer, useForm, useField } from '@strapi/admin/strapi-admin';
import { MultiSelectOption, Typography, Grid, useCollator, Field, MultiSelect, MultiSelectGroup, SingleSelect, SingleSelectOption } from '@strapi/design-system';
import { useIntl } from 'react-intl';
import { styled } from 'styled-components';
import { useGetContentTypesQuery } from '../../../services/content-manager.mjs';
import { useReviewWorkflows } from '../hooks/useReviewWorkflows.mjs';
const WorkflowAttributes = ({ canUpdate = true })=>{
const { formatMessage } = useIntl();
return /*#__PURE__*/ jsxs(Grid.Root, {
background: "neutral0",
hasRadius: true,
gap: 4,
padding: 6,
shadow: "tableShadow",
children: [
/*#__PURE__*/ jsx(Grid.Item, {
col: 6,
direction: "column",
alignItems: "stretch",
children: /*#__PURE__*/ jsx(InputRenderer, {
disabled: !canUpdate,
label: formatMessage({
id: 'Settings.review-workflows.workflow.name.label',
defaultMessage: 'Workflow Name'
}),
name: "name",
required: true,
type: "string"
})
}),
/*#__PURE__*/ jsx(Grid.Item, {
col: 6,
direction: "column",
alignItems: "stretch",
children: /*#__PURE__*/ jsx(ContentTypesSelector, {
disabled: !canUpdate
})
}),
/*#__PURE__*/ jsx(Grid.Item, {
col: 6,
direction: "column",
alignItems: "stretch",
children: /*#__PURE__*/ jsx(StageSelector, {
disabled: !canUpdate
})
})
]
});
};
const ContentTypesSelector = ({ disabled })=>{
const { formatMessage, locale } = useIntl();
const { data: contentTypes, isLoading } = useGetContentTypesQuery();
const { workflows } = useReviewWorkflows();
const currentWorkflow = useForm('ContentTypesSelector', (state)=>state.values);
const { error, value, onChange } = useField('contentTypes');
const formatter = useCollator(locale, {
sensitivity: 'base'
});
const isDisabled = disabled || isLoading || !contentTypes || contentTypes.collectionType.length === 0 && contentTypes.singleType.length === 0;
const collectionTypes = (contentTypes?.collectionType ?? []).toSorted((a, b)=>formatter.compare(a.info.displayName, b.info.displayName)).map((contentType)=>({
label: contentType.info.displayName,
value: contentType.uid
}));
const singleTypes = (contentTypes?.singleType ?? []).map((contentType)=>({
label: contentType.info.displayName,
value: contentType.uid
}));
return /*#__PURE__*/ jsxs(Field.Root, {
error: error,
name: 'contentTypes',
children: [
/*#__PURE__*/ jsx(Field.Label, {
children: formatMessage({
id: 'Settings.review-workflows.workflow.contentTypes.label',
defaultMessage: 'Associated to'
})
}),
/*#__PURE__*/ jsx(MultiSelect, {
customizeContent: (value)=>formatMessage({
id: 'Settings.review-workflows.workflow.contentTypes.displayValue',
defaultMessage: '{count} {count, plural, one {content type} other {content types}} selected'
}, {
count: value?.length
}),
disabled: isDisabled,
onChange: (values)=>{
onChange('contentTypes', values);
},
value: value,
placeholder: formatMessage({
id: 'Settings.review-workflows.workflow.contentTypes.placeholder',
defaultMessage: 'Select'
}),
children: [
...collectionTypes.length > 0 ? [
{
label: formatMessage({
id: 'Settings.review-workflows.workflow.contentTypes.collectionTypes.label',
defaultMessage: 'Collection Types'
}),
children: collectionTypes
}
] : [],
...singleTypes.length > 0 ? [
{
label: formatMessage({
id: 'Settings.review-workflows.workflow.contentTypes.singleTypes.label',
defaultMessage: 'Single Types'
}),
children: singleTypes
}
] : []
].map((opt)=>{
return /*#__PURE__*/ jsx(MultiSelectGroup, {
label: opt.label,
values: opt.children.map((child)=>child.value.toString()),
children: opt.children.map((child)=>{
const { name: assignedWorkflowName } = workflows?.find((workflow)=>(currentWorkflow && workflow.id !== currentWorkflow.id || !currentWorkflow) && workflow.contentTypes.includes(child.value)) ?? {};
return /*#__PURE__*/ jsx(NestedOption, {
value: child.value,
children: /*#__PURE__*/ jsx(Typography, {
children: // @ts-expect-error - formatMessage options doesn't expect to be a React component but that's what we need actually for the <i> and <em> components
formatMessage({
id: 'Settings.review-workflows.workflow.contentTypes.assigned.notice',
defaultMessage: '{label} {name, select, undefined {} other {<i>(assigned to <em>{name}</em> workflow)</i>}}'
}, {
label: child.label,
name: assignedWorkflowName,
em: (...children)=>/*#__PURE__*/ jsx(Typography, {
tag: "em",
fontWeight: "bold",
children: children
}),
i: (...children)=>/*#__PURE__*/ jsx(ContentTypeTakeNotice, {
children: children
})
})
})
}, child.value);
})
}, opt.label);
})
})
]
});
};
const NestedOption = styled(MultiSelectOption)`
padding-left: ${({ theme })=>theme.spaces[7]};
`;
const ContentTypeTakeNotice = styled(Typography)`
font-style: italic;
`;
const StageSelector = ({ disabled })=>{
const { value: stages = [] } = useField('stages');
const { formatMessage } = useIntl();
const { error, value, onChange } = useField('stageRequiredToPublish');
// stages with empty names are not valid, so we avoid them from being used to avoid errors
const validStages = stages.filter((stage)=>stage.name);
return /*#__PURE__*/ jsxs(Field.Root, {
error: error,
name: "stageRequiredToPublish",
hint: formatMessage({
id: 'settings.review-workflows.workflow.stageRequiredToPublish.hint',
defaultMessage: 'Prevents entries from being published if they are not at the required stage.'
}),
children: [
/*#__PURE__*/ jsx(Field.Label, {
children: formatMessage({
id: 'settings.review-workflows.workflow.stageRequiredToPublish.label',
defaultMessage: 'Required stage for publishing'
})
}),
/*#__PURE__*/ jsxs(SingleSelect, {
disabled: disabled,
onChange: (value)=>{
onChange('stageRequiredToPublish', value);
},
value: value,
children: [
/*#__PURE__*/ jsx(SingleSelectOption, {
value: '',
children: formatMessage({
id: 'settings.review-workflows.workflow.stageRequiredToPublish.any',
defaultMessage: 'Any stage'
})
}),
validStages.map((stage, i)=>/*#__PURE__*/ jsx(SingleSelectOption, {
value: stage.id?.toString() || stage.__temp_key__,
children: stage.name
}, `requiredToPublishStage-${stage.id || stage.__temp_key__}`))
]
}),
/*#__PURE__*/ jsx(Field.Hint, {})
]
});
};
export { WorkflowAttributes };
//# sourceMappingURL=WorkflowAttributes.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"WorkflowAttributes.mjs","sources":["../../../../../admin/src/routes/settings/components/WorkflowAttributes.tsx"],"sourcesContent":["import { InputRenderer, useField, useForm } from '@strapi/admin/strapi-admin';\nimport {\n Field,\n Grid,\n MultiSelect,\n MultiSelectGroup,\n MultiSelectOption,\n Typography,\n useCollator,\n SingleSelect,\n SingleSelectOption,\n} from '@strapi/design-system';\nimport { useIntl } from 'react-intl';\nimport { styled } from 'styled-components';\n\nimport { useGetContentTypesQuery } from '../../../services/content-manager';\nimport { useReviewWorkflows } from '../hooks/useReviewWorkflows';\n\nimport type { WorkflowStage } from './Stages';\n\n/* -------------------------------------------------------------------------------------------------\n * WorkflowAttributes\n * -----------------------------------------------------------------------------------------------*/\ninterface WorkflowAttributesProps {\n canUpdate?: boolean;\n}\n\nconst WorkflowAttributes = ({ canUpdate = true }: WorkflowAttributesProps) => {\n const { formatMessage } = useIntl();\n\n return (\n <Grid.Root background=\"neutral0\" hasRadius gap={4} padding={6} shadow=\"tableShadow\">\n <Grid.Item col={6} direction=\"column\" alignItems=\"stretch\">\n <InputRenderer\n disabled={!canUpdate}\n label={formatMessage({\n id: 'Settings.review-workflows.workflow.name.label',\n defaultMessage: 'Workflow Name',\n })}\n name=\"name\"\n required\n type=\"string\"\n />\n </Grid.Item>\n <Grid.Item col={6} direction=\"column\" alignItems=\"stretch\">\n <ContentTypesSelector disabled={!canUpdate} />\n </Grid.Item>\n <Grid.Item col={6} direction=\"column\" alignItems=\"stretch\">\n <StageSelector disabled={!canUpdate} />\n </Grid.Item>\n </Grid.Root>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * ContentTypesSelector\n * -----------------------------------------------------------------------------------------------*/\ninterface ContentTypesSelectorProps {\n disabled?: boolean;\n}\n\nconst ContentTypesSelector = ({ disabled }: ContentTypesSelectorProps) => {\n const { formatMessage, locale } = useIntl();\n const { data: contentTypes, isLoading } = useGetContentTypesQuery();\n const { workflows } = useReviewWorkflows();\n const currentWorkflow = useForm('ContentTypesSelector', (state) => state.values);\n\n const { error, value, onChange } = useField('contentTypes');\n\n const formatter = useCollator(locale, {\n sensitivity: 'base',\n });\n\n const isDisabled =\n disabled ||\n isLoading ||\n !contentTypes ||\n (contentTypes.collectionType.length === 0 && contentTypes.singleType.length === 0);\n\n const collectionTypes = (contentTypes?.collectionType ?? [])\n .toSorted((a, b) => formatter.compare(a.info.displayName, b.info.displayName))\n .map((contentType) => ({\n label: contentType.info.displayName,\n value: contentType.uid,\n }));\n\n const singleTypes = (contentTypes?.singleType ?? []).map((contentType) => ({\n label: contentType.info.displayName,\n value: contentType.uid,\n }));\n\n return (\n <Field.Root error={error} name={'contentTypes'}>\n <Field.Label>\n {formatMessage({\n id: 'Settings.review-workflows.workflow.contentTypes.label',\n defaultMessage: 'Associated to',\n })}\n </Field.Label>\n <MultiSelect\n customizeContent={(value) =>\n formatMessage(\n {\n id: 'Settings.review-workflows.workflow.contentTypes.displayValue',\n defaultMessage:\n '{count} {count, plural, one {content type} other {content types}} selected',\n },\n { count: value?.length }\n )\n }\n disabled={isDisabled}\n onChange={(values) => {\n onChange('contentTypes', values);\n }}\n value={value}\n placeholder={formatMessage({\n id: 'Settings.review-workflows.workflow.contentTypes.placeholder',\n defaultMessage: 'Select',\n })}\n >\n {[\n ...(collectionTypes.length > 0\n ? [\n {\n label: formatMessage({\n id: 'Settings.review-workflows.workflow.contentTypes.collectionTypes.label',\n defaultMessage: 'Collection Types',\n }),\n children: collectionTypes,\n },\n ]\n : []),\n\n ...(singleTypes.length > 0\n ? [\n {\n label: formatMessage({\n id: 'Settings.review-workflows.workflow.contentTypes.singleTypes.label',\n defaultMessage: 'Single Types',\n }),\n chilLine truncated
@@ -0,0 +1,8 @@
'use strict';
const DRAG_DROP_TYPES = {
STAGE: 'stage'
};
exports.DRAG_DROP_TYPES = DRAG_DROP_TYPES;
//# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
{"version":3,"file":"constants.js","sources":["../../../../admin/src/routes/settings/constants.ts"],"sourcesContent":["export type DragDropTypes = 'stage';\n\nexport const DRAG_DROP_TYPES: Record<Uppercase<DragDropTypes>, DragDropTypes> = {\n STAGE: 'stage',\n};\n"],"names":["DRAG_DROP_TYPES","STAGE"],"mappings":";;MAEaA,eAAmE,GAAA;IAC9EC,KAAO,EAAA;AACT;;;;"}
@@ -0,0 +1,6 @@
const DRAG_DROP_TYPES = {
STAGE: 'stage'
};
export { DRAG_DROP_TYPES };
//# sourceMappingURL=constants.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"constants.mjs","sources":["../../../../admin/src/routes/settings/constants.ts"],"sourcesContent":["export type DragDropTypes = 'stage';\n\nexport const DRAG_DROP_TYPES: Record<Uppercase<DragDropTypes>, DragDropTypes> = {\n STAGE: 'stage',\n};\n"],"names":["DRAG_DROP_TYPES","STAGE"],"mappings":"MAEaA,eAAmE,GAAA;IAC9EC,KAAO,EAAA;AACT;;;;"}
@@ -0,0 +1,193 @@
'use strict';
var React = require('react');
var reactDnd = require('react-dnd');
var useKeyboardDragAndDrop = require('./useKeyboardDragAndDrop.js');
function _interopNamespaceDefault(e) {
var n = Object.create(null);
if (e) {
Object.keys(e).forEach(function (k) {
if (k !== 'default') {
var d = Object.getOwnPropertyDescriptor(e, k);
Object.defineProperty(n, k, d.get ? d : {
enumerable: true,
get: function () { return e[k]; }
});
}
});
}
n.default = e;
return Object.freeze(n);
}
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
const DIRECTIONS = {
UPWARD: 'upward',
DOWNWARD: 'downward'
};
const DROP_SENSITIVITY = {
REGULAR: 'regular',
IMMEDIATE: 'immediate'
};
/**
* A utility hook abstracting the general drag and drop hooks from react-dnd.
* Centralising the same behaviours and by default offering keyboard support.
*/ const useDragAndDrop = (active, { type = 'STRAPI_DND', index, item, onStart, onEnd, onGrabItem, onDropItem, onCancel, onMoveItem, dropSensitivity = DROP_SENSITIVITY.REGULAR })=>{
const objectRef = React__namespace.useRef(null);
const [{ handlerId, isOver }, dropRef] = reactDnd.useDrop({
accept: type,
collect (monitor) {
return {
handlerId: monitor.getHandlerId(),
isOver: monitor.isOver({
shallow: true
})
};
},
drop (item) {
const draggedIndex = item.index;
const newIndex = index;
if (isOver && onDropItem) {
onDropItem(draggedIndex, newIndex);
}
},
hover (item, monitor) {
if (!objectRef.current || !onMoveItem) {
return;
}
const dragIndex = item.index;
const newIndex = index;
const hoverBoundingRect = objectRef.current?.getBoundingClientRect();
const hoverMiddleY = (hoverBoundingRect.bottom - hoverBoundingRect.top) / 2;
const clientOffset = monitor.getClientOffset();
if (!clientOffset) return;
const hoverClientY = clientOffset && clientOffset.y - hoverBoundingRect.top;
if (typeof dragIndex === 'number' && typeof newIndex === 'number') {
if (dragIndex === newIndex) {
// Don't replace items with themselves
return;
}
if (dropSensitivity === DROP_SENSITIVITY.REGULAR) {
// Dragging downwards
if (dragIndex < newIndex && hoverClientY < hoverMiddleY) {
return;
}
// Dragging upwards
if (dragIndex > newIndex && hoverClientY > hoverMiddleY) {
return;
}
}
// Time to actually perform the action
onMoveItem(newIndex, dragIndex);
item.index = newIndex;
} else {
// Using numbers as indices doesn't work for nested list items with path like [1, 1, 0]
if (Array.isArray(dragIndex) && Array.isArray(newIndex)) {
// Indices comparison to find item position in nested list
const minLength = Math.min(dragIndex.length, newIndex.length);
let areEqual = true;
let isLessThan = false;
let isGreaterThan = false;
for(let i = 0; i < minLength; i++){
if (dragIndex[i] < newIndex[i]) {
isLessThan = true;
areEqual = false;
break;
} else if (dragIndex[i] > newIndex[i]) {
isGreaterThan = true;
areEqual = false;
break;
}
}
// Don't replace items with themselves
if (areEqual && dragIndex.length === newIndex.length) {
return;
}
if (dropSensitivity === DROP_SENSITIVITY.REGULAR) {
// Dragging downwards
if (isLessThan && !isGreaterThan && hoverClientY < hoverMiddleY) {
return;
}
// Dragging upwards
if (isGreaterThan && !isLessThan && hoverClientY > hoverMiddleY) {
return;
}
}
}
onMoveItem(newIndex, dragIndex);
item.index = newIndex;
}
}
});
const getDragDirection = (monitor)=>{
if (monitor && monitor.isDragging() && !monitor.didDrop() && monitor.getInitialClientOffset() && monitor.getClientOffset()) {
const deltaY = monitor.getInitialClientOffset().y - monitor.getClientOffset().y;
if (deltaY > 0) return DIRECTIONS.UPWARD;
if (deltaY < 0) return DIRECTIONS.DOWNWARD;
return null;
}
return null;
};
const [{ isDragging, direction }, dragRef, dragPreviewRef] = reactDnd.useDrag({
type,
item () {
if (onStart) {
onStart();
}
/**
* This will be attached and it helps define the preview sizes
* when a component is flexy e.g. Relations
*/ const { width } = objectRef.current?.getBoundingClientRect() ?? {};
return {
index,
width,
...item
};
},
end () {
if (onEnd) {
onEnd();
}
},
canDrag: active,
/**
* This is useful when the item is in a virtualized list.
* However, if we don't have an ID then we want the libraries
* defaults to take care of this.
*/ isDragging: item?.id ? (monitor)=>{
return item.id === monitor.getItem().id;
} : undefined,
collect: (monitor)=>({
isDragging: monitor.isDragging(),
initialOffset: monitor.getInitialClientOffset(),
currentOffset: monitor.getClientOffset(),
direction: getDragDirection(monitor)
})
});
const handleKeyDown = useKeyboardDragAndDrop.useKeyboardDragAndDrop(active, index, {
onGrabItem,
onDropItem,
onCancel,
onMoveItem
});
return [
{
handlerId,
isDragging,
handleKeyDown,
isOverDropTarget: isOver,
direction
},
objectRef,
dropRef,
dragRef,
dragPreviewRef
];
};
exports.DIRECTIONS = DIRECTIONS;
exports.DROP_SENSITIVITY = DROP_SENSITIVITY;
exports.useDragAndDrop = useDragAndDrop;
//# sourceMappingURL=useDragAndDrop.js.map
@@ -0,0 +1 @@
{"version":3,"file":"useDragAndDrop.js","sources":["../../../../../admin/src/routes/settings/hooks/useDragAndDrop.ts"],"sourcesContent":["import * as React from 'react';\n\nimport {\n useDrag,\n useDrop,\n type HandlerManager,\n type ConnectDragSource,\n type ConnectDropTarget,\n type ConnectDragPreview,\n type DragSourceMonitor,\n} from 'react-dnd';\n\nimport {\n useKeyboardDragAndDrop,\n type UseKeyboardDragAndDropCallbacks,\n} from './useKeyboardDragAndDrop';\n\nimport type { Data } from '@strapi/types';\n\nconst DIRECTIONS = {\n UPWARD: 'upward',\n DOWNWARD: 'downward',\n} as const;\n\nconst DROP_SENSITIVITY = {\n REGULAR: 'regular',\n IMMEDIATE: 'immediate',\n} as const;\n\ninterface UseDragAndDropOptions<\n TIndex extends number | Array<number> = number,\n TItem extends { index: TIndex } = { index: TIndex },\n> extends UseKeyboardDragAndDropCallbacks<TIndex> {\n type?: string;\n index: TIndex;\n item?: TItem;\n onStart?: () => void;\n onEnd?: () => void;\n dropSensitivity?: (typeof DROP_SENSITIVITY)[keyof typeof DROP_SENSITIVITY];\n}\n\ntype Identifier = ReturnType<HandlerManager['getHandlerId']>;\n\ntype UseDragAndDropReturn<E extends Element = HTMLElement> = [\n props: {\n handlerId: Identifier;\n isDragging: boolean;\n handleKeyDown: <E extends Element>(event: React.KeyboardEvent<E>) => void;\n isOverDropTarget: boolean;\n direction: (typeof DIRECTIONS)[keyof typeof DIRECTIONS] | null;\n },\n objectRef: React.RefObject<E>,\n dropRef: ConnectDropTarget,\n dragRef: ConnectDragSource,\n dragPreviewRef: ConnectDragPreview,\n];\n\ntype DropCollectedProps = {\n handlerId: Identifier;\n isOver: boolean;\n};\n\n/**\n * A utility hook abstracting the general drag and drop hooks from react-dnd.\n * Centralising the same behaviours and by default offering keyboard support.\n */\nconst useDragAndDrop = <\n TIndex extends number | Array<number>,\n TItem extends { index: TIndex; id?: Data.ID; [key: string]: unknown } = {\n index: TIndex;\n [key: string]: unknown;\n },\n E extends Element = HTMLElement,\n>(\n active: boolean,\n {\n type = 'STRAPI_DND',\n index,\n item,\n onStart,\n onEnd,\n onGrabItem,\n onDropItem,\n onCancel,\n onMoveItem,\n dropSensitivity = DROP_SENSITIVITY.REGULAR,\n }: UseDragAndDropOptions<TIndex, TItem>\n): UseDragAndDropReturn<E> => {\n const objectRef = React.useRef<E>(null);\n\n const [{ handlerId, isOver }, dropRef] = useDrop<TItem, void, DropCollectedProps>({\n accept: type,\n collect(monitor) {\n return {\n handlerId: monitor.getHandlerId(),\n isOver: monitor.isOver({ shallow: true }),\n };\n },\n drop(item) {\n const draggedIndex = item.index;\n const newIndex = index;\n\n if (isOver && onDropItem) {\n onDropItem(draggedIndex, newIndex);\n }\n },\n hover(item, monitor) {\n if (!objectRef.current || !onMoveItem) {\n return;\n }\n\n const dragIndex = item.index;\n const newIndex = index;\n\n const hoverBoundingRect = objectRef.current?.getBoundingClientRect();\n const hoverMiddleY = (hoverBoundingRect.bottom - hoverBoundingRect.top) / 2;\n const clientOffset = monitor.getClientOffset();\n if (!clientOffset) return;\n\n const hoverClientY = clientOffset && clientOffset.y - hoverBoundingRect.top;\n if (typeof dragIndex === 'number' && typeof newIndex === 'number') {\n if (dragIndex === newIndex) {\n // Don't replace items with themselves\n return;\n }\n\n if (dropSensitivity === DROP_SENSITIVITY.REGULAR) {\n // Dragging downwards\n if (dragIndex < newIndex && hoverClientY < hoverMiddleY) {\n return;\n }\n\n // Dragging upwards\n if (dragIndex > newIndex && hoverClientY > hoverMiddleY) {\n return;\n }\n }\n\n // Time to actually perform the action\n onMoveItem(newIndex, dragIndex);\n item.index = newIndex;\n } else {\n // Using numbers as indices doesn't work for nested list items with path like [1, 1, 0]\n if (Array.isArray(dragIndex) && Array.isArray(newIndex)) {\n // Indices comparison to find item position in nested list\n const minLength = Math.min(dragIndex.length, newIndex.length);\n let areEqual = true;\n let isLessThan = false;\n let isGreaterThan = false;\n\n for (let i = 0; i < minLength; i++) {\n if (dragIndex[i] < newIndex[i]) {\n isLessThan = true;\n areEqual = false;\n break;\n } else if (dragIndex[i] > newIndex[i]) {\n isGreaterThan = true;\n areEqual = false;\n break;\n }\n }\n\n // Don't replace items with themselves\n if (areEqual && dragIndex.length === newIndex.length) {\n return;\n }\n\Line truncated
@@ -0,0 +1,170 @@
import * as React from 'react';
import { useDrop, useDrag } from 'react-dnd';
import { useKeyboardDragAndDrop } from './useKeyboardDragAndDrop.mjs';
const DIRECTIONS = {
UPWARD: 'upward',
DOWNWARD: 'downward'
};
const DROP_SENSITIVITY = {
REGULAR: 'regular',
IMMEDIATE: 'immediate'
};
/**
* A utility hook abstracting the general drag and drop hooks from react-dnd.
* Centralising the same behaviours and by default offering keyboard support.
*/ const useDragAndDrop = (active, { type = 'STRAPI_DND', index, item, onStart, onEnd, onGrabItem, onDropItem, onCancel, onMoveItem, dropSensitivity = DROP_SENSITIVITY.REGULAR })=>{
const objectRef = React.useRef(null);
const [{ handlerId, isOver }, dropRef] = useDrop({
accept: type,
collect (monitor) {
return {
handlerId: monitor.getHandlerId(),
isOver: monitor.isOver({
shallow: true
})
};
},
drop (item) {
const draggedIndex = item.index;
const newIndex = index;
if (isOver && onDropItem) {
onDropItem(draggedIndex, newIndex);
}
},
hover (item, monitor) {
if (!objectRef.current || !onMoveItem) {
return;
}
const dragIndex = item.index;
const newIndex = index;
const hoverBoundingRect = objectRef.current?.getBoundingClientRect();
const hoverMiddleY = (hoverBoundingRect.bottom - hoverBoundingRect.top) / 2;
const clientOffset = monitor.getClientOffset();
if (!clientOffset) return;
const hoverClientY = clientOffset && clientOffset.y - hoverBoundingRect.top;
if (typeof dragIndex === 'number' && typeof newIndex === 'number') {
if (dragIndex === newIndex) {
// Don't replace items with themselves
return;
}
if (dropSensitivity === DROP_SENSITIVITY.REGULAR) {
// Dragging downwards
if (dragIndex < newIndex && hoverClientY < hoverMiddleY) {
return;
}
// Dragging upwards
if (dragIndex > newIndex && hoverClientY > hoverMiddleY) {
return;
}
}
// Time to actually perform the action
onMoveItem(newIndex, dragIndex);
item.index = newIndex;
} else {
// Using numbers as indices doesn't work for nested list items with path like [1, 1, 0]
if (Array.isArray(dragIndex) && Array.isArray(newIndex)) {
// Indices comparison to find item position in nested list
const minLength = Math.min(dragIndex.length, newIndex.length);
let areEqual = true;
let isLessThan = false;
let isGreaterThan = false;
for(let i = 0; i < minLength; i++){
if (dragIndex[i] < newIndex[i]) {
isLessThan = true;
areEqual = false;
break;
} else if (dragIndex[i] > newIndex[i]) {
isGreaterThan = true;
areEqual = false;
break;
}
}
// Don't replace items with themselves
if (areEqual && dragIndex.length === newIndex.length) {
return;
}
if (dropSensitivity === DROP_SENSITIVITY.REGULAR) {
// Dragging downwards
if (isLessThan && !isGreaterThan && hoverClientY < hoverMiddleY) {
return;
}
// Dragging upwards
if (isGreaterThan && !isLessThan && hoverClientY > hoverMiddleY) {
return;
}
}
}
onMoveItem(newIndex, dragIndex);
item.index = newIndex;
}
}
});
const getDragDirection = (monitor)=>{
if (monitor && monitor.isDragging() && !monitor.didDrop() && monitor.getInitialClientOffset() && monitor.getClientOffset()) {
const deltaY = monitor.getInitialClientOffset().y - monitor.getClientOffset().y;
if (deltaY > 0) return DIRECTIONS.UPWARD;
if (deltaY < 0) return DIRECTIONS.DOWNWARD;
return null;
}
return null;
};
const [{ isDragging, direction }, dragRef, dragPreviewRef] = useDrag({
type,
item () {
if (onStart) {
onStart();
}
/**
* This will be attached and it helps define the preview sizes
* when a component is flexy e.g. Relations
*/ const { width } = objectRef.current?.getBoundingClientRect() ?? {};
return {
index,
width,
...item
};
},
end () {
if (onEnd) {
onEnd();
}
},
canDrag: active,
/**
* This is useful when the item is in a virtualized list.
* However, if we don't have an ID then we want the libraries
* defaults to take care of this.
*/ isDragging: item?.id ? (monitor)=>{
return item.id === monitor.getItem().id;
} : undefined,
collect: (monitor)=>({
isDragging: monitor.isDragging(),
initialOffset: monitor.getInitialClientOffset(),
currentOffset: monitor.getClientOffset(),
direction: getDragDirection(monitor)
})
});
const handleKeyDown = useKeyboardDragAndDrop(active, index, {
onGrabItem,
onDropItem,
onCancel,
onMoveItem
});
return [
{
handlerId,
isDragging,
handleKeyDown,
isOverDropTarget: isOver,
direction
},
objectRef,
dropRef,
dragRef,
dragPreviewRef
];
};
export { DIRECTIONS, DROP_SENSITIVITY, useDragAndDrop };
//# sourceMappingURL=useDragAndDrop.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"useDragAndDrop.mjs","sources":["../../../../../admin/src/routes/settings/hooks/useDragAndDrop.ts"],"sourcesContent":["import * as React from 'react';\n\nimport {\n useDrag,\n useDrop,\n type HandlerManager,\n type ConnectDragSource,\n type ConnectDropTarget,\n type ConnectDragPreview,\n type DragSourceMonitor,\n} from 'react-dnd';\n\nimport {\n useKeyboardDragAndDrop,\n type UseKeyboardDragAndDropCallbacks,\n} from './useKeyboardDragAndDrop';\n\nimport type { Data } from '@strapi/types';\n\nconst DIRECTIONS = {\n UPWARD: 'upward',\n DOWNWARD: 'downward',\n} as const;\n\nconst DROP_SENSITIVITY = {\n REGULAR: 'regular',\n IMMEDIATE: 'immediate',\n} as const;\n\ninterface UseDragAndDropOptions<\n TIndex extends number | Array<number> = number,\n TItem extends { index: TIndex } = { index: TIndex },\n> extends UseKeyboardDragAndDropCallbacks<TIndex> {\n type?: string;\n index: TIndex;\n item?: TItem;\n onStart?: () => void;\n onEnd?: () => void;\n dropSensitivity?: (typeof DROP_SENSITIVITY)[keyof typeof DROP_SENSITIVITY];\n}\n\ntype Identifier = ReturnType<HandlerManager['getHandlerId']>;\n\ntype UseDragAndDropReturn<E extends Element = HTMLElement> = [\n props: {\n handlerId: Identifier;\n isDragging: boolean;\n handleKeyDown: <E extends Element>(event: React.KeyboardEvent<E>) => void;\n isOverDropTarget: boolean;\n direction: (typeof DIRECTIONS)[keyof typeof DIRECTIONS] | null;\n },\n objectRef: React.RefObject<E>,\n dropRef: ConnectDropTarget,\n dragRef: ConnectDragSource,\n dragPreviewRef: ConnectDragPreview,\n];\n\ntype DropCollectedProps = {\n handlerId: Identifier;\n isOver: boolean;\n};\n\n/**\n * A utility hook abstracting the general drag and drop hooks from react-dnd.\n * Centralising the same behaviours and by default offering keyboard support.\n */\nconst useDragAndDrop = <\n TIndex extends number | Array<number>,\n TItem extends { index: TIndex; id?: Data.ID; [key: string]: unknown } = {\n index: TIndex;\n [key: string]: unknown;\n },\n E extends Element = HTMLElement,\n>(\n active: boolean,\n {\n type = 'STRAPI_DND',\n index,\n item,\n onStart,\n onEnd,\n onGrabItem,\n onDropItem,\n onCancel,\n onMoveItem,\n dropSensitivity = DROP_SENSITIVITY.REGULAR,\n }: UseDragAndDropOptions<TIndex, TItem>\n): UseDragAndDropReturn<E> => {\n const objectRef = React.useRef<E>(null);\n\n const [{ handlerId, isOver }, dropRef] = useDrop<TItem, void, DropCollectedProps>({\n accept: type,\n collect(monitor) {\n return {\n handlerId: monitor.getHandlerId(),\n isOver: monitor.isOver({ shallow: true }),\n };\n },\n drop(item) {\n const draggedIndex = item.index;\n const newIndex = index;\n\n if (isOver && onDropItem) {\n onDropItem(draggedIndex, newIndex);\n }\n },\n hover(item, monitor) {\n if (!objectRef.current || !onMoveItem) {\n return;\n }\n\n const dragIndex = item.index;\n const newIndex = index;\n\n const hoverBoundingRect = objectRef.current?.getBoundingClientRect();\n const hoverMiddleY = (hoverBoundingRect.bottom - hoverBoundingRect.top) / 2;\n const clientOffset = monitor.getClientOffset();\n if (!clientOffset) return;\n\n const hoverClientY = clientOffset && clientOffset.y - hoverBoundingRect.top;\n if (typeof dragIndex === 'number' && typeof newIndex === 'number') {\n if (dragIndex === newIndex) {\n // Don't replace items with themselves\n return;\n }\n\n if (dropSensitivity === DROP_SENSITIVITY.REGULAR) {\n // Dragging downwards\n if (dragIndex < newIndex && hoverClientY < hoverMiddleY) {\n return;\n }\n\n // Dragging upwards\n if (dragIndex > newIndex && hoverClientY > hoverMiddleY) {\n return;\n }\n }\n\n // Time to actually perform the action\n onMoveItem(newIndex, dragIndex);\n item.index = newIndex;\n } else {\n // Using numbers as indices doesn't work for nested list items with path like [1, 1, 0]\n if (Array.isArray(dragIndex) && Array.isArray(newIndex)) {\n // Indices comparison to find item position in nested list\n const minLength = Math.min(dragIndex.length, newIndex.length);\n let areEqual = true;\n let isLessThan = false;\n let isGreaterThan = false;\n\n for (let i = 0; i < minLength; i++) {\n if (dragIndex[i] < newIndex[i]) {\n isLessThan = true;\n areEqual = false;\n break;\n } else if (dragIndex[i] > newIndex[i]) {\n isGreaterThan = true;\n areEqual = false;\n break;\n }\n }\n\n // Don't replace items with themselves\n if (areEqual && dragIndex.length === newIndex.length) {\n return;\n }\nLine truncated
@@ -0,0 +1,94 @@
'use strict';
var React = require('react');
function _interopNamespaceDefault(e) {
var n = Object.create(null);
if (e) {
Object.keys(e).forEach(function (k) {
if (k !== 'default') {
var d = Object.getOwnPropertyDescriptor(e, k);
Object.defineProperty(n, k, d.get ? d : {
enumerable: true,
get: function () { return e[k]; }
});
}
});
}
n.default = e;
return Object.freeze(n);
}
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
/**
* Utility hook designed to implement keyboard accessibile drag and drop by
* returning an onKeyDown handler to be passed to the drag icon button.
*
* @internal - You should use `useDragAndDrop` instead.
*/ const useKeyboardDragAndDrop = (active, index, { onCancel, onDropItem, onGrabItem, onMoveItem })=>{
const [isSelected, setIsSelected] = React__namespace.useState(false);
const handleMove = (movement)=>{
if (!isSelected) {
return;
}
if (typeof index === 'number' && onMoveItem) {
if (movement === 'UP') {
onMoveItem(index - 1, index);
} else if (movement === 'DOWN') {
onMoveItem(index + 1, index);
}
}
};
const handleDragClick = ()=>{
if (isSelected) {
if (onDropItem) {
onDropItem(index);
}
setIsSelected(false);
} else {
if (onGrabItem) {
onGrabItem(index);
}
setIsSelected(true);
}
};
const handleCancel = ()=>{
if (isSelected) {
setIsSelected(false);
if (onCancel) {
onCancel(index);
}
}
};
const handleKeyDown = (e)=>{
if (!active) {
return;
}
if (e.key === 'Tab' && !isSelected) {
return;
}
e.preventDefault();
switch(e.key){
case ' ':
case 'Enter':
handleDragClick();
break;
case 'Escape':
handleCancel();
break;
case 'ArrowDown':
case 'ArrowRight':
handleMove('DOWN');
break;
case 'ArrowUp':
case 'ArrowLeft':
handleMove('UP');
break;
}
};
return handleKeyDown;
};
exports.useKeyboardDragAndDrop = useKeyboardDragAndDrop;
//# sourceMappingURL=useKeyboardDragAndDrop.js.map
@@ -0,0 +1 @@
{"version":3,"file":"useKeyboardDragAndDrop.js","sources":["../../../../../admin/src/routes/settings/hooks/useKeyboardDragAndDrop.ts"],"sourcesContent":["import * as React from 'react';\n\nexport type UseKeyboardDragAndDropCallbacks<TIndex extends number | Array<number> = number> = {\n onCancel?: (index: TIndex) => void;\n onDropItem?: (currentIndex: TIndex, newIndex?: TIndex) => void;\n onGrabItem?: (index: TIndex) => void;\n onMoveItem?: (newIndex: TIndex, currentIndex: TIndex) => void;\n};\n\n/**\n * Utility hook designed to implement keyboard accessibile drag and drop by\n * returning an onKeyDown handler to be passed to the drag icon button.\n *\n * @internal - You should use `useDragAndDrop` instead.\n */\nexport const useKeyboardDragAndDrop = <TIndex extends number | Array<number> = number>(\n active: boolean,\n index: TIndex,\n { onCancel, onDropItem, onGrabItem, onMoveItem }: UseKeyboardDragAndDropCallbacks<TIndex>\n) => {\n const [isSelected, setIsSelected] = React.useState(false);\n\n const handleMove = (movement: 'UP' | 'DOWN') => {\n if (!isSelected) {\n return;\n }\n if (typeof index === 'number' && onMoveItem) {\n if (movement === 'UP') {\n onMoveItem((index - 1) as TIndex, index);\n } else if (movement === 'DOWN') {\n onMoveItem((index + 1) as TIndex, index);\n }\n }\n };\n\n const handleDragClick = () => {\n if (isSelected) {\n if (onDropItem) {\n onDropItem(index);\n }\n setIsSelected(false);\n } else {\n if (onGrabItem) {\n onGrabItem(index);\n }\n setIsSelected(true);\n }\n };\n\n const handleCancel = () => {\n if (isSelected) {\n setIsSelected(false);\n\n if (onCancel) {\n onCancel(index);\n }\n }\n };\n\n const handleKeyDown = <E extends Element>(e: React.KeyboardEvent<E>) => {\n if (!active) {\n return;\n }\n\n if (e.key === 'Tab' && !isSelected) {\n return;\n }\n\n e.preventDefault();\n\n switch (e.key) {\n case ' ':\n case 'Enter':\n handleDragClick();\n break;\n\n case 'Escape':\n handleCancel();\n break;\n\n case 'ArrowDown':\n case 'ArrowRight':\n handleMove('DOWN');\n break;\n\n case 'ArrowUp':\n case 'ArrowLeft':\n handleMove('UP');\n break;\n\n default:\n }\n };\n\n return handleKeyDown;\n};\n"],"names":["useKeyboardDragAndDrop","active","index","onCancel","onDropItem","onGrabItem","onMoveItem","isSelected","setIsSelected","React","useState","handleMove","movement","handleDragClick","handleCancel","handleKeyDown","e","key","preventDefault"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AASA;;;;;AAKC,IACM,MAAMA,sBAAyB,GAAA,CACpCC,QACAC,KACA,EAAA,EAAEC,QAAQ,EAAEC,UAAU,EAAEC,UAAU,EAAEC,UAAU,EAA2C,GAAA;AAEzF,IAAA,MAAM,CAACC,UAAYC,EAAAA,aAAAA,CAAc,GAAGC,gBAAAA,CAAMC,QAAQ,CAAC,KAAA,CAAA;AAEnD,IAAA,MAAMC,aAAa,CAACC,QAAAA,GAAAA;AAClB,QAAA,IAAI,CAACL,UAAY,EAAA;AACf,YAAA;AACF;QACA,IAAI,OAAOL,KAAU,KAAA,QAAA,IAAYI,UAAY,EAAA;AAC3C,YAAA,IAAIM,aAAa,IAAM,EAAA;AACrBN,gBAAAA,UAAAA,CAAYJ,QAAQ,CAAcA,EAAAA,KAAAA,CAAAA;aAC7B,MAAA,IAAIU,aAAa,MAAQ,EAAA;AAC9BN,gBAAAA,UAAAA,CAAYJ,QAAQ,CAAcA,EAAAA,KAAAA,CAAAA;AACpC;AACF;AACF,KAAA;AAEA,IAAA,MAAMW,eAAkB,GAAA,IAAA;AACtB,QAAA,IAAIN,UAAY,EAAA;AACd,YAAA,IAAIH,UAAY,EAAA;gBACdA,UAAWF,CAAAA,KAAAA,CAAAA;AACb;YACAM,aAAc,CAAA,KAAA,CAAA;SACT,MAAA;AACL,YAAA,IAAIH,UAAY,EAAA;gBACdA,UAAWH,CAAAA,KAAAA,CAAAA;AACb;YACAM,aAAc,CAAA,IAAA,CAAA;AAChB;AACF,KAAA;AAEA,IAAA,MAAMM,YAAe,GAAA,IAAA;AACnB,QAAA,IAAIP,UAAY,EAAA;YACdC,aAAc,CAAA,KAAA,CAAA;AAEd,YAAA,IAAIL,QAAU,EAAA;gBACZA,QAASD,CAAAA,KAAAA,CAAAA;AACX;AACF;AACF,KAAA;AAEA,IAAA,MAAMa,gBAAgB,CAAoBC,CAAAA,GAAAA;AACxC,QAAA,IAAI,CAACf,MAAQ,EAAA;AACX,YAAA;AACF;AAEA,QAAA,IAAIe,CAAEC,CAAAA,GAAG,KAAK,KAAA,IAAS,CAACV,UAAY,EAAA;AAClC,YAAA;AACF;AAEAS,QAAAA,CAAAA,CAAEE,cAAc,EAAA;AAEhB,QAAA,OAAQF,EAAEC,GAAG;YACX,KAAK,GAAA;YACL,KAAK,OAAA;AACHJ,gBAAAA,eAAAA,EAAAA;AACA,gBAAA;YAEF,KAAK,QAAA;AACHC,gBAAAA,YAAAA,EAAAA;AACA,gBAAA;YAEF,KAAK,WAAA;YACL,KAAK,YAAA;gBACHH,UAAW,CAAA,MAAA,CAAA;AACX,gBAAA;YAEF,KAAK,SAAA;YACL,KAAK,WAAA;gBACHA,UAAW,CAAA,IAAA,CAAA;AACX,gBAAA;AAGJ;AACF,KAAA;IAEA,OAAOI,aAAAA;AACT;;;;"}
@@ -0,0 +1,73 @@
import * as React from 'react';
/**
* Utility hook designed to implement keyboard accessibile drag and drop by
* returning an onKeyDown handler to be passed to the drag icon button.
*
* @internal - You should use `useDragAndDrop` instead.
*/ const useKeyboardDragAndDrop = (active, index, { onCancel, onDropItem, onGrabItem, onMoveItem })=>{
const [isSelected, setIsSelected] = React.useState(false);
const handleMove = (movement)=>{
if (!isSelected) {
return;
}
if (typeof index === 'number' && onMoveItem) {
if (movement === 'UP') {
onMoveItem(index - 1, index);
} else if (movement === 'DOWN') {
onMoveItem(index + 1, index);
}
}
};
const handleDragClick = ()=>{
if (isSelected) {
if (onDropItem) {
onDropItem(index);
}
setIsSelected(false);
} else {
if (onGrabItem) {
onGrabItem(index);
}
setIsSelected(true);
}
};
const handleCancel = ()=>{
if (isSelected) {
setIsSelected(false);
if (onCancel) {
onCancel(index);
}
}
};
const handleKeyDown = (e)=>{
if (!active) {
return;
}
if (e.key === 'Tab' && !isSelected) {
return;
}
e.preventDefault();
switch(e.key){
case ' ':
case 'Enter':
handleDragClick();
break;
case 'Escape':
handleCancel();
break;
case 'ArrowDown':
case 'ArrowRight':
handleMove('DOWN');
break;
case 'ArrowUp':
case 'ArrowLeft':
handleMove('UP');
break;
}
};
return handleKeyDown;
};
export { useKeyboardDragAndDrop };
//# sourceMappingURL=useKeyboardDragAndDrop.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"useKeyboardDragAndDrop.mjs","sources":["../../../../../admin/src/routes/settings/hooks/useKeyboardDragAndDrop.ts"],"sourcesContent":["import * as React from 'react';\n\nexport type UseKeyboardDragAndDropCallbacks<TIndex extends number | Array<number> = number> = {\n onCancel?: (index: TIndex) => void;\n onDropItem?: (currentIndex: TIndex, newIndex?: TIndex) => void;\n onGrabItem?: (index: TIndex) => void;\n onMoveItem?: (newIndex: TIndex, currentIndex: TIndex) => void;\n};\n\n/**\n * Utility hook designed to implement keyboard accessibile drag and drop by\n * returning an onKeyDown handler to be passed to the drag icon button.\n *\n * @internal - You should use `useDragAndDrop` instead.\n */\nexport const useKeyboardDragAndDrop = <TIndex extends number | Array<number> = number>(\n active: boolean,\n index: TIndex,\n { onCancel, onDropItem, onGrabItem, onMoveItem }: UseKeyboardDragAndDropCallbacks<TIndex>\n) => {\n const [isSelected, setIsSelected] = React.useState(false);\n\n const handleMove = (movement: 'UP' | 'DOWN') => {\n if (!isSelected) {\n return;\n }\n if (typeof index === 'number' && onMoveItem) {\n if (movement === 'UP') {\n onMoveItem((index - 1) as TIndex, index);\n } else if (movement === 'DOWN') {\n onMoveItem((index + 1) as TIndex, index);\n }\n }\n };\n\n const handleDragClick = () => {\n if (isSelected) {\n if (onDropItem) {\n onDropItem(index);\n }\n setIsSelected(false);\n } else {\n if (onGrabItem) {\n onGrabItem(index);\n }\n setIsSelected(true);\n }\n };\n\n const handleCancel = () => {\n if (isSelected) {\n setIsSelected(false);\n\n if (onCancel) {\n onCancel(index);\n }\n }\n };\n\n const handleKeyDown = <E extends Element>(e: React.KeyboardEvent<E>) => {\n if (!active) {\n return;\n }\n\n if (e.key === 'Tab' && !isSelected) {\n return;\n }\n\n e.preventDefault();\n\n switch (e.key) {\n case ' ':\n case 'Enter':\n handleDragClick();\n break;\n\n case 'Escape':\n handleCancel();\n break;\n\n case 'ArrowDown':\n case 'ArrowRight':\n handleMove('DOWN');\n break;\n\n case 'ArrowUp':\n case 'ArrowLeft':\n handleMove('UP');\n break;\n\n default:\n }\n };\n\n return handleKeyDown;\n};\n"],"names":["useKeyboardDragAndDrop","active","index","onCancel","onDropItem","onGrabItem","onMoveItem","isSelected","setIsSelected","React","useState","handleMove","movement","handleDragClick","handleCancel","handleKeyDown","e","key","preventDefault"],"mappings":";;AASA;;;;;AAKC,IACM,MAAMA,sBAAyB,GAAA,CACpCC,QACAC,KACA,EAAA,EAAEC,QAAQ,EAAEC,UAAU,EAAEC,UAAU,EAAEC,UAAU,EAA2C,GAAA;AAEzF,IAAA,MAAM,CAACC,UAAYC,EAAAA,aAAAA,CAAc,GAAGC,KAAAA,CAAMC,QAAQ,CAAC,KAAA,CAAA;AAEnD,IAAA,MAAMC,aAAa,CAACC,QAAAA,GAAAA;AAClB,QAAA,IAAI,CAACL,UAAY,EAAA;AACf,YAAA;AACF;QACA,IAAI,OAAOL,KAAU,KAAA,QAAA,IAAYI,UAAY,EAAA;AAC3C,YAAA,IAAIM,aAAa,IAAM,EAAA;AACrBN,gBAAAA,UAAAA,CAAYJ,QAAQ,CAAcA,EAAAA,KAAAA,CAAAA;aAC7B,MAAA,IAAIU,aAAa,MAAQ,EAAA;AAC9BN,gBAAAA,UAAAA,CAAYJ,QAAQ,CAAcA,EAAAA,KAAAA,CAAAA;AACpC;AACF;AACF,KAAA;AAEA,IAAA,MAAMW,eAAkB,GAAA,IAAA;AACtB,QAAA,IAAIN,UAAY,EAAA;AACd,YAAA,IAAIH,UAAY,EAAA;gBACdA,UAAWF,CAAAA,KAAAA,CAAAA;AACb;YACAM,aAAc,CAAA,KAAA,CAAA;SACT,MAAA;AACL,YAAA,IAAIH,UAAY,EAAA;gBACdA,UAAWH,CAAAA,KAAAA,CAAAA;AACb;YACAM,aAAc,CAAA,IAAA,CAAA;AAChB;AACF,KAAA;AAEA,IAAA,MAAMM,YAAe,GAAA,IAAA;AACnB,QAAA,IAAIP,UAAY,EAAA;YACdC,aAAc,CAAA,KAAA,CAAA;AAEd,YAAA,IAAIL,QAAU,EAAA;gBACZA,QAASD,CAAAA,KAAAA,CAAAA;AACX;AACF;AACF,KAAA;AAEA,IAAA,MAAMa,gBAAgB,CAAoBC,CAAAA,GAAAA;AACxC,QAAA,IAAI,CAACf,MAAQ,EAAA;AACX,YAAA;AACF;AAEA,QAAA,IAAIe,CAAEC,CAAAA,GAAG,KAAK,KAAA,IAAS,CAACV,UAAY,EAAA;AAClC,YAAA;AACF;AAEAS,QAAAA,CAAAA,CAAEE,cAAc,EAAA;AAEhB,QAAA,OAAQF,EAAEC,GAAG;YACX,KAAK,GAAA;YACL,KAAK,OAAA;AACHJ,gBAAAA,eAAAA,EAAAA;AACA,gBAAA;YAEF,KAAK,QAAA;AACHC,gBAAAA,YAAAA,EAAAA;AACA,gBAAA;YAEF,KAAK,WAAA;YACL,KAAK,YAAA;gBACHH,UAAW,CAAA,MAAA,CAAA;AACX,gBAAA;YAEF,KAAK,SAAA;YACL,KAAK,WAAA;gBACHA,UAAW,CAAA,IAAA,CAAA;AACX,gBAAA;AAGJ;AACF,KAAA;IAEA,OAAOI,aAAAA;AACT;;;;"}
@@ -0,0 +1,171 @@
'use strict';
var React = require('react');
var strapiAdmin = require('@strapi/admin/strapi-admin');
var reactIntl = require('react-intl');
var settings = require('../../../services/settings.js');
function _interopNamespaceDefault(e) {
var n = Object.create(null);
if (e) {
Object.keys(e).forEach(function (k) {
if (k !== 'default') {
var d = Object.getOwnPropertyDescriptor(e, k);
Object.defineProperty(n, k, d.get ? d : {
enumerable: true,
get: function () { return e[k]; }
});
}
});
}
n.default = e;
return Object.freeze(n);
}
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
const DEFAULT_UNEXPECTED_ERROR_MSG = {
id: 'notification.error',
defaultMessage: 'An error occurred, please try again'
};
const useReviewWorkflows = (params = {})=>{
const { toggleNotification } = strapiAdmin.useNotification();
const { formatMessage } = reactIntl.useIntl();
const { _unstableFormatAPIError: formatAPIError } = strapiAdmin.useAPIErrorHandler();
const { skip = false, ...queryParams } = params;
const { data, isLoading, error } = settings.useGetWorkflowsQuery({
...queryParams
}, {
skip
});
React__namespace.useEffect(()=>{
if (error) {
toggleNotification({
type: 'danger',
message: formatAPIError(error)
});
}
}, [
error,
formatAPIError,
toggleNotification
]);
const [createWorkflow] = settings.useCreateWorkflowMutation();
const create = React__namespace.useCallback(async (data)=>{
try {
const res = await createWorkflow({
data
});
if ('error' in res) {
toggleNotification({
type: 'danger',
message: formatAPIError(res.error)
});
return res;
}
toggleNotification({
type: 'success',
message: formatMessage({
id: 'actions.created',
defaultMessage: 'Created workflow'
})
});
return res;
} catch (err) {
toggleNotification({
type: 'danger',
message: formatMessage(DEFAULT_UNEXPECTED_ERROR_MSG)
});
throw err;
}
}, [
createWorkflow,
formatAPIError,
formatMessage,
toggleNotification
]);
const [updateWorkflow] = settings.useUpdateWorkflowMutation();
const update = React__namespace.useCallback(async (id, data)=>{
try {
const res = await updateWorkflow({
id,
data
});
if ('error' in res) {
toggleNotification({
type: 'danger',
message: formatAPIError(res.error)
});
return res;
}
toggleNotification({
type: 'success',
message: formatMessage({
id: 'actions.updated',
defaultMessage: 'Updated workflow'
})
});
return res;
} catch (err) {
toggleNotification({
type: 'danger',
message: formatMessage(DEFAULT_UNEXPECTED_ERROR_MSG)
});
throw err;
}
}, [
formatAPIError,
formatMessage,
toggleNotification,
updateWorkflow
]);
const [deleteWorkflow] = settings.useDeleteWorkflowMutation();
const deleteAction = React__namespace.useCallback(async (id)=>{
try {
const res = await deleteWorkflow({
id
});
if ('error' in res) {
toggleNotification({
type: 'danger',
message: formatAPIError(res.error)
});
return;
}
toggleNotification({
type: 'success',
message: formatMessage({
id: 'actions.deleted',
defaultMessage: 'Deleted workflow'
})
});
return res.data;
} catch (err) {
toggleNotification({
type: 'danger',
message: formatMessage(DEFAULT_UNEXPECTED_ERROR_MSG)
});
throw err;
}
}, [
deleteWorkflow,
formatAPIError,
formatMessage,
toggleNotification
]);
const { workflows = [], meta } = data ?? {};
return {
// meta contains e.g. the total of all workflows. we can not use
// the pagination object here, because the list is not paginated.
meta,
workflows,
isLoading,
error,
create,
delete: deleteAction,
update
};
};
exports.useReviewWorkflows = useReviewWorkflows;
//# sourceMappingURL=useReviewWorkflows.js.map
@@ -0,0 +1 @@
{"version":3,"file":"useReviewWorkflows.js","sources":["../../../../../admin/src/routes/settings/hooks/useReviewWorkflows.ts"],"sourcesContent":["import * as React from 'react';\n\nimport { useAPIErrorHandler, useNotification } from '@strapi/admin/strapi-admin';\nimport { type MessageDescriptor, useIntl } from 'react-intl';\n\nimport {\n GetWorkflowsParams,\n useCreateWorkflowMutation,\n useDeleteWorkflowMutation,\n useGetWorkflowsQuery,\n useUpdateWorkflowMutation,\n} from '../../../services/settings';\n\nimport type { Create, Update } from '../../../../../shared/contracts/review-workflows';\n\nconst DEFAULT_UNEXPECTED_ERROR_MSG = {\n id: 'notification.error',\n defaultMessage: 'An error occurred, please try again',\n} satisfies MessageDescriptor;\n\ntype UseReviewWorkflowsArgs = GetWorkflowsParams & {\n skip?: boolean;\n};\n\nconst useReviewWorkflows = (params: UseReviewWorkflowsArgs = {}) => {\n const { toggleNotification } = useNotification();\n const { formatMessage } = useIntl();\n const { _unstableFormatAPIError: formatAPIError } = useAPIErrorHandler();\n\n const { skip = false, ...queryParams } = params;\n\n const { data, isLoading, error } = useGetWorkflowsQuery(\n {\n ...queryParams,\n },\n {\n skip,\n }\n );\n\n React.useEffect(() => {\n if (error) {\n toggleNotification({\n type: 'danger',\n message: formatAPIError(error),\n });\n }\n }, [error, formatAPIError, toggleNotification]);\n\n const [createWorkflow] = useCreateWorkflowMutation();\n const create = React.useCallback(\n async (data: Create.Request['body']['data']) => {\n try {\n const res = await createWorkflow({ data });\n\n if ('error' in res) {\n toggleNotification({\n type: 'danger',\n message: formatAPIError(res.error),\n });\n\n return res;\n }\n\n toggleNotification({\n type: 'success',\n message: formatMessage({ id: 'actions.created', defaultMessage: 'Created workflow' }),\n });\n\n return res;\n } catch (err) {\n toggleNotification({\n type: 'danger',\n message: formatMessage(DEFAULT_UNEXPECTED_ERROR_MSG),\n });\n\n throw err;\n }\n },\n [createWorkflow, formatAPIError, formatMessage, toggleNotification]\n );\n\n const [updateWorkflow] = useUpdateWorkflowMutation();\n const update = React.useCallback(\n async (id: string, data: Update.Request['body']['data']) => {\n try {\n const res = await updateWorkflow({ id, data });\n\n if ('error' in res) {\n toggleNotification({\n type: 'danger',\n message: formatAPIError(res.error),\n });\n\n return res;\n }\n\n toggleNotification({\n type: 'success',\n message: formatMessage({ id: 'actions.updated', defaultMessage: 'Updated workflow' }),\n });\n\n return res;\n } catch (err) {\n toggleNotification({\n type: 'danger',\n message: formatMessage(DEFAULT_UNEXPECTED_ERROR_MSG),\n });\n\n throw err;\n }\n },\n [formatAPIError, formatMessage, toggleNotification, updateWorkflow]\n );\n\n const [deleteWorkflow] = useDeleteWorkflowMutation();\n const deleteAction = React.useCallback(\n async (id: string) => {\n try {\n const res = await deleteWorkflow({ id });\n\n if ('error' in res) {\n toggleNotification({\n type: 'danger',\n message: formatAPIError(res.error),\n });\n\n return;\n }\n\n toggleNotification({\n type: 'success',\n message: formatMessage({ id: 'actions.deleted', defaultMessage: 'Deleted workflow' }),\n });\n\n return res.data;\n } catch (err) {\n toggleNotification({\n type: 'danger',\n message: formatMessage(DEFAULT_UNEXPECTED_ERROR_MSG),\n });\n\n throw err;\n }\n },\n [deleteWorkflow, formatAPIError, formatMessage, toggleNotification]\n );\n\n const { workflows = [], meta } = data ?? {};\n\n return {\n // meta contains e.g. the total of all workflows. we can not use\n // the pagination object here, because the list is not paginated.\n meta,\n workflows,\n isLoading,\n error,\n create,\n delete: deleteAction,\n update,\n };\n};\n\nexport { useReviewWorkflows };\n"],"names":["DEFAULT_UNEXPECTED_ERROR_MSG","id","defaultMessage","useReviewWorkflows","params","toggleNotification","useNotification","formatMessage","useIntl","_unstableFormatAPIError","formatAPIError","useAPIErrorHandler","skip","queryParams","data","isLoading","error","useGetWorkflowsQuery","React","useEffect","type","message","createWorkflow","useCreateWorkflowMutation","create","useCallback","res","err","updateWorkflow","useUpdateWorkflowMutation","update","deleteWorkflow","useDeleteWorkflowMutation","deletLine truncated
@@ -0,0 +1,150 @@
import * as React from 'react';
import { useNotification, useAPIErrorHandler } from '@strapi/admin/strapi-admin';
import { useIntl } from 'react-intl';
import { useGetWorkflowsQuery, useCreateWorkflowMutation, useUpdateWorkflowMutation, useDeleteWorkflowMutation } from '../../../services/settings.mjs';
const DEFAULT_UNEXPECTED_ERROR_MSG = {
id: 'notification.error',
defaultMessage: 'An error occurred, please try again'
};
const useReviewWorkflows = (params = {})=>{
const { toggleNotification } = useNotification();
const { formatMessage } = useIntl();
const { _unstableFormatAPIError: formatAPIError } = useAPIErrorHandler();
const { skip = false, ...queryParams } = params;
const { data, isLoading, error } = useGetWorkflowsQuery({
...queryParams
}, {
skip
});
React.useEffect(()=>{
if (error) {
toggleNotification({
type: 'danger',
message: formatAPIError(error)
});
}
}, [
error,
formatAPIError,
toggleNotification
]);
const [createWorkflow] = useCreateWorkflowMutation();
const create = React.useCallback(async (data)=>{
try {
const res = await createWorkflow({
data
});
if ('error' in res) {
toggleNotification({
type: 'danger',
message: formatAPIError(res.error)
});
return res;
}
toggleNotification({
type: 'success',
message: formatMessage({
id: 'actions.created',
defaultMessage: 'Created workflow'
})
});
return res;
} catch (err) {
toggleNotification({
type: 'danger',
message: formatMessage(DEFAULT_UNEXPECTED_ERROR_MSG)
});
throw err;
}
}, [
createWorkflow,
formatAPIError,
formatMessage,
toggleNotification
]);
const [updateWorkflow] = useUpdateWorkflowMutation();
const update = React.useCallback(async (id, data)=>{
try {
const res = await updateWorkflow({
id,
data
});
if ('error' in res) {
toggleNotification({
type: 'danger',
message: formatAPIError(res.error)
});
return res;
}
toggleNotification({
type: 'success',
message: formatMessage({
id: 'actions.updated',
defaultMessage: 'Updated workflow'
})
});
return res;
} catch (err) {
toggleNotification({
type: 'danger',
message: formatMessage(DEFAULT_UNEXPECTED_ERROR_MSG)
});
throw err;
}
}, [
formatAPIError,
formatMessage,
toggleNotification,
updateWorkflow
]);
const [deleteWorkflow] = useDeleteWorkflowMutation();
const deleteAction = React.useCallback(async (id)=>{
try {
const res = await deleteWorkflow({
id
});
if ('error' in res) {
toggleNotification({
type: 'danger',
message: formatAPIError(res.error)
});
return;
}
toggleNotification({
type: 'success',
message: formatMessage({
id: 'actions.deleted',
defaultMessage: 'Deleted workflow'
})
});
return res.data;
} catch (err) {
toggleNotification({
type: 'danger',
message: formatMessage(DEFAULT_UNEXPECTED_ERROR_MSG)
});
throw err;
}
}, [
deleteWorkflow,
formatAPIError,
formatMessage,
toggleNotification
]);
const { workflows = [], meta } = data ?? {};
return {
// meta contains e.g. the total of all workflows. we can not use
// the pagination object here, because the list is not paginated.
meta,
workflows,
isLoading,
error,
create,
delete: deleteAction,
update
};
};
export { useReviewWorkflows };
//# sourceMappingURL=useReviewWorkflows.mjs.map
Loaded 100 of 65041 files, more files were not shown because too many files have changed in this diff. Show more