box-annotations 5.2.1-beta.8 → 5.3.1-beta.0

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 (121) hide show
  1. package/dist/annotations.css +1 -1
  2. package/dist/annotations.js +1 -1
  3. package/dist/annotations.js.LICENSE.txt +1 -10
  4. package/i18n/bn-IN.js +6 -0
  5. package/i18n/bn-IN.properties +12 -0
  6. package/i18n/da-DK.js +6 -0
  7. package/i18n/da-DK.properties +12 -0
  8. package/i18n/de-DE.js +6 -0
  9. package/i18n/de-DE.properties +12 -0
  10. package/i18n/en-AU.js +6 -0
  11. package/i18n/en-AU.properties +12 -0
  12. package/i18n/en-CA.js +6 -0
  13. package/i18n/en-CA.properties +12 -0
  14. package/i18n/en-GB.js +6 -0
  15. package/i18n/en-GB.properties +12 -0
  16. package/i18n/es-419.js +6 -0
  17. package/i18n/es-419.properties +12 -0
  18. package/i18n/es-ES.js +6 -0
  19. package/i18n/es-ES.properties +12 -0
  20. package/i18n/fi-FI.js +6 -0
  21. package/i18n/fi-FI.properties +12 -0
  22. package/i18n/fr-CA.js +6 -0
  23. package/i18n/fr-CA.properties +12 -0
  24. package/i18n/fr-FR.js +6 -0
  25. package/i18n/fr-FR.properties +12 -0
  26. package/i18n/hi-IN.js +6 -0
  27. package/i18n/hi-IN.properties +12 -0
  28. package/i18n/it-IT.js +6 -0
  29. package/i18n/it-IT.properties +12 -0
  30. package/i18n/ja-JP.js +7 -1
  31. package/i18n/ja-JP.properties +13 -1
  32. package/i18n/ko-KR.js +6 -0
  33. package/i18n/ko-KR.properties +12 -0
  34. package/i18n/nb-NO.js +6 -0
  35. package/i18n/nb-NO.properties +12 -0
  36. package/i18n/nl-NL.js +6 -0
  37. package/i18n/nl-NL.properties +12 -0
  38. package/i18n/pl-PL.js +6 -0
  39. package/i18n/pl-PL.properties +12 -0
  40. package/i18n/pt-BR.js +6 -0
  41. package/i18n/pt-BR.properties +12 -0
  42. package/i18n/ru-RU.js +6 -0
  43. package/i18n/ru-RU.properties +12 -0
  44. package/i18n/sv-SE.js +6 -0
  45. package/i18n/sv-SE.properties +12 -0
  46. package/i18n/tr-TR.js +6 -0
  47. package/i18n/tr-TR.properties +12 -0
  48. package/i18n/zh-CN.js +6 -0
  49. package/i18n/zh-CN.properties +12 -0
  50. package/i18n/zh-TW.js +6 -0
  51. package/i18n/zh-TW.properties +12 -0
  52. package/index.js +1 -1
  53. package/package.json +54 -42
  54. package/src/@types/api.ts +3 -2
  55. package/src/@types/events.ts +27 -10
  56. package/src/@types/global.ts +0 -9
  57. package/src/@types/model.ts +9 -0
  58. package/src/BoxAnnotations.ts +6 -2
  59. package/src/adapters/threadedAnnotationsAdapters.ts +49 -28
  60. package/src/api/APIFactory.ts +6 -1
  61. package/src/api/types.ts +23 -1
  62. package/src/boundingBoxHighlight/BoundingBoxHighlightContainer.tsx +4 -1
  63. package/src/common/AnnotationCallbacksContext.ts +7 -0
  64. package/src/common/BaseAnnotator.scss +12 -0
  65. package/src/common/BaseAnnotator.ts +32 -2
  66. package/src/common/BaseManager.ts +2 -0
  67. package/src/common/DeselectListener.tsx +1 -1
  68. package/src/common/withProviders.tsx +6 -2
  69. package/src/components/BoundingBoxHighlight/BoundingBoxHighlightNav.scss +3 -3
  70. package/src/components/BoundingBoxHighlight/BoundingBoxHighlightRect.scss +11 -6
  71. package/src/components/Popups/PopupBase.scss +2 -2
  72. package/src/components/Popups/PopupDrawingToolbar.scss +4 -4
  73. package/src/components/Popups/PopupDrawingToolbar.tsx +0 -7
  74. package/src/components/Popups/PopupList.scss +1 -1
  75. package/src/components/Popups/PopupV2.scss +2 -2
  76. package/src/components/Popups/PopupV2.tsx +128 -72
  77. package/src/components/ReplyForm/ReplyForm.tsx +1 -8
  78. package/src/constants.ts +2 -3
  79. package/src/document/DocumentAnnotator.ts +29 -5
  80. package/src/document/docUtil.ts +8 -1
  81. package/src/drawing/DrawingAnnotations.tsx +30 -21
  82. package/src/drawing/DrawingAnnotationsContainer.tsx +3 -0
  83. package/src/drawing/DrawingCreator.tsx +9 -16
  84. package/src/drawing/DrawingCursor.ts +2 -1
  85. package/src/drawing/DrawingManager.tsx +21 -2
  86. package/src/highlight/HighlightAnnotations.tsx +28 -14
  87. package/src/highlight/HighlightContainer.tsx +3 -0
  88. package/src/highlight/HighlightCreator.scss +9 -2
  89. package/src/highlight/HighlightCreatorManager.ts +8 -5
  90. package/src/highlight/HighlightListener.ts +4 -2
  91. package/src/highlight/HighlightManager.tsx +13 -2
  92. package/src/image/ImageAnnotator.ts +2 -1
  93. package/src/media/MediaAnnotator.ts +39 -16
  94. package/src/popup/PopupLayer.tsx +38 -11
  95. package/src/popup/PopupManager.tsx +4 -2
  96. package/src/region/RegionAnnotations.tsx +2 -3
  97. package/src/region/RegionCreation.tsx +15 -9
  98. package/src/region/RegionCreationContainer.tsx +2 -2
  99. package/src/region/RegionCreationManager.tsx +8 -1
  100. package/src/region/RegionCreator.scss +9 -3
  101. package/src/region/RegionCreator.tsx +9 -17
  102. package/src/region/RegionManager.tsx +8 -1
  103. package/src/region/RegionRect.scss +17 -9
  104. package/src/store/annotations/actions.ts +104 -33
  105. package/src/store/annotations/reducer.ts +49 -1
  106. package/src/store/creator/selectors.ts +6 -6
  107. package/src/store/eventing/create.ts +6 -4
  108. package/src/store/eventing/delete.ts +26 -0
  109. package/src/store/eventing/middleware.ts +53 -15
  110. package/src/store/eventing/replyCreate.ts +30 -0
  111. package/src/store/eventing/replyDelete.ts +31 -0
  112. package/src/store/eventing/replyUpdate.ts +35 -0
  113. package/src/store/eventing/types.ts +4 -4
  114. package/src/store/eventing/update.ts +28 -0
  115. package/src/store/highlight/actions.ts +50 -19
  116. package/src/store/highlight/types.ts +1 -0
  117. package/src/store/options/selectors.ts +2 -2
  118. package/src/store/options/types.ts +2 -2
  119. package/src/test-utils/videoAnnotations.tsx +11 -11
  120. package/src/utils/rotate.ts +43 -0
  121. package/src/utils/useVideoTiming.ts +9 -13
