app-studio 0.7.15 → 0.7.16
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/README.md +1 -1
- package/dist/app-studio.cjs.development.js +44 -5
- package/dist/app-studio.cjs.development.js.map +1 -1
- package/dist/app-studio.cjs.production.min.js +1 -1
- package/dist/app-studio.esm.js +44 -5
- package/dist/app-studio.esm.js.map +1 -1
- package/dist/app-studio.umd.development.js +44 -5
- package/dist/app-studio.umd.development.js.map +1 -1
- package/dist/app-studio.umd.production.min.js +1 -1
- package/dist/element/Element.types.d.ts +8 -0
- package/package.json +1 -1
package/dist/app-studio.esm.js
CHANGED
|
@@ -1696,7 +1696,7 @@ const NumberProps = /*#__PURE__*/new Set(['numberOfLines', 'fontWeight', 'timeSt
|
|
|
1696
1696
|
// Keys to exclude when passing props to the component
|
|
1697
1697
|
const excludedKeys = /*#__PURE__*/new Set([
|
|
1698
1698
|
// Standard styling props
|
|
1699
|
-
'on', 'shadow', 'only', 'media', 'css', 'widthHeight', 'paddingHorizontal', 'paddingVertical', 'marginHorizontal', 'marginVertical', 'animate', 'animateIn', 'animateOut',
|
|
1699
|
+
'on', 'shadow', 'only', 'media', 'css', 'widthHeight', 'paddingHorizontal', 'paddingVertical', 'marginHorizontal', 'marginVertical', 'animate', 'animateIn', 'animateOut', 'theme',
|
|
1700
1700
|
// Underscore-prefixed event props
|
|
1701
1701
|
'_hover', '_active', '_focus', '_visited', '_disabled', '_enabled', '_checked', '_unchecked', '_invalid', '_valid', '_required', '_optional', '_selected', '_target', '_firstChild', '_lastChild', '_onlyChild', '_firstOfType', '_lastOfType', '_empty', '_focusVisible', '_focusWithin', '_placeholder',
|
|
1702
1702
|
// Pseudo-element props
|
|
@@ -3084,6 +3084,28 @@ function useStableStyleMemo(propsToProcess, getColor, mediaQueries, devices, man
|
|
|
3084
3084
|
}
|
|
3085
3085
|
return cacheRef.current.classes;
|
|
3086
3086
|
}
|
|
3087
|
+
const THEME_PREFIX$1 = 'theme-';
|
|
3088
|
+
// Build a getColor that resolves `theme-*` tokens against a component-scoped
|
|
3089
|
+
// theme override before falling back to the global getColor. Tokens not
|
|
3090
|
+
// covered by the override (color-*, light-*, dark-*, theme-* keys not in the
|
|
3091
|
+
// override) pass straight through.
|
|
3092
|
+
function makeScopedGetColor(componentTheme, baseGetColor) {
|
|
3093
|
+
return name => {
|
|
3094
|
+
if (!name || typeof name !== 'string') return String(name);
|
|
3095
|
+
if (!name.startsWith(THEME_PREFIX$1)) return baseGetColor(name);
|
|
3096
|
+
const parts = name.substring(THEME_PREFIX$1.length).split('-');
|
|
3097
|
+
const lastPart = parts[parts.length - 1];
|
|
3098
|
+
const maybeAlpha = parseInt(lastPart, 10);
|
|
3099
|
+
const hasAlpha = parts.length >= 2 && !isNaN(maybeAlpha) && maybeAlpha >= 0 && maybeAlpha <= 1000;
|
|
3100
|
+
const themeKey = hasAlpha ? parts.slice(0, -1).join('-') : parts.join('-');
|
|
3101
|
+
const overrideValue = componentTheme[themeKey];
|
|
3102
|
+
if (typeof overrideValue !== 'string') return baseGetColor(name);
|
|
3103
|
+
const resolved = baseGetColor(overrideValue);
|
|
3104
|
+
if (!hasAlpha) return resolved;
|
|
3105
|
+
const percentage = Math.round(maybeAlpha / 1000 * 100);
|
|
3106
|
+
return `color-mix(in srgb, ${resolved} ${percentage}%, transparent)`;
|
|
3107
|
+
};
|
|
3108
|
+
}
|
|
3087
3109
|
const Element = /*#__PURE__*/React.memo(/*#__PURE__*/forwardRef((_ref, ref) => {
|
|
3088
3110
|
let {
|
|
3089
3111
|
as = 'div',
|
|
@@ -3098,6 +3120,7 @@ const Element = /*#__PURE__*/React.memo(/*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
3098
3120
|
onPress,
|
|
3099
3121
|
blend,
|
|
3100
3122
|
animateOn = 'Both',
|
|
3123
|
+
theme: componentTheme,
|
|
3101
3124
|
...rest
|
|
3102
3125
|
} = props;
|
|
3103
3126
|
const elementRef = useRef(null);
|
|
@@ -3113,6 +3136,17 @@ const Element = /*#__PURE__*/React.memo(/*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
3113
3136
|
getColor,
|
|
3114
3137
|
theme
|
|
3115
3138
|
} = useTheme();
|
|
3139
|
+
// When a component-level `theme` prop is supplied, wrap getColor so
|
|
3140
|
+
// `theme-*` tokens resolve against the override first. Memoize on a
|
|
3141
|
+
// serialized signature so the function identity stays stable across
|
|
3142
|
+
// renders that don't change the override.
|
|
3143
|
+
const componentThemeKey = componentTheme ? Object.entries(componentTheme).map(_ref2 => {
|
|
3144
|
+
let [k, v] = _ref2;
|
|
3145
|
+
return `${k}=${v}`;
|
|
3146
|
+
}).join('|') : '';
|
|
3147
|
+
const scopedGetColor = useMemo(() => componentTheme ? makeScopedGetColor(componentTheme, getColor) : getColor,
|
|
3148
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3149
|
+
[componentThemeKey, getColor]);
|
|
3116
3150
|
const {
|
|
3117
3151
|
trackEvent
|
|
3118
3152
|
} = useAnalytics();
|
|
@@ -3133,8 +3167,8 @@ const Element = /*#__PURE__*/React.memo(/*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
3133
3167
|
setIsVisible(true);
|
|
3134
3168
|
return;
|
|
3135
3169
|
}
|
|
3136
|
-
const observer = new IntersectionObserver(
|
|
3137
|
-
let [entry] =
|
|
3170
|
+
const observer = new IntersectionObserver(_ref3 => {
|
|
3171
|
+
let [entry] = _ref3;
|
|
3138
3172
|
if (entry.isIntersecting) {
|
|
3139
3173
|
setIsVisible(true);
|
|
3140
3174
|
observer.disconnect();
|
|
@@ -3203,8 +3237,13 @@ const Element = /*#__PURE__*/React.memo(/*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
3203
3237
|
return anim;
|
|
3204
3238
|
});
|
|
3205
3239
|
}
|
|
3206
|
-
// Use hash-based memoization for style extraction
|
|
3207
|
-
|
|
3240
|
+
// Use hash-based memoization for style extraction. Mix the component
|
|
3241
|
+
// theme signature into the `theme` argument so the cache invalidates
|
|
3242
|
+
// when an override changes between renders.
|
|
3243
|
+
const utilityClasses = useStableStyleMemo(propsToProcess, scopedGetColor, mediaQueries, devices, manager, componentTheme ? {
|
|
3244
|
+
...theme,
|
|
3245
|
+
__scope: componentThemeKey
|
|
3246
|
+
} : theme);
|
|
3208
3247
|
const newProps = {
|
|
3209
3248
|
ref: setRef
|
|
3210
3249
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-studio.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"app-studio.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1702,7 +1702,7 @@
|
|
|
1702
1702
|
// Keys to exclude when passing props to the component
|
|
1703
1703
|
const excludedKeys = /*#__PURE__*/new Set([
|
|
1704
1704
|
// Standard styling props
|
|
1705
|
-
'on', 'shadow', 'only', 'media', 'css', 'widthHeight', 'paddingHorizontal', 'paddingVertical', 'marginHorizontal', 'marginVertical', 'animate', 'animateIn', 'animateOut',
|
|
1705
|
+
'on', 'shadow', 'only', 'media', 'css', 'widthHeight', 'paddingHorizontal', 'paddingVertical', 'marginHorizontal', 'marginVertical', 'animate', 'animateIn', 'animateOut', 'theme',
|
|
1706
1706
|
// Underscore-prefixed event props
|
|
1707
1707
|
'_hover', '_active', '_focus', '_visited', '_disabled', '_enabled', '_checked', '_unchecked', '_invalid', '_valid', '_required', '_optional', '_selected', '_target', '_firstChild', '_lastChild', '_onlyChild', '_firstOfType', '_lastOfType', '_empty', '_focusVisible', '_focusWithin', '_placeholder',
|
|
1708
1708
|
// Pseudo-element props
|
|
@@ -3090,6 +3090,28 @@
|
|
|
3090
3090
|
}
|
|
3091
3091
|
return cacheRef.current.classes;
|
|
3092
3092
|
}
|
|
3093
|
+
const THEME_PREFIX$1 = 'theme-';
|
|
3094
|
+
// Build a getColor that resolves `theme-*` tokens against a component-scoped
|
|
3095
|
+
// theme override before falling back to the global getColor. Tokens not
|
|
3096
|
+
// covered by the override (color-*, light-*, dark-*, theme-* keys not in the
|
|
3097
|
+
// override) pass straight through.
|
|
3098
|
+
function makeScopedGetColor(componentTheme, baseGetColor) {
|
|
3099
|
+
return name => {
|
|
3100
|
+
if (!name || typeof name !== 'string') return String(name);
|
|
3101
|
+
if (!name.startsWith(THEME_PREFIX$1)) return baseGetColor(name);
|
|
3102
|
+
const parts = name.substring(THEME_PREFIX$1.length).split('-');
|
|
3103
|
+
const lastPart = parts[parts.length - 1];
|
|
3104
|
+
const maybeAlpha = parseInt(lastPart, 10);
|
|
3105
|
+
const hasAlpha = parts.length >= 2 && !isNaN(maybeAlpha) && maybeAlpha >= 0 && maybeAlpha <= 1000;
|
|
3106
|
+
const themeKey = hasAlpha ? parts.slice(0, -1).join('-') : parts.join('-');
|
|
3107
|
+
const overrideValue = componentTheme[themeKey];
|
|
3108
|
+
if (typeof overrideValue !== 'string') return baseGetColor(name);
|
|
3109
|
+
const resolved = baseGetColor(overrideValue);
|
|
3110
|
+
if (!hasAlpha) return resolved;
|
|
3111
|
+
const percentage = Math.round(maybeAlpha / 1000 * 100);
|
|
3112
|
+
return `color-mix(in srgb, ${resolved} ${percentage}%, transparent)`;
|
|
3113
|
+
};
|
|
3114
|
+
}
|
|
3093
3115
|
const Element = /*#__PURE__*/React__default.memo(/*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
3094
3116
|
let {
|
|
3095
3117
|
as = 'div',
|
|
@@ -3104,6 +3126,7 @@
|
|
|
3104
3126
|
onPress,
|
|
3105
3127
|
blend,
|
|
3106
3128
|
animateOn = 'Both',
|
|
3129
|
+
theme: componentTheme,
|
|
3107
3130
|
...rest
|
|
3108
3131
|
} = props;
|
|
3109
3132
|
const elementRef = React.useRef(null);
|
|
@@ -3119,6 +3142,17 @@
|
|
|
3119
3142
|
getColor,
|
|
3120
3143
|
theme
|
|
3121
3144
|
} = useTheme();
|
|
3145
|
+
// When a component-level `theme` prop is supplied, wrap getColor so
|
|
3146
|
+
// `theme-*` tokens resolve against the override first. Memoize on a
|
|
3147
|
+
// serialized signature so the function identity stays stable across
|
|
3148
|
+
// renders that don't change the override.
|
|
3149
|
+
const componentThemeKey = componentTheme ? Object.entries(componentTheme).map(_ref2 => {
|
|
3150
|
+
let [k, v] = _ref2;
|
|
3151
|
+
return `${k}=${v}`;
|
|
3152
|
+
}).join('|') : '';
|
|
3153
|
+
const scopedGetColor = React.useMemo(() => componentTheme ? makeScopedGetColor(componentTheme, getColor) : getColor,
|
|
3154
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3155
|
+
[componentThemeKey, getColor]);
|
|
3122
3156
|
const {
|
|
3123
3157
|
trackEvent
|
|
3124
3158
|
} = useAnalytics();
|
|
@@ -3139,8 +3173,8 @@
|
|
|
3139
3173
|
setIsVisible(true);
|
|
3140
3174
|
return;
|
|
3141
3175
|
}
|
|
3142
|
-
const observer = new IntersectionObserver(
|
|
3143
|
-
let [entry] =
|
|
3176
|
+
const observer = new IntersectionObserver(_ref3 => {
|
|
3177
|
+
let [entry] = _ref3;
|
|
3144
3178
|
if (entry.isIntersecting) {
|
|
3145
3179
|
setIsVisible(true);
|
|
3146
3180
|
observer.disconnect();
|
|
@@ -3209,8 +3243,13 @@
|
|
|
3209
3243
|
return anim;
|
|
3210
3244
|
});
|
|
3211
3245
|
}
|
|
3212
|
-
// Use hash-based memoization for style extraction
|
|
3213
|
-
|
|
3246
|
+
// Use hash-based memoization for style extraction. Mix the component
|
|
3247
|
+
// theme signature into the `theme` argument so the cache invalidates
|
|
3248
|
+
// when an override changes between renders.
|
|
3249
|
+
const utilityClasses = useStableStyleMemo(propsToProcess, scopedGetColor, mediaQueries, devices, manager, componentTheme ? {
|
|
3250
|
+
...theme,
|
|
3251
|
+
__scope: componentThemeKey
|
|
3252
|
+
} : theme);
|
|
3214
3253
|
const newProps = {
|
|
3215
3254
|
ref: setRef
|
|
3216
3255
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-studio.umd.development.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"app-studio.umd.development.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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