node_modules ignore

This commit is contained in:
2025-05-08 23:43:47 +02:00
parent e19d52f172
commit 4574544c9f
65041 changed files with 10593536 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
'use strict';
var designSystem = require('@strapi/design-system');
var styledComponents = require('styled-components');
const activeCheckboxWrapperStyles = styledComponents.css`
background: ${(props)=>props.theme.colors.primary100};
#cog {
opacity: 1;
}
`;
const CheckboxWrapper = styledComponents.styled(designSystem.Box)`
display: flex;
justify-content: space-between;
align-items: center;
#cog {
opacity: 0;
path {
fill: ${(props)=>props.theme.colors.primary600};
}
}
/* Show active style both on hover and when the action is selected */
${(props)=>props.isActive && activeCheckboxWrapperStyles}
&:hover {
${activeCheckboxWrapperStyles}
}
`;
module.exports = CheckboxWrapper;
//# sourceMappingURL=CheckboxWrapper.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"CheckboxWrapper.js","sources":["../../../../../admin/src/components/Permissions/PermissionRow/CheckboxWrapper.jsx"],"sourcesContent":["import { Box } from '@strapi/design-system';\nimport { styled, css } from 'styled-components';\n\nconst activeCheckboxWrapperStyles = css`\n background: ${(props) => props.theme.colors.primary100};\n\n #cog {\n opacity: 1;\n }\n`;\n\nconst CheckboxWrapper = styled(Box)`\n display: flex;\n justify-content: space-between;\n align-items: center;\n\n #cog {\n opacity: 0;\n path {\n fill: ${(props) => props.theme.colors.primary600};\n }\n }\n\n /* Show active style both on hover and when the action is selected */\n ${(props) => props.isActive && activeCheckboxWrapperStyles}\n &:hover {\n ${activeCheckboxWrapperStyles}\n }\n`;\n\nexport default CheckboxWrapper;\n"],"names":["activeCheckboxWrapperStyles","css","props","theme","colors","primary100","CheckboxWrapper","styled","Box","primary600","isActive"],"mappings":";;;;;AAGA,MAAMA,2BAAAA,GAA8BC,oBAAG;cACzB,EAAE,CAACC,QAAUA,KAAMC,CAAAA,KAAK,CAACC,MAAM,CAACC,UAAU,CAAC;;;;;AAKzD,CAAC;AAEKC,MAAAA,eAAAA,GAAkBC,uBAAOC,CAAAA,gBAAAA,CAAI;;;;;;;;YAQvB,EAAE,CAACN,QAAUA,KAAMC,CAAAA,KAAK,CAACC,MAAM,CAACK,UAAU,CAAC;;;;;AAKrD,EAAA,EAAE,CAACP,KAAAA,GAAUA,KAAMQ,CAAAA,QAAQ,IAAIV,2BAA4B;;AAEzD,IAAA,EAAEA,2BAA4B;;AAElC;;;;"}

View File

@@ -0,0 +1,31 @@
import { Box } from '@strapi/design-system';
import { css, styled } from 'styled-components';
const activeCheckboxWrapperStyles = css`
background: ${(props)=>props.theme.colors.primary100};
#cog {
opacity: 1;
}
`;
const CheckboxWrapper = styled(Box)`
display: flex;
justify-content: space-between;
align-items: center;
#cog {
opacity: 0;
path {
fill: ${(props)=>props.theme.colors.primary600};
}
}
/* Show active style both on hover and when the action is selected */
${(props)=>props.isActive && activeCheckboxWrapperStyles}
&:hover {
${activeCheckboxWrapperStyles}
}
`;
export { CheckboxWrapper as default };
//# sourceMappingURL=CheckboxWrapper.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"CheckboxWrapper.mjs","sources":["../../../../../admin/src/components/Permissions/PermissionRow/CheckboxWrapper.jsx"],"sourcesContent":["import { Box } from '@strapi/design-system';\nimport { styled, css } from 'styled-components';\n\nconst activeCheckboxWrapperStyles = css`\n background: ${(props) => props.theme.colors.primary100};\n\n #cog {\n opacity: 1;\n }\n`;\n\nconst CheckboxWrapper = styled(Box)`\n display: flex;\n justify-content: space-between;\n align-items: center;\n\n #cog {\n opacity: 0;\n path {\n fill: ${(props) => props.theme.colors.primary600};\n }\n }\n\n /* Show active style both on hover and when the action is selected */\n ${(props) => props.isActive && activeCheckboxWrapperStyles}\n &:hover {\n ${activeCheckboxWrapperStyles}\n }\n`;\n\nexport default CheckboxWrapper;\n"],"names":["activeCheckboxWrapperStyles","css","props","theme","colors","primary100","CheckboxWrapper","styled","Box","primary600","isActive"],"mappings":";;;AAGA,MAAMA,2BAAAA,GAA8BC,GAAG;cACzB,EAAE,CAACC,QAAUA,KAAMC,CAAAA,KAAK,CAACC,MAAM,CAACC,UAAU,CAAC;;;;;AAKzD,CAAC;AAEKC,MAAAA,eAAAA,GAAkBC,MAAOC,CAAAA,GAAAA,CAAI;;;;;;;;YAQvB,EAAE,CAACN,QAAUA,KAAMC,CAAAA,KAAK,CAACC,MAAM,CAACK,UAAU,CAAC;;;;;AAKrD,EAAA,EAAE,CAACP,KAAAA,GAAUA,KAAMQ,CAAAA,QAAQ,IAAIV,2BAA4B;;AAEzD,IAAA,EAAEA,2BAA4B;;AAElC;;;;"}

View File