@@ -8,6 +8,18 @@ ba.annotationsLoadError = Przepraszamy, nie można wczytać uwag dla tego pliku.
8
8
  ba.annotationsPost = Opublikuj
9
9
  # Label for the save button
10
10
  ba.annotationsSave = Zapisz
11
+ # Aria label for the button to view the next reference
12
+ ba.boundingBoxHighlight.viewNextReference = Wyświetl następne odniesienie
13
+ # Aria label for the button to view the previous reference
14
+ ba.boundingBoxHighlight.viewPrevReference = Wyświetl poprzednie odniesienie
15
+ # Aria label description for reply popup
16
+ ba.popup.reply.comment = Komentarz
17
+ # Aria label description for annotation comment field
18
+ ba.popup.reply.field = Wpisz komentarz
19
+ # Aria label for mention selector loading state
20
+ ba.popup.reply.mentionLoading = Trwa wczytywanie użytkowników…
21
+ # Aria role description for mention user selector
22
+ ba.popup.reply.mentionSelector = Wspomnij o współpracowniku
11
23
  # Button label for cancelling the creation of a description, comment, or reply
12
24
  ba.popups.cancel = Anuluj
13
25
  # Button label for adding a comment in the drawing toolbar
package/i18n/pt-BR.js CHANGED
@@ -4,6 +4,12 @@ export default {
4
4
  "ba.annotationsLoadError": "Não foi possível carregar as anotações deste arquivo.",
5
5
  "ba.annotationsPost": "Publicar",
6
6
  "ba.annotationsSave": "Salvar",
7
+ "ba.boundingBoxHighlight.viewNextReference": "Visualizar próxima referência",
8
+ "ba.boundingBoxHighlight.viewPrevReference": "Visualizar referência anterior",
9
+ "ba.popup.reply.comment": "Comentário",
10
+ "ba.popup.reply.field": "Digite um comentário",
11
+ "ba.popup.reply.mentionLoading": "Carregando usuários…",
12
+ "ba.popup.reply.mentionSelector": "Mencionar um colaborador",
7
13
  "ba.popups.cancel": "Cancelar",
8
14
  "ba.popups.drawing.addComment": "Adicionar comentário",
9
15
  "ba.popups.drawing.delete": "Excluir",
@@ -8,6 +8,18 @@ ba.annotationsLoadError = Não foi possível carregar as anotações deste arqui
8
8
  ba.annotationsPost = Publicar
9
9
  # Label for the save button
10
10
  ba.annotationsSave = Salvar
11
+ # Aria label for the button to view the next reference
12
+ ba.boundingBoxHighlight.viewNextReference = Visualizar próxima referência
13
+ # Aria label for the button to view the previous reference
14
+ ba.boundingBoxHighlight.viewPrevReference = Visualizar referência anterior
15
+ # Aria label description for reply popup
16
+ ba.popup.reply.comment = Comentário
17
+ # Aria label description for annotation comment field
18
+ ba.popup.reply.field = Digite um comentário
19
+ # Aria label for mention selector loading state
20
+ ba.popup.reply.mentionLoading = Carregando usuários…
21
+ # Aria role description for mention user selector
22
+ ba.popup.reply.mentionSelector = Mencionar um colaborador
11
23
  # Button label for cancelling the creation of a description, comment, or reply
12
24
  ba.popups.cancel = Cancelar
13
25
  # Button label for adding a comment in the drawing toolbar
package/i18n/ru-RU.js CHANGED
@@ -4,6 +4,12 @@ export default {
4
4
  "ba.annotationsLoadError": "Сбой при загрузке примечаний для этого файла.",
5
5
  "ba.annotationsPost": "Отправить",
6
6
  "ba.annotationsSave": "Сохранить",
7
+ "ba.boundingBoxHighlight.viewNextReference": "Посмотреть следующую ссылку",
8
+ "ba.boundingBoxHighlight.viewPrevReference": "Посмотреть предыдущую ссылку",
9
+ "ba.popup.reply.comment": "Комментарий",
10
+ "ba.popup.reply.field": "Введите комментарий",
11
+ "ba.popup.reply.mentionLoading": "Загрузка пользователей…",
12
+ "ba.popup.reply.mentionSelector": "Упомянуть соавтора",
7
13
  "ba.popups.cancel": "Отмена",
8
14
  "ba.popups.drawing.addComment": "Добавить комментарий",
9
15
  "ba.popups.drawing.delete": "Удалить",
@@ -8,6 +8,18 @@ ba.annotationsLoadError = Сбой при загрузке примечаний
8
8
  ba.annotationsPost = Отправить
9
9
  # Label for the save button
10
10
  ba.annotationsSave = Сохранить
11
+ # Aria label for the button to view the next reference
12
+ ba.boundingBoxHighlight.viewNextReference = Посмотреть следующую ссылку
13
+ # Aria label for the button to view the previous reference
14
+ ba.boundingBoxHighlight.viewPrevReference = Посмотреть предыдущую ссылку
15
+ # Aria label description for reply popup
16
+ ba.popup.reply.comment = Комментарий
17
+ # Aria label description for annotation comment field
18
+ ba.popup.reply.field = Введите комментарий
19
+ # Aria label for mention selector loading state
20
+ ba.popup.reply.mentionLoading = Загрузка пользователей…
21
+ # Aria role description for mention user selector
22
+ ba.popup.reply.mentionSelector = Упомянуть соавтора
11
23
  # Button label for cancelling the creation of a description, comment, or reply
12
24
  ba.popups.cancel = Отмена
13
25
  # Button label for adding a comment in the drawing toolbar
package/i18n/sv-SE.js CHANGED
@@ -4,6 +4,12 @@ export default {
4
4
  "ba.annotationsLoadError": "Det gick inte att ladda anteckningar för den här filen.",
5
5
  "ba.annotationsPost": "Publicera",
6
6
  "ba.annotationsSave": "Spara",
7
+ "ba.boundingBoxHighlight.viewNextReference": "Visa nästa referens",
8
+ "ba.boundingBoxHighlight.viewPrevReference": "Visa föregående referens",
9
+ "ba.popup.reply.comment": "Kommentar",
10
+ "ba.popup.reply.field": "Skriv en kommentar",
11
+ "ba.popup.reply.mentionLoading": "Läser in användare …",
12
+ "ba.popup.reply.mentionSelector": "Nämn en medarbetare",
7
13
  "ba.popups.cancel": "Avbryt",
8
14
  "ba.popups.drawing.addComment": "Lägg till kommentar",
9
15
  "ba.popups.drawing.delete": "Radera",
@@ -8,6 +8,18 @@ ba.annotationsLoadError = Det gick inte att ladda anteckningar för den här fil
8
8
  ba.annotationsPost = Publicera
9
9
  # Label for the save button
10
10
  ba.annotationsSave = Spara
11
+ # Aria label for the button to view the next reference
12
+ ba.boundingBoxHighlight.viewNextReference = Visa nästa referens
13
+ # Aria label for the button to view the previous reference
14
+ ba.boundingBoxHighlight.viewPrevReference = Visa föregående referens
15
+ # Aria label description for reply popup
16
+ ba.popup.reply.comment = Kommentar
17
+ # Aria label description for annotation comment field
18
+ ba.popup.reply.field = Skriv en kommentar
19
+ # Aria label for mention selector loading state
20
+ ba.popup.reply.mentionLoading = Läser in användare …
21
+ # Aria role description for mention user selector
22
+ ba.popup.reply.mentionSelector = Nämn en medarbetare
11
23
  # Button label for cancelling the creation of a description, comment, or reply
12
24
  ba.popups.cancel = Avbryt
13
25
  # Button label for adding a comment in the drawing toolbar
package/i18n/tr-TR.js CHANGED
@@ -4,6 +4,12 @@ export default {
4
4
  "ba.annotationsLoadError": "Üzgünüz, açıklamalar bu dosya için yüklenemedi.",
5
5
  "ba.annotationsPost": "Gönder",
6
6
  "ba.annotationsSave": "Kaydet",
7
+ "ba.boundingBoxHighlight.viewNextReference": "Sonraki referansı görüntüleyin",
8
+ "ba.boundingBoxHighlight.viewPrevReference": "Önceki referansı görüntüleyin",
9
+ "ba.popup.reply.comment": "Yorum",
10
+ "ba.popup.reply.field": "Bir yorum yazın",
11
+ "ba.popup.reply.mentionLoading": "Kullanıcılar yükleniyor…",
12
+ "ba.popup.reply.mentionSelector": "Bir ortak çalışandan bahsedin",
7
13
  "ba.popups.cancel": "İptal",
8
14
  "ba.popups.drawing.addComment": "Yorum Ekle",
9
15
  "ba.popups.drawing.delete": "Sil",
@@ -8,6 +8,18 @@ ba.annotationsLoadError = Üzgünüz, açıklamalar bu dosya için yüklenemedi.
8
8
  ba.annotationsPost = Gönder
9
9
  # Label for the save button
10
10
  ba.annotationsSave = Kaydet
11
+ # Aria label for the button to view the next reference
12
+ ba.boundingBoxHighlight.viewNextReference = Sonraki referansı görüntüleyin
13
+ # Aria label for the button to view the previous reference
14
+ ba.boundingBoxHighlight.viewPrevReference = Önceki referansı görüntüleyin
15
+ # Aria label description for reply popup
16
+ ba.popup.reply.comment = Yorum
17
+ # Aria label description for annotation comment field
18
+ ba.popup.reply.field = Bir yorum yazın
19
+ # Aria label for mention selector loading state
20
+ ba.popup.reply.mentionLoading = Kullanıcılar yükleniyor…
21
+ # Aria role description for mention user selector
22
+ ba.popup.reply.mentionSelector = Bir ortak çalışandan bahsedin
11
23
  # Button label for cancelling the creation of a description, comment, or reply
12
24
  ba.popups.cancel = İptal
13
25
  # Button label for adding a comment in the drawing toolbar
package/i18n/zh-CN.js CHANGED
@@ -4,6 +4,12 @@ export default {
4
4
  "ba.annotationsLoadError": "抱歉,无法为此文件加载批注。",
5
5
  "ba.annotationsPost": "发布",
6
6
  "ba.annotationsSave": "保存",
7
+ "ba.boundingBoxHighlight.viewNextReference": "查看下一个引用",
8
+ "ba.boundingBoxHighlight.viewPrevReference": "查看先前引用",
9
+ "ba.popup.reply.comment": "评论",
10
+ "ba.popup.reply.field": "键入注释",
11
+ "ba.popup.reply.mentionLoading": "正在加载用户…",
12
+ "ba.popup.reply.mentionSelector": "提及协作者",
7
13
  "ba.popups.cancel": "取消",
8
14
  "ba.popups.drawing.addComment": "添加评论",
9
15
  "ba.popups.drawing.delete": "删除",
@@ -8,6 +8,18 @@ ba.annotationsLoadError = 抱歉,无法为此文件加载批注。
8
8
  ba.annotationsPost = 发布
9
9
  # Label for the save button
10
10
  ba.annotationsSave = 保存
11
+ # Aria label for the button to view the next reference
12
+ ba.boundingBoxHighlight.viewNextReference = 查看下一个引用
13
+ # Aria label for the button to view the previous reference
14
+ ba.boundingBoxHighlight.viewPrevReference = 查看先前引用
15
+ # Aria label description for reply popup
16
+ ba.popup.reply.comment = 评论
17
+ # Aria label description for annotation comment field
18
+ ba.popup.reply.field = 键入注释
19
+ # Aria label for mention selector loading state
20
+ ba.popup.reply.mentionLoading = 正在加载用户…
21
+ # Aria role description for mention user selector
22
+ ba.popup.reply.mentionSelector = 提及协作者
11
23
  # Button label for cancelling the creation of a description, comment, or reply
12
24
  ba.popups.cancel = 取消
13
25
  # Button label for adding a comment in the drawing toolbar
package/i18n/zh-TW.js CHANGED
@@ -4,6 +4,12 @@ export default {
4
4
  "ba.annotationsLoadError": "很抱歉,無法載入此檔案的註解。",
5
5
  "ba.annotationsPost": "張貼",
6
6
  "ba.annotationsSave": "儲存",
7
+ "ba.boundingBoxHighlight.viewNextReference": "檢視下一個參考項目",
8
+ "ba.boundingBoxHighlight.viewPrevReference": "檢視先前的參考項目",
9
+ "ba.popup.reply.comment": "留言",
10
+ "ba.popup.reply.field": "鍵入留言",
11
+ "ba.popup.reply.mentionLoading": "正在載入使用者…",
12
+ "ba.popup.reply.mentionSelector": "提及共同作業者",
7
13
  "ba.popups.cancel": "取消",
8
14
  "ba.popups.drawing.addComment": "新增留言",
9
15
  "ba.popups.drawing.delete": "刪除",
@@ -8,6 +8,18 @@ ba.annotationsLoadError = 很抱歉,無法載入此檔案的註解。
8
8
  ba.annotationsPost = 張貼
9
9
  # Label for the save button
10
10
  ba.annotationsSave = 儲存
11
+ # Aria label for the button to view the next reference
12
+ ba.boundingBoxHighlight.viewNextReference = 檢視下一個參考項目
13
+ # Aria label for the button to view the previous reference
14
+ ba.boundingBoxHighlight.viewPrevReference = 檢視先前的參考項目
15
+ # Aria label description for reply popup
16
+ ba.popup.reply.comment = 留言
17
+ # Aria label description for annotation comment field
18
+ ba.popup.reply.field = 鍵入留言
19
+ # Aria label for mention selector loading state
20
+ ba.popup.reply.mentionLoading = 正在載入使用者…
21
+ # Aria role description for mention user selector
22
+ ba.popup.reply.mentionSelector = 提及共同作業者
11
23
  # Button label for cancelling the creation of a description, comment, or reply
12
24
  ba.popups.cancel = 取消
13
25
  # Button label for adding a comment in the drawing toolbar
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  import './dist/annotations.css';
2
- import './dist/annotations.js';
2
+ import BoxAnnotations from './dist/annotations.js';
3
3
 
4
4
  export default BoxAnnotations;
package/package.json CHANGED
@@ -1,9 +1,14 @@
1
1
  {
2
2
  "name": "box-annotations",
3
- "version": "5.2.1-beta.8",
3
+ "version": "5.3.1-beta.0",
4
4
  "description": "Box Annotations",
5
5
  "author": "Box (https://www.box.com/)",
6
6
  "license": "SEE LICENSE IN LICENSE",
7
+ "sideEffects": [
8
+ "./dist/annotations.js",
9
+ "**/*.css",
10
+ "**/*.scss"
11
+ ],
7
12
  "repository": {
8
13
  "type": "git",
9
14
  "url": "git@github.com:box/box-annotations.git"
@@ -12,7 +17,7 @@
12
17
  "registry": "https://registry.npmjs.org/"
13
18
  },
14
19
  "engines": {
15
- "node": ">=18.x",
20
+ "node": ">=20.x",
16
21
  "yarn": ">=1.10.x"
17
22
  },
18
23
  "devDependencies": {
@@ -27,17 +32,20 @@
27
32
  "@babel/preset-env": "^7.25.9",
28
33
  "@babel/preset-react": "^7.25.9",
29
34
  "@babel/preset-typescript": "^7.25.9",
30
- "@box/frontend": "^10.0.0",
31
- "@box/blueprint-web": "^14.12.2",
32
- "@box/blueprint-web-assets": "^4.114.3",
33
- "@box/collaboration-popover": "^1.60.2",
35
+ "@box/blueprint-web": "^16.12.0",
36
+ "@box/blueprint-web-assets": "^5.5.12",
37
+ "@box/collaboration-popover": "^2.1.32",
38
+ "@box/combobox-with-api": "^1.42.22",
39
+ "@box/frontend": "^11.0.1",
40
+ "@box/item-icon": "^3.2.0",
34
41
  "@box/languages": "^1.1.0",
35
- "@box/readable-time": "^1.39.52",
36
- "@box/threaded-annotations": "^1.80.0",
37
- "@box/user-selector": "^1.74.52",
42
+ "@box/readable-time": "^2.1.32",
43
+ "@box/threaded-annotations": "^4.11.0",
44
+ "@box/types": "^2.1.8",
45
+ "@box/user-selector": "^2.1.35",
38
46
  "@cfaester/enzyme-adapter-react-18": "^0.8.0",
39
- "@commitlint/cli": "^8.3.5",
40
- "@commitlint/config-conventional": "^8.2.0",
47
+ "@commitlint/cli": "^19.8.0",
48
+ "@commitlint/config-conventional": "^19.8.0",
41
49
  "@formatjs/intl-pluralrules": "^1.5.5",
42
50
  "@formatjs/intl-relativetimeformat": "^4.5.12",
43
51
  "@popperjs/core": "^2.4.0",
@@ -48,7 +56,7 @@
48
56
  "@types/classnames": "^2.2.10",
49
57
  "@types/draft-js": "^0.10.40",
50
58
  "@types/enzyme": "^3.10.5",
51
- "@types/jest": "^24.9.0",
59
+ "@types/jest": "^29.5.14",
52
60
  "@types/lodash": "^4.14.150",
53
61
  "@types/react": "18.3.12",
54
62
  "@types/react-dom": "18.3.1",
@@ -57,24 +65,23 @@
57
65
  "@typescript-eslint/eslint-plugin": "^7.3.1",
58
66
  "@typescript-eslint/parser": "^7.3.1",
59
67
  "autoprefixer": "^10.4.19",
60
- "axios": "^0.24.0",
61
- "babel-eslint": "^10.1.0",
62
- "babel-jest": "^24.9.0",
68
+ "axios": "^0.33.0",
69
+ "babel-jest": "^29.7.0",
63
70
  "babel-loader": "^9.2.1",
64
71
  "babel-plugin-istanbul": "^6.0.0",
65
72
  "babel-plugin-react-intl": "^7.5.1",
66
73
  "babel-plugin-transform-require-ignore": "^0.1.1",
67
- "box-node-sdk": "^1.33.0",
68
74
  "box-ui-elements": "^20.0.0",
69
75
  "circular-dependency-plugin": "^5.2.0",
70
76
  "classnames": "^2.2.5",
71
77
  "clsx": "^2.1.1",
72
- "conventional-github-releaser": "^3.1.3",
78
+ "conventional-changelog": "^8.1.3",
79
+ "conventional-changelog-conventionalcommits": "^10.3.0",
73
80
  "core-js": "^3.38.1",
74
81
  "css-loader": "^7.1.2",
75
- "css-minimizer-webpack-plugin": "^7.0.4",
76
- "cypress": "^4.4.1",
77
- "draft-js": "0.10.5",
82
+ "css-minimizer-webpack-plugin": "^8.0.0",
83
+ "cypress": "^15.20.1",
84
+ "draft-js": "^0.11.7",
78
85
  "enzyme": "^3.11.0",
79
86
  "enzyme-to-json": "^3.4.4",
80
87
  "eslint": "^8.57.0",
@@ -91,17 +98,18 @@
91
98
  "eslint-plugin-prettier": "^5.2.1",
92
99
  "eslint-plugin-react": "^7.34.3",
93
100
  "eslint-plugin-react-hooks": "^4.6.0",
94
- "formik": "^2.1.4",
101
+ "formik": "^2.4.9",
95
102
  "husky": "^3.1.0",
96
- "jest": "^24.9.0",
97
- "jest-canvas-mock": "^2.4.0",
98
- "jest-environment-jsdom-sixteen": "^1.0.3",
103
+ "jest": "^29.7.0",
104
+ "jest-canvas-mock": "^2.5.2",
105
+ "jest-environment-jsdom": "^29.7.0",
99
106
  "lint-staged": "^9.5.0",
100
107
  "lodash": "^4.17.15",
101
108
  "mini-css-extract-plugin": "^2.10.1",
102
109
  "npm-run-all": "^4.1.5",
110
+ "postcss": "^8.5.18",
103
111
  "postcss-loader": "^8.1.1",
104
- "prettier": "^1.19.1",
112
+ "prettier": "^3.2.5",
105
113
  "react": "18.3.1",
106
114
  "react-dom": "18.3.1",
107
115
  "react-intl": "6.4.2",
@@ -110,30 +118,34 @@
110
118
  "react-textarea-autosize": "^7.1.2",
111
119
  "redux": "^4.0.5",
112
120
  "regenerator-runtime": "^0.13.9",
113
- "sass": "^1.64.1",
121
+ "sass": "1.77.6",
114
122
  "sass-loader": "^16.0.4",
115
123
  "scroll-into-view-if-needed": "^2.2.24",
116
124
  "style-loader": "^4.0.0",
117
- "stylelint": "^12.0.0",
118
- "stylelint-config-rational-order": "^0.1.2",
119
- "stylelint-config-standard": "^19.0.0",
120
- "stylelint-order": "^3.1.1",
125
+ "stylelint": "^16.26.1",
126
+ "stylelint-config-standard": "^38.0.0",
127
+ "stylelint-config-standard-scss": "^14.0.0",
128
+ "stylelint-order": "^6.0.4",
121
129
  "tabbable": "^1.1.3",
122
- "typescript": "4.9.5",
130
+ "typescript": "5.2.2",
123
131
  "uuid": "^8.3.1",
124
- "wait-on": "^4.0.2",
132
+ "wait-on": "^9.0.5",
125
133
  "webpack": "^5.105.4",
126
134
  "webpack-cli": "^5.1.4",
127
- "webpack-dev-server": "^5.2.3",
135
+ "webpack-dev-server": "^5.2.6",
128
136
  "worker-farm": "^1.7.0"
129
137
  },
130
138
  "peerDependencies": {
131
- "@box/blueprint-web": "^14.12.2",
132
- "@box/blueprint-web-assets": "^4.114.3",
133
- "@box/collaboration-popover": "^1.60.2",
134
- "@box/readable-time": "^1.39.52",
135
- "@box/threaded-annotations": "^1.80.0",
136
- "@box/user-selector": "^1.74.52"
139
+ "@box/blueprint-web": "^16.12.0",
140
+ "@box/blueprint-web-assets": "^5.5.12",
141
+ "@box/collaboration-popover": "^2.1.32",
142
+ "@box/combobox-with-api": "^1.42.22",
143
+ "@box/item-icon": "^3.2.0",
144
+ "@box/readable-time": "^2.1.32",
145
+ "@box/threaded-annotations": "^4.11.0",
146
+ "@box/types": "^2.1.8",
147
+ "@box/user-selector": "^2.1.35",
148
+ "axios": "^0.33.0"
137
149
  },
138
150
  "scripts": {
139
151
  "build": "yarn setup && yarn build:prod:dist",
@@ -143,10 +155,10 @@
143
155
  "clean": "rm -rf dist reports/* i18n/json i18n/*.js",
144
156
  "cy:open": "yarn cy:wait; yarn cypress open",
145
157
  "cy:run": "yarn cy:wait; yarn cypress run --spec test/integration/**/*.test.js",
146
- "cy:wait": "wait-on http-get://localhost:8001",
158
+ "cy:wait": "wait-on http-get://127.0.0.1:8001",
147
159
  "lint": "npm-run-all lint:*",
148
160
  "lint:js": "eslint .",
149
- "lint:scss": "stylelint \"src/**/*.scss\" --syntax scss",
161
+ "lint:scss": "stylelint \"src/**/*.scss\"",
150
162
  "lint:ts": "tsc && eslint --ext=.tsx,.ts --max-warnings=0 .",
151
163
  "release:cdn": "yarn setup; node ./scripts/prod.js",
152
164
  "release:custom": "scripts/release.sh -c",
@@ -174,6 +186,6 @@
174
186
  "**/react-intl/**/@types/react": "^18.3.12",
175
187
  "**/@types/react": "^18.3.12",
176
188
  "**/@types/react-dom": "^18.2.0",
177
- "acorn": "8.14.0"
189
+ "draft-js/immutable": "^3.8.3"
178
190
  }
179
191
  }
package/src/@types/api.ts CHANGED
@@ -10,5 +10,6 @@ export interface Permissions {
10
10
  }
11
11
 
12
12
  export type TokenLiteral = null | undefined | string | { read: string; write?: string };
13
- export type TokenResolver = () => TokenLiteral | Promise<TokenLiteral>;
14
- export type Token = TokenLiteral | TokenResolver;
13
+ export type TokenMap = { [typedFileId: string]: TokenLiteral };
14
+ export type TokenResolver = (typedFileId?: string) => TokenLiteral | TokenMap | Promise<TokenLiteral | TokenMap>;
15
+ export type Token = TokenLiteral | TokenMap | TokenResolver;
@@ -1,19 +1,36 @@
1
1
  enum Event {
2
- ACTIVE_CHANGE = 'annotations_active_change',
2
+ // Inbound: emitted by the host; box-annotations listens.
3
3
  ACTIVE_SET = 'annotations_active_set',
4
- CREATOR_STAGED_CHANGE = 'creator_staged_change',
5
- CREATOR_STATUS_CHANGE = 'creator_status_change',
4
+ ANNOTATION_REMOVE = 'annotations_remove',
5
+ BOUNDING_BOX_HIGHLIGHTS_SET = 'bounding_box_highlights_set',
6
+ BOUNDING_BOX_HIGHLIGHT_SELECT = 'bounding_box_highlight_select',
7
+ COLOR_SET = 'annotations_color_set',
8
+ VIEW_MODE_SET = 'view_mode_set',
9
+ VISIBLE_SET = 'annotations_visible_set',
10
+
11
+ // Outbound: emitted by box-annotations; the host listens.
12
+ ACTIVE_CHANGE = 'annotations_active_change',
6
13
  ANNOTATION_CREATE = 'annotations_create',
14
+ ANNOTATION_DELETE = 'annotations_delete',
7
15
  ANNOTATION_FETCH_ERROR = 'annotations_fetch_error',
8
- ANNOTATION_REMOVE = 'annotations_remove',
16
+ ANNOTATION_REPLY_CREATE = 'annotations_reply_create',
17
+ ANNOTATION_REPLY_DELETE = 'annotations_reply_delete',
18
+ ANNOTATION_REPLY_UPDATE = 'annotations_reply_update',
19
+ ANNOTATION_UPDATE = 'annotations_update',
9
20
  ANNOTATIONS_INITIALIZED = 'annotations_initialized',
10
21
  ANNOTATIONS_MODE_CHANGE = 'annotations_mode_change',
11
- COLOR_SET = 'annotations_color_set',
12
- BOUNDING_BOX_HIGHLIGHTS_SET = 'bounding_box_highlights_set',
22
+ CREATOR_STAGED_CHANGE = 'creator_staged_change',
23
+ CREATOR_STATUS_CHANGE = 'creator_status_change',
24
+
25
+ // Internal: box-annotations emits and listens to itself (redux state change → DOM side effect).
13
26
  BOUNDING_BOX_HIGHLIGHT_NAVIGATE = 'bounding_box_highlight_navigate',
14
- BOUNDING_BOX_HIGHLIGHT_SELECT = 'bounding_box_highlight_select',
15
- VISIBLE_SET = 'annotations_visible_set',
16
- VIEW_MODE_SET = 'view_mode_set',
27
+ }
28
+
29
+ enum SidebarEvent {
30
+ SIDEBAR_ANNOTATION_UPDATE = 'sidebar.annotations_update',
31
+ SIDEBAR_REPLY_CREATE = 'sidebar.annotations_reply_create',
32
+ SIDEBAR_REPLY_DELETE = 'sidebar.annotations_reply_delete',
33
+ SIDEBAR_REPLY_UPDATE = 'sidebar.annotations_reply_update',
17
34
  }
18
35
 
19
36
  // Existing legacy events, don't rename
@@ -23,4 +40,4 @@ enum LegacyEvent {
23
40
  SCALE = 'scaleannotations',
24
41
  }
25
42
 
26
- export { Event, LegacyEvent };
43
+ export { Event, LegacyEvent, SidebarEvent };
@@ -1,12 +1,3 @@
1
- /* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-namespace */
2
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
3
- declare namespace NodeJS {
4
- interface Global {
5
- window: any;
6
- BoxAnnotations: any;
7
- }
8
- }
9
-
10
1
  declare module 'box-annotations-locale-data';
11
2
  declare module 'box-elements-messages';
12
3
  declare module 'box-ui-elements/es/*'; // TODO: Figure out why types don't register properly
@@ -86,15 +86,24 @@ export interface Rect extends Position {
86
86
  width: number;
87
87
  }
88
88
 
89
+ export interface ReplyPermissions {
90
+ can_delete?: boolean;
91
+ can_edit?: boolean;
92
+ can_reply?: boolean;
93
+ can_resolve?: boolean;
94
+ }
95
+
89
96
  export interface Reply {
90
97
  created_at: string;
91
98
  created_by: User;
92
99
  id: string;
93
100
  message: string;
101
+ modified_at?: string;
94
102
  parent: {
95
103
  id: string;
96
104
  type: string;
97
105
  };
106
+ permissions?: ReplyPermissions;
98
107
  type: 'reply';
99
108
  }
100
109
 
@@ -16,9 +16,11 @@ type Annotator = {
16
16
  type AnnotationsOptions = {
17
17
  features: Features;
18
18
  intl: IntlOptions;
19
+ onCopyLink?: (params: { annotationId: string; fileVersionId: string }) => void;
19
20
  };
20
21
 
21
22
  export type Features = {
23
+ isRichTextEnabled?: boolean;
22
24
  isThreadedAnnotation?: boolean;
23
25
  [key: string]: boolean | undefined;
24
26
  };
@@ -43,6 +45,8 @@ type ViewerOption = {
43
45
 
44
46
  type ViewerOptions = Record<string, ViewerOption>;
45
47
 
48
+ type GlobalWithBoxAnnotations = typeof globalThis & { BoxAnnotations: typeof BoxAnnotations };
49
+
46
50
  /**
47
51
  * NAME: The name of the annotator.
48
52
  * CONSTRUCTOR: Constructor for the annotator.
@@ -66,7 +70,7 @@ const ANNOTATORS: Annotator[] = [
66
70
  CONSTRUCTOR: MediaAnnotator,
67
71
  NAME: 'Media',
68
72
  TYPES: [Type.region],
69
- VIEWERS: ['Dash','MP4'],
73
+ VIEWERS: ['Dash', 'MP4'],
70
74
  },
71
75
  ];
72
76
 
@@ -145,5 +149,5 @@ class BoxAnnotations {
145
149
  }
146
150
  }
147
151
 
148
- global.BoxAnnotations = BoxAnnotations;
152
+ (globalThis as GlobalWithBoxAnnotations).BoxAnnotations = BoxAnnotations;
149
153
  export default BoxAnnotations;