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,22 @@
'use strict';
const isBaseQueryError = (error)=>{
return error.name !== undefined;
};
/**
* @description
* Creates a valid query params object for get requests
* ie. plugins[18n][locale]=en becomes locale=en
*/ const buildValidParams = (query)=>{
if (!query) return query;
// Extract pluginOptions from the query, they shouldn't be part of the URL
const { plugins: _, ...validQueryParams } = {
...query,
...Object.values(query?.plugins ?? {}).reduce((acc, current)=>Object.assign(acc, current), {})
};
return validQueryParams;
};
exports.buildValidParams = buildValidParams;
exports.isBaseQueryError = isBaseQueryError;
//# sourceMappingURL=api.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"api.js","sources":["../../../admin/src/utils/api.ts"],"sourcesContent":["import { SerializedError } from '@reduxjs/toolkit';\nimport { type UnknownApiError, type ApiError } from '@strapi/admin/strapi-admin';\n\nexport type BaseQueryError = ApiError | UnknownApiError | SerializedError;\n\nconst isBaseQueryError = (error: BaseQueryError): error is ApiError | UnknownApiError => {\n return error.name !== undefined;\n};\n\ninterface Query {\n plugins?: Record<string, unknown>;\n _q?: string;\n [key: string]: any;\n}\n\n/**\n * This type extracts the plugin options from the query\n * and appends them to the root of the query\n */\ntype TransformedQuery<TQuery extends Query> = Omit<TQuery, 'plugins'> & {\n [key: string]: string;\n};\n\n/**\n * @description\n * Creates a valid query params object for get requests\n * ie. plugins[18n][locale]=en becomes locale=en\n */\nconst buildValidParams = <TQuery extends Query>(query: TQuery): TransformedQuery<TQuery> => {\n if (!query) return query;\n\n // Extract pluginOptions from the query, they shouldn't be part of the URL\n const { plugins: _, ...validQueryParams } = {\n ...query,\n ...Object.values(query?.plugins ?? {}).reduce<Record<string, string>>(\n (acc, current) => Object.assign(acc, current),\n {}\n ),\n };\n\n return validQueryParams;\n};\n\nexport { isBaseQueryError, buildValidParams };\n"],"names":["isBaseQueryError","error","name","undefined","buildValidParams","query","plugins","_","validQueryParams","Object","values","reduce","acc","current","assign"],"mappings":";;AAKA,MAAMA,mBAAmB,CAACC,KAAAA,GAAAA;IACxB,OAAOA,KAAAA,CAAMC,IAAI,KAAKC,SAAAA;AACxB;AAgBA;;;;IAKA,MAAMC,mBAAmB,CAAuBC,KAAAA,GAAAA;IAC9C,IAAI,CAACA,OAAO,OAAOA,KAAAA;;AAGnB,IAAA,MAAM,EAAEC,OAASC,EAAAA,CAAC,EAAE,GAAGC,kBAAkB,GAAG;AAC1C,QAAA,GAAGH,KAAK;AACR,QAAA,GAAGI,OAAOC,MAAM,CAACL,OAAOC,OAAW,IAAA,IAAIK,MAAM,CAC3C,CAACC,GAAAA,EAAKC,UAAYJ,MAAOK,CAAAA,MAAM,CAACF,GAAKC,EAAAA,OAAAA,CAAAA,EACrC,EACD;AACH,KAAA;IAEA,OAAOL,gBAAAA;AACT;;;;;"}

View File

