@tamagui/web 3.0.0-beta.661.1 → 3.0.0-beta.669.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/dist/cjs/createComponent.cjs +1 -1
  2. package/dist/cjs/createComponent.native.cjs +1 -1
  3. package/dist/cjs/createComponent.native.js +1 -1
  4. package/dist/cjs/createComponent.native.js.map +1 -1
  5. package/dist/cjs/createTamagui.cjs +1 -1
  6. package/dist/cjs/createTamagui.native.cjs +1 -1
  7. package/dist/cjs/createTamagui.native.js +1 -1
  8. package/dist/cjs/createTamagui.native.js.map +1 -1
  9. package/dist/cjs/helpers/directStyle.cjs +12 -12
  10. package/dist/cjs/helpers/directStyle.native.cjs +12 -12
  11. package/dist/cjs/helpers/directStyle.native.js +12 -12
  12. package/dist/cjs/helpers/directStyle.native.js.map +1 -1
  13. package/dist/cjs/helpers/formatDiagnostic.cjs +3 -0
  14. package/dist/cjs/helpers/formatDiagnostic.native.cjs +3 -0
  15. package/dist/cjs/helpers/formatDiagnostic.native.js +3 -0
  16. package/dist/cjs/helpers/formatDiagnostic.native.js.map +1 -1
  17. package/dist/cjs/helpers/getSplitStyles.cjs +2 -2
  18. package/dist/cjs/helpers/getSplitStyles.native.cjs +2 -2
  19. package/dist/cjs/helpers/getSplitStyles.native.js +2 -2
  20. package/dist/cjs/helpers/getSplitStyles.native.js.map +1 -1
  21. package/dist/cjs/helpers/mergeVariants.cjs +1 -1
  22. package/dist/cjs/helpers/mergeVariants.native.cjs +1 -1
  23. package/dist/cjs/helpers/mergeVariants.native.js +1 -1
  24. package/dist/cjs/helpers/mergeVariants.native.js.map +1 -1
  25. package/dist/cjs/helpers/propMapper.cjs +2 -2
  26. package/dist/cjs/helpers/propMapper.native.cjs +2 -2
  27. package/dist/cjs/helpers/propMapper.native.js +2 -2
  28. package/dist/cjs/helpers/propMapper.native.js.map +1 -1
  29. package/dist/cjs/hooks/getThemeProxied.native.cjs +1 -1
  30. package/dist/cjs/hooks/getThemeProxied.native.js +1 -1
  31. package/dist/cjs/hooks/getThemeProxied.native.js.map +1 -1
  32. package/dist/cjs/hooks/useComponentState.cjs +2 -2
  33. package/dist/cjs/hooks/useComponentState.native.cjs +2 -2
  34. package/dist/cjs/hooks/useComponentState.native.js +2 -2
  35. package/dist/cjs/hooks/useComponentState.native.js.map +1 -1
  36. package/dist/cjs/hooks/useProps.cjs +1 -1
  37. package/dist/cjs/hooks/useProps.native.cjs +1 -1
  38. package/dist/cjs/hooks/useProps.native.js +1 -1
  39. package/dist/cjs/hooks/useProps.native.js.map +1 -1
  40. package/dist/cjs/hooks/useThemeState.cjs +2 -2
  41. package/dist/cjs/hooks/useThemeState.native.cjs +2 -2
  42. package/dist/cjs/hooks/useThemeState.native.js +2 -2
  43. package/dist/cjs/hooks/useThemeState.native.js.map +1 -1
  44. package/dist/cjs/internal-runtime.cjs +3 -1
  45. package/dist/cjs/internal-runtime.native.cjs +3 -1
  46. package/dist/cjs/internal-runtime.native.js +3 -1
  47. package/dist/cjs/internal-runtime.native.js.map +1 -1
  48. package/dist/cjs/views/Theme.cjs +1 -1
  49. package/dist/cjs/views/Theme.native.cjs +1 -1
  50. package/dist/cjs/views/Theme.native.js +1 -1
  51. package/dist/cjs/views/Theme.native.js.map +1 -1
  52. package/dist/esm/createComponent.mjs +1 -1
  53. package/dist/esm/createComponent.mjs.map +1 -1
  54. package/dist/esm/createComponent.native.js +1 -1
  55. package/dist/esm/createComponent.native.js.map +1 -1
  56. package/dist/esm/createTamagui.mjs +1 -1
  57. package/dist/esm/createTamagui.mjs.map +1 -1
  58. package/dist/esm/createTamagui.native.js +1 -1
  59. package/dist/esm/createTamagui.native.js.map +1 -1
  60. package/dist/esm/helpers/directStyle.mjs +13 -13
  61. package/dist/esm/helpers/directStyle.mjs.map +1 -1
  62. package/dist/esm/helpers/directStyle.native.js +13 -13
  63. package/dist/esm/helpers/directStyle.native.js.map +1 -1
  64. package/dist/esm/helpers/formatDiagnostic.mjs +3 -0
  65. package/dist/esm/helpers/formatDiagnostic.mjs.map +1 -1
  66. package/dist/esm/helpers/formatDiagnostic.native.js +3 -0
  67. package/dist/esm/helpers/formatDiagnostic.native.js.map +1 -1
  68. package/dist/esm/helpers/getSplitStyles.mjs +2 -2
  69. package/dist/esm/helpers/getSplitStyles.mjs.map +1 -1
  70. package/dist/esm/helpers/getSplitStyles.native.js +2 -2
  71. package/dist/esm/helpers/getSplitStyles.native.js.map +1 -1
  72. package/dist/esm/helpers/mergeVariants.mjs +1 -1
  73. package/dist/esm/helpers/mergeVariants.mjs.map +1 -1
  74. package/dist/esm/helpers/mergeVariants.native.js +1 -1
  75. package/dist/esm/helpers/mergeVariants.native.js.map +1 -1
  76. package/dist/esm/helpers/propMapper.mjs +2 -2
  77. package/dist/esm/helpers/propMapper.mjs.map +1 -1
  78. package/dist/esm/helpers/propMapper.native.js +2 -2
  79. package/dist/esm/helpers/propMapper.native.js.map +1 -1
  80. package/dist/esm/hooks/getThemeProxied.native.js +1 -1
  81. package/dist/esm/hooks/getThemeProxied.native.js.map +1 -1
  82. package/dist/esm/hooks/useComponentState.mjs +2 -2
  83. package/dist/esm/hooks/useComponentState.mjs.map +1 -1
  84. package/dist/esm/hooks/useComponentState.native.js +2 -2
  85. package/dist/esm/hooks/useComponentState.native.js.map +1 -1
  86. package/dist/esm/hooks/useProps.mjs +1 -1
  87. package/dist/esm/hooks/useProps.mjs.map +1 -1
  88. package/dist/esm/hooks/useProps.native.js +1 -1
  89. package/dist/esm/hooks/useProps.native.js.map +1 -1
  90. package/dist/esm/hooks/useThemeState.mjs +2 -2
  91. package/dist/esm/hooks/useThemeState.mjs.map +1 -1
  92. package/dist/esm/hooks/useThemeState.native.js +2 -2
  93. package/dist/esm/hooks/useThemeState.native.js.map +1 -1
  94. package/dist/esm/internal-runtime.mjs +3 -1
  95. package/dist/esm/internal-runtime.mjs.map +1 -1
  96. package/dist/esm/internal-runtime.native.js +3 -1
  97. package/dist/esm/internal-runtime.native.js.map +1 -1
  98. package/dist/esm/views/Theme.mjs +1 -1
  99. package/dist/esm/views/Theme.mjs.map +1 -1
  100. package/dist/esm/views/Theme.native.js +2 -1
  101. package/dist/esm/views/Theme.native.js.map +1 -1
  102. package/package.json +15 -15
  103. package/src/createComponent.tsx +4 -1
  104. package/src/createTamagui.ts +6 -1
  105. package/src/helpers/directStyle.ts +23 -12
  106. package/src/helpers/formatDiagnostic.ts +3 -0
  107. package/src/helpers/getSplitStyles.tsx +8 -2
  108. package/src/helpers/mergeVariants.ts +3 -1
  109. package/src/helpers/propMapper.ts +6 -1
  110. package/src/hooks/getThemeProxied.ts +4 -3
  111. package/src/hooks/useComponentState.ts +4 -1
  112. package/src/hooks/useProps.tsx +4 -1
  113. package/src/hooks/useThemeState.ts +8 -2
  114. package/src/internal-runtime.ts +8 -1
  115. package/src/views/Theme.tsx +4 -1
  116. package/types/createComponent.d.ts.map +1 -1
  117. package/types/helpers/directStyle.d.ts.map +1 -1
  118. package/types/helpers/formatDiagnostic.d.ts.map +1 -1
  119. package/types/helpers/getSplitStyles.d.ts.map +1 -1
  120. package/types/helpers/mergeVariants.d.ts.map +1 -1
  121. package/types/helpers/propMapper.d.ts.map +1 -1
  122. package/types/hooks/getThemeProxied.d.ts.map +1 -1
  123. package/types/hooks/useComponentState.d.ts.map +1 -1
  124. package/types/hooks/useProps.d.ts.map +1 -1
  125. package/types/hooks/useThemeState.d.ts.map +1 -1
  126. package/types/internal-runtime.d.ts.map +1 -1
  127. package/types/views/Theme.d.ts.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"useThemeState.js","names":[],"sources":["esm/hooks/useThemeState.js"],"sourcesContent":["import { useIsomorphicLayoutEffect } from \"@tamagui/constants\";\nimport { createContext, useContext, useEffect, useId, useReducer, useRef } from \"react\";\nimport { getConfig } from \"../config\";\nimport { formatDiagnostic } from \"../helpers/formatDiagnostic\";\nimport { getInlineValuesKey, getMergedInlineTheme } from \"../helpers/variables\";\nimport { MISSING_THEME_MESSAGE } from \"../constants/constants\";\n\nconst ThemeStateContext = createContext(\"\");\nconst allListeners = /* @__PURE__ */ new Map();\nconst listenersByParent = {};\nconst HasRenderedOnce = /* @__PURE__ */ new WeakMap();\nconst HadTheme = /* @__PURE__ */ new WeakMap();\nconst PendingUpdate = /* @__PURE__ */ new Map();\nconst states = /* @__PURE__ */ new Map();\nconst localStates = /* @__PURE__ */ new Map();\nlet shouldForce = false;\nconst forceUpdateThemes = () => {\n\tcacheVersion++;\n\tshouldForce = true;\n\tallListeners.forEach((cb) => cb());\n\tshouldForce = false;\n};\nconst getThemeState = (id) => states.get(id);\nconst inlineThemeLayers = /* @__PURE__ */ new Map();\nconst themeProviderParents = /* @__PURE__ */ new Map();\nconst getInlineThemeLayer = (id) => inlineThemeLayers.get(id);\nconst getThemeProviderParent = (id) => themeProviderParents.get(id);\nconst getThemeProviderChainSizes = () => ({\n\tlayers: inlineThemeLayers.size,\n\tparents: themeProviderParents.size\n});\nconst registerThemeProviderChain = (id, parentId, props) => {\n\tthemeProviderParents.set(id, parentId);\n\tif (props.inlineValues) inlineThemeLayers.set(id, {\n\t\tinlineValues: props.inlineValues,\n\t\tinlineClassName: props.inlineClassName\n\t});\n\telse inlineThemeLayers.delete(id);\n};\nlet cacheVersion = 0;\nconst themeNameCache = /* @__PURE__ */ new Map();\nlet themeNameCacheVer = -1;\nlet themes = null;\nlet rootThemeState = null;\nconst getRootThemeState = () => rootThemeState;\nconst incReducer = (c) => c + 1;\nconst useThemeState = (props, isRoot = false, keys, schemeKeys, cascadeOnChange = false, optimizeForFirstRender = false) => {\n\t\"use no memo\";\n\tconst { disable } = props;\n\tconst parentId = useContext(ThemeStateContext);\n\tif (!parentId && !isRoot) throw new Error(process.env.NODE_ENV === \"development\" ? `${MISSING_THEME_MESSAGE}\n\nLooked for theme${props.name ? ` \"${props.name}\"` : \"\"}, but no parent theme context was found (parentId: ${parentId}).` : MISSING_THEME_MESSAGE);\n\tif (disable) return states.get(parentId) || {\n\t\tid: \"\",\n\t\tname: \"light\",\n\t\ttheme: getConfig().themes.light\n\t};\n\tconst id = useId();\n\tconst propsKey = getPropsKey(props);\n\tif (cascadeOnChange) registerThemeProviderChain(id, parentId, props);\n\tconst ref = useRef(null);\n\tif (!ref.current) ref.current = {\n\t\tid,\n\t\tparentId,\n\t\tprops,\n\t\tpropsKey,\n\t\tisRoot,\n\t\tkeys,\n\t\tschemeKeys,\n\t\toptimizeForFirstRender,\n\t\trenderVersion: 0\n\t};\n\telse {\n\t\tref.current.props = props;\n\t\tref.current.propsKey = propsKey;\n\t\tref.current.isRoot = isRoot;\n\t\tref.current.keys = keys;\n\t\tref.current.schemeKeys = schemeKeys;\n\t\tref.current.parentId = parentId;\n\t}\n\tref.current.renderVersion++;\n\tif (process.env.NODE_ENV === \"development\" && globalThis.time) globalThis.time`theme-prep-uses`;\n\tconst [, forceUpdate] = useReducer(incReducer, 0);\n\tconst state = getSnapshotImpl(ref.current);\n\tref.current.lastSnap = state;\n\tuseEffect(() => {\n\t\tconst r = ref.current;\n\t\tconst renderVersion = r.renderVersion;\n\t\tif (r.lastSnap && !states.has(r.id)) {\n\t\t\tstates.set(r.id, r.lastSnap);\n\t\t\tlocalStates.set(r.id, r.lastSnap);\n\t\t}\n\t\tif (cascadeOnChange && !themeProviderParents.has(r.id)) registerThemeProviderChain(r.id, r.parentId, r.props);\n\t\tif (r.unsubscribe && r.subscribedParentId !== r.parentId) cleanupThemeSubscription(r);\n\t\tif (shouldSubscribeToTheme(r, cascadeOnChange)) {\n\t\t\tif (!r.unsubscribe) {\n\t\t\t\tconst pid = r.parentId;\n\t\t\t\tconst sid = r.id;\n\t\t\t\tconst cb = (forced) => {\n\t\t\t\t\tconst next = getSnapshotImpl(r);\n\t\t\t\t\tif (next !== r.lastSnap) {\n\t\t\t\t\t\tr.lastSnap = next;\n\t\t\t\t\t\tif (!forced && r.props.nativeUpdate?.(next)) return;\n\t\t\t\t\t\tforceUpdate();\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tlistenersByParent[pid] = listenersByParent[pid] || /* @__PURE__ */ new Set();\n\t\t\t\tlistenersByParent[pid].add(sid);\n\t\t\t\tallListeners.set(sid, () => {\n\t\t\t\t\tconst forced = shouldForce;\n\t\t\t\t\tPendingUpdate.set(sid, forced ? \"force\" : true);\n\t\t\t\t\tcb(forced);\n\t\t\t\t});\n\t\t\t\tr.subscribedParentId = pid;\n\t\t\t\tr.unsubscribe = () => {\n\t\t\t\t\tallListeners.delete(sid);\n\t\t\t\t\tlistenersByParent[pid]?.delete(sid);\n\t\t\t\t\tlocalStates.delete(sid);\n\t\t\t\t\tstates.delete(sid);\n\t\t\t\t\tPendingUpdate.delete(sid);\n\t\t\t\t\tr.unsubscribe = void 0;\n\t\t\t\t\tr.subscribedParentId = void 0;\n\t\t\t\t};\n\t\t\t}\n\t\t} else if (r.unsubscribe) cleanupThemeSubscription(r);\n\t\treturn () => {\n\t\t\tif (r.renderVersion === renderVersion) cleanupThemeState(r);\n\t\t};\n\t});\n\tif (cascadeOnChange) useIsomorphicLayoutEffect(() => {\n\t\tif (!HasRenderedOnce.get(keys)) {\n\t\t\tHasRenderedOnce.set(keys, true);\n\t\t\treturn;\n\t\t}\n\t\tif (!propsKey) {\n\t\t\tif (HadTheme.get(keys)) scheduleUpdate(id);\n\t\t\tHadTheme.set(keys, false);\n\t\t\treturn;\n\t\t}\n\t\tif (process.env.NODE_ENV === \"development\" && props.debug === \"verbose\") console.warn(` \\xB7 useTheme(${id}) scheduleUpdate`, propsKey, states.get(id)?.name);\n\t\tscheduleUpdate(id);\n\t\tHadTheme.set(keys, true);\n\t}, [keys, propsKey]);\n\treturn state;\n};\nconst shouldSubscribeToTheme = (r, cascadeOnChange) => r.optimizeForFirstRender || r.isRoot || cascadeOnChange || hasThemeUpdatingProps(r.props) || !!r.keys.current?.size || !!r.props.needsUpdate?.();\nfunction cleanupThemeSubscription(r) {\n\tr.unsubscribe?.();\n}\nfunction cleanupThemeState(r) {\n\tif (r.unsubscribe) cleanupThemeSubscription(r);\n\telse {\n\t\tlocalStates.delete(r.id);\n\t\tstates.delete(r.id);\n\t\tPendingUpdate.delete(r.id);\n\t}\n\tinlineThemeLayers.delete(r.id);\n\tthemeProviderParents.delete(r.id);\n}\nconst getSnapshotImpl = (r) => {\n\tconst { id, parentId, props, propsKey, isRoot, keys, schemeKeys, optimizeForFirstRender } = r;\n\tlet local = localStates.get(id);\n\tconst parentState = states.get(parentId);\n\tif (local && !PendingUpdate.has(id)) {\n\t\tif (parentState && local._parentName === parentState.name && local._propsKey === propsKey) return local;\n\t}\n\tconst isSchemeOnlyChange = !optimizeForFirstRender && false;\n\tlet allKeysSchemeOptimized = false;\n\tif (!optimizeForFirstRender) {\n\t\tconst keysSize = keys.current?.size ?? 0;\n\t\tallKeysSchemeOptimized = (schemeKeys?.current?.size ?? 0) === keysSize && keysSize > 0;\n\t}\n\tconst canSkipForSchemeChange = !!isSchemeOnlyChange && allKeysSchemeOptimized;\n\tconst needsUpdate = props.passThrough ? false : optimizeForFirstRender ? true : isRoot || props.name === \"light\" || props.name === \"dark\" || props.name === null ? true : !HasRenderedOnce.get(keys) ? true : canSkipForSchemeChange ? false : keys?.current?.size ? true : props.needsUpdate?.();\n\tconst [rerender, nextRaw] = getNextState(local, props, propsKey, isRoot, id, parentId, needsUpdate, PendingUpdate.get(id));\n\tlet next = nextRaw;\n\tif (props.inlineValues && nextRaw?.theme) {\n\t\tconst merged = getMergedInlineTheme(states.get(parentId)?.theme || nextRaw.theme, props.inlineValues, nextRaw.name, getConfig());\n\t\tif (merged !== nextRaw.theme) next = {\n\t\t\t...nextRaw,\n\t\t\ttheme: merged\n\t\t};\n\t}\n\tPendingUpdate.delete(id);\n\tif (!local || rerender) {\n\t\tlocal = { ...next };\n\t\tlocalStates.set(id, local);\n\t}\n\tif (process.env.NODE_ENV === \"development\" && props.debug === \"verbose\") {\n\t\tconsole.groupCollapsed(` ${id} getSnapshot ${rerender}`, local.name, \">\", next.name);\n\t\tconsole.info({\n\t\t\tprops,\n\t\t\tpropsKey,\n\t\t\tisRoot,\n\t\t\tparentId,\n\t\t\tlocal,\n\t\t\tnext,\n\t\t\tneedsUpdate,\n\t\t\tisSchemeOnlyChange,\n\t\t\tallKeysSchemeOptimized,\n\t\t\tcanSkipForSchemeChange\n\t\t});\n\t\tconsole.groupEnd();\n\t}\n\tif (next !== local) {\n\t\tObject.assign(local, next);\n\t\tlocal.id = id;\n\t}\n\tlocal._parentName = parentState?.name;\n\tlocal._propsKey = propsKey;\n\tstates.set(id, next);\n\treturn local;\n};\nconst getNextState = (lastState, props, propsKey, isRoot = false, id, parentId, needsUpdate, pendingUpdate) => {\n\tconst { debug } = props;\n\tconst parentState = states.get(parentId);\n\tif (props.passThrough) return [false, lastState || parentState || { name: \"\" }];\n\tif (!themes) themes = getConfig().themes;\n\tconst name = !propsKey && (!lastState || !lastState?.isNew) ? null : getNewThemeName(parentState?.name, props, pendingUpdate === \"force\" ? true : !!needsUpdate);\n\tconst isSameAsParent = parentState && (!name || name === parentState.name);\n\tconst shouldRerender = Boolean(pendingUpdate === \"force\" || needsUpdate && (pendingUpdate || lastState?.name !== parentState?.name));\n\tif (process.env.NODE_ENV === \"development\" && debug === \"verbose\") {\n\t\tconst message = ` \\xB7 useTheme(${id}) getNextState => ${name} needsUpdate ${needsUpdate} shouldRerender ${shouldRerender}`;\n\t\tconsole.groupCollapsed(message);\n\t\tconsole.trace({\n\t\t\tname,\n\t\t\tlastState,\n\t\t\tparentState,\n\t\t\tprops,\n\t\t\tpropsKey,\n\t\t\tid,\n\t\t\tisSameAsParent\n\t\t});\n\t\tconsole.groupEnd();\n\t}\n\tif (isSameAsParent) {\n\t\tif (!shouldRerender && lastState && lastState.name === parentState.name) return [false, lastState];\n\t\treturn [shouldRerender, {\n\t\t\t...parentState,\n\t\t\tisNew: false\n\t\t}];\n\t}\n\tif (!name) {\n\t\tconst next = lastState ?? parentState ?? rootThemeState ?? {\n\t\t\tid,\n\t\t\tname: \"light\",\n\t\t\ttheme: getConfig().themes.light\n\t\t};\n\t\tif (shouldRerender) return [true, { ...parentState || lastState || next }];\n\t\treturn [false, next];\n\t}\n\tconst scheme = getScheme(name);\n\tconst parentInverses = parentState?.inverses ?? 0;\n\tconst isInverse = parentState && scheme !== parentState.scheme;\n\tconst inverses = parentInverses + (isInverse ? 1 : 0);\n\tconst nextState = {\n\t\tid,\n\t\tname,\n\t\ttheme: themes[name],\n\t\tscheme,\n\t\tparentId,\n\t\tparentName: parentState?.name,\n\t\tinverses,\n\t\tisInverse,\n\t\tisNew: true\n\t};\n\tif (isRoot) rootThemeState = nextState;\n\tif (pendingUpdate !== \"force\" && lastState && lastState.name === name) return [false, nextState];\n\tconst shouldAvoidRerender = pendingUpdate !== \"force\" && lastState && !needsUpdate && nextState.name === lastState.name;\n\tif (process.env.NODE_ENV === \"development\" && debug === \"verbose\") {\n\t\tconsole.groupCollapsed(` \\xB7 useTheme(${id}) \\u23ED\\uFE0F ${name} shouldAvoidRerender: ${shouldAvoidRerender}`);\n\t\tconsole.info({\n\t\t\tlastState,\n\t\t\tneedsUpdate,\n\t\t\tnextState,\n\t\t\tpendingUpdate\n\t\t});\n\t\tconsole.groupEnd();\n\t}\n\tif (shouldAvoidRerender) return [false, nextState];\n\treturn [true, nextState];\n};\nfunction scheduleUpdate(id) {\n\tconst queue = [id];\n\tconst visited = /* @__PURE__ */ new Set();\n\twhile (queue.length) {\n\t\tconst children = listenersByParent[queue.shift()];\n\t\tif (children) {\n\t\t\tfor (const childId of children) if (!visited.has(childId)) {\n\t\t\t\tvisited.add(childId);\n\t\t\t\tqueue.push(childId);\n\t\t\t}\n\t\t}\n\t}\n\tvisited.forEach((childId) => {\n\t\tallListeners.get(childId)?.();\n\t});\n}\nconst validSchemes = {\n\tlight: \"light\",\n\tdark: \"dark\"\n};\nfunction getScheme(name) {\n\treturn validSchemes[name.split(\"_\")[0]];\n}\nfunction getNewThemeName(parentName = \"\", props, forceUpdate = false) {\n\tconst { name, reset } = props;\n\tif (name && reset) throw new Error(formatDiagnostic(\"❌004\", \"Theme\", \"props name and reset are mutually exclusive\", \"Pass either name or reset, not both\", \"name,reset\", {\n\t\tname,\n\t\treset\n\t}));\n\tconst cacheKey = `${parentName}|${name || \"\"}|${reset ? 1 : 0}|${forceUpdate ? 1 : 0}`;\n\tif (themeNameCacheVer !== cacheVersion) {\n\t\tthemeNameCache.clear();\n\t\tthemeNameCacheVer = cacheVersion;\n\t} else {\n\t\tconst cached = themeNameCache.get(cacheKey);\n\t\tif (cached !== void 0) return cached;\n\t}\n\tconst result = resolveThemeName(parentName, name ?? void 0, reset, getConfig().themes, forceUpdate);\n\tif (themeNameCache.size >= 1e4) themeNameCache.clear();\n\tthemeNameCache.set(cacheKey, result);\n\treturn result;\n}\nconst getThemeNameCacheSize = () => themeNameCache.size;\nfunction resolveThemeName(parentName, name, reset, themes2, forceUpdate = false) {\n\tif (reset) {\n\t\tif (parentName === \"light\" || parentName === \"dark\") return parentName === \"light\" ? \"dark\" : \"light\";\n\t\tconst lastPartIndex = parentName.lastIndexOf(\"_\");\n\t\tconst resetName = lastPartIndex <= 0 ? parentName : parentName.slice(lastPartIndex);\n\t\tconst scheme = parentName.slice(0, lastPartIndex);\n\t\treturn themes2[resetName] ? resetName : scheme;\n\t}\n\tconst parentParts = parentName ? parentName.split(\"_\") : [];\n\tlet found = null;\n\tif (name) {\n\t\tconst nameHasScheme = getScheme(name);\n\t\tif (nameHasScheme && name in themes2) found = name;\n\t\tif (!found && !nameHasScheme) for (let i = parentParts.length; i >= 0; i--) {\n\t\t\tconst base = parentParts.slice(0, i).join(\"_\");\n\t\t\tconst potential = base ? `${base}_${name}` : name;\n\t\t\tif (potential in themes2) {\n\t\t\t\tfound = potential;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\tif (!forceUpdate && found === parentName && !validSchemes[found]) return null;\n\treturn found;\n}\nconst getPropsKey = ({ name, reset, forceClassName, inlineValues }) => `${name || \"\"}${reset || \"\"}${forceClassName || \"\"}${inlineValues ? getInlineValuesKey(inlineValues) : \"\"}`;\nconst hasThemeUpdatingProps = (props) => \"name\" in props || \"reset\" in props || \"forceClassName\" in props || \"inlineValues\" in props;\n\nexport { ThemeStateContext, forceUpdateThemes, getInlineThemeLayer, getNewThemeName, getRootThemeState, getThemeNameCacheSize, getThemeProviderChainSizes, getThemeProviderParent, getThemeState, hasThemeUpdatingProps, resolveThemeName, useThemeState };"],"mappings":";;;;;;;;AAOA,MAAM,oBAAoB,cAAc,EAAE;AAC1C,MAAM,+BAA+B,IAAI,IAAI;AAC7C,MAAM,oBAAoB,CAAC;AAC3B,MAAM,kCAAkC,IAAI,QAAQ;AACpD,MAAM,2BAA2B,IAAI,QAAQ;AAC7C,MAAM,gCAAgC,IAAI,IAAI;AAC9C,MAAM,yBAAyB,IAAI,IAAI;AACvC,MAAM,8BAA8B,IAAI,IAAI;AAC5C,IAAI,cAAc;AAClB,MAAM,0BAA0B;CAC/B;CACA,cAAc;CACd,aAAa,SAAS,OAAO,GAAG,CAAC;CACjC,cAAc;AACf;AACA,MAAM,iBAAiB,OAAO,OAAO,IAAI,EAAE;AAC3C,MAAM,oCAAoC,IAAI,IAAI;AAClD,MAAM,uCAAuC,IAAI,IAAI;AACrD,MAAM,uBAAuB,OAAO,kBAAkB,IAAI,EAAE;AAC5D,MAAM,0BAA0B,OAAO,qBAAqB,IAAI,EAAE;AAClE,MAAM,oCAAoC;CACzC,QAAQ,kBAAkB;CAC1B,SAAS,qBAAqB;AAC/B;AACA,MAAM,8BAA8B,IAAI,UAAU,UAAU;CAC3D,qBAAqB,IAAI,IAAI,QAAQ;CACrC,IAAI,MAAM,cAAc,kBAAkB,IAAI,IAAI;EACjD,cAAc,MAAM;EACpB,iBAAiB,MAAM;CACxB,CAAC;MACI,kBAAkB,OAAO,EAAE;AACjC;AACA,IAAI,eAAe;AACnB,MAAM,iCAAiC,IAAI,IAAI;AAC/C,IAAI,oBAAoB,CAAC;AACzB,IAAI,SAAS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B,mBAAmB,GAAG,QAAQ,KAAK,SAAS,KAAK,kBAAkB,KAAK,eAAe,mBAAmB,YAAY,IAAI;AAC9K,MAAM,yBAAyB,UAAU,UAAU,SAAS,WAAW,SAAS,oBAAoB,SAAS,kBAAkB"}
