@tamagui/core 1.0.1-beta.88 → 1.0.1-beta.91
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/constants/rnw.js +5 -7
- package/dist/cjs/constants/rnw.js.map +2 -2
- package/dist/cjs/constants/rnw.native.js +28 -0
- package/dist/cjs/constants/rnw.native.js.map +7 -0
- package/dist/cjs/createComponent.js +52 -201
- 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/hooks/useFeatures.js +2 -4
- package/dist/cjs/hooks/useFeatures.js.map +2 -2
- package/dist/cjs/static.js +13 -1
- package/dist/cjs/static.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/constants/rnw.js +2 -7
- package/dist/esm/constants/rnw.js.map +2 -2
- package/dist/esm/constants/rnw.native.js +5 -0
- package/dist/esm/constants/rnw.native.js.map +7 -0
- package/dist/esm/createComponent.js +49 -200
- 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/hooks/useFeatures.js +3 -5
- package/dist/esm/hooks/useFeatures.js.map +2 -2
- package/dist/esm/static.js +5 -1
- package/dist/esm/static.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/constants/rnw.d.ts.map +1 -1
- package/types/constants/rnw.native.d.ts +2 -0
- package/types/constants/rnw.native.d.ts.map +1 -0
- 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/hooks/useFeatures.d.ts.map +1 -1
- package/types/static.d.ts +1 -1
- package/types/static.d.ts.map +1 -1
- package/types/styled.d.ts.map +1 -1
- package/types/types.d.ts +1 -3
- package/types/types.d.ts.map +1 -1
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { accessibilityRoleToWebRole, processIDRefList } from "./createComponent";
|
|
2
|
+
function assignNativePropsToWeb(elementType, viewProps, nativeProps) {
|
|
3
|
+
if (!viewProps.role && nativeProps.accessibilityRole) {
|
|
4
|
+
if (nativeProps.accessibilityRole === "none") {
|
|
5
|
+
viewProps.role = "presentation";
|
|
6
|
+
} else {
|
|
7
|
+
const webRole = accessibilityRoleToWebRole[nativeProps.accessibilityRole];
|
|
8
|
+
if (webRole != null) {
|
|
9
|
+
viewProps.role = webRole || nativeProps.accessibilityRole;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
if (nativeProps.accessibilityActiveDescendant != null) {
|
|
14
|
+
viewProps["aria-activedescendant"] = nativeProps.accessibilityActiveDescendant;
|
|
15
|
+
}
|
|
16
|
+
if (nativeProps.accessibilityAtomic != null) {
|
|
17
|
+
viewProps["aria-atomic"] = nativeProps.accessibilityAtomic;
|
|
18
|
+
}
|
|
19
|
+
if (nativeProps.accessibilityAutoComplete != null) {
|
|
20
|
+
viewProps["aria-autocomplete"] = nativeProps.accessibilityAutoComplete;
|
|
21
|
+
}
|
|
22
|
+
if (nativeProps.accessibilityBusy != null) {
|
|
23
|
+
viewProps["aria-busy"] = nativeProps.accessibilityBusy;
|
|
24
|
+
}
|
|
25
|
+
if (nativeProps.accessibilityChecked != null) {
|
|
26
|
+
viewProps["aria-checked"] = nativeProps.accessibilityChecked;
|
|
27
|
+
}
|
|
28
|
+
if (nativeProps.accessibilityColumnCount != null) {
|
|
29
|
+
viewProps["aria-colcount"] = nativeProps.accessibilityColumnCount;
|
|
30
|
+
}
|
|
31
|
+
if (nativeProps.accessibilityColumnIndex != null) {
|
|
32
|
+
viewProps["aria-colindex"] = nativeProps.accessibilityColumnIndex;
|
|
33
|
+
}
|
|
34
|
+
if (nativeProps.accessibilityColumnSpan != null) {
|
|
35
|
+
viewProps["aria-colspan"] = nativeProps.accessibilityColumnSpan;
|
|
36
|
+
}
|
|
37
|
+
if (nativeProps.accessibilityControls != null) {
|
|
38
|
+
viewProps["aria-controls"] = processIDRefList(nativeProps.accessibilityControls);
|
|
39
|
+
}
|
|
40
|
+
if (nativeProps.accessibilityCurrent != null) {
|
|
41
|
+
viewProps["aria-current"] = nativeProps.accessibilityCurrent;
|
|
42
|
+
}
|
|
43
|
+
if (nativeProps.accessibilityDescribedBy != null) {
|
|
44
|
+
viewProps["aria-describedby"] = processIDRefList(nativeProps.accessibilityDescribedBy);
|
|
45
|
+
}
|
|
46
|
+
if (nativeProps.accessibilityDetails != null) {
|
|
47
|
+
viewProps["aria-details"] = nativeProps.accessibilityDetails;
|
|
48
|
+
}
|
|
49
|
+
if (nativeProps.disabled === true) {
|
|
50
|
+
viewProps["aria-disabled"] = true;
|
|
51
|
+
if (elementType === "button" || elementType === "form" || elementType === "input" || elementType === "select" || elementType === "textarea") {
|
|
52
|
+
viewProps.disabled = true;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
if (nativeProps.accessibilityErrorMessage != null) {
|
|
56
|
+
viewProps["aria-errormessage"] = nativeProps.accessibilityErrorMessage;
|
|
57
|
+
}
|
|
58
|
+
if (nativeProps.accessibilityExpanded != null) {
|
|
59
|
+
viewProps["aria-expanded"] = nativeProps.accessibilityExpanded;
|
|
60
|
+
}
|
|
61
|
+
if (nativeProps.accessibilityFlowTo != null) {
|
|
62
|
+
viewProps["aria-flowto"] = processIDRefList(nativeProps.accessibilityFlowTo);
|
|
63
|
+
}
|
|
64
|
+
if (nativeProps.accessibilityHasPopup != null) {
|
|
65
|
+
viewProps["aria-haspopup"] = nativeProps.accessibilityHasPopup;
|
|
66
|
+
}
|
|
67
|
+
if (nativeProps.accessibilityHidden === true) {
|
|
68
|
+
viewProps["aria-hidden"] = nativeProps.accessibilityHidden;
|
|
69
|
+
}
|
|
70
|
+
if (nativeProps.accessibilityInvalid != null) {
|
|
71
|
+
viewProps["aria-invalid"] = nativeProps.accessibilityInvalid;
|
|
72
|
+
}
|
|
73
|
+
if (nativeProps.accessibilityKeyShortcuts != null && Array.isArray(nativeProps.accessibilityKeyShortcuts)) {
|
|
74
|
+
viewProps["aria-keyshortcuts"] = nativeProps.accessibilityKeyShortcuts.join(" ");
|
|
75
|
+
}
|
|
76
|
+
if (nativeProps.accessibilityLabel != null) {
|
|
77
|
+
viewProps["aria-label"] = nativeProps.accessibilityLabel;
|
|
78
|
+
}
|
|
79
|
+
if (nativeProps.accessibilityLabelledBy != null) {
|
|
80
|
+
viewProps["aria-labelledby"] = processIDRefList(nativeProps.accessibilityLabelledBy);
|
|
81
|
+
}
|
|
82
|
+
if (nativeProps.accessibilityLevel != null) {
|
|
83
|
+
viewProps["aria-level"] = nativeProps.accessibilityLevel;
|
|
84
|
+
}
|
|
85
|
+
if (nativeProps.accessibilityLiveRegion != null) {
|
|
86
|
+
viewProps["aria-live"] = nativeProps.accessibilityLiveRegion === "none" ? "off" : nativeProps.accessibilityLiveRegion;
|
|
87
|
+
}
|
|
88
|
+
if (nativeProps.accessibilityModal != null) {
|
|
89
|
+
viewProps["aria-modal"] = nativeProps.accessibilityModal;
|
|
90
|
+
}
|
|
91
|
+
if (nativeProps.accessibilityMultiline != null) {
|
|
92
|
+
viewProps["aria-multiline"] = nativeProps.accessibilityMultiline;
|
|
93
|
+
}
|
|
94
|
+
if (nativeProps.accessibilityMultiSelectable != null) {
|
|
95
|
+
viewProps["aria-multiselectable"] = nativeProps.accessibilityMultiSelectable;
|
|
96
|
+
}
|
|
97
|
+
if (nativeProps.accessibilityOrientation != null) {
|
|
98
|
+
viewProps["aria-orientation"] = nativeProps.accessibilityOrientation;
|
|
99
|
+
}
|
|
100
|
+
if (nativeProps.accessibilityOwns != null) {
|
|
101
|
+
viewProps["aria-owns"] = processIDRefList(nativeProps.accessibilityOwns);
|
|
102
|
+
}
|
|
103
|
+
if (nativeProps.accessibilityPlaceholder != null) {
|
|
104
|
+
viewProps["aria-placeholder"] = nativeProps.accessibilityPlaceholder;
|
|
105
|
+
}
|
|
106
|
+
if (nativeProps.accessibilityPosInSet != null) {
|
|
107
|
+
viewProps["aria-posinset"] = nativeProps.accessibilityPosInSet;
|
|
108
|
+
}
|
|
109
|
+
if (nativeProps.accessibilityPressed != null) {
|
|
110
|
+
viewProps["aria-pressed"] = nativeProps.accessibilityPressed;
|
|
111
|
+
}
|
|
112
|
+
if (nativeProps.accessibilityReadOnly != null) {
|
|
113
|
+
viewProps["aria-readonly"] = nativeProps.accessibilityReadOnly;
|
|
114
|
+
if (elementType === "input" || elementType === "select" || elementType === "textarea") {
|
|
115
|
+
viewProps.readOnly = true;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
if (nativeProps.accessibilityRequired != null) {
|
|
119
|
+
viewProps["aria-required"] = nativeProps.accessibilityRequired;
|
|
120
|
+
if (elementType === "input" || elementType === "select" || elementType === "textarea") {
|
|
121
|
+
viewProps.required = true;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
if (nativeProps.accessibilityRoleDescription != null) {
|
|
125
|
+
viewProps["aria-roledescription"] = nativeProps.accessibilityRoleDescription;
|
|
126
|
+
}
|
|
127
|
+
if (nativeProps.accessibilityRowCount != null) {
|
|
128
|
+
viewProps["aria-rowcount"] = nativeProps.accessibilityRowCount;
|
|
129
|
+
}
|
|
130
|
+
if (nativeProps.accessibilityRowIndex != null) {
|
|
131
|
+
viewProps["aria-rowindex"] = nativeProps.accessibilityRowIndex;
|
|
132
|
+
}
|
|
133
|
+
if (nativeProps.accessibilityRowSpan != null) {
|
|
134
|
+
viewProps["aria-rowspan"] = nativeProps.accessibilityRowSpan;
|
|
135
|
+
}
|
|
136
|
+
if (nativeProps.accessibilitySelected != null) {
|
|
137
|
+
viewProps["aria-selected"] = nativeProps.accessibilitySelected;
|
|
138
|
+
}
|
|
139
|
+
if (nativeProps.accessibilitySetSize != null) {
|
|
140
|
+
viewProps["aria-setsize"] = nativeProps.accessibilitySetSize;
|
|
141
|
+
}
|
|
142
|
+
if (nativeProps.accessibilitySort != null) {
|
|
143
|
+
viewProps["aria-sort"] = nativeProps.accessibilitySort;
|
|
144
|
+
}
|
|
145
|
+
if (nativeProps.accessibilityValueMax != null) {
|
|
146
|
+
viewProps["aria-valuemax"] = nativeProps.accessibilityValueMax;
|
|
147
|
+
}
|
|
148
|
+
if (nativeProps.accessibilityValueMin != null) {
|
|
149
|
+
viewProps["aria-valuemin"] = nativeProps.accessibilityValueMin;
|
|
150
|
+
}
|
|
151
|
+
if (nativeProps.accessibilityValueNow != null) {
|
|
152
|
+
viewProps["aria-valuenow"] = nativeProps.accessibilityValueNow;
|
|
153
|
+
}
|
|
154
|
+
if (nativeProps.accessibilityValueText != null) {
|
|
155
|
+
viewProps["aria-valuetext"] = nativeProps.accessibilityValueText;
|
|
156
|
+
}
|
|
157
|
+
if (nativeProps.nativeID) {
|
|
158
|
+
viewProps.id = nativeProps.nativeID;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
export {
|
|
162
|
+
assignNativePropsToWeb
|
|
163
|
+
};
|
|
164
|
+
//# sourceMappingURL=assignNativePropsToWeb.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/assignNativePropsToWeb.tsx"],
|
|
4
|
+
"sourcesContent": ["import { accessibilityRoleToWebRole, processIDRefList } from './createComponent'\n\n// adapted from react-native-web\n\nexport function assignNativePropsToWeb(elementType: string, viewProps: any, nativeProps: any) {\n if (!viewProps.role && nativeProps.accessibilityRole) {\n if (nativeProps.accessibilityRole === 'none') {\n viewProps.role = 'presentation'\n } else {\n const webRole = accessibilityRoleToWebRole[nativeProps.accessibilityRole]\n if (webRole != null) {\n viewProps.role = webRole || nativeProps.accessibilityRole\n }\n }\n }\n\n if (nativeProps.accessibilityActiveDescendant != null) {\n viewProps['aria-activedescendant'] = nativeProps.accessibilityActiveDescendant\n }\n if (nativeProps.accessibilityAtomic != null) {\n viewProps['aria-atomic'] = nativeProps.accessibilityAtomic\n }\n if (nativeProps.accessibilityAutoComplete != null) {\n viewProps['aria-autocomplete'] = nativeProps.accessibilityAutoComplete\n }\n if (nativeProps.accessibilityBusy != null) {\n viewProps['aria-busy'] = nativeProps.accessibilityBusy\n }\n if (nativeProps.accessibilityChecked != null) {\n viewProps['aria-checked'] = nativeProps.accessibilityChecked\n }\n if (nativeProps.accessibilityColumnCount != null) {\n viewProps['aria-colcount'] = nativeProps.accessibilityColumnCount\n }\n if (nativeProps.accessibilityColumnIndex != null) {\n viewProps['aria-colindex'] = nativeProps.accessibilityColumnIndex\n }\n if (nativeProps.accessibilityColumnSpan != null) {\n viewProps['aria-colspan'] = nativeProps.accessibilityColumnSpan\n }\n if (nativeProps.accessibilityControls != null) {\n viewProps['aria-controls'] = processIDRefList(nativeProps.accessibilityControls)\n }\n if (nativeProps.accessibilityCurrent != null) {\n viewProps['aria-current'] = nativeProps.accessibilityCurrent\n }\n if (nativeProps.accessibilityDescribedBy != null) {\n viewProps['aria-describedby'] = processIDRefList(nativeProps.accessibilityDescribedBy)\n }\n if (nativeProps.accessibilityDetails != null) {\n viewProps['aria-details'] = nativeProps.accessibilityDetails\n }\n if (nativeProps.disabled === true) {\n viewProps['aria-disabled'] = true\n // Enhance with native semantics\n if (\n elementType === 'button' ||\n elementType === 'form' ||\n elementType === 'input' ||\n elementType === 'select' ||\n elementType === 'textarea'\n ) {\n viewProps.disabled = true\n }\n }\n if (nativeProps.accessibilityErrorMessage != null) {\n viewProps['aria-errormessage'] = nativeProps.accessibilityErrorMessage\n }\n if (nativeProps.accessibilityExpanded != null) {\n viewProps['aria-expanded'] = nativeProps.accessibilityExpanded\n }\n if (nativeProps.accessibilityFlowTo != null) {\n viewProps['aria-flowto'] = processIDRefList(nativeProps.accessibilityFlowTo)\n }\n if (nativeProps.accessibilityHasPopup != null) {\n viewProps['aria-haspopup'] = nativeProps.accessibilityHasPopup\n }\n if (nativeProps.accessibilityHidden === true) {\n viewProps['aria-hidden'] = nativeProps.accessibilityHidden\n }\n if (nativeProps.accessibilityInvalid != null) {\n viewProps['aria-invalid'] = nativeProps.accessibilityInvalid\n }\n if (\n nativeProps.accessibilityKeyShortcuts != null &&\n Array.isArray(nativeProps.accessibilityKeyShortcuts)\n ) {\n viewProps['aria-keyshortcuts'] = nativeProps.accessibilityKeyShortcuts.join(' ')\n }\n if (nativeProps.accessibilityLabel != null) {\n viewProps['aria-label'] = nativeProps.accessibilityLabel\n }\n if (nativeProps.accessibilityLabelledBy != null) {\n viewProps['aria-labelledby'] = processIDRefList(nativeProps.accessibilityLabelledBy)\n }\n if (nativeProps.accessibilityLevel != null) {\n viewProps['aria-level'] = nativeProps.accessibilityLevel\n }\n if (nativeProps.accessibilityLiveRegion != null) {\n viewProps['aria-live'] =\n nativeProps.accessibilityLiveRegion === 'none' ? 'off' : nativeProps.accessibilityLiveRegion\n }\n if (nativeProps.accessibilityModal != null) {\n viewProps['aria-modal'] = nativeProps.accessibilityModal\n }\n if (nativeProps.accessibilityMultiline != null) {\n viewProps['aria-multiline'] = nativeProps.accessibilityMultiline\n }\n if (nativeProps.accessibilityMultiSelectable != null) {\n viewProps['aria-multiselectable'] = nativeProps.accessibilityMultiSelectable\n }\n if (nativeProps.accessibilityOrientation != null) {\n viewProps['aria-orientation'] = nativeProps.accessibilityOrientation\n }\n if (nativeProps.accessibilityOwns != null) {\n viewProps['aria-owns'] = processIDRefList(nativeProps.accessibilityOwns)\n }\n if (nativeProps.accessibilityPlaceholder != null) {\n viewProps['aria-placeholder'] = nativeProps.accessibilityPlaceholder\n }\n if (nativeProps.accessibilityPosInSet != null) {\n viewProps['aria-posinset'] = nativeProps.accessibilityPosInSet\n }\n if (nativeProps.accessibilityPressed != null) {\n viewProps['aria-pressed'] = nativeProps.accessibilityPressed\n }\n if (nativeProps.accessibilityReadOnly != null) {\n viewProps['aria-readonly'] = nativeProps.accessibilityReadOnly\n // Enhance with native semantics\n if (elementType === 'input' || elementType === 'select' || elementType === 'textarea') {\n viewProps.readOnly = true\n }\n }\n if (nativeProps.accessibilityRequired != null) {\n viewProps['aria-required'] = nativeProps.accessibilityRequired\n // Enhance with native semantics\n if (elementType === 'input' || elementType === 'select' || elementType === 'textarea') {\n viewProps.required = true\n }\n }\n if (nativeProps.accessibilityRoleDescription != null) {\n viewProps['aria-roledescription'] = nativeProps.accessibilityRoleDescription\n }\n if (nativeProps.accessibilityRowCount != null) {\n viewProps['aria-rowcount'] = nativeProps.accessibilityRowCount\n }\n if (nativeProps.accessibilityRowIndex != null) {\n viewProps['aria-rowindex'] = nativeProps.accessibilityRowIndex\n }\n if (nativeProps.accessibilityRowSpan != null) {\n viewProps['aria-rowspan'] = nativeProps.accessibilityRowSpan\n }\n if (nativeProps.accessibilitySelected != null) {\n viewProps['aria-selected'] = nativeProps.accessibilitySelected\n }\n if (nativeProps.accessibilitySetSize != null) {\n viewProps['aria-setsize'] = nativeProps.accessibilitySetSize\n }\n if (nativeProps.accessibilitySort != null) {\n viewProps['aria-sort'] = nativeProps.accessibilitySort\n }\n if (nativeProps.accessibilityValueMax != null) {\n viewProps['aria-valuemax'] = nativeProps.accessibilityValueMax\n }\n if (nativeProps.accessibilityValueMin != null) {\n viewProps['aria-valuemin'] = nativeProps.accessibilityValueMin\n }\n if (nativeProps.accessibilityValueNow != null) {\n viewProps['aria-valuenow'] = nativeProps.accessibilityValueNow\n }\n if (nativeProps.accessibilityValueText != null) {\n viewProps['aria-valuetext'] = nativeProps.accessibilityValueText\n }\n\n if (nativeProps.nativeID) {\n viewProps.id = nativeProps.nativeID\n }\n}\n"],
|
|
5
|
+
"mappings": "AAAA;AAIO,gCAAgC,aAAqB,WAAgB,aAAkB;AAC5F,MAAI,CAAC,UAAU,QAAQ,YAAY,mBAAmB;AACpD,QAAI,YAAY,sBAAsB,QAAQ;AAC5C,gBAAU,OAAO;AAAA,IACnB,OAAO;AACL,YAAM,UAAU,2BAA2B,YAAY;AACvD,UAAI,WAAW,MAAM;AACnB,kBAAU,OAAO,WAAW,YAAY;AAAA,MAC1C;AAAA,IACF;AAAA,EACF;AAEA,MAAI,YAAY,iCAAiC,MAAM;AACrD,cAAU,2BAA2B,YAAY;AAAA,EACnD;AACA,MAAI,YAAY,u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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
|
}
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
const rnw =
|
|
3
|
-
if (process.env.IS_STATIC === "is_static") {
|
|
4
|
-
Object.assign(rnw, interopRequire(require("react-native-web/dist/cjs/tamagui-exports")));
|
|
5
|
-
} else if (process.env.TAMAGUI_TARGET === "web") {
|
|
6
|
-
Object.assign(rnw, interopRequire(require("react-native-web")).TamaguiExports);
|
|
7
|
-
}
|
|
1
|
+
import * as RNW from "react-native-web";
|
|
2
|
+
const rnw = RNW["TamaguiExports"];
|
|
8
3
|
export {
|
|
9
4
|
rnw
|
|
10
5
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/constants/rnw.tsx"],
|
|
4
|
-
"sourcesContent": ["
|
|
5
|
-
"mappings": "AAAA,MAAM,
|
|
4
|
+
"sourcesContent": ["import * as RNW from 'react-native-web'\n\nexport const rnw = RNW['TamaguiExports']\n"],
|
|
5
|
+
"mappings": "AAAA;AAEO,MAAM,MAAM,IAAI;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -37,7 +37,6 @@ import React, {
|
|
|
37
37
|
createElement,
|
|
38
38
|
forwardRef,
|
|
39
39
|
memo,
|
|
40
|
-
startTransition,
|
|
41
40
|
useCallback,
|
|
42
41
|
useContext,
|
|
43
42
|
useMemo,
|
|
@@ -49,6 +48,7 @@ import { getConfig, onConfiguredOnce } from "./conf";
|
|
|
49
48
|
import { stackDefaultStyles } from "./constants/constants";
|
|
50
49
|
import { isWeb, useIsomorphicLayoutEffect } from "./constants/platform";
|
|
51
50
|
import { rnw } from "./constants/rnw";
|
|
51
|
+
import { assignNativePropsToWeb } from "./helpers/assignNativePropsToWeb";
|
|
52
52
|
import { getReturnVariablesAs } from "./helpers/createPropMapper";
|
|
53
53
|
import { createShallowUpdate } from "./helpers/createShallowUpdate";
|
|
54
54
|
import { extendStaticConfig, parseStaticConfig } from "./helpers/extendStaticConfig";
|
|
@@ -461,10 +461,8 @@ function createComponent(configIn, ParentComponent) {
|
|
|
461
461
|
}
|
|
462
462
|
useIsomorphicLayoutEffect(() => {
|
|
463
463
|
if (typeof window !== "undefined" && (hasEnterStyle || props.animation)) {
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
mounted: true
|
|
467
|
-
});
|
|
464
|
+
setStateShallow({
|
|
465
|
+
mounted: true
|
|
468
466
|
});
|
|
469
467
|
}
|
|
470
468
|
internal.current.isMounted = true;
|
|
@@ -726,9 +724,11 @@ function createComponent(configIn, ParentComponent) {
|
|
|
726
724
|
}
|
|
727
725
|
return content;
|
|
728
726
|
});
|
|
729
|
-
|
|
727
|
+
if (staticConfig.componentName) {
|
|
728
|
+
component.displayName = staticConfig.componentName;
|
|
729
|
+
}
|
|
730
730
|
onConfiguredOnce((conf) => {
|
|
731
|
-
var _a, _b, _c
|
|
731
|
+
var _a, _b, _c;
|
|
732
732
|
if (process.env.IS_STATIC === "is_static") {
|
|
733
733
|
return;
|
|
734
734
|
}
|
|
@@ -739,38 +739,14 @@ function createComponent(configIn, ParentComponent) {
|
|
|
739
739
|
AnimatedView = (_c = tamaguiConfig == null ? void 0 : tamaguiConfig.animations) == null ? void 0 : _c.View;
|
|
740
740
|
initialTheme = initialTheme || proxyThemeVariables(conf.themes[conf.defaultTheme || Object.keys(conf.themes)[0]]);
|
|
741
741
|
const config = getConfig();
|
|
742
|
-
let defaultPropsIn = staticConfig.defaultProps;
|
|
742
|
+
let defaultPropsIn = staticConfig.defaultProps || {};
|
|
743
743
|
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
|
-
}
|
|
744
|
+
if (config.defaultProps && parentNames && staticConfig.componentName) {
|
|
745
|
+
defaultPropsIn = mergeConfigDefaultProps(staticConfig.componentName, defaultPropsIn, config.defaultProps, parentNames);
|
|
769
746
|
}
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
}
|
|
747
|
+
const debug = process.env.NODE_ENV === "development" ? defaultPropsIn["debug"] : false;
|
|
748
|
+
if (process.env.NODE_ENV === "development" && debug === "break") {
|
|
749
|
+
debugger;
|
|
774
750
|
}
|
|
775
751
|
const [parentProps, parentClassNames] = mergeProps(defaultPropsIn, {}, true);
|
|
776
752
|
initialSplitStyles = insertSplitStyles(parentProps, staticConfig, initialTheme, {
|
|
@@ -781,8 +757,11 @@ function createComponent(configIn, ParentComponent) {
|
|
|
781
757
|
focus: false,
|
|
782
758
|
resolveVariablesAs: "both",
|
|
783
759
|
keepVariantsAsProps: true
|
|
784
|
-
}, void 0,
|
|
760
|
+
}, void 0, debug);
|
|
785
761
|
const [defaults, defaultsClassnames] = mergeProps(component.defaultProps, initialSplitStyles.viewProps, true);
|
|
762
|
+
if (debug) {
|
|
763
|
+
console.warn(defaults, component.defaultProps, initialSplitStyles);
|
|
764
|
+
}
|
|
786
765
|
initialSplitStyles.classNames = __spreadValues(__spreadValues(__spreadValues({}, parentClassNames), defaultsClassnames), initialSplitStyles.classNames);
|
|
787
766
|
defaultNativeStyle = {};
|
|
788
767
|
const validStyles2 = staticConfig.validStyles || stylePropsView;
|
|
@@ -802,7 +781,7 @@ function createComponent(configIn, ParentComponent) {
|
|
|
802
781
|
if (Object.keys(defaults).length) {
|
|
803
782
|
tamaguiDefaultProps = defaults;
|
|
804
783
|
}
|
|
805
|
-
if (process.env.NODE_ENV === "development" &&
|
|
784
|
+
if (process.env.NODE_ENV === "development" && debug) {
|
|
806
785
|
if (process.env.IS_STATIC !== "is_static") {
|
|
807
786
|
console.log(`\u{1F41B} [${staticConfig.componentName || "Component"}]`, {
|
|
808
787
|
staticConfig,
|
|
@@ -834,7 +813,6 @@ function createComponent(configIn, ParentComponent) {
|
|
|
834
813
|
};
|
|
835
814
|
return res;
|
|
836
815
|
}
|
|
837
|
-
const DefaultProps = /* @__PURE__ */ new Map();
|
|
838
816
|
const Unspaced = (props) => {
|
|
839
817
|
return props.children;
|
|
840
818
|
};
|
|
@@ -981,165 +959,6 @@ const accessibilityRoleToWebRole = {
|
|
|
981
959
|
summary: "region",
|
|
982
960
|
text: null
|
|
983
961
|
};
|
|
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
962
|
function addPseudoToStyles(styles, initialPseudos, pseudos, name, force = false) {
|
|
1144
963
|
const pseudoStyle = pseudos[name];
|
|
1145
964
|
const shouldNestObject = isWeb && name !== "enterStyle" && name !== "exitStyle";
|
|
@@ -1149,13 +968,43 @@ function addPseudoToStyles(styles, initialPseudos, pseudos, name, force = false)
|
|
|
1149
968
|
styles.push(shouldNestObject && !force ? { [name]: style } : style);
|
|
1150
969
|
}
|
|
1151
970
|
}
|
|
971
|
+
const DefaultProps = /* @__PURE__ */ new Map();
|
|
972
|
+
function mergeConfigDefaultProps(name, props, configDefaults, parentNames) {
|
|
973
|
+
const len = parentNames.length;
|
|
974
|
+
let prev;
|
|
975
|
+
for (let i = 0; i < len; i++) {
|
|
976
|
+
const n = parentNames[i];
|
|
977
|
+
if (!n)
|
|
978
|
+
continue;
|
|
979
|
+
if (DefaultProps.has(n)) {
|
|
980
|
+
prev = DefaultProps.get(n);
|
|
981
|
+
continue;
|
|
982
|
+
}
|
|
983
|
+
const props2 = configDefaults[n];
|
|
984
|
+
if (!props2) {
|
|
985
|
+
if (prev) {
|
|
986
|
+
DefaultProps.set(n, prev);
|
|
987
|
+
}
|
|
988
|
+
continue;
|
|
989
|
+
}
|
|
990
|
+
prev = mergeProps(prev || {}, props2)[0];
|
|
991
|
+
console.log("set prev", prev);
|
|
992
|
+
DefaultProps.set(n, prev);
|
|
993
|
+
}
|
|
994
|
+
const ourDefaultsMerged = DefaultProps.get(name);
|
|
995
|
+
if (ourDefaultsMerged) {
|
|
996
|
+
return mergeProps(props, ourDefaultsMerged)[0];
|
|
997
|
+
}
|
|
998
|
+
return props;
|
|
999
|
+
}
|
|
1152
1000
|
export {
|
|
1153
1001
|
AbsoluteFill,
|
|
1154
1002
|
Spacer,
|
|
1155
1003
|
Unspaced,
|
|
1156
|
-
|
|
1004
|
+
accessibilityRoleToWebRole,
|
|
1157
1005
|
createComponent,
|
|
1158
1006
|
mouseUps,
|
|
1007
|
+
processIDRefList,
|
|
1159
1008
|
spacedChildren
|
|
1160
1009
|
};
|
|
1161
1010
|
//# sourceMappingURL=createComponent.js.map
|