@app-studio/web 0.9.59 → 0.9.60

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.esm.js CHANGED
@@ -9804,7 +9804,7 @@ var TextAreaView = _ref => {
9804
9804
  maxHeight: 'calc(100vh - 100px)',
9805
9805
  height: 'calc(5em)',
9806
9806
  border: 'none',
9807
- resize: 'vertical',
9807
+ // resize property removed to avoid type error, added via style prop
9808
9808
  // Focus state
9809
9809
  on: {
9810
9810
  focus: {
@@ -9881,8 +9881,12 @@ var TextAreaView = _ref => {
9881
9881
  onBlur: handleBlur,
9882
9882
  onFocus: handleFocus,
9883
9883
  multiline: "" + !!isMultiline.toString(),
9884
- onChange: handleChange
9885
- }, fieldStyles, views == null ? void 0 : views.textarea)))));
9884
+ onChange: e => handleChange(e)
9885
+ }, fieldStyles, {
9886
+ style: {
9887
+ resize: 'vertical'
9888
+ }
9889
+ }, views == null ? void 0 : views.textarea)))));
9886
9890
  };
9887
9891
 
9888
9892
  // Defines the TextAreaComponent as a functional component that accepts TextAreaProps for type safety and structure.
@@ -10739,7 +10743,7 @@ var DefaultColorPalette = [
10739
10743
  value: 'transparent'
10740
10744
  }];
10741
10745
 
10742
- var _excluded$y = ["id", "name", "label", "placeholder", "helperText", "views", "size", "shape", "variant", "shadow", "error", "isDisabled", "isReadOnly", "isFocused", "isHovered", "predefinedColors", "showCustomInput", "showRecentColors", "isOpen", "selectedColor", "recentColors", "customColor", "handleToggle", "handleColorSelect", "handleCustomColorChange", "handleCustomColorSubmit", "setIsFocused", "setIsHovered", "triggerRef", "dropdownRef"];
10746
+ var _excluded$y = ["id", "name", "label", "placeholder", "helperText", "views", "size", "shape", "variant", "shadow", "error", "isDisabled", "isReadOnly", "isFocused", "isHovered", "predefinedColors", "showCustomInput", "showRecentColors", "isOpen", "selectedColor", "recentColors", "customColor", "handleToggle", "handleColorSelect", "handleCustomColorChange", "handleCustomColorSubmit", "setIsFocused", "setIsHovered", "triggerRef", "dropdownRef", "onChange"];
10743
10747
  var ColorInputView = _ref => {
10744
10748
  var {
10745
10749
  // Basic props
@@ -15787,7 +15791,7 @@ var AudioRecorder = _ref => {
15787
15791
  }))));
15788
15792
  };
15789
15793
 
