@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.
@@ -9773,7 +9773,7 @@
9773
9773
  maxHeight: 'calc(100vh - 100px)',
9774
9774
  height: 'calc(5em)',
9775
9775
  border: 'none',
9776
- resize: 'vertical',
9776
+ // resize property removed to avoid type error, added via style prop
9777
9777
  // Focus state
9778
9778
  on: {
9779
9779
  focus: {
@@ -9850,8 +9850,12 @@
9850
9850
  onBlur: handleBlur,
9851
9851
  onFocus: handleFocus,
9852
9852
  multiline: "" + !!isMultiline.toString(),
9853
- onChange: handleChange
9854
- }, fieldStyles, views == null ? void 0 : views.textarea)))));
9853
+ onChange: e => handleChange(e)
9854
+ }, fieldStyles, {
9855
+ style: {
9856
+ resize: 'vertical'
9857
+ }
9858
+ }, views == null ? void 0 : views.textarea)))));
9855
9859
  };
9856
9860
 
9857
9861
  // Defines the TextAreaComponent as a functional component that accepts TextAreaProps for type safety and structure.
@@ -10708,7 +10712,7 @@
10708
10712
  value: 'transparent'
10709
10713
  }];
10710
10714
 
10711
- 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"];
10715
+ 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"];
10712
10716
  var ColorInputView = _ref => {
10713
10717
  var {
10714
10718
  // Basic props
@@ -15756,7 +15760,7 @@
15756
15760
  }))));
15757
15761
  };
15758
15762
 
15759
- 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"];
15763
+ 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"];
15760
15764
  var ChatInputView = _ref => {
15761
15765
  var _value$trim$length;
15762
15766
  var {
@@ -16536,7 +16540,7 @@
16536
16540
  }
16537
16541
  };
16538
16542
 
16539
- 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"];
16543
+ 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"];
16540
16544
  var SliderView = _ref => {
16541
16545
  var _views$tooltip, _views$tooltip2;
16542
16546
  var {
@@ -19163,10 +19167,12 @@
19163
19167
  */
19164
19168
  var HighlightStyles = {
19165
19169
  underline: color => ({
19166
- textDecoration: 'underline',
19167
- textDecorationColor: color,
19168
- textDecorationThickness: '4px',
19169
- textUnderlineOffset: '4px'
19170
+ style: {
19171
+ textDecoration: 'underline',
19172
+ textDecorationColor: color,
19173
+ textDecorationThickness: '4px',
19174
+ textUnderlineOffset: '4px'
19175
+ }
19170
19176
  }),
19171
19177
  background: color => ({
19172
19178
  backgroundColor: color,
@@ -19175,17 +19181,21 @@
19175
19181
  borderRadius: '4px'
19176
19182
  }),
19177
19183
  gradient: (color, secondaryColor) => ({
19178
- background: "linear-gradient(135deg, " + color + ", " + (secondaryColor || color) + ")",
19179
- backgroundClip: 'text !important',
19180
- webkitBackgroundClip: 'text !important',
19184
+ style: {
19185
+ background: "linear-gradient(135deg, " + color + ", " + (secondaryColor || color) + ")",
19186
+ backgroundClip: 'text',
19187
+ WebkitBackgroundClip: 'text',
19188
+ WebkitTextFillColor: 'transparent'
19189
+ },
19181
19190
  color: 'transparent',
19182
- webkitTextFillColor: 'transparent',
19183
19191
  display: 'inline-block',
19184
19192
  textShadow: 'none'
19185
19193
  }),
19186
19194
  outline: color => ({
19187
- webkitTextStroke: "1px " + color,
19188
- webkitTextFillColor: 'transparent',
19195
+ style: {
19196
+ WebkitTextStroke: "1px " + color,
19197
+ WebkitTextFillColor: 'transparent'
19198
+ },
19189
19199
  color: 'transparent',
19190
19200
  textShadow: 'none'
19191
19201
  }),
@@ -19485,31 +19495,6 @@
19485
19495
  ref,
19486
19496
  inView
19487
19497
  } = appStudio.useInView();
19488
- var {
19489
- getColor,
19490
- themeMode: ctxMode
19491
- } = appStudio.useTheme();
19492
- var themeMode = props.themeMode || ctxMode;
19493
- // Resolve colors, handling both theme colors and direct hex values
19494
- var resolveColorValue = colorValue => {
19495
- // If it's already a hex color, return it directly
19496
- if (colorValue.startsWith('#')) {
19497
- return colorValue;
19498
- }
19499
- // Otherwise, use the theme's getColor function
19500
- return getColor(colorValue, {
19501
- themeMode
19502
- });
19503
- };
19504
- var resolvedColor = resolveColorValue(highlightColor);
19505
- var resolvedSecondary = highlightSecondaryColor ? resolveColorValue(highlightSecondaryColor) : undefined;
19506
- var baseHighlightProps = HighlightStyles[highlightStyle](resolvedColor, resolvedSecondary);
19507
- var highlightViewProps = highlightStyle === 'background' ? Object.assign({}, baseHighlightProps, {
19508
- color: undefined
19509
- }) : baseHighlightProps;
19510
- var highlightBackgroundOverrides = highlightStyle === 'background' ? {
19511
- bgColor: resolvedColor
19512
- } : {};
19513
19498
  var {
19514
19499
  finalDisplayedText,
19515
19500
  activeHighlightTarget,
@@ -19529,12 +19514,13 @@
19529
19514
  highlightSlideStagger,
19530
19515
  highlightSlideSequential
19531
19516
  }, props));
