@tamagui/web 3.0.3 → 3.0.4

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 (36) hide show
  1. package/dist/cjs/_withNativeStyle.cjs +85 -46
  2. package/dist/cjs/_withNativeStyle.native.cjs +91 -41
  3. package/dist/cjs/_withNativeStyle.native.js +91 -41
  4. package/dist/cjs/_withNativeStyle.native.js.map +1 -1
  5. package/dist/cjs/helpers/nativeStyleEngine.cjs +140 -69
  6. package/dist/cjs/helpers/nativeStyleEngine.native.cjs +177 -118
  7. package/dist/cjs/helpers/nativeStyleEngine.native.js +177 -118
  8. package/dist/cjs/helpers/nativeStyleEngine.native.js.map +1 -1
  9. package/dist/cjs/index.cjs +1 -0
  10. package/dist/cjs/index.native.cjs +1 -0
  11. package/dist/cjs/index.native.js +1 -0
  12. package/dist/cjs/index.native.js.map +1 -1
  13. package/dist/esm/_withNativeStyle.mjs +85 -40
  14. package/dist/esm/_withNativeStyle.mjs.map +1 -1
  15. package/dist/esm/_withNativeStyle.native.js +92 -42
  16. package/dist/esm/_withNativeStyle.native.js.map +1 -1
  17. package/dist/esm/helpers/nativeStyleEngine.mjs +141 -71
  18. package/dist/esm/helpers/nativeStyleEngine.mjs.map +1 -1
  19. package/dist/esm/helpers/nativeStyleEngine.native.js +177 -119
  20. package/dist/esm/helpers/nativeStyleEngine.native.js.map +1 -1
  21. package/dist/esm/index.js +2 -2
  22. package/dist/esm/index.mjs +2 -2
  23. package/dist/esm/index.native.js +2 -2
  24. package/package.json +17 -17
  25. package/src/_withNativeStyle.tsx +141 -55
  26. package/src/helpers/nativeStyleEngine.ts +230 -101
  27. package/src/index.ts +1 -0
  28. package/src/setupHooks.ts +1 -0
  29. package/types/_withNativeStyle.d.ts +22 -2
  30. package/types/_withNativeStyle.d.ts.map +1 -1
  31. package/types/helpers/nativeStyleEngine.d.ts +24 -9
  32. package/types/helpers/nativeStyleEngine.d.ts.map +1 -1
  33. package/types/index.d.ts +1 -1
  34. package/types/index.d.ts.map +1 -1
  35. package/types/setupHooks.d.ts +1 -0
  36. package/types/setupHooks.d.ts.map +1 -1
@@ -1,8 +1,6 @@
1
- var __create = Object.create;
2
1
  var __defProp = Object.defineProperty;
3
2
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
5
  var __export = (target, all) => {
8
6
  for (var name in all) __defProp(target, name, {
@@ -19,21 +17,24 @@ var __copyProps = (to, from, except, desc) => {
19
17
  }
20
18
  return to;
21
19
  };
22
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
23
- value: mod,
24
- enumerable: true
25
- }) : target, mod));
26
20
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
27
21
  var withNativeStyle_exports = {};
28
22
  __export(withNativeStyle_exports, { _withNativeStyle: () => _withNativeStyle });
29
23
  module.exports = __toCommonJS(withNativeStyle_exports);
30
24
  var import_compose_refs = require("@tamagui/compose-refs");
31
- var import_react = __toESM(require("react"), 1);
25
+ var import_constants = require("@tamagui/constants");
26
+ var import_react = require("react");
32
27
  var import_withStableStyle = require("./_withStableStyle.cjs");
33
28
  var import_nativeStyleEngine = require("./helpers/nativeStyleEngine.cjs");
34
29
  var import_useThemeState = require("./hooks/useThemeState.cjs");
30
+ var import_setupHooks = require("./setupHooks.cjs");
35
31
  var import_jsx_runtime = require("react/jsx-runtime");
