@app-studio/web 0.9.75 → 0.9.77

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.
@@ -1,6 +1,6 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('core-js/modules/es.object.assign.js'), require('react'), require('core-js/modules/es.array.includes.js'), require('core-js/modules/es.array.iterator.js'), require('core-js/modules/es.string.includes.js'), require('core-js/modules/web.dom-collections.iterator.js'), require('core-js/modules/es.regexp.to-string.js'), require('app-studio'), require('core-js/modules/es.symbol.description.js'), require('lucide-react/dynamic'), require('core-js/modules/es.array-buffer.constructor.js'), require('core-js/modules/es.array-buffer.slice.js'), require('core-js/modules/es.typed-array.uint8-array.js'), require('core-js/modules/es.typed-array.fill.js'), require('core-js/modules/es.typed-array.set.js'), require('core-js/modules/es.typed-array.sort.js'), require('core-js/modules/es.typed-array.to-locale-string.js'), require('core-js/modules/es.string.starts-with.js'), require('core-js/modules/web.url.js'), require('core-js/modules/web.url.to-json.js'), require('core-js/modules/web.url-search-params.js'), require('zustand'), require('core-js/modules/es.parse-int.js'), require('react-router-dom'), require('core-js/modules/es.parse-float.js'), require('core-js/modules/es.string.ends-with.js'), require('contrast'), require('core-js/modules/es.promise.js'), require('core-js/modules/es.array.reduce.js'), require('core-js/modules/es.number.to-fixed.js'), require('date-fns/format'), require('core-js/modules/es.string.trim.js'), require('core-js/modules/es.regexp.constructor.js'), require('core-js/modules/es.regexp.exec.js'), require('formik'), require('core-js/modules/es.string.replace.js'), require('core-js/modules/es.promise.finally.js'), require('core-js/modules/es.string.match.js'), require('core-js/modules/es.string.search.js'), require('core-js/modules/es.array.flat-map.js'), require('core-js/modules/es.array.unscopables.flat-map.js')) :
3
- typeof define === 'function' && define.amd ? define(['exports', 'core-js/modules/es.object.assign.js', 'react', 'core-js/modules/es.array.includes.js', 'core-js/modules/es.array.iterator.js', 'core-js/modules/es.string.includes.js', 'core-js/modules/web.dom-collections.iterator.js', 'core-js/modules/es.regexp.to-string.js', 'app-studio', 'core-js/modules/es.symbol.description.js', 'lucide-react/dynamic', 'core-js/modules/es.array-buffer.constructor.js', 'core-js/modules/es.array-buffer.slice.js', 'core-js/modules/es.typed-array.uint8-array.js', 'core-js/modules/es.typed-array.fill.js', 'core-js/modules/es.typed-array.set.js', 'core-js/modules/es.typed-array.sort.js', 'core-js/modules/es.typed-array.to-locale-string.js', 'core-js/modules/es.string.starts-with.js', 'core-js/modules/web.url.js', 'core-js/modules/web.url.to-json.js', 'core-js/modules/web.url-search-params.js', 'zustand', 'core-js/modules/es.parse-int.js', 'react-router-dom', 'core-js/modules/es.parse-float.js', 'core-js/modules/es.string.ends-with.js', 'contrast', 'core-js/modules/es.promise.js', 'core-js/modules/es.array.reduce.js', 'core-js/modules/es.number.to-fixed.js', 'date-fns/format', 'core-js/modules/es.string.trim.js', 'core-js/modules/es.regexp.constructor.js', 'core-js/modules/es.regexp.exec.js', 'formik', 'core-js/modules/es.string.replace.js', 'core-js/modules/es.promise.finally.js', 'core-js/modules/es.string.match.js', 'core-js/modules/es.string.search.js', 'core-js/modules/es.array.flat-map.js', 'core-js/modules/es.array.unscopables.flat-map.js'], factory) :
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('core-js/modules/es.object.assign.js'), require('react'), require('core-js/modules/es.array.includes.js'), require('core-js/modules/es.array.iterator.js'), require('core-js/modules/es.string.includes.js'), require('core-js/modules/web.dom-collections.iterator.js'), require('core-js/modules/es.regexp.to-string.js'), require('app-studio'), require('core-js/modules/es.symbol.description.js'), require('lucide-react/dynamic'), require('core-js/modules/es.array-buffer.constructor.js'), require('core-js/modules/es.array-buffer.slice.js'), require('core-js/modules/es.typed-array.uint8-array.js'), require('core-js/modules/es.typed-array.fill.js'), require('core-js/modules/es.typed-array.set.js'), require('core-js/modules/es.typed-array.sort.js'), require('core-js/modules/es.typed-array.to-locale-string.js'), require('core-js/modules/es.string.starts-with.js'), require('core-js/modules/web.url.js'), require('core-js/modules/web.url.to-json.js'), require('core-js/modules/web.url-search-params.js'), require('zustand'), require('core-js/modules/es.parse-int.js'), require('react-router-dom'), require('core-js/modules/es.parse-float.js'), require('core-js/modules/es.string.ends-with.js'), require('contrast'), require('core-js/modules/es.promise.js'), require('core-js/modules/es.array.reduce.js'), require('core-js/modules/es.number.to-fixed.js'), require('date-fns/format'), require('core-js/modules/es.string.trim.js'), require('core-js/modules/es.regexp.constructor.js'), require('core-js/modules/es.regexp.exec.js'), require('formik'), require('core-js/modules/es.string.replace.js'), require('core-js/modules/es.string.split.js'), require('core-js/modules/es.promise.finally.js'), require('core-js/modules/es.string.match.js'), require('core-js/modules/es.string.search.js'), require('core-js/modules/es.array.flat-map.js'), require('core-js/modules/es.array.unscopables.flat-map.js')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', 'core-js/modules/es.object.assign.js', 'react', 'core-js/modules/es.array.includes.js', 'core-js/modules/es.array.iterator.js', 'core-js/modules/es.string.includes.js', 'core-js/modules/web.dom-collections.iterator.js', 'core-js/modules/es.regexp.to-string.js', 'app-studio', 'core-js/modules/es.symbol.description.js', 'lucide-react/dynamic', 'core-js/modules/es.array-buffer.constructor.js', 'core-js/modules/es.array-buffer.slice.js', 'core-js/modules/es.typed-array.uint8-array.js', 'core-js/modules/es.typed-array.fill.js', 'core-js/modules/es.typed-array.set.js', 'core-js/modules/es.typed-array.sort.js', 'core-js/modules/es.typed-array.to-locale-string.js', 'core-js/modules/es.string.starts-with.js', 'core-js/modules/web.url.js', 'core-js/modules/web.url.to-json.js', 'core-js/modules/web.url-search-params.js', 'zustand', 'core-js/modules/es.parse-int.js', 'react-router-dom', 'core-js/modules/es.parse-float.js', 'core-js/modules/es.string.ends-with.js', 'contrast', 'core-js/modules/es.promise.js', 'core-js/modules/es.array.reduce.js', 'core-js/modules/es.number.to-fixed.js', 'date-fns/format', 'core-js/modules/es.string.trim.js', 'core-js/modules/es.regexp.constructor.js', 'core-js/modules/es.regexp.exec.js', 'formik', 'core-js/modules/es.string.replace.js', 'core-js/modules/es.string.split.js', 'core-js/modules/es.promise.finally.js', 'core-js/modules/es.string.match.js', 'core-js/modules/es.string.search.js', 'core-js/modules/es.array.flat-map.js', 'core-js/modules/es.array.unscopables.flat-map.js'], factory) :
4
4
  (global = global || self, factory(global['@app-studio/web'] = {}, null, global.React, null, null, null, null, null, global.appStudio, null, global.dynamic, null, null, null, null, null, null, null, null, null, null, null, global.zustand, null, global.reactRouterDom, null, null, global.contrast, null, null, null, global.format, null, null, null, global.formik));
