@app-studio/web 0.9.51 → 0.9.54
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/web.cjs.development.js +59 -26
- package/dist/web.cjs.development.js.map +1 -1
- package/dist/web.cjs.production.min.js +1 -1
- package/dist/web.cjs.production.min.js.map +1 -1
- package/dist/web.esm.js +60 -27
- package/dist/web.esm.js.map +1 -1
- package/dist/web.umd.development.js +59 -26
- package/dist/web.umd.development.js.map +1 -1
- package/dist/web.umd.production.min.js +1 -1
- package/dist/web.umd.production.min.js.map +1 -1
- package/package.json +2 -2
|
@@ -19309,16 +19309,6 @@ var TypewriterEffect = _ref => {
|
|
|
19309
19309
|
|
|
19310
19310
|
var _excluded$_ = ["text", "duration", "direction", "stagger", "sequential", "textStyle", "as", "wordProps"],
|
|
19311
19311
|
_excluded2$g = ["style"];
|
|
19312
|
-
// CSS keyframes injection - done once
|
|
19313
|
-
var KEYFRAMES_ID = 'slide-effect-keyframes';
|
|
19314
|
-
var injectKeyframes = () => {
|
|
19315
|
-
if (typeof document === 'undefined') return;
|
|
19316
|
-
if (document.getElementById(KEYFRAMES_ID)) return;
|
|
19317
|
-
var style = document.createElement('style');
|
|
19318
|
-
style.id = KEYFRAMES_ID;
|
|
19319
|
-
style.textContent = "\n @keyframes slideInUp {\n from { transform: translateY(100%); opacity: 0; }\n to { transform: translateY(0); opacity: 1; }\n }\n @keyframes slideOutUp {\n from { transform: translateY(0); opacity: 1; }\n to { transform: translateY(-100%); opacity: 0; }\n }\n @keyframes slideInDown {\n from { transform: translateY(-100%); opacity: 0; }\n to { transform: translateY(0); opacity: 1; }\n }\n @keyframes slideOutDown {\n from { transform: translateY(0); opacity: 1; }\n to { transform: translateY(100%); opacity: 0; }\n }\n ";
|
|
19320
|
-
document.head.appendChild(style);
|
|
19321
|
-
};
|
|
19322
19312
|
var SlideEffect = _ref => {
|
|
19323
19313
|
var {
|
|
19324
19314
|
text,
|
|
@@ -19335,10 +19325,6 @@ var SlideEffect = _ref => {
|
|
|
19335
19325
|
var [animKey, setAnimKey] = React.useState(0);
|
|
19336
19326
|
var pendingTextRef = React.useRef(null);
|
|
19337
19327
|
var timeoutRef = React.useRef(null);
|
|
19338
|
-
// Inject keyframes once on mount
|
|
19339
|
-
React.useEffect(() => {
|
|
19340
|
-
injectKeyframes();
|
|
19341
|
-
}, []);
|
|
19342
19328
|
// Handle text changes
|
|
19343
19329
|
React.useEffect(() => {
|
|
19344
19330
|
if (text === displayedText && phase === 'visible') {
|
|
@@ -19404,12 +19390,10 @@ var SlideEffect = _ref => {
|
|
|
19404
19390
|
style: customWordStyle
|
|
19405
19391
|
} = _ref2,
|
|
19406
19392
|
restWordProps = _objectWithoutPropertiesLoose(_ref2, _excluded2$g);
|
|
19407
|
-
// Get animation
|
|
19393
|
+
// Get animation functions based on direction
|
|
19408
19394
|
var isUp = direction === 'up';
|
|
19409
|
-
var enterAnim = isUp ? 'slideInUp' : 'slideInDown';
|
|
19410
|
-
var exitAnim = isUp ? 'slideOutUp' : 'slideOutDown';
|
|
19411
19395
|
// Calculate delay for each word
|
|
19412
|
-
var getDelay =
|
|
19396
|
+
var getDelay = index => {
|
|
19413
19397
|
if (sequential) {
|
|
19414
19398
|
// Sequential: one word at a time
|
|
19415
19399
|
return index * (duration + stagger);
|
|
@@ -19431,9 +19415,6 @@ var SlideEffect = _ref => {
|
|
|
19431
19415
|
flexWrap: 'nowrap',
|
|
19432
19416
|
whiteSpace: 'nowrap'
|
|
19433
19417
|
}), []);
|
|
19434
|
-
// Determine current animation
|
|
19435
|
-
var currentAnim = phase === 'exiting' ? exitAnim : enterAnim;
|
|
19436
|
-
var isAnimating = phase === 'entering' || phase === 'exiting';
|
|
19437
19418
|
return /*#__PURE__*/React__default.createElement(appStudio.Element, Object.assign({
|
|
19438
19419
|
as: "span",
|
|
19439
19420
|
style: containerStyle
|
|
@@ -19442,17 +19423,63 @@ var SlideEffect = _ref => {
|
|
|
19442
19423
|
}, words.map((word, index) => {
|
|
19443
19424
|
var delay = getDelay(index);
|
|
19444
19425
|
var isLast = index === words.length - 1;
|
|
19426
|
+
// Create animation based on phase and direction
|
|
19427
|
+
var wordAnimation;
|
|
19428
|
+
var durationStr = duration + "ms";
|
|
19429
|
+
var delayStr = delay + "ms";
|
|
19430
|
+
if (phase === 'entering') {
|
|
19431
|
+
// Use app-studio animations for entering
|
|
19432
|
+
wordAnimation = isUp ? appStudio.Animation.slideInUp({
|
|
19433
|
+
duration: durationStr,
|
|
19434
|
+
delay: delayStr,
|
|
19435
|
+
timingFunction: 'ease-out',
|
|
19436
|
+
fillMode: 'both'
|
|
19437
|
+
}) : appStudio.Animation.slideInDown({
|
|
19438
|
+
duration: durationStr,
|
|
19439
|
+
delay: delayStr,
|
|
19440
|
+
timingFunction: 'ease-out',
|
|
19441
|
+
fillMode: 'both'
|
|
19442
|
+
});
|
|
19443
|
+
} else if (phase === 'exiting') {
|
|
19444
|
+
// Custom animation objects for exiting (slideOut not in app-studio yet)
|
|
19445
|
+
wordAnimation = isUp ? {
|
|
19446
|
+
from: {
|
|
19447
|
+
transform: 'translateY(0)',
|
|
19448
|
+
opacity: 1
|
|
19449
|
+
},
|
|
19450
|
+
to: {
|
|
19451
|
+
transform: 'translateY(-100%)',
|
|
19452
|
+
opacity: 0
|
|
19453
|
+
},
|
|
19454
|
+
duration: durationStr,
|
|
19455
|
+
delay: delayStr,
|
|
19456
|
+
timingFunction: 'ease-in',
|
|
19457
|
+
fillMode: 'both'
|
|
19458
|
+
} : {
|
|
19459
|
+
from: {
|
|
19460
|
+
transform: 'translateY(0)',
|
|
19461
|
+
opacity: 1
|
|
19462
|
+
},
|
|
19463
|
+
to: {
|
|
19464
|
+
transform: 'translateY(100%)',
|
|
19465
|
+
opacity: 0
|
|
19466
|
+
},
|
|
19467
|
+
duration: durationStr,
|
|
19468
|
+
delay: delayStr,
|
|
19469
|
+
timingFunction: 'ease-in',
|
|
19470
|
+
fillMode: 'both'
|
|
19471
|
+
};
|
|
19472
|
+
}
|
|
19445
19473
|
var wordStyle = Object.assign({}, customWordStyle, {
|
|
19446
19474
|
display: 'inline-block',
|
|
19447
19475
|
marginRight: isLast ? 0 : '0.25em',
|
|
19448
|
-
willChange: isAnimating ? 'transform, opacity' : 'auto',
|
|
19449
|
-
animation: isAnimating ? currentAnim + " " + duration + "ms ease-out " + delay + "ms both" : 'none',
|
|
19450
19476
|
transform: phase === 'visible' ? 'translateY(0)' : undefined,
|
|
19451
19477
|
opacity: phase === 'visible' ? 1 : undefined
|
|
19452
19478
|
});
|
|
19453
19479
|
return /*#__PURE__*/React__default.createElement(appStudio.Text, Object.assign({
|
|
19454
19480
|
key: animKey + "-" + index,
|
|
19455
|
-
as: "span"
|
|
19481
|
+
as: "span",
|
|
19482
|
+
animate: wordAnimation
|
|
19456
19483
|
}, restWordProps, {
|
|
19457
19484
|
style: wordStyle
|
|
19458
19485
|
}), word);
|
|
@@ -19461,7 +19488,7 @@ var SlideEffect = _ref => {
|
|
|
19461
19488
|
|
|
19462
19489
|
var _excluded$$ = ["children", "highlightText", "highlightStyle", "highlightColor", "highlightSecondaryColor", "size", "responsive", "centered", "views", "highlightAnimate", "animate", "animationLoop", "highlightAnimationLoop", "highlightTypewriter", "highlightTypewriterDuration", "highlightSlide", "highlightSlideDuration", "highlightSlideStagger", "highlightSlideSequential"];
|
|
19463
19490
|
function escapeRegExp(string) {
|
|
19464
|
-
return string.replace(/[.*+?^${}()|[\\]
|
|
19491
|
+
return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
19465
19492
|
}
|
|
19466
19493
|
var TitleView = _ref => {
|
|
19467
19494
|
var {
|
|
@@ -19557,7 +19584,13 @@ var TitleView = _ref => {
|
|
|
19557
19584
|
// Get the text to display
|
|
19558
19585
|
var text = typeof finalDisplayedText === 'string' ? finalDisplayedText : typeof children === 'string' ? children : '';
|
|
19559
19586
|
if (typeof text === 'string' && activeHighlightTarget) {
|
|
19560
|
-
var pattern =
|
|
19587
|
+
var pattern = (() => {
|
|
19588
|
+
if (Array.isArray(activeHighlightTarget)) {
|
|
19589
|
+
var escaped = activeHighlightTarget.map(t => escapeRegExp(String(t)));
|
|
19590
|
+
return new RegExp("(" + escaped.join('|') + ")", 'gi');
|
|
19591
|
+
}
|
|
19592
|
+
return new RegExp("(" + escapeRegExp(String(activeHighlightTarget)) + ")", 'gi');
|
|
19593
|
+
})();
|
|
19561
19594
|
var parts = [];
|
|
19562
19595
|
var lastIndex = 0;
|
|
19563
19596
|
var match;
|