@@ -0,0 +1,19 @@
const isBaseQueryError = (error)=>{
return error.name !== undefined;
};
/**
* @description
* Creates a valid query params object for get requests
* ie. plugins[18n][locale]=en becomes locale=en
*/ const buildValidParams = (query)=>{
if (!query) return query;
// Extract pluginOptions from the query, they shouldn't be part of the URL
const { plugins: _, ...validQueryParams } = {
...query,
...Object.values(query?.plugins ?? {}).reduce((acc, current)=>Object.assign(acc, current), {})
};
return validQueryParams;
};
export { buildValidParams, isBaseQueryError };
//# sourceMappingURL=api.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"api.mjs","sources":["../../../admin/src/utils/api.ts"],"sourcesContent":["import { SerializedError } from '@reduxjs/toolkit';\nimport { type UnknownApiError, type ApiError } from '@strapi/admin/strapi-admin';\n\nexport type BaseQueryError = ApiError | UnknownApiError | SerializedError;\n\nconst isBaseQueryError = (error: BaseQueryError): error is ApiError | UnknownApiError => {\n return error.name !== undefined;\n};\n\ninterface Query {\n plugins?: Record<string, unknown>;\n _q?: string;\n [key: string]: any;\n}\n\n/**\n * This type extracts the plugin options from the query\n * and appends them to the root of the query\n */\ntype TransformedQuery<TQuery extends Query> = Omit<TQuery, 'plugins'> & {\n [key: string]: string;\n};\n\n/**\n * @description\n * Creates a valid query params object for get requests\n * ie. plugins[18n][locale]=en becomes locale=en\n */\nconst buildValidParams = <TQuery extends Query>(query: TQuery): TransformedQuery<TQuery> => {\n if (!query) return query;\n\n // Extract pluginOptions from the query, they shouldn't be part of the URL\n const { plugins: _, ...validQueryParams } = {\n ...query,\n ...Object.values(query?.plugins ?? {}).reduce<Record<string, string>>(\n (acc, current) => Object.assign(acc, current),\n {}\n ),\n };\n\n return validQueryParams;\n};\n\nexport { isBaseQueryError, buildValidParams };\n"],"names":["isBaseQueryError","error","name","undefined","buildValidParams","query","plugins","_","validQueryParams","Object","values","reduce","acc","current","assign"],"mappings":"AAKA,MAAMA,mBAAmB,CAACC,KAAAA,GAAAA;IACxB,OAAOA,KAAAA,CAAMC,IAAI,KAAKC,SAAAA;AACxB;AAgBA;;;;IAKA,MAAMC,mBAAmB,CAAuBC,KAAAA,GAAAA;IAC9C,IAAI,CAACA,OAAO,OAAOA,KAAAA;;AAGnB,IAAA,MAAM,EAAEC,OAASC,EAAAA,CAAC,EAAE,GAAGC,kBAAkB,GAAG;AAC1C,QAAA,GAAGH,KAAK;AACR,QAAA,GAAGI,OAAOC,MAAM,CAACL,OAAOC,OAAW,IAAA,IAAIK,MAAM,CAC3C,CAACC,GAAAA,EAAKC,UAAYJ,MAAOK,CAAAA,MAAM,CAACF,GAAKC,EAAAA,OAAAA,CAAAA,EACrC,EACD;AACH,KAAA;IAEA,OAAOL,gBAAAA;AACT;;;;"}

View File

@@ -0,0 +1,23 @@
'use strict';
var constants = require('../routes/content-manager/model/constants.js');
const addColumnToTableHook = ({ displayedHeaders, layout })=>{
const { options } = layout;
if (!options.reviewWorkflows) {
return {
displayedHeaders,
layout
};
}
return {
displayedHeaders: [
...displayedHeaders,
...constants.REVIEW_WORKFLOW_COLUMNS
],
layout
};
};
exports.addColumnToTableHook = addColumnToTableHook;
//# sourceMappingURL=cm-hooks.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"cm-hooks.js","sources":["../../../admin/src/utils/cm-hooks.ts"],"sourcesContent":["import { REVIEW_WORKFLOW_COLUMNS } from '../routes/content-manager/model/constants';\n\nimport type { ListFieldLayout, ListLayout } from '@strapi/content-manager/strapi-admin';\n\n/* -------------------------------------------------------------------------------------------------\n * addColumnToTableHook\n * -----------------------------------------------------------------------------------------------*/\ninterface AddColumnToTableHookArgs {\n layout: ListLayout;\n displayedHeaders: ListFieldLayout[];\n}\n\nconst addColumnToTableHook = ({ displayedHeaders, layout }: AddColumnToTableHookArgs) => {\n const { options } = layout;\n\n if (!options.reviewWorkflows) {\n return { displayedHeaders, layout };\n }\n\n return {\n displayedHeaders: [...displayedHeaders, ...REVIEW_WORKFLOW_COLUMNS],\n layout,\n };\n};\n\nexport { addColumnToTableHook };\n"],"names":["addColumnToTableHook","displayedHeaders","layout","options","reviewWorkflows","REVIEW_WORKFLOW_COLUMNS"],"mappings":";;;;AAYA,MAAMA,uBAAuB,CAAC,EAAEC,gBAAgB,EAAEC,MAAM,EAA4B,GAAA;IAClF,MAAM,EAAEC,OAAO,EAAE,GAAGD,MAAAA;IAEpB,IAAI,CAACC,OAAQC,CAAAA,eAAe,EAAE;QAC5B,OAAO;AAAEH,YAAAA,gBAAAA;AAAkBC,YAAAA;AAAO,SAAA;AACpC;IAEA,OAAO;QACLD,gBAAkB,EAAA;AAAIA,YAAAA,GAAAA,gBAAAA;AAAqBI,YAAAA,GAAAA;AAAwB,SAAA;AACnEH,QAAAA;AACF,KAAA;AACF;;;;"}

