@app-studio/web 0.8.62 → 0.8.64

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
@@ -6958,6 +6958,26 @@ var MessageLayout = _ref => {
6958
6958
  return visible ? MessageContainer : null;
6959
6959
  };
6960
6960
 
6961
+ var generateThumbnail = (videoFile, setThumbnailUrl) => {
6962
+ var video = document.createElement('video');
6963
+ video.preload = 'metadata';
6964
+ video.onloadedmetadata = () => {
6965
+ video.currentTime = 1;
6966
+ };
6967
+ video.oncanplay = () => {
6968
+ var canvas = document.createElement('canvas');
6969
+ canvas.width = video.videoWidth;
6970
+ canvas.height = video.videoHeight;
6971
+ var ctx = canvas.getContext('2d');
6972
+ if (ctx) {
6973
+ ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
6974
+ var thumbnailDataUrl = canvas.toDataURL('image/jpeg');
6975
+ setThumbnailUrl(thumbnailDataUrl);
6976
+ }
6977
+ URL.revokeObjectURL(video.src);
6978
+ };
6979
+ video.src = URL.createObjectURL(videoFile);
6980
+ };
6961
6981
  var useUpload = _ref => {
6962
6982
  var {
6963
6983
  maxSize = 100 * 1024 * 1024,
@@ -6975,26 +6995,6 @@ var useUpload = _ref => {
6975
6995
  var [errorMessage, setErrorMessage] = useState(null);
6976
6996
  var [previewUrl, setPreviewUrl] = useState(null);
6977
6997
  var [thumbnailUrl, setThumbnailUrl] = useState(thumbnail || null);
6978
- var generateThumbnail = videoFile => {
6979
- var video = document.createElement('video');
6980
- video.preload = 'metadata';
6981
- video.onloadedmetadata = () => {
6982
- video.currentTime = 1;
6983
- };
6984
- video.oncanplay = () => {
6985
- var canvas = document.createElement('canvas');
6986
- canvas.width = video.videoWidth;
6987
- canvas.height = video.videoHeight;
6988
- var ctx = canvas.getContext('2d');
6989
- if (ctx) {
6990
- ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
6991
- var thumbnailDataUrl = canvas.toDataURL('image/jpeg');
6992
- setThumbnailUrl(thumbnailDataUrl);
6993
- }
6994
- URL.revokeObjectURL(video.src);
6995
- };
6996
- video.src = URL.createObjectURL(videoFile);
6997
- };
6998
6998
  var handleFileChange = useCallback(event => {
6999
6999
  var _event$target$files;
7000
7000
  var file = (_event$target$files = event.target.files) == null ? void 0 : _event$target$files[0];
@@ -7019,7 +7019,7 @@ var useUpload = _ref => {
7019
7019
  }
7020
7020
  setPreviewUrl(URL.createObjectURL(file));
7021
7021
  if (file.type.startsWith('video/')) {
7022
- generateThumbnail(file);
7022
+ generateThumbnail(file, setThumbnailUrl);
7023
7023
  }
7024
7024
  if (onFileSelect) {
7025
7025
  setSelectedFile(file);
@@ -7671,7 +7671,9 @@ var TabsView = props => {
7671
7671
  isActive,
7672
7672
  setIsActive,
7673
7673
  tabsState,
7674
- setTabsState
7674
+ setTabsState,
7675
+ renderTab,
7676
+ renderContent
7675
7677
  } = props;
7676
7678
  // Declares a function 'moveSelectedTabToTop' that takes an index and modifies the tabs order.
7677
7679
  var moveSelectedTabToTop = idx => {
@@ -7692,11 +7694,9 @@ var TabsView = props => {
7692
7694
  return tab.value === tabsState[0].value;
7693
7695
  };
7694
7696
  return /*#__PURE__*/React.createElement(Vertical, Object.assign({
7695
- width: "100w",
7697
+ width: "100%",
7696
7698
  height: '100%'
7697
- }, styles == null ? void 0 : styles.container), /*#__PURE__*/React.createElement(Horizontal, Object.assign({
7698
- marginBottom: 20
7699
- }, styles == null ? void 0 : styles.headerTabs), tabs.map((tab, idx) => (/*#__PURE__*/React.createElement(Button, Object.assign({
7699
+ }, styles == null ? void 0 : styles.container), /*#__PURE__*/React.createElement(Horizontal, Object.assign({}, styles == null ? void 0 : styles.headerTabs), tabs.map((tab, idx) => renderTab ? renderTab(tab, isContentActive(tab), idx) : (/*#__PURE__*/React.createElement(Button, Object.assign({
7700
7700
  key: tab.title,
7701
7701
  onClick: () => {
7702
7702
  moveSelectedTabToTop(idx);
@@ -7704,11 +7704,12 @@ var TabsView = props => {
7704
7704
  variant: isActive.value === tab.value ? 'filled' : 'ghost',
7705
7705
  shape: "pillShaped",
7706
7706
  cursor: "pointer",
7707
- isAuto: true
7707
+ isAuto: true,
7708
+ margin: 10
7708
7709
  }, styles == null ? void 0 : styles.tab, isActive.value === tab.value ? styles == null ? void 0 : styles.activeTab : {}), /*#__PURE__*/React.createElement(Text, Object.assign({}, styles == null ? void 0 : styles.title, isActive.value === tab.value ? styles == null ? void 0 : styles.activeText : {}), tab.title))))), /*#__PURE__*/React.createElement(View, Object.assign({
7709
7710
  width: '100%',
7710
7711
  height: "100%"
7711
- }, styles == null ? void 0 : styles.content), tabsState.map((tab, idx) => isContentActive(tab) && /*#__PURE__*/React.createElement(View, {
7712
+ }, styles == null ? void 0 : styles.content), tabsState.map(renderContent ? renderContent : (tab, idx) => isContentActive(tab) && /*#__PURE__*/React.createElement(View, {
7712
7713
  key: idx
7713
7714
  }, tab.content))));
7714
7715
  };
@@ -8069,5 +8070,5 @@ var DragAndDropComponent = props => {
8069
8070
  };
8070
8071
  var DragAndDrop = DragAndDropComponent;
8071
8072
 
8072
- export { Alert, ArrowIcon, AspectRatio, Avatar, Badge, BatteryIcon, BluetoothIcon, BoldArrowIcon, BookmarkIcon, Bottom, Button, CalendarIcon, CameraIcon, Center, CenterBase, Checkbox, ChevronIcon, ClockIcon, CloseEyeIcon, CloseIcon, CloudIcon, ComboBox, CopyIcon, CountryPicker, DatePicker, DownloadIcon, DragAndDrop, DragAndDropComponent, DragHandleIcon, DustBinIcon, EditIcon, ErrorIcon, ExternalLinkIcon, FacebookIcon, FileIcon, FileImage, FileSVG, FilterIcon, FormikCheckbox, FormikComboBox, FormikCountryPicker, FormikDatePicker, FormikForm, FormikPassword, FormikSelect, FormikSwitch, FormikTextArea, FormikTextField, HeartIcon, HomeIcon, Horizontal, HorizontalBase, Icon, ImageIcon, InfoIcon, Inline, InstagramIcon, Left, LikeIcon, Link, LinkedinIcon, Loader, LocationIcon, LockIcon, MenuIcon, MessageLayout, MessageView, MicrophoneIcon, MinusIcon, Modal, MoonIcon, NotificationIcon, OpenEyeIcon, PanelIcon, Password, PauseIcon, PlayIcon, PlusIcon, PrintIcon, ProfileIcon, RefreshIcon, Right, SaveIcon, SearchIcon, Select, SettingsIcon, ShareIcon, SpinnerIcon, StarIcon, SuccessIcon, Switch, Table, Tabs, Text, TextArea, TextField, ThreadsIcon, TickIcon, Toggle, ToggleGroup, Top, TwitchIcon, TwitterIcon, UnLikeIcon, UnlockIcon, UploadIcon, Uploader, Vertical, VerticalBase, VideoIcon, View, WarningIcon, WifiIcon, XIcon, YoutubeIcon, hideMessage, hideModal, showMessage, showModal, useMessageStore, useModalStore, useUpload };
8073
+ export { Alert, ArrowIcon, AspectRatio, Avatar, Badge, BatteryIcon, BluetoothIcon, BoldArrowIcon, BookmarkIcon, Bottom, Button, CalendarIcon, CameraIcon, Center, CenterBase, Checkbox, ChevronIcon, ClockIcon, CloseEyeIcon, CloseIcon, CloudIcon, ComboBox, CopyIcon, CountryPicker, DatePicker, DownloadIcon, DragAndDrop, DragAndDropComponent, DragHandleIcon, DustBinIcon, EditIcon, ErrorIcon, ExternalLinkIcon, FacebookIcon, FileIcon, FileImage, FileSVG, FilterIcon, FormikCheckbox, FormikComboBox, FormikCountryPicker, FormikDatePicker, FormikForm, FormikPassword, FormikSelect, FormikSwitch, FormikTextArea, FormikTextField, HeartIcon, HomeIcon, Horizontal, HorizontalBase, Icon, ImageIcon, InfoIcon, Inline, InstagramIcon, Left, LikeIcon, Link, LinkedinIcon, Loader, LocationIcon, LockIcon, MenuIcon, MessageLayout, MessageView, MicrophoneIcon, MinusIcon, Modal, MoonIcon, NotificationIcon, OpenEyeIcon, PanelIcon, Password, PauseIcon, PlayIcon, PlusIcon, PrintIcon, ProfileIcon, RefreshIcon, Right, SaveIcon, SearchIcon, Select, SettingsIcon, ShareIcon, SpinnerIcon, StarIcon, SuccessIcon, Switch, Table, Tabs, Text, TextArea, TextField, ThreadsIcon, TickIcon, Toggle, ToggleGroup, Top, TwitchIcon, TwitterIcon, UnLikeIcon, UnlockIcon, UploadIcon, Uploader, Vertical, VerticalBase, VideoIcon, View, WarningIcon, WifiIcon, XIcon, YoutubeIcon, generateThumbnail, hideMessage, hideModal, showMessage, showModal, useMessageStore, useModalStore, useUpload };
8073
8074
  //# sourceMappingURL=web.esm.js.map