@@ -0,0 +1,156 @@
'use strict';
var jsxRuntime = require('react/jsx-runtime');
var React = require('react');
var designSystem = require('@strapi/design-system');
var icons = require('@strapi/icons');
var get = require('lodash/get');
var PropTypes = require('prop-types');
var reactIntl = require('react-intl');
var styledComponents = require('styled-components');
var index = require('../../../contexts/UsersPermissionsContext/index.js');
var CheckboxWrapper = require('./CheckboxWrapper.js');
const Border = styledComponents.styled.div`
flex: 1;
align-self: center;
border-top: 1px solid ${({ theme })=>theme.colors.neutral150};
`;
const SubCategory = ({ subCategory })=>{
const { formatMessage } = reactIntl.useIntl();
const { onChange, onChangeSelectAll, onSelectedAction, selectedAction, modifiedData } = index.useUsersPermissions();
const currentScopedModifiedData = React.useMemo(()=>{
return get(modifiedData, subCategory.name, {});
}, [
modifiedData,
subCategory
]);
const hasAllActionsSelected = React.useMemo(()=>{
return Object.values(currentScopedModifiedData).every((action)=>action.enabled === true);
}, [
currentScopedModifiedData
]);
const hasSomeActionsSelected = React.useMemo(()=>{
return Object.values(currentScopedModifiedData).some((action)=>action.enabled === true) && !hasAllActionsSelected;
}, [
currentScopedModifiedData,
hasAllActionsSelected
]);
const handleChangeSelectAll = React.useCallback(({ target: { name } })=>{
onChangeSelectAll({
target: {
name,
value: !hasAllActionsSelected
}
});
}, [
hasAllActionsSelected,
onChangeSelectAll
]);
const isActionSelected = React.useCallback((actionName)=>{
return selectedAction === actionName;
}, [
selectedAction
]);
return /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Box, {
children: [
/*#__PURE__*/ jsxRuntime.jsxs(designSystem.Flex, {
justifyContent: "space-between",
alignItems: "center",
children: [
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Box, {
paddingRight: 4,
children: /*#__PURE__*/ jsxRuntime.jsx(designSystem.Typography, {
variant: "sigma",
textColor: "neutral600",
children: subCategory.label
})
}),
/*#__PURE__*/ jsxRuntime.jsx(Border, {}),
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Box, {
paddingLeft: 4,
children: /*#__PURE__*/ jsxRuntime.jsx(designSystem.Checkbox, {
name: subCategory.name,
checked: hasSomeActionsSelected ? 'indeterminate' : hasAllActionsSelected,
onCheckedChange: (value)=>handleChangeSelectAll({
target: {
name: subCategory.name,
value
}
}),
children: formatMessage({
id: 'app.utils.select-all',
defaultMessage: 'Select all'
})
})
})
]
}),
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Flex, {
paddingTop: 6,
paddingBottom: 6,
children: /*#__PURE__*/ jsxRuntime.jsx(designSystem.Grid.Root, {
gap: 2,
style: {
flex: 1
},
children: subCategory.actions.map((action)=>{
const name = `${action.name}.enabled`;
return /*#__PURE__*/ jsxRuntime.jsx(designSystem.Grid.Item, {
col: 6,
direction: "column",
alignItems: "stretch",
children: /*#__PURE__*/ jsxRuntime.jsxs(CheckboxWrapper, {
isActive: isActionSelected(action.name),
padding: 2,
hasRadius: true,
children: [
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Checkbox, {
checked: get(modifiedData, name, false),
name: name,
onCheckedChange: (value)=>onChange({
target: {
name,
value
}
}),
children: action.label
}),
/*#__PURE__*/ jsxRuntime.jsxs("button", {
type: "button",
onClick: ()=>onSelectedAction(action.name),
style: {
display: 'inline-flex',
alignItems: 'center'
},
children: [
/*#__PURE__*/ jsxRuntime.jsx(designSystem.VisuallyHidden, {
tag: "span",
children: formatMessage({
id: 'app.utils.show-bound-route',
defaultMessage: 'Show bound route for {route}'
}, {
route: action.name
})
}),
/*#__PURE__*/ jsxRuntime.jsx(icons.Cog, {
id: "cog",
cursor: "pointer"
})
]
})
]
})
}, action.name);
})
})
})
]
});
};
SubCategory.propTypes = {
subCategory: PropTypes.object.isRequired
};
module.exports = SubCategory;
//# sourceMappingURL=SubCategory.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,154 @@
import { jsxs, jsx } from 'react/jsx-runtime';
import { useMemo, useCallback } from 'react';
import { Box, Flex, Typography, Checkbox, Grid, VisuallyHidden } from '@strapi/design-system';
import { Cog } from '@strapi/icons';
import get from 'lodash/get';
import PropTypes from 'prop-types';
import { useIntl } from 'react-intl';
import { styled } from 'styled-components';
import { useUsersPermissions } from '../../../contexts/UsersPermissionsContext/index.mjs';
import CheckboxWrapper from './CheckboxWrapper.mjs';
const Border = styled.div`
flex: 1;
align-self: center;
border-top: 1px solid ${({ theme })=>theme.colors.neutral150};
`;
const SubCategory = ({ subCategory })=>{
const { formatMessage } = useIntl();
const { onChange, onChangeSelectAll, onSelectedAction, selectedAction, modifiedData } = useUsersPermissions();
const currentScopedModifiedData = useMemo(()=>{
return get(modifiedData, subCategory.name, {});
}, [
modifiedData,
subCategory
]);
const hasAllActionsSelected = useMemo(()=>{
return Object.values(currentScopedModifiedData).every((action)=>action.enabled === true);
}, [
currentScopedModifiedData
]);
const hasSomeActionsSelected = useMemo(()=>{
return Object.values(currentScopedModifiedData).some((action)=>action.enabled === true) && !hasAllActionsSelected;
}, [
currentScopedModifiedData,
hasAllActionsSelected
]);
const handleChangeSelectAll = useCallback(({ target: { name } })=>{
onChangeSelectAll({
target: {
name,
value: !hasAllActionsSelected
}
});
}, [
hasAllActionsSelected,
onChangeSelectAll
]);
const isActionSelected = useCallback((actionName)=>{
return selectedAction === actionName;
}, [
selectedAction
]);
return /*#__PURE__*/ jsxs(Box, {
children: [
/*#__PURE__*/ jsxs(Flex, {
justifyContent: "space-between",
alignItems: "center",
children: [
/*#__PURE__*/ jsx(Box, {
paddingRight: 4,
children: /*#__PURE__*/ jsx(Typography, {
variant: "sigma",
textColor: "neutral600",
children: subCategory.label
})
}),
/*#__PURE__*/ jsx(Border, {}),
/*#__PURE__*/ jsx(Box, {
paddingLeft: 4,
children: /*#__PURE__*/ jsx(Checkbox, {
name: subCategory.name,
checked: hasSomeActionsSelected ? 'indeterminate' : hasAllActionsSelected,
onCheckedChange: (value)=>handleChangeSelectAll({
target: {
name: subCategory.name,
value
}
}),
children: formatMessage({
id: 'app.utils.select-all',
defaultMessage: 'Select all'
})
})
})
]
}),
/*#__PURE__*/ jsx(Flex, {
paddingTop: 6,
paddingBottom: 6,
children: /*#__PURE__*/ jsx(Grid.Root, {
gap: 2,
style: {
flex: 1
},
children: subCategory.actions.map((action)=>{
const name = `${action.name}.enabled`;
return /*#__PURE__*/ jsx(Grid.Item, {
col: 6,
direction: "column",
alignItems: "stretch",
children: /*#__PURE__*/ jsxs(CheckboxWrapper, {
isActive: isActionSelected(action.name),
padding: 2,
hasRadius: true,
children: [
/*#__PURE__*/ jsx(Checkbox, {
checked: get(modifiedData, name, false),
name: name,
onCheckedChange: (value)=>onChange({
target: {
name,
value
}
}),
children: action.label
}),
/*#__PURE__*/ jsxs("button", {
type: "button",
onClick: ()=>onSelectedAction(action.name),
style: {
display: 'inline-flex',
alignItems: 'center'
},
children: [
/*#__PURE__*/ jsx(VisuallyHidden, {
tag: "span",
children: formatMessage({
id: 'app.utils.show-bound-route',
defaultMessage: 'Show bound route for {route}'
}, {
route: action.name
})
}),
/*#__PURE__*/ jsx(Cog, {
id: "cog",
cursor: "pointer"
})
]
})
]
})
}, action.name);
})
})
})
]
});
};
SubCategory.propTypes = {
subCategory: PropTypes.object.isRequired
};
export { SubCategory as default };
//# sourceMappingURL=SubCategory.mjs.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,50 @@
'use strict';
var jsxRuntime = require('react/jsx-runtime');
var React = require('react');
var designSystem = require('@strapi/design-system');
var sortBy = require('lodash/sortBy');
var PropTypes = require('prop-types');
var SubCategory = require('./SubCategory.js');
const PermissionRow = ({ name, permissions })=>{
const subCategories = React.useMemo(()=>{
return sortBy(Object.values(permissions.controllers).reduce((acc, curr, index)=>{
const currentName = `${name}.controllers.${Object.keys(permissions.controllers)[index]}`;
const actions = sortBy(Object.keys(curr).reduce((acc, current)=>{
return [
...acc,
{
...curr[current],
label: current,
name: `${currentName}.${current}`
}
];
}, []), 'label');
return [
...acc,
{
actions,
label: Object.keys(permissions.controllers)[index],
name: currentName
}
];
}, []), 'label');
}, [
name,
permissions
]);
return /*#__PURE__*/ jsxRuntime.jsx(designSystem.Box, {
padding: 6,
children: subCategories.map((subCategory)=>/*#__PURE__*/ jsxRuntime.jsx(SubCategory, {
subCategory: subCategory
}, subCategory.name))
});
};
PermissionRow.propTypes = {
name: PropTypes.string.isRequired,
permissions: PropTypes.object.isRequired
};
module.exports = PermissionRow;
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sources":["../../../../../admin/src/components/Permissions/PermissionRow/index.jsx"],"sourcesContent":["import React, { useMemo } from 'react';\n\nimport { Box } from '@strapi/design-system';\nimport sortBy from 'lodash/sortBy';\nimport PropTypes from 'prop-types';\n\nimport SubCategory from './SubCategory';\n\nconst PermissionRow = ({ name, permissions }) => {\n const subCategories = useMemo(() => {\n return sortBy(\n Object.values(permissions.controllers).reduce((acc, curr, index) => {\n const currentName = `${name}.controllers.${Object.keys(permissions.controllers)[index]}`;\n const actions = sortBy(\n Object.keys(curr).reduce((acc, current) => {\n return [\n ...acc,\n {\n ...curr[current],\n label: current,\n name: `${currentName}.${current}`,\n },\n ];\n }, []),\n 'label'\n );\n\n return [\n ...acc,\n {\n actions,\n label: Object.keys(permissions.controllers)[index],\n name: currentName,\n },\n ];\n }, []),\n 'label'\n );\n }, [name, permissions]);\n\n return (\n <Box padding={6}>\n {subCategories.map((subCategory) => (\n <SubCategory key={subCategory.name} subCategory={subCategory} />\n ))}\n </Box>\n );\n};\n\nPermissionRow.propTypes = {\n name: PropTypes.string.isRequired,\n permissions: PropTypes.object.isRequired,\n};\n\nexport default PermissionRow;\n"],"names":["PermissionRow","name","permissions","subCategories","useMemo","sortBy","Object","values","controllers","reduce","acc","curr","index","currentName","keys","actions","current","label","_jsx","Box","padding","map","subCategory","SubCategory","propTypes","PropTypes","string","isRequired","object"],"mappings":";;;;;;;;;AAQA,MAAMA,gBAAgB,CAAC,EAAEC,IAAI,EAAEC,WAAW,EAAE,GAAA;AAC1C,IAAA,MAAMC,gBAAgBC,aAAQ,CAAA,IAAA;QAC5B,OAAOC,MAAAA,CACLC,MAAOC,CAAAA,MAAM,CAACL,WAAAA,CAAYM,WAAW,CAAA,CAAEC,MAAM,CAAC,CAACC,GAAAA,EAAKC,IAAMC,EAAAA,KAAAA,GAAAA;AACxD,YAAA,MAAMC,WAAc,GAAA,CAAC,EAAEZ,IAAAA,CAAK,aAAa,EAAEK,MAAAA,CAAOQ,IAAI,CAACZ,YAAYM,WAAW,CAAC,CAACI,KAAAA,CAAM,CAAC,CAAC;YACxF,MAAMG,OAAAA,GAAUV,OACdC,MAAOQ,CAAAA,IAAI,CAACH,IAAMF,CAAAA,CAAAA,MAAM,CAAC,CAACC,GAAKM,EAAAA,OAAAA,GAAAA;gBAC7B,OAAO;AACFN,oBAAAA,GAAAA,GAAAA;AACH,oBAAA;wBACE,GAAGC,IAAI,CAACK,OAAQ,CAAA;wBAChBC,KAAOD,EAAAA,OAAAA;AACPf,wBAAAA,IAAAA,EAAM,CAAC,EAAEY,WAAAA,CAAY,CAAC,EAAEG,QAAQ;AAClC;AACD,iBAAA;AACH,aAAA,EAAG,EAAE,CACL,EAAA,OAAA,CAAA;YAGF,OAAO;AACFN,gBAAAA,GAAAA,GAAAA;AACH,gBAAA;AACEK,oBAAAA,OAAAA;AACAE,oBAAAA,KAAAA,EAAOX,OAAOQ,IAAI,CAACZ,YAAYM,WAAW,CAAC,CAACI,KAAM,CAAA;oBAClDX,IAAMY,EAAAA;AACR;AACD,aAAA;AACH,SAAA,EAAG,EAAE,CACL,EAAA,OAAA,CAAA;KAED,EAAA;AAACZ,QAAAA,IAAAA;AAAMC,QAAAA;AAAY,KAAA,CAAA;AAEtB,IAAA,qBACEgB,cAACC,CAAAA,gBAAAA,EAAAA;QAAIC,OAAS,EAAA,CAAA;AACXjB,QAAAA,QAAAA,EAAAA,aAAAA,CAAckB,GAAG,CAAC,CAACC,WAAAA,iBAClBJ,cAACK,CAAAA,WAAAA,EAAAA;gBAAmCD,WAAaA,EAAAA;AAA/BA,aAAAA,EAAAA,WAAAA,CAAYrB,IAAI,CAAA;;AAI1C;AAEAD,aAAAA,CAAcwB,SAAS,GAAG;IACxBvB,IAAMwB,EAAAA,SAAAA,CAAUC,MAAM,CAACC,UAAU;IACjCzB,WAAauB,EAAAA,SAAAA,CAAUG,MAAM,CAACD;AAChC,CAAA;;;;"}

