New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

box-annotations

Package Overview
Dependencies
Maintainers
7
Versions
115
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

box-annotations - npm Package Compare versions

Comparing version 0.7.3 to 0.8.0

47

CHANGELOG.md

@@ -1,28 +0,29 @@

<a name="0.7.3"></a>
## 0.7.3 (2017-12-20)
<a name="0.8.0"></a>
# 0.8.0 (2018-01-03)
* Fix: Safety checks if no threads are registered in the draw controller (#88) ([368c092](https://github.com/box/box-annotations/commit/368c092))
* Fix: Uncaught errors in drawingModeController.handleSelection() (#87) ([71926ed](https://github.com/box/box-annotations/commit/71926ed))
* Fix: Clear both highlight canvases when deleting highlights (#96) ([cabcba1](https://github.com/box/box-annotations/commit/cabcba1))
* Fix: Don't deactivate dialog when canceling new annotation (#91) ([788d1de](https://github.com/box/box-annotations/commit/788d1de))
* Fix: Drawing buttons styling (#82) ([400c6ff](https://github.com/box/box-annotations/commit/400c6ff))
* Fix: Ensure drawing dialog is setup on first save (#81) ([9da70ab](https://github.com/box/box-annotations/commit/9da70ab))
* Fix: Extra padding on escaped comment newlines (#95) ([0e62bce](https://github.com/box/box-annotations/commit/0e62bce))
* Fix: More accurate dialog placement for highlights (#83) ([8b768a9](https://github.com/box/box-annotations/commit/8b768a9))
* Fix: Only reset current page highlights on selection change (#79) ([662f2ea](https://github.com/box/box-annotations/commit/662f2ea))
* Fix: Remove fixed position of mobile header (#85) ([6ca5c01](https://github.com/box/box-annotations/commit/6ca5c01)), closes [#85](https://github.com/box/box-annotations/issues/85)
* Fix: Render highlight comments on their own canvas (#93) ([9eeeace](https://github.com/box/box-annotations/commit/9eeeace))
* Fix: Safety checks if no threads are registered in the draw controller (#88) ([3e54845](https://github.com/box/box-annotations/commit/3e54845))
* Fix: set textarea.placeholder when generating dialogs (#74) ([496a545](https://github.com/box/box-annotations/commit/496a545))
* Fix: Show the appropriate buttons in mobile create highlight dialog (#75) ([8114d0c](https://github.com/box/box-annotations/commit/8114d0c))
* Fix: Uncaught errors in drawingModeController.handleSelection() (#87) ([e0240f6](https://github.com/box/box-annotations/commit/e0240f6))
* Chore: Enforce Lato font for annotation dialogs (#76) ([55b25b3](https://github.com/box/box-annotations/commit/55b25b3))
* Chore: Move threadmap entirely to mode controllers (#71) ([00989ac](https://github.com/box/box-annotations/commit/00989ac))
* Chore: Moving rotateAnnotations() into ImageAnnotator (#94) ([b9dd7b1](https://github.com/box/box-annotations/commit/b9dd7b1))
* Chore: Now respect newline and symbols (#73) ([b7f52d2](https://github.com/box/box-annotations/commit/b7f52d2))
* Update: README.md & variable names in BoxAnnotations.js (#89) ([ab62d18](https://github.com/box/box-annotations/commit/ab62d18))
* Update: THIRD_PARTY_LICENSES (#90) ([4b0d97f](https://github.com/box/box-annotations/commit/4b0d97f))
* Update ISSUE_TEMPLATE.md ([8806f91](https://github.com/box/box-annotations/commit/8806f91))
* Update package.json ([418d368](https://github.com/box/box-annotations/commit/418d368))
* Update package.json ([5ffb68d](https://github.com/box/box-annotations/commit/5ffb68d))
<a name="0.7.2"></a>
## 0.7.2 (2017-12-20)
* Fix: Remove fixed position of mobile header (#85) ([eb02199](https://github.com/box/box-annotations/commit/eb02199)), closes [#85](https://github.com/box/box-annotations/issues/85)
<a name="0.7.1"></a>
## 0.7.1 (2017-12-19)
* Fix: Drawing buttons styling (#82) ([bda13b8](https://github.com/box/box-annotations/commit/bda13b8))
* Fix: Ensure drawing dialog is setup on first save (#81) ([16d7c8d](https://github.com/box/box-annotations/commit/16d7c8d))
* Fix: set textarea.placeholder when generating dialogs (#74) ([5f35ac6](https://github.com/box/box-annotations/commit/5f35ac6))
* Fix: Show the appropriate buttons in mobile create highlight dialog (#75) ([05dba16](https://github.com/box/box-annotations/commit/05dba16))
* Chore: Enforce Lato font for annotation dialogs (#76) ([1e92025](https://github.com/box/box-annotations/commit/1e92025))
* Chore: Now respect newline and symbols (#73) ([41aad68](https://github.com/box/box-annotations/commit/41aad68))
<a name="0.7.0"></a>

@@ -29,0 +30,0 @@ # 0.7.0 (2017-12-12)

{
"name": "box-annotations",
"version": "0.7.3",
"version": "0.8.0",
"description": "Box Annotations",

@@ -102,3 +102,3 @@ "author": "Box (https://www.box.com/)",

"ci": "yarn run clean && yarn run lint && yarn run test",
"clean": "rm -rf dist && rm -rf lib && rm -rf reports/coverage && rm -rf src/i18n/json",
"clean": "rm -rf lib && rm -rf reports/coverage",
"github-release": "./node_modules/.bin/conventional-github-releaser",

@@ -105,0 +105,0 @@ "changelog": "./node_modules/.bin/conventional-changelog -i CHANGELOG.md --same-file",

[![Project Status](https://img.shields.io/badge/status-active-brightgreen.svg?style=flat-square)](http://opensource.box.com/badges/)
[![Styled With Prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
[![build status](https://img.shields.io/travis/box/box-content-preview/master.svg?style=flat-square)](https://travis-ci.org/box/box-annotations)
[![version](https://img.shields.io/badge/version-v0.7.3-blue.svg?style=flat-square)](https://github.com/box/box-annotations)
[![version](https://img.shields.io/badge/version-v0.8.0-blue.svg?style=flat-square)](https://github.com/box/box-annotations)
[![npm version](https://img.shields.io/npm/v/box-ui-elements.svg?style=flat-square)](https://www.npmjs.com/package/box-ui-elements)

@@ -29,16 +29,26 @@

Initialization
--------------
### Instantiating Box Annotations inside Box Content Preview with default options
```javascript
var preview = new Box.Preview();
preview.show('FILE_ID', 'ACCESS_TOKEN', {
container: '.preview-container',
showAnnotations: true
});
```
Where the default enabled types are `point`, `highlight`, and `highlight-comment` for the Document Annotator and `point` for the Image Annotator.
### Passing an instance of Box Annotations into Box Content Preview
```javascript
import BoxAnnotations from 'box-annotations';
const boxAnnotations = new BoxAnnotations();
const annotatorConf = boxAnnotations.determineAnnotator(options, viewerConfig, disabledAnnotationTypes);
/* global BoxAnnotations */
const boxAnnotations = new BoxAnnotations(viewerOptions);
// Construct and init annotator
const annotator = new annotatorConf.CONSTRUCTOR(options);
annotator.init(scale);
var preview = new Box.Preview();
preview.show(FILE_ID, ACCESS_TOKEN, {
container: '.preview-container',
boxAnnotations
});
```
Where `viewerConfig` is an optional object of viewer-specific annotations options and `disabledAnnotationTypes` is an optional string array of valid annotation types to disable. See [Enabling/Disabling Annotations and Annotation Types](#enablingdisabling-annotations-and-annotation-types) below for more details on viewer specific annotation configurations.
Where `viewerOptions` is an optional object of viewer-specific annotator options and `disabledAnnotationTypes` is an optional string array of valid annotation types to disable. See [Enabling/Disabling Annotations and Annotation Types](#enablingdisabling-annotations-and-annotation-types) below for more details on viewer-specific annotation configurations.

@@ -118,10 +128,11 @@ Parameters & Options

| User wants basic preview functionality + ability to edit own annotations| base_preview + annotation_edit |
| User wants basic preview functionality + ability to edit own annotations + ability to select text on documents| base_preview + annotation_edit + item_download |
| User wants basic preview functionality + ability to edit own annotations + ability to highlight text| base_preview + annotation_edit + item_download |
| User wants basic preview functionality + ability to view all annotations + ability to edit own annotations| base_preview + annotation_view_all + annotation_edit |
| User wants basic preview functionality + ability to view only their own annotations| base_preview + annotation_view_self |
**Note:** If the access token is not scoped to include `item_download`, the users will not be able to create highlight annotations even if `highlight` or `highlight-comment` is specified as an enabled annotation type.
Enabling/Disabling Annotations and Annotation Types
------------
Annotation types can be selectively disabled through preview options. Viewer options override global showAnnotations value, for that viewer. See [Box Content Preview](https://github.com/box/box-content-preview) for more details on how to set up the Preview instances that are used with Box Annotations here.
Annotation types can be selectively disabled through preview options. The default enabled types are `point`, `highlight`, and `highlight-comment` for the Document Annotator and `point` for the Image Annotator. Viewer options override global showAnnotations value, for that viewer. See [Box Content Preview](https://github.com/box/box-content-preview) for more details on how to set up the Preview instances that are used with Box Annotations here.
```

@@ -133,4 +144,5 @@ // Turn on/off annotations for all viewers

```
Combined with the following:
Combined with one of the following:
```
// Enable all default annotation types for the specified viewer
preview.show(..., {

@@ -141,2 +153,12 @@ viewers: {

enabled: Boolean, // Enables/disables if set. Respects "showAnnotations" if empty
}
}
}
});
// Enable only certain annotation types are enabled for the specified viewer
preview.show(..., {
viewers: {
VIEWER_NAME: {
annotations: {
enabledTypes: String[] | null // List of annotation types to enable for this viewer. If empty, will respect default types for that annotator.

@@ -148,6 +170,31 @@ }

```
If an instance of BoxAnnotations is being passed into Box Content Preview, annotations options can be specified by viewer.
```
/* global BoxAnnotations */
// Turn on/off all annotation types for each viewer
new BoxAnnotations({
VIEWER_NAME: {
enabled: Boolean
}
});
### Example
Enable all annotations, turn off for Image Viewers, and enable only point annotations on Document viewer:
// Enable/disable the default annotation types for each viewer
new BoxAnnotations({
VIEWER_NAME: {
enabled: Boolean, // Enables/disables if set. Respects "showAnnotations" if empty
}
});
// Enable/disable annotation types for each viewer
new BoxAnnotations({
VIEWER_NAME: {
enabledTypes: String[] | null // List of annotation types to enable for this viewer. If empty, will respect default types for that annotator.
}
});
```
### Examples
Enable all annotations, turn off for Image Viewer, and enable only point annotations on Document Viewer:
```
// Pass options into Preview
preview.show(fileId, token, {

@@ -163,3 +210,2 @@ showAnnotations: true,

annotations: {
enabled: true,
enabledTypes: ['point']

@@ -171,3 +217,20 @@ }

```
Enable the default annotation types for the Document and Image viewers, disable all annotations off for MultiImage Viewer, and enable only highlight comment and drawing annotations on Presentation Viewer:
```
// Instantiate BoxAnnotations with options
const boxAnnotations = new BoxAnnotations({
MultiImage: {
enabled: false
},
Presentation: {
enabledTypes: ['highlight-comment', 'draw']
}
});
preview.show(FILE_ID, ACCESS_TOKEN, {
container: '.preview-container',
boxAnnotations
});
```
Annotators

@@ -174,0 +237,0 @@ -------

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc