@tamagui/core 1.64.4 → 1.65.1
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/native.js +858 -681
- package/dist/native.js.map +3 -3
- package/dist/test.native.js +6479 -0
- package/dist/test.native.js.map +6 -0
- package/package.json +13 -7
- package/dist/cjs/native.js +0 -20
- package/dist/cjs/native.js.map +0 -6
- package/src/native.ts +0 -1
package/dist/native.js
CHANGED
|
@@ -27,6 +27,681 @@ var __export = (target, all) => {
|
|
|
27
27
|
mod
|
|
28
28
|
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
29
29
|
|
|
30
|
+
// ../react-native-use-responder-events/dist/cjs/utils.native.js
|
|
31
|
+
var require_utils_native = __commonJS({
|
|
32
|
+
"../react-native-use-responder-events/dist/cjs/utils.native.js"(exports, module2) {
|
|
33
|
+
"use strict";
|
|
34
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
35
|
+
for (var name in all)
|
|
36
|
+
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
37
|
+
}, __copyProps2 = (to, from, except, desc) => {
|
|
38
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
39
|
+
for (let key of __getOwnPropNames2(from))
|
|
40
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
41
|
+
return to;
|
|
42
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), utils_exports = {};
|
|
43
|
+
__export2(utils_exports, {
|
|
44
|
+
canUseDOM: () => canUseDOM,
|
|
45
|
+
getBoundingClientRect: () => getBoundingClientRect2,
|
|
46
|
+
getLowestCommonAncestor: () => getLowestCommonAncestor,
|
|
47
|
+
getResponderPaths: () => getResponderPaths,
|
|
48
|
+
hasTargetTouches: () => hasTargetTouches,
|
|
49
|
+
hasValidSelection: () => hasValidSelection,
|
|
50
|
+
isPrimaryPointerDown: () => isPrimaryPointerDown,
|
|
51
|
+
isSelectionValid: () => isSelectionValid,
|
|
52
|
+
setResponderId: () => setResponderId
|
|
53
|
+
});
|
|
54
|
+
module2.exports = __toCommonJS2(utils_exports);
|
|
55
|
+
var keyName = "__reactResponderId", canUseDOM = !!(typeof window < "u" && window.document && window.document.createElement), getBoundingClientRect2 = (node) => {
|
|
56
|
+
if (node && node.nodeType === 1 && node.getBoundingClientRect)
|
|
57
|
+
return node.getBoundingClientRect();
|
|
58
|
+
};
|
|
59
|
+
function getEventPath(domEvent) {
|
|
60
|
+
var _a;
|
|
61
|
+
if (domEvent.type === "selectionchange") {
|
|
62
|
+
let target = (_a = window.getSelection()) == null ? void 0 : _a.anchorNode;
|
|
63
|
+
return composedPathFallback(target);
|
|
64
|
+
} else
|
|
65
|
+
return domEvent.composedPath != null ? domEvent.composedPath() : composedPathFallback(domEvent.target);
|
|
66
|
+
}
|
|
67
|
+
function composedPathFallback(target) {
|
|
68
|
+
let path = [];
|
|
69
|
+
for (; target != null && target !== document.body; )
|
|
70
|
+
path.push(target), target = target.parentNode;
|
|
71
|
+
return path;
|
|
72
|
+
}
|
|
73
|
+
function getResponderId(node) {
|
|
74
|
+
return node != null ? node[keyName] : null;
|
|
75
|
+
}
|
|
76
|
+
function setResponderId(node, id) {
|
|
77
|
+
node != null && (node[keyName] = id);
|
|
78
|
+
}
|
|
79
|
+
function getResponderPaths(domEvent) {
|
|
80
|
+
let idPath = [], nodePath = [], eventPath = getEventPath(domEvent);
|
|
81
|
+
for (let i = 0; i < eventPath.length; i++) {
|
|
82
|
+
let node = eventPath[i], id = getResponderId(node);
|
|
83
|
+
id != null && (idPath.push(id), nodePath.push(node));
|
|
84
|
+
}
|
|
85
|
+
return { idPath, nodePath };
|
|
86
|
+
}
|
|
87
|
+
function getLowestCommonAncestor(pathA, pathB) {
|
|
88
|
+
let pathALength = pathA.length, pathBLength = pathB.length;
|
|
89
|
+
if (
|
|
90
|
+
// If either path is empty
|
|
91
|
+
pathALength === 0 || pathBLength === 0 || // If the last elements aren't the same there can't be a common ancestor
|
|
92
|
+
// that is connected to the responder system
|
|
93
|
+
pathA[pathALength - 1] !== pathB[pathBLength - 1]
|
|
94
|
+
)
|
|
95
|
+
return null;
|
|
96
|
+
let itemA = pathA[0], indexA = 0, itemB = pathB[0], indexB = 0;
|
|
97
|
+
pathALength - pathBLength > 0 && (indexA = pathALength - pathBLength, itemA = pathA[indexA], pathALength = pathBLength), pathBLength - pathALength > 0 && (indexB = pathBLength - pathALength, itemB = pathB[indexB], pathBLength = pathALength);
|
|
98
|
+
let depth = pathALength;
|
|
99
|
+
for (; depth--; ) {
|
|
100
|
+
if (itemA === itemB)
|
|
101
|
+
return itemA;
|
|
102
|
+
itemA = pathA[indexA++], itemB = pathB[indexB++];
|
|
103
|
+
}
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
106
|
+
function hasTargetTouches(target, touches) {
|
|
107
|
+
if (!touches || touches.length === 0)
|
|
108
|
+
return !1;
|
|
109
|
+
for (let i = 0; i < touches.length; i++) {
|
|
110
|
+
let node = touches[i].target;
|
|
111
|
+
if (node != null && target.contains(node))
|
|
112
|
+
return !0;
|
|
113
|
+
}
|
|
114
|
+
return !1;
|
|
115
|
+
}
|
|
116
|
+
function hasValidSelection(domEvent) {
|
|
117
|
+
return domEvent.type === "selectionchange" ? isSelectionValid() : domEvent.type === "select";
|
|
118
|
+
}
|
|
119
|
+
function isPrimaryPointerDown(domEvent) {
|
|
120
|
+
let { altKey, button, buttons, ctrlKey, type } = domEvent, isTouch = type === "touchstart" || type === "touchmove", isPrimaryMouseDown = type === "mousedown" && (button === 0 || buttons === 1), isPrimaryMouseMove = type === "mousemove" && buttons === 1, noModifiers = altKey === !1 && ctrlKey === !1;
|
|
121
|
+
return !!(isTouch || isPrimaryMouseDown && noModifiers || isPrimaryMouseMove && noModifiers);
|
|
122
|
+
}
|
|
123
|
+
function isSelectionValid() {
|
|
124
|
+
let selection = window.getSelection();
|
|
125
|
+
if (!selection)
|
|
126
|
+
return !1;
|
|
127
|
+
let string = selection.toString(), anchorNode = selection.anchorNode, focusNode = selection.focusNode, isTextNode = anchorNode && anchorNode.nodeType === window.Node.TEXT_NODE || focusNode && focusNode.nodeType === window.Node.TEXT_NODE;
|
|
128
|
+
return string.length >= 1 && string !== `
|
|
129
|
+
` && !!isTextNode;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
// ../react-native-use-responder-events/dist/cjs/createResponderEvent.native.js
|
|
135
|
+
var require_createResponderEvent_native = __commonJS({
|
|
136
|
+
"../react-native-use-responder-events/dist/cjs/createResponderEvent.native.js"(exports, module2) {
|
|
137
|
+
"use strict";
|
|
138
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
139
|
+
for (var name in all)
|
|
140
|
+
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
141
|
+
}, __copyProps2 = (to, from, except, desc) => {
|
|
142
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
143
|
+
for (let key of __getOwnPropNames2(from))
|
|
144
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
145
|
+
return to;
|
|
146
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), createResponderEvent_exports = {};
|
|
147
|
+
__export2(createResponderEvent_exports, {
|
|
148
|
+
default: () => createResponderEvent
|
|
149
|
+
});
|
|
150
|
+
module2.exports = __toCommonJS2(createResponderEvent_exports);
|
|
151
|
+
var import_utils = require_utils_native(), emptyFunction = () => {
|
|
152
|
+
}, emptyObject = {}, emptyArray = [];
|
|
153
|
+
function normalizeIdentifier(identifier) {
|
|
154
|
+
return identifier > 20 ? identifier % 20 : identifier;
|
|
155
|
+
}
|
|
156
|
+
function createResponderEvent(domEvent, responderTouchHistoryStore) {
|
|
157
|
+
let rect, propagationWasStopped = !1, changedTouches, touches, domEventChangedTouches = domEvent.changedTouches, domEventType = domEvent.type, metaKey = domEvent.metaKey === !0, shiftKey = domEvent.shiftKey === !0, force = (domEventChangedTouches == null ? void 0 : domEventChangedTouches[0].force) || 0, identifier = normalizeIdentifier((domEventChangedTouches == null ? void 0 : domEventChangedTouches[0].identifier) || 0), clientX = (domEventChangedTouches == null ? void 0 : domEventChangedTouches[0].clientX) || domEvent.clientX, clientY = (domEventChangedTouches == null ? void 0 : domEventChangedTouches[0].clientY) || domEvent.clientY, pageX = (domEventChangedTouches == null ? void 0 : domEventChangedTouches[0].pageX) || domEvent.pageX, pageY = (domEventChangedTouches == null ? void 0 : domEventChangedTouches[0].pageY) || domEvent.pageY, preventDefault = typeof domEvent.preventDefault == "function" ? domEvent.preventDefault.bind(domEvent) : emptyFunction, timestamp = domEvent.timeStamp;
|
|
158
|
+
function normalizeTouches(touches2) {
|
|
159
|
+
return Array.prototype.slice.call(touches2).map((touch) => ({
|
|
160
|
+
force: touch.force,
|
|
161
|
+
identifier: normalizeIdentifier(touch.identifier),
|
|
162
|
+
get locationX() {
|
|
163
|
+
return locationX(touch.clientX);
|
|
164
|
+
},
|
|
165
|
+
get locationY() {
|
|
166
|
+
return locationY(touch.clientY);
|
|
167
|
+
},
|
|
168
|
+
pageX: touch.pageX,
|
|
169
|
+
pageY: touch.pageY,
|
|
170
|
+
target: touch.target,
|
|
171
|
+
timestamp
|
|
172
|
+
}));
|
|
173
|
+
}
|
|
174
|
+
if (domEventChangedTouches != null)
|
|
175
|
+
changedTouches = normalizeTouches(domEventChangedTouches), touches = normalizeTouches(domEvent.touches);
|
|
176
|
+
else {
|
|
177
|
+
let emulatedTouches = [
|
|
178
|
+
{
|
|
179
|
+
force,
|
|
180
|
+
identifier,
|
|
181
|
+
get locationX() {
|
|
182
|
+
return locationX(clientX);
|
|
183
|
+
},
|
|
184
|
+
get locationY() {
|
|
185
|
+
return locationY(clientY);
|
|
186
|
+
},
|
|
187
|
+
pageX,
|
|
188
|
+
pageY,
|
|
189
|
+
target: domEvent.target,
|
|
190
|
+
timestamp
|
|
191
|
+
}
|
|
192
|
+
];
|
|
193
|
+
changedTouches = emulatedTouches, touches = domEventType === "mouseup" || domEventType === "dragstart" ? emptyArray : emulatedTouches;
|
|
194
|
+
}
|
|
195
|
+
let responderEvent = {
|
|
196
|
+
bubbles: !0,
|
|
197
|
+
cancelable: !0,
|
|
198
|
+
// `currentTarget` is set before dispatch
|
|
199
|
+
currentTarget: null,
|
|
200
|
+
defaultPrevented: domEvent.defaultPrevented,
|
|
201
|
+
dispatchConfig: emptyObject,
|
|
202
|
+
eventPhase: domEvent.eventPhase,
|
|
203
|
+
isDefaultPrevented() {
|
|
204
|
+
return domEvent.defaultPrevented;
|
|
205
|
+
},
|
|
206
|
+
isPropagationStopped() {
|
|
207
|
+
return propagationWasStopped;
|
|
208
|
+
},
|
|
209
|
+
isTrusted: domEvent.isTrusted,
|
|
210
|
+
nativeEvent: {
|
|
211
|
+
altKey: !1,
|
|
212
|
+
ctrlKey: !1,
|
|
213
|
+
metaKey,
|
|
214
|
+
shiftKey,
|
|
215
|
+
changedTouches,
|
|
216
|
+
force,
|
|
217
|
+
identifier,
|
|
218
|
+
get locationX() {
|
|
219
|
+
return locationX(clientX);
|
|
220
|
+
},
|
|
221
|
+
get locationY() {
|
|
222
|
+
return locationY(clientY);
|
|
223
|
+
},
|
|
224
|
+
pageX,
|
|
225
|
+
pageY,
|
|
226
|
+
target: domEvent.target,
|
|
227
|
+
timestamp,
|
|
228
|
+
touches,
|
|
229
|
+
type: domEventType
|
|
230
|
+
},
|
|
231
|
+
persist: emptyFunction,
|
|
232
|
+
preventDefault,
|
|
233
|
+
stopPropagation() {
|
|
234
|
+
propagationWasStopped = !0;
|
|
235
|
+
},
|
|
236
|
+
target: domEvent.target,
|
|
237
|
+
timeStamp: timestamp,
|
|
238
|
+
touchHistory: responderTouchHistoryStore.touchHistory
|
|
239
|
+
};
|
|
240
|
+
function locationX(x) {
|
|
241
|
+
if (rect = rect || (0, import_utils.getBoundingClientRect)(responderEvent.currentTarget), rect)
|
|
242
|
+
return x - rect.left;
|
|
243
|
+
}
|
|
244
|
+
function locationY(y) {
|
|
245
|
+
if (rect = rect || (0, import_utils.getBoundingClientRect)(responderEvent.currentTarget), rect)
|
|
246
|
+
return y - rect.top;
|
|
247
|
+
}
|
|
248
|
+
return responderEvent;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
});
|
|
252
|
+
|
|
253
|
+
// ../react-native-use-responder-events/dist/cjs/types.native.js
|
|
254
|
+
var require_types_native = __commonJS({
|
|
255
|
+
"../react-native-use-responder-events/dist/cjs/types.native.js"(exports, module2) {
|
|
256
|
+
"use strict";
|
|
257
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
258
|
+
for (var name in all)
|
|
259
|
+
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
260
|
+
}, __copyProps2 = (to, from, except, desc) => {
|
|
261
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
262
|
+
for (let key of __getOwnPropNames2(from))
|
|
263
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
264
|
+
return to;
|
|
265
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), types_exports = {};
|
|
266
|
+
__export2(types_exports, {
|
|
267
|
+
BLUR: () => BLUR,
|
|
268
|
+
CONTEXT_MENU: () => CONTEXT_MENU,
|
|
269
|
+
FOCUS_OUT: () => FOCUS_OUT,
|
|
270
|
+
MOUSE_CANCEL: () => MOUSE_CANCEL,
|
|
271
|
+
MOUSE_DOWN: () => MOUSE_DOWN,
|
|
272
|
+
MOUSE_MOVE: () => MOUSE_MOVE,
|
|
273
|
+
MOUSE_UP: () => MOUSE_UP,
|
|
274
|
+
SCROLL: () => SCROLL,
|
|
275
|
+
SELECT: () => SELECT,
|
|
276
|
+
SELECTION_CHANGE: () => SELECTION_CHANGE,
|
|
277
|
+
TOUCH_CANCEL: () => TOUCH_CANCEL,
|
|
278
|
+
TOUCH_END: () => TOUCH_END,
|
|
279
|
+
TOUCH_MOVE: () => TOUCH_MOVE,
|
|
280
|
+
TOUCH_START: () => TOUCH_START,
|
|
281
|
+
isCancelish: () => isCancelish,
|
|
282
|
+
isEndish: () => isEndish,
|
|
283
|
+
isMoveish: () => isMoveish,
|
|
284
|
+
isScroll: () => isScroll,
|
|
285
|
+
isSelectionChange: () => isSelectionChange,
|
|
286
|
+
isStartish: () => isStartish
|
|
287
|
+
});
|
|
288
|
+
module2.exports = __toCommonJS2(types_exports);
|
|
289
|
+
var BLUR = "blur", CONTEXT_MENU = "contextmenu", FOCUS_OUT = "focusout", MOUSE_DOWN = "mousedown", MOUSE_MOVE = "mousemove", MOUSE_UP = "mouseup", MOUSE_CANCEL = "dragstart", TOUCH_START = "touchstart", TOUCH_MOVE = "touchmove", TOUCH_END = "touchend", TOUCH_CANCEL = "touchcancel", SCROLL = "scroll", SELECT = "select", SELECTION_CHANGE = "selectionchange";
|
|
290
|
+
function isStartish(eventType) {
|
|
291
|
+
return eventType === TOUCH_START || eventType === MOUSE_DOWN;
|
|
292
|
+
}
|
|
293
|
+
function isMoveish(eventType) {
|
|
294
|
+
return eventType === TOUCH_MOVE || eventType === MOUSE_MOVE;
|
|
295
|
+
}
|
|
296
|
+
function isEndish(eventType) {
|
|
297
|
+
return eventType === TOUCH_END || eventType === MOUSE_UP || isCancelish(eventType);
|
|
298
|
+
}
|
|
299
|
+
function isCancelish(eventType) {
|
|
300
|
+
return eventType === TOUCH_CANCEL || eventType === MOUSE_CANCEL;
|
|
301
|
+
}
|
|
302
|
+
function isScroll(eventType) {
|
|
303
|
+
return eventType === SCROLL;
|
|
304
|
+
}
|
|
305
|
+
function isSelectionChange(eventType) {
|
|
306
|
+
return eventType === SELECT || eventType === SELECTION_CHANGE;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
});
|
|
310
|
+
|
|
311
|
+
// ../react-native-use-responder-events/dist/cjs/ResponderTouchHistoryStore.native.js
|
|
312
|
+
var require_ResponderTouchHistoryStore_native = __commonJS({
|
|
313
|
+
"../react-native-use-responder-events/dist/cjs/ResponderTouchHistoryStore.native.js"(exports, module2) {
|
|
314
|
+
"use strict";
|
|
315
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
316
|
+
for (var name in all)
|
|
317
|
+
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
318
|
+
}, __copyProps2 = (to, from, except, desc) => {
|
|
319
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
320
|
+
for (let key of __getOwnPropNames2(from))
|
|
321
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
322
|
+
return to;
|
|
323
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), ResponderTouchHistoryStore_exports = {};
|
|
324
|
+
__export2(ResponderTouchHistoryStore_exports, {
|
|
325
|
+
ResponderTouchHistoryStore: () => ResponderTouchHistoryStore
|
|
326
|
+
});
|
|
327
|
+
module2.exports = __toCommonJS2(ResponderTouchHistoryStore_exports);
|
|
328
|
+
var import_types = require_types_native(), MAX_TOUCH_BANK = 20;
|
|
329
|
+
function timestampForTouch(touch) {
|
|
330
|
+
return touch.timeStamp || touch.timestamp;
|
|
331
|
+
}
|
|
332
|
+
function createTouchRecord(touch) {
|
|
333
|
+
return {
|
|
334
|
+
touchActive: !0,
|
|
335
|
+
startPageX: touch.pageX,
|
|
336
|
+
startPageY: touch.pageY,
|
|
337
|
+
startTimeStamp: timestampForTouch(touch),
|
|
338
|
+
currentPageX: touch.pageX,
|
|
339
|
+
currentPageY: touch.pageY,
|
|
340
|
+
currentTimeStamp: timestampForTouch(touch),
|
|
341
|
+
previousPageX: touch.pageX,
|
|
342
|
+
previousPageY: touch.pageY,
|
|
343
|
+
previousTimeStamp: timestampForTouch(touch)
|
|
344
|
+
};
|
|
345
|
+
}
|
|
346
|
+
function resetTouchRecord(touchRecord, touch) {
|
|
347
|
+
touchRecord.touchActive = !0, touchRecord.startPageX = touch.pageX, touchRecord.startPageY = touch.pageY, touchRecord.startTimeStamp = timestampForTouch(touch), touchRecord.currentPageX = touch.pageX, touchRecord.currentPageY = touch.pageY, touchRecord.currentTimeStamp = timestampForTouch(touch), touchRecord.previousPageX = touch.pageX, touchRecord.previousPageY = touch.pageY, touchRecord.previousTimeStamp = timestampForTouch(touch);
|
|
348
|
+
}
|
|
349
|
+
function getTouchIdentifier({ identifier }) {
|
|
350
|
+
return identifier == null && console.error("Touch object is missing identifier."), process.env.NODE_ENV === "development" && identifier > MAX_TOUCH_BANK && console.error(
|
|
351
|
+
"Touch identifier %s is greater than maximum supported %s which causes performance issues backfilling array locations for all of the indices.",
|
|
352
|
+
identifier,
|
|
353
|
+
MAX_TOUCH_BANK
|
|
354
|
+
), identifier;
|
|
355
|
+
}
|
|
356
|
+
function recordTouchStart(touch, touchHistory) {
|
|
357
|
+
let identifier = getTouchIdentifier(touch), touchRecord = touchHistory.touchBank[identifier];
|
|
358
|
+
touchRecord ? resetTouchRecord(touchRecord, touch) : touchHistory.touchBank[identifier] = createTouchRecord(touch), touchHistory.mostRecentTimeStamp = timestampForTouch(touch);
|
|
359
|
+
}
|
|
360
|
+
function recordTouchMove(touch, touchHistory) {
|
|
361
|
+
let touchRecord = touchHistory.touchBank[getTouchIdentifier(touch)];
|
|
362
|
+
touchRecord ? (touchRecord.touchActive = !0, touchRecord.previousPageX = touchRecord.currentPageX, touchRecord.previousPageY = touchRecord.currentPageY, touchRecord.previousTimeStamp = touchRecord.currentTimeStamp, touchRecord.currentPageX = touch.pageX, touchRecord.currentPageY = touch.pageY, touchRecord.currentTimeStamp = timestampForTouch(touch), touchHistory.mostRecentTimeStamp = timestampForTouch(touch)) : console.warn(
|
|
363
|
+
`Cannot record touch move without a touch start.
|
|
364
|
+
`,
|
|
365
|
+
`Touch Move: ${printTouch(touch)}
|
|
366
|
+
`,
|
|
367
|
+
`Touch Bank: ${printTouchBank(touchHistory)}`
|
|
368
|
+
);
|
|
369
|
+
}
|
|
370
|
+
function recordTouchEnd(touch, touchHistory) {
|
|
371
|
+
let touchRecord = touchHistory.touchBank[getTouchIdentifier(touch)];
|
|
372
|
+
touchRecord ? (touchRecord.touchActive = !1, touchRecord.previousPageX = touchRecord.currentPageX, touchRecord.previousPageY = touchRecord.currentPageY, touchRecord.previousTimeStamp = touchRecord.currentTimeStamp, touchRecord.currentPageX = touch.pageX, touchRecord.currentPageY = touch.pageY, touchRecord.currentTimeStamp = timestampForTouch(touch), touchHistory.mostRecentTimeStamp = timestampForTouch(touch)) : console.warn(
|
|
373
|
+
`Cannot record touch end without a touch start.
|
|
374
|
+
`,
|
|
375
|
+
`Touch End: ${printTouch(touch)}
|
|
376
|
+
`,
|
|
377
|
+
`Touch Bank: ${printTouchBank(touchHistory)}`
|
|
378
|
+
);
|
|
379
|
+
}
|
|
380
|
+
function printTouch(touch) {
|
|
381
|
+
return JSON.stringify({
|
|
382
|
+
identifier: touch.identifier,
|
|
383
|
+
pageX: touch.pageX,
|
|
384
|
+
pageY: touch.pageY,
|
|
385
|
+
timestamp: timestampForTouch(touch)
|
|
386
|
+
});
|
|
387
|
+
}
|
|
388
|
+
function printTouchBank(touchHistory) {
|
|
389
|
+
let { touchBank } = touchHistory, printed = JSON.stringify(touchBank.slice(0, MAX_TOUCH_BANK));
|
|
390
|
+
return touchBank.length > MAX_TOUCH_BANK && (printed += ` (original size: ${touchBank.length})`), printed;
|
|
391
|
+
}
|
|
392
|
+
var ResponderTouchHistoryStore = class {
|
|
393
|
+
constructor() {
|
|
394
|
+
this._touchHistory = {
|
|
395
|
+
touchBank: [],
|
|
396
|
+
//Array<TouchRecord>
|
|
397
|
+
numberActiveTouches: 0,
|
|
398
|
+
// If there is only one active touch, we remember its location. This prevents
|
|
399
|
+
// us having to loop through all of the touches all the time in the most
|
|
400
|
+
// common case.
|
|
401
|
+
indexOfSingleActiveTouch: -1,
|
|
402
|
+
mostRecentTimeStamp: 0
|
|
403
|
+
};
|
|
404
|
+
}
|
|
405
|
+
recordTouchTrack(topLevelType, nativeEvent) {
|
|
406
|
+
let touchHistory = this._touchHistory;
|
|
407
|
+
if ((0, import_types.isMoveish)(topLevelType))
|
|
408
|
+
nativeEvent.changedTouches.forEach((touch) => recordTouchMove(touch, touchHistory));
|
|
409
|
+
else if ((0, import_types.isStartish)(topLevelType))
|
|
410
|
+
nativeEvent.changedTouches.forEach((touch) => recordTouchStart(touch, touchHistory)), touchHistory.numberActiveTouches = nativeEvent.touches.length, touchHistory.numberActiveTouches === 1 && (touchHistory.indexOfSingleActiveTouch = nativeEvent.touches[0].identifier);
|
|
411
|
+
else if ((0, import_types.isEndish)(topLevelType) && (nativeEvent.changedTouches.forEach((touch) => recordTouchEnd(touch, touchHistory)), touchHistory.numberActiveTouches = nativeEvent.touches.length, touchHistory.numberActiveTouches === 1)) {
|
|
412
|
+
let { touchBank } = touchHistory;
|
|
413
|
+
for (let i = 0; i < touchBank.length; i++) {
|
|
414
|
+
let touchTrackToCheck = touchBank[i];
|
|
415
|
+
if (touchTrackToCheck != null && touchTrackToCheck.touchActive) {
|
|
416
|
+
touchHistory.indexOfSingleActiveTouch = i;
|
|
417
|
+
break;
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
if (process.env.NODE_ENV === "development") {
|
|
421
|
+
let activeRecord = touchBank[touchHistory.indexOfSingleActiveTouch];
|
|
422
|
+
activeRecord != null && activeRecord.touchActive || console.error("Cannot find single active touch.");
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
get touchHistory() {
|
|
427
|
+
return this._touchHistory;
|
|
428
|
+
}
|
|
429
|
+
};
|
|
430
|
+
}
|
|
431
|
+
});
|
|
432
|
+
|
|
433
|
+
// ../react-native-use-responder-events/dist/cjs/ResponderSystem.native.js
|
|
434
|
+
var require_ResponderSystem_native = __commonJS({
|
|
435
|
+
"../react-native-use-responder-events/dist/cjs/ResponderSystem.native.js"(exports, module2) {
|
|
436
|
+
"use strict";
|
|
437
|
+
var __create2 = Object.create, __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __getProtoOf2 = Object.getPrototypeOf, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
438
|
+
for (var name in all)
|
|
439
|
+
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
440
|
+
}, __copyProps2 = (to, from, except, desc) => {
|
|
441
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
442
|
+
for (let key of __getOwnPropNames2(from))
|
|
443
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
444
|
+
return to;
|
|
445
|
+
}, __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
|
|
446
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
447
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
448
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
449
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
450
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: !0 }) : target,
|
|
451
|
+
mod
|
|
452
|
+
)), __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), ResponderSystem_exports = {};
|
|
453
|
+
__export2(ResponderSystem_exports, {
|
|
454
|
+
addNode: () => addNode,
|
|
455
|
+
attachListeners: () => attachListeners,
|
|
456
|
+
getResponderNode: () => getResponderNode,
|
|
457
|
+
removeNode: () => removeNode,
|
|
458
|
+
terminateResponder: () => terminateResponder
|
|
459
|
+
});
|
|
460
|
+
module2.exports = __toCommonJS2(ResponderSystem_exports);
|
|
461
|
+
var import_createResponderEvent = __toESM2(require_createResponderEvent_native()), import_ResponderTouchHistoryStore = require_ResponderTouchHistoryStore_native(), import_types = require_types_native(), import_utils = require_utils_native(), import_utils2 = require_utils_native(), emptyObject = {}, startRegistration = [
|
|
462
|
+
"onStartShouldSetResponderCapture",
|
|
463
|
+
"onStartShouldSetResponder",
|
|
464
|
+
{ bubbles: !0 }
|
|
465
|
+
], moveRegistration = [
|
|
466
|
+
"onMoveShouldSetResponderCapture",
|
|
467
|
+
"onMoveShouldSetResponder",
|
|
468
|
+
{ bubbles: !0 }
|
|
469
|
+
], scrollRegistration = [
|
|
470
|
+
"onScrollShouldSetResponderCapture",
|
|
471
|
+
"onScrollShouldSetResponder",
|
|
472
|
+
{ bubbles: !1 }
|
|
473
|
+
], shouldSetResponderEvents = {
|
|
474
|
+
touchstart: startRegistration,
|
|
475
|
+
mousedown: startRegistration,
|
|
476
|
+
touchmove: moveRegistration,
|
|
477
|
+
mousemove: moveRegistration,
|
|
478
|
+
scroll: scrollRegistration
|
|
479
|
+
}, emptyResponder = { id: null, idPath: null, node: null }, responderListenersMap = /* @__PURE__ */ new Map(), isEmulatingMouseEvents = !1, trackedTouchCount = 0, currentResponder = {
|
|
480
|
+
id: null,
|
|
481
|
+
node: null,
|
|
482
|
+
idPath: null
|
|
483
|
+
}, responderTouchHistoryStore = new import_ResponderTouchHistoryStore.ResponderTouchHistoryStore();
|
|
484
|
+
function changeCurrentResponder(responder) {
|
|
485
|
+
currentResponder = responder;
|
|
486
|
+
}
|
|
487
|
+
function getResponderConfig(id) {
|
|
488
|
+
return responderListenersMap.get(id) ?? emptyObject;
|
|
489
|
+
}
|
|
490
|
+
function eventListener(domEvent) {
|
|
491
|
+
let eventType = domEvent.type, eventTarget = domEvent.target;
|
|
492
|
+
if (eventType === "touchstart" && (isEmulatingMouseEvents = !0), (eventType === "touchmove" || trackedTouchCount > 1) && (isEmulatingMouseEvents = !1), // Ignore browser emulated mouse events
|
|
493
|
+
eventType === "mousedown" && isEmulatingMouseEvents || eventType === "mousemove" && isEmulatingMouseEvents || // Ignore mousemove if a mousedown didn't occur first
|
|
494
|
+
eventType === "mousemove" && trackedTouchCount < 1)
|
|
495
|
+
return;
|
|
496
|
+
if (isEmulatingMouseEvents && eventType === "mouseup") {
|
|
497
|
+
trackedTouchCount === 0 && (isEmulatingMouseEvents = !1);
|
|
498
|
+
return;
|
|
499
|
+
}
|
|
500
|
+
let isStartEvent = (0, import_types.isStartish)(eventType) && (0, import_utils2.isPrimaryPointerDown)(domEvent), isMoveEvent = (0, import_types.isMoveish)(eventType), isEndEvent = (0, import_types.isEndish)(eventType), isScrollEvent = (0, import_types.isScroll)(eventType), isSelectionChangeEvent = (0, import_types.isSelectionChange)(eventType), responderEvent = (0, import_createResponderEvent.default)(domEvent, responderTouchHistoryStore);
|
|
501
|
+
(isStartEvent || isMoveEvent || isEndEvent) && (domEvent.touches ? trackedTouchCount = domEvent.touches.length : isStartEvent ? trackedTouchCount = 1 : isEndEvent && (trackedTouchCount = 0), responderTouchHistoryStore.recordTouchTrack(
|
|
502
|
+
eventType,
|
|
503
|
+
responderEvent.nativeEvent
|
|
504
|
+
));
|
|
505
|
+
let eventPaths = (0, import_utils2.getResponderPaths)(domEvent), wasNegotiated = !1, wantsResponder;
|
|
506
|
+
if (isStartEvent || isMoveEvent || isScrollEvent && trackedTouchCount > 0) {
|
|
507
|
+
let currentResponderIdPath = currentResponder.idPath, eventIdPath = eventPaths.idPath;
|
|
508
|
+
if (currentResponderIdPath != null && eventIdPath != null) {
|
|
509
|
+
let lowestCommonAncestor = (0, import_utils2.getLowestCommonAncestor)(
|
|
510
|
+
currentResponderIdPath,
|
|
511
|
+
eventIdPath
|
|
512
|
+
);
|
|
513
|
+
if (lowestCommonAncestor != null) {
|
|
514
|
+
let index = eventIdPath.indexOf(lowestCommonAncestor) + (lowestCommonAncestor === currentResponder.id ? 1 : 0);
|
|
515
|
+
eventPaths = {
|
|
516
|
+
idPath: eventIdPath.slice(index),
|
|
517
|
+
nodePath: eventPaths.nodePath.slice(index)
|
|
518
|
+
};
|
|
519
|
+
} else
|
|
520
|
+
eventPaths = null;
|
|
521
|
+
}
|
|
522
|
+
eventPaths != null && (wantsResponder = findWantsResponder(eventPaths, domEvent, responderEvent), wantsResponder != null && (attemptTransfer(responderEvent, wantsResponder), wasNegotiated = !0));
|
|
523
|
+
}
|
|
524
|
+
if (currentResponder.id != null && currentResponder.node != null) {
|
|
525
|
+
let { id, node } = currentResponder, {
|
|
526
|
+
onResponderStart,
|
|
527
|
+
onResponderMove,
|
|
528
|
+
onResponderEnd,
|
|
529
|
+
onResponderRelease,
|
|
530
|
+
onResponderTerminate,
|
|
531
|
+
onResponderTerminationRequest
|
|
532
|
+
} = getResponderConfig(id);
|
|
533
|
+
if (responderEvent.bubbles = !1, responderEvent.cancelable = !1, responderEvent.currentTarget = node, isStartEvent)
|
|
534
|
+
onResponderStart != null && (responderEvent.dispatchConfig.registrationName = "onResponderStart", onResponderStart(responderEvent));
|
|
535
|
+
else if (isMoveEvent)
|
|
536
|
+
onResponderMove != null && (responderEvent.dispatchConfig.registrationName = "onResponderMove", onResponderMove(responderEvent));
|
|
537
|
+
else {
|
|
538
|
+
let isTerminateEvent = (0, import_types.isCancelish)(eventType) || // native context menu
|
|
539
|
+
eventType === "contextmenu" || // window blur
|
|
540
|
+
eventType === "blur" && eventTarget === window || // responder (or ancestors) blur
|
|
541
|
+
eventType === "blur" && eventTarget.contains(node) && domEvent.relatedTarget !== node || // native scroll without using a pointer
|
|
542
|
+
isScrollEvent && trackedTouchCount === 0 || // native scroll on node that is parent of the responder (allow siblings to scroll)
|
|
543
|
+
isScrollEvent && eventTarget.contains(node) && eventTarget !== node || // native select/selectionchange on node
|
|
544
|
+
isSelectionChangeEvent && (0, import_utils2.hasValidSelection)(domEvent), isReleaseEvent = isEndEvent && !isTerminateEvent && !(0, import_utils2.hasTargetTouches)(node, domEvent.touches);
|
|
545
|
+
if (isEndEvent && onResponderEnd != null && (responderEvent.dispatchConfig.registrationName = "onResponderEnd", onResponderEnd(responderEvent)), isReleaseEvent && (onResponderRelease != null && (responderEvent.dispatchConfig.registrationName = "onResponderRelease", onResponderRelease(responderEvent)), changeCurrentResponder(emptyResponder)), isTerminateEvent) {
|
|
546
|
+
let shouldTerminate = !0;
|
|
547
|
+
(eventType === "contextmenu" || eventType === "scroll" || eventType === "selectionchange") && (wasNegotiated ? shouldTerminate = !1 : onResponderTerminationRequest != null && (responderEvent.dispatchConfig.registrationName = "onResponderTerminationRequest", onResponderTerminationRequest(responderEvent) === !1 && (shouldTerminate = !1))), shouldTerminate && (onResponderTerminate != null && (responderEvent.dispatchConfig.registrationName = "onResponderTerminate", onResponderTerminate(responderEvent)), changeCurrentResponder(emptyResponder), isEmulatingMouseEvents = !1, trackedTouchCount = 0);
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
function findWantsResponder(eventPaths, domEvent, responderEvent) {
|
|
553
|
+
let shouldSetCallbacks = shouldSetResponderEvents[domEvent.type];
|
|
554
|
+
if (shouldSetCallbacks != null) {
|
|
555
|
+
let { idPath, nodePath } = eventPaths, shouldSetCallbackCaptureName = shouldSetCallbacks[0], shouldSetCallbackBubbleName = shouldSetCallbacks[1], { bubbles } = shouldSetCallbacks[2], check = function(id, node, callbackName) {
|
|
556
|
+
let shouldSetCallback = getResponderConfig(id)[callbackName];
|
|
557
|
+
if (shouldSetCallback != null && (responderEvent.currentTarget = node, shouldSetCallback(responderEvent) === !0)) {
|
|
558
|
+
let prunedIdPath = idPath.slice(idPath.indexOf(id));
|
|
559
|
+
return { id, node, idPath: prunedIdPath };
|
|
560
|
+
}
|
|
561
|
+
};
|
|
562
|
+
for (let i = idPath.length - 1; i >= 0; i--) {
|
|
563
|
+
let id = idPath[i], node = nodePath[i], result = check(id, node, shouldSetCallbackCaptureName);
|
|
564
|
+
if (result != null)
|
|
565
|
+
return result;
|
|
566
|
+
if (responderEvent.isPropagationStopped() === !0)
|
|
567
|
+
return;
|
|
568
|
+
}
|
|
569
|
+
if (bubbles)
|
|
570
|
+
for (let i = 0; i < idPath.length; i++) {
|
|
571
|
+
let id = idPath[i], node = nodePath[i], result = check(id, node, shouldSetCallbackBubbleName);
|
|
572
|
+
if (result != null)
|
|
573
|
+
return result;
|
|
574
|
+
if (responderEvent.isPropagationStopped() === !0)
|
|
575
|
+
return;
|
|
576
|
+
}
|
|
577
|
+
else {
|
|
578
|
+
let id = idPath[0], node = nodePath[0];
|
|
579
|
+
if (domEvent.target === node)
|
|
580
|
+
return check(id, node, shouldSetCallbackBubbleName);
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
function attemptTransfer(responderEvent, wantsResponder) {
|
|
585
|
+
let { id: currentId, node: currentNode } = currentResponder, { id, node } = wantsResponder, { onResponderGrant, onResponderReject } = getResponderConfig(id);
|
|
586
|
+
if (responderEvent.bubbles = !1, responderEvent.cancelable = !1, responderEvent.currentTarget = node, currentId == null)
|
|
587
|
+
onResponderGrant != null && (responderEvent.currentTarget = node, responderEvent.dispatchConfig.registrationName = "onResponderGrant", onResponderGrant(responderEvent)), changeCurrentResponder(wantsResponder);
|
|
588
|
+
else {
|
|
589
|
+
let { onResponderTerminate, onResponderTerminationRequest } = getResponderConfig(currentId), allowTransfer = !0;
|
|
590
|
+
onResponderTerminationRequest != null && (responderEvent.currentTarget = currentNode, responderEvent.dispatchConfig.registrationName = "onResponderTerminationRequest", onResponderTerminationRequest(responderEvent) === !1 && (allowTransfer = !1)), allowTransfer ? (onResponderTerminate != null && (responderEvent.currentTarget = currentNode, responderEvent.dispatchConfig.registrationName = "onResponderTerminate", onResponderTerminate(responderEvent)), onResponderGrant != null && (responderEvent.currentTarget = node, responderEvent.dispatchConfig.registrationName = "onResponderGrant", onResponderGrant(responderEvent)), changeCurrentResponder(wantsResponder)) : onResponderReject != null && (responderEvent.currentTarget = node, responderEvent.dispatchConfig.registrationName = "onResponderReject", onResponderReject(responderEvent));
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
var documentEventsCapturePhase = ["blur", "scroll"], documentEventsBubblePhase = [
|
|
594
|
+
// mouse
|
|
595
|
+
"mousedown",
|
|
596
|
+
"mousemove",
|
|
597
|
+
"mouseup",
|
|
598
|
+
"dragstart",
|
|
599
|
+
// touch
|
|
600
|
+
"touchstart",
|
|
601
|
+
"touchmove",
|
|
602
|
+
"touchend",
|
|
603
|
+
"touchcancel",
|
|
604
|
+
// other
|
|
605
|
+
"contextmenu",
|
|
606
|
+
"select",
|
|
607
|
+
"selectionchange"
|
|
608
|
+
], isTamaguiResponderActive = Symbol();
|
|
609
|
+
function attachListeners() {
|
|
610
|
+
import_utils.canUseDOM && !window[isTamaguiResponderActive] && (window.addEventListener("blur", eventListener), documentEventsBubblePhase.forEach((eventType) => {
|
|
611
|
+
document.addEventListener(eventType, eventListener);
|
|
612
|
+
}), documentEventsCapturePhase.forEach((eventType) => {
|
|
613
|
+
document.addEventListener(eventType, eventListener, !0);
|
|
614
|
+
}), window[isTamaguiResponderActive] = !0);
|
|
615
|
+
}
|
|
616
|
+
function addNode(id, node, config) {
|
|
617
|
+
(0, import_utils2.setResponderId)(node, id), responderListenersMap.set(id, config);
|
|
618
|
+
}
|
|
619
|
+
function removeNode(id) {
|
|
620
|
+
currentResponder.id === id && terminateResponder(), responderListenersMap.has(id) && responderListenersMap.delete(id);
|
|
621
|
+
}
|
|
622
|
+
function terminateResponder() {
|
|
623
|
+
let { id, node } = currentResponder;
|
|
624
|
+
if (id != null && node != null) {
|
|
625
|
+
let { onResponderTerminate } = getResponderConfig(id);
|
|
626
|
+
if (onResponderTerminate != null) {
|
|
627
|
+
let event = (0, import_createResponderEvent.default)({}, responderTouchHistoryStore);
|
|
628
|
+
event.currentTarget = node, onResponderTerminate(event);
|
|
629
|
+
}
|
|
630
|
+
changeCurrentResponder(emptyResponder);
|
|
631
|
+
}
|
|
632
|
+
isEmulatingMouseEvents = !1, trackedTouchCount = 0;
|
|
633
|
+
}
|
|
634
|
+
function getResponderNode() {
|
|
635
|
+
return currentResponder.node;
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
});
|
|
639
|
+
|
|
640
|
+
// ../react-native-use-responder-events/dist/cjs/useResponderEvents.native.js
|
|
641
|
+
var require_useResponderEvents_native = __commonJS({
|
|
642
|
+
"../react-native-use-responder-events/dist/cjs/useResponderEvents.native.js"(exports, module2) {
|
|
643
|
+
"use strict";
|
|
644
|
+
var __create2 = Object.create, __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __getProtoOf2 = Object.getPrototypeOf, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
645
|
+
for (var name in all)
|
|
646
|
+
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
647
|
+
}, __copyProps2 = (to, from, except, desc) => {
|
|
648
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
649
|
+
for (let key of __getOwnPropNames2(from))
|
|
650
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
651
|
+
return to;
|
|
652
|
+
}, __reExport2 = (target, mod, secondTarget) => (__copyProps2(target, mod, "default"), secondTarget && __copyProps2(secondTarget, mod, "default")), __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
|
|
653
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
654
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
655
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
656
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
657
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: !0 }) : target,
|
|
658
|
+
mod
|
|
659
|
+
)), __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), useResponderEvents_exports = {};
|
|
660
|
+
__export2(useResponderEvents_exports, {
|
|
661
|
+
useResponderEvents: () => useResponderEvents2
|
|
662
|
+
});
|
|
663
|
+
module2.exports = __toCommonJS2(useResponderEvents_exports);
|
|
664
|
+
var React = __toESM2(require("react")), ResponderSystem = __toESM2(require_ResponderSystem_native());
|
|
665
|
+
__reExport2(useResponderEvents_exports, require_utils_native(), module2.exports);
|
|
666
|
+
var emptyObject = {};
|
|
667
|
+
function useResponderEvents2(hostRef, config = emptyObject) {
|
|
668
|
+
let id = React.useId(), isAttachedRef = React.useRef(!1);
|
|
669
|
+
React.useEffect(() => (ResponderSystem.attachListeners(), () => {
|
|
670
|
+
ResponderSystem.removeNode(id);
|
|
671
|
+
}), [id]), React.useEffect(() => {
|
|
672
|
+
let {
|
|
673
|
+
onMoveShouldSetResponder,
|
|
674
|
+
onMoveShouldSetResponderCapture,
|
|
675
|
+
onScrollShouldSetResponder,
|
|
676
|
+
onScrollShouldSetResponderCapture,
|
|
677
|
+
onSelectionChangeShouldSetResponder,
|
|
678
|
+
onSelectionChangeShouldSetResponderCapture,
|
|
679
|
+
onStartShouldSetResponder,
|
|
680
|
+
onStartShouldSetResponderCapture
|
|
681
|
+
} = config, requiresResponderSystem = onMoveShouldSetResponder != null || onMoveShouldSetResponderCapture != null || onScrollShouldSetResponder != null || onScrollShouldSetResponderCapture != null || onSelectionChangeShouldSetResponder != null || onSelectionChangeShouldSetResponderCapture != null || onStartShouldSetResponder != null || onStartShouldSetResponderCapture != null, node = hostRef.current;
|
|
682
|
+
requiresResponderSystem ? (ResponderSystem.addNode(id, node, config), isAttachedRef.current = !0) : isAttachedRef.current && (ResponderSystem.removeNode(id), isAttachedRef.current = !1);
|
|
683
|
+
}, [config, hostRef, id]), process.env.NODE_ENV === "development" && (React.useDebugValue({
|
|
684
|
+
isResponder: hostRef.current === ResponderSystem.getResponderNode()
|
|
685
|
+
}), React.useDebugValue(config));
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
});
|
|
689
|
+
|
|
690
|
+
// ../react-native-use-responder-events/dist/cjs/index.native.js
|
|
691
|
+
var require_index_native = __commonJS({
|
|
692
|
+
"../react-native-use-responder-events/dist/cjs/index.native.js"(exports, module2) {
|
|
693
|
+
"use strict";
|
|
694
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __copyProps2 = (to, from, except, desc) => {
|
|
695
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
696
|
+
for (let key of __getOwnPropNames2(from))
|
|
697
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
698
|
+
return to;
|
|
699
|
+
}, __reExport2 = (target, mod, secondTarget) => (__copyProps2(target, mod, "default"), secondTarget && __copyProps2(secondTarget, mod, "default")), __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), src_exports2 = {};
|
|
700
|
+
module2.exports = __toCommonJS2(src_exports2);
|
|
701
|
+
__reExport2(src_exports2, require_useResponderEvents_native(), module2.exports);
|
|
702
|
+
}
|
|
703
|
+
});
|
|
704
|
+
|
|
30
705
|
// ../helpers/dist/cjs/clamp.native.js
|
|
31
706
|
var require_clamp_native = __commonJS({
|
|
32
707
|
"../helpers/dist/cjs/clamp.native.js"(exports, module2) {
|
|
@@ -143,7 +818,7 @@ var require_concatClassName_native = __commonJS({
|
|
|
143
818
|
});
|
|
144
819
|
|
|
145
820
|
// ../constants/dist/cjs/index.native.js
|
|
146
|
-
var
|
|
821
|
+
var require_index_native2 = __commonJS({
|
|
147
822
|
"../constants/dist/cjs/index.native.js"(exports, module2) {
|
|
148
823
|
"use strict";
|
|
149
824
|
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
@@ -200,7 +875,7 @@ var require_validStyleProps_native = __commonJS({
|
|
|
200
875
|
validStylesOnBaseProps: () => validStylesOnBaseProps
|
|
201
876
|
});
|
|
202
877
|
module2.exports = __toCommonJS2(validStyleProps_exports);
|
|
203
|
-
var import_constants2 =
|
|
878
|
+
var import_constants2 = require_index_native2(), placeHolderTextColors = {
|
|
204
879
|
placeholderTextColor: !0
|
|
205
880
|
}, validStylesOnBaseProps = {
|
|
206
881
|
...placeHolderTextColors
|
|
@@ -386,7 +1061,7 @@ var require_validStyleProps_native = __commonJS({
|
|
|
386
1061
|
});
|
|
387
1062
|
|
|
388
1063
|
// ../helpers/dist/cjs/types.native.js
|
|
389
|
-
var
|
|
1064
|
+
var require_types_native2 = __commonJS({
|
|
390
1065
|
"../helpers/dist/cjs/types.native.js"(exports, module2) {
|
|
391
1066
|
"use strict";
|
|
392
1067
|
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __copyProps2 = (to, from, except, desc) => {
|
|
@@ -400,7 +1075,7 @@ var require_types_native = __commonJS({
|
|
|
400
1075
|
});
|
|
401
1076
|
|
|
402
1077
|
// ../simple-hash/dist/cjs/index.native.js
|
|
403
|
-
var
|
|
1078
|
+
var require_index_native3 = __commonJS({
|
|
404
1079
|
"../simple-hash/dist/cjs/index.native.js"(exports, module2) {
|
|
405
1080
|
"use strict";
|
|
406
1081
|
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
@@ -445,7 +1120,7 @@ var require_index_native2 = __commonJS({
|
|
|
445
1120
|
});
|
|
446
1121
|
|
|
447
1122
|
// ../helpers/dist/cjs/index.native.js
|
|
448
|
-
var
|
|
1123
|
+
var require_index_native4 = __commonJS({
|
|
449
1124
|
"../helpers/dist/cjs/index.native.js"(exports, module2) {
|
|
450
1125
|
"use strict";
|
|
451
1126
|
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __copyProps2 = (to, from, except, desc) => {
|
|
@@ -459,8 +1134,8 @@ var require_index_native3 = __commonJS({
|
|
|
459
1134
|
__reExport2(src_exports2, require_composeEventHandlers_native(), module2.exports);
|
|
460
1135
|
__reExport2(src_exports2, require_concatClassName_native(), module2.exports);
|
|
461
1136
|
__reExport2(src_exports2, require_validStyleProps_native(), module2.exports);
|
|
462
|
-
__reExport2(src_exports2,
|
|
463
|
-
__reExport2(src_exports2,
|
|
1137
|
+
__reExport2(src_exports2, require_types_native2(), module2.exports);
|
|
1138
|
+
__reExport2(src_exports2, require_index_native3(), module2.exports);
|
|
464
1139
|
}
|
|
465
1140
|
});
|
|
466
1141
|
|
|
@@ -494,16 +1169,16 @@ var require_config_native = __commonJS({
|
|
|
494
1169
|
useTokens: () => useTokens
|
|
495
1170
|
});
|
|
496
1171
|
module2.exports = __toCommonJS2(config_exports);
|
|
497
|
-
var import_constants2 =
|
|
1172
|
+
var import_constants2 = require_index_native2(), conf, setConfig = (next) => {
|
|
498
1173
|
conf = next, configListeners.forEach((cb) => cb(next));
|
|
499
1174
|
}, setConfigFont = (name, font, fontParsed) => {
|
|
500
|
-
if (!conf)
|
|
1175
|
+
if (process.env.NODE_ENV === "development" && !conf)
|
|
501
1176
|
throw new Error("Haven't called createTamagui yet");
|
|
502
1177
|
conf.fonts[name] = font, conf.fontsParsed[`$${name}`] = fontParsed;
|
|
503
1178
|
}, getConfig2 = () => {
|
|
504
1179
|
if (!conf)
|
|
505
1180
|
throw new Error(
|
|
506
|
-
"Missing tamagui config, you either have a duplicate config, or haven't set it up. Be sure createTamagui is called before rendering. Also, make sure all of your tamagui dependencies are on the same version (`tamagui`, `@tamagui/package-name`, etc.)"
|
|
1181
|
+
process.env.NODE_ENV !== "production" ? "Missing tamagui config, you either have a duplicate config, or haven't set it up. Be sure createTamagui is called before rendering. Also, make sure all of your tamagui dependencies are on the same version (`tamagui`, `@tamagui/package-name`, etc.)" : "Err0"
|
|
507
1182
|
);
|
|
508
1183
|
return conf;
|
|
509
1184
|
}, tokensMerged;
|
|
@@ -513,7 +1188,7 @@ var require_config_native = __commonJS({
|
|
|
513
1188
|
var getTokens2 = ({
|
|
514
1189
|
prefixed
|
|
515
1190
|
} = {}) => {
|
|
516
|
-
if (!conf)
|
|
1191
|
+
if (process.env.NODE_ENV === "development" && !conf)
|
|
517
1192
|
throw new Error("Haven't called createTamagui yet");
|
|
518
1193
|
let { tokens, tokensParsed } = conf;
|
|
519
1194
|
return prefixed === !1 ? tokens : prefixed === !0 ? tokensParsed : tokensMerged;
|
|
@@ -566,7 +1241,7 @@ var require_createVariable_native = __commonJS({
|
|
|
566
1241
|
variableToString: () => variableToString
|
|
567
1242
|
});
|
|
568
1243
|
module2.exports = __toCommonJS2(createVariable_exports);
|
|
569
|
-
var import_constants2 =
|
|
1244
|
+
var import_constants2 = require_index_native2(), import_helpers = require_index_native4(), import_config = require_config_native(), IS_VAR = "isVar", createVariable = (props, skipHash = !1) => {
|
|
570
1245
|
if (!skipHash && isVariable(props))
|
|
571
1246
|
return props;
|
|
572
1247
|
let { key, name, val } = props;
|
|
@@ -601,7 +1276,7 @@ var require_createVariable_native = __commonJS({
|
|
|
601
1276
|
return isVariable(v) ? v.variable : v;
|
|
602
1277
|
}
|
|
603
1278
|
var createCSSVariable = (nameProp, includeVar = !0) => {
|
|
604
|
-
if (!nameProp || typeof nameProp != "string")
|
|
1279
|
+
if (process.env.NODE_ENV === "development" && (!nameProp || typeof nameProp != "string"))
|
|
605
1280
|
throw new Error(`createCSSVariable expected string, got: ${nameProp}`);
|
|
606
1281
|
let name = (0, import_helpers.simpleHash)(nameProp, 60);
|
|
607
1282
|
return includeVar ? `var(--${name})` : name;
|
|
@@ -634,11 +1309,11 @@ var require_insertStyleRule_native = __commonJS({
|
|
|
634
1309
|
updateRules: () => updateRules
|
|
635
1310
|
});
|
|
636
1311
|
module2.exports = __toCommonJS2(insertStyleRule_exports);
|
|
637
|
-
var import_constants2 =
|
|
1312
|
+
var import_constants2 = require_index_native2(), import_createVariable = require_createVariable_native(), scannedCache = /* @__PURE__ */ new WeakMap(), totalSelectorsInserted = /* @__PURE__ */ new Map(), allSelectors = {}, allRules = {}, insertedTransforms = {}, getAllSelectors = () => allSelectors, getAllRules = () => Object.values(allRules), getAllTransforms = () => insertedTransforms;
|
|
638
1313
|
function addTransform(identifier, css, rule) {
|
|
639
1314
|
let s = css.indexOf("transform:");
|
|
640
1315
|
if (s === -1) {
|
|
641
|
-
console.error(`\u274C Invalid transform, likely used deg/% improperly ${identifier}`);
|
|
1316
|
+
process.env.NODE_ENV === "development" && console.error(`\u274C Invalid transform, likely used deg/% improperly ${identifier}`);
|
|
642
1317
|
return;
|
|
643
1318
|
}
|
|
644
1319
|
let startI = s + 10, endI = css.indexOf(";"), value = css.slice(startI, endI);
|
|
@@ -658,7 +1333,7 @@ var require_insertStyleRule_native = __commonJS({
|
|
|
658
1333
|
}
|
|
659
1334
|
var lastScannedSheets = null;
|
|
660
1335
|
function scanAllSheets(collectThemes = !1, tokens) {
|
|
661
|
-
if (!import_constants2.isClient)
|
|
1336
|
+
if (process.env.NODE_ENV === "test" || !import_constants2.isClient)
|
|
662
1337
|
return;
|
|
663
1338
|
let themes, sheets = document.styleSheets || [], prev = lastScannedSheets, current = new Set(sheets);
|
|
664
1339
|
if (document.styleSheets) {
|
|
@@ -790,13 +1465,16 @@ var require_insertStyleRule_native = __commonJS({
|
|
|
790
1465
|
allSelectors[identifier] = rules.join(`
|
|
791
1466
|
`), track(identifier), updateRules(identifier, rules);
|
|
792
1467
|
for (let rule of rules)
|
|
793
|
-
|
|
1468
|
+
if (process.env.NODE_ENV === "production")
|
|
794
1469
|
sheet.insertRule(rule, sheet.cssRules.length);
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
1470
|
+
else
|
|
1471
|
+
try {
|
|
1472
|
+
sheet.insertRule(rule, sheet.cssRules.length);
|
|
1473
|
+
} catch (err) {
|
|
1474
|
+
console.groupCollapsed(
|
|
1475
|
+
`Error inserting rule into CSSStyleSheet: ${String(err)}`
|
|
1476
|
+
), console.log({ rule, rulesToInsert }), console.trace(), console.groupEnd();
|
|
1477
|
+
}
|
|
800
1478
|
}
|
|
801
1479
|
}
|
|
802
1480
|
}
|
|
@@ -804,7 +1482,7 @@ var require_insertStyleRule_native = __commonJS({
|
|
|
804
1482
|
if (process.env.IS_STATIC === "is_static")
|
|
805
1483
|
return !0;
|
|
806
1484
|
let total = totalSelectorsInserted.get(identifier);
|
|
807
|
-
return totalSelectorsInserted.size > +(process.env.TAMAGUI_STYLE_INSERTION_WARNING_LIMIT || 5e4) && console.warn(
|
|
1485
|
+
return process.env.NODE_ENV === "development" && totalSelectorsInserted.size > +(process.env.TAMAGUI_STYLE_INSERTION_WARNING_LIMIT || 5e4) && console.warn(
|
|
808
1486
|
'Warning: inserting many CSS rules, you may be animating something and generating many CSS insertions, which can degrade performance. Instead, try using the "disableClassName" property on elements that change styles often. To disable this warning set TAMAGUI_STYLE_INSERTION_WARNING_LIMIT from 50000 to something higher'
|
|
809
1487
|
), total === void 0 || total < 2;
|
|
810
1488
|
}
|
|
@@ -829,7 +1507,7 @@ var require_createProxy_native = __commonJS({
|
|
|
829
1507
|
});
|
|
830
1508
|
module2.exports = __toCommonJS2(createProxy_exports);
|
|
831
1509
|
function createProxy(target, handler) {
|
|
832
|
-
return (typeof target != "object" || !target) && console.warn(
|
|
1510
|
+
return process.env.NODE_ENV === "development" && (typeof target != "object" || !target) && console.warn(
|
|
833
1511
|
"Invalid object given for proxy:",
|
|
834
1512
|
target,
|
|
835
1513
|
`
|
|
@@ -861,7 +1539,7 @@ var require_matchMedia_native = __commonJS({
|
|
|
861
1539
|
module2.exports = __toCommonJS2(matchMedia_native_exports);
|
|
862
1540
|
var matchMediaImpl = matchMediaFallback, matchMedia = (...args) => matchMediaImpl(...args);
|
|
863
1541
|
function matchMediaFallback(query) {
|
|
864
|
-
return console.warn("warning: matchMedia implementation is not provided."), {
|
|
1542
|
+
return process.env.NODE_ENV === "development" && console.warn("warning: matchMedia implementation is not provided."), {
|
|
865
1543
|
match: (a, b) => !1,
|
|
866
1544
|
addListener: () => {
|
|
867
1545
|
},
|
|
@@ -894,10 +1572,11 @@ var require_isDevTools_native = __commonJS({
|
|
|
894
1572
|
});
|
|
895
1573
|
module2.exports = __toCommonJS2(isDevTools_exports);
|
|
896
1574
|
var isDevTools = (() => {
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
1575
|
+
if (process.env.NODE_ENV === "development")
|
|
1576
|
+
try {
|
|
1577
|
+
return new Function("try {return this===window;}catch(e){ return false;}")();
|
|
1578
|
+
} catch {
|
|
1579
|
+
}
|
|
901
1580
|
return !1;
|
|
902
1581
|
})();
|
|
903
1582
|
}
|
|
@@ -920,7 +1599,7 @@ var require_expandStyle_native = __commonJS({
|
|
|
920
1599
|
expandStyle: () => expandStyle
|
|
921
1600
|
});
|
|
922
1601
|
module2.exports = __toCommonJS2(expandStyle_exports);
|
|
923
|
-
var import_constants2 =
|
|
1602
|
+
var import_constants2 = require_index_native2();
|
|
924
1603
|
function expandStyle(key, value) {
|
|
925
1604
|
if (!1)
|
|
926
1605
|
switch (key) {
|
|
@@ -1403,7 +2082,7 @@ var require_normalize_color = __commonJS({
|
|
|
1403
2082
|
});
|
|
1404
2083
|
|
|
1405
2084
|
// ../normalize-css-color/dist/cjs/index.native.js
|
|
1406
|
-
var
|
|
2085
|
+
var require_index_native5 = __commonJS({
|
|
1407
2086
|
"../normalize-css-color/dist/cjs/index.native.js"(exports, module2) {
|
|
1408
2087
|
"use strict";
|
|
1409
2088
|
var __create2 = Object.create, __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __getProtoOf2 = Object.getPrototypeOf, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
@@ -1481,7 +2160,7 @@ var require_normalizeColor_native = __commonJS({
|
|
|
1481
2160
|
rgba: () => import_normalize_css_color2.rgba
|
|
1482
2161
|
});
|
|
1483
2162
|
module2.exports = __toCommonJS2(normalizeColor_exports);
|
|
1484
|
-
var import_constants2 =
|
|
2163
|
+
var import_constants2 = require_index_native2(), import_normalize_css_color = require_index_native5(), import_normalize_css_color2 = require_index_native5(), normalizeColor = (color, opacity) => {
|
|
1485
2164
|
if (!color)
|
|
1486
2165
|
return;
|
|
1487
2166
|
if (color[0] === "$" || color[0] === "v" && color.startsWith("var(") || import_constants2.isWeb && opacity === 1)
|
|
@@ -1491,7 +2170,7 @@ var require_normalizeColor_native = __commonJS({
|
|
|
1491
2170
|
let { r, g, b, a } = (0, import_normalize_css_color.rgba)(colorProcessed), alpha = (opacity ?? a ?? 1).toFixed(2);
|
|
1492
2171
|
return `rgba(${r},${g},${b},${alpha})`;
|
|
1493
2172
|
}
|
|
1494
|
-
console.warn(`Unknown color value: ${color}`);
|
|
2173
|
+
process.env.NODE_ENV === "development" && console.warn(`Unknown color value: ${color}`);
|
|
1495
2174
|
};
|
|
1496
2175
|
}
|
|
1497
2176
|
});
|
|
@@ -1514,7 +2193,7 @@ var require_normalizeValueWithProperty_native = __commonJS({
|
|
|
1514
2193
|
reverseMapClassNameToValue: () => reverseMapClassNameToValue
|
|
1515
2194
|
});
|
|
1516
2195
|
module2.exports = __toCommonJS2(normalizeValueWithProperty_exports);
|
|
1517
|
-
var import_constants2 =
|
|
2196
|
+
var import_constants2 = require_index_native2(), import_helpers = require_index_native4(), import_insertStyleRule = require_insertStyleRule_native(), stylePropsAllPlusTransforms = {
|
|
1518
2197
|
...import_helpers.stylePropsAll,
|
|
1519
2198
|
translateX: !0,
|
|
1520
2199
|
translateY: !0
|
|
@@ -1531,13 +2210,13 @@ var require_normalizeValueWithProperty_native = __commonJS({
|
|
|
1531
2210
|
if (rcache[cssRule])
|
|
1532
2211
|
return rcache[cssRule];
|
|
1533
2212
|
if (!cssRule) {
|
|
1534
|
-
console.warn(
|
|
2213
|
+
process.env.NODE_ENV === "development" && console.warn(
|
|
1535
2214
|
`No CSS rule found for ${key} looking for selector ".${className}", you may not be injecting extracted CSS`
|
|
1536
2215
|
);
|
|
1537
2216
|
return;
|
|
1538
2217
|
}
|
|
1539
2218
|
let cssVal = cssRule.replace(/.*:/, "").replace(/;.*/, "").trim(), res;
|
|
1540
|
-
return cssVal.startsWith("var(") ? res = cssVal : import_helpers.stylePropsUnitless[key] ? res = +cssVal : cssVal.endsWith("px") ? res = +cssVal.replace("px", "") : res = cssVal, rcache[cssRule] = res, typeof res == "number" && isNaN(res) && console.log("Tamagui invalid parsed value, NaN:", {
|
|
2219
|
+
return cssVal.startsWith("var(") ? res = cssVal : import_helpers.stylePropsUnitless[key] ? res = +cssVal : cssVal.endsWith("px") ? res = +cssVal.replace("px", "") : res = cssVal, rcache[cssRule] = res, process.env.NODE_ENV === "development" && typeof res == "number" && isNaN(res) && console.log("Tamagui invalid parsed value, NaN:", {
|
|
1541
2220
|
res,
|
|
1542
2221
|
cssVal,
|
|
1543
2222
|
cssRule,
|
|
@@ -1565,7 +2244,7 @@ var require_normalizeShadow_native = __commonJS({
|
|
|
1565
2244
|
normalizeShadow: () => normalizeShadow
|
|
1566
2245
|
});
|
|
1567
2246
|
module2.exports = __toCommonJS2(normalizeShadow_native_exports);
|
|
1568
|
-
var import_normalize_css_color =
|
|
2247
|
+
var import_normalize_css_color = require_index_native5(), import_defaultOffset = require_defaultOffset_native(), import_normalizeColor = require_normalizeColor_native(), import_normalizeValueWithProperty = require_normalizeValueWithProperty_native();
|
|
1569
2248
|
function normalizeShadow({
|
|
1570
2249
|
shadowColor,
|
|
1571
2250
|
shadowOffset,
|
|
@@ -1660,7 +2339,7 @@ var require_expandStyles_native = __commonJS({
|
|
|
1660
2339
|
fixStyles: () => fixStyles
|
|
1661
2340
|
});
|
|
1662
2341
|
module2.exports = __toCommonJS2(expandStyles_exports);
|
|
1663
|
-
var import_constants2 =
|
|
2342
|
+
var import_constants2 = require_index_native2(), import_expandStyle = require_expandStyle_native(), import_normalizeShadow = require_normalizeShadow_native(), import_normalizeValueWithProperty = require_normalizeValueWithProperty_native(), import_pseudoDescriptors = require_pseudoDescriptors_native();
|
|
1664
2343
|
function expandStylesAndRemoveNullishValues(style) {
|
|
1665
2344
|
let res = {};
|
|
1666
2345
|
for (let key in style) {
|
|
@@ -1797,7 +2476,7 @@ var require_propMapper_native = __commonJS({
|
|
|
1797
2476
|
propMapper: () => propMapper
|
|
1798
2477
|
});
|
|
1799
2478
|
module2.exports = __toCommonJS2(propMapper_exports);
|
|
1800
|
-
var import_constants2 =
|
|
2479
|
+
var import_constants2 = require_index_native2(), import_helpers = require_index_native4(), import_config = require_config_native(), import_isDevTools = require_isDevTools_native(), import_createVariable = require_createVariable_native(), import_expandStyle = require_expandStyle_native(), import_expandStyles = require_expandStyles_native(), import_getVariantExtras = require_getVariantExtras_native(), import_isObj = require_isObj_native(), import_pseudoDescriptors = require_pseudoDescriptors_native(), propMapper = (key, value, styleStateIn, subPropsIn) => {
|
|
1801
2480
|
if (!import_constants2.isAndroid && key === "elevationAndroid")
|
|
1802
2481
|
return;
|
|
1803
2482
|
let subProps = styleStateIn.styleProps.fallbackProps || subPropsIn, styleState = subProps ? new Proxy(styleStateIn, {
|
|
@@ -1805,7 +2484,7 @@ var require_propMapper_native = __commonJS({
|
|
|
1805
2484
|
return k === "curProps" ? subProps : Reflect.get(_, k);
|
|
1806
2485
|
}
|
|
1807
2486
|
}) : styleStateIn, { conf, styleProps, fontFamily, staticConfig } = styleState, { variants } = staticConfig;
|
|
1808
|
-
if (fontFamily && fontFamily[0] === "$" && !(fontFamily in conf.fontsParsed) && console.warn(
|
|
2487
|
+
if (process.env.NODE_ENV === "development" && fontFamily && fontFamily[0] === "$" && !(fontFamily in conf.fontsParsed) && console.warn(
|
|
1809
2488
|
`Warning: no fontFamily "${fontFamily}" found in config: ${Object.keys(conf.fontsParsed).join(
|
|
1810
2489
|
", "
|
|
1811
2490
|
)}`
|
|
@@ -1823,7 +2502,7 @@ var require_propMapper_native = __commonJS({
|
|
|
1823
2502
|
if (!variants)
|
|
1824
2503
|
return;
|
|
1825
2504
|
let variantValue = getVariantDefinition(variants[key], key, value, conf);
|
|
1826
|
-
if (debug === "verbose" && (console.groupCollapsed(`\u2666\uFE0F\u2666\uFE0F\u2666\uFE0F resolve variant ${key}`), console.log({
|
|
2505
|
+
if (process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupCollapsed(`\u2666\uFE0F\u2666\uFE0F\u2666\uFE0F resolve variant ${key}`), console.log({
|
|
1827
2506
|
key,
|
|
1828
2507
|
value,
|
|
1829
2508
|
variantValue,
|
|
@@ -1840,12 +2519,12 @@ var require_propMapper_native = __commonJS({
|
|
|
1840
2519
|
}
|
|
1841
2520
|
if (typeof variantValue == "function") {
|
|
1842
2521
|
let fn = variantValue, extras = (0, import_getVariantExtras.getVariantExtras)(styleState);
|
|
1843
|
-
variantValue = fn(value, extras), debug === "verbose" && (console.groupCollapsed(" expanded functional variant", key), console.log({ fn, variantValue, extras }), console.groupEnd());
|
|
2522
|
+
variantValue = fn(value, extras), process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupCollapsed(" expanded functional variant", key), console.log({ fn, variantValue, extras }), console.groupEnd());
|
|
1844
2523
|
}
|
|
1845
2524
|
let fontFamilyResult;
|
|
1846
2525
|
if ((0, import_isObj.isObj)(variantValue)) {
|
|
1847
2526
|
let fontFamilyUpdate = variantValue.fontFamily || variantValue[conf.inverseShorthands.fontFamily];
|
|
1848
|
-
fontFamilyUpdate && (fontFamilyResult = getFontFamilyFromNameOrVariable(fontFamilyUpdate, conf), styleState.fontFamily = fontFamilyResult, debug === "verbose" && console.log(" updating font family", fontFamilyResult)), variantValue = resolveTokensAndVariants(
|
|
2527
|
+
fontFamilyUpdate && (fontFamilyResult = getFontFamilyFromNameOrVariable(fontFamilyUpdate, conf), styleState.fontFamily = fontFamilyResult, process.env.NODE_ENV === "development" && debug === "verbose" && console.log(" updating font family", fontFamilyResult)), variantValue = resolveTokensAndVariants(
|
|
1849
2528
|
key,
|
|
1850
2529
|
variantValue,
|
|
1851
2530
|
styleProps,
|
|
@@ -1874,7 +2553,7 @@ var require_propMapper_native = __commonJS({
|
|
|
1874
2553
|
var variableToFontNameCache = /* @__PURE__ */ new WeakMap(), fontFamilyCache = /* @__PURE__ */ new WeakMap(), getPropMappedFontFamily = (expanded) => expanded && fontFamilyCache.get(expanded), resolveTokensAndVariants = (key, value, styleProps, styleState, parentVariantKey) => {
|
|
1875
2554
|
var _a;
|
|
1876
2555
|
let { conf, staticConfig, debug, theme } = styleState, { variants } = staticConfig, res = {};
|
|
1877
|
-
debug === "verbose" && console.log(" - resolveTokensAndVariants", key, value);
|
|
2556
|
+
process.env.NODE_ENV === "development" && debug === "verbose" && console.log(" - resolveTokensAndVariants", key, value);
|
|
1878
2557
|
for (let rKey in value) {
|
|
1879
2558
|
let fKey = conf.shorthands[rKey] || rKey, val = value[rKey];
|
|
1880
2559
|
if (variants && fKey in variants) {
|
|
@@ -1903,10 +2582,10 @@ var require_propMapper_native = __commonJS({
|
|
|
1903
2582
|
}
|
|
1904
2583
|
if ((0, import_isObj.isObj)(val)) {
|
|
1905
2584
|
let subObject = resolveTokensAndVariants(fKey, val, styleProps, styleState, key);
|
|
1906
|
-
debug === "verbose" && console.log("object", fKey, subObject), res[fKey] ??= {}, Object.assign(res[fKey], subObject);
|
|
2585
|
+
process.env.NODE_ENV === "development" && debug === "verbose" && console.log("object", fKey, subObject), res[fKey] ??= {}, Object.assign(res[fKey], subObject);
|
|
1907
2586
|
} else
|
|
1908
2587
|
res[fKey] = val;
|
|
1909
|
-
debug && ((_a = res[fKey]) == null ? void 0 : _a[0]) === "$" && console.warn(`\u26A0\uFE0F Missing token in theme ${theme.name}:`, fKey, res[fKey], theme);
|
|
2588
|
+
process.env.NODE_ENV === "development" && debug && ((_a = res[fKey]) == null ? void 0 : _a[0]) === "$" && console.warn(`\u26A0\uFE0F Missing token in theme ${theme.name}:`, fKey, res[fKey], theme);
|
|
1910
2589
|
}
|
|
1911
2590
|
return res;
|
|
1912
2591
|
}, tokenCats = ["size", "color", "radius", "space", "zIndex"].map((name) => ({
|
|
@@ -1934,7 +2613,7 @@ var require_propMapper_native = __commonJS({
|
|
|
1934
2613
|
return value;
|
|
1935
2614
|
let { theme, conf = (0, import_config.getConfig)(), context, fontFamily } = styleState, tokensParsed = conf.tokensParsed, valOrVar, hasSet = !1;
|
|
1936
2615
|
if (theme && value in theme)
|
|
1937
|
-
styleState.debug === "verbose" && console.log(` - getting theme value for ${key} from ${value}`), valOrVar = theme[value], hasSet = !0;
|
|
2616
|
+
process.env.NODE_ENV === "development" && styleState.debug === "verbose" && console.log(` - getting theme value for ${key} from ${value}`), valOrVar = theme[value], hasSet = !0;
|
|
1938
2617
|
else if (value in conf.specificTokens)
|
|
1939
2618
|
hasSet = !0, valOrVar = conf.specificTokens[value];
|
|
1940
2619
|
else {
|
|
@@ -1965,7 +2644,7 @@ var require_propMapper_native = __commonJS({
|
|
|
1965
2644
|
spaceVar != null && (valOrVar = spaceVar, hasSet = !0);
|
|
1966
2645
|
}
|
|
1967
2646
|
}
|
|
1968
|
-
return hasSet ? resolveVariableValue(valOrVar, resolveAs) : (import_isDevTools.isDevTools && styleState.debug === "verbose" && (console.groupCollapsed(" \uFE52 propMap (val)", key, value), console.log({ valOrVar, theme, hasSet }, theme ? theme[key] : ""), console.groupEnd()), value);
|
|
2647
|
+
return hasSet ? resolveVariableValue(valOrVar, resolveAs) : (process.env.NODE_ENV === "development" && import_isDevTools.isDevTools && styleState.debug === "verbose" && (console.groupCollapsed(" \uFE52 propMap (val)", key, value), console.log({ valOrVar, theme, hasSet }, theme ? theme[key] : ""), console.groupEnd()), value);
|
|
1969
2648
|
};
|
|
1970
2649
|
function resolveVariableValue(valOrVar, resolveVariablesAs) {
|
|
1971
2650
|
return resolveVariablesAs === "none" ? valOrVar : (0, import_createVariable.isVariable)(valOrVar) ? !import_constants2.isWeb || resolveVariablesAs === "value" ? valOrVar.val : valOrVar.variable : valOrVar;
|
|
@@ -2017,7 +2696,7 @@ var require_ThemeManager_native = __commonJS({
|
|
|
2017
2696
|
getNonComponentParentManager: () => getNonComponentParentManager
|
|
2018
2697
|
});
|
|
2019
2698
|
module2.exports = __toCommonJS2(ThemeManager_exports);
|
|
2020
|
-
var import_constants2 =
|
|
2699
|
+
var import_constants2 = require_index_native2(), import_config = require_config_native(), import_constants22 = require_constants_native(), emptyState = { name: "" };
|
|
2021
2700
|
function getHasThemeUpdatingProps(props) {
|
|
2022
2701
|
return props.name || props.componentName || props.inverse || props.reset;
|
|
2023
2702
|
}
|
|
@@ -2028,9 +2707,9 @@ var require_ThemeManager_native = __commonJS({
|
|
|
2028
2707
|
return;
|
|
2029
2708
|
}
|
|
2030
2709
|
if (!parentManagerIn)
|
|
2031
|
-
throw new Error(
|
|
2710
|
+
throw process.env.NODE_ENV !== "production" ? new Error(
|
|
2032
2711
|
"No parent manager given, this is likely due to duplicated Tamagui dependencies. Check your lockfile for mis-matched versions. It could also be from an error somewhere else in your stack causing Tamagui to recieve undefined context, you can try putting some ErrorBoundary components around other areas of your app, or a Suspense boundary."
|
|
2033
|
-
);
|
|
2712
|
+
) : "\u274C 0";
|
|
2034
2713
|
if (this.parentManager = parentManagerIn, !this.updateStateFromProps(props, !1))
|
|
2035
2714
|
return parentManagerIn || this;
|
|
2036
2715
|
}
|
|
@@ -2044,7 +2723,7 @@ var require_ThemeManager_native = __commonJS({
|
|
|
2044
2723
|
updateState(nextState, shouldNotify = !0) {
|
|
2045
2724
|
this.state = nextState;
|
|
2046
2725
|
let names = this.state.name.split("_"), lastName = names[names.length - 1][0];
|
|
2047
|
-
this.isComponent = lastName[0] === lastName[0].toUpperCase(), this._allKeys = null, this.scheme = names[0] === "light" ? "light" : names[0] === "dark" ? "dark" : null, this._numChangeEventsSent ??= 0, this._numChangeEventsSent
|
|
2726
|
+
this.isComponent = lastName[0] === lastName[0].toUpperCase(), this._allKeys = null, this.scheme = names[0] === "light" ? "light" : names[0] === "dark" ? "dark" : null, process.env.NODE_ENV === "development" && (this._numChangeEventsSent ??= 0, this._numChangeEventsSent++), shouldNotify && queueMicrotask(() => {
|
|
2048
2727
|
this.notify();
|
|
2049
2728
|
});
|
|
2050
2729
|
}
|
|
@@ -2072,7 +2751,7 @@ var require_ThemeManager_native = __commonJS({
|
|
|
2072
2751
|
this.themeListeners.forEach((cb) => cb(this.state.name, this, forced));
|
|
2073
2752
|
}
|
|
2074
2753
|
onChangeTheme(cb, debugId) {
|
|
2075
|
-
return debugId && (this._listeningIds ??= /* @__PURE__ */ new Set(), this._listeningIds.add(debugId)), this.themeListeners.add(cb), () => {
|
|
2754
|
+
return process.env.NODE_ENV === "development" && debugId && (this._listeningIds ??= /* @__PURE__ */ new Set(), this._listeningIds.add(debugId)), this.themeListeners.add(cb), () => {
|
|
2076
2755
|
this.themeListeners.delete(cb);
|
|
2077
2756
|
};
|
|
2078
2757
|
}
|
|
@@ -2090,7 +2769,7 @@ var require_ThemeManager_native = __commonJS({
|
|
|
2090
2769
|
if (!props.name && !props.inverse && !props.reset && !props.componentName)
|
|
2091
2770
|
return null;
|
|
2092
2771
|
if (props.reset && !isDirectParentAComponentTheme && !(parentManager != null && parentManager.parentManager))
|
|
2093
|
-
return console.warn("Cannot reset no grandparent exists"), null;
|
|
2772
|
+
return process.env.NODE_ENV === "development" && console.warn("Cannot reset no grandparent exists"), null;
|
|
2094
2773
|
let result = null, nextName = props.reset ? isDirectParentAComponentTheme ? ((_a = parentManager == null ? void 0 : parentManager.state) == null ? void 0 : _a.name) || "" : ((_c = (_b = parentManager == null ? void 0 : parentManager.parentManager) == null ? void 0 : _b.state) == null ? void 0 : _c.name) || "" : props.name || "", { componentName } = props, parentName = props.reset ? isDirectParentAComponentTheme ? (
|
|
2095
2774
|
// here because parentManager already skipped componentTheme so we have to only go up once
|
|
2096
2775
|
((_d = parentManager == null ? void 0 : parentManager.parentManager) == null ? void 0 : _d.state.name) || ""
|
|
@@ -2099,7 +2778,7 @@ var require_ThemeManager_native = __commonJS({
|
|
|
2099
2778
|
let base = parentName.split(import_constants22.THEME_NAME_SEPARATOR), lastSegment = base[base.length - 1], isParentComponentTheme = parentName && lastSegment[0].toUpperCase() === lastSegment[0];
|
|
2100
2779
|
isParentComponentTheme && base.pop();
|
|
2101
2780
|
let parentBaseTheme = isParentComponentTheme ? base.slice(0, base.length).join(import_constants22.THEME_NAME_SEPARATOR) : parentName, max = base.length, min = componentName && !nextName ? max : 0;
|
|
2102
|
-
typeof props.debug == "string" && (console.groupCollapsed("ThemeManager.getState()"), console.log({
|
|
2781
|
+
process.env.NODE_ENV === "development" && typeof props.debug == "string" && (console.groupCollapsed("ThemeManager.getState()"), console.log({
|
|
2103
2782
|
props,
|
|
2104
2783
|
parentName,
|
|
2105
2784
|
parentBaseTheme,
|
|
@@ -2134,7 +2813,7 @@ var require_ThemeManager_native = __commonJS({
|
|
|
2134
2813
|
potentials = [...componentPotentials, ...potentials, ...allComponentThemes];
|
|
2135
2814
|
}
|
|
2136
2815
|
let found = potentials.find((t) => t in themes);
|
|
2137
|
-
if (typeof props.debug == "string" && console.log(" - ", { found, potentials, parentManager }), found) {
|
|
2816
|
+
if (process.env.NODE_ENV === "development" && typeof props.debug == "string" && console.log(" - ", { found, potentials, parentManager }), found) {
|
|
2138
2817
|
result = {
|
|
2139
2818
|
name: found,
|
|
2140
2819
|
theme: themes[found],
|
|
@@ -2146,7 +2825,7 @@ var require_ThemeManager_native = __commonJS({
|
|
|
2146
2825
|
break;
|
|
2147
2826
|
}
|
|
2148
2827
|
}
|
|
2149
|
-
return typeof props.debug == "string" && typeof window < "u" && (console.warn("ThemeManager.getState():", {
|
|
2828
|
+
return process.env.NODE_ENV === "development" && typeof props.debug == "string" && typeof window < "u" && (console.warn("ThemeManager.getState():", {
|
|
2150
2829
|
result
|
|
2151
2830
|
}), console.trace(), console.groupEnd()), result;
|
|
2152
2831
|
}
|
|
@@ -2225,7 +2904,7 @@ var require_useTheme_native = __commonJS({
|
|
|
2225
2904
|
useThemeWithState: () => useThemeWithState
|
|
2226
2905
|
});
|
|
2227
2906
|
module2.exports = __toCommonJS2(useTheme_exports);
|
|
2228
|
-
var import_constants2 =
|
|
2907
|
+
var import_constants2 = require_index_native2(), import_react = require("react"), import_config = require_config_native(), import_createVariable = require_createVariable_native(), import_createProxy = require_createProxy_native(), import_ThemeManager = require_ThemeManager_native(), import_ThemeManagerContext = require_ThemeManagerContext_native(), import_getThemeUnwrapped = require_getThemeUnwrapped_native(), emptyProps = { name: null }, cached;
|
|
2229
2908
|
function getDefaultThemeProxied() {
|
|
2230
2909
|
if (cached)
|
|
2231
2910
|
return cached;
|
|
@@ -2243,20 +2922,20 @@ var require_useTheme_native = __commonJS({
|
|
|
2243
2922
|
import_constants2.isServer ? void 0 : () => {
|
|
2244
2923
|
var _a, _b;
|
|
2245
2924
|
let next = ((_a = props.shouldUpdate) == null ? void 0 : _a.call(props)) ?? (keys.current.length > 0 ? !0 : void 0);
|
|
2246
|
-
return props.debug && props.debug !== "profile" && console.log(" \u{1F3A8} useTheme() shouldUpdate?", next, {
|
|
2925
|
+
return process.env.NODE_ENV === "development" && props.debug && props.debug !== "profile" && console.log(" \u{1F3A8} useTheme() shouldUpdate?", next, {
|
|
2247
2926
|
shouldUpdateProp: (_b = props.shouldUpdate) == null ? void 0 : _b.call(props),
|
|
2248
2927
|
keys: [...keys.current]
|
|
2249
2928
|
}), next;
|
|
2250
2929
|
}
|
|
2251
2930
|
), { themeManager, state } = changedThemeState, { theme, name, className } = state;
|
|
2252
2931
|
if (!theme)
|
|
2253
|
-
throw new Error(
|
|
2932
|
+
throw process.env.NODE_ENV === "development" ? new Error(
|
|
2254
2933
|
`No theme found given props ${JSON.stringify(
|
|
2255
2934
|
props
|
|
2256
2935
|
)}. Themes given to tamagui are: ${Object.keys((0, import_config.getConfig)().themes)}`
|
|
2257
|
-
);
|
|
2936
|
+
) : "\u274C 1";
|
|
2258
2937
|
let themeProxied = (0, import_react.useMemo)(() => getThemeProxied(theme, themeManager, keys.current, props.debug), [theme, name, className, themeManager]);
|
|
2259
|
-
return props.debug === "verbose" && (console.groupCollapsed(" \u{1F539} useTheme =>", name), console.log("returning state", changedThemeState, "from props", props), console.groupEnd()), [changedThemeState, themeProxied];
|
|
2938
|
+
return process.env.NODE_ENV === "development" && props.debug === "verbose" && (console.groupCollapsed(" \u{1F539} useTheme =>", name), console.log("returning state", changedThemeState, "from props", props), console.groupEnd()), [changedThemeState, themeProxied];
|
|
2260
2939
|
};
|
|
2261
2940
|
function getThemeProxied(theme, themeManager, keys, debug) {
|
|
2262
2941
|
return (0, import_createProxy.createProxy)(theme, {
|
|
@@ -2280,7 +2959,7 @@ var require_useTheme_native = __commonJS({
|
|
|
2280
2959
|
// when they touch the actual value we only track it
|
|
2281
2960
|
// if its a variable (web), its ignored!
|
|
2282
2961
|
get(_2, subkey) {
|
|
2283
|
-
return keys && (subkey === "val" || subkey === "get" && !import_constants2.isWeb) && !keys.includes(keyString) && (keys.push(keyString), debug && console.log(` \u{1F3A8} useTheme() tracking new key: ${keyString}`)), subkey === "get" ? () => (0, import_createVariable.getVariable)(val) : Reflect.get(val, subkey);
|
|
2962
|
+
return keys && (subkey === "val" || subkey === "get" && !import_constants2.isWeb) && !keys.includes(keyString) && (keys.push(keyString), process.env.NODE_ENV === "development" && debug && console.log(` \u{1F3A8} useTheme() tracking new key: ${keyString}`)), subkey === "get" ? () => (0, import_createVariable.getVariable)(val) : Reflect.get(val, subkey);
|
|
2284
2963
|
}
|
|
2285
2964
|
});
|
|
2286
2965
|
}
|
|
@@ -2321,7 +3000,7 @@ var require_useTheme_native = __commonJS({
|
|
|
2321
3000
|
forced && setThemeState((prev) => createState(prev, !0));
|
|
2322
3001
|
}), disposeChangeListener = parentManager == null ? void 0 : parentManager.onChangeTheme((name, manager) => {
|
|
2323
3002
|
let force = shouldUpdate == null ? void 0 : shouldUpdate(), doUpdate = force ?? !!(keys != null && keys.length || isNewTheme);
|
|
2324
|
-
props.debug && console.log(" \u{1F538} onChange", themeManager.id, {
|
|
3003
|
+
process.env.NODE_ENV === "development" && props.debug && console.log(" \u{1F538} onChange", themeManager.id, {
|
|
2325
3004
|
force,
|
|
2326
3005
|
doUpdate,
|
|
2327
3006
|
props,
|
|
@@ -2342,7 +3021,7 @@ var require_useTheme_native = __commonJS({
|
|
|
2342
3021
|
props.name,
|
|
2343
3022
|
props.reset,
|
|
2344
3023
|
mounted
|
|
2345
|
-
]), props.debug !== "profile" && (0, import_react.useEffect)(() => (globalThis.TamaguiThemeManagers ??= /* @__PURE__ */ new Set(), globalThis.TamaguiThemeManagers.add(themeManager), () => {
|
|
3024
|
+
]), process.env.NODE_ENV === "development" && props.debug !== "profile" && (0, import_react.useEffect)(() => (globalThis.TamaguiThemeManagers ??= /* @__PURE__ */ new Set(), globalThis.TamaguiThemeManagers.add(themeManager), () => {
|
|
2346
3025
|
globalThis.TamaguiThemeManagers.delete(themeManager);
|
|
2347
3026
|
}), [themeManager])), isInversingOnMount) {
|
|
2348
3027
|
if (!parentManager)
|
|
@@ -2388,7 +3067,7 @@ var require_useTheme_native = __commonJS({
|
|
|
2388
3067
|
isNewTheme: isNewTheme2,
|
|
2389
3068
|
mounted: mounted2
|
|
2390
3069
|
};
|
|
2391
|
-
if (props.debug && import_constants2.isClient) {
|
|
3070
|
+
if (process.env.NODE_ENV === "development" && props.debug && import_constants2.isClient) {
|
|
2392
3071
|
console.groupCollapsed(` \u{1F537} ${themeManager2.id} useChangeThemeEffect createState`);
|
|
2393
3072
|
let parentState = { ...parentManager == null ? void 0 : parentManager.state }, parentId = parentManager == null ? void 0 : parentManager.id, themeManagerState = { ...themeManager2.state };
|
|
2394
3073
|
console.log({
|
|
@@ -2441,18 +3120,21 @@ var require_useMedia_native = __commonJS({
|
|
|
2441
3120
|
useMediaPropsActive: () => useMediaPropsActive2
|
|
2442
3121
|
});
|
|
2443
3122
|
module2.exports = __toCommonJS2(useMedia_exports);
|
|
2444
|
-
var import_constants2 =
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
key
|
|
2450
|
-
|
|
2451
|
-
|
|
3123
|
+
var import_constants2 = require_index_native2(), import_react = require("react"), import_config = require_config_native(), import_createProxy = require_createProxy_native(), import_matchMedia = require_matchMedia_native(), import_propMapper = require_propMapper_native(), import_pseudoDescriptors = require_pseudoDescriptors_native(), import_useTheme = require_useTheme_native(), mediaState2 = (
|
|
3124
|
+
// development only safeguard
|
|
3125
|
+
process.env.NODE_ENV === "development" ? (0, import_createProxy.createProxy)(
|
|
3126
|
+
{},
|
|
3127
|
+
{
|
|
3128
|
+
get(target, key) {
|
|
3129
|
+
if (typeof key == "string" && key[0] === "$" && // dont error on $$typeof
|
|
3130
|
+
key[1] !== "$")
|
|
3131
|
+
throw new Error(`Access mediaState should not use "$": ${key}`);
|
|
3132
|
+
return Reflect.get(target, key);
|
|
3133
|
+
}
|
|
2452
3134
|
}
|
|
2453
|
-
}
|
|
3135
|
+
) : {}
|
|
2454
3136
|
), mediaQueryConfig2 = {}, getMedia2 = () => mediaState2, mediaKeys = /* @__PURE__ */ new Set(), isMediaKey = (key) => mediaKeys.has(key) || key[0] === "$" && (key.startsWith("$platform-") || key.startsWith("$theme-") || key.startsWith("$group-")), initState, getInitialMediaState = () => ((0, import_config.getConfig)().disableSSR ? mediaState2 : initState) || {}, defaultMediaImportance = Object.keys(import_pseudoDescriptors.pseudoDescriptors).length, mediaKeysOrdered, getMediaKeyImportance = (key) => {
|
|
2455
|
-
if (key[0] === "$")
|
|
3137
|
+
if (process.env.NODE_ENV === "development" && key[0] === "$")
|
|
2456
3138
|
throw new Error("use short key");
|
|
2457
3139
|
return (0, import_config.getConfig)().settings.mediaPropOrder ? defaultMediaImportance : mediaKeysOrdered.indexOf(key) + 100;
|
|
2458
3140
|
}, dispose = /* @__PURE__ */ new Set(), mediaVersion = 0, configureMedia2 = (config) => {
|
|
@@ -2618,7 +3300,7 @@ var require_Tamagui_native = __commonJS({
|
|
|
2618
3300
|
setIdentifierValue: () => setIdentifierValue
|
|
2619
3301
|
});
|
|
2620
3302
|
module2.exports = __toCommonJS2(Tamagui_exports);
|
|
2621
|
-
var Helpers = __toESM2(
|
|
3303
|
+
var Helpers = __toESM2(require_index_native4()), import_config = require_config_native(), import_insertStyleRule = require_insertStyleRule_native(), import_useMedia = require_useMedia_native(), TamaguiManager = class {
|
|
2622
3304
|
constructor() {
|
|
2623
3305
|
this.Helpers = Helpers;
|
|
2624
3306
|
}
|
|
@@ -2671,7 +3353,7 @@ var require_compose_refs_native = __commonJS({
|
|
|
2671
3353
|
useComposedRefs: () => useComposedRefs
|
|
2672
3354
|
});
|
|
2673
3355
|
module2.exports = __toCommonJS2(compose_refs_exports);
|
|
2674
|
-
var
|
|
3356
|
+
var React = __toESM2(require("react"));
|
|
2675
3357
|
function setRef(ref, value) {
|
|
2676
3358
|
typeof ref == "function" ? ref(value) : ref && (ref.current = value);
|
|
2677
3359
|
}
|
|
@@ -2679,13 +3361,13 @@ var require_compose_refs_native = __commonJS({
|
|
|
2679
3361
|
return (node) => refs.forEach((ref) => setRef(ref, node));
|
|
2680
3362
|
}
|
|
2681
3363
|
function useComposedRefs(...refs) {
|
|
2682
|
-
return
|
|
3364
|
+
return React.useCallback(composeRefs(...refs), refs);
|
|
2683
3365
|
}
|
|
2684
3366
|
}
|
|
2685
3367
|
});
|
|
2686
3368
|
|
|
2687
3369
|
// ../compose-refs/dist/cjs/index.native.js
|
|
2688
|
-
var
|
|
3370
|
+
var require_index_native6 = __commonJS({
|
|
2689
3371
|
"../compose-refs/dist/cjs/index.native.js"(exports, module2) {
|
|
2690
3372
|
"use strict";
|
|
2691
3373
|
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __copyProps2 = (to, from, except, desc) => {
|
|
@@ -2700,7 +3382,7 @@ var require_index_native5 = __commonJS({
|
|
|
2700
3382
|
});
|
|
2701
3383
|
|
|
2702
3384
|
// ../use-did-finish-ssr/dist/cjs/index.native.js
|
|
2703
|
-
var
|
|
3385
|
+
var require_index_native7 = __commonJS({
|
|
2704
3386
|
"../use-did-finish-ssr/dist/cjs/index.native.js"(exports, module2) {
|
|
2705
3387
|
"use strict";
|
|
2706
3388
|
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
@@ -3107,7 +3789,7 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
3107
3789
|
useSplitStyles: () => useSplitStyles
|
|
3108
3790
|
});
|
|
3109
3791
|
module2.exports = __toCommonJS2(getSplitStyles_exports);
|
|
3110
|
-
var import_constants2 =
|
|
3792
|
+
var import_constants2 = require_index_native2(), import_helpers = require_index_native4(), import_react = require("react"), import_config = require_config_native(), import_accessibilityDirectMap = require_accessibilityDirectMap_native(), import_isDevTools = require_isDevTools_native(), import_useMedia = require_useMedia_native(), import_createMediaStyle = require_createMediaStyle_native(), import_expandStyles = require_expandStyles_native(), import_getGroupPropParts = require_getGroupPropParts_native(), import_getStylesAtomic = require_getStylesAtomic_native(), import_insertStyleRule = require_insertStyleRule_native(), import_normalizeValueWithProperty = require_normalizeValueWithProperty_native(), import_propMapper = require_propMapper_native(), import_pseudoDescriptors = require_pseudoDescriptors_native(), fontFamilyKey = "fontFamily", IS_STATIC = process.env.IS_STATIC === "is_static", conf, PROP_SPLIT = "-", getSplitStyles = (props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, context, elementType, debug) => {
|
|
3111
3793
|
var _a, _b, _c, _e, _f, _g;
|
|
3112
3794
|
conf = conf || (0, import_config.getConfig)();
|
|
3113
3795
|
let { shorthands } = conf, {
|
|
@@ -3134,7 +3816,7 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
3134
3816
|
context,
|
|
3135
3817
|
debug
|
|
3136
3818
|
};
|
|
3137
|
-
debug && debug !== "profile" && import_constants2.isClient && (console.groupCollapsed("getSplitStyles (collapsed)"), console.log({
|
|
3819
|
+
process.env.NODE_ENV === "development" && debug && debug !== "profile" && import_constants2.isClient && (console.groupCollapsed("getSplitStyles (collapsed)"), console.log({
|
|
3138
3820
|
props,
|
|
3139
3821
|
staticConfig,
|
|
3140
3822
|
shouldDoClasses,
|
|
@@ -3201,7 +3883,7 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
3201
3883
|
continue;
|
|
3202
3884
|
let shouldPassProp = !isStyleProp || // is in parent variants
|
|
3203
3885
|
isHOC && (parentStaticConfig == null ? void 0 : parentStaticConfig.variants) && keyInit in parentStaticConfig.variants || (inlineProps == null ? void 0 : inlineProps.has(keyInit)), isHOCShouldPassThrough = !!(isHOC && (isShorthand || isValidStyleKeyInit || isMediaOrPseudo || (_a = parentStaticConfig == null ? void 0 : parentStaticConfig.variants) != null && _a[keyInit] || keyInit in skipProps)), shouldPassThrough = shouldPassProp || isHOCShouldPassThrough;
|
|
3204
|
-
if (debug === "verbose" && (console.groupCollapsed(
|
|
3886
|
+
if (process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupCollapsed(
|
|
3205
3887
|
`\u{1F539}\u{1F539}\u{1F539}\u{1F539} ${keyOg}${keyInit !== keyOg ? ` (shorthand for ${keyInit})` : ""} ${shouldPassThrough ? "(pass)" : ""} \u{1F539}\u{1F539}\u{1F539}\u{1F539}`
|
|
3206
3888
|
), console.log({ isVariant, valInit, shouldPassProp }), import_constants2.isClient && console.log({
|
|
3207
3889
|
variants,
|
|
@@ -3217,7 +3899,7 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
3217
3899
|
continue;
|
|
3218
3900
|
}
|
|
3219
3901
|
let expanded = isMediaOrPseudo || !isVariant && !isValidStyleKeyInit ? [[keyInit, valInit]] : (0, import_propMapper.propMapper)(keyInit, valInit, styleState), next = (0, import_propMapper.getPropMappedFontFamily)(expanded);
|
|
3220
|
-
if (next && (styleState.fontFamily = next), debug === "verbose") {
|
|
3902
|
+
if (next && (styleState.fontFamily = next), process.env.NODE_ENV === "development" && debug === "verbose") {
|
|
3221
3903
|
console.groupCollapsed(" \u{1F4A0} expanded", keyInit, valInit);
|
|
3222
3904
|
try {
|
|
3223
3905
|
!import_constants2.isServer && import_isDevTools.isDevTools && (console.log({
|
|
@@ -3244,7 +3926,7 @@ current`, {
|
|
|
3244
3926
|
for (let [key, val] of expanded)
|
|
3245
3927
|
if (!(val == null || key in usedKeys)) {
|
|
3246
3928
|
if (isPseudo = key in import_helpers.validPseudoKeys, isMedia = !isPseudo && !isValidStyleKeyInit && (0, import_useMedia.isMediaKey)(key), isMediaOrPseudo = isMedia || isPseudo, isVariant = variants && key in variants, (inlineProps != null && inlineProps.has(key) || IS_STATIC && inlineWhenUnflattened != null && inlineWhenUnflattened.has(key)) && (viewProps[key] = props[key] ?? val), isHOC && (isMediaOrPseudo || ((_b = parentStaticConfig == null ? void 0 : parentStaticConfig.variants) == null ? void 0 : _b[keyInit]))) {
|
|
3247
|
-
passDownProp(viewProps, key, val, isMediaOrPseudo), debug === "verbose" && (console.groupCollapsed(` - passing down prop ${key}`), console.log({ val, after: { ...viewProps[key] } }), console.groupEnd());
|
|
3929
|
+
passDownProp(viewProps, key, val, isMediaOrPseudo), process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupCollapsed(` - passing down prop ${key}`), console.log({ val, after: { ...viewProps[key] } }), console.groupEnd());
|
|
3248
3930
|
continue;
|
|
3249
3931
|
}
|
|
3250
3932
|
if (isPseudo) {
|
|
@@ -3256,7 +3938,7 @@ current`, {
|
|
|
3256
3938
|
val,
|
|
3257
3939
|
styleProps.noClassNames
|
|
3258
3940
|
), descriptor = import_pseudoDescriptors.pseudoDescriptors[key], isEnter = key === "enterStyle", isExit = key === "exitStyle";
|
|
3259
|
-
if (!styleProps.isAnimated && !componentState.unmounted && (isEnter || isExit) && console.warn(
|
|
3941
|
+
if (process.env.NODE_ENV === "development" && !styleProps.isAnimated && !componentState.unmounted && (isEnter || isExit) && console.warn(
|
|
3260
3942
|
`No animation prop given to component ${staticConfig.componentName || ""} with enterStyle / exitStyle, these styles will be ignore.`
|
|
3261
3943
|
), !descriptor || isExit && !styleProps.isExiting)
|
|
3262
3944
|
continue;
|
|
@@ -3266,12 +3948,12 @@ current`, {
|
|
|
3266
3948
|
}
|
|
3267
3949
|
if (shouldDoClasses && !isEnter && !isExit) {
|
|
3268
3950
|
let pseudoStyles = (0, import_getStylesAtomic.generateAtomicStyles)(pseudoStyleObject, descriptor);
|
|
3269
|
-
debug === "verbose" && (console.groupCollapsed("pseudo (classes)", key), console.log({ pseudoStyleObject, pseudoStyles }), console.groupEnd());
|
|
3951
|
+
process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupCollapsed("pseudo (classes)", key), console.log({ pseudoStyleObject, pseudoStyles }), console.groupEnd());
|
|
3270
3952
|
for (let psuedoStyle of pseudoStyles)
|
|
3271
3953
|
`${psuedoStyle.property}${PROP_SPLIT}${descriptor.name}` in usedKeys || psuedoStyle.identifier;
|
|
3272
3954
|
} else {
|
|
3273
3955
|
let descriptorKey = descriptor.stateKey || descriptor.name, pseudoState = componentState[descriptorKey], isDisabled = isExit ? !styleProps.isExiting : !pseudoState;
|
|
3274
|
-
import_constants2.isWeb && !import_constants2.isClient && isEnter && (isDisabled = !1), debug === "verbose" && (console.groupCollapsed("pseudo", key, { isDisabled }), console.log(pseudoStyleObject, {
|
|
3956
|
+
import_constants2.isWeb && !import_constants2.isClient && isEnter && (isDisabled = !1), process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupCollapsed("pseudo", key, { isDisabled }), console.log(pseudoStyleObject, {
|
|
3275
3957
|
isDisabled,
|
|
3276
3958
|
descriptorKey,
|
|
3277
3959
|
descriptor,
|
|
@@ -3288,7 +3970,7 @@ current`, {
|
|
|
3288
3970
|
}
|
|
3289
3971
|
} else {
|
|
3290
3972
|
let curImportance = usedKeys[importance] || 0, shouldMerge = importance >= curImportance;
|
|
3291
|
-
shouldMerge && (pseudos ||= {}, pseudos[key] ||= {}, pseudos[key][pkey] = val2, mergeStyle(styleState, pkey, val2), usedKeys[pkey] ||= 1), debug === "verbose" && console.log(" subKey", pkey, shouldMerge, {
|
|
3973
|
+
shouldMerge && (pseudos ||= {}, pseudos[key] ||= {}, pseudos[key][pkey] = val2, mergeStyle(styleState, pkey, val2), usedKeys[pkey] ||= 1), process.env.NODE_ENV === "development" && debug === "verbose" && console.log(" subKey", pkey, shouldMerge, {
|
|
3292
3974
|
importance,
|
|
3293
3975
|
curImportance,
|
|
3294
3976
|
pkey,
|
|
@@ -3324,7 +4006,7 @@ current`, {
|
|
|
3324
4006
|
// TODO try true like pseudo
|
|
3325
4007
|
!1
|
|
3326
4008
|
), mediaKeyShort = key.slice(1);
|
|
3327
|
-
debug === "verbose" && console.log(` \u{1F4FA} ${key}`, { key, val, mediaStyle, props, shouldDoClasses, componentState });
|
|
4009
|
+
process.env.NODE_ENV === "development" && debug === "verbose" && console.log(` \u{1F4FA} ${key}`, { key, val, mediaStyle, props, shouldDoClasses, componentState });
|
|
3328
4010
|
let hasSpace = val.space;
|
|
3329
4011
|
if ((hasSpace || !shouldDoClasses) && (Array.isArray(hasMedia) || (hasMedia = []), hasMedia.push(mediaKeyShort)), shouldDoClasses) {
|
|
3330
4012
|
if (hasSpace && (delete mediaStyle.space, mediaState2[mediaKeyShort])) {
|
|
@@ -3334,7 +4016,7 @@ current`, {
|
|
|
3334
4016
|
usedKeys,
|
|
3335
4017
|
!0
|
|
3336
4018
|
);
|
|
3337
|
-
importance && (space = val.space, usedKeys.space = importance, debug === "verbose" && console.log(
|
|
4019
|
+
importance && (space = val.space, usedKeys.space = importance, process.env.NODE_ENV === "development" && debug === "verbose" && console.log(
|
|
3338
4020
|
`Found more important space for current media ${mediaKeyShort}: ${val} (importance: ${importance})`
|
|
3339
4021
|
));
|
|
3340
4022
|
}
|
|
@@ -3363,7 +4045,7 @@ current`, {
|
|
|
3363
4045
|
} else if (isGroupMedia) {
|
|
3364
4046
|
let groupInfo = (0, import_getGroupPropParts.getGroupPropParts)(mediaKeyShort), groupName = groupInfo.name, groupContext = context == null ? void 0 : context.groups.state[groupName];
|
|
3365
4047
|
if (!groupContext) {
|
|
3366
|
-
debug && console.warn(`No parent with group prop, skipping styles: ${groupName}`);
|
|
4048
|
+
process.env.NODE_ENV === "development" && debug && console.warn(`No parent with group prop, skipping styles: ${groupName}`);
|
|
3367
4049
|
continue;
|
|
3368
4050
|
}
|
|
3369
4051
|
let groupPseudoKey = groupInfo.pseudo, groupMediaKey = groupInfo.media, componentGroupState = (_c = componentState.group) == null ? void 0 : _c[groupName];
|
|
@@ -3415,7 +4097,7 @@ current`, {
|
|
|
3415
4097
|
}
|
|
3416
4098
|
isVariant || (viewProps[key] = val);
|
|
3417
4099
|
}
|
|
3418
|
-
if (debug === "verbose") {
|
|
4100
|
+
if (process.env.NODE_ENV === "development" && debug === "verbose") {
|
|
3419
4101
|
console.groupCollapsed(" \u2714\uFE0F expand complete", keyInit);
|
|
3420
4102
|
try {
|
|
3421
4103
|
console.log("style", { ...style }), console.log("viewProps", { ...viewProps });
|
|
@@ -3450,9 +4132,9 @@ current`, {
|
|
|
3450
4132
|
let overrideFace = (_g = (_f = faceInfo[style.fontWeight]) == null ? void 0 : _f[style.fontStyle || "normal"]) == null ? void 0 : _g.val;
|
|
3451
4133
|
overrideFace && (style.fontFamily = overrideFace, styleState.fontFamily = overrideFace, delete style.fontWeight, delete style.fontStyle);
|
|
3452
4134
|
}
|
|
3453
|
-
debug && debug !== "profile" && console.log(`Found fontFamily native: ${style.fontFamily}`, faceInfo);
|
|
4135
|
+
process.env.NODE_ENV === "development" && debug && debug !== "profile" && console.log(`Found fontFamily native: ${style.fontFamily}`, faceInfo);
|
|
3454
4136
|
}
|
|
3455
|
-
if (className && (classNames.className = className), debug === "verbose" && import_isDevTools.isDevTools) {
|
|
4137
|
+
if (className && (classNames.className = className), process.env.NODE_ENV === "development" && debug === "verbose" && import_isDevTools.isDevTools) {
|
|
3456
4138
|
console.groupCollapsed(" \u{1F539} ===>");
|
|
3457
4139
|
try {
|
|
3458
4140
|
let logs = {
|
|
@@ -3542,6 +4224,7 @@ current`, {
|
|
|
3542
4224
|
// handled after loop so pseudos set usedKeys and override it if necessary
|
|
3543
4225
|
group: 1
|
|
3544
4226
|
};
|
|
4227
|
+
process.env.NODE_ENV === "test" && (skipProps["data-test-renders"] = 1);
|
|
3545
4228
|
Object.assign(skipProps, {
|
|
3546
4229
|
whiteSpace: 1,
|
|
3547
4230
|
wordWrap: 1,
|
|
@@ -3697,7 +4380,7 @@ var require_Theme_native = __commonJS({
|
|
|
3697
4380
|
wrapThemeElements: () => wrapThemeElements
|
|
3698
4381
|
});
|
|
3699
4382
|
module2.exports = __toCommonJS2(Theme_exports);
|
|
3700
|
-
var import_constants2 =
|
|
4383
|
+
var import_constants2 = require_index_native2(), import_react = __toESM2(require("react")), import_createVariable = require_createVariable_native(), import_ThemeManagerContext = require_ThemeManagerContext_native(), import_useTheme = require_useTheme_native(), import_ThemeDebug = require_ThemeDebug_native(), import_jsx_runtime = require("react/jsx-runtime"), Theme = (0, import_react.forwardRef)(function(props, ref) {
|
|
3701
4384
|
if (props.disable)
|
|
3702
4385
|
return props.children;
|
|
3703
4386
|
let isRoot = !!props._isRoot, disableDirectChildTheme = props["disable-child-theme"], themeState = (0, import_useTheme.useChangeThemeEffect)(props, isRoot), children = (0, import_react.useMemo)(() => {
|
|
@@ -3710,7 +4393,7 @@ var require_Theme_native = __commonJS({
|
|
|
3710
4393
|
import_react.default.Children.only(children2), children2 = (0, import_react.cloneElement)(children2, { ref });
|
|
3711
4394
|
} catch {
|
|
3712
4395
|
}
|
|
3713
|
-
return props.debug === "visualize" && (children2 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ThemeDebug.ThemeDebug, { themeState, themeProps: props, children: children2 })), children2;
|
|
4396
|
+
return process.env.NODE_ENV === "development" && props.debug === "visualize" && (children2 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ThemeDebug.ThemeDebug, { themeState, themeProps: props, children: children2 })), children2;
|
|
3714
4397
|
}, [props.children, disableDirectChildTheme]);
|
|
3715
4398
|
return useThemedChildren(themeState, children, props, isRoot);
|
|
3716
4399
|
});
|
|
@@ -3853,7 +4536,7 @@ var require_Slot_native = __commonJS({
|
|
|
3853
4536
|
Slottable: () => Slottable
|
|
3854
4537
|
});
|
|
3855
4538
|
module2.exports = __toCommonJS2(Slot_exports);
|
|
3856
|
-
var import_compose_refs =
|
|
4539
|
+
var import_compose_refs = require_index_native6(), import_constants2 = require_index_native2(), import_helpers = require_index_native4(), import_react = require("react"), import_jsx_runtime = require("react/jsx-runtime"), Slot = (0, import_react.forwardRef)(function(props, forwardedRef) {
|
|
3857
4540
|
let { children, ...slotProps } = props;
|
|
3858
4541
|
if ((0, import_react.isValidElement)(children)) {
|
|
3859
4542
|
let mergedProps = mergeSlotProps(children, slotProps);
|
|
@@ -3914,7 +4597,7 @@ var require_createComponent_native = __commonJS({
|
|
|
3914
4597
|
spacedChildren: () => spacedChildren
|
|
3915
4598
|
});
|
|
3916
4599
|
module2.exports = __toCommonJS2(createComponent_exports);
|
|
3917
|
-
var import_compose_refs =
|
|
4600
|
+
var import_compose_refs = require_index_native6(), import_constants2 = require_index_native2(), import_helpers = require_index_native4(), import_use_did_finish_ssr = require_index_native7(), import_react = __toESM2(require("react")), import_config = require_config_native(), import_constants22 = require_constants_native(), import_ComponentContext = require_ComponentContext_native(), import_createVariable = require_createVariable_native(), import_defaultComponentState = require_defaultComponentState_native(), import_createShallowSetState = require_createShallowSetState_native(), import_getSplitStyles = require_getSplitStyles_native(), import_mergeProps = require_mergeProps_native(), import_proxyThemeVariables = require_proxyThemeVariables_native(), import_themeable = require_themeable_native(), import_useMedia = require_useMedia_native(), import_useTheme = require_useTheme_native(), import_setupHooks = require_setupHooks_native(), import_Slot = require_Slot_native(), import_Theme = require_Theme_native(), import_ThemeDebug = require_ThemeDebug_native(), import_jsx_runtime = require("react/jsx-runtime"), tamaguiConfig, AnimatedText, AnimatedView, initialTheme, time, mouseUps = /* @__PURE__ */ new Set();
|
|
3918
4601
|
if (typeof document < "u") {
|
|
3919
4602
|
let cancelTouches = () => {
|
|
3920
4603
|
mouseUps.forEach((x) => x()), mouseUps.clear();
|
|
@@ -3928,7 +4611,7 @@ var require_createComponent_native = __commonJS({
|
|
|
3928
4611
|
(0, import_config.onConfiguredOnce)((conf) => {
|
|
3929
4612
|
if (config = conf, !tamaguiConfig && (tamaguiConfig = conf, !initialTheme)) {
|
|
3930
4613
|
let next = conf.themes[Object.keys(conf.themes)[0]];
|
|
3931
|
-
initialTheme = (0, import_proxyThemeVariables.proxyThemeVariables)(next), initialTheme || console.log("Warning: Missing theme");
|
|
4614
|
+
initialTheme = (0, import_proxyThemeVariables.proxyThemeVariables)(next), process.env.NODE_ENV === "development" && (initialTheme || console.log("Warning: Missing theme"));
|
|
3932
4615
|
}
|
|
3933
4616
|
});
|
|
3934
4617
|
let {
|
|
@@ -3939,7 +4622,7 @@ var require_createComponent_native = __commonJS({
|
|
|
3939
4622
|
validStyles: validStyles2 = {},
|
|
3940
4623
|
variants = {}
|
|
3941
4624
|
} = staticConfig, defaultComponentClassName = `is_${staticConfig.componentName}`, defaultProps = staticConfig.defaultProps;
|
|
3942
|
-
(_a = staticConfig.defaultProps) != null && _a.debug && process.env.IS_STATIC !== "is_static" && console.log(`\u{1F41B} [${staticConfig.componentName || "Component"}]`, {
|
|
4625
|
+
process.env.NODE_ENV === "development" && (_a = staticConfig.defaultProps) != null && _a.debug && process.env.IS_STATIC !== "is_static" && console.log(`\u{1F41B} [${staticConfig.componentName || "Component"}]`, {
|
|
3943
4626
|
staticConfig,
|
|
3944
4627
|
defaultProps,
|
|
3945
4628
|
defaultPropsKeyOrder: defaultProps ? Object.keys(defaultProps) : []
|
|
@@ -3951,6 +4634,7 @@ var require_createComponent_native = __commonJS({
|
|
|
3951
4634
|
let baseViews = (_b = (_a2 = import_setupHooks.hooks).getBaseViews) == null ? void 0 : _b.call(_a2);
|
|
3952
4635
|
baseViews && (BaseText = baseViews.Text, BaseView = baseViews.View);
|
|
3953
4636
|
}
|
|
4637
|
+
process.env.NODE_ENV === "test" && propsIn["data-test-renders"] && (propsIn["data-test-renders"].current ??= 0, propsIn["data-test-renders"].current += 1);
|
|
3954
4638
|
let componentContext = (0, import_react.useContext)(import_ComponentContext.ComponentContext), styledContextProps, overriddenContextProps, contextValue, { context } = staticConfig;
|
|
3955
4639
|
if (context) {
|
|
3956
4640
|
contextValue = (0, import_react.useContext)(context);
|
|
@@ -3966,20 +4650,20 @@ var require_createComponent_native = __commonJS({
|
|
|
3966
4650
|
let curDefaultProps = styledContextProps ? { ...defaultProps, ...styledContextProps } : defaultProps, props;
|
|
3967
4651
|
curDefaultProps ? props = (0, import_mergeProps.mergeProps)(curDefaultProps, propsIn) : props = propsIn;
|
|
3968
4652
|
let debugProp = props.debug, componentName = props.componentName || staticConfig.componentName;
|
|
3969
|
-
time && time`start (ignore)`;
|
|
4653
|
+
process.env.NODE_ENV === "development" && time && time`start (ignore)`;
|
|
3970
4654
|
let isHydrated = config != null && config.disableSSR ? !0 : (0, import_use_did_finish_ssr.useDidFinishSSR)();
|
|
3971
|
-
time && time`did-finish-ssr`;
|
|
4655
|
+
process.env.NODE_ENV === "development" && time && time`did-finish-ssr`;
|
|
3972
4656
|
let stateRef = (0, import_react.useRef)(
|
|
3973
4657
|
void 0
|
|
3974
4658
|
);
|
|
3975
|
-
stateRef.current ||= {}, time && time`stateref`;
|
|
4659
|
+
stateRef.current ||= {}, process.env.NODE_ENV === "development" && time && time`stateref`;
|
|
3976
4660
|
let hostRef = (0, import_react.useRef)(null), animationsConfig = componentContext.animationDriver, useAnimations = animationsConfig == null ? void 0 : animationsConfig.useAnimations, hasAnimationProp = !!(props.animation || props.style && hasAnimatedStyleValue(props.style)), supportsCSSVars = animationsConfig == null ? void 0 : animationsConfig.supportsCSSVars, willBeAnimated = (() => {
|
|
3977
4661
|
if (import_constants2.isServer && !supportsCSSVars)
|
|
3978
4662
|
return !1;
|
|
3979
4663
|
let curState = stateRef.current;
|
|
3980
4664
|
return !!(hasAnimationProp && !isHOC && useAnimations || curState.hasAnimated);
|
|
3981
4665
|
})(), usePresence = animationsConfig == null ? void 0 : animationsConfig.usePresence, presence = willBeAnimated && (usePresence == null ? void 0 : usePresence()) || null, hasEnterStyle = !!props.enterStyle, needsMount = !!((!import_constants2.isWeb || import_constants2.isClient) && willBeAnimated);
|
|
3982
|
-
time && time`pre-use-state`;
|
|
4666
|
+
process.env.NODE_ENV === "development" && time && time`pre-use-state`;
|
|
3983
4667
|
let initialState = willBeAnimated ? supportsCSSVars ? import_defaultComponentState.defaultComponentStateShouldEnter : import_defaultComponentState.defaultComponentState : import_defaultComponentState.defaultComponentStateMounted, states = (0, import_react.useState)(initialState), state = propsIn.forceStyle ? { ...states[0], [propsIn.forceStyle]: !0 } : states[0], setState = states[1], setStateShallow = (0, import_createShallowSetState.createShallowSetState)(setState), groupName = props.group, groupClassName = groupName ? `t_group_${props.group}` : "";
|
|
3984
4668
|
if (groupName) {
|
|
3985
4669
|
let groupContextState = componentContext.groups.state, og = setStateShallow;
|
|
@@ -3994,11 +4678,11 @@ var require_createComponent_native = __commonJS({
|
|
|
3994
4678
|
groupContextState[groupName] = next;
|
|
3995
4679
|
};
|
|
3996
4680
|
}
|
|
3997
|
-
time && time`use-state`;
|
|
4681
|
+
process.env.NODE_ENV === "development" && time && time`use-state`;
|
|
3998
4682
|
let isAnimated = willBeAnimated;
|
|
3999
4683
|
willBeAnimated && !supportsCSSVars && !presence && isHydrated && (import_constants2.isServer || state.unmounted === !0) && (isAnimated = !1), willBeAnimated && !stateRef.current.hasAnimated && (stateRef.current.hasAnimated = !0);
|
|
4000
4684
|
let componentClassName = props.asChild ? "" : props.componentName ? `is_${props.componentName}` : defaultComponentClassName, hasTextAncestor = !!(import_constants2.isWeb && isText && componentContext.inText), isDisabled = props.disabled ?? ((_c = props.accessibilityState) == null ? void 0 : _c.disabled);
|
|
4001
|
-
time && time`use-context`;
|
|
4685
|
+
process.env.NODE_ENV === "development" && time && time`use-context`;
|
|
4002
4686
|
let element = import_constants2.isWeb && (!Component || typeof Component == "string") && props.tag || Component, BaseTextComponent = BaseText || element || "span", BaseViewComponent = BaseView || element || (hasTextAncestor ? "span" : "div");
|
|
4003
4687
|
AnimatedText = animationsConfig ? animationsConfig.Text : BaseTextComponent, AnimatedView = animationsConfig ? animationsConfig.View : BaseViewComponent;
|
|
4004
4688
|
let elementType = isText ? (isAnimated ? AnimatedText : null) || BaseTextComponent : (isAnimated ? AnimatedView : null) || BaseViewComponent;
|
|
@@ -4006,11 +4690,11 @@ var require_createComponent_native = __commonJS({
|
|
|
4006
4690
|
let presenceState = presence[2];
|
|
4007
4691
|
if (presenceState) {
|
|
4008
4692
|
let isEntering = state.unmounted, isExiting2 = !presenceState.isPresent, enterExitVariant = presenceState.enterExitVariant, enterVariant = enterExitVariant ?? presenceState.enterVariant, exitVariant = enterExitVariant ?? presenceState.exitVariant;
|
|
4009
|
-
isEntering && enterVariant ? (debugProp === "verbose" && console.warn(`Animating presence ENTER "${enterVariant}"`), props[enterVariant] = !0) : isExiting2 && exitVariant && (debugProp === "verbose" && console.warn(`Animating presence EXIT "${enterVariant}"`), props[exitVariant] = !enterExitVariant);
|
|
4693
|
+
isEntering && enterVariant ? (process.env.NODE_ENV === "development" && debugProp === "verbose" && console.warn(`Animating presence ENTER "${enterVariant}"`), props[enterVariant] = !0) : isExiting2 && exitVariant && (process.env.NODE_ENV === "development" && debugProp === "verbose" && console.warn(`Animating presence EXIT "${enterVariant}"`), props[exitVariant] = !enterExitVariant);
|
|
4010
4694
|
}
|
|
4011
4695
|
}
|
|
4012
4696
|
let isAnimatedReactNative = hasAnimationProp && (animationsConfig == null ? void 0 : animationsConfig.isReactNative), isReactNative = !!(staticConfig.isReactNative || isAnimatedReactNative), shouldAvoidClasses = !!(!import_constants2.isWeb || isAnimated || !staticConfig.acceptsClassName || propsIn.disableClassName), shouldForcePseudo = !!propsIn.forceStyle, noClassNames = shouldAvoidClasses || shouldForcePseudo, disableThemeProp = props["data-disable-theme"], disableTheme = disableThemeProp && !willBeAnimated || isHOC;
|
|
4013
|
-
time && time`theme-props`, props.themeShallow && (stateRef.current.themeShallow = !0);
|
|
4697
|
+
process.env.NODE_ENV === "development" && time && time`theme-props`, props.themeShallow && (stateRef.current.themeShallow = !0);
|
|
4014
4698
|
let themeStateProps = {
|
|
4015
4699
|
name: props.theme,
|
|
4016
4700
|
componentName,
|
|
@@ -4020,7 +4704,7 @@ var require_createComponent_native = __commonJS({
|
|
|
4020
4704
|
shouldUpdate: () => stateRef.current.isListeningToTheme,
|
|
4021
4705
|
debug: debugProp
|
|
4022
4706
|
}, isExiting = !state.unmounted && (presence == null ? void 0 : presence[0]) === !1;
|
|
4023
|
-
{
|
|
4707
|
+
if (process.env.NODE_ENV === "development") {
|
|
4024
4708
|
let id = (0, import_react.useId)();
|
|
4025
4709
|
if (debugProp && debugProp !== "profile") {
|
|
4026
4710
|
let name = `${componentName || (Component == null ? void 0 : Component.displayName) || (Component == null ? void 0 : Component.name) || "[Unnamed Component]"}`, type = isAnimatedReactNative ? "(animated)" : isReactNative ? "(rnw)" : "", dataIs = propsIn["data-is"] || "", banner = `${name}${dataIs ? ` ${dataIs}` : ""} ${type} id ${id}`;
|
|
@@ -4047,17 +4731,17 @@ var require_createComponent_native = __commonJS({
|
|
|
4047
4731
|
}), console.groupEnd());
|
|
4048
4732
|
}
|
|
4049
4733
|
}
|
|
4050
|
-
time && time`pre-theme-media`;
|
|
4734
|
+
process.env.NODE_ENV === "development" && time && time`pre-theme-media`;
|
|
4051
4735
|
let [themeState, theme] = (0, import_useTheme.useThemeWithState)(themeStateProps);
|
|
4052
4736
|
elementType = Component || elementType;
|
|
4053
4737
|
let isStringElement = typeof elementType == "string";
|
|
4054
|
-
time && time`theme`;
|
|
4738
|
+
process.env.NODE_ENV === "development" && time && time`theme`;
|
|
4055
4739
|
let mediaState2 = (0, import_useMedia.useMedia)(
|
|
4056
4740
|
// @ts-ignore, we just pass a stable object so we can get it later with
|
|
4057
4741
|
// should match to the one used in `setMediaShouldUpdate` below
|
|
4058
4742
|
stateRef
|
|
4059
4743
|
);
|
|
4060
|
-
time && time`media`, (0, import_createVariable.setDidGetVariableValue)(!1);
|
|
4744
|
+
process.env.NODE_ENV === "development" && time && time`media`, (0, import_createVariable.setDidGetVariableValue)(!1);
|
|
4061
4745
|
let resolveVariablesAs = (
|
|
4062
4746
|
// if HOC + mounted + has animation prop, resolve as value so it passes non-variable to child
|
|
4063
4747
|
isAnimated && !supportsCSSVars || isHOC && state.unmounted == !1 && hasAnimationProp ? "value" : "auto"
|
|
@@ -4080,14 +4764,14 @@ var require_createComponent_native = __commonJS({
|
|
|
4080
4764
|
elementType,
|
|
4081
4765
|
debugProp
|
|
4082
4766
|
);
|
|
4083
|
-
props.group && props.untilMeasured === "hide" && !stateRef.current.hasMeasured && (splitStyles.style.opacity = 0), time && time`split-styles`, stateRef.current.isListeningToTheme = splitStyles.dynamicThemeAccess;
|
|
4767
|
+
props.group && props.untilMeasured === "hide" && !stateRef.current.hasMeasured && (splitStyles.style.opacity = 0), process.env.NODE_ENV === "development" && time && time`split-styles`, stateRef.current.isListeningToTheme = splitStyles.dynamicThemeAccess;
|
|
4084
4768
|
let isMediaArray = splitStyles.hasMedia && Array.isArray(splitStyles.hasMedia), shouldListenForMedia = (0, import_createVariable.didGetVariableValue)() || isMediaArray || noClassNames && splitStyles.hasMedia === !0, mediaListeningKeys = isMediaArray ? splitStyles.hasMedia : null;
|
|
4085
4769
|
(0, import_useMedia.setMediaShouldUpdate)(stateRef, {
|
|
4086
4770
|
enabled: shouldListenForMedia,
|
|
4087
4771
|
keys: mediaListeningKeys
|
|
4088
4772
|
});
|
|
4089
4773
|
let isAnimatedReactNativeWeb = hasAnimationProp && isReactNative;
|
|
4090
|
-
if (debugProp && debugProp !== "profile" && (console.groupCollapsed(">>>"), console.log("props in", propsIn, "mapped to", props, "in order", Object.keys(props)), console.log("splitStyles", splitStyles), console.log("media", { shouldListenForMedia, isMediaArray, mediaListeningKeys }), console.log("className", Object.values(splitStyles.classNames)), import_constants2.isClient && console.log("ref", hostRef, "(click to view)"), console.groupEnd(), debugProp === "break"))
|
|
4774
|
+
if (process.env.NODE_ENV === "development" && debugProp && debugProp !== "profile" && (console.groupCollapsed(">>>"), console.log("props in", propsIn, "mapped to", props, "in order", Object.keys(props)), console.log("splitStyles", splitStyles), console.log("media", { shouldListenForMedia, isMediaArray, mediaListeningKeys }), console.log("className", Object.values(splitStyles.classNames)), import_constants2.isClient && console.log("ref", hostRef, "(click to view)"), console.groupEnd(), debugProp === "break"))
|
|
4091
4775
|
debugger;
|
|
4092
4776
|
let {
|
|
4093
4777
|
viewProps: viewPropsIn,
|
|
@@ -4110,7 +4794,7 @@ var require_createComponent_native = __commonJS({
|
|
|
4110
4794
|
hostRef,
|
|
4111
4795
|
staticConfig
|
|
4112
4796
|
});
|
|
4113
|
-
isAnimated && animations && (animationStyles = animations.style), time && time`animations`;
|
|
4797
|
+
isAnimated && animations && (animationStyles = animations.style), process.env.NODE_ENV === "development" && time && time`animations`;
|
|
4114
4798
|
}
|
|
4115
4799
|
let {
|
|
4116
4800
|
asChild,
|
|
@@ -4138,11 +4822,11 @@ var require_createComponent_native = __commonJS({
|
|
|
4138
4822
|
defaultVariants,
|
|
4139
4823
|
...nonTamaguiProps
|
|
4140
4824
|
} = viewPropsIn;
|
|
4141
|
-
props.untilMeasured && !props.group && console.warn(
|
|
4825
|
+
process.env.NODE_ENV === "development" && props.untilMeasured && !props.group && console.warn(
|
|
4142
4826
|
`You set the untilMeasured prop without setting group. This doesn't work, be sure to set untilMeasured on the parent that sets group, not the children that use the $group- prop.
|
|
4143
4827
|
|
|
4144
4828
|
If you meant to do this, you can disable this warning - either change untilMeasured and group at the same time, or do group={conditional ? 'name' : undefined}`
|
|
4145
|
-
), time && time`destructure`;
|
|
4829
|
+
), process.env.NODE_ENV === "development" && time && time`destructure`;
|
|
4146
4830
|
let disabled = ((_d = props.accessibilityState) == null ? void 0 : _d.disabled) || // @ts-expect-error (comes from core)
|
|
4147
4831
|
props.accessibilityDisabled, viewProps = nonTamaguiProps;
|
|
4148
4832
|
isHOC && _themeProp && (viewProps.theme = _themeProp), groupName && (nonTamaguiProps.onLayout = (0, import_helpers.composeEventHandlers)(
|
|
@@ -4154,12 +4838,12 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
4154
4838
|
}
|
|
4155
4839
|
)), viewProps = nonTamaguiProps;
|
|
4156
4840
|
let composedRef = (0, import_compose_refs.useComposedRefs)(hostRef, forwardedRef);
|
|
4157
|
-
viewProps.ref = composedRef, !isReactNative && !isText && import_constants2.isWeb && !isHOC && import_react.Children.toArray(props.children).forEach((item) => {
|
|
4841
|
+
viewProps.ref = composedRef, process.env.NODE_ENV === "development" && !isReactNative && !isText && import_constants2.isWeb && !isHOC && import_react.Children.toArray(props.children).forEach((item) => {
|
|
4158
4842
|
typeof item == "string" && item !== `
|
|
4159
4843
|
` && console.error(
|
|
4160
4844
|
`Unexpected text node: ${item}. A text node cannot be a child of a <View>.`
|
|
4161
4845
|
);
|
|
4162
|
-
}), time && time`events-hooks`;
|
|
4846
|
+
}), process.env.NODE_ENV === "development" && time && time`events-hooks`;
|
|
4163
4847
|
let unPress = () => setStateShallow({
|
|
4164
4848
|
press: !1,
|
|
4165
4849
|
pressIn: !1
|
|
@@ -4212,7 +4896,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
4212
4896
|
let fontFamilyClassName = fontFamily ? `font_${fontFamily}` : "", style = avoidAnimationStyle ? splitStyles.style : animationStyles || splitStyles.style, className;
|
|
4213
4897
|
viewProps.style = style;
|
|
4214
4898
|
let runtimePressStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.pressStyle), attachPress = !!(groupName || runtimePressStyle || onPress || onPressOut || onPressIn || onLongPress || onClick), runtimeHoverStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.hoverStyle), isHoverable = import_constants2.isWeb && !!(groupName || runtimeHoverStyle || onHoverIn || onHoverOut || onMouseEnter || onMouseLeave), handlesPressEvents = !(import_constants2.isWeb || asChild), shouldAttach = !!(attachPress || isHoverable || noClassNames && "pressStyle" in props || import_constants2.isWeb && noClassNames && "hoverStyle" in props);
|
|
4215
|
-
time && time`events-setup`;
|
|
4899
|
+
process.env.NODE_ENV === "development" && time && time`events-setup`;
|
|
4216
4900
|
let events = shouldAttach && !isDisabled && !asChild ? {
|
|
4217
4901
|
onPressOut: attachPress ? (e) => {
|
|
4218
4902
|
unPress(), onPressOut == null || onPressOut(e), onMouseUp == null || onMouseUp(e);
|
|
@@ -4249,9 +4933,9 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
4249
4933
|
delayPressOut: viewProps.delayPressOut,
|
|
4250
4934
|
focusable: viewProps.focusable ?? !0,
|
|
4251
4935
|
minPressDuration: 0
|
|
4252
|
-
}), time && time`events`, debugProp === "verbose" && console.log("events", { events, isHoverable, attachPress }), (_i = (_h = import_setupHooks.hooks).useEvents) == null || _i.call(_h, viewProps, events, splitStyles, setStateShallow);
|
|
4936
|
+
}), process.env.NODE_ENV === "development" && time && time`events`, process.env.NODE_ENV === "development" && debugProp === "verbose" && console.log("events", { events, isHoverable, attachPress }), (_i = (_h = import_setupHooks.hooks).useEvents) == null || _i.call(_h, viewProps, events, splitStyles, setStateShallow);
|
|
4253
4937
|
let direction = props.spaceDirection || "both";
|
|
4254
|
-
time && time`hooks`;
|
|
4938
|
+
process.env.NODE_ENV === "development" && time && time`hooks`;
|
|
4255
4939
|
let content = !children || asChild ? children : spacedChildren({
|
|
4256
4940
|
separator,
|
|
4257
4941
|
children,
|
|
@@ -4265,8 +4949,8 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
4265
4949
|
onLongPress,
|
|
4266
4950
|
onPressIn,
|
|
4267
4951
|
onPressOut
|
|
4268
|
-
})), time && time`spaced-as-child`, // in test mode disable perf unwrapping so react-testing-library finds Text properly
|
|
4269
|
-
elementType === BaseText || elementType === BaseView ? (viewProps.children = content, content = elementType.render(viewProps, viewProps.ref)) : content = (0, import_react.createElement)(elementType, viewProps, content), time && time`create-element`;
|
|
4952
|
+
})), process.env.NODE_ENV === "development" && time && time`spaced-as-child`, // in test mode disable perf unwrapping so react-testing-library finds Text properly
|
|
4953
|
+
process.env.NODE_ENV !== "test" && (elementType === BaseText || elementType === BaseView) ? (viewProps.children = content, content = elementType.render(viewProps, viewProps.ref)) : content = (0, import_react.createElement)(elementType, viewProps, content), process.env.NODE_ENV === "development" && time && time`create-element`;
|
|
4270
4954
|
let subGroupContext = (0, import_react.useMemo)(() => {
|
|
4271
4955
|
if (groupName)
|
|
4272
4956
|
return {
|
|
@@ -4286,11 +4970,11 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
4286
4970
|
}
|
|
4287
4971
|
};
|
|
4288
4972
|
}, [groupName]);
|
|
4289
|
-
if (groupName && subGroupContext && (content = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ComponentContext.ComponentContext.Provider, { groups: subGroupContext, children: content })), time && time`group-context`, content = disableThemeProp ? content : (0, import_Theme.useThemedChildren)(themeState, content, themeStateProps), time && time`themed-children`, props.debug === "visualize" && (content = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ThemeDebug.ThemeDebug, { themeState, themeProps: props, children: content })), overriddenContextProps) {
|
|
4973
|
+
if (groupName && subGroupContext && (content = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ComponentContext.ComponentContext.Provider, { groups: subGroupContext, children: content })), process.env.NODE_ENV === "development" && time && time`group-context`, content = disableThemeProp ? content : (0, import_Theme.useThemedChildren)(themeState, content, themeStateProps), process.env.NODE_ENV === "development" && time && time`themed-children`, process.env.NODE_ENV === "development" && props.debug === "visualize" && (content = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ThemeDebug.ThemeDebug, { themeState, themeProps: props, children: content })), overriddenContextProps) {
|
|
4290
4974
|
let Provider = staticConfig.context.Provider;
|
|
4291
4975
|
content = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Provider, { ...contextValue, ...overriddenContextProps, children: content });
|
|
4292
4976
|
}
|
|
4293
|
-
if (debugProp && debugProp !== "profile") {
|
|
4977
|
+
if (process.env.NODE_ENV === "development" && debugProp && debugProp !== "profile") {
|
|
4294
4978
|
console.groupCollapsed(`render <${typeof elementType == "string" ? elementType : "Component"} /> with props`);
|
|
4295
4979
|
try {
|
|
4296
4980
|
console.log("viewProps", viewProps), console.log("viewPropsOrder", Object.keys(viewProps));
|
|
@@ -4329,7 +5013,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
4329
5013
|
}
|
|
4330
5014
|
console.groupEnd(), console.groupEnd();
|
|
4331
5015
|
}
|
|
4332
|
-
return time && (time`rest`, globalThis.willPrint || (globalThis.willPrint = !0, setTimeout(() => {
|
|
5016
|
+
return process.env.NODE_ENV === "development" && time && (time`rest`, globalThis.willPrint || (globalThis.willPrint = !0, setTimeout(() => {
|
|
4333
5017
|
delete globalThis.willPrint, time.print(), time = null;
|
|
4334
5018
|
}, 50))), content;
|
|
4335
5019
|
});
|
|
@@ -4450,7 +5134,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
4450
5134
|
})
|
|
4451
5135
|
));
|
|
4452
5136
|
}
|
|
4453
|
-
return props.debug && console.log(" Spaced children", final, props), final;
|
|
5137
|
+
return process.env.NODE_ENV === "development" && props.debug && console.log(" Spaced children", final, props), final;
|
|
4454
5138
|
}
|
|
4455
5139
|
function createSpacer({ key, direction, space, spaceFlex }) {
|
|
4456
5140
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
@@ -4557,7 +5241,7 @@ var require_createVariables_native = __commonJS({
|
|
|
4557
5241
|
createVariables: () => createVariables
|
|
4558
5242
|
});
|
|
4559
5243
|
module2.exports = __toCommonJS2(createVariables_exports);
|
|
4560
|
-
var import_helpers =
|
|
5244
|
+
var import_helpers = require_index_native4(), import_createVariable = require_createVariable_native(), cache = /* @__PURE__ */ new WeakMap(), createVariables = (tokens, parentPath = "", isFont = !1) => {
|
|
4561
5245
|
if (cache.has(tokens))
|
|
4562
5246
|
return tokens;
|
|
4563
5247
|
let res = {}, i = 0;
|
|
@@ -4853,17 +5537,19 @@ var require_createTamagui_native = __commonJS({
|
|
|
4853
5537
|
createTamagui: () => createTamagui
|
|
4854
5538
|
});
|
|
4855
5539
|
module2.exports = __toCommonJS2(createTamagui_exports);
|
|
4856
|
-
var import_constants2 =
|
|
5540
|
+
var import_constants2 = require_index_native2(), import_config = require_config_native(), import_createVariables = require_createVariables_native(), import_getThemeCSSRules = require_getThemeCSSRules_native(), import_insertStyleRule = require_insertStyleRule_native(), import_proxyThemeToParents = require_proxyThemeToParents_native(), import_registerCSSVariable = require_registerCSSVariable_native(), import_themes = require_themes_native(), import_useMedia = require_useMedia_native(), import_insertFont = require_insertFont_native(), import_Tamagui = require_Tamagui_native(), createdConfigs = /* @__PURE__ */ new WeakMap();
|
|
4857
5541
|
function createTamagui(configIn) {
|
|
4858
5542
|
var _a;
|
|
4859
5543
|
if (createdConfigs.has(configIn))
|
|
4860
5544
|
return configIn;
|
|
4861
|
-
if (
|
|
4862
|
-
|
|
4863
|
-
|
|
4864
|
-
|
|
4865
|
-
|
|
4866
|
-
|
|
5545
|
+
if (process.env.NODE_ENV === "development") {
|
|
5546
|
+
if (!configIn.tokens)
|
|
5547
|
+
throw new Error("Must define tokens");
|
|
5548
|
+
if (!configIn.themes)
|
|
5549
|
+
throw new Error("Must define themes");
|
|
5550
|
+
if (!configIn.fonts)
|
|
5551
|
+
throw new Error("Must define fonts");
|
|
5552
|
+
}
|
|
4867
5553
|
let tokens = (0, import_createVariables.createVariables)(configIn.tokens), tokensParsed = {}, tokensMerged = {};
|
|
4868
5554
|
for (let cat in tokens) {
|
|
4869
5555
|
tokensParsed[cat] = {}, tokensMerged[cat] = {};
|
|
@@ -4893,7 +5579,7 @@ var require_createTamagui_native = __commonJS({
|
|
|
4893
5579
|
for (let key in tokens)
|
|
4894
5580
|
for (let skey in tokens[key]) {
|
|
4895
5581
|
let variable = tokens[key][skey];
|
|
4896
|
-
if (specificTokens[`$${key}.${skey}`] = variable, typeof variable > "u")
|
|
5582
|
+
if (specificTokens[`$${key}.${skey}`] = variable, process.env.NODE_ENV === "development" && typeof variable > "u")
|
|
4897
5583
|
throw new Error(
|
|
4898
5584
|
`No value for tokens.${key}.${skey}:
|
|
4899
5585
|
${JSON.stringify(
|
|
@@ -4917,7 +5603,7 @@ ${JSON.stringify(
|
|
|
4917
5603
|
language
|
|
4918
5604
|
};
|
|
4919
5605
|
}
|
|
4920
|
-
let sep = configIn.cssStyleSeparator || " ";
|
|
5606
|
+
let sep = process.env.NODE_ENV === "development" ? configIn.cssStyleSeparator || " " : "";
|
|
4921
5607
|
if (cssRuleSets.push(declarationsToRuleSet2(declarations)), fontDeclarations)
|
|
4922
5608
|
for (let key in fontDeclarations) {
|
|
4923
5609
|
let { name, declarations: declarations2, language = "default" } = fontDeclarations[key], fontSelector = `.font_${name}`, langSelector = `:root .t_lang-${name}-${language} ${fontSelector}`, selectors = language === "default" ? ` ${fontSelector}, ${langSelector}` : langSelector, specificRuleSet = declarationsToRuleSet2(declarations2, selectors);
|
|
@@ -4986,7 +5672,7 @@ ${runtimeStyles}`;
|
|
|
4986
5672
|
// const tokens = [...getToken(tokens.size[0])]
|
|
4987
5673
|
// .spacer-sm + ._dsp_contents._dsp-sm-hidden { margin-left: -var(--${}) }
|
|
4988
5674
|
};
|
|
4989
|
-
return (0, import_useMedia.configureMedia)(config), (0, import_config.setConfig)(config), import_config.configListeners.size && (import_config.configListeners.forEach((cb) => cb(config)), import_config.configListeners.clear()), createdConfigs.set(config, !0), (_a = process.env.DEBUG) != null && _a.startsWith("tamagui") && console.log("Tamagui config:", config), globalThis.Tamagui || (globalThis.Tamagui = import_Tamagui.Tamagui), config;
|
|
5675
|
+
return (0, import_useMedia.configureMedia)(config), (0, import_config.setConfig)(config), import_config.configListeners.size && (import_config.configListeners.forEach((cb) => cb(config)), import_config.configListeners.clear()), createdConfigs.set(config, !0), process.env.NODE_ENV === "development" && ((_a = process.env.DEBUG) != null && _a.startsWith("tamagui") && console.log("Tamagui config:", config), globalThis.Tamagui || (globalThis.Tamagui = import_Tamagui.Tamagui)), config;
|
|
4990
5676
|
}
|
|
4991
5677
|
function getThemesDeduped(themes) {
|
|
4992
5678
|
let dedupedThemes = [], existing = /* @__PURE__ */ new Map();
|
|
@@ -5142,7 +5828,7 @@ var require_styled_native = __commonJS({
|
|
|
5142
5828
|
module2.exports = __toCommonJS2(styled_exports);
|
|
5143
5829
|
var import_createComponent = require_createComponent_native(), import_mergeVariants = require_mergeVariants_native(), import_setupReactNative = require_setupReactNative_native();
|
|
5144
5830
|
function styled(ComponentIn, options, staticExtractionOptions) {
|
|
5145
|
-
if (!ComponentIn)
|
|
5831
|
+
if (process.env.NODE_ENV !== "production" && !ComponentIn)
|
|
5146
5832
|
throw new Error("No component given to styled()");
|
|
5147
5833
|
let parentStaticConfig = ComponentIn.staticConfig, isPlainStyledComponent = !!parentStaticConfig && !(parentStaticConfig.isReactNative || parentStaticConfig.isHOC), Component = parentStaticConfig != null && parentStaticConfig.isHOC && !(parentStaticConfig != null && parentStaticConfig.isStyledHOC) || isPlainStyledComponent ? ComponentIn : (parentStaticConfig == null ? void 0 : parentStaticConfig.Component) || ComponentIn, reactNativeConfig = (0, import_setupReactNative.getReactNativeConfig)(Component), isReactNative = !!(reactNativeConfig || staticExtractionOptions != null && staticExtractionOptions.isReactNative || parentStaticConfig != null && parentStaticConfig.isReactNative || (0, import_setupReactNative.getReactNativeConfig)(parentStaticConfig == null ? void 0 : parentStaticConfig.Component)), staticConfigProps = (() => {
|
|
5148
5834
|
if (options) {
|
|
@@ -5192,7 +5878,7 @@ var require_styled_native = __commonJS({
|
|
|
5192
5878
|
});
|
|
5193
5879
|
|
|
5194
5880
|
// ../web/dist/cjs/types.native.js
|
|
5195
|
-
var
|
|
5881
|
+
var require_types_native3 = __commonJS({
|
|
5196
5882
|
"../web/dist/cjs/types.native.js"(exports, module2) {
|
|
5197
5883
|
"use strict";
|
|
5198
5884
|
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __copyProps2 = (to, from, except, desc) => {
|
|
@@ -5370,7 +6056,7 @@ var require_useThemeName_native = __commonJS({
|
|
|
5370
6056
|
useThemeName: () => useThemeName
|
|
5371
6057
|
});
|
|
5372
6058
|
module2.exports = __toCommonJS2(useThemeName_exports);
|
|
5373
|
-
var import_constants2 =
|
|
6059
|
+
var import_constants2 = require_index_native2(), import_react = require("react"), import_ThemeManagerContext = require_ThemeManagerContext_native();
|
|
5374
6060
|
function useThemeName(opts) {
|
|
5375
6061
|
let manager = (0, import_react.useContext)(import_ThemeManagerContext.ThemeManagerContext), [name, setName] = (0, import_react.useState)((manager == null ? void 0 : manager.state.name) || "");
|
|
5376
6062
|
return (0, import_constants2.useIsomorphicLayoutEffect)(() => {
|
|
@@ -5465,7 +6151,7 @@ var require_useIsTouchDevice_native = __commonJS({
|
|
|
5465
6151
|
useIsTouchDevice: () => useIsTouchDevice
|
|
5466
6152
|
});
|
|
5467
6153
|
module2.exports = __toCommonJS2(useIsTouchDevice_exports);
|
|
5468
|
-
var import_constants2 =
|
|
6154
|
+
var import_constants2 = require_index_native2(), import_use_did_finish_ssr = require_index_native7(), useIsTouchDevice = () => import_constants2.isWeb ? (0, import_use_did_finish_ssr.useDidFinishSSR)() ? import_constants2.isTouchable : !1 : !0;
|
|
5469
6155
|
}
|
|
5470
6156
|
});
|
|
5471
6157
|
|
|
@@ -5513,7 +6199,7 @@ var require_Stack_native = __commonJS({
|
|
|
5513
6199
|
Stack: () => Stack2
|
|
5514
6200
|
});
|
|
5515
6201
|
module2.exports = __toCommonJS2(Stack_exports);
|
|
5516
|
-
var import_helpers =
|
|
6202
|
+
var import_helpers = require_index_native4(), import_constants2 = require_constants_native(), import_createComponent = require_createComponent_native(), Stack2 = (0, import_createComponent.createComponent)({
|
|
5517
6203
|
acceptsClassName: !0,
|
|
5518
6204
|
defaultProps: import_constants2.stackDefaultStyles,
|
|
5519
6205
|
validStyles: import_helpers.validStyles
|
|
@@ -5538,7 +6224,7 @@ var require_View_native = __commonJS({
|
|
|
5538
6224
|
View: () => View
|
|
5539
6225
|
});
|
|
5540
6226
|
module2.exports = __toCommonJS2(View_exports);
|
|
5541
|
-
var import_helpers =
|
|
6227
|
+
var import_helpers = require_index_native4(), import_createComponent = require_createComponent_native(), View = (0, import_createComponent.createComponent)({
|
|
5542
6228
|
acceptsClassName: !0,
|
|
5543
6229
|
defaultProps: {
|
|
5544
6230
|
display: "flex"
|
|
@@ -5565,7 +6251,7 @@ var require_Text_native = __commonJS({
|
|
|
5565
6251
|
Text: () => Text2
|
|
5566
6252
|
});
|
|
5567
6253
|
module2.exports = __toCommonJS2(Text_exports);
|
|
5568
|
-
var import_helpers =
|
|
6254
|
+
var import_helpers = require_index_native4(), import_createComponent = require_createComponent_native(), Text2 = (0, import_createComponent.createComponent)({
|
|
5569
6255
|
acceptsClassName: !0,
|
|
5570
6256
|
isText: !0,
|
|
5571
6257
|
defaultProps: {
|
|
@@ -5612,7 +6298,7 @@ var require_ThemeProvider_native = __commonJS({
|
|
|
5612
6298
|
ThemeProvider: () => ThemeProvider
|
|
5613
6299
|
});
|
|
5614
6300
|
module2.exports = __toCommonJS2(ThemeProvider_exports);
|
|
5615
|
-
var import_constants2 =
|
|
6301
|
+
var import_constants2 = require_index_native2(), import_react = require("react"), import_constants22 = require_constants_native(), import_Theme = require_Theme_native(), import_jsx_runtime = require("react/jsx-runtime"), ThemeProvider = (props) => (import_constants2.isClient && (0, import_react.useLayoutEffect)(() => {
|
|
5616
6302
|
if (props.disableRootThemeClass)
|
|
5617
6303
|
return;
|
|
5618
6304
|
let cn = `${import_constants22.THEME_CLASSNAME_PREFIX}${props.defaultTheme}`, target = props.themeClassNameOnRoot ? document.documentElement : document.body;
|
|
@@ -5680,14 +6366,14 @@ var require_TamaguiProvider_native = __commonJS({
|
|
|
5680
6366
|
TamaguiProvider: () => TamaguiProvider
|
|
5681
6367
|
});
|
|
5682
6368
|
module2.exports = __toCommonJS2(TamaguiProvider_exports);
|
|
5683
|
-
var import_constants2 =
|
|
6369
|
+
var import_constants2 = require_index_native2(), React = __toESM2(require("react")), import_ComponentContext = require_ComponentContext_native(), import_useMedia = require_useMedia_native(), import_ThemeProvider = require_ThemeProvider_native(), import_jsx_runtime = require("react/jsx-runtime");
|
|
5684
6370
|
function TamaguiProvider({
|
|
5685
6371
|
children,
|
|
5686
6372
|
disableInjectCSS,
|
|
5687
6373
|
config,
|
|
5688
6374
|
...themePropsProvider
|
|
5689
6375
|
}) {
|
|
5690
|
-
return import_constants2.isWeb && import_constants2.isServer || (0, import_useMedia.useMediaListeners)(config), import_constants2.isClient &&
|
|
6376
|
+
return import_constants2.isWeb && import_constants2.isServer || (0, import_useMedia.useMediaListeners)(config), import_constants2.isClient && React.useLayoutEffect(() => {
|
|
5691
6377
|
if (document.documentElement.classList.contains("t_unmounted") && document.documentElement.classList.remove("t_unmounted"), disableInjectCSS)
|
|
5692
6378
|
return;
|
|
5693
6379
|
let style = document.createElement("style");
|
|
@@ -5790,7 +6476,7 @@ var require_useEvent_native = __commonJS({
|
|
|
5790
6476
|
});
|
|
5791
6477
|
|
|
5792
6478
|
// ../use-event/dist/cjs/index.native.js
|
|
5793
|
-
var
|
|
6479
|
+
var require_index_native8 = __commonJS({
|
|
5794
6480
|
"../use-event/dist/cjs/index.native.js"(exports, module2) {
|
|
5795
6481
|
"use strict";
|
|
5796
6482
|
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __copyProps2 = (to, from, except, desc) => {
|
|
@@ -5806,7 +6492,7 @@ var require_index_native7 = __commonJS({
|
|
|
5806
6492
|
});
|
|
5807
6493
|
|
|
5808
6494
|
// ../web/dist/cjs/index.native.js
|
|
5809
|
-
var
|
|
6495
|
+
var require_index_native9 = __commonJS({
|
|
5810
6496
|
"../web/dist/cjs/index.native.js"(exports, module2) {
|
|
5811
6497
|
"use strict";
|
|
5812
6498
|
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
@@ -5846,7 +6532,7 @@ var require_index_native8 = __commonJS({
|
|
|
5846
6532
|
__reExport2(src_exports2, require_insertFont_native(), module2.exports);
|
|
5847
6533
|
__reExport2(src_exports2, require_styled_native(), module2.exports);
|
|
5848
6534
|
__reExport2(src_exports2, require_setupReactNative_native(), module2.exports);
|
|
5849
|
-
__reExport2(src_exports2,
|
|
6535
|
+
__reExport2(src_exports2, require_types_native3(), module2.exports);
|
|
5850
6536
|
__reExport2(src_exports2, require_GetRef_native(), module2.exports);
|
|
5851
6537
|
var import_config = require_config_native();
|
|
5852
6538
|
__reExport2(src_exports2, require_constants_native(), module2.exports);
|
|
@@ -5888,11 +6574,11 @@ var require_index_native8 = __commonJS({
|
|
|
5888
6574
|
__reExport2(src_exports2, require_FontLanguage_native(), module2.exports);
|
|
5889
6575
|
__reExport2(src_exports2, require_TamaguiProvider_native(), module2.exports);
|
|
5890
6576
|
__reExport2(src_exports2, require_AnimationDriverProvider_native(), module2.exports);
|
|
5891
|
-
__reExport2(src_exports2, require_index_native6(), module2.exports);
|
|
5892
6577
|
__reExport2(src_exports2, require_index_native7(), module2.exports);
|
|
5893
|
-
__reExport2(src_exports2,
|
|
5894
|
-
__reExport2(src_exports2,
|
|
5895
|
-
__reExport2(src_exports2,
|
|
6578
|
+
__reExport2(src_exports2, require_index_native8(), module2.exports);
|
|
6579
|
+
__reExport2(src_exports2, require_index_native6(), module2.exports);
|
|
6580
|
+
__reExport2(src_exports2, require_index_native4(), module2.exports);
|
|
6581
|
+
__reExport2(src_exports2, require_index_native2(), module2.exports);
|
|
5896
6582
|
__reExport2(src_exports2, require_setupHooks_native(), module2.exports);
|
|
5897
6583
|
}
|
|
5898
6584
|
});
|
|
@@ -5947,525 +6633,14 @@ var idFn_default, init_idFn = __esm({
|
|
|
5947
6633
|
}
|
|
5948
6634
|
});
|
|
5949
6635
|
|
|
5950
|
-
// src/native.ts
|
|
5951
|
-
var native_exports = {};
|
|
5952
|
-
__export(native_exports, {
|
|
5953
|
-
Stack: () => Stack,
|
|
5954
|
-
Text: () => Text
|
|
5955
|
-
});
|
|
5956
|
-
module.exports = __toCommonJS(native_exports);
|
|
5957
|
-
|
|
5958
6636
|
// src/index.ts
|
|
5959
6637
|
var src_exports = {};
|
|
5960
6638
|
__export(src_exports, {
|
|
5961
6639
|
Stack: () => Stack,
|
|
5962
6640
|
Text: () => Text
|
|
5963
6641
|
});
|
|
5964
|
-
|
|
5965
|
-
|
|
5966
|
-
var React = __toESM(require("react"));
|
|
5967
|
-
|
|
5968
|
-
// ../react-native-use-responder-events/dist/esm/utils.js
|
|
5969
|
-
var keyName = "__reactResponderId", canUseDOM = !!(typeof window < "u" && window.document && window.document.createElement), getBoundingClientRect = (node) => {
|
|
5970
|
-
if (node && node.nodeType === 1 && node.getBoundingClientRect)
|
|
5971
|
-
return node.getBoundingClientRect();
|
|
5972
|
-
};
|
|
5973
|
-
function getEventPath(domEvent) {
|
|
5974
|
-
var _a;
|
|
5975
|
-
if (domEvent.type === "selectionchange") {
|
|
5976
|
-
let target = (_a = window.getSelection()) == null ? void 0 : _a.anchorNode;
|
|
5977
|
-
return composedPathFallback(target);
|
|
5978
|
-
} else
|
|
5979
|
-
return domEvent.composedPath != null ? domEvent.composedPath() : composedPathFallback(domEvent.target);
|
|
5980
|
-
}
|
|
5981
|
-
function composedPathFallback(target) {
|
|
5982
|
-
let path = [];
|
|
5983
|
-
for (; target != null && target !== document.body; )
|
|
5984
|
-
path.push(target), target = target.parentNode;
|
|
5985
|
-
return path;
|
|
5986
|
-
}
|
|
5987
|
-
function getResponderId(node) {
|
|
5988
|
-
return node != null ? node[keyName] : null;
|
|
5989
|
-
}
|
|
5990
|
-
function setResponderId(node, id) {
|
|
5991
|
-
node != null && (node[keyName] = id);
|
|
5992
|
-
}
|
|
5993
|
-
function getResponderPaths(domEvent) {
|
|
5994
|
-
let idPath = [], nodePath = [], eventPath = getEventPath(domEvent);
|
|
5995
|
-
for (let i = 0; i < eventPath.length; i++) {
|
|
5996
|
-
let node = eventPath[i], id = getResponderId(node);
|
|
5997
|
-
id != null && (idPath.push(id), nodePath.push(node));
|
|
5998
|
-
}
|
|
5999
|
-
return { idPath, nodePath };
|
|
6000
|
-
}
|
|
6001
|
-
function getLowestCommonAncestor(pathA, pathB) {
|
|
6002
|
-
let pathALength = pathA.length, pathBLength = pathB.length;
|
|
6003
|
-
if (
|
|
6004
|
-
// If either path is empty
|
|
6005
|
-
pathALength === 0 || pathBLength === 0 || // If the last elements aren't the same there can't be a common ancestor
|
|
6006
|
-
// that is connected to the responder system
|
|
6007
|
-
pathA[pathALength - 1] !== pathB[pathBLength - 1]
|
|
6008
|
-
)
|
|
6009
|
-
return null;
|
|
6010
|
-
let itemA = pathA[0], indexA = 0, itemB = pathB[0], indexB = 0;
|
|
6011
|
-
pathALength - pathBLength > 0 && (indexA = pathALength - pathBLength, itemA = pathA[indexA], pathALength = pathBLength), pathBLength - pathALength > 0 && (indexB = pathBLength - pathALength, itemB = pathB[indexB], pathBLength = pathALength);
|
|
6012
|
-
let depth = pathALength;
|
|
6013
|
-
for (; depth--; ) {
|
|
6014
|
-
if (itemA === itemB)
|
|
6015
|
-
return itemA;
|
|
6016
|
-
itemA = pathA[indexA++], itemB = pathB[indexB++];
|
|
6017
|
-
}
|
|
6018
|
-
return null;
|
|
6019
|
-
}
|
|
6020
|
-
function hasTargetTouches(target, touches) {
|
|
6021
|
-
if (!touches || touches.length === 0)
|
|
6022
|
-
return !1;
|
|
6023
|
-
for (let i = 0; i < touches.length; i++) {
|
|
6024
|
-
let node = touches[i].target;
|
|
6025
|
-
if (node != null && target.contains(node))
|
|
6026
|
-
return !0;
|
|
6027
|
-
}
|
|
6028
|
-
return !1;
|
|
6029
|
-
}
|
|
6030
|
-
function hasValidSelection(domEvent) {
|
|
6031
|
-
return domEvent.type === "selectionchange" ? isSelectionValid() : domEvent.type === "select";
|
|
6032
|
-
}
|
|
6033
|
-
function isPrimaryPointerDown(domEvent) {
|
|
6034
|
-
let { altKey, button, buttons, ctrlKey, type } = domEvent, isTouch = type === "touchstart" || type === "touchmove", isPrimaryMouseDown = type === "mousedown" && (button === 0 || buttons === 1), isPrimaryMouseMove = type === "mousemove" && buttons === 1, noModifiers = altKey === !1 && ctrlKey === !1;
|
|
6035
|
-
return !!(isTouch || isPrimaryMouseDown && noModifiers || isPrimaryMouseMove && noModifiers);
|
|
6036
|
-
}
|
|
6037
|
-
function isSelectionValid() {
|
|
6038
|
-
let selection = window.getSelection();
|
|
6039
|
-
if (!selection)
|
|
6040
|
-
return !1;
|
|
6041
|
-
let string = selection.toString(), anchorNode = selection.anchorNode, focusNode = selection.focusNode, isTextNode = anchorNode && anchorNode.nodeType === window.Node.TEXT_NODE || focusNode && focusNode.nodeType === window.Node.TEXT_NODE;
|
|
6042
|
-
return string.length >= 1 && string !== `
|
|
6043
|
-
` && !!isTextNode;
|
|
6044
|
-
}
|
|
6045
|
-
|
|
6046
|
-
// ../react-native-use-responder-events/dist/esm/createResponderEvent.js
|
|
6047
|
-
var emptyFunction = () => {
|
|
6048
|
-
}, emptyObject = {}, emptyArray = [];
|
|
6049
|
-
function normalizeIdentifier(identifier) {
|
|
6050
|
-
return identifier > 20 ? identifier % 20 : identifier;
|
|
6051
|
-
}
|
|
6052
|
-
function createResponderEvent(domEvent, responderTouchHistoryStore2) {
|
|
6053
|
-
let rect, propagationWasStopped = !1, changedTouches, touches, domEventChangedTouches = domEvent.changedTouches, domEventType = domEvent.type, metaKey = domEvent.metaKey === !0, shiftKey = domEvent.shiftKey === !0, force = (domEventChangedTouches == null ? void 0 : domEventChangedTouches[0].force) || 0, identifier = normalizeIdentifier((domEventChangedTouches == null ? void 0 : domEventChangedTouches[0].identifier) || 0), clientX = (domEventChangedTouches == null ? void 0 : domEventChangedTouches[0].clientX) || domEvent.clientX, clientY = (domEventChangedTouches == null ? void 0 : domEventChangedTouches[0].clientY) || domEvent.clientY, pageX = (domEventChangedTouches == null ? void 0 : domEventChangedTouches[0].pageX) || domEvent.pageX, pageY = (domEventChangedTouches == null ? void 0 : domEventChangedTouches[0].pageY) || domEvent.pageY, preventDefault = typeof domEvent.preventDefault == "function" ? domEvent.preventDefault.bind(domEvent) : emptyFunction, timestamp = domEvent.timeStamp;
|
|
6054
|
-
function normalizeTouches(touches2) {
|
|
6055
|
-
return Array.prototype.slice.call(touches2).map((touch) => ({
|
|
6056
|
-
force: touch.force,
|
|
6057
|
-
identifier: normalizeIdentifier(touch.identifier),
|
|
6058
|
-
get locationX() {
|
|
6059
|
-
return locationX(touch.clientX);
|
|
6060
|
-
},
|
|
6061
|
-
get locationY() {
|
|
6062
|
-
return locationY(touch.clientY);
|
|
6063
|
-
},
|
|
6064
|
-
pageX: touch.pageX,
|
|
6065
|
-
pageY: touch.pageY,
|
|
6066
|
-
target: touch.target,
|
|
6067
|
-
timestamp
|
|
6068
|
-
}));
|
|
6069
|
-
}
|
|
6070
|
-
if (domEventChangedTouches != null)
|
|
6071
|
-
changedTouches = normalizeTouches(domEventChangedTouches), touches = normalizeTouches(domEvent.touches);
|
|
6072
|
-
else {
|
|
6073
|
-
let emulatedTouches = [
|
|
6074
|
-
{
|
|
6075
|
-
force,
|
|
6076
|
-
identifier,
|
|
6077
|
-
get locationX() {
|
|
6078
|
-
return locationX(clientX);
|
|
6079
|
-
},
|
|
6080
|
-
get locationY() {
|
|
6081
|
-
return locationY(clientY);
|
|
6082
|
-
},
|
|
6083
|
-
pageX,
|
|
6084
|
-
pageY,
|
|
6085
|
-
target: domEvent.target,
|
|
6086
|
-
timestamp
|
|
6087
|
-
}
|
|
6088
|
-
];
|
|
6089
|
-
changedTouches = emulatedTouches, touches = domEventType === "mouseup" || domEventType === "dragstart" ? emptyArray : emulatedTouches;
|
|
6090
|
-
}
|
|
6091
|
-
let responderEvent = {
|
|
6092
|
-
bubbles: !0,
|
|
6093
|
-
cancelable: !0,
|
|
6094
|
-
// `currentTarget` is set before dispatch
|
|
6095
|
-
currentTarget: null,
|
|
6096
|
-
defaultPrevented: domEvent.defaultPrevented,
|
|
6097
|
-
dispatchConfig: emptyObject,
|
|
6098
|
-
eventPhase: domEvent.eventPhase,
|
|
6099
|
-
isDefaultPrevented() {
|
|
6100
|
-
return domEvent.defaultPrevented;
|
|
6101
|
-
},
|
|
6102
|
-
isPropagationStopped() {
|
|
6103
|
-
return propagationWasStopped;
|
|
6104
|
-
},
|
|
6105
|
-
isTrusted: domEvent.isTrusted,
|
|
6106
|
-
nativeEvent: {
|
|
6107
|
-
altKey: !1,
|
|
6108
|
-
ctrlKey: !1,
|
|
6109
|
-
metaKey,
|
|
6110
|
-
shiftKey,
|
|
6111
|
-
changedTouches,
|
|
6112
|
-
force,
|
|
6113
|
-
identifier,
|
|
6114
|
-
get locationX() {
|
|
6115
|
-
return locationX(clientX);
|
|
6116
|
-
},
|
|
6117
|
-
get locationY() {
|
|
6118
|
-
return locationY(clientY);
|
|
6119
|
-
},
|
|
6120
|
-
pageX,
|
|
6121
|
-
pageY,
|
|
6122
|
-
target: domEvent.target,
|
|
6123
|
-
timestamp,
|
|
6124
|
-
touches,
|
|
6125
|
-
type: domEventType
|
|
6126
|
-
},
|
|
6127
|
-
persist: emptyFunction,
|
|
6128
|
-
preventDefault,
|
|
6129
|
-
stopPropagation() {
|
|
6130
|
-
propagationWasStopped = !0;
|
|
6131
|
-
},
|
|
6132
|
-
target: domEvent.target,
|
|
6133
|
-
timeStamp: timestamp,
|
|
6134
|
-
touchHistory: responderTouchHistoryStore2.touchHistory
|
|
6135
|
-
};
|
|
6136
|
-
function locationX(x) {
|
|
6137
|
-
if (rect = rect || getBoundingClientRect(responderEvent.currentTarget), rect)
|
|
6138
|
-
return x - rect.left;
|
|
6139
|
-
}
|
|
6140
|
-
function locationY(y) {
|
|
6141
|
-
if (rect = rect || getBoundingClientRect(responderEvent.currentTarget), rect)
|
|
6142
|
-
return y - rect.top;
|
|
6143
|
-
}
|
|
6144
|
-
return responderEvent;
|
|
6145
|
-
}
|
|
6146
|
-
|
|
6147
|
-
// ../react-native-use-responder-events/dist/esm/types.js
|
|
6148
|
-
var MOUSE_DOWN = "mousedown", MOUSE_MOVE = "mousemove", MOUSE_UP = "mouseup", MOUSE_CANCEL = "dragstart", TOUCH_START = "touchstart", TOUCH_MOVE = "touchmove", TOUCH_END = "touchend", TOUCH_CANCEL = "touchcancel", SCROLL = "scroll", SELECT = "select", SELECTION_CHANGE = "selectionchange";
|
|
6149
|
-
function isStartish(eventType) {
|
|
6150
|
-
return eventType === TOUCH_START || eventType === MOUSE_DOWN;
|
|
6151
|
-
}
|
|
6152
|
-
function isMoveish(eventType) {
|
|
6153
|
-
return eventType === TOUCH_MOVE || eventType === MOUSE_MOVE;
|
|
6154
|
-
}
|
|
6155
|
-
function isEndish(eventType) {
|
|
6156
|
-
return eventType === TOUCH_END || eventType === MOUSE_UP || isCancelish(eventType);
|
|
6157
|
-
}
|
|
6158
|
-
function isCancelish(eventType) {
|
|
6159
|
-
return eventType === TOUCH_CANCEL || eventType === MOUSE_CANCEL;
|
|
6160
|
-
}
|
|
6161
|
-
function isScroll(eventType) {
|
|
6162
|
-
return eventType === SCROLL;
|
|
6163
|
-
}
|
|
6164
|
-
function isSelectionChange(eventType) {
|
|
6165
|
-
return eventType === SELECT || eventType === SELECTION_CHANGE;
|
|
6166
|
-
}
|
|
6167
|
-
|
|
6168
|
-
// ../react-native-use-responder-events/dist/esm/ResponderTouchHistoryStore.js
|
|
6169
|
-
var MAX_TOUCH_BANK = 20;
|
|
6170
|
-
function timestampForTouch(touch) {
|
|
6171
|
-
return touch.timeStamp || touch.timestamp;
|
|
6172
|
-
}
|
|
6173
|
-
function createTouchRecord(touch) {
|
|
6174
|
-
return {
|
|
6175
|
-
touchActive: !0,
|
|
6176
|
-
startPageX: touch.pageX,
|
|
6177
|
-
startPageY: touch.pageY,
|
|
6178
|
-
startTimeStamp: timestampForTouch(touch),
|
|
6179
|
-
currentPageX: touch.pageX,
|
|
6180
|
-
currentPageY: touch.pageY,
|
|
6181
|
-
currentTimeStamp: timestampForTouch(touch),
|
|
6182
|
-
previousPageX: touch.pageX,
|
|
6183
|
-
previousPageY: touch.pageY,
|
|
6184
|
-
previousTimeStamp: timestampForTouch(touch)
|
|
6185
|
-
};
|
|
6186
|
-
}
|
|
6187
|
-
function resetTouchRecord(touchRecord, touch) {
|
|
6188
|
-
touchRecord.touchActive = !0, touchRecord.startPageX = touch.pageX, touchRecord.startPageY = touch.pageY, touchRecord.startTimeStamp = timestampForTouch(touch), touchRecord.currentPageX = touch.pageX, touchRecord.currentPageY = touch.pageY, touchRecord.currentTimeStamp = timestampForTouch(touch), touchRecord.previousPageX = touch.pageX, touchRecord.previousPageY = touch.pageY, touchRecord.previousTimeStamp = timestampForTouch(touch);
|
|
6189
|
-
}
|
|
6190
|
-
function getTouchIdentifier({ identifier }) {
|
|
6191
|
-
return identifier == null && console.error("Touch object is missing identifier."), identifier > MAX_TOUCH_BANK && console.error(
|
|
6192
|
-
"Touch identifier %s is greater than maximum supported %s which causes performance issues backfilling array locations for all of the indices.",
|
|
6193
|
-
identifier,
|
|
6194
|
-
MAX_TOUCH_BANK
|
|
6195
|
-
), identifier;
|
|
6196
|
-
}
|
|
6197
|
-
function recordTouchStart(touch, touchHistory) {
|
|
6198
|
-
let identifier = getTouchIdentifier(touch), touchRecord = touchHistory.touchBank[identifier];
|
|
6199
|
-
touchRecord ? resetTouchRecord(touchRecord, touch) : touchHistory.touchBank[identifier] = createTouchRecord(touch), touchHistory.mostRecentTimeStamp = timestampForTouch(touch);
|
|
6200
|
-
}
|
|
6201
|
-
function recordTouchMove(touch, touchHistory) {
|
|
6202
|
-
let touchRecord = touchHistory.touchBank[getTouchIdentifier(touch)];
|
|
6203
|
-
touchRecord ? (touchRecord.touchActive = !0, touchRecord.previousPageX = touchRecord.currentPageX, touchRecord.previousPageY = touchRecord.currentPageY, touchRecord.previousTimeStamp = touchRecord.currentTimeStamp, touchRecord.currentPageX = touch.pageX, touchRecord.currentPageY = touch.pageY, touchRecord.currentTimeStamp = timestampForTouch(touch), touchHistory.mostRecentTimeStamp = timestampForTouch(touch)) : console.warn(
|
|
6204
|
-
`Cannot record touch move without a touch start.
|
|
6205
|
-
`,
|
|
6206
|
-
`Touch Move: ${printTouch(touch)}
|
|
6207
|
-
`,
|
|
6208
|
-
`Touch Bank: ${printTouchBank(touchHistory)}`
|
|
6209
|
-
);
|
|
6210
|
-
}
|
|
6211
|
-
function recordTouchEnd(touch, touchHistory) {
|
|
6212
|
-
let touchRecord = touchHistory.touchBank[getTouchIdentifier(touch)];
|
|
6213
|
-
touchRecord ? (touchRecord.touchActive = !1, touchRecord.previousPageX = touchRecord.currentPageX, touchRecord.previousPageY = touchRecord.currentPageY, touchRecord.previousTimeStamp = touchRecord.currentTimeStamp, touchRecord.currentPageX = touch.pageX, touchRecord.currentPageY = touch.pageY, touchRecord.currentTimeStamp = timestampForTouch(touch), touchHistory.mostRecentTimeStamp = timestampForTouch(touch)) : console.warn(
|
|
6214
|
-
`Cannot record touch end without a touch start.
|
|
6215
|
-
`,
|
|
6216
|
-
`Touch End: ${printTouch(touch)}
|
|
6217
|
-
`,
|
|
6218
|
-
`Touch Bank: ${printTouchBank(touchHistory)}`
|
|
6219
|
-
);
|
|
6220
|
-
}
|
|
6221
|
-
function printTouch(touch) {
|
|
6222
|
-
return JSON.stringify({
|
|
6223
|
-
identifier: touch.identifier,
|
|
6224
|
-
pageX: touch.pageX,
|
|
6225
|
-
pageY: touch.pageY,
|
|
6226
|
-
timestamp: timestampForTouch(touch)
|
|
6227
|
-
});
|
|
6228
|
-
}
|
|
6229
|
-
function printTouchBank(touchHistory) {
|
|
6230
|
-
let { touchBank } = touchHistory, printed = JSON.stringify(touchBank.slice(0, MAX_TOUCH_BANK));
|
|
6231
|
-
return touchBank.length > MAX_TOUCH_BANK && (printed += ` (original size: ${touchBank.length})`), printed;
|
|
6232
|
-
}
|
|
6233
|
-
var ResponderTouchHistoryStore = class {
|
|
6234
|
-
_touchHistory = {
|
|
6235
|
-
touchBank: [],
|
|
6236
|
-
//Array<TouchRecord>
|
|
6237
|
-
numberActiveTouches: 0,
|
|
6238
|
-
// If there is only one active touch, we remember its location. This prevents
|
|
6239
|
-
// us having to loop through all of the touches all the time in the most
|
|
6240
|
-
// common case.
|
|
6241
|
-
indexOfSingleActiveTouch: -1,
|
|
6242
|
-
mostRecentTimeStamp: 0
|
|
6243
|
-
};
|
|
6244
|
-
recordTouchTrack(topLevelType, nativeEvent) {
|
|
6245
|
-
var _a, _b;
|
|
6246
|
-
let touchHistory = this._touchHistory;
|
|
6247
|
-
if (isMoveish(topLevelType))
|
|
6248
|
-
nativeEvent.changedTouches.forEach((touch) => recordTouchMove(touch, touchHistory));
|
|
6249
|
-
else if (isStartish(topLevelType))
|
|
6250
|
-
nativeEvent.changedTouches.forEach((touch) => recordTouchStart(touch, touchHistory)), touchHistory.numberActiveTouches = nativeEvent.touches.length, touchHistory.numberActiveTouches === 1 && (touchHistory.indexOfSingleActiveTouch = nativeEvent.touches[0].identifier);
|
|
6251
|
-
else if (isEndish(topLevelType) && (nativeEvent.changedTouches.forEach((touch) => recordTouchEnd(touch, touchHistory)), touchHistory.numberActiveTouches = nativeEvent.touches.length, touchHistory.numberActiveTouches === 1)) {
|
|
6252
|
-
let { touchBank } = touchHistory;
|
|
6253
|
-
for (let i = 0; i < touchBank.length; i++)
|
|
6254
|
-
if ((_a = touchBank[i]) != null && _a.touchActive) {
|
|
6255
|
-
touchHistory.indexOfSingleActiveTouch = i;
|
|
6256
|
-
break;
|
|
6257
|
-
}
|
|
6258
|
-
(_b = touchBank[touchHistory.indexOfSingleActiveTouch]) != null && _b.touchActive || console.error("Cannot find single active touch.");
|
|
6259
|
-
}
|
|
6260
|
-
}
|
|
6261
|
-
get touchHistory() {
|
|
6262
|
-
return this._touchHistory;
|
|
6263
|
-
}
|
|
6264
|
-
};
|
|
6265
|
-
|
|
6266
|
-
// ../react-native-use-responder-events/dist/esm/ResponderSystem.js
|
|
6267
|
-
var emptyObject2 = {}, startRegistration = [
|
|
6268
|
-
"onStartShouldSetResponderCapture",
|
|
6269
|
-
"onStartShouldSetResponder",
|
|
6270
|
-
{ bubbles: !0 }
|
|
6271
|
-
], moveRegistration = [
|
|
6272
|
-
"onMoveShouldSetResponderCapture",
|
|
6273
|
-
"onMoveShouldSetResponder",
|
|
6274
|
-
{ bubbles: !0 }
|
|
6275
|
-
], scrollRegistration = [
|
|
6276
|
-
"onScrollShouldSetResponderCapture",
|
|
6277
|
-
"onScrollShouldSetResponder",
|
|
6278
|
-
{ bubbles: !1 }
|
|
6279
|
-
], shouldSetResponderEvents = {
|
|
6280
|
-
touchstart: startRegistration,
|
|
6281
|
-
mousedown: startRegistration,
|
|
6282
|
-
touchmove: moveRegistration,
|
|
6283
|
-
mousemove: moveRegistration,
|
|
6284
|
-
scroll: scrollRegistration
|
|
6285
|
-
}, emptyResponder = { id: null, idPath: null, node: null }, responderListenersMap = /* @__PURE__ */ new Map(), isEmulatingMouseEvents = !1, trackedTouchCount = 0, currentResponder = {
|
|
6286
|
-
id: null,
|
|
6287
|
-
node: null,
|
|
6288
|
-
idPath: null
|
|
6289
|
-
}, responderTouchHistoryStore = new ResponderTouchHistoryStore();
|
|
6290
|
-
function changeCurrentResponder(responder) {
|
|
6291
|
-
currentResponder = responder;
|
|
6292
|
-
}
|
|
6293
|
-
function getResponderConfig(id) {
|
|
6294
|
-
return responderListenersMap.get(id) ?? emptyObject2;
|
|
6295
|
-
}
|
|
6296
|
-
function eventListener(domEvent) {
|
|
6297
|
-
let eventType = domEvent.type, eventTarget = domEvent.target;
|
|
6298
|
-
if (eventType === "touchstart" && (isEmulatingMouseEvents = !0), (eventType === "touchmove" || trackedTouchCount > 1) && (isEmulatingMouseEvents = !1), // Ignore browser emulated mouse events
|
|
6299
|
-
eventType === "mousedown" && isEmulatingMouseEvents || eventType === "mousemove" && isEmulatingMouseEvents || // Ignore mousemove if a mousedown didn't occur first
|
|
6300
|
-
eventType === "mousemove" && trackedTouchCount < 1)
|
|
6301
|
-
return;
|
|
6302
|
-
if (isEmulatingMouseEvents && eventType === "mouseup") {
|
|
6303
|
-
trackedTouchCount === 0 && (isEmulatingMouseEvents = !1);
|
|
6304
|
-
return;
|
|
6305
|
-
}
|
|
6306
|
-
let isStartEvent = isStartish(eventType) && isPrimaryPointerDown(domEvent), isMoveEvent = isMoveish(eventType), isEndEvent = isEndish(eventType), isScrollEvent = isScroll(eventType), isSelectionChangeEvent = isSelectionChange(eventType), responderEvent = createResponderEvent(domEvent, responderTouchHistoryStore);
|
|
6307
|
-
(isStartEvent || isMoveEvent || isEndEvent) && (domEvent.touches ? trackedTouchCount = domEvent.touches.length : isStartEvent ? trackedTouchCount = 1 : isEndEvent && (trackedTouchCount = 0), responderTouchHistoryStore.recordTouchTrack(
|
|
6308
|
-
eventType,
|
|
6309
|
-
responderEvent.nativeEvent
|
|
6310
|
-
));
|
|
6311
|
-
let eventPaths = getResponderPaths(domEvent), wasNegotiated = !1, wantsResponder;
|
|
6312
|
-
if (isStartEvent || isMoveEvent || isScrollEvent && trackedTouchCount > 0) {
|
|
6313
|
-
let currentResponderIdPath = currentResponder.idPath, eventIdPath = eventPaths.idPath;
|
|
6314
|
-
if (currentResponderIdPath != null && eventIdPath != null) {
|
|
6315
|
-
let lowestCommonAncestor = getLowestCommonAncestor(
|
|
6316
|
-
currentResponderIdPath,
|
|
6317
|
-
eventIdPath
|
|
6318
|
-
);
|
|
6319
|
-
if (lowestCommonAncestor != null) {
|
|
6320
|
-
let index = eventIdPath.indexOf(lowestCommonAncestor) + (lowestCommonAncestor === currentResponder.id ? 1 : 0);
|
|
6321
|
-
eventPaths = {
|
|
6322
|
-
idPath: eventIdPath.slice(index),
|
|
6323
|
-
nodePath: eventPaths.nodePath.slice(index)
|
|
6324
|
-
};
|
|
6325
|
-
} else
|
|
6326
|
-
eventPaths = null;
|
|
6327
|
-
}
|
|
6328
|
-
eventPaths != null && (wantsResponder = findWantsResponder(eventPaths, domEvent, responderEvent), wantsResponder != null && (attemptTransfer(responderEvent, wantsResponder), wasNegotiated = !0));
|
|
6329
|
-
}
|
|
6330
|
-
if (currentResponder.id != null && currentResponder.node != null) {
|
|
6331
|
-
let { id, node } = currentResponder, {
|
|
6332
|
-
onResponderStart,
|
|
6333
|
-
onResponderMove,
|
|
6334
|
-
onResponderEnd,
|
|
6335
|
-
onResponderRelease,
|
|
6336
|
-
onResponderTerminate,
|
|
6337
|
-
onResponderTerminationRequest
|
|
6338
|
-
} = getResponderConfig(id);
|
|
6339
|
-
if (responderEvent.bubbles = !1, responderEvent.cancelable = !1, responderEvent.currentTarget = node, isStartEvent)
|
|
6340
|
-
onResponderStart != null && (responderEvent.dispatchConfig.registrationName = "onResponderStart", onResponderStart(responderEvent));
|
|
6341
|
-
else if (isMoveEvent)
|
|
6342
|
-
onResponderMove != null && (responderEvent.dispatchConfig.registrationName = "onResponderMove", onResponderMove(responderEvent));
|
|
6343
|
-
else {
|
|
6344
|
-
let isTerminateEvent = isCancelish(eventType) || // native context menu
|
|
6345
|
-
eventType === "contextmenu" || // window blur
|
|
6346
|
-
eventType === "blur" && eventTarget === window || // responder (or ancestors) blur
|
|
6347
|
-
eventType === "blur" && eventTarget.contains(node) && domEvent.relatedTarget !== node || // native scroll without using a pointer
|
|
6348
|
-
isScrollEvent && trackedTouchCount === 0 || // native scroll on node that is parent of the responder (allow siblings to scroll)
|
|
6349
|
-
isScrollEvent && eventTarget.contains(node) && eventTarget !== node || // native select/selectionchange on node
|
|
6350
|
-
isSelectionChangeEvent && hasValidSelection(domEvent), isReleaseEvent = isEndEvent && !isTerminateEvent && !hasTargetTouches(node, domEvent.touches);
|
|
6351
|
-
if (isEndEvent && onResponderEnd != null && (responderEvent.dispatchConfig.registrationName = "onResponderEnd", onResponderEnd(responderEvent)), isReleaseEvent && (onResponderRelease != null && (responderEvent.dispatchConfig.registrationName = "onResponderRelease", onResponderRelease(responderEvent)), changeCurrentResponder(emptyResponder)), isTerminateEvent) {
|
|
6352
|
-
let shouldTerminate = !0;
|
|
6353
|
-
(eventType === "contextmenu" || eventType === "scroll" || eventType === "selectionchange") && (wasNegotiated ? shouldTerminate = !1 : onResponderTerminationRequest != null && (responderEvent.dispatchConfig.registrationName = "onResponderTerminationRequest", onResponderTerminationRequest(responderEvent) === !1 && (shouldTerminate = !1))), shouldTerminate && (onResponderTerminate != null && (responderEvent.dispatchConfig.registrationName = "onResponderTerminate", onResponderTerminate(responderEvent)), changeCurrentResponder(emptyResponder), isEmulatingMouseEvents = !1, trackedTouchCount = 0);
|
|
6354
|
-
}
|
|
6355
|
-
}
|
|
6356
|
-
}
|
|
6357
|
-
}
|
|
6358
|
-
function findWantsResponder(eventPaths, domEvent, responderEvent) {
|
|
6359
|
-
let shouldSetCallbacks = shouldSetResponderEvents[domEvent.type];
|
|
6360
|
-
if (shouldSetCallbacks != null) {
|
|
6361
|
-
let { idPath, nodePath } = eventPaths, shouldSetCallbackCaptureName = shouldSetCallbacks[0], shouldSetCallbackBubbleName = shouldSetCallbacks[1], { bubbles } = shouldSetCallbacks[2], check = function(id, node, callbackName) {
|
|
6362
|
-
let shouldSetCallback = getResponderConfig(id)[callbackName];
|
|
6363
|
-
if (shouldSetCallback != null && (responderEvent.currentTarget = node, shouldSetCallback(responderEvent) === !0)) {
|
|
6364
|
-
let prunedIdPath = idPath.slice(idPath.indexOf(id));
|
|
6365
|
-
return { id, node, idPath: prunedIdPath };
|
|
6366
|
-
}
|
|
6367
|
-
};
|
|
6368
|
-
for (let i = idPath.length - 1; i >= 0; i--) {
|
|
6369
|
-
let id = idPath[i], node = nodePath[i], result = check(id, node, shouldSetCallbackCaptureName);
|
|
6370
|
-
if (result != null)
|
|
6371
|
-
return result;
|
|
6372
|
-
if (responderEvent.isPropagationStopped() === !0)
|
|
6373
|
-
return;
|
|
6374
|
-
}
|
|
6375
|
-
if (bubbles)
|
|
6376
|
-
for (let i = 0; i < idPath.length; i++) {
|
|
6377
|
-
let id = idPath[i], node = nodePath[i], result = check(id, node, shouldSetCallbackBubbleName);
|
|
6378
|
-
if (result != null)
|
|
6379
|
-
return result;
|
|
6380
|
-
if (responderEvent.isPropagationStopped() === !0)
|
|
6381
|
-
return;
|
|
6382
|
-
}
|
|
6383
|
-
else {
|
|
6384
|
-
let id = idPath[0], node = nodePath[0];
|
|
6385
|
-
if (domEvent.target === node)
|
|
6386
|
-
return check(id, node, shouldSetCallbackBubbleName);
|
|
6387
|
-
}
|
|
6388
|
-
}
|
|
6389
|
-
}
|
|
6390
|
-
function attemptTransfer(responderEvent, wantsResponder) {
|
|
6391
|
-
let { id: currentId, node: currentNode } = currentResponder, { id, node } = wantsResponder, { onResponderGrant, onResponderReject } = getResponderConfig(id);
|
|
6392
|
-
if (responderEvent.bubbles = !1, responderEvent.cancelable = !1, responderEvent.currentTarget = node, currentId == null)
|
|
6393
|
-
onResponderGrant != null && (responderEvent.currentTarget = node, responderEvent.dispatchConfig.registrationName = "onResponderGrant", onResponderGrant(responderEvent)), changeCurrentResponder(wantsResponder);
|
|
6394
|
-
else {
|
|
6395
|
-
let { onResponderTerminate, onResponderTerminationRequest } = getResponderConfig(currentId), allowTransfer = !0;
|
|
6396
|
-
onResponderTerminationRequest != null && (responderEvent.currentTarget = currentNode, responderEvent.dispatchConfig.registrationName = "onResponderTerminationRequest", onResponderTerminationRequest(responderEvent) === !1 && (allowTransfer = !1)), allowTransfer ? (onResponderTerminate != null && (responderEvent.currentTarget = currentNode, responderEvent.dispatchConfig.registrationName = "onResponderTerminate", onResponderTerminate(responderEvent)), onResponderGrant != null && (responderEvent.currentTarget = node, responderEvent.dispatchConfig.registrationName = "onResponderGrant", onResponderGrant(responderEvent)), changeCurrentResponder(wantsResponder)) : onResponderReject != null && (responderEvent.currentTarget = node, responderEvent.dispatchConfig.registrationName = "onResponderReject", onResponderReject(responderEvent));
|
|
6397
|
-
}
|
|
6398
|
-
}
|
|
6399
|
-
var documentEventsCapturePhase = ["blur", "scroll"], documentEventsBubblePhase = [
|
|
6400
|
-
// mouse
|
|
6401
|
-
"mousedown",
|
|
6402
|
-
"mousemove",
|
|
6403
|
-
"mouseup",
|
|
6404
|
-
"dragstart",
|
|
6405
|
-
// touch
|
|
6406
|
-
"touchstart",
|
|
6407
|
-
"touchmove",
|
|
6408
|
-
"touchend",
|
|
6409
|
-
"touchcancel",
|
|
6410
|
-
// other
|
|
6411
|
-
"contextmenu",
|
|
6412
|
-
"select",
|
|
6413
|
-
"selectionchange"
|
|
6414
|
-
], isTamaguiResponderActive = Symbol();
|
|
6415
|
-
function attachListeners() {
|
|
6416
|
-
canUseDOM && !window[isTamaguiResponderActive] && (window.addEventListener("blur", eventListener), documentEventsBubblePhase.forEach((eventType) => {
|
|
6417
|
-
document.addEventListener(eventType, eventListener);
|
|
6418
|
-
}), documentEventsCapturePhase.forEach((eventType) => {
|
|
6419
|
-
document.addEventListener(eventType, eventListener, !0);
|
|
6420
|
-
}), window[isTamaguiResponderActive] = !0);
|
|
6421
|
-
}
|
|
6422
|
-
function addNode(id, node, config) {
|
|
6423
|
-
setResponderId(node, id), responderListenersMap.set(id, config);
|
|
6424
|
-
}
|
|
6425
|
-
function removeNode(id) {
|
|
6426
|
-
currentResponder.id === id && terminateResponder(), responderListenersMap.has(id) && responderListenersMap.delete(id);
|
|
6427
|
-
}
|
|
6428
|
-
function terminateResponder() {
|
|
6429
|
-
let { id, node } = currentResponder;
|
|
6430
|
-
if (id != null && node != null) {
|
|
6431
|
-
let { onResponderTerminate } = getResponderConfig(id);
|
|
6432
|
-
if (onResponderTerminate != null) {
|
|
6433
|
-
let event = createResponderEvent({}, responderTouchHistoryStore);
|
|
6434
|
-
event.currentTarget = node, onResponderTerminate(event);
|
|
6435
|
-
}
|
|
6436
|
-
changeCurrentResponder(emptyResponder);
|
|
6437
|
-
}
|
|
6438
|
-
isEmulatingMouseEvents = !1, trackedTouchCount = 0;
|
|
6439
|
-
}
|
|
6440
|
-
function getResponderNode() {
|
|
6441
|
-
return currentResponder.node;
|
|
6442
|
-
}
|
|
6443
|
-
|
|
6444
|
-
// ../react-native-use-responder-events/dist/esm/useResponderEvents.js
|
|
6445
|
-
var emptyObject3 = {};
|
|
6446
|
-
function useResponderEvents(hostRef, config = emptyObject3) {
|
|
6447
|
-
let id = React.useId(), isAttachedRef = React.useRef(!1);
|
|
6448
|
-
React.useEffect(() => (attachListeners(), () => {
|
|
6449
|
-
removeNode(id);
|
|
6450
|
-
}), [id]), React.useEffect(() => {
|
|
6451
|
-
let {
|
|
6452
|
-
onMoveShouldSetResponder,
|
|
6453
|
-
onMoveShouldSetResponderCapture,
|
|
6454
|
-
onScrollShouldSetResponder,
|
|
6455
|
-
onScrollShouldSetResponderCapture,
|
|
6456
|
-
onSelectionChangeShouldSetResponder,
|
|
6457
|
-
onSelectionChangeShouldSetResponderCapture,
|
|
6458
|
-
onStartShouldSetResponder,
|
|
6459
|
-
onStartShouldSetResponderCapture
|
|
6460
|
-
} = config, requiresResponderSystem = onMoveShouldSetResponder != null || onMoveShouldSetResponderCapture != null || onScrollShouldSetResponder != null || onScrollShouldSetResponderCapture != null || onSelectionChangeShouldSetResponder != null || onSelectionChangeShouldSetResponderCapture != null || onStartShouldSetResponder != null || onStartShouldSetResponderCapture != null, node = hostRef.current;
|
|
6461
|
-
requiresResponderSystem ? (addNode(id, node, config), isAttachedRef.current = !0) : isAttachedRef.current && (removeNode(id), isAttachedRef.current = !1);
|
|
6462
|
-
}, [config, hostRef, id]), React.useDebugValue({
|
|
6463
|
-
isResponder: hostRef.current === getResponderNode()
|
|
6464
|
-
}), React.useDebugValue(config);
|
|
6465
|
-
}
|
|
6466
|
-
|
|
6467
|
-
// src/index.ts
|
|
6468
|
-
var import_web2 = __toESM(require_index_native8());
|
|
6642
|
+
module.exports = __toCommonJS(src_exports);
|
|
6643
|
+
var import_react_native_use_responder_events = __toESM(require_index_native()), import_web2 = __toESM(require_index_native9());
|
|
6469
6644
|
|
|
6470
6645
|
// src/getBaseViews.native.ts
|
|
6471
6646
|
function getBaseViews() {
|
|
@@ -6477,10 +6652,10 @@ function getBaseViews() {
|
|
|
6477
6652
|
}
|
|
6478
6653
|
|
|
6479
6654
|
// src/hooks/useElementLayout.tsx
|
|
6480
|
-
var import_constants = __toESM(
|
|
6655
|
+
var import_constants = __toESM(require_index_native2());
|
|
6481
6656
|
|
|
6482
6657
|
// src/helpers/getBoundingClientRect.tsx
|
|
6483
|
-
var
|
|
6658
|
+
var getBoundingClientRect = (node) => {
|
|
6484
6659
|
var _a;
|
|
6485
6660
|
if (!(!node || node.nodeType !== 1))
|
|
6486
6661
|
return (_a = node.getBoundingClientRect) == null ? void 0 : _a.call(node);
|
|
@@ -6488,7 +6663,7 @@ var getBoundingClientRect2 = (node) => {
|
|
|
6488
6663
|
|
|
6489
6664
|
// src/helpers/getRect.tsx
|
|
6490
6665
|
var getRect = (node) => {
|
|
6491
|
-
let rect =
|
|
6666
|
+
let rect = getBoundingClientRect(node);
|
|
6492
6667
|
if (!rect)
|
|
6493
6668
|
return;
|
|
6494
6669
|
let { x, y, top, left } = rect;
|
|
@@ -6516,7 +6691,7 @@ typeof window < "u" && "ResizeObserver" in window && (resizeObserver = new Resiz
|
|
|
6516
6691
|
var measureLayout = (node, relativeTo, callback) => {
|
|
6517
6692
|
let relativeNode = relativeTo || (node == null ? void 0 : node.parentNode);
|
|
6518
6693
|
relativeNode instanceof HTMLElement && setTimeout(() => {
|
|
6519
|
-
let relativeRect =
|
|
6694
|
+
let relativeRect = getBoundingClientRect(relativeNode), { height, left, top, width } = getRect(node), x = left - relativeRect.left, y = top - relativeRect.top;
|
|
6520
6695
|
callback(x, y, width, height, left, top);
|
|
6521
6696
|
}, 0);
|
|
6522
6697
|
};
|
|
@@ -6533,7 +6708,7 @@ function useElementLayout(ref, onLayout) {
|
|
|
6533
6708
|
}
|
|
6534
6709
|
|
|
6535
6710
|
// src/hooks/usePlatformMethods.ts
|
|
6536
|
-
var import_web = __toESM(
|
|
6711
|
+
var import_web = __toESM(require_index_native9());
|
|
6537
6712
|
function usePlatformMethods(hostRef) {
|
|
6538
6713
|
(0, import_web.useIsomorphicLayoutEffect)(() => {
|
|
6539
6714
|
let node = hostRef.current;
|
|
@@ -6550,7 +6725,7 @@ function usePlatformMethods(hostRef) {
|
|
|
6550
6725
|
var Pressability = require_fake_react_native().default, usePressability = (init_idFn(), __toCommonJS(idFn_exports)).default;
|
|
6551
6726
|
|
|
6552
6727
|
// src/index.ts
|
|
6553
|
-
__reExport(src_exports, __toESM(
|
|
6728
|
+
__reExport(src_exports, __toESM(require_index_native9()), module.exports);
|
|
6554
6729
|
var Stack = import_web2.Stack, Text = import_web2.Text;
|
|
6555
6730
|
(0, import_web2.setupHooks)({
|
|
6556
6731
|
getBaseViews,
|
|
@@ -6583,7 +6758,7 @@ var Stack = import_web2.Stack, Text = import_web2.Text;
|
|
|
6583
6758
|
hrefAttrs,
|
|
6584
6759
|
...viewProps
|
|
6585
6760
|
} = propsIn;
|
|
6586
|
-
if (usePlatformMethods(hostRef), useElementLayout(hostRef, onLayout), useResponderEvents(hostRef, {
|
|
6761
|
+
if (usePlatformMethods(hostRef), useElementLayout(hostRef, onLayout), (0, import_react_native_use_responder_events.useResponderEvents)(hostRef, {
|
|
6587
6762
|
onMoveShouldSetResponder,
|
|
6588
6763
|
onMoveShouldSetResponderCapture,
|
|
6589
6764
|
onResponderEnd,
|
|
@@ -6625,7 +6800,9 @@ var Stack = import_web2.Stack, Text = import_web2.Text;
|
|
|
6625
6800
|
var dontComposePressabilityKeys = {
|
|
6626
6801
|
onClick: !0
|
|
6627
6802
|
};
|
|
6628
|
-
|
|
6629
|
-
|
|
6630
|
-
|
|
6803
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
6804
|
+
0 && (module.exports = {
|
|
6805
|
+
Stack,
|
|
6806
|
+
Text
|
|
6807
|
+
});
|
|
6631
6808
|
//# sourceMappingURL=native.js.map
|