5
5
  }(this, (function (exports, es_object_assign_js, React, es_array_includes_js, es_array_iterator_js, es_string_includes_js, web_domCollections_iterator_js, es_regexp_toString_js, appStudio, es_symbol_description_js, dynamic, es_arrayBuffer_constructor_js, es_arrayBuffer_slice_js, es_typedArray_uint8Array_js, es_typedArray_fill_js, es_typedArray_set_js, es_typedArray_sort_js, es_typedArray_toLocaleString_js, es_string_startsWith_js, web_url_js, web_url_toJson_js, web_urlSearchParams_js, zustand, es_parseInt_js, reactRouterDom, es_parseFloat_js, es_string_endsWith_js, contrast, es_promise_js, es_array_reduce_js, es_number_toFixed_js, format, es_string_trim_js, es_regexp_constructor_js, es_regexp_exec_js, formik) { 'use strict';
6
6
 
@@ -17016,82 +17016,6 @@
17016
17016
  lg: 64,
17017
17017
  xl: 72
17018
17018
  };
17019
- /**
17020
- * Responsive typography system that maps title sizes to responsive breakpoints
17021
- * Based on the Typography system with dynamic breakpoint sizing
17022
- */
17023
- var ResponsiveTypography = {
17024
- // xl maps to H1 - Largest heading
17025
- xl: {
17026
- media: {
17027
- mobile: {
17028
- fontSize: 60
17029
- },
17030
- tablet: {
17031
- fontSize: 60
17032
- },
17033
- desktop: {
17034
- fontSize: 96
17035
- }
17036
- }
17037
- },
17038
- // lg maps to H2 - Large heading
17039
- lg: {
17040
- media: {
17041
- mobile: {
17042
- fontSize: 48
17043
- },
17044
- tablet: {
17045
- fontSize: 48
17046
- },
17047
- desktop: {
17048
- fontSize: 70
17049
- }
17050
- }
17051
- },
17052
- // md maps to H3 - Medium heading
17053
- md: {
17054
- media: {
17055
- mobile: {
17056
- fontSize: 32
17057
- },
17058
- tablet: {
17059
- fontSize: 40
17060
- },
17061
- desktop: {
17062
- fontSize: 56
17063
- }
17064
- }
17065
- },
17066
- // sm maps to T1 - Title text
17067
- sm: {
17068
- media: {
17069
- mobile: {
17070
- fontSize: 20
17071
- },
17072
- tablet: {
17073
- fontSize: 24
17074
- },
17075
- desktop: {
17076
- fontSize: 32
17077
- }
17078
- }
17079
- },
17080
- // xs maps to S1 - Subtitle text
17081
- xs: {
17082
- media: {
17083
- mobile: {
17084
- fontSize: 14
17085
- },
17086
- tablet: {
17087
- fontSize: 18
17088
- },
17089
- desktop: {
17090
- fontSize: 20
17091
- }
17092
- }
17093
- }
17094
- };
17095
17019
  /**
17096
17020
  * Default styles for different highlight types
17097
17021
  */
@@ -17197,9 +17121,17 @@
17197
17121
  }, typingSpeed);
