@sanity/assist

6.2.16.2.2
dist/index.js
~dist/index.jsModified
+7−7
Index: package/dist/index.js
===================================================================
--- package/dist/index.js
+++ package/dist/index.js
@@ -1856,9 +1856,9 @@
 function isFeatureOnboardingDismissed(featureKey) {
 	return typeof localStorage > "u" ? !1 : localStorage.getItem(featureKey) === "true";
 }
 function dismissFeatureOnboarding(featureKey) {
-	typeof localStorage > "u" || localStorage.setItem(featureKey, "true");
+	typeof localStorage < "u" && localStorage.setItem(featureKey, "true");
 }
 function useOnboardingFeature(featureKey) {
 	let $ = c(7), t0;
 	$[0] === featureKey ? t0 = $[1] : (t0 = () => !isFeatureOnboardingDismissed(featureKey), $[0] = featureKey, $[1] = t0);
@@ -2836,9 +2836,9 @@
 		return [];
 	}
 }
 function setPreferredToFieldLanguages(fromLanguageId, languageIds) {
-	typeof localStorage > "u" || localStorage.setItem(`${toFieldLanguagesKeyPrefix}${fromLanguageId}`, JSON.stringify(languageIds));
+	typeof localStorage < "u" && localStorage.setItem(`${toFieldLanguagesKeyPrefix}${fromLanguageId}`, JSON.stringify(languageIds));
 }
 function whatwgRNG(length = 16) {
 	let rnds8 = new Uint8Array(length);
 	return crypto.getRandomValues(rnds8), rnds8;
@@ -3252,16 +3252,16 @@
 	});
 }
 function serializeInlineOf(blockSchemaType, schema, options) {
 	let childrenType = blockSchemaType.fields.find((f) => f.name === "children")?.type;
-	if (!(!childrenType || !isArraySchemaType(childrenType))) return arrayOf({
+	if (childrenType && isArraySchemaType(childrenType)) return arrayOf({
 		...childrenType,
 		of: childrenType.of.filter((t) => !isType(t, "span"))
 	}, schema, options);
 }
 function serializeAnnotations(blockSchemaType, schema, options) {
 	let marksType = blockSchemaType.fields.find((f) => f.name === "markDefs")?.type;
-	if (!(!marksType || !isArraySchemaType(marksType))) return arrayOf(marksType, schema, options);
+	if (marksType && isArraySchemaType(marksType)) return arrayOf(marksType, schema, options);
 }
 function arrayOf(arrayType, schema, options) {
 	return arrayType.of.filter((type) => isAssistSupported(type)).map((t) => serializeMember(schema, t, t.name, options));
 }
@@ -3562,9 +3562,9 @@
 			readOnly,
 			maxDepth
 		]);
 		return useMemo(() => {
-			if (!(!isActive || !status?.initialized)) return node$3({
+			if (isActive && status?.initialized) return node$3({
 				type: "group",
 				icon: () => null,
 				title: "Translation",
 				children: [translateDocumentAction, translateFieldsAction].filter((c) => !!c),
@@ -3690,9 +3690,9 @@
 			isSyncing: documentIsSyncing,
 			task: generateCaption
 		}), isActive = !!imageContext && pathKey === imageContext?.imageDescriptionPath;
 		return useMemo(() => {
-			if (!(!isActive || !imageContext)) return node$2({
+			if (isActive && imageContext) return node$2({
 				type: "action",
 				icon: loading ? () => /* @__PURE__ */ jsx(Box, {
 					style: { height: 17 },
 					children: /* @__PURE__ */ jsx(Spinner, { style: { transform: "translateY(6px)" } })
@@ -3814,9 +3814,9 @@
 			closeInspector,
 			isSelected,
 			pathKey
 		]), onInstructionAction = useCallback((instruction) => {
-			!pathKey || !fieldAssistKey || !assistDocumentId || !assistableDocumentId || requestRunInstruction({
+			pathKey && fieldAssistKey && assistDocumentId && assistableDocumentId && requestRunInstruction({
 				documentId: assistableDocumentId,
 				assistDocumentId,
 				path: pathKey,
 				typePath,