@tamagui/react-native-web-internals 1.132.20 → 1.132.22
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/esm/StyleSheet/__tests__/compiler-createReactDOMStyle-test.native.js +73 -43
- package/dist/esm/StyleSheet/__tests__/compiler-createReactDOMStyle-test.native.js.map +6 -1
- package/dist/esm/StyleSheet/__tests__/compiler-test.native.js +174 -166
- package/dist/esm/StyleSheet/__tests__/compiler-test.native.js.map +6 -1
- package/dist/esm/StyleSheet/__tests__/dom-createOrderedCSSStyleSheet-test.native.js +18 -20
- package/dist/esm/StyleSheet/__tests__/dom-createOrderedCSSStyleSheet-test.native.js.map +6 -1
- package/dist/esm/StyleSheet/__tests__/index-test.native.js +203 -149
- package/dist/esm/StyleSheet/__tests__/index-test.native.js.map +6 -1
- package/dist/esm/StyleSheet/__tests__/preprocess-test.native.js +16 -16
- package/dist/esm/StyleSheet/__tests__/preprocess-test.native.js.map +6 -1
- package/dist/esm/StyleSheet/__tests__/validate-test.native.js +11 -10
- package/dist/esm/StyleSheet/__tests__/validate-test.native.js.map +6 -1
- package/dist/esm/StyleSheet/compiler/createReactDOMStyle.native.js +114 -63
- package/dist/esm/StyleSheet/compiler/createReactDOMStyle.native.js.map +6 -1
- package/dist/esm/StyleSheet/compiler/hash.native.js +4 -2
- package/dist/esm/StyleSheet/compiler/hash.native.js.map +6 -1
- package/dist/esm/StyleSheet/compiler/hyphenateStyleName.native.js +7 -6
- package/dist/esm/StyleSheet/compiler/hyphenateStyleName.native.js.map +6 -1
- package/dist/esm/StyleSheet/compiler/index.native.js +221 -220
- package/dist/esm/StyleSheet/compiler/index.native.js.map +6 -1
- package/dist/esm/StyleSheet/compiler/normalizeColor.native.js +15 -17
- package/dist/esm/StyleSheet/compiler/normalizeColor.native.js.map +6 -1
- package/dist/esm/StyleSheet/compiler/normalizeValueWithProperty.native.js +6 -4
- package/dist/esm/StyleSheet/compiler/normalizeValueWithProperty.native.js.map +6 -1
- package/dist/esm/StyleSheet/compiler/resolveShadowValue.native.js +13 -25
- package/dist/esm/StyleSheet/compiler/resolveShadowValue.native.js.map +6 -1
- package/dist/esm/StyleSheet/dom/createCSSStyleSheet.native.js +15 -10
- package/dist/esm/StyleSheet/dom/createCSSStyleSheet.native.js.map +6 -1
- package/dist/esm/StyleSheet/dom/createOrderedCSSStyleSheet.native.js +22 -22
- package/dist/esm/StyleSheet/dom/createOrderedCSSStyleSheet.native.js.map +6 -1
- package/dist/esm/StyleSheet/dom/index.native.js +34 -29
- package/dist/esm/StyleSheet/dom/index.native.js.map +6 -1
- package/dist/esm/StyleSheet/index.native.js +16 -12
- package/dist/esm/StyleSheet/index.native.js.map +6 -1
- package/dist/esm/StyleSheet/preprocess.native.js +44 -73
- package/dist/esm/StyleSheet/preprocess.native.js.map +6 -1
- package/dist/esm/StyleSheet/validate.native.js +33 -32
- package/dist/esm/StyleSheet/validate.native.js.map +6 -1
- package/dist/esm/TextAncestorContext.native.js +6 -4
- package/dist/esm/TextAncestorContext.native.js.map +6 -1
- package/dist/esm/colorProps.native.js +4 -2
- package/dist/esm/colorProps.native.js.map +6 -1
- package/dist/esm/index.native.js +78 -43
- package/dist/esm/index.native.js.map +6 -1
- package/dist/esm/modules/AccessibilityUtil/__tests__/propsToAccessibilityComponent-test.native.js +9 -9
- package/dist/esm/modules/AccessibilityUtil/__tests__/propsToAccessibilityComponent-test.native.js.map +6 -1
- package/dist/esm/modules/AccessibilityUtil/__tests__/propsToAriaRole-test.native.js +6 -6
- package/dist/esm/modules/AccessibilityUtil/__tests__/propsToAriaRole-test.native.js.map +6 -1
- package/dist/esm/modules/AccessibilityUtil/index.native.js +12 -10
- package/dist/esm/modules/AccessibilityUtil/index.native.js.map +6 -1
- package/dist/esm/modules/AccessibilityUtil/isDisabled.native.js +7 -6
- package/dist/esm/modules/AccessibilityUtil/isDisabled.native.js.map +6 -1
- package/dist/esm/modules/AccessibilityUtil/propsToAccessibilityComponent.native.js +34 -34
- package/dist/esm/modules/AccessibilityUtil/propsToAccessibilityComponent.native.js.map +6 -1
- package/dist/esm/modules/AccessibilityUtil/propsToAriaRole.native.js +24 -25
- package/dist/esm/modules/AccessibilityUtil/propsToAriaRole.native.js.map +6 -1
- package/dist/esm/modules/AssetRegistry/index.native.js +5 -2
- package/dist/esm/modules/AssetRegistry/index.native.js.map +6 -1
- package/dist/esm/modules/ImageLoader/index.native.js +75 -79
- package/dist/esm/modules/ImageLoader/index.native.js.map +6 -1
- package/dist/esm/modules/InteractionManager.native.js +133 -135
- package/dist/esm/modules/InteractionManager.native.js.map +6 -1
- package/dist/esm/modules/Platform/__tests__/index-test.native.js +9 -9
- package/dist/esm/modules/Platform/__tests__/index-test.native.js.map +6 -1
- package/dist/esm/modules/Platform/index.native.js +9 -8
- package/dist/esm/modules/Platform/index.native.js.map +6 -1
- package/dist/esm/modules/TextInputState/index.native.js +31 -30
- package/dist/esm/modules/TextInputState/index.native.js.map +6 -1
- package/dist/esm/modules/UIManager/__tests__/index-test.native.js +49 -51
- package/dist/esm/modules/UIManager/__tests__/index-test.native.js.map +6 -1
- package/dist/esm/modules/UIManager/index.native.js +39 -36
- package/dist/esm/modules/UIManager/index.native.js.map +6 -1
- package/dist/esm/modules/canUseDOM.native.js +6 -4
- package/dist/esm/modules/canUseDOM.native.js.map +6 -1
- package/dist/esm/modules/createDOMProps/__tests__/index-test.native.js +45 -51
- package/dist/esm/modules/createDOMProps/__tests__/index-test.native.js.map +6 -1
- package/dist/esm/modules/createDOMProps/index.native.js +92 -96
- package/dist/esm/modules/createDOMProps/index.native.js.map +6 -1
- package/dist/esm/modules/createEventHandle/__tests__/index-test.native.js +189 -189
- package/dist/esm/modules/createEventHandle/__tests__/index-test.native.js.map +6 -1
- package/dist/esm/modules/createEventHandle/index.native.js +24 -17
- package/dist/esm/modules/createEventHandle/index.native.js.map +6 -1
- package/dist/esm/modules/dismissKeyboard/index.native.js +8 -7
- package/dist/esm/modules/dismissKeyboard/index.native.js.map +6 -1
- package/dist/esm/modules/forwardedProps/index.native.js +128 -126
- package/dist/esm/modules/forwardedProps/index.native.js.map +6 -1
- package/dist/esm/modules/getBoundingClientRect/index.native.js +11 -9
- package/dist/esm/modules/getBoundingClientRect/index.native.js.map +6 -1
- package/dist/esm/modules/invariant.native.js +22 -12
- package/dist/esm/modules/invariant.native.js.map +6 -1
- package/dist/esm/modules/isSelectionValid/index.native.js +5 -6
- package/dist/esm/modules/isSelectionValid/index.native.js.map +6 -1
- package/dist/esm/modules/isWebColor/index.native.js +7 -6
- package/dist/esm/modules/isWebColor/index.native.js.map +6 -1
- package/dist/esm/modules/mergeRefs/__tests__/index-test.native.js +7 -9
- package/dist/esm/modules/mergeRefs/__tests__/index-test.native.js.map +6 -1
- package/dist/esm/modules/mergeRefs/index.native.js +8 -5
- package/dist/esm/modules/mergeRefs/index.native.js.map +6 -1
- package/dist/esm/modules/modality/__tests__/index-test.native.js +8 -8
- package/dist/esm/modules/modality/__tests__/index-test.native.js.map +6 -1
- package/dist/esm/modules/modality/index.native.js +19 -55
- package/dist/esm/modules/modality/index.native.js.map +6 -1
- package/dist/esm/modules/multiplyStyleLengthValue/__tests__/index-test.native.js +4 -4
- package/dist/esm/modules/multiplyStyleLengthValue/__tests__/index-test.native.js.map +6 -1
- package/dist/esm/modules/multiplyStyleLengthValue/index.native.js +15 -17
- package/dist/esm/modules/multiplyStyleLengthValue/index.native.js.map +6 -1
- package/dist/esm/modules/normalizeColor/index.native.js +17 -19
- package/dist/esm/modules/normalizeColor/index.native.js.map +6 -1
- package/dist/esm/modules/pick/index.native.js +6 -3
- package/dist/esm/modules/pick/index.native.js.map +6 -1
- package/dist/esm/modules/processColor/__tests__/index-test.native.js +27 -36
- package/dist/esm/modules/processColor/__tests__/index-test.native.js.map +6 -1
- package/dist/esm/modules/processColor/index.native.js +9 -5
- package/dist/esm/modules/processColor/index.native.js.map +6 -1
- package/dist/esm/modules/requestIdleCallback/index.native.js +19 -21
- package/dist/esm/modules/requestIdleCallback/index.native.js.map +6 -1
- package/dist/esm/modules/setValueForStyles/dangerousStyleValue.native.js +5 -3
- package/dist/esm/modules/setValueForStyles/dangerousStyleValue.native.js.map +6 -1
- package/dist/esm/modules/setValueForStyles/index.native.js +10 -8
- package/dist/esm/modules/setValueForStyles/index.native.js.map +6 -1
- package/dist/esm/modules/unitlessNumbers/index.native.js +66 -60
- package/dist/esm/modules/unitlessNumbers/index.native.js.map +6 -1
- package/dist/esm/modules/useElementLayout/index.native.js +9 -5
- package/dist/esm/modules/useElementLayout/index.native.js.map +6 -1
- package/dist/esm/modules/useEvent/__tests__/index-test.native.js +214 -210
- package/dist/esm/modules/useEvent/__tests__/index-test.native.js.map +6 -1
- package/dist/esm/modules/useEvent/index.native.js +24 -21
- package/dist/esm/modules/useEvent/index.native.js.map +6 -1
- package/dist/esm/modules/useHover/__tests__/index-test.native.js +134 -161
- package/dist/esm/modules/useHover/__tests__/index-test.native.js.map +6 -1
- package/dist/esm/modules/useHover/index.native.js +51 -65
- package/dist/esm/modules/useHover/index.native.js.map +6 -1
- package/dist/esm/modules/useLayoutEffect/index.native.js +6 -5
- package/dist/esm/modules/useLayoutEffect/index.native.js.map +6 -1
- package/dist/esm/modules/useLocale/index.native.js +12 -14
- package/dist/esm/modules/useLocale/index.native.js.map +6 -1
- package/dist/esm/modules/useLocale/isLocaleRTL.native.js +25 -9
- package/dist/esm/modules/useLocale/isLocaleRTL.native.js.map +6 -1
- package/dist/esm/modules/useMergeRefs/__tests__/index-test.native.js +54 -54
- package/dist/esm/modules/useMergeRefs/__tests__/index-test.native.js.map +6 -1
- package/dist/esm/modules/useMergeRefs/index.native.js +16 -9
- package/dist/esm/modules/useMergeRefs/index.native.js.map +6 -1
- package/dist/esm/modules/usePlatformMethods/index.native.js +11 -12
- package/dist/esm/modules/usePlatformMethods/index.native.js.map +6 -1
- package/dist/esm/modules/useStable/__tests__/index-test.native.js +36 -45
- package/dist/esm/modules/useStable/__tests__/index-test.native.js.map +6 -1
- package/dist/esm/modules/useStable/index.native.js +4 -2
- package/dist/esm/modules/useStable/index.native.js.map +6 -1
- package/dist/esm/styleTypes.native.js +1 -2
- package/dist/esm/styleTypes.native.js.map +6 -1
- package/dist/esm/types.native.js +1 -2
- package/dist/esm/types.native.js.map +6 -1
- package/package.json +8 -8
|
@@ -1 +1,6 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/StyleSheet/compiler/normalizeValueWithProperty.tsx"],
|
|
4
|
+
"mappings": "AASA,SAASA,uBAAuB;AAChC,OAAOC,oBAAoB;AAE3B,IAAMC,aAAa;EACjBC,iBAAiB;EACjBC,aAAa;EACbC,gBAAgB;EAChBC,kBAAkB;EAClBC,mBAAmB;EACnBC,iBAAiB;EACjBC,OAAO;EACPC,aAAa;EACbC,qBAAqB;EACrBC,iBAAiB;AACnB;AAEe,SAAf,2BACEC,OACAC,UAAwB;AAExB,MAAIC,cAAcF;AAClB,UAAKC,YAAY,QAAQ,CAACd,gBAAgBc,QAAAA,MAAc,OAAOD,SAAU,WACvEE,cAAc,GAAGF,KAAAA,OACRC,YAAY,QAAQZ,WAAWY,QAAAA,MACxCC,cAAcd,eAAeY,KAAAA,IAExBE;AACT;",
|
|
5
|
+
"names": ["unitlessNumbers", "normalizeColor", "colorProps", "backgroundColor", "borderColor", "borderTopColor", "borderRightColor", "borderBottomColor", "borderLeftColor", "color", "shadowColor", "textDecorationColor", "textShadowColor", "value", "property", "returnValue"]
|
|
6
|
+
}
|
|
@@ -1,26 +1,14 @@
|
|
|
1
|
-
import normalizeColor from "./normalizeColor
|
|
2
|
-
import normalizeValueWithProperty from "./normalizeValueWithProperty
|
|
1
|
+
import normalizeColor from "./normalizeColor";
|
|
2
|
+
import normalizeValueWithProperty from "./normalizeValueWithProperty";
|
|
3
3
|
var defaultOffset = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
height,
|
|
16
|
-
width
|
|
17
|
-
} = shadowOffset || defaultOffset,
|
|
18
|
-
offsetX = normalizeValueWithProperty(width),
|
|
19
|
-
offsetY = normalizeValueWithProperty(height),
|
|
20
|
-
blurRadius = normalizeValueWithProperty(shadowRadius || 0),
|
|
21
|
-
color = normalizeColor(shadowColor || "black", shadowOpacity);
|
|
22
|
-
if (color != null && offsetX != null && offsetY != null && blurRadius != null) return `${offsetX} ${offsetY} ${blurRadius} ${color}`;
|
|
23
|
-
},
|
|
24
|
-
resolveShadowValue_default = resolveShadowValue;
|
|
25
|
-
export { resolveShadowValue_default as default };
|
|
26
|
-
//# sourceMappingURL=resolveShadowValue.native.js.map
|
|
4
|
+
height: 0,
|
|
5
|
+
width: 0
|
|
6
|
+
}, resolveShadowValue = function(style) {
|
|
7
|
+
var { shadowColor, shadowOffset, shadowOpacity, shadowRadius } = style, { height, width } = shadowOffset || defaultOffset, offsetX = normalizeValueWithProperty(width), offsetY = normalizeValueWithProperty(height), blurRadius = normalizeValueWithProperty(shadowRadius || 0), color = normalizeColor(shadowColor || "black", shadowOpacity);
|
|
8
|
+
if (color != null && offsetX != null && offsetY != null && blurRadius != null)
|
|
9
|
+
return `${offsetX} ${offsetY} ${blurRadius} ${color}`;
|
|
10
|
+
}, resolveShadowValue_default = resolveShadowValue;
|
|
11
|
+
export {
|
|
12
|
+
resolveShadowValue_default as default
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=resolveShadowValue.js.map
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/StyleSheet/compiler/resolveShadowValue.tsx"],
|
|
4
|
+
"mappings": "AAUA,OAAOA,oBAAoB;AAC3B,OAAOC,gCAAgC;AAEvC,IAAMC,gBAAgB;EAAEC,QAAQ;EAAGC,OAAO;AAAE,GAEtCC,qBAAqB,SAACC,OAAAA;AAC1B,MAAM,EAAEC,aAAaC,cAAcC,eAAeC,aAAY,IAAKJ,OAC7D,EAAEH,QAAQC,MAAK,IAAKI,gBAAgBN,eACpCS,UAAUV,2BAA2BG,KAAAA,GACrCQ,UAAUX,2BAA2BE,MAAAA,GACrCU,aAAaZ,2BAA2BS,gBAAgB,CAAA,GACxDI,QAAQd,eAAeO,eAAe,SAASE,aAAAA;AACrD,MAAIK,SAAS,QAAQH,WAAW,QAAQC,WAAW,QAAQC,cAAc;AACvE,WAAO,GAAGF,OAAAA,IAAWC,OAAAA,IAAWC,UAAAA,IAAcC,KAAAA;AAElD,GAEA,6BAAeT;",
|
|
5
|
+
"names": ["normalizeColor", "normalizeValueWithProperty", "defaultOffset", "height", "width", "resolveShadowValue", "style", "shadowColor", "shadowOffset", "shadowOpacity", "shadowRadius", "offsetX", "offsetY", "blurRadius", "color"]
|
|
6
|
+
}
|
|
@@ -1,14 +1,19 @@
|
|
|
1
|
-
import canUseDOM from "../../modules/canUseDOM
|
|
1
|
+
import canUseDOM from "../../modules/canUseDOM";
|
|
2
2
|
function createCSSStyleSheet(id, rootNode, textContent) {
|
|
3
3
|
if (canUseDOM) {
|
|
4
|
-
var root = rootNode ?? document,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
var root = rootNode ?? document, element = root.getElementById(id);
|
|
5
|
+
if (element == null)
|
|
6
|
+
if (element = document.createElement("style"), element.setAttribute("id", id), typeof textContent == "string" && element.appendChild(document.createTextNode(textContent)), root instanceof ShadowRoot)
|
|
7
|
+
root.insertBefore(element, root.firstChild);
|
|
8
|
+
else {
|
|
9
|
+
var head = root.head;
|
|
10
|
+
head && head.appendChild(element);
|
|
11
|
+
}
|
|
10
12
|
return element.sheet;
|
|
11
|
-
} else
|
|
13
|
+
} else
|
|
14
|
+
return null;
|
|
12
15
|
}
|
|
13
|
-
export {
|
|
14
|
-
|
|
16
|
+
export {
|
|
17
|
+
createCSSStyleSheet as default
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=createCSSStyleSheet.js.map
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/StyleSheet/dom/createCSSStyleSheet.tsx"],
|
|
4
|
+
"mappings": "AASA,OAAOA,eAAe;AAGP,SAAf,oBACEC,IACAC,UACAC,aAAoB;AAGpB,MAAIH,WAAW;AACb,QAAMI,OAAOF,YAA8BG,UACvCC,UAAUF,KAAKG,eAAeN,EAAAA;AAClC,QAAIK,WAAW;AAMb,UALAA,UAAUD,SAASG,cAAc,OAAA,GACjCF,QAAQG,aAAa,MAAMR,EAAAA,GACvB,OAAOE,eAAgB,YACzBG,QAAQI,YAAYL,SAASM,eAAeR,WAAAA,CAAAA,GAE1CC,gBAAgBQ;AAClBR,aAAKS,aAAaP,SAASF,KAAKU,UAAU;WACrC;AACL,YAAMC,OAAOX,KAAKW;AAClB,QAAIA,QAEFA,KAAKL,YAAYJ,OAAAA;MAErB;AAGF,WAAOA,QAAQU;EACjB;AACE,WAAO;AAEX;",
|
|
5
|
+
"names": ["canUseDOM", "id", "rootNode", "textContent", "root", "document", "element", "getElementById", "createElement", "setAttribute", "appendChild", "createTextNode", "ShadowRoot", "insertBefore", "firstChild", "head", "sheet"]
|
|
6
|
+
}
|
|
@@ -1,32 +1,29 @@
|
|
|
1
1
|
var slice = Array.prototype.slice;
|
|
2
2
|
function createOrderedCSSStyleSheet(sheet) {
|
|
3
|
-
var groups = {},
|
|
4
|
-
selectors = {};
|
|
3
|
+
var groups = {}, selectors = {};
|
|
5
4
|
if (sheet != null) {
|
|
6
5
|
var group;
|
|
7
|
-
slice.call(sheet.cssRules).forEach(function
|
|
6
|
+
slice.call(sheet.cssRules).forEach(function(cssRule, i) {
|
|
8
7
|
var cssText = cssRule.cssText;
|
|
9
|
-
if (cssText.indexOf("stylesheet-group") > -1)
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
if (cssText.indexOf("stylesheet-group") > -1)
|
|
9
|
+
group = decodeGroupRule(cssRule), groups[group] = {
|
|
10
|
+
start: i,
|
|
11
|
+
rules: [
|
|
12
|
+
cssText
|
|
13
|
+
]
|
|
14
|
+
};
|
|
15
|
+
else {
|
|
13
16
|
var selectorText = getSelectorText(cssText);
|
|
14
17
|
selectorText != null && (selectors[selectorText] = !0, groups[group].rules.push(cssText));
|
|
15
18
|
}
|
|
16
19
|
});
|
|
17
20
|
}
|
|
18
21
|
function sheetInsert(sheet2, group2, text) {
|
|
19
|
-
var orderedGroups = getOrderedGroups(groups),
|
|
20
|
-
groupIndex = orderedGroups.indexOf(group2),
|
|
21
|
-
nextGroupIndex = groupIndex + 1,
|
|
22
|
-
nextGroup = orderedGroups[nextGroupIndex],
|
|
23
|
-
position = nextGroup != null && groups[nextGroup].start != null ? groups[nextGroup].start : sheet2.cssRules.length,
|
|
24
|
-
isInserted = insertRuleAt(sheet2, text, position);
|
|
22
|
+
var orderedGroups = getOrderedGroups(groups), groupIndex = orderedGroups.indexOf(group2), nextGroupIndex = groupIndex + 1, nextGroup = orderedGroups[nextGroupIndex], position = nextGroup != null && groups[nextGroup].start != null ? groups[nextGroup].start : sheet2.cssRules.length, isInserted = insertRuleAt(sheet2, text, position);
|
|
25
23
|
if (isInserted) {
|
|
26
24
|
groups[group2].start == null && (groups[group2].start = position);
|
|
27
25
|
for (var i = nextGroupIndex; i < orderedGroups.length; i += 1) {
|
|
28
|
-
var groupNumber = orderedGroups[i],
|
|
29
|
-
previousStart = groups[groupNumber].start || 0;
|
|
26
|
+
var groupNumber = orderedGroups[i], previousStart = groups[groupNumber].start || 0;
|
|
30
27
|
groups[groupNumber].start = previousStart + 1;
|
|
31
28
|
}
|
|
32
29
|
}
|
|
@@ -37,9 +34,8 @@ function createOrderedCSSStyleSheet(sheet) {
|
|
|
37
34
|
* The textContent of the style sheet.
|
|
38
35
|
*/
|
|
39
36
|
getTextContent() {
|
|
40
|
-
return getOrderedGroups(groups).map(function
|
|
41
|
-
var rules = groups[group2].rules,
|
|
42
|
-
marker = rules.shift();
|
|
37
|
+
return getOrderedGroups(groups).map(function(group2) {
|
|
38
|
+
var rules = groups[group2].rules, marker = rules.shift();
|
|
43
39
|
return rules.sort(), rules.unshift(marker), rules.join(`
|
|
44
40
|
`);
|
|
45
41
|
}).join(`
|
|
@@ -54,7 +50,9 @@ function createOrderedCSSStyleSheet(sheet) {
|
|
|
54
50
|
var markerRule = encodeGroupRule(group2);
|
|
55
51
|
groups[group2] = {
|
|
56
52
|
start: null,
|
|
57
|
-
rules: [
|
|
53
|
+
rules: [
|
|
54
|
+
markerRule
|
|
55
|
+
]
|
|
58
56
|
}, sheet != null && sheetInsert(sheet, group2, markerRule);
|
|
59
57
|
}
|
|
60
58
|
var selectorText = getSelectorText(cssText);
|
|
@@ -74,7 +72,7 @@ function decodeGroupRule(cssRule) {
|
|
|
74
72
|
return Number(cssRule.selectorText.split(groupPattern)[1]);
|
|
75
73
|
}
|
|
76
74
|
function getOrderedGroups(obj) {
|
|
77
|
-
return Object.keys(obj).map(Number).sort(function
|
|
75
|
+
return Object.keys(obj).map(Number).sort(function(a, b) {
|
|
78
76
|
return a > b ? 1 : -1;
|
|
79
77
|
});
|
|
80
78
|
}
|
|
@@ -90,5 +88,7 @@ function insertRuleAt(root, cssText, position) {
|
|
|
90
88
|
return !1;
|
|
91
89
|
}
|
|
92
90
|
}
|
|
93
|
-
export {
|
|
94
|
-
|
|
91
|
+
export {
|
|
92
|
+
createOrderedCSSStyleSheet as default
|
|
93
|
+
};
|
|
94
|
+
//# sourceMappingURL=createOrderedCSSStyleSheet.js.map
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/StyleSheet/dom/createOrderedCSSStyleSheet.tsx"],
|
|
4
|
+
"mappings": "AA0BA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D,IAAIC,IAAI,IAAI;;AACjC;AAEA,IAAMC,kBAAkB;AACxB,SAASpC,gBAAgBN,SAAO;AAC9B,MAAM2C,WAAW3C,QAAQoC,MAAM,GAAA,EAAK,CAAA,EAAGQ,KAAI;AAC3C,SAAOD,aAAa,KAAKA,SAASE,QAAQH,iBAAiB,IAAA,IAAQ;AACrE;AAEA,SAASxB,aAAa4B,MAAM9C,SAAiBe,UAAgB;AAC3D,MAAI;AAEF+B,gBAAKC,WAAW/C,SAASe,QAAAA,GAClB;EACT,QAAY;AAGV,WAAO;EACT;AACF;",
|
|
5
|
+
"names": ["slice", "Array", "prototype", "sheet", "groups", "selectors", "group", "call", "cssRules", "forEach", "cssRule", "i", "cssText", "indexOf", "decodeGroupRule", "start", "rules", "selectorText", "getSelectorText", "push", "sheetInsert", "text", "orderedGroups", "getOrderedGroups", "groupIndex", "nextGroupIndex", "nextGroup", "position", "length", "isInserted", "insertRuleAt", "groupNumber", "previousStart", "OrderedCSSStyleSheet", "getTextContent", "map", "marker", "shift", "sort", "unshift", "join", "insert", "groupValue", "Number", "markerRule", "encodeGroupRule", "pop", "groupPattern", "split", "obj", "Object", "keys", "a", "b", "selectorPattern", "selector", "trim", "replace", "root", "insertRule"]
|
|
6
|
+
}
|
|
@@ -1,33 +1,36 @@
|
|
|
1
|
-
import canUseDOM from "../../modules/canUseDOM
|
|
2
|
-
import createCSSStyleSheet from "./createCSSStyleSheet
|
|
3
|
-
import createOrderedCSSStyleSheet from "./createOrderedCSSStyleSheet
|
|
4
|
-
var defaultId = "react-native-stylesheet",
|
|
5
|
-
roots = /* @__PURE__ */new WeakMap(),
|
|
6
|
-
sheets = [],
|
|
7
|
-
initialRules = [
|
|
1
|
+
import canUseDOM from "../../modules/canUseDOM";
|
|
2
|
+
import createCSSStyleSheet from "./createCSSStyleSheet";
|
|
3
|
+
import createOrderedCSSStyleSheet from "./createOrderedCSSStyleSheet";
|
|
4
|
+
var defaultId = "react-native-stylesheet", roots = /* @__PURE__ */ new WeakMap(), sheets = [], initialRules = [
|
|
8
5
|
// minimal top-level reset
|
|
9
|
-
"html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);}",
|
|
6
|
+
"html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);}",
|
|
7
|
+
"body{margin:0;}",
|
|
10
8
|
// minimal form pseudo-element reset
|
|
11
|
-
"button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0;}",
|
|
9
|
+
"button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0;}",
|
|
10
|
+
"input::-webkit-search-cancel-button,input::-webkit-search-decoration,input::-webkit-search-results-button,input::-webkit-search-results-decoration{display:none;}"
|
|
11
|
+
];
|
|
12
12
|
function createSheet(root) {
|
|
13
|
-
var id = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : defaultId,
|
|
14
|
-
sheet;
|
|
13
|
+
var id = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : defaultId, sheet;
|
|
15
14
|
function createSheet2() {
|
|
16
|
-
if (!sheet)
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
15
|
+
if (!sheet)
|
|
16
|
+
if (canUseDOM) {
|
|
17
|
+
var rootNode = root != null ? root.getRootNode() : document;
|
|
18
|
+
if (sheets.length === 0)
|
|
19
|
+
sheet = createOrderedCSSStyleSheet(createCSSStyleSheet(id)), initialRules.forEach(function(rule) {
|
|
20
|
+
sheet.insert(rule, 0);
|
|
21
|
+
}), roots.set(rootNode, sheets.length), sheets.push(sheet);
|
|
22
|
+
else {
|
|
23
|
+
var index = roots.get(rootNode);
|
|
24
|
+
if (index == null) {
|
|
25
|
+
var initialSheet = sheets[0], textContent = initialSheet != null ? initialSheet.getTextContent() : "";
|
|
26
|
+
sheet = createOrderedCSSStyleSheet(createCSSStyleSheet(id, rootNode, textContent)), roots.set(rootNode, sheets.length), sheets.push(sheet);
|
|
27
|
+
} else
|
|
28
|
+
sheet = sheets[index];
|
|
29
|
+
}
|
|
30
|
+
} else
|
|
31
|
+
sheets.length === 0 ? (sheet = createOrderedCSSStyleSheet(createCSSStyleSheet(id)), initialRules.forEach(function(rule) {
|
|
32
|
+
sheet.insert(rule, 0);
|
|
33
|
+
}), sheets.push(sheet)) : sheet = sheets[0];
|
|
31
34
|
}
|
|
32
35
|
return {
|
|
33
36
|
getTextContent() {
|
|
@@ -35,11 +38,13 @@ function createSheet(root) {
|
|
|
35
38
|
},
|
|
36
39
|
id,
|
|
37
40
|
insert(cssText, groupValue) {
|
|
38
|
-
createSheet2(), sheets.forEach(function
|
|
41
|
+
createSheet2(), sheets.forEach(function(s) {
|
|
39
42
|
s.insert(cssText, groupValue);
|
|
40
43
|
});
|
|
41
44
|
}
|
|
42
45
|
};
|
|
43
46
|
}
|
|
44
|
-
export {
|
|
45
|
-
|
|
47
|
+
export {
|
|
48
|
+
createSheet
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/StyleSheet/dom/index.tsx"],
|
|
4
|
+
"mappings": "AAUA,OAAOA,eAAe;AACtB,OAAOC,yBAAyB;AAEhC,OAAOC,gCAAgC;AAMvC,IAAMC,YAAY,2BACZC,QAAQ,oBAAIC,QAAAA,GACZC,SAAS,CAAA,GAETC,eAAe;;EAEnB;EACA;;EAEA;EACA;;AAGK,SAASC,YAAYC,MAAkB;MAAEC,KAAAA,UAAAA,SAAAA,KAAAA,UAAAA,CAAAA,MAAAA,SAAAA,UAAAA,CAAAA,IAAKP,WAC/CQ;AAEJ,WAASH,eAAAA;AACP,QAAIG;AAEJ,UAAIX,WAAW;AACb,YAAMY,WAAiBH,QAAQ,OAAOA,KAAKI,YAAW,IAAKC;AAE3D,YAAIR,OAAOS,WAAW;AACpBJ,kBAAQT,2BAA2BD,oBAAoBS,EAAAA,CAAAA,GACvDH,aAAaS,QAAQ,SAACC,MAAAA;AACpBN,kBAAMO,OAAOD,MAAM,CAAA;UACrB,CAAA,GACAb,MAAMe,IAAIP,UAAUN,OAAOS,MAAM,GACjCT,OAAOc,KAAKT,KAAAA;aACP;AACL,cAAMU,QAAQjB,MAAMkB,IAAIV,QAAAA;AACxB,cAAIS,SAAS,MAAM;AACjB,gBAAME,eAAejB,OAAO,CAAA,GAEtBkB,cAAcD,gBAAgB,OAAOA,aAAaE,eAAc,IAAK;AAE3Ed,oBAAQT,2BACND,oBAAoBS,IAAIE,UAAiBY,WAAAA,CAAAA,GAE3CpB,MAAMe,IAAIP,UAAUN,OAAOS,MAAM,GACjCT,OAAOc,KAAKT,KAAAA;UACd;AACEA,oBAAQL,OAAOe,KAAAA;QAEnB;MACF;AAEE,QAAIf,OAAOS,WAAW,KACpBJ,QAAQT,2BAA2BD,oBAAoBS,EAAAA,CAAAA,GACvDH,aAAaS,QAAQ,SAACC,MAAAA;AACpBN,gBAAMO,OAAOD,MAAM,CAAA;QACrB,CAAA,GACAX,OAAOc,KAAKT,KAAAA,KAEZA,QAAQL,OAAO,CAAA;EAGrB;AAEA,SAAO;IACLmB,iBAAAA;AACEjB,aAAAA,aAAAA,GACOG,MAAMc,eAAc;IAC7B;IACAf;IACAQ,OAAOQ,SAAiBC,YAAkB;AACxCnB,MAAAA,aAAAA,GACAF,OAAOU,QAAQ,SAACY,GAAAA;AACdA,UAAEV,OAAOQ,SAASC,UAAAA;MACpB,CAAA;IACF;EACF;AACF;",
|
|
5
|
+
"names": ["canUseDOM", "createCSSStyleSheet", "createOrderedCSSStyleSheet", "defaultId", "roots", "WeakMap", "sheets", "initialRules", "createSheet", "root", "id", "sheet", "rootNode", "getRootNode", "document", "length", "forEach", "rule", "insert", "set", "push", "index", "get", "initialSheet", "textContent", "getTextContent", "cssText", "groupValue", "s"]
|
|
6
|
+
}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
var absoluteFillObject = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
absoluteFill = absoluteFillObject;
|
|
2
|
+
position: "absolute",
|
|
3
|
+
left: 0,
|
|
4
|
+
right: 0,
|
|
5
|
+
top: 0,
|
|
6
|
+
bottom: 0
|
|
7
|
+
}, absoluteFill = absoluteFillObject;
|
|
9
8
|
function create(styles) {
|
|
10
9
|
return styles;
|
|
11
10
|
}
|
|
@@ -13,8 +12,9 @@ function compose(style1, style2) {
|
|
|
13
12
|
return flatten(style1, style2);
|
|
14
13
|
}
|
|
15
14
|
function flatten() {
|
|
16
|
-
for (var _len = arguments.length, styles = new Array(_len), _key = 0; _key < _len; _key++)
|
|
17
|
-
|
|
15
|
+
for (var _len = arguments.length, styles = new Array(_len), _key = 0; _key < _len; _key++)
|
|
16
|
+
styles[_key] = arguments[_key];
|
|
17
|
+
return styles.flat().flat().flat().flat().reduce(function(acc, cur) {
|
|
18
18
|
return cur && Object.assign(acc, cur), acc;
|
|
19
19
|
}, {});
|
|
20
20
|
}
|
|
@@ -24,7 +24,8 @@ function getSheet() {
|
|
|
24
24
|
textContent: sheet.getTextContent()
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
|
-
function StyleSheet(styles, options) {
|
|
27
|
+
function StyleSheet(styles, options) {
|
|
28
|
+
}
|
|
28
29
|
StyleSheet.absoluteFill = absoluteFill;
|
|
29
30
|
StyleSheet.absoluteFillObject = absoluteFillObject;
|
|
30
31
|
StyleSheet.create = create;
|
|
@@ -32,5 +33,8 @@ StyleSheet.compose = compose;
|
|
|
32
33
|
StyleSheet.flatten = flatten;
|
|
33
34
|
StyleSheet.getSheet = getSheet;
|
|
34
35
|
StyleSheet.hairlineWidth = 1;
|
|
35
|
-
export {
|
|
36
|
-
|
|
36
|
+
export {
|
|
37
|
+
StyleSheet as default,
|
|
38
|
+
flatten
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/StyleSheet/index.tsx"],
|
|
4
|
+
"mappings": "AAoBA,IAAMA,qBAAqB;EACzBC,UAAU;EACVC,MAAM;EACNC,OAAO;EACPC,KAAK;EACLC,QAAQ;AACV,GAEMC,eAAeN;AAKrB,SAASO,OAAOC,QAAM;AACpB,SAAOA;AACT;AAKA,SAASC,QAAQC,QAAaC,QAAW;AACvC,SAAOC,QAAQF,QAAQC,MAAAA;AACzB;AAKO,SAASC,UAAAA;AAAQ,WAAA,OAAA,UAAA,QAAGJ,SAAH,IAAA,MAAA,IAAA,GAAA,OAAA,GAAA,OAAA,MAAA;AAAGA,WAAH,IAAA,IAAA,UAAA,IAAA;AACtB,SAAOA,OACJK,KAAI,EACJA,KAAI,EACJA,KAAI,EACJA,KAAI,EACJC,OAAO,SAACC,KAAKC,KAAAA;AACZ,WAAIA,OACFC,OAAOC,OAAOH,KAAKC,GAAAA,GAEdD;EACT,GAAG,CAAC,CAAA;AACR;AAKA,SAASI,WAAAA;AACP,SAAO;IACLC,IAAI;IACJC,aAAaC,MAAMC,eAAc;EACnC;AACF;AAQe,SAAf,WAAmCf,QAAagB,SAAiB;AAAe;AAEhFC,WAAWnB,eAAeA;AAC1BmB,WAAWzB,qBAAqBA;AAChCyB,WAAWlB,SAASA;AACpBkB,WAAWhB,UAAUA;AACrBgB,WAAWb,UAAUA;AACrBa,WAAWN,WAAWA;AAGtBM,WAAWC,gBAAgB;",
|
|
5
|
+
"names": ["absoluteFillObject", "position", "left", "right", "top", "bottom", "absoluteFill", "create", "styles", "compose", "style1", "style2", "flatten", "flat", "reduce", "acc", "cur", "Object", "assign", "getSheet", "id", "textContent", "sheet", "getTextContent", "options", "StyleSheet", "hairlineWidth"]
|
|
6
|
+
}
|
|
@@ -1,75 +1,46 @@
|
|
|
1
|
-
import normalizeColor from "./compiler/normalizeColor
|
|
2
|
-
import normalizeValueWithProperty from "./compiler/normalizeValueWithProperty
|
|
3
|
-
var emptyObject = {},
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
},
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
var {
|
|
27
|
-
textShadowColor,
|
|
28
|
-
textShadowOffset,
|
|
29
|
-
textShadowRadius
|
|
30
|
-
} = style,
|
|
31
|
-
{
|
|
32
|
-
height,
|
|
33
|
-
width
|
|
34
|
-
} = textShadowOffset || defaultOffset,
|
|
35
|
-
radius = textShadowRadius || 0,
|
|
36
|
-
offsetX = normalizeValueWithProperty(width),
|
|
37
|
-
offsetY = normalizeValueWithProperty(height),
|
|
38
|
-
blurRadius = normalizeValueWithProperty(radius),
|
|
39
|
-
color = normalizeValueWithProperty(textShadowColor, "textShadowColor");
|
|
40
|
-
if (color && (height !== 0 || width !== 0 || radius !== 0) && offsetX != null && offsetY != null && blurRadius != null) return `${offsetX} ${offsetY} ${blurRadius} ${color}`;
|
|
41
|
-
},
|
|
42
|
-
preprocess = function (originalStyle) {
|
|
43
|
-
var style = originalStyle || emptyObject,
|
|
44
|
-
nextStyle = {};
|
|
45
|
-
for (var originalProp in style) {
|
|
46
|
-
var originalValue = style[originalProp],
|
|
47
|
-
prop = originalProp,
|
|
48
|
-
value = originalValue;
|
|
49
|
-
if (!(!Object.prototype.hasOwnProperty.call(style, originalProp) || originalValue == null)) {
|
|
50
|
-
if (prop === "shadowColor" || prop === "shadowOffset" || prop === "shadowOpacity" || prop === "shadowRadius") {
|
|
51
|
-
var boxShadowValue = createBoxShadowValue(style);
|
|
52
|
-
if (boxShadowValue != null && nextStyle.boxShadow == null) {
|
|
53
|
-
var {
|
|
54
|
-
boxShadow
|
|
55
|
-
} = style;
|
|
56
|
-
prop = "boxShadow", value = boxShadow ? `${boxShadow}, ${boxShadowValue}` : boxShadowValue;
|
|
57
|
-
} else continue;
|
|
58
|
-
}
|
|
59
|
-
if (prop === "textShadowColor" || prop === "textShadowOffset" || prop === "textShadowRadius") {
|
|
60
|
-
var textShadowValue = createTextShadowValue(style);
|
|
61
|
-
if (textShadowValue != null && nextStyle.textShadow == null) {
|
|
62
|
-
var {
|
|
63
|
-
textShadow
|
|
64
|
-
} = style;
|
|
65
|
-
prop = "textShadow", value = textShadow ? `${textShadow}, ${textShadowValue}` : textShadowValue;
|
|
66
|
-
} else continue;
|
|
67
|
-
}
|
|
68
|
-
nextStyle[prop] = value;
|
|
1
|
+
import normalizeColor from "./compiler/normalizeColor";
|
|
2
|
+
import normalizeValueWithProperty from "./compiler/normalizeValueWithProperty";
|
|
3
|
+
var emptyObject = {}, defaultOffset = {
|
|
4
|
+
height: 0,
|
|
5
|
+
width: 0
|
|
6
|
+
}, createBoxShadowValue = function(style) {
|
|
7
|
+
var { shadowColor, shadowOffset, shadowOpacity, shadowRadius } = style, { height, width } = shadowOffset || defaultOffset, offsetX = normalizeValueWithProperty(width), offsetY = normalizeValueWithProperty(height), blurRadius = normalizeValueWithProperty(shadowRadius || 0), color = normalizeColor(shadowColor || "black", shadowOpacity);
|
|
8
|
+
if (color != null && offsetX != null && offsetY != null && blurRadius != null)
|
|
9
|
+
return `${offsetX} ${offsetY} ${blurRadius} ${color}`;
|
|
10
|
+
}, createTextShadowValue = function(style) {
|
|
11
|
+
var { textShadowColor, textShadowOffset, textShadowRadius } = style, { height, width } = textShadowOffset || defaultOffset, radius = textShadowRadius || 0, offsetX = normalizeValueWithProperty(width), offsetY = normalizeValueWithProperty(height), blurRadius = normalizeValueWithProperty(radius), color = normalizeValueWithProperty(textShadowColor, "textShadowColor");
|
|
12
|
+
if (color && (height !== 0 || width !== 0 || radius !== 0) && offsetX != null && offsetY != null && blurRadius != null)
|
|
13
|
+
return `${offsetX} ${offsetY} ${blurRadius} ${color}`;
|
|
14
|
+
}, preprocess = function(originalStyle) {
|
|
15
|
+
var style = originalStyle || emptyObject, nextStyle = {};
|
|
16
|
+
for (var originalProp in style) {
|
|
17
|
+
var originalValue = style[originalProp], prop = originalProp, value = originalValue;
|
|
18
|
+
if (!(!Object.prototype.hasOwnProperty.call(style, originalProp) || originalValue == null)) {
|
|
19
|
+
if (prop === "shadowColor" || prop === "shadowOffset" || prop === "shadowOpacity" || prop === "shadowRadius") {
|
|
20
|
+
var boxShadowValue = createBoxShadowValue(style);
|
|
21
|
+
if (boxShadowValue != null && nextStyle.boxShadow == null) {
|
|
22
|
+
var { boxShadow } = style;
|
|
23
|
+
prop = "boxShadow", value = boxShadow ? `${boxShadow}, ${boxShadowValue}` : boxShadowValue;
|
|
24
|
+
} else
|
|
25
|
+
continue;
|
|
69
26
|
}
|
|
27
|
+
if (prop === "textShadowColor" || prop === "textShadowOffset" || prop === "textShadowRadius") {
|
|
28
|
+
var textShadowValue = createTextShadowValue(style);
|
|
29
|
+
if (textShadowValue != null && nextStyle.textShadow == null) {
|
|
30
|
+
var { textShadow } = style;
|
|
31
|
+
prop = "textShadow", value = textShadow ? `${textShadow}, ${textShadowValue}` : textShadowValue;
|
|
32
|
+
} else
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
nextStyle[prop] = value;
|
|
70
36
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
export {
|
|
75
|
-
|
|
37
|
+
}
|
|
38
|
+
return nextStyle;
|
|
39
|
+
}, processStyle = preprocess;
|
|
40
|
+
export {
|
|
41
|
+
createBoxShadowValue,
|
|
42
|
+
createTextShadowValue,
|
|
43
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A;AAEA,MAAMf,QAAQe,iBAAiBpB,aACzBqB,YAAY,CAAC;AAEnB,WAAWC,gBAAgBjB,OAAO;AAChC,QAAMkB,gBAAgBlB,MAAMiB,YAAAA,GACxBE,OAAOF,cACPG,QAAQF;AAEZ,QACE,GAACG,OAAOC,UAAUC,eAAeC,KAAKxB,OAAOiB,YAAAA,KAC7CC,iBAAiB,OAMnB;UACEC,SAAS,iBACTA,SAAS,kBACTA,SAAS,mBACTA,SAAS,gBACT;AACA,YAAMM,iBAAiB1B,qBAAqBC,KAAAA;AAC5C,YAAIyB,kBAAkB,QAAQT,UAAUU,aAAa,MAAM;AACzD,cAAM,EAAEA,UAAS,IAAK1B;AACtBmB,iBAAO,aACPC,QAAQM,YAAY,GAAGA,SAAAA,KAAcD,cAAAA,KAAmBA;QAC1D;AACE;MAEJ;AAGA,UACEN,SAAS,qBACTA,SAAS,sBACTA,SAAS,oBACT;AACA,YAAMQ,kBAAkBlB,sBAAsBT,KAAAA;AAC9C,YAAI2B,mBAAmB,QAAQX,UAAUY,cAAc,MAAM;AAC3D,cAAM,EAAEA,WAAU,IAAK5B;AACvBmB,iBAAO,cACPC,QAAQQ,aAAa,GAAGA,UAAAA,KAAeD,eAAAA,KAAoBA;QAC7D;AACE;MAEJ;AAEAX,gBAAUG,IAAAA,IAAQC;;EACpB;AAGA,SAAOJ;AACT,GAEaa,eAAef;",
|
|
5
|
+
"names": ["normalizeColor", "normalizeValueWithProperty", "emptyObject", "defaultOffset", "height", "width", "createBoxShadowValue", "style", "shadowColor", "shadowOffset", "shadowOpacity", "shadowRadius", "offsetX", "offsetY", "blurRadius", "color", "createTextShadowValue", "textShadowColor", "textShadowOffset", "textShadowRadius", "radius", "preprocess", "originalStyle", "nextStyle", "originalProp", "originalValue", "prop", "value", "Object", "prototype", "hasOwnProperty", "call", "boxShadowValue", "boxShadow", "textShadowValue", "textShadow", "processStyle"]
|
|
6
|
+
}
|
|
@@ -1,40 +1,39 @@
|
|
|
1
1
|
var invalidShortforms = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
};
|
|
2
|
+
background: !0,
|
|
3
|
+
borderBottom: !0,
|
|
4
|
+
borderLeft: !0,
|
|
5
|
+
borderRight: !0,
|
|
6
|
+
borderTop: !0,
|
|
7
|
+
font: !0,
|
|
8
|
+
grid: !0,
|
|
9
|
+
outline: !0,
|
|
10
|
+
textDecoration: !0
|
|
11
|
+
}, invalidMultiValueShortforms = {
|
|
12
|
+
flex: !0,
|
|
13
|
+
margin: !0,
|
|
14
|
+
padding: !0,
|
|
15
|
+
borderColor: !0,
|
|
16
|
+
borderRadius: !0,
|
|
17
|
+
borderStyle: !0,
|
|
18
|
+
borderWidth: !0,
|
|
19
|
+
marginHorizontal: !0,
|
|
20
|
+
marginVertical: !0,
|
|
21
|
+
paddingHorizontal: !0,
|
|
22
|
+
paddingVertical: !0,
|
|
23
|
+
overflow: !0,
|
|
24
|
+
overscrollBehavior: !0,
|
|
25
|
+
backgroundPosition: !0
|
|
26
|
+
};
|
|
28
27
|
function error(message) {
|
|
29
28
|
console.error(message);
|
|
30
29
|
}
|
|
31
30
|
function validate(obj) {
|
|
32
31
|
for (var k in obj) {
|
|
33
|
-
var prop = k.trim(),
|
|
34
|
-
value = obj[prop],
|
|
35
|
-
isInvalid = !1;
|
|
32
|
+
var prop = k.trim(), value = obj[prop], isInvalid = !1;
|
|
36
33
|
if (value !== null) {
|
|
37
|
-
if (typeof value == "string" && value.indexOf("!important") > -1)
|
|
34
|
+
if (typeof value == "string" && value.indexOf("!important") > -1)
|
|
35
|
+
error(`Invalid style declaration "${prop}:${value}". Values cannot include "!important"`), isInvalid = !0;
|
|
36
|
+
else {
|
|
38
37
|
var suggestion = "";
|
|
39
38
|
prop === "animation" || prop === "animationName" ? (suggestion = 'Did you mean "animationKeyframes"?', isInvalid = !0) : prop === "direction" ? (suggestion = 'Did you mean "writingDirection"?', isInvalid = !0) : prop === "verticalAlign" ? (suggestion = 'Did you mean "textAlignVertical"?', isInvalid = !0) : invalidShortforms[prop] ? (suggestion = "Please use long-form properties.", isInvalid = !0) : invalidMultiValueShortforms[prop], suggestion !== "" && error(`Invalid style property of "${prop}". ${suggestion}`);
|
|
40
39
|
}
|
|
@@ -42,5 +41,7 @@ function validate(obj) {
|
|
|
42
41
|
}
|
|
43
42
|
}
|
|
44
43
|
}
|
|
45
|
-
export {
|
|
46
|
-
|
|
44
|
+
export {
|
|
45
|
+
validate
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=validate.js.map
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/StyleSheet/validate.tsx"],
|
|
4
|
+
"mappings": "AASA,IAAMA,oBAAoB;EACxBC,YAAY;EACZC,cAAc;EACdC,YAAY;EACZC,aAAa;EACbC,WAAW;EACXC,MAAM;EACNC,MAAM;EACNC,SAAS;EACTC,gBAAgB;AAClB,GAEMC,8BAA8B;EAClCC,MAAM;EACNC,QAAQ;EACRC,SAAS;EACTC,aAAa;EACbC,cAAc;EACdC,aAAa;EACbC,aAAa;EACbC,kBAAkB;EAClBC,gBAAgB;EAChBC,mBAAmB;EACnBC,iBAAiB;EACjBC,UAAU;EACVC,oBAAoB;EACpBC,oBAAoB;AACtB;AAEA,SAASC,MAAMC,SAAO;AACpBC,UAAQF,MAAMC,OAAAA;AAChB;AAEO,SAASE,SAASC,KAAW;AAClC,WAAWC,KAAKD,KAAK;AACnB,QAAME,OAAOD,EAAEE,KAAI,GACbC,QAAQJ,IAAIE,IAAAA,GACdG,YAAY;AAEhB,QAAID,UAAU,MAId;UAAI,OAAOA,SAAU,YAAYA,MAAME,QAAQ,YAAA,IAAgB;AAC7DV,cACE,8BAA8BM,IAAAA,IAAQE,KAAAA,uCAA4C,GAEpFC,YAAY;WACP;AACL,YAAIE,aAAa;AACjB,QAAIL,SAAS,eAAeA,SAAS,mBACnCK,aAAa,sCAGbF,YAAY,MACHH,SAAS,eAClBK,aAAa,oCACbF,YAAY,MACHH,SAAS,mBAClBK,aAAa,qCACbF,YAAY,MACHlC,kBAAkB+B,IAAAA,KAC3BK,aAAa,oCACbF,YAAY,MACHxB,4BAA4BqB,IAAAA,GAOnCK,eAAe,MACjBX,MAAM,8BAA8BM,IAAAA,MAAUK,UAAAA,EAAY;MAE9D;AAEA,MAAIF,aACF,OAAOL,IAAIC,CAAAA;;EAEf;AACF;",
|
|
5
|
+
"names": ["invalidShortforms", "background", "borderBottom", "borderLeft", "borderRight", "borderTop", "font", "grid", "outline", "textDecoration", "invalidMultiValueShortforms", "flex", "margin", "padding", "borderColor", "borderRadius", "borderStyle", "borderWidth", "marginHorizontal", "marginVertical", "paddingHorizontal", "paddingVertical", "overflow", "overscrollBehavior", "backgroundPosition", "error", "message", "console", "validate", "obj", "k", "prop", "trim", "value", "isInvalid", "indexOf", "suggestion"]
|
|
6
|
+
}
|