View File

@@ -0,0 +1,48 @@
import { jsx } from 'react/jsx-runtime';
import { useMemo } from 'react';
import { Box } from '@strapi/design-system';
import sortBy from 'lodash/sortBy';
import PropTypes from 'prop-types';
import SubCategory from './SubCategory.mjs';
const PermissionRow = ({ name, permissions })=>{
const subCategories = useMemo(()=>{
return sortBy(Object.values(permissions.controllers).reduce((acc, curr, index)=>{
const currentName = `${name}.controllers.${Object.keys(permissions.controllers)[index]}`;
const actions = sortBy(Object.keys(curr).reduce((acc, current)=>{
return [
...acc,
{
...curr[current],
label: current,
name: `${currentName}.${current}`
}
];
}, []), 'label');
return [
...acc,
{
actions,
label: Object.keys(permissions.controllers)[index],
name: currentName
}
];
}, []), 'label');
}, [
name,
permissions
]);
return /*#__PURE__*/ jsx(Box, {
padding: 6,
children: subCategories.map((subCategory)=>/*#__PURE__*/ jsx(SubCategory, {
subCategory: subCategory
}, subCategory.name))
});
};
PermissionRow.propTypes = {
name: PropTypes.string.isRequired,
permissions: PropTypes.object.isRequired
};
export { PermissionRow as default };
//# sourceMappingURL=index.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.mjs","sources":["../../../../../admin/src/components/Permissions/PermissionRow/index.jsx"],"sourcesContent":["import React, { useMemo } from 'react';\n\nimport { Box } from '@strapi/design-system';\nimport sortBy from 'lodash/sortBy';\nimport PropTypes from 'prop-types';\n\nimport SubCategory from './SubCategory';\n\nconst PermissionRow = ({ name, permissions }) => {\n const subCategories = useMemo(() => {\n return sortBy(\n Object.values(permissions.controllers).reduce((acc, curr, index) => {\n const currentName = `${name}.controllers.${Object.keys(permissions.controllers)[index]}`;\n const actions = sortBy(\n Object.keys(curr).reduce((acc, current) => {\n return [\n ...acc,\n {\n ...curr[current],\n label: current,\n name: `${currentName}.${current}`,\n },\n ];\n }, []),\n 'label'\n );\n\n return [\n ...acc,\n {\n actions,\n label: Object.keys(permissions.controllers)[index],\n name: currentName,\n },\n ];\n }, []),\n 'label'\n );\n }, [name, permissions]);\n\n return (\n <Box padding={6}>\n {subCategories.map((subCategory) => (\n <SubCategory key={subCategory.name} subCategory={subCategory} />\n ))}\n </Box>\n );\n};\n\nPermissionRow.propTypes = {\n name: PropTypes.string.isRequired,\n permissions: PropTypes.object.isRequired,\n};\n\nexport default PermissionRow;\n"],"names":["PermissionRow","name","permissions","subCategories","useMemo","sortBy","Object","values","controllers","reduce","acc","curr","index","currentName","keys","actions","current","label","_jsx","Box","padding","map","subCategory","SubCategory","propTypes","PropTypes","string","isRequired","object"],"mappings":";;;;;;;AAQA,MAAMA,gBAAgB,CAAC,EAAEC,IAAI,EAAEC,WAAW,EAAE,GAAA;AAC1C,IAAA,MAAMC,gBAAgBC,OAAQ,CAAA,IAAA;QAC5B,OAAOC,MAAAA,CACLC,MAAOC,CAAAA,MAAM,CAACL,WAAAA,CAAYM,WAAW,CAAA,CAAEC,MAAM,CAAC,CAACC,GAAAA,EAAKC,IAAMC,EAAAA,KAAAA,GAAAA;AACxD,YAAA,MAAMC,WAAc,GAAA,CAAC,EAAEZ,IAAAA,CAAK,aAAa,EAAEK,MAAAA,CAAOQ,IAAI,CAACZ,YAAYM,WAAW,CAAC,CAACI,KAAAA,CAAM,CAAC,CAAC;YACxF,MAAMG,OAAAA,GAAUV,OACdC,MAAOQ,CAAAA,IAAI,CAACH,IAAMF,CAAAA,CAAAA,MAAM,CAAC,CAACC,GAAKM,EAAAA,OAAAA,GAAAA;gBAC7B,OAAO;AACFN,oBAAAA,GAAAA,GAAAA;AACH,oBAAA;wBACE,GAAGC,IAAI,CAACK,OAAQ,CAAA;wBAChBC,KAAOD,EAAAA,OAAAA;AACPf,wBAAAA,IAAAA,EAAM,CAAC,EAAEY,WAAAA,CAAY,CAAC,EAAEG,QAAQ;AAClC;AACD,iBAAA;AACH,aAAA,EAAG,EAAE,CACL,EAAA,OAAA,CAAA;YAGF,OAAO;AACFN,gBAAAA,GAAAA,GAAAA;AACH,gBAAA;AACEK,oBAAAA,OAAAA;AACAE,oBAAAA,KAAAA,EAAOX,OAAOQ,IAAI,CAACZ,YAAYM,WAAW,CAAC,CAACI,KAAM,CAAA;oBAClDX,IAAMY,EAAAA;AACR;AACD,aAAA;AACH,SAAA,EAAG,EAAE,CACL,EAAA,OAAA,CAAA;KAED,EAAA;AAACZ,QAAAA,IAAAA;AAAMC,QAAAA;AAAY,KAAA,CAAA;AAEtB,IAAA,qBACEgB,GAACC,CAAAA,GAAAA,EAAAA;QAAIC,OAAS,EAAA,CAAA;AACXjB,QAAAA,QAAAA,EAAAA,aAAAA,CAAckB,GAAG,CAAC,CAACC,WAAAA,iBAClBJ,GAACK,CAAAA,WAAAA,EAAAA;gBAAmCD,WAAaA,EAAAA;AAA/BA,aAAAA,EAAAA,WAAAA,CAAYrB,IAAI,CAAA;;AAI1C;AAEAD,aAAAA,CAAcwB,SAAS,GAAG;IACxBvB,IAAMwB,EAAAA,SAAAA,CAAUC,MAAM,CAACC,UAAU;IACjCzB,WAAauB,EAAAA,SAAAA,CAAUG,MAAM,CAACD;AAChC,CAAA;;;;"}

