@app-studio/web 0.9.60 → 0.9.62

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.
@@ -19037,7 +19037,9 @@
19037
19037
  var updateAlternatingState = index => {
19038
19038
  var currentWordToHighlight = alternateHighlightText[index];
19039
19039
  // Replace the placeholder in the baseText with the current alternating word
19040
- var regex = new RegExp(placeholder, 'gi');
19040
+ // Escape regex special characters in placeholder to prevent errors
19041
+ var escapedPlaceholder = placeholder.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
19042
+ var regex = new RegExp(escapedPlaceholder, 'gi');
19041
19043
  var newContent = baseText.replace(regex, currentWordToHighlight);
19042
19044
  setFinalDisplayedText(newContent);
19043
19045
  setActiveHighlightTarget(currentWordToHighlight); // Set the current word as the highlight target
@@ -19167,12 +19169,10 @@
19167
19169
  */
19168
19170
  var HighlightStyles = {
19169
19171
  underline: color => ({
19170
- style: {
19171
- textDecoration: 'underline',
19172
- textDecorationColor: color,
19173
- textDecorationThickness: '4px',
19174
- textUnderlineOffset: '4px'
19175
- }
19172
+ textDecoration: 'underline',
19173
+ textDecorationColor: color,
19174
+ textDecorationThickness: '4px',
19175
+ textUnderlineOffset: '4px'
19176
19176
  }),
19177
19177
  background: color => ({
19178
19178
  backgroundColor: color,
@@ -19181,21 +19181,17 @@
19181
19181
  borderRadius: '4px'
19182
19182
  }),
19183
19183
  gradient: (color, secondaryColor) => ({
19184
- style: {
19185
- background: "linear-gradient(135deg, " + color + ", " + (secondaryColor || color) + ")",
19186
- backgroundClip: 'text',
19187
- WebkitBackgroundClip: 'text',
19188
- WebkitTextFillColor: 'transparent'
19189
- },
19184
+ background: "linear-gradient(135deg, " + color + ", " + (secondaryColor || color) + ")",
19185
+ backgroundClip: 'text',
19186
+ WebkitBackgroundClip: 'text !important',
19187
+ WebkitTextFillColor: 'transparent',
19190
19188
  color: 'transparent',
19191
19189
  display: 'inline-block',
19192
19190
  textShadow: 'none'
19193
19191
  }),
19194
19192
  outline: color => ({
19195
- style: {
19196
- WebkitTextStroke: "1px " + color,
19197
- WebkitTextFillColor: 'transparent'
19198
- },
19193
+ WebkitTextStroke: "1px " + color,
19194
+ WebkitTextFillColor: 'transparent !important',
19199
19195
  color: 'transparent',
19200
19196
  textShadow: 'none'
19201
19197
  }),
@@ -19272,18 +19268,17 @@
19272
19268
  }, [textArray, currentTextIndex, charIndex, isComplete, onComplete, pauseTime, typingSpeed]);
19273
19269
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, displayedText.map((text, index) => (/*#__PURE__*/React__default.createElement(React__default.Fragment, {
19274
19270
  key: index
19275
- }, text, showCursor && index === currentTextIndex && !isComplete && (/*#__PURE__*/React__default.createElement(appStudio.Text, {
19271
+ }, text, showCursor && index === currentTextIndex && !isComplete && (/*#__PURE__*/React__default.createElement(appStudio.Text, Object.assign({
19276
19272
  as: "span",
19277
19273
  display: "inline-block",
19278
19274
  width: "0.1em",
19279
19275
  height: "1em",
19280
- backgroundColor: cursorColor,
19281
- style: Object.assign({
19282
- animation: 'blink 1s step-end infinite',
19283
- verticalAlign: 'text-bottom',
19284
- marginLeft: '1px'
19285
- }, textStyle)
19286
- }))))));
19276
+ backgroundColor: cursorColor
19277
+ }, Object.assign({
19278
+ animation: 'blink 1s step-end infinite',
19279
+ verticalAlign: 'text-bottom',
19280
+ marginLeft: '1px'
19281
+ }, textStyle))))))));
19287
19282
  };
19288
19283
 
19289
19284
  var _excluded$_ = ["text", "duration", "direction", "stagger", "sequential", "textStyle", "as", "wordProps"],
