@elliemae/ds-system 3.54.0 → 3.54.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/styled/generated-attributes/generateAttributes.js +0 -6
- package/dist/cjs/styled/generated-attributes/generateAttributes.js.map +2 -2
- package/dist/esm/styled/generated-attributes/generateAttributes.js +0 -6
- package/dist/esm/styled/generated-attributes/generateAttributes.js.map +2 -2
- package/package.json +3 -3
|
@@ -52,12 +52,6 @@ const generateDataTestId = (props, meta) => {
|
|
|
52
52
|
const generateDataDimsumSlot = (props, meta) => {
|
|
53
53
|
if (meta.displayName === null) return {};
|
|
54
54
|
if (!props.didDefinedGetOwnerProps) {
|
|
55
|
-
if (true) {
|
|
56
|
-
console.warn(
|
|
57
|
-
`The component ${meta.displayName} does not define the 'getOwnerProps' function. The 'data-dimsum-slot' attribute will not be generated.
|
|
58
|
-
This is required for the slot system to work correctly. Please ensure that the component is properly configured.`
|
|
59
|
-
);
|
|
60
|
-
}
|
|
61
55
|
return {};
|
|
62
56
|
}
|
|
63
57
|
const finalProps = {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/styled/generated-attributes/generateAttributes.ts", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { displayNameToKebabCase, displayNameToPropCase } from '../helpers.js';\nimport type { AttrsFunc, InternalAttrsFunc, Options, OwnerInterface, PartProps } from '../types.js';\n\nconst generateClassName: InternalAttrsFunc = (props, meta) => {\n if (meta.displayName === null) return {};\n return {\n className: meta.displayName,\n };\n};\n\nconst generateDataTestId: InternalAttrsFunc<{ 'data-testid': string }> = (props, meta) => {\n if (meta.displayName === null) return {};\n if (meta.options.preserveLegacyDataTestId) {\n return props['data-testid'] ? { 'data-testid': props['data-testid'] } : {};\n }\n\n return {\n 'data-testid': props['data-testid'] ?? displayNameToKebabCase(meta.displayName),\n };\n};\n\nconst generateDataDimsumSlot: InternalAttrsFunc = (props, meta) => {\n if (meta.displayName === null) return {};\n\n if (!props.didDefinedGetOwnerProps) {\n if (process.env.NODE_ENV !== 'production') {\n
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,qBAA8D;AAG9D,MAAM,oBAAuC,CAAC,OAAO,SAAS;AAC5D,MAAI,KAAK,gBAAgB,KAAM,QAAO,CAAC;AACvC,SAAO;AAAA,IACL,WAAW,KAAK;AAAA,EAClB;AACF;AAEA,MAAM,qBAAmE,CAAC,OAAO,SAAS;AACxF,MAAI,KAAK,gBAAgB,KAAM,QAAO,CAAC;AACvC,MAAI,KAAK,QAAQ,0BAA0B;AACzC,WAAO,MAAM,aAAa,IAAI,EAAE,eAAe,MAAM,aAAa,EAAE,IAAI,CAAC;AAAA,EAC3E;AAEA,SAAO;AAAA,IACL,eAAe,MAAM,aAAa,SAAK,uCAAuB,KAAK,WAAW;AAAA,EAChF;AACF;AAEA,MAAM,yBAA4C,CAAC,OAAO,SAAS;AACjE,MAAI,KAAK,gBAAgB,KAAM,QAAO,CAAC;AAEvC,MAAI,CAAC,MAAM,yBAAyB;
|
|
4
|
+
"sourcesContent": ["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { displayNameToKebabCase, displayNameToPropCase } from '../helpers.js';\nimport type { AttrsFunc, InternalAttrsFunc, Options, OwnerInterface, PartProps } from '../types.js';\n\nconst generateClassName: InternalAttrsFunc = (props, meta) => {\n if (meta.displayName === null) return {};\n return {\n className: meta.displayName,\n };\n};\n\nconst generateDataTestId: InternalAttrsFunc<{ 'data-testid': string }> = (props, meta) => {\n if (meta.displayName === null) return {};\n if (meta.options.preserveLegacyDataTestId) {\n return props['data-testid'] ? { 'data-testid': props['data-testid'] } : {};\n }\n\n return {\n 'data-testid': props['data-testid'] ?? displayNameToKebabCase(meta.displayName),\n };\n};\n\nconst generateDataDimsumSlot: InternalAttrsFunc = (props, meta) => {\n if (meta.displayName === null) return {};\n\n if (!props.didDefinedGetOwnerProps) {\n // temp disabling the warning because we don't want final app to be affected, next branch has correct logic here already, hotfix can just remove the warning\n // if (process.env.NODE_ENV !== 'production') {\n // console.warn(\n // `The component ${meta.displayName} does not define the 'getOwnerProps' function. The 'data-dimsum-slot' attribute will not be generated.\n // This is required for the slot system to work correctly. Please ensure that the component is properly configured.`,\n // );\n // }\n return {};\n }\n const finalProps: Record<string, unknown> = {};\n if (props['data-dimsum-slot']) {\n finalProps['data-dimsum-parent-slot'] = props['data-dimsum-slot'];\n }\n return {\n ...finalProps,\n 'data-dimsum-slot': displayNameToPropCase(meta.displayName),\n };\n};\n\nexport const getPartProps = (\n props: { 'data-testid': string; 'data-dimsum-slot': string } & OwnerInterface,\n): Record<string, unknown> => {\n const { getOwnerProps, getOwnerPropsArguments } = props;\n\n // If no ownerProps are provided, we won't add global attributes\n if (getOwnerProps === undefined) return {};\n\n const ownerPropsValue = getOwnerProps() as Record<string, PartProps>;\n const ownerPropsArgumentsValue = getOwnerPropsArguments?.() ?? {};\n\n // TODO: @carusox deprecate data-testid usage in favor of data-dimsum-slot\n const elementProps = ownerPropsValue[props['data-dimsum-slot']] ?? ownerPropsValue[props['data-testid']];\n\n // If no elementProps are present, we won't add global attributes either\n if (elementProps === undefined || elementProps === null) return {};\n\n // If elementProps is a function, we call it with the ownerPropsArguments\n // Otherwise we assign it directly\n const resultingObject = typeof elementProps === 'function' ? elementProps(ownerPropsArgumentsValue) : elementProps;\n\n return resultingObject;\n};\n\nconst wrap =\n <T extends object>(\n func: InternalAttrsFunc<T>,\n meta: { options: Options; displayName: string | null },\n ): AttrsFunc<T> =>\n (props) =>\n func(props, meta);\n\nexport const generateAttributes = (options: Options, displayName: string | null): AttrsFunc<any>[] => {\n const meta = { options, displayName };\n\n // Comprehensive list of all the generators above\n // ORDER MATTERS: the attributes returned by previous functions, are received as props by the next ones\n return [wrap(generateClassName, meta), wrap(generateDataTestId, meta), wrap(generateDataDimsumSlot, meta)];\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,qBAA8D;AAG9D,MAAM,oBAAuC,CAAC,OAAO,SAAS;AAC5D,MAAI,KAAK,gBAAgB,KAAM,QAAO,CAAC;AACvC,SAAO;AAAA,IACL,WAAW,KAAK;AAAA,EAClB;AACF;AAEA,MAAM,qBAAmE,CAAC,OAAO,SAAS;AACxF,MAAI,KAAK,gBAAgB,KAAM,QAAO,CAAC;AACvC,MAAI,KAAK,QAAQ,0BAA0B;AACzC,WAAO,MAAM,aAAa,IAAI,EAAE,eAAe,MAAM,aAAa,EAAE,IAAI,CAAC;AAAA,EAC3E;AAEA,SAAO;AAAA,IACL,eAAe,MAAM,aAAa,SAAK,uCAAuB,KAAK,WAAW;AAAA,EAChF;AACF;AAEA,MAAM,yBAA4C,CAAC,OAAO,SAAS;AACjE,MAAI,KAAK,gBAAgB,KAAM,QAAO,CAAC;AAEvC,MAAI,CAAC,MAAM,yBAAyB;AAQlC,WAAO,CAAC;AAAA,EACV;AACA,QAAM,aAAsC,CAAC;AAC7C,MAAI,MAAM,kBAAkB,GAAG;AAC7B,eAAW,yBAAyB,IAAI,MAAM,kBAAkB;AAAA,EAClE;AACA,SAAO;AAAA,IACL,GAAG;AAAA,IACH,wBAAoB,sCAAsB,KAAK,WAAW;AAAA,EAC5D;AACF;AAEO,MAAM,eAAe,CAC1B,UAC4B;AAC5B,QAAM,EAAE,eAAe,uBAAuB,IAAI;AAGlD,MAAI,kBAAkB,OAAW,QAAO,CAAC;AAEzC,QAAM,kBAAkB,cAAc;AACtC,QAAM,2BAA2B,yBAAyB,KAAK,CAAC;AAGhE,QAAM,eAAe,gBAAgB,MAAM,kBAAkB,CAAC,KAAK,gBAAgB,MAAM,aAAa,CAAC;AAGvG,MAAI,iBAAiB,UAAa,iBAAiB,KAAM,QAAO,CAAC;AAIjE,QAAM,kBAAkB,OAAO,iBAAiB,aAAa,aAAa,wBAAwB,IAAI;AAEtG,SAAO;AACT;AAEA,MAAM,OACJ,CACE,MACA,SAEF,CAAC,UACC,KAAK,OAAO,IAAI;AAEb,MAAM,qBAAqB,CAAC,SAAkB,gBAAiD;AACpG,QAAM,OAAO,EAAE,SAAS,YAAY;AAIpC,SAAO,CAAC,KAAK,mBAAmB,IAAI,GAAG,KAAK,oBAAoB,IAAI,GAAG,KAAK,wBAAwB,IAAI,CAAC;AAC3G;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -18,12 +18,6 @@ const generateDataTestId = (props, meta) => {
|
|
|
18
18
|
const generateDataDimsumSlot = (props, meta) => {
|
|
19
19
|
if (meta.displayName === null) return {};
|
|
20
20
|
if (!props.didDefinedGetOwnerProps) {
|
|
21
|
-
if (true) {
|
|
22
|
-
console.warn(
|
|
23
|
-
`The component ${meta.displayName} does not define the 'getOwnerProps' function. The 'data-dimsum-slot' attribute will not be generated.
|
|
24
|
-
This is required for the slot system to work correctly. Please ensure that the component is properly configured.`
|
|
25
|
-
);
|
|
26
|
-
}
|
|
27
21
|
return {};
|
|
28
22
|
}
|
|
29
23
|
const finalProps = {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/styled/generated-attributes/generateAttributes.ts"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { displayNameToKebabCase, displayNameToPropCase } from '../helpers.js';\nimport type { AttrsFunc, InternalAttrsFunc, Options, OwnerInterface, PartProps } from '../types.js';\n\nconst generateClassName: InternalAttrsFunc = (props, meta) => {\n if (meta.displayName === null) return {};\n return {\n className: meta.displayName,\n };\n};\n\nconst generateDataTestId: InternalAttrsFunc<{ 'data-testid': string }> = (props, meta) => {\n if (meta.displayName === null) return {};\n if (meta.options.preserveLegacyDataTestId) {\n return props['data-testid'] ? { 'data-testid': props['data-testid'] } : {};\n }\n\n return {\n 'data-testid': props['data-testid'] ?? displayNameToKebabCase(meta.displayName),\n };\n};\n\nconst generateDataDimsumSlot: InternalAttrsFunc = (props, meta) => {\n if (meta.displayName === null) return {};\n\n if (!props.didDefinedGetOwnerProps) {\n if (process.env.NODE_ENV !== 'production') {\n
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,wBAAwB,6BAA6B;AAG9D,MAAM,oBAAuC,CAAC,OAAO,SAAS;AAC5D,MAAI,KAAK,gBAAgB,KAAM,QAAO,CAAC;AACvC,SAAO;AAAA,IACL,WAAW,KAAK;AAAA,EAClB;AACF;AAEA,MAAM,qBAAmE,CAAC,OAAO,SAAS;AACxF,MAAI,KAAK,gBAAgB,KAAM,QAAO,CAAC;AACvC,MAAI,KAAK,QAAQ,0BAA0B;AACzC,WAAO,MAAM,aAAa,IAAI,EAAE,eAAe,MAAM,aAAa,EAAE,IAAI,CAAC;AAAA,EAC3E;AAEA,SAAO;AAAA,IACL,eAAe,MAAM,aAAa,KAAK,uBAAuB,KAAK,WAAW;AAAA,EAChF;AACF;AAEA,MAAM,yBAA4C,CAAC,OAAO,SAAS;AACjE,MAAI,KAAK,gBAAgB,KAAM,QAAO,CAAC;AAEvC,MAAI,CAAC,MAAM,yBAAyB;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { displayNameToKebabCase, displayNameToPropCase } from '../helpers.js';\nimport type { AttrsFunc, InternalAttrsFunc, Options, OwnerInterface, PartProps } from '../types.js';\n\nconst generateClassName: InternalAttrsFunc = (props, meta) => {\n if (meta.displayName === null) return {};\n return {\n className: meta.displayName,\n };\n};\n\nconst generateDataTestId: InternalAttrsFunc<{ 'data-testid': string }> = (props, meta) => {\n if (meta.displayName === null) return {};\n if (meta.options.preserveLegacyDataTestId) {\n return props['data-testid'] ? { 'data-testid': props['data-testid'] } : {};\n }\n\n return {\n 'data-testid': props['data-testid'] ?? displayNameToKebabCase(meta.displayName),\n };\n};\n\nconst generateDataDimsumSlot: InternalAttrsFunc = (props, meta) => {\n if (meta.displayName === null) return {};\n\n if (!props.didDefinedGetOwnerProps) {\n // temp disabling the warning because we don't want final app to be affected, next branch has correct logic here already, hotfix can just remove the warning\n // if (process.env.NODE_ENV !== 'production') {\n // console.warn(\n // `The component ${meta.displayName} does not define the 'getOwnerProps' function. The 'data-dimsum-slot' attribute will not be generated.\n // This is required for the slot system to work correctly. Please ensure that the component is properly configured.`,\n // );\n // }\n return {};\n }\n const finalProps: Record<string, unknown> = {};\n if (props['data-dimsum-slot']) {\n finalProps['data-dimsum-parent-slot'] = props['data-dimsum-slot'];\n }\n return {\n ...finalProps,\n 'data-dimsum-slot': displayNameToPropCase(meta.displayName),\n };\n};\n\nexport const getPartProps = (\n props: { 'data-testid': string; 'data-dimsum-slot': string } & OwnerInterface,\n): Record<string, unknown> => {\n const { getOwnerProps, getOwnerPropsArguments } = props;\n\n // If no ownerProps are provided, we won't add global attributes\n if (getOwnerProps === undefined) return {};\n\n const ownerPropsValue = getOwnerProps() as Record<string, PartProps>;\n const ownerPropsArgumentsValue = getOwnerPropsArguments?.() ?? {};\n\n // TODO: @carusox deprecate data-testid usage in favor of data-dimsum-slot\n const elementProps = ownerPropsValue[props['data-dimsum-slot']] ?? ownerPropsValue[props['data-testid']];\n\n // If no elementProps are present, we won't add global attributes either\n if (elementProps === undefined || elementProps === null) return {};\n\n // If elementProps is a function, we call it with the ownerPropsArguments\n // Otherwise we assign it directly\n const resultingObject = typeof elementProps === 'function' ? elementProps(ownerPropsArgumentsValue) : elementProps;\n\n return resultingObject;\n};\n\nconst wrap =\n <T extends object>(\n func: InternalAttrsFunc<T>,\n meta: { options: Options; displayName: string | null },\n ): AttrsFunc<T> =>\n (props) =>\n func(props, meta);\n\nexport const generateAttributes = (options: Options, displayName: string | null): AttrsFunc<any>[] => {\n const meta = { options, displayName };\n\n // Comprehensive list of all the generators above\n // ORDER MATTERS: the attributes returned by previous functions, are received as props by the next ones\n return [wrap(generateClassName, meta), wrap(generateDataTestId, meta), wrap(generateDataDimsumSlot, meta)];\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,wBAAwB,6BAA6B;AAG9D,MAAM,oBAAuC,CAAC,OAAO,SAAS;AAC5D,MAAI,KAAK,gBAAgB,KAAM,QAAO,CAAC;AACvC,SAAO;AAAA,IACL,WAAW,KAAK;AAAA,EAClB;AACF;AAEA,MAAM,qBAAmE,CAAC,OAAO,SAAS;AACxF,MAAI,KAAK,gBAAgB,KAAM,QAAO,CAAC;AACvC,MAAI,KAAK,QAAQ,0BAA0B;AACzC,WAAO,MAAM,aAAa,IAAI,EAAE,eAAe,MAAM,aAAa,EAAE,IAAI,CAAC;AAAA,EAC3E;AAEA,SAAO;AAAA,IACL,eAAe,MAAM,aAAa,KAAK,uBAAuB,KAAK,WAAW;AAAA,EAChF;AACF;AAEA,MAAM,yBAA4C,CAAC,OAAO,SAAS;AACjE,MAAI,KAAK,gBAAgB,KAAM,QAAO,CAAC;AAEvC,MAAI,CAAC,MAAM,yBAAyB;AAQlC,WAAO,CAAC;AAAA,EACV;AACA,QAAM,aAAsC,CAAC;AAC7C,MAAI,MAAM,kBAAkB,GAAG;AAC7B,eAAW,yBAAyB,IAAI,MAAM,kBAAkB;AAAA,EAClE;AACA,SAAO;AAAA,IACL,GAAG;AAAA,IACH,oBAAoB,sBAAsB,KAAK,WAAW;AAAA,EAC5D;AACF;AAEO,MAAM,eAAe,CAC1B,UAC4B;AAC5B,QAAM,EAAE,eAAe,uBAAuB,IAAI;AAGlD,MAAI,kBAAkB,OAAW,QAAO,CAAC;AAEzC,QAAM,kBAAkB,cAAc;AACtC,QAAM,2BAA2B,yBAAyB,KAAK,CAAC;AAGhE,QAAM,eAAe,gBAAgB,MAAM,kBAAkB,CAAC,KAAK,gBAAgB,MAAM,aAAa,CAAC;AAGvG,MAAI,iBAAiB,UAAa,iBAAiB,KAAM,QAAO,CAAC;AAIjE,QAAM,kBAAkB,OAAO,iBAAiB,aAAa,aAAa,wBAAwB,IAAI;AAEtG,SAAO;AACT;AAEA,MAAM,OACJ,CACE,MACA,SAEF,CAAC,UACC,KAAK,OAAO,IAAI;AAEb,MAAM,qBAAqB,CAAC,SAAkB,gBAAiD;AACpG,QAAM,OAAO,EAAE,SAAS,YAAY;AAIpC,SAAO,CAAC,KAAK,mBAAmB,IAAI,GAAG,KAAK,oBAAoB,IAAI,GAAG,KAAK,wBAAwB,IAAI,CAAC;AAC3G;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-system",
|
|
3
|
-
"version": "3.54.
|
|
3
|
+
"version": "3.54.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - System",
|
|
6
6
|
"files": [
|
|
@@ -51,8 +51,8 @@
|
|
|
51
51
|
"jest": "~29.7.0",
|
|
52
52
|
"jest-cli": "~29.7.0",
|
|
53
53
|
"styled-components": "~5.3.9",
|
|
54
|
-
"@elliemae/ds-monorepo-devops": "3.54.
|
|
55
|
-
"@elliemae/ds-typescript-helpers": "3.54.
|
|
54
|
+
"@elliemae/ds-monorepo-devops": "3.54.2",
|
|
55
|
+
"@elliemae/ds-typescript-helpers": "3.54.2"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
58
|
"@elliemae/pui-theme": "~2.13.0",
|