36
- const _withNativeStyle = (Component, baseStyle, themeStyleKeys) => {
32
+ const hostTextProps = {
33
+ accessible: import_constants.isAndroid ? false : import_constants.isIos ? true : void 0,
34
+ allowFontScaling: true,
35
+ ellipsizeMode: "tail"
36
+ };
37
+ const _withNativeStyle = (Component, baseStyle, themeStyleKeys, host) => {
37
38
  const Fallback = (0, import_withStableStyle._withStableStyle)(Component, (theme) => {
38
39
  const themedStyle = {};
39
40
  for (const styleKey in themeStyleKeys) {
@@ -41,43 +42,81 @@ const _withNativeStyle = (Component, baseStyle, themeStyleKeys) => {
41
42
  }
42
43
  return [baseStyle, themedStyle];
43
44
  }, true, false);
44
- const Native = import_react.default.memo(function NativeStyleView({ _scopeId, ...props }) {
45
- const { ref, _expressions: _ignoredExpressions, ...rest } = props;
46
- const link = (0, import_react.useRef)(null);
47
- const [refused, setRefused] = (0, import_react.useState)(false);
48
- const themeState = (0, import_useThemeState.getThemeState)(_scopeId);
49
- const stateName = themeState?.name;
50
- const theme = themeState?.theme;
51
- const hostRef = (0, import_react.useCallback)((host) => {
52
- link.current?.unlink();
53
- link.current = null;
54
- (0, import_compose_refs.setRef)(ref, host);
55
- if (host && stateName && theme) {
56
- link.current = (0, import_nativeStyleEngine.linkNativeStyleMapping)(host, baseStyle, themeStyleKeys, _scopeId, stateName, theme);
57
- if (!link.current) setRefused(true);
58
- }
59
- }, [
60
- ref,
61
- _scopeId,
62
- stateName,
63
- theme
64
- ]);
65
- if (refused) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Fallback, { ...props });
66
- const stateStyle = stateName && theme ? (0, import_nativeStyleEngine.resolveNativeStyleMapping)(themeStyleKeys, stateName, theme) : void 0;
67
- if (process.env.NODE_ENV === "development" && (!stateName || !theme)) {
68
- throw new Error(`[@tamagui/core] native fast path cannot resolve theme ${JSON.stringify(stateName)}`);
45
+ const baseViews = host ? import_setupHooks.hooks.getBaseViews?.() : void 0;
46
+ const TextAncestor = baseViews?.TextAncestor;
47
+ const TextAncestorProvider = TextAncestor?.Provider;
48
+ const HostText = host === "text" && !("userSelect" in baseStyle) && !("verticalAlign" in baseStyle) ? baseViews?.NativeText : void 0;
49
+ const hostTextBase = HostText ? {
50
+ overflow: "hidden",
51
+ ...baseStyle,
52
+ ...typeof baseStyle.fontWeight === "number" && { fontWeight: String(baseStyle.fontWeight) }
53
+ } : baseStyle;
54
+ const styles = /* @__PURE__ */ new Map();
55
+ const hostTextStyles = /* @__PURE__ */ new Map();
56
+ const ScopeContext = import_useThemeState.ThemeStateContext;
57
+ const engineOf = import_nativeStyleEngine.getNativeStyleEngine;
58
+ const scopeState = import_useThemeState.getThemeState;
59
+ const resolve = import_nativeStyleEngine.resolveNativeStyleMapping;
60
+ const linkMapping = import_nativeStyleEngine.linkNativeStyleMapping;
61
+ const assignRef = import_compose_refs.setRef;
62
+ const render = (props, key) => {
63
+ const scopeId = (0, import_react.use)(ScopeContext);
64
+ const inText = TextAncestor ? (0, import_react.use)(TextAncestor) : false;
65
+ const themeState = scopeId && engineOf() ? scopeState(scopeId) : void 0;
66
+ const resetsText = inText && host === "view";
67
+ if (!themeState) {
68
+ return resetsText ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TextAncestorProvider, {
69
+ value: false,
70
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Fallback, { ...props })
71
+ }, key) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Fallback, { ...props }, key);
69
72
  }
70
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, {
71
- ref: hostRef,
72
- style: [baseStyle, stateStyle],
73
- ...rest
74
- });
75
- });
76
- return import_react.default.memo(function NativeStyleBoundary(props) {
77
- const scopeId = (0, import_react.useContext)(import_useThemeState.ThemeStateContext);
78
- return (0, import_nativeStyleEngine.getNativeStyleEngine)() && scopeId ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Native, {
79
- ...props,
80
- _scopeId: scopeId
81
- }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Fallback, { ...props });
82
- });
73
+ let rest = props;
74
+ if (props._expressions !== void 0) {
75
+ const { _expressions: _ignoredExpressions, ...withoutExpressions } = props;
76
+ rest = withoutExpressions;
77
+ }
78
+ const ref = props.ref;
79
+ const { name, theme } = themeState;
80
+ const asHostText = HostText && !inText;
81
+ const Rendered = asHostText ? HostText : Component;
82
+ const cache = asHostText ? hostTextStyles : styles;
83
+ let style = cache.get(scopeId);
84
+ if (!style) {
85
+ style = [asHostText ? hostTextBase : baseStyle, null];
86
+ cache.set(scopeId, style);
87
+ }
88
+ style[1] = resolve(themeStyleKeys, name, theme);
89
+ const wrapped = resetsText || asHostText && mayRenderText(rest.children);
90
+ const element = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Rendered, {
91
+ ...asHostText && hostTextProps,
92
+ ...rest,
93
+ ref: (node) => {
94
+ let refCleanup;
95
+ if (typeof ref === "function") refCleanup = ref(node);
96
+ else assignRef(ref, node);
97
+ const link = linkMapping(node, themeStyleKeys, scopeId, name, theme);
98
+ return () => {
99
+ link?.unlink();
100
+ if (typeof refCleanup === "function") refCleanup();
101
+ else assignRef(ref, null);
102
+ };
103
+ },
104
+ style
105
+ }, wrapped ? void 0 : key);
106
+ if (!wrapped) return element;
107
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TextAncestorProvider, {
108
+ value: !resetsText,
109
+ children: element
110
+ }, key);
111
+ };
112
+ const NativeStyleView = (props) => render(props);
113
+ NativeStyleView.inline = (element) => render(element.props, element.key);
114
+ return NativeStyleView;
83
115
  };
