@scaleflex/widget-explorer 0.0.1

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.
Files changed (572) hide show
  1. package/CHANGELOG.md +11924 -0
  2. package/LICENSE +21 -0
  3. package/README.md +1258 -0
  4. package/dist/style.css +1850 -0
  5. package/dist/style.min.css +1 -0
  6. package/lib/Explorer.styled.js +48 -0
  7. package/lib/components/ActionBar/ActionBar.styled.js +103 -0
  8. package/lib/components/ActionBar/DownloadWithExportButton.js +202 -0
  9. package/lib/components/ActionBar/SelectionMenu.js +129 -0
  10. package/lib/components/ActionBar/index.js +105 -0
  11. package/lib/components/AddFilesPanel/AddFiles.js +174 -0
  12. package/lib/components/AddFilesPanel/AddFiles.styled.js +137 -0
  13. package/lib/components/AddFilesPanel/index.js +59 -0
  14. package/lib/components/AiSwitcher/AiSwitcher.constants.js +1 -0
  15. package/lib/components/AiSwitcher/AiSwitcher.styled.js +24 -0
  16. package/lib/components/AiSwitcher/index.js +81 -0
  17. package/lib/components/AssetsList/AssetsList.styled.js +219 -0
  18. package/lib/components/AssetsList/GridView/FilesAccordion.js +76 -0
  19. package/lib/components/AssetsList/GridView/FilesSection/FileCell.js +276 -0
  20. package/lib/components/AssetsList/GridView/FilesSection/FileOverlayOptions.js +140 -0
  21. package/lib/components/AssetsList/GridView/FilesSection/FilesSection.styled.js +15 -0
  22. package/lib/components/AssetsList/GridView/FilesSection/index.js +31 -0
  23. package/lib/components/AssetsList/GridView/FilesSkeleton.js +47 -0
  24. package/lib/components/AssetsList/GridView/FoldersSection/FolderCell.js +239 -0
  25. package/lib/components/AssetsList/GridView/FoldersSection/FolderPreviewGrid.js +106 -0
  26. package/lib/components/AssetsList/GridView/FoldersSection/FolderTopOptions.js +70 -0
  27. package/lib/components/AssetsList/GridView/FoldersSection/index.js +23 -0
  28. package/lib/components/AssetsList/GridView/FoldersSkeleton.js +77 -0
  29. package/lib/components/AssetsList/GridView/GridView.styled.js +11 -0
  30. package/lib/components/AssetsList/GridView/SearchGridView/SearchGridView.styled.js +15 -0
  31. package/lib/components/AssetsList/GridView/SearchGridView/SearchGridViewSkeleton.js +30 -0
  32. package/lib/components/AssetsList/GridView/SearchGridView/index.js +97 -0
  33. package/lib/components/AssetsList/GridView/index.js +196 -0
  34. package/lib/components/AssetsList/ListView/AssetsSection/AssetsSectionTableHeader.js +152 -0
  35. package/lib/components/AssetsList/ListView/AssetsSection/AssetsSectionTableRow.js +333 -0
  36. package/lib/components/AssetsList/ListView/AssetsSection/index.js +99 -0
  37. package/lib/components/AssetsList/ListView/ColumnsMenu.js +89 -0
  38. package/lib/components/AssetsList/ListView/FilesAccordion.js +74 -0
  39. package/lib/components/AssetsList/ListView/FilesSkeleton.js +68 -0
  40. package/lib/components/AssetsList/ListView/FoldersSection/FoldersSectionTableHeader.js +98 -0
  41. package/lib/components/AssetsList/ListView/FoldersSection/FoldersSectionTableRow.js +156 -0
  42. package/lib/components/AssetsList/ListView/FoldersSection/index.js +54 -0
  43. package/lib/components/AssetsList/ListView/FoldersSkeleton.js +67 -0
  44. package/lib/components/AssetsList/ListView/ListView.styled.js +181 -0
  45. package/lib/components/AssetsList/ListView/ListView.utils.js +30 -0
  46. package/lib/components/AssetsList/ListView/SearchListView/index.js +109 -0
  47. package/lib/components/AssetsList/ListView/index.js +203 -0
  48. package/lib/components/AssetsList/ScrollToTop.js +70 -0
  49. package/lib/components/AssetsList/SearchView.hook.js +241 -0
  50. package/lib/components/AssetsList/__SearchTestPannel.js +238 -0
  51. package/lib/components/AssetsList/__SearchTestPannel.mock.js +1 -0
  52. package/lib/components/AssetsList/index.js +266 -0
  53. package/lib/components/AssetsList/relevanceBadge.js +15 -0
  54. package/lib/components/AssetsView/AssetsView.styled.js +25 -0
  55. package/lib/components/AssetsView/AssetsView.thunks.js +64 -0
  56. package/lib/components/AssetsView/index.js +142 -0
  57. package/lib/components/AuthExplorerView.js +79 -0
  58. package/lib/components/Breadcrumbs/BreadCrumbViews/BreadCrumbsViews.styled.js +30 -0
  59. package/lib/components/Breadcrumbs/BreadCrumbViews/index.js +32 -0
  60. package/lib/components/Breadcrumbs/Breadcrumb.js +52 -0
  61. package/lib/components/Breadcrumbs/Breadcrumbs.styled.js +81 -0
  62. package/lib/components/Breadcrumbs/BreadcrumbsSkeleton.js +12 -0
  63. package/lib/components/Breadcrumbs/index.js +187 -0
  64. package/lib/components/BulkEditPanel/BulkEdit.js +330 -0
  65. package/lib/components/BulkEditPanel/BulkEditPanel.styled.js +62 -0
  66. package/lib/components/BulkEditPanel/BulkEditPanel.utils.js +55 -0
  67. package/lib/components/BulkEditPanel/components/AssetsList/AssetsList.constants.js +29 -0
  68. package/lib/components/BulkEditPanel/components/AssetsList/AssetsList.js +148 -0
  69. package/lib/components/BulkEditPanel/components/AssetsList/AssetsList.styled.js +81 -0
  70. package/lib/components/BulkEditPanel/components/AssetsList/Columns/Columns.styled.js +99 -0
  71. package/lib/components/BulkEditPanel/components/AssetsList/Columns/FileMetadataField.js +263 -0
  72. package/lib/components/BulkEditPanel/components/AssetsList/Columns/FileTagField.js +228 -0
  73. package/lib/components/BulkEditPanel/components/AssetsList/Columns/FileTextField.js +107 -0
  74. package/lib/components/BulkEditPanel/components/AssetsList/Columns/MetadataColumn.js +142 -0
  75. package/lib/components/BulkEditPanel/components/AssetsList/Columns/TableRow.js +139 -0
  76. package/lib/components/BulkEditPanel/components/AssetsList/Columns/TagsColumn.js +58 -0
  77. package/lib/components/BulkEditPanel/components/AssetsList/Columns/TagsField.js +80 -0
  78. package/lib/components/BulkEditPanel/components/AssetsList/Columns/TextColumn.js +53 -0
  79. package/lib/components/BulkEditPanel/components/AssetsList/Columns/columns.utils.js +272 -0
  80. package/lib/components/BulkEditPanel/components/AssetsList/Columns/getActiveColumn.js +23 -0
  81. package/lib/components/BulkEditPanel/components/AssetsList/FloatyPreview.js +55 -0
  82. package/lib/components/BulkEditPanel/components/AssetsList/FloatyPreview.styled.js +21 -0
  83. package/lib/components/BulkEditPanel/components/AssetsList/TableBody.js +64 -0
  84. package/lib/components/BulkEditPanel/components/AssetsList/TableHeader.js +67 -0
  85. package/lib/components/BulkEditPanel/components/BulkEditFooter.js +33 -0
  86. package/lib/components/BulkEditPanel/components/ConfirmationModal/ConfirmationModal.js +47 -0
  87. package/lib/components/BulkEditPanel/components/ConfirmationModal/ConfirmationModal.styled.js +25 -0
  88. package/lib/components/BulkEditPanel/components/MainContent/MainContent.js +110 -0
  89. package/lib/components/BulkEditPanel/components/MainContent/MainContent.styled.js +12 -0
  90. package/lib/components/BulkEditPanel/components/MainContent/index.js +2 -0
  91. package/lib/components/BulkEditPanel/components/Sidebar/Sidebar.styled.js +53 -0
  92. package/lib/components/BulkEditPanel/components/Sidebar/Sidebar.utils.js +28 -0
  93. package/lib/components/BulkEditPanel/components/Sidebar/index.js +158 -0
  94. package/lib/components/BulkEditPanel/components/Tabs/Metadata/Metadata.js +246 -0
  95. package/lib/components/BulkEditPanel/components/Tabs/Metadata/Metadata.styled.js +17 -0
  96. package/lib/components/BulkEditPanel/components/Tabs/Tags/Tags.js +222 -0
  97. package/lib/components/BulkEditPanel/components/Tabs/Tags/Tags.mixin.js +20 -0
  98. package/lib/components/BulkEditPanel/components/Tabs/Tags/Tags.styled.js +123 -0
  99. package/lib/components/BulkEditPanel/components/Tabs/Tags/TagsContianer.js +31 -0
  100. package/lib/components/BulkEditPanel/components/Tabs/Tags/TagsPaper.js +95 -0
  101. package/lib/components/BulkEditPanel/components/Tabs/Text/Text.js +167 -0
  102. package/lib/components/BulkEditPanel/components/Tabs/Text/Text.styled.js +15 -0
  103. package/lib/components/BulkEditPanel/components/Tabs/tabs.constants.js +113 -0
  104. package/lib/components/BulkEditPanel/components/Tabs/tabs.js +43 -0
  105. package/lib/components/BulkEditPanel/components/Tabs/tabs.utils.js +239 -0
  106. package/lib/components/BulkEditPanel/index.js +28 -0
  107. package/lib/components/ContextMenu/BeforeUploadMenu/index.js +51 -0
  108. package/lib/components/ContextMenu/ContextMenu.constants.js +64 -0
  109. package/lib/components/ContextMenu/ContextMenu.hooks.js +35 -0
  110. package/lib/components/ContextMenu/ContextMenu.styled.js +107 -0
  111. package/lib/components/ContextMenu/ContextMenuContent.js +202 -0
  112. package/lib/components/ContextMenu/ContextMenuItem.js +142 -0
  113. package/lib/components/ContextMenu/FileMenu/CollaborateSection/index.js +33 -0
  114. package/lib/components/ContextMenu/FileMenu/DeleteSection/index.js +25 -0
  115. package/lib/components/ContextMenu/FileMenu/EditSection/index.js +42 -0
  116. package/lib/components/ContextMenu/FileMenu/FindSection/index.js +29 -0
  117. package/lib/components/ContextMenu/FileMenu/index.js +15 -0
  118. package/lib/components/ContextMenu/FolderMenu/CollaborateSection/index.js +17 -0
  119. package/lib/components/ContextMenu/FolderMenu/DeleteSection/index.js +41 -0
  120. package/lib/components/ContextMenu/FolderMenu/EditSection/index.js +49 -0
  121. package/lib/components/ContextMenu/FolderMenu/FindSection/index.js +49 -0
  122. package/lib/components/ContextMenu/FolderMenu/FolderMenu.utils.js +31 -0
  123. package/lib/components/ContextMenu/FolderMenu/index.js +14 -0
  124. package/lib/components/ContextMenu/MenuOptions/AddVariationOption.js +59 -0
  125. package/lib/components/ContextMenu/MenuOptions/BulkEditOption.js +47 -0
  126. package/lib/components/ContextMenu/MenuOptions/CdnLinkOption.js +54 -0
  127. package/lib/components/ContextMenu/MenuOptions/DeleteOption.js +70 -0
  128. package/lib/components/ContextMenu/MenuOptions/DownloadOption.js +88 -0
  129. package/lib/components/ContextMenu/MenuOptions/EditImageOption.js +63 -0
  130. package/lib/components/ContextMenu/MenuOptions/EditVideoOption.js +87 -0
  131. package/lib/components/ContextMenu/MenuOptions/LocateFileOption.js +45 -0
  132. package/lib/components/ContextMenu/MenuOptions/ManagaAccessOption.js +67 -0
  133. package/lib/components/ContextMenu/MenuOptions/ManageDetailsOption.js +52 -0
  134. package/lib/components/ContextMenu/MenuOptions/MoveOption.js +54 -0
  135. package/lib/components/ContextMenu/MenuOptions/PreviewOption.js +35 -0
  136. package/lib/components/ContextMenu/MenuOptions/RenameOption.js +66 -0
  137. package/lib/components/ContextMenu/MenuOptions/TransformationOption.js +63 -0
  138. package/lib/components/ContextMenu/MultipleMenu/CollaborateSection/index.js +31 -0
  139. package/lib/components/ContextMenu/MultipleMenu/DeleteSection/index.js +6 -0
  140. package/lib/components/ContextMenu/MultipleMenu/EditSection/index.js +14 -0
  141. package/lib/components/ContextMenu/MultipleMenu/FindSection/index.js +14 -0
  142. package/lib/components/ContextMenu/MultipleMenu/index.js +14 -0
  143. package/lib/components/ContextMenu/SharedMenus/DownloadFolderSubMenu.js +36 -0
  144. package/lib/components/ContextMenu/SharedMenus/DownloadSubMenu.js +70 -0
  145. package/lib/components/ContextMenu/index.js +34 -0
  146. package/lib/components/ContextMenu/utils/calculateMenuHeight.js +20 -0
  147. package/lib/components/ContextMenu/utils/calculateMenuPosition.js +42 -0
  148. package/lib/components/ContextMenu/utils/createSeparator.js +14 -0
  149. package/lib/components/ContextMenu/utils/editMedia.js +17 -0
  150. package/lib/components/ContextMenu/utils/getFileLocation.js +8 -0
  151. package/lib/components/ContextMenu/utils/getFilteredOptions.js +20 -0
  152. package/lib/components/ContextMenu/utils/getProperFolderSelections.js +7 -0
  153. package/lib/components/ContextMenu/utils/isEmptyFolderSelection.js +5 -0
  154. package/lib/components/ContextMenu/utils/isFileContextMenu.js +5 -0
  155. package/lib/components/ContextMenu/utils/isFirstFileVisibilityPublic.js +9 -0
  156. package/lib/components/ContextMenu/utils/isMenuItemVisible.js +5 -0
  157. package/lib/components/ContextMenu/utils/isMixedFiles.js +9 -0
  158. package/lib/components/ContextMenu/utils/isMultipleSelection.js +6 -0
  159. package/lib/components/ContextMenu/utils/isSeparatorHidden.js +7 -0
  160. package/lib/components/ContextMenu/utils/triggerDownload.js +45 -0
  161. package/lib/components/CropPanel/CropOptions.js +155 -0
  162. package/lib/components/CropPanel/CropPanel.constants.js +44 -0
  163. package/lib/components/CropPanel/CropPanel.styled.js +107 -0
  164. package/lib/components/CropPanel/CropPanel.utils.js +48 -0
  165. package/lib/components/CropPanel/CropPanelContent.js +209 -0
  166. package/lib/components/CropPanel/ImageOptions.js +326 -0
  167. package/lib/components/CropPanel/ImageResize.js +207 -0
  168. package/lib/components/CropPanel/Option.js +113 -0
  169. package/lib/components/CropPanel/index.js +22 -0
  170. package/lib/components/CropPanel/index.scss +55 -0
  171. package/lib/components/Details/Details.constants.js +70 -0
  172. package/lib/components/Details/Details.utils.js +232 -0
  173. package/lib/components/Details/DetailsSideBar.styled.js +139 -0
  174. package/lib/components/Details/EditActionButtons/EditActionButtons.styled.js +27 -0
  175. package/lib/components/Details/EditActionButtons/index.js +38 -0
  176. package/lib/components/Details/FileDetails.js +31 -0
  177. package/lib/components/Details/FileItem/CustomMetadataTab.js +45 -0
  178. package/lib/components/Details/FileItem/FileItem.styled.js +47 -0
  179. package/lib/components/Details/FileItem/GeneralTab.js +113 -0
  180. package/lib/components/Details/FileItem/SharedFileEditData.js +97 -0
  181. package/lib/components/Details/FileItem/index.js +2 -0
  182. package/lib/components/Details/FileItem/style.scss +11 -0
  183. package/lib/components/Details/FolderDetails.js +138 -0
  184. package/lib/components/Details/FolderItemList/FolderListItem.js +77 -0
  185. package/lib/components/Details/FolderItemList/index.js +62 -0
  186. package/lib/components/Details/MultiItemsDetails.js +69 -0
  187. package/lib/components/Details/MultipleItems.js +71 -0
  188. package/lib/components/Details/TabChips.js +46 -0
  189. package/lib/components/Details/TabPanels.js +42 -0
  190. package/lib/components/Details/Title.js +52 -0
  191. package/lib/components/Details/index.js +53 -0
  192. package/lib/components/DnD/Dnd.styled.js +11 -0
  193. package/lib/components/DnD/DragImage.js +61 -0
  194. package/lib/components/DnD/index.js +218 -0
  195. package/lib/components/Drawer/Drawer.styled.js +45 -0
  196. package/lib/components/Drawer/Drawer.utils.js +163 -0
  197. package/lib/components/Drawer/Resizer.js +141 -0
  198. package/lib/components/Drawer/ResizerCore.js +213 -0
  199. package/lib/components/Drawer/index.js +68 -0
  200. package/lib/components/EmptyViewPlaceholder/EmptyViewPlaceholder.styled.js +39 -0
  201. package/lib/components/EmptyViewPlaceholder/index.js +58 -0
  202. package/lib/components/ExploreView.js +46 -0
  203. package/lib/components/ExplorerUI.js +17 -0
  204. package/lib/components/ExplorerWrapper.js +113 -0
  205. package/lib/components/FacetedSearch/DrawerBody/index.js +42 -0
  206. package/lib/components/FacetedSearch/DrawerWrapper/index.js +83 -0
  207. package/lib/components/FacetedSearch/FacetedSearch.constants.js +27 -0
  208. package/lib/components/FacetedSearch/FacetedSearch.styled.js +101 -0
  209. package/lib/components/FacetedSearch/FacetedSearch.utils.js +3 -0
  210. package/lib/components/FacetedSearch/Field/Date.js +69 -0
  211. package/lib/components/FacetedSearch/Field/Placeholder.js +20 -0
  212. package/lib/components/FacetedSearch/Field/Select.js +136 -0
  213. package/lib/components/FacetedSearch/Field/Switch.js +59 -0
  214. package/lib/components/FacetedSearch/Field/index.js +27 -0
  215. package/lib/components/FacetedSearch/GroupWrapper/index.js +129 -0
  216. package/lib/components/FacetedSearch/StaticFields/Date.js +152 -0
  217. package/lib/components/FacetedSearch/index.js +12 -0
  218. package/lib/components/FileItem/FileInfo/FileInfo.styled.js +126 -0
  219. package/lib/components/FileItem/FileInfo/FileInfo.utils.js +13 -0
  220. package/lib/components/FileItem/FileInfo/FileMetadata.js +37 -0
  221. package/lib/components/FileItem/FileInfo/FileName.js +197 -0
  222. package/lib/components/FileItem/FileInfo/index.js +194 -0
  223. package/lib/components/FileItem/FileItem.mixin.js +22 -0
  224. package/lib/components/FileItem/FileItem.styled.js +54 -0
  225. package/lib/components/FileItem/FileUploadTopOptions.js +87 -0
  226. package/lib/components/FileItem/PreUploadFileThumbnail/FileThumbnail.js +61 -0
  227. package/lib/components/FileItem/PreUploadFileThumbnail/PreUploadFileThumbnail.styled.js +8 -0
  228. package/lib/components/FileItem/PreUploadFileThumbnail/index.js +27 -0
  229. package/lib/components/FileItem/PreUploadFileThumbnail/index.scss +19 -0
  230. package/lib/components/FileItem/index.js +162 -0
  231. package/lib/components/FileItem/index.scss +0 -0
  232. package/lib/components/FileWindowPanel/Body/ActionButtons.js +69 -0
  233. package/lib/components/FileWindowPanel/Body/Body.constants.js +5 -0
  234. package/lib/components/FileWindowPanel/Body/Body.styled.js +196 -0
  235. package/lib/components/FileWindowPanel/Body/BodyFile.js +165 -0
  236. package/lib/components/FileWindowPanel/Body/Footer.js +58 -0
  237. package/lib/components/FileWindowPanel/Body/Preview.js +232 -0
  238. package/lib/components/FileWindowPanel/Body/PreviewPlaceholder.js +20 -0
  239. package/lib/components/FileWindowPanel/Body/VideoEmbed.js +80 -0
  240. package/lib/components/FileWindowPanel/Body/index.js +106 -0
  241. package/lib/components/FileWindowPanel/FileTabs/FileTabButtons.js +98 -0
  242. package/lib/components/FileWindowPanel/FileTabs/FileTabs.constants.js +46 -0
  243. package/lib/components/FileWindowPanel/FileTabs/FileTabs.styled.js +99 -0
  244. package/lib/components/FileWindowPanel/FileTabs/FileTabsList.js +88 -0
  245. package/lib/components/FileWindowPanel/FileTabs/GeneralTab/EditableField.js +78 -0
  246. package/lib/components/FileWindowPanel/FileTabs/GeneralTab/FieldLabel.js +40 -0
  247. package/lib/components/FileWindowPanel/FileTabs/GeneralTab/FieldRow.js +57 -0
  248. package/lib/components/FileWindowPanel/FileTabs/GeneralTab/FieldValue.js +20 -0
  249. package/lib/components/FileWindowPanel/FileTabs/GeneralTab/FieldWithTooltip.js +29 -0
  250. package/lib/components/FileWindowPanel/FileTabs/GeneralTab/GeneralSection.js +182 -0
  251. package/lib/components/FileWindowPanel/FileTabs/GeneralTab/GeneralTab.constants.js +2 -0
  252. package/lib/components/FileWindowPanel/FileTabs/GeneralTab/GeneralTab.styled.js +112 -0
  253. package/lib/components/FileWindowPanel/FileTabs/GeneralTab/GeneralTabSkeleton.js +70 -0
  254. package/lib/components/FileWindowPanel/FileTabs/GeneralTab/TableSeparator.js +10 -0
  255. package/lib/components/FileWindowPanel/FileTabs/GeneralTab/index.js +100 -0
  256. package/lib/components/FileWindowPanel/FileTabs/MetadataTab/CustomMetadataSection.js +234 -0
  257. package/lib/components/FileWindowPanel/FileTabs/MetadataTab/EmbeddedMetadataSection.js +31 -0
  258. package/lib/components/FileWindowPanel/FileTabs/MetadataTab/MetadataTab.constants.js +2 -0
  259. package/lib/components/FileWindowPanel/FileTabs/MetadataTab/MetadataTab.styled.js +134 -0
  260. package/lib/components/FileWindowPanel/FileTabs/MetadataTab/MetadataTabSkeleton.js +70 -0
  261. package/lib/components/FileWindowPanel/FileTabs/MetadataTab/index.js +181 -0
  262. package/lib/components/FileWindowPanel/FileTabs/VariationsTab/VariationItem.js +78 -0
  263. package/lib/components/FileWindowPanel/FileTabs/VariationsTab/Variations.constants.js +22 -0
  264. package/lib/components/FileWindowPanel/FileTabs/VariationsTab/Variations.styled.js +175 -0
  265. package/lib/components/FileWindowPanel/FileTabs/VariationsTab/Variations.thunks.js +54 -0
  266. package/lib/components/FileWindowPanel/FileTabs/VariationsTab/Variations.utils.js +23 -0
  267. package/lib/components/FileWindowPanel/FileTabs/VariationsTab/VariationsContent.js +76 -0
  268. package/lib/components/FileWindowPanel/FileTabs/VariationsTab/VariationsEditModalContent.js +57 -0
  269. package/lib/components/FileWindowPanel/FileTabs/VariationsTab/VariationsSearch.js +44 -0
  270. package/lib/components/FileWindowPanel/FileTabs/VariationsTab/VariationsSkeleton.js +35 -0
  271. package/lib/components/FileWindowPanel/FileTabs/VariationsTab/VariationsTabNavigator.js +38 -0
  272. package/lib/components/FileWindowPanel/FileTabs/VariationsTab/VariationsTabs.js +32 -0
  273. package/lib/components/FileWindowPanel/FileTabs/VariationsTab/VariationsTopOptions.js +204 -0
  274. package/lib/components/FileWindowPanel/FileTabs/VariationsTab/index.js +431 -0
  275. package/lib/components/FileWindowPanel/FileTabs/index.js +83 -0
  276. package/lib/components/FileWindowPanel/FileWindow.js +220 -0
  277. package/lib/components/FileWindowPanel/FileWindow.styled.js +19 -0
  278. package/lib/components/FileWindowPanel/FileWindow.utils.js +38 -0
  279. package/lib/components/FileWindowPanel/Header/AfterUploadActionBtns.js +69 -0
  280. package/lib/components/FileWindowPanel/Header/BeforeUploadActionBtns.js +100 -0
  281. package/lib/components/FileWindowPanel/Header/FileWindowHeader.styled.js +56 -0
  282. package/lib/components/FileWindowPanel/Header/MutualActionBtns.js +92 -0
  283. package/lib/components/FileWindowPanel/Header/index.js +109 -0
  284. package/lib/components/FileWindowPanel/index.js +60 -0
  285. package/lib/components/Filters/Filters.constants.js +358 -0
  286. package/lib/components/Filters/Filters.styled.js +235 -0
  287. package/lib/components/Filters/Filters.utils.js +536 -0
  288. package/lib/components/Filters/FiltersContext.js +59 -0
  289. package/lib/components/Filters/FiltersSkeleton.js +14 -0
  290. package/lib/components/Filters/Groups/Date/index.js +201 -0
  291. package/lib/components/Filters/Groups/Folders/FoldersSkeleton.js +43 -0
  292. package/lib/components/Filters/Groups/Folders/index.js +109 -0
  293. package/lib/components/Filters/Groups/Image/Colors.js +73 -0
  294. package/lib/components/Filters/Groups/Image/Faces.js +64 -0
  295. package/lib/components/Filters/Groups/Image/Orientations.js +64 -0
  296. package/lib/components/Filters/Groups/Image/Resolutions.js +65 -0
  297. package/lib/components/Filters/Groups/Image/Tooltip.js +14 -0
  298. package/lib/components/Filters/Groups/Image/index.js +104 -0
  299. package/lib/components/Filters/Groups/LicenseExpiry/LicenseExpiry.styled.js +17 -0
  300. package/lib/components/Filters/Groups/LicenseExpiry/index.js +97 -0
  301. package/lib/components/Filters/Groups/Metadata/Advanced/ConditionSelector.js +40 -0
  302. package/lib/components/Filters/Groups/Metadata/Advanced/ExtraRow/ConditionSelector.js +35 -0
  303. package/lib/components/Filters/Groups/Metadata/Advanced/ExtraRow/ValueSelector.js +33 -0
  304. package/lib/components/Filters/Groups/Metadata/Advanced/ExtraRow/index.js +18 -0
  305. package/lib/components/Filters/Groups/Metadata/Advanced/Field/AutoComplete.js +56 -0
  306. package/lib/components/Filters/Groups/Metadata/Advanced/Field/Boolean.js +35 -0
  307. package/lib/components/Filters/Groups/Metadata/Advanced/Field/Date.js +36 -0
  308. package/lib/components/Filters/Groups/Metadata/Advanced/Field/GeoPointField.js +30 -0
  309. package/lib/components/Filters/Groups/Metadata/Advanced/Field/Numeric.js +32 -0
  310. package/lib/components/Filters/Groups/Metadata/Advanced/Field/Select.js +55 -0
  311. package/lib/components/Filters/Groups/Metadata/Advanced/Field/Tags.js +21 -0
  312. package/lib/components/Filters/Groups/Metadata/Advanced/Field/Text.js +39 -0
  313. package/lib/components/Filters/Groups/Metadata/Advanced/Field/index.js +52 -0
  314. package/lib/components/Filters/Groups/Metadata/Advanced/KeySelector.js +34 -0
  315. package/lib/components/Filters/Groups/Metadata/Advanced/Row.js +53 -0
  316. package/lib/components/Filters/Groups/Metadata/Advanced/index.js +48 -0
  317. package/lib/components/Filters/Groups/Metadata/Basic/Field/Date.js +45 -0
  318. package/lib/components/Filters/Groups/Metadata/Basic/Field/Field.utils.js +58 -0
  319. package/lib/components/Filters/Groups/Metadata/Basic/Field/Numeric.js +51 -0
  320. package/lib/components/Filters/Groups/Metadata/Basic/Field/OptionsPopup.js +87 -0
  321. package/lib/components/Filters/Groups/Metadata/Basic/Field/Select.js +168 -0
  322. package/lib/components/Filters/Groups/Metadata/Basic/Field/Switch.js +41 -0
  323. package/lib/components/Filters/Groups/Metadata/Basic/Field/Tags.js +38 -0
  324. package/lib/components/Filters/Groups/Metadata/Basic/Field/Text.js +57 -0
  325. package/lib/components/Filters/Groups/Metadata/Basic/Field/Uri.js +54 -0
  326. package/lib/components/Filters/Groups/Metadata/Basic/Field/index.js +46 -0
  327. package/lib/components/Filters/Groups/Metadata/Basic/GroupWrapper.js +79 -0
  328. package/lib/components/Filters/Groups/Metadata/Basic/index.js +80 -0
  329. package/lib/components/Filters/Groups/Metadata/Metadata.constants.js +42 -0
  330. package/lib/components/Filters/Groups/Metadata/Metadata.styled.js +150 -0
  331. package/lib/components/Filters/Groups/Metadata/Metadata.utils.js +160 -0
  332. package/lib/components/Filters/Groups/Metadata/MetadataFiltersContext.js +329 -0
  333. package/lib/components/Filters/Groups/Metadata/Placeholder.js +25 -0
  334. package/lib/components/Filters/Groups/Metadata/common/TagsField/TagsMenu.js +81 -0
  335. package/lib/components/Filters/Groups/Metadata/common/TagsField/TagsSearchPlaceholder.js +18 -0
  336. package/lib/components/Filters/Groups/Metadata/common/TagsField/index.js +142 -0
  337. package/lib/components/Filters/Groups/Metadata/index.js +111 -0
  338. package/lib/components/Filters/Groups/Size/index.js +125 -0
  339. package/lib/components/Filters/Groups/Tags/FilteredTags.js +62 -0
  340. package/lib/components/Filters/Groups/Tags/SelectedTags.js +51 -0
  341. package/lib/components/Filters/Groups/Tags/SuggestedTags.js +43 -0
  342. package/lib/components/Filters/Groups/Tags/index.js +146 -0
  343. package/lib/components/Filters/Groups/TypeAndFormat/Format.js +65 -0
  344. package/lib/components/Filters/Groups/TypeAndFormat/Type.js +85 -0
  345. package/lib/components/Filters/Groups/TypeAndFormat/index.js +114 -0
  346. package/lib/components/Filters/Groups/common/DateRangeField/DateRangeField.styled.js +10 -0
  347. package/lib/components/Filters/Groups/common/DateRangeField/index.js +72 -0
  348. package/lib/components/Filters/Groups/common/FilterFooter.js +67 -0
  349. package/lib/components/Filters/Groups/common/FilterOptions.js +29 -0
  350. package/lib/components/Filters/Groups/common/FilterSearch.js +22 -0
  351. package/lib/components/Filters/Groups/common/FilterSearch.styled.js +15 -0
  352. package/lib/components/Filters/Groups/common/FilterSkeleton.js +44 -0
  353. package/lib/components/Filters/Groups/common/TimeFrames.js +35 -0
  354. package/lib/components/Filters/Groups/index.js +55 -0
  355. package/lib/components/Filters/Placeholder.js +29 -0
  356. package/lib/components/Filters/hooks/useDateTypeFilterValues.js +182 -0
  357. package/lib/components/Filters/hooks/useFilters.js +78 -0
  358. package/lib/components/Filters/index.js +78 -0
  359. package/lib/components/FoldersView/FoldersTree/FoldersTree.styled.js +193 -0
  360. package/lib/components/FoldersView/FoldersTree/FoldersTree.utils.js +78 -0
  361. package/lib/components/FoldersView/FoldersTree/FoldersTreeHeader.js +52 -0
  362. package/lib/components/FoldersView/FoldersTree/FoldersTreeList.js +64 -0
  363. package/lib/components/FoldersView/FoldersTree/FoldersTreeListItem.js +270 -0
  364. package/lib/components/FoldersView/FoldersTree/FoldersTreeSearch.js +70 -0
  365. package/lib/components/FoldersView/FoldersTree/FoldersTreeSkeleton.js +23 -0
  366. package/lib/components/FoldersView/FoldersTree/NoFoldersResult.js +19 -0
  367. package/lib/components/FoldersView/FoldersTree/SearchedFoldersItem.js +113 -0
  368. package/lib/components/FoldersView/FoldersTree/index.js +163 -0
  369. package/lib/components/FoldersView/hooks/useAddFolder.js +60 -0
  370. package/lib/components/FoldersView/index.js +256 -0
  371. package/lib/components/GalleryRoleSelect/CustomRolesTab.js +47 -0
  372. package/lib/components/GalleryRoleSelect/CustomRolesTab.styled.js +10 -0
  373. package/lib/components/GalleryRoleSelect/GalleryRoleSelect.constants.js +11 -0
  374. package/lib/components/GalleryRoleSelect/GalleryRoleSelect.styled.js +132 -0
  375. package/lib/components/GalleryRoleSelect/GalleryRoleSelect.utils.js +87 -0
  376. package/lib/components/GalleryRoleSelect/StandardRolesTab.js +58 -0
  377. package/lib/components/GalleryRoleSelect/index.js +234 -0
  378. package/lib/components/HeaderBar/FacetedSearchToggleButton.js +28 -0
  379. package/lib/components/HeaderBar/HeaderBar.styled.js +25 -0
  380. package/lib/components/HeaderBar/RightSide.js +127 -0
  381. package/lib/components/HeaderBar/index.js +77 -0
  382. package/lib/components/ImageEditorPanel/index.js +33 -0
  383. package/lib/components/InfiniteScroll/InfiniteScroll.js +97 -0
  384. package/lib/components/InfiniteScroll/InfiniteScroll.styled.js +11 -0
  385. package/lib/components/Informer/index.js +9 -0
  386. package/lib/components/LoginScreen/LoginScreen.styled.js +39 -0
  387. package/lib/components/LoginScreen/index.js +133 -0
  388. package/lib/components/MainMenu/MainMenu.styled.js +12 -0
  389. package/lib/components/MainMenu/index.js +77 -0
  390. package/lib/components/Modals/ConfirmationModal/ConfirmationModal.hooks.js +101 -0
  391. package/lib/components/Modals/ConfirmationModal/index.js +1 -0
  392. package/lib/components/Modals/DeleteItems/DeleteItems.hooks.js +233 -0
  393. package/lib/components/Modals/DeleteItems/index.js +1 -0
  394. package/lib/components/Modals/DeleteModal/DeleteModal.hooks.js +87 -0
  395. package/lib/components/Modals/DeleteModal/index.js +1 -0
  396. package/lib/components/Modals/DownloadConsent/DownlaodConsent.styled.js +8 -0
  397. package/lib/components/Modals/DownloadConsent/DownloadConsent.hooks.js +90 -0
  398. package/lib/components/Modals/DownloadConsent/DownloadConsentContent.js +52 -0
  399. package/lib/components/Modals/DownloadConsent/index.js +2 -0
  400. package/lib/components/Modals/Modals.js +384 -0
  401. package/lib/components/Modals/Modals.styled.js +80 -0
  402. package/lib/components/Modals/MoveItems/MoveItems.hooks.js +88 -0
  403. package/lib/components/Modals/MoveItems/index.js +1 -0
  404. package/lib/components/Modals/TransformedDownload/PdfModalContent.js +109 -0
  405. package/lib/components/Modals/TransformedDownload/TransformedDownload.hooks.js +188 -0
  406. package/lib/components/Modals/TransformedDownload/TransformedDownload.styled.js +29 -0
  407. package/lib/components/Modals/TransformedDownload/TransformedDownload.utils.js +46 -0
  408. package/lib/components/Modals/TransformedDownload/index.js +2 -0
  409. package/lib/components/Modals/index.js +7 -0
  410. package/lib/components/Modals/index.scss +0 -0
  411. package/lib/components/NoItems/NoItems.styled.js +54 -0
  412. package/lib/components/NoItems/index.js +50 -0
  413. package/lib/components/PdftronPanel/index.js +31 -0
  414. package/lib/components/PickerPanel/PickerPanel.styled.js +41 -0
  415. package/lib/components/PickerPanel/PickerPanelContent.js +95 -0
  416. package/lib/components/PickerPanel/index.js +21 -0
  417. package/lib/components/ProgressPanel/ProgressPanel.utils.js +29 -0
  418. package/lib/components/ProgressPanel/index.js +37 -0
  419. package/lib/components/TopBar/AppliedFilterChips/AppliedFilterChips.styled.js +11 -0
  420. package/lib/components/TopBar/AppliedFilterChips/index.js +77 -0
  421. package/lib/components/TopBar/Search/ContextDropdown/ContextDropdown.styled.js +59 -0
  422. package/lib/components/TopBar/Search/ContextDropdown/ContextDropdown.utils.js +67 -0
  423. package/lib/components/TopBar/Search/ContextDropdown/index.js +170 -0
  424. package/lib/components/TopBar/Search/PrependedOptions/TempFilterRegexInput.js +133 -0
  425. package/lib/components/TopBar/Search/Search.utils.js +88 -0
  426. package/lib/components/TopBar/Search/SimilarSearchTag.js +60 -0
  427. package/lib/components/TopBar/Search/index.js +278 -0
  428. package/lib/components/TopBar/TopBar.styled.js +37 -0
  429. package/lib/components/TopBar/index.js +61 -0
  430. package/lib/components/TopBar/index.scss +20 -0
  431. package/lib/components/TopSection/TopSection.styled.js +22 -0
  432. package/lib/components/TopSection/index.js +58 -0
  433. package/lib/components/UploadBar/UploadBar.styled.js +84 -0
  434. package/lib/components/UploadBar/index.js +212 -0
  435. package/lib/components/UploadStatus/index.js +20 -0
  436. package/lib/components/UploadsPanel/UploadsList/Header.js +19 -0
  437. package/lib/components/UploadsPanel/UploadsList/List.js +29 -0
  438. package/lib/components/UploadsPanel/UploadsList/PreUploadPlugins.js +22 -0
  439. package/lib/components/UploadsPanel/UploadsList/UploadsList.styled.js +64 -0
  440. package/lib/components/UploadsPanel/UploadsList/UploadsList.utils.js +17 -0
  441. package/lib/components/UploadsPanel/UploadsList/UploadsVirtualGrid.js +25 -0
  442. package/lib/components/UploadsPanel/UploadsList/index.js +55 -0
  443. package/lib/components/UploadsPanel/UploadsPanel.styled.js +24 -0
  444. package/lib/components/UploadsPanel/UploadsPanelTopBar.js +16 -0
  445. package/lib/components/UploadsPanel/index.js +36 -0
  446. package/lib/components/UrlBuilderModal/UrlBuilderModal.styled.js +9 -0
  447. package/lib/components/UrlBuilderModal/index.js +93 -0
  448. package/lib/components/Views/ErroredViewPlaceholder.js +48 -0
  449. package/lib/components/Views/Views.constants.js +29 -0
  450. package/lib/components/Views/Views.styled.js +87 -0
  451. package/lib/components/Views/index.js +100 -0
  452. package/lib/components/common/DeleteModalItemText/DeleteModalItemText.styled.js +8 -0
  453. package/lib/components/common/DeleteModalItemText/index.js +24 -0
  454. package/lib/components/common/EditDetailsButton/EditDetailsButton.styled.js +35 -0
  455. package/lib/components/common/EditDetailsButton/index.js +28 -0
  456. package/lib/components/common/ExpiryDateTooltipContent/ExpiryDateTooltipContent.styled.js +16 -0
  457. package/lib/components/common/ExpiryDateTooltipContent/index.js +29 -0
  458. package/lib/components/common/FileApprovalsInfoPopup/index.js +46 -0
  459. package/lib/components/common/FileMetadataFieldValue/CustomMetadataFieldValue.js +48 -0
  460. package/lib/components/common/FileMetadataFieldValue/FileMetadataFieldValue.styled.js +66 -0
  461. package/lib/components/common/FileMetadataFieldValue/FileMetadataFieldValue.utils.js +311 -0
  462. package/lib/components/common/FileMetadataFieldValue/GeneralMetadataFieldValue.js +120 -0
  463. package/lib/components/common/FileMetadataFieldValue/index.js +26 -0
  464. package/lib/components/common/FileMetadataFieldValue/utils/getFontInfo.js +78 -0
  465. package/lib/components/common/FolderSelector/BrowseFoldersMenu.js +114 -0
  466. package/lib/components/common/FolderSelector/FolderSearchMenu.js +45 -0
  467. package/lib/components/common/FolderSelector/FolderSelector.styled.js +41 -0
  468. package/lib/components/common/FolderSelector/index.js +186 -0
  469. package/lib/components/common/FormattedUriLink/FormattedUriLink.styled.js +15 -0
  470. package/lib/components/common/FormattedUriLink/index.js +21 -0
  471. package/lib/components/common/OriginalBadge/OriginalBadge.styled.js +17 -0
  472. package/lib/components/common/OriginalBadge/index.js +14 -0
  473. package/lib/components/common/SanitizedHtmlElement/index.js +11 -0
  474. package/lib/components/common/Sort/Sort.constants.js +61 -0
  475. package/lib/components/common/Sort/Sort.styled.js +47 -0
  476. package/lib/components/common/Sort/Sort.utils.js +14 -0
  477. package/lib/components/common/Sort/index.js +183 -0
  478. package/lib/components/common/TextWithCopyIcon/TextWithCopyIcon.styled.js +44 -0
  479. package/lib/components/common/TextWithCopyIcon/index.js +71 -0
  480. package/lib/components/common/TopBarUploadButton/index.js +40 -0
  481. package/lib/components/common/TrimmedFilePathWithLocate/TrimmedFilePathWithLocate.utils.js +3 -0
  482. package/lib/components/common/TrimmedFilePathWithLocate/index.js +34 -0
  483. package/lib/components/common/TrimmedFolderPathWithLocate/index.js +13 -0
  484. package/lib/components/common/TrimmedPathWithLocate/TrimmedPathWithLocate.styled.js +30 -0
  485. package/lib/components/common/TrimmedPathWithLocate/index.js +40 -0
  486. package/lib/components/metadata.adapter.js +365 -0
  487. package/lib/defaultLocale.js +1353 -0
  488. package/lib/hooks/index.js +16 -0
  489. package/lib/hooks/useAssetPicker.js +213 -0
  490. package/lib/hooks/useDownloadFilesCsv.js +20 -0
  491. package/lib/hooks/useEditFileDetails.js +505 -0
  492. package/lib/hooks/useExplorer.js +6 -0
  493. package/lib/hooks/useExplorerI18n.js +10 -0
  494. package/lib/hooks/useExplorerInformer.js +10 -0
  495. package/lib/hooks/useFetchFileFolderPermissions.js +31 -0
  496. package/lib/hooks/useFetchMetadataTagsBySearchQuery.js +38 -0
  497. package/lib/hooks/useFileMetadata.js +115 -0
  498. package/lib/hooks/useFilterSearch.js +37 -0
  499. package/lib/hooks/useForcedFilters.js +39 -0
  500. package/lib/hooks/useIsOverflow.js +25 -0
  501. package/lib/hooks/useIsSmallScreen.js +20 -0
  502. package/lib/hooks/useLocateFile.js +231 -0
  503. package/lib/hooks/usePrevious.js +9 -0
  504. package/lib/hooks/useSearchSuggestions.js +168 -0
  505. package/lib/hooks/useStartUpload.js +43 -0
  506. package/lib/hooks/useToLocaleNumber.js +14 -0
  507. package/lib/hooks/useValidateFileName.js +324 -0
  508. package/lib/index.js +1560 -0
  509. package/lib/slices/common.slice.js +254 -0
  510. package/lib/slices/drag.slice.js +75 -0
  511. package/lib/slices/files.slice.js +1307 -0
  512. package/lib/slices/filters.slice.js +382 -0
  513. package/lib/slices/folders.slice.js +964 -0
  514. package/lib/slices/foldersTree.slice.js +501 -0
  515. package/lib/slices/index.js +32 -0
  516. package/lib/slices/metadata.slice.js +487 -0
  517. package/lib/slices/panels.slice.js +351 -0
  518. package/lib/slices/search.slice.js +995 -0
  519. package/lib/slices/selections.slice.js +315 -0
  520. package/lib/slices/targets.slice.js +44 -0
  521. package/lib/slices/topSection.slice.js +71 -0
  522. package/lib/slices/views.slice.js +346 -0
  523. package/lib/style.scss +265 -0
  524. package/lib/thunks/archive.thunks.js +175 -0
  525. package/lib/thunks/downloads.thunks.js +416 -0
  526. package/lib/thunks/items.thunks.js +274 -0
  527. package/lib/thunks/permissions.thunks.js +66 -0
  528. package/lib/thunks/uploads.thunks.js +235 -0
  529. package/lib/utils/SearchSuggestions/SearchSuggestionsMenu.js +95 -0
  530. package/lib/utils/SearchSuggestions/SuggestionMode.js +70 -0
  531. package/lib/utils/SearchSuggestions/SuggestionModeAttribute.js +87 -0
  532. package/lib/utils/SearchSuggestions/SuggestionModeExpression.js +121 -0
  533. package/lib/utils/SearchSuggestions/SuggestionModeTag.js +87 -0
  534. package/lib/utils/SearchSuggestions/SuggestionsManager.js +242 -0
  535. package/lib/utils/SearchSuggestions/constants.js +14 -0
  536. package/lib/utils/SearchSuggestions/index.js +4 -0
  537. package/lib/utils/SearchSuggestions/styled.js +12 -0
  538. package/lib/utils/availableScreenSizes.js +4 -0
  539. package/lib/utils/constants.js +14 -0
  540. package/lib/utils/convertItemsToFilesFoldersUuids.js +12 -0
  541. package/lib/utils/convertItemstoFoldersParentUuids.js +12 -0
  542. package/lib/utils/createPromise.js +9 -0
  543. package/lib/utils/createSuperFocus.js +43 -0
  544. package/lib/utils/decodeB64ToStr.js +11 -0
  545. package/lib/utils/filters.js +333 -0
  546. package/lib/utils/formatFolderPath.js +10 -0
  547. package/lib/utils/formatPinSubTitle.js +17 -0
  548. package/lib/utils/getAcquirerTitle.js +10 -0
  549. package/lib/utils/getActiveOverlayEl.js +11 -0
  550. package/lib/utils/getApiPathtype.js +10 -0
  551. package/lib/utils/getClosestStr.js +22 -0
  552. package/lib/utils/getItemUuids.js +12 -0
  553. package/lib/utils/getLabelsTotalAssetsCount.js +6 -0
  554. package/lib/utils/getMoveAndDeleteData.js +15 -0
  555. package/lib/utils/getParentFolderPath.js +4 -0
  556. package/lib/utils/getQueryStringFromUrl.js +6 -0
  557. package/lib/utils/getScrollableParent.js +15 -0
  558. package/lib/utils/getStringValueExistedInObj.js +9 -0
  559. package/lib/utils/isEmbeddableAsset.js +6 -0
  560. package/lib/utils/isFileVersion.js +9 -0
  561. package/lib/utils/mapArrayKeysToObjValues.js +33 -0
  562. package/lib/utils/mapFiltersToShownFormat.js +252 -0
  563. package/lib/utils/prepareExportedFilesLinks.js +12 -0
  564. package/lib/utils/prepareSearchUrl.js +65 -0
  565. package/lib/utils/removeBackground.js +60 -0
  566. package/lib/utils/removeExtraUrlParams.js +13 -0
  567. package/lib/utils/scrollToAndFocusItemElement.js +16 -0
  568. package/lib/utils/toggleFolderNotFoundModal.js +25 -0
  569. package/lib/utils/trapFocus.js +59 -0
  570. package/lib/utils/truncateString.js +28 -0
  571. package/package.json +55 -0
  572. package/types/index.d.ts +108 -0
