@hanzogui/web 7.0.0 → 7.3.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/LICENSE +40 -19
- package/dist/cjs/_withStableStyle.cjs +1 -1
- package/dist/cjs/_withStableStyle.native.js +1 -1
- package/dist/cjs/config.cjs +2 -2
- package/dist/cjs/config.native.js +2 -2
- package/dist/cjs/config.native.js.map +1 -1
- package/dist/cjs/constants/constants.cjs +3 -3
- package/dist/cjs/constants/constants.native.js +3 -3
- package/dist/cjs/createComponent.cjs +307 -530
- package/dist/cjs/createComponent.native.js +265 -588
- package/dist/cjs/createComponent.native.js.map +1 -1
- package/dist/cjs/createGui.cjs +19 -48
- package/dist/cjs/createGui.native.js +22 -65
- package/dist/cjs/createGui.native.js.map +1 -1
- package/dist/cjs/eventHandling.native.js +19 -9
- package/dist/cjs/eventHandling.native.js.map +1 -1
- package/dist/cjs/helpers/createDesignSystem.cjs +22 -36
- package/dist/cjs/helpers/createDesignSystem.native.js +19 -91
- package/dist/cjs/helpers/createDesignSystem.native.js.map +1 -1
- package/dist/cjs/helpers/defaultAnimationDriver.cjs +1 -1
- package/dist/cjs/helpers/defaultAnimationDriver.native.js +1 -1
- package/dist/cjs/helpers/expandStyle.cjs +11 -74
- package/dist/cjs/helpers/expandStyle.native.js +29 -81
- package/dist/cjs/helpers/expandStyle.native.js.map +1 -1
- package/dist/cjs/helpers/expandStyles.cjs +2 -15
- package/dist/cjs/helpers/expandStyles.native.js +7 -13
- package/dist/cjs/helpers/expandStyles.native.js.map +1 -1
- package/dist/cjs/helpers/getSplitStyles.cjs +233 -557
- package/dist/cjs/helpers/getSplitStyles.native.js +204 -659
- package/dist/cjs/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/cjs/helpers/getThemeCSSRules.cjs +8 -16
- package/dist/cjs/helpers/getTokenForKey.cjs +32 -54
- package/dist/cjs/helpers/getTokenForKey.native.js +40 -59
- package/dist/cjs/helpers/getTokenForKey.native.js.map +1 -1
- package/dist/cjs/helpers/insertStyleRule.cjs +27 -79
- package/dist/cjs/helpers/insertStyleRule.native.js +16 -335
- package/dist/cjs/helpers/insertStyleRule.native.js.map +1 -1
- package/dist/cjs/helpers/isActivePlatform.cjs +2 -17
- package/dist/cjs/helpers/isActivePlatform.native.js +2 -17
- package/dist/cjs/helpers/isActivePlatform.native.js.map +1 -1
- package/dist/cjs/helpers/log.cjs +1 -4
- package/dist/cjs/helpers/log.native.js +1 -6
- package/dist/cjs/helpers/log.native.js.map +1 -1
- package/dist/cjs/helpers/propMapper.cjs +37 -110
- package/dist/cjs/helpers/propMapper.native.js +54 -131
- package/dist/cjs/helpers/propMapper.native.js.map +1 -1
- package/dist/cjs/helpers/skipProps.cjs +3 -11
- package/dist/cjs/helpers/skipProps.native.js +3 -11
- package/dist/cjs/helpers/skipProps.native.js.map +1 -1
- package/dist/cjs/helpers/useRenderElement.cjs +7 -18
- package/dist/cjs/helpers/useRenderElement.native.js +7 -15
- package/dist/cjs/helpers/useRenderElement.native.js.map +1 -1
- package/dist/cjs/helpers/wrapStyleTags.cjs +11 -15
- package/dist/cjs/helpers/wrapStyleTags.native.js +3 -22
- package/dist/cjs/helpers/wrapStyleTags.native.js.map +1 -1
- package/dist/cjs/hooks/getThemeProxied.cjs +10 -54
- package/dist/cjs/hooks/getThemeProxied.native.js +27 -48
- package/dist/cjs/hooks/getThemeProxied.native.js.map +1 -1
- package/dist/cjs/hooks/useTheme.cjs +2 -2
- package/dist/cjs/hooks/useTheme.native.js +2 -2
- package/dist/cjs/hooks/useTheme.native.js.map +1 -1
- package/dist/cjs/hooks/useThemeState.cjs +66 -124
- package/dist/cjs/hooks/useThemeState.native.js +64 -142
- package/dist/cjs/hooks/useThemeState.native.js.map +1 -1
- package/dist/cjs/insertFont.cjs +6 -15
- package/dist/cjs/insertFont.native.js +7 -23
- package/dist/cjs/insertFont.native.js.map +1 -1
- package/dist/cjs/setupReactNative.cjs +4 -24
- package/dist/cjs/setupReactNative.native.js +5 -26
- package/dist/cjs/setupReactNative.native.js.map +1 -1
- package/dist/cjs/views/GuiProvider.cjs +4 -6
- package/dist/cjs/views/GuiProvider.native.js +5 -7
- package/dist/cjs/views/GuiProvider.native.js.map +1 -1
- package/dist/cjs/views/Text.cjs +11 -18
- package/dist/cjs/views/Text.native.js +6 -14
- package/dist/cjs/views/Text.native.js.map +1 -1
- package/dist/cjs/views/ThemeProvider.cjs +9 -11
- package/dist/cjs/views/ThemeProvider.native.js +3 -16
- package/dist/cjs/views/ThemeProvider.native.js.map +1 -1
- package/dist/cjs/views/View.native.js.map +1 -1
- package/dist/esm/_withStableStyle.mjs +1 -1
- package/dist/esm/_withStableStyle.mjs.map +1 -1
- package/dist/esm/_withStableStyle.native.js +1 -1
- package/dist/esm/config.mjs +2 -2
- package/dist/esm/config.mjs.map +1 -1
- package/dist/esm/config.native.js +2 -2
- package/dist/esm/config.native.js.map +1 -1
- package/dist/esm/constants/constants.mjs +3 -3
- package/dist/esm/constants/constants.native.js +3 -3
- package/dist/esm/createComponent.mjs +311 -536
- package/dist/esm/createComponent.mjs.map +1 -1
- package/dist/esm/createComponent.native.js +265 -591
- package/dist/esm/createComponent.native.js.map +1 -1
- package/dist/esm/createGui.mjs +20 -51
- package/dist/esm/createGui.mjs.map +1 -1
- package/dist/esm/createGui.native.js +24 -70
- package/dist/esm/createGui.native.js.map +1 -1
- package/dist/esm/createVariables.mjs.map +1 -1
- package/dist/esm/createVariables.native.js.map +1 -1
- package/dist/esm/eventHandling.native.js +19 -9
- package/dist/esm/eventHandling.native.js.map +1 -1
- package/dist/esm/helpers/createDesignSystem.mjs +22 -36
- package/dist/esm/helpers/createDesignSystem.mjs.map +1 -1
- package/dist/esm/helpers/createDesignSystem.native.js +18 -90
- package/dist/esm/helpers/createDesignSystem.native.js.map +1 -1
- package/dist/esm/helpers/defaultAnimationDriver.mjs +1 -1
- package/dist/esm/helpers/defaultAnimationDriver.mjs.map +1 -1
- package/dist/esm/helpers/defaultAnimationDriver.native.js +1 -1
- package/dist/esm/helpers/expandStyle.mjs +12 -73
- package/dist/esm/helpers/expandStyle.mjs.map +1 -1
- package/dist/esm/helpers/expandStyle.native.js +28 -80
- package/dist/esm/helpers/expandStyle.native.js.map +1 -1
- package/dist/esm/helpers/expandStyles.mjs +2 -15
- package/dist/esm/helpers/expandStyles.mjs.map +1 -1
- package/dist/esm/helpers/expandStyles.native.js +7 -13
- package/dist/esm/helpers/expandStyles.native.js.map +1 -1
- package/dist/esm/helpers/getSplitStyles.mjs +236 -560
- package/dist/esm/helpers/getSplitStyles.mjs.map +1 -1
- package/dist/esm/helpers/getSplitStyles.native.js +205 -662
- package/dist/esm/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/esm/helpers/getThemeCSSRules.mjs +8 -16
- package/dist/esm/helpers/getThemeCSSRules.mjs.map +1 -1
- package/dist/esm/helpers/getTokenForKey.mjs +32 -54
- package/dist/esm/helpers/getTokenForKey.mjs.map +1 -1
- package/dist/esm/helpers/getTokenForKey.native.js +40 -59
- package/dist/esm/helpers/getTokenForKey.native.js.map +1 -1
- package/dist/esm/helpers/insertStyleRule.mjs +27 -79
- package/dist/esm/helpers/insertStyleRule.mjs.map +1 -1
- package/dist/esm/helpers/insertStyleRule.native.js +14 -333
- package/dist/esm/helpers/insertStyleRule.native.js.map +1 -1
- package/dist/esm/helpers/isActivePlatform.mjs +2 -17
- package/dist/esm/helpers/isActivePlatform.mjs.map +1 -1
- package/dist/esm/helpers/isActivePlatform.native.js +2 -17
- package/dist/esm/helpers/isActivePlatform.native.js.map +1 -1
- package/dist/esm/helpers/log.mjs +1 -4
- package/dist/esm/helpers/log.mjs.map +1 -1
- package/dist/esm/helpers/log.native.js +1 -6
- package/dist/esm/helpers/log.native.js.map +1 -1
- package/dist/esm/helpers/propMapper.mjs +37 -108
- package/dist/esm/helpers/propMapper.mjs.map +1 -1
- package/dist/esm/helpers/propMapper.native.js +54 -131
- package/dist/esm/helpers/propMapper.native.js.map +1 -1
- package/dist/esm/helpers/skipProps.mjs +3 -10
- package/dist/esm/helpers/skipProps.mjs.map +1 -1
- package/dist/esm/helpers/skipProps.native.js +2 -10
- package/dist/esm/helpers/skipProps.native.js.map +1 -1
- package/dist/esm/helpers/useRenderElement.mjs +9 -22
- package/dist/esm/helpers/useRenderElement.mjs.map +1 -1
- package/dist/esm/helpers/useRenderElement.native.js +8 -17
- package/dist/esm/helpers/useRenderElement.native.js.map +1 -1
- package/dist/esm/helpers/wrapStyleTags.mjs +11 -15
- package/dist/esm/helpers/wrapStyleTags.mjs.map +1 -1
- package/dist/esm/helpers/wrapStyleTags.native.js +1 -20
- package/dist/esm/helpers/wrapStyleTags.native.js.map +1 -1
- package/dist/esm/hooks/getThemeProxied.mjs +11 -52
- package/dist/esm/hooks/getThemeProxied.mjs.map +1 -1
- package/dist/esm/hooks/getThemeProxied.native.js +27 -48
- package/dist/esm/hooks/getThemeProxied.native.js.map +1 -1
- package/dist/esm/hooks/useTheme.mjs +2 -2
- package/dist/esm/hooks/useTheme.mjs.map +1 -1
- package/dist/esm/hooks/useTheme.native.js +2 -2
- package/dist/esm/hooks/useTheme.native.js.map +1 -1
- package/dist/esm/hooks/useThemeState.mjs +67 -124
- package/dist/esm/hooks/useThemeState.mjs.map +1 -1
- package/dist/esm/hooks/useThemeState.native.js +64 -142
- package/dist/esm/hooks/useThemeState.native.js.map +1 -1
- package/dist/esm/insertFont.mjs +7 -17
- package/dist/esm/insertFont.mjs.map +1 -1
- package/dist/esm/insertFont.native.js +7 -24
- package/dist/esm/insertFont.native.js.map +1 -1
- package/dist/esm/setupReactNative.mjs +4 -24
- package/dist/esm/setupReactNative.mjs.map +1 -1
- package/dist/esm/setupReactNative.native.js +5 -26
- package/dist/esm/setupReactNative.native.js.map +1 -1
- package/dist/esm/views/GuiProvider.mjs +4 -6
- package/dist/esm/views/GuiProvider.mjs.map +1 -1
- package/dist/esm/views/GuiProvider.native.js +5 -7
- package/dist/esm/views/GuiProvider.native.js.map +1 -1
- package/dist/esm/views/Slot.mjs.map +1 -1
- package/dist/esm/views/Text.mjs +11 -18
- package/dist/esm/views/Text.mjs.map +1 -1
- package/dist/esm/views/Text.native.js +5 -12
- package/dist/esm/views/Text.native.js.map +1 -1
- package/dist/esm/views/Theme.mjs.map +1 -1
- package/dist/esm/views/ThemeProvider.mjs +9 -11
- package/dist/esm/views/ThemeProvider.mjs.map +1 -1
- package/dist/esm/views/ThemeProvider.native.js +1 -14
- package/dist/esm/views/ThemeProvider.native.js.map +1 -1
- package/dist/esm/views/View.mjs.map +1 -1
- package/dist/esm/views/View.native.js.map +1 -1
- package/package.json +34 -22
- package/src/_withStableStyle.tsx +2 -2
- package/src/config.ts +7 -4
- package/src/constants/accessibilityDirectMap.tsx +1 -1
- package/src/constants/constants.ts +3 -3
- package/src/createComponent.tsx +31 -2
- package/src/createGui.ts +2 -2
- package/src/eventHandling.native.ts +31 -10
- package/src/helpers/createMediaStyle.ts +1 -1
- package/src/helpers/defaultAnimationDriver.tsx +1 -1
- package/src/helpers/getSplitStyles.tsx +1 -1
- package/src/helpers/getTokenForKey.ts +42 -29
- package/src/helpers/insertStyleRule.tsx +2 -2
- package/src/helpers/isActivePlatform.ts +5 -5
- package/src/helpers/mergeProps.ts +1 -1
- package/src/helpers/skipProps.ts +1 -1
- package/src/helpers/useRenderElement.tsx +4 -1
- package/src/hooks/useTheme.tsx +2 -2
- package/src/interfaces/GuiComponentPropsBaseBase.tsx +10 -4
- package/src/styled.tsx +2 -2
- package/src/types.tsx +33 -24
- package/src/views/View.tsx +6 -1
- package/types/config.d.ts.map +1 -1
- package/types/eventHandling.native.d.ts.map +1 -1
- package/types/helpers/getTokenForKey.d.ts.map +1 -1
- package/types/helpers/isActivePlatform.d.ts +5 -5
- package/types/helpers/skipProps.d.ts +1 -1
- package/types/helpers/useRenderElement.d.ts.map +1 -1
- package/types/helpers/wrapStyleTags.d.ts +1 -1
- package/types/helpers/wrapStyleTags.d.ts.map +1 -1
- package/types/interfaces/GuiComponentPropsBaseBase.d.ts +3 -3
- package/types/interfaces/GuiComponentPropsBaseBase.d.ts.map +1 -1
- package/types/styled.d.ts +1 -1
- package/types/types.d.ts +17 -17
- package/types/types.d.ts.map +1 -1
- package/types/views/Configuration.d.ts +1 -1
- package/types/views/Configuration.d.ts.map +1 -1
- package/types/views/FontLanguage.d.ts +1 -1
- package/types/views/FontLanguage.native.d.ts +2 -1
- package/types/views/FontLanguage.native.d.ts.map +1 -1
- package/types/views/GuiProvider.d.ts +2 -1
- package/types/views/GuiProvider.d.ts.map +1 -1
- package/types/views/GuiRoot.d.ts +1 -1
- package/types/views/GuiRoot.d.ts.map +1 -1
- package/types/views/Slot.d.ts +1 -1
- package/types/views/ThemeProvider.d.ts +1 -1
- package/types/views/ThemeProvider.d.ts.map +1 -1
- package/types/views/View.d.ts.map +1 -1
- package/.turbo/turbo-build.log +0 -2
- package/inject-styles/index.cjs +0 -2
- package/inject-styles/index.js +0 -2
- package/tsconfig.json +0 -44
- package/tsconfig.test.json +0 -9
- package/vitest.config.d.ts +0 -3
- package/vitest.config.d.ts.map +0 -1
- package/vitest.config.ts +0 -14
|
@@ -65,7 +65,7 @@ var import_pseudoTransitions = require("./helpers/pseudoTransitions.native.js");
|
|
|
65
65
|
var import_setElementProps = require("./helpers/setElementProps.native.js");
|
|
66
66
|
var import_subscribeToContextGroup = require("./helpers/subscribeToContextGroup.native.js");
|
|
67
67
|
var import_themeable = require("./helpers/themeable.native.js");
|
|
68
|
-
|
|
68
|
+
require("./helpers/wrapStyleTags.native.js");
|
|
69
69
|
var import_useComponentState = require("./hooks/useComponentState.native.js");
|
|
70
70
|
var import_useMedia = require("./hooks/useMedia.native.js");
|
|
71
71
|
var import_useTheme = require("./hooks/useTheme.native.js");
|
|
@@ -82,113 +82,6 @@ var debugKeyListeners;
|
|
|
82
82
|
var startVisualizer;
|
|
83
83
|
var componentSetStates = /* @__PURE__ */new Set();
|
|
84
84
|
var avoidReRenderKeys = /* @__PURE__ */new Set(["hover", "press", "pressIn", "group", "focus", "focusWithin", "media", "group"]);
|
|
85
|
-
if (false) {
|
|
86
|
-
var cancelPresses = function () {
|
|
87
|
-
componentSetStates.forEach(function (setState) {
|
|
88
|
-
return setState(function (prev) {
|
|
89
|
-
if (prev.press || prev.pressIn) {
|
|
90
|
-
return {
|
|
91
|
-
...prev,
|
|
92
|
-
press: false,
|
|
93
|
-
pressIn: false
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
return prev;
|
|
97
|
-
});
|
|
98
|
-
});
|
|
99
|
-
componentSetStates.clear();
|
|
100
|
-
};
|
|
101
|
-
var cancelTouches = function () {
|
|
102
|
-
componentSetStates.forEach(function (setState) {
|
|
103
|
-
return setState(function (prev) {
|
|
104
|
-
if (prev.press || prev.pressIn || prev.hover) {
|
|
105
|
-
return {
|
|
106
|
-
...prev,
|
|
107
|
-
press: false,
|
|
108
|
-
pressIn: false,
|
|
109
|
-
hover: false
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
return prev;
|
|
113
|
-
});
|
|
114
|
-
});
|
|
115
|
-
componentSetStates.clear();
|
|
116
|
-
};
|
|
117
|
-
addEventListener("mouseup", cancelPresses);
|
|
118
|
-
addEventListener("touchend", cancelTouches);
|
|
119
|
-
addEventListener("touchcancel", cancelTouches);
|
|
120
|
-
if (process.env.NODE_ENV === "development") {
|
|
121
|
-
startVisualizer = function () {
|
|
122
|
-
var devVisualizerConfig = import_config.devConfig === null || import_config.devConfig === void 0 ? void 0 : import_config.devConfig.visualizer;
|
|
123
|
-
if (devVisualizerConfig && !globalThis.__guiDevVisualizer) {
|
|
124
|
-
let show2 = function (val) {
|
|
125
|
-
clearTimeout(tm);
|
|
126
|
-
isShowing = val;
|
|
127
|
-
debugKeyListeners === null || debugKeyListeners === void 0 ? void 0 : debugKeyListeners.forEach(function (l) {
|
|
128
|
-
return l(val);
|
|
129
|
-
});
|
|
130
|
-
if (!val && resizeListener) {
|
|
131
|
-
window.removeEventListener("resize", resizeListener);
|
|
132
|
-
resizeListener = null;
|
|
133
|
-
}
|
|
134
|
-
},
|
|
135
|
-
cancelShow2 = function () {
|
|
136
|
-
clearTimeout(tm);
|
|
137
|
-
if (resizeListener) {
|
|
138
|
-
window.removeEventListener("resize", resizeListener);
|
|
139
|
-
resizeListener = null;
|
|
140
|
-
}
|
|
141
|
-
};
|
|
142
|
-
var show = show2,
|
|
143
|
-
cancelShow = cancelShow2;
|
|
144
|
-
globalThis.__guiDevVisualizer = true;
|
|
145
|
-
debugKeyListeners = /* @__PURE__ */new Set();
|
|
146
|
-
var tm;
|
|
147
|
-
var isShowing = false;
|
|
148
|
-
var resizeListener = null;
|
|
149
|
-
var options = {
|
|
150
|
-
key: "Alt",
|
|
151
|
-
delay: 800,
|
|
152
|
-
...((typeof devVisualizerConfig === "undefined" ? "undefined" : _type_of(devVisualizerConfig)) === "object" ? devVisualizerConfig : {})
|
|
153
|
-
};
|
|
154
|
-
window.addEventListener("blur", function () {
|
|
155
|
-
show2(false);
|
|
156
|
-
});
|
|
157
|
-
window.addEventListener("keydown", function (param) {
|
|
158
|
-
var {
|
|
159
|
-
key,
|
|
160
|
-
metaKey,
|
|
161
|
-
defaultPrevented
|
|
162
|
-
} = param;
|
|
163
|
-
clearTimeout(tm);
|
|
164
|
-
if (defaultPrevented) return;
|
|
165
|
-
if (metaKey) return;
|
|
166
|
-
if (key === options.key) {
|
|
167
|
-
if (!resizeListener) {
|
|
168
|
-
resizeListener = function () {
|
|
169
|
-
return cancelShow2();
|
|
170
|
-
};
|
|
171
|
-
window.addEventListener("resize", resizeListener);
|
|
172
|
-
}
|
|
173
|
-
tm = setTimeout(function () {
|
|
174
|
-
show2(true);
|
|
175
|
-
}, options.delay);
|
|
176
|
-
}
|
|
177
|
-
});
|
|
178
|
-
window.addEventListener("keyup", function (param) {
|
|
179
|
-
var {
|
|
180
|
-
defaultPrevented
|
|
181
|
-
} = param;
|
|
182
|
-
if (defaultPrevented) return;
|
|
183
|
-
cancelShow2();
|
|
184
|
-
if (isShowing) {
|
|
185
|
-
show2(false);
|
|
186
|
-
}
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
};
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
85
|
var BaseText;
|
|
193
86
|
var BaseView;
|
|
194
87
|
var hasSetupBaseViews = false;
|
|
@@ -200,19 +93,13 @@ var lastInteractionWasTouch = {
|
|
|
200
93
|
};
|
|
201
94
|
if (import_constants.isWeb && typeof document !== "undefined") {
|
|
202
95
|
document.addEventListener("keydown", function () {
|
|
203
|
-
if (!lastInteractionWasKeyboard.value)
|
|
204
|
-
lastInteractionWasKeyboard.value = true;
|
|
205
|
-
}
|
|
96
|
+
if (!lastInteractionWasKeyboard.value) lastInteractionWasKeyboard.value = true;
|
|
206
97
|
});
|
|
207
98
|
document.addEventListener("mousedown", function () {
|
|
208
|
-
if (lastInteractionWasKeyboard.value)
|
|
209
|
-
lastInteractionWasKeyboard.value = false;
|
|
210
|
-
}
|
|
99
|
+
if (lastInteractionWasKeyboard.value) lastInteractionWasKeyboard.value = false;
|
|
211
100
|
});
|
|
212
101
|
document.addEventListener("mousemove", function () {
|
|
213
|
-
if (lastInteractionWasKeyboard.value)
|
|
214
|
-
lastInteractionWasKeyboard.value = false;
|
|
215
|
-
}
|
|
102
|
+
if (lastInteractionWasKeyboard.value) lastInteractionWasKeyboard.value = false;
|
|
216
103
|
lastInteractionWasTouch.value = false;
|
|
217
104
|
});
|
|
218
105
|
document.addEventListener("touchstart", function () {
|
|
@@ -238,15 +125,13 @@ function createComponent(staticConfig) {
|
|
|
238
125
|
startVisualizer = void 0;
|
|
239
126
|
}
|
|
240
127
|
}
|
|
241
|
-
if (
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
BaseView = baseViews.View;
|
|
249
|
-
}
|
|
128
|
+
if (!hasSetupBaseViews) {
|
|
129
|
+
var _hooks_getBaseViews;
|
|
130
|
+
hasSetupBaseViews = true;
|
|
131
|
+
var baseViews = (_hooks_getBaseViews = import_setupHooks.hooks.getBaseViews) === null || _hooks_getBaseViews === void 0 ? void 0 : _hooks_getBaseViews.call(import_setupHooks.hooks);
|
|
132
|
+
if (baseViews) {
|
|
133
|
+
BaseText = baseViews.Text;
|
|
134
|
+
BaseView = baseViews.View;
|
|
250
135
|
}
|
|
251
136
|
}
|
|
252
137
|
if (process.env.NODE_ENV === "test") {
|
|
@@ -265,76 +150,67 @@ function createComponent(staticConfig) {
|
|
|
265
150
|
var overriddenContextProps = null;
|
|
266
151
|
var componentContext = import_react.default.useContext(import_ComponentContext.ComponentContext);
|
|
267
152
|
var hasTextAncestor = !!(import_constants.isWeb && isText ? componentContext.inText : false);
|
|
268
|
-
var isInsideNativeMenu =
|
|
153
|
+
var isInsideNativeMenu = import_react.default.useContext(import_native.NativeMenuContext);
|
|
269
154
|
if (!process.env.GUI_IS_CORE_NODE && process.env.NODE_ENV === "development" && debugProp === "profile" && !time) {
|
|
270
|
-
|
|
271
|
-
time = timer.start();
|
|
155
|
+
time = require("@hanzogui/timer").timer().start();
|
|
272
156
|
globalThis["time"] = time;
|
|
273
157
|
}
|
|
274
|
-
if (process.env.NODE_ENV === "development" && !time && globalThis.time)
|
|
275
|
-
|
|
276
|
-
}
|
|
277
|
-
if (process.env.NODE_ENV === "development" && time) time`non-tamagui time (ignore)`;
|
|
158
|
+
if (process.env.NODE_ENV === "development" && !time && globalThis.time) time = globalThis.time;
|
|
159
|
+
if (process.env.NODE_ENV === "development" && time) time`non-gui time (ignore)`;
|
|
278
160
|
var props = propsIn;
|
|
279
161
|
var componentName = props.componentName || staticConfig.componentName;
|
|
280
162
|
var defaultProps = (0, import_getDefaultProps.getDefaultProps)(staticConfig, props.componentName);
|
|
281
163
|
var [nextProps, overrides] = (0, import_mergeProps.mergeComponentProps)(defaultProps, styledContextValue, propsIn);
|
|
282
164
|
props = nextProps;
|
|
283
165
|
overriddenContextProps = overrides;
|
|
284
|
-
if (process.env.NODE_ENV === "development" && import_constants.isClient) {
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
overlay.style.borderColor = "red";
|
|
308
|
-
overlay.style.borderWidth = "1px";
|
|
309
|
-
overlay.style.borderStyle = "dotted";
|
|
310
|
-
}
|
|
311
|
-
var dataAt = node.getAttribute("data-at") || "";
|
|
312
|
-
var dataIn = node.getAttribute("data-in") || "";
|
|
313
|
-
var tooltip = document.createElement("span");
|
|
314
|
-
tooltip.style.position = "absolute";
|
|
315
|
-
tooltip.style.top = "0px";
|
|
316
|
-
tooltip.style.left = "0px";
|
|
317
|
-
tooltip.style.padding = "3px";
|
|
318
|
-
tooltip.style.background = "rgba(0,0,0,0.75)";
|
|
319
|
-
tooltip.style.color = "rgba(255,255,255,1)";
|
|
320
|
-
tooltip.style.fontSize = "12px";
|
|
321
|
-
tooltip.style.lineHeight = "12px";
|
|
322
|
-
tooltip.style.fontFamily = "monospace";
|
|
323
|
-
tooltip.innerText = `${componentName || ""} ${dataAt} ${dataIn}`.trim();
|
|
324
|
-
overlay.appendChild(tooltip);
|
|
325
|
-
node.appendChild(overlay);
|
|
326
|
-
} else {
|
|
327
|
-
remove();
|
|
166
|
+
if (process.env.NODE_ENV === "development" && import_constants.isClient) import_react.default.useEffect(function () {
|
|
167
|
+
var node;
|
|
168
|
+
var overlay = null;
|
|
169
|
+
var remove = function () {
|
|
170
|
+
if (overlay) try {
|
|
171
|
+
var _overlay_parentNode;
|
|
172
|
+
(_overlay_parentNode = overlay.parentNode) === null || _overlay_parentNode === void 0 || _overlay_parentNode.removeChild(overlay);
|
|
173
|
+
overlay = null;
|
|
174
|
+
} catch (e) {}
|
|
175
|
+
};
|
|
176
|
+
var debugVisualizerHandler = function () {
|
|
177
|
+
var show = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
|
|
178
|
+
node = stateRef.current.host;
|
|
179
|
+
if (!node) return;
|
|
180
|
+
if (show) {
|
|
181
|
+
if (!overlay) {
|
|
182
|
+
overlay = document.createElement("span");
|
|
183
|
+
overlay.style.inset = "0px";
|
|
184
|
+
overlay.style.zIndex = "1000000";
|
|
185
|
+
overlay.style.position = "absolute";
|
|
186
|
+
overlay.style.borderColor = "red";
|
|
187
|
+
overlay.style.borderWidth = "1px";
|
|
188
|
+
overlay.style.borderStyle = "dotted";
|
|
328
189
|
}
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
190
|
+
var dataAt = node.getAttribute("data-at") || "";
|
|
191
|
+
var dataIn = node.getAttribute("data-in") || "";
|
|
192
|
+
var tooltip = document.createElement("span");
|
|
193
|
+
tooltip.style.position = "absolute";
|
|
194
|
+
tooltip.style.top = "0px";
|
|
195
|
+
tooltip.style.left = "0px";
|
|
196
|
+
tooltip.style.padding = "3px";
|
|
197
|
+
tooltip.style.background = "rgba(0,0,0,0.75)";
|
|
198
|
+
tooltip.style.color = "rgba(255,255,255,1)";
|
|
199
|
+
tooltip.style.fontSize = "12px";
|
|
200
|
+
tooltip.style.lineHeight = "12px";
|
|
201
|
+
tooltip.style.fontFamily = "monospace";
|
|
202
|
+
tooltip.innerText = `${componentName || ""} ${dataAt} ${dataIn}`.trim();
|
|
203
|
+
overlay.appendChild(tooltip);
|
|
204
|
+
node.appendChild(overlay);
|
|
205
|
+
} else remove();
|
|
206
|
+
};
|
|
207
|
+
debugKeyListeners = debugKeyListeners || /* @__PURE__ */new Set();
|
|
208
|
+
debugKeyListeners.add(debugVisualizerHandler);
|
|
209
|
+
return function () {
|
|
210
|
+
remove();
|
|
211
|
+
debugKeyListeners === null || debugKeyListeners === void 0 || debugKeyListeners.delete(debugVisualizerHandler);
|
|
212
|
+
};
|
|
213
|
+
}, [componentName]);
|
|
338
214
|
var groupContextParent = import_react.default.useContext(import_GroupContext.GroupContext);
|
|
339
215
|
var animationDriver = function () {
|
|
340
216
|
if (props.animatedBy && config) {
|
|
@@ -369,22 +245,18 @@ function createComponent(staticConfig) {
|
|
|
369
245
|
willBeAnimatedClient,
|
|
370
246
|
startedUnhydrated
|
|
371
247
|
} = componentState;
|
|
372
|
-
if (hasAnimationProp && (animationDriver === null || animationDriver === void 0 ? void 0 : animationDriver.avoidReRenders)) {
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
});
|
|
380
|
-
}
|
|
248
|
+
if (hasAnimationProp && (animationDriver === null || animationDriver === void 0 ? void 0 : animationDriver.avoidReRenders)) (0, import_constants.useIsomorphicLayoutEffect)(function () {
|
|
249
|
+
var pendingState = stateRef.current.nextState;
|
|
250
|
+
if (pendingState) {
|
|
251
|
+
stateRef.current.nextState = void 0;
|
|
252
|
+
componentState.setStateShallow(pendingState);
|
|
253
|
+
}
|
|
254
|
+
});
|
|
381
255
|
var allGroupContexts = (0, import_react.useMemo)(function () {
|
|
382
256
|
var _stateRef_current_group_listeners, _stateRef_current_group;
|
|
383
|
-
if (!groupName || props.passThrough)
|
|
384
|
-
return groupContextParent;
|
|
385
|
-
}
|
|
257
|
+
if (!groupName || props.passThrough) return groupContextParent;
|
|
386
258
|
var listeners = /* @__PURE__ */new Set();
|
|
387
|
-
(_stateRef_current_group = stateRef.current.group) === null || _stateRef_current_group === void 0
|
|
259
|
+
(_stateRef_current_group = stateRef.current.group) === null || _stateRef_current_group === void 0 || (_stateRef_current_group_listeners = _stateRef_current_group.listeners) == null || _stateRef_current_group_listeners.clear();
|
|
388
260
|
stateRef.current.group = {
|
|
389
261
|
listeners,
|
|
390
262
|
emit(state2) {
|
|
@@ -394,18 +266,14 @@ function createComponent(staticConfig) {
|
|
|
394
266
|
},
|
|
395
267
|
subscribe(cb) {
|
|
396
268
|
listeners.add(cb);
|
|
397
|
-
if (listeners.size === 1) {
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
});
|
|
401
|
-
}
|
|
269
|
+
if (listeners.size === 1) setStateShallow({
|
|
270
|
+
hasDynGroupChildren: true
|
|
271
|
+
});
|
|
402
272
|
return function () {
|
|
403
273
|
listeners.delete(cb);
|
|
404
|
-
if (listeners.size === 0) {
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
});
|
|
408
|
-
}
|
|
274
|
+
if (listeners.size === 0) setStateShallow({
|
|
275
|
+
hasDynGroupChildren: false
|
|
276
|
+
});
|
|
409
277
|
};
|
|
410
278
|
}
|
|
411
279
|
};
|
|
@@ -419,7 +287,7 @@ function createComponent(staticConfig) {
|
|
|
419
287
|
var _stateRef_current_group2;
|
|
420
288
|
var dispose = (_stateRef_current_group2 = stateRef.current.group) === null || _stateRef_current_group2 === void 0 ? void 0 : _stateRef_current_group2.subscribe(listener);
|
|
421
289
|
return function () {
|
|
422
|
-
dispose === null || dispose === void 0
|
|
290
|
+
dispose === null || dispose === void 0 || dispose();
|
|
423
291
|
};
|
|
424
292
|
}
|
|
425
293
|
}
|
|
@@ -430,16 +298,10 @@ function createComponent(staticConfig) {
|
|
|
430
298
|
var renderProp = props.render;
|
|
431
299
|
var isRenderString = !Component || typeof Component === "string";
|
|
432
300
|
var element = import_constants.isWeb ? isRenderString ? renderProp || Component : Component : Component;
|
|
433
|
-
var
|
|
434
|
-
var BaseViewComponent = BaseView || element || (hasTextAncestor ? "span" : "div");
|
|
435
|
-
var BaseComponent = isText ? BaseTextComponent : BaseViewComponent;
|
|
301
|
+
var BaseComponent = isText ? BaseText || element || "span" : BaseView || element || (hasTextAncestor ? "span" : "div");
|
|
436
302
|
var elementType = BaseComponent;
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
elementType = animationDriver[isText ? "Text" : "View"] || elementType;
|
|
440
|
-
}
|
|
441
|
-
var disableThemeProp = true ? false : props["data-disable-theme"];
|
|
442
|
-
var disableTheme = disableThemeProp || isHOC;
|
|
303
|
+
if (animationDriver && isAnimated && animationDriver.needsCustomComponent) elementType = animationDriver[isText ? "Text" : "View"] || elementType;
|
|
304
|
+
var disableTheme = isHOC;
|
|
443
305
|
if (process.env.NODE_ENV === "development" && time) time`theme-props`;
|
|
444
306
|
var themeStateProps = {
|
|
445
307
|
componentName,
|
|
@@ -448,15 +310,11 @@ function createComponent(staticConfig) {
|
|
|
448
310
|
debug: debugProp,
|
|
449
311
|
unstyled: props.unstyled
|
|
450
312
|
};
|
|
451
|
-
if ("theme" in props)
|
|
452
|
-
themeStateProps.name = props.theme;
|
|
453
|
-
}
|
|
313
|
+
if ("theme" in props) themeStateProps.name = props.theme;
|
|
454
314
|
themeStateProps.needsUpdate = function () {
|
|
455
315
|
return !!stateRef.current.isListeningToTheme;
|
|
456
316
|
};
|
|
457
|
-
|
|
458
|
-
themeStateProps.deopt = willBeAnimated;
|
|
459
|
-
}
|
|
317
|
+
themeStateProps.deopt = willBeAnimated;
|
|
460
318
|
if (process.env.NODE_ENV === "development") {
|
|
461
319
|
if (debugProp && debugProp !== "profile") {
|
|
462
320
|
var name = `${componentName || (Component === null || Component === void 0 ? void 0 : Component.displayName) || (Component === null || Component === void 0 ? void 0 : Component.name) || "[Unnamed Component]"}`;
|
|
@@ -465,19 +323,15 @@ function createComponent(staticConfig) {
|
|
|
465
323
|
var banner = `<${name} /> ${internalID} ${dataIs ? ` ${dataIs}` : ""} ${type.trim()} (hydrated: ${isHydrated}) (unmounted: ${state.unmounted})`;
|
|
466
324
|
var ch = propsIn.children;
|
|
467
325
|
var childLog = typeof ch === "string" ? ch.length > 4 ? ch.slice(0, 4) + "..." : ch : "";
|
|
468
|
-
if (childLog.length) {
|
|
469
|
-
childLog = `(children: ${childLog})`;
|
|
470
|
-
}
|
|
326
|
+
if (childLog.length) childLog = `(children: ${childLog})`;
|
|
471
327
|
if (import_constants.isWeb) {
|
|
472
328
|
console.info(`%c ${banner}`, "background: green; color: white;");
|
|
473
|
-
if (import_constants.isServer) {
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
});
|
|
480
|
-
} else {
|
|
329
|
+
if (import_constants.isServer) (0, import_log.log)({
|
|
330
|
+
noClass,
|
|
331
|
+
isAnimated,
|
|
332
|
+
isWeb: import_constants.isWeb,
|
|
333
|
+
inputStyle
|
|
334
|
+
});else {
|
|
481
335
|
console.groupEnd();
|
|
482
336
|
console.groupCollapsed(`${childLog} [inspect props, state, context \u{1F447}]`);
|
|
483
337
|
(0, import_log.log)("props in:", propsIn);
|
|
@@ -531,13 +385,10 @@ ${banner}
|
|
|
531
385
|
var mediaState = (0, import_useMedia.useMedia)(componentContext, debugProp);
|
|
532
386
|
(0, import_createVariable.setDidGetVariableValue)(false);
|
|
533
387
|
if (process.env.NODE_ENV === "development" && time) time`media`;
|
|
534
|
-
var resolveValues =
|
|
535
|
-
// if HOC + mounted + has animation prop, resolve as value so it passes non-variable to child
|
|
536
|
-
isAnimated && inputStyle !== "css" || isHOC && state.unmounted == false && hasAnimationProp ? "value" : "auto";
|
|
537
388
|
var styleProps = {
|
|
538
389
|
mediaState,
|
|
539
390
|
noClass,
|
|
540
|
-
resolveValues,
|
|
391
|
+
resolveValues: isAnimated && inputStyle !== "css" || isHOC && state.unmounted == false && hasAnimationProp ? "value" : "auto",
|
|
541
392
|
isExiting,
|
|
542
393
|
isAnimated,
|
|
543
394
|
willBeAnimated,
|
|
@@ -556,24 +407,18 @@ ${banner}
|
|
|
556
407
|
overriddenContextProps = overriddenContextProps || {};
|
|
557
408
|
overriddenContextProps[key] = splitStyles.overriddenContextProps[key];
|
|
558
409
|
}
|
|
559
|
-
if (!staticConfig.context)
|
|
560
|
-
contextForOverride = contextForProps;
|
|
561
|
-
}
|
|
410
|
+
if (!staticConfig.context) contextForOverride = contextForProps;
|
|
562
411
|
}
|
|
563
412
|
}
|
|
564
413
|
var groupContext = groupName ? (allGroupContexts === null || allGroupContexts === void 0 ? void 0 : allGroupContexts[groupName]) || null : null;
|
|
565
|
-
if (!isPassthrough && groupContext &&
|
|
566
|
-
// avoids onLayout if we don't need it
|
|
567
|
-
props.containerType !== "normal") {
|
|
414
|
+
if (!isPassthrough && groupContext && props.containerType !== "normal") {
|
|
568
415
|
var groupState = groupContext === null || groupContext === void 0 ? void 0 : groupContext.state;
|
|
569
416
|
if (groupState && groupState.layout === void 0) {
|
|
570
417
|
var _splitStyles_style, _splitStyles_style1;
|
|
571
|
-
if (((_splitStyles_style = splitStyles.style) === null || _splitStyles_style === void 0 ? void 0 : _splitStyles_style.width) || ((_splitStyles_style1 = splitStyles.style) === null || _splitStyles_style1 === void 0 ? void 0 : _splitStyles_style1.height)) {
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
};
|
|
576
|
-
}
|
|
418
|
+
if (((_splitStyles_style = splitStyles.style) === null || _splitStyles_style === void 0 ? void 0 : _splitStyles_style.width) || ((_splitStyles_style1 = splitStyles.style) === null || _splitStyles_style1 === void 0 ? void 0 : _splitStyles_style1.height)) groupState.layout = {
|
|
419
|
+
width: fromPx(splitStyles.style.width),
|
|
420
|
+
height: fromPx(splitStyles.style.height)
|
|
421
|
+
};
|
|
577
422
|
}
|
|
578
423
|
}
|
|
579
424
|
var hasEnterExitTransition = props.transition && _type_of(props.transition) === "object" && !Array.isArray(props.transition) && ("enter" in props.transition || "exit" in props.transition);
|
|
@@ -591,7 +436,6 @@ ${banner}
|
|
|
591
436
|
notifyGroupSubscribers(groupContext, stateRef.current.group || null, childrenGroupState);
|
|
592
437
|
}
|
|
593
438
|
};
|
|
594
|
-
var updateGroupListeners = updateGroupListeners2;
|
|
595
439
|
var ogSetStateShallow = setStateShallow;
|
|
596
440
|
stateRef.current.updateStyleListener = function () {
|
|
597
441
|
var useStyleListener = stateRef.current.useStyleListener;
|
|
@@ -618,12 +462,12 @@ ${banner}
|
|
|
618
462
|
var updateListener = function (next) {
|
|
619
463
|
var _stateRef_current_updateStyleListener, _stateRef_current;
|
|
620
464
|
stateRef.current.nextMedia = next;
|
|
621
|
-
(_stateRef_current_updateStyleListener = (_stateRef_current = stateRef.current).updateStyleListener) === null || _stateRef_current_updateStyleListener === void 0
|
|
465
|
+
(_stateRef_current_updateStyleListener = (_stateRef_current = stateRef.current).updateStyleListener) === null || _stateRef_current_updateStyleListener === void 0 || _stateRef_current_updateStyleListener.call(_stateRef_current);
|
|
622
466
|
};
|
|
623
467
|
componentContext.mediaEmitListeners.add(updateListener);
|
|
624
468
|
stateRef.current.mediaEmitCleanup = function () {
|
|
625
469
|
var _componentContext_mediaEmitListeners;
|
|
626
|
-
(_componentContext_mediaEmitListeners = componentContext.mediaEmitListeners) === null || _componentContext_mediaEmitListeners === void 0
|
|
470
|
+
(_componentContext_mediaEmitListeners = componentContext.mediaEmitListeners) === null || _componentContext_mediaEmitListeners === void 0 || _componentContext_mediaEmitListeners.delete(updateListener);
|
|
627
471
|
};
|
|
628
472
|
}
|
|
629
473
|
componentContext.mediaEmit = componentContext.mediaEmit || function (next) {
|
|
@@ -640,22 +484,16 @@ ${banner}
|
|
|
640
484
|
_iteratorError = err;
|
|
641
485
|
} finally {
|
|
642
486
|
try {
|
|
643
|
-
if (!_iteratorNormalCompletion && _iterator.return != null)
|
|
644
|
-
_iterator.return();
|
|
645
|
-
}
|
|
487
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();
|
|
646
488
|
} finally {
|
|
647
|
-
if (_didIteratorError)
|
|
648
|
-
throw _iteratorError;
|
|
649
|
-
}
|
|
489
|
+
if (_didIteratorError) throw _iteratorError;
|
|
650
490
|
}
|
|
651
491
|
}
|
|
652
492
|
};
|
|
653
493
|
stateRef.current.setStateShallow = function (nextOrGetNext) {
|
|
654
494
|
var prev = stateRef.current.nextState || state;
|
|
655
495
|
var next = typeof nextOrGetNext === "function" ? nextOrGetNext(prev) : nextOrGetNext;
|
|
656
|
-
if (next === prev || (0, import_is_equal_shallow.isEqualShallow)(prev, next))
|
|
657
|
-
return;
|
|
658
|
-
}
|
|
496
|
+
if (next === prev || (0, import_is_equal_shallow.isEqualShallow)(prev, next)) return;
|
|
659
497
|
var canAvoidReRender = Object.keys(next).every(function (key3) {
|
|
660
498
|
return avoidReRenderKeys.has(key3);
|
|
661
499
|
});
|
|
@@ -675,20 +513,18 @@ ${banner}
|
|
|
675
513
|
console.groupEnd();
|
|
676
514
|
}
|
|
677
515
|
updateGroupListeners2();
|
|
678
|
-
(_stateRef_current_updateStyleListener = (_stateRef_current = stateRef.current).updateStyleListener) === null || _stateRef_current_updateStyleListener === void 0
|
|
516
|
+
(_stateRef_current_updateStyleListener = (_stateRef_current = stateRef.current).updateStyleListener) === null || _stateRef_current_updateStyleListener === void 0 || _stateRef_current_updateStyleListener.call(_stateRef_current);
|
|
679
517
|
} else {
|
|
680
|
-
if (process.env.NODE_ENV === "development" && debugProp && debugProp !== "profile") {
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
});
|
|
685
|
-
}
|
|
518
|
+
if (process.env.NODE_ENV === "development" && debugProp && debugProp !== "profile") console.info(`[\u{1F40C}] re-render`, {
|
|
519
|
+
canAvoidReRender,
|
|
520
|
+
next
|
|
521
|
+
});
|
|
686
522
|
ogSetStateShallow(next);
|
|
687
523
|
}
|
|
688
524
|
};
|
|
689
525
|
setStateShallow = function (state2) {
|
|
690
526
|
var _stateRef_current_setStateShallow, _stateRef_current;
|
|
691
|
-
(_stateRef_current_setStateShallow = (_stateRef_current = stateRef.current).setStateShallow) === null || _stateRef_current_setStateShallow === void 0
|
|
527
|
+
(_stateRef_current_setStateShallow = (_stateRef_current = stateRef.current).setStateShallow) === null || _stateRef_current_setStateShallow === void 0 || _stateRef_current_setStateShallow.call(_stateRef_current, state2);
|
|
692
528
|
};
|
|
693
529
|
}
|
|
694
530
|
if (process.env.NODE_ENV === "development" && time) time`split-styles`;
|
|
@@ -697,16 +533,12 @@ ${banner}
|
|
|
697
533
|
splitStyles.style = splitStyles.style || {};
|
|
698
534
|
splitStyles.style.opacity = 0;
|
|
699
535
|
}
|
|
700
|
-
if (splitStyles.dynamicThemeAccess != null)
|
|
701
|
-
stateRef.current.isListeningToTheme = splitStyles.dynamicThemeAccess;
|
|
702
|
-
}
|
|
536
|
+
if (splitStyles.dynamicThemeAccess != null) stateRef.current.isListeningToTheme = splitStyles.dynamicThemeAccess;
|
|
703
537
|
}
|
|
704
538
|
var hasRuntimeMediaKeys = (splitStyles === null || splitStyles === void 0 ? void 0 : splitStyles.hasMedia) && splitStyles.hasMedia !== true;
|
|
705
539
|
var shouldListenForMedia = (0, import_createVariable.didGetVariableValue)() || hasRuntimeMediaKeys || noClass && (splitStyles === null || splitStyles === void 0 ? void 0 : splitStyles.hasMedia) === true;
|
|
706
540
|
var mediaListeningKeys = hasRuntimeMediaKeys ? splitStyles.hasMedia : null;
|
|
707
|
-
if (process.env.NODE_ENV === "development" && debugProp === "verbose")
|
|
708
|
-
console.info(`useMedia() createComponent`, shouldListenForMedia, mediaListeningKeys);
|
|
709
|
-
}
|
|
541
|
+
if (process.env.NODE_ENV === "development" && debugProp === "verbose") console.info(`useMedia() createComponent`, shouldListenForMedia, mediaListeningKeys);
|
|
710
542
|
(0, import_useMedia.setMediaShouldUpdate)(componentContext, shouldListenForMedia, mediaListeningKeys);
|
|
711
543
|
var {
|
|
712
544
|
viewProps: viewPropsIn,
|
|
@@ -735,48 +567,33 @@ ${banner}
|
|
|
735
567
|
onFocus,
|
|
736
568
|
onBlur,
|
|
737
569
|
separator,
|
|
738
|
-
// ignore from here on out
|
|
739
570
|
passThrough,
|
|
740
571
|
forceStyle: _forceStyle,
|
|
741
|
-
// @ts-ignore for next/link compat etc
|
|
742
572
|
onClick,
|
|
743
573
|
theme: _themeProp,
|
|
744
574
|
...nonGuiProps
|
|
745
575
|
} = viewPropsIn || {};
|
|
746
576
|
var viewProps = nonGuiProps;
|
|
747
|
-
if (props.forceStyle)
|
|
748
|
-
viewProps.forceStyle = props.forceStyle;
|
|
749
|
-
}
|
|
577
|
+
if (props.forceStyle) viewProps.forceStyle = props.forceStyle;
|
|
750
578
|
if (isHOC) {
|
|
751
|
-
if (typeof _themeProp !== "undefined")
|
|
752
|
-
|
|
753
|
-
}
|
|
754
|
-
if (typeof passThrough !== "undefined") {
|
|
755
|
-
viewProps.passThrough = passThrough;
|
|
756
|
-
}
|
|
579
|
+
if (typeof _themeProp !== "undefined") viewProps.theme = _themeProp;
|
|
580
|
+
if (typeof passThrough !== "undefined") viewProps.passThrough = passThrough;
|
|
757
581
|
}
|
|
758
582
|
var animationStyles;
|
|
759
|
-
var shouldUseAnimation =
|
|
760
|
-
// if it supports css vars we run it on server too to get matching initial style
|
|
761
|
-
(inputStyle === "css" ? willBeAnimatedClient : willBeAnimated) && useAnimations && !isHOC;
|
|
583
|
+
var shouldUseAnimation = (inputStyle === "css" ? willBeAnimatedClient : willBeAnimated) && useAnimations && !isHOC;
|
|
762
584
|
var animatedRef;
|
|
763
585
|
if (shouldUseAnimation) {
|
|
764
586
|
var useStyleEmitter = (animationDriver === null || animationDriver === void 0 ? void 0 : animationDriver.avoidReRenders) ? function (listener) {
|
|
765
587
|
stateRef.current.useStyleListener = listener;
|
|
766
588
|
} : void 0;
|
|
767
589
|
var effectiveTransition = (0, import_pseudoTransitions.resolveEffectivePseudoTransition)(stateRef.current.prevPseudoState, state, splitStyles === null || splitStyles === void 0 ? void 0 : splitStyles.pseudoTransitions, props.transition);
|
|
768
|
-
if (splitStyles)
|
|
769
|
-
splitStyles.effectiveTransition = effectiveTransition;
|
|
770
|
-
}
|
|
590
|
+
if (splitStyles) splitStyles.effectiveTransition = effectiveTransition;
|
|
771
591
|
stateRef.current.prevPseudoState = (0, import_pseudoTransitions.extractPseudoState)(state);
|
|
772
592
|
var animations = useAnimations({
|
|
773
593
|
props: propsWithAnimation,
|
|
774
|
-
// clone style to prevent animation driver mutations from leaking to viewProps
|
|
775
|
-
// during SSR/pre-hydration (CSS driver mutates style.transition in place)
|
|
776
594
|
style: isHydrated ? splitStylesStyle || {} : {
|
|
777
595
|
...splitStylesStyle
|
|
778
596
|
},
|
|
779
|
-
// @ts-ignore
|
|
780
597
|
styleState: splitStyles,
|
|
781
598
|
useStyleEmitter,
|
|
782
599
|
presence,
|
|
@@ -789,61 +606,43 @@ ${banner}
|
|
|
789
606
|
stateRef
|
|
790
607
|
});
|
|
791
608
|
if (animations) {
|
|
792
|
-
if (animations.ref)
|
|
793
|
-
animatedRef = animations.ref;
|
|
794
|
-
}
|
|
609
|
+
if (animations.ref) animatedRef = animations.ref;
|
|
795
610
|
if (isHydrated && animations) {
|
|
796
611
|
animationStyles = animations.style;
|
|
797
612
|
viewProps.style = animationStyles;
|
|
798
|
-
if (animations.className) {
|
|
799
|
-
viewProps.className = `${state.unmounted === "should-enter" ? "t_unmounted " : ""}${viewProps.className || ""} ${animations.className}`;
|
|
800
|
-
}
|
|
613
|
+
if (animations.className) viewProps.className = `${state.unmounted === "should-enter" ? "t_unmounted " : ""}${viewProps.className || ""} ${animations.className}`;
|
|
801
614
|
}
|
|
802
615
|
}
|
|
803
616
|
if (process.env.NODE_ENV === "development" && time) time`animations`;
|
|
804
617
|
}
|
|
805
|
-
if (process.env.NODE_ENV === "development" && props.untilMeasured && !props.group)
|
|
806
|
-
console.warn(`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.
|
|
618
|
+
if (process.env.NODE_ENV === "development" && props.untilMeasured && !props.group) console.warn(`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.
|
|
807
619
|
|
|
808
620
|
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}`);
|
|
809
|
-
}
|
|
810
621
|
if (process.env.NODE_ENV === "development" && time) time`destructure`;
|
|
811
|
-
if (!isPassthrough && groupContext &&
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
groupContext.state.layout = layout;
|
|
818
|
-
(_stateRef_current_group = stateRef.current.group) === null || _stateRef_current_group === void 0 ? void 0 : _stateRef_current_group.emit({
|
|
819
|
-
layout
|
|
820
|
-
});
|
|
821
|
-
if (!stateRef.current.hasMeasured && props.untilMeasured === "hide") {
|
|
822
|
-
setState(function (prev) {
|
|
823
|
-
return {
|
|
824
|
-
...prev
|
|
825
|
-
};
|
|
826
|
-
});
|
|
827
|
-
}
|
|
828
|
-
stateRef.current.hasMeasured = true;
|
|
622
|
+
if (!isPassthrough && groupContext && props.containerType !== "normal") nonGuiProps.onLayout = (0, import_helpers.composeEventHandlers)(nonGuiProps.onLayout, function (e) {
|
|
623
|
+
var _stateRef_current_group;
|
|
624
|
+
var layout = e.nativeEvent.layout;
|
|
625
|
+
groupContext.state.layout = layout;
|
|
626
|
+
(_stateRef_current_group = stateRef.current.group) === null || _stateRef_current_group === void 0 || _stateRef_current_group.emit({
|
|
627
|
+
layout
|
|
829
628
|
});
|
|
830
|
-
|
|
629
|
+
if (!stateRef.current.hasMeasured && props.untilMeasured === "hide") setState(function (prev) {
|
|
630
|
+
return {
|
|
631
|
+
...prev
|
|
632
|
+
};
|
|
633
|
+
});
|
|
634
|
+
stateRef.current.hasMeasured = true;
|
|
635
|
+
});
|
|
831
636
|
viewProps = ((_hooks_usePropsTransform = import_setupHooks.hooks.usePropsTransform) === null || _hooks_usePropsTransform === void 0 ? void 0 : _hooks_usePropsTransform.call(import_setupHooks.hooks, elementType, nonGuiProps, stateRef, stateRef.current.willHydrate)) || nonGuiProps;
|
|
832
|
-
if (!stateRef.current.composedRef) {
|
|
833
|
-
stateRef.current.
|
|
834
|
-
|
|
835
|
-
}, forwardedRef, import_setElementProps.setElementProps, animatedRef);
|
|
836
|
-
}
|
|
637
|
+
if (!stateRef.current.composedRef) stateRef.current.composedRef = (0, import_compose_refs.composeRefs)(function (x) {
|
|
638
|
+
return stateRef.current.host = x;
|
|
639
|
+
}, forwardedRef, import_setElementProps.setElementProps, animatedRef);
|
|
837
640
|
viewProps.ref = stateRef.current.composedRef;
|
|
838
641
|
(0, import_pointerEvents.usePointerEvents)(props, viewProps);
|
|
839
642
|
if (process.env.NODE_ENV === "development") {
|
|
840
|
-
if (!isReactNative && !isText && import_constants.isWeb && !isHOC) {
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
console.error(`Unexpected text node: ${item}. A text node cannot be a child of a <${staticConfig.componentName || propsIn.tag || "View"}>.`, props);
|
|
844
|
-
}
|
|
845
|
-
});
|
|
846
|
-
}
|
|
643
|
+
if (!isReactNative && !isText && import_constants.isWeb && !isHOC) import_react.default.Children.toArray(props.children).forEach(function (item) {
|
|
644
|
+
if (typeof item === "string" && item !== "\n") console.error(`Unexpected text node: ${item}. A text node cannot be a child of a <${staticConfig.componentName || propsIn.tag || "View"}>.`, props);
|
|
645
|
+
});
|
|
847
646
|
}
|
|
848
647
|
if (process.env.NODE_ENV === "development" && time) time`events-hooks`;
|
|
849
648
|
var unPress = function () {
|
|
@@ -852,26 +651,23 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
852
651
|
pressIn: false
|
|
853
652
|
});
|
|
854
653
|
};
|
|
855
|
-
if (process.env.NODE_ENV === "development" && import_constants.isWeb) {
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
}
|
|
873
|
-
});
|
|
874
|
-
}
|
|
654
|
+
if (process.env.NODE_ENV === "development" && import_constants.isWeb) (0, import_constants.useIsomorphicLayoutEffect)(function () {
|
|
655
|
+
if (debugProp === "verbose") {
|
|
656
|
+
let cssStyleDeclarationToObject2 = function (style) {
|
|
657
|
+
var styleObject = {};
|
|
658
|
+
for (var i = 0; i < style.length; i++) {
|
|
659
|
+
var prop = style[i];
|
|
660
|
+
styleObject[prop] = style.getPropertyValue(prop);
|
|
661
|
+
}
|
|
662
|
+
return styleObject;
|
|
663
|
+
};
|
|
664
|
+
var computed = stateRef.current.host ? cssStyleDeclarationToObject2(getComputedStyle(stateRef.current.host)) : {};
|
|
665
|
+
console.groupCollapsed(`Rendered > (opacity: ${computed.opacity})`);
|
|
666
|
+
console.warn(stateRef.current.host);
|
|
667
|
+
console.warn(computed);
|
|
668
|
+
console.groupEnd();
|
|
669
|
+
}
|
|
670
|
+
});
|
|
875
671
|
(0, import_constants.useIsomorphicLayoutEffect)(function () {
|
|
876
672
|
if (state.unmounted === true && hasEnterStyle) {
|
|
877
673
|
setStateShallow({
|
|
@@ -902,7 +698,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
902
698
|
return function () {
|
|
903
699
|
var _stateRef_current_mediaEmitCleanup, _stateRef_current;
|
|
904
700
|
componentSetStates.delete(setState);
|
|
905
|
-
(_stateRef_current_mediaEmitCleanup = (_stateRef_current = stateRef.current).mediaEmitCleanup) === null || _stateRef_current_mediaEmitCleanup === void 0
|
|
701
|
+
(_stateRef_current_mediaEmitCleanup = (_stateRef_current = stateRef.current).mediaEmitCleanup) === null || _stateRef_current_mediaEmitCleanup === void 0 || _stateRef_current_mediaEmitCleanup.call(_stateRef_current);
|
|
906
702
|
};
|
|
907
703
|
}, [state.unmounted, inputStyle]);
|
|
908
704
|
(0, import_constants.useIsomorphicLayoutEffect)(function () {
|
|
@@ -933,85 +729,64 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
933
729
|
var shouldAttach = !disabled && !props.asChild && Boolean(attachFocus || attachPress || attachHover || runtimePressStyle || runtimeHoverStyle || runtimeFocusStyle);
|
|
934
730
|
var needsPressState = Boolean(hasDynamicGroupChildren || runtimePressStyle);
|
|
935
731
|
if (process.env.NODE_ENV === "development" && time) time`events-setup`;
|
|
936
|
-
if (process.env.NODE_ENV === "development" && debugProp === "verbose") {
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
});
|
|
949
|
-
}
|
|
732
|
+
if (process.env.NODE_ENV === "development" && debugProp === "verbose") (0, import_log.log)(`\u{1FAA9} events()`, {
|
|
733
|
+
runtimeFocusStyle,
|
|
734
|
+
runtimePressStyle,
|
|
735
|
+
runtimeHoverStyle,
|
|
736
|
+
runtimeFocusVisibleStyle,
|
|
737
|
+
attachPress,
|
|
738
|
+
attachFocus,
|
|
739
|
+
attachHover,
|
|
740
|
+
shouldAttach,
|
|
741
|
+
needsHoverState,
|
|
742
|
+
pseudos
|
|
743
|
+
});
|
|
950
744
|
var events = shouldAttach ? {
|
|
951
745
|
onPressOut: attachPress ? function (e) {
|
|
952
746
|
unPress();
|
|
953
|
-
onPressOut === null || onPressOut === void 0
|
|
954
|
-
onMouseUp === null || onMouseUp === void 0
|
|
747
|
+
onPressOut === null || onPressOut === void 0 || onPressOut(e);
|
|
748
|
+
onMouseUp === null || onMouseUp === void 0 || onMouseUp(e);
|
|
955
749
|
} : void 0,
|
|
956
750
|
...((attachHover || attachPress) && {
|
|
957
751
|
onMouseEnter: function (e) {
|
|
958
752
|
var next = {};
|
|
959
|
-
if (needsHoverState && !lastInteractionWasTouch.value)
|
|
960
|
-
next.hover = true;
|
|
961
|
-
}
|
|
753
|
+
if (needsHoverState && !lastInteractionWasTouch.value) next.hover = true;
|
|
962
754
|
if (needsPressState) {
|
|
963
|
-
if (state.pressIn)
|
|
964
|
-
next.press = true;
|
|
965
|
-
}
|
|
755
|
+
if (state.pressIn) next.press = true;
|
|
966
756
|
}
|
|
967
757
|
setStateShallow(next);
|
|
968
|
-
onHoverIn === null || onHoverIn === void 0
|
|
969
|
-
onMouseEnter === null || onMouseEnter === void 0
|
|
758
|
+
onHoverIn === null || onHoverIn === void 0 || onHoverIn(e);
|
|
759
|
+
onMouseEnter === null || onMouseEnter === void 0 || onMouseEnter(e);
|
|
970
760
|
},
|
|
971
761
|
onMouseLeave: function (e) {
|
|
972
762
|
var next = {};
|
|
973
|
-
if (needsHoverState)
|
|
974
|
-
next.hover = false;
|
|
975
|
-
}
|
|
763
|
+
if (needsHoverState) next.hover = false;
|
|
976
764
|
if (needsPressState) {
|
|
977
765
|
next.press = false;
|
|
978
766
|
next.pressIn = false;
|
|
979
767
|
}
|
|
980
768
|
setStateShallow(next);
|
|
981
|
-
onHoverOut === null || onHoverOut === void 0
|
|
982
|
-
onMouseLeave === null || onMouseLeave === void 0
|
|
769
|
+
onHoverOut === null || onHoverOut === void 0 || onHoverOut(e);
|
|
770
|
+
onMouseLeave === null || onMouseLeave === void 0 || onMouseLeave(e);
|
|
983
771
|
}
|
|
984
772
|
}),
|
|
985
773
|
onPressIn: attachPress ? function (e) {
|
|
986
|
-
if (needsPressState) {
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
onMouseDown === null || onMouseDown === void 0 ? void 0 : onMouseDown(e);
|
|
994
|
-
if (import_constants.isWeb) {
|
|
995
|
-
componentSetStates.add(setState);
|
|
996
|
-
}
|
|
774
|
+
if (needsPressState) setStateShallow({
|
|
775
|
+
press: true,
|
|
776
|
+
pressIn: true
|
|
777
|
+
});
|
|
778
|
+
onPressIn === null || onPressIn === void 0 || onPressIn(e);
|
|
779
|
+
onMouseDown === null || onMouseDown === void 0 || onMouseDown(e);
|
|
780
|
+
if (import_constants.isWeb) componentSetStates.add(setState);
|
|
997
781
|
} : void 0,
|
|
998
782
|
onPress: attachPress ? function (e) {
|
|
999
783
|
unPress();
|
|
1000
|
-
|
|
1001
|
-
onClick === null || onClick === void 0 ? void 0 : onClick(e);
|
|
1002
|
-
if (onPress || onClick) {
|
|
1003
|
-
e.stopPropagation();
|
|
1004
|
-
}
|
|
1005
|
-
}
|
|
1006
|
-
onPress === null || onPress === void 0 ? void 0 : onPress(e);
|
|
1007
|
-
if (false) {
|
|
1008
|
-
onLongPress === null || onLongPress === void 0 ? void 0 : onLongPress(e);
|
|
1009
|
-
}
|
|
784
|
+
onPress === null || onPress === void 0 || onPress(e);
|
|
1010
785
|
} : void 0,
|
|
1011
786
|
...(attachPress && onLongPress && {
|
|
1012
787
|
onLongPress: function (e) {
|
|
1013
788
|
unPress();
|
|
1014
|
-
onLongPress === null || onLongPress === void 0
|
|
789
|
+
onLongPress === null || onLongPress === void 0 || onLongPress(e);
|
|
1015
790
|
}
|
|
1016
791
|
}),
|
|
1017
792
|
...(attachFocus && {
|
|
@@ -1024,29 +799,21 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
1024
799
|
next.focusWithin = true;
|
|
1025
800
|
}
|
|
1026
801
|
if (pseudos === null || pseudos === void 0 ? void 0 : pseudos.focusVisibleStyle) {
|
|
1027
|
-
if (lastInteractionWasKeyboard.value)
|
|
1028
|
-
|
|
1029
|
-
} else {
|
|
1030
|
-
next.focus = true;
|
|
1031
|
-
}
|
|
1032
|
-
} else {
|
|
1033
|
-
next.focus = true;
|
|
1034
|
-
}
|
|
802
|
+
if (lastInteractionWasKeyboard.value) next.focusVisible = true;else next.focus = true;
|
|
803
|
+
} else next.focus = true;
|
|
1035
804
|
setStateShallow(next);
|
|
1036
|
-
onFocus === null || onFocus === void 0
|
|
805
|
+
onFocus === null || onFocus === void 0 || onFocus(e);
|
|
1037
806
|
},
|
|
1038
807
|
onBlur: function (e) {
|
|
1039
|
-
if (componentContext.setParentFocusState) {
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
});
|
|
1043
|
-
}
|
|
808
|
+
if (componentContext.setParentFocusState) componentContext.setParentFocusState({
|
|
809
|
+
focusWithin: false
|
|
810
|
+
});
|
|
1044
811
|
setStateShallow({
|
|
1045
812
|
focus: false,
|
|
1046
813
|
focusVisible: false,
|
|
1047
814
|
focusWithin: false
|
|
1048
815
|
});
|
|
1049
|
-
onBlur === null || onBlur === void 0
|
|
816
|
+
onBlur === null || onBlur === void 0 || onBlur(e);
|
|
1050
817
|
}
|
|
1051
818
|
})
|
|
1052
819
|
} : null;
|
|
@@ -1063,58 +830,33 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
1063
830
|
minPressDuration: 0
|
|
1064
831
|
});
|
|
1065
832
|
}
|
|
1066
|
-
if (false) {
|
|
1067
|
-
Object.assign(viewProps, (0, import_eventHandling.getWebEvents)(events));
|
|
1068
|
-
}
|
|
1069
833
|
if (process.env.NODE_ENV === "development" && time) time`events`;
|
|
1070
|
-
if (process.env.NODE_ENV === "development" && debugProp === "verbose") {
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
});
|
|
1076
|
-
}
|
|
834
|
+
if (process.env.NODE_ENV === "development" && debugProp === "verbose") (0, import_log.log)(`events`, {
|
|
835
|
+
events,
|
|
836
|
+
attachHover,
|
|
837
|
+
attachPress
|
|
838
|
+
});
|
|
1077
839
|
var propsWithHref = props;
|
|
1078
840
|
var propsInWithHref = propsIn;
|
|
1079
841
|
var _props_testID, _ref, _ref1, _ref2, _ref3;
|
|
1080
|
-
var
|
|
1081
|
-
var
|
|
1082
|
-
var pressGesture = true ? (0, import_eventHandling.useEvents)(events, viewProps, stateRef, staticConfig, isHOC, isInsideNativeMenu, pressDebugName) : null;
|
|
842
|
+
var pressDebugName = [componentName, (_ref3 = (_ref2 = (_ref1 = (_ref = (_props_testID = props.testID) !== null && _props_testID !== void 0 ? _props_testID : propsIn.testID) !== null && _ref !== void 0 ? _ref : props.accessibilityLabel) !== null && _ref1 !== void 0 ? _ref1 : propsIn.accessibilityLabel) !== null && _ref2 !== void 0 ? _ref2 : typeof propsWithHref.href === "string" ? propsWithHref.href : null) !== null && _ref3 !== void 0 ? _ref3 : typeof propsInWithHref.href === "string" ? propsInWithHref.href : null].filter(Boolean).join(":") || null;
|
|
843
|
+
var pressGesture = (0, import_eventHandling.useEvents)(events, viewProps, stateRef, staticConfig, isHOC, isInsideNativeMenu, pressDebugName);
|
|
1083
844
|
if (process.env.NODE_ENV === "development" && time) time`hooks`;
|
|
1084
845
|
if (asChild) {
|
|
1085
846
|
elementType = import_Slot.Slot;
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
onLongPress,
|
|
1091
|
-
onPressIn,
|
|
1092
|
-
onPressOut,
|
|
1093
|
-
onMouseUp,
|
|
1094
|
-
onMouseDown,
|
|
1095
|
-
onMouseEnter,
|
|
1096
|
-
onMouseLeave
|
|
1097
|
-
}, webStyleEvents);
|
|
1098
|
-
Object.assign(viewProps, passEvents);
|
|
1099
|
-
} else {
|
|
1100
|
-
Object.assign(viewProps, {
|
|
1101
|
-
onPress,
|
|
1102
|
-
onLongPress
|
|
1103
|
-
});
|
|
1104
|
-
}
|
|
847
|
+
Object.assign(viewProps, {
|
|
848
|
+
onPress,
|
|
849
|
+
onLongPress
|
|
850
|
+
});
|
|
1105
851
|
}
|
|
1106
852
|
if (process.env.NODE_ENV === "development" && time) time`spaced-as-child`;
|
|
1107
853
|
var content;
|
|
1108
|
-
if (isPassthrough) {
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
display: "contents"
|
|
1112
|
-
}
|
|
1113
|
-
}, propsIn.children);
|
|
1114
|
-
} else {
|
|
1115
|
-
if (import_setupHooks.hooks.useChildren) {
|
|
1116
|
-
content = import_setupHooks.hooks.useChildren(elementType, content || children, viewProps);
|
|
854
|
+
if (isPassthrough) content = /* @__PURE__ */import_react.default.createElement(BaseComponent, {
|
|
855
|
+
style: {
|
|
856
|
+
display: "contents"
|
|
1117
857
|
}
|
|
858
|
+
}, propsIn.children);else {
|
|
859
|
+
if (import_setupHooks.hooks.useChildren) content = import_setupHooks.hooks.useChildren(elementType, content || children, viewProps);
|
|
1118
860
|
var isRenderPropString = typeof renderProp === "string";
|
|
1119
861
|
if (renderProp && !isRenderPropString) {
|
|
1120
862
|
var out = getCustomRender(renderProp, content || children, viewProps, componentState);
|
|
@@ -1124,76 +866,39 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
1124
866
|
}
|
|
1125
867
|
}
|
|
1126
868
|
if (!content) {
|
|
1127
|
-
if (isRenderPropString)
|
|
1128
|
-
viewProps.render === renderProp;
|
|
1129
|
-
}
|
|
869
|
+
if (isRenderPropString) viewProps.render;
|
|
1130
870
|
content = /* @__PURE__ */import_react.default.createElement(elementType, viewProps, content || children);
|
|
1131
871
|
}
|
|
1132
872
|
if (process.env.NODE_ENV === "development" && time) time`use-children`;
|
|
1133
873
|
}
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
content = (0, import_eventHandling.wrapWithGestureDetector)(content, pressGesture, stateRef, isHOC, isCompositeComponent);
|
|
1137
|
-
}
|
|
874
|
+
var isCompositeComponent = !isHOC && Component && typeof Component !== "string";
|
|
875
|
+
content = (0, import_eventHandling.wrapWithGestureDetector)(content, pressGesture, stateRef, isHOC, isCompositeComponent);
|
|
1138
876
|
var ResetPresence = animationDriver === null || animationDriver === void 0 ? void 0 : animationDriver.ResetPresence;
|
|
1139
877
|
var needsReset = Boolean(
|
|
1140
878
|
// not when passing down to child
|
|
1141
|
-
!asChild &&
|
|
1142
|
-
// not when passThrough
|
|
1143
|
-
splitStyles &&
|
|
1144
|
-
// not when HOC
|
|
1145
|
-
!isHOC && ResetPresence && willBeAnimated && (hasEnterStyle || presenceState));
|
|
879
|
+
!asChild && splitStyles && !isHOC && ResetPresence && willBeAnimated && (hasEnterStyle || presenceState));
|
|
1146
880
|
var hasEverReset = stateRef.current.hasEverResetPresence;
|
|
1147
|
-
if (needsReset && !hasEverReset)
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
content = /* @__PURE__ */(0, import_jsx_runtime.jsx)(ResetPresence, {
|
|
1153
|
-
disabled: !needsReset,
|
|
1154
|
-
children: content
|
|
1155
|
-
});
|
|
1156
|
-
}
|
|
881
|
+
if (needsReset && !hasEverReset) stateRef.current.hasEverResetPresence = true;
|
|
882
|
+
if ((needsReset || hasEverReset) && ResetPresence) content = /* @__PURE__ */(0, import_jsx_runtime.jsx)(ResetPresence, {
|
|
883
|
+
disabled: !needsReset,
|
|
884
|
+
children: content
|
|
885
|
+
});
|
|
1157
886
|
if (process.env.NODE_ENV === "development" && time) time`create-element`;
|
|
1158
|
-
if ("focusWithinStyle" in propsIn || (pseudos === null || pseudos === void 0 ? void 0 : pseudos.focusWithinStyle)) {
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
value: allGroupContexts,
|
|
1168
|
-
children: content
|
|
1169
|
-
});
|
|
1170
|
-
}
|
|
1171
|
-
if (false) {
|
|
1172
|
-
content = /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_ComponentContext.ComponentContext.Provider, {
|
|
1173
|
-
...componentContext,
|
|
1174
|
-
inText: true,
|
|
1175
|
-
children: content
|
|
1176
|
-
});
|
|
1177
|
-
}
|
|
887
|
+
if ("focusWithinStyle" in propsIn || (pseudos === null || pseudos === void 0 ? void 0 : pseudos.focusWithinStyle)) content = /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_ComponentContext.ComponentContext.Provider, {
|
|
888
|
+
...componentContext,
|
|
889
|
+
setParentFocusState: setStateShallow,
|
|
890
|
+
children: content
|
|
891
|
+
});
|
|
892
|
+
if ("group" in props) content = /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_GroupContext.GroupContext.Provider, {
|
|
893
|
+
value: allGroupContexts,
|
|
894
|
+
children: content
|
|
895
|
+
});
|
|
1178
896
|
if (process.env.NODE_ENV === "development" && time) time`group-context`;
|
|
1179
897
|
content = disableTheme || !splitStyles ? content : (0, import_Theme.getThemedChildren)(themeState, content, themeStateProps, false, stateRef);
|
|
1180
898
|
if (process.env.NODE_ENV === "development" && time) time`themed-children`;
|
|
1181
|
-
if (false) {
|
|
1182
|
-
if (isReactNative && !asChild) {
|
|
1183
|
-
content = /* @__PURE__ */(0, import_jsx_runtime.jsx)("span", {
|
|
1184
|
-
className: "_dsp_contents",
|
|
1185
|
-
...(!isPassthrough && isHydrated && events && (0, import_eventHandling.getWebEvents)(events)),
|
|
1186
|
-
children: content
|
|
1187
|
-
});
|
|
1188
|
-
}
|
|
1189
|
-
}
|
|
1190
899
|
if (overriddenContextProps && contextForOverride) {
|
|
1191
900
|
var Provider = contextForOverride.Provider;
|
|
1192
|
-
for (var key1 in styledContextValue)
|
|
1193
|
-
if (!(key1 in overriddenContextProps)) {
|
|
1194
|
-
overriddenContextProps[key1] = styledContextValue[key1];
|
|
1195
|
-
}
|
|
1196
|
-
}
|
|
901
|
+
for (var key1 in styledContextValue) if (!(key1 in overriddenContextProps)) overriddenContextProps[key1] = styledContextValue[key1];
|
|
1197
902
|
content = /* @__PURE__ */(0, import_jsx_runtime.jsx)(Provider, {
|
|
1198
903
|
__disableMergeDefaultValues: true,
|
|
1199
904
|
...overriddenContextProps,
|
|
@@ -1201,62 +906,49 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
1201
906
|
});
|
|
1202
907
|
}
|
|
1203
908
|
if (process.env.NODE_ENV === "development" && time) time`context-override`;
|
|
1204
|
-
if (false) {
|
|
1205
|
-
content = /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
|
|
1206
|
-
children: [content, /* we surpress hydration warnings */
|
|
1207
|
-
!isHydrated ? (0, import_wrapStyleTags.getStyleTags)(Object.values(splitStyles.rulesToInsert)) : null]
|
|
1208
|
-
});
|
|
1209
|
-
}
|
|
1210
909
|
if (process.env.NODE_ENV === "development" && time) time`style-tags`;
|
|
1211
910
|
if (process.env.NODE_ENV === "development") {
|
|
1212
911
|
if (debugProp && debugProp !== "profile") {
|
|
1213
|
-
var
|
|
1214
|
-
var title = `render <${element1} /> (${internalID}) with props`;
|
|
912
|
+
var title = `render <${typeof elementType === "string" ? elementType : "Component"} /> (${internalID}) with props`;
|
|
1215
913
|
if (!import_constants.isWeb || !import_constants.isClient) {
|
|
1216
914
|
(0, import_log.log)(title);
|
|
1217
915
|
(0, import_log.log)(`state: `, state);
|
|
1218
|
-
if (import_isDevTools.isDevTools)
|
|
1219
|
-
(0, import_log.log)("viewProps", viewProps);
|
|
1220
|
-
}
|
|
916
|
+
if (import_isDevTools.isDevTools) (0, import_log.log)("viewProps", viewProps);
|
|
1221
917
|
(0, import_log.log)(`final styles:`);
|
|
1222
|
-
for (var key2 in splitStylesStyle)
|
|
1223
|
-
(0, import_log.log)(key2, splitStylesStyle[key2]);
|
|
1224
|
-
}
|
|
918
|
+
for (var key2 in splitStylesStyle) (0, import_log.log)(key2, splitStylesStyle[key2]);
|
|
1225
919
|
} else {
|
|
1226
920
|
console.groupCollapsed(title);
|
|
1227
921
|
try {
|
|
1228
922
|
(0, import_log.log)("viewProps", viewProps);
|
|
1229
923
|
(0, import_log.log)("children", content);
|
|
1230
|
-
if (typeof window !== "undefined") {
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
});
|
|
1259
|
-
}
|
|
924
|
+
if (typeof window !== "undefined") (0, import_log.log)({
|
|
925
|
+
propsIn,
|
|
926
|
+
props,
|
|
927
|
+
attachPress,
|
|
928
|
+
animationStyles,
|
|
929
|
+
classNames,
|
|
930
|
+
content,
|
|
931
|
+
elementType,
|
|
932
|
+
events,
|
|
933
|
+
isAnimated,
|
|
934
|
+
hasRuntimeMediaKeys,
|
|
935
|
+
isStringElement,
|
|
936
|
+
mediaListeningKeys,
|
|
937
|
+
pseudos,
|
|
938
|
+
shouldAttach,
|
|
939
|
+
noClass,
|
|
940
|
+
shouldListenForMedia,
|
|
941
|
+
splitStyles,
|
|
942
|
+
splitStylesStyle,
|
|
943
|
+
state,
|
|
944
|
+
stateRef,
|
|
945
|
+
staticConfig,
|
|
946
|
+
styleProps,
|
|
947
|
+
themeState,
|
|
948
|
+
viewProps,
|
|
949
|
+
willBeAnimated,
|
|
950
|
+
startedUnhydrated
|
|
951
|
+
});
|
|
1260
952
|
} catch (e) {} finally {
|
|
1261
953
|
console.groupEnd();
|
|
1262
954
|
}
|
|
@@ -1278,9 +970,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
1278
970
|
return content;
|
|
1279
971
|
});
|
|
1280
972
|
function notifyGroupSubscribers(groupContext, groupEmitter, pseudo) {
|
|
1281
|
-
if (!groupContext || !groupEmitter)
|
|
1282
|
-
return;
|
|
1283
|
-
}
|
|
973
|
+
if (!groupContext || !groupEmitter) return;
|
|
1284
974
|
var nextState = {
|
|
1285
975
|
...groupContext.state,
|
|
1286
976
|
pseudo
|
|
@@ -1288,9 +978,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
1288
978
|
groupEmitter.emit(nextState);
|
|
1289
979
|
groupContext.state = nextState;
|
|
1290
980
|
}
|
|
1291
|
-
if (staticConfig.componentName)
|
|
1292
|
-
component.displayName = staticConfig.componentName;
|
|
1293
|
-
}
|
|
981
|
+
if (staticConfig.componentName) component.displayName = staticConfig.componentName;
|
|
1294
982
|
var res = component;
|
|
1295
983
|
res = /* @__PURE__ */import_react.default.memo(res);
|
|
1296
984
|
res.staticConfig = staticConfig;
|
|
@@ -1304,13 +992,10 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
1304
992
|
};
|
|
1305
993
|
}
|
|
1306
994
|
function styleable(Component2, options) {
|
|
1307
|
-
var
|
|
1308
|
-
var out = skipForwardRef ? Component2 : /* @__PURE__ */import_react.default.forwardRef(Component2);
|
|
995
|
+
var out = typeof Component2 === "function" && Component2.length === 1 ? Component2 : /* @__PURE__ */import_react.default.forwardRef(Component2);
|
|
1309
996
|
var extendedConfig = extendStyledConfig(options === null || options === void 0 ? void 0 : options.staticConfig);
|
|
1310
997
|
out = (options === null || options === void 0 ? void 0 : options.disableTheme) ? out : (0, import_themeable.themeable)(out, extendedConfig, true);
|
|
1311
|
-
if (extendedConfig.memo || process.env.
|
|
1312
|
-
out = /* @__PURE__ */import_react.default.memo(out);
|
|
1313
|
-
}
|
|
998
|
+
if (extendedConfig.memo || process.env.GUI_MEMOIZE_STYLEABLE) out = /* @__PURE__ */import_react.default.memo(out);
|
|
1314
999
|
out.staticConfig = extendedConfig;
|
|
1315
1000
|
out.styleable = styleable;
|
|
1316
1001
|
return out;
|
|
@@ -1324,14 +1009,10 @@ var fromPx = function (val) {
|
|
|
1324
1009
|
return 0;
|
|
1325
1010
|
};
|
|
1326
1011
|
var getCustomRender = function (renderProp, content, viewProps, state) {
|
|
1327
|
-
if (typeof renderProp === "function")
|
|
1328
|
-
var out = renderProp(viewProps, state);
|
|
1329
|
-
renderProp = getRenderElementForPlatform(out);
|
|
1330
|
-
}
|
|
1012
|
+
if (typeof renderProp === "function") renderProp = getRenderElementForPlatform(renderProp(viewProps, state));
|
|
1331
1013
|
if (renderProp) {
|
|
1332
1014
|
if ((typeof renderProp === "undefined" ? "undefined" : _type_of(renderProp)) === "object" && /* @__PURE__ */import_react.default.isValidElement(renderProp)) {
|
|
1333
|
-
|
|
1334
|
-
if (renderElement) {
|
|
1015
|
+
if (getRenderElementForPlatform(renderProp)) {
|
|
1335
1016
|
var elementProps = renderProp.props;
|
|
1336
1017
|
var mergedProps = elementProps ? (0, import_mergeRenderElementProps.mergeRenderElementProps)(elementProps, viewProps, content) : viewProps;
|
|
1337
1018
|
return {
|
|
@@ -1343,11 +1024,7 @@ var getCustomRender = function (renderProp, content, viewProps, state) {
|
|
|
1343
1024
|
}
|
|
1344
1025
|
};
|
|
1345
1026
|
function getRenderElementForPlatform(potential) {
|
|
1346
|
-
if (
|
|
1347
|
-
if (isHTMLElement(potential)) {
|
|
1348
|
-
return;
|
|
1349
|
-
}
|
|
1350
|
-
}
|
|
1027
|
+
if (isHTMLElement(potential)) return;
|
|
1351
1028
|
return potential;
|
|
1352
1029
|
}
|
|
1353
1030
|
function isHTMLElement(el) {
|