19532
- // Determine if we should use responsive sizing or static sizing
19533
- var useResponsive = responsive && !props.media; // Don't override if media prop is already provided
19517
+ // Common style calculations
19518
+ var useResponsive = responsive && !props.media;
19534
19519
  var fontSize = TitleSizes[size];
19535
- // Get responsive styles if responsive prop is true
19536
19520
  var responsiveStyles = useResponsive ? ResponsiveTypography[size] : null;
19537
- // Helper function to apply loop control to animations
19521
+ // Highlight style props
19522
+ var highlightProps = HighlightStyles[highlightStyle](highlightColor, highlightSecondaryColor);
19523
+ // Apply loop control to animations
19538
19524
  var applyAnimationLoop = (animation, loopControl) => {
19539
19525
  if (!animation) return animation;
19540
19526
  if (Array.isArray(animation)) {
@@ -19546,109 +19532,88 @@
19546
19532
  iterationCount: loopControl.toString()
19547
19533
  });
19548
19534
  };
19549
- // Apply loop control to animations
19550
19535
  var controlledAnimate = applyAnimationLoop(animate, animationLoop);
19551
19536
  var controlledHighlightAnimate = applyAnimationLoop(highlightAnimate, highlightAnimationLoop);
19552
19537
  // Get the text to display
19553
19538
  var text = typeof finalDisplayedText === 'string' ? finalDisplayedText : typeof children === 'string' ? children : '';