116
+ function mayRenderText(children) {
117
+ if (children == null) return false;
118
+ if (Array.isArray(children) && children.length <= 3) {
119
+ return children.some((child) => child != null && typeof child === "object");
120
+ }
121
+ return typeof children === "object";
122
+ }
@@ -31,11 +31,19 @@ __export(withNativeStyle_exports, { _withNativeStyle: () => _withNativeStyle });
31
31
  module.exports = __toCommonJS(withNativeStyle_exports);
32
32
  var import_jsx_runtime = require("react/jsx-runtime");
33
33
  var import_compose_refs = require("@tamagui/compose-refs");
34
+ var import_constants = require("@tamagui/constants");
34
35
  var import_react = __toESM(require("react"), 1);
35
36
  var import_withStableStyle = require("./_withStableStyle.native.js");
36
37
  var import_nativeStyleEngine = require("./helpers/nativeStyleEngine.native.js");
37
38
  var import_useThemeState = require("./hooks/useThemeState.native.js");
38
- var _withNativeStyle = function(Component, baseStyle, themeStyleKeys) {
39
+ var import_setupHooks = require("./setupHooks.native.js");
40
+ var hostTextProps = {
41
+ accessible: import_constants.isAndroid ? false : import_constants.isIos ? true : void 0,
42
+ allowFontScaling: true,
43
+ ellipsizeMode: "tail"
44
+ };
45
+ var _withNativeStyle = function(Component, baseStyle, themeStyleKeys, host) {
46
+ var _hooks_getBaseViews;
39
47
  var Fallback = (0, import_withStableStyle._withStableStyle)(Component, function(theme) {
40
48
  var themedStyle = {};
41
49
  for (var styleKey in themeStyleKeys) {
@@ -44,45 +52,87 @@ var _withNativeStyle = function(Component, baseStyle, themeStyleKeys) {
44
52
  }
45
53
  return [baseStyle, themedStyle];
46
54
  }, true, false);
47
- var Native = /* @__PURE__ */ import_react.default.memo(function NativeStyleView(param) {
48
- var { _scopeId, ...props } = param;
49
- var { ref, _expressions: _ignoredExpressions, ...rest } = props;
50
- var link = (0, import_react.useRef)(null);
51
- var [refused, setRefused] = (0, import_react.useState)(false);
52
- var themeState = (0, import_useThemeState.getThemeState)(_scopeId);
53
- var stateName = themeState === null || themeState === void 0 ? void 0 : themeState.name;
54
- var theme = themeState === null || themeState === void 0 ? void 0 : themeState.theme;
55
- var hostRef = (0, import_react.useCallback)(function(host) {
56
- var _link_current;
57
- (_link_current = link.current) === null || _link_current === void 0 ? void 0 : _link_current.unlink();
58
- link.current = null;
59
- (0, import_compose_refs.setRef)(ref, host);
60
- if (host && stateName && theme) {
61
- link.current = (0, import_nativeStyleEngine.linkNativeStyleMapping)(host, baseStyle, themeStyleKeys, _scopeId, stateName, theme);
62
- if (!link.current) setRefused(true);
63
- }
64
- }, [
65
- ref,
66
- _scopeId,
67
- stateName,
68
- theme
69
- ]);
70
- if (refused) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Fallback, { ...props });
71
- var stateStyle = stateName && theme ? (0, import_nativeStyleEngine.resolveNativeStyleMapping)(themeStyleKeys, stateName, theme) : void 0;
72
- if (process.env.NODE_ENV === "development" && (!stateName || !theme)) {
73
- throw new Error(`[@tamagui/core] native fast path cannot resolve theme ${JSON.stringify(stateName)}`);
55
+ var baseViews = host ? (_hooks_getBaseViews = import_setupHooks.hooks.getBaseViews) === null || _hooks_getBaseViews === void 0 ? void 0 : _hooks_getBaseViews.call(import_setupHooks.hooks) : void 0;
56
+ var TextAncestor = baseViews === null || baseViews === void 0 ? void 0 : baseViews.TextAncestor;
57
+ var TextAncestorProvider = TextAncestor === null || TextAncestor === void 0 ? void 0 : TextAncestor.Provider;
58
+ var HostText = host === "text" && !("userSelect" in baseStyle) && !("verticalAlign" in baseStyle) ? baseViews === null || baseViews === void 0 ? void 0 : baseViews.NativeText : void 0;
59
+ var hostTextBase = HostText ? {
60
+ overflow: "hidden",
61
+ ...baseStyle,
62
+ ...typeof baseStyle.fontWeight === "number" && { fontWeight: String(baseStyle.fontWeight) }
63
+ } : baseStyle;
64
+ var styles = /* @__PURE__ */ new Map();
65
+ var hostTextStyles = /* @__PURE__ */ new Map();
66
+ var ScopeContext = import_useThemeState.ThemeStateContext;
67
+ var engineOf = import_nativeStyleEngine.getNativeStyleEngine;
68
+ var scopeState = import_useThemeState.getThemeState;
69
+ var resolve = import_nativeStyleEngine.resolveNativeStyleMapping;
70
+ var linkMapping = import_nativeStyleEngine.linkNativeStyleMapping;
71
+ var assignRef = import_compose_refs.setRef;
72
+ var render = function(props, key) {
73
+ var scopeId = (0, import_react.use)(ScopeContext);
74
+ var inText = TextAncestor ? (0, import_react.use)(TextAncestor) : false;
75
+ var themeState = scopeId && engineOf() ? scopeState(scopeId) : void 0;
76
+ var resetsText = inText && host === "view";
77
+ if (!themeState) {
78
+ return resetsText ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TextAncestorProvider, {
79
+ value: false,
80
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Fallback, { ...props })
81
+ }, key) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Fallback, { ...props }, key);
74
82
  }
75
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, {
76
- ref: hostRef,
77
- style: [baseStyle, stateStyle],
78
- ...rest
79
- });
80
- });
81
- return /* @__PURE__ */ import_react.default.memo(function NativeStyleBoundary(props) {
82
- var scopeId = (0, import_react.useContext)(import_useThemeState.ThemeStateContext);
83
- return (0, import_nativeStyleEngine.getNativeStyleEngine)() && scopeId ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Native, {
84
- ...props,
85
- _scopeId: scopeId
86
- }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Fallback, { ...props });
87
- });
83
+ var rest = props;
84
+ if (props._expressions !== void 0) {
85
+ var { _expressions: _ignoredExpressions, ...withoutExpressions } = props;
86
+ rest = withoutExpressions;
87
+ }
88
+ var ref = props.ref;
89
+ var { name, theme } = themeState;
90
+ var asHostText = HostText && !inText;
91
+ var Rendered = asHostText ? HostText : Component;
92
+ var cache = asHostText ? hostTextStyles : styles;
93
+ var style = cache.get(scopeId);
94
+ if (!style) {
95
+ style = [asHostText ? hostTextBase : baseStyle, null];
96
+ cache.set(scopeId, style);
97
+ }
98
+ style[1] = resolve(themeStyleKeys, name, theme);
99
+ var wrapped = resetsText || asHostText && mayRenderText(rest.children);
100
+ var element = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Rendered, {
101
+ ...asHostText && hostTextProps,
102
+ ...rest,
103
+ ref: function(node) {
104
+ var refCleanup;
105
+ if (typeof ref === "function") refCleanup = ref(node);
106
+ else assignRef(ref, node);
107
+ var link = linkMapping(node, themeStyleKeys, scopeId, name, theme);
108
+ return function() {
109
+ link === null || link === void 0 ? void 0 : link.unlink();
110
+ if (typeof refCleanup === "function") refCleanup();
111
+ else assignRef(ref, null);
112
+ };
113
+ },
114
+ style
115
+ }, wrapped ? void 0 : key);
116
+ if (!wrapped) return element;
117
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TextAncestorProvider, {
118
+ value: !resetsText,
119
+ children: element
120
+ }, key);
121
+ };
122
+ var NativeStyleView = function(props) {
123
+ return render(props);
124
+ };
125
+ NativeStyleView.inline = function(element) {
126
+ return render(element.props, element.key);
127
+ };
128
+ return NativeStyleView;
88
129
  };