View File

@@ -0,0 +1,21 @@
import { REVIEW_WORKFLOW_COLUMNS } from '../routes/content-manager/model/constants.mjs';
const addColumnToTableHook = ({ displayedHeaders, layout })=>{
const { options } = layout;
if (!options.reviewWorkflows) {
return {
displayedHeaders,
layout
};
}
return {
displayedHeaders: [
...displayedHeaders,
...REVIEW_WORKFLOW_COLUMNS
],
layout
};
};
export { addColumnToTableHook };
//# sourceMappingURL=cm-hooks.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"cm-hooks.mjs","sources":["../../../admin/src/utils/cm-hooks.ts"],"sourcesContent":["import { REVIEW_WORKFLOW_COLUMNS } from '../routes/content-manager/model/constants';\n\nimport type { ListFieldLayout, ListLayout } from '@strapi/content-manager/strapi-admin';\n\n/* -------------------------------------------------------------------------------------------------\n * addColumnToTableHook\n * -----------------------------------------------------------------------------------------------*/\ninterface AddColumnToTableHookArgs {\n layout: ListLayout;\n displayedHeaders: ListFieldLayout[];\n}\n\nconst addColumnToTableHook = ({ displayedHeaders, layout }: AddColumnToTableHookArgs) => {\n const { options } = layout;\n\n if (!options.reviewWorkflows) {\n return { displayedHeaders, layout };\n }\n\n return {\n displayedHeaders: [...displayedHeaders, ...REVIEW_WORKFLOW_COLUMNS],\n layout,\n };\n};\n\nexport { addColumnToTableHook };\n"],"names":["addColumnToTableHook","displayedHeaders","layout","options","reviewWorkflows","REVIEW_WORKFLOW_COLUMNS"],"mappings":";;AAYA,MAAMA,uBAAuB,CAAC,EAAEC,gBAAgB,EAAEC,MAAM,EAA4B,GAAA;IAClF,MAAM,EAAEC,OAAO,EAAE,GAAGD,MAAAA;IAEpB,IAAI,CAACC,OAAQC,CAAAA,eAAe,EAAE;QAC5B,OAAO;AAAEH,YAAAA,gBAAAA;AAAkBC,YAAAA;AAAO,SAAA;AACpC;IAEA,OAAO;QACLD,gBAAkB,EAAA;AAAIA,YAAAA,GAAAA,gBAAAA;AAAqBI,YAAAA,GAAAA;AAAwB,SAAA;AACnEH,QAAAA;AACF,KAAA;AACF;;;;"}

View File