19539
+ // Common container props
19540
+ var containerProps = {
19541
+ ref,
19542
+ as: 'h1',
19543
+ fontSize: useResponsive ? undefined : fontSize,
19544
+ fontWeight: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.fontWeight : 'bold',
19545
+ letterSpacing: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.letterSpacing : undefined,
19546
+ marginBottom: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.marginBottom : undefined,
19547
+ animate: inView ? controlledAnimate : undefined,
19548
+ media: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.media : undefined
19549
+ };
19550
+ // Render highlighted text content (typewriter, slide, or plain)
19551
+ var renderHighlightedContent = content => {
19552
+ // If animations are enabled but not in view, render invisible placeholder
19553
+ // This holds layout space and prevents animations (like typewriter) from running off-screen
19554
+ if (!inView && (highlightTypewriter || highlightSlide)) {
19555
+ return /*#__PURE__*/React__default.createElement("span", {
19556
+ style: {
19557
+ opacity: 0
19558
+ }
19559
+ }, content);
19560
+ }
19561
+ if (highlightTypewriter) {
19562
+ return /*#__PURE__*/React__default.createElement(TypewriterEffect, Object.assign({
19563
+ text: content,
19564
+ typingSpeed: Math.max(30, highlightTypewriterDuration / (content.length * 10)),
19565
+ showCursor: true,
19566
+ cursorColor: "currentColor"
19567
+ }, highlightProps));
19568
+ }
19569
+ if (highlightSlide) {
19570
+ return /*#__PURE__*/React__default.createElement(SlideEffect, {
19571
+ text: content,
19572
+ duration: stateHighlightSlideDuration,
19573
+ stagger: stateHighlightSlideStagger,
19574
+ sequential: stateHighlightSlideSequential,
19575
+ direction: "up",
19576
+ fontSize: useResponsive ? undefined : fontSize,
19577
+ fontWeight: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.fontWeight : 'bold',
19578
+ wordProps: highlightProps
19579
+ });
19580
+ }
19581
+ return content;
19582
+ };
19583
+ // Case 1: Has highlight target - render with highlighted parts
19554
19584
  if (typeof text === 'string' && activeHighlightTarget) {
19555
- var pattern = (() => {
19556
- if (Array.isArray(activeHighlightTarget)) {
19557
- var escaped = activeHighlightTarget.map(t => escapeRegExp(String(t)));
19558
- return new RegExp("(" + escaped.join('|') + ")", 'gi');
19559
- }
19560
- return new RegExp("(" + escapeRegExp(String(activeHighlightTarget)) + ")", 'gi');
19561
- })();
19585
+ var pattern = Array.isArray(activeHighlightTarget) ? new RegExp("(" + activeHighlightTarget.map(t => escapeRegExp(String(t))).join('|') + ")", 'gi') : new RegExp("(" + escapeRegExp(String(activeHighlightTarget)) + ")", 'gi');
19562
19586
  var parts = [];
19563
19587
  var lastIndex = 0;
19564
19588
  var match;
19565
19589
  while (match = pattern.exec(text)) {
19566
- if (match.index > lastIndex) {
19567
- parts.push(text.substring(lastIndex, match.index));
19568
- }
19590
+ if (match.index > lastIndex) parts.push(text.substring(lastIndex, match.index));
19569
19591
  parts.push({
19570
19592
  highlight: true,
19571
19593
  text: match[0]
19572
19594
  });
19573
19595
  lastIndex = match.index + match[0].length;
19574
19596
  }
19575
- if (lastIndex < text.length) {
19576
- parts.push(text.substring(lastIndex));
19577
- }
19578
- return /*#__PURE__*/React__default.createElement(appStudio.Element, Object.assign({
19579
- ref: ref,
19580
- as: "h1",
19581
- fontSize: useResponsive ? undefined : fontSize,
19582
- fontWeight: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.fontWeight : 'bold',
19583
- letterSpacing: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.letterSpacing : undefined,
19584
- marginBottom: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.marginBottom : undefined,
19585
- animate: inView ? controlledAnimate : undefined,
19586
- media: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.media : undefined
19587
- }, views == null ? void 0 : views.container, props), parts.map((part, idx) => typeof part === 'string' ? part : (/*#__PURE__*/React__default.createElement(appStudio.Text, Object.assign({
19597
+ if (lastIndex < text.length) parts.push(text.substring(lastIndex));
19598
+ return /*#__PURE__*/React__default.createElement(appStudio.Element, Object.assign({}, containerProps, views == null ? void 0 : views.container, props), parts.map((part, idx) => typeof part === 'string' ? part : (/*#__PURE__*/React__default.createElement(appStudio.Text, Object.assign({
19588
19599
  key: "highlight-" + idx,
19589
19600
  as: "span",
19590
19601
  display: "inline",
19591
19602
  animate: inView ? controlledHighlightAnimate : undefined,
19592
19603
  fontSize: useResponsive ? undefined : fontSize
19593
- }, !highlightSlide ? highlightViewProps : {}, highlightBackgroundOverrides, views == null ? void 0 : views.highlight), highlightTypewriter ? (/*#__PURE__*/React__default.createElement(TypewriterEffect, {
19594
- text: part.text,
19595
- typingSpeed: Math.max(30, highlightTypewriterDuration / (part.text.length * 10)),
19596
- showCursor: true,
19597
- cursorColor: "currentColor"
19598
- })) : highlightSlide ? (/*#__PURE__*/React__default.createElement(SlideEffect, {
19599
- text: part.text,
19600
- duration: stateHighlightSlideDuration,
19601
- stagger: stateHighlightSlideStagger,
19602
- sequential: stateHighlightSlideSequential,
19603
- direction: "up",
19604
- fontSize: useResponsive ? undefined : fontSize,
19605
- fontWeight: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.fontWeight : 'bold',
19606
- wordProps: highlightViewProps
19607
- })) : part.text))));
19604
+ }, !highlightSlide ? highlightProps : {}, views == null ? void 0 : views.highlight), renderHighlightedContent(part.text)))));
19608
19605
  }
