app-studio 0.5.69 → 0.5.71
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/app-studio.cjs.development.js +374 -12
- 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 +374 -13
- package/dist/app-studio.esm.js.map +1 -1
- package/dist/app-studio.umd.development.js +374 -12
- package/dist/app-studio.umd.development.js.map +1 -1
- package/dist/app-studio.umd.production.min.js +1 -1
- package/dist/components/Form.d.ts +1 -1
- package/dist/components/Image.d.ts +1 -1
- package/dist/components/Text.d.ts +1 -1
- package/dist/components/View.d.ts +1 -1
- package/dist/{animation → element}/Animation.d.ts +416 -293
- package/dist/{components → element}/Element.d.ts +1 -1
- package/dist/{animation → element}/css.d.ts +1 -1
- package/dist/hooks/useInView.d.ts +9 -0
- package/dist/index.d.ts +4 -3
- package/dist/utils/constants.d.ts +6 -3
- package/package.json +2 -1
- /package/dist/{animation → element}/utils.d.ts +0 -0
|
@@ -1208,6 +1208,8 @@ const generateKeyframes = animation => {
|
|
|
1208
1208
|
direction,
|
|
1209
1209
|
fillMode,
|
|
1210
1210
|
playState,
|
|
1211
|
+
timeline,
|
|
1212
|
+
range,
|
|
1211
1213
|
...keyframesDef
|
|
1212
1214
|
} = animation;
|
|
1213
1215
|
// Générer une clé pour le cache basée sur les keyframes
|
|
@@ -1251,6 +1253,54 @@ const generateKeyframes = animation => {
|
|
|
1251
1253
|
const numericCssProperties = /*#__PURE__*/new Set(['border-bottom-left-radius', 'border-bottom-right-radius', 'border-bottom-width', 'border-left-width', 'border-radius', 'border-right-width', 'border-spacing', 'border-top-left-radius', 'border-top-right-radius', 'border-top-width', 'border-width', 'bottom', 'column-gap', 'column-rule-width', 'column-width', 'font-size', 'gap', 'height', 'left', 'letter-spacing', 'line-height', 'margin', 'margin-bottom', 'margin-left', 'margin-right', 'margin-top', 'max-height', 'max-width', 'min-height', 'min-width', 'outline-offset', 'outline-width', 'padding', 'padding-bottom', 'padding-left', 'padding-right', 'padding-top', 'perspective', 'right', 'row-gap', 'text-indent', 'top', 'width']);
|
|
1252
1254
|
|
|
1253
1255
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
1256
|
+
// Implement a simple LRU cache for classCache
|
|
1257
|
+
class LRUCache {
|
|
1258
|
+
constructor(maxSize) {
|
|
1259
|
+
this.maxSize = maxSize;
|
|
1260
|
+
this.cache = new Map();
|
|
1261
|
+
}
|
|
1262
|
+
get(key) {
|
|
1263
|
+
const item = this.cache.get(key);
|
|
1264
|
+
if (item) {
|
|
1265
|
+
// Move to the end to mark as recently used
|
|
1266
|
+
this.cache.delete(key);
|
|
1267
|
+
this.cache.set(key, item);
|
|
1268
|
+
return item;
|
|
1269
|
+
}
|
|
1270
|
+
return undefined;
|
|
1271
|
+
}
|
|
1272
|
+
set(key, value) {
|
|
1273
|
+
if (this.cache.has(key)) {
|
|
1274
|
+
// If already in cache, just move to the end
|
|
1275
|
+
this.cache.delete(key);
|
|
1276
|
+
} else if (this.cache.size >= this.maxSize) {
|
|
1277
|
+
// Remove the least recently used (first item in the map)
|
|
1278
|
+
const firstKey = this.cache.keys().next().value;
|
|
1279
|
+
if (firstKey) {
|
|
1280
|
+
this.cache.delete(firstKey);
|
|
1281
|
+
}
|
|
1282
|
+
}
|
|
1283
|
+
this.cache.set(key, value);
|
|
1284
|
+
}
|
|
1285
|
+
clear() {
|
|
1286
|
+
this.cache.clear();
|
|
1287
|
+
}
|
|
1288
|
+
delete(key) {
|
|
1289
|
+
this.cache.delete(key);
|
|
1290
|
+
}
|
|
1291
|
+
get size() {
|
|
1292
|
+
return this.cache.size;
|
|
1293
|
+
}
|
|
1294
|
+
keys() {
|
|
1295
|
+
return this.cache.keys();
|
|
1296
|
+
}
|
|
1297
|
+
values() {
|
|
1298
|
+
return this.cache.values();
|
|
1299
|
+
}
|
|
1300
|
+
has(key) {
|
|
1301
|
+
return this.cache.has(key);
|
|
1302
|
+
}
|
|
1303
|
+
}
|
|
1254
1304
|
class UtilityClassManager {
|
|
1255
1305
|
constructor(propertyShorthand, maxCacheSize) {
|
|
1256
1306
|
if (maxCacheSize === void 0) {
|
|
@@ -1259,10 +1309,11 @@ class UtilityClassManager {
|
|
|
1259
1309
|
this.baseStyleSheet = new Map();
|
|
1260
1310
|
this.mediaStyleSheet = new Map();
|
|
1261
1311
|
this.modifierStyleSheet = new Map();
|
|
1262
|
-
this.classCache = new Map();
|
|
1263
1312
|
this.mainDocument = null;
|
|
1264
1313
|
this.propertyShorthand = propertyShorthand;
|
|
1265
1314
|
this.maxCacheSize = maxCacheSize;
|
|
1315
|
+
// Initialize LRUCache with maxSize
|
|
1316
|
+
this.classCache = new LRUCache(this.maxCacheSize);
|
|
1266
1317
|
if (typeof document !== 'undefined') {
|
|
1267
1318
|
this.mainDocument = document;
|
|
1268
1319
|
this.initStyleSheets(document);
|
|
@@ -1376,10 +1427,7 @@ class UtilityClassManager {
|
|
|
1376
1427
|
return Array.from(this.baseStyleSheet.keys());
|
|
1377
1428
|
}
|
|
1378
1429
|
addToCache(key, className, rules) {
|
|
1379
|
-
|
|
1380
|
-
const firstKey = this.classCache.keys().next().value;
|
|
1381
|
-
if (firstKey) this.classCache.delete(firstKey);
|
|
1382
|
-
}
|
|
1430
|
+
// LRUCache handles size limit internally
|
|
1383
1431
|
this.classCache.set(key, {
|
|
1384
1432
|
className,
|
|
1385
1433
|
rules
|
|
@@ -1570,16 +1618,16 @@ class UtilityClassManager {
|
|
|
1570
1618
|
}
|
|
1571
1619
|
}
|
|
1572
1620
|
/**
|
|
1573
|
-
*
|
|
1621
|
+
* WeakMaps a React event to a CSS pseudo-class.
|
|
1574
1622
|
*/
|
|
1575
1623
|
const mapEventToPseudo = event => {
|
|
1576
|
-
const
|
|
1624
|
+
const eventWeakMap = {
|
|
1577
1625
|
hover: 'hover',
|
|
1578
1626
|
active: 'active',
|
|
1579
1627
|
focus: 'focus',
|
|
1580
1628
|
visited: 'visited'
|
|
1581
1629
|
};
|
|
1582
|
-
return
|
|
1630
|
+
return eventWeakMap[event] || null;
|
|
1583
1631
|
};
|
|
1584
1632
|
/**
|
|
1585
1633
|
* Generates shorthand abbreviations for CSS properties.
|
|
@@ -1609,8 +1657,22 @@ function generatePropertyShorthand(styledProps) {
|
|
|
1609
1657
|
}
|
|
1610
1658
|
return propertyShorthand;
|
|
1611
1659
|
}
|
|
1660
|
+
const rawCssCache = /*#__PURE__*/new Map();
|
|
1661
|
+
function generateUniqueClassName(css) {
|
|
1662
|
+
// If we already have a class name for this exact CSS, return it
|
|
1663
|
+
// Otherwise, create a new encoded and truncated class name
|
|
1664
|
+
if (rawCssCache.has(css)) {
|
|
1665
|
+
return rawCssCache.get(css);
|
|
1666
|
+
}
|
|
1667
|
+
const shortName = Math.random().toString(36).substring(7);
|
|
1668
|
+
// Optionally include a counter to reduce collisions on identical slice
|
|
1669
|
+
const newClassName = `raw-css-${shortName}`;
|
|
1670
|
+
// Store it in the cache
|
|
1671
|
+
rawCssCache.set(css, newClassName);
|
|
1672
|
+
return newClassName;
|
|
1673
|
+
}
|
|
1612
1674
|
const propertyShorthand = /*#__PURE__*/generatePropertyShorthand(StyleProps);
|
|
1613
|
-
const utilityClassManager = /*#__PURE__*/new UtilityClassManager(propertyShorthand);
|
|
1675
|
+
const utilityClassManager = /*#__PURE__*/new UtilityClassManager(propertyShorthand, 10000); // You can adjust maxSize here
|
|
1614
1676
|
function parseDuration(duration) {
|
|
1615
1677
|
const match = duration.match(/^([\d.]+)(ms|s)$/);
|
|
1616
1678
|
if (!match) return 0;
|
|
@@ -1688,6 +1750,8 @@ const extractUtilityClasses = (props, getColor, mediaQueries, devices) => {
|
|
|
1688
1750
|
const animationDirections = [];
|
|
1689
1751
|
const animationFillModes = [];
|
|
1690
1752
|
const animationPlayStates = [];
|
|
1753
|
+
const animationTimelines = [];
|
|
1754
|
+
const animationRanges = [];
|
|
1691
1755
|
let cumulativeTime = 0;
|
|
1692
1756
|
animations.forEach(animation => {
|
|
1693
1757
|
const {
|
|
@@ -1709,6 +1773,8 @@ const extractUtilityClasses = (props, getColor, mediaQueries, devices) => {
|
|
|
1709
1773
|
animationDirections.push(animation.direction || 'normal');
|
|
1710
1774
|
animationFillModes.push(animation.fillMode || 'none');
|
|
1711
1775
|
animationPlayStates.push(animation.playState || 'running');
|
|
1776
|
+
animationTimelines.push(animation.timeline || '');
|
|
1777
|
+
animationRanges.push(animation.range || '');
|
|
1712
1778
|
});
|
|
1713
1779
|
computedStyles.animationName = animationNames.join(', ');
|
|
1714
1780
|
computedStyles.animationDuration = animationDurations.join(', ');
|
|
@@ -1718,6 +1784,12 @@ const extractUtilityClasses = (props, getColor, mediaQueries, devices) => {
|
|
|
1718
1784
|
computedStyles.animationDirection = animationDirections.join(', ');
|
|
1719
1785
|
computedStyles.animationFillMode = animationFillModes.join(', ');
|
|
1720
1786
|
computedStyles.animationPlayState = animationPlayStates.join(', ');
|
|
1787
|
+
if (animationTimelines.some(t => t)) {
|
|
1788
|
+
computedStyles.animationTimeline = animationTimelines.join(', ');
|
|
1789
|
+
}
|
|
1790
|
+
if (animationRanges.some(r => r)) {
|
|
1791
|
+
computedStyles.animationRange = animationRanges.join(', ');
|
|
1792
|
+
}
|
|
1721
1793
|
}
|
|
1722
1794
|
// Generate utility classes for computed styles
|
|
1723
1795
|
const generateUtilityClasses = function (styles, context, modifier) {
|
|
@@ -1746,7 +1818,7 @@ const extractUtilityClasses = (props, getColor, mediaQueries, devices) => {
|
|
|
1746
1818
|
generateUtilityClasses(computedStyles, 'base');
|
|
1747
1819
|
// Iterate over remaining style props
|
|
1748
1820
|
Object.keys(props).forEach(property => {
|
|
1749
|
-
if (property !== 'style' && (isStyleProp(property) || ['on', 'media'].includes(property))) {
|
|
1821
|
+
if (property !== 'style' && property !== 'css' && (isStyleProp(property) || ['on', 'media'].includes(property))) {
|
|
1750
1822
|
const value = props[property];
|
|
1751
1823
|
if (typeof value === 'object' && value !== null) {
|
|
1752
1824
|
if (property === 'on') {
|
|
@@ -1816,6 +1888,17 @@ const extractUtilityClasses = (props, getColor, mediaQueries, devices) => {
|
|
|
1816
1888
|
}
|
|
1817
1889
|
}
|
|
1818
1890
|
});
|
|
1891
|
+
if (props.css) {
|
|
1892
|
+
if (typeof props.css === 'object') {
|
|
1893
|
+
Object.assign(computedStyles, props.css);
|
|
1894
|
+
} else if (typeof props.css === 'string') {
|
|
1895
|
+
// Generate or reuse a class for the raw CSS
|
|
1896
|
+
const uniqueClassName = generateUniqueClassName(props.css);
|
|
1897
|
+
console.log('uniqueClassName', uniqueClassName, props.css);
|
|
1898
|
+
utilityClassManager.injectRule(`.${uniqueClassName} { ${props.css} }`);
|
|
1899
|
+
classes.push(uniqueClassName);
|
|
1900
|
+
}
|
|
1901
|
+
}
|
|
1819
1902
|
return classes;
|
|
1820
1903
|
};
|
|
1821
1904
|
|
|
@@ -3067,6 +3150,240 @@ const blinkCursor = _ref43 => {
|
|
|
3067
3150
|
...props
|
|
3068
3151
|
};
|
|
3069
3152
|
};
|
|
3153
|
+
const fadeInScroll = _ref44 => {
|
|
3154
|
+
let {
|
|
3155
|
+
duration = '0.5s',
|
|
3156
|
+
timingFunction = 'ease',
|
|
3157
|
+
timeline = 'scroll()',
|
|
3158
|
+
range = 'cover',
|
|
3159
|
+
...props
|
|
3160
|
+
} = _ref44;
|
|
3161
|
+
return {
|
|
3162
|
+
from: {
|
|
3163
|
+
opacity: 0
|
|
3164
|
+
},
|
|
3165
|
+
to: {
|
|
3166
|
+
opacity: 1
|
|
3167
|
+
},
|
|
3168
|
+
duration,
|
|
3169
|
+
timingFunction,
|
|
3170
|
+
timeline,
|
|
3171
|
+
range,
|
|
3172
|
+
...props
|
|
3173
|
+
};
|
|
3174
|
+
};
|
|
3175
|
+
const slideInLeftScroll = _ref45 => {
|
|
3176
|
+
let {
|
|
3177
|
+
duration = '0.5s',
|
|
3178
|
+
timingFunction = 'ease-out',
|
|
3179
|
+
timeline = 'scroll()',
|
|
3180
|
+
range = 'cover',
|
|
3181
|
+
...props
|
|
3182
|
+
} = _ref45;
|
|
3183
|
+
return {
|
|
3184
|
+
from: {
|
|
3185
|
+
transform: 'translateX(-200%)'
|
|
3186
|
+
},
|
|
3187
|
+
to: {
|
|
3188
|
+
transform: 'translateX(0)'
|
|
3189
|
+
},
|
|
3190
|
+
duration,
|
|
3191
|
+
timingFunction,
|
|
3192
|
+
timeline,
|
|
3193
|
+
range,
|
|
3194
|
+
...props
|
|
3195
|
+
};
|
|
3196
|
+
};
|
|
3197
|
+
const scaleDownScroll = _ref46 => {
|
|
3198
|
+
let {
|
|
3199
|
+
duration = '0.8s',
|
|
3200
|
+
timingFunction = 'ease',
|
|
3201
|
+
timeline = 'scroll()',
|
|
3202
|
+
range = 'cover',
|
|
3203
|
+
...props
|
|
3204
|
+
} = _ref46;
|
|
3205
|
+
return {
|
|
3206
|
+
from: {
|
|
3207
|
+
transform: 'scale(3)'
|
|
3208
|
+
},
|
|
3209
|
+
to: {
|
|
3210
|
+
transform: 'scale(1)'
|
|
3211
|
+
},
|
|
3212
|
+
duration,
|
|
3213
|
+
timingFunction,
|
|
3214
|
+
timeline,
|
|
3215
|
+
range,
|
|
3216
|
+
...props
|
|
3217
|
+
};
|
|
3218
|
+
};
|
|
3219
|
+
// Text fill reveal on scroll driven by a custom property (--fill)
|
|
3220
|
+
// Requires @property --fill defined in CSS
|
|
3221
|
+
const fillTextScroll = _ref47 => {
|
|
3222
|
+
let {
|
|
3223
|
+
duration = '1s',
|
|
3224
|
+
timingFunction = 'linear',
|
|
3225
|
+
timeline = '--section',
|
|
3226
|
+
range = 'entry 100% cover 50%, cover 50% exit 0%',
|
|
3227
|
+
...props
|
|
3228
|
+
} = _ref47;
|
|
3229
|
+
return {
|
|
3230
|
+
from: {
|
|
3231
|
+
'--fill': 0,
|
|
3232
|
+
color: 'transparent',
|
|
3233
|
+
backgroundPositionX: 'calc(var(--underline-block-width) * -1), calc(var(--underline-block-width) * -1), 0'
|
|
3234
|
+
},
|
|
3235
|
+
'50%': {
|
|
3236
|
+
'--fill': 0.5
|
|
3237
|
+
},
|
|
3238
|
+
to: {
|
|
3239
|
+
'--fill': 1,
|
|
3240
|
+
backgroundPositionX: '0, 0, 0',
|
|
3241
|
+
color: 'var(--finish-fill)'
|
|
3242
|
+
},
|
|
3243
|
+
duration,
|
|
3244
|
+
timingFunction,
|
|
3245
|
+
timeline,
|
|
3246
|
+
range,
|
|
3247
|
+
...props
|
|
3248
|
+
};
|
|
3249
|
+
};
|
|
3250
|
+
// Collapsing floating call-to-action on scroll
|
|
3251
|
+
// This animates the width from an expanded value to a collapsed width.
|
|
3252
|
+
const ctaCollapseScroll = _ref48 => {
|
|
3253
|
+
let {
|
|
3254
|
+
duration = '1s',
|
|
3255
|
+
timingFunction = 'linear',
|
|
3256
|
+
timeline = 'scroll()',
|
|
3257
|
+
range = '0 400px',
|
|
3258
|
+
...props
|
|
3259
|
+
} = _ref48;
|
|
3260
|
+
return {
|
|
3261
|
+
from: {
|
|
3262
|
+
width: 'calc(48px + 120px)'
|
|
3263
|
+
},
|
|
3264
|
+
to: {
|
|
3265
|
+
width: '48px'
|
|
3266
|
+
},
|
|
3267
|
+
duration,
|
|
3268
|
+
timingFunction,
|
|
3269
|
+
timeline,
|
|
3270
|
+
range,
|
|
3271
|
+
...props
|
|
3272
|
+
};
|
|
3273
|
+
};
|
|
3274
|
+
// Hand wave animation on scroll with a defined view range
|
|
3275
|
+
const handWaveScroll = _ref49 => {
|
|
3276
|
+
let {
|
|
3277
|
+
duration = '2s',
|
|
3278
|
+
timingFunction = 'linear',
|
|
3279
|
+
timeline = 'scroll()',
|
|
3280
|
+
range = '10vh 60vh',
|
|
3281
|
+
...props
|
|
3282
|
+
} = _ref49;
|
|
3283
|
+
return {
|
|
3284
|
+
from: {
|
|
3285
|
+
transform: 'rotate(0deg)'
|
|
3286
|
+
},
|
|
3287
|
+
'50%': {
|
|
3288
|
+
transform: 'rotate(20deg)'
|
|
3289
|
+
},
|
|
3290
|
+
to: {
|
|
3291
|
+
transform: 'rotate(0deg)'
|
|
3292
|
+
},
|
|
3293
|
+
duration,
|
|
3294
|
+
timingFunction,
|
|
3295
|
+
timeline,
|
|
3296
|
+
range,
|
|
3297
|
+
...props
|
|
3298
|
+
};
|
|
3299
|
+
};
|
|
3300
|
+
// Fade out and blur text on scroll exit
|
|
3301
|
+
const fadeBlurScroll = _ref50 => {
|
|
3302
|
+
let {
|
|
3303
|
+
duration = '1s',
|
|
3304
|
+
timingFunction = 'linear',
|
|
3305
|
+
timeline = 'view()',
|
|
3306
|
+
range = 'cover 40% cover 85%',
|
|
3307
|
+
...props
|
|
3308
|
+
} = _ref50;
|
|
3309
|
+
return {
|
|
3310
|
+
to: {
|
|
3311
|
+
opacity: 0,
|
|
3312
|
+
filter: 'blur(2rem)'
|
|
3313
|
+
},
|
|
3314
|
+
duration,
|
|
3315
|
+
timingFunction,
|
|
3316
|
+
timeline,
|
|
3317
|
+
range,
|
|
3318
|
+
...props
|
|
3319
|
+
};
|
|
3320
|
+
};
|
|
3321
|
+
// Unclip animation using clip-path on scroll
|
|
3322
|
+
const unclipScroll = _ref51 => {
|
|
3323
|
+
let {
|
|
3324
|
+
duration = '1s',
|
|
3325
|
+
timingFunction = 'linear',
|
|
3326
|
+
timeline = '--article',
|
|
3327
|
+
range = 'entry',
|
|
3328
|
+
...props
|
|
3329
|
+
} = _ref51;
|
|
3330
|
+
return {
|
|
3331
|
+
to: {
|
|
3332
|
+
clipPath: 'ellipse(220% 200% at 50% 175%)'
|
|
3333
|
+
},
|
|
3334
|
+
duration,
|
|
3335
|
+
timingFunction,
|
|
3336
|
+
timeline,
|
|
3337
|
+
range,
|
|
3338
|
+
...props
|
|
3339
|
+
};
|
|
3340
|
+
};
|
|
3341
|
+
// Scale down image (or content) on scroll using article timeline
|
|
3342
|
+
const scaleDownArticleScroll = _ref52 => {
|
|
3343
|
+
let {
|
|
3344
|
+
duration = '1s',
|
|
3345
|
+
timingFunction = 'linear',
|
|
3346
|
+
timeline = '--article',
|
|
3347
|
+
range = 'entry',
|
|
3348
|
+
...props
|
|
3349
|
+
} = _ref52;
|
|
3350
|
+
return {
|
|
3351
|
+
'0%': {
|
|
3352
|
+
transform: 'scale(5)'
|
|
3353
|
+
},
|
|
3354
|
+
to: {
|
|
3355
|
+
transform: 'scale(1)'
|
|
3356
|
+
},
|
|
3357
|
+
duration,
|
|
3358
|
+
timingFunction,
|
|
3359
|
+
timeline,
|
|
3360
|
+
range,
|
|
3361
|
+
...props
|
|
3362
|
+
};
|
|
3363
|
+
};
|
|
3364
|
+
// List item scaling animation on scroll driven by an inline view-timeline (--i)
|
|
3365
|
+
const listItemScaleScroll = _ref53 => {
|
|
3366
|
+
let {
|
|
3367
|
+
duration = '0.5s',
|
|
3368
|
+
timingFunction = 'ease',
|
|
3369
|
+
timeline = '--i',
|
|
3370
|
+
range = 'cover 40% cover 60%',
|
|
3371
|
+
...props
|
|
3372
|
+
} = _ref53;
|
|
3373
|
+
return {
|
|
3374
|
+
from: {
|
|
3375
|
+
transform: 'scale(0.8)'
|
|
3376
|
+
},
|
|
3377
|
+
'50%': {
|
|
3378
|
+
transform: 'scale(1)'
|
|
3379
|
+
},
|
|
3380
|
+
duration,
|
|
3381
|
+
timingFunction,
|
|
3382
|
+
timeline,
|
|
3383
|
+
range,
|
|
3384
|
+
...props
|
|
3385
|
+
};
|
|
3386
|
+
};
|
|
3070
3387
|
|
|
3071
3388
|
var Animation = {
|
|
3072
3389
|
__proto__: null,
|
|
@@ -3112,7 +3429,17 @@ var Animation = {
|
|
|
3112
3429
|
shimmer: shimmer,
|
|
3113
3430
|
progress: progress,
|
|
3114
3431
|
typewriter: typewriter,
|
|
3115
|
-
blinkCursor: blinkCursor
|
|
3432
|
+
blinkCursor: blinkCursor,
|
|
3433
|
+
fadeInScroll: fadeInScroll,
|
|
3434
|
+
slideInLeftScroll: slideInLeftScroll,
|
|
3435
|
+
scaleDownScroll: scaleDownScroll,
|
|
3436
|
+
fillTextScroll: fillTextScroll,
|
|
3437
|
+
ctaCollapseScroll: ctaCollapseScroll,
|
|
3438
|
+
handWaveScroll: handWaveScroll,
|
|
3439
|
+
fadeBlurScroll: fadeBlurScroll,
|
|
3440
|
+
unclipScroll: unclipScroll,
|
|
3441
|
+
scaleDownArticleScroll: scaleDownArticleScroll,
|
|
3442
|
+
listItemScaleScroll: listItemScaleScroll
|
|
3116
3443
|
};
|
|
3117
3444
|
|
|
3118
3445
|
const Skeleton = /*#__PURE__*/React__default.memo(_ref => {
|
|
@@ -3335,7 +3662,7 @@ function useOnScreen(options) {
|
|
|
3335
3662
|
}, options);
|
|
3336
3663
|
observer.observe(node);
|
|
3337
3664
|
return () => {
|
|
3338
|
-
observer.
|
|
3665
|
+
observer.disconnect();
|
|
3339
3666
|
};
|
|
3340
3667
|
}, [options]);
|
|
3341
3668
|
return [ref, isOnScreen];
|
|
@@ -3638,6 +3965,40 @@ function useWindowSize() {
|
|
|
3638
3965
|
return size;
|
|
3639
3966
|
}
|
|
3640
3967
|
|
|
3968
|
+
function useInView(options) {
|
|
3969
|
+
const {
|
|
3970
|
+
triggerOnce = false,
|
|
3971
|
+
...observerOptions
|
|
3972
|
+
} = options || {};
|
|
3973
|
+
const ref = React.useRef(null);
|
|
3974
|
+
const [inView, setInView] = React.useState(false);
|
|
3975
|
+
React.useEffect(() => {
|
|
3976
|
+
const element = ref.current;
|
|
3977
|
+
if (!element) return;
|
|
3978
|
+
const observer = new IntersectionObserver(_ref => {
|
|
3979
|
+
let [entry] = _ref;
|
|
3980
|
+
if (entry.isIntersecting) {
|
|
3981
|
+
setInView(true);
|
|
3982
|
+
// If triggerOnce is true, disconnect the observer once the element is in view
|
|
3983
|
+
if (triggerOnce) {
|
|
3984
|
+
observer.disconnect();
|
|
3985
|
+
}
|
|
3986
|
+
} else if (!triggerOnce) {
|
|
3987
|
+
// Only update to false if not using triggerOnce
|
|
3988
|
+
setInView(false);
|
|
3989
|
+
}
|
|
3990
|
+
}, observerOptions);
|
|
3991
|
+
observer.observe(element);
|
|
3992
|
+
return () => {
|
|
3993
|
+
observer.disconnect();
|
|
3994
|
+
};
|
|
3995
|
+
}, [triggerOnce, ...Object.values(observerOptions || {})]);
|
|
3996
|
+
return {
|
|
3997
|
+
ref,
|
|
3998
|
+
inView
|
|
3999
|
+
};
|
|
4000
|
+
}
|
|
4001
|
+
|
|
3641
4002
|
exports.AnalyticsContext = AnalyticsContext;
|
|
3642
4003
|
exports.AnalyticsProvider = AnalyticsProvider;
|
|
3643
4004
|
exports.Animation = Animation;
|
|
@@ -3684,6 +4045,7 @@ exports.useAnalytics = useAnalytics;
|
|
|
3684
4045
|
exports.useClickOutside = useClickOutside;
|
|
3685
4046
|
exports.useFocus = useFocus;
|
|
3686
4047
|
exports.useHover = useHover;
|
|
4048
|
+
exports.useInView = useInView;
|
|
3687
4049
|
exports.useInfiniteScroll = useInfiniteScroll;
|
|
3688
4050
|
exports.useKeyPress = useKeyPress;
|
|
3689
4051
|
exports.useMount = useMount;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-studio.cjs.development.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"app-studio.cjs.development.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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