@@ -0,0 +1,50 @@
'use strict';
var designSystem = require('@strapi/design-system');
const STAGE_COLORS = {
primary600: 'Blue',
primary200: 'Lilac',
alternative600: 'Violet',
alternative200: 'Lavender',
success600: 'Green',
success200: 'Pale Green',
danger500: 'Cherry',
danger200: 'Pink',
warning600: 'Orange',
warning200: 'Yellow',
secondary600: 'Teal',
secondary200: 'Baby Blue',
neutral400: 'Gray',
neutral0: 'White'
};
const getStageColorByHex = (hex)=>{
if (!hex) {
return null;
}
// there are multiple colors with the same hex code in the design tokens. In order to find
// the correct one we have to find all matching colors and then check, which ones are usable
// for stages.
const themeColors = Object.entries(designSystem.lightTheme.colors).filter(([, value])=>value.toUpperCase() === hex.toUpperCase());
const themeColorName = themeColors.reduce((acc, [name])=>{
if (STAGE_COLORS?.[name]) {
acc = name;
}
return acc;
}, null);
if (!themeColorName) {
return null;
}
return {
themeColorName,
name: STAGE_COLORS[themeColorName]
};
};
const AVAILABLE_COLORS = Object.entries(STAGE_COLORS).map(([themeColorName, name])=>({
hex: designSystem.lightTheme.colors[themeColorName].toUpperCase(),
name
}));
exports.AVAILABLE_COLORS = AVAILABLE_COLORS;
exports.getStageColorByHex = getStageColorByHex;
//# sourceMappingURL=colors.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"colors.js","sources":["../../../admin/src/utils/colors.ts"],"sourcesContent":["import { lightTheme } from '@strapi/design-system';\nimport { DefaultTheme } from 'styled-components';\n\nconst STAGE_COLORS: Record<string, string> = {\n primary600: 'Blue',\n primary200: 'Lilac',\n alternative600: 'Violet',\n alternative200: 'Lavender',\n success600: 'Green',\n success200: 'Pale Green',\n danger500: 'Cherry',\n danger200: 'Pink',\n warning600: 'Orange',\n warning200: 'Yellow',\n secondary600: 'Teal',\n secondary200: 'Baby Blue',\n neutral400: 'Gray',\n neutral0: 'White',\n};\n\nconst getStageColorByHex = (hex?: string) => {\n if (!hex) {\n return null;\n }\n\n // there are multiple colors with the same hex code in the design tokens. In order to find\n // the correct one we have to find all matching colors and then check, which ones are usable\n // for stages.\n const themeColors: [string, (keyof typeof STAGE_COLORS)[]][] = Object.entries(\n lightTheme.colors\n ).filter(([, value]) => value.toUpperCase() === hex.toUpperCase());\n\n const themeColorName = themeColors.reduce(\n (acc, [name]) => {\n if (STAGE_COLORS?.[name]) {\n acc = name;\n }\n\n return acc;\n },\n null as keyof typeof STAGE_COLORS | null\n );\n\n if (!themeColorName) {\n return null;\n }\n\n return {\n themeColorName,\n name: STAGE_COLORS[themeColorName],\n };\n};\n\nconst AVAILABLE_COLORS = Object.entries(STAGE_COLORS).map(([themeColorName, name]) => ({\n hex: lightTheme.colors[themeColorName as keyof DefaultTheme['colors']].toUpperCase(),\n name,\n}));\n\nexport { AVAILABLE_COLORS, getStageColorByHex };\n"],"names":["STAGE_COLORS","primary600","primary200","alternative600","alternative200","success600","success200","danger500","danger200","warning600","warning200","secondary600","secondary200","neutral400","neutral0","getStageColorByHex","hex","themeColors","Object","entries","lightTheme","colors","filter","value","toUpperCase","themeColorName","reduce","acc","name","AVAILABLE_COLORS","map"],"mappings":";;;;AAGA,MAAMA,YAAuC,GAAA;IAC3CC,UAAY,EAAA,MAAA;IACZC,UAAY,EAAA,OAAA;IACZC,cAAgB,EAAA,QAAA;IAChBC,cAAgB,EAAA,UAAA;IAChBC,UAAY,EAAA,OAAA;IACZC,UAAY,EAAA,YAAA;IACZC,SAAW,EAAA,QAAA;IACXC,SAAW,EAAA,MAAA;IACXC,UAAY,EAAA,QAAA;IACZC,UAAY,EAAA,QAAA;IACZC,YAAc,EAAA,MAAA;IACdC,YAAc,EAAA,WAAA;IACdC,UAAY,EAAA,MAAA;IACZC,QAAU,EAAA;AACZ,CAAA;AAEA,MAAMC,qBAAqB,CAACC,GAAAA,GAAAA;AAC1B,IAAA,IAAI,CAACA,GAAK,EAAA;QACR,OAAO,IAAA;AACT;;;;AAKA,IAAA,MAAMC,cAAyDC,MAAOC,CAAAA,OAAO,CAC3EC,uBAAAA,CAAWC,MAAM,CACjBC,CAAAA,MAAM,CAAC,CAAC,GAAGC,KAAM,CAAA,GAAKA,MAAMC,WAAW,EAAA,KAAOR,IAAIQ,WAAW,EAAA,CAAA;AAE/D,IAAA,MAAMC,iBAAiBR,WAAYS,CAAAA,MAAM,CACvC,CAACC,GAAAA,EAAK,CAACC,IAAK,CAAA,GAAA;QACV,IAAI5B,YAAAA,GAAe4B,IAAAA,CAAK,EAAE;YACxBD,GAAMC,GAAAA,IAAAA;AACR;QAEA,OAAOD,GAAAA;KAET,EAAA,IAAA,CAAA;AAGF,IAAA,IAAI,CAACF,cAAgB,EAAA;QACnB,OAAO,IAAA;AACT;IAEA,OAAO;AACLA,QAAAA,cAAAA;QACAG,IAAM5B,EAAAA,YAAY,CAACyB,cAAe;AACpC,KAAA;AACF;AAEA,MAAMI,gBAAmBX,GAAAA,MAAAA,CAAOC,OAAO,CAACnB,YAAc8B,CAAAA,CAAAA,GAAG,CAAC,CAAC,CAACL,cAAAA,EAAgBG,IAAK,CAAA,IAAM;AACrFZ,QAAAA,GAAAA,EAAKI,uBAAWC,CAAAA,MAAM,CAACI,cAAAA,CAA+C,CAACD,WAAW,EAAA;AAClFI,QAAAA;KACF,CAAA;;;;;"}