19609
- // If highlightStyle is provided but no highlightText, apply the style to the entire title
19606
+ // Case 2: Has highlight style but no highlight target - apply style to entire title
19610
19607
  if (highlightStyle && !activeHighlightTarget) {
19611
- return /*#__PURE__*/React__default.createElement(appStudio.Element, Object.assign({
19612
- ref: ref,
19613
- as: "h1",
19614
- fontSize: useResponsive ? undefined : fontSize,
19615
- fontWeight: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.fontWeight : 'bold',
19616
- letterSpacing: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.letterSpacing : undefined,
19617
- marginBottom: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.marginBottom : undefined,
19618
- animate: inView ? controlledAnimate : undefined,
19619
- media: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.media : undefined
19620
- }, views == null ? void 0 : views.container, props), /*#__PURE__*/React__default.createElement(appStudio.Text, Object.assign({
19608
+ return /*#__PURE__*/React__default.createElement(appStudio.Element, Object.assign({}, containerProps, views == null ? void 0 : views.container, props), /*#__PURE__*/React__default.createElement(appStudio.Text, Object.assign({
19621
19609
  as: "span",
19622
19610
  fontSize: fontSize,
19623
19611
  display: "inline",
19624
19612
  animate: inView ? controlledHighlightAnimate : undefined
19625
- }, !highlightSlide ? highlightViewProps : {}, highlightBackgroundOverrides, views == null ? void 0 : views.highlight), highlightTypewriter ? (/*#__PURE__*/React__default.createElement(TypewriterEffect, {
19626
- text: text,
19627
- typingSpeed: Math.max(30, highlightTypewriterDuration / (text.length * 10)),
19628
- showCursor: true,
19629
- cursorColor: "currentColor"
19630
- })) : highlightSlide ? (/*#__PURE__*/React__default.createElement(SlideEffect, {
19631
- text: text,
19632
- duration: stateHighlightSlideDuration,
19633
- stagger: stateHighlightSlideStagger,
19634
- sequential: stateHighlightSlideSequential,
19635
- direction: "up",
19636
- fontSize: fontSize,
19637
- fontWeight: useResponsive ? responsiveStyles == null ? void 0 : responsiveStyles.fontWeight : 'bold',
19638
- wordProps: highlightViewProps
19639
- })) : text));
19613
+ }, !highlightSlide ? highlightProps : {}, views == null ? void 0 : views.highlight), renderHighlightedContent(text)));
19640
19614
  }
19641
- // Default case - no highlighting
19642
- return /*#__PURE__*/React__default.createElement(appStudio.Text, Object.assign({
19643
- ref: ref,
19644
- as: "h1",
19645
- fontSize: 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), text);
19615
+ // Case 3: Default - no highlighting
19616
+ return /*#__PURE__*/React__default.createElement(appStudio.Text, Object.assign({}, containerProps, views == null ? void 0 : views.container, props), text);
19652
19617
  };
19653
19618
 
19654
19619
  /**
@@ -20915,7 +20880,7 @@
20915
20880
  category: 'neutral'
20916
20881
  }];
20917
20882
 
20918
- 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"];
20883
+ 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"];
20919
20884
  var ColorPickerView = _ref => {
20920
20885
  var {
20921
20886
  // Basic props
@@ -23282,7 +23247,7 @@
23282
23247
  };
23283
23248
  };
23284
23249
 
23285
- 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"];
23250
+ 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"];
23286
23251
  var EmojiPickerView = _ref => {
23287
23252
  var {
23288
23253
  // Basic props
@@ -24450,7 +24415,7 @@
24450
24415
  var borderWidth = SeparatorThicknesses[thickness];
24451
24416
  // Set appropriate ARIA attributes based on decorative prop
24452
24417
  var ariaProps = decorative ? {
24453
- 'aria-hidden': 'true'
24418
+ 'aria-hidden': true
24454
24419
  } : {
24455
24420
  role: 'separator',
24456
24421
  'aria-orientation': orientation