15790
- var _excluded$M = ["onSubmit", "placeholder", "loading", "disabled", "isAgentRunning", "enableAudioRecording", "leftButtons", "rightButtons", "onStopAgent", "loadingText", "autoFocus", "sandboxId", "hideAttachments", "attachmentText", "promptExamples", "suggestions", "errorMessage", "size", "shape", "variant", "views", "mentionData", "mentionTrigger", "onMentionSelect", "onAudioRecordingStart", "onAudioRecordingStop", "value", "handleChange", "handleSubmit", "editableRef", "fileInputRef", "isUploading", "uploadProgress", "isDraggingOver", "uploadedFiles", "removeUploadedFile", "setPendingFiles", "setUploadedFiles", "setIsUploading", "startUpload", "selectedModel", "handleModelChange", "modelOptions", "subscriptionStatus", "canAccessModel", "isGuideTipShown", "hideGuideTip", "handlePromptExampleSelect", "handleDragOver", "handleDragLeave"];
15794
+ var _excluded$M = ["onSubmit", "placeholder", "loading", "disabled", "isAgentRunning", "enableAudioRecording", "leftButtons", "rightButtons", "onStopAgent", "loadingText", "autoFocus", "sandboxId", "hideAttachments", "attachmentText", "promptExamples", "suggestions", "errorMessage", "size", "shape", "variant", "views", "mentionData", "mentionTrigger", "onMentionSelect", "onAudioRecordingStart", "onAudioRecordingStop", "value", "handleChange", "handleSubmit", "editableRef", "fileInputRef", "isUploading", "uploadProgress", "isDraggingOver", "uploadedFiles", "removeUploadedFile", "setPendingFiles", "setUploadedFiles", "setIsUploading", "startUpload", "selectedModel", "handleModelChange", "modelOptions", "subscriptionStatus", "canAccessModel", "isGuideTipShown", "hideGuideTip", "handlePromptExampleSelect", "handleDragOver", "handleDragLeave", "onChange"];
15791
15795
  var ChatInputView = _ref => {
15792
15796
  var _value$trim$length;
15793
15797
  var {
@@ -16567,7 +16571,7 @@ var OrientationStyles = {
16567
16571
  }
16568
16572
  };
16569
16573
 
16570
- var _excluded$S = ["min", "max", "step", "currentValue", "stepValues", "shape", "size", "variant", "orientation", "isDisabled", "showValue", "showTooltip", "backgroundColor", "label", "helperText", "themeMode", "shadow", "isDragging", "isHovered", "setIsHovered", "trackRef", "thumbRef", "handleThumbMouseDown", "handleTrackMouseDown", "handleKeyDown", "thumbPositionPercent", "ariaLabel", "views"];
16574
+ var _excluded$S = ["min", "max", "step", "currentValue", "stepValues", "shape", "size", "variant", "orientation", "isDisabled", "showValue", "showTooltip", "backgroundColor", "label", "helperText", "themeMode", "shadow", "isDragging", "isHovered", "setIsHovered", "trackRef", "thumbRef", "handleThumbMouseDown", "handleTrackMouseDown", "handleKeyDown", "thumbPositionPercent", "ariaLabel", "views", "onChange", "onDrag"];
16571
16575
  var SliderView = _ref => {
16572
16576
  var _views$tooltip, _views$tooltip2;
16573
16577
  var {
@@ -19194,10 +19198,12 @@ var ResponsiveTypography = {
19194
19198
  */
19195
19199
  var HighlightStyles = {
19196
19200
  underline: color => ({
19197
- textDecoration: 'underline',
19198
- textDecorationColor: color,
19199
- textDecorationThickness: '4px',
19200
- textUnderlineOffset: '4px'
19201
+ style: {
19202
+ textDecoration: 'underline',
19203
+ textDecorationColor: color,
19204
+ textDecorationThickness: '4px',
19205
+ textUnderlineOffset: '4px'
19206
+ }
19201
19207
  }),
19202
19208
  background: color => ({
19203
19209
  backgroundColor: color,
@@ -19206,17 +19212,21 @@ var HighlightStyles = {
19206
19212
  borderRadius: '4px'
19207
19213
  }),
19208
19214
  gradient: (color, secondaryColor) => ({
19209
- background: "linear-gradient(135deg, " + color + ", " + (secondaryColor || color) + ")",
19210
- backgroundClip: 'text !important',
19211
- webkitBackgroundClip: 'text !important',
19215
+ style: {
19216
+ background: "linear-gradient(135deg, " + color + ", " + (secondaryColor || color) + ")",
19217
+ backgroundClip: 'text',
19218
+ WebkitBackgroundClip: 'text',
19219
+ WebkitTextFillColor: 'transparent'
19220
+ },
19212
19221
  color: 'transparent',
19213
- webkitTextFillColor: 'transparent',
19214
19222
  display: 'inline-block',
19215
19223
  textShadow: 'none'
19216
19224
  }),
19217
19225
  outline: color => ({
19218
- webkitTextStroke: "1px " + color,
19219
- webkitTextFillColor: 'transparent',
19226
+ style: {
19227
+ WebkitTextStroke: "1px " + color,
19228
+ WebkitTextFillColor: 'transparent'
19229
+ },
19220
19230
  color: 'transparent',
19221
19231
  textShadow: 'none'
19222
19232
  }),
@@ -19516,31 +19526,6 @@ var TitleView = _ref => {
19516
19526
  ref,
19517
19527
  inView
19518
19528
  } = useInView();
19519
- var {
19520
- getColor,
19521
- themeMode: ctxMode
19522
- } = useTheme();
19523
- var themeMode = props.themeMode || ctxMode;
19524
- // Resolve colors, handling both theme colors and direct hex values
19525
- var resolveColorValue = colorValue => {
19526
- // If it's already a hex color, return it directly
19527
- if (colorValue.startsWith('#')) {
19528
- return colorValue;
19529
- }
19530
- // Otherwise, use the theme's getColor function
19531
- return getColor(colorValue, {
19532
- themeMode
19533
- });
19534
- };
19535
- var resolvedColor = resolveColorValue(highlightColor);
19536
- var resolvedSecondary = highlightSecondaryColor ? resolveColorValue(highlightSecondaryColor) : undefined;
19537
- var baseHighlightProps = HighlightStyles[highlightStyle](resolvedColor, resolvedSecondary);
19538
- var highlightViewProps = highlightStyle === 'background' ? Object.assign({}, baseHighlightProps, {
19539
- color: undefined
19540
- }) : baseHighlightProps;
19541
- var highlightBackgroundOverrides = highlightStyle === 'background' ? {
19542
- bgColor: resolvedColor
19543
- } : {};
19544
19529
  var {
19545
19530
  finalDisplayedText,
19546
19531
  activeHighlightTarget,
@@ -19560,12 +19545,13 @@ var TitleView = _ref => {
19560
19545
  highlightSlideStagger,
19561
19546
  highlightSlideSequential
19562
19547
  }, props));
19563
- // Determine if we should use responsive sizing or static sizing
19564
- var useResponsive = responsive && !props.media; // Don't override if media prop is already provided
19548
+ // Common style calculations
19549
+ var useResponsive = responsive && !props.media;
19565
19550
  var fontSize = TitleSizes[size];
19566
- // Get responsive styles if responsive prop is true
19567
19551
  var responsiveStyles = useResponsive ? ResponsiveTypography[size] : null;
19568
- // Helper function to apply loop control to animations
19552
+ // Highlight style props
19553
+ var highlightProps = HighlightStyles[highlightStyle](highlightColor, highlightSecondaryColor);
19554
+ // Apply loop control to animations
19569
19555
  var applyAnimationLoop = (animation, loopControl) => {
19570
19556
  if (!animation) return animation;
19571
19557
  if (Array.isArray(animation)) {
@@ -19577,109 +19563,88 @@ var TitleView = _ref => {
19577
19563
  iterationCount: loopControl.toString()
19578
19564
  });
19579
19565
  };
19580
- // Apply loop control to animations
19581
19566
  var controlledAnimate = applyAnimationLoop(animate, animationLoop);
19582
19567
  var controlledHighlightAnimate = applyAnimationLoop(highlightAnimate, highlightAnimationLoop);
19583
19568
  // Get the text to display
19584
19569
  var text = typeof finalDisplayedText === 'string' ? finalDisplayedText : typeof children === 'string' ? children : '';
19570
+ // Common container props
19571
+ var containerProps = {
19572
+ ref,
19573
+ as: 'h1',
19574
+ fontSize: useResponsive ? undefined : fontSize,
19575
+ fontWeight: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.fontWeight : 'bold',
19576
+ letterSpacing: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.letterSpacing : undefined,
19577
+ marginBottom: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.marginBottom : undefined,
19578
+ animate: inView ? controlledAnimate : undefined,
19579
+ media: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.media : undefined
19580
+ };
19581
+ // Render highlighted text content (typewriter, slide, or plain)
19582
+ var renderHighlightedContent = content => {
19583
+ // If animations are enabled but not in view, render invisible placeholder
19584
+ // This holds layout space and prevents animations (like typewriter) from running off-screen
19585
+ if (!inView && (highlightTypewriter || highlightSlide)) {
19586
+ return /*#__PURE__*/React.createElement("span", {
19587
+ style: {
19588
+ opacity: 0
19589
+ }
19590
+ }, content);
19591
+ }
19592
+ if (highlightTypewriter) {
19593
+ return /*#__PURE__*/React.createElement(TypewriterEffect, Object.assign({
19594
+ text: content,
19595
+ typingSpeed: Math.max(30, highlightTypewriterDuration / (content.length * 10)),
19596
+ showCursor: true,
19597
+ cursorColor: "currentColor"
19598
+ }, highlightProps));
19599
+ }
19600
+ if (highlightSlide) {
19601
+ return /*#__PURE__*/React.createElement(SlideEffect, {
19602
+ text: content,
19603
+ duration: stateHighlightSlideDuration,
19604
+ stagger: stateHighlightSlideStagger,
19605
+ sequential: stateHighlightSlideSequential,
19606
+ direction: "up",
19607
+ fontSize: useResponsive ? undefined : fontSize,
19608
+ fontWeight: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.fontWeight : 'bold',
19609
+ wordProps: highlightProps
19610
+ });
19611
+ }
19612
+ return content;
19613
+ };
19614
+ // Case 1: Has highlight target - render with highlighted parts
19585
19615
  if (typeof text === 'string' && activeHighlightTarget) {
19586
- var pattern = (() => {
19587
- if (Array.isArray(activeHighlightTarget)) {
19588
- var escaped = activeHighlightTarget.map(t => escapeRegExp(String(t)));
19589
- return new RegExp("(" + escaped.join('|') + ")", 'gi');
19590
- }
19591
- return new RegExp("(" + escapeRegExp(String(activeHighlightTarget)) + ")", 'gi');
19592
- })();
19616
+ var pattern = Array.isArray(activeHighlightTarget) ? new RegExp("(" + activeHighlightTarget.map(t => escapeRegExp(String(t))).join('|') + ")", 'gi') : new RegExp("(" + escapeRegExp(String(activeHighlightTarget)) + ")", 'gi');
19593
19617
  var parts = [];
19594
19618
  var lastIndex = 0;
19595
19619
  var match;
19596
19620
  while (match = pattern.exec(text)) {
19597
- if (match.index > lastIndex) {
19598
- parts.push(text.substring(lastIndex, match.index));
19599
- }
19621
+ if (match.index > lastIndex) parts.push(text.substring(lastIndex, match.index));
19600
19622
  parts.push({
19601
19623
  highlight: true,
19602
19624
  text: match[0]
19603
19625
  });
19604
19626
  lastIndex = match.index + match[0].length;
19605
19627
  }
19606
- if (lastIndex < text.length) {
19607
- parts.push(text.substring(lastIndex));
19608
- }
19609
- return /*#__PURE__*/React.createElement(Element, Object.assign({
19610
- ref: ref,
19611
- as: "h1",
19612
- fontSize: useResponsive ? undefined : fontSize,
19613
- fontWeight: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.fontWeight : 'bold',
19614
- letterSpacing: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.letterSpacing : undefined,
19615
- marginBottom: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.marginBottom : undefined,
19616
- animate: inView ? controlledAnimate : undefined,
19617
- media: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.media : undefined
19618
- }, views == null ? void 0 : views.container, props), parts.map((part, idx) => typeof part === 'string' ? part : (/*#__PURE__*/React.createElement(Text, Object.assign({
19628
+ if (lastIndex < text.length) parts.push(text.substring(lastIndex));
19629
+ return /*#__PURE__*/React.createElement(Element, Object.assign({}, containerProps, views == null ? void 0 : views.container, props), parts.map((part, idx) => typeof part === 'string' ? part : (/*#__PURE__*/React.createElement(Text, Object.assign({
19619
19630
  key: "highlight-" + idx,
19620
19631
  as: "span",
19621
19632
  display: "inline",
19622
19633
  animate: inView ? controlledHighlightAnimate : undefined,
19623
19634
  fontSize: useResponsive ? undefined : fontSize
19624
- }, !highlightSlide ? highlightViewProps : {}, highlightBackgroundOverrides, views == null ? void 0 : views.highlight), highlightTypewriter ? (/*#__PURE__*/React.createElement(TypewriterEffect, {
19625
- text: part.text,
19626
- typingSpeed: Math.max(30, highlightTypewriterDuration / (part.text.length * 10)),
19627
- showCursor: true,
19628
- cursorColor: "currentColor"
19629
- })) : highlightSlide ? (/*#__PURE__*/React.createElement(SlideEffect, {
19630
- text: part.text,
19631
- duration: stateHighlightSlideDuration,
19632
- stagger: stateHighlightSlideStagger,
19633
- sequential: stateHighlightSlideSequential,
19634
- direction: "up",
19635
- fontSize: useResponsive ? undefined : fontSize,
19636
- fontWeight: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.fontWeight : 'bold',
19637
- wordProps: highlightViewProps
19638
- })) : part.text))));
19635
+ }, !highlightSlide ? highlightProps : {}, views == null ? void 0 : views.highlight), renderHighlightedContent(part.text)))));
19639
19636
  }
19640
- // If highlightStyle is provided but no highlightText, apply the style to the entire title
19637
+ // Case 2: Has highlight style but no highlight target - apply style to entire title
19641
19638
  if (highlightStyle && !activeHighlightTarget) {
19642
- return /*#__PURE__*/React.createElement(Element, Object.assign({
19643
- ref: ref,
19644
- as: "h1",
19645
- fontSize: useResponsive ? undefined : fontSize,
19646
- fontWeight: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.fontWeight : 'bold',
19647
- letterSpacing: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.letterSpacing : undefined,
19648
- marginBottom: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.marginBottom : undefined,
19649
- animate: inView ? controlledAnimate : undefined,
19650
- media: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.media : undefined
19651
- }, views == null ? void 0 : views.container, props), /*#__PURE__*/React.createElement(Text, Object.assign({
19639
+ return /*#__PURE__*/React.createElement(Element, Object.assign({}, containerProps, views == null ? void 0 : views.container, props), /*#__PURE__*/React.createElement(Text, Object.assign({
19652
19640
  as: "span",
19653
19641
  fontSize: fontSize,
19654
19642
  display: "inline",
19655
19643
  animate: inView ? controlledHighlightAnimate : undefined
19656
- }, !highlightSlide ? highlightViewProps : {}, highlightBackgroundOverrides, views == null ? void 0 : views.highlight), highlightTypewriter ? (/*#__PURE__*/React.createElement(TypewriterEffect, {
19657
- text: text,
19658
- typingSpeed: Math.max(30, highlightTypewriterDuration / (text.length * 10)),
19659
- showCursor: true,
19660
- cursorColor: "currentColor"
19661
- })) : highlightSlide ? (/*#__PURE__*/React.createElement(SlideEffect, {
19662
- text: text,
19663
- duration: stateHighlightSlideDuration,
19664
- stagger: stateHighlightSlideStagger,
19665
- sequential: stateHighlightSlideSequential,
19666
- direction: "up",
19667
- fontSize: fontSize,
19668
- fontWeight: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.fontWeight : 'bold',
19669
- wordProps: highlightViewProps
19670
- })) : text));
19644
+ }, !highlightSlide ? highlightProps : {}, views == null ? void 0 : views.highlight), renderHighlightedContent(text)));
19671
19645
  }
19672
- // Default case - no highlighting
19673
- return /*#__PURE__*/React.createElement(Text, Object.assign({
19674
- ref: ref,
19675
- as: "h1",
19676
- fontSize: fontSize,
19677
- fontWeight: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.fontWeight : 'bold',
19678
- letterSpacing: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.letterSpacing : undefined,
19679
- marginBottom: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.marginBottom : undefined,
19680
- animate: inView ? controlledAnimate : undefined,
19681
- media: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.media : undefined
19682
- }, views == null ? void 0 : views.container, props), text);
19646
+ // Case 3: Default - no highlighting
19647
+ return /*#__PURE__*/React.createElement(Text, Object.assign({}, containerProps, views == null ? void 0 : views.container, props), text);
19683
19648
  };
19684
19649
 
19685
19650
  /**
@@ -20946,7 +20911,7 @@ var DefaultColorPalette$1 = [
20946
20911
  category: 'neutral'
20947
20912
  }];
20948
20913
 
20949
- var _excluded$14 = ["id", "name", "label", "placeholder", "helperText", "views", "size", "shape", "variant", "error", "isDisabled", "isReadOnly", "predefinedColors", "showCustomInput", "showRecentColors", "isOpen", "selectedColor", "recentColors", "customColor", "handleToggle", "handleColorSelect", "handleCustomColorChange", "handleCustomColorSubmit", "triggerRef", "dropdownRef"];
20914
+ var _excluded$14 = ["id", "name", "label", "placeholder", "helperText", "views", "size", "shape", "variant", "error", "isDisabled", "isReadOnly", "predefinedColors", "showCustomInput", "showRecentColors", "isOpen", "selectedColor", "recentColors", "customColor", "handleToggle", "handleColorSelect", "handleCustomColorChange", "handleCustomColorSubmit", "triggerRef", "dropdownRef", "onChange"];
20950
20915
  var ColorPickerView = _ref => {
20951
20916
  var {
20952
20917
  // Basic props
@@ -23313,7 +23278,7 @@ var useEmojiPickerState = props => {
23313
23278
  };
23314
23279
  };
23315
23280
 
23316
- var _excluded$15 = ["id", "name", "label", "placeholder", "helperText", "views", "size", "shape", "variant", "error", "isDisabled", "isReadOnly", "showSearch", "showCategories", "showRecentEmojis", "enabledCategories", "isOpen", "selectedEmoji", "recentEmojis", "searchQuery", "activeCategory", "filteredEmojis", "handleToggle", "handleEmojiSelect", "handleSearchChange", "handleCategoryChange", "triggerRef", "dropdownRef"];
23281
+ var _excluded$15 = ["id", "name", "label", "placeholder", "helperText", "views", "size", "shape", "variant", "error", "isDisabled", "isReadOnly", "showSearch", "showCategories", "showRecentEmojis", "enabledCategories", "isOpen", "selectedEmoji", "recentEmojis", "searchQuery", "activeCategory", "filteredEmojis", "handleToggle", "handleEmojiSelect", "handleSearchChange", "handleCategoryChange", "triggerRef", "dropdownRef", "onChange"];
23317
23282
  var EmojiPickerView = _ref => {
23318
23283
  var {
23319
23284
  // Basic props
@@ -24481,7 +24446,7 @@ var SeparatorView = _ref => {
24481
24446
  var borderWidth = SeparatorThicknesses[thickness];
24482
24447
  // Set appropriate ARIA attributes based on decorative prop
24483
24448
  var ariaProps = decorative ? {
24484
- 'aria-hidden': 'true'
24449
+ 'aria-hidden': true
24485
24450
  } : {
24486
24451
  role: 'separator',
24487
24452
  'aria-orientation': orientation