@planningcenter/tapestry-migration-cli 3.6.0 → 3.6.1-qa-1035.0
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/tapestry-react-shim.cjs +195 -11
- package/package.json +3 -3
- package/src/components/flex/index.test.ts +151 -0
- package/src/components/flex/index.ts +14 -0
- package/src/components/flex/transforms/auditSpreadProps.test.ts +93 -0
- package/src/components/flex/transforms/auditSpreadProps.ts +6 -0
- package/src/components/flex/transforms/axisToDirection.test.ts +15 -0
- package/src/components/flex/transforms/axisToDirection.ts +26 -0
- package/src/components/flex/transforms/convertStyleProps.test.ts +147 -0
- package/src/components/flex/transforms/convertStyleProps.ts +23 -0
- package/src/components/flex/transforms/cssFlexAliasesToProps.test.ts +202 -0
- package/src/components/flex/transforms/cssFlexAliasesToProps.ts +110 -0
- package/src/components/flex/transforms/flexPropToExpand.test.ts +156 -0
- package/src/components/flex/transforms/flexPropToExpand.ts +100 -0
- package/src/components/flex/transforms/mediaQueriesToResponsive.test.ts +714 -0
- package/src/components/flex/transforms/mediaQueriesToResponsive.ts +523 -0
- package/src/components/flex/transforms/paddingPropsToFlex.test.ts +252 -0
- package/src/components/flex/transforms/paddingPropsToFlex.ts +150 -0
- package/src/components/flex/transforms/setDefaultAxis.test.ts +12 -0
- package/src/components/flex/transforms/setDefaultAxis.ts +1 -0
- package/src/components/flex/transforms/unsupportedProps.test.ts +141 -0
- package/src/components/flex/transforms/unsupportedProps.ts +17 -0
- package/src/components/shared/helpers/unsupportedPropsHelpers.ts +41 -0
- package/src/components/shared/transformFactories/stylePropTransformFactory.test.ts +47 -0
- package/src/components/shared/transformFactories/stylePropTransformFactory.ts +16 -0
|
@@ -81,6 +81,19 @@ function extractPropValue(attr: JSXAttribute, j: JSCodeshift) {
|
|
|
81
81
|
return expression.value
|
|
82
82
|
} else if (expression.type === "NumericLiteral") {
|
|
83
83
|
return expression.value
|
|
84
|
+
} else if (expression.type === "UnaryExpression") {
|
|
85
|
+
const unary = expression as unknown as {
|
|
86
|
+
argument?: { type?: string; value?: unknown }
|
|
87
|
+
operator: string
|
|
88
|
+
}
|
|
89
|
+
if (
|
|
90
|
+
unary.operator === "-" &&
|
|
91
|
+
unary.argument?.type === "NumericLiteral" &&
|
|
92
|
+
typeof unary.argument.value === "number"
|
|
93
|
+
) {
|
|
94
|
+
return -unary.argument.value
|
|
95
|
+
}
|
|
96
|
+
return `{${j(expression).toSource()}}`
|
|
84
97
|
} else if (expression.type === "BooleanLiteral") {
|
|
85
98
|
return expression.value
|
|
86
99
|
} else if (expression.type === "Identifier") {
|
|
@@ -363,6 +376,7 @@ export function stylePropTransformFactory(config: {
|
|
|
363
376
|
styleProps: string[]
|
|
364
377
|
}
|
|
365
378
|
stylePropMapping?: StylePropMapping
|
|
379
|
+
stylesToExclude?: string[]
|
|
366
380
|
stylesToKeep?: string[]
|
|
367
381
|
stylesToRemove: string[]
|
|
368
382
|
targetComponent: string
|
|
@@ -370,6 +384,7 @@ export function stylePropTransformFactory(config: {
|
|
|
370
384
|
}): Transform {
|
|
371
385
|
const {
|
|
372
386
|
stylePropMapping = {} as StylePropMapping,
|
|
387
|
+
stylesToExclude = [],
|
|
373
388
|
stylesToKeep = [],
|
|
374
389
|
stylesToRemove,
|
|
375
390
|
} = config
|
|
@@ -387,6 +402,7 @@ export function stylePropTransformFactory(config: {
|
|
|
387
402
|
return (
|
|
388
403
|
name &&
|
|
389
404
|
name !== "css" &&
|
|
405
|
+
!stylesToExclude.includes(name) &&
|
|
390
406
|
(stylePropNames.includes(name) ||
|
|
391
407
|
name in stylePropMapping ||
|
|
392
408
|
stylesToKeep.includes(name) ||
|