box-annotations 4.1.1-beta.3 → 4.1.1-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.
- package/dist/annotations.css +1 -1
- package/dist/annotations.js +1 -1
- package/i18n/en-US.js +1 -0
- package/i18n/en-US.properties +2 -0
- package/i18n/json/src/components/Popups/messages.json +1 -1
- package/package.json +8 -8
- package/src/common/BaseAnnotator.scss +10 -0
- package/src/components/Popups/messages.ts +5 -0
- package/src/components/ReplyField/ReplyField.tsx +5 -1
- package/src/components/ReplyForm/ReplyForm.tsx +1 -0
- package/src/image/ImageAnnotator.scss +1 -1
package/i18n/en-US.js
CHANGED
|
@@ -5,6 +5,7 @@ export default {
|
|
|
5
5
|
"ba.annotationsPost": "Post",
|
|
6
6
|
"ba.annotationsSave": "Save",
|
|
7
7
|
"ba.popup.reply.comment": "Comment",
|
|
8
|
+
"ba.popup.reply.field": "Type a comment",
|
|
8
9
|
"ba.popups.cancel": "Cancel",
|
|
9
10
|
"ba.popups.drawing.addComment": "Add Comment",
|
|
10
11
|
"ba.popups.drawing.delete": "Delete",
|
package/i18n/en-US.properties
CHANGED
|
@@ -10,6 +10,8 @@ ba.annotationsPost = Post
|
|
|
10
10
|
ba.annotationsSave = Save
|
|
11
11
|
# Aria label description for reply popup
|
|
12
12
|
ba.popup.reply.comment = Comment
|
|
13
|
+
# Aria label description for annotation comment field
|
|
14
|
+
ba.popup.reply.field = Type a comment
|
|
13
15
|
# Button label for cancelling the creation of a description, comment, or reply
|
|
14
16
|
ba.popups.cancel = Cancel
|
|
15
17
|
# Button label for adding a comment in the drawing toolbar
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"id":"ba.popup.reply.comment","description":"Aria label description for reply popup","defaultMessage":"Comment"},{"id":"ba.popups.cancel","description":"Button label for cancelling the creation of a description, comment, or reply","defaultMessage":"Cancel"},{"id":"ba.popups.post","description":"Button label for creating a description, comment, or reply","defaultMessage":"Post"},{"id":"ba.popups.drawing.addComment","description":"Button label for adding a comment in the drawing toolbar","defaultMessage":"Add Comment"},{"id":"ba.popups.drawing.delete","description":"Button title for deleting a staged drawing","defaultMessage":"Delete"},{"id":"ba.popups.drawing.redo","description":"Button title for redoing a staged drawing","defaultMessage":"Redo"},{"id":"ba.popups.drawing.undo","description":"Button title for undoing a staged drawing","defaultMessage":"Undo"},{"id":"ba.popups.replyField.placeholder","description":"Placeholder for reply field editor","defaultMessage":"Type a comment..."},{"id":"ba.popups.popupHighlight.promoter","description":"Popup message for highlight promoter","defaultMessage":"Highlight and Comment"},{"id":"ba.popups.popupHighlight.restrictedPrompt","description":"Prompt message when selection crosses multiple pages","defaultMessage":"Comments restricted to single page"},{"id":"ba.popups.popupList.prompt","description":"Prompt message for empty popup list","defaultMessage":"Mention someone to notify them"},{"id":"ba.popups.popupCursor.regionPrompt","description":"Prompt message following cursor in region annotations mode","defaultMessage":"Draw a box to comment"}]
|
|
1
|
+
[{"id":"ba.popup.reply.comment","description":"Aria label description for reply popup","defaultMessage":"Comment"},{"id":"ba.popup.reply.field","description":"Aria label description for annotation comment field","defaultMessage":"Type a comment"},{"id":"ba.popups.cancel","description":"Button label for cancelling the creation of a description, comment, or reply","defaultMessage":"Cancel"},{"id":"ba.popups.post","description":"Button label for creating a description, comment, or reply","defaultMessage":"Post"},{"id":"ba.popups.drawing.addComment","description":"Button label for adding a comment in the drawing toolbar","defaultMessage":"Add Comment"},{"id":"ba.popups.drawing.delete","description":"Button title for deleting a staged drawing","defaultMessage":"Delete"},{"id":"ba.popups.drawing.redo","description":"Button title for redoing a staged drawing","defaultMessage":"Redo"},{"id":"ba.popups.drawing.undo","description":"Button title for undoing a staged drawing","defaultMessage":"Undo"},{"id":"ba.popups.replyField.placeholder","description":"Placeholder for reply field editor","defaultMessage":"Type a comment..."},{"id":"ba.popups.popupHighlight.promoter","description":"Popup message for highlight promoter","defaultMessage":"Highlight and Comment"},{"id":"ba.popups.popupHighlight.restrictedPrompt","description":"Prompt message when selection crosses multiple pages","defaultMessage":"Comments restricted to single page"},{"id":"ba.popups.popupList.prompt","description":"Prompt message for empty popup list","defaultMessage":"Mention someone to notify them"},{"id":"ba.popups.popupCursor.regionPrompt","description":"Prompt message following cursor in region annotations mode","defaultMessage":"Draw a box to comment"}]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "box-annotations",
|
|
3
|
-
"version": "4.1.1-beta.
|
|
3
|
+
"version": "4.1.1-beta.5",
|
|
4
4
|
"description": "Box Annotations",
|
|
5
5
|
"author": "Box (https://www.box.com/)",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"registry": "https://registry.npmjs.org/"
|
|
13
13
|
},
|
|
14
14
|
"engines": {
|
|
15
|
-
"node": ">=
|
|
15
|
+
"node": ">=18.x",
|
|
16
16
|
"yarn": ">=1.10.x"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"babel-plugin-react-intl": "^7.5.1",
|
|
56
56
|
"babel-plugin-transform-require-ignore": "^0.1.1",
|
|
57
57
|
"box-node-sdk": "^1.33.0",
|
|
58
|
-
"box-ui-elements": "^
|
|
58
|
+
"box-ui-elements": "^18.1.0",
|
|
59
59
|
"circular-dependency-plugin": "^5.2.0",
|
|
60
60
|
"classnames": "^2.2.5",
|
|
61
61
|
"conventional-github-releaser": "^3.1.3",
|
|
@@ -82,12 +82,11 @@
|
|
|
82
82
|
"formik": "^2.1.4",
|
|
83
83
|
"husky": "^3.1.0",
|
|
84
84
|
"jest": "^24.9.0",
|
|
85
|
-
"jest-canvas-mock": "^2.
|
|
85
|
+
"jest-canvas-mock": "^2.4.0",
|
|
86
86
|
"jest-environment-jsdom-sixteen": "^1.0.3",
|
|
87
87
|
"lint-staged": "^9.5.0",
|
|
88
88
|
"lodash": "^4.17.15",
|
|
89
89
|
"mini-css-extract-plugin": "^0.9.0",
|
|
90
|
-
"node-sass": "^4.13.1",
|
|
91
90
|
"npm-run-all": "^4.1.5",
|
|
92
91
|
"optimize-css-assets-webpack-plugin": "^5.0.3",
|
|
93
92
|
"postcss-loader": "^3.0.0",
|
|
@@ -100,6 +99,7 @@
|
|
|
100
99
|
"react-tether": "1.0.5",
|
|
101
100
|
"react-textarea-autosize": "^7.1.2",
|
|
102
101
|
"redux": "^4.0.5",
|
|
102
|
+
"sass": "^1.64.1",
|
|
103
103
|
"sass-loader": "^8.0.2",
|
|
104
104
|
"scroll-into-view-if-needed": "^2.2.24",
|
|
105
105
|
"style-loader": "^1.1.4",
|
|
@@ -120,8 +120,8 @@
|
|
|
120
120
|
"scripts": {
|
|
121
121
|
"build": "yarn setup && yarn build:prod:dist",
|
|
122
122
|
"build:i18n": "props2es",
|
|
123
|
-
"build:dev:dist": "LANGUAGE=en-US BABEL_ENV=dev NODE_ENV=dev webpack --config scripts/webpack.config.js --mode development --progress --colors",
|
|
124
|
-
"build:prod:dist": "BABEL_ENV=production NODE_ENV=production webpack --config scripts/webpack.config.js --mode production",
|
|
123
|
+
"build:dev:dist": "LANGUAGE=en-US BABEL_ENV=dev NODE_ENV=dev NODE_OPTIONS=--openssl-legacy-provider webpack --config scripts/webpack.config.js --mode development --progress --colors",
|
|
124
|
+
"build:prod:dist": "LANGUAGE=en-US BABEL_ENV=production NODE_ENV=production NODE_OPTIONS=--openssl-legacy-provider webpack --config scripts/webpack.config.js --mode production",
|
|
125
125
|
"clean": "rm -rf dist reports/* i18n/json i18n/*.js",
|
|
126
126
|
"cy:open": "yarn cy:wait; yarn cypress open",
|
|
127
127
|
"cy:run": "yarn cy:wait; yarn cypress run --spec test/integration/**/*.test.js",
|
|
@@ -138,7 +138,7 @@
|
|
|
138
138
|
"release:pre": "scripts/release.sh -x",
|
|
139
139
|
"setup": "yarn install && yarn clean && yarn build:i18n",
|
|
140
140
|
"start": "yarn setup && yarn build:dev:dist --watch",
|
|
141
|
-
"start:dev": "yarn setup && LANGUAGE=en-US BABEL_ENV=dev NODE_ENV=dev yarn webpack-dev-server --config scripts/webpack.config.js --mode development",
|
|
141
|
+
"start:dev": "yarn setup && LANGUAGE=en-US BABEL_ENV=dev NODE_ENV=dev NODE_OPTIONS=--openssl-legacy-provider yarn webpack-dev-server --config scripts/webpack.config.js --mode development",
|
|
142
142
|
"start:linked": "IS_LINKED=1 yarn start",
|
|
143
143
|
"test": "BABEL_ENV=test NODE_ENV=test yarn jest",
|
|
144
144
|
"test:e2e": "node scripts/cypress.js",
|
|
@@ -6,6 +6,11 @@ export default defineMessages({
|
|
|
6
6
|
description: 'Aria label description for reply popup',
|
|
7
7
|
defaultMessage: 'Comment',
|
|
8
8
|
},
|
|
9
|
+
ariaLabelReplyField: {
|
|
10
|
+
id: 'ba.popup.reply.field',
|
|
11
|
+
description: 'Aria label description for annotation comment field',
|
|
12
|
+
defaultMessage: 'Type a comment',
|
|
13
|
+
},
|
|
9
14
|
buttonCancel: {
|
|
10
15
|
id: 'ba.popups.cancel',
|
|
11
16
|
description: 'Button label for cancelling the creation of a description, comment, or reply',
|
|
@@ -6,8 +6,10 @@ import {
|
|
|
6
6
|
getActiveMentionForEditorState,
|
|
7
7
|
} from 'box-ui-elements/es/components/form-elements/draft-js-mention-selector/utils';
|
|
8
8
|
import { DraftHandleValue, Editor, EditorState } from 'draft-js';
|
|
9
|
+
import { IntlShape } from 'react-intl';
|
|
9
10
|
import PopupList from '../Popups/PopupList';
|
|
10
11
|
import { Collaborator } from '../../@types';
|
|
12
|
+
import messages from '../Popups/messages';
|
|
11
13
|
import { VirtualElement } from '../Popups/Popper';
|
|
12
14
|
import './ReplyField.scss';
|
|
13
15
|
|
|
@@ -29,6 +31,7 @@ export type Props = {
|
|
|
29
31
|
onChange: (editorState: EditorState) => void;
|
|
30
32
|
placeholder?: string;
|
|
31
33
|
setCursorPosition: (cursorPosition: number) => void;
|
|
34
|
+
intl: IntlShape;
|
|
32
35
|
};
|
|
33
36
|
|
|
34
37
|
export type State = {
|
|
@@ -197,13 +200,14 @@ export default class ReplyField extends React.Component<Props, State> {
|
|
|
197
200
|
handleMouseDown = (event: React.SyntheticEvent): void => event.preventDefault(); // prevent the blur event so that Editor can remain focus
|
|
198
201
|
|
|
199
202
|
render(): JSX.Element {
|
|
200
|
-
const { className, collaborators, editorState, isDisabled, placeholder, ...rest } = this.props;
|
|
203
|
+
const { className, collaborators, intl, editorState, isDisabled, placeholder, ...rest } = this.props;
|
|
201
204
|
const { activeItemIndex, popupAutoScroll, popupReference } = this.state;
|
|
202
205
|
|
|
203
206
|
return (
|
|
204
207
|
<div className={classnames(className, 'ba-ReplyField')}>
|
|
205
208
|
<Editor
|
|
206
209
|
{...rest}
|
|
210
|
+
ariaLabel={intl.formatMessage(messages.ariaLabelReplyField)}
|
|
207
211
|
ariaMultiline
|
|
208
212
|
editorState={editorState}
|
|
209
213
|
handleReturn={this.handleReturn}
|
|
@@ -76,6 +76,7 @@ const ReplyForm = (props: Props): JSX.Element => {
|
|
|
76
76
|
className="ba-Popup-field"
|
|
77
77
|
data-testid="ba-Popup-field"
|
|
78
78
|
editorState={editorState}
|
|
79
|
+
intl={intl}
|
|
79
80
|
isDisabled={isPending}
|
|
80
81
|
onChange={handleChange}
|
|
81
82
|
placeholder={intl.formatMessage(messages.fieldPlaceholder)}
|