@tamagui/core 1.0.1-beta.87 → 1.0.1-beta.90
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 +53 -199
- 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/createPropMapper.js +4 -0
- package/dist/cjs/helpers/createPropMapper.js.map +2 -2
- 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/helpers/getStylesAtomic.js +4 -4
- package/dist/cjs/helpers/getStylesAtomic.js.map +2 -2
- package/dist/cjs/hooks/useFeatures.js +2 -4
- package/dist/cjs/hooks/useFeatures.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 +50 -198
- 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/createPropMapper.js +4 -0
- package/dist/esm/helpers/createPropMapper.js.map +2 -2
- 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/helpers/getStylesAtomic.js +4 -4
- package/dist/esm/helpers/getStylesAtomic.js.map +2 -2
- package/dist/esm/hooks/useFeatures.js +3 -5
- package/dist/esm/hooks/useFeatures.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/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/createPropMapper.d.ts.map +1 -1
- package/types/helpers/extendStaticConfig.d.ts.map +1 -1
- package/types/helpers/getSplitStyles.d.ts +1 -4
- package/types/helpers/getSplitStyles.d.ts.map +1 -1
- package/types/helpers/getStylesAtomic.d.ts +2 -6
- package/types/helpers/getStylesAtomic.d.ts.map +1 -1
- package/types/hooks/useFeatures.d.ts.map +1 -1
- package/types/styled.d.ts.map +1 -1
- package/types/types.d.ts +3 -2
- package/types/types.d.ts.map +1 -1
- package/types/views/ThemeInverse.d.ts +1 -0
- package/types/views/ThemeInverse.d.ts.map +1 -1
- package/types/views/ThemeProvider.d.ts +1 -0
- package/types/views/ThemeProvider.d.ts.map +1 -1
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var assignNativePropsToWeb_exports = {};
|
|
19
|
+
__export(assignNativePropsToWeb_exports, {
|
|
20
|
+
assignNativePropsToWeb: () => assignNativePropsToWeb
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(assignNativePropsToWeb_exports);
|
|
23
|
+
var import_createComponent = require("./createComponent");
|
|
24
|
+
function assignNativePropsToWeb(elementType, viewProps, nativeProps) {
|
|
25
|
+
if (!viewProps.role && nativeProps.accessibilityRole) {
|
|
26
|
+
if (nativeProps.accessibilityRole === "none") {
|
|
27
|
+
viewProps.role = "presentation";
|
|
28
|
+
} else {
|
|
29
|
+
const webRole = import_createComponent.accessibilityRoleToWebRole[nativeProps.accessibilityRole];
|
|
30
|
+
if (webRole != null) {
|
|
31
|
+
viewProps.role = webRole || nativeProps.accessibilityRole;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
if (nativeProps.accessibilityActiveDescendant != null) {
|
|
36
|
+
viewProps["aria-activedescendant"] = nativeProps.accessibilityActiveDescendant;
|
|
37
|
+
}
|
|
38
|
+
if (nativeProps.accessibilityAtomic != null) {
|
|
39
|
+
viewProps["aria-atomic"] = nativeProps.accessibilityAtomic;
|
|
40
|
+
}
|
|
41
|
+
if (nativeProps.accessibilityAutoComplete != null) {
|
|
42
|
+
viewProps["aria-autocomplete"] = nativeProps.accessibilityAutoComplete;
|
|
43
|
+
}
|
|
44
|
+
if (nativeProps.accessibilityBusy != null) {
|
|
45
|
+
viewProps["aria-busy"] = nativeProps.accessibilityBusy;
|
|
46
|
+
}
|
|
47
|
+
if (nativeProps.accessibilityChecked != null) {
|
|
48
|
+
viewProps["aria-checked"] = nativeProps.accessibilityChecked;
|
|
49
|
+
}
|
|
50
|
+
if (nativeProps.accessibilityColumnCount != null) {
|
|
51
|
+
viewProps["aria-colcount"] = nativeProps.accessibilityColumnCount;
|
|
52
|
+
}
|
|
53
|
+
if (nativeProps.accessibilityColumnIndex != null) {
|
|
54
|
+
viewProps["aria-colindex"] = nativeProps.accessibilityColumnIndex;
|
|
55
|
+
}
|
|
56
|
+
if (nativeProps.accessibilityColumnSpan != null) {
|
|
57
|
+
viewProps["aria-colspan"] = nativeProps.accessibilityColumnSpan;
|
|
58
|
+
}
|
|
59
|
+
if (nativeProps.accessibilityControls != null) {
|
|
60
|
+
viewProps["aria-controls"] = (0, import_createComponent.processIDRefList)(nativeProps.accessibilityControls);
|
|
61
|
+
}
|
|
62
|
+
if (nativeProps.accessibilityCurrent != null) {
|
|
63
|
+
viewProps["aria-current"] = nativeProps.accessibilityCurrent;
|
|
64
|
+
}
|
|
65
|
+
if (nativeProps.accessibilityDescribedBy != null) {
|
|
66
|
+
viewProps["aria-describedby"] = (0, import_createComponent.processIDRefList)(nativeProps.accessibilityDescribedBy);
|
|
67
|
+
}
|
|
68
|
+
if (nativeProps.accessibilityDetails != null) {
|
|
69
|
+
viewProps["aria-details"] = nativeProps.accessibilityDetails;
|
|
70
|
+
}
|
|
71
|
+
if (nativeProps.disabled === true) {
|
|
72
|
+
viewProps["aria-disabled"] = true;
|
|
73
|
+
if (elementType === "button" || elementType === "form" || elementType === "input" || elementType === "select" || elementType === "textarea") {
|
|
74
|
+
viewProps.disabled = true;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
if (nativeProps.accessibilityErrorMessage != null) {
|
|
78
|
+
viewProps["aria-errormessage"] = nativeProps.accessibilityErrorMessage;
|
|
79
|
+
}
|
|
80
|
+
if (nativeProps.accessibilityExpanded != null) {
|
|
81
|
+
viewProps["aria-expanded"] = nativeProps.accessibilityExpanded;
|
|
82
|
+
}
|
|
83
|
+
if (nativeProps.accessibilityFlowTo != null) {
|
|
84
|
+
viewProps["aria-flowto"] = (0, import_createComponent.processIDRefList)(nativeProps.accessibilityFlowTo);
|
|
85
|
+
}
|
|
86
|
+
if (nativeProps.accessibilityHasPopup != null) {
|
|
87
|
+
viewProps["aria-haspopup"] = nativeProps.accessibilityHasPopup;
|
|
88
|
+
}
|
|
89
|
+
if (nativeProps.accessibilityHidden === true) {
|
|
90
|
+
viewProps["aria-hidden"] = nativeProps.accessibilityHidden;
|
|
91
|
+
}
|
|
92
|
+
if (nativeProps.accessibilityInvalid != null) {
|
|
93
|
+
viewProps["aria-invalid"] = nativeProps.accessibilityInvalid;
|
|
94
|
+
}
|
|
95
|
+
if (nativeProps.accessibilityKeyShortcuts != null && Array.isArray(nativeProps.accessibilityKeyShortcuts)) {
|
|
96
|
+
viewProps["aria-keyshortcuts"] = nativeProps.accessibilityKeyShortcuts.join(" ");
|
|
97
|
+
}
|
|
98
|
+
if (nativeProps.accessibilityLabel != null) {
|
|
99
|
+
viewProps["aria-label"] = nativeProps.accessibilityLabel;
|
|
100
|
+
}
|
|
101
|
+
if (nativeProps.accessibilityLabelledBy != null) {
|
|
102
|
+
viewProps["aria-labelledby"] = (0, import_createComponent.processIDRefList)(nativeProps.accessibilityLabelledBy);
|
|
103
|
+
}
|
|
104
|
+
if (nativeProps.accessibilityLevel != null) {
|
|
105
|
+
viewProps["aria-level"] = nativeProps.accessibilityLevel;
|
|
106
|
+
}
|
|
107
|
+
if (nativeProps.accessibilityLiveRegion != null) {
|
|
108
|
+
viewProps["aria-live"] = nativeProps.accessibilityLiveRegion === "none" ? "off" : nativeProps.accessibilityLiveRegion;
|
|
109
|
+
}
|
|
110
|
+
if (nativeProps.accessibilityModal != null) {
|
|
111
|
+
viewProps["aria-modal"] = nativeProps.accessibilityModal;
|
|
112
|
+
}
|
|
113
|
+
if (nativeProps.accessibilityMultiline != null) {
|
|
114
|
+
viewProps["aria-multiline"] = nativeProps.accessibilityMultiline;
|
|
115
|
+
}
|
|
116
|
+
if (nativeProps.accessibilityMultiSelectable != null) {
|
|
117
|
+
viewProps["aria-multiselectable"] = nativeProps.accessibilityMultiSelectable;
|
|
118
|
+
}
|
|
119
|
+
if (nativeProps.accessibilityOrientation != null) {
|
|
120
|
+
viewProps["aria-orientation"] = nativeProps.accessibilityOrientation;
|
|
121
|
+
}
|
|
122
|
+
if (nativeProps.accessibilityOwns != null) {
|
|
123
|
+
viewProps["aria-owns"] = (0, import_createComponent.processIDRefList)(nativeProps.accessibilityOwns);
|
|
124
|
+
}
|
|
125
|
+
if (nativeProps.accessibilityPlaceholder != null) {
|
|
126
|
+
viewProps["aria-placeholder"] = nativeProps.accessibilityPlaceholder;
|
|
127
|
+
}
|
|
128
|
+
if (nativeProps.accessibilityPosInSet != null) {
|
|
129
|
+
viewProps["aria-posinset"] = nativeProps.accessibilityPosInSet;
|
|
130
|
+
}
|
|
131
|
+
if (nativeProps.accessibilityPressed != null) {
|
|
132
|
+
viewProps["aria-pressed"] = nativeProps.accessibilityPressed;
|
|
133
|
+
}
|
|
134
|
+
if (nativeProps.accessibilityReadOnly != null) {
|
|
135
|
+
viewProps["aria-readonly"] = nativeProps.accessibilityReadOnly;
|
|
136
|
+
if (elementType === "input" || elementType === "select" || elementType === "textarea") {
|
|
137
|
+
viewProps.readOnly = true;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
if (nativeProps.accessibilityRequired != null) {
|
|
141
|
+
viewProps["aria-required"] = nativeProps.accessibilityRequired;
|
|
142
|
+
if (elementType === "input" || elementType === "select" || elementType === "textarea") {
|
|
143
|
+
viewProps.required = true;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
if (nativeProps.accessibilityRoleDescription != null) {
|
|
147
|
+
viewProps["aria-roledescription"] = nativeProps.accessibilityRoleDescription;
|
|
148
|
+
}
|
|
149
|
+
if (nativeProps.accessibilityRowCount != null) {
|
|
150
|
+
viewProps["aria-rowcount"] = nativeProps.accessibilityRowCount;
|
|
151
|
+
}
|
|
152
|
+
if (nativeProps.accessibilityRowIndex != null) {
|
|
153
|
+
viewProps["aria-rowindex"] = nativeProps.accessibilityRowIndex;
|
|
154
|
+
}
|
|
155
|
+
if (nativeProps.accessibilityRowSpan != null) {
|
|
156
|
+
viewProps["aria-rowspan"] = nativeProps.accessibilityRowSpan;
|
|
157
|
+
}
|
|
158
|
+
if (nativeProps.accessibilitySelected != null) {
|
|
159
|
+
viewProps["aria-selected"] = nativeProps.accessibilitySelected;
|
|
160
|
+
}
|
|
161
|
+
if (nativeProps.accessibilitySetSize != null) {
|
|
162
|
+
viewProps["aria-setsize"] = nativeProps.accessibilitySetSize;
|
|
163
|
+
}
|
|
164
|
+
if (nativeProps.accessibilitySort != null) {
|
|
165
|
+
viewProps["aria-sort"] = nativeProps.accessibilitySort;
|
|
166
|
+
}
|
|
167
|
+
if (nativeProps.accessibilityValueMax != null) {
|
|
168
|
+
viewProps["aria-valuemax"] = nativeProps.accessibilityValueMax;
|
|
169
|
+
}
|
|
170
|
+
if (nativeProps.accessibilityValueMin != null) {
|
|
171
|
+
viewProps["aria-valuemin"] = nativeProps.accessibilityValueMin;
|
|
172
|
+
}
|
|
173
|
+
if (nativeProps.accessibilityValueNow != null) {
|
|
174
|
+
viewProps["aria-valuenow"] = nativeProps.accessibilityValueNow;
|
|
175
|
+
}
|
|
176
|
+
if (nativeProps.accessibilityValueText != null) {
|
|
177
|
+
viewProps["aria-valuetext"] = nativeProps.accessibilityValueText;
|
|
178
|
+
}
|
|
179
|
+
if (nativeProps.nativeID) {
|
|
180
|
+
viewProps.id = nativeProps.nativeID;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
184
|
+
0 && (module.exports = {
|
|
185
|
+
assignNativePropsToWeb
|
|
186
|
+
});
|
|
187
|
+
//# 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;AAAA;AAAA;AAAA;AAAA;AAAA,6BAA6D;AAItD,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,kDAA2B,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,uBAAuB,MAAM;AAC3C,cAAU,iBAAiB,YAAY;AAAA,EACzC;AACA,MAAI,YAAY,6BAA6B,MAAM;AACjD,cAAU,uBAAuB,YAAY;AAAA,EAC/C;AACA,MAAI,YAAY,qBAAqB,MAAM;AACzC,cAAU,eAAe,YAAY;AAAA,EACvC;AACA,MAAI,YAAY,wBAAwB,MAAM;AAC5C,cAAU,kBAAkB,YAAY;AAAA,EAC1C;AACA,MAAI,YAAY,4BAA4B,MAAM;AAChD,cAAU,mBAAmB,YAAY;AAAA,EAC3C;AACA,MAAI,YAAY,4BAA4B,MAAM;AAChD,cAAU,mBAAmB,YAAY;AAAA,EAC3C;AACA,MAAI,YAAY,2BAA2B,MAAM;AAC/C,cAAU,kBAAkB,YAAY;AAAA,EAC1C;AACA,MAAI,YAAY,yBAAyB,MAAM;AAC7C,cAAU,mBAAmB,6CAAiB,YAAY,qBAAqB;AAAA,EACjF;AACA,MAAI,YAAY,wBAAwB,MAAM;AAC5C,cAAU,kBAAkB,YAAY;AAAA,EAC1C;AACA,MAAI,YAAY,4BAA4B,MAAM;AAChD,cAAU,sBAAsB,6CAAiB,YAAY,wBAAwB;AAAA,EACvF;AACA,MAAI,YAAY,wBAAwB,MAAM;AAC5C,cAAU,kBAAkB,YAAY;AAAA,EAC1C;AACA,MAAI,YAAY,aAAa,MAAM;AACjC,cAAU,mBAAmB;AAE7B,QACE,gBAAgB,YAChB,gBAAgB,UAChB,gBAAgB,WAChB,gBAAgB,YAChB,gBAAgB,YAChB;AACA,gBAAU,WAAW;AAAA,IACvB;AAAA,EACF;AACA,MAAI,YAAY,6BAA6B,MAAM;AACjD,cAAU,uBAAuB,YAAY;AAAA,EAC/C;AACA,MAAI,YAAY,yBAAyB,MAAM;AAC7C,cAAU,mBAAmB,YAAY;AAAA,EAC3C;AACA,MAAI,YAAY,uBAAuB,MAAM;AAC3C,cAAU,iBAAiB,6CAAiB,YAAY,mBAAmB;AAAA,EAC7E;AACA,MAAI,YAAY,yBAAyB,MAAM;AAC7C,cAAU,mBAAmB,YAAY;AAAA,EAC3C;AACA,MAAI,YAAY,wBAAwB,MAAM;AAC5C,cAAU,iBAAiB,YAAY;AAAA,EACzC;AACA,MAAI,YAAY,wBAAwB,MAAM;AAC5C,cAAU,kBAAkB,YAAY;AAAA,EAC1C;AACA,MACE,YAAY,6BAA6B,QACzC,MAAM,QAAQ,YAAY,yBAAyB,GACnD;AACA,cAAU,uBAAuB,YAAY,0BAA0B,KAAK,GAAG;AAAA,EACjF;AACA,MAAI,YAAY,sBAAsB,MAAM;AAC1C,cAAU,gBAAgB,YAAY;AAAA,EACxC;AACA,MAAI,YAAY,2BAA2B,MAAM;AAC/C,cAAU,qBAAqB,6CAAiB,YAAY,uBAAuB;AAAA,EACrF;AACA,MAAI,YAAY,sBAAsB,MAAM;AAC1C,cAAU,gBAAgB,YAAY;AAAA,EACxC;AACA,MAAI,YAAY,2BAA2B,MAAM;AAC/C,cAAU,eACR,YAAY,4BAA4B,SAAS,QAAQ,YAAY;AAAA,EACzE;AACA,MAAI,YAAY,sBAAsB,MAAM;AAC1C,cAAU,gBAAgB,YAAY;AAAA,EACxC;AACA,MAAI,YAAY,0BAA0B,MAAM;AAC9C,cAAU,oBAAoB,YAAY;AAAA,EAC5C;AACA,MAAI,YAAY,gCAAgC,MAAM;AACpD,cAAU,0BAA0B,YAAY;AAAA,EAClD;AACA,MAAI,YAAY,4BAA4B,MAAM;AAChD,cAAU,sBAAsB,YAAY;AAAA,EAC9C;AACA,MAAI,YAAY,qBAAqB,MAAM;AACzC,cAAU,eAAe,6CAAiB,YAAY,iBAAiB;AAAA,EACzE;AACA,MAAI,YAAY,4BAA4B,MAAM;AAChD,cAAU,sBAAsB,YAAY;AAAA,EAC9C;AACA,MAAI,YAAY,yBAAyB,MAAM;AAC7C,cAAU,mBAAmB,YAAY;AAAA,EAC3C;AACA,MAAI,YAAY,wBAAwB,MAAM;AAC5C,cAAU,kBAAkB,YAAY;AAAA,EAC1C;AACA,MAAI,YAAY,yBAAyB,MAAM;AAC7C,cAAU,mBAAmB,YAAY;AAEzC,QAAI,gBAAgB,WAAW,gBAAgB,YAAY,gBAAgB,YAAY;AACrF,gBAAU,WAAW;AAAA,IACvB;AAAA,EACF;AACA,MAAI,YAAY,yBAAyB,MAAM;AAC7C,cAAU,mBAAmB,YAAY;AAEzC,QAAI,gBAAgB,WAAW,gBAAgB,YAAY,gBAAgB,YAAY;AACrF,gBAAU,WAAW;AAAA,IACvB;AAAA,EACF;AACA,MAAI,YAAY,gCAAgC,MAAM;AACpD,cAAU,0BAA0B,YAAY;AAAA,EAClD;AACA,MAAI,YAAY,yBAAyB,MAAM;AAC7C,cAAU,mBAAmB,YAAY;AAAA,EAC3C;AACA,MAAI,YAAY,yBAAyB,MAAM;AAC7C,cAAU,mBAAmB,YAAY;AAAA,EAC3C;AACA,MAAI,YAAY,wBAAwB,MAAM;AAC5C,cAAU,kBAAkB,YAAY;AAAA,EAC1C;AACA,MAAI,YAAY,yBAAyB,MAAM;AAC7C,cAAU,mBAAmB,YAAY;AAAA,EAC3C;AACA,MAAI,YAAY,wBAAwB,MAAM;AAC5C,cAAU,kBAAkB,YAAY;AAAA,EAC1C;AACA,MAAI,YAAY,qBAAqB,MAAM;AACzC,cAAU,eAAe,YAAY;AAAA,EACvC;AACA,MAAI,YAAY,yBAAyB,MAAM;AAC7C,cAAU,mBAAmB,YAAY;AAAA,EAC3C;AACA,MAAI,YAAY,yBAAyB,MAAM;AAC7C,cAAU,mBAAmB,YAAY;AAAA,EAC3C;AACA,MAAI,YAAY,yBAAyB,MAAM;AAC7C,cAAU,mBAAmB,YAAY;AAAA,EAC3C;AACA,MAAI,YAAY,0BAA0B,MAAM;AAC9C,cAAU,oBAAoB,YAAY;AAAA,EAC5C;AAEA,MAAI,YAAY,UAAU;AACxB,cAAU,KAAK,YAAY;AAAA,EAC7B;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -31,10 +31,10 @@ __export(platform_exports, {
|
|
|
31
31
|
module.exports = __toCommonJS(platform_exports);
|
|
32
32
|
var import_react = require("react");
|
|
33
33
|
var import_react_native = require("react-native");
|
|
34
|
-
var _a, _b
|
|
34
|
+
var _a, _b;
|
|
35
35
|
const isAndroid = ((_a = import_react_native.Platform) == null ? void 0 : _a.OS) === "android";
|
|
36
36
|
const isIOS = ((_b = import_react_native.Platform) == null ? void 0 : _b.OS) === "ios";
|
|
37
|
-
const isWeb = process.env.TAMAGUI_TARGET
|
|
37
|
+
const isWeb = process.env.TAMAGUI_TARGET === "web";
|
|
38
38
|
const isSSR = isWeb && typeof window === "undefined";
|
|
39
39
|
const isClient = isWeb && typeof window !== "undefined";
|
|
40
40
|
const useIsomorphicLayoutEffect = isSSR ? import_react.useEffect : import_react.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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA2C;AAC3C,0BAAyB;AADzB;AAGO,MAAM,YAAY,2DAAU,QAAO;AACnC,MAAM,QAAQ,2DAAU,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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA2C;AAC3C,0BAAyB;AADzB;AAGO,MAAM,YAAY,2DAAU,QAAO;AACnC,MAAM,QAAQ,2DAAU,QAAO;AAC/B,MAAM,QAAQ,QAAQ,IAAI,mBAAmB;AAC7C,MAAM,QAAQ,SAAS,OAAO,WAAW;AACzC,MAAM,WAAW,SAAS,OAAO,WAAW;AAC5C,MAAM,4BAA4B,QAAQ,yBAAY;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
|
}
|
|
@@ -52,9 +52,10 @@ __export(createComponent_exports, {
|
|
|
52
52
|
AbsoluteFill: () => AbsoluteFill,
|
|
53
53
|
Spacer: () => Spacer,
|
|
54
54
|
Unspaced: () => Unspaced,
|
|
55
|
-
|
|
55
|
+
accessibilityRoleToWebRole: () => accessibilityRoleToWebRole,
|
|
56
56
|
createComponent: () => createComponent,
|
|
57
57
|
mouseUps: () => mouseUps,
|
|
58
|
+
processIDRefList: () => processIDRefList,
|
|
58
59
|
spacedChildren: () => spacedChildren
|
|
59
60
|
});
|
|
60
61
|
module.exports = __toCommonJS(createComponent_exports);
|
|
@@ -66,6 +67,7 @@ var import_conf = require("./conf");
|
|
|
66
67
|
var import_constants = require("./constants/constants");
|
|
67
68
|
var import_platform = require("./constants/platform");
|
|
68
69
|
var import_rnw = require("./constants/rnw");
|
|
70
|
+
var import_assignNativePropsToWeb = require("./helpers/assignNativePropsToWeb");
|
|
69
71
|
var import_createPropMapper = require("./helpers/createPropMapper");
|
|
70
72
|
var import_createShallowUpdate = require("./helpers/createShallowUpdate");
|
|
71
73
|
var import_extendStaticConfig = require("./helpers/extendStaticConfig");
|
|
@@ -394,7 +396,7 @@ function createComponent(configIn, ParentComponent) {
|
|
|
394
396
|
"onLayout"
|
|
395
397
|
]);
|
|
396
398
|
viewProps = webProps;
|
|
397
|
-
assignNativePropsToWeb(elementType, viewProps, nonTamaguiProps);
|
|
399
|
+
(0, import_assignNativePropsToWeb.assignNativePropsToWeb)(elementType, viewProps, nonTamaguiProps);
|
|
398
400
|
if (!asChild) {
|
|
399
401
|
import_rnw.rnw.useElementLayout(hostRef, onLayout);
|
|
400
402
|
import_rnw.rnw.useResponderEvents(hostRef, {
|
|
@@ -478,10 +480,8 @@ function createComponent(configIn, ParentComponent) {
|
|
|
478
480
|
}
|
|
479
481
|
(0, import_platform.useIsomorphicLayoutEffect)(() => {
|
|
480
482
|
if (typeof window !== "undefined" && (hasEnterStyle || props.animation)) {
|
|
481
|
-
(
|
|
482
|
-
|
|
483
|
-
mounted: true
|
|
484
|
-
});
|
|
483
|
+
setStateShallow({
|
|
484
|
+
mounted: true
|
|
485
485
|
});
|
|
486
486
|
}
|
|
487
487
|
internal.current.isMounted = true;
|
|
@@ -743,9 +743,11 @@ function createComponent(configIn, ParentComponent) {
|
|
|
743
743
|
}
|
|
744
744
|
return content;
|
|
745
745
|
});
|
|
746
|
-
|
|
746
|
+
if (staticConfig.componentName) {
|
|
747
|
+
component.displayName = staticConfig.componentName;
|
|
748
|
+
}
|
|
747
749
|
(0, import_conf.onConfiguredOnce)((conf) => {
|
|
748
|
-
var _a, _b, _c
|
|
750
|
+
var _a, _b, _c;
|
|
749
751
|
if (process.env.IS_STATIC === "is_static") {
|
|
750
752
|
return;
|
|
751
753
|
}
|
|
@@ -756,35 +758,13 @@ function createComponent(configIn, ParentComponent) {
|
|
|
756
758
|
AnimatedView = (_c = tamaguiConfig == null ? void 0 : tamaguiConfig.animations) == null ? void 0 : _c.View;
|
|
757
759
|
initialTheme = initialTheme || (0, import_proxyThemeVariables.proxyThemeVariables)(conf.themes[conf.defaultTheme || Object.keys(conf.themes)[0]]);
|
|
758
760
|
const config = (0, import_conf.getConfig)();
|
|
759
|
-
let defaultPropsIn = staticConfig.defaultProps;
|
|
761
|
+
let defaultPropsIn = staticConfig.defaultProps || {};
|
|
760
762
|
const parentNames = [...staticConfig.parentNames || [], staticConfig.componentName];
|
|
761
|
-
if (config.defaultProps && parentNames) {
|
|
762
|
-
|
|
763
|
-
let prev;
|
|
764
|
-
for (let i = 0; i < len; i++) {
|
|
765
|
-
const n = parentNames[i];
|
|
766
|
-
if (!n)
|
|
767
|
-
continue;
|
|
768
|
-
if (DefaultProps.has(n)) {
|
|
769
|
-
prev = DefaultProps.get(n);
|
|
770
|
-
continue;
|
|
771
|
-
}
|
|
772
|
-
const props = config.defaultProps[n];
|
|
773
|
-
if (!props) {
|
|
774
|
-
if (prev) {
|
|
775
|
-
DefaultProps.set(n, prev);
|
|
776
|
-
}
|
|
777
|
-
continue;
|
|
778
|
-
}
|
|
779
|
-
prev = (0, import_mergeProps.mergeProps)(prev || {}, props)[0];
|
|
780
|
-
DefaultProps.set(n, prev);
|
|
781
|
-
}
|
|
782
|
-
const ourDefaultsMerged = DefaultProps.get(staticConfig.componentName);
|
|
783
|
-
if (ourDefaultsMerged) {
|
|
784
|
-
defaultPropsIn = (0, import_mergeProps.mergeProps)(defaultPropsIn, ourDefaultsMerged)[0];
|
|
785
|
-
}
|
|
763
|
+
if (config.defaultProps && parentNames && staticConfig.componentName) {
|
|
764
|
+
defaultPropsIn = mergeConfigDefaultProps(staticConfig.componentName, defaultPropsIn, config.defaultProps, parentNames);
|
|
786
765
|
}
|
|
787
|
-
|
|
766
|
+
const debug = process.env.NODE_ENV === "development" ? defaultPropsIn["debug"] : false;
|
|
767
|
+
if (process.env.NODE_ENV === "development" && debug === "break") {
|
|
788
768
|
debugger;
|
|
789
769
|
}
|
|
790
770
|
const [parentProps, parentClassNames] = (0, import_mergeProps.mergeProps)(defaultPropsIn, {}, true);
|
|
@@ -796,8 +776,11 @@ function createComponent(configIn, ParentComponent) {
|
|
|
796
776
|
focus: false,
|
|
797
777
|
resolveVariablesAs: "both",
|
|
798
778
|
keepVariantsAsProps: true
|
|
799
|
-
}, void 0,
|
|
779
|
+
}, void 0, debug);
|
|
800
780
|
const [defaults, defaultsClassnames] = (0, import_mergeProps.mergeProps)(component.defaultProps, initialSplitStyles.viewProps, true);
|
|
781
|
+
if (debug) {
|
|
782
|
+
console.warn(defaults, component.defaultProps, initialSplitStyles);
|
|
783
|
+
}
|
|
801
784
|
initialSplitStyles.classNames = __spreadValues(__spreadValues(__spreadValues({}, parentClassNames), defaultsClassnames), initialSplitStyles.classNames);
|
|
802
785
|
defaultNativeStyle = {};
|
|
803
786
|
const validStyles2 = staticConfig.validStyles || import_helpers.stylePropsView;
|
|
@@ -817,14 +800,15 @@ function createComponent(configIn, ParentComponent) {
|
|
|
817
800
|
if (Object.keys(defaults).length) {
|
|
818
801
|
tamaguiDefaultProps = defaults;
|
|
819
802
|
}
|
|
820
|
-
if (process.env.NODE_ENV === "development" &&
|
|
803
|
+
if (process.env.NODE_ENV === "development" && debug) {
|
|
821
804
|
if (process.env.IS_STATIC !== "is_static") {
|
|
822
805
|
console.log(`\u{1F41B} [${staticConfig.componentName || "Component"}]`, {
|
|
823
806
|
staticConfig,
|
|
824
807
|
initialSplitStyles,
|
|
825
808
|
tamaguiDefaultProps,
|
|
826
809
|
defaultNativeStyle,
|
|
827
|
-
defaults
|
|
810
|
+
defaults,
|
|
811
|
+
defaultPropsIn
|
|
828
812
|
});
|
|
829
813
|
}
|
|
830
814
|
}
|
|
@@ -848,7 +832,6 @@ function createComponent(configIn, ParentComponent) {
|
|
|
848
832
|
};
|
|
849
833
|
return res;
|
|
850
834
|
}
|
|
851
|
-
const DefaultProps = /* @__PURE__ */ new Map();
|
|
852
835
|
const Unspaced = (props) => {
|
|
853
836
|
return props.children;
|
|
854
837
|
};
|
|
@@ -995,165 +978,6 @@ const accessibilityRoleToWebRole = {
|
|
|
995
978
|
summary: "region",
|
|
996
979
|
text: null
|
|
997
980
|
};
|
|
998
|
-
function assignNativePropsToWeb(elementType, viewProps, nativeProps) {
|
|
999
|
-
if (!viewProps.role && nativeProps.accessibilityRole) {
|
|
1000
|
-
if (nativeProps.accessibilityRole === "none") {
|
|
1001
|
-
viewProps.role = "presentation";
|
|
1002
|
-
} else {
|
|
1003
|
-
const webRole = accessibilityRoleToWebRole[nativeProps.accessibilityRole];
|
|
1004
|
-
if (webRole != null) {
|
|
1005
|
-
viewProps.role = webRole || nativeProps.accessibilityRole;
|
|
1006
|
-
}
|
|
1007
|
-
}
|
|
1008
|
-
}
|
|
1009
|
-
if (nativeProps.accessibilityActiveDescendant != null) {
|
|
1010
|
-
viewProps["aria-activedescendant"] = nativeProps.accessibilityActiveDescendant;
|
|
1011
|
-
}
|
|
1012
|
-
if (nativeProps.accessibilityAtomic != null) {
|
|
1013
|
-
viewProps["aria-atomic"] = nativeProps.accessibilityAtomic;
|
|
1014
|
-
}
|
|
1015
|
-
if (nativeProps.accessibilityAutoComplete != null) {
|
|
1016
|
-
viewProps["aria-autocomplete"] = nativeProps.accessibilityAutoComplete;
|
|
1017
|
-
}
|
|
1018
|
-
if (nativeProps.accessibilityBusy != null) {
|
|
1019
|
-
viewProps["aria-busy"] = nativeProps.accessibilityBusy;
|
|
1020
|
-
}
|
|
1021
|
-
if (nativeProps.accessibilityChecked != null) {
|
|
1022
|
-
viewProps["aria-checked"] = nativeProps.accessibilityChecked;
|
|
1023
|
-
}
|
|
1024
|
-
if (nativeProps.accessibilityColumnCount != null) {
|
|
1025
|
-
viewProps["aria-colcount"] = nativeProps.accessibilityColumnCount;
|
|
1026
|
-
}
|
|
1027
|
-
if (nativeProps.accessibilityColumnIndex != null) {
|
|
1028
|
-
viewProps["aria-colindex"] = nativeProps.accessibilityColumnIndex;
|
|
1029
|
-
}
|
|
1030
|
-
if (nativeProps.accessibilityColumnSpan != null) {
|
|
1031
|
-
viewProps["aria-colspan"] = nativeProps.accessibilityColumnSpan;
|
|
1032
|
-
}
|
|
1033
|
-
if (nativeProps.accessibilityControls != null) {
|
|
1034
|
-
viewProps["aria-controls"] = processIDRefList(nativeProps.accessibilityControls);
|
|
1035
|
-
}
|
|
1036
|
-
if (nativeProps.accessibilityCurrent != null) {
|
|
1037
|
-
viewProps["aria-current"] = nativeProps.accessibilityCurrent;
|
|
1038
|
-
}
|
|
1039
|
-
if (nativeProps.accessibilityDescribedBy != null) {
|
|
1040
|
-
viewProps["aria-describedby"] = processIDRefList(nativeProps.accessibilityDescribedBy);
|
|
1041
|
-
}
|
|
1042
|
-
if (nativeProps.accessibilityDetails != null) {
|
|
1043
|
-
viewProps["aria-details"] = nativeProps.accessibilityDetails;
|
|
1044
|
-
}
|
|
1045
|
-
if (nativeProps.disabled === true) {
|
|
1046
|
-
viewProps["aria-disabled"] = true;
|
|
1047
|
-
if (elementType === "button" || elementType === "form" || elementType === "input" || elementType === "select" || elementType === "textarea") {
|
|
1048
|
-
viewProps.disabled = true;
|
|
1049
|
-
}
|
|
1050
|
-
}
|
|
1051
|
-
if (nativeProps.accessibilityErrorMessage != null) {
|
|
1052
|
-
viewProps["aria-errormessage"] = nativeProps.accessibilityErrorMessage;
|
|
1053
|
-
}
|
|
1054
|
-
if (nativeProps.accessibilityExpanded != null) {
|
|
1055
|
-
viewProps["aria-expanded"] = nativeProps.accessibilityExpanded;
|
|
1056
|
-
}
|
|
1057
|
-
if (nativeProps.accessibilityFlowTo != null) {
|
|
1058
|
-
viewProps["aria-flowto"] = processIDRefList(nativeProps.accessibilityFlowTo);
|
|
1059
|
-
}
|
|
1060
|
-
if (nativeProps.accessibilityHasPopup != null) {
|
|
1061
|
-
viewProps["aria-haspopup"] = nativeProps.accessibilityHasPopup;
|
|
1062
|
-
}
|
|
1063
|
-
if (nativeProps.accessibilityHidden === true) {
|
|
1064
|
-
viewProps["aria-hidden"] = nativeProps.accessibilityHidden;
|
|
1065
|
-
}
|
|
1066
|
-
if (nativeProps.accessibilityInvalid != null) {
|
|
1067
|
-
viewProps["aria-invalid"] = nativeProps.accessibilityInvalid;
|
|
1068
|
-
}
|
|
1069
|
-
if (nativeProps.accessibilityKeyShortcuts != null && Array.isArray(nativeProps.accessibilityKeyShortcuts)) {
|
|
1070
|
-
viewProps["aria-keyshortcuts"] = nativeProps.accessibilityKeyShortcuts.join(" ");
|
|
1071
|
-
}
|
|
1072
|
-
if (nativeProps.accessibilityLabel != null) {
|
|
1073
|
-
viewProps["aria-label"] = nativeProps.accessibilityLabel;
|
|
1074
|
-
}
|
|
1075
|
-
if (nativeProps.accessibilityLabelledBy != null) {
|
|
1076
|
-
viewProps["aria-labelledby"] = processIDRefList(nativeProps.accessibilityLabelledBy);
|
|
1077
|
-
}
|
|
1078
|
-
if (nativeProps.accessibilityLevel != null) {
|
|
1079
|
-
viewProps["aria-level"] = nativeProps.accessibilityLevel;
|
|
1080
|
-
}
|
|
1081
|
-
if (nativeProps.accessibilityLiveRegion != null) {
|
|
1082
|
-
viewProps["aria-live"] = nativeProps.accessibilityLiveRegion === "none" ? "off" : nativeProps.accessibilityLiveRegion;
|
|
1083
|
-
}
|
|
1084
|
-
if (nativeProps.accessibilityModal != null) {
|
|
1085
|
-
viewProps["aria-modal"] = nativeProps.accessibilityModal;
|
|
1086
|
-
}
|
|
1087
|
-
if (nativeProps.accessibilityMultiline != null) {
|
|
1088
|
-
viewProps["aria-multiline"] = nativeProps.accessibilityMultiline;
|
|
1089
|
-
}
|
|
1090
|
-
if (nativeProps.accessibilityMultiSelectable != null) {
|
|
1091
|
-
viewProps["aria-multiselectable"] = nativeProps.accessibilityMultiSelectable;
|
|
1092
|
-
}
|
|
1093
|
-
if (nativeProps.accessibilityOrientation != null) {
|
|
1094
|
-
viewProps["aria-orientation"] = nativeProps.accessibilityOrientation;
|
|
1095
|
-
}
|
|
1096
|
-
if (nativeProps.accessibilityOwns != null) {
|
|
1097
|
-
viewProps["aria-owns"] = processIDRefList(nativeProps.accessibilityOwns);
|
|
1098
|
-
}
|
|
1099
|
-
if (nativeProps.accessibilityPlaceholder != null) {
|
|
1100
|
-
viewProps["aria-placeholder"] = nativeProps.accessibilityPlaceholder;
|
|
1101
|
-
}
|
|
1102
|
-
if (nativeProps.accessibilityPosInSet != null) {
|
|
1103
|
-
viewProps["aria-posinset"] = nativeProps.accessibilityPosInSet;
|
|
1104
|
-
}
|
|
1105
|
-
if (nativeProps.accessibilityPressed != null) {
|
|
1106
|
-
viewProps["aria-pressed"] = nativeProps.accessibilityPressed;
|
|
1107
|
-
}
|
|
1108
|
-
if (nativeProps.accessibilityReadOnly != null) {
|
|
1109
|
-
viewProps["aria-readonly"] = nativeProps.accessibilityReadOnly;
|
|
1110
|
-
if (elementType === "input" || elementType === "select" || elementType === "textarea") {
|
|
1111
|
-
viewProps.readOnly = true;
|
|
1112
|
-
}
|
|
1113
|
-
}
|
|
1114
|
-
if (nativeProps.accessibilityRequired != null) {
|
|
1115
|
-
viewProps["aria-required"] = nativeProps.accessibilityRequired;
|
|
1116
|
-
if (elementType === "input" || elementType === "select" || elementType === "textarea") {
|
|
1117
|
-
viewProps.required = true;
|
|
1118
|
-
}
|
|
1119
|
-
}
|
|
1120
|
-
if (nativeProps.accessibilityRoleDescription != null) {
|
|
1121
|
-
viewProps["aria-roledescription"] = nativeProps.accessibilityRoleDescription;
|
|
1122
|
-
}
|
|
1123
|
-
if (nativeProps.accessibilityRowCount != null) {
|
|
1124
|
-
viewProps["aria-rowcount"] = nativeProps.accessibilityRowCount;
|
|
1125
|
-
}
|
|
1126
|
-
if (nativeProps.accessibilityRowIndex != null) {
|
|
1127
|
-
viewProps["aria-rowindex"] = nativeProps.accessibilityRowIndex;
|
|
1128
|
-
}
|
|
1129
|
-
if (nativeProps.accessibilityRowSpan != null) {
|
|
1130
|
-
viewProps["aria-rowspan"] = nativeProps.accessibilityRowSpan;
|
|
1131
|
-
}
|
|
1132
|
-
if (nativeProps.accessibilitySelected != null) {
|
|
1133
|
-
viewProps["aria-selected"] = nativeProps.accessibilitySelected;
|
|
1134
|
-
}
|
|
1135
|
-
if (nativeProps.accessibilitySetSize != null) {
|
|
1136
|
-
viewProps["aria-setsize"] = nativeProps.accessibilitySetSize;
|
|
1137
|
-
}
|
|
1138
|
-
if (nativeProps.accessibilitySort != null) {
|
|
1139
|
-
viewProps["aria-sort"] = nativeProps.accessibilitySort;
|
|
1140
|
-
}
|
|
1141
|
-
if (nativeProps.accessibilityValueMax != null) {
|
|
1142
|
-
viewProps["aria-valuemax"] = nativeProps.accessibilityValueMax;
|
|
1143
|
-
}
|
|
1144
|
-
if (nativeProps.accessibilityValueMin != null) {
|
|
1145
|
-
viewProps["aria-valuemin"] = nativeProps.accessibilityValueMin;
|
|
1146
|
-
}
|
|
1147
|
-
if (nativeProps.accessibilityValueNow != null) {
|
|
1148
|
-
viewProps["aria-valuenow"] = nativeProps.accessibilityValueNow;
|
|
1149
|
-
}
|
|
1150
|
-
if (nativeProps.accessibilityValueText != null) {
|
|
1151
|
-
viewProps["aria-valuetext"] = nativeProps.accessibilityValueText;
|
|
1152
|
-
}
|
|
1153
|
-
if (nativeProps.nativeID) {
|
|
1154
|
-
viewProps.id = nativeProps.nativeID;
|
|
1155
|
-
}
|
|
1156
|
-
}
|
|
1157
981
|
function addPseudoToStyles(styles, initialPseudos, pseudos, name, force = false) {
|
|
1158
982
|
const pseudoStyle = pseudos[name];
|
|
1159
983
|
const shouldNestObject = import_platform.isWeb && name !== "enterStyle" && name !== "exitStyle";
|
|
@@ -1163,14 +987,44 @@ function addPseudoToStyles(styles, initialPseudos, pseudos, name, force = false)
|
|
|
1163
987
|
styles.push(shouldNestObject && !force ? { [name]: style } : style);
|
|
1164
988
|
}
|
|
1165
989
|
}
|
|
990
|
+
const DefaultProps = /* @__PURE__ */ new Map();
|
|
991
|
+
function mergeConfigDefaultProps(name, props, configDefaults, parentNames) {
|
|
992
|
+
const len = parentNames.length;
|
|
993
|
+
let prev;
|
|
994
|
+
for (let i = 0; i < len; i++) {
|
|
995
|
+
const n = parentNames[i];
|
|
996
|
+
if (!n)
|
|
997
|
+
continue;
|
|
998
|
+
if (DefaultProps.has(n)) {
|
|
999
|
+
prev = DefaultProps.get(n);
|
|
1000
|
+
continue;
|
|
1001
|
+
}
|
|
1002
|
+
const props2 = configDefaults[n];
|
|
1003
|
+
if (!props2) {
|
|
1004
|
+
if (prev) {
|
|
1005
|
+
DefaultProps.set(n, prev);
|
|
1006
|
+
}
|
|
1007
|
+
continue;
|
|
1008
|
+
}
|
|
1009
|
+
prev = (0, import_mergeProps.mergeProps)(prev || {}, props2)[0];
|
|
1010
|
+
console.log("set prev", prev);
|
|
1011
|
+
DefaultProps.set(n, prev);
|
|
1012
|
+
}
|
|
1013
|
+
const ourDefaultsMerged = DefaultProps.get(name);
|
|
1014
|
+
if (ourDefaultsMerged) {
|
|
1015
|
+
return (0, import_mergeProps.mergeProps)(props, ourDefaultsMerged)[0];
|
|
1016
|
+
}
|
|
1017
|
+
return props;
|
|
1018
|
+
}
|
|
1166
1019
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1167
1020
|
0 && (module.exports = {
|
|
1168
1021
|
AbsoluteFill,
|
|
1169
1022
|
Spacer,
|
|
1170
1023
|
Unspaced,
|
|
1171
|
-
|
|
1024
|
+
accessibilityRoleToWebRole,
|
|
1172
1025
|
createComponent,
|
|
1173
1026
|
mouseUps,
|
|
1027
|
+
processIDRefList,
|
|
1174
1028
|
spacedChildren
|
|
1175
1029
|
});
|
|
1176
1030
|
//# sourceMappingURL=createComponent.js.map
|