@tamagui/web 3.0.0-beta.1479.1 → 3.0.0-beta.1540.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/eventHandling.native.cjs +2 -2
- package/dist/cjs/eventHandling.native.js +2 -2
- package/dist/cjs/eventHandling.native.js.map +1 -1
- package/dist/cjs/helpers/expandStyle.cjs +25 -1
- package/dist/cjs/helpers/expandStyle.native.cjs +25 -1
- package/dist/cjs/helpers/expandStyle.native.js +25 -1
- package/dist/cjs/helpers/expandStyle.native.js.map +1 -1
- package/dist/cjs/helpers/getSplitStyles.native.cjs +16 -6
- package/dist/cjs/helpers/getSplitStyles.native.js +16 -6
- package/dist/cjs/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/cjs/helpers/mainThreadPressEvents.native.cjs +47 -120
- package/dist/cjs/helpers/mainThreadPressEvents.native.js +47 -120
- package/dist/cjs/helpers/mainThreadPressEvents.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/esm/eventHandling.native.js +2 -2
- package/dist/esm/eventHandling.native.js.map +1 -1
- package/dist/esm/helpers/expandStyle.mjs +22 -1
- package/dist/esm/helpers/expandStyle.mjs.map +1 -1
- package/dist/esm/helpers/expandStyle.native.js +22 -1
- package/dist/esm/helpers/expandStyle.native.js.map +1 -1
- package/dist/esm/helpers/getSplitStyles.native.js +17 -7
- package/dist/esm/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/esm/helpers/mainThreadPressEvents.native.js +48 -121
- package/dist/esm/helpers/mainThreadPressEvents.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/package.json +16 -16
- package/src/eventHandling.native.ts +4 -4
- package/src/helpers/expandStyle.ts +26 -0
- package/src/helpers/getSplitStyles.tsx +18 -1
- package/src/helpers/mainThreadPressEvents.native.ts +66 -187
- package/src/hooks/useThemeState.ts +10 -2
- package/types/helpers/expandStyle.d.ts +1 -0
- package/types/helpers/expandStyle.d.ts.map +1 -1
- package/types/helpers/getSplitStyles.d.ts.map +1 -1
- package/types/helpers/mainThreadPressEvents.native.d.ts +0 -7
- package/types/helpers/mainThreadPressEvents.native.d.ts.map +1 -1
- package/types/hooks/useThemeState.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\tgetNewThemeName: () => getNewThemeName,\n\tgetRootThemeState: () => getRootThemeState,\n\tgetThemeNameCacheSize: () => getThemeNameCacheSize,\n\tgetThemeProviderChainSizes: () => getThemeProviderChainSizes,\n\tgetThemeProviderParent: () => getThemeProviderParent,\n\tgetThemeState: () => getThemeState,\n\tgetThemeUpdateLayer: () => getThemeUpdateLayer,\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_helpers = require(\"@tamagui/helpers\");\nvar import_config = require(\"../config\");\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 themeUpdateLayers = /* @__PURE__ */ new Map();\nvar themeProviderParents = /* @__PURE__ */ new Map();\nvar getThemeUpdateLayer = function(id) {\n\treturn themeUpdateLayers.get(id);\n};\nvar getThemeProviderParent = function(id) {\n\treturn themeProviderParents.get(id);\n};\nvar getThemeProviderChainSizes = function() {\n\treturn {\n\t\tlayers: themeUpdateLayers.size,\n\t\tparents: themeProviderParents.size\n\t};\n};\nvar registerThemeProviderChain = function(id, parentId, props) {\n\tthemeProviderParents.set(id, parentId);\n\tif (props._themeUpdate) themeUpdateLayers.set(id, props._themeUpdate);\n\telse themeUpdateLayers.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 _ref;\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 r = (_ref = (0, import_react.useRef)(null)).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\tr.props = props;\n\tr.propsKey = propsKey;\n\tr.isRoot = isRoot;\n\tr.keys = keys;\n\tr.schemeKeys = schemeKeys;\n\tr.parentId = parentId;\n\tr.renderVersion++;\n\tvar [, forceUpdate] = (0, import_react.useReducer)(incReducer, 0);\n\tvar state = getSnapshotImpl(r);\n\tr.lastSnap = state;\n\t(0, import_react.useEffect)(function() {\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 _listenersByParent, _pid;\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\t((_listenersByParent = listenersByParent)[_pid = pid] || (_listenersByParent[_pid] = /* @__PURE__ */ new Set())).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\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 Boolean(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\tthemeUpdateLayers.delete(r.id);\n\tthemeProviderParents.delete(r.id);\n}\nvar getSnapshotImpl = function(r) {\n\tvar _keys_current, _schemeKeys_current, _keys_current1, _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._parentSchemeAuthored === parentState.schemeAuthored && 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 = !optimizeForFirstRender && Boolean(((_keys_current = keys.current) === null || _keys_current === void 0 ? void 0 : _keys_current.size) && (schemeKeys === null || schemeKeys === void 0 ? void 0 : (_schemeKeys_current = schemeKeys.current) === null || _schemeKeys_current === void 0 ? void 0 : _schemeKeys_current.size) === keys.current.size);\n\tvar canSkipForSchemeChange = Boolean(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_current1 = keys.current) === null || _keys_current1 === void 0 ? void 0 : _keys_current1.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._themeUpdate && (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 = props._themeUpdate.getTheme(parentTheme, 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 (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._parentSchemeAuthored = parentState === null || parentState === void 0 ? void 0 : parentState.schemeAuthored;\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 parentState = states.get(parentId);\n\tif (props.passThrough) return [false, lastState || parentState || { name: \"\" }];\n\tthemes || (themes = (0, import_config.getConfig)().themes);\n\tvar name = !propsKey && (!lastState || !lastState.isNew) ? null : getNewThemeName(parentState === null || parentState === void 0 ? void 0 : parentState.name, props, pendingUpdate === \"force\" ? true : !!needsUpdate);\n\tvar authoredName = props.name;\n\tvar parentSchemeAuthored = !!(parentState === null || parentState === void 0 ? void 0 : parentState.schemeAuthored);\n\tvar schemeAuthored = isRoot ? !!props.forceClassName : parentSchemeAuthored || !!(authoredName && (0, import_helpers.getThemeScheme)(authoredName) && authoredName in themes);\n\tvar intentChanged = schemeAuthored !== parentSchemeAuthored;\n\tvar resolvedName = name || (parentState === null || parentState === void 0 ? void 0 : parentState.name);\n\tvar sameAsLast = lastState && lastState.name === resolvedName && !!lastState.schemeAuthored === schemeAuthored;\n\tvar isSameAsParent = Boolean(parentState && resolvedName === parentState.name && !intentChanged);\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) || !!(lastState === null || lastState === void 0 ? void 0 : lastState.schemeAuthored) !== schemeAuthored));\n\tif (isSameAsParent) {\n\t\tif (!shouldRerender && sameAsLast) return [false, lastState];\n\t\treturn [shouldRerender, {\n\t\t\t...parentState,\n\t\t\tisNew: false\n\t\t}];\n\t}\n\tif (!resolvedName) {\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 = (0, import_helpers.getThemeScheme)(resolvedName);\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 = Boolean(parentState && scheme !== parentState.scheme);\n\tvar inverses = parentInverses + (isInverse ? 1 : 0);\n\tvar nextState = {\n\t\tid,\n\t\tname: resolvedName,\n\t\ttheme: themes[resolvedName],\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\tschemeAuthored,\n\t\tisNew: true\n\t};\n\tif (isRoot) rootThemeState = nextState;\n\treturn [pendingUpdate === \"force\" || !sameAsLast, 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 _allListeners_get;\n\t\t(_allListeners_get = allListeners.get(childId2)) === null || _allListeners_get === void 0 || _allListeners_get();\n\t});\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 } = props;\n\tvar cacheKey = `${parentName}|${name || \"\"}|${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, (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, themes2) {\n\tvar forceUpdate = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false;\n\tvar parentParts = parentName ? parentName.split(\"_\") : [];\n\tvar found = null;\n\tif (name) {\n\t\tvar nameHasScheme = (0, import_helpers.getThemeScheme)(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 && found !== \"light\" && found !== \"dark\") return null;\n\treturn found;\n}\nvar getPropsKey = function(param) {\n\tvar { name, forceClassName, _themeUpdate } = param;\n\treturn `${name || \"\"}${forceClassName || \"\"}${(_themeUpdate === null || _themeUpdate === void 0 ? void 0 : _themeUpdate.key) || \"\"}`;\n};\nvar hasThemeUpdatingProps = function(props) {\n\treturn \"name\" in props || \"forceClassName\" in props || \"_themeUpdate\" 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;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,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAA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KAAK,IAAI,KAAK,IAAI,aAAa,QAAQ;AACjI;AACA,IAAI,wBAAwB,SAAS,OAAO;CAC3C,OAAO,UAAU,SAAS,oBAAoB,SAAS,kBAAkB;AAC1E"}
|
|
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\tgetNewThemeName: () => getNewThemeName,\n\tgetRootThemeState: () => getRootThemeState,\n\tgetThemeNameCacheSize: () => getThemeNameCacheSize,\n\tgetThemeProviderChainSizes: () => getThemeProviderChainSizes,\n\tgetThemeProviderParent: () => getThemeProviderParent,\n\tgetThemeState: () => getThemeState,\n\tgetThemeUpdateLayer: () => getThemeUpdateLayer,\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_helpers = require(\"@tamagui/helpers\");\nvar import_config = require(\"../config\");\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 themeUpdateLayers = /* @__PURE__ */ new Map();\nvar themeProviderParents = /* @__PURE__ */ new Map();\nvar getThemeUpdateLayer = function(id) {\n\treturn themeUpdateLayers.get(id);\n};\nvar getThemeProviderParent = function(id) {\n\treturn themeProviderParents.get(id);\n};\nvar getThemeProviderChainSizes = function() {\n\treturn {\n\t\tlayers: themeUpdateLayers.size,\n\t\tparents: themeProviderParents.size\n\t};\n};\nvar registerThemeProviderChain = function(id, parentId, props) {\n\tthemeProviderParents.set(id, parentId);\n\tif (props._themeUpdate) themeUpdateLayers.set(id, props._themeUpdate);\n\telse themeUpdateLayers.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 _ref;\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 r = (_ref = (0, import_react.useRef)(null)).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\tr.props = props;\n\tr.propsKey = propsKey;\n\tr.isRoot = isRoot;\n\tr.keys = keys;\n\tr.schemeKeys = schemeKeys;\n\tr.parentId = parentId;\n\tr.renderVersion++;\n\tvar [, forceUpdate] = (0, import_react.useReducer)(incReducer, 0);\n\tvar state = getSnapshotImpl(r);\n\tr.lastSnap = state;\n\t(0, import_react.useEffect)(function() {\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 _listenersByParent, _pid;\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\t((_listenersByParent = listenersByParent)[_pid = pid] || (_listenersByParent[_pid] = /* @__PURE__ */ new Set())).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\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 Boolean(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\tthemeUpdateLayers.delete(r.id);\n\tthemeProviderParents.delete(r.id);\n}\nvar getSnapshotImpl = function(r) {\n\tvar _keys_current, _schemeKeys_current, _keys_current1, _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._parentSchemeAuthored === parentState.schemeAuthored && 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 = !optimizeForFirstRender && Boolean(((_keys_current = keys.current) === null || _keys_current === void 0 ? void 0 : _keys_current.size) && (schemeKeys === null || schemeKeys === void 0 ? void 0 : (_schemeKeys_current = schemeKeys.current) === null || _schemeKeys_current === void 0 ? void 0 : _schemeKeys_current.size) === keys.current.size);\n\tvar canSkipForSchemeChange = Boolean(isSchemeOnlyChange && allKeysSchemeOptimized);\n\tvar needsUpdate = props.passThrough ? false : optimizeForFirstRender ? true : isRoot || props.forceClassName || props.name === \"light\" || props.name === \"dark\" || props.name === null ? true : !HasRenderedOnce.get(keys) ? true : canSkipForSchemeChange ? false : (keys === null || keys === void 0 ? void 0 : (_keys_current1 = keys.current) === null || _keys_current1 === void 0 ? void 0 : _keys_current1.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._themeUpdate && (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 = props._themeUpdate.getTheme(parentTheme, 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 (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._parentSchemeAuthored = parentState === null || parentState === void 0 ? void 0 : parentState.schemeAuthored;\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 parentState = states.get(parentId);\n\tif (props.passThrough) return [false, parentState || lastState || { name: \"\" }];\n\tthemes || (themes = (0, import_config.getConfig)().themes);\n\tvar name = !propsKey && (!lastState || !lastState.isNew) ? null : getNewThemeName(parentState === null || parentState === void 0 ? void 0 : parentState.name, props, pendingUpdate === \"force\" ? true : !!needsUpdate);\n\tvar authoredName = props.name;\n\tvar parentSchemeAuthored = !!(parentState === null || parentState === void 0 ? void 0 : parentState.schemeAuthored);\n\tvar schemeAuthored = isRoot ? !!props.forceClassName : parentSchemeAuthored || !!(authoredName && (0, import_helpers.getThemeScheme)(authoredName) && authoredName in themes);\n\tvar intentChanged = schemeAuthored !== parentSchemeAuthored;\n\tvar resolvedName = name || (parentState === null || parentState === void 0 ? void 0 : parentState.name);\n\tvar sameAsLast = lastState && lastState.name === resolvedName && !!lastState.schemeAuthored === schemeAuthored;\n\tvar isSameAsParent = Boolean(parentState && resolvedName === parentState.name && !intentChanged);\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) || !!(lastState === null || lastState === void 0 ? void 0 : lastState.schemeAuthored) !== schemeAuthored));\n\tif (isSameAsParent) {\n\t\tif (!shouldRerender && sameAsLast) return [false, lastState];\n\t\treturn [shouldRerender, {\n\t\t\t...parentState,\n\t\t\tisNew: false\n\t\t}];\n\t}\n\tif (!resolvedName) {\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 = (0, import_helpers.getThemeScheme)(resolvedName);\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 = Boolean(parentState && scheme !== parentState.scheme);\n\tvar inverses = parentInverses + (isInverse ? 1 : 0);\n\tvar nextState = {\n\t\tid,\n\t\tname: resolvedName,\n\t\ttheme: themes[resolvedName],\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\tschemeAuthored,\n\t\tisNew: true\n\t};\n\tif (isRoot) rootThemeState = nextState;\n\treturn [pendingUpdate === \"force\" || !sameAsLast, 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 _allListeners_get;\n\t\t(_allListeners_get = allListeners.get(childId2)) === null || _allListeners_get === void 0 || _allListeners_get();\n\t});\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 } = props;\n\tvar cacheKey = `${parentName}|${name || \"\"}|${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, (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, themes2) {\n\tvar forceUpdate = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false;\n\tvar parentParts = parentName ? parentName.split(\"_\") : [];\n\tvar found = null;\n\tif (name) {\n\t\tvar nameHasScheme = (0, import_helpers.getThemeScheme)(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 && found !== \"light\" && found !== \"dark\") return null;\n\treturn found;\n}\nvar getPropsKey = function(param) {\n\tvar { name, forceClassName, _themeUpdate } = param;\n\treturn `${name || \"\"}${forceClassName || \"\"}${(_themeUpdate === null || _themeUpdate === void 0 ? void 0 : _themeUpdate.key) || \"\"}`;\n};\nvar hasThemeUpdatingProps = function(props) {\n\treturn \"name\" in props || \"forceClassName\" in props || \"_themeUpdate\" 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;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,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,wBAAwB,CAAC;AAC7B,SAAS,uBAAuB;CAC/B,yBAAyB;CACzB,yBAAyB;CACzB,uBAAuB;CACvB,yBAAyB;CACzB,6BAA6B;CAC7B,kCAAkC;CAClC,8BAA8B;CAC9B,qBAAqB;CACrB,2BAA2B;CAC3B,6BAA6B;CAC7B,wBAAwB;CACxB,qBAAqB;AACtB,CAAC;AACD,OAAO,UAAU,aAAa,qBAA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AK,IAAI,GAAG,cAAc,UAAS,CAAE,CAAC,CAAC,QAAQ,WAAW;CAC9I,IAAI,eAAe,QAAQ,KAAK,eAAe,MAAM;CACrD,eAAe,IAAI,UAAU,MAAM;CACnC,OAAO;AACR;AACA,IAAI,wBAAwB,WAAW;CACtC,OAAO,eAAe;AACvB;AACA,SAAS,iBAAiB,YAAY,MAAM,SAAS;CACpD,IAAI,cAAc,UAAU,SAAS,KAAK,UAAU,OAAO,KAAK,IAAI,UAAU,KAAK;CACnF,IAAI,cAAc,aAAa,WAAW,MAAM,GAAG,IAAI,CAAC;CACxD,IAAI,QAAQ;CACZ,IAAI,MAAM;EACT,IAAI,iBAAiB,GAAG,eAAe,eAAc,CAAE,IAAI;EAC3D,IAAI,iBAAiB,QAAQ,SAAS,QAAQ;EAC9C,IAAI,CAAC,SAAS,CAAC,eAAe,KAAK,IAAI,IAAI,YAAY,QAAQ,KAAK,GAAG,KAAK;GAC3E,IAAI,OAAO,YAAY,MAAM,GAAG,CAAC,CAAC,CAAC,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,UAAU,WAAW,UAAU,QAAQ,OAAO;CAC1F,OAAO;AACR;AACA,IAAI,cAAc,SAAS,OAAO;CACjC,IAAI,EAAE,MAAM,gBAAgB,iBAAiB;CAC7C,OAAO,GAAG,QAAQ,KAAK,kBAAkB,MAAM,iBAAiB,QAAQ,iBAAiB,KAAK,IAAI,KAAK,IAAI,aAAa,QAAQ;AACjI;AACA,IAAI,wBAAwB,SAAS,OAAO;CAC3C,OAAO,UAAU,SAAS,oBAAoB,SAAS,kBAAkB;AAC1E"}
|
|
@@ -99,7 +99,7 @@ function useEvents(events, viewProps, stateRef, staticConfig, isHOC, isInsideNat
|
|
|
99
99
|
if (firePress) (_callbacksRef_current_onPress = (_callbacksRef_current = callbacksRef.current).onPress) === null || _callbacksRef_current_onPress === void 0 ? void 0 : _callbacksRef_current_onPress.call(_callbacksRef_current, e !== null && e !== void 0 ? e : {});
|
|
100
100
|
(_callbacksRef_current_onPressOut = (_callbacksRef_current1 = callbacksRef.current).onPressOut) === null || _callbacksRef_current_onPressOut === void 0 ? void 0 : _callbacksRef_current_onPressOut.call(_callbacksRef_current1, e !== null && e !== void 0 ? e : {});
|
|
101
101
|
};
|
|
102
|
-
var useResponderFallback =
|
|
102
|
+
var useResponderFallback = Boolean(hasRealPressEvents || !isInsideNativeMenu && getIsAndroid() && hasPressEvents);
|
|
103
103
|
useMainThreadPressEvents(events, viewProps, useResponderFallback, debugName);
|
|
104
104
|
if (everEnabled) {
|
|
105
105
|
callbacksRef.current = hasPressEvents ? {
|
|
@@ -108,7 +108,7 @@ function useEvents(events, viewProps, stateRef, staticConfig, isHOC, isInsideNat
|
|
|
108
108
|
onPress: events.onPress,
|
|
109
109
|
onLongPress: events.onLongPress
|
|
110
110
|
} : {};
|
|
111
|
-
if (hasRealPressEvents
|
|
111
|
+
if (hasRealPressEvents) {
|
|
112
112
|
endPress();
|
|
113
113
|
gestureRef.current = null;
|
|
114
114
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eventHandling.native.js","names":[],"sources":["esm/eventHandling.native.js"],"sourcesContent":["import { composeEventHandlers } from \"@tamagui/helpers\";\nimport { getGestureHandler } from \"@tamagui/native\";\nimport React, { useRef } from \"react\";\nimport { Platform, View } from \"react-native\";\nimport { useMainThreadPressEvents } from \"./helpers/mainThreadPressEvents\";\nvar isFabric = !!globalThis.nativeFabricUIManager;\nvar isAndroidCache;\nvar getIsAndroid = function() {\n if (isAndroidCache === void 0) {\n isAndroidCache = (Platform === null || Platform === void 0 ? void 0 : Platform.OS) === \"android\";\n }\n return isAndroidCache;\n};\nvar isNativeDesktopCache;\nvar getIsNativeDesktop = function() {\n if (isNativeDesktopCache === void 0) {\n isNativeDesktopCache = (Platform === null || Platform === void 0 ? void 0 : Platform.OS) === \"macos\" || (Platform === null || Platform === void 0 ? void 0 : Platform.OS) === \"windows\";\n }\n return isNativeDesktopCache;\n};\nvar responderClaim = function() {\n return true;\n};\nvar responderWrapperStyle = {\n display: \"contents\"\n};\nfunction getWebEvents() {\n return {};\n}\nfunction useEvents(events, viewProps, stateRef, staticConfig, isHOC, isInsideNativeMenu, debugName, hasRealPressEvents) {\n if (events) {\n if (events.onFocus) {\n viewProps[\"onFocus\"] = events.onFocus;\n }\n if (events.onBlur) {\n viewProps[\"onBlur\"] = events.onBlur;\n }\n if (getIsNativeDesktop()) {\n if (events.onMouseEnter) {\n viewProps[\"onMouseEnter\"] = events.onMouseEnter;\n }\n if (events.onMouseLeave) {\n viewProps[\"onMouseLeave\"] = events.onMouseLeave;\n }\n }\n }\n var hasPressEvents = events === null || events === void 0 ? void 0 : events.onPress;\n var gh = getGestureHandler();\n if (hasPressEvents) {\n stateRef.current.hasHadEvents = true;\n }\n if (hasRealPressEvents) {\n stateRef.current.hasRealPressEvents = true;\n }\n var everEnabled = Boolean(hasPressEvents || stateRef.current.hasHadEvents);\n var isUsingRNGH = gh.isEnabled;\n if (staticConfig.isInput) {\n if (events) {\n var { onPressIn, onPressOut, onPress } = events;\n var inputEvents = {\n onPressIn,\n onPressOut: onPressOut || onPress\n };\n if (onPressOut && onPress) {\n inputEvents.onPressOut = composeEventHandlers(onPress, onPressOut);\n }\n Object.assign(viewProps, inputEvents);\n }\n return null;\n }\n var isCompositeComponent = !isHOC && staticConfig.Component && typeof staticConfig.Component !== \"string\";\n if (isHOC || isCompositeComponent) {\n if (events) {\n var { onPressIn: onPressIn1, onPressOut: onPressOut1, onPress: onPress1, onLongPress, delayLongPress } = events;\n Object.assign(viewProps, {\n onPressIn: onPressIn1,\n onPressOut: onPressOut1,\n onPress: onPress1,\n onLongPress,\n delayLongPress\n });\n }\n return null;\n }\n if (isUsingRNGH) {\n var callbacksRef = useRef(isUsingRNGH ? {} : null);\n var gestureRef = useRef(null);\n var pressActiveRef = useRef(false);\n var beginPress = function(e) {\n var _callbacksRef_current_onPressIn, _callbacksRef_current;\n if (pressActiveRef.current) return;\n pressActiveRef.current = true;\n (_callbacksRef_current_onPressIn = (_callbacksRef_current = callbacksRef.current).onPressIn) === null || _callbacksRef_current_onPressIn === void 0 ? void 0 : _callbacksRef_current_onPressIn.call(_callbacksRef_current, e !== null && e !== void 0 ? e : {});\n };\n var endPress = function(e) {\n var firePress = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;\n var _callbacksRef_current_onPress, _callbacksRef_current, _callbacksRef_current_onPressOut, _callbacksRef_current1;\n if (!pressActiveRef.current) return;\n pressActiveRef.current = false;\n if (firePress) (_callbacksRef_current_onPress = (_callbacksRef_current = callbacksRef.current).onPress) === null || _callbacksRef_current_onPress === void 0 ? void 0 : _callbacksRef_current_onPress.call(_callbacksRef_current, e !== null && e !== void 0 ? e : {});\n (_callbacksRef_current_onPressOut = (_callbacksRef_current1 = callbacksRef.current).onPressOut) === null || _callbacksRef_current_onPressOut === void 0 ? void 0 : _callbacksRef_current_onPressOut.call(_callbacksRef_current1, e !== null && e !== void 0 ? e : {});\n };\n var useResponderFallback = !isInsideNativeMenu && Boolean(hasRealPressEvents || getIsAndroid() && hasPressEvents);\n useMainThreadPressEvents(events, viewProps, useResponderFallback, debugName);\n if (everEnabled) {\n callbacksRef.current = hasPressEvents ? {\n onPressIn: events.onPressIn,\n onPressOut: events.onPressOut,\n onPress: events.onPress,\n onLongPress: events.onLongPress\n } : {};\n if (hasRealPressEvents && !isInsideNativeMenu) {\n endPress();\n gestureRef.current = null;\n return null;\n }\n if (!gestureRef.current) {\n var { Gesture } = gh.state;\n if (isInsideNativeMenu) {\n var manual = Gesture.Manual().runOnJS(true).manualActivation(true).onTouchesDown(function() {\n beginPress();\n }).onTouchesUp(function() {\n endPress(void 0, true);\n }).onTouchesCancelled(function() {\n endPress();\n }).onFinalize(function() {\n endPress();\n });\n gestureRef.current = manual;\n } else if (!getIsAndroid()) {\n gestureRef.current = Gesture.Manual().runOnJS(true).manualActivation(true).onTouchesDown(function(e) {\n return beginPress(e);\n }).onTouchesUp(function(e) {\n endPress(e, true);\n }).onTouchesCancelled(function(e) {\n return endPress(e);\n }).onFinalize(function() {\n return endPress();\n });\n }\n }\n return gestureRef.current;\n }\n return null;\n }\n useMainThreadPressEvents(events, viewProps, hasPressEvents, debugName);\n return null;\n}\nfunction wrapWithGestureDetector(content, gesture, _stateRef, isHOC, isCompositeComponent, hasRealPressEvents) {\n if (isHOC || isCompositeComponent) {\n return content;\n }\n var gh = getGestureHandler();\n var { GestureDetector } = gh.state;\n if (!GestureDetector || !gesture) {\n return content;\n }\n if (!hasRealPressEvents) {\n return React.createElement(GestureDetector, {\n gesture\n }, content);\n }\n if (isFabric) {\n var claimed = React.cloneElement(content, {\n onStartShouldSetResponder: responderClaim\n });\n return React.createElement(GestureDetector, {\n gesture\n }, claimed);\n }\n return React.createElement(View, {\n collapsable: false,\n style: responderWrapperStyle,\n onStartShouldSetResponder: responderClaim\n }, React.createElement(GestureDetector, {\n gesture\n }, content));\n}\nexport {\n getWebEvents,\n useEvents,\n wrapWithGestureDetector\n};\n//# sourceMappingURL=eventHandling.native.js.map\n"],"mappings":";;;;;;;AAKA,IAAI,WAAW,CAAC,CAAC,WAAW;AAC5B,IAAI;AACJ,IAAI,eAAe,WAAW;CAC5B,IAAI,mBAAmB,KAAK,GAAG;EAC7B,kBAAkB,aAAa,QAAQ,aAAa,KAAK,IAAI,KAAK,IAAI,SAAS,QAAQ;CACzF;CACA,OAAO;AACT;AACA,IAAI;AACJ,IAAI,qBAAqB,WAAW;CAClC,IAAI,yBAAyB,KAAK,GAAG;EACnC,wBAAwB,aAAa,QAAQ,aAAa,KAAK,IAAI,KAAK,IAAI,SAAS,QAAQ,YAAY,aAAa,QAAQ,aAAa,KAAK,IAAI,KAAK,IAAI,SAAS,QAAQ;CAChL;CACA,OAAO;AACT;AACA,IAAI,iBAAiB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UAAU;EACZ,IAAI,UAAU,MAAM,aAAa,SAAS,EACxC,2BAA2B,eAC7B,CAAC;EACD,OAAO,MAAM,cAAc,iBAAiB,EAC1C,QACF,GAAG,OAAO;CACZ;CACA,OAAO,MAAM,cAAc,MAAM;EAC/B,aAAa;EACb,OAAO;EACP,2BAA2B;CAC7B,GAAG,MAAM,cAAc,iBAAiB,EACtC,QACF,GAAG,OAAO,CAAC;AACb"}
|
|
1
|
+
{"version":3,"file":"eventHandling.native.js","names":[],"sources":["esm/eventHandling.native.js"],"sourcesContent":["import { composeEventHandlers } from \"@tamagui/helpers\";\nimport { getGestureHandler } from \"@tamagui/native\";\nimport React, { useRef } from \"react\";\nimport { Platform, View } from \"react-native\";\nimport { useMainThreadPressEvents } from \"./helpers/mainThreadPressEvents\";\nvar isFabric = !!globalThis.nativeFabricUIManager;\nvar isAndroidCache;\nvar getIsAndroid = function() {\n if (isAndroidCache === void 0) {\n isAndroidCache = (Platform === null || Platform === void 0 ? void 0 : Platform.OS) === \"android\";\n }\n return isAndroidCache;\n};\nvar isNativeDesktopCache;\nvar getIsNativeDesktop = function() {\n if (isNativeDesktopCache === void 0) {\n isNativeDesktopCache = (Platform === null || Platform === void 0 ? void 0 : Platform.OS) === \"macos\" || (Platform === null || Platform === void 0 ? void 0 : Platform.OS) === \"windows\";\n }\n return isNativeDesktopCache;\n};\nvar responderClaim = function() {\n return true;\n};\nvar responderWrapperStyle = {\n display: \"contents\"\n};\nfunction getWebEvents() {\n return {};\n}\nfunction useEvents(events, viewProps, stateRef, staticConfig, isHOC, isInsideNativeMenu, debugName, hasRealPressEvents) {\n if (events) {\n if (events.onFocus) {\n viewProps[\"onFocus\"] = events.onFocus;\n }\n if (events.onBlur) {\n viewProps[\"onBlur\"] = events.onBlur;\n }\n if (getIsNativeDesktop()) {\n if (events.onMouseEnter) {\n viewProps[\"onMouseEnter\"] = events.onMouseEnter;\n }\n if (events.onMouseLeave) {\n viewProps[\"onMouseLeave\"] = events.onMouseLeave;\n }\n }\n }\n var hasPressEvents = events === null || events === void 0 ? void 0 : events.onPress;\n var gh = getGestureHandler();\n if (hasPressEvents) {\n stateRef.current.hasHadEvents = true;\n }\n if (hasRealPressEvents) {\n stateRef.current.hasRealPressEvents = true;\n }\n var everEnabled = Boolean(hasPressEvents || stateRef.current.hasHadEvents);\n var isUsingRNGH = gh.isEnabled;\n if (staticConfig.isInput) {\n if (events) {\n var { onPressIn, onPressOut, onPress } = events;\n var inputEvents = {\n onPressIn,\n onPressOut: onPressOut || onPress\n };\n if (onPressOut && onPress) {\n inputEvents.onPressOut = composeEventHandlers(onPress, onPressOut);\n }\n Object.assign(viewProps, inputEvents);\n }\n return null;\n }\n var isCompositeComponent = !isHOC && staticConfig.Component && typeof staticConfig.Component !== \"string\";\n if (isHOC || isCompositeComponent) {\n if (events) {\n var { onPressIn: onPressIn1, onPressOut: onPressOut1, onPress: onPress1, onLongPress, delayLongPress } = events;\n Object.assign(viewProps, {\n onPressIn: onPressIn1,\n onPressOut: onPressOut1,\n onPress: onPress1,\n onLongPress,\n delayLongPress\n });\n }\n return null;\n }\n if (isUsingRNGH) {\n var callbacksRef = useRef(isUsingRNGH ? {} : null);\n var gestureRef = useRef(null);\n var pressActiveRef = useRef(false);\n var beginPress = function(e) {\n var _callbacksRef_current_onPressIn, _callbacksRef_current;\n if (pressActiveRef.current) return;\n pressActiveRef.current = true;\n (_callbacksRef_current_onPressIn = (_callbacksRef_current = callbacksRef.current).onPressIn) === null || _callbacksRef_current_onPressIn === void 0 ? void 0 : _callbacksRef_current_onPressIn.call(_callbacksRef_current, e !== null && e !== void 0 ? e : {});\n };\n var endPress = function(e) {\n var firePress = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;\n var _callbacksRef_current_onPress, _callbacksRef_current, _callbacksRef_current_onPressOut, _callbacksRef_current1;\n if (!pressActiveRef.current) return;\n pressActiveRef.current = false;\n if (firePress) (_callbacksRef_current_onPress = (_callbacksRef_current = callbacksRef.current).onPress) === null || _callbacksRef_current_onPress === void 0 ? void 0 : _callbacksRef_current_onPress.call(_callbacksRef_current, e !== null && e !== void 0 ? e : {});\n (_callbacksRef_current_onPressOut = (_callbacksRef_current1 = callbacksRef.current).onPressOut) === null || _callbacksRef_current_onPressOut === void 0 ? void 0 : _callbacksRef_current_onPressOut.call(_callbacksRef_current1, e !== null && e !== void 0 ? e : {});\n };\n var useResponderFallback = Boolean(hasRealPressEvents || !isInsideNativeMenu && getIsAndroid() && hasPressEvents);\n useMainThreadPressEvents(events, viewProps, useResponderFallback, debugName);\n if (everEnabled) {\n callbacksRef.current = hasPressEvents ? {\n onPressIn: events.onPressIn,\n onPressOut: events.onPressOut,\n onPress: events.onPress,\n onLongPress: events.onLongPress\n } : {};\n if (hasRealPressEvents) {\n endPress();\n gestureRef.current = null;\n return null;\n }\n if (!gestureRef.current) {\n var { Gesture } = gh.state;\n if (isInsideNativeMenu) {\n var manual = Gesture.Manual().runOnJS(true).manualActivation(true).onTouchesDown(function() {\n beginPress();\n }).onTouchesUp(function() {\n endPress(void 0, true);\n }).onTouchesCancelled(function() {\n endPress();\n }).onFinalize(function() {\n endPress();\n });\n gestureRef.current = manual;\n } else if (!getIsAndroid()) {\n gestureRef.current = Gesture.Manual().runOnJS(true).manualActivation(true).onTouchesDown(function(e) {\n return beginPress(e);\n }).onTouchesUp(function(e) {\n endPress(e, true);\n }).onTouchesCancelled(function(e) {\n return endPress(e);\n }).onFinalize(function() {\n return endPress();\n });\n }\n }\n return gestureRef.current;\n }\n return null;\n }\n useMainThreadPressEvents(events, viewProps, hasPressEvents, debugName);\n return null;\n}\nfunction wrapWithGestureDetector(content, gesture, _stateRef, isHOC, isCompositeComponent, hasRealPressEvents) {\n if (isHOC || isCompositeComponent) {\n return content;\n }\n var gh = getGestureHandler();\n var { GestureDetector } = gh.state;\n if (!GestureDetector || !gesture) {\n return content;\n }\n if (!hasRealPressEvents) {\n return React.createElement(GestureDetector, {\n gesture\n }, content);\n }\n if (isFabric) {\n var claimed = React.cloneElement(content, {\n onStartShouldSetResponder: responderClaim\n });\n return React.createElement(GestureDetector, {\n gesture\n }, claimed);\n }\n return React.createElement(View, {\n collapsable: false,\n style: responderWrapperStyle,\n onStartShouldSetResponder: responderClaim\n }, React.createElement(GestureDetector, {\n gesture\n }, content));\n}\nexport {\n getWebEvents,\n useEvents,\n wrapWithGestureDetector\n};\n//# sourceMappingURL=eventHandling.native.js.map\n"],"mappings":";;;;;;;AAKA,IAAI,WAAW,CAAC,CAAC,WAAW;AAC5B,IAAI;AACJ,IAAI,eAAe,WAAW;CAC5B,IAAI,mBAAmB,KAAK,GAAG;EAC7B,kBAAkB,aAAa,QAAQ,aAAa,KAAK,IAAI,KAAK,IAAI,SAAS,QAAQ;CACzF;CACA,OAAO;AACT;AACA,IAAI;AACJ,IAAI,qBAAqB,WAAW;CAClC,IAAI,yBAAyB,KAAK,GAAG;EACnC,wBAAwB,aAAa,QAAQ,aAAa,KAAK,IAAI,KAAK,IAAI,SAAS,QAAQ,YAAY,aAAa,QAAQ,aAAa,KAAK,IAAI,KAAK,IAAI,SAAS,QAAQ;CAChL;CACA,OAAO;AACT;AACA,IAAI,iBAAiB,WAAW;CAC9B,OAAO;AACT;AACA,IAAI,wBAAwB,EAC1B,SAAS,WACX;AACA,SAAS,eAAe;CACtB,OAAO,CAAC;AACV;AACA,SAAS,UAAU,QAAQ,WAAW,UAAU,cAAc,OAAO,oBAAoB,WAAW,oBAAoB;CACtH,IAAI,QAAQ;EACV,IAAI,OAAO,SAAS;GAClB,UAAU,aAAa,OAAO;EAChC;EACA,IAAI,OAAO,QAAQ;GACjB,UAAU,YAAY,OAAO;EAC/B;EACA,IAAI,mBAAmB,GAAG;GACxB,IAAI,OAAO,cAAc;IACvB,UAAU,kBAAkB,OAAO;GACrC;GACA,IAAI,OAAO,cAAc;IACvB,UAAU,kBAAkB,OAAO;GACrC;EACF;CACF;CACA,IAAI,iBAAiB,WAAW,QAAQ,WAAW,KAAK,IAAI,KAAK,IAAI,OAAO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,CAAC,iBAAiB,IAAI,CAAC,CAAC,cAAc,SAAS,GAAG;MACnG,OAAO,WAAW,CAAC;KACrB,CAAC,CAAC,CAAC,YAAY,SAAS,GAAG;MACzB,SAAS,GAAG,IAAI;KAClB,CAAC,CAAC,CAAC,mBAAmB,SAAS,GAAG;MAChC,OAAO,SAAS,CAAC;KACnB,CAAC,CAAC,CAAC,WAAW,WAAW;MACvB,OAAO,SAAS;KAClB,CAAC;IACH;GACF;GACA,OAAO,WAAW;EACpB;EACA,OAAO;CACT;CACA,yBAAyB,QAAQ,WAAW,gBAAgB,SAAS;CACrE,OAAO;AACT;AACA,SAAS,wBAAwB,SAAS,SAAS,WAAW,OAAO,sBAAsB,oBAAoB;CAC7G,IAAI,SAAS,sBAAsB;EACjC,OAAO;CACT;CACA,IAAI,KAAK,kBAAkB;CAC3B,IAAI,EAAE,oBAAoB,GAAG;CAC7B,IAAI,CAAC,mBAAmB,CAAC,SAAS;EAChC,OAAO;CACT;CACA,IAAI,CAAC,oBAAoB;EACvB,OAAO,MAAM,cAAc,iBAAiB,EAC1C,QACF,GAAG,OAAO;CACZ;CACA,IAAI,UAAU;EACZ,IAAI,UAAU,MAAM,aAAa,SAAS,EACxC,2BAA2B,eAC7B,CAAC;EACD,OAAO,MAAM,cAAc,iBAAiB,EAC1C,QACF,GAAG,OAAO;CACZ;CACA,OAAO,MAAM,cAAc,MAAM;EAC/B,aAAa;EACb,OAAO;EACP,2BAA2B;CAC7B,GAAG,MAAM,cAAc,iBAAiB,EACtC,QACF,GAAG,OAAO,CAAC;AACb"}
|
|
@@ -150,6 +150,27 @@ const webInlineRenames = {
|
|
|
150
150
|
start: "insetInlineStart",
|
|
151
151
|
end: "insetInlineEnd"
|
|
152
152
|
};
|
|
153
|
+
const paddingLogicals = ["paddingStart", "paddingEnd"];
|
|
154
|
+
const marginLogicals = ["marginStart", "marginEnd"];
|
|
155
|
+
const nativeShorthandLogicals = {
|
|
156
|
+
padding: paddingLogicals,
|
|
157
|
+
paddingHorizontal: paddingLogicals,
|
|
158
|
+
margin: marginLogicals,
|
|
159
|
+
marginHorizontal: marginLogicals,
|
|
160
|
+
borderRadius: [
|
|
161
|
+
"borderTopStartRadius",
|
|
162
|
+
"borderTopEndRadius",
|
|
163
|
+
"borderBottomStartRadius",
|
|
164
|
+
"borderBottomEndRadius",
|
|
165
|
+
"borderStartStartRadius",
|
|
166
|
+
"borderStartEndRadius",
|
|
167
|
+
"borderEndStartRadius",
|
|
168
|
+
"borderEndEndRadius"
|
|
169
|
+
],
|
|
170
|
+
borderWidth: ["borderStartWidth", "borderEndWidth"],
|
|
171
|
+
borderColor: ["borderStartColor", "borderEndColor"],
|
|
172
|
+
gap: ["rowGap", "columnGap"]
|
|
173
|
+
};
|
|
153
174
|
|
|
154
|
-
export { expandStyle };
|
|
175
|
+
export { expandStyle, nativeShorthandLogicals };
|
|
155
176
|
//# sourceMappingURL=expandStyle.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expandStyle.js","names":[],"sources":["esm/helpers/expandStyle.js"],"sourcesContent":["import { isWeb } from \"@tamagui/constants\";\nimport { getStyleCompat } from \"../config\";\n\nconst neg1Flex = [\n\t[\"flexGrow\", 0],\n\t[\"flexShrink\", 1],\n\t[\"flexBasis\", \"auto\"]\n];\nfunction expandFlex(value, compat) {\n\tif (typeof value === \"string\") return [[\"flex\", value]];\n\tif (typeof value !== \"number\") return;\n\tif (value === -1) return neg1Flex;\n\tswitch (compat) {\n\t\tcase \"legacy\": return [\n\t\t\t[\"flexGrow\", value],\n\t\t\t[\"flexShrink\", 1],\n\t\t\t[\"flexBasis\", \"auto\"]\n\t\t];\n\t\tcase \"react-native\":\n\t\t\tif (value > 0) return [\n\t\t\t\t[\"flexGrow\", value],\n\t\t\t\t[\"flexShrink\", 0],\n\t\t\t\t[\"flexBasis\", 0]\n\t\t\t];\n\t\t\tif (value === 0) return [\n\t\t\t\t[\"flexGrow\", 0],\n\t\t\t\t[\"flexShrink\", 0],\n\t\t\t\t[\"flexBasis\", \"auto\"]\n\t\t\t];\n\t\t\treturn [\n\t\t\t\t[\"flexGrow\", 0],\n\t\t\t\t[\"flexShrink\", -value],\n\t\t\t\t[\"flexBasis\", \"auto\"]\n\t\t\t];\n\t\tcase \"web\":\n\t\t\tif (value < 0) return [[\"flex\", value]];\n\t\t\treturn [\n\t\t\t\t[\"flexGrow\", value],\n\t\t\t\t[\"flexShrink\", 1],\n\t\t\t\t[\"flexBasis\", 0]\n\t\t\t];\n\t}\n}\nfunction expandStyle(key, value, styleCompat = getStyleCompat()) {\n\tif (key === \"flex\") return expandFlex(value, styleCompat);\n\tswitch (key) {\n\t\tcase \"writingDirection\": return [[\"direction\", value]];\n\t\tcase \"backdropFilter\": return [[\"backdropFilter\", value], [\"WebkitBackdropFilter\", value]];\n\t}\n\tif (key in webInlineRenames) return [[webInlineRenames[key], value]];\n\tif (key in universalExpansions) return universalExpansions[key].map((k) => [k, value]);\n\tif (key in EXPANSIONS) return EXPANSIONS[key].map((k) => [k, value]);\n}\nconst all = [\n\t\"Top\",\n\t\"Right\",\n\t\"Bottom\",\n\t\"Left\"\n];\nconst horiz = [\"Right\", \"Left\"];\nconst vert = [\"Top\", \"Bottom\"];\nconst xy = [\"X\", \"Y\"];\nconst EXPANSIONS = {\n\tborderColor: [\n\t\t\"TopColor\",\n\t\t\"RightColor\",\n\t\t\"BottomColor\",\n\t\t\"LeftColor\"\n\t],\n\tborderRadius: [\n\t\t\"TopLeftRadius\",\n\t\t\"TopRightRadius\",\n\t\t\"BottomRightRadius\",\n\t\t\"BottomLeftRadius\"\n\t],\n\tborderWidth: [\n\t\t\"TopWidth\",\n\t\t\"RightWidth\",\n\t\t\"BottomWidth\",\n\t\t\"LeftWidth\"\n\t],\n\tmargin: all,\n\tmarginHorizontal: horiz,\n\tmarginVertical: vert,\n\tpadding: all,\n\tpaddingHorizontal: horiz,\n\tpaddingVertical: vert,\n\t...isWeb && {\n\t\tborderStyle: [\n\t\t\t\"TopStyle\",\n\t\t\t\"RightStyle\",\n\t\t\t\"BottomStyle\",\n\t\t\t\"LeftStyle\"\n\t\t],\n\t\toverflow: xy,\n\t\toverscrollBehavior: xy\n\t}\n};\nfor (const parent in EXPANSIONS) {\n\tconst prefix = parent.slice(0, /[A-Z]/.exec(parent)?.index ?? parent.length);\n\tEXPANSIONS[parent] = EXPANSIONS[parent].map((k) => `${prefix}${k}`);\n}\nconst universalExpansions = {\n\tinset: [\n\t\t\"top\",\n\t\t\"right\",\n\t\t\"bottom\",\n\t\t\"left\"\n\t],\n\tinsetBlock: [\"top\", \"bottom\"],\n\tinsetBlockStart: [\"top\"],\n\tinsetBlockEnd: [\"bottom\"],\n\tmarginBlock: [\"marginTop\", \"marginBottom\"],\n\tmarginBlockStart: [\"marginTop\"],\n\tmarginBlockEnd: [\"marginBottom\"],\n\tpaddingBlock: [\"paddingTop\", \"paddingBottom\"],\n\tpaddingBlockStart: [\"paddingTop\"],\n\tpaddingBlockEnd: [\"paddingBottom\"],\n\tborderBlockColor: [\"borderTopColor\", \"borderBottomColor\"],\n\tborderBlockWidth: [\"borderTopWidth\", \"borderBottomWidth\"],\n\tborderBlockStyle: [\"borderTopStyle\", \"borderBottomStyle\"],\n\tborderBlockStartColor: [\"borderTopColor\"],\n\tborderBlockEndColor: [\"borderBottomColor\"],\n\tborderBlockStartWidth: [\"borderTopWidth\"],\n\tborderBlockEndWidth: [\"borderBottomWidth\"],\n\tborderBlockStartStyle: [\"borderTopStyle\"],\n\tborderBlockEndStyle: [\"borderBottomStyle\"],\n\tminBlockSize: [\"minHeight\"],\n\tmaxBlockSize: [\"maxHeight\"],\n\tminInlineSize: [\"minWidth\"],\n\tmaxInlineSize: [\"maxWidth\"],\n\tblockSize: [\"height\"],\n\tinlineSize: [\"width\"]\n};\nconst webInlineRenames = {\n\tpaddingStart: \"paddingInlineStart\",\n\tpaddingEnd: \"paddingInlineEnd\",\n\tmarginStart: \"marginInlineStart\",\n\tmarginEnd: \"marginInlineEnd\",\n\tborderStartWidth: \"borderInlineStartWidth\",\n\tborderEndWidth: \"borderInlineEndWidth\",\n\tborderStartColor: \"borderInlineStartColor\",\n\tborderEndColor: \"borderInlineEndColor\",\n\tborderStartStyle: \"borderInlineStartStyle\",\n\tborderEndStyle: \"borderInlineEndStyle\",\n\tborderTopStartRadius: \"borderStartStartRadius\",\n\tborderTopEndRadius: \"borderStartEndRadius\",\n\tborderBottomStartRadius: \"borderEndStartRadius\",\n\tborderBottomEndRadius: \"borderEndEndRadius\",\n\tstart: \"insetInlineStart\",\n\tend: \"insetInlineEnd\"\n};\n\nexport { expandStyle };"],"mappings":";;;;AAGA,MAAM,WAAW;CAChB,CAAC,YAAY,CAAC;CACd,CAAC,cAAc,CAAC;CAChB,CAAC,aAAa,MAAM;AACrB;AACA,SAAS,WAAW,OAAO,QAAQ;CAClC,IAAI,OAAO,UAAU,UAAU,OAAO,CAAC,CAAC,QAAQ,KAAK,CAAC;CACtD,IAAI,OAAO,UAAU,UAAU;CAC/B,IAAI,UAAU,CAAC,GAAG,OAAO;CACzB,QAAQ,QAAR;EACC,KAAK,UAAU,OAAO;GACrB,CAAC,YAAY,KAAK;GAClB,CAAC,cAAc,CAAC;GAChB,CAAC,aAAa,MAAM;EACrB;EACA,KAAK;GACJ,IAAI,QAAQ,GAAG,OAAO;IACrB,CAAC,YAAY,KAAK;IAClB,CAAC,cAAc,CAAC;IAChB,CAAC,aAAa,CAAC;GAChB;GACA,IAAI,UAAU,GAAG,OAAO;IACvB,CAAC,YAAY,CAAC;IACd,CAAC,cAAc,CAAC;IAChB,CAAC,aAAa,MAAM;GACrB;GACA,OAAO;IACN,CAAC,YAAY,CAAC;IACd,CAAC,cAAc,CAAC,KAAK;IACrB,CAAC,aAAa,MAAM;GACrB;EACD,KAAK;GACJ,IAAI,QAAQ,GAAG,OAAO,CAAC,CAAC,QAAQ,KAAK,CAAC;GACtC,OAAO;IACN,CAAC,YAAY,KAAK;IAClB,CAAC,cAAc,CAAC;IAChB,CA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CACD;CACA,YAAY,CAAC,OAAO,QAAQ;CAC5B,iBAAiB,CAAC,KAAK;CACvB,eAAe,CAAC,QAAQ;CACxB,aAAa,CAAC,aAAa,cAAc;CACzC,kBAAkB,CAAC,WAAW;CAC9B,gBAAgB,CAAC,cAAc;CAC/B,cAAc,CAAC,cAAc,eAAe;CAC5C,mBAAmB,CAAC,YAAY;CAChC,iBAAiB,CAAC,eAAe;CACjC,kBAAkB,CAAC,kBAAkB,mBAAmB;CACxD,kBAAkB,CAAC,kBAAkB,mBAAmB;CACxD,kBAAkB,CAAC,kBAAkB,mBAAmB;CACxD,uBAAuB,CAAC,gBAAgB;CACxC,qBAAqB,CAAC,mBAAmB;CACzC,uBAAuB,CAAC,gBAAgB;CACxC,qBAAqB,CAAC,mBAAmB;CACzC,uBAAuB,CAAC,gBAAgB;CACxC,qBAAqB,CAAC,mBAAmB;CACzC,cAAc,CAAC,WAAW;CAC1B,cAAc,CAAC,WAAW;CAC1B,eAAe,CAAC,UAAU;CAC1B,eAAe,CAAC,UAAU;CAC1B,WAAW,CAAC,QAAQ;CACpB,YAAY,CAAC,OAAO;AACrB;AACA,MAAM,mBAAmB;CACxB,cAAc;CACd,YAAY;CACZ,aAAa;CACb,WAAW;CACX,kBAAkB;CAClB,gBAAgB;CAChB,kBAAkB;CAClB,gBAAgB;CAChB,kBAAkB;CAClB,gBAAgB;CAChB,sBAAsB;CACtB,oBAAoB;CACpB,yBAAyB;CACzB,uBAAuB;CACvB,OAAO;CACP,KAAK;AACN"}
|
|
1
|
+
{"version":3,"file":"expandStyle.js","names":[],"sources":["esm/helpers/expandStyle.js"],"sourcesContent":["import { isWeb } from \"@tamagui/constants\";\nimport { getStyleCompat } from \"../config\";\n\nconst neg1Flex = [\n\t[\"flexGrow\", 0],\n\t[\"flexShrink\", 1],\n\t[\"flexBasis\", \"auto\"]\n];\nfunction expandFlex(value, compat) {\n\tif (typeof value === \"string\") return [[\"flex\", value]];\n\tif (typeof value !== \"number\") return;\n\tif (value === -1) return neg1Flex;\n\tswitch (compat) {\n\t\tcase \"legacy\": return [\n\t\t\t[\"flexGrow\", value],\n\t\t\t[\"flexShrink\", 1],\n\t\t\t[\"flexBasis\", \"auto\"]\n\t\t];\n\t\tcase \"react-native\":\n\t\t\tif (value > 0) return [\n\t\t\t\t[\"flexGrow\", value],\n\t\t\t\t[\"flexShrink\", 0],\n\t\t\t\t[\"flexBasis\", 0]\n\t\t\t];\n\t\t\tif (value === 0) return [\n\t\t\t\t[\"flexGrow\", 0],\n\t\t\t\t[\"flexShrink\", 0],\n\t\t\t\t[\"flexBasis\", \"auto\"]\n\t\t\t];\n\t\t\treturn [\n\t\t\t\t[\"flexGrow\", 0],\n\t\t\t\t[\"flexShrink\", -value],\n\t\t\t\t[\"flexBasis\", \"auto\"]\n\t\t\t];\n\t\tcase \"web\":\n\t\t\tif (value < 0) return [[\"flex\", value]];\n\t\t\treturn [\n\t\t\t\t[\"flexGrow\", value],\n\t\t\t\t[\"flexShrink\", 1],\n\t\t\t\t[\"flexBasis\", 0]\n\t\t\t];\n\t}\n}\nfunction expandStyle(key, value, styleCompat = getStyleCompat()) {\n\tif (key === \"flex\") return expandFlex(value, styleCompat);\n\tswitch (key) {\n\t\tcase \"writingDirection\": return [[\"direction\", value]];\n\t\tcase \"backdropFilter\": return [[\"backdropFilter\", value], [\"WebkitBackdropFilter\", value]];\n\t}\n\tif (key in webInlineRenames) return [[webInlineRenames[key], value]];\n\tif (key in universalExpansions) return universalExpansions[key].map((k) => [k, value]);\n\tif (key in EXPANSIONS) return EXPANSIONS[key].map((k) => [k, value]);\n}\nconst all = [\n\t\"Top\",\n\t\"Right\",\n\t\"Bottom\",\n\t\"Left\"\n];\nconst horiz = [\"Right\", \"Left\"];\nconst vert = [\"Top\", \"Bottom\"];\nconst xy = [\"X\", \"Y\"];\nconst EXPANSIONS = {\n\tborderColor: [\n\t\t\"TopColor\",\n\t\t\"RightColor\",\n\t\t\"BottomColor\",\n\t\t\"LeftColor\"\n\t],\n\tborderRadius: [\n\t\t\"TopLeftRadius\",\n\t\t\"TopRightRadius\",\n\t\t\"BottomRightRadius\",\n\t\t\"BottomLeftRadius\"\n\t],\n\tborderWidth: [\n\t\t\"TopWidth\",\n\t\t\"RightWidth\",\n\t\t\"BottomWidth\",\n\t\t\"LeftWidth\"\n\t],\n\tmargin: all,\n\tmarginHorizontal: horiz,\n\tmarginVertical: vert,\n\tpadding: all,\n\tpaddingHorizontal: horiz,\n\tpaddingVertical: vert,\n\t...isWeb && {\n\t\tborderStyle: [\n\t\t\t\"TopStyle\",\n\t\t\t\"RightStyle\",\n\t\t\t\"BottomStyle\",\n\t\t\t\"LeftStyle\"\n\t\t],\n\t\toverflow: xy,\n\t\toverscrollBehavior: xy\n\t}\n};\nfor (const parent in EXPANSIONS) {\n\tconst prefix = parent.slice(0, /[A-Z]/.exec(parent)?.index ?? parent.length);\n\tEXPANSIONS[parent] = EXPANSIONS[parent].map((k) => `${prefix}${k}`);\n}\nconst universalExpansions = {\n\tinset: [\n\t\t\"top\",\n\t\t\"right\",\n\t\t\"bottom\",\n\t\t\"left\"\n\t],\n\tinsetBlock: [\"top\", \"bottom\"],\n\tinsetBlockStart: [\"top\"],\n\tinsetBlockEnd: [\"bottom\"],\n\tmarginBlock: [\"marginTop\", \"marginBottom\"],\n\tmarginBlockStart: [\"marginTop\"],\n\tmarginBlockEnd: [\"marginBottom\"],\n\tpaddingBlock: [\"paddingTop\", \"paddingBottom\"],\n\tpaddingBlockStart: [\"paddingTop\"],\n\tpaddingBlockEnd: [\"paddingBottom\"],\n\tborderBlockColor: [\"borderTopColor\", \"borderBottomColor\"],\n\tborderBlockWidth: [\"borderTopWidth\", \"borderBottomWidth\"],\n\tborderBlockStyle: [\"borderTopStyle\", \"borderBottomStyle\"],\n\tborderBlockStartColor: [\"borderTopColor\"],\n\tborderBlockEndColor: [\"borderBottomColor\"],\n\tborderBlockStartWidth: [\"borderTopWidth\"],\n\tborderBlockEndWidth: [\"borderBottomWidth\"],\n\tborderBlockStartStyle: [\"borderTopStyle\"],\n\tborderBlockEndStyle: [\"borderBottomStyle\"],\n\tminBlockSize: [\"minHeight\"],\n\tmaxBlockSize: [\"maxHeight\"],\n\tminInlineSize: [\"minWidth\"],\n\tmaxInlineSize: [\"maxWidth\"],\n\tblockSize: [\"height\"],\n\tinlineSize: [\"width\"]\n};\nconst webInlineRenames = {\n\tpaddingStart: \"paddingInlineStart\",\n\tpaddingEnd: \"paddingInlineEnd\",\n\tmarginStart: \"marginInlineStart\",\n\tmarginEnd: \"marginInlineEnd\",\n\tborderStartWidth: \"borderInlineStartWidth\",\n\tborderEndWidth: \"borderInlineEndWidth\",\n\tborderStartColor: \"borderInlineStartColor\",\n\tborderEndColor: \"borderInlineEndColor\",\n\tborderStartStyle: \"borderInlineStartStyle\",\n\tborderEndStyle: \"borderInlineEndStyle\",\n\tborderTopStartRadius: \"borderStartStartRadius\",\n\tborderTopEndRadius: \"borderStartEndRadius\",\n\tborderBottomStartRadius: \"borderEndStartRadius\",\n\tborderBottomEndRadius: \"borderEndEndRadius\",\n\tstart: \"insetInlineStart\",\n\tend: \"insetInlineEnd\"\n};\nconst paddingLogicals = [\"paddingStart\", \"paddingEnd\"];\nconst marginLogicals = [\"marginStart\", \"marginEnd\"];\nconst nativeShorthandLogicals = {\n\tpadding: paddingLogicals,\n\tpaddingHorizontal: paddingLogicals,\n\tmargin: marginLogicals,\n\tmarginHorizontal: marginLogicals,\n\tborderRadius: [\n\t\t\"borderTopStartRadius\",\n\t\t\"borderTopEndRadius\",\n\t\t\"borderBottomStartRadius\",\n\t\t\"borderBottomEndRadius\",\n\t\t\"borderStartStartRadius\",\n\t\t\"borderStartEndRadius\",\n\t\t\"borderEndStartRadius\",\n\t\t\"borderEndEndRadius\"\n\t],\n\tborderWidth: [\"borderStartWidth\", \"borderEndWidth\"],\n\tborderColor: [\"borderStartColor\", \"borderEndColor\"],\n\tgap: [\"rowGap\", \"columnGap\"]\n};\n\nexport { expandStyle, nativeShorthandL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,uBAAuB,CAAC,gBAAgB;CACxC,qBAAqB,CAAC,mBAAmB;CACzC,uBAAuB,CAAC,gBAAgB;CACxC,qBAAqB,CAAC,mBAAmB;CACzC,uBAAuB,CAAC,gBAAgB;CACxC,qBAAqB,CAAC,mBAAmB;CACzC,cAAc,CAAC,WAAW;CAC1B,cAAc,CAAC,WAAW;CAC1B,eAAe,CAAC,UAAU;CAC1B,eAAe,CAAC,UAAU;CAC1B,WAAW,CAAC,QAAQ;CACpB,YAAY,CAAC,OAAO;AACrB;AACA,MAAM,mBAAmB;CACxB,cAAc;CACd,YAAY;CACZ,aAAa;CACb,WAAW;CACX,kBAAkB;CAClB,gBAAgB;CAChB,kBAAkB;CAClB,gBAAgB;CAChB,kBAAkB;CAClB,gBAAgB;CAChB,sBAAsB;CACtB,oBAAoB;CACpB,yBAAyB;CACzB,uBAAuB;CACvB,OAAO;CACP,KAAK;AACN;AACA,MAAM,kBAAkB,CAAC,gBAAgB,YAAY;AACrD,MAAM,iBAAiB,CAAC,eAAe,WAAW;AAClD,MAAM,0BAA0B;CAC/B,SAAS;CACT,mBAAmB;CACnB,QAAQ;CACR,kBAAkB;CAClB,cAAc;EACb;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD;CACA,aAAa,CAAC,oBAAoB,gBAAgB;CAClD,aAAa,CAAC,oBAAoB,gBAAgB;CAClD,KAAK,CAAC,UAAU,WAAW;AAC5B"}
|
|
@@ -171,6 +171,27 @@ var nativeInlineExpansions = {
|
|
|
171
171
|
insetInlineStart: ["left"],
|
|
172
172
|
insetInlineEnd: ["right"]
|
|
173
173
|
};
|
|
174
|
+
var paddingLogicals = ["paddingStart", "paddingEnd"];
|
|
175
|
+
var marginLogicals = ["marginStart", "marginEnd"];
|
|
176
|
+
var nativeShorthandLogicals = {
|
|
177
|
+
padding: paddingLogicals,
|
|
178
|
+
paddingHorizontal: paddingLogicals,
|
|
179
|
+
margin: marginLogicals,
|
|
180
|
+
marginHorizontal: marginLogicals,
|
|
181
|
+
borderRadius: [
|
|
182
|
+
"borderTopStartRadius",
|
|
183
|
+
"borderTopEndRadius",
|
|
184
|
+
"borderBottomStartRadius",
|
|
185
|
+
"borderBottomEndRadius",
|
|
186
|
+
"borderStartStartRadius",
|
|
187
|
+
"borderStartEndRadius",
|
|
188
|
+
"borderEndStartRadius",
|
|
189
|
+
"borderEndEndRadius"
|
|
190
|
+
],
|
|
191
|
+
borderWidth: ["borderStartWidth", "borderEndWidth"],
|
|
192
|
+
borderColor: ["borderStartColor", "borderEndColor"],
|
|
193
|
+
gap: ["rowGap", "columnGap"]
|
|
194
|
+
};
|
|
174
195
|
|
|
175
|
-
export { expandStyle };
|
|
196
|
+
export { expandStyle, nativeShorthandLogicals };
|
|
176
197
|
//# sourceMappingURL=expandStyle.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expandStyle.native.js","names":[],"sources":["esm/helpers/expandStyle.native.js"],"sourcesContent":["import { isWeb } from \"@tamagui/constants\";\nimport { getStyleCompat } from \"../config\";\nimport { splitComponents } from \"./borderComponents\";\nimport { parseBorderShorthand } from \"./parseBorderShorthand\";\nimport { parseOutlineShorthand } from \"./parseOutlineShorthand\";\n\nvar _loop = function(parent2) {\n\tvar _exec;\n\tvar _exec_index;\n\tvar prefix = parent2.slice(0, (_exec_index = (_exec = /[A-Z]/.exec(parent2)) === null || _exec === void 0 ? void 0 : _exec.index) !== null && _exec_index !== void 0 ? _exec_index : parent2.length);\n\tEXPANSIONS[parent2] = EXPANSIONS[parent2].map(function(k) {\n\t\treturn `${prefix}${k}`;\n\t});\n};\nfunction expandStyle(key, value) {\n\targuments.length > 2 && arguments[2] !== void 0 ? arguments[2] : getStyleCompat();\n\tswitch (key) {\n\t\tcase \"objectFit\": return [[\"resizeMode\", resizeModeMap[value] || \"cover\"]];\n\t\tcase \"verticalAlign\": return [[\"textAlignVertical\", verticalAlignMap[value] || \"auto\"]];\n\t\tcase \"direction\": return [[\"direction\", value], [\"writingDirection\", directionMap[value] || \"auto\"]];\n\t\tcase \"gap\":\n\t\t\tif (typeof value === \"string\") {\n\t\t\t\tvar parts = splitComponents(value);\n\t\t\t\tif (parts.length === 2) return [[\"rowGap\", parts[0]], [\"columnGap\", parts[1]]];\n\t\t\t}\n\t\t\treturn;\n\t\tcase \"position\":\n\t\t\tif (value === \"fixed\" || value === \"sticky\") return [[\"position\", \"absolute\"]];\n\t\t\treturn;\n\t\tcase \"visibility\":\n\t\t\tif (value === \"hidden\") return [[\"opacity\", 0], [\"pointerEvents\", \"none\"]];\n\t\t\treturn [];\n\t\tcase \"backgroundImage\":\n\t\t\tif (typeof value === \"string\") return;\n\t\t\treturn [[\"experimental_backgroundImage\", value]];\n\t\tcase \"border\":\n\t\t\tif (typeof value === \"string\") {\n\t\t\t\tvar parsed = parseBorderShorthand(value);\n\t\t\t\tif (parsed) return parsed;\n\t\t\t}\n\t\t\treturn;\n\t\tcase \"outline\":\n\t\t\tif (typeof value === \"string\") {\n\t\t\t\tvar parsed1 = parseOutlineShorthand(value);\n\t\t\t\tif (parsed1) return parsed1;\n\t\t\t}\n\t\t\treturn;\n\t}\n\tif (key in nativeInlineExpansions) return nativeInlineExpansions[key].map(function(k) {\n\t\treturn [k, value];\n\t});\n\tif (key in universalExpansions) return universalExpansions[key].map(function(k) {\n\t\treturn [k, value];\n\t});\n\tif (key in EXPANSIONS) return EXPANSIONS[key].map(function(k) {\n\t\treturn [k, value];\n\t});\n}\nvar resizeModeMap = {\n\tfill: \"stretch\",\n\tnone: \"center\",\n\t\"scale-down\": \"contain\",\n\tcontain: \"contain\",\n\tcover: \"cover\"\n};\nvar verticalAlignMap = {\n\ttop: \"top\",\n\tmiddle: \"center\",\n\tbottom: \"bottom\",\n\tauto: \"auto\"\n};\nvar directionMap = {\n\tltr: \"ltr\",\n\trtl: \"rtl\",\n\tinherit: \"auto\"\n};\nvar all = [\n\t\"Top\",\n\t\"Right\",\n\t\"Bottom\",\n\t\"Left\"\n];\nvar horiz = [\"Right\", \"Left\"];\nvar vert = [\"Top\", \"Bottom\"];\nvar xy = [\"X\", \"Y\"];\nvar EXPANSIONS = {\n\tborderColor: [\n\t\t\"TopColor\",\n\t\t\"RightColor\",\n\t\t\"BottomColor\",\n\t\t\"LeftColor\"\n\t],\n\tborderRadius: [\n\t\t\"TopLeftRadius\",\n\t\t\"TopRightRadius\",\n\t\t\"BottomRightRadius\",\n\t\t\"BottomLeftRadius\"\n\t],\n\tborderWidth: [\n\t\t\"TopWidth\",\n\t\t\"RightWidth\",\n\t\t\"BottomWidth\",\n\t\t\"LeftWidth\"\n\t],\n\tmargin: all,\n\tmarginHorizontal: horiz,\n\tmarginVertical: vert,\n\tpadding: all,\n\tpaddingHorizontal: horiz,\n\tpaddingVertical: vert,\n\t...isWeb && {\n\t\tborderStyle: [\n\t\t\t\"TopStyle\",\n\t\t\t\"RightStyle\",\n\t\t\t\"BottomStyle\",\n\t\t\t\"LeftStyle\"\n\t\t],\n\t\toverflow: xy,\n\t\toverscrollBehavior: xy\n\t}\n};\nfor (var parent in EXPANSIONS) _loop(parent);\nvar universalExpansions = {\n\tinset: [\n\t\t\"top\",\n\t\t\"right\",\n\t\t\"bottom\",\n\t\t\"left\"\n\t],\n\tinsetBlock: [\"top\", \"bottom\"],\n\tinsetBlockStart: [\"top\"],\n\tinsetBlockEnd: [\"bottom\"],\n\tmarginBlock: [\"marginTop\", \"marginBottom\"],\n\tmarginBlockStart: [\"marginTop\"],\n\tmarginBlockEnd: [\"marginBottom\"],\n\tpaddingBlock: [\"paddingTop\", \"paddingBottom\"],\n\tpaddingBlockStart: [\"paddingTop\"],\n\tpaddingBlockEnd: [\"paddingBottom\"],\n\tborderBlockColor: [\"borderTopColor\", \"borderBottomColor\"],\n\tborderBlockWidth: [\"borderTopWidth\", \"borderBottomWidth\"],\n\tborderBlockStyle: [\"borderTopStyle\", \"borderBottomStyle\"],\n\tborderBlockStartColor: [\"borderTopColor\"],\n\tborderBlockEndColor: [\"borderBottomColor\"],\n\tborderBlockStartWidth: [\"borderTopWidth\"],\n\tborderBlockEndWidth: [\"borderBottomWidth\"],\n\tborderBlockStartStyle: [\"borderTopStyle\"],\n\tborderBlockEndStyle: [\"borderBottomStyle\"],\n\tminBlockSize: [\"minHeight\"],\n\tmaxBlockSize: [\"maxHeight\"],\n\tminInlineSize: [\"minWidth\"],\n\tmaxInlineSize: [\"maxWidth\"],\n\tblockSize: [\"height\"],\n\tinlineSize: [\"width\"]\n};\nvar nativeInlineExpansions = {\n\tborderInlineColor: [\"borderEndColor\", \"borderStartColor\"],\n\tborderInlineWidth: [\"borderEndWidth\", \"borderStartWidth\"],\n\tborderInlineStyle: [\"borderEndStyle\", \"borderStartStyle\"],\n\tborderInlineStartColor: [\"borderStartColor\"],\n\tborderInlineEndColor: [\"borderEndColor\"],\n\tborderInlineStartWidth: [\"borderStartWidth\"],\n\tborderInlineEndWidth: [\"borderEndWidth\"],\n\tborderInlineStartStyle: [\"borderStartStyle\"],\n\tborderInlineEndStyle: [\"borderEndStyle\"],\n\tmarginInline: [\"marginEnd\", \"marginStart\"],\n\tmarginInlineStart: [\"marginStart\"],\n\tmarginInlineEnd: [\"marginEnd\"],\n\tpaddingInline: [\"paddingEnd\", \"paddingStart\"],\n\tpaddingInlineStart: [\"paddingStart\"],\n\tpaddingInlineEnd: [\"paddingEnd\"],\n\tinsetInlineStart: [\"left\"],\n\tinsetInlineEnd: [\"right\"]\n};\n\nexport { expandStyle };"],"mappings":";;;;;;;AAMA,IAAI,QAAQ,SAAS,SAAS;CAC7B,IAAI;CACJ,IAAI;CACJ,IAAI,SAAS,QAAQ,MAAM,IAAI,eAAe,QAAQ,QAAQ,KAAK,OAAO,OAAO,QAAQ,UAAU,KAAK,IAAI,KAAK,IAAI,MAAM,WAAW,QAAQ,gBAAgB,KAAK,IAAI,cAAc,QAAQ,MAAM;CACnM,WAAW,WAAW,WAAW,QAAQ,CAAC,IAAI,SAAS,GAAG;EACzD,OAAO,GAAG,SAAS;CACpB,CAAC;AACF;AAC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AAmB;CACxD,kBAAkB,CAAC,kBAAkB,mBAAmB;CACxD,uBAAuB,CAAC,gBAAgB;CACxC,qBAAqB,CAAC,mBAAmB;CACzC,uBAAuB,CAAC,gBAAgB;CACxC,qBAAqB,CAAC,mBAAmB;CACzC,uBAAuB,CAAC,gBAAgB;CACxC,qBAAqB,CAAC,mBAAmB;CACzC,cAAc,CAAC,WAAW;CAC1B,cAAc,CAAC,WAAW;CAC1B,eAAe,CAAC,UAAU;CAC1B,eAAe,CAAC,UAAU;CAC1B,WAAW,CAAC,QAAQ;CACpB,YAAY,CAAC,OAAO;AACrB;AACA,IAAI,yBAAyB;CAC5B,mBAAmB,CAAC,kBAAkB,kBAAkB;CACxD,mBAAmB,CAAC,kBAAkB,kBAAkB;CACxD,mBAAmB,CAAC,kBAAkB,kBAAkB;CACxD,wBAAwB,CAAC,kBAAkB;CAC3C,sBAAsB,CAAC,gBAAgB;CACvC,wBAAwB,CAAC,kBAAkB;CAC3C,sBAAsB,CAAC,gBAAgB;CACvC,wBAAwB,CAAC,kBAAkB;CAC3C,sBAAsB,CAAC,gBAAgB;CACvC,cAAc,CAAC,aAAa,aAAa;CACzC,mBAAmB,CAAC,aAAa;CACjC,iBAAiB,CAAC,WAAW;CAC7B,eAAe,CAAC,cAAc,cAAc;CAC5C,oBAAoB,CAAC,cAAc;CACnC,kBAAkB,CAAC,YAAY;CAC/B,kBAAkB,CAAC,MAAM;CACzB,gBAAgB,CAAC,OAAO;AACzB"}
|
|
1
|
+
{"version":3,"file":"expandStyle.native.js","names":[],"sources":["esm/helpers/expandStyle.native.js"],"sourcesContent":["import { isWeb } from \"@tamagui/constants\";\nimport { getStyleCompat } from \"../config\";\nimport { splitComponents } from \"./borderComponents\";\nimport { parseBorderShorthand } from \"./parseBorderShorthand\";\nimport { parseOutlineShorthand } from \"./parseOutlineShorthand\";\n\nvar _loop = function(parent2) {\n\tvar _exec;\n\tvar _exec_index;\n\tvar prefix = parent2.slice(0, (_exec_index = (_exec = /[A-Z]/.exec(parent2)) === null || _exec === void 0 ? void 0 : _exec.index) !== null && _exec_index !== void 0 ? _exec_index : parent2.length);\n\tEXPANSIONS[parent2] = EXPANSIONS[parent2].map(function(k) {\n\t\treturn `${prefix}${k}`;\n\t});\n};\nfunction expandStyle(key, value) {\n\targuments.length > 2 && arguments[2] !== void 0 ? arguments[2] : getStyleCompat();\n\tswitch (key) {\n\t\tcase \"objectFit\": return [[\"resizeMode\", resizeModeMap[value] || \"cover\"]];\n\t\tcase \"verticalAlign\": return [[\"textAlignVertical\", verticalAlignMap[value] || \"auto\"]];\n\t\tcase \"direction\": return [[\"direction\", value], [\"writingDirection\", directionMap[value] || \"auto\"]];\n\t\tcase \"gap\":\n\t\t\tif (typeof value === \"string\") {\n\t\t\t\tvar parts = splitComponents(value);\n\t\t\t\tif (parts.length === 2) return [[\"rowGap\", parts[0]], [\"columnGap\", parts[1]]];\n\t\t\t}\n\t\t\treturn;\n\t\tcase \"position\":\n\t\t\tif (value === \"fixed\" || value === \"sticky\") return [[\"position\", \"absolute\"]];\n\t\t\treturn;\n\t\tcase \"visibility\":\n\t\t\tif (value === \"hidden\") return [[\"opacity\", 0], [\"pointerEvents\", \"none\"]];\n\t\t\treturn [];\n\t\tcase \"backgroundImage\":\n\t\t\tif (typeof value === \"string\") return;\n\t\t\treturn [[\"experimental_backgroundImage\", value]];\n\t\tcase \"border\":\n\t\t\tif (typeof value === \"string\") {\n\t\t\t\tvar parsed = parseBorderShorthand(value);\n\t\t\t\tif (parsed) return parsed;\n\t\t\t}\n\t\t\treturn;\n\t\tcase \"outline\":\n\t\t\tif (typeof value === \"string\") {\n\t\t\t\tvar parsed1 = parseOutlineShorthand(value);\n\t\t\t\tif (parsed1) return parsed1;\n\t\t\t}\n\t\t\treturn;\n\t}\n\tif (key in nativeInlineExpansions) return nativeInlineExpansions[key].map(function(k) {\n\t\treturn [k, value];\n\t});\n\tif (key in universalExpansions) return universalExpansions[key].map(function(k) {\n\t\treturn [k, value];\n\t});\n\tif (key in EXPANSIONS) return EXPANSIONS[key].map(function(k) {\n\t\treturn [k, value];\n\t});\n}\nvar resizeModeMap = {\n\tfill: \"stretch\",\n\tnone: \"center\",\n\t\"scale-down\": \"contain\",\n\tcontain: \"contain\",\n\tcover: \"cover\"\n};\nvar verticalAlignMap = {\n\ttop: \"top\",\n\tmiddle: \"center\",\n\tbottom: \"bottom\",\n\tauto: \"auto\"\n};\nvar directionMap = {\n\tltr: \"ltr\",\n\trtl: \"rtl\",\n\tinherit: \"auto\"\n};\nvar all = [\n\t\"Top\",\n\t\"Right\",\n\t\"Bottom\",\n\t\"Left\"\n];\nvar horiz = [\"Right\", \"Left\"];\nvar vert = [\"Top\", \"Bottom\"];\nvar xy = [\"X\", \"Y\"];\nvar EXPANSIONS = {\n\tborderColor: [\n\t\t\"TopColor\",\n\t\t\"RightColor\",\n\t\t\"BottomColor\",\n\t\t\"LeftColor\"\n\t],\n\tborderRadius: [\n\t\t\"TopLeftRadius\",\n\t\t\"TopRightRadius\",\n\t\t\"BottomRightRadius\",\n\t\t\"BottomLeftRadius\"\n\t],\n\tborderWidth: [\n\t\t\"TopWidth\",\n\t\t\"RightWidth\",\n\t\t\"BottomWidth\",\n\t\t\"LeftWidth\"\n\t],\n\tmargin: all,\n\tmarginHorizontal: horiz,\n\tmarginVertical: vert,\n\tpadding: all,\n\tpaddingHorizontal: horiz,\n\tpaddingVertical: vert,\n\t...isWeb && {\n\t\tborderStyle: [\n\t\t\t\"TopStyle\",\n\t\t\t\"RightStyle\",\n\t\t\t\"BottomStyle\",\n\t\t\t\"LeftStyle\"\n\t\t],\n\t\toverflow: xy,\n\t\toverscrollBehavior: xy\n\t}\n};\nfor (var parent in EXPANSIONS) _loop(parent);\nvar universalExpansions = {\n\tinset: [\n\t\t\"top\",\n\t\t\"right\",\n\t\t\"bottom\",\n\t\t\"left\"\n\t],\n\tinsetBlock: [\"top\", \"bottom\"],\n\tinsetBlockStart: [\"top\"],\n\tinsetBlockEnd: [\"bottom\"],\n\tmarginBlock: [\"marginTop\", \"marginBottom\"],\n\tmarginBlockStart: [\"marginTop\"],\n\tmarginBlockEnd: [\"marginBottom\"],\n\tpaddingBlock: [\"paddingTop\", \"paddingBottom\"],\n\tpaddingBlockStart: [\"paddingTop\"],\n\tpaddingBlockEnd: [\"paddingBottom\"],\n\tborderBlockColor: [\"borderTopColor\", \"borderBottomColor\"],\n\tborderBlockWidth: [\"borderTopWidth\", \"borderBottomWidth\"],\n\tborderBlockStyle: [\"borderTopStyle\", \"borderBottomStyle\"],\n\tborderBlockStartColor: [\"borderTopColor\"],\n\tborderBlockEndColor: [\"borderBottomColor\"],\n\tborderBlockStartWidth: [\"borderTopWidth\"],\n\tborderBlockEndWidth: [\"borderBottomWidth\"],\n\tborderBlockStartStyle: [\"borderTopStyle\"],\n\tborderBlockEndStyle: [\"borderBottomStyle\"],\n\tminBlockSize: [\"minHeight\"],\n\tmaxBlockSize: [\"maxHeight\"],\n\tminInlineSize: [\"minWidth\"],\n\tmaxInlineSize: [\"maxWidth\"],\n\tblockSize: [\"height\"],\n\tinlineSize: [\"width\"]\n};\nvar nativeInlineExpansions = {\n\tborderInlineColor: [\"borderEndColor\", \"borderStartColor\"],\n\tborderInlineWidth: [\"borderEndWidth\", \"borderStartWidth\"],\n\tborderInlineStyle: [\"borderEndStyle\", \"borderStartStyle\"],\n\tborderInlineStartColor: [\"borderStartColor\"],\n\tborderInlineEndColor: [\"borderEndColor\"],\n\tborderInlineStartWidth: [\"borderStartWidth\"],\n\tborderInlineEndWidth: [\"borderEndWidth\"],\n\tborderInlineStartStyle: [\"borderStartStyle\"],\n\tborderInlineEndStyle: [\"borderEndStyle\"],\n\tmarginInline: [\"marginEnd\", \"marginStart\"],\n\tmarginInlineStart: [\"marginStart\"],\n\tmarginInlineEnd: [\"marginEnd\"],\n\tpaddingInline: [\"paddingEnd\", \"paddingStart\"],\n\tpaddingInlineStart: [\"paddingStart\"],\n\tpaddingInlineEnd: [\"paddingEnd\"],\n\tinsetInlineStart: [\"left\"],\n\tinsetInlineEnd: [\"right\"]\n};\nvar paddingLogicals = [\"paddingStart\", \"paddingEnd\"];\nvar marginLogicals = [\"marginStart\", \"marginEnd\"];\nvar nativeShorthandLogicals = {\n\tpadding: paddingLogicals,\n\tpaddingHorizontal: paddingLogicals,\n\tmargin: marginLogicals,\n\tmarginHorizontal: marginLogicals,\n\tborderRadius: [\n\t\t\"borderTopStartRadius\",\n\t\t\"borderTopEndRadius\",\n\t\t\"borderBottomStartRadius\",\n\t\t\"borderBottomEndRadius\",\n\t\t\"borderStartStartRadius\",\n\t\t\"borderStartEndRadius\",\n\t\t\"borderEndStartRadius\",\n\t\t\"borderEndEndRadius\"\n\t],\n\tborderWidth: [\"borderStartWidth\", \"borderEndWidth\"],\n\tborderColor: [\"borderStartColor\", \"borderEndColor\"],\n\tgap: [\"rowGap\", \"columnGap\"]\n};\n\nexport { expandStyle, nativeShorthandLogicals };"],"mappings":";;;;;;;AAMA,IAAI,QAAQ,SAAS,SAAS;CAC7B,IAAI;CACJ,IAAI;CACJ,IAAI,SAAS,QAAQ,MAAM,IAAI,eAAe,QAAQ,QAAQ,KAAK,OAAO,OAAO,QAAQ,UAAU,KAAK,IAAI,KAAK,IAAI,MAAM,WAAW,QAAQ,gBAAgB,KAAK,IAAI,cAAc,QAAQ,MAAM;CACnM,WAAW,WAAW,WAAW,QAAQ,CAAC,IAAI,SAAS,GAAG;EACzD,OAAO,GAAG,SAAS;CACpB,CAAC;AACF;AACA,SAAS,YAAY,KAAK,OAAO;CAChC,UAAU,SAAS,KAAK,UAAU,OAAO,KAAK,IAAI,UAAU,KAAK,eAAe;CAChF,QAAQ,KAAR;EACC,KAAK,aAAa,OAAO,CAAC,CAAC,cAAc,cAAc,UAAU,OAAO,CAAC;EACzE,KAAK,iBAAiB,OAAO,CAAC,CAAC,qBAAqB,iBAAiB,UAAU,MAAM,CAAC;EACtF,KAAK,aAAa,OAAO,CAAC,CAAC,aAAa,KAAK,GAAG,CAAC,oBA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U;CAC1B,WAAW,CAAC,QAAQ;CACpB,YAAY,CAAC,OAAO;AACrB;AACA,IAAI,yBAAyB;CAC5B,mBAAmB,CAAC,kBAAkB,kBAAkB;CACxD,mBAAmB,CAAC,kBAAkB,kBAAkB;CACxD,mBAAmB,CAAC,kBAAkB,kBAAkB;CACxD,wBAAwB,CAAC,kBAAkB;CAC3C,sBAAsB,CAAC,gBAAgB;CACvC,wBAAwB,CAAC,kBAAkB;CAC3C,sBAAsB,CAAC,gBAAgB;CACvC,wBAAwB,CAAC,kBAAkB;CAC3C,sBAAsB,CAAC,gBAAgB;CACvC,cAAc,CAAC,aAAa,aAAa;CACzC,mBAAmB,CAAC,aAAa;CACjC,iBAAiB,CAAC,WAAW;CAC7B,eAAe,CAAC,cAAc,cAAc;CAC5C,oBAAoB,CAAC,cAAc;CACnC,kBAAkB,CAAC,YAAY;CAC/B,kBAAkB,CAAC,MAAM;CACzB,gBAAgB,CAAC,OAAO;AACzB;AACA,IAAI,kBAAkB,CAAC,gBAAgB,YAAY;AACnD,IAAI,iBAAiB,CAAC,eAAe,WAAW;AAChD,IAAI,0BAA0B;CAC7B,SAAS;CACT,mBAAmB;CACnB,QAAQ;CACR,kBAAkB;CAClB,cAAc;EACb;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD;CACA,aAAa,CAAC,oBAAoB,gBAAgB;CAClD,aAAa,CAAC,oBAAoB,gBAAgB;CAClD,KAAK,CAAC,UAAU,WAAW;AAC5B"}
|
|
@@ -8,7 +8,7 @@ import { defaultComponentStateMounted } from "../defaultComponentState.native.js
|
|
|
8
8
|
import { isVariable } from "../createVariable.native.js";
|
|
9
9
|
import { stylePieceSymbol } from "../types.native.js";
|
|
10
10
|
import { addComposition, canGenerateCSS, flushDirectStyles, registerAtomicSlot } from "./getCSSStylesAtomic.native.js";
|
|
11
|
-
import { expandStyle } from "./expandStyle.native.js";
|
|
11
|
+
import { expandStyle, nativeShorthandLogicals } from "./expandStyle.native.js";
|
|
12
12
|
import { classifyBorderComponents, splitComponents, startsValueFunction } from "./borderComponents.native.js";
|
|
13
13
|
import { fixStyles } from "./expandStyles.native.js";
|
|
14
14
|
import { getConfigRevisionState } from "./grammarConfig.native.js";
|
|
@@ -1815,24 +1815,34 @@ function emitValue(state, property, raw, cursor, originalValue, contextOnly) {
|
|
|
1815
1815
|
}
|
|
1816
1816
|
value3 = variants;
|
|
1817
1817
|
}
|
|
1818
|
+
if (!cursor && !state.styleProps.noExpand) {
|
|
1819
|
+
var logicals = nativeShorthandLogicals[property];
|
|
1820
|
+
var slots = state.flatSlots;
|
|
1821
|
+
if (logicals && slots) for (var index1 = 0; index1 < logicals.length; index1++) {
|
|
1822
|
+
var list = slots.get(logicals[index1]);
|
|
1823
|
+
if (!list) continue;
|
|
1824
|
+
for (var entry = list.length; entry--;) if (list[entry][3] === "") list.splice(entry, 1);
|
|
1825
|
+
if (!list.length) clearDirectStyle(state, logicals[index1]);
|
|
1826
|
+
}
|
|
1827
|
+
}
|
|
1818
1828
|
var expanded = !state.styleProps.noExpand ? expandStyle(property, value3, state.conf.settings.styleCompat || "web") : null;
|
|
1819
1829
|
if (!expanded) {
|
|
1820
1830
|
emitProperty(state, property, value3, cursor, originalValue, contextOnly);
|
|
1821
1831
|
return;
|
|
1822
1832
|
}
|
|
1823
|
-
if (typeof raw === "string" && expanded.length > 1 && expanded.every(function(
|
|
1824
|
-
return
|
|
1833
|
+
if (typeof raw === "string" && expanded.length > 1 && expanded.every(function(entry2) {
|
|
1834
|
+
return entry2[1] === expanded[0][1];
|
|
1825
1835
|
})) {
|
|
1826
1836
|
var parts1 = splitComponents(raw);
|
|
1827
1837
|
if (parts1.length > 0 && parts1.length <= (expanded.length === 4 ? 4 : 2)) {
|
|
1828
|
-
for (var
|
|
1829
|
-
var partIndex =
|
|
1830
|
-
emitResolved(state, expanded[
|
|
1838
|
+
for (var index2 = 0; index2 < expanded.length; index2++) {
|
|
1839
|
+
var partIndex = index2 === 0 || parts1.length === 1 ? 0 : index2 === 1 || index2 === 3 && parts1.length < 4 ? 1 : index2 === 2 && parts1.length < 3 ? 0 : index2;
|
|
1840
|
+
emitResolved(state, expanded[index2][0], parts1[partIndex], cursor, originalValue, contextOnly);
|
|
1831
1841
|
}
|
|
1832
1842
|
return;
|
|
1833
1843
|
}
|
|
1834
1844
|
}
|
|
1835
|
-
for (var
|
|
1845
|
+
for (var index3 = 0; index3 < expanded.length; index3++) emitProperty(state, expanded[index3][0], expanded[index3][1], cursor, originalValue, contextOnly);
|
|
1836
1846
|
}
|
|
1837
1847
|
function emitConditionalValue(state, property, payload, condition, source, sink, mode, contextOnly) {
|
|
1838
1848
|
if (sink) sink(payload, condition, source);
|