1
+ {"version":3,"file":"useThemeState.js","names":[],"sources":["esm/hooks/useThemeState.js"],"sourcesContent":["import { useIsomorphicLayoutEffect } from \"@tamagui/constants\";\nimport { createContext, useContext, useEffect, useId, useReducer, useRef } from \"react\";\nimport { getConfig } from \"../config\";\nimport { formatDiagnostic } from \"../helpers/formatDiagnostic\";\nimport { getInlineValuesKey, getMergedInlineTheme } from \"../helpers/variables\";\nimport { MISSING_THEME_MESSAGE } from \"../constants/constants\";\n\nconst ThemeStateContext = createContext(\"\");\nconst allListeners = /* @__PURE__ */ new Map();\nconst listenersByParent = {};\nconst HasRenderedOnce = /* @__PURE__ */ new WeakMap();\nconst HadTheme = /* @__PURE__ */ new WeakMap();\nconst PendingUpdate = /* @__PURE__ */ new Map();\nconst states = /* @__PURE__ */ new Map();\nconst localStates = /* @__PURE__ */ new Map();\nlet shouldForce = false;\nconst forceUpdateThemes = () => {\n\tcacheVersion++;\n\tshouldForce = true;\n\tallListeners.forEach((cb) => cb());\n\tshouldForce = false;\n};\nconst getThemeState = (id) => states.get(id);\nconst inlineThemeLayers = /* @__PURE__ */ new Map();\nconst themeProviderParents = /* @__PURE__ */ new Map();\nconst getInlineThemeLayer = (id) => inlineThemeLayers.get(id);\nconst getThemeProviderParent = (id) => themeProviderParents.get(id);\nconst getThemeProviderChainSizes = () => ({\n\tlayers: inlineThemeLayers.size,\n\tparents: themeProviderParents.size\n});\nconst registerThemeProviderChain = (id, parentId, props) => {\n\tthemeProviderParents.set(id, parentId);\n\tif (props.inlineValues) inlineThemeLayers.set(id, {\n\t\tinlineValues: props.inlineValues,\n\t\tinlineClassName: props.inlineClassName\n\t});\n\telse inlineThemeLayers.delete(id);\n};\nlet cacheVersion = 0;\nconst themeNameCache = /* @__PURE__ */ new Map();\nlet themeNameCacheVer = -1;\nlet themes = null;\nlet rootThemeState = null;\nconst getRootThemeState = () => rootThemeState;\nconst incReducer = (c) => c + 1;\nconst useThemeState = (props, isRoot = false, keys, schemeKeys, cascadeOnChange = false, optimizeForFirstRender = false) => {\n\t\"use no memo\";\n\tconst { disable } = props;\n\tconst parentId = useContext(ThemeStateContext);\n\tif (!parentId && !isRoot) throw new Error(process.env.NODE_ENV === \"development\" ? `${MISSING_THEME_MESSAGE}\n\nLooked for theme${props.name ? ` \"${props.name}\"` : \"\"}, but no parent theme context was found (parentId: ${parentId}).` : MISSING_THEME_MESSAGE);\n\tif (disable) return states.get(parentId) || {\n\t\tid: \"\",\n\t\tname: \"light\",\n\t\ttheme: getConfig().themes.light\n\t};\n\tconst id = useId();\n\tconst propsKey = getPropsKey(props);\n\tif (cascadeOnChange) registerThemeProviderChain(id, parentId, props);\n\tconst ref = useRef(null);\n\tif (!ref.current) ref.current = {\n\t\tid,\n\t\tparentId,\n\t\tprops,\n\t\tpropsKey,\n\t\tisRoot,\n\t\tkeys,\n\t\tschemeKeys,\n\t\toptimizeForFirstRender,\n\t\trenderVersion: 0\n\t};\n\telse {\n\t\tref.current.props = props;\n\t\tref.current.propsKey = propsKey;\n\t\tref.current.isRoot = isRoot;\n\t\tref.current.keys = keys;\n\t\tref.current.schemeKeys = schemeKeys;\n\t\tref.current.parentId = parentId;\n\t}\n\tref.current.renderVersion++;\n\tif (process.env.NODE_ENV === \"development\" && globalThis.time) globalThis.time`theme-prep-uses`;\n\tconst [, forceUpdate] = useReducer(incReducer, 0);\n\tconst state = getSnapshotImpl(ref.current);\n\tref.current.lastSnap = state;\n\tuseEffect(() => {\n\t\tconst r = ref.current;\n\t\tconst renderVersion = r.renderVersion;\n\t\tif (r.lastSnap && !states.has(r.id)) {\n\t\t\tstates.set(r.id, r.lastSnap);\n\t\t\tlocalStates.set(r.id, r.lastSnap);\n\t\t}\n\t\tif (cascadeOnChange && !themeProviderParents.has(r.id)) registerThemeProviderChain(r.id, r.parentId, r.props);\n\t\tif (r.unsubscribe && r.subscribedParentId !== r.parentId) cleanupThemeSubscription(r);\n\t\tif (shouldSubscribeToTheme(r, cascadeOnChange)) {\n\t\t\tif (!r.unsubscribe) {\n\t\t\t\tconst pid = r.parentId;\n\t\t\t\tconst sid = r.id;\n\t\t\t\tconst cb = (forced) => {\n\t\t\t\t\tconst next = getSnapshotImpl(r);\n\t\t\t\t\tif (next !== r.lastSnap) {\n\t\t\t\t\t\tr.lastSnap = next;\n\t\t\t\t\t\tif (!forced && r.props.nativeUpdate?.(next)) return;\n\t\t\t\t\t\tforceUpdate();\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tlistenersByParent[pid] = listenersByParent[pid] || /* @__PURE__ */ new Set();\n\t\t\t\tlistenersByParent[pid].add(sid);\n\t\t\t\tallListeners.set(sid, () => {\n\t\t\t\t\tconst forced = shouldForce;\n\t\t\t\t\tPendingUpdate.set(sid, forced ? \"force\" : true);\n\t\t\t\t\tcb(forced);\n\t\t\t\t});\n\t\t\t\tr.subscribedParentId = pid;\n\t\t\t\tr.unsubscribe = () => {\n\t\t\t\t\tallListeners.delete(sid);\n\t\t\t\t\tlistenersByParent[pid]?.delete(sid);\n\t\t\t\t\tlocalStates.delete(sid);\n\t\t\t\t\tstates.delete(sid);\n\t\t\t\t\tPendingUpdate.delete(sid);\n\t\t\t\t\tr.unsubscribe = void 0;\n\t\t\t\t\tr.subscribedParentId = void 0;\n\t\t\t\t};\n\t\t\t}\n\t\t} else if (r.unsubscribe) cleanupThemeSubscription(r);\n\t\treturn () => {\n\t\t\tif (r.renderVersion === renderVersion) cleanupThemeState(r);\n\t\t};\n\t});\n\tif (cascadeOnChange) useIsomorphicLayoutEffect(() => {\n\t\tif (!HasRenderedOnce.get(keys)) {\n\t\t\tHasRenderedOnce.set(keys, true);\n\t\t\treturn;\n\t\t}\n\t\tif (!propsKey) {\n\t\t\tif (HadTheme.get(keys)) scheduleUpdate(id);\n\t\t\tHadTheme.set(keys, false);\n\t\t\treturn;\n\t\t}\n\t\tif (process.env.NODE_ENV === \"development\" && props.debug === \"verbose\") console.warn(` \\xB7 useTheme(${id}) scheduleUpdate`, propsKey, states.get(id)?.name);\n\t\tscheduleUpdate(id);\n\t\tHadTheme.set(keys, true);\n\t}, [keys, propsKey]);\n\treturn state;\n};\nconst shouldSubscribeToTheme = (r, cascadeOnChange) => r.optimizeForFirstRender || r.isRoot || cascadeOnChange || hasThemeUpdatingProps(r.props) || !!r.keys.current?.size || !!r.props.needsUpdate?.();\nfunction cleanupThemeSubscription(r) {\n\tr.unsubscribe?.();\n}\nfunction cleanupThemeState(r) {\n\tif (r.unsubscribe) cleanupThemeSubscription(r);\n\telse {\n\t\tlocalStates.delete(r.id);\n\t\tstates.delete(r.id);\n\t\tPendingUpdate.delete(r.id);\n\t}\n\tinlineThemeLayers.delete(r.id);\n\tthemeProviderParents.delete(r.id);\n}\nconst getSnapshotImpl = (r) => {\n\tconst { id, parentId, props, propsKey, isRoot, keys, schemeKeys, optimizeForFirstRender } = r;\n\tlet local = localStates.get(id);\n\tconst parentState = states.get(parentId);\n\tif (local && !PendingUpdate.has(id)) {\n\t\tif (parentState && local._parentName === parentState.name && local._propsKey === propsKey) return local;\n\t}\n\tconst isSchemeOnlyChange = !optimizeForFirstRender && false;\n\tlet allKeysSchemeOptimized = false;\n\tif (!optimizeForFirstRender) {\n\t\tconst keysSize = keys.current?.size ?? 0;\n\t\tallKeysSchemeOptimized = (schemeKeys?.current?.size ?? 0) === keysSize && keysSize > 0;\n\t}\n\tconst canSkipForSchemeChange = !!isSchemeOnlyChange && allKeysSchemeOptimized;\n\tconst needsUpdate = props.passThrough ? false : optimizeForFirstRender ? true : isRoot || props.name === \"light\" || props.name === \"dark\" || props.name === null ? true : !HasRenderedOnce.get(keys) ? true : canSkipForSchemeChange ? false : keys?.current?.size ? true : props.needsUpdate?.();\n\tconst [rerender, nextRaw] = getNextState(local, props, propsKey, isRoot, id, parentId, needsUpdate, PendingUpdate.get(id));\n\tlet next = nextRaw;\n\tif (process.env.TAMAGUI_RUNTIME_INLINE_THEME_VALUES !== \"disabled\" && props.inlineValues && nextRaw?.theme) {\n\t\tconst merged = getMergedInlineTheme(states.get(parentId)?.theme || nextRaw.theme, props.inlineValues, nextRaw.name, getConfig());\n\t\tif (merged !== nextRaw.theme) next = {\n\t\t\t...nextRaw,\n\t\t\ttheme: merged\n\t\t};\n\t}\n\tPendingUpdate.delete(id);\n\tif (!local || rerender) {\n\t\tlocal = { ...next };\n\t\tlocalStates.set(id, local);\n\t}\n\tif (process.env.NODE_ENV === \"development\" && props.debug === \"verbose\") {\n\t\tconsole.groupCollapsed(` ${id} getSnapshot ${rerender}`, local.name, \">\", next.name);\n\t\tconsole.info({\n\t\t\tprops,\n\t\t\tpropsKey,\n\t\t\tisRoot,\n\t\t\tparentId,\n\t\t\tlocal,\n\t\t\tnext,\n\t\t\tneedsUpdate,\n\t\t\tisSchemeOnlyChange,\n\t\t\tallKeysSchemeOptimized,\n\t\t\tcanSkipForSchemeChange\n\t\t});\n\t\tconsole.groupEnd();\n\t}\n\tif (next !== local) {\n\t\tObject.assign(local, next);\n\t\tlocal.id = id;\n\t}\n\tlocal._parentName = parentState?.name;\n\tlocal._propsKey = propsKey;\n\tstates.set(id, next);\n\treturn local;\n};\nconst getNextState = (lastState, props, propsKey, isRoot = false, id, parentId, needsUpdate, pendingUpdate) => {\n\tconst { debug } = props;\n\tconst parentState = states.get(parentId);\n\tif (props.passThrough) return [false, lastState || parentState || { name: \"\" }];\n\tif (!themes) themes = getConfig().themes;\n\tconst name = !propsKey && (!lastState || !lastState?.isNew) ? null : getNewThemeName(parentState?.name, props, pendingUpdate === \"force\" ? true : !!needsUpdate);\n\tconst isSameAsParent = parentState && (!name || name === parentState.name);\n\tconst shouldRerender = Boolean(pendingUpdate === \"force\" || needsUpdate && (pendingUpdate || lastState?.name !== parentState?.name));\n\tif (process.env.NODE_ENV === \"development\" && debug === \"verbose\") {\n\t\tconst message = ` \\xB7 useTheme(${id}) getNextState => ${name} needsUpdate ${needsUpdate} shouldRerender ${shouldRerender}`;\n\t\tconsole.groupCollapsed(message);\n\t\tconsole.trace({\n\t\t\tname,\n\t\t\tlastState,\n\t\t\tparentState,\n\t\t\tprops,\n\t\t\tpropsKey,\n\t\t\tid,\n\t\t\tisSameAsParent\n\t\t});\n\t\tconsole.groupEnd();\n\t}\n\tif (isSameAsParent) {\n\t\tif (!shouldRerender && lastState && lastState.name === parentState.name) return [false, lastState];\n\t\treturn [shouldRerender, {\n\t\t\t...parentState,\n\t\t\tisNew: false\n\t\t}];\n\t}\n\tif (!name) {\n\t\tconst next = lastState ?? parentState ?? rootThemeState ?? {\n\t\t\tid,\n\t\t\tname: \"light\",\n\t\t\ttheme: getConfig().themes.light\n\t\t};\n\t\tif (shouldRerender) return [true, { ...parentState || lastState || next }];\n\t\treturn [false, next];\n\t}\n\tconst scheme = getScheme(name);\n\tconst parentInverses = parentState?.inverses ?? 0;\n\tconst isInverse = parentState && scheme !== parentState.scheme;\n\tconst inverses = parentInverses + (isInverse ? 1 : 0);\n\tconst nextState = {\n\t\tid,\n\t\tname,\n\t\ttheme: themes[name],\n\t\tscheme,\n\t\tparentId,\n\t\tparentName: parentState?.name,\n\t\tinverses,\n\t\tisInverse,\n\t\tisNew: true\n\t};\n\tif (isRoot) rootThemeState = nextState;\n\tif (pendingUpdate !== \"force\" && lastState && lastState.name === name) return [false, nextState];\n\tconst shouldAvoidRerender = pendingUpdate !== \"force\" && lastState && !needsUpdate && nextState.name === lastState.name;\n\tif (process.env.NODE_ENV === \"development\" && debug === \"verbose\") {\n\t\tconsole.groupCollapsed(` \\xB7 useTheme(${id}) \\u23ED\\uFE0F ${name} shouldAvoidRerender: ${shouldAvoidRerender}`);\n\t\tconsole.info({\n\t\t\tlastState,\n\t\t\tneedsUpdate,\n\t\t\tnextState,\n\t\t\tpendingUpdate\n\t\t});\n\t\tconsole.groupEnd();\n\t}\n\tif (shouldAvoidRerender) return [false, nextState];\n\treturn [true, nextState];\n};\nfunction scheduleUpdate(id) {\n\tconst queue = [id];\n\tconst visited = /* @__PURE__ */ new Set();\n\twhile (queue.length) {\n\t\tconst children = listenersByParent[queue.shift()];\n\t\tif (children) {\n\t\t\tfor (const childId of children) if (!visited.has(childId)) {\n\t\t\t\tvisited.add(childId);\n\t\t\t\tqueue.push(childId);\n\t\t\t}\n\t\t}\n\t}\n\tvisited.forEach((childId) => {\n\t\tallListeners.get(childId)?.();\n\t});\n}\nconst validSchemes = {\n\tlight: \"light\",\n\tdark: \"dark\"\n};\nfunction getScheme(name) {\n\treturn validSchemes[name.split(\"_\")[0]];\n}\nfunction getNewThemeName(parentName = \"\", props, forceUpdate = false) {\n\tconst { name, reset } = props;\n\tif (name && reset) throw new Error(formatDiagnostic(\"❌004\", \"Theme\", \"props name and reset are mutually exclusive\", \"Pass either name or reset, not both\", \"name,reset\", {\n\t\tname,\n\t\treset\n\t}));\n\tconst cacheKey = `${parentName}|${name || \"\"}|${reset ? 1 : 0}|${forceUpdate ? 1 : 0}`;\n\tif (themeNameCacheVer !== cacheVersion) {\n\t\tthemeNameCache.clear();\n\t\tthemeNameCacheVer = cacheVersion;\n\t} else {\n\t\tconst cached = themeNameCache.get(cacheKey);\n\t\tif (cached !== void 0) return cached;\n\t}\n\tconst result = resolveThemeName(parentName, name ?? void 0, reset, getConfig().themes, forceUpdate);\n\tif (themeNameCache.size >= 1e4) themeNameCache.clear();\n\tthemeNameCache.set(cacheKey, result);\n\treturn result;\n}\nconst getThemeNameCacheSize = () => themeNameCache.size;\nfunction resolveThemeName(parentName, name, reset, themes2, forceUpdate = false) {\n\tif (reset) {\n\t\tif (parentName === \"light\" || parentName === \"dark\") return parentName === \"light\" ? \"dark\" : \"light\";\n\t\tconst lastPartIndex = parentName.lastIndexOf(\"_\");\n\t\tconst resetName = lastPartIndex <= 0 ? parentName : parentName.slice(lastPartIndex);\n\t\tconst scheme = parentName.slice(0, lastPartIndex);\n\t\treturn themes2[resetName] ? resetName : scheme;\n\t}\n\tconst parentParts = parentName ? parentName.split(\"_\") : [];\n\tlet found = null;\n\tif (name) {\n\t\tconst nameHasScheme = getScheme(name);\n\t\tif (nameHasScheme && name in themes2) found = name;\n\t\tif (!found && !nameHasScheme) for (let i = parentParts.length; i >= 0; i--) {\n\t\t\tconst base = parentParts.slice(0, i).join(\"_\");\n\t\t\tconst potential = base ? `${base}_${name}` : name;\n\t\t\tif (potential in themes2) {\n\t\t\t\tfound = potential;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\tif (!forceUpdate && found === parentName && !validSchemes[found]) return null;\n\treturn found;\n}\nconst getPropsKey = ({ name, reset, forceClassName, inlineValues }) => `${name || \"\"}${reset || \"\"}${forceClassName || \"\"}${process.env.TAMAGUI_RUNTIME_INLINE_THEME_VALUES !== \"disabled\" && inlineValues ? getInlineValuesKey(inlineValues) : \"\"}`;\nconst hasThemeUpdatingProps = (props) => \"name\" in props || \"reset\" in props || \"forceClassName\" in props || \"inlineValues\" in props;\n\nexport { ThemeStateContext, forceUpdateThemes, getInlineThemeLayer, getNewThemeName, getRootThemeState, getThemeNameCacheSize, getThemeProviderChainSizes, getThemeProviderParent, getThemeState, hasThemeUpdatingProps, resolveThemeName, useThemeState };"],"mappings":";;;;;;;;AAOA,MAAM,oBAAoB,cAAc,EAAE;AAC1C,MAAM,+BAA+B,IAAI,IAAI;AAC7C,MAAM,oBAAoB,CAAC;AAC3B,MAAM,kCAAkC,IAAI,QAAQ;AACpD,MAAM,2BAA2B,IAAI,QAAQ;AAC7C,MAAM,gCAAgC,IAAI,IAAI;AAC9C,MAAM,yBAAyB,IAAI,IAAI;AACvC,MAAM,8BAA8B,IAAI,IAAI;AAC5C,IAAI,cAAc;AAClB,MAAM,0BAA0B;CAC/B;CACA,cAAc;CACd,aAAa,SAAS,OAAO,GAAG,CAAC;CACjC,cAAc;AACf;AACA,MAAM,iBAAiB,OAAO,OAAO,IAAI,EAAE;AA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a,YAAY;CACzC;CACA,MAAM,cAAc,aAAa,WAAW,MAAM,GAAG,IAAI,CAAC;CAC1D,IAAI,QAAQ;CACZ,IAAI,MAAM;EACT,MAAM,gBAAgB,UAAU,IAAI;EACpC,IAAI,iBAAiB,QAAQ,SAAS,QAAQ;EAC9C,IAAI,CAAC,SAAS,CAAC,eAAe,KAAK,IAAI,IAAI,YAAY,QAAQ,KAAK,GAAG,KAAK;GAC3E,MAAM,OAAO,YAAY,MAAM,GAAG,CAAC,EAAE,KAAK,GAAG;GAC7C,MAAM,YAAY,OAAO,GAAG,KAAK,GAAG,SAAS;GAC7C,IAAI,aAAa,SAAS;IACzB,QAAQ;IACR;GACD;EACD;CACD;CACA,IAAI,CAAC,eAAe,UAAU,cAAc,CAAC,aAAa,QAAQ,OAAO;CACzE,OAAO;AACR;AACA,MAAM,eAAe,EAAE,MAAM,OAAO,gBAAgB,mBAAmB,GAAG,QAAQ,KAAK,SAAS,KAAK,kBAAkB,KAAK,QAAQ,IAAI,wCAAwC,cAAc,eAAe,mBAAmB,YAAY,IAAI;AAChP,MAAM,yBAAyB,UAAU,UAAU,SAAS,WAAW,SAAS,oBAAoB,SAAS,kBAAkB"}
@@ -206,7 +206,7 @@ var getSnapshotImpl = function(r) {
206
206
  var needsUpdate = props.passThrough ? false : optimizeForFirstRender ? true : isRoot || props.name === "light" || props.name === "dark" || props.name === null ? true : !HasRenderedOnce.get(keys) ? true : canSkipForSchemeChange ? false : (keys === null || keys === void 0 ? void 0 : (_keys_current = keys.current) === null || _keys_current === void 0 ? void 0 : _keys_current.size) ? true : (_props_needsUpdate = props.needsUpdate) === null || _props_needsUpdate === void 0 ? void 0 : _props_needsUpdate.call(props);
207
207
  var [rerender, nextRaw] = getNextState(local, props, propsKey, isRoot, id, parentId, needsUpdate, PendingUpdate.get(id));
208
208
  var next = nextRaw;
209
- if (props.inlineValues && (nextRaw === null || nextRaw === void 0 ? void 0 : nextRaw.theme)) {
209
+ if (process.env.TAMAGUI_RUNTIME_INLINE_THEME_VALUES !== "disabled" && props.inlineValues && (nextRaw === null || nextRaw === void 0 ? void 0 : nextRaw.theme)) {
210
210
  var _states_get;
211
211
  var merged = getMergedInlineTheme(((_states_get = states.get(parentId)) === null || _states_get === void 0 ? void 0 : _states_get.theme) || nextRaw.theme, props.inlineValues, nextRaw.name, getConfig());
212
212
  if (merged !== nextRaw.theme) next = {
@@ -396,7 +396,7 @@ function resolveThemeName(parentName, name, reset, themes2) {
396
396
  }
397
397
  var getPropsKey = function(param) {
398
398
  var { name, reset, forceClassName, inlineValues } = param;
399
- return `${name || ""}${reset || ""}${forceClassName || ""}${inlineValues ? getInlineValuesKey(inlineValues) : ""}`;
399
+ return `${name || ""}${reset || ""}${forceClassName || ""}${process.env.TAMAGUI_RUNTIME_INLINE_THEME_VALUES !== "disabled" && inlineValues ? getInlineValuesKey(inlineValues) : ""}`;
400
400
  };
401
401
  var hasThemeUpdatingProps = function(props) {
402
402
  return "name" in props || "reset" in props || "forceClassName" in props || "inlineValues" in props;
@@ -1 +1 @@
1
- {"version":3,"file":"useThemeState.native.js","names":[],"sources":["esm/hooks/useThemeState.native.js"],"sourcesContent":["import { supportsDynamicColorIOS, useIsomorphicLayoutEffect } from \"@tamagui/constants\";\nimport { createContext, useContext, useEffect, useId, useReducer, useRef } from \"react\";\nimport { getConfig, getSetting } from \"../config\";\nimport { formatDiagnostic } from \"../helpers/formatDiagnostic\";\nimport { getInlineValuesKey, getMergedInlineTheme } from \"../helpers/variables\";\nimport { MISSING_THEME_MESSAGE } from \"../constants/constants\";\n\nvar ThemeStateContext = createContext(\"\");\nvar allListeners = /* @__PURE__ */ new Map();\nvar listenersByParent = {};\nvar HasRenderedOnce = /* @__PURE__ */ new WeakMap();\nvar HadTheme = /* @__PURE__ */ new WeakMap();\nvar PendingUpdate = /* @__PURE__ */ new Map();\nvar states = /* @__PURE__ */ new Map();\nvar localStates = /* @__PURE__ */ new Map();\nvar shouldForce = false;\nvar forceUpdateThemes = function() {\n\tcacheVersion++;\n\tshouldForce = true;\n\tallListeners.forEach(function(cb) {\n\t\treturn cb();\n\t});\n\tshouldForce = false;\n};\nvar getThemeState = function(id) {\n\treturn states.get(id);\n};\nvar inlineThemeLayers = /* @__PURE__ */ new Map();\nvar themeProviderParents = /* @__PURE__ */ new Map();\nvar getInlineThemeLayer = function(id) {\n\treturn inlineThemeLayers.get(id);\n};\nvar getThemeProviderParent = function(id) {\n\treturn themeProviderParents.get(id);\n};\nvar getThemeProviderChainSizes = function() {\n\treturn {\n\t\tlayers: inlineThemeLayers.size,\n\t\tparents: themeProviderParents.size\n\t};\n};\nvar registerThemeProviderChain = function(id, parentId, props) {\n\tthemeProviderParents.set(id, parentId);\n\tif (props.inlineValues) inlineThemeLayers.set(id, {\n\t\tinlineValues: props.inlineValues,\n\t\tinlineClassName: props.inlineClassName\n\t});\n\telse inlineThemeLayers.delete(id);\n};\nvar cacheVersion = 0;\nvar themeNameCache = /* @__PURE__ */ new Map();\nvar themeNameCacheVer = -1;\nvar themes = null;\nvar rootThemeState = null;\nvar getRootThemeState = function() {\n\treturn rootThemeState;\n};\nvar getThemeBaseName = function(name) {\n\treturn name.replace(/^(light|dark)_/, \"\");\n};\nvar incReducer = function(c) {\n\treturn c + 1;\n};\nvar useThemeState = function(props) {\n\t\"use no memo\";\n\tvar isRoot = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false, keys = arguments.length > 2 ? arguments[2] : void 0, schemeKeys = arguments.length > 3 ? arguments[3] : void 0, cascadeOnChange = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : false, optimizeForFirstRender = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : false;\n\tvar { disable } = props;\n\tvar parentId = useContext(ThemeStateContext);\n\tif (!parentId && !isRoot) throw new Error(process.env.NODE_ENV === \"development\" ? `${MISSING_THEME_MESSAGE}\n\nLooked for theme${props.name ? ` \"${props.name}\"` : \"\"}, but no parent theme context was found (parentId: ${parentId}).` : MISSING_THEME_MESSAGE);\n\tif (disable) return states.get(parentId) || {\n\t\tid: \"\",\n\t\tname: \"light\",\n\t\ttheme: getConfig().themes.light\n\t};\n\tvar id = useId();\n\tvar propsKey = getPropsKey(props);\n\tif (cascadeOnChange) registerThemeProviderChain(id, parentId, props);\n\tvar ref = useRef(null);\n\tif (!ref.current) ref.current = {\n\t\tid,\n\t\tparentId,\n\t\tprops,\n\t\tpropsKey,\n\t\tisRoot,\n\t\tkeys,\n\t\tschemeKeys,\n\t\toptimizeForFirstRender,\n\t\trenderVersion: 0\n\t};\n\telse {\n\t\tref.current.props = props;\n\t\tref.current.propsKey = propsKey;\n\t\tref.current.isRoot = isRoot;\n\t\tref.current.keys = keys;\n\t\tref.current.schemeKeys = schemeKeys;\n\t\tref.current.parentId = parentId;\n\t}\n\tref.current.renderVersion++;\n\tif (process.env.NODE_ENV === \"development\" && globalThis.time) globalThis.time`theme-prep-uses`;\n\tvar [, forceUpdate] = useReducer(incReducer, 0);\n\tvar state = getSnapshotImpl(ref.current);\n\tref.current.lastSnap = state;\n\tuseEffect(function() {\n\t\tvar r = ref.current;\n\t\tvar renderVersion = r.renderVersion;\n\t\tif (r.lastSnap && !states.has(r.id)) {\n\t\t\tstates.set(r.id, r.lastSnap);\n\t\t\tlocalStates.set(r.id, r.lastSnap);\n\t\t}\n\t\tif (cascadeOnChange && !themeProviderParents.has(r.id)) registerThemeProviderChain(r.id, r.parentId, r.props);\n\t\tif (r.unsubscribe && r.subscribedParentId !== r.parentId) cleanupThemeSubscription(r);\n\t\tif (shouldSubscribeToTheme(r, cascadeOnChange)) {\n\t\t\tif (!r.unsubscribe) {\n\t\t\t\tvar pid = r.parentId;\n\t\t\t\tvar sid = r.id;\n\t\t\t\tvar cb = function(forced) {\n\t\t\t\t\tvar next = getSnapshotImpl(r);\n\t\t\t\t\tif (next !== r.lastSnap) {\n\t\t\t\t\t\tvar _r_props_nativeUpdate, _r_props;\n\t\t\t\t\t\tr.lastSnap = next;\n\t\t\t\t\t\tif (!forced && ((_r_props_nativeUpdate = (_r_props = r.props).nativeUpdate) === null || _r_props_nativeUpdate === void 0 ? void 0 : _r_props_nativeUpdate.call(_r_props, next))) return;\n\t\t\t\t\t\tforceUpdate();\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tlistenersByParent[pid] = listenersByParent[pid] || /* @__PURE__ */ new Set();\n\t\t\t\tlistenersByParent[pid].add(sid);\n\t\t\t\tallListeners.set(sid, function() {\n\t\t\t\t\tvar forced = shouldForce;\n\t\t\t\t\tPendingUpdate.set(sid, forced ? \"force\" : true);\n\t\t\t\t\tcb(forced);\n\t\t\t\t});\n\t\t\t\tr.subscribedParentId = pid;\n\t\t\t\tr.unsubscribe = function() {\n\t\t\t\t\tvar _listenersByParent_pid;\n\t\t\t\t\tallListeners.delete(sid);\n\t\t\t\t\t(_listenersByParent_pid = listenersByParent[pid]) === null || _listenersByParent_pid === void 0 || _listenersByParent_pid.delete(sid);\n\t\t\t\t\tlocalStates.delete(sid);\n\t\t\t\t\tstates.delete(sid);\n\t\t\t\t\tPendingUpdate.delete(sid);\n\t\t\t\t\tr.unsubscribe = void 0;\n\t\t\t\t\tr.subscribedParentId = void 0;\n\t\t\t\t};\n\t\t\t}\n\t\t} else if (r.unsubscribe) cleanupThemeSubscription(r);\n\t\treturn function() {\n\t\t\tif (r.renderVersion === renderVersion) cleanupThemeState(r);\n\t\t};\n\t});\n\tif (cascadeOnChange) useIsomorphicLayoutEffect(function() {\n\t\tif (!HasRenderedOnce.get(keys)) {\n\t\t\tHasRenderedOnce.set(keys, true);\n\t\t\treturn;\n\t\t}\n\t\tif (!propsKey) {\n\t\t\tif (HadTheme.get(keys)) scheduleUpdate(id);\n\t\t\tHadTheme.set(keys, false);\n\t\t\treturn;\n\t\t}\n\t\tif (process.env.NODE_ENV === \"development\" && props.debug === \"verbose\") {\n\t\t\tvar _states_get;\n\t\t\tconsole.warn(` \\xB7 useTheme(${id}) scheduleUpdate`, propsKey, (_states_get = states.get(id)) === null || _states_get === void 0 ? void 0 : _states_get.name);\n\t\t}\n\t\tscheduleUpdate(id);\n\t\tHadTheme.set(keys, true);\n\t}, [keys, propsKey]);\n\treturn state;\n};\nvar shouldSubscribeToTheme = function(r, cascadeOnChange) {\n\tvar _r_keys_current, _r_props_needsUpdate, _r_props;\n\treturn r.optimizeForFirstRender || r.isRoot || cascadeOnChange || hasThemeUpdatingProps(r.props) || !!((_r_keys_current = r.keys.current) === null || _r_keys_current === void 0 ? void 0 : _r_keys_current.size) || !!((_r_props_needsUpdate = (_r_props = r.props).needsUpdate) === null || _r_props_needsUpdate === void 0 ? void 0 : _r_props_needsUpdate.call(_r_props));\n};\nfunction cleanupThemeSubscription(r) {\n\tvar _r_unsubscribe;\n\t(_r_unsubscribe = r.unsubscribe) === null || _r_unsubscribe === void 0 || _r_unsubscribe.call(r);\n}\nfunction cleanupThemeState(r) {\n\tif (r.unsubscribe) cleanupThemeSubscription(r);\n\telse {\n\t\tlocalStates.delete(r.id);\n\t\tstates.delete(r.id);\n\t\tPendingUpdate.delete(r.id);\n\t}\n\tinlineThemeLayers.delete(r.id);\n\tthemeProviderParents.delete(r.id);\n}\nvar getSnapshotImpl = function(r) {\n\tvar _keys_current, _props_needsUpdate;\n\tvar { id, parentId, props, propsKey, isRoot, keys, schemeKeys, optimizeForFirstRender } = r;\n\tvar local = localStates.get(id);\n\tvar parentState = states.get(parentId);\n\tif (local && !PendingUpdate.has(id)) {\n\t\tif (parentState && local._parentName === parentState.name && local._propsKey === propsKey) return local;\n\t}\n\tvar isSchemeOnlyChange = !optimizeForFirstRender && supportsDynamicColorIOS && getSetting(\"fastSchemeChange\") && local && parentState && local.scheme !== parentState.scheme && getThemeBaseName(local.name) === getThemeBaseName(parentState.name);\n\tvar allKeysSchemeOptimized = false;\n\tif (!optimizeForFirstRender) {\n\t\tvar _keys_current1, _schemeKeys_current;\n\t\tvar _keys_current_size;\n\t\tvar keysSize = (_keys_current_size = (_keys_current1 = keys.current) === null || _keys_current1 === void 0 ? void 0 : _keys_current1.size) !== null && _keys_current_size !== void 0 ? _keys_current_size : 0;\n\t\tvar _schemeKeys_current_size;\n\t\tallKeysSchemeOptimized = ((_schemeKeys_current_size = schemeKeys === null || schemeKeys === void 0 ? void 0 : (_schemeKeys_current = schemeKeys.current) === null || _schemeKeys_current === void 0 ? void 0 : _schemeKeys_current.size) !== null && _schemeKeys_current_size !== void 0 ? _schemeKeys_current_size : 0) === keysSize && keysSize > 0;\n\t}\n\tvar canSkipForSchemeChange = !!isSchemeOnlyChange && allKeysSchemeOptimized;\n\tvar needsUpdate = props.passThrough ? false : optimizeForFirstRender ? true : isRoot || props.name === \"light\" || props.name === \"dark\" || props.name === null ? true : !HasRenderedOnce.get(keys) ? true : canSkipForSchemeChange ? false : (keys === null || keys === void 0 ? void 0 : (_keys_current = keys.current) === null || _keys_current === void 0 ? void 0 : _keys_current.size) ? true : (_props_needsUpdate = props.needsUpdate) === null || _props_needsUpdate === void 0 ? void 0 : _props_needsUpdate.call(props);\n\tvar [rerender, nextRaw] = getNextState(local, props, propsKey, isRoot, id, parentId, needsUpdate, PendingUpdate.get(id));\n\tvar next = nextRaw;\n\tif (props.inlineValues && (nextRaw === null || nextRaw === void 0 ? void 0 : nextRaw.theme)) {\n\t\tvar _states_get;\n\t\tvar merged = getMergedInlineTheme(((_states_get = states.get(parentId)) === null || _states_get === void 0 ? void 0 : _states_get.theme) || nextRaw.theme, props.inlineValues, nextRaw.name, getConfig());\n\t\tif (merged !== nextRaw.theme) next = {\n\t\t\t...nextRaw,\n\t\t\ttheme: merged\n\t\t};\n\t}\n\tPendingUpdate.delete(id);\n\tif (!local || rerender) {\n\t\tlocal = { ...next };\n\t\tlocalStates.set(id, local);\n\t}\n\tif (process.env.NODE_ENV === \"development\" && props.debug === \"verbose\") {\n\t\tconsole.groupCollapsed(` ${id} getSnapshot ${rerender}`, local.name, \">\", next.name);\n\t\tconsole.info({\n\t\t\tprops,\n\t\t\tpropsKey,\n\t\t\tisRoot,\n\t\t\tparentId,\n\t\t\tlocal,\n\t\t\tnext,\n\t\t\tneedsUpdate,\n\t\t\tisSchemeOnlyChange,\n\t\t\tallKeysSchemeOptimized,\n\t\t\tcanSkipForSchemeChange\n\t\t});\n\t\tconsole.groupEnd();\n\t}\n\tif (next !== local) {\n\t\tObject.assign(local, next);\n\t\tlocal.id = id;\n\t}\n\tlocal._parentName = parentState === null || parentState === void 0 ? void 0 : parentState.name;\n\tlocal._propsKey = propsKey;\n\tstates.set(id, next);\n\treturn local;\n};\nvar getNextState = function(lastState, props, propsKey) {\n\tvar isRoot = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false, id = arguments.length > 4 ? arguments[4] : void 0, parentId = arguments.length > 5 ? arguments[5] : void 0, needsUpdate = arguments.length > 6 ? arguments[6] : void 0, pendingUpdate = arguments.length > 7 ? arguments[7] : void 0;\n\tvar { debug } = props;\n\tvar parentState = states.get(parentId);\n\tif (props.passThrough) return [false, lastState || parentState || { name: \"\" }];\n\tif (!themes) themes = getConfig().themes;\n\tvar name = !propsKey && (!lastState || !(lastState === null || lastState === void 0 ? void 0 : lastState.isNew)) ? null : getNewThemeName(parentState === null || parentState === void 0 ? void 0 : parentState.name, props, pendingUpdate === \"force\" ? true : !!needsUpdate);\n\tvar isSameAsParent = parentState && (!name || name === parentState.name);\n\tvar shouldRerender = Boolean(pendingUpdate === \"force\" || needsUpdate && (pendingUpdate || (lastState === null || lastState === void 0 ? void 0 : lastState.name) !== (parentState === null || parentState === void 0 ? void 0 : parentState.name)));\n\tif (process.env.NODE_ENV === \"development\" && debug === \"verbose\") {\n\t\tvar message = ` \\xB7 useTheme(${id}) getNextState => ${name} needsUpdate ${needsUpdate} shouldRerender ${shouldRerender}`;\n\t\tconsole.info(message);\n\t}\n\tif (isSameAsParent) {\n\t\tif (!shouldRerender && lastState && lastState.name === parentState.name) return [false, lastState];\n\t\treturn [shouldRerender, {\n\t\t\t...parentState,\n\t\t\tisNew: false\n\t\t}];\n\t}\n\tif (!name) {\n\t\tvar _ref, _ref1;\n\t\tvar next = (_ref1 = (_ref = lastState !== null && lastState !== void 0 ? lastState : parentState) !== null && _ref !== void 0 ? _ref : rootThemeState) !== null && _ref1 !== void 0 ? _ref1 : {\n\t\t\tid,\n\t\t\tname: \"light\",\n\t\t\ttheme: getConfig().themes.light\n\t\t};\n\t\tif (shouldRerender) return [true, { ...parentState || lastState || next }];\n\t\treturn [false, next];\n\t}\n\tvar scheme = getScheme(name);\n\tvar _parentState_inverses;\n\tvar parentInverses = (_parentState_inverses = parentState === null || parentState === void 0 ? void 0 : parentState.inverses) !== null && _parentState_inverses !== void 0 ? _parentState_inverses : 0;\n\tvar isInverse = parentState && scheme !== parentState.scheme;\n\tvar inverses = parentInverses + (isInverse ? 1 : 0);\n\tvar nextState = {\n\t\tid,\n\t\tname,\n\t\ttheme: themes[name],\n\t\tscheme,\n\t\tparentId,\n\t\tparentName: parentState === null || parentState === void 0 ? void 0 : parentState.name,\n\t\tinverses,\n\t\tisInverse,\n\t\tisNew: true\n\t};\n\tif (isRoot) rootThemeState = nextState;\n\tif (pendingUpdate !== \"force\" && lastState && lastState.name === name) return [false, nextState];\n\tvar shouldAvoidRerender = pendingUpdate !== \"force\" && lastState && !needsUpdate && nextState.name === lastState.name;\n\tif (process.env.NODE_ENV === \"development\" && debug === \"verbose\") {\n\t\tconsole.groupCollapsed(` \\xB7 useTheme(${id}) \\u23ED\\uFE0F ${name} shouldAvoidRerender: ${shouldAvoidRerender}`);\n\t\tconsole.info({\n\t\t\tlastState,\n\t\t\tneedsUpdate,\n\t\t\tnextState,\n\t\t\tpendingUpdate\n\t\t});\n\t\tconsole.groupEnd();\n\t}\n\tif (shouldAvoidRerender) return [false, nextState];\n\treturn [true, nextState];\n};\nfunction scheduleUpdate(id) {\n\tvar queue = [id];\n\tvar visited = /* @__PURE__ */ new Set();\n\twhile (queue.length) {\n\t\tvar children = listenersByParent[queue.shift()];\n\t\tif (children) {\n\t\t\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\t\t\ttry {\n\t\t\t\tfor (var _iterator = children[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\t\t\tvar childId = _step.value;\n\t\t\t\t\tif (!visited.has(childId)) {\n\t\t\t\t\t\tvisited.add(childId);\n\t\t\t\t\t\tqueue.push(childId);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\t_didIteratorError = true;\n\t\t\t\t_iteratorError = err;\n\t\t\t} finally {\n\t\t\t\ttry {\n\t\t\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t\t\t} finally {\n\t\t\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tvisited.forEach(function(childId2) {\n\t\tvar cb = allListeners.get(childId2);\n\t\tcb === null || cb === void 0 || cb();\n\t});\n}\nvar validSchemes = {\n\tlight: \"light\",\n\tdark: \"dark\"\n};\nfunction getScheme(name) {\n\treturn validSchemes[name.split(\"_\")[0]];\n}\nfunction getNewThemeName() {\n\tvar parentName = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : \"\", props = arguments.length > 1 ? arguments[1] : void 0, forceUpdate = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;\n\tvar { name, reset } = props;\n\tif (name && reset) throw new Error(formatDiagnostic(\"❌004\", \"Theme\", \"props name and reset are mutually exclusive\", \"Pass either name or reset, not both\", \"name,reset\", {\n\t\tname,\n\t\treset\n\t}));\n\tvar cacheKey = `${parentName}|${name || \"\"}|${reset ? 1 : 0}|${forceUpdate ? 1 : 0}`;\n\tif (themeNameCacheVer !== cacheVersion) {\n\t\tthemeNameCache.clear();\n\t\tthemeNameCacheVer = cacheVersion;\n\t} else {\n\t\tvar cached = themeNameCache.get(cacheKey);\n\t\tif (cached !== void 0) return cached;\n\t}\n\tvar result = resolveThemeName(parentName, name !== null && name !== void 0 ? name : void 0, reset, getConfig().themes, forceUpdate);\n\tif (themeNameCache.size >= 1e4) themeNameCache.clear();\n\tthemeNameCache.set(cacheKey, result);\n\treturn result;\n}\nvar getThemeNameCacheSize = function() {\n\treturn themeNameCache.size;\n};\nfunction resolveThemeName(parentName, name, reset, themes2) {\n\tvar forceUpdate = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : false;\n\tif (reset) {\n\t\tif (parentName === \"light\" || parentName === \"dark\") return parentName === \"light\" ? \"dark\" : \"light\";\n\t\tvar lastPartIndex = parentName.lastIndexOf(\"_\");\n\t\tvar resetName = lastPartIndex <= 0 ? parentName : parentName.slice(lastPartIndex);\n\t\tvar scheme = parentName.slice(0, lastPartIndex);\n\t\treturn themes2[resetName] ? resetName : scheme;\n\t}\n\tvar parentParts = parentName ? parentName.split(\"_\") : [];\n\tvar found = null;\n\tif (name) {\n\t\tvar nameHasScheme = getScheme(name);\n\t\tif (nameHasScheme && name in themes2) found = name;\n\t\tif (!found && !nameHasScheme) for (var i = parentParts.length; i >= 0; i--) {\n\t\t\tvar base = parentParts.slice(0, i).join(\"_\");\n\t\t\tvar potential = base ? `${base}_${name}` : name;\n\t\t\tif (potential in themes2) {\n\t\t\t\tfound = potential;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\tif (!forceUpdate && found === parentName && !validSchemes[found]) return null;\n\treturn found;\n}\nvar getPropsKey = function(param) {\n\tvar { name, reset, forceClassName, inlineValues } = param;\n\treturn `${name || \"\"}${reset || \"\"}${forceClassName || \"\"}${inlineValues ? getInlineValuesKey(inlineValues) : \"\"}`;\n};\nvar hasThemeUpdatingProps = function(props) {\n\treturn \"name\" in props || \"reset\" in props || \"forceClassName\" in props || \"inlineValues\" in props;\n};\n\nexport { ThemeStateContext, forceUpdateThemes, getInlineThemeLayer, getNewThemeName, getRootThemeState, getThemeNameCacheSize, getThemeProviderChainSizes, getThemeProviderParent, getThemeState, hasThemeUpdatingProps, resolveThemeName, useThemeState };"],"mappings":";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AAK,IAAI,IAAI,YAAY,QAAQ,KAAK,GAAG,KAAK;GAC3E,IAAI,OAAO,YAAY,MAAM,GAAG,CAAC,EAAE,KAAK,GAAG;GAC3C,IAAI,YAAY,OAAO,GAAG,KAAK,GAAG,SAAS;GAC3C,IAAI,aAAa,SAAS;IACzB,QAAQ;IACR;GACD;EACD;CACD;CACA,IAAI,CAAC,eAAe,UAAU,cAAc,CAAC,aAAa,QAAQ,OAAO;CACzE,OAAO;AACR;AACA,IAAI,cAAc,SAAS,OAAO;CACjC,IAAI,EAAE,MAAM,OAAO,gBAAgB,iBAAiB;CACpD,OAAO,GAAG,QAAQ,KAAK,SAAS,KAAK,kBAAkB,KAAK,eAAe,mBAAmB,YAAY,IAAI;AAC/G;AACA,IAAI,wBAAwB,SAAS,OAAO;CAC3C,OAAO,UAAU,SAAS,WAAW,SAAS,oBAAoB,SAAS,kBAAkB;AAC9F"}
1
+ {"version":3,"file":"useThemeState.native.js","names":[],"sources":["esm/hooks/useThemeState.native.js"],"sourcesContent":["import { supportsDynamicColorIOS, useIsomorphicLayoutEffect } from \"@tamagui/constants\";\nimport { createContext, useContext, useEffect, useId, useReducer, useRef } from \"react\";\nimport { getConfig, getSetting } from \"../config\";\nimport { formatDiagnostic } from \"../helpers/formatDiagnostic\";\nimport { getInlineValuesKey, getMergedInlineTheme } from \"../helpers/variables\";\nimport { MISSING_THEME_MESSAGE } from \"../constants/constants\";\n\nvar ThemeStateContext = createContext(\"\");\nvar allListeners = /* @__PURE__ */ new Map();\nvar listenersByParent = {};\nvar HasRenderedOnce = /* @__PURE__ */ new WeakMap();\nvar HadTheme = /* @__PURE__ */ new WeakMap();\nvar PendingUpdate = /* @__PURE__ */ new Map();\nvar states = /* @__PURE__ */ new Map();\nvar localStates = /* @__PURE__ */ new Map();\nvar shouldForce = false;\nvar forceUpdateThemes = function() {\n\tcacheVersion++;\n\tshouldForce = true;\n\tallListeners.forEach(function(cb) {\n\t\treturn cb();\n\t});\n\tshouldForce = false;\n};\nvar getThemeState = function(id) {\n\treturn states.get(id);\n};\nvar inlineThemeLayers = /* @__PURE__ */ new Map();\nvar themeProviderParents = /* @__PURE__ */ new Map();\nvar getInlineThemeLayer = function(id) {\n\treturn inlineThemeLayers.get(id);\n};\nvar getThemeProviderParent = function(id) {\n\treturn themeProviderParents.get(id);\n};\nvar getThemeProviderChainSizes = function() {\n\treturn {\n\t\tlayers: inlineThemeLayers.size,\n\t\tparents: themeProviderParents.size\n\t};\n};\nvar registerThemeProviderChain = function(id, parentId, props) {\n\tthemeProviderParents.set(id, parentId);\n\tif (props.inlineValues) inlineThemeLayers.set(id, {\n\t\tinlineValues: props.inlineValues,\n\t\tinlineClassName: props.inlineClassName\n\t});\n\telse inlineThemeLayers.delete(id);\n};\nvar cacheVersion = 0;\nvar themeNameCache = /* @__PURE__ */ new Map();\nvar themeNameCacheVer = -1;\nvar themes = null;\nvar rootThemeState = null;\nvar getRootThemeState = function() {\n\treturn rootThemeState;\n};\nvar getThemeBaseName = function(name) {\n\treturn name.replace(/^(light|dark)_/, \"\");\n};\nvar incReducer = function(c) {\n\treturn c + 1;\n};\nvar useThemeState = function(props) {\n\t\"use no memo\";\n\tvar isRoot = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false, keys = arguments.length > 2 ? arguments[2] : void 0, schemeKeys = arguments.length > 3 ? arguments[3] : void 0, cascadeOnChange = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : false, optimizeForFirstRender = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : false;\n\tvar { disable } = props;\n\tvar parentId = useContext(ThemeStateContext);\n\tif (!parentId && !isRoot) throw new Error(process.env.NODE_ENV === \"development\" ? `${MISSING_THEME_MESSAGE}\n\nLooked for theme${props.name ? ` \"${props.name}\"` : \"\"}, but no parent theme context was found (parentId: ${parentId}).` : MISSING_THEME_MESSAGE);\n\tif (disable) return states.get(parentId) || {\n\t\tid: \"\",\n\t\tname: \"light\",\n\t\ttheme: getConfig().themes.light\n\t};\n\tvar id = useId();\n\tvar propsKey = getPropsKey(props);\n\tif (cascadeOnChange) registerThemeProviderChain(id, parentId, props);\n\tvar ref = useRef(null);\n\tif (!ref.current) ref.current = {\n\t\tid,\n\t\tparentId,\n\t\tprops,\n\t\tpropsKey,\n\t\tisRoot,\n\t\tkeys,\n\t\tschemeKeys,\n\t\toptimizeForFirstRender,\n\t\trenderVersion: 0\n\t};\n\telse {\n\t\tref.current.props = props;\n\t\tref.current.propsKey = propsKey;\n\t\tref.current.isRoot = isRoot;\n\t\tref.current.keys = keys;\n\t\tref.current.schemeKeys = schemeKeys;\n\t\tref.current.parentId = parentId;\n\t}\n\tref.current.renderVersion++;\n\tif (process.env.NODE_ENV === \"development\" && globalThis.time) globalThis.time`theme-prep-uses`;\n\tvar [, forceUpdate] = useReducer(incReducer, 0);\n\tvar state = getSnapshotImpl(ref.current);\n\tref.current.lastSnap = state;\n\tuseEffect(function() {\n\t\tvar r = ref.current;\n\t\tvar renderVersion = r.renderVersion;\n\t\tif (r.lastSnap && !states.has(r.id)) {\n\t\t\tstates.set(r.id, r.lastSnap);\n\t\t\tlocalStates.set(r.id, r.lastSnap);\n\t\t}\n\t\tif (cascadeOnChange && !themeProviderParents.has(r.id)) registerThemeProviderChain(r.id, r.parentId, r.props);\n\t\tif (r.unsubscribe && r.subscribedParentId !== r.parentId) cleanupThemeSubscription(r);\n\t\tif (shouldSubscribeToTheme(r, cascadeOnChange)) {\n\t\t\tif (!r.unsubscribe) {\n\t\t\t\tvar pid = r.parentId;\n\t\t\t\tvar sid = r.id;\n\t\t\t\tvar cb = function(forced) {\n\t\t\t\t\tvar next = getSnapshotImpl(r);\n\t\t\t\t\tif (next !== r.lastSnap) {\n\t\t\t\t\t\tvar _r_props_nativeUpdate, _r_props;\n\t\t\t\t\t\tr.lastSnap = next;\n\t\t\t\t\t\tif (!forced && ((_r_props_nativeUpdate = (_r_props = r.props).nativeUpdate) === null || _r_props_nativeUpdate === void 0 ? void 0 : _r_props_nativeUpdate.call(_r_props, next))) return;\n\t\t\t\t\t\tforceUpdate();\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tlistenersByParent[pid] = listenersByParent[pid] || /* @__PURE__ */ new Set();\n\t\t\t\tlistenersByParent[pid].add(sid);\n\t\t\t\tallListeners.set(sid, function() {\n\t\t\t\t\tvar forced = shouldForce;\n\t\t\t\t\tPendingUpdate.set(sid, forced ? \"force\" : true);\n\t\t\t\t\tcb(forced);\n\t\t\t\t});\n\t\t\t\tr.subscribedParentId = pid;\n\t\t\t\tr.unsubscribe = function() {\n\t\t\t\t\tvar _listenersByParent_pid;\n\t\t\t\t\tallListeners.delete(sid);\n\t\t\t\t\t(_listenersByParent_pid = listenersByParent[pid]) === null || _listenersByParent_pid === void 0 || _listenersByParent_pid.delete(sid);\n\t\t\t\t\tlocalStates.delete(sid);\n\t\t\t\t\tstates.delete(sid);\n\t\t\t\t\tPendingUpdate.delete(sid);\n\t\t\t\t\tr.unsubscribe = void 0;\n\t\t\t\t\tr.subscribedParentId = void 0;\n\t\t\t\t};\n\t\t\t}\n\t\t} else if (r.unsubscribe) cleanupThemeSubscription(r);\n\t\treturn function() {\n\t\t\tif (r.renderVersion === renderVersion) cleanupThemeState(r);\n\t\t};\n\t});\n\tif (cascadeOnChange) useIsomorphicLayoutEffect(function() {\n\t\tif (!HasRenderedOnce.get(keys)) {\n\t\t\tHasRenderedOnce.set(keys, true);\n\t\t\treturn;\n\t\t}\n\t\tif (!propsKey) {\n\t\t\tif (HadTheme.get(keys)) scheduleUpdate(id);\n\t\t\tHadTheme.set(keys, false);\n\t\t\treturn;\n\t\t}\n\t\tif (process.env.NODE_ENV === \"development\" && props.debug === \"verbose\") {\n\t\t\tvar _states_get;\n\t\t\tconsole.warn(` \\xB7 useTheme(${id}) scheduleUpdate`, propsKey, (_states_get = states.get(id)) === null || _states_get === void 0 ? void 0 : _states_get.name);\n\t\t}\n\t\tscheduleUpdate(id);\n\t\tHadTheme.set(keys, true);\n\t}, [keys, propsKey]);\n\treturn state;\n};\nvar shouldSubscribeToTheme = function(r, cascadeOnChange) {\n\tvar _r_keys_current, _r_props_needsUpdate, _r_props;\n\treturn r.optimizeForFirstRender || r.isRoot || cascadeOnChange || hasThemeUpdatingProps(r.props) || !!((_r_keys_current = r.keys.current) === null || _r_keys_current === void 0 ? void 0 : _r_keys_current.size) || !!((_r_props_needsUpdate = (_r_props = r.props).needsUpdate) === null || _r_props_needsUpdate === void 0 ? void 0 : _r_props_needsUpdate.call(_r_props));\n};\nfunction cleanupThemeSubscription(r) {\n\tvar _r_unsubscribe;\n\t(_r_unsubscribe = r.unsubscribe) === null || _r_unsubscribe === void 0 || _r_unsubscribe.call(r);\n}\nfunction cleanupThemeState(r) {\n\tif (r.unsubscribe) cleanupThemeSubscription(r);\n\telse {\n\t\tlocalStates.delete(r.id);\n\t\tstates.delete(r.id);\n\t\tPendingUpdate.delete(r.id);\n\t}\n\tinlineThemeLayers.delete(r.id);\n\tthemeProviderParents.delete(r.id);\n}\nvar getSnapshotImpl = function(r) {\n\tvar _keys_current, _props_needsUpdate;\n\tvar { id, parentId, props, propsKey, isRoot, keys, schemeKeys, optimizeForFirstRender } = r;\n\tvar local = localStates.get(id);\n\tvar parentState = states.get(parentId);\n\tif (local && !PendingUpdate.has(id)) {\n\t\tif (parentState && local._parentName === parentState.name && local._propsKey === propsKey) return local;\n\t}\n\tvar isSchemeOnlyChange = !optimizeForFirstRender && supportsDynamicColorIOS && getSetting(\"fastSchemeChange\") && local && parentState && local.scheme !== parentState.scheme && getThemeBaseName(local.name) === getThemeBaseName(parentState.name);\n\tvar allKeysSchemeOptimized = false;\n\tif (!optimizeForFirstRender) {\n\t\tvar _keys_current1, _schemeKeys_current;\n\t\tvar _keys_current_size;\n\t\tvar keysSize = (_keys_current_size = (_keys_current1 = keys.current) === null || _keys_current1 === void 0 ? void 0 : _keys_current1.size) !== null && _keys_current_size !== void 0 ? _keys_current_size : 0;\n\t\tvar _schemeKeys_current_size;\n\t\tallKeysSchemeOptimized = ((_schemeKeys_current_size = schemeKeys === null || schemeKeys === void 0 ? void 0 : (_schemeKeys_current = schemeKeys.current) === null || _schemeKeys_current === void 0 ? void 0 : _schemeKeys_current.size) !== null && _schemeKeys_current_size !== void 0 ? _schemeKeys_current_size : 0) === keysSize && keysSize > 0;\n\t}\n\tvar canSkipForSchemeChange = !!isSchemeOnlyChange && allKeysSchemeOptimized;\n\tvar needsUpdate = props.passThrough ? false : optimizeForFirstRender ? true : isRoot || props.name === \"light\" || props.name === \"dark\" || props.name === null ? true : !HasRenderedOnce.get(keys) ? true : canSkipForSchemeChange ? false : (keys === null || keys === void 0 ? void 0 : (_keys_current = keys.current) === null || _keys_current === void 0 ? void 0 : _keys_current.size) ? true : (_props_needsUpdate = props.needsUpdate) === null || _props_needsUpdate === void 0 ? void 0 : _props_needsUpdate.call(props);\n\tvar [rerender, nextRaw] = getNextState(local, props, propsKey, isRoot, id, parentId, needsUpdate, PendingUpdate.get(id));\n\tvar next = nextRaw;\n\tif (process.env.TAMAGUI_RUNTIME_INLINE_THEME_VALUES !== \"disabled\" && props.inlineValues && (nextRaw === null || nextRaw === void 0 ? void 0 : nextRaw.theme)) {\n\t\tvar _states_get;\n\t\tvar merged = getMergedInlineTheme(((_states_get = states.get(parentId)) === null || _states_get === void 0 ? void 0 : _states_get.theme) || nextRaw.theme, props.inlineValues, nextRaw.name, getConfig());\n\t\tif (merged !== nextRaw.theme) next = {\n\t\t\t...nextRaw,\n\t\t\ttheme: merged\n\t\t};\n\t}\n\tPendingUpdate.delete(id);\n\tif (!local || rerender) {\n\t\tlocal = { ...next };\n\t\tlocalStates.set(id, local);\n\t}\n\tif (process.env.NODE_ENV === \"development\" && props.debug === \"verbose\") {\n\t\tconsole.groupCollapsed(` ${id} getSnapshot ${rerender}`, local.name, \">\", next.name);\n\t\tconsole.info({\n\t\t\tprops,\n\t\t\tpropsKey,\n\t\t\tisRoot,\n\t\t\tparentId,\n\t\t\tlocal,\n\t\t\tnext,\n\t\t\tneedsUpdate,\n\t\t\tisSchemeOnlyChange,\n\t\t\tallKeysSchemeOptimized,\n\t\t\tcanSkipForSchemeChange\n\t\t});\n\t\tconsole.groupEnd();\n\t}\n\tif (next !== local) {\n\t\tObject.assign(local, next);\n\t\tlocal.id = id;\n\t}\n\tlocal._parentName = parentState === null || parentState === void 0 ? void 0 : parentState.name;\n\tlocal._propsKey = propsKey;\n\tstates.set(id, next);\n\treturn local;\n};\nvar getNextState = function(lastState, props, propsKey) {\n\tvar isRoot = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false, id = arguments.length > 4 ? arguments[4] : void 0, parentId = arguments.length > 5 ? arguments[5] : void 0, needsUpdate = arguments.length > 6 ? arguments[6] : void 0, pendingUpdate = arguments.length > 7 ? arguments[7] : void 0;\n\tvar { debug } = props;\n\tvar parentState = states.get(parentId);\n\tif (props.passThrough) return [false, lastState || parentState || { name: \"\" }];\n\tif (!themes) themes = getConfig().themes;\n\tvar name = !propsKey && (!lastState || !(lastState === null || lastState === void 0 ? void 0 : lastState.isNew)) ? null : getNewThemeName(parentState === null || parentState === void 0 ? void 0 : parentState.name, props, pendingUpdate === \"force\" ? true : !!needsUpdate);\n\tvar isSameAsParent = parentState && (!name || name === parentState.name);\n\tvar shouldRerender = Boolean(pendingUpdate === \"force\" || needsUpdate && (pendingUpdate || (lastState === null || lastState === void 0 ? void 0 : lastState.name) !== (parentState === null || parentState === void 0 ? void 0 : parentState.name)));\n\tif (process.env.NODE_ENV === \"development\" && debug === \"verbose\") {\n\t\tvar message = ` \\xB7 useTheme(${id}) getNextState => ${name} needsUpdate ${needsUpdate} shouldRerender ${shouldRerender}`;\n\t\tconsole.info(message);\n\t}\n\tif (isSameAsParent) {\n\t\tif (!shouldRerender && lastState && lastState.name === parentState.name) return [false, lastState];\n\t\treturn [shouldRerender, {\n\t\t\t...parentState,\n\t\t\tisNew: false\n\t\t}];\n\t}\n\tif (!name) {\n\t\tvar _ref, _ref1;\n\t\tvar next = (_ref1 = (_ref = lastState !== null && lastState !== void 0 ? lastState : parentState) !== null && _ref !== void 0 ? _ref : rootThemeState) !== null && _ref1 !== void 0 ? _ref1 : {\n\t\t\tid,\n\t\t\tname: \"light\",\n\t\t\ttheme: getConfig().themes.light\n\t\t};\n\t\tif (shouldRerender) return [true, { ...parentState || lastState || next }];\n\t\treturn [false, next];\n\t}\n\tvar scheme = getScheme(name);\n\tvar _parentState_inverses;\n\tvar parentInverses = (_parentState_inverses = parentState === null || parentState === void 0 ? void 0 : parentState.inverses) !== null && _parentState_inverses !== void 0 ? _parentState_inverses : 0;\n\tvar isInverse = parentState && scheme !== parentState.scheme;\n\tvar inverses = parentInverses + (isInverse ? 1 : 0);\n\tvar nextState = {\n\t\tid,\n\t\tname,\n\t\ttheme: themes[name],\n\t\tscheme,\n\t\tparentId,\n\t\tparentName: parentState === null || parentState === void 0 ? void 0 : parentState.name,\n\t\tinverses,\n\t\tisInverse,\n\t\tisNew: true\n\t};\n\tif (isRoot) rootThemeState = nextState;\n\tif (pendingUpdate !== \"force\" && lastState && lastState.name === name) return [false, nextState];\n\tvar shouldAvoidRerender = pendingUpdate !== \"force\" && lastState && !needsUpdate && nextState.name === lastState.name;\n\tif (process.env.NODE_ENV === \"development\" && debug === \"verbose\") {\n\t\tconsole.groupCollapsed(` \\xB7 useTheme(${id}) \\u23ED\\uFE0F ${name} shouldAvoidRerender: ${shouldAvoidRerender}`);\n\t\tconsole.info({\n\t\t\tlastState,\n\t\t\tneedsUpdate,\n\t\t\tnextState,\n\t\t\tpendingUpdate\n\t\t});\n\t\tconsole.groupEnd();\n\t}\n\tif (shouldAvoidRerender) return [false, nextState];\n\treturn [true, nextState];\n};\nfunction scheduleUpdate(id) {\n\tvar queue = [id];\n\tvar visited = /* @__PURE__ */ new Set();\n\twhile (queue.length) {\n\t\tvar children = listenersByParent[queue.shift()];\n\t\tif (children) {\n\t\t\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\t\t\ttry {\n\t\t\t\tfor (var _iterator = children[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\t\t\tvar childId = _step.value;\n\t\t\t\t\tif (!visited.has(childId)) {\n\t\t\t\t\t\tvisited.add(childId);\n\t\t\t\t\t\tqueue.push(childId);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\t_didIteratorError = true;\n\t\t\t\t_iteratorError = err;\n\t\t\t} finally {\n\t\t\t\ttry {\n\t\t\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t\t\t} finally {\n\t\t\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tvisited.forEach(function(childId2) {\n\t\tvar cb = allListeners.get(childId2);\n\t\tcb === null || cb === void 0 || cb();\n\t});\n}\nvar validSchemes = {\n\tlight: \"light\",\n\tdark: \"dark\"\n};\nfunction getScheme(name) {\n\treturn validSchemes[name.split(\"_\")[0]];\n}\nfunction getNewThemeName() {\n\tvar parentName = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : \"\", props = arguments.length > 1 ? arguments[1] : void 0, forceUpdate = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;\n\tvar { name, reset } = props;\n\tif (name && reset) throw new Error(formatDiagnostic(\"❌004\", \"Theme\", \"props name and reset are mutually exclusive\", \"Pass either name or reset, not both\", \"name,reset\", {\n\t\tname,\n\t\treset\n\t}));\n\tvar cacheKey = `${parentName}|${name || \"\"}|${reset ? 1 : 0}|${forceUpdate ? 1 : 0}`;\n\tif (themeNameCacheVer !== cacheVersion) {\n\t\tthemeNameCache.clear();\n\t\tthemeNameCacheVer = cacheVersion;\n\t} else {\n\t\tvar cached = themeNameCache.get(cacheKey);\n\t\tif (cached !== void 0) return cached;\n\t}\n\tvar result = resolveThemeName(parentName, name !== null && name !== void 0 ? name : void 0, reset, getConfig().themes, forceUpdate);\n\tif (themeNameCache.size >= 1e4) themeNameCache.clear();\n\tthemeNameCache.set(cacheKey, result);\n\treturn result;\n}\nvar getThemeNameCacheSize = function() {\n\treturn themeNameCache.size;\n};\nfunction resolveThemeName(parentName, name, reset, themes2) {\n\tvar forceUpdate = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : false;\n\tif (reset) {\n\t\tif (parentName === \"light\" || parentName === \"dark\") return parentName === \"light\" ? \"dark\" : \"light\";\n\t\tvar lastPartIndex = parentName.lastIndexOf(\"_\");\n\t\tvar resetName = lastPartIndex <= 0 ? parentName : parentName.slice(lastPartIndex);\n\t\tvar scheme = parentName.slice(0, lastPartIndex);\n\t\treturn themes2[resetName] ? resetName : scheme;\n\t}\n\tvar parentParts = parentName ? parentName.split(\"_\") : [];\n\tvar found = null;\n\tif (name) {\n\t\tvar nameHasScheme = getScheme(name);\n\t\tif (nameHasScheme && name in themes2) found = name;\n\t\tif (!found && !nameHasScheme) for (var i = parentParts.length; i >= 0; i--) {\n\t\t\tvar base = parentParts.slice(0, i).join(\"_\");\n\t\t\tvar potential = base ? `${base}_${name}` : name;\n\t\t\tif (potential in themes2) {\n\t\t\t\tfound = potential;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\tif (!forceUpdate && found === parentName && !validSchemes[found]) return null;\n\treturn found;\n}\nvar getPropsKey = function(param) {\n\tvar { name, reset, forceClassName, inlineValues } = param;\n\treturn `${name || \"\"}${reset || \"\"}${forceClassName || \"\"}${process.env.TAMAGUI_RUNTIME_INLINE_THEME_VALUES !== \"disabled\" && inlineValues ? getInlineValuesKey(inlineValues) : \"\"}`;\n};\nvar hasThemeUpdatingProps = function(props) {\n\treturn \"name\" in props || \"reset\" in props || \"forceClassName\" in props || \"inlineValues\" in props;\n};\n\nexport { ThemeStateContext, forceUpdateThemes, getInlineThemeLayer, getNewThemeName, getRootThemeState, getThemeNameCacheSize, getThemeProviderChainSizes, getThemeProviderParent, getThemeState, hasThemeUpdatingProps, resolveTheme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,QAAQ;EAC9C,IAAI,CAAC,SAAS,CAAC,eAAe,KAAK,IAAI,IAAI,YAAY,QAAQ,KAAK,GAAG,KAAK;GAC3E,IAAI,OAAO,YAAY,MAAM,GAAG,CAAC,EAAE,KAAK,GAAG;GAC3C,IAAI,YAAY,OAAO,GAAG,KAAK,GAAG,SAAS;GAC3C,IAAI,aAAa,SAAS;IACzB,QAAQ;IACR;GACD;EACD;CACD;CACA,IAAI,CAAC,eAAe,UAAU,cAAc,CAAC,aAAa,QAAQ,OAAO;CACzE,OAAO;AACR;AACA,IAAI,cAAc,SAAS,OAAO;CACjC,IAAI,EAAE,MAAM,OAAO,gBAAgB,iBAAiB;CACpD,OAAO,GAAG,QAAQ,KAAK,SAAS,KAAK,kBAAkB,KAAK,QAAQ,IAAI,wCAAwC,cAAc,eAAe,mBAAmB,YAAY,IAAI;AACjL;AACA,IAAI,wBAAwB,SAAS,OAAO;CAC3C,OAAO,UAAU,SAAS,WAAW,SAAS,oBAAoB,SAAS,kBAAkB;AAC9F"}
@@ -10,7 +10,9 @@ import { textStaticConfig } from "./views/Text.mjs";
10
10
  import { viewStaticConfig } from "./views/View.mjs";
11
11
  import { STYLE_FRONTEND_PASSTHROUGH_PREFIX, STYLE_FRONTEND_PREPROCESSED, regularStyleFrontend } from "./helpers/styleFrontend.mjs";
12
12
 
13
- const createFrontendProgram = createFrontendProgram$1;
13
+ const createFrontendProgram = process.env.TAMAGUI_RUNTIME_STYLE_VALUE_GRAMMAR === "disabled" ? () => {
14
+ throw new Error("createFrontendProgram requires experimental.webRuntimeFeatures.styleValueGrammar");
15
+ } : createFrontendProgram$1;
14
16
  const plainValueToPayload = (value, property) => {
15
17
  if (typeof value === "string") return value;
16
18
  if (typeof value !== "number" || !Number.isFinite(value)) return null;
@@ -1 +1 @@
1
- {"version":3,"file":"internal-runtime.js","names":["createFrontendProgramImpl","createTamaguiImpl","setupHooksImpl","TamaguiProviderImpl","createFrontendStyledImpl"],"sources":["esm/internal-runtime.js"],"sourcesContent":["import { stylePropsUnitless } from \"@tamagui/helpers\";\nimport { createComponent } from \"./createComponent\";\nimport { setComponentDisplayName } from \"./helpers/componentDisplayName\";\nimport { createFrontendProgram as createFrontendProgramImpl } from \"./helpers/frontendProgram\";\nimport { createTamagui as createTamaguiImpl } from \"./createTamagui\";\nimport { setupHooks as setupHooksImpl } from \"./setupHooks\";\nimport { createFrontendStyled as createFrontendStyledImpl } from \"./styled\";\nimport { TamaguiProvider as TamaguiProviderImpl } from \"./views/TamaguiProvider\";\nimport { textStaticConfig } from \"./views/Text\";\nimport { viewStaticConfig } from \"./views/View\";\nimport {\n STYLE_FRONTEND_PASSTHROUGH_PREFIX,\n STYLE_FRONTEND_PREPROCESSED,\n regularStyleFrontend\n} from \"./helpers/styleFrontend\";\nconst createFrontendProgram = createFrontendProgramImpl;\nconst plainValueToPayload = (value, property) => {\n if (typeof value === \"string\") return value;\n if (typeof value !== \"number\" || !Number.isFinite(value)) return null;\n if (property === \"rotate\" || property === \"rotateX\" || property === \"rotateY\" || property === \"rotateZ\") {\n return value === 0 ? \"0\" : `${value}deg`;\n }\n if (property === \"x\" || property === \"y\" || property === \"perspective\" || property === \"translateX\" || property === \"translateY\") {\n return value === 0 ? \"0\" : `${value}px`;\n }\n return stylePropsUnitless[property] ? String(value) : `${value}px`;\n};\nconst createTamagui = createTamaguiImpl;\nconst setupHooks = setupHooksImpl;\nconst TamaguiProvider = TamaguiProviderImpl;\nfunction createFrontendStyled(frontend) {\n return createFrontendStyledImpl(frontend);\n}\nfunction createFrontendViews(frontend) {\n return {\n View: setComponentDisplayName(\n createComponent({ ...viewStaticConfig, styleFrontend: frontend }),\n \"View\"\n ),\n Text: setComponentDisplayName(\n createComponent({ ...textStaticConfig, styleFrontend: frontend }),\n \"Text\"\n )\n };\n}\nexport {\n STYLE_FRONTEND_PASSTHROUGH_PREFIX,\n STYLE_FRONTEND_PREPROCESSED,\n TamaguiProvider,\n createFrontendProgram,\n createFrontendStyled,\n createFrontendViews,\n createTamagui,\n plainValueToPayload,\n regularStyleFrontend,\n setupHooks\n};\n//# sourceMappingURL=internal-runtime.js.map\n"],"mappings":";;;;;;;;;;;;;AAeA,MAAM,wBAAwBA;AAC9B,MAAM,uBAAuB,OAAO,aAAa;CAC/C,IAAI,OAAO,UAAU,UAAU,OAAO;CACtC,IAAI,OAAO,UAAU,YAAY,CAAC,OAAO,SAAS,KAAK,GAAG,OAAO;CACjE,IAAI,aAAa,YAAY,aAAa,aAAa,aAAa,aAAa,aAAa,WAAW;EACvG,OAAO,UAAU,IAAI,MAAM,GAAG,MAAM;CACtC;CACA,IAAI,aAAa,OAAO,aAAa,OAAO,aAAa,iBAAiB,aAAa,gBAAgB,aAAa,cAAc;EAChI,OAAO,UAAU,IAAI,MAAM,GAAG,MAAM;CACtC;CACA,OAAO,mBAAmB,YAAY,OAAO,KAAK,IAAI,GAAG,MAAM;AACjE;AACA,MAAM,gBAAgBC;AACtB,MAAM,aAAaC;AACnB,MAAM,kBAAkBC;AACxB,SAAS,qBAAqB,UAAU;CACtC,OAAOC,uBAAyB,QAAQ;AAC1C;AACA,SAAS,oBAAoB,UAAU;CACrC,OAAO;EACL,MAAM,wBACJ,gBAAgB;GAAE,GAAG;GAAkB,eAAe;EAAS,CAAC,GAChE,MACF;EACA,MAAM,wBACJ,gBAAgB;GAAE,GAAG;GAAkB,eAAe;EAAS,CAAC,GAChE,MACF;CACF;AACF"}
1
+ {"version":3,"file":"internal-runtime.js","names":["createFrontendProgramImpl","createTamaguiImpl","setupHooksImpl","TamaguiProviderImpl","createFrontendStyledImpl"],"sources":["esm/internal-runtime.js"],"sourcesContent":["import { stylePropsUnitless } from \"@tamagui/helpers\";\nimport { createComponent } from \"./createComponent\";\nimport { setComponentDisplayName } from \"./helpers/componentDisplayName\";\nimport { createFrontendProgram as createFrontendProgramImpl } from \"./helpers/frontendProgram\";\nimport { createTamagui as createTamaguiImpl } from \"./createTamagui\";\nimport { setupHooks as setupHooksImpl } from \"./setupHooks\";\nimport { createFrontendStyled as createFrontendStyledImpl } from \"./styled\";\nimport { TamaguiProvider as TamaguiProviderImpl } from \"./views/TamaguiProvider\";\nimport { textStaticConfig } from \"./views/Text\";\nimport { viewStaticConfig } from \"./views/View\";\nimport {\n STYLE_FRONTEND_PASSTHROUGH_PREFIX,\n STYLE_FRONTEND_PREPROCESSED,\n regularStyleFrontend\n} from \"./helpers/styleFrontend\";\nconst createFrontendProgram = process.env.TAMAGUI_RUNTIME_STYLE_VALUE_GRAMMAR === \"disabled\" ? () => {\n throw new Error(\n \"createFrontendProgram requires experimental.webRuntimeFeatures.styleValueGrammar\"\n );\n} : createFrontendProgramImpl;\nconst plainValueToPayload = (value, property) => {\n if (typeof value === \"string\") return value;\n if (typeof value !== \"number\" || !Number.isFinite(value)) return null;\n if (property === \"rotate\" || property === \"rotateX\" || property === \"rotateY\" || property === \"rotateZ\") {\n return value === 0 ? \"0\" : `${value}deg`;\n }\n if (property === \"x\" || property === \"y\" || property === \"perspective\" || property === \"translateX\" || property === \"translateY\") {\n return value === 0 ? \"0\" : `${value}px`;\n }\n return stylePropsUnitless[property] ? String(value) : `${value}px`;\n};\nconst createTamagui = createTamaguiImpl;\nconst setupHooks = setupHooksImpl;\nconst TamaguiProvider = TamaguiProviderImpl;\nfunction createFrontendStyled(frontend) {\n return createFrontendStyledImpl(frontend);\n}\nfunction createFrontendViews(frontend) {\n return {\n View: setComponentDisplayName(\n createComponent({ ...viewStaticConfig, styleFrontend: frontend }),\n \"View\"\n ),\n Text: setComponentDisplayName(\n createComponent({ ...textStaticConfig, styleFrontend: frontend }),\n \"Text\"\n )\n };\n}\nexport {\n STYLE_FRONTEND_PASSTHROUGH_PREFIX,\n STYLE_FRONTEND_PREPROCESSED,\n TamaguiProvider,\n createFrontendProgram,\n createFrontendStyled,\n createFrontendViews,\n createTamagui,\n plainValueToPayload,\n regularStyleFrontend,\n setupHooks\n};\n//# sourceMappingURL=internal-runtime.js.map\n"],"mappings":";;;;;;;;;;;;;AAeA,MAAM,wBAAwB,QAAQ,IAAI,wCAAwC,mBAAmB;CACnG,MAAM,IAAI,MACR,kFACF;AACF,IAAIA;AACJ,MAAM,uBAAuB,OAAO,aAAa;CAC/C,IAAI,OAAO,UAAU,UAAU,OAAO;CACtC,IAAI,OAAO,UAAU,YAAY,CAAC,OAAO,SAAS,KAAK,GAAG,OAAO;CACjE,IAAI,aAAa,YAAY,aAAa,aAAa,aAAa,aAAa,aAAa,WAAW;EACvG,OAAO,UAAU,IAAI,MAAM,GAAG,MAAM;CACtC;CACA,IAAI,aAAa,OAAO,aAAa,OAAO,aAAa,iBAAiB,aAAa,gBAAgB,aAAa,cAAc;EAChI,OAAO,UAAU,IAAI,MAAM,GAAG,MAAM;CACtC;CACA,OAAO,mBAAmB,YAAY,OAAO,KAAK,IAAI,GAAG,MAAM;AACjE;AACA,MAAM,gBAAgBC;AACtB,MAAM,aAAaC;AACnB,MAAM,kBAAkBC;AACxB,SAAS,qBAAqB,UAAU;CACtC,OAAOC,uBAAyB,QAAQ;AAC1C;AACA,SAAS,oBAAoB,UAAU;CACrC,OAAO;EACL,MAAM,wBACJ,gBAAgB;GAAE,GAAG;GAAkB,eAAe;EAAS,CAAC,GAChE,MACF;EACA,MAAM,wBACJ,gBAAgB;GAAE,GAAG;GAAkB,eAAe;EAAS,CAAC,GAChE,MACF;CACF;AACF"}
@@ -10,7 +10,9 @@ import { textStaticConfig } from "./views/Text.native.js";
10
10
  import { viewStaticConfig } from "./views/View.native.js";
11
11
  import { STYLE_FRONTEND_PASSTHROUGH_PREFIX, STYLE_FRONTEND_PREPROCESSED, regularStyleFrontend } from "./helpers/styleFrontend.native.js";
12
12
 
13
- var createFrontendProgram = createFrontendProgram$1;
13
+ var createFrontendProgram = process.env.TAMAGUI_RUNTIME_STYLE_VALUE_GRAMMAR === "disabled" ? function() {
14
+ throw new Error("createFrontendProgram requires experimental.webRuntimeFeatures.styleValueGrammar");
15
+ } : createFrontendProgram$1;
14
16
  var plainValueToPayload = function(value, property) {
15
17
  if (typeof value === "string") return value;
16
18
  if (typeof value !== "number" || !Number.isFinite(value)) return null;
@@ -1 +1 @@
1
- {"version":3,"file":"internal-runtime.native.js","names":["createFrontendProgramImpl","createTamaguiImpl","setupHooksImpl","TamaguiProviderImpl","createFrontendStyledImpl"],"sources":["esm/internal-runtime.native.js"],"sourcesContent":["import { stylePropsUnitless } from \"@tamagui/helpers\";\nimport { createComponent } from \"./createComponent\";\nimport { setComponentDisplayName } from \"./helpers/componentDisplayName\";\nimport { createFrontendProgram as createFrontendProgramImpl } from \"./helpers/frontendProgram\";\nimport { createTamagui as createTamaguiImpl } from \"./createTamagui\";\nimport { setupHooks as setupHooksImpl } from \"./setupHooks\";\nimport { createFrontendStyled as createFrontendStyledImpl } from \"./styled\";\nimport { TamaguiProvider as TamaguiProviderImpl } from \"./views/TamaguiProvider\";\nimport { textStaticConfig } from \"./views/Text\";\nimport { viewStaticConfig } from \"./views/View\";\nimport { STYLE_FRONTEND_PASSTHROUGH_PREFIX, STYLE_FRONTEND_PREPROCESSED, regularStyleFrontend } from \"./helpers/styleFrontend\";\nvar createFrontendProgram = createFrontendProgramImpl;\nvar plainValueToPayload = function(value, property) {\n if (typeof value === \"string\") return value;\n if (typeof value !== \"number\" || !Number.isFinite(value)) return null;\n if (property === \"rotate\" || property === \"rotateX\" || property === \"rotateY\" || property === \"rotateZ\") {\n return value === 0 ? \"0\" : `${value}deg`;\n }\n if (property === \"x\" || property === \"y\" || property === \"perspective\" || property === \"translateX\" || property === \"translateY\") {\n return value === 0 ? \"0\" : `${value}px`;\n }\n return stylePropsUnitless[property] ? String(value) : `${value}px`;\n};\nvar createTamagui = createTamaguiImpl;\nvar setupHooks = setupHooksImpl;\nvar TamaguiProvider = TamaguiProviderImpl;\nfunction createFrontendStyled(frontend) {\n return createFrontendStyledImpl(frontend);\n}\nfunction createFrontendViews(frontend) {\n return {\n View: setComponentDisplayName(createComponent({\n ...viewStaticConfig,\n styleFrontend: frontend\n }), \"View\"),\n Text: setComponentDisplayName(createComponent({\n ...textStaticConfig,\n styleFrontend: frontend\n }), \"Text\")\n };\n}\nexport {\n STYLE_FRONTEND_PASSTHROUGH_PREFIX,\n STYLE_FRONTEND_PREPROCESSED,\n TamaguiProvider,\n createFrontendProgram,\n createFrontendStyled,\n createFrontendViews,\n createTamagui,\n plainValueToPayload,\n regularStyleFrontend,\n setupHooks\n};\n//# sourceMappingURL=internal-runtime.js.map\n"],"mappings":";;;;;;;;;;;;;AAWA,IAAI,wBAAwBA;AAC5B,IAAI,sBAAsB,SAAS,OAAO,UAAU;CAClD,IAAI,OAAO,UAAU,UAAU,OAAO;CACtC,IAAI,OAAO,UAAU,YAAY,CAAC,OAAO,SAAS,KAAK,GAAG,OAAO;CACjE,IAAI,aAAa,YAAY,aAAa,aAAa,aAAa,aAAa,aAAa,WAAW;EACvG,OAAO,UAAU,IAAI,MAAM,GAAG,MAAM;CACtC;CACA,IAAI,aAAa,OAAO,aAAa,OAAO,aAAa,iBAAiB,aAAa,gBAAgB,aAAa,cAAc;EAChI,OAAO,UAAU,IAAI,MAAM,GAAG,MAAM;CACtC;CACA,OAAO,mBAAmB,YAAY,OAAO,KAAK,IAAI,GAAG,MAAM;AACjE;AACA,IAAI,gBAAgBC;AACpB,IAAI,aAAaC;AACjB,IAAI,kBAAkBC;AACtB,SAAS,qBAAqB,UAAU;CACtC,OAAOC,uBAAyB,QAAQ;AAC1C;AACA,SAAS,oBAAoB,UAAU;CACrC,OAAO;EACL,MAAM,wBAAwB,gBAAgB;GAC5C,GAAG;GACH,eAAe;EACjB,CAAC,GAAG,MAAM;EACV,MAAM,wBAAwB,gBAAgB;GAC5C,GAAG;GACH,eAAe;EACjB,CAAC,GAAG,MAAM;CACZ;AACF"}
1
+ {"version":3,"file":"internal-runtime.native.js","names":["createFrontendProgramImpl","createTamaguiImpl","setupHooksImpl","TamaguiProviderImpl","createFrontendStyledImpl"],"sources":["esm/internal-runtime.native.js"],"sourcesContent":["import { stylePropsUnitless } from \"@tamagui/helpers\";\nimport { createComponent } from \"./createComponent\";\nimport { setComponentDisplayName } from \"./helpers/componentDisplayName\";\nimport { createFrontendProgram as createFrontendProgramImpl } from \"./helpers/frontendProgram\";\nimport { createTamagui as createTamaguiImpl } from \"./createTamagui\";\nimport { setupHooks as setupHooksImpl } from \"./setupHooks\";\nimport { createFrontendStyled as createFrontendStyledImpl } from \"./styled\";\nimport { TamaguiProvider as TamaguiProviderImpl } from \"./views/TamaguiProvider\";\nimport { textStaticConfig } from \"./views/Text\";\nimport { viewStaticConfig } from \"./views/View\";\nimport { STYLE_FRONTEND_PASSTHROUGH_PREFIX, STYLE_FRONTEND_PREPROCESSED, regularStyleFrontend } from \"./helpers/styleFrontend\";\nvar createFrontendProgram = process.env.TAMAGUI_RUNTIME_STYLE_VALUE_GRAMMAR === \"disabled\" ? function() {\n throw new Error(\"createFrontendProgram requires experimental.webRuntimeFeatures.styleValueGrammar\");\n} : createFrontendProgramImpl;\nvar plainValueToPayload = function(value, property) {\n if (typeof value === \"string\") return value;\n if (typeof value !== \"number\" || !Number.isFinite(value)) return null;\n if (property === \"rotate\" || property === \"rotateX\" || property === \"rotateY\" || property === \"rotateZ\") {\n return value === 0 ? \"0\" : `${value}deg`;\n }\n if (property === \"x\" || property === \"y\" || property === \"perspective\" || property === \"translateX\" || property === \"translateY\") {\n return value === 0 ? \"0\" : `${value}px`;\n }\n return stylePropsUnitless[property] ? String(value) : `${value}px`;\n};\nvar createTamagui = createTamaguiImpl;\nvar setupHooks = setupHooksImpl;\nvar TamaguiProvider = TamaguiProviderImpl;\nfunction createFrontendStyled(frontend) {\n return createFrontendStyledImpl(frontend);\n}\nfunction createFrontendViews(frontend) {\n return {\n View: setComponentDisplayName(createComponent({\n ...viewStaticConfig,\n styleFrontend: frontend\n }), \"View\"),\n Text: setComponentDisplayName(createComponent({\n ...textStaticConfig,\n styleFrontend: frontend\n }), \"Text\")\n };\n}\nexport {\n STYLE_FRONTEND_PASSTHROUGH_PREFIX,\n STYLE_FRONTEND_PREPROCESSED,\n TamaguiProvider,\n createFrontendProgram,\n createFrontendStyled,\n createFrontendViews,\n createTamagui,\n plainValueToPayload,\n regularStyleFrontend,\n setupHooks\n};\n//# sourceMappingURL=internal-runtime.js.map\n"],"mappings":";;;;;;;;;;;;;AAWA,IAAI,wBAAwB,QAAQ,IAAI,wCAAwC,aAAa,WAAW;CACtG,MAAM,IAAI,MAAM,kFAAkF;AACpG,IAAIA;AACJ,IAAI,sBAAsB,SAAS,OAAO,UAAU;CAClD,IAAI,OAAO,UAAU,UAAU,OAAO;CACtC,IAAI,OAAO,UAAU,YAAY,CAAC,OAAO,SAAS,KAAK,GAAG,OAAO;CACjE,IAAI,aAAa,YAAY,aAAa,aAAa,aAAa,aAAa,aAAa,WAAW;EACvG,OAAO,UAAU,IAAI,MAAM,GAAG,MAAM;CACtC;CACA,IAAI,aAAa,OAAO,aAAa,OAAO,aAAa,iBAAiB,aAAa,gBAAgB,aAAa,cAAc;EAChI,OAAO,UAAU,IAAI,MAAM,GAAG,MAAM;CACtC;CACA,OAAO,mBAAmB,YAAY,OAAO,KAAK,IAAI,GAAG,MAAM;AACjE;AACA,IAAI,gBAAgBC;AACpB,IAAI,aAAaC;AACjB,IAAI,kBAAkBC;AACtB,SAAS,qBAAqB,UAAU;CACtC,OAAOC,uBAAyB,QAAQ;AAC1C;AACA,SAAS,oBAAoB,UAAU;CACrC,OAAO;EACL,MAAM,wBAAwB,gBAAgB;GAC5C,GAAG;GACH,eAAe;EACjB,CAAC,GAAG,MAAM;EACV,MAAM,wBAAwB,gBAAgB;GAC5C,GAAG;GACH,eAAe;EACjB,CAAC,GAAG,MAAM;CACZ;AACF"}
@@ -19,7 +19,7 @@ const Theme = createRefComponent(function Theme2(props, ref) {
19
19
  const { passThrough } = props;
20
20
  const isRoot = !!props["_isRoot"];
21
21
  const config = getConfig();
22
- const inlineValues = getInlineValuesFromProps(props, config);
22
+ const inlineValues = process.env.TAMAGUI_RUNTIME_INLINE_THEME_VALUES === "disabled" ? null : getInlineValuesFromProps(props, config);
23
23
  let inlineCSS = null;
24
24
  let rulesToInsert = null;
25
25
  if (inlineValues) {
@@ -1 +1 @@
1
- {"version":3,"file":"Theme.js","names":[],"sources":["esm/views/Theme.js"],"sourcesContent":["import { createRefComponent } from \"@tamagui/compose-refs\";\nimport { isWeb, useIsomorphicLayoutEffect } from \"@tamagui/constants\";\nimport { getThemeClassNames } from \"@tamagui/helpers\";\nimport React, { Children, cloneElement, isValidElement, useRef } from \"react\";\nimport { getConfig } from \"../config\";\nimport { variableToString } from \"../createVariable\";\nimport { formatDiagnostic } from \"../helpers/formatDiagnostic\";\nimport { insertStyleRules, shouldInsertStyleRules, updateRules } from \"../helpers/insertStyleRule\";\nimport { getInlineValuesFromProps, getVariablesCSSRules } from \"../helpers/variables\";\nimport { useThemeWithState } from \"../hooks/useTheme\";\nimport { ThemeStateContext, getThemeState, hasThemeUpdatingProps } from \"../hooks/useThemeState\";\nimport { ThemeDebug } from \"./ThemeDebug\";\nimport { jsx } from \"react/jsx-runtime\";\n\nconst useInsertEffectCompat = isWeb ? React.useInsertionEffect || useIsomorphicLayoutEffect : () => {};\nconst Theme = createRefComponent(function Theme2(props, ref) {\n\t\"use no memo\";\n\tif (props.disable) return props.children;\n\tconst { passThrough } = props;\n\tconst isRoot = !!props[\"_isRoot\"];\n\tconst config = getConfig();\n\tconst inlineValues = getInlineValuesFromProps(props, config);\n\tlet inlineCSS = null;\n\tlet rulesToInsert = null;\n\tif (inlineValues) {\n\t\tinlineCSS = getVariablesCSSRules(inlineValues, config);\n\t\tif (inlineCSS && shouldInsertStyleRules(inlineCSS.identifier)) {\n\t\t\tupdateRules(inlineCSS.identifier, inlineCSS.rules);\n\t\t\trulesToInsert = { [inlineCSS.identifier]: [\n\t\t\t\t\"variables\",\n\t\t\t\t\"\",\n\t\t\t\tinlineCSS.identifier,\n\t\t\t\tvoid 0,\n\t\t\t\tinlineCSS.rules\n\t\t\t] };\n\t\t}\n\t}\n\tuseInsertEffectCompat(() => {\n\t\tif (rulesToInsert) insertStyleRules(rulesToInsert);\n\t}, [inlineCSS?.identifier]);\n\tconst themeProps = inlineValues ? {\n\t\t...props,\n\t\tinlineValues,\n\t\tinlineClassName: inlineCSS?.identifier\n\t} : props;\n\tconst [_, themeState] = useThemeWithState(themeProps, isRoot, true);\n\tuseIsomorphicLayoutEffect(() => {}, [\n\t\tthemeState.id,\n\t\tthemeState.name,\n\t\tthemeState.theme\n\t]);\n\tlet finalChildren = props[\"disable-child-theme\"] ? Children.map(props.children, (child) => passThrough || !isValidElement(child) ? child : cloneElement(child, { [\"data-disable-theme\"]: true })) : props.children;\n\tif (ref) try {\n\t\tReact.Children.only(finalChildren);\n\t\tfinalChildren = cloneElement(finalChildren, { ref });\n\t} catch {}\n\tconst stateRef = useRef({ hasEverThemed: false });\n\treturn getThemedChildren(themeState, finalChildren, themeProps, isRoot, stateRef, passThrough);\n});\nTheme[\"avoidForwardRef\"] = true;\nfunction getThemedChildren(themeState, children, props, isRoot = false, stateRef, passThrough = false) {\n\tconst { shallow, forceClassName } = props;\n\tconst state = stateRef.current;\n\tlet shouldRenderChildrenWithTheme = state.hasEverThemed || themeState.isNew || isRoot || hasThemeUpdatingProps(props);\n\tif (process.env.NODE_ENV === \"development\" && props.debug === \"visualize\") children = /* @__PURE__ */ jsx(ThemeDebug, {\n\t\tthemeState,\n\t\tthemeProps: props,\n\t\tchildren\n\t});\n\tif (!shouldRenderChildrenWithTheme) return children;\n\tchildren = /* @__PURE__ */ jsx(ThemeStateContext.Provider, {\n\t\tvalue: themeState.id,\n\t\tchildren\n\t});\n\tconst { isInverse, name } = themeState;\n\tconst requiresExtraWrapper = isInverse || forceClassName;\n\tif (!state.hasEverThemed) state.hasEverThemed = true;\n\tif (requiresExtraWrapper || themeState.name === \"dark\" || themeState.name === \"light\") state.hasEverThemed = \"wrapped\";\n\tif (shallow) if (!themeState.parentId) {} else {\n\t\tconst parentState = getThemeState(themeState.isNew ? themeState.id : themeState.parentId);\n\t\tif (!parentState) throw new Error(formatDiagnostic(\"‼️010\", \"Theme\", \"parent theme state is missing for shallow rendering\", \"Keep <Theme shallow> inside its mounted parent Theme\", \"name,parentId\", {\n\t\t\tname: themeState.name,\n\t\t\tparentId: themeState.parentId\n\t\t}));\n\t\tchildren = Children.toArray(children).map((child) => {\n\t\t\treturn isValidElement(child) ? passThrough ? child : cloneElement(child, void 0, /* @__PURE__ */ jsx(Theme, {\n\t\t\t\tname: parentState.name,\n\t\t\t\tchildren: child.props.children\n\t\t\t})) : child;\n\t\t});\n\t}\n\tif (process.env.NODE_ENV === \"development\") {\n\t\tif (!passThrough && props.debug) console.warn(` getThemedChildren`, {\n\t\t\trequiresExtraWrapper,\n\t\t\tforceClassName,\n\t\t\tthemeState,\n\t\t\tstate,\n\t\t\tthemeSpanProps: getThemeClassNameAndColor(themeState, props, isRoot)\n\t\t});\n\t}\n\tif (forceClassName === false) return children;\n\tif (isWeb) {\n\t\tconst baseStyle = props.contain ? inertContainedStyle : inertStyle;\n\t\tconst { className = \"\", color } = passThrough ? {} : getThemeClassNameAndColor(themeState, props, isRoot);\n\t\tconst inlineClassName = passThrough ? void 0 : props.inlineClassName;\n\t\tchildren = /* @__PURE__ */ jsx(\"span\", {\n\t\t\tclassName: `${className} is_Theme${inlineClassName ? ` ${inlineClassName}` : \"\"}`,\n\t\t\tstyle: passThrough ? baseStyle : {\n\t\t\t\tcolor,\n\t\t\t\t...baseStyle\n\t\t\t},\n\t\t\tchildren\n\t\t});\n\t\tif (state.hasEverThemed === \"wrapped\") children = /* @__PURE__ */ jsx(\"span\", {\n\t\t\tclassName: requiresExtraWrapper ? `${name.startsWith(\"light\") ? \"t_light\" : name.startsWith(\"dark\") ? \"t_dark\" : \"\"} _dsp_contents` : `_dsp_contents`,\n\t\t\tchildren\n\t\t});\n\t\treturn children;\n\t}\n\treturn children;\n}\nconst inertStyle = { display: \"contents\" };\nconst inertContainedStyle = {\n\tdisplay: \"contents\",\n\tcontain: \"strict\"\n};\nconst empty = {\n\tclassName: \"\",\n\tcolor: void 0\n};\nfunction getThemeClassNameAndColor(themeState, props, isRoot = false) {\n\tif (!themeState.isNew && !props.forceClassName) return empty;\n\treturn {\n\t\tcolor: themeState?.theme && themeState.isNew ? variableToString(themeState.theme.color) : \"\",\n\t\tclassName: getThemeClassNames(themeState.name, isRoot)\n\t};\n}\n\nexport { Theme, getThemedChildren };"],"mappings":";;;;;;;;;;;;;;;AAcA,MAAM,wBAAwB,QAAQ,MAAM,sBAAsB,kCAAkC,CAAC;AACrG,MAAM,QAAQ,mBAAmB,SAAS,OAAO,OAAO,KAAK;CAC5D;CACA,IAAI,MAAM,SAAS,OAAO,MAAM;CAChC,MAAM,EAAE,gBAAgB;CACxB,MAAM,SAAS,CAAC,CAAC,MAAM;CACvB,MAAM,SAAS,UAAU;CACzB,MAAM,eAAe,yBAAyB,OAAO,MAAM;CAC3D,IAAI,YAAY;CAChB,IAAI,gBAAgB;CACpB,IAAI,cAAc;EACjB,YAAY,qBAAqB,cAAc,MAAM;EACrD,IAAI,aAAa,uBAAuB,UAAU,UAAU,GAAG;GAC9D,YAAY,UAAU,YAAY,UAAU,KAAK;GACjD,gBAAgB,GAAG,UAAU,aAAa;IACzC;IACA;IACA,UAAU;IACV,KAAK;IACL,UAAU;GACX,EAAE;EACH;CACD;CACA,4BAA4B;EAC3B,IAAI,eAAe,iBAAiB,aAAa;CAClD,GAAG,CAAC,WAAW,UAAU,CAAC;CAC1B,MAAM,aAAa,eAAe;EACjC,GAAG;EACH;EACA,iBAAiB,WAAW;CAC7B,IAAI;CACJ,MAAM,CAAC,GAAG,cAAc,kBAAkB,YAAY,QAAQ,IAAI;CAClE,gCAAgC,CAAC,GAAG;EACnC,WAAW;EACX,WAAW;EACX,WAAW;CACZ,CAAC;CACD,IAAI,gBAAgB,MAAM,yBAAyB,SAAS,IAAI,MAAM,WAAW,UAAU,eAAe,CAAC,eAAe,KAAK,IAAI,QAAQ,aAAa,OAAO,GAAG,uBAAu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Theme.js","names":[],"sources":["esm/views/Theme.js"],"sourcesContent":["import { createRefComponent } from \"@tamagui/compose-refs\";\nimport { isWeb, useIsomorphicLayoutEffect } from \"@tamagui/constants\";\nimport { getThemeClassNames } from \"@tamagui/helpers\";\nimport React, { Children, cloneElement, isValidElement, useRef } from \"react\";\nimport { getConfig } from \"../config\";\nimport { variableToString } from \"../createVariable\";\nimport { formatDiagnostic } from \"../helpers/formatDiagnostic\";\nimport { insertStyleRules, shouldInsertStyleRules, updateRules } from \"../helpers/insertStyleRule\";\nimport { getInlineValuesFromProps, getVariablesCSSRules } from \"../helpers/variables\";\nimport { useThemeWithState } from \"../hooks/useTheme\";\nimport { ThemeStateContext, getThemeState, hasThemeUpdatingProps } from \"../hooks/useThemeState\";\nimport { ThemeDebug } from \"./ThemeDebug\";\nimport { jsx } from \"react/jsx-runtime\";\n\nconst useInsertEffectCompat = isWeb ? React.useInsertionEffect || useIsomorphicLayoutEffect : () => {};\nconst Theme = createRefComponent(function Theme2(props, ref) {\n\t\"use no memo\";\n\tif (props.disable) return props.children;\n\tconst { passThrough } = props;\n\tconst isRoot = !!props[\"_isRoot\"];\n\tconst config = getConfig();\n\tconst inlineValues = process.env.TAMAGUI_RUNTIME_INLINE_THEME_VALUES === \"disabled\" ? null : getInlineValuesFromProps(props, config);\n\tlet inlineCSS = null;\n\tlet rulesToInsert = null;\n\tif (inlineValues) {\n\t\tinlineCSS = getVariablesCSSRules(inlineValues, config);\n\t\tif (inlineCSS && shouldInsertStyleRules(inlineCSS.identifier)) {\n\t\t\tupdateRules(inlineCSS.identifier, inlineCSS.rules);\n\t\t\trulesToInsert = { [inlineCSS.identifier]: [\n\t\t\t\t\"variables\",\n\t\t\t\t\"\",\n\t\t\t\tinlineCSS.identifier,\n\t\t\t\tvoid 0,\n\t\t\t\tinlineCSS.rules\n\t\t\t] };\n\t\t}\n\t}\n\tuseInsertEffectCompat(() => {\n\t\tif (rulesToInsert) insertStyleRules(rulesToInsert);\n\t}, [inlineCSS?.identifier]);\n\tconst themeProps = inlineValues ? {\n\t\t...props,\n\t\tinlineValues,\n\t\tinlineClassName: inlineCSS?.identifier\n\t} : props;\n\tconst [_, themeState] = useThemeWithState(themeProps, isRoot, true);\n\tuseIsomorphicLayoutEffect(() => {}, [\n\t\tthemeState.id,\n\t\tthemeState.name,\n\t\tthemeState.theme\n\t]);\n\tlet finalChildren = props[\"disable-child-theme\"] ? Children.map(props.children, (child) => passThrough || !isValidElement(child) ? child : cloneElement(child, { [\"data-disable-theme\"]: true })) : props.children;\n\tif (ref) try {\n\t\tReact.Children.only(finalChildren);\n\t\tfinalChildren = cloneElement(finalChildren, { ref });\n\t} catch {}\n\tconst stateRef = useRef({ hasEverThemed: false });\n\treturn getThemedChildren(themeState, finalChildren, themeProps, isRoot, stateRef, passThrough);\n});\nTheme[\"avoidForwardRef\"] = true;\nfunction getThemedChildren(themeState, children, props, isRoot = false, stateRef, passThrough = false) {\n\tconst { shallow, forceClassName } = props;\n\tconst state = stateRef.current;\n\tlet shouldRenderChildrenWithTheme = state.hasEverThemed || themeState.isNew || isRoot || hasThemeUpdatingProps(props);\n\tif (process.env.NODE_ENV === \"development\" && props.debug === \"visualize\") children = /* @__PURE__ */ jsx(ThemeDebug, {\n\t\tthemeState,\n\t\tthemeProps: props,\n\t\tchildren\n\t});\n\tif (!shouldRenderChildrenWithTheme) return children;\n\tchildren = /* @__PURE__ */ jsx(ThemeStateContext.Provider, {\n\t\tvalue: themeState.id,\n\t\tchildren\n\t});\n\tconst { isInverse, name } = themeState;\n\tconst requiresExtraWrapper = isInverse || forceClassName;\n\tif (!state.hasEverThemed) state.hasEverThemed = true;\n\tif (requiresExtraWrapper || themeState.name === \"dark\" || themeState.name === \"light\") state.hasEverThemed = \"wrapped\";\n\tif (shallow) if (!themeState.parentId) {} else {\n\t\tconst parentState = getThemeState(themeState.isNew ? themeState.id : themeState.parentId);\n\t\tif (!parentState) throw new Error(formatDiagnostic(\"‼️010\", \"Theme\", \"parent theme state is missing for shallow rendering\", \"Keep <Theme shallow> inside its mounted parent Theme\", \"name,parentId\", {\n\t\t\tname: themeState.name,\n\t\t\tparentId: themeState.parentId\n\t\t}));\n\t\tchildren = Children.toArray(children).map((child) => {\n\t\t\treturn isValidElement(child) ? passThrough ? child : cloneElement(child, void 0, /* @__PURE__ */ jsx(Theme, {\n\t\t\t\tname: parentState.name,\n\t\t\t\tchildren: child.props.children\n\t\t\t})) : child;\n\t\t});\n\t}\n\tif (process.env.NODE_ENV === \"development\") {\n\t\tif (!passThrough && props.debug) console.warn(` getThemedChildren`, {\n\t\t\trequiresExtraWrapper,\n\t\t\tforceClassName,\n\t\t\tthemeState,\n\t\t\tstate,\n\t\t\tthemeSpanProps: getThemeClassNameAndColor(themeState, props, isRoot)\n\t\t});\n\t}\n\tif (forceClassName === false) return children;\n\tif (isWeb) {\n\t\tconst baseStyle = props.contain ? inertContainedStyle : inertStyle;\n\t\tconst { className = \"\", color } = passThrough ? {} : getThemeClassNameAndColor(themeState, props, isRoot);\n\t\tconst inlineClassName = passThrough ? void 0 : props.inlineClassName;\n\t\tchildren = /* @__PURE__ */ jsx(\"span\", {\n\t\t\tclassName: `${className} is_Theme${inlineClassName ? ` ${inlineClassName}` : \"\"}`,\n\t\t\tstyle: passThrough ? baseStyle : {\n\t\t\t\tcolor,\n\t\t\t\t...baseStyle\n\t\t\t},\n\t\t\tchildren\n\t\t});\n\t\tif (state.hasEverThemed === \"wrapped\") children = /* @__PURE__ */ jsx(\"span\", {\n\t\t\tclassName: requiresExtraWrapper ? `${name.startsWith(\"light\") ? \"t_light\" : name.startsWith(\"dark\") ? \"t_dark\" : \"\"} _dsp_contents` : `_dsp_contents`,\n\t\t\tchildren\n\t\t});\n\t\treturn children;\n\t}\n\treturn children;\n}\nconst inertStyle = { display: \"contents\" };\nconst inertContainedStyle = {\n\tdisplay: \"contents\",\n\tcontain: \"strict\"\n};\nconst empty = {\n\tclassName: \"\",\n\tcolor: void 0\n};\nfunction getThemeClassNameAndColor(themeState, props, isRoot = false) {\n\tif (!themeState.isNew && !props.forceClassName) return empty;\n\treturn {\n\t\tcolor: themeState?.theme && themeState.isNew ? variableToString(themeState.theme.color) : \"\",\n\t\tclassName: getThemeClassNames(themeState.name, isRoot)\n\t};\n}\n\nexport { Theme, getThemedChildren };"],"mappings":";;;;;;;;;;;;;;;AAcA,MAAM,wBAAwB,QAAQ,MAAM,sBAAsB,kCAAkC,CAAC;AACrG,MAAM,QAAQ,mBAAmB,SAAS,OAAO,OAAO,KAAK;CAC5D;CACA,IAAI,MAAM,SAAS,OAAO,MAAM;CAChC,MAAM,EAAE,gBAAgB;CACxB,MAAM,SAAS,CAAC,CAAC,MAAM;CACvB,MAAM,SAAS,UAAU;CACzB,MAAM,eAAe,QAAQ,IAAI,wCAAwC,aAAa,OAAO,yBAAyB,OAAO,MAAM;CACnI,IAAI,YAAY;CAChB,IAAI,gBAAgB;CACpB,IAAI,cAAc;EACjB,YAAY,qBAAqB,cAAc,MAAM;EACrD,IAAI,aAAa,uBAAuB,UAAU,UAAU,GAAG;GAC9D,YAAY,UAAU,YAAY,UAAU,KAAK;GACjD,gBAAgB,GAAG,UAAU,aAAa;IACzC;IACA;IACA,UAAU;IACV,KAAK;IACL,UAAU;GACX,EAAE;EACH;CACD;CACA,4BAA4B;EAC3B,IAAI,eAAe,iBAAiB,aAAa;CAClD,GAAG,CAAC,WAAW,UAAU,CAAC;CAC1B,MAAM,aAAa,eAAe;EACjC,GAAG;EACH;EACA,iBAAiB,WAAW;CAC7B,IAAI;CACJ,MAAM,CAAC,GAAG,cAAc,kBAAkB,YAAY,QAAQ,IAAI;CAClE,gCAAgC,CAAC,GAAG;EACnC,WAAW;EACX,WAAW;EACX,WAAW;CACZ,CAAC;CACD,IAAI,gBAAgB,MAAM,yBAAyB,SAAS,IAAI,MAAM,WAAW,UAAU,eAAe,CAAC,eAAe,KAAK,IAAI,QAAQ,aAAa,OAAO,GAAG,uBAAuB,KAAK,CAAC,CAAC,IAAI,MAAM;CA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19
  if (props.disable) return props.children;
20
20
  var { passThrough } = props;
21
21
  var isRoot = !!props["_isRoot"];
22
- var inlineValues = getInlineValuesFromProps(props, getConfig());
22
+ var config = getConfig();
23
+ var inlineValues = process.env.TAMAGUI_RUNTIME_INLINE_THEME_VALUES === "disabled" ? null : getInlineValuesFromProps(props, config);
23
24
  var inlineCSS = null;
24
25
  var rulesToInsert = null;
25
26
  useInsertEffectCompat(function() {
@@ -1 +1 @@
1
- {"version":3,"file":"Theme.native.js","names":[],"sources":["esm/views/Theme.native.js"],"sourcesContent":["import { jsx } from \"react/jsx-runtime\";\nimport { createRefComponent } from \"@tamagui/compose-refs\";\nimport { isWeb, useIsomorphicLayoutEffect } from \"@tamagui/constants\";\nimport { getThemeClassNames } from \"@tamagui/helpers\";\nimport React, { Children, cloneElement, isValidElement, useRef } from \"react\";\nimport { getConfig } from \"../config\";\nimport { variableToString } from \"../createVariable\";\nimport { formatDiagnostic } from \"../helpers/formatDiagnostic\";\nimport { insertStyleRules } from \"../helpers/insertStyleRule\";\nimport { removeNativeStyleScope, updateNativeStyleScope } from \"../helpers/nativeStyleEngine\";\nimport { getInlineValuesFromProps } from \"../helpers/variables\";\nimport { useThemeWithState } from \"../hooks/useTheme\";\nimport { ThemeStateContext, getThemeState, hasThemeUpdatingProps } from \"../hooks/useThemeState\";\nimport { ThemeDebug } from \"./ThemeDebug\";\n\nvar useInsertEffectCompat = isWeb ? React.useInsertionEffect || useIsomorphicLayoutEffect : function() {};\nvar Theme = createRefComponent(function Theme2(props, ref) {\n\t\"use no memo\";\n\tif (props.disable) return props.children;\n\tvar { passThrough } = props;\n\tvar isRoot = !!props[\"_isRoot\"];\n\tvar inlineValues = getInlineValuesFromProps(props, getConfig());\n\tvar inlineCSS = null;\n\tvar rulesToInsert = null;\n\tuseInsertEffectCompat(function() {\n\t\tif (rulesToInsert) insertStyleRules(rulesToInsert);\n\t}, [inlineCSS === null || inlineCSS === void 0 ? void 0 : inlineCSS.identifier]);\n\tvar themeProps = inlineValues ? {\n\t\t...props,\n\t\tinlineValues,\n\t\tinlineClassName: inlineCSS === null || inlineCSS === void 0 ? void 0 : inlineCSS.identifier\n\t} : props;\n\tvar [_, themeState] = useThemeWithState(themeProps, isRoot, true);\n\tuseIsomorphicLayoutEffect(function() {\n\t\tupdateNativeStyleScope(themeState.id, themeState.name, themeState.theme);\n\t\treturn function() {\n\t\t\treturn removeNativeStyleScope(themeState.id);\n\t\t};\n\t}, [\n\t\tthemeState.id,\n\t\tthemeState.name,\n\t\tthemeState.theme\n\t]);\n\tvar finalChildren = props[\"disable-child-theme\"] ? Children.map(props.children, function(child) {\n\t\treturn passThrough || !/* @__PURE__ */ isValidElement(child) ? child : /* @__PURE__ */ cloneElement(child, { [\"data-disable-theme\"]: true });\n\t}) : props.children;\n\tif (ref) try {\n\t\tReact.Children.only(finalChildren);\n\t\tfinalChildren = /* @__PURE__ */ cloneElement(finalChildren, { ref });\n\t} catch (e) {}\n\tvar stateRef = useRef({ hasEverThemed: false });\n\treturn getThemedChildren(themeState, finalChildren, themeProps, isRoot, stateRef, passThrough);\n});\nTheme[\"avoidForwardRef\"] = true;\nfunction getThemedChildren(themeState, children, props) {\n\tvar isRoot = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false, stateRef = arguments.length > 4 ? arguments[4] : void 0, passThrough = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : false;\n\tvar { shallow, forceClassName } = props;\n\tvar state = stateRef.current;\n\tvar shouldRenderChildrenWithTheme = state.hasEverThemed || themeState.isNew || isRoot || hasThemeUpdatingProps(props);\n\tif (process.env.NODE_ENV === \"development\" && props.debug === \"visualize\") children = /* @__PURE__ */ jsx(ThemeDebug, {\n\t\tthemeState,\n\t\tthemeProps: props,\n\t\tchildren\n\t});\n\tif (!shouldRenderChildrenWithTheme) return children;\n\tchildren = /* @__PURE__ */ jsx(ThemeStateContext.Provider, {\n\t\tvalue: themeState.id,\n\t\tchildren\n\t});\n\tvar { isInverse, name } = themeState;\n\tvar requiresExtraWrapper = isInverse || forceClassName;\n\tif (!state.hasEverThemed) state.hasEverThemed = true;\n\tif (requiresExtraWrapper || themeState.name === \"dark\" || themeState.name === \"light\") state.hasEverThemed = \"wrapped\";\n\tif (shallow) if (!themeState.parentId) {} else {\n\t\tvar parentState = getThemeState(themeState.isNew ? themeState.id : themeState.parentId);\n\t\tif (!parentState) throw new Error(formatDiagnostic(\"‼️010\", \"Theme\", \"parent theme state is missing for shallow rendering\", \"Keep <Theme shallow> inside its mounted parent Theme\", \"name,parentId\", {\n\t\t\tname: themeState.name,\n\t\t\tparentId: themeState.parentId\n\t\t}));\n\t\tchildren = Children.toArray(children).map(function(child) {\n\t\t\treturn /* @__PURE__ */ isValidElement(child) ? passThrough ? child : /* @__PURE__ */ cloneElement(child, void 0, /* @__PURE__ */ jsx(Theme, {\n\t\t\t\tname: parentState.name,\n\t\t\t\tchildren: child.props.children\n\t\t\t})) : child;\n\t\t});\n\t}\n\tif (process.env.NODE_ENV === \"development\") {\n\t\tif (!passThrough && props.debug) console.warn(` getThemedChildren`, {\n\t\t\trequiresExtraWrapper,\n\t\t\tforceClassName,\n\t\t\tthemeState,\n\t\t\tstate,\n\t\t\tthemeSpanProps: getThemeClassNameAndColor(themeState, props, isRoot)\n\t\t});\n\t}\n\tif (forceClassName === false) return children;\n\tif (isWeb) {\n\t\tvar baseStyle = props.contain ? inertContainedStyle : inertStyle;\n\t\tvar { className = \"\", color } = passThrough ? {} : getThemeClassNameAndColor(themeState, props, isRoot);\n\t\tvar inlineClassName = passThrough ? void 0 : props.inlineClassName;\n\t\tchildren = /* @__PURE__ */ jsx(\"span\", {\n\t\t\tclassName: `${className} is_Theme${inlineClassName ? ` ${inlineClassName}` : \"\"}`,\n\t\t\tstyle: passThrough ? baseStyle : {\n\t\t\t\tcolor,\n\t\t\t\t...baseStyle\n\t\t\t},\n\t\t\tchildren\n\t\t});\n\t\tif (state.hasEverThemed === \"wrapped\") children = /* @__PURE__ */ jsx(\"span\", {\n\t\t\tclassName: requiresExtraWrapper ? `${name.startsWith(\"light\") ? \"t_light\" : name.startsWith(\"dark\") ? \"t_dark\" : \"\"} _dsp_contents` : `_dsp_contents`,\n\t\t\tchildren\n\t\t});\n\t\treturn children;\n\t}\n\treturn children;\n}\nvar inertStyle = { display: \"contents\" };\nvar inertContainedStyle = {\n\tdisplay: \"contents\",\n\tcontain: \"strict\"\n};\nvar empty = {\n\tclassName: \"\",\n\tcolor: void 0\n};\nfunction getThemeClassNameAndColor(themeState, props) {\n\tvar isRoot = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;\n\tif (!themeState.isNew && !props.forceClassName) return empty;\n\treturn {\n\t\tcolor: (themeState === null || themeState === void 0 ? void 0 : themeState.theme) && themeState.isNew ? variableToString(themeState.theme.color) : \"\",\n\t\tclassName: getThemeClassNames(themeState.name, isRoot)\n\t};\n}\n\nexport { Theme, getThemedChildren };"],"mappings":";;;;;;;;;;;;;;;;AAeA,IAAI,wBAAwB,QAAQ,MAAM,sBAAsB,4BAA4B,WAAW,CAAC;AACxG,IAAI,QAAQ,mBAAmB,SAAS,OAAO,OAAO,KAAK;CAC1D;CACA,IAAI,MAAM,SAAS,OAAO,MAAM;CAChC,IAAI,EAAE,gBAAgB;CACtB,IAAI,SAAS,CAAC,CAAC,MAAM;CACrB,IAAI,eAAe,yBAAyB,OAAO,UAAU,CAAC;CAC9D,IAAI,YAAY;CAChB,IAAI,gBAAgB;CACpB,sBAAsB,WAAW;EAChC,IAAI,eAAe,iBAAiB,aAAa;CAClD,GAAG,CAAC,cAAc,QAAQ,cAAc,KAAK,IAAI,KAAK,IAAI,UAAU,UAAU,CAAC;CAC/E,IAAI,aAAa,eAAe;EAC/B,GAAG;EACH;EACA,iBAAiB,cAAc,QAAQ,cAAc,KAAK,IAAI,KAAK,IAAI,UAAU;CAClF,IAAI;CACJ,IAAI,CAAC,GAAG,cAAc,kBAAkB,YAAY,QAAQ,IAAI;CAChE,0BAA0B,WAAW;EACpC,uBAA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,KAAK,WAAW,MAAM,IAAI,WAAW,GAAG,kBAAkB;GACtI;EACD,CAAC;EACD,OAAO;CACR;CACA,OAAO;AACR;AACA,IAAI,aAAa,EAAE,SAAS,WAAW;AACvC,IAAI,sBAAsB;CACzB,SAAS;CACT,SAAS;AACV;AACA,IAAI,QAAQ;CACX,WAAW;CACX,OAAO,KAAK;AACb;AACA,SAAS,0BAA0B,YAAY,OAAO;CACrD,IAAI,SAAS,UAAU,SAAS,KAAK,UAAU,OAAO,KAAK,IAAI,UAAU,KAAK;CAC9E,IAAI,CAAC,WAAW,SAAS,CAAC,MAAM,gBAAgB,OAAO;CACvD,OAAO;EACN,QAAQ,eAAe,QAAQ,eAAe,KAAK,IAAI,KAAK,IAAI,WAAW,UAAU,WAAW,QAAQ,iBAAiB,WAAW,MAAM,KAAK,IAAI;EACnJ,WAAW,mBAAmB,WAAW,MAAM,MAAM;CACtD;AACD"}
1
+ {"version":3,"file":"Theme.native.js","names":[],"sources":["esm/views/Theme.native.js"],"sourcesContent":["import { jsx } from \"react/jsx-runtime\";\nimport { createRefComponent } from \"@tamagui/compose-refs\";\nimport { isWeb, useIsomorphicLayoutEffect } from \"@tamagui/constants\";\nimport { getThemeClassNames } from \"@tamagui/helpers\";\nimport React, { Children, cloneElement, isValidElement, useRef } from \"react\";\nimport { getConfig } from \"../config\";\nimport { variableToString } from \"../createVariable\";\nimport { formatDiagnostic } from \"../helpers/formatDiagnostic\";\nimport { insertStyleRules } from \"../helpers/insertStyleRule\";\nimport { removeNativeStyleScope, updateNativeStyleScope } from \"../helpers/nativeStyleEngine\";\nimport { getInlineValuesFromProps } from \"../helpers/variables\";\nimport { useThemeWithState } from \"../hooks/useTheme\";\nimport { ThemeStateContext, getThemeState, hasThemeUpdatingProps } from \"../hooks/useThemeState\";\nimport { ThemeDebug } from \"./ThemeDebug\";\n\nvar useInsertEffectCompat = isWeb ? React.useInsertionEffect || useIsomorphicLayoutEffect : function() {};\nvar Theme = createRefComponent(function Theme2(props, ref) {\n\t\"use no memo\";\n\tif (props.disable) return props.children;\n\tvar { passThrough } = props;\n\tvar isRoot = !!props[\"_isRoot\"];\n\tvar config = getConfig();\n\tvar inlineValues = process.env.TAMAGUI_RUNTIME_INLINE_THEME_VALUES === \"disabled\" ? null : getInlineValuesFromProps(props, config);\n\tvar inlineCSS = null;\n\tvar rulesToInsert = null;\n\tuseInsertEffectCompat(function() {\n\t\tif (rulesToInsert) insertStyleRules(rulesToInsert);\n\t}, [inlineCSS === null || inlineCSS === void 0 ? void 0 : inlineCSS.identifier]);\n\tvar themeProps = inlineValues ? {\n\t\t...props,\n\t\tinlineValues,\n\t\tinlineClassName: inlineCSS === null || inlineCSS === void 0 ? void 0 : inlineCSS.identifier\n\t} : props;\n\tvar [_, themeState] = useThemeWithState(themeProps, isRoot, true);\n\tuseIsomorphicLayoutEffect(function() {\n\t\tupdateNativeStyleScope(themeState.id, themeState.name, themeState.theme);\n\t\treturn function() {\n\t\t\treturn removeNativeStyleScope(themeState.id);\n\t\t};\n\t}, [\n\t\tthemeState.id,\n\t\tthemeState.name,\n\t\tthemeState.theme\n\t]);\n\tvar finalChildren = props[\"disable-child-theme\"] ? Children.map(props.children, function(child) {\n\t\treturn passThrough || !/* @__PURE__ */ isValidElement(child) ? child : /* @__PURE__ */ cloneElement(child, { [\"data-disable-theme\"]: true });\n\t}) : props.children;\n\tif (ref) try {\n\t\tReact.Children.only(finalChildren);\n\t\tfinalChildren = /* @__PURE__ */ cloneElement(finalChildren, { ref });\n\t} catch (e) {}\n\tvar stateRef = useRef({ hasEverThemed: false });\n\treturn getThemedChildren(themeState, finalChildren, themeProps, isRoot, stateRef, passThrough);\n});\nTheme[\"avoidForwardRef\"] = true;\nfunction getThemedChildren(themeState, children, props) {\n\tvar isRoot = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false, stateRef = arguments.length > 4 ? arguments[4] : void 0, passThrough = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : false;\n\tvar { shallow, forceClassName } = props;\n\tvar state = stateRef.current;\n\tvar shouldRenderChildrenWithTheme = state.hasEverThemed || themeState.isNew || isRoot || hasThemeUpdatingProps(props);\n\tif (process.env.NODE_ENV === \"development\" && props.debug === \"visualize\") children = /* @__PURE__ */ jsx(ThemeDebug, {\n\t\tthemeState,\n\t\tthemeProps: props,\n\t\tchildren\n\t});\n\tif (!shouldRenderChildrenWithTheme) return children;\n\tchildren = /* @__PURE__ */ jsx(ThemeStateContext.Provider, {\n\t\tvalue: themeState.id,\n\t\tchildren\n\t});\n\tvar { isInverse, name } = themeState;\n\tvar requiresExtraWrapper = isInverse || forceClassName;\n\tif (!state.hasEverThemed) state.hasEverThemed = true;\n\tif (requiresExtraWrapper || themeState.name === \"dark\" || themeState.name === \"light\") state.hasEverThemed = \"wrapped\";\n\tif (shallow) if (!themeState.parentId) {} else {\n\t\tvar parentState = getThemeState(themeState.isNew ? themeState.id : themeState.parentId);\n\t\tif (!parentState) throw new Error(formatDiagnostic(\"‼️010\", \"Theme\", \"parent theme state is missing for shallow rendering\", \"Keep <Theme shallow> inside its mounted parent Theme\", \"name,parentId\", {\n\t\t\tname: themeState.name,\n\t\t\tparentId: themeState.parentId\n\t\t}));\n\t\tchildren = Children.toArray(children).map(function(child) {\n\t\t\treturn /* @__PURE__ */ isValidElement(child) ? passThrough ? child : /* @__PURE__ */ cloneElement(child, void 0, /* @__PURE__ */ jsx(Theme, {\n\t\t\t\tname: parentState.name,\n\t\t\t\tchildren: child.props.children\n\t\t\t})) : child;\n\t\t});\n\t}\n\tif (process.env.NODE_ENV === \"development\") {\n\t\tif (!passThrough && props.debug) console.warn(` getThemedChildren`, {\n\t\t\trequiresExtraWrapper,\n\t\t\tforceClassName,\n\t\t\tthemeState,\n\t\t\tstate,\n\t\t\tthemeSpanProps: getThemeClassNameAndColor(themeState, props, isRoot)\n\t\t});\n\t}\n\tif (forceClassName === false) return children;\n\tif (isWeb) {\n\t\tvar baseStyle = props.contain ? inertContainedStyle : inertStyle;\n\t\tvar { className = \"\", color } = passThrough ? {} : getThemeClassNameAndColor(themeState, props, isRoot);\n\t\tvar inlineClassName = passThrough ? void 0 : props.inlineClassName;\n\t\tchildren = /* @__PURE__ */ jsx(\"span\", {\n\t\t\tclassName: `${className} is_Theme${inlineClassName ? ` ${inlineClassName}` : \"\"}`,\n\t\t\tstyle: passThrough ? baseStyle : {\n\t\t\t\tcolor,\n\t\t\t\t...baseStyle\n\t\t\t},\n\t\t\tchildren\n\t\t});\n\t\tif (state.hasEverThemed === \"wrapped\") children = /* @__PURE__ */ jsx(\"span\", {\n\t\t\tclassName: requiresExtraWrapper ? `${name.startsWith(\"light\") ? \"t_light\" : name.startsWith(\"dark\") ? \"t_dark\" : \"\"} _dsp_contents` : `_dsp_contents`,\n\t\t\tchildren\n\t\t});\n\t\treturn children;\n\t}\n\treturn children;\n}\nvar inertStyle = { display: \"contents\" };\nvar inertContainedStyle = {\n\tdisplay: \"contents\",\n\tcontain: \"strict\"\n};\nvar empty = {\n\tclassName: \"\",\n\tcolor: void 0\n};\nfunction getThemeClassNameAndColor(themeState, props) {\n\tvar isRoot = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;\n\tif (!themeState.isNew && !props.forceClassName) return empty;\n\treturn {\n\t\tcolor: (themeState === null || themeState === void 0 ? void 0 : themeState.theme) && themeState.isNew ? variableToString(themeState.theme.color) : \"\",\n\t\tclassName: getThemeClassNames(themeState.name, isRoot)\n\t};\n}\n\nexport { Theme, getThemedChildren };"],"mappings":";;;;;;;;;;;;;;;;AAeA,IAAI,wBAAwB,QAAQ,MAAM,sBAAsB,4BAA4B,WAAW,CAAC;AACxG,IAAI,QAAQ,mBAAmB,SAAS,OAAO,OAAO,KAAK;CAC1D;CACA,IAAI,MAAM,SAAS,OAAO,MAAM;CAChC,IAAI,EAAE,gBAAgB;CACtB,IAAI,SAAS,CAAC,CAAC,MAAM;CACrB,IAAI,SAAS,UAAU;CACvB,IAAI,eAAe,QAAQ,IAAI,wCAAwC,aAAa,O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AY,MAAM,UAAU,sBAAsB;EACtD,IAAI,EAAE,YAAY,IAAI,UAAU,cAAc,CAAC,IAAI,0BAA0B,YAAY,OAAO,MAAM;EACtG,IAAI,kBAAkB,cAAc,KAAK,IAAI,MAAM;EACnD,WAA2B,oBAAI,QAAQ;GACtC,WAAW,GAAG,UAAU,WAAW,kBAAkB,IAAI,oBAAoB;GAC7E,OAAO,cAAc,YAAY;IAChC;IACA,GAAG;GACJ;GACA;EACD,CAAC;EACD,IAAI,MAAM,kBAAkB,WAAW,WAA2B,oBAAI,QAAQ;GAC7E,WAAW,uBAAuB,GAAG,KAAK,WAAW,OAAO,IAAI,YAAY,KAAK,WAAW,MAAM,IAAI,WAAW,GAAG,kBAAkB;GACtI;EACD,CAAC;EACD,OAAO;CACR;CACA,OAAO;AACR;AACA,IAAI,aAAa,EAAE,SAAS,WAAW;AACvC,IAAI,sBAAsB;CACzB,SAAS;CACT,SAAS;AACV;AACA,IAAI,QAAQ;CACX,WAAW;CACX,OAAO,KAAK;AACb;AACA,SAAS,0BAA0B,YAAY,OAAO;CACrD,IAAI,SAAS,UAAU,SAAS,KAAK,UAAU,OAAO,KAAK,IAAI,UAAU,KAAK;CAC9E,IAAI,CAAC,WAAW,SAAS,CAAC,MAAM,gBAAgB,OAAO;CACvD,OAAO;EACN,QAAQ,eAAe,QAAQ,eAAe,KAAK,IAAI,KAAK,IAAI,WAAW,UAAU,WAAW,QAAQ,iBAAiB,WAAW,MAAM,KAAK,IAAI;EACnJ,WAAW,mBAAmB,WAAW,MAAM,MAAM;CACtD;AACD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/web",
3
- "version": "3.0.0-beta.661.1",
3
+ "version": "3.0.0-beta.669.1",
4
4
  "license": "MIT",
5
5
  "author": {
6
6
  "name": "Nate Wienert"
@@ -81,22 +81,22 @@
81
81
  "test:web": "vitest --typecheck --run"
82
82
  },
83
83
  "dependencies": {
84
- "@tamagui/compose-refs": "3.0.0-beta.661.1",
85
- "@tamagui/constants": "3.0.0-beta.661.1",
86
- "@tamagui/dom": "3.0.0-beta.661.1",
87
- "@tamagui/helpers": "3.0.0-beta.661.1",
88
- "@tamagui/is-equal-shallow": "3.0.0-beta.661.1",
89
- "@tamagui/native": "3.0.0-beta.661.1",
90
- "@tamagui/normalize-css-color": "3.0.0-beta.661.1",
91
- "@tamagui/style-grammar": "3.0.0-beta.661.1",
92
- "@tamagui/timer": "3.0.0-beta.661.1",
93
- "@tamagui/types": "3.0.0-beta.661.1",
94
- "@tamagui/use-did-finish-ssr": "3.0.0-beta.661.1",
95
- "@tamagui/use-event": "3.0.0-beta.661.1",
96
- "@tamagui/use-force-update": "3.0.0-beta.661.1"
84
+ "@tamagui/compose-refs": "3.0.0-beta.669.1",
85
+ "@tamagui/constants": "3.0.0-beta.669.1",
86
+ "@tamagui/dom": "3.0.0-beta.669.1",
87
+ "@tamagui/helpers": "3.0.0-beta.669.1",
88
+ "@tamagui/is-equal-shallow": "3.0.0-beta.669.1",
89
+ "@tamagui/native": "3.0.0-beta.669.1",
90
+ "@tamagui/normalize-css-color": "3.0.0-beta.669.1",
91
+ "@tamagui/style-grammar": "3.0.0-beta.669.1",
92
+ "@tamagui/timer": "3.0.0-beta.669.1",
93
+ "@tamagui/types": "3.0.0-beta.669.1",
94
+ "@tamagui/use-did-finish-ssr": "3.0.0-beta.669.1",
95
+ "@tamagui/use-event": "3.0.0-beta.669.1",
96
+ "@tamagui/use-force-update": "3.0.0-beta.669.1"
97
97
  },
98
98
  "devDependencies": {
99
- "@tamagui/build": "3.0.0-beta.661.1",
99
+ "@tamagui/build": "3.0.0-beta.669.1",
100
100
  "@testing-library/react": "^16.1.0",
101
101
  "csstype": "^3.0.10",
102
102
  "react": ">=19",
@@ -1599,7 +1599,10 @@ export function createComponent<
1599
1599
 
1600
1600
  useIsomorphicLayoutEffect(() => {
1601
1601
  let disposeSafeArea: (() => void) | undefined
1602
- if (splitStyles?.usesSafeArea) {
1602
+ if (
1603
+ process.env.TAMAGUI_RUNTIME_SAFE_AREA !== 'disabled' &&
1604
+ splitStyles?.usesSafeArea
1605
+ ) {
1603
1606
  const updateSafeArea = () => {
1604
1607
  setState((previous) => ({ ...previous }))
1605
1608
  }
@@ -349,7 +349,12 @@ function getThemesDeduped(
349
349
  // custom variables merge into base themes only; sub-themes inherit them
350
350
  // via proxyThemesToParents (native) and the CSS cascade (web), so a
351
351
  // inline <Theme> patch survives sub-theme switches below it
352
- if (variables && variablesCtx && !themeName.includes('_')) {
352
+ if (
353
+ process.env.TAMAGUI_RUNTIME_INLINE_THEME_VALUES !== 'disabled' &&
354
+ variables &&
355
+ variablesCtx &&
356
+ !themeName.includes('_')
357
+ ) {
353
358
  mergeConfigVariablesIntoTheme(
354
359
  theme as any,
355
360
  themeName,