View File

@@ -0,0 +1,52 @@
'use strict';
var jsxRuntime = require('react/jsx-runtime');
var React = require('react');
var designSystem = require('@strapi/design-system');
var reactIntl = require('react-intl');
var index = require('../../contexts/UsersPermissionsContext/index.js');
var formatPluginName = require('../../utils/formatPluginName.js');
var init = require('./init.js');
var index$1 = require('./PermissionRow/index.js');
var reducer = require('./reducer.js');
const Permissions = ()=>{
const { modifiedData } = index.useUsersPermissions();
const { formatMessage } = reactIntl.useIntl();
const [{ collapses }] = React.useReducer(reducer.reducer, reducer.initialState, (state)=>init(state, modifiedData));
return /*#__PURE__*/ jsxRuntime.jsx(designSystem.Accordion.Root, {
size: "M",
children: /*#__PURE__*/ jsxRuntime.jsx(designSystem.Flex, {
direction: "column",
alignItems: "stretch",
gap: 1,
children: collapses.map((collapse, index)=>/*#__PURE__*/ jsxRuntime.jsxs(designSystem.Accordion.Item, {
value: collapse.name,
children: [
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Accordion.Header, {
variant: index % 2 === 0 ? 'secondary' : undefined,
children: /*#__PURE__*/ jsxRuntime.jsx(designSystem.Accordion.Trigger, {
caretPosition: "right",
description: formatMessage({
id: 'users-permissions.Plugin.permissions.plugins.description',
defaultMessage: 'Define all allowed actions for the {name} plugin.'
}, {
name: collapse.name
}),
children: formatPluginName(collapse.name)
})
}),
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Accordion.Content, {
children: /*#__PURE__*/ jsxRuntime.jsx(index$1, {
permissions: modifiedData[collapse.name],
name: collapse.name
})
})
]
}, collapse.name))
})
});
};
module.exports = Permissions;
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sources":["../../../../admin/src/components/Permissions/index.jsx"],"sourcesContent":["import React, { useReducer } from 'react';\n\nimport { Accordion, Flex } from '@strapi/design-system';\nimport { useIntl } from 'react-intl';\n\nimport { useUsersPermissions } from '../../contexts/UsersPermissionsContext';\nimport formatPluginName from '../../utils/formatPluginName';\n\nimport init from './init';\nimport PermissionRow from './PermissionRow';\nimport { initialState, reducer } from './reducer';\n\nconst Permissions = () => {\n const { modifiedData } = useUsersPermissions();\n const { formatMessage } = useIntl();\n const [{ collapses }] = useReducer(reducer, initialState, (state) => init(state, modifiedData));\n\n return (\n <Accordion.Root size=\"M\">\n <Flex direction=\"column\" alignItems=\"stretch\" gap={1}>\n {collapses.map((collapse, index) => (\n <Accordion.Item key={collapse.name} value={collapse.name}>\n <Accordion.Header variant={index % 2 === 0 ? 'secondary' : undefined}>\n <Accordion.Trigger\n caretPosition=\"right\"\n description={formatMessage(\n {\n id: 'users-permissions.Plugin.permissions.plugins.description',\n defaultMessage: 'Define all allowed actions for the {name} plugin.',\n },\n { name: collapse.name }\n )}\n >\n {formatPluginName(collapse.name)}\n </Accordion.Trigger>\n </Accordion.Header>\n <Accordion.Content>\n <PermissionRow permissions={modifiedData[collapse.name]} name={collapse.name} />\n </Accordion.Content>\n </Accordion.Item>\n ))}\n </Flex>\n </Accordion.Root>\n );\n};\n\nexport default Permissions;\n"],"names":["Permissions","modifiedData","useUsersPermissions","formatMessage","useIntl","collapses","useReducer","reducer","initialState","state","init","_jsx","Accordion","Root","size","Flex","direction","alignItems","gap","map","collapse","index","_jsxs","Item","value","name","Header","variant","undefined","Trigger","caretPosition","description","id","defaultMessage","formatPluginName","Content","PermissionRow","permissions"],"mappings":";;;;;;;;;;;;AAYA,MAAMA,WAAc,GAAA,IAAA;IAClB,MAAM,EAAEC,YAAY,EAAE,GAAGC,yBAAAA,EAAAA;IACzB,MAAM,EAAEC,aAAa,EAAE,GAAGC,iBAAAA,EAAAA;AAC1B,IAAA,MAAM,CAAC,EAAEC,SAAS,EAAE,CAAC,GAAGC,gBAAWC,CAAAA,eAAAA,EAASC,oBAAc,EAAA,CAACC,KAAUC,GAAAA,IAAAA,CAAKD,KAAOR,EAAAA,YAAAA,CAAAA,CAAAA;IAEjF,qBACEU,cAAA,CAACC,uBAAUC,IAAI,EAAA;QAACC,IAAK,EAAA,GAAA;AACnB,QAAA,QAAA,gBAAAH,cAACI,CAAAA,iBAAAA,EAAAA;YAAKC,SAAU,EAAA,QAAA;YAASC,UAAW,EAAA,SAAA;YAAUC,GAAK,EAAA,CAAA;AAChDb,YAAAA,QAAAA,EAAAA,SAAAA,CAAUc,GAAG,CAAC,CAACC,UAAUC,KACxB,iBAAAC,eAAA,CAACV,uBAAUW,IAAI,EAAA;AAAqBC,oBAAAA,KAAAA,EAAOJ,SAASK,IAAI;;AACtD,sCAAAd,cAAA,CAACC,uBAAUc,MAAM,EAAA;4BAACC,OAASN,EAAAA,KAAAA,GAAQ,CAAM,KAAA,CAAA,GAAI,WAAcO,GAAAA,SAAAA;oDACzDjB,cAAA,CAACC,uBAAUiB,OAAO,EAAA;gCAChBC,aAAc,EAAA,OAAA;AACdC,gCAAAA,WAAAA,EAAa5B,aACX,CAAA;oCACE6B,EAAI,EAAA,0DAAA;oCACJC,cAAgB,EAAA;iCAElB,EAAA;AAAER,oCAAAA,IAAAA,EAAML,SAASK;AAAK,iCAAA,CAAA;AAGvBS,gCAAAA,QAAAA,EAAAA,gBAAAA,CAAiBd,SAASK,IAAI;;;AAGnC,sCAAAd,cAAA,CAACC,uBAAUuB,OAAO,EAAA;AAChB,4BAAA,QAAA,gBAAAxB,cAACyB,CAAAA,OAAAA,EAAAA;AAAcC,gCAAAA,WAAAA,EAAapC,YAAY,CAACmB,QAASK,CAAAA,IAAI,CAAC;AAAEA,gCAAAA,IAAAA,EAAML,SAASK;;;;AAhBvDL,iBAAAA,EAAAA,QAAAA,CAASK,IAAI,CAAA;;;AAuB5C;;;;"}

