@tamagui/core 3.0.3 → 3.0.5

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.
@@ -37,6 +37,7 @@ function getBaseViews() {
37
37
  View: rn.View || ((_rn_default = rn.default) === null || _rn_default === void 0 ? void 0 : _rn_default.View),
38
38
  Text: rn.Text || ((_rn_default1 = rn.default) === null || _rn_default1 === void 0 ? void 0 : _rn_default1.Text),
39
39
  TextAncestor: rn.unstable_TextAncestorContext,
40
+ NativeText: rn.unstable_NativeText,
40
41
  StyleSheet: rn.StyleSheet || ((_rn_default2 = rn.default) === null || _rn_default2 === void 0 ? void 0 : _rn_default2.StyleSheet),
41
42
  Pressable: rn.Pressable || ((_rn_default3 = rn.default) === null || _rn_default3 === void 0 ? void 0 : _rn_default3.Pressable)
42
43
  };
@@ -37,6 +37,7 @@ function getBaseViews() {
37
37
  View: rn.View || ((_rn_default = rn.default) === null || _rn_default === void 0 ? void 0 : _rn_default.View),
38
38
  Text: rn.Text || ((_rn_default1 = rn.default) === null || _rn_default1 === void 0 ? void 0 : _rn_default1.Text),
39
39
  TextAncestor: rn.unstable_TextAncestorContext,
40
+ NativeText: rn.unstable_NativeText,
40
41
  StyleSheet: rn.StyleSheet || ((_rn_default2 = rn.default) === null || _rn_default2 === void 0 ? void 0 : _rn_default2.StyleSheet),
41
42
  Pressable: rn.Pressable || ((_rn_default3 = rn.default) === null || _rn_default3 === void 0 ? void 0 : _rn_default3.Pressable)
42
43
  };
