@tamagui/web 3.0.0-beta.655.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.
- package/dist/cjs/createComponent.cjs +1 -1
- package/dist/cjs/createComponent.native.cjs +1 -1
- package/dist/cjs/createComponent.native.js +1 -1
- package/dist/cjs/createComponent.native.js.map +1 -1
- package/dist/cjs/createTamagui.cjs +1 -1
- package/dist/cjs/createTamagui.native.cjs +1 -1
- package/dist/cjs/createTamagui.native.js +1 -1
- package/dist/cjs/createTamagui.native.js.map +1 -1
- package/dist/cjs/helpers/directStyle.cjs +12 -12
- package/dist/cjs/helpers/directStyle.native.cjs +12 -12
- package/dist/cjs/helpers/directStyle.native.js +12 -12
- package/dist/cjs/helpers/directStyle.native.js.map +1 -1
- package/dist/cjs/helpers/formatDiagnostic.cjs +3 -0
- package/dist/cjs/helpers/formatDiagnostic.native.cjs +3 -0
- package/dist/cjs/helpers/formatDiagnostic.native.js +3 -0
- package/dist/cjs/helpers/formatDiagnostic.native.js.map +1 -1
- package/dist/cjs/helpers/getSplitStyles.cjs +2 -2
- package/dist/cjs/helpers/getSplitStyles.native.cjs +2 -2
- package/dist/cjs/helpers/getSplitStyles.native.js +2 -2
- package/dist/cjs/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/cjs/helpers/mergeVariants.cjs +1 -1
- package/dist/cjs/helpers/mergeVariants.native.cjs +1 -1
- package/dist/cjs/helpers/mergeVariants.native.js +1 -1
- package/dist/cjs/helpers/mergeVariants.native.js.map +1 -1
- package/dist/cjs/helpers/propMapper.cjs +2 -2
- package/dist/cjs/helpers/propMapper.native.cjs +2 -2
- package/dist/cjs/helpers/propMapper.native.js +2 -2
- package/dist/cjs/helpers/propMapper.native.js.map +1 -1
- package/dist/cjs/hooks/getThemeProxied.native.cjs +1 -1
- package/dist/cjs/hooks/getThemeProxied.native.js +1 -1
- package/dist/cjs/hooks/getThemeProxied.native.js.map +1 -1
- package/dist/cjs/hooks/useComponentState.cjs +2 -2
- package/dist/cjs/hooks/useComponentState.native.cjs +2 -2
- package/dist/cjs/hooks/useComponentState.native.js +2 -2
- package/dist/cjs/hooks/useComponentState.native.js.map +1 -1
- package/dist/cjs/hooks/useProps.cjs +1 -1
- package/dist/cjs/hooks/useProps.native.cjs +1 -1
- package/dist/cjs/hooks/useProps.native.js +1 -1
- package/dist/cjs/hooks/useProps.native.js.map +1 -1
- package/dist/cjs/hooks/useThemeState.cjs +2 -2
- package/dist/cjs/hooks/useThemeState.native.cjs +2 -2
- package/dist/cjs/hooks/useThemeState.native.js +2 -2
- package/dist/cjs/hooks/useThemeState.native.js.map +1 -1
- package/dist/cjs/internal-runtime.cjs +3 -1
- package/dist/cjs/internal-runtime.native.cjs +3 -1
- package/dist/cjs/internal-runtime.native.js +3 -1
- package/dist/cjs/internal-runtime.native.js.map +1 -1
- package/dist/cjs/views/Theme.cjs +1 -1
- package/dist/cjs/views/Theme.native.cjs +1 -1
- package/dist/cjs/views/Theme.native.js +1 -1
- package/dist/cjs/views/Theme.native.js.map +1 -1
- package/dist/esm/createComponent.mjs +1 -1
- package/dist/esm/createComponent.mjs.map +1 -1
- package/dist/esm/createComponent.native.js +1 -1
- package/dist/esm/createComponent.native.js.map +1 -1
- package/dist/esm/createTamagui.mjs +1 -1
- package/dist/esm/createTamagui.mjs.map +1 -1
- package/dist/esm/createTamagui.native.js +1 -1
- package/dist/esm/createTamagui.native.js.map +1 -1
- package/dist/esm/helpers/directStyle.mjs +13 -13
- package/dist/esm/helpers/directStyle.mjs.map +1 -1
- package/dist/esm/helpers/directStyle.native.js +13 -13
- package/dist/esm/helpers/directStyle.native.js.map +1 -1
- package/dist/esm/helpers/formatDiagnostic.mjs +3 -0
- package/dist/esm/helpers/formatDiagnostic.mjs.map +1 -1
- package/dist/esm/helpers/formatDiagnostic.native.js +3 -0
- package/dist/esm/helpers/formatDiagnostic.native.js.map +1 -1
- package/dist/esm/helpers/getSplitStyles.mjs +2 -2
- package/dist/esm/helpers/getSplitStyles.mjs.map +1 -1
- package/dist/esm/helpers/getSplitStyles.native.js +2 -2
- package/dist/esm/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/esm/helpers/mergeVariants.mjs +1 -1
- package/dist/esm/helpers/mergeVariants.mjs.map +1 -1
- package/dist/esm/helpers/mergeVariants.native.js +1 -1
- package/dist/esm/helpers/mergeVariants.native.js.map +1 -1
- package/dist/esm/helpers/propMapper.mjs +2 -2
- package/dist/esm/helpers/propMapper.mjs.map +1 -1
- package/dist/esm/helpers/propMapper.native.js +2 -2
- package/dist/esm/helpers/propMapper.native.js.map +1 -1
- package/dist/esm/hooks/getThemeProxied.native.js +1 -1
- package/dist/esm/hooks/getThemeProxied.native.js.map +1 -1
- package/dist/esm/hooks/useComponentState.mjs +2 -2
- package/dist/esm/hooks/useComponentState.mjs.map +1 -1
- package/dist/esm/hooks/useComponentState.native.js +2 -2
- package/dist/esm/hooks/useComponentState.native.js.map +1 -1
- package/dist/esm/hooks/useProps.mjs +1 -1
- package/dist/esm/hooks/useProps.mjs.map +1 -1
- package/dist/esm/hooks/useProps.native.js +1 -1
- package/dist/esm/hooks/useProps.native.js.map +1 -1
- package/dist/esm/hooks/useThemeState.mjs +2 -2
- package/dist/esm/hooks/useThemeState.mjs.map +1 -1
- package/dist/esm/hooks/useThemeState.native.js +2 -2
- package/dist/esm/hooks/useThemeState.native.js.map +1 -1
- package/dist/esm/internal-runtime.mjs +3 -1
- package/dist/esm/internal-runtime.mjs.map +1 -1
- package/dist/esm/internal-runtime.native.js +3 -1
- package/dist/esm/internal-runtime.native.js.map +1 -1
- package/dist/esm/views/Theme.mjs +1 -1
- package/dist/esm/views/Theme.mjs.map +1 -1
- package/dist/esm/views/Theme.native.js +2 -1
- package/dist/esm/views/Theme.native.js.map +1 -1
- package/package.json +15 -15
- package/src/createComponent.tsx +4 -1
- package/src/createTamagui.ts +6 -1
- package/src/helpers/directStyle.ts +23 -12
- package/src/helpers/formatDiagnostic.ts +3 -0
- package/src/helpers/getSplitStyles.tsx +8 -2
- package/src/helpers/mergeVariants.ts +3 -1
- package/src/helpers/propMapper.ts +6 -1
- package/src/hooks/getThemeProxied.ts +4 -3
- package/src/hooks/useComponentState.ts +4 -1
- package/src/hooks/useProps.tsx +4 -1
- package/src/hooks/useThemeState.ts +8 -2
- package/src/internal-runtime.ts +8 -1
- package/src/views/Theme.tsx +4 -1
- package/types/createComponent.d.ts.map +1 -1
- package/types/helpers/directStyle.d.ts.map +1 -1
- package/types/helpers/formatDiagnostic.d.ts.map +1 -1
- package/types/helpers/getSplitStyles.d.ts.map +1 -1
- package/types/helpers/mergeVariants.d.ts.map +1 -1
- package/types/helpers/propMapper.d.ts.map +1 -1
- package/types/hooks/getThemeProxied.d.ts.map +1 -1
- package/types/hooks/useComponentState.d.ts.map +1 -1
- package/types/hooks/useProps.d.ts.map +1 -1
- package/types/hooks/useThemeState.d.ts.map +1 -1
- package/types/internal-runtime.d.ts.map +1 -1
- package/types/views/Theme.d.ts.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useThemeState.native.js","names":[],"sources":["cjs/hooks/useThemeState.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n\tfor (var name in all) __defProp(target, name, {\n\t\tget: all[name],\n\t\tenumerable: true\n\t});\n};\nvar __copyProps = (to, from, except, desc) => {\n\tif (from && typeof from === \"object\" || typeof from === \"function\") {\n\t\tfor (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {\n\t\t\tget: () => from[key],\n\t\t\tenumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable\n\t\t});\n\t}\n\treturn to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar useThemeState_exports = {};\n__export(useThemeState_exports, {\n\tThemeStateContext: () => ThemeStateContext,\n\tforceUpdateThemes: () => forceUpdateThemes,\n\tgetInlineThemeLayer: () => getInlineThemeLayer,\n\tgetNewThemeName: () => getNewThemeName,\n\tgetRootThemeState: () => getRootThemeState,\n\tgetThemeNameCacheSize: () => getThemeNameCacheSize,\n\tgetThemeProviderChainSizes: () => getThemeProviderChainSizes,\n\tgetThemeProviderParent: () => getThemeProviderParent,\n\tgetThemeState: () => getThemeState,\n\thasThemeUpdatingProps: () => hasThemeUpdatingProps,\n\tresolveThemeName: () => resolveThemeName,\n\tuseThemeState: () => useThemeState\n});\nmodule.exports = __toCommonJS(useThemeState_exports);\nvar import_constants = require(\"@tamagui/constants\");\nvar import_react = require(\"react\");\nvar import_config = require(\"../config\");\nvar import_formatDiagnostic = require(\"../helpers/formatDiagnostic\");\nvar import_variables = require(\"../helpers/variables\");\nvar import_constants2 = require(\"../constants/constants\");\nvar ThemeStateContext = (0, import_react.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 = (0, import_react.useContext)(ThemeStateContext);\n\tif (!parentId && !isRoot) throw new Error(process.env.NODE_ENV === \"development\" ? `${import_constants2.MISSING_THEME_MESSAGE}\n\nLooked for theme${props.name ? ` \"${props.name}\"` : \"\"}, but no parent theme context was found (parentId: ${parentId}).` : import_constants2.MISSING_THEME_MESSAGE);\n\tif (disable) return states.get(parentId) || {\n\t\tid: \"\",\n\t\tname: \"light\",\n\t\ttheme: (0, import_config.getConfig)().themes.light\n\t};\n\tvar id = (0, import_react.useId)();\n\tvar propsKey = getPropsKey(props);\n\tif (cascadeOnChange) registerThemeProviderChain(id, parentId, props);\n\tvar ref = (0, import_react.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] = (0, import_react.useReducer)(incReducer, 0);\n\tvar state = getSnapshotImpl(ref.current);\n\tref.current.lastSnap = state;\n\t(0, import_react.useEffect)(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) (0, import_constants.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 && import_constants.supportsDynamicColorIOS && (0, import_config.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 parentTheme = ((_states_get = states.get(parentId)) === null || _states_get === void 0 ? void 0 : _states_get.theme) || nextRaw.theme;\n\t\tvar merged = (0, import_variables.getMergedInlineTheme)(parentTheme, props.inlineValues, nextRaw.name, (0, import_config.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 = (0, import_config.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: (0, import_config.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((0, import_formatDiagnostic.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, (0, import_config.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 ? (0, import_variables.getInlineValuesKey)(inlineValues) : \"\"}`;\n};\nvar hasThemeUpdatingProps = function(props) {\n\treturn \"name\" in props || \"reset\" in props || \"forceClassName\" in props || \"inlineValues\" in props;\n};\n//# sourceMappingURL=useThemeState.js.map\n"],"mappings":";;;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC/B,KAAK,IAAI,QAAQ,KAAK,UAAU,QAAQ,MAAM;EAC7C,KAAK,IAAI;EACT,YAAY;CACb,CAAC;AACF;AACA,IAAI,eAAe,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K,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,gBAAgB,GAAG,iBAAiB,oBAAoB,YAAY,IAAI;AACrI;AACA,IAAI,wBAAwB,SAAS,OAAO;CAC3C,OAAO,UAAU,SAAS,WAAW,SAAS,oBAAoB,SAAS,kBAAkB;AAC9F"}
|
|
1
|
+
{"version":3,"file":"useThemeState.native.js","names":[],"sources":["cjs/hooks/useThemeState.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n\tfor (var name in all) __defProp(target, name, {\n\t\tget: all[name],\n\t\tenumerable: true\n\t});\n};\nvar __copyProps = (to, from, except, desc) => {\n\tif (from && typeof from === \"object\" || typeof from === \"function\") {\n\t\tfor (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {\n\t\t\tget: () => from[key],\n\t\t\tenumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable\n\t\t});\n\t}\n\treturn to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar useThemeState_exports = {};\n__export(useThemeState_exports, {\n\tThemeStateContext: () => ThemeStateContext,\n\tforceUpdateThemes: () => forceUpdateThemes,\n\tgetInlineThemeLayer: () => getInlineThemeLayer,\n\tgetNewThemeName: () => getNewThemeName,\n\tgetRootThemeState: () => getRootThemeState,\n\tgetThemeNameCacheSize: () => getThemeNameCacheSize,\n\tgetThemeProviderChainSizes: () => getThemeProviderChainSizes,\n\tgetThemeProviderParent: () => getThemeProviderParent,\n\tgetThemeState: () => getThemeState,\n\thasThemeUpdatingProps: () => hasThemeUpdatingProps,\n\tresolveThemeName: () => resolveThemeName,\n\tuseThemeState: () => useThemeState\n});\nmodule.exports = __toCommonJS(useThemeState_exports);\nvar import_constants = require(\"@tamagui/constants\");\nvar import_react = require(\"react\");\nvar import_config = require(\"../config\");\nvar import_formatDiagnostic = require(\"../helpers/formatDiagnostic\");\nvar import_variables = require(\"../helpers/variables\");\nvar import_constants2 = require(\"../constants/constants\");\nvar ThemeStateContext = (0, import_react.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 = (0, import_react.useContext)(ThemeStateContext);\n\tif (!parentId && !isRoot) throw new Error(process.env.NODE_ENV === \"development\" ? `${import_constants2.MISSING_THEME_MESSAGE}\n\nLooked for theme${props.name ? ` \"${props.name}\"` : \"\"}, but no parent theme context was found (parentId: ${parentId}).` : import_constants2.MISSING_THEME_MESSAGE);\n\tif (disable) return states.get(parentId) || {\n\t\tid: \"\",\n\t\tname: \"light\",\n\t\ttheme: (0, import_config.getConfig)().themes.light\n\t};\n\tvar id = (0, import_react.useId)();\n\tvar propsKey = getPropsKey(props);\n\tif (cascadeOnChange) registerThemeProviderChain(id, parentId, props);\n\tvar ref = (0, import_react.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] = (0, import_react.useReducer)(incReducer, 0);\n\tvar state = getSnapshotImpl(ref.current);\n\tref.current.lastSnap = state;\n\t(0, import_react.useEffect)(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) (0, import_constants.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 && import_constants.supportsDynamicColorIOS && (0, import_config.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 parentTheme = ((_states_get = states.get(parentId)) === null || _states_get === void 0 ? void 0 : _states_get.theme) || nextRaw.theme;\n\t\tvar merged = (0, import_variables.getMergedInlineTheme)(parentTheme, props.inlineValues, nextRaw.name, (0, import_config.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 = (0, import_config.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: (0, import_config.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((0, import_formatDiagnostic.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, (0, import_config.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 ? (0, import_variables.getInlineValuesKey)(inlineValues) : \"\"}`;\n};\nvar hasThemeUpdatingProps = function(props) {\n\treturn \"name\" in props || \"reset\" in props || \"forceClassName\" in props || \"inlineValues\" in props;\n};\n//# sourceMappingURL=useThemeState.js.map\n"],"mappings":";;;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC/B,KAAK,IAAI,QAAQ,KAAK,UAAU,QAAQ,MAAM;EAC7C,KAAK,IAAI;EACT,YAAY;CACb,CAAC;AACF;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC7C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY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AAS;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,gBAAgB,GAAG,iBAAiB,oBAAoB,YAAY,IAAI;AACvM;AACA,IAAI,wBAAwB,SAAS,OAAO;CAC3C,OAAO,UAAU,SAAS,WAAW,SAAS,oBAAoB,SAAS,kBAAkB;AAC9F"}
|
|
@@ -44,7 +44,9 @@ var import_TamaguiProvider = require("./views/TamaguiProvider.cjs");
|
|
|
44
44
|
var import_Text = require("./views/Text.cjs");
|
|
45
45
|
var import_View = require("./views/View.cjs");
|
|
46
46
|
var import_styleFrontend = require("./helpers/styleFrontend.cjs");
|
|
47
|
-
const createFrontendProgram =
|
|
47
|
+
const createFrontendProgram = process.env.TAMAGUI_RUNTIME_STYLE_VALUE_GRAMMAR === "disabled" ? () => {
|
|
48
|
+
throw new Error("createFrontendProgram requires experimental.webRuntimeFeatures.styleValueGrammar");
|
|
49
|
+
} : import_frontendProgram.createFrontendProgram;
|
|
48
50
|
const plainValueToPayload = (value, property) => {
|
|
49
51
|
if (typeof value === "string") return value;
|
|
50
52
|
if (typeof value !== "number" || !Number.isFinite(value)) return null;
|
|
@@ -46,7 +46,9 @@ var import_TamaguiProvider = require("./views/TamaguiProvider.native.js");
|
|
|
46
46
|
var import_Text = require("./views/Text.native.js");
|
|
47
47
|
var import_View = require("./views/View.native.js");
|
|
48
48
|
var import_styleFrontend = require("./helpers/styleFrontend.native.js");
|
|
49
|
-
var createFrontendProgram =
|
|
49
|
+
var createFrontendProgram = process.env.TAMAGUI_RUNTIME_STYLE_VALUE_GRAMMAR === "disabled" ? function() {
|
|
50
|
+
throw new Error("createFrontendProgram requires experimental.webRuntimeFeatures.styleValueGrammar");
|
|
51
|
+
} : import_frontendProgram.createFrontendProgram;
|
|
50
52
|
var plainValueToPayload = function(value, property) {
|
|
51
53
|
if (typeof value === "string") return value;
|
|
52
54
|
if (typeof value !== "number" || !Number.isFinite(value)) return null;
|
|
@@ -46,7 +46,9 @@ var import_TamaguiProvider = require("./views/TamaguiProvider.native.js");
|
|
|
46
46
|
var import_Text = require("./views/Text.native.js");
|
|
47
47
|
var import_View = require("./views/View.native.js");
|
|
48
48
|
var import_styleFrontend = require("./helpers/styleFrontend.native.js");
|
|
49
|
-
var createFrontendProgram =
|
|
49
|
+
var createFrontendProgram = process.env.TAMAGUI_RUNTIME_STYLE_VALUE_GRAMMAR === "disabled" ? function() {
|
|
50
|
+
throw new Error("createFrontendProgram requires experimental.webRuntimeFeatures.styleValueGrammar");
|
|
51
|
+
} : import_frontendProgram.createFrontendProgram;
|
|
50
52
|
var plainValueToPayload = function(value, property) {
|
|
51
53
|
if (typeof value === "string") return value;
|
|
52
54
|
if (typeof value !== "number" || !Number.isFinite(value)) return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal-runtime.native.js","names":[],"sources":["cjs/internal-runtime.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar internal_runtime_exports = {};\n__export(internal_runtime_exports, {\n STYLE_FRONTEND_PASSTHROUGH_PREFIX: () => import_styleFrontend.STYLE_FRONTEND_PASSTHROUGH_PREFIX,\n STYLE_FRONTEND_PREPROCESSED: () => import_styleFrontend.STYLE_FRONTEND_PREPROCESSED,\n TamaguiProvider: () => TamaguiProvider,\n createFrontendProgram: () => createFrontendProgram,\n createFrontendStyled: () => createFrontendStyled,\n createFrontendViews: () => createFrontendViews,\n createTamagui: () => createTamagui,\n plainValueToPayload: () => plainValueToPayload,\n regularStyleFrontend: () => import_styleFrontend.regularStyleFrontend,\n setupHooks: () => setupHooks\n});\nmodule.exports = __toCommonJS(internal_runtime_exports);\nvar import_helpers = require(\"@tamagui/helpers\");\nvar import_createComponent = require(\"./createComponent\");\nvar import_componentDisplayName = require(\"./helpers/componentDisplayName\");\nvar import_frontendProgram = require(\"./helpers/frontendProgram\");\nvar import_createTamagui = require(\"./createTamagui\");\nvar import_setupHooks = require(\"./setupHooks\");\nvar import_styled = require(\"./styled\");\nvar import_TamaguiProvider = require(\"./views/TamaguiProvider\");\nvar import_Text = require(\"./views/Text\");\nvar import_View = require(\"./views/View\");\nvar import_styleFrontend = require(\"./helpers/styleFrontend\");\nvar createFrontendProgram = import_frontendProgram.createFrontendProgram;\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 import_helpers.stylePropsUnitless[property] ? String(value) : `${value}px`;\n};\nvar createTamagui = import_createTamagui.createTamagui;\nvar setupHooks = import_setupHooks.setupHooks;\nvar TamaguiProvider = import_TamaguiProvider.TamaguiProvider;\nfunction createFrontendStyled(frontend) {\n return (0, import_styled.createFrontendStyled)(frontend);\n}\nfunction createFrontendViews(frontend) {\n return {\n View: (0, import_componentDisplayName.setComponentDisplayName)((0, import_createComponent.createComponent)({\n ...import_View.viewStaticConfig,\n styleFrontend: frontend\n }), \"View\"),\n Text: (0, import_componentDisplayName.setComponentDisplayName)((0, import_createComponent.createComponent)({\n ...import_Text.textStaticConfig,\n styleFrontend: frontend\n }), \"Text\")\n };\n}\n//# sourceMappingURL=internal-runtime.js.map\n"],"mappings":";;;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,2BAA2B,CAAC;AAChC,SAAS,0BAA0B;CACjC,yCAAyC,qBAAqB;CAC9D,mCAAmC,qBAAqB;CACxD,uBAAuB;CACvB,6BAA6B;CAC7B,4BAA4B;CAC5B,2BAA2B;CAC3B,qBAAqB;CACrB,2BAA2B;CAC3B,4BAA4B,qBAAqB;CACjD,kBAAkB;AACpB,CAAC;AACD,OAAO,UAAU,aAAa,wBAAwB;AACtD,IAAI,iBAAiB,QAAQ,kBAAkB;AAC/C,IAAI,yBAAyB,QAAQ,6BAAmB;AACxD,IAAI,8BAA8B,QAAQ,0CAAgC;AAC1E,IAAI,yBAAyB,QAAQ,qCAA2B;AAChE,IAAI,uBAAuB,QAAQ,2BAAiB;AACpD,IAAI,oBAAoB,QAAQ,wBAAc;AAC9C,IAAI,gBAAgB,QAAQ,oBAAU;AACtC,IAAI,yBAAyB,QAAQ,mCAAyB;AAC9D,IAAI,cAAc,QAAQ,wBAAc;AACxC,IAAI,cAAc,QAAQ,wBAAc;AACxC,IAAI,uBAAuB,QAAQ,mCAAyB;AAC5D,IAAI,wBAAwB,uBAAuB;
|
|
1
|
+
{"version":3,"file":"internal-runtime.native.js","names":[],"sources":["cjs/internal-runtime.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar internal_runtime_exports = {};\n__export(internal_runtime_exports, {\n STYLE_FRONTEND_PASSTHROUGH_PREFIX: () => import_styleFrontend.STYLE_FRONTEND_PASSTHROUGH_PREFIX,\n STYLE_FRONTEND_PREPROCESSED: () => import_styleFrontend.STYLE_FRONTEND_PREPROCESSED,\n TamaguiProvider: () => TamaguiProvider,\n createFrontendProgram: () => createFrontendProgram,\n createFrontendStyled: () => createFrontendStyled,\n createFrontendViews: () => createFrontendViews,\n createTamagui: () => createTamagui,\n plainValueToPayload: () => plainValueToPayload,\n regularStyleFrontend: () => import_styleFrontend.regularStyleFrontend,\n setupHooks: () => setupHooks\n});\nmodule.exports = __toCommonJS(internal_runtime_exports);\nvar import_helpers = require(\"@tamagui/helpers\");\nvar import_createComponent = require(\"./createComponent\");\nvar import_componentDisplayName = require(\"./helpers/componentDisplayName\");\nvar import_frontendProgram = require(\"./helpers/frontendProgram\");\nvar import_createTamagui = require(\"./createTamagui\");\nvar import_setupHooks = require(\"./setupHooks\");\nvar import_styled = require(\"./styled\");\nvar import_TamaguiProvider = require(\"./views/TamaguiProvider\");\nvar import_Text = require(\"./views/Text\");\nvar import_View = require(\"./views/View\");\nvar import_styleFrontend = require(\"./helpers/styleFrontend\");\nvar createFrontendProgram = process.env.TAMAGUI_RUNTIME_STYLE_VALUE_GRAMMAR === \"disabled\" ? function() {\n throw new Error(\"createFrontendProgram requires experimental.webRuntimeFeatures.styleValueGrammar\");\n} : import_frontendProgram.createFrontendProgram;\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 import_helpers.stylePropsUnitless[property] ? String(value) : `${value}px`;\n};\nvar createTamagui = import_createTamagui.createTamagui;\nvar setupHooks = import_setupHooks.setupHooks;\nvar TamaguiProvider = import_TamaguiProvider.TamaguiProvider;\nfunction createFrontendStyled(frontend) {\n return (0, import_styled.createFrontendStyled)(frontend);\n}\nfunction createFrontendViews(frontend) {\n return {\n View: (0, import_componentDisplayName.setComponentDisplayName)((0, import_createComponent.createComponent)({\n ...import_View.viewStaticConfig,\n styleFrontend: frontend\n }), \"View\"),\n Text: (0, import_componentDisplayName.setComponentDisplayName)((0, import_createComponent.createComponent)({\n ...import_Text.textStaticConfig,\n styleFrontend: frontend\n }), \"Text\")\n };\n}\n//# sourceMappingURL=internal-runtime.js.map\n"],"mappings":";;;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,2BAA2B,CAAC;AAChC,SAAS,0BAA0B;CACjC,yCAAyC,qBAAqB;CAC9D,mCAAmC,qBAAqB;CACxD,uBAAuB;CACvB,6BAA6B;CAC7B,4BAA4B;CAC5B,2BAA2B;CAC3B,qBAAqB;CACrB,2BAA2B;CAC3B,4BAA4B,qBAAqB;CACjD,kBAAkB;AACpB,CAAC;AACD,OAAO,UAAU,aAAa,wBAAwB;AACtD,IAAI,iBAAiB,QAAQ,kBAAkB;AAC/C,IAAI,yBAAyB,QAAQ,6BAAmB;AACxD,IAAI,8BAA8B,QAAQ,0CAAgC;AAC1E,IAAI,yBAAyB,QAAQ,qCAA2B;AAChE,IAAI,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js
CHANGED
|
@@ -52,7 +52,7 @@ const Theme = (0, import_compose_refs.createRefComponent)(function Theme2(props,
|
|
|
52
52
|
const { passThrough } = props;
|
|
53
53
|
const isRoot = !!props["_isRoot"];
|
|
54
54
|
const config = (0, import_config.getConfig)();
|
|
55
|
-
const inlineValues = (0, import_variables.getInlineValuesFromProps)(props, config);
|
|
55
|
+
const inlineValues = process.env.TAMAGUI_RUNTIME_INLINE_THEME_VALUES === "disabled" ? null : (0, import_variables.getInlineValuesFromProps)(props, config);
|
|
56
56
|
let inlineCSS = null;
|
|
57
57
|
let rulesToInsert = null;
|
|
58
58
|
if (inlineValues) {
|
|
@@ -54,7 +54,7 @@ var Theme = (0, import_compose_refs.createRefComponent)(function Theme2(props, r
|
|
|
54
54
|
var { passThrough } = props;
|
|
55
55
|
var isRoot = !!props["_isRoot"];
|
|
56
56
|
var config = (0, import_config.getConfig)();
|
|
57
|
-
var inlineValues = (0, import_variables.getInlineValuesFromProps)(props, config);
|
|
57
|
+
var inlineValues = process.env.TAMAGUI_RUNTIME_INLINE_THEME_VALUES === "disabled" ? null : (0, import_variables.getInlineValuesFromProps)(props, config);
|
|
58
58
|
var inlineCSS = null;
|
|
59
59
|
var rulesToInsert = null;
|
|
60
60
|
useInsertEffectCompat(function() {
|
|
@@ -54,7 +54,7 @@ var Theme = (0, import_compose_refs.createRefComponent)(function Theme2(props, r
|
|
|
54
54
|
var { passThrough } = props;
|
|
55
55
|
var isRoot = !!props["_isRoot"];
|
|
56
56
|
var config = (0, import_config.getConfig)();
|
|
57
|
-
var inlineValues = (0, import_variables.getInlineValuesFromProps)(props, config);
|
|
57
|
+
var inlineValues = process.env.TAMAGUI_RUNTIME_INLINE_THEME_VALUES === "disabled" ? null : (0, import_variables.getInlineValuesFromProps)(props, config);
|
|
58
58
|
var inlineCSS = null;
|
|
59
59
|
var rulesToInsert = null;
|
|
60
60
|
useInsertEffectCompat(function() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Theme.native.js","names":[],"sources":["cjs/views/Theme.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n\tfor (var name in all) __defProp(target, name, {\n\t\tget: all[name],\n\t\tenumerable: true\n\t});\n};\nvar __copyProps = (to, from, except, desc) => {\n\tif (from && typeof from === \"object\" || typeof from === \"function\") {\n\t\tfor (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {\n\t\t\tget: () => from[key],\n\t\t\tenumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable\n\t\t});\n\t}\n\treturn to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n\t// If the importer is in node compatibility mode or this is not an ESM\n\t// file that has been converted to a CommonJS file using a Babel-\n\t// compatible transform (i.e. \"__esModule\" has not been set), then set\n\t// \"default\" to the CommonJS \"module.exports\" for node compatibility.\n\tisNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", {\n\t\tvalue: mod,\n\t\tenumerable: true\n\t}) : target,\n\tmod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar Theme_exports = {};\n__export(Theme_exports, {\n\tTheme: () => Theme,\n\tgetThemedChildren: () => getThemedChildren\n});\nmodule.exports = __toCommonJS(Theme_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_compose_refs = require(\"@tamagui/compose-refs\");\nvar import_constants = require(\"@tamagui/constants\");\nvar import_helpers = require(\"@tamagui/helpers\");\nvar import_react = __toESM(require(\"react\"), 1);\nvar import_config = require(\"../config\");\nvar import_createVariable = require(\"../createVariable\");\nvar import_formatDiagnostic = require(\"../helpers/formatDiagnostic\");\nvar import_insertStyleRule = require(\"../helpers/insertStyleRule\");\nvar import_nativeStyleEngine = require(\"../helpers/nativeStyleEngine\");\nvar import_variables = require(\"../helpers/variables\");\nvar import_useTheme = require(\"../hooks/useTheme\");\nvar import_useThemeState = require(\"../hooks/useThemeState\");\nvar import_ThemeDebug = require(\"./ThemeDebug\");\nvar useInsertEffectCompat = import_constants.isWeb ? import_react.default.useInsertionEffect || import_constants.useIsomorphicLayoutEffect : function() {};\nvar Theme = (0, import_compose_refs.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 = (0, import_config.getConfig)();\n\tvar inlineValues = (0, import_variables.getInlineValuesFromProps)(props, config);\n\tvar inlineCSS = null;\n\tvar rulesToInsert = null;\n\tuseInsertEffectCompat(function() {\n\t\tif (rulesToInsert) (0, import_insertStyleRule.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] = (0, import_useTheme.useThemeWithState)(themeProps, isRoot, true);\n\t(0, import_constants.useIsomorphicLayoutEffect)(function() {\n\t\t(0, import_nativeStyleEngine.updateNativeStyleScope)(themeState.id, themeState.name, themeState.theme);\n\t\treturn function() {\n\t\t\treturn (0, import_nativeStyleEngine.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\"] ? import_react.Children.map(props.children, function(child) {\n\t\treturn passThrough || !/* @__PURE__ */ (0, import_react.isValidElement)(child) ? child : /* @__PURE__ */ (0, import_react.cloneElement)(child, { [\"data-disable-theme\"]: true });\n\t}) : props.children;\n\tif (ref) try {\n\t\timport_react.default.Children.only(finalChildren);\n\t\tfinalChildren = /* @__PURE__ */ (0, import_react.cloneElement)(finalChildren, { ref });\n\t} catch (e) {}\n\tvar stateRef = (0, import_react.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 || (0, import_useThemeState.hasThemeUpdatingProps)(props);\n\tif (process.env.NODE_ENV === \"development\" && props.debug === \"visualize\") children = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ThemeDebug.ThemeDebug, {\n\t\tthemeState,\n\t\tthemeProps: props,\n\t\tchildren\n\t});\n\tif (!shouldRenderChildrenWithTheme) return children;\n\tchildren = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_useThemeState.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 = (0, import_useThemeState.getThemeState)(themeState.isNew ? themeState.id : themeState.parentId);\n\t\tif (!parentState) throw new Error((0, import_formatDiagnostic.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 = import_react.Children.toArray(children).map(function(child) {\n\t\t\treturn /* @__PURE__ */ (0, import_react.isValidElement)(child) ? passThrough ? child : /* @__PURE__ */ (0, import_react.cloneElement)(child, void 0, /* @__PURE__ */ (0, import_jsx_runtime.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 (import_constants.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__ */ (0, import_jsx_runtime.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\") {\n\t\t\tvar className1 = requiresExtraWrapper ? `${name.startsWith(\"light\") ? \"t_light\" : name.startsWith(\"dark\") ? \"t_dark\" : \"\"} _dsp_contents` : `_dsp_contents`;\n\t\t\tchildren = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(\"span\", {\n\t\t\t\tclassName: className1,\n\t\t\t\tchildren\n\t\t\t});\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 ? (0, import_createVariable.variableToString)(themeState.theme.color) : \"\",\n\t\tclassName: (0, import_helpers.getThemeClassNames)(themeState.name, isRoot)\n\t};\n}\n//# sourceMappingURL=Theme.js.map\n"],"mappings":";;;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC/B,KAAK,IAAI,QAAQ,KAAK,UAAU,QAAQ,MAAM;EAC7C,KAAK,IAAI;EACT,YAAY;CACb,CAAC;AACF;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC7C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EACnE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GAAG,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QAAQ,UAAU,IAAI,KAAK;GAC9G,WAAW,KAAK;GAChB,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAC3D,CAAC;CACF;CACA,OAAO;AACR;AACA,IAAI,WAAW,KAAK,YAAY,YAAY,SAAS,OAAO,OAAO,SAAS,aAAa,GAAG,CAAC,IAAI,CAAC,GAAG,YAKpG,cAAc,CAAC,OAAO,CAAC,IAAI,aAAa,UAAU,QAAQ,WAAW;CACpE,OAAO;CACP,YAAY;AACb,CAAC,IAAI,QACL,GACD;AACA,IAAI,gBAA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
+
{"version":3,"file":"Theme.native.js","names":[],"sources":["cjs/views/Theme.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n\tfor (var name in all) __defProp(target, name, {\n\t\tget: all[name],\n\t\tenumerable: true\n\t});\n};\nvar __copyProps = (to, from, except, desc) => {\n\tif (from && typeof from === \"object\" || typeof from === \"function\") {\n\t\tfor (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {\n\t\t\tget: () => from[key],\n\t\t\tenumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable\n\t\t});\n\t}\n\treturn to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n\t// If the importer is in node compatibility mode or this is not an ESM\n\t// file that has been converted to a CommonJS file using a Babel-\n\t// compatible transform (i.e. \"__esModule\" has not been set), then set\n\t// \"default\" to the CommonJS \"module.exports\" for node compatibility.\n\tisNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", {\n\t\tvalue: mod,\n\t\tenumerable: true\n\t}) : target,\n\tmod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar Theme_exports = {};\n__export(Theme_exports, {\n\tTheme: () => Theme,\n\tgetThemedChildren: () => getThemedChildren\n});\nmodule.exports = __toCommonJS(Theme_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_compose_refs = require(\"@tamagui/compose-refs\");\nvar import_constants = require(\"@tamagui/constants\");\nvar import_helpers = require(\"@tamagui/helpers\");\nvar import_react = __toESM(require(\"react\"), 1);\nvar import_config = require(\"../config\");\nvar import_createVariable = require(\"../createVariable\");\nvar import_formatDiagnostic = require(\"../helpers/formatDiagnostic\");\nvar import_insertStyleRule = require(\"../helpers/insertStyleRule\");\nvar import_nativeStyleEngine = require(\"../helpers/nativeStyleEngine\");\nvar import_variables = require(\"../helpers/variables\");\nvar import_useTheme = require(\"../hooks/useTheme\");\nvar import_useThemeState = require(\"../hooks/useThemeState\");\nvar import_ThemeDebug = require(\"./ThemeDebug\");\nvar useInsertEffectCompat = import_constants.isWeb ? import_react.default.useInsertionEffect || import_constants.useIsomorphicLayoutEffect : function() {};\nvar Theme = (0, import_compose_refs.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 = (0, import_config.getConfig)();\n\tvar inlineValues = process.env.TAMAGUI_RUNTIME_INLINE_THEME_VALUES === \"disabled\" ? null : (0, import_variables.getInlineValuesFromProps)(props, config);\n\tvar inlineCSS = null;\n\tvar rulesToInsert = null;\n\tuseInsertEffectCompat(function() {\n\t\tif (rulesToInsert) (0, import_insertStyleRule.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] = (0, import_useTheme.useThemeWithState)(themeProps, isRoot, true);\n\t(0, import_constants.useIsomorphicLayoutEffect)(function() {\n\t\t(0, import_nativeStyleEngine.updateNativeStyleScope)(themeState.id, themeState.name, themeState.theme);\n\t\treturn function() {\n\t\t\treturn (0, import_nativeStyleEngine.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\"] ? import_react.Children.map(props.children, function(child) {\n\t\treturn passThrough || !/* @__PURE__ */ (0, import_react.isValidElement)(child) ? child : /* @__PURE__ */ (0, import_react.cloneElement)(child, { [\"data-disable-theme\"]: true });\n\t}) : props.children;\n\tif (ref) try {\n\t\timport_react.default.Children.only(finalChildren);\n\t\tfinalChildren = /* @__PURE__ */ (0, import_react.cloneElement)(finalChildren, { ref });\n\t} catch (e) {}\n\tvar stateRef = (0, import_react.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 || (0, import_useThemeState.hasThemeUpdatingProps)(props);\n\tif (process.env.NODE_ENV === \"development\" && props.debug === \"visualize\") children = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ThemeDebug.ThemeDebug, {\n\t\tthemeState,\n\t\tthemeProps: props,\n\t\tchildren\n\t});\n\tif (!shouldRenderChildrenWithTheme) return children;\n\tchildren = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_useThemeState.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 = (0, import_useThemeState.getThemeState)(themeState.isNew ? themeState.id : themeState.parentId);\n\t\tif (!parentState) throw new Error((0, import_formatDiagnostic.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 = import_react.Children.toArray(children).map(function(child) {\n\t\t\treturn /* @__PURE__ */ (0, import_react.isValidElement)(child) ? passThrough ? child : /* @__PURE__ */ (0, import_react.cloneElement)(child, void 0, /* @__PURE__ */ (0, import_jsx_runtime.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 (import_constants.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__ */ (0, import_jsx_runtime.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\") {\n\t\t\tvar className1 = requiresExtraWrapper ? `${name.startsWith(\"light\") ? \"t_light\" : name.startsWith(\"dark\") ? \"t_dark\" : \"\"} _dsp_contents` : `_dsp_contents`;\n\t\t\tchildren = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(\"span\", {\n\t\t\t\tclassName: className1,\n\t\t\t\tchildren\n\t\t\t});\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 ? (0, import_createVariable.variableToString)(themeState.theme.color) : \"\",\n\t\tclassName: (0, import_helpers.getThemeClassNames)(themeState.name, isRoot)\n\t};\n}\n//# sourceMappingURL=Theme.js.map\n"],"mappings":";;;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC/B,KAAK,IAAI,QAAQ,KAAK,UAAU,QAAQ,MAAM;EAC7C,KAAK,IAAI;EACT,YAAY;CACb,CAAC;AACF;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC7C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EACnE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GAAG,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QAAQ,UAAU,IAAI,KAAK;GAC9G,WAAW,KAAK;GAChB,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAC3D,CAAC;CACF;CACA,OAAO;AACR;AACA,IAAI,WAAW,KAAK,YAAY,YAAY,SAAS,OAAO,OAAO,SAAS,aAAa,GAAG,CAAC,IAAI,CAAC,GAAG,YAKpG,cAAc,CAAC,OAAO,CAAC,IAAI,aAAa,UAAU,QAAQ,W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kB,WAAW,MAAM,KAAK,IAAI;EAC9K,YAAY,GAAG,eAAe,oBAAoB,WAAW,MAAM,MAAM;CAC1E;AACD"}
|
|
@@ -675,7 +675,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
675
675
|
}, []);
|
|
676
676
|
useIsomorphicLayoutEffect(() => {
|
|
677
677
|
let disposeSafeArea;
|
|
678
|
-
if (splitStyles?.usesSafeArea) {
|
|
678
|
+
if (process.env.TAMAGUI_RUNTIME_SAFE_AREA !== "disabled" && splitStyles?.usesSafeArea) {
|
|
679
679
|
const updateSafeArea = () => {
|
|
680
680
|
setState((previous) => ({ ...previous }));
|
|
681
681
|
};
|