@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,132 @@
|
|
|
1
|
+
import { parseTransition, parseTransitionLonghands } from "./transition.native.js";
|
|
2
|
+
|
|
3
|
+
var timingLonghands = /* @__PURE__ */ new Set(["transitionDuration", "transitionTimingFunction"]);
|
|
4
|
+
function listText(values) {
|
|
5
|
+
return values.join(", ");
|
|
6
|
+
}
|
|
7
|
+
function alignTransitionContributions(contributions, presetNames) {
|
|
8
|
+
var state = {
|
|
9
|
+
global: null,
|
|
10
|
+
preset: null,
|
|
11
|
+
lists: {}
|
|
12
|
+
};
|
|
13
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
14
|
+
try {
|
|
15
|
+
for (var _iterator = contributions[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
16
|
+
var contribution = _step.value;
|
|
17
|
+
if (contribution.prop === "transition") {
|
|
18
|
+
var parsed = parseTransition(contribution.value, presetNames);
|
|
19
|
+
if (!parsed.ok) return parsed;
|
|
20
|
+
state.global = null;
|
|
21
|
+
state.preset = null;
|
|
22
|
+
state.lists = {};
|
|
23
|
+
if (parsed.value.kind === "global") {
|
|
24
|
+
state.global = parsed.value.value;
|
|
25
|
+
continue;
|
|
26
|
+
}
|
|
27
|
+
var entries = parsed.value.entries;
|
|
28
|
+
var presetEntry = entries.find(function(entry) {
|
|
29
|
+
return entry.timing.type === "preset";
|
|
30
|
+
});
|
|
31
|
+
if (presetEntry) {
|
|
32
|
+
state.preset = presetEntry.timing;
|
|
33
|
+
state.lists.transitionProperty = listText(entries.map(function(entry) {
|
|
34
|
+
return entry.property;
|
|
35
|
+
}));
|
|
36
|
+
state.lists.transitionDelay = listText(entries.map(function(entry) {
|
|
37
|
+
return entry.delay;
|
|
38
|
+
}));
|
|
39
|
+
state.lists.transitionBehavior = listText(entries.map(function(entry) {
|
|
40
|
+
return entry.behavior;
|
|
41
|
+
}));
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
state.lists.transitionProperty = listText(entries.map(function(entry) {
|
|
45
|
+
return entry.property;
|
|
46
|
+
}));
|
|
47
|
+
state.lists.transitionDuration = listText(entries.map(function(entry) {
|
|
48
|
+
return entry.timing.duration;
|
|
49
|
+
}));
|
|
50
|
+
state.lists.transitionTimingFunction = listText(entries.map(function(entry) {
|
|
51
|
+
return entry.timing.timingFunction;
|
|
52
|
+
}));
|
|
53
|
+
state.lists.transitionDelay = listText(entries.map(function(entry) {
|
|
54
|
+
return entry.delay;
|
|
55
|
+
}));
|
|
56
|
+
state.lists.transitionBehavior = listText(entries.map(function(entry) {
|
|
57
|
+
return entry.behavior;
|
|
58
|
+
}));
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
if (state.global) {
|
|
62
|
+
return {
|
|
63
|
+
ok: false,
|
|
64
|
+
diagnostics: [{
|
|
65
|
+
code: "transition-invalid-list",
|
|
66
|
+
token: contribution.prop,
|
|
67
|
+
message: `"${contribution.prop}" cannot override the CSS-wide transition "${state.global}" per longhand; restate the whole transition`
|
|
68
|
+
}]
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
if (state.preset && timingLonghands.has(contribution.prop)) {
|
|
72
|
+
return {
|
|
73
|
+
ok: false,
|
|
74
|
+
diagnostics: [{
|
|
75
|
+
code: "transition-invalid-list",
|
|
76
|
+
token: contribution.prop,
|
|
77
|
+
message: `"${contribution.prop}" cannot partially override the "${state.preset.name}" preset \u2014 a preset's timing is not decomposable into CSS components; restate \`transition\` with CSS timing or change the preset`
|
|
78
|
+
}]
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
state.lists[contribution.prop] = contribution.value;
|
|
82
|
+
}
|
|
83
|
+
} catch (err) {
|
|
84
|
+
_didIteratorError = true;
|
|
85
|
+
_iteratorError = err;
|
|
86
|
+
} finally {
|
|
87
|
+
try {
|
|
88
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
89
|
+
_iterator.return();
|
|
90
|
+
}
|
|
91
|
+
} finally {
|
|
92
|
+
if (_didIteratorError) {
|
|
93
|
+
throw _iteratorError;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
if (state.global) {
|
|
98
|
+
return {
|
|
99
|
+
ok: true,
|
|
100
|
+
value: {
|
|
101
|
+
kind: "global",
|
|
102
|
+
value: state.global
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
if (state.preset) {
|
|
107
|
+
var zipped = parseTransitionLonghands({
|
|
108
|
+
transitionProperty: state.lists.transitionProperty,
|
|
109
|
+
transitionDelay: state.lists.transitionDelay,
|
|
110
|
+
transitionBehavior: state.lists.transitionBehavior
|
|
111
|
+
});
|
|
112
|
+
if (!zipped.ok || zipped.value.kind !== "transition") return zipped;
|
|
113
|
+
var preset = state.preset;
|
|
114
|
+
var entries1 = zipped.value.entries.map(function(entry) {
|
|
115
|
+
return {
|
|
116
|
+
...entry,
|
|
117
|
+
timing: preset
|
|
118
|
+
};
|
|
119
|
+
});
|
|
120
|
+
return {
|
|
121
|
+
ok: true,
|
|
122
|
+
value: {
|
|
123
|
+
kind: "transition",
|
|
124
|
+
entries: entries1
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
return parseTransitionLonghands(state.lists);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export { alignTransitionContributions };
|
|
132
|
+
//# sourceMappingURL=transitionAlign.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transitionAlign.native.js","names":[],"sources":["esm/transitionAlign.native.js"],"sourcesContent":["import { parseTransition, parseTransitionLonghands } from \"./transition\";\nvar timingLonghands = /* @__PURE__ */ new Set([\n \"transitionDuration\",\n \"transitionTimingFunction\"\n]);\nfunction listText(values) {\n return values.join(\", \");\n}\nfunction alignTransitionContributions(contributions, presetNames) {\n var state = {\n global: null,\n preset: null,\n lists: {}\n };\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = contributions[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var contribution = _step.value;\n if (contribution.prop === \"transition\") {\n var parsed = parseTransition(contribution.value, presetNames);\n if (!parsed.ok) return parsed;\n state.global = null;\n state.preset = null;\n state.lists = {};\n if (parsed.value.kind === \"global\") {\n state.global = parsed.value.value;\n continue;\n }\n var entries = parsed.value.entries;\n var presetEntry = entries.find(function(entry) {\n return entry.timing.type === \"preset\";\n });\n if (presetEntry) {\n state.preset = presetEntry.timing;\n state.lists.transitionProperty = listText(entries.map(function(entry) {\n return entry.property;\n }));\n state.lists.transitionDelay = listText(entries.map(function(entry) {\n return entry.delay;\n }));\n state.lists.transitionBehavior = listText(entries.map(function(entry) {\n return entry.behavior;\n }));\n continue;\n }\n state.lists.transitionProperty = listText(entries.map(function(entry) {\n return entry.property;\n }));\n state.lists.transitionDuration = listText(entries.map(function(entry) {\n return entry.timing.duration;\n }));\n state.lists.transitionTimingFunction = listText(entries.map(function(entry) {\n return entry.timing.timingFunction;\n }));\n state.lists.transitionDelay = listText(entries.map(function(entry) {\n return entry.delay;\n }));\n state.lists.transitionBehavior = listText(entries.map(function(entry) {\n return entry.behavior;\n }));\n continue;\n }\n if (state.global) {\n return {\n ok: false,\n diagnostics: [\n {\n code: \"transition-invalid-list\",\n token: contribution.prop,\n message: `\"${contribution.prop}\" cannot override the CSS-wide transition \"${state.global}\" per longhand; restate the whole transition`\n }\n ]\n };\n }\n if (state.preset && timingLonghands.has(contribution.prop)) {\n return {\n ok: false,\n diagnostics: [\n {\n code: \"transition-invalid-list\",\n token: contribution.prop,\n message: `\"${contribution.prop}\" cannot partially override the \"${state.preset.name}\" preset \\u2014 a preset's timing is not decomposable into CSS components; restate \\`transition\\` with CSS timing or change the preset`\n }\n ]\n };\n }\n state.lists[contribution.prop] = contribution.value;\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n if (state.global) {\n return {\n ok: true,\n value: {\n kind: \"global\",\n value: state.global\n }\n };\n }\n if (state.preset) {\n var zipped = parseTransitionLonghands({\n transitionProperty: state.lists.transitionProperty,\n transitionDelay: state.lists.transitionDelay,\n transitionBehavior: state.lists.transitionBehavior\n });\n if (!zipped.ok || zipped.value.kind !== \"transition\") return zipped;\n var preset = state.preset;\n var entries1 = zipped.value.entries.map(function(entry) {\n return {\n ...entry,\n timing: preset\n };\n });\n return {\n ok: true,\n value: {\n kind: \"transition\",\n entries: entries1\n }\n };\n }\n return parseTransitionLonghands(state.lists);\n}\nexport {\n alignTransitionContributions\n};\n//# sourceMappingURL=transitionAlign.js.map\n"],"mappings":";;;AACA,IAAI,kCAAkC,IAAI,IAAI,CAC5C,sBACA,0BACF,CAAC;AACD,SAAS,SAAS,QAAQ;CACxB,OAAO,OAAO,KAAK,IAAI;AACzB;AACA,SAAS,6BAA6B,eAAe,aAAa;CAChE,IAAI,QAAQ;EACV,QAAQ;EACR,QAAQ;EACR,OAAO,CAAC;CACV;CACA,IAAI,4BAA4B,MAAM,oBAAoB,OAAO,iBAAiB,KAAK;CACvF,IAAI;EACF,KAAK,IAAI,YAAY,cAAc,OAAO,UAAU,GAAG,OAAO,EAAE,6BAA6B,QAAQ,UAAU,KAAK,GAAG,OAAO,4BAA4B,MAAM;GAC9J,IAAI,eAAe,MAAM;GACzB,IAAI,aAAa,SAAS,cAAc;IACtC,IAAI,SAAS,gBAAgB,aAAa,OAAO,WAAW;IAC5D,IAAI,CAAC,OAAO,IAAI,OAAO;IACvB,MAAM,SAAS;IACf,MAAM,SAAS;IACf,MAAM,QAAQ,CAAC;IACf,IAAI,OAAO,MAAM,SAAS,UAAU;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,MAAM;MACN,OAAO,aAAa;MACpB,SAAS,IAAI,aAAa,KAAK,mCAAmC,MAAM,OAAO,KAAK;KACtF,CACF;IACF;GACF;GACA,MAAM,MAAM,aAAa,QAAQ,aAAa;EAChD;CACF,SAAS,KAAK;EACZ,oBAAoB;EACpB,iBAAiB;CACnB,UAAU;EACR,IAAI;GACF,IAAI,CAAC,6BAA6B,UAAU,UAAU,MAAM;IAC1D,UAAU,OAAO;GACnB;EACF,UAAU;GACR,IAAI,mBAAmB;IACrB,MAAM;GACR;EACF;CACF;CACA,IAAI,MAAM,QAAQ;EAChB,OAAO;GACL,IAAI;GACJ,OAAO;IACL,MAAM;IACN,OAAO,MAAM;GACf;EACF;CACF;CACA,IAAI,MAAM,QAAQ;EAChB,IAAI,SAAS,yBAAyB;GACpC,oBAAoB,MAAM,MAAM;GAChC,iBAAiB,MAAM,MAAM;GAC7B,oBAAoB,MAAM,MAAM;EAClC,CAAC;EACD,IAAI,CAAC,OAAO,MAAM,OAAO,MAAM,SAAS,cAAc,OAAO;EAC7D,IAAI,SAAS,MAAM;EACnB,IAAI,WAAW,OAAO,MAAM,QAAQ,IAAI,SAAS,OAAO;GACtD,OAAO;IACL,GAAG;IACH,QAAQ;GACV;EACF,CAAC;EACD,OAAO;GACL,IAAI;GACJ,OAAO;IACL,MAAM;IACN,SAAS;GACX;EACF;CACF;CACA,OAAO,yBAAyB,MAAM,KAAK;AAC7C"}
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { parseTransition } from "./transition.mjs";
|
|
2
|
+
|
|
3
|
+
const legacyControlKeys = /* @__PURE__ */ new Set([
|
|
4
|
+
"default",
|
|
5
|
+
"enter",
|
|
6
|
+
"exit",
|
|
7
|
+
"delay",
|
|
8
|
+
"stiffness",
|
|
9
|
+
"damping",
|
|
10
|
+
"mass",
|
|
11
|
+
"tension",
|
|
12
|
+
"friction",
|
|
13
|
+
"velocity",
|
|
14
|
+
"overshootClamping",
|
|
15
|
+
"duration",
|
|
16
|
+
"bounciness",
|
|
17
|
+
"speed"
|
|
18
|
+
]);
|
|
19
|
+
const springConfigKeys = /* @__PURE__ */ new Set([
|
|
20
|
+
"stiffness",
|
|
21
|
+
"damping",
|
|
22
|
+
"mass",
|
|
23
|
+
"tension",
|
|
24
|
+
"friction",
|
|
25
|
+
"velocity",
|
|
26
|
+
"overshootClamping",
|
|
27
|
+
"duration",
|
|
28
|
+
"bounciness",
|
|
29
|
+
"speed"
|
|
30
|
+
]);
|
|
31
|
+
function migrateLegacyTransition(input, presetNames) {
|
|
32
|
+
if (typeof input === "string") return parseTransition(input, presetNames);
|
|
33
|
+
const inputIsTuple = Array.isArray(input);
|
|
34
|
+
const options = inputIsTuple ? input[1] : input;
|
|
35
|
+
const defaultValue = inputIsTuple ? input[0] : options.default;
|
|
36
|
+
const diagnostics = [];
|
|
37
|
+
const delay = options.delay === void 0 ? void 0 : typeof options.delay === "number" && Number.isFinite(options.delay) ? `${options.delay}ms` : null;
|
|
38
|
+
if (delay === null) {
|
|
39
|
+
diagnostics.push({
|
|
40
|
+
code: "transition-invalid-token",
|
|
41
|
+
token: String(options.delay),
|
|
42
|
+
message: "legacy transition delay must be a finite number of milliseconds"
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
const resolveTiming = (rawValue, field) => {
|
|
46
|
+
const parsed = parseTransition(rawValue, presetNames);
|
|
47
|
+
if (!parsed.ok) {
|
|
48
|
+
for (let index = 0; index < parsed.diagnostics.length; index++) {
|
|
49
|
+
const diagnostic = parsed.diagnostics[index];
|
|
50
|
+
diagnostics.push({
|
|
51
|
+
...diagnostic,
|
|
52
|
+
message: `legacy transition ${field}: ${diagnostic.message}`
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
if (parsed.value.kind !== "transition" || parsed.value.entries.length !== 1 || parsed.value.entries[0].property !== "all") {
|
|
58
|
+
diagnostics.push({
|
|
59
|
+
code: "transition-invalid-token",
|
|
60
|
+
token: rawValue,
|
|
61
|
+
message: `legacy transition ${field} must be a preset or CSS timing value`
|
|
62
|
+
});
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
return parsed.value.entries[0];
|
|
66
|
+
};
|
|
67
|
+
let defaultTransition;
|
|
68
|
+
if (defaultValue !== void 0) {
|
|
69
|
+
if (typeof defaultValue === "string") {
|
|
70
|
+
defaultTransition = resolveTiming(defaultValue, "default");
|
|
71
|
+
} else {
|
|
72
|
+
diagnostics.push({
|
|
73
|
+
code: "transition-invalid-token",
|
|
74
|
+
token: String(defaultValue),
|
|
75
|
+
message: "legacy transition default must be a preset or CSS timing value"
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
const resolveLifecycle = (field) => {
|
|
80
|
+
const rawValue = options[field];
|
|
81
|
+
if (rawValue === void 0) return;
|
|
82
|
+
if (typeof rawValue === "string") return resolveTiming(rawValue, field);
|
|
83
|
+
diagnostics.push({
|
|
84
|
+
code: "transition-invalid-token",
|
|
85
|
+
token: String(rawValue),
|
|
86
|
+
message: `legacy transition ${field} must be a preset or CSS timing value`
|
|
87
|
+
});
|
|
88
|
+
return;
|
|
89
|
+
};
|
|
90
|
+
const enter = resolveLifecycle("enter");
|
|
91
|
+
const exit = resolveLifecycle("exit");
|
|
92
|
+
const config = {};
|
|
93
|
+
for (const key of springConfigKeys) {
|
|
94
|
+
if (options[key] !== void 0) config[key] = options[key];
|
|
95
|
+
}
|
|
96
|
+
const hasConfig = Object.keys(config).length > 0;
|
|
97
|
+
const entries = [];
|
|
98
|
+
if (defaultTransition) {
|
|
99
|
+
if (defaultTransition.timing.type === "css" && hasConfig) {
|
|
100
|
+
diagnostics.push({
|
|
101
|
+
code: "transition-invalid-token",
|
|
102
|
+
token: String(defaultValue),
|
|
103
|
+
message: "spring overrides cannot be applied to CSS transition timing"
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
entries.push({
|
|
107
|
+
...defaultTransition,
|
|
108
|
+
delay: delay ?? defaultTransition.delay,
|
|
109
|
+
timing: defaultTransition.timing.type === "preset" && hasConfig ? {
|
|
110
|
+
...defaultTransition.timing,
|
|
111
|
+
config
|
|
112
|
+
} : defaultTransition.timing
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
for (const [property, rawValue] of Object.entries(options)) {
|
|
116
|
+
if (legacyControlKeys.has(property)) continue;
|
|
117
|
+
let transition;
|
|
118
|
+
let propertyConfig;
|
|
119
|
+
if (typeof rawValue === "string") {
|
|
120
|
+
transition = resolveTiming(rawValue, property);
|
|
121
|
+
if (!transition) continue;
|
|
122
|
+
} else if (rawValue && typeof rawValue === "object" && !Array.isArray(rawValue)) {
|
|
123
|
+
propertyConfig = rawValue;
|
|
124
|
+
if (propertyConfig.type === void 0) {
|
|
125
|
+
transition = defaultTransition;
|
|
126
|
+
} else if (typeof propertyConfig.type === "string") {
|
|
127
|
+
transition = resolveTiming(propertyConfig.type, property);
|
|
128
|
+
if (!transition) continue;
|
|
129
|
+
} else {
|
|
130
|
+
diagnostics.push({
|
|
131
|
+
code: "transition-invalid-token",
|
|
132
|
+
token: property,
|
|
133
|
+
message: `legacy transition property "${property}" has a non-string type`
|
|
134
|
+
});
|
|
135
|
+
continue;
|
|
136
|
+
}
|
|
137
|
+
} else {
|
|
138
|
+
diagnostics.push({
|
|
139
|
+
code: "transition-invalid-token",
|
|
140
|
+
token: property,
|
|
141
|
+
message: `legacy transition property "${property}" needs a preset, CSS timing value, or default`
|
|
142
|
+
});
|
|
143
|
+
continue;
|
|
144
|
+
}
|
|
145
|
+
if (!transition) {
|
|
146
|
+
diagnostics.push({
|
|
147
|
+
code: "transition-invalid-token",
|
|
148
|
+
token: property,
|
|
149
|
+
message: `legacy transition property "${property}" needs a preset, CSS timing value, or default`
|
|
150
|
+
});
|
|
151
|
+
continue;
|
|
152
|
+
}
|
|
153
|
+
const propertyOverrides = propertyConfig ? Object.fromEntries(Object.entries(propertyConfig).filter(([key]) => key !== "type")) : void 0;
|
|
154
|
+
const hasPropertyOverrides = propertyOverrides !== void 0 && Object.keys(propertyOverrides).length > 0;
|
|
155
|
+
if (hasPropertyOverrides && transition.timing.type === "css") {
|
|
156
|
+
diagnostics.push({
|
|
157
|
+
code: "transition-invalid-token",
|
|
158
|
+
token: property,
|
|
159
|
+
message: `legacy transition property "${property}" cannot apply spring overrides to CSS timing`
|
|
160
|
+
});
|
|
161
|
+
continue;
|
|
162
|
+
}
|
|
163
|
+
entries.push({
|
|
164
|
+
...transition,
|
|
165
|
+
property,
|
|
166
|
+
timing: transition.timing.type === "preset" && propertyOverrides && hasPropertyOverrides ? {
|
|
167
|
+
...transition.timing,
|
|
168
|
+
config: propertyOverrides
|
|
169
|
+
} : transition.timing,
|
|
170
|
+
delay: delay ?? transition.delay
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
if (diagnostics.length) return {
|
|
174
|
+
ok: false,
|
|
175
|
+
diagnostics
|
|
176
|
+
};
|
|
177
|
+
const value = {
|
|
178
|
+
kind: "transition",
|
|
179
|
+
entries,
|
|
180
|
+
...enter ? { enter: {
|
|
181
|
+
...enter,
|
|
182
|
+
delay: delay ?? enter.delay
|
|
183
|
+
} } : {},
|
|
184
|
+
...exit ? { exit: {
|
|
185
|
+
...exit,
|
|
186
|
+
delay: delay ?? exit.delay
|
|
187
|
+
} } : {},
|
|
188
|
+
...hasConfig ? { config } : {}
|
|
189
|
+
};
|
|
190
|
+
return {
|
|
191
|
+
ok: true,
|
|
192
|
+
value
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
export { migrateLegacyTransition };
|
|
197
|
+
//# sourceMappingURL=transitionLegacy.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transitionLegacy.js","names":[],"sources":["esm/transitionLegacy.js"],"sourcesContent":["import { parseTransition } from \"./transition\";\nconst legacyControlKeys = /* @__PURE__ */ new Set([\n \"default\",\n \"enter\",\n \"exit\",\n \"delay\",\n \"stiffness\",\n \"damping\",\n \"mass\",\n \"tension\",\n \"friction\",\n \"velocity\",\n \"overshootClamping\",\n \"duration\",\n \"bounciness\",\n \"speed\"\n]);\nconst springConfigKeys = /* @__PURE__ */ new Set([\n \"stiffness\",\n \"damping\",\n \"mass\",\n \"tension\",\n \"friction\",\n \"velocity\",\n \"overshootClamping\",\n \"duration\",\n \"bounciness\",\n \"speed\"\n]);\nfunction migrateLegacyTransition(input, presetNames) {\n if (typeof input === \"string\") return parseTransition(input, presetNames);\n const inputIsTuple = Array.isArray(input);\n const options = inputIsTuple ? input[1] : input;\n const defaultValue = inputIsTuple ? input[0] : options.default;\n const diagnostics = [];\n const delay = options.delay === void 0 ? void 0 : typeof options.delay === \"number\" && Number.isFinite(options.delay) ? `${options.delay}ms` : null;\n if (delay === null) {\n diagnostics.push({\n code: \"transition-invalid-token\",\n token: String(options.delay),\n message: \"legacy transition delay must be a finite number of milliseconds\"\n });\n }\n const resolveTiming = (rawValue, field) => {\n const parsed = parseTransition(rawValue, presetNames);\n if (!parsed.ok) {\n for (let index = 0; index < parsed.diagnostics.length; index++) {\n const diagnostic = parsed.diagnostics[index];\n diagnostics.push({\n ...diagnostic,\n message: `legacy transition ${field}: ${diagnostic.message}`\n });\n }\n return;\n }\n if (parsed.value.kind !== \"transition\" || parsed.value.entries.length !== 1 || parsed.value.entries[0].property !== \"all\") {\n diagnostics.push({\n code: \"transition-invalid-token\",\n token: rawValue,\n message: `legacy transition ${field} must be a preset or CSS timing value`\n });\n return;\n }\n return parsed.value.entries[0];\n };\n let defaultTransition;\n if (defaultValue !== void 0) {\n if (typeof defaultValue === \"string\") {\n defaultTransition = resolveTiming(defaultValue, \"default\");\n } else {\n diagnostics.push({\n code: \"transition-invalid-token\",\n token: String(defaultValue),\n message: \"legacy transition default must be a preset or CSS timing value\"\n });\n }\n }\n const resolveLifecycle = (field) => {\n const rawValue = options[field];\n if (rawValue === void 0) return;\n if (typeof rawValue === \"string\") return resolveTiming(rawValue, field);\n diagnostics.push({\n code: \"transition-invalid-token\",\n token: String(rawValue),\n message: `legacy transition ${field} must be a preset or CSS timing value`\n });\n return;\n };\n const enter = resolveLifecycle(\"enter\");\n const exit = resolveLifecycle(\"exit\");\n const config = {};\n for (const key of springConfigKeys) {\n if (options[key] !== void 0) config[key] = options[key];\n }\n const hasConfig = Object.keys(config).length > 0;\n const entries = [];\n if (defaultTransition) {\n if (defaultTransition.timing.type === \"css\" && hasConfig) {\n diagnostics.push({\n code: \"transition-invalid-token\",\n token: String(defaultValue),\n message: \"spring overrides cannot be applied to CSS transition timing\"\n });\n }\n entries.push({\n ...defaultTransition,\n delay: delay ?? defaultTransition.delay,\n timing: defaultTransition.timing.type === \"preset\" && hasConfig ? { ...defaultTransition.timing, config } : defaultTransition.timing\n });\n }\n for (const [property, rawValue] of Object.entries(options)) {\n if (legacyControlKeys.has(property)) continue;\n let transition;\n let propertyConfig;\n if (typeof rawValue === \"string\") {\n transition = resolveTiming(rawValue, property);\n if (!transition) continue;\n } else if (rawValue && typeof rawValue === \"object\" && !Array.isArray(rawValue)) {\n propertyConfig = rawValue;\n if (propertyConfig.type === void 0) {\n transition = defaultTransition;\n } else if (typeof propertyConfig.type === \"string\") {\n transition = resolveTiming(propertyConfig.type, property);\n if (!transition) continue;\n } else {\n diagnostics.push({\n code: \"transition-invalid-token\",\n token: property,\n message: `legacy transition property \"${property}\" has a non-string type`\n });\n continue;\n }\n } else {\n diagnostics.push({\n code: \"transition-invalid-token\",\n token: property,\n message: `legacy transition property \"${property}\" needs a preset, CSS timing value, or default`\n });\n continue;\n }\n if (!transition) {\n diagnostics.push({\n code: \"transition-invalid-token\",\n token: property,\n message: `legacy transition property \"${property}\" needs a preset, CSS timing value, or default`\n });\n continue;\n }\n const propertyOverrides = propertyConfig ? Object.fromEntries(\n Object.entries(propertyConfig).filter(([key]) => key !== \"type\")\n ) : void 0;\n const hasPropertyOverrides = propertyOverrides !== void 0 && Object.keys(propertyOverrides).length > 0;\n if (hasPropertyOverrides && transition.timing.type === \"css\") {\n diagnostics.push({\n code: \"transition-invalid-token\",\n token: property,\n message: `legacy transition property \"${property}\" cannot apply spring overrides to CSS timing`\n });\n continue;\n }\n entries.push({\n ...transition,\n property,\n timing: transition.timing.type === \"preset\" && propertyOverrides && hasPropertyOverrides ? { ...transition.timing, config: propertyOverrides } : transition.timing,\n delay: delay ?? transition.delay\n });\n }\n if (diagnostics.length) return { ok: false, diagnostics };\n const value = {\n kind: \"transition\",\n entries,\n ...enter ? { enter: { ...enter, delay: delay ?? enter.delay } } : {},\n ...exit ? { exit: { ...exit, delay: delay ?? exit.delay } } : {},\n ...hasConfig ? { config } : {}\n };\n return { ok: true, value };\n}\nexport {\n migrateLegacyTransition\n};\n//# sourceMappingURL=transitionLegacy.js.map\n"],"mappings":";;;AACA,MAAM,oCAAoC,IAAI,IAAI;CAChD;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AACD,MAAM,mCAAmC,IAAI,IAAI;CAC/C;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AACD,SAAS,wBAAwB,OAAO,aAAa;CACnD,IAAI,OAAO,UAAU,UAAU,OAAO,gBAAgB,OAAO,WAAW;CACxE,MAAM,eAAe,MAAM,QAAQ,KAAK;CACxC,MAAM,UAAU,eAAe,MAAM,KAAK;CAC1C,MAAM,eAAe,eAAe,MAAM,KAAK,QAAQ;CACvD,MAAM,cAAc,CAAC;CACrB,MAAM,QAAQ,QAAQ,UAAU,KAAK,IAAI,KAAK,IAAI,OAAO,QAAQ,UAAU,YAAY,OAAO,SAAS,QAAQ,KAAK,IAAI,GAAG,QAAQ,MAAM,MAAM;CAC/I,IAAI,UAAU,MAAM;EAClB,YAAY,KAAK;GACf,MAAM;GACN,OAAO,OAAO,QAAQ,KAAK;GAC3B,SAAS;EACX,CAAC;CACH;CACA,MAAM,iBAAiB,UAAU,UAAU;EACzC,MAAM,SAAS,gBAAgB,UAAU,WA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;IACf,MAAM;IACN,OAAO;IACP,SAAS,+BAA+B,SAAS;GACnD,CAAC;GACD;EACF;EACA,QAAQ,KAAK;GACX,GAAG;GACH;GACA,QAAQ,WAAW,OAAO,SAAS,YAAY,qBAAqB,uBAAuB;IAAE,GAAG,WAAW;IAAQ,QAAQ;GAAkB,IAAI,WAAW;GAC5J,OAAO,SAAS,WAAW;EAC7B,CAAC;CACH;CACA,IAAI,YAAY,QAAQ,OAAO;EAAE,IAAI;EAAO;CAAY;CACxD,MAAM,QAAQ;EACZ,MAAM;EACN;EACA,GAAG,QAAQ,EAAE,OAAO;GAAE,GAAG;GAAO,OAAO,SAAS,MAAM;EAAM,EAAE,IAAI,CAAC;EACnE,GAAG,OAAO,EAAE,MAAM;GAAE,GAAG;GAAM,OAAO,SAAS,KAAK;EAAM,EAAE,IAAI,CAAC;EAC/D,GAAG,YAAY,EAAE,OAAO,IAAI,CAAC;CAC/B;CACA,OAAO;EAAE,IAAI;EAAM;CAAM;AAC3B"}
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import { parseTransition } from "./transition.native.js";
|
|
2
|
+
|
|
3
|
+
function _type_of(obj) {
|
|
4
|
+
"@swc/helpers - typeof";
|
|
5
|
+
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
6
|
+
}
|
|
7
|
+
var legacyControlKeys = /* @__PURE__ */ new Set([
|
|
8
|
+
"default",
|
|
9
|
+
"enter",
|
|
10
|
+
"exit",
|
|
11
|
+
"delay",
|
|
12
|
+
"stiffness",
|
|
13
|
+
"damping",
|
|
14
|
+
"mass",
|
|
15
|
+
"tension",
|
|
16
|
+
"friction",
|
|
17
|
+
"velocity",
|
|
18
|
+
"overshootClamping",
|
|
19
|
+
"duration",
|
|
20
|
+
"bounciness",
|
|
21
|
+
"speed"
|
|
22
|
+
]);
|
|
23
|
+
var springConfigKeys = /* @__PURE__ */ new Set([
|
|
24
|
+
"stiffness",
|
|
25
|
+
"damping",
|
|
26
|
+
"mass",
|
|
27
|
+
"tension",
|
|
28
|
+
"friction",
|
|
29
|
+
"velocity",
|
|
30
|
+
"overshootClamping",
|
|
31
|
+
"duration",
|
|
32
|
+
"bounciness",
|
|
33
|
+
"speed"
|
|
34
|
+
]);
|
|
35
|
+
function migrateLegacyTransition(input, presetNames) {
|
|
36
|
+
if (typeof input === "string") return parseTransition(input, presetNames);
|
|
37
|
+
var inputIsTuple = Array.isArray(input);
|
|
38
|
+
var options = inputIsTuple ? input[1] : input;
|
|
39
|
+
var defaultValue = inputIsTuple ? input[0] : options.default;
|
|
40
|
+
var diagnostics = [];
|
|
41
|
+
var delay = options.delay === void 0 ? void 0 : typeof options.delay === "number" && Number.isFinite(options.delay) ? `${options.delay}ms` : null;
|
|
42
|
+
if (delay === null) {
|
|
43
|
+
diagnostics.push({
|
|
44
|
+
code: "transition-invalid-token",
|
|
45
|
+
token: String(options.delay),
|
|
46
|
+
message: "legacy transition delay must be a finite number of milliseconds"
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
var resolveTiming = function(rawValue2, field) {
|
|
50
|
+
var parsed = parseTransition(rawValue2, presetNames);
|
|
51
|
+
if (!parsed.ok) {
|
|
52
|
+
for (var index = 0; index < parsed.diagnostics.length; index++) {
|
|
53
|
+
var diagnostic = parsed.diagnostics[index];
|
|
54
|
+
diagnostics.push({
|
|
55
|
+
...diagnostic,
|
|
56
|
+
message: `legacy transition ${field}: ${diagnostic.message}`
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
if (parsed.value.kind !== "transition" || parsed.value.entries.length !== 1 || parsed.value.entries[0].property !== "all") {
|
|
62
|
+
diagnostics.push({
|
|
63
|
+
code: "transition-invalid-token",
|
|
64
|
+
token: rawValue2,
|
|
65
|
+
message: `legacy transition ${field} must be a preset or CSS timing value`
|
|
66
|
+
});
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
return parsed.value.entries[0];
|
|
70
|
+
};
|
|
71
|
+
var defaultTransition;
|
|
72
|
+
if (defaultValue !== void 0) {
|
|
73
|
+
if (typeof defaultValue === "string") {
|
|
74
|
+
defaultTransition = resolveTiming(defaultValue, "default");
|
|
75
|
+
} else {
|
|
76
|
+
diagnostics.push({
|
|
77
|
+
code: "transition-invalid-token",
|
|
78
|
+
token: String(defaultValue),
|
|
79
|
+
message: "legacy transition default must be a preset or CSS timing value"
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
var resolveLifecycle = function(field) {
|
|
84
|
+
var rawValue2 = options[field];
|
|
85
|
+
if (rawValue2 === void 0) return;
|
|
86
|
+
if (typeof rawValue2 === "string") return resolveTiming(rawValue2, field);
|
|
87
|
+
diagnostics.push({
|
|
88
|
+
code: "transition-invalid-token",
|
|
89
|
+
token: String(rawValue2),
|
|
90
|
+
message: `legacy transition ${field} must be a preset or CSS timing value`
|
|
91
|
+
});
|
|
92
|
+
return;
|
|
93
|
+
};
|
|
94
|
+
var enter = resolveLifecycle("enter");
|
|
95
|
+
var exit = resolveLifecycle("exit");
|
|
96
|
+
var config = {};
|
|
97
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
98
|
+
try {
|
|
99
|
+
for (var _iterator = springConfigKeys[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
100
|
+
var key = _step.value;
|
|
101
|
+
if (options[key] !== void 0) config[key] = options[key];
|
|
102
|
+
}
|
|
103
|
+
} catch (err) {
|
|
104
|
+
_didIteratorError = true;
|
|
105
|
+
_iteratorError = err;
|
|
106
|
+
} finally {
|
|
107
|
+
try {
|
|
108
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
109
|
+
_iterator.return();
|
|
110
|
+
}
|
|
111
|
+
} finally {
|
|
112
|
+
if (_didIteratorError) {
|
|
113
|
+
throw _iteratorError;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
var hasConfig = Object.keys(config).length > 0;
|
|
118
|
+
var entries = [];
|
|
119
|
+
if (defaultTransition) {
|
|
120
|
+
if (defaultTransition.timing.type === "css" && hasConfig) {
|
|
121
|
+
diagnostics.push({
|
|
122
|
+
code: "transition-invalid-token",
|
|
123
|
+
token: String(defaultValue),
|
|
124
|
+
message: "spring overrides cannot be applied to CSS transition timing"
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
entries.push({
|
|
128
|
+
...defaultTransition,
|
|
129
|
+
delay: delay !== null && delay !== void 0 ? delay : defaultTransition.delay,
|
|
130
|
+
timing: defaultTransition.timing.type === "preset" && hasConfig ? {
|
|
131
|
+
...defaultTransition.timing,
|
|
132
|
+
config
|
|
133
|
+
} : defaultTransition.timing
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;
|
|
137
|
+
try {
|
|
138
|
+
for (var _iterator1 = Object.entries(options)[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {
|
|
139
|
+
var [property, rawValue] = _step1.value;
|
|
140
|
+
if (legacyControlKeys.has(property)) continue;
|
|
141
|
+
var transition = void 0;
|
|
142
|
+
var propertyConfig = void 0;
|
|
143
|
+
if (typeof rawValue === "string") {
|
|
144
|
+
transition = resolveTiming(rawValue, property);
|
|
145
|
+
if (!transition) continue;
|
|
146
|
+
} else if (rawValue && (typeof rawValue === "undefined" ? "undefined" : _type_of(rawValue)) === "object" && !Array.isArray(rawValue)) {
|
|
147
|
+
propertyConfig = rawValue;
|
|
148
|
+
if (propertyConfig.type === void 0) {
|
|
149
|
+
transition = defaultTransition;
|
|
150
|
+
} else if (typeof propertyConfig.type === "string") {
|
|
151
|
+
transition = resolveTiming(propertyConfig.type, property);
|
|
152
|
+
if (!transition) continue;
|
|
153
|
+
} else {
|
|
154
|
+
diagnostics.push({
|
|
155
|
+
code: "transition-invalid-token",
|
|
156
|
+
token: property,
|
|
157
|
+
message: `legacy transition property "${property}" has a non-string type`
|
|
158
|
+
});
|
|
159
|
+
continue;
|
|
160
|
+
}
|
|
161
|
+
} else {
|
|
162
|
+
diagnostics.push({
|
|
163
|
+
code: "transition-invalid-token",
|
|
164
|
+
token: property,
|
|
165
|
+
message: `legacy transition property "${property}" needs a preset, CSS timing value, or default`
|
|
166
|
+
});
|
|
167
|
+
continue;
|
|
168
|
+
}
|
|
169
|
+
if (!transition) {
|
|
170
|
+
diagnostics.push({
|
|
171
|
+
code: "transition-invalid-token",
|
|
172
|
+
token: property,
|
|
173
|
+
message: `legacy transition property "${property}" needs a preset, CSS timing value, or default`
|
|
174
|
+
});
|
|
175
|
+
continue;
|
|
176
|
+
}
|
|
177
|
+
var propertyOverrides = propertyConfig ? Object.fromEntries(Object.entries(propertyConfig).filter(function(param) {
|
|
178
|
+
var [key2] = param;
|
|
179
|
+
return key2 !== "type";
|
|
180
|
+
})) : void 0;
|
|
181
|
+
var hasPropertyOverrides = propertyOverrides !== void 0 && Object.keys(propertyOverrides).length > 0;
|
|
182
|
+
if (hasPropertyOverrides && transition.timing.type === "css") {
|
|
183
|
+
diagnostics.push({
|
|
184
|
+
code: "transition-invalid-token",
|
|
185
|
+
token: property,
|
|
186
|
+
message: `legacy transition property "${property}" cannot apply spring overrides to CSS timing`
|
|
187
|
+
});
|
|
188
|
+
continue;
|
|
189
|
+
}
|
|
190
|
+
entries.push({
|
|
191
|
+
...transition,
|
|
192
|
+
property,
|
|
193
|
+
timing: transition.timing.type === "preset" && propertyOverrides && hasPropertyOverrides ? {
|
|
194
|
+
...transition.timing,
|
|
195
|
+
config: propertyOverrides
|
|
196
|
+
} : transition.timing,
|
|
197
|
+
delay: delay !== null && delay !== void 0 ? delay : transition.delay
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
} catch (err) {
|
|
201
|
+
_didIteratorError1 = true;
|
|
202
|
+
_iteratorError1 = err;
|
|
203
|
+
} finally {
|
|
204
|
+
try {
|
|
205
|
+
if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
|
|
206
|
+
_iterator1.return();
|
|
207
|
+
}
|
|
208
|
+
} finally {
|
|
209
|
+
if (_didIteratorError1) {
|
|
210
|
+
throw _iteratorError1;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
if (diagnostics.length) return {
|
|
215
|
+
ok: false,
|
|
216
|
+
diagnostics
|
|
217
|
+
};
|
|
218
|
+
var value = {
|
|
219
|
+
kind: "transition",
|
|
220
|
+
entries,
|
|
221
|
+
...enter ? { enter: {
|
|
222
|
+
...enter,
|
|
223
|
+
delay: delay !== null && delay !== void 0 ? delay : enter.delay
|
|
224
|
+
} } : {},
|
|
225
|
+
...exit ? { exit: {
|
|
226
|
+
...exit,
|
|
227
|
+
delay: delay !== null && delay !== void 0 ? delay : exit.delay
|
|
228
|
+
} } : {},
|
|
229
|
+
...hasConfig ? { config } : {}
|
|
230
|
+
};
|
|
231
|
+
return {
|
|
232
|
+
ok: true,
|
|
233
|
+
value
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
export { migrateLegacyTransition };
|
|
238
|
+
//# sourceMappingURL=transitionLegacy.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transitionLegacy.native.js","names":[],"sources":["esm/transitionLegacy.native.js"],"sourcesContent":["import { parseTransition } from \"./transition\";\nfunction _type_of(obj) {\n \"@swc/helpers - typeof\";\n return obj && typeof Symbol !== \"undefined\" && obj.constructor === Symbol ? \"symbol\" : typeof obj;\n}\nvar legacyControlKeys = /* @__PURE__ */ new Set([\n \"default\",\n \"enter\",\n \"exit\",\n \"delay\",\n \"stiffness\",\n \"damping\",\n \"mass\",\n \"tension\",\n \"friction\",\n \"velocity\",\n \"overshootClamping\",\n \"duration\",\n \"bounciness\",\n \"speed\"\n]);\nvar springConfigKeys = /* @__PURE__ */ new Set([\n \"stiffness\",\n \"damping\",\n \"mass\",\n \"tension\",\n \"friction\",\n \"velocity\",\n \"overshootClamping\",\n \"duration\",\n \"bounciness\",\n \"speed\"\n]);\nfunction migrateLegacyTransition(input, presetNames) {\n if (typeof input === \"string\") return parseTransition(input, presetNames);\n var inputIsTuple = Array.isArray(input);\n var options = inputIsTuple ? input[1] : input;\n var defaultValue = inputIsTuple ? input[0] : options.default;\n var diagnostics = [];\n var delay = options.delay === void 0 ? void 0 : typeof options.delay === \"number\" && Number.isFinite(options.delay) ? `${options.delay}ms` : null;\n if (delay === null) {\n diagnostics.push({\n code: \"transition-invalid-token\",\n token: String(options.delay),\n message: \"legacy transition delay must be a finite number of milliseconds\"\n });\n }\n var resolveTiming = function(rawValue2, field) {\n var parsed = parseTransition(rawValue2, presetNames);\n if (!parsed.ok) {\n for (var index = 0; index < parsed.diagnostics.length; index++) {\n var diagnostic = parsed.diagnostics[index];\n diagnostics.push({\n ...diagnostic,\n message: `legacy transition ${field}: ${diagnostic.message}`\n });\n }\n return;\n }\n if (parsed.value.kind !== \"transition\" || parsed.value.entries.length !== 1 || parsed.value.entries[0].property !== \"all\") {\n diagnostics.push({\n code: \"transition-invalid-token\",\n token: rawValue2,\n message: `legacy transition ${field} must be a preset or CSS timing value`\n });\n return;\n }\n return parsed.value.entries[0];\n };\n var defaultTransition;\n if (defaultValue !== void 0) {\n if (typeof defaultValue === \"string\") {\n defaultTransition = resolveTiming(defaultValue, \"default\");\n } else {\n diagnostics.push({\n code: \"transition-invalid-token\",\n token: String(defaultValue),\n message: \"legacy transition default must be a preset or CSS timing value\"\n });\n }\n }\n var resolveLifecycle = function(field) {\n var rawValue2 = options[field];\n if (rawValue2 === void 0) return;\n if (typeof rawValue2 === \"string\") return resolveTiming(rawValue2, field);\n diagnostics.push({\n code: \"transition-invalid-token\",\n token: String(rawValue2),\n message: `legacy transition ${field} must be a preset or CSS timing value`\n });\n return;\n };\n var enter = resolveLifecycle(\"enter\");\n var exit = resolveLifecycle(\"exit\");\n var config = {};\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = springConfigKeys[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var key = _step.value;\n if (options[key] !== void 0) config[key] = options[key];\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n var hasConfig = Object.keys(config).length > 0;\n var entries = [];\n if (defaultTransition) {\n if (defaultTransition.timing.type === \"css\" && hasConfig) {\n diagnostics.push({\n code: \"transition-invalid-token\",\n token: String(defaultValue),\n message: \"spring overrides cannot be applied to CSS transition timing\"\n });\n }\n entries.push({\n ...defaultTransition,\n delay: delay !== null && delay !== void 0 ? delay : defaultTransition.delay,\n timing: defaultTransition.timing.type === \"preset\" && hasConfig ? {\n ...defaultTransition.timing,\n config\n } : defaultTransition.timing\n });\n }\n var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;\n try {\n for (var _iterator1 = Object.entries(options)[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {\n var [property, rawValue] = _step1.value;\n if (legacyControlKeys.has(property)) continue;\n var transition = void 0;\n var propertyConfig = void 0;\n if (typeof rawValue === \"string\") {\n transition = resolveTiming(rawValue, property);\n if (!transition) continue;\n } else if (rawValue && (typeof rawValue === \"undefined\" ? \"undefined\" : _type_of(rawValue)) === \"object\" && !Array.isArray(rawValue)) {\n propertyConfig = rawValue;\n if (propertyConfig.type === void 0) {\n transition = defaultTransition;\n } else if (typeof propertyConfig.type === \"string\") {\n transition = resolveTiming(propertyConfig.type, property);\n if (!transition) continue;\n } else {\n diagnostics.push({\n code: \"transition-invalid-token\",\n token: property,\n message: `legacy transition property \"${property}\" has a non-string type`\n });\n continue;\n }\n } else {\n diagnostics.push({\n code: \"transition-invalid-token\",\n token: property,\n message: `legacy transition property \"${property}\" needs a preset, CSS timing value, or default`\n });\n continue;\n }\n if (!transition) {\n diagnostics.push({\n code: \"transition-invalid-token\",\n token: property,\n message: `legacy transition property \"${property}\" needs a preset, CSS timing value, or default`\n });\n continue;\n }\n var propertyOverrides = propertyConfig ? Object.fromEntries(Object.entries(propertyConfig).filter(function(param) {\n var [key2] = param;\n return key2 !== \"type\";\n })) : void 0;\n var hasPropertyOverrides = propertyOverrides !== void 0 && Object.keys(propertyOverrides).length > 0;\n if (hasPropertyOverrides && transition.timing.type === \"css\") {\n diagnostics.push({\n code: \"transition-invalid-token\",\n token: property,\n message: `legacy transition property \"${property}\" cannot apply spring overrides to CSS timing`\n });\n continue;\n }\n entries.push({\n ...transition,\n property,\n timing: transition.timing.type === \"preset\" && propertyOverrides && hasPropertyOverrides ? {\n ...transition.timing,\n config: propertyOverrides\n } : transition.timing,\n delay: delay !== null && delay !== void 0 ? delay : transition.delay\n });\n }\n } catch (err) {\n _didIteratorError1 = true;\n _iteratorError1 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion1 && _iterator1.return != null) {\n _iterator1.return();\n }\n } finally {\n if (_didIteratorError1) {\n throw _iteratorError1;\n }\n }\n }\n if (diagnostics.length) return {\n ok: false,\n diagnostics\n };\n var value = {\n kind: \"transition\",\n entries,\n ...enter ? {\n enter: {\n ...enter,\n delay: delay !== null && delay !== void 0 ? delay : enter.delay\n }\n } : {},\n ...exit ? {\n exit: {\n ...exit,\n delay: delay !== null && delay !== void 0 ? delay : exit.delay\n }\n } : {},\n ...hasConfig ? {\n config\n } : {}\n };\n return {\n ok: true,\n value\n };\n}\nexport {\n migrateLegacyTransition\n};\n//# sourceMappingURL=transitionLegacy.js.map\n"],"mappings":";;;AACA,SAAS,SAAS,KAAK;CACrB;CACA,OAAO,OAAO,OAAO,WAAW,eAAe,IAAI,gB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