UI_AnnotationSlots typedef
UI_AnnotationSlots = AnonymousType_2032702
Annotation-related slot configuration - UI surfaces for viewing, selecting, and managing annotations.
| Slot | Trigger | Description |
|---|---|---|
actions |
Annotation selected | Action buttons (delete, duplicate, custom) for the selected annotation. Replaces annotationTooltipCallback. |
status |
Hover on locked/read-only annotation | Status indicator showing "Locked" or "Read only" flags. |
textMarkupInline |
Text selected (with markup tools) | Inline toolbar for creating highlights, underlines, strikeouts. |
deleteConfirm |
Delete annotation triggered | Confirmation dialog before deleting an annotation. |
link |
Link annotation interaction | Editor for link annotation URL/action. |
note |
Note annotation expanded | Popup showing the note's text content (not the canvas icon). |
Example:
Custom annotation actions with a delete button:
```ts
NutrientViewer.load({
ui: {
annotations: {
actions: (getInstance, id) => ({
render: () => {
const bar = document.createElement("div");
const deleteBtn = document.createElement("button");
deleteBtn.textContent = "Delete";
deleteBtn.onclick = async () => {
const instance = getInstance();
const selected = instance?.getSelectedAnnotations();
if (selected?.size) await instance?.delete(selected.first().id);
};
bar.appendChild(deleteBtn);
return bar;
},
}),
},
},
});
Example:
```ts
Skip the delete confirmation and delete immediately:
```ts
NutrientViewer.load({
ui: {
annotations: {
deleteConfirm: { autoResolve: "accept" },
},
},
});
Implementation
typedef UI_AnnotationSlots = AnonymousType_2032702;