17198
17122
  return () => clearTimeout(timeout);
17199
17123
  }, [textArray, currentTextIndex, charIndex, isComplete, onComplete, pauseTime, typingSpeed]);
17124
+ var renderWithLineBreaks = text => {
17125
+ if (!text || typeof text !== 'string') return text;
17126
+ var parts = text.split('|');
17127
+ if (parts.length === 1) return text;
17128
+ return parts.map((part, index) => (/*#__PURE__*/React__default.createElement(React__default.Fragment, {
17129
+ key: index
17130
+ }, part, index < parts.length - 1 && /*#__PURE__*/React__default.createElement("br", null))));
17131
+ };
17200
17132
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, displayedText.map((text, index) => (/*#__PURE__*/React__default.createElement(React__default.Fragment, {
17201
17133
  key: index
17202
- }, text, showCursor && index === currentTextIndex && !isComplete && (/*#__PURE__*/React__default.createElement(TextComponent, Object.assign({
17134
+ }, renderWithLineBreaks(text), showCursor && index === currentTextIndex && !isComplete && (/*#__PURE__*/React__default.createElement(TextComponent, Object.assign({
17203
17135
  as: "span",
17204
17136
  display: "inline-block",
17205
17137
  width: "0.1em",
@@ -17250,20 +17182,30 @@
17250
17182
  }
17251
17183
  }, [text, displayedText, phase]);
17252
17184
  // Calculate animation durations
17253
- var words = React.useMemo(() => displayedText.split(' '), [displayedText]);
17254
- var wordCount = words.length;
17185
+ var {
17186
+ lines,
17187
+ totalWordCount
17188
+ } = React.useMemo(() => {
17189
+ var rawLines = displayedText.split('|');
17190
+ var processedLines = rawLines.map(line => line.trim().split(/\s+/).filter(w => w.length > 0));
17191
+ var count = processedLines.reduce((acc, line) => acc + line.length, 0);
17192
+ return {
17193
+ lines: processedLines,
17194
+ totalWordCount: count
17195
+ };
17196
+ }, [displayedText]);
17255
17197
  var totalEnterDuration = React.useMemo(() => {
17256
17198
  if (sequential) {
17257
- return wordCount * (duration + stagger);
17199
+ return totalWordCount * (duration + stagger);
17258
17200
  }
17259
- return (wordCount - 1) * stagger + duration;
17260
- }, [wordCount, duration, stagger, sequential]);
17201
+ return (totalWordCount - 1) * stagger + duration;
17202
+ }, [totalWordCount, duration, stagger, sequential]);
17261
17203
  var totalExitDuration = React.useMemo(() => {
17262
17204
  if (sequential) {
17263
- return wordCount * (duration + stagger);
17205
+ return totalWordCount * (duration + stagger);
17264
17206
  }
17265
- return (wordCount - 1) * stagger + duration;
17266
- }, [wordCount, duration, stagger, sequential]);
17207
+ return (totalWordCount - 1) * stagger + duration;
17208
+ }, [totalWordCount, duration, stagger, sequential]);
17267
17209
  // Handle phase transitions
17268
17210
  React.useEffect(() => {
17269
17211
  if (timeoutRef.current) {
@@ -17312,24 +17254,32 @@
17312
17254
  var containerStyle = React.useMemo(() => Object.assign({
17313
17255
  display: 'inline-block',
17314
17256
  position: 'relative',
17315
- overflow: 'hidden',
17316
17257
  verticalAlign: 'bottom',
17317
- whiteSpace: 'nowrap'
17258
+ whiteSpace: 'nowrap',
17259
+ lineHeight: 'normal'
17318
17260
  }, textStyle), [textStyle]);
17319
- // Word row container style
17320
- var wordRowStyle = React.useMemo(() => ({
17261
+ var linesContainerStyle = React.useMemo(() => ({
17321
17262
  display: 'inline-flex',
17322
- flexWrap: 'nowrap',
17263
+ flexDirection: 'column',
17264
+ alignItems: 'center'
17265
+ }), []);
17266
+ var lineStyle = React.useMemo(() => ({
17267
+ display: 'block',
17323
17268
  whiteSpace: 'nowrap'
17324
17269
  }), []);
17270
+ var globalWordIndex = 0;
17325
17271
  return /*#__PURE__*/React__default.createElement(appStudio.Element, Object.assign({
17326
17272
  as: "span",
17327
17273
  style: containerStyle
17328
17274
  }, props), /*#__PURE__*/React__default.createElement("span", {
17329
- style: wordRowStyle
17330
- }, words.map((word, index) => {
17331
- var delay = getDelay(index);
17332
- var isLast = index === words.length - 1;
17275
+ style: linesContainerStyle
17276
+ }, lines.map((lineWords, lineIndex) => (/*#__PURE__*/React__default.createElement("span", {
17277
+ key: "line-" + lineIndex,
17278
+ style: lineStyle
17279
+ }, lineWords.map((word, wordIndex) => {
17280
+ var currentGlobalIndex = globalWordIndex++;
17281
+ var delay = getDelay(currentGlobalIndex);
17282
+ var isLastInLine = wordIndex === lineWords.length - 1;
17333
17283
  // Create animation based on phase and direction
17334
17284
  var wordAnimation;
17335
17285
  var durationStr = duration + "ms";
@@ -17348,7 +17298,7 @@
17348
17298
  fillMode: 'both'
17349
17299
  });
17350
17300
  } else if (phase === 'exiting') {
17351
- // Custom animation objects for exiting (slideOut not in app-studio yet)
17301
+ // Custom animation objects for exiting
17352
17302
  wordAnimation = isUp ? {
17353
17303
  from: {
17354
17304
  transform: 'translateY(0)',
@@ -17379,22 +17329,30 @@
17379
17329
  }
17380
17330
  var wordStyle = Object.assign({}, customWordStyle, {
17381
17331
  display: 'inline-block',
17382
- marginRight: isLast ? 0 : '0.25em',
17332
+ marginRight: isLastInLine ? 0 : '0.25em',
17383
17333
  transform: phase === 'visible' ? 'translateY(0)' : undefined,
17384
17334
  opacity: phase === 'visible' ? 1 : undefined
17385
17335
  });
17386
17336
  return /*#__PURE__*/React__default.createElement(TextComponent, Object.assign({
17387
- key: animKey + "-" + index,
17337
+ key: animKey + "-" + lineIndex + "-" + wordIndex,
17388
17338
  as: "span",
17389
17339
  animate: wordAnimation
17390
17340
  }, restWordProps, wordStyle), word);
17391
- })));
17341
+ }))))));
17392
17342
  };
17393
17343
 
17394
- var _excluded$$ = ["children", "highlightText", "highlightStyle", "highlightColor", "highlightSecondaryColor", "size", "responsive", "views", "highlightAnimate", "animate", "animationLoop", "highlightAnimationLoop", "highlightTypewriter", "highlightTypewriterDuration", "highlightSlide", "highlightSlideDuration", "highlightSlideStagger", "highlightSlideSequential", "themeMode", "textComponent"];
17344
+ var _excluded$$ = ["children", "highlightText", "highlightStyle", "highlightColor", "highlightSecondaryColor", "size", "views", "highlightAnimate", "animate", "animationLoop", "highlightAnimationLoop", "highlightTypewriter", "highlightTypewriterDuration", "highlightSlide", "highlightSlideDuration", "highlightSlideStagger", "highlightSlideSequential", "themeMode", "textComponent"];
17395
17345
  function escapeRegExp(string) {
17396
17346
  return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
17397
17347
  }
17348
+ var renderWithLineBreaks = text => {
17349
+ if (!text || typeof text !== 'string') return text;
17350
+ var parts = text.split('|');
17351
+ if (parts.length === 1) return text;
17352
+ return parts.map((part, index) => (/*#__PURE__*/React__default.createElement(React__default.Fragment, {
17353
+ key: index
17354
+ }, part, index < parts.length - 1 && /*#__PURE__*/React__default.createElement("br", null))));
17355
+ };
17398
17356
  var TitleView = _ref => {
17399
17357
  var {
17400
17358
  children,
@@ -17403,7 +17361,6 @@
17403
17361
  highlightColor = 'theme.primary',
17404
17362
  highlightSecondaryColor,
17405
17363
  size = 'lg',
17406
- responsive = true,
17407
17364
  views,
17408
17365
  highlightAnimate,
17409
17366
  animate,
@@ -17471,10 +17428,7 @@
17471
17428
  highlightSlideSequential
17472
17429
  }, props));
17473
17430
  var TextComponent = textComponent || appStudio.Text;
17474
- // Common style calculations
17475
- var useResponsive = responsive && !props.media;
17476
17431
  var fontSize = TitleSizes[size];
17477
- var responsiveStyles = useResponsive ? ResponsiveTypography[size] : null;
17478
17432
  // Highlight style props
17479
17433
  var highlightProps = HighlightStyles[highlightStyle](resolvedHighlightColor, resolvedHighlightSecondaryColor);
17480
17434
  // Apply loop control to animations
@@ -17499,8 +17453,7 @@
17499
17453
  animate: inView ? controlledAnimate : undefined
17500
17454
  }, !textComponent && {
17501
17455
  as: 'h1',
17502
- fontSize: useResponsive ? undefined : fontSize,
17503
- media: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.media : undefined
17456
+ fontSize
17504
17457
  });
17505
17458
  // Render highlighted text content (typewriter, slide, or plain)
17506
17459
  var renderHighlightedContent = content => {
@@ -17528,12 +17481,12 @@
17528
17481
  stagger: stateHighlightSlideStagger,
17529
17482
  sequential: stateHighlightSlideSequential,
17530
17483
  direction: "up",
17531
- fontSize: useResponsive ? undefined : fontSize,
17484
+ fontSize: fontSize,
17532
17485
  wordProps: highlightProps,
17533
17486
  textComponent: TextComponent
17534
17487
  });
