sanity-plugin-asset-source-unsplash
7.0.217.0.22
dist/index.js~
dist/index.jsModified+3−2
Index: package/dist/index.js
===================================================================
--- package/dist/index.js
+++ package/dist/index.js
@@ -1,5 +1,6 @@
import { t as Loader } from "./Loader-BKAt74MR.js";
+import "@sanity/ui/styles.css";
import { definePlugin, useClient } from "sanity";
import { c } from "react/compiler-runtime";
import { jsx, jsxs } from "react/jsx-runtime";
import { Box, Dialog, Stack, TextInput } from "@sanity/ui";
@@ -27,9 +28,9 @@
componentId: "sc-2sc45f-0"
})`animation:${rotate} 500ms linear infinite;`;
function SearchInput(t0) {
let $ = c(12), { value, changeAction } = t0, [inputValue, setInputValue] = useOptimistic(value), isPending = inputValue !== value, t1;
- $[0] !== changeAction || $[1] !== setInputValue ? (t1 = function(newValue) {
+ $[0] !== changeAction || $[1] !== setInputValue ? (t1 = function handleChange(newValue) {
startTransition(async () => {
setInputValue(newValue), await changeAction(newValue);
});
}, $[0] = changeAction, $[1] = setInputValue, $[2] = t1) : t1 = $[2];
@@ -53,9 +54,9 @@
function UnsplashAssetSource(t0) {
let $ = c(25), { onClose, onSelect } = t0, t1;
$[0] === Symbol.for("react.memo_cache_sentinel") ? (t1 = { apiVersion: "2022-09-01" }, $[0] = t1) : t1 = $[0];
let client = useClient(t1), t2;
- $[1] === client ? t2 = $[2] : (t2 = memoize(async function(query, page) {
+ $[1] === client ? t2 = $[2] : (t2 = memoize(async function fetcher(query, page) {
let searchParams = new URLSearchParams({
page: `${page}`,
per_page: "42"
});