View File

@@ -0,0 +1,47 @@
import { lightTheme } from '@strapi/design-system';
const STAGE_COLORS = {
primary600: 'Blue',
primary200: 'Lilac',
alternative600: 'Violet',
alternative200: 'Lavender',
success600: 'Green',
success200: 'Pale Green',
danger500: 'Cherry',
danger200: 'Pink',
warning600: 'Orange',
warning200: 'Yellow',
secondary600: 'Teal',
secondary200: 'Baby Blue',
neutral400: 'Gray',
neutral0: 'White'
};
const getStageColorByHex = (hex)=>{
if (!hex) {
return null;
}
// there are multiple colors with the same hex code in the design tokens. In order to find
// the correct one we have to find all matching colors and then check, which ones are usable
// for stages.
const themeColors = Object.entries(lightTheme.colors).filter(([, value])=>value.toUpperCase() === hex.toUpperCase());
const themeColorName = themeColors.reduce((acc, [name])=>{
if (STAGE_COLORS?.[name]) {
acc = name;
}
return acc;
}, null);
if (!themeColorName) {
return null;
}
return {
themeColorName,
name: STAGE_COLORS[themeColorName]
};
};
const AVAILABLE_COLORS = Object.entries(STAGE_COLORS).map(([themeColorName, name])=>({
hex: lightTheme.colors[themeColorName].toUpperCase(),
name
}));
export { AVAILABLE_COLORS, getStageColorByHex };
//# sourceMappingURL=colors.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"colors.mjs","sources":["../../../admin/src/utils/colors.ts"],"sourcesContent":["import { lightTheme } from '@strapi/design-system';\nimport { DefaultTheme } from 'styled-components';\n\nconst STAGE_COLORS: Record<string, string> = {\n primary600: 'Blue',\n primary200: 'Lilac',\n alternative600: 'Violet',\n alternative200: 'Lavender',\n success600: 'Green',\n success200: 'Pale Green',\n danger500: 'Cherry',\n danger200: 'Pink',\n warning600: 'Orange',\n warning200: 'Yellow',\n secondary600: 'Teal',\n secondary200: 'Baby Blue',\n neutral400: 'Gray',\n neutral0: 'White',\n};\n\nconst getStageColorByHex = (hex?: string) => {\n if (!hex) {\n return null;\n }\n\n // there are multiple colors with the same hex code in the design tokens. In order to find\n // the correct one we have to find all matching colors and then check, which ones are usable\n // for stages.\n const themeColors: [string, (keyof typeof STAGE_COLORS)[]][] = Object.entries(\n lightTheme.colors\n ).filter(([, value]) => value.toUpperCase() === hex.toUpperCase());\n\n const themeColorName = themeColors.reduce(\n (acc, [name]) => {\n if (STAGE_COLORS?.[name]) {\n acc = name;\n }\n\n return acc;\n },\n null as keyof typeof STAGE_COLORS | null\n );\n\n if (!themeColorName) {\n return null;\n }\n\n return {\n themeColorName,\n name: STAGE_COLORS[themeColorName],\n };\n};\n\nconst AVAILABLE_COLORS = Object.entries(STAGE_COLORS).map(([themeColorName, name]) => ({\n hex: lightTheme.colors[themeColorName as keyof DefaultTheme['colors']].toUpperCase(),\n name,\n}));\n\nexport { AVAILABLE_COLORS, getStageColorByHex };\n"],"names":["STAGE_COLORS","primary600","primary200","alternative600","alternative200","success600","success200","danger500","danger200","warning600","warning200","secondary600","secondary200","neutral400","neutral0","getStageColorByHex","hex","themeColors","Object","entries","lightTheme","colors","filter","value","toUpperCase","themeColorName","reduce","acc","name","AVAILABLE_COLORS","map"],"mappings":";;AAGA,MAAMA,YAAuC,GAAA;IAC3CC,UAAY,EAAA,MAAA;IACZC,UAAY,EAAA,OAAA;IACZC,cAAgB,EAAA,QAAA;IAChBC,cAAgB,EAAA,UAAA;IAChBC,UAAY,EAAA,OAAA;IACZC,UAAY,EAAA,YAAA;IACZC,SAAW,EAAA,QAAA;IACXC,SAAW,EAAA,MAAA;IACXC,UAAY,EAAA,QAAA;IACZC,UAAY,EAAA,QAAA;IACZC,YAAc,EAAA,MAAA;IACdC,YAAc,EAAA,WAAA;IACdC,UAAY,EAAA,MAAA;IACZC,QAAU,EAAA;AACZ,CAAA;AAEA,MAAMC,qBAAqB,CAACC,GAAAA,GAAAA;AAC1B,IAAA,IAAI,CAACA,GAAK,EAAA;QACR,OAAO,IAAA;AACT;;;;AAKA,IAAA,MAAMC,cAAyDC,MAAOC,CAAAA,OAAO,CAC3EC,UAAAA,CAAWC,MAAM,CACjBC,CAAAA,MAAM,CAAC,CAAC,GAAGC,KAAM,CAAA,GAAKA,MAAMC,WAAW,EAAA,KAAOR,IAAIQ,WAAW,EAAA,CAAA;AAE/D,IAAA,MAAMC,iBAAiBR,WAAYS,CAAAA,MAAM,CACvC,CAACC,GAAAA,EAAK,CAACC,IAAK,CAAA,GAAA;QACV,IAAI5B,YAAAA,GAAe4B,IAAAA,CAAK,EAAE;YACxBD,GAAMC,GAAAA,IAAAA;AACR;QAEA,OAAOD,GAAAA;KAET,EAAA,IAAA,CAAA;AAGF,IAAA,IAAI,CAACF,cAAgB,EAAA;QACnB,OAAO,IAAA;AACT;IAEA,OAAO;AACLA,QAAAA,cAAAA;QACAG,IAAM5B,EAAAA,YAAY,CAACyB,cAAe;AACpC,KAAA;AACF;AAEA,MAAMI,gBAAmBX,GAAAA,MAAAA,CAAOC,OAAO,CAACnB,YAAc8B,CAAAA,CAAAA,GAAG,CAAC,CAAC,CAACL,cAAAA,EAAgBG,IAAK,CAAA,IAAM;AACrFZ,QAAAA,GAAAA,EAAKI,UAAWC,CAAAA,MAAM,CAACI,cAAAA,CAA+C,CAACD,WAAW,EAAA;AAClFI,QAAAA;KACF,CAAA;;;;"}