View File

@@ -0,0 +1,50 @@
import { jsx, jsxs } from 'react/jsx-runtime';
import { useReducer } from 'react';
import { Accordion, Flex } from '@strapi/design-system';
import { useIntl } from 'react-intl';
import { useUsersPermissions } from '../../contexts/UsersPermissionsContext/index.mjs';
import formatPluginName from '../../utils/formatPluginName.mjs';
import init from './init.mjs';
import PermissionRow from './PermissionRow/index.mjs';
import { reducer, initialState } from './reducer.mjs';
const Permissions = ()=>{
const { modifiedData } = useUsersPermissions();
const { formatMessage } = useIntl();
const [{ collapses }] = useReducer(reducer, initialState, (state)=>init(state, modifiedData));
return /*#__PURE__*/ jsx(Accordion.Root, {
size: "M",
children: /*#__PURE__*/ jsx(Flex, {
direction: "column",
alignItems: "stretch",
gap: 1,
children: collapses.map((collapse, index)=>/*#__PURE__*/ jsxs(Accordion.Item, {
value: collapse.name,
children: [
/*#__PURE__*/ jsx(Accordion.Header, {
variant: index % 2 === 0 ? 'secondary' : undefined,
children: /*#__PURE__*/ jsx(Accordion.Trigger, {
caretPosition: "right",
description: formatMessage({
id: 'users-permissions.Plugin.permissions.plugins.description',
defaultMessage: 'Define all allowed actions for the {name} plugin.'
}, {
name: collapse.name
}),
children: formatPluginName(collapse.name)
})
}),
/*#__PURE__*/ jsx(Accordion.Content, {
children: /*#__PURE__*/ jsx(PermissionRow, {
permissions: modifiedData[collapse.name],
name: collapse.name
})
})
]
}, collapse.name))
})
});
};
export { Permissions as default };
//# sourceMappingURL=index.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.mjs","sources":["../../../../admin/src/components/Permissions/index.jsx"],"sourcesContent":["import React, { useReducer } from 'react';\n\nimport { Accordion, Flex } from '@strapi/design-system';\nimport { useIntl } from 'react-intl';\n\nimport { useUsersPermissions } from '../../contexts/UsersPermissionsContext';\nimport formatPluginName from '../../utils/formatPluginName';\n\nimport init from './init';\nimport PermissionRow from './PermissionRow';\nimport { initialState, reducer } from './reducer';\n\nconst Permissions = () => {\n const { modifiedData } = useUsersPermissions();\n const { formatMessage } = useIntl();\n const [{ collapses }] = useReducer(reducer, initialState, (state) => init(state, modifiedData));\n\n return (\n <Accordion.Root size=\"M\">\n <Flex direction=\"column\" alignItems=\"stretch\" gap={1}>\n {collapses.map((collapse, index) => (\n <Accordion.Item key={collapse.name} value={collapse.name}>\n <Accordion.Header variant={index % 2 === 0 ? 'secondary' : undefined}>\n <Accordion.Trigger\n caretPosition=\"right\"\n description={formatMessage(\n {\n id: 'users-permissions.Plugin.permissions.plugins.description',\n defaultMessage: 'Define all allowed actions for the {name} plugin.',\n },\n { name: collapse.name }\n )}\n >\n {formatPluginName(collapse.name)}\n </Accordion.Trigger>\n </Accordion.Header>\n <Accordion.Content>\n <PermissionRow permissions={modifiedData[collapse.name]} name={collapse.name} />\n </Accordion.Content>\n </Accordion.Item>\n ))}\n </Flex>\n </Accordion.Root>\n );\n};\n\nexport default Permissions;\n"],"names":["Permissions","modifiedData","useUsersPermissions","formatMessage","useIntl","collapses","useReducer","reducer","initialState","state","init","_jsx","Accordion","Root","size","Flex","direction","alignItems","gap","map","collapse","index","_jsxs","Item","value","name","Header","variant","undefined","Trigger","caretPosition","description","id","defaultMessage","formatPluginName","Content","PermissionRow","permissions"],"mappings":";;;;;;;;;;AAYA,MAAMA,WAAc,GAAA,IAAA;IAClB,MAAM,EAAEC,YAAY,EAAE,GAAGC,mBAAAA,EAAAA;IACzB,MAAM,EAAEC,aAAa,EAAE,GAAGC,OAAAA,EAAAA;AAC1B,IAAA,MAAM,CAAC,EAAEC,SAAS,EAAE,CAAC,GAAGC,UAAWC,CAAAA,OAAAA,EAASC,YAAc,EAAA,CAACC,KAAUC,GAAAA,IAAAA,CAAKD,KAAOR,EAAAA,YAAAA,CAAAA,CAAAA;IAEjF,qBACEU,GAAA,CAACC,UAAUC,IAAI,EAAA;QAACC,IAAK,EAAA,GAAA;AACnB,QAAA,QAAA,gBAAAH,GAACI,CAAAA,IAAAA,EAAAA;YAAKC,SAAU,EAAA,QAAA;YAASC,UAAW,EAAA,SAAA;YAAUC,GAAK,EAAA,CAAA;AAChDb,YAAAA,QAAAA,EAAAA,SAAAA,CAAUc,GAAG,CAAC,CAACC,UAAUC,KACxB,iBAAAC,IAAA,CAACV,UAAUW,IAAI,EAAA;AAAqBC,oBAAAA,KAAAA,EAAOJ,SAASK,IAAI;;AACtD,sCAAAd,GAAA,CAACC,UAAUc,MAAM,EAAA;4BAACC,OAASN,EAAAA,KAAAA,GAAQ,CAAM,KAAA,CAAA,GAAI,WAAcO,GAAAA,SAAAA;oDACzDjB,GAAA,CAACC,UAAUiB,OAAO,EAAA;gCAChBC,aAAc,EAAA,OAAA;AACdC,gCAAAA,WAAAA,EAAa5B,aACX,CAAA;oCACE6B,EAAI,EAAA,0DAAA;oCACJC,cAAgB,EAAA;iCAElB,EAAA;AAAER,oCAAAA,IAAAA,EAAML,SAASK;AAAK,iCAAA,CAAA;AAGvBS,gCAAAA,QAAAA,EAAAA,gBAAAA,CAAiBd,SAASK,IAAI;;;AAGnC,sCAAAd,GAAA,CAACC,UAAUuB,OAAO,EAAA;AAChB,4BAAA,QAAA,gBAAAxB,GAACyB,CAAAA,aAAAA,EAAAA;AAAcC,gCAAAA,WAAAA,EAAapC,YAAY,CAACmB,QAASK,CAAAA,IAAI,CAAC;AAAEA,gCAAAA,IAAAA,EAAML,SAASK;;;;AAhBvDL,iBAAAA,EAAAA,QAAAA,CAASK,IAAI,CAAA;;;AAuB5C;;;;"}

