@braze/sanity-plugin-ai-translation 0.2.80 → 0.2.81
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3438,7 +3438,10 @@ ${protectedPhrases.join(", ")}`, buildStyleGuideSection = (globalPrompt, localeP
|
|
|
3438
3438
|
translationMode,
|
|
3439
3439
|
releaseConfig,
|
|
3440
3440
|
documentSource
|
|
3441
|
-
} = useTranslationContext(), client = useClient({ apiVersion: "vX" }), [scanKey, setScanKey] = useState(0), [validationResults, setValidationResults] = useState(/* @__PURE__ */ new Map()), [sourceRefsWithDrafts, setSourceRefsWithDrafts] = useState([]), [isSourceDraftCheckLoading, setIsSourceDraftCheckLoading] = useState(!0), [staleDrafts, setStaleDrafts] = useState([]), [isDraftCheckLoading, setIsDraftCheckLoading] = useState(!0), [draftAction, setDraftAction] = useState("none"), [isDraftActionInProgress, setIsDraftActionInProgress] = useState(!1), [conflictContext, setConflictContext] = useState(null), [isCheckingConflicts, setIsCheckingConflicts] = useState(!0), filteredReferences =
|
|
3441
|
+
} = useTranslationContext(), client = useClient({ apiVersion: "vX" }), [scanKey, setScanKey] = useState(0), [validationResults, setValidationResults] = useState(/* @__PURE__ */ new Map()), [sourceRefsWithDrafts, setSourceRefsWithDrafts] = useState([]), [isSourceDraftCheckLoading, setIsSourceDraftCheckLoading] = useState(!0), [staleDrafts, setStaleDrafts] = useState([]), [isDraftCheckLoading, setIsDraftCheckLoading] = useState(!0), [draftAction, setDraftAction] = useState("none"), [isDraftActionInProgress, setIsDraftActionInProgress] = useState(!1), [conflictContext, setConflictContext] = useState(null), [isCheckingConflicts, setIsCheckingConflicts] = useState(!0), filteredReferences = useMemo(
|
|
3442
|
+
() => references.filter((ref) => selectedReferenceIds.has(ref._id)),
|
|
3443
|
+
[references, selectedReferenceIds]
|
|
3444
|
+
), documentsToValidate = useMemo(() => {
|
|
3442
3445
|
const docs = [
|
|
3443
3446
|
{
|
|
3444
3447
|
_id: document._id,
|
|
@@ -3452,6 +3455,9 @@ ${protectedPhrases.join(", ")}`, buildStyleGuideSection = (globalPrompt, localeP
|
|
|
3452
3455
|
return docs;
|
|
3453
3456
|
}, [document, references, selectedReferenceIds, shouldTranslateReferences]), handleValidationResult = useCallback((id, result) => {
|
|
3454
3457
|
setValidationResults((prev) => {
|
|
3458
|
+
const existing = prev.get(id);
|
|
3459
|
+
if (existing && existing.isValidating === result.isValidating && existing.errors.length === result.errors.length)
|
|
3460
|
+
return prev;
|
|
3455
3461
|
const next = new Map(prev);
|
|
3456
3462
|
return next.set(id, result), next;
|
|
3457
3463
|
});
|