View File

@@ -0,0 +1,11 @@
'use strict';
const prefixPluginTranslations = (trad, pluginId)=>{
return Object.keys(trad).reduce((acc, current)=>{
acc[`${pluginId}.${current}`] = trad[current];
return acc;
}, {});
};
exports.prefixPluginTranslations = prefixPluginTranslations;
//# sourceMappingURL=translations.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"translations.js","sources":["../../../admin/src/utils/translations.ts"],"sourcesContent":["type TradOptions = Record<string, string>;\n\nconst prefixPluginTranslations = (trad: TradOptions, pluginId: string): TradOptions => {\n if (!pluginId) {\n throw new TypeError(\"pluginId can't be empty\");\n }\n return Object.keys(trad).reduce((acc, current) => {\n acc[`${pluginId}.${current}`] = trad[current];\n return acc;\n }, {} as TradOptions);\n};\n\nexport { prefixPluginTranslations };\n"],"names":["prefixPluginTranslations","trad","pluginId","Object","keys","reduce","acc","current"],"mappings":";;AAEMA,MAAAA,wBAAAA,GAA2B,CAACC,IAAmBC,EAAAA,QAAAA,GAAAA;AAInD,IAAA,OAAOC,OAAOC,IAAI,CAACH,MAAMI,MAAM,CAAC,CAACC,GAAKC,EAAAA,OAAAA,GAAAA;AACpCD,QAAAA,GAAG,CAAC,CAAC,EAAEJ,QAAAA,CAAS,CAAC,EAAEK,OAAQ,CAAA,CAAC,CAAC,GAAGN,IAAI,CAACM,OAAQ,CAAA;QAC7C,OAAOD,GAAAA;AACT,KAAA,EAAG,EAAC,CAAA;AACN;;;;"}