View File

@@ -0,0 +1,15 @@
'use strict';
const init = (initialState, permissions)=>{
const collapses = Object.keys(permissions).sort().map((name)=>({
name,
isOpen: false
}));
return {
...initialState,
collapses
};
};
module.exports = init;
//# sourceMappingURL=init.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"init.js","sources":["../../../../admin/src/components/Permissions/init.js"],"sourcesContent":["const init = (initialState, permissions) => {\n const collapses = Object.keys(permissions)\n .sort()\n .map((name) => ({ name, isOpen: false }));\n\n return { ...initialState, collapses };\n};\n\nexport default init;\n"],"names":["init","initialState","permissions","collapses","Object","keys","sort","map","name","isOpen"],"mappings":";;AAAMA,MAAAA,IAAAA,GAAO,CAACC,YAAcC,EAAAA,WAAAA,GAAAA;IAC1B,MAAMC,SAAAA,GAAYC,MAAOC,CAAAA,IAAI,CAACH,WAAAA,CAAAA,CAC3BI,IAAI,EAAA,CACJC,GAAG,CAAC,CAACC,IAAAA,IAAU;AAAEA,YAAAA,IAAAA;YAAMC,MAAQ,EAAA;SAAM,CAAA,CAAA;IAExC,OAAO;AAAE,QAAA,GAAGR,YAAY;AAAEE,QAAAA;AAAU,KAAA;AACtC;;;;"}

