@tamagui/style-grammar 0.0.0-bootstrap.0 → 3.0.0-beta.643.1
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/LICENSE +21 -0
- package/README.md +33 -1
- package/dist/cjs/backgroundFamily.cjs +176 -0
- package/dist/cjs/backgroundFamily.native.cjs +195 -0
- package/dist/cjs/backgroundFamily.native.js +197 -0
- package/dist/cjs/backgroundFamily.native.js.map +1 -0
- package/dist/cjs/borderFamily.cjs +169 -0
- package/dist/cjs/borderFamily.native.cjs +247 -0
- package/dist/cjs/borderFamily.native.js +249 -0
- package/dist/cjs/borderFamily.native.js.map +1 -0
- package/dist/cjs/candidate.cjs +608 -0
- package/dist/cjs/candidate.native.cjs +821 -0
- package/dist/cjs/candidate.native.js +823 -0
- package/dist/cjs/candidate.native.js.map +1 -0
- package/dist/cjs/candidateTarget.cjs +50 -0
- package/dist/cjs/candidateTarget.native.cjs +88 -0
- package/dist/cjs/candidateTarget.native.js +90 -0
- package/dist/cjs/candidateTarget.native.js.map +1 -0
- package/dist/cjs/clauseCapability.cjs +130 -0
- package/dist/cjs/clauseCapability.native.cjs +152 -0
- package/dist/cjs/clauseCapability.native.js +154 -0
- package/dist/cjs/clauseCapability.native.js.map +1 -0
- package/dist/cjs/clausePrecedence.cjs +153 -0
- package/dist/cjs/clausePrecedence.native.cjs +204 -0
- package/dist/cjs/clausePrecedence.native.js +206 -0
- package/dist/cjs/clausePrecedence.native.js.map +1 -0
- package/dist/cjs/clauseSources.cjs +47 -0
- package/dist/cjs/clauseSources.native.cjs +49 -0
- package/dist/cjs/clauseSources.native.js +51 -0
- package/dist/cjs/clauseSources.native.js.map +1 -0
- package/dist/cjs/config.cjs +130 -0
- package/dist/cjs/config.native.cjs +185 -0
- package/dist/cjs/config.native.js +187 -0
- package/dist/cjs/config.native.js.map +1 -0
- package/dist/cjs/evaluateProgram.cjs +65 -0
- package/dist/cjs/evaluateProgram.native.cjs +70 -0
- package/dist/cjs/evaluateProgram.native.js +72 -0
- package/dist/cjs/evaluateProgram.native.js.map +1 -0
- package/dist/cjs/fontShorthand.cjs +207 -0
- package/dist/cjs/fontShorthand.native.cjs +260 -0
- package/dist/cjs/fontShorthand.native.js +262 -0
- package/dist/cjs/fontShorthand.native.js.map +1 -0
- package/dist/cjs/geometricShorthand.cjs +122 -0
- package/dist/cjs/geometricShorthand.native.cjs +128 -0
- package/dist/cjs/geometricShorthand.native.js +130 -0
- package/dist/cjs/geometricShorthand.native.js.map +1 -0
- package/dist/cjs/index.cjs +19 -0
- package/dist/cjs/index.native.cjs +21 -0
- package/dist/cjs/index.native.js +23 -0
- package/dist/cjs/index.native.js.map +1 -0
- package/dist/cjs/lowerProgram.cjs +205 -0
- package/dist/cjs/lowerProgram.native.cjs +257 -0
- package/dist/cjs/lowerProgram.native.js +259 -0
- package/dist/cjs/lowerProgram.native.js.map +1 -0
- package/dist/cjs/mergeFlatValues.cjs +50 -0
- package/dist/cjs/mergeFlatValues.native.cjs +71 -0
- package/dist/cjs/mergeFlatValues.native.js +73 -0
- package/dist/cjs/mergeFlatValues.native.js.map +1 -0
- package/dist/cjs/modifierRegistry.cjs +246 -0
- package/dist/cjs/modifierRegistry.native.cjs +426 -0
- package/dist/cjs/modifierRegistry.native.js +428 -0
- package/dist/cjs/modifierRegistry.native.js.map +1 -0
- package/dist/cjs/payloadShape.cjs +69 -0
- package/dist/cjs/payloadShape.native.cjs +71 -0
- package/dist/cjs/payloadShape.native.js +73 -0
- package/dist/cjs/payloadShape.native.js.map +1 -0
- package/dist/cjs/programEligibility.cjs +46 -0
- package/dist/cjs/programEligibility.native.cjs +48 -0
- package/dist/cjs/programEligibility.native.js +50 -0
- package/dist/cjs/programEligibility.native.js.map +1 -0
- package/dist/cjs/programHash.cjs +86 -0
- package/dist/cjs/programHash.native.cjs +106 -0
- package/dist/cjs/programHash.native.js +108 -0
- package/dist/cjs/programHash.native.js.map +1 -0
- package/dist/cjs/programs.cjs +128 -0
- package/dist/cjs/programs.native.cjs +220 -0
- package/dist/cjs/programs.native.js +222 -0
- package/dist/cjs/programs.native.js.map +1 -0
- package/dist/cjs/registry.cjs +629 -0
- package/dist/cjs/registry.native.cjs +635 -0
- package/dist/cjs/registry.native.js +637 -0
- package/dist/cjs/registry.native.js.map +1 -0
- package/dist/cjs/resolvePayload.cjs +296 -0
- package/dist/cjs/resolvePayload.native.cjs +302 -0
- package/dist/cjs/resolvePayload.native.js +304 -0
- package/dist/cjs/resolvePayload.native.js.map +1 -0
- package/dist/cjs/runtime.cjs +50 -0
- package/dist/cjs/runtime.native.cjs +52 -0
- package/dist/cjs/runtime.native.js +54 -0
- package/dist/cjs/runtime.native.js.map +1 -0
- package/dist/cjs/safeAreaVariables.cjs +42 -0
- package/dist/cjs/safeAreaVariables.native.cjs +44 -0
- package/dist/cjs/safeAreaVariables.native.js +46 -0
- package/dist/cjs/safeAreaVariables.native.js.map +1 -0
- package/dist/cjs/scanFlatValue.cjs +181 -0
- package/dist/cjs/scanFlatValue.native.cjs +183 -0
- package/dist/cjs/scanFlatValue.native.js +185 -0
- package/dist/cjs/scanFlatValue.native.js.map +1 -0
- package/dist/cjs/serializePayload.cjs +149 -0
- package/dist/cjs/serializePayload.native.cjs +187 -0
- package/dist/cjs/serializePayload.native.js +189 -0
- package/dist/cjs/serializePayload.native.js.map +1 -0
- package/dist/cjs/stateModifiers.cjs +43 -0
- package/dist/cjs/stateModifiers.native.cjs +45 -0
- package/dist/cjs/stateModifiers.native.js +47 -0
- package/dist/cjs/stateModifiers.native.js.map +1 -0
- package/dist/cjs/states.cjs +97 -0
- package/dist/cjs/states.native.cjs +131 -0
- package/dist/cjs/states.native.js +133 -0
- package/dist/cjs/states.native.js.map +1 -0
- package/dist/cjs/table.cjs +54 -0
- package/dist/cjs/table.native.cjs +135 -0
- package/dist/cjs/table.native.js +137 -0
- package/dist/cjs/table.native.js.map +1 -0
- package/dist/cjs/textDecorationFamily.cjs +129 -0
- package/dist/cjs/textDecorationFamily.native.cjs +199 -0
- package/dist/cjs/textDecorationFamily.native.js +201 -0
- package/dist/cjs/textDecorationFamily.native.js.map +1 -0
- package/dist/cjs/tooling.cjs +26 -0
- package/dist/cjs/tooling.native.cjs +28 -0
- package/dist/cjs/tooling.native.js +30 -0
- package/dist/cjs/tooling.native.js.map +1 -0
- package/dist/cjs/toolingAnnotations.cjs +105 -0
- package/dist/cjs/toolingAnnotations.native.cjs +133 -0
- package/dist/cjs/toolingAnnotations.native.js +135 -0
- package/dist/cjs/toolingAnnotations.native.js.map +1 -0
- package/dist/cjs/toolingDiagnostics.cjs +459 -0
- package/dist/cjs/toolingDiagnostics.native.cjs +788 -0
- package/dist/cjs/toolingDiagnostics.native.js +790 -0
- package/dist/cjs/toolingDiagnostics.native.js.map +1 -0
- package/dist/cjs/toolingRegistry.cjs +159 -0
- package/dist/cjs/toolingRegistry.native.cjs +164 -0
- package/dist/cjs/toolingRegistry.native.js +166 -0
- package/dist/cjs/toolingRegistry.native.js.map +1 -0
- package/dist/cjs/transformFamily.cjs +425 -0
- package/dist/cjs/transformFamily.native.cjs +517 -0
- package/dist/cjs/transformFamily.native.js +519 -0
- package/dist/cjs/transformFamily.native.js.map +1 -0
- package/dist/cjs/transition.cjs +459 -0
- package/dist/cjs/transition.native.cjs +499 -0
- package/dist/cjs/transition.native.js +501 -0
- package/dist/cjs/transition.native.js.map +1 -0
- package/dist/cjs/transitionAlign.cjs +115 -0
- package/dist/cjs/transitionAlign.native.cjs +154 -0
- package/dist/cjs/transitionAlign.native.js +156 -0
- package/dist/cjs/transitionAlign.native.js.map +1 -0
- package/dist/cjs/transitionLegacy.cjs +217 -0
- package/dist/cjs/transitionLegacy.native.cjs +260 -0
- package/dist/cjs/transitionLegacy.native.js +262 -0
- package/dist/cjs/transitionLegacy.native.js.map +1 -0
- package/dist/cjs/transitionNative.cjs +281 -0
- package/dist/cjs/transitionNative.native.cjs +285 -0
- package/dist/cjs/transitionNative.native.js +287 -0
- package/dist/cjs/transitionNative.native.js.map +1 -0
- package/dist/cjs/unitlessNumbers.cjs +86 -0
- package/dist/cjs/unitlessNumbers.native.cjs +106 -0
- package/dist/cjs/unitlessNumbers.native.js +108 -0
- package/dist/cjs/unitlessNumbers.native.js.map +1 -0
- package/dist/cjs/v6ThemeNames.cjs +47 -0
- package/dist/cjs/v6ThemeNames.native.cjs +53 -0
- package/dist/cjs/v6ThemeNames.native.js +55 -0
- package/dist/cjs/v6ThemeNames.native.js.map +1 -0
- package/dist/cjs/valueParser.cjs +148 -0
- package/dist/cjs/valueParser.native.cjs +150 -0
- package/dist/cjs/valueParser.native.js +152 -0
- package/dist/cjs/valueParser.native.js.map +1 -0
- package/dist/cjs/valueTypes.cjs +38 -0
- package/dist/cjs/valueTypes.native.cjs +40 -0
- package/dist/cjs/valueTypes.native.js +42 -0
- package/dist/cjs/valueTypes.native.js.map +1 -0
- package/dist/esm/backgroundFamily.mjs +150 -0
- package/dist/esm/backgroundFamily.mjs.map +1 -0
- package/dist/esm/backgroundFamily.native.js +167 -0
- package/dist/esm/backgroundFamily.native.js.map +1 -0
- package/dist/esm/borderFamily.mjs +146 -0
- package/dist/esm/borderFamily.mjs.map +1 -0
- package/dist/esm/borderFamily.native.js +222 -0
- package/dist/esm/borderFamily.native.js.map +1 -0
- package/dist/esm/candidate.mjs +581 -0
- package/dist/esm/candidate.mjs.map +1 -0
- package/dist/esm/candidate.native.js +792 -0
- package/dist/esm/candidate.native.js.map +1 -0
- package/dist/esm/candidateTarget.mjs +29 -0
- package/dist/esm/candidateTarget.mjs.map +1 -0
- package/dist/esm/candidateTarget.native.js +65 -0
- package/dist/esm/candidateTarget.native.js.map +1 -0
- package/dist/esm/clauseCapability.mjs +107 -0
- package/dist/esm/clauseCapability.mjs.map +1 -0
- package/dist/esm/clauseCapability.native.js +127 -0
- package/dist/esm/clauseCapability.native.js.map +1 -0
- package/dist/esm/clausePrecedence.mjs +121 -0
- package/dist/esm/clausePrecedence.mjs.map +1 -0
- package/dist/esm/clausePrecedence.native.js +170 -0
- package/dist/esm/clausePrecedence.native.js.map +1 -0
- package/dist/esm/clauseSources.mjs +23 -0
- package/dist/esm/clauseSources.mjs.map +1 -0
- package/dist/esm/clauseSources.native.js +23 -0
- package/dist/esm/clauseSources.native.js.map +1 -0
- package/dist/esm/config.mjs +103 -0
- package/dist/esm/config.mjs.map +1 -0
- package/dist/esm/config.native.js +156 -0
- package/dist/esm/config.native.js.map +1 -0
- package/dist/esm/evaluateProgram.mjs +45 -0
- package/dist/esm/evaluateProgram.mjs.map +1 -0
- package/dist/esm/evaluateProgram.native.js +48 -0
- package/dist/esm/evaluateProgram.native.js.map +1 -0
- package/dist/esm/fontShorthand.mjs +184 -0
- package/dist/esm/fontShorthand.mjs.map +1 -0
- package/dist/esm/fontShorthand.native.js +235 -0
- package/dist/esm/fontShorthand.native.js.map +1 -0
- package/dist/esm/geometricShorthand.mjs +102 -0
- package/dist/esm/geometricShorthand.mjs.map +1 -0
- package/dist/esm/geometricShorthand.native.js +106 -0
- package/dist/esm/geometricShorthand.native.js.map +1 -0
- package/dist/esm/index.mjs +1 -0
- package/dist/esm/index.native.js +1 -0
- package/dist/esm/lowerProgram.mjs +182 -0
- package/dist/esm/lowerProgram.mjs.map +1 -0
- package/dist/esm/lowerProgram.native.js +232 -0
- package/dist/esm/lowerProgram.native.js.map +1 -0
- package/dist/esm/mergeFlatValues.mjs +27 -0
- package/dist/esm/mergeFlatValues.mjs.map +1 -0
- package/dist/esm/mergeFlatValues.native.js +46 -0
- package/dist/esm/mergeFlatValues.native.js.map +1 -0
- package/dist/esm/modifierRegistry.mjs +219 -0
- package/dist/esm/modifierRegistry.mjs.map +1 -0
- package/dist/esm/modifierRegistry.native.js +397 -0
- package/dist/esm/modifierRegistry.native.js.map +1 -0
- package/dist/esm/payloadShape.mjs +49 -0
- package/dist/esm/payloadShape.mjs.map +1 -0
- package/dist/esm/payloadShape.native.js +49 -0
- package/dist/esm/payloadShape.native.js.map +1 -0
- package/dist/esm/programEligibility.mjs +22 -0
- package/dist/esm/programEligibility.mjs.map +1 -0
- package/dist/esm/programEligibility.native.js +22 -0
- package/dist/esm/programEligibility.native.js.map +1 -0
- package/dist/esm/programHash.mjs +62 -0
- package/dist/esm/programHash.mjs.map +1 -0
- package/dist/esm/programHash.native.js +80 -0
- package/dist/esm/programHash.native.js.map +1 -0
- package/dist/esm/programs.mjs +103 -0
- package/dist/esm/programs.mjs.map +1 -0
- package/dist/esm/programs.native.js +193 -0
- package/dist/esm/programs.native.js.map +1 -0
- package/dist/esm/registry.mjs +595 -0
- package/dist/esm/registry.mjs.map +1 -0
- package/dist/esm/registry.native.js +599 -0
- package/dist/esm/registry.native.js.map +1 -0
- package/dist/esm/resolvePayload.mjs +273 -0
- package/dist/esm/resolvePayload.mjs.map +1 -0
- package/dist/esm/resolvePayload.native.js +277 -0
- package/dist/esm/resolvePayload.native.js.map +1 -0
- package/dist/esm/runtime.mjs +63 -0
- package/dist/esm/runtime.native.js +63 -0
- package/dist/esm/safeAreaVariables.mjs +18 -0
- package/dist/esm/safeAreaVariables.mjs.map +1 -0
- package/dist/esm/safeAreaVariables.native.js +18 -0
- package/dist/esm/safeAreaVariables.native.js.map +1 -0
- package/dist/esm/scanFlatValue.mjs +160 -0
- package/dist/esm/scanFlatValue.mjs.map +1 -0
- package/dist/esm/scanFlatValue.native.js +160 -0
- package/dist/esm/scanFlatValue.native.js.map +1 -0
- package/dist/esm/serializePayload.mjs +125 -0
- package/dist/esm/serializePayload.mjs.map +1 -0
- package/dist/esm/serializePayload.native.js +161 -0
- package/dist/esm/serializePayload.native.js.map +1 -0
- package/dist/esm/stateModifiers.mjs +19 -0
- package/dist/esm/stateModifiers.mjs.map +1 -0
- package/dist/esm/stateModifiers.native.js +19 -0
- package/dist/esm/stateModifiers.native.js.map +1 -0
- package/dist/esm/states.mjs +69 -0
- package/dist/esm/states.mjs.map +1 -0
- package/dist/esm/states.native.js +101 -0
- package/dist/esm/states.native.js.map +1 -0
- package/dist/esm/table.mjs +31 -0
- package/dist/esm/table.mjs.map +1 -0
- package/dist/esm/table.native.js +110 -0
- package/dist/esm/table.native.js.map +1 -0
- package/dist/esm/textDecorationFamily.mjs +106 -0
- package/dist/esm/textDecorationFamily.mjs.map +1 -0
- package/dist/esm/textDecorationFamily.native.js +174 -0
- package/dist/esm/textDecorationFamily.native.js.map +1 -0
- package/dist/esm/tooling.mjs +15 -0
- package/dist/esm/tooling.native.js +15 -0
- package/dist/esm/toolingAnnotations.mjs +85 -0
- package/dist/esm/toolingAnnotations.mjs.map +1 -0
- package/dist/esm/toolingAnnotations.native.js +111 -0
- package/dist/esm/toolingAnnotations.native.js.map +1 -0
- package/dist/esm/toolingDiagnostics.mjs +428 -0
- package/dist/esm/toolingDiagnostics.mjs.map +1 -0
- package/dist/esm/toolingDiagnostics.native.js +755 -0
- package/dist/esm/toolingDiagnostics.native.js.map +1 -0
- package/dist/esm/toolingRegistry.mjs +135 -0
- package/dist/esm/toolingRegistry.mjs.map +1 -0
- package/dist/esm/toolingRegistry.native.js +138 -0
- package/dist/esm/toolingRegistry.native.js.map +1 -0
- package/dist/esm/transformFamily.mjs +392 -0
- package/dist/esm/transformFamily.mjs.map +1 -0
- package/dist/esm/transformFamily.native.js +482 -0
- package/dist/esm/transformFamily.native.js.map +1 -0
- package/dist/esm/transition.mjs +434 -0
- package/dist/esm/transition.mjs.map +1 -0
- package/dist/esm/transition.native.js +472 -0
- package/dist/esm/transition.native.js.map +1 -0
- package/dist/esm/transitionAlign.mjs +95 -0
- package/dist/esm/transitionAlign.mjs.map +1 -0
- package/dist/esm/transitionAlign.native.js +132 -0
- package/dist/esm/transitionAlign.native.js.map +1 -0
- package/dist/esm/transitionLegacy.mjs +197 -0
- package/dist/esm/transitionLegacy.mjs.map +1 -0
- package/dist/esm/transitionLegacy.native.js +238 -0
- package/dist/esm/transitionLegacy.native.js.map +1 -0
- package/dist/esm/transitionNative.mjs +257 -0
- package/dist/esm/transitionNative.mjs.map +1 -0
- package/dist/esm/transitionNative.native.js +259 -0
- package/dist/esm/transitionNative.native.js.map +1 -0
- package/dist/esm/unitlessNumbers.mjs +65 -0
- package/dist/esm/unitlessNumbers.mjs.map +1 -0
- package/dist/esm/unitlessNumbers.native.js +83 -0
- package/dist/esm/unitlessNumbers.native.js.map +1 -0
- package/dist/esm/v6ThemeNames.mjs +23 -0
- package/dist/esm/v6ThemeNames.mjs.map +1 -0
- package/dist/esm/v6ThemeNames.native.js +27 -0
- package/dist/esm/v6ThemeNames.native.js.map +1 -0
- package/dist/esm/valueParser.mjs +125 -0
- package/dist/esm/valueParser.mjs.map +1 -0
- package/dist/esm/valueParser.native.js +125 -0
- package/dist/esm/valueParser.native.js.map +1 -0
- package/dist/esm/valueTypes.mjs +14 -0
- package/dist/esm/valueTypes.mjs.map +1 -0
- package/dist/esm/valueTypes.native.js +14 -0
- package/dist/esm/valueTypes.native.js.map +1 -0
- package/package.json +98 -4
- package/src/backgroundFamily.ts +182 -0
- package/src/borderFamily.ts +172 -0
- package/src/candidate.ts +691 -0
- package/src/candidateTarget.ts +67 -0
- package/src/clauseCapability.ts +209 -0
- package/src/clausePrecedence.ts +198 -0
- package/src/clauseSources.ts +29 -0
- package/src/config.ts +169 -0
- package/src/evaluateProgram.ts +91 -0
- package/src/fontShorthand.ts +177 -0
- package/src/geometricShorthand.ts +105 -0
- package/src/index.ts +1 -0
- package/src/lowerProgram.ts +398 -0
- package/src/modifierRegistry.ts +340 -0
- package/src/payloadShape.ts +92 -0
- package/src/programEligibility.ts +46 -0
- package/src/programHash.ts +128 -0
- package/src/programs.ts +95 -0
- package/src/registry.ts +367 -0
- package/src/resolvePayload.ts +480 -0
- package/src/runtime.ts +32 -0
- package/src/safeAreaVariables.ts +19 -0
- package/src/scanFlatValue.ts +327 -0
- package/src/serializePayload.ts +199 -0
- package/src/stateModifiers.ts +36 -0
- package/src/states.ts +128 -0
- package/src/table.ts +47 -0
- package/src/textDecorationFamily.ts +119 -0
- package/src/tooling.ts +8 -0
- package/src/toolingAnnotations.ts +151 -0
- package/src/toolingDiagnostics.ts +735 -0
- package/src/toolingRegistry.ts +130 -0
- package/src/transformFamily.ts +590 -0
- package/src/transition.ts +553 -0
- package/src/transitionAlign.ts +165 -0
- package/src/transitionLegacy.ts +237 -0
- package/src/transitionNative.ts +357 -0
- package/src/unitlessNumbers.ts +61 -0
- package/src/v6ThemeNames.ts +40 -0
- package/src/valueParser.ts +193 -0
- package/src/valueTypes.ts +136 -0
- package/types/backgroundFamily.d.ts +17 -0
- package/types/backgroundFamily.d.ts.map +11 -0
- package/types/borderFamily.d.ts +23 -0
- package/types/borderFamily.d.ts.map +11 -0
- package/types/candidate.d.ts +52 -0
- package/types/candidate.d.ts.map +11 -0
- package/types/candidateTarget.d.ts +32 -0
- package/types/candidateTarget.d.ts.map +11 -0
- package/types/clauseCapability.d.ts +69 -0
- package/types/clauseCapability.d.ts.map +11 -0
- package/types/clausePrecedence.d.ts +30 -0
- package/types/clausePrecedence.d.ts.map +11 -0
- package/types/clauseSources.d.ts +12 -0
- package/types/clauseSources.d.ts.map +11 -0
- package/types/config.d.ts +44 -0
- package/types/config.d.ts.map +11 -0
- package/types/evaluateProgram.d.ts +27 -0
- package/types/evaluateProgram.d.ts.map +11 -0
- package/types/fontShorthand.d.ts +25 -0
- package/types/fontShorthand.d.ts.map +11 -0
- package/types/geometricShorthand.d.ts +21 -0
- package/types/geometricShorthand.d.ts.map +11 -0
- package/types/index.d.ts +3 -0
- package/types/index.d.ts.map +11 -0
- package/types/lowerProgram.d.ts +73 -0
- package/types/lowerProgram.d.ts.map +11 -0
- package/types/mergeFlatValues.d.ts +14 -0
- package/types/mergeFlatValues.d.ts.map +11 -0
- package/types/modifierRegistry.d.ts +70 -0
- package/types/modifierRegistry.d.ts.map +11 -0
- package/types/payloadShape.d.ts +15 -0
- package/types/payloadShape.d.ts.map +11 -0
- package/types/programEligibility.d.ts +23 -0
- package/types/programEligibility.d.ts.map +11 -0
- package/types/programHash.d.ts +20 -0
- package/types/programHash.d.ts.map +11 -0
- package/types/programs.d.ts +18 -0
- package/types/programs.d.ts.map +11 -0
- package/types/registry.d.ts +24 -0
- package/types/registry.d.ts.map +11 -0
- package/types/resolvePayload.d.ts +75 -0
- package/types/resolvePayload.d.ts.map +11 -0
- package/types/runtime.d.ts +34 -0
- package/types/runtime.d.ts.map +11 -0
- package/types/safeAreaVariables.d.ts +5 -0
- package/types/safeAreaVariables.d.ts.map +11 -0
- package/types/scanFlatValue.d.ts +29 -0
- package/types/scanFlatValue.d.ts.map +11 -0
- package/types/serializePayload.d.ts +13 -0
- package/types/serializePayload.d.ts.map +11 -0
- package/types/stateModifiers.d.ts +14 -0
- package/types/stateModifiers.d.ts.map +11 -0
- package/types/states.d.ts +22 -0
- package/types/states.d.ts.map +11 -0
- package/types/table.d.ts +4 -0
- package/types/table.d.ts.map +11 -0
- package/types/textDecorationFamily.d.ts +23 -0
- package/types/textDecorationFamily.d.ts.map +11 -0
- package/types/tooling.d.ts +10 -0
- package/types/tooling.d.ts.map +11 -0
- package/types/toolingAnnotations.d.ts +29 -0
- package/types/toolingAnnotations.d.ts.map +11 -0
- package/types/toolingDiagnostics.d.ts +114 -0
- package/types/toolingDiagnostics.d.ts.map +11 -0
- package/types/toolingRegistry.d.ts +10 -0
- package/types/toolingRegistry.d.ts.map +11 -0
- package/types/transformFamily.d.ts +83 -0
- package/types/transformFamily.d.ts.map +11 -0
- package/types/transition.d.ts +65 -0
- package/types/transition.d.ts.map +11 -0
- package/types/transitionAlign.d.ts +15 -0
- package/types/transitionAlign.d.ts.map +11 -0
- package/types/transitionLegacy.d.ts +9 -0
- package/types/transitionLegacy.d.ts.map +11 -0
- package/types/transitionNative.d.ts +41 -0
- package/types/transitionNative.d.ts.map +11 -0
- package/types/unitlessNumbers.d.ts +3 -0
- package/types/unitlessNumbers.d.ts.map +11 -0
- package/types/v6ThemeNames.d.ts +7 -0
- package/types/v6ThemeNames.d.ts.map +11 -0
- package/types/valueParser.d.ts +36 -0
- package/types/valueParser.d.ts.map +11 -0
- package/types/valueTypes.d.ts +66 -0
- package/types/valueTypes.d.ts.map +11 -0
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
TransitionDiagnostic,
|
|
3
|
+
TransitionEntry,
|
|
4
|
+
TransitionIR,
|
|
5
|
+
TransitionParseResult,
|
|
6
|
+
} from './transition'
|
|
7
|
+
import { parseTransition } from './transition'
|
|
8
|
+
|
|
9
|
+
export type LegacyTransitionValue =
|
|
10
|
+
| string
|
|
11
|
+
| Readonly<Record<string, unknown>>
|
|
12
|
+
| readonly [string, Readonly<Record<string, unknown>>]
|
|
13
|
+
|
|
14
|
+
const legacyControlKeys = new Set([
|
|
15
|
+
'default',
|
|
16
|
+
'enter',
|
|
17
|
+
'exit',
|
|
18
|
+
'delay',
|
|
19
|
+
'stiffness',
|
|
20
|
+
'damping',
|
|
21
|
+
'mass',
|
|
22
|
+
'tension',
|
|
23
|
+
'friction',
|
|
24
|
+
'velocity',
|
|
25
|
+
'overshootClamping',
|
|
26
|
+
'duration',
|
|
27
|
+
'bounciness',
|
|
28
|
+
'speed',
|
|
29
|
+
])
|
|
30
|
+
const springConfigKeys = new Set([
|
|
31
|
+
'stiffness',
|
|
32
|
+
'damping',
|
|
33
|
+
'mass',
|
|
34
|
+
'tension',
|
|
35
|
+
'friction',
|
|
36
|
+
'velocity',
|
|
37
|
+
'overshootClamping',
|
|
38
|
+
'duration',
|
|
39
|
+
'bounciness',
|
|
40
|
+
'speed',
|
|
41
|
+
])
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* lowers the legacy array and per-property object forms into transition IR.
|
|
45
|
+
* per-property presets and spring overrides remain explicit driver config.
|
|
46
|
+
*/
|
|
47
|
+
export function migrateLegacyTransition(
|
|
48
|
+
input: LegacyTransitionValue,
|
|
49
|
+
presetNames: ReadonlySet<string>
|
|
50
|
+
): TransitionParseResult {
|
|
51
|
+
if (typeof input === 'string') return parseTransition(input, presetNames)
|
|
52
|
+
|
|
53
|
+
const inputIsTuple = Array.isArray(input)
|
|
54
|
+
const options = (
|
|
55
|
+
inputIsTuple
|
|
56
|
+
? (input as readonly [string, Readonly<Record<string, unknown>>])[1]
|
|
57
|
+
: input
|
|
58
|
+
) as Readonly<Record<string, unknown>>
|
|
59
|
+
const defaultValue = inputIsTuple
|
|
60
|
+
? (input as readonly [string, Readonly<Record<string, unknown>>])[0]
|
|
61
|
+
: options.default
|
|
62
|
+
const diagnostics: TransitionDiagnostic[] = []
|
|
63
|
+
|
|
64
|
+
const delay =
|
|
65
|
+
options.delay === undefined
|
|
66
|
+
? undefined
|
|
67
|
+
: typeof options.delay === 'number' && Number.isFinite(options.delay)
|
|
68
|
+
? `${options.delay}ms`
|
|
69
|
+
: null
|
|
70
|
+
|
|
71
|
+
if (delay === null) {
|
|
72
|
+
diagnostics.push({
|
|
73
|
+
code: 'transition-invalid-token',
|
|
74
|
+
token: String(options.delay),
|
|
75
|
+
message: 'legacy transition delay must be a finite number of milliseconds',
|
|
76
|
+
})
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const resolveTiming = (
|
|
80
|
+
rawValue: string,
|
|
81
|
+
field: string
|
|
82
|
+
): TransitionEntry | undefined => {
|
|
83
|
+
const parsed = parseTransition(rawValue, presetNames)
|
|
84
|
+
if (!parsed.ok) {
|
|
85
|
+
for (let index = 0; index < parsed.diagnostics.length; index++) {
|
|
86
|
+
const diagnostic = parsed.diagnostics[index]
|
|
87
|
+
diagnostics.push({
|
|
88
|
+
...diagnostic,
|
|
89
|
+
message: `legacy transition ${field}: ${diagnostic.message}`,
|
|
90
|
+
})
|
|
91
|
+
}
|
|
92
|
+
return
|
|
93
|
+
}
|
|
94
|
+
if (
|
|
95
|
+
parsed.value.kind !== 'transition' ||
|
|
96
|
+
parsed.value.entries.length !== 1 ||
|
|
97
|
+
parsed.value.entries[0].property !== 'all'
|
|
98
|
+
) {
|
|
99
|
+
diagnostics.push({
|
|
100
|
+
code: 'transition-invalid-token',
|
|
101
|
+
token: rawValue,
|
|
102
|
+
message: `legacy transition ${field} must be a preset or CSS timing value`,
|
|
103
|
+
})
|
|
104
|
+
return
|
|
105
|
+
}
|
|
106
|
+
return parsed.value.entries[0]
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
let defaultTransition: TransitionEntry | undefined
|
|
110
|
+
if (defaultValue !== undefined) {
|
|
111
|
+
if (typeof defaultValue === 'string') {
|
|
112
|
+
defaultTransition = resolveTiming(defaultValue, 'default')
|
|
113
|
+
} else {
|
|
114
|
+
diagnostics.push({
|
|
115
|
+
code: 'transition-invalid-token',
|
|
116
|
+
token: String(defaultValue),
|
|
117
|
+
message: 'legacy transition default must be a preset or CSS timing value',
|
|
118
|
+
})
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const resolveLifecycle = (field: 'enter' | 'exit'): TransitionEntry | undefined => {
|
|
123
|
+
const rawValue = options[field]
|
|
124
|
+
if (rawValue === undefined) return
|
|
125
|
+
if (typeof rawValue === 'string') return resolveTiming(rawValue, field)
|
|
126
|
+
diagnostics.push({
|
|
127
|
+
code: 'transition-invalid-token',
|
|
128
|
+
token: String(rawValue),
|
|
129
|
+
message: `legacy transition ${field} must be a preset or CSS timing value`,
|
|
130
|
+
})
|
|
131
|
+
return
|
|
132
|
+
}
|
|
133
|
+
const enter = resolveLifecycle('enter')
|
|
134
|
+
const exit = resolveLifecycle('exit')
|
|
135
|
+
|
|
136
|
+
const config: Record<string, unknown> = {}
|
|
137
|
+
for (const key of springConfigKeys) {
|
|
138
|
+
if (options[key] !== undefined) config[key] = options[key]
|
|
139
|
+
}
|
|
140
|
+
const hasConfig = Object.keys(config).length > 0
|
|
141
|
+
|
|
142
|
+
const entries: TransitionEntry[] = []
|
|
143
|
+
if (defaultTransition) {
|
|
144
|
+
if (defaultTransition.timing.type === 'css' && hasConfig) {
|
|
145
|
+
diagnostics.push({
|
|
146
|
+
code: 'transition-invalid-token',
|
|
147
|
+
token: String(defaultValue),
|
|
148
|
+
message: 'spring overrides cannot be applied to CSS transition timing',
|
|
149
|
+
})
|
|
150
|
+
}
|
|
151
|
+
entries.push({
|
|
152
|
+
...defaultTransition,
|
|
153
|
+
delay: delay ?? defaultTransition.delay,
|
|
154
|
+
timing:
|
|
155
|
+
defaultTransition.timing.type === 'preset' && hasConfig
|
|
156
|
+
? { ...defaultTransition.timing, config }
|
|
157
|
+
: defaultTransition.timing,
|
|
158
|
+
})
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
for (const [property, rawValue] of Object.entries(options)) {
|
|
162
|
+
if (legacyControlKeys.has(property)) continue
|
|
163
|
+
|
|
164
|
+
let transition: TransitionEntry | undefined
|
|
165
|
+
let propertyConfig: Readonly<Record<string, unknown>> | undefined
|
|
166
|
+
if (typeof rawValue === 'string') {
|
|
167
|
+
transition = resolveTiming(rawValue, property)
|
|
168
|
+
if (!transition) continue
|
|
169
|
+
} else if (rawValue && typeof rawValue === 'object' && !Array.isArray(rawValue)) {
|
|
170
|
+
propertyConfig = rawValue as Readonly<Record<string, unknown>>
|
|
171
|
+
if (propertyConfig.type === undefined) {
|
|
172
|
+
transition = defaultTransition
|
|
173
|
+
} else if (typeof propertyConfig.type === 'string') {
|
|
174
|
+
transition = resolveTiming(propertyConfig.type, property)
|
|
175
|
+
if (!transition) continue
|
|
176
|
+
} else {
|
|
177
|
+
diagnostics.push({
|
|
178
|
+
code: 'transition-invalid-token',
|
|
179
|
+
token: property,
|
|
180
|
+
message: `legacy transition property "${property}" has a non-string type`,
|
|
181
|
+
})
|
|
182
|
+
continue
|
|
183
|
+
}
|
|
184
|
+
} else {
|
|
185
|
+
diagnostics.push({
|
|
186
|
+
code: 'transition-invalid-token',
|
|
187
|
+
token: property,
|
|
188
|
+
message: `legacy transition property "${property}" needs a preset, CSS timing value, or default`,
|
|
189
|
+
})
|
|
190
|
+
continue
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
if (!transition) {
|
|
194
|
+
diagnostics.push({
|
|
195
|
+
code: 'transition-invalid-token',
|
|
196
|
+
token: property,
|
|
197
|
+
message: `legacy transition property "${property}" needs a preset, CSS timing value, or default`,
|
|
198
|
+
})
|
|
199
|
+
continue
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
const propertyOverrides = propertyConfig
|
|
203
|
+
? Object.fromEntries(
|
|
204
|
+
Object.entries(propertyConfig).filter(([key]) => key !== 'type')
|
|
205
|
+
)
|
|
206
|
+
: undefined
|
|
207
|
+
const hasPropertyOverrides =
|
|
208
|
+
propertyOverrides !== undefined && Object.keys(propertyOverrides).length > 0
|
|
209
|
+
if (hasPropertyOverrides && transition.timing.type === 'css') {
|
|
210
|
+
diagnostics.push({
|
|
211
|
+
code: 'transition-invalid-token',
|
|
212
|
+
token: property,
|
|
213
|
+
message: `legacy transition property "${property}" cannot apply spring overrides to CSS timing`,
|
|
214
|
+
})
|
|
215
|
+
continue
|
|
216
|
+
}
|
|
217
|
+
entries.push({
|
|
218
|
+
...transition,
|
|
219
|
+
property,
|
|
220
|
+
timing:
|
|
221
|
+
transition.timing.type === 'preset' && propertyOverrides && hasPropertyOverrides
|
|
222
|
+
? { ...transition.timing, config: propertyOverrides }
|
|
223
|
+
: transition.timing,
|
|
224
|
+
delay: delay ?? transition.delay,
|
|
225
|
+
})
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
if (diagnostics.length) return { ok: false, diagnostics }
|
|
229
|
+
const value: TransitionIR = {
|
|
230
|
+
kind: 'transition',
|
|
231
|
+
entries,
|
|
232
|
+
...(enter ? { enter: { ...enter, delay: delay ?? enter.delay } } : {}),
|
|
233
|
+
...(exit ? { exit: { ...exit, delay: delay ?? exit.delay } } : {}),
|
|
234
|
+
...(hasConfig ? { config } : {}),
|
|
235
|
+
}
|
|
236
|
+
return { ok: true, value }
|
|
237
|
+
}
|
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
import type { ParsedTransition, TransitionEntry } from './transition'
|
|
2
|
+
|
|
3
|
+
export type NativeTransitionPlatform = 'android' | 'ios'
|
|
4
|
+
|
|
5
|
+
export interface NativeTransitionTarget {
|
|
6
|
+
platform: NativeTransitionPlatform
|
|
7
|
+
reactNativeMinor: number
|
|
8
|
+
androidApi?: number
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface NativeTransitionCapability {
|
|
12
|
+
properties: readonly string[]
|
|
13
|
+
minimumReactNativeMinor: number
|
|
14
|
+
platforms: readonly NativeTransitionPlatform[]
|
|
15
|
+
interpolation: 'continuous' | 'discrete'
|
|
16
|
+
note: string
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface NativeTransitionDiagnostic {
|
|
20
|
+
code:
|
|
21
|
+
| 'native-transition-css-global'
|
|
22
|
+
| 'native-transition-property'
|
|
23
|
+
| 'native-transition-timing'
|
|
24
|
+
| 'native-transition-delay'
|
|
25
|
+
| 'native-transition-behavior'
|
|
26
|
+
| 'native-transition-filter'
|
|
27
|
+
property?: string
|
|
28
|
+
message: string
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export type NativeTransitionValidationResult =
|
|
32
|
+
| { ok: true }
|
|
33
|
+
| { ok: false; diagnostics: readonly NativeTransitionDiagnostic[] }
|
|
34
|
+
|
|
35
|
+
const bothPlatforms: readonly NativeTransitionPlatform[] = ['android', 'ios']
|
|
36
|
+
const iosPlatform: readonly NativeTransitionPlatform[] = ['ios']
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* rn animated capability changes relevant to the v3 rn >= 0.82 target.
|
|
40
|
+
*
|
|
41
|
+
* 0.84 added broad non-layout native-driver coverage. 0.85 added layout
|
|
42
|
+
* properties through the shared Animated/Reanimated backend.
|
|
43
|
+
*/
|
|
44
|
+
export const nativeTransitionCapabilities: readonly NativeTransitionCapability[] = [
|
|
45
|
+
{
|
|
46
|
+
properties: ['opacity', 'transform', 'x', 'y', 'rotate', 'scale', 'filter'],
|
|
47
|
+
minimumReactNativeMinor: 82,
|
|
48
|
+
platforms: bothPlatforms,
|
|
49
|
+
interpolation: 'continuous',
|
|
50
|
+
note: 'baseline native-driver properties; filter animation landed in RN 0.82',
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
properties: [
|
|
54
|
+
'backgroundColor',
|
|
55
|
+
'borderRadius',
|
|
56
|
+
'borderTopLeftRadius',
|
|
57
|
+
'borderTopRightRadius',
|
|
58
|
+
'borderBottomRightRadius',
|
|
59
|
+
'borderBottomLeftRadius',
|
|
60
|
+
'boxShadow',
|
|
61
|
+
'outlineColor',
|
|
62
|
+
'outlineOffset',
|
|
63
|
+
'outlineWidth',
|
|
64
|
+
'transformOrigin',
|
|
65
|
+
'zIndex',
|
|
66
|
+
],
|
|
67
|
+
minimumReactNativeMinor: 84,
|
|
68
|
+
platforms: bothPlatforms,
|
|
69
|
+
interpolation: 'continuous',
|
|
70
|
+
note: 'continuous properties explicitly recorded for the RN 0.84 backend',
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
properties: [
|
|
74
|
+
'backfaceVisibility',
|
|
75
|
+
'isolation',
|
|
76
|
+
'mixBlendMode',
|
|
77
|
+
'outlineStyle',
|
|
78
|
+
'overflow',
|
|
79
|
+
'pointerEvents',
|
|
80
|
+
'position',
|
|
81
|
+
],
|
|
82
|
+
minimumReactNativeMinor: 84,
|
|
83
|
+
platforms: bothPlatforms,
|
|
84
|
+
interpolation: 'discrete',
|
|
85
|
+
note: 'the RN 0.84 backend can set these values, but native has no CSS allow-discrete transition semantics',
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
properties: ['cursor'],
|
|
89
|
+
minimumReactNativeMinor: 84,
|
|
90
|
+
platforms: iosPlatform,
|
|
91
|
+
interpolation: 'discrete',
|
|
92
|
+
note: 'cursor is limited to auto and pointer on iOS 17 or newer',
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
// the capability survey verifies width as the representative RN 0.85
|
|
96
|
+
// layout animation. Keep the matrix conservative until the rest of the
|
|
97
|
+
// layout property set has matching source evidence.
|
|
98
|
+
properties: ['width'],
|
|
99
|
+
minimumReactNativeMinor: 85,
|
|
100
|
+
platforms: bothPlatforms,
|
|
101
|
+
interpolation: 'continuous',
|
|
102
|
+
note: 'layout animation explicitly verified for the RN 0.85 shared backend',
|
|
103
|
+
},
|
|
104
|
+
]
|
|
105
|
+
|
|
106
|
+
function capabilityFor(property: string): NativeTransitionCapability | undefined {
|
|
107
|
+
for (let index = 0; index < nativeTransitionCapabilities.length; index++) {
|
|
108
|
+
const capability = nativeTransitionCapabilities[index]
|
|
109
|
+
for (
|
|
110
|
+
let propertyIndex = 0;
|
|
111
|
+
propertyIndex < capability.properties.length;
|
|
112
|
+
propertyIndex++
|
|
113
|
+
) {
|
|
114
|
+
if (capability.properties[propertyIndex] === property) return capability
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return undefined
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
const baseFilterFunctions: ReadonlySet<string> = new Set(['brightness', 'opacity'])
|
|
121
|
+
const expandedAndroidFilterFunctions: ReadonlySet<string> = new Set([
|
|
122
|
+
'blur',
|
|
123
|
+
'contrast',
|
|
124
|
+
'drop-shadow',
|
|
125
|
+
'grayscale',
|
|
126
|
+
'hue-rotate',
|
|
127
|
+
'saturate',
|
|
128
|
+
])
|
|
129
|
+
const filterFunctionPattern = /([a-z-]+)\s*\(/g
|
|
130
|
+
|
|
131
|
+
function appendDiagnostics(
|
|
132
|
+
target: NativeTransitionDiagnostic[],
|
|
133
|
+
source: readonly NativeTransitionDiagnostic[]
|
|
134
|
+
): void {
|
|
135
|
+
for (let index = 0; index < source.length; index++) target.push(source[index])
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
function validateFilter(
|
|
139
|
+
value: string,
|
|
140
|
+
target: NativeTransitionTarget
|
|
141
|
+
): NativeTransitionDiagnostic | undefined {
|
|
142
|
+
filterFunctionPattern.lastIndex = 0
|
|
143
|
+
for (
|
|
144
|
+
let match = filterFunctionPattern.exec(value);
|
|
145
|
+
match;
|
|
146
|
+
match = filterFunctionPattern.exec(value)
|
|
147
|
+
) {
|
|
148
|
+
const name = match[1]
|
|
149
|
+
if (baseFilterFunctions.has(name)) continue
|
|
150
|
+
|
|
151
|
+
if (target.platform === 'ios') {
|
|
152
|
+
return {
|
|
153
|
+
code: 'native-transition-filter',
|
|
154
|
+
property: 'filter',
|
|
155
|
+
message: `filter function "${name}()" is not supported on iOS`,
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
if (!expandedAndroidFilterFunctions.has(name)) {
|
|
160
|
+
return {
|
|
161
|
+
code: 'native-transition-filter',
|
|
162
|
+
property: 'filter',
|
|
163
|
+
message: `filter function "${name}()" is not supported on Android`,
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
if (target.reactNativeMinor < 83) {
|
|
167
|
+
return {
|
|
168
|
+
code: 'native-transition-filter',
|
|
169
|
+
property: 'filter',
|
|
170
|
+
message: `filter function "${name}()" requires React Native 0.83 or newer`,
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
if ((target.androidApi ?? 0) < 31) {
|
|
174
|
+
return {
|
|
175
|
+
code: 'native-transition-filter',
|
|
176
|
+
property: 'filter',
|
|
177
|
+
message: 'expanded filter functions require Android API 31 or newer',
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
return undefined
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
function validateProperty(
|
|
185
|
+
property: string,
|
|
186
|
+
target: NativeTransitionTarget,
|
|
187
|
+
transitionedValues: Readonly<Record<string, string>>
|
|
188
|
+
): NativeTransitionDiagnostic[] {
|
|
189
|
+
const diagnostics: NativeTransitionDiagnostic[] = []
|
|
190
|
+
|
|
191
|
+
if (property.startsWith('--')) {
|
|
192
|
+
diagnostics.push({
|
|
193
|
+
code: 'native-transition-property',
|
|
194
|
+
property,
|
|
195
|
+
message: 'CSS custom properties are not supported on native',
|
|
196
|
+
})
|
|
197
|
+
return diagnostics
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
const capability = capabilityFor(property)
|
|
201
|
+
if (!capability) {
|
|
202
|
+
diagnostics.push({
|
|
203
|
+
code: 'native-transition-property',
|
|
204
|
+
property,
|
|
205
|
+
message: `"${property}" transitions are not supported on native`,
|
|
206
|
+
})
|
|
207
|
+
return diagnostics
|
|
208
|
+
}
|
|
209
|
+
if (!capability.platforms.includes(target.platform)) {
|
|
210
|
+
diagnostics.push({
|
|
211
|
+
code: 'native-transition-property',
|
|
212
|
+
property,
|
|
213
|
+
message: `"${property}" transitions are not supported on ${target.platform}`,
|
|
214
|
+
})
|
|
215
|
+
return diagnostics
|
|
216
|
+
}
|
|
217
|
+
if (target.reactNativeMinor < capability.minimumReactNativeMinor) {
|
|
218
|
+
diagnostics.push({
|
|
219
|
+
code: 'native-transition-property',
|
|
220
|
+
property,
|
|
221
|
+
message: `"${property}" transitions require React Native 0.${capability.minimumReactNativeMinor} or newer`,
|
|
222
|
+
})
|
|
223
|
+
return diagnostics
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
if (capability.interpolation === 'discrete') {
|
|
227
|
+
diagnostics.push({
|
|
228
|
+
code: 'native-transition-property',
|
|
229
|
+
property,
|
|
230
|
+
message: `"${property}" is discrete and native has no allow-discrete transition semantics`,
|
|
231
|
+
})
|
|
232
|
+
return diagnostics
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
if (property === 'filter') {
|
|
236
|
+
const value = transitionedValues.filter
|
|
237
|
+
if (value === undefined) {
|
|
238
|
+
diagnostics.push({
|
|
239
|
+
code: 'native-transition-filter',
|
|
240
|
+
property,
|
|
241
|
+
message: 'filter transition validation requires the resolved destination value',
|
|
242
|
+
})
|
|
243
|
+
return diagnostics
|
|
244
|
+
}
|
|
245
|
+
const diagnostic = validateFilter(value, target)
|
|
246
|
+
if (diagnostic) diagnostics.push(diagnostic)
|
|
247
|
+
}
|
|
248
|
+
return diagnostics
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
function validateEntry(
|
|
252
|
+
entry: TransitionEntry,
|
|
253
|
+
target: NativeTransitionTarget,
|
|
254
|
+
transitionedValues: Readonly<Record<string, string>>
|
|
255
|
+
): NativeTransitionDiagnostic[] {
|
|
256
|
+
const diagnostics: NativeTransitionDiagnostic[] = []
|
|
257
|
+
|
|
258
|
+
if (entry.property === 'none') return diagnostics
|
|
259
|
+
|
|
260
|
+
if (entry.behavior === 'allow-discrete') {
|
|
261
|
+
diagnostics.push({
|
|
262
|
+
code: 'native-transition-behavior',
|
|
263
|
+
property: entry.property,
|
|
264
|
+
message: 'allow-discrete transition behavior is not supported on native',
|
|
265
|
+
})
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
if (entry.timing.type === 'css') {
|
|
269
|
+
if (
|
|
270
|
+
/^(?:steps|linear)\(/.test(entry.timing.timingFunction) ||
|
|
271
|
+
entry.timing.timingFunction === 'step-start' ||
|
|
272
|
+
entry.timing.timingFunction === 'step-end'
|
|
273
|
+
) {
|
|
274
|
+
diagnostics.push({
|
|
275
|
+
code: 'native-transition-timing',
|
|
276
|
+
property: entry.property,
|
|
277
|
+
message: `timing function "${entry.timing.timingFunction}" is not supported on native`,
|
|
278
|
+
})
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
if (Number.parseFloat(entry.delay) < 0) {
|
|
282
|
+
diagnostics.push({
|
|
283
|
+
code: 'native-transition-delay',
|
|
284
|
+
property: entry.property,
|
|
285
|
+
message: `negative transition delay "${entry.delay}" is not supported on native`,
|
|
286
|
+
})
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
if (entry.property !== 'all') {
|
|
290
|
+
appendDiagnostics(
|
|
291
|
+
diagnostics,
|
|
292
|
+
validateProperty(entry.property, target, transitionedValues)
|
|
293
|
+
)
|
|
294
|
+
return diagnostics
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
let hasProperty = false
|
|
298
|
+
for (const property in transitionedValues) {
|
|
299
|
+
if (!Object.prototype.hasOwnProperty.call(transitionedValues, property)) continue
|
|
300
|
+
hasProperty = true
|
|
301
|
+
appendDiagnostics(diagnostics, validateProperty(property, target, transitionedValues))
|
|
302
|
+
}
|
|
303
|
+
if (!hasProperty) {
|
|
304
|
+
diagnostics.push({
|
|
305
|
+
code: 'native-transition-property',
|
|
306
|
+
property: 'all',
|
|
307
|
+
message:
|
|
308
|
+
'"all" transition validation requires the concrete changed native properties',
|
|
309
|
+
})
|
|
310
|
+
}
|
|
311
|
+
return diagnostics
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* validates a normalized transition for a concrete native target.
|
|
316
|
+
*
|
|
317
|
+
* pass the resolved destination values when property support depends on the
|
|
318
|
+
* value, as with filter functions.
|
|
319
|
+
*/
|
|
320
|
+
export function validateNativeTransition(
|
|
321
|
+
transition: ParsedTransition,
|
|
322
|
+
target: NativeTransitionTarget,
|
|
323
|
+
transitionedValues: Readonly<Record<string, string>> = {}
|
|
324
|
+
): NativeTransitionValidationResult {
|
|
325
|
+
if (transition.kind === 'global') {
|
|
326
|
+
return {
|
|
327
|
+
ok: false,
|
|
328
|
+
diagnostics: [
|
|
329
|
+
{
|
|
330
|
+
code: 'native-transition-css-global',
|
|
331
|
+
message: `CSS-wide value "${transition.value}" is not supported on native`,
|
|
332
|
+
},
|
|
333
|
+
],
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
const diagnostics: NativeTransitionDiagnostic[] = []
|
|
338
|
+
if (transition.enter) {
|
|
339
|
+
appendDiagnostics(
|
|
340
|
+
diagnostics,
|
|
341
|
+
validateEntry(transition.enter, target, transitionedValues)
|
|
342
|
+
)
|
|
343
|
+
}
|
|
344
|
+
if (transition.exit) {
|
|
345
|
+
appendDiagnostics(
|
|
346
|
+
diagnostics,
|
|
347
|
+
validateEntry(transition.exit, target, transitionedValues)
|
|
348
|
+
)
|
|
349
|
+
}
|
|
350
|
+
for (let index = 0; index < transition.entries.length; index++) {
|
|
351
|
+
appendDiagnostics(
|
|
352
|
+
diagnostics,
|
|
353
|
+
validateEntry(transition.entries[index], target, transitionedValues)
|
|
354
|
+
)
|
|
355
|
+
}
|
|
356
|
+
return diagnostics.length ? { ok: false, diagnostics } : { ok: true }
|
|
357
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
const unitlessNumberPropertyNames = [
|
|
2
|
+
'animationIterationCount',
|
|
3
|
+
'aspectRatio',
|
|
4
|
+
'borderImageOutset',
|
|
5
|
+
'borderImageSlice',
|
|
6
|
+
'borderImageWidth',
|
|
7
|
+
'boxFlex',
|
|
8
|
+
'boxFlexGroup',
|
|
9
|
+
'boxOrdinalGroup',
|
|
10
|
+
'columnCount',
|
|
11
|
+
'flex',
|
|
12
|
+
'flexGrow',
|
|
13
|
+
'flexOrder',
|
|
14
|
+
'flexPositive',
|
|
15
|
+
'flexShrink',
|
|
16
|
+
'flexNegative',
|
|
17
|
+
'fontWeight',
|
|
18
|
+
'gap',
|
|
19
|
+
'columnGap',
|
|
20
|
+
'rowGap',
|
|
21
|
+
'gridRow',
|
|
22
|
+
'gridRowEnd',
|
|
23
|
+
'gridRowGap',
|
|
24
|
+
'gridRowStart',
|
|
25
|
+
'gridColumn',
|
|
26
|
+
'gridColumnEnd',
|
|
27
|
+
'gridColumnGap',
|
|
28
|
+
'gridColumnStart',
|
|
29
|
+
'lineClamp',
|
|
30
|
+
'opacity',
|
|
31
|
+
'order',
|
|
32
|
+
'orphans',
|
|
33
|
+
'tabSize',
|
|
34
|
+
'widows',
|
|
35
|
+
'zIndex',
|
|
36
|
+
'zoom',
|
|
37
|
+
'fillOpacity',
|
|
38
|
+
'floodOpacity',
|
|
39
|
+
'stopOpacity',
|
|
40
|
+
'strokeDasharray',
|
|
41
|
+
'strokeDashoffset',
|
|
42
|
+
'strokeMiterlimit',
|
|
43
|
+
'strokeOpacity',
|
|
44
|
+
'strokeWidth',
|
|
45
|
+
'scale',
|
|
46
|
+
'scaleX',
|
|
47
|
+
'scaleY',
|
|
48
|
+
'scaleZ',
|
|
49
|
+
'shadowOpacity',
|
|
50
|
+
] as const
|
|
51
|
+
|
|
52
|
+
// Mirrored from react-native-web-internals/src/modules/unitlessNumbers/index.tsx;
|
|
53
|
+
// this package cannot import across that runtime boundary.
|
|
54
|
+
const unitlessNumbers = new Set<string>(unitlessNumberPropertyNames)
|
|
55
|
+
for (const prefix of ['ms', 'Moz', 'O', 'Webkit']) {
|
|
56
|
+
for (const property of unitlessNumberPropertyNames) {
|
|
57
|
+
unitlessNumbers.add(prefix + property[0].toUpperCase() + property.slice(1))
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export const unitlessNumberProperties: ReadonlySet<string> = unitlessNumbers
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
type KebabCase<Name extends string> = Name extends `${infer First}${infer Rest}`
|
|
2
|
+
? First extends Lowercase<First>
|
|
3
|
+
? `${First}${KebabCase<Rest>}`
|
|
4
|
+
: `-${Lowercase<First>}${KebabCase<Rest>}`
|
|
5
|
+
: Name
|
|
6
|
+
|
|
7
|
+
// style-grammar cannot import the theme package without reversing the dependency
|
|
8
|
+
// graph. This tuple is the zero-dependency vocabulary; the config test compares it
|
|
9
|
+
// exhaustively with every actual v5 theme key so a new camel-case built-in fails.
|
|
10
|
+
const v6RenamedThemeNames = [
|
|
11
|
+
'accentBackground',
|
|
12
|
+
'accentColor',
|
|
13
|
+
'colorHover',
|
|
14
|
+
'colorPress',
|
|
15
|
+
'colorFocus',
|
|
16
|
+
'backgroundHover',
|
|
17
|
+
'backgroundPress',
|
|
18
|
+
'backgroundFocus',
|
|
19
|
+
'borderColor',
|
|
20
|
+
'borderColorHover',
|
|
21
|
+
'borderColorFocus',
|
|
22
|
+
'borderColorPress',
|
|
23
|
+
'outlineColor',
|
|
24
|
+
'placeholderColor',
|
|
25
|
+
'colorTransparent',
|
|
26
|
+
'shadowColor',
|
|
27
|
+
] as const
|
|
28
|
+
|
|
29
|
+
export const v6ThemeNameReplacements = Object.freeze(
|
|
30
|
+
Object.fromEntries(
|
|
31
|
+
v6RenamedThemeNames.map((name) => [
|
|
32
|
+
name,
|
|
33
|
+
name.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`),
|
|
34
|
+
])
|
|
35
|
+
)
|
|
36
|
+
) as {
|
|
37
|
+
readonly [Name in (typeof v6RenamedThemeNames)[number]]: KebabCase<Name>
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export const v6RemovedThemeNames = ['backgroundActive'] as const
|