View File

@@ -0,0 +1,9 @@
const prefixPluginTranslations = (trad, pluginId)=>{
return Object.keys(trad).reduce((acc, current)=>{
acc[`${pluginId}.${current}`] = trad[current];
return acc;
}, {});
};
export { prefixPluginTranslations };
//# sourceMappingURL=translations.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"translations.mjs","sources":["../../../admin/src/utils/translations.ts"],"sourcesContent":["type TradOptions = Record<string, string>;\n\nconst prefixPluginTranslations = (trad: TradOptions, pluginId: string): TradOptions => {\n if (!pluginId) {\n throw new TypeError(\"pluginId can't be empty\");\n }\n return Object.keys(trad).reduce((acc, current) => {\n acc[`${pluginId}.${current}`] = trad[current];\n return acc;\n }, {} as TradOptions);\n};\n\nexport { prefixPluginTranslations };\n"],"names":["prefixPluginTranslations","trad","pluginId","Object","keys","reduce","acc","current"],"mappings":"AAEMA,MAAAA,wBAAAA,GAA2B,CAACC,IAAmBC,EAAAA,QAAAA,GAAAA;AAInD,IAAA,OAAOC,OAAOC,IAAI,CAACH,MAAMI,MAAM,CAAC,CAACC,GAAKC,EAAAA,OAAAA,GAAAA;AACpCD,QAAAA,GAAG,CAAC,CAAC,EAAEJ,QAAAA,CAAS,CAAC,EAAEK,OAAQ,CAAA,CAAC,CAAC,GAAGN,IAAI,CAACM,OAAQ,CAAA;QAC7C,OAAOD,GAAAA;AACT,KAAA,EAAG,EAAC,CAAA;AACN;;;;"}

