@hanzo/ui 0.5.10
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/assets/lux-site-icons/android-chrome-192x192.png +0 -0
- package/assets/lux-site-icons/android-chrome-512x512.png +0 -0
- package/assets/lux-site-icons/apple-touch-icon.png +0 -0
- package/assets/lux-site-icons/favicon-16x16.png +0 -0
- package/assets/lux-site-icons/favicon-32x32.png +0 -0
- package/assets/lux-site-icons/favicon.ico +0 -0
- package/assets/standard-docs/LUX-NFT-Terms-and-Conditions.pdf +0 -0
- package/assets/standard-docs/LUX-Privacy-Policy.pdf +0 -0
- package/blocks/components/accordian-block.tsx +48 -0
- package/blocks/components/block-component-props.ts +11 -0
- package/blocks/components/bullet-cards-block.tsx +43 -0
- package/blocks/components/card-block.tsx +213 -0
- package/blocks/components/carte-blanche-block/index.tsx +98 -0
- package/blocks/components/content.tsx +70 -0
- package/blocks/components/cta-block.tsx +98 -0
- package/blocks/components/enh-heading-block.tsx +194 -0
- package/blocks/components/grid-block/grid-block-mutator.ts +12 -0
- package/blocks/components/grid-block/index.tsx +83 -0
- package/blocks/components/grid-block/mutator-registry.ts +10 -0
- package/blocks/components/grid-block/table-borders.mutator.ts +47 -0
- package/blocks/components/group-block.tsx +83 -0
- package/blocks/components/heading-block.tsx +88 -0
- package/blocks/components/image-block.tsx +108 -0
- package/blocks/components/index.ts +30 -0
- package/blocks/components/screenful-block/content.tsx +115 -0
- package/blocks/components/screenful-block/index.tsx +77 -0
- package/blocks/components/screenful-block/poster-background.tsx +34 -0
- package/blocks/components/screenful-block/video-background.tsx +45 -0
- package/blocks/components/space-block.tsx +66 -0
- package/blocks/components/video-block.tsx +137 -0
- package/blocks/def/accordian-block.ts +14 -0
- package/blocks/def/block.ts +7 -0
- package/blocks/def/bullet-cards-block.ts +20 -0
- package/blocks/def/card-block.ts +24 -0
- package/blocks/def/carte-blanche-block.ts +20 -0
- package/blocks/def/cta-block.ts +19 -0
- package/blocks/def/element-block.ts +11 -0
- package/blocks/def/enh-heading-block.ts +45 -0
- package/blocks/def/grid-block.ts +16 -0
- package/blocks/def/group-block.ts +11 -0
- package/blocks/def/heading-block.ts +15 -0
- package/blocks/def/image-block.ts +36 -0
- package/blocks/def/index.ts +35 -0
- package/blocks/def/screenful-block.ts +51 -0
- package/blocks/def/space-block.ts +64 -0
- package/blocks/def/video-block.ts +28 -0
- package/blocks/index.ts +2 -0
- package/common/chat-widget.tsx +75 -0
- package/common/contact-dialog/contact-form.tsx +111 -0
- package/common/contact-dialog/disclaimer.tsx +13 -0
- package/common/contact-dialog/index.tsx +48 -0
- package/common/copyright.tsx +21 -0
- package/common/drawer-menu.tsx +51 -0
- package/common/footer.tsx +77 -0
- package/common/head-metadata/from-next/metadata-types.ts +158 -0
- package/common/head-metadata/from-next/opengraph-types.ts +267 -0
- package/common/head-metadata/from-next/twitter-types.ts +92 -0
- package/common/head-metadata/index.tsx +208 -0
- package/common/header/index.tsx +57 -0
- package/common/header/mobile-nav.tsx +72 -0
- package/common/header/theme-toggle.tsx +26 -0
- package/common/icons/github.tsx +14 -0
- package/common/icons/index.tsx +34 -0
- package/common/icons/lux-logo.tsx +10 -0
- package/common/icons/secure-delivery.tsx +13 -0
- package/common/icons/social-icon.tsx +35 -0
- package/common/icons/youtube-logo.tsx +59 -0
- package/common/index.ts +14 -0
- package/common/logo.tsx +71 -0
- package/common/mini-chart/index.tsx +8 -0
- package/common/mini-chart/mini-chart-props.ts +44 -0
- package/common/mini-chart/mini-chart.tsx +76 -0
- package/common/mini-chart/wrapper.tsx +23 -0
- package/context-providers/index.ts +1 -0
- package/context-providers/theme-provider.tsx +20 -0
- package/next/README.md +11 -0
- package/next/determine-device-middleware.ts +16 -0
- package/next/fonts/DrukTextWide-Bold-Trial.otf +0 -0
- package/next/fonts/DrukTextWide-Heavy-Trial.otf +0 -0
- package/next/fonts/DrukTextWide-Medium-Trial.otf +0 -0
- package/next/get-app-router-font-classes.ts +12 -0
- package/next/load-and-return-lux-next-fonts-on-import.ts +68 -0
- package/next/next-font-desc.ts +28 -0
- package/next/not-found-content.mdx +4 -0
- package/next/not-found.tsx +23 -0
- package/next/pages-router-font-vars.tsx +18 -0
- package/next/root-layout.tsx +53 -0
- package/package.json +105 -0
- package/primitives/accordion.tsx +61 -0
- package/primitives/action-button.tsx +46 -0
- package/primitives/apply-typography.tsx +55 -0
- package/primitives/avatar.tsx +49 -0
- package/primitives/badge.tsx +36 -0
- package/primitives/button.tsx +73 -0
- package/primitives/calendar.tsx +72 -0
- package/primitives/card.tsx +83 -0
- package/primitives/checkbox.tsx +32 -0
- package/primitives/command.tsx +155 -0
- package/primitives/dialog-video-controller.tsx +38 -0
- package/primitives/dialog.tsx +152 -0
- package/primitives/form.tsx +179 -0
- package/primitives/index.ts +144 -0
- package/primitives/inline-icon.tsx +37 -0
- package/primitives/input.tsx +30 -0
- package/primitives/label.tsx +28 -0
- package/primitives/link-element.tsx +104 -0
- package/primitives/main.tsx +17 -0
- package/primitives/mdx-link.tsx +22 -0
- package/primitives/nav-items.tsx +48 -0
- package/primitives/popover.tsx +35 -0
- package/primitives/progress.tsx +27 -0
- package/primitives/scroll-area.tsx +47 -0
- package/primitives/select.tsx +169 -0
- package/primitives/separator.tsx +29 -0
- package/primitives/sheet.tsx +175 -0
- package/primitives/skeleton.tsx +15 -0
- package/primitives/switch.tsx +33 -0
- package/primitives/table.tsx +117 -0
- package/primitives/tabs.tsx +60 -0
- package/primitives/tailwind-indicator.tsx +19 -0
- package/primitives/text-area.tsx +26 -0
- package/primitives/toast.tsx +129 -0
- package/primitives/toaster.tsx +37 -0
- package/primitives/use-toast.ts +192 -0
- package/primitives/video-player.tsx +26 -0
- package/primitives/youtube-embed.tsx +83 -0
- package/siteDef/footer/community.tsx +67 -0
- package/siteDef/footer/company.ts +37 -0
- package/siteDef/footer/ecosystem.ts +37 -0
- package/siteDef/footer/index.tsx +26 -0
- package/siteDef/footer/legal.ts +28 -0
- package/siteDef/footer/network.ts +33 -0
- package/siteDef/footer/svg/warpcast-logo.svg +12 -0
- package/siteDef/main-nav.ts +35 -0
- package/style/globals.css +13 -0
- package/style/hanzo-common.css +32 -0
- package/style/hanzo-default-colors.css +79 -0
- package/style/social-svg.css +3 -0
- package/tailwind/colors.tailwind.js +46 -0
- package/tailwind/fonts.tailwind.ts +31 -0
- package/tailwind/index.ts +18 -0
- package/tailwind/lux-tw-fonts.ts +32 -0
- package/tailwind/safelist.tailwind.js +26 -0
- package/tailwind/screens.tailwind.js +8 -0
- package/tailwind/spacing.tailwind.js +57 -0
- package/tailwind/tailwind.config.base.js +905 -0
- package/tailwind/tw-font-desc.ts +15 -0
- package/tailwind/typo-plugin/get-plugin-styles.js +676 -0
- package/tailwind/typo-plugin/index.d.ts +9 -0
- package/tailwind/typo-plugin/index.js +141 -0
- package/tailwind/typo-plugin/utils.js +60 -0
- package/tailwind/typography-test.mdx +36 -0
- package/types/breakpoints.ts +11 -0
- package/types/bullet-item.ts +10 -0
- package/types/button-def.ts +39 -0
- package/types/contact-info.ts +11 -0
- package/types/dimensions.ts +20 -0
- package/types/grid-def.ts +37 -0
- package/types/icon.ts +10 -0
- package/types/image-def.ts +28 -0
- package/types/index.ts +29 -0
- package/types/link-def.ts +59 -0
- package/types/site-def.ts +31 -0
- package/types/t-shirt-size.ts +5 -0
- package/util/index.ts +76 -0
- package/util/specifier.ts +43 -0
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Metadata types
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export interface DeprecatedMetadataFields {
|
|
8
|
+
/**
|
|
9
|
+
* Deprecated options that have a preferred method
|
|
10
|
+
* @deprecated Use appWebApp to configure apple-mobile-web-app-capable which provides
|
|
11
|
+
* @see https://www.appsloveworld.com/coding/iphone/11/difference-between-apple-mobile-web-app-capable-and-apple-touch-fullscreen-ipho
|
|
12
|
+
*/
|
|
13
|
+
'apple-touch-fullscreen'?: never
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Obsolete since iOS 7.
|
|
17
|
+
* @see https://web.dev/apple-touch-icon/
|
|
18
|
+
* @deprecated use icons.apple or instead
|
|
19
|
+
*/
|
|
20
|
+
'apple-touch-icon-precomposed'?: never
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export type TemplateString =
|
|
24
|
+
| DefaultTemplateString
|
|
25
|
+
| AbsoluteTemplateString
|
|
26
|
+
| AbsoluteString
|
|
27
|
+
export type DefaultTemplateString = {
|
|
28
|
+
default: string
|
|
29
|
+
template: string
|
|
30
|
+
}
|
|
31
|
+
export type AbsoluteTemplateString = {
|
|
32
|
+
absolute: string
|
|
33
|
+
template: string | null
|
|
34
|
+
}
|
|
35
|
+
export type AbsoluteString = {
|
|
36
|
+
absolute: string
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export type Author = {
|
|
40
|
+
// renders as <link rel="author"...
|
|
41
|
+
url?: string | URL
|
|
42
|
+
// renders as <meta name="author"...
|
|
43
|
+
name?: string
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// does not include "unsafe-URL". to use this users should
|
|
47
|
+
// use '"unsafe-URL" as ReferrerEnum'
|
|
48
|
+
export type ReferrerEnum =
|
|
49
|
+
| 'no-referrer'
|
|
50
|
+
| 'origin'
|
|
51
|
+
| 'no-referrer-when-downgrade'
|
|
52
|
+
| 'origin-when-cross-origin'
|
|
53
|
+
| 'same-origin'
|
|
54
|
+
| 'strict-origin'
|
|
55
|
+
| 'strict-origin-when-cross-origin'
|
|
56
|
+
|
|
57
|
+
export type ColorSchemeEnum =
|
|
58
|
+
| 'normal'
|
|
59
|
+
| 'light'
|
|
60
|
+
| 'dark'
|
|
61
|
+
| 'light dark'
|
|
62
|
+
| 'dark light'
|
|
63
|
+
| 'only light'
|
|
64
|
+
|
|
65
|
+
type RobotsInfo = {
|
|
66
|
+
// all and none will be inferred from index/follow boolean options
|
|
67
|
+
index?: boolean
|
|
68
|
+
follow?: boolean
|
|
69
|
+
|
|
70
|
+
/** @deprecated set index to false instead */
|
|
71
|
+
noindex?: never
|
|
72
|
+
/** @deprecated set follow to false instead */
|
|
73
|
+
nofollow?: never
|
|
74
|
+
|
|
75
|
+
noarchive?: boolean
|
|
76
|
+
nosnippet?: boolean
|
|
77
|
+
noimageindex?: boolean
|
|
78
|
+
nocache?: boolean
|
|
79
|
+
notranslate?: boolean
|
|
80
|
+
indexifembedded?: boolean
|
|
81
|
+
nositelinkssearchbox?: boolean
|
|
82
|
+
unavailable_after?: string
|
|
83
|
+
'max-video-preview'?: number | string
|
|
84
|
+
'max-image-preview'?: 'none' | 'standard' | 'large'
|
|
85
|
+
'max-snippet'?: number
|
|
86
|
+
}
|
|
87
|
+
export type Robots = RobotsInfo & {
|
|
88
|
+
// if you want to specify an alternate robots just for google
|
|
89
|
+
googleBot?: string | RobotsInfo
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export type ResolvedRobots = {
|
|
93
|
+
basic: string | null
|
|
94
|
+
googleBot: string | null
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export type IconURL = string | URL
|
|
98
|
+
export type Icon = IconURL | IconDescriptor
|
|
99
|
+
export type IconDescriptor = {
|
|
100
|
+
url: string | URL
|
|
101
|
+
type?: string
|
|
102
|
+
sizes?: string
|
|
103
|
+
color?: string
|
|
104
|
+
/** defaults to rel="icon" unless superseded by Icons map */
|
|
105
|
+
rel?: string
|
|
106
|
+
media?: string
|
|
107
|
+
/**
|
|
108
|
+
* @see https://developer.mozilla.org/docs/Web/API/HTMLImageElement/fetchPriority
|
|
109
|
+
*/
|
|
110
|
+
fetchPriority?: 'high' | 'low' | 'auto'
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export type Icons = {
|
|
114
|
+
/** rel="icon" */
|
|
115
|
+
icon?: Icon | Icon[]
|
|
116
|
+
/** rel="shortcut icon" */
|
|
117
|
+
shortcut?: Icon | Icon[]
|
|
118
|
+
/**
|
|
119
|
+
* @see https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariWebContent/ConfiguringWebApplications/ConfiguringWebApplications.html
|
|
120
|
+
* rel="apple-touch-icon"
|
|
121
|
+
*/
|
|
122
|
+
apple?: Icon | Icon[]
|
|
123
|
+
/** rel inferred from descriptor, defaults to "icon" */
|
|
124
|
+
other?: IconDescriptor | IconDescriptor[]
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export type Verification = {
|
|
128
|
+
google?: null | string | number | (string | number)[]
|
|
129
|
+
yahoo?: null | string | number | (string | number)[]
|
|
130
|
+
yandex?: null | string | number | (string | number)[]
|
|
131
|
+
me?: null | string | number | (string | number)[]
|
|
132
|
+
// if you ad-hoc additional verification
|
|
133
|
+
other?: {
|
|
134
|
+
[name: string]: string | number | (string | number)[]
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export type ResolvedVerification = {
|
|
139
|
+
google?: null | (string | number)[]
|
|
140
|
+
yahoo?: null | (string | number)[]
|
|
141
|
+
yandex?: null | (string | number)[]
|
|
142
|
+
me?: null | (string | number)[]
|
|
143
|
+
other?: {
|
|
144
|
+
[name: string]: (string | number)[]
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export type ResolvedIcons = {
|
|
149
|
+
icon: IconDescriptor[]
|
|
150
|
+
apple: IconDescriptor[]
|
|
151
|
+
shortcut?: IconDescriptor[]
|
|
152
|
+
other?: IconDescriptor[]
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export type ThemeColorDescriptor = {
|
|
156
|
+
color: string
|
|
157
|
+
media?: string
|
|
158
|
+
}
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
import type { AbsoluteTemplateString, TemplateString } from './metadata-types'
|
|
2
|
+
|
|
3
|
+
export type OpenGraphType =
|
|
4
|
+
| 'article'
|
|
5
|
+
| 'book'
|
|
6
|
+
| 'music.song'
|
|
7
|
+
| 'music.album'
|
|
8
|
+
| 'music.playlist'
|
|
9
|
+
| 'music.radio_station'
|
|
10
|
+
| 'profile'
|
|
11
|
+
| 'website'
|
|
12
|
+
| 'video.tv_show'
|
|
13
|
+
| 'video.other'
|
|
14
|
+
| 'video.movie'
|
|
15
|
+
| 'video.episode'
|
|
16
|
+
|
|
17
|
+
export type OpenGraph =
|
|
18
|
+
| OpenGraphWebsite
|
|
19
|
+
| OpenGraphArticle
|
|
20
|
+
| OpenGraphBook
|
|
21
|
+
| OpenGraphProfile
|
|
22
|
+
| OpenGraphMusicSong
|
|
23
|
+
| OpenGraphMusicAlbum
|
|
24
|
+
| OpenGraphMusicPlaylist
|
|
25
|
+
| OpenGraphRadioStation
|
|
26
|
+
| OpenGraphVideoMovie
|
|
27
|
+
| OpenGraphVideoEpisode
|
|
28
|
+
| OpenGraphVideoTVShow
|
|
29
|
+
| OpenGraphVideoOther
|
|
30
|
+
| OpenGraphMetadata
|
|
31
|
+
|
|
32
|
+
// update this type to reflect actual locales
|
|
33
|
+
type Locale = string
|
|
34
|
+
|
|
35
|
+
type OpenGraphMetadata = {
|
|
36
|
+
determiner?: 'a' | 'an' | 'the' | 'auto' | ''
|
|
37
|
+
title?: string | TemplateString
|
|
38
|
+
description?: string
|
|
39
|
+
emails?: string | Array<string>
|
|
40
|
+
phoneNumbers?: string | Array<string>
|
|
41
|
+
faxNumbers?: string | Array<string>
|
|
42
|
+
siteName?: string
|
|
43
|
+
locale?: Locale
|
|
44
|
+
alternateLocale?: Locale | Array<Locale>
|
|
45
|
+
images?: OGImage | Array<OGImage>
|
|
46
|
+
audio?: OGAudio | Array<OGAudio>
|
|
47
|
+
videos?: OGVideo | Array<OGVideo>
|
|
48
|
+
url?: string | URL
|
|
49
|
+
countryName?: string
|
|
50
|
+
ttl?: number
|
|
51
|
+
}
|
|
52
|
+
export type OpenGraphWebsite = OpenGraphMetadata & {
|
|
53
|
+
type: 'website'
|
|
54
|
+
}
|
|
55
|
+
type OpenGraphArticle = OpenGraphMetadata & {
|
|
56
|
+
type: 'article'
|
|
57
|
+
publishedTime?: string // datetime
|
|
58
|
+
modifiedTime?: string // datetime
|
|
59
|
+
expirationTime?: string // datetime
|
|
60
|
+
authors?: null | string | URL | Array<string | URL>
|
|
61
|
+
section?: null | string
|
|
62
|
+
tags?: null | string | Array<string>
|
|
63
|
+
}
|
|
64
|
+
type OpenGraphBook = OpenGraphMetadata & {
|
|
65
|
+
type: 'book'
|
|
66
|
+
isbn?: null | string
|
|
67
|
+
releaseDate?: null | string // datetime
|
|
68
|
+
authors?: null | string | URL | Array<string | URL>
|
|
69
|
+
tags?: null | string | Array<string>
|
|
70
|
+
}
|
|
71
|
+
type OpenGraphProfile = OpenGraphMetadata & {
|
|
72
|
+
type: 'profile'
|
|
73
|
+
firstName?: null | string
|
|
74
|
+
lastName?: null | string
|
|
75
|
+
username?: null | string
|
|
76
|
+
gender?: null | string
|
|
77
|
+
}
|
|
78
|
+
type OpenGraphMusicSong = OpenGraphMetadata & {
|
|
79
|
+
type: 'music.song'
|
|
80
|
+
duration?: null | number
|
|
81
|
+
albums?: null | string | URL | OGAlbum | Array<string | URL | OGAlbum>
|
|
82
|
+
musicians?: null | string | URL | Array<string | URL>
|
|
83
|
+
}
|
|
84
|
+
type OpenGraphMusicAlbum = OpenGraphMetadata & {
|
|
85
|
+
type: 'music.album'
|
|
86
|
+
songs?: null | string | URL | OGSong | Array<string | URL | OGSong>
|
|
87
|
+
musicians?: null | string | URL | Array<string | URL>
|
|
88
|
+
releaseDate?: null | string // datetime
|
|
89
|
+
}
|
|
90
|
+
type OpenGraphMusicPlaylist = OpenGraphMetadata & {
|
|
91
|
+
type: 'music.playlist'
|
|
92
|
+
songs?: null | string | URL | OGSong | Array<string | URL | OGSong>
|
|
93
|
+
creators?: null | string | URL | Array<string | URL>
|
|
94
|
+
}
|
|
95
|
+
type OpenGraphRadioStation = OpenGraphMetadata & {
|
|
96
|
+
type: 'music.radio_station'
|
|
97
|
+
creators?: null | string | URL | Array<string | URL>
|
|
98
|
+
}
|
|
99
|
+
type OpenGraphVideoMovie = OpenGraphMetadata & {
|
|
100
|
+
type: 'video.movie'
|
|
101
|
+
actors?: null | string | URL | OGActor | Array<string | URL | OGActor>
|
|
102
|
+
directors?: null | string | URL | Array<string | URL>
|
|
103
|
+
writers?: null | string | URL | Array<string | URL>
|
|
104
|
+
duration?: null | number
|
|
105
|
+
releaseDate?: null | string // datetime
|
|
106
|
+
tags?: null | string | Array<string>
|
|
107
|
+
}
|
|
108
|
+
type OpenGraphVideoEpisode = OpenGraphMetadata & {
|
|
109
|
+
type: 'video.episode'
|
|
110
|
+
actors?: null | string | URL | OGActor | Array<string | URL | OGActor>
|
|
111
|
+
directors?: null | string | URL | Array<string | URL>
|
|
112
|
+
writers?: null | string | URL | Array<string | URL>
|
|
113
|
+
duration?: null | number
|
|
114
|
+
releaseDate?: null | string // datetime
|
|
115
|
+
tags?: null | string | Array<string>
|
|
116
|
+
series?: null | string | URL
|
|
117
|
+
}
|
|
118
|
+
type OpenGraphVideoTVShow = OpenGraphMetadata & {
|
|
119
|
+
type: 'video.tv_show'
|
|
120
|
+
}
|
|
121
|
+
type OpenGraphVideoOther = OpenGraphMetadata & {
|
|
122
|
+
type: 'video.other'
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export type OGImage = string | OGImageDescriptor | URL
|
|
126
|
+
type OGImageDescriptor = {
|
|
127
|
+
url: string | URL
|
|
128
|
+
secureUrl?: string | URL
|
|
129
|
+
alt?: string
|
|
130
|
+
type?: string
|
|
131
|
+
width?: string | number
|
|
132
|
+
height?: string | number
|
|
133
|
+
}
|
|
134
|
+
type OGAudio = string | OGAudioDescriptor | URL
|
|
135
|
+
type OGAudioDescriptor = {
|
|
136
|
+
url: string | URL
|
|
137
|
+
secureUrl?: string | URL
|
|
138
|
+
type?: string
|
|
139
|
+
}
|
|
140
|
+
type OGVideo = string | OGVideoDescriptor | URL
|
|
141
|
+
type OGVideoDescriptor = {
|
|
142
|
+
url: string | URL
|
|
143
|
+
secureUrl?: string | URL
|
|
144
|
+
type?: string
|
|
145
|
+
width?: string | number
|
|
146
|
+
height?: string | number
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export type ResolvedOpenGraph =
|
|
150
|
+
| ResolvedOpenGraphWebsite
|
|
151
|
+
| ResolvedOpenGraphArticle
|
|
152
|
+
| ResolvedOpenGraphBook
|
|
153
|
+
| ResolvedOpenGraphProfile
|
|
154
|
+
| ResolvedOpenGraphMusicSong
|
|
155
|
+
| ResolvedOpenGraphMusicAlbum
|
|
156
|
+
| ResolvedOpenGraphMusicPlaylist
|
|
157
|
+
| ResolvedOpenGraphRadioStation
|
|
158
|
+
| ResolvedOpenGraphVideoMovie
|
|
159
|
+
| ResolvedOpenGraphVideoEpisode
|
|
160
|
+
| ResolvedOpenGraphVideoTVShow
|
|
161
|
+
| ResolvedOpenGraphVideoOther
|
|
162
|
+
| ResolvedOpenGraphMetadata
|
|
163
|
+
|
|
164
|
+
type ResolvedOpenGraphMetadata = {
|
|
165
|
+
determiner?: 'a' | 'an' | 'the' | 'auto' | ''
|
|
166
|
+
title: AbsoluteTemplateString
|
|
167
|
+
description?: string
|
|
168
|
+
emails?: Array<string>
|
|
169
|
+
phoneNumbers?: Array<string>
|
|
170
|
+
faxNumbers?: Array<string>
|
|
171
|
+
siteName?: string
|
|
172
|
+
locale?: Locale
|
|
173
|
+
alternateLocale?: Array<Locale>
|
|
174
|
+
images?: Array<OGImage>
|
|
175
|
+
audio?: Array<OGAudio>
|
|
176
|
+
videos?: Array<OGVideo>
|
|
177
|
+
url: null | URL | string
|
|
178
|
+
countryName?: string
|
|
179
|
+
ttl?: number
|
|
180
|
+
}
|
|
181
|
+
type ResolvedOpenGraphWebsite = ResolvedOpenGraphMetadata & {
|
|
182
|
+
type: 'website'
|
|
183
|
+
}
|
|
184
|
+
type ResolvedOpenGraphArticle = ResolvedOpenGraphMetadata & {
|
|
185
|
+
type: 'article'
|
|
186
|
+
publishedTime?: string // datetime
|
|
187
|
+
modifiedTime?: string // datetime
|
|
188
|
+
expirationTime?: string // datetime
|
|
189
|
+
authors?: Array<string>
|
|
190
|
+
section?: string
|
|
191
|
+
tags?: Array<string>
|
|
192
|
+
}
|
|
193
|
+
type ResolvedOpenGraphBook = ResolvedOpenGraphMetadata & {
|
|
194
|
+
type: 'book'
|
|
195
|
+
isbn?: string
|
|
196
|
+
releaseDate?: string // datetime
|
|
197
|
+
authors?: Array<string>
|
|
198
|
+
tags?: Array<string>
|
|
199
|
+
}
|
|
200
|
+
type ResolvedOpenGraphProfile = ResolvedOpenGraphMetadata & {
|
|
201
|
+
type: 'profile'
|
|
202
|
+
firstName?: string
|
|
203
|
+
lastName?: string
|
|
204
|
+
username?: string
|
|
205
|
+
gender?: string
|
|
206
|
+
}
|
|
207
|
+
type ResolvedOpenGraphMusicSong = ResolvedOpenGraphMetadata & {
|
|
208
|
+
type: 'music.song'
|
|
209
|
+
duration?: number
|
|
210
|
+
albums?: Array<OGAlbum>
|
|
211
|
+
musicians?: Array<string | URL>
|
|
212
|
+
}
|
|
213
|
+
type ResolvedOpenGraphMusicAlbum = ResolvedOpenGraphMetadata & {
|
|
214
|
+
type: 'music.album'
|
|
215
|
+
songs?: Array<string | URL | OGSong>
|
|
216
|
+
musicians?: Array<string | URL>
|
|
217
|
+
releaseDate?: string // datetime
|
|
218
|
+
}
|
|
219
|
+
type ResolvedOpenGraphMusicPlaylist = ResolvedOpenGraphMetadata & {
|
|
220
|
+
type: 'music.playlist'
|
|
221
|
+
songs?: Array<string | URL | OGSong>
|
|
222
|
+
creators?: Array<string | URL>
|
|
223
|
+
}
|
|
224
|
+
type ResolvedOpenGraphRadioStation = ResolvedOpenGraphMetadata & {
|
|
225
|
+
type: 'music.radio_station'
|
|
226
|
+
creators?: Array<string | URL>
|
|
227
|
+
}
|
|
228
|
+
type ResolvedOpenGraphVideoMovie = ResolvedOpenGraphMetadata & {
|
|
229
|
+
type: 'video.movie'
|
|
230
|
+
actors?: Array<string | URL | OGActor>
|
|
231
|
+
directors?: Array<string | URL>
|
|
232
|
+
writers?: Array<string | URL>
|
|
233
|
+
duration?: number
|
|
234
|
+
releaseDate?: string // datetime
|
|
235
|
+
tags?: Array<string>
|
|
236
|
+
}
|
|
237
|
+
type ResolvedOpenGraphVideoEpisode = ResolvedOpenGraphMetadata & {
|
|
238
|
+
type: 'video.episode'
|
|
239
|
+
actors?: Array<string | URL | OGActor>
|
|
240
|
+
directors?: Array<string | URL>
|
|
241
|
+
writers?: Array<string | URL>
|
|
242
|
+
duration?: number
|
|
243
|
+
releaseDate?: string // datetime
|
|
244
|
+
tags?: Array<string>
|
|
245
|
+
series?: string | URL
|
|
246
|
+
}
|
|
247
|
+
type ResolvedOpenGraphVideoTVShow = ResolvedOpenGraphMetadata & {
|
|
248
|
+
type: 'video.tv_show'
|
|
249
|
+
}
|
|
250
|
+
type ResolvedOpenGraphVideoOther = ResolvedOpenGraphMetadata & {
|
|
251
|
+
type: 'video.other'
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
type OGSong = {
|
|
255
|
+
url: string | URL
|
|
256
|
+
disc?: number
|
|
257
|
+
track?: number
|
|
258
|
+
}
|
|
259
|
+
type OGAlbum = {
|
|
260
|
+
url: string | URL
|
|
261
|
+
disc?: number
|
|
262
|
+
track?: number
|
|
263
|
+
}
|
|
264
|
+
type OGActor = {
|
|
265
|
+
url: string | URL
|
|
266
|
+
role?: string
|
|
267
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
// Reference: https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/markup
|
|
2
|
+
|
|
3
|
+
import type { AbsoluteTemplateString, TemplateString } from './metadata-types'
|
|
4
|
+
|
|
5
|
+
export type Twitter =
|
|
6
|
+
| TwitterSummary
|
|
7
|
+
| TwitterSummaryLargeImage
|
|
8
|
+
| TwitterPlayer
|
|
9
|
+
| TwitterApp
|
|
10
|
+
| TwitterMetadata
|
|
11
|
+
|
|
12
|
+
type TwitterMetadata = {
|
|
13
|
+
// defaults to card="summary"
|
|
14
|
+
site?: string // username for account associated to the site itself
|
|
15
|
+
siteId?: string // id for account associated to the site itself
|
|
16
|
+
creator?: string // username for the account associated to the creator of the content on the site
|
|
17
|
+
creatorId?: string // id for the account associated to the creator of the content on the site
|
|
18
|
+
description?: string
|
|
19
|
+
title?: string | TemplateString
|
|
20
|
+
images?: TwitterImage | Array<TwitterImage>
|
|
21
|
+
}
|
|
22
|
+
type TwitterSummary = TwitterMetadata & {
|
|
23
|
+
card: 'summary'
|
|
24
|
+
}
|
|
25
|
+
type TwitterSummaryLargeImage = TwitterMetadata & {
|
|
26
|
+
card: 'summary_large_image'
|
|
27
|
+
}
|
|
28
|
+
type TwitterPlayer = TwitterMetadata & {
|
|
29
|
+
card: 'player'
|
|
30
|
+
players: TwitterPlayerDescriptor | Array<TwitterPlayerDescriptor>
|
|
31
|
+
}
|
|
32
|
+
type TwitterApp = TwitterMetadata & {
|
|
33
|
+
card: 'app'
|
|
34
|
+
app: TwitterAppDescriptor
|
|
35
|
+
}
|
|
36
|
+
export type TwitterAppDescriptor = {
|
|
37
|
+
id: {
|
|
38
|
+
iphone?: string | number
|
|
39
|
+
ipad?: string | number
|
|
40
|
+
googleplay?: string
|
|
41
|
+
}
|
|
42
|
+
url?: {
|
|
43
|
+
iphone?: string | URL
|
|
44
|
+
ipad?: string | URL
|
|
45
|
+
googleplay?: string | URL
|
|
46
|
+
}
|
|
47
|
+
name?: string
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export type TwitterImage = string | TwitterImageDescriptor | URL
|
|
51
|
+
type TwitterImageDescriptor = {
|
|
52
|
+
url: string | URL
|
|
53
|
+
alt?: string
|
|
54
|
+
secureUrl?: string | URL
|
|
55
|
+
type?: string
|
|
56
|
+
width?: string | number
|
|
57
|
+
height?: string | number
|
|
58
|
+
}
|
|
59
|
+
type TwitterPlayerDescriptor = {
|
|
60
|
+
playerUrl: string | URL
|
|
61
|
+
streamUrl: string | URL
|
|
62
|
+
width: number
|
|
63
|
+
height: number
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
type ResolvedTwitterImage = {
|
|
67
|
+
url: string | URL
|
|
68
|
+
alt?: string
|
|
69
|
+
secureUrl?: string | URL
|
|
70
|
+
type?: string
|
|
71
|
+
width?: string | number
|
|
72
|
+
height?: string | number
|
|
73
|
+
}
|
|
74
|
+
type ResolvedTwitterSummary = {
|
|
75
|
+
site: string | null
|
|
76
|
+
siteId: string | null
|
|
77
|
+
creator: string | null
|
|
78
|
+
creatorId: string | null
|
|
79
|
+
description: string | null
|
|
80
|
+
title: AbsoluteTemplateString
|
|
81
|
+
images?: Array<ResolvedTwitterImage>
|
|
82
|
+
}
|
|
83
|
+
type ResolvedTwitterPlayer = ResolvedTwitterSummary & {
|
|
84
|
+
players: Array<TwitterPlayerDescriptor>
|
|
85
|
+
}
|
|
86
|
+
type ResolvedTwitterApp = ResolvedTwitterSummary & { app: TwitterAppDescriptor }
|
|
87
|
+
|
|
88
|
+
export type ResolvedTwitterMetadata =
|
|
89
|
+
| ({ card: 'summary' } & ResolvedTwitterSummary)
|
|
90
|
+
| ({ card: 'summary_large_image' } & ResolvedTwitterSummary)
|
|
91
|
+
| ({ card: 'player' } & ResolvedTwitterPlayer)
|
|
92
|
+
| ({ card: 'app' } & ResolvedTwitterApp)
|