@tamagui/core 1.116.1 → 1.116.3

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.
Files changed (29) hide show
  1. package/dist/cjs/createOptimizedView.js +22 -0
  2. package/dist/cjs/getBaseViews.js +23 -0
  3. package/dist/cjs/helpers/getBoundingClientRect.js +24 -0
  4. package/dist/cjs/helpers/getRect.js +27 -0
  5. package/dist/cjs/hooks/useElementLayout.js +100 -0
  6. package/dist/cjs/index.js +79 -0
  7. package/dist/cjs/inject-styles.js +28 -0
  8. package/dist/cjs/reactNativeTypes.js +14 -0
  9. package/dist/cjs/vendor/Pressability.js +22 -0
  10. package/dist/native.js +3 -3
  11. package/dist/native.js.map +3 -3
  12. package/dist/test.native.js +2 -2
  13. package/dist/test.native.js.map +3 -3
  14. package/package.json +6 -6
  15. package/dist/cjs/createOptimizedView.native.cjs +0 -245
  16. package/dist/cjs/createOptimizedView.native.cjs.map +0 -6
  17. package/dist/cjs/getBaseViews.native.cjs +0 -36
  18. package/dist/cjs/getBaseViews.native.cjs.map +0 -6
  19. package/dist/cjs/vendor/Pressability.native.cjs +0 -28
  20. package/dist/cjs/vendor/Pressability.native.cjs.map +0 -6
  21. /package/dist/cjs/{createOptimizedView.cjs.map → createOptimizedView.js.map} +0 -0
  22. /package/dist/cjs/{getBaseViews.cjs.map → getBaseViews.js.map} +0 -0
  23. /package/dist/cjs/helpers/{getBoundingClientRect.cjs.map → getBoundingClientRect.js.map} +0 -0
  24. /package/dist/cjs/helpers/{getRect.cjs.map → getRect.js.map} +0 -0
  25. /package/dist/cjs/hooks/{useElementLayout.cjs.map → useElementLayout.js.map} +0 -0
  26. /package/dist/cjs/{index.cjs.map → index.js.map} +0 -0
  27. /package/dist/cjs/{inject-styles.cjs.map → inject-styles.js.map} +0 -0
  28. /package/dist/cjs/{reactNativeTypes.cjs.map → reactNativeTypes.js.map} +0 -0
  29. /package/dist/cjs/vendor/{Pressability.cjs.map → Pressability.js.map} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/core",
3
- "version": "1.116.1",
3
+ "version": "1.116.3",
4
4
  "source": "src/index.tsx",
5
5
  "main": "dist/cjs",
6
6
  "module": "dist/esm",
@@ -35,13 +35,13 @@
35
35
  "native-test.d.ts"
36
36
  ],
37
37
  "dependencies": {
38
- "@tamagui/react-native-use-pressable": "1.116.1",
39
- "@tamagui/react-native-use-responder-events": "1.116.1",
40
- "@tamagui/use-event": "1.116.1",
41
- "@tamagui/web": "1.116.1"
38
+ "@tamagui/react-native-use-pressable": "1.116.3",
39
+ "@tamagui/react-native-use-responder-events": "1.116.3",
40
+ "@tamagui/use-event": "1.116.3",
41
+ "@tamagui/web": "1.116.3"
42
42
  },
