@tamagui/core 1.0.1-beta.88 → 1.0.1-beta.89
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/assignNativePropsToWeb.js +187 -0
- package/dist/cjs/assignNativePropsToWeb.js.map +7 -0
- package/dist/cjs/constants/platform.js +2 -2
- package/dist/cjs/constants/platform.js.map +2 -2
- package/dist/cjs/createComponent.js +50 -197
- package/dist/cjs/createComponent.js.map +2 -2
- package/dist/cjs/helpers/assignNativePropsToWeb.js +187 -0
- package/dist/cjs/helpers/assignNativePropsToWeb.js.map +7 -0
- package/dist/cjs/helpers/assignNativePropsToWeb.native.js +29 -0
- package/dist/cjs/helpers/assignNativePropsToWeb.native.js.map +7 -0
- package/dist/cjs/helpers/extendStaticConfig.js +3 -1
- package/dist/cjs/helpers/extendStaticConfig.js.map +2 -2
- package/dist/cjs/helpers/getSplitStyles.js +11 -11
- package/dist/cjs/helpers/getSplitStyles.js.map +2 -2
- package/dist/cjs/styled.js +0 -5
- package/dist/cjs/styled.js.map +2 -2
- package/dist/cjs/types.js.map +1 -1
- package/dist/esm/assignNativePropsToWeb.js +164 -0
- package/dist/esm/assignNativePropsToWeb.js.map +7 -0
- package/dist/esm/constants/platform.js +2 -2
- package/dist/esm/constants/platform.js.map +2 -2
- package/dist/esm/createComponent.js +47 -195
- package/dist/esm/createComponent.js.map +2 -2
- package/dist/esm/helpers/assignNativePropsToWeb.js +164 -0
- package/dist/esm/helpers/assignNativePropsToWeb.js.map +7 -0
- package/dist/esm/helpers/assignNativePropsToWeb.native.js +6 -0
- package/dist/esm/helpers/assignNativePropsToWeb.native.js.map +7 -0
- package/dist/esm/helpers/extendStaticConfig.js +3 -1
- package/dist/esm/helpers/extendStaticConfig.js.map +2 -2
- package/dist/esm/helpers/getSplitStyles.js +11 -11
- package/dist/esm/helpers/getSplitStyles.js.map +2 -2
- package/dist/esm/styled.js +0 -5
- package/dist/esm/styled.js.map +2 -2
- package/package.json +6 -6
- package/types/assignNativePropsToWeb.d.ts +2 -0
- package/types/assignNativePropsToWeb.d.ts.map +1 -0
- package/types/constants/platform.d.ts.map +1 -1
- package/types/createComponent.d.ts +15 -1
- package/types/createComponent.d.ts.map +1 -1
- package/types/helpers/assignNativePropsToWeb.d.ts +2 -0
- package/types/helpers/assignNativePropsToWeb.d.ts.map +1 -0
- package/types/helpers/assignNativePropsToWeb.native.d.ts +2 -0
- package/types/helpers/assignNativePropsToWeb.native.d.ts.map +1 -0
- package/types/helpers/extendStaticConfig.d.ts.map +1 -1
- package/types/helpers/getSplitStyles.d.ts.map +1 -1
- package/types/styled.d.ts.map +1 -1
- package/types/types.d.ts +1 -2
- package/types/types.d.ts.map +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
var _a, _b
|
|
1
|
+
var _a, _b;
|
|
2
2
|
import { useEffect, useLayoutEffect } from "react";
|
|
3
3
|
import { Platform } from "react-native";
|
|
4
4
|
const isAndroid = ((_a = Platform) == null ? void 0 : _a.OS) === "android";
|
|
5
5
|
const isIOS = ((_b = Platform) == null ? void 0 : _b.OS) === "ios";
|
|
6
|
-
const isWeb = process.env.TAMAGUI_TARGET
|
|
6
|
+
const isWeb = process.env.TAMAGUI_TARGET === "web";
|
|
7
7
|
const isSSR = isWeb && typeof window === "undefined";
|
|
8
8
|
const isClient = isWeb && typeof window !== "undefined";
|
|
9
9
|
const useIsomorphicLayoutEffect = isSSR ? useEffect : useLayoutEffect;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/constants/platform.ts"],
|
|
4
|
-
"sourcesContent": ["import { useEffect, useLayoutEffect } from 'react'\nimport { Platform } from 'react-native'\n\nexport const isAndroid = Platform?.OS === 'android'\nexport const isIOS = Platform?.OS === 'ios'\
|
|
5
|
-
"mappings": "AAAA;AAAA;AACA;AAEO,MAAM,YAAY,uCAAU,QAAO;AACnC,MAAM,QAAQ,uCAAU,QAAO;
|
|
4
|
+
"sourcesContent": ["import { useEffect, useLayoutEffect } from 'react'\nimport { Platform } from 'react-native'\n\nexport const isAndroid = Platform?.OS === 'android'\nexport const isIOS = Platform?.OS === 'ios'\nexport const isWeb = process.env.TAMAGUI_TARGET === 'web'\nexport const isSSR = isWeb && typeof window === 'undefined'\nexport const isClient = isWeb && typeof window !== 'undefined'\nexport const useIsomorphicLayoutEffect = isSSR ? useEffect : useLayoutEffect\nexport const isChrome = typeof navigator !== 'undefined' && /Chrome/.test(navigator.userAgent || '')\nexport const isWebTouchable = typeof window !== 'undefined' && 'ontouchstart' in window\nexport const isTouchable = !isWeb || isWebTouchable\nexport const isWebIOS =\n isWeb &&\n typeof navigator !== 'undefined' &&\n (/iPad|iPhone|iPod/.test(navigator.platform) ||\n (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1)) &&\n !window['MSStream']\n"],
|
|
5
|
+
"mappings": "AAAA;AAAA;AACA;AAEO,MAAM,YAAY,uCAAU,QAAO;AACnC,MAAM,QAAQ,uCAAU,QAAO;AAC/B,MAAM,QAAQ,QAAQ,IAAI,mBAAmB;AAC7C,MAAM,QAAQ,SAAS,OAAO,WAAW;AACzC,MAAM,WAAW,SAAS,OAAO,WAAW;AAC5C,MAAM,4BAA4B,QAAQ,YAAY;AACtD,MAAM,WAAW,OAAO,cAAc,eAAe,SAAS,KAAK,UAAU,aAAa,EAAE;AAC5F,MAAM,iBAAiB,OAAO,WAAW,eAAe,kBAAkB;AAC1E,MAAM,cAAc,CAAC,SAAS;AAC9B,MAAM,WACX,SACA,OAAO,cAAc,eACpB,oBAAmB,KAAK,UAAU,QAAQ,KACxC,UAAU,aAAa,cAAc,UAAU,iBAAiB,MACnE,CAAC,OAAO;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -49,6 +49,7 @@ import { getConfig, onConfiguredOnce } from "./conf";
|
|
|
49
49
|
import { stackDefaultStyles } from "./constants/constants";
|
|
50
50
|
import { isWeb, useIsomorphicLayoutEffect } from "./constants/platform";
|
|
51
51
|
import { rnw } from "./constants/rnw";
|
|
52
|
+
import { assignNativePropsToWeb } from "./helpers/assignNativePropsToWeb";
|
|
52
53
|
import { getReturnVariablesAs } from "./helpers/createPropMapper";
|
|
53
54
|
import { createShallowUpdate } from "./helpers/createShallowUpdate";
|
|
54
55
|
import { extendStaticConfig, parseStaticConfig } from "./helpers/extendStaticConfig";
|
|
@@ -726,9 +727,11 @@ function createComponent(configIn, ParentComponent) {
|
|
|
726
727
|
}
|
|
727
728
|
return content;
|
|
728
729
|
});
|
|
729
|
-
|
|
730
|
+
if (staticConfig.componentName) {
|
|
731
|
+
component.displayName = staticConfig.componentName;
|
|
732
|
+
}
|
|
730
733
|
onConfiguredOnce((conf) => {
|
|
731
|
-
var _a, _b, _c
|
|
734
|
+
var _a, _b, _c;
|
|
732
735
|
if (process.env.IS_STATIC === "is_static") {
|
|
733
736
|
return;
|
|
734
737
|
}
|
|
@@ -739,38 +742,14 @@ function createComponent(configIn, ParentComponent) {
|
|
|
739
742
|
AnimatedView = (_c = tamaguiConfig == null ? void 0 : tamaguiConfig.animations) == null ? void 0 : _c.View;
|
|
740
743
|
initialTheme = initialTheme || proxyThemeVariables(conf.themes[conf.defaultTheme || Object.keys(conf.themes)[0]]);
|
|
741
744
|
const config = getConfig();
|
|
742
|
-
let defaultPropsIn = staticConfig.defaultProps;
|
|
745
|
+
let defaultPropsIn = staticConfig.defaultProps || {};
|
|
743
746
|
const parentNames = [...staticConfig.parentNames || [], staticConfig.componentName];
|
|
744
|
-
if (config.defaultProps && parentNames) {
|
|
745
|
-
|
|
746
|
-
let prev;
|
|
747
|
-
for (let i = 0; i < len; i++) {
|
|
748
|
-
const n = parentNames[i];
|
|
749
|
-
if (!n)
|
|
750
|
-
continue;
|
|
751
|
-
if (DefaultProps.has(n)) {
|
|
752
|
-
prev = DefaultProps.get(n);
|
|
753
|
-
continue;
|
|
754
|
-
}
|
|
755
|
-
const props = config.defaultProps[n];
|
|
756
|
-
if (!props) {
|
|
757
|
-
if (prev) {
|
|
758
|
-
DefaultProps.set(n, prev);
|
|
759
|
-
}
|
|
760
|
-
continue;
|
|
761
|
-
}
|
|
762
|
-
prev = mergeProps(prev || {}, props)[0];
|
|
763
|
-
DefaultProps.set(n, prev);
|
|
764
|
-
}
|
|
765
|
-
const ourDefaultsMerged = DefaultProps.get(staticConfig.componentName);
|
|
766
|
-
if (ourDefaultsMerged) {
|
|
767
|
-
defaultPropsIn = mergeProps(defaultPropsIn, ourDefaultsMerged)[0];
|
|
768
|
-
}
|
|
747
|
+
if (config.defaultProps && parentNames && staticConfig.componentName) {
|
|
748
|
+
defaultPropsIn = mergeConfigDefaultProps(staticConfig.componentName, defaultPropsIn, config.defaultProps, parentNames);
|
|
769
749
|
}
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
}
|
|
750
|
+
const debug = process.env.NODE_ENV === "development" ? defaultPropsIn["debug"] : false;
|
|
751
|
+
if (process.env.NODE_ENV === "development" && debug === "break") {
|
|
752
|
+
debugger;
|
|
774
753
|
}
|
|
775
754
|
const [parentProps, parentClassNames] = mergeProps(defaultPropsIn, {}, true);
|
|
776
755
|
initialSplitStyles = insertSplitStyles(parentProps, staticConfig, initialTheme, {
|
|
@@ -781,8 +760,11 @@ function createComponent(configIn, ParentComponent) {
|
|
|
781
760
|
focus: false,
|
|
782
761
|
resolveVariablesAs: "both",
|
|
783
762
|
keepVariantsAsProps: true
|
|
784
|
-
}, void 0,
|
|
763
|
+
}, void 0, debug);
|
|
785
764
|
const [defaults, defaultsClassnames] = mergeProps(component.defaultProps, initialSplitStyles.viewProps, true);
|
|
765
|
+
if (debug) {
|
|
766
|
+
console.warn(defaults, component.defaultProps, initialSplitStyles);
|
|
767
|
+
}
|
|
786
768
|
initialSplitStyles.classNames = __spreadValues(__spreadValues(__spreadValues({}, parentClassNames), defaultsClassnames), initialSplitStyles.classNames);
|
|
787
769
|
defaultNativeStyle = {};
|
|
788
770
|
const validStyles2 = staticConfig.validStyles || stylePropsView;
|
|
@@ -802,7 +784,7 @@ function createComponent(configIn, ParentComponent) {
|
|
|
802
784
|
if (Object.keys(defaults).length) {
|
|
803
785
|
tamaguiDefaultProps = defaults;
|
|
804
786
|
}
|
|
805
|
-
if (process.env.NODE_ENV === "development" &&
|
|
787
|
+
if (process.env.NODE_ENV === "development" && debug) {
|
|
806
788
|
if (process.env.IS_STATIC !== "is_static") {
|
|
807
789
|
console.log(`\u{1F41B} [${staticConfig.componentName || "Component"}]`, {
|
|
808
790
|
staticConfig,
|
|
@@ -834,7 +816,6 @@ function createComponent(configIn, ParentComponent) {
|
|
|
834
816
|
};
|
|
835
817
|
return res;
|
|
836
818
|
}
|
|
837
|
-
const DefaultProps = /* @__PURE__ */ new Map();
|
|
838
819
|
const Unspaced = (props) => {
|
|
839
820
|
return props.children;
|
|
840
821
|
};
|
|
@@ -981,165 +962,6 @@ const accessibilityRoleToWebRole = {
|
|
|
981
962
|
summary: "region",
|
|
982
963
|
text: null
|
|
983
964
|
};
|
|
984
|
-
function assignNativePropsToWeb(elementType, viewProps, nativeProps) {
|
|
985
|
-
if (!viewProps.role && nativeProps.accessibilityRole) {
|
|
986
|
-
if (nativeProps.accessibilityRole === "none") {
|
|
987
|
-
viewProps.role = "presentation";
|
|
988
|
-
} else {
|
|
989
|
-
const webRole = accessibilityRoleToWebRole[nativeProps.accessibilityRole];
|
|
990
|
-
if (webRole != null) {
|
|
991
|
-
viewProps.role = webRole || nativeProps.accessibilityRole;
|
|
992
|
-
}
|
|
993
|
-
}
|
|
994
|
-
}
|
|
995
|
-
if (nativeProps.accessibilityActiveDescendant != null) {
|
|
996
|
-
viewProps["aria-activedescendant"] = nativeProps.accessibilityActiveDescendant;
|
|
997
|
-
}
|
|
998
|
-
if (nativeProps.accessibilityAtomic != null) {
|
|
999
|
-
viewProps["aria-atomic"] = nativeProps.accessibilityAtomic;
|
|
1000
|
-
}
|
|
1001
|
-
if (nativeProps.accessibilityAutoComplete != null) {
|
|
1002
|
-
viewProps["aria-autocomplete"] = nativeProps.accessibilityAutoComplete;
|
|
1003
|
-
}
|
|
1004
|
-
if (nativeProps.accessibilityBusy != null) {
|
|
1005
|
-
viewProps["aria-busy"] = nativeProps.accessibilityBusy;
|
|
1006
|
-
}
|
|
1007
|
-
if (nativeProps.accessibilityChecked != null) {
|
|
1008
|
-
viewProps["aria-checked"] = nativeProps.accessibilityChecked;
|
|
1009
|
-
}
|
|
1010
|
-
if (nativeProps.accessibilityColumnCount != null) {
|
|
1011
|
-
viewProps["aria-colcount"] = nativeProps.accessibilityColumnCount;
|
|
1012
|
-
}
|
|
1013
|
-
if (nativeProps.accessibilityColumnIndex != null) {
|
|
1014
|
-
viewProps["aria-colindex"] = nativeProps.accessibilityColumnIndex;
|
|
1015
|
-
}
|
|
1016
|
-
if (nativeProps.accessibilityColumnSpan != null) {
|
|
1017
|
-
viewProps["aria-colspan"] = nativeProps.accessibilityColumnSpan;
|
|
1018
|
-
}
|
|
1019
|
-
if (nativeProps.accessibilityControls != null) {
|
|
1020
|
-
viewProps["aria-controls"] = processIDRefList(nativeProps.accessibilityControls);
|
|
1021
|
-
}
|
|
1022
|
-
if (nativeProps.accessibilityCurrent != null) {
|
|
1023
|
-
viewProps["aria-current"] = nativeProps.accessibilityCurrent;
|
|
1024
|
-
}
|
|
1025
|
-
if (nativeProps.accessibilityDescribedBy != null) {
|
|
1026
|
-
viewProps["aria-describedby"] = processIDRefList(nativeProps.accessibilityDescribedBy);
|
|
1027
|
-
}
|
|
1028
|
-
if (nativeProps.accessibilityDetails != null) {
|
|
1029
|
-
viewProps["aria-details"] = nativeProps.accessibilityDetails;
|
|
1030
|
-
}
|
|
1031
|
-
if (nativeProps.disabled === true) {
|
|
1032
|
-
viewProps["aria-disabled"] = true;
|
|
1033
|
-
if (elementType === "button" || elementType === "form" || elementType === "input" || elementType === "select" || elementType === "textarea") {
|
|
1034
|
-
viewProps.disabled = true;
|
|
1035
|
-
}
|
|
1036
|
-
}
|
|
1037
|
-
if (nativeProps.accessibilityErrorMessage != null) {
|
|
1038
|
-
viewProps["aria-errormessage"] = nativeProps.accessibilityErrorMessage;
|
|
1039
|
-
}
|
|
1040
|
-
if (nativeProps.accessibilityExpanded != null) {
|
|
1041
|
-
viewProps["aria-expanded"] = nativeProps.accessibilityExpanded;
|
|
1042
|
-
}
|
|
1043
|
-
if (nativeProps.accessibilityFlowTo != null) {
|
|
1044
|
-
viewProps["aria-flowto"] = processIDRefList(nativeProps.accessibilityFlowTo);
|
|
1045
|
-
}
|
|
1046
|
-
if (nativeProps.accessibilityHasPopup != null) {
|
|
1047
|
-
viewProps["aria-haspopup"] = nativeProps.accessibilityHasPopup;
|
|
1048
|
-
}
|
|
1049
|
-
if (nativeProps.accessibilityHidden === true) {
|
|
1050
|
-
viewProps["aria-hidden"] = nativeProps.accessibilityHidden;
|
|
1051
|
-
}
|
|
1052
|
-
if (nativeProps.accessibilityInvalid != null) {
|
|
1053
|
-
viewProps["aria-invalid"] = nativeProps.accessibilityInvalid;
|
|
1054
|
-
}
|
|
1055
|
-
if (nativeProps.accessibilityKeyShortcuts != null && Array.isArray(nativeProps.accessibilityKeyShortcuts)) {
|
|
1056
|
-
viewProps["aria-keyshortcuts"] = nativeProps.accessibilityKeyShortcuts.join(" ");
|
|
1057
|
-
}
|
|
1058
|
-
if (nativeProps.accessibilityLabel != null) {
|
|
1059
|
-
viewProps["aria-label"] = nativeProps.accessibilityLabel;
|
|
1060
|
-
}
|
|
1061
|
-
if (nativeProps.accessibilityLabelledBy != null) {
|
|
1062
|
-
viewProps["aria-labelledby"] = processIDRefList(nativeProps.accessibilityLabelledBy);
|
|
1063
|
-
}
|
|
1064
|
-
if (nativeProps.accessibilityLevel != null) {
|
|
1065
|
-
viewProps["aria-level"] = nativeProps.accessibilityLevel;
|
|
1066
|
-
}
|
|
1067
|
-
if (nativeProps.accessibilityLiveRegion != null) {
|
|
1068
|
-
viewProps["aria-live"] = nativeProps.accessibilityLiveRegion === "none" ? "off" : nativeProps.accessibilityLiveRegion;
|
|
1069
|
-
}
|
|
1070
|
-
if (nativeProps.accessibilityModal != null) {
|
|
1071
|
-
viewProps["aria-modal"] = nativeProps.accessibilityModal;
|
|
1072
|
-
}
|
|
1073
|
-
if (nativeProps.accessibilityMultiline != null) {
|
|
1074
|
-
viewProps["aria-multiline"] = nativeProps.accessibilityMultiline;
|
|
1075
|
-
}
|
|
1076
|
-
if (nativeProps.accessibilityMultiSelectable != null) {
|
|
1077
|
-
viewProps["aria-multiselectable"] = nativeProps.accessibilityMultiSelectable;
|
|
1078
|
-
}
|
|
1079
|
-
if (nativeProps.accessibilityOrientation != null) {
|
|
1080
|
-
viewProps["aria-orientation"] = nativeProps.accessibilityOrientation;
|
|
1081
|
-
}
|
|
1082
|
-
if (nativeProps.accessibilityOwns != null) {
|
|
1083
|
-
viewProps["aria-owns"] = processIDRefList(nativeProps.accessibilityOwns);
|
|
1084
|
-
}
|
|
1085
|
-
if (nativeProps.accessibilityPlaceholder != null) {
|
|
1086
|
-
viewProps["aria-placeholder"] = nativeProps.accessibilityPlaceholder;
|
|
1087
|
-
}
|
|
1088
|
-
if (nativeProps.accessibilityPosInSet != null) {
|
|
1089
|
-
viewProps["aria-posinset"] = nativeProps.accessibilityPosInSet;
|
|
1090
|
-
}
|
|
1091
|
-
if (nativeProps.accessibilityPressed != null) {
|
|
1092
|
-
viewProps["aria-pressed"] = nativeProps.accessibilityPressed;
|
|
1093
|
-
}
|
|
1094
|
-
if (nativeProps.accessibilityReadOnly != null) {
|
|
1095
|
-
viewProps["aria-readonly"] = nativeProps.accessibilityReadOnly;
|
|
1096
|
-
if (elementType === "input" || elementType === "select" || elementType === "textarea") {
|
|
1097
|
-
viewProps.readOnly = true;
|
|
1098
|
-
}
|
|
1099
|
-
}
|
|
1100
|
-
if (nativeProps.accessibilityRequired != null) {
|
|
1101
|
-
viewProps["aria-required"] = nativeProps.accessibilityRequired;
|
|
1102
|
-
if (elementType === "input" || elementType === "select" || elementType === "textarea") {
|
|
1103
|
-
viewProps.required = true;
|
|
1104
|
-
}
|
|
1105
|
-
}
|
|
1106
|
-
if (nativeProps.accessibilityRoleDescription != null) {
|
|
1107
|
-
viewProps["aria-roledescription"] = nativeProps.accessibilityRoleDescription;
|
|
1108
|
-
}
|
|
1109
|
-
if (nativeProps.accessibilityRowCount != null) {
|
|
1110
|
-
viewProps["aria-rowcount"] = nativeProps.accessibilityRowCount;
|
|
1111
|
-
}
|
|
1112
|
-
if (nativeProps.accessibilityRowIndex != null) {
|
|
1113
|
-
viewProps["aria-rowindex"] = nativeProps.accessibilityRowIndex;
|
|
1114
|
-
}
|
|
1115
|
-
if (nativeProps.accessibilityRowSpan != null) {
|
|
1116
|
-
viewProps["aria-rowspan"] = nativeProps.accessibilityRowSpan;
|
|
1117
|
-
}
|
|
1118
|
-
if (nativeProps.accessibilitySelected != null) {
|
|
1119
|
-
viewProps["aria-selected"] = nativeProps.accessibilitySelected;
|
|
1120
|
-
}
|
|
1121
|
-
if (nativeProps.accessibilitySetSize != null) {
|
|
1122
|
-
viewProps["aria-setsize"] = nativeProps.accessibilitySetSize;
|
|
1123
|
-
}
|
|
1124
|
-
if (nativeProps.accessibilitySort != null) {
|
|
1125
|
-
viewProps["aria-sort"] = nativeProps.accessibilitySort;
|
|
1126
|
-
}
|
|
1127
|
-
if (nativeProps.accessibilityValueMax != null) {
|
|
1128
|
-
viewProps["aria-valuemax"] = nativeProps.accessibilityValueMax;
|
|
1129
|
-
}
|
|
1130
|
-
if (nativeProps.accessibilityValueMin != null) {
|
|
1131
|
-
viewProps["aria-valuemin"] = nativeProps.accessibilityValueMin;
|
|
1132
|
-
}
|
|
1133
|
-
if (nativeProps.accessibilityValueNow != null) {
|
|
1134
|
-
viewProps["aria-valuenow"] = nativeProps.accessibilityValueNow;
|
|
1135
|
-
}
|
|
1136
|
-
if (nativeProps.accessibilityValueText != null) {
|
|
1137
|
-
viewProps["aria-valuetext"] = nativeProps.accessibilityValueText;
|
|
1138
|
-
}
|
|
1139
|
-
if (nativeProps.nativeID) {
|
|
1140
|
-
viewProps.id = nativeProps.nativeID;
|
|
1141
|
-
}
|
|
1142
|
-
}
|
|
1143
965
|
function addPseudoToStyles(styles, initialPseudos, pseudos, name, force = false) {
|
|
1144
966
|
const pseudoStyle = pseudos[name];
|
|
1145
967
|
const shouldNestObject = isWeb && name !== "enterStyle" && name !== "exitStyle";
|
|
@@ -1149,13 +971,43 @@ function addPseudoToStyles(styles, initialPseudos, pseudos, name, force = false)
|
|
|
1149
971
|
styles.push(shouldNestObject && !force ? { [name]: style } : style);
|
|
1150
972
|
}
|
|
1151
973
|
}
|
|
974
|
+
const DefaultProps = /* @__PURE__ */ new Map();
|
|
975
|
+
function mergeConfigDefaultProps(name, props, configDefaults, parentNames) {
|
|
976
|
+
const len = parentNames.length;
|
|
977
|
+
let prev;
|
|
978
|
+
for (let i = 0; i < len; i++) {
|
|
979
|
+
const n = parentNames[i];
|
|
980
|
+
if (!n)
|
|
981
|
+
continue;
|
|
982
|
+
if (DefaultProps.has(n)) {
|
|
983
|
+
prev = DefaultProps.get(n);
|
|
984
|
+
continue;
|
|
985
|
+
}
|
|
986
|
+
const props2 = configDefaults[n];
|
|
987
|
+
if (!props2) {
|
|
988
|
+
if (prev) {
|
|
989
|
+
DefaultProps.set(n, prev);
|
|
990
|
+
}
|
|
991
|
+
continue;
|
|
992
|
+
}
|
|
993
|
+
prev = mergeProps(prev || {}, props2)[0];
|
|
994
|
+
console.log("set prev", prev);
|
|
995
|
+
DefaultProps.set(n, prev);
|
|
996
|
+
}
|
|
997
|
+
const ourDefaultsMerged = DefaultProps.get(name);
|
|
998
|
+
if (ourDefaultsMerged) {
|
|
999
|
+
return mergeProps(props, ourDefaultsMerged)[0];
|
|
1000
|
+
}
|
|
1001
|
+
return props;
|
|
1002
|
+
}
|
|
1152
1003
|
export {
|
|
1153
1004
|
AbsoluteFill,
|
|
1154
1005
|
Spacer,
|
|
1155
1006
|
Unspaced,
|
|
1156
|
-
|
|
1007
|
+
accessibilityRoleToWebRole,
|
|
1157
1008
|
createComponent,
|
|
1158
1009
|
mouseUps,
|
|
1010
|
+
processIDRefList,
|
|
1159
1011
|
spacedChildren
|
|
1160
1012
|
};
|
|
1161
1013
|
//# sourceMappingURL=createComponent.js.map
|