View File

@@ -0,0 +1,17 @@
'use strict';
/**
* Retrieves the display name of an admin panel user
*/ const getDisplayName = ({ firstname, lastname, username, email } = {})=>{
if (username) {
return username;
}
// firstname is not required if the user is created with a username
if (firstname) {
return `${firstname} ${lastname ?? ''}`.trim();
}
return email ?? '';
};
exports.getDisplayName = getDisplayName;
//# sourceMappingURL=users.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"users.js","sources":["../../../admin/src/utils/users.ts"],"sourcesContent":["import type { SanitizedAdminUser } from '@strapi/admin/strapi-admin';\n\n/**\n * Retrieves the display name of an admin panel user\n */\nconst getDisplayName = ({\n firstname,\n lastname,\n username,\n email,\n}: Partial<\n Pick<SanitizedAdminUser, 'firstname' | 'lastname' | 'username' | 'email'>\n> = {}): string => {\n if (username) {\n return username;\n }\n\n // firstname is not required if the user is created with a username\n if (firstname) {\n return `${firstname} ${lastname ?? ''}`.trim();\n }\n\n return email ?? '';\n};\n\nexport { getDisplayName };\n"],"names":["getDisplayName","firstname","lastname","username","email","trim"],"mappings":";;AAEA;;AAEC,IACKA,MAAAA,cAAAA,GAAiB,CAAC,EACtBC,SAAS,EACTC,QAAQ,EACRC,QAAQ,EACRC,KAAK,EAGN,GAAG,EAAE,GAAA;AACJ,IAAA,IAAID,QAAU,EAAA;QACZ,OAAOA,QAAAA;AACT;;AAGA,IAAA,IAAIF,SAAW,EAAA;QACb,OAAO,CAAC,EAAEA,SAAU,CAAA,CAAC,EAAEC,QAAY,IAAA,EAAA,CAAG,CAAC,CAACG,IAAI,EAAA;AAC9C;AAEA,IAAA,OAAOD,KAAS,IAAA,EAAA;AAClB;;;;"}

View File

@@ -0,0 +1,15 @@
/**
* Retrieves the display name of an admin panel user
*/ const getDisplayName = ({ firstname, lastname, username, email } = {})=>{
if (username) {
return username;
}
// firstname is not required if the user is created with a username
if (firstname) {
return `${firstname} ${lastname ?? ''}`.trim();
}
return email ?? '';
};
export { getDisplayName };
//# sourceMappingURL=users.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"users.mjs","sources":["../../../admin/src/utils/users.ts"],"sourcesContent":["import type { SanitizedAdminUser } from '@strapi/admin/strapi-admin';\n\n/**\n * Retrieves the display name of an admin panel user\n */\nconst getDisplayName = ({\n firstname,\n lastname,\n username,\n email,\n}: Partial<\n Pick<SanitizedAdminUser, 'firstname' | 'lastname' | 'username' | 'email'>\n> = {}): string => {\n if (username) {\n return username;\n }\n\n // firstname is not required if the user is created with a username\n if (firstname) {\n return `${firstname} ${lastname ?? ''}`.trim();\n }\n\n return email ?? '';\n};\n\nexport { getDisplayName };\n"],"names":["getDisplayName","firstname","lastname","username","email","trim"],"mappings":"AAEA;;AAEC,IACKA,MAAAA,cAAAA,GAAiB,CAAC,EACtBC,SAAS,EACTC,QAAQ,EACRC,QAAQ,EACRC,KAAK,EAGN,GAAG,EAAE,GAAA;AACJ,IAAA,IAAID,QAAU,EAAA;QACZ,OAAOA,QAAAA;AACT;;AAGA,IAAA,IAAIF,SAAW,EAAA;QACb,OAAO,CAAC,EAAEA,SAAU,CAAA,CAAC,EAAEC,QAAY,IAAA,EAAA,CAAG,CAAC,CAACG,IAAI,EAAA;AAC9C;AAEA,IAAA,OAAOD,KAAS,IAAA,EAAA;AAClB;;;;"}