130
+ function mayRenderText(children) {
131
+ if (children == null) return false;
132
+ if (Array.isArray(children) && children.length <= 3) {
133
+ return children.some(function(child) {
134
+ return child != null && typeof child === "object";
135
+ });
136
+ }
137
+ return typeof children === "object";
138
+ }
@@ -31,11 +31,19 @@ __export(withNativeStyle_exports, { _withNativeStyle: () => _withNativeStyle });
31
31
  module.exports = __toCommonJS(withNativeStyle_exports);
32
32
  var import_jsx_runtime = require("react/jsx-runtime");
33
33
  var import_compose_refs = require("@tamagui/compose-refs");
34
+ var import_constants = require("@tamagui/constants");
34
35
  var import_react = __toESM(require("react"), 1);
35
36
  var import_withStableStyle = require("./_withStableStyle.native.js");
36
37
  var import_nativeStyleEngine = require("./helpers/nativeStyleEngine.native.js");
37
38
  var import_useThemeState = require("./hooks/useThemeState.native.js");
38
- var _withNativeStyle = function(Component, baseStyle, themeStyleKeys) {
39
+ var import_setupHooks = require("./setupHooks.native.js");
40
+ var hostTextProps = {
41
+ accessible: import_constants.isAndroid ? false : import_constants.isIos ? true : void 0,
42
+ allowFontScaling: true,
43
+ ellipsizeMode: "tail"
44
+ };
45
+ var _withNativeStyle = function(Component, baseStyle, themeStyleKeys, host) {
46
+ var _hooks_getBaseViews;
39
47
  var Fallback = (0, import_withStableStyle._withStableStyle)(Component, function(theme) {
40
48
  var themedStyle = {};
41
49
  for (var styleKey in themeStyleKeys) {
@@ -44,47 +52,89 @@ var _withNativeStyle = function(Component, baseStyle, themeStyleKeys) {
44
52
  }
45
53
  return [baseStyle, themedStyle];
46
54
  }, true, false);
47
- var Native = /* @__PURE__ */ import_react.default.memo(function NativeStyleView(param) {
48
- var { _scopeId, ...props } = param;
49
- var { ref, _expressions: _ignoredExpressions, ...rest } = props;
50
- var link = (0, import_react.useRef)(null);
51
- var [refused, setRefused] = (0, import_react.useState)(false);
52
- var themeState = (0, import_useThemeState.getThemeState)(_scopeId);
53
- var stateName = themeState === null || themeState === void 0 ? void 0 : themeState.name;
54
- var theme = themeState === null || themeState === void 0 ? void 0 : themeState.theme;
55
- var hostRef = (0, import_react.useCallback)(function(host) {
56
- var _link_current;
57
- (_link_current = link.current) === null || _link_current === void 0 ? void 0 : _link_current.unlink();
58
- link.current = null;
59
- (0, import_compose_refs.setRef)(ref, host);
60
- if (host && stateName && theme) {
61
- link.current = (0, import_nativeStyleEngine.linkNativeStyleMapping)(host, baseStyle, themeStyleKeys, _scopeId, stateName, theme);
62
- if (!link.current) setRefused(true);
63
- }
64
- }, [
65
- ref,
66
- _scopeId,
67
- stateName,
68
- theme
69
- ]);
70
- if (refused) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Fallback, { ...props });
71
- var stateStyle = stateName && theme ? (0, import_nativeStyleEngine.resolveNativeStyleMapping)(themeStyleKeys, stateName, theme) : void 0;
72
- if (process.env.NODE_ENV === "development" && (!stateName || !theme)) {
73
- throw new Error(`[@tamagui/core] native fast path cannot resolve theme ${JSON.stringify(stateName)}`);
55
+ var baseViews = host ? (_hooks_getBaseViews = import_setupHooks.hooks.getBaseViews) === null || _hooks_getBaseViews === void 0 ? void 0 : _hooks_getBaseViews.call(import_setupHooks.hooks) : void 0;
56
+ var TextAncestor = baseViews === null || baseViews === void 0 ? void 0 : baseViews.TextAncestor;
57
+ var TextAncestorProvider = TextAncestor === null || TextAncestor === void 0 ? void 0 : TextAncestor.Provider;
58
+ var HostText = host === "text" && !("userSelect" in baseStyle) && !("verticalAlign" in baseStyle) ? baseViews === null || baseViews === void 0 ? void 0 : baseViews.NativeText : void 0;
59
+ var hostTextBase = HostText ? {
60
+ overflow: "hidden",
61
+ ...baseStyle,
62
+ ...typeof baseStyle.fontWeight === "number" && { fontWeight: String(baseStyle.fontWeight) }
63
+ } : baseStyle;
64
+ var styles = /* @__PURE__ */ new Map();
65
+ var hostTextStyles = /* @__PURE__ */ new Map();
66
+ var ScopeContext = import_useThemeState.ThemeStateContext;
67
+ var engineOf = import_nativeStyleEngine.getNativeStyleEngine;
68
+ var scopeState = import_useThemeState.getThemeState;
69
+ var resolve = import_nativeStyleEngine.resolveNativeStyleMapping;
70
+ var linkMapping = import_nativeStyleEngine.linkNativeStyleMapping;
71
+ var assignRef = import_compose_refs.setRef;
72
+ var render = function(props, key) {
73
+ var scopeId = (0, import_react.use)(ScopeContext);
74
+ var inText = TextAncestor ? (0, import_react.use)(TextAncestor) : false;
75
+ var themeState = scopeId && engineOf() ? scopeState(scopeId) : void 0;
76
+ var resetsText = inText && host === "view";
77
+ if (!themeState) {
78
+ return resetsText ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TextAncestorProvider, {
79
+ value: false,
80
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Fallback, { ...props })
81
+ }, key) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Fallback, { ...props }, key);
74
82
  }
75
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, {
76
- ref: hostRef,
77
- style: [baseStyle, stateStyle],
78
- ...rest
79
- });
80
- });
81
- return /* @__PURE__ */ import_react.default.memo(function NativeStyleBoundary(props) {
82
- var scopeId = (0, import_react.useContext)(import_useThemeState.ThemeStateContext);
83
- return (0, import_nativeStyleEngine.getNativeStyleEngine)() && scopeId ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Native, {
84
- ...props,
85
- _scopeId: scopeId
86
- }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Fallback, { ...props });
87
- });
83
+ var rest = props;
84
+ if (props._expressions !== void 0) {
85
+ var { _expressions: _ignoredExpressions, ...withoutExpressions } = props;
86
+ rest = withoutExpressions;
87
+ }
88
+ var ref = props.ref;
89
+ var { name, theme } = themeState;
90
+ var asHostText = HostText && !inText;
91
+ var Rendered = asHostText ? HostText : Component;
92
+ var cache = asHostText ? hostTextStyles : styles;
93
+ var style = cache.get(scopeId);
94
+ if (!style) {
95
+ style = [asHostText ? hostTextBase : baseStyle, null];
96
+ cache.set(scopeId, style);
97
+ }
98
+ style[1] = resolve(themeStyleKeys, name, theme);
99
+ var wrapped = resetsText || asHostText && mayRenderText(rest.children);
100
+ var element = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Rendered, {
101
+ ...asHostText && hostTextProps,
102
+ ...rest,
103
+ ref: function(node) {
104
+ var refCleanup;
105
+ if (typeof ref === "function") refCleanup = ref(node);
106
+ else assignRef(ref, node);
107
+ var link = linkMapping(node, themeStyleKeys, scopeId, name, theme);
108
+ return function() {
109
+ link === null || link === void 0 ? void 0 : link.unlink();
110
+ if (typeof refCleanup === "function") refCleanup();
111
+ else assignRef(ref, null);
112
+ };
113
+ },
114
+ style
115
+ }, wrapped ? void 0 : key);
116
+ if (!wrapped) return element;
117
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TextAncestorProvider, {
118
+ value: !resetsText,
119
+ children: element
120
+ }, key);
121
+ };
122
+ var NativeStyleView = function(props) {
123
+ return render(props);
124
+ };
125
+ NativeStyleView.inline = function(element) {
126
+ return render(element.props, element.key);
127
+ };
128
+ return NativeStyleView;
88
129
  };