@@ -0,0 +1,181 @@
1
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
2
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
4
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
5
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
6
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
7
+ import { useState } from 'react';
8
+ import { useSelector } from 'react-redux';
9
+ import { Spinner } from '@scaleflex/widget-common';
10
+ import { TooltipV2 } from '@scaleflex/ui/core';
11
+ import { FILE_WINDOW_TAB_IDS } from '@scaleflex/widget-utils/lib/constants';
12
+ import { useExplorer } from '@scaleflex/widget-explorer/lib/hooks';
13
+ import CustomMetadataSection from './CustomMetadataSection';
14
+ import EmbeddedMetadataSection from './EmbeddedMetadataSection';
15
+ import StyledMetadataTab from './MetadataTab.styled';
16
+ import MetadataTabSkeleton from './MetadataTabSkeleton';
17
+ import { selectIsM0LegacyMeta, selectMetadataModel } from '../../../../slices/metadata.slice';
18
+ import EditDetailsButton from '../../../common/EditDetailsButton';
19
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
20
+ var MetadataTab = function MetadataTab(_ref) {
21
+ var _file$info3;
22
+ var originalFile = _ref.originalFile,
23
+ file = _ref.previewedFile,
24
+ setIsTabsHidden = _ref.setIsTabsHidden,
25
+ isPreUpload = _ref.isPreUpload,
26
+ i18n = _ref.i18n,
27
+ alertUnsavedChangesFirst = _ref.alertUnsavedChangesFirst,
28
+ isFileLoading = _ref.isFileLoading,
29
+ editFileDetailsProps = _ref.editFileDetailsProps;
30
+ var _useExplorer = useExplorer(),
31
+ checkUserPermissions = _useExplorer.checkUserPermissions;
32
+ var _ref2 = editFileDetailsProps || {},
33
+ isEditing = _ref2.isEditing,
34
+ cancelEditing = _ref2.cancelEditing,
35
+ enableEditing = _ref2.enableEditing,
36
+ editedDetails = _ref2.editedDetails,
37
+ setDetails = _ref2.setDetails,
38
+ saveEditedDetails = _ref2.saveEditedDetails,
39
+ isUserNotAllowedToEdit = _ref2.isUserNotAllowedToEdit,
40
+ metaErrors = _ref2.metaErrors,
41
+ setMetaErrors = _ref2.setMetaErrors,
42
+ isSaving = _ref2.isSaving,
43
+ scrollToMetaField = _ref2.scrollToMetaField,
44
+ isSaveDisabled = _ref2.isSaveDisabled,
45
+ isCustomMetadataOpened = _ref2.isCustomMetadataOpened,
46
+ setIsCustomMetadataOpened = _ref2.setIsCustomMetadataOpened;
47
+ var _file$info = file.info,
48
+ _file$info2 = _file$info === void 0 ? {} : _file$info,
49
+ _file$info2$metadata = _file$info2.metadata,
50
+ embeddedMetadata = _file$info2$metadata === void 0 ? {} : _file$info2$metadata;
51
+ var metadataModel = useSelector(selectMetadataModel);
52
+ var isM0LegacyMeta = useSelector(selectIsM0LegacyMeta);
53
+ var _useState = useState(false),
54
+ _useState2 = _slicedToArray(_useState, 2),
55
+ isEmbeddedMetadataOpened = _useState2[0],
56
+ setIsEmbeddedMetadataOpened = _useState2[1];
57
+ var isEmbeddedMetadataEmpty = Object.keys(embeddedMetadata).length === 0;
58
+ var toggleCustomFields = function toggleCustomFields() {
59
+ if (isEditing && isCustomMetadataOpened) {
60
+ return;
61
+ }
62
+ setIsCustomMetadataOpened(function (_isOpened) {
63
+ return !_isOpened;
64
+ });
65
+ };
66
+ var toggleMetadata = function toggleMetadata() {
67
+ setIsEmbeddedMetadataOpened(function (_isOpened) {
68
+ return !_isOpened;
69
+ });
70
+ };
71
+ var toggleMetadataTabSection = function toggleMetadataTabSection() {
72
+ if (isEmbeddedMetadataEmpty) {
73
+ return;
74
+ }
75
+ toggleMetadata();
76
+ toggleCustomFields();
77
+ };
78
+ var enableEditingOriginalFileOnly = function enableEditingOriginalFileOnly() {
79
+ if (originalFile.uuid !== file.uuid) {
80
+ return;
81
+ }
82
+ enableEditing({
83
+ forceUseFileWindow: false,
84
+ tabId: FILE_WINDOW_TAB_IDS.METADATA
85
+ });
86
+ setIsTabsHidden(true);
87
+ };
88
+ var cancelEditingWithAlert = function cancelEditingWithAlert() {
89
+ alertUnsavedChangesFirst(function () {
90
+ if (!isPreUpload) setIsTabsHidden(false);
91
+ cancelEditing();
92
+ });
93
+ };
94
+ var renderNoValue = function renderNoValue() {
95
+ return /*#__PURE__*/_jsx(StyledMetadataTab.NoValueWrapper, {
96
+ children: "\u2014"
97
+ });
98
+ };
99
+ var tabSections = [{
100
+ i18nStr: 'tabSectionEmbeddedMetadataLabel',
101
+ component: EmbeddedMetadataSection,
102
+ isOpened: isEmbeddedMetadataOpened,
103
+ toggleFn: toggleMetadata,
104
+ hide: Object.keys(((_file$info3 = file.info) === null || _file$info3 === void 0 ? void 0 : _file$info3.metadata) || {}).length === 0 || isM0LegacyMeta || !isEmbeddedMetadataOpened
105
+ }, {
106
+ i18nStr: 'tabSectionCustomMetadataLabel',
107
+ component: CustomMetadataSection,
108
+ isOpened: isCustomMetadataOpened,
109
+ toggleFn: toggleCustomFields,
110
+ hide: !metadataModel || isM0LegacyMeta || !isCustomMetadataOpened
111
+ }];
112
+ if (isFileLoading) {
113
+ return /*#__PURE__*/_jsx(MetadataTabSkeleton, {});
114
+ }
115
+ return /*#__PURE__*/_jsxs(StyledMetadataTab.Wrapper, {
116
+ isEditing: isEditing,
117
+ children: [/*#__PURE__*/_jsxs(StyledMetadataTab.DetailsSidebarNavigation, {
118
+ children: [/*#__PURE__*/_jsx(StyledMetadataTab.DetailsSidebarNavigationBtn, {
119
+ isChecked: isCustomMetadataOpened,
120
+ onClick: toggleMetadataTabSection,
121
+ children: i18n('explorerDetailsSidebarMetadataTabCustomLabel')
122
+ }), isEmbeddedMetadataEmpty ? /*#__PURE__*/_jsx(TooltipV2, {
123
+ title: i18n('explorerDetailsSidebarMetadataTabNoEmbeddedHint'),
124
+ position: "top",
125
+ size: "md",
126
+ children: /*#__PURE__*/_jsx(StyledMetadataTab.DetailsSidebarNavigationBtn, {
127
+ $disabled: isEmbeddedMetadataEmpty,
128
+ isChecked: isEmbeddedMetadataOpened,
129
+ children: i18n('explorerDetailsSidebarMetadataTabEmbeddedLabel')
130
+ })
131
+ }) : /*#__PURE__*/_jsx(StyledMetadataTab.DetailsSidebarNavigationBtn, {
132
+ $disabled: isEmbeddedMetadataEmpty,
133
+ isChecked: isEmbeddedMetadataOpened,
134
+ onClick: toggleMetadataTabSection,
135
+ children: i18n('explorerDetailsSidebarMetadataTabEmbeddedLabel')
136
+ })]
137
+ }), /*#__PURE__*/_jsx(StyledMetadataTab.TabSections, {
138
+ isEditing: isEditing,
139
+ children: tabSections.map(function (section) {
140
+ return !section.hide && /*#__PURE__*/_jsx(section.component, {
141
+ i18n: i18n,
142
+ checkUserPermissions: checkUserPermissions,
143
+ file: file,
144
+ isEditing: isEditing,
145
+ formRef: section.formRef,
146
+ editedDetails: editedDetails,
147
+ updateEditedDetails: setDetails,
148
+ metaErrors: metaErrors,
149
+ setMetaErrors: setMetaErrors,
150
+ renderNoValue: renderNoValue,
151
+ isUserNotAllowedToEdit: isUserNotAllowedToEdit || originalFile.uuid !== file.uuid,
152
+ enableEditing: enableEditingOriginalFileOnly,
153
+ scrollToMetaField: scrollToMetaField,
154
+ dismissMarginBottom: true
155
+ }, section.i18nStr);
156
+ })
157
+ }), isEditing && /*#__PURE__*/_jsxs(StyledMetadataTab.ActionsBtns, {
158
+ children: [/*#__PURE__*/_jsx(StyledMetadataTab.ActionBtn, {
159
+ size: "sm",
160
+ color: "basic",
161
+ onClick: cancelEditingWithAlert,
162
+ disabled: isSaving,
163
+ children: i18n('mutualizedCancelButtonLabel')
164
+ }), /*#__PURE__*/_jsx(StyledMetadataTab.ActionBtn, {
165
+ size: "sm",
166
+ color: "primary",
167
+ onClick: saveEditedDetails,
168
+ disabled: isSaveDisabled || isSaving,
169
+ children: isSaving ? /*#__PURE__*/_jsx(Spinner, {}) : i18n('mutualizedSaveButton')
170
+ })]
171
+ }), !isEditing && /*#__PURE__*/_jsx(StyledMetadataTab.EditDetailsBtnWrapper, {
172
+ children: /*#__PURE__*/_jsx(EditDetailsButton, {
173
+ enableEditing: enableEditingOriginalFileOnly,
174
+ isUserNotAllowedToEdit: isUserNotAllowedToEdit,
175
+ mt: "75px",
176
+ mr: "24px"
177
+ })
178
+ })]
179
+ });
180
+ };
181
+ export default MetadataTab;
@@ -0,0 +1,78 @@
1
+ import getFileLink from '@scaleflex/widget-utils/lib/getFileLink';
2
+ import LinkHelper from '@scaleflex/widget-utils/lib/LinkHelper';
3
+ import getFormattedPreviewUrl from '@scaleflex/widget-utils/lib/getFormattedPreviewUrl';
4
+ import { Image } from '@scaleflex/widget-common';
5
+ import { EllipsedText, TextWithHighlights } from '@scaleflex/ui/core';
6
+ import { useExplorer } from '../../../../hooks';
7
+ import VariationsTopOptions from './VariationsTopOptions';
8
+ import StyledVariants from './Variations.styled';
9
+ import { VARIATIONS_TAB_IDS } from './Variations.constants';
10
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
+ var VariationItem = function VariationItem(_ref) {
12
+ var isOriginal = _ref.isOriginal,
13
+ isRemovedBackground = _ref.isRemovedBackground,
14
+ searchQuery = _ref.searchQuery,
15
+ isActive = _ref.isActive,
16
+ variant = _ref.variant,
17
+ onClick = _ref.onClick,
18
+ activeTabId = _ref.activeTabId,
19
+ deleteVariant = _ref.deleteVariant,
20
+ editVariantFile = _ref.editVariantFile,
21
+ editVariantName = _ref.editVariantName,
22
+ isUserPermittedToEditVariant = _ref.isUserPermittedToEditVariant;
23
+ var _useExplorer = useExplorer(),
24
+ isDevEnv = _useExplorer.isDevEnv,
25
+ container = _useExplorer.container,
26
+ i18n = _useExplorer.i18n;
27
+ var hideUpdateOperations = isOriginal || isRemovedBackground || !isUserPermittedToEditVariant || activeTabId === VARIATIONS_TAB_IDS.AUTOMATIC;
28
+ var previewUrl = getFormattedPreviewUrl({
29
+ // order here is important as we must use the preview url if exists
30
+ url: variant.preview || getFileLink(variant),
31
+ isDevEnv: isDevEnv,
32
+ containerToken: container
33
+ });
34
+ var variantImgSrc = new LinkHelper({
35
+ href: isRemovedBackground || activeTabId === VARIATIONS_TAB_IDS.AUTOMATIC ? getFileLink(variant) : previewUrl || '',
36
+ wrapEncodeUrl: true
37
+ }).appendSearchParams({
38
+ func: 'fit',
39
+ w: 218,
40
+ h: 142
41
+ });
42
+ return /*#__PURE__*/_jsxs(StyledVariants.Item, {
43
+ $isActive: isActive,
44
+ onClick: onClick,
45
+ children: [/*#__PURE__*/_jsx(VariationsTopOptions, {
46
+ variant: variant,
47
+ deleteVariant: deleteVariant,
48
+ editVariantFile: editVariantFile,
49
+ editName: editVariantName,
50
+ hideUpdateOperations: hideUpdateOperations,
51
+ isOriginal: isOriginal
52
+ }), /*#__PURE__*/_jsx(StyledVariants.ItemImg, {
53
+ children: /*#__PURE__*/_jsx(Image, {
54
+ src: variantImgSrc,
55
+ alt: variant.name,
56
+ title: variant.name
57
+ })
58
+ }), /*#__PURE__*/_jsx(StyledVariants.ItemNameWrapper, {
59
+ children: /*#__PURE__*/_jsxs(StyledVariants.ItemFooterWrapper, {
60
+ children: [/*#__PURE__*/_jsx(StyledVariants.ItemName, {
61
+ children: /*#__PURE__*/_jsx(EllipsedText, {
62
+ maxLinesCount: 1,
63
+ children: searchQuery ? /*#__PURE__*/_jsx(TextWithHighlights, {
64
+ text: variant.name,
65
+ highlightText: searchQuery
66
+ }) : variant.name
67
+ })
68
+ }), (isOriginal || isRemovedBackground) && /*#__PURE__*/_jsx(StyledVariants.VariantBadge, {
69
+ label: i18n(isRemovedBackground ? 'mutualizedRemovedBackgroundLabel' : 'mutualizedOriginalLabel'),
70
+ variant: "filled",
71
+ size: "sm",
72
+ $isSecondaryColor: isRemovedBackground
73
+ })]
74
+ })
75
+ })]
76
+ });
77
+ };
78
+ export default VariationItem;
@@ -0,0 +1,22 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
3
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
4
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
5
+ var VARIATIONS_TAB_IDS = {
6
+ MANUAL: 'manual',
7
+ AUTOMATIC: 'automatic'
8
+ };
9
+ var VARIATIONS_TAB = _defineProperty(_defineProperty({}, VARIATIONS_TAB_IDS.MANUAL, {
10
+ id: VARIATIONS_TAB_IDS.MANUAL,
11
+ i18nKey: 'explorerFileWindowVariationsManualTabLabel'
12
+ }), VARIATIONS_TAB_IDS.AUTOMATIC, {
13
+ id: VARIATIONS_TAB_IDS.AUTOMATIC,
14
+ i18nKey: 'explorerFileWindowVariationsAutomaticTabLabel',
15
+ disabled: function disabled(_ref) {
16
+ var presetsVariants = _ref.presetsVariants;
17
+ return (presetsVariants === null || presetsVariants === void 0 ? void 0 : presetsVariants.length) === 0;
18
+ }
19
+ });
20
+ var VARIATIONS_TABS = [VARIATIONS_TAB[VARIATIONS_TAB_IDS.MANUAL], VARIATIONS_TAB[VARIATIONS_TAB_IDS.AUTOMATIC]];
21
+ var VALID_QUERY_PARAMS_REGEX = /^([a-zA-Z0-9_-]+(?:\[\d+\])?=[a-zA-Z0-9._%,-]*)?(?:&[a-zA-Z0-9_-]+(?:\[\d+\])?=[a-zA-Z0-9._%,-]*)*(&wat_text=.*)?(&wat_fontsize=\d+(max)?)?$/;
22
+ export { VARIATIONS_TABS, VARIATIONS_TAB_IDS, VALID_QUERY_PARAMS_REGEX };
@@ -0,0 +1,175 @@
1
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21, _templateObject22, _templateObject23, _templateObject24, _templateObject25, _templateObject26, _templateObject27, _templateObject28, _templateObject29, _templateObject30;
2
+ function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
3
+ import styled, { css } from 'styled-components';
4
+ import { StatusLabel, Search, Skeleton, Tabs as SfxTabs, Tab as SfxTab } from '@scaleflex/ui/core';
5
+ import { FV, PC } from '@scaleflex/widget-common';
6
+ var Actions = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0 24px;\n height: 24px;\n margin: 18px 0;\n\n .SfxBadge {\n color: ", ";\n background-color: ", ";\n }\n\n .SfxButton-StartIcon {\n margin-right: 4px;\n }\n\n .SfxButton-Badge {\n margin-left: 4px;\n }\n\n svg {\n width: 14px;\n height: 14px;\n }\n"])), function (_ref) {
7
+ var theme = _ref.theme;
8
+ return theme.palette[PC.AccentStateless];
9
+ }, function (_ref2) {
10
+ var theme = _ref2.theme;
11
+ return theme.palette[PC.BackgroundStateless];
12
+ });
13
+ var Title = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n ", ";\n color: ", ";\n"])), function (_ref3) {
14
+ var font = _ref3.theme.typography.font;
15
+ return font[FV.TitleH4];
16
+ }, function (_ref4) {
17
+ var theme = _ref4.theme;
18
+ return theme.palette[PC.TextPrimary];
19
+ });
20
+ var VariantsWrapper = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: grid;\n grid-template-columns: repeat(2, 1fr);\n gap: 16px;\n margin: 16px 0 24px 0;\n overflow-y: auto;\n max-height: calc(100% - 184px);\n flex-wrap: wrap;\n padding: 0 24px;\n\n ", " {\n grid-template-columns: repeat(auto-fill, minmax(218px, 1fr));\n grid-auto-rows: minmax(218px, auto);\n }\n"])), function (_ref5) {
21
+ var theme = _ref5.theme;
22
+ return theme.breakpoints.down('lg');
23
+ });
24
+ var SpinnerWrapper = styled.div(function (_ref6) {
25
+ var theme = _ref6.theme;
26
+ return css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n justify-content: center;\n align-items: center;\n height: 170px;\n margin-top: 12px;\n\n ", " {\n height: 146px;\n }\n"])), theme.breakpoints.down('lg'));
27
+ });
28
+ var Item = styled.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n position: relative;\n max-width: 218px;\n min-height: 170px;\n border-radius: 2px;\n border: 1px solid ", ";\n overflow: hidden;\n display: flex;\n flex-direction: column;\n flex-shrink: 0;\n cursor: pointer;\n background: ", ";\n\n &:hover {\n .SfxStatusLabel-root {\n background: ", ";\n }\n }\n\n ", " {\n max-width: unset;\n }\n"])), function (_ref7) {
29
+ var theme = _ref7.theme,
30
+ $isActive = _ref7.$isActive;
31
+ return theme.palette[PC[$isActive ? 'AccentStateless' : 'BordersItem']];
32
+ }, function (_ref8) {
33
+ var $isActive = _ref8.$isActive,
34
+ theme = _ref8.theme;
35
+ return theme.palette[PC[$isActive ? 'BackgroundGrey' : 'BackgroundHover']];
36
+ }, function (_ref9) {
37
+ var theme = _ref9.theme;
38
+ return theme.palette[PC.AccentPrimaryHover];
39
+ }, function (_ref10) {
40
+ var theme = _ref10.theme;
41
+ return theme.breakpoints.down('lg');
42
+ });
43
+ var ItemImg = styled.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n width: 100%;\n height: 120px;\n flex-grow: 1;\n background: ", ";\n display: flex;\n align-items: center;\n justify-content: center;\n user-select: none;\n pointer-events: none;\n overflow: hidden;\n\n img {\n max-width: 218px;\n max-height: 142px;\n }\n"])), function (_ref11) {
44
+ var theme = _ref11.theme;
45
+ return theme.palette[PC.BackgroundStateless];
46
+ });
47
+ var ItemFooterWrapper = styled.div(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n"])));
48
+ var ItemNameWrapper = styled.div(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n padding: 6px 8px;\n height: 28px;\n\n ", ";\n color: ", ";\n"])), function (_ref12) {
49
+ var theme = _ref12.theme;
50
+ return theme.typography.font[FV.LabelExtraSmallUp];
51
+ }, function (_ref13) {
52
+ var theme = _ref13.theme;
53
+ return theme.palette[PC.TextPrimary];
54
+ });
55
+ var ItemName = styled.label(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n white-space: normal;\n"])));
56
+ var AddVariantBtn = styled.button(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n background: ", ";\n border: 1px dashed ", ";\n border-radius: 2px;\n cursor: pointer;\n max-width: 218px;\n min-height: 170px;\n flex-shrink: 0;\n user-select: none;\n ", ";\n color: ", ";\n\n > svg {\n color: ", ";\n }\n\n &:hover {\n background: ", ";\n }\n\n ", " {\n max-width: unset;\n }\n"])), function (_ref14) {
57
+ var theme = _ref14.theme;
58
+ return theme.palette[PC.BackgroundHover];
59
+ }, function (_ref15) {
60
+ var theme = _ref15.theme;
61
+ return theme.palette[PC.BordersItem];
62
+ }, function (_ref16) {
63
+ var theme = _ref16.theme;
64
+ return theme.typography.font[FV.ButtonMdEmphasis];
65
+ }, function (_ref17) {
66
+ var theme = _ref17.theme;
67
+ return theme.palette[PC.LinkStateless];
68
+ }, function (_ref18) {
69
+ var theme = _ref18.theme;
70
+ return theme.palette[PC.IconsPlaceholder];
71
+ }, function (_ref19) {
72
+ var theme = _ref19.theme;
73
+ return theme.palette[PC.BackgroundPrimaryHover];
74
+ }, function (_ref20) {
75
+ var theme = _ref20.theme;
76
+ return theme.breakpoints.down('lg');
77
+ });
78
+ var AddVariantBtnLabel = styled.span(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 4px;\n margin-top: 12px;\n\n ", ";\n"])), function (_ref21) {
79
+ var theme = _ref21.theme;
80
+ return theme.typography.font[FV.ButtonLgEmphasis];
81
+ });
82
+ var SearchWrapper = styled.div(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n padding: ", ";\n"])), function (_ref22) {
83
+ var disabled = _ref22.disabled;
84
+ return disabled ? 0 : '0 24px';
85
+ });
86
+ var SearchInput = styled(Search)(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["\n width: 100%;\n"])));
87
+ var NoVariantsPlaceholderWrapper = styled.div(_templateObject14 || (_templateObject14 = _taggedTemplateLiteral(["\n white-space: break-spaces;\n ", ";\n color: ", ";\n padding: 24px;\n height: calc(100% - 184px);\n text-align: center;\n display: flex;\n flex-direction: column;\n align-items: center;\n padding-top: 120px;\n gap: 8px;\n"])), function (_ref23) {
88
+ var theme = _ref23.theme;
89
+ return theme.typography.font[FV.LabelMedium];
90
+ }, function (_ref24) {
91
+ var theme = _ref24.theme;
92
+ return theme.palette[PC.LinkStateless];
93
+ });
94
+ var NoVariantsPlaceholder = styled.label(_templateObject15 || (_templateObject15 = _taggedTemplateLiteral(["\n word-break: break-word;\n overflow: overlay;\n"])));
95
+ var VariantBadge = styled(StatusLabel)(_templateObject16 || (_templateObject16 = _taggedTemplateLiteral(["\n background: ", ";\n\n padding: 2px 4px;\n margin-left: 10px;\n flex-shrink: 0;\n\n ", ";\n"])), function (_ref25) {
96
+ var theme = _ref25.theme,
97
+ $isSecondaryColor = _ref25.$isSecondaryColor;
98
+ return theme.palette[PC[$isSecondaryColor ? 'BackgroundPrimaryActive' : 'AccentStateless']];
99
+ }, function (_ref26) {
100
+ var theme = _ref26.theme;
101
+ return theme.typography.font[FV.LabelSmall];
102
+ });
103
+ var HighlightedName = styled.span(_templateObject17 || (_templateObject17 = _taggedTemplateLiteral(["\n background: ", ";\n"])), function (_ref27) {
104
+ var theme = _ref27.theme;
105
+ return theme.palette[PC.Accent_1_8_Opacity];
106
+ });
107
+ var VariantName = styled.div(_templateObject18 || (_templateObject18 = _taggedTemplateLiteral(["\n word-wrap: break-word;\n text-align: center;\n"])));
108
+ var SkeletonWrapper = styled.div(_templateObject19 || (_templateObject19 = _taggedTemplateLiteral(["\n margin-top: 12px;\n display: flex;\n flex-direction: column;\n padding: 0 24px;\n overflow-y: hidden;\n width: 100%;\n"])));
109
+ var SkeletonTitleWrapper = styled.div(_templateObject20 || (_templateObject20 = _taggedTemplateLiteral(["\n width: 100%;\n display: flex;\n flex-direction: column;\n\n .SfxSkeleton-root {\n background-color: ", ";\n }\n"])), function (_ref28) {
110
+ var theme = _ref28.theme;
111
+ return theme.palette[PC.BackgroundActive];
112
+ });
113
+ var SkeletonTitleContent = styled.div(_templateObject21 || (_templateObject21 = _taggedTemplateLiteral(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n height: 60px;\n width: 100%;\n"])));
114
+ var SkeletonContent = styled.div(_templateObject22 || (_templateObject22 = _taggedTemplateLiteral(["\n display: grid;\n grid-template-columns: repeat(2, 1fr);\n gap: 16px;\n margin: 16px 0 24px 0;\n overflow-y: auto;\n flex-wrap: wrap;\n overflow: hidden;\n\n ", " {\n grid-template-columns: repeat(auto-fill, minmax(218px, 1fr));\n grid-auto-rows: minmax(218px, auto);\n }\n"])), function (_ref29) {
115
+ var theme = _ref29.theme;
116
+ return theme.breakpoints.down('lg');
117
+ });
118
+ var ImageSkeleton = styled(Skeleton)(_templateObject23 || (_templateObject23 = _taggedTemplateLiteral(["\n height: 100%;\n width: 100%;\n background-color: ", ";\n"])), function (_ref30) {
119
+ var theme = _ref30.theme;
120
+ return theme.palette[PC.BackgroundHover];
121
+ });
122
+ var SkeletonItemWrapper = styled.div(_templateObject24 || (_templateObject24 = _taggedTemplateLiteral(["\n position: relative;\n display: flex;\n z-index: 20;\n max-width: 218px;\n min-height: 170px;\n flex-direction: column;\n border-radius: 4px;\n border: 1px solid ", ";\n\n ", " {\n max-width: unset;\n }\n"])), function (_ref31) {
123
+ var theme = _ref31.theme;
124
+ return theme.palette[PC.BordersItem];
125
+ }, function (_ref32) {
126
+ var theme = _ref32.theme;
127
+ return theme.breakpoints.down('lg');
128
+ });
129
+ var FooterSkeleton = styled(Skeleton)(_templateObject25 || (_templateObject25 = _taggedTemplateLiteral(["\n position: absolute;\n bottom: 8px;\n left: 8px;\n z-index: 30;\n width: 150px;\n height: 16px;\n"])));
130
+ var Tabs = styled(SfxTabs)(_templateObject26 || (_templateObject26 = _taggedTemplateLiteral(["\n align-items: center;\n padding: ", ";\n\n .SfxTab-root {\n &:not(:first-child) {\n margin-left: 0;\n }\n\n ", ";\n\n border-bottom: 1px solid ", ";\n height: 40px;\n }\n"])), function (_ref33) {
131
+ var isLoading = _ref33.isLoading;
132
+ return isLoading ? '0' : '0 24px';
133
+ }, function (_ref34) {
134
+ var isLoading = _ref34.isLoading;
135
+ return isLoading ? css(_templateObject27 || (_templateObject27 = _taggedTemplateLiteral(["\n margin-bottom: 0;\n "]))) : css(_templateObject28 || (_templateObject28 = _taggedTemplateLiteral(["\n margin-top: 12px;\n "])));
136
+ }, function (_ref35) {
137
+ var theme = _ref35.theme;
138
+ return theme.palette[PC.BordersItem];
139
+ });
140
+ var Tab = styled(SfxTab)(_templateObject29 || (_templateObject29 = _taggedTemplateLiteral(["\n flex-grow: 1;\n justify-content: center;\n margin-left: unset;\n\n ", ";\n"])), function (_ref36) {
141
+ var theme = _ref36.theme;
142
+ return theme.typography.font[FV.LabelLarge];
143
+ });
144
+ var EditModalContent = styled.div(_templateObject30 || (_templateObject30 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n gap: 16px;\n"])));
145
+ var Styled = {
146
+ Actions: Actions,
147
+ Title: Title,
148
+ VariantsWrapper: VariantsWrapper,
149
+ SpinnerWrapper: SpinnerWrapper,
150
+ AddVariantBtn: AddVariantBtn,
151
+ AddVariantBtnLabel: AddVariantBtnLabel,
152
+ NoVariantsPlaceholderWrapper: NoVariantsPlaceholderWrapper,
153
+ NoVariantsPlaceholder: NoVariantsPlaceholder,
154
+ Item: Item,
155
+ ItemImg: ItemImg,
156
+ ItemNameWrapper: ItemNameWrapper,
157
+ ItemName: ItemName,
158
+ SearchWrapper: SearchWrapper,
159
+ SearchInput: SearchInput,
160
+ VariantBadge: VariantBadge,
161
+ HighlightedName: HighlightedName,
162
+ VariantName: VariantName,
163
+ ImageSkeleton: ImageSkeleton,
164
+ ItemFooterWrapper: ItemFooterWrapper,
165
+ SkeletonWrapper: SkeletonWrapper,
166
+ SkeletonTitleWrapper: SkeletonTitleWrapper,
167
+ SkeletonTitleContent: SkeletonTitleContent,
168
+ SkeletonContent: SkeletonContent,
169
+ FooterSkeleton: FooterSkeleton,
170
+ SkeletonItemWrapper: SkeletonItemWrapper,
171
+ Tabs: Tabs,
172
+ Tab: Tab,
173
+ EditModalContent: EditModalContent
174
+ };
175
+ export default Styled;
@@ -0,0 +1,54 @@
1
+ import createThunk from '@scaleflex/widget-utils/lib/createThunk';
2
+ import { PERMISSIONS } from '@scaleflex/widget-utils/lib/constants';
3
+ export var getVariants = createThunk(async function (fileUuid, thunkApi) {
4
+ var _await$thunkApi$extra = await thunkApi.extra.apiClient.get("file/".concat(fileUuid, "/variants"), {
5
+ id: 'fileVariants',
6
+ abortSignal: thunkApi.signal
7
+ }),
8
+ _await$thunkApi$extra2 = _await$thunkApi$extra.variants,
9
+ variants = _await$thunkApi$extra2 === void 0 ? [] : _await$thunkApi$extra2;
10
+ return variants;
11
+ });
12
+ export var addNewVariant = createThunk(async function (_ref, thunkApi) {
13
+ var fileUuid = _ref.fileUuid,
14
+ data = _ref.data;
15
+ var _await$thunkApi$extra3 = await thunkApi.extra.apiClient.post("file/".concat(fileUuid, "/variants"), {
16
+ data: {
17
+ variant_name: data.name,
18
+ variant_url: data.url,
19
+ variant_query: data.query
20
+ },
21
+ abortSignal: thunkApi.signal
22
+ }),
23
+ _await$thunkApi$extra4 = _await$thunkApi$extra3.variant,
24
+ variant = _await$thunkApi$extra4 === void 0 ? {} : _await$thunkApi$extra4;
25
+ return variant;
26
+ });
27
+ export var editVariant = createThunk(async function (_ref2, thunkApi) {
28
+ var fileUuid = _ref2.fileUuid,
29
+ data = _ref2.data;
30
+ var _await$thunkApi$extra5 = await thunkApi.extra.apiClient.put("file/".concat(fileUuid, "/variants"), {
31
+ data: {
32
+ variant_uuid: data.uuid,
33
+ variant_name: data.name,
34
+ variant_url: data.url,
35
+ variant_query: data.query
36
+ },
37
+ abortSignal: thunkApi.signal
38
+ }),
39
+ _await$thunkApi$extra6 = _await$thunkApi$extra5.variant,
40
+ variant = _await$thunkApi$extra6 === void 0 ? {} : _await$thunkApi$extra6;
41
+ return variant;
42
+ });
43
+ export var deleteVariant = createThunk(async function (_ref3, thunkApi) {
44
+ var fileUuid = _ref3.fileUuid,
45
+ variantUuid = _ref3.variantUuid;
46
+ var response = await thunkApi.extra.apiClient["delete"]("file/".concat(fileUuid, "/variants"), {
47
+ data: {
48
+ variants_list: [variantUuid]
49
+ },
50
+ permissionsToCheck: [PERMISSIONS.FILE_DELETE],
51
+ abortSignal: thunkApi.signal
52
+ });
53
+ return response;
54
+ });
@@ -0,0 +1,23 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
6
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
+ export var createRemovedBackgroundVariantObject = function createRemovedBackgroundVariantObject(originalFile) {
8
+ var removedBgImgName = originalFile.name.replace(/\.(?:.(?!\.))+$/, '.png');
9
+ return _objectSpread(_objectSpread({}, originalFile), {}, {
10
+ uuid: "".concat(originalFile.uuid, "-removed_bg"),
11
+ url: originalFile.info.remove_background,
12
+ name: removedBgImgName,
13
+ bgRemoved: true,
14
+ extension: 'png',
15
+ type: 'image/png',
16
+ info: _objectSpread(_objectSpread({}, originalFile.info), {}, {
17
+ ext: 'png',
18
+ img_type: 'PNG',
19
+ name: removedBgImgName,
20
+ type: 'image/png'
21
+ })
22
+ });
23
+ };
@@ -0,0 +1,76 @@
1
+ import { useDispatch, useSelector } from 'react-redux';
2
+ import { VariantPlaceholder, PlusOutline } from '@scaleflex/icons';
3
+ import { selectIsUserPermittedTo } from '@scaleflex/widget-core/lib/slices/user.slice';
4
+ import { PERMISSIONS } from '@scaleflex/widget-utils/lib/constants';
5
+ import VariationItem from './VariationItem';
6
+ import StyledVariants from './Variations.styled';
7
+ import { filesVariationsUpdated } from '../../../../slices/files.slice';
8
+ import NoItems from '../../../NoItems';
9
+ import { VARIATIONS_TAB_IDS } from './Variations.constants';
10
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
+ var VariationsContent = function VariationsContent(_ref) {
12
+ var originalFile = _ref.originalFile,
13
+ addNewVariant = _ref.addNewVariant,
14
+ isLoading = _ref.isLoading,
15
+ variants = _ref.variants,
16
+ searchQuery = _ref.searchQuery,
17
+ originalVariantsCount = _ref.originalVariantsCount,
18
+ displayedFileVariant = _ref.displayedFileVariant,
19
+ deleteVariant = _ref.deleteVariant,
20
+ editVariantFile = _ref.editVariantFile,
21
+ editVariantName = _ref.editVariantName,
22
+ setSelectedVariant = _ref.setSelectedVariant,
23
+ i18n = _ref.i18n,
24
+ activeTabId = _ref.activeTabId;
25
+ var dispatch = useDispatch();
26
+ var isUserPermittedToEditVariant = useSelector(function (state) {
27
+ return selectIsUserPermittedTo(state, PERMISSIONS.FILE_IMAGE_EDITOR);
28
+ });
29
+ var showAddVariantButton = isUserPermittedToEditVariant && activeTabId === VARIATIONS_TAB_IDS.MANUAL;
30
+ var onSelectVariant = function onSelectVariant(variant) {
31
+ setSelectedVariant(variant);
32
+ dispatch(filesVariationsUpdated(variant));
33
+ };
34
+ if (!isLoading && variants.length === 0 && originalVariantsCount > 0) {
35
+ return /*#__PURE__*/_jsx(NoItems, {
36
+ iconWidth: 150,
37
+ iconHeight: 60,
38
+ mt: 120,
39
+ noSearchResults: true,
40
+ smallItemsGap: true,
41
+ primary: i18n('mutualizedNoResults'),
42
+ secondary: i18n('mutualizedTryAnotherSearch')
43
+ });
44
+ }
45
+ return /*#__PURE__*/_jsxs(StyledVariants.VariantsWrapper, {
46
+ children: [showAddVariantButton && /*#__PURE__*/_jsxs(StyledVariants.AddVariantBtn, {
47
+ onClick: addNewVariant,
48
+ "data-testid": "add-variant-button",
49
+ children: [/*#__PURE__*/_jsx(VariantPlaceholder, {
50
+ size: 115,
51
+ height: 58
52
+ }), /*#__PURE__*/_jsxs(StyledVariants.AddVariantBtnLabel, {
53
+ children: [/*#__PURE__*/_jsx(PlusOutline, {
54
+ size: 14
55
+ }), i18n('explorerFileWindowAddVariationButton')]
56
+ })]
57
+ }), variants.map(function (variant) {
58
+ return /*#__PURE__*/_jsx(VariationItem, {
59
+ variant: variant,
60
+ searchQuery: searchQuery,
61
+ isOriginal: originalFile.uuid === variant.uuid,
62
+ isActive: variant.uuid === displayedFileVariant.uuid,
63
+ isRemovedBackground: variant.bgRemoved,
64
+ onClick: function onClick() {
65
+ return onSelectVariant(variant);
66
+ },
67
+ deleteVariant: deleteVariant,
68
+ editVariantFile: editVariantFile,
69
+ editVariantName: editVariantName,
70
+ isUserPermittedToEditVariant: isUserPermittedToEditVariant,
71
+ activeTabId: activeTabId
72
+ }, variant.uuid);
73
+ })]
74
+ });
75
+ };
76
+ export default VariationsContent;