43
43
  "devDependencies": {
44
- "@tamagui/build": "1.116.1",
44
+ "@tamagui/build": "1.116.3",
45
45
  "@testing-library/react": "^16.0.1",
46
46
  "csstype": "^3.0.10",
47
47
  "typescript": "^5.5.2",
@@ -1,245 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf,
6
- __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all) __defProp(target, name, {
9
- get: all[name],
10
- enumerable: !0
11
- });
12
- },
13
- __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
15
- get: () => from[key],
16
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
- });
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
26
- value: mod,
27
- enumerable: !0
28
- }) : target, mod)),
29
- __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
30
- value: !0
31
- }), mod);
32
- var createOptimizedView_native_exports = {};
33
- __export(createOptimizedView_native_exports, {
34
- createOptimizedView: () => createOptimizedView,
35
- getAccessibilityRoleFromRole: () => getAccessibilityRoleFromRole
36
- });
37
- module.exports = __toCommonJS(createOptimizedView_native_exports);
38
- var import_react = __toESM(require("react"));
39
- function createOptimizedView(children, viewProps, baseViews) {
40
- const TextAncestor = baseViews.TextAncestor,
41
- ViewNativeComponent = baseViews.View,
42
- {
43
- accessibilityElementsHidden,
44
- accessibilityLabel,
45
- accessibilityLabelledBy,
46
- accessibilityLiveRegion,
47
- accessibilityRole,
48
- accessibilityState,
49
- accessibilityValue,
50
- "aria-busy": ariaBusy,
51
- "aria-checked": ariaChecked,
52
- "aria-disabled": ariaDisabled,
53
- "aria-expanded": ariaExpanded,
54
- "aria-hidden": ariaHidden,
55
- "aria-label": ariaLabel,
56
- "aria-labelledby": ariaLabelledBy,
57
- "aria-live": ariaLive,
58
- "aria-selected": ariaSelected,
59
- "aria-valuemax": ariaValueMax,
60
- "aria-valuemin": ariaValueMin,
61
- "aria-valuenow": ariaValueNow,
62
- "aria-valuetext": ariaValueText,
63
- focusable,
64
- id,
65
- importantForAccessibility,
66
- nativeID,
67
- pointerEvents,
68
- role,
69
- tabIndex
70
- // ...otherProps
71
- } = viewProps,
72
- _accessibilityLabelledBy = ariaLabelledBy?.split(/\s*,\s*/g) ?? accessibilityLabelledBy;
73
- let _accessibilityState;
74
- (accessibilityState != null || ariaBusy != null || ariaChecked != null || ariaDisabled != null || ariaExpanded != null || ariaSelected != null) && (_accessibilityState = {
75
- busy: ariaBusy ?? accessibilityState?.busy,
76
- checked: ariaChecked ?? accessibilityState?.checked,
77
- disabled: ariaDisabled ?? accessibilityState?.disabled,
78
- expanded: ariaExpanded ?? accessibilityState?.expanded,
79
- selected: ariaSelected ?? accessibilityState?.selected
80
- });
81
- let _accessibilityValue;
82
- (accessibilityValue != null || ariaValueMax != null || ariaValueMin != null || ariaValueNow != null || ariaValueText != null) && (_accessibilityValue = {
83
- max: ariaValueMax ?? accessibilityValue?.max,
84
- min: ariaValueMin ?? accessibilityValue?.min,
85
- now: ariaValueNow ?? accessibilityValue?.now,
86
- text: ariaValueText ?? accessibilityValue?.text
87
- });
88
- let style = Array.isArray(viewProps.style) ? baseViews.StyleSheet.flatten(viewProps.style) : viewProps.style;
89
- const newPointerEvents = style?.pointerEvents || pointerEvents,
90
- finalProps = viewProps,
91
- extras = {
92
- accessibilityLiveRegion: ariaLive === "off" ? "none" : ariaLive ?? accessibilityLiveRegion,
93
- accessibilityLabel: ariaLabel ?? accessibilityLabel,
94
- focusable: tabIndex !== void 0 ? !tabIndex : focusable,
95
- accessibilityState: _accessibilityState,
96
- accessibilityRole: role ? getAccessibilityRoleFromRole(role) : accessibilityRole,
97
- accessibilityElementsHidden: ariaHidden ?? accessibilityElementsHidden,
98
- accessibilityLabelledBy: _accessibilityLabelledBy,
99
- accessibilityValue: _accessibilityValue,
100
- importantForAccessibility: ariaHidden === !0 ? "no-hide-descendants" : importantForAccessibility,
101
- nativeID: id ?? nativeID,
102
- style,
103
- pointerEvents: newPointerEvents
104
- };
105
- for (const key in extras) extras[key] != null && (finalProps[key] = extras[key]);
106
- const isInText = import_react.default.useContext(TextAncestor),
107
- finalElement = import_react.default.createElement(ViewNativeComponent, finalProps, children);
108
- return isInText ? import_react.default.createElement(TextAncestor.Provider, {
109
- value: !1
110
- }, finalElement) : finalElement;
111
- }
112
- function getAccessibilityRoleFromRole(role) {
113
- switch (role) {
114
- case "alert":
115
- return "alert";
116
- case "alertdialog":
117
- return;
118
- case "application":
119
- return;
120
- case "article":
121
- return;
122
- case "banner":
123
- return;
124
- case "button":
125
- return "button";
126
- case "cell":
127
- return;
128
- case "checkbox":
129
- return "checkbox";
130
- case "columnheader":
131
- return;
132
- case "combobox":
133
- return "combobox";
134
- case "complementary":
135
- return;
136
- case "contentinfo":
137
- return;
138
- case "definition":
139
- return;
140
- case "dialog":
141
- return;
142
- case "directory":
143
- return;
144
- case "document":
145
- return;
146
- case "feed":
147
- return;
148
- case "figure":
149
- return;
150
- case "form":
151
- return;
152
- case "grid":
153
- return "grid";
154
- case "group":
155
- return;
156
- case "heading":
157
- return "header";
158
- case "img":
159
- return "image";
160
- case "link":
161
- return "link";
162
- case "list":
163
- return "list";
164
- case "listitem":
165
- return;
166
- case "log":
167
- return;
168
- case "main":
169
- return;
170
- case "marquee":
171
- return;
172
- case "math":
173
- return;
174
- case "menu":
175
- return "menu";
176
- case "menubar":
177
- return "menubar";
178
- case "menuitem":
179
- return "menuitem";
180
- case "meter":
181
- return;
182
- case "navigation":
183
- return;
184
- case "none":
185
- return "none";
186
- case "note":
187
- return;
188
- case "option":
189
- return;
190
- case "presentation":
191
- return "none";
192
- case "progressbar":
193
- return "progressbar";
194
- case "radio":
195
- return "radio";
196
- case "radiogroup":
197
- return "radiogroup";
198
- case "region":
199
- return;
200
- case "row":
201
- return;
202
- case "rowgroup":
203
- return;
204
- case "rowheader":
205
- return;
206
- case "scrollbar":
207
- return "scrollbar";
208
- case "searchbox":
209
- return "search";
210
- case "separator":
211
- return;
212
- case "slider":
213
- return "adjustable";
214
- case "spinbutton":
215
- return "spinbutton";
216
- case "status":
217
- return;
218
- case "summary":
219
- return "summary";
220
- case "switch":
221
- return "switch";
222
- case "tab":
223
- return "tab";
224
- case "table":
225
- return;
226
- case "tablist":
227
- return "tablist";
228
- case "tabpanel":
229
- return;
230
- case "term":
231
- return;
232
- case "timer":
233
- return "timer";
234
- case "toolbar":
235
- return "toolbar";
236
- case "tooltip":
237
- return;
238
- case "tree":
239
- return;
240
- case "treegrid":
241
- return;
242
- case "treeitem":
243
- return;
244
- }
245
- }
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H;AAAA,IACF,KAAK;AACH;AAAA,IACF,KAAK;AACH;AAAA,IACF,KAAK;AACH;AAAA,IACF,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH;AAAA,IACF,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH;AAAA,IACF,KAAK;AACH;AAAA,IACF,KAAK;AACH;AAAA,IACF,KAAK;AACH;AAAA,IACF,KAAK;AACH;AAAA,IACF,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH;AAAA,IACF,KAAK;AACH;AAAA,IACF,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH;AAAA,IACF,KAAK;AACH;AAAA,IACF,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH;AAAA,IACF,KAAK;AACH;AAAA,IACF,KAAK;AACH;AAAA,IACF,KAAK;AACH;AAAA,IACF,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH;AAAA,IACF,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH;AAAA,IACF,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH;AAAA,IACF,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH;AAAA,IACF,KAAK;AACH;AAAA,IACF,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH;AAAA,IACF,KAAK;AACH;AAAA,IACF,KAAK;AACH;AAAA,IACF,KAAK;AACH;AAAA,EACJ;AAGF;",
5
- "names": ["React"]
6
- }
@@ -1,36 +0,0 @@
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) __defProp(target, name, {
7
- get: all[name],
8
- enumerable: !0
9
- });
10
- },
11
- __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
13
- get: () => from[key],
14
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
- });
16
- return to;
17
- };
18
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
19
- value: !0
20
- }), mod);
21
- var getBaseViews_native_exports = {};
22
- __export(getBaseViews_native_exports, {
23
- getBaseViews: () => getBaseViews
24
- });
25
- module.exports = __toCommonJS(getBaseViews_native_exports);
26
- function getBaseViews() {
27
- const native = require("react-native-web");
28
- let View, TextAncestor;
29
- return process.env.NODE_ENV !== "test" && (View = require("react-native/Libraries/Components/View/ViewNativeComponent").default, TextAncestor = require("react-native/Libraries/Text/TextAncestor")), View || (View = native.View || native.default.View), {
30
- View,
31
- Text: native.Text || native.default.Text,
32
- StyleSheet: native.StyleSheet || native.default.StyleSheet,
33
- TextAncestor,
34
- Pressable: native.Pressable || native.default.Pressable
35
- };
36
- }
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/getBaseViews.native.ts"],
4
- "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,SAAS,eAAe;AAC7B,QAAM,SAAS,QAAQ,cAAc;AAErC,MAAI,MACA;AAEJ,SAAI,QAAQ,IAAI,aAAa,WAC3B,OAAO,QAAQ,4DAA4D,EAAE,SAC7E,eAAe,QAAQ,0CAA0C,IAG9D,SACH,OAAO,OAAO,QAAQ,OAAO,QAAQ,OAGhC;AAAA,IACL;AAAA,IACA,MAAM,OAAO,QAAQ,OAAO,QAAQ;AAAA,IACpC,YAAY,OAAO,cAAc,OAAO,QAAQ;AAAA,IAChD;AAAA,IACA,WAAW,OAAO,aAAa,OAAO,QAAQ;AAAA,EAChD;AACF;",
5
- "names": []
6
- }
@@ -1,28 +0,0 @@
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) __defProp(target, name, {
7
- get: all[name],
8
- enumerable: !0
9
- });
10
- },
11
- __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
13
- get: () => from[key],
14
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
- });
16
- return to;
17
- };
18
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
19
- value: !0
20
- }), mod);
21
- var Pressability_native_exports = {};
22
- __export(Pressability_native_exports, {
23
- Pressability: () => Pressability,
24
- usePressability: () => usePressability
25
- });
26
- module.exports = __toCommonJS(Pressability_native_exports);
27
- const Pressability = require("react-native/Libraries/Pressability/Pressability").default,
28
- usePressability = require("react-native/Libraries/Pressability/usePressability").default;
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/vendor/Pressability.native.tsx"],
4
- "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,eACX,QAAQ,kDAAkD,EAAE,SACjD,kBACX,QAAQ,qDAAqD,EAAE;",
5
- "names": []
6
- }
File without changes