17535
17488
  }
17536
- return content;
17489
+ return renderWithLineBreaks(content);
17537
17490
  };
17538
17491
  // Case 1: Has highlight target - render with highlighted parts
17539
17492
  if (typeof text === 'string' && activeHighlightTarget) {
@@ -17551,12 +17504,12 @@
17551
17504
  }
17552
17505
  if (lastIndex < text.length) parts.push(text.substring(lastIndex));
17553
17506
  return /*#__PURE__*/React__default.createElement(appStudio.Element, Object.assign({
17554
- fontSize: useResponsive ? undefined : fontSize
17507
+ fontSize: fontSize
17555
17508
  }, containerProps, views == null ? void 0 : views.container, props), parts.map((part, idx) => typeof part === 'string' ? (/*#__PURE__*/React__default.createElement(TextComponent, {
17556
17509
  key: "text-" + idx,
17557
17510
  as: "span",
17558
17511
  display: "inline"
17559
- }, part)) : (/*#__PURE__*/React__default.createElement(TextComponent, Object.assign({
17512
+ }, renderWithLineBreaks(part))) : (/*#__PURE__*/React__default.createElement(TextComponent, Object.assign({
17560
17513
  key: "highlight-" + idx,
17561
17514
  as: "span",
17562
17515
  display: "inline",
@@ -17574,7 +17527,7 @@
17574
17527
  }, !highlightSlide ? highlightProps : {}, views == null ? void 0 : views.highlight), renderHighlightedContent(text)));
17575
17528
  }
17576
17529
  // Case 3: Default - no highlighting
17577
- return /*#__PURE__*/React__default.createElement(TextComponent, Object.assign({}, containerProps, props, views == null ? void 0 : views.container), text);
17530
+ return /*#__PURE__*/React__default.createElement(TextComponent, Object.assign({}, containerProps, props, views == null ? void 0 : views.container), renderWithLineBreaks(text));
17578
17531
  };
17579
17532
 
17580
17533
  /**