{
const { parent } = item;
const { relationMode } = item.annotation;
const editable = parent.isEditable && !item.isReadOnly();
- const deleteable = parent.isDeleteable && !item.isReadOnly();
+ const deletable = parent.isDeletable && !item.isReadOnly();
if (relationMode) {
classes.push(styles.relation);
@@ -114,7 +114,7 @@ const HtxTextAreaRegionView = ({ item, onFocus }) => {
{
if (self !== p) p.setGroundTruth(false, false);
@@ -445,7 +445,7 @@ const _Annotation = types
self.ground_truth = value;
- if (ivokeEvent) {
+ if (invokeEvent) {
getEnv(self).events.invoke("groundTruth", self.store, self, value);
}
},
@@ -697,7 +697,7 @@ const _Annotation = types
if (force) self.unselectAll();
self.names.forEach((tag) => tag.needsUpdate?.());
- self.updateAppearenceFromState();
+ self.updateAppearanceFromState();
const areas = Array.from(self.areas.values());
// It should find just one unfinished region, but just in case we work with array
const filtered = areas.filter((area) => area.isDrawing);
@@ -705,8 +705,8 @@ const _Annotation = types
// Update UI to reflect the state of an unfinished region in case if it exists
if (filtered.length) self.regionStore.selection._updateResultsFromRegions(filtered);
},
- updateAppearenceFromState() {
- self.areas.forEach((area) => area.updateAppearenceFromState?.());
+ updateAppearanceFromState() {
+ self.areas.forEach((area) => area.updateAppearanceFromState?.());
},
setInitialValues() {
@@ -970,7 +970,7 @@ const _Annotation = types
Hotkey.setScope(enableHotkeys ? Hotkey.DEFAULT_SCOPE : "__none__");
},
- createResult(areaValue, resultValue, control, object, skipAfrerCreate = false, additionalStates = []) {
+ createResult(areaValue, resultValue, control, object, skipAfterCreate = false, additionalStates = []) {
// Without correct validation object may be null, but it it shouldn't be so in results - so we should find any
if (!object && control.type === "textarea") {
object = self.objects[0];
@@ -1014,10 +1014,10 @@ const _Annotation = types
// This is added mostly for the reason of updating indexes in labels
// for the elements (like highlights in text) that won't be dynamically changed
// but are dependent on the whole region list values
- self.updateAppearenceFromState();
+ self.updateAppearanceFromState();
if (!area.classification) getEnv(self).events.invoke("entityCreate", area);
- if (!skipAfrerCreate) self.afterCreateResult(area, control);
+ if (!skipAfterCreate) self.afterCreateResult(area, control);
return area;
},
diff --git a/web/libs/editor/src/stores/RegionStore.js b/web/libs/editor/src/stores/RegionStore.js
index fcda1c21531c..29018d90f70a 100644
--- a/web/libs/editor/src/stores/RegionStore.js
+++ b/web/libs/editor/src/stores/RegionStore.js
@@ -459,7 +459,7 @@ export default types
return Array.from(self.selection.selected.values()).map((reg) => reg.id);
},
- get persistantView() {
+ get persistentView() {
return window.localStorage.getItem(localStorageKeys.view) ?? self.view;
},
};
@@ -494,7 +494,7 @@ export default types
window.localStorage.setItem(localStorageKeys.sortDirection, self.sortOrder);
self.initHotkeys();
- self.annotation.updateAppearenceFromState();
+ self.annotation.updateAppearanceFromState();
},
setGrouping(group) {
@@ -517,7 +517,7 @@ export default types
else if (!region.hidden) region.toggleFiltered();
});
}
- self.annotation.updateAppearenceFromState();
+ self.annotation.updateAppearanceFromState();
},
/**
diff --git a/web/libs/editor/src/stores/SettingsStore.js b/web/libs/editor/src/stores/SettingsStore.js
index 69d9caebabd6..4d9595cdcc95 100644
--- a/web/libs/editor/src/stores/SettingsStore.js
+++ b/web/libs/editor/src/stores/SettingsStore.js
@@ -143,7 +143,7 @@ const SettingsModel = types
// Update appearance of all regions to reflect the new setting
const annotation = getRoot(self).annotationStore.selected;
if (annotation) {
- annotation.updateAppearenceFromState();
+ annotation.updateAppearanceFromState();
}
},
diff --git a/web/libs/editor/src/stores/TaskStore.js b/web/libs/editor/src/stores/TaskStore.js
index 0a524cd880d4..8d97af8a1a44 100644
--- a/web/libs/editor/src/stores/TaskStore.js
+++ b/web/libs/editor/src/stores/TaskStore.js
@@ -22,7 +22,7 @@ const TaskStore = types
agreement: types.maybeNull(types.number),
/**
* Data of task, may contain an object but in App Store will be transformed into string
- * MST doesn't support processing of dynamic objects with unkown keys value
+ * MST doesn't support processing of dynamic objects with unknown keys value
*/
data: types.maybeNull(types.string),
queue: types.optional(types.maybeNull(types.string), null),
diff --git a/web/libs/editor/src/tags/control/Label.jsx b/web/libs/editor/src/tags/control/Label.jsx
index f549933c7867..fb820a3d4f67 100644
--- a/web/libs/editor/src/tags/control/Label.jsx
+++ b/web/libs/editor/src/tags/control/Label.jsx
@@ -131,7 +131,7 @@ const Model = types
if (self.annotation.selectedDrawingRegions.length > 0) {
/* here we are validating if we are drawing a new region or if region is already closed
the way that new drawing region and a finished regions work is similar, but new drawing region
- doesn't visualy select the polygons when you are drawing.
+ doesn't visually select the polygons when you are drawing.
*/
sameObjectSelectedRegions = self.annotation.selectedDrawingRegions.filter((region) => {
return region.parent?.name === self.parent?.toname;
diff --git a/web/libs/editor/src/tags/control/TextArea/TextArea.jsx b/web/libs/editor/src/tags/control/TextArea/TextArea.jsx
index c5a0e2c008aa..415f77c43ce3 100644
--- a/web/libs/editor/src/tags/control/TextArea/TextArea.jsx
+++ b/web/libs/editor/src/tags/control/TextArea/TextArea.jsx
@@ -109,7 +109,7 @@ const Model = types
return self.editable && self.annotation.editable;
},
- get isDeleteable() {
+ get isDeletable() {
return !self.isReadOnly();
},
diff --git a/web/libs/editor/src/tags/control/TextArea/TextAreaRegionView.jsx b/web/libs/editor/src/tags/control/TextArea/TextAreaRegionView.jsx
index 3d0abcde38cf..9946f70ad8e9 100644
--- a/web/libs/editor/src/tags/control/TextArea/TextAreaRegionView.jsx
+++ b/web/libs/editor/src/tags/control/TextArea/TextAreaRegionView.jsx
@@ -107,7 +107,7 @@ const HtxTextAreaResult = observer(({ item, control, firstResultInputRef, onFocu
const deleteHandler = useCallback(
(idx) => {
- if (!item.from_name.isDeleteable) return;
+ if (!item.from_name.isDeletable) return;
const newValue = value.toJSON();
newValue.splice(idx, 1);
@@ -130,7 +130,7 @@ const HtxTextAreaResult = observer(({ item, control, firstResultInputRef, onFocu
onFocus={onFocus}
collapsed={collapsed}
validate={item.from_name.validateText}
- canDelete={item.from_name.isDeleteable && canDelete}
+ canDelete={item.from_name.isDeletable && canDelete}
/>
);
});
diff --git a/web/libs/editor/src/tags/object/Audio/model.js b/web/libs/editor/src/tags/object/Audio/model.js
index f7c10f6db8e3..e1cac632d5fe 100644
--- a/web/libs/editor/src/tags/object/Audio/model.js
+++ b/web/libs/editor/src/tags/object/Audio/model.js
@@ -321,7 +321,7 @@ export const AudioModel = types.compose(
if (!self._ws?.loaded || !isDefined(time)) return;
try {
- // setCurrentTime some times can take up to 76ms and it is syncronous
+ // setCurrentTime some times can take up to 76ms and it is synchronous
self._ws.setCurrentTime(time, true);
// syncCursor provides sync drawing which can cost up to 10ms which is too much for syncing playback
setTimeout(() => {
diff --git a/web/libs/editor/src/tags/object/Image/Image.js b/web/libs/editor/src/tags/object/Image/Image.js
index 41c20a59a499..028fd6b17b65 100644
--- a/web/libs/editor/src/tags/object/Image/Image.js
+++ b/web/libs/editor/src/tags/object/Image/Image.js
@@ -381,10 +381,10 @@ const Model = types
imageDimension.item_index = index;
}
- // We're using raw region result instead of calulated one when
+ // We're using raw region result instead of calculated one when
// the image data is not available (image is not yet loaded)
// As the serialization also happens during region creation,
- // we have to forsee this scenario and avoid using raw result
+ // we have to foresee this scenario and avoid using raw result
// as it can only be present for already created (submitter) regions
const useRawResult = !currentImageEntity.imageLoaded && isDefined(region._rawResult);
diff --git a/web/libs/editor/src/tags/object/RichText/model.js b/web/libs/editor/src/tags/object/RichText/model.js
index 1cd1bba5c9cf..ba717b35c171 100644
--- a/web/libs/editor/src/tags/object/RichText/model.js
+++ b/web/libs/editor/src/tags/object/RichText/model.js
@@ -21,7 +21,7 @@ import ObjectBase from "../Base";
import DomManager from "./domManager";
const WARNING_MESSAGES = {
- dataTypeMistmatch: () => "Do not put text directly in task data if you use valueType=url.",
+ dataTypeMismatch: () => "Do not put text directly in task data if you use valueType=url.",
badURL: (url) => `URL (${escapeHtml(url)}) is not valid.`,
secureMode: () => 'In SECURE MODE valueType is set to "url" by default.',
loadingError: (url, error) => `Loading URL (${url}) unsuccessful: ${error}`,
@@ -40,7 +40,7 @@ const WARNING_MESSAGES = {
* @name Text
* @param {string} name - name of the element
* @param {string} value - value of the element
- * @param {url|text} [valueType=url|text] – source of the data, check (Data retrieval)[https://labelstud.io/guide/tasks.html] page for more inforamtion
+ * @param {url|text} [valueType=url|text] – source of the data, check (Data retrieval)[https://labelstud.io/guide/tasks.html] page for more information
* @param {boolean} [inline=false] - whether to embed html directly to LS or use iframe (only HyperText)
* @param {boolean} [saveTextResult=true] – whether or not to save selected text to the serialized data
* @param {boolean} [selectionEnabled=true] - enable or disable selection
@@ -198,7 +198,7 @@ const Model = types
const url = value;
if (!isValidObjectURL(url, true)) {
- const message = [WARNING_MESSAGES.badURL(url), WARNING_MESSAGES.dataTypeMistmatch()];
+ const message = [WARNING_MESSAGES.badURL(url), WARNING_MESSAGES.dataTypeMismatch()];
if (window.LS_SECURE_MODE) message.unshift(WARNING_MESSAGES.secureMode());
@@ -256,7 +256,7 @@ const Model = types
// security measure, if valuetype is set to url then LS
// doesn't save the text into the result, otherwise it does
- // can be aslo directly configured
+ // can be also directly configured
if (self.savetextresult === "none") {
if (self.valuetype === "url") self.savetextresult = "no";
else if (self.valuetype === "text") self.savetextresult = "yes";
diff --git a/web/libs/editor/src/tags/object/RichText/view.jsx b/web/libs/editor/src/tags/object/RichText/view.jsx
index efdd945d2252..05d8854598de 100644
--- a/web/libs/editor/src/tags/object/RichText/view.jsx
+++ b/web/libs/editor/src/tags/object/RichText/view.jsx
@@ -159,7 +159,7 @@ class RichTextPieceView extends Component {
* @param {Document} _doc is not used in this implementation
* @param {HTMLElement} region to wrap selection around
*/
- _hightlightRegion = (_doc, region) => {
+ _highlightRegion = (_doc, region) => {
const span = region._spans[0];
const lastSpan = region._spans.at(-1);
const selection = window.getSelection();
@@ -257,7 +257,7 @@ class RichTextPieceView extends Component {
_onMouseDown = (ev) => {
if (this.props.item.canResizeSpans) {
- // we definitelly not in a process of adjusting any other region anymore, so reset flags
+ // we definitely not in a process of adjusting any other region anymore, so reset flags
this._resetDragParams();
this._removeSelectionStyle();
// but might start to adjust this one
@@ -277,7 +277,7 @@ class RichTextPieceView extends Component {
const tag = item.mountNodeRef.current;
const doc = tag?.contentDocument ?? tag?.ownerDocument ?? tag;
this.currentSelection = window.getSelection();
- this._hightlightRegion(doc, this.draggableRegion);
+ this._highlightRegion(doc, this.draggableRegion);
// attach global event for mouseup to always catch the end of dragging, even outside of the tag;
// will be called after mouseup on the text tag
document.addEventListener("mouseup", this._onMouseUpGlobal, { once: true });
@@ -514,7 +514,7 @@ class RichTextPieceView extends Component {
style.textContent = "body a[href] { pointer-events: all; }";
doc.head.appendChild(style);
- // // @todo make links selectable; dragstart supressing doesn't help — they are still draggable
+ // // @todo make links selectable; dragstart suppressing doesn't help — they are still draggable
// body.addEventListener("dragstart", e => {
// e.stopPropagation();
// e.preventDefault();
diff --git a/web/libs/editor/src/tags/object/TimeSeries.jsx b/web/libs/editor/src/tags/object/TimeSeries.jsx
index d42e7931e68e..4490917a6232 100644
--- a/web/libs/editor/src/tags/object/TimeSeries.jsx
+++ b/web/libs/editor/src/tags/object/TimeSeries.jsx
@@ -1196,7 +1196,7 @@ const Overview = observer(({ item, data, series }) => {
// so we swap prev as well
[prev[0], prev[1]] = [prev[1], prev[0]];
} else {
- // This may happen at begining when range was not enough wide yet
+ // This may happen at beginning when range was not enough wide yet
if (x1 === startX) {
x2 = Math.min(width, x1 + MIN_OVERVIEW);
x1 = Math.max(0, x2 - MIN_OVERVIEW);
diff --git a/web/libs/editor/src/tags/object/Video/VideoRegions.jsx b/web/libs/editor/src/tags/object/Video/VideoRegions.jsx
index 37def9ae4b91..4a357f4e786d 100644
--- a/web/libs/editor/src/tags/object/Video/VideoRegions.jsx
+++ b/web/libs/editor/src/tags/object/Video/VideoRegions.jsx
@@ -45,19 +45,19 @@ const VideoRegionsPure = ({
// so we observe all the sequences to rerender transformer
regions.map((reg) => fixMobxObserve(reg.sequence));
- const workinAreaCoordinates = useMemo(() => {
+ const workingAreaCoordinates = useMemo(() => {
const resultWidth = videoDimensions.width * zoom;
const resultHeight = videoDimensions.height * zoom;
const overshotX = Math.abs(pan.x) >= Math.abs((width - resultWidth) / 2);
const overshotY = Math.abs(pan.y) >= Math.abs((height - resultHeight) / 2);
const panXDirection = pan.x > 0 ? 1 : -1;
const panYDirection = pan.y > 0 ? 1 : -1;
- const overshotXAmmount = (Math.abs(pan.x) - Math.abs((width - resultWidth) / 2)) * panXDirection;
- const overshotYAmmount = (Math.abs(pan.y) - Math.abs((height - resultHeight) / 2)) * panYDirection;
- const edgeZoomOffestX = overshotX ? overshotXAmmount : 0;
- const edgeZoomOffestY = overshotY ? overshotYAmmount : 0;
- const offsetLeft = (width - resultWidth) / 2 + pan.x - edgeZoomOffestX;
- const offsetTop = (height - resultHeight) / 2 + pan.y - edgeZoomOffestY;
+ const overshotXAmount = (Math.abs(pan.x) - Math.abs((width - resultWidth) / 2)) * panXDirection;
+ const overshotYAmount = (Math.abs(pan.y) - Math.abs((height - resultHeight) / 2)) * panYDirection;
+ const edgeZoomOffsetX = overshotX ? overshotXAmount : 0;
+ const edgeZoomOffsetY = overshotY ? overshotYAmount : 0;
+ const offsetLeft = (width - resultWidth) / 2 + pan.x - edgeZoomOffsetX;
+ const offsetTop = (height - resultHeight) / 2 + pan.y - edgeZoomOffsetY;
return {
width: resultWidth,
@@ -72,28 +72,28 @@ const VideoRegionsPure = ({
const layerProps = useMemo(
() => ({
- width: workinAreaCoordinates.width,
- height: workinAreaCoordinates.height,
+ width: workingAreaCoordinates.width,
+ height: workingAreaCoordinates.height,
scaleX: zoom,
scaleY: zoom,
position: {
- x: workinAreaCoordinates.x,
- y: workinAreaCoordinates.y,
+ x: workingAreaCoordinates.x,
+ y: workingAreaCoordinates.y,
},
}),
- [workinAreaCoordinates, zoom],
+ [workingAreaCoordinates, zoom],
);
const normalizeMouseOffsets = useCallback(
(x, y) => {
- const { x: offsetLeft, y: offsetTop } = workinAreaCoordinates;
+ const { x: offsetLeft, y: offsetTop } = workingAreaCoordinates;
return {
x: (x - offsetLeft) / zoom,
y: (y - offsetTop) / zoom,
};
},
- [workinAreaCoordinates, zoom],
+ [workingAreaCoordinates, zoom],
);
useEffect(() => {
@@ -119,20 +119,20 @@ const VideoRegionsPure = ({
item.addVideoRegion(fixedRegion);
setNewRegion(null);
}
- }, [isDrawing, workinAreaCoordinates, videoDimensions]);
+ }, [isDrawing, workingAreaCoordinates, videoDimensions]);
const inBounds = (x, y) => {
if (allowRegionsOutsideWorkingArea) return true;
- return x > 0 && y > 0 && x < workinAreaCoordinates.realWidth && y < workinAreaCoordinates.realHeight;
+ return x > 0 && y > 0 && x < workingAreaCoordinates.realWidth && y < workingAreaCoordinates.realHeight;
};
const limitCoordinates = ({ x, y }) => {
if (allowRegionsOutsideWorkingArea) return { x, y };
return {
- x: clamp(x, 0, workinAreaCoordinates.realWidth),
- y: clamp(y, 0, workinAreaCoordinates.realHeight),
+ x: clamp(x, 0, workingAreaCoordinates.realWidth),
+ y: clamp(y, 0, workingAreaCoordinates.realHeight),
};
};
@@ -211,8 +211,8 @@ const VideoRegionsPure = ({
layerProps={layerProps}
locked={locked}
isDrawing={isDrawing}
- workinAreaCoordinates={workinAreaCoordinates}
- onDragMove={createOnDragMoveHandler(workinAreaCoordinates, !allowRegionsOutsideWorkingArea)}
+ workingAreaCoordinates={workingAreaCoordinates}
+ onDragMove={createOnDragMoveHandler(workingAreaCoordinates, !allowRegionsOutsideWorkingArea)}
stageRef={stageRef}
/>
@@ -228,8 +228,8 @@ const VideoRegionsPure = ({
keepRatio={false}
ignoreStroke
flipEnabled={false}
- boundBoxFunc={createBoundingBoxGetter(workinAreaCoordinates, !allowRegionsOutsideWorkingArea)}
- onDragMove={createOnDragMoveHandler(workinAreaCoordinates, !allowRegionsOutsideWorkingArea)}
+ boundBoxFunc={createBoundingBoxGetter(workingAreaCoordinates, !allowRegionsOutsideWorkingArea)}
+ onDragMove={createOnDragMoveHandler(workingAreaCoordinates, !allowRegionsOutsideWorkingArea)}
/>
) : null}
@@ -237,7 +237,7 @@ const VideoRegionsPure = ({
);
};
-const RegionsLayer = observer(({ regions, item, locked, isDrawing, workinAreaCoordinates, stageRef, onDragMove }) => {
+const RegionsLayer = observer(({ regions, item, locked, isDrawing, workingAreaCoordinates, stageRef, onDragMove }) => {
return (
<>
{regions.map((reg) => (
@@ -246,7 +246,7 @@ const RegionsLayer = observer(({ regions, item, locked, isDrawing, workinAreaCoo
key={reg.id}
reg={reg}
frame={item.frame}
- workingArea={workinAreaCoordinates}
+ workingArea={workingAreaCoordinates}
draggable={!reg.isReadOnly() && !isDrawing && !locked}
selected={reg.selected || reg.inSelection}
listening={!reg.locked && !reg.hidden}
diff --git a/web/libs/editor/tests/e2e/fragments/AtImageView.js b/web/libs/editor/tests/e2e/fragments/AtImageView.js
index 90608aabc175..a8ea8fd62fa9 100644
--- a/web/libs/editor/tests/e2e/fragments/AtImageView.js
+++ b/web/libs/editor/tests/e2e/fragments/AtImageView.js
@@ -196,7 +196,7 @@ module.exports = {
* The coordinates are relative to the window
* @returns {Promise<{x: number, y: number, width: number, height: number}>}
*/
- async getRegionAbsoultePosition(regionId, includeStage = true) {
+ async getRegionAbsolutePosition(regionId, includeStage = true) {
const [shapeId, coords] = await I.executeScript((regionId) => {
const annotation = Htx.annotationStore.selected;
const region = annotation.regions.find((r) => r.cleanId === regionId);
@@ -213,7 +213,7 @@ module.exports = {
width: coords.right - coords.left,
height: coords.bottom - coords.top,
}
- : await I.executeScript(Helpers.getRegionAbsoultePosition, shapeId);
+ : await I.executeScript(Helpers.getRegionAbsolutePosition, shapeId);
return includeStage
? {
@@ -315,7 +315,7 @@ module.exports = {
assert.notEqual(regionId, undefined, "Region not found");
- const position = await this.getRegionAbsoultePosition(regionId, false);
+ const position = await this.getRegionAbsolutePosition(regionId, false);
I.say("Clicking on a region at", `${position.x} ${position.y}`);
@@ -327,7 +327,7 @@ module.exports = {
assert.notEqual(region, undefined, "Region not found");
- const position = await this.getRegionAbsoultePosition(region.id);
+ const position = await this.getRegionAbsolutePosition(region.id);
I.say(`Drag region by ${shiftX} ${shiftY}`);
await I.dragAndDropMouse(position, {
diff --git a/web/libs/editor/tests/e2e/tests/helpers.js b/web/libs/editor/tests/e2e/tests/helpers.js
index 07e2fc41b734..b38df94ced13 100644
--- a/web/libs/editor/tests/e2e/tests/helpers.js
+++ b/web/libs/editor/tests/e2e/tests/helpers.js
@@ -706,7 +706,7 @@ const isRotaterExist = async () => {
return !!rotaters.length;
};
-const getRegionAbsoultePosition = async (shapeId) => {
+const getRegionAbsolutePosition = async (shapeId) => {
const stage = window.Konva.stages[0];
const region = stage.findOne((shape) => String(shape._id) === String(shapeId));
@@ -982,7 +982,7 @@ module.exports = {
getCanvasSize,
getImageSize,
getImageFrameSize,
- getRegionAbsoultePosition,
+ getRegionAbsolutePosition,
setKonvaLayersOpacity,
setZoom,
getZoomProps,