@@ -1 +1 @@
1
- {"version":3,"file":"getBaseViews.native.js","names":[],"sources":["cjs/getBaseViews.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 getBaseViews_native_exports = {};\n__export(getBaseViews_native_exports, {\n getBaseViews: () => getBaseViews\n});\nmodule.exports = __toCommonJS(getBaseViews_native_exports);\nvar native = __toESM(require(\"react-native\"), 1);\nfunction getBaseViews() {\n var _rn_default, _rn_default1, _rn_default2, _rn_default3;\n var rn = native;\n return {\n View: rn.View || ((_rn_default = rn.default) === null || _rn_default === void 0 ? void 0 : _rn_default.View),\n Text: rn.Text || ((_rn_default1 = rn.default) === null || _rn_default1 === void 0 ? void 0 : _rn_default1.Text),\n TextAncestor: rn.unstable_TextAncestorContext,\n StyleSheet: rn.StyleSheet || ((_rn_default2 = rn.default) === null || _rn_default2 === void 0 ? void 0 : _rn_default2.StyleSheet),\n Pressable: rn.Pressable || ((_rn_default3 = rn.default) === null || _rn_default3 === void 0 ? void 0 : _rn_default3.Pressable)\n };\n}\n//# sourceMappingURL=getBaseViews.native.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;CACvH;CACA,OAAO;AACT;AACA,IAAI,WAAW,KAAK,YAAY,YAAY,SAAS,OAAO,OAAO,SAAS,aAAa,GAAG,CAAC,IAAI,CAAC,GAAG,YAKnG,cAAc,CAAC,OAAO,CAAC,IAAI,aAAa,UAAU,QAAQ,WAAW;CAAE,OAAO;CAAK,YAAY;AAAK,CAAC,IAAI,QACzG,GACF;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,8BAA8B,CAAC;AACnC,SAAS,6BAA6B,EACpC,oBAAoB,aACtB,CAAC;AACD,OAAO,UAAU,aAAa,2BAA2B;AACzD,IAAI,SAAS,QAAQ,QAAQ,cAAc,GAAG,CAAC;AAC/C,SAAS,eAAe;CACtB,IAAI,aAAa,cAAc,cAAc;CAC7C,IAAI,KAAK;CACT,OAAO;EACL,MAAM,GAAG,UAAU,cAAc,GAAG,aAAa,QAAQ,gBAAgB,KAAK,IAAI,KAAK,IAAI,YAAY;EACvG,MAAM,GAAG,UAAU,eAAe,GAAG,aAAa,QAAQ,iBAAiB,KAAK,IAAI,KAAK,IAAI,aAAa;EAC1G,cAAc,GAAG;EACjB,YAAY,GAAG,gBAAgB,eAAe,GAAG,aAAa,QAAQ,iBAAiB,KAAK,IAAI,KAAK,IAAI,aAAa;EACtH,WAAW,GAAG,eAAe,eAAe,GAAG,aAAa,QAAQ,iBAAiB,KAAK,IAAI,KAAK,IAAI,aAAa;CACtH;AACF"}
1
+ {"version":3,"file":"getBaseViews.native.js","names":[],"sources":["cjs/getBaseViews.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 getBaseViews_native_exports = {};\n__export(getBaseViews_native_exports, {\n getBaseViews: () => getBaseViews\n});\nmodule.exports = __toCommonJS(getBaseViews_native_exports);\nvar native = __toESM(require(\"react-native\"), 1);\nfunction getBaseViews() {\n var _rn_default, _rn_default1, _rn_default2, _rn_default3;\n var rn = native;\n return {\n View: rn.View || ((_rn_default = rn.default) === null || _rn_default === void 0 ? void 0 : _rn_default.View),\n Text: rn.Text || ((_rn_default1 = rn.default) === null || _rn_default1 === void 0 ? void 0 : _rn_default1.Text),\n TextAncestor: rn.unstable_TextAncestorContext,\n NativeText: rn.unstable_NativeText,\n StyleSheet: rn.StyleSheet || ((_rn_default2 = rn.default) === null || _rn_default2 === void 0 ? void 0 : _rn_default2.StyleSheet),\n Pressable: rn.Pressable || ((_rn_default3 = rn.default) === null || _rn_default3 === void 0 ? void 0 : _rn_default3.Pressable)\n };\n}\n//# sourceMappingURL=getBaseViews.native.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;CACvH;CACA,OAAO;AACT;AACA,IAAI,WAAW,KAAK,YAAY,YAAY,SAAS,OAAO,OAAO,SAAS,aAAa,GAAG,CAAC,IAAI,CAAC,GAAG,YAKnG,cAAc,CAAC,OAAO,CAAC,IAAI,aAAa,UAAU,QAAQ,WAAW;CAAE,OAAO;CAAK,YAAY;AAAK,CAAC,IAAI,QACzG,GACF;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,8BAA8B,CAAC;AACnC,SAAS,6BAA6B,EACpC,oBAAoB,aACtB,CAAC;AACD,OAAO,UAAU,aAAa,2BAA2B;AACzD,IAAI,SAAS,QAAQ,QAAQ,cAAc,GAAG,CAAC;AAC/C,SAAS,eAAe;CACtB,IAAI,aAAa,cAAc,cAAc;CAC7C,IAAI,KAAK;CACT,OAAO;EACL,MAAM,GAAG,UAAU,cAAc,GAAG,aAAa,QAAQ,gBAAgB,KAAK,IAAI,KAAK,IAAI,YAAY;EACvG,MAAM,GAAG,UAAU,eAAe,GAAG,aAAa,QAAQ,iBAAiB,KAAK,IAAI,KAAK,IAAI,aAAa;EAC1G,cAAc,GAAG;EACjB,YAAY,GAAG;EACf,YAAY,GAAG,gBAAgB,eAAe,GAAG,aAAa,QAAQ,iBAAiB,KAAK,IAAI,KAAK,IAAI,aAAa;EACtH,WAAW,GAAG,eAAe,eAAe,GAAG,aAAa,QAAQ,iBAAiB,KAAK,IAAI,KAAK,IAAI,aAAa;CACtH;AACF"}
@@ -7,6 +7,7 @@ function getBaseViews() {
7
7
  View: rn.View || ((_rn_default = rn.default) === null || _rn_default === void 0 ? void 0 : _rn_default.View),
8
8
  Text: rn.Text || ((_rn_default1 = rn.default) === null || _rn_default1 === void 0 ? void 0 : _rn_default1.Text),
9
9
  TextAncestor: rn.unstable_TextAncestorContext,
10
+ NativeText: rn.unstable_NativeText,
10
11
  StyleSheet: rn.StyleSheet || ((_rn_default2 = rn.default) === null || _rn_default2 === void 0 ? void 0 : _rn_default2.StyleSheet),
11
12
  Pressable: rn.Pressable || ((_rn_default3 = rn.default) === null || _rn_default3 === void 0 ? void 0 : _rn_default3.Pressable)
12
13
  };
@@ -1 +1 @@
1
- {"version":3,"file":"getBaseViews.native.js","names":[],"sources":["esm/getBaseViews.native.js"],"sourcesContent":["import * as native from \"react-native\";\nfunction getBaseViews() {\n var _rn_default, _rn_default1, _rn_default2, _rn_default3;\n var rn = native;\n return {\n View: rn.View || ((_rn_default = rn.default) === null || _rn_default === void 0 ? void 0 : _rn_default.View),\n Text: rn.Text || ((_rn_default1 = rn.default) === null || _rn_default1 === void 0 ? void 0 : _rn_default1.Text),\n TextAncestor: rn.unstable_TextAncestorContext,\n StyleSheet: rn.StyleSheet || ((_rn_default2 = rn.default) === null || _rn_default2 === void 0 ? void 0 : _rn_default2.StyleSheet),\n Pressable: rn.Pressable || ((_rn_default3 = rn.default) === null || _rn_default3 === void 0 ? void 0 : _rn_default3.Pressable)\n };\n}\nexport {\n getBaseViews\n};\n//# sourceMappingURL=getBaseViews.native.js.map\n"],"mappings":";;;AACA,SAAS,eAAe;CACtB,IAAI,aAAa,cAAc,cAAc;CAC7C,IAAI,KAAK;CACT,OAAO;EACL,MAAM,GAAG,UAAU,cAAc,GAAG,aAAa,QAAQ,gBAAgB,KAAK,IAAI,KAAK,IAAI,YAAY;EACvG,MAAM,GAAG,UAAU,eAAe,GAAG,aAAa,QAAQ,iBAAiB,KAAK,IAAI,KAAK,IAAI,aAAa;EAC1G,cAAc,GAAG;EACjB,YAAY,GAAG,gBAAgB,eAAe,GAAG,aAAa,QAAQ,iBAAiB,KAAK,IAAI,KAAK,IAAI,aAAa;EACtH,WAAW,GAAG,eAAe,eAAe,GAAG,aAAa,QAAQ,iBAAiB,KAAK,IAAI,KAAK,IAAI,aAAa;CACtH;AACF"}
1
+ {"version":3,"file":"getBaseViews.native.js","names":[],"sources":["esm/getBaseViews.native.js"],"sourcesContent":["import * as native from \"react-native\";\nfunction getBaseViews() {\n var _rn_default, _rn_default1, _rn_default2, _rn_default3;\n var rn = native;\n return {\n View: rn.View || ((_rn_default = rn.default) === null || _rn_default === void 0 ? void 0 : _rn_default.View),\n Text: rn.Text || ((_rn_default1 = rn.default) === null || _rn_default1 === void 0 ? void 0 : _rn_default1.Text),\n TextAncestor: rn.unstable_TextAncestorContext,\n NativeText: rn.unstable_NativeText,\n StyleSheet: rn.StyleSheet || ((_rn_default2 = rn.default) === null || _rn_default2 === void 0 ? void 0 : _rn_default2.StyleSheet),\n Pressable: rn.Pressable || ((_rn_default3 = rn.default) === null || _rn_default3 === void 0 ? void 0 : _rn_default3.Pressable)\n };\n}\nexport {\n getBaseViews\n};\n//# sourceMappingURL=getBaseViews.native.js.map\n"],"mappings":";;;AACA,SAAS,eAAe;CACtB,IAAI,aAAa,cAAc,cAAc;CAC7C,IAAI,KAAK;CACT,OAAO;EACL,MAAM,GAAG,UAAU,cAAc,GAAG,aAAa,QAAQ,gBAAgB,KAAK,IAAI,KAAK,IAAI,YAAY;EACvG,MAAM,GAAG,UAAU,eAAe,GAAG,aAAa,QAAQ,iBAAiB,KAAK,IAAI,KAAK,IAAI,aAAa;EAC1G,cAAc,GAAG;EACjB,YAAY,GAAG;EACf,YAAY,GAAG,gBAAgB,eAAe,GAAG,aAAa,QAAQ,iBAAiB,KAAK,IAAI,KAAK,IAAI,aAAa;EACtH,WAAW,GAAG,eAAe,eAAe,GAAG,aAAa,QAAQ,iBAAiB,KAAK,IAAI,KAAK,IAAI,aAAa;CACtH;AACF"}
package/dist/native.cjs CHANGED
@@ -7690,7 +7690,7 @@ function resolveStyles(...inputs) {
7690
7690
  function joinClassNames(...parts) {
7691
7691
  return parts.filter(Boolean).join(" ").trim() || void 0;
7692
7692
  }
7693
- var _excluded$22, _excluded2$5, View$1$1, commonStyle, styles$10, WebScrollView;
7693
+ var _excluded$22, _excluded2$4, View$1$1, commonStyle, styles$10, WebScrollView;
7694
7694
  var init_WebScrollView = __esmMin((() => {
7695
7695
  init_View();
7696
7696
  init_objectSpread2();
@@ -7741,7 +7741,7 @@ var init_WebScrollView = __esmMin((() => {
7741
7741
  "snapToStart",
7742
7742
  "bounces"
7743
7743
  ];
7744
- _excluded2$5 = ["dataSet"];
7744
+ _excluded2$4 = ["dataSet"];
7745
7745
  View$1$1 = View$2;
7746
7746
  commonStyle = {
7747
7747
  flexGrow: 1,
@@ -7779,7 +7779,7 @@ var init_WebScrollView = __esmMin((() => {
7779
7779
  };
7780
7780
  WebScrollView = react.forwardRef((props, forwardedRef) => {
7781
7781
  const { children, contentContainerStyle, horizontal, onContentSizeChange, onScroll, refreshControl, stickyHeaderIndices, pagingEnabled, centerContent, scrollEnabled = true, scrollEventThrottle = 0, showsHorizontalScrollIndicator, showsVerticalScrollIndicator, style, keyboardShouldPersistTaps, keyboardDismissMode, contentOffset, contentInset, contentInsetAdjustmentBehavior, decelerationRate, directionalLockEnabled, disableIntervalMomentum, disableScrollViewPanResponder, endFillColor, fadingEdgeLength, indicatorStyle, invertStickyHeaders, maintainVisibleContentPosition, maximumZoomScale, minimumZoomScale, nestedScrollEnabled, onScrollToTop, overScrollMode, pinchGestureEnabled, removeClippedSubviews, scrollIndicatorInsets, scrollPerfTag, scrollToOverflowEnabled, snapToAlignment, snapToEnd, snapToInterval, snapToOffsets, snapToStart, bounces } = props, rest = _objectWithoutProperties(props, _excluded$22);
7782
- const { dataSet } = rest, domRest = _objectWithoutProperties(rest, _excluded2$5);
7782
+ const { dataSet } = rest, domRest = _objectWithoutProperties(rest, _excluded2$4);
7783
7783
  const dataAttrs = {};
7784
7784
  if (dataSet) for (const key in dataSet) dataAttrs[`data-${key}`] = dataSet[key];
7785
7785
  const scrollNodeRef = react.useRef(null);
@@ -14690,7 +14690,7 @@ var init_useTheme_native = __esmMin((() => {
14690
14690
  }));
14691
14691
  //#endregion
14692
14692
  //#region ../web/dist/esm/_withStableStyle.native.js
14693
- var _excluded$8, _excluded2$4, EMPTY_EXPRESSIONS, EMPTY_THEME, FALLBACK_THEME_CACHE, _withStableStyle;
14693
+ var _excluded$8, _excluded2$3, EMPTY_EXPRESSIONS, EMPTY_THEME, FALLBACK_THEME_CACHE, _withStableStyle;
14694
14694
  var init__withStableStyle_native = __esmMin((() => {
14695
14695
  init_config_native();
14696
14696
  init_createVariable_native();
@@ -14700,14 +14700,14 @@ var init__withStableStyle_native = __esmMin((() => {
14700
14700
  init_objectWithoutProperties();
14701
14701
  init_objectSpread2();
14702
14702
  _excluded$8 = ["ref"];
14703
- _excluded2$4 = ["_expressions"];
14703
+ _excluded2$3 = ["_expressions"];
14704
14704
  EMPTY_EXPRESSIONS = [];
14705
14705
  EMPTY_THEME = {};
14706
14706
  FALLBACK_THEME_CACHE = /* @__PURE__ */ new WeakMap();
14707
14707
  _withStableStyle = function(Component, createStyle, hasThemeKeys, hasMediaKeys) {
14708
14708
  return /* @__PURE__ */ react.default.memo(function WithStableStyle(props) {
14709
14709
  var { ref } = props, propsWithoutRef = _objectWithoutProperties(props, _excluded$8);
14710
- var { _expressions = EMPTY_EXPRESSIONS } = propsWithoutRef, rest = _objectWithoutProperties(propsWithoutRef, _excluded2$4);
14710
+ var { _expressions = EMPTY_EXPRESSIONS } = propsWithoutRef, rest = _objectWithoutProperties(propsWithoutRef, _excluded2$3);
14711
14711
  var parentId = (0, react.useContext)(ThemeStateContext);
14712
14712
  var theme = hasThemeKeys && parentId ? useTheme() : null;
14713
14713
  var media = hasMediaKeys ? useMedia() : null;
@@ -14804,7 +14804,8 @@ function getCompiledMapping(mapping) {
14804
14804
  compiled = {
14805
14805
  mapping,
14806
14806
  states: /* @__PURE__ */ new Map(),
14807
- links: /* @__PURE__ */ new Set()
14807
+ tableId: nextTableId++,
14808
+ sent: /* @__PURE__ */ new Map()
14808
14809
  };
14809
14810
  if (compiledMappings.size >= 1e4) compiledMappings.clear();
14810
14811
  compiledMappings.set(key, compiled);
@@ -14822,22 +14823,7 @@ function resolveCompiledMapping(compiled, stateName, theme) {
14822
14823
  renderProps = normalizeNativeStyle(renderProps, true);
14823
14824
  var _engine_processStyleColors;
14824
14825
  var nativeProps = (_engine_processStyleColors = engine === null || engine === void 0 ? void 0 : engine.processStyleColors(renderProps)) !== null && _engine_processStyleColors !== void 0 ? _engine_processStyleColors : renderProps;
14825
- if (compiled.states.size >= 1e4) {
14826
- compiled.states.clear();
14827
- var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
14828
- try {
14829
- for (var _iterator = compiled.links[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) _step.value.stateThemes.clear();
14830
- } catch (err) {
14831
- _didIteratorError = true;
14832
- _iteratorError = err;
14833
- } finally {
14834
- try {
14835
- if (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();
14836
- } finally {
14837
- if (_didIteratorError) throw _iteratorError;
14838
- }
14839
- }
14840
- }
14826
+ if (compiled.states.size >= 1e4) compiled.states.clear();
14841
14827
  var resolved = {
14842
14828
  theme,
14843
14829
  renderProps,
@@ -14846,10 +14832,19 @@ function resolveCompiledMapping(compiled, stateName, theme) {
14846
14832
  compiled.states.set(stateName, resolved);
14847
14833
  return resolved;
14848
14834
  }
14835
+ function syncTableState(compiled, stateName, theme) {
14836
+ var resolved = resolveCompiledMapping(compiled, stateName, theme);
14837
+ if (compiled.sent.get(stateName) === resolved) return;
14838
+ compiled.sent.set(stateName, resolved);
14839
+ engine.setTableState(compiled.tableId, stateName, resolved.nativeProps);
14840
+ }
14849
14841
  function setNativeStyleEngine(next) {
14850
14842
  if (engine !== next) {
14843
+ settleReleases();
14851
14844
  compiledMappings.clear();
14852
- activeCompiledMappings.clear();
14845
+ scopeMappings.clear();
14846
+ pendingLinks = [];
14847
+ unlinkedPending = 0;
14853
14848
  }
14854
14849
  engine = next;
14855
14850
  if (next) {
@@ -14877,53 +14872,31 @@ function getNativeStyleEngine() {
14877
14872
  function updateNativeStyleScope(scopeId, stateName, theme) {
14878
14873
  var previous = scopeStates.get(scopeId);
14879
14874
  if ((previous === null || previous === void 0 ? void 0 : previous.name) === stateName && previous.theme === theme) return;
14875
+ flushNativeStyleLinks();
14880
14876
  scopeStates.set(scopeId, {
14881
14877
  name: stateName,
14882
14878
  theme
14883
14879
  });
14884
14880
  if (engine) {
14885
- var entries = [];
14886
- var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
14887
- try {
14888
- for (var _iterator = activeCompiledMappings[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
14889
- var compiled = _step.value;
14890
- var props = void 0;
14891
- var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;
14881
+ var linked = scopeMappings.get(scopeId);
14882
+ if (linked) {
14883
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
14884
+ try {
14885
+ for (var _iterator = linked.keys()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
14886
+ var compiled = _step.value;
14887
+ syncTableState(compiled, stateName, theme);
14888
+ }
14889
+ } catch (err) {
14890
+ _didIteratorError = true;
14891
+ _iteratorError = err;
14892
+ } finally {
14892
14893
  try {
14893
- for (var _iterator1 = compiled.links[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {
14894
- var link = _step1.value;
14895
- if (link.scopeId !== scopeId) continue;
14896
- if (link.stateThemes.get(stateName) === theme) continue;
14897
- props || (props = resolveCompiledMapping(compiled, stateName, theme).nativeProps);
14898
- entries.push({
14899
- id: link.handle.id,
14900
- state: stateName,
14901
- props
14902
- });
14903
- link.stateThemes.set(stateName, theme);
14904
- }
14905
- } catch (err) {
14906
- _didIteratorError1 = true;
14907
- _iteratorError1 = err;
14894
+ if (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();
14908
14895
  } finally {
14909
- try {
14910
- if (!_iteratorNormalCompletion1 && _iterator1.return != null) _iterator1.return();
14911
- } finally {
14912
- if (_didIteratorError1) throw _iteratorError1;
14913
- }
14896
+ if (_didIteratorError) throw _iteratorError;
14914
14897
  }
14915
14898
  }
14916
- } catch (err) {
14917
- _didIteratorError = true;
14918
- _iteratorError = err;
14919
- } finally {
14920
- try {
14921
- if (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();
14922
- } finally {
14923
- if (_didIteratorError) throw _iteratorError;
14924
- }
14925
14899
  }
14926
- if (entries.length) engine.updateViewStateTables(entries);
14927
14900
  }
14928
14901
  engine === null || engine === void 0 || engine.setStateName(stateName, scopeId);
14929
14902
  }
@@ -14934,32 +14907,41 @@ function removeNativeStyleScope(scopeId) {
14934
14907
  function resolveNativeStyleMapping(mapping, stateName, theme) {
14935
14908
  return resolveCompiledMapping(getCompiledMapping(mapping), stateName, theme).renderProps;
14936
14909
  }
14937
- function linkNativeStyleMapping(ref, baseStyle, mapping, scopeId, stateName, theme) {
14938
- if (!engine) return null;
14939
- var compiled = getCompiledMapping(mapping);
14940
- var scopeState = scopeStates.get(scopeId);
14941
- var _scopeState_name;
14942
- var currentStateName = (_scopeState_name = scopeState === null || scopeState === void 0 ? void 0 : scopeState.name) !== null && _scopeState_name !== void 0 ? _scopeState_name : stateName;
14943
- var _scopeState_theme;
14944
- var currentTheme = (_scopeState_theme = scopeState === null || scopeState === void 0 ? void 0 : scopeState.theme) !== null && _scopeState_theme !== void 0 ? _scopeState_theme : theme;
14945
- var stale = currentStateName !== stateName || currentTheme !== theme;
14946
- var stateProps = resolveCompiledMapping(compiled, currentStateName, currentTheme).nativeProps;
14947
- var base = processedBases.get(baseStyle);
14948
- if (!base || base.engine !== engine) {
14949
- base = {
14950
- engine,
14951
- props: engine.processStyleColors(normalizeNativeStyle(baseStyle))
14952
- };
14953
- processedBases.set(baseStyle, base);
14910
+ function trackScopeMapping(link, delta) {
14911
+ var linked = scopeMappings.get(link.scopeId);
14912
+ if (!linked) scopeMappings.set(link.scopeId, linked = /* @__PURE__ */ new Map());
14913
+ var _linked_get;
14914
+ var count = ((_linked_get = linked.get(link.compiled)) !== null && _linked_get !== void 0 ? _linked_get : 0) + delta;
14915
+ if (count) linked.set(link.compiled, count);
14916
+ else {
14917
+ linked.delete(link.compiled);
14918
+ if (!linked.size) scopeMappings.delete(link.scopeId);
14954
14919
  }
14955
- var state = {};
14956
- var stateThemes = /* @__PURE__ */ new Map();
14920
+ }
14921
+ function flushNativeStyleLinks() {
14922
+ settleReleases();
14923
+ if (!pendingLinks.length) return;
14924
+ var links = pendingLinks;
14925
+ pendingLinks = [];
14926
+ unlinkedPending = 0;
14927
+ if (!engine) return;
14928
+ var live = links.filter(function(link2) {
14929
+ return link2.id === 0;
14930
+ });
14931
+ if (!live.length) return;
14932
+ var refs = [];
14933
+ var tableIds = [];
14934
+ var scopeIndexes = [];
14935
+ var scopes = [];
14957
14936
  var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
14958
14937
  try {
14959
- for (var _iterator = compiled.states[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
14960
- var [name, cached] = _step.value;
14961
- state[name] = cached.nativeProps;
14962
- stateThemes.set(name, cached.theme);
14938
+ for (var _iterator = live[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
14939
+ var link = _step.value;
14940
+ var scopeIndex = scopes.indexOf(link.scopeId);
14941
+ if (scopeIndex === -1) scopeIndex = scopes.push(link.scopeId) - 1;
14942
+ refs.push(link.ref);
14943
+ tableIds.push(link.compiled.tableId);
14944
+ scopeIndexes.push(scopeIndex);
14963
14945
  }
14964
14946
  } catch (err) {
14965
14947
  _didIteratorError = true;
@@ -14971,33 +14953,108 @@ function linkNativeStyleMapping(ref, baseStyle, mapping, scopeId, stateName, the
14971
14953
  if (_didIteratorError) throw _iteratorError;
14972
14954
  }
14973
14955
  }
14974
- state[currentStateName] = stateProps;
14975
- stateThemes.set(currentStateName, currentTheme);
14976
- var handle = engine.link(ref, {
14977
- base: base.props,
14978
- state
14979
- }, scopeId);
14980
- if (!handle) return null;
14981
- if (stale) engine.updateViewStateTables([{
14982
- id: handle.id,
14983
- state: currentStateName,
14984
- props: stateProps
14985
- }]);
14986
- var link = {
14987
- handle,
14988
- scopeId,
14989
- stateThemes
14990
- };
14991
- compiled.links.add(link);
14992
- activeCompiledMappings.add(compiled);
14993
- return {
14994
- id: handle.id,
14956
+ var firstId = engine.linkTables(refs, tableIds, scopeIndexes, scopes);
14957
+ for (var i = 0; i < live.length; i++) {
14958
+ var link1 = live[i];
14959
+ link1.id = firstId + i;
14960
+ link1.owner = engine;
14961
+ link1.ref = null;
14962
+ trackScopeMapping(link1, 1);
14963
+ }
14964
+ }
14965
+ function settleReleases() {
14966
+ settleQueued = false;
14967
+ if (!releases.size) return;
14968
+ var settling = [...releases.values()];
14969
+ releases.clear();
14970
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
14971
+ try {
14972
+ for (var _iterator = settling[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) _step.value.settle();
14973
+ } catch (err) {
14974
+ _didIteratorError = true;
14975
+ _iteratorError = err;
14976
+ } finally {
14977
+ try {
14978
+ if (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();
14979
+ } finally {
14980
+ if (_didIteratorError) throw _iteratorError;
14981
+ }
14982
+ }
14983
+ }
14984
+ function releasable(ref, compiled, scopeId, id, settle) {
14985
+ var handle = {
14986
+ id,
14995
14987
  unlink: function() {
14996
- compiled.links.delete(link);
14997
- if (!compiled.links.size) activeCompiledMappings.delete(compiled);
14998
- handle.unlink();
14988
+ var prior = releases.get(ref);
14989
+ if (prior && prior.handle !== handle) prior.settle();
14990
+ releases.set(ref, {
14991
+ compiled,
14992
+ scopeId,
14993
+ handle,
14994
+ settle
14995
+ });
14996
+ if (!settleQueued) {
14997
+ settleQueued = true;
14998
+ queueMicrotask(settleReleases);
14999
+ }
14999
15000
  }
15000
15001
  };
15002
+ return handle;
15003
+ }
15004
+ function linkNativeStyleMapping(ref, mapping, scopeId, stateName, theme) {
15005
+ if (!engine) return null;
15006
+ var compiled = getCompiledMapping(mapping);
15007
+ var scopeState = scopeStates.get(scopeId);
15008
+ var stale = scopeState && (scopeState.name !== stateName || scopeState.theme !== theme);
15009
+ var kept = releases.get(ref);
15010
+ if (kept) {
15011
+ releases.delete(ref);
15012
+ if (!stale && kept.compiled === compiled && kept.scopeId === scopeId) return kept.handle;
15013
+ kept.settle();
15014
+ }
15015
+ if (stale) {
15016
+ syncTableState(compiled, scopeState.name, scopeState.theme);
15017
+ var handle = engine.link(ref, compiled.tableId, scopeId, true);
15018
+ if (!handle) return null;
15019
+ var link = {
15020
+ ref: null,
15021
+ compiled,
15022
+ scopeId,
15023
+ id: handle.id,
15024
+ owner: engine
15025
+ };
15026
+ trackScopeMapping(link, 1);
15027
+ return releasable(ref, compiled, scopeId, handle.id, function() {
15028
+ if (link.id === -1) return;
15029
+ link.id = -1;
15030
+ if (link.owner === engine) trackScopeMapping(link, -1);
15031
+ handle.unlink();
15032
+ });
15033
+ }
15034
+ syncTableState(compiled, stateName, theme);
15035
+ var link1 = {
15036
+ ref,
15037
+ compiled,
15038
+ scopeId,
15039
+ id: 0,
15040
+ owner: null
15041
+ };
15042
+ pendingLinks.push(link1);
15043
+ return releasable(ref, compiled, scopeId, 0, function() {
15044
+ var id = link1.id;
15045
+ if (id === -1) return;
15046
+ link1.id = -1;
15047
+ link1.ref = null;
15048
+ if (id > 0) {
15049
+ if (link1.owner === engine) trackScopeMapping(link1, -1);
15050
+ link1.owner.unlink(id);
15051
+ } else if (++unlinkedPending > 512 && unlinkedPending * 2 > pendingLinks.length) {
15052
+ pendingLinks = pendingLinks.filter(function(pending2) {
15053
+ return pending2.id === 0;
15054
+ });
15055
+ unlinkedPending = 0;
15056
+ }
15057
+ });
15001
15058
  }
15002
15059
  function setNativeStyleEngineFlushListener(cb) {
15003
15060
  flushListener = cb;
@@ -15023,7 +15080,7 @@ function queueNativeViewState(entry) {
15023
15080
  }
15024
15081
  pending.push(entry);
15025
15082
  }
15026
- var nativeTextInputColorProps, nativeOutlineProps, nativeIntrinsicSizeProps, engine, scopeStates, mappingKeys, compiledMappings, activeCompiledMappings, processedBases, pending, flushListener;
15083
+ var nativeTextInputColorProps, nativeOutlineProps, nativeIntrinsicSizeProps, engine, scopeStates, mappingKeys, compiledMappings, scopeMappings, nextTableId, pendingLinks, unlinkedPending, releases, settleQueued, pending, flushListener;
15027
15084
  var init_nativeStyleEngine_native = __esmMin((() => {
15028
15085
  init_createVariable_native();
15029
15086
  init_objectSpread2();
@@ -15051,24 +15108,51 @@ var init_nativeStyleEngine_native = __esmMin((() => {
15051
15108
  scopeStates = /* @__PURE__ */ new Map();
15052
15109
  mappingKeys = /* @__PURE__ */ new WeakMap();
15053
15110
  compiledMappings = /* @__PURE__ */ new Map();
15054
- activeCompiledMappings = /* @__PURE__ */ new Set();
15055
- processedBases = /* @__PURE__ */ new WeakMap();
15111
+ scopeMappings = /* @__PURE__ */ new Map();
15112
+ nextTableId = 1;
15113
+ pendingLinks = [];
15114
+ unlinkedPending = 0;
15115
+ releases = /* @__PURE__ */ new Map();
15116
+ settleQueued = false;
15056
15117
  pending = null;
15057
15118
  flushListener = null;
15058
15119
  }));
15059
15120
  //#endregion
15121
+ //#region ../web/dist/esm/setupHooks.native.js
15122
+ function setupHooks(next) {
15123
+ Object.assign(hooks, next);
15124
+ }
15125
+ var hooks;
15126
+ var init_setupHooks_native = __esmMin((() => {
15127
+ hooks = {};
15128
+ }));
15129
+ //#endregion
15060
15130
  //#region ../web/dist/esm/_withNativeStyle.native.js
15061
- var _excluded$7, _excluded2$3, _withNativeStyle;
15131
+ function mayRenderText(children) {
15132
+ if (children == null) return false;
15133
+ if (Array.isArray(children) && children.length <= 3) return children.some(function(child) {
15134
+ return child != null && typeof child === "object";
15135
+ });
15136
+ return typeof children === "object";
15137
+ }
15138
+ var _excluded$7, hostTextProps, _withNativeStyle;
15062
15139
  var init__withNativeStyle_native = __esmMin((() => {
15063
15140
  init_index_native$12();
15141
+ init_index_native$6();
15064
15142
  init__withStableStyle_native();
15065
15143
  init_nativeStyleEngine_native();
15066
15144
  init_useThemeState_native();
15067
- init_objectWithoutProperties();
15145
+ init_setupHooks_native();
15068
15146
  init_objectSpread2();
15069
- _excluded$7 = ["_scopeId"];
15070
- _excluded2$3 = ["ref", "_expressions"];
15071
- _withNativeStyle = function(Component, baseStyle, themeStyleKeys) {
15147
+ init_objectWithoutProperties();
15148
+ _excluded$7 = ["_expressions"];
15149
+ hostTextProps = {
15150
+ accessible: isAndroid ? false : isIos ? true : void 0,
15151
+ allowFontScaling: true,
15152
+ ellipsizeMode: "tail"
15153
+ };
15154
+ _withNativeStyle = function(Component, baseStyle, themeStyleKeys, host) {
15155
+ var _hooks_getBaseViews;
15072
15156
  var Fallback = _withStableStyle(Component, function(theme) {
15073
15157
  var themedStyle = {};
15074
15158
  for (var styleKey in themeStyleKeys) {
@@ -15077,40 +15161,72 @@ var init__withNativeStyle_native = __esmMin((() => {
15077
15161
  }
15078
15162
  return [baseStyle, themedStyle];
15079
15163
  }, true, false);
15080
- var Native = /* @__PURE__ */ react.default.memo(function NativeStyleView(param) {
15081
- var { _scopeId } = param, props = _objectWithoutProperties(param, _excluded$7);
15082
- var { ref, _expressions: _ignoredExpressions } = props, rest = _objectWithoutProperties(props, _excluded2$3);
15083
- var link = (0, react.useRef)(null);
15084
- var [refused, setRefused] = (0, react.useState)(false);
15085
- var themeState = getThemeState(_scopeId);
15086
- var stateName = themeState === null || themeState === void 0 ? void 0 : themeState.name;
15087
- var theme = themeState === null || themeState === void 0 ? void 0 : themeState.theme;
15088
- var hostRef = (0, react.useCallback)(function(host) {
15089
- var _link_current;
15090
- (_link_current = link.current) === null || _link_current === void 0 || _link_current.unlink();
15091
- link.current = null;
15092
- setRef(ref, host);
15093
- if (host && stateName && theme) {
15094
- link.current = linkNativeStyleMapping(host, baseStyle, themeStyleKeys, _scopeId, stateName, theme);
15095
- if (!link.current) setRefused(true);
15096
- }
15097
- }, [
15098
- ref,
15099
- _scopeId,
15100
- stateName,
15101
- theme
15102
- ]);
15103
- if (refused) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Fallback, _objectSpread2({}, props));
15104
- var stateStyle = stateName && theme ? resolveNativeStyleMapping(themeStyleKeys, stateName, theme) : void 0;
15105
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Component, _objectSpread2({
15106
- ref: hostRef,
15107
- style: [baseStyle, stateStyle]
15108
- }, rest));
15109
- });
15110
- return /* @__PURE__ */ react.default.memo(function NativeStyleBoundary(props) {
15111
- var scopeId = (0, react.useContext)(ThemeStateContext);
15112
- return getNativeStyleEngine() && scopeId ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Native, _objectSpread2(_objectSpread2({}, props), {}, { _scopeId: scopeId })) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Fallback, _objectSpread2({}, props));
15113
- });
15164
+ var baseViews = host ? (_hooks_getBaseViews = hooks.getBaseViews) === null || _hooks_getBaseViews === void 0 ? void 0 : _hooks_getBaseViews.call(hooks) : void 0;
15165
+ var TextAncestor = baseViews === null || baseViews === void 0 ? void 0 : baseViews.TextAncestor;
15166
+ var TextAncestorProvider = TextAncestor === null || TextAncestor === void 0 ? void 0 : TextAncestor.Provider;
15167
+ var HostText = host === "text" && !("userSelect" in baseStyle) && !("verticalAlign" in baseStyle) ? baseViews === null || baseViews === void 0 ? void 0 : baseViews.NativeText : void 0;
15168
+ var hostTextBase = HostText ? _objectSpread2(_objectSpread2({ overflow: "hidden" }, baseStyle), typeof baseStyle.fontWeight === "number" && { fontWeight: String(baseStyle.fontWeight) }) : baseStyle;
15169
+ var styles = /* @__PURE__ */ new Map();
15170
+ var hostTextStyles = /* @__PURE__ */ new Map();
15171
+ var ScopeContext = ThemeStateContext;
15172
+ var engineOf = getNativeStyleEngine;
15173
+ var scopeState = getThemeState;
15174
+ var resolve = resolveNativeStyleMapping;
15175
+ var linkMapping = linkNativeStyleMapping;
15176
+ var assignRef = setRef;
15177
+ var render = function(props, key) {
15178
+ var scopeId = (0, react.use)(ScopeContext);
15179
+ var inText = TextAncestor ? (0, react.use)(TextAncestor) : false;
15180
+ var themeState = scopeId && engineOf() ? scopeState(scopeId) : void 0;
15181
+ var resetsText = inText && host === "view";
15182
+ if (!themeState) return resetsText ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TextAncestorProvider, {
15183
+ value: false,
15184
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Fallback, _objectSpread2({}, props))
15185
+ }, key) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Fallback, _objectSpread2({}, props), key);
15186
+ var rest = props;
15187
+ if (props._expressions !== void 0) {
15188
+ var { _expressions: _ignoredExpressions } = props;
15189
+ rest = _objectWithoutProperties(props, _excluded$7);
15190
+ }
15191
+ var ref = props.ref;
15192
+ var { name, theme } = themeState;
15193
+ var asHostText = HostText && !inText;
15194
+ var Rendered = asHostText ? HostText : Component;
15195
+ var cache = asHostText ? hostTextStyles : styles;
15196
+ var style = cache.get(scopeId);
15197
+ if (!style) {
15198
+ style = [asHostText ? hostTextBase : baseStyle, null];
15199
+ cache.set(scopeId, style);
15200
+ }
15201
+ style[1] = resolve(themeStyleKeys, name, theme);
15202
+ var wrapped = resetsText || asHostText && mayRenderText(rest.children);
15203
+ var element = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Rendered, _objectSpread2(_objectSpread2(_objectSpread2({}, asHostText && hostTextProps), rest), {}, {
15204
+ ref: function(node) {
15205
+ var refCleanup;
15206
+ if (typeof ref === "function") refCleanup = ref(node);
15207
+ else assignRef(ref, node);
15208
+ var link = linkMapping(node, themeStyleKeys, scopeId, name, theme);
15209
+ return function() {
15210
+ link === null || link === void 0 || link.unlink();
15211
+ if (typeof refCleanup === "function") refCleanup();
15212
+ else assignRef(ref, null);
15213
+ };
15214
+ },
15215
+ style
15216
+ }), wrapped ? void 0 : key);
15217
+ if (!wrapped) return element;
15218
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TextAncestorProvider, {
15219
+ value: !resetsText,
15220
+ children: element
15221
+ }, key);
15222
+ };
15223
+ var NativeStyleView = function(props) {
15224
+ return render(props);
15225
+ };
15226
+ NativeStyleView.inline = function(element) {
15227
+ return render(element.props, element.key);
15228
+ };
15229
+ return NativeStyleView;
15114
15230
  };
15115
15231
  })), defaultComponentState, defaultComponentStateMounted;
15116
15232
  var init_defaultComponentState_native = __esmMin((() => {
@@ -18881,15 +18997,6 @@ var init_useSplitStyles_native = __esmMin((() => {
18881
18997
  };
18882
18998
  }));
18883
18999
  //#endregion
18884
- //#region ../web/dist/esm/setupHooks.native.js
18885
- function setupHooks(next) {
18886
- Object.assign(hooks, next);
18887
- }
18888
- var hooks;
18889
- var init_setupHooks_native = __esmMin((() => {
18890
- hooks = {};
18891
- }));
18892
- //#endregion
18893
19000
  //#region ../web/dist/esm/views/Slot.native.js
18894
19001
  function mergeSlotProps(child, slotProps) {
18895
19002
  var childProps = child.props;
@@ -23276,6 +23383,7 @@ function getBaseViews() {
23276
23383
  View: rn.View || ((_rn$default = rn.default) === null || _rn$default === void 0 ? void 0 : _rn$default.View),
23277
23384
  Text: rn.Text || ((_rn$default2 = rn.default) === null || _rn$default2 === void 0 ? void 0 : _rn$default2.Text),
23278
23385
  TextAncestor: rn.unstable_TextAncestorContext,
23386
+ NativeText: rn.unstable_NativeText,
23279
23387
  StyleSheet: rn.StyleSheet || ((_rn$default3 = rn.default) === null || _rn$default3 === void 0 ? void 0 : _rn$default3.StyleSheet),
23280
23388
  Pressable: rn.Pressable || ((_rn$default4 = rn.default) === null || _rn$default4 === void 0 ? void 0 : _rn$default4.Pressable)
23281
23389
  };
@@ -23621,6 +23729,7 @@ init_useThemeState_native();
23621
23729
  init_useTheme_native();
23622
23730
  init__withStableStyle_native();
23623
23731
  init_nativeStyleEngine_native();
23732
+ init_setupHooks_native();
23624
23733
  init__withNativeStyle_native();
23625
23734
  init_getCSSStylesAtomic_native();
23626
23735
  init_normalizeColor_native();
@@ -23634,7 +23743,6 @@ init_getSplitStyles_native();
23634
23743
  init_mergeSlotStyleProps_native();
23635
23744
  init_ClientOnly_native();
23636
23745
  init_index_native$2();
23637
- init_setupHooks_native();
23638
23746
  init_Slot_native();
23639
23747
  init_Theme_native();
23640
23748
  init_createComponent_native();
@@ -23712,6 +23820,7 @@ exports.cssShorthandLonghands = cssShorthandLonghands;
23712
23820
  exports.currentPlatform = currentPlatform;
23713
23821
  exports.defaultSizing = defaultSizing;
23714
23822
  exports.fluid = fluid;
23823
+ exports.flushNativeStyleLinks = flushNativeStyleLinks;
23715
23824
  exports.forceUpdateThemes = forceUpdateThemes;
23716
23825
  exports.formatDiagnostic = formatDiagnostic;
23717
23826
  exports.getAutoVariableCSS = getAutoVariableCSS;
@@ -3729,14 +3729,14 @@ If this is intended and you are using Tamagui without any themes, you can disabl
3729
3729
  //#endregion
3730
3730
  //#region ../web/dist/esm/_withStableStyle.native.js
3731
3731
  var _excluded$8 = ["ref"];
3732
- var _excluded2$4 = ["_expressions"];
3732
+ var _excluded2$3 = ["_expressions"];
3733
3733
  var EMPTY_EXPRESSIONS = [];
3734
3734
  var EMPTY_THEME = {};
3735
3735
  var FALLBACK_THEME_CACHE = /* @__PURE__ */ new WeakMap();
3736
3736
  var _withStableStyle = function(Component, createStyle, hasThemeKeys, hasMediaKeys) {
3737
3737
  return /* @__PURE__ */ react.default.memo(function WithStableStyle(props) {
3738
3738
  var { ref } = props, propsWithoutRef = _objectWithoutProperties(props, _excluded$8);
3739
- var { _expressions = EMPTY_EXPRESSIONS } = propsWithoutRef, rest = _objectWithoutProperties(propsWithoutRef, _excluded2$4);
3739
+ var { _expressions = EMPTY_EXPRESSIONS } = propsWithoutRef, rest = _objectWithoutProperties(propsWithoutRef, _excluded2$3);
3740
3740
  var parentId = (0, react.useContext)(ThemeStateContext);
3741
3741
  var theme = hasThemeKeys && parentId ? useTheme() : null;
3742
3742
  var media = hasMediaKeys ? useMedia() : null;
@@ -3844,8 +3844,8 @@ var engine = null;
3844
3844
  var scopeStates = /* @__PURE__ */ new Map();
3845
3845
  var mappingKeys = /* @__PURE__ */ new WeakMap();
3846
3846
  var compiledMappings = /* @__PURE__ */ new Map();
3847
- var activeCompiledMappings = /* @__PURE__ */ new Set();
3848
- var processedBases = /* @__PURE__ */ new WeakMap();
3847
+ var scopeMappings = /* @__PURE__ */ new Map();
3848
+ var nextTableId = 1;
3849
3849
  function getCompiledMapping(mapping) {
3850
3850
  var key = mappingKeys.get(mapping);
3851
3851
  if (!key) {
@@ -3859,7 +3859,8 @@ function getCompiledMapping(mapping) {
3859
3859
  compiled = {
3860
3860
  mapping,
3861
3861
  states: /* @__PURE__ */ new Map(),
3862
- links: /* @__PURE__ */ new Set()
3862
+ tableId: nextTableId++,
3863
+ sent: /* @__PURE__ */ new Map()
3863
3864
  };
3864
3865
  if (compiledMappings.size >= 1e4) compiledMappings.clear();
3865
3866
  compiledMappings.set(key, compiled);
@@ -3877,22 +3878,7 @@ function resolveCompiledMapping(compiled, stateName, theme) {
3877
3878
  renderProps = normalizeNativeStyle(renderProps, true);
3878
3879
  var _engine_processStyleColors;
3879
3880
  var nativeProps = (_engine_processStyleColors = engine === null || engine === void 0 ? void 0 : engine.processStyleColors(renderProps)) !== null && _engine_processStyleColors !== void 0 ? _engine_processStyleColors : renderProps;
3880
- if (compiled.states.size >= 1e4) {
3881
- compiled.states.clear();
3882
- var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
3883
- try {
3884
- for (var _iterator = compiled.links[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) _step.value.stateThemes.clear();
3885
- } catch (err) {
3886
- _didIteratorError = true;
3887
- _iteratorError = err;
3888
- } finally {
3889
- try {
3890
- if (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();
3891
- } finally {
3892
- if (_didIteratorError) throw _iteratorError;
3893
- }
3894
- }
3895
- }
3881
+ if (compiled.states.size >= 1e4) compiled.states.clear();
3896
3882
  var resolved = {
3897
3883
  theme,
3898
3884
  renderProps,
@@ -3901,10 +3887,19 @@ function resolveCompiledMapping(compiled, stateName, theme) {
3901
3887
  compiled.states.set(stateName, resolved);
3902
3888
  return resolved;
3903
3889
  }
3890
+ function syncTableState(compiled, stateName, theme) {
3891
+ var resolved = resolveCompiledMapping(compiled, stateName, theme);
3892
+ if (compiled.sent.get(stateName) === resolved) return;
3893
+ compiled.sent.set(stateName, resolved);
3894
+ engine.setTableState(compiled.tableId, stateName, resolved.nativeProps);
3895
+ }
3904
3896
  function setNativeStyleEngine(next) {
3905
3897
  if (engine !== next) {
3898
+ settleReleases();
3906
3899
  compiledMappings.clear();
3907
- activeCompiledMappings.clear();
3900
+ scopeMappings.clear();
3901
+ pendingLinks = [];
3902
+ unlinkedPending = 0;
3908
3903
  }
3909
3904
  engine = next;
3910
3905
  if (next) {
@@ -3932,53 +3927,31 @@ function getNativeStyleEngine() {
3932
3927
  function updateNativeStyleScope(scopeId, stateName, theme) {
3933
3928
  var previous = scopeStates.get(scopeId);
3934
3929
  if ((previous === null || previous === void 0 ? void 0 : previous.name) === stateName && previous.theme === theme) return;
3930
+ flushNativeStyleLinks();
3935
3931
  scopeStates.set(scopeId, {
3936
3932
  name: stateName,
3937
3933
  theme
3938
3934
  });
3939
3935
  if (engine) {
3940
- var entries = [];
3941
- var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
3942
- try {
3943
- for (var _iterator = activeCompiledMappings[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
3944
- var compiled = _step.value;
3945
- var props = void 0;
3946
- var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;
3936
+ var linked = scopeMappings.get(scopeId);
3937
+ if (linked) {
3938
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
3939
+ try {
3940
+ for (var _iterator = linked.keys()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
3941
+ var compiled = _step.value;
3942
+ syncTableState(compiled, stateName, theme);
3943
+ }
3944
+ } catch (err) {
3945
+ _didIteratorError = true;
3946
+ _iteratorError = err;
3947
+ } finally {
3947
3948
  try {
3948
- for (var _iterator1 = compiled.links[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {
3949
- var link = _step1.value;
3950
- if (link.scopeId !== scopeId) continue;
3951
- if (link.stateThemes.get(stateName) === theme) continue;
3952
- props || (props = resolveCompiledMapping(compiled, stateName, theme).nativeProps);
3953
- entries.push({
3954
- id: link.handle.id,
3955
- state: stateName,
3956
- props
3957
- });
3958
- link.stateThemes.set(stateName, theme);
3959
- }
3960
- } catch (err) {
3961
- _didIteratorError1 = true;
3962
- _iteratorError1 = err;
3949
+ if (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();
3963
3950
  } finally {
3964
- try {
3965
- if (!_iteratorNormalCompletion1 && _iterator1.return != null) _iterator1.return();
3966
- } finally {
3967
- if (_didIteratorError1) throw _iteratorError1;
3968
- }
3951
+ if (_didIteratorError) throw _iteratorError;
3969
3952
  }
3970
3953
  }
3971
- } catch (err) {
3972
- _didIteratorError = true;
3973
- _iteratorError = err;
3974
- } finally {
3975
- try {
3976
- if (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();
3977
- } finally {
3978
- if (_didIteratorError) throw _iteratorError;
3979
- }
3980
3954
  }
3981
- if (entries.length) engine.updateViewStateTables(entries);
3982
3955
  }
3983
3956
  engine === null || engine === void 0 || engine.setStateName(stateName, scopeId);
3984
3957
  }
@@ -3989,32 +3962,43 @@ function removeNativeStyleScope(scopeId) {
3989
3962
  function resolveNativeStyleMapping(mapping, stateName, theme) {
3990
3963
  return resolveCompiledMapping(getCompiledMapping(mapping), stateName, theme).renderProps;
3991
3964
  }
3992
- function linkNativeStyleMapping(ref, baseStyle, mapping, scopeId, stateName, theme) {
3993
- if (!engine) return null;
3994
- var compiled = getCompiledMapping(mapping);
3995
- var scopeState = scopeStates.get(scopeId);
3996
- var _scopeState_name;
3997
- var currentStateName = (_scopeState_name = scopeState === null || scopeState === void 0 ? void 0 : scopeState.name) !== null && _scopeState_name !== void 0 ? _scopeState_name : stateName;
3998
- var _scopeState_theme;
3999
- var currentTheme = (_scopeState_theme = scopeState === null || scopeState === void 0 ? void 0 : scopeState.theme) !== null && _scopeState_theme !== void 0 ? _scopeState_theme : theme;
4000
- var stale = currentStateName !== stateName || currentTheme !== theme;
4001
- var stateProps = resolveCompiledMapping(compiled, currentStateName, currentTheme).nativeProps;
4002
- var base = processedBases.get(baseStyle);
4003
- if (!base || base.engine !== engine) {
4004
- base = {
4005
- engine,
4006
- props: engine.processStyleColors(normalizeNativeStyle(baseStyle))
4007
- };
4008
- processedBases.set(baseStyle, base);
3965
+ var pendingLinks = [];
3966
+ var unlinkedPending = 0;
3967
+ function trackScopeMapping(link, delta) {
3968
+ var linked = scopeMappings.get(link.scopeId);
3969
+ if (!linked) scopeMappings.set(link.scopeId, linked = /* @__PURE__ */ new Map());
3970
+ var _linked_get;
3971
+ var count = ((_linked_get = linked.get(link.compiled)) !== null && _linked_get !== void 0 ? _linked_get : 0) + delta;
3972
+ if (count) linked.set(link.compiled, count);
3973
+ else {
3974
+ linked.delete(link.compiled);
3975
+ if (!linked.size) scopeMappings.delete(link.scopeId);
4009
3976
  }
4010
- var state = {};
4011
- var stateThemes = /* @__PURE__ */ new Map();
3977
+ }
3978
+ function flushNativeStyleLinks() {
3979
+ settleReleases();
3980
+ if (!pendingLinks.length) return;
3981
+ var links = pendingLinks;
3982
+ pendingLinks = [];
3983
+ unlinkedPending = 0;
3984
+ if (!engine) return;
3985
+ var live = links.filter(function(link2) {
3986
+ return link2.id === 0;
3987
+ });
3988
+ if (!live.length) return;
3989
+ var refs = [];
3990
+ var tableIds = [];
3991
+ var scopeIndexes = [];
3992
+ var scopes = [];
4012
3993
  var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
4013
3994
  try {
4014
- for (var _iterator = compiled.states[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
4015
- var [name, cached] = _step.value;
4016
- state[name] = cached.nativeProps;
4017
- stateThemes.set(name, cached.theme);
3995
+ for (var _iterator = live[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
3996
+ var link = _step.value;
3997
+ var scopeIndex = scopes.indexOf(link.scopeId);
3998
+ if (scopeIndex === -1) scopeIndex = scopes.push(link.scopeId) - 1;
3999
+ refs.push(link.ref);
4000
+ tableIds.push(link.compiled.tableId);
4001
+ scopeIndexes.push(scopeIndex);
4018
4002
  }
4019
4003
  } catch (err) {
4020
4004
  _didIteratorError = true;
@@ -4026,33 +4010,110 @@ function linkNativeStyleMapping(ref, baseStyle, mapping, scopeId, stateName, the
4026
4010
  if (_didIteratorError) throw _iteratorError;
4027
4011
  }
4028
4012
  }
4029
- state[currentStateName] = stateProps;
4030
- stateThemes.set(currentStateName, currentTheme);
4031
- var handle = engine.link(ref, {
4032
- base: base.props,
4033
- state
4034
- }, scopeId);
4035
- if (!handle) return null;
4036
- if (stale) engine.updateViewStateTables([{
4037
- id: handle.id,
4038
- state: currentStateName,
4039
- props: stateProps
4040
- }]);
4041
- var link = {
4042
- handle,
4043
- scopeId,
4044
- stateThemes
4045
- };
4046
- compiled.links.add(link);
4047
- activeCompiledMappings.add(compiled);
4048
- return {
4049
- id: handle.id,
4013
+ var firstId = engine.linkTables(refs, tableIds, scopeIndexes, scopes);
4014
+ for (var i = 0; i < live.length; i++) {
4015
+ var link1 = live[i];
4016
+ link1.id = firstId + i;
4017
+ link1.owner = engine;
4018
+ link1.ref = null;
4019
+ trackScopeMapping(link1, 1);
4020
+ }
4021
+ }
4022
+ var releases = /* @__PURE__ */ new Map();
4023
+ var settleQueued = false;
4024
+ function settleReleases() {
4025
+ settleQueued = false;
4026
+ if (!releases.size) return;
4027
+ var settling = [...releases.values()];
4028
+ releases.clear();
4029
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
4030
+ try {
4031
+ for (var _iterator = settling[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) _step.value.settle();
4032
+ } catch (err) {
4033
+ _didIteratorError = true;
4034
+ _iteratorError = err;
4035
+ } finally {
4036
+ try {
4037
+ if (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();
4038
+ } finally {
4039
+ if (_didIteratorError) throw _iteratorError;
4040
+ }
4041
+ }
4042
+ }
4043
+ function releasable(ref, compiled, scopeId, id, settle) {
4044
+ var handle = {
4045
+ id,
4050
4046
  unlink: function() {
4051
- compiled.links.delete(link);
4052
- if (!compiled.links.size) activeCompiledMappings.delete(compiled);
4053
- handle.unlink();
4047
+ var prior = releases.get(ref);
4048
+ if (prior && prior.handle !== handle) prior.settle();
4049
+ releases.set(ref, {
4050
+ compiled,
4051
+ scopeId,
4052
+ handle,
4053
+ settle
4054
+ });
4055
+ if (!settleQueued) {
4056
+ settleQueued = true;
4057
+ queueMicrotask(settleReleases);
4058
+ }
4054
4059
  }
4055
4060
  };
4061
+ return handle;
4062
+ }
4063
+ function linkNativeStyleMapping(ref, mapping, scopeId, stateName, theme) {
4064
+ if (!engine) return null;
4065
+ var compiled = getCompiledMapping(mapping);
4066
+ var scopeState = scopeStates.get(scopeId);
4067
+ var stale = scopeState && (scopeState.name !== stateName || scopeState.theme !== theme);
4068
+ var kept = releases.get(ref);
4069
+ if (kept) {
4070
+ releases.delete(ref);
4071
+ if (!stale && kept.compiled === compiled && kept.scopeId === scopeId) return kept.handle;
4072
+ kept.settle();
4073
+ }
4074
+ if (stale) {
4075
+ syncTableState(compiled, scopeState.name, scopeState.theme);
4076
+ var handle = engine.link(ref, compiled.tableId, scopeId, true);
4077
+ if (!handle) return null;
4078
+ var link = {
4079
+ ref: null,
4080
+ compiled,
4081
+ scopeId,
4082
+ id: handle.id,
4083
+ owner: engine
4084
+ };
4085
+ trackScopeMapping(link, 1);
4086
+ return releasable(ref, compiled, scopeId, handle.id, function() {
4087
+ if (link.id === -1) return;
4088
+ link.id = -1;
4089
+ if (link.owner === engine) trackScopeMapping(link, -1);
4090
+ handle.unlink();
4091
+ });
4092
+ }
4093
+ syncTableState(compiled, stateName, theme);
4094
+ var link1 = {
4095
+ ref,
4096
+ compiled,
4097
+ scopeId,
4098
+ id: 0,
4099
+ owner: null
4100
+ };
4101
+ pendingLinks.push(link1);
4102
+ return releasable(ref, compiled, scopeId, 0, function() {
4103
+ var id = link1.id;
4104
+ if (id === -1) return;
4105
+ link1.id = -1;
4106
+ link1.ref = null;
4107
+ if (id > 0) {
4108
+ if (link1.owner === engine) trackScopeMapping(link1, -1);
4109
+ link1.owner.unlink(id);
4110
+ } else if (++unlinkedPending > 512 && unlinkedPending * 2 > pendingLinks.length) {
4111
+ pendingLinks = pendingLinks.filter(function(pending2) {
4112
+ return pending2.id === 0;
4113
+ });
4114
+ unlinkedPending = 0;
4115
+ }
4116
+ });
4056
4117
  }
4057
4118
  var pending = null;
4058
4119
  var flushListener = null;
@@ -4081,10 +4142,21 @@ function queueNativeViewState(entry) {
4081
4142
  pending.push(entry);
4082
4143
  }
4083
4144
  //#endregion
4145
+ //#region ../web/dist/esm/setupHooks.native.js
4146
+ var hooks = {};
4147
+ function setupHooks(next) {
4148
+ Object.assign(hooks, next);
4149
+ }
4150
+ //#endregion
4084
4151
  //#region ../web/dist/esm/_withNativeStyle.native.js
4085
- var _excluded$7 = ["_scopeId"];
4086
- var _excluded2$3 = ["ref", "_expressions"];
4087
- var _withNativeStyle = function(Component, baseStyle, themeStyleKeys) {
4152
+ var _excluded$7 = ["_expressions"];
4153
+ var hostTextProps = {
4154
+ accessible: isAndroid ? false : isIos ? true : void 0,
4155
+ allowFontScaling: true,
4156
+ ellipsizeMode: "tail"
4157
+ };
4158
+ var _withNativeStyle = function(Component, baseStyle, themeStyleKeys, host) {
4159
+ var _hooks_getBaseViews;
4088
4160
  var Fallback = _withStableStyle(Component, function(theme) {
4089
4161
  var themedStyle = {};
4090
4162
  for (var styleKey in themeStyleKeys) {
@@ -4093,42 +4165,80 @@ var _withNativeStyle = function(Component, baseStyle, themeStyleKeys) {
4093
4165
  }
4094
4166
  return [baseStyle, themedStyle];
4095
4167
  }, true, false);
4096
- var Native = /* @__PURE__ */ react.default.memo(function NativeStyleView(param) {
4097
- var { _scopeId } = param, props = _objectWithoutProperties(param, _excluded$7);
4098
- var { ref, _expressions: _ignoredExpressions } = props, rest = _objectWithoutProperties(props, _excluded2$3);
4099
- var link = (0, react.useRef)(null);
4100
- var [refused, setRefused] = (0, react.useState)(false);
4101
- var themeState = getThemeState(_scopeId);
4102
- var stateName = themeState === null || themeState === void 0 ? void 0 : themeState.name;
4103
- var theme = themeState === null || themeState === void 0 ? void 0 : themeState.theme;
4104
- var hostRef = (0, react.useCallback)(function(host) {
4105
- var _link_current;
4106
- (_link_current = link.current) === null || _link_current === void 0 || _link_current.unlink();
4107
- link.current = null;
4108
- setRef(ref, host);
4109
- if (host && stateName && theme) {
4110
- link.current = linkNativeStyleMapping(host, baseStyle, themeStyleKeys, _scopeId, stateName, theme);
4111
- if (!link.current) setRefused(true);
4112
- }
4113
- }, [
4114
- ref,
4115
- _scopeId,
4116
- stateName,
4117
- theme
4118
- ]);
4119
- if (refused) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Fallback, _objectSpread2({}, props));
4120
- var stateStyle = stateName && theme ? resolveNativeStyleMapping(themeStyleKeys, stateName, theme) : void 0;
4121
- if (globalThis.process.env.NODE_ENV === "development" && (!stateName || !theme)) throw new Error(`[@tamagui/core] native fast path cannot resolve theme ${JSON.stringify(stateName)}`);
4122
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Component, _objectSpread2({
4123
- ref: hostRef,
4124
- style: [baseStyle, stateStyle]
4125
- }, rest));
4126
- });
4127
- return /* @__PURE__ */ react.default.memo(function NativeStyleBoundary(props) {
4128
- var scopeId = (0, react.useContext)(ThemeStateContext);
4129
- return getNativeStyleEngine() && scopeId ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Native, _objectSpread2(_objectSpread2({}, props), {}, { _scopeId: scopeId })) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Fallback, _objectSpread2({}, props));
4130
- });
4168
+ var baseViews = host ? (_hooks_getBaseViews = hooks.getBaseViews) === null || _hooks_getBaseViews === void 0 ? void 0 : _hooks_getBaseViews.call(hooks) : void 0;
4169
+ var TextAncestor = baseViews === null || baseViews === void 0 ? void 0 : baseViews.TextAncestor;
4170
+ var TextAncestorProvider = TextAncestor === null || TextAncestor === void 0 ? void 0 : TextAncestor.Provider;
4171
+ var HostText = host === "text" && !("userSelect" in baseStyle) && !("verticalAlign" in baseStyle) ? baseViews === null || baseViews === void 0 ? void 0 : baseViews.NativeText : void 0;
4172
+ var hostTextBase = HostText ? _objectSpread2(_objectSpread2({ overflow: "hidden" }, baseStyle), typeof baseStyle.fontWeight === "number" && { fontWeight: String(baseStyle.fontWeight) }) : baseStyle;
4173
+ var styles = /* @__PURE__ */ new Map();
4174
+ var hostTextStyles = /* @__PURE__ */ new Map();
4175
+ var ScopeContext = ThemeStateContext;
4176
+ var engineOf = getNativeStyleEngine;
4177
+ var scopeState = getThemeState;
4178
+ var resolve = resolveNativeStyleMapping;
4179
+ var linkMapping = linkNativeStyleMapping;
4180
+ var assignRef = setRef;
4181
+ var render = function(props, key) {
4182
+ var scopeId = (0, react.use)(ScopeContext);
4183
+ var inText = TextAncestor ? (0, react.use)(TextAncestor) : false;
4184
+ var themeState = scopeId && engineOf() ? scopeState(scopeId) : void 0;
4185
+ var resetsText = inText && host === "view";
4186
+ if (!themeState) return resetsText ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TextAncestorProvider, {
4187
+ value: false,
4188
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Fallback, _objectSpread2({}, props))
4189
+ }, key) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Fallback, _objectSpread2({}, props), key);
4190
+ var rest = props;
4191
+ if (props._expressions !== void 0) {
4192
+ var { _expressions: _ignoredExpressions } = props;
4193
+ rest = _objectWithoutProperties(props, _excluded$7);
4194
+ }
4195
+ var ref = props.ref;
4196
+ var { name, theme } = themeState;
4197
+ var asHostText = HostText && !inText;
4198
+ var Rendered = asHostText ? HostText : Component;
4199
+ var cache = asHostText ? hostTextStyles : styles;
4200
+ var style = cache.get(scopeId);
4201
+ if (!style) {
4202
+ style = [asHostText ? hostTextBase : baseStyle, null];
4203
+ cache.set(scopeId, style);
4204
+ }
4205
+ style[1] = resolve(themeStyleKeys, name, theme);
4206
+ var wrapped = resetsText || asHostText && mayRenderText(rest.children);
4207
+ var element = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Rendered, _objectSpread2(_objectSpread2(_objectSpread2({}, asHostText && hostTextProps), rest), {}, {
4208
+ ref: function(node) {
4209
+ var refCleanup;
4210
+ if (typeof ref === "function") refCleanup = ref(node);
4211
+ else assignRef(ref, node);
4212
+ var link = linkMapping(node, themeStyleKeys, scopeId, name, theme);
4213
+ return function() {
4214
+ link === null || link === void 0 || link.unlink();
4215
+ if (typeof refCleanup === "function") refCleanup();
4216
+ else assignRef(ref, null);
4217
+ };
4218
+ },
4219
+ style
4220
+ }), wrapped ? void 0 : key);
4221
+ if (!wrapped) return element;
4222
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TextAncestorProvider, {
4223
+ value: !resetsText,
4224
+ children: element
4225
+ }, key);
4226
+ };
4227
+ var NativeStyleView = function(props) {
4228
+ return render(props);
4229
+ };
4230
+ NativeStyleView.inline = function(element) {
4231
+ return render(element.props, element.key);
4232
+ };
4233
+ return NativeStyleView;
4131
4234
  };
4235
+ function mayRenderText(children) {
4236
+ if (children == null) return false;
4237
+ if (Array.isArray(children) && children.length <= 3) return children.some(function(child) {
4238
+ return child != null && typeof child === "object";
4239
+ });
4240
+ return typeof children === "object";
4241
+ }
4132
4242
  //#endregion
4133
4243
  //#region ../web/dist/esm/constants/isDevTools.native.js
4134
4244
  var isDevTools = (function() {
@@ -8328,12 +8438,6 @@ var useSplitStyles = function(a, b, c, d, e, f, g, h, i, j, k, l, m, n) {
8328
8438
  return res;
8329
8439
  };
8330
8440
  //#endregion
8331
- //#region ../web/dist/esm/setupHooks.native.js
8332
- var hooks = {};
8333
- function setupHooks(next) {
8334
- Object.assign(hooks, next);
8335
- }
8336
- //#endregion
8337
8441
  //#region ../web/dist/esm/views/Slot.native.js
8338
8442
  var _excluded$6 = ["children"];
8339
8443
  var Slot = /* @__PURE__ */ (0, react.memo)(createRefComponent(function Slot2(props, forwardedRef) {
@@ -12953,6 +13057,7 @@ function getBaseViews() {
12953
13057
  View: rn.View || ((_rn$default = rn.default) === null || _rn$default === void 0 ? void 0 : _rn$default.View),
12954
13058
  Text: rn.Text || ((_rn$default2 = rn.default) === null || _rn$default2 === void 0 ? void 0 : _rn$default2.Text),
12955
13059
  TextAncestor: rn.unstable_TextAncestorContext,
13060
+ NativeText: rn.unstable_NativeText,
12956
13061
  StyleSheet: rn.StyleSheet || ((_rn$default3 = rn.default) === null || _rn$default3 === void 0 ? void 0 : _rn$default3.StyleSheet),
12957
13062
  Pressable: rn.Pressable || ((_rn$default4 = rn.default) === null || _rn$default4 === void 0 ? void 0 : _rn$default4.Pressable)
12958
13063
  };
@@ -13322,6 +13427,7 @@ exports.cssShorthandLonghands = cssShorthandLonghands;
13322
13427
  exports.currentPlatform = currentPlatform;
13323
13428
  exports.defaultSizing = defaultSizing;
13324
13429
  exports.fluid = fluid;
13430
+ exports.flushNativeStyleLinks = flushNativeStyleLinks;
13325
13431
  exports.forceUpdateThemes = forceUpdateThemes;
13326
13432
  exports.formatDiagnostic = formatDiagnostic;
13327
13433
  exports.getAutoVariableCSS = getAutoVariableCSS;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/core",
3
- "version": "3.0.3",
3
+ "version": "3.0.5",
4
4
  "gitHead": "a49cc7ea6b93ba384e77a4880ae48ac4a5635c14",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -137,19 +137,19 @@
137
137
  "clean:build": "tamagui-build clean:build"
138
138
  },
139
139
  "dependencies": {
140
- "@tamagui/compose-refs": "3.0.3",
141
- "@tamagui/constants": "3.0.3",
142
- "@tamagui/helpers": "3.0.3",
143
- "@tamagui/react-native-media-driver": "3.0.3",
144
- "@tamagui/react-native-use-pressable": "3.0.3",
145
- "@tamagui/use-element-layout": "3.0.3",
146
- "@tamagui/use-event": "3.0.3",
147
- "@tamagui/web": "3.0.3"
140
+ "@tamagui/compose-refs": "3.0.5",
141
+ "@tamagui/constants": "3.0.5",
142
+ "@tamagui/helpers": "3.0.5",
143
+ "@tamagui/react-native-media-driver": "3.0.5",
144
+ "@tamagui/react-native-use-pressable": "3.0.5",
145
+ "@tamagui/use-element-layout": "3.0.5",
146
+ "@tamagui/use-event": "3.0.5",
147
+ "@tamagui/web": "3.0.5"
148
148
  },
149
149
  "devDependencies": {
150
- "@tamagui/build": "3.0.3",
151
- "@tamagui/native-bundle": "3.0.3",
152
- "@tamagui/react-native-web-lite": "3.0.3",
150
+ "@tamagui/build": "3.0.5",
151
+ "@tamagui/native-bundle": "3.0.5",
152
+ "@tamagui/react-native-web-lite": "3.0.5",
153
153
  "@testing-library/react": "^16.1.0",
154
154
  "csstype": "^3.0.10",
155
155
  "react": "19.2.3",
@@ -164,5 +164,5 @@
164
164
  "./dist/cjs": "./dist/esm/index.native.js",
165
165
  "./theme-update": "./dist/esm/theme-update.native.js"
166
166
  },
167
- "releaseSourceCommit": "fbdb8553a66ed741b2aee6df317828cbbd2f96b1"
167
+ "releaseSourceCommit": "2500e65729dfd41ce27b4b3271f22f9c1d1ff5a3"
168
168
  }
@@ -12,6 +12,7 @@ export function getBaseViews() {
12
12
  View: rn.View || rn.default?.View,
13
13
  Text: rn.Text || rn.default?.Text,
14
14
  TextAncestor: rn.unstable_TextAncestorContext,
15
+ NativeText: rn.unstable_NativeText,
15
16
  StyleSheet: rn.StyleSheet || rn.default?.StyleSheet,
16
17
  Pressable: rn.Pressable || rn.default?.Pressable,
17
18
  }
@@ -2,6 +2,7 @@ export declare function getBaseViews(): {
2
2
  View: any;
3
3
  Text: any;
4
4
  TextAncestor: any;
5
+ NativeText: any;
5
6
  StyleSheet: any;
6
7
  Pressable: any;
7
8
  };
@@ -1 +1 @@
1
- {"version":3,"file":"getBaseViews.native.d.ts","sourceRoot":"","sources":["../src/getBaseViews.native.ts"],"names":[],"mappings":"AAOA,wBAAgB,YAAY;IAIxB,IAAI;IACJ,IAAI;IACJ,YAAY;IACZ,UAAU;IACV,SAAS;EAEZ"}
1
+ {"version":3,"file":"getBaseViews.native.d.ts","sourceRoot":"","sources":["../src/getBaseViews.native.ts"],"names":[],"mappings":"AAOA,wBAAgB,YAAY;IAIxB,IAAI;IACJ,IAAI;IACJ,YAAY;IACZ,UAAU;IACV,UAAU;IACV,SAAS;EAEZ"}