130
+ function mayRenderText(children) {
131
+ if (children == null) return false;
132
+ if (Array.isArray(children) && children.length <= 3) {
133
+ return children.some(function(child) {
134
+ return child != null && typeof child === "object";
135
+ });
136
+ }
137
+ return typeof children === "object";
138
+ }
89
139
 
90
140
  //# sourceMappingURL=_withNativeStyle.native.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"_withNativeStyle.native.js","names":[],"sources":["cjs/_withNativeStyle.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar withNativeStyle_exports = {};\n__export(withNativeStyle_exports, {\n _withNativeStyle: () => _withNativeStyle\n});\nmodule.exports = __toCommonJS(withNativeStyle_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_compose_refs = require(\"@tamagui/compose-refs\");\nvar import_react = __toESM(require(\"react\"), 1);\nvar import_withStableStyle = require(\"./_withStableStyle\");\nvar import_nativeStyleEngine = require(\"./helpers/nativeStyleEngine\");\nvar import_useThemeState = require(\"./hooks/useThemeState\");\nvar _withNativeStyle = function(Component, baseStyle, themeStyleKeys) {\n var Fallback = (0, import_withStableStyle._withStableStyle)(Component, function(theme) {\n var themedStyle = {};\n for (var styleKey in themeStyleKeys) {\n var _theme_themeStyleKeys_styleKey;\n themedStyle[styleKey] = (_theme_themeStyleKeys_styleKey = theme[themeStyleKeys[styleKey]]) === null || _theme_themeStyleKeys_styleKey === void 0 ? void 0 : _theme_themeStyleKeys_styleKey.get();\n }\n return [\n baseStyle,\n themedStyle\n ];\n }, true, false);\n var Native = /* @__PURE__ */ import_react.default.memo(function NativeStyleView(param) {\n var { _scopeId, ...props } = param;\n var { ref, _expressions: _ignoredExpressions, ...rest } = props;\n var link = (0, import_react.useRef)(null);\n var [refused, setRefused] = (0, import_react.useState)(false);\n var themeState = (0, import_useThemeState.getThemeState)(_scopeId);\n var stateName = themeState === null || themeState === void 0 ? void 0 : themeState.name;\n var theme = themeState === null || themeState === void 0 ? void 0 : themeState.theme;\n var hostRef = (0, import_react.useCallback)(function(host) {\n var _link_current;\n (_link_current = link.current) === null || _link_current === void 0 ? void 0 : _link_current.unlink();\n link.current = null;\n (0, import_compose_refs.setRef)(ref, host);\n if (host && stateName && theme) {\n link.current = (0, import_nativeStyleEngine.linkNativeStyleMapping)(host, baseStyle, themeStyleKeys, _scopeId, stateName, theme);\n if (!link.current) setRefused(true);\n }\n }, [\n ref,\n _scopeId,\n stateName,\n theme\n ]);\n if (refused) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Fallback, {\n ...props\n });\n var stateStyle = stateName && theme ? (0, import_nativeStyleEngine.resolveNativeStyleMapping)(themeStyleKeys, stateName, theme) : void 0;\n if (process.env.NODE_ENV === \"development\" && (!stateName || !theme)) {\n throw new Error(`[@tamagui/core] native fast path cannot resolve theme ${JSON.stringify(stateName)}`);\n }\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, {\n ref: hostRef,\n style: [\n baseStyle,\n stateStyle\n ],\n ...rest\n });\n });\n return /* @__PURE__ */ import_react.default.memo(function NativeStyleBoundary(props) {\n var scopeId = (0, import_react.useContext)(import_useThemeState.ThemeStateContext);\n return (0, import_nativeStyleEngine.getNativeStyleEngine)() && scopeId ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Native, {\n ...props,\n _scopeId: scopeId\n }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Fallback, {\n ...props\n });\n });\n};\n//# sourceMappingURL=_withNativeStyle.js.map\n"],"mappings":";;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OA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AG,yBAAyB,0BAAyB,CAAE,gBAAgB,WAAW,KAAK,IAAI,KAAK;EACvI,IAAI,QAAQ,IAAI,aAAa,kBAAkB,CAAC,aAAa,CAAC,QAAQ;GACpE,MAAM,IAAI,MAAM,yDAAyD,KAAK,UAAU,SAAS,GAAG;EACtG;EACA,OAAuB,iBAAC,GAAG,mBAAmB,IAAG,CAAE,WAAW;GAC5D,KAAK;GACL,OAAO,CACL,WACA,UACF;GACA,GAAG;EACL,CAAC;CACH,CAAC;CACD,OAAuB,6BAAa,QAAQ,KAAK,SAAS,oBAAoB,OAAO;EACnF,IAAI,WAAW,GAAG,aAAa,WAAU,CAAE,qBAAqB,iBAAiB;EACjF,QAAQ,GAAG,yBAAyB,qBAAoB,CAAE,KAAK,UAA0B,iBAAC,GAAG,mBAAmB,IAAG,CAAE,QAAQ;GAC3H,GAAG;GACH,UAAU;EACZ,CAAC,IAAoB,iBAAC,GAAG,mBAAmB,IAAG,CAAE,UAAU,EACzD,GAAG,MACL,CAAC;CACH,CAAC;AACH"}
