@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,459 @@
|
|
|
1
|
+
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all) __defProp(target, name, {
|
|
8
|
+
get: all[name],
|
|
9
|
+
enumerable: true
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
15
|
+
get: () => from[key],
|
|
16
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
|
+
var toolingDiagnostics_exports = {};
|
|
23
|
+
__export(toolingDiagnostics_exports, {
|
|
24
|
+
canonicalizeStyleValue: () => canonicalizeStyleValue,
|
|
25
|
+
completeStyleValue: () => completeStyleValue,
|
|
26
|
+
completeStyleValueAtCursor: () => completeStyleValueAtCursor,
|
|
27
|
+
createCandidatePropertyVocabulary: () => createCandidatePropertyVocabulary,
|
|
28
|
+
createGrammarConfigViewFromSerializedConfig: () => createGrammarConfigViewFromSerializedConfig,
|
|
29
|
+
createStylePropSet: () => createStylePropSet,
|
|
30
|
+
diagnoseStyleValue: () => diagnoseStyleValue,
|
|
31
|
+
diagnoseStyleValueProgram: () => diagnoseStyleValueProgram,
|
|
32
|
+
modifierChainBefore: () => modifierChainBefore,
|
|
33
|
+
referenceKindFor: () => referenceKindFor
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(toolingDiagnostics_exports);
|
|
36
|
+
var import_candidateTarget = require("./candidateTarget.cjs");
|
|
37
|
+
var import_config = require("./config.cjs");
|
|
38
|
+
var import_geometricShorthand = require("./geometricShorthand.cjs");
|
|
39
|
+
var import_mergeFlatValues = require("./mergeFlatValues.cjs");
|
|
40
|
+
var import_payloadShape = require("./payloadShape.cjs");
|
|
41
|
+
var import_programEligibility = require("./programEligibility.cjs");
|
|
42
|
+
var import_resolvePayload = require("./resolvePayload.cjs");
|
|
43
|
+
var import_registry = require("./registry.cjs");
|
|
44
|
+
var import_valueParser = require("./valueParser.cjs");
|
|
45
|
+
var import_v6ThemeNames = require("./v6ThemeNames.cjs");
|
|
46
|
+
function canonicalizeStyleValue(input, registry) {
|
|
47
|
+
const parsed = (0, import_valueParser.parseValue)(input, registry);
|
|
48
|
+
if (!parsed.ok) return parsed;
|
|
49
|
+
return {
|
|
50
|
+
ok: true,
|
|
51
|
+
value: (0, import_mergeFlatValues.formatParsedValue)(parsed.value),
|
|
52
|
+
parsed: parsed.value
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
function forEachName(names, visit) {
|
|
56
|
+
if (!names) return;
|
|
57
|
+
if (Array.isArray(names)) {
|
|
58
|
+
for (const name of names) visit(name);
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
if (names instanceof Set) {
|
|
62
|
+
for (const name of names) visit(name);
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
for (const name in names) visit(name);
|
|
66
|
+
}
|
|
67
|
+
function createCandidatePropertyVocabulary(config) {
|
|
68
|
+
const byName = /* @__PURE__ */ new Map();
|
|
69
|
+
const entriesByCategory = /* @__PURE__ */ new Map();
|
|
70
|
+
for (const entry of import_registry.grammarEntries) {
|
|
71
|
+
if (!entry.tokenCategory) continue;
|
|
72
|
+
const contributions = entriesByCategory.get(entry.tokenCategory) || [];
|
|
73
|
+
contributions.push({
|
|
74
|
+
property: entry.prop,
|
|
75
|
+
tokenCategory: entry.tokenCategory
|
|
76
|
+
});
|
|
77
|
+
entriesByCategory.set(entry.tokenCategory, contributions);
|
|
78
|
+
}
|
|
79
|
+
for (const [category, contributions] of entriesByCategory) {
|
|
80
|
+
forEachName(config.tokenNames?.[category], (name) => {
|
|
81
|
+
const existing = byName.get(name) || [];
|
|
82
|
+
for (const contribution of contributions) {
|
|
83
|
+
if (!existing.some((item) => item.property === contribution.property)) {
|
|
84
|
+
existing.push(contribution);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
byName.set(name, existing);
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
return byName;
|
|
91
|
+
}
|
|
92
|
+
function createGrammarConfigViewFromSerializedConfig(config, metadata) {
|
|
93
|
+
const isVersioned = typeof metadata === "object" && metadata !== null && metadata.themeFields === "values-only";
|
|
94
|
+
if (metadata !== void 0 && !isVersioned) {
|
|
95
|
+
throw new Error("@tamagui/style-grammar: unsupported serialized config themeFields format");
|
|
96
|
+
}
|
|
97
|
+
const themes = {};
|
|
98
|
+
for (const themeName in config.themes) {
|
|
99
|
+
const serializedTheme = config.themes[themeName];
|
|
100
|
+
if (!serializedTheme || typeof serializedTheme !== "object") continue;
|
|
101
|
+
const runtimeTheme = {};
|
|
102
|
+
for (const key in serializedTheme) {
|
|
103
|
+
if (isVersioned || key !== "id") {
|
|
104
|
+
runtimeTheme[key] = serializedTheme[key];
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
themes[themeName] = runtimeTheme;
|
|
108
|
+
}
|
|
109
|
+
return (0, import_config.createGrammarConfigView)({
|
|
110
|
+
shorthands: config.shorthands,
|
|
111
|
+
media: config.media,
|
|
112
|
+
themes,
|
|
113
|
+
tokensParsed: config.tokens,
|
|
114
|
+
fontsParsed: config.fonts
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
const removedThemeNames = new Set(import_v6ThemeNames.v6RemovedThemeNames);
|
|
118
|
+
const grammarProperties = new Set(import_registry.grammarEntries.map((entry) => entry.prop));
|
|
119
|
+
const categoryReferenceKind = {
|
|
120
|
+
color: "color",
|
|
121
|
+
space: "length",
|
|
122
|
+
size: "length",
|
|
123
|
+
radius: "length",
|
|
124
|
+
zIndex: "number",
|
|
125
|
+
fontFamily: "other",
|
|
126
|
+
fontSize: "length",
|
|
127
|
+
fontWeight: "number",
|
|
128
|
+
lineHeight: "length",
|
|
129
|
+
letterSpacing: "length"
|
|
130
|
+
};
|
|
131
|
+
function referenceKindFor(contributions, targetProperty) {
|
|
132
|
+
let fallback;
|
|
133
|
+
for (const contribution of contributions) {
|
|
134
|
+
const kind = contribution.tokenCategory ? categoryReferenceKind[contribution.tokenCategory] : "other";
|
|
135
|
+
if (contribution.property === targetProperty) return kind;
|
|
136
|
+
if (fallback !== "color") fallback = kind;
|
|
137
|
+
}
|
|
138
|
+
return fallback ?? "other";
|
|
139
|
+
}
|
|
140
|
+
function parseErrorSpan(input, error) {
|
|
141
|
+
const length = input.length;
|
|
142
|
+
if (error.code === "unregistered-modifier" && error.modifier) {
|
|
143
|
+
return {
|
|
144
|
+
start: error.index,
|
|
145
|
+
end: error.index + error.modifier.length
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
if (error.code === "unterminated-string" || error.code === "unterminated-function" || error.code === "unterminated-comment") {
|
|
149
|
+
return {
|
|
150
|
+
start: Math.max(0, Math.min(error.index, length - 1)),
|
|
151
|
+
end: length
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
const start = Math.max(0, Math.min(error.index, length - 1));
|
|
155
|
+
const width = error.code === "stray-comment-close" ? 2 : 1;
|
|
156
|
+
return {
|
|
157
|
+
start,
|
|
158
|
+
end: Math.min(length, start + width)
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
function candidateEndWithSuffix(payload, end) {
|
|
162
|
+
if (payload.charCodeAt(end) !== 47) return end;
|
|
163
|
+
let cursor = end + 1;
|
|
164
|
+
while (cursor < payload.length) {
|
|
165
|
+
const code = payload.charCodeAt(cursor);
|
|
166
|
+
if (code === 32 || code === 9 || code === 10 || code === 13 || code === 12) break;
|
|
167
|
+
if (code === 44 || code === 40 || code === 41) break;
|
|
168
|
+
cursor++;
|
|
169
|
+
}
|
|
170
|
+
return cursor;
|
|
171
|
+
}
|
|
172
|
+
function diagnoseStyleValue(property, input, options) {
|
|
173
|
+
const { result, spans } = (0, import_valueParser.parseValueWithSourceSpans)(input, options.registry);
|
|
174
|
+
if (!result.ok) {
|
|
175
|
+
return result.errors.map((error) => {
|
|
176
|
+
const span = parseErrorSpan(input, error);
|
|
177
|
+
return {
|
|
178
|
+
code: error.code,
|
|
179
|
+
index: span.start,
|
|
180
|
+
...span,
|
|
181
|
+
message: error.message
|
|
182
|
+
};
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
const targetProperty = options.config.shorthands?.[property] || property;
|
|
186
|
+
const targetIsKnown = grammarProperties.has(targetProperty);
|
|
187
|
+
const candidates = options.candidates || createCandidatePropertyVocabulary(options.config);
|
|
188
|
+
const diagnostics = [];
|
|
189
|
+
const diagnosed = /* @__PURE__ */ new Set();
|
|
190
|
+
const push = (key, diagnostic) => {
|
|
191
|
+
if (diagnosed.has(key)) return;
|
|
192
|
+
diagnosed.add(key);
|
|
193
|
+
diagnostics.push({
|
|
194
|
+
index: diagnostic.start,
|
|
195
|
+
...diagnostic
|
|
196
|
+
});
|
|
197
|
+
};
|
|
198
|
+
const diagnoseSegment = (payload, offset) => {
|
|
199
|
+
const sightings = [];
|
|
200
|
+
const resolved = (0, import_resolvePayload.resolvePayload)(payload, {
|
|
201
|
+
lookup(name) {
|
|
202
|
+
const contributions2 = candidates.get(name);
|
|
203
|
+
if (!contributions2) return void 0;
|
|
204
|
+
return {
|
|
205
|
+
name,
|
|
206
|
+
kind: referenceKindFor(contributions2, targetProperty)
|
|
207
|
+
};
|
|
208
|
+
},
|
|
209
|
+
onCandidate(start, end, name, reference) {
|
|
210
|
+
sightings.push({
|
|
211
|
+
start,
|
|
212
|
+
end,
|
|
213
|
+
name,
|
|
214
|
+
resolved: reference
|
|
215
|
+
});
|
|
216
|
+
if (reference) return;
|
|
217
|
+
const replacement = import_v6ThemeNames.v6ThemeNameReplacements[name];
|
|
218
|
+
if (replacement) {
|
|
219
|
+
push(`v6-theme-name-replaced:${name}`, {
|
|
220
|
+
code: "v6-theme-name-replaced",
|
|
221
|
+
start: offset + start,
|
|
222
|
+
end: offset + end,
|
|
223
|
+
candidate: name,
|
|
224
|
+
replacement,
|
|
225
|
+
message: `"${name}" is not a v6 built-in name; use "${replacement}"`
|
|
226
|
+
});
|
|
227
|
+
} else if (removedThemeNames.has(name)) {
|
|
228
|
+
push(`v6-theme-name-removed:${name}`, {
|
|
229
|
+
code: "v6-theme-name-removed",
|
|
230
|
+
start: offset + start,
|
|
231
|
+
end: offset + end,
|
|
232
|
+
candidate: name,
|
|
233
|
+
message: `"${name}" was removed from the v6 built-in theme vocabulary`
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
});
|
|
238
|
+
if (targetIsKnown) {
|
|
239
|
+
for (const error of resolved.errors) {
|
|
240
|
+
const sighting2 = sightings.find((entry) => entry.start === error.index);
|
|
241
|
+
if (!sighting2?.resolved) continue;
|
|
242
|
+
push(`${error.code}:${error.name}:${error.opacity}`, {
|
|
243
|
+
code: error.code,
|
|
244
|
+
start: offset + error.index,
|
|
245
|
+
end: offset + candidateEndWithSuffix(payload, sighting2.end),
|
|
246
|
+
candidate: error.name,
|
|
247
|
+
message: error.message
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
const candidate = resolved.segments.length === 1 && typeof resolved.segments[0] !== "string" ? resolved.segments[0].name : null;
|
|
252
|
+
if (candidate === null || !targetIsKnown) return;
|
|
253
|
+
const contributions = candidates.get(candidate);
|
|
254
|
+
if (!contributions) return;
|
|
255
|
+
const target = (0, import_candidateTarget.resolveCandidateTarget)(targetProperty, candidate, contributions);
|
|
256
|
+
if (target.ok) return;
|
|
257
|
+
const sighting = sightings.find((entry) => entry.name === candidate && entry.resolved);
|
|
258
|
+
push(`${target.diagnostic.code}:${candidate}:${targetProperty}`, {
|
|
259
|
+
...target.diagnostic,
|
|
260
|
+
start: offset + (sighting?.start ?? 0),
|
|
261
|
+
end: offset + (sighting?.end ?? payload.length)
|
|
262
|
+
});
|
|
263
|
+
};
|
|
264
|
+
for (const span of spans) {
|
|
265
|
+
if (span.kind !== "base" && span.kind !== "payload") continue;
|
|
266
|
+
if (span.start >= span.end) continue;
|
|
267
|
+
diagnoseSegment(input.slice(span.start, span.end), span.start);
|
|
268
|
+
}
|
|
269
|
+
return diagnostics;
|
|
270
|
+
}
|
|
271
|
+
function modifierChainBefore(input, spans, start) {
|
|
272
|
+
const byEnd = /* @__PURE__ */ new Map();
|
|
273
|
+
for (const span of spans) {
|
|
274
|
+
if (span.kind === "modifier") byEnd.set(span.end, span);
|
|
275
|
+
}
|
|
276
|
+
const reversed = [];
|
|
277
|
+
let colon = start - 1;
|
|
278
|
+
while (colon >= 0 && input.charCodeAt(colon) === 58) {
|
|
279
|
+
const span = byEnd.get(colon);
|
|
280
|
+
if (!span) break;
|
|
281
|
+
reversed.push(input.slice(span.start, span.end));
|
|
282
|
+
colon = span.start - 1;
|
|
283
|
+
}
|
|
284
|
+
reversed.reverse();
|
|
285
|
+
return reversed;
|
|
286
|
+
}
|
|
287
|
+
function createStylePropSet(config) {
|
|
288
|
+
const styleProps = /* @__PURE__ */ new Set([...import_registry.grammarEntries.map((entry) => entry.prop), ...Object.keys(import_programEligibility.legacyPartComposite)]);
|
|
289
|
+
for (const shorthand in config.shorthands) {
|
|
290
|
+
styleProps.add(shorthand);
|
|
291
|
+
styleProps.add(config.shorthands[shorthand]);
|
|
292
|
+
}
|
|
293
|
+
return styleProps;
|
|
294
|
+
}
|
|
295
|
+
function payloadSpan(input, payload) {
|
|
296
|
+
const at = input.indexOf(payload);
|
|
297
|
+
return at === -1 ? {
|
|
298
|
+
start: 0,
|
|
299
|
+
end: input.length
|
|
300
|
+
} : {
|
|
301
|
+
start: at,
|
|
302
|
+
end: at + payload.length
|
|
303
|
+
};
|
|
304
|
+
}
|
|
305
|
+
function diagnoseStyleValueProgram(property, input, options) {
|
|
306
|
+
const candidates = options.candidates || createCandidatePropertyVocabulary(options.config);
|
|
307
|
+
const scoped = {
|
|
308
|
+
...options,
|
|
309
|
+
candidates
|
|
310
|
+
};
|
|
311
|
+
const diagnostics = diagnoseStyleValue(property, input, scoped);
|
|
312
|
+
if (diagnostics.length > 0) return diagnostics;
|
|
313
|
+
const parsed = (0, import_valueParser.parseValue)(input, options.registry);
|
|
314
|
+
if (!parsed.ok) return diagnostics;
|
|
315
|
+
const targetProperty = options.config.shorthands?.[property] || property;
|
|
316
|
+
if (parsed.value.clauses.length > 0 && (0, import_programEligibility.programEligibility)(targetProperty) === "legacy-part") {
|
|
317
|
+
return [{
|
|
318
|
+
code: "legacy-part-conditional",
|
|
319
|
+
index: 0,
|
|
320
|
+
start: 0,
|
|
321
|
+
end: input.length,
|
|
322
|
+
property: targetProperty,
|
|
323
|
+
message: `conditional values are not supported on part prop "${targetProperty}"; move the condition onto \`${import_programEligibility.legacyPartComposite[targetProperty]}\``
|
|
324
|
+
}];
|
|
325
|
+
}
|
|
326
|
+
const results = [];
|
|
327
|
+
const reported = /* @__PURE__ */ new Set();
|
|
328
|
+
const geometric = (0, import_geometricShorthand.splitGeometricShorthandValue)(targetProperty, parsed.value);
|
|
329
|
+
const programs = geometric && geometric.errors.length === 0 ? geometric.entries : [{
|
|
330
|
+
property: targetProperty,
|
|
331
|
+
value: parsed.value
|
|
332
|
+
}];
|
|
333
|
+
for (const program of programs) {
|
|
334
|
+
const { base, clauses } = program.value;
|
|
335
|
+
const payloads = [...base === null ? [] : [base], ...clauses.map((clause) => clause.payload)];
|
|
336
|
+
for (const payload of payloads) {
|
|
337
|
+
for (const diagnostic of diagnoseStyleValueProgramSlot(program.property, payload, scoped)) {
|
|
338
|
+
const key = `${diagnostic.code}:${diagnostic.candidate}:${program.property}`;
|
|
339
|
+
if (reported.has(key)) continue;
|
|
340
|
+
reported.add(key);
|
|
341
|
+
const span = payloadSpan(input, payload);
|
|
342
|
+
results.push({
|
|
343
|
+
...diagnostic,
|
|
344
|
+
index: span.start,
|
|
345
|
+
...span
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
if (base !== null) {
|
|
350
|
+
pushShapeDiagnostic(results, reported, input, program.property, base, true);
|
|
351
|
+
}
|
|
352
|
+
for (const clause of clauses) {
|
|
353
|
+
pushShapeDiagnostic(results, reported, input, program.property, clause.payload, base !== null);
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
return results;
|
|
357
|
+
}
|
|
358
|
+
function diagnoseStyleValueProgramSlot(property, payload, options) {
|
|
359
|
+
const slotDiagnostics = diagnoseStyleValue(property, payload, options);
|
|
360
|
+
return slotDiagnostics.filter((diagnostic) => diagnostic.code === "candidate-property-mismatch");
|
|
361
|
+
}
|
|
362
|
+
function pushShapeDiagnostic(results, reported, input, property, payload, hasBase) {
|
|
363
|
+
const diagnostic = (0, import_payloadShape.validatePayloadShape)(property, payload, hasBase);
|
|
364
|
+
if (!diagnostic) return;
|
|
365
|
+
const key = `${diagnostic.code}:${diagnostic.payload}:${property}`;
|
|
366
|
+
if (reported.has(key)) return;
|
|
367
|
+
reported.add(key);
|
|
368
|
+
const span = payloadSpan(input, payload);
|
|
369
|
+
results.push({
|
|
370
|
+
code: diagnostic.code,
|
|
371
|
+
index: span.start,
|
|
372
|
+
...span,
|
|
373
|
+
property,
|
|
374
|
+
message: diagnostic.message
|
|
375
|
+
});
|
|
376
|
+
}
|
|
377
|
+
function completeStyleValue(property, options) {
|
|
378
|
+
const candidates = options.candidates || createCandidatePropertyVocabulary(options.config);
|
|
379
|
+
const targetProperty = options.config.shorthands?.[property] || property;
|
|
380
|
+
if (!grammarProperties.has(targetProperty)) return [];
|
|
381
|
+
const byValue = /* @__PURE__ */ new Map();
|
|
382
|
+
for (const [value, contributions] of candidates) {
|
|
383
|
+
if ((0, import_candidateTarget.resolveCandidateTarget)(targetProperty, value, contributions).ok) {
|
|
384
|
+
byValue.set(value, "configured");
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
const standalone = import_registry.standaloneValueProps[targetProperty];
|
|
388
|
+
if (standalone) {
|
|
389
|
+
for (const value in standalone) {
|
|
390
|
+
if (!byValue.has(value)) byValue.set(value, "keyword");
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
if (targetProperty === "fontWeight") {
|
|
394
|
+
for (const value in import_registry.fontWeightNames) {
|
|
395
|
+
if (!byValue.has(value)) byValue.set(value, "keyword");
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
const completions = [];
|
|
399
|
+
for (const [value, kind] of byValue) {
|
|
400
|
+
if (diagnoseStyleValue(property, value, {
|
|
401
|
+
...options,
|
|
402
|
+
candidates
|
|
403
|
+
}).length === 0) {
|
|
404
|
+
completions.push({
|
|
405
|
+
value,
|
|
406
|
+
kind
|
|
407
|
+
});
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
completions.sort((a, b) => a.value < b.value ? -1 : a.value > b.value ? 1 : 0);
|
|
411
|
+
return completions;
|
|
412
|
+
}
|
|
413
|
+
function completeStyleValueAtCursor(property, input, cursor, options) {
|
|
414
|
+
if (cursor < 0 || cursor > input.length) return null;
|
|
415
|
+
const parsed = (0, import_valueParser.parseValueWithSourceSpans)(input, options.registry);
|
|
416
|
+
const active = parsed.spans.find((span) => cursor >= span.start && cursor <= span.end && span.kind === "modifier") ?? parsed.spans.find((span) => cursor >= span.start && cursor <= span.end && span.kind === "word" && span.start > 0 && parsed.result.ok && parsed.spans.some((segment) => (segment.kind === "base" || segment.kind === "payload") && segment.start < span.start && segment.end >= span.end)) ?? parsed.spans.find((span) => cursor >= span.start && cursor <= span.end && span.kind !== "modifier" && span.kind !== "word");
|
|
417
|
+
if (active?.kind === "modifier" || active?.kind === "word") {
|
|
418
|
+
if (!parsed.result.ok && parsed.result.errors.some((error) => error.code !== "unregistered-modifier" && error.code !== "empty-modifier" && error.code !== "empty-payload")) {
|
|
419
|
+
return null;
|
|
420
|
+
}
|
|
421
|
+
return {
|
|
422
|
+
replaceStart: active.start,
|
|
423
|
+
replaceLength: active.end - active.start,
|
|
424
|
+
completions: completeModifiers(options, input.charCodeAt(active.end) !== 58, active.kind === "modifier" ? modifierChainBefore(input, parsed.spans, active.start) : [])
|
|
425
|
+
};
|
|
426
|
+
}
|
|
427
|
+
if (active) {
|
|
428
|
+
if (!parsed.result.ok && parsed.result.errors.some((error) => error.code !== "empty-payload")) {
|
|
429
|
+
return null;
|
|
430
|
+
}
|
|
431
|
+
return {
|
|
432
|
+
replaceStart: active.start,
|
|
433
|
+
replaceLength: active.end - active.start,
|
|
434
|
+
completions: active.kind === "payload" && input.charCodeAt(active.start - 1) === 58 ? [...completeModifiers(options, true, modifierChainBefore(input, parsed.spans, active.start)), ...completeStyleValue(property, options)] : completeStyleValue(property, options)
|
|
435
|
+
};
|
|
436
|
+
}
|
|
437
|
+
if (parsed.result.ok && cursor === input.length) {
|
|
438
|
+
return {
|
|
439
|
+
replaceStart: cursor,
|
|
440
|
+
replaceLength: 0,
|
|
441
|
+
completions: completeModifiers(options, true, [])
|
|
442
|
+
};
|
|
443
|
+
}
|
|
444
|
+
return null;
|
|
445
|
+
}
|
|
446
|
+
function completeModifiers(options, appendColon, modifiers) {
|
|
447
|
+
const names = options.registry.next?.(modifiers);
|
|
448
|
+
if (!names) return [];
|
|
449
|
+
const completions = [];
|
|
450
|
+
for (const name of names) {
|
|
451
|
+
completions.push({
|
|
452
|
+
value: name,
|
|
453
|
+
kind: "modifier",
|
|
454
|
+
insertText: appendColon ? `${name}:` : name
|
|
455
|
+
});
|
|
456
|
+
}
|
|
457
|
+
completions.sort((a, b) => a.value < b.value ? -1 : a.value > b.value ? 1 : 0);
|
|
458
|
+
return completions;
|
|
459
|
+
}
|