@datocms/astro 0.1.0 → 0.1.1
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/components/Image/buildSrcSet.ts +45 -0
- package/components/Image/index.astro +115 -0
- package/components/VideoPlayer/index.astro +101 -0
- package/components/VideoPlayer/toHtmlArgs.ts +70 -0
- package/lib/index.ts +4 -1
- package/lib/types.ts +45 -1
- package/lib/useVideoPlayer/index.ts +51 -0
- package/package.json +54 -42
- package/components/Foobar.astro +0 -1
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
|
|
2
|
+
const bogusBaseUrl = "https://example.com/";
|
|
3
|
+
|
|
4
|
+
export const buildSrcSet = (
|
|
5
|
+
src: string | null | undefined,
|
|
6
|
+
width: number | undefined,
|
|
7
|
+
candidateMultipliers: number[]
|
|
8
|
+
) => {
|
|
9
|
+
if (!(src && width)) {
|
|
10
|
+
return undefined;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
return candidateMultipliers
|
|
14
|
+
.map((multiplier) => {
|
|
15
|
+
const url = new URL(src, bogusBaseUrl);
|
|
16
|
+
|
|
17
|
+
if (multiplier !== 1) {
|
|
18
|
+
url.searchParams.set("dpr", `${multiplier}`);
|
|
19
|
+
const maxH = url.searchParams.get("max-h");
|
|
20
|
+
const maxW = url.searchParams.get("max-w");
|
|
21
|
+
if (maxH) {
|
|
22
|
+
url.searchParams.set(
|
|
23
|
+
"max-h",
|
|
24
|
+
`${Math.floor(Number.parseInt(maxH) * multiplier)}`
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
if (maxW) {
|
|
28
|
+
url.searchParams.set(
|
|
29
|
+
"max-w",
|
|
30
|
+
`${Math.floor(Number.parseInt(maxW) * multiplier)}`
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const finalWidth = Math.floor(width * multiplier);
|
|
36
|
+
|
|
37
|
+
if (finalWidth < 50) {
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return `${url.toString().replace(bogusBaseUrl, "/")} ${finalWidth}w`;
|
|
42
|
+
})
|
|
43
|
+
.filter(Boolean)
|
|
44
|
+
.join(",");
|
|
45
|
+
};
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { ResponsiveImageType } from "../../lib/types";
|
|
3
|
+
import { buildSrcSet } from './buildSrcSet';
|
|
4
|
+
|
|
5
|
+
type StyleAttribute = astroHTML.JSX.HTMLAttributes['style'];
|
|
6
|
+
type StyleAttributeAsObject = Exclude<StyleAttribute, string>;
|
|
7
|
+
|
|
8
|
+
interface Props {
|
|
9
|
+
/** The actual response you get from a DatoCMS `responsiveImage` GraphQL query */
|
|
10
|
+
data: ResponsiveImageType;
|
|
11
|
+
/** Additional CSS class for the root <picture> tag */
|
|
12
|
+
pictureClass?: string;
|
|
13
|
+
/** Additional CSS rules to add to the root <picture> tag */
|
|
14
|
+
pictureStyle?: StyleAttribute;
|
|
15
|
+
/** Additional CSS class for the <img> tag */
|
|
16
|
+
imgClass?: string;
|
|
17
|
+
/** Additional CSS rules to add to the <img> tag */
|
|
18
|
+
imgStyle?: StyleAttributeAsObject;
|
|
19
|
+
/**
|
|
20
|
+
* When true, the image will be considered high priority. Lazy loading is automatically disabled, and fetchpriority="high" is added to the image.
|
|
21
|
+
* You should use the priority property on any image detected as the Largest Contentful Paint (LCP) element. It may be appropriate to have multiple priority images, as different images may be the LCP element for different viewport sizes.
|
|
22
|
+
* Should only be used when the image is visible above the fold.
|
|
23
|
+
**/
|
|
24
|
+
priority?: boolean;
|
|
25
|
+
/** Whether the component should use a blurred image placeholder */
|
|
26
|
+
usePlaceholder?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* The HTML5 `sizes` attribute for the image
|
|
29
|
+
*
|
|
30
|
+
* Learn more about srcset and sizes:
|
|
31
|
+
* -> https://web.dev/learn/design/responsive-images/#sizes
|
|
32
|
+
* -> https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attr-sizes
|
|
33
|
+
**/
|
|
34
|
+
sizes?: HTMLImageElement["sizes"];
|
|
35
|
+
/**
|
|
36
|
+
* If `data` does not contain `srcSet`, the candidates for the `srcset` of the image will be auto-generated based on these width multipliers
|
|
37
|
+
*
|
|
38
|
+
* Default candidate multipliers are [0.25, 0.5, 0.75, 1, 1.5, 2, 3, 4]
|
|
39
|
+
**/
|
|
40
|
+
srcSetCandidates?: number[];
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const {
|
|
44
|
+
data,
|
|
45
|
+
pictureClass,
|
|
46
|
+
pictureStyle,
|
|
47
|
+
imgClass,
|
|
48
|
+
imgStyle,
|
|
49
|
+
priority,
|
|
50
|
+
usePlaceholder,
|
|
51
|
+
sizes,
|
|
52
|
+
srcSetCandidates,
|
|
53
|
+
} = Astro.props;
|
|
54
|
+
|
|
55
|
+
const placeholderStyle: StyleAttributeAsObject | undefined =
|
|
56
|
+
usePlaceholder && data.base64
|
|
57
|
+
? {
|
|
58
|
+
backgroundImage: `url("${data.base64}")`,
|
|
59
|
+
backgroundSize: "cover",
|
|
60
|
+
backgroundRepeat: "no-repeat",
|
|
61
|
+
backgroundPosition: "50% 50%",
|
|
62
|
+
color: "transparent",
|
|
63
|
+
}
|
|
64
|
+
: usePlaceholder && data.bgColor
|
|
65
|
+
? { backgroundColor: data.bgColor ?? undefined, color: "transparent" }
|
|
66
|
+
: undefined;
|
|
67
|
+
|
|
68
|
+
const { width } = data;
|
|
69
|
+
|
|
70
|
+
const height =
|
|
71
|
+
data.height ?? Math.round(data.aspectRatio ? width / data.aspectRatio : 0);
|
|
72
|
+
|
|
73
|
+
const sizingStyle = {
|
|
74
|
+
aspectRatio: `${width} / ${height}`,
|
|
75
|
+
width: "100%",
|
|
76
|
+
maxWidth: `${width}px`,
|
|
77
|
+
height: "auto",
|
|
78
|
+
};
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
<picture data-testid="picture" class={pictureClass} style={pictureStyle}>
|
|
82
|
+
{
|
|
83
|
+
data.webpSrcSet && (
|
|
84
|
+
<source
|
|
85
|
+
srcset={data.webpSrcSet}
|
|
86
|
+
sizes={sizes ?? data.sizes ?? null}
|
|
87
|
+
type="image/webp"
|
|
88
|
+
/>
|
|
89
|
+
)
|
|
90
|
+
}
|
|
91
|
+
<source
|
|
92
|
+
srcset={data.srcSet ??
|
|
93
|
+
buildSrcSet(data.src, data.width, srcSetCandidates) ??
|
|
94
|
+
null}
|
|
95
|
+
sizes={sizes ?? data.sizes ?? null}
|
|
96
|
+
/>
|
|
97
|
+
{
|
|
98
|
+
data.src && (
|
|
99
|
+
<img
|
|
100
|
+
src={data.src}
|
|
101
|
+
alt={data.alt ?? ""}
|
|
102
|
+
title={data.title ?? null}
|
|
103
|
+
fetchpriority={priority ? "high" : undefined}
|
|
104
|
+
loading={priority ? undefined : "lazy"}
|
|
105
|
+
class={imgClass}
|
|
106
|
+
style={{
|
|
107
|
+
...placeholderStyle,
|
|
108
|
+
...sizingStyle,
|
|
109
|
+
...imgStyle,
|
|
110
|
+
}}
|
|
111
|
+
data-testid="img"
|
|
112
|
+
/>
|
|
113
|
+
)
|
|
114
|
+
}
|
|
115
|
+
</picture>
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
---
|
|
2
|
+
import "@mux/mux-player";
|
|
3
|
+
import type { Video } from "../../lib/types";
|
|
4
|
+
import type {
|
|
5
|
+
CmcdTypes,
|
|
6
|
+
MaxResolutionValue,
|
|
7
|
+
MinResolutionValue,
|
|
8
|
+
PlaybackTypes,
|
|
9
|
+
RenditionOrderValue,
|
|
10
|
+
StreamTypes,
|
|
11
|
+
} from "@mux/playback-core/.";
|
|
12
|
+
import type MuxPlayerElement from "@mux/mux-player";
|
|
13
|
+
import type { Tokens } from "@mux/mux-player";
|
|
14
|
+
import { useVideoPlayer } from "../../lib";
|
|
15
|
+
import { toHTMLAttrs } from "./toHtmlArgs";
|
|
16
|
+
|
|
17
|
+
type ValueOf<T> = T[keyof T];
|
|
18
|
+
|
|
19
|
+
type StyleAttribute = astroHTML.JSX.HTMLAttributes["style"];
|
|
20
|
+
|
|
21
|
+
interface Props {
|
|
22
|
+
data: Video;
|
|
23
|
+
class?: string;
|
|
24
|
+
style?: StyleAttribute;
|
|
25
|
+
|
|
26
|
+
_hlsConfig?: MuxPlayerElement["_hlsConfig"];
|
|
27
|
+
accentColor?: string;
|
|
28
|
+
audio?: boolean;
|
|
29
|
+
autoPlay?: boolean | string;
|
|
30
|
+
backwardSeekOffset?: number;
|
|
31
|
+
beaconCollectionDomain?: string;
|
|
32
|
+
crossOrigin?: string;
|
|
33
|
+
currentTime?: number;
|
|
34
|
+
customDomain?: string;
|
|
35
|
+
debug?: boolean;
|
|
36
|
+
defaultDuration?: number;
|
|
37
|
+
defaultHiddenCaptions?: boolean;
|
|
38
|
+
defaultShowRemainingTime?: boolean;
|
|
39
|
+
defaultStreamType?: ValueOf<StreamTypes>;
|
|
40
|
+
disableCookies?: boolean;
|
|
41
|
+
disablePictureInPicture?: boolean;
|
|
42
|
+
envKey?: string;
|
|
43
|
+
extraSourceParams?: Record<string, any>;
|
|
44
|
+
forwardSeekOffset?: number;
|
|
45
|
+
hotkeys?: string;
|
|
46
|
+
loop?: boolean;
|
|
47
|
+
maxResolution?: MaxResolutionValue;
|
|
48
|
+
metadata?: Record<string, any>;
|
|
49
|
+
metadataVideoId?: string;
|
|
50
|
+
metadataVideoTitle?: string;
|
|
51
|
+
metadataViewerUserId?: string;
|
|
52
|
+
minResolution?: MinResolutionValue;
|
|
53
|
+
muted?: boolean;
|
|
54
|
+
nohotkeys?: string;
|
|
55
|
+
noVolumePref?: boolean;
|
|
56
|
+
paused?: boolean;
|
|
57
|
+
placeholder?: string;
|
|
58
|
+
playbackId?: string;
|
|
59
|
+
playbackRate?: number;
|
|
60
|
+
playbackRates?: number[];
|
|
61
|
+
playerSoftwareName?: string;
|
|
62
|
+
playerSoftwareVersion?: string;
|
|
63
|
+
playsInline?: boolean;
|
|
64
|
+
poster?: string;
|
|
65
|
+
preferCmcd?: CmcdTypes;
|
|
66
|
+
preferPlayback?: PlaybackTypes;
|
|
67
|
+
preload?: string;
|
|
68
|
+
primaryColor?: string;
|
|
69
|
+
renditionOrder?: RenditionOrderValue;
|
|
70
|
+
secondaryColor?: string;
|
|
71
|
+
src?: string;
|
|
72
|
+
startTime?: number;
|
|
73
|
+
storyboardSrc?: string;
|
|
74
|
+
streamType: StreamTypes | "ll-live" | "live:dvr" | "ll-live:dvr";
|
|
75
|
+
argetLiveWindow?: number;
|
|
76
|
+
theme?: string;
|
|
77
|
+
themeProps?: Record<string, any>;
|
|
78
|
+
thumbnailTime?: number;
|
|
79
|
+
title?: string;
|
|
80
|
+
tokens?: Tokens;
|
|
81
|
+
volume?: number;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
const {
|
|
85
|
+
data,
|
|
86
|
+
disableCookies = true,
|
|
87
|
+
preload = "metadata",
|
|
88
|
+
...otherProps
|
|
89
|
+
} = Astro.props;
|
|
90
|
+
|
|
91
|
+
const computedProps = {
|
|
92
|
+
...useVideoPlayer({ data }),
|
|
93
|
+
disableCookies,
|
|
94
|
+
preload,
|
|
95
|
+
};
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
<mux-player
|
|
99
|
+
stream-type="on-demand"
|
|
100
|
+
{...toHTMLAttrs(computedProps)}
|
|
101
|
+
{...toHTMLAttrs(otherProps)}></mux-player>
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
|
|
2
|
+
type KeyTypes = string | number | symbol;
|
|
3
|
+
type Maybe<T> = T | null;
|
|
4
|
+
|
|
5
|
+
export const isNil = (x: unknown): x is null | undefined => x == undefined;
|
|
6
|
+
|
|
7
|
+
// Type Guard to determine if a given key is actually a key of some object of type T
|
|
8
|
+
export const isKeyOf = <T extends {} = any>(
|
|
9
|
+
k: KeyTypes,
|
|
10
|
+
o: Maybe<T> | undefined,
|
|
11
|
+
): k is keyof T => {
|
|
12
|
+
if (isNil(o)) return false;
|
|
13
|
+
return k in o;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const PropToAttrNameMap = {
|
|
17
|
+
crossOrigin: 'crossorigin',
|
|
18
|
+
viewBox: 'viewBox',
|
|
19
|
+
playsInline: 'playsinline',
|
|
20
|
+
autoPlay: 'autoplay',
|
|
21
|
+
playbackRate: 'playbackrate',
|
|
22
|
+
playbackRates: 'playbackrates',
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const toKebabCase = (string: string) =>
|
|
26
|
+
string.replace(/[A-Z]/g, (match) => `-${match.toLowerCase()}`);
|
|
27
|
+
|
|
28
|
+
export const toNativeAttrName = (
|
|
29
|
+
propName: string,
|
|
30
|
+
propValue: any,
|
|
31
|
+
): string | undefined => {
|
|
32
|
+
if (typeof propValue === 'boolean' && !propValue) return undefined;
|
|
33
|
+
if (isKeyOf(propName, PropToAttrNameMap)) return PropToAttrNameMap[propName];
|
|
34
|
+
if (typeof propValue === 'undefined') return undefined;
|
|
35
|
+
if (/[A-Z]/.test(propName)) return toKebabCase(propName);
|
|
36
|
+
|
|
37
|
+
return propName;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export const toNativeAttrValue = (propValue: any, propName: string) => {
|
|
41
|
+
if (Array.isArray(propValue)) return propValue.join(' ');
|
|
42
|
+
if (typeof propValue === 'boolean') return propValue;
|
|
43
|
+
|
|
44
|
+
return propValue;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export const toHTMLAttrs = (props = {}) => {
|
|
48
|
+
return Object.entries(props).reduce<{ [k: string]: string }>(
|
|
49
|
+
(transformedProps, [propName, propValue]) => {
|
|
50
|
+
const attrName = toNativeAttrName(propName, propValue);
|
|
51
|
+
|
|
52
|
+
// Prop was stripped: don't add.
|
|
53
|
+
if (!attrName) {
|
|
54
|
+
return transformedProps;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const attrValue = toNativeAttrValue(propValue, propName);
|
|
58
|
+
|
|
59
|
+
// Prop is undefined: omit it
|
|
60
|
+
if (attrValue === undefined) {
|
|
61
|
+
return transformedProps;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
transformedProps[attrName] = attrValue;
|
|
65
|
+
|
|
66
|
+
return transformedProps;
|
|
67
|
+
},
|
|
68
|
+
{},
|
|
69
|
+
);
|
|
70
|
+
};
|
package/lib/index.ts
CHANGED
package/lib/types.ts
CHANGED
|
@@ -1 +1,45 @@
|
|
|
1
|
-
|
|
1
|
+
type Maybe<T> = T | null;
|
|
2
|
+
type Possibly<T> = Maybe<T> | undefined;
|
|
3
|
+
|
|
4
|
+
export type ResponsiveImageType = {
|
|
5
|
+
/** A base64-encoded thumbnail to offer during image loading */
|
|
6
|
+
base64?: Maybe<string>;
|
|
7
|
+
/** The height of the image */
|
|
8
|
+
height?: Maybe<number>;
|
|
9
|
+
/** The width of the image */
|
|
10
|
+
width: number;
|
|
11
|
+
/** The aspect ratio (width/height) of the image */
|
|
12
|
+
aspectRatio?: number;
|
|
13
|
+
/** The HTML5 `sizes` attribute for the image */
|
|
14
|
+
sizes?: Maybe<string>;
|
|
15
|
+
/** The fallback `src` attribute for the image */
|
|
16
|
+
src?: Maybe<string>;
|
|
17
|
+
/** The HTML5 `srcSet` attribute for the image */
|
|
18
|
+
srcSet?: Maybe<string>;
|
|
19
|
+
/** The HTML5 `srcSet` attribute for the image in WebP format, for browsers that support the format */
|
|
20
|
+
webpSrcSet?: Maybe<string>;
|
|
21
|
+
/** The background color for the image placeholder */
|
|
22
|
+
bgColor?: Maybe<string>;
|
|
23
|
+
/** Alternate text (`alt`) for the image */
|
|
24
|
+
alt?: Maybe<string>;
|
|
25
|
+
/** Title attribute (`title`) for the image */
|
|
26
|
+
title?: Maybe<string>;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export type Video = {
|
|
30
|
+
/** Title attribute (`title`) for the video */
|
|
31
|
+
title?: Possibly<string>;
|
|
32
|
+
/** The height of the video */
|
|
33
|
+
height?: Possibly<number>;
|
|
34
|
+
/** The width of the video */
|
|
35
|
+
width?: Possibly<number>;
|
|
36
|
+
/** The MUX playbaack ID */
|
|
37
|
+
muxPlaybackId?: Possibly<string>;
|
|
38
|
+
/** The MUX playbaack ID */
|
|
39
|
+
playbackId?: Possibly<string>;
|
|
40
|
+
/** A data: URI containing a blurhash for the video */
|
|
41
|
+
blurUpThumb?: Possibly<string>;
|
|
42
|
+
/** Other data can be passed, but they have no effect on rendering the player */
|
|
43
|
+
// biome-ignore lint/suspicious/noExplicitAny: we intentionally want to allow to add any other value to this video object
|
|
44
|
+
[k: string]: any;
|
|
45
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { Video } from '../types';
|
|
2
|
+
|
|
3
|
+
type Maybe<T> = T | null;
|
|
4
|
+
type Possibly<T> = Maybe<T> | undefined;
|
|
5
|
+
|
|
6
|
+
const computedTitle = (title: Maybe<string> | undefined) => {
|
|
7
|
+
return title ? { title } : undefined;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
const computedPlaybackId = (
|
|
11
|
+
muxPlaybackId: Possibly<string>,
|
|
12
|
+
playbackId: Possibly<string>,
|
|
13
|
+
) => {
|
|
14
|
+
if (!(muxPlaybackId || playbackId)) return undefined;
|
|
15
|
+
|
|
16
|
+
return { playbackId: `${muxPlaybackId || playbackId}` };
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const computedStyle = (width: Possibly<number>, height: Possibly<number>) => {
|
|
20
|
+
if (!(width && height)) return undefined;
|
|
21
|
+
|
|
22
|
+
return {
|
|
23
|
+
style: {
|
|
24
|
+
aspectRatio: `${width} / ${height}`,
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const computedPlaceholder = (blurUpThumb: Possibly<string>) => {
|
|
30
|
+
return blurUpThumb ? { placeholder: blurUpThumb } : undefined;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
type UseVideoPlayerArgs = {
|
|
34
|
+
data?: Video;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export const useVideoPlayer = ({
|
|
38
|
+
data,
|
|
39
|
+
}: UseVideoPlayerArgs) => {
|
|
40
|
+
const { title, width, height, playbackId, muxPlaybackId, blurUpThumb } =
|
|
41
|
+
data || {};
|
|
42
|
+
|
|
43
|
+
if (data === undefined) return {};
|
|
44
|
+
|
|
45
|
+
return {
|
|
46
|
+
...(computedTitle(title) || {}),
|
|
47
|
+
...(computedPlaybackId(muxPlaybackId, playbackId) || {}),
|
|
48
|
+
...(computedStyle(width, height) || {}),
|
|
49
|
+
...(computedPlaceholder(blurUpThumb) || {}),
|
|
50
|
+
};
|
|
51
|
+
};
|
package/package.json
CHANGED
|
@@ -1,44 +1,56 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
2
|
+
"name": "@datocms/astro",
|
|
3
|
+
"description": "A set of components and utilities to work faster with DatoCMS in Astro projects.",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"version": "0.1.1",
|
|
6
|
+
"sideEffects": false,
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git://github.com/datocms/astro-datocms.git"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/datocms/astro-datocms",
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"author": "Stefano Verna <s.verna@datocms.com>",
|
|
14
|
+
"contributors": ["Silvano Stralla <silvano@datocms.com>"],
|
|
15
|
+
"keywords": [
|
|
16
|
+
"astro",
|
|
17
|
+
"withastro",
|
|
18
|
+
"astro-component",
|
|
19
|
+
"datocms",
|
|
20
|
+
"typescript",
|
|
21
|
+
"ui"
|
|
22
|
+
],
|
|
23
|
+
"exports": {
|
|
24
|
+
".": "./lib/index.ts",
|
|
25
|
+
"./types": "./lib/types.ts",
|
|
26
|
+
"./utils": "./lib/utils.ts"
|
|
27
|
+
},
|
|
28
|
+
"typesVersions": {
|
|
29
|
+
"*": {
|
|
30
|
+
"*": ["lib/*"]
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"engines": {
|
|
34
|
+
"node": ">=18.0.0"
|
|
35
|
+
},
|
|
36
|
+
"files": ["components", "lib"],
|
|
37
|
+
"scripts": {
|
|
38
|
+
"check": "astro check --root components"
|
|
39
|
+
},
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"@astrojs/check": "^0.9.1",
|
|
42
|
+
"typescript": "^5.5.4"
|
|
43
|
+
},
|
|
44
|
+
"peerDependencies": {
|
|
45
|
+
"@mux/mux-player": "*"
|
|
46
|
+
},
|
|
47
|
+
"peerDependenciesMeta": {
|
|
48
|
+
"@mux/mux-player": {
|
|
49
|
+
"optional": true
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"@mux/mux-player": "*",
|
|
54
|
+
"@mux/playback-core": "^0.25.1"
|
|
55
|
+
}
|
|
44
56
|
}
|
package/components/Foobar.astro
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<h1>Foobar</h1>
|