Fixes hover preview going out of window bounds (#6776)
* fix: hover preview out of bounds * fix: pop * fix: check for both element and data * fix: show loading indicator * fix: width
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import isNil from "lodash/isNil";
|
||||
import isUUID from "validator/lib/isUUID";
|
||||
import { z } from "zod";
|
||||
import { UrlHelper } from "@shared/utils/UrlHelper";
|
||||
import { isUrl } from "@shared/utils/urls";
|
||||
import { ValidateURL } from "@server/validation";
|
||||
import { BaseSchema } from "../schema";
|
||||
@@ -24,7 +26,16 @@ export const UrlsUnfurlSchema = BaseSchema.extend({
|
||||
},
|
||||
{ message: ValidateURL.message }
|
||||
),
|
||||
documentId: z.string().uuid().optional(),
|
||||
documentId: z
|
||||
.string()
|
||||
.optional()
|
||||
.refine(
|
||||
(val) =>
|
||||
val ? isUUID(val) || UrlHelper.SLUG_URL_REGEX.test(val) : true,
|
||||
{
|
||||
message: "must be uuid or url slug",
|
||||
}
|
||||
),
|
||||
})
|
||||
.refine(
|
||||
(val) =>
|
||||
|
||||
Reference in New Issue
Block a user