box-ui-elements 24.0.0-beta.3 → 24.0.0-beta.5

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 (159) hide show
  1. package/dist/explorer.js +1 -1
  2. package/dist/openwith.js +1 -1
  3. package/dist/picker.js +1 -1
  4. package/dist/preview.js +1 -1
  5. package/dist/sharing.js +1 -1
  6. package/dist/sidebar.js +1 -1
  7. package/dist/uploader.js +1 -1
  8. package/es/api/Metadata.js +98 -13
  9. package/es/api/Metadata.js.flow +110 -12
  10. package/es/api/Metadata.js.map +1 -1
  11. package/es/elements/common/messages.js +16 -0
  12. package/es/elements/common/messages.js.flow +25 -0
  13. package/es/elements/common/messages.js.map +1 -1
  14. package/es/elements/common/withBlueprintModernization.js +16 -0
  15. package/es/elements/common/withBlueprintModernization.js.map +1 -0
  16. package/es/elements/content-explorer/Content.js +2 -1
  17. package/es/elements/content-explorer/Content.js.map +1 -1
  18. package/es/elements/content-explorer/ContentExplorer.js +21 -6
  19. package/es/elements/content-explorer/ContentExplorer.js.map +1 -1
  20. package/es/elements/content-explorer/MetadataQueryAPIHelper.js +61 -4
  21. package/es/elements/content-explorer/MetadataQueryAPIHelper.js.map +1 -1
  22. package/es/elements/content-explorer/MetadataSidePanel.js +40 -14
  23. package/es/elements/content-explorer/MetadataSidePanel.js.map +1 -1
  24. package/es/elements/content-explorer/MetadataViewContainer.js +55 -4
  25. package/es/elements/content-explorer/MetadataViewContainer.js.map +1 -1
  26. package/es/elements/content-explorer/stories/tests/ContentExplorer-visual.stories.js +5 -0
  27. package/es/elements/content-explorer/stories/tests/ContentExplorer-visual.stories.js.flow +6 -0
  28. package/es/elements/content-explorer/stories/tests/ContentExplorer-visual.stories.js.map +1 -1
  29. package/es/elements/content-explorer/stories/tests/MetadataView-visual.stories.js +61 -13
  30. package/es/elements/content-explorer/stories/tests/MetadataView-visual.stories.js.map +1 -1
  31. package/es/elements/content-explorer/utils.js +140 -12
  32. package/es/elements/content-explorer/utils.js.map +1 -1
  33. package/es/elements/content-picker/ContentPicker.js +4 -1
  34. package/es/elements/content-picker/ContentPicker.js.flow +4 -1
  35. package/es/elements/content-picker/ContentPicker.js.map +1 -1
  36. package/es/elements/content-picker/stories/tests/ContentPicker-visual.stories.js +5 -0
  37. package/es/elements/content-picker/stories/tests/ContentPicker-visual.stories.js.flow +6 -0
  38. package/es/elements/content-picker/stories/tests/ContentPicker-visual.stories.js.map +1 -1
  39. package/es/elements/content-preview/ContentPreview.js +3 -1
  40. package/es/elements/content-preview/ContentPreview.js.flow +3 -0
  41. package/es/elements/content-preview/ContentPreview.js.map +1 -1
  42. package/es/elements/content-preview/stories/tests/ContentPreview-visual.stories.js +5 -0
  43. package/es/elements/content-preview/stories/tests/ContentPreview-visual.stories.js.flow +7 -1
  44. package/es/elements/content-preview/stories/tests/ContentPreview-visual.stories.js.map +1 -1
  45. package/es/elements/content-sharing/ContentSharing.js +4 -1
  46. package/es/elements/content-sharing/ContentSharing.js.flow +4 -1
  47. package/es/elements/content-sharing/ContentSharing.js.map +1 -1
  48. package/es/elements/content-sidebar/ContentSidebar.js +3 -1
  49. package/es/elements/content-sidebar/ContentSidebar.js.flow +3 -0
  50. package/es/elements/content-sidebar/ContentSidebar.js.map +1 -1
  51. package/es/elements/content-sidebar/stories/tests/ContentSidebar-visual.stories.js +5 -0
  52. package/es/elements/content-sidebar/stories/tests/ContentSidebar-visual.stories.js.map +1 -1
  53. package/es/elements/content-uploader/ContentUploader.js +3 -1
  54. package/es/elements/content-uploader/ContentUploader.js.map +1 -1
  55. package/es/elements/content-uploader/stories/tests/ContentUploader-visual.stories.js +5 -0
  56. package/es/elements/content-uploader/stories/tests/ContentUploader-visual.stories.js.flow +6 -0
  57. package/es/elements/content-uploader/stories/tests/ContentUploader-visual.stories.js.map +1 -1
  58. package/es/features/classification/applied-by-ai-classification-reason/AppliedByAiClassificationReason.js +51 -0
  59. package/es/features/classification/applied-by-ai-classification-reason/AppliedByAiClassificationReason.js.map +1 -0
  60. package/es/features/classification/applied-by-ai-classification-reason/AppliedByAiClassificationReason.scss +29 -0
  61. package/es/features/classification/applied-by-ai-classification-reason/messages.js +13 -0
  62. package/es/features/classification/applied-by-ai-classification-reason/messages.js.map +1 -0
  63. package/es/features/classification/types.js +2 -0
  64. package/es/features/classification/types.js.map +1 -0
  65. package/es/src/elements/common/__tests__/withBlueprintModernization.test.d.ts +1 -0
  66. package/es/src/elements/common/withBlueprintModernization.d.ts +3 -0
  67. package/es/src/elements/content-explorer/ContentExplorer.d.ts +11 -3
  68. package/es/src/elements/content-explorer/MetadataQueryAPIHelper.d.ts +11 -1
  69. package/es/src/elements/content-explorer/MetadataSidePanel.d.ts +6 -3
  70. package/es/src/elements/content-explorer/MetadataViewContainer.d.ts +3 -1
  71. package/es/src/elements/content-explorer/stories/tests/MetadataView-visual.stories.d.ts +1 -0
  72. package/es/src/elements/content-explorer/utils.d.ts +9 -3
  73. package/es/src/elements/content-sidebar/stories/tests/ContentSidebar-visual.stories.d.ts +5 -0
  74. package/es/src/features/classification/applied-by-ai-classification-reason/AppliedByAiClassificationReason.d.ts +6 -0
  75. package/es/src/features/classification/applied-by-ai-classification-reason/__tests__/AppliedByAiClassificationReason.test.d.ts +1 -0
  76. package/es/src/features/classification/applied-by-ai-classification-reason/messages.d.ts +13 -0
  77. package/es/src/features/classification/types.d.ts +6 -0
  78. package/i18n/bn-IN.js +8 -2
  79. package/i18n/bn-IN.properties +6 -2
  80. package/i18n/da-DK.js +8 -2
  81. package/i18n/da-DK.properties +6 -2
  82. package/i18n/de-DE.js +8 -2
  83. package/i18n/de-DE.properties +6 -2
  84. package/i18n/en-AU.js +6 -0
  85. package/i18n/en-AU.properties +4 -0
  86. package/i18n/en-CA.js +6 -0
  87. package/i18n/en-CA.properties +4 -0
  88. package/i18n/en-GB.js +6 -0
  89. package/i18n/en-GB.properties +4 -0
  90. package/i18n/en-US.js +6 -0
  91. package/i18n/en-US.properties +12 -0
  92. package/i18n/en-x-pseudo.js +6 -0
  93. package/i18n/es-419.js +8 -2
  94. package/i18n/es-419.properties +6 -2
  95. package/i18n/es-ES.js +8 -2
  96. package/i18n/es-ES.properties +6 -2
  97. package/i18n/fi-FI.js +8 -2
  98. package/i18n/fi-FI.properties +6 -2
  99. package/i18n/fr-CA.js +8 -2
  100. package/i18n/fr-CA.properties +6 -2
  101. package/i18n/fr-FR.js +8 -2
  102. package/i18n/fr-FR.properties +6 -2
  103. package/i18n/hi-IN.js +8 -2
  104. package/i18n/hi-IN.properties +6 -2
  105. package/i18n/it-IT.js +8 -2
  106. package/i18n/it-IT.properties +6 -2
  107. package/i18n/ja-JP.js +8 -2
  108. package/i18n/ja-JP.properties +6 -2
  109. package/i18n/ko-KR.js +8 -2
  110. package/i18n/ko-KR.properties +6 -2
  111. package/i18n/nb-NO.js +8 -2
  112. package/i18n/nb-NO.properties +6 -2
  113. package/i18n/nl-NL.js +8 -2
  114. package/i18n/nl-NL.properties +6 -2
  115. package/i18n/pl-PL.js +8 -2
  116. package/i18n/pl-PL.properties +6 -2
  117. package/i18n/pt-BR.js +8 -2
  118. package/i18n/pt-BR.properties +6 -2
  119. package/i18n/ru-RU.js +8 -2
  120. package/i18n/ru-RU.properties +6 -2
  121. package/i18n/sv-SE.js +8 -2
  122. package/i18n/sv-SE.properties +6 -2
  123. package/i18n/tr-TR.js +8 -2
  124. package/i18n/tr-TR.properties +6 -2
  125. package/i18n/zh-CN.js +8 -2
  126. package/i18n/zh-CN.properties +6 -2
  127. package/i18n/zh-TW.js +8 -2
  128. package/i18n/zh-TW.properties +6 -2
  129. package/package.json +1 -1
  130. package/src/api/Metadata.js +110 -12
  131. package/src/api/__tests__/Metadata.test.js +120 -0
  132. package/src/elements/common/__tests__/withBlueprintModernization.test.tsx +91 -0
  133. package/src/elements/common/messages.js +25 -0
  134. package/src/elements/common/withBlueprintModernization.tsx +24 -0
  135. package/src/elements/content-explorer/Content.tsx +1 -0
  136. package/src/elements/content-explorer/ContentExplorer.tsx +224 -182
  137. package/src/elements/content-explorer/MetadataQueryAPIHelper.ts +89 -4
  138. package/src/elements/content-explorer/MetadataSidePanel.tsx +55 -14
  139. package/src/elements/content-explorer/MetadataViewContainer.tsx +61 -1
  140. package/src/elements/content-explorer/__tests__/ContentExplorer.test.tsx +36 -2
  141. package/src/elements/content-explorer/__tests__/MetadataQueryAPIHelper.test.ts +8 -5
  142. package/src/elements/content-explorer/__tests__/MetadataSidePanel.test.tsx +145 -3
  143. package/src/elements/content-explorer/stories/tests/ContentExplorer-visual.stories.js +6 -0
  144. package/src/elements/content-explorer/stories/tests/MetadataView-visual.stories.tsx +54 -8
  145. package/src/elements/content-explorer/utils.ts +150 -13
  146. package/src/elements/content-picker/ContentPicker.js +4 -1
  147. package/src/elements/content-picker/stories/tests/ContentPicker-visual.stories.js +6 -0
  148. package/src/elements/content-preview/ContentPreview.js +3 -0
  149. package/src/elements/content-preview/stories/tests/ContentPreview-visual.stories.js +7 -1
  150. package/src/elements/content-sharing/ContentSharing.js +4 -1
  151. package/src/elements/content-sidebar/ContentSidebar.js +3 -0
  152. package/src/elements/content-sidebar/stories/tests/ContentSidebar-visual.stories.tsx +6 -0
  153. package/src/elements/content-uploader/ContentUploader.tsx +3 -1
  154. package/src/elements/content-uploader/stories/tests/ContentUploader-visual.stories.js +6 -0
  155. package/src/features/classification/applied-by-ai-classification-reason/AppliedByAiClassificationReason.scss +29 -0
  156. package/src/features/classification/applied-by-ai-classification-reason/AppliedByAiClassificationReason.tsx +55 -0
  157. package/src/features/classification/applied-by-ai-classification-reason/__tests__/AppliedByAiClassificationReason.test.tsx +105 -0
  158. package/src/features/classification/applied-by-ai-classification-reason/messages.ts +18 -0
  159. package/src/features/classification/types.ts +7 -0
