@tamagui/react-native-web-internals 2.7.7 → 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/dist/cjs/StyleSheet/compiler/createReactDOMStyle.cjs +151 -136
- package/dist/cjs/StyleSheet/compiler/hash.cjs +15 -18
- package/dist/cjs/StyleSheet/compiler/hyphenateStyleName.cjs +21 -24
- package/dist/cjs/StyleSheet/compiler/index.cjs +295 -321
- package/dist/cjs/StyleSheet/compiler/normalizeColor.cjs +20 -23
- package/dist/cjs/StyleSheet/compiler/normalizeValueWithProperty.cjs +32 -35
- package/dist/cjs/StyleSheet/compiler/resolveShadowValue.cjs +27 -38
- package/dist/cjs/StyleSheet/dom/createCSSStyleSheet.cjs +37 -40
- package/dist/cjs/StyleSheet/dom/createOrderedCSSStyleSheet.cjs +108 -111
- package/dist/cjs/StyleSheet/dom/index.cjs +70 -72
- package/dist/cjs/StyleSheet/index.cjs +33 -34
- package/dist/cjs/StyleSheet/preprocess.cjs +74 -94
- package/dist/cjs/StyleSheet/validate.cjs +72 -75
- package/dist/cjs/TextAncestorContext.cjs +15 -18
- package/dist/cjs/colorProps.cjs +25 -28
- package/dist/cjs/index.cjs +49 -50
- package/dist/cjs/modules/AccessibilityUtil/index.cjs +18 -21
- package/dist/cjs/modules/AccessibilityUtil/isDisabled.cjs +15 -18
- package/dist/cjs/modules/AccessibilityUtil/propsToAccessibilityComponent.cjs +46 -49
- package/dist/cjs/modules/AccessibilityUtil/propsToAriaRole.cjs +34 -39
- package/dist/cjs/modules/AssetRegistry/index.cjs +18 -19
- package/dist/cjs/modules/ImageLoader/index.cjs +135 -141
- package/dist/cjs/modules/InteractionManager.cjs +212 -219
- package/dist/cjs/modules/Platform/index.cjs +18 -21
- package/dist/cjs/modules/TextInputState/index.cjs +55 -58
- package/dist/cjs/modules/UIManager/index.cjs +46 -51
- package/dist/cjs/modules/canUseDOM.cjs +15 -18
- package/dist/cjs/modules/createDOMProps/index.cjs +289 -358
- package/dist/cjs/modules/createEventHandle/index.cjs +57 -62
- package/dist/cjs/modules/dismissKeyboard/index.cjs +16 -19
- package/dist/cjs/modules/forwardedProps/index.cjs +128 -130
- package/dist/cjs/modules/getBoundingClientRect/index.cjs +22 -25
- package/dist/cjs/modules/invariant.cjs +26 -27
- package/dist/cjs/modules/isSelectionValid/index.cjs +22 -25
- package/dist/cjs/modules/isWebColor/index.cjs +15 -18
- package/dist/cjs/modules/mergeRefs/index.cjs +31 -34
- package/dist/cjs/modules/modality/index.cjs +131 -134
- package/dist/cjs/modules/multiplyStyleLengthValue/index.cjs +25 -28
- package/dist/cjs/modules/normalizeColor/index.cjs +28 -31
- package/dist/cjs/modules/pick/index.cjs +24 -27
- package/dist/cjs/modules/processColor/index.cjs +28 -36
- package/dist/cjs/modules/requestIdleCallback/index.cjs +28 -29
- package/dist/cjs/modules/setValueForStyles/dangerousStyleValue.cjs +39 -42
- package/dist/cjs/modules/setValueForStyles/index.cjs +31 -34
- package/dist/cjs/modules/unitlessNumbers/index.cjs +74 -75
- package/dist/cjs/modules/useElementLayout/index.cjs +24 -31
- package/dist/cjs/modules/useEvent/index.cjs +40 -43
- package/dist/cjs/modules/useHover/index.cjs +113 -118
- package/dist/cjs/modules/useLayoutEffect/index.cjs +18 -26
- package/dist/cjs/modules/useLocale/index.cjs +33 -43
- package/dist/cjs/modules/useLocale/isLocaleRTL.cjs +66 -76
- package/dist/cjs/modules/useMergeRefs/index.cjs +19 -29
- package/dist/cjs/modules/usePlatformMethods/index.cjs +24 -30
- package/dist/cjs/modules/useStable/index.cjs +24 -32
- package/dist/cjs/styleTypes.cjs +10 -11
- package/dist/cjs/types.cjs +10 -11
- package/dist/esm/StyleSheet/compiler/createReactDOMStyle.mjs +137 -119
- package/dist/esm/StyleSheet/compiler/createReactDOMStyle.mjs.map +1 -1
- package/dist/esm/StyleSheet/compiler/hash.mjs +2 -2
- package/dist/esm/StyleSheet/compiler/hyphenateStyleName.mjs +7 -6
- package/dist/esm/StyleSheet/compiler/hyphenateStyleName.mjs.map +1 -1
- package/dist/esm/StyleSheet/compiler/index.mjs +279 -302
- package/dist/esm/StyleSheet/compiler/index.mjs.map +1 -1
- package/dist/esm/StyleSheet/compiler/normalizeColor.mjs +7 -5
- package/dist/esm/StyleSheet/compiler/normalizeColor.mjs.map +1 -1
- package/dist/esm/StyleSheet/compiler/normalizeValueWithProperty.mjs +19 -17
- package/dist/esm/StyleSheet/compiler/normalizeValueWithProperty.mjs.map +1 -1
- package/dist/esm/StyleSheet/compiler/resolveShadowValue.mjs +14 -20
- package/dist/esm/StyleSheet/compiler/resolveShadowValue.mjs.map +1 -1
- package/dist/esm/StyleSheet/dom/createCSSStyleSheet.mjs +24 -22
- package/dist/esm/StyleSheet/dom/createCSSStyleSheet.mjs.map +1 -1
- package/dist/esm/StyleSheet/dom/createOrderedCSSStyleSheet.mjs +94 -93
- package/dist/esm/StyleSheet/dom/createOrderedCSSStyleSheet.mjs.map +1 -1
- package/dist/esm/StyleSheet/dom/index.mjs +57 -54
- package/dist/esm/StyleSheet/dom/index.mjs.map +1 -1
- package/dist/esm/StyleSheet/index.mjs +18 -17
- package/dist/esm/StyleSheet/index.mjs.map +1 -1
- package/dist/esm/StyleSheet/preprocess.mjs +58 -75
- package/dist/esm/StyleSheet/preprocess.mjs.map +1 -1
- package/dist/esm/StyleSheet/validate.mjs +58 -57
- package/dist/esm/StyleSheet/validate.mjs.map +1 -1
- package/dist/esm/TextAncestorContext.mjs +2 -0
- package/dist/esm/TextAncestorContext.mjs.map +1 -1
- package/dist/esm/colorProps.mjs +11 -10
- package/dist/esm/colorProps.mjs.map +1 -1
- package/dist/esm/index.js +22 -15
- package/dist/esm/index.mjs +22 -15
- package/dist/esm/modules/AccessibilityUtil/index.mjs +5 -3
- package/dist/esm/modules/AccessibilityUtil/index.mjs.map +1 -1
- package/dist/esm/modules/AccessibilityUtil/isDisabled.mjs +2 -1
- package/dist/esm/modules/AccessibilityUtil/isDisabled.mjs.map +1 -1
- package/dist/esm/modules/AccessibilityUtil/propsToAccessibilityComponent.mjs +33 -31
- package/dist/esm/modules/AccessibilityUtil/propsToAccessibilityComponent.mjs.map +1 -1
- package/dist/esm/modules/AccessibilityUtil/propsToAriaRole.mjs +20 -21
- package/dist/esm/modules/AccessibilityUtil/propsToAriaRole.mjs.map +1 -1
- package/dist/esm/modules/AssetRegistry/index.mjs +3 -2
- package/dist/esm/modules/AssetRegistry/index.mjs.map +1 -1
- package/dist/esm/modules/ImageLoader/index.mjs +120 -124
- package/dist/esm/modules/ImageLoader/index.mjs.map +1 -1
- package/dist/esm/modules/InteractionManager.mjs +199 -201
- package/dist/esm/modules/InteractionManager.mjs.map +1 -1
- package/dist/esm/modules/Platform/index.mjs +4 -3
- package/dist/esm/modules/Platform/index.mjs.map +1 -1
- package/dist/esm/modules/TextInputState/index.mjs +42 -40
- package/dist/esm/modules/TextInputState/index.mjs.map +1 -1
- package/dist/esm/modules/UIManager/index.mjs +33 -33
- package/dist/esm/modules/UIManager/index.mjs.map +1 -1
- package/dist/esm/modules/canUseDOM.mjs +1 -0
- package/dist/esm/modules/canUseDOM.mjs.map +1 -1
- package/dist/esm/modules/createDOMProps/index.mjs +275 -341
- package/dist/esm/modules/createDOMProps/index.mjs.map +1 -1
- package/dist/esm/modules/createEventHandle/index.mjs +44 -44
- package/dist/esm/modules/createEventHandle/index.mjs.map +1 -1
- package/dist/esm/modules/dismissKeyboard/index.mjs +3 -1
- package/dist/esm/modules/dismissKeyboard/index.mjs.map +1 -1
- package/dist/esm/modules/forwardedProps/index.mjs +104 -104
- package/dist/esm/modules/forwardedProps/index.mjs.map +1 -1
- package/dist/esm/modules/getBoundingClientRect/index.mjs +8 -7
- package/dist/esm/modules/getBoundingClientRect/index.mjs.map +1 -1
- package/dist/esm/modules/invariant.mjs +11 -10
- package/dist/esm/modules/invariant.mjs.map +1 -1
- package/dist/esm/modules/isSelectionValid/index.mjs +8 -7
- package/dist/esm/modules/isSelectionValid/index.mjs.map +1 -1
- package/dist/esm/modules/isWebColor/index.mjs +2 -1
- package/dist/esm/modules/isWebColor/index.mjs.map +1 -1
- package/dist/esm/modules/mergeRefs/index.mjs +17 -16
- package/dist/esm/modules/mergeRefs/index.mjs.map +1 -1
- package/dist/esm/modules/modality/index.mjs +115 -115
- package/dist/esm/modules/modality/index.mjs.map +1 -1
- package/dist/esm/modules/multiplyStyleLengthValue/index.mjs +11 -10
- package/dist/esm/modules/multiplyStyleLengthValue/index.mjs.map +1 -1
- package/dist/esm/modules/normalizeColor/index.mjs +15 -13
- package/dist/esm/modules/normalizeColor/index.mjs.map +1 -1
- package/dist/esm/modules/pick/index.mjs +10 -9
- package/dist/esm/modules/pick/index.mjs.map +1 -1
- package/dist/esm/modules/processColor/index.mjs +12 -10
- package/dist/esm/modules/processColor/index.mjs.map +1 -1
- package/dist/esm/modules/requestIdleCallback/index.mjs +14 -12
- package/dist/esm/modules/requestIdleCallback/index.mjs.map +1 -1
- package/dist/esm/modules/setValueForStyles/dangerousStyleValue.mjs +27 -25
- package/dist/esm/modules/setValueForStyles/dangerousStyleValue.mjs.map +1 -1
- package/dist/esm/modules/setValueForStyles/index.mjs +18 -16
- package/dist/esm/modules/setValueForStyles/index.mjs.map +1 -1
- package/dist/esm/modules/unitlessNumbers/index.mjs +60 -57
- package/dist/esm/modules/unitlessNumbers/index.mjs.map +1 -1
- package/dist/esm/modules/useElementLayout/index.mjs +12 -14
- package/dist/esm/modules/useElementLayout/index.mjs.map +1 -1
- package/dist/esm/modules/useEvent/index.mjs +28 -26
- package/dist/esm/modules/useEvent/index.mjs.map +1 -1
- package/dist/esm/modules/useHover/index.mjs +101 -101
- package/dist/esm/modules/useHover/index.mjs.map +1 -1
- package/dist/esm/modules/useLayoutEffect/index.mjs +2 -0
- package/dist/esm/modules/useLayoutEffect/index.mjs.map +1 -1
- package/dist/esm/modules/useLocale/index.mjs +15 -17
- package/dist/esm/modules/useLocale/index.mjs.map +1 -1
- package/dist/esm/modules/useLocale/isLocaleRTL.mjs +52 -58
- package/dist/esm/modules/useLocale/isLocaleRTL.mjs.map +1 -1
- package/dist/esm/modules/useMergeRefs/index.mjs +3 -3
- package/dist/esm/modules/useMergeRefs/index.mjs.map +1 -1
- package/dist/esm/modules/usePlatformMethods/index.mjs +11 -12
- package/dist/esm/modules/usePlatformMethods/index.mjs.map +1 -1
- package/dist/esm/modules/useStable/index.mjs +8 -6
- package/dist/esm/modules/useStable/index.mjs.map +1 -1
- package/dist/esm/styleTypes.mjs +0 -2
- package/dist/esm/types.mjs +0 -2
- package/package.json +8 -8
- package/src/modules/createDOMProps/index.tsx +3 -12
- package/src/modules/forwardedProps/index.tsx +0 -1
- package/src/modules/mergeRefs/index.tsx +1 -1
- package/types/StyleSheet/compiler/createReactDOMStyle.d.ts.map +1 -1
- package/types/StyleSheet/compiler/normalizeColor.d.ts.map +1 -1
- package/types/StyleSheet/compiler/resolveShadowValue.d.ts.map +1 -1
- package/types/StyleSheet/index.d.ts +15 -16
- package/types/StyleSheet/index.d.ts.map +1 -1
- package/types/StyleSheet/preprocess.d.ts +1 -1
- package/types/StyleSheet/preprocess.d.ts.map +1 -1
- package/types/colorProps.d.ts.map +1 -1
- package/types/modules/AccessibilityUtil/index.d.ts +6 -5
- package/types/modules/AccessibilityUtil/index.d.ts.map +1 -1
- package/types/modules/AccessibilityUtil/isDisabled.d.ts.map +1 -1
- package/types/modules/AccessibilityUtil/propsToAccessibilityComponent.d.ts.map +1 -1
- package/types/modules/AccessibilityUtil/propsToAriaRole.d.ts.map +1 -1
- package/types/modules/ImageLoader/index.d.ts +1 -1
- package/types/modules/ImageLoader/index.d.ts.map +1 -1
- package/types/modules/InteractionManager.d.ts +3 -3
- package/types/modules/InteractionManager.d.ts.map +1 -1
- package/types/modules/Platform/index.d.ts.map +1 -1
- package/types/modules/TextInputState/index.d.ts.map +1 -1
- package/types/modules/createDOMProps/index.d.ts.map +1 -1
- package/types/modules/forwardedProps/index.d.ts +70 -74
- package/types/modules/forwardedProps/index.d.ts.map +1 -1
- package/types/modules/getBoundingClientRect/index.d.ts.map +1 -1
- package/types/modules/isWebColor/index.d.ts.map +1 -1
- package/types/modules/multiplyStyleLengthValue/index.d.ts.map +1 -1
- package/types/modules/normalizeColor/index.d.ts.map +1 -1
- package/types/modules/processColor/index.d.ts.map +1 -1
- package/types/modules/requestIdleCallback/index.d.ts +3 -1
- package/types/modules/requestIdleCallback/index.d.ts.map +1 -1
- package/types/modules/unitlessNumbers/index.d.ts.map +1 -1
- package/types/modules/useLayoutEffect/index.d.ts +1 -1
- package/types/modules/useLayoutEffect/index.d.ts.map +1 -1
- package/dist/cjs/StyleSheet/__tests__/compiler-createReactDOMStyle-test.cjs +0 -265
- package/dist/cjs/StyleSheet/__tests__/compiler-test.cjs +0 -419
- package/dist/cjs/StyleSheet/__tests__/dom-createOrderedCSSStyleSheet-test.cjs +0 -160
- package/dist/cjs/StyleSheet/__tests__/index-test.cjs +0 -436
- package/dist/cjs/StyleSheet/__tests__/preprocess-test.cjs +0 -121
- package/dist/cjs/StyleSheet/__tests__/validate-test.cjs +0 -51
- package/dist/cjs/modules/AccessibilityUtil/__tests__/propsToAccessibilityComponent-test.cjs +0 -57
- package/dist/cjs/modules/AccessibilityUtil/__tests__/propsToAriaRole-test.cjs +0 -46
- package/dist/cjs/modules/Platform/__tests__/index-test.cjs +0 -56
- package/dist/cjs/modules/UIManager/__tests__/index-test.cjs +0 -111
- package/dist/cjs/modules/createDOMProps/__tests__/index-test.cjs +0 -177
- package/dist/cjs/modules/createEventHandle/__tests__/index-test.cjs +0 -422
- package/dist/cjs/modules/mergeRefs/__tests__/index-test.cjs +0 -48
- package/dist/cjs/modules/modality/__tests__/index-test.cjs +0 -59
- package/dist/cjs/modules/multiplyStyleLengthValue/__tests__/index-test.cjs +0 -38
- package/dist/cjs/modules/processColor/__tests__/index-test.cjs +0 -85
- package/dist/cjs/modules/useEvent/__tests__/index-test.cjs +0 -490
- package/dist/cjs/modules/useHover/__tests__/index-test.cjs +0 -382
- package/dist/cjs/modules/useMergeRefs/__tests__/index-test.cjs +0 -125
- package/dist/cjs/modules/useStable/__tests__/index-test.cjs +0 -122
- package/dist/esm/StyleSheet/__tests__/compiler-createReactDOMStyle-test.mjs +0 -242
- package/dist/esm/StyleSheet/__tests__/compiler-createReactDOMStyle-test.mjs.map +0 -1
- package/dist/esm/StyleSheet/__tests__/compiler-test.mjs +0 -420
- package/dist/esm/StyleSheet/__tests__/compiler-test.mjs.map +0 -1
- package/dist/esm/StyleSheet/__tests__/dom-createOrderedCSSStyleSheet-test.mjs +0 -137
- package/dist/esm/StyleSheet/__tests__/dom-createOrderedCSSStyleSheet-test.mjs.map +0 -1
- package/dist/esm/StyleSheet/__tests__/index-test.mjs +0 -413
- package/dist/esm/StyleSheet/__tests__/index-test.mjs.map +0 -1
- package/dist/esm/StyleSheet/__tests__/preprocess-test.mjs +0 -122
- package/dist/esm/StyleSheet/__tests__/preprocess-test.mjs.map +0 -1
- package/dist/esm/StyleSheet/__tests__/validate-test.mjs +0 -52
- package/dist/esm/StyleSheet/__tests__/validate-test.mjs.map +0 -1
- package/dist/esm/StyleSheet/compiler/hash.mjs.map +0 -1
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/index.mjs.map +0 -1
- package/dist/esm/modules/AccessibilityUtil/__tests__/propsToAccessibilityComponent-test.mjs +0 -34
- package/dist/esm/modules/AccessibilityUtil/__tests__/propsToAccessibilityComponent-test.mjs.map +0 -1
- package/dist/esm/modules/AccessibilityUtil/__tests__/propsToAriaRole-test.mjs +0 -23
- package/dist/esm/modules/AccessibilityUtil/__tests__/propsToAriaRole-test.mjs.map +0 -1
- package/dist/esm/modules/Platform/__tests__/index-test.mjs +0 -33
- package/dist/esm/modules/Platform/__tests__/index-test.mjs.map +0 -1
- package/dist/esm/modules/UIManager/__tests__/index-test.mjs +0 -88
- package/dist/esm/modules/UIManager/__tests__/index-test.mjs.map +0 -1
- package/dist/esm/modules/createDOMProps/__tests__/index-test.mjs +0 -154
- package/dist/esm/modules/createDOMProps/__tests__/index-test.mjs.map +0 -1
- package/dist/esm/modules/createEventHandle/__tests__/index-test.mjs +0 -399
- package/dist/esm/modules/createEventHandle/__tests__/index-test.mjs.map +0 -1
- package/dist/esm/modules/mergeRefs/__tests__/index-test.mjs +0 -25
- package/dist/esm/modules/mergeRefs/__tests__/index-test.mjs.map +0 -1
- package/dist/esm/modules/modality/__tests__/index-test.mjs +0 -60
- package/dist/esm/modules/modality/__tests__/index-test.mjs.map +0 -1
- package/dist/esm/modules/multiplyStyleLengthValue/__tests__/index-test.mjs +0 -15
- package/dist/esm/modules/multiplyStyleLengthValue/__tests__/index-test.mjs.map +0 -1
- package/dist/esm/modules/processColor/__tests__/index-test.mjs +0 -62
- package/dist/esm/modules/processColor/__tests__/index-test.mjs.map +0 -1
- package/dist/esm/modules/useEvent/__tests__/index-test.mjs +0 -467
- package/dist/esm/modules/useEvent/__tests__/index-test.mjs.map +0 -1
- package/dist/esm/modules/useHover/__tests__/index-test.mjs +0 -359
- package/dist/esm/modules/useHover/__tests__/index-test.mjs.map +0 -1
- package/dist/esm/modules/useMergeRefs/__tests__/index-test.mjs +0 -102
- package/dist/esm/modules/useMergeRefs/__tests__/index-test.mjs.map +0 -1
- package/dist/esm/modules/useStable/__tests__/index-test.mjs +0 -99
- package/dist/esm/modules/useStable/__tests__/index-test.mjs.map +0 -1
- package/dist/esm/styleTypes.mjs.map +0 -1
- package/dist/esm/types.mjs.map +0 -1
- package/src/StyleSheet/__tests__/compiler-createReactDOMStyle-test.tsx +0 -236
- package/src/StyleSheet/__tests__/compiler-test.tsx +0 -426
- package/src/StyleSheet/__tests__/dom-createOrderedCSSStyleSheet-test.tsx +0 -169
- package/src/StyleSheet/__tests__/index-test.tsx +0 -406
- package/src/StyleSheet/__tests__/preprocess-test.tsx +0 -107
- package/src/StyleSheet/__tests__/validate-test.tsx +0 -42
- package/src/modules/AccessibilityUtil/__tests__/propsToAccessibilityComponent-test.tsx +0 -44
- package/src/modules/AccessibilityUtil/__tests__/propsToAriaRole-test.tsx +0 -25
- package/src/modules/Platform/__tests__/index-test.tsx +0 -45
- package/src/modules/UIManager/__tests__/index-test.tsx +0 -87
- package/src/modules/createDOMProps/__tests__/index-test.tsx +0 -138
- package/src/modules/createEventHandle/__tests__/index-test.tsx +0 -459
- package/src/modules/mergeRefs/__tests__/index-test.tsx +0 -32
- package/src/modules/modality/__tests__/index-test.tsx +0 -66
- package/src/modules/multiplyStyleLengthValue/__tests__/index-test.tsx +0 -23
- package/src/modules/processColor/__tests__/index-test.tsx +0 -78
- package/src/modules/useEvent/__tests__/index-test.tsx +0 -511
- package/src/modules/useHover/__tests__/index-test.tsx +0 -342
- package/src/modules/useMergeRefs/__tests__/index-test.tsx +0 -91
- package/src/modules/useStable/__tests__/index-test.tsx +0 -101
|
@@ -1,64 +1,67 @@
|
|
|
1
1
|
import { canUseDOM } from "../../modules/canUseDOM.mjs";
|
|
2
2
|
import { createCSSStyleSheet } from "./createCSSStyleSheet.mjs";
|
|
3
3
|
import { createOrderedCSSStyleSheet } from "./createOrderedCSSStyleSheet.mjs";
|
|
4
|
+
|
|
4
5
|
const defaultId = "react-native-stylesheet";
|
|
5
|
-
const roots = /* @__PURE__ */new WeakMap();
|
|
6
|
+
const roots = /* @__PURE__ */ new WeakMap();
|
|
6
7
|
const sheets = [];
|
|
7
8
|
const initialRules = [
|
|
8
|
-
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
"
|
|
9
|
+
"html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);}",
|
|
10
|
+
"body{margin:0;}",
|
|
11
|
+
"button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0;}",
|
|
12
|
+
"input::-webkit-search-cancel-button,input::-webkit-search-decoration,input::-webkit-search-results-button,input::-webkit-search-results-decoration{display:none;}"
|
|
13
|
+
];
|
|
12
14
|
function createSheet(root, id = defaultId) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
15
|
+
let sheet;
|
|
16
|
+
function createSheet2() {
|
|
17
|
+
if (sheet) return;
|
|
18
|
+
if (canUseDOM) {
|
|
19
|
+
const rootNode = root != null ? root.getRootNode() : document;
|
|
20
|
+
if (sheets.length === 0) {
|
|
21
|
+
sheet = createOrderedCSSStyleSheet(createCSSStyleSheet(id));
|
|
22
|
+
initialRules.forEach((rule) => {
|
|
23
|
+
sheet.insert(rule, 0);
|
|
24
|
+
});
|
|
25
|
+
roots.set(rootNode, sheets.length);
|
|
26
|
+
sheets.push(sheet);
|
|
27
|
+
} else {
|
|
28
|
+
const index = roots.get(rootNode);
|
|
29
|
+
if (index == null) {
|
|
30
|
+
const initialSheet = sheets[0];
|
|
31
|
+
const textContent = initialSheet != null ? initialSheet.getTextContent() : "";
|
|
32
|
+
sheet = createOrderedCSSStyleSheet(createCSSStyleSheet(id, rootNode, textContent));
|
|
33
|
+
roots.set(rootNode, sheets.length);
|
|
34
|
+
sheets.push(sheet);
|
|
35
|
+
} else {
|
|
36
|
+
sheet = sheets[index];
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
} else {
|
|
40
|
+
if (sheets.length === 0) {
|
|
41
|
+
sheet = createOrderedCSSStyleSheet(createCSSStyleSheet(id));
|
|
42
|
+
initialRules.forEach((rule) => {
|
|
43
|
+
sheet.insert(rule, 0);
|
|
44
|
+
});
|
|
45
|
+
sheets.push(sheet);
|
|
46
|
+
} else {
|
|
47
|
+
sheet = sheets[0];
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return {
|
|
52
|
+
getTextContent() {
|
|
53
|
+
createSheet2();
|
|
54
|
+
return sheet.getTextContent();
|
|
55
|
+
},
|
|
56
|
+
id,
|
|
57
|
+
insert(cssText, groupValue) {
|
|
58
|
+
createSheet2();
|
|
59
|
+
sheets.forEach((s) => {
|
|
60
|
+
s.insert(cssText, groupValue);
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
};
|
|
62
64
|
}
|
|
65
|
+
|
|
63
66
|
export { createSheet };
|
|
64
67
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["esm/StyleSheet/dom/index.js"],"sourcesContent":["import { canUseDOM } from \"../../modules/canUseDOM\";\nimport { createCSSStyleSheet } from \"./createCSSStyleSheet\";\nimport { createOrderedCSSStyleSheet } from \"./createOrderedCSSStyleSheet\";\nconst defaultId = \"react-native-stylesheet\";\nconst roots = /* @__PURE__ */ new WeakMap();\nconst sheets = [];\nconst initialRules = [\n // minimal top-level reset\n \"html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);}\",\n \"body{margin:0;}\",\n // minimal form pseudo-element reset\n \"button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0;}\",\n \"input::-webkit-search-cancel-button,input::-webkit-search-decoration,input::-webkit-search-results-button,input::-webkit-search-results-decoration{display:none;}\"\n];\nfunction createSheet(root, id = defaultId) {\n let sheet;\n function createSheet2() {\n if (sheet) return;\n if (canUseDOM) {\n const rootNode = root != null ? root.getRootNode() : document;\n if (sheets.length === 0) {\n sheet = createOrderedCSSStyleSheet(createCSSStyleSheet(id));\n initialRules.forEach((rule) => {\n sheet.insert(rule, 0);\n });\n roots.set(rootNode, sheets.length);\n sheets.push(sheet);\n } else {\n const index = roots.get(rootNode);\n if (index == null) {\n const initialSheet = sheets[0];\n const textContent = initialSheet != null ? initialSheet.getTextContent() : \"\";\n sheet = createOrderedCSSStyleSheet(\n createCSSStyleSheet(id, rootNode, textContent)\n );\n roots.set(rootNode, sheets.length);\n sheets.push(sheet);\n } else {\n sheet = sheets[index];\n }\n }\n } else {\n if (sheets.length === 0) {\n sheet = createOrderedCSSStyleSheet(createCSSStyleSheet(id));\n initialRules.forEach((rule) => {\n sheet.insert(rule, 0);\n });\n sheets.push(sheet);\n } else {\n sheet = sheets[0];\n }\n }\n }\n return {\n getTextContent() {\n createSheet2();\n return sheet.getTextContent();\n },\n id,\n insert(cssText, groupValue) {\n createSheet2();\n sheets.forEach((s) => {\n s.insert(cssText, groupValue);\n });\n }\n };\n}\nexport {\n createSheet\n};\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;;;AAGA,MAAM,YAAY;AAClB,MAAM,wBAAwB,IAAI,QAAQ;AAC1C,MAAM,SAAS,CAAC;AAChB,MAAM,eAAe;CAEnB;CACA;CAEA;CACA;AACF;AACA,SAAS,YAAY,MAAM,KAAK,WAAW;CACzC,IAAI;CACJ,SAAS,eAAe;EACtB,IAAI,OAAO;EACX,IAAI,WAAW;GACb,MAAM,WAAW,QAAQ,OAAO,KAAK,YAAY,IAAI;GACrD,IAAI,OAAO,WAAW,GAAG;IACvB,QAAQ,2BAA2B,oBAAoB,EAAE,CAAC;IAC1D,aAAa,SAAS,SAAS;KAC7B,MAAM,OAAO,MAAM,CAAC;IACtB,CAAC;IACD,MAAM,IAAI,UAAU,OAAO,MAAM;IACjC,OAAO,KAAK,KAAK;GACnB,OAAO;IACL,MAAM,QAAQ,MAAM,IAAI,QAAQ;IAChC,IAAI,SAAS,MAAM;KACjB,MAAM,eAAe,OAAO;KAC5B,MAAM,cAAc,gBAAgB,OAAO,aAAa,eAAe,IAAI;KAC3E,QAAQ,2BACN,oBAAoB,IAAI,UAAU,WAAW,CAC/C;KACA,MAAM,IAAI,UAAU,OAAO,MAAM;KACjC,OAAO,KAAK,KAAK;IACnB,OAAO;KACL,QAAQ,OAAO;IACjB;GACF;EACF,OAAO;GACL,IAAI,OAAO,WAAW,GAAG;IACvB,QAAQ,2BAA2B,oBAAoB,EAAE,CAAC;IAC1D,aAAa,SAAS,SAAS;KAC7B,MAAM,OAAO,MAAM,CAAC;IACtB,CAAC;IACD,OAAO,KAAK,KAAK;GACnB,OAAO;IACL,QAAQ,OAAO;GACjB;EACF;CACF;CACA,OAAO;EACL,iBAAiB;GACf,aAAa;GACb,OAAO,MAAM,eAAe;EAC9B;EACA;EACA,OAAO,SAAS,YAAY;GAC1B,aAAa;GACb,OAAO,SAAS,MAAM;IACpB,EAAE,OAAO,SAAS,UAAU;GAC9B,CAAC;EACH;CACF;AACF"}
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
const absoluteFillObject = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
position: "absolute",
|
|
3
|
+
left: 0,
|
|
4
|
+
right: 0,
|
|
5
|
+
top: 0,
|
|
6
|
+
bottom: 0
|
|
7
7
|
};
|
|
8
8
|
const absoluteFill = absoluteFillObject;
|
|
9
9
|
function create(styles) {
|
|
10
|
-
|
|
10
|
+
return styles;
|
|
11
11
|
}
|
|
12
12
|
function compose(style1, style2) {
|
|
13
|
-
|
|
13
|
+
return flatten(style1, style2);
|
|
14
14
|
}
|
|
15
15
|
function flatten(...styles) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
return styles.flat().flat().flat().flat().reduce((acc, cur) => {
|
|
17
|
+
if (cur) {
|
|
18
|
+
Object.assign(acc, cur);
|
|
19
|
+
}
|
|
20
|
+
return acc;
|
|
21
|
+
}, {});
|
|
22
22
|
}
|
|
23
23
|
function getSheet() {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
return {
|
|
25
|
+
id: "",
|
|
26
|
+
textContent: sheet.getTextContent()
|
|
27
|
+
};
|
|
28
28
|
}
|
|
29
29
|
function StyleSheet(styles, options) {}
|
|
30
30
|
StyleSheet.absoluteFill = absoluteFill;
|
|
@@ -34,5 +34,6 @@ StyleSheet.compose = compose;
|
|
|
34
34
|
StyleSheet.flatten = flatten;
|
|
35
35
|
StyleSheet.getSheet = getSheet;
|
|
36
36
|
StyleSheet.hairlineWidth = 1;
|
|
37
|
+
|
|
37
38
|
export { StyleSheet, flatten };
|
|
38
39
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["esm/StyleSheet/index.js"],"sourcesContent":["const absoluteFillObject = {\n position: \"absolute\",\n left: 0,\n right: 0,\n top: 0,\n bottom: 0\n};\nconst absoluteFill = absoluteFillObject;\nfunction create(styles) {\n return styles;\n}\nfunction compose(style1, style2) {\n return flatten(style1, style2);\n}\nfunction flatten(...styles) {\n return styles.flat().flat().flat().flat().reduce((acc, cur) => {\n if (cur) {\n Object.assign(acc, cur);\n }\n return acc;\n }, {});\n}\nfunction getSheet() {\n return {\n id: \"\",\n textContent: sheet.getTextContent()\n };\n}\nfunction StyleSheet(styles, options) {\n}\nStyleSheet.absoluteFill = absoluteFill;\nStyleSheet.absoluteFillObject = absoluteFillObject;\nStyleSheet.create = create;\nStyleSheet.compose = compose;\nStyleSheet.flatten = flatten;\nStyleSheet.getSheet = getSheet;\nStyleSheet.hairlineWidth = 1;\nexport {\n StyleSheet,\n flatten\n};\n//# sourceMappingURL=index.js.map\n"],"mappings":";AAAA,MAAM,qBAAqB;CACzB,UAAU;CACV,MAAM;CACN,OAAO;CACP,KAAK;CACL,QAAQ;AACV;AACA,MAAM,eAAe;AACrB,SAAS,OAAO,QAAQ;CACtB,OAAO;AACT;AACA,SAAS,QAAQ,QAAQ,QAAQ;CAC/B,OAAO,QAAQ,QAAQ,MAAM;AAC/B;AACA,SAAS,QAAQ,GAAG,QAAQ;CAC1B,OAAO,OAAO,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,KAAK,QAAQ;EAC7D,IAAI,KAAK;GACP,OAAO,OAAO,KAAK,GAAG;EACxB;EACA,OAAO;CACT,GAAG,CAAC,CAAC;AACP;AACA,SAAS,WAAW;CAClB,OAAO;EACL,IAAI;EACJ,aAAa,MAAM,eAAe;CACpC;AACF;AACA,SAAS,WAAW,QAAQ,SAAS,CACrC;AACA,WAAW,eAAe;AAC1B,WAAW,qBAAqB;AAChC,WAAW,SAAS;AACpB,WAAW,UAAU;AACrB,WAAW,UAAU;AACrB,WAAW,WAAW;AACtB,WAAW,gBAAgB"}
|
|
@@ -1,86 +1,69 @@
|
|
|
1
1
|
import { normalizeColor } from "./compiler/normalizeColor.mjs";
|
|
2
2
|
import { normalizeValueWithProperty } from "./compiler/normalizeValueWithProperty.mjs";
|
|
3
|
+
|
|
3
4
|
const emptyObject = {};
|
|
4
5
|
const defaultOffset = {
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
height: 0,
|
|
7
|
+
width: 0
|
|
7
8
|
};
|
|
8
|
-
const createBoxShadowValue = style => {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
} = shadowOffset || defaultOffset;
|
|
19
|
-
const offsetX = normalizeValueWithProperty(width);
|
|
20
|
-
const offsetY = normalizeValueWithProperty(height);
|
|
21
|
-
const blurRadius = normalizeValueWithProperty(shadowRadius || 0);
|
|
22
|
-
const color = normalizeColor(shadowColor || "black", shadowOpacity);
|
|
23
|
-
if (color != null && offsetX != null && offsetY != null && blurRadius != null) {
|
|
24
|
-
return `${offsetX} ${offsetY} ${blurRadius} ${color}`;
|
|
25
|
-
}
|
|
9
|
+
const createBoxShadowValue = (style) => {
|
|
10
|
+
const { shadowColor, shadowOffset, shadowOpacity, shadowRadius } = style;
|
|
11
|
+
const { height, width } = shadowOffset || defaultOffset;
|
|
12
|
+
const offsetX = normalizeValueWithProperty(width);
|
|
13
|
+
const offsetY = normalizeValueWithProperty(height);
|
|
14
|
+
const blurRadius = normalizeValueWithProperty(shadowRadius || 0);
|
|
15
|
+
const color = normalizeColor(shadowColor || "black", shadowOpacity);
|
|
16
|
+
if (color != null && offsetX != null && offsetY != null && blurRadius != null) {
|
|
17
|
+
return `${offsetX} ${offsetY} ${blurRadius} ${color}`;
|
|
18
|
+
}
|
|
26
19
|
};
|
|
27
|
-
const createTextShadowValue = style => {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const offsetX = normalizeValueWithProperty(width);
|
|
39
|
-
const offsetY = normalizeValueWithProperty(height);
|
|
40
|
-
const blurRadius = normalizeValueWithProperty(radius);
|
|
41
|
-
const color = normalizeValueWithProperty(textShadowColor, "textShadowColor");
|
|
42
|
-
if (color && (height !== 0 || width !== 0 || radius !== 0) && offsetX != null && offsetY != null && blurRadius != null) {
|
|
43
|
-
return `${offsetX} ${offsetY} ${blurRadius} ${color}`;
|
|
44
|
-
}
|
|
20
|
+
const createTextShadowValue = (style) => {
|
|
21
|
+
const { textShadowColor, textShadowOffset, textShadowRadius } = style;
|
|
22
|
+
const { height, width } = textShadowOffset || defaultOffset;
|
|
23
|
+
const radius = textShadowRadius || 0;
|
|
24
|
+
const offsetX = normalizeValueWithProperty(width);
|
|
25
|
+
const offsetY = normalizeValueWithProperty(height);
|
|
26
|
+
const blurRadius = normalizeValueWithProperty(radius);
|
|
27
|
+
const color = normalizeValueWithProperty(textShadowColor, "textShadowColor");
|
|
28
|
+
if (color && (height !== 0 || width !== 0 || radius !== 0) && offsetX != null && offsetY != null && blurRadius != null) {
|
|
29
|
+
return `${offsetX} ${offsetY} ${blurRadius} ${color}`;
|
|
30
|
+
}
|
|
45
31
|
};
|
|
46
|
-
const preprocess = originalStyle => {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
nextStyle[prop] = value;
|
|
81
|
-
}
|
|
82
|
-
return nextStyle;
|
|
32
|
+
const preprocess = (originalStyle) => {
|
|
33
|
+
const style = originalStyle || emptyObject;
|
|
34
|
+
const nextStyle = {};
|
|
35
|
+
for (const originalProp in style) {
|
|
36
|
+
const originalValue = style[originalProp];
|
|
37
|
+
let prop = originalProp;
|
|
38
|
+
let value = originalValue;
|
|
39
|
+
if (!Object.prototype.hasOwnProperty.call(style, originalProp) || originalValue == null) {
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
if (prop === "shadowColor" || prop === "shadowOffset" || prop === "shadowOpacity" || prop === "shadowRadius") {
|
|
43
|
+
const boxShadowValue = createBoxShadowValue(style);
|
|
44
|
+
if (boxShadowValue != null && nextStyle.boxShadow == null) {
|
|
45
|
+
const { boxShadow } = style;
|
|
46
|
+
prop = "boxShadow";
|
|
47
|
+
value = boxShadow ? `${boxShadow}, ${boxShadowValue}` : boxShadowValue;
|
|
48
|
+
} else {
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
if (prop === "textShadowColor" || prop === "textShadowOffset" || prop === "textShadowRadius") {
|
|
53
|
+
const textShadowValue = createTextShadowValue(style);
|
|
54
|
+
if (textShadowValue != null && nextStyle.textShadow == null) {
|
|
55
|
+
const { textShadow } = style;
|
|
56
|
+
prop = "textShadow";
|
|
57
|
+
value = textShadow ? `${textShadow}, ${textShadowValue}` : textShadowValue;
|
|
58
|
+
} else {
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
nextStyle[prop] = value;
|
|
63
|
+
}
|
|
64
|
+
return nextStyle;
|
|
83
65
|
};
|
|
84
66
|
const processStyle = preprocess;
|
|
67
|
+
|
|
85
68
|
export { createBoxShadowValue, createTextShadowValue, preprocess, processStyle };
|
|
86
69
|
//# sourceMappingURL=preprocess.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"preprocess.js","names":[],"sources":["esm/StyleSheet/preprocess.js"],"sourcesContent":["import { normalizeColor } from \"./compiler/normalizeColor\";\nimport { normalizeValueWithProperty } from \"./compiler/normalizeValueWithProperty\";\nconst emptyObject = {};\nconst defaultOffset = { height: 0, width: 0 };\nconst createBoxShadowValue = (style) => {\n const { shadowColor, shadowOffset, shadowOpacity, shadowRadius } = style;\n const { height, width } = shadowOffset || defaultOffset;\n const offsetX = normalizeValueWithProperty(width);\n const offsetY = normalizeValueWithProperty(height);\n const blurRadius = normalizeValueWithProperty(shadowRadius || 0);\n const color = normalizeColor(shadowColor || \"black\", shadowOpacity);\n if (color != null && offsetX != null && offsetY != null && blurRadius != null) {\n return `${offsetX} ${offsetY} ${blurRadius} ${color}`;\n }\n};\nconst createTextShadowValue = (style) => {\n const { textShadowColor, textShadowOffset, textShadowRadius } = style;\n const { height, width } = textShadowOffset || defaultOffset;\n const radius = textShadowRadius || 0;\n const offsetX = normalizeValueWithProperty(width);\n const offsetY = normalizeValueWithProperty(height);\n const blurRadius = normalizeValueWithProperty(radius);\n const color = normalizeValueWithProperty(textShadowColor, \"textShadowColor\");\n if (color && (height !== 0 || width !== 0 || radius !== 0) && offsetX != null && offsetY != null && blurRadius != null) {\n return `${offsetX} ${offsetY} ${blurRadius} ${color}`;\n }\n};\nconst preprocess = (originalStyle) => {\n const style = originalStyle || emptyObject;\n const nextStyle = {};\n for (const originalProp in style) {\n const originalValue = style[originalProp];\n let prop = originalProp;\n let value = originalValue;\n if (!Object.prototype.hasOwnProperty.call(style, originalProp) || originalValue == null) {\n continue;\n }\n if (prop === \"shadowColor\" || prop === \"shadowOffset\" || prop === \"shadowOpacity\" || prop === \"shadowRadius\") {\n const boxShadowValue = createBoxShadowValue(style);\n if (boxShadowValue != null && nextStyle.boxShadow == null) {\n const { boxShadow } = style;\n prop = \"boxShadow\";\n value = boxShadow ? `${boxShadow}, ${boxShadowValue}` : boxShadowValue;\n } else {\n continue;\n }\n }\n if (prop === \"textShadowColor\" || prop === \"textShadowOffset\" || prop === \"textShadowRadius\") {\n const textShadowValue = createTextShadowValue(style);\n if (textShadowValue != null && nextStyle.textShadow == null) {\n const { textShadow } = style;\n prop = \"textShadow\";\n value = textShadow ? `${textShadow}, ${textShadowValue}` : textShadowValue;\n } else {\n continue;\n }\n }\n nextStyle[prop] = value;\n }\n return nextStyle;\n};\nconst processStyle = preprocess;\nexport {\n createBoxShadowValue,\n createTextShadowValue,\n preprocess,\n processStyle\n};\n//# sourceMappingURL=preprocess.js.map\n"],"mappings":";;;;AAEA,MAAM,cAAc,CAAC;AACrB,MAAM,gBAAgB;CAAE,QAAQ;CAAG,OAAO;AAAE;AAC5C,MAAM,wBAAwB,UAAU;CACtC,MAAM,EAAE,aAAa,cAAc,eAAe,iBAAiB;CACnE,MAAM,EAAE,QAAQ,UAAU,gBAAgB;CAC1C,MAAM,UAAU,2BAA2B,KAAK;CAChD,MAAM,UAAU,2BAA2B,MAAM;CACjD,MAAM,aAAa,2BAA2B,gBAAgB,CAAC;CAC/D,MAAM,QAAQ,eAAe,eAAe,SAAS,aAAa;CAClE,IAAI,SAAS,QAAQ,WAAW,QAAQ,WAAW,QAAQ,cAAc,MAAM;EAC7E,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,WAAW,GAAG;CAChD;AACF;AACA,MAAM,yBAAyB,UAAU;CACvC,MAAM,EAAE,iBAAiB,kBAAkB,qBAAqB;CAChE,MAAM,EAAE,QAAQ,UAAU,oBAAoB;CAC9C,MAAM,SAAS,oBAAoB;CACnC,MAAM,UAAU,2BAA2B,KAAK;CAChD,MAAM,UAAU,2BAA2B,MAAM;CACjD,MAAM,aAAa,2BAA2B,MAAM;CACpD,MAAM,QAAQ,2BAA2B,iBAAiB,iBAAiB;CAC3E,IAAI,UAAU,WAAW,KAAK,UAAU,KAAK,WAAW,MAAM,WAAW,QAAQ,WAAW,QAAQ,cAAc,MAAM;EACtH,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,WAAW,GAAG;CAChD;AACF;AACA,MAAM,cAAc,kBAAkB;CACpC,MAAM,QAAQ,iBAAiB;CAC/B,MAAM,YAAY,CAAC;CACnB,KAAK,MAAM,gBAAgB,OAAO;EAChC,MAAM,gBAAgB,MAAM;EAC5B,IAAI,OAAO;EACX,IAAI,QAAQ;EACZ,IAAI,CAAC,OAAO,UAAU,eAAe,KAAK,OAAO,YAAY,KAAK,iBAAiB,MAAM;GACvF;EACF;EACA,IAAI,SAAS,iBAAiB,SAAS,kBAAkB,SAAS,mBAAmB,SAAS,gBAAgB;GAC5G,MAAM,iBAAiB,qBAAqB,KAAK;GACjD,IAAI,kBAAkB,QAAQ,UAAU,aAAa,MAAM;IACzD,MAAM,EAAE,cAAc;IACtB,OAAO;IACP,QAAQ,YAAY,GAAG,UAAU,IAAI,mBAAmB;GAC1D,OAAO;IACL;GACF;EACF;EACA,IAAI,SAAS,qBAAqB,SAAS,sBAAsB,SAAS,oBAAoB;GAC5F,MAAM,kBAAkB,sBAAsB,KAAK;GACnD,IAAI,mBAAmB,QAAQ,UAAU,cAAc,MAAM;IAC3D,MAAM,EAAE,eAAe;IACvB,OAAO;IACP,QAAQ,aAAa,GAAG,WAAW,IAAI,oBAAoB;GAC7D,OAAO;IACL;GACF;EACF;EACA,UAAU,QAAQ;CACpB;CACA,OAAO;AACT;AACA,MAAM,eAAe"}
|
|
@@ -1,67 +1,68 @@
|
|
|
1
1
|
const invalidShortforms = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
background: true,
|
|
3
|
+
borderBottom: true,
|
|
4
|
+
borderLeft: true,
|
|
5
|
+
borderRight: true,
|
|
6
|
+
borderTop: true,
|
|
7
|
+
font: true,
|
|
8
|
+
grid: true,
|
|
9
|
+
outline: true,
|
|
10
|
+
textDecoration: true
|
|
11
11
|
};
|
|
12
12
|
const invalidMultiValueShortforms = {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
13
|
+
flex: true,
|
|
14
|
+
margin: true,
|
|
15
|
+
padding: true,
|
|
16
|
+
borderColor: true,
|
|
17
|
+
borderRadius: true,
|
|
18
|
+
borderStyle: true,
|
|
19
|
+
borderWidth: true,
|
|
20
|
+
marginHorizontal: true,
|
|
21
|
+
marginVertical: true,
|
|
22
|
+
paddingHorizontal: true,
|
|
23
|
+
paddingVertical: true,
|
|
24
|
+
overflow: true,
|
|
25
|
+
overscrollBehavior: true,
|
|
26
|
+
backgroundPosition: true
|
|
27
27
|
};
|
|
28
28
|
function error(message) {
|
|
29
|
-
|
|
29
|
+
console.error(message);
|
|
30
30
|
}
|
|
31
31
|
function validate(obj) {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
32
|
+
for (const k in obj) {
|
|
33
|
+
const prop = k.trim();
|
|
34
|
+
const value = obj[prop];
|
|
35
|
+
let isInvalid = false;
|
|
36
|
+
if (value === null) {
|
|
37
|
+
continue;
|
|
38
|
+
}
|
|
39
|
+
if (typeof value === "string" && value.indexOf("!important") > -1) {
|
|
40
|
+
error(`Invalid style declaration "${prop}:${value}". Values cannot include "!important"`);
|
|
41
|
+
isInvalid = true;
|
|
42
|
+
} else {
|
|
43
|
+
let suggestion = "";
|
|
44
|
+
if (prop === "animation" || prop === "animationName") {
|
|
45
|
+
suggestion = "Did you mean \"animationKeyframes\"?";
|
|
46
|
+
isInvalid = true;
|
|
47
|
+
} else if (prop === "direction") {
|
|
48
|
+
suggestion = "Did you mean \"writingDirection\"?";
|
|
49
|
+
isInvalid = true;
|
|
50
|
+
} else if (prop === "verticalAlign") {
|
|
51
|
+
suggestion = "Did you mean \"textAlignVertical\"?";
|
|
52
|
+
isInvalid = true;
|
|
53
|
+
} else if (invalidShortforms[prop]) {
|
|
54
|
+
suggestion = "Please use long-form properties.";
|
|
55
|
+
isInvalid = true;
|
|
56
|
+
} else if (invalidMultiValueShortforms[prop]) {}
|
|
57
|
+
if (suggestion !== "") {
|
|
58
|
+
error(`Invalid style property of "${prop}". ${suggestion}`);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
if (isInvalid) {
|
|
62
|
+
delete obj[k];
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
65
|
}
|
|
66
|
+
|
|
66
67
|
export { validate };
|
|
67
68
|
//# sourceMappingURL=validate.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"validate.js","names":[],"sources":["esm/StyleSheet/validate.js"],"sourcesContent":["const invalidShortforms = {\n background: true,\n borderBottom: true,\n borderLeft: true,\n borderRight: true,\n borderTop: true,\n font: true,\n grid: true,\n outline: true,\n textDecoration: true\n};\nconst invalidMultiValueShortforms = {\n flex: true,\n margin: true,\n padding: true,\n borderColor: true,\n borderRadius: true,\n borderStyle: true,\n borderWidth: true,\n marginHorizontal: true,\n marginVertical: true,\n paddingHorizontal: true,\n paddingVertical: true,\n overflow: true,\n overscrollBehavior: true,\n backgroundPosition: true\n};\nfunction error(message) {\n console.error(message);\n}\nfunction validate(obj) {\n for (const k in obj) {\n const prop = k.trim();\n const value = obj[prop];\n let isInvalid = false;\n if (value === null) {\n continue;\n }\n if (typeof value === \"string\" && value.indexOf(\"!important\") > -1) {\n error(\n `Invalid style declaration \"${prop}:${value}\". Values cannot include \"!important\"`\n );\n isInvalid = true;\n } else {\n let suggestion = \"\";\n if (prop === \"animation\" || prop === \"animationName\") {\n suggestion = 'Did you mean \"animationKeyframes\"?';\n isInvalid = true;\n } else if (prop === \"direction\") {\n suggestion = 'Did you mean \"writingDirection\"?';\n isInvalid = true;\n } else if (prop === \"verticalAlign\") {\n suggestion = 'Did you mean \"textAlignVertical\"?';\n isInvalid = true;\n } else if (invalidShortforms[prop]) {\n suggestion = \"Please use long-form properties.\";\n isInvalid = true;\n } else if (invalidMultiValueShortforms[prop]) {\n }\n if (suggestion !== \"\") {\n error(`Invalid style property of \"${prop}\". ${suggestion}`);\n }\n }\n if (isInvalid) {\n delete obj[k];\n }\n }\n}\nexport {\n validate\n};\n//# sourceMappingURL=validate.js.map\n"],"mappings":";AAAA,MAAM,oBAAoB;CACxB,YAAY;CACZ,cAAc;CACd,YAAY;CACZ,aAAa;CACb,WAAW;CACX,MAAM;CACN,MAAM;CACN,SAAS;CACT,gBAAgB;AAClB;AACA,MAAM,8BAA8B;CAClC,MAAM;CACN,QAAQ;CACR,SAAS;CACT,aAAa;CACb,cAAc;CACd,aAAa;CACb,aAAa;CACb,kBAAkB;CAClB,gBAAgB;CAChB,mBAAmB;CACnB,iBAAiB;CACjB,UAAU;CACV,oBAAoB;CACpB,oBAAoB;AACtB;AACA,SAAS,MAAM,SAAS;CACtB,QAAQ,MAAM,OAAO;AACvB;AACA,SAAS,SAAS,KAAK;CACrB,KAAK,MAAM,KAAK,KAAK;EACnB,MAAM,OAAO,EAAE,KAAK;EACpB,MAAM,QAAQ,IAAI;EAClB,IAAI,YAAY;EAChB,IAAI,UAAU,MAAM;GAClB;EACF;EACA,IAAI,OAAO,UAAU,YAAY,MAAM,QAAQ,YAAY,IAAI,CAAC,GAAG;GACjE,MACE,8BAA8B,KAAK,GAAG,MAAM,sCAC9C;GACA,YAAY;EACd,OAAO;GACL,IAAI,aAAa;GACjB,IAAI,SAAS,eAAe,SAAS,iBAAiB;IACpD,aAAa;IACb,YAAY;GACd,OAAO,IAAI,SAAS,aAAa;IAC/B,aAAa;IACb,YAAY;GACd,OAAO,IAAI,SAAS,iBAAiB;IACnC,aAAa;IACb,YAAY;GACd,OAAO,IAAI,kBAAkB,OAAO;IAClC,aAAa;IACb,YAAY;GACd,OAAO,IAAI,4BAA4B,OAAO,CAC9C;GACA,IAAI,eAAe,IAAI;IACrB,MAAM,8BAA8B,KAAK,KAAK,YAAY;GAC5D;EACF;EACA,IAAI,WAAW;GACb,OAAO,IAAI;EACb;CACF;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"TextAncestorContext.js","names":[],"sources":["esm/TextAncestorContext.js"],"sourcesContent":["import { createContext } from \"react\";\nconst TextAncestorContext = createContext(false);\nexport {\n TextAncestorContext\n};\n//# sourceMappingURL=TextAncestorContext.js.map\n"],"mappings":";;;AACA,MAAM,sBAAsB,cAAc,KAAK"}
|
package/dist/esm/colorProps.mjs
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
const colorProps = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
backgroundColor: true,
|
|
3
|
+
borderColor: true,
|
|
4
|
+
borderTopColor: true,
|
|
5
|
+
borderRightColor: true,
|
|
6
|
+
borderBottomColor: true,
|
|
7
|
+
borderLeftColor: true,
|
|
8
|
+
color: true,
|
|
9
|
+
shadowColor: true,
|
|
10
|
+
textDecorationColor: true,
|
|
11
|
+
textShadowColor: true
|
|
12
12
|
};
|
|
13
|
+
|
|
13
14
|
export { colorProps };
|
|
14
15
|
//# sourceMappingURL=colorProps.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"colorProps.js","names":[],"sources":["esm/colorProps.js"],"sourcesContent":["const colorProps = {\n backgroundColor: true,\n borderColor: true,\n borderTopColor: true,\n borderRightColor: true,\n borderBottomColor: true,\n borderLeftColor: true,\n color: true,\n shadowColor: true,\n textDecorationColor: true,\n textShadowColor: true\n};\nexport {\n colorProps\n};\n//# sourceMappingURL=colorProps.js.map\n"],"mappings":";AAAA,MAAM,aAAa;CACjB,iBAAiB;CACjB,aAAa;CACb,gBAAgB;CAChB,kBAAkB;CAClB,mBAAmB;CACnB,iBAAiB;CACjB,OAAO;CACP,aAAa;CACb,qBAAqB;CACrB,iBAAiB;AACnB"}
|