View File

@@ -0,0 +1,13 @@
const init = (initialState, permissions)=>{
const collapses = Object.keys(permissions).sort().map((name)=>({
name,
isOpen: false
}));
return {
...initialState,
collapses
};
};
export { init as default };
//# sourceMappingURL=init.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"init.mjs","sources":["../../../../admin/src/components/Permissions/init.js"],"sourcesContent":["const init = (initialState, permissions) => {\n const collapses = Object.keys(permissions)\n .sort()\n .map((name) => ({ name, isOpen: false }));\n\n return { ...initialState, collapses };\n};\n\nexport default init;\n"],"names":["init","initialState","permissions","collapses","Object","keys","sort","map","name","isOpen"],"mappings":"AAAMA,MAAAA,IAAAA,GAAO,CAACC,YAAcC,EAAAA,WAAAA,GAAAA;IAC1B,MAAMC,SAAAA,GAAYC,MAAOC,CAAAA,IAAI,CAACH,WAAAA,CAAAA,CAC3BI,IAAI,EAAA,CACJC,GAAG,CAAC,CAACC,IAAAA,IAAU;AAAEA,YAAAA,IAAAA;YAAMC,MAAQ,EAAA;SAAM,CAAA,CAAA;IAExC,OAAO;AAAE,QAAA,GAAGR,YAAY;AAAEE,QAAAA;AAAU,KAAA;AACtC;;;;"}

