diff --git a/frontend/public/lsf/lsf.html b/frontend/public/lsf/lsf.html
index 91a6f7f..101ad8c 100644
--- a/frontend/public/lsf/lsf.html
+++ b/frontend/public/lsf/lsf.html
@@ -314,6 +314,17 @@
return;
}
+ if (msg.type === "LS_EXPORT_CHECK") {
+ const raw = exportSelectedAnnotation();
+ const requestId =
+ msg.payload && typeof msg.payload === "object" ? msg.payload.requestId : null;
+ if (requestId) {
+ raw.requestId = requestId;
+ }
+ postToParent("LS_EXPORT_CHECK_RESULT", raw);
+ return;
+ }
+
if (msg.type === "LS_RESET") {
destroyLabelStudio();
postToParent("LS_RESET_DONE", {});
diff --git a/frontend/src/pages/DataAnnotation/Annotate/LabelStudioTextEditor.tsx b/frontend/src/pages/DataAnnotation/Annotate/LabelStudioTextEditor.tsx
index b754d19..1a97e5c 100644
--- a/frontend/src/pages/DataAnnotation/Annotate/LabelStudioTextEditor.tsx
+++ b/frontend/src/pages/DataAnnotation/Annotate/LabelStudioTextEditor.tsx
@@ -68,6 +68,7 @@ type ExportPayload = {
fileId?: string | null;
segmentIndex?: number | string | null;
annotation?: Record;
+ requestId?: string | null;
};
const LSF_IFRAME_SRC = "/lsf/lsf.html";
@@ -91,20 +92,67 @@ const resolvePayloadMessage = (payload: unknown) => {
return undefined;
};
+const isRecord = (value: unknown): value is Record =>
+ !!value && typeof value === "object" && !Array.isArray(value);
+
+const normalizeSnapshotValue = (value: unknown, seen: WeakSet