Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,11 @@ module.exports = function(grunt) {
});
grunt.registerTask('plugins', ["uglify:plugins"]);
grunt.registerTask('modules', ["uglify:modules"]);
grunt.registerTask('buildUI', function (){
grunt.log.writeln('esbuild');
const result = exec("npx esbuild --bundle --sourcemap --format=esm --outfile=ui/index.js ui/index.mjs");
grunt.log.writeln(result);
});
grunt.registerTask('css', 'Generate Tailwind CSS files for usage.', function (file) {
grunt.log.writeln('Tailwind');
//TODO change back to minify
Expand Down
78 changes: 78 additions & 0 deletions modules/annotations/EVENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,84 @@ For global events, it is enough to say ``OSDAnnotations.addHandler(...)``. For c

##### enabled | ``{isEnabled: boolean}``

##### layer-added

##### layer-removed

##### annotation-create | ``{object: fabric.Object}``
Fires when annotation object is created. This does not apply when
``annotation-replace`` is called - in that case, the replacement is
considered as the creation.

##### annotation-before-create | ``{object: fabric.Object, isCancelled: () => boolean, setCancelled: (cancelled: boolean) => void}``
This event is fired prior to inserting any annotation, including promotion (simple helper annotation creation is not affected).
`isCancelled` can be called to check if the deletion was already requested to be cancelled (by another plugin/module for example)
`setCancelled` can be used to request to cancel the deletion

##### annotation-delete | ``{object: fabric.Object}``

##### annotation-before-delete | ``{object: fabric.Object, isCancelled: () => boolean, setCancelled: (cancelled: boolean) => void}``
This event is fired prior to deleting any annotation.
`isCancelled` can be called to check if the deletion was already requested to be cancelled (by another plugin/module for example)
`setCancelled` can be used to request to cancel the deletion

##### annotation-replace | ``{previous: fabric.Object, next: fabric.Object}``
This event is fired when annotation is replaced, e.g. free-form-tool edit. Such edits
in fact replace annotation with a new one, although the annotation identity as perceived
by the user remains the same. This event is called only once per update,
at the end.

##### annotation-before-replace | ``{object: fabric.Object, isCancelled: () => boolean, setCancelled: (cancelled: boolean) => void}``
This event is fired prior to replacing annotation. Same usage as `annotation-before-delete`

##### annotation-replace-doppelganger | ``{previous: fabric.Object, next: fabric.Object}``
This event is fired when annotations are replaced, but only temporarily (e.g. via free form tool).
It can be called several times during one edit action.

##### annotation-before-replace-doppelganger | ``{object: fabric.Object, isCancelled: () => boolean, setCancelled: (cancelled: boolean) => void}``
This event is fired prior to replacing doppelganger annotation. Same usage as `annotation-before-delete`

##### annotation-edit | ``{object: fabric.Object}``
This event is fired when user performs direct annotation editing.

##### annotation-before-edit | ``{object: fabric.Object, isCancelled: () => boolean, setCancelled: (cancelled: boolean) => void}``
This event is fired prior to editing annotation. Same usage as `annotation-before-delete`

##### annotation-selected | ``{object: fabric.Object}``
This event is fired when user selects an annotation.

##### annotation-deselected | ``{object: fabric.Object}``
This event is fired when user deselects an annotation.

##### annotation-set-private | ``{object: fabric.Object}``
This event is fired when the `private` property of an annotation changes.

##### annotation-add-comment | ``{object: fabric.Object, comment: AnnotationComment}``
This event is fired when a comment is added, one by one.
```ts
type AnnotationComment = {
id: string;
author: {
id: string;
name: string;
};
reference: string;
content: string;
replyTo?: string;
createdAt: number;
modifiedAt: number;
removed?: boolean;
}
```

##### annotation-delete-comment | ``{object: fabric.Object, comment: AnnotationComment}``
This event is fired when a comment is deleted, one by one.
See `annotation-add-comment` for `AnnotationComment` definition.

##### annotation-updated-comment | ``{object: fabric.Object, commentId: string, newComment: AnnotationComment | null}``
This event is fired when comment data gets updated and is expected to re-render. `newComment` will be `null` if the comment was deleted.
See `annotation-add-comment` for `AnnotationComment` definition.

##### comments-control-clicked
This event is fired when user clicks the control for comments

Expand Down
Loading