View File

@@ -0,0 +1,34 @@
'use strict';
var immer = require('immer');
const initialState = {
collapses: []
};
const reducer = (state, action)=>// eslint-disable-next-line consistent-return
immer.produce(state, (draftState)=>{
switch(action.type){
case 'TOGGLE_COLLAPSE':
{
draftState.collapses = state.collapses.map((collapse, index)=>{
if (index === action.index) {
return {
...collapse,
isOpen: !collapse.isOpen
};
}
return {
...collapse,
isOpen: false
};
});
break;
}
default:
return draftState;
}
});
exports.initialState = initialState;
exports.reducer = reducer;
//# sourceMappingURL=reducer.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"reducer.js","sources":["../../../../admin/src/components/Permissions/reducer.js"],"sourcesContent":["import { produce } from 'immer';\n\nconst initialState = {\n collapses: [],\n};\n\nconst reducer = (state, action) =>\n // eslint-disable-next-line consistent-return\n produce(state, (draftState) => {\n switch (action.type) {\n case 'TOGGLE_COLLAPSE': {\n draftState.collapses = state.collapses.map((collapse, index) => {\n if (index === action.index) {\n return { ...collapse, isOpen: !collapse.isOpen };\n }\n\n return { ...collapse, isOpen: false };\n });\n\n break;\n }\n default:\n return draftState;\n }\n });\n\nexport { initialState, reducer };\n"],"names":["initialState","collapses","reducer","state","action","produce","draftState","type","map","collapse","index","isOpen"],"mappings":";;;;AAEA,MAAMA,YAAe,GAAA;AACnBC,IAAAA,SAAAA,EAAW;AACb;AAEA,MAAMC,OAAU,GAAA,CAACC,KAAOC,EAAAA,MAAAA;AAEtBC,IAAAA,aAAAA,CAAQF,OAAO,CAACG,UAAAA,GAAAA;AACd,QAAA,OAAQF,OAAOG,IAAI;YACjB,KAAK,iBAAA;AAAmB,gBAAA;oBACtBD,UAAWL,CAAAA,SAAS,GAAGE,KAAMF,CAAAA,SAAS,CAACO,GAAG,CAAC,CAACC,QAAUC,EAAAA,KAAAA,GAAAA;wBACpD,IAAIA,KAAAA,KAAUN,MAAOM,CAAAA,KAAK,EAAE;4BAC1B,OAAO;AAAE,gCAAA,GAAGD,QAAQ;gCAAEE,MAAQ,EAAA,CAACF,SAASE;AAAO,6BAAA;AACjD;wBAEA,OAAO;AAAE,4BAAA,GAAGF,QAAQ;4BAAEE,MAAQ,EAAA;AAAM,yBAAA;AACtC,qBAAA,CAAA;AAEA,oBAAA;AACF;AACA,YAAA;gBACE,OAAOL,UAAAA;AACX;AACF,KAAA;;;;;"}

View File

@@ -0,0 +1,31 @@
import { produce } from 'immer';
const initialState = {
collapses: []
};
const reducer = (state, action)=>// eslint-disable-next-line consistent-return
produce(state, (draftState)=>{
switch(action.type){
case 'TOGGLE_COLLAPSE':
{
draftState.collapses = state.collapses.map((collapse, index)=>{
if (index === action.index) {
return {
...collapse,
isOpen: !collapse.isOpen
};
}
return {
...collapse,
isOpen: false
};
});
break;
}
default:
return draftState;
}
});
export { initialState, reducer };
//# sourceMappingURL=reducer.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"reducer.mjs","sources":["../../../../admin/src/components/Permissions/reducer.js"],"sourcesContent":["import { produce } from 'immer';\n\nconst initialState = {\n collapses: [],\n};\n\nconst reducer = (state, action) =>\n // eslint-disable-next-line consistent-return\n produce(state, (draftState) => {\n switch (action.type) {\n case 'TOGGLE_COLLAPSE': {\n draftState.collapses = state.collapses.map((collapse, index) => {\n if (index === action.index) {\n return { ...collapse, isOpen: !collapse.isOpen };\n }\n\n return { ...collapse, isOpen: false };\n });\n\n break;\n }\n default:\n return draftState;\n }\n });\n\nexport { initialState, reducer };\n"],"names":["initialState","collapses","reducer","state","action","produce","draftState","type","map","collapse","index","isOpen"],"mappings":";;AAEA,MAAMA,YAAe,GAAA;AACnBC,IAAAA,SAAAA,EAAW;AACb;AAEA,MAAMC,OAAU,GAAA,CAACC,KAAOC,EAAAA,MAAAA;AAEtBC,IAAAA,OAAAA,CAAQF,OAAO,CAACG,UAAAA,GAAAA;AACd,QAAA,OAAQF,OAAOG,IAAI;YACjB,KAAK,iBAAA;AAAmB,gBAAA;oBACtBD,UAAWL,CAAAA,SAAS,GAAGE,KAAMF,CAAAA,SAAS,CAACO,GAAG,CAAC,CAACC,QAAUC,EAAAA,KAAAA,GAAAA;wBACpD,IAAIA,KAAAA,KAAUN,MAAOM,CAAAA,KAAK,EAAE;4BAC1B,OAAO;AAAE,gCAAA,GAAGD,QAAQ;gCAAEE,MAAQ,EAAA,CAACF,SAASE;AAAO,6BAAA;AACjD;wBAEA,OAAO;AAAE,4BAAA,GAAGF,QAAQ;4BAAEE,MAAQ,EAAA;AAAM,yBAAA;AACtC,qBAAA,CAAA;AAEA,oBAAA;AACF;AACA,YAAA;gBACE,OAAOL,UAAAA;AACX;AACF,KAAA;;;;"}