Skip to content

Commit

Permalink
chore: remove extra props
Browse files Browse the repository at this point in the history
  • Loading branch information
seaerchin committed Jul 25, 2024
1 parent 330c7f8 commit 838adf5
Showing 1 changed file with 3 additions and 16 deletions.
19 changes: 3 additions & 16 deletions packages/components/src/interfaces/native/Text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,32 +31,19 @@ const ItalicMarkSchema = Type.Object(
const LinkMarkSchema = Type.Unsafe<{
type: "link"
attrs: {
target: "_blank" | "_self" | "_parent" | "_top"
target: "_blank"
href: string | null
rel: string
class: string
}
}>(
Type.Object(
{
type: Type.Literal("link", { default: "link" }),
attrs: Type.Object({
target: Type.Union([
// NOTE: Taken with reference to
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-target
// There's technically 1 more property - unfencedTop but we're disallowing
// because it allows embedded frames to traverse beyond its root
Type.Literal("_blank"),
Type.Literal("_self"),
Type.Literal("_parent"),
Type.Literal("_top"),
]),
target: Type.Literal("_blank"),
// NOTE: The href given by tiptap here
// https://github.com/ueberdosis/tiptap/blob/main/packages/extension-link/src/link.ts
// defaults to `null` href but href could also be passed as `undefined`
// defaults to `null` href
href: Type.Union([Type.String(), Type.Null()]),
rel: Type.String(),
class: Type.Union([Type.String(), Type.Null()]),
}),
},
{
Expand Down

0 comments on commit 838adf5

Please sign in to comment.