package/i18n/tr-TR.js CHANGED
@@ -109,7 +109,7 @@ export default {
109
109
  "be.contentSidebar.activityFeed.commentForm.commentCancel": "İptal",
110
110
  "be.contentSidebar.activityFeed.commentForm.commentLabel": "Bir yorum yazın",
111
111
  "be.contentSidebar.activityFeed.commentForm.commentPost": "Gönder",
112
- "be.contentSidebar.activityFeed.commentForm.commentTimestampLabel": "Comment with timestamp",
112
+ "be.contentSidebar.activityFeed.commentForm.commentTimestampLabel": "Zaman damgasıyla yorum yapın",
113
113
  "be.contentSidebar.activityFeed.commentForm.commentWrite": "Bir yorum yazın",
114
114
  "be.contentSidebar.activityFeed.commmon.showOriginalMessage": "Orijinali Göster",
115
115
  "be.contentSidebar.activityFeed.common.activityStatusResolved": "Çözüldü",
@@ -291,9 +291,12 @@ export default {
291
291
  "be.messageCenter.previewError": "Üzgünüz, bu görüntüyü göstermekte sorun yaşıyoruz.",
292
292
  "be.messageCenter.product": "Ürün",
293
293
  "be.messageCenter.title": "Yenilikler",
294
+ "be.metadataUpdateErrorNotification": "Unable to save changes. Please try again.",
295
+ "be.metadataUpdateSuccessNotification": " {numSelected, plural, =1 {1 document updated} other {# documents updated} } ",
294
296
  "be.modifiedDate": "{date} tarihinde değiştirildi",
295
297
  "be.modifiedDateBy": "{name} tarafından {date} tarihinde değiştirildi",
296
298
  "be.moreOptions": "Daha Fazla Seçenek",
299
+ "be.multipleValues": "Multiple Values",
297
300
  "be.nameASC": "Ad: A → Z",
298
301
  "be.nameDESC": "Ad: Z → A",
299
302
  "be.nameDate": "{name} tarafından {date} tarihinde",
@@ -417,6 +420,7 @@ export default {
417
420
  "be.skillUnknownError": "Bu Skill özelliği kullanılırken veya ilgili veriler getirilirken bir hata oluştu.",
418
421
  "be.sort": "Sırala",
419
422
  "be.statusSkill": "Durum",
423
+ "be.success": "Success",
420
424
  "be.today": "bugün",
421
425
  "be.topicsSkill": "Konular",
422
426
  "be.transcriptEdit": "Düzenlemek için bir bölüme tıklayın.",
@@ -483,6 +487,8 @@ export default {
483
487
  "boxui.categorySelector.label.more": "Daha fazla",
484
488
  "boxui.checkboxTooltip.iconInfoText": "Bilgi",
485
489
  "boxui.classification.add": "Ekle",
490
+ "boxui.classification.appliedByBoxAi": "Box IA",
491
+ "boxui.classification.appliedByBoxAiOnDate": "Box AI on {modifiedAt}",
486
492
  "boxui.classification.classification": "Sınıflandırma",
487
493
  "boxui.classification.classificationDarkBlue": "Koyu Mavi",
488
494
  "boxui.classification.classificationGreen": "Yeşil",
@@ -913,7 +919,7 @@ export default {
913
919
  "boxui.shareMenu.shortcutOnly": "Yalnızca Kısayol",
914
920
  "boxui.shareMenu.viewAndDownload": "Görüntüleme ve İndirme",
915
921
  "boxui.shareMenu.viewOnly": "Yalnızca Görüntüleme",
916
- "boxui.subHeader.bulkItemActionMenuAriaLabel": "Bulk actions",
922
+ "boxui.subHeader.bulkItemActionMenuAriaLabel": "Toplu işlemler",
917
923
  "boxui.subHeader.metadata": "Meta veri",
918
924
  "boxui.timeInput.emptyTimeError": "Gerekli alan. Saati SS.DD biçiminde girin.",
919
925
  "boxui.timeInput.invalidTimeError": "Geçersiz saat biçimi. Saati SS.DD biçiminde girin.",
@@ -219,7 +219,7 @@ be.contentSidebar.activityFeed.commentForm.commentLabel = Bir yorum yazın
219
219
  # Text for post button
220
220
  be.contentSidebar.activityFeed.commentForm.commentPost = Gönder
221
221
  # Label for toggle to add video timestamp to comment
222
- be.contentSidebar.activityFeed.commentForm.commentTimestampLabel = Comment with timestamp
222
+ be.contentSidebar.activityFeed.commentForm.commentTimestampLabel = Zaman damgasıyla yorum yapın
223
223
  # Placeholder for comment input
224
224
  be.contentSidebar.activityFeed.commentForm.commentWrite = Bir yorum yazın
225
225
  # Show original button for showing original comment
@@ -966,6 +966,10 @@ boxui.categorySelector.label.more = Daha fazla
966
966
  boxui.checkboxTooltip.iconInfoText = Bilgi
967
967
  # Button to add classification on an item
968
968
  boxui.classification.add = Ekle
969
+ # Title of the card that shows the reason why the AI classification was applied when no date is available.
970
+ boxui.classification.appliedByBoxAi = Box IA
971
+ # Title of the card that shows the reason why the AI classification was applied on a specific date.
972
+ boxui.classification.appliedByBoxAiOnDate = Box AI on {modifiedAt}
969
973
  # Header for classification section in sidebar
970
974
  boxui.classification.classification = Sınıflandırma
971
975
  # Classification label color name as dark blue
@@ -1827,7 +1831,7 @@ boxui.shareMenu.viewAndDownload = Görüntüleme ve İndirme
1827
1831
  # Description of permissions granted to users who have access to the shared link
1828
1832
  boxui.shareMenu.viewOnly = Yalnızca Görüntüleme
1829
1833
  # Aria-label for the dropdown menu that shows actions for selected items
1830
- boxui.subHeader.bulkItemActionMenuAriaLabel = Bulk actions
1834
+ boxui.subHeader.bulkItemActionMenuAriaLabel = Toplu işlemler
1831
1835
  # Text for metadata button that will open the metadata side panel
1832
1836
  boxui.subHeader.metadata = Meta veri
1833
1837
  # Error message for empty time formats. "HH:MM A" should be localized.
package/i18n/zh-CN.js CHANGED
@@ -109,7 +109,7 @@ export default {
109
109
  "be.contentSidebar.activityFeed.commentForm.commentCancel": "取消",
110
110
  "be.contentSidebar.activityFeed.commentForm.commentLabel": "留下评论",
111
111
  "be.contentSidebar.activityFeed.commentForm.commentPost": "发布",
112
- "be.contentSidebar.activityFeed.commentForm.commentTimestampLabel": "Comment with timestamp",
112
+ "be.contentSidebar.activityFeed.commentForm.commentTimestampLabel": "带时间戳的评论",
113
113
  "be.contentSidebar.activityFeed.commentForm.commentWrite": "留下评论",
114
114
  "be.contentSidebar.activityFeed.commmon.showOriginalMessage": "显示原始评论",
115
115
  "be.contentSidebar.activityFeed.common.activityStatusResolved": "Resolved",
@@ -291,9 +291,12 @@ export default {
291
291
  "be.messageCenter.previewError": "抱歉,无法显示此图像。",
292
292
  "be.messageCenter.product": "产品",
293
293
  "be.messageCenter.title": "新增功能",
294
+ "be.metadataUpdateErrorNotification": "Unable to save changes. Please try again.",
295
+ "be.metadataUpdateSuccessNotification": " {numSelected, plural, =1 {1 document updated} other {# documents updated} } ",
294
296
  "be.modifiedDate": "修改日期:{date}",
295
297
  "be.modifiedDateBy": "{name} 于 {date} 修改",
296
298
  "be.moreOptions": "更多选项",
299
+ "be.multipleValues": "Multiple Values",
297
300
  "be.nameASC": "名称:A → Z",
298
301
  "be.nameDESC": "名称:Z → A",
299
302
  "be.nameDate": "{name} 于 {date} 修改",
@@ -417,6 +420,7 @@ export default {
417
420
  "be.skillUnknownError": "运行此技能或获取其数据时出错。",
418
421
  "be.sort": "排序",
419
422
  "be.statusSkill": "状态",
423
+ "be.success": "Success",
420
424
  "be.today": "今天",
421
425
  "be.topicsSkill": "主题",
422
426
  "be.transcriptEdit": "单击任何部分开始编辑。",
@@ -483,6 +487,8 @@ export default {
483
487
  "boxui.categorySelector.label.more": "更多",
484
488
  "boxui.checkboxTooltip.iconInfoText": "信息",
485
489
  "boxui.classification.add": "添加",
490
+ "boxui.classification.appliedByBoxAi": "Box AI",
491
+ "boxui.classification.appliedByBoxAiOnDate": "Box AI on {modifiedAt}",
486
492
  "boxui.classification.classification": "分类",
487
493
  "boxui.classification.classificationDarkBlue": "深蓝色",
488
494
  "boxui.classification.classificationGreen": "绿色",
@@ -913,7 +919,7 @@ export default {
913
919
  "boxui.shareMenu.shortcutOnly": "仅快捷键",
914
920
  "boxui.shareMenu.viewAndDownload": "查看和下载",
915
921
  "boxui.shareMenu.viewOnly": "仅查看",
916
- "boxui.subHeader.bulkItemActionMenuAriaLabel": "Bulk actions",
922
+ "boxui.subHeader.bulkItemActionMenuAriaLabel": "批量操作",
917
923
  "boxui.subHeader.metadata": "元数据",
918
924
  "boxui.timeInput.emptyTimeError": "必填字段。请以“上午小时:分钟”格式输入时间。",
919
925
  "boxui.timeInput.invalidTimeError": "时间格式无效。请以“上午小时:分钟”格式输入时间。",
@@ -219,7 +219,7 @@ be.contentSidebar.activityFeed.commentForm.commentLabel = 留下评论
219
219
  # Text for post button
220
220
  be.contentSidebar.activityFeed.commentForm.commentPost = 发布
221
221
  # Label for toggle to add video timestamp to comment
222
- be.contentSidebar.activityFeed.commentForm.commentTimestampLabel = Comment with timestamp
222
+ be.contentSidebar.activityFeed.commentForm.commentTimestampLabel = 带时间戳的评论
223
223
  # Placeholder for comment input
224
224
  be.contentSidebar.activityFeed.commentForm.commentWrite = 留下评论
225
225
  # Show original button for showing original comment
@@ -966,6 +966,10 @@ boxui.categorySelector.label.more = 更多
966
966
  boxui.checkboxTooltip.iconInfoText = 信息
967
967
  # Button to add classification on an item
968
968
  boxui.classification.add = 添加
969
+ # Title of the card that shows the reason why the AI classification was applied when no date is available.
970
+ boxui.classification.appliedByBoxAi = Box AI
971
+ # Title of the card that shows the reason why the AI classification was applied on a specific date.
972
+ boxui.classification.appliedByBoxAiOnDate = Box AI on {modifiedAt}
969
973
  # Header for classification section in sidebar
970
974
  boxui.classification.classification = 分类
971
975
  # Classification label color name as dark blue
@@ -1827,7 +1831,7 @@ boxui.shareMenu.viewAndDownload = 查看和下载
1827
1831
  # Description of permissions granted to users who have access to the shared link
1828
1832
  boxui.shareMenu.viewOnly = 仅查看
1829
1833
  # Aria-label for the dropdown menu that shows actions for selected items
1830
- boxui.subHeader.bulkItemActionMenuAriaLabel = Bulk actions
1834
+ boxui.subHeader.bulkItemActionMenuAriaLabel = 批量操作
1831
1835
  # Text for metadata button that will open the metadata side panel
1832
1836
  boxui.subHeader.metadata = 元数据
1833
1837
  # Error message for empty time formats. "HH:MM A" should be localized.
package/i18n/zh-TW.js CHANGED
@@ -109,7 +109,7 @@ export default {
109
109
  "be.contentSidebar.activityFeed.commentForm.commentCancel": "取消",
110
110
  "be.contentSidebar.activityFeed.commentForm.commentLabel": "撰寫留言",
111
111
  "be.contentSidebar.activityFeed.commentForm.commentPost": "張貼",
112
- "be.contentSidebar.activityFeed.commentForm.commentTimestampLabel": "Comment with timestamp",
112
+ "be.contentSidebar.activityFeed.commentForm.commentTimestampLabel": "帶時間戳的留言",
113
113
  "be.contentSidebar.activityFeed.commentForm.commentWrite": "撰寫留言",
114
114
  "be.contentSidebar.activityFeed.commmon.showOriginalMessage": "顯示原始留言",
115
115
  "be.contentSidebar.activityFeed.common.activityStatusResolved": "已解決",
@@ -291,9 +291,12 @@ export default {
291
291
  "be.messageCenter.previewError": "很抱歉,顯示此影像時發生問題。",
292
292
  "be.messageCenter.product": "產品",
293
293
  "be.messageCenter.title": "新增內容",
294
+ "be.metadataUpdateErrorNotification": "Unable to save changes. Please try again.",
295
+ "be.metadataUpdateSuccessNotification": " {numSelected, plural, =1 {1 document updated} other {# documents updated} } ",
294
296
  "be.modifiedDate": "於 {date} 修改",
295
297
  "be.modifiedDateBy": "{name} 於 {date} 修改",
296
298
  "be.moreOptions": "更多選項",
299
+ "be.multipleValues": "Multiple Values",
297
300
  "be.nameASC": "名稱:A → Z",
298
301
  "be.nameDESC": "名稱:Z → A",
299
302
  "be.nameDate": "{name} 於 {date}",
@@ -417,6 +420,7 @@ export default {
417
420
  "be.skillUnknownError": "執行這個技能或擷取其資料時發生錯誤。",
418
421
  "be.sort": "排序",
419
422
  "be.statusSkill": "狀態",
423
+ "be.success": "Success",
420
424
  "be.today": "今天",
421
425
  "be.topicsSkill": "主題",
422
426
  "be.transcriptEdit": "按一下任一區段以編輯。",
@@ -483,6 +487,8 @@ export default {
483
487
  "boxui.categorySelector.label.more": "更多",
484
488
  "boxui.checkboxTooltip.iconInfoText": "資訊",
485
489
  "boxui.classification.add": "新增",
490
+ "boxui.classification.appliedByBoxAi": "Box AI",
491
+ "boxui.classification.appliedByBoxAiOnDate": "Box AI on {modifiedAt}",
486
492
  "boxui.classification.classification": "分類",
487
493
  "boxui.classification.classificationDarkBlue": "深藍色",
488
494
  "boxui.classification.classificationGreen": "綠色",
@@ -913,7 +919,7 @@ export default {
913
919
  "boxui.shareMenu.shortcutOnly": "僅捷徑",
914
920
  "boxui.shareMenu.viewAndDownload": "檢視與下載",
915
921
  "boxui.shareMenu.viewOnly": "僅檢視",
916
- "boxui.subHeader.bulkItemActionMenuAriaLabel": "Bulk actions",
922
+ "boxui.subHeader.bulkItemActionMenuAriaLabel": "大量動作",
917
923
  "boxui.subHeader.metadata": "中繼資料",
918
924
  "boxui.timeInput.emptyTimeError": "必填欄位。請以「上午 時時:分分」的格式輸入時間。",
919
925
  "boxui.timeInput.invalidTimeError": "無效的時間格式。請以「上午 時時:分分」的格式輸入時間。",
@@ -219,7 +219,7 @@ be.contentSidebar.activityFeed.commentForm.commentLabel = 撰寫留言
219
219
  # Text for post button
220
220
  be.contentSidebar.activityFeed.commentForm.commentPost = 張貼
221
221
  # Label for toggle to add video timestamp to comment
222
- be.contentSidebar.activityFeed.commentForm.commentTimestampLabel = Comment with timestamp
222
+ be.contentSidebar.activityFeed.commentForm.commentTimestampLabel = 帶時間戳的留言
223
223
  # Placeholder for comment input
224
224
  be.contentSidebar.activityFeed.commentForm.commentWrite = 撰寫留言
225
225
  # Show original button for showing original comment
@@ -966,6 +966,10 @@ boxui.categorySelector.label.more = 更多
966
966
  boxui.checkboxTooltip.iconInfoText = 資訊
967
967
  # Button to add classification on an item
968
968
  boxui.classification.add = 新增
969
+ # Title of the card that shows the reason why the AI classification was applied when no date is available.
970
+ boxui.classification.appliedByBoxAi = Box AI
971
+ # Title of the card that shows the reason why the AI classification was applied on a specific date.
972
+ boxui.classification.appliedByBoxAiOnDate = Box AI on {modifiedAt}
969
973
  # Header for classification section in sidebar
970
974
  boxui.classification.classification = 分類
971
975
  # Classification label color name as dark blue
@@ -1827,7 +1831,7 @@ boxui.shareMenu.viewAndDownload = 檢視與下載
1827
1831
  # Description of permissions granted to users who have access to the shared link
1828
1832
  boxui.shareMenu.viewOnly = 僅檢視
1829
1833
  # Aria-label for the dropdown menu that shows actions for selected items
1830
- boxui.subHeader.bulkItemActionMenuAriaLabel = Bulk actions
1834
+ boxui.subHeader.bulkItemActionMenuAriaLabel = 大量動作
1831
1835
  # Text for metadata button that will open the metadata side panel
1832
1836
  boxui.subHeader.metadata = 中繼資料
1833
1837
  # Error message for empty time formats. "HH:MM A" should be localized.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "box-ui-elements",
3
- "version": "24.0.0-beta.3",
3
+ "version": "24.0.0-beta.5",
4
4
  "description": "Box UI Elements",
5
5
  "author": "Box (https://www.box.com/)",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -16,7 +16,7 @@ import partition from 'lodash/partition';
16
16
  import uniq from 'lodash/uniq';
17
17
  import uniqueId from 'lodash/uniqueId';
18
18
  import { getBadItemError, getBadPermissionsError, isUserCorrectableError } from '../utils/error';
19
- import { getTypedFileId } from '../utils/file';
19
+ import { getTypedFileId, getTypedFolderId } from '../utils/file';
20
20
  import { handleOnAbort, formatMetadataFieldValue } from './utils';
21
21
  import File from './File';
22
22
  import {
@@ -90,6 +90,16 @@ class Metadata extends File {
90
90
  return `${this.getMetadataCacheKey(id)}_classification`;
91
91
  }
92
92
 
93
+ /**
94
+ * Creates a key for the metadata template schema cache
95
+ *
96
+ * @param {string} templateKey - template key
97
+ * @return {string} key
98
+ */
99
+ getMetadataTemplateSchemaCacheKey(templateKey: string): string {
100
+ return `${CACHE_PREFIX_METADATA}template_schema_${templateKey}`;
101
+ }
102
+
93
103
  /**
94
104
  * API URL for metadata
95
105
  *
@@ -105,6 +115,21 @@ class Metadata extends File {
105
115
  return baseUrl;
106
116
  }
107
117
 
118
+ /**
119
+ * API URL for metadata
120
+ *
121
+ * @param {string} id - a Box folder id
122
+ * @param {string} field - metadata field
123
+ * @return {string} base url for files
124
+ */
125
+ getMetadataUrlForFolder(id: string, scope?: string, template?: string): string {
126
+ const baseUrl = `${this.getBaseApiUrl()}/folders/${id}/metadata`;
127
+ if (scope && template) {
128
+ return `${baseUrl}/${scope}/${template}`;
129
+ }
130
+ return baseUrl;
131
+ }
132
+
108
133
  /**
109
134
  * API URL for metadata templates for a scope
110
135
  *
@@ -337,9 +362,23 @@ class Metadata extends File {
337
362
  * @param {string} templateKey - template key
338
363
  * @return {Promise} Promise object of metadata template
339
364
  */
340
- getSchemaByTemplateKey(templateKey: string): Promise<MetadataTemplateSchemaResponse> {
365
+ async getSchemaByTemplateKey(templateKey: string): Promise<MetadataTemplateSchemaResponse> {
366
+ const cache: APICache = this.getCache();
367
+ const key = this.getMetadataTemplateSchemaCacheKey(templateKey);
368
+
369
+ // Return cached value if it exists
370
+ if (cache.has(key)) {
371
+ return cache.get(key);
372
+ }
373
+
374
+ // Fetch from API if not cached
341
375
  const url = this.getMetadataTemplateSchemaUrl(templateKey);
342
- return this.xhr.get({ url });
376
+ const response = await this.xhr.get({ url });
377
+
378
+ // Cache the response
379
+ cache.set(key, response);
380
+
381
+ return response;
343
382
  }
344
383
 
345
384
  /**
@@ -786,27 +825,33 @@ class Metadata extends File {
786
825
  }
787
826
 
788
827
  /**
789
- * API for patching metadata on file
828
+ * API for patching metadata on item (file/folder)
790
829
  *
791
- * @param {BoxItem} file - File object for which we are changing the description
830
+ * @param {BoxItem} item - File/Folder object for which we are changing the description
792
831
  * @param {Object} template - Metadata template
793
832
  * @param {Array} operations - Array of JSON patch operations
794
833
  * @param {Function} successCallback - Success callback
795
834
  * @param {Function} errorCallback - Error callback
835
+ * @param {boolean} suppressCallbacks - Boolean to decide whether suppress callbacks or not
796
836
  * @return {Promise}
797
837
  */
798
838
  async updateMetadata(
799
- file: BoxItem,
839
+ item: BoxItem,
800
840
  template: MetadataTemplate,
801
841
  operations: JSONPatchOperations,
802
842
  successCallback: Function,
803
843
  errorCallback: ElementsErrorCallback,
844
+ suppressCallbacks?: boolean,
804
845
  ): Promise<void> {
805
846
  this.errorCode = ERROR_CODE_UPDATE_METADATA;
806
- this.successCallback = successCallback;
807
- this.errorCallback = errorCallback;
847
+ if (!suppressCallbacks) {
848
+ // Only set callbacks when we intend to invoke them for this call
849
+ // so that callers performing bulk operations can suppress per-item callbacks
850
+ this.successCallback = successCallback;
851
+ this.errorCallback = errorCallback;
852
+ }
808
853
 
809
- const { id, permissions } = file;
854
+ const { id, permissions, type } = item;
810
855
  if (!id || !permissions) {
811
856
  this.errorHandler(getBadItemError());
812
857
  return;
@@ -821,11 +866,14 @@ class Metadata extends File {
821
866
 
822
867
  try {
823
868
  const metadata = await this.xhr.put({
824
- url: this.getMetadataUrl(id, template.scope, template.templateKey),
869
+ url:
870
+ type === 'file'
871
+ ? this.getMetadataUrl(id, template.scope, template.templateKey)
872
+ : this.getMetadataUrlForFolder(id, template.scope, template.templateKey),
825
873
  headers: {
826
874
  [HEADER_CONTENT_TYPE]: 'application/json-patch+json',
827
875
  },
828
- id: getTypedFileId(id),
876
+ id: type === 'file' ? getTypedFileId(id) : getTypedFolderId(id),
829
877
  data: operations,
830
878
  });
831
879
  if (!this.isDestroyed()) {
@@ -840,13 +888,63 @@ class Metadata extends File {
840
888
  editor,
841
889
  );
842
890
  }
843
- this.successHandler(editor);
891
+ if (!suppressCallbacks) {
892
+ this.successHandler(editor);
893
+ }
844
894
  }
845
895
  } catch (e) {
896
+ if (suppressCallbacks) {
897
+ // Let the caller decide how to handle errors (e.g., aggregate for bulk operations)
898
+ throw e;
899
+ }
846
900
  this.errorHandler(e);
847
901
  }
848
902
  }
849
903
 
904
+ /**
905
+ * API for bulk patching metadata on items (file/folder)
906
+ *
907
+ * @param {BoxItem[]} items - File/Folder object for which we are changing the description
908
+ * @param {Object} template - Metadata template
909
+ * @param {Array} operations - Array of JSON patch operations for each item
910
+ * @param {Function} successCallback - Success callback
911
+ * @param {Function} errorCallback - Error callback
912
+ * @return {Promise}
913
+ */
914
+ async bulkUpdateMetadata(
915
+ items: BoxItem[],
916
+ template: MetadataTemplate,
917
+ operations: JSONPatchOperations[],
918
+ successCallback: Function,
919
+ errorCallback: ElementsErrorCallback,
920
+ ): Promise<void> {
921
+ this.errorCode = ERROR_CODE_UPDATE_METADATA;
922
+ this.successCallback = successCallback;
923
+ this.errorCallback = errorCallback;
924
+
925
+ try {
926
+ const updatePromises = items.map(async (item, index) => {
927
+ try {
928
+ // Suppress per-item callbacks; aggregate outcome at the bulk level only
929
+ await this.updateMetadata(item, template, operations[index], successCallback, errorCallback, true);
930
+ } catch (e) {
931
+ // Re-throw to be caught by Promise.all and handled once below
932
+ throw new Error(`Failed to update metadata: ${e.message || e}`);
933
+ }
934
+ });
935
+
936
+ await Promise.all(updatePromises);
937
+
938
+ if (!this.isDestroyed()) {
939
+ this.successHandler();
940
+ }
941
+ } catch (e) {
942
+ if (!this.isDestroyed()) {
943
+ this.errorHandler(e);
944
+ }
945
+ }
946
+ }
947
+
850
948
  /**
851
949
  * API for patching metadata on file
852
950
  *
@@ -1700,6 +1700,7 @@ describe('api/Metadata', () => {
1700
1700
  permissions: {
1701
1701
  can_upload: true,
1702
1702
  },
1703
+ type: 'file',
1703
1704
  };
1704
1705
  const ops = [{ op: 'add' }, { op: 'test' }];
1705
1706
  const cache = new Cache();
@@ -1767,6 +1768,7 @@ describe('api/Metadata', () => {
1767
1768
  permissions: {
1768
1769
  can_upload: true,
1769
1770
  },
1771
+ type: 'file',
1770
1772
  };
1771
1773
  const ops = [{ op: 'add' }, { op: 'test' }];
1772
1774
  const cache = new Cache();
@@ -1833,6 +1835,7 @@ describe('api/Metadata', () => {
1833
1835
  permissions: {
1834
1836
  can_upload: true,
1835
1837
  },
1838
+ type: 'file',
1836
1839
  };
1837
1840
  const ops = [{ op: 'add' }, { op: 'test' }];
1838
1841
  const cache = new Cache();
@@ -1894,6 +1897,123 @@ describe('api/Metadata', () => {
1894
1897
  });
1895
1898
  });
1896
1899
 
1900
+ describe('bulkUpdateMetadata()', () => {
1901
+ test('should call updateMetadata for each item and call successHandler when all succeed', async () => {
1902
+ const success = jest.fn();
1903
+ const error = jest.fn();
1904
+ const items = [
1905
+ { id: '1', name: 'file1', permissions: { can_upload: true }, type: 'file' },
1906
+ { id: '2', name: 'file2', permissions: { can_upload: true }, type: 'file' },
1907
+ ];
1908
+ const template = { scope: 'scope', templateKey: 'templateKey' };
1909
+ const ops = [[{ op: 'replace', path: '/foo', value: 'a' }], [{ op: 'replace', path: '/foo', value: 'b' }]];
1910
+
1911
+ metadata.updateMetadata = jest.fn().mockResolvedValue(undefined);
1912
+ metadata.isDestroyed = jest.fn().mockReturnValue(false);
1913
+ metadata.successHandler = jest.fn();
1914
+ metadata.errorHandler = jest.fn();
1915
+
1916
+ await metadata.bulkUpdateMetadata(items, template, ops, success, error);
1917
+
1918
+ expect(metadata.errorCode).toBe(ERROR_CODE_UPDATE_METADATA);
1919
+ expect(metadata.successCallback).toBe(success);
1920
+ expect(metadata.errorCallback).toBe(error);
1921
+ expect(metadata.updateMetadata).toHaveBeenCalledTimes(2);
1922
+ expect(metadata.updateMetadata).toHaveBeenNthCalledWith(
1923
+ 1,
1924
+ items[0],
1925
+ template,
1926
+ ops[0],
1927
+ success,
1928
+ error,
1929
+ true,
1930
+ );
1931
+ expect(metadata.updateMetadata).toHaveBeenNthCalledWith(
1932
+ 2,
1933
+ items[1],
1934
+ template,
1935
+ ops[1],
1936
+ success,
1937
+ error,
1938
+ true,
1939
+ );
1940
+ expect(metadata.isDestroyed).toHaveBeenCalledTimes(1);
1941
+ expect(metadata.successHandler).toHaveBeenCalledTimes(1);
1942
+ expect(metadata.errorHandler).not.toHaveBeenCalled();
1943
+ });
1944
+
1945
+ test('should call errorHandler with aggregated error when any update fails', async () => {
1946
+ const success = jest.fn();
1947
+ const error = jest.fn();
1948
+ const items = [
1949
+ { id: '1', name: 'file1', permissions: { can_upload: true }, type: 'file' },
1950
+ { id: '2', name: 'file2', permissions: { can_upload: true }, type: 'file' },
1951
+ ];
1952
+ const template = { scope: 'scope', templateKey: 'templateKey' };
1953
+ const ops = [[], []];
1954
+
1955
+ metadata.updateMetadata = jest
1956
+ .fn()
1957
+ .mockResolvedValueOnce(undefined)
1958
+ .mockRejectedValueOnce(new Error('mock error'));
1959
+ metadata.isDestroyed = jest.fn().mockReturnValue(false);
1960
+ metadata.successHandler = jest.fn();
1961
+ metadata.errorHandler = jest.fn();
1962
+
1963
+ await metadata.bulkUpdateMetadata(items, template, ops, success, error);
1964
+
1965
+ expect(metadata.updateMetadata).toHaveBeenCalledTimes(2);
1966
+ expect(metadata.errorHandler).toHaveBeenCalledTimes(1);
1967
+ const errArg = metadata.errorHandler.mock.calls[0][0];
1968
+ expect(errArg).toBeInstanceOf(Error);
1969
+ expect(errArg.message).toContain('Failed to update metadata');
1970
+ expect(errArg.message).toContain('mock error');
1971
+ expect(metadata.successHandler).not.toHaveBeenCalled();
1972
+ });
1973
+
1974
+ test('should not call successHandler when destroyed after successful updates', async () => {
1975
+ const success = jest.fn();
1976
+ const error = jest.fn();
1977
+ const items = [
1978
+ { id: '1', name: 'file1', permissions: { can_upload: true }, type: 'file' },
1979
+ { id: '2', name: 'file2', permissions: { can_upload: true }, type: 'file' },
1980
+ ];
1981
+ const template = { scope: 'scope', templateKey: 'templateKey' };
1982
+ const ops = [[], []];
1983
+
1984
+ metadata.updateMetadata = jest.fn().mockResolvedValue(undefined);
1985
+ metadata.isDestroyed = jest.fn().mockReturnValue(true);
1986
+ metadata.successHandler = jest.fn();
1987
+ metadata.errorHandler = jest.fn();
1988
+
1989
+ await metadata.bulkUpdateMetadata(items, template, ops, success, error);
1990
+
1991
+ expect(metadata.successHandler).not.toHaveBeenCalled();
1992
+ expect(metadata.errorHandler).not.toHaveBeenCalled();
1993
+ });
1994
+
1995
+ test('should not call errorHandler when destroyed after failure', async () => {
1996
+ const success = jest.fn();
1997
+ const error = jest.fn();
1998
+ const items = [
1999
+ { id: '1', name: 'file1', permissions: { can_upload: true }, type: 'file' },
2000
+ { id: '2', name: 'file2', permissions: { can_upload: true }, type: 'file' },
2001
+ ];
2002
+ const template = { scope: 'scope', templateKey: 'templateKey' };
2003
+ const ops = [[], []];
2004
+
2005
+ metadata.updateMetadata = jest.fn().mockRejectedValue(new Error('mock error'));
2006
+ metadata.isDestroyed = jest.fn().mockReturnValue(true);
2007
+ metadata.successHandler = jest.fn();
2008
+ metadata.errorHandler = jest.fn();
2009
+
2010
+ await metadata.bulkUpdateMetadata(items, template, ops, success, error);
2011
+
2012
+ expect(metadata.successHandler).not.toHaveBeenCalled();
2013
+ expect(metadata.errorHandler).not.toHaveBeenCalled();
2014
+ });
2015
+ });
2016
+
1897
2017
  describe('updateMetadataRedesign()', () => {
1898
2018
  test('should call error callback with a bad item error when no id', () => {
1899
2019
  jest.spyOn(ErrorUtil, 'getBadItemError').mockReturnValueOnce('error');