1
+ {"version":3,"file":"_withNativeStyle.native.js","names":[],"sources":["cjs/_withNativeStyle.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar withNativeStyle_exports = {};\n__export(withNativeStyle_exports, {\n _withNativeStyle: () => _withNativeStyle\n});\nmodule.exports = __toCommonJS(withNativeStyle_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_compose_refs = require(\"@tamagui/compose-refs\");\nvar import_constants = require(\"@tamagui/constants\");\nvar import_react = __toESM(require(\"react\"), 1);\nvar import_withStableStyle = require(\"./_withStableStyle\");\nvar import_nativeStyleEngine = require(\"./helpers/nativeStyleEngine\");\nvar import_useThemeState = require(\"./hooks/useThemeState\");\nvar import_setupHooks = require(\"./setupHooks\");\nvar hostTextProps = {\n accessible: import_constants.isAndroid ? false : import_constants.isIos ? true : void 0,\n allowFontScaling: true,\n ellipsizeMode: \"tail\"\n};\nvar _withNativeStyle = function(Component, baseStyle, themeStyleKeys, host) {\n var _hooks_getBaseViews;\n var Fallback = (0, import_withStableStyle._withStableStyle)(Component, function(theme) {\n var themedStyle = {};\n for (var styleKey in themeStyleKeys) {\n var _theme_themeStyleKeys_styleKey;\n themedStyle[styleKey] = (_theme_themeStyleKeys_styleKey = theme[themeStyleKeys[styleKey]]) === null || _theme_themeStyleKeys_styleKey === void 0 ? void 0 : _theme_themeStyleKeys_styleKey.get();\n }\n return [\n baseStyle,\n themedStyle\n ];\n }, true, false);\n var baseViews = host ? (_hooks_getBaseViews = import_setupHooks.hooks.getBaseViews) === null || _hooks_getBaseViews === void 0 ? void 0 : _hooks_getBaseViews.call(import_setupHooks.hooks) : void 0;\n var TextAncestor = baseViews === null || baseViews === void 0 ? void 0 : baseViews.TextAncestor;\n var TextAncestorProvider = TextAncestor === null || TextAncestor === void 0 ? void 0 : TextAncestor.Provider;\n var HostText = host === \"text\" && !(\"userSelect\" in baseStyle) && !(\"verticalAlign\" in baseStyle) ? baseViews === null || baseViews === void 0 ? void 0 : baseViews.NativeText : void 0;\n var hostTextBase = HostText ? {\n overflow: \"hidden\",\n ...baseStyle,\n ...typeof baseStyle.fontWeight === \"number\" && {\n fontWeight: String(baseStyle.fontWeight)\n }\n } : baseStyle;\n var styles = /* @__PURE__ */ new Map();\n var hostTextStyles = /* @__PURE__ */ new Map();\n var ScopeContext = import_useThemeState.ThemeStateContext;\n var engineOf = import_nativeStyleEngine.getNativeStyleEngine;\n var scopeState = import_useThemeState.getThemeState;\n var resolve = import_nativeStyleEngine.resolveNativeStyleMapping;\n var linkMapping = import_nativeStyleEngine.linkNativeStyleMapping;\n var assignRef = import_compose_refs.setRef;\n var render = function(props, key) {\n var scopeId = (0, import_react.use)(ScopeContext);\n var inText = TextAncestor ? (0, import_react.use)(TextAncestor) : false;\n var themeState = scopeId && engineOf() ? scopeState(scopeId) : void 0;\n var resetsText = inText && host === \"view\";\n if (!themeState) {\n return resetsText ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TextAncestorProvider, {\n value: false,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Fallback, {\n ...props\n })\n }, key) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Fallback, {\n ...props\n }, key);\n }\n var rest = props;\n if (props._expressions !== void 0) {\n var { _expressions: _ignoredExpressions, ...withoutExpressions } = props;\n rest = withoutExpressions;\n }\n var ref = props.ref;\n var { name, theme } = themeState;\n var asHostText = HostText && !inText;\n var Rendered = asHostText ? HostText : Component;\n var cache = asHostText ? hostTextStyles : styles;\n var style = cache.get(scopeId);\n if (!style) {\n style = [\n asHostText ? hostTextBase : baseStyle,\n null\n ];\n cache.set(scopeId, style);\n }\n style[1] = resolve(themeStyleKeys, name, theme);\n var wrapped = resetsText || asHostText && mayRenderText(rest.children);\n var element = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Rendered, {\n ...asHostText && hostTextProps,\n ...rest,\n ref: function(node) {\n var refCleanup;\n if (typeof ref === \"function\") refCleanup = ref(node);\n else assignRef(ref, node);\n var link = linkMapping(node, themeStyleKeys, scopeId, name, theme);\n return function() {\n link === null || link === void 0 ? void 0 : link.unlink();\n if (typeof refCleanup === \"function\") refCleanup();\n else assignRef(ref, null);\n };\n },\n style\n }, wrapped ? void 0 : key);\n if (!wrapped) return element;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TextAncestorProvider, {\n value: !resetsText,\n children: element\n }, key);\n };\n var NativeStyleView = function(props) {\n return render(props);\n };\n NativeStyleView.inline = function(element) {\n return render(element.props, element.key);\n };\n return NativeStyleView;\n};\nfunction mayRenderText(children) {\n if (children == null) return false;\n if (Array.isArray(children) && children.length <= 3) {\n return children.some(function(child) {\n return child != null && typeof child === \"object\";\n });\n }\n return typeof children === \"object\";\n}\n//# sourceMappingURL=_withNativeStyle.js.map\n"],"mappings":";;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;C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