@tamagui/static 1.0.1-beta.70 → 1.0.1-beta.71

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/dist/cjs/extractor/extractToClassNames.js +1 -11
  2. package/dist/cjs/extractor/extractToClassNames.js.map +2 -2
  3. package/dist/cjs/index.js +1 -1
  4. package/dist/cjs/index.js.map +2 -2
  5. package/dist/esm/extractor/extractToClassNames.js +1 -11
  6. package/dist/esm/extractor/extractToClassNames.js.map +2 -2
  7. package/dist/esm/index.js +1 -1
  8. package/dist/esm/index.js.map +1 -1
  9. package/dist/jsx/extractor/extractToClassNames.js +1 -11
  10. package/dist/jsx/index.js +1 -1
  11. package/package.json +9 -9
  12. package/src/extractor/extractToClassNames.ts +0 -19
  13. package/src/index.ts +1 -1
  14. package/types/constants.d.ts +0 -0
  15. package/types/constants.d.ts.map +0 -0
  16. package/types/extractor/accessSafe.d.ts +0 -0
  17. package/types/extractor/accessSafe.d.ts.map +0 -0
  18. package/types/extractor/babelParse.d.ts +0 -0
  19. package/types/extractor/babelParse.d.ts.map +0 -0
  20. package/types/extractor/buildClassName.d.ts +0 -0
  21. package/types/extractor/buildClassName.d.ts.map +0 -0
  22. package/types/extractor/createEvaluator.d.ts +0 -0
  23. package/types/extractor/createEvaluator.d.ts.map +0 -0
  24. package/types/extractor/createExtractor.d.ts +0 -0
  25. package/types/extractor/createExtractor.d.ts.map +0 -0
  26. package/types/extractor/ensureImportingConcat.d.ts +0 -0
  27. package/types/extractor/ensureImportingConcat.d.ts.map +0 -0
  28. package/types/extractor/evaluateAstNode.d.ts +0 -0
  29. package/types/extractor/evaluateAstNode.d.ts.map +0 -0
  30. package/types/extractor/extractHelpers.d.ts +0 -0
  31. package/types/extractor/extractHelpers.d.ts.map +0 -0
  32. package/types/extractor/extractMediaStyle.d.ts +0 -0
  33. package/types/extractor/extractMediaStyle.d.ts.map +0 -0
  34. package/types/extractor/extractToClassNames.d.ts +1 -6
  35. package/types/extractor/extractToClassNames.d.ts.map +1 -1
  36. package/types/extractor/findTopmostFunction.d.ts +0 -0
  37. package/types/extractor/findTopmostFunction.d.ts.map +0 -0
  38. package/types/extractor/generatedUid.d.ts +0 -0
  39. package/types/extractor/generatedUid.d.ts.map +0 -0
  40. package/types/extractor/getPrefixLogs.d.ts +0 -0
  41. package/types/extractor/getPrefixLogs.d.ts.map +0 -0
  42. package/types/extractor/getPropValueFromAttributes.d.ts +0 -0
  43. package/types/extractor/getPropValueFromAttributes.d.ts.map +0 -0
  44. package/types/extractor/getSourceModule.d.ts +0 -0
  45. package/types/extractor/getSourceModule.d.ts.map +0 -0
  46. package/types/extractor/getStaticBindingsForScope.d.ts +0 -0
  47. package/types/extractor/getStaticBindingsForScope.d.ts.map +0 -0
  48. package/types/extractor/hoistClassNames.d.ts +0 -0
  49. package/types/extractor/hoistClassNames.d.ts.map +0 -0
  50. package/types/extractor/literalToAst.d.ts +0 -0
  51. package/types/extractor/literalToAst.d.ts.map +0 -0
  52. package/types/extractor/loadTamagui.d.ts +0 -0
  53. package/types/extractor/loadTamagui.d.ts.map +0 -0
  54. package/types/extractor/logLines.d.ts +0 -0
  55. package/types/extractor/logLines.d.ts.map +0 -0
  56. package/types/extractor/normalizeTernaries.d.ts +0 -0
  57. package/types/extractor/normalizeTernaries.d.ts.map +0 -0
  58. package/types/extractor/removeUnusedHooks.d.ts +0 -0
  59. package/types/extractor/removeUnusedHooks.d.ts.map +0 -0
  60. package/types/extractor/timer.d.ts +0 -0
  61. package/types/extractor/timer.d.ts.map +0 -0
  62. package/types/extractor/validHTMLAttributes.d.ts +0 -0
  63. package/types/extractor/validHTMLAttributes.d.ts.map +0 -0
  64. package/types/index.d.ts +1 -1
  65. package/types/index.d.ts.map +1 -1
  66. package/types/types.d.ts +0 -0
  67. package/types/types.d.ts.map +0 -0
  68. package/dist/cjs/patchReactNativeWeb.js +0 -107
  69. package/dist/cjs/patchReactNativeWeb.js.map +0 -7
  70. package/dist/esm/patchReactNativeWeb.js +0 -82
  71. package/dist/esm/patchReactNativeWeb.js.map +0 -7
  72. package/dist/jsx/patchReactNativeWeb.js +0 -81
  73. package/patches/18/createDOMProps.cjs.js +0 -385
  74. package/patches/18/createDOMProps.js +0 -379
  75. package/src/patchReactNativeWeb.ts +0 -116
  76. package/types/patchReactNativeWeb.d.ts +0 -2
  77. package/types/patchReactNativeWeb.d.ts.map +0 -1