@@ -19459,13 +19454,11 @@
19459
19454
  key: animKey + "-" + index,
19460
19455
  as: "span",
19461
19456
  animate: wordAnimation
19462
- }, restWordProps, {
19463
- style: wordStyle
19464
- }), word);
19457
+ }, restWordProps, wordStyle), word);
19465
19458
  })));
19466
19459
  };
19467
19460
 
19468
- var _excluded$$ = ["children", "highlightText", "highlightStyle", "highlightColor", "highlightSecondaryColor", "size", "responsive", "views", "highlightAnimate", "animate", "animationLoop", "highlightAnimationLoop", "highlightTypewriter", "highlightTypewriterDuration", "highlightSlide", "highlightSlideDuration", "highlightSlideStagger", "highlightSlideSequential"];
19461
+ var _excluded$$ = ["children", "highlightText", "highlightStyle", "highlightColor", "highlightSecondaryColor", "size", "responsive", "views", "highlightAnimate", "animate", "animationLoop", "highlightAnimationLoop", "highlightTypewriter", "highlightTypewriterDuration", "highlightSlide", "highlightSlideDuration", "highlightSlideStagger", "highlightSlideSequential", "themeMode"];
19469
19462
  function escapeRegExp(string) {
19470
19463
  return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
19471
19464
  }
@@ -19488,13 +19481,42 @@
19488
19481
  highlightSlide: propHighlightSlide = false,
19489
19482
  highlightSlideDuration = 500,
19490
19483
  highlightSlideStagger = 50,
19491
- highlightSlideSequential = true
19484
+ highlightSlideSequential = true,
19485
+ themeMode: elementMode
19492
19486
  } = _ref,
19493
19487
  props = _objectWithoutPropertiesLoose(_ref, _excluded$$);
19494
19488
  var {
19495
19489
  ref,
19496
19490
  inView
19497
19491
  } = appStudio.useInView();
19492
+ var {
19493
+ getColor,
19494
+ themeMode,
19495
+ theme
19496
+ } = appStudio.useTheme();
19497
+ var currentThemeMode = elementMode || themeMode;
19498
+ var resolvedHighlightColor = getColor(highlightColor, {
19499
+ themeMode: currentThemeMode
19500
+ });
19501
+ // Fallback: If getColor returns the token itself (resolution failed), try manual lookup in theme object
19502
+ if (resolvedHighlightColor === highlightColor && highlightColor.startsWith('theme.') && theme) {
19503
+ var tokenPath = highlightColor.replace('theme.', '');
19504
+ var value = tokenPath.split('.').reduce((acc, part) => acc && acc[part], theme);
19505
+ if (typeof value === 'string') {
19506
+ resolvedHighlightColor = value;
19507
+ }
19508
+ }
19509
+ var resolvedHighlightSecondaryColor = highlightSecondaryColor ? getColor(highlightSecondaryColor, {
19510
+ themeMode: currentThemeMode
19511
+ }) : undefined;
19512
+ // Fallback for secondary color
19513
+ if (highlightSecondaryColor && resolvedHighlightSecondaryColor === highlightSecondaryColor && highlightSecondaryColor.startsWith('theme.') && theme) {
19514
+ var _tokenPath = highlightSecondaryColor.replace('theme.', '');
19515
+ var _value = _tokenPath.split('.').reduce((acc, part) => acc && acc[part], theme);
19516
+ if (typeof _value === 'string') {
19517
+ resolvedHighlightSecondaryColor = _value;
19518
+ }
19519
+ }
19498
19520
  var {
19499
19521
  finalDisplayedText,
19500
19522
  activeHighlightTarget,
@@ -19519,7 +19541,7 @@
19519
19541
  var fontSize = TitleSizes[size];
19520
19542
  var responsiveStyles = useResponsive ? ResponsiveTypography[size] : null;
19521
19543
  // Highlight style props
19522
- var highlightProps = HighlightStyles[highlightStyle](highlightColor, highlightSecondaryColor);
19544
+ var highlightProps = HighlightStyles[highlightStyle](resolvedHighlightColor, resolvedHighlightSecondaryColor);
19523
19545
  // Apply loop control to animations
19524
19546
  var applyAnimationLoop = (animation, loopControl) => {
19525
19547
  if (!animation) return animation;