@@ -1,379 +0,0 @@
1
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
2
-
3
- /**
4
- * Copyright (c) Nicolas Gallagher.
5
- *
6
- * This source code is licensed under the MIT license found in the
7
- * LICENSE file in the root directory of this source tree.
8
- *
9
- *
10
- */
11
- import AccessibilityUtil from '../AccessibilityUtil';
12
- import StyleSheet from '../../exports/StyleSheet';
13
- var emptyObject = {};
14
- var hasOwnProperty = Object.prototype.hasOwnProperty;
15
- var isArray = Array.isArray;
16
- var uppercasePattern = /[A-Z]/g;
17
-
18
- function toHyphenLower(match) {
19
- return '-' + match.toLowerCase();
20
- }
21
-
22
- function hyphenateString(str) {
23
- return str.replace(uppercasePattern, toHyphenLower);
24
- }
25
-
26
- function processIDRefList(idRefList) {
27
- return isArray(idRefList) ? idRefList.join(' ') : idRefList;
28
- }
29
-
30
- var pointerEventsStyles = StyleSheet.create({
31
- auto: {
32
- pointerEvents: 'auto'
33
- },
34
- 'box-none': {
35
- pointerEvents: 'box-none'
36
- },
37
- 'box-only': {
38
- pointerEvents: 'box-only'
39
- },
40
- none: {
41
- pointerEvents: 'none'
42
- }
43
- });
44
-
45
- var createDOMProps = function createDOMProps(elementType, props, options) {
46
- if (!props) {
47
- props = emptyObject;
48
- }
49
-
50
- var _props = props,
51
- accessibilityActiveDescendant = _props.accessibilityActiveDescendant,
52
- accessibilityAtomic = _props.accessibilityAtomic,
53
- accessibilityAutoComplete = _props.accessibilityAutoComplete,
54
- accessibilityBusy = _props.accessibilityBusy,
55
- accessibilityChecked = _props.accessibilityChecked,
56
- accessibilityColumnCount = _props.accessibilityColumnCount,
57
- accessibilityColumnIndex = _props.accessibilityColumnIndex,
58
- accessibilityColumnSpan = _props.accessibilityColumnSpan,
59
- accessibilityControls = _props.accessibilityControls,
60
- accessibilityCurrent = _props.accessibilityCurrent,
61
- accessibilityDescribedBy = _props.accessibilityDescribedBy,
62
- accessibilityDetails = _props.accessibilityDetails,
63
- accessibilityDisabled = _props.accessibilityDisabled,
64
- accessibilityErrorMessage = _props.accessibilityErrorMessage,
65
- accessibilityExpanded = _props.accessibilityExpanded,
66
- accessibilityFlowTo = _props.accessibilityFlowTo,
67
- accessibilityHasPopup = _props.accessibilityHasPopup,
68
- accessibilityHidden = _props.accessibilityHidden,
69
- accessibilityInvalid = _props.accessibilityInvalid,
70
- accessibilityKeyShortcuts = _props.accessibilityKeyShortcuts,
71
- accessibilityLabel = _props.accessibilityLabel,
72
- accessibilityLabelledBy = _props.accessibilityLabelledBy,
73
- accessibilityLevel = _props.accessibilityLevel,
74
- accessibilityLiveRegion = _props.accessibilityLiveRegion,
75
- accessibilityModal = _props.accessibilityModal,
76
- accessibilityMultiline = _props.accessibilityMultiline,
77
- accessibilityMultiSelectable = _props.accessibilityMultiSelectable,
78
- accessibilityOrientation = _props.accessibilityOrientation,
79
- accessibilityOwns = _props.accessibilityOwns,
80
- accessibilityPlaceholder = _props.accessibilityPlaceholder,
81
- accessibilityPosInSet = _props.accessibilityPosInSet,
82
- accessibilityPressed = _props.accessibilityPressed,
83
- accessibilityReadOnly = _props.accessibilityReadOnly,
84
- accessibilityRequired = _props.accessibilityRequired,
85
- accessibilityRole = _props.accessibilityRole,
86
- accessibilityRoleDescription = _props.accessibilityRoleDescription,
87
- accessibilityRowCount = _props.accessibilityRowCount,
88
- accessibilityRowIndex = _props.accessibilityRowIndex,
89
- accessibilityRowSpan = _props.accessibilityRowSpan,
90
- accessibilitySelected = _props.accessibilitySelected,
91
- accessibilitySetSize = _props.accessibilitySetSize,
92
- accessibilitySort = _props.accessibilitySort,
93
- accessibilityValueMax = _props.accessibilityValueMax,
94
- accessibilityValueMin = _props.accessibilityValueMin,
95
- accessibilityValueNow = _props.accessibilityValueNow,
96
- accessibilityValueText = _props.accessibilityValueText,
97
- dataSet = _props.dataSet,
98
- focusable = _props.focusable,
99
- nativeID = _props.nativeID,
100
- pointerEvents = _props.pointerEvents,
101
- style = _props.style,
102
- testID = _props.testID,
103
- domProps = _objectWithoutPropertiesLoose(_props, ["accessibilityActiveDescendant", "accessibilityAtomic", "accessibilityAutoComplete", "accessibilityBusy", "accessibilityChecked", "accessibilityColumnCount", "accessibilityColumnIndex", "accessibilityColumnSpan", "accessibilityControls", "accessibilityCurrent", "accessibilityDescribedBy", "accessibilityDetails", "accessibilityDisabled", "accessibilityErrorMessage", "accessibilityExpanded", "accessibilityFlowTo", "accessibilityHasPopup", "accessibilityHidden", "accessibilityInvalid", "accessibilityKeyShortcuts", "accessibilityLabel", "accessibilityLabelledBy", "accessibilityLevel", "accessibilityLiveRegion", "accessibilityModal", "accessibilityMultiline", "accessibilityMultiSelectable", "accessibilityOrientation", "accessibilityOwns", "accessibilityPlaceholder", "accessibilityPosInSet", "accessibilityPressed", "accessibilityReadOnly", "accessibilityRequired", "accessibilityRole", "accessibilityRoleDescription", "accessibilityRowCount", "accessibilityRowIndex", "accessibilityRowSpan", "accessibilitySelected", "accessibilitySetSize", "accessibilitySort", "accessibilityValueMax", "accessibilityValueMin", "accessibilityValueNow", "accessibilityValueText", "dataSet", "focusable", "nativeID", "pointerEvents", "style", "testID"]);
104
-
105
- var disabled = accessibilityDisabled;
106
- var role = AccessibilityUtil.propsToAriaRole(props); // ACCESSIBILITY
107
-
108
- if (accessibilityActiveDescendant != null) {
109
- domProps['aria-activedescendant'] = accessibilityActiveDescendant;
110
- }
111
-
112
- if (accessibilityAtomic != null) {
113
- domProps['aria-atomic'] = accessibilityAtomic;
114
- }
115
-
116
- if (accessibilityAutoComplete != null) {
117
- domProps['aria-autocomplete'] = accessibilityAutoComplete;
118
- }
119
-
120
- if (accessibilityBusy != null) {
121
- domProps['aria-busy'] = accessibilityBusy;
122
- }
123
-
124
- if (accessibilityChecked != null) {
125
- domProps['aria-checked'] = accessibilityChecked;
126
- }
127
-
128
- if (accessibilityColumnCount != null) {
129
- domProps['aria-colcount'] = accessibilityColumnCount;
130
- }
131
-
132
- if (accessibilityColumnIndex != null) {
133
- domProps['aria-colindex'] = accessibilityColumnIndex;
134
- }
135
-
136
- if (accessibilityColumnSpan != null) {
137
- domProps['aria-colspan'] = accessibilityColumnSpan;
138
- }
139
-
140
- if (accessibilityControls != null) {
141
- domProps['aria-controls'] = processIDRefList(accessibilityControls);
142
- }
143
-
144
- if (accessibilityCurrent != null) {
145
- domProps['aria-current'] = accessibilityCurrent;
146
- }
147
-
148
- if (accessibilityDescribedBy != null) {
149
- domProps['aria-describedby'] = processIDRefList(accessibilityDescribedBy);
150
- }
151
-
152
- if (accessibilityDetails != null) {
153
- domProps['aria-details'] = accessibilityDetails;
154
- }
155
-
156
- if (disabled === true) {
157
- domProps['aria-disabled'] = true; // Enhance with native semantics
158
-
159
- if (elementType === 'button' || elementType === 'form' || elementType === 'input' || elementType === 'select' || elementType === 'textarea') {
160
- domProps.disabled = true;
161
- }
162
- }
163
-
164
- if (accessibilityErrorMessage != null) {
165
- domProps['aria-errormessage'] = accessibilityErrorMessage;
166
- }
167
-
168
- if (accessibilityExpanded != null) {
169
- domProps['aria-expanded'] = accessibilityExpanded;
170
- }
171
-
172
- if (accessibilityFlowTo != null) {
173
- domProps['aria-flowto'] = processIDRefList(accessibilityFlowTo);
174
- }
175
-
176
- if (accessibilityHasPopup != null) {
177
- domProps['aria-haspopup'] = accessibilityHasPopup;
178
- }
179
-
180
- if (accessibilityHidden === true) {
181
- domProps['aria-hidden'] = accessibilityHidden;
182
- }
183
-
184
- if (accessibilityInvalid != null) {
185
- domProps['aria-invalid'] = accessibilityInvalid;
186
- }
187
-
188
- if (accessibilityKeyShortcuts != null && Array.isArray(accessibilityKeyShortcuts)) {
189
- domProps['aria-keyshortcuts'] = accessibilityKeyShortcuts.join(' ');
190
- }
191
-
192
- if (accessibilityLabel != null) {
193
- domProps['aria-label'] = accessibilityLabel;
194
- }
195
-
196
- if (accessibilityLabelledBy != null) {
197
- domProps['aria-labelledby'] = processIDRefList(accessibilityLabelledBy);
198
- }
199
-
200
- if (accessibilityLevel != null) {
201
- domProps['aria-level'] = accessibilityLevel;
202
- }
203
-
204
- if (accessibilityLiveRegion != null) {
205
- domProps['aria-live'] = accessibilityLiveRegion === 'none' ? 'off' : accessibilityLiveRegion;
206
- }
207
-
208
- if (accessibilityModal != null) {
209
- domProps['aria-modal'] = accessibilityModal;
210
- }
211
-
212
- if (accessibilityMultiline != null) {
213
- domProps['aria-multiline'] = accessibilityMultiline;
214
- }
215
-
216
- if (accessibilityMultiSelectable != null) {
217
- domProps['aria-multiselectable'] = accessibilityMultiSelectable;
218
- }
219
-
220
- if (accessibilityOrientation != null) {
221
- domProps['aria-orientation'] = accessibilityOrientation;
222
- }
223
-
224
- if (accessibilityOwns != null) {
225
- domProps['aria-owns'] = processIDRefList(accessibilityOwns);
226
- }
227
-
228
- if (accessibilityPlaceholder != null) {
229
- domProps['aria-placeholder'] = accessibilityPlaceholder;
230
- }
231
-
232
- if (accessibilityPosInSet != null) {
233
- domProps['aria-posinset'] = accessibilityPosInSet;
234
- }
235
-
236
- if (accessibilityPressed != null) {
237
- domProps['aria-pressed'] = accessibilityPressed;
238
- }
239
-
240
- if (accessibilityReadOnly != null) {
241
- domProps['aria-readonly'] = accessibilityReadOnly; // Enhance with native semantics
242
-
243
- if (elementType === 'input' || elementType === 'select' || elementType === 'textarea') {
244
- domProps.readOnly = true;
245
- }
246
- }
247
-
248
- if (accessibilityRequired != null) {
249
- domProps['aria-required'] = accessibilityRequired; // Enhance with native semantics
250
-
251
- if (elementType === 'input' || elementType === 'select' || elementType === 'textarea') {
252
- domProps.required = true;
253
- }
254
- }
255
-
256
- if (role != null) {
257
- // 'presentation' synonym has wider browser support
258
- domProps['role'] = role === 'none' ? 'presentation' : role;
259
- }
260
-
261
- if (accessibilityRoleDescription != null) {
262
- domProps['aria-roledescription'] = accessibilityRoleDescription;
263
- }
264
-
265
- if (accessibilityRowCount != null) {
266
- domProps['aria-rowcount'] = accessibilityRowCount;
267
- }
268
-
269
- if (accessibilityRowIndex != null) {
270
- domProps['aria-rowindex'] = accessibilityRowIndex;
271
- }
272
-
273
- if (accessibilityRowSpan != null) {
274
- domProps['aria-rowspan'] = accessibilityRowSpan;
275
- }
276
-
277
- if (accessibilitySelected != null) {
278
- domProps['aria-selected'] = accessibilitySelected;
279
- }
280
-
281
- if (accessibilitySetSize != null) {
282
- domProps['aria-setsize'] = accessibilitySetSize;
283
- }
284
-
285
- if (accessibilitySort != null) {
286
- domProps['aria-sort'] = accessibilitySort;
287
- }
288
-
289
- if (accessibilityValueMax != null) {
290
- domProps['aria-valuemax'] = accessibilityValueMax;
291
- }
292
-
293
- if (accessibilityValueMin != null) {
294
- domProps['aria-valuemin'] = accessibilityValueMin;
295
- }
296
-
297
- if (accessibilityValueNow != null) {
298
- domProps['aria-valuenow'] = accessibilityValueNow;
299
- }
300
-
301
- if (accessibilityValueText != null) {
302
- domProps['aria-valuetext'] = accessibilityValueText;
303
- } // "dataSet" replaced with "data-*"
304
-
305
-
306
- const tmgCN = dataSet ? dataSet.className : undefined
307
- const tmgID = dataSet ? dataSet.id : undefined
308
-
309
- if (dataSet != null) {
310
- for (var dataProp in dataSet) {
311
- if (dataProp === 'className' || dataProp === 'id') continue
312
- if (hasOwnProperty.call(dataSet, dataProp)) {
313
- var dataName = hyphenateString(dataProp);
314
- var dataValue = dataSet[dataProp];
315
-
316
- if (dataValue != null) {
317
- domProps["data-" + dataName] = dataValue;
318
- }
319
- }
320
- }
321
- } // FOCUS
322
- // "focusable" indicates that an element may be a keyboard tab-stop.
323
-
324
-
325
- if (focusable === false) {
326
- domProps.tabIndex = '-1';
327
- }
328
-
329
- if ( // These native elements are keyboard focusable by default
330
- elementType === 'a' || elementType === 'button' || elementType === 'input' || elementType === 'select' || elementType === 'textarea') {
331
- if (focusable === false || accessibilityDisabled === true) {
332
- domProps.tabIndex = '-1';
333
- }
334
- } else if ( // These roles are made keyboard focusable by default
335
- role === 'button' || role === 'checkbox' || role === 'link' || role === 'radio' || role === 'textbox' || role === 'switch') {
336
- if (focusable !== false) {
337
- domProps.tabIndex = '0';
338
- }
339
- } else {
340
- // Everything else must explicitly set the prop
341
- if (focusable === true) {
342
- domProps.tabIndex = '0';
343
- }
344
- } // Resolve styles
345
-
346
- var _StyleSheet = StyleSheet([style, pointerEvents && pointerEventsStyles[pointerEvents]], {
347
- writingDirection: options ? options.writingDirection : 'ltr'
348
- }),
349
- className = _StyleSheet[0],
350
- inlineStyle = _StyleSheet[1];
351
-
352
- // elementType = null on setNativeProps and overrides our classname
353
- if (elementType != null && className) {
354
- domProps.className = className;
355
- }
356
-
357
- if (inlineStyle) {
358
- domProps.style = inlineStyle;
359
- }
360
-
361
- if (tmgCN) {
362
- domProps.className = tmgCN
363
- }
364
-
365
- if (tmgID) {
366
- domProps.id = tmgID
367
- } else if (nativeID != null) {
368
- domProps.id = nativeID;
369
- } // Automated test IDs
370
-
371
-
372
- if (testID != null) {
373
- domProps['data-testid'] = testID;
374
- }
375
-
376
- return domProps;
377
- };
378
-
379
- export default createDOMProps;
@@ -1,116 +0,0 @@
1
- import path from 'path'
2
-
3
- import * as fs from 'fs-extra'
4
-
5
- // were patching react-native-web so we can use some internal methods
6
- // we do it this way because we need to rely on webpack or bundler config to determine cjs vs esm
7
- // so we can't just require it all directly
8
- // would be nice in the future to be able to eject from react-native-web entirely optionally
9
-
10
- const PATCH_PREFIX = 'tamagui-patch-'
11
- const PATCH_VERSION = `${PATCH_PREFIX}-v5`
12
- const PATCH_COMMENT = `// ${PATCH_VERSION}`
13
- const PATCH_END_COMMENT = `// tamagui-patch-end`
14
-
15
- // keep it sync
16
- export function patchReactNativeWeb(dir: string = require.resolve('react-native-web')) {
17
- const rootDir = dir.replace(/[\/\\]dist.*/, '')
18
-
19
- const pkgJSON = fs.readJSONSync(path.join(rootDir, 'package.json'))
20
- if (pkgJSON.version.split('.')[1] !== '18') {
21
- console.error(
22
- `⛔️ Error! Tamagui as of beta 69 only works with react-native-web version 0.18.x`,
23
- pkgJSON.version
24
- )
25
- process.exit(1)
26
- }
27
-
28
- // patch exports for tamagui
29
- const modulePath = path.join(rootDir, 'dist', 'tamagui-exports.js')
30
- const cjsPath = path.join(rootDir, 'dist', 'cjs', 'tamagui-exports.js')
31
- const alreadyPatchedImports =
32
- fs.existsSync(modulePath) &&
33
- fs.readFileSync(modulePath, 'utf-8') === moduleExports &&
34
- fs.existsSync(cjsPath) &&
35
- fs.readFileSync(cjsPath, 'utf-8') === cjsExports
36
-
37
- if (!alreadyPatchedImports) {
38
- console.log(' | patch ' + path.relative(rootDir, modulePath))
39
- fs.writeFileSync(modulePath, moduleExports)
40
- console.log(' | patch ' + path.relative(rootDir, cjsPath))
41
- fs.writeFileSync(cjsPath, cjsExports)
42
- }
43
-
44
- // patch createDOMProps
45
- const dpFile = path.join(rootDir, 'dist', 'modules', 'createDOMProps', 'index.js')
46
- const dpPatched = fs.readFileSync(
47
- path.join(__dirname, '..', '..', 'patches', '18', 'createDOMProps.js'),
48
- 'utf-8'
49
- )
50
- const dpFileCJS = path.join(rootDir, 'dist', 'cjs', 'modules', 'createDOMProps', 'index.js')
51
- const dpCJSPatched = fs.readFileSync(
52
- path.join(__dirname, '..', '..', 'patches', '18', 'createDOMProps.cjs.js'),
53
- 'utf-8'
54
- )
55
- const alreadyPatchedDOMProps =
56
- fs.readFileSync(dpFile, 'utf-8') === dpPatched &&
57
- fs.readFileSync(dpFileCJS, 'utf-8') === dpCJSPatched
58
-
59
- if (!alreadyPatchedDOMProps) {
60
- console.log(' | patch ' + path.relative(rootDir, dpFile))
61
- fs.writeFileSync(dpFile, dpPatched)
62
- console.log(' | patch ' + path.relative(rootDir, dpFileCJS))
63
- fs.writeFileSync(dpFileCJS, dpCJSPatched)
64
- }
65
-
66
- // export tamagui exports from root
67
- const moduleEntry = path.join(rootDir, 'dist', 'index.js')
68
- const moduleEntrySrc = fs.readFileSync(moduleEntry, 'utf-8')
69
- if (!moduleEntrySrc.includes(PATCH_COMMENT)) {
70
- fs.writeFileSync(
71
- moduleEntry,
72
- `${removePatch(moduleEntrySrc)}
73
-
74
- ${PATCH_COMMENT}
75
- import * as TExports from './tamagui-exports'
76
- export const TamaguiExports = TExports
77
- ${PATCH_END_COMMENT}
78
- `
79
- )
80
- }
81
- const cjsEntry = path.join(rootDir, 'dist', 'cjs', 'index.js')
82
- const cjsEntrySrc = fs.readFileSync(cjsEntry, 'utf-8')
83
- if (!cjsEntrySrc.includes(PATCH_COMMENT)) {
84
- fs.writeFileSync(
85
- cjsEntry,
86
- `${removePatch(cjsEntrySrc)}
87
-
88
- ${PATCH_COMMENT}
89
- exports.TamaguiExports = require("./tamagui-exports");
90
- ${PATCH_END_COMMENT}
91
- `
92
- )
93
- }
94
- }
95
-
96
- function removePatch(source: string) {
97
- return source.replace(/\/\/ tamagui-patch([.\s\S]*)/g, '')
98
- }
99
-
100
- const moduleExports = `
101
- export { default as createDOMProps } from './modules/createDOMProps'
102
- export { default as TextAncestorContext } from './exports/Text/TextAncestorContext'
103
- export { default as useElementLayout } from './modules/useElementLayout'
104
- export { default as useMergeRefs } from './modules/useMergeRefs'
105
- export { default as usePlatformMethods } from './modules/usePlatformMethods'
106
- export { default as useResponderEvents } from './modules/useResponderEvents'
107
- `
108
-
109
- const cjsExports = `
110
- exports.createDOMProps = require('./modules/createDOMProps')
111
- exports.TextAncestorContext = require('./exports/Text/TextAncestorContext')
112
- exports.useElementLayout = require('./modules/useElementLayout')
113
- exports.useMergeRefs = require('./modules/useMergeRefs')
114
- exports.usePlatformMethods = require('./modules/usePlatformMethods')
115
- exports.useResponderEvents = require('./modules/useResponderEvents')
116
- `
@@ -1,2 +0,0 @@
1
- export declare function patchReactNativeWeb(dir?: string): void;
2
- //# sourceMappingURL=patchReactNativeWeb.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"patchReactNativeWeb.d.ts","sourceRoot":"","sources":["../src/patchReactNativeWeb.ts"],"names":[],"mappings":"AAeA,wBAAgB,mBAAmB,CAAC,GAAG,GAAE,MAA4C,QA8EpF"}